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
Display demographic info from JSON metadata
function demographicInfo(sampleId){ var metadataInfo = d3.select("#sample-metadata"); d3.json("data/samples.json").then((incomingData) => { metadataInfo.html(""); var metadataVar = incomingData.metadata; console.log(metadataVar); //filtering data with ID chosen by the user var itemsList = metadataVar.filter(sampleObject => sampleObject.id == sampleId); var list = itemsList[0]; var wfreq = list.wfreq Object.entries(list).forEach(([key, value]) => { metadataInfo.append("h5").text(`${key} : ${value}`); }); //sending washing frequiency from here to refresh the graph buildGauge(wfreq); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sampleMetaData(value){\n url = \"/metadata/\";\n Plotly.d3.json(url + value, (error, data) => {\n if (error) return console.warn(error);\n $cardText = Plotly.d3.select('#sample-metadata');\n $cardText.html('');\n Object.keys(data).forEach((key) => {\n $cardText\n .append('text')\n .html(key + \": \" + data[key])\n .append('br')\n .append('br')\n });\n });\n\n}", "function dyna_demos(id) {\n d3.json(\"data/samples.json\").then((demodata) => {\n var metadata = demodata.metadata;\n // Returns Object:Object when you use `${}`\n console.log(metadata);\n\n // Select sample-metadata section\n var demographicInfo = d3.select(\"#sample-metadata\");\n // Clear contents\n // demographicInfo.html(\"Test\");\n demographicInfo.html(\"\");\n\n var result = metadata.filter(meta => meta.id.toString() === id)[0];\n\n // 5. Display each key-value pair from the metadata JSON object somewhere on the page.\n Object.entries(result).forEach((key) => {\n demographicInfo.append(\"h6\").text(key[0] + \": \" + key[1]);\n });\n });\n}", "function demographic_info(index){\n let info_opt=d3.select(\".panel-body\");\n info_opt.html(\"\")\n d3.json(\"samples.json\").then(function(data){\n //getting the values from the data\n var metadata=Object.values(data.metadata);\n Object.entries(metadata[index]).forEach(([keys,values])=>{\n let new_opt=info_opt.append(\"p\")\n var item=`${keys} : ${values}`\n new_opt.text(item)\n })\n }) \n}", "function getDemoInfo(id) {\n // read the json file to get data\n d3.json(\"names.json\").then((data)=> {\n // get the metadata info for the demographic panel\n const metadata = data.metadata;\n \n console.log(metadata)\n \n // filter metadata info by id\n const result = metadata.filter(meta => meta.id.toString() === id)[0];\n // select demographic panel to put data\n const demographicInfo = d3.select(\"#name-metadata\");\n \n // empty the demographic info panel each time before getting new id info\n demographicInfo.html(\"\");\n \n // grab the necessary demographic data data for the id and append the info to the panel\n Object.entries(result).forEach((key) => { \n demographicInfo.append(\"h5\").text(key[0].toUpperCase() + \": \" + key[1] + \"\\n\"); \n });\n });\n }", "function demographicstuff(personId) {\n //I will need a variable and go through my jsondata and grab the metadata--ID is at [0]\n var metaData = jsonData.metadata.filter((x) => x.id === parseInt(personId))[0];\n //make sure it is grabbing what I need\n //console.log(metaData)\n //Worked with a teammate on this demo HTML part\n var demoHTML = d3.select(\"#sample-metadata\");\n demoHTML.html(\"\");\n //this is similar to the unpacking done on Day 2 of Week 15\n Object.entries(metaData).forEach(([key, value]) =>\n demoHTML.append(\"h6\").text(`${key}: ${value}`));\n}", "function getMetadata(sample) {\n d3.json('samples.json').then((data) => {\n var metadata = data.metadata;\n var sampleValues = metadata.filter(object => object.id == sample);\n var demographicInfo = sampleValues[0];\n var panel = d3.select(\"#sample-metadata\");\n panel.html(\"\");\n Object.entries(demographicInfo).forEach(([key, value]) => {\n panel.append(\"h5\").text(key.toUpperCase() + ': ' + value);\n })\n });\n}", "function buildMetadataInfo(BioSample) { \n d3.json(\"samples.json\").then((data) => {\n //console.log(data)\n \n // Get the metadata info for the demographic panel\n var metadata = data.metadata;\n //console.log(metadata)\n\n // Filter metadata info by id\n var result = metadata.filter(sampleobject => sampleobject.id == BioSample)[0];\n \n // Select demographic panel to show Demographic Info\n var demographicInfo = d3.select(\"#sample-metadata\");\n \n // Empty the demographic info panel each time before getting new id info\n demographicInfo.html(\"\");\n\n // Get demographic data for the id and append to the info to the panel\n Object.entries(result).forEach(([key, value]) => { \n demographicInfo\n .append(\"h5\")\n .text(`${key}: ${value}`); \n });\n });\n}", "function MetaData(id) {\r\n d3.json(\"Data/samples.json\").then((d)=> {\r\n \r\n // Variable for metadata\r\n var metadata = d.metadata;\r\n\r\n console.log(metadata)\r\n\r\n // // Filter metadata values by id \r\n var result = metadata.filter(meta => meta.id.toString() === id)[0];\r\n\r\n // Variable for demographic panel\r\n var demographicInfo = d3.select(\"#sample-metadata\");\r\n \r\n // Clear panel for new selection\r\n demographicInfo.html(\"\");\r\n\r\n // grab the necessary demographic data data for the id and append the info to the panel\r\n Object.entries(result).forEach((key) => { \r\n demographicInfo.append(\"h5\").text(key[0].toUpperCase() + \": \" + key[1] + \"\\n\"); \r\n });\r\n });\r\n}", "function metadata(sampleid){\n d3.json('samples.json').then((data) => {\n console.log(data);\n\n // Display the sample metadata, i.e., an individual's demographic info \n var metadata = data.metadata\n var metadatasample = metadata.filter(metaObject => metaObject.id == sampleid)[0]\n\n var div = d3.select(\"#sample-metadata\")\n div.html(\"\");\n\n // Display each key-value pair from the metadata JSON object somewhere on the page.\n Object.entries(metadatasample).forEach(([key, value])=>{\n div.append(\"p\").text(`${key.toUpperCase()}: ${value}`)\n });\n });\n}", "function getInfo(id) {\n // read the json file\n d3.json(\"samples.json\").then((data)=> {\n \n // get info for panel\n var metadata = data.metadata;\n\n console.log(metadata)\n\n // filter data\n var result = metadata.filter(meta => meta.id.toString() === id)[0];;\n\n // select demographic \n var demographicInfo = d3.select(\"#sample-metadata\");\n \n demographicInfo.html(\"\");\n\n // append the info to the panel\n Object.entries(result).forEach((key) => { \n demographicInfo.append(\"h5\").text(key[0].toUpperCase() + \": \" + key[1] + \"\\n\"); \n });\n });\n}", "function getInfo(id) {\n // Read the JSON file to get data\n d3.json(\"static/data/samples.json\").then((samplesData) => {\n // Get the data info for the demographic \n var metadata = samplesData.metadata;\n console.log(metadata)\n // filter meta data info by id\n var result = metadata.filter(meta => meta.id.toString() === id)[0];\n console.log(result);\n // select demographic panel to insert data\n var demoInfo = d3.select(\"#sample-metadata\");\n \n // Clear out the demographic for every new id input \n demoInfo.html(\"\");\n \n // Grab the necessary demographic data for the id and append the info\n Object.entries(result).forEach((key) => { \n demoInfo.append(\"h5\").text(key[0].toUpperCase() + \": \" + key[1] + \"\\n\"); \n });\n });\n}", "function get_demographics(id) {\n // read the samples.json file to get data\n d3.json(\"../data/samples.json\").then((data) => {\n\n // get the metadata info for the demographics visual on the webpage\n var metadata = data.metadata;\n\n console.log(metadata)\n\n // filter meta data info by id an indivual set of demographics matching the sample graph\n var result_id = metadata.filter(meta => meta.id.toString() === id)[0];\n\n // select demographic id in order to add the sample demographics\n var demographicInfo = d3.select(\"#sample-metadata\");\n\n // empty the demographic info each time before getting new info so that nothing is added to existing info displayed\n demographicInfo.html(\"\");\n\n // get the necessary demographic data for the id and append the info to the sample-metadata panel in index.html\n Object.entries(result_id).forEach((key_value) => {\n demographicInfo.append(\"h5\").text(key_value[0].toUpperCase() + \": \" + key_value[1] + \"\\n\");\n });\n });\n}", "function getmetadata(id) {\n d3.json('samples.json').then((data)=> {\n var metadata = data.metadata;\n console.log(metadata);\n // filter metadata by id\n var result = metadata.filter(meta => meta.id.toString() === id)[0];\n // select demographic panel to put data\n var demodata = d3.select('#sample-metadata');\n // clear the demographic panel on refresh\n demodata.html('');\n Object.entries(result).forEach((key) => { \n demodata.append('h5').text(key[0].toUpperCase() + ': ' + key[1] + '\\n'); \n });\n });\n}", "function showDemographicInfo(selectedSampleID) {\n\n console.log(\"showDemographicInfo: sample =\", selectedSampleID);\n\n d3.json(\"samples.json\").then((data) => {\n\n var demographicInfo = data.metadata;\n\n var resultArray = demographicInfo.filter(sampleObj => sampleObj.id == selectedSampleID)\n var result = resultArray[0];\n console.log(result)\n\n var panel = d3.select(\"#sample-metadata\");\n // clear panel variable on every load\n panel.html(\"\");\n\n Object.entries(result).forEach(([key, value]) => {\n var labelsToShow = `${key}: ${value}`;\n panel.append(\"h6\").text(labelsToShow);\n });\n });\n\n}", "function populateDemoInfo(patientID) {\n var demographicInfoBox = d3.select(\"#sample-metadata\");\n d3.json(\"samples.json\").then(data => {\n // console.log(data)\n })\n d3.json(\"samples.json\").then((data) => {\n var metadata = data.metadata;\n var resultArray = metadata.filter(s => s.id == patientID);\n var result = resultArray[0];\n var demographicInfoBox = d3.select(\"#sample-metadata\");\n demographicInfoBox.html(\"\");\n Object.entries(result).forEach(([key, value]) => {\n demographicInfoBox.append(\"h6\").text(`${key.toUpperCase()}: ${value}`);\n });\n });\n}", "function getSamplesInfo(id) {\n d3.json(\"samples.json\").then((d) =>{\n\n var metaData = d.metadata;\n console.log(metaData);\n\n var row = metaData.filter(m => m.id.toString() === id)[0];\n\n var demographicData = d3.select(\"#sample-metadata\");\n\n demographicData.html(\"\");\n\n Object.entries(row).forEach((key) =>{\n demographicData.append(\"h5\").text(`${key[0]}: ${key[1]} \\n`);\n })\n })\n}", "function displayMovieInfo() {\n\n // YOUR CODE GOES HERE!!! HINT: You will need to create a new div to hold the JSON.\n\n }", "function displayMetadata(value) {\n d3.json(\"samples.json\").then((data) => {\n let metadataArray = data.metadata.filter(selected => selected.id == value);\n let metadata = metadataArray[0];\n\n let wordbox = d3.select(\"#sample-metadata\");\n wordbox.html(\"\") // resets html to be blank\n // this should work just like on the ufo assignment....\n Object.entries(metadata).forEach(([key,value]) => {\n wordbox.append(\"h6\").text(`${key} : ${value}`)\n })\n })\n}", "function demographicData(selection) {\n // view data again\n d3.json('samples.json').then((data) => {\n // console.log(data)\n // all metadata\n var metaData = data.metadata\n // console.log(metaData);\n // selection metadata\n var selectionMD = metaData.filter(meta => meta.id.toString() === selection)[0];\n // console.log(selectionMD)\n // select demographic info from HTML-line31\n var demographicInfo = d3.select(\"#sample-metadata\")\n // clear out info for new id\n demographicInfo.html(\"\");\n // add to html\n Object.entries(selectionMD).forEach((key) => {\n demographicInfo.append(\"h5\").text(key[0].toUpperCase() + \": \" + key[1] + \"\\n\");\n });\n });\n\n}", "function changeMetaData(data) {\n let $panelBody = document.getElementById(\"metadata-sample\");\n // clear any existing metadata\n $panelBody.innerHTML = \"\";\n // Loop through keys in json response and create new tags for metadata\n for (let key in data) {\n h5Tag = document.createElement(\"h5\");\n metadataText = document.createTextNode(`${key}: ${data[key]}`);\n h5Tag.append(metadataText);\n $panelBody.appendChild(h5Tag);\n }\n}", "function buildMetadata(sample) {\n d3.json(\"samples.json\").then((data) => {\n var metadata = data.metadata;\n var resultArray = metadata.filter(sampleObj => sampleObj.id == sample);\n var result = resultArray[0];\n \n var PANEL = d3.select(\"#sample-metadata\");\n PANEL.html(\"\");\n //PANEL.append(\"h6\").text(result.location);\n // Skill Drill: modify buildMetadata() function to populate the \n // Demographic Info panel with the rest of the demographic data.\n Object.entries(result).forEach(([key, value]) => \n {PANEL.append(\"h6\").text(`${key.toUpperCase()}: ${value}`);\n });\n})}", "function populateDemoInfo(r){\n var demogInfo = Object.entries(r)\n console.log(demogInfo)\n const demogEntry = d3.select('#sample-metadata')\n demogEntry.html(\"\");\n for (var i = 0; i < demogInfo.length; i++){\n demogEntry.append('h6').text(demogInfo[i])\n } \n}", "function ShowMetadata(sampleId)\n{\n // name of function and parameter called\n console.log(`Calling ShowMetadata(${sampleId})`);\n\n // call data\n d3.json(\"samples.json\").then((data) => {\n\n\n var metadata = data.metadata;\n var resultArray = metadata.filter(md => md.id == sampleId);\n var result = resultArray[0];\n\n var PANEL = d3.select(\"#sample-metadata\");\n // clear old metadata\n PANEL.html(\"\");\n\n Object.entries(result).forEach(([key, value]) => {\n // flesh out with html f string\n var textToShow = `${key}: ${value}` ;\n\n PANEL.append(\"h6\").text(textToShow);\n });\n });\n}", "function DisplayMetadata(sampleId) {\n console.log(`DisplayMetadata(${sampleId})`);\n\n // Clear demographic info \n document.getElementById(\"sample-metadata\").innerHTML = \"\";\n\n d3.json(\"data/samples.json\").then(data => {\n\n var metaData = data.metadata;\n var resultArray = metaData.filter(s => s.id == sampleId);\n var result = resultArray[0];\n\n // Assigning the information to extract from the dataset\n var id = result.id;\n var ethnicity = result.ethnicity;\n var gender = result.gender;\n var age = result.age;\n var location = result.location;\n var bbtype = result.bbtype;\n var wfreq = result.wfreq;\n var info = [id,ethnicity,gender,age,location,bbtype,wfreq];\n\n // Append new data to a list within the demographic box\n var ul = d3.select(\"#sample-metadata\").append(\"ul\");\n ul.append(\"li\").text(`id: ${id}`);\n ul.append(\"li\").text(`ethnicity: ${ethnicity}`);\n ul.append(\"li\").text(`gender: ${gender}`);\n ul.append(\"li\").text(`age: ${age}`);\n ul.append(\"li\").text(`location: ${location}`);\n ul.append(\"li\").text(`bbtype: ${bbtype}`);\n ul.append(\"li\").text(`wfreq: ${wfreq}`);\n\n })\n}", "function Meta(metaId) {\n // Use d3 to connect to the json\n d3.json(sdata).then((data) => {\n MetaHuman = data.metadata\n var fdata = MetaHuman.filter(object => object.id == metaId)[0];\n // Connect to the sample-metadata id on the html through a variable\n var metapanel = d3.select(\"#sample-metadata\")\n\n // Append each key value pair the object.entries code\n Object.entries(fdata).forEach(([key, value]) => {\n metapanel.append(\"metapanel\").text(`${key}: ${value}`)\n });\n });\n}", "function displayResults(json) {\n let photographer = json;\n let heading = document.createElement('h1');\n section.appendChild(heading);\n heading.textContent = photographer;\n }", "function populateDemographicInfo(selectedPatientID) {\n d3.json(\"samples.json\").then(data => {\n var metadata = data.metadata;\n var filteredmetadata = metadata.filter(patient => patient.id == selectedPatientID)[0];\n var panel = d3.select(\"#sample-metadata\");\n panel.html(\"\");\n Object.entries(filteredmetadata).forEach(([key, value]) => {\n panel.append(\"h5\").text(`${key}: ${value}`);\n });\n })\n}", "function populatedemographics(id) {\r\n\r\n //filter data with id, select the demographic info with appropriate id\r\n \r\n var filterMetaData= jsonData.metadata.filter(meta => meta.id.toString() === id)[0];\r\n \r\n // select the panel to put data\r\n var demographicInfo = d3.select(\"#sample-metadata\");\r\n \r\n // empty the demographic info panel each time before getting new id info\r\n \r\n demographicInfo.html(\"\");\r\n\r\n // grab the necessary demographic data data for the id and append the info to the panel\r\n Object.entries(filterMetaData).forEach((key) => { \r\n demographicInfo.append(\"h5\").text(key[0].toUpperCase() + \": \" + key[1] + \"\\n\");\r\n });\r\n }", "function metadata(meta) {\n d3.json(\"samples.json\").then((data) => {\n console.log(data);\n //get data for samples and metadata\n //var samples = data.samples;\n var metadata = data.metadata\n //filter metadata by ID\n var output = metadata.filter(results => results.id == meta);\n //create an initial output to default the first option\n var initialoutput = output[0];\n //from the html, we are told to find the panel w/ id #sample-metadata\n var PANEL = d3.select(\"#sample-metadata\");\n //Clear existing outputs. Something I became very aware of during project 2 and still managed to forget.\n PANEL.html(\"\");\n Object.entries(initialoutput).forEach(([key, value]) => {\n PANEL.append(\"h6\").text(`${key.toUpperCase()}: ${value}`);\n })\n \n });\n \n}", "function demoInfo(id) {\r\n d3.json(\"data/cardata.json\").then((data)=> {\r\n //call in metadata to demographic panel//\r\n var car_data = data.cars;\r\n var result = car_data.filter(car => car.index_col.toString() === id)[0]\r\n\r\n console.log(`test ${result}`)\r\n\r\n //select demographic panel from html//\r\n var features = d3.select(\"#cardata-cars\");\r\n //empty the demographic panel for new data//\r\n features.html(\"\");\r\n Object.entries(result).forEach((key) => {\r\n features.append(\"h5\").text(key[0]+ \": \" + key[1]);\r\n });\r\n });\r\n}", "function builtDemdata(sample){\n d3.json(\"../data/samples.json\").then(function(data){\n var valueMeta=data.metadata;\n var resultArray=valueMeta.filter(object => object.id == sample);\n var result = resultArray[0];\n\n// Select html location for demographic information\n var selectDem = d3.select('#sample-metadata');\n selectDem.html(\" \");\n\n Object.entries(result).forEach(([key,value])=>{\n selectDem.append(\"h6\").text(`${key.toUpperCase()}: ${value}`);\n });\n});\n}", "function createMetaData(sample) {\n d3.json(\"samples.json\").then(function(data) {\n let metadata = data.metadata;\n let resultsArray = metadata.filter(function(data) {\n return data.id == sample;\n });\n let result = resultsArray[0];\n let panel = d3.select(\"#sample-metadata\");\n\n // reset exisisting metadata\n panel.html(\"\");\n \n // // loop through each object and append data to panel\n Object.entries(result).forEach(function([key, value]) {\n panel.append(\"h6\").text(`${key.toUpperCase()}: ${value}`)\n }); \n });\n}", "function demographicPanel(id) {\n \n d3.json(\"samples.json\").then((importedData) => { \n console.log(importedData);\n var metadata = importedData.metadata;\n // console.log(metadata);\n // Filter the data for the object with the desired sample number\n var filteredData = metadata.filter(m => m.id == id);\n var object = filteredData[0];\n console.log(object);\n // Use d3 to select the panel with id of `#sample-metadata`\n var demoPanel = d3.select(\"#sample-metadata\");\n // Use `.html(\"\") to clear any existing metadata\n demoPanel.html(\"\");\n\n Object.entries(object).forEach(([key, value]) => {\n demoPanel.append(\"h5\").text(`${key.toUpperCase()}: ${value}`);\n });\n \n });\n}", "function infoCard(id){\n d3.json(\"./samples.json\").then((data) =>{\n\n //grab infr from samples\n var metadata = data.metadata;\n\n //use selected id to filter data info card\n var filtered = metadata.filter(info => info.id.toString() === id)[0];\n\n var demographicInfo = d3.select('#sample-metadata');\n\n //reset the card for new info \n demographicInfo.html(\"\");\n\n //append new info based on selected id and write it to the page.\n Object.entries(filtered).forEach((key) =>{\n demographicInfo.append('h5').text(key[0].toString() + \":\" +key[1] + \"\\n\");\n });\n \n });\n}", "function buildDemo(sample_id) {\n d3.json(\"samples.json\").then(function(data){\n // Filter the metadata for id, convert id to string\n var metadataID = data.metadata.filter(md => md.id.toString() === sample_id)[0];\n console.log(metadataID)\n // Get a reference for the demographic information\n var infoData = d3.select(\"#sample-metadata\");\n // Clear the demographic display, with each new selection from dropdown \n infoData.html(\"\");\n // Loop through the metadataIDs and append the key, value pairs \n Object.entries(metadataID).forEach((key) => {\n infoData.append(\"p\").text(key[0] + \": \" + key[1]);\n }); \n })}", "function displayResult1 () {\n if (request1.readyState == 4) {\n /*responseText used to get response from server in string format.\n String format is not easily readable, so JSON.parse() method is used to convert JSON text to JS object which is easy to parse*/\n var jsonI = JSON.parse(request1.responseText); \n document.getElementById(\"outputIn\").innerHTML = jsonI.artist.name;\n document.getElementById(\"outputIs\").innerHTML = jsonI.artist.bio.summary;\n document.getElementById(\"outputIu\").innerHTML = jsonI.artist.url;\n document.getElementById(\"outputIp\").innerHTML = \"<img src = \"+jsonI.artist.image[1]['#text']+\"></img>\";\n }\n}", "function displayInfo(feature) {\r\n const title = feature.properties.title;\r\n var imageUrl = feature.properties.icon.slice(3);\r\n\r\n toggleSideBar(\"open\");\r\n infoContainer.innerHTML = \"\";\r\n\r\n let headerElement = document.createElement(\"h1\");\r\n headerElement.className = \"title\";\r\n headerElement.textContent = title;\r\n\r\n let imgElement = document.createElement(\"img\");\r\n imgElement.src = imageUrl;\r\n imgElement.className = \"img-description\";\r\n\r\n infoContainer.appendChild(headerElement);\r\n infoContainer.appendChild(imgElement);\r\n}", "function buildMetadata(sample) {\n\n \n // Read the json data\n d3.json(\"samples.json\").then(function (data) {\n \n let metadata = data.metadata;\n \n console.log(metadata);\n \n let resultArray = metadata.filter(sampleObject => sampleObject.id == sample);\n\n let result = resultArray[0];\n\n let demoTable = d3.select(\"#sample-metadata\");\n\n demoTable.html(\"\");\n\n Object.entries(result).forEach(([key, value]) =>{\n demoTable.append(\"p\").text(`${key} : ${value}`);\n }); \n\n}); \n}", "function firstMeta(sample) {\r\n var id = metadata[0].id;\r\n var ethnicity = metadata[0].ethnicity;\r\n var gender = metadata[0].gender;\r\n var age = metadata[0].age;\r\n var location = metadata[0].location;\r\n var list = d3.select(\"#sample-metadata\");\r\n// List Generator with metadata extracted\r\n list.html(\"\");\r\n list.html(`id: ${id}, ethnicity: ${ethnicity}, Gender: ${gender}, Age: ${age}, Location: ${location}`);\r\n}", "function loadInfo() {\r\n\t\tvar info = JSON.parse(this.responseText);\r\n\t\tdocument.getElementById(\"title\").innerHTML = info.title;\r\n\t\tdocument.getElementById(\"author\").innerHTML = info.author;\r\n\t\tdocument.getElementById(\"stars\").innerHTML = info.stars;\r\n\t}", "function buildMetadata(singleSample) {\n d3.json(\"data/samples.json\").then((data) => {\n var result = data.metadata;\n var sampleResultFilter = result.filter(d => d.id == singleSample);\n var sampleResult = sampleResultFilter[0];\n console.log(sampleResult);\n\n // clear html from #sample-metadata html\n // htmlMetadata = d3.select(\"#sample-metadata\");\n // htmlMetadata.html(\"\");\n\n // Object.entries(sampleResult).forEach(([key, value]) => {\n // htmlMetadata.append(\"p\").text(`${key}: ${value}`);\n // });\n });\n}", "function buildMetadata (newSelection) {\n d3.json(\"samples.json\").then(data => {\n var metadata = data.metadata; \n var filtered = metadata.filter(row => row.id == newSelection)[0];\n var demoInfo = d3.select(\"#sample-metadata\");\n demoInfo.html(\"\");\n Object.entries(filtered).forEach(([key,value]) => {\n demoInfo.append(\"h6\").text(`${key}: ${value}`);\n });\n });\n}", "function metadataBuilder(sample) {\n d3.json(\"samples.json\").then((data) => {\n var metadata = data.metadata; \n var sampleArray = metadata.filter(sampleObject =>\n sampleObject.id == sample);\n var result = sampleArray[0]\n var panel = d3.select(\"#sample-metadata\");\n panel.html(\"\");\n Object.entries(result).forEach(([key, value]) => {\n panel.append(\"h6\").text(`${key}: ${value}`);\n });\n \n })\n }", "function getMetadata(metadata) {\n\n var metadataHtml=d3.select(\"#sample-metadata\");\n // clean metadata tabel if data exists\n metadataHtml.html(\"\");\n // and append current sample metadata to html\n Object.entries(metadata).forEach(([key, value]) => metadataHtml.append(\"p\").text(`${key}: ${value}`)\n );\n}", "function displaySelected() {\n console.log(\"response text\", this.responseText);\n var response = JSON.parse( this.responseText );\n console.log( response );\n\n // DOM final results\n var displayAt = document.querySelector('#show-detail');\n\n var title = document.createElement(\"h1\");\n title.innerHTML = response.name;\n displayAt.appendChild(title);\n\n var image = document.createElement(\"img\");\n image.src = response.image.medium;\n displayAt.appendChild(image);\n\n var summary = document.createElement(\"p\");\n summary.innerHTML = response.summary;\n displayAt.appendChild(summary);\n\n}", "function parseJsonFeatured() {\n var results = metadata;\n\n // can't bind elements to carousel due to possible bug\n for (var i=0;i<4;i++)\n {\n var shelf = getActiveDocument().getElementsByTagName(\"shelf\").item(i)\n var section = shelf.getElementsByTagName(\"section\").item(0)\n \n //create an empty data item for the section\n section.dataItem = new DataItem()\n \n //create data items from objects\n let newItems = results.map((result) => {\n let objectItem = new DataItem(result.type, result.ID);\n objectItem.url = result.url;\n objectItem.title = result.title;\n objectItem.onselect = result.onselect;\n objectItem.watchtime = result.watchtime;\n return objectItem;\n });\n \n //add the data items to the section's data item; 'images' relates to the binding name in the protoype where items:{images} is all of the newItems being added to the sections' data item;\n section.dataItem.setPropertyPath(\"images\", newItems)\n }\n}", "function updateDemographics(demo){\n // select sample-metadata\n var selectDemo = d3.select(\"#sample-metadata\");\n //console.log(selectDemo)\n\n //clear tag\n selectDemo.html(\"\");\n\n // get data and append it to H5 header \n //Simplify the code \n Object.entries(demo[0]).forEach((key) => { \n selectDemo.append(\"h5\").text(key[0].toUpperCase() + \": \" + key[1] + \"\\n\"); \n });\n}", "function drawInfo(object) {\n\n if (infoContainer.hasChildNodes()) {\n infoContainer.removeChild(infoContainer.firstChild);\n }\n if (object !== \"Metadata not available.\") {\n const infoList = document.createElement('ul');\n let item1 = document.createElement('li');\n let item2 = document.createElement('li');\n item1.textContent = `Date/Time of Photo: ${object.time}`;\n item2.textContent = `Camera: ${object.camera}`;\n infoList.appendChild(item1);\n infoList.appendChild(item2);\n infoContainer.appendChild(infoList);\n const infoList = document.createElement('ul');\n let item1 = document.createElement('li');\n item1.textContent = object;\n infoList.appendChild(item1);\n infoContainer.appendChild(infoList);\n }\n}", "displayInfo() {\n let imageContainer = document.querySelector(\"#image-container\");\n let thumbnailEl = document.createElement(\"img\");\n thumbnailEl.setAttribute(\"src\", this.thumbnailImg)\n imageContainer.append(thumbnailEl);\n let artistNameDiv = document.querySelector(\"#artist-name\");\n artistNameDiv.textContent = this.name;\n let artistInfoDiv = document.querySelector(\"#profile-info\");\n artistInfoDiv.textContent = this.profileInfo;\n\n }", "function renderInfo(data){\n\n console.log(data);\n\n //display title\n title.innerHTML = data.name;\n\n //display image\n image.src = data.image.url;\n image.alt=\"Image not found\";\n \n //display favourite\n if(favList!==null && favList.includes(id)){\n fav.innerHTML = '<i id=\"heart-icon\" class=\"fas fa-heart\"></i>';\n }\n else{\n fav.innerHTML = '<i id=\"heart-icon\" class=\"far fa-heart\"></i>';\n }\n\n //display powerstats\n for(var i in data.powerstats){\n document.getElementById(i).innerHTML = data.powerstats[i];\n }\n\n //display biography\n for(var i in data.biography){\n document.getElementById(i).innerHTML = data.biography[i];\n }\n\n //display appearance\n for(var i in data.appearance){\n document.getElementById(i).innerHTML = data.appearance[i];\n }\n\n //display work\n for(var i in data.work){\n document.getElementById(i).innerHTML = data.work[i];\n }\n\n //display connections\n for(var i in data.connections){\n document.getElementById(i).innerHTML = data.connections[i];\n }\n}", "function getMetaData() {\n jQuery.ajax({\n headers: {\n \"Accept\": \"application/json\"\n },\n url: METADATA_URL,\n contentType: 'text/plain',\n dataType: 'text',\n success: function (data) {\n data = jQuery.parseJSON(data);\n setMeta(data);\n chat();\n },\n error: function (jqXHR, textStatus) {\n chat();\n }\n });\n }", "function meta(sampleid) {\n //1.Use the D3 library to read in samples.json.\n d3.json(\"samples.json\").then(data => {\n var meta = data.metadata;\n var metaid = meta.filter(beta => beta.id == sampleid)\n var selector = d3.select(\"#sample-metadata\");\n //console.log(metadata)\n \n //clear the data upon selection\n selector.html(\"\");\n Object.entries(metaid[0]).forEach(([key, value]) => {\n selector.append(\"h6\").text(`${key}: ${value}`);\n });\n });\n}// meta(id) ", "function buildMetadata(sample) {\n // retrieve data from the same source\n d3.json(\"samples.json\").then((data) => {\n var metadata = data.metadata;\n\n // filter selected id from optionChanged\n // retrieve data from the array\n var resultArray = metadata.filter(sampleObj => sampleObj.id == sample);\n var result = resultArray[0];\n\n // select area to put relative info\n var PANEL = d3.select(\"#sample-metadata\");\n // ensures that the contents of the panel are cleared\n PANEL.html(\"\");\n\n // iterate through each pair of data and display them\n Object.entries(result).forEach(([key, value]) => {\n PANEL.append(\"h6\").text(`${key.toUpperCase()}: ${value}`);\n });\n });\n}", "function getInfo() {\n // read the json file to get data\n var selector = d3.select(\"#selDataset\");\n\n d3.json(\"samples.json\").then((data)=> {\n \n //Get the metadata info for the demographic panel\n var sampleNames = data.names;\n\n //console.log(metadata)\n\n //Filter metadata info by id\n sampleNames.forEach((sample)=>{\n selector\n .append(\"option\")\n .text(sample)\n .property(\"value\", sample);\n });\n\n var firstvalue = sampleNames[0];\n buildCharts(firstvalue);\n buildData(firstvalue);\n });\n \n}", "function metaOutput(data) {\n if (data !== \"\") {\n //search metadata from response\n var search_title = data.title;\n var search_link = data.link;\n //build heading output for metadata heading\n var metaHeading = '<h6>'+search_title+' | <a href=\"'+search_link+'\">Flickr</a></h6>';\n //render metadata to contextual-output\n $(\".contextual-output\").prepend(metaHeading);\n }\n }", "function useApiData(data) {document.querySelector(\"#content\").innerHTML = `\n<img src=\"${data.hits[0]recipe.image}\">\n<h5>${data.hits[0].recipe.label}</h5>\n<p>Source: ${data.hits[0].recipe.source}</p>\n<a href=\"${data.hits[0].recipe.url}\">Go conferir</a>\n`\n}", "function populatePokemanInfo(data){\n let html = \"<h2>\" + data.name + \"</h2><img src=http://pokeapi.co/media/img/\" + data.national_id + \".png><h4>Types</h4><ul>\"; //breaking to iterate through types\n for (let i = 0; i < data.types.length; i++){\n html += \"<li>\" + data.types[i].name + \"</li>\";\n }\n html += \"</ul><h4>Height</h4><p>\" + data.height + \"</p><h4>Weight</h4><p>\" + data.weight +\"</p>\";\n $(\".pokeman_info\").html(html);\n }", "function updateDemoInfo(metadataItem) {\n var dataTable = d3.select(\"#sample-metadata\");\n dataTable.html(\"\");\n Object.keys(metadataItem).forEach(function (key) {\n dataTable.append('li').text(`${key}: ${metadataItem[key]}`)\n });\n}", "function parseFeatureInfoJSON(info, idTxt, title) {\n info = JSON.parse(info);\n if (info.features.length > 0) { // check if info has any content, if so shows popup\n \n var infoAux = '<div class=\"featureInfo\" id=\"featureInfoPopup' + idTxt + '\">';\n infoAux += '<div class=\"featureGroup\">';\n infoAux += '<div style=\"padding:1em\" class=\"individualFeature\">';\n infoAux += '<h4 style=\"border-top:1px solid gray;text-decoration:underline;margin:1em 0\">' + title + '</h4>';\n infoAux += '<ul>';\n \n for (i in info.features) {\n Object.keys(info.features[i].properties).forEach(function(k){\n if (k != 'bbox') { //Do not show bbox property\n infoAux += '<li>';\n infoAux += '<b>' + ucwords(k.replace(/_/g, ' ')) + ':</b>';\n if (info.features[i].properties[k] != null) {\n infoAux += ' ' + info.features[i].properties[k];\n }\n infoAux += '<li>';\n }\n });\n }\n \n infoAux += '</ul>';\n //infoAux += '<img style=\"height:40px\" src=\"http://ventas.ign.gob.ar/image/data/general/logoAzul.png\"/>';\n infoAux += '</div></div></div>';\n \n return infoAux;\n }\n \n return '';\n }", "showMetadata(){\n document.getElementById('trackInfo').innerHTML = \n '<h3 class=\"trackMetaSnippet artistTitle\">'+this.currentTrackMetadata.tags.artist+'</h3>'+\n '<h3 class=\"trackMetaSnippet trackTitle\">'+this.currentTrackMetadata.tags.title +'</h3>'+\n '<h3 class=\"trackMetaSnippet albumTitle\">'+this.currentTrackMetadata.tags.album+'</h3>';\n }", "function listMetadata(name){\n console.log(\"in listMetadata\");\n if (name != null) {\n document.getElementById(\"metadata_holder\").style.display = \"block\";\n document.getElementById(\"type_holder\").style.display = \"none\";\n console.log(\" model to display is \" + name);\n getMetadata(master_data, name); // extract the metadata for that model\n openOverview();\n }\n return false;\n}", "function ShowMetadata(sampleId){\n console.log(`ShowMetadata for ID: (${sampleId})`);\n \n d3.json(\"samples.json\").then(data => {\n\n var metadata = data.metadata;\n console.log(\"Here's all the metadata:\");\n console.log(metadata);\n var testSubjectMetadata = metadata.filter(s => s.id == sampleId); \n console.log(`Test subject ${sampleId}'s demographic information (metadata) as the object itself is:`);\n console.log(testSubjectMetadata);\n\n // Now how to put the JavaScript variable testSubjectMetadata into the HTML in div id=\"sample-metadata\" class=\"panel-body\"\n // metadata stores the following for each test subject:\n // id, wfreq, bbtype (\"I\" or \"O\"), location, age, gender, ethnicity\n\n MetadataToHTML =\n \"ID: \" + testSubjectMetadata[0].id + \"<br>\" +\n \"reports washing belly button \" + testSubjectMetadata[0].wfreq + \" times per week\" + \"<br>\" +\n \"innie or outie (I or O): \" + testSubjectMetadata[0].bbtype + \"<br>\" +\n \"age: \" + testSubjectMetadata[0].age + \"<br>\" +\n \"gender: \" + testSubjectMetadata[0].gender + \"<br>\" +\n \"location: \" + testSubjectMetadata[0].location + \"<br>\" +\n \"ethnicity: \" + testSubjectMetadata[0].ethnicity;\n\n document.getElementById(\"sample-metadata\").innerHTML = MetadataToHTML;\n console.log(MetadataToHTML);\n\n });\n\n}", "function loadJsonData(moreInfoElement) {\n $.ajax({\n url: 'assets/data/latest.json',\n type: 'get',\n dataType : 'json',\n success: function(data) {\n $.each(data, function(key, item) {\n moreInfoElement.text(item.Description);\n });\n },\n error: function(e) {\n console.log('error message'+e.message);\n }\n });\n}", "function updatemetadata(sample) {\n d3.json(\"data/samples.json\").then((data) => {\n var metadata = data.metadata;\n var filterArray = metadata.filter(sampleObject => sampleObject.id == sample);\n var result = filterArray[0];\n var metaPanel = d3.select(\"#sample-metadata\");\n metaPanel.html(\"\");\n Object.entries(result).forEach(([key, value]) => {\n metaPanel.append(\"h6\").text(`${key.toUpperCase()}: ${value}`)\n })\n \n });\n }", "function buildMetadata(sample) {\n d3.json(\"samples.json\").then((data) => {\n var metadata = data.metadata;\n console.log(metadata);\n\n var resultsArray = metadata.filter(data => data.id == sample);\n var result = resultsArray[0];\n var PANEL = d3.select(\"#sample-metadata\");\n\n // Clear the existing data\n PANEL.html(\"\");\n\n Object.entries(result).forEach(([key, value]) => {\n PANEL.append(\"h6\").text(`${key.toUpperCase()}: ${value}`);\n });\n\n // Bonus: Build a Gauge Chart\n buildGauge(result.wfreq);\n });\n}", "function setDescription(json) {\n var description = JSON.stringify(json.weather[0].description);\n $('.description').html(description.substr(1, description.length - 2));\n}", "function Metadata({name, metadata}: {name: string, metadata: Object}) {\n const classes = useStyles();\n return (\n <Grid container alignContent=\"flex-start\" spacing={1}>\n <Grid item>\n <Typography\n variant=\"subtitle2\"\n color=\"textSecondary\"\n style={{wordBreak: 'break-all'}}\n paragraph>\n {name}\n </Typography>\n </Grid>\n {metadata != null &&\n Object.keys(metadata).map(key => {\n const val = metadata[key];\n const isObject = typeof val === 'object';\n return (\n <Grid item key={key} container xs={12} alignItems=\"flex-start\">\n <Grid item xs={12}>\n <Typography variant=\"body2\" color=\"textSecondary\">\n {key}\n </Typography>\n </Grid>\n <Grid item classes={{root: isObject ? classes.objectValue : ''}}>\n {typeof val === 'object' ? (\n <pre data-testid=\"metadata-json\">\n {JSON.stringify(val, null, 2)}\n </pre>\n ) : (\n <Typography>{val}</Typography>\n )}\n </Grid>\n </Grid>\n );\n })}\n </Grid>\n );\n}", "function displayArtMet(data) {\n const art = document.querySelector(\".art-div\");\n\n const artLink = document.createElement(\"a\");\n const artImage = document.createElement(\"img\");\n\n if (data.primaryImage === \"\") {\n artImage.style.display = \"none\";\n } else {\n artImage.src = data.primaryImage;\n artImage.alt = data.objectName;\n artLink.appendChild(artImage);\n artLink.href= data.objectURL;\n artLink.setAttribute(\"target\", \"_blank\");\n artLink.classList.add(\"flex-item\");\n art.appendChild(artLink);\n };\n}", "function detail_result(json_parse) {\n\n document.getElementsByClassName('panel')[0].className = \"panel panel-default show\"\n document.getElementsByClassName('panel-heading')[0].innerHTML = '<strong>' + json_parse.Title + '</strong><br/>(' + json_parse.Released + ')'\n document.getElementsByClassName('panel-body')[0].innerHTML = '<div class=\"detail_holder\">' +\n '<div><strong>Genre:</strong>&nbsp;&nbsp;' + json_parse.Genre + '</div>' +\n '<div><strong>Starring:</strong>&nbsp;&nbsp;' + json_parse.Actors + '</div>' +\n '<div>' + json_parse.Plot + '</div>' +\n '</div>'\n \n \n \n}", "function displayJSONwithMap() {\n\tbio.display();\n\twork.display();\n\tprojects.display();\n\teducation.display();\n\t\n\t// insert the Google may that was provided by Cameron and James.\n\t$(\"#mapDiv\").append(googleMap);\n\t\n\t// insert a class name so sections can be formatted \n\t$(\"#main\").children(\"div\").toggleClass(\"main-section\");\n\t// don't put the \"main-section\" class name on all divs!\n\t$(\"#header\").toggleClass(\"main-section\");\n\t// acutally I'm not using this div, so lose it.\n\t$(\"#header\").next(\"div\").remove();\n}", "function displayOkitJson() {\n // $(jqId(JSON_MODEL_PANEL)).html('<pre><code>' + JSON.stringify(okitJsonModel, null, 2) + '</code></pre>');\n // $(jqId(JSON_VIEW_PANEL)).html('<pre><code>' + JSON.stringify(okitJsonView, null, 2) + '</code></pre>');\n // $(jqId(JSON_REGION_PANEL)).html('<pre><code>' + JSON.stringify(regionOkitJson, null, 2) + '</code></pre>');\n}", "function table(metadata) {\n // select demographic info object to put data and empty current selection\n var demoinfo = d3.select(\"#sample-metadata\");\n demoinfo.html(\"\");\n // add demographic information from the new sample\n Object.entries(metadata).forEach(([key, value]) => {\n demoinfo.append(\"p\").text(`${key}:${value}`);\n });\n}", "function extras(json) {\r\n\t\tlet link1 = document.createElement(\"a\");\r\n\t\tlet link2 = document.createElement(\"a\");\r\n\t\tdocument.getElementById(\"extra\").innerHTML = \"<span>For more information\"+\r\n\t\t\t\" if applicable, click below: </span></br>\";\r\n\r\n\t\tif(json.meals[0].strSource !=null) {\r\n\t\t\tlink1.innerHTML = \"Source </br>\";\r\n\t\t\tlink1.href = json.meals[0].strSource;\r\n\t\t}\r\n\t\tif(json.meals[0].strYoutube != null) {\r\n\t\t\tlink2.innerHTML = \"Youtube\";\r\n\t\t\tlink2.href = json.meals[0].strYoutube;\r\n\t\t}\r\n\t\tdocument.getElementById(\"extra\").appendChild(link1);\r\n\t\tdocument.getElementById(\"extra\").appendChild(link2);\r\n\t}", "function metadata(properties) {\n\n //handle categories\n //TODO: not sure what is desired to show up here so showing both cats & subcats for now\n var categorylist = [];\n var subcategorylist = [];\n for(var n = 0; n < properties.category.length; n++) {\n var cat = properties.category[n];\n if (cat.parent == 0) {\n categorylist.push(cat.name);\n } else {\n subcategorylist.push(cat.name);\n }\n }\n properties.subcategorylist = subcategorylist.join(', ') ;\n properties.categorylist = categorylist.join(', ');\n\n //These are the properties we want to show, in order\n var useProps = ['placename', 'categorylist', 'subcategorylist', 'description', 'website', 'access', 'hours'];\n var info = \"\";\n for (var i=0; i<useProps.length; i++) {\n var prop = useProps[i];\n if (properties[prop] && properties[prop].length > 0) {\n if (prop == 'website') {\n info += '<p class=\"' + prop + '\"><a href=\"' + properties[prop] + '\" target=\"_blank\">Website</a></p>';\n } else {\n info += '<p class=\"' + prop + '\">' + properties[prop] + '</p>';\n }\n }\n }\n return info;\n }", "function displayTvShow() {\n $.ajax({\n url: `http://api.tvmaze.com/shows/${$show_id}`,\n type: \"GET\",\n dataType: \"json\",\n }).done(function (response) {\n\n $show_title.append(`<p>${response.name} &#11088; ${$show_rating}</p>`);\n $show_img.append(`<img src='${response.image.original}' class='img-fluid' alt='tvShow'>`);\n $show_info.append(response.summary);\n\n });\n\n}", "function buildDemographics(id_idx) {\n let meta = samples_data.metadata[id_idx];\n let demo = [];\n // Capitalize the first letter of the label text\n // becaue it displays ugly if you don't.\n for (let key in meta) {\n let label = key[0].toUpperCase() + key.slice(1);\n let value = meta[key];\n let lbl = `${label}: ${value}`;\n demo.push(lbl);\n };\n console.log(demo);\n\n // Use d3 to create the table dynamically.\n d3.select('#sample-metadata').selectAll('*').remove();\n let ul = d3.select('#sample-metadata').append(\"ul\");\n ul.style('marginLeft' , '0px')\n ul.selectAll('li')\n .data(demo)\n .enter()\n .append('li')\n .text(d => d)\n .style('list-style', 'none')\n .style('marginLeft' , '0px')\n}", "function showInfo() {\n let url = '';\n\n if (this.dataset.type) {\n url = `https://api.themoviedb.org/3/${this.dataset.type}/${this.dataset.id}?api_key=0e66e3cd5d8c014d6e406d8aba055a88&language=ru-RU`;\n } else {\n movies.innerHTML = '<h2 class=\"text-danger\">Произошла ошибка. Повторите позже</h2>';\n }\n\n fetch(url)\n .then(response => {\n if (response.status !== 200) {\n return Promise.reject(new Error(response.status));\n }\n return response.json();\n })\n .then(output => {\n console.log(output);\n movies.innerHTML = `\n <div class=\"col-4\">\n <img src=\"${(output.poster_path) ? `${img_url}${output.poster_path}` : 'img/no_image.png'}\" alt=\"${output.name || output.title}\">\n ${(output.homepage) ? `<p><a href=\"${output.homepage}\" target=\"_blank\">Официальная страница</a></p>` : ''}\n ${(output.imdb_id) ? `<p><a href=\"https://imdb.com/title/${output.imdb_id}\" target=\"_blank\">Сcылка на imdb.com</a></p>` : ''}\n </div>\n <div class=\"col-8\">\n <h3>${output.name || output.title}</h3>\n <p>Рейтинг: ${output.vote_average}</p>\n <p>Статус: ${output.status}</p>\n <p>Премьера: ${output.release_date || output.first_air_date}</p>\n ${(output.last_episode_to_air) ? `<p>Вышло сезонов: ${output.number_of_seasons}, серий: ${output.number_of_episodes}</p>` : ''}\n <p>${output.overview}</p>\n <p>Жанр: ${output.genres.map(item => item.name)}</p>\n <div class=\"row video\"></div>\n </div>\n `;\n getVideo(this.dataset.type, this.dataset.id);\n })\n .catch(reason => {\n movies.innerText = 'Что-то пошло не так...';\n console.error('error', reason);\n });\n}", "function demographicData(name){\r\n const metaData = jsonData.metadata.filter(metadata => metadata.id == name)[0];\r\n console.log(metaData)\r\n \r\n //finding the element by ID in the HTML\r\n var selector = d3.select(\"#sample-metadata\")\r\n selector.html('')\r\n Object.entries(metaData).forEach(([key, value])=>{\r\n var text = `${key}: ${value}`\r\n selector.append('p').text(text)\r\n })\r\n var gaugeData = [\r\n {\r\n domain: { x: [0, 1], y: [0, 1] },\r\n value: metaData.wfreq,\r\n title: { text: \"Wash Frequency\" },\r\n type: \"indicator\",\r\n mode: \"gauge+number\",\r\n gauge: {\r\n axis: { range: [null, 10] },\r\n bar: { color: \"black\" },\r\n steps: [\r\n { range: [0, 2], color: \"red\" },\r\n { range: [2, 3], color: \"yellow\" },\r\n { range: [3, 5], color: \"lightgreen\" },\r\n { range: [5, 10], color: \"darkgreen\" }\r\n\r\n ],\r\n \r\n }\r\n }\r\n ];\r\n \r\n var layout = { width: 600, height: 450, margin: { t: 0, b: 0 } };\r\n Plotly.newPlot('gauge', gaugeData, layout);\r\n}", "gatherInfo(info, content) {\n info.spotify_artist_id = content.artists ? content.artists[0].id : content.id;\n info.spotify_album_id = content.album ? content.album.id : content.id;\n info.spotify_song_id = content.id;\n info.spotify_artist_url = content.artists ? content.artists[0].external_urls.spotify : content.external_urls.spotify;\n info.spotify_album_url = content.album ? content.album.external_urls.spotify : content.external_urls.spotify;\n info.spotify_song_url = content.external_urls.spotify;\n info.artist_image = content.artists ? null : module.exports.selectImage(content.images); // we'll need to ge the image some other way.\n info.album_image = module.exports.selectImage(content.album ? content.album.images : content.images);\n info.song_image = info.album_image;\n return info;\n }", "function gotJSONNowWhat() {\n\t\tshowPhotos(oReq);\n\t }", "function displayDoctors() {\n\n // Reading Doctors file.\n var d = readFromJson('doc');\n\n // For loop to run till all the doctor's are printed.\n for (var i = 0; i < d.doctors.length; i++) {\n\n // Printing doctor's id, name & speciality.\n console.log(d.doctors[i].id + \". \" + d.doctors[i].name + \" (\" + d.doctors[i].special + \")\");\n }\n}", "function displaydemodata(id) {\r\n\t\t\t\tvar demodata = d3.select(\".sample-metadata\");\r\n\t\t\t\tdemodata.html(\"\")\r\n\t\t\t\tdemodata.append(\"li\").text(`id: ${data.metadata[id_index].id}`);\r\n\t\t\t\tdemodata.append(\"li\").text(`ethnicity: ${data.metadata[id_index].ethnicity}`);\r\n\t\t\t\tdemodata.append(\"li\").text(`gender: ${data.metadata[id_index].gender}`);\r\n\t\t\t\tdemodata.append(\"li\").text(`age: ${data.metadata[id_index].age}`);\r\n\t\t\t\tdemodata.append(\"li\").text(`location: ${data.metadata[id_index].location}`);\r\n\t\t\t\tdemodata.append(\"li\").text(`bbtype: ${data.metadata[id_index].bbtype}`);\r\n\t\t\t\tdemodata.append(\"li\").text(`wfreq: ${data.metadata[id_index].wfreq}`);\r\n\t\t\t}", "function printData(json) {\n document.getElementById(\"fullname\").innerHTML = json.results[0].name.title\n + \" \" + json.results[0].name.first + \" \" + json.results[0].name.last;\n document.getElementById(\"state\").innerHTML = json.results[0].location.state;\n document.getElementById(\"street\").innerHTML = json.results[0].location.street.name + \" \"\n + json.results[0].location.street.number;\n document.getElementById(\"postcode\").innerHTML = json.results[0].location.postcode;\n document.getElementById(\"phone\").innerHTML = json.results[0].phone;\n document.getElementById(\"cell\").innerHTML = json.results[0].cell;\n document.getElementById(\"date_of_birth\").innerHTML = json.results[0].dob.date;\n document.getElementById(\"email\").innerHTML = json.results[0].email;\n let imgurl = json.results[0].picture.thumbnail;\n document.getElementById(\"profile_picture\").src = imgurl;\n\n\n\n}", "function buildPanel(id) {\n d3.json(\"samples.json\").then((buildData) => {\n\n // Filter by id to match user selection with our JSON data\n var infoArray = buildData.metadata.filter(x => x.id == id);\n console.log(infoArray);\n\n // Grabbing zeroth element of the filtered metadata\n var infoObject = infoArray[0];\n console.log(infoObject);\n\n // Looping through metadata to display in panel\n var metaPanel = d3.select(\"#sample-metadata\");\n metaPanel.html(\"\");\n Object.entries(infoObject).forEach(([key, value]) => {\n metaPanel.append(\"h5\").text(`${key}: ${value}`);\n });\n\n });\n\n}", "function getDetails () {\ndocument.getElementById('details').innerHTML = `\n<h2>${movieData.title}</h2>\n<p>${movieData.overview}</p>\n<img src=\"${movieData.poster}\" alt=\"${movieData.title}\">\n`\n}", "function getMetadata(path) {\n var passageContainer = document.getElementById(\"app\");\n var jsondata;\n fetch(path)\n .then(\n function (u) { return u.json(); }\n )\n .then(\n function (json) {\n var jsondata = json;\n for (var i = Object.keys(jsondata.title).length; i--; i >= 0) {\n // for each entry in jsondata, add div and information from \"data.json\"\n var div = document.createElement(\"div\");\n div.setAttribute(\"id\", \"div_\" + (i));\n div.innerHTML = (`${compareYear(jsondata[\"year\"][i], year0)}<p class=\"show-pub ${checkIfEmptyValue(\"\", jsondata[\"type\"][i], \"\")} ${checkIfEmptyValue(\"\", jsondata[\"community\"][i], \"\")}\">${checkIfEmptyValue(\"<span class='authors'>\", jsondata[\"co-author(s)\"][i], \"</span>: \")}<span class=\"title\"><a href=\"${jsondata[\"link to publication\"][i]}\">${jsondata[\"title\"][i]}</a></span>${checkIfEmptyValue(\", in <span class='publisher'>\", jsondata[\"publisher (e.g. journal/blog name)\"][i], \"</span>\")}. ${checkIfEmptyValue(`<span class='hashtag hashtag-${jsondata[\"type\"][i]} inactive light-mode'>`, jsondata[\"type\"][i], \"</span>\")} ${checkIfEmptyValue(`<span class='hashtag hashtag-${jsondata[\"community\"][i]} inactive light-mode'>`, jsondata[\"community\"][i], \"</span>\")}</p>`);\n passageContainer.appendChild(div);\n var year0 = jsondata[\"year\"][i];\n //enable filtering by hashtag\n document.querySelectorAll('span.hashtag').forEach((x) => {\n x.addEventListener('click', filterByHashtag);\n })\n // add functionality to lightswitch\n const lightSwitch = document.getElementById('flexSwitchCheckDefault');\n lightSwitch.addEventListener('change', e => {\n if(e.target.checked === true) {\n console.log(\"Checkbox is checked - boolean value: \", e.target.checked);\n changeToDarkMode();\n }\n if(e.target.checked === false) {\n console.log(\"Checkbox is not checked - boolean value: \", e.target.checked);\n changeToLightMode();\n }\n });\n };\n }\n );\n return jsondata;\n}", "function updateDemographicInfo(sampleID) {\n\n // Verify updateDemographicInfo function has been called\n // console.log(`Update demographic info panel(${sampleID}).`);\n\n // // Read data and arrange for demographic info panel\n d3.json(\"./data/samples.json\").then(data => {\n var metadata = data.metadata;\n var resultArray = metadata.filter(s => s.id == sampleID);\n var result = resultArray[0];\n\n // // Declare variable to reference HTML element and append data to panel\n var demographicPanel = d3.select(\"#sample-metadata\");\n demographicPanel.html(\"\");\n Object.entries(result).forEach(([key, value]) => {\n demographicPanel.append(\"h6\").text(`${key.toUpperCase()}: ${value}`);\n });\n\n // Plot gauge chart\n drawGaugeChart(result.wfreq);\n});\n}", "function drawMetaData(){\n // Set text size and color\n fill(0);\n // Display the number of observers\n textSize(12);\n text('('+str(timelinesArray.length)+' Observers)',940,360);\n // Display the crowdsourced valence, arousal and standard deviations.\n textSize(13);\n text('Average Valence: '+valence,680,416);\n text('Average Arousal: '+arousal,680,430);\n textSize(10);\n text('(standev. '+valence_stdev+')',850,416);\n text('(standev. '+arousal_stdev+')',850,430);\n // Display the self-reported valence and arousal\n if (vidInd>3){\n text('Self-reported: '+reported[vidInd-4][0],954,416);\n text('Self-reported: '+reported[vidInd-4][1],954,430);\n }\n textSize(12);\n}", "function showDetails(d) {\r\n\t// Get the ID of the feature.\r\n\t// var id = getIdOfFeature(f);\r\n\t// Use the ID to get the data entry.\r\n\t// var d = dataById[id];\r\n\t// Render the Mustache template with the data object and put the\r\n\t// resulting HTML output in the details container.\r\n\t// var detailsHtml = Mustache.render(template, d);\r\n\t// Hide the initial container.\r\n\t// d3.select('#initial').classed(\"hidden\", true);\r\n\t// Put the HTML output in the details container and show (unhide) it.\r\n\t// d3.select('#details').html(detailsHtml);\r\n\t// d3.select('#details').classed(\"hidden\", false);\r\n}", "function meta(samplechoice) {\n\n // Define selection of metadata\n var selector = d3.select(\"#sample-metadata\");\n\n // Pull data from file\n d3.json(file).then((data) => {\n\n var sample = data.metadata.filter(a => a.id==samplechoice);\n \n selector.html(\"\");\n\n // Append information to appropriate demographic information\n selector.append(\"h5\").text(\"ID: \" + sample[0].id);\n selector.append(\"h5\").text(\"Ethnicity: \" + sample[0].ethnicity);\n selector.append(\"h5\").text(\"Gender: \" + sample[0].gender);\n selector.append(\"h5\").text(\"Age: \" + sample[0].age);\n selector.append(\"h5\").text(\"Location: \" + sample[0].location);\n selector.append(\"h5\").text(\"Bb Type: \" + sample[0].bbtype);\n selector.append(\"h5\").text(\"Wfreq: \" + sample[0].wfreq);\n\n //console.log(sample[0]);\n //var metadata = d3.select(\"#sample-metadata\");\n \n });\n\n}", "function about(aboutus){\n \n $(\"#text\").hide();\n $.getJSON(\"json/abt.json\",function(data){\n $.each(data.abouts,function(key,value){\n $(\"#au\").html(content(value.abt, value.first, value.second, value.third));\n });\n }); \n}", "function showPerson(person){\n const item = reviews[person]; \n img.src = item.img; \n author.textContent = item.name;\n job.textContent = item.job; \n info.textContent = item.text; \n}", "function extractShowInfo(data) {\n\treturn {\n\t\ttitle: data.title,\n\t\tairday: data.airs.day,\n\t\tairtime: data.airs.time,\n\t\ttimezone: data.airs.timezone,\n\t\truntime: data.runtime,\n overview: data.overview\n\t};\n}", "function showPerson(person){\n const item = reviews[person];\n img.src = item.img;\n author.textContent = item.name;\n job.textContent = item.job;\n info.textContent = item.text; \n}", "function renderKeyInfo(key, data) {\n\tvar element = document.createDocumentFragment()\n\tvar icon = document.createElement('img')\n\ticon.src = protocol()+\"//sbapi.me/get/\"+data.path+\"/META/icon\"\n\ticon.className = \"metaIcon\"\n\telement.appendChild(icon)\n\telement.appendChild(textItem(data.filename, \"pre metaTitle\"))\n\telement.appendChild(textItem(data.author.name, \"pre metaAuthor\")) //todo: link with sbs account somehow?\n\treturn element\n}", "function successGetBookMetadata(data) {\n var jsonObject = JSON.parse(data.body);\n var bookTitle = jsonObject.d.Name.split(\".\")[0];\n var bookPrice = jsonObject.d.Length / 1024;\n\n //Render the title and price in the placeholders\n document.getElementById(\"lblBookTitle\").innerText =\n bookTitle;\n document.getElementById(\"lblBookPrice\").innerText =\n \"$ \" + bookPrice.toFixed(2);\n $(\"#lnkBuy\").show();\n}", "function displayData(data){\n\tlet display_with_poster = `\n\t\t\t<a href=\"${data.id}\" class=\"moreInfo\">\n\t\t\t<img class=\"poster\" src=\"http://image.tmdb.org/t/p/w500/${data.poster_path}\">\n\t\t\t<h3 class=\"title\">${data.title}</h3>\n\t\t\t</a>\n\t\t\t<p class=\"year\">${data.release_date}</p>\n\t\t\t`\n\tlet display_no_poster = `\n\t\t\t<a href=\"${data.id}\" class=\"moreInfo\">\n\t\t\t<img class=\"poster\" src=\"img/no_poster.png\">\n\t\t\t<a href=\"${data.id}\">\n\t\t\t<h3 class=\"title\">${data.title}</h3>\n\t\t\t</a>\n\t\t\t<p class=\"year\">${data.release_date}</p>\n\t\t\t`\n\tif(data.poster_path === null){\n\t\t$(`.movie${data.id}`).html(display_no_poster);\n\t}\n\telse{\n\t\t$(`.movie${data.id}`).html(display_with_poster);\n\t}\n}", "function displayResult2 () {\n if (request2.readyState == 4) {\n var jsonTA = JSON.parse(request2.responseText);\n document.getElementById(\"outputTA1\").innerHTML = \"List of top 5 albums:\"\n for (var i = 0; i < 5; i++)\n {\n document.getElementById(\"outputTA2\").innerHTML += \"<br></br>\"+jsonTA.topalbums.album[i]['name'] + \"<img src=\"+jsonTA.topalbums.album[i].image[1]['#text']+\"/>\";\n }\n }\n}", "function showExtendedDetails(jsonResort) {\n const extendedDesc = document.querySelector(\".extendedDesc\");\n\n extendedDesc.querySelector(\"h1\").textContent = jsonResort.gsx$resort.$t;\n extendedDesc.querySelector(\"h2\").textContent = jsonResort.gsx$country.$t;\n extendedDesc.querySelector(\".modal-green span\").textContent = jsonResort.gsx$greenslopes.$t;\n extendedDesc.querySelector(\".modal-blue span\").textContent = jsonResort.gsx$blueslopes.$t;\n extendedDesc.querySelector(\".modal-red span\").textContent = jsonResort.gsx$redslopes.$t;\n extendedDesc.querySelector(\".modal-black span\").textContent = jsonResort.gsx$blackslopes.$t;\n extendedDesc.querySelector(\".resortMap\").src = jsonResort.gsx$mapimage.$t;\n extendedDesc.querySelector(\".extendedPrice span\").textContent = jsonResort.gsx$skipass.$t;\n extendedDesc.querySelector(\".resortDescription\").textContent = jsonResort.gsx$about.$t;\n extendedDesc.querySelector(\".resortWebpageA\").href = jsonResort.gsx$homepage.$t;\n extendedDesc.querySelector(\".resortWebcamA\").href = jsonResort.gsx$webcamera.$t;\n extendedDesc.querySelector(\".resortIcons figure .tooltiptext .tooltipheight\").textContent = jsonResort.gsx$maxheight.$t;\n extendedDesc.querySelector(\".resortIcons figure .tooltiptext .tooltiplength\").textContent = jsonResort.gsx$slopelength.$t;\n\n extendedDesc.querySelector(\".close\").addEventListener(\"click\", (e) => {\n extendedDesc.style.animation = \".3s open ease-in forwards;\";\n extendedDesc.style.display = \"none\";\n });\n}", "function renderMosaic(data) {\n if (data) {\n var results = JSON.parse(data.body).Objects;\n\n function getTiles() {\n var tileList = [];\n\n results.map(function(tile) {\n tileList.push([\n '<li>',\n '<img src=\"' + tile.FotoMedium + '\">',\n '</li>'\n ].join('\\n'));\n });\n\n return tileList.join('\\n');\n }\n\n return [\n '<footer role=\"presentation\" class=\"splash\">',\n '<ul id=\"mosaic\">',\n getTiles(),\n '</ul>',\n '</footer>',\n ].join('\\n');\n } else {\n return '';\n }\n}" ]
[ "0.7352095", "0.73417807", "0.7277301", "0.71999466", "0.71886367", "0.7171232", "0.7162792", "0.7153268", "0.715262", "0.70248187", "0.7005684", "0.69514644", "0.69173986", "0.68637663", "0.6855104", "0.68427765", "0.6839695", "0.6837385", "0.68088305", "0.6773677", "0.6772447", "0.67526424", "0.6733251", "0.6721244", "0.6686459", "0.66688335", "0.6619795", "0.66154546", "0.6611722", "0.6600098", "0.6561163", "0.6528386", "0.6520166", "0.64863515", "0.6428531", "0.6409567", "0.6402551", "0.63679993", "0.63654464", "0.6365399", "0.63579726", "0.6341635", "0.6324971", "0.6320323", "0.6315463", "0.6310088", "0.62978214", "0.6297316", "0.6256255", "0.6246111", "0.6228157", "0.6196461", "0.61551195", "0.6137891", "0.6122507", "0.6114886", "0.6112209", "0.6088521", "0.6087891", "0.60845935", "0.60802454", "0.6076277", "0.60555285", "0.6042319", "0.60392076", "0.603168", "0.6024076", "0.6007281", "0.59935933", "0.5975444", "0.59713584", "0.5966568", "0.596463", "0.5952339", "0.5950663", "0.59479696", "0.5945287", "0.5924173", "0.59230465", "0.59214973", "0.587114", "0.58694154", "0.58559865", "0.5855026", "0.58542264", "0.58498544", "0.58464676", "0.5811291", "0.5781745", "0.5780291", "0.5780109", "0.5772268", "0.57614803", "0.57560205", "0.574688", "0.5744186", "0.57362515", "0.5735365", "0.5734613", "0.57342726" ]
0.6498157
33
Initiate the webpage with the default visualizations
function init(){ var selector = d3.select("#selDataset"); d3.json("data/samples.json").then(incomingData => { var nameId = incomingData.names; //filling the dropdown list of ID's nameId.forEach(id => {selector.append("option").text(id).property("value", id);}); //default ID to generate the graphs var defaultId = nameId[0]; demographicInfo(defaultId); barChart(defaultId); bubbleChart(defaultId); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initializeWebpage() {\r\n drawGridLines();\r\n drawGridLines();\r\n initArray();\r\n populateGameGrid(gameGrid);\r\n // Add any necessary functionality you need for the Reach portion below here\r\n }", "function initPage () {\n // Applying styles to all buttons\n var formButtons = $('div#cvss-calculator-form input[type=\"button\"]');\n angular.forEach(formButtons, function(button) {\n button.className = 'btn btn-default';\n });\n\n // !!!!!!!!!!!!!!!!!!!!!!!!\n // !!!!!!!! CALL function to initialize plots and check for existence of\n // !!!!!!!! hidden fields which WILL affect the page display.\n // Note: we only want the PlotService initialized once because it is\n // used by both versions.\n PlotService.plotMethods.init('V3'); // initialize plots and tool tips\n hiddenCheck();\n // Complete\n vm.initComplete = true;\n }", "function initPage() {\n $.get('/api/headlines?saved=false').done((data) => {\n articleContainer.empty();\n if (data && data.length > 0) {\n renderArticles(data);\n\n // Activate tooltips for the action buttons.\n $('[data-toggle=\"tooltip\"]').tooltip();\n } else {\n renderEmpty();\n }\n });\n }", "function initPage() {\n $.get('/api/headlines?saved=true').done((data) => {\n articleContainer.empty();\n\n if (data && data.length > 0) {\n renderArticles(data);\n\n // Activate tooltips for the action buttons.\n $('[data-toggle=\"tooltip\"]').tooltip();\n } else {\n renderEmpty();\n }\n });\n }", "function initialize() {\n console.log('setting the view of the webpage.');\n}", "function init() {\n createWelcomeGraphic();\n console.log('WELCOME TO ASSOCIATE MANAGER!');\n console.log('FOLLOW THE PROMPTS TO COMPLETE YOUR TASKS.');\n}", "function initVis() {\r\n\r\n createMapChart();\r\n populateTable();\r\n createLineCharts();\r\n}", "function initViz() {\n var containerDiv = document.getElementById(\"vizContainer\"),\n // define url to a Overview view from the Superstore workbook on my tableau dev site\n url = \"https://10ax.online.tableau.com/t/loicplaygrounddev353480/views/Superstore/Overview?:showAppBanner=false&:display_count=n&:showVizHome=n\";\n options = {\n hideTabs: true,\n onFirstInteractive: function () {\n var worksheets = getWorksheets(viz);\n // process all filters used on the dashboard initially and subscribe to any filtering event comming out of the dashboard to recompute the filters on the webpage.\n processFilters(worksheets);\n viz.addEventListener('filterchange', (filterEvent) => {\n var worksheets = getWorksheets(filterEvent.getViz());\n processFilters(worksheets);\n });\n viz.addEventListener(tableau.TableauEventName.MARKS_SELECTION, (marksEvent) => {\n var worksheets = getWorksheets(marksEvent.getViz());\n processFilters(worksheets);\n });\n }\n };\n\n viz = new tableau.Viz(containerDiv, url, options);\n}", "function initDashboard() {\n \n tempGauge(city);\n percipGauge(city);\n generateChart();\n generate_prcp();\n addParagraph(city) \n}", "function buildWebsiteOnStartup() {\n populateDropdown();\n d3.json(\"samples.json\").then(data => {\n buildCharts(data.names[0]);\n populateDemographicInfo(data.names[0]);\n })\n}", "function init() {\n\n // TODO: break this up a little so the logic is clearer\n\n if(window.location.host.slice(0, 9) === \"127.0.0.1\") {\n if(window.location.hash)\n state.safe_mode = window.location.hash.slice(1)\n else\n state.safe_mode = true\n }\n\n if(window.location.search) {\n state.query = window.location.search.substr(1).split('&').reduce(function(acc, pair) {\n var p = pair.split('=')\n acc[p[0]] = p[1]\n return acc\n }, {})\n if(state.query.tag)\n state.tags = [state.query.tag]\n else if(state.query.tags)\n state.tags = state.query.tags.split('|')\n }\n\n // G = Dagoba.graph()\n\n render_init()\n\n function cb() {\n force_rerender()\n showtags()\n tagglue()\n }\n\n add_data(cb)\n\n // setTimeout(function() {\n // // render()\n // }, 111)\n\n on_render(get_viz_html) // oh poo\n}", "function init() {\n if ($('.scheduled-page').length > 0) {\n setPageUrl();\n bindEvents();\n renderSwitcher();\n renderActions();\n switchPage(scheduled.currentView);\n }\n }", "function init() {\n loadTheme();\n loadBorderRadius();\n loadBookmarksBar();\n loadStartPage();\n loadHomePage();\n loadSearchEngine();\n loadCache();\n loadWelcome();\n}", "function render() {\n if (window._env === 'development') console.debug('RENDER');\n initDynamicSentence();\n initMapChart();\n initHighcharts();\n initBubbleChart();\n initSankeyChart();\n initBubbleChart();\n initTableBody();\n }", "function init() {\n\t// register event handlers for control buttons (start, pause, reset, help)\n\t$(\"#startButton\").on('click', startMelting);\n\t$(\"#resetButton\").on('click', resetExperiment);\n\t//$(\"#helpButton\").on('click', showHelp);\n\t//$(\"#infoButton\").on('click', displayAboutInfo);\n\t$(\"input[name='whichGraph']\").click(function() {\n\t\tshowWhichGraph = $(\"input[name='whichGraph']:checked\").val();\n\t\twindowResized();\n\t });\n\tshowWhichGraph = $(\"input[name='whichGraph']:checked\").val();\n\t// some CSS adjustments as well\n\t$(\"#stirBar1\").hide();\n\t$(\"#stirBar2\").hide();\n\n\tgetAreas();\n\tgetNumBlocks();\n}", "function initializeViz() {\n var container = document.getElementById(\"vizcontainer\");\n var url = \"https://public.tableau.com/views/WorldIndicators/GDPpercapita\";\n var options = {\n width: container.offsetWidth,\n height: container.offsetHeight,\n onFirstInteractive: function () {\n workbook = viz.getWorkbook();\n activeSheet = workbook.getActiveSheet();\n publishedSheets = workbook.getPublishedSheetsInfo();\n annyangInit();\n var options = {\n maxRows: 0, // 0 is returning all rows\n ignoreAliases: false,\n ignoreSelection: true\n };\n //activeSheet.getUnderlyingDataAsync(options).then(function(d) {dataFunc(d)});\n //activeSheet.getSummaryDataAsync(options).then(function(t) {sumFunc(t)});\n //getFilters(activeSheet);\n buildSelectFilterCountryCmd();\n buildSelectFilterRegionCmd();\n buildFuzzyCmds();\n }\n };\n viz = new tableau.Viz(container, url, options);\n }", "function initViz() {\n console.log(\"loadingviz\");\n viz = new tableau.Viz(vizContainer, url, options);\n}", "function init() {\n // Activate Widget / Cards\n weatherWidget(true);\n holidayWidget(true);\n restaurantWidget(true);\n timezoneWidget(true);\n\n // Activate the page content\n renderHeader();\n renderMainContent();\n renderFooter();\n $('.sidenav').sidenav();\n $('.fixed-action-btn').floatingActionButton();\n $('.modal').modal();\n searchInputAutoComplete();\n renderSearchLocations();\n\n // LAST: Activate Widget Filter\n renderFilterWidgets();\n}", "function init() {\n\n getCourses(program);\n getPreqs(courses);\n drawGraph();\n\n //set zoom view level\n zoomOut();\n\n //loading done\n $('#spin1').hide();\n}", "function setUpPage() {\n createEventListeners();\n populateFigures();\n}", "function init()\n{\n //initalize the application\n meDominance='';\n reset();\n //setFrameUrl('header','header.htm');\n //setFrameUrl('left','selectdomleft.htm');\n //setFrameUrl('right','selectdomright.htm');\n\n blnInitCalled=true;\n}", "function pageReady() {\n svg4everybody();\n initScrollMonitor();\n initModals();\n }", "function initializeVisualization(createStaticElements) {\n d3.json(\"data/\" + global.dataset.file, function(data) {\n // Cache the dataset\n global.papers = data.papers;\n\n // Initialize some global parameters\n global.computeOldestLatestPublicationYears();\n global.computeMedianMaximalNormalizedCitationCountsPerYear();\n\n // Restore data from previous session\n sessionManager.loadPreviousSession();\n\n // If no seed papers, won't do anything\n algorithm.updateFringe();\n view.initializeView(createStaticElements);\n\n // setup autocomplete popup\n $('#dialog .typeahead').typeahead({\n hint: true,\n highlight: true,\n minLength: 3\n }, {\n name: 'titles',\n displayKey: 'value',\n source: substringMatcher(Object.keys(global.papers)\n .map(function(doi) {\n return global.papers[doi].title;\n }))\n });\n });\n}", "function initializeViz() {\n alert(\"smart\");\n var placeholderDiv = document.getElementById(\"tableauViz\");\n var url = \"https://analytics.wfp.org/views/kk_0/Shopsoverview?:embed=y\"; \n\n // var url = \"http://public.tableau.com/views/WorldIndicators/GDPpercapita\";\n var options = {\n width: placeholderDiv.offsetWidth,\n height: placeholderDiv.offsetHeight,\n hideTabs: true,\n hideToolbar: true,\n onFirstInteractive: function () {\n workbook = viz.getWorkbook();\n activeSheet = workbook.getActiveSheet();\n }\n };\n viz = new tableau.Viz(placeholderDiv, url, options); \n}", "function initPage(){\r\n\t\t//add head class\r\n\t\t$(\"#headAssemblyLi\").addClass(\"active\");\r\n\t\t$(\"#leftCarQueryLi\").addClass(\"active\");\r\n\t\tgetSeries();\r\n\t\tfillLineSelect();\r\n\t\t$(\"#carTag\").hide();\r\n\t\t$(\"#resultTable\").hide();\r\n\t\t$(\"#tabTestLine\").hide();\r\n\t}", "function initialisePage(){\n\t\t\tcurrent_tab = \"about\";\n\t\t\tgenerateNav(register_navevents);\n\t\t\tgenerateFramework(current_tab, generatePage);\n\t\t\t// Enable button again\n\t\t\tbuttonOff();\n\t\t}", "function initializePage() {\r\n colorList();\r\n }", "function setUpPage(){\r\n displayHeader();\r\n displayFooter();\r\n displaySideBar();\r\n\r\n createEventListeners();\r\n}", "function main() {\r\n initFlags();\r\n fixMarkup();\r\n changeLayout();\r\n initConfiguration();\r\n}", "function setUpPage(){\r\n displayHeader();\r\n displayFooter();\r\n displaySideBar();\r\n createEventListeners();\r\n}", "function init() {\n cashElements();\n attachEvents();\n render();\n }", "function startVisualizer(websiteState) {\n console.log(\"\\nVisualizer started\");\n websiteState.visualizer.active = true;\n syncBeats(websiteState);\n ping(websiteState);\n}", "function main(){\n\t//Initialice with first episode\n\tvar sel_episodes = [1]\n\t//collage(); //Create a collage with all the images as initial page of the app\n\tpaintCharacters();\n\tpaintEpisodes();\n\tpaintLocations(sel_episodes);\n}", "function init() {\n // THIS IS THE CODE THAT WILL BE EXECUTED ONCE THE WEBPAGE LOADS\n }", "function init() {\n\n\t// first, decorate the page...\n\tdecorate();\n\n//\tctx = document.getElementById(\"canvas\").getContext(\"2d\");\n//\tctx.fillStyle = \"rgb(250,0,0)\";\n//\tctx.save();\n//\tctx.translate(75, 75);\n//\tctx.rotate(-Math.PI / 6);\n//\tctx.translate(-75, -75);\n//\tctx.fillRect(75, 75, 50, 50);\n//\tctx.restore();\n//\tctx.fillStyle = \"rgb(0,0,250)\";\n//\tctx.fillRect(75, 75, 5, 5);\n}", "function init() {\n // Load and style highCharts library. https://www.highCharts.com/docs.\n highchartsExport( Highcharts );\n applyThemeTo( Highcharts );\n\n _containerDom = document.querySelector( '#chart-section' );\n _resultAlertDom = _containerDom.querySelector( '#chart-result-alert' );\n _failAlertDom = _containerDom.querySelector( '#chart-fail-alert' );\n _chartDom = _containerDom.querySelector( '#chart' );\n _dataLoadedDom = _containerDom.querySelector( '.data-enabled' );\n\n startLoading();\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 charts(\"940\");\n}", "function init() {\n loadTheme();\n loadBorderRadius();\n loadSearchEngine();\n loadHomePage();\n loadStartPage();\n loadBookmarksBar();\n loadWelcome();\n\n ipcRenderer.send('request-set-about');\n\n document.onkeydown = keyDown;\n}", "function initializePage() {\r\n createCanvas();\r\n resetArray();\r\n setUpControls();\r\n drawCurrentState();\r\n addBox();\r\n // timer = setInterval(updateBox, 200);\r\n }", "async show() {\n // Anzuzeigenden Seiteninhalt nachladen\n let html = await fetch(\"page-overview/page-overview.html\");\n let css = await fetch(\"page-overview/page-overview.css\");\n\n if (html.ok && css.ok) {\n html = await html.text();\n css = await css.text();\n } else {\n console.error(\"Fehler beim Laden des HTML/CSS-Inhalts\");\n return;\n }\n\n // Seite zur Anzeige bringen\n let pageDom = document.createElement(\"div\");\n pageDom.innerHTML = html;\n\n this._renderBoatTiles(pageDom);\n\n this._app.setPageTitle(\"Startseite\");\n this._app.setPageCss(css);\n this._app.setPageHeader(pageDom.querySelector(\"header\"));\n this._app.setPageContent(pageDom.querySelector(\"main\"));\n }", "function startup() {\n const container = document.getElementsByClassName('main-interface')[0];\n\n const renderer = new Step3Renderer(container);\n const eventManager = new EventManager();\n\n const events = eventManager.getEvents()\n\n renderer.render(events);\n\n const mapView = document.getElementsByClassName('map-view')[0];\n const mapsInterface = new MapsInterface(mapView, { lat: 0, lng: 0 });\n\n setupMap(events, mapsInterface);\n}", "function init () {\n win.SiteCanvas = PageInterface;\n on(win, 'message', onMessage);\n\n on(win, 'load', FrameInterface.calculateViewportDimensions);\n on(win, 'resize', FrameInterface.calculateViewportDimensions);\n }", "function initViz() {\n console.log(\"Hello!\");\n // no const with viz as it has been assigned by let at the top\n viz = new tableau.Viz(vizContainer, url, options);\n}", "function initialize() {\n\t\t\n\t\tsvg = scope.selection.append(\"svg\").attr(\"id\", scope.id).style(\"overflow\", \"visible\").attr(\"class\", \"vizuly\");\n\t\tbackground = svg.append(\"rect\").attr(\"class\", \"vz-background\");\n\t\tdefs = vizuly2.util.getDefs(viz);\n\t\tplot = svg.append('g');\n\t\t\n\t\tscope.dispatch.apply('initialized', viz);\n\t}", "function initPage()\n\t{\n\t\tinitGlobalVars();\n\t\tinitDOM();\n\t\tinitEvents();\n\t}", "function init(){\n console.debug('Document Load and Ready');\n console.trace('init');\n initGallery();\n \n pintarLista( );\n pintarNoticias();\n limpiarSelectores();\n resetBotones();\n \n}", "function main() {\n init();\n render();\n handleVisibilityChange();\n}", "function initiatePage () {\n\t highlightDayOfTheWeek();\n\t populateHairdresserContainer();\n\t animateContainer(true, '#who');\n\t window.setTimeout(function () { autoScrollSlideshow(); }, 4000);\n\t}", "init() {\n\n\n\t\t\t\tChart.resize();\n\t\t\t\tChart.render();\n\t\t\t}", "function main() {\n init(fontSize);\n\n renderModel = ReadModel();\n renderUI = ReaderBaseFrame(RootContainer);\n renderModel.init(function (data) {\n renderUI(data);\n });\n\n EventHandler();\n }", "function initHtml () {\n\t\t\t$container.slick(config);\n\t\t}", "function init() {\n\n browserManager = new BrowserManager();\n screenshotsAndroid = new ScreenshotsAndroid();\n magazine = new Magazine();\n workFlowManager = new WorkFlowManager();\n buttonsManager = new ButtonsManager();\n fieldsEdit = new FieldsEdit();\n tableEdit = new TableEdit();\n workFlowEdit = new WorkFlowEdit();\n\n //View Manager\n viewManager = new ViewManager();\n\n // table\n tileManager.drawTable();\n\n // ScreenshotsAndroid\n screenshotsAndroid.init();\n\n // BrowserManager\n browserManager.init();\n\n var dimensions = tileManager.dimensions;\n\n // groups icons\n headers = new Headers(dimensions.columnWidth, dimensions.superLayerMaxHeight, dimensions.groupsQtty,\n dimensions.layersQtty, dimensions.superLayerPosition);\n\n // uncomment for testing\n //create_stats();\n\n $('#backButton').click(function() {\n\n if(viewManager.views[window.actualView])\n viewManager.views[window.actualView].backButton();\n\n });\n\n $('#container').click(onClick);\n\n //Disabled Menu\n //initMenu();\n\n setTimeout(function() { initPage(); }, 500);\n\n setTimeout(function (){\n guide.active = true;\n if(actualView === 'home'){\n guide.showHelp();\n }\n }, 15000);\n\n /*setTimeout(function() {\n var loader = new Loader();\n loader.findThemAll();\n }, 2000);*/\n\n //TWEEN.removeAll();\n}", "function init()\r\n{\r\n\t//Initialize globals\r\n\tstyleExplorer = new StyleExplorerApplication();\r\n\tstyleExplorer.setCanvas(document.getElementById(\"canvasStyleExplorer\"));\r\n}", "function init() {\n console.debug(\"Document Load and Ready\");\n\n listener();\n initGallery();\n cargarAlumnos();\n\n // mejor al mostrar la modal\n // cargarCursos();\n}", "function initViz() {\n viz = new tableau.Viz(vizContainer, url, options);\n}", "function init() {\n\n\t\t\t// WOW일때 컬러칩 active 안 되는 경우 처리\n\t\t\tif( $('.layout-2 #selectColor').length > 0 && $('.layout-2 #selectColor .active').length == 0 ){\n\t\t\t\t$('.layout-2 #selectColor').find('.swatch').first().addClass('active');\n\t\t\t}\n\n\t\t\tnew ss.PDPStandard.PDPFeaturesController();\n\t\t\tnew ss.PDPStandard.PDPAccessories();\n\n\t\t\tnew ss.PDPStandard.PDPThreeSixty();\n\t\t\tnew ss.PDPStandard.PDPGallery();\n\t\t\t//new ss.PDPStandard.PDPKeyVisual();\n\n\t\t\tif ($('.media-module').find('.sampleimages').length > 0) {\n\t\t\t\tnew ss.PDPStandard.PDPSampleImages();\n\t\t\t}\n\n\t\t\tcurrentMetrics = ss.metrics;\n\n\t\t\tbindEvents();\n\t\t\theroSize();\n\t\t\tthrottleCarousel();\n\n\t\t\tnew ss.PDPStandard.PDPCommon();\n\t\t\tnew ss.PDPStandard.PDPeCommerceWOW();\n\t\t\tss.PDPStandard.optionInitWOW();\n\t\t}", "function initialise() {\n mainMenu();\n\n initialisePage();\n}", "function initPage(){\r\n\t\t//add head class\r\n\t\t$(\"#headGeneralInformationLi\").addClass(\"active\");\r\n\t\tgetSeries();\r\n\t\t$(\"#divLeft,#divHead,#divFoot\").addClass(\"notPrintable\");\r\n\t\t$(\"#startTime\").val(window.byd.DateUtil.lastWorkDate());\r\n\r\n\t\tajaxQueryReplacementCost(\"monthly\");\r\n \tajaxQueryReplacementCost(\"yearly\");\r\n \tajaxQueryCostDistribute();\r\n\t\tresetAll();\r\n\t}", "async init() {\n // setup the csvLoader button\n this.csvLoader()\n this.mkradio(\"axial\")\n this.mkradio(\"sagittal\")\n this.mkradio(\"coronal\")\n // setup the radio buttons\n // selected is the radio button we have selected\n /** The view that has been selected to view the slices of the brain from. Stored on pane for export and import of sessions.\n * @alias brainView\n * @memberof Pane\n * @instance\n */\n this.paneOb.brainView = \"sagittal\" // default\n this.paneOb.paneDiv.querySelector(\"#radiosagittal\").checked = true\n\n // create the brain slice slider\n this.createSlider()\n\n // set defaults\n // ensure that the slider only permits sagittal slice count\n this.paneOb.paneDiv.querySelector(\"#radiosagittal\").click()\n\n }", "function pageInit(subject){\n topOTUBar(subject)\n topOTUBubble(subject)\n demographTable(subject)\n washingGauge(subject)\n}", "function init() {\n initializeVariables();\n initializeHtmlElements();\n}", "function _init() {\r\n // set page <title>\r\n Metadata.set(home.title);\r\n\r\n // activate controller\r\n _activate();\r\n }", "function init(){\n $(\"html\").css({\n \"width\":\"100%\",\n \"height\":\"100%\",\n \"margin\":\"0px\",\n \"padding\":\"0px\"\n });\n $(\"body\").css({\n \"width\":\"100%\",\n \"height\":\"100%\",\n \"overflow\":\"hidden\",\n \"margin\":\"0px\",\n \"padding\":\"0px\"\n });\n setSizeForPages();\n $(window).resize(setSizeForPages);\n }", "function setupPage() {\n $.ajaxSetup({cache: false}); // globally sets ajax caching to false (for this lifecycle of this page)\n setupRegionList();\n setupViewList();\n setupGraphicControls();\n setupCreateNewRegion();\n setupAdvancedSettings();\n setupSaveDisplayedGenes();\n setupDeleteButton();\n setupDrawGraph();\n}", "function loadVisualizer(targetEnvironment) {\n // Load HTML\n main.innerHTML = '\\n <div id=\"navigation\">\\n <button class=\"submit-button\" id=\"new-environment\">New Environment</button>\\n <button class=\"submit-button\" id=\"regenerate-environment\">Regenerate Environment</button>\\n <button class=\"submit-button\" id=\"save-template\">Save Template</button>\\n <button class=\"submit-button\" id=\"save-environment\">Save Environment</button>\\n <h1 id=\"message\"></h1>\\n <p id=\"content\"></p>\\n </div>\\n <div id=\"toolbar\">\\n <h1 class=\"sidebar\">Controls</h1>\\n <h2 class=\"sidebar\" id=\"layer-toggles-header\"></h2>\\n <div class=\"toolbar-container scroll-box\" id=\"layer-toggles\"></div>\\n <h2 class=\"sidebar\" id=\"layer-selector-header\"></h2>\\n <div class=\"toolbar-container scroll-box\" id=\"layer-selector\"></div>\\n <h2 class=\"sidebar\" id=\"anomaly-selector-header\"></h2>\\n <div class=\"toolbar-container scroll-box\" id=\"anomaly-selector\"></div>\\n </div>\\n <svg id=\"display\"></svg>\\n <div id=\"legend\">\\n <h1 class=\"sidebar\">Legend</h1>\\n <h2 class=\"sidebar\" id=\"legend-environment-title\"></h2>\\n <table class=\"legend-table\" id=\"legend-main-table\"></table>\\n <h2 class=\"sidebar\" id=\"legend-layer-title\"></h2>\\n <table class=\"legend-table\" id=\"legend-selected-layer-table\"></table>\\n <h2 class=\"sidebar\" id=\"legend-cell-title\"></h2>\\n <div class=\"scroll-box\" id=\"cell-table-holder\">\\n <table class=\"legend-table\" id=\"legend-selected-cell-table\"></table>\\n </div>\\n </div>\\n ';\n\n // Set globals\n environment = targetEnvironment;\n elementSelections = environment.elementTypes.slice(0);\n if (elementSelections.length > 0) elementSelections.unshift(\"None\"); // adds \"None\" to the front of array\n anomalies = environment.anomalyTypes.slice(0);\n if (anomalies.length > 0) anomalies.unshift(\"None\"); // adds \"None\" to the front of array\n selectedLayer = \"None\";\n selectedAnomalyType = \"None\";\n selectedCell = \"None\";\n\n loadNavigation();\n loadDisplay();\n loadToolbar();\n loadLegend();\n\n document.getElementById(\"Elevation-Toggle\").click();\n document.getElementById(\"Grid-Toggle\").click();\n}", "function setupMain() {\n setupMenu();\n setupTreeView();\n setupAnnotations();\n\n // Add initial pane\n pm.registerPane();\n pm.renderPane();\n}", "function initializePage() {\n // Initialize variables that correspond to\n // DOM objects in the user interface plus\n // $window.\n initializeVariables();\n\n // Check errorMessage\n if (errorMessage.length > 0) {\n Print.print(errorMessage);\n Print.print(instructions);\n return;\n }\n\n // Provide the link behavior for the arrows.\n $backArrow.click(backSlide);\n $nextArrow.click(nextSlide);\n\n // Initialize the slide dropdown menu\n initializeSlideDropdown();\n\n // Provide the behavior for the slide dropdown menu\n slideDropdown.onchange = slideDropdownBehavior;\n \n // Do the initial sizing of the story frame.\n resizeStoryFrame();\n\n // Show the total number of slides\n $slideTotal.text(\"\" + storyLength);\n\n // Initialize by showing slide 0 or show the slide\n // corresponding to the query parameter start=N.\n //\n // Keep in mind that user indexing starts at 1 so\n // we need to adjust here by subtracting 1.\n\n var start = 0;\n\n if (QueryParams.Params[\"start\"]) {\n start = parseInt(QueryParams.Params[\"start\"]);\n\n if (isNaN(start))\n start = 0;\n else\n start--;\n }\n\n showSlide(start);\n\n // Set up auto resize on the story frame.\n window.onresize = resizeStoryFrame;\n}", "function init() {\r\n\t//Sets the FileName to the one passed by the query parameter\r\n\tinitFileNameFromURL();\r\n\r\n\t//Createing the color set in the Toolbar, so the user can select a color\r\n\tcreateColorset();\r\n\r\n\t//Selects the Pencil after startup, so the user can start drawing after the page has loaded.\r\n\t$('#pencil').attr('class', 'active');\r\n\r\n\t//every wich is clickable will be defined in this function \r\n\tdeclareJqueryOnClickEvents();\r\n\r\n\tloadImageIntoHTML();\r\n}", "function initialize() {\n\tinitialColorScale(imageData);\n\tloadIconImages(imageData);\n\tdrawBarChart(imageData);\n\tdrawSliderBar(imageData);\n\tdrawTreemap(imageData);\n}", "function init() {\n\n initFloorsMapping(Config.BUILDINGS);\n createElevators(Config.BUILDINGS);\n\n AppUI.init();\n attachEvents(Config.BUILDINGS);\n }", "function initHtml () {\n\t\t\t$container.addClass(\"ibm-widget-processed\");\n\n\t\t\tif (config.type === \"simple\") {\n\t\t\t\t$hideables.addClass(\"ibm-hide\");\n\t\t\t}\n\n\t\t\tif (config.type === \"panel\") {\n\t\t\t\t$headings.removeClass(\"ibm-active\");\n\t\t\t\t$containers.slideUp(slideupSpeed);\n\t\t\t}\n\t\t}", "function setLayout() {\n\t// Create title page\n\tvar p = document.createElement(\"p\");\n\tp.innerHTML = \"One particle in static electric and \" +\n\t\t\"magnetic field\";\n\tp.style.fontWeight = \"bold\";\n\tdocument.body.append(p);\n\n\t// Define first Tabs\n\ttabs1 = new Tabs(\"tabs1\");\n\ttabs1.setWidth(\"450px\");\n\ttabs1.setHeight(\"240px\");\n\ttabs1.addTab(\"Log\", 0);\n\ttabs1.addTab(\"Params\", 0);\n\ttabs1.addTab(\"Results\", 0);\n\t\n\t// Define second Tabs\n\ttabs2 = new Tabs(\"tabs2\");\n\ttabs2.setWidth(\"300px\");\n\ttabs2.setHeight(\"300px\");\n\ttabs2.addTab(\"xy\", 1);\n\ttabs2.addTab(\"yz\", 1);\n\ttabs2.addTab(\"xz\", 1);\n\ttabs2.addTab(\"xyz\", 1);\n\t\n\t// Clear all tabs\n\ttabs1.text(\"Params\").clear();\n\ttabs1.text(\"Results\").clear();\n\ttabs1.text(\"Log\").clear();\n\ttabs2.graphic(\"xy\").clear();\n\ttabs2.graphic(\"yz\").clear();\n\ttabs2.graphic(\"xz\").clear();\n\ttabs2.graphic(\"xyz\").clear();\n\n\t// Define bgroup\n\tbgroup = new Bgroup(\"bgroup\");\n\tbgroup.setWidth(\"60px\");\n\tbgroup.setHeight(\"147px\");\n\tbgroup.addButton(\"Clear\");\n\tbgroup.addButton(\"Load\");\n\tbgroup.addButton(\"Read\");\n\tbgroup.addButton(\"Start\");\n\tbgroup.addButton(\"Draw\");\n\tbgroup.addButton(\"Help\");\n\tbgroup.addButton(\"About\");\n\tbgroup.disable(\"Read\");\n\tbgroup.disable(\"Start\");\n\tbgroup.disable(\"Draw\");\n}", "function init() {\n\t\t\tif (!container) return;\n\t\t\trequestImages();\n\t\t\tbuildLayout();\n\t\t}", "function initialPages($) {\n\t\tdateRangePicker('#chart1-daterange');\n\t\tdatePicker('#chart2-date');\n\t\tselect2Plugin('.select2')\n\t\tcharts1Ajax();\n\t\tcharts2Ajax();\n\t\t//charts3();\n\t\t\n\t\t/* === click charts1 button === */\n\t\t$('#charts1-view-btn').click(function(){\n\t\t\tcharts1Ajax();\n\t\t});\n\t\t\n\t\t/* === click charts2 button === */\n\t\t$('#charts2-view-btn').click(function(){\n\t\t\tcharts2Ajax();\n\t\t})\n\t}", "static start() {\n this.buttonCreate();\n this.buttonHideModal();\n\n // Animal.createAnimal('Zebras', 36, 'black-white', false);\n // Animal.createAnimal('Zirafa', 30, 'brown-white', true);\n // Animal.createAnimal('Liutas', 35, 'brown', false);\n // Animal.createAnimal('Dramblys', 20, 'grey', false);\n\n this.load();\n }", "function initMain(){\n\tbuildGameButton();\n\tbuildGameStyle();\n\tbuildScoreboard();\n\t\n\tgoPage('main');\n\tloadXML('questions.xml');\n}", "function initPage() {\n\n initHeader();\n\n initForm();\n\n initDatalist();\n}", "function startDemo() {\n View.set('Demo');\n }", "init() {\n super.init();\n // set the default engine page\n this.xmlConfig = this.gps.xmlConfig;\n let id = this._defaultPanelID;\n let engineDisplayPages = this.xmlConfig.getElementsByTagName(\"EngineDisplayPage\");\n if (engineDisplayPages.length == 0) {\n engineDisplayPages = this.xmlConfig.getElementsByTagName(\"EngineDisplay\");\n this.engineDisplayPages[id] = {\n title: \"Default\",\n node: this.xmlConfig.getElementsByTagName(\"EngineDisplay\"),\n buttons: []\n };\n this.selectedEnginePage = id;\n } else {\n for (let i = 0; i < engineDisplayPages.length; i++) {\n let engineDisplayPageRoot = engineDisplayPages[i];\n let id = engineDisplayPageRoot.getElementsByTagName(\"ID\")[0].textContent;\n let engineDisplayPage = {\n title: engineDisplayPageRoot.getElementsByTagName(\"Title\")[0].textContent,\n node: engineDisplayPageRoot.getElementsByTagName(\"Node\")[0].textContent,\n buttons: []\n };\n let buttonNodes = engineDisplayPageRoot.getElementsByTagName(\"Button\");\n for (let buttonNode of buttonNodes) {\n engineDisplayPage.buttons.push({\n text: buttonNode.getElementsByTagName(\"Text\")[0].textContent\n });\n }\n this.engineDisplayPages[id] = engineDisplayPage;\n if (i == 0) {\n this.selectEnginePage(id);\n }\n };\n }\n }", "function init() {\r\n\taddListeners();\r\n\t// Polite loading\r\n\tif (Enabler.isPageLoaded()) {\r\n\t\tshow();\r\n\t}\r\n\telse {\r\n\t\tEnabler.addEventListener(studio.events.StudioEvent.PAGE_LOADED, show);\r\n\t\t//Enabler.addEventListener(studio.events.StudioEvent.VISIBLE, show);\r\n\t}\r\n}", "function main() {\n initBurgerMenu();\n setScrollAnimationTargets(); // init homepage nav\n\n if ($('#home').length === 1) {\n initHomepageNav();\n } else {\n console.log('not home');\n } // init lightboxes\n\n\n initVideoLightbox();\n initTCsLightbox();\n}", "function init() {\n\t\t\t// Mount all riot tags\n\t\t\triot.mount('loadingscreen');\n\t\t\triot.mount('applauncher');\n\n\t\t\t//window.wm.mode = 'exposeHack';\n //window.wm.mode = 'default';\n\t\t}", "function init() {\n initVisualization();\n \n addSimulationControls(play, pause, step, stop_movement);\n \n addParamControls(\"#sliders\", params, update_params); \n}", "async show() {\n // Anzuzeigenden Seiteninhalt nachladen\n let html = await fetch(\"page-start/page-start.html\");\n let css = await fetch(\"page-start/page-start.css\");\n\n if (html.ok && css.ok) {\n html = await html.text();\n css = await css.text();\n } else {\n console.error(\"Fehler beim Laden des HTML/CSS-Inhalts\");\n return;\n }\n\n // Seite zur Anzeige bringen\n this._pageDom = document.createElement(\"div\");\n this._pageDom.innerHTML = html;\n\n await this._renderReciepts(this._pageDom);\n\n this._app.setPageTitle(\"Startseite\", {isSubPage: true});\n this._app.setPageCss(css);\n this._app.setPageHeader(this._pageDom.querySelector(\"header\"));\n this._app.setPageContent(this._pageDom.querySelector(\"main\"));\n\n this._countDown();\n }", "function loadOperationVisualizer(targetEnvironment, saps) {\n // Load HTML\n main.innerHTML = '\\n <div id=\"navigation\">\\n <button class=\"submit-button\" id=\"new-environment\">New Environment</button>\\n <button class=\"submit-button\" id=\"regenerate-environment\">Regenerate Environment</button>\\n <button class=\"submit-button\" id=\"save-template\">Save Template</button>\\n <button class=\"submit-button\" id=\"save-environment\">Save Environment</button>\\n <h1 id=\"message\"></h1>\\n <p id=\"content\"></p>\\n </div>\\n <div id=\"toolbar\">\\n <h1 class=\"sidebar\">Controls</h1>\\n <h2 class=\"sidebar\" id=\"layer-toggles-header\"></h2>\\n <div class=\"toolbar-container scroll-box\" id=\"layer-toggles\"></div>\\n <h2 class=\"sidebar\" id=\"layer-selector-header\"></h2>\\n <div class=\"toolbar-container scroll-box\" id=\"layer-selector\"></div>\\n <h2 class=\"sidebar\" id=\"anomaly-selector-header\"></h2>\\n <div class=\"toolbar-container scroll-box\" id=\"anomaly-selector\"></div>\\n </div>\\n <svg id=\"display\"></svg>\\n <div id=\"legend\">\\n <h1 class=\"sidebar\">Legend</h1>\\n <h2 class=\"sidebar\" id=\"legend-environment-title\"></h2>\\n <table class=\"legend-table\" id=\"legend-main-table\"></table>\\n <h2 class=\"sidebar\" id=\"legend-layer-title\"></h2>\\n <table class=\"legend-table\" id=\"legend-selected-layer-table\"></table>\\n <h2 class=\"sidebar\" id=\"legend-cell-title\"></h2>\\n <div class=\"scroll-box\" id=\"cell-table-holder\">\\n <table class=\"legend-table\" id=\"legend-selected-cell-table\"></table>\\n </div>\\n </div>\\n <div id=\"operation-controls\">\\n <button class=\"submit-button\" id=\"previous-action-ten\"><<<</button>\\n <button class=\"submit-button\" id=\"previous-action\"><</button>\\n <h5 id=\"action-message\">Begin</h5>\\n <button class=\"submit-button\" id=\"next-action\">></button>\\n <button class=\"submit-button\" id=\"next-action-ten\">>>></button>\\n <h5 id=\"state-message\"></h5>\\n </div>\\n ';\n\n // Set globals\n stateActionPairs = saps;\n environment = targetEnvironment;\n elementSelections = environment.elementTypes.slice(0);\n if (elementSelections.length > 0) elementSelections.unshift(\"None\"); // adds \"None\" to the front of array\n anomalies = environment.anomalyTypes.slice(0);\n if (anomalies.length > 0) anomalies.unshift(\"None\"); // adds \"None\" to the front of array\n selectedLayer = \"None\";\n selectedAnomalyType = \"None\";\n selectedCell = \"None\";\n\n // Resize Some stuff\n document.getElementById(\"navigation\").setAttribute(\"height\", \"12%\");\n document.getElementById(\"toolbar\").setAttribute(\"height\", \"65%\");\n document.getElementById(\"display\").setAttribute(\"height\", \"65%\");\n document.getElementById(\"legend\").setAttribute(\"height\", \"65%\");\n\n actionIndex = -1;\n actionMessage = document.getElementById(\"action-message\");\n stateMessage = document.getElementById(\"state-message\");\n\n loadNavigation();\n loadDisplay();\n loadToolbar();\n loadLegend();\n loadOperationControls();\n\n document.getElementById(\"Elevation-Toggle\").click();\n document.getElementById(\"Grid-Toggle\").click();\n}", "function init() {\n setDomEvents();\n }", "function initializePage() {\n handleGlobalEvent();\n handleSideBar();\n handleMessageBar();\n handleCollapsibleController();\n handleResetButton();\n handleDisabledSubmit();\n handleAjaxError();\n handleAjaxSetup();\n }", "function setVisualStructure() {\n // Get contexts.\n const contextnames = [\n 'scape',\n 'glassBottle',\n 'bottleText',\n 'bottleWave',\n 'chart',\n 'blackBox',\n 'globe',\n ];\n\n updateContexts(contextnames);\n setRoughCanvases();\n}", "function setVisualStructure() {\n // Get contexts.\n const contextnames = [\n 'scape',\n 'glassBottle',\n 'bottleText',\n 'bottleWave',\n 'chart',\n 'blackBox',\n 'globe',\n ];\n\n updateContexts(contextnames);\n setRoughCanvases();\n}", "function initLivenessDesign() {\n document.querySelector('header').classList.add('d-none');\n document.querySelector('main').classList.add('darker-bg');\n session.videoMsgOverlays.forEach((overlay) => overlay.classList.add(settings.D_NONE_FADEOUT));\n session.loadingInitialized.classList.remove(settings.D_NONE_FADEOUT); // display loading until initialization is done\n}", "function init() {\r\n\t\r\n\t/* Initialize the scene framework */\r\n\t// Cameras\r\n\tcameras();\r\n\t// Renderer\r\n\tinitRenderer();\r\n\t// Lights\r\n\tlights();\r\n\t// Axes\r\n\taxes( 300 , true );\t\r\n\t// Materials\r\n\tmaterials();\r\n\r\n\t/* Initialize the UI */\r\n\tUI( 'browser' );\r\n\t\r\n\t/* Initialize the settings of the lucidChart object */\r\n\tlucidChart.init();\r\n\t\r\n\t/* Initialize the event listeners */\r\n\tinitEventListeners();\r\n\t\r\n\t// GEOMETRIES\r\n\tentities();\r\n\t\r\n\t// Create the Stereoscopic viewing object (Not applied yet)\r\n\tvar effect = new THREE.StereoEffect(renderer);\r\n\t\t\r\n\tdebug.master && debug.renderer && console.log ('About to call the render function' );\r\n\trender();\t\t \r\n\tdebug.master && debug.renderer && console.log ( 'Now Rendering' );\r\n}", "function initUI() {\n showDataIsLoaded();\n showExplorePage();\n bindSearchHandler();\n}", "function initializeVisualizer(session_, viewportSelector, pipelineSelector, proxyEditorSelector, fileSelector, sourceSelector, filterSelector, dataInfoSelector) {\n session = session_;\n\n // Initialize data and DOM behavior\n updatePaletteNames();\n addScrollBehavior();\n addDefaultButtonsBehavior();\n addFixHeightBehavior();\n addTimeAnimationButtonsBehavior();\n addPreferencePanelBehavior();\n\n // Create panels\n createFileManagerView(fileSelector);\n createCreationView(sourceSelector, 'sources');\n createCreationView(filterSelector, 'filters');\n createViewportView(viewportSelector);\n createPipelineManagerView(pipelineSelector);\n createProxyEditorView(proxyEditorSelector);\n createDataInformationPanel(dataInfoSelector);\n\n // Set initial state\n $('.need-input-source').hide();\n proxyEditor.empty();\n activePipelineInspector();\n }", "init()\n { this.animated_children.push( this.axes_viewer = new Axes_Viewer( { uniforms: this.uniforms } ) );\n // Scene defaults:\n this.shapes = { box: new defs.Cube() };\n const phong = new defs.Phong_Shader();\n this.material = { shader: phong, color: color( .8,.4,.8,1 ) };\n }", "function initialize() {\n $.get(\"views/AdminHomePage.html\")\n .done(setup)\n .fail(error);\n }", "async function initializePage() {\n loadProjectsContainer();\n loadCalisthenicsContainer();\n loadCommentsContainer();\n}", "function startInitialization() {\n initializing = true;\n\n try {\n // Initialize the mode webview.\n createSubwindow();\n\n // Bind and run inital resize first thing\n $(window).resize(responsiveResize);\n responsiveResize();\n\n // Load the modes (adds to settings content)\n loadAllModes();\n\n // Bind settings controls\n bindSettingsControls();\n\n // Load the colorset configuration data (needs to happen before settings are\n // loaded and a colorset is selected.\n getColorsets();\n\n // Load up initial settings!\n // @see scripts/main.settings.js\n loadSettings();\n\n // Initalize Tooltips (after modes have been loaded)\n initToolTips();\n\n // Load the quickload list\n initQuickload();\n\n // Load the history list.\n initHistoryload();\n\n // Prep the connection status overlay\n $stat = $('body.home h1');\n $options = $('.options', $stat);\n\n // Actually try to init the connection and handle the various callbacks\n startSerial();\n\n bindMainControls(); // Bind all the controls for the main interface\n } catch(e) {\n handleInitError('Initialization', e);\n }\n}", "setupUI() {\n\n hdxAV.algOptions.innerHTML = '';\n\t\n hdxAVCP.add(\"undiscovered\", visualSettings.undiscovered);\n hdxAVCP.add(\"visiting\", visualSettings.visiting);\n hdxAVCP.add(\"discarded\", visualSettings.discarded);\n for (let i = 0; i < this.categories.length; i++) {\n hdxAVCP.add(this.categories[i].name,\n this.categories[i].visualSettings);\n }\n }", "function main() {\n startSlideShowAnimation();\n renderProject();\n}", "function initializePage() {\n\t$('.project a').click(addProjectDetails);\n\n\t$('#colorBtn').click(randomizeColors);\n\n\t$('.spotify .handle').hover(function() {\n\t\tshowSpotify($(this).parent());\n\t});\n}" ]
[ "0.692247", "0.6729887", "0.67226017", "0.6676069", "0.6632677", "0.66055197", "0.6588383", "0.6580578", "0.6461093", "0.6456474", "0.6442683", "0.64402604", "0.64346385", "0.64128834", "0.64107823", "0.6392999", "0.6390571", "0.63831747", "0.6383004", "0.6370113", "0.63599634", "0.6358411", "0.6341433", "0.63368994", "0.6333739", "0.6331901", "0.63227004", "0.631103", "0.6297086", "0.62968963", "0.628717", "0.62842774", "0.6280562", "0.62752587", "0.62647426", "0.626436", "0.6257127", "0.62554795", "0.62544775", "0.62523925", "0.6249618", "0.6245106", "0.6242896", "0.6242536", "0.62371266", "0.62129956", "0.62129277", "0.61766726", "0.6173529", "0.6171801", "0.61697334", "0.61637324", "0.6153649", "0.6153283", "0.6147537", "0.6145134", "0.6140165", "0.61330146", "0.6128886", "0.61226034", "0.6121276", "0.6112992", "0.6112918", "0.6106595", "0.6099318", "0.60965705", "0.6092095", "0.6085842", "0.6064621", "0.6060087", "0.60570383", "0.60536295", "0.605037", "0.60495365", "0.60474753", "0.6032836", "0.6031583", "0.6020093", "0.60187894", "0.60179424", "0.6017344", "0.6003456", "0.5997626", "0.5994091", "0.5993234", "0.599087", "0.5989894", "0.5980751", "0.5980401", "0.5980401", "0.5978785", "0.5976563", "0.5976225", "0.5973528", "0.597271", "0.5972025", "0.5968968", "0.59674674", "0.5961025", "0.59609175", "0.5958384" ]
0.0
-1
From index.html onchange of selDataset
function optionChanged(SubjectID){ demographicInfo(SubjectID); barChart(SubjectID); bubbleChart(SubjectID); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function optionChanged(){\r\n var dropdownMenu = d3.select('#selDataset');\r\n var subjectID = dropdownMenu.property('value');\r\n// run the plot data function (which includes the dropdownValue function)\r\n plotData(subjectID);\r\n}", "function optionChanged () {\n id = d3.select('#selDataset').property('value');\n reload(id)\n return id\n}", "chooseData() {\n // ******* TODO: PART I *******\n //Changed the selected data when a user selects a different\n // menu item from the drop down.\n\n }", "chooseData() {\n // ******* TODO: PART I *******\n //Changed the selected data when a user selects a different\n // menu item from the drop down.\n\n }", "function optionChanged() {\n\tdropDownMenu=d3.select('#selDataset');\n\tid=dropDownMenu.property('value');\n\tconsole.log(id);\n\tbuildPlot(id);\n\n}", "function optionChanged(){\r\n var data=d3.select('option').node().value;\r\n getData(data)\r\n }", "function optionChanged(dataset) {\n console.log(dataset);\n charts(dataset);\n}", "function datasetChangeHandler(evt){\n while(selections.list.length > 0) {\n selections.removeSelection(selections.list[0]);\n }\n selectedSets.forEach(function(d){d.active=false;});\n that.draw();\n }", "function chooseData() {\n\n // ******* TODO: PART I *******\n //Changed the selected data when a user selects a different\n // menu item from the drop down.\n\tvar select = document.getElementById(\"dataset\");\n\tupdateBarChart(select.options[select.selectedIndex].value);\n\t\n}", "function optionChanged(passdata)\n{\n table(passdata);\n charts(passdata);\n}", "function optionChanged(id) {\n\n getData(id);\n}", "function optionChanged(id) {\n getData(id);\n}", "function chooseData() {\n // ******* TODO: PART I *******\n // Changed the selected data when a user selects a different\n // menu item from the drop down.\n window.barChart.update();\n\n}", "function selectDataset(datasetIndex){\n var datasetForm = document.getElementById(\"datasets\");\n datasetForm.options[datasetIndex].selected = !(datasetForm.options[datasetIndex].selected);\n //Focus the main select form, update the metadata for the options selected in the main select form\n datasetForm.focus();\n displayMetadata(datasetForm);\n}", "function optionChanged() { \n\n var testSubject = d3.select('#selDataset').node().value;\n buildPlot(testSubject)\n \n}", "function optionChanged(newSelection) {\n buildChart(newSelection);\n}", "function selectHandler() \n {\n var selectedItem = chart.getSelection()[0];\n if (selectedItem) \n {\n var selectedLevel = data.getValue(selectedItem.row, 0);\n var hidData = $(\"#hid\"+title+\"PieChartContainer\").val();\n \n if(hidData != undefined){\n var hid_ids = JSON.parse(hidData); \n var selected_ele_ids = hid_ids[selectedLevel];\n ViewerHighLight(selected_ele_ids);\n }\n }\n }", "function optionChanged(selection) {\n // Select the input value from the form\n plottingAll(selection);\n}", "function optionChanged() {\n // Obtain selected sample from dropdown\n var selectedSample = Plotly.d3.select('select').property('value'); \n console.log('selectsamle_value : ' , selectedSample)\n // Call plot function with the new sample value\n fillOutTable(selectedSample);\n buildCharts(selectedSample);\n buildGauges(selectedSample);\n}", "function selectionChanged(evt) {\n\t\tvar ctx = evt.data;\n\t\tvar $allSelected = $(this).find(':selected');\n\t\tvar value = $allSelected.attr('value');\n\t\tvar $selectedOptions = ctx.$options.find('[data-value=\"' + value + '\"]');\n\t\tselectUpdateValue(ctx, $selectedOptions, undefined, false);\n\t}", "function chooseData() {\n\n // ******* TODO: PART I *******\n // Copy over your HW2 code here\n var selected = document.getElementById('dataset');\n updateBarChart(selected.options[selected.selectedIndex].value);\n\n\n}", "function optionChanged() {\n // Select the input value from the selection\n var filter_year = d3.select('#selDataset').property('value');\n // console.log('filter_id:', filter_id);\n myPlot(filter_year);\n}", "function SelectionChange() { }", "function SelectionChange() { }", "function selMeasure() { // function that writes the data based on the dropdown selection\n var m = document.getElementById(\"sel\").value;\n writeData(m); \n }", "function chooseData(v) {\n\n console.log(v);\n\n\n // ******* TODO: PART I *******\n // Change the selected data when a user selects a different\n // menu item from the drop down.\n createBarChart(v);\n}", "function dd_change(selected_option) {\n $('.selectpicker').selectpicker('render');\n val = selected_option.attr(\"table\").substr(2)\n if (zoo != val) {\n zoo = val;\n set_zoo(selected_option.attr(\"search\"));\n }\n else {\n //updateData(selected_option.attr(\"search\"));\n };\n }", "function optionChanged(id) {\n display_data(id);\n dyna_demos(id);\n}", "function college_change() {\n var selectedIndex = d3.event.target.selectedIndex;\n var selectedDOMElement = d3.event.target.children[selectedIndex].value;\n drawMain(selectedDOMElement, container_width);\n }", "function optionChanged(sample_id){\n // Prevent the page from refreshing\n d3.event.preventDefault();\n // Select the input value from the dropdown\n var sample_id = d3.select(\"#selDataset\").node().value;\n console.log(sample_id);\n\n // d3.select(\"#selDataset\").node().value = \"\";\n // Call the plot and demo functions with the new sample_id\n buildPlots(sample_id);\n buildDemo(sample_id);\n }", "function changeData(){\n\tcurYear = sel.value();\n\tmyTitle.html(curYear + \": \" + lev);\n}", "function SelectionChange() {}", "function SelectionChange() {}", "function SelectionChange() {}", "function SelectionChange() {}", "function optionChanged (d) {\n console.log(\"option changed function\");\n const isNumber = (element) => element === d;\n var idx = (names.findIndex(isNumber));\n d3.selectAll(\"td\").remove();\n d3.selectAll(\"option\").remove();\n var dropMenu = d3.select(\"#selDataset\")\n dropMenu.append(\"option\").text(d); \n init(idx);\n}", "function getData() {\r\n var dropdownMenu = d3.select(\"#selDataset\");\r\n // Assign the value of the dropdown menu option to a variable\r\n var newTestID = dropdownMenu.property(\"value\").toString();\r\n plotFunc(newTestID);\r\n}", "function getSelectData( dataset ,key1 ,key2 ,key3 ,key4 ,target ) {\r\n var ajaxResult= AJAXRequest(\"POST\", BASE_URL + \"/getComboData\", \"dataset=\" + dataset + \"&key1=\" + key1+ \"&key2=\" + key2+ \"&key3=\" + key3+ \"&key4=\" + key4 + \"&target=\" + target);\r\n return ajaxResult;\r\n}", "function selectchange(x,res,selectedval,targetdiv)\n {\n \n }", "function onChangeSelect(){\n app.activeSoftware = [];\n selected = d3.select(this) // select the select\n .selectAll(\"option:checked\") // select the selected values\n .each(function() { \n app.activeSoftware.push(this.value);\n }); // for each of those, get its value\n createTable();\n}", "function optionChanged(year) {\n var dropdownMenu = d3.select(\"#selDataset\");\n var year = dropdownMenu.property(\"value\");\n buildBarChart(year);\n fetchData(year);\n }", "function useSelectedDataset() {\n let modUrl = \"/models-for-dataset?dataset=\" + getSelectedDatasetName();\n let imgUrl = \"/dataset-details?dataset=\" + getSelectedDatasetName();\n\n populateModels(modUrl);\n populateStaticImages(imgUrl);\n}", "function optionChanged(newSample) {\n getData(newSample, createCharts);\n}", "function optionChanged(newSample) {\n var dropDownMenu = d3.select('#selDataset');\n var subject = dropDownMenu.property('value');\n createBarChart(subject);\n createBubbleChart(subject);\n createDemographics(subject);\n createGaugeChart(subject);\n}", "function dropdownchange() {\n var dropdownMenu = d3.select(\"#myDropdown\");\n // Assign the value of the dropdown menu option to a variable\n var dataset = dropdownMenu.property(\"value\");\n // Initialize an empty array for the country's data\n var data = getData();\n console.log(data)\n\n if (dataset == 'us') {\n data = us;\n }\n else if (dataset == 'uk') {\n data = uk;\n }\n else if (dataset == 'canada') {\n data = canada;\n }\n // Call function to update the chart\n updatePlotly(data);\n }", "function dropdownchange() {\n var dropdownMenu = d3.select(\"#myDropdown\");\n // Assign the value of the dropdown menu option to a variable\n var dataset = dropdownMenu.property(\"value\");\n // Initialize an empty array for the country's data\n var data = getData();\n console.log(data)\n\n if (dataset == 'us') {\n data = us;\n }\n else if (dataset == 'uk') {\n data = uk;\n }\n else if (dataset == 'canada') {\n data = canada;\n }\n // Call function to update the chart\n updatePlotly(data);\n }", "function optionChanged (newSelection) {\n buildCharts(newSelection);\n buildMetadata(newSelection);\n}", "selectDataSource(data, sourceName, random) {\n let html = '<option class=\"existDataSource\">' + sourceName + '</option>';\n\n $('select.data').append(html);\n $('select.data').on('change', (e)=>{\n let data = this.props.reportData,\n name = $(e.target)[0][$(e.target)[0].selectedIndex].value,\n widgetConfig = $(e.target)[0].offsetParent.className,\n random = widgetConfig.split('_')[1];\n\n $(e.target)[0].selectedIndex > 1 ? this.chartDataSource(data, name, random) : null;\n });\n }", "function Changed(newSample) {\n// Fetch new data each time a new sample is selected\nbuildPlot(newSample);\noptionChanged(newSample);\n}", "function optionChanged(newSample){\n getData(newSample);\n getDemoData(newSample);\n\n}", "function optionChanged(){\n\n // Use D3 to get selected subject ID from dropdown \n subjectID = d3.select(\"#selDataset\").property(\"value\");\n console.log(subjectID)\n \n\n // Update Charts based on selected Student_ID\n topOTUBar(subjectID)\n topOTUBubble(subjectID)\n demographTable(subjectID)\n washingGauge(subjectID)\n\n \n\n}", "function y_select_change(self) {\n $(self).parent().find(\".attr-options\").fadeOut();\n var type = $(self).find(\":selected\").attr('type');\n if(type == \"gene\"){\n $(self).parent().find('.y-gene-attribute-select option:contains(\"select a specification\")').prop('selected', true);\n $(self).parent().find(\".y-gene-attribute-select\").fadeIn();\n var gene = $(self).find(\":selected\").val();\n } else {\n $(self).parent().find('.y-gene-attribute-select option:contains(\"select a specification\")').prop('selected', true);\n $(self).parent().find(\".y-gene-attribute-select\").fadeOut();\n $(self).parent().find(\"#y-data-type-container\").fadeOut();\n }\n }", "function onSelect(event) {\r\n refresh(JSON.parse(event.data));\r\n}", "function selectHandler() {\n var selectedItem = chart.getSelection()[0];\n if (selectedItem) {\n var value = data.getValue(selectedItem.row, selectedItem.column);\n alert('The user selected ' + value);\n }\n }", "function selectHandler() {\n var selectedItem = chart.getSelection()[0];\n if (selectedItem) {\n var value = data.getValue(selectedItem.row, selectedItem.column);\n alert('The user selected ' + value);\n }\n }", "handleSelected(event) {\n this.setData(event);\n }", "handleSelected(event) {\n this.setData(event);\n }", "function optionChanged(NextSample){\n ChartInfo(NextSample);\n AllData(NextSample);\n\n }", "function selectHandler() {\n var selectedItem = chart.getSelection()[0];\n if (selectedItem) {\n var value = data.getValue(selectedItem.row, selectedItem.column);\n alert('The user selected ' + value);\n }\n }", "function optionChanged(choose_data){\n console.log(choose_data)\n create_charts(choose_data)\n}", "function dropDownUpdate(){\n const idIndex = d3\n .select('body')\n .select('#selDataset')\n .property('value');\n \n d3.json('samples.json').then(data => {\n barChart(idIndex,data);\n bubbleChart(idIndex,data);\n demographics(idIndex, data);\n });\n}", "function optionChanged(newData){\n sample_metadata(newData);\n plotData(newData);\n}", "function MakeDataSetSelector(dataSets) {\n //Retrieve info on user datasets:\n dataSets = JSON.parse(dataSets);\n \n //First, we check whether there is a curdataset, if not, we select one:\n if (RetrieveLocalStorage(\"CurDataSet\") == \"null\") {\n ChangeLocalStorage(\"CurDataSet\", dataSets[0]);\n }\n\n let select = d3.select(\"#toolbar\")\n .append(\"select\")\n .attr(\"id\" , \"DataSetSelector\")\n .attr(\"onchange\" , \"OnChangeDataSetSelector()\");\n \n //Append options:\n var selector = document.getElementById(\"DataSetSelector\");\n let newOption = document.createElement(\"option\");\n newOption.text = RetrieveLocalStorage(\"CurDataSet\");\n selector.add(newOption);\n dataSets.forEach(function(d){ \n if(d != RetrieveLocalStorage(\"CurDataSet\")){\n let newOption = document.createElement(\"option\");\n newOption.text = d;\n selector.add(newOption);\n }\n });\n\n //dont mind me :)\n d3.select(\"#toolbar\").append(\"input\")\n .attr('type', 'color')\n .attr('value', 'black')\n .attr('id', 'msvColor') \n}", "function optionChanged(newID) {\n fillTable(newID);\n makeCharts(newID);\n}", "function optionChanged(id) {\n charting(id);\n meta(id);\n}// change(id)", "function populateDropDown() { \r\n \r\n // select the panel to put data\r\n var dropdown = d3.select('#selDataset');\r\n jsonData.names.forEach((name) => {\r\n dropdown.append('option').text(name).property('value', name);\r\n });\r\n \r\n // set 940 as place holder ID\r\n populatedemographics(jsonData.names[0]);\r\n visuals(jsonData.names[0]);\r\n }", "function optionChanged(newSelection) {\n console.log(newSelection);\n updateTable(newSelection);\n}", "function dropDown(names){\r\n //finding the element by ID in the HTML\r\n var selector = d3.select(\"#selDataset\")\r\n names.forEach(name => {\r\n selector.append(\"option\")\r\n .text(name)\r\n .property(\"value\", name);\r\n });\r\n optionChanged(names[0])\r\n}", "function selChanged(selId) {\n data.selId = selId;\n appNav.setProps({mdata: data});\n}", "function selFeature(value){\r\n //...\r\n }", "data(val) {\n\t\t\t\tif (!arguments.length) return data;\n\t\t\t\tdata = val;\n\t\t\t\t$sel.datum(data);\n\t\t\t\tChart.render();\n\t\t\t\treturn Chart;\n\t\t\t}", "data(val) {\n\t\t\t\tif (!arguments.length) return data;\n\t\t\t\tdata = val;\n\t\t\t\t$sel.datum(data);\n\t\t\t\tChart.render();\n\t\t\t\treturn Chart;\n\t\t\t}", "data(val) {\n\t\t\t\tif (!arguments.length) return data;\n\t\t\t\tdata = val;\n\t\t\t\t$sel.datum(data);\n\t\t\t\tChart.render();\n\t\t\t\treturn Chart;\n\t\t\t}", "data(val) {\n\t\t\t\tif (!arguments.length) return data;\n\t\t\t\tdata = val;\n\t\t\t\t$sel.datum(data);\n\t\t\t\tChart.render();\n\t\t\t\treturn Chart;\n\t\t\t}", "data(val) {\n\t\t\t\tif (!arguments.length) return data;\n\t\t\t\tdata = val;\n\t\t\t\t$sel.datum(data);\n\t\t\t\tChart.render();\n\t\t\t\treturn Chart;\n\t\t\t}", "data(val) {\n\t\t\t\tif (!arguments.length) return data;\n\t\t\t\tdata = val;\n\t\t\t\t$sel.datum(data);\n\t\t\t\tChart.render();\n\t\t\t\treturn Chart;\n\t\t\t}", "function dropDown() {\n // Use list of sample names to render the select options\n Plotly.d3.json(\"/names\", function (error, response) {\n if (error) return console.warn(error);\n\n let selection = document.getElementById(\"select-dataset\");\n for (let i = 0; i < response.length; i++) {\n let selectedOption = document.createElement(\"option\");\n selectedOption.text = response[i];\n selectedOption.value = response[i];\n selection.appendChild(selectedOption);\n }\n getData(response[0], createCharts);\n });\n}", "function onSelected($e, datum) {\n onAutocompleted($e,datum);\n }", "build() {\n this.$node.append('label')\n .attr('for', 'ds')\n .text(Language.DATA_SET);\n // create select and update hash on property change\n this.$select = this.$node.append('select')\n .attr('id', 'ds')\n .classed('form-control', true)\n .on('change', () => {\n const selectedData = this.$select.selectAll('option')\n .filter((d, i) => i === this.$select.property('selectedIndex'))\n .data();\n AppContext.getInstance().hash.setProp(AppConstants.HASH_PROPS.DATASET, selectedData[0].key);\n AppContext.getInstance().hash.removeProp(AppConstants.HASH_PROPS.TIME_POINTS);\n AppContext.getInstance().hash.removeProp(AppConstants.HASH_PROPS.DETAIL_VIEW);\n AppContext.getInstance().hash.removeProp(AppConstants.HASH_PROPS.SELECTION);\n if (selectedData.length > 0) {\n GlobalEventHandler.getInstance().fire(AppConstants.EVENT_DATA_COLLECTION_SELECTED, selectedData[0].values);\n this.trackSelections(selectedData[0].values[0].item);\n }\n });\n }", "function selFeature(value){\n //...\n }", "function selFeature(value){\n //...\n }", "function updateFilter(selectFilter,filterType){\n var displayText = \"<h4>Select a Dataset:</h4>\";\n //Grab the main form that displays the dataset selection\n var datasetForm = document.getElementById(\"datasets\");\n for (filterIndex=0; filterIndex<selectFilter.options.length; filterIndex++) {\n if (selectFilter.options[filterIndex].selected) {\n //Grab the filter from the selected value\n var filter = selectFilter.options[filterIndex].value;\n //For each dataset option (pulled from the main selection form)\n for (datasetIndex=0; datasetIndex<datasetForm.options.length; datasetIndex++) {\n if(metadata[datasetIndex][filterType] == filter){\n //Wrap the metadata in a clickable element- take action when the dataset is selected\n displayText += \"<div class='filteredOption' onClick='selectDataset(\"+datasetIndex+\")'>\";\n displayText += getMetadataDisplay(metadata[datasetIndex]);\n displayText += \"</div>\"\n\n }\n }\n }\n }\n //Updated the selectable datasets from the filtered option\n var textElement = document.getElementById('filterDatasets');\n textElement.innerHTML = displayText;\n}", "function onChange(e){\n\t\tvar dd = ae$('.csb-dd')\n\t\tif( !dd || dd.parentSelector != el ) dd = el\n\t\tdd.ae$ae$('[data-name]').classList.remove('selected')\n\t\tel.selectedOptions.forEach(function(opt){\n\t\t\tvar line\n\t\t\tvar value = encodeURI( opt.value )\n\t\t\tline = dd.ae$('.csb-option[data-value=\"'+ value +'\"]')\n\t\t\tif(line) line.classList.add('selected')\n\t\t})\n\t}", "function optionChanged(newSampleID)\n\n { \n //Log new selection\n console.log(`User selected ${newSampleID}`) ;\n\n //Run functions to display data\n FillMetaData(newSampleID) ;\n\n DrawBarGraph(newSampleID) ;\n\n DrawBubbleChart(newSampleID) ;\n\n }", "function on_change_var1(string) {\n self._var1 = string;\n\n //https://stackoverflow.com/questions/1085801/get-selected-value-in-dropdown-list-using-javascript\n var e = document.getElementById(\"var2\");\n self._var2 = e.options[e.selectedIndex].value;\n\n document.getElementById(\"scatter\").innerHTML = '';\n // console.log(\"change var 1\");\n // console.log(\"var 1: \" + self._var1);\n // console.log(\"var 2: \" + self._var2);\n // self._pcp = parallelCoordinatesChart(\"pcp\", self._data, self._colors, dimensions, self.callback_applyBrushFilter);\n self._scatter = scatter(\"scatter\", self._data_selected, self._var1, self._var2, self._pcp.highlight_single);\n // self._dataTable = dataTable(\"data-table\", self._data_selected, dimensions, self._colors, self._pcp.highlight_single)\n\n}", "function optionChanged(selectedPatientID) {\n console.log(selectedPatientID);\n buildCharts(selectedPatientID);\n populateDemographicInfo(selectedPatientID);\n}", "function selectedData(event) {\n displayProblems();\n}", "function chooseData() {\n\n //Changed the selected data when a user selects a different\n // menu item from the drop down.\n\n var data = $(\"#controls > div > button > span.filter-option.pull-left\").text();\n updateMap(data);\n}", "function ondatachange() {\n XayDungChuoiGiaTriSearch();\n}", "function init() {\n \n var selector = d3.select(\"#selDataset\");\n d3.json(\"samples.json\").then(function(data){\n var IDNames = data.names;\n IDNames.forEach(function(userchoice){\n selector\n .append(\"option\")\n .text(userchoice)\n .property(\"value\", userchoice);\n });\n var beginning = IDNames[0];\n ChartInfo(beginning);\n AllData(beginning);\n });\n }", "function changeData() {\n // // Load the file indicated by the select menu\n let dataFile = document.getElementById('dataset').value;\n if (document.getElementById('random').checked) {\n randomSubset();\n }\n else {\n d3.csv('data/' + dataFile + '.csv', update);\n }\n}", "function dropdownChange() {\n var newYear = d3.select(this).property('value');\n axes(slide,newYear);\n cars(slide,newYear);\n}", "_onColumnChange(e) {\n this.selected = e.detail.value;\n this._updateCols(parseInt(e.detail.value));\n }", "onchange() {}", "onDataChange() {}", "function getData() {\n var dropdownMenu = d3.select(\"#selDataset\");\n // Assign the value of the dropdown menu option to a variable\n var dataset = dropdownMenu.property(\"value\");\n // Initialize an empty array for the country's data\n var data = [];\n\n if (dataset == 'all') {\n data = all;\n }\n else if (dataset == 'Texas') {\n data = Texas;\n }\n else if (dataset == 'California') {\n data = Cali;\n }\n else if (dataset == 'Montana') {\n data = Mont;\n }\n else if (dataset == 'Florida') {\n data = Flor;\n}\n // Call function to update the chart\n updatePlotly(data);\n}", "function getData() {\n var dropdownMenu = d3.select(\"#selDataset\");\n // Assign the value of the dropdown menu option to a variable\n var dataset = dropdownMenu.property(\"value\");\n // Initialize an empty array for the country's data\n // Call function to update the chart\n updatePlotly(data);\n}", "function optionChanged (sample) {\ndemographic_panel(sample);\ncreate_charts(sample);\n}", "function optionChanged(id) {\n doplot(id);\n getInfo(id);\n}", "function optionChanged(id) {\n plot_samples(id);\n get_demographics(id);\n}", "onTreeSelectionChanged(selectedDatasets) {\n this.attribValidationMessage = '';\n this.attribValidationState = '';\n this.multiselectValidationClass = '';\n if(selectedDatasets.length === 0) {\n this.attribValidationState = 'error';\n this.multiselectValidationClass = 'tree-multi-select-error';\n this.attribValidationMessage = \"Dataset Attrbutes are Required\";\n } else {\n this.multiselectValidationClass = 'tree-multi-select-success';\n this.attribValidationState = 'success';\n }\n this.forceUpdate();\n }" ]
[ "0.71637946", "0.71618605", "0.7111019", "0.7111019", "0.7102964", "0.70220983", "0.6930491", "0.6880302", "0.68738693", "0.6864434", "0.6852886", "0.6849894", "0.6821627", "0.67366636", "0.67059267", "0.66800827", "0.66518974", "0.6645639", "0.6625451", "0.6608131", "0.6600475", "0.6596315", "0.6595742", "0.6595742", "0.6580738", "0.65486735", "0.65361565", "0.652843", "0.6513551", "0.6503492", "0.650302", "0.64919674", "0.64919674", "0.64919674", "0.64919674", "0.64900035", "0.64423096", "0.64223063", "0.64163154", "0.6411603", "0.6401511", "0.6391235", "0.63821846", "0.6374427", "0.63590294", "0.63590294", "0.634881", "0.63403267", "0.6332757", "0.6332015", "0.6287471", "0.6285666", "0.6282169", "0.62253016", "0.62253016", "0.62196136", "0.62196136", "0.6215456", "0.6207497", "0.6197203", "0.6196554", "0.618887", "0.61814624", "0.6176946", "0.6166872", "0.6163935", "0.6160943", "0.6153847", "0.6146247", "0.6144212", "0.61415476", "0.61415476", "0.61415476", "0.61415476", "0.61415476", "0.61415476", "0.61242247", "0.6088509", "0.60836077", "0.6069385", "0.6069385", "0.6065975", "0.60643", "0.60474765", "0.6044664", "0.60445404", "0.6036879", "0.60363793", "0.6026404", "0.6023085", "0.6011508", "0.59974724", "0.59958315", "0.5992325", "0.59892607", "0.59840184", "0.59762204", "0.596686", "0.5965608", "0.5959766", "0.5958686" ]
0.0
-1
Advanced challenge Gauge Char
function buildGauge(wfreq) { console.log(wfreq); var level = parseFloat(wfreq) * 20; var degrees = 180 - level; var textlevel = level / 20; var radius = 0.5; var radians = (degrees * Math.PI) / 180; var x = radius * Math.cos(radians); var y = radius * Math.sin(radians); var mainPath = "M -.0 -0.05 L .0 0.05 L "; var pathX = String(x); var space = " "; var pathY = String(y); var pathEnd = " Z"; var path = mainPath.concat(pathX, space, pathY, pathEnd); var data = [ { type: "scatter", x: [0], y: [0], marker: { size: 20, color: "#f2096b" }, showlegend: false, name: "Washing Frequency", text: textlevel, hoverinfo: "name" }, { values: [50 / 9, 50 / 9, 50 / 9, 50 / 9, 50 / 9, 50 / 9, 50 / 9, 50 / 9, 50 / 9, 50], rotation: 90, text: ["8-9", "7-8", "6-7", "5-6", "4-5", "3-4", "2-3", "1-2", "0-1", ""], textinfo: "text", textposition: "inside", marker: { colors: [ "#85b788", "#8bbf8f", "#8dc386", "#b7cf90", "#d5e79a", "#e5e9b0", "#eae8ca", "#f5f2e5", "#f9f3ec", "#ffffff" ] }, labels: ["8-9", "7-8", "6-7", "5-6", "4-5", "3-4", "2-3", "1-2", "0-1", ""], hoverinfo: "label", hole: 0.5, type: "pie", showlegend: false } ]; var layout = { shapes: [ { type: "path", path: path, fillcolor: "#f2096b", line: { color: "#f2096b" } } ], title: "<b>Belly Button Washing Frequency</b> <br> Scrubs per Week", height: 500, width: 500, xaxis: { zeroline: false, showticklabels: false, showgrid: false, range: [-1,1] }, yaxis: { zeroline: false, showticklabels: false, showgrid: false, range: [-1, 1] } }; Plotly.newPlot("gauge", data, layout); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function disarm_cg_insig() {\r\n while (dcgi < dcgs.length) {\r\n var c = dcgs.charAt(dcgi++).toUpperCase();\r\n if ((c >= \"A\") && (c <= \"Z\")) {\r\n //dump(\"c\", c);\r\n return c;\r\n }\r\n }\r\n return \"\";\r\n}", "function lettersToGuess() {\n var i ;\n var toGess = 0 ;\n for (i in progressWord) {\n if (progressWord[i] === \"__\")\n toGess++;\n }\n return toGess;\n }", "getLetter(gpa) {\n //https://stackoverflow.com/questions/6665997/switch-statement-for-greater-than-less-than\n if (gpa > 3.5) {\n return \"AA\"\n }\n if (gpa > 3) {\n return \"BA\"\n }\n if (gpa > 2.5) {\n return \"BB\"\n }\n if (gpa > 2) {\n return \"CB\"\n }\n if (gpa > 1.5) {\n return \"CC\"\n }\n\n return \"FF\"\n\n\n }", "function oneAsciiChar(\n singleIntChar,\n perSingleCharPoints,\n fullWidth,\n fullHeight,\n startingSizeRadius,\n areaWidth,\n areaHeight,\n startingAlpha,\n startingR,\n startingG,\n startingB,\n startingClrPlus,\n startingRunnerClrIncUpR,\n startingRunnerClrIncUpG,\n startingRunnerClrIncUpB) {\n\n this.allCharDefinitionData = new Array(perSingleCharPoints);\n\n // WE HAVE SIX SAME DIGITS PER ONE CHAR !\n for (var fdg = 0; fdg < this.allCharDefinitionData.length; fdg++) {\n this.allCharDefinitionData[fdg] = new Array(6);\n }\n\n // Char Width / Height calculation\n this.oneCharWidth = fullWidth / 10; // So we have some space left for chars alignment\n this.oneCharHeight = fullHeight - (this.oneCharWidth); // So we have some space left for chars alignment\n\n var tmpPoints;\n\n // For INPUT-param singleIntChar build specific char-points\n\n tmpPoints = eval('constructChar_' + singleIntChar.toString() + '(perSingleCharPoints, this.oneCharWidth, this.oneCharHeight);');\n\n for (var j = 0; j < tmpPoints.length; j++) {\n\n // WE HAVE SIX SAME DIGITS PER ONE CHAR !\n for (var sixdigits = 0; sixdigits < 6; sixdigits++) {\n\n this.allCharDefinitionData[j][sixdigits] =\n new oneAnimRunner(\n startingSizeRadius,\n areaWidth,\n areaHeight,\n startingAlpha,\n startingR,\n startingG,\n startingB,\n startingClrPlus,\n startingRunnerClrIncUpR,\n startingRunnerClrIncUpG,\n startingRunnerClrIncUpB,\n -1); // This number IRRELEVANT here !\n\n this.allCharDefinitionData[j][sixdigits].runnerX = tmpPoints[j][0];\n this.allCharDefinitionData[j][sixdigits].runnerY = tmpPoints[j][1];\n\n this.allCharDefinitionData[j][sixdigits].runnerStartingXBackup = this.allCharDefinitionData[j][sixdigits].runnerX;\n this.allCharDefinitionData[j][sixdigits].runnerStartingYBackup = this.allCharDefinitionData[j][sixdigits].runnerY;\n\n // FULL BACKUP OF ORIGINAL POSITION !\n this.allCharDefinitionData[j][sixdigits].runnerStartingXBackupFULL = this.allCharDefinitionData[j][sixdigits].runnerX;\n this.allCharDefinitionData[j][sixdigits].runnerStartingYBackupFULL = this.allCharDefinitionData[j][sixdigits].runnerY;\n }\n }\n\n // Randomize in the begining which point where inside the single-char\n this.allCharDefinitionData.sort(function () { return (0.5 - Math.random()); });\n\n return;\n }", "function armour_cg_outletter(l) {\r\n if (acgg.length >= 5) {\r\n armour_cg_outgroup();\r\n }\r\n acgg += l;\r\n}", "function guessChar(z){\n guess();\n}", "gameOver() {\n const {matchedKeys, letter, error} = this.state;\n let goodLetters = 0;\n letter.forEach((element) => {\n if (matchedKeys.includes(element)) goodLetters++;\n });\n if (goodLetters === letter.length) return 'won';\n if (error >= 10) return 'loose';\n else return 'playing';\n }", "function getPigLatin(input){\n console.log\n let r =\"\";\n let start = \"\";\n let flg = false;\n let checkSC = false;\n let len =0;\n if(input[0] === input[0].toUpperCase()) flg = true;\n if(input[input.length-1].toUpperCase() === input[input.length-1].toLowerCase()) checkSC= true;\n if(checkSC) len = input.length-1;\n else len = input.length\n for(let i=0; i<len;i++){\n if(input[i] === 'a' || input[i]=== 'e' || input[i] === 'i' || input[i]==='o' || input[i]==='u'){\n start = input.slice(0,i)\n if(checkSC) r= (input.slice(i,len) + start + \"ay\"+ input[len]).toLowerCase();\n else r= (input.slice(i,len) + start + \"ay\").toLowerCase();\n\n break;\n }\n }\n if(flg) return r[0].toUpperCase()+r.slice(1);\n else return r;\n}", "function hachage(chaine) {\n let condensat = 0;\n \n for (let i = 0; i < chaine.length; i++) {\n condensat = (condensat +chaine.charCodeAt(i) * 3 ** i) % 65536;\n }\n \n return condensat;\n}", "function lettersToGuess() {\n var toGuess = 0;\n for (i in progressWord) {\n if (progressWord[i] === \"_\")\n toGuess++;\n }\n return toGuess;\n }", "generateChar()\n {\n let randVal = floor(random(0,this.geneLength));\n return randVal;\n }", "pointDegradation(addToPaper){cov_1rtpcx8cw8.f[2]++;const letters=(cov_1rtpcx8cw8.s[6]++,addToPaper.split(''));let availableLetters=(cov_1rtpcx8cw8.s[7]++,'');// When you reach the end of the string, get out of loop\ncov_1rtpcx8cw8.s[8]++;for(let i=0;i<letters.length;i++){cov_1rtpcx8cw8.s[9]++;// If durability ever reaches 0, sharpen pencil\nif(this.durability===0){cov_1rtpcx8cw8.b[1][0]++;cov_1rtpcx8cw8.s[10]++;console.log(`Your pencil has a durability of 0! You need to sharpen it! Here's what I've written ${availableLetters}`);}else{cov_1rtpcx8cw8.b[1][1]++;}cov_1rtpcx8cw8.s[11]++;if((cov_1rtpcx8cw8.b[3][0]++,this.durability===0)&&(cov_1rtpcx8cw8.b[3][1]++,this.length===0)){cov_1rtpcx8cw8.b[2][0]++;cov_1rtpcx8cw8.s[12]++;break;}else{cov_1rtpcx8cw8.b[2][1]++;}// Check how many letters of the string you can write with pencil\ncov_1rtpcx8cw8.s[13]++;availableLetters+=letters[i];cov_1rtpcx8cw8.s[14]++;if(letters[i]===' '){cov_1rtpcx8cw8.b[4][0]++;cov_1rtpcx8cw8.s[15]++;this.durability-=0;}else{cov_1rtpcx8cw8.b[4][1]++;cov_1rtpcx8cw8.s[16]++;if((cov_1rtpcx8cw8.b[6][0]++,letters[i]!==letters[i].toUpperCase())||(cov_1rtpcx8cw8.b[6][1]++,letters[i].match(/^[.,:!?]/))){cov_1rtpcx8cw8.b[5][0]++;cov_1rtpcx8cw8.s[17]++;this.durability-=1;}else{cov_1rtpcx8cw8.b[5][1]++;cov_1rtpcx8cw8.s[18]++;if(letters[i]===letters[i].toUpperCase()){cov_1rtpcx8cw8.b[7][0]++;cov_1rtpcx8cw8.s[19]++;this.durability-=2;}else{cov_1rtpcx8cw8.b[7][1]++;}}}}cov_1rtpcx8cw8.s[20]++;return availableLetters;}", "function remainingChar() {\n let pendingChar = falseChar;\n falseChar = 0;\n for (var i = 0; i < pendingChar; i++) {\n console.log(\"remaining \" + i);\n randomChar();\n pushPassword();\n }\n }", "function solution(S) {\n let lowerS = S.toLowerCase();\n var occurrences = new Array(26);\n //set every letter as array index, and occurrences as 0 to initialize\n for (var i = 0; i < occurrences.length; i++) {\n occurrences[i] = 0;\n }\n // for ( <var> in <string> ) {\n // returns index of each element of string;\n // for ( <var> of <string> ) {\n // returns each character of string\n \n //for (var id in lowerS) {\n for (let id = 0; id < lowerS.length; id++) {\n //id yields the index of the characters in lowerS\n //lowerS.charCodeAt(id) yields the character code at position id of lower\n // Code: 104 id: 0 lowerS[id]: h\n // code - 'a'.charCodeAt(0) = 104 - 97 = 7\n // Code: 101 id: 1 lowerS[id]: e\n // code - 'a'.charCodeAt(0) = 101 - 97 = 4\n // Code: 108 id: 2 lowerS[id]: l\n // code - 'a'.charCodeAt(0) = 108 - 97 = 11\n // Code: 108 id: 3 lowerS[id]: l\n // code - 'a'.charCodeAt(0) = 108 - 97 = 11\n // Code: 111 id: 4 lowerS[id]: o\n // code - 'a'.charCodeAt(0) = 111 - 97 = 14\n let code = lowerS.charCodeAt(id);\n console.log(\"Code: \", code, \" id: \", id, \" lowerS[id]: \", lowerS[id]);\n //Subtracting the character code of 'a' from code yields the character # of a-z (0-25)\n let index = code - 'a'.charCodeAt(0);\n console.log(`code - 'a'.charCodeAt(0) = ${code} - ${'a'.charCodeAt(0)} = ${index}`);\n occurrences[index]++;\n }\n console.log(\"New occurrences: \", occurrences);\n\n var best_char = 'a';\n var best_res = occurrences[0]; //replace 0 with the actual value of occurrences of 'a'\n\n //starting i at 1, because we've already set best_char = 'a' and 'a's occurrences.\n for (var i = 1; i < 26; i++) {\n if (occurrences[i] >= best_res) {\n //Now reverse this from an index (i) to a character code (fromCharCode) to a character (best_char)\n best_char = String.fromCharCode('a'.charCodeAt(0) + i);\n best_res = occurrences[i];\n }\n }\n\n return best_char;\n}", "function fearNotLetter(str) {\n let answerArray = [];\n\n [...str].forEach((x, i) => {\n answerArray.push(str.charCodeAt(i));\n });\n\n for (let i = 0; i < answerArray.length - 1; i++) {\n if ((answerArray[i] + 1) !== answerArray[i + 1]) {\n console.log(\"this one \" + String.fromCharCode(answerArray[i] + 1));\n return String.fromCharCode(answerArray[i] + 1);\n }\n }\n console.log(undefined);\n return undefined;\n}", "function leetspeak(str) {\n var newChar = {\n A:4,\n E:3,\n G:6,\n I:1,\n O:0,\n S:5,\n T:7\n }\n var keys = Object.keys(newChar)\n var newStr = str.toUpperCase()\n var final = ''\n for (var i = 0; i < newStr.length; i++) {\n let character = newStr.charAt(i)\n if (keys.includes(character)) {\n final += newChar[character]\n } else final += character\n }\n return final.toLowerCase()\n}", "function idGua(guaCode) {\n\t//Gua[0] is the upper trigram; Gua[1] is the lower trigram\n var jiuGua = 0, //Old situation\n\tyiGua = 0, //The situation which affects the change\n\txinGua =0; //New situation\n\n\tfor (i=0; i<6; i++) {\n\t if (guaCode[i] === 3) { //Yang changes to Yin\n\t\tjiuGua += 9 * (Math.pow(10,i));\t//Yang\n\t\tyiGua += 9 * (Math.pow(10,i));\t//Active\n\t\txinGua += 6 * (Math.pow(10,i));\t//Yin\n\t } else if (guaCode[i] === 4) { //Yin stays yin\n\t\tjiuGua += 6 * (Math.pow(10,i));\t//Yin\n\t\tyiGua += 6 * (Math.pow(10,i));\t//Passive\n\t\txinGua += 6 * (Math.pow(10,i));\t//Yin\n\t } else if (guaCode[i] === 5) { //Yang stays Yang\n\t\tjiuGua += 9 * (Math.pow(10,i));\t//Yang\n\t\tyiGua += 6 * (Math.pow(10,i));\t//Passive\n\t\txinGua += 9 * (Math.pow(10,i));\t//Yang\n\t } else { //if (guaCode[i] === 6) { //Yin changes to Yang\n\t\tjiuGua += 6 * (Math.pow(10,i));\t//Yin\n\t\tyiGua += 9 * (Math.pow(10,i));\t//Active\n\t\txinGua += 9 * (Math.pow(10,i));\t//Yang\n\t }\n\t}\n\n\tfunction nameGua(gua) {\n\t\tif (gua === 669669) {\n\t\t\treturn '51';\n\t\t} else if (gua === 969669) {\n\t\t\treturn '21';\n\t\t} else if (gua === 699669) {\n\t\t\treturn '17';\n\t\t} else if (gua === 999669) {\n\t\t\treturn '25. Wu Wang: Innocence |||';\n\t\t} else if (gua === 996669) {\n\t\t\treturn '42. Yi: Increase |||';\n\t\t} else if (gua === 696669) {\n\t\t\treturn '3';\n\t\t} else if (gua === 966669) {\n\t\t\treturn '27. Yi: The corners of the Mouth |||';\n\t\t} else if (gua === 666669) {\n\t\t\treturn '24. Fu: Return ||';\n\n\n\t\t} else if (gua === 669969) {\n\t\t\treturn '55';\n\t\t} else if (gua === 969969) {\n\t\t\treturn '30';\n\t\t} else if (gua === 699969) {\n\t\t\treturn '49';\n\t\t} else if (gua === 999969) {\n\t\t\treturn '13. Tong Ren: Fellowship with People |||';\n\t\t} else if (gua === 996969) {\n\t\t\treturn '37';\n\t\t} else if (gua === 696969) {\n\t\t\treturn '63';\n\t\t} else if (gua === 966969) {\n\t\t\treturn '22';\n\t\t} else if (gua === 666969) {\n\t\t\treturn '36';\n\n\n\t\t} else if (gua === 669699) {\n\t\t return '54';\n\t\t} else if (gua === 969699) {\n\t\t return '38';\n\t\t} else if (gua === 699699) {\n\t\t return '58';\n\t\t} else if (gua === 999699) {\n\t\t return '10. Lu: Treading |||';\n\t\t} else if (gua === 996699) {\n\t\t return '61. Zhong Fu: Inner Truth |||';\n\t\t} else if (gua === 696699) {\n\t\t return '60';\n\t\t} else if (gua === 966699) {\n\t\t return '41. Sun: Decrease |||';\n\t\t} else if (gua === 666699) {\n\t\t return '19. Lin: Approach ||';\n\n\n\t\t} else if (gua === 669999) {\n\t\t return '34. Da Zhuang: The Power of the Great ||';\n\t\t} else if (gua === 969999) {\n\t\t return '14. Da Yu: Possession in Great Measure |||';\n\t\t} else if (gua === 699999) {\n\t\t return '43. Guai: Break-through ||';\n\t\t} else if (gua === 999999) {\n\t\t return '1. Qian: The Creative |';\n\t\t} else if (gua === 996999) {\n\t\t return '9. Xiao Chu: The Taming Power of the Small |||';\n\t\t} else if (gua === 696999) {\n\t\t return '5';\n\t\t} else if (gua === 966999) {\n\t\t return '26. Da Chu: The Taming Power of the Great |||';\n\t\t} else if (gua === 666999) {\n\t\t return '11. Tai: Peace ||';\n\n\n\t\t} else if (gua === 669996) {\n\t\t return '32. Heng: Duration |||';\n\t\t} else if (gua === 969996) {\n\t\t return '50';\n\t\t} else if (gua === 699996) {\n\t\t return '28. Da Guo: Preponderance of the Great |||';\n\t\t} else if (gua === 999996) {\n\t\t return '44. Gou: Coming to Meet ||';\n\t\t} else if (gua === 996996) {\n\t\t return '57';\n\t\t} else if (gua === 696996) {\n\t\t return '48';\n\t\t} else if (gua === 966996) {\n\t\t return '18';\n\t\t} else if (gua === 666996) {\n\t\t return '46. Sheng: Pushing Upward |||';\n\n\n\t\t} else if (gua === 669696) {\n\t\t return '40';\n\t\t} else if (gua === 969696) {\n\t\t return '64';\n\t\t} else if (gua === 699696) {\n\t\t return '47';\n\t\t} else if (gua === 999696) {\n\t\t return '6';\n\t\t} else if (gua === 996696) {\n\t\t return '59';\n\t\t} else if (gua === 696696) {\n\t\t return '29';\n\t\t} else if (gua === 966696) {\n\t\t return '4';\n\t\t} else if (gua === 666696) {\n\t\t return '7. Shi: The Army |||';\n\n\n\t\t} else if (gua === 669966) {\n\t\t return '62. Xiao Guo: Preponderance of the Small |||';\n\t\t} else if (gua === 969966) {\n\t\t return '56';\n\t\t} else if (gua === 699966) {\n\t\t return '31. Xian: Influence |||';\n\t\t} else if (gua === 999966) {\n\t\t return '33. Dun: Retreat ||';\n\t\t} else if (gua === 996966) {\n\t\t return '53';\n\t\t} else if (gua === 696966) {\n\t\t return '39';\n\t\t} else if (gua === 966966) {\n\t\t return '52';\n\t\t} else if (gua === 666966) {\n\t\t return '15. Qian: Modesty |||';\n\n\n\t\t} else if (gua === 669666) {\n\t\t return '16. Yu: Enthusiasm |||';\n\t\t} else if (gua === 969666) {\n\t\t return '35';\n\t\t} else if (gua === 699666) {\n\t\t return '45. Cui: Gathering Together |||';\n\t\t} else if (gua === 999666) {\n\t\t return '12. Pi: Standstill ||';\n\t\t} else if (gua === 996666) {\n\t\t return '20. Guan: Contempation ||';\n\t\t} else if (gua === 696666) {\n\t\t return '8. Bi: Holding Together |||';\n\t\t} else if (gua === 966666) {\n\t\t return '23. Bo: Splitting Apart ||';\n\t\t} else if (gua === 666666) {\n\t\t return '2. Kun: The Receptive |';\n\t\t} else { return gua; }\n\t}\n\t\n\treturn (nameGua(jiuGua) + '\\n' + nameGua(yiGua) + '\\n' + nameGua(xinGua));\n\t//return jiuGua + '\\n' + yiGua + '\\n' + xinGua;\n}", "function scrabbleScore(word) {\n\tword = word.toLowerCase();\n\tlet letterPoints = 0;\n\tfor(let i=0; i < word.length; i++){\n\t\tletterPoints += Number(newPointStructure[word[i]]);\n\t}\n\t\t\t\t\treturn letterPoints;\n}", "function NewLetter () {\n CompLetter = Letters[Math.floor(Math.random() * Letters.length)];\n GuessesLeft = 9\n GuessesSoFar = \"\";\n}", "function incrementPasswordChar(char) {\n if (char === \"z\") {\n return \"a\";\n } else if (char === \"Z\") {\n return \"A\";\n } else if (char === 9) {\n return 0;\n }\n // return String.fromCharCode(char.charCodeAt(0) + 1);\n let charCode = char.charCodeAt(); // turns char into number\n let encryptedCharCode = charCode + 1; // increases number by 1\n let encryptedCodeString = String.fromCharCode(encryptedCharCode); // returns number back to string\n return encryptedCodeString;\n }", "function collectChar(choice){\n var addChar;\n if(choice === 0){\n addChar = getLower();\n }\n else if(choice === 1){\n addChar = getUpper();\n }\n else if(choice === 2){\n addChar = getNum();\n }\n else{\n addChar = getSpecial();\n }\n return(addChar);\n}", "function charFreq(string){\n //...\n}", "function charFreq(string){\n //...\n}", "function leetspeak (str) {\n str2 = str.charAt(0).toLowerCase()\n str3 = str.slice(1)\n str4 = str2 + str3\n str4 = str4.replace(/A/gi,4)\n str4 = str4.replace(/E/gi,3)\n str4 = str4.replace(/G/gi,6)\n str4 = str4.replace(/I/gi,1)\n str4 = str4.replace(/O/gi,0)\n str4 = str4.replace(/S/gi,5)\n str4 = str4.replace(/T/gi,7)\n return str4\n}", "function change(g) {\n if (!changing || g == 26) {\n document.getElementById('score').innerHTML = g;\n shown[pos] = alphabet[g];\n pos++;\n isFinished();\n\n //replace shown word with guessed word.\n update();\n document.getElementById('score').innerHTML = stats.score;\n }\n\n\n}", "compute(input) {\n if (typeof input !== \"string\" || input === \"\")\n return null;\n\n if (!this.patt_a.test(input))\n return undefined;\n\n if (!this.cs) input = input.toUpperCase();\n let appLen = input.length;\n let chkLen = 1 + this.dblchk;\n let wLen = this.w.length;\n let S = 0;\n let i = appLen;\n while (i > 0) {\n let a = this.acsEnum[input.charAt(i - 1)];\n if (wLen + i > appLen + chkLen) //if character position is within preset weight array, then use preset\n S += a * this.w[appLen + chkLen - i];\n else //if character position is beyond preset weight array, then calculate its weight\n S += a * Math.pow(this.r, appLen + chkLen - i);\n i--;\n }\n\n if (this.dblchk) {\n let V = this.M + this.R - S % this.M;\n let quotient = ~~(V / this.r);\n let remainder = V - quotient * this.r;\n return this.ccs.charAt(quotient) + this.ccs.charAt(remainder);\n } else {\n return this.ccs.charAt((this.M + this.R - S % this.M) % this.M);\n }\n }", "function encryptorMassive(word) {\n let newWord = '';\n word = word.toLowerCase();\n for(let i = 0; i < word.length; i++) {\n if(word[i] == 'a') {\n newWord += 4;\n } else if(word[i] == 's') {\n newWord += 5;\n } else if(word[i] == 'i') {\n newWord += 1;\n } else if(word[i] == 'e') {\n newWord += 3;\n } else if(word[i] == 'o') {\n newWord += 0;\n } else {\n newWord += word[i];\n }\n }\n console.log(newWord);\n}", "function grade_changer(letter_grade) {\n var grade\n if (letter_grade == \"A+\") {\n grade = 15;\n } else if (letter_grade == \"A\") {\n grade = 14;\n } else if (letter_grade == \"A-\") {\n grade = 13;\n } else if (letter_grade == \"B+\") {\n grade = 12;\n } else if (letter_grade == \"B\") {\n grade = 11;\n } else if (letter_grade == \"B-\") {\n grade = 10;\n } else if (letter_grade == \"C+\") {\n grade = 9;\n } else if (letter_grade == \"C\") {\n grade = 8;\n } else if (letter_grade == \"C-\") {\n grade = 7;\n } else if (letter_grade == \"D+\") {\n grade = 6;\n } else if (letter_grade == \"D\") {\n grade = 5;\n } else if (letter_grade == \"D-\") {\n grade = 4;\n } else if (letter_grade == \"F+\") {\n grade = 3;\n } else if (letter_grade == \"F\") {\n grade = 2;\n } else if (letter_grade == \"F-\") {\n grade = 1;\n } else {\n grade = 0;\n }\n return grade\n }", "function letterGuess(){\r\n var c = document.getElementById('Gletter').value.toUpperCase();\r\n // If the guesses letter is Present !!\r\n if (key.includes(c)){\r\n // All the chars having same value as c must be shown ie if a letter is guessed, all places having it it shown\r\n for (var w = 0; w < guesses.length; w++){\r\n // Equals the word\r\n if (c == key[w]){\r\n // the space is still blank-Fill it in\r\n if (guesses[w] == '_')\r\n guesses[w] = c;\r\n // If not\r\n else{\r\n // Check if other blanks contain the same letter\r\n var count = 0;\r\n for (var v = w+1; v < key.length; v++){\r\n if (key[v] == c)\r\n count += 1;\r\n }\r\n // If they do not then for 5 seconds show that the letter exists\r\n if (count == 0){\r\n document.getElementById('last').innerHTML = 'Letter Already Present';\r\n setTimeout(function(){document.getElementById('last').innerHTML = 'Current Position: ';}, 5000);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n // If the letter is not in the word at all => Punishment extra part to the hanging...\r\n else{\r\n errors += 1;\r\n changeImage();\r\n }\r\n // Checking for decisive result\r\n if (errors == 10)\r\n resultingText(false);\r\n if (guesses.toString().replaceAll(',', '') == key)\r\n resultingText(true);\r\n \r\n // Setting the input back to null and printing the new dashes again\r\n document.getElementById('Gletter').value = '';\r\n dashes();\r\n}", "function charFreq(string) {\n //...\n}", "function charFreq(string) {\n //...\n}", "function contamination(text, char) {\n if (text == '' || char == '') {\n return '';\n } else {\n return char.repeat(text.length);\n }\n}", "function polybius(input, encode = true) {\n let str = \"\";\n //declare empty string var\n let lowerText = input.toLowerCase();\n //converts input to lowercase\n if (encode === true) {\n for (let i = 0; i < lowerText.length; i++) {\n //looks for letter at set index, using for loop\n let letter = lowerText[i];\n if (lowerText.charCodeAt(i) >= 97 && lowerText.charCodeAt(i) <= 122) {\n let row =\n Math.floor((letter.charCodeAt(0) - \"a\".charCodeAt(0)) / 5) + 1;\n // creates var, finds text using UTF-16 code index, sets var to found number \n // translate into number \"set\"\n let col = ((letter.charCodeAt(0) - \"a\".charCodeAt(0)) % 5) + 1;\n //str var plus +1 because i/j are 2 letters \n if (letter === \"k\") {\n row = row - 1;\n col = 5 - col + 1;\n } else if (letter >= \"j\") {\n if (col === 1) {\n col = 6;\n row = row - 1;\n }\n col = col - 1;\n }\n str += `${col}${row}`;\n } else {\n str += lowerText[i];\n }\n }\n } else if (encode === false) {\n //regex:\n // g = globally, throws into each indiv digit\n // D = everything but digits, if d = only digits\n // \"\" replaces with empty\n let numTest = input.replace(/\\D/g, \"\");\n if (numTest.length % 2 == 0) {\n for (let j = 0; j < input.length; j++) {\n let row = input.charAt(j);\n let col;\n // take 1st & 2nd digit, pass thru res and column, adding 97 to number, transform back into string\n if (row == \" \") {\n str += row;\n } else {\n row = parseInt(input.charAt(j));\n col = parseInt(input.charAt(j + 1));\n // init imaginary 5*5 grid for math\n let res = col * 5 - 5;\n res = row + res;\n if (res == 9) {\n res = \"i/j\";\n } else {\n //res plus +1 because i/j are 2 letters\n if (res > 9) {\n res++;\n }\n //add 96 bring number to utf 16 first digit slot\n res += 96;\n res = String.fromCharCode(res);\n }\n str += res;\n //add extra value to index because we are evaluating 2 digits at a time\n j++;\n }\n }\n } else {\n return false;\n }\n }\n return str;\n }", "function polybius(input, encode = true) {\n // your solution code here\n //const lowInput = input.toLowerCase()\n if(encode === false && input.split(' ').join('').length % 2 != 0) return false \n\n let alphabet = [\n {letter: 'a', squareCombo: '11'},\n {letter: 'b', squareCombo: '21'},\n {letter: 'c', squareCombo: '31'},\n {letter: 'd', squareCombo: '41'},\n {letter: 'e', squareCombo: '51'},\n {letter: 'f', squareCombo: '12'},\n {letter: 'g', squareCombo: '22'},\n {letter: 'h', squareCombo: '32'},\n {letter: 'i', squareCombo: '42'},\n {letter: 'j', squareCombo: '42'},\n {letter: 'k', squareCombo: '52'},\n {letter: 'l', squareCombo: '13'},\n {letter: 'm', squareCombo: '23'},\n {letter: 'n', squareCombo: '33'},\n {letter: 'o', squareCombo: '43'},\n {letter: 'p', squareCombo: '53'},\n {letter: 'q', squareCombo: '14'},\n {letter: 'r', squareCombo: '24'}, \n {letter: 's', squareCombo: '34'},\n {letter: 't', squareCombo: '44'},\n {letter: 'u', squareCombo: '54'},\n {letter: 'v', squareCombo: '15'},\n {letter: 'w', squareCombo: '25'},\n {letter: 'x', squareCombo: '35'},\n {letter: 'y', squareCombo: '45'},\n {letter: 'z', squareCombo: '55'},\n {letter: ' ', squareCombo: ' '}\n ]\n\n let result = []\n let substring = \"\"\n \n for(let i = 0; i < input.length; i++){\n if(encode === true){\n const findLetter = alphabet.find(letter => letter.letter === input[i]) //find letter ojbect that matches coordinating input letter\n result.push(findLetter.squareCombo)\n } else {\n const num = input[i]\n if (num === ' ') result.push(' ')\n else {\n substring += num\n if(substring.length === 2){\n const findCombo = alphabet.find(combo => combo.squareCombo === substring)\n if (findCombo.squareCombo === \"42\") { result.push('ij')\n }\n else result.push(findCombo.letter)\n substring = \"\"\n }\n }\n }\n }\nreturn result.join('')\n }", "function psychicGame () {\n\n // resets the game\n reset();\n \n // main game logic all triggered here by key-up\n document.onkeyup = function(event) {\n \n // var containting the letter on the key pressed\n var guess = event.key;\n\n console.log(secretLetter);\n\n\n for (g = 9; g > 0; g--) {\n if (guess == secretLetter)\n {\n wins++;\n reset();\n break;\n }\n else if (guessesLeft == 0)\n {\n losses++;\n reset();\n break;\n }\n else \n {\n guessesLeft--;\n break;\n }\n }\n\n guessedLetters.push(\" \" + guess);\n\n scorecard();\n\n }\n\n }", "function letterValueGetter(char) {\n if (char == '_') {\n return 0;\n } else if (char == 'e' || char == 'a' || char == 'i' || char == 'o' || char == 'n' || char == 'r' || char == 't' || char == 'l' || char == 's' || char == 'u') {\n return 1;\n } else if (char == 'd' || char == 'g') {\n return 2;\n } else if (char == 'b' || char == 'c' || char == 'm' || char == 'p') {\n return 3;\n } else if (char == 'f' || char == 'h' || char == 'v' || char == 'w' || char == 'y') {\n return 4;\n } else if (char == 'k') {\n return 5;\n } else if (char == 'j' || char == 'x') {\n return 8;\n } else {\n return 10;\n }\n}", "unlocked(){return hasChallenge(\"燃料\",11)}", "unlocked(){return hasChallenge(\"燃料\",11)}", "function polybius(input, encode = true) {\n let encoded = [];\n let decrypt = [];\n let numberPairs = [];\n let arrayOfNumbers = [];\n let codedLetter2;\n let realLetter;\n let count;\n let pairs;\n let numbers;\n let message;\n let polycode;\n let codedLetter;\n let space;\n let spaceCounter = 0;\n let placement;\n let lowercaseConvertNumber = 86;\n let uppercaseConvertNumber = 54;\n if(encode == true){\n for (let i = 0; i < input.length; i++){\n let ascii = input[i].charCodeAt();\n if (ascii == 32){\n space = String.fromCharCode(ascii);\n polycode = 0;\n encoded.push(space);\n }\n if(ascii >= 65 && ascii <= 90){\n polycode = ascii - uppercaseConvertNumber;\n if(polycode == 20){polycode = 19;}\n }\n else if (ascii > 96 && ascii < 123){\n polycode = ascii - lowercaseConvertNumber;\n if(polycode == 20){polycode = 19;}\n console.log(polycode + \"pc\");\n }\n //if(polycode == 20){polycode = 19;}\n switch(true){\n case (polycode == 11 || polycode == 23):\n codedLetter = polycode + 0;\n console.log(codedLetter);\n break;\n case (polycode == 12 || polycode == 24):\n codedLetter = polycode + 9;\n console.log(codedLetter);\n break;\n case (polycode == 13 || polycode == 25):\n codedLetter = polycode + 18;\n console.log(codedLetter);\n break;\n case (polycode == 14 || polycode == 26):\n codedLetter = polycode + 27;\n console.log(codedLetter);\n break;\n case (polycode == 16 || polycode == 28):\n codedLetter = polycode - 4;\n console.log(codedLetter);\n break;\n case (polycode == 17 || polycode == 29):\n codedLetter = polycode + 5;\n console.log(codedLetter);\n break;\n case (polycode == 18 || polycode == 30):\n codedLetter = polycode + 14;\n console.log(codedLetter);\n break;\n case (polycode == 19 || polycode == 31):\n codedLetter = polycode + 23;\n console.log(codedLetter);\n break;\n case (polycode == 15):\n codedLetter = polycode + 36;\n console.log(codedLetter);\n break;\n case (polycode == 21):\n codedLetter = polycode + 31;\n console.log(codedLetter);\n break;\n case (polycode == 22):\n codedLetter = polycode - 9;\n console.log(codedLetter);\n break;\n case (polycode == 27):\n codedLetter = polycode - 13;\n console.log(codedLetter);\n break;\n case (polycode == 28):\n codedLetter = polycode - 4;\n console.log(codedLetter);\n break;\n case (polycode == 32):\n codedLetter = polycode - 17;\n console.log(codedLetter);\n break;\n case (polycode == 33):\n codedLetter = polycode - 8;\n console.log(codedLetter);\n break;\n case (polycode == 34):\n codedLetter = polycode + 1;\n console.log(codedLetter);\n break;\n case (polycode == 35):\n codedLetter = polycode + 10;\n console.log(codedLetter);\n break;\n case (polycode == 36):\n codedLetter = polycode + 19;\n console.log(codedLetter);\n break;\n }\n encoded.push(codedLetter);\n }\n if (encoded.includes(space)){\n for (let i = 0; i < encoded.length; i++){\n if (input[i] == space){\n encoded.splice(i+1, 1);\n }\n }\n }\n console.log(count);\n message = encoded.join(\"\");\n console.log(message);\n return message;\n } \n else{\n for (let i = 0; i < input.length; i++){\n if (input[i] == \" \"){\n spaceCounter++;\n }\n }\n if((input.length - spaceCounter) % 2 != 0) {\n return false;\n }\n for (let i = 0; i < input.length; i++){\n if (input[i] == \" \"){\n decrypt.push('5');\n decrypt.push('6');\n }\n else {decrypt.push(input[i]);\n }\n }\n for (let i = 0; i < decrypt.length; i+2){\n numbers = decrypt.splice(i, 2);\n numbers = numbers.join(\"\");\n numberPairs.push(numbers);\n }\n for (let i = 0; i < numberPairs.length; i++){\n let num = parseInt(numberPairs[i]);\n arrayOfNumbers.push(num);\n }\n if (typeof arrayOfNumbers[0] == 'number'){\n console.log(true);\n }\n for (let i = 0; i < arrayOfNumbers.length; i++){\n switch(true){\n case (arrayOfNumbers[i] == 11 || arrayOfNumbers[i] == 23):\n codedLetter = arrayOfNumbers[i] + 86;\n console.log(codedLetter);\n break;\n case (arrayOfNumbers[i] == 21 || arrayOfNumbers[i] == 33):\n codedLetter = arrayOfNumbers[i] - 9;\n codedLetter += 86;\n console.log(codedLetter);\n break;\n case (arrayOfNumbers[i] == 31 || arrayOfNumbers[i] == 43):\n codedLetter = arrayOfNumbers[i] - 18;\n codedLetter += 86;\n console.log(codedLetter);\n break;\n case (arrayOfNumbers[i] == 41 || arrayOfNumbers[i] == 53):\n codedLetter = arrayOfNumbers[i] - 27;\n codedLetter += 86;\n console.log(codedLetter);\n break;\n case (arrayOfNumbers[i] == 12 || arrayOfNumbers[i] == 24):\n codedLetter = arrayOfNumbers[i] + 4;\n codedLetter += 86;\n console.log(codedLetter);\n break;\n case (arrayOfNumbers[i] == 22 || arrayOfNumbers[i] == 34):\n codedLetter = arrayOfNumbers[i] - 5;\n codedLetter += 86;\n console.log(codedLetter);\n break;\n case (arrayOfNumbers[i] == 32 || arrayOfNumbers[i] == 44):\n codedLetter = arrayOfNumbers[i] - 14;\n codedLetter += 86;\n console.log(codedLetter);\n break;\n case (arrayOfNumbers[i] == 42):\n codedLetter = arrayOfNumbers[i] - 23;\n codedLetter += 86;\n codedLetter2 = \"j\";\n console.log(realLetter);\n break;\n case (arrayOfNumbers[i] == 54):\n codedLetter = arrayOfNumbers[i] - 23;\n codedLetter += 86;\n console.log(codedLetter);\n break;\n case (arrayOfNumbers[i] == 51):\n codedLetter = arrayOfNumbers[i] - 36;\n codedLetter += 86;\n console.log(codedLetter);\n break;\n case (arrayOfNumbers[i] == 52):\n codedLetter = arrayOfNumbers[i] - 31;\n codedLetter += 86;\n console.log(codedLetter);\n break;\n case (arrayOfNumbers[i] == 13):\n codedLetter = arrayOfNumbers[i] + 9;\n codedLetter += 86;\n console.log(codedLetter);\n break;\n case (arrayOfNumbers[i] == 14):\n codedLetter = arrayOfNumbers[i] + 13;\n codedLetter += 86;\n console.log(codedLetter);\n break;\n case (arrayOfNumbers[i] == 15):\n codedLetter = arrayOfNumbers[i] + 17;\n codedLetter += 86;\n console.log(codedLetter);\n break;\n case (arrayOfNumbers[i] == 25):\n codedLetter = arrayOfNumbers[i] + 8;\n codedLetter += 86;\n console.log(codedLetter);\n break;\n case (arrayOfNumbers[i] == 35):\n codedLetter = arrayOfNumbers[i] - 1;\n codedLetter += 86;\n console.log(codedLetter);\n break;\n case (arrayOfNumbers[i] == 45):\n codedLetter = arrayOfNumbers[i] - 10;\n codedLetter += 86;\n console.log(codedLetter);\n break;\n case (arrayOfNumbers[i] == 55):\n codedLetter = arrayOfNumbers[i] - 19;\n codedLetter += 86;\n console.log(codedLetter);\n break;\n case (arrayOfNumbers[i] == 56):\n codedLetter = arrayOfNumbers[i] - 24;\n console.log(codedLetter);\n break;\n }\n realLetter = String.fromCharCode(codedLetter);\n \n encoded.push(realLetter);\n if (codedLetter2){encoded.push(codedLetter2);}\n }\n message = encoded.join(\"\");\n //console.log(placement)\n console.log(message);\n return message;\n }\n }", "charValue(character){\n if(BadBoggle.isAVowel(character)) return 3;\n if(character === 'y') return -10;\n return -2;\n }", "function c0_shortCode(ch7,P1){\r\n var cDret='';\r\n var cDp0=\"abcdefghijklmnopqrstuvxyz0123456789ABCDEFGHIJKLMNOPQRSTUVXYZ\";\r\n var cf1s=c0_f_evals1;\r\n var cf2s=c0_f_evals2;\r\n c0_f_evals1=null;\r\n c0_f_evals2=null;\r\n var cDp=c0_get_next_moves();\r\n c0_f_evals1=cf1s;\r\n c0_f_evals2=cf2s;\r\n var cDp1='';\r\n for(var c77=0;c77<cDp.length;c77+=5){\r\n var c7move=cDp.substr(c77,4);\r\n if( ( c0_position.charAt( c0_position.indexOf(c7move.substr(0,2))-1 )==\"p\" ) &&\r\n\t ((\"18\").indexOf( c7move.charAt(3) )>=0) )\r\n\t\t{\r\n\t\tcDp1+=c7move+\"[Q]\"+';'+c7move+\"[R]\"+';'+c7move+\"[B]\"+';'+c7move+\"[N]\"+';';\r\n\t\t}\r\n else cDp1+=c7move+' ;';\r\n if(cDp.charAt(c77+4)==\"[\") c77+=3;\r\n }\r\n\r\n if(ch7==1)\r\n\t{\r\n\tvar cDcmp=P1;\r\n\tif((cDcmp.length>4) && (cDcmp.substr(4,3)==\"[0]\")) cDcmp=cDcmp.substr(0,4);\r\n\tcDret=cDp0.charAt(cDp1.indexOf(cDcmp)/8);\r\n\t}\r\n else if(ch7==-1)\r\n\t{\r\n\tvar cDmove=cDp1.substr( (cDp0.indexOf(P1))*8,7);\r\n\tc0_become_from_engine=cDmove.charAt(5);\r\n\tif(c0_become_from_engine==' ') c0_become_from_engine='Q';\r\n\tc0_become=c0_become_from_engine;\r\n\tif( (\"Q \").indexOf( cDmove.charAt(5) )>=0 ) cDmove=cDmove.substr(0,4);\r\n\tcDret=cDmove;\r\n\t}\r\n return cDret;\r\n}", "function alphabetWar(fight) {\n // Define the variables.\n const RIGHT = \"Right side wins!\";\n const LEFT = \"Left side wins!\";\n const TIE = \"Let's fight again!\";\n // TODO: Delete this leftPower variable.\n const leftPower = {\n w: 4,\n p: 3,\n b: 2,\n s: 1,\n t: 0,\n };\n // TODO: Delete this rightPower variable.\n const rightPower = {\n m: 4,\n q: 3,\n d: 2,\n z: 1,\n j: 0,\n };\n // The characters in the left and right side powers are represented as 3-digit UTF-16 codes.\n // The powerArray array below consists for five 6-digit integers.\n // The first 3-digits represent the character from the left-side power.\n // The second 3-digits represent the character from the right-side power.\n // The two characters in first element in the powerArray array are worth 0 points.\n // The second two characters in the second element (first position) in the powerArray array are worth 1 point.\n // Etc.\n const powerArray = [\"116106\", \"115122\", \"098100\", \"112113\", \"119109\"];\n // const powerArray = [116106, 115122, 098100, 112113, 119109];\n // const powerArray = [116106, 115122, 98100, 112113, 119109];\n let leftTotal = 0;\n let rightTotal = 0;\n\n // TODO: Generate the powerArray from the leftPower and rightPower variables:\n\n // TODO: Check the powerArray for points and characters using String.charCodeAt() and String.fromCharCode().\n // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt\n // and https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode\n // powerArray.forEach((element) => {\n // console.log(String.fromCharCode(element.substring(0, 3)));\n // console.log(String.fromCharCode(element.substring(3)));\n // });\n // for (let index = 0; index < powerArray.length; index++) {\n // console.log(index);\n // console.log(String.fromCharCode(powerArray[index].substring(0, 3)));\n // console.log(String.fromCharCode(powerArray[index].substring(3)));\n // }\n\n // Define functions.\n\n const tallyPoints = function (param1, param2) {\n // console.log(`param1 in tallyPoints: ${param1}`);\n // console.log(`param2 in tallyPoints: ${param2}`);\n let numLeft = 0;\n let numRight = 0;\n // look at the first character\n // if it exists in the object, add the points.\n // console.log(param1[0] in leftPower);\n // console.log(param1[0] in rightPower);\n\n // console.log(typeof rightPower[0]);\n // console.log(typeof z);\n\n // console.log(typeof Object.keys(rightPower)[0]);\n for (let i in param1) {\n // console.log(param1[i]);\n // console.log(typeof param1[i]);\n // // if (param1[i] in leftPower) console.log(leftPower.param1[i]);\n if (param1[i] in rightPower) {\n // console.log(rightPower[param1[i]]);\n // console.log(param1[i] in rightPower);\n numRight += rightPower[param1[i]];\n } else {\n numLeft += leftPower[param1[i]];\n }\n }\n return [numLeft, numRight];\n };\n // console.log(`tallyPoints(fight):${tallyPoints(fight)}`);\n\n const getKeyByValue = function (object, value) {\n return Object.keys(object).find((key) => object[key] === value);\n };\n\n const switchCharacters = function (param1) {\n console.log(\"switch characters\");\n switch (param1) {\n // from left to right\n case \"w\":\n return getKeyByValue(rightPower, leftPower.w);\n case \"p\":\n return getKeyByValue(rightPower, leftPower.p);\n case \"b\":\n return getKeyByValue(rightPower, leftPower.b);\n case \"s\":\n return getKeyByValue(rightPower, leftPower.s);\n case \"t\":\n return \"t\";\n // from right to left\n case \"m\":\n return getKeyByValue(leftPower, rightPower.m);\n case \"q\":\n return getKeyByValue(leftPower, rightPower.q);\n case \"d\":\n return getKeyByValue(leftPower, rightPower.d);\n case \"z\":\n return getKeyByValue(leftPower, rightPower.z);\n case \"j\":\n return \"j\";\n default:\n console.log(`Fix me. \"${param1}\" is not set up.`);\n }\n };\n\n console.log('fight.includes(\"t\")', fight.includes(\"t\"));\n console.log('fight.includes(\"j\")', fight.includes(\"j\"));\n\n // If t nor j is present, tally points.\n // If t and j is present, tally points.\n if (\n (fight.includes(\"t\") && fight.includes(\"j\")) ||\n (!fight.includes(\"t\") && !fight.includes(\"j\"))\n ) {\n console.log(\n \"Either t nor j is present. Or t and j is present. Tally points.\",\n );\n for (let i in fight) {\n // console.log(fight[i]);\n if (fight[i] in rightPower) {\n // console.log(\"Right side\");\n rightTotal = tallyPoints(fight, rightPower)[1];\n } else if (fight[i] in leftPower) {\n // console.log(\"Left side\");\n leftTotal = tallyPoints(fight, leftPower)[0];\n }\n }\n }\n\n // If t or j is present, switch characters, then tally points.\n else {\n console.log(\"t or j is present. Switch characters. Then tally points.\");\n\n console.log(`The old string is \"${fight}\".`);\n newString = fight.replace(\n fight.charAt(fight.indexOf(\"t\") + 1),\n switchCharacters(fight.charAt(fight.indexOf(\"t\") + 1)),\n );\n console.log(`The new string is \"${newString}\".`);\n\n for (let i in newString) {\n // console.log(fight[i]);\n if (newString[i] in rightPower) {\n // console.log(\"Right side\");\n rightTotal = tallyPoints(newString, rightPower)[1];\n } else if (newString[i] in leftPower) {\n // console.log(\"Left side\");\n leftTotal = tallyPoints(newString, leftPower)[0];\n }\n }\n }\n\n if (leftTotal > rightTotal) return LEFT;\n else if (rightTotal > leftTotal) return RIGHT;\n else return TIE;\n}", "guessed(guessedLetter) {\n if (guessedLetter === this.letter) {\n this.guessed = true;\n return this.letter;\n }\n }", "function subChar(number) {\n if (number === 4) {\n console.log(\"IV\");\n }\n else if (number === 5) {\n console.log(\"V\");\n }\n\n else if (number === 6) {\n console.log(\"VI\");\n }\n\n \n}", "function princeCharming() { /* ... */ }", "function AtbashCipher(txt){\n \n inputText = document.getElementById(\"input1\").value;\n outputText = \"\";\n \n //Checking if inputText is empty\n if(inputText.length==0)\n document.getElementById(\"input2\").value = \"\";\n \n for( i=0;i<inputText.length;i++)\n {\n // Checking if the character is in [a-z] or [A-Z] \n if( AtbashWheel[inputText[i]] !== undefined ) {\n res += AtbashWheel[inputText[i]]; \n }\n //Checking if character non alphabetic\n else {\n //No change, use the same character\n res += inputText[i];\n }\n document.getElementById(\"input2\").value = res;\n }\n}", "function lettersToGuess() {\n var i ;\n var toGess = 0 ;\n for (i in newWord) {\n if (newWord[i] === \"__\")\n toGess++;\n }\n return toGess;\n}", "function answer1(sentence) {\n // Write your code here\n let obj = {};\n sentence.split('').forEach((char) => {\n if (obj[char]) {\n obj[char] += 1;\n } else {\n obj[char] = 1;\n }\n });\n console.log(obj);\n let freqCharTimes = Number.NEGATIVE_INFINITY;​\n for (const char in obj) {\n if (obj[char] > freqCharTimes) {\n freqCharTimes = obj[char];\n }\n }\n return freqCharTimes;\n}", "function getFirstCh(c) {\n execScript(\"tmp=asc(\\\"\" + c + \"\\\")\", \"vbscript\");\n tmp = 65536 + tmp;\n if (tmp >= 45217 && tmp <= 45252) return \"A\";\n if (tmp >= 45253 && tmp <= 45760) return \"B\";\n if (tmp >= 45761 && tmp <= 46317) return \"C\";\n if (tmp >= 46318 && tmp <= 46825) return \"D\";\n if (tmp >= 46826 && tmp <= 47009) return \"E\";\n if (tmp >= 47010 && tmp <= 47296) return \"F\";\n if ((tmp >= 47297 && tmp <= 47613) || (tmp == 63193)) return \"G\";\n if (tmp >= 47614 && tmp <= 48118) return \"H\";\n if (tmp >= 48119 && tmp <= 49061) return \"J\";\n if (tmp >= 49062 && tmp <= 49323) return \"K\";\n if (tmp >= 49324 && tmp <= 49895) return \"L\";\n if (tmp >= 49896 && tmp <= 50370) return \"M\";\n if (tmp >= 50371 && tmp <= 50613) return \"N\";\n if (tmp >= 50614 && tmp <= 50621) return \"O\";\n if (tmp >= 50622 && tmp <= 50905) return \"P\";\n if (tmp >= 50906 && tmp <= 51386) return \"Q\";\n if (tmp >= 51387 && tmp <= 51445) return \"R\";\n if (tmp >= 51446 && tmp <= 52217) return \"S\";\n if (tmp >= 52218 && tmp <= 52697) return \"T\";\n if (tmp >= 52698 && tmp <= 52979) return \"W\";\n if (tmp >= 52980 && tmp <= 53688) return \"X\";\n if (tmp >= 53689 && tmp <= 54480) return \"Y\";\n if (tmp >= 54481 && tmp <= 62289) return \"Z\";\n return c.charAt(0);\n }", "function computerGuess() {\nvar letter = letters[Math.floor(Math.random() * letters.length) * 26];\n}", "function hackerSpeak(str) {\n let newStr = \"\";\n for (let i = 0; i < str.length; i++) {\n if (str[i] === \"a\") {\n newStr += \"4\";\n } else if (str[i] === \"e\") {\n newStr += \"3\";\n } else if (str[i] === \"i\") {\n newStr += \"1\";\n } else if (str[i] === \"o\") {\n newStr += \"0\";\n } else if (str[i] === \"s\") {\n newStr += \"5\";\n } else {\n newStr += str[i];\n }\n }\n console.log(newStr);\n}", "function gac(ascii) {\n var str = \"\" + ascii;\n return str.charCodeAt(0);\n}", "function gac(ascii) {\n var str = \"\" + ascii;\n return str.charCodeAt(0);\n}", "characterMapping(d) {\n switch (d) {\n case \"percentagea\":\n return \"A\"\n case \"percentaget\":\n return \"U\"\n case \"percentageg\":\n return \"G\"\n default:\n return \"C\"\n }\n }", "pointDegradation(addToPaper){cov_14q771vu2z.f[2]++;const letters=(cov_14q771vu2z.s[8]++,addToPaper.split(''));let whatICanWrite=(cov_14q771vu2z.s[9]++,'');// When you reach the end of the string, get out of loop\ncov_14q771vu2z.s[10]++;for(let i=0;i<letters.length;i++){cov_14q771vu2z.s[11]++;// If pencilDurability ever reaches 0, sharpen pencil\nif(this.pencilDurability===0){cov_14q771vu2z.b[1][0]++;cov_14q771vu2z.s[12]++;console.log(`Your pencil has a durability of 0! You need to sharpen it! Here's what I've written \"${whatICanWrite}\".`);cov_14q771vu2z.s[13]++;break;}else{cov_14q771vu2z.b[1][1]++;}// Check how many letters of the string you can write with pencil\ncov_14q771vu2z.s[14]++;whatICanWrite+=letters[i];cov_14q771vu2z.s[15]++;if(letters[i]===' '){cov_14q771vu2z.b[2][0]++;cov_14q771vu2z.s[16]++;this.pencilDurability-=0;}else{cov_14q771vu2z.b[2][1]++;cov_14q771vu2z.s[17]++;if((cov_14q771vu2z.b[4][0]++,letters[i]!==letters[i].toUpperCase())||(cov_14q771vu2z.b[4][1]++,letters[i].match(/^[.,:!?]/))){cov_14q771vu2z.b[3][0]++;cov_14q771vu2z.s[18]++;this.pencilDurability-=1;}else{cov_14q771vu2z.b[3][1]++;cov_14q771vu2z.s[19]++;if(letters[i]===letters[i].toUpperCase()){cov_14q771vu2z.b[5][0]++;cov_14q771vu2z.s[20]++;this.pencilDurability-=2;}else{cov_14q771vu2z.b[5][1]++;}}}}cov_14q771vu2z.s[21]++;return whatICanWrite;}", "function get_char_score() {\n $scope.time_diff = char_time_end - char_time_start;\n if ($scope.time_diff <= 20) return 100;\n else if ($scope.time_diff <= 38) return 70;\n else if ($scope.time_diff <= 56) return 30;\n else return 10;\n }", "function toTrytes(input) {\n\n // If input is not a string, return null\n if ( typeof input !== 'string' ) return null\n\n var TRYTE_VALUES = \"9ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n var trytes = \"\";\n\n for (var i = 0; i < input.length; i++) {\n var char = input[i];\n var asciiValue = char.charCodeAt(0);\n\n // If not recognizable ASCII character, return null\n if (asciiValue > 255) {\n //asciiValue = 32\n return null;\n }\n\n var firstValue = asciiValue % 27;\n var secondValue = (asciiValue - firstValue) / 27;\n\n var trytesValue = TRYTE_VALUES[firstValue] + TRYTE_VALUES[secondValue];\n\n trytes += trytesValue;\n }\n\n return trytes;\n}", "function toTrytes(input) {\n\n // If input is not a string, return null\n if ( typeof input !== 'string' ) return null\n\n var TRYTE_VALUES = \"9ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n var trytes = \"\";\n\n for (var i = 0; i < input.length; i++) {\n var char = input[i];\n var asciiValue = char.charCodeAt(0);\n\n // If not recognizable ASCII character, return null\n if (asciiValue > 255) {\n //asciiValue = 32\n return null;\n }\n\n var firstValue = asciiValue % 27;\n var secondValue = (asciiValue - firstValue) / 27;\n\n var trytesValue = TRYTE_VALUES[firstValue] + TRYTE_VALUES[secondValue];\n\n trytes += trytesValue;\n }\n\n return trytes;\n}", "function getIconCharacter(icon) {\n switch(icon) {\n case 'nt_chanceflurries' :\n return 'V';\n\n case 'nt_chancerain' :\n return 'Q';\n\n case 'nt_chancesleet' :\n return 'T';\n\n case 'nt_chancesnow' :\n return 'V';\n\n case 'nt_chancetstorms' :\n return '0';\n\n case 'nt_clear' :\n return 'C';\n\n case 'nt_cloudy' :\n return 'Y';\n\n case 'nt_flurries' :\n return 'W';\n\n case 'nt_fog' :\n return 'K';\n\n case 'nt_hazy' :\n return 'E';\n\n case 'nt_mostlycloudy' :\n return 'N';\n\n case 'nt_mostlysunny' :\n return 'I';\n\n case 'nt_partlycloudy' :\n return 'I';\n\n case 'nt_partlysunny' :\n return 'N';\n\n case 'nt_rain' :\n return 'R';\n\n case 'nt_sleet' :\n return 'T';\n\n case 'nt_snow' :\n return 'X';\n\n case 'nt_sunny' :\n return 'C';\n\n case 'nt_tstorms' :\n return 'O';\n\n case 'nt_unknown' :\n return ')';\n\n case 'chanceflurries' :\n return 'V';\n\n case 'chancerain' :\n return 'Q';\n\n case 'chancesleet' :\n return 'T';\n\n case 'chancesnow' :\n return 'V';\n\n case 'chancetstorms' :\n return '0';\n\n case 'clear' :\n return 'B';\n\n case 'cloudy' :\n return 'Y';\n\n case 'flurries' :\n return 'W';\n\n case 'fog' :\n return 'M';\n\n case 'hazy' :\n return 'J';\n\n case 'mostlycloudy' :\n return 'N';\n\n case 'mostlysunny' :\n return 'H';\n\n case 'partlycloudy' :\n return 'H';\n\n case 'partlysunny' :\n return 'N';\n\n case 'rain' :\n return 'R';\n\n case 'sleet' :\n return 'U';\n\n case 'snow' :\n return 'X';\n\n case 'sunny' :\n return 'B';\n\n case 'tstorms' :\n return 'Z';\n\n case 'unknown' :\n return ')';\n\n default:\n return \")\";\n\n }\n}", "function countLetters(){\n for (let i = 0; i < textInput.length; i++){\n if (checkLetter(textInput.charAt(i)) === false){\n letters[textInput.charAt(i)] = 1;\n }else{\n current = letters[textInput.charAt(i)];\n letters[textInput.charAt(i)] = current + 1;\n }\n }\n}", "function characters(sentence){\n // const sentence = 'BACDGF';\n // NOTE sorts string by converting it to an array, sorting that array, and joining it back into a string\n // 'BACDGF' => ['B','A','C','D','G','F'] => 'ABCDFG'\n let sorted = sentence.split('').sort().join('')\n let charCode = sorted.charCodeAt(0)\n // iterate over sorted code\n for(let i = 0; i < sentence.length; i++){\n console.log(charCode)\n console.log(sorted.charCodeAt(i), sorted.charAt(i))\n\n // Check if character is missing.\n if(charCode != sorted.charCodeAt(i)){\n console.log(\"found missing letter\")\n console.log(String.fromCharCode(charCode))\n return String.fromCharCode(charCode)\n }\n \n\n charCode++\n }\n}", "function s(s) {\n // const map = \"$abcdefghijklmnopqrstuvwxyz\"\n // .split(\"\")\n // .reduce((acc, char, idx) => ({ ...acc, [char]: idx }), {});\n\n return helper(0);\n\n function helper(i) {\n if (i >= s.length) {\n return 1;\n }\n if (s[i] === \"0\") {\n return 0;\n }\n\n let ways = helper(s, i + 1);\n if (i + 2 <= s.length && Number(s.substring(i, i + 2)) <= 26) {\n ways += helper(i + 2);\n }\n return ways;\n }\n}", "function evaluateGuess(letter) {\r\n var positions = [];\r\n\r\n for (var i = 0; i < transformersCharacters[computerPick].length; i++) {\r\n if(transformersCharacters[computerPick][i] === letter) {\r\n positions.push(i);\r\n }\r\n }\r\n\r\n if (positions.length <= 0) {\r\n guessesLeft--;\r\n } else {\r\n for(var i = 0; i < positions.length; i++) {\r\n wordGuessed[positions[i]] = letter;\r\n }\r\n }\r\n}", "scoreWord(word) {\n // console.log(word);\n let score = 0;\n let wordArray = word.toUpperCase().split('');\n for (let char of wordArray) {\n // console.log(`Char ${char} has a score of ${scoreLetters[char]}`);\n score += scoreLetters[char];\n }\n if (wordArray.length >= 7) {\n score += 8;\n }\n return score\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 cantidadCaracteres(frase) {\r\n \r\n let i=0;\r\n let nuevaPalabra=\"\";\r\n let nuevaFrase=\"\";\r\n let longitud=frase.length;\r\n let longitudNP=0;\r\n\r\n\r\n for ( i == 0; i < longitud; i++) {\r\n \r\n while (frase[i] ==\" \") {\r\n i++;\r\n } \r\n if (frase[i]==\"a\" || frase[i]==\"A\") {\r\n\r\n while ((frase[i]!=' ') && (i < longitud) ) {\r\n nuevaPalabra = nuevaPalabra+frase[i];\r\n i++;\r\n longitudNP++;\r\n } \r\n if (nuevaPalabra[longitudNP-1]==\"r\" ||nuevaPalabra[longitudNP-1]==\"R\") {\r\n nuevaFrase= nuevaFrase+nuevaPalabra+\" \";\r\n }\r\n nuevaPalabra=\"\";\r\n longitudNP=0;\r\n }else{\r\n if ((frase[i] !=\" \") && (i<longitud)) {\r\n i++;\r\n }\r\n }\r\n } \r\n return nuevaFrase;\r\n \r\n}", "function letterChanges(str) {}", "function letterChanges(str) {}", "function letterChanges(str) {}", "function challenge2() {\n\n}", "function Encode ( CharNum, Cipher, RangeLowest, RangeHighest ) {\n var ShftCharNum = CharNum + Cipher;\n if (( CharNum >= RangeLowest ) && ( CharNum <= RangeHighest )) {\n // If need to wrap to beginning of alphabet, do it\n if ( ShftCharNum > RangeHighest ) {\n return( RangeLowest + ( ShftCharNum - RangeHighest ) - 1 );\n } else { return( ShftCharNum ); };\n };\n //else the character is not in the range\n return( -1 );\n}", "function oldScrabbleScorer(word) {\n\tword = word.toUpperCase();\n\tlet letterPoints = \"\";\n\tlet totalPoints = 0;\n \n\tfor (let i = 0; i < word.length; i++) {\n \n\t for (const pointValue in oldPointStructure) {\n \n\t\t if (oldPointStructure[pointValue].includes(word[i])) {\n\t\t\ttotalPoints += Number(pointValue);\n\t\t\tletterPoints += `Points for '${word[i]}': ${pointValue}\\n`\n\t\t }\n \n\t }\n\t}\n\tletterPoints += `Total points for word: ${totalPoints}.\\n`;\n\treturn totalPoints;\t\t// Used to be \"return letterPoints\"\n }", "function encodeDecodeLetter(char){\r\n var goTo; // this is the positon of the next component to which signal is passed\r\n // goes through input/output rotor 1 2 3 bounces back at reflector and goes back to input/output\r\n for (var i = 0; i < 26; i++) {\r\n if(inOut[i].val == char){\r\n goTo = inOut[i].prev;\r\n }\r\n }\r\n\r\n for (var i = 0; i < 26; i++) {\r\n if(rotor3[i].pos === goTo){\r\n goTo = parseInt(rotor3[i].prev);\r\n break;\r\n }\r\n }\r\n\r\n for (var i = 0; i < 26; i++) {\r\n if(rotor2[i].pos === goTo){\r\n goTo = parseInt(rotor2[i].prev);\r\n break;\r\n }\r\n }\r\n\r\n for (var i = 0; i < 26; i++) {\r\n if(rotor1[i].pos === goTo){\r\n goTo = parseInt(rotor1[i].pos);\r\n break;\r\n }\r\n }\r\n\r\n goTo = reflector[goTo -1].reflects;\r\n\r\n for (i = 0; i < 26; i++) {\r\n if(rotor1[i].pos == goTo){\r\n goTo = rotor1[i].next;\r\n break;\r\n }\r\n }\r\n\r\n for (i = 0; i < 26; i++) {\r\n if(rotor2[i].pos == goTo){\r\n goTo = rotor2[i].next;\r\n break;\r\n }\r\n }\r\n\r\n for (i = 0; i < 26; i++) {\r\n if(rotor3[i].pos == goTo){\r\n goTo = rotor3[i].next;\r\n break;\r\n }\r\n }\r\n\r\n return inOut[goTo -1].val;\r\n}", "advance() {\n var newString = '';\n\n let l = this.string.length;\n\n for (let i = 0; i < l; i++) {\n let curElem = this.string[i];\n\n if (!this.hasRuleFor(curElem)) {\n newString += curElem;\n continue;\n }\n\n let curRule = this.getRandomRule(curElem);\n\n let part = curRule.output;\n\n // The element of DEATHHHHHH!\n // Cut everything that follows from here\n // FIXME: Is this ok with stacks\n if (part == '✝') return;\n\n newString += part;\n }\n\n this.string = newString;\n return this.string;\n }", "function charFreq(string){\n \"use strict\";\n\n}", "function sabb(x, val, happ) {\n let sabObj = {}\n let letterTotal = 0;\n let finalTotal;\n x = x.replace(/ /g, '');\n for (let char of \"sabbatical\") {\n sabObj[char] = (sabObj[char] || 0) + 1;\n }\n\n for (let char of x) {\n if (char in sabObj) {\n letterTotal += 1;\n }\n\n }\n\n finalTotal = letterTotal + val + happ;\n if (finalTotal > 22) return \"Sabbatical! Boom!\";\n return \"Back to your desk, boy.\";\n\n}", "function alternative(s) {\n const counts = new Array(26).fill(0);\n\n for (let i = 0; i < s.length; i++) {\n counts[s.charCodeAt(i) - 97]++;\n }\n\n const result = new Array(Math.max(...counts)).fill('');\n\n // iterate through each letter of alphabet\n for (let i = 0; i < 26; i++) {\n // iterate through each count of a letter\n for (let j = 0; j < counts[i]; j++) {\n if (j % 2 === 0) {\n result[j] += String.fromCharCode(i + 97);\n } else {\n result[j] = String.fromCharCode(i + 97) + result[j];\n\n }\n }\n }\n\n return result.join('');\n}", "function challenge3() {\n\n}", "engtoNum(Card) {\n let score = 0;\n if (Card === \"J\" || Card === \"Q\" || Card === \"K\") {\n score = 10;\n } else if (Card === \"A\") {\n score = 1;\n } else {\n score = Card;\n }\n return score;\n }", "function react(letters) {\n const stack = [];\n for (let char of letters.split(\"\")) {\n const top = stack[stack.length - 1];\n if (top && top.toLowerCase() === char.toLowerCase() && top !== char) {\n stack.pop();\n } else {\n stack.push(char);\n }\n }\n return stack.length;\n}", "computePerfectPlay(letters) {\n if (this.dictionary.has(letters)) {\n return -1\n }\n\n let prepends = this.get(0, letters)\n for (var p of prepends) {\n if (this.perfectPlay(p + letters) === 1) {\n return -1\n }\n }\n let appends = this.get(1, letters)\n for (var a of appends) {\n if (this.perfectPlay(letters + a) === 1) {\n return -1\n }\n }\n\n return 1\n }", "function main() {\n var n = parseInt(readLine());\n var s = readLine();\n var k = parseInt(readLine());\n\n var resultCode = [];\n var resultString = '';\n k = k % 26;\n for(var i = 0; i < s.length; i++) {\n if(s.charAt(i).match(/[a-zA-Z]/) !== null) {\n\n var charCode = s.charCodeAt(i) + k;\n if(s.charCodeAt(i) < 91) {\n if(charCode > 90) {\n charCode = charCode - 90 + 64;\n resultCode.push(charCode);\n } else {\n resultCode.push(charCode);\n }\n }\n else if(s.charCodeAt(i) > 96 && s.charCodeAt(i) < 123){\n if(charCode > 122) {\n charCode = charCode - 122 + 96;\n resultCode.push(charCode);\n } else {\n resultCode.push(charCode);\n }\n }\n } else {\n resultCode.push(s.charCodeAt(i));\n }\n }\n for(var j = 0; j < resultCode.length; j++) {\n resultString += String.fromCharCode(resultCode[j]);\n }\n console.log(resultString);\n}", "function oldScrabbleScorer(word) {\n\tword = word.toUpperCase();\n\tlet letterPoints = \"\";\n \n\tfor (let i = 0; i < word.length; i++) {\n \n\t for (const pointValue in oldPointStructure) {\n \n\t\t if (oldPointStructure[pointValue].includes(word[i])) {\n\t\t\t letterPoints += `Points for '${word[i]}': ${pointValue}\\n`\n\t\t }\n \n\t }\n\t}\n // console.log({letterPoints}); //for testing\n\treturn letterPoints;\n \n}", "function high(x){\nlet result = '';\nlet bestScore = 0;\nlet arrayWord = x.split(' ');\n for (let p = 0 ; p < arrayWord.length ; p++ ){\n let wordScore = 0;\n for (let k = 0; k < arrayWord[p].length; k++){\n let code = arrayWord[p].toUpperCase().charCodeAt(k)\n if (code > 64 && code < 91 ) wordScore += (code - 64);\n }\n bestScore < wordScore ? ( bestScore = wordScore, result = arrayWord[p]) : null;\n }\n return result;\n}", "function randomChar(){\n return possChars[0][Math.floor(Math.random()*possChars[0].length)] \n}", "function addCorrectLetter(letter) {\n for (var i = 0; i < character.length; i++) {\n // If current letter(input) has already been pressed\n if (letter.key === character[i]) {\n // change letter inputed to uppercase\n answerArray[i] = letter.key.toUpperCase();\n currentWordDisplay();\n //reduce letters left remaining to guess by 1\n lettersRemaining--;\n console.log(\"letters Remaning: \" + lettersRemaining);\n //if letters left to guess are equal to 0 \n if (lettersRemaining === 0) {\n winScore++;\n displayWinCount();\n alert(\"YOU WON!!!\");\n restartGame();\n\n\n }\n }\n }\n}", "function repeatedLetter() {\n\n}", "function poorManHuffman(c, a) {\n\t var e = \"\";\n\n\t for (e = a; c > 1; c--) {\n\t e += a;\n\t }\n\n\t return e;\n\t } // Watch for tag state changes and check initial state", "function cesar(){\n\n var texto=prompt(\"Ingrese ABC\");\n\n var cifrado =\"\";\n\n for(var i=0; i<texto.length; i++) { //el for recorrera las letras del texto a cifrar//\n\n if (parseInt(texto[i])%1 === 0) //condicionar para no ingresar numeros//\n texto = prompt(\"Por favor ingrese un texto sin numeros ni espacios\");\n\n var ubicacionCesar=(texto.toUpperCase().charCodeAt(i) - 65 + 33) % 26 + 65;\n\n var palabraCifrada= String.fromCharCode(ubicacionCesar);\n\n cifrado+= palabraCifrada; //acumular las letras cifradas//\n\n }\n\n return cifrado;\n\n}", "function ReplaceText(text) {\n text = String(text);\n\n function mixCase(letter) {\n var upper = Math.random() < 0.5;\n if (upper) {\n return letter.toUpperCase();\n }\n else {\n return letter.toLowerCase();\n }\n }\n\n function lowCase(letter) {\n return letter.toLowerCase();\n }\n\n function upCase(letter) {\n return letter.toUpperCase();\n }\n\n var answer = \"\";\n var cases = [];\n\n for (var i = 0; i < text.length; i++) {\n if (text[i] == '<') {\n i++;\n if (text[i] == \"/\") {\n cases.pop();\n while (text[i] != '>') {\n i++;\n }\n }\n else if (text[i] == 'm') {\n cases.push(mixCase);\n while (text[i] != '>') {\n i++;\n }\n }\n else if (text[i] == 'u') {\n cases.push(upCase);\n while (text[i] != '>') {\n i++;\n }\n }\n else if (text[i] == 'l') {\n cases.push(lowCase);\n while (text[i] != '>') {\n i++;\n }\n }\n else {\n alert(i + \"Error!\");\n }\n }\n else {\n if (cases.length == 0) {\n answer += text[i];\n }\n else {\n var currLetter = text[i];\n\n for (var j = cases.length - 1; j >= 0; j--) {\n currLetter = cases[j](currLetter);\n }\n\n answer += currLetter;\n }\n }\n }\n\n return answer;\n}", "function Letter(character){\n \n this.character = character;\n this.letterGuessed = false;\n this.toString = function(){\n if( this.letterGuessed ){\n return this.character;\n }\n else{\n return \"_ \";\n }\n };\n this.checkLetter = function(char){\n if( char === this.character ){\n this.letterGuessed = true;\n }\n }; \n\n}", "function uniToAbgode(asc) {\n\tvar abg = ''; // value to be returned\n\tvar i=0; // index for processing\n\tasc = ''+asc; // ensure the input is a string\n\twhile( i<asc.length ) {\n var a = asc.charCodeAt(i++);\n\t\tif((a>=97 && a<=122) || (a>=48 && a<=57))\n\t\t\tabg += String.fromCharCode(a); // a-z0-9 is straight through\n\t\telse if(a>=39 && a<=47)\n\t\t\tabg += String.fromCharCode(a+43); // '-/ is converted to R-Z\n\t\telse if(a==32)\n\t\t\tabg += String.fromCharCode(81); // space becomes Q\n\t\telse { //convert to A-P (hexadecimal) code\n if ( // check if it’s the start of a surrogate pair\n a >= 0xD800 && a <= 0xDBFF && // high surrogate\n asc.length > i // there is a next code unit\n ) {\n var b = asc.charCodeAt(i);\n if (b >= 0xDC00 && b <= 0xDFFF) { // low surrogate\n a = (a - 0xD800) * 0x400 + b - 0xDC00 + 0x10000;\n i++;\n }\n }\n\t\t\t//if(a<20 || a>126) // alert(a); //not printable ascii\n\t\t\tvar c = a.toString(16).toLowerCase(); // convert character to hexadecimal \"8\" -> \"08\" -> \"Ag\"\n\t\t\twhile(c.length<2)\n\t\t\t\tc = '0'+c; // left-pad to ensure minimum length of 2\n\t\t\tfor(j=0; j<c.length; j++) {\n\t\t\t\t// convert 0123456789abcdef to ABCDEFGHIJKLMNOP\n\t\t\t\t// by adding 17 to numbers, and subtracting 22 from letters\n\t\t\t\tvar d = String.fromCharCode( c[j].charCodeAt(0) + ( c[j]<='9' ? 17 : -22 ) );\n\t\t\t\t// convert the last 'digit' of A-P code to lowercase to indicate the end\n\t\t\t\tabg += (j==c.length-1 ? d.toLowerCase() : d );\n\t\t\t}\n\t\t\t//c[c.length-1] = c[c.length-1].toLowerCase();\n\t\t}\n\t}\n\treturn abg;\n}", "function getCharScore() {\n var charScore = 0;\n var userChar = document.getElementsByClassName(\"char\");\n\n for(var i = 0; i < userChar.length; i++) {\n if(userChar[i].checked) {\n var charValue = userChar[i].value;\n break;\n }\n }\n if(charValue === \"oscarTheGrouch\") {\n charScore = 1;\n }\n if(charValue === \"bert\") {\n charScore = 2;\n }\n if(charValue === \"theCount\") {\n charScore = 3;\n }\n if(charValue === \"elmo\") {\n charScore = 4;\n }\n if(charValue === \"bigBird\") {\n charScore = 5;\n }\n if(charValue === \"cookieMonster\") {\n charScore = 6;\n }\n return charScore;\n }", "function binaryAgent(str) {\n var bi = str.split(\" \");\n var newarr = [];\n console.log(bi);\n\n for(var i=0; i < bi.length; i++){\n bi[i] = calBi(bi[i]); // array of char code\n }\n\n bi.forEach(function(elm){\n newarr.push(String.fromCharCode(elm));\n });\n\n return newarr.join(\"\");\n\n function calBi (text){\n var sum = 0;\n for(var i = 0; i < 8; i++){\n if(text[i] == 1){\n sum += Math.pow(2, (7-i));\n }\n }\n return sum;\n } //calBi ends\n}", "function challenge1() {\n\n}", "function challenge1() {\n\n}", "showLetter() {\n if(this.isGuessed) {\n return this.character;\n } else {\n return \"_\"\n }\n }", "function checkLetter(num) {\r\n\r\n var good = false;\r\n for (i = 0; i < password.length; i++) {\r\n\r\n if (password.charAt(i) == letters[num]) {\r\n password1 = password1.setChar(i, letters[num]);\r\n good = true;\r\n }\r\n }\r\n if (good == true) {\r\n markGood(num);\r\n updateBoard();\r\n if (password1 == password) win = true;\r\n } \r\n else {\r\n markBad(num);\r\n chances++;\r\n document.getElementById(\"hangman\").innerHTML = '<img src=\"img/hang' + chances + '.jpg\" alt=\"\">';\r\n }\r\n checkIfGameEnded();\r\n}", "function computerguess() {\n randomletter = letterbase[Math.floor(Math.random() * letterbase.length)];\n console.log(randomletter);\n\n}", "function generatePassword() {\n //prompt for password length\n var passLength = prompt(\"Please enter password length between 8 and 128\", \"8\");\n if (passLength < 8 || passLength > 128) {\n alert(\"Please enter a number between 8 and 128\");\n return;\n }\n //prompt for password complexity options\n var passUpOpt = confirm(\"would you like to include uppercase characters?\");\n var passLowOpt = confirm(\"would you like to include lowercase characters?\");\n var passNumOpt = confirm(\"would you like to include numeric characters?\");\n var passSpecOpt = confirm(\"would you like to include special characters?\");\n //array for password characters\n //let passChar = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')' '_' '+'];\n var passUpChar = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n var passLowChar = \"abcdefghijklmopqrstuvwxyz\";\n var passNumChar = \"1234567890\";\n var passSpecChar = \"!@#$%^&*()_+\";\n var passChar = \"\";\n \n /* if (passUpOpt = true) {\n if (passLowOpt = true) {\n if (passNumOpt = true) {\n if (passSpecOpt = true) {\n passChar = passUpChar + passLowChar + passNumChar + passSpecChar;\n }\n }\n }\n } else if (passUpOpt = false) {\n if (passLowOpt = true) {\n if (passNumOpt = true) {\n if (passSpecChar = true) {\n passChar = passLowChar + passNumChar + passSpecChar;\n }\n }\n }\n } */\n //combinations of strings\n if (passUpOpt && passLowOpt && passNumOpt && passSpecOpt) {\n passChar = passUpChar + passLowChar + passNumChar + passSpecChar;\n } else if (!passUpOpt && !passLowOpt && !passNumOpt && !passSpecOpt) {\n alert(\"Please choose at least one type of character\")\n } else if (passLowOpt && passNumOpt && passSpecOpt) {\n passChar = passLowChar + passNumChar + passSpecChar;\n } else if (passNumOpt && passSpecOpt) {\n passChar = passNumChar + passSpecChar;\n } else if (passSpecOpt) {\n passChar = passSpecChar;\n } else if (passUpOpt && passNumOpt && passSpecOpt) {\n passChar = passUpChar + passNumChar + passSpecChar;\n } else if (passUpOpt && passSpecOpt) {\n passChar = passUpChar + passSpecChar;\n } else if (passUpOpt && passLowOpt && passNumOpt) {\n passChar = passUpChar + passLowChar + passNumChar;\n } else if (passUpOpt && passLowOpt && passSpecChar) {\n passChar = passUpChar + passLowChar + passSpecChar;\n } else if (passUpOpt && passNumOpt) {\n passChar = passUpChar + passNumChar;\n } else if (passUpOpt) {\n passChar = passUpChar;\n } else if (passLowOpt && passNumOpt) {\n passChar = passLowChar + passNumChar;\n } else if (passLowChar) {\n passChar = passLowChar;\n } else if (passNumOpt && passSpecOpt) {\n passChar = passNumChar + passSpecChar;\n } else if (passSpecOpt) {\n passChar = passSpecChar;\n } else if (passNumOpt) {\n passChar = passNumChar;\n } else if (passUpOpt && passLowOpt) {\n passChar = passUpChar + passLowChar;\n } else if (passLowOpt && passSpecOpt) {\n passChar = passLowChar && passSpecChar;\n }\n\n console.log(passChar);\n\n\n var pass = \"\";\n //for loop to pick the characters the password will contain\n for(var i = 0; i <= passLength; i++) {\n pass = pass + passChar.charAt(Math.floor(Math.random() * Math.floor(passChar.length - 1)));\n }\n alert(pass);\n //return pass;\n document.querySelector(\"#password\").value = pass;\n\n}", "function ultapiramid(n) {\n let b = 65\n let mt = \"\"\n for (var i = n; i > 0; i--) {\n let s = '';\n for (var j = 0; j < i; j++) {\n s = s + String.fromCharCode(b + (j % 26)) + \" \";\n }\n console.log(mt + s);\n mt = mt + \" \"\n }\n\n mt = \"\"\n s = \"\"\n for (var i = 0; i < n; i++) {\n mt = '';\n for (var j = n - 1; j > i; j--) {\n mt = mt + \" \"\n }\n s = s + String.fromCharCode(b + (j % 26)) + \" \";\n if (i != 0)\n console.log(mt + s);\n }\n}" ]
[ "0.627934", "0.6277242", "0.6172538", "0.61572987", "0.61565423", "0.60607004", "0.598429", "0.5981207", "0.5948695", "0.5948275", "0.59100723", "0.5901065", "0.5886577", "0.5877408", "0.587437", "0.58537275", "0.5852753", "0.58525217", "0.58333933", "0.5819561", "0.58183736", "0.58149064", "0.58149064", "0.58114207", "0.58087194", "0.58040595", "0.5803873", "0.5802256", "0.57991165", "0.5798588", "0.5798588", "0.579277", "0.5784424", "0.5781193", "0.5780304", "0.5770694", "0.57504845", "0.57504845", "0.5748997", "0.5743227", "0.57305086", "0.5720175", "0.5709536", "0.5707768", "0.57050866", "0.56945914", "0.56902665", "0.5686429", "0.5671456", "0.5661141", "0.565994", "0.5659172", "0.5659172", "0.5654496", "0.565351", "0.56526715", "0.56439173", "0.56439173", "0.5637936", "0.56256247", "0.562528", "0.5624173", "0.56174386", "0.5613037", "0.56118643", "0.56054884", "0.5600485", "0.5600485", "0.5600485", "0.5598937", "0.5598175", "0.55966145", "0.55917925", "0.55889165", "0.5588832", "0.55887985", "0.55795276", "0.5577159", "0.55764633", "0.55756724", "0.55747014", "0.5574411", "0.5573848", "0.55735475", "0.55721444", "0.55651444", "0.5556037", "0.55547845", "0.5547448", "0.5545388", "0.5541608", "0.55408245", "0.553859", "0.5538125", "0.5532944", "0.5532944", "0.5532281", "0.5530994", "0.55285674", "0.55280644", "0.55248445" ]
0.0
-1
load the main menu
function loadMenu(){ pgame.state.start('menu'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadMenu() {\n var nav = $('.navigation');\n if (nav.html() == \"\" || !nav.hasClass('settings_menu') || nav.hasClass('user_menu')) {\n nav.text('');\n $('.main').ready(function () {\n $http.get($rootScope.contextPath + '/components/settings/settings_menu.html').success(function (data) {\n\n angular.element('.navigation').append($compile(data)($scope));\n $('.ui.menu').find('.item').removeClass('active');\n $('.' + $state.current.name).addClass('active');\n nav.addClass('settings_menu');\n nav.removeClass('user_menu');\n\n $('.ui.menu .item').on('click', function () {\n if (!$(this).hasClass('header')) {\n $(this).addClass('active').closest('.ui.menu').find('.item').not($(this))\n .removeClass('active');\n }\n });\n });\n });\n\n }\n }", "function load_menu(){\n //take-order page content loading\n int_get_menu_item_install({stallid:user_info[\"stall\"]},function(data){\n cache_menu=data.content;\n display_order_menu();\n //--load menu info page\n display_menu_info();\n });\n}", "function initialize() {\n activateMenus();\n}", "function main() {\n MenuItem.init();\n sizeUI();\n }", "function onOpen() { CUSTOM_MENU.add(); }", "function startatLoad(){\r\n\tloadNavbar(function(){\r\n\t\tsetSelectMenuesValues(function(){\r\n\t\t\t\tgetXMLData(function(){\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t});\r\n}", "function loadMenu() {\n // Works only with nav-links that have 'render' instead of 'component' below in return\n if (istrue) {\n // Do not show these buttons to unauthorise user\n document.getElementById(\"edit\").children[6].style.display = \"none\";\n document.getElementById(\"edit\").children[5].style.display = \"none\";\n document.getElementById(\"edit\").children[4].style.display = \"none\";\n document.getElementById(\"edit\").children[3].style.display = \"none\";\n }\n }", "function addMenu(){\n var appMenu = new gui.Menu({ type: 'menubar' });\n if(os.platform() != 'darwin') {\n // Main Menu Item 1.\n item = new gui.MenuItem({ label: \"Options\" });\n var submenu = new gui.Menu();\n // Submenu Items.\n submenu.append(new gui.MenuItem({ label: 'Preferences', click :\n function(){\n // Add preferences options.\n // Edit Userdata and Miscellaneous (Blocking to be included).\n\n var mainWin = gui.Window.get();\n\n\n var preferWin = gui.Window.open('./preferences.html',{\n position: 'center',\n width:901,\n height:400,\n focus:true\n });\n mainWin.blur();\n }\n }));\n\n submenu.append(new gui.MenuItem({ label: 'User Log Data', click :\n function(){\n var mainWin = gui.Window.get();\n\n var logWin = gui.Window.open('./userlogdata.html',{\n position: 'center',\n width:901,\n height:400,\n toolbar: false,\n focus:true\n });\n }\n }));\n\n submenu.append(new gui.MenuItem({ label: 'Exit', click :\n function(){\n gui.App.quit();\n }\n }));\n\n item.submenu = submenu;\n appMenu.append(item);\n\n // Main Menu Item 2.\n item = new gui.MenuItem({ label: \"Transfers\"});\n var submenu = new gui.Menu();\n // Submenu 1.\n submenu.append(new gui.MenuItem({ label: 'File Transfer', click :\n function(){\n var mainWin = gui.Window.get();\n var aboutWin = gui.Window.open('./filetransfer.html',{\n position: 'center',\n width:901,\n height:400,\n toolbar: false,\n focus: true\n });\n mainWin.blur();\n }\n }));\n item.submenu = submenu;\n appMenu.append(item);\n\n // Main Menu Item 3.\n item = new gui.MenuItem({ label: \"Help\" });\n var submenu = new gui.Menu();\n // Submenu 1.\n submenu.append(new gui.MenuItem({ label: 'About', click :\n function(){\n var mainWin = gui.Window.get();\n var aboutWin = gui.Window.open('./about.html', {\n position: 'center',\n width:901,\n height:400,\n toolbar: false,\n focus: true\n });\n mainWin.blur();\n }\n }));\n item.submenu = submenu;\n appMenu.append(item);\n gui.Window.get().menu = appMenu;\n }\n else {\n // menu for mac.\n }\n\n}", "function app(){\n mainMenu();\n}", "function showMainMenu(){\n addTemplate(\"menuTemplate\");\n showMenu();\n}", "function initMenu() {\n // Set up TreeMenu\n App4Sea.TreeMenu.SetUp();\n\n // Set up TreeInfo\n App4Sea.TreeInfo.SetUp();\n\n // Hook events to menu\n $(\"#MenuContainer input[type='checkbox']\").click(() => {\n updateBaseMap();\n });\n $('#MenuContainer select').change(() => {\n updateBaseMap();\n });\n }", "function gameMenutoMainMenu() {\n if (store.getState().lastAction == MENU_CHANGE && store.getState().previousPage == 'GAME_MENU' && store.getState().currentPage == 'MAIN_MENU') {\n mainSfxController(preloaderSfxSource);\n preloaderStarter();\n\n setTimeout(function(){\n gameMenu.classList.add('pagehide');\n mainMenu.classList.remove('pagehide');\n gameMenuStartableid.classList.remove('game-menu-startable');\n gameMenuBattlepointer1id.classList.remove('game-menu-battlepointer');\n if (store.getState().activeGameState.isMap1Completed != true) {\n gameMenuStarthereTextid.classList.add('nodisplay');\n }\n }, 600);\n\n setTimeout(function(){\n mainMenuCreditsButtonid.classList.remove('nodisplay');\n mainMenuStartButtonid.classList.remove('nodisplay');\n }, 1400);\n\n mainMenuPlayonmobileButtonid.classList.add('main-menu-playonmobile-button');\n\n loadSavedMenuid.classList.remove('load-saved-menu');\n loadSavedMenuid.classList.add('load-saved-menu-reverse');\n mainMenuArmorgamesImageid.classList.add('main-menu-armorgames-image');\n mainMenuIronhideImageid.classList.add('main-menu-ironhide-image');\n mainMenuStartImageid.classList.add('main-menu-start-image');\n mainMenuCreditsImageid.classList.add('main-menu-credits-image');\n }\n }", "function loadSavedMenutoMainMenu() {\n if (store.getState().previousPage == 'LOAD_SAVED' && store.getState().currentPage == 'MAIN_MENU') {\n mainMenuCreditsImageid.classList.replace('main-menu-credits-image-reverse', 'main-menu-credits-image-ls');\n mainMenuStartImageid.classList.replace('main-menu-start-image-reverse', 'main-menu-start-image-ls');\n mainMenuArmorgamesImageid.classList.replace('main-menu-armorgames-image-reverse', 'main-menu-armorgames-image-ls');\n mainMenuIronhideImageid.classList.replace('main-menu-ironhide-image-reverse', 'main-menu-ironhide-image-ls');\n\n mainMenuArmorgamesButtonid.classList.remove('nodisplay');\n mainMenuIronhideButtonid.classList.remove('nodisplay');\n\n loadSavedMenuid.classList.remove('load-saved-menu');\n loadSavedMenuid.classList.add('load-saved-menu-reverse');\n\n loadSavedMenuActionsContainerid.classList.add('nodisplay');\n\n setTimeout(function(){\n mainMenuCreditsButtonid.classList.remove('nodisplay');\n mainMenuStartButtonid.classList.remove('nodisplay');\n }, 1200);\n\n setTimeout(function(){\n try {\n mainMenuCreditsButtonid.classList.add('main-menu-credits-button');\n mainMenuStartButtonid.classList.add('main-menu-start-button');\n }\n catch(err) {}\n }, 800);\n }\n }", "function onOpen() {\n createMenu();\n}", "function loadApplication() {\n console.log(\"Application loaded\");\n // Load directly to the main menu\n configureUI(displayMainMenu());\n\n}", "function loadDefaultMenu()\n{\n\tvar output = \"\";\n\t\n\toutput += \"<a href='javascript:void(0)' class='closebtn' onclick='closeNav()'>&times;</a>\"\n\toutput += \"<a href='#' onclick='javascript:loadRegions()'>Region</a>\"\n\toutput += \"<a href='#' onclick='javascript:loadCities()'>City</a>\"\n\toutput += \"<a href='#' onclick='javascript:loadTeams()'>Team</a>\"\n\t\n\tdocument.getElementById(\"mySidenav\").innerHTML = output;\n}", "function mainmenu(){\n\t\t\t\tJ(\"#main_menu ul li ul\").css({display: \"none\"}); // Opera Fix\n\t\t\t\t\tJ(\"#main_menu ul li\").hover(function(){\n\t\t\t\t\t\tJ(this).find('ul:first').css({visibility: \"visible\",display: \"none\"}).show(300);\n\t\t\t\t\t\t},function(){\n\t\t\t\t\t\tJ(this).find('ul:first').css({visibility: \"hidden\"});\n\t\t\t\t\t});\n\t\t\t\t}", "function preMenutoMainMenu() {\n if (store.getState().lastAction == MENU_CHANGE && store.getState().previousPage == 'PRE_MENU' && store.getState().currentPage == 'MAIN_MENU') {\n mainSfxController(preloaderSfxSource);\n preloaderStarter();\n loadSavedMenuGameslotDisplayHandler();\n\n setTimeout(function(){\n preMenu.classList.add('pagehide');\n mainMenu.classList.remove('pagehide');\n }, 600);\n\n mainMenuPlayonmobileButtonid.classList.add('main-menu-playonmobile-button');\n mainMenuArmorgamesImageid.classList.add('main-menu-armorgames-image');\n mainMenuIronhideImageid.classList.add('main-menu-ironhide-image');\n mainMenuStartImageid.classList.add('main-menu-start-image');\n mainMenuCreditsImageid.classList.add('main-menu-credits-image');\n }\n }", "function init(){\n\n\t\tstorage = gieson.Storage;\n\n\t\tdocumon.PageManager.init();\n\t\tdocumon.MenuTree = new gieson.MenuTree({\n\t\t\t\ttarget : \"menuPanel\",\n\t\t\t\tcallback : documon.PageManager.loadPage,\n\t\t\t\tmenuData : MenuData // MenuData should be located on the window object, since it is loaded in via <script src=\"_menuData.js\">\n\t\t});\n\t\t\n\t\t// snag current page before loading others (otherwise the stored value will get overwritten)\n\t\tvar currentPageId = storage.get(\"currentPageId\");\n\t\tvar loadedPageIds = storage.get(\"loadedPageIds\");\n\t\t\n\t\tif(loadedPageIds && loadedPageIds.length){\n\t\t\tfor(var i=0; i<loadedPageIds.length; i++){\n\t\t\t\tdocumon.MenuTree.select(loadedPageIds[i]);\n\t\t\t}\n\t\t}\n\t\tif(currentPageId){\n\t\t\tdocumon.MenuTree.select(currentPageId);\n\t\t} else {\n\t\t\tif(MenuData && MenuData.length){\n\t\t\t\tdocumon.MenuTree.select(MenuData[0].id);\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\tdocumon.Access.init();\n\n\t\tdocumon.Search.init();\n\n\t\twindow.addEventListener(\"message\", receiveMessage, false);\n\n\t}", "function loadMenus() {\r\n debugger;\r\n API.getMenus()\r\n .then(res => \r\n setMenus(res.data)\r\n )\r\n .catch(err => console.log(err));\r\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}", "function init(){\r\n\t// Load the data from the text file\r\n\tloadJSON(function(response){\r\n\t\t// Parse JSON string into object\r\n\t\tvar content = JSON.parse(response);\r\n\t\tvar header = content.header;\r\n\t\tvar menu = content.menu;\r\n\t\tvar title = content.title;\r\n\t\tvar body = content.body;\r\n\t\tvar footer = content.footer;\r\n\t\t\r\n\t\t// Initiate the menu value\r\n\t\tvar menuContent = \"\";\r\n\t\tvar subMenuContent = '';\r\n\t\t\r\n\t\t//Get all the items for the menu\r\n\t\tfor (i=0; i < menu.length; i++){\r\n\t\t\t// If the item has a submenu \r\n\t\t\tif(menu[i].submenu != null && menu[i].submenu.length > 0)\r\n\t\t\t{\r\n\t\t\t\titem = '<a href=\"'+menu[i].url+'\">'+menu[i].title+'<i class=\"down\"></i></a>';\r\n\t\t\t\t\r\n\t\t\t\tfor (j=0; j < menu[i].submenu.length; j++) \r\n\t\t\t\t{\r\n\t\t\t\t\tsubMenuContent += '<a href=\"'+menu[i].submenu[j].url+'\">'+menu[i].submenu[j].title+'</a>';\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\titem = '<div class=\"dropdown\"><button class=\"dropbtn\">'+item+'</button><div class=\"dropdown-content\">'+subMenuContent+'</div></div>';\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\titem = '<a href=\"'+menu[i].url+'\">'+menu[i].title+'</a>';\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmenuContent += item;\r\n\t\t}\r\n\t\t\r\n\t\t// Prepare the menu to be sent to the page\r\n\t\tmenuContent += '<a href=\"javascript:void(0);\" class=\"icon\" onclick=\"showMenu()\">&#9776;</a>';\r\n\t\t\r\n\t\t// Add the data to the html nodes on the main page\r\n\t\tdocument.getElementById('header').innerHTML = \"<h1>\"+header+\"</h1>\";\r\n\t\tdocument.getElementById('title').innerHTML = title;\r\n\t\tdocument.getElementById('text').innerHTML = body;\r\n\t\tdocument.getElementById('footer').innerHTML = footer;\r\n\t\tdocument.getElementById('topnav').innerHTML = menuContent;\r\n\t\t\r\n\t\t// Remove the loader \r\n\t\tsetTimeout(function(){document.getElementById(\"loader\").style.display = \"none\"}, 3000);\r\n\t\t\r\n\t\t// show the page\r\n\t\tsetTimeout(function(){document.getElementById(\"container\").style.display = \"block\"}, 3000);\r\n\r\n\t});\r\n}", "function add_menu(){\n\t/******* add menu ******/\n\t// menu itsself\n\tvar menu=$(\"#menu\");\n\tif(menu.length){\n\t\trem_menu();\n\t};\n\n\tmenu=$(\"<div></div>\");\n\tmenu.attr(\"id\",\"menu\");\n\tmenu.addClass(\"menu\");\n\t\n\t//////////////// rm setup //////////////////\n\tvar f=function(){\n\t\tvar box=$(\"#rm_box\");\n\t\tif(box.length){\n\t\t\tbox.toggle();\t\n\t\t}\n\t};\n\tadd_sidebar_entry(menu,f,\"rules\",\"style\");\n\tvar box=$(\"<div></div>\");\n\tbox.attr(\"id\",\"rm_box\");\n\tbox.text(\"loading content ... hang on\");\n\tbox.hide();\n\tmenu.append(box);\t\n\t//////////////// rm setup //////////////////\n\n\t//////////////// area setup //////////////////\n\tvar f=function(){\n\t\tvar box=$(\"#areas_box\");\n\t\tif(box.length){\n\t\t\tbox.toggle();\t\n\t\t}\n\t};\n\tadd_sidebar_entry(menu,f,\"areas\",\"home\");\n\tvar box=$(\"<div></div>\");\n\tbox.attr(\"id\",\"areas_box\");\n\tbox.text(\"loading content ... hang on\");\n\tbox.hide();\n\tmenu.append(box);\t\n\t//////////////// area setup //////////////////\n\n\t//////////////// camera setup //////////////////\n\tvar f=function(){\n\t\tvar box=$(\"#cameras_box\");\n\t\tif(box.length){\n\t\t\tbox.toggle();\t\n\t\t}\n\t};\n\tadd_sidebar_entry(menu,f,\"units\",\"camera_enhance\");\n\tvar box=$(\"<div></div>\");\n\tbox.attr(\"id\",\"cameras_box\");\n\tbox.text(\"loading content ... hang on\");\n\tbox.hide();\n\tmenu.append(box);\t\n\t//////////////// camera setup //////////////////\n\n\t//////////////// user setup //////////////////\n\tvar f=function(){\n\t\tvar box=$(\"#users_box\");\n\t\tif(box.length){\n\t\t\tbox.toggle();\t\n\t\t\tlogin_entry_button_state(\"-1\",\"show\");\t// scale the text fields for the \"new\" entry = -1\n\t\t}\n\t};\n\tadd_sidebar_entry(menu,f,\"users\",\"group\");\n\tvar box=$(\"<div></div>\");\n\tbox.attr(\"id\",\"users_box\");\n\tbox.text(\"loading content ... hang on\");\n\tbox.hide();\n\tmenu.append(box);\t\n\t//////////////// user setup //////////////////\n\n\n\t//////////////// logout //////////////////\n\tvar f=function(){\n\t\t\tg_user=\"nongoodlogin\";\n\t\t\tg_pw=\"nongoodlogin\";\n\t\t\tc_set_login(g_user,g_pw);\n\t\t\ttxt2fb(get_loading(\"\",\"Signing you out...\"));\n\t\t\tfast_reconnect=1;\n\t\t\tcon.close();\n\n\t\t\t// hide menu\n\t\t\trem_menu();\n\t};\n\tadd_sidebar_entry(menu,f,\"log-out\",\"vpn_key\");\n\t//////////////// logout //////////////////\n\n\t////////////// hidden data_fields /////////////\n\tvar h=$(\"<div></div>\");\n\th.attr(\"id\",\"list_cameras\");\n\th.hide();\n\tmenu.append(h);\n\n\th=$(\"<div></div>\");\n\th.attr(\"id\",\"list_area\");\n\th.hide();\n\tmenu.append(h);\n\t////////////// hidden data_fields /////////////\n\n\n\tmenu.insertAfter(\"#clients\");\n\t\n\n\tvar hamb=$(\"<div></div>\");\n\thamb.click(function(){\n\t\treturn function(){\n\t\t\ttoggle_menu();\n\t\t}\n\t}());\n\thamb.attr(\"id\",\"hamb\");\n\thamb.addClass(\"hamb\");\n\tvar a=$(\"<div></div>\");\n\tvar b=$(\"<div></div>\");\n\tvar c=$(\"<div></div>\");\n\ta.addClass(\"hamb_l\");\n\tb.addClass(\"hamb_l\");\n\tc.addClass(\"hamb_l\");\n\thamb.append(a);\n\thamb.append(b);\n\thamb.append(c);\n\thamb.insertAfter(\"#clients\");\n\t/******* add menu ******/\n}", "loadMenu() {\n switch (this.currentMenuChoices) {\n case MenuChoices.null: // case MenuChoices.edit:\n this.menuView.contentsMenu.style.display = \"block\";\n this.menuView.loadContent.style.display = \"inline-table\";\n this.currentMenuChoices = MenuChoices.load;\n this.menuView.loadButton.style.backgroundColor = this.menuView.menuColorSelected;\n this.menuView.loadButton.style.zIndex = \"1\";\n break;\n case MenuChoices.load:\n this.menuView.contentsMenu.style.display = \"none\";\n this.menuView.loadContent.style.display = \"none\";\n this.currentMenuChoices = MenuChoices.null;\n this.menuView.loadButton.style.backgroundColor = this.menuView.menuColorDefault;\n this.menuView.loadButton.style.zIndex = \"0\";\n break;\n default:\n this.cleanMenu();\n this.menuView.loadButton.style.backgroundColor = this.menuView.menuColorSelected;\n this.menuView.loadButton.style.zIndex = \"1\";\n this.menuView.loadContent.style.display = \"inline-table\";\n this.currentMenuChoices = MenuChoices.load;\n break;\n }\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 }", "function initialise() {\n mainMenu();\n\n initialisePage();\n}", "function mainMenutoLoadSavedMenu() {\n if (store.getState().previousPage == 'MAIN_MENU' && store.getState().currentPage == 'LOAD_SAVED') {\n mainMenuCreditsButtonid.classList.add('nodisplay');\n mainMenuStartButtonid.classList.add('nodisplay');\n\n mainMenuArmorgamesImageid.classList.remove('main-menu-armorgames-image');\n mainMenuIronhideImageid.classList.remove('main-menu-ironhide-image');\n mainMenuStartImageid.classList.remove('main-menu-start-image');\n mainMenuCreditsImageid.classList.remove('main-menu-credits-image');\n mainMenuArmorgamesImageid.classList.remove('main-menu-armorgames-image-ls');\n mainMenuIronhideImageid.classList.remove('main-menu-ironhide-image-ls');\n mainMenuStartImageid.classList.remove('main-menu-start-image-ls');\n mainMenuCreditsImageid.classList.remove('main-menu-credits-image-ls');\n\n mainMenuArmorgamesImageid.classList.add('main-menu-armorgames-image-reverse');\n mainMenuIronhideImageid.classList.add('main-menu-ironhide-image-reverse');\n mainMenuStartImageid.classList.add('main-menu-start-image-reverse');\n mainMenuCreditsImageid.classList.add('main-menu-credits-image-reverse');\n mainMenuCreditsButtonid.classList.add('nodisplay');\n mainMenuStartButtonid.classList.add('nodisplay');\n\n loadSavedMenuid.classList.remove('load-saved-menu-start', 'load-saved-menu-reverse');\n loadSavedMenuid.classList.add('load-saved-menu');\n\n setTimeout(function(){\n try { loadSavedMenuActionsContainerid.classList.remove('nodisplay') }\n catch(err) {}\n }, 800);\n\n setTimeout(function(){\n loadSavedMenuGameslotDisplayHandler();\n }, 600);\n\n\n loadSavedMenuDeleteConfirmationTrue();\n loadSavedMenuDeleteConfirmationFalse();\n }\n }", "function init() {\n var menu = new Item();\n menu.submenu = $('#bottomBar ul.menu');\n\n var accountMenuItem = menu.addItem('account', undefined, 'account');\n var settingsMenuItem = menu.addItem('settings', undefined, 'settings');\n var downloadsMenuItem = menu.addItem('downloads',undefined, 'downloads');\n var aboutUsMenuItem = menu.addItem('about_us', undefined, 'aboutus');\n\n /*\n * Accounts\n */\n accountMenuItem.addItem('invitation', account.showInviteDialog);\n if (account.isLoggedIn()) {\n accountMenuItem.addItem('change_login_data', account.editProfile);\n accountMenuItem.addItem('delete_account', account.deleteAccount);\n accountMenuItem.addSeparator();\n var logOutParent = (settings.os === \"web\") ? menu : accountMenuItem;\n logOutParent.addItem('logout', function() {\n sync.fireSync(true);\n }, 'logout');\n } else {\n accountMenuItem.addItem('sign_in', account.showRegisterDialog);\n }\n\n // Language Menu\n var languageMenuItem = settingsMenuItem.addItem('language', undefined, 'language');\n var languages = language.availableLang, languageItem;\n $.each(languages, function(code) {\n languageItem = languageMenuItem.addItem(languages[code].translation);\n languageItem.el.attr(\"class\", code);\n });\n languageMenuItem.el.delegate('li', 'click', function(e) {\n language.setLanguage(e.currentTarget.className);\n });\n\n\n settingsMenuItem.addSeparator();\n settingsMenuItem.addItem('add_item_method', dialogs.openSelectAddItemMethodDialog);\n settingsMenuItem.addItem('switchdateformat', dialogs.openSwitchDateFormatDialog);\n settingsMenuItem.addItem('sidebar_position', dialogs.openSidebarPositionDialog);\n settingsMenuItem.addItem('delete_prompt_menu', dialogs.openDeletePromptDialog);\n\n var isNaturalDateRecognitionEnabled = settings.getInt('enable_natural_date_recognition', 0);\n var enableNaturalDateRecognitionMenuString = 'enable_natural_date_recognition';\n var enableNaturalDateRecognitionMenuItem;\n if (isNaturalDateRecognitionEnabled === 1) {\n enableNaturalDateRecognitionMenuString = 'disable_natural_date_recognition';\n }\n enableNaturalDateRecognitionMenuItem = settingsMenuItem.addItem(enableNaturalDateRecognitionMenuString, function () {\n var isNaturalDateRecognitionEnabled = settings.getInt('enable_natural_date_recognition', 0);\n if (isNaturalDateRecognitionEnabled === 1) {\n settings.setInt('enable_natural_date_recognition', 0);\n enableNaturalDateRecognitionMenuItem.setLabel('enable_natural_date_recognition');\n } else {\n settings.setInt('enable_natural_date_recognition', 1);\n enableNaturalDateRecognitionMenuItem.setLabel('disable_natural_date_recognition');\n }\n });\n settingsMenuItem.addSeparator();\n\n // Reset Window Positions\n settingsMenuItem.addItem('reset_window_size', undefined);\n settingsMenuItem.addItem('reset_note_window', undefined);\n\n // Create Tutorials\n //settingsMenuItem.addItem('create_tutorials', database.recreateTuts);\n\n /*\n * About Wunderlist\n */\n\n aboutUsMenuItem.addItem('knowledge_base', 'http://support.6wunderkinder.com/kb');\n //aboutUsMenuItem.addItem('privacy_policy', 'http://www.6wunderkinder.com');\n aboutUsMenuItem.addItem('wunderkinder_tw', 'http://www.twitter.com/6Wunderkinder');\n aboutUsMenuItem.addItem('wunderkinder_fb', 'http://www.facebook.com/6Wunderkinder');\n aboutUsMenuItem.addSeparator();\n aboutUsMenuItem.addItem('changelog', 'http://www.6wunderkinder.com/wunderlist/changelog');\n aboutUsMenuItem.addItem('backgrounds', dialogs.openBackgroundsDialog);\n aboutUsMenuItem.addItem('about_wunderlist', dialogs.openCreditsDialog);\n aboutUsMenuItem.addItem('about_wunderkinder', 'http://www.6wunderkinder.com/');\n\n\n /*\n * Downloads\n */\n downloadsMenuItem.addItem('iphone', 'http://itunes.apple.com/us/app/wunderlist-to-do-listen/id406644151');\n downloadsMenuItem.addItem('ipad', 'http://itunes.apple.com/us/app/wunderlist-hd/id420670429');\n downloadsMenuItem.addItem('android', 'http://market.android.com/details?id=com.wunderkinder.wunderlistandroid');\n if (settings.os !== 'darwin') {\n downloadsMenuItem.addItem('macosx', 'http://www.6wunderkinder.com/wunderlist/');\n }\n if (settings.os !== 'windows') {\n downloadsMenuItem.addItem('windows', 'http://www.6wunderkinder.com/wunderlist/');\n }\n if (settings.os !== 'linux') {\n downloadsMenuItem.addItem('linux', 'http://www.6wunderkinder.com/wunderlist/');\n }\n }", "function init() {\n let menu = $E('menu', {\n id: kUI.prefMenu.id,\n label: kUI.prefMenu.label,\n accesskey: kUI.prefMenu.accesskey\n });\n\n if (kSiteList.length) {\n let popup = $E('menupopup');\n\n $event(popup, 'command', onCommand);\n\n kSiteList.forEach(({name, disabled}, i) => {\n let menuitem = popup.appendChild($E('menuitem', {\n label: name + (disabled ? ' [disabled]' : ''),\n type: 'checkbox',\n checked: !disabled,\n closemenu: 'none'\n }));\n\n menuitem[kDataKey.itemIndex] = i;\n });\n\n menu.appendChild(popup);\n }\n else {\n $E(menu, {\n tooltiptext: kUI.prefMenu.noSiteRegistered,\n disabled: true\n });\n }\n\n $ID('menu_ToolsPopup').appendChild(menu);\n }", "function setMenu(menu){ \n switch(menu){\n case 'food-input-icon':\n loadFoodMenu();\n break; \n \n case 'stats-icon':\n loadStatsMenu(); \n break; \n \n case 'settings-icon':\n loadSettingsMenu(); \n break;\n \n case 'share-icon':\n loadShareMenu(); \n break;\n \n case 'sign-out-icon':\n signOut(); \n break;\n case 'nav-icon':\n loadNavMenu(); \n \n }\n}", "function initMenuFunction() {\n if (menuStatus == \"menu-exist\") {\n fetchMenu(dateSelected).done(function (menuArray) {\n backupArray = menuArray;\n setMenuData(menuArray);\n setModifyButtonClickListener();\n setDeleteBtnClickListener(dateSelected);\n setMenuEditable(menuStatus === \"no-menu\" ? true : false);\n });\n }\n }", "function carregaMenu(pagina){\n\tlet dir = \"C:/www/HEALTHLAB/frontend/\";\n\t$('#menu').load(dir+pagina, function() {\n\t\tdocument.getElementById('titulo-header').innerHTML = document.getElementById('title').innerHTML;\n\t});\n}", "function scene::BuildMenu(folder)\r\n{\r\n local idx = 0;\r\n local fb = FileBrowser();\r\n local files = fb.BroseDir(folder,\"*.gbt,*.ml\");\r\n local uiman = system.GetUIMan();\r\n local scrsz = SIZE();\r\n local xpos = 2;\r\n local menuYpos = uiman.GetScreenGridY(0)-16; // font index(0-3)\r\n local slot = 0;\r\n \r\n\tmaps.resize(0);\r\n menubar.resize(0);\r\n \r\n if(files)\r\n {\r\n maps.resize(files);\r\n menubar.resize(files+4); // for top and remote\r\n }\r\n \r\n menubar[slot] = UiControl();\r\n menubar[slot].Create(0, xpos, menuYpos, xpos+70, menuYpos + 7);\r\n menubar[slot].SetFont(3);\r\n menubar[slot].SetText(\"Curent Folder: \" + folder, 0);\r\n menubar[slot].SetImage(\"topmenu.bmp\");\r\n menubar[slot].SetColor(0xCCCCCC, 0xCCCCCC);\r\n slot++;\r\n menuYpos -= 4;\r\n\r\n// makes button for remote downloading\r\n menuYpos-=3;\r\n menubar[slot] = UiControl();\r\n menubar[slot].Create(100, xpos, menuYpos, xpos+40, menuYpos+3);\r\n menubar[slot].SetFont(1);\r\n menubar[slot].SetText(\"> Remote Levels\", 0);\r\n menubar[slot].SetImage(\"topmenu.bmp\");\r\n menubar[slot].SetColor(0xCCCC00, 0xCCCCCC);\r\n slot++;\r\n \r\n \r\n // makes button for getting back to bspmaps\r\n menubar[slot] = UiControl();\r\n menubar[slot].Create(101, xpos+40, menuYpos, xpos+80, menuYpos+3);\r\n menubar[slot].SetFont(1);\r\n menubar[slot].SetText(\"> Local levels\", 0);\r\n menubar[slot].SetImage(\"topmenu.bmp\");\r\n menubar[slot].SetColor(0xCCCC00, 0xCCCCCC);\r\n slot++;\r\n \r\n // makes button for getting back to bspmaps\r\n menubar[slot] = UiControl();\r\n menubar[slot].Create(102, xpos+80, menuYpos, xpos+120, menuYpos+3);\r\n menubar[slot].SetFont(1);\r\n menubar[slot].SetText(\"> Master Server\", 0);\r\n menubar[slot].SetImage(\"topmenu.bmp\");\r\n menubar[slot].SetColor(0xCCCC00, 0xCCCCCC);\r\n slot++;\r\n \r\n menuYpos -= 4;\r\n\r\n \r\n for( idx=0; idx < files; idx+=1)\r\n {\r\n local lf = fb.GetAt(idx);\r\n if(lf == \"\") break;\r\n\r\n maps[idx] = folder+lf;\r\n\r\n menubar[slot] = UiControl();\r\n menubar[slot].Create(idx, xpos+(idx), menuYpos, xpos+(idx)+40, menuYpos+3);\r\n menubar[slot].SetFont(1);\r\n menubar[slot].SetText(lf, 0);\r\n menubar[slot].SetImage(\"freebut.bmp\");\r\n menubar[slot].SetColor(0xCCCC44, 0xCCCCCC);\r\n\r\n menuYpos-=3;\r\n slot++;\r\n }\r\n}", "function openMenuItemsOnLoad()\r\n{\r\n\tfindCookieRoot();\r\n\tvar openMenuItemIds = get_cookie('openMenuItemIds');\r\n\tif (openMenuItemIds) \r\n\t{\r\n\t\tvar itemForOpenArr = openMenuItemIds.split(\";\");\r\n\t\tfor (var i = 0; i < itemForOpenArr.length; i++) \r\n\t\t{\r\n\t\t\tvar itemId = itemForOpenArr[i];\r\n\t\t\t// show sometimes conficts with slideDown in Vmenu2()\r\n\t\t\t$(\"#\"+itemId).slideDown(1);\r\n\t\t\tvar par = $(\"#\"+itemId).parent();\r\n\t\t\tvar parc = $('a.current').parent();\r\n\t\t\tif($('a.current',par).length && $(par).attr('id')!=$(parc).attr('id'))\r\n\t\t\t\t$(par).find('a:first').css('color',window.colorlink);\r\n\t\t\t$(par).find('img:first').attr(\"src\", \"include/img/minus.gif\");\t\t\r\n\t\t}\r\n\t}\r\n\ttoggleExpandCollapse();\r\n}", "function setupMenu() {\n // console.log('setupMenu');\n\n document.getElementById('menuGrip')\n .addEventListener('click', menuGripClick);\n\n document.getElementById('menuPrint')\n .addEventListener('click', printClick);\n\n document.getElementById('menuHighlight')\n .addEventListener('click', menuHighlightClick);\n\n const menuControls = document.getElementById('menuControls');\n if (Common.isIE) {\n menuControls.style.display = 'none';\n } else {\n menuControls.addEventListener('click', menuControlsClick);\n }\n\n document.getElementById('menuSave')\n .addEventListener('click', menuSaveClick);\n\n document.getElementById('menuExportSvg')\n .addEventListener('click', exportSvgClick);\n\n document.getElementById('menuExportPng')\n .addEventListener('click', exportPngClick);\n\n PageData.MenuOpen = (Common.Settings.Menu === 'Open');\n}", "function initializeMainMenu() {\r\n\r\n \t\"use strict\";\r\n \tvar $mainMenu = jQuery('#main-menu').children('ul');\r\n\r\n \tif(Modernizr.mq('only all and (max-width: 1024px)') ) {\r\n\r\n \t\r\n\r\n \t\t/* Responsive Menu Events */\r\n \t\tvar addActiveClass = false;\r\n \t\r\n \t\tjQuery('.subMenu').css('display', 'none');\r\n \t\tjQuery(\"li:not(.menu-item-object-neko_homesection) a.hasSubMenu, .menu-item-language-current.menu-item-has-children\").unbind('click');\r\n \t\tjQuery('li',$mainMenu).unbind('mouseenter mouseleave');\r\n\r\n\r\n \t\tjQuery(\"a.hasSubMenu\").on(\"click\", function(e) {\r\n\r\n \t\t\tvar $this = jQuery(this);\t\r\n \t\t\te.preventDefault();\r\n\r\n\r\n \t\t\taddActiveClass = $this.parent(\"li\").hasClass(\"Nactive\");\r\n\r\n\r\n \t\t\t$this.parent(\"li\").removeClass(\"Nactive\");\r\n \t\t\t$this.next('.subMenu').slideUp('fast');\r\n\r\n\r\n\r\n \t\t\tif(!addActiveClass) {\r\n \t\t\t\t$this.parents(\"li\").addClass(\"Nactive\");\r\n \t\t\t\t$this.next('.subMenu').slideDown('fast');\r\n\r\n \t\t\t}else{\r\n \t\t\t\t$this.parent().parent('li').addClass(\"Nactive\");\r\n \t\t\t}\r\n\r\n \t\t\treturn;\r\n \t\t});\r\n\r\n\t\t/** condition for wpml dropdown menu **/\r\n\t\tjQuery(\".menu-item-language-current.menu-item-has-children\").on(\"click touchend\", function(e) {\r\n\r\n\t\t\tvar $this = jQuery(this);\t\r\n\t\t\te.preventDefault();\r\n\r\n\t\t\taddActiveClass = $this.hasClass(\"Nactive\");\r\n\r\n\r\n\t\t\t$this.removeClass(\"Nactive\");\r\n\t\t\t$this.children('.sub-menu').slideUp('fast');\r\n\t\t\t\r\n\r\n\t\t\tif(!addActiveClass) {\r\n\t\t\t\t$this.addClass(\"Nactive\");\r\n\t\t\t\t$this.children('.sub-menu').slideDown('fast');\r\n\t\t\t}\r\n\r\n\t\t\treturn;\r\n\t\t});\r\n\r\n\r\n \t}else{\r\n\r\n\r\n \t\tjQuery(\"li\", $mainMenu).removeClass(\"Nactive\");\r\n \t\tjQuery('li:not(.menu-item-object-neko_homesection) a', $mainMenu).unbind('click');\r\n \t\tjQuery('.subMenu, .sub-menu').css('display', 'none');\r\n\r\n \t\tjQuery('li',$mainMenu).hover(\r\n\r\n \t\t\tfunction() {\r\n\r\n \t\t\t\tvar $this = jQuery(this),\r\n \t\t\t\t$subMenu = $this.children('.subMenu, .sub-menu');\r\n\r\n\r\n \t\t\t\tif( $subMenu.length ){\r\n\r\n \t\t\t\t$this.addClass('hover').stop();\t\r\n\r\n \t\t\t\t}else {\r\n\r\n \t\t\t\t\tif($this.parent().is(jQuery(':gt(1)', $mainMenu))){\r\n\r\n \t\t\t\t\t\t$this.stop(false, true).fadeIn('slow');\r\n\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n\r\n\r\n \t\t\t\tif($this.parent().is(jQuery(':gt(1)', $mainMenu))){\r\n\r\n \t\t\t\t\t$subMenu.stop(true, true).fadeIn(200,'easeInOutQuad'); \r\n \t\t\t\t\t\r\n \t\t\t\t\tif($this.parents(\"li.primary\").hasClass('nk-submenu-right')){\r\n \t\t\t\t\t\t$subMenu.css('left', -$subMenu.parent().outerWidth(true));\r\n \t\t\t\t\t}else{\r\n \t\t\t\t\t\t$subMenu.css('left', $subMenu.parent().outerWidth(true));\r\n \t\t\t\t\t}\r\n\r\n\r\n \t\t\t\t}else{\r\n\r\n \t\t\t\t\t$subMenu.stop(true, true).delay( 300 ).fadeIn(200,'easeInOutQuad'); \t\t\t\t\t\r\n\r\n \t\t\t\t}\r\n\r\n \t\t\t}, function() {\r\n\r\n \t\t\t\tvar $this = jQuery(this),\r\n \t\t\t\t$subMenu = $this.children('ul');\r\n\r\n \t\t\t\tif($this.parent().is(jQuery(':gt(1)', $mainMenu))){\r\n\r\n\r\n \t\t\t\t\t$this.children('ul').hide();\r\n \t\t\t\t\t$this.children('ul').css('left', 0);\r\n\r\n\r\n \t\t\t\t}else{\r\n\r\n \t\t\t\t\t$this.removeClass('hover');\r\n \t\t\t\t\t$subMenu.stop(true, true).delay( 300 ).fadeOut();\r\n \t\t\t\t}\r\n\r\n \t\t\t\tif( $subMenu.length ){$this.removeClass('hover');}\r\n\r\n \t\t\t});\r\n\r\n \t}\r\n }", "function nicholls_menu_loader() {\n\t\t\n\t\t\tjQuery('#footer').append( '<div id=\"nicholls-menu-loader\"></div>' );\n\t\t\t\n\t\t\tjQuery('#nicholls-menu-list').children().each( function() {\n\t\t\t\t// We stop if the item has no menu. Using the .each() using 'return true' is like 'continue'\n\t\t\t\tif ( jQuery(this).hasClass('nicholls-menu-no' ) ) return true;\n\t\t\t\t\n\t\t\t\t// We get the class of the moused over object\n\t\t\t\tvar menu_load_id = jQuery(this).attr('id');\n\t\n\t\t\t\t// Perorm all the heavy lifting ajax because menu_load_id should be clean by now\n\t\t\t\tvar menu_data = jQuery( '#'+menu_load_id+'-source' ).html();\n\t\n\t\t\t\tjQuery('#nicholls-menu-content').append( '<div id=\"'+menu_load_id+'-contents\" class=\"nicholls-menu-contents\">'+menu_data+'</div>' );\n\t\t\t\n\t\t\t});\n\t\t\n\t\t}", "function loadHorizontalMenu() {\n\t\t \tvar loadAsync = new Deferred();\n\n\t\t\t\trequire([\"dojo/request\"], function(request){\n\t\t\t\t\n\t\t\t\t\trequest(jsonDefinitionUri_).then(function(data){\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Having \" in a string for JSON parsing is sometimes\n\t\t\t\t\t\t// frowned on by parsers; replace them with ' to prevent\n\t\t\t\t\t\t// obscure JSON parsing problems\n\t\t\t\t\t\tvar menuData = JSON.parse(data.replace(/\\\\\"/g,\"\\'\"));\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tDojoArray.forEach(menuData.menus_,function(item){\n\t\t\t\t\t\t\tbuildMenu(item,hMenu,false);\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Our accessibility key for the File Menu is m\n\t\t \thMenu.own(\n\t \t\t\ton(window, \"keypress\", function(e){\n\t \t\t\t\trequire([\"dialogs\"],function(BTDialogs){\n\t \t\t\t\t\tif(!BTDialogs.checkForRegisteredModals()) {\n\t\t\t\t\t \t\tvar keyPressed = String.fromCharCode(e.charCode || e.keyCode || e.which);\n\t\t\t\t\t \t\tif(keyPressed == \"m\") {\n\t\t\t\t\t \t\t\thMenu.focus();\n\t\t\t\t \t\t\t\te.preventDefault();\n\t\t\t\t \t\t\t\te.stopPropagation();\n\t\t\t\t\t \t\t}\t \t\t\t\t\t\t\n\t \t\t\t\t\t} \t\t\t\t\t\n\t \t\t\t\t});\n\t \t\t\t})\n\t\t \t);\t\n\t\t \t\n\t\t \t// MenuBar doesn't completely behave in a desktop-like manner due to how focusing on\n\t\t \t// the DOM works. So this helps make it slightly more Desktop-like.\n\t\t \t\n\t\t \thMenu.own(\n\t \t\t\ton(hMenu, \"keypress\", function(e){\n\t\t\t \t\tvar keyPressed = String.fromCharCode(e.charCode || e.keyCode || e.which);\n\t\t\t \t\tif(keyPressed == \"m\") {\n\t\t\t \t\t\t// There's a problem with the menubar not actually being blurred\n\t\t\t \t\t\t// once an action's been used in one of its submenus. So we're going\n\t\t\t \t\t\t// to instead force defocusing and then reacquire. Unfortunately\n\t\t\t \t\t\t// this will always land back on the first MenuBar child, but it's\n\t\t\t \t\t\t// better than an invisible focus.\n\t\t\t \t\t\tif(hMenu.focusedChild === hMenu.getChildren()[0]) {\n\t\t\t \t\t\t\thMenu.focusNext();\n\t\t\t \t\t\t}\n\t\t\t \t\t\thMenu.focus();\n\t\t \t\t\t\te.preventDefault();\n\t\t \t\t\t\te.stopPropagation();\n\t\t\t \t\t}\n\t \t\t\t})\n\t\t \t);\t\t \t\n\n\t\t\t\t\t\thMenu.startup();\n\t\t\t\t\t\t\n\t\t\t\t\t\tloadAsync.resolve(hMenu);\n\t\t\t\t\t\t\n\t\t\t\t\t}, function(err){\n\t\t\t\t\t\tloadAsync.reject(\"FileMenu request errored: \" + err);\n\t\t\t\t\t}, function(evt){\n\t\t\t\t\t\t// Progress would go here\n\t\t\t\t\t});\n\t\t\t\t});\t\t \t\n\t\t \t\n\t\t \treturn loadAsync.promise;\n\t\t }", "function initmenu(levels,height,width,delay,type)\r\n{\r\nif (populatemenuitems==\"true\")\r\n{\r\nfor (i=0;i<=levels-1;i++)\r\n{\r\nMENU_ITEMS[i] = ITEMS[i+1];\r\n}\r\n}\r\n\r\n//setting the height\r\nglobheight=height;\r\ngloblevel=levels;\r\nglobwidth=width;\r\nglobdelay=delay;\r\n\r\nif (populatemenuitems==\"false\")\r\n{\r\n if (type==\"horizontal\")\r\n {\r\n //Defaults for horizontal\r\n MENU_POS['block_left'] = [0, 0];\r\n MENU_POS['top'] = [0];\r\n MENU_POS['left'] = [globwidth];\r\n globtype=\"horizontal\";\r\n }\r\n else\r\n { \r\n //Defaults for vertical\r\n MENU_POS['block_left'] = [0, globwidth];\r\n MENU_POS['top'] = [0, 0];\r\n MENU_POS['left'] = [0, 0];\r\n globtype=\"vertical\";\r\n }\r\n}\r\n}", "function mainMenuShow () {\n $ (\"#menuButton\").removeAttr (\"title-1\");\n $ (\"#menuButton\").attr (\"title\", htmlSafe (\"Stäng menyn\")); // i18n\n $ (\"#menuButton\").html (\"×\");\n $ (\".mainMenu\").show ();\n}", "function menu() {\n\t$('#menu').off();\n\tinitModel();\n\trenderMenu();\n\n\t$('#menu').on('click', '.levels', game);\n}", "function load_json_menu_object(){\n\tjQuery.getJSON(plugin_url +'menu/menu_object.js', function(data){\n\t\t//attach to global menu object(s)\n\t\tmenu_object = data.menu.structure;\n\t\tmenu_config = data.menu.config;\n\t\t//check menu config\n\t\tcheck_menu_configuration();\n\t\t//iterate the menu object\n\t\titerate_menu_object();\n\t});\n}", "function OnMouseDown()\n{\n Application.LoadLevel(\"MainMenu\");\n}", "function init_menus(trees) {\n menus.pane = new Tweakpane.Pane({\n container: div_tweakpane,\n }).addFolder({ \n title: \"Control panel\", expanded: view.control_panel.show\n });\n\n const tab = menus.pane.addTab({ pages: [\n { title: \"Layout\" },\n { title: \"Selections\" },\n { title: \"Advanced\" },\n ]});\n create_menu_basic(tab.pages[0], trees);\n create_menu_selection(tab.pages[1]);\n create_menu_advanced(tab.pages[2])\n\n\n //const tab = menus.pane.addTab({ pages: [\n //{ title: \"Tree view\" },\n //{ title: \"Representation\" },\n //{ title: \"Selection\" },\n //]});\n //create_menu_main(tab.pages[0], trees);\n //create_menu_representation(tab.pages[1]);\n //create_menu_selection(tab.pages[2]);\n}", "function load()\n{\n\tsetupParts();\n\t\n\tmain();\n}", "function initializeMenu() {\n robotMenu = Menus.addMenu(\"Robot\", \"robot\", Menus.BEFORE, Menus.AppMenuBar.HELP_MENU);\n\n CommandManager.register(\"Select current statement\", SELECT_STATEMENT_ID, \n robot.select_current_statement);\n CommandManager.register(\"Show keyword search window\", TOGGLE_KEYWORDS_ID, \n search_keywords.toggleKeywordSearch);\n CommandManager.register(\"Show runner window\", TOGGLE_RUNNER_ID, \n runner.toggleRunner);\n CommandManager.register(\"Run test suite\", RUN_ID,\n runner.runSuite)\n robotMenu.addMenuItem(SELECT_STATEMENT_ID, \n [{key: \"Ctrl-\\\\\"}, \n {key: \"Ctrl-\\\\\", platform: \"mac\"}]);\n \n robotMenu.addMenuDivider();\n\n robotMenu.addMenuItem(RUN_ID,\n [{key: \"Ctrl-R\"},\n {key: \"Ctrl-R\", platform: \"mac\"},\n ]);\n\n robotMenu.addMenuDivider();\n\n robotMenu.addMenuItem(TOGGLE_KEYWORDS_ID, \n [{key: \"Ctrl-Alt-\\\\\"}, \n {key: \"Ctrl-Alt-\\\\\", platform: \"mac\" }]);\n robotMenu.addMenuItem(TOGGLE_RUNNER_ID,\n [{key: \"Alt-R\"},\n {key: \"Alt-R\", platform: \"mac\"},\n ]);\n }", "function loadMenu() {\n GetPage('treemenu.html', \n function(pResponse) { \n $(\"#menu\").jstree({\n \"plugins\" : [ \"themes\", \"html_data\", \"ui\", \"cookies\"],\n \"cookies\" : {\n \"save_opened\" : \"evolved_tree\",\n \"save_selected\" : \"evolved_selected\",\n \"auto_save\" : true\n },\n \"themes\" : {\n \"theme\" : \"apple\",\n \"dots\" : true,\n \"icons\" : false\n },\n \"html_data\" : {\n \"data\" : pResponse\n }\n });\n ShowLoading(false);\n AttachLinkEvents();\n \n var goTo = $.query.get('GoTo');\n if(goTo) {\n ShowPage(unescape(goTo));\n } else {\n GetPage('welcome.html', \n function(pResponse) {\n $('#page').html(pResponse);\n AttachLinkEvents();\n }\n );\n }\n }\n );\n}", "function main() {\n menu = new states.Menu();\n currentstate = menu;\n}", "function initMenus() {\n $(document).on('click', '.sidemenu-switch', function (event) {\n $('.sidebar').toggleClass('light');\n $('.content').toggleClass('light');\n });\n function toggleMenu($menu){\n $menu.toggleClass('open');\n }\n $(document).on('click', '.menu .menu-toggle', function (event){\n event.preventDefault();\n toggleMenu($(this).parents('.menu').first());\n });\n }", "function startMenu() {\n createManager();\n}", "function loadSavedtoGameMenu() {\n if (store.getState().lastAction == MENU_CHANGE && store.getState().previousPage == 'LOAD_SAVED' && store.getState().currentPage == 'GAME_MENU') {\n mainSfxController(preloaderSfxSource);\n preloaderStarter();\n\n setTimeout(function(){\n mainMenuPlayonmobileButtonid.classList.remove('main-menu-playonmobile-button');\n mainMenu.classList.add('pagehide');\n gameMenu.classList.remove('pagehide');\n mainMenuArmorgamesImageid.classList.remove('main-menu-armorgames-image-reverse');\n mainMenuIronhideImageid.classList.remove('main-menu-ironhide-image-reverse');\n mainMenuStartImageid.classList.remove('main-menu-start-image-reverse');\n mainMenuCreditsImageid.classList.remove('main-menu-credits-image-reverse');\n }, 600);\n\n if (store.getState().activeGameState.isMap1Completed != true) {\n setTimeout(function(){\n gameMenuStarthereTextid.classList.remove('nodisplay');\n }, 2200);\n }\n\n gameMenuStartableid.classList.add('game-menu-startable');\n gameMenuBattlepointer1id.classList.add('game-menu-battlepointer');\n mainMenuArmorgamesImageid.classList.remove('main-menu-armorgames-image');\n mainMenuIronhideImageid.classList.remove('main-menu-ironhide-image');\n mainMenuStartImageid.classList.remove('main-menu-start-image');\n mainMenuCreditsImageid.classList.remove('main-menu-credits-image');\n }\n }", "function OnQuit()\n{\n\t// back to main menu\n\tApplication.LoadLevel(\"StartMenu\");\n}", "function loadManagerMenu() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n // Load the possible manager menu options, pass in the products data\n loadManagerOptions(res);\n });\n}", "function loadMenu(dest,type){\n// dest Aff = affluenze Com = composizione Scr = scrutinio\n// type 0 = regionali 1 = camera 2 = senato\n name = dest;\n tipo = type;\n \tif (name == 'Aff'){\n\t\tloadStato();\t\n\t}else{\n\t\tloadData();\n\t}\n}", "function loadMenu(){\n if(failSafe){\n textIntro.innerHTML = \"\";\n svg.style.display = \"block\";\n newGameButton.style.display = \"block\";\n buttonBox.style.display = \"block\";\n endText.style.display = \"none\";\n endStats.style.display = \"none\";\n textMenu.style.display = \"none\";\n textIntro.style.display = \"none\";\n skipButton.style.display = \"none\";\n skipButtonBox.style.display = \"none\";\n endText.style.display = \"none\";\n endStats.style.display = \"none\";\n if (localStorage.getItem(\"game\") === null){\n button.style.display = \"none\";\n }else{\n button.style.display = \"block\";\n html.style.height = \"33%\";\n }\n failSafe = false;\n }\n}", "function init() {\n console.log('Welcome to your company employee manager.')\n menu()\n}", "function setupMainMenu() {\n mainMenuFontHeight = height;\n mainMenuFontAlpha = 0;\n}", "_initMenu() {\n this.menu.parentMenu = this.triggersSubmenu() ? this._parentMenu : undefined;\n this.menu.direction = this.dir;\n this._setMenuElevation();\n this._setIsMenuOpen(true);\n this.menu.focusFirstItem(this._openedBy || 'program');\n }", "function mainMenu() {\n\n //Present the user with a list of options to choose from\n inquirer\n .prompt([\n //give user main menu options\n {\n name: \"choice\",\n type: \"rawlist\",\n choices: info.menus.main,\n message: \"What would you like to do?\"\n }\n ])\n .then(function(answer) {\n //Check if the user wants to exit\n checkForExit(answer.choice);\n\n switch(answer.choice) {\n case \"Run Test\":\n pickDirectory(\"test\");\n break;\n case \"View Scores\":\n viewMenu();\n break;\n default:\n mainMenu();\n }\n \n });\n}", "function init() {\n reset();\n menu = new GameMenu();\n /* Initialize the level */\n initLevel();\n\n lastTime = Date.now();\n main();\n }", "function initMainScreen() {\n //Initialize the user list for \"Contacts\" tab\n initContactList();\n\n //Initialize the chat list for \"Chats\" tab\n initChatList();\n\n // now show the side panel icon\n $('.rightSidePaneBtnDiv').show();\n}", "function preloadMainMenu(game) {\n game.load.image('menu-bg', 'assets/bg/main-menu.png');\n game.load.image('button-medium', 'assets/ui/button-medium.png');\n game.load.image('black', 'assets/ui/black.png');\n\n game.load.audio('menu-bgm', ['assets/music/title.mp3']);\n game.load.audio('menu-accept', ['assets/sounds/accept01.mp3']);\n}", "function load_menu_links(menu, menu_option) {\n\n\tconsole.log('load_menu_links called: ');\n\tconsole.log('menu: '+JSON.stringify(menu))\n\tconsole.log('menu_option: '+JSON.stringify(menu_option))\n\n\n\t$(\"#side-menu > a\").click(function(e) {\n\t\te.preventDefault();\n\t\tlink = $(this).attr('href');\n\n\t\t$(\"#content-header\").html($(this).html());\n\n\t\tif (link in menu ) {\n\t\t\tlink2 = link;\n\t\t\t$('#content_'+link2).css('display','flex');\n\t\t\tload_sidebar_options(menu_option,link2);\n\t\t\tadd_back_button(menu_option);\n\t\t\tshow_content(link2);\n\t\t\treturn '';\n\t\t}\n\n\t\tconsole.log(\"SHOWING LINK: =========> \"+link);\n\t\tshow_content(link);\n\t});\n\n}", "function CreditstoMainMenu() {\n if (store.getState().lastAction == MENU_CHANGE && store.getState().previousPage == 'CREDITS' && store.getState().currentPage == 'MAIN_MENU') {\n mainSfxController(preloaderSfxSource);\n preloaderStarter();\n\n setTimeout(function(){\n credits.classList.add('pagehide');\n mainMenu.classList.remove('pagehide');\n }, 600);\n\n setTimeout(function(){\n mainMenuCreditsButtonid.classList.remove('nodisplay');\n mainMenuStartButtonid.classList.remove('nodisplay');\n }, 1400);\n\n mainMenuPlayonmobileButtonid.classList.add('main-menu-playonmobile-button');\n mainMenuArmorgamesImageid.classList.add('main-menu-armorgames-image');\n mainMenuIronhideImageid.classList.add('main-menu-ironhide-image');\n mainMenuStartImageid.classList.add('main-menu-start-image');\n mainMenuCreditsImageid.classList.add('main-menu-credits-image');\n }\n }", "function init() {\n if (!app.dock) return\n const menu = Menu.buildFromTemplate(getMenuTemplate())\n app.dock.setMenu(menu)\n}", "function initMain(){\n\tbuildGameButton();\n\tbuildGameStyle();\n\tbuildScoreboard();\n\t\n\tgoPage('main');\n\tloadXML('questions.xml');\n}", "function LoadMainMenu(css_effect_class_name) {\n\tg_CSSEffectClassName = css_effect_class_name;\n\tconsole.log(\"CSS EFFET NAME: \" + css_effect_class_name);\n\tvar domNodeList = document.getElementsByClassName(\"IcarusButton\");\n\tfor(var i = 0; i < domNodeList.length; ++i)\n\t{\n\t\t// Work-around the fact that onload is not working on button elements\n\t\tdomNodeList[i].onload();\n\t}\n\t\n\t// Get the options from the engine to know if\n\t// whether or not we should be using mouse\n\t\n\t// Get from engine: info about if there is a save\n\t//\t file or not.\n\t\n\t// Pop either New Game or Continue, depending on what\n\t// the engine tells us\n}", "_start() {\n\n this._menuView = new MenuView(\n document.querySelector('nav'),\n this.sketches\n );\n\n for (var key in this.sketches) {\n this.DEFAULT_SKETCH = key;\n break;\n }\n\n this._setupScroll();\n this._setupWindow();\n this._onHashChange();\n }", "function loadMenuContent() {\r\n let amiList = document.querySelectorAll(\".allMenuItems\");\r\n\r\n amiList.forEach((item) => {\r\n if (item.dataset.jsMain) {\r\n let currentDay = item.dataset.jsMain;\r\n item.textContent = dmpContent[currentDay][\"main\"];\r\n } else if (item.dataset.jsSide1) {\r\n let currentDay = item.dataset.jsSide1;\r\n item.textContent = dmpContent[currentDay][\"side1\"];\r\n } else if (item.dataset.jsSide2) {\r\n let currentDay = item.dataset.jsSide2;\r\n item.textContent = dmpContent[currentDay][\"side2\"];\r\n } else if (item.dataset.jsOther) {\r\n let currentDay = item.dataset.jsOther;\r\n item.textContent = dmpContent[currentDay][\"other\"];\r\n } else {\r\n let currentDay = item.dataset.jsNotesSpan;\r\n item.textContent = dmpContent[currentDay][\"notes\"];\r\n }\r\n });\r\n\r\n addOrEdit();\r\n}", "function install_menu() {\n var config = {\n name: 'dashboard_level',\n submenu: 'Settings',\n title: 'Dashboard Level',\n on_click: open_settings\n };\n wkof.Menu.insert_script_link(config);\n }", "function C999_Common_Achievements_MainMenu() {\n C999_Common_Achievements_ResetImage();\n\tSetScene(\"C000_Intro\", \"ChapterSelect\");\n}", "prepare() { this.createTopMenu(); this.createQuickMenu(); this.showQuickMenu(); }", "initMenu() {\n this.on('menu-selected', event => {\n // Focus on search bar if in most popular tab (labeled All)\n if (event.choice === 'most-popular') {\n this.focusSearchBar();\n }\n\n this.currentlySelected = event.choice;\n }, this);\n\n // call init menu from sdk\n initNavbar(this.menu);\n }", "function MAIN_NAVIGATION$static_(){ToolbarSkin.MAIN_NAVIGATION=( new ToolbarSkin(\"main-navigation\"));}", "function initLoad() {\n\t/////////////////// MAPPER LES LIENS ///////////////////\n\tif (Modernizr.history) {\t\n\t\t// menu\n\t\t$(\"#cn-wrapper a\").each(function() {\n\t\t\t$(this).click(function() {\n\t\t\t\teverPushed = true;\n\t\t\t\t$(\".cn-wrapper li a.survol\").removeClass(\"survol\");\n\t\t\t\tloadStart($(this).attr(\"href\"));\n\t\t\t\treturn false;\n\t\t\t});\n\t\t});\n\t\t$(\"#container-map-ima area\").each(function() {\n\t\t\t$(this).click(function() {\n\t\t\t\teverPushed = true;\n\t\t\t\t$(\".cn-wrapper li a.survol\").removeClass(\"survol\");\n\t\t\t\tloadStart($(this).attr(\"href\"));\n\t\t\t\treturn false;\n\t\t\t});\n\t\t});\n\t\t// footer \n\t\t/*$(\"#bloc-btn-bottom a[href^=mentions]\").click(function() {\n\t\t\tloadStart($(this).attr(\"href\"));\n\t\t\teverPushed = true;\n\t\t\treturn false;\n\t\t});*/\n\t\t// contenu\n\t\tmapAllLinks();\n\t\n\t\t/////////////////// GESTION D'URL ///////////////////\n\t\t$(window).bind(\"popstate\", function() {\n\t\t\t\n\t\t\tif (everPushed) {\n\t\t\t link = location.pathname.substr(0, location.pathname.length-1).replace(/^.*[\\\\/]/, \"\"); \n\t\t\t loadStart(link);\n\t\t\t }\n\n\t\t});\n\t\t\n\t\t\n\n\t}\n}", "function loadMenu(currentNavItem){\n /**\n * Load menu to div with id \"menu\" and highlight tab denoted by currentNavItem\n * @param {String} currentNavItem - either search, compare, or donate\n */\n var xhr= new XMLHttpRequest();\n xhr.open('GET', 'menu.html', true);\n xhr.onreadystatechange= function() {\n if (this.readyState!==4) return;\n if (this.status!==200) return; // or whatever error handling you want\n document.getElementById('menu').innerHTML= this.responseText;\n // Highlight current page nav text after menu bar is loaded\n console.log(currentNavItem)\n highlightNavItem(currentNavItem)\n obj = getSessionObject()\n document.getElementById('funds').innerHTML = '$'+(obj['percentAllocated']/100.0*obj['totalFunds']).toFixed(2)+'/$'+obj['totalFunds']+' allocated';\n loadCart();\n };\n xhr.send();\n\n}", "function load_sidebar_options(menu_option,sidebar_option) {\n\tcontent = $(\"#\"+menu_option);\n\n\tif (typeof sidebar_option === 'undefined') { sidebar_option = menu_option+\"-main-panel\"; }\n\n\tconsole.log('load_sidebar_options menu_option = '+menu_option);\n\tconsole.log('load_sidebar_options sidebar_option = '+sidebar_option);\n\n\ttry {\n\t\t//first level: button is found on top bar\n\t\tif (menu_option in menu_options) {\n\t\t\t//sidebar is cleared, to be filled again\n\t\t\t$('#side-menu > a').remove();\n\n\t\t\t// menu = second level\n\t\t\tmenu = menu_options[menu_option];\n\t\t\tconsole.log('load_sidebar_options menu: '+JSON.stringify(menu));\n\t\t\tconsole.log(\"load_sidebar_options sidebar option: \"+JSON.stringify(menu[sidebar_option]));\n\n\t\t\tsidebar_options = menu[sidebar_option];\n\t\t\t//third level\n\t\t\tfor (var i=0;i<=sidebar_options.length-1;i++) {\n\n\t\t\t\tconsole.log('load_sidebar_options sidebar[i]:' + JSON.stringify(sidebar_options[i]));\n\n\t\t\t\toption = sidebar_options[i];\n\n\t\t\t\tname = option['name'];\n\t\t\t\tlink = option['link'];\n\t\t\t\tdescription = option['description'];\n\n\t\t\t\tconsole.log('name = '+name);\n\t\t\t\tconsole.log('link = '+link);\n\t\t\t\tconsole.log('description = '+description);\n\n\t\t\t\t//sidebar element is created\n\t\t\t\telement = $('<a href=\"' + link +'\"><div class=\"side-menu-option\">'+ name +'</div></a>');\n\n\t\t\t\t//sidebar element is added\n\t\t\t\t$(\"#side-menu\").append(element);\n\n\t\t\t\t//if there is a funct on the third level, it's bound to a click event\n\t\t\t\tif ('funct' in option) {\n\t\t\t\t\tfunct = option['funct'];\n\t\t\t\t\tadd_sidebar_funct(element,option['funct']);\n\t\t\t\t}\n\n\t\t\t\tif('description' in option) {\n\t\t\t\t\tadd_sidebar_description(element,description);\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t//load_menu_links method binds the click events to the new sidebar options\n\t\t\t//menu, menu_option are passed further for recursivity:\n\t\t\t//\tif \"link\" is in menu, that means a newly created sidebar item is also on level 2\n\t\t\t//\t so it actually runs load_sidebar_options again for his own sidebar elements\n\t\t\tload_menu_links(menu, menu_option);\n\n\t\t}\n\n\t} catch(err) {\n\t\tconsole.log('No menu options for element '+err);\n\t}\n}", "function mainMenu() {\n hideOverlay();\n showOverlay();\n getId('quitText').innerHTML = \"Go to the<br>MAIN MENU?\";\n\tgetId('buttonLeftText').innerHTML = \"Yes\";\n\tgetId('buttonRightText').innerHTML = \"Back\";\n}", "function initializeMainMenu() {\n\n \t\"use strict\";\n \tvar $mainMenu = jQuery('.menu-header .navbar-collapse').children('ul');\n\n\n \tif(Modernizr.mq('only all and (max-width: 1024px)') || Modernizr.touch && Modernizr.mq('only all and (max-width: 1024px)')) {\n\n \t\tvar addActiveClass = false;\n\n \t\tjQuery(\"li a.has-sub-menu\").unbind('click');\n \t\t$('li',$mainMenu).unbind('mouseenter mouseleave');\n\n\n \t\t$(\"a.has-sub-menu\").on(\"click\", function(e) {\n\n \t\t\tvar $this = jQuery(this);\t\n \t\t\te.preventDefault();\n\n \t\t\taddActiveClass = $this.parent(\"li\").hasClass(\"Nactive\");\n\n \t\t\t$this.parent().removeClass(\"Nactive\");\n \t\t\t$this.next('.sub-menu').slideUp('fast');\n\n\n \t\t\tif(!addActiveClass) {\n \t\t\t\t$this.parents(\"li\").addClass(\"Nactive\");\n \t\t\t\t$this.next('.sub-menu').slideDown('fast');\n \t\t\t}\n\n \t\t\treturn false;\n \t\t});\n\n \t}else if( Modernizr.touch && Modernizr.mq('only all and (min-width: 1024px)') ){\n\n \t\t$(\"li\", $mainMenu).removeClass(\"Nactive\");\n \t\t$('li a', $mainMenu).unbind('click');\n\n \t\t$(\"a.has-sub-menu\").on(\"click\", function(e) {\n\n \t\t\te.preventDefault();\n\n \t\t\tvar $this = jQuery(this),\n \t\t\t$subMenu = $this.parent().children('.sub-menu'),\n \t\t\t$header_H = $('.menu-header').outerHeight(true);\n\n\n\n \t\t\tif($this.parent().parent().is(jQuery(':gt(1)', $mainMenu))){\n\n \t\t\t\t$subMenu.stop(true, true).fadeIn(200,'easeInOutQuad'); \n \t\t\t\t$subMenu.css('left', $subMenu.parent().outerWidth(true));\n\n \t\t\t}else{\n\n \t\t\t\t$('.sub-menu').css('display', 'none');\n\n \t\t\t\tif($subMenu.css('display') === 'none'){\n\n \t\t\t\t\tvar preheaderoffset = 0;\n \t\t\t\t\tvar offset = 0;\n \t\t\t\t\tif($('#pre-header').css('display') === 'block'){\n \t\t\t\t\t\tpreheaderoffset = $('#pre-header').outerHeight(true);\n \t\t\t\t\t}\n\n \t\t\t\t\tif($('.header-6').length || $('.header-7').length){\n \t\t\t\t\t\tvar $displayState = ($subMenu.hasClass('neko-mega-menu'))?'table':'block';\n \t\t\t\t\t\t$subMenu.css('top', ($header_H - preheaderoffset ) + offset);\n\n \t\t\t\t\t}else{\n \t\t\t\t\t\tif($('.header-1').length && !$('.scroll-header').length){\n \t\t\t\t\t\t\toffset = - parseInt($('.menu-header').css('padding-bottom'));\n \t\t\t\t\t\t}\n\n \t\t\t\t\t\t$subMenu.css('top', ($header_H - preheaderoffset) + offset); \n \t\t\t\t\t}\n \t\t\t\t\t$subMenu.stop(true, true).delay( 300 ).fadeIn(200,'easeInOutQuad', function(){});\n \t\t\t\t}\n \t\t\t}\n \t\t});\n}else{\n\n\t$(\"li\", $mainMenu).removeClass(\"Nactive\");\n\t$('li a', $mainMenu).unbind('click');\n\n\t$('li',$mainMenu).hover(\n\n\t\tfunction() {\n\n\t\t\tvar $this = jQuery(this),\n\t\t\t$subMenu = $this.children('.sub-menu'),\n\t\t\t$header_H = $('.menu-header').outerHeight(true) - parseInt($('.menu-header').css('padding-top'));\n\n\n\t\t\tif($this.parent().is(jQuery(':gt(1)', $mainMenu))){\n\t\t\t\t$subMenu.stop(true, true).fadeIn(200,'easeInOutQuad').end(); \n\t\t\t\t$subMenu.css('left', $subMenu.parent().outerWidth(true));\n\t\t\t}else{\n\n\t\t\t\tvar preheaderoffset = 0;\n\t\t\t\tvar offset = 0;\n\t\t\t\tif($('#pre-header').css('display') === 'block'){\n\t\t\t\t\tpreheaderoffset = $('#pre-header').outerHeight(true);\n\t\t\t\t}\n\n\t\t\t\t$subMenu.css('top', ($header_H - preheaderoffset) + offset); \n\n\n\t\t\t\t$subMenu.stop(true, true).delay( 300 ).fadeIn(200,'easeInOutQuad', function(){});\n\t\t\t}\n\n\t\t}, function() {\n\n\t\t\tvar $this = jQuery(this),\n\t\t\t$subMenu = $this.children('ul, div');\n\n\t\t\tif($this.parent().is(jQuery(':gt(1)', $mainMenu))){\n\t\t\t\t$this.children('ul').hide();\n\n\n\t\t\t}else{\n\n\t\t\t\t$subMenu.stop(true, false).delay( 300 ).fadeOut(0).end();\n\t\t\t\tif( $subMenu.length ){$this.removeClass('hover');}\n\n\t\t\t}\n\n\t\t});\n}\n}", "function loadMainView() {\n let body = document.getElementsByTagName('body')[0];\n let root = webComponents.getComponentByName('adminui-root', 'root');\n let components = webComponents.components;\n webComponents.loadGroup(components.sidebar, root.sidebarTarget, context);\n webComponents.loadGroup(components.topbar, root.topbarTarget, context);\n webComponents.loadGroup(components.dashboard_page, root.contentTarget, context);\n webComponents.loadGroup(components.logout_modal, body, context);\n }", "function loadMainView() {\n let body = document.getElementsByTagName('body')[0];\n let root = webComponents.getComponentByName('adminui-root', 'root');\n let components = webComponents.components;\n webComponents.loadGroup(components.sidebar, root.sidebarTarget, context);\n webComponents.loadGroup(components.topbar, root.topbarTarget, context);\n webComponents.loadGroup(components.dashboard_page, root.contentTarget, context);\n webComponents.loadGroup(components.logout_modal, body, context);\n }", "function initMenuListener() {\n /*\n Left Panel\n */\n // Prevent default behavior and use ajax to load pages.\n $(\"#nav\").on(\"click\", \"a\", function (e) {\n e.preventDefault();\n var page = $(this).attr(\"href\");\n var title = $(this).html();\n // Dont load a href link from the closebutton in menu.\n if (page != '#closeleft') {\n loadPage(page, title);\n }\n });\n\n // Close left panel when clicking on menu item\n $(\"#nav-panel\").on(\"click\", \"li\", function () {\n $(\"#nav-panel\").panel(\"close\");\n });\n\n }", "function menuhrres() {\r\n\r\n}", "static async load()\n {\n await RPM.settings.read();\n await RPM.datasGame.read();\n RPM.gameStack.pushTitleScreen();\n RPM.datasGame.loaded = true;\n RPM.requestPaintHUD = true;\n }", "function menuLoader(extension) {\n return Promise.resolve(MENU);\n}", "function manageMenu() {\n if (menuOpen) {\n menuOpen = false;\n closeMenu();\n } else {\n menuOpen = true;\n openMenu();\n }\n}", "function loadMenuButtons(){\n texts = [];\n texts.push(new Text(WIDTH/2, HEIGHT/25, WIDTH/6, \"OCTE\", -WIDTH/10, false));\n //texts.push(new Text(WIDTH/2, HEIGHT*0.2, WIDTH/50, \"(overly complicated tennis experience)\", -WIDTH/10, false));\n buttons = [];\n buttons.push(new Button(WIDTH/2, HEIGHT/2 - HEIGHT/10 + HEIGHT/150, WIDTH*0.2, HEIGHT/15, \"1player\", \"1 PLAYER\", 0, {}));\n buttons.push(new Button(WIDTH/2, HEIGHT/2 + HEIGHT/150, WIDTH*0.2, HEIGHT/15, \"2player\", \"2 PLAYERS\", 0, {}));\n buttons.push(new Button(WIDTH/2, HEIGHT/2 + HEIGHT/10 + HEIGHT/150, WIDTH*0.2, HEIGHT/15, \"options\", \"OPTIONS\", 0, {}));\n}", "function __m_menuBtns_init(){\n\t\t__m_menuBtns_effect();\n\t\t__m_menuBtns_click();\n\n\t\t_m_prozor_init();\n\t}", "function loadAdmin() {\n\tvar city = getSelectedCity();\n\tloadNews(city);\n}", "onReady() {\n SmartCrawlerMenu.set();\n this.createWindow();\n }", "function loadStart() {\n // Prepare the screen and load new content\n collapseHeader(false);\n wipeContents();\n loadHTML('#info-content', 'ajax/info.html');\n loadHTML('#upper-content', 'ajax/texts.html #welcome-text');\n loadHTML('#burger-container', 'ajax/burger-background.html #burger-flags', function() {\n loadScript(\"js/flag-events.js\");\n });\n}", "function main () {\n\t$('.bt-menu').click(function(){\n\t\tif (contador == 1) {\n\t\t\t$('nav').animate({\n\t\t\t\tleft: '0'\n\t\t\t});\n\t\t\tcontador = 0;\n\t\t\tmenuresp =menuresp+1;\n\t\t} else {\n\t\t\tcontador = 1;\n\t\t\t//menuresp = menuresp+1;\n\t\t\t$('nav').animate({\n\t\t\t\tleft: '-100%'\n\t\t\t});\n\t\t}\n\t});\n\n\t// Mostramos y ocultamos submenus\n\t$('.submenu').click(function(){\n\t\t$(this).children('.children').slideToggle();\n\t});\n\tvar altura= $('.menu').offset().top;\n\t//alert(altura);\n\t$(window).on('scroll', function(){\n\t\tif ($(window).scrollTop()> altura) {\n\t\t\t$('.menu').addClass('sticky');\n\t\t} else{\n\t\t\t$('.menu').removeClass('sticky');\n\t\t}\n\t});\n}", "function initMenu() {\n\n //removeSelectedClassForMenu();\n\n //$('.sub-menu > .sub-menu__item').eq(selectedIndex).addClass('sub-menu__item--active', 'active');\n \n }", "preloadMenu()\n {\n currentScene.load.image('Fondo', 'assets/sprites/Menus/Fondo.png');\n currentScene.load.image('Loading', 'assets/sprites/Menus/Loading.png');\n currentScene.load.image('GoatMenu', 'assets/sprites/Menus/GoatMenu.png');\n currentScene.load.image('Fondo2', 'assets/sprites/Menus/Fondo2.png');\n currentScene.load.image('Logo', 'assets/sprites/Menus/GoatLogo.png');\n currentScene.load.image('GameCredits', 'assets/sprites/Menus/GamuCreditso.png');\n\n currentScene.load.image('FirstStart', 'assets/sprites/Menus/Play.png');\n\n currentScene.load.image('StartBtn', 'assets/sprites/Menus/Start.png');\n currentScene.load.image('StartHigh', 'assets/sprites/Menus/Start2.png');\n currentScene.load.image('ContinueBtn', 'assets/sprites/Menus/Continue.png');\n currentScene.load.image('ContinueHigh', 'assets/sprites/Menus/Continue2.png');\n currentScene.load.image('MenuMuteBtn', 'assets/sprites/Menus/Mute.png');\n currentScene.load.image('MenuMuteHigh', 'assets/sprites/Menus/Mute2.png');\n currentScene.load.image('CreditsBtn', 'assets/sprites/Menus/Credits.png');\n currentScene.load.image('CreditsHigh', 'assets/sprites/Menus/Credits2.png');\n }", "function simulat_menu_infos() {\n display_menu_infos();\n}", "function cargarInicio() {\n $(\"#col-md-12\").load(\"./inicio.php\");\n $(\".menu_movil\").on('click', cargarPagina);\n $(\".menu_movil\").on('touch', cargarPagina);\n // $(\".sub-menu\").on('touch', mostrarsubmenu);\n}", "function loadControls(id) {\n $(\"#main\").hide();\n showid = id;\n controls_loaded = true;\n $(\"#main\").load(\"/presentor/control/\" + id, function(){\n slideButtons();\n });\n $(\".menuitem.control\").show();\n}", "function StartMenu() {\n //this.menu = new Menu('start-menu');\n this.shutDownMenu = new Menu('shutdown-menu');\n this.shutDownButton = new MenuButton('options-button', this.shutDownMenu);\n Menu.apply(this, ['start-menu']);\n}", "function setupMenu()\n{\t\n\t//load random background for menu\n\tvar randomBackground = Math.floor(Math.random()*2);\n\tconsole.log(\"Random background: \"+randomBackground);\n\tvar extension = \".jpg\";\n\tdocument.getElementById('menubackground').src = 'images/menu/' + randomBackground + extension;\n\n\t//Fade in menu\n\tEffect.Fade('menu', { duration: 0.5, from: 0, to: 1 });\n\t\n\t//hide map div\n\tdocument.getElementById('map').style.width = \"0%\";\n\tdocument.getElementById('map').style.height = \"0%\";\n\tdocument.getElementById('map').style.visibility = \"hidden\";\n\t\n\t//hide console\n\tdocument.getElementById('console').style.width = \"0%\";\n\tdocument.getElementById('console').style.height = \"0%\";\n\tdocument.getElementById('console').style.visibility = \"hidden\";\n\n\t//play main menu soundtrack\n\tdocument.getElementById('soundtrack').src = 'sounds/mainmenu.mp3';\n\tvar soundtrack = document.getElementById('soundtrack');\n\tif (music == 1)\n\t{\n\t\tsoundtrack.play();\t\n\t}\t\n\t\n\t//play swish in sound\n\t//playInterfaceEffect('swishin.mp3');\n\n\t//load random background for map\n\tvar randomBackground = Math.floor(Math.random()*4);\n\tconsole.log(\"Random background: \"+randomBackground);\n\tvar part1 = \"url('images/background/\";\n\tvar part2 = \".png')\";\n\tdocument.getElementById('map').style.background = part1 + randomBackground + part2;\n\n}", "function LoadModule(menu) {\n\tthis.menu = menu;\n\t// this.menu.requestParams = GetUrlRequestParamsObject(menu.url)\n}" ]
[ "0.7608732", "0.74284774", "0.7232722", "0.7225084", "0.7198799", "0.7092776", "0.7044938", "0.7030987", "0.6989321", "0.6959533", "0.6922993", "0.69172233", "0.6883626", "0.6871499", "0.68668133", "0.68262374", "0.6801431", "0.67479944", "0.6747484", "0.6720265", "0.6705218", "0.6693347", "0.6689412", "0.6688759", "0.66592604", "0.6653795", "0.6651958", "0.664279", "0.6632294", "0.6627585", "0.6603974", "0.65887195", "0.6585702", "0.65770686", "0.65753365", "0.65734726", "0.6563493", "0.65602", "0.6548712", "0.6535952", "0.65351355", "0.6534831", "0.6527872", "0.65247625", "0.6523778", "0.6522321", "0.6521654", "0.6516245", "0.650564", "0.64893854", "0.6488323", "0.6486772", "0.64802355", "0.6477342", "0.64564925", "0.6455204", "0.64463264", "0.6439931", "0.6407104", "0.6389538", "0.6367174", "0.63632435", "0.6343173", "0.634304", "0.6335133", "0.63260823", "0.631966", "0.63169765", "0.631514", "0.6311305", "0.6299487", "0.62950414", "0.6294765", "0.6270825", "0.62602645", "0.6251977", "0.62509865", "0.6245617", "0.62445927", "0.6233263", "0.6233263", "0.62321967", "0.62283534", "0.6226549", "0.6223282", "0.62208325", "0.62185746", "0.6215418", "0.62147766", "0.62126094", "0.6210869", "0.6209713", "0.6193936", "0.61938655", "0.619289", "0.61924887", "0.61887497", "0.617677", "0.61701226", "0.6157938" ]
0.8382835
0
To deal with files longer than the minimap, slowely scroll the minimap as you go up and down and take into account the minimap.session.$scrollTop for your calculations scrolling the editor
function updateScrollOver(event){ var newScrBoxTop = (event.clientY+10) - (scrBoxHeight/2), isUnderTop = ((newScrBoxTop + self.minimap.session.$scrollTop) >= scrollOver.offsetTop), newScrBoxBottom = (event.clientY+10) + (scrBoxHeight/2), isOverBottom = ((newScrBoxBottom + self.minimap.session.$scrollTop) <= (scrollOver.offsetTop+scrollOver.offsetHeight)); if(down && isUnderTop && isOverBottom){ //TODO: take into account minimap.session.$scrollTop for clicks on the minimap var line = (((event.clientY+10) - scrollOver.offsetTop + self.minimap.session.$scrollTop)/(self.minimap.renderer.$textLayer .$characterSize.height)); //TODO: figure out why I have to add this 10...padding?...margin? scrollBox.style.top = (newScrBoxTop); self.Editor.editor.scrollToLine(line, true, false); } else if(down && isUnderTop){ scrollBox.style.top = scrollOver.offsetTop + scrollOver.offsetHeight - scrollBox.offsetHeight; self.Editor.editor.scrollToLine(self.Editor.editor.session.getLength(), true, false); } else if(down && isOverBottom){ scrollBox.style.top = scrollOver.offsetTop; self.Editor.editor.scrollToLine(1, true, false); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function syncSrcScroll () {\n var resultHtml = $(resultClass),\n scrollTop = resultHtml.scrollTop(),\n textarea = $(srcClass),\n lineHeight = parseFloat(textarea.css('line-height')),\n lines,\n i,\n line;\n\n if (!scrollMap) { scrollMap = buildScrollMap(); }\n\n lines = Object.keys(scrollMap);\n\n if (lines.length < 1) {\n return;\n }\n\n line = lines[0];\n\n for (i = 1; i < lines.length; i++) {\n if (scrollMap[lines[i]] < scrollTop) {\n line = lines[i];\n continue;\n }\n\n break;\n }\n\n textarea.stop(true).animate({\n scrollTop: lineHeight * line\n }, 100, 'linear');\n}", "function slowFrame2() { // this is the scrolling function\n if (Math.abs(document.body.scrollTop - beforePeekPosition) <= Math.abs(diff)) { // if its very close to destination\n clearInterval(slowInterval); // stop scrolling\n document.body.scrollTop = beforePeekPosition; // set scroll to destination\n beforePeekPosition = -1; // peek finished\n } else {\n document.body.scrollTop = document.body.scrollTop + diff; // scroll\n }\n }", "function syncResultScroll() {\n var textarea = $(srcClass),\n lineHeight = parseFloat(textarea.css('line-height')),\n lineNo, posTo;\n\n lineNo = Math.floor(textarea.scrollTop() / lineHeight);\n if (!scrollMap) { scrollMap = buildScrollMap(); }\n posTo = scrollMap[lineNo];\n $(resultClass).stop(true).animate({\n scrollTop: posTo\n }, 100, 'linear');\n}", "function qodeOnWindowScroll() {\n\t qodeInitNewsShortcodesPagination().scroll();\n }", "updateScroll(){\n \t\tif (this.$.content.scrollHeight > this.$.content.offsetHeight){\n \t\t\tthis.$.content.scrollTop = this.$.content.scrollHeight - this.$.content.offsetHeight;\n \t\t}\n \t}", "function browseScrollPos() {\n var $selectedItem = $('.workspace-browse li.selected .page__container.selected'),\n $browseTree = $('.workspace-browse');\n\n if ($selectedItem.length) {\n var selectedTop = $selectedItem.offset().top,\n selectedBottom = selectedTop + $selectedItem.height(),\n browseTop = $browseTree.offset().top,\n browseBottom = browseTop + $browseTree.height(),\n navHeight = $('.nav').height();\n\n if (selectedTop < browseTop) {\n console.log('Item was outside of viewable browse tree');\n $browseTree.scrollTop($browseTree.scrollTop() + (selectedTop) - (navHeight / 2));\n } else if (selectedBottom > browseBottom) {\n console.log('Item was outside of viewable browse tree');\n $browseTree.scrollTop(selectedBottom - (navHeight / 2) - $selectedItem.height())\n }\n }\n}", "function fixScroll(editor) {\n // Below is copied from the CodeMirror window resize handler, codeMirror.refresh() didn't work...\n const d = editor.display\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null\n d.scrollbarsClipped = false\n editor.setSize()\n}", "function updateScroll(){\n $('#scrollBox').scrollTop(9999999999999999999999999999999999999);\n}", "function updateScroll() {\n var element = document.getElementById(fileouput);\n element.scrollTop = element.scrollHeight;\n}", "function ScrollPosition() {}", "function scroll_check(ev,tag){\n\n\tdrag_manager.scroll_value = tag.scrollTop;\n\n\tfolder_positions_find();\n\n}", "function scrollOver(){\n var current = $galleryDoc.docById();\n var scrollAmount;\n if (current.length){\n scrollAmount = current.position().left - current.parent().width()/2 + current.innerWidth()/2;\n }else{\n return;\n }\n\n current.addClass('current-document');\n $galleryDoc.embedViewport.find('.gallery').animate({\n scrollLeft: scrollAmount\n }, 200);\n }", "watchScroll() {\n this.isScrolledToBottom = (this.msgsEl.scrollTop + this.msgsEl.offsetHeight) === this.msgsEl.scrollHeight;\n if (this.msgsEl.scrollTop === 0) { // stick to earliest message on history upload\n const currentFirstMessage = this.msgsEl.children[0];\n this.ChatService.loadOlderMessages().then(() => {\n this.timeout(()=>currentFirstMessage.scrollIntoView());\n });\n }\n }", "function slowFrame1() { // this is the scrolling function\n if (Math.abs(document.body.scrollTop - target) <= Math.abs(diff)) { // if its very close to destination\n clearInterval(slowInterval); // stop scrolling\n document.body.scrollTop = target; // set scroll to destination\n } else {\n document.body.scrollTop = document.body.scrollTop + diff; // scrolling\n }\n }", "function updateScreenshotScroll() {\r\n if (!isMobile) { \r\n $('#screenshots').slimScroll(slimOptionsContent); \r\n }\r\n}", "buildScrollMap() {\n if (!this.totalLineCount) {\n return null;\n }\n const scrollMap = [];\n const nonEmptyList = [];\n for (let i = 0; i < this.totalLineCount; i++) {\n scrollMap.push(-1);\n }\n nonEmptyList.push(0);\n scrollMap[0] = 0;\n // write down the offsetTop of element that has 'data-line' property to scrollMap\n const lineElements = this.previewElement.getElementsByClassName(\"sync-line\");\n for (let i = 0; i < lineElements.length; i++) {\n let el = lineElements[i];\n let t = el.getAttribute(\"data-line\");\n if (!t) {\n continue;\n }\n t = parseInt(t, 10);\n if (!t) {\n continue;\n }\n // this is for ignoring footnote scroll match\n if (t < nonEmptyList[nonEmptyList.length - 1]) {\n el.removeAttribute(\"data-line\");\n }\n else {\n nonEmptyList.push(t);\n let offsetTop = 0;\n while (el && el !== this.previewElement) {\n offsetTop += el.offsetTop;\n el = el.offsetParent;\n }\n scrollMap[t] = Math.round(offsetTop);\n }\n }\n nonEmptyList.push(this.totalLineCount);\n scrollMap.push(this.previewElement.scrollHeight);\n let pos = 0;\n for (let i = 0; i < this.totalLineCount; i++) {\n if (scrollMap[i] !== -1) {\n pos++;\n continue;\n }\n const a = nonEmptyList[pos - 1];\n const b = nonEmptyList[pos];\n scrollMap[i] = Math.round((scrollMap[b] * (i - a) + scrollMap[a] * (b - i)) / (b - a));\n }\n return scrollMap; // scrollMap's length == screenLineCount (vscode can't get screenLineCount... sad)\n }", "function updateScroll(){if(!elements.li[0])return;var height=elements.li[0].offsetHeight,top=height*ctrl.index,bot=top+height,hgt=elements.scroller.clientHeight,scrollTop=elements.scroller.scrollTop;if(top<scrollTop){scrollTo(top);}else if(bot>scrollTop+hgt){scrollTo(bot-hgt);}}", "function reposition() {\n var amountOfIframeScroll = initialScroll - $editorDoc.scrollTop();\n var heightAboveToolbar = $toolbar.offset().top - $contentWrap.offset().top; // e.g. merge conflict resolution\n var heightOfPrecursor = $editorPrecursor.outerHeight();\n var heightOfToolbar = $toolbar.outerHeight();\n\n $editorPrecursor.css('top', (heightAboveToolbar + heightOfToolbar + amountOfIframeScroll + precursorTopPadding) + 'px');\n $editorBody.css('padding-top', (heightOfPrecursor + bodyTopPadding) + 'px');\n }", "initWindowEvents() {\n /**\n * Several keyboard events.\n */\n window.addEventListener(\"keydown\", (event) => {\n if (event.shiftKey && event.ctrlKey && event.which === 83) {\n // ctrl+shift+s preview sync source\n return this.previewSyncSource();\n }\n else if (event.metaKey || event.ctrlKey) {\n // ctrl+c copy\n if (event.which === 67) {\n // [c] copy\n document.execCommand(\"copy\");\n }\n else if (event.which === 187 && !this.config.vscode) {\n // [+] zoom in\n this.zoomIn();\n }\n else if (event.which === 189 && !this.config.vscode) {\n // [-] zoom out\n this.zoomOut();\n }\n else if (event.which === 48 && !this.config.vscode) {\n // [0] reset zoom\n this.resetZoom();\n }\n else if (event.which === 38) {\n // [ArrowUp] scroll to the most top\n if (this.presentationMode) {\n window[\"Reveal\"].slide(0);\n }\n else {\n this.previewElement.scrollTop = 0;\n }\n }\n }\n else if (event.which === 27) {\n // [esc] toggle sidebar toc\n this.escPressed(event);\n }\n });\n window.addEventListener(\"resize\", () => {\n this.scrollMap = null;\n });\n window.addEventListener(\"message\", (event) => {\n const data = event.data;\n if (!data) {\n return;\n }\n // console.log('receive message: ' + data.command)\n if (data.command === \"updateHTML\") {\n this.totalLineCount = data.totalLineCount;\n this.sidebarTOCHTML = data.tocHTML;\n this.sourceUri = data.sourceUri;\n this.renderSidebarTOC();\n this.updateHTML(data.html, data.id, data.class);\n }\n else if (data.command === \"changeTextEditorSelection\" &&\n (this.config.scrollSync || data.forced)) {\n const line = parseInt(data.line, 10);\n let topRatio = parseFloat(data.topRatio);\n if (isNaN(topRatio)) {\n topRatio = 0.372;\n }\n this.scrollToRevealSourceLine(line, topRatio);\n }\n else if (data.command === \"startParsingMarkdown\") {\n /**\n * show refreshingIcon after 1 second\n * if preview hasn't finished rendering.\n */\n if (this.refreshingIconTimeout) {\n clearTimeout(this.refreshingIconTimeout);\n }\n this.refreshingIconTimeout = setTimeout(() => {\n if (!this.presentationMode) {\n this.refreshingIcon.style.display = \"block\";\n }\n }, 1000);\n }\n else if (data.command === \"openImageHelper\") {\n window[\"$\"](\"#image-helper-view\").modal();\n }\n else if (data.command === \"runAllCodeChunks\") {\n this.runAllCodeChunks();\n }\n else if (data.command === \"runCodeChunk\") {\n this.runNearestCodeChunk();\n }\n else if (data.command === \"escPressed\") {\n this.escPressed();\n }\n else if (data.command === \"previewSyncSource\") {\n this.previewSyncSource();\n }\n else if (data.command === \"copy\") {\n document.execCommand(\"copy\");\n }\n else if (data.command === \"zommIn\") {\n this.zoomIn();\n }\n else if (data.command === \"zoomOut\") {\n this.zoomOut();\n }\n else if (data.command === \"resetZoom\") {\n this.resetZoom();\n }\n else if (data.command === \"scrollPreviewToTop\") {\n if (this.presentationMode) {\n window[\"Reveal\"].slide(0);\n }\n else {\n this.previewElement.scrollTop = 0;\n }\n }\n }, false);\n }", "_scrollTop(){\n let self = this;\n \n if(this.props.speed == 'fast') {\n let hasScrollTop = 'scrollTop' in window;\n //if (value === undefined) return hasScrollTop ? node.scrollTop : node.pageYOffset\n hasScrollTop ? (() => {window.scrollTop = 0})() : (() => { window.scrollTo(window.scrollX, 0) })();\n }else{\n function moveScroll(){ \n self.scrollTop = self.scrollTop / 1.2; \n if(self.scrollTop === 0){ \n clearInterval(moveInterval); \n moveInterval = null;\n } \n } \n let moveInterval = setInterval(moveScroll, 10); \n } \n }", "scrollToPos(scrollTop) {\n if (this.scrollTimeout) {\n clearTimeout(this.scrollTimeout);\n this.scrollTimeout = null;\n }\n if (scrollTop < 0) {\n return;\n }\n const delay = 10;\n const helper = (duration = 0) => {\n this.scrollTimeout = setTimeout(() => {\n if (duration <= 0) {\n this.previewScrollDelay = Date.now() + 500;\n this.previewElement.scrollTop = scrollTop;\n return;\n }\n const difference = scrollTop - this.previewElement.scrollTop;\n const perTick = (difference / duration) * delay;\n // disable preview onscroll\n this.previewScrollDelay = Date.now() + 500;\n this.previewElement.scrollTop += perTick;\n if (this.previewElement.scrollTop === scrollTop) {\n return;\n }\n helper(duration - delay);\n }, delay);\n };\n const scrollDuration = 120;\n helper(scrollDuration);\n }", "update() {\n\t\tthis.scroll.update();\n\t}", "_handleScrolledClassOnEditor() {\n __querySelectorLive(`.${this.utils.cls('_editor-wrapper')}`, ($wrapper) => {\n $wrapper.addEventListener('scroll', (e) => {\n if (Math.abs($wrapper.scrollTop) >= 100) {\n this._$editor.classList.add('scrolled');\n }\n else {\n this._$editor.classList.remove('scrolled');\n }\n });\n });\n }", "function OCM_scrolling() {\r\n\t\t\t\t\t\r\n\t\t\t\t\t$offCanvasEl.mousewheel(function (event, delta) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.scrollTop -= (delta * 30);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function runOnce() {\r\n let loadScroll = Number(localStorage.getItem(\"loadScroll\"));\r\n let lock = false;\r\n\r\n if (loadScroll) {\r\n if (lock === false) {\r\n document.getElementById('playlists').scrollTop = loadScroll;\r\n }\r\n lock = true;\r\n }\r\n}", "function manageScroll () {\n\t\tvar scroller = $('#scroller'),\n\t\t\telementScrolled,\n\t\t\tcurrentScrollTop;\n\n\t\tscroller.scroll(function () {\n\t\t\tcurrentScrollTop = $(this).scrollTop();\n\t\t\tif (currentScrollTop > prevScrollTop) {\n\t\t\t\telementScrolled = Math.floor((currentScrollTop - prevScrollTop) / minContentHeight);\n\t\t\t\t// If a complete block is scrolled up only then call the updateGrid function\n\t\t\t\tif (elementScrolled) {\n\t\t\t\t\tupdateGrid(lastDrawIndex, lastDrawIndex + 3);\n\t\t\t\t\tprevScrollTop = currentScrollTop;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "function scrollPos(){\n\t\tvar div = document.getElementById(\"secLayerDiv\").scrollTop;\n\t\tvar startPos = windowStart1(div);\n\n\t\tchangeFirstLayerWindow(startPos);\n\t\t\n\t\tthirdLayerPointer(div);\n\t}", "function update(){var pos=jQuerywindow.scrollTop();jQuerythis.each(function(){var jQueryelement=jQuery(this);var top=jQueryelement.offset().top;var height=getHeight(jQueryelement);// Check if totally above or totally below viewport\nif(top+height<pos||top>pos+windowHeight){return;}jQuerythis.css('backgroundPosition',xpos+\" \"+Math.round((firstTop-pos)*speedFactor)+\"px\");});}", "updateScroll() {\n\t\t\tthis.scrollPosition = window.scrollY;\n\t\t}", "function onscrolling(){if($(document).scrollTop()+$(window).height() + 10/*some px before touch bottom*/ >= $(document).height()){console.log('loading...');loadquery();/*$(\"#container\").BlocksIt('reload');*/}}", "updateScrollPosition(prevProps, prevState) {\r\n const messageContainer = ReactDOM.findDOMNode(this.refs.messageList);\r\n const currentMessages = _.filter(this.threadMessages, (message) => !!message);\r\n if (currentMessages.length <= 1 || !messageContainer) {\r\n return;\r\n }\r\n const newestMessage = currentMessages[currentMessages.length - 1];\r\n const secondNewestMessage = currentMessages[currentMessages.length - 2];\r\n const oldHeight = messageContainer.scrollHeight - newestMessage.clientHeight;\r\n const currentPosition = messageContainer.scrollTop + messageContainer.clientHeight;\r\n const startOfSecondNewest = oldHeight - secondNewestMessage.clientHeight;\r\n if (this.isLastMessageMine() || (startOfSecondNewest <= currentPosition && currentPosition <= oldHeight)) {\r\n messageContainer.scrollTop = messageContainer.scrollHeight;\r\n }\r\n }", "onInputEffect() {\n const { inputEditor, file } = store\n const { path, initialSelection, isLoaded } = file || {}\n if (!inputEditor || !isLoaded || !initialSelection) return\n\n console.info(\"TODO: DEFERRING onInputEffect(): see store.onInputEffect\")\n // console.info(\"initializing input\", { path, initialSelection, inputEditor })\n // try {\n // // HACK: manually set the height of the codeMirror instance\n // // so that the bottom scrollbar shows up in the right place.\n // // ????\n // // const { clientWidth, clientHeight } = document.querySelector(\"#InputEditor\")\n // // inputEditor.setSize(clientWidth, clientHeight - 1)\n // // inputEditor.resize()\n // // console.info(inputEditor)\n\n // // clear the `initialSelection` flag so we don't try to scroll again\n // delete file.initialSelection\n\n // // turn into a `cursor` event so we'll scroll the views\n // if (initialSelection.scroll) initialSelection.scroll.event = \"cursor\"\n // store.lastSelectionForFile(file.path, initialSelection)\n // // Set `store.selection` after a delay so rendering works better\n // setTimeout(() => {\n // console.info(\"onInputEffect setting selection to \", initialSelection)\n // store.selection = initialSelection\n // }, 10)\n\n // // scroll the inputEditor itself to match\n // const { scroll, anchor, head } = initialSelection\n // inputEditor.scrollTo(0, scroll?.scroll || 0)\n // if (anchor && head) inputEditor.doc.setSelection(anchor, head)\n // inputEditor.focus()\n // } catch (e) {\n // console.warn(\"CM scroll error:\", e)\n // }\n }", "_adjustScrollingTop() {\n return this.el.scrollTop = this.g.zoomer.get(\"_alignmentScrollTop\");\n }", "function instrScrollTop() {\n InstrBody.animate({ scrollTop: 0 });\n }", "function updateScroll(){\n var treshold = 5;\n ux.scroll.offsetPrevious = ux.scroll.offset;\n ux.scroll.offset = $(window).scrollTop();\n \n // We compare distance traveled with a defined treshold and report scroll direction\n if( ux.scroll.offset - ux.scroll.offsetPrevious > treshold ){\n ux.scroll.direction = 'down';\n } else if( ux.scroll.offsetPrevious - ux.scroll.offset > treshold ){\n ux.scroll.direction = 'up';\n }\n \n ux.viewport.visibleTop = ux.scroll.offset\n ux.viewport.visibleBottom = ux.viewport.height + ux.scroll.offset;\n}", "pollScroll () {\n const domNode = ReactDOM.findDOMNode(this);\n\n // let's update the scroll now, in a raf.\n if (this.scrollDelta > 0) {\n domNode.scrollTop += this.scrollDelta;\n this.scrollDelta = 0;\n } else if (this.scrollDelta === -1) {\n domNode.scrollTop = domNode.scrollHeight;\n this.scrollDelta = 0;\n }\n\n const { scrollTop, scrollHeight, clientHeight } = domNode;\n if (scrollTop !== this.scrollTop || this.invalidate) {\n this.invalidate = false;\n const scrollLoadThreshold = LOG_LINE_HEIGHT * SCROLL_LOAD_THRESHOLD;\n const nearTop = (scrollTop - this.fakeLineCount * LOG_LINE_HEIGHT) <= scrollLoadThreshold;\n const nearBottom = scrollTop >= (scrollHeight - clientHeight - scrollLoadThreshold);\n const atBottom = scrollTop >= (scrollHeight - clientHeight - 1);\n\n const { lines } = this.props;\n if (nearTop && nearBottom && lines.size === 1) {\n // wait until the first chunk is loaded.\n } else {\n // we are at the top/bottom, load some stuff.\n if (nearTop && !this.isLineLoaded(0)) {\n // don't dispatch in the raf, do it later\n setTimeout(() => this.loadLine(0, true), 0);\n }\n\n if (nearBottom && lines.size) {\n // if we haven't reached the end of the file yet\n if (lines.last().isMissingMarker) {\n // don't dispatch in the raf, do it later\n setTimeout(() => this.loadLine(lines.size - 1, false), 0);\n } else if (atBottom) {\n // we're tailing here.\n if (!this.props.tailing) {\n this.props.startTailing();\n }\n }\n }\n }\n\n if (!atBottom && this.props.tailing) {\n this.props.stopTailing();\n }\n // update the scroll position.\n this.scrollTop = domNode.scrollTop;\n this.scrollHeight = domNode.scrollHeight;\n }\n // do another raf.\n this.rafRequestId = window.requestAnimationFrame(this.pollScroll);\n }", "initScroll() {\n this.libraryView.effetLibrarySelect.scrollTop += 1;\n this.libraryView.exempleLibrarySelect.scrollTop += 1;\n this.libraryView.intrumentLibrarySelect.scrollTop += 1;\n }", "scrollToPosition(startPosition, endPosition, skipCursorUpdate) {\n if (this.skipScrollToPosition) {\n this.skipScrollToPosition = false;\n return;\n }\n if (this.owner.enableImageResizerMode && this.owner.imageResizerModule.isImageResizing\n || this.isMouseDownInFooterRegion || this.isRowOrCellResizing) {\n return;\n }\n let lineWidget = this.selection.getLineWidgetInternal(endPosition.currentWidget, endPosition.offset, true);\n if (isNullOrUndefined(lineWidget)) {\n return;\n }\n let top = this.selection.getTop(lineWidget);\n if (this.isMouseDown) {\n let prevLineWidget = this.selection.getLineWidgetInternal(endPosition.currentWidget, endPosition.offset, false);\n let prevTop = this.selection.getTop(prevLineWidget);\n if (prevLineWidget !== lineWidget && endPosition.location.y >= prevTop) {\n lineWidget = prevLineWidget;\n }\n }\n let height = lineWidget.height;\n //Gets current page.\n let endPage = this.selection.getPage(lineWidget.paragraph);\n this.currentPage = endPage;\n let x = 0;\n let y = 0;\n let viewer = this;\n let isPageLayout = viewer instanceof PageLayoutViewer;\n if (isPageLayout) {\n if (isNullOrUndefined(endPage)) {\n return;\n }\n let pageWidth = endPage.boundingRectangle.width;\n x = (this.visibleBounds.width - pageWidth * this.zoomFactor) / 2;\n if (x < 30) {\n x = 30;\n }\n // tslint:disable-next-line:max-line-length\n y = endPage.boundingRectangle.y * this.zoomFactor + (this.pages.indexOf(endPage) + 1) * viewer.pageGap * (1 - this.zoomFactor);\n }\n let scrollTop = this.containerTop;\n let scrollLeft = this.containerLeft;\n let pageHeight = this.visibleBounds.height;\n let caretInfo = this.selection.updateCaretSize(this.owner.selection.end, true);\n let topMargin = caretInfo.topMargin;\n let caretHeight = caretInfo.height;\n x += (endPosition.location.x) * this.zoomFactor;\n y += (endPosition.location.y + topMargin) * this.zoomFactor;\n //vertical scroll bar update\n if ((scrollTop + 20) > y) {\n this.viewerContainer.scrollTop = (y - 10);\n }\n else if (scrollTop + pageHeight < y + caretHeight) {\n this.viewerContainer.scrollTop = y + caretHeight - pageHeight + 10;\n }\n if (!skipCursorUpdate) {\n this.selection.updateCaretToPage(startPosition, endPage);\n }\n let scrollBarWidth = this.viewerContainer.offsetWidth - this.viewerContainer.clientWidth;\n if (scrollLeft > x) {\n this.viewerContainer.scrollLeft = x - (viewer.pageContainer.offsetWidth / 100) * 20;\n }\n else if (scrollLeft + this.visibleBounds.width < x + scrollBarWidth) {\n this.viewerContainer.scrollLeft = scrollLeft + (viewer.pageContainer.offsetWidth / 100) * 15 + scrollBarWidth;\n }\n }", "function updateScroll () {\n if (!elements.li[0]) return;\n if (mode === MODE_STANDARD) {\n updateStandardScroll();\n } else {\n updateVirtualScroll();\n }\n }", "function updateMaxScrolls()\n {\n var offsets = getPageOffsets();\n\n var x = offsets[0];\n if (x < minXOffset)\n {\n minXOffset = x;\n } else if (x > maxXOffset)\n {\n maxXOffset = x;\n }\n\n var y = offsets[1];\n if (y < minYOffset)\n {\n minYOffset = y;\n } else if (y > maxYOffset)\n {\n maxYOffset = y;\n }\n }", "function scrollNum() {\n let z = fixWindow();\n let menu = document\n .getElementById(\"menuBar\")\n .getAttribute(\"style\", \"height\");\n let reg = /[0-9]/g;\n //menu shrink\n if (z.y > 200) {\n if (menu) {\n let height = parseInt(menu.match(reg).join(\"\"));\n if (height >= 175) {\n document\n .getElementById(\"sign\")\n .setAttribute(\"style\", \"display:none\");\n document\n .getElementById(\"map\")\n .setAttribute(\"style\", \"display:none\");\n myMove(height);\n }\n }\n } else { //window grow\n myGrow(75);\n\n }\n}", "function updateScrollTop(cm, val) {\n\t\t if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n\t\t if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n\t\t setScrollTop(cm, val, true);\n\t\t if (gecko) { updateDisplaySimple(cm); }\n\t\t startWorker(cm, 100);\n\t\t }", "function edgtfOnWindowScroll() {\n \n }", "function updateScroll() {\n const element = document.getElementsByClassName('messages');\n element[0].scrollTop = element[0].scrollHeight + 100;\n\n if (!CURRENT_CASENAME) CURRENT_CASENAME = $('#currentCaseDisplayName #name').text();\n}", "function updateScroll(){\n historique.scrollTop = historique.scrollHeight;\n}", "function updateScroll(){\n var element = instance.$(\"#commentinput\");\n element.scrollTop = element.scrollHeight;\n }", "function body_scroll(){\n\n\tdrag_manager.body_scroll = document.documentElement.scrollTop;\n\n}", "function $a(e,t){var a=e.display,n=ya(e.display);t.top<0&&(t.top=0);var r=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:a.scroller.scrollTop,f=qt(e),o={};t.bottom-t.top>f&&(t.bottom=t.top+f);var i=e.doc.height+Bt(a),s=t.top<n,c=t.bottom>i-n;if(t.top<r)o.scrollTop=s?0:t.top;else if(t.bottom>r+f){var u=Math.min(t.top,(c?i:t.bottom)-f);u!=r&&(o.scrollTop=u)}var l=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:a.scroller.scrollLeft,d=zt(e)-(e.options.fixedGutter?a.gutters.offsetWidth:0),_=t.right-t.left>d;return _&&(t.right=t.left+d),t.left<10?o.scrollLeft=0:t.left<l?o.scrollLeft=Math.max(0,t.left-(_?0:10)):t.right>d+l-3&&(o.scrollLeft=t.right+(_?0:10)-d),o}", "function updateScroll() {\n\t//gets the div class element that holds the list and the scroll.\n let element = document.getElementsByClassName(\"isgrP\")[0];\n element.scrollTop = element.scrollHeight;\n}", "updatePosition() {\n\t\tlet autoHeight = false;\n\t\tlet content = this.ReactDOM.findDOMNode(this.refs.content);\n\t\tthis.contentHeight = content.getBoundingClientRect().height;\n\t\tthis.contentWidth = this.node.getBoundingClientRect().width;\n\n\t\t// set autoHeight or autoWidth\n\t\tif (this.img && (this.img.naturalWidth / (this.img.naturalHeight - this.props.strength) * this.contentHeight < this.contentWidth)) {\n\t\t\tautoHeight = true;\n\t\t}\n\n\t\t// update scroll position\n\t\tlet rect = this.node.getBoundingClientRect();\n\t\tif (rect) {\n\t\t\tthis.setImagePosition(rect.top, autoHeight);\n\t\t}\n\n\t}", "function mkdOnWindowScroll() {\n \n }", "get _maxScrollTop(){return this._estScrollHeight-this._viewportHeight+this._scrollOffset;}", "function scroller() {\n chat[0].scrollTop = chat[0].scrollHeight;\n }", "function updateScroll(){\r\n chat.scrollTop = chat.scrollHeight;\r\n}", "function updateScroll() {\n chatDisplay.scrollTop = chatDisplay.scrollHeight;\n}", "function topFunction3() {\r\n var pos = 0;\r\n var id = setInterval(frame, 5);\r\n function frame(){\r\n if(pos>=1700){\r\n element.scrollIntoView(true);\r\n clearInterval(id);\r\n }else{\r\n pos+=5;\r\n document.body.scrollTop=pos; // For Safari\r\n document.documentElement.scrollTop=pos; // For Chrome, Firefox, IE and Opera\r\n }\r\n }\r\n \r\n}", "function _calcCurrentPos() {\n\t\t\treturn _settings.wrapper ? Math.ceil( _settings.wrapper.scrollTop() ) : Math.ceil( $( window ).scrollTop() );\n\t\t}", "function scroll_reInit(){\n if ($allInner.find('.scroll-pane').length>0) {\n /*if ($mobile) {\n $('.scroll-pane').jScrollPane({\n showArrows: false,\n maintainPosition: true,\n showArrows: false,\n animateScroll: false,\n hijackInternalLinks: true\t\t\t\t\t\t\n });\t\n }else{\t*/\n $('.scroll-pane').jScrollPane({\n showArrows: false,\n autoReinitialise: false,\n maintainPosition: true,\n showArrows: false,\n verticalDragMaxHeight: 37,\n verticalDragMinHeight: 37,\n verticalGutter : 10,\n //mouseWheelSpeed: 20,\n //animateScroll: true,\n // animateDuration: 500,\n // hijackInternalLinks: true,\n verticalDragMinHeight: 40, //forcing dragger to keep dimension and not grow/shrink with content\n verticalDragMaxHeight: 40\n });\n //}\n };\n //\n $('.drop-pane').jScrollPane({\n showArrows: false,\n autoReinitialise: false,\n maintainPosition: true,\n showArrows: false,\n verticalDragMaxHeight: 37,\n verticalDragMinHeight: 37,\n verticalGutter : 10\n });\n}", "updateScroll() {\n var element = document.getElementById(\"text-log\");\n element.scrollTop = element.scrollHeight;\n }", "function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }", "function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }", "function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }", "function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }", "function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }", "function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }", "function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }", "function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }", "function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }", "function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }", "function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }", "function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }", "function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }", "function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }", "function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }", "function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }", "function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }", "constructor() {\n /**\n * VSCode API object got from acquireVsCodeApi\n */\n this.vscodeAPI = null;\n /**\n * Whether finished loading preview\n */\n this.doneLoadingPreview = false;\n /**\n * Whether to enable sidebar toc\n */\n this.enableSidebarTOC = false;\n /**\n * .sidebar-toc element\n */\n this.sidebarTOC = null;\n /**\n * .sidebar-toc element innerHTML generated by markdown-engine.ts\n */\n this.sidebarTOCHTML = \"\";\n this.refreshingIconTimeout = null;\n /**\n * Scroll map that maps buffer line to scrollTops of html elements\n */\n this.scrollMap = null;\n /**\n * TextEditor total buffer line count\n */\n this.totalLineCount = 0;\n /**\n * TextEditor cursor current line position\n */\n this.currentLine = -1;\n /**\n * TextEditor inital line position\n */\n this.initialLine = 0;\n /**\n * Used to delay preview scroll\n */\n this.previewScrollDelay = 0;\n /**\n * Track the slide line number, and (h, v) indices\n */\n this.slidesData = [];\n /**\n * Current slide offset\n */\n this.currentSlideOffset = -1;\n /**\n * SetTimeout value\n */\n this.scrollTimeout = null;\n /**\n * Configs\n */\n this.config = {};\n /**\n * Markdown file URI\n */\n this.sourceUri = null;\n /**\n * Caches\n */\n this.zenumlCache = {};\n this.wavedromCache = {};\n this.flowchartCache = {};\n this.sequenceDiagramCache = {};\n $ = window[\"$\"];\n /** init preview elements */\n const previewElement = document.getElementsByClassName(\"mume\")[0];\n const hiddenPreviewElement = document.createElement(\"div\");\n hiddenPreviewElement.classList.add(\"mume\");\n hiddenPreviewElement.classList.add(\"markdown-preview\");\n hiddenPreviewElement.classList.add(\"hidden-preview\");\n hiddenPreviewElement.setAttribute(\"for\", \"preview\");\n hiddenPreviewElement.style.zIndex = \"0\";\n previewElement.insertAdjacentElement(\"beforebegin\", hiddenPreviewElement);\n /** init `window` events */\n this.initWindowEvents();\n /** init contextmenu */\n this.initContextMenu();\n /** load config */\n this.config = JSON.parse(document.getElementById(\"mume-data\").getAttribute(\"data-config\"));\n this.sourceUri = this.config[\"sourceUri\"];\n /*\n if (this.config.vscode) { // remove vscode default styles\n const defaultStyles = document.getElementById('_defaultStyles')\n if (defaultStyles) defaultStyles.remove()\n }\n */\n // console.log(\"init webview: \" + this.sourceUri);\n // console.log(document.getElementsByTagName('html')[0].innerHTML)\n // console.log(JSON.stringify(config))\n /** init preview properties */\n (this.previewElement = previewElement),\n (this.hiddenPreviewElement = hiddenPreviewElement),\n (this.currentLine = this.config[\"line\"] || -1);\n this.initialLine = this.config[\"initialLine\"] || 0;\n this.presentationMode = previewElement.hasAttribute(\"data-presentation-mode\");\n (this.toolbar = {\n toolbar: document.getElementById(\"md-toolbar\"),\n backToTopBtn: document.getElementsByClassName(\"back-to-top-btn\")[0],\n refreshBtn: document.getElementsByClassName(\"refresh-btn\")[0],\n sidebarTOCBtn: document.getElementsByClassName(\"sidebar-toc-btn\")[0],\n }),\n (this.refreshingIcon = document.getElementsByClassName(\"refreshing-icon\")[0]),\n /** init toolbar event */\n this.initToolbarEvent();\n /** init image helper */\n this.initImageHelper();\n /** set zoom */\n this.setZoomLevel();\n /**\n * If it's not presentation mode, then we need to tell the parent window\n * that the preview is loaded, and the markdown needs to be updated so that\n * we can update properties like `sidebarTOCHTML`, etc...\n */\n if (!this.presentationMode) {\n previewElement.onscroll = this.scrollEvent.bind(this);\n this.postMessage(\"webviewFinishLoading\", [this.sourceUri]);\n }\n else {\n // TODO: presentation preview to source sync\n this.config.scrollSync = true; // <= force to enable scrollSync for presentation\n this.initPresentationEvent();\n }\n // make it possible for interactive vega to load local data files\n const base = document.createElement(\"base\");\n base.href = this.sourceUri;\n document.head.appendChild(base);\n // console.log(document.getElementsByTagName('html')[0].outerHTML)\n }", "function scroll(output) {\n $(\".repl\").animate({\n scrollTop: output.height(),\n },\n 50\n );\n }", "setTimelineOffset() {\n const { playing } = this.player;\n const { container } = this.elements;\n // Values defining the speed of scrolling and at what points triggering the offset\n const { lowerSeek, upperSeek, upperPlaying, scrollSpeed } = this.timeline;\n // Retrieve the container positions for the container, timeline and seek handle\n const clientRect = container.getBoundingClientRect();\n const timelineRect = container.timeline.getBoundingClientRect();\n const seekPos = container.timeline.seekHandle.getBoundingClientRect();\n // Current position in the editor container\n const zoom = parseFloat(container.timeline.style.width);\n let offset = parseFloat(container.timeline.style.left);\n const seekHandlePos = parseFloat(container.timeline.seekHandle.style.left);\n // Retrieve the hover position in the editor container, else retrieve the seek value\n const percentage = (100 / clientRect.width) * (seekPos.left - clientRect.left);\n // If playing set lower upper bound to when we shift the timeline\n const upperBound = this.seeking ? upperSeek : upperPlaying;\n\n // Calculate the timeline offset position\n if (percentage > upperBound && zoom - offset > 100) {\n // If the seek handle is visibe move by scroll percentage else move into view\n if (percentage <= 100) {\n offset = Math.max(offset - (percentage - upperBound) / scrollSpeed, (zoom - 100) * -1);\n } else {\n offset = Math.max(offset - (percentage - upperBound), (zoom - 100) * -1);\n }\n } else if (percentage < lowerSeek) {\n // If the seek handle is visibe move by scroll percentage else move into view\n if (percentage >= 0) {\n offset = Math.min(offset - ((lowerSeek - percentage) / scrollSpeed) * -1, 0);\n } else {\n offset = Math.min(offset - (lowerSeek - percentage) * -1, 0);\n }\n }\n\n if (offset === parseFloat(container.timeline.style.left)) {\n return;\n }\n\n // Update the preview thumbnails\n this.setVideoTimelimeContent();\n\n // Apply the timeline seek offset\n container.timeline.style.left = `${offset}%`;\n\n // Only adjust the seek position when playing or seeking as we don't want to adjust if the current time is updated\n if (!(playing || this.seeking)) {\n return;\n }\n\n // Retrieve the position of the seek handle after the timeline shift\n const seekPosUpdated = container.timeline.seekHandle.getBoundingClientRect().left;\n const seekPercentage = clamp(seekHandlePos + (100 / timelineRect.width) * (seekPos.left - seekPosUpdated), 0, 100);\n\n container.timeline.seekHandle.style.left = `${seekPercentage}%`;\n\n // Show the corresponding preview thumbnail for the updated seek position\n if (this.seeking && this.previewThumbnailsReady) {\n const seekTime = this.player.duration * (seekPercentage / 100);\n this.player.previewThumbnails.showImageAtCurrentTime(seekTime);\n }\n }", "function updateHeightsInViewport(cm) {\n\t\t var display = cm.display;\n\t\t var prevBottom = display.lineDiv.offsetTop;\n\t\t var viewTop = Math.max(0, display.scroller.getBoundingClientRect().top);\n\t\t var oldHeight = display.lineDiv.getBoundingClientRect().top;\n\t\t var mustScroll = 0;\n\t\t for (var i = 0; i < display.view.length; i++) {\n\t\t var cur = display.view[i], wrapping = cm.options.lineWrapping;\n\t\t var height = (void 0), width = 0;\n\t\t if (cur.hidden) { continue }\n\t\t oldHeight += cur.line.height;\n\t\t if (ie && ie_version < 8) {\n\t\t var bot = cur.node.offsetTop + cur.node.offsetHeight;\n\t\t height = bot - prevBottom;\n\t\t prevBottom = bot;\n\t\t } else {\n\t\t var box = cur.node.getBoundingClientRect();\n\t\t height = box.bottom - box.top;\n\t\t // Check that lines don't extend past the right of the current\n\t\t // editor width\n\t\t if (!wrapping && cur.text.firstChild)\n\t\t { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n\t\t }\n\t\t var diff = cur.line.height - height;\n\t\t if (diff > .005 || diff < -.005) {\n\t\t if (oldHeight < viewTop) { mustScroll -= diff; }\n\t\t updateLineHeight(cur.line, height);\n\t\t updateWidgetHeight(cur.line);\n\t\t if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n\t\t { updateWidgetHeight(cur.rest[j]); } }\n\t\t }\n\t\t if (width > cm.display.sizerWidth) {\n\t\t var chWidth = Math.ceil(width / charWidth(cm.display));\n\t\t if (chWidth > cm.display.maxLineLength) {\n\t\t cm.display.maxLineLength = chWidth;\n\t\t cm.display.maxLine = cur.line;\n\t\t cm.display.maxLineChanged = true;\n\t\t }\n\t\t }\n\t\t }\n\t\t if (Math.abs(mustScroll) > 2) { display.scroller.scrollTop += mustScroll; }\n\t\t }", "function addToScrollPos(cm, left, top) {\n\t\t if (left != null || top != null) resolveScrollToPos(cm);\n\t\t if (left != null)\n\t\t cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left;\n\t\t if (top != null)\n\t\t cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n\t\t }", "scroller(scrollWindow) {\n this.state.runposition = false\n var container = d3.select('body');\n // event dispatcher\n var dispatch = d3.dispatch('active', 'progress');\n\n // d3 selection of all the\n // text sections that will\n // be scrolled through\n var sections = null;\n\n // array that will hold the\n // y coordinate of each section\n // that is scrolled through\n var sectionPositions = [];\n \n var currentIndex = -1;\n // y coordinate of\n var containerStart = 0;\n\n\n\n\n\n /**\n * scroll - constructor function.\n * Sets up scroller to monitor\n * scrolling of els selection.\n *\n * @param els - d3 selection of\n * elements that will be scrolled\n * through by user.\n */\n \n function scroll(els) {\n sections = els;\n\n // when window is scrolled call\n // position. When it is resized\n // call resize.\n\n d3.select(ReactDOM.findDOMNode(this))\n .on('scroll.scroller', position)\n .on('resize.scroller', resize);\n\n // manually call resize\n // initially to setup\n // scroller.\n resize();\n\n // hack to get position\n // to be called once for\n // the scroll position on\n // load.\n // @v4 timer no longer stops if you\n // return true at the end of the callback\n // function - so here we stop it explicitly.\n var timer = d3.timer(function () {\n position();\n timer.stop();\n });\n };\n\n /**\n * resize - called initially and\n * also when page is resized.\n * Resets the sectionPositions\n *\n */\n function resize() {\n // sectionPositions will be each sections\n // starting position relative to the top\n // of the first section.\n sectionPositions = [];\n var startPos;\n sections.each(function (d, i) {\n var top = this.getBoundingClientRect().top;\n if (i === 0) {\n startPos = top;\n }\n sectionPositions.push(top - startPos);\n });\n\n containerStart = container.node().getBoundingClientRect().top + window.pageYOffset;\n }\n\n /**\n * position - get current users position.\n * if user has scrolled to new section,\n * dispatch active event with new section\n * index.\n *\n */\n function position() {\n var pos = window.pageYOffset - 10 - containerStart;\n var sectionIndex = d3.bisect(sectionPositions, pos);\n sectionIndex = Math.min(sections.size() - 1, sectionIndex);\n\n if (currentIndex !== sectionIndex) {\n // @v4 you now `.call` the dispatch callback\n dispatch.call('active', this, sectionIndex);\n currentIndex = sectionIndex;\n }\n\n var prevIndex = Math.max(sectionIndex - 1, 0);\n var prevTop = sectionPositions[prevIndex];\n var progress = (pos - prevTop) / (sectionPositions[sectionIndex] - prevTop);\n // @v4 you now `.call` the dispatch callback\n dispatch.call('progress', this, currentIndex, progress);\n }\n\n /**\n * container - get/set the parent element\n * of the sections. Useful for if the\n * scrolling doesn't start at the very top\n * of the page.\n *\n * @param value - the new container value\n */\n scroll.container = function (value) {\n if (arguments.length === 0) {\n return container;\n }\n container = value;\n return scroll;\n };\n\n // @v4 There is now no d3.rebind, so this implements\n // a .on method to pass in a callback to the dispatcher.\n scroll.on = function (action, callback) {\n dispatch.on(action, callback);\n };\n\n return scroll;\n }", "function recarga2() {\n window.name = self.pageYOffset || (document.documentElement.scrollTop + document.body.scrollTop);\n}", "[scroll]() {\n if (!this.scrollableElement || !this.currentMousePosition) {\n return;\n }\n\n cancelAnimationFrame(this.scrollAnimationFrame);\n\n const { speed, sensitivity } = this.options;\n\n const rect = this.scrollableElement.getBoundingClientRect();\n const bottomCutOff = rect.bottom > window.innerHeight;\n const topCutOff = rect.top < 0;\n const cutOff = topCutOff || bottomCutOff;\n\n const documentScrollingElement = getDocumentScrollingElement();\n const scrollableElement = this.scrollableElement;\n const clientX = this.currentMousePosition.clientX;\n const clientY = this.currentMousePosition.clientY;\n\n if (scrollableElement !== document.body && scrollableElement !== document.documentElement && !cutOff) {\n const { offsetHeight, offsetWidth } = scrollableElement;\n\n if (rect.top + offsetHeight - clientY < sensitivity) {\n scrollableElement.scrollTop += speed;\n } else if (clientY - rect.top < sensitivity) {\n scrollableElement.scrollTop -= speed;\n }\n\n if (rect.left + offsetWidth - clientX < sensitivity) {\n scrollableElement.scrollLeft += speed;\n } else if (clientX - rect.left < sensitivity) {\n scrollableElement.scrollLeft -= speed;\n }\n } else {\n const { innerHeight, innerWidth } = window;\n\n if (clientY < sensitivity) {\n documentScrollingElement.scrollTop -= speed;\n } else if (innerHeight - clientY < sensitivity) {\n documentScrollingElement.scrollTop += speed;\n }\n\n if (clientX < sensitivity) {\n documentScrollingElement.scrollLeft -= speed;\n } else if (innerWidth - clientX < sensitivity) {\n documentScrollingElement.scrollLeft += speed;\n }\n }\n\n this.scrollAnimationFrame = requestAnimationFrame(this[scroll]);\n }", "function updateScroll () {\n if (!elements.li[0]) return;\n var height = elements.li[0].offsetHeight,\n top = height * ctrl.index,\n bot = top + height,\n hgt = elements.scroller.clientHeight,\n scrollTop = elements.scroller.scrollTop;\n if (top < scrollTop) {\n scrollTo(top);\n } else if (bot > scrollTop + hgt) {\n scrollTo(bot - hgt);\n }\n }", "function updateScroll () {\n if (!elements.li[0]) return;\n var height = elements.li[0].offsetHeight,\n top = height * ctrl.index,\n bot = top + height,\n hgt = elements.scroller.clientHeight,\n scrollTop = elements.scroller.scrollTop;\n if (top < scrollTop) {\n scrollTo(top);\n } else if (bot > scrollTop + hgt) {\n scrollTo(bot - hgt);\n }\n }", "function updateScroll () {\n if (!elements.li[0]) return;\n var height = elements.li[0].offsetHeight,\n top = height * ctrl.index,\n bot = top + height,\n hgt = elements.scroller.clientHeight,\n scrollTop = elements.scroller.scrollTop;\n if (top < scrollTop) {\n scrollTo(top);\n } else if (bot > scrollTop + hgt) {\n scrollTo(bot - hgt);\n }\n }", "function update(){\n var pos = $window.scrollTop(); \n\n $this.each(function(){\n var $element = $(this);\n var top = $element.offset().top;\n var height = getHeight($element);\n\n // Check if totally above or totally below viewport\n if (top + height < pos || top > pos + windowHeight) {\n return;\n }\n\n $this.css('backgroundPosition', xpos + \" \" + Math.round((firstTop - pos) * speedFactor) + \"px\");\n });\n }", "function updateScrollTop(cm, val) {\r\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\r\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\r\n setScrollTop(cm, val, true);\r\n if (gecko) { updateDisplaySimple(cm); }\r\n startWorker(cm, 100);\r\n}", "function loadScroll() {\n\n\t\tvar hasErrors = false;\n\t\tif ($('.global_errors').size() > 0) {\n\t\t\thasErrors = true;\n\t\t\tvar div = $($('.global_errors')[0]);\n\t\t\tvar top = Math.max(0, div.offset().top - 100);\n\t\t\t// $(document).animate({ scrollTop: top }, { duration: 'slow',\n\t\t\t// easing: 'swing'});\n\t\t\t$(document).scrollTop(top);\n\t\t}\n\n\t\tvar cookie = $.cookie(\"scrollPosition\");\n\t\tif (cookie) {\n\t\t\tif (!hasErrors) {\n\t\t\t\tvar values = cookie.split(',');\n\t\t\t\twindow.scrollTo(values[0], values[1]);\n\t\t\t}\n\t\t\t// delete cookie\n\t\t\t$.cookie(\"scrollPosition\", null, {\n\t\t\t\tpath : '/'\n\t\t\t});\n\t\t}\n\t}", "function updateScroll() {\n var height = $('#messages').prop('scrollHeight');\n $('#messages').scrollTop(height);\n}", "function getWindowScrollPos() {\n \t_windowPos = $(window).scrollTop();\n }", "function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n}", "function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n}", "function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n}", "function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n}", "function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n}", "function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n}", "function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n}", "function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n}" ]
[ "0.6471689", "0.6057487", "0.60402244", "0.5946359", "0.5820106", "0.5816053", "0.5775414", "0.576942", "0.57249874", "0.5717371", "0.5680687", "0.566385", "0.5656268", "0.5654267", "0.5649125", "0.5647867", "0.5627636", "0.56238145", "0.55900973", "0.55503035", "0.5532952", "0.55274636", "0.5526552", "0.55230236", "0.55211747", "0.55139786", "0.5512626", "0.55018175", "0.55006933", "0.5500671", "0.54965967", "0.5484916", "0.54523283", "0.542575", "0.5416944", "0.54152834", "0.5411201", "0.5406028", "0.5403196", "0.539574", "0.53757006", "0.5375357", "0.53705204", "0.5370104", "0.5361285", "0.5360927", "0.5360382", "0.5351784", "0.53465074", "0.53320986", "0.5331957", "0.5319933", "0.53110874", "0.53094935", "0.53053504", "0.53019273", "0.52995014", "0.5297541", "0.52904576", "0.5287583", "0.5287583", "0.5287583", "0.5287583", "0.5287583", "0.5287583", "0.5287583", "0.5287583", "0.5287583", "0.5287583", "0.5287583", "0.5287583", "0.5287583", "0.5287583", "0.5287583", "0.5287583", "0.5287583", "0.5284588", "0.5283832", "0.5280471", "0.52786237", "0.52747375", "0.52710336", "0.52690625", "0.5263724", "0.52623814", "0.52623814", "0.52623814", "0.5261929", "0.52606183", "0.5257933", "0.52528775", "0.52466124", "0.5245635", "0.5245635", "0.5245635", "0.5245635", "0.5245635", "0.5245635", "0.5245635", "0.5245635" ]
0.5708626
10
Here you can put in the text you want to make it type.
function type() { document.getElementById('screen').innerHTML +=text.charAt(index); index += 1; var t = setTimeout('type()',100); // The time taken for each character here is 100ms. You can change it if you want. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function typeText(text){\n var chars = text.split('');\n chars.forEach(function(char, index){\n $(settings.el).delay(settings.speed).queue(function (next){\n var text = $(this).html() + char;\n $(this).html(text);\n next();\n\n // we are done, remove from queue\n if(index === chars.length - 1){\n settings.queue = settings.queue - 1;\n $(settings.mainel).trigger('typewriteTyped', text);\n }\n });\n }, this);\n }", "set text(value) {}", "set text(value) {}", "function newTyping() {\n output.html(type.value());\n output.parent('output');\n}", "function type(element, text) {\n [...text].forEach(x => {\n act(() => {\n userEvent.type(element, x);\n });\n });\n}", "onTextChange()\n {\n let data = this.pad.getContents()\n\n // add type\n data[\"@type\"] = \"mycelium::rich-text\"\n\n this.shroom.setData(this.key, data)\n }", "function type() {\n // Type as long as there are characters left in phrase\n if (char_index <= text[text_index].length) {\n if (!typing) set_typing(true);\n set_typed_text(text[text_index].substring(0, char_index++));\n setTimeout(type, type_delay);\n }\n // Call erase when finished\n else {\n set_typing(false);\n setTimeout(erase, new_delay);\n }\n }", "function typeIt() {\n clearCanvas();\n disableCanvas();\n $(settings.typed, context).show();\n $(settings.drawIt, context).bind('click.signaturepad', function (e) {\n e.preventDefault();\n drawIt();\n });\n $(settings.typeIt, context).unbind('click.signaturepad');\n $(settings.typeIt, context).bind('click.signaturepad', function (e) {\n e.preventDefault();\n });\n $(settings.output, context).val('');\n $(settings.drawIt, context).removeClass(settings.currentClass);\n $(settings.typeIt, context).addClass(settings.currentClass);\n $(settings.sig, context).removeClass(settings.currentClass);\n $(settings.drawItDesc, context).hide();\n $(settings.clear, context).hide();\n $(settings.typeItDesc, context).show();\n }", "function typeWriter() {\n if (i < txt.length) {\n document.getElementById(\"typing\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n}", "function setTextInput(text) {\n setText(text);\n }", "function typing() {\n let options = {\n strings: [\"Hello, Adventurer... ^1000\", \"Shall we begin?\"],\n loop: false,\n smartBackspace: true,\n backSpeed: 50,\n typeSpeed: 100,\n showCursor: false\n }\n let typed = new Typed(\".type-intro\", options);\n \n setTimeout(function(){\n $(\".formy\").fadeIn(8000);\n }, 5000)\n}", "get type () {\n return TEXT;\n }", "get type () {\n return TEXT;\n }", "function changeTyped(text1,text2) {\n\ttyped.destroy();\n\t\ttyped = new Typed(\".typed\", {\n\t\tstrings: [text1, text2],\n\t\ttypeSpeed: 70,\n\t\tloop: true,\n\t\tstartDelay: 1000,\n\t\tshowCursor: false\n\t});\n}", "textEnter() {}", "function typeWriter() {\n if (i < txt.length) {\n document.getElementById(\"heading\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n }", "function typeWriter(text, i, fnCallback) {\n // Chekc if text isn't finished yet\n if (i < (text.length)) {\n // Add next character to h1\n document.getElementById(\"typing\").innerHTML = text.substring(0, i+1) +'<span aria-hidden=\"true\"></span>';\n\n // Wait for a while and call this function again for next character\n setTimeout(function() {\n typeWriter(text, i + 1, fnCallback)\n }, 50);\n }\n // Text finished, call callback if there is a callback function\n else if (typeof fnCallback == 'function') {\n // call callback after timeout\n setTimeout(fnCallback, 2000);\n }\n }", "get isText() {\n return this.type.isText;\n }", "function copy_text(txt){\n var pasteBoard = [NSPasteboard generalPasteboard]\n [pasteBoard declareTypes:[NSArray arrayWithObject:NSPasteboardTypeString] owner:nil]\n [pasteBoard setString:txt forType:NSPasteboardTypeString]\n}", "function typeText(selector, text) {\n var $selector = (0, _jquery['default'])((0, _jquery['default'])(selector).get(0)); // Only interact with the first result\n $selector.val(text);\n var event = document.createEvent('Events');\n event.initEvent('input', true, true);\n $selector[0].dispatchEvent(event);\n }", "typeText(int) {\n const index = this.typeInt(int);\n return tileTypes[index].type;\n }", "function ontext (text) {\n return text;\n}", "addUIText(name, text) {\n this.uiTexts[name] = text;\n }", "function createTextElm(type, text) {\r\n var elm = document.createElement(type);\r\n var t = document.createTextNode(text);\r\n elm.appendChild(t);\r\n return elm;\r\n}", "function placeText() {\n const name = type.value();\n placeText.html('hello ' + name + '!');\n this.c = color(random(255), random(255), random(255));\n type.value('');\n//number of text\n for (let i = 0; i < 150; i++) {\n push();\n fill(this.c);\n translate(random(1800), random(1500));\n text(name, 0, 0);\n pop();\n }\n}", "function typeInTextarea(newText) {\n var el = document.querySelector(\"#msgEdit\");\n var start = el.selectionStart\n var end = el.selectionEnd\n var text = el.value\n var before = text.substring(0, start)\n var after = text.substring(end, text.length)\n el.value = (before + newText + after)\n el.selectionStart = el.selectionEnd = start + newText.length\n el.focus()\n }", "set richText(value) {}", "function customText() {\n let text = document.querySelector(\"textarea\").value;\n let parsedText = validateText(text);\n if (parsedText != null) {\n setInitials();\n displayText(parsedText);\n }\n}", "function editType() {\n let currentType = document.getElementById(\"typeEdit\").value\n if (currentType === \"classic\") {\n setType(\"classic\"); \n setTypeText(\"Classical Music\");\n }\n\n else if (currentType === \"popular\") {\n setType(\"popular\"); \n setTypeText(\"Popular Music\")\n }\n\n else if (currentType === \"jazzy/pop\") {\n setType(\"jazzy/pop\"); \n setTypeText(\"Jazzy-Pop music\");\n }\n\n else if (currentType === \"surprise\") {\n setType(\"suprise\"); \n setTypeText(\"A surprise\");\n }\n}", "typeAnimation(){\n\t\t//preserve a copy of all the text we're about to display incase we need to save\n\t\tthis.saveCopy();\n\t\t\n\t\tFileManager.writing = false; \n\t\t\n\t\t//figure out how fast we want to type the screen based on how much content needs typing \n\t\tvar letters = 0;\n\t\tfor (i=0; i< this.state.toShowText.length; i++){\t\t\t \n\t\t\tletters += this.state.toShowText[i].text.length;\n\t\t}\n\t\tvar scale = Math.floor(letters/20);\n\t\tif(scale < 1){\n\t\t\tscale = 1;\n\t\t}\n\t\t\n\t\t\n\t\t//do the actual typing\n\t\tthis.typeAnimationActual(scale);\n\t\t\n\t}", "function showWhatWeTyped() {\n // fill the div with the content of the input field\n theDiv.innerHTML = field.value;\n subtitle.innerHTML = field2.value; \n}", "renderTypeText() {\n const { value } = this.state;\n\n return (\n <Input\n { ...this.props }\n type=\"text\"\n onChange={ this.onChange }\n onFocus={ this.onFocus }\n onClick={ this.onClick }\n value={ value }\n />\n );\n }", "function typistUpdateHtml(element, state) {\n var text = state.texts[state.currentTextIndex];\n var typed = text.substring(0, state.currentTypedChars);\n var untyped = text.substring(state.currentTypedChars);\n \n element.innerHTML = typed + \" <span class=\\\"typist-untyped\\\">\" + untyped + \"</span>\";\n}", "function typeWriter() {\n if (i < txt.length) {\n document.getElementById(\"no\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n }", "function typeWriter() {\n if (i < txt.length) {\n document.getElementById(\"no\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n }", "addText() {\n this.addCustom('type', {\n inputLabel: 'Property value'\n });\n const index = this.model.length - 1;\n const item = this.model[index];\n item.schema.isFile = false;\n item.schema.inputType = 'text';\n /* istanbul ignore else */\n if (hasFormDataSupport) {\n item.contentType = '';\n }\n this.requestUpdate();\n }", "function displayText(recognized) {\n document.querySelector('#mytext').setAttribute('value', recognized);\n}", "set text(text) {\n\t\tthis._text = text;\n\t}", "function typeWriter() {\n\n if (i < txt.length) {\n document.getElementById('name').innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n}", "function typeString($target, index, cursorPosition, callback) {\n // Get text\n var text = settings.text[index];\n // Get placeholder, type next character\n var placeholder = $target.attr('placeholder');\n $target.attr('placeholder', placeholder + text[cursorPosition]);\n // Type next character\n if (cursorPosition < text.length - 1) {\n setTimeout(function () {\n typeString($target, index, cursorPosition + 1, callback);\n }, settings.delay);\n return true;\n }\n // Callback if animation is finished\n callback();\n }", "function begin_typing() {\t\t\t\t\t\t/*FUNCTION CONTROLLING TYPEWRITING EFFECT ---- */\r\n\tif (i < txt[type_flag].length) {\r\n\t\tdocument.getElementById(\"my_info_p\").innerHTML += txt[type_flag].charAt(i);\r\n\t\ti++;\r\n\t\tsetTimeout(begin_typing, speed);\r\n\t}\r\n\tif (i == txt[type_flag].length) {\r\n\t\tdocument.getElementById(\"my_info_p\").innerHTML += '<br>';\r\n\t\ttype_flag++;\r\n\t\ti = 0;\r\n\t\tbegin_typing();\r\n\t}\r\n\r\n}", "function typeWriter() {\n if (i < txt.length) {\n document.getElementById(\"name\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n}", "text () {\n\n }", "function typeWriter() {\n if (i < txt.length) {\n document.getElementById(\"cmdline\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n}", "function typeText(id, text) {\n if (i < text.length) {\n document.getElementById(id).innerHTML += text.charAt(i);\n i++;\n setTimeout(typeText.bind(null, id, text), speed);\n }\n}", "function typeWriter() {\n if (i < txt.length) {\n document.getElementById(\"typewrited\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n}", "function typeWriter() {\n if (i == -1) {\n setTimeout(typeWriter, 2000);\n i = 0;\n } else {\n if (i < txt.length) {\n document.getElementById(\"name\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n }\n }", "handleText() {\n if (this.text) {\n this.addItem({ label: this.text })\n }\n }", "function typeWriter(text, i, fnCallback) {\n\t // check if text isn't finished yet\n\t if (i < (text.length)) {\n\t\t// add next character to #top\n\t document.querySelector(\"#cursor\").innerHTML = text.substring(0, i+1) +'<span aria-hidden=\"true\"></span>';\n \n\t\t// wait for a while and call this function again for next character\n\t\tsetTimeout(function() {\n\t\t typeWriter(text, i + 1, fnCallback)\n\t\t}, 250); //this controls speed of the typing and the delay in between\n\t }\n\t // text finished, call callback if there is a callback function\n\t else if (typeof fnCallback == 'function') {\n\t\t// call callback after timeout\n\t\tsetTimeout(fnCallback, 700);\n\t }\n\t}", "async function getTypeText(type) { // eslint-disable-line no-unused-vars\n\tif (type === 'proposta') {\n\t\treturn 'minha proposta';\n\t} if (type === 'histórico') {\n\t\treturn 'meu histórico';\n\t}\n\treturn 'meu posicionamento';\n}", "function typeWriter() {\n \tif (i < txt.length) {\n document.getElementById(\"intro\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n}", "function typeWriter(){\n if (i < txt.length) {\n typeBox.innerHTML += txt.charAt(i);\n console.log(txt.charAt(i));\n i++;\n setTimeout(typeWriter, speed);\n }\n}", "text (state, text) {\n state.text = text\n }", "function changeText() {\n \n }", "function doneTyping () {\n //do something\n }", "function typeWriter() {\n if (u < txt.length) {\n var x = document.getElementById(\"typed\").textContent += txt.charAt(u);\n u++;\n setTimeout(typeWriter, speed);\n console.log(x);\n }\n}", "function setUpText() {\n textImg = createGraphics(width, height);\n textImg.pixelDensity(1);\n textImg.background(255);\n textImg.textStyle(fontStyle);\n textImg.textFont('Roboto');\n textImg.textSize(fontSize);\n textImg.textAlign(CENTER, CENTER);\n textImg.text(type, width / 2, height / 4 + fontSize / 6);\n textImg.loadPixels();\n}", "text(text) {\n // console.log(`Incoming text: ${text.text}`)\n }", "function t(text) { return {'macro_name': 'plaintext', 'text': text}; }", "function typeWriter() {\n if (i < txt.length) {\n document.getElementById(\"question\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n}", "function typeset(element, text) {\n if (text !== void 0) {\n element.textContent = text;\n }\n if (window.MathJax !== void 0) {\n MathJax.Hub.Queue(['Typeset', MathJax.Hub, element]);\n }\n}", "function typeWrite (context, canvas, string, x, y, lineHeight, padding) {\n context.font = \"14px Verdana\";\n context.fillStyle = \"#FFF\";\n\n \"use strict\";\n var cursor_x = x || 0;\n var cursor_y = y || 0;\n var lineHeight = lineHeight || 14; \n var padding = padding || 10;\n var i = 0;\n\n $_inter = setInterval(function() {\n var rem = string.substr(i);\n var space = rem.indexOf(' ');\n space = (space === -1) ? string.length:space;\n var wordwidth = context.measureText(rem.substr(0, space)).width;\n var w = context.measureText(string.charAt(i)).width;\n\n if (cursor_x + wordwidth >= canvas.width - padding) {\n cursor_x = x;\n cursor_y += lineHeight;\n }\n\n context.fillText(string.charAt(i), cursor_x, cursor_y);\n\n i++;\n cursor_x += w;\n\n if (i === string.length) {\n clearInterval($_inter);\n }\n }, 80);\n}", "function typeWriter() {\n if (i < txt.length) {\n $(\"#myname\").html($(\"#myname\").html() + txt.charAt(i));\n i++;\n setTimeout(typeWriter, speed);\n }\n}", "function typeWriter() {\n if (i < txt.length) {\n document.getElementById(\"animated-text\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n}", "function kw(type){return{type:type,style:\"keyword\"}}", "function startGame(){\n runTyping(\"Immer einmal mehr wie du...\");\n inputTextElement.value ='sag was'; \n}", "function TextData(){}", "type(text = '', config = {}) {\n\n\t\t// Contextualizing the config object\n\t\tconst conf = this.contextConfig(config);\n\n\t\t// Caching the typing state\n\t\tthis.cache = {\n\t\t\t...conf,\n\t\t\ttext,\n\t\t};\n\n\t\treturn new Promise(resolve => {\n\n\t\t\t// Attaching the type resolve function\n\t\t\tthis.typeResolve = resolve;\n\n\t\t\t// Recursive typing\n\t\t\tconst recType = (text, tick, init = false) => {\n\n\t\t\t\t// Checking if the text is finished\n\t\t\t\tif (text.length > 0) {\n\t\t\t\t\tthis.typeTimer = setTimeout(() => {\n\n\t\t\t\t\t\t// Stopping typing\n\t\t\t\t\t\tif (init && this.typing) {\n\t\t\t\t\t\t\tthis.stopType();\n\n\t\t\t\t\t\t\t// Updating the index\n\t\t\t\t\t\t\tconf.cursor.index = this.config.cursor.index;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Stopping deleting\n\t\t\t\t\t\tif (this.deleting) {\n\t\t\t\t\t\t\tthis.stopDelete();\n\n\t\t\t\t\t\t\t// Updating the index\n\t\t\t\t\t\t\tconf.cursor.index = this.config.cursor.index;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Updating the typing state\n\t\t\t\t\t\tthis.typing = true;\n\n\t\t\t\t\t\t// Typing a character\n\t\t\t\t\t\tthis.config.text = this.config.text.slice(0, conf.cursor.index) + text[0] + this.config.text.slice(conf.cursor.index);\n\t\t\t\t\t\tthis.config.cursor.index = ++conf.cursor.index;\n\t\t\t\t\t\tthis.render(conf);\n\n\t\t\t\t\t\t// Playing typing sound\n\t\t\t\t\t\tthis.playSound(conf);\n\n\t\t\t\t\t\t// Caching the typing state\n\t\t\t\t\t\tthis.cache = {\n\t\t\t\t\t\t\t...conf,\n\t\t\t\t\t\t\ttick,\n\t\t\t\t\t\t\ttext: text.slice(1),\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// Invoking the recursion\n\t\t\t\t\t\trecType(text.slice(1), conf.tick || this.config.tick);\n\t\t\t\t\t}, tick);\n\t\t\t\t} else {\n\n\t\t\t\t\t// Stopping typing\n\t\t\t\t\tthis.stopType();\n\n\t\t\t\t\t// Resolving the typing\n\t\t\t\t\tresolve(this);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Starting the recursion\n\t\t\trecType(text, conf.delay || 0, true);\n\t\t});\n\t}", "function typeWriter() {\n if (i < txt.length) {\n document.getElementById(\"demo\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n}", "function typeWriter() {\n if (i < txt.length) {\n document.getElementById(\"demo\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n}", "function typeWriter(text, i, fnCallback) {\r\n // chekc if text isn't finished yet\r\n if (i < (text.length)) {\r\n // add next character to h1\r\n document.querySelector(\"h1\").innerHTML = text.substring(0, i+1) +'<span aria-hidden=\"true\"></span>';\r\n \r\n // wait for a while and call this function again for next character\r\n setTimeout(function() {\r\n typeWriter(text, i + 1, fnCallback)\r\n }, 100);\r\n }\r\n // text finished, call callback if there is a callback function\r\n else if (typeof fnCallback == 'function') {\r\n // call callback after timeout\r\n setTimeout(fnCallback, 700);\r\n }\r\n }", "function addChatTyping(data) {\n data.typing = true;\n data.message = 'is typing';\n addChatMessage(data);\n }", "function addChatTyping (data) {\n data.typing = true;\n data.message = 'is typing';\n addChatMessage(data);\n console.log(\"addChatTyping\")\n }", "setType(type) { }", "function addTextToField(elem, text) {\r\n if (elem.selectionStart || elem.selectionStart === 0) {\r\n var startPos = elem.selectionStart;\r\n var endPos = elem.selectionEnd;\r\n elem.value = elem.value.substring(0, startPos)\r\n + text\r\n + elem.value.substring(endPos, elem.value.length);\r\n } else {\r\n elem.value += text;\r\n }\r\n }", "function addChatTyping (data) {\n data.typing = true;\n data.message = 'is typing';\n addChatMessage(data);\n }", "function addChatTyping (data) {\n data.typing = true;\n data.message = 'is typing';\n addChatMessage(data);\n }", "function addChatTyping (data) {\n data.typing = true;\n data.message = 'is typing';\n addChatMessage(data);\n }", "function addChatTyping (data) {\n data.typing = true;\n data.message = 'is typing';\n addChatMessage(data);\n }", "init() {\n this.setHelpUrl(Blockly.Msg.TEXT_TEXT_HELPURL);\n this.setColour(45);\n this.appendDummyInput()\n .appendField(this.newQuote_(true))\n .appendField(new Blockly.FieldTextInput(''), 'TEXT')\n .appendField(this.newQuote_(false));\n this.setOutput(true);\n this.setTooltip('Gives the given text');\n this.setAsLiteral('Text');\n }", "function TextData() { }", "function TextData() { }", "addText(e) {\n dispatch({\n type: \"SET_TEXT\",\n payload: e.target.value\n })\n }", "function addChatTyping (data) {\n data.typing = true;\n data.message = 'is typing';\n addTypingMessage(data);\n }", "__typewriter() {\n let arr = this.options.text.split('');\n\n for (let i = 0, len = arr.length; i < len; i++) {\n let char = arr[i];\n let el = this.__createElement();\n \n char = char === ' ' ? el.innerHTML = '&nbsp;' : el.innerText = char;\n \n setTimeout(() => { \n setTimeout(() => {\n el.classList.add('active'); \n }, this.options.delay);\n \n document.querySelector(this.options.selector).insertAdjacentElement('beforeend', el);\n }, i * this.options.interval);\n }\n }", "function autoType(elementClass, typingSpeed){\n var thhis = $(elementClass);\n thhis.css({\n \"position\": \"relative\",\n \"display\": \"inline-block\"\n });\n thhis.prepend('<div class=\"cursor\" style=\"right: initial; left:0;\"></div>');\n thhis = thhis.find(\".text-js\");\n var text = thhis.text().trim().split('');\n var amntOfChars = text.length;\n var newString = \"\";\n thhis.text(\"|\");\n setTimeout(function(){\n thhis.css(\"opacity\",1);\n thhis.prev().removeAttr(\"style\");\n thhis.text(\"\");\n for(var i = 0; i < amntOfChars; i++){\n (function(i,char){\n setTimeout(function() { \n newString += char;\n thhis.text(newString);\n },i*typingSpeed);\n })(i+1,text[i]);\n }\n },1500);\n}", "function addText(text = \"Tap and Edit\", pos_top = 0, pos_left = 0) {\r\n canvas.add(new fabric.IText(text, {\r\n left: pos_left,\r\n id: canvas.getObjects().length + 1,\r\n top: pos_top,\r\n fontSize: 150,\r\n fontFamily: 'Helvetica',\r\n fontWeight: 'normal'\r\n }));\r\n}", "function addText(text = \"Tap and Edit\", pos_top = 0, pos_left = 0) {\r\n canvas.add(new fabric.IText(text, {\r\n left: pos_left,\r\n id: canvas.getObjects().length + 1,\r\n top: pos_top,\r\n fontSize: 150,\r\n fontFamily: 'Helvetica',\r\n fontWeight: 'normal'\r\n }));\r\n}", "function addChatTyping(data) {\n data.typing = true;\n data.message = 'is typing';\n target = data.sender;\n addChatMessage(data);\n }", "addText(code){\n let textBar = document.querySelector(\".text\").innerHTML;\n switch (code) {\n case \"Backspace\":\n\n textBar.innerHTML.strike();\n\n }\n if(code != \"Enter\"){\n textBar += code;\n } else {\n let command = textBar.innerHTML;\n console.log(command);\n }\n }", "function TextData() {}", "function TextData() {}", "function TextData() {}", "set text(pText) {\n\t\tthis.__Internal__Dont__Modify__.text = Validate.type(pText, \"string\", \"ERROR\", true);\n\t}", "constructor(text) {\n\t\tthis._text = text;\n\t}", "function typeWriter(text, i, fnCallback) {\n // chekc if text isn't finished yet\n if (i < (text.length)) {\n // add next character to h1\n document.getElementById(\"one\").innerHTML = text.substring(0, i+1) +'<span aria-hidden=\"true\"></span>';\n\n // wait for a while and call this function again for next character\n setTimeout(function() {\n typeWriter(text, i + 1, fnCallback)\n }, 100);\n }\n // text finished, call callback if there is a callback function\n else if (typeof fnCallback == 'function') {\n // call callback after timeout\n setTimeout(fnCallback, 700);\n }\n }", "function type(elem, txt, speed) {\n if (i < txt.length) {\n document.getElementById(elem).innerHTML += txt.charAt(i);\n i++;\n timeouts.push(setTimeout(function(){type(elem, txt, speed)}, speed));\n }\n}", "function typeWriter() {\n if (i < txt.length) {\n document.getElementById(\"nomPrenom\").innerHTML += txt.charAt(i);\n i++;\n setTimeout(typeWriter, speed);\n }\n}", "onCreateText(e) {\n e.preventDefault()\n\n let newSel;\n this.transaction(function(tx) {\n let container = tx.get(this.props.containerId)\n let textType = tx.getSchema().getDefaultTextType()\n let node = tx.create({\n id: uuid(textType),\n type: textType,\n content: ''\n })\n container.show(node.id)\n\n newSel = tx.createSelection({\n type: 'property',\n path: [ node.id, 'content'],\n startOffset: 0,\n endOffset: 0\n })\n }.bind(this))\n this.rerender()\n this.setSelection(newSel)\n }", "function typeWriter(text, i, fnCallback) {\n // check if text isn't finished yet\n if (i < text.length) {\n // add next character to h1\n tagLine.show().html(text.substring(0, i + 1));\n \n // wait for a while and call this function again for next character\n setTimeout(function () {\n typeWriter(text, i + 1, fnCallback);\n }, 100);\n }\n // text finished, call callback if there is a callback function\n else if (typeof fnCallback === 'function') {\n // call callback after timeout\n setTimeout(fnCallback, 2000);\n }\n }", "function typeCharacter( paramDoc, paramCharCode ) {\t\r\n\t// Local variable to extract information about cursor after operations\r\n\tvar newCursorCoords;\r\n\t// Determine if we typing normally, or overwriting a selected block, and act accordingly\r\n\tif ( paramDoc.isSelection ) {\r\n\t\tvar tmpSel = paramDoc.getCurrentSelection();\r\n\t\tvar newCursorCoords = paramDoc.replaceTextInRange( tmpSel.startLine, tmpSel.startColumn, tmpSel.endLine, tmpSel.endColumn, String.fromCharCode(paramCharCode) );\r\n\t}\r\n\telse newCursorCoords = paramDoc.insertText( String.fromCharCode(paramCharCode), cursorLine, cursorColumn );\r\n\t\r\n\tcursorColumn = newCursorCoords[1];\r\n}" ]
[ "0.7147511", "0.69886845", "0.69886845", "0.6972693", "0.68526036", "0.6841061", "0.682003", "0.65776974", "0.65669364", "0.65552783", "0.6533473", "0.6510645", "0.6510645", "0.64854515", "0.6403195", "0.6386045", "0.63331556", "0.63029134", "0.6264683", "0.62430984", "0.62154436", "0.62015665", "0.61733013", "0.6172244", "0.61655986", "0.616079", "0.61607265", "0.613936", "0.61386967", "0.6137523", "0.6133038", "0.6132037", "0.6118829", "0.6107263", "0.6107263", "0.61067295", "0.6103843", "0.60945165", "0.60874486", "0.60817176", "0.60817003", "0.6076098", "0.60643244", "0.60637015", "0.606014", "0.60536975", "0.60474265", "0.60363877", "0.6034522", "0.6031489", "0.6010224", "0.60095686", "0.5996634", "0.5995509", "0.5995216", "0.59937257", "0.5989936", "0.5964589", "0.596437", "0.59544057", "0.5952419", "0.5949213", "0.5949202", "0.5946529", "0.5910611", "0.59052324", "0.589752", "0.58942056", "0.5893487", "0.5893487", "0.5889106", "0.5876595", "0.58765316", "0.58750516", "0.5873701", "0.58722204", "0.58722204", "0.58722204", "0.58722204", "0.58719975", "0.58604985", "0.58604985", "0.58603257", "0.5858488", "0.58570874", "0.5853323", "0.584276", "0.584276", "0.58418673", "0.581979", "0.58143574", "0.58143574", "0.58143574", "0.5810561", "0.57991683", "0.5797821", "0.5795594", "0.5791182", "0.5789031", "0.5788897", "0.5782927" ]
0.0
-1
Resets all the local state on this scope
function resetLocalState() { $scope.transactionSent = null; $scope.transactionNeedsApproval = null; clearReturnedTxData(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "reset() {\r\n this.state=this.initial;\r\n this.statesStack.clear();\r\n\r\n }", "reset() {\n this.resetFields();\n this.resetStatus();\n }", "reset() {\r\n this.currentState = this.initalState;\r\n this.clearHistory();\r\n }", "reset(){\n this.enable();\n this.init();\n this.buildAll();\n }", "function reset() {\n\t setState(null);\n\t} // in case of reload", "function reset() {\n attachSource(null);\n attachView(null);\n protectionData = null;\n protectionController = null;\n }", "function resetScope() {\n $scope.storyCount = 0;\n $scope.stories = [];\n $scope.error = {};\n }", "function resetScope () {\n\t\t\t\t\t\t\t\tscope.fileAdded = false;\n\t\t\t\t\t\t\t\tscope.fileUploading = false;\n\t\t\t\t\t\t\t\tscope.fileSaving = false;\n\t\t\t\t\t\t\t\tscope.fileCropping = false;\n\t\t\t\t\t\t\t\tscope.selectionActive = false;\n\t\t\t\t\t\t\t\tscope.activeImage = null;\n\t\t\t\t\t\t\t\tscope.barStyle= { width: '0%'};\n\t\t\t\t\t\t\t\tscope.error = false;\n\t\t\t\t\t\t\t\tscope.selectedFiles = null;\n\t\t\t\t\t\t\t\tscope.errorMessage = \"\";\n\t\t\t\t\t\t\t\tscope.userSaved = false;\n\t\t\t\t\t\t\t\tif(scope.simpleImageEditor) {\n\t\t\t\t\t\t\t\t\tscope.imageUrl = scope.simpleImageEditor['url'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tscope.imageUrl = null;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tscope.userCancelled = false;\n\t\t \t}", "reset() {\r\n this.currentState = this.initial;\r\n }", "function resetStateAll() {\n that.state.all = false;\n }", "reset() {\n state = createGameState();\n notifyListeners();\n }", "reset() {\n store.dispatch('setIsUnsavedChanges', { isUnsavedChanges: true });\n this.data = {};\n this.activeIndex = 0;\n this.activeCaption = '';\n }", "function reset() { }", "reset() {\n this.unbind();\n }", "function reset_all()\n {\n $states = [];\n $links = [];\n $graph_table = [];\n $end_states = [];\n graph.clear();\n $start_right = [];\n $left = [];\n $current_tape_index = \"\";\n $current_state = \"\";\n $previous_state = \"\";\n $old_current_state = \"\";\n $old_previous_state = \"\";\n $old_tape_index = \"\";\n $error = false;\n $old_tape_head_value = \"\";\n }", "reset() {\n\t\t// Keys\n\t\tthis.keys \t\t= {};\n\n\t\t// State\n\t\tthis.state \t\t= \"\";\n\n\t\t// Score\n\t\tthis.score \t\t= 0;\n\n\t\t// Health\n\t\tthis.health \t= 100;\n\t}", "reset() {\r\n this.prevState=this.currentState;\r\n this.currentState = this.config.initial;\r\n }", "reset() {\r\n this.state = this.initial;\r\n }", "function _resetState() {\n eventManager.clearEvents();\n pressedKeys.clear();\n refCount = 0;\n}", "function _resetState() {\n eventManager.clearEvents();\n pressedKeys.clear();\n refCount = 0;\n}", "function _resetState() {\n eventManager.clearEvents();\n pressedKeys.clear();\n refCount = 0;\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}", "resetAll(state) {\n state.restoList = [];\n state.filteredList = [];\n state.ratingAverage = [];\n state.markersDisplayed = [];\n state.filteringFinished = false;\n state.searchResultHasPage = false;\n state.seeMoreCliked = false;\n }", "function clear() {\n $log.debug(\"kyc-flow-state clear()\");\n clearCurrent();\n states = [];\n }", "async resetAll() {\n\t\treturn reset();\n\t}", "function resetState(){\n Oclasses = {}; // known classes\n arrayOfClassVals = null; // cached array of class values\n arrayOfClassKeys = null; // cached array of class keys\n objectProperties = {}; // known object properties\n arrayOfObjectPropVals = null; // array of object property values\n arrayOfObjectPropKeys = null; // array of object property keys\n dataTypeProperties = {}; // known data properties\n arrayOfDataPropsVals = null; // array of data properties values\n\n classColorGetter = kiv.colorHelper();\n svg = null;\n zoomer = null;\n renderParams = null;\n mainRoot = null;\n panel = null;\n }", "function reset() {\n save(null);\n }", "function reset() {\n BaseAPI.reset.call(_self);\n\n // Data Model\n _self.cmi = new CMI(_self);\n _self.adl = new ADL(_self);\n }", "reset() {\n for (const sensor of this.activeSensors_.values()) {\n sensor.reset();\n }\n this.activeSensors_.clear();\n this.resolveFuncs_.clear();\n this.getSensorShouldFail_.clear();\n this.permissionsDenied_.clear();\n this.maxFrequency_ = 60;\n this.minFrequency_ = 1;\n this.receiver_.$.close();\n this.interceptor_.stop();\n }", "reset () {\n this.state.clear()\n this.redraw()\n }", "reset() {\r\n this.statesDone.clear();\r\n this.statesDone.push(this.initialState);\r\n }", "reset() {\n this.playerContainer.players.forEach(x => x.clearHand())\n this.winner = undefined;\n this.incrementState();\n this.clearSpread();\n this.deck = new Deck();\n this.clearPot();\n this.clearFolded();\n }", "function resetAll(){\n\t\t\t\tlogger.debug(\"Resetting all variables\");\n\t\t\t\tisAudioOn = true;\n\t\t\t\tlpChatFontSize = 13;\n\t\t\t\tchatWinCloseable = true;\n\t\t\t\tlpInteractiveChat = false;\n\t\t\t\tlpVisitorTypingMsg = false;\n\t\t\t \tofflineSurveyNameOverride = \"\";\n\t\t\t\tpreChatSurveyNameOverride = \"\";\n\t\t\t\texitSurveyNameOverride = \"\";\n\t\t\t\tscreenState = '';\n\t\t\t\twindowState = windowStateType.READY;\n\t\t\t\tchatInstanceReady = false;\n\t\t\t\tcollaborationInstanceReady=false;\n\t\t\t}", "clearState() {\n this.names = {};\n this.history = {};\n this.noids = {};\n this.avatars = {};\n }", "function reset() {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n restore_array = [];\n index = -1;\n }", "function reset() {\n clear();\n initialize(gameData);\n }", "function reset() {\n projectStage = null;\n separator = null;\n eventQueue = [];\n errorQueue = [];\n Implementation.requestQueue = null;\n }", "function reset() {\n $scope.currentTimes = {};\n $scope.currentUser = 0;\n $scope.selectedDate = moment();\n $scope.startDate = \"\";\n $scope.endDate = \"\";\n $scope.startTime = \"\";\n $scope.endTime = \"\";\n }", "function reset() {\n BaseAPI.reset.call(_self);\n\n // Data Model\n _self.cmi = new CMI(_self);\n }", "function reset() {\n generateLevel(0);\n Resources.setGameOver(false);\n paused = false;\n score = 0;\n lives = 3;\n level = 1;\n changeRows = false;\n pressedKeys = {\n left: false,\n right: false,\n up: false,\n down: false\n };\n }", "function reset() {\n md = null;\n }", "reset() {\n this.setIrqMask(0);\n this.setNmiMask(0);\n this.resetCassette();\n this.keyboard.clearKeyboard();\n this.setTimerInterrupt(false);\n this.z80.reset();\n }", "reset() {\r\n this.activeState = this.config.initial;\r\n }", "reset() {\n this.inboundIntentModels = [];\n this.intents = [];\n this.ephemeralRelations = [];\n }", "function reset_all(){\n input = \"\";\n result = \"0\";\n history = \"0\";\n answer = \"\";\n setResult(\"0\");\n setHistory(\"0\");\n }", "function resetVariables() {\n $scope.gameInput = '';\n inBuilding.buildingName = \"\";\n }", "function reset() {\n\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 reset() {\n // Internal State\n this.currentState = constants.STATE_NOT_INITIALIZED;\n this.lastErrorCode = 0;\n\n // Utility Functions\n this.apiLogLevel = constants.LOG_LEVEL_ERROR;\n this.listenerArray = [];\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 }", "reset() {\n // Reset the stats\n this.numSusceptible = getInitialNumSusceptible();\n this.numInfectious = getInitialNumInfectious();\n this.numNonInfectious = 0;\n this.numImmune = 0;\n this.numDead = 0;\n this.numIcu = 0;\n\n // Clear the border context\n const { width, height } = this.borderCtx.canvas.getBoundingClientRect();\n this.borderCtx.clearRect(0, 0, width * 2, height * 2);\n\n this.numCommunities = getNumCommunities();\n if (this.numCommunities !== this.model.numCommunities) {\n this.model.numCommunities = this.numCommunities;\n }\n\n this.model.communities = {};\n this.model.setupCommunity();\n\n this.chart.resetChart(this.numSusceptible, this.numInfectious);\n this.timeline.reset();\n this.model.resetModel(this.createCurrentStats());\n\n const {\n width1,\n height2,\n } = this.demographicsCtx.canvas.getBoundingClientRect();\n this.demographicsCtx.clearRect(0, 0, width1 * 2, height2 * 2);\n this.demographicsChart.resetChart(this.createCurrentStats().sum());\n }", "reset() {\n const _ = this;\n _.throwIfDisposed();\n const y = _._yielder;\n _._yielder = null;\n _._state = 0 /* Before */;\n if (y)\n yielder(y); // recycle until actually needed.\n }", "reset() {\n window.sessionStorage.removeItem(\"token\");\n window.sessionStorage.removeItem(\"user\");\n window.sessionStorage.removeItem(\"projects\");\n window.sessionStorage.removeItem(\"state\");\n window.sessionStorage.removeItem(\"centrelines\");\n window.sessionStorage.removeItem(\"mapbox\");\n this.context.setProjectMode(null)\n this.setState({\n activeProject: null,\n projects: [],\n priorities: [],\n objGLData: [],\n filterStore: [],\n rulerPoints: [],\n filters: [], \n carMarker: [], \n filterPriorities: [],\n filterRMClass: [],\n rmclass: [],\n faultData: [],\n inspections: [],\n bucket: null,\n dataActive: false,\n }, () => {\n this.leafletMap.invalidateSize(true);\n let glData = null\n this.GLEngine.redraw(glData, false);\n })\n }", "reset(state) {\n state.isLogged = false\n state.isAdmin = false\n state.isRoot = false\n state.id = ''\n state.name = ''\n state.role = ''\n state.description = {}\n state.groupIds = []\n }", "function reset() {\n let da = new VMN.DAPI();\n da.db.cleanDB();\n da.cleanLog();\n VMN.DashCore.cleanStack();\n}", "reset()\n {\n // unbind any VAO if they exist..\n if (this.nativeVaoExtension)\n {\n this.nativeVaoExtension.bindVertexArrayOES(null);\n }\n\n // reset all attributes..\n this.resetAttributes();\n\n this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL, false);\n\n this.setBlendMode(0);\n\n // TODO?\n // this.setState(this.defaultState);\n }", "reset() {\n this.level = null;\n }", "function resetState() {\n state = 'unopened';\n order = [];\n}", "reset() {\n this.init();\n }", "reset() {\r\n this.currentState = this.config.initial;\r\n }", "function reset() { stack=[]; rstack=[];}", "_reset()\n {\n this.stopped = false;\n this.currentTarget = null;\n this.target = null;\n }", "reset() {\n this.program = null;\n this.shader = null;\n }", "reset() {}", "reset() {}", "reset() {}", "resetState() {\n for (let r = 0; r < this.grid.rows; r++) {\n for (let c = 0; c < this.grid.cols; c++) {\n this.grid.nodes[r][c].cameFrom = undefined;\n this.grid.nodes[r][c].f = Infinity;\n this.grid.nodes[r][c].g = Infinity;\n this.grid.nodes[r][c].visited = false;\n }\n }\n this.openSet = [this.grid.startNode];\n this.closedSet = [];\n this.currentNode = this.grid.startNode;\n this.finishStatus = undefined;\n this.finished = false;\n this.grid.startNode.f = 0;\n this.grid.startNode.g = 0;\n }", "reset() {\r\n this.setState(this.baseState);\r\n }", "reset() {\n this.cache = null\n this.counter = 0\n this.results = []\n }", "function reset() {\n getService().reset();\n}", "function reset() {\n\t\tdictionary = {};\n\t\tradioNames = [];\n\t}", "reset() {\r\n this.currentState = this.config.initial;\r\n this.recordStates.push(this.currentState);\r\n this.currentStatePosition++;\r\n this.recordMethods.push('reset');\r\n }", "function reset() {\n humanChoices = [];\n computerChoices = [];\n level = 0;\n gameOver = false;\n}", "function Reset() {\n vm.model = angular.copy(vm.master);\n resetForm();\n }", "function reset() {\n //RESET EVERYTHING\n console.log(\"RESETTING\")\n entering = 0;\n leaving = 0;\n a = 0;\n b = 0;\n}", "clearStates() {\n // applications should extend this to actually do something, assuming they can save locally\n }", "reset() {\n this._lastDir = null;\n this._lastFilterIndex = null;\n }", "function reset() {\n // noop\n }", "reset() {\n // Make any pending promise obsolete.\n this.pendingBackendInitId++;\n this.state.dispose();\n this.ENV.reset();\n this.state = new EngineState();\n for (const backendName in this.registry) {\n this.disposeRegisteredKernels(backendName);\n this.registry[backendName].dispose();\n delete this.registry[backendName];\n }\n this.backendName = null;\n this.backendInstance = null;\n this.pendingBackendInit = null;\n }", "reset() {\n if (this.active_sensor_ != null) {\n this.active_sensor_.reset();\n this.active_sensor_ = null;\n }\n\n this.get_sensor_should_fail_ = false;\n this.resolve_func_ = null;\n this.max_frequency_ = 60;\n }", "function reset() {\n gridPoints = []; // resets the gridPoints so that it clears the walls etc. on reset.\n gridPointsByPos = [];\n openSet.clear();\n closedSet.clear();\n gctx.clearRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT);\n grid.createGrid();\n\n}", "function softReset() {\n currentAns = 0;\n operatorArr = [];\n numberArr = [];\n fixedNumberArr = [];\n}", "clear() {\n this.state = new TurtleState(new THREE.Vector3(0,0,0), new THREE.Vector3(0,1,0)); \n stateStack = [];\n }", "Reset() {\n this.translation = this.originalTranslation.Clone();\n this.rotationInRadians = this.originalRotationInRadians;\n this.scale = this.originalScale.Clone();\n this.origin = this.originalOrigin.Clone();\n this.dimensions = this.originalDimensions.Clone();\n this.isDirty = true;\n }", "reset() {\n this.api.clear();\n this.api = null;\n this.fieldDescriptor.clear();\n this.resetForm();\n }", "reset() {\n this.grid = this.getEmptyBoard();\n }", "reset() {\n this.gameInProgress = true; // true if playing game, false if ended\n\n // 1.) available players\n this.createCharacters();\n this.displayAvailableCharacters(this.characters);\n\n // Number enemies defeated\n this.enemiesDefeated = 0;\n this.defeatedCharacters.length = 0;\n this.defeatedCharacters = [];\n this.displayDefeatedCharacters(this.defeatedCharacters);\n\n // get rid of player and enemy\n this.currentPlayer = undefined;\n this.currentEnemy = undefined;\n\n // Interact with the DOM\n this.displayGameStatus();\n }", "clearGame() {\n this.state.numberOfProblems = 0;\n this.state.numberOfProblemsSolved = 0;\n this.state.expressions = [];\n this.state.solutions = [];\n this.state.level = '';\n this.state.operators = [];\n this.state.currentTime = '0.0';\n }", "reset() {\n this.set('data', []);\n this._reset();\n }", "reset() {\r\n this.state = this.config.initial;\r\n }", "function reset() {\n\tstate.questionCounter = 0;\n\tstate.score = 0;\n\tstate.questions = [\n\t\t{\n\t\t\tid: 0,\n\t\t\tpregunta: 'Ets un/a Vilafranquí/ina de Tota la Vida? Prova el test!',\n\t\t\trespostes: [],\n\t\t\tcorrecte: null,\n\t\t},\n\t];\n\tstate.collectedAnswers = [];\n\tstate.comodinsLeft = state.comodinsInitial;\n\tstate.comodiUsedInQuestion = false;\n\tstate.comodiButtonExpanded = false;\n\t// display initial question\n\tdisplayInitialQuestion();\n}", "reset() {\n if (!this._running) {\n this._currentState = undefined;\n }\n }", "reset() {\n if (this.sensor_reading_timer_id_) {\n window.clearTimeout(this.sensor_reading_timer_id_);\n this.sensor_reading_timer_id_ = null;\n }\n\n this.start_should_fail_ = false;\n this.update_reading_function_ = null;\n this.active_sensor_configurations_ = [];\n this.suspend_called_ = null;\n this.resume_called_ = null;\n this.add_configuration_called_ = null;\n this.remove_configuration_called_ = null;\n this.resetBuffer();\n core.unmapBuffer(this.buffer_array_);\n this.buffer_array_ = null;\n bindings.StubBindings(this.stub_).close();\n }", "reset() {\n this._age = 0\n this._height = 0\n this._fruits = []\n this._healthyStatus = true\n this._harvested = ''\n }", "reset() {\n this._updateSelectedItemIndex(0);\n this.steps.forEach(step => step.reset());\n this._stateChanged();\n }", "reset() {\n // do nothing\n }", "function resetData() {\n\t\t\tconsole.log(\"resetData()\");\n\n\t\t\tvm.results = [];\n\t\t\tvm.selectedIndex = -1;\n vm.selectedAccIndex = 0;\n\t\t\tvm.total_count = 0;\n loadEmptyObject();\n\t\t\tresetBoolean();\n\t\t}", "reset() {\n const self = this;\n this.updateDimensions(self);\n }", "resetAll() {\n // Clear any previous worlds and renderers\n // if (World && engine)\n // World.clear();\n\n super.resetAll();\n this.engine = Matter.Engine.create();\n }", "function reset() {\n remoteCache = {};\n localCacheById = {};\n localCache = {};\n}" ]
[ "0.7494326", "0.73974353", "0.7364746", "0.7307454", "0.72181076", "0.71871376", "0.7110051", "0.7068902", "0.70276034", "0.70210123", "0.69935924", "0.6967193", "0.69577533", "0.69442296", "0.69368047", "0.6935591", "0.69266456", "0.69206697", "0.6905557", "0.6905557", "0.6905557", "0.69043237", "0.69036335", "0.6896355", "0.6892537", "0.6892206", "0.68802327", "0.68763876", "0.6870508", "0.68356454", "0.6835099", "0.68313146", "0.6826894", "0.68186355", "0.67965156", "0.6793064", "0.6762691", "0.67602974", "0.6754352", "0.674472", "0.67192113", "0.6716421", "0.6715442", "0.67111635", "0.6710402", "0.66972435", "0.6693337", "0.66855955", "0.6682507", "0.66811484", "0.6678566", "0.66686463", "0.66678184", "0.6667562", "0.6665235", "0.66619176", "0.6649043", "0.66478795", "0.6647472", "0.6641318", "0.6637907", "0.6629578", "0.66288316", "0.66241735", "0.66241735", "0.66241735", "0.661799", "0.66111463", "0.65945977", "0.6591926", "0.65884197", "0.6579752", "0.65776104", "0.6574217", "0.6571112", "0.656594", "0.65655553", "0.6562528", "0.6560456", "0.65556574", "0.6552483", "0.6547263", "0.65457726", "0.65447843", "0.6543761", "0.6541171", "0.6540964", "0.65400904", "0.6539608", "0.65395385", "0.653522", "0.65335953", "0.65263736", "0.6524374", "0.6524353", "0.65234077", "0.6523197", "0.6521893", "0.65216255", "0.6521234" ]
0.746674
1
Triggers otp modal to open if user needs to otp before sending a tx
function openModal(params) { if (!params || !params.type) { throw new Error('Missing modal type'); } var modalInstance = $modal.open({ templateUrl: 'modal/templates/modalcontainer.html', controller: 'ModalController', scope: $scope, size: params.size, resolve: { // The return value is passed to ModalController as 'locals' locals: function () { return { type: params.type, wallet: $rootScope.wallets.current, userAction: BG_DEV.MODAL_USER_ACTIONS.sendFunds }; } } }); return modalInstance.result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openSendToModal()\n\t{\n\t\tclearSendto();\n\t\t$(\"#sendto\").modal(\"show\");\n\t\t\n\t}", "generateOtp(){\n this.showspinner = true;\n this.generatedOtpValue = Math.floor(Math.random()*1000000);\n \n saveOtp({\n otpNumber: this.generatedOtpValue,\n recordId: this.recordId\n })\n .then(() => {\n //Show toast message\n const evt = new ShowToastEvent({\n title: 'Record Update',\n message: 'OTP has been generated successfully',\n variant: 'success',\n mode: 'dismissable'\n }); \n this.dispatchEvent(evt);\n \n //Fire an event to handle in aura component to close the modal box\n if(this.closeModal)\n this.dispatchEvent(new CustomEvent('closequickacion'));\n else\n this.showspinner = false;\n })\n .catch(error => {\n this.error = error; \n //Show toast message\n const evtErr = new ShowToastEvent({\n title: 'Record Error',\n message: 'failure occurred' + this.error,\n variant: 'failure',\n mode: 'dismissable'\n }); \n this.dispatchEvent(evtErr);\n });\n }", "function ModConfirmOpen(mode, el_input) {\n console.log(\" ----- ModConfirmOpen ----\")\n // values of mode are : \"prelim_excomp\", \"payment_form\", \"download_invoice\"\n\n // ModConfirmOpen(null, \"user_without_userallowed\", null, response.user_without_userallowed);\n console.log(\" mode\", mode )\n\n// --- create mod_dict\n mod_dict = {mode: mode};\n\n// --- put text in modal form\n const show_modal = (mode === \"prelim_excomp\") ? true :\n (mode === \"payment_form\") ? (permit_dict.requsr_role_corr && permit_dict.permit_pay_comp) :\n (mode === \"download_invoice\") ? (permit_dict.requsr_role_corr && permit_dict.permit_view_invoice) : false;\n const header_text = (mode === \"prelim_excomp\") ? loc.Preliminary_compensation_form :\n (mode === \"payment_form\") ? loc.Download_payment_form :\n (mode === \"download_invoice\") ? loc.Download_invoice : null;\n\n let msg_list = [];\n let hide_save_btn = false;\n\n if(show_modal){\n el_confirm_header.innerText = header_text;\n el_confirm_loader.classList.add(cls_visible_hide)\n el_confirm_msg_container.classList.remove(\"border_bg_invalid\", \"border_bg_valid\");\n const cpt = (mode === \"prelim_excomp\") ? loc.The_preliminary_compensation_form :\n (mode === \"payment_form\") ? loc.The_payment_form :\n (mode === \"download_invoice\") ? loc.The_invoice : \"-\";\n const msg_list = [\"<p>\", cpt, loc.will_be_downloaded_sing, \"</p><p>\",\n loc.Do_you_want_to_continue, \"</p>\"];\n const msg_html = (msg_list.length) ? msg_list.join(\"\") : null;\n el_confirm_msg_container.innerHTML = msg_html;\n\n const caption_save = loc.OK;\n el_confirm_btn_save.innerText = caption_save;\n add_or_remove_class (el_confirm_btn_save, cls_hide, hide_save_btn);\n\n add_or_remove_class (el_confirm_btn_save, \"btn-primary\", (mode !== \"delete\"));\n add_or_remove_class (el_confirm_btn_save, \"btn-outline-danger\", (mode === \"delete\"));\n\n const caption_cancel = loc.Cancel;\n el_confirm_btn_cancel.innerText = caption_cancel;\n\n // set focus to cancel button\n set_focus_on_el_with_timeout(el_confirm_btn_cancel, 150);\n\n// show modal\n $(\"#id_mod_confirm\").modal({backdrop: true});\n };\n }", "send() {\n // Disable send button\n this.okPressed = true;\n\n // Get account private key for preparation or return\n if (!this._Wallet.decrypt(this.common)) return this.okPressed = false;\n\n // Prepare the transaction\n let entity = this.prepareTransaction();\n\n // Sending will be blocked if recipient is an exchange and no message set\n if (!this._Helpers.isValidForExchanges(entity)) {\n this.okPressed = false;\n this._Alert.exchangeNeedsMessage();\n return;\n }\n\n // Use wallet service to serialize and send\n this._Wallet.transact(this.common, entity).then(() => {\n this._$timeout(() => {\n // Enable send button\n this.okPressed = false;\n // Reset all\n this.init();\n return;\n });\n }, () => {\n this._$timeout(() => {\n // Delete private key in common\n this.common.privateKey = '';\n // Enable send button\n this.okPressed = false;\n return;\n });\n });\n $('#confirmation').modal({\n show: 'true'\n }); \n }", "function showModal() {\n setVisible(true);\n setSignUp(false);\n }", "function forgotPass(click) {\n modal.style.display = \"block\";\n signin.style.display = \"none\";\n otp.style.display = \"none\";\n forgot.style.display = \"flex\";\n}", "function otp_sent_regular(){\n swal({\n title: \"OTP SENT!\",\n text: \"Please check your mobile phone\",\n icon: \"success\",\n button: \"Ok\",\n });\n }", "showSendingModal()\n {\n this.props.dispatch({type: \"WALLET_SHOW_SENDING\"});\n }", "function resetOrderEvent(event) {\n $(\"#confirmPasswordPopup\").modal('show');\n}", "async onSendViaEmail() {\n await this.preparingEmailSending();\n this.setState({ showModal: false, isMnemonicCopied: true });\n }", "function viewPendInv() {\n let updateMessage =\n 'These changes will not be saved, are you sure you want to leave the screen?';\n let createMessage =\n 'This Pending Invoice will not be added, are you sure you want to leave this screen?';\n let displayedMessage;\n\n if (PENDINV_ACTION == 'createPendInv') displayedMessage = createMessage;\n else displayedMessage = updateMessage;\n\n if (confirm(displayedMessage)) {\n document.getElementById('pendingInvoiceInformation').style.width = '100%';\n $('#pendingInvoiceCreationZone').hide();\n $('#pendingInvoiceDisplay').show();\n }\n}", "actionModalDialog() {\n this.send(this.get('action'));\n this.controller.set('showModal', false);\n }", "function showPayeePage() {\n gTrans.showDialogCorp = true;\n document.addEventListener(\"evtSelectionDialogInput\", handleInputPayeeAccOpen, false);\n document.addEventListener(\"evtSelectionDialogCloseInput\", handleInputPayeeAccClose, false);\n document.addEventListener(\"tabChange\", tabChanged, false);\n document.addEventListener(\"onInputSelected\", okSelected, false);\n //Tao dialog\n dialog = new DialogListInput(CONST_STR.get('TRANS_LOCAL_DIALOG_TITLE_ACC'), 'TH', CONST_PAYEE_INTER_TRANSFER);\n dialog.USERID = gCustomerNo;\n dialog.PAYNENAME = \"1\";\n dialog.TYPETEMPLATE = \"0\";\n dialog.showDialog(callbackShowDialogSuccessed, '');\n}", "function showThanks() {\n\t\t\t$(\"#IP-head-reg\").modal('hide');\n\t\t\t$('#post-sub').modal('show');\n\t\t}", "function onclick_InviteEmailU4() {\n var result = validate();\n if (result == false) {\n return false;\n }\n customer_id = createUpdateCustomer(customer_id);\n var params = {\n custid: customer_id,\n sales_record_id: null,\n invitetoportal: 'T',\n unity: 'T',\n sendinfo: null,\n id: 'customscript_sl_lead_capture',\n deploy: 'customdeploy_sl_lead_capture'\n };\n params = JSON.stringify(params);\n var upload_url = baseURL + nlapiResolveURL('suitelet', 'customscript_sl_send_email_module', 'customdeploy_sl_send_email_module') + '&params=' + params;\n window.open(upload_url, \"_self\", \"height=750,width=650,modal=yes,alwaysRaised=yes\");\n}", "function confirmProcess(){\r\n\tdocument.getElementById('processFlag').value = 'Y';\r\n\tvar data = savePurchaseOrder();{\r\n\t\tif(data!=\"\"){\r\n\t\t\tpropFunction();\r\n\t\t\tdocument.getElementById(\"processMessage\").innerHTML = \"Order saved and sent to process at WMS\";\r\n\t\t\t$('#confirmProcessModel').modal('show');\r\n\t\t\t\r\n\t\t\tsetTimeout(function() {\r\n\t\t\t\twindow.location.replace(\"./PurchaseOrder\");\r\n\t\t\t}, 5000);\r\n\t\t}\r\n\t}\r\n}", "function showModal() {\n\t\t \tvar action = $(\"#myModal\").attr(\"action\");\n\t\t \n\t\t \tif (action == 'update' || action == 'create') {\n\t\t \t\t$(\"#myModal\").modal(\"show\");\n\t\t \t}\n\t\t \t\n\t\t \tshowContractEndDateSelect();\n\t\t \tshowHidePassword();\n\t\t \tshowHideConfirmPassword();\n\t\t }", "function ModConfirmOpen(tblName, mode, el_input, user_without_userallowed) {\n console.log(\" ----- ModConfirmOpen ----\")\n // values of mode are : \"delete\", \"is_active\" or \"send_activation_email\", \"permission_admin\", \"user_without_userallowed\"\n // \"add_from_prev_yr\"\n // ModConfirmOpen(null, \"user_without_userallowed\", null, response.user_without_userallowed);\n console.log(\" mode\", mode )\n console.log(\" tblName\", tblName )\n console.log(\" el_input\", el_input )\n\n// --- get selected_pk\n let selected_pk = null;\n // tblRow is undefined when clicked on delete btn in submenu btn or form (no inactive btn)\n const tblRow = t_get_tablerow_selected(el_input);\n const data_dict = (tblRow) ? get_datadict_from_tblRow(tblRow) : selected.data_dict;\n const user_name = (data_dict && data_dict.username) ? data_dict.username : \"-\";\n console.log(\" tblRow\", tblRow);\n console.log(\" data_dict\", data_dict);\n\n// --- get info from data_dict\n // TODO remove requsr_pk from client\n const is_request_user = (data_dict && permit_dict.requsr_pk && permit_dict.requsr_pk === data_dict.id)\n console.log(\" is_request_user\", is_request_user)\n\n// --- create mod_dict\n mod_dict = {mode: mode, table: tblName};\n const has_selected_item = (!isEmpty(data_dict));\n if(has_selected_item){\n mod_dict.mapid = data_dict.mapid;\n if (tblName === \"userpermit\"){\n mod_dict.userpermit_pk = data_dict.id\n } else {\n mod_dict.user_pk = data_dict.id;\n mod_dict.user_ppk = data_dict.schoolbase_id;\n }\n };\n if (mode === \"is_active\") {\n mod_dict.current_isactive = data_dict.is_active;\n } else if (mode === \"user_without_userallowed\") {\n if (!isEmpty(user_without_userallowed)) {\n mod_dict.user_pk = user_without_userallowed.user_pk;\n mod_dict.schoolbase_pk = user_without_userallowed.schoolbase_pk;\n mod_dict.username = user_without_userallowed.username;\n mod_dict.last_name = user_without_userallowed.last_name;\n };\n };\n console.log(\" mod_dict\", mod_dict);\n\n// --- put text in modal form\n let dont_show_modal = false;\n const is_mode_permission_admin = (mode === \"permission_admin\");\n const is_mode_send_activation_email = (mode === \"send_activation_email\");\n\n const inactive_txt = (mod_dict.current_isactive) ? loc.Make_user_inactive : loc.Make_user_active;\n const header_text = (mode === \"delete\") ? (tblName === \"userpermit\") ? loc.Delete_permission : loc.Delete_user :\n (mode === \"is_active\") ? inactive_txt :\n (mode === \"user_without_userallowed\") ? loc.Add_user :\n (is_mode_send_activation_email) ? loc.Send_activation_email :\n (is_mode_permission_admin) ? loc.Set_permissions : \"\";\n\n let msg_list = [];\n let hide_save_btn = false;\n if(mode === \"user_without_userallowed\"){\n // PR2023-01-01 from https://stackoverflow.com/questions/4842993/javascript-push-an-entire-list\n // use push.apply instead of joining the list before pushing\n msg_list.push([\"<p>\", loc.Username, \" '\", mod_dict.username, \"' \", loc._of_, loc.User.toLowerCase(),\" '\" , mod_dict.last_name, \"'</p>\"].join(\"\"));\n msg_list.push([\"<p>\", loc.already_exists_in_previous_examyear, \"</p>\"].join(\"\"));\n\n msg_list.push([\"<p class='mt-3'>\", loc.Doyou_wantto_add_to_this_examyear, \"</p>\"].join(\"\"));\n } else if (!has_selected_item){\n msg_list.push(\"<p>\" + loc.No_user_selected + \"</p>\");\n hide_save_btn = true;\n\n } else if (tblName === \"userpermit\"){\n const action = (data_dict.action) ? data_dict.action : \"-\";\n const page = (data_dict.page) ? data_dict.page : \"-\";\n msg_list.push([\"<p>\", loc.Action, \" '\", action, \"'\", loc.on_page, \"'\",page, \"'\", loc.will_be_deleted, \"</p>\"].join(\"\"));\n msg_list.push(\"<p>\" + loc.Do_you_want_to_continue + \"</p>\");\n\n } else if(mode === \"delete\"){\n if(is_request_user){\n msg_list.push(\"<p>\" + loc.Sysadm_cannot_delete_own_account + \"</p>\");\n hide_save_btn = true;\n } else {\n msg_list.push([\"<p>\", loc.User + \" '\" + user_name + \"'\", loc.will_be_deleted, \"</p>\"].join(\"\"));\n msg_list.push(\"<p>\" + loc.Do_you_want_to_continue + \"</p>\");\n }\n\n } else if(mode === \"is_active\"){\n if(is_request_user && mod_dict.current_isactive){\n msg_list.push(\"<p>\" + loc.Sysadm_cannot_set_inactive + \"</p>\");\n hide_save_btn = true;\n } else {\n const inactive_txt = (mod_dict.current_isactive) ? loc.will_be_made_inactive : loc.will_be_made_active\n msg_list.push([\"<p>\", loc.User + \" '\" + user_name + \"'\", inactive_txt, \"</p>\"].join(\"\"));\n msg_list.push(\"<p>\" + loc.Do_you_want_to_continue + \"</p>\");\n }\n\n } else if(is_mode_permission_admin){\n hide_save_btn = true;\n const fldName = get_attr_from_el(el_input, \"data-field\")\n if (fldName === \"group_admin\") {\n msg_list.push(\"<p>\" + loc.Sysadm_cannot_remove_sysadm_perm + \"</p>\");\n };\n\n } else if (is_mode_send_activation_email) {\n const is_expired = activationlink_is_expired(data_dict.activationlink_sent);\n dont_show_modal = (data_dict.activated);\n if(!dont_show_modal){\n mod_dict.user_pk_list = [];\n // --- loop through tblBody.rows and fill user_pk_list, only users of other years\n for (let i = 0, tr; tr = tblBody_datatable.rows[i]; i++) {\n if (tr.classList.contains(cls_selected) ) {\n const tr_dict = user_dicts[tr.id];\n if (tr_dict){\n if (!tr_dict.activated){\n mod_dict.user_pk_list.push(tr_dict.id);\n };\n };\n };\n };\n // tr_clicked is not yet selected when clicked on icon, add data_dict.id to user_pk_list\n if (data_dict && !mod_dict.user_pk_list.includes(data_dict.id)){\n mod_dict.user_pk_list.push(data_dict.id);\n };\n mod_dict.user_pk_count = (mod_dict.user_pk_list) ? mod_dict.user_pk_list.length : 0;\n\n msg_list = [\"<p>\"];\n if (!mod_dict.user_pk_count){\n // this should not be possible, but let it stay\n hide_save_btn = true\n msg_list.push(...[loc.There_are_no, loc.users_selected_not_activated, \"</p>\"]);\n } else {\n if (mod_dict.user_pk_count === 1){\n if(is_expired) {msg_list.push(\"<p>\" + loc.Activationlink_expired + \"</p>\");};\n msg_list.push(...[\"<p>\", loc.We_will_send_an_email_to, \":<br>&emsp;\",loc.User, \":&emsp;&emsp;\", user_name,\n \"<br>&emsp;\", loc.Email_address, \":&emsp;\", data_dict.email, \"</p>\"]);\n\n } else {\n msg_list.push(...[\"<p>\", loc.There_are, mod_dict.user_pk_count, loc.users_selected_not_activated, \"</p><p>\",\n loc.We_will_send_an_email_to, \" \", loc.Those_users.toLowerCase(), \".\"]);\n };\n msg_list.push(...[\"</p><p class='pt-2'>\", loc.Do_you_want_to_continue + \"</p>\"]);\n };\n };\n };\n\n if(!dont_show_modal){\n el_confirm_header.innerText = header_text;\n el_confirm_loader.classList.add(cls_visible_hide)\n el_confirm_msg_container.classList.remove(\"border_bg_invalid\", \"border_bg_valid\");\n\n el_confirm_msg_container.innerHTML = (msg_list.length) ? msg_list.join(\"\") : null;\n\n const caption_save = (mode === \"delete\") ? loc.Yes_delete :\n (mode === \"is_active\") ? ( (mod_dict.current_isactive) ? loc.Yes_make_inactive : loc.Yes_make_active ) :\n (is_mode_send_activation_email) ? loc.Yes_send_email : loc.OK;\n el_confirm_btn_save.innerText = caption_save;\n add_or_remove_class (el_confirm_btn_save, cls_hide, hide_save_btn);\n\n add_or_remove_class (el_confirm_btn_save, \"btn-primary\", (mode !== \"delete\"));\n add_or_remove_class (el_confirm_btn_save, \"btn-outline-danger\", (mode === \"delete\"));\n\n const caption_cancel = (mode === \"delete\") ? loc.No_cancel :\n (mode === \"is_active\") ? loc.No_cancel :\n (is_mode_send_activation_email) ? loc.No_cancel : loc.Cancel;\n\n el_confirm_btn_cancel.innerText = (!hide_save_btn && has_selected_item && !is_mode_permission_admin) ? caption_cancel : loc.Close;\n\n // set focus to cancel button\n set_focus_on_el_with_timeout(el_confirm_btn_cancel, 150);\n\n// show modal\n $(\"#id_mod_confirm\").modal({backdrop: true});\n };\n }", "OnClickPutMoneyIn() {\n this.setPopupTransaction(SessionConstant.POPUP_PUT_MONEY_IN);\n }", "inititateAcSetupMessage(window) {\n if (!window) {\n window = this.getBestParentWin();\n }\n\n window.openDialog(\n \"chrome://openpgp/content/ui/autocryptInitiateBackup.xhtml\",\n \"\",\n \"dialog,centerscreen\"\n );\n }", "function onclick_SendInfo() {\n var result = validate();\n if (result == false) {\n return false;\n }\n customer_id = createUpdateCustomer(customer_id);\n var params = {\n custid: customer_id,\n sales_record_id: null,\n invitetoportal: 'T',\n unity: 'T',\n sendinfo: 'T',\n id: 'customscript_sl_lead_capture',\n deploy: 'customdeploy_sl_lead_capture'\n };\n params = JSON.stringify(params);\n var upload_url = baseURL + nlapiResolveURL('suitelet', 'customscript_sl_send_email_module', 'customdeploy_sl_send_email_module') + '&params=' + params;\n window.open(upload_url, \"_self\", \"height=750,width=650,modal=yes,alwaysRaised=yes\");\n}", "function onclick_InviteEmail() {\n var result = validate();\n if (result == false) {\n return false;\n }\n customer_id = createUpdateCustomer(customer_id);\n var params = {\n custid: customer_id,\n sales_record_id: null,\n invitetoportal: 'T',\n unity: null,\n sendinfo: null,\n id: 'customscript_sl_lead_capture',\n deploy: 'customdeploy_sl_lead_capture'\n };\n params = JSON.stringify(params);\n var upload_url = baseURL + nlapiResolveURL('suitelet', 'customscript_sl_send_email_module', 'customdeploy_sl_send_email_module') + '&params=' + params;\n window.open(upload_url, \"_self\", \"height=750,width=650,modal=yes,alwaysRaised=yes\");\n}", "function showPopupOrder(tittle, content, nameButton){\n\tvar d = new Date;\n\tcheckin_time = [d.getFullYear(), d.getMonth()+1, d.getDate()].join('/')+' '+\n [d.getHours(), d.getMinutes(), d.getSeconds()].join(':');\n\tsetMessagePopup('Thông báo đặt phòng', 'Hãy xác nhận đặt phòng <br></br>'\n\t\t\t+'Giờ checkin là: '+ checkin_time, 'Đặt phòng')\n\t$('#popup-message').modal('show');\n\t$('#btn-success-popup').removeAttr('disabled');\n}", "function promptIfOexchange() {\n var s = ['',\n '<div id=\"oexchange-prompt-inner\">',\n '<h1>OExchange</h1>',\n '<p>This site has enabled open sharing. Would you like to remember it so you can share here later?</p>',\n '<div id=\"oexchange-prompt-buttons\">',\n '<form action=\"'+addUrl+'\" target=\"_blank\">',\n '<input type=\"hidden\" name=\"add\" value=\"'+(getXRD())+'\">',\n '<button onclick=\"jQuery.oex.hidePrompt();\">Save</button>',\n '<button onclick=\"jQuery.oex.hidePrompt();return false\">No Thanks</button></form>',\n '</div>',\n '</div>'].join('');\n jQuery('body').append('<div id=\"oexchange-prompt\">'+s+'</div>');\n\n if (readCookie('odbm')) {\n // don't ask again \n } else {\n jQuery('#oexchange-prompt').slideDown();\n }\n }", "function onCallForwardingAutoPopupOkBtnClick() {\r\n callForwardingAutoToggleSwitch.click();\r\n }", "function otpConfirmation() {\n if (verificationId1 !== \"\" && otpInput !== \"\") {\n setIsLoading2(true);\n var credential = firebase.auth.PhoneAuthProvider.credential(\n verificationId1,\n otpInput\n );\n firebase\n .auth()\n .signInWithCredential(credential)\n .then((res) => {\n // console.log('signedIn')\n // var user1 = firebase.auth().currentUser;\n // history.push(\"/Quiz\");\n window.location.reload();\n setIsLoading2(false);\n })\n .catch((err) => {\n alert(\"Error Verifying OTP\");\n window.location.reload();\n setIsLoading2(false);\n });\n } else if (otpInput === \"\" && verificationId1 !== \"\") {\n alert(\"Solve reCaptcha to initialize verification\");\n } else {\n alert(\"Get OTP to initialize verification\");\n }\n }", "function popupEventSender() {\n// Show the modal\n\t$('#eventSenderModal').modal('show')\n}", "function ULOGA_EMAIL(a, n) {\r\n if (a != undefined) {\r\n if (a) {\r\n TBL[\"AKK\"][\"AKK_EML_TXT\"][n].innerHTML = \"verified\";\r\n TBL[\"AKK\"][\"AKK_EML_BTN\"][n].style.display = \"block\";\r\n TBL[\"AKK\"][\"AKK_EML_BTN\"][n].onclick = function () {\r\n RST_PSS(n);\r\n };\r\n TBL[\"AKK\"][\"AKK_EML_BTN\"][n].innerHTML = \"reset password\";\r\n } else {\r\n TBL[\"AKK\"][\"AKK_EML_TXT\"][n].innerHTML = \"not verified\";\r\n TBL[\"AKK\"][\"AKK_EML_BTN\"][n].style.display = \"none\";\r\n TBL[\"AKK\"][\"AKK_EML_BTN\"][n].onclick = function () {};\r\n TBL[\"AKK\"][\"AKK_EML_BTN\"][n].innerHTML = \"\";\r\n }\r\n } else {\r\n TBL[\"AKK\"][\"AKK_EML_TXT\"][n].innerHTML = \"not created\";\r\n TBL[\"AKK\"][\"AKK_EML_BTN\"][n].style.display = \"none\";\r\n TBL[\"AKK\"][\"AKK_EML_BTN\"][n].onclick = function () {};\r\n TBL[\"AKK\"][\"AKK_EML_BTN\"][n].innerHTML = \"\";\r\n }\r\n}", "onClickButtonModal(event, status) {\n event.preventDefault();\n\n const { flowRecoveryPassword } = this.state;\n\n if (!status) {\n this.setState({\n displayModal: false,\n displayFormSendEmail: false,\n displayFormSuccessEmail: false,\n displayFormSendPassword: false,\n displayFormSuccessPassword: false,\n loader: false,\n email: '',\n password: '',\n confirmPassword: '',\n errorMessage: '',\n });\n return;\n }\n\n if (flowRecoveryPassword) {\n this.setState({\n displayModal: true,\n displayFormSendPassword: true,\n });\n return;\n }\n\n this.setState({\n displayModal: true,\n displayFormSendEmail: true,\n });\n }", "function actualizar_oi(){\n $('#confirmar_actualizar_oi').modal('show');\n}", "function confirmSOProcess(){\r\n\tdocument.getElementById('processFlag').value = 'Y';\r\n\tvar data = saveSalesOrder();{\r\n\t\tif(data!=\"\"){\r\n\t\t\tpropFunction();\r\n\t\t\tdocument.getElementById(\"processMessage\").innerHTML = \"Order saved and sent to process at WMS\";\r\n\t\t\t$('#confirmProcessModel').modal('show');\r\n\t\t\t\r\n\t\t\tsetTimeout(function() {\r\n\t\t\t\twindow.location.replace(\"./SalesOrder\");\r\n\t\t\t}, 5000);\r\n\t\t}\r\n\t}\r\n}", "function showProperPopup(e) {\n var cloneClone;\n\n // prevent to add sharp to URL after clicking on Cancel job btn (because it's link)\n // TODO: make it button not link\n if ($(e.target).is(modalCancelBtn)) {\n e.preventDefault();\n }\n\n // if user clicks on wihraw btn\n if ($(e.target).is(modalWithdrawBtn)) {\n // if job status is applied we show popup without reason\n if (chatData.status === \"applied\") {\n cloneClone = simpleWithdrawPopupClone.clone(true);\n $(mainModalCont).addClass(\"is-active\");\n $(mainModalContentCont).append(cloneClone);\n } else if (chatData.status === \"rewarded\") {\n // if job status is rewarded we show popup with reason\n cloneClone = withdrawPopupReasonClone.clone(true);\n $(mainModalCont).addClass(\"is-active\");\n $(mainModalContentCont).append(cloneClone);\n };\n // if user clicks on apply btn\n } else if ($(e.target).is(modalApplyBtn)) {\n // we take hardcoded person's standart price and cut of currency and text\n // TODO: how can we make this value not hardcoded?\n var price = parseInt($(\".js-person-standart-price\").val());\n\n cloneClone = applyPopupClone.clone(true);\n // if user clicks on custom apply\n if ($(e.target).hasClass(\"is-custom-apply\")) {\n // we insert provided reason to appropriate element in popup\n cloneClone.find(\".js-custom-apply-reason\").html($(\".js-custom-reason\").val());\n // and take provided price from input\n price = parseInt($(\".js-custom-price-input\").val());\n }\n // then we insert interpreter's price into element in popup and add currency\n // TODO: how can we make currency and fee not hardcoded?\n cloneClone.find(\".js-applied-price\").html(price + \" NOK\");\n if (chatData.commissions) {\n // add skiwo fee text\n cloneClone.find(\".js-apply-fee-text\").html(\"+\" + (parseFloat(chatData.commissions.fee) * 100) + \"%\");\n // show skiwo fee value that received from backend\n cloneClone.find(\".js-apply-fee\").html(parseFloat(price * parseFloat(chatData.commissions.fee)).toFixed(2) + \" NOK\");\n // add skiwo VAT text\n cloneClone.find(\".js-apply-vat-text\").html(\"+\" + (parseFloat(chatData.commissions.vat ? chatData.commissions.vat : 0) * 100) + \"%\");\n // show skiwo VAT value that received from backend\n cloneClone.find(\".js-apply-vat\").html(parseFloat((parseFloat(price * parseFloat(chatData.commissions.fee)).toFixed(2)) * parseFloat(chatData.commissions.vat ? chatData.commissions.vat : 0)).toFixed(2) + \" NOK\");\n }\n var fee = Number(parseFloat(price * parseFloat(chatData.commissions.fee)).toFixed(2));\n var vat = Number(parseFloat((parseFloat(price * parseFloat(chatData.commissions.fee)).toFixed(2)) * parseFloat(chatData.commissions.vat ? chatData.commissions.vat : 0)).toFixed(2));\n // and insert total price to popup\n cloneClone.find(\".js-total-apply-price\").html((price + fee + vat) + \" NOK\");\n // then we show popup with apply block\n $(mainModalCont).addClass(\"is-active\");\n $(mainModalContentCont).append(cloneClone);\n $(mainModalContentCont).addClass(\"is-apply\");\n // if user clicks on reward btn\n } else if ($(e.target).is(modalRewardBtn)) {\n // we pull clear and total price from clicked btn\n var clearPrice = $(e.target).attr(\"data-clear-price\");\n var name = $(e.target).attr(\"data-person-name\");\n var price = parseInt(clearPrice);\n\n cloneClone = rewardPopupClone.clone(true);\n // then we fill in this popup with prices\n cloneClone.find(\".js-applied-price\").html(clearPrice);\n if (chatData.commissions) {\n // add skiwo fee text\n cloneClone.find(\".js-apply-fee-text\").html(\"+\" + (parseFloat(chatData.commissions.fee) * 100) + \"%\");\n // show skiwo fee value that received from backend\n cloneClone.find(\".js-apply-fee\").html(parseFloat(price * parseFloat(chatData.commissions.fee)).toFixed(2) + \" NOK\");\n // add skiwo VAT text\n cloneClone.find(\".js-apply-vat-text\").html(\"+\" + (parseFloat(chatData.commissions.vat ? chatData.commissions.vat : 0) * 100) + \"%\");\n // show skiwo VAT value that received from backend\n cloneClone.find(\".js-apply-vat\").html(parseFloat((parseFloat(price * parseFloat(chatData.commissions.fee)).toFixed(2)) * parseFloat(chatData.commissions.vat ? chatData.commissions.vat : 0)).toFixed(2) + \" NOK\");\n }\n var fee = Number(parseFloat(price * parseFloat(chatData.commissions.fee)).toFixed(2));\n var vat = Number(parseFloat((parseFloat(price * parseFloat(chatData.commissions.fee)).toFixed(2)) * parseFloat(chatData.commissions.vat ? chatData.commissions.vat : 0)).toFixed(2));\n cloneClone.find(\".js-total-apply-price\").html((price + fee + vat) + \" NOK\");\n cloneClone.find(\".js-inter-name\").html(name);\n // and show popup\n $(mainModalCont).addClass(\"is-active\");\n $(mainModalContentCont).append(cloneClone);\n $(mainModalContentCont).addClass(\"is-apply\");\n // if user clicks on decline btn\n } else if ($(e.target).is(modalDeclineBtn)) {\n // we receive array of person that business in talking now\n var currentPersonArray = chatData.chat_section.filter(function(obj) {\n return Number(currentActiveDiscussionId) === Number(obj.inter_id);\n });\n // then we get his name\n var currentPersonName = currentPersonArray[0].inter_first_name;\n // and try to get awarded person array\n var awardedPersonArray = chatData.chat_section.filter(function(obj) {\n return obj.last_method_status === \"Awarded\";\n });\n\n // if we have awarded person\n if (awardedPersonArray.length) {\n // we get his id\n var awardedPersonId = awardedPersonArray[0].inter_id;\n // if this id matches with current discussion id\n if (Number(currentActiveDiscussionId) === Number(awardedPersonId)) {\n // we create popup with declining reason and show it\n cloneClone = declineReasonPopupClone.clone(true);\n $(mainModalCont).addClass(\"is-active\");\n $(mainModalContentCont).append(cloneClone);\n }\n // if we don't have awarded person\n } else {\n // we create usual decline popup and show it\n cloneClone = declinePopupClone.clone(true);\n cloneClone.find(\".js-decline-person-name\").html(currentPersonName);\n $(mainModalCont).addClass(\"is-active\");\n $(mainModalContentCont).append(cloneClone);\n }\n // if we click cancel job btn\n } else if ($(e.target).is(modalCancelBtn)) {\n // we try to check which status was before canceling\n var jobStatus = 0;\n var awardedName;\n\n // if we'he already rewarded someone\n if (chatData.status === \"rewarded\") {\n // we set job status variable to 2 and look for awarded person\n jobStatus = 2;\n for (var i = 0, lim = chatData.chat_section.length; i < lim; i += 1) {\n if (chatData.chat_section[i].last_method_status === \"Awarded\") {\n awardedName = chatData.chat_section[i].inter_first_name;\n break\n }\n }\n // if we have some applies or simple msgs\n } else if (chatData.status === \"replied\") {\n // we look for applies\n for (var i = 0, lim = chatData.chat_section.length; i < lim; i += 1) {\n if (chatData.chat_section[i].last_method_status === \"Applied\") {\n // if we find minimum one we set job status variable to 1\n jobStatus = 1;\n break\n }\n }\n // if we don't have applies or awards we set 0 to job status variable\n } else {\n jobStatus = 0;\n }\n // then we make action according to job satus variable\n switch (jobStatus) {\n // if we don't have applies or awards we just cancel assignment and no one cares\n case 0:\n cancelAssignment();\n break;\n // if we have applies we show cancel popup\n case 1:\n cloneClone = cancelSimpleClone.clone(true);\n $(mainModalCont).addClass(\"is-active\");\n $(mainModalContentCont).append(cloneClone);\n break;\n // if we have award we show popup that sayed that an interpreter will be sad after it\n case 2:\n cloneClone = cancelSevereClone.clone(true);\n cloneClone.find(\".js-cancel-person-name\").html(awardedName);\n $(mainModalCont).addClass(\"is-active\");\n $(mainModalContentCont).append(cloneClone);\n break;\n }\n }\n }", "function preTransferOwnership(ownerID) {\n letOwnerTransfer = false;\n $(\".modal-title\").html(\"New Owner\");\n $(\".modal-body\").html(`\n <label> New Owner: </label>\n <input id=\"newOwnerEmail\" type=\"text\" data-id=${ownerID} placeholder=\"New Owner Email\" onblur=\"checkIfFoundAdmin(this)\" autofocus=\"autofocus\"/>\n <p>Once Transfer happens, you will be logged out and your role will change to Manger.\n <br/>Are you sure you want to proceed?</p>`);\n $(\".modal-footer\").html(`\n<button id='deleteBTN' type=\"button\" class=\"btn btn-danger\">Transfer</button>\n<button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">Close</button>`);\n setTimeout(function () {\n $('#deleteBTN').attr(\"onclick\", `trasferOwnership(${ownerID});`)\n }, 50);\n // enter while in newOwnerEmail input\n $('#newOwnerEmail').on('keyup', (e) => {\n if (e.keyCode == 13) {\n $('#deleteBTN').focus();\n trasferOwnership(ownerID);\n }\n ;\n });\n}", "function openModalApprovaAppunto(btn) {\n idAppunto = parseInt($(btn).attr(\"id\").split('_')[$(btn).attr(\"id\").split('_').length - 1]);\n idArgomento = parseInt($(btn).attr(\"id\").split('_')[$(btn).attr(\"id\").split('_').length - 2]);\n $(\"#contModale\").text(\"Sei sicuro di voler accettare questo allegato?\");\n $(\"#btnConfApprovAllegato\").removeAttr(\"disabled\");\n $(\"#modalApprovAllegato\").modal(\"show\");\n}", "function onchecked() {\n if (vm.attestation.acceptTerms) {\n vm.openAuthenticateModal();\n } else {\n vm.isAuthenticated = false;\n }\n }", "function sendQuestion(){\n $('#questionModal').modal('hide');\n // window.open(taeUIInline.getInstance().questionsURL+\"/create?text=\"+$(\"#inputQuestion\").val()+\"&tags=Infanzia,\"+simpaticoEservice,\"_blank\");\n window.open(taeUIInline.getInstance().questionsURL+\"/create?tags=Infanzia,\"+simpaticoEservice,\"_blank\");\n}", "_order_accepted(event) {\n const order = event.detail;\n if (order.pcode == this.pcode)\n return;\n\n const price = this.$.currency_scaler.yToHumanReadable(order.price);\n const volume = this.$.currency_scaler.xToHumanReadable(order.volume);\n\n this.$.modal.modal_text = `Do you want to ${order.is_bid ? 'sell' : 'buy'} ${volume} units for $${price}?`\n this.$.modal.on_close_callback = (accepted) => {\n if (!accepted)\n return;\n\n this.$.trader_state.accept_order(order);\n };\n this.$.modal.show();\n }", "function ModConfirmOpen_DownloadUserdata(mode ) {\n console.log(\" ----- ModConfirmOpen_DownloadUserdata ----\")\n\n// variables for future use in other functions\n console.log(\" mode\", mode);\n const may_edit = true;\n const show_modal = true;\n const show_large_modal = true;\n\n// --- create mod_dict\n mod_dict = {mode: mode};\n\n // --- put text in modal for\n let header_txt = \"\";\n const msg_list = [];\n let caption_save = loc.OK;\n let hide_save_btn = false;\n\n header_txt = loc.Download_user_data;\n caption_save = loc.Yes_download;\n msg_list.push(\"<p>\" + loc.The_user_data + loc.will_be_downloaded_plur + \"</p><p>\");\n msg_list.push(\"<p>\" + loc.Do_you_want_to_continue + \"</p>\");\n\n el_confirm_header.innerText = header_txt;\n el_confirm_loader.classList.add(cls_visible_hide);\n el_confirm_msg_container.classList.remove(\"border_bg_invalid\", \"border_bg_valid\");\n\n el_confirm_msg_container.innerHTML = msg_list.join(\"\");\n\n el_confirm_btn_save.innerText = caption_save;\n add_or_remove_class (el_confirm_btn_save, cls_hide, hide_save_btn);\n\n //add_or_remove_class (el_confirm_btn_save, \"btn-primary\", (mode !== \"delete\"));\n add_or_remove_class (el_confirm_btn_save, \"btn-outline-danger\", (mode === \"delete_candidate\"), \"btn-primary\");\n\n el_confirm_btn_cancel.innerText = (hide_save_btn) ? loc.Close : loc.No_cancel;\n\n// set focus to cancel button\n set_focus_on_el_with_timeout(el_confirm_btn_cancel, 150);\n\n// show modal\n if (show_modal) {\n $(\"#id_mod_confirm\").modal({backdrop: true});\n\n // this code must come after $(\"#id_mod_confirm\"), otherwise it will not work\n add_or_remove_class(document.getElementById(\"id_mod_confirm_size\"), \"modal-md\", show_large_modal, \"modal-md\");\n };\n }", "_order_accepted(event) {\n const order = event.detail;\n //Get bids and asks\n const bids = this.bids.filter(b => b.pcode === this.pcode);\n const asks = this.asks.filter(a => a.pcode === this.pcode);\n if (order.pcode == this.pcode)\n return;\n\n if ((this.settledAssets === 0 && order.is_bid) || (this.settledAssets === 2 && !order.is_bid)) {\n this.$.widget.setLimitText(`Cannot accept ${order.is_bid ? 'bid' : 'ask'}: holding ${this.settledAssets} bonds`);\n return;\n }\n\n this.$.modal.modal_text = `Do you want to ${order.is_bid ? 'sell' : 'buy'} for $${parseFloat((order.price/100).toFixed(1))}?`\n this.$.modal.on_close_callback = (accepted) => {\n if (!accepted)\n return;\n this.$.trader_state.accept_order(order);\n //Cancel all asks\n if(order.is_bid){\n for(let i = 0; i < asks.length; i++) {\n this.$.trader_state.cancel_order(asks[i]);\n }\n }\n else{\n for(let i = 0; i < asks.length; i++) {\n this.$.trader_state.cancel_order(asks[i]);\n }\n }\n };\n this.$.modal.show();\n }", "function onclick_approveEmail() {\n\n try {\n\n // Pop up dialogue box for Approval\n\n var options = {\n title: \"Email for Account Confirmation Activated!\",\n message: \"Click Ok to Approve\"\n };\n\n } catch (err) {\n log.error({title: \"Error setting check box field value\", details: err.message});\n }\n\n // Function called on 'OK' dialogue response\n\n function success(result) {\n\n try {\n\n if (result === true)\n {\n\n var curRec = currentRecord.get();\n var recordId = curRec[\"id\"];\n\n log.debug({title: 'record', details: curRec});\n log.debug({title: 'record ID', details: recordId});\n\n // setting Email for Account Confirmation field value to true.\n\n var id = record.submitFields({\n type: record.Type.CUSTOMER,\n id: recordId,\n values: {\n custentity_email_approve_chckbox: true\n }\n });\n\n window.location.reload();\n }\n\n\n } catch (err) {\n log.error({title: \"Error in dialog block\", details: err.message});\n }\n }\n\n function failure(reason) {\n log.debug(\"Failure: \" + reason);\n }\n\n dialog.confirm(options).then(success).catch(failure);\n\n\n }", "async requireResendActivation({ view, antl }) {\n return view.render('user.request_email', {\n action: \"UserController.resendActivation\",\n header: antl.formatMessage(\"main.send_activation_email_again\"),\n lead: antl.formatMessage(\"main.send_activation_email_again_desc\"),\n })\n }", "customShowModalPopup() { \n this.customFormModal = true;\n }", "function insertNew3TPAllowance() {\n var frm = document.frmAllow;\n if (frm.allowTPAddress.value.length < 41) {\n $(\"#statusFormAllow\").css(\"background-color\", \"Salmon\");\n $(\"#statusFormAllow\").html(\"You must inform appropriate information\");\n return\n }\n $(\"#statusFormAllow\").css(\"background-color\", \"lightblue\");\n $(\"#statusFormAllow\").html(\"Waiting for you to confirm the transaction in MetaMask or another Ethereum wallet software\");\n console.log(\"Sending... \" + frm.allowTPAddress.value);\n contract.allowIssuers(frm.allowTPAddress.value, {from: web3.eth.accounts[0], gas: 3000000, value: 0}, function (err, result) {\n if (!err) {\n $(\"#statusFormAllow\").css(\"background-color\", \"yellow\");\n $(\"#statusFormAllow\").text(\"Transaction sent. Wait until it is mined. Transaction hash: \" + result);\n waitForTxToBeMined(result, \"#statusFormAllow\");\n } else {\n console.error(err);\n $(\"#statusFormAllow\").css(\"background-color\", \"Salmon\");\n $(\"#statusFormAllow\").html(\"Error \" + JSON.stringify(err));\n }\n });\n $(\"#btnStartOverNew3TPAllowance\").show();\n $(\"#btnInsertNew3TPAllowance\").hide();\n}", "function openProposedObjectiveModal(){\n $(\"#obj-modal-type\").val('propose');\n\tsetObjectiveModalContent('', '', '', getToday(), 0, 2);\n\tshowObjectiveModal(true);\n}", "function onForgotClick()\n\t{\n\t\t$('#forgot_box').toggle(); \n\t}", "makePromptVisible() {\n // Loads popup only if it is disabled.\n if (this.popupStatus === false) {\n $(\"#\" + this.options.popupID).hide().fadeIn(\"slow\");\n this.popupStatus = true;\n }\n }", "handleEditEmailButtonClick() {\n this.openEditEmailModal();\n }", "function MtcClick(){window.open(\"//mtc.contactatonce.com/MobileTextConnectConversationInitiater.aspx?MerchantId=\"+objMtc.MerchantId+\"&ProviderId=\"+objMtc.ProviderId+\"&PlacementId=31\",\"\",\"resizable=yes,toolbar=no,menubar=no,location=no,scrollbars=no,status=no,height=400,width=410\")}", "function onclick_SendEmail() {\n var result = validate();\n if (result == false) {\n return false;\n }\n customer_id = createUpdateCustomer(customer_id);\n var params = {\n custid: customer_id,\n sales_record_id: null,\n id: 'customscript_sl_lead_capture',\n deploy: 'customdeploy_sl_lead_capture'\n };\n params = JSON.stringify(params);\n var upload_url = baseURL + nlapiResolveURL('suitelet', 'customscript_sl_send_email_module', 'customdeploy_sl_send_email_module') + '&params=' + params;\n window.open(upload_url, \"_self\", \"height=750,width=650,modal=yes,alwaysRaised=yes\");\n}", "function checkout() {\n document.getElementById(\"final-order\");\n prompt(\"Please enter your phone number\");\n alert(\n \"Your order is being processed. It will be delivered to your location soon if delivery option was selected. Thank you\"\n );\n }", "function showMessageSecurityPanel() {\n document\n .getElementById(\"messageSecurityPanel\")\n .openPopup(\n document.getElementById(\"encryptionTechBtn\"),\n \"bottomcenter topright\",\n 0,\n 0,\n false\n );\n}", "function displayCreateAccountModal(){\n showModal(\"create-account-template\")\n\n // defer the slow part, so that the modal actually appears\n setTimeout(function(){\n // create a new mailbox. this takes a few seconds...\n keys = openpgp.generate_key_pair(KEY_TYPE_RSA, KEY_SIZE, \"\")\n var publicHash = computePublicHash(keys.publicKeyArmored)\n var email = publicHash+\"@\"+window.location.hostname\n\n // Change \"Generating...\" to \"Done\", explain what's going on to the user\n $(\"#createAccountModal h3\").text(\"Welcome, \"+email)\n $(\"#spinner\").css(\"display\", \"none\")\n $(\"#createForm\").css(\"display\", \"block\")\n }, 100)\n\n $(\"#createButton\").click(function(){\n createAccount(keys)\n })\n}", "openChangePasswordModal() {\n this.CucControllerHelper.modal\n .showModal({\n modalConfig: {\n template: passwordTemplate,\n controller: 'LogsAccountPasswordCtrl',\n controllerAs: 'ctrl',\n backdrop: 'static',\n },\n })\n .finally(() => this.CucControllerHelper.scrollPageToTop());\n }", "showConfirmDialog() {\n this.props.showMakeOrderDialog();\n }", "function successPrompt(id, el) {\n \t$('.success-prompt').remove();\n \t$('.password-prompt').remove();\n\n \tvar container = (state === STATES.SELL) ? \"#sellingOffers\" : \"#buyingOffers\";\n\n \tvar form = $(document.createElement(\"form\"));\n \tform.submit(function() {$(this).remove(); passPrompt(id, el, $(this).attr('action')); return false;});\n \tform.addClass('success-prompt');\n\n \tform.html(`<p>Was your transaction successful?</p>\n \t\t\t <button type='button' onclick='deleteDataModule.closePrompt(this)' class='btn close-corner'><i class='fas fa-times'></i></button>\n \t\t\t <div class='btns'>\n \t\t\t\t\t<button type='submit' onclick=\"this.form.action='yes'\" class='btn'>Yes</button>\n \t\t\t\t\t<button type='submit' onclick=\"this.form.action='no'\" class='btn'>No</button>\n \t\t\t </div>`)\n\n \t$(container).append(form);\n \tvar pos = $(el).offset();\n \tpos.left -= form.width()\n \tform.offset(pos);\n }", "function modalShown(o){\n\t\t/*\n\t\tif(o.template){\n\t\t\t//show spinner dialogue\n\t\t\t//render o.template into o.target here\n\t\t}\n\t\t*/\n\t\tsaveTabindex();\n\t\ttdc.Grd.Modal.isVisible=true;\n\t}", "function pay() {\n if(paySetting == 0) {\n $(\"#paid\").fadeIn(1000);\n $(\"#change\").fadeIn(1000);\n $(\"#pay\").hide();\n $(\"#cancel\").fadeIn(1000);\n $(\"#process\").fadeIn(1000);\n $('#addBtn').prop('disabled', true);\n } else {\n $(\"#payWindow\").modal();\n }\n}", "function displayAgentProfileModal() {\n\t\t \tvar action = $(\"#agentProfileModal\").attr(\"action\");\n\t\t \tif(action == 'Show Profile of') {\n\t\t \t\t$(\"#agentProfileModal\").modal(\"show\");\n\t\t \t\tshowHideOldPassword();\n\t\t \t\tshowHideChangePassModal();\n\t\t \t}\n\t\t }", "function openSave () {\n $('#saveTemplate').modal('show');\n }", "function openSave () {\n $('#saveTemplate').modal('show');\n }", "function on_activate(options)\n {\n old_hashed_password = options.old_hashed_password;\n on_success = options.on_success;\n on_cancellation = options.on_cancellation;\n\n if (on_cancellation) { domanip.enable(DOM.cancel_password_setup_button, true); }\n else { domanip.disable(DOM.cancel_password_setup_button, true); }\n\n update_confirmation_button_status();\n\n DOM.new_password_input.focus();\n }", "function UserProfileModal() {\t\t\n\tcustomModalBox.htmlBox('yt-UserProfileContent', '', 'UserProfile'); \n\t$('mb_close_link').addEvent('click', function() {\n\t\t$('yt-UserProfileContent').injectInside(document.forms[0]);\t\t\n\t\tif($('txtarUserProfileMsg'))\n\t\t$('txtarUserProfileMsg').value=\"\";\n\t\t\n\t//\twindow.location.reload(true); \n\t});\n\n\t\n}", "function checkSession() {\n setTimeout(function () {\n if (!sessionData.email && sessionData.submissions >= 3) {\n $('#modal1').modal('open');\n }\n }, 2000);\n\n}", "function becomeFreeMemberOpenPopup() {\n var _freepopup = \"http://\" + DomainName + \"/commonpopup/FreeRegistrationWithPwd\";\n if ($(\"#hdnallfreepop\").length > 0) { _freepopup = \"http://\" + DomainName + \"/\" + $(\"#hdnallfreepop\").val(); }\n var PaymentVal = readCookieValue(\"NewspaperARCHIVE.com.User.PaymentAttempt\");\n if (PaymentVal != null && PaymentVal.length > 0) {\n var _PaymentCount = readFromString(PaymentVal, \"PaymentCount\");\n if (parseInt(_PaymentCount) > 1) {\n openPopup(_freepopup + \"?r=\" + Math.floor(Math.random() * 10001), 800, true);\n }\n else {\n if ($(\"#hdnPaymentMode\").length > 0 && ($(\"#hdnPaymentMode\").val() == \"PaidVersion\")) { top.window.location = _becomememberpage; }\n else { openPopup(_freepopup + \"?r=\" + Math.floor(Math.random() * 10001), 800, true); }\n }\n }\n else {\n if ($(\"#hdnPaymentMode\").length > 0 && ($(\"#hdnPaymentMode\").val() == \"PaidVersion\")) { top.window.location = _becomememberpage; }\n else { openPopup(_freepopup + \"?r=\" + Math.floor(Math.random() * 10001), 800, true); }\n }\n}", "function addTransaction(e) {\n document.getElementById(\"myModal\").style.display = \"block\";\n}", "function doopenchannel() {\n ModalService.showModal({\n templateUrl: \"modals/openchannel.html\",\n controller: \"OpenChannelController\",\n }).then(function(modal) {\n modal.element.modal();\n $scope.$emit(\"child:showalert\",\n \"To open a new channel, enter or scan the remote node id and amount to fund.\");\n modal.close.then(function(result) {\n });\n });\n }", "function showPopupFormular() {\r\n $(\"#\" + global.Element.PopupFormular).modal(\"show\");\r\n }", "send() {\n // Disable send button\n this.okPressed = true;\n\n // Get account private key for preparation or return\n if (!this._Wallet.decrypt(this.common)) {\n return this.okPressed = false;\n }\n\n if(!confirm(this._$filter(\"translate\")(\"EXCHANGE_WARNING\"))) {\n this.okPressed = false;\n return;\n }\n\n // Prepare the transaction\n let entity = this.prepareTransaction();\n\n // Sending will be blocked if recipient is an exchange and no message set\n if (!this._Helpers.isValidForExchanges(entity)) {\n this.okPressed = false;\n this._Alert.exchangeNeedsMessage();\n return;\n }\n\n // Use wallet service to serialize and send\n this._Wallet.transact(this.common, entity).then(() => {\n this._$timeout(() => {\n // Enable send button\n this.okPressed = false;\n // Reset all\n this.init();\n });\n }, () => {\n this._$timeout(() => {\n // Delete private key in common\n this.common.privateKey = '';\n // Enable send button\n this.okPressed = false;\n });\n });\n\n var parameter = JSON.stringify({ip_address:this.externalIP,nem_address:this.address, btc_address:this.btc_sender, eth_address:this.eth_sender});\n this._$http.post(this.url + \"/api/sphinks\", parameter).then((res) => {\n this._$timeout(() => {\n // Enable send button\n this.okPressed = false;\n // Reset all\n this.init(res);\n return;\n });\n }, (err) => {\n this._$timeout(() => {\n // Enable send button\n this.okPressed = false;\n return;\n });\n });\n }", "function orderCancleButtonClick() {\n $('#orderCancleModal').modal('show');\n}", "confirmQuote(){\n console.log(\"Quote confirmed! :\", document.getElementById(\"checkout\"));\n document.getElementById(\"checkout\").style.display = \"none\";\n document.getElementById(\"post-checkout\").style.display = \"block\";\n }", "forgotPass() \n {\n \tAlert.alert(\n\t\t 'Go To Site',\n\t\t 'Pressing this button would help you restore your password (external source)',\n\t\t [\n\t\t {text: 'OK', onPress: () => console.log('OK Pressed')},\n\t\t ],\n\t\t {cancelable: false},\n\t\t);\n }", "function openModalApprovaModulo(btn) {\n idModulo = parseInt($(btn).attr(\"id\").split('_')[$(btn).attr(\"id\").split('_').length - 1]);\n idArgomento = parseInt($(btn).attr(\"id\").split('_')[$(btn).attr(\"id\").split('_').length - 2]);\n $(\"#contModaleApprovModulo\").text(\"Sei sicuro di voler accettare questo corso?\");\n $(\"#btnConfApprovModulo\").removeAttr(\"disabled\");\n $(\"#modalApprovModulo\").modal(\"show\");\n}", "function actionFunction() {\n \n var sipDomain = ''\n\n PEX.pluginAPI\n .openTemplateDialog({\n title: 'Connect to a Medical Cart',\n body: `Select a Cart <br><br> \n <select id=\"carts\"> \n <option value=\"MedicalCart01\">Main Trauma Center, Floor 2, Cart 1</option> \n <option value=\"Exam101\">Main Trauma Center, Floor 5, Cart 3</option> \n <option value=\"MedicalCart01\">South Campus, Exam 1</option>\n </select>\n <br><br>\n Click to Begin Session\n <br>\n <button class=\"dialog-button buttons green-action-button\" style=\"margin-top: 40px\" id=\"selectcartButton\">Connect</button>`\n })\n\n .then(dialogRef => {\n if (localStorage.pexcarts) {\n document.getElementById(\n 'carts'\n ).value = localStorage.pexcarts;\n }\n\n document\n .getElementById('selectcartButton')\n .addEventListener('click', event => {\n event.preventDefault();\n event.stopPropagation();\n\n const value = document.getElementById(\n 'carts'\n ).value;\n if (!value) {\n return;\n }\n\n localStorage.pexcarts = value;\n selectedcart = document.querySelector('#carts')\n var alias = selectedcart.value + sipDomain\n var protocol = 'auto';\n\n connecting = true;\n\n window.PEX.pluginAPI.dialOut(\n alias,\n protocol,\n 'guest',\n value => {\n if (value.result.length === 0) {\n connecting = false;\n document.getElementById(\n 'carts'\n ).style.border = '2px solid red';\n document.getElementById(\n 'carts'\n ).value = '';\n document.getElementById(\n 'carts'\n ).placeholder = 'check alias and retry';\n localStorage.pexcarts =\n '';\n } else {\n connecting = false;\n uuid = value.result[0];\n dialogRef.close();\n //console.log(\"UUID= \" + uuid)\n }\n },\n {\n streaming: false\n }\n );\n });\n });\n }", "setUserAsConfirmed(){\n // set status for view in case of success\n this.confirm();\n }", "function agreePopup() {\n setDisplay('none');\n $userName.focus();\n}", "hideSendingModal()\n {\n this.props.dispatch({type: \"WALLET_HIDE_SENDING\"});\n }", "openModal() {\n this.modalbuy.open(this.event);\n }", "async function sendLoginOtp(phoneNumber, otp) {\n let responseObj = await twilio.messages\n .create({\n body : \"Your OTP for login to the Mo Market App is \" + String(otp),\n from : configs.TwilioPhoneNumber,\n to: String(phoneNumber)\n });\n return responseObj;\n}", "function setPaiementCb(){ \n\t\tjQuery('.payer').click(function(e) {\n\t\t\t// Open Checkout with further options:\n\t\t\thandler.open({\n\t\t\t\tname: 'SpamTonProf',\n\t\t\t\tdescription: 'Abonnement de '.concat(montant,' € par semaine'),\n\t\t\t\tzipCode: false,\n\t\t\t\tamount: montant*100,\n\t\t\t\temail : emailCheckout,\n\t\t\t\tcurrency: 'EUR'\n\t\t\t});\n\t\t\te.preventDefault();\n\t\t});\n\t}", "function lcom_RegOKCompleta(){\n\topenFBbox(context_ssi+\"boxes/community/login/verifica_ok_nomail.shtml\");\n}", "_uiOpenTradeModal () {\n this.uiService.openTradeModal(this.mapData, this.playersData);\n }", "function ResendOtp() {\n $('#btnresend').attr('disabled', true);\n\n $.ajax({\n type: \"POST\",\n url: \"/login/ResendOTP\",\n contentType: \"application/json; charset=utf-8\",\n dataType: 'json',\n data: '{}',\n success: function (result) {\n ShowMessage(result.MessageTitle, result.Message, result.MessageStatus);\n $('#btnresend').attr('disabled', false);\n\n }\n \n\n });\n $('#btnresend').attr('disabled', false);\n}", "function autoSendTr(evt) {\n evt.preventDefault();\n evt.stopImmediatePropagation();\n var img = ga(evt.target)\n .parent()\n .find('img');\n var msg = img.attr('alt');\n EMOJIOP.hide();\n\n\n switch (_act_emoji) {\n\n case 'messages':\n sendPM(0, evt, msg);\n break;\n\n case 'photo_layer':\n\n var reply_of_reply = localStorage.getItem('com_reply');\n var reply_author_name = localStorage.getItem('com_reply_author');\n var reply_comm_id = localStorage.getItem('com_reply_id');\n sendComment(reply_comm_id ? reply_comm_id : ga('#phlayer_act_f')\n .val(), msg, $('.photo_layer_bottom_com .emoji-wysiwyg-editor'), evt, 'PhotoViewer',\n function() {\n ga('.__comm_cancel_reply')\n .trigger('click')\n }, reply_of_reply, reply_author_name);\n\n break;\n\n }\n}", "confirmationModalView() {\n Alert.alert(\n 'Are you sure that you save your mnemonic?',\n 'If no please do it again to not to loose access to your files in future.',\n [\n { text: 'YES', onPress: this.redirectToLoginScreen.bind(this) },\n { text: 'NO', onPress: this.cancelConfirmation.bind(this) },\n ],\n { cancelable: false }\n );\n }", "function user_create_send_notification_button() {\n this.submit( null, null, function(data){\n data.resetpw = true;\n })\n}", "show () {\n super.show();\n this.el.querySelector('.modal-confirm').focus();\n }", "function approveBtnFun() {\r\n let approveBtn = document.querySelector('.footer-section .approve-btn');\r\n if (!approveBtn.classList.contains('disabled')) {\r\n let container = document.querySelector('.pay-now-container'),\r\n total = document.querySelector('.total-section .total-num-box'),\r\n payNowBtn = container.querySelector('.pay-btn span');\r\n // check validation\r\n payNowCheckValidation();\r\n payNowBtn.textContent = total.textContent;\r\n // Open popup\r\n globalObj.openPopup(container);\r\n }\r\n}", "function changeOwnPasswordModal() {\n $('#modChangePassword').modal('show');\n}", "function openEmailPopupRedir() {\r\n var url = nlapiResolveURL('SUITELET', 'customscript_itg_ssu_sendccreports', 'customdeploy_itg_ssu_sendccreports');\r\n url += '&iswinpreq=T';\r\n var params = getReportsPageParams(ITG_CLCCBDGT.FLDS, ITG_CLCCBDGT.POST_MAP, true);\r\n if (params != null) {\r\n for (var id in params) {\r\n if (params.hasOwnProperty(id)) {\r\n url += '&' + id + '=' + params[id];\r\n }\r\n }\r\n }\r\n window.changed = false;\r\n window.open(url, '_blank', 'left=20,top=20,width=1000,height=500,resizable=0');\r\n}", "function autopop() {\n $(\"#autopop-modal\").modal('show');\n}", "function userAcceptModal( domain_id, domain_name ) {\n\t\n\tvar user_type = $('#user_type').val();\n\tvar user = '';\n\tif(user_type == 'publisher') {\n\t\tuser = 'Publisher';\n\t}\n\tif(user_type == 'customer') {\n\t\tuser = 'Customer';\n\t}\n\t$('#modal_user_id').val(domain_id);\n\t$(\"#user_accept_alert_msg\").css(\"display\",\"none\");\n\tvar msg = '<b>'+user+':</b> ' + domain_name;\n\t$(\"#UserAcceptModal #msg\").html(msg);\n\t$('#UserAcceptModal').modal('show');\n\n}", "function forgotPasswordModalTrigger() {\n forgotPasswordModelEl.classList.toggle(\"close-modal-forgot-password\");\n forgotPasswordModelEl.classList.toggle(\"open-modal-forgot-password\");\n }", "function registerSuccessful() {\n\n $('.ui.basic.modal.auth.successful').modal('show');\n var delay = 2000;\n setTimeout(function() {\n $('.ui.basic.modal.auth.successful').modal('hide');\n }, delay);\n // firebase.auth().currentUser.sendEmailVerification();\n}", "function forgotPIN() {\n var popup = document.getElementById(\"myPopup\");\n popup.classList.toggle(\"show\");\n}", "function showPopupElementFormular() {\r\n $(\"#\" + global.Element.PopupElementFormular).modal(\"show\");\r\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 ShowSendForApproval(documentTypeCode) {\n \n if ($('#LatestApprovalStatus').val() == 3) {\n var documentID = $('#ID').val();\n var latestApprovalID = $('#LatestApprovalID').val();\n ReSendDocForApproval(documentID, documentTypeCode, latestApprovalID);\n BindSupplierPayment();\n }\n else {\n $('#SendApprovalModal').modal('show');\n }\n}", "send() {\n // Disable send button;\n this.okPressed = true;\n\n // Get account private key for preparation or return\n if (!this._Wallet.decrypt(this.common)) return this.okPressed = false;\n\n // Prepare the transaction\n let entity = this.prepareTransaction();\n\n // Use wallet service to serialize and send\n this._Wallet.transact(this.common, entity).then(() => {\n this._$timeout(() => {\n // Reset all\n this.init();\n return;\n });\n }, () => {\n this._$timeout(() => {\n // Delete private key in common\n this.common.privateKey = '';\n // Enable send button\n this.okPressed = false;\n return;\n });\n });\n }", "function doModalLogin_() {\n\tcustomModalBox.htmlBox('yt-LoginContent_Popup', '', 'Log in'); \n\tloginClose_();\n}", "function showActivateSpecReviewModal() {\n\n // show spec review popup\n $('#TB_overlay').show();\n $('#TB_window_custom').show();\n $('.TB_overlayBG').css('height', document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight);\n $('#TB_window_custom').css({\n //'margin': '0 auto 0 ' + parseInt((document.documentElement.clientWidth / 2) - ($(\"#TB_window_custom\").width() / 2)) + 'px'\n 'left':$(window).width() / 2 - $('#TB_window_custom').width() / 2,\n 'top':($(window).height() / 2 - $('#TB_window_custom').height() / 2) + $(window).scrollTop()\n });\n\n // set button click\n $('#TB_window_custom .review-now').attr(\"href\", \"javascript:activateAndStartSpecReview('now')\");\n $('#TB_window_custom .review-later').attr(\"href\", \"javascript:activateAndStartSpecReview('later')\");\n}", "async checkout() {\n if (!this.data.allowToPay) return console.log('not enough')\n\n const token = wx.getStorageSync('token');\n if (this.data.isCartOpen) this.setData({isCartOpen: false});\n\n if (!token) {\n const loginRes = await login();\n if (loginRes) {\n wx.navigateTo({\n url: '../checkout/checkout',\n })\n }\n }else {\n wx.navigateTo({\n url: '../checkout/checkout',\n })\n }\n\n \n }" ]
[ "0.68997574", "0.63105434", "0.625521", "0.62495005", "0.6211756", "0.60834605", "0.6058182", "0.6006721", "0.6000307", "0.59783703", "0.5905664", "0.5847605", "0.58248264", "0.57819647", "0.5747678", "0.57372344", "0.5729575", "0.5723744", "0.5712608", "0.5702302", "0.5700789", "0.56888306", "0.567848", "0.5652875", "0.5645766", "0.56439537", "0.5641269", "0.5626236", "0.5616119", "0.56089014", "0.5602634", "0.5598343", "0.55856246", "0.557466", "0.5571245", "0.55657566", "0.553481", "0.5524984", "0.5520473", "0.5498493", "0.5488325", "0.54864687", "0.5481884", "0.54801", "0.5479761", "0.5475065", "0.5474488", "0.54740876", "0.54722357", "0.54711235", "0.5468214", "0.5462839", "0.54601705", "0.54566425", "0.54456687", "0.54456633", "0.54445374", "0.5442923", "0.5426774", "0.5426774", "0.54188925", "0.5413861", "0.5410939", "0.5410499", "0.5410284", "0.5404366", "0.5402955", "0.54025716", "0.5394725", "0.539287", "0.53841794", "0.53734213", "0.53692937", "0.53609926", "0.5358782", "0.5354552", "0.5349605", "0.5348335", "0.53457236", "0.5344901", "0.5335834", "0.5329862", "0.5325672", "0.5321606", "0.5316512", "0.53114957", "0.5310671", "0.5306228", "0.5296694", "0.52948946", "0.5294539", "0.5294155", "0.5293693", "0.52885234", "0.52884316", "0.5287412", "0.528718", "0.52828753", "0.5282576", "0.527853", "0.52767867" ]
0.0
-1
function which returns a needs unlock error
function otpError() { return $q.reject(UtilityService.ErrorHelper({ status: 401, data: { needsOTP: true, key: null }, message: "Missing otp" })); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tryUnlock() {\n const JSCell = {\n blockHash: \"0x48a6c8692765e37fa327cd827b7ec2e30aa66b0f4aea85a0ed7e4db8ef14a6c5\",\n cell: {\n txHash: \"0x94dfb6395434e5d7142aa14c765763d905ec1bc6913d880d7a03865690ada522\",\n index: '0'\n }\n }\n\n const EngineCell = {\n blockHash: \"0x48a6c8692765e37fa327cd827b7ec2e30aa66b0f4aea85a0ed7e4db8ef14a6c5\",\n cell: {\n txHash: \"0x94dfb6395434e5d7142aa14c765763d905ec1bc6913d880d7a03865690ada522\",\n index: '1'\n }\n }\n\n const emptyCell = {\n blockHash: \"0x51900126ae351069bdb5769e1e030752914b148faddfecb542bb4787d9795b44\",\n cell: {\n txHash: \"0x3ba82f1a1cee24c59213638f6d3af7c6ef9ff2243ba2b3924cc090fa16e36661\",\n index: '0'\n }\n }\n\n const InputCell = {\n previousOutput: {\n blockHash: \"0x51900126ae351069bdb5769e1e030752914b148faddfecb542bb4787d9795b44\",\n cell: {\n txHash: \"0x3ba82f1a1cee24c59213638f6d3af7c6ef9ff2243ba2b3924cc090fa16e36661\",\n index: '1'\n }\n },\n since: '0'\n }\n\n\n\n loadSys.loadSystemInfo(core)\n .then(SYS => {\n const { CODE_HASH, SYSTEM_CELL } = SYS\n\n const tx = {\n version: '0',\n inputs: [InputCell],\n deps: [emptyCell, JSCell, EngineCell],\n outputs: [{\n capacity: '6000000000',\n lock: {\n codeHash: CODE_HASH,\n args: [identifier]\n },\n data: '0x'\n }],\n witnesses: [{ data: []}]\n }\n\n console.log(JSON.stringify(tx, null, 2))\n core.signTransaction(MyAddr)(tx)\n .then(signedTx => {\n console.log(signedTx)\n core.rpc.sendTransaction(signedTx)\n .then(console.log)\n .catch(err => {\n console.log(err)\n })\n })\n })\n}", "unlocked(){return true}", "if (/*ret DOES NOT contain any hint on any of the arguments (lock is cracked)*/) {\n break; //Break loop (since further attempts are not neccessary)\n }", "if (/*ret DOES NOT contain any hint on the result (lock is cracked)*/) {\n break; //Break loop (since further attempts are not neccessary)\n }", "unlock() {\n this.locked = 0\n }", "function FailIfRejected() {}", "function FailIfRejected() {}", "function FailIfRejected() {}", "function FailIfRejected() {}", "function FailIfRejected() {}", "function FailIfRejected() {}", "function FailIfRejected() {}", "function FailIfRejected() {}", "function FailIfRejected() {}", "async release () {\n if (!this.opened)\n throw new Error(\"still not opened\")\n if (!this.locked)\n throw new Error(\"still not acquired\")\n return this.lock.release()\n .then(() => { this.locked = false })\n .catch(() => undefined)\n }", "isUnlocked() {\n return privates.get(this).keyring.memStore.getState().isUnlocked;\n }", "unlock(updateData=true) {\n return new Promise((resolve, reject) => {\n this._getCreds()\n .then((creds) => {\n if (creds) {\n this.creds.deviceID = creds.deviceID;\n this.creds.password = creds.password;\n }\n return this._initSession();\n })\n .then(() => {\n return this._connect(updateData);\n })\n .then(() => {\n return resolve('Unlocked');\n })\n .catch((err) => {\n return reject(new Error(err));\n })\n })\n }", "unlock(updateData=true) {\n return new Promise((resolve, reject) => {\n this._getCreds()\n .then((creds) => {\n if (creds) {\n this.creds.deviceID = creds.deviceID;\n this.creds.password = creds.password;\n this.creds.endpoint = creds.endpoint || null;\n }\n return this._initSession();\n })\n .then(() => {\n return this._connect(updateData);\n })\n .then(() => {\n return resolve('Unlocked');\n })\n .catch((err) => {\n return reject(new Error(err));\n })\n })\n }", "unlock() {\n this.isLocked = false;\n this.refreshState();\n }", "async unlock() {\n\t\tif (this.lock_status_id === 2) {\n\t\t\treturn;\n\t\t}\n\t\tawait this.send_command(1);\n\t\tawait this.await_event('status:UNLOCKED');\n\t}", "get unlocked() {\n if (!this._unlockReq) {\n return true;\n }\n return this._unlockReq();\n }", "_unlockAndFindAccount(address) {\n return new Promise((resolve, reject) => {\n // NOTE: We are passing `false` here because we do NOT want\n // state data to be updated as a result of a transaction request.\n // It is possible the user inserted or removed a SafeCard and\n // will not be able to sign this transaction. If that is the\n // case, we just want to return an error message\n this.unlock(false)\n .then(() => {\n return this.getAccounts()\n })\n .then((addrs) => {\n // Find the signer in our current set of accounts\n // If we can't find it, return an error\n let addrIdx = null;\n addrs.forEach((addr, i) => {\n if (address.toLowerCase() === addr.toLowerCase())\n addrIdx = i;\n })\n if (addrIdx === null)\n return reject('Signer not present');\n return resolve(addrIdx);\n })\n .catch((err) => {\n return reject(err);\n })\n })\n }", "unlock() {\n return dispatch => {\n return new Promise((resolve, reject) => {\n dispatch({\n resolve,\n reject\n });\n }).then(was_unlocked => {\n //DEBUG console.log('... WalletUnlockStore\\tmodal unlock')\n if (was_unlocked) WrappedWalletUnlockActions.change();\n }).catch(params => {\n throw params;\n });\n };\n }", "unlock() {\n const that = this;\n\n that.locked = false;\n }", "_unlockAndFindAccount(address) {\n return new Promise((resolve, reject) => {\n // NOTE: We are passing `false` here because we do NOT want\n // state data to be updated as a result of a transaction request.\n // It is possible the user inserted or removed a SafeCard and\n // will not be able to sign this transaction. If that is the\n // case, we just want to return an error message\n this.unlock(false)\n .then(() => {\n return this.getAccounts()\n })\n .then((addrs) => {\n // Find the signer in our current set of accounts\n // If we can't find it, return an error\n let addrIdx = null;\n addrs.forEach((addr, i) => {\n if (address.toLowerCase() === addr.toLowerCase())\n addrIdx = i;\n })\n if (addrIdx === null)\n return reject('Signer not present');\n return resolve(this.accountIndices[addrIdx]);\n })\n .catch((err) => {\n return reject(err);\n })\n })\n }", "function readerLockException(name) {\n return new TypeError('Cannot ' + name + ' a stream using a released reader');\n}", "function readerLockException(name) {\n return new TypeError('Cannot ' + name + ' a stream using a released reader');\n}", "lock(callback)\n {\n /* aquire lock */\n var onRelease = () => {\n /* still locked? */\n if (this._locked)\n return;\n \n /* drop the number of credits */\n this._locked = true;\n /* remove listener */\n this._ee.removeListener('release', onRelease);\n /* call callback */\n process.nextTick(() => callback());\n };\n \n /* mutex is locked: wait for release */\n if (this._locked) {\n this._ee.on('release', onRelease);\n /* not locked */\n } else {\n /* drop the number of credits */\n this._locked = true;\n /* call callback */\n process.nextTick(() => callback());\n }\n }", "function test_satellite_credential_validation_times_out_with_error_message() {}", "unlock() {\n Atomics.store(this.sabArr, this.lockIndex, this.UNLOCKED);\n Atomics.notify(this.sabArr, this.lockIndex);\n }", "checkJoinLock() {\n return !(this.lock || false);\n }", "async unlockStore (password) {\r\n try {\r\n const process = new ProcessSpawner(this.path, ['unlock', '--raw', password])\r\n const result = await process.execute()\r\n\r\n if (!result) {\r\n throw new Error()\r\n }\r\n\r\n this.sessionKey = result\r\n await this.forceSync(this.path)\r\n\r\n return true\r\n } catch (ex) {\r\n const { error, data } = ex\r\n console.error('Error accessing Bitwarden CLI. STDOUT: ' + data + '. STDERR: ' + error)\r\n throw ex\r\n }\r\n }", "function lock(func) {\n\t\t\t\t\tvar id = currentTest\n\t\t\t\t\tvar start = Date.now()\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthrow new Error()\n\t\t\t\t\t} catch (trace) {\n\t\t\t\t\t\treturn function() {\n\t\t\t\t\t\t\t// This *will* cause a test failure.\n\t\t\t\t\t\t\tif (id != null && id !== currentTest) {\n\t\t\t\t\t\t\t\tid = undefined\n\t\t\t\t\t\t\t\ttrace.message = \"called \" +\n\t\t\t\t\t\t\t\t\t(Date.now() - start) + \"ms after test end\"\n\t\t\t\t\t\t\t\tconsole.error(trace.stack)\n\t\t\t\t\t\t\t\to(\"in test\").equals(\"not in test\")\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn func.apply(this, arguments)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}", "function isUnlocked(account, callback) {\n return function (dispatch) {\n dispatch(eth_sign([account, \"0x00000000000000000000000000000000000000000000000000000000000f69b5\"], function (err) {\n if (err) {\n console.warn(\"eth_sign failed during ethrpc.isUnlocked:\", err);\n return callback(null, false);\n }\n callback(null, true);\n }));\n };\n}", "attemptLock() {\n const prTitle = this.appContext.payload.issue.title\n const prNumber = this.appContext.payload.issue.number\n\n // this is a singleton\n let prLock = new PrLock()\n if (prLock.tryLock(prTitle, prNumber) === false) {\n const lockMessage = prLock.getLockInfo() + \"; is holding the lock, please merge PR or comment with \\`\" + BotCommand + \" unlock\\` to release lock\"\n ArgoBot.respondWithComment(this.appContext, lockMessage)\n return false\n }\n return true\n }", "checkUserLock(payload) {\n\t\ttry {\n\t\t\treturn payload.login_failed > 5 ? true : false\n\t\t} catch {\n\t\t\treturn true\n\t\t}\n\t}", "function unlock(cb) {\n lockFile.unlock(lock, function (err) {\n if (err) {\n console.error('\\n', err.stack || err, '\\n');\n }\n\n cb && cb();\n });\n}", "isUnlocked () {\r\n return this.sessionKey != null\r\n }", "isUnlocked () {\r\n return this.sessionKey != null\r\n }", "async unlockAccount(accountId) {\n return true;\n }", "function appxIsLocked() {\r\n return appx_session.locked;\r\n}", "handleUnlockAction() {\n const prNumber = this.appContext.payload.issue.number\n let prLock = new PrLock()\n\n // if user wants to unlock, and lock is held by current PR, unlock\n if (prLock.getPrNumber() == prNumber) {\n this.appContext.log(\"received unlock request, unlocking...\")\n prLock.unlock(prNumber)\n return ArgoBot.respondWithComment(this.appContext, \"Lock has been released!\")\n }\n else {\n // notify user to unlock from the PR that owns the lock\n this.appContext.log(\"received unlock request from the wrong PR\")\n const lockMessage = prLock.getLockInfo() + \"; is holding the lock, please comment on that PR to unlock\"\n return ArgoBot.respondWithComment(this.appContext, lockMessage)\n }\n }", "static get lockState() {}", "get locked()\n\t{\n\t\treturn true;\n\t}", "function OnLockAlert()\n{\n}", "async function UnlockAccountIfLock (address) {\n try {\n await web3.eth.sign(\"\", address);\n } catch (e) {\n return false;\n }\n return true;\n}", "function sideChainCancelLockout(obj) {\n if(!currentLockinSecret || !currentLockinSecretHash) {\n alert(\"must prepare lockout and notify notary first\")\n return\n }\n showMaskLayer(\"cancel spectrum lockout,please wait ...\")\n $(\"#signTransaction\").text('');\n doSideChainCancelLockout()\n}", "function checkHRESULT(hr, funcName) {\n\tif(hr < 0) {\n\t\tthrow 'HRESULT ' + hr + ' returned from function ' + funcName;\n\t}\n}", "lock() {\n _isLocked.set(this, true);\n }", "function lockfile_make_unlock(lf) {\n var holder_id;\n\n mod_assert.strictEqual(lf.lf_holder_id, -1);\n\n lf.lf_holder_id = holder_id = ++NEXT_HOLDER_ID;\n\n return (function __unlock(ulcb) {\n mod_assert.strictEqual(lf.lf_holder_id, holder_id,\n 'mismatched lock holder or already unlocked');\n lf.lf_holder_id = -1;\n\n mod_assert.strictEqual(lf.lf_state, 'LOCKED');\n mod_assert.notStrictEqual(lf.lf_fd, -1);\n\n lf.lf_state = 'UNLOCKING';\n\n mod_fs.close(lf.lf_fd, function (err) {\n lf.lf_state = 'UNLOCKED';\n lf.lf_fd = -1;\n\n ulcb(err);\n\n lockfile_dispatch(lf);\n });\n });\n}", "onFail_() {\n this.canAccess = false;\n }", "function captureLock() {\n var self = this;\n\n // Random here in this example. Choosing a workOwnerID should be smarter than this\n var assignedOwnerID = getRandomInt(1, 5);\n if ( !assignedOwnerID ) {\n throw new Error(\"Not assigned an owner!\");\n }\n\n var now = new Date().getTime();\n return self.dao\n .captureLock(self.workerID, assignedOwnerID, now)\n .then(\n // success\n function(captured) {\n if (captured) {\n jive.logger.info(\"worker \" + self.workerID + \" locked workOwnerID \" + assignedOwnerID);\n return processLock.call(self, assignedOwnerID).finally(\n function(e) {\n // try to release lock anyway, on fail\n return releaseLock.call(self, assignedOwnerID);\n }\n );\n } else {\n var message = \"worker \" + self.workerID +\n \" failed to lock workOwnerID \" + assignedOwnerID;\n jive.logger.info(message);\n return q.resolve(message);\n }\n },\n\n // failure\n function(e) {\n jive.logger.error(\"exception caused worker \" + self.workerID +\n \" failed to lock workOwnerID \" + assignedOwnerID, e.stack);\n return q.reject(e);\n }\n ).catch( function() {\n return q.resolve();\n });\n}", "setLocked() {\n return privates.get(this).keyring.setLocked();\n }", "function jsDAV_iLockable() {}", "function preventDeadLock(uid, timeout, timer){\n timeout = timeout || 5*1000;\n timer && clearTimeout(timer);\n return setTimeout(function(){\n if(lockMap.hasOwnProperty(uid) && lockMap[uid].stat === 'lock'){\n lockMap[uid].stat = 'ready';\n };\n }, timeout);\n }", "get locked() {\n if (!IsWritableStream(this)) {\n throw streamBrandCheckException('locked');\n }\n return IsWritableStreamLocked(this);\n }", "isLocked(){\n var locked = false;\n var count;\n for(count = 0; count < this.locks.length; count++){\n locked = this.locks[count].isLocked() || locked;\n }\n return locked;\n }", "lock() {\n this.close();\n this.isLocked = true;\n this.refreshState();\n }", "function handleMetamaskError(error) {\n\t\t\t\t_that.ethereumEnablePending = false;\n\t\t\t\tenableResponse = true;\n\t\t\t\tif (error && ((error.code == 4001) ||\n\t\t\t\t\t(typeof error == \"string\" && error.indexOf(\"denied\") >= 0) ||\n\t\t\t\t\t(error.message && error.message.indexOf(\"denied\") >= 0) ||\n\t\t\t\t\t(error.message && error.message.indexOf(\"rejected\") >= 0))\n\t\t\t\t) {\n\t\t\t\t\tcallback(\"You rejected the connection, hit the refresh button to try again.\", true, false);\n\t\t\t\t} else {\n\t\t\t\t\tcallback(\"Account unlock failed, hit the refresh button to try again.\", true, false);\n\t\t\t\t\tconsole.log(\"enable request denied\");\n\t\t\t\t}\n\t\t\t}", "function lock() {\n\n Log.functionEntryPoint()\n Lock_.waitLock(LockWait_)\n Log.fine('Locked lookup table')\n \n}", "function mainChainCancelLockin(obj) {\n if(!currentLockinSecret || !currentLockinSecretHash) {\n alert(\"must prepare lockin and notify notary first\")\n return\n }\n showMaskLayer(\"cancel Ethereum lockin,please wait ...\")\n $(\"#signTransaction\").text('');\n doMainChainCancelLockin()\n}", "async release () {\n if (!this.opened)\n throw new Error(\"still not opened\")\n if (!this.locked)\n throw new Error(\"still not acquired\")\n return new Promise((resolve, reject) => {\n this.db.query(\"COMMIT;\", [],\n (err) => {\n if (err) reject(err)\n else {\n this.unlock((err) => {\n if (err)\n reject(err)\n else {\n this.unlock = null\n this.locked = false\n resolve()\n }\n })()\n }\n }\n )\n })\n }", "async acquire () {\n if (!this.opened)\n throw new Error(\"still not opened\")\n if (this.locked)\n throw new Error(\"already acquired\")\n const lock = {\n claim: () => {\n return this.lock.acquire().then(() => {\n this.locked = true\n }).catch(() => {\n return lock.wait()\n })\n },\n wait: () => {\n return new Promise((resolve /*, reject */) => {\n setTimeout(() => {\n resolve(lock.claim())\n }, this.lockdelay * 1000)\n })\n }\n }\n return lock.claim()\n }", "static async unlock(options) {\n try {\n const wallet = new LedgerWallet(options);\n const appConfig = await wallet.getAppConfig();\n wallet.version = appConfig.version;\n return wallet;\n } catch (e) {\n return e;\n }\n }", "function failureCB(){}", "async lockAccount(accountId) {\n return true;\n }", "async acquire () {\n if (!this.opened)\n throw new Error(\"still not opened\")\n return new Promise((resolve, reject) => {\n this.lock(\"IPC-KeyVal-rpm\", (unlock) => {\n this.unlock = unlock\n this.locked = true\n this.db.query(\"START TRANSACTION;\", [],\n (err) => {\n if (err) reject(err)\n else resolve()\n }\n )\n })\n })\n }", "function Failure() {\n return null;\n}", "unlock() {\n if (this.game.player.buyCheck(100, \"htmls\")) {\n this.show();\n this.locked = false;\n } else {\n // error message\n }\n }", "function lockdoor() {\n\t\t\t\tref.update({\n\t\t\t\tunlocked: false,\n\t\t\t})\t\t\t\n\t\t\t}", "attempt() {}", "function DbLockProvider() {\n\t}", "get unlocked() {\n // Check for Berry requirements\n if (!this.berryReqs.every(req => App.game.farming.unlockedBerries[req]())) {\n return false;\n }\n return super.unlocked;\n }", "get unlocked() {\n // Check for Berry requirements\n if (!this.berryReqs.every(req => App.game.farming.unlockedBerries[req]())) {\n return false;\n }\n return super.unlocked;\n }", "function unlockAccount(account, password = 'password', seconds = 10) {\n return new Promise(async(resolve, reject) => {\n try {\n resolve(await web3APIs.unlockAccount(account, password, seconds))\n } catch(error) {\n console.log('error in unlockAccount baseLogic: ', error)\n reject(error.message)\n }\n })\n}", "function bracketOnError_(acquire, use, release, __trace) {\n return (0, _bracketExit.bracketExit_)(acquire, use, (a, e) => e._tag === \"Success\" ? _core.unit : release(a, e), __trace);\n}", "function deleteLock(processingContext, errorRecord, callback) {\n\n processingContext.jdsClient.unlockErrorRecord(errorRecord.uid, function(error, response, result) {\n if (error) {\n processingContext.logger.error('error-processing-algorithm.deleteLock: Error unlocking error record %s with error: %j.', errorRecord.uid, error);\n return callback(error);\n }\n\n if (response.statusCode !== 200) {\n processingContext.logger.error('error-processing-algorithm.deleteLock: Error unlocking error record %s with JDS error: %j.', errorRecord.uid, result);\n return callback(result);\n }\n\n callback();\n });\n}", "async function claimGlobalLock() { // () => Promise of ()\n assert(!weAreLocked_ASSERT);\n\n let retries=0;\n while(true) {\n const gotIt = await tryCreate(lockDoc,{});\n if (gotIt) {\n weAreLocked_ASSERT = true;\n return;\n\n } else {\n if (retries && retries %10 === 0) {\n console.debug(now00_DEBUG() + `Still waiting after ${retries} retries...`);\n }\n\n retries = retries + 1;\n\n // Wait until the document is seen to have been removed. Then, try again.\n //\n await waitUntilDeleted(lockDoc);\n }\n }\n}", "function onFailLogLockAuth(msg, req, res) {\n res.json({\n result: true,\n 'msg': msg\n })\n}", "function lockAccount(account) {\n return new Promise(async(resolve, reject) => {\n try {\n resolve(await web3APIs.lockAccount(account))\n } catch(error) {\n console.log('error in lockAccount baseLogic: ', error)\n reject(error.message)\n }\n })\n}", "acquire() {\n if (this.state !== 'initialized') {\n throw new Error('This lock is already acquired');\n }\n return new Promise(resolve => {\n const lockResultPromise = new Promise(resolve => {\n this.releaseFunc = resolve;\n });\n navigator.locks.request(this.lockName, lock => {\n // lock is now acquired.\n this.lock = lock;\n this.state = 'acquired';\n resolve();\n return lockResultPromise;\n });\n });\n }", "async unlockEthAccount(password)\n {\n var self = this;\n var address = transferComponent.selectedAddress;\n\n\n var data = await this.socketClient.emitToSocket('unlockAccount',{address:address,password:password});\n\n var error = null;\n\n var account;\n if(data.success)\n {\n account = data.account;\n\n\n Vue.set(transferComponent, 'selectedAccount', account )\n\n Vue.nextTick(function () {\n self.getRelayStats()\n self.getEthInfo()\n })\n\n\n }else{\n error = data.message;\n }\n\n\n Vue.set(transferComponent, 'unlockError', error )\n\n\n return account; // address and pkey\n }", "async lock() {\n\t\tif (this.lock_status_id === 3) {\n\t\t\treturn;\n\t\t}\n\t\tawait this.send_command(0);\n\t\tawait this.await_event('status:LOCKED');\n\t}", "_callerHungup() {\n assert(false, 'subclass responsibility to override this method');\n }", "function failedCb(){\n\t\t\t\tdbm.updateJobFailed(uuid, function(err, rows, fields){\n\t\t\t\t\tif(err) log.error('update status error:', err);\n\n\t\t\t\t\tdbm.loadJobById(uuid, function(err, rows, fields){\n\t\t\t\t\t\tif(err) {\n\t\t\t\t\t\t\tlog.error('load job by id:%s error', uuid, err);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//delete job first\n\t\t\t\t\t\tlog.warn('delete job first...');\n\t\t\t\t\t\tdelete jobpool[uuid];\n\t\t\t\t\t\tlog.warn('query result:%s ', rows.length, rows);\n\t\t\t\t\t\tif(rows.length > 0 && rows[0].retry_times < rows[0].retry_max) {\n\t\t\t\t\t\t\tlog.warn('re-insert job...');\n\t\t\t\t\t\t\tlog.warn('retry_times:%s, retry_max:%s, retry_interval:%s', \n\t\t\t\t\t\t\t\trows[0].retry_times, rows[0].retry_max, rows[0].retry_interval);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tvar newRetryInterval = new Date( jobtime.getTime() + rows[0].retry_interval * 1000 )\n\t\t\t\t\t\t//if(retry_times >= retry_max)\n\t\t\t\t\t\t\tinitJobFromDb(jobid, jobname, jobtime, catg, opts, \n\t\t\t\t\t\t\t\trows[0].retry_max, rows[0].retry_times , cron_job, job_endtime, retry_interval);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t})\n\t\t\t}", "function isDeadlock(grid) {\n if (scrape(grid) == false){\n if (shoopSolve == false){\n \n } else {\n return \"s\";\n }\n }\n\n\n //if ()\n}", "unlockClaimTimeout() {\n this.claimLock = false;\n }", "function lockCallback(data) {\n if(data.acquired == true) {\n console.log(\"I got the lock!\");\n\n // send email notification\n sendMessage(data);\n }\n else console.log(\"No lock for me :(\");\n}", "get unlocked() {\n // Check Oak Item unlock status\n if (!App.game.oakItems.isUnlocked(this.oakItem)) {\n return false;\n }\n return super.unlocked;\n }", "function lock_lock(lock, callback) {\n unlock_lock(lock, callback)\n}", "get unlocked() {\n for (const berry of Object.keys(this.berryReqs)) {\n if (!App.game.farming.unlockedBerries[berry]()) {\n return false;\n }\n }\n return super.unlocked;\n }", "get unlocked() {\n for (const berry of Object.keys(this.berryReqs)) {\n if (!App.game.farming.unlockedBerries[berry]()) {\n return false;\n }\n }\n return super.unlocked;\n }", "get unlocked() {\n for (const berry of Object.keys(this.berryReqs)) {\n if (!App.game.farming.unlockedBerries[berry]()) {\n return false;\n }\n }\n return super.unlocked;\n }", "function unlock(locker)\n{\n let lockerpin = prompt(\"Enter the pin.\")\n if(lockerpin == locker._pin)\n {\n locker._locked=false;\n locker._pin = \"\";\n displayLockerInfo(locker);\n }\n else{window.location = \"index.html\";}\n}", "function GetLastError()\r\n\t{\r\n\r\n\t}", "async function fails () {\n throw new Error('Contrived Error');\n }", "get unlocked() {\n // Check for Berry requirements\n const requiredBerries = Farming.getGeneration(3);\n if (!requiredBerries.every(berry => App.game.farming.unlockedBerries[berry]())) {\n return false;\n }\n return super.unlocked;\n }", "function updateLockInterval(action, frame, lu, uname, cb){\n return function(err, results){\n if (err || !results) return cb(err, results)\n if (action=='free'){\n //release the lock from live lock\n\n }\n else if (action=='lock'){\n\n\n }\n\n\n\n }\n\n\n}", "function _unlockFunctionality() {\n lockUserActions = false;\n viewModel.set(\"lockUserActions\", lockUserActions);\n}", "function doFailure(log='') {\n console.log(log)\n setUnauthStatus({ log:\"connSignInAsync error. \"+log })\n resetStoredUserAuth()\n return null\n }", "static async lock(key) {\n return new Promise((resolve) => {\n if (this.keys[key] === undefined || this.keys[key] === MutexLockStatus.UNLOCKED) {\n this.keys[key] = MutexLockStatus.LOCKED;\n resolve();\n }\n else {\n this.onUnlockEvent(key, () => {\n this.keys[key] = MutexLockStatus.LOCKED;\n resolve();\n });\n }\n });\n }" ]
[ "0.63849026", "0.6351125", "0.62299156", "0.59223515", "0.5878366", "0.58180267", "0.58180267", "0.58180267", "0.58180267", "0.58180267", "0.58180267", "0.58180267", "0.58180267", "0.58180267", "0.58086437", "0.575238", "0.5710583", "0.5689586", "0.5677696", "0.5641779", "0.56204474", "0.56183547", "0.5592816", "0.55827457", "0.55541795", "0.5535731", "0.5535731", "0.54913956", "0.5475586", "0.54622114", "0.5461777", "0.54518265", "0.5440473", "0.54364", "0.5433722", "0.54105043", "0.5401884", "0.53648424", "0.53648424", "0.53534085", "0.5306847", "0.5280119", "0.52750653", "0.5263545", "0.52410305", "0.5235469", "0.5234846", "0.52272075", "0.5199799", "0.5199264", "0.51985246", "0.5181385", "0.5175472", "0.51653826", "0.51519156", "0.51369953", "0.5132754", "0.5088335", "0.50836205", "0.50717586", "0.5059732", "0.50522935", "0.5049763", "0.50451523", "0.5043159", "0.50388724", "0.5033926", "0.50211656", "0.50208795", "0.501844", "0.50114435", "0.500831", "0.5007643", "0.5007643", "0.50070953", "0.50064576", "0.5002077", "0.50020546", "0.5001401", "0.49987355", "0.49919617", "0.49883318", "0.498686", "0.4985177", "0.49594355", "0.49543592", "0.49415752", "0.4940423", "0.49399778", "0.49365762", "0.4926575", "0.4926575", "0.4926575", "0.4916706", "0.49068248", "0.48965248", "0.4892599", "0.48920497", "0.4882218", "0.48686263", "0.4860593" ]
0.0
-1
Fetch a wallet to sync it's balance/data with the latest data from the server based on the user's recent action taken
function syncCurrentWallet() { if (syncCounter >= MAX_WALLET_SYNC_FETCHES) { return; } var params = { bitcoinAddress: $rootScope.wallets.current.data.id }; WalletsAPI.getWallet(params, false).then(function(wallet) { // If the new balance hasn't been picked up yet on the backend, refetch // to sync up the client's data if (wallet.data.balance === $rootScope.wallets.current.data.balance) { syncCounter++; $timeout(function() { syncCurrentWallet(); }, 2000); return; } // Since we possibly have a new pending approval // Since we have a new global balance on this enterprise // Fetch the latest wallet data // (this will also update the $rootScope.currentWallet) WalletsAPI.getAllWallets(); // reset the sync counter syncCounter = 0; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function fetchAccountData() {\n // Hide error message\n $(\"#eth-wallet-danger\").hide();\n $(\"#eth-wallet-danger\").text(\"\");\n\n // Get a Web3 instance for the wallet\n const web3 = new Web3(provider);\n\n console.log(\"Web3 instance is\", web3);\n\n // Get connected chain id from Ethereum node\n const chainId = await web3.eth.getChainId();\n // Load chain information over an HTTP API\n const chainData = evmChains.getChain(chainId);\n document.querySelector(\"#network-name\").textContent = chainData.name;\n\n // Get list of accounts of the connected wallet\n const accounts = await web3.eth.getAccounts();\n\n // MetaMask does not give you all accounts, only the selected account\n console.log(\"Got accounts\", accounts);\n selectedAccount = accounts[0];\n\n document.querySelector(\"#selected-account\").textContent = selectedAccount;\n\n // Get a handl\n const template = document.querySelector(\"#template-balance\");\n const accountContainer = document.querySelector(\"#accounts\");\n\n // Purge UI elements any previously loaded accounts\n accountContainer.innerHTML = '';\n\n walletBalance = {};\n // Go through all accounts and get their ETH balance\n const rowResolvers = accounts.map(async(address) => {\n const balance = await web3.eth.getBalance(address);\n // ethBalance is a BigNumber instance\n // https://github.com/indutny/bn.js/\n const ethBalance = web3.utils.fromWei(balance, \"ether\");\n const humanFriendlyBalance = parseFloat(ethBalance).toFixed(4);\n // Fill in the templated row and put in the document\n const clone = template.content.cloneNode(true);\n clone.querySelector(\".address\").textContent = address;\n clone.querySelector(\".balance\").textContent = humanFriendlyBalance + \" ETH\";\n ethWallet.address = address;\n accountContainer.appendChild(clone);\n\n // Add balance to balance object\n walletBalance.eth = humanFriendlyBalance;\n });\n\n // add token balance\n for (const [key, value] of Object.entries(vegaTokens)) {\n let contract = new web3.eth.Contract(minABI, value.address);\n accounts.map(async(address) => {\n var balance = await contract.methods.balanceOf(address).call();\n const humanFriendlyBalance = parseFloat(balance) / 10 ** value.decimal;\n console.log(humanFriendlyBalance);\n const clone = template.content.cloneNode(true);\n clone.querySelector(\".address\").textContent = address;\n clone.querySelector(\".balance\").textContent = humanFriendlyBalance + \" \" + key;\n accountContainer.appendChild(clone);\n\n // Add balance to balance object\n walletBalance[key] = humanFriendlyBalance;\n });\n }\n\n // Because rendering account does its own RPC commucation\n // with Ethereum node, we do not want to display any results\n // until data for all accounts is loaded\n await Promise.all(rowResolvers);\n\n console.log(JSON.stringify(walletBalance));\n\n // Display fully loaded UI for wallet data\n document.querySelector(\"#connected\").style.display = \"block\";\n document.querySelector(\"#prepare-message\").style.display = \"none\";\n document.querySelector(\"#prepare\").style.display = \"none\";\n if (validNetworks.includes(chainData.name)) {\n $(\"#eth-wallet-box\").removeClass(\"invalid-box\").addClass(\"valid-box\");\n } else {\n $(\"#eth-wallet-box\").addClass(\"invalid-box\").removeClass(\"valid-box\");\n $(\"#eth-wallet-danger\").show();\n console.log(\"Only the following networks are supported: \" + validNetworks.join());\n $(\"#eth-wallet-danger\").text(\"Only the following networks are supported: \" + validNetworks.join());\n }\n}", "async function fetchAccountData() {\n\n // Get a Web3 instance for the wallet\n const web3 = new Web3(provider);\n\n console.log(\"Web3 instance is\", web3);\n\n // Get connected chain id from Ethereum node\n const chainId = await web3.eth.getChainId();\n // Load chain information over an HTTP API\n const chainData = evmChains.getChain(chainId);\n document.querySelector(\"#network-name\").textContent = chainData.name;\n\n // Get list of accounts of the connected wallet\n const accounts = await web3.eth.getAccounts();\n\n // MetaMask does not give you all accounts, only the selected account\n console.log(\"Got accounts\", accounts);\n selectedAccount = accounts[0];\n\n document.querySelector(\"#selected-account\").textContent = selectedAccount;\n\n // Get a handl\n const template = document.querySelector(\"#template-balance\");\n const accountContainer = document.querySelector(\"#accounts\");\n\n const contractAddress = \"0x0456c33f24038bf277a1F1CA27C1999a416BbA0d\";\n var Erush = new web3.eth.Contract([{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"checkmemopurchases\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"getmemotextcountforaddr\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_memo\",\"type\":\"string\"}],\"name\":\"sendtokenwithmemo\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"0x0456c33f24038bf277a1F1CA27C1999a416BbA0d\");\n\n\n\n\n // Purge UI elements any previously loaded accounts\n accountContainer.innerHTML = '';\n\n // Go through all accounts and get their ETH balance\n const rowResolvers = accounts.map(async (address) => {\n const balance = await web3.eth.getBalance(address);\n const ebl = await Erush.methods.balanceOf(address).call();\n console.log(\"eblllll\", ebl);\n // ethBalance is a BigNumber instance\n // https://github.com/indutny/bn.js/\n const ethBalance = web3.utils.fromWei(balance, \"ether\");\n const eerBalance = web3.utils.fromWei(ebl, \"ether\");\n\n\n const humanFriendlyBalance = parseFloat(ethBalance).toFixed(4);\n const humanFriendlyeerBalance = parseFloat(eerBalance).toFixed(4);\n // Fill in the templated row and put in the document\n const clone = template.content.cloneNode(true);\n clone.querySelector(\".address\").textContent = address;\n clone.querySelector(\".balance\").textContent = humanFriendlyBalance;\n clone.querySelector(\".eerbalance\").textContent = humanFriendlyeerBalance;\n accountContainer.appendChild(clone);\n });\n\n // Because rendering account does its own RPC commucation\n // with Ethereum node, we do not want to display any results\n // until data for all accounts is loaded\n await Promise.all(rowResolvers);\n\n // Display fully loaded UI for wallet data\n document.querySelector(\"#prepare\").style.display = \"none\";\n document.querySelector(\"#connected\").style.display = \"block\";\n}", "async function fetchAccountData() {\n // Get a Web3 instance for the wallet\n const web3 = new Web3(provider);\n\n console.log(\"Web3 instance is\", web3);\n\n // Get connected chain id from Ethereum node\n const chainId = await web3.eth.getChainId();\n // Load chain information over an HTTP API\n const chainData = evmChains.getChain(chainId);\n document.querySelector(\"#network-name\").textContent = chainData.name;\n\n // Get list of accounts of the connected wallet\n const accounts = await web3.eth.getAccounts();\n\n // MetaMask does not give you all accounts, only the selected account\n console.log(\"Got accounts\", accounts);\n selectedAccount = accounts[0];\n\n document.querySelector(\"#selected-account\").textContent = selectedAccount;\n\n // Get a handl\n const template = document.querySelector(\"#template-balance\");\n const accountContainer = document.querySelector(\"#accounts\");\n\n // Purge UI elements any previously loaded accounts\n if (accountContainer && template) {\n accountContainer.innerHTML = \"\";\n\n // Go through all accounts and get their ETH balance\n const rowResolvers = accounts.map(async address => {\n const balance = await web3.eth.getBalance(address);\n // ethBalance is a BigNumber instance\n // https://github.com/indutny/bn.js/\n const ethBalance = web3.utils.fromWei(balance, \"ether\");\n const humanFriendlyBalance = parseFloat(ethBalance).toFixed(4);\n // Fill in the templated row and put in the document\n const clone = template.content.cloneNode(true);\n clone.querySelector(\".address\").textContent = address;\n clone.querySelector(\".balance\").textContent = humanFriendlyBalance;\n accountContainer.appendChild(clone);\n });\n }\n\n // Because rendering account does its own RPC commucation\n // with Ethereum node, we do not want to display any results\n // until data for all accounts is loaded\n // Display fully loaded UI for wallet data\n document.querySelector(\"#prepare\").style.display = \"none\";\n document.querySelector(\"#connected\").style.display = \"block\";\n\n // Contract\n ConnectedContract = new web3.eth.Contract(\n AngelAbi,\n \"0xd1B9E138516EE74ee27949eb1B58584A4bEDE267\", \n provider\n );\n bindRebirth();\n\n fetchContractData();\n}", "function balance_update(data) {\n console.log('Currency Wallet Update');\n // executor.getCurrentBalance();\n CustomUtil.printWalletStatus();\n // db.storeWalletState();\n}", "async function fetchAccountData() {\n\n // Get a Web3 instance for the wallet\n const web3 = new Web3(provider);\n\n console.log(\"Web3 instance is\", web3);\n\n // Get connected chain id from Ethereum node\n const chainId = await web3.eth.getChainId();\n console.log('chainId', chainId);\n // Load chain information over an HTTP API\n const chainData = evmChains.getChain(chainId);\n document.querySelector(\"#network-name\").textContent = chainData.name;\n\n // Get list of accounts of the connected wallet\n const accounts = await web3.eth.getAccounts();\n\n // MetaMask does not give you all accounts, only the selected account\n console.log(\"Got accounts\", accounts);\n selectedAccount = accounts[0];\n\n document.querySelector(\"#selected-account\").textContent = selectedAccount;\n\n // Get a handl\n const template = document.querySelector(\"#template-balance\");\n const accountContainer = document.querySelector(\"#accounts\");\n\n // Purge UI elements any previously loaded accounts\n accountContainer.innerHTML = '';\n\n // Go through all accounts and get their ETH balance\n const rowResolvers = accounts.map(async (address) => {\n const balance = await web3.eth.getBalance(address) || \"0\";\n // ethBalance is a BigNumber instance\n // https://github.com/indutny/bn.js/\n console.log('balance', balance);\n const ethBalance = web3.utils.fromWei(balance, \"ether\");\n const humanFriendlyBalance = parseFloat(ethBalance).toFixed(4);\n // Fill in the templated row and put in the document\n const clone = template.content.cloneNode(true);\n clone.querySelector(\".address\").textContent = address;\n clone.querySelector(\".balance\").textContent = humanFriendlyBalance;\n accountContainer.appendChild(clone);\n });\n\n // Because rendering account does its own RPC commucation\n // with Ethereum node, we do not want to display any results\n // until data for all accounts is loaded\n await Promise.all(rowResolvers);\n\n // Display fully loaded UI for wallet data\n document.querySelector(\"#prepare\").style.display = \"none\";\n document.querySelector(\"#connected\").style.display = \"block\";\n}", "async loadData(wallet) {\n // Update loaded / unloaded ranges for wallet\n await wallet.fetchgetWalletData('last');\n wallets.updateWalletsTable();\n // Detemine if load data should be restricted due to overlapping prior loaded data from another blockchain\n let latestIdToFetch = this.determineLatestIdToFetch(wallet);\n if (latestIdToFetch === 'load') {\n communication.message(\"Please complete loading of Hive data for wallet first. </i>\");\n } else {\n communication.message(\"Wallet data loading for \" + wallet.address + \".<br>Please wait.\");\n // Load data in loop - different processes per blockchain\n let storageNames;\n if (wallet.blockchain.name === 'hive') {\n // Load data\n storageNames = await this.getAccountHistoryFullHive(wallet, 0, latestIdToFetch);\n // Process airdrops once all data loaded\n await this.checkProcessAirdrops(wallet);\n\n await this.processPendingTransactions(wallet);\n\n // Update process status in wallet (and paired wallet) for stacks update\n wallet.updateProcessStatus(storageNames, 'updated');\n } else {\n // Load data\n storageNames = await this.getAccountHistoryFullSteem(wallet, 0, latestIdToFetch);\n // Update process status in wallet (and paired wallet) for stacks update\n wallet.updateProcessStatus(storageNames, 'updated');\n }\n }\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}", "fetchData(cb=null) {\n this.wait(\"Syncing chain data\");\n this.state.session.fetchData(this.state.currency, (err) => {\n this.unwait();\n if (err) {\n // Failed to fetch -- update state and set the alert\n return this.handleStateUpdate({err, currency: this.state.currency, cb});\n } else {\n // Successfully fetched -- update state\n this.handleStateUpdate();\n }\n // If this succeeded and we have a callback, go ahead and use it.\n if (cb) {\n return cb(null);\n }\n });\n }", "function displayWallet() {\n if (localStorage.getItem('reddcoinWallet')) {\n $('#walletSwapInteract').trigger('click');\n }\n else {\n $('#createWalletSetup').trigger('click');\n }\n\n if (localStorage.getItem('reddcoinWallet') || localStorage.getItem('user')) {\n Reddcoin.popup.updateBalance();\n Reddcoin.popup.updateHistory();\n\n // TODO: SEARCH\n Reddcoin.popup.updateSend();\n Reddcoin.popup.updateAccount();\n Reddcoin.popup.updateReceive();\n }\n}", "function loadWallet() {\n if (!localStorage.getItem(\"currentWallet\")) {\n return;\n }\n currentWallet = JSON.parse(localStorage.getItem(\"currentWallet\"));\n}", "async function fetchAccountData() {\r\n\r\n // Get a Web3 instance for the wallet\r\n web3 = new Web3(provider);\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 document.querySelector(\"#network-name\").textContent = chainData.name;\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 document.querySelector(\"#selected-account\").textContent = selectedAccount;\r\n const balance = await web3.eth.getBalance(selectedAccount);\r\n const ethBalance = web3.utils.fromWei(balance, \"ether\");\r\n const humanFriendlyBalance = parseFloat(ethBalance).toFixed(4);\r\n document.querySelector(\"#eth-balance\").textContent = humanFriendlyBalance+' ETH';\r\n\r\n // $(\"#qpo\").attr(\"data-bs-content\",document.getElementById('www').innerText)\r\n // console.log($('#qpo').attr(\"data-bs-content\"))\r\n new bootstrap.Popover('#qpo',{content:document.getElementById('www').innerHTML,html:true})\r\n\r\n // data-bs-content=\"Disabled popover\"\r\n\r\n // Get a handl\r\n // const template = document.querySelector(\"#template-balance\");\r\n // const accountContainer = document.querySelector(\"#accounts\");\r\n\r\n // Purge UI elements any previously loaded accounts\r\n // accountContainer.innerHTML = '';\r\n\r\n // Go through all accounts and get their ETH balance\r\n // const rowResolvers = accounts.map(async (address) => {\r\n // const balance = await web3.eth.getBalance(address);\r\n // // ethBalance is a BigNumber instance\r\n // // https://github.com/indutny/bn.js/\r\n // const ethBalance = web3.utils.fromWei(balance, \"ether\");\r\n // const humanFriendlyBalance = parseFloat(ethBalance).toFixed(4);\r\n // // Fill in the templated row and put in the document\r\n // const clone = template.content.cloneNode(true);\r\n // clone.querySelector(\".address\").textContent = address;\r\n // clone.querySelector(\".balance\").textContent = humanFriendlyBalance;\r\n // accountContainer.appendChild(clone);\r\n // });\r\n\r\n // Because rendering account does its own RPC commucation\r\n // with Ethereum node, we do not want to display any results\r\n // until data for all accounts is loaded\r\n // await Promise.all(rowResolvers);\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 $('#maddress').val(selectedAccount);\r\n setdisable(false);\r\n}", "async getAccountWallet(params) {\n let {data} = await xhr.get(`${this.apiUrl}/api/account/wallet`,{params});\n return data;\n }", "async getBalance () {\n await this.update()\n return this.client.getBalance()\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 }", "_updateWallet(transaction = this.transaction_update()) {\n let wallet = this.state.wallet;\n\n if (!wallet) {\n reject(\"missing wallet\");\n return;\n } //DEBUG console.log('... wallet',wallet)\n\n\n let wallet_clone = (0,lodash_es_cloneDeep__WEBPACK_IMPORTED_MODULE_17__[\"default\"])(wallet);\n\n wallet_clone.last_modified = new Date();\n (0,_tcomb_structs__WEBPACK_IMPORTED_MODULE_6__.WalletTcomb)(wallet_clone); // validate\n\n let wallet_store = transaction.objectStore(\"wallet\");\n let p = idb_helper__WEBPACK_IMPORTED_MODULE_3__[\"default\"].on_request_end(wallet_store.put(wallet_clone));\n let p2 = idb_helper__WEBPACK_IMPORTED_MODULE_3__[\"default\"].on_transaction_end(transaction).then(() => {\n this.state.wallet = wallet_clone;\n this.setState({\n wallet: wallet_clone\n });\n });\n return Promise.all([p, p2]);\n }", "async fetchInfoToSync () {\n // Preferences\n const {\n accountTokens,\n currentLocale,\n frequentRpcList,\n identities,\n selectedAddress,\n tokens,\n } = this.preferencesController.store.getState()\n\n // Filter ERC20 tokens\n const filteredAccountTokens = {}\n Object.keys(accountTokens).forEach(address => {\n const checksummedAddress = ethUtil.toChecksumAddress(address)\n filteredAccountTokens[checksummedAddress] = {}\n Object.keys(accountTokens[address]).forEach(\n networkType => (filteredAccountTokens[checksummedAddress][networkType] = networkType !== 'mainnet' ?\n accountTokens[address][networkType] :\n accountTokens[address][networkType].filter(({ address }) => {\n const tokenAddress = ethUtil.toChecksumAddress(address)\n return contractMap[tokenAddress] ? contractMap[tokenAddress].erc20 : true\n })\n )\n )\n })\n\n const preferences = {\n accountTokens: filteredAccountTokens,\n currentLocale,\n frequentRpcList,\n identities,\n selectedAddress,\n tokens,\n }\n\n // Accounts\n const hdKeyring = this.keyringController.getKeyringsByType('HD Key Tree')[0]\n const hdAccounts = await hdKeyring.getAccounts()\n const accounts = {\n hd: hdAccounts.filter((item, pos) => (hdAccounts.indexOf(item) === pos)).map(address => ethUtil.toChecksumAddress(address)),\n simpleKeyPair: [],\n ledger: [],\n trezor: [],\n }\n\n // transactions\n\n let transactions = this.txController.store.getState().transactions\n // delete tx for other accounts that we're not importing\n transactions = transactions.filter(tx => {\n const checksummedTxFrom = ethUtil.toChecksumAddress(tx.txParams.from)\n return (\n accounts.hd.includes(checksummedTxFrom)\n )\n })\n\n return {\n accounts,\n preferences,\n transactions,\n network: this.networkController.store.getState(),\n }\n }", "loadDbData() {\n return idb_helper__WEBPACK_IMPORTED_MODULE_3__[\"default\"].cursor(\"wallet\", cursor => {\n if (!cursor) return false;\n let wallet = cursor.value; // Convert anything other than a string or number back into its proper type\n\n wallet.created = new Date(wallet.created);\n wallet.last_modified = new Date(wallet.last_modified);\n wallet.backup_date = wallet.backup_date ? new Date(wallet.backup_date) : null;\n wallet.brainkey_backup_date = wallet.brainkey_backup_date ? new Date(wallet.brainkey_backup_date) : null;\n\n try {\n (0,_tcomb_structs__WEBPACK_IMPORTED_MODULE_6__.WalletTcomb)(wallet);\n } catch (e) {\n console.log(\"WalletDb format error\", e);\n }\n\n this.state.wallet = wallet;\n this.setState({\n wallet\n });\n return false; //stop iterating\n });\n }", "wallet_get(owner, opt) {\n let endpoint = `account/${owner}/wallet_history`;\n let options = opt || { };\n\n if (!options.year_month && typeof options.balance_only === 'undefined') options.balance_only = true;\n if (typeof options.flp === 'undefined') options.flp = true;\n\n let qs = \"\";\n for (let prop in options) {\n if (options[prop]) qs += prop + '&';\n }\n if (qs) endpoint += \"?\" + qs;\n\n return this._get(endpoint);\n }", "onWalletUpdate(wallet) {\n const mapped = wallet.map(item => item.toJS()).filter(item => item.type === 'funding');\n mapped.forEach((item) => {\n this.state.wallet = this.state.wallet.filter(w => w.currency !== item.currency);\n this.state.wallet.push(item);\n });\n }", "async function refreshAccountData() {\r\n\r\n // If any current data is displayed when\r\n // the user is switching acounts in the wallet\r\n // immediate hide this data\r\n document.querySelector(\"#connected\").style.display = \"none\";\r\n document.querySelector(\"#prepare\").style.display = \"block\";\r\n\r\n // Disable button while UI is loading.\r\n // fetchAccountData() will take a while as it communicates\r\n // with Ethereum node via JSON-RPC and loads chain data\r\n // over an API call.\r\n document.querySelector(\"#buy-connect\").setAttribute(\"disabled\", \"disabled\")\r\n await fetchAccountData(provider);\r\n document.querySelector(\"#buy-connect\").removeAttribute(\"disabled\")\r\n}", "function Account() {\n var backend = void 0,\n localstorage = APP.localstorage,\n tooltip = void 0,\n transaction = void 0,\n monero_price = 0,\n balance = 0,\n unlocked_balance = 0,\n base = 10000000000,\n walletName = void 0,\n blockchainheight = 0,\n wallet_address = '',\n keys = void 0;\n\n var j_current_balance = $('.current_balance');\n var j_current_usd = $('#current_usd');\n var j_wallet_address = $('.wallet-address');\n var import_btn = $('#import-transactions');\n var rescan_btn = $('#rescan');\n var height_input = $('#import-height');\n var table = $('#transactions-table');\n var import_progress = $('#import-progress');\n var clear_cache = $('#clear-cache');\n\n //send\n var send_btn = $('#try-send-transaction');\n var send_address = $('#send-address');\n var send_amount = $('#send-amount');\n var send_payment_id = $('#send-payment-id');\n\n //tootlip\n var tt_id = $('#tx-id');\n var tt_fee = $('#tx-fee');\n var tt_confirmations = $('#tx-confirmations');\n var tt_mixin = $('#tx-mixin');\n\n function onInit() {\n\n keys = localstorage.get('keys');\n transaction = new _transaction.Transaction();\n\n // walletName = localstorage.get('walletName');\n\n backend = new _backend.Backend();\n\n wallet_address = JSON.parse(localstorage.get('keys')).public_addr;\n\n // changelly.getCurrencies().then((data) => {\n // console.log(data);\n // updateCurrencyList(data.result);\n // });\n\n backend.get_monero_price().then(function (data) {\n monero_price = data[0].price_usd;\n updateView();\n });\n\n j_wallet_address.val(wallet_address);\n\n getTransactionsData();\n\n new _tabs.Tabs('.account', { 'wallet': 0, 'transactions': 1, 'send': 2, 'exchange': 3 });\n // new Copy('#copy-exchange-address','#exchange-address');\n new _copy.Copy('#copy-wallet-address', '#wallet-address');\n new _qrcode.QR('#qrcode', '#exchange-address');\n new _qrcode.ToggleQR('#toggle-qr', '#wallet-address');\n var exchange = new _exchange.Exchange(wallet_address);\n new _loading.Loading('#transaction-load', function () {\n console.log('transactions loaded!');\n showMockTransactions();\n });\n\n new _validator.Validator('#try-send-transaction', '#send-transaction');\n // new Validator('#to-exchange','.exchange-data', ()=>{\n // exchange.go();\n // });\n\n tooltip = new _tooltip.Tooltip('[data-transaction-id]', 'data-transaction-id', getTransactionDetail, function (hash, data) {\n var txs = JSON.parse(localstorage.get('txs'));\n var tx = txs.find(function (el) {\n return el.txid === hash;\n });\n console.log(txs);\n var mixin = data.rctsig_prunable.MGs[0].ss.length - 1;\n var confirmations = blockchainheight - tx.height;\n var split_hash = hash.substr(0, 32) + '<br>' + hash.substr(32);\n\n tt_id.html(split_hash);\n tt_fee.text(tx.fee / 1000000000000 + ' XMR');\n tt_mixin.text(mixin);\n tt_confirmations.text(confirmations);\n });\n\n import_btn.on('click', function () {\n importWalletFromHeight();\n });\n\n send_btn.on('click', function () {\n makeTransaction();\n });\n\n var rescan_interval = setInterval(function () {\n rescanBlockchain();\n }, 10000);\n\n setInterval(function () {\n backend.get_height().then(function (data) {\n blockchainheight = data.result.count;\n console.log('curr blockchain height:', blockchainheight);\n });\n }, 45000);\n backend.get_height().then(function (data) {\n blockchainheight = data.result.count;\n console.log('curr blockchain height:', blockchainheight);\n });\n\n rescan_btn.on('click', rescanBlockchain);\n\n clear_cache.on('click', function () {\n localstorage.clear();\n window.location.href = '/';\n });\n\n updateView();\n }\n\n function getBalance() {\n\n var txs = JSON.parse(localstorage.get('txs'));\n console.log(txs);\n\n var _balance = txs.reduce(function (res, el) {\n switch (el.type) {\n case 'in':\n res += el.amount;\n break;\n case 'out':\n res -= el.amount + el.fee;\n break;\n }\n return res;\n }, 0);\n balance = Math.round(_balance / base) / 100;\n updateView();\n // backend.get_balance().then((data)=>{\n // balance = Math.round(data.result.balance/base)/100;\n // unlocked_balance = Math.round(data.result.unlocked_balance/base)/100;\n // if(balance > 0 && unlocked_balance === 0){\n // alert('All your balance locked! Wait ~15 minutes');\n // }\n // updateView();\n // getTransactionsData(); //TODO: to debug, remove later\n // });\n }\n\n function importWalletFromHeight() {\n\n var height = height_input.val();\n height = height == '' ? 1 : parseInt(height);\n var keys = JSON.parse(localstorage.get('keys'));\n //mock keys for test: //TODO: remove on production\n keys.public_addr = '9w7UYUD35ZS82ZsiHus5HeJQCJhzJiMRZTLTsCYCGfUoahk5PJpfKpPMvsBjteE3EW3Xm63t4ibk1ihBdjYjZn6KAjH2oSt';\n keys.view.sec = 'c53e9456ca998abc13cfc9a4c868bbe142ef0298fcf6b569bdf7986b9d525305';\n keys.spend.sec = '0da41a4648265e69701418753b610566ae04f0bbee8b815e3e4b99a69a5bd80d';\n import_btn.text('Importing...');\n var progress = '';\n var update_interval = void 0;\n\n setTimeout(function () {\n var socket = io('http://localhost:3335/');\n\n update_interval = setInterval(function () {\n import_progress.text(progress);\n }, 1000);\n socket.on('progress', function (data) {\n // console.log(data);\n // import_progress.text(data.progress);\n progress = data.progress;\n });\n socket.on('imported', function (data) {\n clearInterval(update_interval);\n localstorage.set('walletStatus', 'imported');\n console.log('from imported event', data.walletName);\n // getTransactionsData();\n // import_btn.text('Imported!');\n // socket.close();\n import_progress.text('');\n getTransactionsData();\n import_btn.text('Imported!');\n\n socket.close();\n });\n // socket.on('disconnect',()=>{\n // console.log('from disconnected event');\n // getTransactionsData();\n // import_btn.text('Imported!');\n // socket.close();\n // });\n }, 2000);\n\n backend.import_from_height(keys.public_addr, keys.spend.sec, keys.view.sec, height).then(function (data) {\n walletName = data.data;\n localstorage.set('walletName', data.data);\n backend.updateWalletName(data.data);\n\n // getTransactionsData();\n }).catch(function (e) {\n console.log('Cannot import wallet!', e);\n });\n }\n\n function rescanBlockchain() {\n backend.rescan_blockchain().then(function (data) {\n console.log('on rescan', data);\n updateTransactionTable(data);\n });\n }\n\n function getTransactionsData() {\n backend.get_transfers().then(function (data) {\n console.log(data);\n return data;\n }).then(updateTransactionTable);\n }\n\n function updateTransactionTable(txs_data) {\n $('.tr-generated').remove();\n var rows = txsDataToTableRows(txs_data);\n table.append(rows);\n tooltip.reinit();\n }\n\n function txsDataToTableRows(data) {\n var all = [];\n var restore_height = 0;\n var _in = data.result.in ? data.result.in : [];\n var _out = data.result.out ? data.result.out : [];\n var _pool = data.result.pool ? data.result.pool : [];\n var _pending = data.result.pending ? data.result.pending : [];\n var _failed = data.result.failed ? data.result.failed : [];\n var _all = _in.concat(_out, _pool, _pending, _failed);\n\n //eval restore height:\n if (_out.length > 0) {\n console.log('restore h out: ', _out);\n } else if (_in.length > 0) {\n console.log('restore h in: ', _in);\n } else {\n restore_height = blockchainheight;ll;\n }\n var local = [];\n\n if (localstorage.get('walletStatus') === 'imported') {\n var _local = JSON.parse(localstorage.get('txs'));\n local = _local.filter(function (el) {\n return _all.findIndex(function (tx) {\n return transaction.compare(tx, el);\n }) === -1;\n });\n }\n\n all = local.concat(_all);\n localstorage.set('txs', JSON.stringify(all));\n var rows = all.sort(function (a, b) {\n return -a.timestamp + b.timestamp;\n }).map(function (tx) {\n return transaction.generateTableRow(tx, monero_price);\n });\n getBalance();\n return rows;\n }\n\n function getTransactionDetail(tx) {\n return backend.get_transactions_info([tx]);\n // .then((data)=>{\n //\n // let txs = data.txs_as_json.map(JSON.parse);\n // console.log(txs);\n // });\n }\n\n function makeTransaction() {\n send_btn.attr('disabled', 'disabled');\n send_btn.text('Sending...');\n var address = send_address.val();\n var amount = parseFloat(send_amount.val()) * 1000000000000;\n var payment_id = send_payment_id.val();\n backend.make_transaction(address, amount, payment_id).then(function (data) {\n console.log(data);\n if (data.error) {\n send_btn.text(backend.translateWalletError(data.error));\n return;\n }\n send_btn.text('Success!');\n var tx_hash = data.result.tx_hash;\n // getTransactionDetail(tx_hash);\n }, function (error) {\n console.log(error);\n });\n }\n\n function updateView() {\n j_current_balance.text(balance);\n j_current_usd.text(Math.round(monero_price * balance));\n }\n\n //mockTransactions\n function showMockTransactions() {\n $('tr.hidden').removeClass('hidden');\n }\n\n onInit();\n}", "async function refreshAccountData() {\n\n // If any current data is displayed when\n // the user is switching acounts in the wallet\n // immediate hide this data\n document.querySelector(\"#connected\").style.display = \"none\";\n document.querySelector(\"#prepare\").style.display = \"block\";\n\n // Disable button while UI is loading.\n // fetchAccountData() will take a while as it communicates\n // with Ethereum node via JSON-RPC and loads chain data\n // over an API call.\n document.querySelector(\"#btn-connect\").setAttribute(\"disabled\", \"disabled\")\n await fetchAccountData(provider);\n document.querySelector(\"#btn-connect\").removeAttribute(\"disabled\")\n}", "async function refreshAccountData() {\n\n // If any current data is displayed when\n // the user is switching acounts in the wallet\n // immediate hide this data\n document.querySelector(\"#connected\").style.display = \"none\";\n document.querySelector(\"#prepare\").style.display = \"block\";\n\n // Disable button while UI is loading.\n // fetchAccountData() will take a while as it communicates\n // with Ethereum node via JSON-RPC and loads chain data\n // over an API call.\n document.querySelector(\"#btn-connect\").setAttribute(\"disabled\", \"disabled\")\n await fetchAccountData(provider);\n document.querySelector(\"#btn-connect\").removeAttribute(\"disabled\")\n}", "function fetchBtcAvg(){\n var url = \"https://apiv2.bitcoinaverage.com/indices/local/history/BTCEUR?period=alltime&format=json\";\n $.getJSON(url, function(data) {\n localStorage.btcavg = JSON.stringify(data);\n btcavg = data;\n console.log('loaded new bitcoinaverage_local data: '+data.length+' days.');\n });\n}", "getUserWallet() {\n return Api.get(\"/client/user-wallet\");\n }", "async function refreshAccountData() {\n // If any current data is displayed when\n // the user is switching acounts in the wallet\n // immediate hide this data\n document.querySelector(\"#connected\").style.display = \"none\";\n document.querySelector(\"#prepare\").style.display = \"block\";\n\n // Disable button while UI is loading.\n // fetchAccountData() will take a while as it communicates\n // with Ethereum node via JSON-RPC and loads chain data\n // over an API call.\n document.querySelector(\"#btn-connect\").setAttribute(\"disabled\", \"disabled\");\n await fetchAccountData(provider);\n document.querySelector(\"#btn-connect\").removeAttribute(\"disabled\");\n}", "async function refreshAccountData() {\r\n\r\n // If any current data is displayed when\r\n // the user is switching acounts in the wallet\r\n // immediate hide this data\r\n document.querySelector(\"#connected\").style.display = \"none\";\r\n document.querySelector(\"#prepare\").style.display = \"block\";\r\n\r\n // Disable button while UI is loading.\r\n // fetchAccountData() will take a while as it communicates\r\n // with Ethereum node via JSON-RPC and loads chain data\r\n // over an API call.\r\n document.querySelector(\"#btn-connect\").setAttribute(\"disabled\", \"disabled\")\r\n await fetchAccountData(provider);\r\n document.querySelector(\"#btn-connect\").removeAttribute(\"disabled\")\r\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 updatewallets() {\n //seclect the wallet from wallets array and update it\n var walletsArray = JSON.parse(localStorage.getItem(\"walletsArray\"));\n for (var i = 0; i < walletsArray.length; i++) {\n if (walletsArray[i].name == currentWallet.name) {\n walletsArray[i].amount = currentWallet.amount;\n }\n }\n // }\n localStorage.setItem(\"walletsArray\", JSON.stringify(walletsArray));\n}", "async function fetchData() {\n const accounts = await web3.eth.getAccounts();\n setAddresses(accounts);\n setSelectedAddress(accounts[0]);\n accountService.setData(selectedAddress);\n }", "function syncWallet (successcallback, errorcallback) {\n\n var panic = function(e) {\n console.log('Panic ' + e);\n window.location.replace(\"/\");\n throw 'Save disabled.';\n // kick out of the wallet in a inconsistent state to prevent save\n };\n\n if (MyWallet.wallet.isEncryptionConsistent === false) {\n panic(\"The wallet was not fully enc/decrypted\");\n }\n\n if (!MyWallet.wallet || !MyWallet.wallet.sharedKey\n || MyWallet.wallet.sharedKey.length === 0\n || MyWallet.wallet.sharedKey.length !== 36)\n { throw 'Cannot backup wallet now. Shared key is not set'; };\n\n WalletStore.disableLogout();\n\n var _errorcallback = function(e) {\n WalletStore.sendEvent('on_backup_wallet_error');\n WalletStore.sendEvent(\"msg\", {type: \"error\", message: 'Error Saving Wallet: ' + e});\n // Re-fetch the wallet from server\n MyWallet.getWallet();\n // try to save again:\n // syncWallet(successcallback, errorcallback);\n errorcallback && errorcallback(e);\n };\n try {\n var method = 'update';\n var data = JSON.stringify(MyWallet.wallet, null, 2);\n var crypted = WalletCrypto.encryptWallet( data\n , WalletStore.getPassword()\n , WalletStore.getPbkdf2Iterations()\n , MyWallet.wallet.isUpgradedToHD ? 3.0 : 2.0 );\n\n if (crypted.length == 0) {\n throw 'Error encrypting the JSON output';\n }\n\n //Now Decrypt the it again to double check for any possible corruption\n WalletCrypto.decryptWallet(crypted, WalletStore.getPassword(), function(obj) {\n try {\n var oldChecksum = WalletStore.getPayloadChecksum();\n WalletStore.sendEvent('on_backup_wallet_start');\n WalletStore.setEncryptedWalletData(crypted);\n var new_checksum = WalletStore.getPayloadChecksum();\n var data = {\n length: crypted.length,\n payload: crypted,\n checksum: new_checksum,\n method : method,\n format : 'plain',\n language : WalletStore.getLanguage()\n };\n\n if (Helpers.isHex(oldChecksum)) {\n data.old_checksum = oldChecksum;\n }\n\n if (WalletStore.isSyncPubKeys()) {\n // Include HD addresses unless in lame mode:\n var hdAddresses = (\n MyWallet.wallet.hdwallet != undefined &&\n MyWallet.wallet.hdwallet.accounts != undefined\n ) ? [].concat.apply([],\n MyWallet.wallet.hdwallet.accounts.map(function(account) {\n return account.labeledReceivingAddresses\n })) : [];\n data.active = [].concat.apply([],\n [\n MyWallet.wallet.activeAddresses,\n hdAddresses\n ]\n ).join('|');\n }\n\n MyWallet.securePost(\n \"wallet\"\n , data\n , function(data) {\n checkWalletChecksum(\n new_checksum\n , function() {\n WalletStore.setIsSynchronizedWithServer(true);\n WalletStore.enableLogout();\n WalletStore.resetLogoutTimeout();\n WalletStore.sendEvent('on_backup_wallet_success');\n successcallback && successcallback();\n }\n , function() {\n _errorcallback('Checksum Did Not Match Expected Value');\n WalletStore.enableLogout();\n }\n );\n }\n , function(e) {\n WalletStore.enableLogout();\n _errorcallback(e);\n }\n );\n\n } catch (e) {\n _errorcallback(e);\n WalletStore.enableLogout();\n };\n },\n function(e) {\n console.log(e);\n throw(\"Decryption failed\");\n });\n } catch (e) {\n _errorcallback(e);\n WalletStore.enableLogout();\n }\n\n}", "getWallet() {\r\n return this.wallet;\r\n }", "async function refreshAccountData() {\n\n // If any current data is displayed when\n // the user is switching acounts in the wallet\n // immediate hide this data\n document.querySelector(\"#connected\").style.display = \"none\";\n document.querySelector(\"#prepare-message\").style.display = \"block\";\n document.querySelector(\"#prepare\").style.display = \"block\";\n\n // Disable button while UI is loading.\n // fetchAccountData() will take a while as it communicates\n // with Ethereum node via JSON-RPC and loads chain data\n // over an API call.\n document.querySelector(\"#btn-connect\").setAttribute(\"disabled\", \"disabled\")\n await fetchAccountData(provider);\n document.querySelector(\"#btn-connect\").removeAttribute(\"disabled\")\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 }", "function saveWallet() {\n localStorage.setItem(\"currentWallet\", JSON.stringify(currentWallet));\n}", "getAccountBalance () {\n return this.createRequest('/balance', 'GET');\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 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 }", "async function syncCoin() {\n const date = moment().utc().startOf('minute').toDate();\n // Setup the crex24.com api url.\n const url = `${ config.crex24.api }`;\n const btcurl = `${ config.crex24btc.api }`;\n\n const info = await rpc.call('getinfo');\n const masternodes = await rpc.call('getmasternodecount');\n const maxnodes = await rpc.call('getmaxnodecount');\n const nethashps = await rpc.call('getnetworkhashps');\n\n let market = await fetch(url);\n if (Array.isArray(market)) {\n market = market.length ? market[0] : {};\n }\n\n let cbtcusd = await fetch(btcurl);\n if (Array.isArray(cbtcusd)) {\n cbtcusd = cbtcusd.length ? cbtcusd[0] : {};\n }\n\n let btcusdprc = cbtcusd.last;\n let btcprc = (market.last).toFixed(12);\n let usdprc = (btcusdprc * btcprc);\n\n const coin = new Coin({\n cap: market.volumeInUsd,\n createdAt: date,\n blocks: info.blocks,\n btc: (market.last).toFixed(12),\n diff: info.difficulty,\n mnsOff: masternodes.total - masternodes.stable,\n mnsOn: masternodes.stable,\n maxsOff: maxnodes.total - maxnodes.stable,\n maxsOn: maxnodes.stable,\n netHash: nethashps,\n peers: info.connections,\n status: 'Online',\n supply: info.moneysupply,\n usd: usdprc\n });\n\n//process.stdout.write(\"BTC\" + btcprc + \" \" + \"USD\" + usdprc);\n\n\n await coin.save();\n}", "function updateBalance() {\n\tif (ApiKey=='') {\n\t\t// No API key. No use trying to fetch info.\n\t\tBTC = Number.NaN;\n\t\tfiat = Number.NaN;\n\t\tchrome.browserAction.setTitle({title: \"No API key.\"});\n\t\treturn;\n\t}\n\n\tvar path;\n\tif (useAPIv2) \tpath = \"BTC\" + currency + \"/money/info\";\n\telse \t\t\tpath = \"info.php\";\n\n\t// Make a POST request to Mt. Gox to update the balance.\n\tmtGoxPost(path, [],\n\t\t\t\n\t\tfunction(e) {\n\t\t\tconsole.log(\"Error getting account balance. Retrying after 10 seconds...\");\n\t\t\tchrome.browserAction.setTitle({title: \"Error getting user info. MtGox problem?\"});\n\t\t\tscheduleBalanceUpdate(10*1000);\n\t\t},\n\t\t\n\t\tfunction(d) {\n\t\t\ttry {\n\t\t\t\tvar jsonData = JSON.parse(d.currentTarget.responseText);\n\t\t\t\tif (useAPIv2) jsonData = jsonData.data;\n\t\n\t\t\t\tif (typeof(jsonData.Wallets[currency].Balance.value) == \"undefined\") {\n\t\t\t\t\tlog(\"Error fetching account balance: \" + jsonData.error);\n\t\t\t\t\tchrome.browserAction.setTitle({title: \"Error getting balance. Mt. Gox problem?\"});\n\t\t\t\t} else {\n\t\t\t\t\tBTC = parseFloat(jsonData.Wallets.BTC.Balance.value);\n\t\t\t\t\tfiat = parseFloat(jsonData.Wallets[currency].Balance.value);\n\t\t\t\t\tchrome.browserAction.setTitle({ title: (BTC.toFixed(3) + \" BTC + \" + fiat.toFixed(2) + \" \" + currency) });\n\t\t\t\t\trefreshPopup(true);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tconsole.log(e);\n\t\t\t\tchrome.browserAction.setTitle({title: \"Exception parsing user info. MtGox problem?\"});\n\t\t\t}\n\t\t\t\n\t\t\t// Update the balance every 5 minutes.\n\t\t\tscheduleBalanceUpdate(5*60*1000);\n\t\t}\n\t);\n}", "async addWallet() {\n // Validate and format address\n let newAddress = this.validateAddress();\n // Deactivate addressInput button\n this.addressInput.changeToDeactive();\n // Check if wallet already exists in list of wallets\n if (wallets.findWallet(this.name, newAddress) !== undefined) {\n communication.message('Address already included in database for this blockchain. Please try again.');\n } else {\n // Get financial data to check existence of account\n let walletFinancialData = await this.getWalletsFinancialData(this.name, [newAddress]);\n // Invalid address for blockchain\n if (walletFinancialData[newAddress].valid === false) {\n communication.message(\"Not a valid address on \" + this.name + \" blockchain. Please try again.\");\n // Valid address\n } else {\n communication.message('Verified.<br> Generating new wallet info for ' + this.name + ' blockchain.');\n // Generate a new Wallet instance based on the new address\n // - saves in wallets and also stores the summaryRange in the database\n await wallets.generateNewWallet(this, newAddress, true);\n // Set current wallet to new wallet\n wallets.processWalletSelection(this.name, newAddress);\n // Update wallets table\n wallets.updateWalletsTable();\n wallets.scrollToBottomOfTable();\n communication.message('Verified.<br> Click on LOAD DATA to obtain transactions from ' + this.name + ' blockchain.');\n }\n }\n }", "getBalance() {\n return this.wallet.getBalance();\n }", "async getExistingWallets() {\n this.localWallets = JSON.parse(walletFile);\n }", "upgradeWallet() {\n // Lock button\n this.okPressed = true;\n // Upgrade\n return this._Wallet.upgrade(this.common, this.selectedWallet).then(()=> {\n this._$timeout(() => {\n // Unlock button\n this.okPressed = false;\n // Clean common object\n this.common = nem.model.objects.get(\"common\");\n // Prepare wallet download link\n this._Wallet.prepareDownload(this.selectedWallet);\n // Store base64 format for safety protocol\n this.rawWallet = this._Wallet.base64Encode(this.selectedWallet);\n //\n this.needsUpgrade = false;\n this.showSafetyMeasure = true;\n });\n },\n (err) => {\n this._$timeout(() => {\n // Unlock button\n this.okPressed = false;\n // Clean common object\n this.common = nem.model.objects.get(\"common\");\n });\n })\n }", "function fetchExchangeRateData() {\n const currency_one = currencyOne.value;\n const currency_two = currencyTwo.value;\n\n const localData = JSON.parse(localStorage.getItem(\"exchange_rate_data\"));\n // console.log(Date.now());\n // console.log(localData);\n if(localData===null || +localData.time_last_updated + 5000 > Date.now()){\n fetch(`https://api.exchangerate-api.com/v4/latest/${currency_one}`)\n .then((res) => res.json())\n .then((data) => {\n // console.log(data);\n localStorage.setItem(\"exchange_rate_data\", JSON.stringify(data));\n const rate = data.rates[currency_two];\n\n rateElem.innerText = `1 ${currency_one} = ${rate} ${currency_two}`;\n\n amountTwo.value = (amountOne.value * rate).toFixed(2);\n });\n}else{\n console.log(\"Network not called!\");\n const rate = localData.rates[currency_two];\n\n rateElem.innerText = `1 ${currency_one} = ${rate} ${currency_two}`;\n\n amountTwo.value = (amountOne.value * rate).toFixed(2);\n}\n}", "async getBlockchainData () {\n try {\n await this.abcSweeper.populateObjectFromNetwork()\n await this.bchnSweeper.populateObjectFromNetwork()\n\n this.abcSweeper.paper.balance = this.abcSweeper.BCHBalanceFromPaperWallet\n this.abcSweeper.paper.utxos = this.abcSweeper.UTXOsFromPaperWallet\n // console.log('ABC Paper wallet: ', this.abcSweeper.paper)\n // console.log(`ABC Paper wallet utxos: ${JSON.stringify(this.abcSweeper.paper.utxos, null, 2)}`)\n\n this.bchnSweeper.paper.balance = this.bchnSweeper.BCHBalanceFromPaperWallet\n this.bchnSweeper.paper.utxos = this.bchnSweeper.UTXOsFromPaperWallet\n // console.log('BCHN Paper wallet: ', this.abcSweeper.paper)\n\n this.abcSweeper.receiver.balance = this.abcSweeper.BCHBalanceFromReceiver\n this.abcSweeper.receiver.utxos = this.abcSweeper.UTXOsFromReceiver\n // console.log('ABC Receiver wallet: ', this.abcSweeper.receiver)\n // console.log(`ABC Receiver wallet utxos: ${JSON.stringify(this.abcSweeper.receiver.utxos, null, 2)}`)\n\n this.bchnSweeper.receiver.balance = this.bchnSweeper.BCHBalanceFromReceiver\n this.bchnSweeper.receiver.utxos = this.bchnSweeper.UTXOsFromReceiver\n // console.log('BCHN Receiver wallet: ', this.bchnSweeper.receiver)\n // console.log(`BCHN Receiver wallet utxos: ${JSON.stringify(this.bchnSweeper.receiver.utxos, null, 2)}`)\n } catch (e) {\n console.error('Error in getBlockchainData()')\n // throw new Error(e.message)\n throw e\n }\n }", "function Convert(props) {\n\n const [state , setState] = useState({ inputAmount: \"0\" });\n \n // The connected wallet account address\n const [account , setAccount] = useState('');\n \n // The connected wallet account ether balance\n const [ethBalance , setEthBalance] = useState('0');\n\n // The connected wallet account SafekeepToken balance\n const [tokenBalance , setTokenBalance] = useState('0');\n\n // The SafekeepToken Contract\n const [token , setToken] = useState();\n\n // The DEX Contract\n const [dex , setDex] = useState();\n\n // The DEX address\n const [dexAddress , setDexAddress] = useState();\n\n // Bool to determine whether to show wallet balances\n // (connected to wallet => false => not loading => show balances)\n const [loading , setLoading] = useState(true);\n\n async function loadBlockchainData() {\n const {database} = require('../../database/firebase.js');\n const user = firebase.auth().currentUser;\n if (!user)\n {\n props.showError('User not connected. Please connet to website.');\n } else {\n // get registered user wallet address\n const docRef = await database.collection(\"UsersWallets\")\n .doc(user.uid).get();\n const registeredAccount = docRef.data().walletAddress;\n\n // get MetaMask wallet address\n const web3 = window.web3;\n const accounts = await web3.eth.getAccounts();\n setAccount(accounts[0]);\n\n if (registeredAccount !== accounts[0]) {\n props.showError('Given wallet address different than registered address. ' +\n 'Please connect to the correct wallet or go to LostFunds page.');\n } else {\n if (accounts[0] !== undefined && accounts[0] !== '') {\n setEthBalance(await web3.eth.getBalance(accounts[0]));\n }\n \n // Load Token\n const networkId = await web3.eth.net.getId();\n const tokenData = Token.networks[networkId];\n if (tokenData) {\n const safekeepToken = new web3.eth.Contract(Token.abi, tokenData.address);\n setToken(safekeepToken);\n if(accounts[0] !== undefined && accounts[0] !== '') {\n let tokenBalance = await safekeepToken.methods.balanceOf(accounts[0]).call();\n setTokenBalance(tokenBalance.toString());\n }\n } else {\n window.alert('Token contract not deployed to detected network.');\n }\n \n // Load DEX\n const dexData = Dex.networks[networkId];\n if (dexData) {\n setDexAddress(dexData.address);\n setDex(new web3.eth.Contract(Dex.abi, dexData.address));\n } else {\n window.alert('DEX contract not deployed to detected network.');\n }\n \n setLoading(false);\n }\n }\n }\n\n async function loadWeb3() {\n if (window.ethereum) {\n window.web3 = new Web3(window.ethereum);\n await window.ethereum.enable();\n } else if (window.web3) {\n window.web3 = new Web3(window.web3.currentProvider);\n } else {\n window.alert('Non-Ethereum browser detected. You should consider trying MetaMask!');\n }\n }\n\n function buyTokens(etherAmount) {\n let convertedEtherAmount = etherAmount.toString();\n convertedEtherAmount = window.web3.utils.toWei(convertedEtherAmount, 'Ether');\n setLoading(true);\n dex.methods.buyTokens().send({ value: convertedEtherAmount, from: account, gas: 3000000 }).on('transactionHash', (hash) => {\n setLoading(false);\n });\n }\n\n function sellTokens(tokenAmount) {\n let convertedTokenAmount = tokenAmount.toString();\n convertedTokenAmount = window.web3.utils.toWei(convertedTokenAmount, 'Ether');\n setLoading(true);\n token.methods.approve(dexAddress, convertedTokenAmount).send({ from: account, gas: 3000000 }).on('transactionHash', (hash) => {\n dex.methods.sellTokens(convertedTokenAmount).send({ from: account }).on('transactionHash', (hash) => {\n setLoading(false)\n })\n });\n }\n\n const connectAccount = async () => {\n await loadWeb3();\n await loadBlockchainData();\n };\n\n\n let content;\n if (loading) {\n if (account !== undefined && account !== '') {\n content = <p id=\"loader\" className=\"text-center\">Loading...</p>\n } else {\n content = <p id=\"loader\" className=\"text-center\">Please connect to wallet</p>\n }\n } else {\n content =\n <div>\n <span className=\"float-right text-muted\">\n Ether Balance: {window.web3.utils.fromWei(ethBalance, 'Ether')}\n </span>\n <span className=\"float-right text-muted\">\n Token Balance: {window.web3.utils.fromWei(tokenBalance, 'Ether')}\n </span>\n <button className=\"btn btn-primary buy-sell\"\n variant=\"contained\" color=\"primary\"\n onClick={() => buyTokens(state.inputAmount)}>\n Buy Tokens\n </button>\n <button className=\"btn btn-primary buy-sell\"\n variant=\"contained\"\n color=\"primary\"\n onClick={() => sellTokens(state.inputAmount)}>\n Sell Tokens\n </button>\n </div>\n }\n \n return( \n <div className=\"convert\">\n Amount to buy/sell:\n <input className=\"inputAmount\"\n placeholder={\"how much to send?\"}\n type=\"text\" value={state.inputAmount} \n onChange={(evt) => setState({inputAmount: evt.target.value})}\n />\n <button className=\"btn btn-primary connect\"\n variant=\"contained\"\n color=\"primary\"\n onClick={connectAccount}>\n Connect wallet\n </button>\n {content}\n </div>\n )\n}", "function updateBalance() {\n $.ajax({\n url: 'https://shared-sandbox-api.marqeta.com/v3/balances/' + user.token,\n type: 'get',\n headers: {\n 'Accept': 'application/json',\n 'Authorization': authHeader\n },\n dataType: 'json',\n success: function (data) {\n console.log(data);\n let gpa = data.gpa;\n $('#balance').text(\"The user's balance is: \" + gpa.ledger_balance + ' and available balance is: ' + gpa.available_balance);\n }\n });\n }", "function _updateWallet() {\r\n if (!_isEmpty(output)) {\r\n address.value = output.address;\r\n publickey.value = output.publicKey;\r\n privatekey.value = output.privateKey;\r\n }\r\n }", "function C24_GetBalances() { \r\n \r\n var C24request = {\r\n 'id' : 'C24',\r\n 'name' : 'Crex24',\r\n 'apikey' : EXKEY,\r\n 'secret' : EXSECRET,\r\n 'command' : \"/v2/account/balance\", \r\n 'uri' : 'https://api.crex24.com',\r\n 'method' : 'GET',\r\n 'payload' : '' // <- wallet address\r\n }; \r\n \r\n \r\n if (ADATTRIB === 'demo') \r\n DataAll = [ {\"currency\": \"ETH\",\"available\": 0.0979, \"reserved\": 0.0 },\r\n {\"currency\": \"BCD\", \"available\": 12.43897,\"reserved\": 0.0 },\r\n {\"currency\": \"BCH\", \"available\": 1.3394, \"reserved\": 1.4013 },]; \r\n else\r\n {\r\n Logger.log(\"Fetch\"); \r\n var response = C24_PrivateRequest(C24request),\r\n DataAll = JSON.parse(UrlFetchApp.fetch(response.uri, response.params));\r\n }\r\n try { Logger.log(\"Validate if we receive a valid response...\"+DataAll[0].currency); } catch(e) {Logger.log(DataAll); Logger.log(\"no or empty response\"); return null;}\r\n Logger.log( DataAll[0].currency);\r\n if (DataAll == null || DataAll == '') { Logger.log(\"no or empty response\"); return null;}\r\n \r\n\r\n var array = [];\r\n for (r in DataAll) { \r\n if (((DataAll[r].available + DataAll[r].reserved) * 10000 ) > 0) {\r\n array.push({\r\n curcodeEX: DataAll[r].currency, \r\n balance: DataAll[r].available + DataAll[r].reserved\r\n }); \r\n }\r\n }\r\n \r\n Logger.log(array); \r\n return (array);\r\n}", "fetchUserAccount() {\n if ( !this._apikey || !this._ajax ) return;\n\n this._ajax.get( this.getSignedUrl( '/v3/account' ), {\n type: 'json',\n headers: { 'X-MBX-APIKEY': this._apikey },\n\n success: ( xhr, status, response ) => {\n let balances = this.parseUserBalances( response );\n this.emit( 'user_balances', balances );\n this.emit( 'user_data', true );\n },\n error: ( xhr, status, error ) => {\n this.emit( 'user_fail', error );\n this.stopUserStream();\n }\n });\n }", "async loadData() {\n const vote = this.state.voteContract;\n const web3 = window.web3;\n\n // account info\n const accounts = await web3.eth.getAccounts();\n this.setState({account: accounts[0]});\n let balanceInWei = await web3.eth.getBalance(this.state.account);\n let balance = web3.utils.fromWei(balanceInWei, \"ether\");\n this.setState({accountBalance: balance});\n\n // deposit info\n const stakedInWei = await vote.methods.get_staked().call({from:this.state.account});\n const staked = web3.utils.fromWei(stakedInWei, \"ether\");\n this.setState({amountDeposited: staked});\n\n // withdraw info\n const withdrawableInWei = await vote.methods.get_withdraw().call({from:this.state.account});\n const withdrawable = web3.utils.fromWei(withdrawableInWei, \"ether\");\n this.setState({amountWithdrawable: withdrawable});\n }", "async getWalletInfo() {\n return new Promise(async resolve => {\n const myWalletInfo = await this.wallet.getWalletInfo();\n resolve(myWalletInfo);\n });\n }", "function retrieve(){\n\tloading(true);\n\t$.post('retrieve.php', \n\t\t\t{id: $('#watchID').val()},\n\t\t\tfunction(response){\n\t\t\t\tif(response === 'false'){\n\t\t\t\t\talert('Wallet retrieval error\\nCheck your Identifier');\n\t\t\t\t\tloading(false);\n\t\t\t\t} else {\n\t\t\t\t\topenWallet(response)\n\t\t\t\t}\n\t\t\t}\n\t);\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 loadBlockchainData(){\n const web3 =window.web3;\n // fetch the account to which metamask is connected to\n const accounts=await web3.eth.getAccounts();\n //console.log(accounts[0]);\n //set the account state to first account of ganache\n this.setState({account:accounts[0]});\n //console.log(this.state.account);\n\n const ethBalance = await web3.eth.getBalance(this.state.account);\n // if same name and value then only name is enoguh\n this.setState({ethBalance});\n\n // Load bibaToken SC\n // import the smart contracts and make their function accessible\n //new web3.eth.Contract(jsonInterface,address,options);\n //const abi = bibaToken.abi;\n // get network id via metamask dynamically\n const networkId = await web3.eth.net.getId();// returns 5777 automatically for ganache\n const tokenData=bibaToken.networks[networkId];\n // it would be in networks->ganache network id->address from bibaToken.json\n //const address= bibaToken.networks[networkId].address;\n // token has the javascript version of smart contract\n //const token = new web3.eth.Contract(abi,address);\n //console.log(token);\n if(tokenData){\n const token = new web3.eth.Contract(bibaToken.abi,tokenData.address);\n //console.log(token);\n this.setState({token});\n let tokenBalance = await token.methods.balanceOf(this.state.account).call();\n //console.log(\"Token Balance:\",tokenBalance.toString());\n if(!tokenBalance){\n toast.error('The Smart Contracts are not migrated properly...');\n return;\n }\n this.setState({tokenBalance:tokenBalance.toString()});\n }else{\n toast.error('bibaToken contract is not deployed to the detected network.');\n return;\n }\n\n // Load ethSwap SC\n const ethSwapData = ethSwap.networks[networkId];\n if(ethSwapData){\n const EthSwap = new web3.eth.Contract(ethSwap.abi,ethSwapData.address);\n this.setState({EthSwap});\n }else{\n toast.error('ethSwap contract is not deployed to the detected network.');\n }\n //console.log(this.state.EthSwap);\n // once all the smart contract are loaded then setloading state to false to remove the loader.\n this.setState({loading:false});\n }", "determineLatestIdToFetch(wallet) {\n let latestIdToFetch = false;\n let priorWallet = this.checkForWalletWithPriorLoadedData(wallet);\n if (priorWallet !== false) {\n if (priorWallet.hasAllDataLoaded('steem')) {\n latestIdToFetch = priorWallet.latestTransactionIdLoaded('steem');\n } else {\n latestIdToFetch = 'load';\n }\n }\n return latestIdToFetch;\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 }", "async storeNewSubmittedTransferData(txHash, addressTo, balancePaymentId, tokenAmount)\n {\n\n var blockNumber = await this.getEthBlockNumber();\n\n\n var balanceTransferData = {\n addressTo: addressTo,\n balancePaymentId: balancePaymentId,\n tokenAmount: tokenAmount,\n txHash: txHash,\n block:blockNumber,\n confirmed: false\n }\n\n console.log('Storing new submitted transfer data',('balance_transfers:'+addressTo.toString()),balanceTransferData)\n\n //helps audit payouts\n //this guy never gets updated and so should not be used\n await this.redisInterface.pushToRedisList(('balance_transfers:'+addressTo.toString()), JSON.stringify(balanceTransferData) )\n\n\n await this.redisInterface.storeRedisHashData('balance_transfer',balancePaymentId, JSON.stringify(balanceTransferData) )\n\n }", "_getActiveWallet(cb, forceRefresh=false) {\n if (forceRefresh !== true && (this.hasActiveWallet() === true || this.isPaired !== true)) {\n // If the active wallet already exists, or if we are not paired, skip the request\n return cb(null);\n } else {\n // No active wallet? Get it from the device\n const payload = Buffer.alloc(0);\n const param = this._buildEncRequest(encReqCodes.GET_WALLETS, payload);\n return this._request(param, (err, res) => {\n if (err) {\n this._resetActiveWallets();\n return cb(err);\n }\n return cb(this._handleGetWallets(res));\n })\n }\n }", "syncActiveWalletState(bypassRefresh=false) {\n const activeWallet = this.state.session.getActiveWallet();\n if (!activeWallet)\n return;\n const isExternal = activeWallet.external;\n if (this.state.walletIsExternal !== isExternal) {\n // We only want to refresh if we know another interface was active before. If this\n // is the first check, just set the flag without calling refresh (it will get called)\n // automatically.\n const shouldRefresh = this.state.walletIsExternal !== null;\n // Set state regardless\n this.setState({ walletIsExternal: isExternal })\n // Refresh if needed\n if (shouldRefresh === true && bypassRefresh !== true)\n this.refreshWallets();\n }\n }", "@action fetchPaymentHistoryDetails() {\n const claimReferenceNumber = this.selectedClaimId;\n if (this.selectedClaimId) {\n this.isLoading = true;\n const _selectedPlayerDetails = JSON.parse(JSON.stringify(this.selectedPlayerDetails));\n const {identity} = _selectedPlayerDetails;\n const obj = {\n firstName: identity['firstName'],\n lastName: identity['lastName'],\n reason: 'reason',\n comment: 'comment'\n }\n const url = `${config.SERVER_BASE_URL}/v1/claim/${claimReferenceNumber}/transactions/history`;\n fetch(url, {\n method: 'POST',\n headers: {\n 'Authorization': `Bearer ${localStorage.getItem('accessToken')}`,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(obj),\n })\n .then(response => response.json())\n .then(res => {\n if (res && res.error) {\n this.successMessage = null;\n this.errorMessage = res.error\n this.showToast = true;\n } else if (res && res.transactions) {\n this.setPaymentHistoryData(res.transactions);\n } else {\n this.successMessage = 'No Results.';\n this.errorMessage = null;\n this.showToast = true;\n this.paymentHistoryData = []\n }\n })\n .catch((error) => {\n this.errorMessage = error.toString();\n });\n }\n }", "addFundToWallet({ commit }, { walletId, fundId }) {\n commit('setWalletLoading', { isLoading: true });\n\n Axios.get('/data/fund' + parseInt(fundId) + '.json').then(({ data: fund }) => {\n commit('addFundToWallet', { walletId, fund });\n commit('resetPercentages', { walletId });\n commit('setWalletLoading', { isLoading: false });\n }).catch(e => console.log(e));\n }", "function loadDataFromBank() {\n console.log('Load data from bank.');\n\n setBankStatusGreen(\"LOADING\");\n\n $('#selectedBankLink').html('');\n $('#bankWebAddr').html('');\n $('#defaultAccount').html('');\n $('#defaultAccount').val(0);\n $('#latestTransaction').html('');\n\n settings.getLoginDetails().then(function(result) {\n var bankingapp_url = result['BankingAppUrl'];\n var username = result['Username'];\n var password = result['Password'];\n\n var data = {};\n data['action'] = 'get_account_list';\n data['username'] = username;\n data['password'] = password;\n\n $.post(bankingapp_url, data, function(response) {\n if(response.result == \"OK\")\n {\n for (var index = 0, len = response.list.length; index < len; ++index) {\n var balance_int = Number(response.list[index].balance);\n var balance_float = balance_int / SATHOSI;\n var balance_str = String(balance_float);\n\n var option_text = '<option value=\"'+ String(response.list[index].account_id) +'\">' + response.list[index].name + ' / ' + balance_str +' ' + response.list[index].currency + '</option>';\n $('#defaultAccount').append(option_text);\n }\n\n // If only one account, set is as the default\n if(response.list.length == 1){\n var account = response.list[0].account_id;\n var account_currency = response.list[0].currency;\n\n settings.getLoginDetails().then(function(login_details) {\n login_details['Account'] = account;\n login_details['AccountCurrency'] = account_currency;\n settings.setLoginDetails(login_details).then(function() {\n $('#defaultAccount').val(account);\n });\n })\n }\n\n loadTransactionList(bankingapp_url, username, password, account);\n\n\n }else{\n $('#latestTransaction option[value=\"status\"]').text('Error loading transaction');\n }\n }, 'json');\n\n });\n }", "async fetchData () {\n const self = this;\n await Market.findOne({\n name: self.market.name\n }, null, {\n sort: {\n timestamp: -1\n }\n }, function (err, doc) {\n if (err) throw err;\n if (doc) {\n self.market = doc;\n } else {\n self.market.save((err) => {\n if (err) {\n Logger.error('Could not save market to database: ' + err);\n throw err;\n }\n });\n }\n });\n this.marketOutput = 0;\n this.status = self.market.status;\n this.plantInOperation = self.market.plantInOperation;\n this.marketOutput = 0;\n this.status = self.market.status;\n }", "function BFX_GetBalance() { \n var bfxrequest = {\n 'apikey' : '•••••••••',\n 'secret' : '•••••••••',\n 'uri' :'https://api.bitfinex.com',\n 'version' : '/v2/',\n 'command' :'auth/r/wallets',\n 'method' :'POST',\n 'payload' : {}\n };\n\n var response = BFX_PrivateRequest(bfxrequest);\n Logger.log( JSON.parse(UrlFetchApp.fetch(response.uri, response.params)) );\n}", "getTransactions(isUpdate, txHash) {\n let obj = {\n 'params': {\n 'address': this.formData.pointerAdd, //pointer address here this.formData.pointerAdd\n 'hash': txHash ? txHash : '',\n 'pageSize': isUpdate ? 100 : 50\n }\n };\n return this._$http.get(this._Wallet.node.host + ':' + this._Wallet.node.port + '/account/transfers/all', obj).then((res) => {\n if (isUpdate) {\n // Check if txes left to load\n if (!res.data.data.length || res.data.data.length < 100) this.noMoreTxes = true;\n //\n for (let i = 0; i < res.data.data.length; i++) {\n this.transactions.push(res.data.data[i]);\n }\n } else {\n this.transactions = res.data.data;\n this.analyzeTransactions();\n }\n });\n }", "function getAccountDetails() {\n scatter.getIdentity({accounts: [network]}).then(function (id) {\n const account = id.accounts.find(function (x) {\n return x.blockchain === 'eos'\n });\n //console.log('account', account);\n hideScatterLoginSub.style.display = \"\";\n eosAccountFunds.style.display = \"block\";\n scatterConnected.style.display = \"block\";\n reloadDataDisplay.style.display = \"\";\n\n let accountID = account[\"name\"];\n document.getElementById(\"scatter-login\").textContent = accountID;\n\n\n // callback\n eos.getCurrencyBalance(contractName, accountID, contractSymbal,).then(result => {\n if (result > '0.0000'){\n document.getElementById(\"accoutBal\").textContent = result;\n } else{\n document.getElementById(\"accoutBal\").textContent = '0.0000';\n }\n\n }).catch(e => {\n console.log(e);\n });\n\n // Contract Table\n eos.getTableRows({\n code: contractName,\n scope: contractName,\n table: contractTable,\n json: true,\n lower_bound: accountID,\n limit: 1\n }).then((table) => {\n //Remove this\n console.log(\"Loading Account Details =======>\");\n\n function getUserDetails(data) {\n return data.filter(value => {\n return value.stake_account >= accountID;\n\n });\n }\n\n\n let userInfo = getUserDetails(table.rows);\n console.log(userInfo[0].stake_account === accountID);\n let sd = new Date(0); // The 0 there is the key, which sets the date to the epoch\n\n\n let today = Math.round((new Date()).getTime() / 1000);\n console.log('Current Time ====> ' + today);\n document.getElementById(\"stakeType\").textContent = 'No Term';\n document.getElementById(\"stakedBal\").textContent = '0.0000';\n document.getElementById(\"stakeType\").textContent = 'Not Available';\n document.getElementById(\"stakeDate\").textContent = 'Not Available';\n document.getElementById(\"escrow\").textContent = 'Not Available';\n stakeBtnDisplay.style.display = \"block\";\n unstakeBtnDisplay.style.display = \"none\";\n claimednaDisplay.style.display = \"none\";\n\n\n if (userInfo.length > 0) {\n //console.log(userInfo[0]);\n let accountTable = (userInfo[0].stake_account === accountID);\n sd.setUTCSeconds(userInfo[0].stake_due);\n if (accountTable) {\n let unstrBal = document.getElementById(\"stakedBal\").textContent;\n let totalunFounds = unstrBal.replace(\"0.0000\", userInfo[0].staked);\n document.getElementById(\"stakedBal\").textContent = totalunFounds;\n document.getElementById(\"stakeDate\").textContent = sd;\n document.getElementById(\"escrow\").textContent = userInfo[0].escrow;\n stakeBtnDisplay.style.display = \"none\";\n unstakeBtnDisplay.style.display = \"block\";\n }\n function refreshData(){\n if ( accountTable && userInfo[0].stake_due <= today ) {\n claimednaDisplay.style.display = \"block\";\n };\n }setInterval(refreshData, 1000);\n if (accountTable && userInfo[0].stake_period === 1) {\n document.getElementById(\"stakeType\").textContent = 'Weekly';\n\n }\n if (accountTable && userInfo[0].stake_period === 2) {\n document.getElementById(\"stakeType\").textContent = 'Monthly';\n\n }\n if (accountTable && userInfo[0].stake_period === 3) {\n document.getElementById(\"stakeType\").textContent = 'Quarterly';\n\n }\n if (accountTable && today > userInfo[0].stake_due) {\n claimednaDisplay.style.display = \"block\";\n\n }\n } else {\n console.log('<======= Error Getting Data From Table');\n }\n\n }).catch(e => {\n loginFail();\n console.log(e);\n });\n }).catch(e => {\n loginFail();\n console.log(e);\n });\n\n }", "async fetchUser () {\n const user = await getJSON('/api/user')\n if (!this.checkResponse(user)) return\n this.user = user\n this.assets = user.assets\n this.exchanges = user.exchanges\n this.walletMap = {}\n for (const [assetID, asset] of Object.entries(user.assets)) {\n if (asset.wallet) {\n this.walletMap[assetID] = asset.wallet\n }\n }\n this.updateMenuItemsDisplay()\n return user\n }", "function finishedBalanceRequest()\r\n\t{\t\r\n\t\t//check if all requests are complete\r\n if (loadedED < tokenCount && loadedW < tokenCount /*|| loadedBid < 1*/) {\r\n return;\r\n }\r\n\t\t\r\n\t\tlet sumETH = 0;\r\n\t\tlet sumToken = 0;\r\n\t\t\r\n\t\tlet loadedBothBalances = false;\r\n\t\tif(loadedED >= tokenCount && loadedW >= tokenCount)\r\n\t\t\tloadedBothBalances = true;\r\n\t\t\r\n\t\tdisplayedED = loadedED >= tokenCount;\r\n\t\tdisplayedW = loadedW >= tokenCount;\r\n\t\tdisplayedBid = loadedBid >= 1;\r\n\t\t\r\n\t\t// get totals\r\n\t\tfor (var i = 0; i < tokenCount; i++) \r\n\t\t{\r\n\r\n\t\t\tlet token = undefined;\r\n\t\t\tif(i < _delta.config.tokens.length)\r\n\t\t\t{\r\n\t\t\t\ttoken = _delta.config.tokens[i];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ttoken = _delta.config.customTokens[i - _delta.config.tokens.length];\r\n\t\t\t}\r\n\t\t\tlet bal = balances[token.name];\r\n\t\t\tif(bal)\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tif(loadedBothBalances)\r\n\t\t\t\t\tbal.Total = Number(bal.Wallet) + Number(bal.EtherDelta);\r\n\t\t\t\telse if(displayedED)\r\n\t\t\t\t\tbal.Total = bal.EtherDelta;\r\n\t\t\t\telse\r\n\t\t\t\t\tbal.Total = bal.Wallet;\r\n\t\t\t\t\t\r\n\t\t\t\tbal['Est. ETH'] = '';\r\n\t\t\t\tif(bal.Bid && bal.Total)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(token.name !== 'ETH')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tlet val = Number(bal.Bid) * Number(bal.Total);\r\n\t\t\t\t\t\tbal['Est. ETH'] = val;\r\n\t\t\t\t\t\tsumToken += val;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if(! bal.bid) {\r\n\t\t\t\t\tbal.bid = '';\r\n\t\t\t\t}\r\n\t\t\t\tif(token.name === 'ETH')\r\n\t\t\t\t{\r\n\t\t\t\t\tbalances.ETH.Bid = '';\r\n\t\t\t\t\tbalances.ETH['Est. ETH'] = bal.Total;\r\n\t\t\t\t\tsumETH = balances.ETH.Total;\r\n\t\t\t\t}\r\n\t\t\t\tbalances[token.name] = bal;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(loadedBothBalances)\r\n\t\t{\r\n\t\t\t$('#ethbalance').html(sumETH.toFixed(fixedDecimals) + ' ETH');\r\n\t\t\t$('#tokenbalance').html(sumToken.toFixed(fixedDecimals) + ' ETH');\r\n\t\t\t$('#totalbalance').html((sumETH + sumToken).toFixed(fixedDecimals) + ' ETH');\r\n\t\t}\r\n\t\t \r\n\t\t\r\n let result = Object.values(balances);\r\n lastResult = result;\r\n\t\tif(loadedED >= tokenCount && loadedW >= tokenCount)\r\n\t\t\tdownloadBalances();\r\n\t\tif(showCustomTokens)\r\n\t\t\tlastResult3 = result;\r\n\r\n\t\tmakeTable(result, hideZero);\r\n }", "async getUserData(setWallets, setSelectedWallet) {\n user = auth.currentUser.uid;\n console.log(user);\n\n let ref = firebase\n .firestore()\n .collection('users')\n .doc(user)\n .collection('wallets');\n\n ref.onSnapshot((snapShot) => {\n let wallets = [];\n snapShot.forEach((col) => {\n let address = col.id;\n let balance = col.data().balance;\n\n let wallet = {\n address: address,\n balance: balance,\n };\n\n let transactionsData = [];\n ref = firebase\n .firestore()\n .collection('users')\n .doc(user)\n .collection('wallets')\n .doc(address)\n .collection('transactions');\n\n ref.onSnapshot((snapShot) => {\n snapShot.forEach((transaction) => {\n let transactionFound = false;\n\n transactionsData.forEach((transactionInArray) => {\n console.log(transactionInArray.id);\n console.log(transaction.id);\n console.log(transactionInArray.id === transaction.id);\n if (transactionInArray.id === transaction.id) {\n let index = transactionsData.indexOf(transactionInArray);\n transactionsData[index] = transaction;\n transactionFound = true;\n }\n });\n if (!transactionFound) {\n transactionsData.push(transaction);\n }\n\n let walletFound = false;\n\n wallets.forEach((walletInArray) => {\n if (walletInArray.address === wallet.address) {\n let index = wallets.indexOf(walletInArray);\n wallets[index] = wallet;\n walletFound = true;\n }\n });\n if (!walletFound) {\n wallets.push(wallet);\n }\n });\n\n transactionsData.sort((a, b) => {\n return b.data().timestamp - a.data().timestamp;\n });\n\n wallet = {\n ...wallet,\n transactions: transactionsData,\n };\n let walletFound = false;\n\n wallets.forEach((walletInArray) => {\n if (walletInArray.address === wallet.address) {\n let index = wallets.indexOf(walletInArray);\n wallets[index] = wallet;\n walletFound = true;\n }\n });\n if (!walletFound) {\n wallets.push(wallet);\n }\n\n setWallets((oldWallets) => {\n setSelectedWallet((old) => old);\n return wallets;\n });\n });\n });\n\n //setWallets(wallets)\n });\n }", "function updateBalance() {\n\n var address = $(\"#generated-address\").text();\n\n $.ajax({\n url: \"/api/balance/\" + address\n })\n .done(function( res ) {\n\n console.log(\"Total balance for address is: \" + res.balance + \" BTC\");\n $(\"#balance\").text(res.balance + \" BTC\");\n });\n}", "async loadBlockchainData() {\n\n //Obteniendo un proveedor desde Metamask\n const web3 = new Web3(Web3.givenProvider || \"http://localhost:8545\");\n\n //Solicitando autorizar el proveedor de Metamask\n window.ethereum.enable();\n\n //Obteniendo todas las cuentas asociadas a la billetera\n const accounts = await web3.eth.getAccounts();\n\n //Guarda toda la cuenta desde la cual se hara peticiones, en el state de React\n this.setState({ account: accounts[0] });\n\n //Crea uns conexion al contrato ElectoralProcessContract usando la direccion de este en la blockchain y su interfas ABI\n const electoralContract = new web3.eth.Contract(TODO_LIST_ABI_ELECTORAL, TODO_LIST_ADDRESS_ELECTORAL);\n\n //Crea uns conexion al contrato VotingTableContract usando la direccion de este en la blockchain y su interfas ABI\n const votingTable = new web3.eth.Contract(TODO_LIST_ABI_TABLE, TODO_LIST_ADDRESS_TABLE);\n\n //Se almacena la instancia de los dos contratos en el state de React y ademas una instancia de la libreria Web3js para emplearla posteriormente\n this.setState({ electoralContract, votingTable, web3, selectTable: TODO_LIST_ADDRESS_TABLE });\n\n //Lista las diferentes mesas\n this.listTables();\n\n //Carga los votos de los candidatos asociados a las mesas\n this.loadTable(TODO_LIST_ADDRESS_TABLE);\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 }", "function BYB_GetBalance() { \n var bybrequest = {\n \"id\" : \"BYB\",\n \"name\" : \"Bybit\",\n \"apikey\" : '•••••••••',\n \"secret\" : '•••••••••',\n \"command\" : \"/open-api/wallet/fund/records\",\n // \"uri\" : \"https://api.bybit.com\",\n \"uri\" : \"api-testnet.bybit.com\",\n \"apiversion\" : \"/v1/\",\n \"method\" : \"get\",\n \"payload\" : \"\"\n }; \n\n var response = BYB_PrivateRequest(bybrequest);\n Logger.log( JSON.parse(UrlFetchApp.fetch(response.uri, response.params)) );\n}", "function inMyWallet() {\n console.log(currentWallet);\n walletValue.textContent = \"$\"+ parseInt(currentWallet.amount);\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}", "async fetchAccountDataByAddress({ commit }, address) {\n let accountInfo = await sdkAccount.getAccountInfoByAddress(address)\n let formattedAccountInfo = {\n address: accountInfo?.address?.address,\n addressHeight: accountInfo?.addressHeight,\n publicKey: accountInfo?.publicKey,\n publicKeyHeight: accountInfo?.publicKeyHeight,\n importance: accountInfo?.importance,\n importanceHeight: accountInfo?.importanceHeight,\n accountType: accountInfo?.accountType,\n linkedAccountKey: accountInfo?.linkedAccountKey,\n };\n let mosaicList = Array.isArray(accountInfo?.mosaics) \n ? accountInfo.mosaics.map( el => ({\n mosaicId: el.hex, \n amount: el.amount\n })) \n : [];\n\n commit('setAccountInfo', accountInfo)\n commit('accountInfo', formattedAccountInfo)\n commit('mosaicList', mosaicList)\n\n let accountBalance = []\n accountInfo.mosaics.forEach((el, idx) => {\n let mosaicLink = `<a href=\"#/mosaic/${el.id}\">${el.id}</a>`\n let balanceObject = {\n idx : idx+1,\n mosaicId: mosaicLink,\n amount: el.amount\n }\n accountBalance.push(balanceObject)\n })\n\n commit('setAccountBalance', accountBalance)\n\n const transactionList = await sdkTransaction.getAccountTransactions(address)\n\n let formattedTansactionList = [];\n formattedTansactionList = transactionList.map(el => ({\n deadline: el.deadline,\n fee: el.fee,\n transactionHash: el.transactionHash,\n transactionType: el.transactionBody?.type\n }));\n\n commit('transactionList', formattedTansactionList);\n\n let accountTransactions = []\n transactionList.forEach((el, idx) => {\n let transactionLink = `<a href=\"#/transaction/${el.transactionHash}\">${el.transactionHash}</a>`\n let transactionObject = {\n idx : idx+1,\n deadline: el.deadline,\n fee: el.fee,\n transactionHash: transactionLink,\n transactionType: el.transactionBody.type\n }\n accountTransactions.push(transactionObject)\n })\n commit('setAccountTransactions', accountTransactions)\n\n\n\n\n const ownedNamespaceList = await sdkNamespace.getNamespacesFromAccountByAddress(address)\n commit('namespaceList', ownedNamespaceList);\n\n let ownedNamespaces = []\n ownedNamespaceList.forEach((el, idx) => {\n let namespaceNameLink = `<a href=\"/#/namespace/${el.namespaceName}\">${el.namespaceName}</a>`\n let ownedNamespaceObject = {\n idx : idx+1,\n namespaceName: namespaceNameLink,\n namespaceType: el.type,\n status: el.active,\n namespaceStartHeight: el.startHeight,\n namespaceEndHeight: el.endHeight\n }\n ownedNamespaces.push(ownedNamespaceObject)\n })\n commit('setAccountOwnNamespaces', ownedNamespaces)\n }", "addWallet() {}", "async function checkBet() {\n if (typeof window.ethereum !== \"undefined\") {\n const provider = new ethers.providers.Web3Provider(window.ethereum);\n const signer = provider.getSigner();\n // could suffice to use provider, but then one gets a diferent adress in setBetting\n // so we can use signer in both places or come up with a different id mechanism (probably bet id or so)\n const contract = new ethers.Contract(greeterAddress, Betting.abi, signer);\n\n console.log(\"provider in fetch: \", { provider });\n try {\n const data = await contract.checkBet();\n // const data = await contract.payMeBack(10 ** 17);\n console.log(\"data: \", { data });\n console.log(\"data: \", convertHex(data));\n } catch (err) {\n console.log(\"Error: \", err);\n }\n }\n }", "function get_bitcoin_price() {\n var location = \"transaction\";\n var url = \"https://blockchain.info/ticker?cors=true\";\n\n $.ajax({\n url: url,\n type: 'GET',\n async: true,\n success: function(data, status) {\n USD_price = data.USD.last;\n console.log(USD_price);\n update_display();\n }\n });\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}", "function saveCashierTill() {\n retrieveValues();\n saveToServer();\n}", "function updatedBalance() {\n const balance = app.currentAccountBalance(id);\n\n //set account name\n const accountName = document.getElementById(\"accountNameLabel\");\n accountName.textContent = `${data.accountName}(${balance})`;\n}", "onSetWallet({\n wallet_name = \"default\",\n create_wallet_password,\n brnkey,\n resolve\n }) {\n var p = new Promise(res => {\n if (/[^a-z0-9_-]/.test(wallet_name) || wallet_name === \"\") throw new Error(\"Invalid wallet name\");\n\n if (this.state.current_wallet === wallet_name) {\n res();\n return;\n }\n\n var add;\n\n if (!this.state.wallet_names.has(wallet_name)) {\n var wallet_names = this.state.wallet_names.add(wallet_name);\n add = idb_instance__WEBPACK_IMPORTED_MODULE_10__[\"default\"].root.setProperty(\"wallet_names\", wallet_names);\n this.setState({\n wallet_names\n });\n }\n\n var current = idb_instance__WEBPACK_IMPORTED_MODULE_10__[\"default\"].root.setProperty(\"current_wallet\", wallet_name);\n res(Promise.all([add, current]).then(() => {\n // The database must be closed and re-opened first before the current\n // application code can initialize its new state.\n idb_instance__WEBPACK_IMPORTED_MODULE_10__[\"default\"].close();\n bitsharesjs__WEBPACK_IMPORTED_MODULE_8__.ChainStore.clearCache();\n stores_BalanceClaimActiveStore__WEBPACK_IMPORTED_MODULE_4__[\"default\"].reset(); // Stores may reset when loadDbData is called\n\n return idb_instance__WEBPACK_IMPORTED_MODULE_10__[\"default\"].init_instance().init_promise.then(() => {\n // Make sure the database is ready when calling CachedPropertyStore.reset()\n stores_CachedPropertyStore__WEBPACK_IMPORTED_MODULE_5__[\"default\"].reset();\n return Promise.all([stores_WalletDb__WEBPACK_IMPORTED_MODULE_1__[\"default\"].loadDbData().then(() => stores_AccountStore__WEBPACK_IMPORTED_MODULE_3__[\"default\"].loadDbData()), actions_PrivateKeyActions__WEBPACK_IMPORTED_MODULE_6__[\"default\"].loadDbData().then(() => stores_AccountRefsStore__WEBPACK_IMPORTED_MODULE_2__[\"default\"].loadDbData())]).then(() => {\n // Update state here again to make sure listeners re-render\n if (!create_wallet_password) {\n this.setState({\n current_wallet: wallet_name\n });\n return;\n }\n\n return stores_WalletDb__WEBPACK_IMPORTED_MODULE_1__[\"default\"].onCreateWallet(create_wallet_password, brnkey, //brainkey,\n true, //unlock\n wallet_name).then(() => this.setState({\n current_wallet: wallet_name\n }));\n });\n });\n }));\n }).catch(error => {\n console.error(error);\n return Promise.reject(error);\n });\n if (resolve) resolve(p);\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 }", "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 }", "refreshAvailableFunds() {\n clearTimeout(this.state.walletTimer);\n this.state.walletTimer = setTimeout(() => {\n this.ws.requestCalc(this.calcs);\n }, 100);\n }", "async getAccountHistoryFullHive(wallet, delayBetweenFetches, latestIdToFetch) {\n let maxTransactions = 1000 + wallet.blockchain.parameters.transactionCountOffset; // Maximum number of transactions is 1000 - need -1 adjustment for Steem\n let latestIdToFetchReached = false; // Stops loop when prior transactions loaded through other blockchain are reached\n let currentStorage = {name: wallet.blockchain.name, earliestRangeTransaction: false}; // Transactions stored in current storage\n let storageNames = new Set([wallet.blockchain.name]); // Set of all storages used\n // Loop for each unloaded range\n for (const transactionsCurrency in wallet.unloadedRanges) {\n // Loop for each unloaded range for blockchain\n for (let range of wallet.unloadedRanges[transactionsCurrency].reverse()) {\n let minTransactions = this.setMinTransactions(range.type); // Force at least a minimum number of transactions to be obtained (for situation where numbers misbehave)\n let expectedRangeComplete = false; // True when transactions to be fetched is less than maximum\n // Set load state\n let loadState = 'normal'; // Load state typically starts as normal\n if (range.lastTransaction.id === false) {\n loadState = 'empty'; // Load state initially set to empty if fetch of latest transaction returns empty\n }\n let rangeEndsHit = {first: false, last: true}; // Allows adjustment of transaction range and removal of overlapping transactions\n let lastTransactionToObtain = range.lastTransaction; // Marker for end of segment\n // Loop until all data obtained, error arises, or prior data reached\n let rangeComplete = false;\n let errorInFetch = false;\n let validityOfLastTransactionInSegment = true;\n while (rangeComplete === false && errorInFetch === false && latestIdToFetchReached === false) {\n // Transactions to obtain is inclusive (i.e. includes both first and last, so should be +1)\n // - however Steem API obtains one more transaction than transactionsToObtain, so +1 removed with transactionCountOffset (corrected in Hive in HF24)\n let transactionsRemainingInRange = lastTransactionToObtain.number - range.firstTransaction.number + 1 + wallet.blockchain.parameters.transactionCountOffset;\n if (transactionsRemainingInRange <= maxTransactions) {\n expectedRangeComplete = true;\n }\n let transactionsToObtain = Math.min(Math.max(Math.min(maxTransactions, transactionsRemainingInRange), minTransactions), lastTransactionToObtain.number + 1 + wallet.blockchain.parameters.transactionCountOffset);\n let firstRequestedNumber = lastTransactionToObtain.number - transactionsToObtain + 1 + wallet.blockchain.parameters.transactionCountOffset;\n // Fetch history segment\n let historySegment = await grapheneAPI.fetchAccountHistorySegment(this.name, wallet.address, lastTransactionToObtain.number, transactionsToObtain);\n // Error handling for fetch\n if (historySegment.hasOwnProperty('error')) {\n errorInFetch = true;\n // Fetch OK\n } else {\n // Extract last and first transactions\n let lastTransactionInSegment = true;\n let firstTransactionInSegment;\n if (loadState === 'normal') {\n // Extract last and first transactions obtained - check validity of last against expected last transaction\n lastTransactionInSegment = this.extractLastTransaction(historySegment.result, wallet.address, wallet.summaryRange.addressNumber, lastTransactionToObtain);\n validityOfLastTransactionInSegment = this.checkValidLastTransaction(lastTransactionInSegment, lastTransactionToObtain);\n firstTransactionInSegment = this.extractFirstTransaction(historySegment.result, wallet.address, wallet.summaryRange.addressNumber, 2, firstRequestedNumber);\n } else if (loadState === 'empty') {\n // Extract first transactions obtained - set last as expected last transaction (no other data available)\n lastTransactionInSegment = lastTransactionToObtain;\n firstTransactionInSegment = this.extractFirstTransaction(historySegment.result, wallet.address, wallet.summaryRange.addressNumber, 1, firstRequestedNumber);\n }\n // Break if last transaction check shows error\n if (validityOfLastTransactionInSegment === false) {\n communication.message(\"Issue with inconsistent account history numbers. Please try again later.\");\n let checkTrans = await grapheneAPI.fetchAccountHistory(this.name, wallet.address, lastTransactionToObtain.number, 1, false, false);\n let checkSegment = await grapheneAPI.fetchAccountHistorySegment(this.name, wallet.address, lastTransactionToObtain.number+200, transactionsToObtain);\n break;\n }\n // Check if range is completed by this segment\n rangeComplete = this.checkRangeComplete(firstRequestedNumber, firstTransactionInSegment, range.firstTransaction, expectedRangeComplete);\n if (rangeComplete === true) {\n rangeEndsHit.first = true;\n }\n // Check if latest id to fetch (due to paired wallet loading) is reached by this segment\n if (latestIdToFetch !== false) {\n latestIdToFetchReached = this.checkIdReached(latestIdToFetch, firstTransactionInSegment.id);\n }\n // Broad filter of segment by block number\n let filteredTransactions = this.broadFilterTransactions(historySegment.result, range.firstTransaction.id, range.lastTransaction.id);\n // Create object of processed transactions for account history segment\n let processedTransactions = this.processHistoryDataSegment(filteredTransactions, wallet.address, wallet.summaryRange.addressNumber);\n // Complete filtering\n let fineFilteredTransactions;\n if (latestIdToFetchReached === false) {\n fineFilteredTransactions = this.fineFilterTransactions(processedTransactions, range.firstTransaction.id, range.lastTransaction.id);\n } else {\n fineFilteredTransactions = this.fineFilterTransactions(processedTransactions, latestIdToFetch, range.lastTransaction.id);\n fineFilteredTransactions = this.fineFilterOutSingleId(fineFilteredTransactions, latestIdToFetch);\n }\n\n // Process data if transactions to store\n if (fineFilteredTransactions.length > 0) {\n // Split transactions by blockchain storage\n let storageInfo = this.splitTransactionsAndRangeByStorage(fineFilteredTransactions, rangeEndsHit, range, firstTransactionInSegment, lastTransactionInSegment, loadState);\n //if (this.checkTransactionsInStorageInfo(storageInfo) === true) {\n // Create new wallet if necessary\n for (let storageName in storageInfo) {\n if (!storageNames.has(storageName)) {\n storageNames.add(storageName);\n if (wallets.findWallet(storageName, wallet.address) === undefined) {\n // Generate a new Wallet instance based on the new address - saves wallet in wallets and also stores the summaryRange in the database\n await wallets.generateNewWallet(blockchains.data[storageName], wallet.address, true);\n let splitResults = await wallet.splitFullRange(storageName, storageInfo, currentStorage);\n currentStorage.name = storageName;\n wallet.rangesCountAdjust(splitResults.prior.transactionsCurrency, splitResults.prior.firstTransaction.number);\n wallet.rangesCountAdjust(splitResults.new.transactionsCurrency, -splitResults.new.lastTransaction.number-1);\n wallets.updateWalletsTable();\n } else {\n console.log('ISSUE HERE')\n }\n }\n }\n // Aggregate transaction across day for frequent transaction types\n for (let storageName in storageInfo) {\n storageInfo[storageName].transactions = this.aggregateHistoryDataSegment(storageInfo[storageName].transactions);\n }\n // Store transactions and transaction ranges in indexedDB\n for (let storageName in storageInfo) {\n let inclusiveTransactionRange = wallet.createInclusiveTransactionRange('loaded', false, storageName, storageInfo[storageName].firstTransaction, storageInfo[storageName].lastTransaction);\n await this.storeTransactions(storageInfo[storageName].transactions, storageName, inclusiveTransactionRange, wallet.blockchain.name);\n wallet.rangesCountAdjust(storageName, inclusiveTransactionRange.lastTransaction.number - inclusiveTransactionRange.firstTransaction.number); //+ this.overlapCount(overlap));\n }\n\n //}\n // Store range searched if no transactions to store\n } else {\n let emptyFirst = {number: firstRequestedNumber, id: false};\n if (rangeComplete === true) {\n emptyFirst = range.firstTransaction;\n }\n let inclusiveTransactionRange = wallet.createInclusiveTransactionRange('loaded', false, currentStorage.name, emptyFirst, lastTransactionToObtain);\n await this.storeTransactions([], currentStorage.name, inclusiveTransactionRange, wallet.blockchain.name);\n wallet.rangesCountAdjust(currentStorage.name, inclusiveTransactionRange.lastTransaction.number - inclusiveTransactionRange.firstTransaction.number); // + this.overlapCount(overlap));\n }\n // Add prior operations loaded range\n if (latestIdToFetchReached === true) {\n let inclusiveTransactionRange = wallet.createInclusiveTransactionRange('loaded', false, currentStorage.name, range.firstTransaction, firstTransactionObtained);\n await this.storeTransactions([], currentStorage.name, inclusiveTransactionRange, wallet.blockchain.name);\n wallet.rangesCountAdjust(currentStorage.name, inclusiveTransactionRange.lastTransaction.number - inclusiveTransactionRange.firstTransaction.number); // + this.overlapCount(overlap));\n }\n // Update wallets table\n wallets.updateWalletsTable();\n // Reset for next loop\n if (rangeComplete === false) {\n lastTransactionToObtain = firstTransactionInSegment;\n currentStorage.earliestRangeTransaction = firstTransactionInSegment;\n if (firstTransactionInSegment.id === false) {\n loadState = 'empty';\n } else {\n loadState = 'normal';\n }\n rangeEndsHit.last = false;\n }\n // Delay\n await logistics.delayInMs(delayBetweenFetches);\n }\n }\n // After range loop ends\n if (errorInFetch === true) {\n // Communicate error, update wallet, update wallets table\n communication.message(\"Error in fetching account history data. Please check connection or wait and retry.\");\n } else if (validityOfLastTransactionInSegment === true) {\n // Communicate completion, update wallet, update wallets table\n communication.message(\"Loading complete.\");\n await wallet.fetchgetWalletData('last');\n wallets.updateWalletsTable();\n }\n }\n }\n return storageNames;\n }", "listTransactions(key) {\n var render = '';\n var bodyFormData = new FormData();\n var promises = [];\n bodyFormData.set('addr', key);\n\n promises.push(\n fetch('https://api.omniexplorer.info/v1/transaction/address/0', {\n method: 'POST',\n body: bodyFormData,\n })\n .then(res => {\n return res.json();\n })\n );\n\n promises.push(\n fetch(`https://chain.api.btc.com/v3/address/${key}/tx`)\n .then(res => {\n return res.json();\n })\n );\n\n\n // Promise.all(promises).then(responses =>\n // Promise.all(responses.map(res => re;s.json())).then(response => {\n // var txArray = [];\n // var historySafex = JSON.stringify(response[0].data.transactions);\n // var historyBitcoin = JSON.stringify(response[1]);\n //\n // console.log(historySafex);\n // console.log(historyBitcoin);\n // })\n // );\n\n Promise.all(promises)\n .then(function (response) {\n var txArray = [];\n var historySafex = response[0].transactions;\n var historyBtc = response[1].data.list;\n console.log(historySafex, historyBtc);\n \n // TODO: Continue from here\n \n /*txArray.push(historySafex);\n txArray.push(historyBtc);\n\n var safexDirection = txArray[0]['referenceaddress'] === key ? \"Received\" : \"Sent\";\n var safexDateTime = new Date(txArray[0]['blocktime'] * 1000);\n var safexConfirmations = txArray[0]['confirmations'] > 15 ? \"(16/16)\" : \"(\" + txArray[0]['confirmations'] + \"/16)\";\n\n\n txArray.forEach((tx) => {\n\n });*/\n\n })\n .catch(function (error) {\n console.log(error);\n alert(\"Could not fetch transaction history...\");\n });\n\n }", "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 function getTradeBalance() {\n await traderBot.api('TradeBalance', {asset: 'ETH'})\n .then((res) => console.log(res))\n .catch((rej) => console.log(rej));\n}", "function fetchWalletId(){\n\t\tvar url = \"https://api.bitcoindollar.io/UserAccess.svc/GetWalletId\";\n\t\t// console.log($scope.userData);\n\t\tvar s = String($scope.userData.UserID);\n\t\tvar postObj = \"\" + s;\n\t\t// var postObj = \"17\";\n\t\t// console.log(postObj)\n\t\t$http.post(url,postObj).then(success,error);\n\n\t\tfunction success(res){\n\t\t\t// console.log(res);\n\t\t\t$scope.userWalletId = JSON.parse(res.data).Message;\n\t\t\tif ($scope.userWalletId.length>0) {\n\t\t\t\t$scope.btcFlag = true;\n\t\t\t}else{\n\t\t\t\t$scope.btcFlag = false;\n\t\t\t}\n\t\t\t// console.log($scope.ReferralList);\n\t\t}\n\n\t\tfunction error(err){\n\t\t\tconsole.log(err);\n\t\t}\n\t}", "async getAccountHistoryFullSteem(wallet, delayBetweenFetches, latestIdToFetch) {\n let maxTransactions = 1000 + wallet.blockchain.parameters.transactionCountOffset; // Maximum number of transactions is 1000 - need -1 adjustment for Steem\n let latestIdToFetchReached = false; // Stops loop when prior transactions loaded through other blockchain are reached\n // Loop for each blockchain in wallet\n for (const transactionsCurrency in wallet.unloadedRanges) {\n // Loop for each unloaded range for blockchain\n for (let range of wallet.unloadedRanges[transactionsCurrency].reverse()) {\n let minTransactions = this.setMinTransactions(range.type); // Force at least a minimum number of transactions to be obtained (for situation where numbers misbehave)\n let expectedRangeComplete = false; // True when transactions to be fetched is less than maximum\n let rangeEndsHit = {first: false, last: true}; // Allows removal of overlapping transactions\n let lastTransactionToObtain = range.lastTransaction; // Marker for end of segment\n // Loop until all data obtained, error arises, or prior data reached\n let rangeComplete = false;\n let errorInFetch = false;\n let validityOfLastTransactionInSegment = true;\n while (rangeComplete === false && errorInFetch === false && latestIdToFetchReached === false) {\n // Transactions to obtaim is inclusive (i.e. includes both first and last, so should be +1)\n // - however Steem API obtains one more transaction than transactionsToObtain, so +1 removed with transactionCountOffset (corrected in Hive in HF24)\n let transactionsRemainingInRange = lastTransactionToObtain.number - range.firstTransaction.number + 1 + wallet.blockchain.parameters.transactionCountOffset;\n if (transactionsRemainingInRange <= maxTransactions) {\n expectedRangeComplete = true;\n }\n let transactionsToObtain = Math.min(Math.max(Math.min(maxTransactions, transactionsRemainingInRange), minTransactions), lastTransactionToObtain.number + 1 + wallet.blockchain.parameters.transactionCountOffset);\n let firstRequestedNumber = lastTransactionToObtain.number - transactionsToObtain + 1 + wallet.blockchain.parameters.transactionCountOffset;\n // Fetch history segment\n let historySegment = await grapheneAPI.fetchAccountHistorySegment(this.name, wallet.address, lastTransactionToObtain.number, transactionsToObtain);\n // Error handling for fetch\n if (historySegment.hasOwnProperty('error')) {\n errorInFetch = true;\n // Fetch OK\n } else {\n // Extract last and first transactions obtained - check validity of last against expcted last transaction\n let lastTransactionInSegment = this.extractLastTransaction(historySegment.result, wallet.address, wallet.summaryRange.addressNumber, lastTransactionToObtain);\n validityOfLastTransactionInSegment = this.checkValidLastTransaction(lastTransactionInSegment, lastTransactionToObtain);\n let firstTransactionInSegment = this.extractFirstTransaction(historySegment.result, wallet.address, wallet.summaryRange.addressNumber, 1, firstRequestedNumber);\n // Break if last transaction check shows error\n if (validityOfLastTransactionInSegment === false) {\n communication.message(\"Issue with inconsistent account history numbers. Please try again later.\");\n break;\n }\n // Check if range is completed by this segment\n rangeComplete = this.checkRangeComplete(firstRequestedNumber, firstTransactionInSegment, range.firstTransaction, expectedRangeComplete);\n // Check if latest id to fetch (due to paired wallet loading) is reached by this segment\n if (latestIdToFetch !== false) {\n latestIdToFetchReached = this.checkIdReached(latestIdToFetch, firstTransactionInSegment.id);\n }\n // Broad filter of segment by block number\n let filteredTransactions = this.broadFilterTransactions(historySegment.result, range.firstTransaction.id, range.lastTransaction.id);\n // Create object of processed transactions for account history segment\n let processedTransactions = this.processHistoryDataSegment(filteredTransactions, wallet.address, wallet.summaryRange.addressNumber);\n // Complete filtering\n let fineFilteredTransactions;\n if (latestIdToFetchReached === false) {\n fineFilteredTransactions = this.fineFilterTransactions(processedTransactions, range.firstTransaction.id, range.lastTransaction.id);\n } else {\n fineFilteredTransactions = this.fineFilterTransactions(processedTransactions, latestIdToFetch, range.lastTransaction.id);\n fineFilteredTransactions = this.fineFilterOutSingleId(fineFilteredTransactions, latestIdToFetch);\n }\n // Adjust transaction range if range complete (minimum number of transactions can result in over-fetch)\n if (rangeComplete === true) {\n firstTransactionInSegment = range.firstTransaction;\n rangeEndsHit.first = true;\n }\n\n // Process data if transactions to store\n if (fineFilteredTransactions.length > 0) {\n // Remove overlapping transactions to prevent doubling\n this.removeOverlapTransactionsSteem(fineFilteredTransactions, rangeEndsHit, range.type, range.firstTransaction, lastTransactionToObtain);\n // Aggregate transaction across day for frequent transaction types\n let aggregatedTransactions = this.aggregateHistoryDataSegment(fineFilteredTransactions);\n // Store transactions and transaction ranges in indexedDB\n let inclusiveTransactionRange = wallet.createInclusiveTransactionRange('loaded', false, wallet.blockchain.name, firstTransactionInSegment, lastTransactionInSegment);\n await this.storeTransactions(aggregatedTransactions, wallet.blockchain.name, inclusiveTransactionRange, wallet.blockchain.name);\n wallet.rangesCountAdjust(wallet.blockchain.name, inclusiveTransactionRange.lastTransaction.number - inclusiveTransactionRange.firstTransaction.number);\n // Store range searched if no transactions to store\n } else {\n let inclusiveTransactionRange = wallet.createInclusiveTransactionRange('loaded', false, wallet.blockchain.name, firstTransactionInSegment, lastTransactionInSegment);\n await this.storeTransactions([], wallet.blockchain.name, inclusiveTransactionRange, wallet.blockchain.name);\n wallet.rangesCountAdjust(wallet.blockchain.name, inclusiveTransactionRange.lastTransaction.number - inclusiveTransactionRange.firstTransaction.number);\n }\n // Add prior operations loaded range\n if (latestIdToFetchReached === true) {\n let inclusiveTransactionRange = wallet.createInclusiveTransactionRange('loaded', false, wallet.blockchain.name, range.firstTransaction, firstTransactionInSegment);\n await this.storeTransactions([], wallet.blockchain.name, inclusiveTransactionRange, wallet.blockchain.name);\n wallet.rangesCountAdjust(wallet.blockchain.name, inclusiveTransactionRange.lastTransaction.number - inclusiveTransactionRange.firstTransaction.number);\n }\n\n // Update wallets table\n wallets.updateWalletsTable();\n // Reset for next loop\n if (rangeComplete === false) {\n lastTransactionToObtain = firstTransactionInSegment;\n rangeEndsHit.last = false;\n }\n // Delay\n await logistics.delayInMs(delayBetweenFetches);\n }\n }\n // After range loop ends\n if (errorInFetch === true) {\n // Communicate error, update wallet, update wallets table\n communication.message(\"Error in fetching account history data. Please check connection or wait and retry.\");\n } else if (validityOfLastTransactionInSegment === true) {\n // Communicate completion, update wallet, update wallets table\n communication.message(\"Loading complete.\");\n await wallet.fetchgetWalletData('last');\n wallets.updateWalletsTable();\n }\n }\n }\n return [wallet.blockchain.name];\n }", "getUserWallet(uid) {\n return Request.get({\n url: `${URLS.WALLET_USER}/${uid}`,\n });\n }", "function balance_update(data) {\n // console.log('Balance Update');\n // for ( let obj of data.B ) {\n // let { a:asset, f:available, l:onOrder } = obj;\n // if ( available == '0.00000000' ) continue;\n // console.log(asset+'\\tavailable: '+available+' ('+onOrder+' on order)');\n // }\n }", "async function showBalance() {\n return findAllInTable(\"account\");\n}", "checkForWalletWithPriorLoadedData(wallet) {\n if (this.name === 'steem') {\n if (wallet.summaryRange.pairs.hasOwnProperty('hive')) {\n return wallets.findWallet('hive', wallet.address);\n }\n }\n return false;\n }", "checkBalance(walletAddress){\r\n var balance = 0;\r\n for(var i = 0; i < this.bc.length; i++){\r\n for(var j = 0; j < this.bc[i].data.length; j++){\r\n if(this.bc[i].data[j].reciever == walletAddress){\r\n balance += this.bc[i].data[j].amount;\r\n } else if (this.bc[i].data[j].sender == walletAddress) {\r\n balance -= this.bc[i].data[j].amount;\r\n }\r\n }\r\n\r\n }\r\n return balance;\r\n }", "function saveBorrowing() {\n retrieveValues();\n saveToServer();\n}" ]
[ "0.6660032", "0.6631854", "0.6615793", "0.6583423", "0.657073", "0.6427267", "0.6401395", "0.63983786", "0.6394166", "0.638086", "0.63560534", "0.6325544", "0.6325153", "0.63162255", "0.6277071", "0.624337", "0.6203192", "0.6162223", "0.61570483", "0.6156683", "0.61560416", "0.61221504", "0.61221504", "0.61138296", "0.61079276", "0.60971504", "0.6093494", "0.60905254", "0.60696536", "0.6065001", "0.6049385", "0.60437644", "0.6028844", "0.6002706", "0.5977958", "0.596438", "0.59342283", "0.59091556", "0.5897953", "0.58663714", "0.58566725", "0.58554983", "0.58362335", "0.58282655", "0.58227175", "0.5810277", "0.5809536", "0.5804129", "0.5788232", "0.57723826", "0.5770716", "0.57569736", "0.5728986", "0.57264435", "0.5716321", "0.5698441", "0.5696712", "0.5685559", "0.5681842", "0.56716955", "0.5667881", "0.5654852", "0.5652308", "0.5651186", "0.5646481", "0.56298167", "0.5627984", "0.56227976", "0.56208587", "0.56115174", "0.56113094", "0.5602647", "0.5591428", "0.5589199", "0.5586929", "0.55853075", "0.5570349", "0.55674934", "0.5555973", "0.5555169", "0.55463433", "0.5537028", "0.55301255", "0.5509919", "0.5508228", "0.5505644", "0.5497653", "0.5495944", "0.5492901", "0.54824764", "0.54816866", "0.5474933", "0.5473634", "0.5473028", "0.54629606", "0.54619753", "0.5452776", "0.54351145", "0.54342365", "0.5432601" ]
0.72206116
0
change tag_id to tag names
function handlePostTags(data) { let tagArr = []; for (let i = 0; i < data.length; i++) { tagArr.push(data[i].tag_name); } return tagArr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set_tags(self) {\n var tags = [];\n for (var i = 0; i < self.items.length; i++) {\n if (self.items[i]['tags']) {\n var these_tags = self.items[i]['tags'];\n var slugs = these_tags.map(self.slugify);\n tags = tags.concat(these_tags);\n if (self.items[i]['className']) {\n self.items[i]['className'] = self.items[i]['className'] + ' ' + slugs.join(' ');\n } else {\n self.items[i]['className'] = slugs.join(' ');\n }\n }\n }\n tags = tags.filter( self.onlyUnique );\n tags.sort();\n self.setup_filters(self,tags,\"Tags\");\n return tags;\n }", "function updateTagNameDisplayer(element) {\n $(\"#tag-name\").text(\"<\" + element.tagName + \">\");\n}", "function tags(tags) { }", "function updateTags(tags) {\n $('#tags').empty();\n tags = Object.keys(tags);\n tags = tags.sort();\n $.each(tags, function(index, tag) {\n var taglink = $('<a>')\n .text(tag)\n .addClass('taglink')\n .bind('click', function() {\n updateTagView(readTagView(), tag);\n });\n $('#tags').append(taglink);\n });\n}", "function createObjectName(tags) {\n var tagArray = tags.split(\" \"); \n var name = tagArray.map(function(tag) {\n return tag.charAt(0).toUpperCase() + tag.slice(1);\n }).join(\" \"); \n\n return name;\n }", "toString(nameMap = undefined) {\n return this.tags.map(a => `#${a}`).join(' ');\n }", "function updateExistingTagLabels() {\n removeExistingTagLabels();\n if (taggableId !== \"\") {\n sendGetTagsRequest();\n }\n}", "function toggleTag(tag) {\n //writeDebug(\"called toggleTag(\"+tag+\")\");\n\n var currentValues = $input.val() || '';\n currentValues = currentValues.split(/\\s*,\\s*/);\n var found = false;\n var newValues = new Array();\n for (var i = 0; i < currentValues.length; i++) {\n var value = currentValues[i];\n if (!value) \n continue;\n if (value == tag) {\n found = true;\n } else {\n if (value.indexOf(tag) != 0) {\n newValues.push(value);\n }\n }\n }\n\n if (!found) {\n newValues.push(tag)\n }\n //writeDebug(\"newValues=\"+newValues);\n\n setTags(newValues);\n }", "function tagMapping (selector){\n var tag_array = $(selector).get(); //Create a native array of <span>\n var tag_names = [], //with duplicated names\n tags = [], //sorted and without duplicated names\n tag_counts = [];\n \n for (x in tag_array) { //change jq native array to an array of strings\n tag_names.push($(tag_array[x]).html());\n }\n \n // remove the duplicated tag names\n tag_names.sort();\n tags =[tag_names[0]];\n for (i=0; i<tag_names.length-1; i++){\n if (tag_names[i] != tag_names[i+1]){\n tags.push(tag_names[i+1]);\n }\n }\n \n // Count the tags\n for (x in tags){\n var txt = \"#wrapper span.\" + tags[x] + '_color';\n tag_counts.push($(txt).length);\n }\n \n // Out put the tags and counts to the side column\n \n for (x in tags){\n var tag_color = tags[x] + '_color';\n var tag_size = tags[x] + '_size';\n var newSpan;\n\n \n if(x==0){\n var be_string;\n if (tag_counts[x] > 1){ be_string = \" were \"; } else { be_string = \" was \"};\n \n newSpan = '<span class=\"count ' + tag_color + '\">'\n + tag_counts[x] + '</span>' + be_string\n + 'filed under <span class=\"nav_link ' + tag_color +' ' + tag_size +'\">' + tags[x] +'</span>, ';\n \n $('#tagCloud p').append(newSpan);\n \n }else if( x == tags.length - 1){\n newSpan = 'and <span class=\"count ' + tag_color + '\">'\n + tag_counts[x] + '</span> under <span class=\"nav_link ' +tag_color +' ' + tag_size +'\">' + tags[x] +'</span>.';\n $('#tagCloud p').append(newSpan);\n }else{\n newSpan = '<span class=\"count ' + tag_color + '\">'\n + tag_counts[x] + '</span> under <span class=\"nav_link ' + tag_color +' ' + tag_size +'\">' + tags[x] +'</span>, ';\n $('#tagCloud p').append(newSpan);\n }\n }\n \n //Set the font size for the tag cloud\n var count_min = Math.min.apply(Math, tag_counts) , count_max = Math.max.apply(Math, tag_counts); //found the min and max count\n var size_min = 0.9, size_max = 1.5;\n for (x in tag_counts){ \n var tag_size = size_max * (tag_counts[x] - count_min)/(count_max - count_min);\n var selector = '.'+tags[x]+'_size';\n \n if (tag_size < size_min){\n $(selector).css({'font-size':(size_min + 'em')});\n }else{\n $(selector).css({'font-size':(tag_size + 'em')});\n }\n }\n \n }", "setTagIds(event) {\n let tagIds = null;\n if (event.value.length) {\n tagIds = [];\n for (let i = 0; i < event.value.length; i++) {\n tagIds.push(event.value[i].id);\n }\n }\n this.postsService.post.tag_ids = tagIds;\n }", "function uniqueTagNames(tags, tagsConfidence){\n tags.sort();\n\n let tagsToAdd = [];\n let j = 0;// j = index for tagsConfidence\n let i = 0;// i = index for tags\n\n //inserting all the tags in tagsToAdd in a sorted way\n while(i < tags.length && j < tagsConfidence.length){\n if(tagsConfidence[j]['name'] < tags[i]){\n if(tagsConfidence[j]['name'] != tagsToAdd[tagsToAdd.length-1])\n tagsToAdd.push(tagsConfidence[j]['name']);\n j++;\n }else{\n if(tags[i] != tagsToAdd[tagsToAdd.length-1])\n tagsToAdd.push(tags[i]);\n i++;\n }\n }\n\n while(j < tagsConfidence.length){\n if(tagsConfidence[j]['name'] != tagsToAdd[tagsToAdd.length-1])\n tagsToAdd.push(tagsConfidence[j]['name']);\n j++;\n }\n\n while(i < tags.length){\n if(tags[i] != tagsToAdd[tagsToAdd.length-1])\n tagsToAdd.push(tags[i]);\n i++;\n }\n\n tags = tagsToAdd;\n\n // tags.sort(); // this won't be necessary\n return tags;\n}", "function changeTags(value){\n setTags(value)\n console.log(tags)\n }", "function makingTags(tags) {\n var addTags = '';\n if (tags !== null) {\n addTags += '<ul class=\"tags\">';\n for (let i = 0; i < tags.length; i++) {\n addTags += '<li>' + tags[i] + '</li>';\n }\n addTags += '</ul>';\n }\n return addTags;\n}", "function addTag(id, tag){\n\t\n}", "function renameTag(orig, modified) {\n db.run(\"UPDATE tagnames SET name=(?) WHERE name LIKE (?)\", modified, orig, function (err) {\n if (err) {\n console.log(err);\n return;\n }\n console.log(\"UPDATE: \"+this.changes);\n });\n}", "function addTag (name) {\n $('#post_current_tags').val(function () {\n return $(this).val().concat(name, ',')\n })\n $('.current-tags').append(\"<span class='badge badge-pill badge-primary tag'>\" + name + '</span>')\n }", "updateTags() {\n // Clear previous tags\n let parent = document.getElementById('tag-container');\n this.clearChildNodes(parent);\n\n let {area, comparisonAreas} = this.selected;\n\n // Create tag for focused country\n this.createTag(area.country, true);\n\n // Create tag for each comparison area\n for (let i = 0; i < comparisonAreas.length; i++) {\n this.createTag(comparisonAreas[i], false);\n }\n }", "function removeExistingTagLabels() {\n toAddTagList = new Set();\n const tagList = document.getElementById(\"tag-line\");\n while (tagList.firstChild) {\n tagList.removeChild(tagList.firstChild)\n }\n}", "set tag(value) {}", "set tag(value) {}", "set tag(value) {}", "set tag(value) {}", "mapGenericTag(tag, warnings) {\n tag = { id: tag.id, value: tag.value }; // clone object\n this.postMap(tag, warnings);\n // Convert native tag event to generic 'alias' tag\n const id = this.getCommonName(tag.id);\n return id ? { id, value: tag.value } : null;\n }", "function updateTagView(tags, changedTag) {\n var outputTags = [];\n\n if (changedTag) {\n var tagIndex = tags.indexOf(changedTag);\n if (tagIndex == -1) {\n tags.push(changedTag);\n } else {\n tags.splice(tags.indexOf(changedTag), 1);\n }\n }\n\n $.each(tags, function(index, tag) {\n if (tag.match(/ /)) {\n outputTags.push('[[' + tag + ']]');\n } else {\n outputTags.push(tag);\n }\n });\n \n $('#editor input').val(outputTags.join(' '))\n}", "function forgivingTag (tag, tags) {\n if (tag[0] !== 'v') tag = 'v' + tag\n if (tags.indexOf(tag) >= 0) return tag\n const unprefixed = tag.replace(/^v/, '')\n if (tags.indexOf(unprefixed) >= 0) return unprefixed\n return tag\n}", "additionalNametags(self) { return []; }", "setupTags() {\n let allTags = [];\n this.model.forEach(function(post) {\n post.tags.forEach(function(tag) {\n let eTag = allTags.find(function(e){\n return e.name = tag;\n });\n\n if(eTag === undefined) {\n allTags.push({id: tag, name: tag, count: 1});\n } else {\n eTag.count++;\n }\n });\n });\n this.set('tags', allTags);\n }", "looper(tags) {\n\t\tvar tagString = \"\";\n\t\tif (Array.isArray(tags)) {\n\t\t\tfor (var i = 0; i < tags.length; i++) {\n\t\t\tif (i > 0) {\n\t\t\t\ttagString = tagString + \", \" + tags[i];\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttagString = tagString + tags[i];\n\t\t\t}\n\t\t}\n\t\t}\n\t\treturn tagString;\n\t}", "function addTagLabel(name) {\n let tagList = document.getElementById(\"tag-line\");\n let newTag = document.createElement(\"span\");\n let newText = document.createElement(\"span\");\n let newRemove = document.createElement(\"a\");\n let newIcon = document.createElement(\"i\");\n let input = document.getElementById(\"tag-add\");\n\n input.value = \"\";\n\n newTag.className = \"tag-label tag\";\n newTag.id = name;\n\n let aElement = document.createElement('a');\n aElement.innerText = name;\n newText.appendChild(aElement);\n\n newIcon.className = \"remove glyphicon glyphicon-remove-sign glyphicon-white\";\n\n newRemove.onclick = function() {\n tagList.removeChild(newTag);\n toAddTagList.delete(name.toLowerCase());\n removeTagFromItem(name);\n };\n newText.onclick = function() {\n window.location.href = '/tags/display/' + encodeURIComponent(name.toLowerCase());\n };\n newRemove.appendChild(newIcon);\n newTag.appendChild(newText);\n newTag.appendChild(newRemove);\n\n if(!toAddTagList.has(name)) {\n toAddTagList.add(name);\n tagList.appendChild(newTag);\n }\n}", "function changeAssignedTags(state, actionTag) {\n const filteredState = state.filter(tag => (tag.id !== actionTag.tagCategory.id));\n\n if (actionTag.tagValue && actionTag.tagValue.length > 0) {\n return [...filteredState,\n {\n description: actionTag.tagCategory.description,\n id: actionTag.tagCategory.id,\n values: actionTag.tagValue,\n }];\n }\n\n return [...filteredState];\n}", "function Tag(id) {\n\tthis.id = id;\n\tthis.name = _t('label.upper.tag');\n\tthis.dateCreated = '00/00/0000';\n}", "function reconstructTags() {\n\tlet vf = $('input#class-tags-input-field');\n\tlet hf = $('.class-tags-input-hidden');\n\tlet words = hf.val().split(';;');\n\n\tfor (var i = words.length - 1; i >= 0; i--) {\n\t\tvf.val(words[i]);\n\t\taddTag();\n\t}\n\n\thf.val('');\n}", "function attributeIds(vm) {\r\n var tagCounters = Object.create(null);\r\n for (var i = 0; ++i < d.all.length;) {\r\n var el = d.all[i];\r\n if (el.sourceLine > 0 && el != d.body) {\r\n var tagCounter = tagCounters[el.tagName] = 1 + (tagCounters[el.tagName] | 0);\r\n if (!el.id) {\r\n var tagId = el.tagName.toLowerCase() + tagCounter;\r\n if (!getOutputPane().contentWindow[tagId]) {\r\n getOutputPane().contentWindow[tagId] = el;\r\n el.sourceTagId = tagId;\r\n vm.idMappings.add(tagId);\r\n console.log(tagId, el);\r\n }\r\n }\r\n }\r\n }\r\n }", "static uposTags() {\n // return [ \"ADJ\", \"ADP\", \"ADV\", \"AUX\", \"CONJ\", \"DET\", \"INTJ\", \"NOUN\", \"NUM\", \"PART\", \"PRON\", \"PROPN\", \"PUNCT\", \"SCONJ\", \"SYM\", \"VERB\", \"X\" ]\n return [\n {\n \"value\": \"ADJ\",\n \"label\": \"Adjective\"\n },\n {\n \"value\": \"ADP\",\n \"label\": \"Adposition\"\n },\n {\n \"value\": \"ADV\",\n \"label\": \"Adverb\"\n },\n {\n \"value\": \"AUX\",\n \"label\": \"Auxiliary Verb\"\n },\n {\n \"value\": \"CCONJ\",\n \"label\": \"Coordinating Conjunction\"\n },\n {\n \"value\": \"DET\",\n \"label\": \"Determiner\"\n },\n {\n \"value\": \"INTJ\",\n \"label\": \"Interjection\"\n },\n {\n \"value\": \"NOUN\",\n \"label\": \"Noun\"\n },\n {\n \"value\": \"NUM\",\n \"label\": \"Numeral\"\n },\n {\n \"value\": \"PART\",\n \"label\": \"Particle\"\n },\n {\n \"value\": \"PRON\",\n \"label\": \"Pronoun\"\n },\n {\n \"value\": \"PROPN\",\n \"label\": \"Proper Noun\"\n },\n {\n \"value\": \"PUNCT\",\n \"label\": \"Punctuation\"\n },\n {\n \"value\": \"SCONJ\",\n \"label\": \"Subordinating Conjunction\"\n },\n {\n \"value\": \"SYM\",\n \"label\": \"Symbol\"\n },\n {\n \"value\": \"VERB\",\n \"label\": \"Verb\"\n },\n {\n \"value\": \"X\",\n \"label\": \"Other\"\n }\n ]\n }", "onUpdateTagAtIndex() {}", "function replaceTextByTag(tag) {\n\tfor (var i = 0; i < tag.length; i++) {\n\t\tvar words = tag[i].innerText.split(' ');\n\t\tfor (var j = 0; j < words.length; j++) {\n\t\t\twords[j] = 'Hodor'\n\t\t}\n\t\ttag[i].innerText = words.join(' ');\n\t}\n}", "function getLabelFromId(id) {\n return id.replace('_', ' ').replace(/\\w\\S*/g, function(txt){\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n });\n}", "applyTags(tags) {\n return (\n tags &&\n tags\n .filter(t => this.state.selectedTags.indexOf(t.id) > -1)\n .map(t => ({ title: t.title, id: t.id }))\n );\n }", "onReplaceTagAtIndex() {}", "tagChange(tag) {\n let tagPos = this.tags.indexOf(tag);\n if (tagPos === this.tags.length-1 && (tag.name !== '' || tag.value !== '')) this.addEmptyTag();\n }", "function addTag(tag)\n{\n if (is_similar() && tag !== '')\n {\n $('.your_tags')\n .append('\\\n <a class=\"dropdown-item cursor\" name=\"tag\">#'\n + tag +\n '</a>'\n );\n }\n\n function is_similar()\n {\n let my_tags = [];\n\n for (let spl of $('a[name=tag]')){\n my_tags.push(spl.innerHTML);\n }\n\n return ((my_tags.indexOf(\"#\" + tag) == -1));\n }\n}", "function generateTags() {\n let allTags = {};\n const articles = document.querySelectorAll(optArticleSelector);\n\n for (let article of articles) {\n\n const tagList = article.querySelector(optArticleTagsSelector);\n let html = '';\n const articleTags = article.getAttribute('data-tags');\n const articleTagsArray = articleTags.split(' ');\n\n for (let tag of articleTagsArray) {\n const linkHTMLData = { id: tag, title: tag };\n const linkHTML = templates.tagLink(linkHTMLData);\n html = html + linkHTML + ' ';\n\n // eslint-disable-next-line no-prototype-builtins\n if (!allTags.hasOwnProperty(tag)) {\n allTags[tag] = 1;\n } else {\n allTags[tag]++;\n }\n }\n tagList.innerHTML = html;\n }\n\n const tagList = document.querySelector('.tags');\n const tagsParams = calculateTagsParams(allTags);\n const allTagsData = { tags: [] };\n\n for (let tag in allTags) {\n allTagsData.tags.push({\n tag: tag,\n count: allTags[tag],\n className: calculateTagClass(allTags[tag], tagsParams)\n });\n\n }\n tagList.innerHTML = templates.tagCloudLink(allTagsData);\n }", "applyTags(tags) {\n var qp = { tags: tags.toString() };\n return this.refreshModel(qp).then( model =>{\n this.emit(events.TAGS_SELECTED);\n return model;\n });\n }", "function construct_tag(tag_name){\n render_tag = '<li class=\"post__tag\"><a class=\"post__link post__tag_link\">' + tag_name + '</a> </li>'\n return render_tag\n}", "function populateTagField (tagArray){\n\t\ttagArray.forEach(addTag);\n\t}", "function convertEntitiesToTags() {\r\n\t\tfor (var id in w.entities) {\r\n\t\t\tvar markers = w.editor.dom.select('[name=\"' + id + '\"]');\r\n\t\t\tvar start = markers[0];\r\n\t\t\tvar end = markers[1];\r\n\r\n\t\t\tvar nodes = [ start ];\r\n\t\t\tvar currentNode = start;\r\n\t\t\twhile (currentNode != end && currentNode != null) {\r\n\t\t\t\tcurrentNode = currentNode.nextSibling;\r\n\t\t\t\tnodes.push(currentNode);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tw.editor.$(nodes).wrapAll('<entity id=\"'+id+'\" _type=\"'+w.entities[id].props.type+'\" />');\t\t\t\r\n\t\t\tw.editor.$(markers).remove();\r\n\t\t}\r\n\t}", "function appendTags() {\n \n $.each(availableTags, function(k, tag) {\n $('#DataTags').append(\n '<a href=\"#\" class=\"label\" onclick=\"Tags.toggleTag(this, \\''+tag+'\\')\">'+tag+'</a> '\n );\n });\n \n }", "function cambiarIdsTags(){\n var contadorEspañol = 1;\n var contadorIngles = 1;\n //Cambiara todos los id de los tags obtenidos\n while(true){\n //Busca el elemento que contiene la informacion de los tag\n if(document.getElementById(\"formTag\")){\n elemento = document.getElementById(\"formTag\"); //Busca el contenedor de los tags\n elemento.id = \"formTag\" + contadorEspañol; //cambia el id del contenedor de los tag al siguiente\n elemento = document.getElementById(\"inputTagEspañol\"); //busca el tag español actual\n elemento.id = \"inputTagEspañol\" + contadorEspañol; //Cambia el id al tagSiguiente\n elemento.name = \"tagEspañol\" + contadorEspañol; //Cambia el nombre al tagSiguiente\n elemento = document.getElementById(\"inputTagIngles\"); //busca el tag ingles actual\n elemento.id = \"inputTagIngles\" + contadorIngles; //cambia el id al tagSiguiente\n elemento.name = \"tagIngles\" + contadorIngles; //cambia el nombre del tagSiguiente\n botonEliminar = document.getElementById(\"eliminarTag\"); //busca el boton eliminar del tag actual\n botonEliminar.id = \"\"+contadorEspañol; //cambia el id del boton eliinar al tagSiguiente\n contadorEspañol++;\n contadorIngles++;\n cantidadTags++;\n }\n else{\n break;\n }\n }\n}", "function getTags() {\n\tvar tagString = \" \";\n\tfor (let tag of safeQueryA('div.boxbody td a[rel=\"tag\"]')) {\n\t\ttagString += tag.innerText.replace(/[#,]/g, '') + \" \";\n\t};\n\treturn tagString.replace(/[,\\\\/:?<>\\t\\n\\v\\f\\r]/g, '_');\n}", "function setupTags(pageId, tags) {\n // Remove old tags stuff if it's there\n $(\"DIV#\" + pageId + \" input#Tags ~ DIV.superblyTagfieldDiv\").remove();\n // Get the populated values\n var data = $(\"DIV#\" + pageId + \" input#Tags\").val();\n if (data != \"\")\n data = data.split(\",\");\n else\n data = [];\n\n var tagArray = convertTagObjectsToStrArray(tags);\n\n // Setup tags field\n $(\"DIV#\" + pageId + \" input#Tags\").superblyTagField({\n allowNewTags: true,\n showTagsNumber: 10,\n preset: data,\n tags: tagArray\n });\n}", "function RmTag(tagID,tagText,tagValue)\n{\n // DESCRIPTION:\n // Removes a tag from the tag-list\n\n // Remove\n // a) Custom Tags and Tags without special letters\n var oldStr = document.getElementById(\"tag_str\").value;\n var newStrPre = oldStr.replace(\"|\" + tagText + \"|\",\"\");\n\n // b) Tags with custom letters\n newStr = newStrPre.replace(\"|\" + tagValue + \"|\",\"\");\n\n document.getElementById(\"tag_str\").value = newStr;\n\n document.getElementById(\"tagID\" + tagID).remove();\n}", "function saveTags() {\n $field.val(\n $.map($list.find('li > span'), function(obj) {\n return $(obj).text();\n }).join(',')\n );\n }", "updateTags() {\n let tags = this.get('tags');\n let oldTags = tags.filterBy('id', null);\n\n tags.removeObjects(oldTags);\n oldTags.invoke('deleteRecord');\n }", "function fixTag(tag) {\n var temp = '<';\n for (var i = 1; i < tag.length; ++i) {\n if (tag.charAt(i).match(/[a-z\\-]/i)) {\n temp += tag.charAt(i);\n } else {\n break;\n }\n }\n return temp;\n\n}", "function setTags(tags, doSort) {\n //writeDebug(\"called setTags(\"+tags+\")\");\n\n clearSelection();\n var values;\n if (typeof(tags) == 'object') {\n values = tags;\n } else {\n values = tags.split(/\\s*,\\s*/);\n }\n if (!values.length) {\n return;\n }\n var tmpValues = new Array()\n for (var i = 0; i < values.length; i++) {\n tmpValues.push(values[i].replace(/([^0-9A-Za-z_])/, '\\\\$1'));\n }\n var filter = \"#\"+tmpValues.join(\",#\");\n //writeDebug(\"filter=\"+filter);\n $tagCloud.find(filter).addClass(\"current\");\n if (doSort) {\n values = values.sort();\n }\n $input.val(values.join(\", \"));\n }", "function addTagInternal( tag ) {\n if( typeof tag === 'string' && attrs.tagTitleField ) {\n var tmp = {};\n tmp[attrs.tagTitleField] = tag;\n tag = tmp;\n }\n\n scope.tags.push( tag );\n scope.inputText = '';\n scope.selection = -1;\n }", "function renameTreeCategory(categoryId, identifier)\n\t{\n\t\tvar elements = getElementsById(categoryId);\n\t\tfor (var j=0; j<elements.length; j++)\n\t\t{\n\t\t\telements[j].children(1).firstChild.nodeValue = identifier;\n\t\t}\n\t}", "function fixupTags(editor) {\n var text = editor.code.get();\n\n editor.code.set(text.replace(/\\[Tag\\:([^\\]]+)]/gi, '<span class=\"redactor-mention\">$1</span>'));\n}", "function idify ($) {\n $('h1, h2, h3, h4, h5, h6').each(function () {\n var $this = $(this)\n $this.attr('id', slugify($this.text()).toLowerCase())\n })\n}", "function updateCodeList() {\n let added_tags = '';\n let remove_tags = '';\n Object.keys(selectedCode).forEach((key, idx) => {\n if (selectedCode[key] == 0) {\n let visit = key.split('-')[0];\n let code = key.split('-')[1];\n let name = ptTestData[2][code];\n remove_tags = remove_tags + \"<span class ='badge badge-warning drug-tag'>\"\n + visit + ': ' + name.toLowerCase().substring(0, 10) + \"</span> <br>\";\n } else if (selectedCode[key] == 2) {\n let visit = key.split('-')[0];\n let code = key.split('-')[1];\n added_tags = added_tags + \"<span class ='badge badge-success drug-tag'>\"\n + drug_dic[code].toLowerCase().substring(0, 20) + \"</span> <br>\";\n }\n });\n $('#added-drugs').html(added_tags);\n $('#removed-codes').html(remove_tags);\n}", "function getTagName(event) {\n let sTag;\n const tag = event.ctx.tag;\n if (tag) {\n switch (typeof tag) {\n case 'string':\n sTag = tag;\n break;\n case 'number':\n if (Number.isFinite(tag)) {\n sTag = tag.toString();\n }\n break;\n case 'object':\n // A tag-object must have its own method toString(), in order to be converted automatically;\n if (hasOwnProperty(tag, 'toString') && typeof tag.toString === 'function') {\n sTag = tag.toString();\n }\n break;\n default:\n break;\n }\n }\n return sTag;\n}", "function removeTagname(tagname) {\n db.run(\"DELETE FROM tagnames WHERE name LIKE (?)\", tagname, function (err) {\n if (err) {\n console.log(err);\n return;\n }\n console.log(\"DELETE: \"+this.changes);\n });\n}", "function captureTagName() {\n var startIdx = currentTag.idx + (currentTag.isClosing ? 2 : 1);\n return html.slice(startIdx, charIdx).toLowerCase();\n }", "addTag(name) {\n const tag = this.tags.find((tag) => {\n return tag.name === name;\n });\n if (!tag) {\n this.tags = [\n ...this.tags,\n { id: this.getIdTags(), name: name, checked: false },\n ];\n } else {\n }\n }", "function renderTags() {\r\n\r\n //Criar o HTML (option) para todos os tags\r\n let strHtml = \"\"\r\n for (let i = 0; i < tags.length; i++) {\r\n strHtml += `<label class=\"form-check-label mr-3\">\r\n <input class=\"form-check-input\" type=\"checkbox\" name=\"\" id=\"\" value=\"${tags[i]._id}\"> ${tags[i]._name}</label><br>`\r\n }\r\n let selTags = document.getElementById(\"idSelTags\")\r\n selTags.innerHTML = strHtml\r\n\r\n}", "tagId(state) {\n return state.tagId;\n }", "function removeTag() {\n var clicked = $(this).text();\n //find the tag that needs to be deleted\n for (var i = 0; i < tagArray.length; i++) {\n if (tagArray[i] == clicked) {\n tagArray.splice(i, 1);\n $(\".\" + i + \"\").remove();\n };\n };\n\n //reset the added tags to make sure there is no brake in name numbers\n AppendToDiv();\n }", "function tag(id) {\n\turl = \"tag.php?id=\" + id + \"&tag=\" + document.getElementById('newtag').value;\n\tdoAjaxCall(url, \"updateTag\", \"GET\", true);\n}", "function update_taglist(tags)\n {\n // compute counts first by iterating over all notes\n var counts = {};\n $.each(notesdata, function(id, rec) {\n for (var t, j=0; rec && rec.tags && j < rec.tags.length; j++) {\n t = rec.tags[j];\n if (typeof counts[t] == 'undefined')\n counts[t] = 0;\n counts[t]++;\n }\n });\n\n rcmail.triggerEvent('kolab-tags-counts', {counter: counts});\n\n if (tags && tags.length) {\n rcmail.triggerEvent('kolab-tags-refresh', {tags: tags});\n }\n }", "function addSpaceToTagsDepartments(data) {\n var tags = [];\n var departments = [];\n data.tags.forEach(tag => {\n tags.push(\" \" + tag);\n })\n data.departments.forEach(department => {\n departments.push(\" \" + department);\n })\n data.tags = tags;\n data.departments = departments;\n return data;\n }", "function redisplayTags() {\n // Change tag labels to reflect the gender reality.\n var tagboxes = document.getElementsByClassName('tagbox');\n for (var i = 0; i < tagboxes.length; ++i) {\n var tagButtons = tagboxes[i].getElementsByTagName('input');\n tagButtons[0].value = replaceGenderWords(tagNames[i]);\n }\n}", "function getTagNames(event, desc, callback) {\n\n var tagIds = event['tags'];\n\n // If there are no tags, don't make a request to the server\n if (tagIds.length == 0) {\n desc += 'None';\n callback(event, desc, []);\n return;\n }\n\n // Send GET request\n jQuery.ajaxSettings.traditional = true;\n $.ajax({\n url: \"http://localhost:8000/api/tag/retrieve\",\n method: \"GET\",\n data: {\n id: tagIds\n },\n success: function (tagNames) {\n // Append the tag names to description\n for (var i = 0; i < tagNames.length-1; i++) {\n desc += tagNames[i]['fields']['name'] + \", \";\n }\n desc += tagNames[tagNames.length-1]['fields']['name'];\n callback(event, desc, tagNames); \n },\n });\n\n }", "function update_name_and_id(element,value){\n input_value = element.value;\n element.value = input_value.replace(/ #.*$/,'');\n $(element.id.replace(/_names$/,'_ids')).value +=\n input_value.replace(/^.*#/,'') + ', ';\n}", "function idToName(id) {\n return id.split(\"_\").map(word => word.charAt(0).toUpperCase() + word.substr(1)).join(\" \")\n}", "buildTags() {\n\n\t\tlet tags = '';\n\n\t\t \tthis.props.foodList.combinedFoods.slice(0,10).map( flist => { \n\n\t\t \t\tif(flist.tags != undefined) {\n\t\t \t\t\ttags += (flist.tags+\" \") ; \n\t\t \t\t}\n\t\t \t\n\n\t\t\t});\n\n\t\t \tconsole.log('combined tags', tags);\n\n\t\t \treturn tags; \n\n\t}", "generateTagsParams(tags, targets) {\n return tags.map(({ _id, name, colorCode }) => {\n // Current tag's selection state (all, some or none)\n const count = targets.reduce((memo, target) =>\n memo + (target.tagIds && target.tagIds.indexOf(_id) > -1), 0);\n\n let state = 'none';\n if (count > 0) {\n if (count === targets.length) {\n state = 'all';\n } else if (count < targets.length) {\n state = 'some';\n }\n }\n\n return {\n _id,\n title: name,\n image: <i className=\"icon ion-pricetags\" style={{ color: colorCode }} />,\n selectedBy: state,\n };\n });\n }", "getTagged (tagName) {\n return Api().get(`tags/${tagName}`, tagName)\n }", "function changeTaggableModel(newTaggableId, newTaggableType) {\n taggableId = newTaggableId;\n taggableType = newTaggableType;\n updateExistingTagLabels();\n}", "function registertags(){\n // reset the tagresult content.\n var tagresult = $('#tagresult');\n tagresult.val('');\n\t\t// for each tag, add it to the value field.\n $(\".listtags a span\").each(function(i){\n \t// if first do not add a comma\n if(i > 0) {\n tagresult.val( tagresult.val() + ', ');\n }\n tagresult.val( tagresult.val() + $(this).html() );\n });\n }", "function toggleTag(e) {\n var id = $(e).attr(\"data-id\");\n var availableTags = [];\n var availableTagsID = [];\n $('.header_div_2 .keywords div').children('p').each(function () {\n availableTags.push($(this).text());\n availableTagsID.push($(this).parent().children(\"button\").attr(\"data-id\"));\n });\n\n var original_height;\n\n $('.myTags').tagit({\n tagSource: availableTags,\n select: true,\n sortable: true,\n allowNewTags: false,\n triggerKeys: ['enter', 'tab'],\n allowSpaces: true,\n beforeTagAdded: function (event, ui) {\n original_height = $(\".header_div_3\").height();\n if ($.inArray(ui.tagLabel, availableTags) == -1) {\n return false;\n }\n },\n afterTagAdded: function (event, ui) {\n var e = $(\".header_div_2 .keywords div p[value='\" + ui.tagLabel + \"']\").parent();\n $(\".content-wrapper.original .myTags\").tagit(\"createTag\", ui.tagLabel);\n $(\".content-wrapper.duplicate .myTags\").tagit(\"createTag\", ui.tagLabel);\n var button_element = $('button[data-id=' + $(e).children(\"button\").attr(\"data-id\") + ']');\n $(button_element).css(\"background-color\", \"#ab2019\");\n $(button_element).attr(\"data-function\", \"remove\");\n $(button_element).children(\"i\").removeClass(\"fa-plus\");\n $(button_element).children(\"i\").addClass(\"fa-close\");\n },\n beforeTagRemoved: function (event, ui) {\n original_height = $(\".header_div_3\").height();\n var data_id = $(ui.tag).attr(\"data-id\");\n var button_element = $('button[data-id=' + data_id + ']');\n $(button_element).attr(\"data-function\", \"add\").css(\"background-color\", \"#3bc264\");\n $(button_element).children(\"i\").removeClass(\"fa-close\");\n $(button_element).children(\"i\").addClass(\"fa-plus\");\n },\n afterTagRemoved: function (event, ui) {\n var data_id = $(ui.tag).attr(\"data-id\");\n $(\".myTags\").tagit(\"removeTag\", $(\".myTags li[data-id=\" + data_id + \"]\"));\n var button_element = $('button[data-id=' + data_id + ']');\n $(button_element).attr(\"data-function\", \"add\").css(\"background-color\", \"#3bc264\");\n $(button_element).children(\"i\").removeClass(\"fa-close\");\n $(button_element).children(\"i\").addClass(\"fa-plus\");\n }\n });\n\n if ($(e).attr(\"data-function\") == \"add\") {\n $(\".myTags\").tagit(\"createTag\", e.id);\n $(\".content-wrapper.original .myTags li\").eq(-2).attr(\"data-id\", id);\n $(\".content-wrapper.duplicate .myTags li\").eq(-2).attr(\"data-id\", id);\n }\n else if ($(e).attr(\"data-function\") == \"remove\") {\n $(\".myTags\").tagit(\"removeTag\", $(\".myTags li[data-id=\" + $(e).attr(\"data-id\") + \"]\"));\n }\n}", "function toTags(tags) {\n if (tags === undefined) {\n return undefined;\n }\n const res = {};\n for (const blobTag of tags.blobTagSet) {\n res[blobTag.key] = blobTag.value;\n }\n return res;\n}", "function toTags(tags) {\n if (tags === undefined) {\n return undefined;\n }\n const res = {};\n for (const blobTag of tags.blobTagSet) {\n res[blobTag.key] = blobTag.value;\n }\n return res;\n}", "function parseName(tag) {\n\tlet name = tag.name\n\tname = name.replace(/_/g, ' ');\n\tname = name.replace(/\\b\\w/g, l => l.toUpperCase());\n\treturn name;\n}", "tagString(tag) {\n for (const [handle, prefix] of Object.entries(this.tags)) {\n if (tag.startsWith(prefix))\n return handle + escapeTagName(tag.substring(prefix.length));\n }\n return tag[0] === '!' ? tag : `!<${tag}>`;\n }", "function findTags(data) {\n let tags = [];\n data.forEach(recipe => {\n recipe.tags.forEach(tag => {\n if (!tags.includes(tag)) {\n tags.push(tag);\n }\n });\n });\n tags.sort();\n tags.forEach(tag => domUpdates.listTag(capitalize(tag), tag));\n}", "name2tags(name) {\n let res = {};\n name\n .split(\".\")\n .slice(1)\n .forEach(x => {\n let [n, v] = x.split(\"=\");\n res[n] = v;\n });\n return res;\n }", "function renderTags( name, tags ) {\n return tags.map(function render( tag ) {\n if( typeof tag == 'string' ) return tag.trim();\n // Sort attribute names before rendering to a string.\n var attrs = Object.keys( tag )\n .sort()\n .reduce(function attrs( result, name ) {\n return format('%s \"%s\"=\"%s\"', result, name, tag[name] );\n }, '');\n // Render the full tag with attributes.\n return format('<%s%s>', name, attrs );\n });\n}", "function captureTagName() {\n var startIdx = currentTag.idx + (currentTag.isClosing ? 2 : 1);\n return html.slice(startIdx, charIdx).toLowerCase();\n }", "function makeTagHovers(id) {\n\n\t\tvar tagelems = [];\n\n\t\tif (!id) {\n\t\t\t$(\".tag-list\").each(function() {\n\t\t\t\ttagelems.push($(this));\n\t\t\t});\n\t\t} else {\n\t\t\ttagelems.push($(\"#tag-list-\" + id));\n\t\t}\n\n\t\ttagelems.forEach(function(tagelem) {\n\t\t\t$(tagelem).mouseover(function() {\n\t\t\t\t$(this).find('.tag-button').css('visibility', 'visible')\n\t\t\t});\n\n\t\t\t$(tagelem).mouseleave(function() {\n\t\t\t\t$(this).find('.tag-button').css('visibility', 'hidden');\n\t\t\t});\n\n\t\t\tvar tag = new Object();\n\t\t\ttag.id = $(tagelem).find('.tag-filter-id').text();\n\t\t\ttag.name = $(tagelem).find('.tag-filter-name').text();\n\n\t\t\t$(tagelem).find('.tag-edit-button').click(function(e) {\n\t\t\t\te.preventDefault();\n\n\t\t\t\tvar editHTML = new EJS({url: '../../templates/tagedit.ejs'}).render({tag: tag});\n\t\t\t\t$(\"#main-modal-content\").html(editHTML);\n\n\t\t\t\t$('#tag-edit-form').submit(function (e) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tvar newName = $('#edit-tag-name').val();\n\t\t\t\t\t\n\t\t\t\t\tif (newName != tag.name) {\n\t\t\t\t\t\t$.get(\"/api/tag/edit\", {id: tag.id, name: newName, _csrf: csrf}).done(function(result) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (result) {\n\t\t\t\t\t\t\t\t$('.tag-filter').each(function() {\n\t\t\t\t\t\t\t\t\tif ($(this).find('.tag-filter-id').text() === result.id.toString())\n\t\t\t\t\t\t\t\t\t\t$(this).find('.tag-filter-name').text(result.name);\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t$(\"#link-input-tag-\" + result.id).text(result.name);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$(\"#main-modal\").modal('hide');\n\t\t\t\t\t\t\n\t\t\t\t\t\t});\n\t\t\t\t\t}\telse {\n\t\t\t\t\t\t$(\"#main-modal\").modal('hide');\n\t\t\t\t\t}\n\t\t\t\t})\t\n\t\t\t});\n\n\t\t\t$(tagelem).find('.tag-remove-button').click(function(e) {\n\t\t\t\te.preventDefault();\n\t\t\t\t\n\t\t\t\tswal({\n\t\t\t\t title: \"Are you sure?\",\n\t\t\t\t text: \"Links will no longer have this tag.\",\n\t\t\t\t type: \"warning\",\n\t\t\t\t showCancelButton: true,\n\t\t\t\t confirmButtonClass: \"btn-danger\",\n\t\t\t\t confirmButtonText: \"Ok, delete\",\n\t\t\t\t cancelButtonText: \"Cancel\",\n\t\t\t\t closeOnConfirm: false,\n\t\t\t\t closeOnCancel: true\n\t\t\t\t},\n\t\t\t\tfunction(isConfirm) {\n\t\t\t\t if (isConfirm) {\n\n\t\t\t\t\t$.get(\"/api/tag/remove\", {id: tag.id, _csrf: csrf}).done(function(result) {\n\t\t\t\t\t\tif (result) {\n\t\t\t\t\t\t\t$('.tag-filter').each(function() {\n\t\t\t\t\t\t\t\tif ($(this).find('.tag-filter-id').text() === tag.id)\n\t\t\t\t\t\t\t\t\t$(this).remove();\n\n\t\t\t\t\t\t\t\tswal(\"Deleted!\", \"Your tag was removed.\", \"success\");\t\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\t});\n\t\t\t});\t\t\t\n\t\t});\n\t}", "static async untagAll(tagId) {\n\t\tconst noteTags = await NoteTag.modelSelectAll('SELECT id FROM note_tags WHERE tag_id = ?', [tagId]);\n\t\tfor (let i = 0; i < noteTags.length; i++) {\n\t\t\tawait NoteTag.delete(noteTags[i].id);\n\t\t}\n\n\t\tawait Tag.delete(tagId);\n\t}", "async handleTagCreated(tag) {\n this.setState({\n tags: [...this.state.tags, tag],\n draftTags: [...this.state.draftTags, tag]\n });\n }", "function resetTags(){\r\n document.querySelectorAll('.tag').forEach(function(tag){\r\n tag.parentElement.removeChild(tag);\r\n })\r\n}", "function tag(){\n // clears the tag and title field\n betterClear('tags', 'titleParagraph');\n\n // The variable paragraph is for all the tags of artist 1; paragraph 2 is for all the tags of artist 2\n var paragraph = document.getElementById('tags');\n var paragraph2 = document.getElementById('tags2');\n var artistName = document.getElementById(\"name\").value.toLowerCase();\n var artistName2 = document.getElementById(\"name2\").value.toLowerCase();\n var album = document.getElementById(\"album\").value.toLowerCase();\n var album2 = document.getElementById(\"album2\").value.toLowerCase();\n var mood = document.getElementById(\"mood\").value.toLowerCase();\n var mood2 = document.getElementById(\"mood2\").value.toLowerCase();\n var genre = document.getElementById(\"genre\").value.toLowerCase();\n var genre2 = document.getElementById(\"genre2\").value.toLowerCase();\n var instrument = document.getElementById(\"instrument\").value.toLowerCase();\n var instrument2 = document.getElementById(\"instrument2\").value.toLowerCase();\n=======\n>>>>>>> b3bc9c5b930f0e8d6d69c0c1c5d90f064f04c002\n\n // initialize tags for artist 1\n var tags = `\n ${artistName} type beat,\n ${artistName} type beat 2021,\n ${artistName} type beat free,\n ${artistName} type beat 2020,\n ${artistName} type beat free for profit,\n ${artistName} type beat with hook,\n free ${artistName} type beat,\n `\n\n // initialize tags for artist 2\n var tags2 = `\n ${artistName2} type beat,\n ${artistName2} type beat 2021,\n ${artistName2} type beat free,\n ${artistName2} type beat 2020,\n ${artistName2} type beat free for profit,\n ${artistName2} type beat with hook,\n free ${artistName2} type beat,\n `\n\n // additional tags for artist 1\n if (mood != ''){ tags += `${artistName} type beat ${mood},`;}\n if (album != ''){ tags += `${artistName} type beat ${album},`;}\n if (instrument != ''){ tags += `${artistName} type beat ${instrument},`;}\n if (genre != ''){ tags += `${artistName} type beat ${genre},`;}\n\n // node the tags to add to the paragraph\n var tagsNode = document.createTextNode(tags);\n paragraph.appendChild(tagsNode);\n\n // additional tags for artist 2\n if (artistName2 != ''){\n if (mood2 != ''){ tags2 += `${artistName2} type beat ${mood2},`;}\n if (album2 != ''){ tags2 += `${artistName2} type beat ${album2},`;}\n if (instrument2 != ''){ tags2 += `${artistName2} type beat ${instrument2},`;}\n if (genre2 != ''){ tags2 += `${artistName2} type beat ${genre2},`;}\n // node the 2nd tags to add to the paragraph 2\n var tags2Node = document.createTextNode(tags2);\n paragraph2.appendChild(tags2Node);\n }\n console.log(tags2);\n // create Instagram caption by calling outside function\n instagramCaption(artistName, artistName2, mood);\n additionalTags(tags, tags2, artistName, artistName2);\n\n \n}", "function GenerateTagHTML(tags) {\r\n \r\n var html = '<div class=\"tags\">';\r\n \r\n // Generate the html for each of the tags and return it\r\n $.each(tags, function(key, tag) { html += '<span>' + tag + '</span>' });\r\n return html + '</div>';\r\n \r\n }", "function filterTagIds(tagNames) {\n return tags.filter(tag => tagNames.includes(tag.name)).map(tag => tag._id);\n}", "function changeTag(newTag, oldTag){\n\ttagUtorid = '', tagCourse = '';\n\ttagTerm = '', tagYear = '';\n\tvar i=0;\n\tselectedRow.find('td').each(function(){\n\t\tswitch(i){\n \t\tcase 0:\n \t\ttagUtorid = $(this).text();\n \t\tbreak;\n \t\tcase 1:\n \t\ttagCourse = $(this).text();\n \t\tbreak;\n \tcase 2:\n \t\ttagTerm = $(this).text();\n \t\tbreak;\n \tcase 3:\n \t\ttagYear = $(this).text();\n \t\tbreak;\n\t\t}\n\t\ti++;\n\t});\n\tvar changeString = 'All_Applications=True&TagUtorid=\"' +\n\t\t\t\ttagUtorid + '\"&TagCourse=\"' + tagCourse +\n\t\t\t\t'\"&TagValue=\"' + newTag + '\"&OldTag=\"' + oldTag +\n\t\t\t\t'\"&TagTerm=\"' + tagTerm +'\"&TagYear=\"' + tagYear +\n\t\t\t\t'\"&ChangeTag';\n\tdisplayPageInfo(changeString);\n}", "function initTags() {\n \n for (var j = $scope.QUERY.whattodo.length - 1; j >= 0; j--) {\n for (var i = $scope.tripTags.length - 1; i >= 0; i--) {\n if ($scope.QUERY.whattodo[j].slug == $scope.tripTags[i].slug) {\n $scope.local.tags.push($scope.tripTags[i]);\n break;\n }\n }\n }\n }", "update_tags(state) {\n Vue.http.get(Hunt.API_URL + '/tags')\n .then(\n success => {\n state.tags = [];\n success.body.forEach(x=>{\n state.tags.push({\n label: x.name,\n value: x.id\n });\n });\n },\n fail => {\n if(fail.status===403) {\n Bus.$emit(\"goto-login\");\n }\n Hunt.toast(fail.data.message);\n console.log(fail);\n }\n );\n }", "function tagName(tag, options) {\n if (tag == null || tag === '') {\n tag = options.defaultTag || 'Api';\n }\n tag = toIdentifier(tag);\n return tag.charAt(0).toUpperCase() + (tag.length == 1 ? '' : tag.substr(1));\n}", "function get_associated_from_tag(tag) {\n let lst = '';\n let index = get_tag_index(tag);\n\n for (let i = 0; i < get_tagged_length(tag); i++)\n if (!is_tag_private(tags[index + 1][i])) // making sure the tags to display aren't private ones\n lst += '<button onclick=\"set_current_article(this)\">' + tags[index + 1][i] + '</button>';\n\n return lst;\n}" ]
[ "0.619169", "0.61647934", "0.6133643", "0.6024926", "0.60090107", "0.60002893", "0.59881663", "0.5889364", "0.58690417", "0.5857717", "0.5829866", "0.58055496", "0.58024853", "0.579754", "0.57947767", "0.5757236", "0.5745489", "0.57231486", "0.5705612", "0.5705612", "0.5705612", "0.5705612", "0.5689349", "0.5686877", "0.5672402", "0.5662794", "0.5653823", "0.56485116", "0.5643607", "0.56408346", "0.56320375", "0.56205124", "0.5615503", "0.5611733", "0.5609431", "0.5592822", "0.5585381", "0.556063", "0.5558637", "0.5557818", "0.5554935", "0.5535259", "0.55109113", "0.55083674", "0.5504195", "0.5482613", "0.5479739", "0.54633975", "0.5451164", "0.54490006", "0.5447784", "0.5446971", "0.5445223", "0.54419464", "0.5432668", "0.5430147", "0.5418641", "0.5405278", "0.54008925", "0.53933364", "0.5391193", "0.53873277", "0.5382387", "0.538101", "0.5380617", "0.53780377", "0.5375807", "0.53653437", "0.5353253", "0.5348739", "0.53479445", "0.5345432", "0.53397775", "0.5336118", "0.5333962", "0.53293777", "0.53289795", "0.532865", "0.5326405", "0.5319865", "0.53195465", "0.53195465", "0.53179944", "0.53162223", "0.5316036", "0.53069055", "0.52984065", "0.5297884", "0.52955437", "0.5293065", "0.5280052", "0.52794755", "0.5274087", "0.5272153", "0.5269404", "0.5260865", "0.5255979", "0.5250565", "0.5248378", "0.52467555" ]
0.5494101
45
0 is false 1 is true
function getBudget() { budget = parseInt(Math.floor(Math.random() * 15)+15); document.getElementById("budget").disabled = true; document.getElementById("curBudget").innerHTML = "$"+ budget; //document.getElementById("rollBudget").disabled = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function trueOrFalse1() {\n\t\t \tconsole.log(eachone[count].option1.truth);\n\t\t \tif (eachone[count].option1.truth == true){\n\t\t \t\tcorrectAnswers++;\n\t\t \t\tguessedIt = true;\n\t\t \t} else {\n\t\t \t\tincorrectAnswers++;\n\t\t \t\tguessedIt = false;\n\t\t \t};\n\t\t}", "function isTrue(boolean){\n return boolean == 1;\n}", "function boolean (data) {\n return data === false || data === true;\n }", "function boolean (data) {\n return data === false || data === true;\n }", "eval_bool(input) {\n const rs = this.evaluate(input);\n return (rs && rs.length === 1 && rs[0] === true)\n }", "getBoolean() {\n return (this.getUint8() & 1) === 1;\n }", "function bool(ciuresult){\n if (ciuresult == 'y' || ciuresult == 'a') return true;\n // 'p' is for polyfill\n if (ciuresult == 'n' || ciuresult == 'p') return false;\n throw 'unknown return value from can i use';\n }", "bool() {\n this.throw_if_less_than(1);\n let val = this.buffer[this.pos];\n this.pos += 1;\n return val === 1;\n }", "function isTrue(bool){\n \n return (Object.is(true,bool));\n\n }", "function parse_PtgBool(blob) { blob.l++; return blob.read_shift(1)!==0;}", "function parse_PtgBool(blob) { blob.l++; return blob.read_shift(1)!==0;}", "function parse_PtgBool(blob) { blob.l++; return blob.read_shift(1)!==0;}", "function parse_PtgBool(blob) { blob.l++; return blob.read_shift(1)!==0;}", "function bool(x) {\n\treturn (x === 1 || x === '1' || x === true || x === 'true');\n}", "function is1(x){\r\n return x == 1;\r\n}", "function Boolean() {}", "function isOk(val) {\r\n return typeof val === \"boolean\" && val;\r\n }", "function ifChuckSaysSo() {\n return !!0;\n}", "function truthDetector(theTruth){\n if(theTruth = true){\n return 1;\n }\n}", "function isTtrue(bool){\n return true;\n }", "function Booleans(){\n return false;\n}", "function checkTrue(matches) {\n return matches == true;\n}", "function $chk(obj){\n\treturn !!(obj || obj === 0);\n}", "function $chk(obj){\n\treturn !!(obj || obj === 0);\n}", "function evalBoolVal(val) {\n Log.GenMsg(`Evaluating single boolVal '${val}'...`);\n let addr = memManager.getFalseVal();\n if (val === \"true\") {\n //Store \"00\" in X and compare with defualt \"00\" in memory\n byteCode.push(\"A2\", \"00\", \"EC\", addr[0], addr[1]);\n }\n if (val === \"false\") {\n //Store \"01\" in X and compare with defualt \"00\" in memory\n byteCode.push(\"A2\", \"01\", \"EC\", addr[0], addr[1]);\n }\n }", "function isFalse(boolean){\n return boolean == 0;\n}", "function _boolean($a) {\n if ((0, _xvseq._isEmpty)($a)) return false;\n var a = (0, _xvseq._first)($a);\n if ($a.size > 1 && !_isNode(a)) {\n throw (0, _xverr.error)(\"err:FORG0006\");\n }\n return !!a.valueOf();\n}", "function randomBool()\n{\n return (randomInt(0, 1) === 1);\n}", "function parse_PtgBool(blob) {\n blob.l++;\n return blob.read_shift(1) !== 0;\n }", "function boolean(val) {\n\t return !!val;\n\t}", "function boolean(val) {\n\t return !!val;\n\t}", "is_true(val) {\n return ['true', 'yes', '1', 1, true].includes(val);\n }", "function lua_true(op) {\n return op != null && op !== false;\n}", "function testTrueLooseNonEqualityComparison(){\n var zero = 0;\n var one = 1;\n\n return zero !== one;\n\n}", "function imply( val ) {\n return (val === true ? 1 : val ? val : 0);\n }", "function _checkAi(){return true;}", "function getRandomBoolean() \n{\n return getRandomInt(0, 1) > 0;\n}", "function boolean_check(i) {\n return !!i;\n}", "function allTrue(value) {\n // Replace this comment with your code...\n if (\n /^[Y][E][S]/i.test(value) ||\n /^[T][R][U][E]/i.test(value) ||\n value === true ||\n value === 1 ||\n /^[T]/i.test(value) ||\n /^[Y]/i.test(value)\n ) {\n return true;\n } else if (\n /^[Y][E][S]/i.test(value) ||\n /^[T][R][U][E]/i.test(value) ||\n value === true ||\n value === 0 ||\n /^[T]/i.test(value) ||\n /^[Y]/i.test(value)\n ) {\n return false;\n }\n}", "function trueOrFalse(a , b) {\r\n return a < b;\r\n}", "function booWho2(bool) {\n return typeof bool === 'boolean'? true:false\n}", "function not(a){\r\n return (a === true) ? false :\r\n (a === false) ? true : error(not);\r\n}", "function returnTrue() {\n\t\t\treturn true;\n\t\t}", "function returnTrue() {\n\t\t\treturn true;\n\t\t}", "function returnTrue() {\n\t\t\treturn true;\n\t\t}", "function returnTrue() {\n\t\t\treturn true;\n\t\t}", "get boolValue() {}", "function booleanify(val) {\n\t if (val === \"true\" || val == 1) {\n\t return true;\n\t }\n\n\t if (val === \"false\" || val == 0 || !val) {\n\t return false;\n\t }\n\n\t return val;\n\t}", "function isTrue(input) {\n\treturn input === true || input == \"true\";\n}", "function if_function(condition, true_res, false_res) {\n\n\n}", "function testBooleanLogic (arr){\n for (var i = 0; i < arr.length; i++) {\n if(arr[i] === true){\n return true;\n }\n }\n return false;\n}", "function isSomethingTrue(x){\n return x;\n}", "function truthiness(value) {\n if (value) {\n console.log( true );\n }else {\n console.log( false );\n }\n}", "function sc_not(b) {\n return b === false;\n}", "function bool(aValue) {\n return (aValue != 0);\n }", "function itsTrueOrFalse() {\r\n\r\n if ( its ) {\r\n\r\n console.log( \"hello\" );\r\n\r\n } else {\r\n\r\n console.log( \"bye\" );\r\n }\r\n}", "function booWho(bool) {\n return typeof bool === 'boolean'\n}", "function matchBool() {\n\t\tvar pattern = /^(true|false)/;\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 booWho(bool) {\r\n\treturn (bool === true || bool === false);\r\n}", "is_bool(val) {\n return this.is_true(val) || this.is_false(val);\n }", "function trueOrFalse(value) {\n if(value===true){\nreturn \"true\"\nconsole.log (\"true\")\n}\nelse{\n if(value===false){\n return \"false\"\n console.log (\"false\")\n } \n\n}\n \n}", "function bool(val) {\n if (_.contains(['true', true, '1', 1, 'y', 'Y'], val)) {\n return true;\n } else if (_.contains(['false', false, '0', 0, 'n', 'N'], val)) {\n return false;\n }\n return val;\n}", "function areTrue(a, b) {\n if (a == true) {\n if (b == true) {\n return \"both\";\n }\n else {\n return \"first\";\n }\n }\n else if (b == true) {\n return \"second\";\n }\n else {\n return \"neither\";\n }\n }", "function readBool(){\n checkLen(1);\n var i = buf.readUInt8(pos);\n pos++;\n if(i == 0)\n return \"false\";\n if(i == 1)\n return \"true\";\n return \"\";\n }", "function d3_true() {\n return true;\n}", "function boolean(value) {\r\n return value === TRUE || value === FALSE;\r\n }", "function vtrue(vvar)\r\n{\r\n var tmp1=false;\r\n if (vvar==\"True\" || vvar==\"true\") { tmp1=true; }\r\n return tmp1;\r\n}", "function bit (value) {\n\t return value === 0 || value === 1\n\t}", "function testFalseLooseEqualityComparison(){\n var zero = 0;\n var one = 1;\n\n return zero == one;\n}", "function ourTrueOrFalse(isItTrue) {\n if (isItTrue) {\n return \"yes, it´ss true\";\n }\n return \"no,it´s false\";\n}", "function isTautology(results){\r\n for (var i= 0; i < results.length; i++) if (results[i] == 0) return false;\r\n return true;\r\n}", "isOn() {\n\t\treturn !!this.at;\n\t}", "function oneTrue(arg1, arg2){\n if(arg1 === true || arg2 === false){\n \treturn true;\n }\n}", "function checkZeroResult(){\n return result.length === 1 && result.charAt(0) === \"0\";\n }", "function booWho(bool) {\n if(bool === false){return true}\n if(bool === true){ return true}\n return false;\n}", "isSolved(){\r\n if(this.__isSolved>-1){\r\n // 既にこの関数は実行されているので、その実行結果を返す\r\n switch(this.__isSolved){\r\n case 0: return false;\r\n case 1: return true;\r\n default: throw \"We should not reach here!\";\r\n }\r\n }\r\n \r\n for(let i=0; i<81; i++){\r\n if(this.numbers[i]==0){\r\n this.__isSolved = 0;\r\n return false;\r\n }\r\n }\r\n this.__isSolved = 1;\r\n return true;\r\n }", "random_bool(p) {\n return this.random_dec() < p;\n }", "function true_boolean() { \r\ndocument.write(10 > 2); //true \r\n}", "function isTrue(value) {\n return value == \"true\" || value == true;\n }", "function trueOrFalse() {\n if (accountHist === undefined) {\n console.log('returned false')\n return false;\n } else {\n console.log('returned true')\n return true;\n }\n }", "function randomBoolean(){\n // let random = Math.floor(Math.random() * 1);\n //\n // if(random === 0 ){\n // return false;\n // }\n // else if(random === 1){\n // return true;\n // }\n\n return Boolean(Math.floor(Math.random() * 2));\n\n}", "isErr() {\n return !this.isOk()\n }", "isOk() {\n return this.value !== void 0\n }", "isZero() {\n return this.value == 0;\n }", "function isEquals() {\n return reponse == nb2;\n}", "isBoolean(val) {\n return typeof val === 'boolean';\n }", "function allOk(obj) {\r\n var flag = true;\r\n for (var i in obj) {\r\n flag = flag && obj[i];\r\n }\r\n return flag;\r\n }", "function isTrue(bool) {\n return bool;\n }", "function cb_true_2(num) {\n print(\"element \" + num); // B3 B6 B9 B15 B18 B21 B27 B30 B33\n return true; // B4 B7 B10 B16 B19 B22 B28 B31 B34\n} // B5 B8 B11 B17 B20 B23 B29 B32 B35", "function getBooleanValue(s) {\r\n s = s.toLowerCase();\r\n if (s === 'false' || s === 'f' || s === 'no' || s === 'n' || s === 'off' || s === '0') {\r\n return false;\r\n }\r\n return true;\r\n}", "static isExist(value) {\n\n if (value === true || value === false) {\n return true;\n }\n\n if (value === 0) {\n return true;\n }\n\n if (value) {\n return true;\n }\n\n return false;\n }", "function trueOrFalse(wasThatTrue){\r\n if (wasThatTrue) {\r\n return \"yes,That was true\"; \r\n }\r\n return \"That was false\";\r\n}", "function trueOrFalse(wasThatTrue){\r\n if (wasThatTrue) {\r\n return \"yes,That was true\"; \r\n }\r\n return \"That was false\";\r\n}", "function isValid(value) {\n\t return Boolean(value || value === 0);\n\t}", "function toBool(str){\n\t\tif(str === true){\n\t\t\treturn true;\n\t\t}\n\t\telse if(str){\n\t\t\treturn (str.toUpperCase() === 'TRUE');\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}", "isBit(val) {\n return val === 0 || val === 1;\n }", "function welcomeToBooleans() {\n return true; // return boolean value is true\n}", "function checkState(number){\n console.log(number)\n if (number ===2 || number === 1){\n return true;\n }\n console.log(number)\n return false;\n }", "function pasreString2Boolean(value){\n return /^true$/i.test( value);\n }", "function boolean(val) {\n return !!val;\n}", "function boo(bool) {\n if (typeof(bool) === \"boolean\") {\n return true;\n } else {\n return false;\n }\n }" ]
[ "0.6946256", "0.6801192", "0.6783927", "0.66684", "0.6621297", "0.6592657", "0.6563788", "0.6560356", "0.65308", "0.65022117", "0.65022117", "0.65022117", "0.65022117", "0.6478607", "0.64704686", "0.6461497", "0.64568436", "0.6401179", "0.6398329", "0.6394248", "0.6375605", "0.6355522", "0.6355288", "0.6355288", "0.63418096", "0.63417107", "0.6309971", "0.6304339", "0.6283637", "0.62834525", "0.62834525", "0.6280568", "0.6280544", "0.6277212", "0.62753046", "0.6269065", "0.624303", "0.6236563", "0.6235067", "0.62324506", "0.62177676", "0.62171763", "0.6214885", "0.6214885", "0.6214885", "0.6214885", "0.6214185", "0.62104243", "0.6201838", "0.61999", "0.61899203", "0.6186619", "0.6186615", "0.6185201", "0.61843085", "0.6167899", "0.6166425", "0.61582375", "0.61516184", "0.6148783", "0.6140118", "0.61233777", "0.6111451", "0.61010104", "0.6089984", "0.6079691", "0.60791194", "0.60562664", "0.60546714", "0.60463655", "0.6035553", "0.603467", "0.6033334", "0.60275346", "0.6025862", "0.6023793", "0.60232526", "0.6021491", "0.60159767", "0.6014761", "0.6007922", "0.6007367", "0.6005239", "0.6003162", "0.6002203", "0.59999096", "0.5999298", "0.5990093", "0.5987131", "0.5979417", "0.5978095", "0.59775954", "0.59775954", "0.59697133", "0.59666246", "0.5959694", "0.5959427", "0.59497637", "0.59455526", "0.5933239", "0.5923767" ]
0.0
-1
Affichage liste message & user
function usersListRefresh() { $.ajax({ url:"http://localhost/tchat/API/index.php?action=listUsers", type:"GET" }).done(function(response) { //console.log(response); $('#userList ul').empty(); for (var i = 0; i < response.length; i++) { //console.log(i); $('#userList ul').append('<li>' + response[i].userNickname + '</li>'); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showUserMessges (user) {\r\n var list = document.getElementById('message-list');\r\n var user = JSON.parse(localStorage.getItem(user.email));\r\n for (var msg of user.messages) {\r\n let item = document.createElement('li');\r\n if (msg.from === user.email) {\r\n createSendMessages(list, item);\r\n }\r\n else if ( msg.timeToLive > ((new Date()).getTime() - new Date(msg.timeCreated).getTime())) {\r\n createReceivedMessages(list, item);\r\n }\r\n }\r\n\r\n function createSendMessages(list, item, lastTimeStamp){\r\n \r\n item.setAttribute('class', 'right');\r\n item.setAttribute('data-timestamp', msg.timeCreated.toString());\r\n item.innerHTML = '<receiver></receiver><bubble><message><strong>'+ msg.message + '</strong></message><sender> :' + msg.from + '</sender></bibble>';\r\n list.appendChild(item);\r\n }\r\n \r\n function createReceivedMessages(list, item, ){\r\n item.setAttribute('class', 'left');\r\n item.innerHTML = '<bubble><sender>' + msg.from + ': </sender><message><strong>'+ msg.message +'</strong>' + ' Expire @' + new Date(msg.timeCreated + msg.timeToLive).getHours() + ':' + new Date(msg.timeCreated + msg.timeToLive).getMinutes() + '</message></bubble><receiver></receiver>'\r\n item.setAttribute('data-timestamp', msg.timeCreated.toString());\r\n list.appendChild(item);\r\n setTimeout( function () {\r\n list.removeChild(item);\r\n }, msg.timeToLive - ((new Date()).getTime() - new Date(msg.timeCreated).getTime())); \r\n }\r\n\r\n setInterval(function (){\r\n var curUser = JSON.parse(localStorage.getItem(user.email));\r\n var nodes = list.querySelectorAll('li');\r\n if(nodes.length === 0){\r\n return;\r\n }\r\n var lastItem = nodes[nodes.length-1];\r\n var lastTimeStamp = lastItem.getAttribute('data-timestamp');\r\n var length = curUser.messages.length-1;\r\n var index = length;\r\n for (var i = length; i >= 0; i--){\r\n if (curUser.messages[i].timeCreated > lastTimeStamp) {\r\n index--;\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n if (index < length) {\r\n for (; index <= length; index++) {\r\n let item = document.createElement('li');\r\n if ( curUser.messages[index].timeToLive > ((new Date()).getTime() - new Date(curUser.messages[index].timeCreated).getTime())) {\r\n if( curUser.messages[index].timeCreated <= lastTimeStamp){\r\n continue;\r\n }\r\n if(curUser.messages[index].from === curUser.email){\r\n item.setAttribute('class', 'right');\r\n item.innerHTML = '<receiver></receiver>' + '<bubble><message><strong>'+ curUser.messages[index].message +'</strong></message><sender>'+ ':' + curUser.messages[index].from + '</sender></bubble>' \r\n item.setAttribute('data-timestamp', curUser.messages[index].timeCreated.toString());\r\n list.appendChild(item);\r\n lastTimeStamp = item.getAttribute('data-timestamp');\r\n }\r\n else {\r\n item.setAttribute('class', 'left');\r\n item.innerHTML = '<bubble><sender>' + curUser.messages[index].from + ':' + '</sender>' + '<message><strong>'+ curUser.messages[index].message +'</strong>' + ' Expire @' + new Date(curUser.messages[index].timeCreated + curUser.messages[index].timeToLive).getHours() + ':' + new Date(curUser.messages[index].timeCreated + curUser.messages[index].timeToLive).getMinutes() + '</message></bubble>' + '<receiver></receiver>'\r\n item.setAttribute('data-timestamp', curUser.messages[index].timeCreated.toString());\r\n list.appendChild(item);\r\n lastTimeStamp = item.getAttribute('data-timestamp');\r\n setTimeout( function () {\r\n list.removeChild(item);\r\n }, curUser.messages[index].timeToLive - ((new Date()).getTime() - new Date(curUser.messages[index].timeCreated).getTime()));\r\n }\r\n } \r\n }\r\n }\r\n }, 2000);\r\n\r\n}", "function dispalyMessages(messages) {\n // let list_message = document.querySelector('.list-text');\n if (list_message !== null) {\n list_message.remove();\n }\n list_message = document.createElement('div');\n list_message.className = 'list-text';\n\n for (let value of messages) {\n\n let messageText = document.createElement('p');\n messageText.className = \"message-text\";\n messageText.textContent = value.message;\n list_user.textContent = value.users;\n \n if (value.users === itemOfuser) {\n messageText.style.background = 'red';\n }\n if(value.bold === true){\n messageText.style.fontWeight = 'bold';\n }else{\n messageText.style.fontWeight = 'normal';\n }\n\n if(value.italic === true){\n messageText.style.fontStyle = 'italic';\n }else{\n messageText.style.fontStyle = 'normal';\n }\n\n list_message.appendChild(messageText);\n messageTitle.appendChild(list_message);\n }\n}", "function userList(){\n users.innerHTML = \"\";\n \n DATA.users.forEach(function(user){\n \n user.messages.forEach(function(el){\n \n if(el.id==user.messages.length){\n let newuser = `<ul class=\"user\" active=\"${user.id}\" ><li><div class=\"user-list-info\"> <img src=${user.avatar} alt=\"foto\"><div><h4>${user.first_name}</h4><span style=\"color: #419FD9\">${el.is_from_me? \"You\": user.first_name} : </span>\n <span>${el.text.slice(0,20)}...</span></div></div></li>\n <li><p>${el.time}</p></ul></li>`;\n users.innerHTML += newuser; \n } \n }) \n })\n \n \n}", "getMessages() {\n\t\tMessage.find().then((res) => {\n\t\t\tlet messages = res;\n\t\t\tlet promises = [];\n\n\t\t\tfor(let i=0;i < messages.length;i++) {\n\t\t\t\tpromises.push(User.findOne({ _id : messages[i].userId }));\n\t\t\t}\n\n\t\t\tQ.all(promises).then((res) => {\n\t\t\t\tfor(let i=0;i<messages.length;i++) {\n\t\t\t\t\tmessages[i].user = res[i];\n\t\t\t\t}\n\n\t\t\t\tthis.socket.emit('message', messages);\n\t\t\t});\n\t\t});\n\t}", "handleMessage (data) {\n console.log(data)\n if (data.type === 'message') {\n console.log('is message')\n let sender = data.username\n let listItem = document.createElement('li')\n listItem.innerText = sender + ': ' + data.data // syntax : first username then message\n this.messageList.appendChild(listItem)\n }\n }", "function listMessages() {\r\n\r\n\t\t var request = gapi.client.gmail.users.messages.list({\r\n\t\t 'userId': 'me'\r\n\t\t });\r\n\t\r\n\t\t request.execute(function(resp) {\r\n\t\t\t\t\t var messageIDS = resp.messages;\r\n\r\n\t\t\t\t\t if (messageIDS && messageIDS.length >= 20)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t getMessage('me', messageIDS);\r\n\t\t\t } else {\r\n\t\t\t \t errorPrepend('No Messages found.');\r\n\t\t\t }\r\n\t\t });\r\n\t\t }", "function updateChat(msg) {\n var data = JSON.parse(msg.data);\n insert(\"chat\", data.userMessage);\n id(\"userlist\").innerHTML = \"\";\n data.userlist.forEach(function (user) {\n insert(\"userlist\", \"<li>\" + user + \"</li>\");\n });\n}", "function messageAllUsers() {\n vm.filteredusers.forEach(function (obj) {\n AddContacts(obj.email);\n });\n }", "function DodajPorukeIzListe(usr,msg,prim) {\n\n let chatDiv = '#chat-' + prim;\n let chatDiv2 = '#chat-' + usr;\n $(chatDiv).find(\"#divMessage\").append(usr + ': ' + msg + '<br>');\n $(chatDiv2).find(\"#divMessage\").append(usr + ': ' + msg + '<br>');\n}", "function viewMessages(user, messages){\n\tif(user.role === ROLE.ADMIN || user.role === ROLE.MODERATOR){\n\t\treturn messages;\n\t};\n\treturn messages.filter(messages => message.userId === user.id);\n}", "function renderMessage(){\n DATA.users.forEach(function(item,key){\n if(item.selected){\n messageElement.innerHTML = \"\";\n \n item.messages.forEach(function(mes,id){\n let newMessage = `<li class = \"${mes.is_from_me? \"from-me\":\"to-me\"}\" id = \"message${mes.id}\">${mes.text}<p>${mes.time}</p></li>`\n messageElement.innerHTML += newMessage;\n \n person.firstElementChild.textContent = `${item.first_name}`;\n person.lastElementChild.textContent = `${item.activity}`;\n let modal_1_header = document.querySelector(\".modal_1_header\");\n let modal_1_body1 = document.querySelector(\".modal_1_body1\");\n let information = document.querySelectorAll(\".information\");\n let informations = document.querySelectorAll(\".informations\");\n let user_1_header = document.querySelector(\".user_1_header\");\n let user_1_body1 = document.querySelector(\".user_1_body1\");\n\n modal_1_header.firstElementChild.lastElementChild.firstElementChild.textContent = `${item.first_name}`;\n modal_1_header.firstElementChild.lastElementChild.lastElementChild.textContent = `${item.activity}`;\n modal_1_header.firstElementChild.firstElementChild.firstElementChild.setAttribute(\"src\",`${item.avatar}`) ; \n modal_1_body1.firstElementChild.lastElementChild.firstElementChild.textContent = `${item.phone_number}`;\n \n information[0].innerText = item.photos + \" photos\";\n information[1].innerText = item.videos + \" videos\";\n information[2].innerText = item.files + \" files\";\n information[3].innerText = item.audio_files + \" audio files\";\n information[4].innerText = item.shared_links + \" shared links\";\n information[5].innerText = item.voice_messages + \" voice messages\";\n information[6].innerText = item.gifs + \" gifs\";\n information[7].innerText = item.groups_common + \" groups in common\";\n\n user_1_header.firstElementChild.lastElementChild.firstElementChild.textContent = `${item.first_name}`;\n user_1_header.firstElementChild.lastElementChild.lastElementChild.textContent = `${item.activity}`;\n user_1_header.firstElementChild.firstElementChild.firstElementChild.setAttribute(\"src\",`${item.avatar}`) ; \n user_1_body1.firstElementChild.lastElementChild.firstElementChild.textContent = `${item.phone_number}`;\n\n informations[0].innerText = item.photos + \" photos\";\n informations[1].innerText = item.videos + \" videos\";\n informations[2].innerText = item.files + \" files\";\n informations[3].innerText = item.audio_files + \" audio files\";\n informations[4].innerText = item.shared_links + \" shared links\";\n informations[5].innerText = item.voice_messages + \" voice messages\";\n informations[6].innerText = item.gifs + \" gifs\";\n informations[7].innerText = item.groups_common + \" groups in common\";\n })\n \n }\n \n })\n \n}", "function getMessages() {\n \tvar transaction = db.transaction(['osMsgStore'], 'readonly'),\n \t\tobjectStore = transaction.objectStore('osMsgStore'),\n \t\tcursor = objectStore.openCursor(),\n isAdmin = document.getElementsByTagName('body')[0].className === 'admin' ? true : false;\n\n \tcursor.onsuccess = function(e) {\n var res = e.target.result;\n\n \t if (res) {\n generateMessage(res.key, res.value.created, res.value.message, isAdmin);\n \t res.continue();\n \t }\n \t}\n }", "render () {\n console.log(this.props.messages)\n const messages = this.props.messages.map((message, i) => {\n let fromMe = (this.props.username === message.username)\n\n return (\n <Message\n key={i}\n message={message.message}\n username={message.username}\n fromMe={fromMe}\n />\n )\n })\n return (\n <div className='messages' id='messageList'>\n {messages}\n </div>\n )\n }", "function addMessage(username, text) {\n var el = $(\"<li class='list-group-item'><b>\" + username + \":</b> \" + text + \"</li>\")\n $messageList.append(el);\n }", "getUserMessages(id) {\n let mensajes;\n let messages = JSON.parse(localStorage.getItem('mensajes')) || [];\n for (let i = 0; i < messages.length; i++) {\n const me = messages[i][id];\n if (me) {\n mensajes = me;\n }\n }\n this.setState({\n update: false\n });\n return mensajes;\n }", "function check_messages()\n{\n var user_id=$('.person.active').attr('user-id');\n\n if(user_id!=null)\n {\n $.ajax({\n url:ajax_url('get_my_messages/'+user_id),\n success:function(messages)\n {\n $('.active-chat .bubble').each(function(){\n var message_id=$(this).attr('message-id');\n\n messages.forEach((item)=>{\n if(item.id==message_id)\n {\n if(item.read==true)\n {\n $(this).find('i').addClass('text-success');\n }\n }\n });\n \n });\n }\n });\n\n }\n \n}", "function displayLoadedMessages(messageList){\n let history = document.getElementById('history');\n //Clear history\n history.innerHTML = \"\";\n\n for(let m of messageList){\n let paragraph = document.createElement('p');\n\n //If user the current user\n if(m.user.trim() === name.trim()){\n paragraph.innerHTML = '<b>Me:</b> ' + m.message;\n }\n else{\n paragraph.innerHTML = '<b>' + m.user + ':</b> ' + m.message;\n }\n //Append to the history\n history.appendChild(paragraph);\n }\n //Scroll to the last element\n history.scrollTop = history.scrollHeight;\n document.getElementById('chat_input').value = '';\n}", "function afficheMsg(message) {\n $('#messages').append('<aside><span class=\"message\">'+\n message.msg+'</span><span class=\"user\">'+\n message.user.pseudo+'</span></aside>') ;\n}", "fetchMessages(username, chatId){\n this.sendMessage({\n command: 'fetch_messages',\n username: username,\n chatId: chatId\n });\n console.log(chatId);\n console.log(username);\n }", "function message (from, msg) {\n\t\tif(from !='{{user_team_name}}'){\n \t\t$('ul#chat_message').append($('<li>').append($('<b>').text(from), msg));\n\t}}", "function selectConciergeFromList(){\n var parentUl = $('.user-content').children('ul');\n var users = parentUl.children('li');\n var user = users.get(0);\n\n // Clear message contents..\n $('#messages').html('');\n\n // Set user to select..\n for(var i = 0; i < users.length; i++) {\n user = users.get(i);\n user.setAttribute(\"style\", \"\");\n }\n users.get(0).setAttribute(\"style\", \"background-color: #eee;\");\n selectedIndex = 0;\n\n disableActionButton();\n var oneUser = {\n id : \"CONCIERGE\",\n contact_id: \"Concierge_\" + userSelf.email,\n username : \"Concierge\",\n email : \"CONCIERGE EMAIL\",\n img : \"/images/concierge.png\"\n };\n\n selectFlag = \"CON\";\n userSelected = oneUser;\n\n showUserInfo(oneUser);\n\n curConvId = \"Concierge_\" + userSelf.email;\n // Load conversation content of this user..\n var msgObj = {\n from: userSelf.email,\n contact_id: \"Concierge_\" + userSelf.email\n };\n socket.emit('loadConv', msgObj);\n}", "renderMessages(){\n if(this.state.messages){\n //@TODO use msg.userID to build an <a href=/user/profile/msg.userID>msg.userName</a> link\n // for the chatUser span\n return this.state.messages.map((msg, i) => {\n return(\n <div class=\"chatMessage\" key={i}>\n <span class=\"chatUser\">{msg.userName}: </span>\n <span class=\"chatText\">{msg.text}</span>\n </div>\n );\n });\n }\n else{\n return <li>Loading Messages..</li>\n }\n }", "function get_messages(a){\n $(\"#messages\").empty(); //elemento con texto concatenado\n console.log(\"Voy a traer los mensajes\");\n //console.log(a);\n //console.log($(a).text());\n //user_to=$(a).text(); //formato jquery\n user_to=$(a).attr('attr-id'); //formato jquery\n let parent = $('#users');\n let hijos = parent.children(); //array de divs per user\n for(var i=0; i<hijos.length; i++) {\n var id = '#' + hijos[i].id;\n if($(id).hasClass('active_chat')) {\n $(id).removeClass('active_chat');\n }\n }\n $(a).addClass('active_chat');\n // console.log(user_to);\n\n $.getJSON(\"/messages/\"+current_user.id+\"/\"+user_to, function(data){\n $(\"#messages\").empty();\n console.log(data);\n if (data!=null){\n for(var i=0; i<data.length; i++){\n if((current_user.id==data[i]['user_to_id'] && user_to==data[i]['user_from_id']) ||\n (current_user.id==data[i]['user_from_id'] && user_to==data[i]['user_to_id'])\n ){\n var div='<div class=\"Message_type\">'+\n 'image'+\n '<div class=\"received_msg\">'+\n '<div class=\"received_withd_msg\">'+\n '<p>Message</p>'+\n // '<span class=\"time_date\"> 11:01 AM | June 9</span></div>'+\n '</div>';\n if(current_user.id==data[i]['user_from_id']){\n div = div.replace('image', '');\n div = div.replace('Message_type', 'outgoing_msg');\n div = div.replace('received_msg', 'sent_msg');\n div = div.replace('<div class=\"received_withd_msg\">', '');\n }else{\n div = div.replace('image', '<div class=\"incoming_msg_img\"> <img src=\"https://ptetutorials.com/images/user-profile.png\" alt=\"sunil\"> </div>');\n div = div.replace('Message_type', 'incoming_msg');\n div = div+'</div>';\n }\n //var div='<br><div>Message</div>';\n div = div.replace('Message', data[i]['content']);\n // console.log(div);\n $(\"#messages\").append(div);\n }\n } \n }\n\n });\n}", "function update_message_pane(user) {\n\n\n cdata = get_contact(user) ;\n\n html = `<table class=\"message-table\">`;\n if (user in user_data) {\n user_data[user]['messages'].forEach( (m) => {\n [u,mes] = m.split(\"|\");\n if (u == '0') { u = \"You\"; } else { u=cdata.first_name; }\n // html += `<div class=\"row ml-10 pt-3 gy-5\" >\n html += `<tr class=\"message-table-row\">\n <td class=s1><div class=\"message-bubble\" p-3>${mes}</div></td>\n <td class=s2><div class=\"message-sender text-center\">${u}</td>\n </tr>`\n });\n\n }\n html += `</table>`\n $(\"#message_container\").html(html);\n $(\"#message_container\").scrollTop($('#message_container')[0].scrollHeight);\n}", "function getMessage(value) {\n idCounter = idCounter + 1;\n setMsg({\n id: idCounter,\n emmiter: \"User\",\n msg: value\n });\n }", "function correo() {\n\tgetSubscribedUsers( function(obj) {\n\t\tvar users = obj;\n\t\tusers.forEach(function(user){\n\t\t\t// setup email data with unicode symbols\n\t\t\tvar mail = user.email;\n\t\t\tvar name = user.user_name;\n\t\t\tvar hmks = importanceOrderHmks(user.hmk, 7);\n\t\t\tvar subj = name+', tienes '+hmks.length+' tareas para esta semana!';\n\t\t\tconst list = hmks.map(hmk => \"<li>\"+hmk.name+\" (importancia: \"+hmk.importance+\")</li>\");\n\t\t\tconst hmklist = '<ol>' + list.join('') + '</ol>';\n\t\t\tvar msg = \"<h1>Hola \"+name+\"!</h1><h2>Tienes \"+hmks.length+\" tareas para esta semana.</h2> \\\n\t\t\t<p> A continuación te presentamos el orden en el cual te sugerimos hacerlas:</p>\"+hmklist;\n\t\t\tsendMail(mail, subj, msg);\n\t\t});\n\t});\n}", "function exibirMensagem(msg) {\n let msgStatus = document.getElementById(\"msgText\");\n msgStatus.innerHTML = '';\n\n var ul = document.createElement('ul');\n ul.className = 'msg-retorno';\n\n for (let i = 0; i < msg.length; i++) {\n var li = document.createElement('li');\n li.innerText = msg[i];\n\n ul.appendChild(li);\n\n }\n msgStatus.appendChild(ul);\n}", "async function listMessages(req, res, next) {\n try {\n const connection = await getConnection();\n const { search } = req.query;\n\n let result;\n\n if (search) {\n await searchSchema.validateAsync(search);\n\n [result] = await connection.query(\n `\n select title, text, type, category from messages\n where messages.title like ? or messages.text like ? or messages.type like ? or messages.category like ?\n `,\n [`%${search}%`, `%${search}%`, `%${search}%`, `%${search}%`]\n );\n } else {\n [result] = await connection.query(`\n select from_users_id, concat_ws(' ',a.name, b.surname) as De, e.avatar as avatar_from, to_users_id, concat_ws(' ',c.name, d.surname) as Para, f.avatar as avatar_to, title, text, image, type, category, create_message from messages\n inner join users a on a.id = from_users_id\n inner join users b on b.id = from_users_id\n inner join users c on c.id = to_users_id\n inner join users d on d.id = to_users_id\n inner join users e on e.id = from_users_id\n inner join users f on f.id = to_users_id\n order by create_message desc;\n `);\n }\n\n const [messages] = result;\n\n connection.release();\n\n res.send({\n status: 'ok',\n message: 'Lista de mensajes De Para en orden descendente',\n data: result,\n });\n } catch (error) {\n next(error);\n }\n}", "function displayMessages(messages) {\n let userLocalStorage = localStorage.getItem(\"username\");\n user.textContent = userLocalStorage;\n\n let oldmessage = document.querySelector('.message')\n \n if (oldmessage !== null){\n oldmessage.remove();\n }\n \n const newMessage = document.createElement('div');\n newMessage.className = 'message';\n\n for (let message of messages) {\n\n let otherMessage = document.createElement('div');\n otherMessage.className = 'message-row other-message';\n\n let listOfMessage = otherMessage;\n\n let yourMessage = document.createElement('div');\n yourMessage.className = 'message-row your-message';\n\n let messageTitle = document.createElement('div');\n messageTitle.className = 'message-title';\n\n let title = document.createElement('div');\n title.className = 'message-title';\n title.id = 'title1';\n\n let messageText = document.createElement('div');\n messageText.className = 'message-text';\n\n let newPara = document.createElement('p');\n let newSpan = document.createElement('span');\n \n if (userLocalStorage === message.username){\n title.id = 'title2';\n listOfMessage = yourMessage;\n };\n\n newSpan.textContent = message.username;\n newPara.textContent = emoticon(message.text);\n\n if (message.bold === true){\n newPara.style.fontWeight = 'bold';\n }else{\n newPara.style.fontWeight = 'normal';\n };\n\n if (message.italic === true){\n newPara.style.fontStyle = 'italic';\n }else{\n newPara.style.fontStyle = 'normal';\n };\n\n // if (title.id === 'title1'){\n // let sound = new Audio(\"../img/chat_request.mp3\");\n // sound.play();\n // };\n \n title.appendChild(newSpan);\n messageText.appendChild(newPara);\n\n messageTitle.appendChild(title);\n messageTitle.appendChild(messageText);\n\n listOfMessage.appendChild(messageTitle);\n newMessage.appendChild(listOfMessage);\n chatContent.appendChild(newMessage);\n goBottom();\n };\n}", "function getAllMessage(userId, callback) {\n\tdb.getData(\"messages\", {user_id: userId}, callback);\n}", "function loadChatBox(messages) {\n // $('#messages').html('');\n \n messages.forEach(function (message) { \n var cssClass = (message.senderName == myUser.name) ? 'chatMessageRight col-8 my-message d-flex' : 'chatMessageLeft col-8 my-friend-message d-flex flex-row-reverse ml-auto';\n $('#messages').append('<div class=\"' + cssClass + '\">' + message.text + '</div>');\n });\n console.log($('#messages').html());\n}", "function getAllMessages(){\n\t\treturn Restangular.all('message').getList();\n\t}// end of get all messages function", "function loadMessages(convList){\n // var convList = [\n // conv_id: String, /* id of this conversation, same as contact id if type is one or con, group id if type is grp */\n // type: String, /* 1- CON, 2 - ONE, 3 - GRP */\n // timestamp: String, /* Time stamp of this conversation.. */\n // from: String, /* Email of sender.. */\n // msg_type: String, /* 1- TEXT, 2 - IMG, 3 - FILE */\n // msg_subtype: String, /* TEXT - \"\", IMG - \"\" OR JPEG, PNG, ..., FILE - PDF, WORD, EXCEL, .. */\n // msg_content: String /* TEXT - message of text, IMG - Content of image FILE - Path of file.. */\n // ];\n\n\n for(var i in convList) {\n var oneMsg = convList[i];\n var isSelf = false;\n if(oneMsg.from == userSelf.email) {\n isSelf = true;\n }\n\n if(oneMsg.msg_type == \"TEXT\") {\n var msgData = {\n conv_id: oneMsg.conv_id,\n type: oneMsg.type,\n from: oneMsg.from,\n timestamp: oneMsg.timestamp,\n to: \"ND\",\n msg: oneMsg.msg_content\n };\n addMsgFromUser(msgData, isSelf, true);\n }\n else if(oneMsg.msg_type == \"IMG\") {\n var imgData = {\n conv_id: oneMsg.conv_id,\n type: oneMsg.type,\n from: oneMsg.from,\n timestamp: oneMsg.timestamp,\n filePath: oneMsg.msg_subtype,\n to: \"ND\",\n img: oneMsg.msg_content\n };\n addImgFromUser(imgData, isSelf, true);\n }\n else if(oneMsg.msg_type == \"FILE\") {\n var fileData = {\n conv_id: oneMsg.conv_id,\n type: oneMsg.type,\n from: oneMsg.from,\n timestamp: oneMsg.timestamp,\n filePath: oneMsg.msg_subtype,\n to: \"ND\",\n fileIcon: oneMsg.msg_content\n };\n addFileFromUser(fileData, isSelf, true);\n }\n }\n}", "retrieveMessages() {\n let sender = this.props.pair.sender;\n let receiver = this.props.pair.receiver;\n let messageList = [];\n let portrait = require('../../assets/default_avatar.png');\n\n // If the sender/receiver pairing matches the to/from section of a message, add to our list.\n this.props.messages.forEach((item, index, array) => {\n if((item.from === receiver && item.to === sender) ||\n (item.to === receiver && item.from === sender)) {\n console.log(item.time);\n let message = {\n _id: item.id,\n text: item.body,\n createdAt: new Date(item.time * 1000),\n user: {\n _id: 0,\n },\n };\n // User _id: 1 for application user, 2 for other party\n if(item.from === receiver) {\n message.user._id = 2;\n if(this.props.pair.senderCard.image !== null) {\n message.user.avatar = this.props.pair.receiverCard.image;\n } else {\n message.user.avatar = portrait;\n }\n }\n else\n message.user._id = 1;\n messageList.push(message);\n }\n });\n\n // Sort the messages by time\n messageList.sort((a, b) => {\n return a.createdAt.getTime() < b.createdAt.getTime();\n });\n\n // Update the message list\n this.setState({messages : messageList});\n }", "async function getMsgList(dispatch, userid) {\n initIO(dispatch, userid)\n const response = await reqChatMsgList()\n const result = response.data\n if(result.code===0) {\n const {users, chatMsgs} = result.data\n // Distribute synchronization action\n dispatch(receiveMsgList({users, chatMsgs, userid}))\n }\n}", "function userExtract (username) { \n // the last messages in the streams.home array are the newest\n var userMsgs = streams.users[username];\n\n $('.followMessages').html('');\n $('div.followMessages').css('background-color', 'maroon');\n\n // iterates through each message, add\n for (var i = 0, len = userMsgs.length; i < len; i++) {\n var name = userMsgs[i].user;\n var msg = userMsgs[i].message;\n var time = userMsgs[i].created_at;\n \n // prepends the newest messages to the body.div element\n $('.followMessages').prepend(msgOutput(name, msg, time));\n } \n}", "function listMessages(userId, query, callback) {\r\n var getPageOfMessages = function(request, result) {\r\n request.execute(function(resp) {\r\n result = result.concat(resp.messages);\r\n var nextPageToken = resp.nextPageToken;\r\n if (nextPageToken) {\r\n request = gapi.client.gmail.users.messages.list({\r\n 'userId': userId,\r\n 'pageToken': nextPageToken,\r\n 'q': query\r\n });\r\n console.log(\r\n \"hello!\");\r\n } else {\r\n callback(result);\r\n }\r\n });\r\n };\r\n var initialRequest = gapi.client.gmail.users.messages.list({\r\n 'userId': userId,\r\n 'q': query\r\n });\r\n console.log(\"hello!!\");\r\n}", "async function checkNewMessagesAllUsers() {\n let name = await getCurrentUserName();\n\n let new_message_selector = await getSelectorNewMessage();\n\n let user = await page.evaluate((selector_newMessage,selector_newMessageUser,selector_newMessageUserPicUrl) => {\n\n \t let nodes = document.querySelectorAll(selector_newMessage);\n\n \t let el = nodes[0].parentNode.parentNode.parentNode.parentNode.parentNode.querySelector(selector_newMessageUser);\n\n \t let name=el ? el.innerText : '';\n \t \n \t el=nodes[0].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.querySelector(selector_newMessageUserPicUrl);\n \t let number='';\n \t if (el && el.hasAttribute('src')){\n \t let arr=/&u=([0-9]+)/g.exec(el.getAttribute('src'));\n \t if (arr[1])\n \t\t number=arr[1]\n \t }\n \t return [name,number];\n\n }, new_message_selector, selector.new_message_user,selector.new_message_user_pic_url);\n \n if (user[0] && user[0] != name) {\n\n\n if (last_received_message_other_user != user[0]) {\n \n \tlet message = 'You have a new message by \"' + user[0]+\";\"+user[1] + '\". Switch to that user to see the message.';\n \n \tprint('\\n' + message, config.received_message_color_new_user);\n\n \t// show notification\n \tnotify(user[0]+\";\"+user[1], message);\n\n \tlast_received_message_other_user = user[0];\n }\n }\n }", "function sendUpdatedUserlist(conn, message) {\n\tconn.send(JSON.stringify({ type: \"server_userlist\", name: message }));\n\n}", "function addMessage (type, user, msg){\n let ul=document.querySelector('.chatList');\n switch(type){\n case 'status':\n ul.innerHTML +='<li class=\"m-status\">' + msg + '</li>'\n break;\n \n case 'msg':\n if(user == userName){\n ul.innerHTML +='<li class=\"m-txt\"><span class=\"me\">' + user +'</span>'+msg+'</li>'\n }else{\n ul.innerHTML +='<li class=\"m-txt\"><span>' + user +'</span>'+msg+'</li>'\n }\n break; \n }\n //This send the 'scroll' to the end of the page\n ul.scrollTop = ul.scrollHeight;\n}", "getAllMessages() {\n return fetch(`${remoteURL}/messages?_expand=user`).then(result => result.json()).then((data) => {\n console.log(data)\n return data\n })\n }", "renderChannelMessages() {\n console.log('props are', this.props);\n let messages = this.props.channelMessages.map(message => {\n return (\n <ListGroup.Item className='color'>{message.username}: {message.content}</ListGroup.Item>\n )\n });\n return messages;\n }", "function listUsers() { // user listing\n let numbers = [\":one:\", \":two:\", \":three:\", \":four:\", \":five:\"]; // normal discord emoji text\n let numbersUnicode = [\"\\u0031\\u20E3\", \"\\u0032\\u20E3\", \"\\u0033\\u20E3\", \"\\u0034\\u20E3\", \"\\u0035\\u20E3\"]; // unicode\n for (let i = 0; i <= 4; i++) { // we select first 5 users\n let u = users[i]; // we try to define the user\n if (u) { // if the user exists\n uarr.push(numbers[i] + ` ${u.name}`); // we push it into the array with the newline definitions\n binds[numbersUnicode[i]] = { // we also save it\n userId: u.id // and put there his user id\n };\n }\n }\n return uarr.join(\"\\n\"); // we return a string from the array with newlines\n }", "function outputMessage(message) {\n const div = document.createElement('div')\n div.classList.add('message')\n if (message.username === username) {\n div.innerHTML = `<li class=\"replies\">\n <span class=\"user-name\" style=\"float:right\">${message.username}</span>\n <p>${message.text} <span style=\"text-align:right;font-size:9px; display:block\">${message.time}</span></p>\n </li>`\n document.querySelector('.chat-messages').appendChild(div)\n } else {\n div.innerHTML = `<li class=\"sent\">\n <span class=\"user-name\" style=\"float:left; margin-right: 10px;\">${message.username}</span>\n <p>${message.text} <span style=\"text-align:left;font-size:9px; display:block\">${message.time}</span></p>\n </li>`\n document.querySelector('.chat-messages').appendChild(div)\n }\n}", "get getLastMessageList () {\n //\n const limit = this\n .request\n .input('limit', null)\n\n return Message\n .query()\n .notDeleted()\n .with('user')\n .limit(limit || 50)\n .orderBy('id', 'desc')\n .fetch()\n }", "handleOnUserMessage(user, message){\n\n // Message in JSON-Objekt umwandeln für Datenzugriff\n var data = JSON.parse(message);\n // Spiel-Logik hat hier nichts zu suchen, kommt dann im GameRoom noch ...\n if (data.dataType === GAME_LOGIC) return;\n\n // Chat-Nachricht\n if (data.dataType === CHAT_MESSAGE) {\n\t\t\t// Absender ergänzen, die anderen wollen ja wissen, vom wem die Nachricht war\n\t\t\tdata.sender = user.Username;\n }\n // Es hat eine Nachricht drin\n if (typeof data.message !== 'undefined'){\n /*\n * Diverse mögliche Kommando abarbeiten\n */\n //UserName soll geändert werden\n if(data.message.startsWith(\"/nick \")) {\n console.log(\"Kommando: /nick\");\n // Username überschreiben und alle User informieren\n user.setUsername(data.message.replace(\"/nick \", \"\"));\n user.room.sendDetails();\n\n // zusätzlich eine Nachricht an alle vorbereiten\n data = {\n dataType: CHAT_MESSAGE,\n sender: \"Server\",\n message: \"User [\"+data.sender + \"] heisst neu [\"+user.Username+\"]\"\n };\n }\n // Kommando /play wechselt dem Raum bei Erfolg\n else if(data.message.startsWith(\"/play \")) {\n // mit wem will aktueller User spielen?\n let otherName = data.message.replace(\"/play \", \"\");\n let otherIdx = user.room.users.findIndex(e => e.Username.trim() == otherName );\n\n console.log(\"/playResult: \" + otherIdx);\n\n // Gibt es den überhaupt?\n if(otherIdx == -1){\n //nein, nachricht vorbereiten\n data = {\n dataType: CHAT_MESSAGE,\n sender: \"Server\",\n message: \"User [\"+otherName + \"] nicht gefunden\"\n };\n // ja, es gibt ihn\n }else {\n let other = user.room.users[otherIdx];\n\n // aktuellen User und Spielpartner aus aktuellem Raum entfernen\n user.room.removeUser(user);\n user.room.removeUser(other);\n\n // neuen Raum eröffnen und beide darin zuordnen\n user.setRoom(new GameRoom(user.Username + \" vs. \" + otherName));\n other.setRoom(user.room);\n user.room.addUser(user);\n user.room.addUser(other);\n //--> Die User werden im addUser noch über die neuen Raum-Details informiert\n }\n\n\n }\n // Raum verlassen und in Lobby zurückkehren\n else if(data.message.startsWith(\"/quit\")) {\n\n console.log(\"/quit: \" + user.Username);\n //info vorbereiten und senden\n data = {\n dataType: CHAT_MESSAGE,\n sender: \"Server\",\n message: \"User [\"+user.Username + \"] quitted\"\n };\n user.room.sendAll(JSON.stringify(data));\n // user entfernen\n user.room.removeUser(user);\n // .. und an Lobby zuweisen\n user.room = user.lobby;\n user.lobby.addUser(user); // in addUser werden wieder alle informiert\n\n // Nachricht vorbereiten\n data = {\n dataType: CHAT_MESSAGE,\n sender: \"Server\",\n message: \"User [\"+user.Username + \"] joined\"\n };\n\n }\n // alles andere müssten nun Chat-Nachrichten sein\n else {\n // Aus Sicherheitsgründen werden sämtliche Zeichen durch den Code ersetzt\n // dadruch bleiben auch alle <>/*[]\" erhalten und es kann nichts \"eingeschleust\" werden\n data.message = data.message.replace(/[\\u00A0-\\u9999<>\\&]/gim, function(i) {\n return '&#'+i.charCodeAt(0)+';';\n });\n\n }\n }//message ist gesetzt\n\n // vorbereitete Nachricht an alle senden\n user.room.sendAll(JSON.stringify(data));\n\n}", "async function getMessagesFrom(req, res, next) {\n try {\n const { id } = req.params;\n const connection = await getConnection();\n const [result] = await connection.query(\n `\n select messages.id, concat_ws(' ', a.name, b.surname) as Para, c.avatar as avatar_to, title, text, image, type, category, from_users_id, create_message from messages\n inner join users a on a.id = to_users_id\n inner join users b on b.id = to_users_id\n inner join users c on c.id = to_users_id\n where from_users_id=?\n order by create_message desc;\n `,\n [id]\n );\n\n connection.release();\n res.send({\n status: 'ok',\n data: result,\n });\n } catch (error) {\n next(error);\n }\n}", "function displayMessages(messages) {\n\t// Remove messages from html\n\t$('#messageTable tbody').html('');\n\t// Fill the table messages\n\t$.each(messages, function(index, message){\n\t\tvar line = $('#messageTable ').append('<tr><td>'+message.username+'</td><td>'+message.message+'</td></tr>');\n\t\t\n\t});\n}", "async function retrieveMessages () {\n console.log(\"retrieveMessages executing\");\n \n let global = JSON.parse(sessionStorage.global);\n // sets the user nick in the <em id=\"userNick\"></em> in wall.html file\n setNick(global.nick);\n \n /*\n * Fetch: \n * \n * send/retrieve network requests to/from the server\n\n * - let promise = fetch(url, [options])\n * - url – the URL to access.\n * - options – optional parameters: method, headers etc.\n * \n * See comments in login.js file \n * \n */\n let response = await fetch(global.messageAddress);\n let messageList = await response.json(); //extract JSON from the http response\n \n // declare and initialize objects to update the table\n let tableRef = document.getElementById('messageTable');\n let tableBody = tableRef.getElementsByTagName('tbody')[0];\n let newTbody = document.createElement('tbody');\n tableBody.parentNode.replaceChild(newTbody, tableBody);\n \n // sets the user nick in the <em id=\"numberMessages\"></em> in wall.html file\n\n setNumberOfMessages(messageList.length);\n \n \n for (var i = 0; i < messageList.length; i++){\n // the item below has this (JSON) format:\n // item :{\"content\":\"this is a message\",\n // \"idmessage\":1,\n // \"owner\":{\"idpublicuser\":2,\"nick\":\"Cervantes\"}}\n\n let item = messageList[i];\n console.log(\"retrievedMessages :\" + JSON.stringify(item));\n \n // Insert a row in the table at the last row\n let newRow = newTbody.insertRow();\n \n // Insert content cell in the row at index 0\n // It will contain the content of the message\n let newCell = newRow.insertCell(0);\n // item :{\"content\":\"this is a message\",\n // \"idmessage\":1,\n // \"owner\":{\"idpublicuser\":2,\"nick\":\"Cervantes\"}} \n let newText = document.createTextNode(item.content);\n newCell.appendChild(newText);\n \n // Insert owner cell in the row at index 1\n // It will contain the owner of the message\n newCell = newRow.insertCell(1);\n // item :{\"content\":\"this is a message\",\n // \"idmessage\":1,\n // \"owner\":{\"idpublicuser\":2,\"nick\":\"Cervantes\"}} \n newText = document.createTextNode(item.owner.nick);\n newCell.appendChild(newText);\n \n // Insert button cell in the row at index 2\n // It will contain the button to delete the message \n newCell = newRow.insertCell(2);\n let removebutton = document.createElement(\"button\");\n removebutton.innerHTML = \"remove\";\n removebutton.setAttribute(\"id\", item.idmessage);\n // item :{\"content\":\"this is a message\",\n // \"idmessage\":1,\n // \"owner\":{\"idpublicuser\":2,\"nick\":\"Cervantes\"}} \n removebutton.addEventListener(\"click\", function(){\n let idElem = event.srcElement.id;\n // deleteMessage is defined in file deletemessages.js\n deleteMessage(idElem);\n });\n newCell = newRow.insertCell(2);\n newCell.appendChild(removebutton);\n }\n}", "get messages() {\n\t\treturn Message.collection.find({ chatId: this._id }).fetch();\n\t}", "function displayMessage(user, msg, time) {\r\n let newDiv = document.createElement('div');\r\n if (user === username) {\r\n newDiv.className = 'msg-container-left';\r\n }\r\n else {\r\n newDiv.className = 'msg-container-right';\r\n }\r\n let newUser = document.createElement('div');\r\n newUser.className = 'msg-user';\r\n newUser.innerHTML = user;\r\n newDiv.appendChild(newUser);\r\n let newMsg = document.createElement('p');\r\n newMsg.className = 'msg-text';\r\n newMsg.innerHTML = msg;\r\n newDiv.appendChild(newMsg);\r\n let newTime = document.createElement('span');\r\n newTime.innerHTML = time;\r\n newMsg.appendChild(newTime);\r\n document.querySelector('#message-list').appendChild(newDiv);\r\n document.querySelector('.chat').scrollTop = 1000000;\r\n }", "function selectBotFromList(){\n var parentUl = $('.user-content').children('ul');\n var users = parentUl.children('li');\n var user = users.get(0);\n\n // Clear message contents..\n $('#messages').html('');\n\n // Set user to select..\n for(var i = 0; i < users.length; i++) {\n user = users.get(i);\n user.setAttribute(\"style\", \"\");\n }\n users.get(1).setAttribute(\"style\", \"background-color: #eee;\");\n selectedIndex = 1;\n\n disableActionButton();\n var oneUser = {\n id : \"BOT\",\n contact_id: \"BOT\",\n username : \"CHAT BOT\",\n email : \"CHATEMAIL\",\n img : \"/images/bot.png\"\n };\n\n selectFlag = \"BOT\";\n userSelected = oneUser;\n\n showUserInfo(oneUser);\n connectChatBot();\n\n curConvId = \"BOT\";\n}", "function get_messages() {\n\n fct_MyLearn_API_Client.query({ type: 'Mensajes', extension1: 'Trabajo', extension2: $routeParams.IdTrabajo }).$promise.then(function (data) {\n $scope.ls_msjs = data;\n });\n\n }", "function inviaMessaggioUtente(){\n var text_user=($('.send').val());\n if (text_user) { //la dicitura cosi senza condizione, stà a dire text_user=0\n templateMsg = $(\".template-message .new-message\").clone()\n templateMsg.find(\".text-message\").text(text_user);\n templateMsg.find(\".time-message\").text(ora);\n templateMsg.addClass(\"sendbyUser\");\n $(\".conversation\").append(templateMsg);\n $(\".send\").val(\"\");\n setTimeout(stampaMessaggioCpu, 2000);\n\n var pixelScroll=$('.containChat')[0].scrollHeight;\n $(\".containChat\").scrollTop(pixelScroll);\n }\n }", "function addMessageToList(username, style_type, message) {\n username = $sanitize(username)\n removeChatTyping(username)\n var color = style_type ? getUsernameColor(username) : null\n self.messages.push({ content: $sanitize(message), style: style_type, username: username, color: color })\n $ionicScrollDelegate.scrollBottom();\n }", "function receiveFromParent(user, message)\n{\n\t$('#messages').append(makeMessageFrom(user, message));\n}", "async function openChat(userTag) {\n fetch('/getFriendInfo',{\n method: 'POST',\n headers: {\n \"content-type\":\"application/json\"\n },\n body: JSON.stringify({from:localStorage.getItem('userId'),to:userTag.id})\n }).then(res=>res.json())\n .then(async data=>{\n let ul = document.getElementById(\"messageContainer\");\n ul.innerHTML = ''\n\n let {Friend,messages,User} = await data\n user = User\n friend = Friend\n \n messages.forEach(message=>{\n let ul = document.getElementById(\"messageContainer\");\n let li = document.createElement(\"li\");\n let browserUser = localStorage.getItem(\"userId\");\n let img = document.createElement(\"img\");\n \n if (browserUser === message.from) {\n li.className = \"me\";\n img.src = `images/resources/${User.profilePhotos}`;\n } else {\n li.className = \"you\";\n img.src = `images/resources/${Friend.profilePhotos}`;\n }\n let figure = document.createElement(\"figure\");\n\n let p = document.createElement(\"p\");\n p.innerHTML = message.text;\n figure.appendChild(img);\n li.appendChild(figure);\n li.appendChild(p);\n ul.appendChild(li);\n })\n \n await outputFriendHeader(Friend)\n \n })\n \n}", "readMessages(username) {\n if (this.findUser(username)) {\n return this.findUser(username).getMessagesAsString();\n }\n }", "function getReceivedMessages(req, res) {\n const userId = req.user.sub;\n let page = 1;\n\n if (req.params.page) {\n page = req.params.page;\n }\n\n const itemsPerPage = 4;\n Message.find({ receiver: userId })\n .populate('emitter', 'name surname _id nick image')\n .sort({created_at: 'desc'})\n .paginate(page, itemsPerPage, (err, messages, total) => {\n if (err)\n return res.status(500).send({ message: 'Error en la petición.' });\n if (!messages)\n return res.status(404).send({ message: 'No hay mensajes.' });\n return res.status(200).send({\n total,\n pages: Math.ceil(total / itemsPerPage),\n messages\n });\n });\n}", "getAllMessages () {\n API.getAllMessages()\n .then((response => {\n let messages = response\n //Gets user friend data and stores it for use//\n API.getFriendData(sessionStorage.activeUser)\n .then((friendResponse) => {\n messaging.buildMessageArray(messages, friendResponse)\n }) \n }))\n }", "function AddnewMessages(message)\n{\n\t\t\tconsole.log(message)\n\t\t\t\n\t\t\tif(message.channel.sid == generalChannel.sid)\n\t\t\t{\n\t\t\t\tgeneralChannel.getMessages(1).then(function(messagesPaginator){\n\t\t\t\t\t\t\n\t\t\t\t\tconst ImageURL = messagesPaginator.items[0];\n\t\t\t\t\t\n\t\t\t\t\t\t\tif(message.state.attributes.StaffuserName == \"admin\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (message.type == 'media')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t ImageURL.media.getContentUrl().then(function(url){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"IMAGE url\",url);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(message.state.media.state.contentType == \"image/jpeg\" || message.state.media.state.contentType == \"image/png\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//==============image print \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar temp='<div class=\"m-messenger__wrapper\" id=\"message_'+message.state.index+'\" >'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message m-messenger__message--out\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-body\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"modify-btn\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<a id=\"'+message.state.index+'\" onClick=\"MessageDelete(this.id)\" class=\"remove btn m-btn m-btn--icon btn-sm m-btn--icon-only m-btn--pill\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<i class=\"la la-close\"></i>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</a>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-arrow\"></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-content\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-text\"><img src=\"'+url+'\" height=\"100px\" width=\"100px\"/></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").append(temp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").animate({ scrollTop: $(this).height() }, 10);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//$(\"#chatmessage\").append(\"<li id='message_\"+message.state.index+\"' class='classleft'><img src='\"+url+\"' /> <div id='\"+latestPage.items[msgI].index+\"' onClick='MessageDelete(this.id)'><img src='delete.png'/></div></li>\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//= ==========Any file print hre admin side ======\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t var temp='<div class=\"m-messenger__wrapper\" id=\"message_'+message.state.index+'\" >'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message m-messenger__message--out\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-body\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"modify-btn\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<a id=\"'+message.state.index+'\" onClick=\"MessageDelete(this.id)\" class=\"remove btn m-btn m-btn--icon btn-sm m-btn--icon-only m-btn--pill\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<i class=\"la la-close\"></i>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</a>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-arrow\"></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-content\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-text\"><a src=\"'+url+'\"/></a></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").append(temp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").animate({ scrollTop: $(this).height() }, 10);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//$(\"#chatmessage\").append(\"<li id='message_\"+message.state.index+\"' class='classleft'><a href='\"+url+\"' >file</a><div id='\"+latestPage.items[msgI].index+\"' onClick='MessageDelete(this.id)'><img src='delete.png'/></div> </li>\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t// -------------simple text print ================\n\t\t\t\t\t\t\t\t\t\t\tif(message.state.attributes.note == \"note\")\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tvar temp='<div class=\"m-messenger__wrapper owner_note\" id=\"message_'+message.state.index+'\" >'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message m-messenger__message--out\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-body\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"modify-btn\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<a id=\"'+message.state.index+'\" onclick=\"MessageEdit(this.id);\" class=\"edit btn m-btn m-btn--icon btn-sm m-btn--icon-only m-btn--pill\" >'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<i class=\"la la-pencil\"></i>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</a>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<a id=\"'+message.state.index+'\" onClick=\"MessageDelete(this.id)\" class=\"remove btn m-btn m-btn--icon btn-sm m-btn--icon-only m-btn--pill\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<i class=\"la la-close\"></i>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</a>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-arrow\"></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-content\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-text\" id=\"editmessage_'+message.state.index+'\">'+message.state.body+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<i class=\"la la-pencil\"></i></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>';\n\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").append(temp);\n\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").animate({ scrollTop: $(this).height() }, 10);\n\t\t\t\t\t\t\t\t\t\t\t\t//$(\"#chatmessage\").append(\"<li id='message_\"+message.state.index+\"' class='classleft note'>\"+message.state.body+\"<img src='note.png'/><div id='\"+message.state.index+\"' onclick='MessageEdit(this.id);'><img src='edit.png'/></div><div id='\"+message.state.index+\"' onClick='MessageDelete(this.id)'><img src='delete.png'/></div></li>\");\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t var temp='<div class=\"m-messenger__wrapper\" id=\"message_'+message.state.index+'\" >'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message m-messenger__message--out\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-body\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"modify-btn\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<a id=\"'+message.state.index+'\" onclick=\"MessageEdit(this.id);\" class=\"edit btn m-btn m-btn--icon btn-sm m-btn--icon-only m-btn--pill\" >'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<i class=\"la la-pencil\"></i>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</a>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<a id=\"'+message.state.index+'\" onClick=\"MessageDelete(this.id)\" class=\"remove btn m-btn m-btn--icon btn-sm m-btn--icon-only m-btn--pill\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<i class=\"la la-close\"></i>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</a>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-arrow\"></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-content\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-text\" id=\"editmessage_'+message.state.index+'\">'+message.state.body+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>';\n\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").append(temp);\n\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").animate({ scrollTop: $(this).height() }, 10);\n\t\t\t\t\t\t\t\t\t\t\t\t//$(\"#chatmessage\").append(\"<li id='message_\"+message.state.index+\"' class='classleft'>\"+message.state.body+\"<div id='\"+message.state.index+\"' onclick='MessageEdit(this.id);'><img src='edit.png'/></div><div id='\"+message.state.index+\"' onClick='MessageDelete(this.id)'><img src='delete.png'/></div></li>\");\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\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{\n\t\t\t\t\t\t\t\t\t\tif (message.type == 'media')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t ImageURL.media.getContentUrl().then(function(url){\n\t\t\t\t\t\t\t\t\t\t\t\t console.log(\"IMAGE url\",url);\n\t\t\t\t\t\t\t\t\t\t\t\tif(message.state.media.state.contentType == \"image/jpeg\" || message.state.media.state.contentType == \"image/png\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar temp='<div class=\"m-messenger__wrapper\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message m-messenger__message--in\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-pic\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<img src=\"assets/app/media/img/users/user4.jpg\" alt=\"\"/>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-body\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-arrow\"></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-content\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-username\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<img src=\"'+url+'\" height=\"100px\" width=\"100px\"/>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-text\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>';\n\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").append(temp);\n\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").animate({ scrollTop: $(this).height() }, 10);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//$(\"#chatmessage\").append(\"<li class='classright'><img src='\"+url+\"' /> </li>\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t var temp='<div class=\"m-messenger__wrapper\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message m-messenger__message--in\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-pic\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<img src=\"assets/app/media/img/users/user4.jpg\" alt=\"\"/>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-body\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-arrow\"></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-content\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-username\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<a href=\"'+url+'\" >file</a>' \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-text\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t $(\"#chatmessage\").append(temp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t $(\"#chatmessage\").animate({ scrollTop: $(this).height() }, 10);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//$(\"#chatmessage\").append(\"<li class='classright'><a href='\"+url+\"' >file</a> </li>\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tvar temp='<div class=\"m-messenger__wrapper\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message m-messenger__message--in\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-pic\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<img src=\"assets/app/media/img/users/user4.jpg\" alt=\"\"/>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-body\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-arrow\"></div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-content\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-username\">'\n\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'<div class=\"m-messenger__message-text\">'+message.state.body+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>'\n\t\t\t\t\t\t\t\t\t\t\t\t\t+'</div>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").append(temp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$(\"#chatmessage\").animate({ scrollTop: $(document).height() }, 10);\n\t\t\t\t\t\t\t\t\t\t//$(\"#chatmessage\").append(\"<li class='classright'>\"+message.state.body+\"</li>\");\n\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t$(\"#chatmessage\").animate({ scrollTop: $(this).height() }, 1000);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t//$(\"#listOfChannel\").html(\"\");\n\t\t\t\t\tfor(var j=0;j<StoreChannel.length;j++)\n\t\t\t\t\t{\n\t\t\t\t\t\t\t//console.log(\"message.channel.sid\",message.channel.sid);\n\t\t\t\t\t\t\t//console.log(\"StoreChannel[i].state.sid\",StoreChannel[j].sid)\n\t\t\t\t\t\t\tif(message.channel.sid == StoreChannel[j].sid)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tconsole.log(\"Messagerboxy\",message.channel.body)\n\t\t\t\t\t\t\t\t\t\tvar countId=$(\"#count_\"+j).val();\n\t\t\t\t\t\t\t\t\t\tcountId=parseInt(countId)+1;\n\t\t\t\t\t\t\t\t\t\tconsole.log(\"countIdcountId\",countId);\n\t\t\t\t\t\t\t\t\t\t$(\".count_\"+j).text(countId);\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t$(\".count_\"+j).addClass(\"m-widget4__number\")\n\t\t\t\t\t\t\t\t\t\t$(\"#onlineStatus_\"+j).removeClass(\"bg-gray\");\n\t\t\t\t\t\t\t\t\t\t$(\"#onlineStatus_\"+j).addClass(\"bg-success\");\n\t\t\t\t\t\t\t\t\t\t$(\"#count_\"+j).val(parseInt(countId));\n\t\t\t\t\t\t\t\t\t\t$(\"#lastMessage_\"+j).text(message.state.body)\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\t\t\t}\n\t\n\t \n\t \n\t\n\t//$(\"#listOfChannel\").prepend(\"<li id='\"+StoreChannel[j].state.uniqueName+\"'onclick='customergetChannel(this.id)' style='color:green;'>\"+StoreChannel[j].state.friendlyName+\"<span class='count_\"+j+\"' style='color:red;'>\"+txtval+\"<span><input type='hidden' id='count_\"+j+\"' value='\"+txtval+\"'/></li>\");\n\t\n\t\n\t\t\t\t\t}\n\n\t\t}\n\t\t\n\n}", "function getMessages(jid){\n $.ajax({\n type: \"GET\",\n dataType : 'json',\n url: \"/api/user-messages?user=\" + jid + \"/\",\n success: function(reply){\n Spinner.stopSpinner();\n appendMessages(reply, jid);\n }\n });\n}", "function addMessage(msg, isUser) {\n\n const words = Util.makeElement('p', 'message-content')\n words.innerText = msg;\n const message = Util.makeElement('div', 'message-box');\n // find who gave this message\n if (isUser) {\n message.className += ' right-align';\n }\n message.appendChild(words);\n // add message to feed\n Feed.appendChild(message);\n // Feed.scrollIntoView(true)\n message.scrollIntoView({\n behavior: 'smooth' \n });\n // Feed.scrollTop = Feed.scrollHeight;\n}", "function renderMessage(message) {\n $('.messages').append('<div class=\"message\"><strong>' + message.username + '</strong>:' + message.message + '</div>');\n}", "function getChatCallback(users){\n if (users !== null) {\n var tmp = '';\n $.each(users, function(i,itm){\n tmp += '<li>';\n\n //don't display the message for the original player\n if(itm.username !== username){\n tmp += itm.username + ': ' ;\n }\n\n tmp += itm.message +' <span class=\"time_stamp\"> ' + itm.time_stamp+'</span></li>';\n });\n\n chatBox.html(tmp);\n scrollChatBox();\n }\n setTimeout(function(){\n getChat(gameId);\n }, 2000);\n}", "function collectMessagesByUser(user, params){\n return collectMessagesBy(\"user\", user, params);\n }", "function writeMessages(msgs) {\n var num = msgs.length - 4;\n while(num--) {\n if(parseInt(msgs[num].user_id) % 5 == 0) {\n term.red(\"[\" + num + \"] \" + msgs[num].name + \" \"); \n\t\t\tif(msgs[num].favorited_by.includes(user_id)) {\n\t\t\t\tterm.bold.underline.red(\"(\" + msgs[num].favorited_by.length + \")\");\n\t\t\t} else {\n\t\t\t\tterm.red(\"(\" + msgs[num].favorited_by.length + \")\");\n\t\t\t}\n\t\t\tterm.red(\": \");\n } else if(parseInt(msgs[num].user_id) % 5 == 1) {\n term.white(\"[\" + num + \"] \" + msgs[num].name + \" \");\n\t\t\tif(msgs[num].favorited_by.includes(user_id)) {\n\t\t\t\tterm.bold.underline.white(\"(\" + msgs[num].favorited_by.length + \")\");\n\t\t\t} else {\n\t\t\t\tterm.white(\"(\" + msgs[num].favorited_by.length + \")\");\n\t\t\t}\n\t\t\tterm.white(\": \");\n } else if(parseInt(msgs[num].user_id) % 5 == 2) {\n term.blue(\"[\" + num + \"] \" + msgs[num].name + \" \");\n\t\t\tif(msgs[num].favorited_by.includes(user_id)) {\n\t\t\t\tterm.bold.underline.blue(\"(\" + msgs[num].favorited_by.length + \")\");\n\t\t\t} else {\n\t\t\t\tterm.blue(\"(\" + msgs[num].favorited_by.length + \")\");\n\t\t\t}\n\t\t\tterm.blue(\": \");\n } else if(parseInt(msgs[num].user_id) % 5 == 3) {\n term.magenta(\"[\" + num + \"] \" + msgs[num].name + \" \");\n\t\t\tif(msgs[num].favorited_by.includes(user_id)) {\n\t\t\t\tterm.bold.underline.magenta(\"(\" + msgs[num].favorited_by.length + \")\");\n\t\t\t} else {\n\t\t\t\tterm.magenta(\"(\" + msgs[num].favorited_by.length + \")\");\n\t\t\t}\n\t\t\tterm.magenta(\": \");\n } else if(parseInt(msgs[num].user_id) % 5 == 4) {\n term.cyan(\"[\" + num + \"] \" + msgs[num].name + \" \");\n\t\t\tif(msgs[num].favorited_by.includes(user_id)) {\n\t\t\t\tterm.bold.underline.cyan(\"(\" + msgs[num].favorited_by.length + \")\");\n\t\t\t} else {\n\t\t\t\tterm.cyan(\"(\" + msgs[num].favorited_by.length + \")\");\n\t\t\t}\n\t\t\tterm.cyan(\": \");\n }\n var italic = false;\n var bold = false;\n var msg = msgs[num].text;\n if(msg == null) {\n msg = \"\";\n }\n for(var v = 0; v < msg.length; v++) {\n if(msg[v] == \"_\" && msg.indexOf(\"://\") == -1) {\n italic = !italic;\n } else if(msg[v] == \"*\") {\n bold = !bold;\n }\n \n\t\t\tif((!(/[^a-zA-Z0-9?!.,\"'/()#:@; ]/.test(msg[v])) || msg.indexOf(\"://\") > -1)) {\n if(bold) {\n if(italic) {\n term.green.bold.italic(msg[v]);\n } else {\n term.green.bold(msg[v]);\n }\n } else if(italic) {\n term.green.italic(msg[v]);\n } else {\n\t\t\t\t\tif(msg[v] != '\\n') {\n \tterm.green(msg[v]);\n\t\t\t\t\t}\n }\n }\n }\n term.green(\"\\n\");\n }\n}", "function appendMessage(sender, title, avatar_url, message, container, classList=null) {\n let displayUl = container.getElementsByTagName(\"ul\")[0];\n let msgClass = (sender==\"user\") ? \"user\" : \"bot\";\n let msg = document.createElement(\"li\");\n let classes = \"\";\n if(classList != null) classes = \" \" + classList.join(\" \");\n msg.setAttribute(\"class\", msgClass);\n msg.innerHTML = `<div class=\"heading\">\n <span>${title}</span>\n </div>\n <div class=\"msg-content${classes}\">\n <img src=\"${avatar_url}\">\n <p>${message}</p>\n </div>`;\n \n displayUl.appendChild(msg);\n updateScroll(container);\n}", "getMessageUI () {\n return (\n <ul ref={this.messageContainer} className=\"message-thread\">\n {\n this.state.conversations.map( (conversation, index) => \n <li className={`${this.alignMessages(conversation.toUserId) ? 'align-right' : ''}`} key={index}> {conversation.message} </li>\n )\n }\n </ul>\n )\n }", "function appendUserMessage(msg: Message, isAuthor: boolean) {\n $('#messages').append($('<li>')\n .append(() => {\n const node = $(isAuthor ? '<div class=\"msg-container author\">' : '<div class=\"msg-container\">');\n if (!isAuthor) node.append($('<p class=\"author-name\">').text(msg.userName));\n node.append($('<p>').text(msg.text))\n .append($('<p class=\"time\">').text(new Date(msg.timeStamp).toLocaleTimeString('it-IT')));\n return node;\n }));\n window.scrollTo(0, document.body.scrollHeight);\n}", "getAllMessages ({ commit }) {\n api.getMessages((messages) => {\n let inbox = messages.filter((message) => message.to.email === user.email && !message.isDeleted)\n let outbox = messages.filter((message) => message.from.email === user.email)\n // let important = messages.filter((message) => message.isImportant)\n let trash = messages.filter((message) => message.isDeleted)\n\n commit('setInbox', inbox)\n commit('setOutbox', outbox)\n // commit('setImportant', important)\n commit('setTrash', trash)\n })\n }", "function selectUserFromList(name, contact_id, id, type){\n var parentUl = $('.user-content').children('ul');\n var users = parentUl.children('li');\n var user = users.get(0);\n\n // Clear message contents..\n $('#messages').html('');\n\n // Set user to select..\n for(var i = 0; i < users.length; i++) {\n user = users.get(i);\n if(user.id == contact_id) {\n user.setAttribute(\"style\", \"background-color: #eee;\");\n selectedIndex = i;\n }\n else {\n user.setAttribute(\"style\", \"\");\n }\n }\n\n disableActionButton();\n\n // Find selected user from the contact list..\n var contactUser = contactList.find(function(oneContactUser) {\n return oneContactUser.contact_id === contact_id;\n });\n\n var img;\n var email;\n if(contactUser == undefined && type == \"SEARCH\") {\n enableActionButton(\"add\");\n email = contact_id;\n }\n else if(contactUser == undefined && type == \"CONTACT\") {\n selectedIndex = -1;\n $('#panel-userinfo').fadeOut(1000);\n infoVisibleFlag = false;\n return;\n }\n else {\n switch (contactUser.state) {\n case \"ADDED\":\n case \"CONTACTED\":\n enableActionButton(\"remove\");\n break;\n case \"INVITED\":\n case \"DECLINED\":\n enableActionButton(\"add\");\n enableActionButton(\"remove\");\n break;\n default:\n case \"REMOVED\":\n enableActionButton(\"add\");\n break;\n }\n email = contactUser.email;\n }\n\n img = getUserImg(type, email);\n\n\n var oneUser = {\n id : id,\n contact_id: contact_id,\n username : name,\n email : email,\n img : img\n };\n\n selectFlag = \"ONE\";\n userSelected = oneUser;\n\n showUserInfo(oneUser);\n\n if(type == \"CONTACT\") {\n curConvId = contactUser.contact_id;\n // Load conversation content of this user..\n var msgObj = {\n type: \"ONE\",\n from: userSelf.email,\n obj_email: contactUser.email,\n contact_id: curConvId\n };\n socket.emit('loadConv', msgObj);\n setMessageBudge(contact_id, 0);\n }\n}", "function Displaychat(name,dnt,usr_msg) {\n var user_name = $('<div class=\"username\">').text(name);\n var date_time = $('<div class=\"timestamp\">').text(dnt);\n var user_msg = $('<div class=\"usermessage\">').text(usr_msg);\n \n $('#messages')\n .append($('<li>')\n .append(user_name)\n .append(date_time)\n .append(user_msg));\n pageScroll();\n}", "function addMessage (message) {\n let message_list = document.querySelector('#messages');\n if (message_list) {\n const message_entry = document.createElement('li');\n message_entry.textContent = `${message.text}`;\n message_list.appendChild(message_entry);\n }\n}", "function _displayMessage(message) {\n const messageElem = $('<li class=\"list-group-item\">')\n .append('<p class=\"message\"><strong>' + message.name + ': </strong>' + message.message + '</p>');\n const allMessagesElem = $('#messages');\n allMessagesElem.append(messageElem);\n allMessagesElem.scrollTop($('#messages').prop(\"scrollHeight\"));\n}", "function getMessages(id) {\n $('ul#messages').html(\"\");\n $.getJSON(\"v1/course/messages/\" + id, function (data) {\n var li = '';\n $.each(data.messages, function (i, data) {\n if(data.image==\"\"){\n li += '<li class=\"others\" style=\"padding-right: 20px;\"><label class=\"name\">' + data.admin.admin_name +\n ':</label><div class=\"message\">' + data.message + '</div><div class=\"clear\"></div></li>';\n }else{\n li += '<li class=\"others\" style=\"padding-right: 20px;\"><label class=\"name\">' + data.admin.admin_name +\n ':</label><mg class=\"message\">' + data.message + '<br><img src=\"images/'+data.image+'\"class=\"imageMessage\"></div><div class=\"clear\"></div></li>';\n }\n });\n $('ul#messages').html(li);\n $('#scrollMsj').scrollTop($('#scrollMsj').prop(\"scrollHeight\"));\n }).done(function () {\n\n }).fail(function () {\n alert('Sorry! Unable to fetch topic messages');\n }).always(function () {\n\n });\n\n // attaching the chatroom id to send button\n $('#send').attr('course_id', id);\n }", "function getMentions (msg) {\n return msg.mentions.users.array()\n}", "function ListMessages(auth) {\n var gmail = google.gmail('v1');\n var query= \"from: notifications@github.com view pull request\";\n nock('https://www.googleapis.com/gmail/v1/users')\n\t.get('/jaga4494/messages').reply(200, {\n\t\tusername: 'davidwalshblog',\n\t\tfirstname: 'David'\n\t});\n return new Promise(function (resolve, reject) \n\t{\n\n gmail.users.messages.list({\n auth: auth,\n userId: 'me',\n q: query,\n }, \n \n function(err, response,body) {\n if (err) {\n console.log('The API returned an error: ' + err);\n return;\n }\n var obj = JSON.parse(body);\n resolve(obj);\n\n /*\n var msgs = response.messages;\n console.log('- %s', msgs);\n if (msgs.length == 0) {\n console.log('No message found.');\n } else {\n console.log('Message:');\n \n \n //console.log('- %s', msgs.messages[1].id);\n \n for (var i = 0; i < msgs.length; i++) {\n var msg = msgs[i];\n console.log('- %s', msg.id);\n }\n \n }*/\n });\n});\n}", "function ListMessages(auth) {\n var gmail = google.gmail('v1');\n var query= \"from: notifications@github.com view pull request\";\n nock('https://www.googleapis.com/gmail/v1/users')\n\t.get('/jaga4494/messages').reply(200, {\n\t\tusername: 'davidwalshblog',\n\t\tfirstname: 'David'\n\t});\n return new Promise(function (resolve, reject) \n\t{\n\n gmail.users.messages.list({\n auth: auth,\n userId: 'me',\n q: query,\n }, \n \n function(err, response,body) {\n if (err) {\n console.log('The API returned an error: ' + err);\n return;\n }\n var obj = JSON.parse(body);\n resolve(obj);\n\n /*\n var msgs = response.messages;\n console.log('- %s', msgs);\n if (msgs.length == 0) {\n console.log('No message found.');\n } else {\n console.log('Message:');\n \n \n //console.log('- %s', msgs.messages[1].id);\n \n for (var i = 0; i < msgs.length; i++) {\n var msg = msgs[i];\n console.log('- %s', msg.id);\n }\n \n }*/\n });\n});\n}", "function appendMessageOnRight(usermsg) {\n if(usermsg.img){\n $(\"#msgs\").append(`<li class=\"my-chattinglist\"><span class=\"chattingbox\"><img src=\"${usermsg.img}\" class=\"chat-upload-img\"></img></span></li>`);\n }else{\n let msg = usermsg.val();\n $(\"#msgs\").append(`<li class=\"my-chattinglist\"><span class=\"chattingbox\">${msg}</span></li>`);\n }\n $(\"#msgcontainer\").scrollTop($(\"#msgcontainer\")[0].scrollHeight);\n}", "function addMessages(messages) {\n for (let m of messages) {\n let displayPerson = m.messageSender\n \n for (let c of contactList) {\n if (m.messageSender === c.phoneNum) {\n displayPerson = c.name;\n }\n }\n \n if (typeof m.messageContent != \"string\") {\n console.log(\"invalid message\");\n }\n displayHtml += '<span id=\"message\" style=\"bottom:' + m.displayNumber + '%;\">' +\n displayPerson + ': ' + m.messageContent + '</span>';\n }\n \n document.getElementById(\"message-display\").innerHTML = displayHtml;\n}", "function addMessage(data) {\n\n\t\t\tif(data.dest) {\n\n\t\t\t\tvar $username1 = $('<span class=\"user1\"/>')\n\t\t\t\t.text(data.user)\n\t\t\t\t.css('color', getUsernameColor(data.user));\n\t\t\t\t\n\t\t\t\tvar $whisper = $('<span class=\"whisper\"/>')\n\t\t\t\t.text(' ⇒ ')\n\t\t\t\t.css('color', '#000000');\n\t\t\t\t\n\t\t\t\tvar $username2 = $('<span class=\"user2\"/>')\n\t\t\t\t.text(data.dest)\n\t\t\t\t.css('color', getUsernameColor(data.dest));\n\t\t\t\t\n\t\t\t\tvar $usernameDiv = $('<span class=\"username\"/>')\n\t\t\t\t.append($username1, $whisper, $username2);\n\t\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvar $usernameDiv = $('<span class=\"username\"/>')\n\t\t\t\t.text(data.user)\n\t\t\t\t.css('color', getUsernameColor(data.user));\n\t\t\t}\n\t\t\t\n\t\t\tvar $messageBodyDiv = $('<span class=\"messageBody\">')\n\t\t\t\t.text(data.message);\n\t\t\t\t\n\t\t\tvar $moodDiv = $('<img src=\"img/'+ mood +'.png\" alt=\"'+mood+'\" class=\"moodEmote\" title=\"'+mood+'\" />');\n\t\t\t\t\n\t\t\tvar $timeStampDiv = $('<span class=\"timeStamp\">')\n\t\t\t\t.text(data.date);\n\n\t\t\tvar $imgDiv=$('<img src=\"'+ getImg(data.user) +'\" alt=\"\" class=\"img\" id=\"avatar\" height=\"42\" width=\"42\"/>');\n\n\t\t\tvar $messageDiv = $('<li class=\"message\"/>')\n\t\t\t\t.data('username', data.user)\n\t\t\t\t.append($imgDiv,$usernameDiv, $messageBodyDiv, $timeStampDiv, $moodDiv);\n\n\t\t\taddMessageElement($messageDiv);\n\t\t}", "function addUserMessage(message) {\n var newUserMessage = document.createElement(\"P\");\n newUserMessage.setAttribute('class', 'message user_message');\n var messageTextNodeUser = document.createTextNode(message);\n newUserMessage.appendChild(messageTextNodeUser);\n document.getElementById(\"messages\").appendChild(newUserMessage);\n}", "function getHistoryMsg(roomUser) {\n let allMsg = null;\n\n listRooms.forEach( (room) => {\n if(roomUser === room.name){\n allMsg = room.msg;\n return false;\n }\n });\n\n return allMsg;\n}", "drawMessage({\n user: u,\n timestamp: t,\n message: m\n }) {\n let $messageRow = $(\"<li>\", {\n \"class\": \"message-row\"\n });\n //extra styling for messages sent from self\n if (this.username === u) {\n $messageRow.addClass(\"me\");\n }\n //generates the message\n let $message = $(\"<p>\");\n\n $message.append($(\"<span>\", {\n \"class\": \"message-username\",\n text: u\n }));\n\n $message.append($(\"<span>\", {\n \"class\": \"timestamp\",\n \"data-time\": t,\n //text: (new Date(t)).getTime()\n text: moment(t).fromNow() //utilizes moment to set the timestamp\n }));\n\n $message.append($(\"<span>\", {\n \"class\": \"message-message\",\n text: m\n }));\n\n let $img = $(\"<img>\", {\n src: createGravatarUrl(u),\n title: u\n });\n //loads the message and scrolls it into view\n $messageRow.append($img);\n $messageRow.append($message);\n this.$list.append($messageRow);\n $messageRow.get(0).scrollIntoView();\n }", "function listenForMsg(user){\n document.getElementById(\"message_contents\").innerHTML = \"\";\n database.ref('/'+user.uid+'/friends/'+profileId).once(\"value\").then((snapshot) => {\n var chatid = snapshot.child('chatid').val();\n\n database.ref('/messages/'+chatid).on('child_added', function (snapshot){\n var sender = snapshot.val().sender\n if(sender === user.uid && snapshot.key !== \"last\" && snapshot.key !== \"time\"){\n var html = \"\"\n html = `\n <div class=\"you\">\n <div class=\"your-chat-content\">\n ${snapshot.val().msg}<span>${snapshot.val().time}</span>\n </div>\n </div>\n `\n }else if(sender === profileId && snapshot.key !== \"last\" && snapshot.key !== \"time\"){\n var html = \"\"\n html = `\n <div class=\"friend\">\n <div class=\"chat-content\">\n ${snapshot.val().msg}<span>${snapshot.val().time}</span>\n </div>\n </div>\n `\n }else if(snapshot.key === \"last\" || snapshot.key === \"time\"){\n html = \"\"\n }\n document.getElementById(\"message_contents\").innerHTML += html;\n var element = document.getElementById(\"message_contents\");\n element.scrollTop = element.scrollHeight;\n })\n })\n}", "async function liste() {\n const bilan = await Present.findAll({\n where: {\n Classe: \"lp-fi\"\n }\n });\n //console.log(date);\n //var nom;\n const abs = await Absent.findAll({\n where: {\n Classe: \"lp-fi\"\n }\n });\n\n const exampleEmbed = new MessageEmbed()\n .setColor('#4C1B1B')\n .setTitle(\"La liste des appels d'aujourd'hui \")\n .setTimestamp(message.createdAt)\n /*bilan.forEach((eleve) => {\n console.log(eleve.NomEleve);\n nom = eleve.NomEleve;\n exampleEmbed.addField(\n `${eleve.filter(el => el === eleve.toLowerCase()).map(elv => elv.NomEleve).join(', ')}`\n )\n });*/\n exampleEmbed.addField(\n `voici la liste des élèves présent :`,\n `${bilan.map(elv => elv.NomEleve).join(', \\n')}`\n );\n\n exampleEmbed.addField(\n `voici la liste des élèves absent :`,\n `${abs.map(elv => elv.NomEleve).join(', \\n')}`\n );\n message.channel.send(exampleEmbed)\n }", "function appendChatMessage(message) {\n\n if (myGroups.indexOf(message.receiver) < 0) {\n // this is for one-one chat\n if (message.receiver == myUser.id && message.sender == myFriend.id) {\n playNewMessageAudio();\n \n var cssClass = (message.sender == myUser.id) ? 'chatMessageRight col-8 my-message d-flex' : 'chatMessageLeft col-8 my-friend-message d-flex flex-row-reverse ml-auto';\n $('#messages').append('<div class=\"' + cssClass + '\">' + message.text + '</div>');\n } else {\n playNewMessageNotificationAudio();\n updateChatNotificationCount(message.sender);\n }\n if (allChatMessages[message.sender] != undefined) {\n allChatMessages[message.sender].push(message);\n } else {\n allChatMessages[message.sender] = new Array(message);\n }\n } else {\n\n // this is for group chat\n if (message.sender != myUser.id) {\n message.text = message.senderName + ': ' + message.text;\n if (message.receiver == myFriend.id) {\n playNewMessageAudio();\n\n var cssClass = (message.sender == myUser.id) ? 'chatMessageRight col-8 my-message d-flex' : 'chatMessageLeft col-8 my-friend-message d-flex flex-row-reverse ml-auto';\n $('#messages').append('<div class=\"' + cssClass + '\">' + message.text + '</div>');\n } else {\n playNewMessageNotificationAudio();\n updateChatNotificationCount(message.receiver);\n }\n if (allChatMessages[message.receiver] != undefined) {\n allChatMessages[message.receiver].push(message);\n } else {\n allChatMessages[message.receiver] = new Array(message);\n }\n }\n\n }\n\n}", "async execute(msg, args, discord, rMsg) {\n let serverRoles = rMsg.slice(0);\n serverRoles = serverRoles.filter(e => e.guildID == msg.guild.id)\n\n\n let embed = new discord.MessageEmbed()\n .setTitle(\"Lista dei tavoli attualmente aperti\")\n\n if (serverRoles.length <= 0)\n embed.setDescription('Non ci sono tavoli aperti')\n\n for (let e of serverRoles) {\n let curChat = msg.guild.channels.cache.get(e.channelID)\n let curMsg = await curChat.messages.fetch(e.msgID);\n let curPlayerCount = curMsg.reactions.cache.get(\"✔\").count - 1\n\n if (curPlayerCount == Number(e.capMem) - 1)\n embed.addField(e.roleName, `Creato da ${e.authorName}\\nTavolo Pieno`)\n else\n embed.addField(e.roleName, `Creato da ${e.authorName}\\n${curPlayerCount}/${Number(e.capMem) - 1} posti prenotati`)\n }\n\n msg.channel.send(embed)\n }", "function getMessages() {\n $.get('http://localhost:3000/messages', (data) => {\n data.forEach(addMessage);\n })\n}", "list(roomId) {\n Message.findAll({\n where: {\n id: roomId\n }\n }).then((messages) => messages.map((message) => this.socket.emit(message)))\n .catch((error) => console.log('Getting message list failed', error));\n }", "hasUser(msg) {\n let indexOfUser = this.list.findIndex(user => user.id === msg.author.id);\n return indexOfUser !== -1;\n }", "function fetchMessages() {\n let url = '/messages?user=' + parameterUsername;\n\n const parameterLanguage = defaultLanguage;\n if (parameterLanguage) {\n url += '&language=' + parameterLanguage;\n }\n\n console.log(url);\n\n fetch(url)\n .then((response) => {\n return response.json();\n })\n .then((messages) => {\n const messagesContainer = document.getElementById('message-container');\n if (messages.length == 0) {\n messagesContainer.innerHTML = '<p>This user has no posts yet.</p>';\n } else {\n messagesContainer.innerHTML = '';\n }\n\n\n var count = 0;\n\n messages.forEach((message) => {\n const messageDiv = buildMessageDiv(message);\n\n if (count !== maxMessages) {\n \tcount++;\n } else {\n \tmessageDiv.hidden = true;\n }\n\n messagesContainer.appendChild(messageDiv);\n });\n\n });\n}", "function GetMessages(req, res){\n Message.find({}).exec((err, result) => {\n res.send(result);\n })\n}", "printMessages() {\n\n let style = {\n color: \"black\",\n fontSize: \"12px\",\n paddingBottom: \"5px\"\n };\n\n return this.state.messages.map((msg, i) => {\n return (\n <div key={i} style={style}>\n <b>{msg.user}: </b>{msg.message}\n </div>\n\n );\n });\n\n }", "function adminMessages(user, messages){\n\tif(user.role === ROLE.ADMIN || user.role === ROLE.MODERATOR){\n\t\treturn messages;\n\t} else {\n\t\tres.status(403).json('Forbidden');\n\t};\n}", "function getMessage(filterUser){\n return new Promise((resolve,reject)=>{\n resolve(store.list(filterUser))\n })\n}", "function receive_messages() {\n\n\tvar current_admin = 0;\n\tvar current_guest = 0;\n\t\n\t$.ajax({\n\t\ttype: \"GET\",\n\t\tcache: false,\n\t\tdataType: \"json\",\n\t\turl: sts_base_url + \"/simple/livechat_receive/\",\n\t\tsuccess: function(data){\n\t\t\tif (data !== null) {\n\t\t\t\tif (data.success) {\n\t\t\t\t\tif (data.messages.length > 0) {\n\t\t\t\t\n\t\t\t\t\t\t//html = '<ul>';\n\t\t\t\t\t\thtml = '';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$.each(\n\t\t\t\t\t\t\tdata.messages,\n\t\t\t\t\t\t\tfunction (index, value) {\n\t\t\t\t\t\t\t\tif (value.guest == 1) {\n\t\t\t\t\t\t\t\t\tcurrent_guest++;\n\t\t\t\t\t\t\t\t\thtml += '<p>' + nl2br($('<div/>').text(value.message).html()) + ' <br /><div class=\"message-name\">' + $('<div/>').text(value.name).html() + ' - ' + $('<div/>').text(value.time_ago).html() + '</div><div class=\"clearfix\"></div><hr /></p>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tcurrent_admin++;\n\t\t\t\t\t\t\t\t\thtml += '<p>' + nl2br($('<div/>').text(value.message).html()) + ' <br /><div class=\"message-name\">' + $('<div/>').text(value.user_name).html() + ' - ' + $('<div/>').text(value.time_ago).html() + '</div><div class=\"clearfix\"></div><hr /></p>';\t\t\t\t\t\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\t\t\n\t\t\t\t\t\t//html += '</ul>';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$('#lcs_receive').html(html);\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (data.messages.length > lcs_current_messages) {\n\t\t\t\t\t\t\t$('#lcs_receive').scrollTop($('#lcs_receive').prop(\"scrollHeight\"));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (current_admin > lcs_current_admin_messages) {\n\t\t\t\t\t\t\tvar audio = new Audio(sts_base_url + '/user/plugins/livechat/audio/alert1.wav');\n\t\t\t\t\t\t\taudio.play();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tlcs_current_messages = data.messages.length;\n\t\t\t\t\t\tlcs_current_admin_messages = current_admin;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\thtml = '<p>No Messages<hr /></p>';\n\n\t\t\t\t\t\t$('#lcs_receive').html(html);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$('#lcs_receive').html(data.message);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\t \n\tsetTimeout(function() {\n\t\treceive_messages()\n\t}, 3000);\n}", "function selectUerChatBox(element, userId, userName) {\n console.log(\"Duy dsadashdsd\" + element);\n myFriend.id = userId;\n myFriend.name = userName;\n $('#box').show();\n $('#messages').show();\n $('#onlineUsers div').removeClass('active');\n\n $('#onlineGroups div').removeClass('active');\n\n $(element).addClass('active');\n $('#notifyTyping').text('');\n $('#m').val('').focus();\n // Reset chat message count to 0\n clearChatNotificationCount(userId);\n // load all chat message for selected user \n $('#messages').html('');\n\n socket.emit(\"loadPreviousMess\", {\n sender: myUser.name,\n receiver: myFriend.name\n })\n}", "function updateChat(msg) {\n\tvar data = JSON.parse(msg.data);\n insert(\"chat\", data.userMessage);\n id(\"userlist\").innerHTML = \"\";\n data.userlist.forEach(function (user) {\n \tinsert(\"userlist\", \"<li>\" + user + \"</li>\");\n });\n id(\"channellist\").innerHTML = \"\";\n insert(\"channellist\", \"<button id=\\\"btn\\\">new</button>\");\n data.chlist.forEach(function (channel) {\n \tinsert(\"channellist\", \"<li id=\\\"\"+ channel +\"\\\">\" + channel + \"</li>\");\n });\n document.getElementById(\"channellist\").addEventListener(\"click\",function(e) {\n connectToChannel(e);\n });\n}", "function Message() {\n const res = axios.post(`https://api.woofics.com/api/message`, {\n from_user: id,\n to_user: uid,\n message: sentmsg,\n name: name\n },{\n headers:{ Authorization: `Bearer ${localStorage.getItem(\"user_token\")}` }\n })\n .then((response) => {\n function Users() {\n const { data: response } = axios.post(`https://api.woofics.com/api/history`, {\n from_user: id,\n to_user: uid\n },{\n headers:{ Authorization: `Bearer ${localStorage.getItem(\"user_token\")}` }\n })\n .then((response) => {\n if (response) {\n \n setMsg(response.data)\n setRight(response.data.from_user)\n SendData()\n // divRef.current.scrollIntoView({ behavior: 'smooth' });\n scrollToBottom();\n\n }\n }, (Error) => {\n // \n })\n }\n Users()\n setsentMsg('')\n }, (Error) => {\n // \n });\n }" ]
[ "0.6978265", "0.6966728", "0.69108284", "0.6882009", "0.6752527", "0.6717182", "0.671635", "0.66754943", "0.6660735", "0.66254634", "0.6580257", "0.6571969", "0.6571284", "0.6486938", "0.64795035", "0.64167166", "0.6413631", "0.64014405", "0.63722277", "0.6367521", "0.6307415", "0.6306974", "0.630427", "0.6288855", "0.6286646", "0.62773764", "0.62731355", "0.6264763", "0.6262563", "0.6232828", "0.6228522", "0.62230825", "0.62032014", "0.6203183", "0.6183594", "0.6176819", "0.617248", "0.6172425", "0.61689925", "0.6164252", "0.6163258", "0.6160395", "0.6156811", "0.6156784", "0.61525923", "0.6147584", "0.6146475", "0.6118846", "0.6105009", "0.6100434", "0.6097019", "0.6090982", "0.6072288", "0.60721165", "0.60563046", "0.6055305", "0.60532176", "0.60482264", "0.60459167", "0.60381246", "0.6036147", "0.6033701", "0.6032656", "0.6030661", "0.603005", "0.60208815", "0.60154444", "0.6013291", "0.60065836", "0.6002462", "0.5988876", "0.59850013", "0.5982728", "0.5979786", "0.59788686", "0.5972392", "0.59605944", "0.5959035", "0.5959035", "0.5950181", "0.5944805", "0.59395003", "0.593889", "0.59330666", "0.59291375", "0.59188056", "0.5911767", "0.5902201", "0.5900535", "0.5898344", "0.5895345", "0.58949286", "0.5886177", "0.58860093", "0.58850634", "0.58837956", "0.5878931", "0.58757746", "0.5875702", "0.5873522", "0.5872755" ]
0.0
-1
Fonction de connection au t'chat du nouvel utilisateur
function userConnect() { $.ajax({ // On définit l'URL appelée url: 'http://localhost/tchat/API/index.php', // On définit la méthode HTTP type: 'GET', // On définit les données qui seront envoyées data: { action: 'userAdd', userNickname: $('#userNickname').val() }, // l'équivalent d'un "case" avec les codes de statut HTTP statusCode: { // Si l'utilisateur est bien créé 201: function (response) { //console.log("Si l'utilisateur est bien créé"); console.log(response); // On stocke l'identifiant récupéré dans la variable globale userId window.userId = response; // On masque la fenêtre, puis on rafraichit la liste de utilisateurs //(a faire...) $('#connexion').css("display","none"); usersListRefresh(); }, // Si l'utilisateur existe déjà 208: function (response) { console.log("Si l'utilisateur existe déjà"); // On fait bouger la fenêtre de gauche à droite // et de droite à gauche 3 fois // (à faire...) $("#login").animate({marginLeft:'1rem'},30) .animate({marginLeft:'-1rem'},30) .animate({marginLeft:'1rem'},30) .animate({marginLeft:'-1rem'},30) .animate({marginLeft:'1rem'},30) } } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showChat(username) {\r\n\tsocket.emit('newChatter', username);\r\n}", "function connect() {\n console.log(sock);\n\n var user = document.getElementById(\"pseudo\").value.trim();\n if (! user) return;\n document.getElementById(\"radio2\").check = true;\n id = user;\n sock.emit(\"login\", user);\n }", "connectUser (theme, user, roomId) {\n this.socket.emit('connectUser', {theme, user, roomId})\n }", "joindreGroupe(socket,channel,username){\n $(\"#listDesMessages\").empty();\n $(\"#msgBox\").focus();\n var msg = new Message(\"onJoinChannel\", channel.id , null , username, null );\n socket.send(JSON.stringify(msg));\n document.getElementById(\"current_group_name\").innerHTML = channel.name;\n }", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"Conectado...\");\n\t\n client.subscribe(\"jeffersson.pino@gmail.com/WEB\");\n\n\t\n }", "function connect(c) {\n \n var globalChat = $('#global_chat');\n\n if(c.label === 'loadRoom') {\n\n if ( peerReconnecting ){\n // do nothing\n } else {\n setTimeout(function(){\n c.send([sessionMessages,sessionTorrents]);\n },4000)\n c.on('data', function(data){\n\n if ( isRoomLoaded ){\n //\n } else {\n sessionMessages= data[0]\n newDataNotification('chat','#textChat','chatNotification',sessionMessages.length);\n sessionMessages.forEach(function(message,index){\n globalChat.append('<div><span class=\"peer\" style=\"color:'+message['color']+'\">' + message['peer'] + '</span>: ' + message['message'] + '</div>');\n globalChat.scrollTop(globalChat.prop(\"scrollHeight\"));\n });\n isRoomLoaded = true;\n }\n\n var torrentList = data[1]\n\n if ( torrentList.length > 0 ){ \n\n }\n\n torrentList.forEach(function(torrent,index){\n var torrentValid = true\n torrentValidation.forEach(function(validInfoHash,index){\n if(validInfoHash==torrent[\"infoHash\"]){\n torrentValid = false;\n }\n })\n if(torrentValid == true){\n newDataNotification(c.label,'#downloads','torrentNotification',torrentNotification);\n torrentValidation.push(torrent[\"infoHash\"]);\n loadPushedTorrents(torrent[\"infoHash\"],torrent[\"name\"],torrent[\"length\"],torrent[\"size\"],torrent[\"fileList\"],c.peer)\n }\n });\n });\n }\n // Handle a chat connection.\n } else if (c.label === 'chat') {\n \n var chatbox = $('<div class=\"peerUsername\"></div>').addClass('connection').addClass('active').attr('id', c.peer);\n var header = $('<div></div>').html(c.peer).appendTo(chatbox);\n var messages = $('<div><em>'+c.peer+' connected.</em></div>').addClass('messages');\n \n chatbox.append(header);\n globalChat.append(messages);\n\n $('.filler').hide();\n $('#chat_user_list').append(chatbox);\n\n // Append message to chat\n c.on('data', function(data) {\n newDataNotification('chat','#textChat','chatNotification',chatNotification);\n globalChat.append('<div><span class=\"peer\" style=\"color:'+data[1]+'\">' + c.peer + '</span>: ' + data[0] +\n '</div>');\n globalChat.scrollTop(globalChat.prop(\"scrollHeight\"));\n\n var messageObject = { \"peer\": c.peer, \"message\": data[0], \"color\": data[1] }\n sessionMessages.push(messageObject);\n });\n\n // Fade peer out on close and destroy users torrents\n c.on('close', function() {\n $('#' + c.peer + 'mouse').fadeOut(1000, function() {\n $(this).remove();\n });\n chatbox.remove();\n if ($('.connection').length === 0) {\n $('.filler').show();\n }\n userNotification = userNotification - 2;\n newDataNotification('user','#userList','userNotification',userNotification);\n var messages = $('<div><em>'+c.peer+' disconnected.</em></div>').addClass('messages');\n globalChat.append(messages);\n // remove disconnecting users torrents\n if ( peerReconnecting ){\n // do nothing\n } else {\n /* $('.'+c.peer+'torrentz').remove();*/\n }\n\n // $.ajax({\n // type: 'delete',\n // url: 'http://allthetime.io/rtos/rooms?userName=' + c.peer,\n // async: false\n // }); \n //delete peer.connections[c.peer]\n //delete connectedPeers[c.peer];\n });\n\n // when info hash is received! \n } else if (c.label === 'torrentz') {\n\n c.on('data', function(data) {\n newDataNotification(c.label,'#downloads','torrentNotification',torrentNotification);\n loadPushedTorrents(data[0],data[1],data[2],data[3],data[4],c.peer);\n });\n\n // Send mouse position of moving mouse to user\n } else if (c.label === 'mouse') {\n newDataNotification('user','#userList','userNotification',userNotification);\n $('<div id=\"' + c.peer + 'mouse\" class=\"mouse\">').appendTo('body');\n \n c.on('data', function(data) {\n var id = '#' + c.peer + 'mouse';\n $(id).css({\n \"top\": data[1] + \"px\",\n \"left\": data[0] + \"px\"\n });\n });\n\n // Start Video \n } else if (c.label === \"videoFeed\") {\n c.on('data', function(data) {\n if(data != \"close\"){\n var call = peer.call(data, mediaStream);\n console.log(\"here comes some video\");\n } else{\n $('#v' + c.peer + 'cam').detach();\n } \n });\n }\n connectedPeers[c.peer] = 1;\n }", "openConnection() {\n\n this.socket = io()\n\n this.socket.on('Welcome', data => {\n this.username = data.username\n this.avatar = data.avatar\n })\n\n this.socket.on('chatMessageFromServer', (data) => { // arrow function keeps \"this.\" from changing \n\n // alert(data.message) // debug +++\n\n this.displayMessageFromServer(data)\n\n })\n\n }", "function userConnect()\n {\n $.ajax({\n // On définit l'URL appelée\n url: 'http://localhost/tchat/API/index.php',\n // On définit la méthode HTTP\n type: 'GET',\n // On définit les données qui seront envoyées\n data: {\n action: 'userAdd',\n userNickname: $('#userNickname').val()\n },\n // l'équivalent d'un \"case\" avec les codes de statut HTTP\n statusCode: {\n // Si l'utilisateur est bien créé\n 201: function (response) {\n // On stocke l'identifiant récupéré dans la variable globale userId\n window.userId = response.userId;\n // On masque la fenêtre, puis on rafraichit la liste de utilisateurs\n // (à faire...)\n },\n // Si l'utilisateur existe déjà\n 208: function (response) {\n // On fait bouger la fenêtre de gauche à droite\n // et de droite à gauche 3 fois\n // (à faire...)\n }\n }\n })\n }", "function newConnection(socket) {\n // Log the socket id\n console.log('New connection: ' + socket.id);\n\n // Emit to all other clients except user.\n socket.on('CONNECT_USER', function (userProfile) {\n // For every user add userProfile to object\n connectedUsers[socket.id] = userProfile;\n socket.broadcast.emit('CONNECT_USER', {\n // Send the user profile and socket id to client\n userProfile: userProfile,\n id: socket.id\n });\n });\n\n // When textArea received from client\n socket.on('textArea', sendTextarea);\n\n // When searchField received from client\n socket.on('searchField', sendSearchfield);\n\n // Send searchfield message to all clients\n function sendSearchfield(field) {\n // Api request to Youtube send it to all clients\n io.emit('NEW_VIDEO',\n // EncodeURI Make sure spaces work\n `${(field)}`);\n }\n\n // Send textarea message to all clients\n function sendTextarea(text) {\n io.sockets.emit('textArea', text);\n }\n\n // Client disconnect\n socket.on('disconnect', function () {\n console.log('User disconnected: ' + socket.id);\n // Broadcast to all other clients. Delete the socket.id from the connecter\n socket.broadcast.emit('DISCONNECT_USER', socket.id);\n // Delete the property\n delete connectedUsers[socket.id];\n });\n\n // When video playing received from client\n socket.on('videoPlay', sendPlaying);\n // Send to all client except self\n function sendPlaying() {\n socket.broadcast.emit('videoPlay', true);\n }\n\n // When video pause received from client\n socket.on('videoPause', sendPause);\n // Send to all client except self\n function sendPause() {\n socket.broadcast.emit('videoPause', true);\n }\n}", "function newClientConnect(data) {\n\tshowNewMessage(\"notification\", {msg: '<b> ~ '+data.username+' joined the chatroom. ~</b>'});\n\tMaterialize.toast(data.username+' joined the chatroom.', 2000);\n\taddUserToList(data);\n}", "function connect(c) {\n // Handle a chat connection.\n if (c.label === 'chat') {\n var username = \"\";\n var userid = c.peer;\n // Added to test dropping conn issue\n if(c.peer === null || c.peer === '') {\n c.close();\n return;\n }\n // Added to test dropping conn issue\n var chatBox = null;\n var chatBoxDiv = null;\n var messageBox = null;\n connectedPeers[userid] = 1;\n\n Meteor.call('getUsrDtls', userid,\n function(error, result) {\n if(error != null) {\n console.log(\"Error while getting user details - \" + error.reason)\n } else {\n username = result.profile.name;\n var now = new Date();\n $(\"#activeChats\").prepend('<div id=\"cb_' + userid + '\"><button class=\"pure-button '\n + chatBoxColorClasses[i % 3] + ' full-width\" onclick=\"return showHide(\\'chatBoxDiv_' + userid +'\\');\">'\n + username + '</button><div id=\"chatBoxDiv_' + userid\n + '\" data-chatwith=\"' + userid + '\" style=\"display: none;\" class=\"chatBoxDiv\">'\n + '<div id=\"msgBox_' + userid + '\" class=\"msgListBox\"><em><small> Chat started at ' + formatDate(now) +'.</small></em></div>'\n // + '<form class=\"pure-form\" id=\"chatForm_' + userid + '\">'\n + '<input type=\"text\" class=\"pure-input msgInput full-width\" placeholder=\"Type Your Message\" id=\"chatBox_'\n + userid + '\" /></div></div>');\n i++;\n $(\"#olUsersList\").slideUp();\n $(document).on('keyup', '.msgInput', function(e) {\n var keyCode = (e.keyCode? e.keyCode: e.which);\n if (keyCode == '13') {\n e.preventDefault();\n var pid = ('' + this.id).split('_')[1];\n var msg = $(\"#chatBox_\" + pid).val();\n c.send(\"<p><strong>\" + peername +\":</strong> \" + msg + \"</p>\");\n messageBox.append(\"<p><strong>You:</strong> \" + msg + \"</p>\");\n messageBox.emoticonize();\n messageBox.scrollTop(messageBox[0].scrollHeight);\n $(\"#chatBox_\" + pid).val(\"\");\n return false;\n }\n });\n\n chatBox = $(\"#cb_\" + userid);\n chatBoxDiv = $(\"#chatBoxDiv_\" + userid);\n messageBox = $(\"#msgBox_\" + userid);\n chatBoxDiv.slideDown();\n }\n });\n \n c.on('data', function(data) {\n messageBox.append(data);\n messageBox.emoticonize();\n messageBox.scrollTop(messageBox[0].scrollHeight);\n chatBoxDiv.slideDown();\n document.getElementById(\"messagetone\").play();\n });\n c.on('close', function() {\n if(!clickedSignout) {\n alert(username + ' has left the chat.');\n } else {\n // reset the value\n clickedSignout = 0;\n }\n chatBox.remove();\n delete connectedPeers[c.peer];\n });\n }\n}", "connect()\n {\n //disconect before\n if(this.client !== null )\n {\n this.client.disconnect();\n this.client = null;\n }\n if(this.socket !== null)\n {\n this.socket.close();\n this.socket = null;\n }\n\n //conenct to the websocket server\n this.socket = new SockJS(\"http://localhost:8080/EZStomp/\");\n this.client = Stomp.Stomp.over(this.socket);\n\n let headers = \n {\n login:this.state.currentUser,\n \"user-name\":this.state.currentUser\n }\n \n this.client.connect(headers,(frame)=>{\n\n //subscribe the client to the specific conversation with the other user\n //the other user will also be subscribed to this conversation if he opens the same conversation\n this.client.subscribe('/secured/user/queue/loan-room/'+this.props.conversation.id, (content) =>\n {\n //each time a message is send we must display it in the conversation\n this.showMessageOutput(JSON.parse(content.body))\n })\n })\n }", "establishSocketConnection(userId) {\n console.log(`ESTABLISHING SOCKET CONNECTION TO ${userId}`);\n try {\n this.socket = io(chatSocketUrl, {\n path: pathChatSocket,\n query: `userId=${userId}`,\n });\n } catch (error) {\n alert(\"cant connect to socket server\");\n }\n }", "function connect() {\n var serverUrl;\n var scheme = \"ws\";\n\n // If this is an HTTPS connection, we have to use a secure WebSocket\n // connection too, so add another \"s\" to the scheme.\n\n if (document.location.protocol === \"https:\") {\n scheme += \"s\";\n }\n serverUrl = scheme + \"://\" + myHostname + \":6503\";\n\n log(`Connecting to server: ${serverUrl}`);\n connection = new WebSocket(serverUrl, \"json\");\n\n connection.onopen = function(evt) {\n document.getElementById(\"text\").disabled = false;\n document.getElementById(\"send\").disabled = false;\n };\n\n connection.onerror = function(evt) {\n console.dir(evt);\n }\n\n connection.onmessage = function(evt) {\n var chatBox = document.querySelector(\".chatbox\");\n var text = \"\";\n var msg = JSON.parse(evt.data);\n log(\"Message received: \");\n console.dir(msg);\n var time = new Date(msg.date);\n var timeStr = time.toLocaleTimeString();\n\n switch(msg.type) {\n case \"id\":\n clientID = msg.id;\n setUsername();\n break;\n\n case \"username\":\n text = \"<b>User <em>\" + msg.name + \"</em> signed in at \" + timeStr + \"</b><br>\";\n break;\n\n case \"message\":\n text = \"(\" + timeStr + \") <b>\" + msg.name + \"</b>: \" + msg.text + \"<br>\";\n break;\n\n case \"rejectusername\":\n myUsername = msg.name;\n text = \"<b>Your username has been set to <em>\" + myUsername +\n \"</em> because the name you chose is in use.</b><br>\";\n break;\n\n case \"userlist\": // Received an updated user list\n handleUserlistMsg(msg);\n break;\n\n // Signaling messages: these messages are used to trade WebRTC\n // signaling information during negotiations leading up to a video\n // call.\n\n case \"video-offer\": // Invitation and offer to chat\n handleVideoOfferMsg(msg);\n break;\n\n case \"video-answer\": // Callee has answered our offer\n handleVideoAnswerMsg(msg);\n break;\n\n case \"new-ice-candidate\": // A new ICE candidate has been received\n handleNewICECandidateMsg(msg);\n break;\n\n case \"hang-up\": // The other peer has hung up the call\n handleHangUpMsg(msg);\n break;\n\n // Unknown message; output to console for debugging.\n\n default:\n log_error(\"Unknown message received:\");\n log_error(msg);\n }\n\n // If there's text to insert into the chat buffer, do so now, then\n // scroll the chat panel so that the new text is visible.\n\n if (text.length) {\n chatBox.innerHTML += text;\n chatBox.scrollTop = chatBox.scrollHeight - chatBox.clientHeight;\n }\n };\n}", "function connect() {\n pubnubChat.history({\n channel: channel,\n limit: 50,\n callback: function(msgs) {\n if (msgs.length > 1) {\n pubnubChat.each(msgs[0], appendMessageToChat);\n }\n },\n });\n }", "connectionHandler(){\n let self= this; //since this will be changed on on('connect')\n\n\n // handling the event- 'connect', which checks if the connection has been established by server or not (connection established at config-> chat_sockets.js)\n this.socket.on('connect',function(){\n console.log('Connection established using Sockets..!');\n\n //CHAT-ROOM\n //EMIT\n //emiting an event named 'join_room' to the server\n // used by the user to join a chat-room\n self.socket.emit('join_room',{\n user_email: self.userEmail,\n chatroom:'codeial' \n });\n\n //RECEIVE\n //Receiving the notification/event from server when any user has joined the Chat-room\n self.socket.on('user_joined',function(data){\n console.log('User joined',data);\n });\n });\n\n //SENDING MESSAGE\n // CHANGE :: send a message on clicking the send message button\n $('#send-message').click(function(){\n let msg = $('#chat-message-input').val(); // val() to get the content of msg sent\n\n if (msg != ''){\n //EMIT\n self.socket.emit('send_message', {\n message: msg, // message contains the msg sent\n user_email: self.userEmail,\n chatroom: 'codeial'\n });\n }\n });\n\n //RECEIVE MSG\n self.socket.on('receive_message',function(data){\n console.log('message received',data.message);\n\n let newMessage= $('<li>'); // creating a list-item\n\n let messageType = 'other-message'; // setting it to a classname in chat_box.scss\n\n // to check if the same user receives the msg, then chng messageType to self-message(another class)\n //These classes r used to set the alignment of msgs differently for the dending nd receiving user,ie., left aligned and right aligned\n if(data.user_email == self.userEmail){\n messageType= 'self-message';\n }\n\n // appending span element to list item \n newMessage.append($('<span>',{\n 'html':data.message // setting the content\n }));\n\n newMessage.append($('<sub>',{\n 'html':data.user_email\n }));\n\n newMessage.addClass(messageType); // adding the class\n\n $('#chat-messages-list').append(newMessage); // Append the 'newMessage' list to the \n //unordered list 'chat-messages-list' in _chat_box.ejs in views\n\n });\n\n }", "servermsg_private(text){\n console.log(`User msg for ${this.username}: ${text}`);\n this.socket.emit('chat:message', {username: '<system private>', text});\n }", "function onConnect() {\r\n // Once a connection has been made, make a subscription and send a message.\r\n console.log(\"Conectado...\");\r\n client.subscribe(\"licha_05reyes@outlook.com/IoT\");\r\n enviarInfo(\"00:00/00:00/0/0/0/0\")\r\n \r\n}", "connect() {\n communicator.sendMessage('connected');\n }", "startApp () {\n this.ws = new window.WebSocket('ws://vhost3.lnu.se:20080/socket/')\n document.getElementById(`close${this.count}`).addEventListener('click', this.closeChat.bind(this), { once: true })\n document.getElementById(`minimize${this.count}`).addEventListener('click', this.minimizeChat.bind(this))\n document.getElementById(`userMessage${this.count}`).addEventListener('keydown', this.sendMessage.bind(this))\n document.getElementById(`userMessage${this.count}`).addEventListener('input', this.emojiChecker.bind(this))\n document.getElementById(`channel${this.count}`).addEventListener('keydown', this.createChannel.bind(this))\n document.getElementById(`channels${this.count}`).addEventListener('click', this.changeChannel.bind(this))\n document.getElementById(`channels${this.count}`).addEventListener('dblclick', this.removeChannel.bind(this))\n document.getElementById(`nickName${this.count}`).addEventListener('keydown', this.updateUsername.bind(this))\n this.ws.addEventListener('message', this.listenMessage.bind(this))\n document.getElementById(`userMessage${this.count}`).focus()\n document.getElementById(`userMessage${this.count}`).disabled = true\n document.getElementById(`channel${this.count}`).disabled = true\n\n const sessionStorage = JSON.parse(window.sessionStorage.getItem('data'))\n if (sessionStorage === null) {\n document.getElementById(`defaultChannel${this.count}`).click()\n document.getElementById(`receivedMessages${this.count}`).innerHTML += `<p class=\"receivedMessages\">You will need to enter a username before you can continue</p>`\n document.getElementById(`receivedMessages${this.count}`).innerHTML += `<p class=\"receivedMessages\">The Matrix ${this.getTime()}</p>`\n document.getElementById(`nickName${this.count}`).focus()\n } else {\n this.userName = String(sessionStorage[0])\n document.getElementById(`nickName${this.count}`).value = String(this.userName)\n this.savedMessages = sessionStorage[1]\n this.channels = sessionStorage[2]\n this.channels.forEach(element => { this.addChannel(element) })\n document.getElementById(`userMessage${this.count}`).disabled = false\n document.getElementById(`channel${this.count}`).disabled = false\n document.getElementById(`defaultChannel${this.count}`).click()\n }\n }", "function newConnection(socket) {\n\n /*socket id es la id de la conexion */\n console.log('new connection: ' + socket.id);\n socket.emit('usuario local', socket.id);\n socket.emit('connection');\n /*numero de clientes */\n /*para conectar ala base de datos */\n MongoClient.connect(url, function (err, client) {\n const db = client.db(dbName);\n chat = db.collection('chats');\n assert.equal(null, err);\n if (err) {\n throw err;\n }\n \n console.log(\"Connected successfully to server\");\n });\n function mostrarDatos(){\n chat.find().limit(100).sort({_id:1}).toArray(function(err,res){\n assert.equal(err,null);\n console.log(\"datos a enviar\"+res);\n socket.emit('salida',res);\n });\n }\n function removerDatos(){\n chat.remove({},function(){\n socket.emit('borrar');\n })\n }\n \n //console.log(io.sockets.sockets.length);\n // socket.broadcast.emit('usuario Nuevo',socket.id);\n // socket.emit('usario',socket.id);\n\n socket.on('unir chat', (room) => {\n nombreClientes = [];\n roomLocal = room;\n console.log(\"se quiere unir \" + room);\n socket.join(room);\n clients = io.sockets.adapter.rooms[room].sockets;\n numClients = (typeof clients !== 'undefined') ? Object.keys(clients).length : 0;\n //console.log(\"Numero de clientes \" + numClients);\n for (var clientId in clients) {\n //console.log(\"cliente id \" + clientId);\n //this is the socket of each client in the room.\n var clientSocket = io.sockets.connected[clientId];\n \n console.log(\"nombre de usarui es -----------------\"+clientSocket.username);\n \n \n nombreClientes.push(clientSocket.username);\n //console.log(\"clientes \"+clientSocket.id);\n //you can do whatever you need with this\n //clientSocket.emit('new event', \"Updates\");\n //nombreClientes.push(clientSocket.id);*/\n // console.log(\"arreglo de clientes \" + nombreClientes);\n\n\n }\n\n\n io.to(room).emit('actualizar usuarios', nombreClientes);\n });\n socket.on('disconnect', function () {\n nombreClientes = nombreClientes.filter(item => item !== socket.username);\n io.to(roomLocal).emit('actualizar usuarios', nombreClientes);\n //console.log('user disconnected '+socket.id);\n });\n socket.on('mouse', (data) => {\n //console.log(data);\n socket.broadcast.emit('mouse', data);\n });\n socket.on('borrar',(data)=>{\n //remover todos los chats de la colecion\n chat.remove({},()=>{\n socket.emit('borrar');\n })\n })\n socket.on('mensaje chat', (msg) => {\n let nombre = socket.username;\n let mensaje = msg;\n chat.insert({ usuario: nombre, mensaje: mensaje }, function () {\n io.emit('mensaje chat', {\n usuario: nombre,\n mensaje: mensaje\n \n });\n sendStatus({\n message: \"mesage sent\",\n clear: true\n });\n\n })\n\n });\n socket.on('ingresar usuario',(data)=>{\n \n socket.username = data;\n console.log(\"dar mensajes al ingresar\");\n mostrarDatos();\n \n\n });\n /*codigo para la base de datos*/\n sendStatus = function (s) {\n socket.emit('status', s);\n }\n //obtenr chats de mongo coletions\n\n\n\n}", "function connect(room) {\n // Handle a chat connection.\n $('#text').focus();\n const chatbox = $('<div></div>').addClass('connection').addClass('active').attr('id', room.name);\n const roomName = room.name.replace('sfu_text_', '');\n const header = $('<h1></h1>').html('Room: <strong>' + roomName + '</strong>');\n const messages = $('<div><em>Peer connected.</em></div>').addClass('messages');\n chatbox.append(header);\n chatbox.append(messages);\n // Select connection handler.\n chatbox.on('click', () => {\n chatbox.toggleClass('active');\n });\n\n $('.filler').hide();\n $('#connections').append(chatbox);\n\n room.getLog();\n room.once('log', logs => {\n for (let i = 0; i < logs.length; i++) {\n const log = JSON.parse(logs[i]);\n\n switch (log.messageType) {\n case 'ROOM_DATA':\n messages.append('<div><span class=\"peer\">' + log.message.src + '</span>: ' + log.message.data + '</div>');\n break;\n case 'ROOM_USER_JOIN':\n if (log.message.src === peer.id) {\n break;\n }\n messages.append('<div><span class=\"peer\">' + log.message.src + '</span>: has joined the room </div>');\n break;\n case 'ROOM_USER_LEAVE':\n if (log.message.src === peer.id) {\n break;\n }\n messages.append('<div><span class=\"peer\">' + log.message.src + '</span>: has left the room </div>');\n break;\n }\n }\n });\n\n room.on('data', message => {\n if (message.data instanceof ArrayBuffer) {\n const dataView = new Uint8Array(message.data);\n const dataBlob = new Blob([dataView]);\n const url = URL.createObjectURL(dataBlob);\n messages.append('<div><span class=\"file\">' +\n message.src + ' has sent you a <a target=\"_blank\" href=\"' + url + '\">file</a>.</span></div>');\n } else {\n messages.append('<div><span class=\"peer\">' + message.src + '</span>: ' + message.data + '</div>');\n }\n });\n\n room.on('peerJoin', peerId => {\n messages.append('<div><span class=\"peer\">' + peerId + '</span>: has joined the room </div>');\n });\n\n room.on('peerLeave', peerId => {\n messages.append('<div><span class=\"peer\">' + peerId + '</span>: has left the room </div>');\n });\n }", "function user(){\n\n var person = usuario.name+\" - (\"+usuario.username+\")\";\n socket.emit(\"nickname\", person);\n\n return false;\n }", "function onConnected()\n{\n document.getElementById('connectionStatus').textContent = \"connected!\";\n readForever();\n console.log(socketId);\n read();\n write('PASS none');\n write('NICK ' + userName);\n write('USER USER 0 * :Real Name', function()\n {\n //wait for a sign that we're registered before joining.\n //Welcome to the Internet Relay Network -RPL_WELCOME via IRC RFCs\n //socket.listen is not an option for client side connections. let's try reading until we get what we want\n var welcomeMsg=\"\";\n var dateRead = new Date();\n console.log(dateRead+\": Wrote after USER\\r\\n\");\n\n //write('JOIN #realtestchannel\\r\\n');\n })//end write\n} // end onConnected", "connect() {\r\n socket = new WebSocket(\"ws://localhost:4567/profesor\");\r\n socket.onopen = this.openWs;\r\n socket.onerror = this.errorWs;\r\n socket.onmessage = this.messageWs;\r\n app.recarga();\r\n }", "function connectChatBot() {\n var dataObj = {\n type : \"BOT\",\n from : userSelf.email,\n msg : {\n sendType: \"Connect\",\n msgData: \"FirstLink\"\n }\n };\n\n sendMessageToOne(dataObj);\n}", "function escribiendo(){\n socket.emit(\"escribiendo\",{ escribiendo: true, id: usuarioChat.usuario.id });\n \n}", "function userConnection(data) {\n if(data.graph_id && data.user)\n socket.emit(\"user/connection\", data);\n}", "function onConnect() {\r\n // Once a connection has been made, make a subscription and send a message.\r\n console.log(\"Conectado...\");\r\n\r\n client.subscribe(\"jomsk@hotmail.com/IoT\");\r\n\r\n\r\n}", "function startChat() {\n let channel = client.join({ user: username});\n \n channel.on(\"data\", onData);\n \n rl.on(\"line\", function(text) {\n client.send({ user: username, text: text }, res => {});\n });\n}", "function logear(){\n let correo = document.getElementById('correo').value;\n let usuario = $('#login_form #usuario').val();\n socket.emit('datos_usuario', { correo: correo, usuario: usuario } );\n yo = usuario;\n // id_user = socket.id;\n document.getElementById('usuarioLogeado').innerText = yo;\n}", "function onConnect() {\n // Once a connection has been made, make a subscription and save a message to a txt.\n client.subscribe(\"mebaris01/nurusallam/\");\n \n}", "function onConnected(frame) {\n console.log('Connected: ' + frame);\n stompClient.subscribe('/topic/public', onMessageReceived);\n stompClient.send(\"/app/newUser\",\n {},\n JSON.stringify({\n sender: username,\n type: 'JOIN',\n dateTime: moment().format('DD/MM/YYYY hh:mm:ss')\n })\n )\n connectingElement.classList.add('hidden');\n}", "function connect(){\n const socket = io(server);\n socket.on('connect', ()=>{\n console.log('connected')\n })\n\n emissionObject ={\n currentName:user.userName,\n currentImg:user.imgUrl,\n date:new Date().getTime,\n message:\"hello world\"\n }\n socket.on(room, (message)=>{\n console.log(`${user.username}: ${user.imgUrl}: ${message}`)\n let textLine = document.createElement(\"li\")\n let image = createImage(user.imgUrl);\n textLine.innerText = `${user.userName}: ${message}`\n textLine.appendChild(image);\n chatbox.appendChild(textLine);\n\n \n }) ;\n\n return socket;\n}", "userConnect(req, res) {\n\n // The socket ID of the currently connecting socket\n const socketId = sails.sockets.getId(req)\n\n LiveChat.create({\n socketID: socketId,\n displayName: req.param('displayName'),\n department: req.param('department'),\n subject: req.param('subject'),\n isAwaiting: true,\n user: req.user && req.user.id ? req.user.id : null\n }).exec(function (err, liveChatR) {\n if (err) {\n return res.json({\n error: err,\n errorMessage: err.message\n })\n } else {\n // Notify watchers that a new user has connected\n req.session.livechat = liveChatR\n LiveChat.publishCreate(liveChatR)\n return res.ok()\n }\n })\n }", "function connect() {\n pseudo = pseudoInput.value.trim();\n if (pseudo.length === 0) {\n alert(\"Votre pseudo ne doit pas être vide ! \");\n return;\n }\n if (!/^\\S+$/.test(pseudo)) {\n alert(\"Votre pseudo ne doit pas contenir d'espaces ! \");\n return;\n }\n sock.emit(\"login\", pseudo);\n }", "servermsg_room(text){\n console.log(`Room msg for ${this.username}: ${text}`);\n io.in(this.room).emit('chat:message', {username: '<system>', text});\n }", "function envoiMessage(mess) {\r\n // On recupere le message\r\n var message = document.getElementById('message').value;\r\n\r\n // On appelle l'evenement se trouvant sur le serveur pour qu'il enregistre le message et qu'il l'envoie a tous les autres clients connectes (sauf nous)\r\n socket.emit('nouveauMessage', { 'pseudo' : pseudo, 'message' : message });\r\n\r\n // On affiche directement notre message dans notre page\r\n document.getElementById('tchat').innerHTML += '<div class=\"line\"><b>'+pseudo+'</b> : '+message+'</div>';\r\n\r\n // On vide le formulaire\r\n document.getElementById('message').value = '';\r\n\r\n // On retourne false pour pas que le formulaire n'actualise pas la page\r\n return false;\r\n}", "componentWillMount() {\n console.log(this.state.user)\n this.socket = io('localhost:8000');\n\n this.socket.on('sentMsg', (response) => {this.setState({messages: response})}); //listen with new message\n\n this.socket.on('loginFail', (response) => {alert('Username is used !')}); //login fail\n this.socket.on('loginSuccess', (response) => {this.setState({user: {id: this.socket.id, name: response}})}); //login ok\n this.socket.on('updateUserList', (response) => {this.setState({userOnline: response})}); //update users list\n this.socket.on('server-sent-channel', (response) => {this.setState({listChannel: response})});\n this.socket.on('server-sent-channel-socket', (response) => {this.setState({channelSocketInfo: response})});\n\n\n }", "createChat () {\n let messageDiv = elementCreate.create('div', { id: 'messages' })\n this.chatDiv.appendChild(messageDiv)\n\n this.chatSocket = new window.WebSocket('ws://vhost3.lnu.se:20080/socket/', 'chatchannel')\n\n let chatData = {\n 'type': 'message',\n 'data': '',\n 'username': this.nameStorage.getItem('userName'),\n 'channel': 'myOwnChannel',\n 'key': 'eDBE76deU7L0H9mEBgxUKVR0VCnq0XBd'\n }\n\n this.chatSocket.addEventListener('message', event => {\n let answer = JSON.parse(event.data)\n\n if (answer.type !== 'heartbeat') {\n let user = elementCreate.create('h3', { id: 'user' })\n user.innerText = answer.username\n this.chatDiv.querySelector('#messages').appendChild(user)\n\n let userMessage = document.createElement('p')\n userMessage.innerText = answer.data\n this.chatDiv.querySelector('#messages').appendChild(userMessage)\n }\n messageDiv.scrollTop = messageDiv.scrollHeight\n })\n\n let messageBox = elementCreate.create('textarea',\n { name: 'textbox', id: 'messagebox', cols: 30, rows: 5 })\n this.chatDiv.appendChild(messageBox)\n\n let textBox = this.chatDiv.querySelector('#messagebox')\n let chatSocket = this.chatSocket\n textBox.addEventListener('keydown', event =>\n sendMessage(event, chatSocket, textBox, chatData))\n\n /**\n * Sends messages to server via the web socket.\n *\n * @param {event} event\n * @param {WebSocket} chatSocket\n * @param {element} textBox\n * @param {object} chatData\n */\n function sendMessage (event, chatSocket, textBox, chatData) {\n if (event.key === 'Enter') {\n event.preventDefault()\n\n if (textBox.value !== '') {\n chatData.data = textBox.value\n chatSocket.send(JSON.stringify(chatData))\n textBox.value = ''\n }\n }\n }\n }", "function initUser(roomname) {\n peer.on('open', function(id) {\n $('#username-text').hide();\n $('#peerSubmit').hide();\n $('#id').show();\n $('#pid').text(id);\n if (peerReconnecting){\n // do nothing\n } else {\n createVideoFeedButton();\n }\n var data = {\n roomName: roomname,\n userName: id\n } \n sendUserToServer(data);\n });\n }", "function sendMessage() {\n \t\tvar message = data.value;\n\t\tdata.value = \"\";\n\t\t// tell server to execute 'sendchat' and send along one parameter\n\t\tsocket.emit('sendchat', message);\n\t}", "function connect() {\n\n\n var username = document.getElementById(\"userNameField\").value;\n var password = document.getElementById(\"passwordField\").value;\n if (username) {\n easyrtc.setUsername(username);\n }\n if (password) {\n easyrtc.setCredential({password: password});\n }\n\n\n connectToRoom(room);\n easyrtc.setPeerListener(dispatchIncomingData);// set callback function on reception of message\n easyrtc.setRoomOccupantListener(generateRoomOccupants);\n\n\n if (room === \"default\" && firstConnect === true) {\n easyrtc.connect(\"multichat\", loginSuccess, loginFailure);\n firstConnect = false;\n }\n //console.log(easyrtc.username);\n\n //pouchDB\n updateRoomListIndex();\n connectToDb(room);\n //vis.js\n generateGraph(room);\n\n const $sendStuff = $(\"#sendStuff\");\n $sendStuff.on(\"click\", sendMessage);// FIXME some things can be moved outside this function to avoid being called several times unnecessarily\n $sendStuff.html(\"Send to room: \" + room);\n\n //experimental stuff :\n if (experimental) {\n showRooms();\n }\n}", "function initChat() {\n var chat;\n\n chat = dataChannelChat;\n /* this function is called with every data packet recieved */\n rtc.on(chat.event, function(conn, data, id, username) {\n /* decode and append to data */\n data = chat.recv.apply(this, arguments);\n\t\tpacket_inbound(id, data);\n });\n}", "function sendMessage(username, usermsg) {\n let type;\n let msg;\n if(usermsg.img){\n type = \"image\";\n msg = usermsg.img;\n $(\".img-preview\").hide();\n }else{\n type = \"string\";\n msg = usermsg.val();\n }\n sendPing(startPoint.x + (canvas.vptCoords.tl.x + canvas.vptCoords.tr.x) / 2, startPoint.y + (canvas.vptCoords.tl.y + canvas.vptCoords.bl.y) / 2, \"chat\");\n socket.emit(\"fromclient\", {\n username: username,\n type: type,\n msg: msg,\n });\n}", "handleOnUserMessage(user, message){\n\n // Message in JSON-Objekt umwandeln für Datenzugriff\n var data = JSON.parse(message);\n // Spiel-Logik hat hier nichts zu suchen, kommt dann im GameRoom noch ...\n if (data.dataType === GAME_LOGIC) return;\n\n // Chat-Nachricht\n if (data.dataType === CHAT_MESSAGE) {\n\t\t\t// Absender ergänzen, die anderen wollen ja wissen, vom wem die Nachricht war\n\t\t\tdata.sender = user.Username;\n }\n // Es hat eine Nachricht drin\n if (typeof data.message !== 'undefined'){\n /*\n * Diverse mögliche Kommando abarbeiten\n */\n //UserName soll geändert werden\n if(data.message.startsWith(\"/nick \")) {\n console.log(\"Kommando: /nick\");\n // Username überschreiben und alle User informieren\n user.setUsername(data.message.replace(\"/nick \", \"\"));\n user.room.sendDetails();\n\n // zusätzlich eine Nachricht an alle vorbereiten\n data = {\n dataType: CHAT_MESSAGE,\n sender: \"Server\",\n message: \"User [\"+data.sender + \"] heisst neu [\"+user.Username+\"]\"\n };\n }\n // Kommando /play wechselt dem Raum bei Erfolg\n else if(data.message.startsWith(\"/play \")) {\n // mit wem will aktueller User spielen?\n let otherName = data.message.replace(\"/play \", \"\");\n let otherIdx = user.room.users.findIndex(e => e.Username.trim() == otherName );\n\n console.log(\"/playResult: \" + otherIdx);\n\n // Gibt es den überhaupt?\n if(otherIdx == -1){\n //nein, nachricht vorbereiten\n data = {\n dataType: CHAT_MESSAGE,\n sender: \"Server\",\n message: \"User [\"+otherName + \"] nicht gefunden\"\n };\n // ja, es gibt ihn\n }else {\n let other = user.room.users[otherIdx];\n\n // aktuellen User und Spielpartner aus aktuellem Raum entfernen\n user.room.removeUser(user);\n user.room.removeUser(other);\n\n // neuen Raum eröffnen und beide darin zuordnen\n user.setRoom(new GameRoom(user.Username + \" vs. \" + otherName));\n other.setRoom(user.room);\n user.room.addUser(user);\n user.room.addUser(other);\n //--> Die User werden im addUser noch über die neuen Raum-Details informiert\n }\n\n\n }\n // Raum verlassen und in Lobby zurückkehren\n else if(data.message.startsWith(\"/quit\")) {\n\n console.log(\"/quit: \" + user.Username);\n //info vorbereiten und senden\n data = {\n dataType: CHAT_MESSAGE,\n sender: \"Server\",\n message: \"User [\"+user.Username + \"] quitted\"\n };\n user.room.sendAll(JSON.stringify(data));\n // user entfernen\n user.room.removeUser(user);\n // .. und an Lobby zuweisen\n user.room = user.lobby;\n user.lobby.addUser(user); // in addUser werden wieder alle informiert\n\n // Nachricht vorbereiten\n data = {\n dataType: CHAT_MESSAGE,\n sender: \"Server\",\n message: \"User [\"+user.Username + \"] joined\"\n };\n\n }\n // alles andere müssten nun Chat-Nachrichten sein\n else {\n // Aus Sicherheitsgründen werden sämtliche Zeichen durch den Code ersetzt\n // dadruch bleiben auch alle <>/*[]\" erhalten und es kann nichts \"eingeschleust\" werden\n data.message = data.message.replace(/[\\u00A0-\\u9999<>\\&]/gim, function(i) {\n return '&#'+i.charCodeAt(0)+';';\n });\n\n }\n }//message ist gesetzt\n\n // vorbereitete Nachricht an alle senden\n user.room.sendAll(JSON.stringify(data));\n\n}", "function connect(id, token) {\n // Socket Event Listners:\n var dataTypes = ['msg=', 'customSale=', 'celebration=', 'hostChange='];\n socket = new WebSocket(wsBaseUrl + '?id='+id+'&user_token='+token);\n // socket events\n socket.addEventListener('open', function (event) { // connection: opened\n onConnect();\n });\n socket.addEventListener('message', function(event) { // connection: received data[msg]\n var msgType; var msg;\n for (var i=0; i<dataTypes.length; i++) {\n if (event.data.includes(dataTypes[i])) {\n msgType = dataTypes[i];\n msg = event.data.replace(msgType, '');\n\n switch (i) {\n case 0:\n onMessage(msg);\n console.log('socket.msg: '+msg);\n break;\n case 1:\n onCustomChat(msg);\n console.log('socket.onCustomChat: '+msg);\n break;\n case 2:\n onCelebration(msg);\n console.log('socket.onCelebration: '+msg);\n break;\n case 3:\n onStreamHostChange(msg);\n console.log('socket.onStreamHostChange: '+msg);\n break;\n default:\n break;\n }\n }\n }\n });\n socket.addEventListener('customSale', function(event) { // connection: received data[customSale]\n onCustomChat(event.data);\n // onCustomChat(event.data);\n });\n socket.addEventListener('removeChat', function(event) { // connection: remove data\n onDeleteChat(event.data);\n });\n socket.addEventListener('error', function() { // connection: encountered error\n if(socket.readyState !== READY_STATE_OPEN) {\n console.log('connection closed, reconnecting in 3 seconds');\n setTimeout(function(){ connect(id, token); }, RECONNECT_TIMEOUT);\n }\n });\n socket.addEventListener('close', function() { // connection: closed\n onClose();\n });\n // End Socket Listners\n\n console.log('chatService(wsBaseUrl).connect('+id+', '+token+')');\n return this;\n }", "function onConnect() {\n\t// Once a connection has been made, make a subscription and send a message.\n\ttry {\n\t\tclearInterval(interval);\n\t} catch (error) {}\n\t// client subscribed op dynamische topic!\n\tclient.subscribe(`/luemniro/PiToJs/${InputFieldValue}`);\n\t// Kijken of juiste ID is ingegeven!\n\tinitializeCommunication();\n}", "function updateChat() {\n console.log(\"Update\");\n socket = io.connect('http://localhost:1337');\n console.log(\"Connected\");\n socket.on(\"newsSC\", function (data) {\n console.log(\"Receive Data: \" + data.myText);\n writeText(data.myText);\n });\n }", "async connect() {\n Channel.botMessage('Welcome to Routefusion Chat!\\n\\n');\n this.user = await this.setUser();\n this.greetUser();\n }", "showChat() {\n if (!this.openedYet) { // if first time\n this.openConnection() // open connection\n }\n this.openedYet = true // connection established\n this.chatWrapper.classList.add(\"chat--visible\")\n this.chatField.focus()\n }", "function onFirstConnection () {\n\t\t\thandleMessage(\"server\", {\n\t\t\t\tnoBroadcast: true,\n\t\t\t\tmessage: \"Welcome @\" + session.username + \", you have joined room #\" + room.id\n\t\t\t});\n\t\t\t// Warn other user that a new user joined the room\n\t\t\thandleMessage(\"server\", {\n\t\t\t\tnoPrivate: true,\n\t\t\t\tmessage: '@' + session.username + ' has joined!'\n\t\t\t});\n\t\t}", "function activity() {\n setTimeout(() => {\n fivereborn.query(configs.serverInfo[0], configs.serverInfo[1], (err, data) => {\n if (err) {\n console.log(err);\n } else {\n bot.user.setActivity(\"\" + data.clients + \"/\" + data.maxclients + \" Joueur(s) connecté(es) | s!help\", { type: configs.activityType });\n }\n });\n activity();\n }, 10000);\n}", "function loadClientChatSessionAndInfo(chat_id) {\n let client_info = connected_client_list.get(chat_id); // get client info\n let connection_status = client_connection_status.get(chat_id);\n\n // update client connection status\n let elem = document.getElementById(\"indicator-\" + chat_id);\n elem.setAttribute(\"class\", connection_status == CONNECTED ? \"indicator chatting\" : \"indicator offline\");\n \n // set chat window's title bar\n elem = document.getElementById(\"chat-win-indicator\");\n elem.setAttribute(\"class\", connection_status == CONNECTED ? \"indicator chatting\" : \"indicator offline\");\n elem = document.querySelector('.chat-window-cont .header-menu-bar .profile-picture');\n elem.setAttribute(\"src\", client_info.client.picture);\n elem = document.querySelector('.chat-window-cont .header-menu-bar .profile-name-connect-time .name');\n elem.innerHTML = client_info.client.name;\n elem = document.getElementById(\"chat-win-status\");\n elem.innerHTML = connection_status == CONNECTED ? \"online\" : \"offline\";\n\n // set user's information\n elem = document.getElementById(\"user-info-indicator\");\n elem.setAttribute(\"class\", connection_status == CONNECTED ? \"indicator chatting\" : \"indicator offline\");\n elem = document.querySelector('.chat-user-info-cont .user-connect-info .profile-picture');\n elem.setAttribute(\"src\", client_info.client.picture);\n elem = document.querySelector('.chat-user-info-cont .user-connect-info .name');\n elem.innerHTML = client_info.client.name;\n elem = document.querySelector('.chat-user-info-cont .user-connect-info .user-type');\n elem.innerHTML = \"Customer\";\n elem = document.querySelector('.chat-user-info-cont .user-personal-info .info-list .list-data');\n elem.innerHTML = client_info.client.email;\n\n // load and render user's chat history\n let message_list = chat_messages.get(chat_id);\n let message_type = chat_messages_type.get(chat_id);\n chat_window_msg_list_elem.innerHTML = \"\"; // clear messages if there is any\n let client_prev_sent_msg_time = 0;\n let client_curr_sent_msg_time;\n let agent_prev_sent_msg_time = 0;\n let agent_curr_sent_msg_time;\n \n // iterate through the messages\n for (let i = 0; i < message_list.length; i++) {\n if (message_type[i] == CLIENT_MSG) {\n client_curr_sent_msg_time = message_list[i].time;\n\n // check to create header or tail message\n if ((client_curr_sent_msg_time - client_prev_sent_msg_time) > 60) { // create header message\n chat_window_msg_list_elem.appendChild(createClientHeaderMessageBox(message_list[i]));\n\n } else { // create tail message\n chat_window_msg_list_elem.appendChild(createClientTailMessageBox(message_list[i]));\n }\n\n client_prev_sent_msg_time = client_curr_sent_msg_time;\n\n } else { // AGENT_MSG\n agent_curr_sent_msg_time = message_list[i].time;\n\n // check to create header or tail message\n if ((agent_curr_sent_msg_time - agent_prev_sent_msg_time) > 60) { // create header message\n chat_window_msg_list_elem.appendChild(createAgentHeaderMessageBox(message_list[i]));\n\n } else { // create tail message\n chat_window_msg_list_elem.appendChild(createAgentTailMessageBox(message_list[i]));\n }\n\n agent_prev_sent_msg_time = agent_curr_sent_msg_time;\n }\n }\n\n // scroll chat message container to bottom\n chat_window_msg_list_elem.scrollTop = 100000;\n }", "function connect(host) {\n if (websocket === undefined) {\n websocket = new WebSocket(host);\n }\n\n websocket.onopen = function() {\n // chrome.storage.local.get([\"username\"], function(data) {\n // websocket.send(JSON.stringify({userLoginId: data.username}));\n // });\n\n data = {\n\t\t \"method\":\"SUBSCRIBE\",\n\t\t \"params\": [\n\t\t \"rvnusdt@aggTrade\",\n\t\t \"shibusdt@aggTrade\",\n\t\t \"dogeusdt@aggTrade\",\n\t\t \"btcusdt@aggTrade\",\n\t\t \"beamusdt@aggTrade\"\n\t\t ],\n\t\t \"id\": id\n\t\t};\n\t\twebsocket.send(JSON.stringify(data)); //将消息发送到服务端\n };\n\n websocket.onmessage = function (event) {\n // var received_msg = JSON.parse(event.data);\n // var demoNotificationOptions = {\n // type: \"basic\",\n // title: received_msg.subject,\n // message: received_msg.message,\n // iconUrl: \"images/demo-icon.png\"\n // }\n data = JSON.parse(event.data);\n var sendData = {\n };\n\t\tif (data.s == 'SHIBUSDT') {\n\t\t\tsendData.coin = \"SHIB\";\n\t\t\tsendData.price = data.p;\n\t\t\t// $('#shib').html(data.p);\n\t\t}\n\t\tif (data.s == 'RVNUSDT') {\n\t\t\tsendData.coin = \"RVN\";\n\t\t\tsendData.price = data.p;\n\t\t\t// $('#rvn').html(data.p);\n\t\t}\n\t\tif (data.s == 'DOGEUSDT') {\n\t\t\tsendData.coin = \"DOGE\";\n\t\t\tsendData.price = data.p;\n\t\t\t// $('#rvn').html(data.p);\n\t\t}\n\t\tif (data.s == 'BTCUSDT') {\n\t\t\tsendData.coin = \"BTC\";\n\t\t\tsendData.price = data.p;\n\t\t\t// $('#rvn').html(data.p);\n\t\t}\n\t\tif (data.s == 'BEAMUSDT') {\n\t\t\tsendData.coin = \"BEAM\";\n\t\t\tsendData.price = data.p;\n\t\t\t// $('#rvn').html(data.p);\n\t\t}\n\t\t// chrome.tabs.query({active: true, currentWindow: true}, function(tabs){\n\t\t// chrome.tabs.sendMessage(tabs[0].id, {action: sendData}, function(response) {}); \n\t\t// });\n\t\t\n\t\t// chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {\n\t\t// chrome.tabs.sendMessage(tabs[0].id, sendData, function(response) { });\n\t\t// });\n\n\t\t// alert(JSON.stringify(sendData));\n\t\tvar port = chrome.runtime.connect({name: \"coinStatus\"});//通道名称\n\t\tport.onDisconnect.addListener(function() {\n\t var ignoreError = chrome.runtime.lastError;\n\t console.log(\"onDisconnect\");\n });\n\n\t\tport.postMessage(sendData);//发送消息\n\t\t// port.onMessage.addListener(function(msg) {//监听消息\n\t\t// \tconsole.log(msg);\n\t\t// // if (msg.question == \"Who's there?\")\n\t\t// // port.postMessage({answer: \"yisheng\"});\n\t\t// // else if (msg.question == \"Madame who?\")\n\t\t// // port.postMessage({answer: \"Madame... Bovary\"});\n\t\t// });\n\t\t// chrome.runtime.onMessage.addListener(function (request,sender,callback) {\n\t\t// \tconsole.log(request);\n\t\t// \tconsole.log(sender);\n\t\t// callback(sendData);\n\t\t// });\n\t\t// chrome.notifications.create(\"\", sendData);\n // updateData();\n };\n\n //If the websocket is closed but the session is still active, create new connection again\n websocket.onclose = function() {\n \treq = {\n\t\t \"method\": \"UNSUBSCRIBE\",\n\t\t \"params\": [\n\t\t \"rvnusdt@aggTrade\",\n\t\t \"shibusdt@aggTrade\",\n\t\t \"dogeusdt@aggTrade\",\n\t\t \"btcusdt@aggTrade\",\n\t\t \"beamusdt@aggTrade\"\n\t\t ],\n\t\t \"id\": id\n\t\t}\n\t\twebsocket.send(JSON.stringify(data));\n websocket = undefined;\n chrome.storage.local.get(['demo_session'], function(data) {\n if (data.demo_session) {\n createWebSocketConnection();\n }\n });\n };\n}", "function chat() {\n\t\tvar loginform = document.getElementById('loginform');\n\t\tvar channel_name = document.getElementById('channel_name');\n\t\tif(loginform && channel_name) {\n\t\t\tvar selector;\n\t\t\tvar button;\n\t\t\tif(sticks.get_cookie('chat_theme', 'dark') === 'light') {\n\t\t\t\tsticks.addClass(document.body, 'light-theme');\n\t\t\t\tselector = '.settings-item[data-settings-type=chat-theme] i';\n\t\t\t\tbutton = document.querySelector(selector);\n\t\t\t\tsticks.toggleClass(button, 'fa-toggle-on');\n\t\t\t\tsticks.toggleClass(button, 'fa-toggle-off');\n\t\t\t}\n\t\t\tif(sticks.get_cookie('smooth_scroll', 'on') === 'off') {\n\t\t\t\t_smooth_scroll = false;\n\t\t\t\tselector = '.settings-item[data-settings-type=smooth-scroll-mode] i';\n\t\t\t\tbutton = document.querySelector(selector);\n\t\t\t\tsticks.toggleClass(button, 'fa-toggle-on');\n\t\t\t\tsticks.toggleClass(button, 'fa-toggle-off');\n\t\t\t}\n\t\t\tif(sticks.get_cookie('join_mode', 'hide') === 'show') {\n\t\t\t\t_show_join_leave_message = true;\n\t\t\t\tselector = '.settings-item[data-settings-type=join-mode] i';\n\t\t\t\tbutton = document.querySelector(selector);\n\t\t\t\tsticks.toggleClass(button, 'fa-toggle-on');\n\t\t\t\tsticks.toggleClass(button, 'fa-toggle-off');\n\t\t\t}\n\t\t\tchannel_name = channel_name.value;\n\t\t\tvar webchat_uri = loginform.getAttribute('data-webchat-uri');\n\t\t\tsticks.on(loginform, 'submit', function(event) {\n\t\t\t\tsticks.preventDefault(event);\n\t\t\t\tsticks.chat.connect(webchat_uri, channel_name);\n\t\t\t\ttoggle_spinner(true);\n\t\t\t\tpulse_channel_window(channel_name, true);\n\t\t\t\t_connect_timeout = setTimeout(on_connection_timeout, 5000);\n\t\t\t\treturn false;\n\t\t\t});\n\t\t\tvar tab = document.getElementById('channel-tab-template');\n\t\t\tinit_channel_tab_event_listeners(tab);\n\t\t\tvar settings_items = tab.parentNode.querySelectorAll('.settings-item');\n\t\t\tfor(var idx=0; idx < settings_items.length; idx++) {\n\t\t\t\tsticks.on(settings_items[idx], 'click', function(e) {\n\t\t\t\t\tsettings_item_toggle(e.currentTarget);\n\t\t\t\t\treturn sticks.preventDefault(e);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tsticks.on(window, 'beforeunload', disconnect)\n\t}", "function socket_connect() {\n socket = io('localhost:3000/');\n socket_emitUsername();\n socket_initSocketEventHandlers();\n}", "function connectSuccess( caller_rtc_id)\n{\n\t\ttrace(\"connectSuccess() : Entering room only for myself : [\"+ $chat_room_name +\"] rtc_id='\"+ caller_rtc_id +\"'...\");\t\n\t\t/**\n\t\t * 더 이상 lobby 방은 이 함수가 호출이 되지 않는다. 하지만 안전을 위해서 둔다.\n\t\t */\n\t\tif ( $chat_room_name == 'lobby' ) {\n\t\t\treturn;\n\t\t}\n\t\telse {\n\t\t\t// socket.io 로 방설정을 먼저 하고 채팅방에 죠인해야 설정이 리턴된다. 이것은 방 목록에서 방 인원 수 표시에 영향을 미친다.\n\t\t\tsocket_io_chat_room_setting_for_room_join();\n\t\t\tchat_room_join();\n\t\t}\n\t\t\n\t\t\n\t\t/**\n\t\t * 이 콜백은 각 사용자 마다 한번씩만 발생 시킨다.\n\t\t */\n\t\tif ( typeof callback_connect_success == 'function' ) callback_connect_success( caller_rtc_id );\n\t\t\n\t\t\n\t\tif( is_observer != true ){//observer\n\t\t\n\t\t\tif ( $(\"video[rtc-id='\" + caller_rtc_id + \"']\").length ) {//if self video already exists.\n\t\t\t\tvar selfVideo = $(\"video[rtc-id='\"+caller_rtc_id+\"']\")[0];//to avoid self video duplication on server connection lost.\n\t\t\t}\n\t\t\telse {\t\t\n\t\t\t\tvar selfVideo = create_video_element( caller_rtc_id, 'me' );\n\t\t\t}\n\t\t\t\n\t\t\teasyrtc.setVideoObjectSrc(selfVideo, easyrtc.getLocalStream() );\n\t\t\t\n\t\t\tselfVideo.muted = true; // @todo check 'muted' attribute is added in DOM.\n\t\t\t\n\t\t}//observer\n\t\t/**\n\t\t * after join the video chat room\n\t\t */\n\t$.cookie('chat_room_name', $chat_room_name); // must be needed\n}", "function getUsersConnected() {\n //Quantidada de usuarios\n io.sockets.emit('qtdUsers', { \"qtdUsers\": usersConnected });\n\n //retorna os nomes dos usuarios\n io.sockets.emit('listaUsuarios', Object.keys(listUsers));\n}", "function sendMsgTo(userLoggedin, msgTxt,pvtMsgType,usrName, pageType){\r\n\r\n \t if(validateMsg(userLoggedin,msgTxt)==-1)\r\n \t\t return -1;\r\n \t \r\n\t var toUsrName=document.getElementById(\"users\");\r\n var selIdx= toUsrName.selectedIndex;\r\n \r\n \t if(selIdx==-1)\r\n \t {\r\n \t\t alert(\"Please selected the user\");\r\n \t\t return 0;\r\n \t }\r\n \t \r\n // User to whom message is to be sent \t \r\n var touser = toUsrName.options[selIdx].value;\r\n \r\n //user who is sending message\r\n var usrName=document.getElementById(usrName).value;\r\n // message that needs to be sent\r\n \r\n \t if(touser==usrName)\r\n \t {\r\n \t\t alert(\"You cannot send message to yourself\");\r\n \t\t return 0;\r\n \t }\r\n \t \r\n \t \r\n \t var msgTxt = document.getElementById(\"msgTxt\").value;\r\n \t \r\n// \t alert(\"userLoggedin=\" + userLoggedin +\", msgTxt =\" + msgTxt + \", pvtMsgType =\" + pvtMsgType + \",usrName =\" + usrName +\", pageType=\"+ pageType);\r\n document.getElementById(\"msgTxt\").value=\"\";\r\n socket.emit(pvtMsgType, {\r\n \"name\": usrName,\r\n \"msgTxt\": msgTxt,\r\n \"to\" :touser,\r\n \"pageType\":pageType\r\n });\r\n \r\n\t}", "function connect(c) {\n startMessaging();\n\n // Handle a chat connection.\n if (c.label === 'chat') {\n var chatbox = $('<div></div>').addClass('connection').addClass('active').attr('id', c.peer);\n var messages = $('<div><em class=\"notification\">La Conversación inicio, Alguien se conecto a usted...</em></div>').addClass('messages');\n chatbox.append(messages);\n \n // Select connection handler.\n chatbox.on('click', function() {\n if ($(this).attr('class').indexOf('active') === -1) {\n $(this).addClass('active');\n } else {\n $(this).removeClass('active');\n }\n });\n $('.filler').hide();\n $('#connections').append(chatbox);\n c.on('data', function(data) {\n \t// Decrypt data (message)\n console.log(\"DATA!!!!!!:\");\n console.log(data); \n var dataBigInt = data.split(\",\");\n for (var i = 0; i < dataBigInt.length; i++) {\n dataBigInt[i] = new BigInteger(dataBigInt[i]);\n }\n RSAChat.setPrivateKey(n, d);\n console.log(\"n:\", n);\n console.log(\"d:\", d);\n decryptedMsg = {};\n //decryptedMsg.plaintext = RSAChat.decrypt(dataBigInt);\n decryptedMsg.plaintext = data;\n console.log(\"Decrypted text\");\n messages.append('<li><div class=\"message_block partner\"><span class=\"date\">' + (new Date()).getHours() + ':' + addZero(new Date().getMinutes()) + '</span> <span class=\"peer\">Socio</span><div class=\"message\">' + decryptedMsg.plaintext.replace(/([^>])\\n/g, '$1<br/>') +\n '</div></div></li>');\n // play notification\n notifyMe();\n\n });\n c.on('close', function() {\n alert('La otra persona salio de la conversación, Volviendo al inicio...');\n $('.chat').hide();\n if ($('.connection').length === 0) {\n $('.filler').show();\n }\n delete connectedPeers[c.peer];\n window.location.replace(\"http://localhost/rsa\");\n });\n } \n connectedPeers[c.peer] = 1;\n}", "function sendMessage() {\r\n let content = document.getElementById(\"msg\").value;//recupere le message de l'input\r\n document.getElementById(\"msg\").value = \"\";//on vide l'élément\r\n websocket.send(\"[\"+login+\"] \"+content);//on envoie le msg au serveur + login de la personne\r\n}", "function startChat(){\n\txmlHttp2 = GetXmlHttpObject();\n\n\tif (xmlHttp2 == null){\n\t\talert(\"Browser does not support HTTP Request\");\n\t\treturn;\n\t}\n\n\tvar url = base_url+ \"mulaiChat\";\n\txmlHttp2.open(\"POST\", url, true);\n\txmlHttp2.onreadystatechange = stateChanged2;\n\txmlHttp2.send(null);\n}", "onUserJoined() {\n this.socket.on(\"userJoined\");\n }", "function connect(computerID) {\n conn = peer.connect(computerID);\n conn.on('open', function () {\n document.getElementById(\"sText\").innerHTML = \"Connecté\";\n document.getElementById(\"sIcon\").src = \"style/img/connected.svg\";\n imageInput.disabled=false;\n });\n\n conn.on('close', function () {\n document.getElementById(\"sText\").innerHTML = \"Déconnecté\";\n document.getElementById(\"sIcon\").src = \"style/img/disconnected.svg\";\n imageInput.disabled=true;\n });\n}", "setupChatNs() {\r\n\t\tthis.ns.chat.on(\"connection\", baseSocket => {\r\n\t\t\tconst socket = new Proxy(baseSocket, new ExtendedSocket()); //extend socket\r\n\r\n\t\t\tsocket.log(chalk.cyan(\"connected\"));\r\n\t\t\tthis.sockets.add(socket);\r\n\r\n\t\t\t//socket wants to join a room\r\n\t\t\tsocket.on(ACTION_TYPE.JOIN_ROOM, ({\r\n\t\t\t\troom,\r\n\t\t\t\tnick\r\n\t\t\t}) => {\r\n\t\t\t\tsocket.changeRoomTo(room);\r\n\r\n\t\t\t\tif (nick) {\r\n\t\t\t\t\tsocket.nick = nick;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//give the socket a random name if it doesnt have any yet\r\n\t\t\t\tif (!socket.nick) {\r\n\t\t\t\t\tsocket.nick = randomNick();\r\n\t\t\t\t\tsocket.emit(ACTION_TYPE.OWN_NICK_CHANGE, {\r\n\t\t\t\t\t\tuser: {\r\n\t\t\t\t\t\t\tnew: socket.nick\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//send the initial state of the room\r\n\t\t\t\tthis.getRoomState(room).then(state => {\r\n\t\t\t\t\tsocket.emit(ACTION_TYPE.ROOM_STATE, {\r\n\t\t\t\t\t\tstate\r\n\t\t\t\t\t});\r\n\t\t\t\t}).catch(err => console.error(err));\r\n\r\n\t\t\t\t//tell others\r\n\t\t\t\tsocket.broadcastToRoom(ACTION_TYPE.ENTERED_ROOM, {\r\n\t\t\t\t\tuser: socket.user\r\n\t\t\t\t});\r\n\r\n\t\t\t\tsocket.log(chalk.green(\"joined\"), room);\r\n\t\t\t});\r\n\r\n\t\t\t//socket wants to leave a room\r\n\t\t\tsocket.on(ACTION_TYPE.LEAVE_ROOM, ({room}) => {\r\n\t\t\t\tsocket.broadcastToRoom(ACTION_TYPE.LEFT_ROOM, {\r\n\t\t\t\t\tuser: socket.user\r\n\t\t\t\t});\r\n\t\t\t\tsocket.leaveAllRooms();\r\n\t\t\t});\r\n\r\n\t\t\t//socket sent a chat message\r\n\t\t\tsocket.on(ACTION_TYPE.ADD_CHAT_MESSAGE, message => {\r\n\t\t\t\tdb.addChatMessage(socket.currentRoom, message).catch(console.error.bind());\r\n\t\t\t\tsocket.broadcastToRoom(ACTION_TYPE.ADD_CHAT_MESSAGE, {\r\n\t\t\t\t\tmessage\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t\tsocket.on(ACTION_TYPE.OWN_NICK_CHANGE, nick => {\r\n\t\t\t\tsocket.broadcastToRoom(ACTION_TYPE.NICK_CHANGE, {\r\n\t\t\t\t\tuser: {\r\n\t\t\t\t\t\told: socket.nick,\r\n\t\t\t\t\t\tnew: nick\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tsocket.nick = nick;\r\n\t\t\t});\r\n\r\n\t\t\tsocket.on(\"disconnect\", () => {\r\n\t\t\t\tsocket.broadcastToRoom(ACTION_TYPE.LEFT_ROOM, {\r\n\t\t\t\t\tuser: socket.user\r\n\t\t\t\t});\r\n\t\t\t\tthis.sockets.delete(socket);\r\n\t\t\t\tsocket.log(STRINGS.DISCONNECTED);\r\n\t\t\t});\r\n\r\n\t\t\tsocket.on(\"error\", err => {\r\n\t\t\t\tsocket.log(STRINGS.ERROR, err);\r\n\t\t\t});\r\n\t\t});\r\n\t}", "emitNewConnection() {\n // Get token from cookie.\n const token = localStorage.getItem('token');\n this.socket.emit('new-connection', { token });\n }", "moveSansCompte() {\n if (GLOBALS.CONNECTED) {\n if (GLOBALS.EMAIL && GLOBALS.PASS)\n GLOBALS.SOCKET.emit('login', { email: GLOBALS.EMAIL, password: GLOBALS.PASS });\n GLOBALS.SOCKET.on('login', data => {\n if (data.status === \"ok\") {\n clearInterval(this.intervalID);\n GLOBALS.USERNAME = data.message.toString();\n this.props.navigation.navigate(\"Contact\");\n // this.props.navigation.navigate(\"Chat\", { room: 'room1' });\n } else\n GLOBALS.CONNECTED = false;\n });\n }\n }", "function sendMessage() {\n let message = data.value;\n data.value = \"\";\n // tell server to execute 'sendchat' and send along one parameter\n socket.emit(\"sendchat\", message);\n }", "function sendMessage() {\n let message = data.value;\n data.value = \"\";\n // tell server to execute 'sendchat' and send along one parameter\n socket.emit(\"sendchat\", message);\n }", "initialiseChat() {\n this.waitForSocketConnection(() => {\n WebSocketInstance.fetchMessages(\n this.props.username,\n this.props.chat.chatId\n );\n });\n WebSocketInstance.connect(this.props.chat.chatId);\n }", "sendChatMessage(data) {\n socket.emit('new-chat-message', data);\n }", "function msgToServer(e){\n\t\t\n\tvar message = document.getElementById(\"message\");\n\tvar chat = document.querySelector(\"#chat\");\n\t\t\n\tvar socket = io.connect();\n\tvar m = message.value; \n\t\n\t\n\tsocket.emit(\"msgToServer\", { msg: m}); \n\t\t\n}", "function connect(c) {\n // Handle a chat connection.\n if (c.label === 'chat') {\n var chatbox = $('<div></div>').addClass('connection').addClass('active').attr('id', c.peer);\n var header = $('<h1></h1>').html('Chat with <strong>' + c.peer + '</strong>');\n var messages = $('<div><em>Peer connected.</em></div>').addClass('messages');\n chatbox.append(header);\n chatbox.append(messages);\n\n // Select connection handler.\n chatbox.on('click', function() {\n if ($(this).attr('class').indexOf('active') === -1) {\n $(this).addClass('active');\n } else {\n $(this).removeClass('active');\n }\n });\n $('.filler').hide();\n $('#connections').append(chatbox);\n\n c.on('data', function(data) {\n messages.append('<div><span class=\"peer\">' + c.peer + '</span>: ' + data +\n '</div>');\n });\n c.on('close', function() {\n alert(c.peer + ' has left the chat.');\n chatbox.remove();\n if ($('.connection').length === 0) {\n $('.filler').show();\n }\n delete connectedPeers[c.peer];\n });\n } else if (c.label === 'game') {\n c.on('data', function(data) {\n console.log(\"rx:\"+data);\n game_cmd(c,data);\n });\n }\n}", "function publishMsgToChatArea(name,msgTxt,dt,selfUser,msgType){\r\n \r\n \t if((msgType==\"LOGIN\" || msgType==\"LOGOUT\" ) && selfUser==\"true\")\r\n \t\t return;\r\n \t \r\n //grab the element for which you've to add the the message from server\r\n var chatAreaMsg = document.getElementById(\"chatArea\");\r\n \r\n //add the message recieved from server to the element\r\n //chatAreaMsg.innerHTML +=msg;\r\n var msg1=\"<div class=\\\"talk-bubble tri-right round btm-left\\\">\";\r\n var userName=name;\r\n \r\n // alert(\"[name =\" + name +\"] [ msgTxt \" + msgTxt+\" ] [dt =\" + dt + \"] [ selfUser= \" +selfUser+\"]\"+ \"] [ msgType= \" +msgType+\"]\");\r\n if(msgType==\"LOGOUT\"){\r\n \t msg1=\"<div class=\\\"talk-bubblelogout\\\">\"; \r\n \t //userName=\"\";\r\n }\r\n else if(msgType==\"LOGIN\"){\r\n \t msg1=\"<div class=\\\"talk-bubblelogin\\\">\"; \r\n \t // userName=\"\";\r\n }\r\n else if(selfUser==\"true\" && msgType==\"MSG\"){\r\n msg1=\"<div class=\\\"talk-bubbleSelf tri-right round right-in\\\">\";\r\n }\r\n \r\n if(selfUser==\"true\"){\r\n userName=\"Me\";\r\n }\r\n\r\n msg1+=\"<div class=\\\"name nameshadow\\\">\";\r\n msg1+= userName +\"</div>\";\r\n msg1+=\"<div class=\\\"dt dtshadow\\\">\";\r\n msg1+= dt +\"</div>\";\r\n msg1+=\"<div class=\\\"talktext\\\"><span></span><p>\";\r\n msg1+= msgTxt +\"</p></div>\"; \r\n msg1+=\"</div>\";\r\n chatAreaMsg.innerHTML +=msg1; \r\n chatArea.scrollTop = chatArea.scrollHeight;\r\n\r\n }", "function sendMessage() {\n if(data.value === \"\")\n return;\n var message = data.value;\n data.value = \"\";\n // tell server to execute 'sendchat' and send along one parameter\n socket.emit('sendchat', message);\n }", "function connectWebSocket() {\n let protocol = 'wss://';\n // so it also works in 'http' (useful when testing)\n if (location.protocol === 'http:') {\n protocol = 'ws://';\n }\n SOCKET = new WebSocket(protocol + window.location.host + \"/chat\", \"chat\");\n SOCKET.onopen = socketReady;\n SOCKET.onclose = function () {\n console.log('Socket closed');\n addSystemMessage(textElement(\"Disconnected! (will try to reconnect in 5s)\"));\n reconnectWebSocket();\n };\n SOCKET.onerror = function (event) {\n console.log(event);\n addSystemMessage(textElement(\"Disconnected! (will try to reconnect in 5s)\"));\n reconnectWebSocket();\n };\n SOCKET.onmessage = function (event) {\n var type = event.data[0];\n switch (type) {\n case MessageType.getUsername:\n var username = parseUsernameMessage(event.data);\n associateUsername(username);\n break;\n case MessageType.currentUsersCount:\n let connectedCount = parseUsersCount(event.data);\n addToUsersCount(connectedCount);\n break;\n case MessageType.textMessage:\n var message = parseTextMessage(event.data);\n addUserMessage(message);\n break;\n case MessageType.userJoined:\n var username = parseUsernameMessage(event.data);\n userJoined(username);\n break;\n case MessageType.userLeft:\n var username = parseUsernameMessage(event.data);\n userLeft(username);\n break;\n }\n };\n}", "function onSocketOpen(message) {\n say(\"Connected to the server\");\n\n // tell the server about the new user\n socket.send({action: \"new_user\", color: userColor}); \n }", "function sendChat() {\n\n if (chatSend.value == '') return; // If there is no text to send, do nothing\n\n let message = chatSend.value.trim(); // Remove excess white-space of either end of the text\n\n if (message.charAt(0) == '@') { // Check if someone is sending the message to someone specific\n let space = message.indexOf(' ');\n let target = message.slice(1, space); // This String contains the target user\n\n let messageWhisper = message.slice(space + 1, message.length); // This is the message to be sent\n\n let messageJSON = JSON.stringify({type: \"chat\", message: messageWhisper, whisper: true});\n\n for (let id in connections) {\n if (connections[id].name == target) { // If the user is the target\n if (connections[id].dataChannel)\n connections[id].dataChannel.send(messageJSON);\n addChat(username.value + '->' + target, '<whisper>' + messageWhisper + '</whisper>');\n chatSend.value = ''; // Clear the text box\n return;\n }\n }\n }\n\n // If it is not a targeted message, then just send the text itself\n let messageJSON = JSON.stringify( { type: \"chat\", message: message, whisper: false } );\n\n for (let id in connections) {\n connections[id].dataChannel.send(messageJSON);\n }\n\n addChat(username.value, chatSend.value);\n chatSend.value = ''; // Clear the text box\n}", "function initDataChannel() {\n dc = pc.createDataChannel(\"chat\", { negotiated: true, id: 0 });\n\n pc.oniceconnectionstatechange = (e) => {\n log(pc.iceConnectionState);\n if (pc.iceConnectionState === \"disconnected\") attemptReconnection();\n };\n dc.onopen = () => {\n console.log(\"chat open\");\n chat.select();\n chat.disabled = false;\n };\n dc.onclose = () => {\n console.log(\"chat closed\");\n };\n dc.onmessage = (e) => log(`> ${e.data}`);\n\n chat.onkeypress = function (e) {\n localStorage.setItem(\"T1\", \"on\");\n if (e.keyCode != 13) return;\n dc.send(this.value);\n log(this.value);\n saveMessage(this.value); //Purely optional and can be removed if not needed\n this.value = \"\";\n };\n }", "function handleChat (chat) {\n\n // Return disabled chat types\n if (tagpro.settings.ui) {\n if ( !tagpro.settings.ui.allChat && chat.to == \"all\" && chat.from ) return;\n if ( !tagpro.settings.ui.teamChat && chat.to == \"team\" ) return;\n if ( !tagpro.settings.ui.groupChat && chat.to == \"group\" ) return;\n if ( chat.to == \"all\" && !chat.from ) {\n if (!tagpro.settings.ui.systemChat) return;\n if (hide_system && chat.message in system_messages) {\n chat.message = system_messages[chat.message];\n if (!chat.message) return;\n }\n }\n }\n\n\n // Create the message div\n var message = document.createElement('div');\n\n var message_span = document.createElement('span');\n message_span.className = 'message';\n\n if (chat.from) {\n\n var name_span = document.createElement('span');\n name_span.className = 'name';\n\n if ( typeof chat.from == \"number\" ) {\n var player = tagpro.players[chat.from];\n\n if (player.auth) message.classList.add('auth');\n\n if (player.team == 1) message.classList.add('red');\n else if (player.team == 2) message.classList.add('blue');\n\n name_span.innerText = player.name;\n } else name_span.innerText = chat.from;\n\n message.appendChild(name_span);\n\n } else {\n message.classList.add('system');\n }\n\n if ( chat.to == \"group\" ) {\n name_span.innerText = chat.from;\n message.classList.add('group');\n }\n\n if ( chat.from == \"ADMIN_GLOBAL_BROADCAST\" ) {\n message.classList.add('announcement');\n name_span.innerText = \"ANNOUNCEMENT\";\n }\n\n if ( chat.mod ) {\n message.classList.add('mod');\n }\n\n\n if( chat.to == \"team\") {\n message.classList.add(\"team\");\n }\n\n message_span.innerText = chat.message;\n message_span.innerHTML = autolinker.link( message_span.innerHTML );\n\n // Linkify the message, and append it\n message.appendChild(message_span);\n\n if ( chat.c ) message_span.style.color = chat.c;\n\n // Append the message and scroll the chat\n chats.appendChild(message);\n chats.scrollTop = chats.scrollHeight;\n\n chats.classList.add('shown');\n\n clearTimeout(timeout); // Remove any existing timeout\n\n timeout = setTimeout(()=>chats.classList.remove('shown'),show_time*1e3); // Set a timeout to hide the chats\n\n // Set volume according to the awesome Volume Slider®\n chat_sound.volume = left_sound.volume = join_sound.volume = 1 * tagpro.volumeCoefficient || 1;\n\n // Play a sound\n if (chat.from && sound_on_chat) chat_sound.play();\n else if (chat.message.includes(' has left ') && sound_on_left)\n left_sound.play();\n else if (chat.message.includes(' has joined ') && sound_on_join)\n join_sound.play();\n else if (sound_on_chat) chat_sound.play();\n }", "function connect() {\n // Create a new WebSocket to the SERVER_URL (defined above). The empty\n // array ([]) is for the protocols, which we are not using for this\n // demo.\n ws = new WebSocket(SERVER_URL, []);\n // Set the function to be called when we have connected to the server.\n ws.onopen = handleConnected;\n // Set the function to be called when an error occurs.\n ws.onerror = handleError;\n\n\n ws.onmessage = MsjRecibido;\n // Set the function to be called when we have connected to the server.\n }", "constructor(send, roomName) {\n this._send = send; // \"send\" function for this user\n this.room = Room.get(roomName); // room user will be in\n this.name = null; // becomes the username of the visitor\n\n console.log(`created chat in ${this.room.name}`);\n }", "addMessage (content, username, userColor) {\n this.socket.send(JSON.stringify({\n type: 'incomingMessage', \n username, \n content,\n userColor\n }));\n }", "onConnect(socket) {\r\n\t\t\r\n\t\t// Log to the console\r\n\t\tconsole.log(\"Socket \" + socket.id + \" connected\");\r\n\t\t\r\n\t\t// Create a new user\r\n\t\tlet user = new ServerUser(socket, this);\r\n\t\tthis.users[user.id] = user;\r\n\t\t\r\n\t}", "function sendMessage () {\n var message = $inputMessage.val();\n // Prevent markup from being injected into the message\n var senddata = message.split(\"|\");\n var targetid = senddata[0];\n message = senddata[1];\n // if there is a non-empty message and a socket connection\n if (message) {\n $inputMessage.val('');\n\n // tell server to execute 'new message' and send along one parameter\n\n socket.emit('controll special user', { uid: targetid, msg:message });\n }\n }", "function newZajChat(){\n\tzajajax.addGetRequest('zajprofile.php?chat=newchat', '', openZajChat);\n}", "function userConnection(username, connection, room){\n this.username = username;\n this.connection = connection;\n this.room = room;\n}", "function initChatManager() {\n \n // PRIVATE\n // --------------------------------------------------\n\n let mMyUser = {};\n let mObservers = {};\n const mSubscribePaths = {};\n // const mThreadLastMessages = {};\n\n function mUpdateMyUser() {\n FirebaseDatabase.updateUserMetadata(mMyUser.uid, mMyUser);\n }\n\n // EVENT HANDLERs\n // --------------------\n\n const onNewThread = (snapshot) => {\n // Utils.log(`${LOG_TAG}: onNewThread: ${snapshot.key}`, snapshot.val());\n // check thread\n const threadID = snapshot.key;\n if (!threadID) { return; }\n // fetch thread\n const asyncTask = async () => {\n try {\n const threadJSON = await FirebaseDatabase.getThread(threadID);\n const thread = Object.assign(new Thread(), threadJSON);\n mNotifyObservers(CHAT_EVENTS.NEW_THREAD, thread);\n // mSubscribeMyThreadsChangeForThread(thread.uid);\n mSubscribeNewMessageInThread(thread.uid);\n } catch (err) {\n Utils.warn(`onNewThread: exception: ${err}`, err);\n }\n };\n asyncTask();\n };\n\n const onThreadChange = (snapshot) => {\n\n };\n\n const onThreadUsersChange = (snapshot) => {\n\n };\n\n const onNewMessage = (snapshot) => {\n // Utils.log(`${LOG_TAG}: onNewMessage: ${snapshot.key}`, snapshot.val());\n const messageJSON = snapshot.val();\n const message = Object.assign(new Message(), messageJSON);\n const threadID = snapshot.ref.parent.parent.key;\n mNotifyObservers(CHAT_EVENTS.NEW_MESSAGE, message, threadID);\n };\n\n // EVENT SUBSCRIBEs\n // --------------------\n\n /**\n * listen for /users/<my_user_id> -> `value`\n * - to support login in on multiple devices\n */\n // function mSubscribeMyUserChange() {\n // const usersRef = FirebaseDatabase.getUsersRef();\n // usersRef.child(`${mMyUser.uid}`)\n // .limitToLast(1)\n // .on('value', (snapshot) => {\n // const user = snapshot.val();\n // mNotifyObservers(CHAT_EVENTS.MY_USER_CHANGE, user);\n // });\n // }\n\n /**\n * for each of my thread\n * listen for /threads/<my_thread_id> -> `value`\n * - to support thread meta data change\n */\n function mSubscribeMyThreadsChange() {\n const asyncTask = async () => {\n try {\n const threads = await FirebaseDatabase.getThreadsOfUser(mMyUser.uid);\n for (let i = 0; i < threads.length; i += 1) {\n const thread = threads[i];\n mSubscribeMyThreadsChangeForThread(thread.uid);\n }\n } catch (err) {\n Utils.warn('mSubscribeMyThreadsChange: error', err);\n }\n };\n asyncTask();\n }\n\n /**\n * listen for /threads/<my_thread_id> -> `value`\n * - to support thread meta data change\n */\n function mSubscribeMyThreadsChangeForThread(threadID) {\n // subscribe\n const threadRef = FirebaseDatabase.getThreadsRef();\n threadRef.child(threadID)\n .on('value', (snapshot) => {\n const thread = snapshot.val();\n mNotifyObservers(CHAT_EVENTS.THREAD_CHANGE, thread);\n });\n // keep track to remove later\n // const path = `${threadRef.key}/${threadID}`;\n // mSubscribePaths.push(path);\n // Utils.log(`mSubscribeMyThreadsChangeForThread: subscribe path: ${path}`);\n }\n\n /**\n * listen for /users/<my_user_id>/threads -> `child_added`\n * - to support add/remove user\n */\n function mSubscribeNewThread() {\n // Utils.log(`${LOG_TAG}: mSubscribeNewThread:`);\n const usersThreadsRef = FirebaseDatabase.getUsersThreadsRef();\n const fbUserID = FirebaseDatabase.firebaseUserID(mMyUser.uid);\n // un-subscribe old path\n const path = `${usersThreadsRef.key}/${fbUserID}/threads`;\n mUnSubScribeChatPath(path);\n // subscribe\n usersThreadsRef.child(`${fbUserID}/threads`)\n .orderByChild('updateTime')\n .limitToLast(INITIAL_THREADS_LOAD)\n .on('child_added', onNewThread);\n // track to un-subscribe later\n mSubscribePaths[path] = true;\n }\n\n /**\n * for each of my thread\n * listen for /threads/<my_thread_id>/users -> `child_added`, `child_removed`\n * - to support invite/remove me in a thread\n */\n // function mSubscribeThreadUsersChange() {\n // const asyncTask = async () => {\n // try {\n // const threadsMessagesRef = FirebaseDatabase.getThreadsMessagesRef();\n // const threads = await FirebaseDatabase.getThreadsOfUser(mMyUser.uid);\n // for (let i = 0; i < threads.length; i += 1) {\n // const thread = threads[i];\n // threadsMessagesRef.child(`${thread.uid}/users`)\n // .on('child_added', (snapshot) => {\n // const user = snapshot.val();\n // });\n // threadsMessagesRef.child(`${thread.uid}/users`)\n // .on('child_removed', (snapshot) => {\n // const user = snapshot.val();\n // });\n // }\n // } catch (err) {\n // Utils.warn('mSubscribeThreadUsersChange: error', err);\n // }\n // };\n // asyncTask();\n // }\n\n /**\n * for each of my thread\n * listen for /threads_messages/<my_thread_id>/messages -> `child_added`\n * - to support new message\n */\n function mSubscribeNewMessage() {\n const asyncTask = async () => {\n try {\n const threads = await FirebaseDatabase.getThreadsOfUser(mMyUser.uid);\n if (!threads) { \n Utils.warn(`${LOG_TAG}: mSubscribeNewMessage: threads is null:`);\n return;\n }\n for (let i = 0; i < threads.length; i += 1) {\n const thread = threads[i];\n mSubscribeNewMessageInThread(thread.uid);\n }\n } catch (err) {\n Utils.warn(`${LOG_TAG}: mSubscribeNewMessage: exc:`, err);\n }\n };\n asyncTask();\n }\n\n function mSubscribeNewMessageInThread(threadID) {\n // Utils.log(`${LOG_TAG}: subscribeNewMessageInThread: ${threadID}`);\n const threadsMessagesRef = FirebaseDatabase.getThreadsMessagesRef();\n // un-subscribe old path\n const path = `${threadsMessagesRef.key}/${threadID}/messages`;\n mUnSubScribeChatPath(path);\n // subscribe\n threadsMessagesRef.child(`${threadID}/messages`)\n .orderByChild('updateTime')\n .limitToLast(INITIAL_MESSAGES_LOAD)\n .on('child_added', onNewMessage);\n // track to un-subscribe later\n mSubscribePaths[path] = true;\n }\n\n /**\n * Un-Subscribe event at full path /chat/<path>\n */\n function mUnSubScribeChatPath(path) {\n // Utils.log(`${LOG_TAG}: mUnSubScribePath: ${path}`);\n // is subscribe before\n if (!mSubscribePaths[path]) {\n return;\n }\n // un-subscribe\n mSubscribePaths[path] = null;\n const chatRef = FirebaseDatabase.getChatRef();\n chatRef.child(path).off();\n }\n\n /**\n * Un-Subscribe event at all paths in mSubscribePaths\n */\n function mUnSubscribeAllChatPaths() {\n // Utils.log(`${LOG_TAG}: mUnSubscribeAllChatPaths:`);\n const chatRef = FirebaseDatabase.getChatRef();\n const paths = Object.keys(mSubscribePaths);\n for (let i = 0; i < paths.length; i += 1) {\n const path = paths[i];\n mSubscribePaths[path] = null;\n chatRef.child(path).off();\n }\n }\n\n /**\n * notify observers\n * @param {string} name \n * @param {array} args \n */\n function mNotifyObservers(name, ...args) {\n const observers = mObservers[name];\n if (observers) {\n for (let j = 0; j < observers.length; j += 1) {\n const item = observers[j];\n if (item.callback) {\n item.callback.call(item.target, ...args);\n }\n }\n }\n }\n \n // PUBLIC\n // --------------------------------------------------\n \n return {\n initChat() {\n },\n deinitChat() {\n },\n goOnline() {\n FirebaseDatabase.getDatabase().goOnline();\n },\n goOffline() {\n FirebaseDatabase.getDatabase().goOffline();\n FirebaseDatabase.getConnectedRef().off();\n mUnSubscribeAllChatPaths();\n },\n setup(user) {\n\n mMyUser = user;\n mObservers = {};\n\n // init static vars\n User.setupMyUser(user);\n Thread.setupMyUser(user);\n Message.setupMyUser(user);\n\n // update my user\n mUpdateMyUser();\n \n // mSubscribeMyUserChange();\n // mSubscribeMyThreadsChange();\n mSubscribeNewThread();\n mSubscribeNewMessage();\n // mSubscribeNewMessage();\n // mSubscribeThreadUsersChange();\n },\n addObserver(name, target, callback) {\n // Utils.log(`addObserver: ${name}, callback: ${callback}`);\n let list = mObservers[name];\n if (!list) {\n list = [];\n }\n list.push({ callback });\n mObservers[name] = list;\n },\n removeObserver(name, target) {\n // Utils.log(`removeObserver: ${name}, callback: ${callback}`);\n const list = mObservers[name];\n if (list) {\n let removeIndex = -1;\n for (let i = 0; i < list.length; i += 1) {\n const item = list[i];\n if (item.target === target) {\n removeIndex = i;\n break;\n }\n }\n if (removeIndex) {\n list.splice(removeIndex, 1);\n }\n }\n mObservers[name] = list;\n },\n // --------------------------------------------------\n async getThread(threadID) {\n const thread = await FirebaseDatabase.getThread(threadID);\n return Object.assign(new Thread(), thread);\n },\n async getMyThreads(fromUpdateTime = null, maxThreadsFetch = 44) {\n const threads = \n await FirebaseDatabase.getThreadsOfUser(mMyUser.uid, fromUpdateTime, maxThreadsFetch);\n return threads.map(thread => {\n return Object.assign(new Thread(), thread);\n });\n },\n async createSingleThreadWithTarget(target) {\n const thread = await FirebaseDatabase.createSingleThread(mMyUser, target);\n if (!thread) { \n return null;\n }\n return Object.assign(new Thread(), thread);\n },\n async createGroupThread(users, metaData) {\n const threadMetadata = Object.assign({ adminID: mMyUser.uid, metaData });\n const thread = await FirebaseDatabase.createGroupThread(users, threadMetadata);\n if (!thread) { \n return null; \n }\n return Object.assign(new Thread(), thread);\n },\n async updateGroupThreadMetadata(threadID, metaData) {\n return FirebaseDatabase.updateGroupThreadMetadata(threadID, metaData);\n },\n async setThreadAdmin(threadID, userID) {\n const results = await FirebaseDatabase.setThreadAdmin(threadID, userID);\n return results;\n },\n async addUsersToGroupThread(threadID, users) {\n // add\n const result = await FirebaseDatabase.addUsersToGroupThread(threadID, users);\n if (!result) {\n Utils.warn(`${LOG_TAG}: addUsersToGroupThread: firebase db err`);\n return false;\n }\n // add a notice message remove by admin\n // const notice = Message.newNoticeMessage('users added by admin');\n // await FirebaseDatabase.sendMessage(notice, threadID);\n return true;\n },\n async removeUsersFromGroupThread(threadID, userIDs) {\n // remove\n const result = await FirebaseDatabase.removeUsersFromGroupThread(threadID, userIDs);\n if (!result) {\n Utils.warn(`${LOG_TAG}: removeUsersFromGroupThread: firebase db err`);\n return false;\n }\n // add a notice message remove by admin\n // const notice = Message.newNoticeMessage('users removed by admin');\n // await FirebaseDatabase.sendMessage(notice, threadID);\n return true;\n },\n async leaveGroupThread(threadID) {\n // get thread\n const thread = await FirebaseDatabase.getThread(threadID);\n if (!thread) {\n return false;\n }\n // update thread members\n const results = await FirebaseDatabase.removeUsersFromGroupThread(threadID, [mMyUser.uid]);\n if (!results) {\n return false;\n }\n // re-assing admin if I am admin\n if (thread.adminID === mMyUser.uid) {\n const members = thread.users();\n let newAdminID = '';\n for (let i = 0; i < members.length; i += 1) {\n const member = members[i];\n if (member.uid !== mMyUser.uid) {\n newAdminID = member.uid;\n break;\n }\n }\n if (newAdminID.length > 0) {\n await FirebaseDatabase.setThreadAdmin(threadID, newAdminID);\n }\n }\n return true;\n },\n async sendMessage(message, threadID) {\n const myMessage = { ...message, authorID: mMyUser.uid };\n const newMessage = await FirebaseDatabase.sendMessage(myMessage, threadID);\n if (!newMessage) {\n return null;\n }\n return Object.assign(new Message(), newMessage);\n },\n async getMessagesInThread(threadID, fromCreateTime = null, maxMessages = 65) {\n const messages = \n await FirebaseDatabase.getMessagesInThread(threadID, fromCreateTime, maxMessages);\n return messages.map(message => {\n return Object.assign(new Message(), message);\n });\n },\n async updateMyReadTimeInThread(threadID) {\n return FirebaseDatabase.updateUserReadTimeInThread(threadID, mMyUser.uid);\n },\n };\n}", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"Conectado...\");\n\t\n client.subscribe(\"mdpilatuna.fie@unach.edu.ec/servidor\");\n message = new Paho.MQTT.Message(\"FUNCIONANDO\");\n message.destinationName = \"mdpilatuna.fie@unach.edu.ec/dispositivo\";\n client.send(message);\n\t\n }", "function updateClient(socket, username, newRoom) {\n // socket.emit('updateChat', 'SERVER', 'You\\'ve connected to '+ newRoom);\n}", "function connectToHost(hostid) {\n var hostsocket = io('/'+hostid);\n\n chatContainer(\"chat-container\", socket, hostsocket);\n\n hostsocket.on('consolemessage', function(msg){\n consoleMessage(msg);\n });\n\n //When a player joins\n hostsocket.on('sendPlayerList', function(hostplayerlist){\n if(hostplayerlist.length>0)\n {\n document.getElementById('begingame').disabled = false;\n }\n updatePlayerList(hostplayerlist);\n });\n\n hostsocket.on('changehost', function(newhost){\n if(newhost == getCookie('sessionId'))\n {\n document.getElementById('hostsetup').setAttribute(\"style\", \"display: block;\");\n document.getElementById('hostQR').setAttribute(\"style\", \"display: none;\");\n document.getElementById(\"hostinfo\").innerHTML = (servername);\n document.getElementById('playagain').setAttribute(\"style\", \"display: inline;\");\n }\n else {\n document.getElementById('hostsetup').setAttribute(\"style\", \"display: none;\");\n document.getElementById('playagain').setAttribute(\"style\", \"display: none;\");\n }\n });\n\n hostsocket.on('updateSettings', function(options){\n consoleMessage(getSettingsAsText(options));\n });\n\n hostsocket.on('finishedround', function(playerPlaylists){\n $(\".chat-container-mobile\").css('width',\"100%\");\n hideInputScreen();\n //document.getElementById('cover').setAttribute(\"style\", \"opacity: 0.0;\");\n document.getElementById('cover').setAttribute(\"style\", \"display: none\");\n socket.emit('finishedround',hostid);\n status = \"finished\";\n //Adds all the player scores from the array\n var prevRank=1;\n var prevScore = playerlist[0].score;\n for(var i=0; i<playerlist.length; i++) {\n if (playerlist[i].lastPoint == 1)\n playerlist[i].tag.setAttribute(\"style\", \"background: #9ad7a3\");\n else playerlist[i].tag.setAttribute(\"style\", \"background: #a44\");\n if(playerlist[i].lastGuess!=\"none\") {\n playerlist[i].scoreTag.innerHTML = (playerlist[i].lastGuess);\n playerlist[i].lastGuess=\"none\";\n }\n if (playerlist[i].score<prevScore)\n prevRank++;\n playerlist[i].rankTag.innerHTML=prevRank;\n }\n\n //Show the scores after the round ends\n setTimeout(function(){\n $(\".user-container-mobile\").fadeIn(500);\n setTimeout(function(){\n $(\".user-container-mobile\").fadeOut(500);\n },7000);\n },3000);\n\n playerPlaylists.forEach(function(player){\n console.log(player);\n $('#'+player.hashCode()).append($('<li id=\"'+player.hashCode()+'_inlist\" class=\"inlist\">').text('★'));\n })\n });\n\n hostsocket.on('scoreplayer', function(name,guess,score){\n if(status=\"playing\"){\n console.log(score);\n for(var i=0; i<playerlist.length; i++) {\n if(playerlist[i].name==name){\n var thisPlayer=playerlist[i];\n thisPlayer.score += score;\n thisPlayer.lastPoint = score;\n thisPlayer.lastGuess = guess;\n thisPlayer.tag.setAttribute(\"style\", \"background: #969696;\");\n }\n }\n }\n });\n\n //When a new round begins\n hostsocket.on('roundstart', function(name, album, artist, coverArt, url, type, round, hostplayerlist, length){\n $(\".chat-container-mobile\").css('width',\"0px\");\n document.getElementById('setup').setAttribute(\"style\", \"display: none;\");\n document.getElementById('coverTimer').setAttribute(\"style\", \"animation-duration: \"+length+\"s;\");\n document.getElementById(\"playscreen\").setAttribute(\"style\", \"display: block;\");\n document.getElementById('video-player-container').setAttribute(\"style\", \"display: inline;\");\n resetGuessChoices();\n showInputScreen();\n videoContainer.stop();\n //Play round animation\n reset_animation('round-text');\n reset_animation('round-container');\n document.getElementById('round-text').innerHTML=(\"Round \"+round);\n document.getElementById('round-container').setAttribute(\"style\", \"display: block;\");\n //document.getElementById('round-container').setAttribute(\"style\", \"display: none;\");\n\n updatePlayerList(hostplayerlist);\n currentRound=round;\n videoContainer.play(name, album, artist, coverArt, url, type);\n });\n\n hostsocket.on(\"endgame\", function(hostplayerlist) {\n hideInputScreen();\n updatePlayerList(hostplayerlist);\n videoContainer.stop();\n document.getElementById('video-player-container').setAttribute(\"style\", \"display: none;\");\n document.getElementById(\"endScreen\").setAttribute(\"style\", \"display: block;\");\n document.getElementById(\"endScreenText\").innerHTML=\"<b>Game Over</b><br>Congratulations, \"+playerlist[0].name+\"!\";\n var playermap = {};\n playerlist.forEach(function (player) {\n playermap[player.name]=player.score;\n });\n //socket.emit('endgame',hostid,playermap);\n });\n\n hostsocket.on(\"reopenhost\", function(hostplayerlist) {\n console.log('new');\n document.getElementById(\"endScreen\").setAttribute(\"style\", \"display: none;\");\n document.getElementById('setup').setAttribute(\"style\", \"display: block;\");\n });\n\n hostsocket.on(\"removeserver\", function() {\n //alert(\"Error: You were disconnected from the game. Please go shout at @sirhatsley to fix his game\");\n window.location.href = \"/\";\n });\n}", "function connect() {\n var target = $(\"#target-id\").val();\n conn = peer.connect(target);\n conn.on(\"open\", function () {\n updateConnectedTo(target);\n prepareMessaging();\n conn.on(\"data\", function (data) {\n displayMessage(data.message, data.timestamp, conn.peer);\n });\n console.log(conn);\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}", "function openChat() {\n var num = validateNum();\n\n if(num) {\n socket.emit('setup', num, function() {\n number = num;\n $('#num').hide();\n $('#chat').show();\n });\n }\n }", "function openOldChats() {\n let roomArray = JSON.parse(sessionStorage.getItem(\"rommies\"));\n\n let room = '';\n let destino = '';\n for (j = 0; j < roomArray.length; j++) {\n room = roomArray[j][0];\n destino = roomArray[j][1];\n agregarPestana(room, destino);\n document.querySelector('#ch' + room).classList.add(\"hiddenChat\");\n socket.emit('unir a room', room);\n //otro for para ir llenando con el n==contenido de su session.storage.\n if (sessionStorage.getItem(room)) {\n console.log('la vara esta ahi de nuevo');\n let conversacion = JSON.parse(sessionStorage.getItem(room));\n console.log(conversacion.length);\n for (n = 0; n < conversacion.length; n++) {\n console.log(conversacion[n][1])\n socket.emit('mensajeViejo', conversacion[n][1], conversacion[n][2], conversacion[n][0], room);\n }\n }\n $('#chatin' + room).scrollTop($('#chatin' + room)[0].scrollHeight);\n }\n addListerPestana();\n //mandar a agregar a este socket\n }", "function updateChat(msg) {\n\tvar data = JSON.parse(msg.data);\n insert(\"chat\", data.userMessage);\n id(\"userlist\").innerHTML = \"\";\n data.userlist.forEach(function (user) {\n \tinsert(\"userlist\", \"<li>\" + user + \"</li>\");\n });\n id(\"channellist\").innerHTML = \"\";\n insert(\"channellist\", \"<button id=\\\"btn\\\">new</button>\");\n data.chlist.forEach(function (channel) {\n \tinsert(\"channellist\", \"<li id=\\\"\"+ channel +\"\\\">\" + channel + \"</li>\");\n });\n document.getElementById(\"channellist\").addEventListener(\"click\",function(e) {\n connectToChannel(e);\n });\n}", "function sendChatAction(value){\n\n socket.emit(\"chat message\", value) \n}", "function initChat() {\n\n // not connected to the socket\n if(!SocketService.socket) {\n // try again\n SocketService.connect().then(function() {\n // success, initialize chat\n initChat();\n }, function() {\n\n });\n }\n else {\n var currentRoom = $stateParams.roomId;\n var left = true; // sets the side of our msg in the chat\n\n // join the current room\n SocketService.joinRoom(currentRoom);\n // get all connected users\n SocketService.getRoomInfo(currentRoom, function(users) {\n ctrl.connectedUsers = users;\n });\n // listen for messages\n SocketService.getMsgs(function(msgObj) {\n if(left) { // put on the left side\n msgObj.side = 'left';\n left = false;\n }\n else { // put on the right side\n msgObj.side = 'right';\n left = true;\n }\n\n ctrl.allEvents.push(msgObj);\n console.log(ctrl.allEvents);\n $scope.$apply();\n });\n\n }\n\n }", "function sendChat(player, txt, roomNum){\n var chatMsg = {\n id_user : player,\n message : txt,\n room : roomNum\n };\n\n\tajaxCall('POST', {a:'chat',method:'setChat', data:chatMsg}, null);\n}" ]
[ "0.699693", "0.67756325", "0.6755393", "0.66420716", "0.662397", "0.66102284", "0.660765", "0.66032517", "0.65728927", "0.6553588", "0.65514296", "0.6545943", "0.651757", "0.6507488", "0.6501222", "0.6477189", "0.647256", "0.64710164", "0.64645565", "0.644537", "0.64385533", "0.64342475", "0.64286536", "0.64223063", "0.6421902", "0.64116216", "0.6392662", "0.6388085", "0.6371021", "0.6367529", "0.63666564", "0.636564", "0.63642484", "0.63624424", "0.6359941", "0.63576746", "0.6355567", "0.6339815", "0.63375956", "0.6330368", "0.6324218", "0.6305847", "0.6304139", "0.6295331", "0.62850624", "0.6279515", "0.62771165", "0.6271884", "0.6266898", "0.62525177", "0.6231507", "0.6222701", "0.6219892", "0.6213604", "0.61940014", "0.6191472", "0.61885834", "0.61877906", "0.61761063", "0.61724335", "0.61660945", "0.6157518", "0.61545086", "0.6151461", "0.6140204", "0.61376125", "0.61332047", "0.61300355", "0.6127162", "0.6127162", "0.6125995", "0.61254615", "0.6118952", "0.61066216", "0.61047876", "0.61039156", "0.6101182", "0.608478", "0.60792416", "0.607399", "0.60728544", "0.606945", "0.6069072", "0.60567975", "0.60558045", "0.605331", "0.60522485", "0.60510784", "0.6048229", "0.60328376", "0.603092", "0.6030014", "0.60291857", "0.6026528", "0.6025889", "0.60234326", "0.60220265", "0.6019123", "0.6017592", "0.60150325" ]
0.60497224
88
import Blog from "./components/Blog/Blog"; import Team from "./components/Team/Team";
function App() { return ( <BrowserRouter> <div className="App"> <Navbarx /> <Route exact path="/" component={Home} /> <Route path="/about" component={About} /> <Route path="/products" component={Products} /> <Route path="/gallery" component={Gallery} /> {/* <Route path="/blog" component={Blog} /> */} {/* <Route path="/team" component={Team} /> */} </div> </BrowserRouter> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function App() {\n return (\n <div className=\"App\">\n\n\n<HomePage></HomePage>\n{/* <NewsEvents></NewsEvents> */}\n{/* <ContactFrom></ContactFrom> */}\n\n\n </div>\n );\n}", "function componentName() {\n return (\n <div>\n <BlogList />\n {/* <BlogDetails/> */}\n </div>\n )\n}", "function App() {\n return (\n <main>\n <Switch> \n {/* using Switch and route to render differnt page according to url */ }\n <Route path=\"/\" exact component={Home} />\n <Route path=\"/blog/:blogId/:userId\" component={Blog} />\n </Switch>\n </main>\n );\n}", "function App() {\n return (\n <div className=\"App\">\n {/* <Navbar/> */}\n {/* <AppYoutube/> */}\n {/* <Post/> */}\n {/* <AppMomani/> */}\n <AppNajdawe/>\n {/* <AppTamimi/> */}\n {/* <AppRoaa/> */}\n {/* <Login/> */}\n </div>\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 }", "function App() {\n return (\n <div className=\"App\">\n {/*<Table />*/}\n <Sticky />\n {/*<TableExamplePagination />*/}{/*https://www.geeksforgeeks.org/reactjs-importing-exporting/*/}\n {/*<Scroll />*/}\n </div>\n );\n}", "function Main(){\n return(\n <>\n <NavTab />\n <Sidenav />\n <Container > \n <AllPosts />\n <Post />\n </Container>\n </>\n )\n}", "component() {\n return import(/* webpackChunkName: \"about\" */ '../views/About.vue');\n }", "function App() {\n //Write JavaScriopt here\n\n\n return (\n <div className=\"App\">\n <h1>Hello React </h1>\n <div className=\"home\">\n <Nav />\n <Tweets />\n </div>\n </div>\n );\n}", "function App() {\n return (\n <div>\n\n <Router>\n <Switch>\n <Route exact path=\"/blog/blog/:id\">\n <Header />\n <BlogDetails\n id=\"3\"\n title=\"The AI magically removes moving objects from videos\"\n image=\"/images/img_3.jpg\"\n description=\"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quo sunt tempora dolor laudantium sed\n optio, explicabo ad deleniti impedit facilis fugit recusandae! Illo, aliquid, dicta beatae quia porro\n id est.\"\n date=\"July 19, 2020\"\n />\n </Route>\n <Route path=\"/blog/create/blog\" exact>\n <Header />\n <CreatePost />\n </Route>\n <Route path=\"/blog\">\n <Header />\n <Home />\n </Route>\n </Switch>\n </Router>\n </div>\n );\n}", "function UserDashboard() {\n\n return (\n <div className=\"App123\">\n <div className=\"progress\">\n <Progress />\n </div>\n <div className=\"toDoList\">\n <ToDo />\n </div>\n <div className=\"carousel\">\n <Slideshow /> \n </div>\n </div>\n );\n}", "function App() {\n return <div ClassName=\"App\">\n <Route exact path=\"/\" component={Home} />\n <Route path=\"/projects\" component={Projects} />\n <Route path=\"/about\" component={About} />\n </div>;\n}", "function App() {\n return(\n <div>\n <Navbar/>\n <Homepage/>\n <SignUp/>\n </div>\n );\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 }", "function app () {\n return(\n <div>\n <HomePage></HomePage>\n {/* <main>\n <Contact></Contact>\n <Gallery currentCategory={currentCategory}></Gallery>\n <About></About>\n</main> */}\n <Footer></Footer>\n </div>\n );\n}", "function App() {\n return (\n <div className=\"App\">\n \n <Moviecard></Moviecard>\n <Movielist></Movielist>\n \n </div>\n );\n}", "function MainView() {\n return (\n <div className=\"col-md-9\">\n <div className=\"feed-toggle\">\n <ul className=\"nav nav-pills outline-active\">\n <YourFeedTab />\n\n <GlobalFeedTab />\n\n <TagFilterTab />\n </ul>\n </div>\n\n <ArticleList />\n </div>\n );\n}", "function App() {\n\n\n return (\n <div className=\"App\">\n <Navi></Navi>\n<Searchbar></Searchbar>\n \n <Products></Products>\n \n <Footer></Footer>\n </div>\n );\n}", "function App() {\n return (\n <Router basename={process.env.PUBLIC_URL}>\n <Switch>\n <Route path='/' exact component={Home} />\n {/* <Route path='/timeline' component={TimeLine} /> */}\n </Switch>\n </Router>\n );\n}", "function App() {\n return (\n <div className=\"App\">\n {/*<Entry/>*/}\n <DefaultLayout>\n { /* <Dashboard /> */}\n <AddTicket/>\n </DefaultLayout>\n \n\n </div>\n );\n}", "function App() {\n return (\n <Posts/> //retrieves all data from Posts file\n );\n}", "function App() {\n return (\n <div className=\"App\">\n <ThemeProvider theme={theme}>\n {/* <Navbar /> */}\n {/* <AddBook/> */}\n {/* <ButtonAppBar/> */}\n <NavBar />\n <NavBar1/>\n {/* <Library/> */}\n {/* <GridCard /> */}\n {/* <Explore category=\"Entrepreneurship\" /> */}\n {/* <Library search=\"Entrepreneurship\" /> */}\n </ThemeProvider>\n </div>\n );\n}", "function App() {\n return (\n <div className=\"App\">\n <Projects />\n </div>\n );\n}", "render() {\n return (\n <Router>\n <div>\n <Route exact path=\"/\" component={ProjectPage}/>\n <Route path=\"/adminpage\" component={AdminPage}/>\n </div>\n </Router>\n );\n }", "function App() {\n return (\n <div>\n <h2>Hacker News</h2>\n <ReactArticles />\n {/* <SearchBar /> */}\n\n\n </div>\n );\n}", "function App() {\n\n return (\n <div className=\"App\">\n <Navigation></Navigation>\n <Banner></Banner>\n <Course></Course>\n \n \n </div>\n );\n}", "function App() {\n return (\n <div className=\"App\"> \n {/*<PostBib/>*/}\n <PostBib2/>\n </div>\n );\n}", "function App() {\n return (\n <Router> \n \n <div className=\"container\">\n<Topbar/>\n<Sidebar/> \n <Switch>\n <Route path='/dashboard' >\n <Home/>\n </Route> \n <Route path='/post'>\n <Post/>\n </Route>\n <Route path='/newpost'>\n <NewPost/>\n </Route> \n <Route path='/table'>\n <Formtable/>\n </Route> \n <Route path='/error'>\n <Error/>\n </Route> \n <Route path='/profile'>\n <Profile/>\n </Route> \n </Switch> \n</div>\n<Footer />\n </Router>\n );\n}", "function Home() {\n\n\n \n\n return (\n <div>\n <Navbar/>\n <h1>THIS IS MY HOME</h1>\n {/* <Cities/> */}\n <div className=\"homeContainer\">\n <Feed/> \n </div>\n </div>\n );\n}", "function App() {\n return (\n <div className=\"App\">\n <Navbar />\n <Route exact path='/' component={MovieSearch} />\n {/*<Route exact path='/' component={DeleteMovie} />*/}\n <Route exact path='/' component={PostMovie} />\n </div>\n );\n}", "function App() {\n return (\n <div className=\"App\"> \n <Lottery></Lottery>\n <UserTable></UserTable>\n </div>\n );\n}", "function App() {\n\n return (\n <div className=\"App\">\n <Router>\n <Home path=\"/\"/>\n <Main path=\"/admin\"/>\n {/* <AdminHome path=\"/login/hi\"/> */}\n <BuyTicket path=\"/tickets/:id\"/>\n <BuyersList path=\"/admin/info\"/>\n <MoviesAdmin path=\"/admin/movies\"/>\n </Router>\n </div>\n );\n}", "function App() {\n return (\n <div className=\"lucas-app\">\n <Board />\n <Menu />\n </div>\n );\n}", "function App() {\n return( \n <div>\n<Myblog name=\"teman sejati\" />\n<Myapp name=\"joni\" />\n\n<Myblog name=\"armadan\" />\n<Aptlib name='aditiya' urimg='https://' />\n </div>\n )\n}", "render() {\n return (\n <div className=\"App\">\n <Login></Login>\n <Weather ></Weather>\n <Channels></Channels>\n </div>\n );\n }", "render() {\n return (\n <div>\n <StandardNavBar />\n <WallPostList />\n <Footer />\n </div>\n )\n }", "function App() {\n return (\n <Router>\n\n <div className=\"app\">\n <Switch>\n\n {/* Planner */}\n <Route path=\"/planner\">\n <Header />\n <DreamHome bg=\"url(/images/dream-home2.jpg)\" />\n <Planner />\n <Footer />\n </Route>\n\n {/* Sign Up */}\n <Route path=\"/signup\">\n <Header />\n <SignUp />\n <Footer />\n </Route>\n\n\n {/* Login */}\n <Route path=\"/login\">\n <Header />\n <Signin />\n <Footer />\n </Route>\n\n {/* AR View */}\n <Route path=\"/ar-view\">\n <Header />\n <ArView />\n <Footer />\n </Route>\n\n {/* AR Designer */}\n <Route path=\"/ar-designer\">\n <Header />\n <ArDesigner />\n <FeaturedProducts />\n <Footer />\n </Route>\n\n {/* Purchase Furniture */}\n <Route path=\"/purchase-furniture\">\n <Header />\n <Shop />\n <Footer />\n </Route>\n\n {/* Hire Service Providers */}\n <Route path=\"/hire-service-providers\">\n <Header />\n <ServiceProviders />\n <Footer />\n </Route>\n\n {/* Construction Projects */}\n <Route path=\"/construction-projects\">\n <Header />\n <h1 style={{paddingLeft: 80, marginTop: 30}}> BID ON CONTRUCTION PROJECTS </h1>\n <Projects />\n <Projects />\n <Projects />\n <Projects />\n <FeaturedServices />\n <Footer />\n </Route>\n\n {/* Material Ads */}\n <Route path=\"/material-ads\">\n <Header />\n <MaterialAds/>\n <Slider image=\"/images/material-banner.jpg\" />\n <MaterialAds/>\n <Footer />\n </Route>\n\n {/* HOME */}\n <Route path=\"/\">\n <Header />\n <Slider image=\"/images/slider-banner.jpg\"/>\n <FeaturedProducts />\n <DreamHome bg=\"url(/images/dream-home.jpg)\" />\n <FeaturedServices />\n <Footer />\n </Route>\n\n \n </Switch>\n \n </div>\n\n </Router>\n \n\n \n \n );\n}", "function Home() {\n return (\n <div>\n <Header />\n <Employee />\n </div>\n )\n}", "function App() {\n\n return (\n <div className=\"App\">\n <ScheduleEvent />\n <Subscribe />\n <Player />\n </div>\n );\n}", "function App() {\n \n \n return (\n <Router>\n <div className= \"pages\">\n <nav className=\"nav-bar\">\n <h1 className= \"title\">CRYSTALS & PENDULUMS</h1>\n {/* <img src=\"%PUBLIC_URL%/favicon.ico\" width=\"25\" height=\"25\" alt=\"brand\"/> */}\n <ul className=\"across\">\n \n \n <li><Link to=\"/Welcome\">WELCOME</Link></li>\n <li><Link to=\"/Crystals\">CRYSTALS</Link></li>\n <li><Link to=\"/Jewelry\">JEWELRY</Link></li> \n <li><Link to=\"/Pendulums\">PENDULUMS</Link></li> \n <li><Link to=\"/ItemUpload\">ITEM UPLOAD</Link></li>\n </ul> \n \n </nav>\n \n <Switch>\n <Route path='/Welcome'><br/><br/>\n <Welcome />\n </Route>\n <Route path='/Crystals'><br/><br/>\n <Crystals />\n </Route>\n <Route path='/Jewelry'><br/><br/>\n <Jewelry />\n </Route>\n <Route path='/Pendulums'><br/><br/>\n <Pendulums />\n </Route>\n <Route path='/ItemUpload'><br/><br/>\n <ItemUpload />\n \n </Route>\n </Switch>\n\n \n\n\n\n\n </div>\n\n </Router>\n\n \n );\n}", "function Homepage() {\n return (\n <div className=\"Home\">\n \n <Hero />\n <Featured />\n <Footer />\n </div>\n );\n}", "function App() {\n return (\n <Layout className=\"layout\">\n <Header>\n <Navbar/>\n </Header>\n <Content className=\"site-layout-content\">\n <Title style={{ textAlign: 'center'}}>Index Page</Title>\n <SchoolComponent/>\n </Content>\n <Footer style={{ textAlign: 'center', padding: '470px 0 0 0'}}>\n Copyright {new Date().getFullYear()}\n </Footer>\n </Layout>\n );\n}", "function App (){\n\n \n\n \n return (\n <div className=\"App\">\n <div className=\"header123\"><Header/></div>\n \n<div className=\"brightlow\">\n <div className=\"feature123\"><FeatureSection/></div>\n <div className=\"pocket123\"> <PocketSection/></div>\n <div className=\"action123\"> <ActionSection/></div>\n \n <div className=\"city123\"><CitySection/></div>\n <div className=\"footer123\"><Footer/></div>\n </div></div>\n \n );\n}", "function App() {\n return (\n <div className=\"App\">\n <HeaderHook />\n {routes}\n {/* <MoviesHook /> */}\n {/* <MoviesComponent /> */}\n {/* <Hooks /> */}\n </div>\n );\n}", "function App() {\n return (\n <>\n <div className=\"test\">\n <Router>\n <Navbar />\n <Container>\n <Switch>\n <Route exact path=\"/\">\n <Home />\n </Route>\n <Route exact path=\"/People\">\n <DataFetchPeople />\n </Route>\n <Route exact path=\"/Starships\">\n <DataFetchShips />\n </Route>\n </Switch>\n </Container>\n </Router>\n </div>\n </>\n );\n}", "function App() {\n\n\n return (\n\n <Router>\n\n <Route path=\"/\" exact component={Overlay}></Route>\n \n <Route path=\"/myweb\" exact component={() => {\n return <Main />\n \n }}></Route>\n <Route path=\"/myweb\" exact component={() => {\n return <Skills />\n }}></Route>\n \n <Route path=\"/myweb\" exact component={() => {\n return <Project />\n \n }}></Route>\n <Route path=\"/myweb\" exact component={() => {\n return <Skillbar />\n }}></Route>\n\n <Route path=\"/myweb\" exact component={() => {\n return <Contact />\n }}></Route>\n\n {/* <Route path=\"/myweb\" exact component={() => {\n return <Copyright />\n }}></Route> */}\n {/* all projects */}\n {/*\n <Route path=\"/myweb/project1\" exact component={() => {\n return <Project1 />\n \n }}></Route>\n\n<Route path=\"/myweb/project2\" exact component={() => {\n return <Contact />\n \n }}></Route>\n <Route path=\"/myweb/project3\" exact component={() => {\n return <Main />\n \n }}></Route>\n <Route path=\"/myweb/project4\" exact component={() => {\n return <Skills />\n \n }}></Route>\n \n \n */}\n </Router>\n )\n\n \n}", "function App() {\n return (\n <div className=\"App\">\n <header className=\"main_menu home_menu\">\n <Menu />\n <Team />\n </header>\n </div>\n );\n}", "function App() {\n return(\n <div>\n <BrowserRouter>\n <Switch>\n <Route path=\"/articles\">\n <Articles/>\n </Route>\n <Route path=\"/signup\">\n <SignUp/>\n </Route>\n <Route path=\"/signin\">\n <SignIn />\n </Route>\n <Route path=\"/\">\n <Home/>\n </Route>\n </Switch> \n </BrowserRouter>\n </div>\n )\n}", "render(){\n\n\nreturn(\n<Router>\n<div className=\"main-container\">\n<Route exact path='/' render={(props) => <Login {...props} baseUrl={this.baseUrl} /> } />\n<Route exact path='/home' render={(props) => <Home {...props} baseUrl={this.baseUrl} /> } />\n<Route exact path='/profile' render={(props) => <Profile {...props} baseUrl={this.baseUrl} /> } />\n</div>\n\n</Router>\n) \n\n}", "function App() {\n return (\n <div className=\"App\">\n <header className=\"App-header\">\n <h3>Email App</h3>\n </header>\n <main>\n <CsvUpload />\n <hr />\n <ListFiles />\n <hr />\n <CurrFileData />\n </main>\n </div>\n );\n}", "function App() {\n return (\n <div>\n {/* <Routes/> */}\n <InputColleges/>\n <ShowColleges/><br/>\n <CollegeDetails/>\n \n </div>\n );\n}", "function App() {\n return (\n <div className={css.App}>\n {//<NavBarSimple />\n }\n <NavBarForm />\n <Sidebar />\n <ContentHooksAPI />\n </div>\n );\n}", "function Main(){\n return(\n <Switch>\n <Route exact path=\"/\" component={Landing} />\n <Route exact path=\"/aboutme\" component={About} />\n <Route exact path=\"/resume\" component={Resume} />\n <Route exact path=\"/contact\" component={Contact} />\n <Route component={Error}></Route>\n {/* <Route exact path=\"/projects\" component={Project} /> */}\n </Switch>\n )\n}", "render () {\n return (\n <section>\n <DataBase />\n <FileUpload />\n </section>\n )\n }", "function App() {\n return (\n <Router >\n <div className=\"App\">\n\n {/* Get data from API */}\n {/* <PostList /> */}\n {/* Post data to API */}\n {/* <PostForm /> */}\n\n {/* Routing in React */}\n <Nav />\n <Switch >\n <Route path=\"/\" exact component={Home} />\n <Route path=\"/about\" component={About} />\n <Route path=\"/shop\" exact component={Shop} />\n <Route path=\"/contact\" component={Contact} />\n <Route path=\"/shop/:id\" component={ItemDetail}/>\n </Switch>\n </div> \n </Router> \n );\n }", "function BlogMain() {\n return(\n <main>\n {/* <Banner />\n <Nav /> */}\n console.log(\"Blog page clicked\");\n </main>\n )\n}", "function loadStories() {\n require('../app/components/avatars/avatars.stories');\n require('../app/components/loading.stories');\n}", "function App() {\n return (\n <div>\n <Switch>\n <Route exact path=\"/\" component={Chat}></Route>\n <Route exact path=\"/dashboard/admin\" component={Dashboard}></Route>\n <Route exact path=\"/dashboard/admin/bot\" component={Bot}></Route>\n <Route\n exact\n path=\"/dashboard/admin/user/:id\"\n component={UserSettings}\n ></Route>\n <Route\n exact\n path=\"/dashboard/admin/bot/:id\"\n component={ManageBot}\n ></Route>\n <Route exact path=\"/dashboard/admin/user\" component={UserList}></Route>\n <Route\n exact\n path=\"/dashboard/admin/company\"\n component={CompaniesComponent}\n ></Route>\n <Route exact path=\"/auth/register\" component={Register}></Route>\n <Route exact path=\"/auth/login\" component={Login}></Route>\n <Route exact path=\"/auth/verify_email\" component={VerifyEmail}></Route>\n <Route exact path=\"/preview\" component={EmbedCode}></Route>\n <Route component={Error}></Route>\n </Switch>\n </div>\n );\n}", "function App() {\n return (\n <div>\n <Router>\n <switch>\n <Route exact path='/' component={Ageclass}></Route>\n <Route exact path='/1' component={Cityclass}></Route>\n <Route exact path='/2' component={Dobclass}></Route>\n <Route exact path='/task2' component={Login}></Route>\n <Route exact path='/task3' component={Arithamaticoperation}></Route>\n <Route exact path='/task4' component={Eventchange}></Route>\n <Route exact path='/task5' component={Restfullservice}></Route> \n\n\n </switch>\n </Router>\n </div>\n );\n}", "function App() {\n return (\n <div className=\"container\">\n <h1>Madlibs</h1>\n {/* <Link className = \"btn btn-info mr-3\" to=\"/\">Home</Link> */}\n\n \n {/* <h4 className = \"my-3\">We have quotes by:</h4> */}\n <Router className = \"my-3\">\n <Home path=\"/\"/>\n <Camp path=\"/camp\"/>\n\n\n\n </Router>\n\n\n \n\n\n\n </div>\n );\n}", "render() {\n return (\n <React.Fragment>\n <NavBar />\n <ApplicationViews />\n </React.Fragment>\n );\n }", "function App() {\n return (\n <>\n <BrowserRouter>\n <Navbar /> \n <Route path=\"/src/components/Forms/login.jsx\" exact>\n <Login />\n </Route>\n <Route path=\"/AboutUs\" exact>\n <Home />\n </Route>\n <Route path=\"/src/components/Movies/Movies.js\">\n <Movies />\n </Route>\n \n <Route path=\"/src/components/Plays\">\n <Plays />\n </Route>\n\n <Route path=\"/src/components/Forms/AddMovie.jsx\">\n <AddMovie />\n </Route>\n \n <Route path=\"/src/components/ContactUs\">\n <ContactUs />\n </Route>\n <Route path=\"/Book/:id\">\n <TwoComponent/>\n {/* <Link to={'/Book/:id'}><button className=\"btn btn-primary\">Proceed</button></Link> */}\n </Route>\n </BrowserRouter> \n\n {/* <BrowserRouter>\n <Switch>\n <Route exact path=\"/\" render={props=>\n <>\n <Navbar/>\n <Movies/>\n </>\n }/>\n <Route path=\"/Movies\" component={Movies}/>\n <Route path=\"/Book/:id\" render={props=>\n <>\n <div class=\"container-fluid\">\n <div class=\"row\">\n <div class=\"col-lg-5\">\n <MovieDisplay/>\n </div>\n <div class=\"col-lg-6\">\n <Grid/>\n </div>\n </div>\n </div>\n </>\n }/>\n </Switch>\n </BrowserRouter> */}\n </>\n );\n}", "function loadStories() {\n // You can require as many stories as you need.\n require('../src/stories/button');\n require('../src/stories/form');\n require('../src/stories/pagination');\n}", "function Stories(props) {\n return (\n <div>\n stories component\n </div>\n )\n}", "function App() {\n return (\n <div className=\"App\">\n <Switch>\n <Route exact path=\"/\" render={props => <Home {...props} />} />\n <Route exact path=\"/Contact\" render={props => <Contact {...props} />} />\n <Route exact path=\"/About\" render={props => <About {...props} />} />\n <Route exact path=\"/Roadmap\" render={props => <Roadmap {...props} />} />\n </Switch>\n </div>\n );\n}", "function Temp() {\n const { zhPageList } = usePages();\n const { user_id, adim } = usePages().userInfo;\n const { RecordTeam, UserEditor, RecordPlayer, Profile } = pagesMenu();\n return (\n <Router>\n <Layout className=\"layout\">\n <Header>\n {/* <div className=\"logo\" /> */}\n <NavBar />\n </Header>\n <Switch>\n <Route exact path=\"/\">\n <Redirect to={\"/\" + zhPageList[0][0]} />\n </Route>\n <Route\n path=\"/確認隊伍資訊\"\n render={(props) => <Checkteam user_id={user_id} adim={adim} />}\n />\n {zhPageList.map((page, index) => (\n <Route key={index} path={\"/\" + page[0]} component={page[1]} />\n ))}\n <Route exact path=\"/profile\" component={UserEditor} />\n <Route exact path=\"/profile/:user_id\" component={Profile} />\n <Route path=\"/recordTeam/:aMatch\" component={RecordTeam} />\n <Route path=\"/recordPlayer/:data\" component={RecordPlayer} />\n </Switch>\n <Footer style={{ textAlign: \"center\" }}>\n Online Basketball Web design by{\" \"}\n </Footer>\n </Layout>\n </Router>\n );\n}", "function App(){\n\n return<TechList /> \n //<h1>Hello Rocketseat</h1> // usando sintaxe JSX - É necessario importar o react\n}", "function App() {\n return (\n\n <div >\n\n <Header></Header>\n <AuctionPlayers></AuctionPlayers>\n\n </div>\n );\n}", "function App() {\n return (\n <>\n <h1> Reactjs - Single page Web App 🚀 </h1>\n <h2> Github users </h2>\n\n <User></User>\n </>\n );\n}", "function App() {\n return (\n <div className=\"App\">\n <Nav />\n <Switch>\n <Route path=\"/\" exact>\n <Home />\n </Route>\n <Route path=\"/social\" exact>\n <Image />\n </Route>\n <Route path=\"/contact\" exact>\n <Contact />\n </Route>\n <Route path=\"/myskill\" exact>\n <Myskills />\n </Route>\n <Route path=\"/liveproject\" exact>\n <Liveproject />\n </Route>\n {/* <Route path=\"/img\" exact>\n <Mygallery />\n </Route> */}\n </Switch>\n </div>\n );\n}", "function HomePage() {\n return <TodoList />;\n}", "function Home() {\n return (\n <>\n {/* <SocialAuth/> */}\n <Editor/>\n </>\n );\n}", "function App() {\n return (\n <div className=\"App\">\n \n <Title/>\n {/*\n <PersonalInfo/>\n <VideoBanner/>\n \n <SplitText/>\n <LandingPage/>\n */}\n\n\n\n </div>\n );\n}", "function App() {\n return (\n <div>\n <Route\n path='/doc'\n component={Alldoctors}\n />\n <Route\n path='/login'\n component={LoginRoute}\n />\n <Route\n path='/register'\n component={RegisterRoute}\n />\n </div>\n );\n}", "function App() {\n return (\n <div className=\"container\">\n <Router>\n <Header />\n <Switch>\n {/* <Route exact path=\"/\" component ={Login}/> */}\n <Route exact path=\"/\" component={HeroListing}/>\n <Route exact path=\"/hero/:heroId\" component={HeroDetail}/>\n <Route exact path=\"/team\" component={Team}/>\n <Route>404 not found!</Route>\n </Switch>\n </Router>\n </div>\n );}", "function App() {\n return (\n <Provider store={store}>\n <div className=\"App\">\n <TopNavigation></TopNavigation>\n <FeaturedSlider></FeaturedSlider>\n <ProductCardList></ProductCardList>\n <ProductModal></ProductModal>\n </div>\n </Provider>\n );\n}", "function App() {\n return (\n <div className=\"App\"> \n <ToDoApp />\n </div>\n );\n}", "function HomeScreen() {\n return (\n <div className=\"App\">\n\n <TeQuestHeader></TeQuestHeader>\n \n <MyCarousel></MyCarousel>\n\n <BoxLabelsPart></BoxLabelsPart>\n\n <CallForAction></CallForAction>\n\n <FeaturedSPs></FeaturedSPs>\n\n <NewsletterSubscribe></NewsletterSubscribe>\n\n <FooterMenuItems></FooterMenuItems>\n </div>\n );\n}", "function App() {\n return (\n <Router>\n <div className=\"container\">\n <Navbar />\n <br />\n <Route path=\"/\" exact component={Home} />\n <Route path=\"/all\" component={View} />\n <Route path=\"/add\" component={Add} />\n <Route path=\"/edit/:id\" component={Edit} />\n <Route path=\"/old\" component={Old} />\n <Route path=\"/updatemany\" component={UpdateMany} />\n </div>\n </Router>\n );\n}", "function App() {\n return (\n //creating router components using <Route> element:\n //If we go to the URL with with path, it will get different routes and show different parts of the database (helps to map different url path)\n <Router>\n <div className=\"container\">\n <Navbar />\n <br />\n <Route path=\"/\" exact component={ExercisesList} />\n <Route path=\"/edit/:id\" component={EditExercise} />\n <Route path=\"/create\" component={CreateExercise} />\n <Route path=\"/user\" component={CreateUser} />\n </div>\n </Router>\n );\n}", "function include(path) {\nreturn () => import('@/components/' + path)\n}", "function App() {\n return (\n // <GooglePexel></GooglePexel>\n <GoogleBooksSearch></GoogleBooksSearch>\n // <div className=\"row\">\n // <div className=\"col-md-8 offset-md-2\">\n // {/* <Contacts /> */}\n // <Country />\n // </div>\n // </div>\n )\n}", "function Projects() {\n return (\n <Container>\n <div>\n <Row className=\"project-card\">\n <ProjectCard\n imgPath={meetup}\n title=\"ReactJS Meetup Progressive Web App\"\n description=\"a serverless, progressive web application (PWA) with React using a test-driven development (TDD) technique and hosted by a cloud provider (Lambda AWS). Users of this app will be able to use this application whenever they want to view upcoming events for a specific city..\"\n github=\"https://github.com/wafachaari/myFlix-client\"\n header=\"React | CSS | JavaScript | OAuth2 | Jest | Serverless Programming\"\n application=\"https://wafachaari.github.io/meet/\"\n />\n </Row>\n <Row className=\"project-card\">\n <ProjectCard\n header=\"MongoDB | Express | React | Node.js | Redux | JSX | SCSS | Parcel | JavaScript | Bootstrap\"\n imgPath={movieapi}\n title=\"ReactJS Web App - MyFlix\"\n description=\" full stack application using React, JWT, and Node.js for serverside (which queries a REST API built from scratch) allows you to create a profile, browse movies, favorite movies, explore directors, and update information..\"\n application=\"https://wafachaari.github.io/meet/\"\n github=\"https://github.com/wafachaari/myFlix-clien\" />\n </Row>\n <Row className=\"project-card\">\n <ProjectCard\n header=\"HTML | CSS | JavaScript | jQuery | Bootstrap\"\n imgPath={pokemon}\n // isBlog={false}\n title=\"Javascript/jQuery Web App - PokéDex\"\n description=\" a javascript app with HTML,css,jquery ,that also loads data from an external API The styling for this app was created with help from Bootstrap and interacts with the Pokemon API. The development of Poke-Dex took a deep dive into advanced JavaScript methods and DOM interaction.\"\n link=\"https://github.com/wafachaari/myFlix-clien\"\n application=\"https://wafachaari.github.io/meet/\"\n />\n </Row>\n </div>\n </Container>\n );\n}", "function App() {\n return (\n <div className=\"App\">\n <Router>\n <NavBar/>\n <Switch>\n <Route exact path=\"/\" component={Home} />\n <Route exact path=\"/home\" component={Home} />\n <Route exact path=\"/products\" component={FetchProducts} />\n <Route exact path=\"/new\" component={CreateProduct} />\n \n </Switch>\n </Router>\n </div>\n );\n}", "function Homepage() {\n return (\n <div >\n <Navbar />\n <Entryform />\n <Displayform />\n </div>\n )\n}", "function App() {\n return (\n <main>\n <NavBar />\n <SignUpSection />\n <GithubEntreprise/>\n <GithubActions />\n <UserCompanies />\n <GithubTeams />\n <Benefits />\n <EntrepriseUses />\n <Security />\n <Host />\n <Integrations />\n <CommunitySection />\n <Statistics />\n <ContactUs />\n <Footer />\n </main>\n );\n}", "function App() {\n \n return (\n <Router>\n <div>\n <nav>\n <ul>\n <li>\n <Link to=\"/home\">Home</Link>\n </li>\n <li>\n <Link to=\"/about\">About</Link>\n </li>\n <li>\n <Link to=\"/contact\">Contact</Link>\n </li>\n </ul>\n </nav>\n </div>\n\n <Switch>\n <Route exact path=\"/home\">\n <Home />\n </Route>\n <Route path=\"/about\">\n <About />\n </Route>\n <Route exact path=\"/contact\">\n <Contact />\n </Route>\n <Route path=\"/contact/detail-contact\">\n <DetailContact />\n </Route>\n </Switch>\n\n \n </Router>\n );\n}", "function Home() {\n \n return (\n <section>\n <Hero/>\n <Categories/>\n <Recomendaciones/>\n <Descuentos/>\n </section>\n )\n}", "function App() {\n return (\n <Router>\n <Switch> \n <Route exact path=\"/\" component={Login}/>\n <NavBar/>\n {/* <Sidebar/> */}\n </Switch>\n <Switch>\n <Route exact path=\"/dashAdmin\" component={DashBordAdmin}/>\n <Route exact path=\"/showProfile\" component={ShowProfile}/>\n <Route exact path=\"/addTicket\" component={AddTicket}/>\n \n \n \n </Switch>\n </Router>\n );\n}", "componentWillMount() {\n this.getProjects();\n\n this.getTodos();\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 }", "function App() {\n return (\n <Router>\n <Switch>\n <Route exact path=\"/\">\n <Redirect to=\"/Home\" />\n </Route>\n\n <AuthLayout exact path=\"/Login\" component={Login} />\n <AuthLayout exact path=\"/Register\" component={Register} />\n\n <div className=\"App\">\n <BaseLayout\n exact\n path=\"/DepartmentTypeList\"\n component={DepartmentTypeList}\n />\n <BaseLayout exact path=\"/Home\" component={Home} />\n\n <BaseLayout exact path=\"/CreateDepartmentType\" component={CreateDepartmentType} />\n </div>\n </Switch>\n </Router>\n );\n}", "function loadStories() {\n require(\"../index.stories\");\n}", "function App() {\n return (\n <Router>\n <div className=\"App\">\n {/* <Navbarcomponent /> */}\n <Route exact path=\"/Users\" component={Users} />\n <Route exact path=\"/Profile\" component={Profile} />\n <Route exact path=\"/Landing\" component={Landing} />\n {/* <Route path=\"/SMS/:number\" component={SmsDetails} /> */}\n\n </div>\n </Router>\n );\n}", "function App() {\n \n return (\n <div className=\"App\">\n <Header /> \n\n <Switch>\n <Route exact path='/'>\n <Main url={url}/> \n </Route>\n \n <Route path='/about' component= { About } >\n </Route>\n\n {/* <Route path='/projects' component={ Projects }>\n </Route> */}\n\n <Route path='/designer' component={ Designer }>\n </Route>\n\n <Route path='/contact' component={ Contact }>\n </Route>\n\n <Route path='/resume' component={ Resume }>\n </Route>\n\n <Route path='/articles' component={ Articles }>\n </Route> \n\n </Switch>\n {/* <Footer /> */}\n </div>\n );\n}", "render() { // all components need this.\n return (\n <div>\n <h3>Stories App</h3>\n <p className=\"lead\">Sample paragraph</p>\n </div>\n );\n }", "function App() {\n return (\n <Router>\n <div className=\"App\">\n <Route exact path=\"/\" component={Intro} />\n <Route exact path=\"/Choose\" component={Choose} />\n <Route exact path=\"/Shout\" component={Explode} />\n <Route exact path=\"/FunnyVideo\" component={FunnyVideo} />\n </div>\n </Router>\n );\n\n}", "function App() {\n return (\n <div className=\"App\">\n {/* <h1>sreedhar</h1>\n <Student />\n <Add_1 /> */}\n {/* <Props_Components/> */}\n {/* <Props_Classcomponents sayhello=\"good morning\"/> */}\n {/* <State_Components/> */}\n {/* <Events_Component /> */}\n {/* <Binding_Component/> */}\n <Navbar_Component />\n {/* <Conditions_Components/> */}\n {/* <Loops_FunctionalComponets /> */}\n </div>\n );\n}", "function HelloReact() {\n return (\n <div className=\"container\">\n Hello React!\n {/*Another imported component*/}\n <Counter/>\n </div>\n )\n}", "function App() {\n return (\n <>\n <Router>\n <Navbar />\n <Switch>\n <Route path='/' exact component={Home} />\n <Route path='/wisata' component={Wisata} />\n <Route path='/produk' component={Produk} />\n <Route path='/blog' component={Blog} />\n {/* <Route path='/sign-up' component={SignUp} /> */}\n </Switch>\n </Router>\n </>\n );\n}" ]
[ "0.6112332", "0.6043444", "0.5795258", "0.57648414", "0.5762315", "0.5705003", "0.56934285", "0.5665387", "0.56451756", "0.56362164", "0.56143516", "0.55437773", "0.5531811", "0.55315185", "0.5522978", "0.55227834", "0.5517167", "0.5512909", "0.5511386", "0.5495315", "0.5487968", "0.54873294", "0.5485414", "0.5484655", "0.5470067", "0.54563254", "0.5451742", "0.54474914", "0.5446707", "0.54459864", "0.54377836", "0.54368323", "0.5435454", "0.5429746", "0.54274696", "0.54159945", "0.54143053", "0.54117", "0.5405983", "0.5403681", "0.53913087", "0.53842396", "0.53760123", "0.5368938", "0.5367267", "0.53648585", "0.5362443", "0.5362018", "0.53577906", "0.53532267", "0.5349452", "0.53485304", "0.5347761", "0.53411686", "0.5329792", "0.5328312", "0.5324976", "0.53237426", "0.53193635", "0.5319348", "0.5318634", "0.5316996", "0.53140235", "0.53038895", "0.5303858", "0.53000546", "0.5299026", "0.5297961", "0.5295444", "0.5294748", "0.5293429", "0.5293299", "0.52903533", "0.52899903", "0.52800244", "0.52780473", "0.52778417", "0.52774453", "0.5270695", "0.5265017", "0.52601975", "0.5259928", "0.525893", "0.52570057", "0.52530426", "0.52501976", "0.5245725", "0.5245658", "0.52448654", "0.52439386", "0.5243712", "0.5241444", "0.524023", "0.5240175", "0.5237861", "0.52367646", "0.52345043", "0.5230718", "0.52283734", "0.5225137" ]
0.5448223
27
all currently selected associations are kept here the main submission function for when
function addMetadataEdits() { $('#meta_textarea').addClass('meta_ajaxwait').removeAttr('id'); $.ajax({ url: arcs.baseURL + "metadataedits/add", type: "post", data: { resource_kid: resource_kid, resource_name: resource_name, scheme_id: meta_scheme_name, control_type: meta_control_type, field_name: meta_field_name, user_id: "user_not_set", //this is set in the controller value_before: meta_value_before, new_value: meta_new_value, approved: 0, rejected: 0, reason_rejected: "", metadata_kid: meta_resource_kid }, success: function (data) { var fill = '<td>' + '<div class="icon-meta-lock">&nbsp;</div>' + '<div>Pending Approval</div>' + '</td>'; $(".meta_ajaxwait").parent().parent().replaceWith(fill); metadataIsSelected = 0; editBtnClick = 0; } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mutate() {\n // Update relationships here\n // Optimising Organisations\n let newOrgs = [];\n for (let org of organisations) {\n const newOrg = this.optimise(org, Organisation, ORGANISATIONS);\n newOrgs.push(newOrg);\n }\n organisations = newOrgs;\n // Optimising Users\n let newUsers = [];\n for (let user of users) {\n const newUser = this.optimise(user, User, USERS);\n newUsers.push(newUser);\n // Add user to organisation using _id as a unique identifier\n let org = this.getOrganisation(newUser.organization_id);\n if (org) {\n org.addUser(newUser);\n newUser.organisation = org;\n }\n }\n users = newUsers;\n\n\n // Optimising Tickets\n let newTickets = [];\n for (let ticket of tickets) {\n const newTicket = this.optimise(ticket, Ticket, TICKETS);\n newTickets.push(newTicket);\n\n // Add ticket to submitter user\n let submitter = this.getUser(newTicket.submitter_id);\n if(submitter) {\n submitter.addTicket(newTicket, true);\n newTicket.submitter = submitter;\n }\n\n // Add ticket to assignee\n let assignee = this.getUser(newTicket.assignee_id);\n if (assignee) {\n assignee.addTicket(newTicket);\n newTicket.assignee = assignee;\n }\n\n // Add ticket to Organistaion\n let org = this.getOrganisation(newTicket.organization_id);\n if (org) {\n org.addTicket(newTicket);\n newTicket.organisation = org;\n }\n\n }\n tickets = newTickets;\n }", "function promoteAnalysisList() {\n\n var aids = [];\n $(\"input[name='queue_items[]']:checked\").each(function () {\n aids.push( $(this).val());\n });\n\n console.log( \"Analysis Ids to delete: \" + JSON.stringify( aids));\n\n $.post( \"promoteAnalysisList\", { aids: JSON.stringify( aids)},\n function(result) { document.getElementById('analysisActionStatus').innerHTML = result; });\n}", "function selectAllUploaded(selected) {\n\t\t\tif (self.activeTab == 'uploadeddailymail') {\n\t\t\t\tif (selected) {\n\t\t\t\t\tvar dataCopy = angular.copy(self.uploadedList.data);\n\t\t\t\t\tself.uploadedGridOptions.uploadedSelectedItems = dataCopy;\n\t\t\t\t} else {\n\t\t\t\t\tself.uploadedGridOptions.uploadedSelectedItems = [];\n\t\t\t\t}\n\t\t\t} else if (self.activeTab == 'unindexeddailymail') {\n\t\t\t\tif (selected) {\n\t\t\t\t\tvar dataCopy = angular.copy(self.unindexedList.data);\n\t\t\t\t\tself.unindexedGridOptions.unindexedSelectedItems = dataCopy;\n\t\t\t\t} else {\n\t\t\t\t\tself.unindexedGridOptions.unindexedSelectedItems = [];\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function refreshDropsWithNewAssociation(){\n console.log(\"called refreshDropsWithNewAssociation\")\n //get the parent associated drop for add existing\n let currentInAddExistingAssociatedType = O('associated_add_existing_entity_select_box_type').value\n console.log(\"type \"+currentInAddExistingAssociatedType)\n fillExistingNameAssociations(currentInAddExistingAssociatedType)\n\n\n let currentInPendingEntityType = O('pending_entity_select_box_type').value\n console.log(\"type \"+currentInPendingEntityType)\n fillPendingNameAssociations(currentInPendingEntityType)\n}", "function SubmitIncludeAssignment(SubmitBt, TempDb) {\n var UpdateStudentsCourse = [];\n var UpdateCoursesAssignmnet = [];\n if (SubmitBt != null) {\n\n //Course Only\n $('table [name=\"checkerbox_assignment_include\"]').each(function (i, chk) {\n if (chk.checked)\n UpdateCoursesAssignmnet.push($(chk).val());\n });\n CoursesAssignmentsArray = UpdateAssignmentCourseData(UpdateCoursesAssignmnet, \"course\", CoursesAssignmentsArray);\n\n //Students Only\n if ($('#CourseModalIncludeTable').is(':visible') && !$('#CourseModalIncludeTableTop').is(':visible')) {\n $('table [name=\"checkerbox\"]').each(function (i, chk) {\n if (chk.checked)\n UpdateStudentsCourse.push($(chk).val());\n });\n console.log(UpdateStudentsCourse);\n UpdateAssignmentCourseData(UpdateStudentsCourse, \"student_assignment\", AssignmentsStudentsArray);\n }\n\n //Students Per Course Per Assignment Only\n if ($('#CourseModalIncludeTable').is(':visible') && $('#CourseModalIncludeTableTop').is(':visible')) {\n $('table [name=\"checkerbox_student\"]').each(function (i, chk) {\n if (chk.checked)\n UpdateStudentsCourse.push($(chk).val());\n });\n UpdateAssignmentCourseData(UpdateStudentsCourse, \"student_course\", CoursesStudentsArray);\n }\n }\n else {\n //Courses Only\n $('table [name=\"checkerbox_assignment_include\"]').each(function (i, chk) {\n if (chk.checked)\n UpdateCoursesAssignmnet.push($(chk).val());\n });\n TemporaryDb = UpdateAssignmentCourseData(UpdateCoursesAssignmnet, \"course\", TempDb);\n return UpdateAssignmentCourseData(UpdateCoursesAssignmnet, \"course\", TempDb);\n }\n RefreshCourseHtmlModalBody(AssignmentID, CoursesAssignmentsArray);\n}", "addRelationship() {\n this.mapTypeForm.reset();\n this.submitted = false;\n this.displayModal = true;\n this.isedit = false;\n }", "function setSubmitsFromCheckboxes () {\n\tvar upd = $(\"update\");\n\tvar del = $(\"delete\");\n\tvar isAnyRowChecked = $$(\"input[type='checkbox']\"). any (function (c) {\n\t\treturn c.checked;\n\t});\n\tupd.disabled = (! isAnyRowChecked) || upd.fieldValidationSaysDoNotEnable;\n\tdel.disabled = (! isAnyRowChecked) || del.fieldValidationSaysDoNotEnable;\n\tupd.mainSaysDoNotEnable = ! isAnyRowChecked;\n\tdel.mainSaysDoNotEnable = ! isAnyRowChecked;\t\t\n}", "addRelationship() {\n this.relationTypeForm.reset();\n this.submitted = false;\n this.displayModal = true;\n this.isedit = false;\n }", "function markDoneSelectedGoals() {\n\t\t\tfor (var i = 0; i < vm.goals.length; i++) {\n\n\t\t\t\t// If the goal is selected \n\t\t\t\tif (vm.goals[i].selected === true) {\n\t\t\t\t\tvm.goals[i].done = true;\n\t\t\t\t\tvm.goals[i].selected = false;\n\n\t\t\t\t\ttasks.updateTask(vm.goals[i]);\n\t\t\t\t}\n\t\t\t}\t\n\n\t\t\t//vm.goals = tasks.saveTasks(vm.goals);\n\t\t}", "'submit .project-data-form'(event, instance) {\n event.preventDefault();\n\n // Get contact info (text fields)\n const projectName = event.target.projectName.value; // based on associated html id tags\n const bio = event.target.bio.value;\n let skillsWanted = event.target.skillsWanted.value.split(',');\n skillsWanted = _.map(skillsWanted, (skill) => { return utils.makeReadable(skill); });\n const url = event.target.projectUrl.value;\n\n console.log(skillsWanted);\n Projects.update({ _id: FlowRouter.getParam('_id') }, {\n $set: {\n projectName: projectName,\n bio: bio,\n skillsWanted: skillsWanted,\n url: url,\n modifiedAt: new Date()\n }\n });\n\n SkillGraphCollection.addVertexList(skillsWanted);\n\n FlowRouter.go('Project_Profile_Page', { _id: FlowRouter.getParam('_id') });\n }", "static associate(models) {\n // define association here\n project.belongsToMany(models.user, {\n through: 'userPermission',\n onDelete: 'CASCADE',\n foreignKey: 'projectId'\n })\n // project.hasMany(models.userPermission, {\n // onDelete: 'CASCADE',\n // foreignKey: {\n // allowNull: false\n // }\n // })\n project.hasMany(models.puzzle, {\n onDelete: 'CASCADE',\n foreignKey: {\n allowNull: false\n }\n })\n\n project.hasMany(models.label, {\n foreignKey: {\n allowNull: false,\n },\n })\n }", "static associate(models) {\n Compra.belongsToMany(models.Produto, { through: 'Compra_Produto', onDelete: 'cascade' });\n models.Produto.belongsToMany(Compra, { through: 'Compra_Produto', onDelete: 'cascade' });\n }", "propagateSelectedShapes() {\n // we loop over all selected shapes and propagate them individually\n // since they could be in different t/z so that he propagation won't\n // be the same for each of them\n this.regions_info.selected_shapes.map(\n (id) => {\n let shape =\n Object.assign({}, this.regions_info.data.get(id));\n // collect dimensions for propagation\n let theDims =\n Utils.getDimensionsForPropagation(\n this.regions_info, shape.theZ, shape.theT);\n if (theDims.length > 0)\n this.context.publish(\n REGIONS_GENERATE_SHAPES,\n {config_id : this.regions_info.image_info.config_id,\n shapes : [shape],\n number : theDims.length, random : false,\n theDims : theDims, propagated: true});\n });\n }", "function saveElementTypesForm() {\n for (var i = 0; i < elementSeedForms.length; i++) {\n var type = elementSeedForms[i][\"element\"];\n if (!elementSelectionForm.elementTypes[type]) {\n elementSeedForms[i][\"selected\"] = elementSelectionForm.selectables[type];\n }\n }\n}", "function MSM_Save() {\n console.log(\"=== MSM_Save =========\");\n\n const has_permit = (permit_dict.permit_crud && permit_dict.requsr_same_school);\n\n console.log(\" has_permit\", has_permit);\n console.log(\" permit_dict\", permit_dict);\n\n if(has_permit){\n\n let new_array = [];\n let allowed_str = \"\"\n const tblBody_select = el_MSM_tblbody_select;\n for (let i = 0, row; row = tblBody_select.rows[i]; i++) {\n const base_pk_int = get_attr_from_el_int(row, \"data-pk\")\n if(base_pk_int > 0) {\n const is_selected = (!!get_attr_from_el_int(row, \"data-selected\"))\n if(is_selected){\n new_array.push(base_pk_int);\n\n };\n }\n }\n if(new_array){\n // PR2020-11-02 from https://www.w3schools.com/js/js_array_sort.asp\n new_array.sort(function(a, b){return a - b});\n };\n\n // --- upload changes\n // mod_MSM_dict = user_data_dict with additional keys\n const upload_dict = { mode: \"update\",\n user_pk: mod_MSM_dict.user_pk,\n ual_pk: mod_MSM_dict.ual_pk,\n allowed_clusters: (new_array.length) ? new_array : null\n };\n\n UploadChanges(upload_dict, urls.url_userallowedcluster_upload);\n };\n// hide modal\n $(\"#id_mod_select_multiple\").modal(\"hide\");\n } // MSM_Save", "function setOwners(result)\n{\n if(result == 'affair')\n {\n $('#assignedTo').attr('multiple', 'multiple');\n $('#assignedTo').chosen('destroy');\n $('#assignedTo').chosen(defaultChosenOptions);\n }\n else if($('#assignedTo').attr('multiple') == 'multiple')\n {\n $('#assignedTo').removeAttr('multiple');\n $('#assignedTo').chosen('destroy');\n $('#assignedTo').chosen(defaultChosenOptions);\n }\n}", "static associate(models) {\n\t\t\t// define association here\n\t\t}", "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 maybeSaveThenRemoveAllCurrentAvatarEntities() {\n if (approvedUsernames.indexOf(AccountServices.username) > -1) {\n return;\n }\n\n MyAvatar.getAvatarEntitiesVariant().forEach(function(avatarEntity) {\n if (avatarEntity.properties.locked) {\n console.log(\"Boot Code 00000001\");\n Window.location = kickDomain;\n return;\n }\n\n if (enableCollisionlessAvatarEntities && avatarEntity.properties.collisionless) {\n return;\n }\n\n maybeSaveThenDelete(avatarEntity.id, avatarEntity.properties);\n });\n }", "function checkSelectionSubmit() {\n for (var opt in survey[questionIndex]['answers']) {\n if($(\"#Select\"+opt).is(':checked')) {\n $('#submit').attr('disabled',false);\n return;\n }\n } \n $('#submit').attr('disabled',true);\n}", "static associate(models) {\n // define association here\n models.strain.belongsToMany(models.user, { through: models.user_strain });\n models.strain.hasMany(models.review);\n models.strain.hasMany(models.effect);\n models.strain.hasMany(models.flavor);\n }", "function syncronizeCheckboxes(clicked, pri, pub) {\n pri.checked = false;\n pub.checked = false;\n clicked.checked = true;\n }", "function manageSelectedIds() {\n var financeCube = CoreCommonsService.findElementByKey($scope.originalFinanceCubes.sourceCollection, $scope.choosedFinanceCube, 'financeCubeVisId');\n selectedFinanceCubeId = financeCube.financeCubeId;\n $scope.selectedModelId = financeCube.model.modelId;\n $scope.selectedModelVisId = financeCube.model.modelVisId;\n }", "function mapPreselectedInsuranceTypes() {\n let preselected;\n \n if(typeof $stateParams.preselected === 'string'){\n preselected = new Set()\n preselected.add($stateParams.preselected)\n } else {\n preselected = new Set($stateParams.preselected)\n }\n for(var index in $scope.insurance_types){\n if(preselected.has(index)){\n $scope.insurance_types[index].selected = true;\n } else {\n $scope.insurance_types[index].selected = false;\n }\n }\n \n }", "function save() {\n switch (vm.completeOptions.requestType) {\n case u4dmConstants.productionTypes.transferBatch:\n if (vm.icvConfigBatch) {\n if (temporaryCheck(vm.icvConfigBatch.getSelectedItems())) {\n var machineAndQuantity = [];\n vm.icvConfigBatch.getSelectedItems().forEach(function (item) {\n machineAndQuantity.push({ equipment: item.EquipmentNId, quantity: item.ToBeSavedWorkedQuantity });\n });\n vm.completeOptions.machineAndQuantity = machineAndQuantity;\n }\n else { return; }\n }\n else {\n var list = _.pluck(vm.icvConfigMachines.getSelectedItems(), \"NId\");\n vm.completeOptions.equipmentList = list;\n }\n break;\n\n case u4dmConstants.productionTypes.serialized:\n if (vm.icvConfigSerialNo) {\n vm.completeOptions.selectedSNs = vm.icvConfigSerialNo.getSelectedItems();\n }\n else {\n var list = _.pluck(vm.icvConfigMachines.getSelectedItems(), \"NId\");\n vm.completeOptions.equipmentList = list;\n }\n break;\n\n case u4dmConstants.productionTypes.fullSerialized:\n case u4dmConstants.productionTypes.fullQuantity:\n var list = _.pluck(vm.icvConfigMachines.getSelectedItems(), \"NId\");\n vm.completeOptions.machinesForFull = list;\n break;\n };\n \n u4dmSvc.messaging.post(u4dmConstants.events.COMPLETE_OPTIONS_SELECTED, vm.completeOptions);\n cancel();\n }", "function resetSelectedImages() {\n for(i = 0; i < formData.imageSet1.length; i++) {\n formData.imageSet1[i].selected = false\n }\n for(i = 0; i < formData.imageSet2.length; i++) {\n formData.imageSet2[i].selected = false\n }\n for(i = 0; i < formData.imageSet3.length; i++) {\n formData.imageSet3[i].selected = false\n }\n}", "function handleSelections()\n{\n \n $('#searchForm').on('submit', function(event)\n {\n event.preventDefault();\n\n let sportsQuery = $('#js_sport option:selected').text(); \n\n $(\"option[value='select']\").attr(\"disabled\", \"disabled\");\n \n let $location = $('#searchArea').val() ;\n\n let $startDate = $('#startDate').val() ;\n\n let $endDate = $('#endDate').val();\n\n let extras = {};\n\n extras.restaurants = $('#restaurant').is(':checked');\n extras.parking = $('#parking').is(':checked');\n extras.hotel = $('#hotel').is(':checked');\n\n let apiQuery = \n {\n sport : sportsQuery,\n extraQuery : extras,\n location : $location,\n start : $startDate,\n end : $endDate\n };\n\n handleAPIRequests(apiQuery);\n\n });\n\n}", "function requestAssociations() {\n return {\n type: actionTypes.REQUEST_ASSOCIATIONS,\n };\n}", "function formPreRequisits(){\n $.get({\n async: false,\n url: '\\getbus',\n dataType: 'JSON'\n }).done((response)=>{\n let checkBoxHtml = '';\n const checkBoxes = response.bus;\n $.each(checkBoxes, (checkBox, key)=>{\n checkBoxHtml += '<input type=\"checkbox\" class=\"chk-col-blue checkall\" name=\"buid[]\" id=\"' + key + '\" value=\"'+ key +'\" /><label for=\"' + key + '\">' + checkBox + '</label>';\n });\n $('.bus').html(checkBoxHtml);\n });\n \n $.get({\n async: false,\n url: '\\getusers',\n dataType: 'JSON'\n }).done((response)=>{\n var selectOpts = response.users;\n var optionsCount, pointer;\n optionsCount = pointer = response.users.length;\n if (users.children().length > 1) {\n users.children().first().siblings().remove();\n }\n while (pointer > 0) {\n var index = optionsCount - pointer;\n users.append('<option value=\"' + selectOpts[index] + '\">' + selectOpts[index] + '</option>');\n pointer--;\n }\n }).then(()=>{\n users.chosen('destroy');\n users.chosen({no_results_text: \"Oops, nothing found!\"});\n });\n}", "static associate(models) {\r\n // define association here\r\n }", "_unmarkAll() {\n if (!this.isEmpty()) {\n this._selection.forEach(value => this._unmarkSelected(value));\n }\n }", "_unmarkAll() {\n if (!this.isEmpty()) {\n this._selection.forEach(value => this._unmarkSelected(value));\n }\n }", "_unmarkAll() {\n if (!this.isEmpty()) {\n this._selection.forEach(value => this._unmarkSelected(value));\n }\n }", "function MSM_Save() {\n console.log(\"=== MSM_Save =========\");\n\n const has_permit = permit_dict.permit_crud_sameschool;\n\n if(has_permit){\n\n let new_array = [];\n let allowed_str = \"\"\n const tblBody_select = el_MSM_tblbody_select;\n for (let i = 0, row; row = tblBody_select.rows[i]; i++) {\n const base_pk_int = get_attr_from_el_int(row, \"data-pk\")\n if(base_pk_int > 0) {\n const is_selected = (!!get_attr_from_el_int(row, \"data-selected\"))\n if(is_selected){\n new_array.push(base_pk_int);\n\n };\n }\n }\n if(new_array){\n // PR2020-11-02 from https://www.w3schools.com/js/js_array_sort.asp\n new_array.sort(function(a, b){return a - b});\n };\n\n // --- upload changes\n // mod_MSM_dict = user_data_dict with additional keys\n const upload_dict = { user_pk: mod_MSM_dict.user_pk,\n schoolbase_pk: mod_MSM_dict.schoolbase_pk,\n mapid: mod_MSM_dict.mapid,\n mode: \"update\",\n allowed_clusters: (new_array.length) ? new_array : null };\n\n UploadChanges(upload_dict, urls.url_user_upload);\n };\n// hide modal\n $(\"#id_mod_select_multiple\").modal(\"hide\");\n } // MSM_Save", "function handleCompanySelection () {\n var currentCompany = $(this).closest(\"g\").find(\"label\");\n var currentCompanyName = currentCompany.attr(\"for\").toString();\n \n if(currentCompany.hasClass(\"selected\")) {\n var index = selectedCompanies.indexOf(currentCompanyName);\n currentCompany.removeClass(\"selected\");\n if (selectedCompanies.length <= 1) {\n $(\"#please\").fadeIn(650); \n }\n selectedCompanies.splice(index, 1); \n removeCompany(currentCompanyName, index);\n $(this).closest(\"g\").prependTo(\"#unselected-container\");\n } else {\n selectedCompanies.push(currentCompany.attr(\"for\").toString());\n var index = selectedCompanies.indexOf(currentCompanyName);\n addCompany(currentCompanyName, index);\n \n currentCompany.addClass(\"selected\");\n $(this).closest(\"g\").prependTo(\"#selected-container\");\n }\n \n console.log(selectedCompanies);\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {// define association here\n }", "static associate(models) {\n models.attraction.belongsTo(models.themePark)\n models.attraction.hasMany(models.attractionFavorites)\n models.attraction.belongsToMany(models.creative, {through: \"projectWork\"})\n }", "function submit() {\n saveForm(applicant)\n}", "static associate(models) {\n // define association here\n\n // M:N 관계\n models.users.belongsToMany(models.groups, {foreignKey:\"user_id\", through: models.usersmngroups}) \n models.users.belongsToMany(models.groups, {as:\"group_id\", foreignKey:\"user_id\", through: models.applicants}) \n models.users.belongsToMany(models.trophies, {foreignKey:\"user_id\", through: models.usersmntrophies}) \n }", "function reduceExpert() {\n var tempArr = [];\n // reduce contact\n for(var i = 0; i < $scope.expert.contacts.length; i++){\n tempArr.push($scope.expert.contacts[i].objectId);\n }\n $scope.expert.contacts = tempArr;\n // reduce Project\n for(var i = 0; i < $scope.expert.projectCompliance.length; i++){\n if($scope.expert.projectCompliance[i].project){\n $scope.expert.projectCompliance[i].project = $scope.expert.projectCompliance[i].project._id;\n }\n }\n }", "static associate( models ) {\n // define association here\n }", "function setFacilitiesInapplicable() {\n\n // Delete facilities.\n if (EventFormData.facilities.length > 0) {\n\n $scope.facilitiesError = false;\n EventFormData.facilities = [];\n\n var promise = eventCrud.updateFacilities(EventFormData);\n promise.then(function() {\n $scope.savingFacilities = false;\n $scope.facilitiesInapplicable = true;\n $scope.facilitiesCssClass = 'state-complete';\n }, function() {\n $scope.savingFacilities = false;\n $scope.facilitiesError = true;\n });\n\n }\n else {\n $scope.facilitiesInapplicable = true;\n $scope.facilitiesCssClass = 'state-complete';\n }\n }", "static associate(models) {\n // define association here\n models.inboundFavorite.belongsTo(models.outboundFavorite, {onDelete: \"CASCADE\"})\n //models.inboundFavorite.belongsToMany(models.user, {through: \"userInboundFavorite\"});\n }", "function updateRelationships(){\n\t\tconsole.log('gonna updateRelationships')\n\t\t//post per aggiornare relazione tra past e current.\n\t\tdate = new Date(Date.now());\n\t\t$.post(\"/relation\",{\n\t\t\tprevious: pastPlayerVideoId,\n\t\t\tclicked: getCurrentPlayerId(),\n\t\t\trecommender: currentPlayerRecommender,\n\t\t\tlastSelected: date\n\t\t}).done((data)=>{\n\t\t\tconsole.log('Relations Updated');\n\t\t})\n\t}", "function submitForm(e){\n\te.preventDefault();\n\n\t// data from form\n\tvar formData = $(this).serializeArray();\n\n\t// object to be passed to choregraphe\n\tvar symptomListToDiagnose = {};\n\n\t// set default to absent if not single type question\n\tsymptomItems.forEach(function(item){\n\t\tsymptomListToDiagnose[item.id] = 'absent';\n\t});\n\n\t// set checked choices to present (all the items in formData are the checked items)\n\tformData.forEach(function(item){\n\t\tsymptomListToDiagnose[item.value] = 'present';\n\t});\n\n\tsubmitDiagnosisToChoregraphe(symptomListToDiagnose);\n}", "function ui_toggleAssociatedCkboxes(arr_assocs){\n\tfor (var i=0; i<arr_assocs.length; i++){\n\n\t\tui_toggleChecked( arr_assocs[i] );\n\t}\n}", "static associate(models) {\n // define association here\n models.producto.belongsToMany(models.lista_producto, {through: this, foreignKey: 'productoId'})\n models.lista_producto.belongsToMany(models.producto, {through: this, foreignKey: 'listaId'})\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n Candidate.hasOne(models.Upload,{foreignKey: 'idKandidat', as: 'uploads', onDelete: 'CASCADE'})\n Candidate.hasOne(models.User,{foreignKey: 'idUser', as: 'users', onDelete: 'CASCADE'})\n }", "function modifyRelationship() {\n\t\t\tconsole.log(\"modifyRelationship() -> AlleleFearUpdateAPI()\");\n\n\t\t\t// check if record selected\n\t\t\tif(vm.selectedIndex < 0) {\n\t\t\t\talert(\"Cannot Modify if a record is not selected.\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n // skip duplicates; relationship type, marker\n var rKey = 0;\n var mKey = 0;\n var isMIduplicate = false;\n var isMInoreference = false;\n\t\t\tfor(var i=0;i<vm.apiDomain.mutationInvolves.length; i++) {\n rKey = vm.apiDomain.mutationInvolves[i].relationshipTermKey;\n mKey = vm.apiDomain.mutationInvolves[i].markerKey;\n\n if (rKey == \"\" || mKey == \"\") {\n continue\n }\n\n if (vm.apiDomain.mutationInvolves[i].refsKey == \"\") {\n isMInoreference = true;\n }\n\n\t\t\t for(var j=i+1;j<vm.apiDomain.mutationInvolves.length; j++) {\n if (\n vm.apiDomain.mutationInvolves[j].relationshipTermKey == rKey\n && vm.apiDomain.mutationInvolves[j].markerKey == mKey\n ) { \n vm.apiDomain.mutationInvolves[j].processStatus = \"x\";\n isMIduplicate = true;\n }\n }\n }\n //if (isMIduplicate) {\n //alert(\"Mutation Involves: duplicate found; the duplicate will be skipped.\");\n //}\n if (isMInoreference) {\n alert(\"MI: Reference is required.\");\n return;\n }\n \n // skip duplicates; organism, marker\n var oKey = 0;\n var mKey = 0;\n var isECduplicate = false;\n var isECnoreference = false;\n\t\t\tfor(var i=0;i<vm.apiDomain.expressesComponents.length; i++) {\n oKey = vm.apiDomain.expressesComponents[i].organismKey;\n mKey = vm.apiDomain.expressesComponents[i].markerKey;\n\n if (oKey == \"\" || mKey == \"\") {\n continue\n }\n\n if (vm.apiDomain.expressesComponents[i].refsKey == \"\") {\n isECnoreference = true;\n }\n\n\t\t\t for(var j=i+1;j<vm.apiDomain.expressesComponents.length; j++) {\n if (\n vm.apiDomain.expressesComponents[j].organismKey == oKey\n && vm.apiDomain.expressesComponents[j].markerKey == mKey\n ) { \n vm.apiDomain.expressesComponents[j].processStatus = \"x\";\n isECduplicate = true;\n }\n }\n }\n //if (isECduplicate) {\n //alert(\"Expresses Components: duplicate found; the duplicate will be skipped.\");\n //}\n if (isECnoreference) {\n alert(\"EC: Reference is required.\");\n return;\n }\n\n // skip duplicates; organism, marker\n var oKey = 0;\n var mKey = 0;\n var isDCduplicate = false;\n var isDCnoreference = false;\n\t\t\tfor(var i=0;i<vm.apiDomain.driverComponents.length; i++) {\n oKey = vm.apiDomain.driverComponents[i].organismKey;\n mKey = vm.apiDomain.driverComponents[i].markerKey;\n\n if (oKey == \"\" || mKey == \"\") {\n continue\n }\n\n if (vm.apiDomain.driverComponents[i].refsKey == \"\") {\n isDCnoreference = true;\n }\n\n\t\t\t for(var j=i+1;j<vm.apiDomain.driverComponents.length; j++) {\n if (\n vm.apiDomain.driverComponents[j].organismKey == rKey\n && vm.apiDomain.driverComponents[j].markerKey == mKey\n ) { \n vm.apiDomain.driverComponents[j].processStatus = \"x\";\n isDCduplicate = true;\n }\n }\n }\n //if (isDCduplicate) {\n //alert(\"Driver Components: duplicate found; the duplicate will be skipped.\");\n //}\n if (isDCnoreference) {\n alert(\"DC: Reference is required.\");\n return;\n }\n\n\t\t\tpageScope.loadingStart();\n\n\t\t\tAlleleFearUpdateAPI.update(vm.apiDomain, function(data) {\n\t\t\t\tif (data.error != null) {\n\t\t\t\t\talert(\"ERROR: \" + data.error + \" - \" + data.message);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tloadObject();\n\t\t\t\t}\n\t\t\t\tpageScope.loadingEnd();\n\t\t\t}, function(err) {\n\t\t\t\tpageScope.handleError(vm, \"API ERROR: AlleleFearUpdateAPI.update\");\n\t\t\t\tpageScope.loadingEnd();\n\t\t\t});\n\t\t}", "submit(e) {\n // e.preventDefault();\n this.currentStep++;\n\n\n const category_array = [];\n this.$checkboxInputs.forEach(function (element) {\n if (element.checked === true) {\n category_array.push(element.value)\n }\n });\n let institutionId = '';\n this.$thirdStepInputs.forEach(function (element) {\n if (element.checked === true) {\n institutionId = element.value\n\n }\n });\n\n // $.ajax({\n // type: \"POST\",\n // url: \"{% url 'add_donation' %}\",\n // data: {\n // 'quantity': this.$bagsInput.value,\n // 'categories': category_array,\n // 'institution': institutionId,\n // 'address': this.$addressInput,\n // 'phone_number': this.$phoneInput,\n // 'zip_code': this.$postcodeInput,\n // 'pick_up_date': this.$dateInput,\n // 'pick_up_time': this.$timeInput,\n // 'pick_up_comment': this.$postcodeInput,\n // 'user': this.$userId,\n // },\n // success: function () {\n // $('#message').html(\"<h2>Donation Form Submitted!</h2>\")\n // }\n // });\n // return false;\n\n this.updateForm();\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "function clearSelected() {\n selectedUser = null;\n selectedUserId = null;\n editIndex = null;\n }", "accept () {\n this.set('register', false)\n this.set('selectedAdjective', null);\n this.set('selectedNoun', null);\n this.set('selectedVerb', null);\n }", "function handleSubmit() {\n updateUserRecipeSelection();\n }", "static associate(models) {\n // define association here\n User.belongsToMany(models.Badge, { through: \"Achievement\" });\n User.hasMany(models.Achievement, { foreignKey: \"UserId\" });\n User.hasMany(models.Target, { foreignKey: \"UserId\" });\n User.hasMany(models.Transaction, { foreignKey: \"UserId\" });\n }", "static associate(models) {\n Accommodation.belongsTo(models.Location, {\n foreignKey: \"location_id\",\n });\n Accommodation.hasMany(models.Room, {\n foreignKey: \"accommodation_id\",\n as: \"rooms\",\n onDelete: \"cascade\"\n });\n Accommodation.hasMany(models.Rating, {\n foreignKey: \"accommodation_id\",\n onDelete: \"CASCADE\"\n });\n Accommodation.hasMany(models.Trips, {\n foreignKey: \"accommodation_id\",\n onDelete: \"CASCADE\"\n });\n Accommodation.hasMany(models.Rating,{\n foreignKey: \"accommodation_id\",\n onDelete: \"CASCADE\"\n });\n }", "associate () {\n // my one\n if (this.keys && this.keys.fks) {\n // need to link tables\n this.keys.fks.forEach(fk => {\n // look for the N side in 1:N\n const tableName = fk.tableName\n if(!this.db.tables[tableName]) {\n console.error('No foreign table', tableName)\n } else{\n // the foreign model\n fk.table = this.db.tables[tableName]\n }\n\n })\n }\n }", "function submitbutton(pressbutton)\r\n{\r\n\tif (pressbutton=='previewPage')\r\n\t{\r\n\t\tvar previewPage = document.getElementById('previewPage');\r\n\t\tpreviewPage.setAttribute(\"value\",\"1\");\r\n\t\tpressbutton = \"savePage\";\r\n\t} else if (pressbutton=='previewProject')\r\n\t{\r\n\t\tvar previewProject = document.getElementById('previewProject');\r\n\t\tpreviewProject.setAttribute(\"value\",\"1\");\r\n\t\tpressbutton = \"saveProject\";\r\n\t} else if (pressbutton=='uploadTokens')\r\n\t{\r\n\t\tdocument.adminForm.setAttribute('enctype','multipart/form-data');\r\n\t} else if (pressbutton=='removeTokens')\r\n\t{\r\n\t\tvar foundchecked = false;\r\n\t\tvar tokentable = document.getElementById('tokentable');\r\n\t\tvar chkboxes = tokentable.getElementsByTagName(\"input\");\r\n\t\tfor (var i=0; i<chkboxes.length; i++)\r\n\t\t{\r\n\t\t\tif (chkboxes[i].getAttribute('name')=='cid[]' && chkboxes[i].checked)\r\n\t\t\t{\r\n\t\t\t\tfoundchecked = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (!foundchecked)\r\n\t\t{\r\n\t\t\talert('Please select token(s) first!');\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (!confirm('Do you really want to remove the selected tokens?')) return;\r\n\t} else if (pressbutton=='copyQuestion')\r\n\t{\r\n\t\tvar selCopyquestion = document.getElementById('selCopyquestion');\r\n\t\tif (selCopyquestion.options[selCopyquestion.selectedIndex].value==-1)\r\n\t\t{\r\n\t\t\talert(\"Please select a question first!\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t} else if (pressbutton=='copyUsergroup')\r\n\t{\r\n\t\tvar selUsergroup = document.getElementById('selUsergroup');\r\n\t\tif (selUsergroup.options[selUsergroup.selectedIndex].value==-1)\r\n\t\t{\r\n\t\t\talert(\"Please select a usergroup first!\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t} else if (pressbutton=='removeUsergroups')\r\n\t{\r\n\t\tvar foundchecked = false;\r\n\t\tvar ugtable = document.getElementById('usergrouptable');\r\n\t\tvar chkboxes = ugtable.getElementsByTagName(\"input\");\r\n\t\tfor (var i=0; i<chkboxes.length; i++)\r\n\t\t{\r\n\t\t\tif (chkboxes[i].getAttribute('name')=='ugchk[]' && chkboxes[i].checked)\r\n\t\t\t{\r\n\t\t\t\tfoundchecked = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (!foundchecked)\r\n\t\t{\r\n\t\t\talert('Please select usergroup(s) first!');\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (!confirm('Do you really want to remove the selected usergroup(s)?')) return;\r\n\t} else if (pressbutton=='sendEmails' && !checkemail())\r\n\t{\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tdocument.adminForm.task.value=pressbutton;\r\n\tsubmitform(pressbutton);\r\n}", "function cookCoursesIfNeededToChooseSave(which) {\n switch (which) {\n case 'student':\n $.post('Controllers/adderAndAll/coursesController.php', {getAllChoose: null, which: which}, function (coursesToSign) {\n coursesToSign = JSON.parse(coursesToSign);\n //courses\n var texture = \"\";\n if (coursesToSign[0].length > 0) {\n ////start to organize it.\n coursesToSign[0].forEach(function (object, i) {\n texture += \"\" + object.name + \"&nbsp;<input class='i-b courseSelect' type='checkbox' data-courseId='\" + object.course_id + \"' value=''/>\";\n });\n }\n ;\n showAddCont({texture: texture, which: coursesToSign[1]});\n });\n break;\n case 'course':\n case 'administator':\n showAddCont({texture: \"\", which: which});\n break;\n }\n}", "loadSelections() {\n this.$state.go('textStorageRoot.selectionList', {\n topic: this.currentTopic,\n domain: this.currentDomain\n });\n }", "static associate (models) {\n // define association here\n }", "static associate (models) {\n // define association here\n }", "static associate (models) {\n // define association here\n }", "function saveParticipation() {\n var deferred = $q.defer();\n // collect organization information to save\n var organizations = [];\n // filter organizations for existing records\n _.each(service.activity.organizations, function (organization) {\n // ignore empty records\n if (organization.classification_id !== null && organization.id !== null) {\n var existing = _.find(organizations, function (o) { return o.id === organization.id });\n // the organization is already collected\n if (existing) {\n // update participation id if avialable \n if (existing.p_id === null && organization.p_id !== null) {\n existing.p_id = organization.p_id;\n }\n // organization is NOT marked for removal\n if (!organization.delete) {\n existing.classification_ids.push(organization.classification_id.toString());\n existing.classification_ids = _.uniq(existing.classification_ids);\n existing.delete = false;\n }\n }\n // the organization hasn't been collected\n else {\n // organization is marked for removal\n if (organization.delete) {\n // if the p_id is null, ignore because its not in the database to delete\n if (organization.p_id !== null) {\n // add the classification_ids parameter as an empty array, effectively removing classification\n _.extend(organization, { classification_ids: [] });\n }\n }\n else {\n // add the classification_ids parameter and populate with classification id\n _.extend(organization, { classification_ids: [organization.classification_id.toString()] });\n }\n organizations.push(organization);\n }\n }\n });\n _.each(organizations, function (org, idx) {\n var options = {\n instance_id: pmt.instance,\n user_id: $rootScope.currentUser.user.id,\n activity_id: service.activity.id,\n organization_id: org.id,\n participation_id: org.p_id,\n classification_ids: org.classification_ids.join() || null,\n edit_action: \"replace\",\n pmtId: pmt.id[pmt.env]\n };\n var header = {\n headers: { Authorization: 'Bearer ' + $rootScope.currentUser.token }\n };\n // delete record\n if (org.delete && org.classification_ids.length === 0) {\n options.edit_action = \"delete\";\n }\n // save record\n else {\n // new record\n if (!org.p_id) {\n options.edit_action = \"add\";\n }\n }\n // call the api\n $http.post(pmt.api[pmt.env] + 'pmt_edit_participation', options, header).success(function (data, status, headers, config) {\n var response = data[0].response;\n // the participation record was not saved successfully\n if (response.message !== 'Success') {\n service.activity.errors.push({ \"record\": \"organization\", \"id\": response.id, \"message\": response.message });\n }\n // if this is the last record return \n if (organizations.length === idx + 1) {\n deferred.resolve(organizations);\n }\n }).error(function (data, status, headers, c) {\n // if this is the last record return \n if (organizations.length === idx + 1) {\n deferred.resolve(organizations);\n }\n });\n });\n return deferred.promise;\n }", "static associate(models) { \n // define association here\n }", "static associate(models) {\n // The same subcategory can belong to many categories\n this.belongsTo(models.category, {\n onDelete: \"CASCADE\",\n onUpdate: \"CASCADE\",\n });\n\n // The same subcategory can belong to many products\n this.belongsToMany(models.product, {\n through: \"product_subcategory\",\n onDelete: \"RESTRICT\",\n onUpdate: \"CASCADE\",\n });\n }", "function clearArrays() {\n\t\tentities = entities.filter(filterByActive);\n\t\tataquesAliados = ataquesAliados.filter(filterByActive);\n\t\tataquesInimigos = ataquesInimigos.filter(filterByActive);\n\t}//clearArrays", "function saveJoinChange(mediaid, mediatype, obj) {\n // Prepare the form variables.\n var join_event = obj.closest('.social_data_all').find(\"input:radio[name=event_join]:checked\").val(); // returns: yes / no\n var guests_count = obj.closest('.social_data_all').find(\"#join_guests_number\").val();\n\n // If the user hasn't specified to join or not, halt the operation.\n if (join_event != 'yes' && join_event != 'no')\n return;\n\n\n $.ajax({\n url: ReturnLink('/ajax/ajax_userjoin_save_media.php'),\n data: {join_event: join_event, guests_count: guests_count, media: mediatype, mediaid: mediaid, page: 0},\n type: 'post',\n success: function (data) {\n var ret = null;\n try {\n ret = $.parseJSON(data);\n } catch (Ex) {\n return;\n }\n if (ret.error) {\n TTAlert({\n msg: ret.error,\n type: 'alert',\n btn1: t('ok'),\n btn2: '',\n btn2Callback: null\n });\n return;\n } else {\n //resetJoinsItems( obj.closest('.social_data_all') );\n //setJoinsItems(obj);\n getJoinDetails(obj.closest('.social_data_all'));\n\n initJoins(obj.closest('.social_data_all'));\n }\n }\n });\n}", "static associate(models) {\n // define association here\n this.myAssociation = this.belongsToMany(models.Project, {\n as: \"projects\",\n through: models.Profile_Projects,\n foreignKey: 'profile_id',\n otherKey: 'project_id',\n onDelete: 'CASCADE'\n });\n }", "function clearFields() {\n \t$('#frmMain').removeClass('submitted'); \t\n \t$('#frmDirectlyBolted').removeClass('submitted'); \t\n \t$('#frmPostWithEndPlate').removeClass('submitted'); \n \t\n \tclearFormFields('frmMain');\n \tclearFormFields('frmDirectlyBolted');\n \tclearFormFields('frmPostWithEndPlate');\n \t \t\n \t$(\"#txtShape\").val('S'); \n $(\"#ddlConnectiontypeMonoRail\").val('curvedRailsNO');\n $(\"#ddlConnectiontypeMonoRail\").trigger(\"change\");\n \t\n \t$('#ConnectiontypeMonorail').val(\"connectionTypeMonoEP\"); \t \t\n \t$(\"#ConnectiontypeMonorail\").trigger(\"change\");\n \t \t \t\n \t$(\".defaultValueZero\").val(0);\n \t\n \tUncheckAllCheckBox();\n \tclearSelect2Dropdown();\n \t\n \t$('#drpBoltGrade').val(getOptId('drpBoltGrade', BoGrGp)).change();\n \t$('#drpBoltDia').val(BoltDiaGP);\n \t\n \t$('.addTR').text(\"Add\");\n \tisEdit = false;\n \tSelected = [];\n }", "function processSubmitMainForm(e) {\n if (e.preventDefault) {\n e.preventDefault();\n }\n\n for (var j = 0; j < CHECKBOX_IDS.length; j++) {\n setRemoveItemToLocalstorage(\n CHECKBOX_IDS[j],\n createHttpHeaderFromFormById(CHECKBOX_IDS[j]));\n }\n\n // You must return false to prevent the default form behavior\n return false;\n}", "function sync_selected(evt) {\n\t\tvar nodes_selected = [];\n\t\tvar edges_selected = [];\n\t\tvar eles = g.elements(\"node:selected\");\n\t\t$(document).trigger(\"edit_mode\");\n\t\t$.each(eles, function(i, ele){\n\t\t\t// update the view information (position etc.)\n\t\t\tvar node_data = ele.data();\n\t\t\tvar pos = ele.renderedPosition();\n\t\t\tif (!node_data.view) {\n\t\t\t\tnode_data.view = {};\n\t\t\t}\n\t\t\tnode_data.view.position = pos;\n\t\t\tnodes_selected.push(node_data);\n\t\t});\n\t\t$('#node_editor').trigger(\"update_form\", [nodes_selected]);\n\t\t\n\t\t// next handle edges\n\t\teles = g.elements(\"edge:selected\");\n\t\t$.each(eles, function(i, ele){\n\t\t\tvar edge_data = ele.data();\n\t\t\tedges_selected.push(edge_data);\n\t\t});\n\t\t$(\"#edge_editor\").trigger(\"update_form\", [edges_selected]);\n\t}", "function btnExcludeSelected() {\n const eraseOnlySelected = document.querySelectorAll('.selected');\n for (let erase of eraseOnlySelected) {\n if (confirm('Tem certeza de que deseja excluir TODAS as atividades SELECIONADAS?')) {\n const nextParent = erase.parentNode;\n const theLastParent = nextParent.parentNode\n theLastParent.remove();\n }\n }\n archiveSet();\n }", "function uncheckAll(){\n $('#exploration').find('input[type=\"checkbox\"]:checked').prop('checked',false);\n for (var filter in checkboxFilters) {\n checkboxFilters[filter].active = false;\n }\n createDistricts();\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }", "static associate(models) {\n // define association here\n }" ]
[ "0.5511209", "0.5372658", "0.531038", "0.52924573", "0.51596075", "0.5127055", "0.5123417", "0.51117015", "0.51034164", "0.5090165", "0.5084233", "0.50790113", "0.5073295", "0.5064676", "0.5062036", "0.506079", "0.5054088", "0.50481683", "0.504514", "0.50447446", "0.50376046", "0.5032436", "0.50272167", "0.5016762", "0.5016555", "0.501296", "0.5007018", "0.5002096", "0.49926063", "0.4990077", "0.4988948", "0.4988948", "0.4988269", "0.49876618", "0.49826536", "0.49783358", "0.49783358", "0.49783358", "0.49783358", "0.49783358", "0.49783358", "0.49783358", "0.49783358", "0.49783358", "0.49783358", "0.49783358", "0.49707165", "0.49624687", "0.49571607", "0.49459255", "0.4942333", "0.4942108", "0.4941493", "0.4940898", "0.49351108", "0.49343127", "0.4928703", "0.4927046", "0.49266368", "0.49224305", "0.49210444", "0.49209782", "0.49153328", "0.49153328", "0.49153328", "0.4913915", "0.49138668", "0.4912472", "0.49086735", "0.49045926", "0.49038404", "0.4896688", "0.4896364", "0.4884678", "0.48834652", "0.48834652", "0.48834652", "0.48772204", "0.48761615", "0.48739177", "0.486788", "0.4864412", "0.48603842", "0.48602974", "0.48519373", "0.48519048", "0.48506752", "0.4847284", "0.48468018", "0.48468018", "0.48468018", "0.48468018", "0.48468018", "0.48468018", "0.48468018", "0.48468018", "0.48468018", "0.48468018", "0.48468018", "0.48468018", "0.48468018" ]
0.0
-1
load in associator checkboxes based on the current page number
function populateAssociatorCheckboxes(currentPage) { var associatorPreview = { 'excavations' : 'Title', 'archival objects' : 'Name', 'subjects' : 'Resource_Identifier'//go ask kora for this pls }; var populateCheckboxes = "<hr>"; currentPage = currentPage-1; //pages start at 1, but array index starts at 0 var startIndex = currentPage*10; //10 items per page for (var key=startIndex; key<startIndex+10 && key <associator_current_showing.length; key++) { var obj = associator_current_showing[key]; var kid = ''; var text = ''; var preview = obj[associatorPreview[meta_scheme_name]]; for (var field in obj) { if( obj.hasOwnProperty(field) && field != 'pid' && field != 'schemeID' && field != 'linkers' && field != associatorPreview[meta_scheme_name] ){ if (field == 'kid') { kid = obj[field]; } else if (field == 'Image Upload') { text += "<span class='metadata_associator'>" + 'Original Name: ' + obj[field]['originalName'] + "</span><br />"; } else { text += "<span class='metadata_associator'>" + field + ': ' + obj[field] + "</span><br />"; } } } populateCheckboxes += "<input type='checkbox' class='checkedboxes' name='associator-item-" + key + "' id='associator-item-" + key + "' value='" + kid + "' />" + "<label for='associator-item-" + key + "'><div style='float:left; width:111px;'>" + preview + " </div><div style='float:left; width:200px;'>" + "<span class='metadata_associator'>" + 'KID: ' + kid + "</span>" + "<br />" + text + "</div></label><br />"; } $("#associatorSearchObjects").scrollTop(0); //scroll back to top of the checkboxes on page change. $('#associatorSearchObjects').html(populateCheckboxes); //new page of content associator_selected.forEach(function (tempdata) { //check checkboxes that have already been selected $('#associatorSearchObjects input[value="' + tempdata + '"]').prop("checked", 'checked'); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectPagesInList() {\n\n\tif (($(this).children('input')).is(':checked')) {\n\n\t\t$(this).children('input').removeAttr('checked');\n\t\t$(this).removeClass('selected');\n\n\t} else {\n\n\t\t$(this).children('input').attr('checked', 'checked');\n\t\t$(this).addClass('selected');\n\t}\n}", "function prepareInitialCheckboxes() {\n\tfor (var i = 1; i <= $v(\"totalLines\");) {\n\t\tif (cellValue(i, \"application\") == 'All') {\n\t\t\tvar topRowId = i;\n\t\t\tvar preCompanyId = cellValue(topRowId, \"companyId\");\n\t\t\tvar preFacilityId = cellValue(topRowId, \"facilityId\");\n\t\t\tfor (i++; i <= $v(\"totalLines\"); i++) {\n\t\t\t\tif (preCompanyId == cellValue(i, \"companyId\") && preFacilityId == cellValue(i, \"facilityId\")) { //check if the row is still within scope\n\t\t\t\t\tfor (var j = 0; j <= $v(\"headerCount\"); j++) {\n\t\t\t\t\t\tvar colName = config[5 + 2 * j].columnId;\n\t\t\t\t\t\t//Note: 5 being the no. of columns before the Permission columns (starting from 0)\n\t\t\t\t\t\t// 2 * j is the index of the columns contain check boxes (skipping preceding hidden columns)\n\t\t\t\t\t\tif (cell(topRowId, colName).isChecked()) {\n\t\t\t\t\t\t\tif (cell(i, colName).isChecked())\n\t\t\t\t\t\t\t\tcell(i, colName).setChecked(false);\n\t\t\t\t\t\t\tcell(i, colName).setDisabled(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\n\t\t\t\t\tpreCompanyId = cellValue(i, \"companyId\");\n\t\t\t\t\tpreFacilityId = cellValue(i, \"facilityId\");\n\t\t\t\t} else\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} else\n\t\t\ti++;\n\t}\n}", "function paginationNav(pages) {\n for(var i = 0; i < pages; i++) {\n header.append('<a href=\"#\" data-page=\"'+i+'\" id=\"page-button\">'+(i+1)+'</a>'); // Adding one to offset the array but to keep math logic for Listener on pagination buttons\n if(i == (pageStart/pagerSize)) {\n $('#page-button').addClass('active');\n }\n }\n paginationButtons = $('#app a#page-button');\n header.prepend('<span><input type=\"checkbox\" id=\"checkbox\" checked />Paginate</span>');\n}", "function ajax_selected_boxes_pagination(onclick_field, paginate_class, container, address, div_loader, select_class_name, input_read, input_unread, input_all, delete_something ){\n\n\t\t$(onclick_field).on('click', paginate_class, function (e){\n\t\t\te.preventDefault(); \n\t\t\tvar page = $(this).attr('rel');\n\t\t\t//alert(page);\n\t\t\t$(container).load(address + page + div_loader, function(){\n\t\t\t\tselected_boxes(select_class_name, input_read, input_unread, input_all);\n\t\t\t\tdelete_something_pagination(delete_something);\n\t\t\t});\n\t\t});\t\n\t}", "function LoadCheckboxes()\n{\n\tvar data = datajson;\n\t$(\".locationContainer\").html(\"\");\n\tfor(var i = 0; i < data.length; i ++)\n\t{\n\t\t$(\".locationContainer\").append(\"<input type='checkbox' class='\"+data[i].name+\"-checkbox itemCheckbox' /><label>\"+data[i].name+\"</label>\");\n\t}\n\t$(\".itemCheckbox\").click(LoadMarkers);\n}", "function loadDatas(){\n pagination(\n $('#btnPagination .active').text(), \n $('#btnPagination .active')\n );\n}", "componentWillMount(pageNumber){\n if(pageNumber)this.setState({page:parseInt(pageNumber), list:[], progress:true, allSelected:false});\n axios(`${baseUrl}&page=${pageNumber ? pageNumber : this.state.page}`)\n .then(res => {\n let link = res.headers.link ? res.headers.link.split(',') : [];\n let total = this.props.match.params.page;\n link.forEach((item) => {\n if(item.indexOf('rel=\"last\"') > -1)\n total = item.substring(item.indexOf('&page=')+6,item.indexOf('>',item.indexOf('&page=')));\n });\n total = parseInt(total);\n this.setState({list: res.data.items.map(item => ({...item,checked:Desafio.checkIfisSelected(this.state.selectedItems,item)})), total, progress:false, total_count:res.data.total_count})\n this.setState({allSelected:Desafio.checkIfisAllSelected(this.state.list)});\n }).catch((erro) => {\n this.setState({erro:erro.message});\n })\n\n }", "function buildImageList(pageIds) {\n $.each(pageIds, function(id, pageId) {\n var li = '<li data-id=\"pagelistImage\">';\n li += '<input type=\"checkbox\" class=\"filled-in\" id=\"page' + pageId + '\" data-pageid=\"' + pageId + '\" />';\n li += '<label for=\"page' + pageId + '\"></label>';\n li += '<a href=\"#!\" data-pageid=\"' + pageId + '\" class=\"page-text\">Page ' + pageId + '</a><br />';\n li += '<a href=\"#!\" data-pageid=\"' + pageId + '\" ><img width=\"100\" src=\"\" style=\"display: none;\" /></a>';\n li += '</li>';\n $('#imageList').append(li);\n });\n\n // Direct checkbox events need to be initialized after their creation\n initializeMultiCheckboxSelection();\n\n // In case of reload, reset selectAll checkbox first\n if( $('#selectFilter').prop('indeterminate') === true || $('#selectFilter').prop('checked') === true )\n $('#selectFilter').click();\n\n // Select all pages (e.g. as default on page load)\n $('#selectFilter').click();\n\n // In case of reload and shown images, restore this setting after image list switch is finished\n var imageListTrigger = $('.image-list-trigger');\n if( $(imageListTrigger).hasClass('active') ) {\n $(imageListTrigger).removeClass('active');\n $(imageListTrigger).click();\n }\n}", "function loadChecked() {\n\tvar html = '';\n\tfor (var i = 0; i < selected.length; i++) {\n\t\tvar checkbox = document.getElementById(selected[i]);\n\t\t\thtml += '<input type=\"checkbox\" checked name=\"chooses\" value=\"'\n\t\t\t\t\t+ selected[i] + '\">';\n\t\t$('#' + selected[i]).prop('checked', true);\n\t}\n\t$('#addcheckbox').html(html);\n\n\t// set check all\n\tif (isCheckAll()) {\n\t\t$('#inputSelectAll').prop('checked', true);\n\t}\n}", "function setAssignmentPage(pageNumber) {\r\n //Variables\r\n ///The number of assignments on a page, determined by a select box\r\n var pageSize = $(\"#frm-assignment-page-num\").val();\r\n\r\n ///The number of assignments now on previous pages\r\n var offset = pageSize * pageNumber;\r\n\r\n\r\n //Change Page\r\n ///If the new offset is a valid number\r\n if(offset >= 0 || offset <= userSession.assignmentUserNum){\r\n ///Change the assignment page\r\n getAssignmentPage(offset); \r\n }\r\n}", "function ajax_approve_block_user_pagination(onclick_field, paginate_class, container, address, div_loader, select_class_name, input_read, input_unread, input_all, approve_disable_user){\n\n\t\t$(onclick_field).on('click', paginate_class, function (e){\n\t\t\te.preventDefault(); \n\t\t\tvar page = $(this).attr('rel');\n\t\t\t//alert(page);\n\t\t\t$(container).load(address + page + div_loader, function(){\n\t\t\t\tselected_boxes(select_class_name, input_read, input_unread, input_all);\n\t\t\t\tapprove_block_user(approve_disable_user);\n\t\t\t});\n\t\t});\t\n\t}", "function loadCheck(){\n\t\n\tvar i = 0;\n\tvar rowId;\n\tvar thisCheck = 0;\n\t\n\twhile(i < dataArray.length){\n\t\t\n\t\trowId = '#'+dataArray[i]+' .act_col > .chck_s';\n\t\t\n\t\t$(rowId).prop('checked', true);\n\t\tif($(rowId).is(':checked')){\n\t\t\tthisCheck++;\n\t\t}\n\t\t\n\t\ti++;\n\t}\n\n\tif(thisCheck > 0){\n\t\t$('#chck-all').prop('checked',true);\n\t}else{\n\t\t$('#chck-all').prop('checked',false);\n\t}\n\n\t\n}", "function chk_a(tabla){\n var new_array_pag=new Array();\n var temp_array_pag=new Array();\n var index,i=0;\n var sel_all = $($(tabla).children('thead')[0]).children('tr').children('th').children('input');\n var paginas = $(tabla+'_wrapper').children('div'+tabla+'_paginate').children('span').children('a');\n \n if(paginas.length > 1){\n $.each(paginas,function(index,pagina){\n $(pagina).attr('onclick','chk_a(\\''+tabla+'\\')');\n });\n //se valida cada ves que se cambia de pagina para chequear o deschequar el check de selecionar todo\n $.each(paginas, function(index, pagina){\n if(pagina['className'] === 'paginate_active'){\n pag_active = pagina['innerHTML'];\n }\n });\n existe_pag(pag_active,tabla,sel_all);\n $.each(array_pag, function(index, pag){\n if(pag[0]==parseInt(pag_active)){\n if(pag[1]){\n $.each(sel_all,function(index,data){\n data['checked']=true;\n });\n }else{\n sel_all.attr('checked',false);\n }\n }\n });\n }else{\n console.log('hay una pagina');\n } \n}", "function activateHotelFilteringCheckboxes(){\n $('.filterHotelCheckbox').click(function(){\n $(this).closest('div').prev('div.box-1').children('a.remove-small').show();\n sendFilterRequest($(this));\n });\n}", "function generateAssignmentPageMarkers (currentPage) {\r\n //Generate Page Markers\r\n ///Empty out the current page marker row\r\n $(\"#assignment-page-markers\").empty();\r\n\r\n ///The number of assignments on a page, determined by a select box\r\n var pageSize = $(\"#frm-assignment-page-num\").val();\r\n\r\n ///How many markers to generate - truncated by parse int so one is added if there are extraneous assignments\r\n var numOfMarkers = parseInt(userSession.assignmentNum / pageSize);\r\n\r\n if(userSession.assignmentNum % pageSize != 0) {\r\n numOfMarkers++;\r\n }\r\n\r\n ///For the number of markers that need to be generated\r\n for(var i = 0; i < numOfMarkers; i++)\r\n {\r\n ///If it is the currently selected page\r\n if(i === currentPage) {\r\n ///Append a selected page marker\r\n $(\"#assignment-page-markers\").append('<a class=\"page-marker-selected\">' + i + '</a>');\r\n } else { \r\n ///If it is not the currently selected page append a normal page marker\r\n $(\"#assignment-page-markers\").append('<a class=\"page-marker\" onclick=\"setAssignmentPage(' + i + ')\">' + i + '</a>');\r\n }\r\n }\r\n}", "function getPage(page) {\n var size = 10;\n var offset = (page - 1) * size;\n $.get(\"/get_total\", function (result) {\n var totalCount = result.count;\n if ($('#checkNameDesc').is(':checked')) {\n $.get('/get_sorted?page=' + page + '&size=' + size + '&sortBy=name&sortDir=DESC', function (json) {\n showTable(json, offset);\n pageBar(totalCount, size);\n });\n } else if ($('#checkNameAsc').is(':checked')) {\n $.get('/get_sorted?page=' + page + '&size=' + size + '&sortBy=name&sortDir=ASC', function (json) {\n showTable(json, offset);\n pageBar(totalCount, size);\n });\n } else if ($('#checkCategoryDesc').is(':checked')) {\n $.get('/get_sorted?page=' + page + '&size=' + size + '&sortBy=category&sortDir=DESC', function (json) {\n showTable(json, offset);\n pageBar(totalCount, size);\n });\n } else if ($('#checkCategoryAsc').is(':checked')) {\n $.get('/get_sorted?page=' + page + '&size=' + size + '&sortBy=category&sortDir=ASC', function (json) {\n showTable(json, offset);\n pageBar(totalCount, size);\n });\n } else if ($('#checkRatingDesc').is(':checked')) {\n $.get('/get_sorted?page=' + page + '&size=' + size + '&sortBy=rating&sortDir=DESC', function (json) {\n showTable(json, offset);\n pageBar(totalCount, size);\n });\n } else if ($('#checkRatingAsc').is(':checked')) {\n $.get('/get_sorted?page=' + page + '&size=' + size + '&sortBy=rating&sortDir=ASC', function (json) {\n showTable(json, offset);\n pageBar(totalCount, size);\n });\n } else if ($('#checkPriceDesc').is(':checked')) {\n $.get('/get_sorted?page=' + page + '&size=' + size + '&sortBy=price&sortDir=DESC', function (json) {\n showTable(json, offset);\n pageBar(totalCount, size);\n });\n } else if ($('#checkPriceAsc').is(':checked')) {\n $.get('/get_sorted?page=' + page + '&size=' + size + '&sortBy=price&sortDir=ASC', function (json) {\n showTable(json, offset);\n pageBar(totalCount, size);\n });\n } else {\n $.get('/get_table?size=' + size + '&offset=' + offset, function (json) {\n showTable(json, offset);\n pageBar(totalCount, size);\n });\n }\n });\n}", "function buildPages(callback) {\n // our pagination page numbering\n $scope.pagesOption = [];\n // build our pages for pagination\n for(var i = 1; i <= $scope.pages; i++) {\n if(i==1)\n $scope.pagesOption.push({\n number: i,\n active: true\n })\n else\n $scope.pagesOption.push({\n number: i,\n active: false\n })\n }\n // initially set selected page to the first page\n $scope.selectedPage = $scope.pagesOption[0].number.toString()\n // run callback if available\n if( callback ) callback()\n }", "function onPageshow(e){\n\t\t\t\t\t\t\t\t\n\t\t\t\t//check selected\n\t\t\t\tcheckSelected();\n\t\t\t\t\t\t\t\t\n\t\t\t}", "function changePage(data,page)\r\n {\r\n var btn_next = document.getElementById(\"btn_next\");\r\n var btn_prev = document.getElementById(\"btn_prev\");\r\n var page_span = document.getElementById(\"page\");\r\n const tableArr = (data)\r\n const tableMain = document.getElementById(\"GridBody\");\r\n showHeaders(data)\r\n \r\n // Validate page\r\n if (page < 1) page = 1;\r\n if (page > numPages()) page = numPages();\r\n \r\n tableMain.innerHTML = \"\";\r\n\r\n for (var i = (page-1) * records_per_page; i < (page * records_per_page) && i < tableArr.length; i++) {\r\n let tableRowEle = '<tr class=\"table-row\">'\r\n tableRowEle += '<td>'+`<input type=\"checkbox\" id=\"check${i}\" value=\"${tableArr[i].primkey}\" class=\"tick\" /><label class=\"sall_check\" for=\"check${i}\">`+'<img src=\"images/check_box_outline_blank-black-18dp.svg\" /></label></th>'\r\n Object.entries(tableArr[i]).slice(1).forEach(entry => {\r\n const [key,value] =entry \r\n tableRowEle += `<td class=\"${key}\">`+value+'</td>'\r\n })\r\n tableRowEle += '</tr>'\r\n tableMain.innerHTML += tableRowEle\r\n }\r\n page_span.innerHTML = page + \"/\" + numPages();\r\n\r\n if (page == 1) {\r\n btn_prev.style.visibility = \"hidden\";\r\n } else {\r\n btn_prev.style.visibility = \"visible\";\r\n }\r\n\r\n if (page == numPages()) {\r\n btn_next.style.visibility = \"hidden\";\r\n } else {\r\n btn_next.style.visibility = \"visible\";\r\n }\r\n }", "function specific_pagination(onclick_field, paginate_class, article, container, address, page, div_loader, input_class_name_for_selecting_all, input_class_name_for_selecting_each ){\n\t\t$(onclick_field).on('click', paginate_class, function(e){\n\t \t\te.preventDefault();\n\t \t\tvar page_id = $(this).attr('rel');\n\t \t\tvar article_id = $(article).data(\"article-id\");\n\t \t\t//alert(page_id);\n\t \t\t$(container).load(address + article_id + '&' + page + '=' + page_id + div_loader, function(){\n\t \t\t\tajax_select_all_boxes(onclick_field, input_class_name_for_selecting_all, input_class_name_for_selecting_each);\n\t \t\t});\n\n\t \t});\n\t}", "function cambioPago() {\n var metodoSelecionado = $('input[name=\"TipoPago\"]:checked').val();\n $('#modalidad').val(metodoSelecionado);\n var arr = [\"efectivo\", \"tarjeta\", \"mixto\"];\n if (parseInt(metodoSelecionado) == 1) {\n loadEfectivo(arr[0], arr[1], arr[2]);\n }\n if (parseInt(metodoSelecionado) == 2) {\n loadTarjeta(arr[1], arr[0], arr[2]);\n }\n if (parseInt(metodoSelecionado) == 3) {\n loadMixto(arr[2], arr[1], arr[0]);\n }\n}", "function beforeLoad(context) {\r\n var itemSublist = context.form.getSublist({\r\n id: 'item'\r\n });\r\n //this checkbox will trigger the logic on the Client Script\r\n var manuBtn = itemSublist.addField({\r\n id: 'custpage_manu_select',\r\n label: 'Select ManuFacturer',\r\n type: serverWidget.FieldType.CHECKBOX\r\n });\r\n // context.form.insertField({\r\n // field: manuBtn,\r\n // nextfield: 'quantity'\r\n // });\r\n }", "function loadSelector() {\n for (var i = 0; i < core.n_; i++) {\n $('#page-selector').append(\n [\"<option value='\", i, \"'>\", i + 1, '</option>'].join('')\n );\n }\n}", "function SelectAllCheckBox(){\n angular.forEach(CycleCountLineCtrl.ePage.Entities.Header.Data.UIWmsCycleCountLine, function (value, key) {\n var startData = CycleCountLineCtrl.ePage.Masters.CurrentPageStartingIndex\n var LastData = CycleCountLineCtrl.ePage.Masters.CurrentPageStartingIndex + (CycleCountLineCtrl.ePage.Masters.Pagination.ItemsPerPage);\n \n if (CycleCountLineCtrl.ePage.Masters.SelectAll){\n // Enable and disable based on page wise\n if((key>=startData) && (key<LastData)){\n if(value.Status!='CLO'){\n value.SingleSelect = true;\n }\n }\n }\n else{\n if((key>=startData) && (key<LastData)){\n value.SingleSelect = false;\n }\n }\n });\n\n var Checked1 = CycleCountLineCtrl.ePage.Entities.Header.Data.UIWmsCycleCountLine.some(function (value, key) {\n return value.SingleSelect == true;\n });\n if (Checked1) {\n CycleCountLineCtrl.ePage.Masters.EnableDeleteButton = true;\n CycleCountLineCtrl.ePage.Masters.EnableCopyButton = true;\n CycleCountLineCtrl.ePage.Masters.EnableCloseLineButton = true;\n } else {\n CycleCountLineCtrl.ePage.Masters.EnableDeleteButton = false;\n CycleCountLineCtrl.ePage.Masters.EnableCopyButton = false;\n CycleCountLineCtrl.ePage.Masters.EnableCloseLineButton = false;\n }\n }", "function process_checkboxes(items,namespace) {\n $(':checkbox').each(function () {\n // enable checkboxes\n $(this).prop('disabled', false);\n\n // set checkbox value attribute\n if ($(this).val() === 'on') {\n // Find first sibling with a value or data-value attribute\n const sib = $(this).siblings('span[data-value],a[value],span[value],a[data-value]');\n let v = sib.attr('data-value');\n if (typeof v === 'undefined') {\n v = sib.attr('value');\n }\n\n if (typeof v === 'undefined') {\n // Fall back to the href of a link element\n v = $(this).siblings('a').attr('href');\n }\n\n if (typeof v === 'undefined') {\n v = 'skip';\n }\n\n $(this).val(v);\n }\n\n // apply stored settings\n if (items[$(this).val()]) {\n $(this).prop('checked', true);\n } else {\n $(this).prop('checked', false);\n }\n\n // create function to update on click\n $(this).click(function () {\n const v = $(this).val()\n if (v !== 'skip') {\n if ($(this).prop('checked')) {\n items[v] = true;\n $(':checkbox[value=\"' + v + '\"]').prop('checked', true);\n } else {\n items[v] = false;\n $(':checkbox[value=\"' + v + '\"]').prop('checked', false);\n }\n try {\n CarnapServerAPI.putAssignmentState(namespace,items);\n } catch {\n console.log('Unable to access CarnapServerAPI');\n }\n }\n });\n });\n}", "function pageRelatedFeatures(){\n switch(data.page){\n case \"Home\": loadHomePage(); break;\n case \"Shop\": loadShopPage(); break;\n case \"Contact\": loadContactPage(); break;\n }\n}", "function pageNavigator(pagenumber) {\n var pages = ['index-pg', 'product-pg', 'cart-pg', 'delivery-pg', 'contact-pg'];\n var listnum = ['ls1', 'ls2', 'ls3', 'ls5', 'ls6'];\n document.getElementById(pages[pagenumber]).className = \"_active \";\n document.getElementById(listnum[pagenumber]).className = \"_active \";\n for (var i = 0; i < pages.length; i++) {\n if (i !== pagenumber) {\n document.getElementById(pages[i]).className = \"_inacitve\";\n document.getElementById(listnum[i]).className = \"_inactive \";\n }\n }\n\n}", "function pageselectCallback(page_index, jq)\n {\n // 从表单获取每页的显示的列表项数目\n var items_per_page = $(\"#items_per_page\").val();\n var max_elem = Math.min((page_index+1) * items_per_page, $(\"#hiddenresult .showing\").length);\n\n opts.focus_2.html(\"\");\n // 获取加载元素\n for(var i=page_index*items_per_page;i<max_elem;i++){\n opts.focus_2.append($(\"#hiddenresult .showing:eq(\"+i+\")\").clone());\n }\n //阻止单击事件\n return false;\n }", "function ui_toggleAssociatedCkboxes(arr_assocs){\n\tfor (var i=0; i<arr_assocs.length; i++){\n\n\t\tui_toggleChecked( arr_assocs[i] );\n\t}\n}", "function setPage() {\n $(\"#name\").focus();\n $(\"#other-title\").hide();\n $(\"#title option\").first().prop(\"selected\", true);\n $(\"input\").val(\"\");\n $(\"#design option\").first().prop(\"selected\", true);\n $(\"#colors-js-puns\").hide();\n $(\":checked\").each((i, e) => {\n $(e).prop(\"checked\", false);\n });\n $ (\".activities\").append('<p class=\"total\">Total: <span>$0</span></p>');\n displayPaymentOptions(\"firstLoad\");\n}", "function loadPage(page_num, filename) {\n var chants_on_page = [];\n if (pageHasChanged()) {\n chants_on_page = antiphoner.getChants(data.current_folio);\n $('#metadata-tab').html(incipit_template({incipits: chants_on_page, folio: data.current_folio}));\n $('#metadata-tab h3').click(function () {\n $(this).next('.metadata').slideToggle().siblings('.metadata:visible').slideUp();\n });\n }\n }", "function generateSectionCheckboxes() {\n var dataDef = {\"requestType\": \"getSections\", \"session\": getCookie(\"token\"), \"username\": getCookie(\"username\")};\n var urlDef = \"/cgi-bin/request.py\";\n var dataTypeDef = \"json\";\n //$.post(urlToSubmitTo, dataToSubmit, successFunctionToRunOnReturn, expectedReturnType)\n $.post(urlDef, dataDef, setSections, dataTypeDef);\n}", "function sel_todo(tabla, id_check, event){\n event.stopImmediatePropagation();\n var checkboxs = $(tabla).children('tbody').children('tr').children('td').children('input');\n var paginas = $(tabla+'_wrapper').children('div'+tabla+'_paginate').children('span').children('a');\n if($(id_check).is(':checked')){\n //se verifica en el array de las paginas para colocar que se seleccionaron todos los elementos de esa pagina\n chg_array_value(paginas, true);\n //se chequean los checkbox y se agragan a la lista\n $.each(checkboxs, function(index, checkbox){\n if(!checkbox['checked']){\n checkbox['checked'] = true;\n agrupar(id_check.substring(5), checkbox['id']); \n }\n });\n }else{\n chg_array_value(paginas,false);\n $.each(checkboxs, function(index, checkbox){\n checkbox['checked'] = false;\n agrupar(id_check.substring(5), checkbox['id']);\n });\n }\n \n}", "function activarcheckbox(bigdata){\n $.each(bigdata, function(key, item) {\n //if(key==\"productos\"){\n let inicial=key.substring(0, 4);\n console.log(key, item, inicial);\n $('input#'+key).iCheck('check');\n if(!getAccess(item, 1)){\n $('#vie'+inicial).iCheck('uncheck') \n }\n if(!getAccess(item, 2)){\n $('#adi'+inicial).iCheck('uncheck') \n }\n if(!getAccess(item, 4)){\n $('#edi'+inicial).iCheck('uncheck') \n }\n\n if(!getAccess(item, 8)){\n $('#del'+inicial).iCheck('uncheck') \n }\n\n if(!getAccess(item, 16)){\n $('#pri'+inicial).iCheck('uncheck') \n }\n\n if(!getAccess(item, 32)){\n $('#act'+inicial).iCheck('uncheck') \n }\n\n if(!getAccess(item, 64)){\n $('#sel'+inicial).iCheck('uncheck') \n }\n\n if(!getAccess(item, 128)){\n $('#pay'+inicial).iCheck('uncheck') \n }\n\n if(!getAccess(item, 256)){\n $('#acc'+inicial).iCheck('uncheck')\n }\n //}\n });\n}", "function paginationOnClick() {\n $(\".page\").each(function(){\n $(this).click(function(e) {\n $('#contenu').load($(this).attr(\"href\"), [], paginationOnClick );\n console.log($(this).attr(\"href\"));\n e.preventDefault();\n })\n });\n }", "function setPageElements() {\n\n // removes any error message shown from previous request.\n $(\".issue\").removeClass(\"show\");\n\n var carDetails = JSON.parse(localStorage.getItem(\"carDetails\"));\n\n // set all fault options to original state by removing hide class\n $('.faultOption').removeClass('hide');\n\n // iterate through carDetails object and if the value is of type boolean and it is false add hide class\n for (var key in carDetails) {\n if (typeof carDetails[key] === \"boolean\" && !carDetails[key]) {\n $(\"#\" + key).addClass('hide');\n }\n }\n\n // set page 2 button height and span depending on number and parity of buttons\n var hiddenOptions = $('.faultOption.hide').length;\n var totalOptions = $('.faultOptions').children().length;\n var options = totalOptions - hiddenOptions;\n var optionParity = options % 2;\n\n if (options > 6) {\n $('.faultOption').css(\"height\", \"50px\");\n }\n\n if (optionParity === 1) {\n $('#other').css(\"grid-column\", \"span 2\");\n }\n\n}", "updateCheckboxes() {\n for (const id of this.compareList.keys()) {\n this._checkCheckbox(id);\n }\n }", "function existe_pag(pag_active,tabla,sel_all){\n var exist;\n for (i = 0; i < array_pag.length; i++) { \n if(array_pag[i][0] === parseInt(pag_active)){\n exist = true;\n break; \n }else{\n exist = false;\n }\n }\n if(!exist){\n //en caso que la pagina no este en el array de paginas se agrega para tenerla en cuenta para validar si esta checked\n temp_array_pag = [];\n new_array_pag = [];\n\n paginas = $(tabla+'_wrapper').children('div'+tabla+'_paginate').children('span').children('a');\n $.each(paginas, function(index, pagina){\n new_array_pag.push(parseInt($(pagina).html()));\n });\n\n $.each(array_pag, function(index, data){\n temp_array_pag.push(parseInt(data[0]));\n });\n\n $.each(new_array_pag,function(index, pagina){\n if($.inArray(new_array_pag[index], temp_array_pag)==-1){\n array_pag.push([new_array_pag[index], false]);\n sel_all.attr('checked',false);\t\t \n }\n });\n }\n}", "function initDiscoveryPage() {\r\n manageState(actions.businessStructureStep);\r\n $(\"#previous\").click(function () {\r\n $(window).scrollTop($('#heading').offset().top);\r\n $(\"#previous\").blur();\r\n manageState(previousAction);\r\n });\r\n $(\"#next\").click(function () {\r\n if (isTrust) {\r\n \tif (currentAction == actions.businessStructureStep || currentAction == actions.helpMeDecideResultStep) {\r\n \twindow.location.href = \"trust.html\";\r\n }\r\n }\r\n if (currentAction == actions.finishedStep) {\r\n \t// finished selecting, start applying...\r\n \tvar queryStr = \"?type=\";\r\n \tvar first = true;\r\n \t$(\"input[type=checkbox]:checked\").each(function(i, item) {\r\n \t\tfirst?first=false:queryStr+=',';\r\n \t\tqueryStr += item.id;\r\n \t});\r\n \tlocation.href = \"../register.html\" + queryStr;\r\n \treturn;\r\n }\r\n $(window).scrollTop($('#heading').offset().top);\r\n $(\"#next\").blur();\r\n if (!ifAnythingSelected(\"questions\") && previousAction != actions.helpMeDecideStep\r\n \t && previousAction != actions.helpMeDecideSelectStep && previousAction != actions.employeeStep\r\n \t && previousAction != actions.activityGSTStep) { // ignore step 4\r\n $(\"#validation\").show();\r\n $(window).scrollTop($('#validation').offset().top);\r\n $(\".scroll\").click(function (event) {\r\n event.preventDefault();\r\n var full_url = this.href;\r\n var parts = full_url.split(\"#\");\r\n var trgt = parts[1];\r\n var target_offset = $(\"#\" + trgt).offset();\r\n var target_top = target_offset.top;\r\n jQuery('html, body').animate({\r\n scrollTop: target_top\r\n }, 1200);\r\n });\r\n return;\r\n }\r\n manageState(nextAction);\r\n });\r\n}", "getEligiblePages() {\n const { form, route: { pageConfig, pageList } } = this.props;\n const eligiblePageList = getActivePages(pageList, form.data);\n // Any `showPagePerItem` pages are expanded to create items for each array item.\n // We update the `path` for each of those pages to replace `:index` with the current item index.\n const expandedPageList = expandArrayPages(eligiblePageList, form.data);\n // We can't check the pageKey for showPagePerItem pages, because multiple pages will match\n const pageIndex = pageConfig.showPagePerItem\n ? _.findIndex(item => item.path === this.props.location.pathname, expandedPageList)\n : _.findIndex(item => item.pageKey === pageConfig.pageKey, expandedPageList);\n return { pages: expandedPageList, pageIndex };\n }", "function check() {\n document.getElementById(\"next\").disabled = currentPage == numberOfPages ? true : false;\n document.getElementById(\"previous\").disabled = currentPage == 1 ? true : false;\n document.getElementById(\"first\").disabled = currentPage == 1 ? true : false;\n document.getElementById(\"last\").disabled = currentPage == numberOfPages ? true : false;\n}", "function check() {\n document.getElementById(\"next\").disabled = currentPage == numberOfPages ? true : false;\n document.getElementById(\"previous\").disabled = currentPage == 1 ? true : false;\n document.getElementById(\"first\").disabled = currentPage == 1 ? true : false;\n document.getElementById(\"last\").disabled = currentPage == numberOfPages ? true : false;\n}", "function showPage(listOfStudents, paginationPageSelected) {\r\n //if the first paginatinon button is selected the last index = 9, if the second pagination button is selected the last index = 19 etc\r\n const lastIndexToDisplay = (paginationPageSelected*10)-1;\r\n const firstIndexToDisplay = lastIndexToDisplay - 9;\r\n //make list items are hidden\r\n for(let i=0; i < list.length; i+=1) {\r\n document.querySelector('ul.student-list').children[i].style.display = 'none'//hides all\r\n }\r\n // of the matchedList, make sure that the onces within the selected index are revealed\r\n for(let i=0; i < listOfStudents.length; i+=1) {\r\n if(i >= firstIndexToDisplay && i <= lastIndexToDisplay) {\r\n // if the index of the matchedList is in the required range, reveal it!!!\r\n listOfStudents[i].style.display= '';\r\n }\r\n }\r\n}", "_loadOptions() {\n let include = storage.data[OPT_INCLUDE] || this._incl;\n let range = storage.data[OPT_RANGE] || this._range;\n \n for (let [key, val] of Object.entries(include)) {\n this._cboxes[key].checked = val;\n if (val && key !== 'reversals') {\n this._numCBoxesChecked++;\n }\n }\n this._selectRangeRows(range.low, range.high);\n this._incl = include;\n this._range = range;\n this._updateRangeAvailability();\n }", "function checkBox() {\n var foobar = $('#foobar'),\n checkbox;\n\n for (var key in FamilyGuy) {\n foobar.append('<input type=\"checkbox\" id=\"' + key + '\"/>' +\n '<label for=\"' + key + '\">' + FamilyGuy[key].last_name + '</label>')\n }\n\n foobar.append('<p><a href=\"#\" id=\"enable\">Enable All</a></div><br /><div><a href=\"#\" id=\"disable\">Disable All</a></p>');\n\n $('#enable').on('click', function () {\n en_dis_able(true);\n });\n\n $('#disable').on('click', function () {\n en_dis_able(false);\n });\n\n function en_dis_able(value) {\n checkbox = $('input[type=\"checkbox\"]');\n for (var i = 0, s = checkbox.length; i < s; i++) {\n checkbox[i].checked = value;\n }\n }\n }", "function createEditPg(){\n\tvar numberCheckboxChecked = countChkbox();\n\t\n}", "function initCheckboxes(){\n let checkboxes = document.getElementById(\"content1\").getElementsByTagName('input');\n let planetKeys = Object.keys(visualizer_list);\n let planetKeys2 = Object.keys(visualizer_list2);\n for(let x = 0; x < checkboxes.length; x++){\n let checkbox = checkboxes[x];\n let checkBoxId = checkboxes[x].id;\n let checkBoxBody = checkboxes[x].id.split(\"-\")[0];\n if(planetKeys.includes(checkBoxBody)){\n if(visualizer_list[checkBoxBody].hidden === true){\n checkbox.checked = false;\n }\n else {\n checkbox.checked = true;\n }\n //checkbox.checked = true;\n checkbox.removeAttribute(\"disabled\");\n checkbox.removeAttribute(\"class\");\n let bodyLabel = document.getElementById(checkBoxBody + \"-label1\");\n bodyLabel.removeAttribute(\"class\");\n }\n else{\n checkbox.disabled = true;\n }\n }\n if(comparing){\n for(let x = 0; x < checkboxes.length; x++){\n let checkbox = checkboxes[x];\n let checkBoxId = checkboxes[x].id;\n let checkBoxBody = checkboxes[x].id.split(\"-\")[0];\n if(planetKeys2.includes(checkBoxBody)){\n checkbox.checked = true;\n // if(visualizer_list[checkBoxBody].hidden === true){\n // checkbox.checked = false;\n // }\n // else {\n // checkbox.checked = true;\n // }\n checkbox.removeAttribute(\"disabled\");\n checkbox.removeAttribute(\"class\");\n let bodyLabel = document.getElementById(checkBoxBody + \"-label1\");\n bodyLabel.removeAttribute(\"class\");\n }\n }\n }\n addPlusToCheckboxes();\n}", "function showPage(pageNumber, listName) { // Takes arguments for page number and source list\n $(eachStudent).hide(); // Hides initial list of all students\n let currentLength = listName.length;\n for (let i = 0; i < currentLength; i++) { // Loops to check for right range\n if (i < pageNumber * studentsperPage && i + 1 > (pageNumber - 1) * studentsperPage) {\n $(listName[i]).show(); // Shows students in correct number range\n }\n }\n currentList = listName; // Sets current list so addPages knows how many pages to make\n}", "function studentpaginatorNextButton() {\n var nextClick = localStorage.getItem('nextpage');\n // var prevClick = localStorage.getItem('previouspage');\n if (parseInt(nextClick) >= 1) {\n $('#prevButton').show();\n $('#prevButton').css('background-color', '');\n $('#prevButton').css('color', '#007dc6');\n\n $('#nextButton').css('background-color', '#007dc6');\n $('#nextButton').css('color', 'white');\n\n var next = parseInt(nextClick) + 1;\n var prev = parseInt(nextClick);\n\n localStorage.setItem('nextpage', next);\n localStorage.setItem('previouspage', prev);\n } else {\n return false;\n }\n\n var queryString = $('#questionAjaxsearch').val();\n // --------------------------- next [search + pagination] ---------------------------------------------------------\n if (queryString.trim().length != 0) {\n // =======================================================\n var year = $('#questionYear').val();\n var courseId = $('#courseName').val();\n var subjectID = $('#subjectID').val();\n var topic = $('#topicID').val();\n\n var array1 = []\n var array2 = []\n var array3 = []\n var array4 = []\n \n console.log(year, '<=>', courseId, '<=>', subjectID, '<=>', topic);\n $(\"input:checkbox[name=Difficulty]:checked\").each(function () {\n \n if (array1.includes($(this).val())) {\n var index = array1.indexOf($(this).val());\n if (index > -1) {\n array1.splice(index, 1);\n }\n } else {\n array1.push($(this).val());\n }\n });\n\n $(\"input:checkbox[name=questionType]:checked\").each(function () {\n \n if (array2.includes($(this).val())) {\n var index = array2.indexOf($(this).val());\n if (index > -1) {\n array2.splice(index, 1);\n }\n } else {\n array2.push($(this).val());\n }\n });\n\n $(\"input:checkbox[name=language]:checked\").each(function () {\n \n if (array3.includes($(this).val())) {\n var index = array3.indexOf($(this).val());\n if (index > -1) {\n array3.splice(index, 1);\n }\n } else {\n array3.push($(this).val());\n }\n });\n\n $(\"input:checkbox[name=marks]:checked\").each(function () {\n \n if (array4.includes($(this).val())) {\n var index = array4.indexOf($(this).val());\n if (index > -1) {\n array4.splice(index, 1);\n }\n } else {\n array4.push($(this).val());\n }\n });\n\n var search_String = queryString;\n var page = next;\n // =======================================================\n Swal.fire({\n position: 'center',\n title: \"<b style='font-size:20px;font-weight:500;color:#1eb6e9;'>Loading...</b>\",\n showConfirmButton: false,\n onOpen: () => {\n Swal.showLoading();\n }\n })\n getSearchQuestion(year, courseId, subjectID, topic, array1, array2, array3, array4,search_String,page)\n\n // ---------------------------------------------------\n } else {\n // =======================================================\n var year = $('#questionYear').val();\n var courseId = $('#courseName').val();\n var subjectID = $('#subjectID').val();\n var topic = $('#topicID').val();\n\n var array1 = []\n var array2 = []\n var array3 = []\n var array4 = []\n \n console.log(year, '<=>', courseId, '<=>', subjectID, '<=>', topic);\n $(\"input:checkbox[name=Difficulty]:checked\").each(function () {\n \n if (array1.includes($(this).val())) {\n var index = array1.indexOf($(this).val());\n if (index > -1) {\n array1.splice(index, 1);\n }\n } else {\n array1.push($(this).val());\n }\n });\n\n $(\"input:checkbox[name=questionType]:checked\").each(function () {\n \n if (array2.includes($(this).val())) {\n var index = array2.indexOf($(this).val());\n if (index > -1) {\n array2.splice(index, 1);\n }\n } else {\n array2.push($(this).val());\n }\n });\n\n $(\"input:checkbox[name=language]:checked\").each(function () {\n \n if (array3.includes($(this).val())) {\n var index = array3.indexOf($(this).val());\n if (index > -1) {\n array3.splice(index, 1);\n }\n } else {\n array3.push($(this).val());\n }\n });\n\n $(\"input:checkbox[name=marks]:checked\").each(function () {\n \n if (array4.includes($(this).val())) {\n var index = array4.indexOf($(this).val());\n if (index > -1) {\n array4.splice(index, 1);\n }\n } else {\n array4.push($(this).val());\n }\n });\n\n var search_String = '';\n var page = next;\n // =======================================================\n Swal.fire({\n position: 'center',\n title: \"<b style='font-size:20px;font-weight:500;color:#1eb6e9;'>Loading...</b>\",\n showConfirmButton: false,\n onOpen: () => {\n Swal.showLoading();\n }\n })\n getSearchQuestion(year, courseId, subjectID, topic, array1, array2, array3, array4,search_String,page)\n\n }\n\n\n\n\n // -----------------------------------------------------------------------------------------------------------------\n}", "async loadPreviousPages() {\n logger.debug('AnnotationListWidget#loadPreviousPages', this._loading);\n try {\n if (this._loading) {\n return;\n }\n this._loading = true;\n const minHeight = this._rootElem.height() * this._minContentRelativeHeight;\n const numPages = this._nav.getNumPages();\n let scrollHeight = this._rootElem[0].scrollHeight;\n\n for (let nextPage = this._nav.getActiveRange().startPage - 1;\n nextPage >= 0 && scrollHeight < minHeight;\n scrollHeight = this._rootElem[0].scrollHeight, --nextPage)\n {\n logger.debug('AnnotationListWidget#_loadPreviousPages nextPage:', nextPage, 'scrollHeight:', scrollHeight, 'minHeight:', minHeight);\n await this._loadPage(nextPage);\n }\n } catch (e) {\n logger.error('AnnotationListWidget#loadPreviousPages failed', e);\n } finally {\n this._loading = false;\n }\n }", "function newAssignmentPage(change) {\r\n //Variables\r\n ///The number of assignments on a page, determined by a select box\r\n var pageSize = $(\"#frm-assignment-page-num\").val();\r\n\r\n ///How many assignments to change by\r\n var changeBy = pageSize * change;\r\n\r\n ///How many assignments are now in previous pages\r\n var offset = userSession.assignmentPageOffset + changeBy;\r\n\r\n\r\n //Change page\r\n ///If the new offset is a valid number\r\n if(offset >= 0 || offset <= userSession.assignmentNum){\r\n ///Change the assignment page\r\n getAssignmentPage(offset); \r\n }\r\n}", "function selectAllSections() {\n $(\"#section-frame\").children(\"div\").each(function(index, value) { \n $(\"#\"+value.id+\"-checkbox\").prop(\"checked\", true);\n });\n}", "function ajax_pagination(onclick_field, paginate_class, container, address, div_loader, div_on_click, input_class_name_for_selecting_all, input_class_name_for_selecting_each, delete_something ){\n\n\t\t$(onclick_field).on('click', paginate_class, function (e){\n\t\t\te.preventDefault(); \n\t\t\tvar page = $(this).attr('rel');\n\t\t\t//alert(page);\n\t\t\t$(container).load(address + page + div_loader, function(){\n\t\t\t\tajax_select_all_boxes(div_on_click, input_class_name_for_selecting_all, input_class_name_for_selecting_each);\n\t\t\t\tdelete_something_pagination(delete_something);\n\t\t\t});\t\t\n\t\t});\n\t}", "function showCheckBox(data) {\n \t// update checkboxes\n \tdojo.forEach(data, function(item){\n \t\t\t\t\titem.chkBoxUpdate = '<input type=\"checkbox\" align=\"center\" id=\"'+item.expdIdentifier+'\" onClick=\"getCheckedRows(this)\" />';\n \t\t\t\t\titem.chkBoxUpdate.id = item.expdIdentifier;\n \t\t\t\t});\n \t\n \t// Standard checkboxes\n \tdojo.forEach(data, function(item){\n \t\tif (item.includesStd == \"Y\"){\n \t\t\titem.chkBoxStd = '<input type=\"checkbox\" disabled align=\"center\" id=\"'+item.expdIdentifier+'cb'+'\" checked=\"checked\"/>';\n\t\t\t\t\t} else{\n\t\t\t\t\titem.chkBoxStd = '<input type=\"checkbox\" disabled align=\"center\" id=\"'+item.expdIdentifier+'cb'+'\"/>';\n\t\t\t\t\t}\n\t\t\t\t\titem.chkBoxStd.id = item.expdIdentifier + 'cb';\n\t\t\t\t});\n }", "function pageing() {\r\n opts.actualPage = $(\"#ddPaging\").val();\r\n bindDatasource();\r\n }", "function loadNetworkApp()\n{\n $('#STA_HTTP_SID_1').prop(\"checked\", project.systemFiles.CONFIG_TYPE_MODE.STA_START_APPS & 1);\n $('#STA_MDNS_ID_4' ).prop(\"checked\", project.systemFiles.CONFIG_TYPE_MODE.STA_START_APPS & 4 );\n \n $('#AP_HTTP_SID_1').prop(\"checked\", project.systemFiles.CONFIG_TYPE_MODE.AP_START_APPS & 1 );\n $('#AP_DHCP_SID_2').prop(\"checked\", project.systemFiles.CONFIG_TYPE_MODE.AP_START_APPS & 2 );\n $('#AP_MDNS_ID_4' ).prop(\"checked\", project.systemFiles.CONFIG_TYPE_MODE.AP_START_APPS & 4 );\n $('#AP_DNS_SID_8' ).prop(\"checked\", project.systemFiles.CONFIG_TYPE_MODE.AP_START_APPS & 8 );\n \n $('#CLS_HTTP_SID_1').prop(\"checked\", project.systemFiles.CONFIG_TYPE_MODE.P2P_CLS_START_APPS & 1 );\n $('#CLS_MDNS_ID_4' ).prop(\"checked\", project.systemFiles.CONFIG_TYPE_MODE.P2P_CLS_START_APPS & 4 );\n \n $('#GO_HTTP_SID_1').prop(\"checked\", project.systemFiles.CONFIG_TYPE_MODE.P2P_GO_START_APPS & 1 );\n $('#GO_DHCP_SID_2').prop(\"checked\", project.systemFiles.CONFIG_TYPE_MODE.P2P_GO_START_APPS & 2 );\n $('#GO_MDNS_ID_4' ).prop(\"checked\", project.systemFiles.CONFIG_TYPE_MODE.P2P_GO_START_APPS & 4 );\n $('#GO_DNS_SID_8' ).prop(\"checked\", project.systemFiles.CONFIG_TYPE_MODE.P2P_GO_START_APPS & 8 );\n \n //document.getElementById('STA_HTTP_SID_1' ).checked = (project.systemFiles.CONFIG_TYPE_MODE.STA_START_APPS & 1 );\n //document.getElementById('STA_DHCP_SID_2' ).checked = (project.systemFiles.CONFIG_TYPE_MODE.STA_START_APPS & 2 );\n //document.getElementById('STA_MDNS_ID_4' ).checked = (project.systemFiles.CONFIG_TYPE_MODE.STA_START_APPS & 4 );\n //document.getElementById('STA_DNS_SID_8' ).checked = (project.systemFiles.CONFIG_TYPE_MODE.STA_START_APPS & 8 );\n //document.getElementById('STA_DC_ID_16' ).checked = (project.systemFiles.CONFIG_TYPE_MODE.STA_START_APPS & 16 ); \n /*\n document.getElementById('AP_HTTP_SID_1').checked = (project.systemFiles.CONFIG_TYPE_MODE.AP_START_APPS & 1 );\n document.getElementById('AP_DHCP_SID_2').checked = (project.systemFiles.CONFIG_TYPE_MODE.AP_START_APPS & 2 );\n document.getElementById('AP_MDNS_ID_4' ).checked = (project.systemFiles.CONFIG_TYPE_MODE.AP_START_APPS & 4 );\n document.getElementById('AP_DNS_SID_8' ).checked = (project.systemFiles.CONFIG_TYPE_MODE.AP_START_APPS & 8 );\n //document.getElementById('AP_DC_ID_16' ).checked = (project.systemFiles.CONFIG_TYPE_MODE.AP_START_APPS & 16 ); \n \n document.getElementById('CLS_HTTP_SID_1').checked = (project.systemFiles.CONFIG_TYPE_MODE.P2P_CLS_START_APPS & 1 );\n //document.getElementById('CLS_DHCP_SID_2').checked = (project.systemFiles.CONFIG_TYPE_MODE.P2P_CLS_START_APPS & 2 );\n document.getElementById('CLS_MDNS_ID_4' ).checked = (project.systemFiles.CONFIG_TYPE_MODE.P2P_CLS_START_APPS & 4 );\n //document.getElementById('CLS_DNS_SID_8' ).checked = (project.systemFiles.CONFIG_TYPE_MODE.P2P_CLS_START_APPS & 8 );\n //document.getElementById('CLS_DC_ID_16' ).checked = (project.systemFiles.CONFIG_TYPE_MODE.P2P_CLS_START_APPS & 16 ); \n *\n document.getElementById('GO_HTTP_SID_1').checked = (project.systemFiles.CONFIG_TYPE_MODE.P2P_GO_START_APPS & 1 );\n document.getElementById('GO_DHCP_SID_2').checked = (project.systemFiles.CONFIG_TYPE_MODE.P2P_GO_START_APPS & 2 );\n document.getElementById('GO_MDNS_ID_4' ).checked = (project.systemFiles.CONFIG_TYPE_MODE.P2P_GO_START_APPS & 4 );\n document.getElementById('GO_DNS_SID_8' ).checked = (project.systemFiles.CONFIG_TYPE_MODE.P2P_GO_START_APPS & 8 );\n //document.getElementById('GO_DC_ID_16' ).checked = (project.systemFiles.CONFIG_TYPE_MODE.P2P_GO_START_APPS & 16 );\n */\n \n document.getElementById('STA_HTTP_SID_1').addEventListener('change', updateSTANetApp, false);\n //document.getElementById('STA_DHCP_SID_2').addEventListener('change', updateSTANetApp, false);\n document.getElementById('STA_MDNS_ID_4' ).addEventListener('change', updateSTANetApp, false);\n //document.getElementById('STA_DNS_SID_8' ).addEventListener('change', updateSTANetApp, false);\n //document.getElementById('STA_DC_ID_16' ).addEventListener('change', updateSTANetApp, false); \n \n document.getElementById('AP_HTTP_SID_1').addEventListener('change', updateAPNetApp, false);\n document.getElementById('AP_DHCP_SID_2').addEventListener('change', updateAPNetApp, false);\n document.getElementById('AP_MDNS_ID_4' ).addEventListener('change', updateAPNetApp, false);\n document.getElementById('AP_DNS_SID_8' ).addEventListener('change', updateAPNetApp, false);\n //document.getElementById('AP_DC_ID_16' ).addEventListener('change', updateAPNetApp, false); \n \n document.getElementById('CLS_HTTP_SID_1').addEventListener('change', updateCLSNetApp, false);\n //document.getElementById('CLS_DHCP_SID_2').addEventListener('change', updateCLSNetApp, false);\n document.getElementById('CLS_MDNS_ID_4' ).addEventListener('change', updateCLSNetApp, false);\n //document.getElementById('CLS_DNS_SID_8' ).addEventListener('change', updateCLSNetApp, false);\n //document.getElementById('CLS_DC_ID_16' ).addEventListener('change', updateCLSNetApp, false);\n \n document.getElementById('GO_HTTP_SID_1').addEventListener('change', updateGONetApp, false);\n document.getElementById('GO_DHCP_SID_2').addEventListener('change', updateGONetApp, false);\n document.getElementById('GO_MDNS_ID_4' ).addEventListener('change', updateGONetApp, false);\n document.getElementById('GO_DNS_SID_8' ).addEventListener('change', updateGONetApp, false);\n //document.getElementById('GO_DC_ID_16' ).addEventListener('change', updateGONetApp, false);\n \n}", "function changePage(n) {\n currentPage = Math.min(Math.max(1, n), totalPages);\n displayVenueList();\n}", "function selectCheckboxes(fm, v)\r\n\t{\r\n\t for (var i=0;i<fm.elements.length;i++) {\r\n\t var e = fm.elements[i];\r\n\t\t if (e.name.indexOf('active') < 0 &&\r\n\t\t e.type == 'checkbox')\r\n e.checked = v;\r\n\t }\r\n\t}", "function get_updated_controls(){\n selected_service_uids = [];\n $.each($(\"input:checked\"), function(i,e){\n selected_service_uids.push($(e).val());\n });\n\n if (window.location.href.search('add_control') > -1) {\n control_type = 'c';\n } else {\n control_type = 'b';\n }\n\n url = window.location.href.split(\"?\")[0]\n .replace(\"/add_blank\", \"\")\n .replace(\"/add_control\", \"\") + \"/getWorksheetReferences\"\n element = $(\"#worksheet_add_references\");\n if(element.length > 0){\n $(element).load(url,\n {'service_uids': selected_service_uids.join(\",\"),\n 'control_type': control_type,\n '_authenticator': $('input[name=\"_authenticator\"]').val()},\n function(responseText, statusText, xhr, $form) {\n }\n );\n };\n }", "function loadAnomalySelectionForm() {\n currentState = \"SelectAnomalyTypes\";\n customInputsTitle.innerText = \"Select Anomaly Presence\";\n customInputsContent.innerHTML = \"\";\n var anomalySelectionList = document.createElement(\"ul\");\n anomalySelectionList.setAttribute(\"id\", \"anomaly-selection-list\");\n anomalySelectionList.setAttribute(\"class\", \"selection-list\");\n for (var i in anomalySelectionForm.anomalyTypes) {\n var type = anomalySelectionForm.anomalyTypes[i];\n var typeId = type + \"-count\";\n // create list item element\n var newListItem = document.createElement(\"li\");\n newListItem.setAttribute(\"id\", type + \"-list-item\");\n // create nubmer input element\n var numberField = document.createElement('input');\n numberField.setAttribute(\"class\", \"custom-input\");\n numberField.setAttribute(\"type\", \"number\");\n numberField.setAttribute(\"id\", typeId);\n numberField.setAttribute(\"min\", 0);\n numberField.setAttribute(\"max\", maxAnomalies);\n numberField.value = anomalySelectionForm.counts[type];\n // create label element for checkbox\n var newLabel = document.createElement(\"label\");\n newLabel.setAttribute(\"for\", typeId);\n newLabel.innerText = type;\n // add elements to DOM\n newListItem.appendChild(numberField);\n newListItem.appendChild(newLabel);\n anomalySelectionList.appendChild(newListItem);\n }\n customInputsContent.appendChild(anomalySelectionList);\n}", "function loadCustomCheckbox() {\n const items = document.getElementById(\"items-checkbox\");\n for (let i = 0; i < beverages.length; i++) {\n const b = beverages[i];\n const element = `\n <div class=\"ck-button\">\n <label class=\"ck-button-checked\">\n <input id=\"cb${i + 1}\" type=\"checkbox\" value=\"${b.Name}\" onclick=\"onClickCheckbox(${i})\">\n <span>${b.Name} Rp. ${b.Price}</span>\n </label>\n </div>\n `;\n\n items.innerHTML += element;\n }\n}", "function saveForm() {\n var k;\n var checkbox;\n var option;\n var span;\n formData._id = formId;\n formData.numberOfPages = vm.numberOfPages;\n for (var i = 1; i <= vm.numberOfPages; i++) {\n var page = document.getElementById(\"page\" + i);\n for (var j = 1; j < page.childNodes.length; j++) {\n var node = page.childNodes[j];\n if ((node.nodeType !== 1) || (!node.hasAttribute('name'))) {\n continue;\n }\n var id = node.id;\n elements[id] = {};\n elements[id].name = node.getAttribute(\"name\");\n elements[id].page = i;\n elements[id].width = parseInt(node.style.width);\n elements[id].height = parseInt(node.style.height);\n elements[id].border = node.style.border;\n elements[id].borderRadius = node.style.borderRadius;\n elements[id].opacity = node.style.opacity;\n elements[id].top = parseInt(node.style.top) + parseInt(node.getAttribute(\"data-y\"));\n elements[id].left = parseInt(node.style.left) + parseInt(node.getAttribute(\"data-x\"));\n if (id.startsWith(\"background\")) {\n elements[id].type = \"background\";\n elements[id].src = node.getAttribute(\"src\");\n } else {\n elements[id].backgroundColor = node.style.backgroundColor;\n }\n if (id.startsWith(\"signature\")) {\n elements[id].type = \"signature\";\n }\n if (id.startsWith(\"image\")) {\n elements[id].type = \"image\";\n }\n if (id.startsWith(\"radio\") || id.startsWith(\"auto_radio\") || id.startsWith(\"checkbox\") || id.startsWith(\"auto_checkbox\") || id.startsWith(\"dropdown\") || id.startsWith(\"auto_dropdown\") || id.startsWith(\"auto_text\") || id.startsWith(\"text\") || id.startsWith(\"label\")) {\n elements[id].fontSize = node.style.fontSize;\n elements[id].color = node.style.color;\n elements[id].fontFamily = node.style.fontFamily;\n elements[id].textDecoration = node.style.textDecoration;\n if (id.startsWith(\"auto_text\") || id.startsWith(\"text\")) {\n elements[id].type = \"text\";\n elements[id].default = node.placeholder;\n } else if (id.startsWith(\"label\")) {\n elements[id].content = node.innerHTML;\n elements[id].type = \"label\";\n } else if (id.startsWith(\"dropdown\") || id.startsWith(\"auto_dropdown\")) {\n elements[id].options = [];\n elements[id].default = node.value;\n elements[id].type = \"dropdown\";\n if (node.lastChild) {\n for (k = 0; k < node.childNodes.length; k++) {\n option = node.childNodes[k];\n if (option.tagName && option.tagName === 'OPTION') elements[id].options.push(option.innerHTML);\n }\n }\n } else if (id.startsWith(\"radio\") || id.startsWith(\"auto_radio\")) {\n elements[id].options = [];\n elements[id].default = \"\";\n if (node.className.includes(\"radioMultiline\")) elements[id].display = \"radioMultiline\";\n else elements[id].display = \"radioInline\";\n elements[id].type = \"radio\";\n if (node.lastChild) {\n for (k = 0; k < node.childNodes.length; k++) {\n option = node.childNodes[k].firstChild;\n elements[id].options.push(option.value);\n if (option.checked === true) elements[id].default = option.value;\n }\n }\n } else if (id.startsWith(\"checkbox\") || id.startsWith(\"auto_checkbox\")) {\n for (k = 0; k < node.childNodes.length; k++) {\n if (node.childNodes[k].tagName && node.childNodes[k].tagName === \"SPAN\") span = node.childNodes[k];\n if (node.childNodes[k].tagName && node.childNodes[k].tagName === \"INPUT\") checkbox = node.childNodes[k];\n }\n elements[id].type = \"checkbox\";\n elements[id].default = checkbox.checked;\n elements[id].label = span.innerHTML;\n }\n }\n }\n }\n formData.elements = elements;\n formData.groupName = vm.groupName;\n formData.formName = vm.formName;\n formBuilderFactory.updateForm(formData)\n .then(function(data, status, config, headers) {\n snackbarContainer.MaterialSnackbar.showSnackbar({\n message: \"Saved the form\"\n });\n vm.saved = true;\n vm.getSavedElements();\n }, function(data) {\n if (data.status === 404) {\n var formData = {\n groupName: vm.groupName,\n formName: vm.formName,\n };\n $http.post(appConfig.API_URL + \"/protected/forms\", {\n formData: formData\n }, {\n headers: {\n 'Content-Type': 'application/json'\n }\n })\n .then(function(res) {\n saveForm();\n });\n } else {\n snackbarContainer.MaterialSnackbar.showSnackbar({\n message: \"Failed to save the form. Please try again.\"\n });\n }\n });\n }", "handlePageClick(data) {\n const selected = data.selected;\n const offset = Math.ceil(selected * this.state.perPage);\n\n this.setState({\n offset,\n currentPage: selected + 1,\n merchants: this.state.totalRows.slice(offset, offset + this.state.perPage),\n filteredRowsPaged: this.state.filteredRows.slice(offset, offset + this.state.perPage),\n }, () => {\n if (this.state.filteredRowsPaged.length > 0) {\n this.globalSelectorGroup(this.state.filteredRowsPaged);\n } else {\n this.globalSelectorGroup(this.state.merchants);\n }\n });\n }", "loadNextArtistsOrAlbums() {\n this.page++;\n this.loadArtistsOrAlbums(this.page * 6);\n }", "function setCheckboxValue(pos) {\n if (vm.tableData[pos][\"check\"]) {\n vm.borrowerNumber++;\n } else {\n var el = $('#select-all').get(0);\n if (el && el.checked && ('indeterminate' in el)) {\n // Set visual state of \"Select all\" control \n // as 'indeterminate'\n el.indeterminate = true;\n }\n vm.borrowerNumber--;\n }\n }", "function pageLink(button) {\n\tlet dataPage \t\t\t\t= $(button).data(\"page\");\n\tlet pageListChildrenLength \t= $(\"#page-list\").children().length;\n\t$.ajax({\n\t\turl \t\t: \"files_backend_ajax/backend_barang_keluar.php\",\n\t\ttype \t\t: \"POST\",\n\t\tdata \t\t: { pageListTabelBarangKeluar : dataPage, pageListChildrenLength : pageListChildrenLength },\n\t\tsuccess\t: function(responseText) {\n\t\t\t$(\"#tabelBarangKeluar\").html(responseText);\n\t\t}\n\t});\n\tfor (let i = 1; i <= pageListChildrenLength; i++) {\n\t\tif (dataPage == i) {\n\t\t\t$(\".page-circle\").removeClass(\"page-actived\");\t\n\t\t\t$(button).addClass(\"page-actived\");\n\t\t}\n\t}\n}", "function checkPages() {\n var previousButtons = document.getElementsByClassName(\"previous-page\");\n var nextButtons = document.getElementsByClassName(\"next-page\");\n if (currentPage == 1) {\n for (var i = 0; i < previousButtons.length; i++) {\n previousButtons[i].className = \"page-button-disabled previous-page\";\n }\n } else {\n for (var i = 0; i < previousButtons.length; i++) {\n previousButtons[i].className = \"page-button previous-page\";\n }\n }\n if (receivedProjects < elementsPerPage) {\n for (var i = 0; i < nextButtons.length; i++) {\n nextButtons[i].className = \"page-button-disabled next-page\";\n }\n } else {\n for (var i = 0; i < nextButtons.length; i++) {\n nextButtons[i].className = \"page-button next-page\";\n }\n }\n}", "function loadVisiblePages() {\n // Fetch page images that are currently shown on the site\n var firstVisibleImageLinks = $('#imageList li>a').not('.page-text').withinviewport();\n $.each(firstVisibleImageLinks, function(index, aEl) {\n var imgEl = $(aEl).find('img');\n // Check if the image is already loaded\n if( $(imgEl).attr('src') !== '' )\n return;\n\n // Load page images via Ajax\n $.get( \"ajax/image/page\", { \"imageId\" : globalImageType, \"pageId\" : $(aEl).attr('data-pageid'), \"width\" : 150 } )\n .always(function( data ) {\n // Remove broken image icon first\n var nextEl = $(imgEl).next();\n if( nextEl.length !== 0 ) {\n $(nextEl).remove();\n }\n })\n .done(function( data ) {\n $(imgEl).attr('src', \"data:image/jpeg;base64, \" + data);\n })\n .fail(function( data ) {\n $(imgEl).after('<i class=\"material-icons image-list-broken-image\" data-info=\"broken-image\">broken_image</i>');\n });\n });\n}", "checkboxMapping() {\n if (!this.state.loadingProject && !this.state.loadingYear) {\n let checkedYears = {};\n\n let yearsConcerned = this.state.project.study_year.map(year => year._id);\n\n this.state.years.forEach(year => {\n if (yearsConcerned.indexOf(year._id) !== -1) checkedYears[year._id] = true;\n else checkedYears[year._id] = false;\n });\n\n this.setState({\n checkedYears: checkedYears\n });\n }\n }", "function getDocumentGenerationCheckBoxListResponse() {\n\n var response = {};\n\n response.Documents = new Array();\n\n var chkboxlist = document.getElementById('cblDocumentTypes');\n\n var len = ((chkboxlist === undefined) || (chkboxlist === null)) ? -1 : chkboxlist.rows.length;\n\n response.MaximumCount = len;\n\n for (var index = 0; index < len; ++index) {\n\n if ((chkboxlist.rows[index].children.length > 0) && (chkboxlist.rows[index].children[0].children.length > 0)) {\n\n if ((chkboxlist.rows[index].children[0].children[0].children != null) && (chkboxlist.rows[index].children[0].children[0].children.length > 0)) {\n\n /*\n * Disabled elements within a checkbox list contains a additional SPAN element with disabled=\"disabled\"\n */\n\n if ((chkboxlist.rows[index].children[0].children[0].children[0].tagName.toLowerCase() == 'input') &&\n (chkboxlist.rows[index].children[0].children[0].children[0].type.toLowerCase() == 'checkbox')) {\n\n var doc = {};\n\n doc.IsSelected = true;\n\n var publication = chkboxlist.rows[index].children[0].children[0].innerText.trim();\n\n doc.DocumentName = ((publication == null) || (publication.length == 0)) ? '' : publication;\n\n doc.DocumentTypeId = 0; // to be assigned during doc generation.\n\n doc.IsAvailable = false; // doc generation indicator\n\n doc.CreationDate = null; // doc generation date/time\n\n doc.IsRequired = true; // doc is required for generation\n\n response.Documents.push(doc);\n\n }\n\n } else if ((chkboxlist.rows[index].children[0].children[0].children != null) && (chkboxlist.rows[index].children[0].children[0].children.length == 0)) {\n\n /*\n * Enabled elements within a checkbox list does not contain a additional SPAN element\n */\n\n if ((chkboxlist.rows[index].children[0].children[0].tagName.toLowerCase() == 'input') && (chkboxlist.rows[index].children[0].children[0].type.toLowerCase() == 'checkbox')) {\n\n var doc = {};\n\n doc.IsSelected = chkboxlist.rows[index].children[0].children[0].checked;\n\n var publication = chkboxlist.rows[index].children[0].innerText.trim();\n\n doc.DocumentName = ((publication == null) || (publication.length == 0)) ? '' : publication;\n\n doc.DocumentTypeId = 0; // to be assigned during doc generation.\n\n doc.IsAvailable = false; // doc generation indicator\n\n doc.CreationDate = null; // doc generation date/time\n\n doc.IsRequired = false; // optional doc generation\n\n response.Documents.push(doc);\n\n }\n }\n\n }\n }\n\n return response;\n}", "function onDocumentLoadSuccess({ numPages }) { \n setNumPages(numPages); \n setPageNumber(1); \n }", "function prepareActivityTaxPage() {\r\n // make sure the calculation is correct.\r\n step = 5;\r\n calculateCompletion();\r\n previousAction = actions.activityGSTStep;\r\n nextAction = actions.finishedStep;\r\n\r\n $(\":checkbox\").click(function () {\r\n if (this.id !== 'ckNone') {\r\n if ($(\"#ckNone\").prop(\"checked\") && $(this).prop(\"checked\")) {\r\n $(\"#ckNone\").trigger(\"click\");\r\n }\r\n } else {\r\n {\r\n if ($(\"#ckNone\").prop(\"checked\")) {\r\n applicationType.noneOfAbove2 = true;\r\n $(\":checkbox\").each(function (i, element) {\r\n if (element.id !== \"ckNone\" && $(element).prop('checked')) {\r\n $(element).trigger('click');\r\n }\r\n });\r\n }\r\n }\r\n }\r\n });\r\n // none of the above\r\n $(\"#ckNone\").click(function () {\r\n applicationType.noneOfAbove2 = $(\"#ckNone\").prop('checked');\r\n if ($(\"#ckNone\").prop('checked')) {\r\n \t$('#div-gst-tip').hide();\r\n }\r\n \r\n });\r\n\r\n if (applicationType.noneOfAbove2 !== undefined) {\r\n setCheckBox(\"#ckNone\", applicationType.noneOfAbove2);\r\n }\r\n\r\n // wine\r\n $(\"#ckDealInWine\").click(function () {\r\n registrations.isWET = $(\"#ckDealInWine\").prop('checked');\r\n checkTaxes();\r\n });\r\n\r\n if (registrations.isWET != undefined) {\r\n setCheckBox(\"#ckDealInWine\", registrations.isWET);\r\n }\r\n\r\n // fuel\r\n $(\"#ckUseFuel\").click(function () {\r\n registrations.isFTC = $(\"#ckUseFuel\").prop('checked');\r\n checkTaxes();\r\n });\r\n\r\n if (registrations.isFTC != undefined) {\r\n setCheckBox(\"#ckUseFuel\", registrations.isFTC);\r\n }\r\n\r\n // luxury cars\r\n $(\"#ckLuxury\").click(function () {\r\n registrations.isLCT = $(\"#ckLuxury\").prop('checked');\r\n checkTaxes();\r\n });\r\n\r\n if (registrations.isLCT != undefined) {\r\n setCheckBox(\"#ckLuxury\", registrations.isLCT);\r\n }\r\n \r\n\t// set initial tip/help status:\r\n window.setTimeout(checkTaxes, 10);\r\n}", "function onDocumentLoadSuccess({ numPages }) { \n\tsetNumPages(numPages); \n\tsetPageNumber(1); \n}", "if (currentPage <= 6) {\n startPage = 1;\n endPage = totalPages;\n }", "updatePageButtons() {\r\n this.setState({\r\n prevPageToggleable: parseInt(this.state.startRecord) > 1,\r\n nextPageToggleable: parseInt(this.state.endRecord) < parseInt(this.state.totalRecords),\r\n });\r\n }", "function change_opponenet_check_boxes(is_checked)\n{\n for (var ii = 0; ii < opponents.length; ii++)\n {\n checkbox = document.getElementById(\"opp_check_box_\" + opponents[ii]);\n checkbox.checked = is_checked;\n }\n redraw_head_to_head(slider.value);\n}", "function go_to_page(page_num){\n var show_per_page = parseInt($('#show_per_page').val());\n start_from = page_num * show_per_page;\n end_on = start_from + show_per_page;\n $('#names').children().css('display', 'none').slice(start_from, end_on).css('display', 'inline-flex');\n $('.page_link[longdesc=' + page_num +']').addClass('active_page').siblings('.active_page').removeClass('active_page');\n $('#current_page').val(page_num);\n}", "async function selectKorpus() {\r\n let checkboxes = document.querySelectorAll('input[name=korpus]');\r\n for (i = 0; i < checkboxes.length; i++) {\r\n checkboxes[i].checked = true;\r\n let next = checkboxes[i].nextElementSibling.firstChild;\r\n next.classList.remove(\"hidden\");\r\n next.classList.remove(\"add\");\r\n console.log(\"added \" + next);\r\n }\r\n await updateKorpusCheckboxes();\r\n await fetchMiniStats();\r\n console.log(\"selected\")\r\n}", "function checkAllSectionsSelected(){\n if($(\"input[id^='section_check']:visible:checked\").length == $(\"input[id^='section_check']:visible\").length){\n $(\"#section_all\").prop(\"checked\", true);\n } else {\n $(\"#section_all\").prop(\"checked\", false);\n }\n}", "async LoadNextPages() {\n logger.debug('AnnotationListWidget#loadNextPages loading:', this._loading);\n try {\n if (this._loading) {\n return;\n }\n this._loading = true;\n const minHeight = this._rootElem.height() * this._minContentRelativeHeight;\n const numPages = this._nav.getNumPages();\n let scrollHeight = this._rootElem[0].scrollHeight;\n\n for (let nextPage = this._nav.getActiveRange().endPage + 1;\n nextPage < numPages && scrollHeight < minHeight;\n scrollHeight = this._rootElem[0].scrollHeight, ++nextPage)\n {\n logger.debug('AnnotationListWidget#loadNextPages nextPage:', nextPage, 'numPages:', numPages, 'scrollHeight:', scrollHeight, 'minHeight:', minHeight);\n await this._loadPage(nextPage);\n }\n } catch (e) {\n logger.error('AnnotationListWidget#loadNextPages failed', e);\n } finally {\n this._loading = false;\n }\n }", "function initializeMultiCheckboxSelection() {\n // Add event listener on li element instead of directly to checkbox in order to allow shift click in firefox.\n // A click on checkboxes in firefox is not triggered, if a modifier is active (shift, alt, ctrl)\n const doesProvideMod = !(navigator.userAgent.indexOf(\"Firefox\") >= 0);\n $('#imageList>li').on('click', (doesProvideMod ? 'input[type=\"checkbox\"]' : 'label'), function(event) {\n const checkbox = doesProvideMod ? this : $(this).siblings('input[type=\"checkbox\"]')[0];\n if( !lastChecked ) {\n lastChecked = checkbox;\n return;\n }\n\n if( event.shiftKey ) {\n var checkBoxes = $('#imageList input[type=\"checkbox\"]').not('#selectFilter');\n var start = $(checkBoxes).index($(checkbox));\n var end = $(checkBoxes).index($(lastChecked));\n\n $(checkBoxes).slice(Math.min(start, end), Math.max(start, end) + 1).prop('checked', $(lastChecked).is(':checked'));\n }\n\n $(checkbox).change();\n lastChecked = checkbox;\n });\n}", "function addClick(filterit) {\r\n $(\"[class^=page-\").removeClass(\"disabled\");\r\n $(\".page-\"+curPage).addClass(\"disabled\");\r\n if(curPage==1) { $(\".page-prev\").addClass(\"disabled\"); }\r\n if(curPage==pageCount) { $(\".page-next\").addClass(\"disabled\"); }\r\n $(\".pages\").click(function() {\r\n if($(this).hasClass('disabled')) {\r\n return false;\r\n }\r\n pageId = $(this).attr('id').split(\"-\");\r\n page = pageId[1];\r\n if(page=='prev') {\r\n page=Number(curPage)-1;\r\n } else if(page=='next') {\r\n page=Number(curPage)+1;\r\n }\r\n curPage=page;\r\n page=(page*20)-20;\r\n if(filterit=='games') {\r\n search_filter($(\"#searchField\").val(),page);\r\n } else if(filterit=='news'){\r\n createNewsTable(page); \r\n } else if(filterit=='users') {\r\n createUserList(page,temp_list);\r\n } else if(filterit=='preorder') {\r\n createPreorderList(page,temp_list);\r\n } else if(filterit=='msgs') {\r\n loadMSGList(page);\r\n }\r\n });\r\n}", "function setPagination() {\n //recreated paging list\n $(\"div#current-data #pagination ul li\").detach();\n $(\"div#current-data #pagination ul\").append(\n \"<li id='firstPage' title='First'><a href='#' aria-label='First'><span aria-hidden='true'>&laquo;</span></a></li>\"+\n \"<li id='prevPage' title='Previous'><a href='#' aria-label='Previous'><span aria-hidden='true'>&lt;</span></a></li>\"\n );\n var startPageNo = Math.floor(currPageNo/pagePerLoad) * pagePerLoad + (currPageNo%pagePerLoad === 0 ? 0 : 1); //start page no of serial page on page selected\n var endPageNo = maxPage < (startPageNo + pagePerLoad) ? maxPage : (startPageNo + pagePerLoad -1); //end page no of serial page on page selected\n for(var idx = startPageNo; idx <= endPageNo; idx++) {\n $(\"div#current-data #pagination ul\").append(\n \"<li id='page\"+idx+\"'\"+(idx === currPageNo ? \" class='active' \" : \"\")+\"><a href='#'>\"+idx+\"</a></li>\"\n );\n }\n $(\"div#current-data #pagination ul\").append(\n \"<li id='nextPage' title='Next'><a href='#' aria-label='Next'><span aria-hidden='true'>&gt;</span></a></li>\"+\n \"<li id='lastPage' title='Last'><a href='#' aria-label='Last'><span aria-hidden='true'>&raquo;</span></a></li>\"\n );\n }", "function showPage(page, list) { //pass a page number and a list to show\n\n var $activeLink = $( \"li a\" ).eq( page -1); // checks if the page number is equal to the link num\n // first hide all students on the page\n $('.student-item').hide();\n // Then loop through all students in the student list argument\n list.each(function(index){\n // if student should be on this page number\n if (index >= pageSize * (page - 1) && index < pageSize * page){\n // show the student\n $(this).show();\n\n }\n });\n\n $('li a').removeClass('active'); //remove the active class to unhighlight the link\n $activeLink.addClass('active'); //add the hightlight to the active link\n }", "_initWidget() {\n for (const id of this.compareList.keys()) {\n this._checkCheckbox(id);\n\n this._populateWidget(id);\n\n this._updateWidgetState();\n }\n }", "function paging(pageNb) {\n articlesAll.hide();\n articlesAll.slice((pageNb - 1) * itemsOnPage, (pageNb * itemsOnPage)).show();\n numberOfPage.each(function() {\n // This is for styling the number of page/pages\n if($(this).text() != pageNb) {\n $(this).removeClass('sel');\n } else {\n $(this).addClass('sel');\n }\n });\n }", "loadCheckboxInputEventListeners(dataCtrl,uiCtrl){\n const className = uiCtrl.returnIds().classNames.checkboxesSelector\n for(const input of document.getElementsByClassName(className)){\n input.addEventListener('click',(e)=>{\n dataCtrl.updateRegChecked(e.target.id)\n dataCtrl.addSelectedRow(parseInt(e.target.id),e.target.checked)\n uiCtrl.updateButtonTextValue(dataCtrl.returnData('selectedRow').length)\n })\n }\n }", "function checkAllCheckBox() {\n $(\"#checkAllbachelor\").click(function() {\n $(\"input[name*='bachelor']\").not(this).prop('checked', this.checked);\n if (childLengthCount > 0) {\n let d = document.getElementById(\"activeUserAccess\");\n let childElememt = document.getElementById(\"activeUserAccess\").children;\n for (var i = 0; i < childLengthCount; i++) {\n var loopDataNot = $(\"input:checkbox[name*='bachelor']:not(:checked)\");\n if (loopDataNot) {\n for (var m = 0; m < loopDataNot.length; m++) {\n if (document.getElementById(\"activeUserAccess\").children[i] != undefined) {\n if (document.getElementById(\"activeUserAccess\").children[i].innerHTML == loopDataNot[m].value) {\n let childElememt = document.getElementById(\"activeUserAccess\").children[i];\n d.removeChild(childElememt);\n }\n }\n }\n }\n if (document.getElementById(\"activeUserAccess\").children.length > 0) {\n var loopData = $(\"input:checkbox[name*='bachelor']:checked\");\n if (loopData) {\n for (var m = 0; m < loopData.length; m++) {\n if (document.getElementById(\"activeUserAccess\").children[i] != undefined) {\n if (document.getElementById(\"activeUserAccess\").children[i].innerHTML == loopData[m].value) {\n let childElememt = document.getElementById(\"activeUserAccess\").children[i];\n d.removeChild(childElememt);\n }\n\n }\n }\n }\n }\n }\n if (document.getElementById(\"activeUserAccess\").children.length == 0) {\n childLengthCount = 0;\n var loopData = $(\"input:checkbox[name*='bachelor']:checked\");\n if (loopData) {\n for (var m = 0; m < loopData.length; m++) {\n activeAccess(loopData[m].defaultValue, true);\n }\n }\n }\n } else {\n if (this.checked) {\n var loopData = $(\"input:checkbox[name*='bachelor']:checked\");\n if (loopData) {\n for (var m = 0; m < loopData.length; m++) {\n activeAccess(loopData[m].defaultValue, true);\n }\n }\n } else {\n var loopDataNot = $(\"input:checkbox[name*='bachelor']:not(:checked)\");\n if (loopDataNot) {\n for (var m = 0; m < loopDataNot.length; m++) {\n activeAccess(loopDataNot[m].defaultValue, false);\n }\n }\n }\n }\n childLengthCount = document.getElementById(\"activeUserAccess\").children.length;\n //\talert(childLengthCount);\n });\n}", "function loadCCPage(pageNo) {\n\tvar postParams = \"infoTypeId=\"+activeHorizontalTabInfoID+\"&pageNo=\" + pageNo;\n\tvar infoArr = {};\n\tinfoArr[\"action\"] = \"pagination\";\n\n\t\t\t/**\n\t* search code for this section using keyword \"allInOneRespone\"\n\t*/\n\t/*\n\t\t\t\tif(typeOfApi=='allInOneResponse')\n\t{\n\t\thideCommonLoader();\n\t\tloadCCPageResponse(responseAllInOneResponse);\n\t}\n\telse\n\t*/\n\t\tsendProcessCCRequest(postParams,infoArr);\n\n\treturn false;\n}", "function initializePagesInfo() {\n siteName = getCurrSiteName();\n $.ajax({\n url: \"/easel/sites/\" + siteName + \"/getAllPageNames/\",\n method: \"POST\",\n success: function(data) {\n var pages = data[\"pages\"];\n for (var i = 0; i < pages.length; i++) {\n let name = pages[i]['name'];\n let info = {\n 'opened': pages[i]['opened'] == 'True',\n 'active': pages[i]['active'] == 'True',\n 'saved': true\n }\n pagesInfo[name] = info;\n }\n updatePages();\n },\n error: function(e) {\n console.error(\"failed to load the page tree: \", e);\n }\n });\n}", "function pageLoad() {\r\n\tdocument.getElementById('bottom').checked = true;\r\n\tdocument.getElementById('listItem').focus();\r\n\tmyList = [];\r\n}", "function initPaginationClick(studentList) {\n\t$('a').on('click', function (event) {\n\t\t\t//prevents default browser click reaction\n\t\t\tevent.preventDefault();\n\t\t\t//deselects the currently active page\n\t\t\t$('.active').removeClass();\n\t\t\t//obtains the page number clicked\n\t\t\tvar pageNumberClicked = $(this).text() - 1;\n\t\t\t//calls showPage with the chosen page number and the specified roster\n\t\t\tshowPage( pageNumberClicked, studentList);\n\t\t\t//activates page link of newly selected page\n\t\t\t$(this).addClass('active');\n\t\t});\n }", "function partnersLoad(){\r\n\t\tfunction makePartner(num, title){\r\n\t\t\t$('#partner_wrapper #scroll_wrapper').append('<div id=\"'+num+'\" class=\"partner\" data-title=\"'+title+'\"><img src=\"/images/logos/'+num+'.jpg\" /><div class=\"selectPartner\"><span></span>SELECT<div></div></span></div></div>');\r\n\t\t};\r\n\t\t//loop through each partner and place it on page\r\n\t\t$.each(App.Partners.all, function(i, v){\r\n\t\t\tmakePartner(v[0], v[1]);\r\n\t\t});\r\n\t\t//bind click event to each partner logo\r\n\t\t$('.partner').bind('click', function(){\r\n\t\t\tvar partnerId = $(this).attr(\"id\");\r\n\t\t\tif($(this).hasClass('checked')){\r\n\t\t\t\t$(this).removeClass('checked');\r\n\t\t\t\t$(this).children(\"div\").children(\"span\").css({ 'backgroundPosition' : 0+'px' });\r\n\t\t\t\t$('li#p_'+partnerId).fadeOut(300, function(){ $(this).remove(); });\r\n\t\t\t}else {\r\n\t\t\t\t$(this).addClass('checked');\r\n\t\t\t\t$(this).children(\"div\").children(\"span\").css({ 'backgroundPosition' : -22+'px' });\r\n\t\t\t\t$('#pickedWrapper').append('<li id=\"p_'+partnerId+'\" style=\"display:none;\"><img src=\"/images/logos/'+partnerId+'.jpg\" /></li>');\r\n\t\t\t\t$('li#p_'+partnerId).fadeIn(300);\r\n\t\t\t}\r\n\t\t});\r\n\t}", "function show(category) {\n for (var i = 0; i < gmarkers.length; i++) {\n if (gmarkers[i].category == category) {\n gmarkers[i].setVisible(true);\n }\n }\n // == check the checkbox ==\n //document.getElementById(category + \"box\").checked = true;\n}", "function setPage(){\n\t\tvar rwIdlength = rwId.length; \n\t\tfor(var i=0; i < rwIdlength; i++){\n\t\t\tvar j = Math.floor($(rwId[i]).offset().top - $(window).scrollTop());\n\t\t\tif (j < wHeight * 1.3){\n\t\t\t\t$(rwId[i]).addClass('active');\n\t\t\t} else{\n\t\t\t\t$(rwId[i]).removeClass('active');\n\t\t\t}\n\t\t}\n\t}", "function loadPagination(pageData,page,rows,isLoadButton){\n\n // 0th index = 1st position\n let firstRecord = (page - 1) * rows;\n\n // 10th index = 11th position\n let lastRecord = page * rows;\n\n //slice will return 1st to 10th position and store in customerData\n let customerData = pageData.slice(firstRecord,lastRecord);\n\n //call function to load table \n loadTable(customerData);\n\n //if true then call function to load button passing the datas length by num of rows\n if(isLoadButton){\n \n loadButton(pageData.length/rows);\n }\n}", "function changeDisplayCategory()\r\n{\r\n if(document.getElementById('CiviliansBtn').checked)\r\n {\r\n if(document.getElementById('civFunctionBtn').checked)\r\n {\r\n categoryToColorBy = functionTag;\r\n }\r\n if(document.getElementById('civIndustryBtn').checked)\r\n {\r\n categoryToColorBy = industryTag;\r\n }\r\n if(document.getElementById('civSizeCompanyBtn').checked)\r\n {\r\n categoryToColorBy = sizeCompanyTag;\r\n }\r\n }\r\n\r\n if(document.getElementById('ConsultantsBtn').checked)\r\n {\r\n if(document.getElementById('consEmplyerBtn').checked)\r\n {\r\n categoryToColorBy = employerTag;\r\n }\r\n if(document.getElementById('consIndustryBtn').checked)\r\n {\r\n categoryToColorBy = industryTag;\r\n }\r\n }\r\n //document.getElementById(\"USNavyBtn\").checked = true;\r\n loadUSNavy();\r\n}", "function ajaxGotState(ajax) {\n $(\"status\").innerHTML = \"He is wearing: \" + ajax.responseText;\n var accessories = getAccessoriesArray(ajax.responseText);\n for (var i = 0; i < accessories.length; i++) {\n if (accessories[i]) {\n $(accessories[i]).checked = true;\n $(accessories[i] + \"_image\").appear();\n }\n }\n}", "loadAllUniversities(page) {\n let url = document.pageData.base_education.pageUrls.universities_all_index + '?page=' + page;\n\n let data = {\n url: url\n };\n this.$store.dispatch('loadAllUniversities', data);\n }", "function setCertainCheckboxes(){\r\n $(\"#testlist INPUT[type='checkbox']\").prop('checked',false);\r\n $.each(selectedTestList,function(key,val) {\r\n $('#testlist input:checkbox[value='+val+']').prop('checked',true);\r\n });\r\n}" ]
[ "0.6302366", "0.607973", "0.60235935", "0.5897849", "0.5787513", "0.5602354", "0.5587718", "0.5574504", "0.5573683", "0.55676943", "0.5523294", "0.551985", "0.5515246", "0.55046284", "0.54901373", "0.54881644", "0.5463226", "0.5451636", "0.5435843", "0.53943294", "0.53852904", "0.53780514", "0.5377416", "0.53617144", "0.53550845", "0.5350892", "0.5347364", "0.53327864", "0.5300466", "0.52955556", "0.5292343", "0.5290272", "0.5287871", "0.52767706", "0.5274472", "0.5267897", "0.5267457", "0.52545637", "0.52388597", "0.52294403", "0.52269185", "0.52269185", "0.5220525", "0.52170366", "0.5199962", "0.51920843", "0.5188077", "0.5184021", "0.517774", "0.5159291", "0.51561844", "0.5154811", "0.5151856", "0.514882", "0.514437", "0.513699", "0.51346624", "0.51278716", "0.5115959", "0.5111809", "0.5102455", "0.5102046", "0.5095228", "0.50897694", "0.50860155", "0.5085583", "0.5084618", "0.5082554", "0.5082152", "0.50809616", "0.5079207", "0.50742394", "0.5066093", "0.50622815", "0.5056955", "0.50541013", "0.5052677", "0.505053", "0.50457585", "0.5044131", "0.5041662", "0.5033012", "0.5030386", "0.50255316", "0.5020678", "0.5020155", "0.50164044", "0.5014772", "0.50145644", "0.5012045", "0.50048965", "0.5003878", "0.500255", "0.50006634", "0.4998961", "0.49963522", "0.49945065", "0.4990986", "0.49905345", "0.49904087" ]
0.79220134
0
check if the value was a &nsbp.. that won't save in mysql well.
function checkForNbsp(text){ if(text == "\u00a0"){ text = ''; } return text; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isDataSafe(type, value) {\n\n return true;\n }", "function checkFieldNull(field,Strflag)\n{ \n var str = field.value;\n\n if(str == null)//for netscape\n {\n str = field.options[field.selectedIndex].value;\n }\n \n if(str == \"\")\n {\n //alert(\"修改投保单需要选择投保单号\");\n //field.focus();\n if(Strflag == \"0\")\n {\n DAlert(field,Message[35]);\n }\n else if(Strflag == \"1\")\n {\n DAlert(field,Message[36]); \t\n } \n else if(Strflag == \"2\")\n {\n DAlert(field,Message[39]); \t\n } \n else if(Strflag == \"3\")\n {\n DAlert(field,Message[40]); \t\n } \n\n return false;\n } \n return true;\n}", "function di_safevalue(val)\n{\n if(val==undefined || val=='' || val==null)\n return '';\n else\n return val; \n}", "function ibanbic_validate(event, allowSpace) {\n var keycode = ('which' in event) ? event.which : event.keyCode;\n var reg = /^(?:[A-Za-z0-9]+$)/; \n if(allowSpace == true)\n var reg = /^(?:[A-Za-z0-9&\\s]+$)/;\n if(event.target.id == 'novalnet_sepa_account_holder')\n var reg = /^(?:[A-Za-z-&.\\s]+$)/;\n return (reg.test(String.fromCharCode(keycode)) || keycode == 0 || keycode == 8 || (event.ctrlKey == true && keycode == 114) || ( allowSpace == true && keycode == 32))? true : false;\n}", "function verify(e) {\n with (top.document.forms[0].elements[e]) {\n if (value != '1'\n && value != '2'\n && value != '3'\n && value != '4'\n && value != '5'\n && value != '6'\n && value != '7'\n && value != '8'\n && value != '9')\n value = '';\n }\n return true;\n}", "function validateSpecialCharacters(sender, args)\n{\n args.IsValid = true;\n\n var iChars = \"!@$%^&*+=[]\\\\\\';.{}|\\\":<>\";\n for (var i = 0; i < args.Value.length; i++)\n {\n if (iChars.indexOf(args.Value.charAt(i)) != -1)\n {\n args.IsValid = false;\n\n return false;\n }\n }\n\n return args.IsValid;\n}", "function hasValue(elem){\n\t\t\treturn $(elem).val() != '';\n\t\t}", "function checkFieldNull(field,Strflag)\n{\n\t var str = field.value;\n\n\t if(str == null)//for netscape\n\t {\n\t\t\t str = field.options[field.selectedIndex].value;\n\t }\n\n\t if(str == \"\")\n\t {\n\t\t\t//alert(\"修改投保单需要选择投保单号\");\n\t\t\t//field.focus();\n\t\t\tif(Strflag == \"0\")\n\t\t\t{\n\t\t\t\t DAlert(field,Message[35]);\n\t\t\t}\n\t\t\telse if(Strflag == \"1\")\n\t\t\t{\n\t\t\t\t DAlert(field,Message[36]);\n\t\t\t}\n\t\t\telse if(Strflag == \"2\")\n\t\t\t{\n\t\t\t\t DAlert(field,Message[39]);\n\t\t\t}\n\t\t\telse if(Strflag == \"3\")\n\t\t\t{\n\t\t\t\t DAlert(field,Message[40]);\n\t\t\t}\n\t\t\telse if(Strflag == \"4\")\n\t\t\t{\n\t\t\t\t DAlert(field,Message[44]);\n\t\t\t}else if(Strflag == \"5\"){\n\n\t\t\t DAlert(field,Message[48]);\n\t\t}else if(Strflag == \"6\"){\n\n\t\t\t DAlert(field,Message[49]);\n\t\t}else if(Strflag == \"7\"){\n\n\t\t\t DAlert(field,Message[50]);\n\t\t}else if(Strflag == \"8\"){\n\t\t\t\tDAlert(field,Message[51]);\n\t\t}\n\n\t\t\treturn false;\n\t }\n\t return true;\n}", "function cekPoin(poin){\n\t\tif( $('#pointTB').val() != $('#pointTB').val().replace(/[^0-9]/g, '')){ // cek hanya angka \n\t\t\t$('#pointTB').val($('#pointTB').val().replace(/[^0-9]/g, ''));\n\t\t}\n\t}", "function cekPoin(poin){\n\t\tif( $('#pointTB').val() != $('#pointTB').val().replace(/[^0-9]/g, '')){ // cek hanya angka \n\t\t\t$('#pointTB').val($('#pointTB').val().replace(/[^0-9]/g, ''));\n\t\t}\n\t}", "prepareValue (value) {\n if (value === undefined) return ''\n\n if (value === null) return 'NULL'\n\n return mysql.escape(value)\n }", "function checkString() {\n var i = 1;\n var error = false;\n while (i < opHidden.length && !error) {\n if (!(isNumeric(opHidden[i]) || operazioniValide.indexOf(opHidden[i]) > -1 )||opHidden[i]==\"\" ) {\n error = true;\n }\n i++;\n }\n if (openParIndex != closeParIndex) {\n error = true;\n }\n if (error) {\n return false;\n } else {\n return true;\n }\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 isStringValue(value) {\r\n return isStringValue(value, false);\r\n}", "function checkValue(value){\n\tif(value == \"\" || value == \"null\" || value == null || value == undefined){\n\t\tvalue = \"\";\n\t}\n\treturn value;\n}", "function validateIDField(sender, args) {\n args.IsValid = true;\n\n var iChars = \"!@$#%^&*+=[]\\\\\\';,.{}|\\\":<>\";\n for (var i = 0; i < args.Value.length; i++) {\n if (iChars.indexOf(args.Value.charAt(i)) != -1) {\n args.IsValid = false;\n\n return false;\n }\n }\n\n return args.IsValid;\n}", "function nonEmptyString (data) {\n return string(data) && data !== '';\n }", "function isSpecialCharacter(fieldVal)\r\n{\r\n var s = fieldVal.value;\r\n //alert(\"string value is\"+s);\r\n var specialChar = '/!\\\"=\\\\;+~%^*?:.[]{}()@#$%^&*,';\r\n for (var i = 0; i < s.length; i++)\r\n {\r\n var c = s.charAt(i);\r\n if (c == \"'\")\r\n {\r\n var msg = \"\";\r\n msg = (\"No Special Characters Allowed (/!\\\"=\\\\;+~%^*?:.[]{}()@#$%^&*,') \");\r\n fieldVal.value = '';\r\n fieldVal.focus();\r\n return msg;\r\n\r\n }\r\n\r\n\r\n for (var j = 0; j <= specialChar.length; j++)\r\n {\r\n var p = specialChar.charAt(j);\r\n if (p == c)\r\n {\r\n var msg = \"\";\r\n msg = (\"No Special Characters Allowed (/!\\\"=\\\\;+~%^*?:.[]{}()@#$%^&*,')\");\r\n fieldVal.value = '';\r\n fieldVal.focus();\r\n return msg;\r\n }\r\n }\r\n\r\n }\r\n}", "function isNumeric(poin){\n\t\tif( $('#pointTB').val() != $('#pointTB').val().replace(/[^0-9]/g, '')){ // cek hanya angka \n\t\t\t$('#pointTB').val($('#pointTB').val().replace(/[^0-9]/g, ''));\n\t\t}\n\t}", "function urlEncodeIfNecessary(s) {\n\t\tvar regex = /[\\\\\\\"<>\\.;]/;\n\t\tvar hasBadChars = regex.exec(s) != null;\n\t\treturn hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;\n\t}", "function urlEncodeIfNecessary(s) {\n\t\tvar regex = /[\\\\\\\"<>\\.;]/;\n\t\tvar hasBadChars = regex.exec(s) != null;\n\t\treturn hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;\n\t}", "function urlEncodeIfNecessary(s) {\n\t\tvar regex = /[\\\\\\\"<>\\.;]/;\n\t\tvar hasBadChars = regex.exec(s) != null;\n\t\treturn hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;\n\t}", "function isKatakaraObj(obj) \n{\n\tif (obj == null) return false;\n\tvar value = obj.value.trim();\n\tif (value == \"\") return true;\n \t\n\tif(!isKatakaraString(value))\t\n\t{\n\t\talert(getMessage(\"MSG_S0_0021\"));\n\t\tobj.focus();\n\t\tobj.select();\n\t\treturn false;\n\t}\n\treturn true;\n}", "function safeAdd(obj) {\n var v = obj.val();\n if (!failed_chars.test(v)) {\n return v;\n } else {\n return '';\n }\n}", "function urlEncodeIfNecessary(s) {\n\t\tvar regex = /[\\\\\\\"<>\\.;]/;\n\t\tvar hasBadChars = regex.exec(s) != null;\n\t\treturn hasBadChars && (typeof encodeURIComponent === \"undefined\" ? \"undefined\" : _typeof(encodeURIComponent)) != UNDEF ? encodeURIComponent(s) : s;\n\t}", "function Fb_NGAY_TRANG(b_ngay) {\r\n if (b_ngay == null) return true;\r\n b_ngay = C_NVL(b_ngay);\r\n while (b_ngay.indexOf('/') >= 0) b_ngay = b_ngay.replace('/', '');\r\n return (b_ngay == \"\");\r\n}", "function IsBornosoftModifierCharaceter(CUni)\r\n{\r\n\tif(CUni=='হ' || CUni=='`' \r\n\t|| CUni=='~' )\r\n\t\treturn true;\r\n\treturn false;\r\n}", "_sanitizeValue (item) {\n let itemType = typeof item;\n\n if (null === item) {\n // null is allowed\n }\n else if (\"string\" === itemType || \"number\" === itemType || \"boolean\" === itemType) {\n // primitives are allowed\n }\n else if (cls.isSquelBuilder(item)) {\n // Builders allowed\n }\n else {\n let typeIsValid =\n !!getValueHandler(item, this.options.valueHandlers, cls.globalValueHandlers);\n\n if (!typeIsValid) {\n throw new Error(\"field value must be a string, number, boolean, null or one of the registered custom value types\");\n }\n }\n\n return item;\n }", "function verifier(_champ){\n if(_champ.val()==\"\") {\n return false; \n }\n else {\n return true; \n }\n }", "function hasEntityReference(input)\n{\n\tvar andLocation = input.indexOf('&');\n\tvar code;\n\tif (andLocation != -1 && andLocation + 1 < input.length) //if you found a & and the next thing that follows is an alpha\n\t{\n\t\tcode = input.charCodeAt(andLocation + 1);\n\t\tif ((code > 64 && code < 91) || // upper alpha (A-Z)\n \t(code > 96 && code < 123)) // lower alpha (a-z)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n}", "function cleanQueryValue(val) {\n return encodeURIComponent(val)\n .replace(/!/g, '%21')\n .replace(/'/g, '%27')\n .replace(/\\(/g, '%28')\n .replace(/\\)/g, '%29')\n .replace(/\\*/g, '%2A')\n .replace(/%0A/g, '\\n');\n }", "function urlEncodeIfNecessary(s) {\n var regex = /[\\\\\\\"<>\\.;]/;\n var hasBadChars = regex.exec(s) != null;\n return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;\n }", "function urlEncodeIfNecessary(s) {\n var regex = /[\\\\\\\"<>\\.;]/;\n var hasBadChars = regex.exec(s) != null;\n return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;\n }", "function urlEncodeIfNecessary(s) {\n var regex = /[\\\\\\\"<>\\.;]/;\n var hasBadChars = regex.exec(s) != null;\n return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;\n }", "function hasSpecialChar(obj,fieldname)\r\n{\r\n text = obj.value;\r\n if(isEmpty(obj))\r\n {\r\n return false;\r\n }\r\n else\r\n {\r\n var i;\r\n var oneChar;\r\n for( i = 0; i < text.length; i++ )\r\n {\r\n oneChar = text.charAt( i );\r\n if ( ! isCharValid( oneChar, ALPHA|NUMERICS|SPACE|DASH|UNDERSCORE|SLASH|DOT ) )\r\n {\r\n// alert(getErrorMsg(26,fieldname));\r\n obj.focus();\r\n obj.select();\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n}", "function sanitizeSubjectCode(ins){\n const chkr = datab.find(p => p.subject === ins);\n \n //if exists in database\n if (chkr) {\n return true;\n }\n else{\n return false;\n }\n}", "function isString(obj) { // 56\n\t\treturn !!(obj === '' || (obj && obj.charCodeAt && obj.substr)); // 57\n\t} // 58", "function sanitizeCourseCode(ins){\n const chkr = datab.find(p => p.catalog_nbr == ins);\n\n //if exists in database\n if (chkr) {\n return true;\n }\n else{\n return false;\n }\n}", "function urlEncodeIfNecessary(s) {\n var regex = /[\\\\\\\"<>\\.;]/;\n var hasBadChars = regex.exec(s) !== null;\n return hasBadChars && typeof encodeURIComponent !== UNDEF ? encodeURIComponent(s) : s;\n }", "function is_bad_name(b_name,p_caption,i)\n {\n var reg=/[-\\s\\'\\\"’]+/g,b_replace_reg=/\\s+[\\-\\|–]{1}.*$/g;\n var lower_b=b_name.toLowerCase().replace(reg,\"\"),lower_my=my_query.name.replace(/\\s(-|@|&|and)\\s.*$/).toLowerCase().replace(reg,\"\");\n if(lower_b.indexOf(lower_my)!==-1 || lower_my.indexOf(lower_b)!==-1) return false;\n b_name=b_name.replace(b_replace_reg,\"\");\n my_query.name=my_query.name.replace(\"’\",\"\\'\");\n console.log(\"b_name=\"+b_name+\", my_query.name=\"+my_query.name);\n if(MTP.matches_names(b_name,my_query.name)) return false;\n if(i===0 && b_name.toLowerCase().indexOf(my_query.name.split(\" \")[0].toLowerCase())!==-1) return false;\n return true;\n }", "getTrueValue () {\n var val = this.getValue ();\n if (!val) return;\n if (val === NULL_CHARACTER) return null;\n return val;\n }", "function getWriteNan() {\n return false;\n}", "function checkSSN (theField, emptyOK)\r\n{ if (checkSSN.arguments.length == 1) emptyOK = defaultEmptyOK;\r\n if ((emptyOK == true) && (isEmpty(theField.value))) return true;\r\n else\r\n { var normalizedSSN = stripCharsInBag(theField.value, SSNDelimiters)\r\n if (!isSSN(normalizedSSN, false))\r\n return warnInvalid (theField, iSSN);\r\n else\r\n { // if you don't want to reformats as 123-456-7890, comment next line out\r\n theField.value = reformatSSN(normalizedSSN)\r\n return true;\r\n }\r\n }\r\n}", "function checkSSN (theField, emptyOK)\r\n{ if (checkSSN.arguments.length == 1) emptyOK = defaultEmptyOK;\r\n if ((emptyOK == true) && (isEmpty(theField.value))) return true;\r\n else\r\n { var normalizedSSN = stripCharsInBag(theField.value, SSNDelimiters)\r\n if (!isSSN(normalizedSSN, false))\r\n return warnInvalid (theField, iSSN);\r\n else\r\n { // if you don't want to reformats as 123-456-7890, comment next line out\r\n theField.value = reformatSSN(normalizedSSN)\r\n return true;\r\n }\r\n }\r\n}", "function check_number(nb) {\n return nb.nb$float !== undefined;\n }", "function pfu(strVal)\r\n{\r\n\treturn encodeURIComponent(replaceSQ(strVal));\r\n}", "function inValNS(e){\n var l = e.length;\n if(l == 0){ return true; }\n else{\n for(i = 0; i < l; i++){ if(e.charAt(i) == \" \"){ return true; break; } }\n return false;\n }\n}", "function test_false_string_case (){ assertFalse( compare.isValue( 'wa', 'Wa', false ) ); }", "function _isEncodedBlob(value) {\n\t return value && value.__local_forage_encoded_blob;\n\t }", "function _isEncodedBlob(value) {\n\t return value && value.__local_forage_encoded_blob;\n\t }", "function _isEncodedBlob(value) {\n\t return value && value.__local_forage_encoded_blob;\n\t }", "cleanValue() {\n if (!this.node.value.match(/\\d/)) {\n this.node.value = '';\n }\n }", "function _isEncodedBlob(value) {\n\t return value && value.__local_forage_encoded_blob;\n\t}", "function _isEncodedBlob(value) {\n\t return value && value.__local_forage_encoded_blob;\n\t}", "function podPress_is_emptystr( val ) {\r\n\t\tvar str = String(val);\r\n\t\tvar str_trim = str.replace(/\\s+$/, '');\r\n\t\tstr_trim = str_trim.replace(/^\\s+/, '');\r\n\t\tif (str_trim.length > 0) {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "function nameCheked(value) {\n value = value.trim();\n if(value != \"\" && value.length > 2 && value != null){\n return true;\n }\n return false;\n}", "checkValue() {\n let newInput;\n newInput = this.elName.value;\n\n if (newInput === '') {\n this.initializeValues();\n this.setFurigana();\n } else {\n newInput = this.removeString(newInput);\n\n if (this.input === newInput) return; // no changes\n\n this.input = newInput;\n\n if (this.isConverting) return;\n\n const newValues = newInput.replace(kanaExtractionPattern, '').split('');\n this.checkConvert(newValues);\n this.setFurigana(newValues);\n }\n\n this.debug(this.input);\n }", "function FFString_checkBlank( obj , objname , showmsg){\n\tif(this.isBlank(obj.value)){\n\t\tif(showmsg == null || showmsg) {\n\t\t\talert(objname + \"을 입력하세요.\");\n\t\t\tobj.focus();\n\t\t}\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "function isinputvalid() {\r\n let inputstr = field.value;\r\n let patt = /^[0-9]{1,3}$/g; //1-999\r\n let cond = patt.test(inputstr);\r\n\r\n if (!cond) {\r\n field.value = \"\";\r\n updateImg(data.default.bev);\r\n }\r\n return cond;\r\n}", "function isSingleQuote(fld) \r\n{\r\n\tvar val = \"\";\r\n\tfor (i=0; i<fld.length ; i++) \r\n\t{\r\n\t\tif(fld.charAt(i) == \"'\")\r\n\t\t{\r\n\t\t\treturn false;\r\n \t}\r\n\t}\r\n\treturn true;\r\n}", "save() {\n let value = this.state.value;\n if (value && value.length && typeof value === 'string') {\n this.props.onSave(this.state.value);\n this.setState({\n value: ''\n });\n }\n\n }", "function isDBCSChar(unichar, isDBCSSession, isDBCSEuro, CodePage){\r\n\treturn false;\r\n}", "function checkSendedValue() {\n return (req.body.email != undefined && String(req.body.email).match(/^(([^<>()\\[\\]\\\\.,;:\\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,}))$/) == null) ||\n (req.body.password != undefined && req.body.password == \"\") ||\n (req.body.password2 != undefined && req.body.password2 == \"\") ||\n (req.body.token != undefined && req.body.token == \"\") ||\n (req.body.itineraryName != undefined && req.body.itineraryName == \"\") ||\n (req.body.emailUser != undefined && req.body.emailUser == \"\") ||\n (req.body.coordinate != undefined && req.body.coordinate == \"\");\n }", "static hasValue(val) {\n if (val == undefined || val == \"\" || val == NaN || val == null) {\n return false;\n }\n return true;\n }", "function isIntegerVal(field){\n\tif (!isInteger(field.value)){\n\t\tfield.value=\"\";\n\t}\n}", "function isNum(v,maybenull) {\n var n = new Number(v.value);\n if (isNaN(n)) {\n return false;\n }\n if (maybenull==0 && v.value=='') {\n\n\n return false;\n }\n return true;\n}", "function removeUnwantedSpecialCharsSepa(value, req)\n{\n if (value != 'undefined' || value != '') {\n value.replace(/^\\s+|\\s+$/g, '');\n if (req != 'undefined' && req == 'account_holder') {\n return value.replace(/[\\/\\\\|\\]\\[|#@,+()`'$~%\":;*?<>!^{}=_]/g, '');\n }else {\n return value.replace(/[\\/\\\\|\\]\\[|#@,+()`'$~%.\":;*?<>!^{}=_-]/g, '');\n }\n }\n}", "function isPostObjPub(obj, msgID)\n{\n\tif (obj == null) return false;\n\tvar value = obj.value.trim();\n\tif (value == \"\") return true;\n\t\n\tvar result = true;\n\treg = /^\\d|^-/;\n for(var i=0; i<value.length; i++)\n {\n var strSub = value.substring(i,i+1); //char\n\t\tif (!reg.test(strSub))\n\t\t{\n\t\t\tresult = false;\n\t\t\tbreak;\n\t\t}\n }\n\tif (!result)\n\t{\n\t\talert(getMessage(msgID));\n\t\tobj.select();\n\t\tobj.focus();\t\t\n\t}\n\treturn result;\n}", "function dataIsEmpty( data ) {\n if ( !data)\n return true;\n\n if ( data.length > 20 )\n return false;\n\n var value = data.replace( /[\\n|\\t]*/g, '' ).toLowerCase();\n if ( !value || value == '<br>' || value == '<p>&nbsp;<br></p>' || value == '<p><br></p>' || value == '<div><br></div>' || value == '<p>&nbsp;</p>' || value == '&nbsp;' || value == ' ' || value == '&nbsp;<br>' || value == ' <br>' )\n return true;\n\n return false;\n }", "function isRealValue(obj){\n return obj && obj !== \"null\" && obj!== \"undefined\";\n}", "function saveStage(stateNum)\n {\n try\n {\n document.getElementById('longName').value = trim(document.getElementById('longName').value);\n if(document.getElementById('longName').value.match('#'))\n {\n document.getElementById('longName').value = document.getElementById('longName').value.replace(/#/g,\"\");\n } \n warn(stateNum);\n \n }\n catch(ex)\n {}\n \n }", "function shouldIgnoreValue(propertyInfo,value){return value==null||propertyInfo.hasBooleanValue&&!value||propertyInfo.hasNumericValue&&isNaN(value)||propertyInfo.hasPositiveNumericValue&&value<1||propertyInfo.hasOverloadedBooleanValue&&value===false;}", "function shouldIgnoreValue(propertyInfo,value){return value==null||propertyInfo.hasBooleanValue&&!value||propertyInfo.hasNumericValue&&isNaN(value)||propertyInfo.hasPositiveNumericValue&&value<1||propertyInfo.hasOverloadedBooleanValue&&value===false;}", "function shouldIgnoreValue(propertyInfo,value){return value==null||propertyInfo.hasBooleanValue&&!value||propertyInfo.hasNumericValue&&isNaN(value)||propertyInfo.hasPositiveNumericValue&&value<1||propertyInfo.hasOverloadedBooleanValue&&value===false;}", "validateSSN(fieldName, value, temp) {\n if(!(value.match(/^\\d{6}-\\d{4}$/i) && this.validatePersonalIdentityNumber(value))) {\n temp.socialSecurityNumberValid = false;\n temp.fieldValidationErrors.socialSecurityNumber = 'Social Security Number is invalid';\n } else {\n temp.socialSecurityNumberValid = true;\n temp.fieldValidationErrors.socialSecurityNumber = '';\n }\n return temp;\n }", "function _isEncodedBlob(value) {\n return value && value.__local_forage_encoded_blob;\n }", "function stripSpecial($elem) {\r\n\tconsole.log($elem.val());\r\n\t$elem.val($elem.val().replace(/\\D/g,\"\"));\r\n\t\r\n\tconsole.log($elem.val());\r\n\treturn true;\r\n}", "set Raw(value) {}", "validateTagString(val) {\n var reg = new RegExp(/[!\"#$%&'()\\*\\+\\-\\s\\.,\\/:;<=>?@\\[\\\\\\]^`{|}~]/g);\n if (reg.test(val)) {\n return false;\n }\n return true;\n }", "function dataPresent(data) {\n return (data != null && data !== '' && data !== '#NUM!' && data !== '#DIV/0!')\n }", "function cleanNumericValueForSaving(num) {\n if (num[0] == '(') {\n num = num.slice(1, num.length);\n }\n while (num.indexOf(',') != -1) {\n num = num.replace(',', '');\n }\n\n while (num.indexOf('$') != -1) {\n num = num.replace('$', '');\n }\n return num;\n}", "function isBadValue(value) {\n return (value === null || // null\n value === \"\" || // empty string\n (/^\\s+$/.test(value))); // all whitespace\n }", "function C_NVL(b_in) { // Dan\r\n var b_kq = (b_in == null) ? \"\" : b_in.replace(/^[\\s]+/, '').replace(/[\\s]+$/, '').replace(/[\\s]{2,}/, ' ');\r\n if (b_kq.toUpperCase() == \"NULL\") b_kq = \"\";\r\n return b_kq;\r\n}", "function sanitize(o) {\n var temp = \"\",\n testPlusChar = \"\";\n \n for (i=0;i<o.value.length;i++) {\n var iPlusOne = i+1;\n testPlusChar += o.value.substring(i,iPlusOne);\n if ((!regExpression.test(testPlusChar))) {\n var lastChar = testPlusChar.length-1;\n temp = testPlusChar.substring(0,lastChar);\n testPlusChar = temp;\n }\n }\n o.value = testPlusChar;\n }", "function notValid_anySimpleType(strObj) {\n\treturn false;\n }", "function normalizeData(val) {\n if (val === 'true') {\n return true;\n }\n\n if (val === 'false') {\n return false;\n }\n\n if (val === Number(val).toString()) {\n return Number(val);\n }\n\n if (val === '' || val === 'null') {\n return null;\n }\n\n return val;\n }", "function normalizeData(val) {\n if (val === 'true') {\n return true;\n }\n\n if (val === 'false') {\n return false;\n }\n\n if (val === Number(val).toString()) {\n return Number(val);\n }\n\n if (val === '' || val === 'null') {\n return null;\n }\n\n return val;\n }", "function isNsChar(c) {\n return isPrintable$1(c) && !isWhitespace$1(c)\n // byte-order-mark\n && c !== 0xFEFF\n // b-char\n && c !== CHAR_CARRIAGE_RETURN$1\n && c !== CHAR_LINE_FEED$1;\n}", "function _isEncodedBlob(value) {\n return value && value.__local_forage_encoded_blob;\n }", "function e(value) {\r\n return connection.escape(value)\r\n}", "isLikeEmpty(inputVar) {\n if (typeof inputVar !== 'undefined' && inputVar !== null) {\n let strTemp = JSON.stringify(inputVar);\n strTemp = strTemp.replace(/\\s+/g, ''); // remove all whitespaces\n strTemp = strTemp.replace(/\\\"+/g, \"\"); // remove all >\"<\n strTemp = strTemp.replace(/\\'+/g, \"\"); // remove all >'<\n strTemp = strTemp.replace(/\\[+/g, \"\"); // remove all >[<\n strTemp = strTemp.replace(/\\]+/g, \"\"); // remove all >]<\n if (strTemp !== '') {\n return false;\n } else {\n return true;\n }\n } else {\n return true;\n }\n }", "function isNsChar(c) {\n return isPrintable(c) && !isWhitespace(c)\n // byte-order-mark\n && c !== 0xFEFF\n // b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}", "function isNsChar(c) {\n return isPrintable(c) && !isWhitespace(c)\n // byte-order-mark\n && c !== 0xFEFF\n // b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}", "function isNsChar(c) {\n return isPrintable(c) && !isWhitespace(c)\n // byte-order-mark\n && c !== 0xFEFF\n // b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}", "function isNsChar(c) {\n return isPrintable(c) && !isWhitespace(c)\n // byte-order-mark\n && c !== 0xFEFF\n // b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}", "function isNsChar(c) {\n return isPrintable(c) && !isWhitespace(c)\n // byte-order-mark\n && c !== 0xFEFF\n // b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}", "function isNsChar(c) {\n return isPrintable(c) && !isWhitespace(c)\n // byte-order-mark\n && c !== 0xFEFF\n // b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}", "function isNsChar(c) {\n return isPrintable(c) && !isWhitespace(c)\n // byte-order-mark\n && c !== 0xFEFF\n // b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}", "function isNsChar(c) {\n return isPrintable(c) && !isWhitespace(c)\n // byte-order-mark\n && c !== 0xFEFF\n // b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}", "function isNsChar(c) {\n return isPrintable(c) && !isWhitespace(c)\n // byte-order-mark\n && c !== 0xFEFF\n // b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}", "function escapeColumnValue(s) {\n if (typeof s === \"string\") {\n return s.replace(/&(?![a-zA-Z]{1,8};)/g, \"&amp;\");\n } else {\n return s;\n }\n }" ]
[ "0.53694344", "0.5256359", "0.52243227", "0.52089447", "0.51995593", "0.5182345", "0.51631117", "0.51407635", "0.5136123", "0.5136123", "0.5133355", "0.5130084", "0.5124512", "0.5122446", "0.5107383", "0.51035196", "0.50921404", "0.5075348", "0.5053554", "0.50516665", "0.50516665", "0.50516665", "0.50404286", "0.5036245", "0.5034326", "0.50144726", "0.5011158", "0.5008842", "0.5007214", "0.49938685", "0.49818477", "0.49797007", "0.49797007", "0.49797007", "0.49637255", "0.49552733", "0.49478444", "0.492226", "0.4919889", "0.49020302", "0.49002892", "0.48973832", "0.48968634", "0.48968634", "0.48956463", "0.48819074", "0.48772144", "0.48770842", "0.48768452", "0.48768452", "0.48768452", "0.48761988", "0.48707208", "0.48707208", "0.48690662", "0.485699", "0.4853864", "0.4852764", "0.48508", "0.48497033", "0.48486608", "0.48480543", "0.4847867", "0.48461658", "0.48431003", "0.4842886", "0.48394623", "0.4831015", "0.48284492", "0.48243856", "0.4822282", "0.4821053", "0.4821053", "0.4821053", "0.48156273", "0.48150524", "0.48130378", "0.4807716", "0.4801207", "0.47966406", "0.47960967", "0.47930256", "0.4783348", "0.47804153", "0.47685957", "0.47645465", "0.47645465", "0.47613505", "0.47588938", "0.47567838", "0.47540188", "0.4751494", "0.4751494", "0.4751494", "0.4751494", "0.4751494", "0.4751494", "0.4751494", "0.4751494", "0.4751494", "0.47467694" ]
0.0
-1
save was clicked. this is just a helper function that is run to grab the data before submit.
function getMetadataForSubmit(){ meta_new_value = ''; if (meta_control_type == 'text') { meta_new_value = checkForNbsp( $("#meta_textarea").val() ); } else if (meta_control_type == 'list') { meta_new_value = checkForNbsp( $("#meta_textarea option:selected").text() ); } else if (meta_control_type == 'date') { var month = '', day = '', year = ''; month = checkForNbsp( $('#month_select option:selected').text() ); day = checkForNbsp( $('#day_select option:selected').text() ); year = checkForNbsp( $('#year_select option:selected').text() ); meta_new_value = year + '-' + month + '-' + day + ' CE'; } else if (meta_control_type == 'terminus') { var month = '', day = '', year = '', prefix = '', era = ''; month = checkForNbsp( $('#month_select option:selected').text() ); day = checkForNbsp( $('#day_select option:selected').text() ); year = checkForNbsp( $('#year_select option:selected').text() ); prefix = checkForNbsp( $('#prefix_select option:selected').text() ); era = checkForNbsp( $('#era_select option:selected').text() ); if (prefix != '') { meta_new_value = prefix + ' '; } meta_new_value += year + '-' + month + '-' + day; if (era != '') { meta_new_value += ' ' + era; } } else if (meta_control_type == 'multi_input') { $("#meta_textarea option").each(function () { meta_new_value += checkForNbsp( $(this).text() ) + "\n"; }); if (meta_new_value != '') { meta_new_value = meta_new_value.substring(0, meta_new_value.length - 1); } } else if (meta_control_type == 'multi_select') { $("#meta_textarea option:selected").each(function () { meta_new_value += checkForNbsp( $(this).text() ) + "\n"; }); if (meta_new_value != '') { meta_new_value = meta_new_value.substring(0, meta_new_value.length - 1); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "save () {\n\n // Validate\n if (this.checkValidity()) {\n\n // Collect input\n this.info.item = this.collectInput();\n\n // Show modal\n this.modal.show();\n }\n }", "function Save(e) {\n\t// saveURL is a switch used to check whether this is a new feature request or an edit.\n\tif (saveURL === undefined) {\n\t saveURL = newURL;\n\t}\n\t\n\t$.ajax({\n type: \"POST\",\n url: saveURL,\n data: $('#feature-request-form').serialize(),\n success: function (data) {\n grid.reload();\n\t\t$('#feature-modal-form').modal('hide');\n\t\tclearForm('#feature-modal-form');\n },\n\t failure: function () {\n alert('Failed to save.');\n\t\t$('#feature-modal-form').modal('hide');\n\t }\n });\n\tsaveURL = newURL;\n e.preventDefault();\n }", "function Save() {\n if ($('#ab121sgAddEdit').valid()) {\n if (vm.isNew) {\n dataContext.add(\"/api/ab121sg\",vm.ab121sg).then(function (data) {\n notify.showMessage('success', \"ab121sg record added successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab121sg/\";\n });\n } else {\n dataContext.upDate(\"/api/ab121sg\", vm.ab121sg).then(function (data) {\n notify.showMessage('success', \"ab121sg record updated successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab121sg/\";\n });\n }\n }\n }", "function saveAction(){\n\t\tvar data = getInput();\n\t\tif(data.id == \"\") {\n\t\t\t// delete the id property as it's\n\t\t\t// automatically set by database.\n\t\t\tdelete data.id;\n\t\t\tupdateDB(\"add\", data);\n\t\t}\n\t\telse {\n\t\t\tdata.id = Number(data.id);\n\t\t\tupdateDB(\"edit\", data);\n\t\t}\n\t\tclearInput();\n\t}", "save() {\n try {\n this._toggleSaveThrobber();\n this._readFromForm();\n this.dao.save();\n\n // make sure the edit input is showing the correct id, reload data from server\n document.getElementById('edit_id').value = this.dao.id;\n this.read();\n \n } catch(e) {\n console.log(e);\n alert(e);\n }\n this._toggleSaveThrobber();\n }", "function process_save(saveall) {\n obj = getObj('save_func');\n if (saveall)\n obj.value = 'save_all_page';\n else\n obj.value = 'save_marked';\n obj.form.submit();\n}", "function onSaveSuccess(data, response, xhr)\n\t{\n\t\tthis.sidebar.layout.removeClass('saving');\n\t\tthis.data.fields = data.fields;\n\t\tthis.sidebar.breadcrumbsView.back();\n\t\tthis.renderGridView();\n\t\tthis.showGridView();\n\t\tLiveUpdater.changedModel(this.data.field);\n\t}", "function onSaveSuccess(data, response, xhr)\n\t{\n\t\tthis.sidebar.layout.removeClass('saving');\n\t\tthis.data.field = data.field;\n\t\tLiveUpdater.changedModel(this.data.field);\n\t}", "function submit() {\n saveForm(applicant)\n}", "_handleButtonSave()\n {\n var element = this._getJQueryElement();\n if ($(element).is(':visible'))\n {\n this.model.set('job_settings', this._editor.getValue());\n Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__WORKFLOWJOB_SAVE, {workflowjob: this.model, workflow: this._workflow});\n }\n }", "submit () {\n\n // Add to saved A/B tests\n const saved = document.querySelector('#saved');\n saved.add(this.info.item);\n saved.clearFilters();\n\n // Switch to tab saved\n const tabs = document.querySelector('#tabs');\n tabs.selectTab('saved');\n\n // Hide modal\n this.modal.hide();\n\n // Reset create form\n document.querySelector('#create').innerHTML = '<fedex-ab-create></fedex-ab-create>';\n }", "function onSaveSuccess(data, response, xhr)\n\t{\n\t\tthis.createDefaultFields(this.data.creator);\n\t\tthis.sidebar.breadcrumbsView.back();\n\t\tthis.sidebar.layout.removeClass('saving');\n\t\tthis.showGridView();\n\t\t// LiveUpdater.refresh(); // decided to remove this for now\n\t}", "function successSave() {\n var saveSuccess = $('#save-success');\n showSaveResult(saveSuccess);\n}", "save() {\n this._toggleSaveThrobber();\n try {\n this._readFromForm();\n var resp = this.dao.save();\n if (!resp) {\n alert(\"Error while saving taxon.\")\n } else {\n var jsonObj = JSON.parse(resp);\n if (jsonObj[0].response == false ) {\n alert(jsonObj[1].response);\n } else {\n console.log(this.dao)\n // make sure the latin name input field is showing the correct name, reload data from server\n document.getElementById('latin_name').value = this.dao.unique_name;\n alert('Saved');\n }\n }\n } catch(e) {\n alert(e);\n console.log(e);\n }\n this._toggleSaveThrobber();\n }", "function onSaveSuccess(data, response, xhr)\n\t{\n\t\t// update id's and scope in case they change\n\t\t// this happens when switching from global\n\t\t// to page specific fields (switching scope)\n\t\tthis.data.node.data = data;\n\t\tthis.data.node.data.originals = this.originals;\n\t\tthis.data.field = this.data.node.data;\n\n\t\tthis.view.empty();\n\t\tthis.view.append(this.renderField(this.data.field, true));\n\t\tthis.sidebar.layout.removeClass('saving');\n\t\tLiveUpdater.changedField(this.data.field);\n\t}", "function save(){\n\tid = -1;\n\t\n\tif (pos_comp != -1)//modificar\n\t\tid = positions[pos_comp][0];\n\t\t\n\t$(\"#btnGuardar\").hide();\n\t$(\"#mensajeTemporal\").show();\n\t$(\"#backImage\").css({cursor:\"wait\"});\n\t\n\t\n\t$(\"#idPagina\").val(id);\n\t$(\"#contenido\").val($(\"#contenido\").sceditor(\"instance\").val());\n\t\n\t\n\t$(\"#subirPagina\").ajaxSubmit({\n\t\tdataType: \"json\",\n\t\tsuccess: function(respuesta_json){\n\t\t\t$(\"#btnGuardar\").show();\n\t\t\t$(\"#mensajeTemporal\").hide();\n\t\t\t$(\"#backImage\").css({cursor:\"default\"});\n\t\t\n\t\t\t$(\"#resultados\").text(respuesta_json.mensaje);\n\t\t\tprincipalCerrarPopUp(pagina_cerrarPopUp);\n\t\t\tconsultarTuplasExistentes(nombrePHPConsultar, isBorrarTuplas, arrayCamposConsulta);\n\t\t}\n\t});\n}", "function handleSaveButton() {\n $(\".main-area\").on(\"submit\", \"#js-edit-form\", function(e) {\n console.log(\"Save button clicked\");\n // stop from form submitting\n e.preventDefault();\n // create variable that holds title value\n let title = $(\"#journal-title\").val();\n // create variable that holds date value\n let travelDate = $(\"#travel-date\").val();\n // create variable that hold image value\n let coverPhoto = $(\"#main-image\").val();\n // if this (main-area) data method entry id equal undefined (meaning nothing inputted) is true\n if ($(this).data(\"entryid\") === undefined) {\n // call create entyr function with title, date and photo as parameter\n createEntry(title, travelDate, coverPhoto);\n } else {\n const id = $(this).data(\"entryid\");\n // create new entry object that has different keys\n const newEntry = {\n id,\n title,\n travelDate,\n coverPhoto\n };\n // call save entry with new entry object as a parameter\n saveEntry(newEntry);\n }\n });\n}", "function Save() {\n if ($('#ab041AddEdit').valid()) {\n if (vm.isNew) {\n dataContext.add(\"/api/ab041\",vm.ab041).then(function (data) {\n notify.showMessage('success', \"ab041 record added successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab041/\";\n });\n } else {\n dataContext.upDate(\"/api/ab041\", vm.ab041).then(function (data) {\n notify.showMessage('success', \"ab041 record updated successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab041/\";\n });\n }\n }\n }", "_save() {\n const detail = this.serializeForm();\n this.dispatchEvent(new CustomEvent('save', {\n bubbles: true,\n composed: true,\n cancelable: true,\n detail\n }));\n }", "'.save click'() {\n this.saveContact();\n Navigator.openParentPage();\n\n // Prevent the default submit behavior\n return false;\n }", "function editStudyInfoSave(e) {\r\n\r\n\t// console.log($('#editStudyInfoModal .form-control').serializeObject());\r\n\r\n\tvar newInfo = $('#editStudyInfoModal .form-control').serializeObject();\r\n\t// console.log(newInfo)\r\n\tvar study = $('#edit-study-page').data('editing');\r\n\r\n\t_.forEach(newInfo, function(item, key) {\r\n\t\tstudy[key] = item;\r\n\t});\r\n\r\n\t$('#edit-study-page').data('editing', study);\r\n\r\n\t$('#editStudyInfoModal').modal('hide');\r\n\r\n}", "save(){\n //\n }", "function clickSave(event) {\n event.preventDefault();\n if ($('#title-input').val() === \"\" || $('#task-input').val() === \"\") return false;\n var card = new CreateCard($('#title-input').val(), $('#task-input').val())\n $( \".bottom-box\" ).prepend(makeCardHTML(card)); \n localStoreCard(card);\n $('form')[0].reset();\n $('.character-count-task').text(0);\n $('.character-count-title').text(0);\n}", "save() {\n this._requireSave = true;\n }", "onSaving() {\n var ptr = this;\n this.formView.applyValues();\n this.record.save(function () {\n ptr.onSaved();\n });\n this.saving.raise();\n }", "function handleSave() {\n console.log('in handleSave');\n const updatedList = {\n id: trip.id,\n location: title,\n start_date: date,\n days: days,\n }\n console.log('Updated trip info:', updatedList);\n //update list to reflect changes by triggering events stemmed from update list reducer\n dispatch({ type: 'UPDATE_LIST', payload: updatedList })\n //reset edit mode to false\n setEditMode(false)\n // history.push('/user')\n }", "function OnBtnSave_Click( e )\r\n{\r\n Save( 'generic_save_title' , 'save_confirm_msg' ) ;\r\n}", "function OnBtnSave_Click( e )\r\n{\r\n Save( 'generic_save_title' , 'save_confirm_msg' ) ;\r\n}", "function saveSubmit() {\n\tvar sPath = '';\n\tsPath += document.getElementById('currentRoot').value;\n\tsPath += document.getElementById('currentFolder').value;\n\tif (selectedType == 'file') {\n\t\twindow.opener.filelibraryAction(sPath + selectedFile);\n\t\twindow.close();\n\t}\t\t\n}", "function onSaveClick() {\n logger.info('save_button click event handler');\n closeKeyboards();\n clearAllErrors();\n var isValid = true;\n\n if (!($.customer_profile_first_name.value)) {\n showError($.customer_profile_first_name, $.first_name_error, _L('Please provide a first name.'), true);\n isValid = false;\n }\n if (!($.customer_profile_last_name.value)) {\n showError($.customer_profile_last_name, $.last_name_error, _L('Please provide a last name.'), true);\n isValid = false;\n }\n\n if (isValid) {\n var params = {\n first_name : $.customer_profile_first_name.value,\n last_name : $.customer_profile_last_name.value\n };\n\n var promise = currentCustomer.setProfile(params);\n Alloy.Router.showActivityIndicator(promise);\n promise.done(function(model, params, options) {\n notify(_L('Customer profile data successfully saved.'));\n $.edit_customer_profile.fireEvent('route', {\n page : 'profile',\n isCancel : true\n });\n });\n }\n\n if (!isValid) {\n notify(_L('Please fill in all the required fields.'));\n }\n}", "function save() {\n //get all metadata entered by the user\n type = $(\"#type\")[0].value;\n material1 = $(\"#mat1\")[0].innerText;\n material2 = $(\"#mat2\")[0].innerText;\n description = $(\"#desc\")[0].value;\n newton = $(\"#newton\")[0].value;\n curve = JSON.stringify(processedData);\n //use jQuerys ajax request to post all data to a php script\n $.post(\"./php_helper/savedata.php\", {\n type: type,\n material1: material1,\n material2: material2,\n description: description,\n newton: newton,\n curve: curve\n }, function (data) {\n showPopup(\"save_success\");\n }).fail(function () {\n showPopup(\"save_fail\")\n });\n}", "onSaveButtonClick(eventObject) {\n let saveButton = eventObject.target;\n let savedType = saveButton.getAttribute(\"saved\") ? RoKA.Reddit.SaveType.UNSAVE : RoKA.Reddit.SaveType.SAVE;\n new RoKA.Reddit.SaveRequest(this.threadInformation.name, savedType, function () {\n if (savedType === RoKA.Reddit.SaveType.SAVE) {\n saveButton.setAttribute(\"saved\", \"true\");\n saveButton.textContent = RoKA.Application.localisationManager.get(\"post_button_unsave\");\n }\n else {\n saveButton.removeAttribute(\"saved\");\n saveButton.textContent = RoKA.Application.localisationManager.get(\"post_button_save\");\n }\n });\n }", "_handleClickButtonSave()\n {\n Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__RESOURCELIST_SAVE, {resourcelist: this.model,\n fields: {resource_type: this.ui.selectResourceType.val(),\n name: this.ui.resourceListName.val(),\n description: this.ui.resourceListDescription.val()}});\n }", "onSaveButtonClick(eventObject) {\n let saveButton = eventObject.target;\n let savedType = saveButton.getAttribute(\"saved\") ? RoKA.Reddit.SaveType.UNSAVE : RoKA.Reddit.SaveType.SAVE;\n new RoKA.Reddit.SaveRequest(this.commentObject.name, savedType, function () {\n if (savedType === RoKA.Reddit.SaveType.SAVE) {\n saveButton.setAttribute(\"saved\", \"true\");\n saveButton.textContent = RoKA.Application.localisationManager.get(\"post_button_unsave\");\n }\n else {\n saveButton.removeAttribute(\"saved\");\n saveButton.textContent = RoKA.Application.localisationManager.get(\"post_button_save\");\n }\n });\n }", "async postSave () {\n\t}", "save() {}", "handleSaveClick(event) {\n event.stopPropagation();\n event.preventDefault();\n\n this.doFormSave();\n }", "function saveEdited(){\n\tactiveDataSet = studentList.find( arr => arr.absenceId == activeElement ); \n\t$.post(\"\", {\n\t\t\t\t'type': 'editabsence',\n\t\t\t\t'console': '',\n\t\t\t\t'aid': activeDataSet['absenceId'],\n\t\t\t\t'id': activeElement,\n\t\t\t\t'start': formatDateDash(document.getElementById('esickstart').value),\n\t\t\t\t'end': formatDateDash(document.getElementById('esickend').value),\n\t\t\t\t'comment': document.getElementById('ecomment').value,\n\t\t\t\t'evia': document.querySelector('input[name=\"evia\"]:checked').value\n }, function (data,status) {\n\t\t\t\thandleServerResponse(data, status);\n\t\t\t});\t\n}", "function saveData() {\n\t\t\n\t\t// After Save, Alert User with a Dailog //\n\t\t$.mobile.changePage( \"#dialogAlert\", {\n\t\t transition: \"pop\",\n\t\t reverse: false,\n\t\t changeHash: false\n\t\t});\n\n\t\t// When #alertDialog Loads, Target ID, Clear the Div and Append the Following Save Alert //\n\t\t// In A listview with an Anchor Leading to #viewData //\n\t\t$('#alert').empty();\n\t\t$('#alert').append($('<li>').append($('<a href=\"#viewData\" id=\"saveAlertLink\" data-icon=\"rightarrow\"></a>')\n\t\t\t.append($('<img src=\"save.png\" class=\"iconImg\" />' +\n\t\t\t\t'<h4>Hooray!</h4>' +\n\t\t\t\t'<p>Your Loan Has Been Saved!</p>')\n\t\t)));\n\t\t// Refresh The Dialog listview to Ensure Proper View //\n\t\t$('#alert').listview(\"refresh\");\n\t}", "save() {\n }", "function saveData(key) {\n\t\t// Set Random Key for Stored Data //\n\t\tif(!key) {\n\t\t\tvar id = Math.floor(Math.random()*10001);\n\t\t}else{\n\t\t\tid = key;\n\t\t}\n\t\t// Call Functions //\n\t\tgetCheckboxValue();\n\t\tgetSelectedRadio();\n\t\tvar item \t\t\t\t= {};\n\t\t\titem.training \t\t= [\"Training Style: \", $('#training').value];\n\t\t\titem.wname\t\t\t= [\"Workout Name: \", $('#wname').value];\n\t\t\titem.favorite\t\t= [\"Favorite: \", favoriteValue];\n\t\t\titem.howlong\t\t= [\"How Long: \", $('#howlong').value + \" minutes\"];\n\t\t\titem.timeofday\t\t= [\"Preferred Time: \", timeValue];\n\t\t\titem.completiondate\t= [\"Completion Date: \", $('#completiondate').value];\n\t\t\titem.comments\t\t= [\"Self-Motivation: \", $('#comments').value];\n\t\t\t\n\t\t// Save Data into Local Storage with JSON.stringify //\n\t\tlocalStorage.setItem(id, JSON.stringify(item));\n\t\talert(\"Workout Saved!\");//\n\t\t// Set dialog using Dialog //\n\t\t//$('#dialog').attr(\"title\", \"Saved!\").text(\"Your workout has been saved.\").dialog('open');\n\t}", "function ep_Save() {\n\tvar bankAccount = nlapiGetFieldValue('custpage_2663_bank_account');\n\tvar batchId = nlapiGetFieldValue('custpage_2663_batchid');\n\tif (bankAccount && batchId) {\n\t\tif (!document.forms['main_form'].onsubmit || document.forms['main_form'].onsubmit()) {\n\t\t\tupsertBatch(bankAccount, batchId);\n\t\t\t\n\t\t\t// set the refresh flag\n\t\t nlapiSetFieldValue('custpage_2663_refresh_page', 'T', false);\n\n // set to view mode\n nlapiSetFieldValue('custpage_2663_edit_mode', 'F', false);\n \n\t\t // suppress the alert\n\t\t setWindowChanged(window, false);\n\t\t \n\t\t // submit the form -- calls submitForm function\n\t\t document.forms.main_form.submit();\n\t\t}\n\t}\n}", "function clickSaveButton() {\n\tif(this.innerHTML === savedButtText) {\n\t\tthis.innerHTML = notSavedButtText;\n\t} else {\n\t\tthis.innerHTML = savedButtText;\n\t}\n\n\tupdateAllSavedPCs();\n}", "function send_specific_info_into_db(form_submit){\t\t\n\t\t$(form_submit).submit(function(evt){\n\t\tvar article_id = $('#edit_article_container').attr('rel');\n\t\t\t//alert(article_id);\n\t\tevt.preventDefault();\n\t\tvar postData = $(this).serialize();\n\t\tvar url = $(this).attr('action');\n\t\t\t$.post(url, postData, function(php_table_data){\n\t\t\t\twindow.location = 'preview.php?article_id=' + article_id;\n\t\t\t});\n\t\t});\t\n\t}", "save(e) {\n e.preventDefault();\n // gather data from DOM\n let {$el} = this,\n resource_id = $el.find('#resource_id').val(),\n resource_name = $el.find('#resource_name').val(),\n resource_owners = $el\n .find('input:checked')\n .map(function () {\n return $(this).attr('id');\n })\n .toArray(),\n resource_description = $el.find('#resource_description').val(),\n\n // construct resource\n resource = {\n name: resource_name,\n resource_owners: resource_owners,\n description: resource_description\n };\n\n // save the resource\n this\n .actions\n .saveResource(resource_id, resource)\n .then(() => {\n // redirect to detail view of the resource\n return history.navigate(constructLocalUrl('resource-type', [resource_id]), {trigger: true});\n })\n .catch(err => {\n this\n .props\n .notificationActions\n .addNotification(\n `Could not save resource ${resource.name}. ${err.message}`,\n 'error'\n );\n });\n }", "function saveSpec() {\n updateGeneralspe();\n if (!iserror && !iserrorOwnpanel && !iserrorGeneralSpec && !isSingleError) {\n document.forms['specForm'].action = '${pageContext.request.contextPath}/specification/Specification.action?saveandBack=';\n document.forms['specForm'].submit();\n }\n }", "function handleSave(){\n props.onAdd(qItems);\n props.toggle(); \n }", "function save(){\r\n\tutil.log(\"Data: Saving All...\");\r\n\t//Save Each\r\n\tutil.log(\"Data: Saving Done...\");\r\n}", "function saveQuestion(){\n rightPane.innerHTML = templates.renderQuestionForm();\n var questionForm = document.getElementById(\"question-form\");\n questionForm.addEventListener('click', function(event){\n event.preventDefault();\n var target = event.target;\n var submit = document.querySelector(\"input.btn\");\n if (target === submit){\n var textArea = questionForm.querySelector('textarea').value;\n var nameInput = questionForm.querySelector('input[type=\"text\"]').value;\n var newEntry = {\n subject: nameInput, \n question: textArea,\n id: Math.random(),\n responses: []\n }\n var oldList = getStoredQuestions();\n oldList.push(newEntry);\n storeQuestions(oldList);\n var questionHtml = templates.renderQuestion({ \n questions: getStoredQuestions()\n });\n leftPane.innerHTML = questionHtml;\n questionForm.querySelector('textarea').value = \"\";\n questionForm.querySelector('input[type=\"text\"]').value = \"\"; \n addListeners();\n }\n });\n }", "function submitClick() {\n updateDBUser(currentUser.email, newName, newCountry, pictureIndex);\n setShowForm(!showForm);\n }", "function saveObject() {\r\n\tdocument.forms[0].submit();\r\n}", "function saveSubmit(callback) {\n LIMSService.Entrusted.UpdateStatus_EntrustedVoucher_General({\n voucherid: _VoucherID,\n statusofsubmit: 'P',\n qualifedstring: $scope.qual\n }).$promise.then(function (req) {\n callback(req);\n }, function (errResponse) {\n callback(errResponse);\n });\n }", "function saveAction(saveURL)\r\n{\r\n var workArea = _getWorkAreaDefaultObj();\r\n var docData = workArea.getHTMLDataObj();\r\n if(docData != null && docData.hasUserModifiedData() == true)\r\n {\r\n \tdocData.setSaveURL(saveURL);\r\n docData.performSaveChanges(_defaultWorkAreaSave);\r\n }\r\n else\r\n {\r\n \tvar objAjax = new htmlAjax();\r\n \tobjAjax.error().addError(\"warningInfo\", szMsg_No_change, false);\r\n \t_displayProcessMessage(objAjax);\r\n }\r\n}", "function save(model) {\n // who knows what this does\n }", "function actuallySave() {\n var inputs = document.getElementsByTagName('input');\n var data = {\n details: details\n };\n var isDefault = true;\n for(var i = 0; i < inputs.length; ++i) {\n if(inputs[i].type == 'checkbox') {\n data[inputs[i].id] = inputs[i].checked;\n if(isDefault && inputs[i].checked != (DEFAULT_FALSE.indexOf(inputs[i].id) === -1)) {\n isDefault = false;\n }\n }\n else {\n data[inputs[i].id] = inputs[i].value;\n if(isDefault && inputs[i].value) {\n isDefault = false;\n }\n }\n }\n twitch.configuration.set('broadcaster', CONFIG_VERSION, JSON.stringify(data));\n document.getElementById(\"reset\").disabled = isDefault;\n if(saveCallTimeout) {\n clearTimeout(saveCallTimeout);\n }\n saveCallTimeout = undefined;\n hideUnsaved();\n }", "function handleFormSubmit(event) {\n console.log(\"BUTTON CLICK\")\n event.preventDefault();\n const id = localStorage.getItem('id')\n API.saveGarden({\n title: formObject.gardenName,\n user_id: id,\n plant_id: formObject.plant_id,\n size: formObject.size,\n plants:formObject.plants\n }).then(res=>{\n const id = res.data._id\n history.push('/gardenview/'+id)\n })\n console.log(formObject)\n\n }", "function saveInput() {\n\t$(\"button\").on(\"click\", function () {\n\t\tevent.preventDefault(event);\n\t\tvar button = $(this);\n\n\t\tlocalStorage.setItem(\n\t\t\tbutton[0].form.nextElementSibling.dataset.value,\n\t\t\tbutton[0].form[0].value\n\t\t);\n\t});\n}", "function save ()\n {\n $uibModalInstance.close(vm.item);\n }", "function initSave(event) {\n event.preventDefault();\n var ajax = new Ajax();\n var data;\n var url;\n if(current.name.value) {\n url = \"../../src/php/rest.php?method=saveName\";\n data = \"name=\" + current.name.value;\n ajax.post(url, data, loadComplete);\n }\n if(current.username.value) {\n url = \"../../src/php/rest.php?method=saveUsername\";\n data = \"username=\" + current.username.value;\n ajax.post(url, data, loadComplete);\n }\n if(current.brows.files[0]) {\n saveImg();\n }\n else {\n var message = \"No field selected\";\n Flash.flashError(current.menu, message);\n }\n }", "function handleSaveItem(event){\n //Console readout\n //console.log(\"Saving item...\")\n \n //Convert the button that was clicked to a jQuery DOM item\n var target = $(event.target);\n\n //Check if the save icon is clicked instead of the button itself and adjust handle accordingly\n if (target.hasClass(\"fas\")){\n saveButton = $(event.target).parent();\n }else{\n saveButton = target;\n }\n \n //Get index for data save from data attribute \n var index = saveButton.parent().children('textarea').data('index');\n\n //Get entered text for timeblock\n var text = saveButton.parent().children('textarea').val();\n\n //Enter item into local storage\n localStorage.setItem(index,text);\n\n}", "livelyPrepareSave() {\n // this.setAttribute(\"data-mydata\", this.get(\"#textField\").value);\n }", "function saveAndClose(){\n save_button.addEventListener('click', function(event){\n event.preventDefault();\n active_element.innerHTML = editable_content.value;\n let json = {\n project_id: iframe.attributes['data-project-id'].value,\n selector: getUniqueSelector(active_element),\n change_value: editable_content.value,\n comment: content_comment.value\n }\n let myJSON = JSON.stringify(json);\n // Send data to backend\n let xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"/savechanges\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n // Typical action to be performed when the document is ready:\n console.log(\"Saved!\");\n }\n };\n xhr.send(myJSON);\n\n pu.style.display = 'none';\n editable_content.innerHTML = \"\";\n });\n close_button.addEventListener('click', function(){\n pu.style.display = \"none\";\n editable_content.innerHTML = \"\";\n });\n }", "function save(e) {\n var node = e.target;\n if (node.nodeName === 'INPUT' && node.checked) {\n localStorage[node.name] = node.value;\n }\n else if (node.nodeName === 'SELECT') {\n localStorage[node.name] = node.value;\n }\n }", "function saveData() {\n\t\tif(!key){\n\t\t\tvar id \t\t\t\t\t\t= Math.floor(Math.random()*1000001);\n\t\t}else{\n\t\t\tid = key;\n\t\t}\n\t\t\n\t\tgetRadioValue ();\n\t\tgetCheckbox();\n\t\tvar item\t\t\t\t\t\t= {};\n\t\t\t item.kname\t\t\t\t= [\"Kid's Name:\", $(\"kname\").value];\n\t\t\t item.pname\t\t\t\t= [\"Parent's Name:\", $(\"pname\").value];\n\t\t\t item.phone\t\t\t\t= [\"Phone #:\", $(\"phone\").value];\n\t\t\t item.email\t\t\t\t= [\"Email:\", $(\"email\").value];\n\t\t\t item.date\t\t\t\t= [\"Play Date:\", $(\"date\").value];\n\t\t\t item.sex\t\t\t\t= [\"Sex:\", sexValue];\n\t\t\t item.choice\t\t\t= [\"Best Time of Week:\", $(\"choice\").value];\n\t\t\t item.select\t\t\t= [\"Best Time of Day:\", $(\"dayTimes\").value];\n\t\t\t item.allergies\t\t= [\"Needs:\", hasAllergy];\n\t\t\t item.comments\t\t\t= [\"Notes:\", $(\"comments\").value];\n\t\t\t item.outgoing\t\t\t= [\"How Outgoing? 1-10:\", $(\"outgoing\").value];\n\t\tlocalStorage.setItem(id, JSON.stringify(item));\n\t\talert(\"Saved!\");\n\t}", "_saveData(){\n this.forwardButton.classList.remove('inactive');\n this.backButton.classList.remove('inactive');\n this.homeContainer.classList.remove('inactive');\n this.homeContainer.innerHTML = \"HOME\";\n const entry = this.diaryEntry.value;\n this.diaryService.post(this.journalID,this.date, this.promptIndex,entry);\n }", "function inner_after_save()\n\t{\n\t\tthat.processCodeInScripts();\n\t\tthat.editor.focus();\n\t\tthat.showInFooter(\"saved\");\n\t\tLiteGUI.trigger( that, \"stored\" );\n\t}", "function handleSaveButtonAjax(e) {\n\t\te.preventDefault();\n\t\tthis.blur();\n\n\t\tif (isSaving) {\n\t\t\t// If an AJAX save is currently being performed, submit the form immediately\n\t\t\t// This is because the user expects the button to be reliable\n\t\t\t$('#picture').val('');\n\t\t\t$('#application-form').submit();\n\t\t}\n\t\telse {\n\t\t\thandleAjaxSave(function() {\n\t\t\t\t$('#application-form').submit();\n\t\t\t})\n\t\t}\n\t}", "save () { if (this.name) saveValue(this.name, this.items); }", "function saveClicked () {\n // TODO - the disabling of the submit button should be in AJS.Dialog.\n var submitButton = $(\".permissions-update-button\").disable();\n if (isEditPage) {\n updateEditPage();\n\n // Notify the user that the changes are not yet saved to the back-end.\n AJS.setVisible(\"#page-permissions-unsaved-changes-msg\", permissionManager.permissionsEdited);\n submitButton.enable();\n closeDialog();\n } else {\n var post = permissionManager.makePermissionStrings();\n post.pageId = AJS.params.pageId;\n $(\"#waitImage\").show();\n\n AJS.safe.post(contextPath + \"/pages/setpagepermissions.action\", post, function(data) {\n $(\"#waitImage\").hide();\n\n // If any permissions set, show padlock\n AJS.setVisible(\"#content-metadata-page-restrictions\", data.hasPermissions);\n submitButton.enable();\n closeDialog();\n }, \"json\");\n }\n }", "function saveClicked () {\n // TODO - the disabling of the submit button should be in AJS.Dialog.\n var submitButton = $(\".permissions-update-button\").disable();\n if (isEditPage) {\n updateEditPage();\n\n // Notify the user that the changes are not yet saved to the back-end.\n AJS.setVisible(\"#page-permissions-unsaved-changes-msg\", permissionManager.permissionsEdited);\n submitButton.enable();\n closeDialog();\n } else {\n var post = permissionManager.makePermissionStrings();\n post.pageId = AJS.params.pageId;\n $(\"#waitImage\").show();\n\n AJS.safe.post(contextPath + \"/pages/setpagepermissions.action\", post, function(data) {\n $(\"#waitImage\").hide();\n\n // If any permissions set, show padlock\n AJS.setVisible(\"#content-metadata-page-restrictions\", data.hasPermissions);\n submitButton.enable();\n closeDialog();\n }, \"json\");\n }\n }", "function save() {\n if (!pro) {\n $ionicPopup.alert({\n title: 'Pro Feature',\n template: 'Workouts can only be saved in Ruckus Pro. You can however still share!'\n });\n return false;\n }\n\n if (vm.saved) {\n return false;\n }\n workoutService.editOrCreate(saveSnapShot.date, saveSnapShot).then(function(res) {\n vm.saved = true;\n }, function(err) {\n log.log('there was an error with saving to the datastore' + err);\n });\n }", "saveQuestion(e) {\n\t\tlet formData = new FormData();\n\t\tformData.append('username', this.username);\n\t\tformData.append('test_id', this.test_id);\n\t\tformData.append('test_key', `${this.username}_${this.test_key}`);\n\t\tformData.append('question_id', this.question_id);\n\t\tformData.append('answer', this.answer);\n\n\t\tif(this.answer === undefined) {\n\t\t\tconsole.log('not selected');\n\t\t\te.preventDefault();\n\t\t\tthis.answerWarning.classList.add('warning');\n\t\t} else {\n\t\t\tthis.nextQuestion.style.display = 'none';\n\t\t\tthis.waitBtn.style.display = 'inline';\n\t\t\tfetch('inc/handlers/save_question_handler.php', {\n\t\t\t\tmethod: 'POST',\n\t\t\t\tbody: formData\n\t\t\t});\n\t\t}\n\t}", "function onSubmitFileSaveForm() {\n return fileSaveForm.form('validate');\n }", "function save() {\n $log.log('CollegeFundPaymentDialogController::save called');\n if (vm.collegeFundPayment.id) {\n //update the collegeFundPayment information\n CollegeFundPayment.save(vm.collegeFundPayment, onSaveFinished);\n } else {\n // Create New CollegeFundPayment\n if (vm.collegeFundPayment.id !== null) {\n CollegeFundPayment.create(vm.collegeFundPayment, onSaveFinished);\n }\n }\n }", "function save() {\n //验证表单\n if (!$(\"#editForm\").validate())\n return false;\n var strData = \"{\";\n strData += \"'strItemID':'\" + $(\"#ItemID\").val() + \"',\";\n strData += \"'strCharge':'\" + $(\"#CHARGE\").val() + \"',\";\n strData += \"'strPowerFee':'\" + $(\"#TEST_POWER_FEE\").val() + \"',\";\n strData += \"'strPreFree':'\" + $(\"#PRETREATMENT_FEE\").val() + \"',\";\n strData += \"'strTestAnsyFree':'\" + $(\"#TEST_ANSY_FEE\").val() + \"',\";\n strData += \"'strTestPointNum':'\" + $(\"#TEST_POINT_NUM\").val() + \"',\";\n strData += \"'strAnsyNum':'\" + $(\"#ANALYSE_NUM\").val() + \"'\";\n strData += \"}\";\n\n $.ajax({\n cache: false,\n type: \"POST\",\n url: \"ItemPrice.aspx/EditItem\",\n data: strData,\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: function (data, textStatus) {\n if (data.d == \"1\") {\n detailWin.hidden();\n manager.loadData();\n clearDialogValue();\n }\n else {\n $.ligerDialog.warn('保存项目数据失败!');\n }\n }\n });\n }", "__save(method, url, success, error, final) {\n this.request(method, url, this.formData, success, error, final);\n }", "function submit(){\n\n if (!this.formtitle) return;\n const obj = Program.createWithTitle(this.formtitle).toObject();\n\n if (this.formvideo){\n obj.fields.video = {value: this.formvideo, type: 'STRING'};\n }\n\n ckrecordService.save(\n 'PRIVATE', // cdatabaseScope, PUBLIC or PRIVATE\n null, // recordName,\n null, // recordChangeTag\n 'Program', // recordType\n null, // zoneName, null is _defaultZone, PUBLIC databases can only be default\n null, // forRecordName,\n null, // forRecordChangeTag,\n null, // publicPermission,\n null, // ownerRecordName,\n null, // participants,\n null, // parentRecordName,\n obj.fields // fields\n ).then( record => {\n // Save new value\n this.formtitle = '';\n this.formvideo = '';\n $scope.$apply();\n this.add( {rec: new Program(record)} );\n this.close();\n }).catch((error) => {\n // Revert to previous value\n console.log('addition ERROR', error);\n //TODO: Show message when current user does not have permission.\n // error message will be: 'CREATE operation not permitted'\n });\n\n }", "onSaving() {\n if (this._saving) {\n this._saving.raise();\n }\n }", "function handleSave(e) {\r\n let target = e.target,\r\n query = target.dataset.query;\r\n\r\n if (query) {\r\n switch (query) {\r\n case \"saveSetting\": {\r\n let settings = list.map((item) => {\r\n return item.value;\r\n });\r\n\r\n settings.push(0); //current iteration\r\n\r\n Firebase.setValue(settings, \"settings\").then(() => {\r\n sessionStorage.setItem(\"isNewUser\", false);\r\n //Notification().showMessage(\"success\", \"Successfully saved!\");\r\n window.location.hash = \"#task-list\";\r\n });\r\n\r\n break;\r\n }\r\n }\r\n }\r\n }", "function setSaveEvent(data){\n\t\tvar theID = '#save_' + data.doc.index;\n\t\tscroll_id = '#save_' + data.doc.index;\n\t\t$(theID).click(function(){\n\n\t\t\t$.each(jsonData.rows,function(i){\n\t\t\t\tif(jsonData.rows[i].doc.index == data.doc.index){\n\t\t\t\t\tconsole.log(\"we are SAVING \" + data.doc.index);\n\t\t\t\t\t// Update the video name to JSON database\n\t\t\t\t\tthis_video_name= document.getElementById(\"nameForSaving\").innerHTML + \"_\" + data.doc.index +\n\t\t\t\t\t\t\t\"_\" + data.doc._id + \".mp4\";\n\n\t\t\t\t\t$(\"#save-to-disk\").trigger('click');\n\t\t\t\t\tjsonData.rows[i].doc[\"video\"] = this_video_name;\n\t\t\t\t\tsendUpdateJSONRequest();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t})\n\t\tsendUpdateJSONRequest();\n\t});\n}", "onSavePress() {\n\t\t\tvar sUrl = this._buildPreviewURL(this._buildReturnedURL());\n\t\t\tif (isValidUrl(sUrl) && this._areAllTextFieldsValid() && this._areAllValueStateNones()) {\n\t\t\t\tthis._close(this._buildReturnedSettings());\n\t\t\t} else {\n\t\t\t\tthis._setFocusOnInvalidInput();\n\t\t\t}\n\t\t}", "handleSubmitToDMS(){\n this.msgpaSelected = true;\n this.handleSave();\n }", "function saveTag() {\n\n $(\"input[name='_method']\").val(\n $(\"#categoryForm\").data(\"action\") == \"create\" ? \"POST\" : \"PATCH\"\n );\n\n var url = $(\"#DATA\").data(\"url\") + \"/categories\";\n $.formDataAjax({\n modalTitle: \"Categorías\",\n type: \"POST\",\n url:\n $(\"#categoryForm\").data(\"action\") == \"create\"\n ? url\n : url + \"/\" + $(\"#id\").val(),\n form: \"categoryForm\",\n loadingSelector: \"#categoryModal\",\n successCallback: function (data) {\n table.ajax.reload();\n $(\"#categoryModal\").modal(\"hide\");\n },\n errorCallback: function (data) {\n }\n });\n }", "function handleSave() {\n setLoading(true);\n //console.log(props.editData.data.id);\n let formData = {\n title,\n text\n };\n console.log(formData);\n axios\n .post(\n `https://salesforce-blogs.herokuapp.com/blogs/api/${\n isEdit ? props.editData.data.id : ''\n }`,\n formData\n )\n .then(response => {\n toast.success('Post saved successfully.');\n setLoading(false);\n })\n .catch(err => {\n toast.error('Cannot save post, some error occured' + err);\n console.log('Cannot save post, some error occured' + err);\n setLoading(false);\n });\n }", "function saveData() {\n\tstate.save();\n}", "async saveButtonClicked() {\n try {\n const writingData = await this.getData();\n const endpoint = this.page ? '/api/page/' + this.page._id : '/api/page';\n\n try {\n let response = await fetch(endpoint, {\n method: this.page ? 'POST' : 'PUT',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8'\n },\n body: JSON.stringify(writingData)\n });\n\n response = await response.json();\n\n if (response.success) {\n window.location.pathname = response.result.uri ? response.result.uri : '/page/' + response.result._id;\n } else {\n alert(response.error);\n console.log('Validation failed:', response.error);\n }\n } catch (sendingError) {\n console.log('Saving request failed:', sendingError);\n }\n } catch (savingError) {\n alert(savingError);\n console.log('Saving error: ', savingError);\n }\n }", "bindSave(handler) {\n this.form.addEventListener('submit', e => {\n const name = U.getElement('#name').value\n e.preventDefault()\n handler(name)\n return false;\n }, false)\n }", "function saveArticle (e) {\n if (e.preventDefault) {\n e.preventDefault();\n }\n\n var form = $(e.target),\n button = form.find('.standard-btn');\n\n button.trigger('start.activity');\n\n $.ajax({\n type: 'POST',\n url: form.attr('action'),\n statusCode: {\n 401: function () {\n window.location.href = '/login';\n }\n },\n success: function () {\n button.trigger('stop.activity');\n\n // Change the UI\n button\n .prop('disabled', true)\n .prop('title', 'Saved to Reading List')\n .blur();\n\n button.find('span')\n .text('Saved')\n .removeClass('icon-read-later')\n .addClass('icon-couch');\n },\n error: function (jqxhr) {\n button.trigger('stop.activity');\n }\n });\n }", "function saveEventDesc(event) {\n let clickedSave = event.target;\n let rowEventId = $(clickedSave).prev().attr('id');\n eventDescText = $(`#${rowEventId} textarea`).val()\n //check if the user enterd an event for the save button clicked\n if (eventDescText) {\n evntDescProp = rowEventId\n if (!dailyEvents) {\n dailyEvents = {}\n }\n dailyEvents[evntDescProp] = eventDescText\n localStorage.setItem(plannerDate.text(), JSON.stringify(dailyEvents));\n alert(\"Changes have been saved.\")\n }\n else {\n //if no data enterd for the event for the save button clicked, alert the user they clicked the wrong save\n alert(\"Please enter an event descrption before clicking SAVE.\")\n }\n}", "onSubmit(e) {\n e.preventDefault();\n alert(\"Saved\");\n }", "saveRecipeOfTheDay() {\n if (this.articleSaveRecipeOfTheDayButton.waitForExist()) {\n this.recipeOfTheDayID = this.getRecipeOfTheDayID();\n this.articleSaveRecipeOfTheDayButton.click();\n }\n }", "function handleSave(event) {\n event.preventDefault();\n setSaving(true);\n if (addOrEditContactType === messages.Add) onAddContact(addOrEditContact);\n else onUpdateContact(addOrEditContact);\n history.push('/contact-list');\n const contact = { ...addOrEditContact };\n const name = `${contact.firstname} ${contact.lastname}`;\n toast.success(`${messages.toastcontact} ${name} ${messages.toastsaved}`);\n }", "function saveUpdate()\r\n{ \r\n\tvar testid = $(this).data('testid');\r\n\tvar saveBtn = $(`#save-${testid}`);\r\n\tvar row = $(`.test-row-${testid}`);\r\n\r\n\tif (updateFlag == false)\r\n\t\ttestID = testid;\r\n\r\n\t// We only want to update and send JSON to the Update Endpoint once \r\n\t// the modal has been displayed. \r\n\tif (updateFlag)\r\n\t{\r\n\t\tvar updateFirstName = document.getElementById(\"updateFirstName\").value;\r\n\t\tvar updateLastName = document.getElementById(\"updateLastName\").value;\r\n\t\tvar updateEmail = document.getElementById(\"updateEmail\").value;\r\n\t\tvar updatePhone = document.getElementById(\"updatePhone\").value;\r\n\r\n\t\tupdateFlag = false;\r\n\t\tupdateContact(updateFirstName, updateLastName, updateEmail, updatePhone, testID);\r\n\t}\r\n\r\n\tupdateFlag = true;\r\n}", "registerSubmitEvent() {\n\t\tthis.container.on('click', '.js-modal__save', (e) => {\n\t\t\tAppConnector.request({\n\t\t\t\tmodule: app.getModuleName(),\n\t\t\t\taction: 'ChangeCompany',\n\t\t\t\trecord: this.container.find('#companyId').val()\n\t\t\t}).done(() => {\n\t\t\t\twindow.location.href = 'index.php';\n\t\t\t});\n\t\t\te.preventDefault();\n\t\t});\n\t}", "function dataEntrySubmit(ob) \r\n{\r\n\t// Set value of hidden field used in post-processing after form is submitted\r\n\t// $('#submit-action').val( ( $(ob).text() ? trim($(ob).text()) : trim($(ob).val()) ) );\r\n\t$('#submit-action').val( $(ob).attr('name') );\r\n\tif ($('#submit-action').val() == '' || $('#submit-action').val() == null) {\r\n\t\t$('#submit-action').val('submit-btn-saverecord');\r\n\t}\r\n\t\r\n\t// Clicked Save or Delete\r\n\tif ($('#submit-action').val() != \"submit-btn-cancel\") \r\n\t{\r\n\t\t// Determine esign_action\r\n\t\tvar esign_action = \"\";\r\n\t\tif ($('#__ESIGNATURE__').length && $('#__ESIGNATURE__').prop('checked') && $('#__ESIGNATURE__').prop('disabled') == false) {\r\n\t\t\tesign_action = \"save\";\r\n\t\t\t// If form is not locked already or checked to be locked, then stop (because is necessary)\r\n\t\t\tif ($('#__LOCKRECORD__').prop('checked') == false) {\r\n\t\t\t\tsimpleDialog('WARNING:\\n\\nThe \"Lock Record\" option must be checked before the e-signature can be saved. Please check the \"Lock Record\" check box and try again.');\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Set the lock action\r\n\t\tvar lock_action = ($('#__LOCKRECORD__').prop(\"disabled\") && (esign_action == \"save\" || esign_action == \"\")) ? 2 : 1;\r\n\t\t\r\n\t\t// \"change reason\" popup for existing records (and lock record, if user has rights)\r\n\t\tif (require_change_reason && record_exists && dataEntryFormValuesChanged) \r\n\t\t{\r\n\t\t\t$('#change_reason_popup').dialog('destroy');\r\n\t\t\t$('#change_reason_popup').dialog({ bgiframe: true, modal: true, width: 500, zIndex: 4999, buttons: {\r\n\t\t\t\t'Save': function() {\r\n\t\t\t\t\t$('#change_reason_popup_error').css('display','none'); //Default state\r\n\t\t\t\t\tif ($(\"#change_reason\").val().length < 1) {\r\n\t\t\t\t\t\t$('#change_reason_popup_error').toggle('blind',{},'normal');\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Before submitting the form, add change reason values from dialog as form elements for submission\r\n\t\t\t\t\t$('#form').append('<input type=\"hidden\" name=\"change-reason\" value=\"'+$(\"#change_reason\").val().replace(/\"/gi, '&quot;')+'\">');\t\t\t\t\t\t\r\n\t\t\t\t\t// Save locked value\r\n\t\t\t\t\tif ($('#__LOCKRECORD__').prop('checked')) {\r\n\t\t\t\t\t\t$('#change_reason_popup').dialog('destroy');\r\n\t\t\t\t\t\tsaveLocking(lock_action,esign_action);\r\n\t\t\t\t\t// Not locked, so just submit form\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tformSubmitDataEntry();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} });\r\n\t\t}\r\n\t\t// Do locking and/or save e-signature, then submit form\r\n\t\telse if ($('#__LOCKRECORD__').prop('checked') && (!$('#__LOCKRECORD__').prop(\"disabled\") || esign_action == \"save\"))\r\n\t\t{\r\n\t\t\tsaveLocking(lock_action,esign_action);\r\n\t\t}\r\n\t\t// Just submit form if neither using change_reason nor locking\r\n\t\telse\r\n\t\t{\r\n\t\t\tformSubmitDataEntry();\r\n\t\t}\r\n\t}\r\n\t// Clicked Cancel (requires form submission)\r\n\telse {\r\n\t\tformSubmitDataEntry();\r\n\t}\t\r\n}", "function buttonSaveCallback(data)\n{\n alert(data);\n}", "function saveData(){\n var id = Math.floor((Math.random()*10000000)+1); \n //gather all form field values and store them in an object\n //Object properties contain array with the form label and input values\n getSelectedRadio();\n var item = {}\n item.name = [\"Item Name:\", $('item-name').value];\n item.brand = [\"Item Brand:\", $('item-brand').value];\n item.quantity = [\"Quantity:\", $('quantity').value];\n item.cost = [\"Total Cost:\", $('total-cost').value];\n item.date = [\"Pledge Date:\", $('pledge').value];\n item.priority = [\"Priority:\", priorityValue];\n item.timeFrame = [\"Time Frame:\", $('time').value];\n item.amountSaved = [\"Amount Saved:\", $('amount').value];\n item.motivation = [\"Motivation:\", $('motivation').value];\n item.space = [\"<br>\", \"<br>\"];\n \n //save data into local storage: Using Stringify to convert our object into a string\n localStorage.setItem(id, JSON.stringify(item));\n alert(\"Saved!\");\n }", "onClickSave() {\n HashBrown.Helpers.SettingsHelper.setSettings(this.model.id, null, 'info', this.model.settings.info)\n .then(() => {\n this.close();\n\n this.trigger('change', this.model);\n })\n .catch(UI.errorModal);\n }", "function saveData(args) {\n var data = args;\n (function (d) {\n $.post('submit', {\"content\": JSON.stringify(d)});\n })(data);\n}", "function saveAndFinishLater()\n{\n\tif (vm.isSaveValid)\n\t{\n\t\t_submitAllData(SAVE_ORDER_AND_FINISH_LATER_URL, SUCCESS_MESSAGE.SAVE_ORDER_AND_FINISH_LATER);\n\t}\n}", "function save() {\r\n \t\t// get busy\r\n \t\tgetBusy();\r\n \t\t\r\n \t\t/****/\r\n \t\t\r\n \t\t\r\n \t\t/*****/\r\n \t\t\r\n \t\tangular.forEach(vm.examenes, function(examen, key) {\r\n \t\t\tif(examen.create) {\r\n \t\t\t\tcreate({\r\n\t\t\t\t\t\ttmp: {\r\n\t\t\t\t\t\t\tcodigoCausaExterna: vm.examenDetail.codigoCausaExterna,\r\n\t\t\t\t\t\t\tcodigoClaseServicio: vm.examenDetail.codigoClaseServicio,\r\n\t\t\t\t\t\t\tvalorCostoEps: '',\r\n\t\t\t\t\t\t\tvalorCuotaModeradora: ''\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t_embedded: {\r\n\t\t\t\t\t\t\texamenTipo:{\r\n\t\t\t\t\t\t\t\tid: examen.tipo,\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\tafiliado: {\r\n\t\t\t\t\t\t\t\tid: $stateParams.afiliadoId\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\tmedico: vm.examenDetail.medico\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\texamen: {}\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\t\t\t$state.go('main.afiliado.edit.examen.list', {afiliadoId: $stateParams.afiliadoId});\r\n \t\t\r\n \t}" ]
[ "0.7044786", "0.6961385", "0.69376624", "0.69375515", "0.69053787", "0.6905036", "0.68994737", "0.68904287", "0.6866641", "0.68442833", "0.6843944", "0.68310714", "0.68140966", "0.6800253", "0.67923254", "0.6787124", "0.6786178", "0.67747575", "0.6773818", "0.671149", "0.6637343", "0.6636818", "0.66166645", "0.6595551", "0.656837", "0.6563142", "0.65591246", "0.65591246", "0.6540228", "0.65046036", "0.64973015", "0.64927673", "0.64812696", "0.64797026", "0.64653665", "0.6463176", "0.64455223", "0.64432985", "0.64297724", "0.6398151", "0.63964164", "0.63894206", "0.63856936", "0.6383353", "0.63708484", "0.636256", "0.6358671", "0.6350436", "0.6347697", "0.6346339", "0.63427174", "0.6342112", "0.63357294", "0.6334161", "0.6319769", "0.63137376", "0.6313432", "0.6312409", "0.63109607", "0.6284832", "0.62822616", "0.6279439", "0.6264828", "0.62616", "0.6235193", "0.62249666", "0.62241864", "0.6223981", "0.62205476", "0.62205476", "0.6218642", "0.6213791", "0.6212375", "0.6205644", "0.61979306", "0.6189325", "0.6179784", "0.61761963", "0.61707807", "0.616578", "0.61651194", "0.6156563", "0.61550665", "0.61498064", "0.6144354", "0.6143009", "0.61415327", "0.61359334", "0.6130148", "0.6129254", "0.61240757", "0.61220694", "0.6121891", "0.6121873", "0.6119553", "0.6114508", "0.611422", "0.6108495", "0.6107512", "0.61039716", "0.61022997" ]
0.0
-1
Given a latest finalized DBR object, decide whether to import it
function importDBRCheck (finalizedDBR) { let dbrMonth = finalizedDBR.Month.format('MMMM YYYY') return redshift.hasMonth(finalizedDBR.Month).then(function (hasMonth) { if (hasMonth) { log.info(`No new DBRs to import.`) if (args.force) { log.warn(`--force specified, importing DBR for ${dbrMonth} anyways`) return finalizedDBR } cliUtils.runCompleteHandler(startTime, 0) } else { return finalizedDBR } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stageDBRCheck (finalizedDBR) {\n return dbr.findStagedDBR(finalizedDBR.Month).then(\n function (stagedDBR) {\n let dbrMonth = stagedDBR.Month.format('MMMM YYYY')\n // DBR is staged!\n if (!args.force) {\n // No need to re-stage\n log.warn(`Using existing staged DBR for ${dbrMonth}.`)\n let s3uri = `s3://${args.staging_bucket}/${stagedDBR.Key}`\n log.debug(`Staged s3uri: ${s3uri}`)\n return ({s3uri: s3uri, month: stagedDBR.Month})\n } else {\n // Force re-stage\n log.warn(`--force specified, overwriting staged DBR for ${dbrMonth}`)\n return dbr.stageDBR(stagedDBR.Month).then(function (s3uri) {\n return ({s3uri: s3uri, month: stagedDBR.Month})\n })\n }\n },\n function (err) {\n // DBR not staged. Stage then import.\n log.debug(`DBR not staged: ${err}`)\n log.info(`Staging DBR for ${finalizedDBR.Month.format('MMMM YYYY')}.`)\n return dbr.stageDBR(finalizedDBR.Month).then(function (s3uri) {\n return ({s3uri: s3uri, month: finalizedDBR.Month})\n })\n }\n )\n}", "function isImportLoaded(link) {\n return useNative ? link.__loaded ||\n (link.import && link.import.readyState !== 'loading') :\n link.__importParsed;\n}", "function isImportLoaded(link) {\n return useNative ? link.__loaded ||\n (link.import && link.import.readyState !== 'loading') :\n link.__importParsed;\n}", "function resolveDynamicImport(possibleSplitEntry) {\n const { moduleTree } = possibleSplitEntry;\n if (moduleTree.dependants.length === 0)\n return false;\n let isDynamic = true;\n for (const dependant of moduleTree.dependants) {\n // if all dependants require this module dynamic\n // then we have a splitEntry\n if (dependant.type !== ImportReference_1.ImportType.DYNAMIC_IMPORT) {\n isDynamic = false;\n break;\n }\n }\n return isDynamic;\n}", "isLoaded(tailNum) {\n\t\treturn (tailNum in this.flightData) && (!this.flightData[tailNum].loading)\n\t}", "function detectImport() {\n\tvar line;\n\tvar i = 0;\n\twhile ((line = Zotero.read()) !== false) {\n\t\tline = line.replace(/^\\s+/, \"\");\n\t\tif (line != \"\") {\n\t\t\t//Actual MEDLINE format starts with PMID\n\t\t\tif (line.substr(0, 6).match(/^PMID( {1, 2})?- /)) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tif (i++ > 3) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "isLoadPerformed() {\n const entriesType = this.getEntriesType();\n\n const { isLoadPerformed = false } = this.props.state.entries[entriesType];\n\n return isLoadPerformed;\n }", "isLoadedFromFileSystem() {\n return false;\n }", "function loadDone() {\n return true;\n }", "get loaded() { return this._value !== _sentinel; }", "SaveAndReimport() {}", "static setIsBundled() {\n ModuleRegistry.isBundled = true;\n }", "function Interpreter_ShouldLoad(theObjectData)\n{\n\t//by default: we dont load\n\tvar bRes = false;\n\t//dont load placeholders\n\tif (!theObjectData.PlaceHolder)\n\t{\n\t\t//always assume active\n\t\ttheObjectData.Inactive = false;\n\t\t//object is deactivated?\n\t\tif (this.State.Deactivated[theObjectData.Id])\n\t\t{\n\t\t\t//mark the object\n\t\t\ttheObjectData.Inactive = true;\n\t\t\t//we only load if we are loading inactive\n\t\t\tbRes = this.ShowInactive;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//variation object?\n\t\t\tif (theObjectData.Variation)\n\t\t\t{\n\t\t\t\t//object activated?\n\t\t\t\tif (this.State.Activated[theObjectData.Id])\n\t\t\t\t{\n\t\t\t\t\t//valid\n\t\t\t\t\tbRes = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//mark the object\n\t\t\t\t\ttheObjectData.Inactive = true;\n\t\t\t\t\t//we only load if we are loading inactive\n\t\t\t\t\tbRes = this.ShowInactive;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//assume its good\n\t\t\t\tbRes = true;\n\t\t\t}\n\t\t}\n\t\t//still valid? we need to check parentage\n\t\tif (bRes)\n\t\t{\n\t\t\t//has parent\n\t\t\tif (theObjectData.ParentObject)\n\t\t\t{\n\t\t\t\t//only valid if its valid parent\n\t\t\t\tswitch (theObjectData.ParentObject.Class)\n\t\t\t\t{\n\t\t\t\t\tcase __NEMESIS_CLASS_EDIT:\n\t\t\t\t\tcase __NEMESIS_CLASS_POPUP_MENU:\n\t\t\t\t\tcase __NEMESIS_CLASS_CHECK_BOX:\n\t\t\t\t\tcase __NEMESIS_CLASS_RADIO_BUTTON:\n\t\t\t\t\tcase __NEMESIS_CLASS_COMBO_BOX:\n\t\t\t\t\tcase __NEMESIS_CLASS_LIST_VIEW:\n\t\t\t\t\tcase __NEMESIS_CLASS_LIST_BOX:\n\t\t\t\t\tcase __NEMESIS_CLASS_TREE_VIEW:\n\t\t\t\t\tcase __NEMESIS_CLASS_STATUSBAR:\n\t\t\t\t\tcase __NEMESIS_CLASS_NAV_BAR:\n\t\t\t\t\tcase __NEMESIS_CLASS_TRACK_BAR:\n\t\t\t\t\t\t//bad parents\n\t\t\t\t\t\tbRes = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t//valid and not inactive? but we are showing inactive?\n\t\t\t\tif (bRes && !theObjectData.Inactive && this.ShowInactive)\n\t\t\t\t{\n\t\t\t\t\t//hunt down parents\n\t\t\t\t\tfor (var parent = theObjectData.ParentObject; parent; parent = parent.ParentObject)\n\t\t\t\t\t{\n\t\t\t\t\t\t//inactive?\n\t\t\t\t\t\tif (parent.Inactive)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//this should be inactive as well\n\t\t\t\t\t\t\ttheObjectData.Inactive = true;\n\t\t\t\t\t\t\t//end loop\n\t\t\t\t\t\t\tbreak;\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\telse\n\t\t\t{\n\t\t\t\t//only valid if its a top level\n\t\t\t\tswitch (theObjectData.Class)\n\t\t\t\t{\n\t\t\t\t\tcase __NEMESIS_CLASS_FORM:\n\t\t\t\t\tcase __NEMESIS_CLASS_POPUP_MENU:\n\t\t\t\t\t\t//stil fine\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t//cant load these without a parent\n\t\t\t\t\t\tbRes = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t//return the result\n\treturn bRes;\n}", "function dependenciesAreLoaded(dependencies) {\n\t\t\tfor ( var i = 0 ; i < dependencies.length ; i++ ) {\n\t\t\t\tvar libraryName = dependencies[i];\n\t\t\t\tif ( !(libraryStorage[libraryName]) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "_determineWhetherToWritePackageJson() {\n this.writePackageJson = this.writePackageJson && this.origin !== _constants().COMPONENT_ORIGINS.AUTHORED;\n }", "get inDepBundle () {\n const bundler = this.getBundler()\n return !!bundler && bundler !== this.root\n }", "function gLyphsLoadObjectInfo(id) {\n if(current_feature && (current_feature.id == id)) {\n gLyphsDisplayFeatureInfo(current_feature);\n return false;\n }\n\n var object = eedbGetObject(id);\n if(!object) { return false; }\n\n if(object.classname == \"Feature\") {\n gLyphsProcessFeatureSelect(object);\n }\n if(object.classname == \"Experiment\") {\n eedbDisplaySourceInfo(object);\n }\n if(object.classname == \"FeatureSource\") {\n eedbDisplaySourceInfo(object);\n }\n if(object.classname == \"Configuration\") {\n eedbDisplaySourceInfo(object);\n }\n if(object.classname == \"Assembly\") {\n eedbDisplaySourceInfo(object);\n }\n \n}", "function addIfComplete(aNode) {\n if (complete[aNode.id]) {\n return true;\n }\n \n if (incomplete[aNode.id]) {\n return false;\n }\n \n var isComplete = !!allPotentialObjects[aNode.id];\n \n if (isComplete && aNode.parents) {\n $.each(aNode.parents, function (key, parentNode) {\n if (!addIfComplete(parentNode)) {\n isComplete = false;\n return false;\n }\n });\n }\n \n if (!isComplete) {\n incomplete[aNode.id] = aNode;\n return false;\n } else {\n complete[aNode.id] = aNode;\n ret.push(aNode);\n return true;\n }\n }", "function isCanSwitchHSEditObj(nextobj) {\n//if I want to switch to another new object.\n if (!editHSObjIsDirty()) {\n editHSObjCleanup(nextobj == null ? true : false); //if no new obj to open, roll back up panel\n return true; //no editing done with the current ad, just close then.\n }\n if (nextobj && (nextobj.db_id != -1) && nextobj.db_id == currObj.db_id)\n return false; //false coz no need to switch\n if (!nextobj) {\n if (confirm(hsePrompt['confirmReset'])) {\n editHSObjCleanup(true); //no new obj to show. just roll back the pane.\n return true;\n }\n }\n else if (confirm(hsePrompt['confirmReset'])) {\n editHSObjCleanup(false); //keep the panel there.\n return true;\n }\n return false;\n}", "function isJsonSchemaDraft4 (obj) {\n expect(obj).to.be.an(\"object\");\n expect(obj).to.include.keys(\"id\", \"$schema\", \"properties\", \"definitions\");\n expect(obj).not.to.have.any.keys(exports);\n return true;\n }", "function checkFilesNeeded(base, comparator, ignores){\n if(Object.keys(base).length === 0 && base.constructor === Object || comparator.constructor != Object || Object.keys(ignores).length === 0 && ignores.constructor === Object){\n showToast(\"Please check you have loaded the appropriate files.\", \"R\");\n return false;\n }\n else{\n return true;\n }\n}", "isNodePackage(insertedPath, currentLine) {\r\n if (!currentLine.match(/require|import/)) {\r\n return false;\r\n }\r\n if (!insertedPath.match(/^[a-z]/i)) {\r\n return false;\r\n }\r\n return true;\r\n }", "load () {\n if (!this.exists) {\n // We can't load it because it doesn't exist\n throw new Carmel.Error(Carmel.Error.PACK.NOT_FOUND);\n }\n }", "function isImportIntraPackage(importingPackage) {\n return importedModulePackage => importedModulePackage === importingPackage;\n}", "function isDef(obj) {\n return typeof obj !== 'undefined';\n}", "validateObject(\n className: string,\n object: any,\n query: any,\n runOptions: QueryOptions,\n maintenance: boolean\n ): Promise<boolean> {\n let schema;\n const acl = runOptions.acl;\n const isMaster = acl === undefined;\n var aclGroup: string[] = acl || [];\n return this.loadSchema()\n .then(s => {\n schema = s;\n if (isMaster) {\n return Promise.resolve();\n }\n return this.canAddField(schema, className, object, aclGroup, runOptions);\n })\n .then(() => {\n return schema.validateObject(className, object, query, maintenance);\n });\n }", "function isAlreadyCompiled(input, output, banner, project) {\n // does output file exists\n var outstat = mtime(output);\n if (!outstat) {\n return false;\n }\n \n // is input newer than output?\n var inpstat = mtime(input);\n if (inpstat > outstat) {\n return false;\n }\n \n // does the banners match?\n var oldContent = fs.readFileSync(output).toString();\n if (oldContent.substr(0, banner.length) !== banner) {\n return false;\n }\n \n // its really compiled already...\n return oldContent;\n}", "function isInStockLibraries(n) {\n const sourceFile = ts.isSourceFile(n) ? n : n.getSourceFile();\n if (sourceFile) {\n return sourceFile.fileName.indexOf('node_modules/typescript/') !== -1;\n }\n else {\n // the node is nowhere? Consider it as part of the core libs: we can't do\n // anything with it anyways, and it was likely included as default.\n return true;\n }\n}", "function isLoaded() {\n\treturn LOADED;\n}", "function areDependenciesAvailable() {}", "checkResource(resource) {\n const lazyImports = [\n '@nestjs/swagger',\n '@nestjs/microservices',\n '@nestjs/microservices/microservices-module',\n '@nestjs/platform-express',\n '@nestjs/websockets/socket-module',\n 'cache-manager',\n 'class-validator',\n 'class-transformer',\n 'fastify-swagger'\n ];\n if (!lazyImports.includes(resource)) {\n return false;\n }\n try {\n require.resolve(resource);\n } catch (err) {\n return true;\n }\n return false;\n }", "checkResource(resource) {\n const lazyImports = [\n '@nestjs/microservices',\n '@nestjs/platform-express',\n 'cache-manager',\n 'class-validator',\n 'class-transformer',\n '@nestjs/microservices/microservices-module',\n '@nestjs/websockets/socket-module',\n ];\n if (!lazyImports.includes(resource)) {\n return false;\n }\n try {\n require.resolve(resource);\n } catch (err) {\n return true;\n }\n return false;\n }", "loadIncompleteProject() {\n const { onStepChange, onProjectUpdate } = this.props\n const incompleteProjectStr = window.localStorage.getItem(LS_INCOMPLETE_PROJECT)\n if(incompleteProjectStr) {\n const incompleteProject = JSON.parse(incompleteProjectStr)\n this.setState({\n project: update(this.state.project, { $merge : incompleteProject }),\n dirtyProject: update(this.state.dirtyProject, { $merge : incompleteProject }),\n wizardStep: WZ_STEP_FILL_PROJ_DETAILS\n }, () => {\n typeof onProjectUpdate === 'function' && onProjectUpdate(this.state.dirtyProject, false)\n typeof onStepChange === 'function' && onStepChange(this.state.wizardStep, this.state.dirtyProject)\n })\n }\n }", "function isImportable(path){\n var p = path;\n if(p.endsWith(\".m.js\")){\n p = p.substring(0, path.length - \".m.js\".length);\n }\n if(_get(p) != null){\n return true;\n }\n if(p.endsWith(\".p.js\")){\n p = p.substring(0, path.length - \".p.js\".length);\n }\n if(_get(p) != null){\n return true;\n }\n return false;\n}", "function loadObject(objPath, material1, material2) {\n loader.load(objPath, function(object) {\n object.name = objPath; //to be able to compare with loaded object\n\n var defaultMeshes = ['FR1', 'FR2', 'HE1', 'IB1', 'HG1', 'HT1', 'IB1', 'IL1', 'IN1', 'LI1', 'LO1', 'SO1', 'SO2', 'PF1', 'LI1', 'LC1', 'LC1LI', 'LC1HG', 'CO1', 'CO2', 'CO1LI', 'CO2LI'];\n var material1Meshes = ['FR1', 'FR2', 'IB1', 'IL1', 'CO1', 'CO2', 'LC1', 'ST1', 'TN1BK', 'TK1BK', 'TT1BK', 'TT2BK', 'MJ1BK', 'TB1BK', 'BI1BK', 'BI2BK', 'BB2', 'TN1', 'TK1', 'TT1', 'HT1', 'LO1'];\n\n object.rotation.y = (270 * Math.PI) / 180;\n object.translateZ(90);\n object.translateY(objY);\n\n object.traverse(function(child) {\n if (child instanceof THREE.Mesh) {\n\n child.visible = false;\n child.material = material2;\n\n if (defaultMeshes.includes(child.name)) {\n child.visible = true;\n child.castShadow = true;\n }\n if (material1Meshes.includes(child.name)) {\n child.material = material1;\n }\n }\n });\n\n scene.add(object);\n window.objectContainer.scene = scene;\n window.objectContainer.obj = object;\n\n });\n}", "removeImportAndDetectIfType() {\n this.tokens.removeInitialToken();\n if (\n this.tokens.matchesContextual(ContextualKeyword._type) &&\n !this.tokens.matches1AtIndex(this.tokens.currentIndex() + 1, TokenType.comma) &&\n !this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 1, ContextualKeyword._from)\n ) {\n // This is an \"import type\" statement, so exit early.\n this.removeRemainingImport();\n return true;\n }\n\n if (this.tokens.matches1(TokenType.name) || this.tokens.matches1(TokenType.star)) {\n // We have a default import or namespace import, so there must be some\n // non-type import.\n this.removeRemainingImport();\n return false;\n }\n\n if (this.tokens.matches1(TokenType.string)) {\n // This is a bare import, so we should proceed with the import.\n return false;\n }\n\n let foundNonType = false;\n while (!this.tokens.matches1(TokenType.string)) {\n // Check if any named imports are of the form \"foo\" or \"foo as bar\", with\n // no leading \"type\".\n if ((!foundNonType && this.tokens.matches1(TokenType.braceL)) || this.tokens.matches1(TokenType.comma)) {\n this.tokens.removeToken();\n if (\n this.tokens.matches2(TokenType.name, TokenType.comma) ||\n this.tokens.matches2(TokenType.name, TokenType.braceR) ||\n this.tokens.matches4(TokenType.name, TokenType.name, TokenType.name, TokenType.comma) ||\n this.tokens.matches4(TokenType.name, TokenType.name, TokenType.name, TokenType.braceR)\n ) {\n foundNonType = true;\n }\n }\n this.tokens.removeToken();\n }\n return !foundNonType;\n }", "function isDef(obj) {\n\t\treturn typeof obj !== 'undefined';\n\t}", "function compressed(){\n\t\treturn hasClass(compressClass);\n\t}", "function check_assetItem (obj, call_shotgun)\r\n {\r\n // define if obj is an object (and dict entry) or an array (coming from shotObj.background_assets)\r\n // check obj status according to Shotgun and/or assets_list\r\n // update the obj using asset_item\r\n // return updated asset_item >> this has to be an OBJECT !\r\n assets_list = readFile(episodeFolder, 'asset');\r\n // if it is an array process to transform to obj\r\n if (obj instanceof Array)\r\n {\r\n if (obj[1].match(/re-use/gi))\r\n {\r\n obj = new reuse_BGAssetObj (obj[2],obj[0]);\r\n }\r\n else if (!obj[1].match(/re-use|undefined/gi))\r\n {\r\n bgasset_name = obj[0];\r\n if (bgasset_name in assets_list)\r\n {\r\n // get the obj from the list\r\n obj = assets_list[bgasset_name];\r\n };\r\n }\r\n else\r\n {\r\n log('err', [$.line, decodeURI(File($.fileName).name)], obj.toSource() + \"\\nis not a valid BG object !\");\r\n };\r\n }\r\n if (obj instanceof Object && obj.BGType != 're-use') // new asset and not BG reuse\r\n {\r\n if (call_shotgun == true)\r\n {\r\n // this part will ask shotgun if asset is uploaded or not\r\n // and if asset has task assigned\r\n // then change asset.status and asset.sg_id accordingly\r\n // first create temp file in local dir containing asset_obj\r\n tmp_path = \"~/Documents/AdobeScripts/ExportTool/.temp\";\r\n tmpFile = new File (tmp_path);\r\n tmpFile.open(\"w\",\"TEXT\",\"????\");\r\n tmpFile.write (obj.toSource());\r\n tmpFile.close();\r\n // then call python script to check the asset\r\n ext_py_script = localize (py_scripts_path, \"sg_checkAssetStatus.py\");\r\n pythonScript = system.callSystem (python_path + ' \\\"' + ext_py_script + '\\\" -a \\\"' + tmp_path + '\\\"');\r\n result = eval(pythonScript);\r\n \r\n log('debug', [$.line, decodeURI(File($.fileName).name)], \"Shotgun call result:\\n\"+ obj['name'] + \"\\n\" + String(result));\r\n if (result[0] == obj['name'] && result[1] != 'undefined')\r\n {\r\n // asset found on shotgun\r\n // if asset has tasks assigned, status = locked, else status = uploaded\r\n // sg_id updated with id of corresponding asset\r\n obj.status = result[1];\r\n obj.sg_id = result[2];\r\n return obj;\r\n }\r\n else\r\n {\r\n // cannot find an asset on shotgun\r\n return obj;\r\n }\r\n }\r\n else\r\n {\r\n // keep obj as it is, and do not update asset.status\r\n return obj;\r\n }\r\n }\r\n else if (obj instanceof Object && obj.BGType == 're-use')\r\n {\r\n // keep obj as it is, and do not update asset.status\r\n return obj;\r\n }\r\n else\r\n {\r\n log('err', [$.line, decodeURI(File($.fileName).name)], (typeof obj) + \"\\nis not valid type of asset !\\n[\"+obj+\"]\");\r\n return;\r\n };\r\n }", "async LoadObject(path) {\n var estensione = path.split(\"/\").slice(-1)[0].split(\".\").slice(-1)[0].toLowerCase();\n\n var loader, errore = false;\n switch (estensione) {\n case \"gltf\":\n case \"glb\":\n loader = new GLTFLoader();\n loader.setDRACOLoader(this.dracoLoader);\n break;\n case \"obj\":\n loader = new OBJLoader();\n default:\n errore = true;\n }\n if (errore) {\n return 0;\n }\n\n const object = await Promise.all([\n loader.loadAsync(path),\n ]);\n return object[0];\n }", "function shouldReallyMerge(a, b) {\n return a.kind === b.kind && (a.kind !== 225 /* ModuleDeclaration */ || areSameModule(a, b));\n // We use 1 NavNode to represent 'A.B.C', but there are multiple source nodes.\n // Only merge module nodes that have the same chain. Don't merge 'A.B.C' with 'A'!\n function areSameModule(a, b) {\n if (a.body.kind !== b.body.kind) {\n return false;\n }\n if (a.body.kind !== 225 /* ModuleDeclaration */) {\n return true;\n }\n return areSameModule(a.body, b.body);\n }\n }", "function checkCompatability() {\n\tif (typeof my_ubmVersion !== \"string\") {\n\t\tvar s = \"The bookmarklet does not have a setting! Please make sure yours has one!\";\n\t\talert(s);\n\t\tthrow s;\n\t}\n\tif ([-1, NaN].includes(versionCompare(my_ubmVersion, ubm_clientFormatVersion))) { /*aka is the my_ubmVersion less than ubm_clientFormatVersion*/\n\t\tvar s = \"The client has an older version 'v\" + my_ubmVersion + \"' than is compatable with the bookarklet manager 'v\" + ubm_clientFormatVersion + \"'! Because of this, the script will not load until you update your bookmarklet. Possibly will add the ability to redirect to the main site and then update it for you.\";\n\t\talert(s);\n\t\tthrow s;\n\t}\n\tif (typeof repos !== \"undefined\") {\n\t\tconsole.log(\"Reloading script!\");\n\t}\n\tif (typeof my_settings !== \"object\") {\n\t\tconsole.warn(\"The settings object was not found or is not an object!\");\n\t\tsettings = {};\n\t}\n}", "function resourceIsNew(element) {\n if (!suppressDoubleIncludes) {\n return true;\n }\n const tagName = element.tagName.value;\n if (!tagName) {\n // text node they do not have tag names, so we can process them as they are without\n // any further ado\n return true;\n }\n let reference = element.attr(\"href\")\n .orElseLazy(() => element.attr(\"src\").value)\n .orElseLazy(() => element.attr(\"rel\").value);\n if (!reference.isPresent()) {\n return true;\n }\n return !head.querySelectorAll(`${tagName}[href='${reference.value}']`).length &&\n !head.querySelectorAll(`${tagName}[src='${reference.value}']`).length &&\n !head.querySelectorAll(`${tagName}[rel='${reference.value}']`).length;\n }", "_determineWhetherToDeleteComponentDirContent() {\n if (typeof this.deleteBitDirContent === 'undefined') {\n this.deleteBitDirContent = this.origin === _constants().COMPONENT_ORIGINS.IMPORTED;\n }\n }", "function importFile(type) {\n if(type === 'master') {\n importData();\n }\n }", "function forceLoad() {}", "isLoadedFromServer() {\n return true;\n }", "function instantiate_source_if_ready(crumbs, src_key) {\n let src_jsnc = _.isString(src_key) ? _.get(jsnc.indicators, src_key) : src_key;\n // instantiate dep and recurse only if all of indicator's dependencies are fulfilled\n if (_.every(this.provider_table.get(src_key), pkey => provider_ready.has(pkey) && provider_ready.get(pkey))) {\n instantiate_source.call(this, crumbs, src_key, src_jsnc);\n } else {\n let cyclist = coll.cycles_table.get(src_key);\n if (!_.isEmpty(cyclist)) {\n let unfulfilled = _.filter(this.provider_table.get(src_key), pkey => !provider_ready.has(pkey) || !provider_ready.get(pkey));\n // if all unfulfilled inputs are cyclic, allow indicator to be created normally, while substituting\n // in Deferred objects where inputs are not yet defined\n if (_.every(unfulfilled, unf => cyclist.includes(unf))) instantiate_source.call(this, crumbs, src_key, src_jsnc);\n }\n }\n }", "modelCanExist () {\n\t\t// we match on a New Relic object ID and object type, in which case we add a new stack trace as needed\n\t\treturn true;\n\t}", "async is_frozen(branch) {\n\n if (!this.inited) {\n await this.init()\n }\n\n var data = this.data\n\n if(!data) {\n return [false]\n }\n if (!data[branch]) {\n return [false]\n }\n\n if (!data[branch].frozen) {\n return [false]\n }\n\n return [true, data[branch].frozen_by]\n }", "function isReferenceEqual(a, b) {\n if (!isSymbolEqual(a.symbol, b.symbol)) {\n // If the reference's target symbols are different, the reference itself is different.\n return false;\n }\n // The reference still corresponds with the same symbol, now check that the path by which it is\n // imported has not changed.\n return a.importPath === b.importPath;\n }", "test_doNotRetainExtends(){\n let translator = new Translator();\n translator.registerPackage(PackageFile);\n let text = JSON.stringify(this.json.doNotRetainExtends);\n let object1 = translator.decode(text).getRoot();\n let object2 = translator.decode(text).getRoot();\n\n Assert.equals(\"ca.frar.jjjrmi.translator.testclasses.DoNotRetainExtends\", object1.constructor.__getClass());\n Assert.equals(\"ca.frar.jjjrmi.translator.testclasses.DoNotRetainExtends\", object2.constructor.__getClass());\n Assert.notEquals(object1, object2);\n }", "function isDeclared(objName) {\n return ( window.hasOwnProperty(objName) ) ? true : false;\n }", "lookup(name, checkIfIsImport) {\n var p = this.parent;\n var val = this.variables[name];\n if (val !== undefined) {\n // CHANGE HERE\n // Terminate lookup if it is an import, and return undefined\n if (checkIfIsImport && this.imports && this.imports.has(name)) {\n return undefined;\n }\n\n return val;\n }\n return p && p.lookup(name);\n }", "function validate(res){\n try {\n JSON.parse(JSON.stringify(require('./extracted/article.json')));\n JSON.parse(JSON.stringify(require('./extracted/metadata.json')));\n }\n catch (err){\n apiReply(res, {\n message: 'failure! Corrupt json recieved: ' + err,\n });\n return false;\n }\n return true;\n}", "function processImport(nodeName) {\n // an import (bkmark, org, tabsOutliner) has happened => save and refresh\n\n RefreshCB = function() {animateNewImport(nodeName);};\n saveBT();\n refreshTable();\n}", "function isDate(obj) {\n\n return getClass(obj) === \"Date\";\n}", "function importDeprecatedComponent(j, root) {\n let hasChanged = false;\n\n // import { connect } from 'dva';\n // import { injectIntl } from 'react-intl';\n root\n .find(j.Identifier)\n .filter((path) => {\n return (\n deprecatedComponentNames.includes(path.node.name) &&\n path.parent.node.type === 'ImportSpecifier' &&\n antdPkgNames.includes(path.parent.parent.node.source.value)\n );\n })\n .forEach((path) => {\n hasChanged = true;\n const importedComponentName = path.parent.node.imported.name;\n const antdPkgName = path.parent.parent.node.source.value;\n\n // remove old imports\n const importDeclaration = path.parent.parent.node;\n importDeclaration.specifiers = importDeclaration.specifiers.filter(\n (specifier) => !specifier.imported || specifier.imported.name !== importedComponentName,\n );\n\n // add new import from 'umi'\n const localComponentName = path.parent.node.local.name;\n addSubmoduleImport(j, root, {\n moduleName: 'umi',\n importedName: importedComponentName,\n localName: localComponentName,\n before: antdPkgName,\n });\n });\n\n return hasChanged;\n }", "checkIfModelBuiltFn () {\n fetch(test_url + '/TM/ldamodel', {\n mode: 'cors',\n method: 'GET'\n })\n .then((resp) => resp.json())\n .then((data) => {\n var modelBuilt = data['modelBuilt'];\n\n if (modelBuilt) {\n clearInterval(this.timerId);\n this.setState( { modelCreated: true } );\n }\n })\n .catch(function (error) {\n console.log(JSON.stringify(error));\n });\n }", "function isExportReference(node) {\n var container = resolver.getReferencedExportContainer(node);\n return !!container;\n }", "function compareImports(a, b) {\n return a.path < b.path ? -1 : 1;\n}", "function _isAlternativeRecognitionResult(obj) {\r\n return obj && typeof obj === 'object';\r\n}", "[ISREUSABLE] (entry, st) {\n return entry.type === 'File' &&\n !this.unlink &&\n st.isFile() &&\n st.nlink <= 1 &&\n process.platform !== 'win32'\n }", "[ISREUSABLE] (entry, st) {\n return entry.type === 'File' &&\n !this.unlink &&\n st.isFile() &&\n st.nlink <= 1 &&\n process.platform !== 'win32'\n }", "isLoadStarted() {\n const entriesType = this.getEntriesType();\n const { state } = this.props;\n\n return state.entries[entriesType].isLoadStarted || false;\n }", "function isScriptLoaded(elem,scriptentry) {\n\t\t\tif ((elem.readyState && elem.readyState!==\"complete\" && elem.readyState!==\"loaded\") || scriptentry[\"done\"]) { return 0; }\n\t\t\telem.onload = elem.onreadystatechange = nNULL; // prevent memory leak\n\t\t\treturn 1;\n\t\t}", "function isLoading()/*:Boolean*/ {\n return this.previewLoadMask$67CD && !this.previewLoadMask$67CD.disabled && this.previewLoadMask$67CD['el'].isMasked();\n }", "function isLoaded() {\n var globalRequire = window['require'];\n // .on() ensures that it's Dojo's AMD loader\n return globalRequire && globalRequire.on;\n}", "function isTiddlerLoadedModule(tiddler, title) {\n\n\tvar module = $tw.modules.titles[title];\n\n\t/*var moduleType = tiddler.fields[\"module-type\"];\n\tif (!moduleType) return false;\n\tvar typeGroup = $tw.modules.types[moduleType];\n\tif (!typeGroup) return false;\n\tvar module = typeGroup[title || tiddler.fields.title];*/\n\n\tif (!module) return false;\n\n\t// If there are exports, it has been loaded.\n\treturn Boolean(module.exports);\n}", "function loaded() {\n ut.assert(true);\n ut.async(false);\n }", "function is_object(object) {\n\t\treturn exists(object) && object !== null && object.constructor === object_constructor;\n\t}", "function isImportedReference(node) {\n var declaration = resolver.getReferencedImportDeclaration(node);\n return declaration && (declaration.kind === 231 /* ImportClause */ || declaration.kind === 234 /* ImportSpecifier */);\n }", "_processJavaEntityImports(fields, relationships) {\n let importJsonIgnore = false;\n let importJsonIgnoreProperties = false;\n let importSet = false;\n const uniqueEnums = {};\n\n let importApiModelProperty = Object.values(relationships).filter(v => typeof v.javadoc != 'undefined').length > 0;\n if (!importApiModelProperty) {\n importApiModelProperty = Object.values(fields).filter(v => typeof v.javadoc != 'undefined').length > 0;\n }\n\n Object.values(relationships).forEach(v => {\n if (v.ownerSide === false && ['one-to-many', 'one-to-one', 'many-to-many'].includes(v.relationshipType)) {\n importJsonIgnore = true;\n } else if (v.relationshipType === 'many-to-one') {\n importJsonIgnoreProperties = true;\n }\n if (v.relationshipType === 'one-to-many' || v.relationshipType === 'many-to-many') {\n importSet = true;\n }\n });\n\n Object.values(fields).forEach(v => {\n if (v.fieldIsEnum && (!uniqueEnums[v.fieldType] || (uniqueEnums[v.fieldType] && v.fieldValues.length !== 0))) {\n uniqueEnums[v.fieldType] = v.fieldType;\n }\n });\n return { importApiModelProperty, importJsonIgnore, importJsonIgnoreProperties, importSet, uniqueEnums };\n }", "[_canPlaceDep] (dep, target, edge, peerEntryEdge = null) {\n // peer deps of root deps are effectively root deps\n const isRootDep = target.isRoot && (\n // a direct dependency from the root node\n edge.from === target ||\n // a member of the peer set of a direct root dependency\n peerEntryEdge && peerEntryEdge.from === target\n )\n\n const entryEdge = peerEntryEdge || edge\n\n // has child by that name already\n if (target.children.has(dep.name)) {\n const current = target.children.get(dep.name)\n // if the integrities match, then it's literally the same exact bytes,\n // even if it came from somewhere else.\n if (dep.integrity && dep.integrity === current.integrity) {\n return KEEP\n }\n\n // we can always place the root's deps in the root nm folder\n if (isRootDep) {\n return this[_canPlacePeers](dep, target, edge, REPLACE, peerEntryEdge)\n }\n\n // if the version is greater, try to use the new one\n const curVer = current.package.version\n const newVer = dep.package.version\n // always try to replace if the version is greater\n const tryReplace = curVer && newVer && semver.gte(newVer, curVer)\n if (tryReplace && current.canReplaceWith(dep)) {\n return this[_canPlacePeers](dep, target, edge, REPLACE, peerEntryEdge)\n }\n\n // ok, see if the current one satisfies the edge we're working on then\n if (edge.satisfiedBy(current)) {\n return KEEP\n }\n\n // last try, if we prefer deduplication over novelty, check to see if\n // this (older) dep can satisfy the needs of the less nested instance\n if (this[_preferDedupe] && current.canReplaceWith(dep)) {\n return this[_canPlacePeers](dep, target, edge, REPLACE, peerEntryEdge)\n }\n\n // no agreement could be reached :(\n return CONFLICT\n }\n\n // check to see if the target DOESN'T have a child by that name,\n // but DOES have a conflicting dependency of its own. no need to check\n // if this is the edge we're already looking to resolve!\n if (target !== entryEdge.from && target.edgesOut.has(dep.name)) {\n const edge = target.edgesOut.get(dep.name)\n // It might be that the dep would not be valid here, BUT some other\n // version would. Could to try to resolve that, but that makes this no\n // longer a pure synchronous function. ugh.\n // This is a pretty unlikely scenario in a normal install, because we\n // resolve the peer dep set against the parent dependencies, and\n // presumably they all worked together SOMEWHERE to get published in the\n // first place, and since we resolve shallower deps before deeper ones,\n // this can only occur by a child having a peer dep that does not satisfy\n // the parent. It can happen if we're doing a deep update limited by\n // a specific name, however, or if a dep makes an incompatible change\n // to its peer dep in a non-semver-major version bump, or if the parent\n // is unbounded in its dependency list.\n if (!edge.satisfiedBy(dep)) {\n return CONFLICT\n }\n }\n\n // check to see what the name resolves to here, and who depends on it\n // and if they'd be ok with the new dep being there instead. we know\n // at this point that it's not the target's direct child node. this is\n // only a check we do when deduping. if it's a direct dep of the target,\n // then we just make the invalid edge and resolve it later.\n const current = target !== entryEdge.from && target.resolve(dep.name)\n if (current) {\n for (const edge of current.edgesIn.values()) {\n if (edge.from.isDescendantOf(target) && edge.valid) {\n if (!edge.satisfiedBy(dep)) {\n return CONFLICT\n }\n }\n }\n }\n\n return this[_canPlacePeers](dep, target, edge, OK, peerEntryEdge)\n }", "function checkForImport(file, importing) {\n\t\treturn fspro.readFile(file).then(contents => {\n\t\t\tif (contents.indexOf(importing) != -1) {\n\t\t\t\treturn file;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t}", "function hasImportOrReexportStatements(source) {\n return /(?:import|export)[\\s\\S]+?([\"'])(?:\\\\\\1|.)+?\\1/.test(source);\n }", "function checkForLibrary() {\n try {\n if(window.utag) {\n return true;\n }\n else {\n return false;\n }\n }\n catch (e) {\n log(\"ERROR: Could not find library (from checkForLibrary method): \" + e);\n return false;\n }\n }", "static isImportDeclaration(structure) {\r\n return structure.kind === StructureKind_1.StructureKind.ImportDeclaration;\r\n }", "checkLibraries() {\n const constructor = this;\n const regex = /__[^_]+_+/g;\n let unlinkedLibraries = constructor.binary.match(regex);\n\n if (unlinkedLibraries !== null) {\n unlinkedLibraries = unlinkedLibraries\n .map(\n (\n name // Remove underscores\n ) => name.replace(/_/g, \"\")\n )\n .sort()\n .filter((name, index, arr) => {\n // Remove duplicates\n if (index + 1 >= arr.length) {\n return true;\n }\n\n return name !== arr[index + 1];\n })\n .join(\", \");\n\n const error = `${constructor.contractName} contains unresolved libraries. You must deploy and link the following libraries before you can deploy a new version of ${constructor.contractName}: ${unlinkedLibraries}`;\n\n throw new Error(error);\n }\n }", "checkLibraries() {\n const constructor = this;\n const regex = /__[^_]+_+/g;\n let unlinkedLibraries = constructor.binary.match(regex);\n\n if (unlinkedLibraries !== null) {\n unlinkedLibraries = unlinkedLibraries\n .map((\n name // Remove underscores\n ) => name.replace(/_/g, \"\"))\n .sort()\n .filter((name, index, arr) => {\n // Remove duplicates\n if (index + 1 >= arr.length) {\n return true;\n }\n\n return name !== arr[index + 1];\n })\n .join(\", \");\n\n const error = `${\n constructor.contractName\n } contains unresolved libraries. You must deploy and link the following libraries before you can deploy a new version of ${\n constructor.contractName\n }: ${unlinkedLibraries}`;\n\n throw new Error(error);\n }\n }", "function boat_has_this_load(loads, load_id) {\n flag = false;\n loads.forEach((load) => {\n if (load.key == load_id) {\n flag = true;\n }\n });\n return flag;\n}", "function defined(obj) {\n return typeof obj !== 'undefined';\n }", "get isBolt(): boolean {\n // we only want to return true when there is bolt config\n // AND no yarn workspaces config\n // because emotion has a bolt config and yarn workspaces\n // and if you have both, you probably want workspaces\n let hasBolt = !!this.json.bolt;\n let hasYarnWorkspaces = !!this.json.workspaces;\n return hasBolt && !hasYarnWorkspaces;\n }", "function defined(obj) {\n return typeof obj !== 'undefined';\n }", "enforceBext_() {\r\n for (let prop in this.bext) {\r\n if (this.bext.hasOwnProperty(prop)) {\r\n if (this.bext[prop] && prop != 'timeReference') {\r\n this.bext.chunkId = 'bext';\r\n break;\r\n }\r\n }\r\n }\r\n if (this.bext.timeReference[0] || this.bext.timeReference[1]) {\r\n this.bext.chunkId = 'bext';\r\n }\r\n }", "function is_object(object) {\n\treturn exists(object) && object !== null && object.constructor === object_constructor;\n}", "function load_deps(importer, scope, cache, ref, complete)\n{\n var dl = ref.length, i, t, cached,\n head, load, next, loaded = new Array(dl);\n // xpcom module / nodejs, require / webworker, importScripts\n if (isXPCOM || isNode || isWebWorker)\n {\n for (i=0; i<dl; i++)\n {\n if (HAS.call(ref[i],'loaded'))\n {\n loaded[i] = ref[i].loaded;\n // hook here\n importer.trigger('import-class', [\n // this, id, classname, path, reference\n importer, ref[i].id, ref[i].name, ref[i].path, loaded[ i ]\n ], ref[i].ctx).trigger('import-class-'+ref[i].id, [\n // this, id, classname, path, reference\n importer, ref[i].id, ref[i].name, ref[i].path, loaded[ i ]\n ], ref[i].ctx);\n }\n else if (HAS.call(cache,ref[i].ctx+'--'+ref[ i ].cache_id))\n {\n loaded[i] = cache[ref[i].ctx+'--'+ref[ i ].cache_id];\n }\n else if ('class' !== ref[ i ].type)\n {\n loaded[i] = cache[ref[i].ctx+'--'+ref[ i ].cache_id ] = read_file( ref[ i ].path, isXPCOM ? 'UTF-8' : 'utf8');\n }\n else if (ref[ i ].name in scope)\n {\n loaded[i] = scope[ref[ i ].name];\n }\n else\n {\n loaded[i] = import_module(ref[ i ].name, ref[ i ].path, scope) || null;\n // hook here\n importer.trigger('import-class', [\n // this, id, classname, path, reference\n importer, ref[i].id, ref[i].name, ref[i].path, loaded[ i ]\n ], ref[i].ctx).trigger('import-class-'+ref[i].id, [\n // this, id, classname, path, reference\n importer, ref[i].id, ref[i].name, ref[i].path, loaded[ i ]\n ], ref[i].ctx);\n }\n }\n return complete.apply(scope, loaded);\n }\n // browser, <script> tags\n else\n {\n head = $$tag('head', 0);\n t = 0; i = 0;\n load = function load(id, ctx, type, path, next) {\n var done, script;\n if ('style' === type || 'script' === type)\n {\n if ((script = $$(id)) && type === script.tagName[LOWER]())\n {\n next();\n }\n else\n {\n read_file_async(path, 'utf8', function(data) {\n cache[ ctx+'--'+id ] = data;\n $$asset(type, data)[ATTR]('id', id);\n next();\n });\n }\n }\n else if ('class' !== type)\n {\n if ('template' === type && (script = $$(id)) && 'script' === script.tagName[LOWER]())\n {\n next();\n }\n else\n {\n read_file_async(path, 'utf8', function(data) {\n cache[ ctx+'--'+id ] = data;\n if ('template' === type && !$$(id))\n $$asset('tpl', data)[ATTR]('id', id);\n next();\n });\n }\n }\n else\n {\n if ((script = $$(id)) && 'script' === script.tagName[LOWER]())\n {\n next();\n }\n else\n {\n done = 0;\n script = $$el('script');\n script[ATTR]('id', id);\n script[ATTR]('type', 'text/javascript');\n script.onload = script.onreadystatechange = function() {\n if (!done && (!script.readyState || 'loaded' == script.readyState || 'complete' == script.readyState))\n {\n done = 1;\n script.onload = script.onreadystatechange = null;\n next();\n }\n }\n // load it\n //script.src = path;\n script[ATTR]('src', path);\n head.appendChild(script);\n }\n }\n };\n next = function next() {\n var cached;\n if (HAS.call(ref[i],'loaded') || (cached=HAS.call(cache,ref[ i ].ctx+'--'+ref[ i ].cache_id)) || (ref[ i ].name in scope))\n {\n loaded[i] = (HAS.call(ref[i],'loaded') ? ref[i].loaded : (cached ? cache[ ref[ i ].ctx+'--'+ref[ i ].cache_id ] : scope[ ref[ i ].name ])) || null;\n\n // hook here\n importer.trigger('import-class', [\n // this, id, classname, path, reference\n importer, ref[i].id, ref[i].name, ref[i].path, loaded[ i ]\n ], ref[ i ].ctx).trigger('import-class-'+ref[i].id, [\n // this, id, classname, path, reference\n importer, ref[i].id, ref[i].name, ref[i].path, loaded[ i ]\n ], ref[ i ].ctx);\n\n if (++i >= dl)\n {\n complete.apply(scope, loaded);\n }\n else if (HAS.call(ref[i],'loaded') || (cached=HAS.call(cache,ref[ i ].ctx+'--'+ref[ i ].cache_id)) || (ref[ i ].name in scope))\n {\n loaded[i] = (HAS.call(ref[i],'loaded') ? ref[i].loaded : (cached ? cache[ ref[ i ].ctx+'--'+ref[ i ].cache_id ] : scope[ ref[ i ].name ])) || null;\n next();\n }\n else\n {\n scope[ref[ i ].name] = null;\n load(ref[ i ].cache_id, ref[ i ].ctx, ref[ i ].type, ref[ i ].path, next);\n }\n }\n else if (++t < 4)\n {\n setTimeout(next, 20);\n }\n else\n {\n t = 0;\n scope[ref[ i ].name] = null;\n // hook here\n importer.trigger('import-class', [\n // this, id, classname, path, reference\n importer, ref[i].id, ref[i].name, ref[i].path, null\n ], ref[ i ].ctx).trigger('import-class-'+ref[i].id, [\n // this, id, classname, path, reference\n importer, ref[i].id, ref[i].name, ref[i].path, null\n ], ref[ i ].ctx);\n i++; next();\n }\n };\n while (i < dl && (HAS.call(ref[i],'loaded') || (cached=HAS.call(cache,ref[ i ].ctx+'--'+ref[ i ].cache_id)) || (ref[ i ].name in scope)))\n {\n loaded[i] = (HAS.call(ref[i],'loaded') ? ref[i].loaded : (cached ? cache[ ref[ i ].ctx+'--'+ref[ i ].cache_id ] : scope[ ref[ i ].name ])) || null;\n i++;\n }\n if (i < dl) load(ref[ i ].cache_id, ref[ i ].ctx, ref[ i ].type, ref[ i ].path, next);\n else complete.apply(scope, loaded);\n }\n}", "function isAllowToImportPackage(toDirPath, currentWorkspace, pkgPath) {\n if (pkgPath.startsWith('internal/')) {\n return false;\n }\n const internalPkgFound = pkgPath.match(/\\/internal\\/|\\/internal$/);\n if (internalPkgFound) {\n const rootProjectForInternalPkg = path.join(currentWorkspace, pkgPath.substr(0, internalPkgFound.index));\n return toDirPath.startsWith(rootProjectForInternalPkg + path.sep) || toDirPath === rootProjectForInternalPkg;\n }\n return true;\n}", "async function isClassifierKnown(classifier, creds, expected, expectedErrors) {\n try {\n const classifierInfo = await store.getClassifierByBluemixId(classifier.id);\n // if the classifier wasn't found in the DB...\n if (!classifierInfo &&\n // ... and it isn't a classifier that everyone gets as a sample out of the box ...\n bluemixclassifiers.IGNORE.indexOf(classifier.name) === -1 &&\n // ... and we haven't already notified the teacher about this...\n isErrorExpected(expectedErrors, 'unmanagedClassifiers', expected, classifier.id) === false) {\n // then classifier is not known!\n return false;\n }\n return true;\n }\n catch (err) {\n log.error({ err, classifier, creds, credid: creds.id }, 'Failed to get classifier info from DB');\n slack.notify('Failed to verify ' + expected + ' classifier ' + classifier.id, slack.SLACK_CHANNELS.CREDENTIALS);\n // Okay... so the classifier isn't known, so we're about to lie here.\n // but it's not really lying, it's more optimistic. We haven't been\n // able to successfully confirm that the classifier isn't in the DB,\n // so let's assume that it's probably there.\n // (With a prod on Slack so it can be investigated properly).\n return true;\n }\n}", "checkJsonDeep(target, keys) {\n let origin = target;\n keys = keys.split('.');\n for (let key of keys) {\n if (typeof origin[key] === 'undefined' || !origin[key]) {\n return false;\n }\n origin = origin[key];\n }\n\n return true;\n }", "function isSortable(object){\n\treturn !!object.sort; \n}", "function isValid () {\n var name = this.path.substring(devDir.length + 1)\n var isValid = valid(name)\n if (name === '' && this.type === 'Directory') {\n // the first directory entry is ok\n return true\n }\n if (isValid) {\n log.verbose('extracted file from tarball', name)\n extractCount++\n } else {\n // invalid\n log.silly('ignoring from tarball', name)\n }\n return isValid\n }", "function isUpdateAvailable() {\n /* globals __webpack_hash__ */\n // __webpack_hash__ is the hash of the current compilation.\n // It's a global variable injected by webpack.\n return mostRecentCompilationHash !== __webpack_require__.h();\n} // webpack disallows updates in other states.", "function loadAPIConnectionData( ) {\n\n\tif ( ( false !== AccessToken ) && ( false !== BASE_URL ) ) {\n\t\t// no need to load connection settings, already set\n\t\treturn true;\n\t}\n\n\ttry {\n\t\tvar data = Storage.readSync( at_file );\n\t\tdata = JSON.parse( data );\n\n\t\tAccessToken = data.token;\n\t\tBASE_URL = data.baseurl;\n\n\t\treturn ( false !== AccessToken ) && ( false !== BASE_URL );\n\t}\n\tcatch( e ) {\n\t\treturn false;\n\t}\n\n\treturn false;\n\n}", "function isPromocodeJsonTypeAvailable(){\n\tvar paymentOptionTypes = JSON.parse(localStorage.getItem(\"fundingSourceTypes\"));\n\tfor ( var paymentOptionIndex = 0; paymentOptionIndex < paymentOptionTypes.length; paymentOptionIndex++) {\n\t\tvar paymentOptionSourcesJsonType = paymentOptionTypes[paymentOptionIndex].jsonType;\n\t\tif(paymentOptionSourcesJsonType === jsonTypeConstant.PROMOCREDIT){\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function cargaFinalizada() {\n return travelreq.finishedLoad && driversLoader.finishedLoad && positionsLoader.finishedLoad && incidentsLoader.finishedLoad;\n }", "newClientAvailable(id, fields, currentVersion) {\n function isNewVersion(version) {\n return (\n version._id === id &&\n fields.some(\n (field) => version[field] !== currentVersion[field]\n )\n );\n }\n\n const dependency = new Tracker.Dependency();\n const version = this.get(id);\n dependency.depend();\n const stop = this.watch(\n (version) => {\n if (isNewVersion(version)) {\n dependency.changed();\n stop();\n }\n },\n {\n skipInitial: true,\n }\n );\n return !!version && isNewVersion(version);\n }", "test_doNotRetainAnno(){\n let translator = new Translator();\n translator.registerPackage(PackageFile);\n let text = JSON.stringify(this.json.doNotRetainAnno);\n let object1 = translator.decode(text).getRoot();\n let object2 = translator.decode(text).getRoot();\n\n Assert.equals(\"ca.frar.jjjrmi.translator.testclasses.DoNotRetainAnno\", object1.constructor.__getClass());\n Assert.equals(\"ca.frar.jjjrmi.translator.testclasses.DoNotRetainAnno\", object2.constructor.__getClass());\n Assert.notEquals(object1, object2);\n }", "async _handlePreviouslyNestedCurrentlyImportedCase() {\n if (!this.consumer) return; // $FlowFixMe this.component.componentMap is set\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n\n if (this.origin === _constants().COMPONENT_ORIGINS.IMPORTED && this.component.componentMap.origin === _constants().COMPONENT_ORIGINS.NESTED) {\n await this._cleanOldNestedComponent();\n this.component.componentMap = this.addComponentToBitMap(this.writeToPath);\n }\n }", "importJson(toImportJson) { \n if(!(\"investments\" in toImportJson))\n return false;\n\n // Look for the investments key, put it as investment objects\n var tempInvestments = {};\n var investmentsJson = toImportJson[\"investments\"];\n\n for(var i = 0; i < investmentsJson.length; i++) {\n try {\n var investment = Investment.jsonToObject(investmentsJson[i]);\n tempInvestments[investment.properties[\"projectId\"]] = investment;\n } catch(err) {\n console.log(err);\n return false;\n }\n }\n\n this.investments = tempInvestments;\n this.persist();\n return true;\n }" ]
[ "0.56698275", "0.54464036", "0.54464036", "0.53402126", "0.52092147", "0.5175762", "0.51743627", "0.5021658", "0.49325806", "0.48964417", "0.48744404", "0.48551345", "0.48498148", "0.48346767", "0.48335588", "0.48110187", "0.47725433", "0.47594666", "0.47549152", "0.47402713", "0.4731066", "0.47300786", "0.47241557", "0.46995926", "0.469035", "0.46815738", "0.46773157", "0.46649256", "0.4662499", "0.46593606", "0.4653791", "0.4651124", "0.4641227", "0.4638103", "0.4630515", "0.46290228", "0.4627916", "0.4592738", "0.45824674", "0.45746824", "0.45510647", "0.45478588", "0.4543107", "0.45410454", "0.4533998", "0.45288402", "0.45232633", "0.4506334", "0.44949365", "0.44899327", "0.44836342", "0.44830278", "0.44799966", "0.44767764", "0.4473584", "0.44721162", "0.44718784", "0.4466713", "0.4460746", "0.4458108", "0.44554347", "0.444318", "0.44428533", "0.44428533", "0.44394138", "0.44355172", "0.4426447", "0.4425476", "0.442294", "0.44131204", "0.44098893", "0.44048473", "0.44035256", "0.4403403", "0.44015703", "0.44014516", "0.43988046", "0.4396873", "0.43957657", "0.43929118", "0.43800622", "0.4377094", "0.43741006", "0.43733674", "0.43721572", "0.4368244", "0.4368196", "0.43632466", "0.435767", "0.43503678", "0.43499795", "0.43474215", "0.43465766", "0.43453637", "0.43452027", "0.4331754", "0.43285504", "0.43257672", "0.43235093", "0.43186292" ]
0.6206688
0
Given a DBR, (optionally) stage it
function stageDBRCheck (finalizedDBR) { return dbr.findStagedDBR(finalizedDBR.Month).then( function (stagedDBR) { let dbrMonth = stagedDBR.Month.format('MMMM YYYY') // DBR is staged! if (!args.force) { // No need to re-stage log.warn(`Using existing staged DBR for ${dbrMonth}.`) let s3uri = `s3://${args.staging_bucket}/${stagedDBR.Key}` log.debug(`Staged s3uri: ${s3uri}`) return ({s3uri: s3uri, month: stagedDBR.Month}) } else { // Force re-stage log.warn(`--force specified, overwriting staged DBR for ${dbrMonth}`) return dbr.stageDBR(stagedDBR.Month).then(function (s3uri) { return ({s3uri: s3uri, month: stagedDBR.Month}) }) } }, function (err) { // DBR not staged. Stage then import. log.debug(`DBR not staged: ${err}`) log.info(`Staging DBR for ${finalizedDBR.Month.format('MMMM YYYY')}.`) return dbr.stageDBR(finalizedDBR.Month).then(function (s3uri) { return ({s3uri: s3uri, month: finalizedDBR.Month}) }) } ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DBVTBroadPhase() {\n\n _BroadPhase.BroadPhase.call(this);\n\n this.types = _constants.BR_BOUNDING_VOLUME_TREE;\n\n this.tree = new _DBVT.DBVT();\n this.stack = [];\n this.leaves = [];\n this.numLeaves = 0;\n}", "function _addStage(funcParamObj,onExecuteComplete){\r\n\r\n /** default object content of an operation */\r\n var operationObj = funcParamObj.operationRef;\r\n var httpRequest = funcParamObj.request;\r\n var httpResponse = funcParamObj.response;\r\n var data = funcParamObj.payload;\r\n\r\n /** operation configuration */\r\n var pipelineFieldName = operationObj.conf['params.payload.pipelinename'] ? operationObj.conf['params.payload.pipelinename'] : 'pipeline';\r\n var sortFromConf = operationObj.conf['params.sort'] || operationObj.conf['params.sort.default'];\r\n var sortFromPayloadField = operationObj.conf['params.payload.sort.field'];\r\n var sortDirection = operationObj.conf['params.payload.sort.direction'];\r\n\r\n try {\r\n\r\n // containers\r\n var pipelineArray = data[pipelineFieldName];\r\n var sortStage = {};\r\n var sortSubStage = {};\r\n var sortValue = 1; // default ASC\r\n if(sortDirection && data[sortDirection] && data[sortDirection]==='DESC'){\r\n sortValue = -1;\r\n }\r\n\r\n // get projection\r\n if(sortFromPayloadField && data[sortFromPayloadField]){\r\n // explicit field with all projection\r\n sortSubStage[data[sortFromPayloadField]] = sortValue;\r\n }else if (sortFromConf){\r\n // configuration-time projection or default\r\n sortSubStage = JSON.parse(sortFromConf);\r\n }else{\r\n sortSubStage._id = sortValue;\r\n }\r\n\r\n // create the stage\r\n sortStage['$sort']=sortSubStage;\r\n\r\n // build up togheter\r\n if(!pipelineArray){\r\n pipelineArray=[];\r\n }\r\n pipelineArray[pipelineArray.length]=sortStage;\r\n data[pipelineFieldName]=pipelineArray;\r\n\r\n /** callback with funcParamObj updated - maybe */\r\n funcParamObj.payload = data;\r\n onExecuteComplete(null, funcParamObj);\r\n\r\n }catch(error){\r\n\r\n /** dispatch the error to the next op in chain */\r\n onExecuteComplete(error,funcParamObj);\r\n\r\n }\r\n}", "function updateStage() {\n compound_pendulam_stage.update();\n}", "runBootStage(stage) {\n const runBootStagePromiseResolver = async (resolve, reject) => {\n try {\n systemLog_1.default.log({ leadingBlankLine: false }, `BOOT STAGE: ${stage}`);\n this.stageResolver = resolve;\n this.stageRejecter = reject;\n this.bootConfigs[stage] = this.getBootConfig(stage, this.finsembleConfig);\n this.dependencyGraphs[stage] = new bootDependencyGraph_1.BootDependencyGraph(stage, this.bootConfigs[stage], this.cumulativePreviousBootConfig);\n logger_1.default.system.log(\"forceObjectsToLogger\", \"BootDependencyGraph.runBootStage\", stage, this.bootConfigs[stage], this.cumulativePreviousBootConfig, this.dependencyGraphs[stage]);\n console.log(\"BootDependencyGraph.runBootStage\", stage, this.bootConfigs[stage], this.cumulativePreviousBootConfig, this.dependencyGraphs[stage]);\n // kicks off processing the dependency graph for this stage -- will continue until done\n this.processWhatIsReady(this.dependencyGraphs[stage]);\n // keep list of all to check for dependency located in a previous state\n this.cumulativePreviousBootConfig = [...this.cumulativePreviousBootConfig, ...this.bootConfigs[stage]];\n }\n catch (err) {\n reject(new bootDependencyGraph_1.DGDiagnostics(\"BootEngine:runBootStage.reject\" + err));\n }\n };\n return new Promise(runBootStagePromiseResolver);\n }", "static prepare(_branch, _options = {}, _mtxWorld = FudgeCore.Matrix4x4.IDENTITY(), _lights = new Map(), _shadersUsed = null) {\n let firstLevel = (_shadersUsed == null);\n if (firstLevel) {\n _shadersUsed = [];\n Render.timestampUpdate = performance.now();\n Render.nodesSimple.reset();\n Render.nodesAlpha.reset();\n Render.nodesPhysics.reset();\n Render.dispatchEvent(new Event(\"renderPrepareStart\" /* RENDER_PREPARE_START */));\n }\n if (!_branch.isActive)\n return; // don't add branch to render list if not active\n _branch.nNodesInBranch = 1;\n _branch.radius = 0;\n _branch.dispatchEventToTargetOnly(new Event(\"renderPrepare\" /* RENDER_PREPARE */));\n _branch.timestampUpdate = Render.timestampUpdate;\n if (_branch.cmpTransform && _branch.cmpTransform.isActive)\n _branch.mtxWorld.set(FudgeCore.Matrix4x4.MULTIPLICATION(_mtxWorld, _branch.cmpTransform.mtxLocal));\n else\n _branch.mtxWorld.set(_mtxWorld); // overwrite readonly mtxWorld of the current node\n let cmpRigidbody = _branch.getComponent(FudgeCore.ComponentRigidbody);\n if (cmpRigidbody && cmpRigidbody.isActive) { //TODO: support de-/activation throughout\n Render.nodesPhysics.push(_branch); // add this node to physics list\n if (!_options?.ignorePhysics)\n this.transformByPhysics(_branch, cmpRigidbody);\n }\n let cmpLights = _branch.getComponents(FudgeCore.ComponentLight);\n for (let cmpLight of cmpLights) {\n if (!cmpLight.isActive)\n continue;\n let type = cmpLight.light.getType();\n let lightsOfType = _lights.get(type);\n if (!lightsOfType) {\n lightsOfType = [];\n _lights.set(type, lightsOfType);\n }\n lightsOfType.push(cmpLight);\n }\n let cmpMesh = _branch.getComponent(FudgeCore.ComponentMesh);\n let cmpMaterial = _branch.getComponent(FudgeCore.ComponentMaterial);\n if (cmpMesh && cmpMesh.isActive && cmpMaterial && cmpMaterial.isActive) {\n // TODO: careful when using particlesystem, pivot must not change node position\n cmpMesh.mtxWorld = FudgeCore.Matrix4x4.MULTIPLICATION(_branch.mtxWorld, cmpMesh.mtxPivot);\n let shader = cmpMaterial.material.getShader();\n if (_shadersUsed.indexOf(shader) < 0)\n _shadersUsed.push(shader);\n _branch.radius = cmpMesh.radius;\n if (cmpMaterial.sortForAlpha)\n Render.nodesAlpha.push(_branch); // add this node to render list\n else\n Render.nodesSimple.push(_branch); // add this node to render list\n }\n for (let child of _branch.getChildren()) {\n Render.prepare(child, _options, _branch.mtxWorld, _lights, _shadersUsed);\n _branch.nNodesInBranch += child.nNodesInBranch;\n let cmpMeshChild = child.getComponent(FudgeCore.ComponentMesh);\n let position = cmpMeshChild ? cmpMeshChild.mtxWorld.translation : child.mtxWorld.translation;\n _branch.radius = Math.max(_branch.radius, FudgeCore.Vector3.DIFFERENCE(position, _branch.mtxWorld.translation).magnitude + child.radius);\n }\n if (firstLevel) {\n Render.dispatchEvent(new Event(\"renderPrepareEnd\" /* RENDER_PREPARE_END */));\n for (let shader of _shadersUsed)\n Render.setLightsInShader(shader, _lights);\n }\n //Calculate Physics based on all previous calculations \n // Render.setupPhysicalTransform(_branch);\n }", "brand()\n {\n this.branded = true;\n }", "toggleStage() {\n if (this.state.stage === 'DND') {\n this.setState({ stage: 'URL' });\n } else {\n this.setState({ stage: 'DND' });\n }\n }", "function step () {\n branches.forEach(b => b.update())\n}", "moveStageTo(processStage) {\n // Component.__dirtyOfArrayOfProcessStages.set(this.__currentProcessStage, false);\n // Component.__dirtyOfArrayOfProcessStages.set(processStage, true);\n this.__currentProcessStage = processStage;\n }", "function nextBR(node, dir) {\n var link = dir + \"Sibling\", search = node[link];\n while (search && !isBR(search)) {\n search = search[link];\n }\n return search;\n }", "function beta_install(pr) {\n var prs = [pr];\n var jqxhr = $.post(\"/ia/send_to_beta\", {\n data : JSON.stringify(prs)\n })\n .done(function (data) {\n if (!ia_data.staged) {\n ia_data.staged = {};\n }\n \n ia_data.staged.beta = 1;\n });\n }", "function addBone(bone) {\n switch (state_comp) {\n case 0:\n if (bone.type == \"frame\") {\n document.getElementById(\"d_framename\").innerHTML = bone.name;//Shut up I know, this is an exception!\n //On second tought, these could've been arranged in two arrays...\n if (bone.skullslots) skullslots = bone.skullslots;\n if (bone.limbslots) limbslots = bone.limbslots;\n if (bone.tailslots) tailslots = bone.tailslots;\n if (bone.tstyle) tstyle = bone.tstyle;\n if (bone.bskulls) skulls = bone.bskulls;\n if (bone.barms) arms = bone.barms;\n if (bone.blegs) legs = bone.blegs;\n if (bone.bwings) wings = bone.bwings;\n if (bone.bfins) fins = bone.bfins;\n if (bone.btentacles) tentacles = bone.btentacles;\n if (bone.btails) tails = bone.btails;\n if (bone.amalgamy) amalgamy = bone.amalgamy;\n if (bone.amalgamy_dif) amalgamy_dif = bone.amalgamy_dif;\n if (bone.antiquity) antiquity = bone.antiquity;\n if (bone.antiquity_dif) antiquity_dif = bone.antiquity_dif;\n if (bone.menace) menace = bone.menace;\n if (bone.menace_dif) menace_dif = bone.menace_dif;\n if (bone.supportcc) supportcc = bone.supportcc;\n if (bone.supportcc_dif) supportcc_dif = bone.supportcc_dif;\n if (bone.implausibility) implausibility = bone.implausibility;\n if (bone.implausibility_dif) implausibility_dif = bone.implausibility_dif;\n pvalue += bone.pvalue;\n addLine(bone);\n state_comp = 1;\n }\n break;\n case 1:\n var changed = false;\n if (skullslots > 0 && bone.type == \"skull\") {\n skulls++;\n skullslots--;\n changed = true;\n }\n if (limbslots > 0 && (bone.type == \"arm\" || bone.type == \"leg\" || bone.type == \"wing\" || bone.type == \"fin\" || bone.type == \"tentacle\")) {\n switch (bone.type) {\n case \"arm\":\n arms++;\n break;\n case \"leg\":\n legs++;\n break;\n case \"wing\":\n wings++;\n break;\n case \"fin\":\n fins++;\n break;\n case \"tentacle\":\n tentacles++;\n break;\n }\n limbslots--;\n changed = true;\n }\n if (tailslots > 0 && bone.type == \"tail\") {\n tails++;\n tailslots--;\n changed = true;\n }\n if (changed) {\n if (bone.amalgamy) amalgamy += bone.amalgamy;\n if (bone.amalgamy_dif) amalgamy_dif += bone.amalgamy_dif;\n if (bone.antiquity) antiquity += bone.antiquity;\n if (bone.antiquity_dif) antiquity_dif += bone.antiquity_dif;\n if (bone.menace) menace += bone.menace;\n if (bone.menace_dif) menace_dif += bone.menace_dif;\n if (bone.supportcc) supportcc += bone.supportcc;\n if (bone.supportcc_dif) supportcc_dif += bone.supportcc_dif;\n if (bone.implausibility) implausibility += bone.implausibility;\n if (bone.implausibility_dif) implausibility_dif += bone.implausibility_dif;\n pvalue += bone.pvalue;\n addLine(bone);\n }\n break;\n case 2:\n break;\n }\n\n updateDisplay();\n}", "function TNodes_doCopyBranchToJson(source){\n \n var mysplit={};\n var splitnodecollection=new Array();\n var nodeAttr=new TComAttr();\n var boxnodeAttr=new TComAttr();\n var tmpnds=new TNodes('tempNodes',source.Owner,source.Owner.Ident);\n var e=0;\n var maxlevel=-1;\n var list=[]; // array for json-bifork-objects\n var myitemlist={}; // subelementlist container or sticker\n var myitemnds={}; // Nodes in subelement\n var partlist={}; // return-receiver for recursive callings \n var curindex=0;\n var mybuildorder='noinfo';\n\n switch (source.Type){\n case 'node':\n var mysourcends=source.Owner;\n var myzeronode=null;\n var zeronodeflag=false; \n break;\n \n case 'nodes':\n var myzeronode=new TNode();\n myzeronode.doAssign(source.Item[0]);\n var mysourcends=source;\n source=mysourcends.Item[0];\n var zeronodeflag=true; \n break;\n\n case 'container':\n var mysourcends=source.Nodes;\n source=mysourcends.Item[0];\n tmpnds.Item[0]=source; \n break;\n /* STICKER_mp\n case 'sticker':\n var mysourcends=source.Nodes;\n \n break;*/\n default:\n return null;\n } \n \n /* ====================================\n * Node with childs == bifork-structure\n * ==================================== \n */ \n \n if (source.HasChild==true){\n \n mybuildorder='child';\n \n // set the startlevel\n var minlevel=source.Child.Level;\n\n // get all objects with ident from this branch\n // load it into the tmpnds\n for (var i=source.Child.AbsoluteIndex;i<=mysourcends.Count;i++){\n \n mysplit=mysourcends.Item[i];\n if (i>source.Child.AbsoluteIndex && mysplit.Level<=source.Child.Level){\n break;\n }\n tmpnds.Item[i] = new TSplit();\n tmpnds.Item[i].doAssign(mysplit);\n tmpnds.Item[i].ParentIndex=mysplit.Parent.Parent.AbsoluteIndex;\n if (mysplit.Level>maxlevel){\n maxlevel=mysplit.Level;\n }\n \n // show copy-result\n doPrint('copy to node -> ' + i + ' type:' + mysplit.Type);\n doPrint('copy-target -> ' + i + ' type:' + tmpnds.Item[i].Type);\n \n // + ' ident: ' + myobjectlist[e].Ident + ' ->' , myobjectlist[e]);\n \n }\n \n // initialize the two-dimensional horizontal array\n var levellist = new Array(maxlevel-minlevel+1);\n for (var L=minlevel;L<=maxlevel;L++){\n levellist[L] = new Array();\n }\n \n // sort the elements of tmpnds in levellist[level, absoluteindex]\n for (var S in tmpnds.Item){\n mysplit=tmpnds.Item[S];\n levellist[mysplit.Level][S]=tmpnds.Item[S];\n }\n\n if (zeronodeflag){\n curindex=list.length;\n list[list.length]=myzeronode.doDBTreeDataobject();\n list[curindex].buildorder='zeronode'; \n }\n \n for (L=minlevel;L<=maxlevel;L++){ \n for (S in levellist[L]){\n \n mysplit=levellist[L][S];\n \n curindex=list.length;\n list[curindex]=mysplit.UpNode.doDBTreeDataobject();\n list[curindex].buildorder=mybuildorder; //'U'+mysplit.AbsoluteIndex;\n curindex=list.length;\n list[curindex]=mysplit.DownNode.doDBTreeDataobject();\n list[curindex].buildorder=mybuildorder; //'D'+mysplit.AbsoluteIndex;\n\n // scanning the sub-elements\n\n // the two nodes in a mini-array for dry-code\n // UpNode\n splitnodecollection[1]=mysplit.UpNode;\n // DownNode\n splitnodecollection[2]=mysplit.DownNode;\n \n // container and splits \n // seq. up- and downnode => 1, then 2\n for (var i=1;i<=2;i++){\n // t iterats 1 and 2 for container und splits to keep the code dry \n for (var t=1;t<=2;t++){ \n \n switch (t){\n case 1: myitemlist=splitnodecollection[i].ContainerList;\n break;\n case 2: myitemlist=splitnodecollection[i].StickerList;\n break;\n }\n \n for (var j=1;j<=myitemlist.Count;j++){\n curindex=list.length;\n list[curindex]=myitemlist.Item[j].doDBTreeDataobject();\n list[curindex].buildorder=mybuildorder;\n \n myitemnds=myitemlist.Item[j].Nodes;\n \n // scanning for bifork in container\n if (myitemnds.Item !=undefined){\n\n // recursive calling over object TNodes -> incl. zeronode\n partlist = myitemnds.doCopyBranchToJson(myitemlist.Item[j].Nodes); \n\n for (e in partlist) { \n if (e==1){ \n // insert a control-command between the data\n // at zeronode-position in container-elementlist\n list[list.length]={\n 'datatype': 'command',\n 'todo': 'stackup'\n }\n }\n curindex=list.length;\n list[curindex]=partlist[e];\n list[curindex].buildorder=mybuildorder;\n }\n // mark last element\n curindex=list.length-1;\n list[curindex].buildorder='lastelement';\n \n // insert a control-command between the data\n list[list.length]={\n 'datatype': 'command',\n 'todo': 'stackdown'\n }\n \n }//if != undefined\n }// for itemlist\n\n }// for t container and sticker\n }// for i, up und down\n }//for levellist\n }// for levellist\n\n // list of objects to console\n for (var e in list){\n doPrint('copy to json -> [' + e + ']' \n + ' ident: ' + list[e].ident \n + ' type: ' + list[e].datatype\n + ' buildorder: ' + list[e].buildorder\n + ' ->' , list[e]);\n }\n\n delete levellist;\n\n }// end node-child\n\n\n /* ======================================\n * Zeronode without children in container\n * ====================================== \n */ \n\n if (source.HasChild==false && source.ZeroNodeType=='container'){\n mybuildorder='nochild';\n curindex=list.length;\n list[curindex]=source.doDBTreeDataobject();\n list[curindex].buildorder=mybuildorder;\n \n // list of objects to console\n for (var e in list){\n doPrint('copy to json -> [' + e + ']' \n + ' ident: ' + list[e].ident \n + ' type: ' + list[e].datatype \n + ' ->' , list[e]);\n }\n \n }\n\n /* ======================================\n * Zeronode without children in sticker\n * ====================================== \n */ \n/* STICKER_mp\n if (source.HasChild==false && source.ZeroNodeType=='sticker'){\n mybuildorder='nochild';\n curindex=list.length;\n list[curindex]=source.doDBTreeDataobject();\n list[curindex].buildorder=mybuildorder;\n \n // list of objects to console\n for (var e in list){\n doPrint('copy to json -> [' + e + ']' \n + ' ident: ' + list[e].ident \n + ' type: ' + list[e].datatype \n + ' ->' , list[e]);\n }\n \n }*/\n\n /* ====================================\n * Node with containerlist\n * ==================================== \n */ \n\n if (source.ContainerList.Count>0){\n mybuildorder='container';\n myitemlist=source.ContainerList;\n\n for (var j=1;j<=myitemlist.Count;j++){\n\n curindex=list.length;\n list[curindex]=myitemlist.Item[j].doDBTreeDataobject();\n list[curindex].buildorder=mybuildorder;\n /* STICKER_mpif (myitemlist.Owner.ZeroNodeType=='sticker'){\n list[curindex].buildorder='sticker'; \n }*/\n \n myitemnds=myitemlist.Item[j].Nodes;\n \n // scanning for bifork in container\n if (myitemnds.Item !=undefined){\n\n // recursive calling over object TNodes -> incl. zeronode\n partlist = myitemnds.doCopyBranchToJson(myitemlist.Item[j].Nodes); \n\n for (e in partlist) { \n if (e==1){ \n // insert a control-command between the data\n // at zeronode-position in container-elementlist\n list[list.length]={\n 'datatype': 'command',\n 'todo': 'stackup'\n }\n }\n \n list[list.length]=partlist[e];\n }\n\n // insert a control-command between the data\n list[list.length]={\n 'datatype': 'command',\n 'todo': 'stackdown'\n }\n }//----\n \n }\n\n // list of objects to console\n for (var e in list){\n doPrint('copy to json -> [' + e + ']' \n + ' ident: ' + list[e].ident \n + ' type: ' + list[e].datatype \n + ' ->' , list[e]);\n }\n\n\n }// end node-container\n\n\n /* ====================================\n * Node with stickerlist\n * ==================================== \n */ \n/* STICKER_mp\n if (source.StickerList.Count>0){\n mybuildorder='sticker';\n myitemlist=source.StickerList;\n\n for (var j=1;j<=myitemlist.Count;j++){\n\n curindex=list.length;\n list[curindex]=myitemlist.Item[j].doDBTreeDataobject();\n list[curindex].buildorder=mybuildorder;\n \n myitemnds=myitemlist.Item[j].Nodes;\n \n // scanning for bifork in container\n if (myitemnds.Item !=undefined){\n\n // recursive calling over object TNodes -> incl. zeronode\n partlist = myitemnds.doCopyBranchToJson(myitemlist.Item[j].Nodes); \n\n for (e in partlist) { \n if (e==1){ \n // insert a control-command between the data\n // at zeronode-position in container-elementlist\n list[list.length]={\n 'datatype': 'command',\n 'todo': 'stackup'\n }\n }\n \n list[list.length]=partlist[e];\n }\n\n // insert a control-command between the data\n list[list.length]={\n 'datatype': 'command',\n 'todo': 'stackdown'\n }\n }//----\n \n }\n\n // list of objects to console\n for (var e in list){\n doPrint('copy to json -> [' + e + ']' \n + ' ident: ' + list[e].ident \n + ' type: ' + list[e].datatype \n + ' ->' , list[e]);\n }\n\n\n }// end node-sticker */\n\n delete tmpnds;\n \n return list;\n\n }", "async function prep_staging(branch) {\n await deleteChannel(branch);\n\n let url = await generateBranchDeployUrl(branch);\n\n await setEnv(url);\n\n console.log(`Staging url: ${url}`);\n}", "attachStage(stage) {\n\t\tthis.stage = stage;\n\t}", "function Step() {\n let mergerer = new PrMerger();\n return mergerer.execute();\n}", "function brToSoftBreakAtom(node, builder, {addMarkerable, nodeFinished}) {\n if (node.nodeType !== 1 || node.tagName !== 'BR') {\n return;\n }\n\n let softReturn = builder.createAtom('soft-return');\n addMarkerable(softReturn);\n\n nodeFinished();\n }", "addStage(stage, options = {}) {\n const ret = stage_deployment_1.StageDeployment.fromStage(stage, options);\n this.stages.push(ret);\n return ret;\n }", "function addResortDroppable(nodeID) {\n // ignore levels with only one branch\n if ($('.tree-branch' + nodeID).length <= 1) return;\n // add reordering droppable targets\n $('div.tree-dz' + nodeID).droppable({\n accept: '.tree-branch' + nodeID,\n activeClass: 'dropzone-ready',\n hoverClass: 'dropzone-active',\n drop(e, ui) {\n const node = ui.draggable;\n $(node).insertAfter(this);\n const dzNode = $(node).attr('id').substring(9);\n $('#tree-dz' + dzNode).insertAfter($(node));\n rescanDisplayOrder($(this).attr('tree-parent'));\n },\n });\n}", "function addBulb() {\n physical.bulb = {};\n\n const type = qlcPlusPhysical.Bulb[0].$.Type;\n if (![``, `Other`, getOflFixturePhysicalProperty(`bulb`, `type`)].includes(type)) {\n physical.bulb.type = type;\n }\n\n const colorTemperature = Number.parseFloat(qlcPlusPhysical.Bulb[0].$.ColourTemperature);\n if (colorTemperature && getOflFixturePhysicalProperty(`bulb`, `colorTemperature`) !== colorTemperature) {\n physical.bulb.colorTemperature = colorTemperature;\n }\n\n const lumens = Number.parseFloat(qlcPlusPhysical.Bulb[0].$.Lumens);\n if (lumens && getOflFixturePhysicalProperty(`bulb`, `lumens`) !== lumens) {\n physical.bulb.lumens = lumens;\n }\n }", "function BRDA (lineNumber, blockNumber, branchNumber, hits) {\n\tthis.lineNumber = lineNumber\n\tthis.blockNumber = blockNumber\n\tthis.branchNumber = branchNumber\n\tthis.hits = hits\n}", "function nextStage() {\r\n level++;\r\n }", "setBurned(stage){\n if(this.burned == null){\n console.log(\"here\");\n }\n for(let i = stage; i < this.burned.length; i++){\n this.burned[i] = true; //set all future stages to true\n }\n }", "function bfs (dsn) {\n /**\n * Helper function to get successors of the current node;\n * @param n Node.\n */\n var getSuccs = function (n) {\n /* Add successor nodes to queue. */\n n.succs.values().forEach(function (s) {\n if (s instanceof window.provvisDecl.Node &&\n window.nset.indexOf(s.parent.parent) === -1) {\n window.nset.push(s.parent.parent);\n window.nqueue.push(s.parent.parent);\n } else if (window.nset.indexOf(s) === -1) {\n window.nset.push(s);\n window.nqueue.push(s);\n }\n });\n };\n\n var nqueue = [];\n var nset = [];\n\n nset.push(dsn);\n nqueue.push(dsn);\n\n while (nqueue.length > 0) {\n getSuccs(nqueue.shift());\n }\n }", "[\"ASSIGN_STAFF_TO_DEPARTMENT\"](state) {\n state.showLoader = true;\n }", "processStages(issue) {\n console.log();\n console.log(`Processing stages for ${issue.html_url}`);\n // card events should be in order chronologically\n let currentStage;\n let currentColumn;\n let doneTime;\n let addedTime;\n const tempLabels = {};\n if (issue.events) {\n for (const event of issue.events) {\n let eventDateTime;\n if (event.created_at) {\n eventDateTime = event.created_at;\n }\n //\n // Process Project Stages\n //\n let toStage;\n let toLevel;\n let fromStage;\n let fromLevel = 0;\n if (event.project_card && event.project_card.column_name) {\n if (!addedTime) {\n addedTime = eventDateTime;\n }\n if (issue.project_stage !== 'None' && !event.project_card.stage_name) {\n throw new Error(`stage_name should have been set already for ${event.project_card.column_name}`);\n }\n toStage = event.project_card.stage_name;\n toLevel = stageLevel[toStage];\n currentStage = toStage;\n currentColumn = event.project_card.column_name;\n }\n if (issue.project_stage !== 'None' && event.project_card && event.project_card.previous_column_name) {\n if (!event.project_card.previous_stage_name) {\n throw new Error(`previous_stage_name should have been set already for ${event.project_card.previous_column_name}`);\n }\n fromStage = event.project_card.previous_stage_name;\n fromLevel = stageLevel[fromStage];\n }\n // last occurence of moving to a stage from a lesser stage\n // example: if an item is not blocked but put on hold for 6 months,\n // then the in-progress date will be when it went back in progress\n // moving forward\n if (fromLevel < toLevel) {\n issue[this.stageAtNames[toLevel]] = eventDateTime;\n }\n //moving back, clear the stage at dates up to fromLevel\n else if (fromLevel > toLevel) {\n for (let i = toLevel + 1; i <= fromLevel; i++) {\n delete issue[this.stageAtNames[i]];\n }\n }\n }\n if (addedTime) {\n issue.project_added_at = addedTime;\n console.log(`project_added_at: ${issue.project_added_at}`);\n }\n // current board processing does by column so we already know these\n // asof replays events and it's possible to have the same time and therefore can be out of order.\n // only take that fragility during narrow asof cases.\n // asof clears these\n if (!issue.project_column) {\n issue.project_column = currentColumn;\n }\n if (!issue.project_stage) {\n issue.project_stage = currentStage;\n }\n console.log(`project_stage: ${issue.project_stage}`);\n console.log(`project_column: ${issue.project_column}`);\n }\n }", "function goToStage(_stageName) {\n var nextStage = engine.stages[_stageName];\n if(nextStage) {\n nextStages.push(nextStage);\n }\n }", "spill(logspill=true) {\n if (!this.stage) {\n console.error('@ BagExpr.spill: Bag is not attached to a Stage.');\n return;\n } else if (this.parent) {\n console.error('@ BagExpr.spill: Cannot spill a bag while it\\'s inside of another expression.');\n return;\n } else if (this.toolbox) {\n console.warn('@ BagExpr.spill: Cannot spill bag while it\\'s inside the toolbox.');\n return;\n }\n\n let stage = this.stage;\n let items = this.items;\n let pos = this.pos;\n\n // GAME DESIGN CHOICE:\n // Remove the bag from the stage.\n // stage.remove(this);\n\n let before_str = stage.toString();\n let bag_before_str = this.toString();\n stage.saveState();\n Logger.log('state-save', stage.toString());\n\n // Add back all of this bags' items to the stage.\n items.forEach((item, index) => {\n item = item.clone();\n let theta = index / items.length * Math.PI * 2;\n let rad = this.size.w * 1.5;\n let targetPos = addPos(pos, { x:rad*Math.cos(theta), y:rad*Math.sin(theta) } );\n\n targetPos = clipToRect(targetPos, item.absoluteSize, { x:25, y:0 },\n {w:GLOBAL_DEFAULT_SCREENSIZE.width-25,\n h:GLOBAL_DEFAULT_SCREENSIZE.height - stage.toolbox.size.h});\n\n item.pos = pos;\n Animate.tween(item, { 'pos':targetPos }, 100, (elapsed) => Math.pow(elapsed, 0.5));\n //item.pos = addPos(pos, { x:rad*Math.cos(theta), y:rad*Math.sin(theta) });\n item.parent = null;\n this.graphicNode.removeItem(item);\n item.scale = { x:1, y:1 };\n stage.add(item);\n });\n\n // Set the items in the bag back to nothing.\n this.items = [];\n this.graphicNode.removeAllItems(); // just to be sure!\n console.warn(this.graphicNode);\n\n // Log changes\n if (logspill)\n Logger.log('bag-spill', {'before':before_str, 'after':stage.toString(), 'item':bag_before_str});\n\n // Play spill sfx\n Resource.play('bag-spill');\n }", "function SetBTRForm(objBtr) {\n\t\t$('#txtBTR_Guid').val(objBtr.btr_guid);\n\t\t$('#txtBTR_ApprovedDate').val(objBtr.approved_date);\n\t\t$('#txtBTR_ApprovalStatus').val(objBtr.approval_status);\n\t\t$(\"#lblRequester\").html(objBtr.requestor_uni_code);\n\t\t$(\"#txtBTR_Requestor\").val(objBtr.requestor_uni_code);\n\t\t$('#budgetType').val(objBtr.budget_type);\n\t\t$('#txtBTR_title').val(objBtr.title);\n\t\t$(\"#divStatus\"+ objBtr.life_cycle).css('background-color','red').css('color','white');\n\t\t$('#txtexplanation').val(objBtr.explanation);\t\n\t\t\n\t\t$('#txtBTR_life_cycle').val(objBtr.life_cycle); //Put the request into the default starting state Draft\n\t\t$('#txtBTR_transfer_type').val(objBtr.transfer_type); //Put the request into the default starting state Draft\n\t}", "function applyBrushStroke(bs){\n\n if(bs.path.length < 2)\n return;\n \n console.log(\"Setting shape to \" + bs.shape);\n // do we need to wait?\n \n servedbi.src = null;\n servedbi.src = bs.shape;\n //servedbi.onload = function(){\n console.log(\"Buffering served brush\");\n bufferBrush(bs);\n\n bs.path = bs.path.reverse();\n\n console.log(\"Drawing segments\");\n var v0 = bs.path.pop();\n while(bs.path.length > 0){\n var v = bs.path.pop();\n drawSegment(servedbc, v0, v, null);\n v0 = v;\n }\n console.log(\"Done\");\n //};\n //console.log(\"Setting src\");\n //servedbi.src = bs.shape;\n }", "if (!m_bdfInitialized.bdf_bValue) {\n\t\t\t// initialize now\n\t\t\tCLightSource lsNew;\n\t\t\tSetupLightSource(lsNew);\n\t\t\tm_lsLightSource.SetLightSourceWithNoDiscarding(lsNew);\n\t\t\tm_bdfInitialized.bdf_bValue = TRUE;\n\t\t}", "function TNodes_doCopyBranchToNode(source,target,action){\n alert('not full implemented, use CopyBranchToJson and PasteBranchFromJson instead !');\n action=action||'append';\n var mysplit={};\n var nodeAttr=new TComAttr();\n var boxnodeAttr=new TComAttr();\n var cAttr=new TComContainerAttr();\n \n // !!! to build ==> check target, if source fits !!!!!!!!!!!!!!!!!!!!!!!!!!\n \n \n if (source.HasChild==true && target.HasChild==false){ \n \n /* ================================================\n * copying the branchpart from sourcenode to tmpnds\n * ================================================\n */ \n \n var mysourcends=source.Owner;\n var tmpnds=new TNodes('tempNodes',target.Owner,target.Owner.Ident);\n var maxlevel=-1;\n\n\n // set the startlevel\n var minlevel=source.Child.Level;\n\n // get all objects with ident from this branch\n // load it into the tmpnds\n for (var i=source.Child.AbsoluteIndex;i<=mysourcends.Count;i++){\n \n mysplit=mysourcends.Item[i];\n if (i>source.Child.AbsoluteIndex && mysplit.Level<=source.Child.Level){\n break;\n }\n tmpnds.Item[i] = new TSplit();\n tmpnds.Item[i].doAssign(mysplit);\n tmpnds.Item[i].ParentIndex=mysplit.Parent.Parent.AbsoluteIndex;\n if (mysplit.Level>maxlevel){\n maxlevel=mysplit.Level;\n }\n \n // show copy-result\n doPrint('copy to node -> ' + i + ' type:' + mysplit.Type);\n doPrint('copy-target -> ' + i + ' type:' + tmpnds.Item[i].Type);\n \n // + ' ident: ' + myobjectlist[e].Ident + ' ->' , myobjectlist[e]);\n \n }\n \n /* =======================================================\n * wide sort of mpnds into levellist[level, absoluteindex]\n * =======================================================\n */\n\n // initialize the two-dimensional horizontal array\n var levellist = new Array(maxlevel-minlevel+1);\n for (var L=minlevel;L<=maxlevel;L++){\n levellist[L] = new Array();\n }\n \n // wide-sort of the elements of tmpnds by level and index\n // in levellist[level, absoluteindex]\n for (var S in tmpnds.Item){\n mysplit=tmpnds.Item[S];\n levellist[mysplit.Level][S]=tmpnds.Item[S];\n }\n\n delete tmpnds;\n\n /* ====================================================\n * starts the pasting-process into node from here\n * ====================================================\n */\n\n var firstsplitflag=true;\n var mytargetnode=target;\n var mytargetnds=target.Owner;\n var mytargetparentid=target.Parent.Ident;\n var builditems=new Array();\n \n nodeAttr.action=action;\n\n var myorientation='';\n \n var updata ={}; // UpNode of split, name is identical to doPastBranchFromJson \n var downdata={}; // DownNode\n \n var zeronodeflag=false;\n var firstsplitflag=true;\n \n // holds the differences (heigth and width) between source to target \n var dh=0;\n var dw=0;\n\n \n //var builditems=new Array(); // stores the added, new splits with the source-indexes \n var splitindex=0; // keeps track to the buildorder of data.index (AbsoluteIndex of the original structure)\n // is S in CopyBranchToNode()\n var parentsplitindex=0; // means the split-linking in terms of parent and child (skiping the link over node)\n var parentspin=0;\n \n //nodeAttr.action=action;\n firstsplitflag=true;\n \n // sequential process \n\n for (L=minlevel;L<=maxlevel;L++){ \n for (S in levellist[L]){\n \n mysplit=levellist[L][S];\n \n // distinguish the different element-types\n \n //if (data.datatype=='node'){\n \n updata=mysplit.UpNode;\n downdata=mysplit.DownNode;\n\n \n if (zeronodeflag==false){\n \n // set the splitorientation\n switch(updata.Align){\n case 'left': myorientation='v';\n break;\n case 'top': myorientation='h';\n break;\n default: myorientation='n';\n }\n \n myorientation=mysplit.Orientation;\n //splitindex=updata.Parent.AbsoluteIndex;\n splitindex=mysplit.AbsoluteIndex;\n //parentsplitindex=updata.Parent.Parent.Parent.AbsoluteIndex; // parent means in terms of s\n parentsplitindex=mysplit.Parent.Parent.AbsoluteIndex; // parent means in terms of s\n parentspin=mysplit.Parent.Spin; \n \n // for the first split target-parameter)\n // firstsplitflag \n \n if (firstsplitflag){\n \n var mytargetnode=target; // defines the target for the first split\n var mytargetnds=target.Owner;\n var mytargetparentid=target.Parent.Ident;\n\n }else{ // targets for the next splits are in builditems \n\n if (parentspin==1){\n mytargetnode=builditems[parentsplitindex].UpNode;\n mytargetparentid=mytargetnode.Ident; \n }else{\n mytargetnode=builditems[parentsplitindex].DownNode;\n mytargetparentid=mytargetnode.Ident;\n }\n }\n \n // get the differences (heigth and width) between source to target \n if (updata.Align=='left'){\n dh=mytargetnode.Height-updata.Height;\n dw=mytargetnode.Width-(updata.Width+downdata.Width);\n \n } else if (updata.Align=='top'){\n dh=mytargetnode.Height-(updata.Height+downdata.Height);\n dw=mytargetnode.Width-updata.Width; \n } else {\n dh=mytargetnode.Height-updata.Height;\n dw=mytargetnode.Width-updata.Width; \n }\n\n\n if (action=='append' || action=='insert'){\n nodeAttr.uid='';\n nodeAttr.did='';\n\n }else{\n nodeAttr.uid=updata.Ident;\n nodeAttr.did=downdata.Ident;\n \n } \n \n // append -> build split like clicking splitbuttons\n // insert -> take the heights and widths form source \n switch (action){\n case 'append':\n nodeAttr.uh=updata.Height;\n nodeAttr.uw=updata.Width;\n nodeAttr.dh=downdata.Height;\n nodeAttr.dw=downdata.Width;\n break;\n case 'insert':\n switch(updata.Align){\n case 'left':\n nodeAttr.uh=updata.Height+dh; //nodeAttr.uh=updata.height\n nodeAttr.uw=updata.Width;\n nodeAttr.dh=downdata.Height+dh; //nodeAttr.dh=downdata.height\n nodeAttr.dw=downdata.Width+dw; \n break;\n case 'top':\n //if (builditems[cursplitindex].Parent.Spin==1){\n nodeAttr.uh=updata.Height\n nodeAttr.uw=updata.Width+dw; //nodeAttr.uw=updata.width\n nodeAttr.dh=downdata.Height+dh;\n nodeAttr.dw=downdata.Width+dw; //nodeAttr.dw=downdata.width \n break;\n default:\n nodeAttr.uh=updata.Height;\n nodeAttr.uw=updata.Width;\n nodeAttr.dh=downdata.Height;\n nodeAttr.dw=downdata.Width; \n }\n break;\n default:\n nodeAttr.uh=updata.Height;\n nodeAttr.uw=updata.Width;\n nodeAttr.dh=downdata.Height;\n nodeAttr.dw=downdata.Width;\n }\n\n builditems[splitindex]={}; \n builditems[splitindex]=mytargetnds.doAdd(mytargetnode, myorientation, 'split made by id -> ' + mytargetparentid,nodeAttr); \n\n\n\n //partcount=0;\n firstsplitflag=false; \n\n }//zeronodeflag\n \n //}//node\n \n }//for\n\n }//for\n\n delete builditems;\n delete levellist;\n \n \n }// has child\n \n return true;\n \n}", "function bnpCopyTo(r) {\n\t for(var i = this.t-1; i >= 0; --i) r.data[i] = this.data[i];\n\t r.t = this.t;\n\t r.s = this.s;\n\t}", "function processBundle(b) {\n var bundle = _.clone(b);\n var totalLatches = 0;\n var latchCount = 0;\n if (bundle.lessIn && bundle.lessIn.length > 0) {\n totalLatches++;\n }\n\n if (bundle.sassIn && bundle.sassIn.length > 0) {\n totalLatches++;\n }\n\n if (bundle.cssIn && bundle.cssIn.length > 0) {\n totalLatches++;\n }\n\n var bundleState = {\n bundleFiles : [],\n acceptFile : function() {\n var self = this;\n return through.obj(function (file, enc, cb) {\n self.bundleFiles.push(file);\n cb(null, file);\n });\n },\n pipelineComplete : function () {\n latchCount++;\n if (latchCount >= totalLatches) {\n this.nextPipeline();\n }\n },\n nextPipeline: function(){\n var self = this;\n // need a virtual source\n var src = require('stream').Readable({objectMode: true});\n src.findex = 0;\n src._read = function (cb) {\n for (; this.findex < self.bundleFiles.length; this.findex++) {\n this.push(self.bundleFiles[this.findex]);\n }\n if(this.findex >= self.bundleFiles.length){\n // undocumented on https://nodejs.org/api/stream.html#stream_event_data\n // but \"null\" is the control signal that there is no more data in the stream...\n this.push(null);\n }\n };\n\n var postcss = require('gulp-postcss');\n var sourcemaps = require('gulp-sourcemaps');\n var autoprefixer = require('autoprefixer-core');\n\n src.pipe(concatCss(bundle.out + buildCssExt))\n .pipe(sourcemaps.init())\n .pipe(postcss([ autoprefixer({ browsers: ['last 2 version'] }) ]))\n .pipe(sourcemaps.write('.'))\n .pipe(rename(function (path) {\n path.basename = bundle.out;\n path.extname = buildCssExt;\n }))\n .pipe(gulp.dest(cssDest))\n .on('end', function () {\n bundleComplete();\n });\n }\n };\n\n if (bundle.lessIn && bundle.lessIn.length > 0) {\n gulp.src(bundle.lessIn)\n .pipe(less({\n paths: [path.join(__dirname, 'less', 'includes')]\n }))\n .pipe(bundleState.acceptFile())\n .on('finish', function () {\n bundleState.pipelineComplete();\n })\n }\n\n if (bundle.sassIn && bundle.sassIn.length > 0) {\n gulp.src(bundle.sassIn)\n .pipe(sass())\n .pipe(bundleState.acceptFile())\n .on('finish', function () {\n bundleState.pipelineComplete();\n })\n }\n\n if (bundle.cssIn && bundle.cssIn.length > 0) {\n gulp.src(bundle.cssIn)\n .pipe(bundleState.acceptFile())\n .on('finish', function () {\n bundleState.pipelineComplete();\n })\n }\n }", "function advanceStage(num , path) {\n var newNumber = num;\n var chosenPath = path;\n \n // Hides prior stages\n $('.visible').removeClass('visible');\n $('body').css('background-image','none');\n preLoad(newNumber , chosenPath);\n serverPreLoad(newNumber , chosenPath);\n serverInfoPreLoad(newNumber , chosenPath);\n loadPartner(newNumber);\n setBackground(newNumber , chosenPath);\n \n // Makes new stage visible\n $('.stage-' + newNumber).addClass('visible');\n}", "function addBlossom(e, A, r) {\n\tbcount++;\n\tlet u = g.left(e); let U = bid(u);\n\tlet v = g.right(e); let V = bid(v);\n\n\t// check for presence of priority-improving path\n\tlet x = U;\n\twhile (x != A) {\n\t\tx = g.mate(x,link[x]); // x now odd\n\t\tif (prio[x] < prio[r]) {\n\t\t\tif (trace)\n\t\t\t\ttraceString += `blossom: found ${g.x2s(r)}-${g.x2s(x)} path\\n`;\n\t\t\tlet ee = apath.reverse(path(v,r));\n\t\t\treturn apath.join(apath.join(ee,e),path(u,x));\n\t\t}\n\t\tx = bid(g.mate(x,link[x]));\n\t\tsteps++;\n\t}\n\n\tx = V;\n\twhile (x != A) {\n\t\tx = g.mate(x,link[x]); // x now odd\n\t\tif (prio[x] < prio[r]) {\n\t\t\tif (trace)\n\t\t\t\ttraceString += `blossom: found ${g.x2s(r)}-${g.x2s(x)} path\\n`;\n\t\t\tlet ee = apath.reverse(path(u,r));\n\t\t\treturn apath.join(apath.join(ee,e),path(v,x));\n\t\t}\n\t\tx = bid(g.mate(x,link[x]));\n\t\tsteps++;\n\t}\n\n\t// proceed to forming new blossom\n\tx = U; let s = '';\n\twhile (x != A) {\n\t\tif (trace) s = `${g.x2s(x)}${s ? ' ' : ''}` + s;\n\t\tbase[outer.merge(outer.find(x), outer.find(A))] = A;\n\t\tx = g.mate(x,link[x]); // x now odd\n\t\tif (trace) s = `${g.x2s(x)} ${s}`;\n\t\tbase[outer.merge(x, outer.find(A))] = A;\n\t\tbridge[x] = [e,u];\n\t\tadd2q(x);\n\t\tx = bid(g.mate(x,link[x]));\n\t\tsteps++;\n\t}\n\tif (trace) s = `${g.x2s(A)}${s ? ' ' : ''}` + s;\n\tx = V;\n\twhile (x != A) {\n\t\tif (trace) s += ` ${g.x2s(x)}`;\n\t\tbase[outer.merge(outer.find(x), outer.find(A))] = A;\n\t\tx = g.mate(x,link[x]); // x now odd\n\t\tif (trace) s += ` ${g.x2s(x)}`;\n\t\tbase[outer.merge(x,outer.find(A))] = A;\n\t\tbridge[x] = [e,v];\n\t\tadd2q(x);\n\t\tx = bid(g.mate(x,link[x]));\n\t\tsteps++;\n\t}\n\tif (trace)\n\t\ttraceString += `blossom: ${g.e2s(e)} ${g.x2s(A)} [${s}]\\n` +\n\t\t\t\t\t `\t${outer.toString()}\\n`;\n\treturn 0;\n}", "function loadNextStage() {\n if (firstStage) {\n // add a sneaky extra circle in the off chance they find all of the hidden circles :P\n // withheld data is also a bias after all\n createCircle(startColour);\n // so the grey fades in\n $('#circles-area').addClass('fade-bg-colour');\n $('#circles-area').removeClass(startColour);\n $('#circles-area').addClass('grey');\n $('#instruction-text').html(MISSED_CIRCLES_TEXT);\n firstStage = false;\n } else {\n createSlider();\n bgColourSlider[0].noUiSlider.on('update', updateSlider);\n $('#instruction-text').html(SLIDER_TEXT);\n $('.circle').removeClass('glow');\n $('#circles-area').removeClass('grey fade-bg-colour');\n $('#circles-area').addClass(startColour);\n $('#next-stage').addClass('d-none');\n $('#start-again').removeClass('d-none');\n $('#background-colour-slider-container').removeClass('d-none');\n }\n}", "function bnpCopyTo(r) {\n for(var i = this.t-1; i >= 0; --i) r.data[i] = this.data[i];\n r.t = this.t;\n r.s = this.s;\n}", "function bnpCopyTo(r) {\n for(var i = this.t-1; i >= 0; --i) r.data[i] = this.data[i];\n r.t = this.t;\n r.s = this.s;\n}", "function bnpCopyTo(r) {\n for(var i = this.t-1; i >= 0; --i) r.data[i] = this.data[i];\n r.t = this.t;\n r.s = this.s;\n}", "function bnpCopyTo(r) {\n for(var i = this.t-1; i >= 0; --i) r.data[i] = this.data[i];\n r.t = this.t;\n r.s = this.s;\n}", "function bnpCopyTo(r) {\n for(var i = this.t-1; i >= 0; --i) r.data[i] = this.data[i];\n r.t = this.t;\n r.s = this.s;\n}", "function bnpCopyTo(r) {\n for(var i = this.t-1; i >= 0; --i) r.data[i] = this.data[i];\n r.t = this.t;\n r.s = this.s;\n}", "function bnpCopyTo(r) {\n for(var i = this.t-1; i >= 0; --i) r.data[i] = this.data[i];\n r.t = this.t;\n r.s = this.s;\n}", "function bnpCopyTo(r) {\n for(var i = this.t-1; i >= 0; --i) r.data[i] = this.data[i];\n r.t = this.t;\n r.s = this.s;\n}", "function bnpCopyTo(r) {\n for(var i = this.t-1; i >= 0; --i) r.data[i] = this.data[i];\n r.t = this.t;\n r.s = this.s;\n}", "function TNodes_doPasteBranchFromJson(myjson,target,action){ \n // check to deny the action\n if (target.HasChild==true){\n return false; \n }\n\n action=action||'append';\n var data = {};\n var nodeAttr=new TComAttr();\n var boxnodeAttr=new TComAttr();\n var cAttr=new TComContainerAttr();\n /* STICKER_mp var sAttr= new TComStickerAttr(); */\n var myorientation='';\n \n var partcount=0;\n var updata ={};\n var downdata={};\n \n var zeronodeflag=false;\n var firstsplitflag=false;\n var startwithcontainerflag=false;\n \n var mytargetnode={}; // defines the current target for adding the split\n var mytargetnds={}; // obj for the TNodes of the current target, triggers the doADD()\n var mytargetparentid='';\n var builditems=new Array(); // stores the added, new splits with the source-indexes \n var splitindex=0; // keeps track to the buildorder of data.index (AbsoluteIndex of the original structure)\n // is S in CopyBranchToNode()\n var parentsplitindex=0; // means the split-linking in terms of parent and child (skiping the link over node)\n var parentspin=0;\n\n var lastzeronode={};\n\n var containernode={};\n var buildcontainer=new Array();\n var lastcontainer={};\n var lastcontainerindex=0;\n var lastcontainerhasnode=false;\n \n /* STICKER_mp var stickernode={}; \n var buildsticker=new Array();\n var laststicker={};\n var laststickerindex=0;\n var laststickerhasnode=false;\n\n\n // stacks\n var builditemsstack=new Array();\n var mytargetndsstack=new Array();\n \n \n // holds the differences (heigth and width) between source to target \n var dh=0;\n var dw=0;\n \n nodeAttr.action=action;\n \n var firstelement=myjson[0]; // get the element e=0\n\n mytargetnode=target; // defines the target for the first action\n mytargetnds=target.Owner;\n mytargetparentid=target.Parent.Ident;\n \n switch (firstelement.datatype){\n case 'node':\n firstsplitflag=true;\n break;\n case 'container':\n startwithcontainerflag=true;\n case 'command':\n break;\n default: \n }\n \n // sequential process the json-object\n for (var e in myjson){\n \n data=myjson[e];\n \n // distinguish the different element-types\n\n /* **************************************************************\n * control - not a real dataelement\n */\n if (data.datatype=='command'){\n switch (data.todo){\n case 'stackup':\n // nodes-stack one up (TNodes-bifork)\n mytargetndsstack.unshift(mytargetnds); \n \n if (lastzeronode.ZeroNodeType=='container'){\n mytargetnds=lastcontainer.Nodes;\n }\n /* STICKER_mp\n if (lastzeronode.ZeroNodeType=='sticker'){\n mytargetnds=laststicker.Nodes;\n }*/\n \n // builditemsstack one up\n builditemsstack.unshift(builditems);\n builditems=new Array();\n break;\n \n case 'stackdown':\n // nodes-stack one down (TNodes-bifork)\n mytargetnds=mytargetndsstack.shift();\n // builditemsstack one down\n builditems=builditemsstack.shift();\n break;\n }\n }\n \n /* ****************************************************\n * node\n */\n if (data.datatype=='node'){\n \n if (data.align=='fit'){\n zeronodeflag=true;\n }else{\n zeronodeflag=false;\n }\n \n // handle zeronode \n if (partcount==0 && zeronodeflag==true){\n myorientation='n';\n splitindex=0;updata.index;\n parentsplitindex=0;\n parentspin=0;\n \n if (action=='append' || action=='insert'){\n nodeAttr.uid='';\n }else{\n nodeAttr.uid=data.ident;\n } \n \n //mytargetnode=lastcontainer; // defines the target for the first split\n //mytargetparentid=target.Parent.Ident;\n \n if (lastcontainerhasnode){\n //mytargetnode.ContainerList.Item[lastcontainerindex].doAddZeroSplit(lastcontainer.Ident,nodeAttr);\n lastzeronode=lastcontainer.doAddZeroSplit(lastcontainer.Ident,nodeAttr);\n lastcontainerhasnode=false; \n }\n /* STICKER_mp\n if (laststickerhasnode){\n lastzeronode=laststicker.doAddZeroSplit(laststicker.Ident,nodeAttr); \n laststickerhasnode=false;\n }\n */\n }\n \n if (partcount==0 && zeronodeflag==false){\n updata=data;\n }\n \n if (zeronodeflag==false){\n partcount++;\n }\n \n // waits for down node\n if (partcount==2 && zeronodeflag==false){\n \n downdata=data;\n \n // set the splitorientation\n switch(updata.align){\n case 'left': myorientation='v';\n break;\n case 'top': myorientation='h';\n break;\n default: myorientation='n';\n }\n \n splitindex=updata.index;\n parentsplitindex=updata.parentindex; // parent means in terms of s\n parentspin=updata.parentspin; \n \n // for the first split target-parameter)\n // firstsplitflag \n \n /* if (firstsplitflag){\n \n mytargetnode=target; // defines the target for the first split\n mytargetnds=target.Owner;\n mytargetparentid=target.Parent.Ident;\n \n }else{ // targets for the next splits are in builditems \n */\n \n if (firstsplitflag==false){\n \n switch (parentspin){\n case 1: mytargetnode=builditems[parentsplitindex].UpNode;\n mytargetparentid=mytargetnode.Ident;\n break; \n case -1: mytargetnode=builditems[parentsplitindex].DownNode;\n mytargetparentid=mytargetnode.Ident;\n break;\n case 0: mytargetnode=lastcontainer.Nodes.Item[0];\n mytargetparentid=mytargetnode.Ident; \n break;\n default:\n }\n }\n \n // get the differences (heigth and width) between source to target \n if (updata.align=='left'){\n dh=mytargetnode.Height-updata.height;\n dw=mytargetnode.Width-(updata.width+downdata.width);\n \n } else if (updata.align=='top'){\n dh=mytargetnode.Height-(updata.height+downdata.height);\n dw=mytargetnode.Width-updata.width; \n } else {\n dh=mytargetnode.Height-updata.height;\n dw=mytargetnode.Width-updata.width; \n }\n \n \n if (action=='append' || action=='insert'){\n nodeAttr.uid='';\n nodeAttr.did='';\n \n }else{\n nodeAttr.uid=updata.ident;\n nodeAttr.did=downdata.ident;\n \n } \n \n // append -> build split like clicking splitbuttons\n // insert -> take the heights and widths form source \n switch (action){\n case 'append':\n nodeAttr.uh=updata.height;\n nodeAttr.uw=updata.width;\n nodeAttr.dh=downdata.height;\n nodeAttr.dw=downdata.width;\n break;\n case 'insert':\n switch(updata.align){\n case 'left':\n nodeAttr.uh=updata.height+dh; //nodeAttr.uh=updata.height\n nodeAttr.uw=updata.width;\n nodeAttr.dh=downdata.height+dh; //nodeAttr.dh=downdata.height\n nodeAttr.dw=downdata.width+dw; \n break;\n case 'top':\n //if (builditems[cursplitindex].Parent.Spin==1){\n nodeAttr.uh=updata.height\n nodeAttr.uw=updata.width+dw; //nodeAttr.uw=updata.width\n nodeAttr.dh=downdata.height+dh;\n nodeAttr.dw=downdata.width+dw; //nodeAttr.dw=downdata.width \n break;\n default:\n nodeAttr.uh=updata.height;\n nodeAttr.uw=updata.width;\n nodeAttr.dh=downdata.height;\n nodeAttr.dw=downdata.width; \n }\n break;\n case 'relink':\n switch(updata.align){\n case 'left':\n nodeAttr.uh=updata.height+dh; //nodeAttr.uh=updata.height\n nodeAttr.uw=updata.width;\n nodeAttr.dh=downdata.height+dh; //nodeAttr.dh=downdata.height\n nodeAttr.dw=downdata.width+dw; \n break;\n case 'top':\n //if (builditems[cursplitindex].Parent.Spin==1){\n nodeAttr.uh=updata.height\n nodeAttr.uw=updata.width+dw; //nodeAttr.uw=updata.width\n nodeAttr.dh=downdata.height+dh;\n nodeAttr.dw=downdata.width+dw; //nodeAttr.dw=downdata.width \n break;\n default:\n nodeAttr.uh=updata.height;\n nodeAttr.uw=updata.width;\n nodeAttr.dh=downdata.height;\n nodeAttr.dw=downdata.width; \n }\n break;\n default:\n nodeAttr.uh=updata.height;\n nodeAttr.uw=updata.width;\n nodeAttr.dh=downdata.height;\n nodeAttr.dw=downdata.width;\n }\n \n builditems[splitindex]={}; \n builditems[splitindex]=mytargetnds.doAdd(mytargetnode, myorientation, 'split made by id -> ' + mytargetparentid,nodeAttr); \n \n partcount=0;\n firstsplitflag=false; \n \n }//partcount\n \n // show current node-element\n doPrint('pasteobj->' + e + '|type:' + data.datatype \n + '|ident:' + data.ident\n + '|parentindex:' + data.parentindex\n + '|parentspin:' + data.parentspin);\n \n \n }//node\n \n /* ******************************\n * container\n */\n if (data.datatype=='container'){\n \n cAttr.action=action;\n \n if (action=='append' || action=='insert'){\n cAttr.id='';\n \n } else {\n cAttr.Ident=data.ident; \n }\n // SaVe\n cAttr.Height=data.height;\n cAttr.Width=data.width;\n cAttr.Given=data.given;\n cAttr.Kind=data.kind;\n cAttr.Attributes=data.styles;\n cAttr.HasRightScrollbar=data.rightscrollbar;\n cAttr.IsFitToParent=data.fit_height;\n cAttr.Wrap = data.wrap;\n cAttr.Label = data.label;\n cAttr.Html = data.html;\n cAttr.Nature = data.nature;\n cAttr.Options = data.options;\n cAttr.RelatedContainer = data.relatedcontainer;\n\n if (data.buildorder=='container'){\n \n mytargetnode=target; // defines the target for the first split\n mytargetnds=target.Owner;\n mytargetparentid=target.Parent.Ident;\n\n containernode=target;\n \n }\n \n \n else{ \n // targets for the next containers are in builditems \n switch (data.parentspin){\n case 1: containernode=builditems[splitindex].UpNode;\n break;\n case -1: containernode=builditems[splitindex].DownNode;\n break;\n default: containernode=builditems[splitindex].UpNode;\n }\n }\n \n //lastcontainer=containernode.doAddContainer(null,cAttr); \n lastcontainerindex=lastcontainer.AbsoluteIndex;\n \n // startobject is container in a node (no children)\n if (firstsplitflag){\n //mytargetnds=lastcontainer.Nodes;\n firstsplitflag=false; \n }\n \n if (data.nodescount!=undefined){\n lastcontainerhasnode=true;\n }else{\n lastcontainerhasnode=false;\n }\n \n // show current container-element\n doPrint('pasteobj->' + e + '|type:' + data.datatype \n + '|ident:' + data.ident\n + '|parentindex:' + data.parentindex\n + '|parentspin:' + data.parentspin);\n \n }// container\n \n \n }// end PasteBranchFromJson ", "function br() {\n d3.select(id).append(\"br\");\n }", "spill(logspill=true) {\n\n if (!this.stage) {\n console.error('@ BracketArrayExpr.spill: Array is not attached to a Stage.');\n return;\n } else if (this.parent) {\n console.error('@ BracketArrayExpr.spill: Cannot spill array while it\\'s inside of another expression.');\n return;\n } else if (this.toolbox) {\n console.warn('@ BracketArrayExpr.spill: Cannot spill array while it\\'s inside the toolbox.');\n return;\n }\n\n let stage = this.stage;\n let items = this.items;\n let pos = this.pos;\n\n // GAME DESIGN CHOICE:\n // Remove the bag from the stage.\n // stage.remove(this);\n\n let before_str = stage.toString();\n let bag_before_str = this.toString();\n stage.saveState();\n Logger.log('state-save', stage.toString());\n\n // Add back all of this bags' items to the stage.\n items.forEach((item, index) => {\n\n item = item.clone();\n let theta = index / items.length * Math.PI * 2;\n let rad = this.size.h * 2.0;\n let targetPos = addPos(pos, { x:rad*Math.cos(theta), y:rad*Math.sin(theta) } );\n\n targetPos = clipToRect(targetPos, item.absoluteSize, { x:25, y:0 },\n {w:GLOBAL_DEFAULT_SCREENSIZE.width-25,\n h:GLOBAL_DEFAULT_SCREENSIZE.height - stage.toolbox.size.h});\n\n item.pos = pos;\n Animate.tween(item, { 'pos':targetPos }, 100, (elapsed) => Math.pow(elapsed, 0.5));\n //item.pos = addPos(pos, { x:rad*Math.cos(theta), y:rad*Math.sin(theta) });\n item.parent = null;\n this.graphicNode.removeChild(item);\n item.scale = { x:1, y:1 };\n stage.add(item);\n });\n\n // Set the items in the bag back to nothing.\n this.items = [];\n this.graphicNode.holes = [this.l_brak, this.r_brak]; // just to be sure!\n this.graphicNode.update();\n\n // Log changes\n if (logspill)\n Logger.log('bag-spill', {'before':before_str, 'after':stage.toString(), 'item':bag_before_str});\n\n // Play spill sfx\n Resource.play('bag-spill');\n }", "function SDB(state) {\n var stack = state.stack;\n var n = stack.pop();\n\n if (exports.DEBUG) {\n console.log(state.step, 'SDB[]', n);\n }\n\n state.deltaBase = n;\n }", "function SDB(state) {\n var stack = state.stack;\n var n = stack.pop();\n\n if (DEBUG) console.log(state.step, 'SDB[]', n);\n\n state.deltaBase = n;\n}", "function intializeDevelopmentStages() {\n\n function createStages ( numberOfStages, laneId, translationIdPrefix ) {\n for (var phaseId = 1; phaseId <= numberOfStages; phaseId++) {\n createDevelopmentStage( laneId, phaseId,\n translationIdPrefix + phaseId + \".name\",\n translationIdPrefix + phaseId + \".description\")\n }\n }\n\n initializeLanes();\n\n var translationKeyPrefix = \"marketplace.devStage.stages\";\n var customerLanePrefix = translationKeyPrefix + \".customer.phase\";\n var communityLanePrefix = translationKeyPrefix + \".community.phase\";\n\n createStages( 4, customerLaneId, customerLanePrefix );\n createStages( 4, communityLaneId, communityLanePrefix );\n }", "applyIncrementalBending(stepDesc) {\n if (this.bendingIncrements === 0)\n return;\n\n let timeFactor = 1;\n if (stepDesc && stepDesc.dt)\n timeFactor = stepDesc.dt / (1000 / 60);\n\n const posDelta = this.bendingPositionDelta.clone().multiplyScalar(timeFactor);\n const velDelta = this.bendingVelocityDelta.clone().multiplyScalar(timeFactor);\n this.position.add(posDelta);\n this.velocity.add(velDelta);\n this.angularVelocity += (this.bendingAVDelta * timeFactor);\n this.angle += (this.bendingAngleDelta * timeFactor);\n\n this.bendingIncrements--;\n }", "function drc() {\n var comp = audioContext.createDynamicsCompressor();\n\n /* The supported method names are different on browsers with different\n * versions.*/\n audioContext.createGainNode = (audioContext.createGainNode ||\n audioContext.createGain);\n var boost = audioContext.createGainNode();\n comp.threshold.value = INIT_DRC_THRESHOLD;\n comp.knee.value = INIT_DRC_KNEE;\n comp.ratio.value = INIT_DRC_RATIO;\n comp.attack.value = INIT_DRC_ATTACK;\n comp.release.value = INIT_DRC_RELEASE;\n boost.gain.value = dBToLinear(INIT_DRC_BOOST);\n\n comp.connect(boost);\n\n function input(n) {\n return [pin(comp)];\n }\n\n function output(n) {\n return [pin(boost)];\n }\n\n function config(name, value) {\n var p = name[0];\n switch (p) {\n case 'threshold':\n case 'knee':\n case 'ratio':\n case 'attack':\n case 'release':\n comp[p].value = parseFloat(value);\n break;\n case 'boost':\n boost.gain.value = dBToLinear(parseFloat(value));\n break;\n case 'enable':\n break;\n default:\n console.log('invalid parameter: name =', name, 'value =', value);\n }\n }\n\n this.input = input;\n this.output = output;\n this.config = config;\n}", "drop(parentId, index, locationInLayout) {\n\n\n\n if (this.state.selectedBrick === undefined) {\n console.log('sb undefined');\n if (this.state.selectedBlock !== undefined) {\n this.moveBlock(parentId, index, locationInLayout);\n }\n this.setState({\n 'selectedBrick': undefined,\n 'selectedBlock': undefined\n });\n\n return;\n }\n\n console.log('CREATE ' + parentId + ' ' + index);\n\n this.increasePointsBy(1);\n\n let brick = this.state.selectedBrick;\n console.log(' Attempting to create <' + brick + '> in ' + parentId + ' ' + index);\n\n this.lockEditor();\n\n if (brick && parentId !== undefined && index !== undefined) {\n this.pickup(); // unselect the selected brick\n\n let snd = new Audio(dropSound);\n snd.play();\n\n this.createBlock(brick, parentId, index, false, true);\n }\n }", "applyIncrementalBending() { }", "applyIncrementalBending() { }", "function focusNext(branchElement) {\n branchElement = angular.element(branchElement);\n var next;\n var branchContainer = branchElement[0].querySelector('.md-branch-container');\n if (branchElement.hasClass('md-open') && branchContainer) {\n // find nearest child branch\n Array.prototype.slice.call(branchContainer.children).every(function (el) {\n if (el.nodeName === 'MD-BRANCH') { next = angular.element(el); }\n return !next;\n });\n\n // if no child branches are found try to get next branch\n if (!next) { next = branchElement.next(); }\n } else {\n next = branchElement.next();\n }\n\n // recursively find next branch\n if (!next || !next.length) { next = findNext(branchElement); }\n if (next && next.length) { next.focus(); }\n }", "function drawStage(stage){\n //draw stage (svg element)\n stage = d3.select(\".center-block\").append(\"svg\").attr(\"class\", \"svg-class\")\n \t.attr(\"width\", width + margin.left + margin.right)\n \t.attr(\"height\", height + margin.top + margin.bottom)\n \t.append(\"g\")\n \t.attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n return stage;\n}", "bind(scope, stage, options) {\n var _b, _c, _d, _e, _f;\n const inputs = new Array();\n inputs.push(...(_b = this.props.additionalArtifacts) !== null && _b !== void 0 ? _b : []);\n const envVarCommands = new Array();\n const bashOptions = (_c = this.props.bashOptions) !== null && _c !== void 0 ? _c : '-eu';\n if (bashOptions) {\n envVarCommands.push(`set ${bashOptions}`);\n }\n for (const [varName, output] of Object.entries((_d = this.props.useOutputs) !== null && _d !== void 0 ? _d : {})) {\n const outputArtifact = output.artifactFile;\n // Add the artifact to the list of inputs, if it's not in there already. Determine\n // the location where CodeBuild is going to stick it based on whether it's the first (primary)\n // input or an 'extra input', then parse.\n let artifactIndex = inputs.findIndex(a => a.artifactName === outputArtifact.artifact.artifactName);\n if (artifactIndex === -1) {\n artifactIndex = inputs.push(outputArtifact.artifact) - 1;\n }\n const dirEnv = artifactIndex === 0 ? 'CODEBUILD_SRC_DIR' : `CODEBUILD_SRC_DIR_${outputArtifact.artifact.artifactName}`;\n envVarCommands.push(`export ${varName}=\"$(node -pe 'require(process.env.${dirEnv} + \"/${outputArtifact.fileName}\")[\"${output.outputName}\"]')\"`);\n }\n this._project = new codebuild.PipelineProject(scope, 'Project', {\n environment: this.props.environment || { buildImage: codebuild.LinuxBuildImage.STANDARD_5_0 },\n vpc: this.props.vpc,\n securityGroups: this.props.securityGroups,\n subnetSelection: this.props.subnetSelection,\n buildSpec: codebuild.BuildSpec.fromObject({\n version: '0.2',\n phases: {\n build: {\n commands: [\n ...envVarCommands,\n ...this.props.commands,\n ],\n },\n },\n }),\n });\n for (const statement of (_e = this.props.rolePolicyStatements) !== null && _e !== void 0 ? _e : []) {\n this._project.addToRolePolicy(statement);\n }\n this._action = new codepipeline_actions.CodeBuildAction({\n actionName: this.props.actionName,\n input: inputs[0],\n extraInputs: inputs.slice(1),\n runOrder: (_f = this.props.runOrder) !== null && _f !== void 0 ? _f : 100,\n project: this._project,\n environmentVariables: this.props.environmentVariables,\n });\n // Replace the placeholder actionProperties at the last minute\n this._actionProperties = this._action.actionProperties;\n return this._action.bind(scope, stage, options);\n }", "async _bundlerNode(payload) {\n const sigResult = await this.signPayload(payload);\n return sigResult !== null\n ? await axios_1.default.post(this.bundlerUrl + SERVICE_SUBMIT, sigResult)\n : null;\n }", "async stage({ all, files }) {\r\n if (!all && !files.length) return;\r\n\r\n if (all) await spawnGit([\"add\", \"-A\"]);\r\n else await spawnGit([\"add\", ...files]);\r\n }", "function brushed() {\n var selection = d3.event.selection;\n xScale.domain(selection.map(xScale2.invert, xScale2));\n\n focus.selectAll(\".dot\")\n .attr(\"cx\", function(d) { return xScale(d.date); })\n .attr(\"cy\", function(d) { return yScale(d.consumption); });\n focus.selectAll(\".line\").attr(\"d\", valueline(origdata));\n focus.select(\".axis--x\").call(xAxis);\n}", "applyIncrementalBending(stepDesc) {\n if (this.bendingIncrements === 0)\n return;\n\n if (stepDesc && stepDesc.dt) {\n const timeFactor = stepDesc.dt / (1000 / 60);\n // TODO: use clone() below. it's cleaner\n const posDelta = (new ThreeVector()).copy(this.bendingPositionDelta).multiplyScalar(timeFactor);\n const avDelta = (new ThreeVector()).copy(this.bendingAVDelta).multiplyScalar(timeFactor);\n this.position.add(posDelta);\n this.angularVelocity.add(avDelta);\n\n // one approach to orientation bending is slerp:\n this.quaternion.slerp(this.bendingTarget.quaternion, this.incrementScale * timeFactor * 0.8);\n } else {\n this.position.add(this.bendingPositionDelta);\n this.angularVelocity.add(this.bendingAVDelta);\n this.quaternion.slerp(this.bendingTarget.quaternion, this.incrementScale);\n }\n\n // alternative: fixed delta-quaternion correction\n // TODO: adjust quaternion bending to dt timefactor precision\n // this.quaternion.multiply(this.bendingQuaternionDelta);\n this.bendingIncrements--;\n }", "function parStageBlock(stageName, subStageId, subStage, stageId) {\n return require('./templates/parallel-stage-block.hbs')({\n stageName: stageName,\n subStageId: subStageId,\n subStage: subStage,\n stageId: stageId,\n stepListing: stepListing(subStageId, subStage.steps)\n });\n}", "function execMerlin() {\n\tdocument.getElementById(\"merlinYes\").style.display = \"none\";\n\tdocument.getElementById(\"merlinPrompt\").innerText = \"Choose what stage you want to preview\"\n\tfor(var i=0; i<totalStages; i++) {\n\t\tvar id = \"merlin\" + (i+1) + \"stage\";\n\t\tdocument.getElementById(id).style.display = \"block\";\n\t}\n}", "function Bundler () {\n}", "function bld_buildFW(strBldFldr, rptObj, strBldType, strFlags)\n{\n\t\tvar fso = new ActiveXObject(\"Scripting.FileSystemObject\");\n\t\tvar strBldCmdStr = fso.BuildPath(strBldFldr, \"bin\\\\mkallbld.bat\");\n\t\trptObj.reportProgress(\"Starting \" + strBldType + \" build...\");\n\t\trptObj.closeLog();\t// Close so the external process can append to the log file.\n\t\ttry\n\t\t{\n\t\t\tmisc_RunExtProg(strBldCmdStr, strFlags, null, rptObj, rptObj.strLogFileName, true);\n\t\t} catch (err)\n\t\t{\n\t\t\trptObj.reopenLog (); // Re-open the log file for appending.\n\t\t\trptObj.reportFailure(strBldType + \" build failed, \" + err.description, true);\n\t\t\tmisc_ExitScript();\n\t\t}\n\t\trptObj.reopenLog(); // Re-open the log file for appending\n\t\trptObj.reportProgress(\"Finished building \" + strBldType +\" build.\");\n}", "function bnpCopyTo(r) {\n for (var i = this.t - 1; i >= 0; --i) r[i] = this[i];\n r.t = this.t;\n r.s = this.s;\n }", "function bnpCopyTo(r) {\n for (var i = this.t - 1; i >= 0; --i) r[i] = this[i];\n r.t = this.t;\n r.s = this.s;\n }", "function PebbleChain () {}", "loadBallerBase(){\n\n let ballerBase = this.ballerBase = this.rc.getResource(\"baller_base\").scene.children[0].clone();\n\n ballerBase.position.fromArray([0, 0.06999 ,0]);\n\n ballerBase.receiveShadow = true;\n ballerBase.visible = true;\n\n this.playerRollNode.add(ballerBase);\n\n }", "function addStage(req, res) {\n if (!validator.isValid(req.body.stageName)) {\n res.json({\n code: Constant.ERROR_CODE,\n message: Constant.FIELD_REQUIRED\n });\n }\n else {\n stage.findOne({stageName: {$regex: new RegExp('^' + req.body.stageName + '$', \"i\")}, moduleType: req.body.moduleType, companyId: req.body.companyId, deleted: false}, function(err, industryData) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: err});\n }\n else {\n if (industryData) {\n res.json({\n code: Constant.ERROR_CODE,\n message: Constant.CONTACT_INDUSTRY_EXIST\n });\n }\n else {\n var industryDataField = {\n stageName: req.body.stageName,\n companyId: req.body.companyId,\n moduleType: req.body.moduleType\n };\n stage(industryDataField).save(function(err, data) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, message: err});\n } else {\n res.json({code: Constant.SUCCESS_CODE, data: data});\n }\n });\n }\n\n }\n });\n }\n\n}", "split(node) {\n let newNode = new BNode();\n let newNodeIsLeafOldValue = newNode.isLeaf;\n newNode.isLeaf = node.isLeaf;\n this.addAtLastIndexOfCallStack(\n () => {\n newNode.isLeaf = newNodeIsLeafOldValue;\n }\n );\n while (node.size() > Math.floor(this.base / 2)) {\n let nodePopLastElement = node.popLast();\n this.addAtLastIndexOfCallStack(\n this.undoPopLast.bind(this, nodePopLastElement, node)\n );\n newNode.addFirst(nodePopLastElement);\n this.addAtLastIndexOfCallStack(\n this.undoAddFirst.bind(this, newNode)\n );\n if (newNode.first().hasLeftChild()) {\n let newNodeFirstLeftChildParentOldValue = newNode.first().leftChild.parent;\n newNode.first().leftChild.parent = newNode;\n this.addAtLastIndexOfCallStack(() => {\n newNode.first().leftChild.parent = newNodeFirstLeftChildParentOldValue;\n });\n }\n if (newNode.first().hasRightChild()) {\n let newNodeFirstRightChildParentOldValue = newNode.first().rightChild.parent;\n newNode.first().rightChild.parent = newNode;\n this.addAtLastIndexOfCallStack(() => {\n newNode.first().rightChild.parent = newNodeFirstRightChildParentOldValue\n });\n }\n }\n return newNode;\n }", "function processDataplaneDrop() { \n if (\"dpid\" in e) { \n addEvent(\"switches\", e[\"dpid\"], point, entities);\n } \n else if (\"host_id\" in e) {\n addEvent(\"hosts\", e[\"host_id\"], point, entities);\n }\n }", "function br (ctx, node) {\n const macro = ctx.break ? ctx.break : defaultMacro\n return macro(node)\n}", "break(dir = 'both'){\n if (dir === 'next'){\n if (this.next != null){\n this.next.last = null;\n this.next = null;\n }\n }else if (dir === 'last'){\n if (this.last != null){\n this.last.next = null;\n this.last = null;\n }\n }else if(dir === 'both'){\n if (this.last != null){\n this.last.next = null;\n this.last = null;\n }\n if (this.next != null){\n this.next.last = null;\n this.next = null;\n }\n }\n }", "function place_in_lighter_branch(bracket, decoy){\n if (is_lighter(bracket.branch_1, bracket.branch_2)){\n bracket.branch_1 = place_decoy_in_bracket(bracket.branch_1, decoy);\n return bracket;\n }\n if (is_lighter(bracket.branch_2, bracket.branch_1)){\n bracket.branch_2 = place_decoy_in_bracket(bracket.branch_2, decoy);\n return bracket;\n }\n // If both branch have the same number of players, then choose one at random.\n if(random(0,1) == 0){\n bracket.branch_1 = place_decoy_in_bracket(bracket.branch_1, decoy);\n return bracket;\n }\n else{\n bracket.branch_2 = place_decoy_in_bracket(bracket.branch_2, decoy);\n return bracket;\n }\n }", "function SDB(state) {\n const stack = state.stack;\n const n = stack.pop();\n\n if (exports.DEBUG) console.log(state.step, 'SDB[]', n);\n\n state.deltaBase = n;\n}", "function makeTurkeySandwhich(){\n //get one slice of bread;\n //add turkey;\n //put a slice of bread on top;\n}", "function newStageBlock() {\n return require('./templates/stage-block.hbs')();\n}", "function Bump(status) {\n \"use strict\";\n Leaf.call(this);\n this.state = status;\n}", "function bnpCopyTo(r) {\n for (var i = this.t - 1; i >= 0; --i) r[i] = this[i];\n r.t = this.t;\n r.s = this.s;\n }", "function bnpCopyTo(r) {\n for (var i = this.t - 1; i >= 0; --i) r[i] = this[i];\n r.t = this.t;\n r.s = this.s;\n }", "function bnpCopyTo(r) {\n\t for(var i = this.t-1; i >= 0; --i) r[i] = this[i];\n\t r.t = this.t;\n\t r.s = this.s;\n\t }", "function bnpCopyTo(r) {\n\t for(var i = this.t-1; i >= 0; --i) r[i] = this[i];\n\t r.t = this.t;\n\t r.s = this.s;\n\t }", "function bnpCopyTo(r) {\n\t for (var i = this.t - 1; i >= 0; --i) r[i] = this[i]\n\t r.t = this.t\n\t r.s = this.s\n\t}", "function bnpCopyTo(r) {\n\t for (var i = this.t - 1; i >= 0; --i) r[i] = this[i]\n\t r.t = this.t\n\t r.s = this.s\n\t}", "function importDBRCheck (finalizedDBR) {\n let dbrMonth = finalizedDBR.Month.format('MMMM YYYY')\n return redshift.hasMonth(finalizedDBR.Month).then(function (hasMonth) {\n if (hasMonth) {\n log.info(`No new DBRs to import.`)\n if (args.force) {\n log.warn(`--force specified, importing DBR for ${dbrMonth} anyways`)\n return finalizedDBR\n }\n cliUtils.runCompleteHandler(startTime, 0)\n } else {\n return finalizedDBR\n }\n })\n}", "LD_A_PBC(op){ op.register_A = op.readMemory(op.register_BC); return 8; }", "function bnpCopyTo(r) {\r\n\t for (var i = this.t - 1; i >= 0; --i) r[i] = this[i];\r\n\t r.t = this.t;\r\n\t r.s = this.s;\r\n\t}", "function bnpCopyTo(r) {\r\n\t for (var i = this.t - 1; i >= 0; --i) r[i] = this[i];\r\n\t r.t = this.t;\r\n\t r.s = this.s;\r\n\t}", "async stageBlock(blockId, body, contentLength, options = {}) {\n const { span, updatedOptions } = createSpan(\"BlockBlobClient-stageBlock\", options);\n try {\n ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);\n return await this.blockBlobContext.stageBlock(blockId, contentLength, body, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, requestOptions: {\n onUploadProgress: options.onProgress,\n }, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, 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 stageBlock(blockId, body, contentLength, options = {}) {\n const { span, updatedOptions } = createSpan(\"BlockBlobClient-stageBlock\", options);\n try {\n ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);\n return await this.blockBlobContext.stageBlock(blockId, contentLength, body, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, requestOptions: {\n onUploadProgress: options.onProgress,\n }, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, 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 }", "function bnpCopyTo(r) {\n for (var i = this.t - 1; i >= 0; --i) {\n r[i] = this[i];\n }r.t = this.t;\n r.s = this.s;\n }", "function bnpCopyTo(r) {\n for (var i = this.t - 1; i >= 0; --i) {\n r[i] = this[i];\n }r.t = this.t;\n r.s = this.s;\n }", "function bnpCopyTo(r) {\n for (var i = this.t - 1; i >= 0; --i) {\n r[i] = this[i];\n }r.t = this.t;\n r.s = this.s;\n }", "function bnpCopyTo(r) {\n for(var i = this.t-1; i >= 0; --i) r[i] = this[i];\n r.t = this.t;\n r.s = this.s;\n }", "function bnpCopyTo(r) {\n for(var i = this.t-1; i >= 0; --i) r[i] = this[i];\n r.t = this.t;\n r.s = this.s;\n }", "function bnpCopyTo(r) {\n for(var i = this.t-1; i >= 0; --i) r[i] = this[i];\n r.t = this.t;\n r.s = this.s;\n }" ]
[ "0.50146896", "0.49512193", "0.48900294", "0.4831163", "0.48262903", "0.47168937", "0.46789825", "0.46443695", "0.46065322", "0.45829472", "0.45658687", "0.45603934", "0.4559333", "0.45510262", "0.45469394", "0.45300382", "0.44928783", "0.4479802", "0.4471626", "0.44711", "0.44512996", "0.44423187", "0.44290984", "0.44084477", "0.44032663", "0.44020122", "0.43947622", "0.43938002", "0.43919346", "0.4386898", "0.43702984", "0.43598813", "0.4357216", "0.43559253", "0.4354051", "0.43522123", "0.43284455", "0.43281624", "0.43281624", "0.43281624", "0.43281624", "0.43281624", "0.43281624", "0.43281624", "0.43281624", "0.43281624", "0.43261746", "0.43134156", "0.43104288", "0.4307578", "0.4302511", "0.42909497", "0.42837313", "0.4283116", "0.42752993", "0.42583525", "0.42583525", "0.42507225", "0.423973", "0.42335948", "0.42331788", "0.42289323", "0.4227872", "0.4224861", "0.42143255", "0.42103735", "0.42099184", "0.42021003", "0.4197444", "0.4197444", "0.41927782", "0.41923648", "0.41914937", "0.41906595", "0.4189042", "0.41884604", "0.41831926", "0.41744497", "0.41729292", "0.41698855", "0.41626227", "0.4161712", "0.41590092", "0.41590092", "0.41587022", "0.41587022", "0.41581368", "0.41581368", "0.41498154", "0.41428828", "0.4140596", "0.4140596", "0.41388285", "0.41388285", "0.41346765", "0.41346765", "0.41346765", "0.41300693", "0.41300693", "0.41300693" ]
0.6583978
0
Run VACUUM on the line_items table
function vacuum () { if (!args.no_vacuum) { log.info('Running VACUUM on line_items...') return redshift.vacuum(process.env.LINE_ITEMS_TABLE_NAME || 'line_items') } else { log.info('--no-vacuum specified, skiping vacuum.') return } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "vacuum () {\n this.db.exec('VACUUM')\n }", "async function dbVacuum() {\n db.run(/*sql*/`VACUUM \"main\"`);\n}", "async UPDATE_QUANTITY({ state, commit }, lineItems) {\n let client = this.app.apolloProvider.defaultClient;\n\n const checkoutData = await client.mutate({\n mutation: CheckoutLineItemsUpdate,\n variables: { checkoutId: state.checkout.id, lineItems },\n });\n\n const checkout = pathOr(\n {},\n [\"data\", \"checkoutLineItemsUpdate\", \"checkout\"],\n checkoutData\n );\n\n commit(\"SET_CHECKOUT\", checkout);\n }", "function run(){\n\n let sql = \"SELECT * FROM items LEFT JOIN item_attributes ON item_attributes.entity_id = items.id AND item_attributes.key = 'checksum' GROUP BY items.id, item_attributes.key;\";\n beetsDB.all(sql, function(err, files){\n files = dbPublic.reformatData(files);\n\n // TODO: We can make this more efficient by comparing the differences and just adding/deleting the changes\n dbPublic.purgeDB(username);\n\n dbPublic.addToDB(files);\n\n if(loadJson.privateDBOptions.quickSync === false){\n smokeThatHash();\n }\n });\n}", "function updateAllocated(e, item, orderedItems) {\n var allocLen = trModel.allocated.length;\n trModel.allocated.splice(0, allocLen);\n Array.prototype.push.apply(trModel.allocated, orderedItems);\n }", "function manipulate () {\n console.log(\"beginning data manipulation\");\n\n var sql = \"alter table carto.bg add column geonum bigint; update carto.bg set geonum = ('1' || geoid)::bigint; alter table carto.bg add column state integer; update carto.bg set state=statefp::integer; alter table carto.bg add column county integer; update carto.bg set county=countyfp::integer; alter table carto.bg rename column name to geoname; alter table carto.bg rename column tractce to tract; alter table carto.bg rename column blkgrpce to bg; alter table carto.bg drop column statefp; alter table carto.bg drop column countyfp; CREATE INDEX carto_bg_geoid ON carto.bg USING btree (geoid); CREATE UNIQUE INDEX carto_bg_geonum_idx ON carto.bg USING btree (geonum); CREATE INDEX carto_bg_state_idx ON carto.bg USING btree (state); CREATE INDEX bg_geom_gist ON carto.bg USING gist (geom);\" +\n\n \"alter table carto.county add column geonum bigint; update carto.county set geonum = ('1' || geoid)::bigint; alter table carto.county rename column name to geoname; alter table carto.county add column state integer; update carto.county set state=statefp::integer; alter table carto.county add column county integer; update carto.county set county=countyfp::integer; alter table carto.county drop column statefp; alter table carto.county drop column countyfp; CREATE INDEX carto_county_geoid ON carto.county USING btree (geoid); CREATE UNIQUE INDEX carto_county_geonum_idx ON carto.county USING btree (geonum); CREATE INDEX carto_county_state_idx ON carto.county USING btree (state); CREATE INDEX county_geom_gist ON carto.county USING gist (geom);\" +\n\n \"alter table carto.place add column geonum bigint; update carto.place set geonum = ('1' || geoid)::bigint; alter table carto.place rename column name to geoname; alter table carto.place add column state integer; update carto.place set state=statefp::integer; alter table carto.place add column place integer; update carto.place set place=placefp::integer; alter table carto.place drop column statefp; alter table carto.place drop column placefp; CREATE INDEX carto_place_geoid ON carto.place USING btree (geoid); CREATE UNIQUE INDEX carto_place_geonum_idx ON carto.place USING btree (geonum); CREATE INDEX carto_place_state_idx ON carto.place USING btree (state); CREATE INDEX place_geom_gist ON carto.place USING gist (geom);\" +\n\n \"alter table carto.state add column geonum bigint; update carto.state set geonum = ('1' || geoid)::bigint; alter table carto.state rename column name to geoname; alter table carto.state add column state integer; update carto.state set state=statefp::integer; alter table carto.state rename column stusps to abbrev; alter table carto.state drop column statefp; CREATE INDEX carto_state_geoid ON carto.state USING btree (geoid); CREATE UNIQUE INDEX carto_state_geonum_idx ON carto.state USING btree (geonum); CREATE INDEX carto_state_state_idx ON carto.state USING btree (state); CREATE INDEX state_geom_gist ON carto.state USING gist (geom);\" +\n\n \"alter table carto.tract add column geonum bigint; update carto.tract set geonum = ('1' || geoid)::bigint; alter table carto.tract rename column name to geoname; alter table carto.tract add column state integer; update carto.tract set state=statefp::integer; alter table carto.tract add column county integer; update carto.tract set county=countyfp::integer; alter table carto.tract rename column tractce to tract; alter table carto.tract drop column statefp; alter table carto.tract drop column countyfp; CREATE INDEX carto_tract_geoid ON carto.tract USING btree (geoid); CREATE UNIQUE INDEX carto_tract_geonum_idx ON carto.tract USING btree (geonum); CREATE INDEX carto_tract_state_idx ON carto.tract USING btree (state); CREATE INDEX tract_geom_gist ON carto.tract USING gist (geom);\" +\n\n \"alter table tiger.county add column geonum bigint; update tiger.county set geonum = ('1' || geoid)::bigint; alter table tiger.county rename column name to geoname; alter table tiger.county add column state integer; update tiger.county set state=statefp::integer; alter table tiger.county add column county integer; update tiger.county set county=countyfp::integer; alter table tiger.county drop column statefp; alter table tiger.county drop column countyfp; CREATE INDEX county_geom_gist ON tiger.county USING gist (geom); CREATE INDEX tiger_county_geoid ON tiger.county USING btree (geoid); CREATE UNIQUE INDEX tiger_county_geonum_idx ON tiger.county USING btree (geonum); CREATE INDEX tiger_county_state_idx ON tiger.county USING btree (state);\" +\n\n \"alter table tiger.place add column geonum bigint; update tiger.place set geonum = ('1' || geoid)::bigint; alter table tiger.place rename column namelsad to geoname; alter table tiger.place rename column name to geoname_simple; alter table tiger.place add column state integer; update tiger.place set state=statefp::integer; alter table tiger.place add column place integer; update tiger.place set place=placefp::integer; alter table tiger.place drop column statefp; alter table tiger.place drop column placefp; CREATE INDEX place_geom_gist ON tiger.place USING gist (geom); CREATE INDEX tiger_place_geoid ON tiger.place USING btree (geoid); CREATE UNIQUE INDEX tiger_place_geonum_idx ON tiger.place USING btree (geonum); CREATE INDEX tiger_place_state_idx ON tiger.place USING btree (state);\" +\n\n \"alter table tiger.state add column geonum bigint; update tiger.state set geonum = ('1' || geoid)::bigint; alter table tiger.state rename column name to geoname; alter table tiger.state add column state integer; update tiger.state set state=statefp::integer; alter table tiger.state rename column stusps to abbrev; CREATE INDEX state_geom_gist ON tiger.state USING gist (geom); CREATE INDEX tiger_state_geoid ON tiger.state USING btree (geoid); CREATE UNIQUE INDEX tiger_state_geonum_idx ON tiger.state USING btree (geonum); CREATE INDEX tiger_state_state_idx ON tiger.state USING btree (state);\" +\n\n \"alter table tiger.tract add column geonum bigint; update tiger.tract set geonum = ('1' || geoid)::bigint; alter table tiger.tract rename column namelsad to geoname; alter table tiger.tract rename column name to simple_name; alter table tiger.tract add column state integer; update tiger.tract set state=statefp::integer; alter table tiger.tract add column county integer; update tiger.tract set county=countyfp::integer; alter table tiger.tract rename column tractce to tract; alter table tiger.tract drop column statefp; alter table tiger.tract drop column countyfp; CREATE INDEX tiger_tract_geoid ON tiger.tract USING btree (geoid); CREATE UNIQUE INDEX tiger_tract_geonum_idx ON tiger.tract USING btree (geonum); CREATE INDEX tiger_tract_state_idx ON tiger.tract USING btree (state); CREATE INDEX tract_geom_gist ON tiger.tract USING gist (geom);\" +\n\n \"alter table tiger.bg add column geonum bigint; update tiger.bg set geonum = ('1' || geoid)::bigint; alter table tiger.bg add column state integer; update tiger.bg set state=statefp::integer; alter table tiger.bg add column county integer; update tiger.bg set county=countyfp::integer; alter table tiger.bg rename column namelsad to geoname; alter table tiger.bg rename column tractce to tract; alter table tiger.bg rename column blkgrpce to bg; alter table tiger.bg drop column statefp; alter table tiger.bg drop column countyfp; CREATE INDEX bg_geom_gist ON tiger.bg USING gist (geom); CREATE INDEX tiger_bg_geoid ON tiger.bg USING btree (geoid); CREATE UNIQUE INDEX tiger_bg_geonum_idx ON tiger.bg USING btree (geonum); CREATE INDEX tiger_bg_state_idx ON tiger.bg USING btree (state);\";\n \n client.connect();\n\n var newquery = client.query(sql);\n\n newquery.on(\"end\", function () {\n client.end();\n console.log(\"end manipulation\");\n cleanup();\n });\n\n\n}", "function putItem (table, item) {\n let params = {\n Item: item,\n ReturnConsumedCapacity: 'TOTAL',\n TableName: table\n }\n return new Promise((resolve, reject) => {\n ddb.putItem(params, (err, data) => {\n if (err) return reject(err)\n return resolve(data)\n })\n })\n}", "function crearTablaAscensorItemsMaquinas(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_items_maquinas(k_coditem_maquinas, v_item, o_descripcion, v_clasificacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function addToLatestRedis(row, redis, i, latest_products, total_process, total_process, lt_redis_key, done) {\n\n var row_mongo_id = row._id;\n redis.hmset('item_' + row_mongo_id, row, function (err) {\n if (err) {\n console.log('305');\n console.log(err);\n }\n\n redis.expire('item_' + row_mongo_id, 60 * 60 * 24 * 7, function () {\n if (err) {\n console.log('310');\n console.log(err);\n }\n redis.zadd(lt_redis_key, i, row_mongo_id, function (err) {\n if (err) {\n console.log('315');\n console.log(err);\n }\n if (i == (latest_products.length - 1)) {\n console.log(lt_redis_key + ' :: update ho gya hai !!!');\n total_process++;\n }\n\n if (total_process == total_process.length) {\n console.log(\" !!! final update ho gya hai!!!\");\n var end = new Date().getTime() - start;\n console.log('time taken ' + end);\n done();\n redis.set('home_latest_generate', new Date() + \"\");\n redis.expire('home_latest_generate', 60 * 15 * 1);\n }\n });\n });\n });\n}", "function rebuildTableFromAry(){\n\tclearTable();\n\t\n\tvar ary_len = codeSystemListDataStore.getArySize();\n\t\n\tfor(var i = 0; i < ary_len; i++){\n\t\tvar curRecord = codeSystemListDataStore.getCodeSystemByIndex(i);\n\t\t\n\t\tvar temp_codeSystemVersion_id = curRecord[\"codeSystemVersion_id\"];\n\t\tvar temp_codeSystemVersion_name = curRecord[\"codeSystemVersion_name\"];\n\t\tvar temp_codeSystem_name = curRecord[\"codeSystem_name\"];\n\t\tvar temp_codeSystemVersion_desc = curRecord[\"codeSystemVersion_desc\"];\n\t\t\n\t\tinsertTableRow(temp_codeSystem_id,temp_codeSystem_oid, temp_codeSystem_code, temp_codeSystem_name, temp_codeSystem_display_name);\n\t}\n}", "async syncKlineInfo (symbol, period) {\n getLogger().debug(`start sync ${symbol}:${period} kline info`)\n \n const timeRange = await zip(\n from(this.DBTable.min('ts', {where: {\n symbol,\n period\n }})),\n from(this.DBTable.max('ts', {where: {\n symbol,\n period\n }}))\n ).pipe(\n map(([\n min,\n max\n ]) => {\n const result = {}\n if(min){\n result.minTs = min\n }else {\n result.minTs = Math.floor(Date.now() / 1000)\n }\n\n if(max){\n result.maxTs = max\n }else {\n result.maxTs = Math.floor(Date.now() / 1000)\n }\n return result\n }),\n ).toPromise()\n \n \n await merge(\n from(this.reqKlineInfo(symbol, period, null, timeRange.minTs - 1)).pipe(\n // query left\n expand(klines => klines.length === 0 \n ? EMPTY\n : from(this.reqKlineInfo(symbol, period, 0, klines[0].ts - 1))),\n ),\n from(this.reqKlineInfo(symbol, period, timeRange.maxTs + 1)).pipe(\n // query right\n expand(klines => klines.length === 0 \n ? EMPTY\n : from(this.reqKlineInfo(symbol, period, klines[klines.length - 1].ts + 1))),\n )\n ).pipe(\n reduce((acc, val)=> acc.concat(val), []),\n mergeMap(klines => this.DBTable.bulkCreate(klines, {\n updateOnDuplicate: [\n 'symbol',\n 'period',\n 'ts'\n ]\n })) \n ).toPromise()\n }", "function processVersionRow(row) {\n\t\t\tlet modifiedOn, version;\n\t\t\tif (Array.isArray(row)) {\n\t\t\t\tmodifiedOn = row[1];\n\t\t\t\tversion = Number(row[2]);\n\t\t\t} else {\n\t\t\t\tmodifiedOn = row.modified_on;\n\t\t\t\tversion = Number(row.version);\n\t\t\t}\n\t\t\tif (modifiedOn.getTime() > versionInfo.modifiedOn.getTime())\n\t\t\t\tversionInfo.modifiedOn = modifiedOn;\n\t\t\tversionInfo.version += version;\n\t\t}", "async function inserts() {\n const tsv = fs.readFileSync('finalDump_2019-05-14.tsv', 'utf8');\n const lines = tsv.split('\\n');\n let count = 0;\n for (let [idx, line] of lines.entries()){\n const tabVals = line.split('\\t');\n\n if (idx === 0 || idx === lines.length - 1) continue; // skip header and end line\n if (tabVals[0] === \"1.0\") continue; // skip repeated-PPIs\n\n await knex('interactions').select('*').where({\n entity_1 : tabVals[2],\n entity_2 : tabVals[3],\n interaction_type_id : getItrnIdx(Number(tabVals[0]))\n })\n .then( (rows)=>{\n console.log('INSERT initialization', rows);\n if (rows.length === 0 ){\n count++;\n console.log(`Interaction NOT FOUND ${tabVals[2]}-${tabVals[3]} of AIV-index ${tabVals[0]} with pcc ${tabVals[8]}, INSERTing - line ${idx}`);\n return knex('interactions').insert({\n entity_1 : tabVals[2],\n entity_2 : tabVals[3],\n interaction_type_id : getItrnIdx(Number(tabVals[0])),\n pearson_correlation_coeff : tabVals[8] || null\n })\n }\n else {\n console.log(`Interaction Found: ${tabVals[2]}-${tabVals[3]} of AIV-index ${tabVals[0]} - line ${idx}`);\n return rows;\n }\n })\n .then(async (rows)=>{\n let interactionId = typeof rows[0] === \"number\" ? rows[0] : rows[0].interaction_id; // if row freshly inserted (will return [1001]) or not (will return [ RowDataPacket {interaction_id : 1001}]\n console.log('Interaction ID:', interactionId);\n console.log(tabVals[17], tabVals[16]);\n if (tabVals[17] === \"0.0\" && tabVals[16] === \"0.0\") { console.log('lol'); return interactionId } // don't enter zero-values\n const interologSubsetSelect = await knex('interolog_confidence_subset_table').select('*').where('interaction_id', interactionId);\n if (interologSubsetSelect.length === 0){\n return knex('interolog_confidence_subset_table').insert({\n interaction_id : interactionId,\n s_cerevisiae : tabVals[9],\n s_pombe : tabVals[10],\n worm : tabVals[11],\n fly : tabVals[12],\n human : tabVals[13],\n mouse : tabVals[14],\n e_coli : tabVals[15],\n total_hits : tabVals[16],\n num_species : tabVals[17],\n }).return(interactionId)\n }\n else {\n return interactionId;\n }\n })\n .then( async (itrnId)=>{\n console.log('3rd cb', itrnId);\n if (tabVals[7] === \"0.0\") return itrnId;\n const algoName = determineAlgo(tabVals[7]);\n const algoScorePerItrnSubset = await knex('interactions_algo_score_join_table').select('*').where({\n algo_name : algoName[0],\n interaction_id : itrnId,\n algo_score : algoName[1]\n });\n if (algoScorePerItrnSubset.length === 0){\n return knex('interactions_algo_score_join_table').insert({\n algo_name : algoName[0],\n interaction_id : itrnId,\n algo_score : algoName[1]\n }).return(itrnId)\n }\n else {\n return itrnId\n }\n })\n .then(async(itrnId)=>{\n console.log('4th cb', itrnId);\n const pmid = tabVals[1].replace('-', '#'); // note replace 29320478-2 for 29320478#2 as it will be work better for linking\n const sourcePreSelect = await knex('external_source').select('*').where({\n source_name : pmid\n });\n console.log(pmid, 'pmid');\n if (sourcePreSelect.length === 0){\n return knex('external_source').insert({\n source_name : pmid,\n comments : initCmtsForRefs(pmid),\n date_uploaded : new Date(),\n })\n .then((instdRow) => {return {source : instdRow[0], itrnId}})\n }\n else {\n return {source : sourcePreSelect[0].source_id, itrnId};\n }\n })\n .then(async(sourceAndItrnIds)=>{\n console.log('source and itrn Ids\\n', sourceAndItrnIds);\n const miMethod = tabVals[4] || \"\";\n const miType = tabVals[5] || \"\";\n const bindId = tabVals[6] || \"\";\n const joinTablePreSelect = await knex('interactions_source_mi_join_table').where({\n interaction_id : sourceAndItrnIds.itrnId,\n source_id : sourceAndItrnIds.source,\n external_db_id : bindId,\n mi_detection_method : miMethod,\n mi_detection_type : miType\n });\n if (joinTablePreSelect.length === 0 ) {\n return knex('interactions_source_mi_join_table').insert({\n interaction_id : sourceAndItrnIds.itrnId,\n source_id : sourceAndItrnIds.source,\n external_db_id : bindId,\n mi_detection_method : miMethod,\n mi_detection_type : miType,\n mode_of_action : 1\n });\n }\n })\n .catch((err)=>{\n console.error('Error:', err);\n throw new Error('STOP!');\n })\n\n }\n\n console.log(count);\n}", "function atualizaOrdenacao(){\n\n var resort = true, callback = function(table){};\n\n tabela.trigger(\"update\", [resort, callback]);\n\n }", "setCalculatedGroupPriorities(agendaitems) {\n return Promise.all(\n agendaitems.map(async (item) => {\n const mandatees = await item.get('mandatees');\n if (item.isApproval) {\n return;\n }\n if (mandatees.length == 0) {\n item.set('groupPriority', 20000000);\n return;\n }\n const mandateePriorities = mandatees.map((mandatee) => mandatee.priority);\n const minPrio = Math.min(...mandateePriorities);\n const minPrioIndex = mandateePriorities.indexOf(minPrio);\n delete mandateePriorities[minPrioIndex];\n let calculatedGroupPriority = minPrio;\n mandateePriorities.forEach((value) => {\n calculatedGroupPriority += value / 100;\n });\n item.set('groupPriority', calculatedGroupPriority);\n })\n );\n }", "function addMutationInvolvesRow() {\n\t\t\tconsole.log(\"addMutationInvolvesRow\");\n\n\t\t\tif (vm.apiDomain.mutationInvolves == undefined) {\n\t\t\t\tvm.apiDomain.mutationInvolves = [];\n\t\t\t}\n\n\t\t\tvar i = vm.apiDomain.mutationInvolves.length;\n\n\t\t\tvm.apiDomain.mutationInvolves[i] = {\n\t\t\t\t\"processStatus\": \"c\",\n\t\t\t\t\"relationshipKey\": \"\",\n\t\t\t \t\"alleleKey\": vm.apiDomain.alleleKey,\n \"alleleSymbol\": \"\",\n\t\t\t \t\"markerKey\": \"\",\n \"markerSymbol\": \"\",\n \"markerAccID\": \"\",\n \"organismKey\": \"1\",\n \"organism\": \"mouse, laboratory\",\n\t\t\t \t\"categoryKey\": \"1003\",\n\t\t\t \t\"categoryTerm\": \"\",\n\t\t\t \t\"relationshipTermKey\": \"\",\n\t\t\t \t\"relationshipTerm\": \"\",\n\t\t\t \t\"qualifierKey\": \"11391898\",\n\t\t\t \t\"qualifierTerm\": \"\",\n\t\t\t \t\"evidenceKey\": \"11391900\",\n\t\t\t \t\"evidenceTerm\": \"IGC\",\n\t\t\t\t\"refsKey\": \"\",\n\t\t\t \t\"jnumid\": \"\",\n\t\t\t\t\"short_citation\": \"\",\n\t\t\t\t\"createdBy\": \"\",\n\t\t\t\t\"creation_date\": \"\",\n\t\t\t\t\"modifiedBy\": \"\",\n\t\t\t\t\"modification_date\": \"\"\n\t\t\t}\n\n addMINoteRow(i);\n\t\t}", "addLineItem(){\n\t\t\t\tthis.setState({\n\t\t\t\t\tlineItems: this.state.lineItems + 1\n\t\t\t\t});\n\t\t\t\tthis.state.lineItemsArray.push({id: this.state.lineItems, desc: \"\", amount: 0});\n\t\t}", "async function batchWriteCommits({\n aggregateType,\n aggregateKey = '@',\n commits,\n tableName = config.tableName,\n startVersion = 1,\n} = {}) {\n const AWS = config.configuredAWS\n const ddb = new AWS.DynamoDB()\n\n let i = 0\n try {\n while (i < commits.length) {\n const versionOffset = i\n await ddb\n .batchWriteItem({\n RequestItems: {\n [tableName]: commits.slice(i, i + 25).map((commit, num) => ({\n PutRequest: {\n Item: serializeCommit({\n aggregateType,\n aggregateKey,\n version: startVersion + versionOffset + num,\n ...commit,\n }),\n },\n })),\n },\n })\n .promise()\n i += 25\n }\n } catch (error) {\n throw error\n }\n}", "function reloadOutputAllocations() {\n inventreeGet(\n '{% url \"api-build-line-list\" %}',\n {\n build: build_info.pk,\n tracked: true,\n },\n {\n success: function(response) {\n let build_lines = response.results || response;\n let table_data = $(table).bootstrapTable('getData');\n\n has_tracked_lines = build_lines.length > 0;\n\n /* Iterate through each active build output and update allocations\n * For each build output, we need to:\n * - Append any existing allocations\n * - Work out how many lines are \"fully allocated\"\n */\n for (var ii = 0; ii < table_data.length; ii++) {\n let output = table_data[ii];\n\n let fully_allocated = 0;\n\n // Construct a list of allocations for this output\n let lines = [];\n\n // Iterate through each tracked build line item\n for (let jj = 0; jj < build_lines.length; jj++) {\n\n // Create a local copy of the build line\n let line = Object.assign({}, build_lines[jj]);\n\n let required = line.bom_item_detail.quantity * output.quantity;\n\n let allocations = [];\n let allocated = 0;\n\n // Iterate through each allocation for this line item\n for (let kk = 0; kk < line.allocations.length; kk++) {\n let allocation = line.allocations[kk];\n\n if (allocation.install_into == output.pk) {\n allocations.push(allocation);\n allocated += allocation.quantity;\n }\n }\n\n line.allocations = allocations;\n line.allocated = allocated;\n line.quantity = required;\n\n if (allocated >= required) {\n fully_allocated += 1;\n }\n\n lines.push(line);\n }\n\n // Push the row back in\n output.lines = lines;\n output.fully_allocated = fully_allocated;\n table_data[ii] = output;\n }\n\n // Update the table data\n $(table).bootstrapTable('load', table_data);\n\n if (has_tracked_lines) {\n $(table).bootstrapTable('showColumn', 'fully_allocated');\n } else {\n $(table).bootstrapTable('hideColumn', 'fully_allocated');\n }\n }\n }\n );\n }", "incrementStat (key, increment) {\n let period = new Date().toISOString().slice(0, 10); // 2016-01-01\n this.run(`\n INSERT INTO stats (period, key, value)\n VALUES ($1, $2, $3)\n ON CONFLICT (period, key)\n DO UPDATE SET value = stats.value + EXCLUDED.value\n `, [period, key, increment], (err, result) => {\n if (err) {\n log.warn('Unable to save stat:', key, increment, err);\n }\n });\n }", "async function updateStore(store){\n return new Promise(async function(resolve, reject){\n const tableName = formatName(store)\n db.run('CREATE TABLE IF NOT EXISTS '+tableName+' (vmp_id INT UNIQUE, stockLevel INTEGER NOT NULL, last_updated DATETIME, FOREIGN KEY(vmp_id) REFERENCES beers(vmp_id))');\n\n const facets = await vinmonopolet.getFacets();\n const storeFacet = facets.find(facet => facet.name === 'Butikker')\n const storeFacetValue = storeFacet.values.find(val => val.name === store)\n const beer = vinmonopolet.Facet.Category.BEER\n\n let {pagination, products} = await vinmonopolet.getProducts({facet: [storeFacetValue,beer]})\n while (pagination.hasNext) {\n const response = await pagination.next()\n products = products.concat(response.products)\n pagination = response.pagination\n }\n\n db.beginTransaction(async function(err, transaction) {\n var date = new Date().toISOString();\n for(i=0; i<products.length; i++){\n transaction.run(\"INSERT INTO \"+tableName+\" VALUES (?,?,?) ON CONFLICT (vmp_id) DO UPDATE SET stockLevel = excluded.stockLevel, last_updated = ?\",[products[i].code, products[i].chosenStoreStock.stockLevel, date, date]);\n }\n transaction.commit(function(err) {\n if(err){\n logger.log(\"Transaction failed for updateStore: \" + err.message)\n } else {\n db.beginTransaction(function(err, transaction2) {\n transaction2.run(\"DELETE FROM \"+tableName+\" WHERE last_updated < ?\", [date]);\n transaction2.commit(function(err) {\n if(err){\n reject(err)\n } else {\n resolve(true)\n }\n });\n });\n\n }\n });\n });\n })\n\n}", "doTransaction() {\n this.todoList.items.splice(this.todoIndex, 1);\n for(let i = 0; i < this.todoList.items.length; i++){\n this.todoList.items[i].key = i;\n }\n }", "async acquire () {\n if (!this.opened)\n throw new Error(\"still not opened\")\n return new Promise((resolve, reject) => {\n this.lock(\"IPC-KeyVal-rpm\", (unlock) => {\n this.unlock = unlock\n this.locked = true\n this.db.query(\"START TRANSACTION;\", [],\n (err) => {\n if (err) reject(err)\n else resolve()\n }\n )\n })\n })\n }", "function updateAllocated(event, item, orderedItems) {\n ctrl.allocated.sourceItems.splice(0, ctrl.allocated.sourceItems.length);\n Array.prototype.push.apply(ctrl.allocated.sourceItems, orderedItems);\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}", "async _processItems (h) {\n const pages = await this.store.table('page').catch(ERROR)\n const items = pages.find({\n updated: true\n })\n const plist = []\n for (const itemRaw of items) {\n const item = new Item(itemRaw)\n const promise = this.trains.run('processItem', {h, item})\n .catch(ERROR)\n plist.push(promise)\n }\n await Promise.all(plist)\n this.store.save()\n }", "function syncLocalTable() {\r\n return syncContext.push().then(function () {\r\n return syncContext.pull(new WindowsAzure.Query(tableName));\r\n });\r\n }", "updateLineSeries() {\n const lineSeries = this.props.ratings.reduce(\n (acc, seasonRatings, index) => {\n const individualLineSeries = this.convertRatingsToLineSeries(\n seasonRatings,\n index\n );\n acc.push(individualLineSeries);\n\n return acc;\n },\n []\n );\n\n this.ratings = lineSeries;\n }", "function line_operations(a_line) {\n // for loop to change Trello ISO dates to moment objects\n // that work with moment methods \n for(let x = 0; x < a_line.length; x++) {\n a_line[x].cDate = moment(a_line[x].cDate);\n }\n // call function that returns array of moment.format() strings of\n // last (show_days + 1) days\n var chart_days = moment_dates(show_days);\n // convert moment.format() strings to moment objects\n for(let x = 0; x < chart_days.length; x++) {\n chart_days[x] = moment(chart_days[x]);\n }\n // create an array of 60 zeros\n var zero_array = new Array(show_days + 1).fill(0);\n // compare created/resolved dates to dates on chart x axis\n // and count them to zero_array\n for(let x = 0; x < chart_days.length; x++) {\n for(let abc = 0; abc < a_line.length; abc++) {\n if (chart_days[x].date() == a_line[abc].cDate.date()) {\n if (chart_days[x].month() == a_line[abc].cDate.month()) {\n if (chart_days[x].year() == a_line[abc].cDate.year()) {\n zero_array[x]++;\n } // end if\n } // end if\n } // end if\n } //end for\n } //end for\n // make the created dates accumulate\n for(let x = 0; x < zero_array.length - 1; x++) {\n zero_array[x+1] = zero_array[x+1] + zero_array[x];\n }\n return(zero_array);\n}", "function putLineItemDO(lineItemDO, createModelFn) {\n\t\t\t\tvar itemHash;\n\t\t\t\tif (lineItemDO) {\n\t\t\t\t\titemHash = hash(lineItemDO);\n\n\t\t\t\t}\n\t\t\t\tif (isValidKey(itemHash)) {\n\t\t\t\t\tvar existingModel = items[itemHash];\n\t\t\t\t\tif (!angular.isDefined(existingModel)) {\n\t\t\t\t\t\titems[itemHash] = createModelFn(lineItemDO);\n\t\t\t\t\t\titemCollection.size += 1;\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmergeLineItemWithDO(existingModel, lineItemDO);\n\t\t\t\t\t\tvar newHash = hash(existingModel);\n\t\t\t\t\t\tif (isValidKey(newHash) && newHash != itemHash) {\n\t\t\t\t\t\t\t$log.debug('Merge rehash: ', newHash, existingModel);\n\t\t\t\t\t\t\t// What if there is already a value at items[newHash]?\n\t\t\t\t\t\t\titems[newHash] = existingModel;\n\t\t\t\t\t\t\tdelete items[itemHash];\n\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} else {\n\t\t\t\t\t$log.error('Failed to hash', lineItemDO);\n\n\t\t\t\t}\n\t\t\t\treturn itemCollection;\n\n\t\t\t}", "function mergeData(){\n\n var locRef={};\n var tempStatsArray = tempStats.stdout; // array with the stats info\n var entryAsset, entryStats; // variables to hold entries assets and stats\n var newStats = {}; // obj containing the new stats\n\n for(let i = 0; i < assetsData.length; i++){\n\n entryAsset = tempAssets[i]; // get Asset\n\n for(let k = 0; k < tempStatsArray.length; k++){\n\n entryStats = tempStatsArray[k]; // get stats\n\n // If there is a correspondence between Assets list and Stats list\n if(entryAsset.name === entryStats.name){\n\n // Create new stats object\n newStats = {timestamp:tempStats.timestamp, stdout: [entryStats]};\n\n // If asset has a \"vf-OS\" label and marked as \"true\"\n if( (\"vf-OS\" in entryAsset.labels) &&\n (entryAsset.labels[\"vf-OS\"] === \"true\") ){\n\n // If it has a front url\n if((\"vf-OS.frontendUri\" in entryAsset.labels) &&\n (entryAsset.labels[\"frontendUri\"] !== \"\")){ // It is a vApp\n\n // Put stats data in historyDB\n locRef = {obj: historyDB, objName:\"runningVAssets\"};\n addStatsToHistory(locRef, newStats);\n\n // Add Asset Info To History\n historyDB.runningVAssets[entryStats.name].assetDetails = tempAssets[k];\n\n } else { // If it does not have a url put it in \"Supporting Library Containers\" table\n\n // Put stats data in historyDB\n locRef = {obj: historyDB, objName:\"notRunningVAssets\"};\n addStatsToHistory(locRef, newStats);\n\n // add Asset Info To History\n historyDB.notRunningVAssets[entryStats.name].assetDetails = tempAssets[k];\n }\n\n } else { // Put it in Others Containers tables\n\n // Put stats data in historyDB\n locRef = {obj: historyDB, objName:\"otherContainers\"};\n addStatsToHistory(locRef, newStats);\n\n // Add Asset Info To History\n historyDB.otherContainers[entryStats.name].assetDetails = tempAssets[k];\n }\n\n break; // Go to next asset\n }\n }\n }\n\n // remove all data from all sets\n removeOldData();\n\n // check if it is necessary to change units scale\n changeDataScales();\n\n // reset temp variables\n tempStats = undefined;\n tempAssets = undefined;\n}", "function crearTablaAuditoriaInspeccionesAscensores(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE auditoria_inspecciones_ascensores (k_codusuario,k_codinspeccion,o_consecutivoinsp,o_estado_envio,o_revision,v_item_nocumple,k_codcliente,k_codinforme,k_codusuario_modifica,o_actualizar_inspeccion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores auditoria...Espere\");\n console.log('transaction creada ok');\n });\n}", "async init() {\n const { rows } = await this.client.db.query(`SELECT * FROM \"${this.table}\"`);\n for(const row of rows) this.cache.set(row.id, row);\n }", "function changeMutationInvolvesRow(index) {\n\t\t\tconsole.log(\"changeMutationInvolvesRow: \" + index);\n\n\t\t\tvm.selectedMIIndex = index;\n\n\t\t\tif (vm.apiDomain.mutationInvolves[index] == null) {\n\t\t\t\tvm.selectedMIIndex = 0;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (vm.apiDomain.mutationInvolves[index].processStatus == \"x\") {\n\t\t\t\tvm.apiDomain.mutationInvolves[index].processStatus = \"u\";\n\t\t\t};\n }", "function doInsertAuditList(client,data)\n{\n\tglobal.ConsoleLog(\"doInsertAuditList\");\n\tglobal.ConsoleLog(data.audit_nameid);\n\tglobal.ConsoleLog(data.audit_typeid);\n\treturn new Promise((resolve, reject) => {\n\n\t\tconst shouldAbort = err => {\n\t\t\tif (err) {\n\t\t\t\tconsole.error('Error in transaction', err.stack);\n\t\t\t\tclient.query('ROLLBACK', err => {\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\tconsole.error('Error rolling back client', err.stack);\n\t\t\t\t\t}\n\t\t\t\t\t// release the client back to the pool\n\t\t\t\t\t//done();\n\t\t\t\t});\n\n\t\t\t\treject(err.message);\n\t\t\t}\n\t\t\treturn !!err;\n\t\t};\n\n\t\tclient.query('BEGIN', err =>{\n\t\t\tif (shouldAbort(err)) \n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlet insertSql =\n\t\t\t\t\t\t'INSERT INTO scanapp_testing_audit(products_id,customers_id,locations_id,status_id,productcategories_id,audit_nameid,audit_typeid,datefinished,userscreated_id) ' +\n\t\t\t\t\t\t'SELECT p1.id,p1.customers_id,p1.locations1_id,p1.status_id,productcategories_id,'+data.audit_nameid+', ' + data.audit_typeid +',now(),$2 FROM scanapp_testing_products p1 WHERE p1.dateexpired IS NULL' +\n\t\t\t\t\t\t' AND p1.id = $1 '+\n\t\t\t\t\t\t'returning id';\n\t\n\t\t\t\tlet params = [\n\t\t\t\t\tdata.productid,\n\t\t\t\t\tdata.user_id\t\n\t\t\t\t];\n\t\t\t\tglobal.ConsoleLog(insertSql);\n\t\t\t\tglobal.ConsoleLog(params);\n\t\t\t\tclient.query(insertSql, params, (err, result) => {\n\t\t\t\t\tif (shouldAbort(err)) return;\n\t\t\t\t\tglobal.ConsoleLog(insertSql);\n\t\t\t\t\tglobal.ConsoleLog(params);\n\t\t\t\t\tglobal.ConsoleLog(err);\n\t\t\t\t\tglobal.ConsoleLog(result);\n\t\t\t\t\tclient.query('COMMIT', err => {\n\t\t\t\t\t\t// done();\n\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\tconsole.error('Error committing transaction', err.stack);\n\t\t\t\t\t\t\treject(err);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresolve(result.rows[0]);\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\t\n\t\t});\n\t});\n}", "function onQuerySucceeded(sender, args) {\n var listEnumerator = collListItem.getEnumerator();\n while (listEnumerator.moveNext()) {\n\n //update array\n var oListItem = listEnumerator.get_current();\n //save the number of lines to be deleted\n deleteLineArray[count] = oListItem.get_id();\n //count number of rows in list\n \n var total = 0;\n array[count] = new Array(14);\n array[count][1] = oListItem.get_item('Project');\n array[count][2] = oListItem.get_item('Date1');\n array[count][3] = oListItem.get_item('Recipient');\n array[count][4] = oListItem.get_item('Description1');\n array[count][5] = oListItem.get_item('Province');\n array[count][6] = oListItem.get_item('ExpensesType');\n array[count][7] = oListItem.get_item('Amount');\n array[count][8] = oListItem.get_item('Tip');\n array[count][9] = oListItem.get_item('TPS');\n array[count][10] = oListItem.get_item('TVQ');\n array[count][11] = oListItem.get_item('Total');\n array[count][12] = oListItem.get_item('ExchangeRate');\n array[count][13] = oListItem.get_item('TotalAfterRate');\n\n //total += array[count][j];\n \n //array[count][3] = total;\n sumCol += array[count][11];\n count++;\n }\n //Call this function to build the empty table.\n \n SP.SOD.executeFunc('sp.js', 'SP.ClientContext', lookupProject);\n \n}", "function LineItemCache($q, $log, _) {\n\t\tvar cache = this;\n\t\tcache.isValid = false;\n\t\tvar isAllItemsValid = false;\n\n\t\tvar allItemsList = [];\n\t\tvar allPrimaryItemsList = [];\n\t\tvar allItemsByPrimaryLineNumber = {};\n\t\tvar allItemSOsByPrimaryLineNumber = {};\n\t\t\n\t\tvar mainLineItemCollection = new LineItemCollection();\n\n\t\tvar assetKey = 1;\n\t\tvar tempAssetActions = [];\n\t\tvar pendingAssetActions = {};\n\t\tvar pricePendingInfo = {\n\t\t\tIsPricePending: true\n\t\t};\n\n\t\tcache.getLineItems = getLineItems;\n\t\tcache.getLineItem = getLineItem;\n\t\tcache.getLineItemSOsByPrimaryLineNumber = getLineItemSOsByPrimaryLineNumber;\n\t\tcache.getLineItemsByPrimaryLineNumber = getLineItemsByPrimaryLineNumber;\n\t\tcache.getChargePrimaryLines = getChargePrimaryLines;\n\t\tcache.getLineItemDOChanges = getLineItemDOChanges;\n\t\tcache.refreshAllItemsList = refreshAllItemsList;\n\t\tcache.getSize = getSize;\n\t\tcache.putLineItemDOs = putLineItemDOs;\n\t\tcache.removeLineItems = removeLineItems;\n\t\tcache.putAssetActions = putAssetActions;\n\t\tcache.getAssetActions = getAssetActions;\n\t\tcache.clearAssetActions = clearAssetActions;\n\t\tcache.getAssetKey = getAssetKey;\n\t\tcache.setAssetKey = setAssetKey;\n\t\tcache.putPendingAssetAction = putPendingAssetAction;\n\t\tcache.getPendingAssetActions = getPendingAssetActions;\n\t\tcache.clearPendingAssetActions = clearPendingAssetActions;\n\t\tcache.putPricePendingInfo = putPricePendingInfo;\n\t\tcache.getIsPricePending = getIsPricePending;\n\n\t\t/* - Method declarations - */\n\n\t\t/**\n\t\t * Return the map of primary lines by their primary line number\n\t\t * includes option lines also.\n\t\t * @return {map of line items}\n\t\t */\n\t\tfunction getLineItemsByPrimaryLineNumber() {\n\t\t\tif (!isAllItemsValid) {\n\t\t\t\trefreshAllItemsList();\n\n\t\t\t}\n\t\t\treturn allItemsByPrimaryLineNumber;\n\n\t\t}\n\n\t\t/**\n\t\t * Return the array of items in all states. \n\t\t * If called multiple times, this will only have to concat\n\t\t * \tall the items into a list once.\n\t\t * @return {array of line items}\n\t\t */\n\t\tfunction getLineItemSOsByPrimaryLineNumber() {\n\t\t\tif (!isAllItemsValid) {\n\t\t\t\trefreshAllItemsList();\n\n\t\t\t}\n\t\t\treturn allItemSOsByPrimaryLineNumber;\n\n\t\t}\n\n\t\t/**\n\t\t * Return the array of items in all states. \n\t\t * If called multiple times, this will only have to concat\n\t\t * \tall the items into a list once.\n\t\t * @return {array of line items}\n\t\t */\n\t\tfunction getLineItems() {\n\t\t\tif (!isAllItemsValid) {\n\t\t\t\trefreshAllItemsList();\n\n\t\t\t}\n\t\t\treturn allItemsList;\n\n\t\t}\n\n\t\t/**\n\t\t * Return the array of primary lines\n\t\t * @return {array of line items}\n\t\t */\n\t\tfunction getChargePrimaryLines () {\n\t\t\tif (!isAllItemsValid) {\n\t\t\t\trefreshAllItemsList();\n\n\t\t\t}\n\t\t\treturn allPrimaryItemsList;\n\n\t\t}\n\n\t\t/** Get a line item in the cache by PLN */\n\t\tfunction getLineItem(primaryLineNumber) {\n\t\t\treturn mainLineItemCollection.getLineItem(primaryLineNumber);\n\n\t\t}\n\t\t/** Return a deep copy of pending changes */\n\t\tfunction getLineItemDOChanges() {\n\t\t\tvar lines = mainLineItemCollection.getLineItems(true);\n\t\t\tvar linesWithChanges = [];\n\t\t\t_.forEach(lines, function (nextLineModel) {\n\t\t\t\tvar changeResult = nextLineModel.getLineItemDOChanges();\n\t\t\t\tif (changeResult) {\n\t\t\t\t\tlinesWithChanges.push(changeResult);\n\n\t\t\t\t}\n\n\t\t\t});\n\t\t\treturn linesWithChanges;\n\n\t\t}\n\n\t\t/**\n\t\t * Pull line items into flat array from map collection.\n\t\t * @return {list of line items} \n\t\t */\n\t\tfunction refreshAllItemsList() {\n\t\t\tif (!cache.isValid) {\n\t\t\t\tallItemsList = [];\n\t\t\t\tallPrimaryItemsList = [];\n\t\t\t\tallItemsByPrimaryLineNumber = {};\n\t\t\t\tallItemSOsByPrimaryLineNumber = {};\n\t\t\t\treturn allItemsList;\n\n\t\t\t}\n\t\t\tallItemsList = mainLineItemCollection.getLineItems();\n\t\t\t//store items by primary line #\n\t\t\t(function populatePrimaryLineMap(items) {\n\t\t\t\t_.forEach(items, function (chargeLine) {\n\t\t\t\t\tif(chargeLine.isSelected()) {\n\t\t\t\t\t\tvar lineItemSO = chargeLine.lineItemSO();\t\n\t\t\t\t\t\tvar primaryLineNumber = chargeLine.primaryLineNumber();\n\t\t\t\t\t\tallItemSOsByPrimaryLineNumber[primaryLineNumber] = lineItemSO;\n\t\t\t\t\t\tallItemsByPrimaryLineNumber[primaryLineNumber] = chargeLine;\n\t\t\t\t\t\tallPrimaryItemsList.push(chargeLine);\n\n\t\t\t\t\t\tif(chargeLine.optionLines.length) {\n\t\t\t\t\t\t\tpopulatePrimaryLineMap(chargeLine.optionLines);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t})(allItemsList);\n\n\t\t\treturn allItemsList;\n\t\t}\n\n\t\tfunction getSize() {\n\t\t\tif (!cache.isValid) {\n\t\t\t\treturn 0;\n\n\t\t\t}\n\t\t\treturn mainLineItemCollection.size;\n\n\t\t}\n\t\tfunction putLineItemDOs(lineItemDOArray, createModelFn) {\n\t\t\tisAllItemsValid = false;\n\t\t\tlineItemDOArray = [].concat(lineItemDOArray);\n\t\t\tcache.isValid = cache.isValid || !!lineItemDOArray;\n\t\t\tmainLineItemCollection.putLineItemDOs(lineItemDOArray, createModelFn);\n\t\t\treturn cache;\n\n\t\t}\n\t\tfunction removeLineItems(itemArray, forceDelete) {\n\t\t\tif (angular.isUndefined(itemArray)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tisAllItemsValid = false;\n\t\t\titemArray = [].concat(itemArray);\n\t\t\tvar anyItem = false;\n\t\t\t_.forEach(itemArray, function (nextItem) {\n\t\t\t\t//mark item for delete\n\t\t\t\tanyItem = mainLineItemCollection.deleteItem(nextItem, forceDelete) || anyItem; \n\t\t\t});\n\t\t\treturn anyItem;\n\n\t\t}\n\t\tfunction putPricePendingInfo(pendingInfoObject) {\n\t\t\tif (pendingInfoObject) {\n\t\t\t\tpricePendingInfo = pendingInfoObject;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tpricePendingInfo = null;\n\n\t\t\t}\n\t\t\treturn pricePendingInfo;\n\n\t\t}\n\t\tfunction getIsPricePending() {\n\t\t\tif (pricePendingInfo) {\n\t\t\t\treturn pricePendingInfo.IsPricePending;\n\n\t\t\t} else {\n\t\t\t\t//If price pending info isn't valid, check line items\n\t\t\t\treturn _.some(getLineItems(), function (nextItem) {\n\t\t\t\t\treturn nextItem && nextItem.isPricePending();\n\n\t\t\t\t});\n\n\t\t\t}\n\n\t\t}\n\n\t\t/** Managing asset actions */\n\n\t\tfunction putAssetActions(actions) {\n\t\t\ttempAssetActions = (tempAssetActions || []).concat(actions);\n\t\t}\n\t\t\n\t\tfunction getAssetActions() {\n\t\t\treturn tempAssetActions;\n\t\t}\n\n\t\tfunction clearAssetActions() {\n\t\t\ttempAssetActions = [];\n\t\t}\n\t\t\n\t\tfunction getAssetKey() {\n\t\t\treturn assetKey;\n\t\t}\n\n\t\tfunction setAssetKey(value) {\n\t\t\tassetKey = value;\n\t\t}\n\n\t\tfunction putPendingAssetAction(hashKey, actions) {\n\t\t\tpendingAssetActions[hashKey] = actions;\n\t\t}\n\n\n\t\tfunction getPendingAssetActions(hashKey) {\n\t\t\treturn pendingAssetActions[hashKey];\n\t\t}\n\n\t\tfunction clearPendingAssetActions(hashKey) {\n\t\t\tdelete pendingAssetActions[hashKey];\n\t\t}\n\t\n\t\t/** --------------------------------------------------------------------- */\n\t\t/** --------------------------------------------------------------------- */\n\n\t\t/**\n\t\t * Constructor for making a set specifically for line items. This lets\n\t\t * \tus try out different ways of hashing and merging line items to keep\n\t\t * \tthe DO's on the client side in sync with the server responses.\n\t\t * \t\n\t\t * @param {array} initItems [items to add to the set immediately.]\n\t\t */\n\n\t\tfunction LineItemCollection(initItems) {\n\t\t\tvar itemCollection = this;\n\t\t\tvar items = new Object(null);\n\t\t\tvar txnPrimaryLineNumberMap = new Object(null);\n\t\t\tvar hash = hashLineNumber;\n\t\t\t\n\t\t\titemCollection.size = 0;\n\n\t\t\titemCollection.getLineItem = getLineItem;\n\t\t\titemCollection.getLineItems = getLineItems;\n\t\t\titemCollection.hasLineItem = hasLineItem;\n\t\t\titemCollection.putLineItemDO = putLineItemDO;\n\t\t\titemCollection.putLineItemDOs = putLineItemDOs;\n\t\t\titemCollection.deleteItem = deleteItem;\n\n\t\t\tputLineItemDOs(initItems);\n\n\t\t\t/**\n\t\t\t * Maintain a consistent hash that identifies each line item. To do this,\n\t\t\t * \t\ta mapping between the line item's primary line number and it's txn\n\t\t\t * \t\tprimary line number is maintained.\n\t\t\t * \t\t\n\t\t\t * @param {[type]} lineItemDO item\n\t\t\t * @return {number} hash value\n\t\t\t */\n\t\t\tfunction hashLineNumber(lineItemOrNumber) {\n\t\t\t\tvar itemKey = isValidKey(lineItemOrNumber) ? lineItemOrNumber : lineItemOrNumber.txnPrimaryLineNumber;\n\t\t\t\tvar mappedVal = txnPrimaryLineNumberMap[itemKey];\n\t\t\t\treturn mappedVal ? mappedVal : itemKey;\n\n\t\t\t}\n\n\t\t\tfunction mergeLineItemWithDO(lineItemModel, lineItemDO) {\n\t\t\t\tlineItemModel.mergeLineItemDO(lineItemDO);\n\t\t\t\tvar actualPLN = lineItemModel.primaryLineNumber();\n\t\t\t\tif (lineItemModel.txnPrimaryLineNumber != actualPLN) {\n\t\t\t\t\ttxnPrimaryLineNumberMap[lineItemModel.txnPrimaryLineNumber] = actualPLN;\n\t\t\t\t\t// lineItemModel.txnPrimaryLineNumber = actualPLN;\n\t\t\t\t\treturn actualPLN;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\treturn lineItemModel.txnPrimaryLineNumber;\n\n\t\t\t}\n\n\t\t\tfunction hasLineItem(itemOrKey) {\n\t\t\t\tvar itemKey;\n\t\t\t\tif (isValidKey(itemOrKey)) {\n\t\t\t\t\tvar mappedVal = txnPrimaryLineNumberMap[txnPLN];\n\t\t\t\t\titemKey = mappedVal ? mappedVal : itemOrKey;\n\n\t\t\t\t} else {\n\t\t\t\t\titemKey = hash(itemOrKey);\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\treturn !!(items[itemKey]);\n\n\t\t\t}\n\t\t\tfunction getLineItem(itemOrKey) {\n\t\t\t\tvar itemKey = hash(itemOrKey);\n\t\t\t\tvar lineItem = items[itemKey];\n\t\t\t\tif (!lineItem) {\n\t\t\t\t\t//Loop accross item until matching child is found\n\t\t\t\t\t_.some(items, function (nextItem) {\n\t\t\t\t\t\tlineItem = nextItem.getOptionLine(itemKey);\n\t\t\t\t\t\treturn !!lineItem;\t\t\t\t\t\t\n\n\t\t\t\t\t});\n\n\t\t\t\t}\n\t\t\t\treturn lineItem;\n\n\t\t\t}\n\t\t\tfunction getLineItems(includeUnselected) {\n\t\t\t\tvar nextItem;\n\t\t\t\tvar allItems = [];\n\t\t\t\t_.forOwn(items, function (nextItem, key) {\n\t\t\t\t\tif (includeUnselected || nextItem.isSelected()) {\n\t\t\t\t\t\tallItems.push(nextItem);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t});\n\t\t\t\t// allItems.sort(compareLineItemSequence);\n\t\t\t\treturn allItems;\n\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Add the line item DO to the cache. \n\t\t\t * Use callback function to return Line Item Model representation\n\t\t\t * @param lineItemDO the line item DO\n\t\t\t * @return the line item model structure\n\t\t\t */\n\t\t\tfunction putLineItemDO(lineItemDO, createModelFn) {\n\t\t\t\tvar itemHash;\n\t\t\t\tif (lineItemDO) {\n\t\t\t\t\titemHash = hash(lineItemDO);\n\n\t\t\t\t}\n\t\t\t\tif (isValidKey(itemHash)) {\n\t\t\t\t\tvar existingModel = items[itemHash];\n\t\t\t\t\tif (!angular.isDefined(existingModel)) {\n\t\t\t\t\t\titems[itemHash] = createModelFn(lineItemDO);\n\t\t\t\t\t\titemCollection.size += 1;\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmergeLineItemWithDO(existingModel, lineItemDO);\n\t\t\t\t\t\tvar newHash = hash(existingModel);\n\t\t\t\t\t\tif (isValidKey(newHash) && newHash != itemHash) {\n\t\t\t\t\t\t\t$log.debug('Merge rehash: ', newHash, existingModel);\n\t\t\t\t\t\t\t// What if there is already a value at items[newHash]?\n\t\t\t\t\t\t\titems[newHash] = existingModel;\n\t\t\t\t\t\t\tdelete items[itemHash];\n\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} else {\n\t\t\t\t\t$log.error('Failed to hash', lineItemDO);\n\n\t\t\t\t}\n\t\t\t\treturn itemCollection;\n\n\t\t\t}\n\t\t\tfunction putLineItemDOs(allItems, createModelFn) {\n\t\t\t\tif (allItems) {\n\t\t\t\t\tfor (var i = 0; i < allItems.length; i += 1) {\n\t\t\t\t\t\tputLineItemDO(allItems[i], createModelFn);\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\treturn itemCollection;\n\n\t\t\t}\n\t\t\tfunction deleteItem(itemOrKey, forceDelete) {\n\t\t\t\tvar itemKey = isValidKey(itemOrKey) ? itemOrKey : hash(itemOrKey);\n\t\t\t\tvar hasPendingItem = false;\n\t\t\t\tif (isValidKey(itemKey) && items[itemKey]) {\n\t\t\t\t\tif (forceDelete) {\n\t\t\t\t\t\titems[itemKey].deselect();\n\t\t\t\t\t\titemCollection.size --;\n\t\t\t\t\t\tdelete items[itemKey];\n\n\t\t\t\t\t} else if (items[itemKey].deselect()) {\n\t\t\t\t\t\titemCollection.size --;\n\t\t\t\t\t\thasPendingItem = true;\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//If item was already deslected, remove it from collection\n\t\t\t\t\t\tdelete items[itemKey];\n\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} \n\t\t\t\treturn hasPendingItem;\n\n\t\t\t}\n\n\t\t\tfunction isValidKey(potentialKey) {\n\t\t\t\tvar keyType = typeof potentialKey;\n\t\t\t\treturn keyType === 'string' || keyType === 'number';\n\n\t\t\t}\n\n\t\t}\n\n\t}", "function reviseStock() {\n var table = getCurrentTable();\n if (table === \"error\") return;\n var dic = table.item_id;\n Object.entries(dic).forEach(([key, value]) => {\n changeStock(key, -value);\n })\n}", "function crearTablaAscensorItemsPozo(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_items_pozo(k_coditem_pozo, v_item, o_descripcion, v_clasificacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\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 crearTablaAscensorItemsCabina(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_items_cabina (k_coditem_cabina, v_item, o_descripcion, v_clasificacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function insert_order() {\n var ss = SpreadsheetApp.getActiveSpreadsheet();\n var copySheet = ss.getSheetByName(DASHBOARD_V2_SHEET);\n var pasteSheet = ss.getSheetByName(ARCHIVE_SHEET);\n var lock = LockService.getScriptLock(); \n\n lock.waitLock(4000); // lock 4 seconds\n // Getting all values from sheet form\n var source = [];\n source.push([copySheet.getRange(\"D34\").getValues()]);\n source.push([copySheet.getRange(\"D35\").getValues()]);\n source.push([copySheet.getRange(\"D36\").getValues()]);\n source.push([copySheet.getRange(\"D37\").getValues()]);\n source.push([copySheet.getRange(\"D41\").getValues()]);\n source.push([copySheet.getRange(\"D38\").getValues()]);\n source.push('EUR');\n source.push([copySheet.getRange(\"D40\").getValues()]);\n source.push([copySheet.getRange(\"D39\").getValues()]);\n source.push([copySheet.getRange(\"D44\").getValues()]);\n source.push([copySheet.getRange(\"E44\").getValues()]);\n source.push([copySheet.getRange(\"D42\").getValues()]);\n source.push([copySheet.getRange(\"E42\").getValues()]);\n source.push([copySheet.getRange(\"D43\").getValues()]);\n source.push([copySheet.getRange(\"E43\").getValues()]);\n source.push([copySheet.getRange(\"D45\").getValues()]); //RiskReward ratio\n source.push([copySheet.getRange(\"D46\").getValues()]);\n source.push([copySheet.getRange(\"D47\").getValues()]);\n source.push([copySheet.getRange(\"D48\").getValues()]); //Venduto a\n source.push([copySheet.getRange(\"D50\").getValues()]);\n source.push([copySheet.getRange(\"D49\").getValues()]);\n source.push([copySheet.getRange(\"D51\").getValues()]);\n source.push([copySheet.getRange(\"E51\").getValues()]);\n source.push([copySheet.getRange(\"D52\").getValues()]);\n source.push([copySheet.getRange(\"D53\").getValues()]);\n source.push([copySheet.getRange(\"D54\").getValues()]);\n source.push([copySheet.getRange(\"D55\").getValues()]);\n source.push([copySheet.getRange(\"C56:E56\").getValues()]);\n\n // Get last row on archive sheet\n var currentRow = pasteSheet.getLastRow()\n\n // setting a particular formula on first column ID i\n var sourceFormulas = pasteSheet.getRange(currentRow,1).getFormulasR1C1(); //formula copy\n currentRow++; //goto next row\n var targetRange = pasteSheet.getRange(currentRow, 1);\n targetRange.setFormulasR1C1(sourceFormulas); //pasting formula\n\n // Now setting values cell per cell\n for (var i = 0; i < source.length; i++) {\n pasteSheet.getRange(currentRow,i+2).setValue(source[i]);\n }\n\n //Copy formatting to last row from reference row\n formatting_row(ARCHIVE_SHEET, currentRow)\n\n lock.releaseLock();\n\n // clear source values\n //source.clearContent();\n\n //Browser.msgBox('Success copy!');\n}", "function doUpdateAuditList(client,auditid)\n{\n\tglobal.ConsoleLog(\"doUpdateAuditList\");\n\treturn new Promise((resolve, reject) => {\n\t\tconst shouldAbort = err => {\n\t\t\tif (err) {\n\t\t\t\tconsole.error('Error in transaction', err.stack);\n\t\t\t\tclient.query('ROLLBACK', err => {\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\tconsole.error('Error rolling back client', err.stack);\n\t\t\t\t\t}\n\t\t\t\t\t// release the client back to the pool\n\t\t\t\t\t//done();\n\t\t\t\t});\n\n\t\t\t\treject(err.message);\n\t\t\t}\n\t\t\treturn !!err;\n\t\t};\n\n\t\tclient.query('BEGIN', err => {\n\t\t\tif (shouldAbort(err)) return;\n\t\t\tlet updatesql =\n\t\t\t\t'UPDATE scanapp_testing_audit ' + \n\t\t\t\t'SET datefinished=now() '+\n\t\t\t\t'where id = $1 '+\n\t\t\t\t'returning datefinished,products_id,status_id ';\n\t\t\tlet params = [\n\t\t\t\tauditid\t\n\t\t\t];\n\t\t\tclient.query(updatesql, params, (err, result) => {\n\t\t\t\tglobal.ConsoleLog(updatesql);\n\t\t\t\tglobal.ConsoleLog(params);\n\t\t\t\tglobal.ConsoleLog(err);\n\t\t\t\tglobal.ConsoleLog(result);\n\t\t\t\tif (shouldAbort(err)) return;\n\n\t\t\t\tclient.query('COMMIT', err => {\n\t\t\t\t\t// done();\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\tconsole.error('Error committing transaction', err.stack);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tglobal.ConsoleLog(result.rows[0]['datefinished']);\n\t\t\t\t\t\tresult.rows[0]['datefinished'] = global.moment(result.rows[0]['datefinished']).format('YYYY-MM-DD HH:mm');\n\t\t\t\t\t\t// let datefinished = global.moment(result.rows[0]['datefinished']).format('YYYY-MM-DD HH:mm');\n\t\t\t\t\t\t// global.ConsoleLog(datefinished);\n\t\t\t\t\t\tresolve(result.rows[0]);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t});\n}", "function lowinventory() {\n console.log(\"Low inventory items: \");\n var tableLow = new Table({\n head: ['Item ID', 'Product Name', 'Quantity']\n });\n connection.query(\"SELECT item_id, product_name, stock_quantity FROM products WHERE stock_quantity <= 5\", function (err, res) {\n for (let j = 0; j < res.length; j++) {\n tableLow.push(\n [res[j].item_id, res[j].product_name, res[j].stock_quantity]\n );\n }\n console.log(tableLow.toString());\n console.log('\\n*******************');\n managerOptions();\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}", "__onLayout(e, key) {\n const {\n height,\n } = e.nativeEvent.layout;\n const {\n onItemPlaced,\n } = this.props;\n this.requestAnimationFrame(() => {\n const {\n items,\n } = this.state;\n const heights = this.__getColumnHeights(\n this.props,\n this.state,\n );\n const item = this.props.items\n .filter((item) => item.key === key)[0];\n const parentKeys = this.props.items\n .map(({ key }) => key);\n const minHeight = Math.min(...heights);\n const column = heights.indexOf(minHeight);\n this.setState(\n {\n // XXX: Here, alongside updating the item position,\n // we also clean out any keys which are no longer\n // referenced by the parent.\n items: Object.entries({\n ...items,\n [key]: {\n height,\n column,\n },\n })\n .filter((entry) => {\n return parentKeys.indexOf(entry[0]) >= 0;\n })\n .reduce(\n (obj, entry) => {\n return ({\n ...obj,\n [entry[0]]: entry[1],\n });\n },\n {},\n ),\n },\n () => {\n return onItemPlaced(\n item,\n );\n },\n );\n });\n }", "getAllDataplanes ({ commit }) {\n const getDataplanes = async () => {\n return new Promise(async (resolve, reject) => {\n const result = []\n const states = []\n\n const dataplanes = await api.getAllDataplanes()\n const items = await dataplanes.items\n\n for (let i = 0; i < items.length; i++) {\n const itemName = items[i].name\n const itemMesh = items[i].mesh\n\n const itemStatus = await api.getDataplaneOverviewsFromMesh(itemMesh, itemName)\n .then(response => {\n const items = response.dataplaneInsight.subscriptions\n\n if (items && items.length > 0) {\n for (let i = 0; i < items.length; i++) {\n const connectTime = items[i].connectTime\n const disconnectTime = items[i].disconnectTime\n\n if (connectTime && connectTime.length && !disconnectTime) {\n return 'Online'\n }\n }\n }\n\n return 'Offline'\n })\n\n // create the full data array\n result.push({\n status: itemStatus,\n name: itemName,\n mesh: itemMesh\n })\n }\n\n // create a simple flat status object with booleans for checking\n // if any dataplanes are offline\n for (let i = 0; i < Object.values(result).length; i++) {\n const statusVal = Object.values(result[i])[0]\n const isOnline = !(statusVal === 'Offline' || statusVal === 'offline')\n\n states.push(isOnline)\n }\n\n // if any of the dataplanes return false for being online\n // commit this so we can check against it\n const anyDpOffline = states.some(i => i === false)\n\n commit('SET_ANY_DP_OFFLINE', anyDpOffline)\n\n // commit the total list of dataplanes\n commit('SET_TOTAL_DP_LIST', result)\n\n // resolve the promise\n resolve()\n })\n }\n\n return getDataplanes()\n }", "function lowInventory() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if(err) throw err;\n var table = new Table({\n head: ['Item ID', 'Product', 'Price', 'Quantity']\n , colWidths: [20, 21, 25, 17]\n });\n for (var i = 0; i < res.length; i++) {\n if (res[i].stock_quantity < 5) {\n table.push(\n [res[i].item_id, res[i].product_name, res[i].price, res[i].stock_quantity]\n );\n }\n\n }\n console.log(table.toString());\n console.log(\"\\n\");\n continueManaging();\n })\n \n}", "syncUI() {\n super.syncUI();\n if (this.listViewItem) {\n var item = this.listViewItem;\n var columns = this.getColumns();\n for (var i = 0; i < columns.length; i++) {\n var s = columns[i];\n if (!item.columns[i]) {\n item.addColumn(this.getColumnWithFor(s));\n }\n item.setItem(i, this.getItemForColumn(s));\n }\n }\n }", "addDataToLedger({state, commit}, {csvBill, csvCategory}) {\n const csvId = state.counters['csvId'] + 1;\n commit('setCounter', {counterName: 'csvId', id: csvId});\n commit('pushCsvToLedgers', {csvBill, csvCategory, id: csvId});\n let ledger = getCsvLedgerById(state, csvId);\n if (ledger) {\n commit('setMonthTable',{ledger});\n }\n const nextTableId = state.counters['tableId'] + 1;\n commit('setCounter', {counterName: 'tableId', id: nextTableId});\n commit('pushFilteredLedgerToTable', {csvId: csvId, nextTableId: nextTableId, isSource: true});\n }", "async downloadAndCommitNewItemsOf(commitingItem, con) {\n if (!this.processingState.canContinue)\n return;\n\n let ids = [];\n let hashes = [];\n for (let newItem of commitingItem.newItems) {\n ids.push(newItem.id);\n\n // we are looking for updatingItem's parent subscriptions and want to update it\n if (newItem.state.parent != null)\n hashes.push(newItem.state.parent);\n\n // we are looking for updatingItem's subscriptions by origin\n hashes.push(newItem.getOrigin());\n }\n\n // The record may not exist due to ledger desync too, so we create it if need\n let rs = await this.node.ledger.arrayFindOrCreate(ids, ItemState.PENDING, 0, con);\n let i = 0;\n\n let hashesWithSubscriptions = await this.node.ledger.getItemsWithSubscriptions(hashes, con);\n\n for (let newItem of commitingItem.newItems) {\n //TODO: synchronize all items in transaction\n await this.node.lock.synchronize(newItem.id, async () => {\n let r = rs[i];\n i++;\n\n await r.approve(con, newItem.getExpiresAt(), false, true);\n\n //save newItem to DB in Permanet mode\n if (this.node.config.permanetMode)\n await this.node.ledger.putKeptItem(r, newItem, con);\n\n let newExtraResult = {};\n // if new item is smart contract node calls method onCreated or onUpdated\n if (newItem instanceof NSmartContract) {\n if (this.negativeNodes.has(this.node.myInfo))\n this.addItemToResync(this.itemId, this.record);\n else {\n newItem.nodeInfoProvider = this.node.nodeInfoProvider;\n\n let ime = await this.node.getEnvironmentByContract(newItem, con);\n ime.nameCache = this.node.nameCache;\n let me = ime.getMutable();\n\n if (newItem.state.revision === 1) {\n // and call onCreated\n newExtraResult.onCreatedResult = await this.item.onCreated(me);\n } else {\n newExtraResult.onUpdateResult = await this.item.onUpdated(me);\n\n new ScheduleExecutor(async () => await this.node.callbackService.synchronizeFollowerCallbacks(me.id),\n 1000, this.node.executorService).run();\n }\n\n await me.save(con);\n }\n }\n\n // update new item's smart contracts link to\n await this.notifyContractSubscribers(newItem, r.state, hashesWithSubscriptions, con);\n\n let result = ItemResult.fromStateRecord(r);\n result.extra = newExtraResult;\n if (this.node.cache.get(r.id) == null)\n this.node.cache.put(newItem, result, r);\n else\n this.node.cache.update(r.id, result);\n });\n\n new ScheduleExecutor(() => this.node.checkSpecialItem(this.item), 100, this.node.executorService).run();\n\n await this.downloadAndCommitNewItemsOf(newItem, con);\n }\n }", "function crearTablaEscalerasItemsPreliminar(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE escaleras_items_preliminar(k_coditem, o_descripcion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function exclusiveUpdate(conn, data, cb) {\n //begin transaction\n db.transaction(conn, function(conn, cb) {\n //loop data for update optimistic lock\n cps.pfor(data.length, function(i, cb){\n //run method sequential\n cps.seq([\n function(_, cb) {\n //lock row by id\n Items.Table.lockById(conn, data[i].id, cb);\n },\n function(row, cb) {\n //calculate stock\n value = row._data.stock - data[i].quantity;\n\n /*update quantity\n if update error will be rollback\n if update no error will be commit\n */\n row.update(conn, {'stock': value}, cb);\n },\n function(res, cb) {\n cb();\n }\n ], cb);\n }, cb);\n }, cb);\n}", "function exclusiveUpdate(conn, data, cb) {\n //begin transaction\n db.transaction(conn, function(conn, cb) {\n //loop data for update optimistic lock\n cps.pfor(data.length, function(i, cb){\n //run method sequential\n cps.seq([\n function(_, cb) {\n //lock row by id\n Items.Table.lockById(conn, data[i].id, cb);\n },\n function(row, cb) {\n //calculate stock\n value = row._data.stock - data[i].quantity;\n\n /*update quantity\n if update error will be rollback\n if update no error will be commit\n */\n row.update(conn, {'stock': value}, cb);\n },\n function(res, cb) {\n cb();\n }\n ], cb);\n }, cb);\n }, cb);\n}", "function updateItems() {\n hn.newest(function(err, items) {\n _.each(items, function(item) {\n redis.del(config.redis.prev + item.id);\n redis.del(config.redis.prev + item.id + ':info');\n redis.exists(config.redis.prev + item.id, function(err, exists) {\n\n if(err)\n return console.error(err);\n\n if(!exists)\n request(item.url, function(err, res, body) {\n console.log(item);\n redis.set(config.redis.prev + item.id.toString(), body, function (err) {\n if(err)\n return console.error(err);\n console.log(item.id + ' : ' + item.title + ' : Cached');\n });\n redis.set(config.redis.prev + item.id.toString() + ':info', JSON.stringify(item), function (err) {\n if(err) console.error(err);\n });\n });\n });\n });\n });\n}", "async fetchAllRowsAndWriteIntoLocalFile() {\n\t\t\tconst oThis = this;\n\n\t\t\tlet lastProcessTime = await oThis.fetchLastProcessTime();\n\n\t\t\tconsole.info(oThis.model.tableName, \"- lastProcessTime-\", lastProcessTime);\n\n\t\t\tlet r = await oThis.fetchTotalRowCountAndMaxUpdated({lastProcessTime: lastProcessTime});\n\n\n\t\t\tlet totalRowCount = r[0].totalRowCount || 0;\n\t\t\tlet maxUpdatedAtStr = r[0].maxUpdatedAt || lastProcessTime;\n\n\t\t\tconsole.info(oThis.model.tableName, \"- totalRowCount-\", totalRowCount);\n\t\t\tconsole.info(oThis.model.tableName, \"- maxUpdatedAtStr-\", maxUpdatedAtStr);\n\n\t\t\tif (totalRowCount == 0){\n\t\t\t\treturn responseHelper.successWithData({hasRows: false});\n\t\t\t}\n\n\t\t\tshell.mkdir(\"-p\", oThis.localDirFullFilePath);\n\n\t\t\tlet perBatchSize = Math.ceil(totalRowCount/(oThis.mysqlLimit * oThis.parallelProcessCount));\n\n\t\t\tlet startOffset = 0;\n\t\t\tlet endOffset = 0;\n\n\t\t\tlet promiseArray = [];\n\t\t\tfor(let batchNumber=1; batchNumber <= oThis.parallelProcessCount; batchNumber++){\n\t\t\t\tendOffset = startOffset + (oThis.mysqlLimit * perBatchSize);\n\t\t\t\tlet params = {\n\t\t\t\t\tstartOffset: startOffset, endOffset: endOffset,\n\t\t\t\t\tlastProcessTime: lastProcessTime, batchNumber: batchNumber\n\t\t\t\t};\n\t\t\t\tlet r = oThis.fetchDetailsAndWriteIntoLocalFile(params);\n\t\t\t\tpromiseArray.push(r);\n\t\t\t\tif(endOffset >= totalRowCount){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tstartOffset = endOffset;\n }\n\n await Promise.all(promiseArray).catch((err)=>{\n \treturn Promise.reject(err);\n\t\t\t});\n\t\t\treturn responseHelper.successWithData({hasRows: true, maxUpdatedAtStr: maxUpdatedAtStr});\n\t }", "function lowInventory() {\n connection.query(\n \"SELECT * FROM products WHERE stock_quantity < 10\", function(err,res) {\n if (err) throw err;\n //Use cli-table\n let table = new Table ({\n //Create Headers\n head: ['ID','PRODUCT','DEPARTMENT','PRICE','STOCK'],\n colWidths: [7, 50, 25, 15, 10]\n });\n for (let i = 0; i < res.length; i++) {\n table.push([res[i].item_id,res[i].product_name,res[i].department_name,\"$ \" + res[i].price,res[i].stock_quantity]);\n }\n console.log(table.toString() + \"\\n\");\n managerChoices();\n }\n )\n}", "async commit() {\n const { keyValueMap } = this.checkpoints.pop();\n if (!this.isCheckpoint) {\n // This was the final checkpoint, we should now commit and flush everything to disk\n const batchOp = [];\n keyValueMap.forEach(function (value, key) {\n if (value === null) {\n batchOp.push({\n type: 'del',\n key: Buffer.from(key, 'binary'),\n });\n }\n else {\n batchOp.push({\n type: 'put',\n key: Buffer.from(key, 'binary'),\n value,\n });\n }\n });\n await this.batch(batchOp);\n }\n else {\n // dump everything into the current (higher level) cache\n const currentKeyValueMap = this.checkpoints[this.checkpoints.length - 1].keyValueMap;\n keyValueMap.forEach((value, key) => currentKeyValueMap.set(key, value));\n }\n }", "function updateItemsPuertasValoresElectrica(k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion) {\n $('#texto_carga').text('Guardando datos electrica...Espere');\n db.transaction(function (tx) {\n var query = \"UPDATE puertas_valores_electrica SET n_calificacion = ?,\"+\n \"v_calificacion = ?,\"+\n \"o_observacion = ? \"+\n \"WHERE k_codusuario = ? \"+\n \"AND k_codinspeccion = ? \"+\n \"AND k_coditem = ?\"; \n tx.executeSql(query, [n_calificacion,v_calificacion,o_observacion,k_codusuario,k_codinspeccion,k_coditem], function(tx, res) {\n console.log(\"rowsAffected puertas_valores_electrica: \" + res.rowsAffected);\n },\n function(tx, error) {\n console.log('UPDATE error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "function incrKey(remote, table_name) {\n const meta_key = keyEncoding.table(table_name);\n return kv.runT(remote, function(tx) {\n return kv.get(tx, meta_key).then(meta => {\n const pk_value = meta.current_pk_value;\n return kv.put(\n tx,\n meta_key,\n Object.assign(meta, {\n current_pk_value: pk_value + 1\n })\n );\n });\n });\n}", "function calculateInventory() {\n // var query = \"UPDATE products SET stock_quantity = quantity WHERE item_id = productId\";\n var query = \"UPDATE products SET stock_quantity = stock_quantity-\" + quantity + \" WHERE item_id = \" + productId;\n connection.query(query, function (err, res) {\n })\n setTimeout(viewInventory, 1500);\n setTimeout(purchaseQuestions, 2000);\n}", "function crearTablaAscensorItemsPreliminar(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_items_preliminar(k_coditem_preli, o_descripcion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function updateItemsPuertasValoresPreliminar(k_codusuario,k_codinspeccion,coditem_preli, calificacion,observacion) {\n db.transaction(function (tx) {\n var query = \"UPDATE puertas_valores_preliminar SET v_calificacion = ?,\"+\n \"o_observacion = ? \"+\n \"WHERE k_codusuario = ? \"+\n \"AND k_codinspeccion = ? \"+\n \"AND k_coditem_preli = ?\"; \n tx.executeSql(query, [calificacion,observacion,k_codusuario,k_codinspeccion,coditem_preli], function(tx, res) {\n console.log(\"rowsAffected updateItemsPuertasValoresPreliminar: \" + res.rowsAffected);\n },\n function(tx, error) {\n console.log('UPDATE error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "function doCheckAuditList(client,data)\n{\n\tglobal.ConsoleLog(\"doCheckAuditList\");\n\treturn new Promise((resolve, reject) => {\n\t\tconst shouldAbort = err => {\n\t\t\tif (err) {\n\t\t\t\tconsole.error('Error in transaction', err.stack);\n\t\t\t\tclient.query('ROLLBACK', err => {\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\tconsole.error('Error rolling back client', err.stack);\n\t\t\t\t\t}\n\t\t\t\t\t// release the client back to the pool\n\t\t\t\t\t// done();\n\t\t\t\t});\n\t\n\t\t\t\treject(err.message);\n\t\t\t}\n\t\t\treturn !!err;\n\t\t};\n\t\n\t\tclient.query('BEGIN', err => {\n\t\t\tif (shouldAbort(err)) return;\n\t\t\tlet selectsql =\n\t\t\t\t'select a1.id,a1.products_id,a1.audit_nameid,a1.audit_typeid,a1.datefinished,p1.barcode ,p1.name,p1.comments,' +\n\t\t\t\t'p1.description,p1.serial_number,p1.status_id,s1.name status,' + \n\t\t\t\t'p1.locations1_id,l1.name locations,'+\n\t\t\t\t'p1.productcategories_id,c1.name category '+\n\t\t\t\t'from scanapp_testing_audit a1 ' +\n\t\t\t\t'left join scanapp_testing_products p1 on (p1.id = a1.products_id) ' + \n\t\t\t\t'left join scanapp_testing_productcategories c1 on (c1.id = p1.productcategories_id) '+\n\t\t\t\t'left join scanapp_testing_locations l1 on (l1.id = p1.locations1_id) '+\n\t\t\t\t'left join scanapp_testing_statuses s1 on (s1.id = p1.status_id) '+\n\t\t\t\t'where p1.barcode = $1 '+\n\t\t\t\t'and a1.dateexpired is null ' +\n\t\t\t\t// 'and a1.datefinished is null ' +\n\t\t\t\t'and a1.userscreated_id =$2' + \n\t\t\t\t'and a1.customers_id =$3';\n\t\t\tlet params = [\n\t\t\t\t__.sanitiseAsString(data.barcode, 50),\n\t\t\t\tdata.user_id,\t\n\t\t\t\tdata.customers_id\n\t\t\t];\n\t\t\tclient.query(selectsql, params, (err, result) => {\n\t\t\t\t// global.ConsoleLog(selectsql);\n\t\t\t\t// global.ConsoleLog(params);\n\t\t\t\t// global.ConsoleLog(err);\n\t\t\t\t// global.ConsoleLog(result);\n\t\t\t\tif (shouldAbort(err)) return;\n\t\t\t\tclient.query('COMMIT', err => {\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\tconsole.error('Error committing transaction', err.stack);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tglobal.ConsoleLog(result.rows[0]);\n\t\t\t\t\t\tresolve(result.rows);\t\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});\n\n}", "function updateItemsPuertasValoresMecanicos(k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion) {\n $('#texto_carga').text('Guardando datos mecanicos...Espere');\n db.transaction(function (tx) {\n var query = \"UPDATE puertas_valores_mecanicos SET n_calificacion = ?,\"+\n \"v_calificacion = ?,\"+\n \"o_observacion = ? \"+\n \"WHERE k_codusuario = ? \"+\n \"AND k_codinspeccion = ? \"+\n \"AND k_coditem = ?\"; \n tx.executeSql(query, [n_calificacion,v_calificacion,o_observacion,k_codusuario,k_codinspeccion,k_coditem], function(tx, res) {\n console.log(\"rowsAffected puertas_valores_mecanicos: \" + res.rowsAffected);\n },\n function(tx, error) {\n console.log('UPDATE error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "function updateDbWithClusterCsv(db) {\n var clusterInsertCounter = 0;\n let clusterReader = require('readline').createInterface({\n input: require('fs').createReadStream('tools/data/sample/keurig/C-Metrics-Cluster.csv')\n });\n\n //INDIVIDUAL_ID,HOUSEHOLD_ID,FIRST_NAME,LAST_NAME,RFV Score_2016,Age,Gender,MaritalStatus,Life Stage,RFV Score_2015\n\n\n clusterReader.on('line', function (line) {\n let cluster = {};\n let fieldArray = line.split(',');\n let individualId = fieldArray[0];\n cluster['RFV Score'] = fieldArray[4];\n cluster['Age'] = parseInt(fieldArray[5]) || 0;\n cluster['Life Stage'] = fieldArray[8];\n cluster['RFV'] = Utils.getRFV(fieldArray[4]);\n\n\t\tvar rfvOld = Utils.getRFV(fieldArray[9]);\n\t\t// if(!rfvOld) {\n\t\t// \trfvOld = RFV_CLUSTERS[Math.round(Math.random()*5)];\n\t\t// }\n\n cluster['RFV Score-2015'] = fieldArray[9];\n cluster['RFV-2015'] = rfvOld;\n if(fieldArray[6] === 'Young Singles') {\n cluster['children_in_household'] = false;\n } else {\n var randomChildInHouse = Math.round(Math.random()*1);\n cluster['children_in_household'] = (randomChildInHouse === 0) ? false : true;\n }\n db.customers.findAndModify({\n query: { INDIVIDUAL_ID: individualId },\n update: { $set: cluster }\n }).then(function(doc) {\n clusterReader.resume();\n clusterInsertCounter += 1;\n if(clusterInsertCounter === 10000) {\n console.log('Inserted all cluster records. \\nInserting dashboard data');\n updateDbWithDashboardCsv(db);\n }\n });\n\n clusterReader.pause();\n });\n\n clusterReader.on('close', function() {\n // updateDbWithDashboardCsv(db);\n console.log('updating started .... please wait ... ');\n });\n\n // let dashboardReader = require('readline').createInterface({\n // input: require('fs').createReadStream('tools/data/sample/keurig/C-Metrics-Dashboard.csv')\n // });\n // dashboardReader.on('line', function (line) {\n // let dashboard = {};\n // let fieldArray = line.split(',');\n // let individualId = fieldArray[0];\n // console.log(\"dashboard individual id: \"+ individualId);\n // dashboard['Potential_Score'] = fieldArray[5];\n // dashboard['Potential'] = fieldArray[6];\n // dashboard['Total Sales'] = fieldArray[7];\n // dashboard['Q1 Sales'] = fieldArray[8];\n // dashboard['Q2 Sales'] = fieldArray[9];\n // dashboard['Q3 sales'] = fieldArray[10];\n // dashboard['Q4 Sales'] = fieldArray[11];\n //\n // db.customers.findAndModify({\n // query: { INDIVIDUAL_ID: individualId },\n // update: { $set: dashboard }\n // }).then(function(doc) {\n // dashboardReader.resume();\n // });\n //\n // dashboardReader.pause();\n // });\n\n}", "renderAssetStatusTable() {\n\t\t// intialize row variables\n\t\tlet inStock = 0;\n\t\tlet outStock = 0;\n\t\tlet damaged = 0;\n\t\tlet total = 0;\n\n\t\t// summation variables\n\t\tlet totalInStock = 0;\n\t\tlet totalOutStock = 0;\n\t\tlet totalDamaged = 0;\n\t\tlet totalOfTotal = 0;\n\n\t\treturn (\n\t\t\t<Segment>\n\t\t\t\t<Label as=\"a\" color=\"orange\" ribbon>\n\t\t\t\t\t<Icon name=\"shopping basket\" />Asset Summery\n\t\t\t\t</Label>\n\t\t\t\t<Table color=\"orange\" celled unstackable definition striped>\n\t\t\t\t\t<Table.Header>\n\t\t\t\t\t\t<Table.Row>\n\t\t\t\t\t\t\t<Table.HeaderCell>\n\t\t\t\t\t\t\t\t<Icon name=\"tv\" color=\"grey\" /> Asset-Type\n\t\t\t\t\t\t\t</Table.HeaderCell>\n\t\t\t\t\t\t\t<Table.HeaderCell>\n\t\t\t\t\t\t\t\t<Icon name=\"download\" color=\"green\" /> In stock\n\t\t\t\t\t\t\t</Table.HeaderCell>\n\t\t\t\t\t\t\t<Table.HeaderCell>\n\t\t\t\t\t\t\t\t<Icon name=\"upload\" color=\"purple\" /> Out of Stock\n\t\t\t\t\t\t\t</Table.HeaderCell>\n\t\t\t\t\t\t\t<Table.HeaderCell>\n\t\t\t\t\t\t\t\t<Icon name=\"ban\" color=\"red\" /> Damaged\n\t\t\t\t\t\t\t</Table.HeaderCell>\n\t\t\t\t\t\t\t<Table.HeaderCell>\n\t\t\t\t\t\t\t\t<Icon name=\"plus\" color=\"orange\" /> Total\n\t\t\t\t\t\t\t</Table.HeaderCell>\n\t\t\t\t\t\t</Table.Row>\n\t\t\t\t\t</Table.Header>\n\t\t\t\t\t<Table.Body>\n\t\t\t\t\t\t{this.state.allAssetTypes.map((asset, idx) => {\n\t\t\t\t\t\t\t// get the values of row data\n\t\t\t\t\t\t\tinStock = this.getInStock(idx);\n\t\t\t\t\t\t\toutStock = this.getOutStock(idx);\n\t\t\t\t\t\t\tdamaged = this.getDamaged(idx);\n\t\t\t\t\t\t\ttotal = this.getInStock(idx) + this.getOutStock(idx) + this.getDamaged(idx);\n\t\t\t\t\t\t\t// set summation variables\n\t\t\t\t\t\t\ttotalInStock += inStock;\n\t\t\t\t\t\t\ttotalOutStock += outStock;\n\t\t\t\t\t\t\ttotalDamaged += damaged;\n\t\t\t\t\t\t\ttotalOfTotal += total;\n\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<Table.Row key={asset.id} style={{ cursor: 'pointer' }}>\n\t\t\t\t\t\t\t\t\t<Table.Cell>\n\t\t\t\t\t\t\t\t\t\t<Icon name=\"triangle right\" color=\"grey\" />\n\t\t\t\t\t\t\t\t\t\t{asset.type_name}\n\t\t\t\t\t\t\t\t\t</Table.Cell>\n\t\t\t\t\t\t\t\t\t{inStock > 0 ? (\n\t\t\t\t\t\t\t\t\t\t<Table.Cell selectable onClick={this.inStockCellOnClick.bind(this, idx, asset)}>\n\t\t\t\t\t\t\t\t\t\t\t<a>{inStock}</a>\n\t\t\t\t\t\t\t\t\t\t</Table.Cell>\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t<Table.Cell disabled>{inStock}</Table.Cell>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t{/* <Table.Cell selectable={outStock>0}><a>{outStock}</a></Table.Cell> */}\n\t\t\t\t\t\t\t\t\t{/* rendering problem when cell is selectable */}\n\t\t\t\t\t\t\t\t\t{outStock > 0 ? (\n\t\t\t\t\t\t\t\t\t\t<Table.Cell\n\t\t\t\t\t\t\t\t\t\t\tselectable\n\t\t\t\t\t\t\t\t\t\t\tonClick={this.outStockCellOnClick.bind(this, idx, asset)}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<a>{outStock}</a>\n\t\t\t\t\t\t\t\t\t\t</Table.Cell>\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t<Table.Cell disabled>{outStock}</Table.Cell>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t{damaged > 0 ? (\n\t\t\t\t\t\t\t\t\t\t<Table.Cell\n\t\t\t\t\t\t\t\t\t\t\tselectable\n\t\t\t\t\t\t\t\t\t\t\tonClick={this.damagedStockCellOnClick.bind(this, idx, asset)}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<a>{damaged}</a>\n\t\t\t\t\t\t\t\t\t\t</Table.Cell>\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t<Table.Cell disabled>{damaged}</Table.Cell>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t<Table.Cell>{total}</Table.Cell>\n\t\t\t\t\t\t\t\t</Table.Row>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})}\n\t\t\t\t\t</Table.Body>\n\t\t\t\t\t<Table.Footer fullWidth>\n\t\t\t\t\t\t<Table.Row>\n\t\t\t\t\t\t\t<Table.HeaderCell>\n\t\t\t\t\t\t\t\t<Icon name=\"instock\" />\n\t\t\t\t\t\t\t\t<strong>TOTAL</strong>\n\t\t\t\t\t\t\t\t<Icon name=\"chevron right\" />\n\t\t\t\t\t\t\t</Table.HeaderCell>\n\t\t\t\t\t\t\t<Table.HeaderCell>{totalInStock}</Table.HeaderCell>\n\t\t\t\t\t\t\t<Table.HeaderCell>{totalOutStock}</Table.HeaderCell>\n\t\t\t\t\t\t\t<Table.HeaderCell>{totalDamaged}</Table.HeaderCell>\n\t\t\t\t\t\t\t<Table.HeaderCell>{totalOfTotal}</Table.HeaderCell>\n\t\t\t\t\t\t</Table.Row>\n\t\t\t\t\t</Table.Footer>\n\t\t\t\t</Table>\n\t\t\t\t<Statistic.Group>\n\t\t\t\t\t<Statistic>\n\t\t\t\t\t\t<Statistic.Value>{totalInStock}</Statistic.Value>\n\t\t\t\t\t\t<Statistic.Label>In Stock</Statistic.Label>\n\t\t\t\t\t</Statistic>\n\t\t\t\t\t<Statistic>\n\t\t\t\t\t\t<Statistic.Value>{totalOutStock}</Statistic.Value>\n\t\t\t\t\t\t<Statistic.Label>Out of Stock</Statistic.Label>\n\t\t\t\t\t</Statistic>\n\t\t\t\t\t<Statistic>\n\t\t\t\t\t\t<Statistic.Value>{totalDamaged}</Statistic.Value>\n\t\t\t\t\t\t<Statistic.Label>Damaged</Statistic.Label>\n\t\t\t\t\t</Statistic>\n\t\t\t\t\t<Statistic>\n\t\t\t\t\t\t<Statistic.Value>{totalOfTotal}</Statistic.Value>\n\t\t\t\t\t\t<Statistic.Label>Total</Statistic.Label>\n\t\t\t\t\t</Statistic>\n\t\t\t\t</Statistic.Group>\n\t\t\t</Segment>\n\t\t);\n\t}", "function updateItemsPuertasValoresMotorizacion(k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion) {\n $('#texto_carga').text('Guardando datos motorizacion...Espere');\n db.transaction(function (tx) {\n var query = \"UPDATE puertas_valores_motorizacion SET n_calificacion = ?,\"+\n \"v_calificacion = ?,\"+\n \"o_observacion = ? \"+\n \"WHERE k_codusuario = ? \"+\n \"AND k_codinspeccion = ? \"+\n \"AND k_coditem = ?\"; \n tx.executeSql(query, [n_calificacion,v_calificacion,o_observacion,k_codusuario,k_codinspeccion,k_coditem], function(tx, res) {\n console.log(\"rowsAffected puertas_valores_motorizacion: \" + res.rowsAffected);\n },\n function(tx, error) {\n console.log('UPDATE error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "refreshFromRowOnStoreAdd(row, {\n isExpand\n }) {\n const args = arguments;\n this.runWithTransition(() => {\n // Postpone drawing of events for a new resource until the following project refresh. Previously the draw\n // would not happen because engine was not ready, but now when we allow commits and can read values during\n // commit that block is no longer there\n this.currentOrientation.suspended = !isExpand;\n super.refreshFromRowOnStoreAdd(row, ...args);\n this.currentOrientation.suspended = false;\n }, !isExpand);\n }", "function renderBuildLineAllocationTable(element, build_line, options={}) {\n\n let output = options.output || 'untracked';\n let tableId = `allocation-table-${output}-${build_line.pk}`;\n\n // Construct a table element\n let html = `\n <div class='sub-table'>\n <table class='table table-condensed table-striped' id='${tableId}'></table>\n </div>`;\n\n element.html(html);\n\n let sub_table = $(`#${tableId}`);\n\n // Load the allocation items into the table\n sub_table.bootstrapTable({\n data: build_line.allocations,\n showHeader: false,\n columns: [\n {\n field: 'part',\n title: '{% trans \"Part\" %}',\n formatter: function(_value, row) {\n let html = imageHoverIcon(row.part_detail.thumbnail);\n html += renderLink(row.part_detail.full_name, `/part/${row.part_detail.pk}/`);\n return html;\n }\n },\n {\n field: 'quantity',\n title: '{% trans \"Allocated Quantity\" %}',\n formatter: function(_value, row) {\n let text = '';\n let url = '';\n let serial = row.serial;\n\n if (row.stock_item_detail) {\n serial = row.stock_item_detail.serial;\n }\n\n if (serial && row.quantity == 1) {\n text = `{% trans \"Serial Number\" %}: ${serial}`;\n } else {\n text = `{% trans \"Quantity\" %}: ${row.quantity}`;\n if (row.part_detail && row.part_detail.units) {\n text += ` <small>${row.part_detail.units}</small>`;\n }\n }\n\n var pk = row.stock_item || row.pk;\n\n url = `/stock/item/${pk}/`;\n\n return renderLink(text, url);\n }\n },\n {\n field: 'location',\n title: '{% trans \"Location\" %}',\n formatter: function(value, row) {\n if (row.location_detail) {\n let text = shortenString(row.location_detail.pathstring);\n let url = `/stock/location/${row.location_detail.pk}/`;\n\n return renderLink(text, url);\n } else {\n return '<i>{% trans \"No location set\" %}</i>';\n }\n }\n },\n {\n field: 'actions',\n title: '',\n formatter: function(value, row) {\n let buttons = '';\n buttons += makeEditButton('button-allocation-edit', row.pk, '{% trans \"Edit stock allocation\" %}');\n buttons += makeDeleteButton('button-allocation-delete', row.pk, '{% trans \"Delete stock allocation\" %}');\n return wrapButtons(buttons);\n }\n }\n ]\n });\n\n // Callbacks\n $(sub_table).on('click', '.button-allocation-edit', function() {\n let pk = $(this).attr('pk');\n\n constructForm(`{% url \"api-build-item-list\" %}${pk}/`, {\n fields: {\n quantity: {},\n },\n title: '{% trans \"Edit Allocation\" %}',\n onSuccess: function() {\n $(options.parent_table).bootstrapTable('refresh');\n },\n });\n });\n\n $(sub_table).on('click', '.button-allocation-delete', function() {\n let pk = $(this).attr('pk');\n\n constructForm(`{% url \"api-build-item-list\" %}${pk}/`, {\n method: 'DELETE',\n title: '{% trans \"Remove Allocation\" %}',\n onSuccess: function() {\n $(options.parent_table).bootstrapTable('refresh');\n },\n });\n });\n}", "addToInventory(userInput){\n // Get DB info of the item selected\n this.connection.queryAsync('SELECT * FROM products WHERE item_id = ?', [userInput.choice])\n .then(queryItem => {\n // UPDATE Inventory\n this.connection.queryAsync('UPDATE products SET stock_quantity = stock_quantity + ? WHERE item_id = ? LIMIT 1', [userInput.quantity, userInput.choice])\n .then(() => {\n\n let newTotal = parseInt(userInput.quantity) + queryItem[0].stock_quantity;\n\n console.log(`\\nInventory update was successful!\\nNew inventory is ${newTotal}`);\n\n })// Close DB connection\n .then(this.connection.end())\n .catch((err) => console.log(err))\n \n }).catch((err) => console.log(err));\n }", "addToColumnsAffected(assocHex){\n if(!this.columnsAffected[assocHex.index.col]){\n this.columnsAffected[assocHex.index.col] = [];\n }\n this.columnsAffected[assocHex.index.col].push(assocHex.index.row);\n }", "function updateItemsPuertasValoresManiobras(k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion) {\n $('#texto_carga').text('Guardando datos maniobras...Espere');\n db.transaction(function (tx) {\n var query = \"UPDATE puertas_valores_maniobras SET n_calificacion = ?,\"+\n \"v_calificacion = ?,\"+\n \"o_observacion = ? \"+\n \"WHERE k_codusuario = ? \"+\n \"AND k_codinspeccion = ? \"+\n \"AND k_coditem = ?\"; \n tx.executeSql(query, [n_calificacion,v_calificacion,o_observacion,k_codusuario,k_codinspeccion,k_coditem], function(tx, res) {\n console.log(\"rowsAffected puertas_valores_maniobras: \" + res.rowsAffected);\n },\n function(tx, error) {\n console.log('UPDATE error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "function SupplierTotalOrderRevenueAccDate(dbName, start_date, end_date, supplierId) {\n return new Promise(async (resolve, reject) => {\n let final_result=[],result=[],count = 0,temp;\n var sql1 = \" select id from supplier_branch where supplier_id = ? \"\n let get_branch = await ExecuteQ.Query(dbName,sql1,[supplierId])\n let total=0,commision_given_to_admin=0,order_ids,order_data,reveneu_data,agentConnection={},ary,agent_order_data;\n\n for(const [index1,j] of get_branch.entries()){\n order_data=await supplierProfitAfterTaxCommissionAccDate(dbName,j.id,start_date,end_date);\n order_ids=order_data.order_ids;\n reveneu_data=order_data.revenue_data\n logger.debug(\"=====order==Data==>>\",reveneu_data)\n if(order_ids && order_ids.length>0){\n let getAgentDbData=await common.GetAgentDbInformation(dbName); \n // logger.debug(\"===AGENT==CONNECTION==>>==2=\",Object.entries(agentConnection).length);\n if(Object.entries(agentConnection).length===0){\n agentConnection=await common.RunTimeAgentConnection(getAgentDbData);\n }\n let a_sql=\"select IFNULL(DAYOFWEEK(`co`.`created_on`),0) as week_day,IFNULL(DATE(`co`.`created_on`),0) as created_at,\"+\n \" IFNULL(sum(co.commission_ammount),0) AS total_revenue\"+\n \" from cbl_user_orders co join cbl_user cu on cu.id=co.user_id where DATE(created_on) >='\"+start_date+\"'\"+\n \" and DATE(co.created_on) <= '\"+end_date+\"' and co.order_id IN(\"+order_ids+\") and cu.supplier_id=0 group by DATE(co.created_on) \"\n agent_order_data=await ExecuteQ.QueryAgent(agentConnection,a_sql,[]);\n logger.debug(\"======AGENT==ORDER==>>\",agent_order_data)\n if(reveneu_data && reveneu_data.length>0){\n for(const [rindex,j] of reveneu_data.entries()){\n temp = {\n week_day : j.week_day,\n created_at : j.created_at,\n total_revenue : j.total_revenue\n }\n if(agent_order_data && agent_order_data.length>0){\n for(const [aindex,k] of agent_order_data.entries()){\n if(k.created_at==j.created_at){\n // logger.debug(\"====MATCH===\",k.total_revenue)\n temp.total_revenue= temp.total_revenue-k.total_revenue\n }\n }\n }\n final_result.push(temp)\n }\n }\n }\n \n } \n resolve(final_result)\n \n \n // multiConnection[dbName].query(sql1, [supplierId], function (err, result1) {\n // var sql = \"SELECT IFNULL(DAYOFWEEK(`created_on`),0) as week_day,IFNULL(DATE(`created_on`),0) as created_at,IFNULL(SUM(supplier_commision),0) as total_revenue from orders where created_on >='\" + start_date + \"' and created_on <= '\" + end_date + \"' and supplier_branch_id = ? and status = 5 \"\n // if (result1.length) {\n // for (var i = 0; i < result1.length; i++) {\n // (function (i) {\n // multiConnection[dbName].query(sql, [result1[i].id], function (err, result) {\n // if (err) {\n // reject(err)\n // }\n // let temp;\n // if(result[0].total_revenue){\n // temp = {\n // week_day : result[0].week_day,\n // created_at : result[0].created_at,\n // total_revenue : result[0].total_revenue\n // }\n // final_result.push(temp)\n // }\n // if (i == result1.length - 1) {\n // resolve(final_result);\n // }\n // });\n // })(i);\n // }\n // }\n // else {\n // resolve(final_result)\n // }\n // });\n\n })\n}", "function LineItems(_ref) {\n var theme = _ref.theme,\n data = _ref.data;\n\n return _react2.default.createElement(\n TableTag,\n { theme: theme },\n _react2.default.createElement(\n HeadTag,\n null,\n _react2.default.createElement(\n RowTag,\n { theme: theme },\n _react2.default.createElement(\n HeaderTag,\n { theme: theme },\n 'Name'\n ),\n _react2.default.createElement(\n HeaderTag,\n { theme: theme },\n 'SKU'\n ),\n _react2.default.createElement(\n HeaderTag,\n { theme: theme },\n 'QTY'\n ),\n _react2.default.createElement(\n HeaderTag,\n { theme: theme },\n 'Item Price'\n ),\n _react2.default.createElement(\n HeaderTag,\n { theme: theme },\n 'Sub-Total'\n )\n )\n ),\n _react2.default.createElement(\n BodyTag,\n null,\n data.items.map(function (x) {\n return _react2.default.createElement(\n RowTag,\n { theme: theme, key: x.id },\n _react2.default.createElement(\n DataTag,\n { theme: theme },\n x.name\n ),\n _react2.default.createElement(\n DataTag,\n { theme: theme },\n x.sku\n ),\n _react2.default.createElement(\n DataTag,\n { theme: theme, right: true },\n x.qty\n ),\n _react2.default.createElement(\n DataTag,\n { theme: theme, right: true },\n x.itemPrice\n ),\n _react2.default.createElement(\n DataTag,\n { theme: theme, right: true },\n x.subTotal\n )\n );\n }),\n _react2.default.createElement(\n RowTag,\n null,\n _react2.default.createElement(DataTag, { theme: theme, noBorder: true }),\n _react2.default.createElement(DataTag, { theme: theme, noBorder: true }),\n _react2.default.createElement(DataTag, { theme: theme, noBorder: true }),\n _react2.default.createElement(\n DataTag,\n { theme: theme, right: true, bold: true },\n 'Sub-Total'\n ),\n _react2.default.createElement(\n DataTag,\n { theme: theme, right: true, bold: true },\n data.grandTotal\n )\n )\n )\n );\n}", "forkTableLedger({state, commit}, {csvId, tableId, filters}) {\n const nextTableId = state.counters['tableId'] + 1;\n commit('setCounter', {counterName: 'tableId', id: nextTableId});\n commit('pushFilteredLedgerToTable', {csvId: csvId, nextTableId: nextTableId, tableId: tableId, isSource: false, filters});\n }", "setMonthTable(state, {ledger}) {\n ledger.bill.forEach(e => {\n let item = {year: e.year, month: e.month, monthKey: e.monthKey};\n if(e.month && e.year && ledger.monthTable.findIndex(i => (i.year === e.year && i.month === e.month)) < 0) {\n ledger.monthTable.push(item);\n }\n });\n }", "function agg(){\n\tvar db;\n\t\n\tdb = window.openDatabase('mydb', '1.0', 'TestDB', 2 * 1024 * 1024);\n\t\n\t\n\tdb.transaction(function (tx) {\n tx.executeSql('CREATE TABLE IF NOT EXISTS TestiV2 (id unique, id_traduzione, italiano, inglese, francese, spagnolo)');\n\t\t\t\t \n tx.executeSql('DELETE FROM TestiV2', [], function (tx, results) {\n }, null);\n\t\n\t});\n\t\n\tagg2()\n\n}", "function postSource_restoreLine(type, name) {\n\n\tif (type == 'item' && name == 'item') {\n\n\t\ttry {\n\t\t\t//Get committed line values\n\t\t\tvar lineNum = nlapiGetCurrentLineItemIndex(type);\n\t\t\tvar qty = nlapiGetLineItemValue(type, 'quantity', lineNum);\n\t\t\tvar stDescription = nlapiGetLineItemValue(type, 'description', lineNum);\n\t\t\tvar curRate = nlapiGetLineItemValue(type, 'rate', lineNum);\n\t\t\tvar departmentId = nlapiGetLineItemValue(type, 'department', lineNum);\n\t\t\tvar classId = nlapiGetLineItemValue(type, 'class', lineNum);\n\t\t\tvar customerId = nlapiGetLineItemValue(type, 'customer', lineNum);\n\t\t\tvar capX = nlapiGetLineItemValue(type, 'custcol_capex_spec', lineNum);\n\t\t\tvar isBillable = nlapiGetLineItemValue(type, 'isbillable', lineNum);\n\t\t\tvar dteExRcpt = nlapiGetLineItemValue(type, 'expectedreceiptdate', lineNum);\n\t\t\tvar catNum = nlapiGetLineItemValue(type, 'custcol_catalog_num', lineNum); //added\n\n\t\t\t//Set new values after item change post sourcing if values not null\n\t\t\tif (qty != null && qty != '') {\n\t\t\t\tnlapiSetCurrentLineItemValue(type, 'quantity', qty, false);\n\t\t\t}\n\n\t\t\tif (stDescription != '' && stDescription != null) {\n\t\t\t\tnlapiSetCurrentLineItemValue(type, 'description', stDescription, false);\n\t\t\t}\n\t\t\tif (curRate != null && curRate != '') {\n\t\t\t\tnlapiSetCurrentLineItemValue(type, 'rate', curRate, false);\n\t\t\t}\n\t\t\tif (departmentId != null && departmentId != '') {\n\t\t\t\tnlapiSetCurrentLineItemValue(type, 'department', departmentId, false);\n\t\t\t}\n\t\t\tif (classId != null && classId != '') {\n\t\t\t\tnlapiSetCurrentLineItemValue(type, 'class', classId, false);\n\t\t\t}\n\t\t\tif (customerId != null && customerId != '') {\n\t\t\t\tnlapiSetCurrentLineItemValue(type, 'customer', customerId, false);\n\t\t\t}\n\t\t\tif (isBillable == 'T') {\n\t\t\t\tnlapiSetCurrentLineItemValue(type, 'isbillable', isBillable, false);\n\t\t\t}\n\t\t\tif (dteExRcpt != null && dteExRcpt != '') {\n\t\t\t\tnlapiSetCurrentLineItemValue(type, 'expectedreceiptdate', dteExRcpt, false);\n\t\t\t}\n\t\t\tif (capX != null && capX != '') {\n\t\t\t\tnlapiSetCurrentLineItemValue(type, 'custcol_capex_spec', isCapX, false);\n\t\t\t}\n\t\t\tif (catNum != null && catNum != '') {\n\t\t\t\tnlapiSetCurrentLineItemValue(type, 'custcol_catalog_num', catNum, false);\n\t\t\t}\n\n\t\t} catch (e) {\n\t\t\tnlapiLogExecution('ERROR', 'unexpected error restoring previous line values', e.toString());\n\t\t}\n\t}\n}", "addToCart({commit}) { \n commit('setCartItemsLocal');\n }", "function updateItemsPuertasValoresIniciales(n_cliente,n_equipo,n_empresamto,o_desc_puerta,o_tipo_puerta,o_motorizacion,o_acceso,o_accionamiento,o_operador,o_hoja,o_transmision,o_identificacion,f_fecha,v_ancho,v_alto,v_codigo,o_consecutivoinsp,ultimo_mto,inicio_servicio,ultima_inspeccion,h_hora,tipo_informe, k_codusuario,k_codinspeccion) {\n $('#texto_carga').text('Guardando datos iniciales...Espere');\n db.transaction(function (tx) {\n var query = \"UPDATE puertas_valores_iniciales SET n_cliente = ?,\"+\n \"n_equipo = ?,\"+\n \"n_empresamto = ?,\"+\n \"o_desc_puerta = ?,\"+\n \"o_tipo_puerta = ?,\"+\n \"o_motorizacion = ?,\"+\n \"o_acceso = ?,\"+\n \"o_accionamiento = ?,\"+\n \"o_operador = ?,\"+\n \"o_hoja = ?,\"+\n \"o_transmision = ?,\"+\n \"o_identificacion = ?,\"+\n \"f_fecha = ?,\"+\n \"v_ancho = ?,\"+\n \"v_alto = ?,\"+\n \"v_codigo = ?,\"+\n \"o_consecutivoinsp = ?,\"+\n \"ultimo_mto = ?,\"+\n \"inicio_servicio = ?,\"+\n \"ultima_inspeccion = ?,\"+\n \"h_hora = ?,\"+\n \"o_tipo_informe = ? \"+\n \"WHERE k_codusuario = ? \"+\n \"AND k_codinspeccion = ?\";\n tx.executeSql(query, [n_cliente,n_equipo,n_empresamto,o_desc_puerta,o_tipo_puerta,o_motorizacion,o_acceso,o_accionamiento,o_operador,o_hoja,o_transmision,o_identificacion,f_fecha,v_ancho,v_alto,v_codigo,o_consecutivoinsp,ultimo_mto,inicio_servicio,ultima_inspeccion,h_hora,tipo_informe, k_codusuario,k_codinspeccion], function(tx, res) {\n console.log(\"rowsAffected: \" + res.rowsAffected);\n },\n function(tx, error) {\n console.log('UPDATE error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "render(){\n let lines = this.props.lines;\n let inv = cloneDeep(this.props.invoices);\n\n return(\n <div>\n <table className=\"table table-bordered table-hover\">\n <thead>\n <tr>\n {(() => {\n if (!this.props.readOnly) {\n return <th><input type=\"checkbox\" disabled/></th>\n }\n return null;\n })()}\n <th>Item</th>\n <th>Description</th>\n <th>Car plate#</th>\n <th>From</th>\n <th>To</th>\n <th>Period</th>\n <th>Amount</th>\n </tr>\n </thead>\n\n <tbody>\n {(() => {\n if (lines) {\n return (\n lines.map((item, key) => {\n let codeName = '';\n let invId = {};\n\n if (inv[0]) {\n invId = inv[0]._id;\n codeName = inv[0].codeName;\n inv[0].numb--;\n if (inv[0].numb === 0) inv.splice(0, 1);\n }\n \n return (\n <LineTabRow key={`line-${key}`}\n invId={invId}\n codeName={codeName}\n onSelect={this.changeSelectedItem.bind(null,item)}\n line={item}\n onSave={this.handleSaveLine}\n selectedListId={this.state.selectedListId}\n isEdit={this.state.isEdit}\n cars={this.props.cars}\n readOnly={this.props.readOnly}/>\n )\n }))\n }\n return undefined\n })()}\n </tbody>\n </table>\n </div>\n )\n }", "async function addPayment(acc, row, index) {\n\n console.log(\"Processing row:\", index, \"...\");\n try {\n console.log(\"Adding payments for pid:\", row[0], \"...\");\n let commandSet = [];\n let paymentIssues = {};\n let dataIssues = {};\n\n let pidData = {pid: row[0]};\n let pidDataF = Object.assign ({fromPayments: 1}, pidData);\n // matches a property node by pid \n //let propNode = db.upsertNode(\"p:Property\", ['pid'], {pid:row[0]});\n let propNode = db.upsertNodeEx(\"p:Property\", ['pid'], pidDataF, pidData);\n commandSet.push(propNode);\n let unpaidTotal = 0;\n\n // add payments from year 2002-03 till now, based on entries in the excel file.\n // Why 5??? Because payment data is present from the 6th column (0 based index) onwards\n for (var i=5; i<row.length; i++) {\n if (!isNaN(row[i])) {\n\n commandSet.push(db.addPipe(propNode.alias, propNode.alias));\n let yearNode = db.upsertNode(`y${i}:Year`, ['name'], {name:yearMap[i]});\n commandSet.push(yearNode);\n commandSet.push(db.setRelation(propNode, yearNode, \n TAX_PAYMENT_REL, {status: \"PAID\", amt: row[i]}));\n\n } else if (row[i] == \"N/P\") {\n \n // accummulate payment defaults...\n paymentIssues.year = yearMap[i];\n paymentIssues.unpaid = findMax(row, 5);\n unpaidTotal += paymentIssues.unpaid;\n\n commandSet.push(db.addPipe(propNode.alias, propNode.alias));\n let yearNode = db.upsertNode(`y${i}:Year`, ['name'], {name:yearMap[i]});\n commandSet.push(yearNode);\n commandSet.push(db.setRelation(propNode, yearNode, \n TAX_PAYMENT_REL, {status: \"NOT_PAID\", amt:paymentIssues.unpaid}));\n\n } else if (row[i] == \"N/A\"){ /*nothing to do here.*/ \n \n } else if (row[i] === undefined || row[i] === \"\") { // no data present.\n dataIssues[yearMap[i]] = IssueTypes.missingPaymentDetails;\n\n commandSet.push(db.addPipe(propNode.alias, propNode.alias));\n let yearNode = db.findNode(`y${i}:Year`, {name:yearMap[i].toString()});\n commandSet.push(yearNode);\n commandSet.push(db.setRelation(propNode, yearNode, \n `TAX_PAYMENT`, {status: \"UNKNOWN\"}));\n }\n }\n\n if (!empty(paymentIssues)) addPaymentIssues(commandSet, propNode, paymentIssues, unpaidTotal);\n if (!empty(dataIssues) || row.length<17) addDataIssues(commandSet, propNode, dataIssues);\n\n let result = await db.exec(commandSet);\n } catch (e) {\n console.error(\"error while processing record:\", i, e);\n }\n}", "commit() {\n return new Promise((resolve, reject) => {\n // Anything to commit?\n if (!this.buffer.hasChanges()) {\n resolve();\n return;\n }\n\n (0, _debug.default)('Committing local changes'); // Collect current staged mutations into a commit and ...\n\n this.commits.push(new Commit([this.buffer.purge()], {\n resolve,\n reject\n })); // ... clear the table for the next commit.\n\n this.buffer = new _SquashingBuffer.default(this.LOCAL);\n this.performCommits();\n });\n }", "function importCsvData2MySQL(filePath){\n let stream = fs.createReadStream(filePath);\n let csvData = []\n let csvStream = csv\n .parse()\n .on(\"data\", function (data) {\n // console.log(data)\n csvData.push(data);\n \n })\n .on(\"end\", function () {\n // Remove Header ROW\n csvData.shift();\n for(i=0;i<csvData.length;i++)\n {\n pool.query('insert into public.tb_m_jobcard (plant_code,order_number,part_number,customer_code,customer_name,issued_qty,per_day_qty) values ($1,$2,$3,$4,$5,$6,$7) on conflict(plant_code,order_number) do update set part_number = excluded.part_number,customer_code = excluded.customer_code,customer_name=excluded.customer_name',csvData[i]) \n }\n \n\t\t\tfs.unlinkSync(filePath)\n });\n stream.pipe(csvStream);\n}", "function updateItemsAuditoriaInspeccionesPuertas(k_codusuario,cod_inspeccion,consecutivo_insp,revision,estado_envio,o_actualizar_inspeccion) {\n //alert(cod_inspeccion+\" \"+consecutivo_insp+\" \"+estado_envio);\n var estado_revision;\n if (revision > 0) {\n estado_revision = \"Si\";\n }else{\n estado_revision = \"No\";\n }\n db.transaction(function (tx) {\n var query = \"UPDATE auditoria_inspecciones_puertas SET o_actualizar_inspeccion = ?,\"+\n \"o_estado_envio = ?,\"+\n \"o_revision = ?,\"+\n \"v_item_nocumple = ? \"+\n \"WHERE k_codusuario = ? \"+\n \"AND k_codinspeccion = ? \"+\n \"AND o_consecutivoinsp = ?\";\n tx.executeSql(query, [o_actualizar_inspeccion,estado_envio,estado_revision,revision,k_codusuario,cod_inspeccion,consecutivo_insp], function(tx, res) {\n console.log(\"rowsAffected updateItemsAuditoriaInspeccionesPuertas: \" + res.rowsAffected);\n },\n function(tx, error) {\n console.log('UPDATE error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n cerrarVentanaCarga();\n });\n}", "function performMigrations () {\n /* Each migration has a 'key,' and we must first check to see\n * if that key has already been saved for the current user.\n * If it exists, the user has already run the migration.\n */\n localforage.getItem('schema-11-7-2016_longname_and_stopname_cutoff_fix', function (err, schemaUpdateExists) {\n // If the key isn't found, that means we need to run the migration.\n if (schemaUpdateExists !== true) {\n // This migration simply empties the entire cache. Bye!\n localforage.clear();\n // Save the migration key. The next time this function is run,\n // we won't ever enter this if block.\n localforage.setItem('schema-11-7-2016_longname_and_stopname_cutoff_fix', true);\n }\n });\n }", "processCSVVersion04072020(raw) {\n\t\traw.forEach( datum => {\n\t\t\tdatum.covid19_test_results = datum.covid_19_test_results;\n\t\t\tdelete datum.covid_19_test_results;\n\t\t});\n\t\traw.columns[raw.columns.find(\"covid_19_test_results\")] = \"covid19_test_results\";\n\t\tiflog(\"processCSVversion0(): begin processing\")\n\t\treturn \n\t}", "function UpdateApproveRequestOrdeTable() {\n // Update order data from csv \n approve_order_request_table.rows().remove();\n upload_approve_order_request_table();\n }", "function computeItemNode() {\n items.forEach(function (item) {\n item.node.forEach(function (node) {\n var node_id = node;\n node = {};\n node.cluster = nodes[node];\n })\n item.start.node_id = item.start.node;\n item.start.node = nodes[item.start.node_id];\n })\n\n }", "function lowInventory(num) {\n let sql = `SELECT * FROM products GROUP BY item_id HAVING stock_quantity < ` + num;\n con.query(sql, (err, results, fields) => {\n if (err) throw err;\n results.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 startUp();\n })\n}", "function doInsertStatus ( sku_ind,ind,status,overallStatus ) {\n\n/*\n\n 'FILE_NAME': null, Y\n 'ACTION': null, Y\n 'PRODUCT_CODE': null, Y\n 'TABLE_NAME': null, Y\n 'PERSISTED': null, Y\n 'ERROR_MSG': null, Y\n 'LAST_UPDATED' : null\n*/\n\n\tvar db_row = status[sku_ind][ind];\n var mymodel = require('../models/imports');\n var bind_obj = Object.assign({}, mymodel.definition);\n utils.copy_keys(mymodel.defaults,bind_obj);\n utils.copy_keys(db_row,bind_obj);\n\n bind_obj['LAST_UPDATED'] = new Date();\n bind_obj['ACTION'] = overallStatus['ACTION'];\n\n var params = {\n\t\t'bind_obj' : bind_obj,\n\t\t'table' : 'imports',\n\t\t'stmt' : mymodel.ins_stmt,\n\t\t'commit' : false,\n\t\t'curr_ind' : ind,\n\t\t'conn'\t: overallStatus['DB_CONN'],\n\t\t//'keepDBConnAlive'\t: true\n\t};\n\n\toverallStatus['STATUS_OBJECTS'].push(bind_obj);\n\n\tdb_api.executeInsert(params,function (err, params) {\n\t\tif (err) {\n\t\t\tconsole.log('[ERROR] Error occurred during insert to imports table');\n\t\t\tconsole.log(err);\n\t\t\tconsole.log(params['bind_obj']);\n\t\t\t//closeConnection2(overallStatus['DB_CONN']);\n\t\t\t//endProcess(overallStatus);\n\t\t\t//return;\n\t\t}\n\t\tind++;\n\t\tif (ind < status[sku_ind].length) {\t\t\t\n\t\t\t// Insert next element\n\t\t\tdoInsertStatus(sku_ind,ind,status,overallStatus);\n\t\t} else {\n\t\t\tsku_ind++;\n\t\t\tif (sku_ind < status.length) {\n\t\t\t\tind=0;\n\t\t\t\t//status[sku_ind] = [];\n\t\t\t\tdoInsertStatus(sku_ind,ind,status,overallStatus);\n\t\t\t} else {\n\t\t\t\t// Done with all rows and columns\n\t\t\t\tconsole.log('[INFO] Imports table updated');\n\t\t\t\tconsole.log(status);\n\n\t\t\t\t//overall_status['STATUS'] = 'COMPLETE';\n \t\t//var file_upload_def = Object.assign({}, file_upload.definition);\n \t\t//utils.copy_keys(overall_status,file_upload_def);\n \t\t//var upd_clause = '';\n \t\t//Object.keys(overall_status).forEach(function(key,index) {\n \t//\tupd_clause = upd_clause + key + '=:' + key + ',';\n \t\t//});\n \t\t//upd_clause = upd_clause.substring(0, upd_clause.length - 1);\n \t\t//var stmt = 'update '+sku_app_schema+'.'+'file_upload set ' + upd_clause + ' where FILE_NAME = :FILE_NAME';\n\n \t\t/*var params = {\n \t\t'bind_obj' : overall_status,\n \t\t'table' : 'file_upload',\n \t\t'stmt' : stmt,\n \t\t//'commit' : true\n \t\t'commit' : true\n \t\t};*/\n\n\t\t\t\t/*db_api.executeUpdate(params, function(upd_err,params) {\n\t\t\t\t\tif (upd_err) {\n\t\t\t\t\t\tconsole.log(\"[ERROR] Some error occurred during update: \"+upd_err);\n\t\t\t\t\t\tconsole.log(params['bind_obj']);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconsole.log('Rows updated: '+params['update_count']);\n\t\t\t\t\treturn;\n\t\t\t\t});*/\n\n\t\t\t\t// This is our final update\n\t\t\t\tvar fileUploadStatus = null;\n\t\t\t\tvar err_msg = '';\n\t\t\t\tif (overallStatus['TOTAL_FAILURE'] == 0) {\n\t\t\t\t\tfileUploadStatus = 'COMPLETE';\n\t\t\t\t\terr_msg = 'Completed';\n\t\t\t\t} else {\n\t\t\t\t\tfileUploadStatus = 'ERROR';\n\t\t\t\t\terr_msg = 'Failed';\n\t\t\t\t}\n\n\n\t\t\t\tupdateFileUploadTable(fileUploadStatus, err_msg, function (err, params) {\n\t\t\t\t\t//console.log('Update stmt was successful');\t\t\t\t\t\t\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\tconsole.log('[ERROR] Error updating file_upload table');\n\t\t\t\t\t\tconsole.log(err);\n\t\t\t\t\t\t//closeConnection(overallStatus);\n\t\t\t\t\t\t//closeConnection(overallStatus);\n\t\t\t\t\t\t//endProcess(overallStatus);\n\t\t\t\t\t\t//return;\n\t\t\t\t\t}\n\t\t\t\t\tendProcess(overallStatus);\n\t\t\t\t\t//return;\n\t\t\t\t}, overallStatus);\n\t\t\t}\n\t\t}\n\n\t});\n}", "onMove(item, callback) {\n if (item.start >= item.end) {\n callback(null);\n return;\n }\n let updateAlloc = {Id: item.id, Flag: \"U\", StartDate: item.start, EndDate: item.end, Percentage: item.content};\n this.PHPController.updateAllocation(updateAlloc);\n callback(item);\n this.createTotalTimeline();\n }", "async function newuseritem(amount, name, owner){\r\n let irow = await sql.get(`SELECT * FROM items WHERE name = \"${name}\"`)\r\n if(!irow) return\r\n sql.get(`SELECT * FROM useritems WHERE owner = \"${owner}\" AND name = \"${name}\" COLLATE NOCASE`).then((row) =>{\r\n if(!row){\r\n sql.run(`INSERT INTO useritems (name, type, effect, effectval, amount, owner, decaytime, time, value, category, max, useable, sellable) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, name, irow.type, irow.effect, irow.effectval, amount, owner, irow.time, getcurdate(), irow.value, irow.category, irow.max, irow.useable, irow.sellable) \r\n }\r\n else{\r\n sql.run(`UPDATE useritems SET amount = \"${row.amount + amount}\" WHERE owner = \"${owner}\" AND name = \"${name}\" COLLATE NOCASE`)\r\n }\r\n }).catch(() =>{\r\n sql.run(`CREATE TABLE IF NOT EXISTS useritems (name TEXT, type TEXT, effect TEXT, effectval INTEGER, amount INTEGER, owner TEXT, decaytime INTEGER, time INTEGER, value INTEGER, category TEXT, max INTEGER, useable TEXT, sellable INTEGER)`).then(() => {\r\n sql.run(`INSERT INTO useritems (name, type, effect, effectval, amount, owner, decaytime, time, value, category, max, useable, sellable) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, name, irow.type, irow.effect, irow.effectval, amount, owner, irow.time, getcurdate(), irow.value,irow.category, irow.max, irow.useable, irow.sellable)\r\n })\r\n })\r\n}", "function crearTablaAscensorItemsFoso(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_items_foso (k_coditem_foso, v_item, o_descripcion, v_clasificacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "updateClientAreaForRow(row, beforeLayout) {\n // tslint:disable-next-line:max-line-length\n let tableWidget = row.ownerTable;\n if (beforeLayout) {\n //tslint:disable:no-empty\n }\n else {\n this.clientActiveArea.x = this.clientArea.x = tableWidget.x;\n this.clientActiveArea.width = this.clientArea.width = tableWidget.width;\n this.clientArea = new Rect(this.clientArea.x, this.clientArea.y, this.clientArea.width, this.clientArea.height);\n // tslint:disable-next-line:max-line-length\n this.clientActiveArea = new Rect(this.clientActiveArea.x, this.clientActiveArea.y, this.clientActiveArea.width, this.clientActiveArea.height);\n }\n }", "async function update() {\r\n\tvar result = await client.query(\"select * from poe_ladder_data where (league = 'Abyss') order by rank\");\r\n\t//console.log(result);\r\n\r\n\tvar date_1 = new Date().toUTCString();\r\n\r\n\tfor(var i = 0; i < result.rows.length; i++)\r\n\t{\r\n\t\tconsole.log(i + \" : \" + result.rows[i].account_name + \" \" + result.rows[i].name);\r\n\t\tawait get_items(result.rows[i].account_name, result.rows[i].name);\r\n\t\tawait sleep(1000);\r\n\t}\r\n\r\n\tvar date_2 = new Date().toUTCString();\r\n\t\r\n\tconsole.log('start: ' + date_1);\r\n\tconsole.log('end: ' + date_2);\r\n\r\n\tawait client.end();\r\n}", "function update() {\n $scope.items.shift();\n $scope.items.push(generateRow());\n $scope.usage1 = setUsage();\n $scope.usage2 = setUsage();\n $scope.usage3 = setUsage();\n $scope.usage4 = setUsage();\n $scope.mapObject.data = mapChanges();\n $timeout(update, updateInterval);\n }", "updateAccountEntries() {\n const accountProcessors \n = Array.from(this._accountProcessorsByAccountIds.values());\n for (let i = accountProcessors.length - 1; i >= 0; --i) {\n const processor = accountProcessors[i];\n const { accountEntry, oldestIndex, newAccountStatesByOrder } = processor;\n const { sortedTransactionKeys, accountStatesByTransactionId } = accountEntry;\n\n if (oldestIndex <= 0) {\n accountEntry.accountStatesByOrder.length = 0;\n accountStatesByTransactionId.clear();\n }\n else {\n for (let i = oldestIndex; i < sortedTransactionKeys.length; ++i) {\n accountStatesByTransactionId.delete(sortedTransactionKeys[i].id);\n }\n if (newAccountStatesByOrder) {\n accountEntry.accountStatesByOrder = newAccountStatesByOrder;\n }\n else {\n accountEntry.accountStatesByOrder.length \n = Math.max(processor.oldestIndex, 0);\n }\n }\n\n // Force reloading of the account entry the next time it's needed.\n accountEntry.sortedTransactionKeys = undefined;\n accountEntry.nonReconciledTransactionIds = undefined;\n\n //accountEntry.accountStatesByTransactionId.clear();\n }\n }", "async function aggregateHistoryAssets(){\n\tlet settings = await wrapper.toStrong(SETTINGS_DB.findOne({}));\n\tif (!settings){\n\t\treturn setTimeout(aggregateHistoryAssets, timeout);\n\t}\n\tawait getAssetsActions(settings);\n\t\n\tawait wrapper.toStrong(settings.save());\n\tconsole.log('===== END assets aggregation', settings);\n\tsetTimeout(aggregateHistoryAssets, timeout);\n}" ]
[ "0.57560194", "0.5642123", "0.49177557", "0.4869999", "0.4334779", "0.43320096", "0.42345592", "0.42293197", "0.4187086", "0.41862658", "0.41783383", "0.41738325", "0.4143337", "0.41373187", "0.4128018", "0.41192642", "0.41055834", "0.4096731", "0.40937638", "0.40873325", "0.40847108", "0.40684113", "0.4065017", "0.4057806", "0.40485084", "0.4043124", "0.40406296", "0.4032693", "0.4028898", "0.40078816", "0.40029326", "0.3986425", "0.3979092", "0.39780933", "0.39775845", "0.39773735", "0.39759436", "0.3967084", "0.3958904", "0.39472565", "0.39424843", "0.39375678", "0.39289933", "0.39262086", "0.3913754", "0.39091197", "0.39054665", "0.38967368", "0.38967326", "0.38954774", "0.3894277", "0.38925958", "0.3892122", "0.3892122", "0.38920113", "0.3891436", "0.38832945", "0.3880186", "0.38787422", "0.3866724", "0.38656223", "0.3864629", "0.3863509", "0.38619024", "0.38598087", "0.38587674", "0.38512054", "0.384564", "0.3844848", "0.38430873", "0.38389373", "0.38373825", "0.38339785", "0.3831802", "0.38247293", "0.38228008", "0.3817039", "0.38154575", "0.38138866", "0.38102508", "0.38086683", "0.38069555", "0.38051662", "0.38016596", "0.3795475", "0.37929037", "0.37897226", "0.37853095", "0.37851056", "0.37812603", "0.37798396", "0.37787887", "0.37762967", "0.37732944", "0.3772109", "0.3769158", "0.37689415", "0.37634993", "0.37633654", "0.37633044" ]
0.78819424
0
This is for the .txt system (bad)
function parse(file) { let names = []; let parts = file.split(':'); parts[0].split('\n').forEach(function(line) { if (line !== '') { names.push(line.split(',')[0]); } }); let n = -1; parts[1].split('\n').forEach(function(line) { if (n >= 0) { data[names[n]] = line; } n++; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function $textfile(path)\n{\n\tvar thisPtr=this;\n\tvar data=\"\";\n\tvar file=null;\n\tvar file_is_tmp = false;\n\t\t\n\tthis.inlet1=new this.inletClass(\"inlet1\",this,\"data is appended to the buffer. methods: \\\"bang\\\", \\\"clear\\\", \\\"write\\\", \\\"cr\\\", \\\"tab\\\", \\\"dump\\\", \\\"open\\\", \\\"read\\\", \\\"query\\\", \\\"length\\\", \\\"line\\\", \\\"tmpfile\\\", \\\"path\\\", \\\"writebin\\\"\");\t\n\n\tthis.outlet1 = new this.outletClass(\"outlet1\",this,\"text data\");\n\tthis.outlet2 = new this.outletClass(\"outlet2\",this, \"text info\");\n\t\n\t//append input\n\tthis.inlet1[\"anything\"]=function(str) {\n\t\tdata=(data.length)?data+\" \"+str:str; //prepend a space if there's already data in the buffer\t\n\t}\n\t\n\t//reset the data var\n\tthis.inlet1[\"clear\"]=function() {\n\t\tdata=\"\";\n\t}\t\n\t\n\t//write to disk\n\tthis.inlet1[\"write\"]=function() {\n\t\tfile=LilyUtils.writeDataToFile(file,data);\n\t}\n\t\n\t//write binary to disk\n\tthis.inlet1[\"writebin\"]=function() {\n\t\tif(file) LilyUtils.writeBinaryFile(file,data);\n\t}\t\n\t\n\t//create a tmp file\n\tthis.inlet1[\"tmpfile\"]=function(ext) {\n\t\tfile = LilyUtils.getTempFile(ext);\n\t\tfile_is_tmp = true;\n\t}\n\t\n\t//output the file path if it exists\n\tthis.inlet1[\"path\"]=function() {\n\t\tif(file && file.path)\n\t\t\tthisPtr.outlet2.doOutlet(file.path);\n\t\telse\n\t\t\tthisPtr.outlet2.doOutlet(\"bang\");\n\t}\n\t\n\t//new line\n\tthis.inlet1[\"cr\"]=function() {\n\t\tif(LilyUtils.navigatorPlatform() == \"windows\") {\n\t\t\tdata=data+\"\\r\\n\";\n\t\t} else {\n\t\t\tdata=data+\"\\n\";\n\t\t}\n\t}\n\t\n\t//new line\n\tthis.inlet1[\"tab\"]=function() {\n\t\tdata=data+\"\\t\";\n\t}\t\t\t\t\n\t\n\t//dump contents\n\tthis.inlet1[\"bang\"]=function() {\n\t\tthisPtr.outlet1.doOutlet(data);\n\t}\n\t\n\t//dump contents\n\tthis.inlet1[\"dump\"]=function() {\n\t\tthisPtr.outlet1.doOutlet(data);\n\t}\n\t\n\t//open in text window\n\tthis.inlet1[\"open\"]=function() {\n\t\tif(file)\n\t\t\tfile.launch();\n\t\telse\n\t\t\tLilyDebugWindow.error(\"file must be saved before it can be opened.\") //error\n\t}\t\n\t\n\t//read in a new file\n\tthis.inlet1[\"read\"]=function(p) {\n\t\treadFile(p,true);\t\t\n\t}\n\t\n\t//data array length\n\tthis.inlet1[\"query\"]=function() {\n\t\tvar arr=data.split(\"\\n\");\t\t\n\t\tthisPtr.outlet2.doOutlet(arr.length);\n\t}\n\t\n\t//data array length\n\tthis.inlet1[\"length\"]=function() {\t\t\n\t\tthisPtr.outlet2.doOutlet(data.length);\n\t}\t\n\t\n\t//output line by number\n\tthis.inlet1[\"line\"]=function(num) {\n\t\tvar arr=data.split(\"\\n\");\n\t\tif(typeof arr[parseInt(num)]!=\"undefined\")\n\t\t\tthisPtr.outlet1.doOutlet(arr[parseInt(num)]);\n\t}\n\t\n\t//remove the tmp file\n\tthis.destructor=function() {\n\t\tif(file_is_tmp) {\n\t\t\ttry {\n\t\t\t\tfile.remove(false);\t\n\t\t\t} catch(e) {\n\t\t\t\tLilyDebugWindow.error(e.name + \": \" + e.message);\n\t\t\t}\n\t\t}\n\t}\t\n\t\n\tfunction readFile(p,useFP) {\n\t\tvar fPath = null;\n\t\t\n\t\tif(p) {\n\t\t\t//get the path to the patch if we need it\n\t\t\tfPath = (p)?LilyUtils.getFilePath(p):\"\";\n\t\t\tif(!fPath) {\n\t\t\t\tLilyDebugWindow.error(\"Path \"+p+\" not found\");\n\t\t\t\treturn;\t\n\t\t\t}\t\t\t\n\t\t}\n\t\t\t\n\t\t//read the file.\t\n\t\tvar tmp=LilyUtils.readFileFromPath(fPath,useFP);\n\t\tdata=tmp.data;\n\t\tfile=tmp.file;\t\n\t}\n\t\n\treadFile(path,false); //open the file if a path is provided\n\t\n\t//called by the object creation method.\t\n\tthis.init=function() {\n\t\tthisPtr.controller.attachObserver(this.objID,\"dblclick\",function(){thisPtr.inlet1.open();},\"performance\");\t\t\t\n\t}\t\n\t\t\n\treturn this;\n}", "function save_text(file_name,info_text) {\nif (!file_name) {save_text_count++; file_name = 'text' + save_text_count.toString() + '.txt';}\nvar fs = require('fs'); fs.write(file_name, info_text, 'w');}", "isTextFile(file) {\n let extensions = [\"doc\", \"docx\", \"odt\", \"pdf\", \"rtf\", \"txt\"];\n return extensions.includes(file.extension);\n }", "function read(f)\n\t{\n\t\tt = fs.readFileSync(f, 'utf8', (err,txt) => {\n\t\t\tif (err) throw err;\n\t\t});\n\t\treturn t;\n\t}", "async getFileAsString(path) {\n let pathX = /[a-zA-Z0-9-_\\.//]+(.txt)/; //validity for a path/file name\n //let pathX = /[a-zA-Z0-9-_\\.//]/; //validity for a path/file name\n \n if (path.match(pathX)) {\n if(!path) {\n throw \"Need to provide a file name!\";\n }\n //console.log(\"About to read \" +path);\n let fileContent = await fs.readFileAsync(path, \"utf-8\");\n //console.log(fileContent);\n return fileContent.toString();\n }\n else {\n console.log(\"Invalid path\");\n }\n \n \n \n }", "readFileTextSync() {\n\t\t\treturn ___R$$priv$project$rome$$internal$path$classes$AbsoluteFilePath_ts$fs.readFileSync(\n\t\t\t\tthis.join(),\n\t\t\t\t\"utf8\",\n\t\t\t);\n\t\t}", "addSpecFromTXT(spec_name, file){\n\t\tlet _this = this;\n\t\tlet lista = [];\n\t\tlet listb = [];\n\t\tlet reader = new FileReader;\n\n\t\treader.onload = function(){\n\t\t\t// parse into lists\n\t\t\tlet points = _this.getPointsFromTXTData(reader.result);\n\t\t\t_this.addSpec(spec_name, points);\n\t\t}\n\n\t\treader.readAsText(file);\n\t}", "function writeTxtFiles() { //调用前面的写方法\n\n\t// could've written these as one function,\n\t// left em separate for easy customization,\n\t// e.g., could've written writeCsv()\n\n\n\n\n\n\twriteHtml();\n\twriteCss();\n\t// writeJson();\n\twriteManifest();\n\n\n}", "static txt ({ filepath, newFilepath, fileInfo }) {\n const info = '\\n\\nFile Info:\\n' +\n Object.keys(fileInfo)\n .map(k => `${k}: ${fileInfo[k]}`)\n .join('\\n')\n\n return fs.readFile(filepath)\n .then(file => fs.writeFile(newFilepath, file + info))\n }", "function TextParser() {}", "function TextParser() {}", "function start(txt) {\n var reply;\n key_at_a_time = true; // default\n\n // sanity check the file size\n if (txt.length === 0) {\n alert('That is an empty file!');\n return false;\n }\n\n // sanity check the file size\n if (txt.length > 32*1024) {\n reply = confirm('The file is ' + txt.length + ' bytes long.\\n' +\n 'Hit \"OK\" if you still want to proceed.');\n if (!reply) {\n return false;\n }\n }\n\n // sanity check the line ending convention\n function countRe(txt, re) {\n var pieces = txt.match(re);\n if (pieces === null) {\n return 0;\n }\n return pieces.length;\n }\n\n var crs = countRe(txt, /\\r/g); // compucolor & mac line endings\n var nls = countRe(txt, /\\n/g); // unix line endings\n var crnls = countRe(txt, /\\r\\n/g); // dos line endings\n var re, pieces;\n if (crnls*1.1 >= crs && crnls*1.1 >= nls) {\n // the *1.1 is because the number of crs and the number of\n // newlines is at least as great as the number of cr/nls, so\n // any stray cr's or nl's would confuse things.\n reply = confirm('The file appears to use DOS line endings.\\n' +\n 'Hit \"OK\" to convert them to Mac line endings ' +\n 'on the fly, \"Cancel\" to prevent the conversion.');\n if (reply) {\n re = /\\r\\n/g;\n }\n } else if (nls > crs) {\n // apparently unix line endings\n reply = confirm('The file appears to use Unix line endings.\\n' +\n 'Hit \"OK\" to convert them to Mac line endings ' +\n 'on the fly, \"Cancel\" to prevent the conversion.');\n if (reply) {\n re = /\\n/g;\n }\n } else {\n // apparently compucolor/Mac line endings\n re = /\\r/g;\n }\n pieces = txt.split(re);\n var len = pieces.length;\n\n // check for long lines\n var longlinesOk = false;\n for (var n=0; n < len && !longlinesOk; n++) {\n if (pieces[n].length > 97) {\n reply = confirm(\n 'Warning: some lines are greater than the maximum ' +\n 'line buffer size (97).\\n' +\n 'For example, line ' + (n+1) + ' is ' +\n pieces[n].length + ' bytes long.\\n' +\n 'Hit \"OK\" to proceed, resulting in truncated lines, ' +\n 'or \"Cancel\" to abort the transfer.');\n if (!reply) {\n return false;\n } else {\n longlinesOk = true;\n }\n }\n }\n\n // OK, accept it for processing\n text = pieces.join('\\r');\n offset = 0;\n phase = 0; // needed only for keyStuff routine\n return true;\n }", "function readFileText(name,callback){\n process.nextTick(function () {\n var content=fs.readFileSync(name)\n callback(content.toString())\n })\n}", "function readText() {\n\n fs.readFile(\"random.txt\", \"utf8\", function (error, data) {\n var dataArr = data.split(\",\");\n\n // Calls switch case \n switcher(dataArr[0], dataArr[1]);\n });\n}", "function makeTextFile(text) {\r\n var data = new Blob([text], { type: 'text/plain' });\r\n\r\n textFile = window.URL.createObjectURL(data);\r\n\r\n return textFile;\r\n}", "function read(f)\n{\n t = fs.readFileSync(f, 'utf8', (err,txt) => {\n if (err) throw err;\n });\n return t;\n}", "fileCall(path) {\n var fileStream = require('fs');\n var f = fileStream.readFileSync(path, 'utf8');\n return f;\n // var arr= f.split('');\n // return arr;\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 displayFile() {\n var i = 0,\n count = 0;\n\n while (count < (todocl.textArr.length * 5)) {\n if (i == todocl.textArr.length) {\n i = 0;\n }\n if (todocl.textArr[i].substring(0, 3) === '(A)' && count < todocl.textArr.length) {\n todocl.out.innerHTML += \"<span style='color:#A40000; font-weight: 900;'>\" + (i + 1) + \" \" + todocl.textArr[i] + NEW_LINE + \"</span>\";\n }\n\n if (todocl.textArr[i].substring(0, 3) === '(B)' && count > todocl.textArr.length && count <= (todocl.textArr.length * 2)) {\n todocl.out.innerHTML += \"<span style='color:#B24200; font-weight: 900;'>\" + (i + 1) + \" \" + todocl.textArr[i] + NEW_LINE + \"</span>\";\n }\n\n if (todocl.textArr[i].substring(0, 3) === '(C)' && count > (todocl.textArr.length * 2) && count <= (todocl.textArr.length * 3)) {\n todocl.out.innerHTML += \"<span style='color:#FF790C; font-weight: 900;'>\" + (i + 1) + \" \" + todocl.textArr[i] + NEW_LINE + \"</span>\";\n }\n\n if (todocl.textArr[i].substring(0, 3).match(/^([(D-Z)]+)$/) && count > (todocl.textArr.length * 3) && count <= (todocl.textArr.length * 4)) {\n todocl.out.innerHTML += \"<span style='color:#FFFFFF; font-weight: 900;'>\" + (i + 1) + \" \" + todocl.textArr[i] + NEW_LINE + \"</span>\";\n }\n\n if (todocl.textArr[i].substring(0, 3) !== '(A)' && todocl.textArr[i].substring(0, 3) !== '(B)' && todocl.textArr[i].substring(0, 3) !== '(C)' &&\n !todocl.textArr[i].substring(0, 3).match(/^([(D-Z)]+)$/) && count >= (todocl.textArr.length * 4)) {\n todocl.out.innerHTML += (i + 1) + \" \" + todocl.textArr[i] + NEW_LINE;\n }\n count++;\n i++;\n }\n\n todocl.out.innerHTML += \"--\" + NEW_LINE + \"TODO: \" +\n todocl.textArr.length + \" Of \" +\n todocl.textArr.length + \" tasks shown\";\n }", "function ler(){\n fs.readFile(\"./input/test.txt\",{encoding: 'utf-8'},(error, dados) => {\n if(error){\n console.log('Ocorreu um erro durante a leitura do arquivo!')\n }else{\n console.log(dados)\n }\n })\n}", "function readTextFile(path) {\n\tfs.readFile(path, function(err, data) {\n\t\treturn String(data);\n\t});\n}", "function callTxt() {\n fs.readFile(\"random.txt\", \"utf8\", function(error, data) {\n\n // If the code experiences any errors it will log the error to the console.\n if (error) {\n return console.log(error);\n }\n // Then split it by commas (to make it more readable)\n var dataArr = data.split(\",\");\n \n //assign command and search based on contents of random.txt\n liriCommand = dataArr[0];\n searchParams = dataArr[1];\n return checkCommand(liriCommand);\n });\n}", "async readFileTextMeta() {\n\t\t\treturn {\n\t\t\t\tinput: await this.readFileText(),\n\t\t\t\tpath: this.assertReadable(),\n\t\t\t};\n\t\t}", "function getTextContentFromFiles(files,callback){var readCount=0;var results=[];files.forEach(function(/*blob*/file){readFile(file,function(/*string*/text){readCount++;text&&results.push(text.slice(0,TEXT_SIZE_UPPER_BOUND));if(readCount==files.length){callback(results.join('\\r'));}});});}", "function TextParser() { }", "function readTextFile()\n\t\t{\n\t\t\tvar rawFile = new XMLHttpRequest();\n\t\t\trawFile.open(\"GET\",\"file:///C:/Users/barat/Desktop/PB_Project/phase3/input/intermediateOutput4.txt\", false);\n\t\t\trawFile.onreadystatechange = function ()\n\t\t\t{\n\t\t\t\tif(rawFile.readyState === 4)\n\t\t\t\t{\n\t\t\t\t\tif(rawFile.status === 200 || rawFile.status == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tallText = rawFile.responseText;\n\t\t\t\t\t\t//console.log(allText)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\trawFile.send(null);\n\t\t}", "function readAllText(path) {\n return fs.readFileSync(path, 'utf8');\n}", "function JM_readTextFile(myfile) {\n myfile.open(\"r\");\n myContents = myfile.read().split(\"\\n\");\n myfile.close();\n return myContents;\n}", "function findText(){\n fs.readFile(\"random.txt\", \"utf8\", function(error, data) {\n\n if (error) {\n return console.log(error);\n }\n\n var dataArr = data.split(\",\");\n var term = dataArr[1].trim().slice(1,-1);\n liri.findSong(term);\n\n });\n}", "function readfile(){\n\t\t\tvar txtFile = \"c:/test.txt\"\n\t\t\tvar file = new File([\"\"],txtFile);\n\n\t\t\tfile.open(\"r\"); // open file with read access\n\t\t\tvar str = \"\";\n\t\t\twhile (!file.eof) {\n\t\t\t\t// read each line of text\n\t\t\t\tstr += file.readln() + \"\\n\";\n\t\t\t}\n\t\t\tfile.close();\n\t\t\talert(str);\n\t\t}", "getItalics(line){\n\n }", "function randomText() {\n fs.readFile('random.txt', 'utf-8', function read(err, data) {\n var dataArr = data.split(\",\");\n randomSearch = dataArr[1];\n\n switch (dataArr[0]) {\n case \"my-tweets\":\n twitterCommand();\n break;\n case \"spotify-this-song\":\n spotifyCommand();\n break;\n case \"movie-this\":\n movieCommand();\n break;\n case \"do-what-it-says\":\n log();\n break;\n };\n log(\"do-what-it-says was run and returned the following informtion: \");\n });\n}", "function uploadTXTFile($event) {\n\n\t// process for each txt\n\tvar files = $event.target.files;\n\tfor (let i = 0; i < files.length; i++) {\n\t\tlet reader = new FileReader();\n\t\treader.onload = processDataFromTXT(files[i].name);\n\t\treader.readAsText(files[i]);\n\t}\n\n\t// update input\n\t$('#uploadTXT').replaceWith('<input id=\"uploadTXT\" type=\"file\" accept=\".txt\" style=\"display: none;\" multiple>');\n\tdocument.getElementById('uploadTXT').addEventListener('change', uploadTXTFile, false);\n}", "function displayContents() {\r\n \r\n var thisFile = fileText;\r\n var txt = \"\";\r\n var wordLen = parseInt(document.getElementById(\"WordLength\").value) + 1;\r\n \r\n var fileLength = thisFile.split(\"\\n\").length;\r\n \r\n if (wordLen > 0){\r\n for (i = Math.round(Math.random() * 100);i < fileLength; i = i + 100){\r\n document.getElementById('wait').innerHTML = i;\r\n console.log(i + \": \" + thisFile.split(\"\\n\")[i]);\r\n txt += (thisFile.split(\"\\n\")[i].length == (wordLen)) ? thisFile.split(\"\\n\")[i] + \"\\n\" : \"\";\r\n }\r\n console.log(txt);\r\n }\r\n else {\r\n txt = thisFile;\r\n }\r\n \r\n var txtLength = txt.split(\"\\n\").length;\r\n var rndWord = Math.round(Math.random() * txtLength);\r\n \r\n var el = document.getElementById('main');\r\n el.innerHTML = rndWord + \" / \" + txt.split(\"\\n\")[rndWord]; //display output in DOM\r\n \r\n \r\n \r\n \r\n }", "function doWhatItSays() {\n fs.readFile('random.txt', 'utf8', function (err, data) {\n if (err) throw err;\n console.log(data);\n });\n}", "function read(txt){\n\t\n //this part is going to be sweet because I have to separate the txt string into chunks of 100 chars in order for the google tts service\n //to provide me with texts longer than 100 chars translated to voice.\n play_sound(\"http://translate.google.com/translate_tts?ie=UTF-8&q=\"+encodeURI(txt)+\"&tl=\"+languages[language]+\"&total=1&idx=0prev=input\"); \n}", "function send_file(fname)\n{\n\tvar f = new File(fname);\n\tif(!f.open(\"r\")) \n\t\treturn;\n\tvar txt = f.readAll();\n\tf.close();\n\tfor(var l in txt)\n\t\twriteln(txt[l]);\n}", "function savedContent($, news_title){\n $('.article-content p').each(function(index, item){\n var x = $(this).text();\n\n var y = x.substring(0, 2).trim();\n\n if(y == ''){\n x=x+'\\r\\n';\n fs.appendFile('./data/' + news_title + '.txt', x, 'utf-8', function(err){\n if(err){\n console.log(err);\n }\n });\n }\n })\n}", "function TextData() {}", "function TextData() {}", "function TextData() {}", "function getTextFile(theFilename){\n return new Promise($.async(function (resolve, reject) {\n try {\n $.fs.readFile(theFilename, 'utf8', function (err, theContent) {\n if (err) {\n resolve(\"\")\n } else {\n resolve(theContent);\n }\n });\n }\n catch (error) {\n resolve(\"\")\n }\n \n }));\n}", "function fixFile (data) {\n var charArray = data.split(\"\");\n\n var newData = charArray.map(function(el) {\n if (el === \"\\n\") return \" \";\n if (el === \"\\r\") return \" \";\n return el;\n }).join(\"\");\n\n return newData;\n}", "function getFileContent(files) {\n let content = \"\";\n for (let i = 0; i < files.length; i++) {\n if (fs.existsSync(files[i]) == false) {\n console.log(\"One or more files dont exist\");\n return;\n }\n content += fs.readFileSync(files[i]);\n if (i != files.length - 1)\n content += \"\\r\\n\";\n // would cause little problems further if only \\n, since you know now every line is distinguished by \\r\\n use it\n }\n return content;\n}", "function showHelp() {\t\n const helpText = fs.readFileSync('./help.txt',{encoding:'UTF-8'});\n console.log(helpText);\n}", "function isText (file) {\n const ext = extname(file)\n return TEXT_EXTENSIONS.indexOf(ext) !== -1\n}", "function loadFileHandler(text)\r\n\t{\r\n\t var content = text.split(\"\\n\");\r\n\t var processed = [];\r\n\t for(var i = 0; i < content.length; i++)\r\n\t {\r\n\t \tif(content[i].includes(\",\"))\r\n\t \t{\r\n\t \t\tprocessed.push(content[i].split(\",\"));\r\n\t \t}\r\n\t \telse\r\n\t \t{\r\n\t \t\tprocessed.push([content[i]]);\r\n\t \t}\r\n\t \t}\r\n\t callback(processed,arg1,arg2,arg3);\r\n\t}", "getContents() {\n return _fs.default.readFileSync(this.filePath, \"utf8\");\n }", "function getTextsFile() {\n\n // IMP: Must have var with the same name as this.id (assigned at top of the file currently).\n var corpusPath = \"Data/\" + currentCorpus + \"-Texts.txt\";\n\n // Get the data from our JSON file\n d3.json(corpusPath, function(error, textsData) {\n if (error) {\n alert(corpusPath + ' is not available.');\n throw error;\n }\n\n // Store texts data for use throughout this page.\n allTextsData = textsData;\n });\n\n}", "function writeNewFile() {\n fs.writeFile('allText.txt', 'some text', (e, text) => {\n if (e) {\n\n fs.appendFile('allText.txt', songs + \"&bsp;\" + movies + \"&bsp;\" + books, (e, text) => {\n\n if (e) {\n\n fs.readFile('allText.txt', 'utf8', (e, text) => {\n\n if (e) {\n console.log(e)\n }\n console.log(text)\n })\n }\n })\n }\n })\n}", "function Zn(t){return n(17).readFileSync(t,\"utf8\")}", "function getAsText1(fileToRead) {\n var reader = new FileReader();\n\n reader.readAsText(fileToRead);\n\n reader.onload = loadHandler1;\n reader.onerror = errorHandler;\n}", "function readTextFile(file)\n{\n var rawFile = new XMLHttpRequest();\n rawFile.open(\"GET\", file, false);\n rawFile.onreadystatechange = function ()\n {\n if(rawFile.readyState === 4)\n {\n if(rawFile.status === 200 || rawFile.status == 0)\n {\n var allText = rawFile.responseText;\n fileDisplayArea.innerText = allText\n }\n }\n }\n rawFile.send(null);\n}", "function createTextFile(fn, txt, server) {\n if (getTextFile(fn, server) !== null) {\n console.log(\"ERROR: createTextFile failed because the specified \" +\n \"server already has a text file with the same fn\");\n return;\n }\n var file = new TextFile(fn, txt);\n server.textFiles.push(file);\n return file;\n}", "function readTxtFile(file) {\n if (!file.exists) {\n throw \"Cannot find file: \" + decodeURI(file.absoluteURI);\n }\n file.open(\"r\", \"TEXT\");\n file.encoding = \"UTF8\";\n file.lineFeed = \"unix\";\n var str = file.read();\n file.close();\n return str;\n}", "_getFileText() {\n throw new Error('Expected getFileText to be provided as option to constructor');\n }", "function getTemp() {\n b.readTextFile(w1, printStatus);\n}", "function readFile(file,callback){if(!global.FileReader||file.type&&!(file.type in TEXT_TYPES)){callback('');return;}if(file.type===''){var contents='';// Special-case text clippings, which have an empty type but include\r\n\t// `.textClipping` in the file name. `readAsText` results in an empty\r\n\t// string for text clippings, so we force the file name to serve\r\n\t// as the text value for the file.\r\n\tif(TEXT_CLIPPING_REGEX.test(file.name)){contents=file.name.replace(TEXT_CLIPPING_REGEX,'');}callback(contents);return;}var reader=new FileReader();reader.onload=function(){callback(reader.result);};reader.onerror=function(){callback('');};reader.readAsText(file);}", "function loadFile(){\n\t\tsource = document.getElementById(\"textFile\");\n\t\tfile = source.files[0];\n\t\treader = new FileReader();\n\t\treader.onload = function() {\n\t\t\tvar text = reader.result;\n\t\t\ttext = text.replace(/\\r/gi, '');\n\t\t\ttext = text.replace(/\\n\\n/gi, '\\n');\n\t\t\tclearText();\n\t\t\tvar lines = getLines(text);\n\t\t\tfor(var i in lines){\n\t\t\t\tif(lines[i] == ''){\n\t\t\t\t\tlines[i] = '<br>';\n\t\t\t\t} \n\t\t\t\tif(i==0){\n\t\t\t\t\t$('#textBody').html(lines[i]);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tvar newLine = document.createElement('div')\n\t\t\t\t\tnewLine.innerHTML = lines[i];\n\t\t\t\t\tdocument.getElementById(\"textBody\").appendChild(newLine);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\treader.readAsText(file);\n}", "function save() {\n\nvar txt = document.getElementById(\"txt\").value;\n\t\n var textToWrite = document.getElementById(\"txt\").value;\n var textFileAsBlob = new Blob([textToWrite], {\n type:\"text/plain\"\n\t\t\t\t\t//add function to make files save as html files, using if/else and .substring of textarea\n });\n var fileNameToSaveAs = prompt(\"Name your file\");\n\n var downloadLink = document.createElement(\"a\");\n downloadLink.download = fileNameToSaveAs;\n {\n downloadLink.href = window.webkitURL.createObjectURL(textFileAsBlob);\n }\n downloadLink.click();\n }", "function handleFiles(files) {\n // Check for the various File API support.\n if (window.FileReader) {\n // FileReader are supported.\n getAsText(files[0]);\n } else {\n alert('FileReader are not supported in this browser.');\n }\n}", "read() {\n return fs.readFileSync(this.filepath).toString();\n }", "function getAsText2(fileToRead) {\n var reader = new FileReader();\n\n reader.readAsText(fileToRead);\n\n reader.onload = loadHandler2;\n reader.onerror = errorHandler;\n}", "function sc_openOutputFile(s) {\n throw \"can't open \" + s;\n}", "function saveText(text, filename){\n var a = document.createElement('a');\n a.setAttribute('href', 'data:text/plain;charset=utf-u,'+encodeURIComponent(text));\n a.setAttribute('download', filename);\n a.click()\n }", "function getTextContentFromFiles(files, callback) {\n\t var readCount = 0;\n\t var results = [];\n\t files.forEach(function ( /*blob*/file) {\n\t readFile(file, function ( /*string*/text) {\n\t readCount++;\n\t text && results.push(text.slice(0, TEXT_SIZE_UPPER_BOUND));\n\t if (readCount == files.length) {\n\t callback(results.join('\\r'));\n\t }\n\t });\n\t });\n\t}", "function File() {}", "function load_txtFile(episodeStr, target) {\r\n var txtFile = new XMLHttpRequest();\r\n txtFile.open(\"GET\", \"assets/txt/episode\" + episodeStr + \".txt\", true);\r\n txtFile.onreadystatechange = function () {\r\n if (txtFile.readyState === 4 && txtFile.status == 200)\r\n content = txtFile.responseText;\r\n target.innerHTML = content;\r\n }\r\n txtFile.send(null);\r\n}", "function readFile(print) {\n const ERR_MESS_READ = \"TODO: Trouble reading file.\";\n\n var i;\n\n todocl.dbx.filesDownload({\n path: todocl.path\n }).then(function (response) {\n var textBlob, reader;\n\n textBlob = response.fileBlob;\n reader = new FileReader();\n\n reader.addEventListener(\"loadend\", function () {\n var contents = reader.result;\n todocl.textArr = contents.split(NEW_LINE);\n\n setText(todocl.textArr,\n function (callBack) {\n if (callBack && print) {\n displayFile();\n }\n if (callBack) {\n\n }\n });\n });\n reader.readAsText(textBlob);\n }).catch(function (Error) {\n todocl.out.innerHTML = ERR_MESS_READ;\n });\n }", "function readFile(file, mode) {\n const fileInfo = fs.readFileSync(file).toString().split(\"|---|\");\n const title = fileInfo[0].toUpperCase();\n const link = fileInfo[1];\n\n if (mode) {\n if (title.split(\"(\") === undefined) {\n return title.toUpperCase();\n }\n \n else {\n return title.toUpperCase().split(\"(\")[0];\n }\n }\n\n else {\n return link;\n }\n }", "function handleFiles2(files) {\n if (window.FileReader) {\n getAsText2(files[0]);\n } else {\n alert('FileReader are not supported in this browser.');\n }\n}", "function appendText() {\n var cleanAppend = '\\n' + input +'\\n' + result + '\\n' + \"------------------------------------------------------------\";\n fs.appendFile(\"log.txt\", cleanAppend, function (err) {\n\n if (err) {\n console.log(err);\n } \n });\n}", "async function processText(fileName, encoding = \"utf-8\") {\r\n try {\r\n let text2 = await fs.promises.readFile(fileName, encoding);\r\n console.log(text2);\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n}", "function InFile() {\r\n}", "function whateverYouSay() {\n fs.readFile('random.txt', 'utf8', function(error, data) {\n \n if (error) {\n return console.log(error)\n }\n\n});\n}", "function changeTextFile(){\n var inputs = document.querySelectorAll( '.inputfile1' );\n Array.prototype.forEach.call( inputs, function( input )\n {\n var label\t = input.nextElementSibling,\n labelVal = label.innerHTML;\n\n input.addEventListener( 'change', function(e)\n {\n var fileName = '';\n \n if( this.files && this.files.length > 1 )\n fileName = ( this.getAttribute( 'data-multiple-caption' ) || '' ).replace( '{count}', this.files.length );\n else\n fileName = e.target.value.split( '\\\\' ).pop();\n\n if( fileName )\n {\n label.querySelector( 'span' ).innerHTML = fileName;\n }\n else\n {\n label.innerHTML = labelVal;\n }\n });\n });\n}", "function readFile() {\n $.get('words.txt', function (data) {\n arr = data.split(' ');\n });\n }", "function doWhat (){\n var fs = require(\"fs\");\n\n// Running the readFile module that's inside of fs.\n// Stores the read information into the variable \"data\"\nfs.readFile(\"random.txt\", \"utf8\", function(err, data) {\n if (err) {\n return console.log(err);\n }\n\n // We will then print the contents of data\n console.log(data);\n\n// // Then split it by commas (to make it more readable)\n// var dataArr = data.split(\",\");\n\n// // We will then re-display the content as an array for later use.\n// console.log(dataArr);\n});\n\n}", "writeln(txt) {\n\n this.fileOut.write(txt + \"\\n\")\n\n }", "function showFile(){\n\twindow.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;\n\tfunction onInitFs(fs) {\n\t\tfs.root.getFile('log.txt', {}, function(fileEntry) {\n\n // Get a File object representing the file,\n // then use FileReader to read its contents.\n fileEntry.file(function(file) {\n var reader = new FileReader();\n\n reader.onloadend = function(e) {\n var txtArea = document.createElement('textarea');\n txtArea.value = this.result;\n document.body.appendChild(txtArea);\n };\n\n reader.readAsText(file);\n }, errorHandler);\n\n }, errorHandler);\n\n\t}\n\twindow.requestFileSystem(window.TEMPORARY, 5*1024*1024 /*5MB*/, onInitFs, errorHandler);\n}", "function randomTextRead() {\n fs.readFile(\"random.txt\", \"utf8\", function(error, data) {\n if (error) {\n return console.log(error);\n }\n console.log(data);\n var dataArr = data.split(\",\");\n console.log(dataArr);\n command = dataArr[0];\n song = dataArr[1];\n getSongs();\n console.log(\"------------------------------------------\");\n \n\n })\n}", "function doIt() {\n\t\tfs.readFile(\"random.txt\", \"UTF8\", function(err,data){\n\t\t\tif(err){\n\t\t\t\tconsole.log(\"Bummer.There's an error: \" + err);\n\t\t\t}\n\n\t\t\tvar dataArray = data.split(',');\n\t\t\tliri(dataArray[0], dataArray[1]);\n\t\t});\n\n\t}", "function FileReader () {}", "function formatFile(files) {\n\tvar res = '';\n\tfor (var i=0; i<files.length; i++) \n\t\tres += files[i] + '\\n';\n\treturn res;\n}", "function readfile(s)\n{\n\talllines=[];\n\tcueindex=[];\n\tcueNameList=[];\n\tvar f = new File(s);\n\tvar i,line,c;\n\n\tif (f.isopen) {\n\t\ti=0;\n\t\twhile ((line = f.readline()) != null) {//returns a string\n\t\t\tlineArray=convertToNiceArray(line);\n\t\t\t\n\t\t\t\n\t\t\talllines.push(lineArray);\n\t\t\tif (lineArray[0]==\"cue\"){\n\t\t\t\tcueindex.push(i);\n\t\t\t\tcueNameList.push(lineArray.slice(1).toString());\n\t\t\t}\n\t\t\ti++;\n\t\t\t\n\t\t}\n\t\tf.close();\n\tgetcues();\n\t} else {\n\t\tpost(\"could not open file: \" + s + \"\\n\");\n\t}\n}", "function handleFiles1(files) {\n if (window.FileReader) {\n getAsText1(files[0]);\n } else {\n alert('FileReader are not supported in this browser.');\n }\n}", "Get(filename)\n {\n return \"\";\n }", "function readEntireTextFile(filepath, func) {\n var called = false;\n try {\n obj.fs.open(filepath, 'r', function (err, fd) {\n obj.fs.fstat(fd, function (err, stats) {\n var bufferSize = stats.size, chunkSize = 512, buffer = new Buffer(bufferSize), bytesRead = 0;\n while (bytesRead < bufferSize) {\n if ((bytesRead + chunkSize) > bufferSize) { chunkSize = (bufferSize - bytesRead); }\n obj.fs.readSync(fd, buffer, bytesRead, chunkSize, bytesRead);\n bytesRead += chunkSize;\n }\n obj.fs.close(fd);\n called = true;\n func(buffer.toString('utf8', 0, bufferSize));\n });\n });\n } catch (e) { if (called == false) { func(null); } }\n }", "function fileLoaded(data) {\n var txt = data.join('\\n');\n\n input.html(txt);\n // Note the use of a function that will 'process' the text\n // This is b/c the text might come in a number of different ways\n // process(txt);\n}", "function getInput() {\n var data = fs.readFileSync('./input/thoughtWorks.txt', 'utf8');\n return data.toString();\n}", "readFile() {\n const fileContents = fs.readFileSync(this.fileName, { encoding: \"utf8\" })\n return fileContents.split(\"\\n\")\n }", "function whatever() {\n fs.readFile('random.txt', 'utf8', function(error, data) {\n \t// text converted to array\n var randomArray = data.split(\",\");\n // passes array data to appropriate function\n if (randomArray[0] == 'spotify-this-song') {\n \tspotify(randomArray[1]);\n }\n if (randomArray[0] == 'movie-this') {\n movies(randomArray[1]);\n }\n });\n}", "function generateText() {\n\n words.clear()\n var textFile = document.getElementById(\"inputFile\")\n //console.log(textFile)\n parseFile(textFile)\n\n}", "function add(txt) {\n src.push(txt || \"\");\n }", "function LoadText() {\n\tReadCSV(\"CurrentText\", CurrentChapter, CurrentScreen, \"Text\", GetWorkingLanguage());\n}", "function doWhatFileSays(){\n\n // Load the NPM Package fs\n // fs is a core Node package for reading and writing files\n var fs = require(\"fs\");\n\n // This block of code will read from the \"random.txt\" file.\n // It's important to include the \"utf8\" parameter or the code will provide stream data (garbage)\n // The code will store the contents of the reading inside the variable \"instructions\"\n fs.readFile(\"random.txt\", \"utf8\", function(error, instructions) {\n\n // If the code experiences any errors it will log the error to the console.\n if (error) {\n return console.log(error);\n }\n\n // We will then print the contents of data\n console.log(instructions);\n\n // Then split it by commas (to make it more readable)\n var dataArr = instructions.split(\",\");\n\n // We will then re-display the content as an array for later use.\n console.log(dataArr);\n\n switch(dataArr[0])\n {\n\n case \"concert-this\":\n console.log(\"calling concert-this\");\n writeConcertInfo(dataArr[1]);\n break;\n\n case \"spotify-this-song\":\n console.log(\"calling spotify-this-song\");\n writeSongInfo(dataArr[1]);\n break;\n\n case \"movie-this\":\n console.log(\"calling movie-this\");\n writeMovieInfo(dataArr[1]);\n break;\n }\n\n });\n}", "function sc_openInputFile(s) {\n throw \"can't open \" + s;\n}", "function readFile() {\n\n var fileName = \"\";\n\n //if a file name is given then store it in the fileName variable.\n if(nodeArgs[3]) {\n fileName = nodeArgs[3];\n }\n //if no file name is given then default the file name to 'random.txt'.\n else {\n fileName = \"random.txt\";\n }\n\n fs.readFile(fileName, \"utf8\", function(err, data) {\n //if the code experiences any errors it will lof the error and return it to terminate the program. \n if(err){\n console.log(err);\n console.log(\"\\n************ Enter an existing text file name in the folder **************\\n\");\n return;\n }\n //let user know that file name can be inserted.\n if(fileName != \"log.txt\") {\n console.log(\"\\nInsert log.txt as the file name after 'do-what-it-says' to have the program run your latest commands out of that file.\");\n }\n\n if(data.length < 1) {\n console.log(\"\\n******** This file is empty, add to the file before trying to read from it *******\\n\")\n }\n else {\n //stores each piece of data between commas in a different index of the array.\n var dataArr = data.split(\",\");\n //this sets the parameter to the last argument in the file...\n //note: if format is not sustained within the text files (i.e. \"COMMAND\",\"PARAMETER\",\"COMMAND\",\"PARAMETER\")then this function will break.\n nodeArgs[3] = dataArr[(dataArr.length - 1)];\n //this sets the command to the last used command in the file...\n //again..this will break if format is not sustained.\n liri(dataArr[(dataArr.length - 2)]);\n }\n });\n \n}", "function random() {\n\tfs.readFile(random.txt, \"utf8\", function(err, data){\n\n\t});\n}", "function saveFile(){\n\tvar name = prompt(\"What is the file name?\");\n\tvar type = prompt(\"Please type the extension(no full stop)\");\n\tvar file = document.createElement(\"a\");\n\tdocument.body.appendChild(file);\n\tfile.style = \"display: none\";\n\tvar text = getText();\n\ttext = text.replace(/([^\\r])\\n/g, \"$1\\r\\n\");\n\tblob = new Blob([text], {type: \"text\"});\n\turl = URL.createObjectURL(blob);\n\tfile.href = url;\n\tfile.download = name+\".\"+type;\n\tfile.click();\n\tURL.revokeObjectURL(url);\n}", "function TextData(){}" ]
[ "0.63146454", "0.6283607", "0.566496", "0.5661632", "0.564107", "0.5626804", "0.5594489", "0.5593659", "0.55753285", "0.55447704", "0.55447704", "0.55336475", "0.55014366", "0.5476736", "0.54633933", "0.5455586", "0.54367346", "0.54200983", "0.54191923", "0.5414083", "0.5412145", "0.5403012", "0.5401745", "0.5388381", "0.5337374", "0.5335221", "0.5334657", "0.53315544", "0.53217274", "0.5317878", "0.53172374", "0.5304957", "0.5304793", "0.52946883", "0.5287188", "0.5285827", "0.52768666", "0.5272023", "0.5264359", "0.5264359", "0.5264359", "0.5240302", "0.52346617", "0.52324086", "0.5227926", "0.52271104", "0.52213556", "0.5217378", "0.52123934", "0.52092814", "0.52081656", "0.52053404", "0.51862544", "0.51749414", "0.51747155", "0.5159856", "0.5154444", "0.5152196", "0.51447177", "0.51445174", "0.5140678", "0.51383895", "0.5135181", "0.513301", "0.5128313", "0.5127529", "0.512736", "0.5124596", "0.51204675", "0.511813", "0.5115338", "0.5106688", "0.509925", "0.50955147", "0.5095437", "0.50947106", "0.5088244", "0.50845224", "0.5084053", "0.50810945", "0.5078077", "0.5074842", "0.5070985", "0.5069682", "0.50683516", "0.5060433", "0.5059961", "0.50597566", "0.5056476", "0.5051006", "0.5047414", "0.5041337", "0.5040781", "0.5040325", "0.5036464", "0.50285524", "0.5028238", "0.5027565", "0.5025785", "0.50236547", "0.50172037" ]
0.0
-1
generic for ALL calls, todo, why optimize now!
function getResource(u, cb) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function all(func) {\n return function() {\n var params = getParams(arguments);\n var length = params.length;\n for (var i = 0; i < length; i++) {\n if (!func.call(null, params[i])) {\n return false;\n }\n }\n return true;\n };\n }", "function all(func) {\n return function() {\n var params = getParams(arguments);\n var length = params.length;\n for (var i = 0; i < length; i++) {\n if (!func.call(null, params[i])) {\n return false;\n }\n }\n return true;\n };\n }", "function all(func) {\n return function() {\n var params = getParams(arguments);\n var length = params.length;\n for (var i = 0; i < length; i++) {\n if (!func.call(null, params[i])) {\n return false;\n }\n }\n return true;\n };\n }", "function all(func) {\n return function () {\n var params = getParams(arguments);\n var length = params.length;\n for (var i = 0; i < length; i++) {\n if (!func.call(null, params[i])) {\n return false\n }\n }\n return true\n }\n }", "function all() {\n return true;\n }", "function addAll() {}", "function all(f, xs){ return and(map(f, xs)); }", "function all(func, array){\n for (var i=0; i<array.length; i++){\n\t if (!func(array[i])) return false;\n }\n return true;\n }", "apply () {}", "function every(obj, call) {\n for (var i in obj) {\n if (!call(obj[i], i)) return false;\n }\n return true;\n}", "function doAll(/* args */){\n\t\tvar fn = Array.prototype.shift.call(arguments);\n\t\tif(!arguments.length) {\n\t\t\treturn fn();\n\t\t} else {\n\t\t\tfn();\n\t\t\treturn doAll.apply(null, arguments);\n\t\t}\n\t}", "static all() {\n return allDoges\n }", "static getAll(){\n return [...all]\n }", "function all2(func2, arg1, arg2s) {\n var len = arg2s.length;\n for (var i = 0; i < len; i += 1) {\n\tfunc2(arg1, arg2s[$A$Num(i)]);\n }\n }", "static all(iterable) {\n return CustomPromise.handleArray(iterable, { resolveAll:1, rejectAny:1 });\n }", "all (reporter) { return this.every(reporter) }", "function all_in() {\n raise('all in');\n}", "static private internal function m121() {}", "all() {\n return Object.values(this.byId); // alloc??\n }", "function every(arr, boo) {\n return arr.forEach(function(el) {console.log(boo(el)); return boo(el)})\n}", "private public function m246() {}", "onAny() {}", "private internal function m248() {}", "function n(t, n, e) {\n return Object(_promiseUtils_js__WEBPACK_IMPORTED_MODULE_0__[\"eachAlways\"])(t.map(function (r, t) {\n return n.apply(e, [r, t]);\n }));\n }", "function arrCall(arr, foo, arg1=null, arg2=null, arg3=null, arg4=null){\n\tfor (var k in arr){\n\t\tfoo.call(arr[k], arg1, arg2, arg3, arg4);\n\t}\n}", "transient protected internal function m189() {}", "forEach(f) {\n for (var i=0,l=this.count; i<l; i++) {\n f(this.get(i));\n }\n }", "function checkAllHelper(){\n\tcheckAll(selected_furn);\n}", "function i(e,t){for(var n=0;n<e.length;n++)t(e[n],n)}", "function each(e,t){if(e){var i;for(i=0;i<e.length&&(!e[i]||!t(e[i],i,e));i+=1);}}", "function all(p, xs){\r\n return and(map(p, xs));\r\n}", "static get TYPE_ALL() {\n return TYPE_ALL;\n }", "forEach(func){\n this.foreach(func);\n }", "function rltall () {\n}", "function each(objOrArr, callBack) {\n\n\n}", "forAllObjects (fcn, obj = {}) {\n for (var i = 0, len = this.length; i < len; i++) {\n this.getObject(i, obj)\n fcn(obj, i)\n }\n }", "forEach(iterator) {\n // don't use _.each, because we can't break out of it.\n var keys = Object.keys(this._map);\n\n for (var i = 0; i < keys.length; i++) {\n var breakIfFalse = iterator.call(\n null,\n this._map[keys[i]],\n this._idParse(keys[i])\n );\n\n if (breakIfFalse === false) {\n return;\n }\n }\n }", "all(format) {\n return getOccurrences.call(this, null, format, \"all\")\n }", "function addAllOpt(arr){\n if(Array.isArray(arr) && arr.length !== 0 ){\n return addAll(arr)\n }\n return 0\n}", "function all (data) {\n if (array(data)) {\n return testArray(data, false);\n }\n\n assert.object(data);\n\n return testObject(data, false);\n }", "function miFuncion (){}", "function any(func) {\n return function () {\n var params = getParams(arguments);\n var length = params.length;\n for (var i = 0; i < length; i++) {\n if (func.call(null, params[i])) {\n return true\n }\n }\n return false\n }\n }", "function n(t,e){Object.keys(t).forEach(function(i){return e(t[i],i)})}", "function all(fn, list) {\n \n return !list || \n ( fn(head(list)) && all(fn, tail(list)) );\n}", "function all(fn, list) {\n \n return !list || \n ( fn(head(list)) && all(fn, tail(list)) );\n}", "function all(fn, list) {\n \n return !list || \n ( fn(head(list)) && all(fn, tail(list)) );\n}", "function all(fn, list) {\n \n return !list || \n ( fn(head(list)) && all(fn, tail(list)) );\n}", "function all(fn, list) {\n \n return !list || \n ( fn(head(list)) && all(fn, tail(list)) );\n}", "function all(fn, list) {\n \n return !list || \n ( fn(head(list)) && all(fn, tail(list)) );\n}", "function all(fn, list) {\n \n return !list || \n ( fn(head(list)) && all(fn, tail(list)) );\n}", "function all(fn, list) {\n \n return !list || \n ( fn(head(list)) && all(fn, tail(list)) );\n}", "function all(fn, list) {\n \n return !list || \n ( fn(head(list)) && all(fn, tail(list)) );\n}", "function all(fn, list) {\n \n return !list || \n ( fn(head(list)) && all(fn, tail(list)) );\n}", "function all(fn, list) {\n \n return !list || \n ( fn(head(list)) && all(fn, tail(list)) );\n}", "function all(fn, list) {\n \n return !list || \n ( fn(head(list)) && all(fn, tail(list)) );\n}", "function all(fn, list) {\n \n return !list || \n ( fn(head(list)) && all(fn, tail(list)) );\n}", "function any(func) {\n return function() {\n var params = getParams(arguments);\n var length = params.length;\n for (var i = 0; i < length; i++) {\n if (func.call(null, params[i])) {\n return true;\n }\n }\n return false;\n };\n }", "function any(func) {\n return function() {\n var params = getParams(arguments);\n var length = params.length;\n for (var i = 0; i < length; i++) {\n if (func.call(null, params[i])) {\n return true;\n }\n }\n return false;\n };\n }", "function any(func) {\n return function() {\n var params = getParams(arguments);\n var length = params.length;\n for (var i = 0; i < length; i++) {\n if (func.call(null, params[i])) {\n return true;\n }\n }\n return false;\n };\n }", "function sr(e,t){Object.keys(e).forEach((function(n){return t(e[n],n)}))}", "function each(list, calling) {\n for (var thing in list) {\n calling(list[thing], thing);\n }\n}", "transient private protected internal function m182() {}", "function some(obj, func) {\n let newArr =Object.values(obj);\n for(let i=0; i<newArr.length; i++) {\n if(func(newArr[i]))\n return true;\n }\n return false;\n }", "function provideAll(r) {\n return self => provideAll_(self, r);\n}", "function executeMethodeForAllObject( methode )\n{\n\tvar i ;\n\tfor( i=0 ; i<aobjects.length ; i++ )\n\t{\n\t\tmethode.call( aobjects[i] ) ;\n\t}\n}", "function sel_all_chk_box(sel_all_id, chkbox_coll_name, this_el_id = null)\n{\n\tif(this_el_id != null)\n\t{\n\t\t// Case 1 DONE\n\t\t// if this_el_id is false, then, set select all false\n\t\tif($(this_el_id).is(':checked') == false)\n\t\t{\n\t\t\t$(sel_all_id).prop('checked', false);\n\t\t\treturn false;\n\t\t}\n\t\t// Case 2\n\t\t// If this_el_id is true, then loop and, check for all chkbox_coll_name, to set select_all - true or false\n\t\t// in else condition, set tr_fa to false, then break, then assign, the last value of tr_fa to select_all checkbox\n\t\tvar tru_fal = null;\n\t\tif($(this_el_id).is(':checked') )\n\t\t{\n\t\t\t$(':checkbox[name=\"'+chkbox_coll_name+'\"]').each( function(){\n\t\t\t\ttru_fal = $(this).is(':checked');\n\t\t\t\tif(tru_fal == false)\n\t\t\t\t{\n\t\t\t\t\t$(sel_all_id).prop('checked', tru_fal);\n\t\t\t\t\t//break;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t$(sel_all_id).prop('checked', tru_fal);\n\t\t\t});\n\t\t\t// for the moment false - JLT\n\t\t\treturn false;\n\t\t}\n\t}\n\t// Case 3\n\t// If select_all is true set all true, else, set all false, loop through & set, the value of select_all\n\tif($(sel_all_id).is(':checked') == true || $(sel_all_id).is(':checked') == false)\n\t{\n\t\ttru_fal = $(sel_all_id).is(':checked');\n\t\t// Loop now\n\t\t$(':checkbox[name=\"'+chkbox_coll_name+'\"]').each(function(){\n\t\t\t\t$(this).prop('checked', tru_fal);\n\t\t});\n\t}\n}", "function tryThese() {\n for (var i=0; i < arguments.length; i++) {\n try {\n var item = arguments[i]() ;\n return item ;\n } catch (e) {}\n }\n return NO;\n }", "static any(iterable) {\n return CustomPromise.handleArray(iterable, { resolveAny:1, rejectAll:1 });\n }", "function allOf() {\n return _.reduceRight(\n arguments,\n function (truth, f) { return truth && f(); },\n true\n );\n}", "function sel_all_chk_box(sel_all_id, chkbox_coll_name, this_el_id)\n{\n\tif( this_el_id != null || this_el_id != \"undefined\" )\n\t{\n\t\t// Case 1 DONE\n\t\t// if this_el_id is false, then, set select all false\n\t\tif($(this_el_id).is(':checked') == false)\n\t\t{\n\t\t\t$(sel_all_id).prop('checked', false);\n\t\t\treturn false;\n\t\t}\n\t\t// Case 2\n\t\t// If this_el_id is true, then loop and, check for all chkbox_coll_name, to set select_all - true or false\n\t\t// in else condition, set tr_fa to false, then break, then assign, the last value of tr_fa to select_all checkbox\n\t\tvar tru_fal = null;\n\t\tif($(this_el_id).is(':checked') )\n\t\t{\n\t\t\t$(':checkbox[name=\"'+chkbox_coll_name+'\"]').each( function(){\n\t\t\t\ttru_fal = $(this).is(':checked');\n\t\t\t\tif(tru_fal == false)\n\t\t\t\t{\n\t\t\t\t\t$(sel_all_id).prop('checked', tru_fal);\n\t\t\t\t\t//break;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t$(sel_all_id).prop('checked', tru_fal);\n\t\t\t});\n\t\t\t// for the moment false - JLT\n\t\t\treturn false;\n\t\t}\n\t}\n\t// Case 3\n\t// If select_all is true set all true, else, set all false, loop through & set, the value of select_all\n\tif($(sel_all_id).is(':checked') == true || $(sel_all_id).is(':checked') == false)\n\t{\n\t\ttru_fal = $(sel_all_id).is(':checked');\n\t\t// Loop now\n\t\t$(':checkbox[name=\"'+chkbox_coll_name+'\"]').each(function(){\n\t\t\t\t$(this).prop('checked', tru_fal);\n\t\t});\n\t}\n}", "function any() {\n }", "static private protected internal function m118() {}", "function every(t, f) {\n if (typeof t === \"function\" && f === undefined) {\n return get().map(t);\n } else if (typeof t === \"string\") {\n return get(t).map(f);\n }\n }", "function every(array, test) {\n // Your code here.\n }", "static getAll(cb){\n getMentorsFromFile(cb)\n }", "function all(iter, f) {\n if (iter.length === 0)\n return true;\n return iter.map(f).reduce(\n function (a, b) { return (!!a) && (!!b); }\n );\n}", "function sc_forEach(proc, l1) {\n if (l1 === undefined)\n\treturn undefined;\n // else\n var nbApplyArgs = arguments.length - 1;\n var applyArgs = new Array(nbApplyArgs);\n while (l1 !== null) {\n\tfor (var i = 0; i < nbApplyArgs; i++) {\n\t applyArgs[i] = arguments[i + 1].car;\n\t arguments[i + 1] = arguments[i + 1].cdr;\n\t}\n\tproc.apply(null, applyArgs);\n }\n // add return so FF does not complain.\n return undefined;\n}", "function each(collection,fn){var i=0,length=collection.length,cont;for(i;i<length;i++){cont=fn(collection[i],i);if(cont===false){break;//allow early exit\r\n\t}}}", "every(callback, subject, predicate, object, graph) {\n let some = false;\n const every = !this.some(quad => {\n some = true;\n return !callback(quad);\n }, subject, predicate, object, graph);\n return some && every;\n }", "function forEachCall(obj, func) {\n \n // loop though the items in the object\n for (var prop in obj) {\n \n // restrict to only immediate properties of the object (exclude inherited)\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n\n // call the function passing in the value and property\n func.call(null, obj[prop], prop);\n }\n }\n }", "function callingAllWithArrays () {\n $Promise.all([]);\n $Promise.all(values);\n }", "function __it() {}", "transient private internal function m185() {}", "function all (data) {\n if (array(data)) {\n return testArray(data, false);\n }\n\n assert.object(data);\n\n return testObject(data, false);\n }", "function all (fn, list) {\n return !list ||\n (fn(head(list)) && all(fn, tail(list)))\n}", "function la(e,t){Object.keys(e).forEach((function(n){return t(e[n],n)}))}", "foreach(func){\n var data, _next;\n _next = this.next;\n this.next = null;\n\n while( (data = this.process()) != null )\n func(data);\n\n this.next = _next;\n }", "all(el, callback) {\n el = this.s(el);\n el.forEach((data) => {\n callback(this.toNodeList(data));\n });\n }", "function $forall(o, cb) {\n\t\tif (o instanceof Uint8Array) {\n\t\t\tfor (var i = 0, l = o.length; i < l; i++) {\n\t\t\t\t$k[$j++] = o[i];\n\t\t\t\tif (cb && cb() == $b) break;\n\t\t\t}\n\t\t} else if (o instanceof Array) {\n\t\t\t// The array may be a view.\n\t\t\tfor (var a = o.b, i = o.o, l = o.o + o.length; i < l; i++) {\n\t\t\t\t$k[$j++] = a[i];\n\t\t\t\tif (cb && cb() == $b) break;\n\t\t\t}\n\t\t} else if (typeof o === 'string') {\n\t\t\tfor (var i = 0, l = o.length; i < l; i++) {\n\t\t\t\t$k[$j++] = o.charCodeAt(i);\n\t\t\t\tif (cb && cb() == $b) break;\n\t\t\t}\n\t\t} else {\n\t\t\tfor (var id in o) {\n\t\t\t\t$k[$j++] = id;\n\t\t\t\t$k[$j++] = o[id];\n\t\t\t\tif (cb && cb() == $b) break;\n\t\t\t}\n\t\t}\n\t}", "function wrap_all() {\r\n // Iterate over list of arguments.\r\n for (var arg of arguments) {\r\n // If arg is an array or a node list wrap each node within it,\r\n // otherwise treat arg as a single node.\r\n if (Array.isArray(arg) || arg instanceof NodeList) {\r\n for (var node of arg) {\r\n wrap(node);\r\n }\r\n } else {\r\n wrap(arg);\r\n }\r\n }\r\n}", "function each(obj, fn) {\n\t\tif (!obj) { return; }\n\t\t\n\t\tvar name, i = 0, length = obj.length;\n\t\n\t\t// object\n\t\tif (length === undefined) {\n\t\t\tfor (name in obj) {\n\t\t\t\tif (fn.call(obj[name], name, obj[name]) === false) { break; }\n\t\t\t}\n\t\t\t\n\t\t// array\n\t\t} else {\n\t\t\tfor (var value = obj[0];\n\t\t\t\ti < length && fn.call( value, i, value ) !== false; value = obj[++i]) {\t\t\t\t\n\t\t\t}\n\t\t}\n\t\n\t\treturn obj;\n\t}", "function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }", "function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }", "function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }", "function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }", "function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }", "function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }", "function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }", "function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }", "function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }", "function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }" ]
[ "0.5767316", "0.5767316", "0.5767316", "0.5733055", "0.5611387", "0.55834943", "0.55788726", "0.5536664", "0.5461371", "0.54512393", "0.5443003", "0.5428783", "0.5418442", "0.5386806", "0.5358905", "0.5334537", "0.5329419", "0.5316431", "0.52966267", "0.5258802", "0.52530056", "0.524571", "0.52174914", "0.5180581", "0.51687026", "0.5141641", "0.51190287", "0.5118872", "0.511216", "0.5106889", "0.51066", "0.50996673", "0.5089514", "0.50765646", "0.50762546", "0.5060398", "0.50547296", "0.50541663", "0.50500655", "0.50174", "0.5016986", "0.50161546", "0.5014761", "0.5012176", "0.5012176", "0.5012176", "0.5012176", "0.5012176", "0.5012176", "0.5012176", "0.5012176", "0.5012176", "0.5012176", "0.5012176", "0.5012176", "0.5012176", "0.5004341", "0.5004341", "0.5004341", "0.50030273", "0.5002601", "0.5001686", "0.49918285", "0.4977213", "0.49770805", "0.49682865", "0.49625972", "0.4962361", "0.49611336", "0.49516904", "0.49422804", "0.49394038", "0.4936403", "0.49267995", "0.49264684", "0.49171305", "0.4914781", "0.49119407", "0.49112937", "0.4908784", "0.4907977", "0.49024662", "0.4901729", "0.48915115", "0.4890272", "0.4889456", "0.48741344", "0.48679656", "0.48643595", "0.48620525", "0.48549563", "0.48388156", "0.48388156", "0.48388156", "0.48388156", "0.48388156", "0.48388156", "0.48388156", "0.48388156", "0.48388156", "0.48388156" ]
0.0
-1
Function created to extract data from the Search.gov API
function createJobListForGovJobs(dataInfo) { let result = ""; for (let i = 0; i < dataInfo.length; i++) { result += "<div class='list' style='cursor: pointer;' onclick='window.location=" + '"' + dataInfo[i].url + '"' + ";'> "; result += "<img src='https://search.gov/img/searchdotgovlogo.png'></img>" result += "<div> <h1>" + dataInfo[i].position_title + "</h1> </div>"; result += "<div> <h2>" + dataInfo[i].organization_name + "</h2> </div>"; let fixedLocation = ""; for (let y = 0; y < dataInfo[i].locations.length; y++) { fixedLocation += dataInfo[i].locations[y] + "<br/>"; } result += "<div> <h2>" + fixedLocation + "</h2> </div>"; // Date format DD MM YYYY let fixedDate = dataInfo[i].start_date.split("-"); result += "<div> <h3>" + fixedDate[2] + "/" + fixedDate[1] + "/" + fixedDate[0] + "</h3> </div>"; result += "</div> " } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getData() {\n\tvar query = \"http://api.nytimes.com/svc/search/v2/articlesearch.json?q=\" + search + \"&api-key=\" + key;\n\trequest({\n\t\turl: query,\n\t\tjson: true\n\t}, \n\tfunction(error, response, data) {\n\t\tif (error) {\n\t\t\tthrow error;\n\t\t}\n\t\tvar urls = [];\n\t\tvar docs = data.response.docs;\n\t\tfor (var d in docs) {\n\t\t\turls.push(docs[d].web_url);\n\t\t}\n\t\tconsole.log(urls);\n\t});\n}", "function getDataFromApi (searchTerm, callback) {\n var query = {\n fillIngredients: false,\n ingredients: searchTerm,\n limitLicense: true,\n number: 6,\n ranking: 1\n }\n $.getJSON(SPOONACULAR_SEARCH_URL, query, callback);\n}", "function grab_data(search_terms) {\n // set the apikey and limit\n var apikey = \"RPXDNR1LTCTK\";\n var lmt = 1;\n var urls = search_terms.map(function(e){\n return \"https://api.tenor.com/v1/search?q=\" + e + \"&key=\" + apikey + \"&limit=\" + lmt;\n });\n return;\n}", "async fetchData(searchTerm) {\n const response = await axios.get(\"http://www.omdbapi.com/\", {\n params: {\n apikey: \"3373d3bd\",\n s: searchTerm,\n },\n });\n\n //check for errors before we get back our response\n if (response.data.Error) {\n //empty array meaning we didnt get anything back to show to the user\n return [];\n }\n\n //return the data we want\n return response.data.Search;\n }", "async function getSearchData() {\n //First check if the keyword is valid\n var keyword = GET.keyword;\n //Abort if keyword is undefined or not of a proper length\n if (!keyword || keyword.length < 1) return;\n //Now set up the request method\n let response = await fetch('https://manc.hu/api/lexicon/search', {\n method: 'post',\n mode: \"cors\",\n cache: \"no-cache\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n },\n headers: {\n \"Authorization\": \"Bearer \" + (await getAccessToken()),\n \"Content-Type\": \"application/json\",\n },\n body: '{\"query\": \"' + keyword + '\",\"definition\": true,\"from\": 0,\"size\": 100}'\n });\n //Now wait for the response\n let result = await response.json();\n return result;\n}", "async getSearchEndpoint() {\n const response2 = await fetch(\n `https://www.alphavantage.co/query?function=SYMBOL_SEARCH&keywords=${\n this.symbolSearch\n }&apikey=${this.apiKey}`\n );\n const response2Data = await response2.json();\n\n return response2Data;\n }", "function getResults(){\n\tvar api_endpt = \"http://en.wikipedia.org/w/api.php\";\n\t$.ajax({\n\t\turl: api_endpt,\n\t\tdata: { action: 'opensearch', search: $(\"input[name=search]\").val(), format: 'json' }, \n\t\tdataType: \"jsonp\",\n\t\ttype: \"GET\",\n\t\terror: function(){\n\t\t\tconsole.log(\"could not receive data\");\n\t\t},\n\t\tsuccess: printInfo\n\t});\n}", "function fetchSearchData(searchTerm) {\n let url = searchBaseURL + \"?api_key=\" + apiKey + \"&q=\" + searchTerm;\n console.log(url);\n window\n .fetch(url)\n .then(res => res.json())\n .then(data => {\n console.log(data)\n\n // constructing second search query to get all the rows of data\n let searchAllURL = url + `&start=0&rows=${data.response.rowCount}`;\n console.log(searchAllURL);\n searchAllData(searchAllURL);\n })\n .catch(error => {\n console.log(error);\n })\n}", "function makeSearchRequest(uri) {\n fetch(uri)\n .then(function(response) {\n return response.json();\n })\n .then(function(myJson) {\n extractNeededData(myJson.response.venues);\n console.log(myJson.response);\n })\n .catch(function(error) {\n console.log(error);\n });\n}", "async function callAPI(){\n\t let rawEtatStations = await fetch('https://data.mulhouse-alsace.fr/api/records/1.0/search/?dataset=68224_stationsvelocite_jcdecaux_tempsreel&rows=40&sort=-number&facet=status&facet=contract_name&facet=name&timezone=Europe%2FBerlin');\n\t return await rawEtatStations.json();\n\t}", "function getDataFromApi(searchTerm, callback) {\n displayLoadingMessage();\n $('.js-search-results').html();\n const settings = {\n url: endPoint,\n data: {\n term: 'restaurant',\n location: `${searchTerm}`,\n limit: 40,\n attributes: 'hot_and_new'\n },\n dataType: 'json',\n type: 'GET',\n success: callback\n };\n\n $.ajax(settings);\n\n}", "function getNewsResults() {\n // grab search term from UI\n if (isRefreshing) {\n searchTerm = lastSearched;\n }\n else {\n searchTerm = $(\"#searchTerm\").val();\n } // personal newsapi key\n var apiKey = '9dd7602e5a99dcd0eacce85dbe256de8';\n \n // base api url\n var baseUrl = 'https://gnews.io/api/v4/';\n // compile full request\n var requestUrl = `${baseUrl}search?q=${searchTerm}&lang=en&token=${apiKey}`;\n console.log(`requestUrl -> ${requestUrl}`);\n // make a request for the data at the \n\n fetch(requestUrl)\n .then(response => response.json())\n .then(data => processResults(data));\n}", "async function getSearchData() {\n const response = await getSearch({\n keywords: keyword,\n type,\n limit: limit_item,\n offset: (page - 1) * limit_item,\n });\n if (response.data.code === 200) {\n if (\n response.data.result.songCount > 0 ||\n type === \"1000\" ||\n type === \"1004\"\n ) {\n switch (type) {\n case \"1\":\n setSongList(response.data.result.songs);\n setTotal_item(response.data.result.songCount);\n break;\n case \"1000\":\n setPlayList(response.data.result.playlists);\n setTotal_item(response.data.result.playlistCount);\n break;\n case \"1004\":\n setMvList(response.data.result && response.data.result.mvs);\n setTotal_item(response.data.result.mvCount);\n break;\n default:\n break;\n }\n } else {\n alert(`No result match '${keyword}', please try again!`);\n }\n }\n }", "function search() {\n \n var xhr = new XMLHttpRequest();\n var uri = encodeURI('http://www.omdbapi.com/?S='+ document.getElementById('search_value').value + '&y=&plot=short&r=json')\n\n xhr.open('GET', uri, true);\n \n xhr.onreadystatechange = function() {\n if (xhr.readyState == 4) {\n var json_parse = JSON.parse(xhr.response)\n search_works(json_parse)\n }\n }\n\n xhr.send(null);\n \n}", "function getUserData2(displayFunction){\n var result = null;\n var xhr = new XMLHttpRequest(); \n var title = (document.getElementById('searchAll').value).split(' ').join('+')\n xhr.open('GET', 'https://www.omdbapi.com/?apikey=eae4ab59&s='+title);\n xhr.send()\n xhr.onload = function (){\n if(xhr.status == 200){\n result = JSON.parse(xhr.response);\n displayFunction(result);\n }\n else{\n console.log(\"Error Code is:\" + xhr.status);\n }\n } \n }", "function getSearchResults(searchTerm) {\n fetch('https://thinksaydo.com/tiyproxy.php?https://openapi.etsy.com/v2/listings/active?api_key=h9oq2yf3twf4ziejn10b717i&keywords=' + encodeURIComponent(searchTerm) + '&includes=Images,Shop')\n .then(response => response.json())\n .then(data => {\n searchResults = data;\n \n console.log(searchResults);\n\n renderResultCards();\n });\n}", "function getData(error, response) {\n if (error) throw error;\n\n // make json format from the data\n data = JSON.parse(response[0].responseText);\n\n // list for all the countries\n var countryArray = [];\n\n for(var i = 0; i < 30; i ++){\n countryArray.push(data.structure.dimensions.series[0].values[i][\"name\"])\n }\n\n // and a list with all the elements from api request\n var oecdArray = [];\n\n // place the values in the list\n for(var i = 0; i < countryArray.length; i ++){\n for(var j = 0; j < 4; j ++){\n var linking = i + \":\" + j + \":0\";\n oecdArray.push(data.dataSets[0].series[linking].observations);\n }\n }\n\n var values = [];\n\n // digging a little bit further so we skip non-values\n for(var i = 0; i < oecdArray.length; i ++){\n values.push(oecdArray[i][0][0]);\n }\n\n // list for all the internet access values\n var internetArray = [];\n\n // internet value is on 0th position in oecdArray\n for (var i = 0; i < values.length; i += 4){\n internetArray.push(values[i]);\n }\n\n // also for the voting turn out values\n var votesArray = [];\n\n // voting rate is on 1th position\n for(var i = 1; i < values.length; i += 4){\n votesArray.push(values[i]);\n }\n\n // share of people with secondary degree\n var secDegreeArray = [];\n\n // which is on the 2th position\n for(var i = 2; i < values.length; i += 4){\n secDegreeArray.push(values[i]);\n }\n\n // and one for the perception of corruption\n var perceptionArray = [];\n\n // which is on 3th position\n for(var i = 3; i < values.length; i += 4){\n perceptionArray.push(values[i]);\n }\n\n // making a dict for indexing later on\n // var wellBeingDict = [];\n\n // linking keys and values in dictionary\n for(var i = 0; i < 30; i++){\n wellBeingDict.push({\n country: countryArray[i],\n internet: internetArray[i],\n votes: votesArray[i],\n education: secDegreeArray[i],\n perception: perceptionArray[i]\n });\n }\n\n var w = 1200;\n var h = 600;\n var padding = 50;\n\n // create scale for width with extent returning the boundary as an array\n var xScale = d3.scaleLinear()\n .domain(d3.extent(wellBeingDict, function(d) {return d.perception}))\n .nice() // ensure scatters are within the range\n .range([0, w - padding]);\n\n // also for height\n var yScale = d3.scaleLinear()\n .domain([0, 100])\n .range([h - padding, 0]);\n\n // for the radius of a point\n var rScale = d3.scaleLinear()\n .domain(d3.extent(wellBeingDict, function(d) {return d.education}))\n .range([4, 20]);\n\n // and a function for sequential coloring (colorblind-friendly)\n var color = d3.scaleSequential(d3.interpolateRgb(\"#edf8fb\",\"#006d2c\"))\n .domain([d3.min(wellBeingDict, function(d) {return d.education}),\n d3.max(wellBeingDict, function(d) {return d.education})]);\n\n // function for creating x-axis later on\n var xAxis = d3.axisBottom()\n .scale(xScale);\n\n // and for y-axis\n var yAxis = d3.axisLeft()\n .scale(yScale);\n\n // update options\n var update = [\"Perception of corruption on x axis (%)\",\n \"Share of households with internet broadband access on x axis (%)\"];\n\n // creating tip box to show value\n var tip = d3.tip()\n .attr('class', 'd3-tip')\n .offset([-20, 0])\n .html(function(d, i) {\n return \"Country: \" + d.country\n + \"<br>\" + \"Share of households with internet broadband access: \" + d.internet + \"<br>\" +\n \" Voter turnout: \" + d.votes + \"<br>\" + \"Labour force withsecondary education: \" + d.education + \"<br>\" +\n \" Perception of corruption: \" + d.perception});\n\n // creating legend\n var legend = d3.legendColor()\n .labelFormat(d3.format(\".0f\"))\n .scale(color)\n .shapePadding(5)\n .shapeWidth(50)\n .shapeHeight(20)\n .labelOffset(12);\n\n // creating selection menu\n var select = d3.select('body')\n .append('select')\n \t.attr('class','select')\n .on('change',updateX)\n\n var options = select\n .selectAll('option')\n \t.data(update)\n .enter()\n \t.append('option')\n \t.text(function (d) {return d;})\n .classed('selected', function(d) {return d === xAxis;})\n .on('click', function(d) {\n xAxis = d;\n updateX();\n });\n\n // creating a canvas to draw my scatterplot on\n var svg = d3.select(\"body\")\n .append(\"svg\")\n .attr(\"width\", w)\n .attr(\"height\", h);\n\n // boxes with value's\n svg.call(tip);\n\n // drawing x-axis\n svg.append(\"g\")\n .attr(\"class\", \"axis\")\n .attr(\"transform\", \"translate(50,\" + (h - padding) + \")\")\n .call(xAxis)\n\n // adding label\n svg.append(\"text\")\n .attr(\"transform\", \"translate(1000, 585)\")\n .attr(\"class\", \"textClass\")\n .style(\"text-anchor\", \"middle\")\n .text(\"Perception of corruption (%)\");\n\n // drawing y-axis\n svg.append(\"g\")\n .attr(\"class\", \"axis\")\n .attr(\"transform\", \"translate(\" + padding + \")\")\n .call(yAxis)\n\n // adding label\n svg.append(\"text\")\n .attr(\"transform\", \"translate(15, 50) rotate(-90)\")\n .attr(\"class\", \"textClass\")\n .style(\"text-anchor\", \"end\")\n .text(\"Voter turnout (%)\");\n\n // placing legend\n svg.append(\"g\")\n .attr(\"transform\", \"translate(1100, 0)\")\n .call(legend);\n\n // drawing the scatters\n svg.selectAll(\"circle\")\n .data(wellBeingDict)\n .enter()\n .append(\"circle\")\n .attr(\"class\", \"point\")\n .attr(\"transform\", \"translate(50, 0)\")\n .attr(\"cx\", d => xScale(d.perception))\n .attr(\"cy\", d => yScale(d.votes))\n .attr(\"r\", d => rScale(d.education))\n .on('mouseover', tip.show)\n .on('mouseout', tip.hide)\n .style(\"fill\", d => color(d.education));\n\n function updateX() {\n\n // update axis and scale\n var independent = this.independent\n xScale.domain(d3.extent(wellBeingDict, function(d) {return d[independent]})).nice()\n xAxis.scale(xScale)\n\n // place new x-axis\n d3.select('#xAxis')\n .transition()\n .duration(750)\n .call(xAxis)\n\n // draw new scatters\n d3.selectAll('circle')\n .transition()\n .duration(750)\n .delay(function (d,i) {\n return i * 50\n })\n .attr('cx',function (d) {\n return xScale(d[independent])\n });\n\n };\n }", "function search() {\n var searchTerm = $(\"#searchTerm\").val();\n var numRecords = $(\"#articleRetrieve\").val();\n var startYear = $(\"#startYear\").val();\n var endYear = $(\"#endYear\").val();\n\n var queryURL = 'https://api.nytimes.com/svc/search/v2/articlesearch.json?api-key=gnonuSaxEo5iK92FxNJduzfDGBhhhehk&fq=source:(\"The New York Times\")&q='+searchTerm;\n if (startYear!==\"\") {\n queryURL += \"&begin_date=\"+startYear+\"0101\";\n }\n if (endYear!==\"\") {\n queryURL += \"&end_date=\"+endYear+\"1231\";\n }\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n .then(function(response) {\n console.log(response);\n\n\n\n\n });\n\n }", "function readSearchData() {\n var searchTerm = document.getElementById(\"keyword\").value;\n var state = document.getElementById(\"state\").value;\n var city = document.getElementById(\"city\").value;\n orgSearch(searchTerm, state, city);\n}", "function search(type, value) {\r\n let tsvurl = '';\r\n let kmlurl = '';\r\n let uid = '&uid=0x3cfb19ead752b37bb90da0eb3a0fe78baa9fa055';\r\n if (type == 'postcode') {\r\n tsvurl = 'https://www.nomisweb.co.uk/api/v01/dataset/NM_145_1.data.tsv?date=latest&geography=POSTCODE|' + value + ';299&rural_urban=0&cell=1...16&measures=20301&select=date_name,geography_code,cell_name,obs_value' + uid;\r\n kmlurl = 'https://www.nomisweb.co.uk/api/v01/dataset/NM_145_1.data.kml?date=latest&geography=POSTCODE|' + value + ';299&rural_urban=0&cell=0&measures=20100' + uid;\r\n } else {\r\n tsvurl = 'https://www.nomisweb.co.uk/api/v01/dataset/NM_145_1.data.tsv?date=latest&geography=LATLONG|' + value.lat + ';' + value.lng + ';299&rural_urban=0&cell=1...16&measures=20301&select=date_name,geography_code,cell_name,obs_value' + uid;\r\n kmlurl = 'https://www.nomisweb.co.uk/api/v01/dataset/NM_145_1.data.kml?date=latest&geography=LATLONG|' + value.lat + ';' + value.lng + ';299&rural_urban=0&cell=0&measures=20100' + uid;\r\n }\r\n fetch(tsvurl).then((response) => {\r\n return response.text();\r\n })\r\n .then((tsvdata) => {\r\n json = tsv2json(tsvdata);\r\n\r\n fetch(kmlurl).then((response) => {\r\n return response.text();\r\n })\r\n .then((str) => {\r\n return (new window.DOMParser()).parseFromString(str, \"text/xml\");\r\n })\r\n .then((kmldata) => {\r\n geojson = toGeoJSON.kml(kmldata);\r\n return geojson;\r\n })\r\n .then(() => {\r\n remMapLayer('selection');\r\n addMapLayer(geojson, 'selection');\r\n fitMapLayer(geojson);\r\n });\r\n return true;\r\n })\r\n .then(() => {\r\n data2table(json);\r\n })\r\n}", "function getSearchData(searchUrl, searchInput) {\n $.ajax({\n url: searchUrl,\n dataType: 'jsonp',\n data: {\n // API Parameters\n action: 'query',\n format: 'json',\n // Search Generator Params\n generator: 'search',\n gsrsearch: searchInput,\n gsrnamespace: 0,\n gsrlimit: 10,\n // Properties Params\n prop: 'extracts|pageimages',\n exchars: 400,\n exlimit: 'max',\n explaintext: true,\n exintro: true,\n piprop: 'thumbnail',\n pilimit: 'max',\n pithumbsize: 200\n },\n success: function (data) {\n drawWikiResults(data.query.pages);\n }\n });\n}", "function downloadSearchData() {\n fetch(`https://spacelaunchnow.me/api/3.3.0/${category.value}/?search=${term.value}`)\n .then(res => res.json())\n .then(data => determineCategory(data));\n}", "async getBasicInfo(){\n //<== Html selectors ==>\n const fieldNameClassName = \".gsc_oci_field\";\n const valueClassName = \".gsc_oci_value\";\n\n // <== Logic ==>\n\n // get fields \n const page = this.page;\n const fieldNameLst = await page.$$eval(fieldNameClassName, (options) =>\n options.map((option) => option.textContent\n ));\n const valueLst = await page.$$eval(valueClassName, (options) =>\n options.map((option) => option.textContent\n ));\n \n\n // <== Set data to json ==>\n for (var i in fieldNameLst){\n const fieldName = fieldNameLst[i];\n if (fieldName===\"Description\"){\n continue\n }\n if (fieldName==\"Total citations\"){\n continue\n }\n const value = valueLst[i];\n this.json[fieldName] = value\n }\n \n\n }", "function fetchTheData() {\r\n let baseURL = \"https://newsapi.org/v2/top-headlines\";\r\n deleteOld();\r\n let search = \"?q=\" + id(\"search\").value;\r\n id(\"searchTerm\").textContent = id(\"search\").value;\r\n let apiKey = \"&apiKey=c1c6c8286a5449b7a7fcc01deb46437c\";\r\n fetch(baseURL + search + apiKey)\r\n .then(checkStatus)\r\n .then(response => response.json()) // if json\r\n .then(processResponse)\r\n .catch(handleError);\r\n }", "function getResults() {\n var searchText = document.getElementById('search').value;\n \n odkData.query('pediatria', 'regdate = ?', [searchText], null, null, \n \t\tnull, null, null, null, true, cbSRSuccess, cbSRFailure);\n}", "async function Search__() \r\n {\r\n let cve_id_bein = \"https://cve.circl.lu/api/cve/\";\r\n \r\n const response = await fetch(cve_id_bein + message__);\r\n const data = await response.json();\r\n let json_split = JSON.parse(JSON.stringify(data));\r\n print_search(json_split.id, json_split.summary, json_split.references, json_split.cvss);\r\n }", "function Retrieve(jwt, Data) {\r\n return fetch('https://heath.infra.mediamath.com/deployments/search', {\r\n method: \"POST\",\r\n body: JSON.stringify(Data),\r\n headers: {\r\n \"Authorization\":`Bearer ${jwt}`,\r\n },\r\n})\r\n .then(result => result.json())\r\n// Loop to access each database object (hit) individually\r\n .then((body) => {\r\n for(i = 0; i < body.hits.hits.length; i++){\r\n console.log(prettify(body.hits.hits[i]));\r\n }\r\n})\r\n}", "function getResFromAPI(searchVal, callback) {\n let searchParams = '';\n let searchSnippet = '';\n\n for (i = 0; i < searchVal.length; i++){\n let resObj = searchVal[i];\n let firstItem = Object.keys(resObj)[0];\n if (firstItem != 'includeIngredients'){\n let itemName = Object.keys(resObj)[1];\n let itemVal = resObj[Object.keys(resObj)[1]];\n let minMaxVal = resObj.minMax;\n searchSnippet = '&' + minMaxVal + itemName + '=' + itemVal;\n }else{\n let itemName = Object.keys(resObj)[0];\n let itemVal = resObj[Object.keys(resObj)[0]]; \n searchSnippet = '&' + itemName + '=' + itemVal;\n }\n searchParams += searchSnippet;\n }\n\n const infoSettings = {\n url: getRecipesURI+`${searchParams}`, \n dataType: 'json',\n success: callback,\n error: function(err) { alert(err); },\n beforeSend: function(xhr) {\n xhr.setRequestHeader(\"X-Mashape-Authorization\", \"Dw5Du2x9f1mshumfYcTmv8RduW9Op1On2QIjsnwkVvyQwCuMSb\");\n }\n };\n\n $.ajax(infoSettings);\n }", "function getData() {\r\n fetch('http://www.omdbapi.com?s='+guardian+'&apikey=893a62a')\r\n .then(Response => Response.json())\r\n .then(data => {\r\n moviesData = data.Search\r\n console.log(moviesData);\r\n render(moviesData);\r\n })\r\n }", "function getRecords(datain)\n{\n var filters = new Array();\n var daterange = 'daysAgo90';\n var projectedamount = 0;\n var probability = 0;\n if (datain.daterange) {\n daterange = datain.daterange;\n }\n if (datain.projectedamount) {\n projectedamount = datain.projectedamount;\n }\n if (datain.probability) {\n probability = datain.probability;\n }\n \n filters[0] = new nlobjSearchFilter( 'trandate', null, 'onOrAfter', daterange ); // like daysAgo90\n filters[1] = new nlobjSearchFilter( 'projectedamount', null, 'greaterthanorequalto', projectedamount);\n filters[2] = new nlobjSearchFilter( 'probability', null, 'greaterthanorequalto', probability );\n \n // Define search columns\n var columns = new Array();\n columns[0] = new nlobjSearchColumn( 'salesrep' );\n columns[1] = new nlobjSearchColumn( 'expectedclosedate' );\n columns[2] = new nlobjSearchColumn( 'entity' );\n columns[3] = new nlobjSearchColumn( 'projectedamount' );\n columns[4] = new nlobjSearchColumn( 'probability' );\n columns[5] = new nlobjSearchColumn( 'email', 'customer' );\n columns[6] = new nlobjSearchColumn( 'email', 'salesrep' );\n columns[7] = new nlobjSearchColumn( 'title' );\n \n // Execute the search and return results\n \n var opps = new Array();\n var searchresults = nlapiSearchRecord( 'opportunity', null, filters, columns );\n \n // Loop through all search results. When the results are returned, use methods\n // on the nlobjSearchResult object to get values for specific fields.\n for ( var i = 0; searchresults != null && i < searchresults.length; i++ )\n {\n var searchresult = searchresults[ i ];\n var record = searchresult.getId( );\n var salesrep = searchresult.getValue( 'salesrep' );\n var salesrep_display = searchresult.getText( 'salesrep' );\n var salesrep_email = searchresult.getValue( 'email', 'salesrep' );\n var customer = searchresult.getValue( 'entity' );\n var customer_display = searchresult.getText( 'entity' );\n var customer_email = searchresult.getValue( 'email', 'customer' );\n var expectedclose = searchresult.getValue( 'expectedclosedate' );\n var projectedamount = searchresult.getValue( 'projectedamount' );\n var probability = searchresult.getValue( 'probability' );\n var title = searchresult.getValue( 'title' );\n \n opps[opps.length++] = new opportunity( record,\n title,\n probability,\n projectedamount,\n customer_display,\n salesrep_display);\n }\n \n var returnme = new Object();\n returnme.nssearchresult = opps;\n return returnme;\n}", "async fetchData(searchTerm) {\n const response = await axios.get('https://api.themoviedb.org/3/search/movie', {\n params: {\n api_key: 'f1aa11a7624dbaf3024fa5751d21ee70',\n query: searchTerm,\n }\n });\n // console.log(response);\n if(response.data.page === undefined){\n return [];\n }\n return response.data.results;\n }", "function getTrendingSearch() { \r\n const found = fetch(trendingGiphy + apiKey) \r\n .then((response) => {\r\n return response.json() \r\n }).then(data => {\r\n return data \r\n })\r\n .catch((error) => {\r\n return error \r\n })\r\n return found\r\n}", "function getSearchResults(search) {\r\n const found = fetch(link_giphy + search + '&api_key=' + apiKey)\r\n .then((response) => {\r\n return response.json()\r\n }).then(data => {\r\n return data\r\n })\r\n .catch((error) => {\r\n return error\r\n })\r\n return found\r\n}", "function searchIt() {\n var term = input.value();\n // Loop through every year\n for (var i = 0; i < total; i++) {\n var year = start + i;\n // Make the API query URL\n var url = makeURL(term, year);\n // Run the query and keep track of the index\n goJSON(url, i);\n }\n}", "function searchAllCountries() {\r\n GetAjaxData(\"https://restcountries.eu/rest/v2/all?fields=name;topLevelDomain;capital;currencies;flag\", response => createArrayFromAllCountries(response) , err => console.log(err))\r\n}", "function searchFromFilter() {\r\n GetAjaxData(\"https://restcountries.eu/rest/v2/all?fields=name;topLevelDomain;capital;currencies;flag\", response => filterArrayOfCountries(response) , err => console.log(err))\r\n}", "function getData(type, search){\r\n $.ajax(\r\n {\r\n url: url + 'search/' + type,\r\n \"data\" : {\r\n \"api_key\": \"a6adae1843502c7becfac80b53ca41ac\",\r\n \"query\" : search,\r\n \"language\" :\"it-IT\"\r\n },\r\n \"method\": \"GET\",\r\n \"success\": function (data, stato) {\r\n if(data.total_results > 0){\r\n print(type, data.results);\r\n } else {\r\n notFound(type);\r\n }\r\n },\r\n error: function (errore) {\r\n console.log(\"E' avvenuto un errore. \" + errore);\r\n }\r\n });\r\n }", "function getInputData() {\n //Dynamically create Saved Search to grab all eligible Sales orders to invoice\n //In this example, we are grabbing all main level data where sales order status are \n //any of Pending Billing or Pending Billing/Partially Fulfilled\n return search.create({\n type: \"salesorder\",\n filters:\n [\n [\"shipmethod\", \"anyof\", \"37\"],\n \"AND\",\n [\"type\", \"anyof\", \"SalesOrd\"],\n \"AND\",\n [\"status\", \"anyof\", \"SalesOrd:A\"],\n \"AND\",\n [\"memorized\", \"is\", \"F\"],\n \"AND\",\n [\"mainline\", \"is\", \"T\"],\n \"AND\", \n [\"amount\",\"greaterthan\",\"0.00\"], \n \"AND\", \n [\"custbody1\",\"anyof\",\"4926\"]\n ],\n columns:\n [\n search.createColumn({ name: \"tranid\", label: \"Document Number\" })\n ]\n });\n }", "async getInfo(keyword) {\n //http://openapi.seoul.go.kr:8088/(인증키)/xml/MgisArtPlace/1/5/\n //const response = await fetch(`http://openapi.seoul.go.kr:8088/${this.apiKey}/json/GetParkInfo/1/5`)\n const response = await fetch(`http://openapi.seoul.go.kr:8088/${this.apiKey}/json/MgisArtPlace/1/354/`)\n\n const responseData = await response.json();\n\n return responseData;\n\n }", "function getDataFromApi(searchTerm, callback){\n //console.log('searching: ' +searchTerm);\n const query = {\n \n api_key: '',\n q: `${searchTerm}`,\n limit: 5\n };\n \n $.getJSON(giphy_search_url,query,callback);\n}", "async fetchDataFromApi(movieIndex) {\n const res = await axios.get(\"http://www.omdbapi.com/\", {\n params: {\n apikey: \"b796d8f8\",\n s: `${movieIndex}`,\n },\n });\n if (res.data.Error) {\n return [];\n }\n return res.data.Search;\n }", "function concertThis(search){\n term = \"https://rest.bandsintown.com/artists/\" + searchTerm + \"/events?app_id=codingbootcamp\"\n\n axios\n .get(term)\n .then(function(response){\n // console.log(response.data);\n let data = response.data;\n for (let i=0; i<data.length; i++){\n var date = moment(data[i].datetime).calendar()\n \n // console.log(\"data[i]:\",data[i]);\n console.log(/--------------------------/);\n console.log(\"Venue Name: \",data[i].venue.name);\n console.log(\"Venue Location: \",data[i].venue.city + \" \" + data[i].venue.region);\n console.log(\"Date: \",date);\n console.log(/--------------------------/);\n \n }\n })\n .catch(function(error){\n if (error.response) {\n console.log(error.response.data);\n console.log(error.response.status);\n console.log(error.response.headers);\n } else if (error.request) {\n console.log(error.request);\n } else {\n console.log(\"Error\", error.message);\n }\n console.log(error.config);\n })\n \n}", "function getData(){\r\n\t\t// main entry point to web service\r\n\t\tconst SERVICE_URL = \"https://cors-anywhere.herokuapp.com/https://api.jikan.moe/v3/search/\"; // anime/?q=\";\r\n\t\t\r\n\t\t// No API Key required!\r\n let selection = document.querySelector(\"#selections\").value;\r\n \r\n let limit = document.querySelector(\"#limit\").value;\r\n\t\t\r\n\t\tlet currentstatus = document.querySelector(\"#currentstatus\").value;\r\n\t\t\r\n\t\tlet maturity = document.querySelector(\"#maturity\").value;\r\n\t\t\r\n\t\t// build up our URL string\r\n\t\tlet url = SERVICE_URL;\r\n\t\t\r\n\t\t// parse the user entered term we wish to search\r\n\t\tterm = document.querySelector(\"#searchterm\").value;\r\n\t\t\r\n\t\t// get rid of any leading and trailing spaces\r\n\t\tterm = term.trim();\r\n\t\t// encode spaces and special characters\r\n\t\tterm = encodeURIComponent(term);\r\n\t\t\r\n\t\t// if there's no term to search then bail out of the function (return does this)\r\n\t\tif(term.length < 1){\r\n\t\t\tdocument.querySelector(\"#debug\").innerHTML = \"<b>Enter a search term first!</b>\";\r\n\t\t\treturn;\r\n\t\t}\r\n \r\n url += selection + \"/\";\r\n\t\turl += \"?q=\" + term;\r\n url += \"&limit=\" + limit;\r\n url += \"&page=1\";\r\n\t\turl += \"?status=\" + currentstatus;\r\n\t\turl += \"&rated=\" + maturity;\r\n\t\turl += \"&genre=\";\r\n\t\t\r\n\t\t// Genre Selection\r\n\t\tlet genre = document.getElementsByName(\"genre[]\");\r\n\t\t\r\n\t\tfor (let i = 0; i<genre.length; i++) {\r\n\t\t\tif (genre[i].checked) \r\n\t\t\t{\r\n\t\t\t\turl += genre[i].value + \"%2C\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// update the UI\r\n\t\tdocument.querySelector(\"#debug\").innerHTML = `<b>Querying web service with:</b> <a href=\"${url}\" target=\"_blank\">${url}</a>`;\r\n\t\t\r\n\t\t// call the web service, and prepare to download the file\r\n\t\t$.ajax({\r\n\t\t dataType: \"json\",\r\n\t\t url: url,\r\n\t\t data: null,\r\n\t\t success: jsonLoaded\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t}", "function getSearchResults(query) {\n\n \n fetch(`${api.base}weather?q=${query}&units=metric&APPID=${api.key}`)\n\n .then(verifyFetch)\n .then(weather => {\n return weather.json();\n })\n .then(displayResults)\n .then(function () {\n loadContainer.style.display = 'none';\n });\n\n\n // Adding the second API FETCH for the forecast \n fetch(`${api.base}forecast?q=${query}&units=metric&APPID=${api.key}`)\n .then(verifyFetch)\n .then(forecast => {\n return forecast.json();\n })\n .then(displayForecast);\n}", "searchPerformance() {\n // console.log(this.init_performance.year, this.init_performance.month);\n let requestOptions = {\n method: \"GET\",\n redirect: \"follow\",\n };\n\n fetch(\n `https://bsdtx4tahj.execute-api.us-east-1.amazonaws.com/api/performance?year=${this.init_performance.year}&month=${this.init_performance.month}`,\n requestOptions\n )\n .then((response) => response.text())\n .then((result) => {\n // console.log(\"performance\", result);\n this.init_performance = JSON.parse(result).Data[0];\n console.log(\"performance\", this.init_performance);\n this.init_year = this.init_performance.year;\n this.init_month = this.init_performance.month;\n })\n .catch((error) => console.log(\"error\", error));\n }", "function searchedData(err, data, response) {\n return data;\n }", "async function asyncGetChargingStations(latitudeA, longitudeA, latitudeB, longitudeB) {\n var url = new URL(baseUrl); //create the API contact url and define it's parameters\n const boundingBox = \"(\" + latitudeA + \",\" + longitudeA + \")(\" + latitudeB + \",\" + longitudeB + \")\";\n const params = [[\"boundingbox\", boundingBox],\n [\"maxresults\", maxResults]]\n\n /* var searchParams = new URLSearchParams(params);\n const searchParamString = searchParams.toString();\n url.search = searchParamString; */\n //merge the parameters with the URL (old code up top)\n url.search = new URLSearchParams(params).toString();\n if(enableDebug) console.log(url.toString());\n\n //contact the API and extract the returned json\n const response = await fetch(url, {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"x-API-key\": apiKey\n }\n });\n const data = await response.json();\n if(enableDebug) console.log(data);\n\n var stationArray = [];\n data.forEach(function (item, index) {\n var station = {};\n station.latitude = data[index].AddressInfo.Latitude;\n station.longitude = data[index].AddressInfo.Longitude;\n station.name = data[index].AddressInfo.Title;\n\n stationArray.push(station);\n });\n if(enableDebug) console.log(stationArray);\n return stationArray;\n\n}", "async getResults() {\n\n try {\n /** axios:\n * fetching and converting with .json happens in one step rather than 2 separate like fetch\n * API call syntax: is on food2fork.com => browse => api, \n * site name followed http request with documented search data syntax: /api/search?field= ...\n * axios will return a promise, so we need to await and save into a constant. */\n const result = await axios(`https://www.food2fork.com/api/search?key=${key}&q=${this.query}`);\n //a limit of only 50 API calls a day, ran out so result isn't received properly\n console.log(result);\n //we want to save the recipes array inside the Search object, encapsulationnn\n this.result = result.data.recipes;\n } catch (error) {\n alert(error);\n }\n }", "async function searchById() {\n const key = \"a860a075\";\n try {\n const response = await fetch(`http://www.omdbapi.com/?apikey=${key}&i=${searchId}`);\n const res = await response.json();\n console.log(res);\n displayValues(res);\n return res;\n }\n catch (e) {\n console.log(e);\n }\n}", "function processData(data){\n\n var itemCount;\n var numTotalEntries;\n var searchedItems;\n var length;\n\n // if ack == 'fail'\n if (data['findItemsAdvancedResponse'][0]['ack'] === 'Failure'){\n return {'itemCount': 0};\n }\n else {\n // ack == 'success'\n numTotalEntries = data['findItemsAdvancedResponse'][0]['paginationOutput'][0]['totalEntries'];\n searchedItems = data['findItemsAdvancedResponse'][0]['searchResult'][0]['item']\n }\n\n // no searched items or total entries == 0\n if (!searchedItems || numTotalEntries === 0){\n return {'itemCount': 0};\n }else {\n // in this case, total entries > 0 and searchedItem exists\n length = searchedItems.length;\n for (var i = 0; i < searchedItems.length; i++){\n \n // follow the instruction to include all 'attribute loss' cases \n if (!searchedItems[i]['title'] ||\n !searchedItems[i]['galleryURL'] ||\n !searchedItems[i]['condition'] ||\n !searchedItems[i]['location'] ||\n !searchedItems[i]['primaryCategory'][0]['categoryName'] ||\n !searchedItems[i]['condition'][0]['conditionDisplayName'] ||\n !searchedItems[i]['shippingInfo'][0]['shippingType'] ||\n !searchedItems[i]['shippingInfo'][0]['shippingServiceCost'] ||\n !searchedItems[i]['shippingInfo'][0]['shipToLocations'] ||\n !searchedItems[i]['shippingInfo'][0]['expeditedShipping'] ||\n !searchedItems[i]['shippingInfo'][0]['oneDayShippingAvailable'] ||\n !searchedItems[i]['listingInfo'][0]['bestOfferEnabled'] ||\n !searchedItems[i]['listingInfo'][0]['buyItNowAvailable'] ||\n !searchedItems[i]['listingInfo'][0]['listingType'] ||\n !searchedItems[i]['listingInfo'][0]['gift'] ||\n !searchedItems[i]['listingInfo'][0]['watchCount'] ||\n !searchedItems[i]['viewItemURL'] ||\n !searchedItems[i]['sellingStatus'][0]['currentPrice'])\n {\n numTotalEntries = numTotalEntries - 1;\n length = length - 1;\n }\n }\n // after delete these items losing attributes,\n // check if the current total entries are > 0\n if (numTotalEntries === 0){\n return {'itemCount': 0};\n }\n else{\n // total entries > 0\n itemCount = length;\n }\n\n // calculate page number\n var page = parseInt(itemCount / 5) + 1;\n if (page >= 20){\n page = 20;\n }\n var formattedArray = [];\n\n for (var j = 0; j < searchedItems.length; j++){\n if (!searchedItems[j]['title'])\n continue;\n if (!searchedItems[j]['galleryURL'])\n continue;\n if (!searchedItems[j]['condition'])\n continue;\n if (!searchedItems[j]['location'])\n continue;\n if (!searchedItems[j]['primaryCategory'][0]['categoryName'])\n continue;\n if (!searchedItems[j]['condition'][0]['conditionDisplayName'])\n continue;\n if (!searchedItems[j]['shippingInfo'][0]['shippingType'])\n continue;\n if (!searchedItems[j]['shippingInfo'][0]['shippingServiceCost'])\n continue;\n if (!searchedItems[j]['shippingInfo'][0]['shipToLocations'])\n continue;\n if (!searchedItems[j]['shippingInfo'][0]['expeditedShipping'])\n continue;\n if (!searchedItems[j]['shippingInfo'][0]['oneDayShippingAvailable'])\n continue;\n if (!searchedItems[j]['listingInfo'][0]['bestOfferEnabled'])\n continue;\n if (!searchedItems[j]['listingInfo'][0]['buyItNowAvailable'])\n continue;\n if (!searchedItems[j]['listingInfo'][0]['listingType'])\n continue;\n if (!searchedItems[j]['listingInfo'][0]['gift'])\n continue;\n if (!searchedItems[j]['listingInfo'][0]['watchCount'])\n continue;\n if (!searchedItems[j]['viewItemURL'])\n continue;\n if (!searchedItems[j]['sellingStatus'][0]['currentPrice'])\n continue;\n\n // check if searched img is undefined\n var defaultImg = \"https://csci571.com/hw/hw8/images/ebayDefault.png\";\n var undefinedImg = \"https://thumbs1.ebaystatic.com/pict/04040_0.jpg\";\n\n // if img is undefined, replace it with default display\n if (searchedItems[j]['galleryURL'][0] === undefinedImg) {\n searchedItems[j]['galleryURL'][0] = defaultImg;\n }\n\n var formatted_object = {\n /* summary info */\n 'image': searchedItems[j]['galleryURL'][0],\n 'title': searchedItems[j]['title'][0],\n 'price': searchedItems[j]['sellingStatus'][0]['currentPrice'][0][\"__value__\"],\n 'location': searchedItems[j]['location'][0],\n 'ItemURL':searchedItems[j]['viewItemURL'][0],\n\n /* basic info */\n 'category': searchedItems[j]['primaryCategory'][0]['categoryName'][0],\n 'condition': searchedItems[j]['condition'][0]['conditionDisplayName'][0],\n\n /* shipping info */\n 'shippingType': searchedItems[j]['shippingInfo'][0]['shippingType'][0],\n 'shippingCost': searchedItems[j]['shippingInfo'][0]['shippingServiceCost'][0][\"__value__\"],\n 'shippingTo': searchedItems[j]['shippingInfo'][0]['shipToLocations'][0],\n 'expeditedShipping': searchedItems[j]['shippingInfo'][0]['expeditedShipping'][0],\n 'oneDayShippingAvailable': searchedItems[j]['shippingInfo'][0]['oneDayShippingAvailable'][0],\n\n /* Listing info */\n 'bestOfferEnabled': searchedItems[j]['listingInfo'][0]['bestOfferEnabled'][0],\n 'buyItNowAvailable': searchedItems[j]['listingInfo'][0]['buyItNowAvailable'][0],\n 'listingType': searchedItems[j]['listingInfo'][0]['listingType'][0],\n \"gift\": searchedItems[j]['listingInfo'][0]['gift'][0],\n \"watchCount\": searchedItems[j]['listingInfo'][0]['watchCount'][0]\n\n };\n formattedArray.push(formatted_object);\n }\n //console.log('formattedArray is' + formattedArray);\n var processedData = {'keyword': keyword, 'count': itemCount, 'page': page, 'data': formattedArray};\n console.log('------------');\n console.log(processedData['data'][0]);\n return processedData;\n }\n}", "function parse_nytimes_search(data)\n{\n try{\n let results = data[\"response\"][\"docs\"];\n let return_data = [];\n // console.log(results);\n for(let i = 0; i < results.length; ++i)\n {\n let news = results[i];\n if(checkValid(news[\"headline\"][\"main\"]) && checkValid(news[\"news_desk\"]) &&\n checkValid(news[\"pub_date\"]) && checkValid(news[\"web_url\"]) && checkValid(news[\"abstract\"]))\n {\n let img = \"\";\n let imgs = news[\"multimedia\"];\n for(let j = 0; j < imgs.length; ++j)\n {\n if(parseInt(imgs[j][\"width\"]) >= 2000)\n {\n img = \"https://www.nytimes.com/\" + imgs[j][\"url\"];\n break;\n }\n }\n if(img.length === 0)\n img = \"https://upload.wikimedia.org/wikipedia/commons/0/0e/Nytimes_hq.jpg\";\n let single = {\n \"article-id\": news[\"web_url\"],\n \"section-url\": news[\"web_url\"],\n \"title\": news[\"headline\"][\"main\"],\n \"section\": news[\"news_desk\"],\n \"date\": formatDate(news[\"pub_date\"]),\n \"description\": news[\"abstract\"],\n \"image\": img,\n \"source\": \"nytimes\"\n }\n return_data.push(single);\n }\n if(return_data.length === 10)\n break;\n }\n // console.log(return_data)\n return JSON.stringify(return_data);\n } catch (e) {\n console.log(\"Error\");\n return JSON.stringify({})\n }\n}", "function getResults(request, response) {\r\n let investment = request.body.search[0];\r\n\r\n // Creates url for 1st API request\r\n // Takes string typed out by user, returns search results (and symbols)\r\n let url = `https://www.alphavantage.co/query?function=SYMBOL_SEARCH&keywords=${request.body.search[1]}&outputsize=full&apikey=${process.env.ALPHAVANTAGE_API_KEY}`;\r\n\r\n superagent.get(url) // Send 1st API request\r\n .then(symbolSearchResults => {\r\n if (symbolSearchResults.body.bestMatches.length > 0) {\r\n let symbol = symbolSearchResults.body.bestMatches[0]['1. symbol'];\r\n let name = symbolSearchResults.body.bestMatches[0]['2. name'];\r\n\r\n // Creates url for 2nd API request, using symbol from 1st request\r\n let urlTwo = `https://www.alphavantage.co/query?function=TIME_SERIES_DAILY_ADJUSTED&symbol=${symbol}&outputsize=full&apikey=${process.env.ALPHAVANTAGE_API_KEY}`;\r\n\r\n superagent.get(urlTwo) // Send 2nd API request to get the past stock values\r\n .then(priceData => {\r\n latestSavedRegretObj = new Regret(priceData.body, investment, name, symbol, request.body.search[2]); /// Run response through constructor model\r\n })\r\n .then(regret => {\r\n return response.render('pages/result', { regret: latestSavedRegretObj })\r\n })\r\n } else {\r\n return response.render('pages/result', { regret: request.body.search[1] });\r\n }\r\n })\r\n}", "function geoPointResponse(response, searchType) {\n\t\tmyData.length = 0; //empty myData array\n\t\tmyMetaData.length = 0;\n\n\t\tconsole.log('geoPointResponse GET success');\n\t\tconsole.log('response = ');\n\t\tconsole.log(response);\n\t\tObject.keys(response).forEach(function (key) {\n\t\t\tvar responseObj = response[key];\n\t\t\tconsole.log('responseObj = ');\n\t\t\tconsole.log(responseObj);\n\n\t\t\tcurrentPage = responseObj.page;\n\t\t\tnumPages = responseObj.numPages;\n\t\t\ttotalResponses = responseObj.data.length;\n\t\t\tparams = responseObj.params;\n\n\t\t\tmyMetaData.push({\n\t\t\t\ttotalResponses: totalResponses,\n\t\t\t\tcurrentPage: currentPage,\n\t\t\t\tnumPages: numPages,\n\t\t\t\tparams: params\n\t\t\t});\n\n\t\t\tvar breweries = responseObj.data;\n\t\t\tconsole.log('breweries = ');\n\t\t\tconsole.log(breweries);\n\n\t\t\tfor (var i = 0; i < breweries.length; i++) {\n\t\t\t\tvar breweryName = breweries[i].brewery.name;\n\t\t\t\tvar breweryImages = breweries[i].brewery.images;\n\t\t\t\tvar breweryDesc = breweries[i].brewery.description;\n\t\t\t\tvar breweryDescShort;\n\t\t\t\tvar breweryType = breweries[i].locationTypeDisplay;\n\t\t\t\tvar breweryDistance = breweries[i].distance;\n\t\t\t\tvar breweryWebsite = breweries[i].website;\n\t\t\t\tvar breweryWebsiteDisplay;\n\t\t\t\tvar breweryLocality = breweries[i].locality;\n\t\t\t\tvar breweryRegion = breweries[i].region;\n\t\t\t\tvar breweryId = breweries[i].breweryId;\n\n\t\t\t\t//build content object\n\t\t\t\tmyData.push({\n\t\t\t\t\tbreweryName: breweryName,\n\t\t\t\t\tbreweryImages: breweryImages,\n\t\t\t\t\tbreweryDesc: breweryDesc,\n\t\t\t\t\tbreweryDescShort: breweryDescShort,\n\t\t\t\t\tbreweryType: breweryType,\n\t\t\t\t\tbreweryDistance: breweryDistance,\n\t\t\t\t\tbreweryWebsite: breweryWebsite,\n\t\t\t\t\tbreweryWebsiteDisplay: breweryWebsiteDisplay,\n\t\t\t\t\tbreweryLocality: breweryLocality,\n\t\t\t\t\tbreweryRegion: breweryRegion,\n\t\t\t\t\tbreweryId: breweryId\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t\tconsole.log('myMetaData =');\n\t\tconsole.log(myMetaData);\n\t\tconsole.log('myData =');\n\t\tconsole.log(myData);\n\n\t\tpopulateData(myData, myMetaData, searchType);\n\t}", "function search() {\t\t\t\t\n\t\t\tconsole.log(vm.apiDomain);\n\t\t\n\t\t\tpageScope.loadingStart();\n\t\t\t\n\t\t\tAlleleFearSearchAPI.search(vm.apiDomain, function(data) {\n\t\t\t\tvm.results = data;\n\t\t\t\tvm.selectedIndex = 0;\n\t\t\t\tif (vm.results.length > 0) {\n\t\t\t\t\tloadObject();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tclear();\n\t\t\t\t pageScope.loadingEnd();\n\t\t\t\t}\n\t\t\t\tsetFocus();\n\t\t\t}, function(err) {\n\t\t\t\tpageScope.handleError(vm, \"API ERROR: AlleleFearSearchAPI.search\");\n\t\t\t\tpageScope.loadingEnd();\n\t\t\t\tsetFocus();\n\t\t\t});\n\t\t}", "function findWeatherDetails() {\n let searchLink =\n \"https://api.openweathermap.org/data/2.5/weather?q=copenhagen&appid=\" +\n appKey;\n httpRequestAsync(searchLink, theResponse);\n}", "function buildQueryURL() {\n // queryURL is the url we'll use to query the API\n var queryURL =\"https://api.data.gov/ed/collegescorecard/v1/schools?api_key=hJeRaRgcFSddWPeyUWgfur8b6vz2DB0FTDNg0ENF&_fields=id,school.name,school.state,school.school_url&school.name=\"+$(\"#search-term\").val().trim();\n\n// ====================================================================================================================================== //\n// TESTING API URL SEARCH PARAMETER NOTES:\n//This line will list the universities the user searched that is provided with the school's id and name: In this example, University of Washington is used -->\n// https://api.data.gov/ed/collegescorecard/v1/schools.json?&api_key=hJeRaRgcFSddWPeyUWgfur8b6vz2DB0FTDNg0ENF&school.name=University%20of%20Washington&_fields=id,school.name\n\n// https://api.data.gov/ed/collegescorecard/v1/schools.json?&api_key=hJeRaRgcFSddWPeyUWgfur8b6vz2DB0FTDNg0ENF&school.name=NAME%20of%20SCHOOL&_fields=id,school.name\n\n// Refer back to Developer's API Documentation and dictionary of the: dev-category and the developer-friendly-name\n// ====================================================================================================================================== //\n\n // Begin building an object to contain our API call's query parameters\n // Set the API key\n var queryParams = {\"api-key\": \"hJeRaRgcFSddWPeyUWgfur8b6vz2DB0FTDNg0ENF\"};\n\n\n // Grab text the user typed into the search input, add to the queryParams object\n queryParams[\"school.name\"] = $(\"#search-term\")\n .val()\n .trim();\n\n // Logging the URL so we have access to it for troubleshooting\n // console.log(\"---------------\\nURL: \" + queryURL + \"\\n---------------\");\n // console.log(queryURL + $.param(queryParams));\n return queryURL + $.param(queryParams);\n}", "function getDataFromApi(searchTerm, callback){\n const query = {\n part: 'snippet',\n key: 'AIzaSyAcQZoB0aRBwDFCoFdxsQ7V7UacB37xV2Y',\n q: `${searchTerm}`,\n maxResults: 5\n }\n $.getJSON(YOUTUBE_SEARCH_URL, query, callback)\n console.log(query)\n}", "async function getData(url, city) {\n const pages = await getPages(url);\n let page = 1;\n let responseArray = [];\n while(page <= pages) {\n console.log(url + '&page=' + page);\n await request(url + '&page=' + page)\n .then(content => {\n const $ = cheerio.load(content);\n $('.search-results.organic .result').each(function(index, element) {\n const address_region = $(element).find('span[itemprop=\"addressRegion\"]').text() || null;\n if(address_region && address_region === 'MA') {\n responseArray.push({\n city: city,\n name: $(element).find('a.business-name span').text() || null,\n street_address: $(element).find('span.street-address').text() || null,\n locality: $(element).find('span.locality').text().trim().replace(',',\"\") || null,\n address_region: address_region,\n postal_code: $(element).find('span[itemprop=\"postalCode\"]').text() || null,\n phone: $(element).find('.phones.phone.primary').text() || null,\n website: $(element).find('a.track-visit-website').attr('href') || null,\n });\n }\n });\n }).catch(error => console.log(error));\n page++;\n }\n return responseArray;\n}", "function processAPI_DATA() {\n STATE.searchResult = STATE.searchResult.restaurants.map(currentRestaurant => {\n let restaurant = currentRestaurant.restaurant;\n\n return {\n name: restaurant.name,\n address: restaurant.location.address,\n thumb: restaurant.thumb,\n priceRange: restaurant.price_range,\n ratings: restaurant.user_rating.aggregate_rating\n };\n });\n\n render();\n}", "function getDataFromApi(searchTerm, callback) {\n// set key value for ajax request from API\n const QUERY = {\n part: 'snippet',\n key: 'AAIzaSyBA9pN1XPD67wx2rEzNV6ymHIp7dJTwg4A',\n q: searchTerm,\n }; \n\n .getJSON(YOUTUBE_SEARCH_URL, QUERY, callback);\n}", "function getCourseData() {\n let query = document.getElementById(\"courseSearch\").value;\n query = query.split(\" \").join(\"\");\n\n fetch(`https://api.sga.umbc.edu/course/${query}`)\n .then(response => response.json())\n .then(showCourseInformation)\n .catch(showSearchErrorMessage);\n}", "function fetchDetails(search){\n \n console.log('called ')\n var xhrRequest =new XMLHttpRequest();\n xhrRequest.onload = function(){\n var responseJSON = JSON.parse(xhrRequest.response);\n\n if(responseJSON.response === 'error'){\n\n alert('Sorry your super Hero lost in space');\n }\n\n addToContainer(responseJSON);\n\n \n }\n xhrRequest.open('GET',`https://superheroapi.com/api/936106680158599/search/${search}`);\n \n xhrRequest.send();\n}", "function getResults(query)\r\n{ \r\n fetch(`${api.base}weather?q=${query}&units=metric&APPID=${api.key}`) //retrieving the weather data\r\n .then(weather => {\r\n return weather.json(); //converting it into a JSON file\r\n\r\n }).then(DisplayResults);\r\n\r\n}", "getJSONData(searchIn, searchFor, callBack) {\n try {\n fetch('https://www.theedgesusu.co.uk/wp-json/wp/v2/' + searchIn + '?search=' + searchFor + '&_embed', {\n method: 'GET',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n },\n }).then(response => response.json())\n .then(responseJson => {\n callBack(responseJson);\n })\n .catch(error => {\n console.error(error);\n });\n } catch (error) {\n // Error retrieving data\n }\n }", "function search() {\n fetch('/', { \n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n }\n }).then(function(response) { console.log(response.json()); })\n /*\n return fetch(`api/food?q=${query}`, {\n accept: \"application/json\"\n })\n .then(checkStatus)\n .then(parseJSON)\n .then(cb);\n */\n}", "function movieSearch(movie)\n{\n request(\"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&tomatoes=true&r=json\", function (error, response, body) {\n console.log('error:', error); // Print the error if one occurre\n console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received\n console.log('body:', body); // Print the HTML for the Google homepage.\n console.log(body.title);\n console.log(response.title);\n});\n}", "function processSearchResponse() {\n\tif (requestXml.readyState == 4) {\n\t\tvar resultXml = requestXml.responseXML;\n\t\t\n\t\tk = 0;\n\t\tnames = [];\n\t\ttrackers = [];\n\t\thashes = [];\n\t\t$('RESULT', resultXml).each(function(i) {\n\t\t\tnames[k] = $(this).find(\"NAME\").text();\n\t\t\ttrackers[k] = $(this).find(\"TRACKER\").text();\n\t\t\thashes[k] = $(this).find(\"HASH\").text();\n\t\t\tk++;\n\t\t});\n\t\t\n\t\tsearch_results = [];\n\t\tfor (var j = 0; j < names.length; j++)\n\t\t\tsearch_results.push(names[j]);\n\t\t\n\t\t$('#results_list').sfList('clear');\n\t\t$('#results_list').sfList('option', 'data', search_results);\n\t\t\n\t\tis_list_shown = true;\n\t}\n}", "function parseYelp(jsonRes)\n{\n var information = []\n for(var i in jsonRes['businesses'])\n {\n var name = jsonRes['businesses'][i]['name']\n var address = jsonRes['businesses'][i]['location']['address1']\n var cityState = jsonRes['businesses'][i]['location']['city'] + ', ' + jsonRes['businesses'][i]['location']['state']\n var url = jsonRes['businesses'][i]['url']\n information.push({'name': name, 'address': address, 'cityState': cityState, 'url': url})\n }\n return information\n}", "function bandsSearch(search) {\n var artist;\n\n if (search === null || search === undefined || search === \"\") {\n artist = \"Post Malone\";\n } else {\n artist = search;\n }\n\n axios.get(\"https://rest.bandsintown.com/artists/\" + artist + \"/events?app_id=codingbootcamp\").then(\n function (response, error) {\n\n if (error) {\n return console.log(error);\n }\n console.log(\"\\n Here are upcoming event details for \" + artist + \"...\\n\")\n for (i = 0; i < response.data.length; i++) {\n console.log(\"----------Event Info----------\" + \"\\n\");\n console.log(\"\\033[38;5;6m\" + \"Venue Name: \" + \"\\033[0m\" + response.data[i].venue.name);\n console.log(\"\\033[38;5;6m\" + \"Venue Location: \" + \"\\033[0m\" + response.data[i].venue.city + \", \" + response.data[i].venue.region);\n console.log(\"\\033[38;5;6m\" + \"Date of event: \" + \"\\033[0m\" + moment(response.data[i].datetime).format(\"MM/DD/YYYY\") + \"\\n\");\n console.log(\"-------------------------------\");\n }\n }\n );\n}", "function fetchDataFromAPI(connection)\n{\n\tvar url = 'https://data.gov.in/api/datastore/resource.json?resource_id=0a076478-3fd3-4e2c-b2d2-581876f56d77&api-key=8b5e72d61484945034cb91e8fc8361bb';\n\thttps.get(url, function(res) {\n var body = '';\n\n res.on('data', function(chunk) {\n body += chunk;\n });\n\n res.on('end', function()\n {\n var fbResponse = JSON.parse(body)\n console.log(\"KARTIK Got response: OK \");\n \n fbResponse.records.forEach(function(f)\n {\n \n // console.log(\"KARTIK LOG what is in array : \" + f.id);\n\t\t\n \tvar id = f.id ;\n \tvar officename = f.officename \n \tvar pincode = f.pincode ;\n \tvar officeType = f.officeType ;\n \tvar Deliverystatus = f.Deliverystatus ;\n \tvar divisionname = f.divisionname ;\n \tvar regionname = f.regionname ;\n \tvar circlename = f.circlename ;\n var Taluk = f.Taluk ;\n var Districtname = f.Districtname ;\n var statename = f.statename ;\n var Telephone = f.Telephone ;\n \n var values = [[id, officename, pincode, officeType, Deliverystatus, divisionname, regionname, circlename, Taluk, Districtname, statename, Telephone ]]; \n configureExpress(connection, values);\n \n });\n connection.end();\n });\n}).on('error', function(e) {\n console.log(\"Got error: \", e);\n});\n}", "search(app){\n const myToken = '?token=LGQ5F3PAWYCTNMMA7MIH';\n const root = 'https://www.eventbriteapi.com/v3/events/search/';\n const params = {\n 'popular' : true,\n 'q' : this.state.value,\n 'sort_by' : 'date',\n 'expand' : 'category,venue'\n };\n $.getJSON(root + myToken, params,\n function(data){\n console.log(data);\n app.pullData(data);\n }\n );\n }", "function parseCharitySearch(response) {\n jsonRes = JSON.parse(response);\n var respArr = Array(jsonRes.length);\n for (i in jsonRes) {\n respArr[i] = Array(7);\n respArr[i][0] = jsonRes[i].ein;\n respArr[i][1] = jsonRes[i].charityName;\n respArr[i][2] = jsonRes[i].websiteURL;\n respArr[i][3] = jsonRes[i].mailingAddress.streetAddress1;\n respArr[i][4] = jsonRes[i].mailingAddress.city;\n respArr[i][5] = jsonRes[i].mailingAddress.stateOrProvince;\n respArr[i][6] = jsonRes[i].mailingAddress.postalCode;\n }\n return respArr;\n}", "function contentApiCallback(){\n\t\n\tvar output = \"\";\n\t\n\tif(myclient.data == null){\n \tvar display = \"<b><font color='red'>return object == null</font></b>\"\n document.getElementById(myclient.divid).innerHTML = output;\n return;\n }\n \n var textJson = gadgets.json.parse(myclient.data);\n if(!textJson){\n var display = \"<b><font color='red'>parsing results returned nothing</font></b>\"\n document.getElementById(myclient.divid).innerHTML = output;\n return;\n }\n \n var entries = textJson['search-results']['entry'];\n \n\t$.each(entries, function(i1, entry){\n \tvar title = entry['dc:title'];\n \toutput = output + (i1+1) + \". \" + title + \"<br>\";\n });\n \n document.getElementById(myclient.divid).innerHTML = \"Search results:<br>\"+output;\n}", "function getJSON (source) {\n var url = '';\n\n // WIKIPEDIA API CALL\n if (source === 'wikipedia') {\n url = 'https://en.wikipedia.org/w/api.php?action=opensearch&search=';\n\n $.ajax({\n url: url + SEARCH_STR,\n dataType: 'jsonp',\n method: 'GET',\n success: function (data) {\n // give API data to getSavedUrls, just to pass it on to loadResults later\n getSavedUrls(data, source);\n },\n error: function (err) {\n throw err;\n }\n });\n\n // NEW YORK TIMES API CALL\n } else if (source === 'nyt') {\n url = 'https://api.nytimes.com/svc/search/v2/articlesearch.json';\n url += '?' + $.param({\n 'api-key': '1a6e15371cf94b97a62802a17d365145',\n 'q': SEARCH_STR,\n 'begin_date': '20140101'\n });\n\n $.ajax({\n url: url,\n dataType: 'json',\n method: 'GET',\n success: function (data) {\n getSavedUrls(data, source);\n },\n error: function (err) {\n throw err;\n }\n });\n\n // THE GUARDIAN API CALL\n } else if (source === 'guardian') {\n url = 'http://content.guardianapis.com/search';\n url += '?' + $.param({\n 'api-key': 'e8eb4ddb-47ce-4400-9edc-42c41e3f2a2f',\n 'q': SEARCH_STR,\n 'from-date': '2014-01-01',\n 'section': 'news'\n });\n\n $.ajax({\n url: url,\n dataType: 'json',\n method: 'GET',\n success: function (data) {\n getSavedUrls(data, source);\n },\n error: function (err) {\n throw err;\n }\n });\n }\n }", "function search() {\n return axios.get(BASEURL);\n}", "function getBandsInTown() {\n if (searchTerm === \"\") {\n searchTerm = \"Ariana Grande\"; //default search\n }\n axios\n .get(\n \"https://rest.bandsintown.com/artists/\" +\n searchTerm +\n \"/events?app_id=codingbootcamp\"\n )\n .then(function(response) {\n logString +=\n \"\\n\\n\\nYou Searched For: \" +\n searchTerm +\n \"\\n******** Results *********\\n\\n\";\n if (response.data[0] === undefined) {\n logString += \"*** There were no results for this search ***\\n\\n\\n\";\n } else {\n var unformattedDate = response.data[0].datetime;\n var dateFormat = \"MM/DD/YYYY hh:mmA\";\n var formattedDate = moment(unformattedDate).format(dateFormat);\n logString += \"Venue Name - \" + response.data[0].venue.name;\n logString += \"\\nVenue City - \" + response.data[0].venue.city;\n logString += \"\\nRegion - \" + response.data[0].venue.region;\n logString += \"\\nEvent Date - \" + formattedDate;\n }\n logString += \"\\n\\n******** End *********\\n\\n\\n\";\n console.log(logString);\n logResults();\n });\n}", "function runQuery(numArticles, queryURL){\n var queryURL = \"\";\n\n queryURL = \"http://url.json?&api-key=\" + apiKey + \"q=\" + searchTerm;\n\n \n $.ajax({ url: queryURL, method: 'GET'})\n .done(function(response) {\n var results = response.response;\n console.log('response: ', results)\n\n for (i = 0; i < results.docs.length; i++) {\n array.push({\n 'attribute': results.docs[i].field-from-object,\n 'attribute2': results.docs[i].field2-from-object\n });\n }\n });\n return array;\n}", "async getResults() {\n const res = await axios(`http://dataservice.accuweather.com/locations/v1/cities/search?apikey=${apiKey}&q=${this.query}&details=false&offset=0&alias=Never`); // res stands for results\n try {\n this.cities = res.data; // Full city DATA\n this.cityName = this.cities[0].LocalizedName; // Name of the city\n } catch (error) {\n console.log(error);\n }\n }", "function jsonapi (search, callback){\n var stackexchange = require('stackexchange-node');\n var options = { version: 2.2 };\n\tvar context = new stackexchange(options);\n\tvar re=/<pre><code>([\\s\\S]*?)<\\/code><\\/pre>/gm;\n\tvar re2=/<(.*?)>/g;\n\tvar m;\n var complete = {\n concept: [],\n code: [],\n title: '',\n is_code: false\n };\n\tvar filter = {\n \t\tpagesize: 1,\n \t\tsort: 'relevance',\n \t\torder: 'desc',\n \t\tq: search,\n \t\tfilter: '!)R7_YdluAAl180(njTbqNhsH'\n\t};\n //console.log(context.search.advanced);\n\tcontext.search.advanced(filter, function (err, results){\n //console.log(results);\n if (err) throw err;\n var s;\n for(var i=0;i<results.items[0].answers.length;i++){\n if(results.items[0].answers[i].is_accepted){\n s=results.items[0].answers[i].body;\n break;\n }\n }\n complete.title=results.items[0].title;\n //complete.concept=s;\n //var s='<p><strong>You are a victim of <a href=\\\"//en.wikipedia.org/wiki/Branch_predictor\\\" rel=\\\"noreferrer\\\">branch prediction</a> fail.</strong></p>\\n\\n<hr>\\n\\n<h2>What is Branch Prediction?</h2>\\n\\n<p>Consider a railroad junction:</p>\\n\\n<p><a href=\\\"//commons.wikimedia.org/wiki/File:Entroncamento_do_Transpraia.JPG\\\" rel=\\\"noreferrer\\\"><img src=\\\"https://i.stack.imgur.com/muxnt.jpg\\\" alt=\\\"Licensed Image\\\"></a>\\n<sub><a href=\\\"//commons.wikimedia.org/wiki/File:Entroncamento_do_Transpraia.JPG\\\" rel=\\\"noreferrer\\\">Image</a> by Mecanismo, via Wikimedia Commons. Used under the <a href=\\\"//creativecommons.org/licenses/by-sa/3.0/deed.en\\\" rel=\\\"noreferrer\\\">CC-By-SA 3.0</a> license.</sub></p>\\n\\n<p>Now for the sake of argument, suppose this is back in the 1800s - before long distance or radio communication.</p>\\n\\n<p>You are the operator of a junction and you hear a train coming. You have no idea which way it is supposed to go. You stop the train to ask the driver which direction they want. And then you set the switch appropriately.</p>\\n\\n<p><em>Trains are heavy and have a lot of inertia. So they take forever to start up and slow down.</em></p>\\n\\n<p>Is there a better way? You guess which direction the train will go!</p>\\n\\n<ul>\\n<li>If you guessed right, it continues on.</li>\\n<li>If you guessed wrong, the captain will stop, back up, and yell at you to flip the switch. Then it can restart down the other path.</li>\\n</ul>\\n\\n<p><strong>If you guess right every time</strong>, the train will never have to stop.<br>\\n<strong>If you guess wrong too often</strong>, the train will spend a lot of time stopping, backing up, and restarting.</p>\\n\\n<hr>\\n\\n<p><strong>Consider an if-statement:</strong> At the processor level, it is a branch instruction:</p>\\n\\n<p><img src=\\\"https://i.stack.imgur.com/pyfwC.png\\\" alt=\\\"image2\\\"></p>\\n\\n<p>You are a processor and you see a branch. You have no idea which way it will go. What do you do? You halt execution and wait until the previous instructions are complete. Then you continue down the correct path.</p>\\n\\n<p><em>Modern processors are complicated and have long pipelines. So they take forever to \\\"warm up\\\" and \\\"slow down\\\".</em></p>\\n\\n<p>Is there a better way? You guess which direction the branch will go!</p>\\n\\n<ul>\\n<li>If you guessed right, you continue executing.</li>\\n<li>If you guessed wrong, you need to flush the pipeline and roll back to the branch. Then you can restart down the other path.</li>\\n</ul>\\n\\n<p><strong>If you guess right every time</strong>, the execution will never have to stop.<br>\\n<strong>If you guess wrong too often</strong>, you spend a lot of time stalling, rolling back, and restarting.</p>\\n\\n<hr>\\n\\n<p>This is branch prediction. I admit it\\'s not the best analogy since the train could just signal the direction with a flag. But in computers, the processor doesn\\'t know which direction a branch will go until the last moment.</p>\\n\\n<p>So how would you strategically guess to minimize the number of times that the train must back up and go down the other path? You look at the past history! If the train goes left 99% of the time, then you guess left. If it alternates, then you alternate your guesses. If it goes one way every 3 times, you guess the same...</p>\\n\\n<p><strong><em>In other words, you try to identify a pattern and follow it.</em></strong> This is more or less how branch predictors work.</p>\\n\\n<p>Most applications have well-behaved branches. So modern branch predictors will typically achieve >90% hit rates. But when faced with unpredictable branches with no recognizable patterns, branch predictors are virtually useless.</p>\\n\\n<p>Further reading: <a href=\\\"//en.wikipedia.org/wiki/Branch_predictor\\\" rel=\\\"noreferrer\\\">\\\"Branch predictor\\\" article on Wikipedia</a>.</p>\\n\\n<hr>\\n\\n<h2>As hinted from above, the culprit is this if-statement:</h2>\\n\\n<pre><code>if (data[c] &gt;= 128)\\n sum += data[c];\\n</code></pre>\\n\\n<p>Notice that the data is evenly distributed between 0 and 255. \\nWhen the data is sorted, roughly the first half of the iterations will not enter the if-statement. After that, they will all enter the if-statement.</p>\\n\\n<p>This is very friendly to the branch predictor since the branch consecutively goes the same direction many times.\\nEven a simple saturating counter will correctly predict the branch except for the few iterations after it switches direction.</p>\\n\\n<p><strong>Quick visualization:</strong></p>\\n\\n<pre><code>T = branch taken\\nN = branch not taken\\n\\ndata[] = 0, 1, 2, 3, 4, ... 126, 127, 128, 129, 130, ... 250, 251, 252, ...\\nbranch = N N N N N ... N N T T T ... T T T ...\\n\\n = NNNNNNNNNNNN ... NNNNNNNTTTTTTTTT ... TTTTTTTTTT (easy to predict)\\n</code></pre>\\n\\n<p>However, when the data is completely random, the branch predictor is rendered useless because it can\\'t predict random data.\\nThus there will probably be around 50% misprediction. (no better than random guessing)</p>\\n\\n<pre><code>data[] = 226, 185, 125, 158, 198, 144, 217, 79, 202, 118, 14, 150, 177, 182, 133, ...\\nbranch = T, T, N, T, T, T, T, N, T, N, N, T, T, T, N ...\\n\\n = TTNTTTTNTNNTTTN ... (completely random - hard to predict)\\n</code></pre>\\n\\n<hr>\\n\\n<p><strong>So what can be done?</strong></p>\\n\\n<p>If the compiler isn\\'t able to optimize the branch into a conditional move, you can try some hacks if you are willing to sacrifice readability for performance.</p>\\n\\n<p>Replace:</p>\\n\\n<pre><code>if (data[c] &gt;= 128)\\n sum += data[c];\\n</code></pre>\\n\\n<p>with:</p>\\n\\n<pre><code>int t = (data[c] - 128) &gt;&gt; 31;\\nsum += ~t &amp; data[c];\\n</code></pre>\\n\\n<p>This eliminates the branch and replaces it with some bitwise operations.</p>\\n\\n<p><sub>(Note that this hack is not strictly equivalent to the original if-statement. But in this case, it\\'s valid for all the input values of <code>data[]</code>.)</sub></p>\\n\\n<p><strong>Benchmarks: Core i7 920 @ 3.5 GHz</strong></p>\\n\\n<p>C++ - Visual Studio 2010 - x64 Release</p>\\n\\n<pre><code>// Branch - Random\\nseconds = 11.777\\n\\n// Branch - Sorted\\nseconds = 2.352\\n\\n// Branchless - Random\\nseconds = 2.564\\n\\n// Branchless - Sorted\\nseconds = 2.587\\n</code></pre>\\n\\n<p>Java - Netbeans 7.1.1 JDK 7 - x64</p>\\n\\n<pre><code>// Branch - Random\\nseconds = 10.93293813\\n\\n// Branch - Sorted\\nseconds = 5.643797077\\n\\n// Branchless - Random\\nseconds = 3.113581453\\n\\n// Branchless - Sorted\\nseconds = 3.186068823\\n</code></pre>\\n\\n<p>Observations:</p>\\n\\n<ul>\\n<li><strong>With the Branch:</strong> There is a huge difference between the sorted and unsorted data.</li>\\n<li><strong>With the Hack:</strong> There is no difference between sorted and unsorted data.</li>\\n<li>In the C++ case, the hack is actually a tad slower than with the branch when the data is sorted.</li>\\n</ul>\\n\\n<p>A general rule of thumb is to avoid data-dependent branching in critical loops. (such as in this example)</p>\\n\\n<hr>\\n\\n<p><strong>Update:</strong></p>\\n\\n<ul>\\n<li><p>GCC 4.6.1 with <code>-O3</code> or <code>-ftree-vectorize</code> on x64 is able to generate a conditional move. So there is no difference between the sorted and unsorted data - both are fast.</p></li>\\n<li><p>VC++ 2010 is unable to generate conditional moves for this branch even under <code>/Ox</code>.</p></li>\\n<li><p>Intel Compiler 11 does something miraculous. It <a href=\\\"//en.wikipedia.org/wiki/Loop_interchange\\\" rel=\\\"noreferrer\\\">interchanges the two loops</a>, thereby hoisting the unpredictable branch to the outer loop. So not only is it immune the mispredictions, it is also twice as fast as whatever VC++ and GCC can generate! In other words, ICC took advantage of the test-loop to defeat the benchmark...</p></li>\\n<li><p>If you give the Intel Compiler the branchless code, it just out-right vectorizes it... and is just as fast as with the branch (with the loop interchange).</p></li>\\n</ul>\\n\\n<p>This goes to show that even mature modern compilers can vary wildly in their ability to optimize code...</p>\\n'\n //var s='<p>Okay, I have seen this:\\n<a href=\"https://stackoverflow.com/questions/1129216/sorting-objects-in-an-array-by-a-field-value-in-javascript\">Sort array of objects by string property value in JavaScript</a><br>\\nNow, my problem is that I want sort the array by a field value in dependence of an external int value.</p>\\n\\n<p>The Int value represents a number of persons for a reservation, the objects in the array are the tables with the seats.<br></p>\\n\\n<p>Now, when I got a Reservation with 4 persons the array should beginn with the object where Seats are equal to my Int (the 4 persons) or the nearest higher one. The next ones should be i.e. 6 and 8. Objects with Seats are smaller then my Int should listed at the end (when 4 persons want a reservation, I dont need tables with 2 Seats). I hop its a bit cleare now.</p>\\n\\n<pre><code>{\\n Area: \"Bar\",\\n Seats: 2,\\n Id : 1\\n},{\\n Area: \"Outside\",\\n Seats: 8,\\n Id : 2\\n},{\\n Area: \"Room\",\\n Seats: 4,\\n Id : 3\\n},{\\n Area: \"Floor\",\\n Seats: 2,\\n Id : 4\\n},{\\n Area: \"Room\",\\n Seats: 6,\\n Id : 5\\n}\\n</code></pre>\\n\\n<p>Okay, here is my solution:<br></p>\\n\\n<pre><code> res.sort(function (a, b) {\\n if ((a.Seats &lt; goal) &amp;&amp; (b.Seats &lt; goal)) {\\n return b.Seats - a.Seats;\\n }\\n if (a.Seats &lt; goal) {\\n return 1;\\n }\\n if (b.Seats &lt; goal) {\\n return -1;\\n }\\n return a.Seats - b.Seats;\\n });\\n</code></pre>\\n';\n //var s=\"<p>The reason why performance improves drastically when the data is sorted is that the branch prediction penalty is removed, as explained beautifully in <a href=\\\"https://stackoverflow.com/users/922184/mysticial\\\">Mysticial</a>'s answer.</p>\\n\\n<p>Now, if we look at the code</p>\\n\\n<pre><code>if (data[c] &gt;= 128)\\n sum += data[c];\\n</code></pre>\\n\\n<p>we can find that the meaning of this particular <code>if... else...</code> branch is to add something when a condition is satisfied. This type of branch can be easily transformed into a <strong>conditional move</strong> statement, which would be compiled into a conditional move instruction: <code>cmovl</code>, in an <code>x86</code> system. The branch and thus the potential branch prediction penalty is removed.</p>\\n\\n<p>In <code>C</code>, thus <code>C++</code>, the statement, which would compile directly (without any optimization) into the conditional move instruction in <code>x86</code>, is the ternary operator <code>... ? ... : ...</code>. So we rewrite the above statement into an equivalent one:</p>\\n\\n<pre><code>sum += data[c] &gt;=128 ? data[c] : 0;\\n</code></pre>\\n\\n<p>While maintaining readability, we can check the speedup factor.</p>\\n\\n<p>On an Intel <a href=\\\"http://en.wikipedia.org/wiki/Intel_Core#Core_i7\\\" rel=\\\"noreferrer\\\">Core i7</a>-2600K @ 3.4&nbsp;GHz and Visual Studio 2010 Release Mode, the benchmark is (format copied from Mysticial):</p>\\n\\n<p><strong>x86</strong></p>\\n\\n<pre><code>// Branch - Random\\nseconds = 8.885\\n\\n// Branch - Sorted\\nseconds = 1.528\\n\\n// Branchless - Random\\nseconds = 3.716\\n\\n// Branchless - Sorted\\nseconds = 3.71\\n</code></pre>\\n\\n<p><strong>x64</strong></p>\\n\\n<pre><code>// Branch - Random\\nseconds = 11.302\\n\\n// Branch - Sorted\\n seconds = 1.830\\n\\n// Branchless - Random\\nseconds = 2.736\\n\\n// Branchless - Sorted\\nseconds = 2.737\\n</code></pre>\\n\\n<p>The result is robust in multiple tests. We get a great speedup when the branch result is unpredictable, but we suffer a little bit when it is predictable. In fact, when using a conditional move, the performance is the same regardless of the data pattern.</p>\\n\\n<p>Now let's look more closely by investigating the <code>x86</code> assembly they generate. For simplicity, we use two functions <code>max1</code> and <code>max2</code>.</p>\\n\\n<p><code>max1</code> uses the conditional branch <code>if... else ...</code>:</p>\\n\\n<pre><code>int max1(int a, int b) {\\n if (a &gt; b)\\n return a;\\n else\\n return b;\\n}\\n</code></pre>\\n\\n<p><code>max2</code> uses the ternary operator <code>... ? ... : ...</code>:</p>\\n\\n<pre><code>int max2(int a, int b) {\\n return a &gt; b ? a : b;\\n}\\n</code></pre>\\n\\n<p>On a x86-64 machine, <code>GCC -S</code> generates the assembly below.</p>\\n\\n<pre><code>:max1\\n movl %edi, -4(%rbp)\\n movl %esi, -8(%rbp)\\n movl -4(%rbp), %eax\\n cmpl -8(%rbp), %eax\\n jle .L2\\n movl -4(%rbp), %eax\\n movl %eax, -12(%rbp)\\n jmp .L4\\n.L2:\\n movl -8(%rbp), %eax\\n movl %eax, -12(%rbp)\\n.L4:\\n movl -12(%rbp), %eax\\n leave\\n ret\\n\\n:max2\\n movl %edi, -4(%rbp)\\n movl %esi, -8(%rbp)\\n movl -4(%rbp), %eax\\n cmpl %eax, -8(%rbp)\\n cmovge -8(%rbp), %eax\\n leave\\n ret\\n</code></pre>\\n\\n<p><code>max2</code> uses much less code due to the usage of instruction <code>cmovge</code>. But the real gain is that <code>max2</code> does not involve branch jumps, <code>jmp</code>, which would have a significant performance penalty if the predicted result is not right.</p>\\n\\n<p>So why does a conditional move perform better?</p>\\n\\n<p>In a typical <code>x86</code> processor, the execution of an instruction is divided into several stages. Roughly, we have different hardware to deal with different stages. So we do not have to wait for one instruction to finish to start a new one. This is called <strong><a href=\\\"http://en.wikipedia.org/wiki/Pipeline_%28computing%29\\\" rel=\\\"noreferrer\\\">pipelining</a></strong>.</p>\\n\\n<p>In a branch case, the following instruction is determined by the preceding one, so we cannot do pipelining. We have to either wait or predict.</p>\\n\\n<p>In a conditional move case, the execution conditional move instruction is divided into several stages, but the earlier stages like <code>Fetch</code> and <code>Decode</code> does not depend on the result of the previous instruction; only latter stages need the result. Thus, we wait a fraction of one instruction's execution time. This is why the conditional move version is slower than the branch when prediction is easy.</p>\\n\\n<p>The book <em><a href=\\\"http://rads.stackoverflow.com/amzn/click/0136108040\\\" rel=\\\"noreferrer\\\">Computer Systems: A Programmer's Perspective, second edition</a></em> explains this in detail. You can check Section 3.6.6 for <em>Conditional Move Instructions</em>, entire Chapter 4 for <em>Processor Architecture</em>, and Section 5.11.2 for a special treatment for <em>Branch Prediction and Misprediction Penalties</em>.</p>\\n\\n<p>Sometimes, some modern compilers can optimize our code to assembly with better performance, sometimes some compilers can't (the code in question is using Visual Studio's native compiler). Knowing the performance difference between branch and conditional move when unpredictable can help us write code with better performance when the scenario gets so complex that the compiler can not optimize them automatically.</p>\\n\";\n m=s.split(re);\n for(var i=0; i<m.length; i++){\n if(i%2==0){\n complete.concept.push(m[i]);\n }else{\n complete.code.push(m[i]);\n }\n }\n complete.is_code = complete.code.length > 0;\n for(var i=0; i<complete.concept.length;i++){\n while(re2.test(complete.concept[i])){\n complete.concept[i]=complete.concept[i].replace(re2,\" \");\n }\n while(/\\n|\\r/g.test(complete.concept[i])){\n complete.concept[i]=complete.concept[i].replace(/\\n|\\r/g,\" \");\n }\n }\n //console.log(complete);\n callback(complete);\n });\n}", "function getSearch(query) {\n fetch('https://api.openweathermap.org/data/2.5/weather?q='+query+'&units=metric&APPID=a3b6f15258058e4c4430dfc2ae1f7424')\n .then(weather =>{\n return weather.json();\n }).then(displayWeather);\n console.log(query);\n \n}", "function convertSearchResult(result) {\n console.log(\"convertSearchResult reached\");\n\n // parse the response into a javascript json object\n var result_json = JSON.parse(result);\n\n // get the first result in the list of regions\n var first_result = result_json[Object.keys(result_json)[0]];\n\n // get a list of businesses of the first result\n var buisnesses = first_result.businesses;\n\n var buisness_hash = {};\n\n buisnesses.forEach((b) => {\n buisness_hash[b.name] = b.rating\n });\n\n return buisness_hash;\n}", "function searchJson(searchInput) {\n var contents = searchRequest.response;\n var results = \"\";\n for(var i = 0; i < contents.length; i++){\n if(contents[i]['nm'] === searchInput || contents[i]['cty'] === searchInput || contents[i]['hse'] === searchInput || contents[i]['yrs'] === searchInput){\n results += \"Name: \" + contents[i]['nm'] + \"<br>\";\n results += \"Country: \" + contents[i]['cty'] + \"<br>\";\n results += \"House: \" + contents[i]['hse'] + \"<br>\";\n results += \"Years: \" + contents[i]['yrs'] + \"<br><br>\";\n } \n }\n document.getElementById(\"displaySearchResults\").innerHTML = results;\n}", "function searchCamps(req, res) {\n axios({url: `https://ridb.recreation.gov/api/v1/campsites/2?APIKey=${APIKey}`,\n headers: {APIKey: APIKey},\n method: \"GET\"\n})\n .then(function (response) {\n // handle success\n console.log(response.data);\n res.json(response.data)\n })\n .catch(function (error) {\n // handle error\n console.log(error);\n })\n .then(function () {\n // always executed\n });\n}", "function search() {\n let apiKey = \"d35ea4f1a6c2987f94eb1e419288d906\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}&units=${units}`;\n axios.get(apiUrl).then(showInput);\n\n apiUrl = `https://api.openweathermap.org/data/2.5/forecast?q=${city}&appid=${apiKey}&units=${units}`;\n axios.get(apiUrl).then(showForecast);\n}", "function getSearch() {\n\n\t\t\t\t\tvar request = $http({\n\t\t\t\t\t\tmethod: \"get\",\n\t\t\t\t\t\turl: \"http://tmb_rpc.qa.pdone.com/search_processor.php?mode=SEARCH&page=1&phrase=e&page_length=100&type=news\",\n\t\t\t\t\t});\n\n\t\t\t\t\treturn( request.then( handleSuccess, handleError ) );\n\n\t\t\t\t}", "function getStatementsWithSearch(more, curPage) {\n var verbSort = $(\"#search-verb-sort\").val();\n var verbId = $(\"#search-user-verb-id\").val();\n var actor = $(\"#search-actor\").val();\n var relatedAgents = $(\"#search-related-agents\").val();\n var activityId = $(\"#search-activity-id\").val();\n var relatedActivities = $(\"#search-related-activities\").val();\n var registrationId = $(\"#search-registration-id\").val();\n var statementId = $(\"#search-statement-id\").val();\n var voidedStatementId = $(\"#search-voided-statement-id\").val();\n var sinceDate = $(\"#search-statements-since-date input\").val();\n var untilDate = $(\"#search-statements-until-date input\").val();\n var limit = $(\"#search-limit\").val();\n\n // Build Search\n var search = ADL.XAPIWrapper.searchParams();\n if (verbId != \"\") { search['verb'] = verbId; }\n if (verbSort != \"\") { search['ascending'] = verbSort; }\n if (actor != \"\") { search['agent'] = actor; }\n if (relatedAgents != \"\") { search['related_agents'] = relatedAgents; }\n if (activityId != \"\") { search['activity'] = activityId; }\n if (relatedActivities != \"\") { search['related_activities'] = relatedActivities; }\n if (registrationId != \"\") { search['registration'] = registrationId; }\n if (statementId != \"\") { search['statementId'] = statementId; }\n if (voidedStatementId != \"\") { search['voidedStatementId'] = voidedStatementId; }\n if (sinceDate != \"\") { search['since'] = sinceDate; }\n if (untilDate != \"\") { search['until'] = untilDate; }\n if (limit != \"\") { search['limit'] = limit; }\n //console.log(search);\n\n // Put together the xAPI Query\n var urlparams = new Array();\n var url = \"https://lrs.adlnet.gov/xapi/statements\";\n\n for (s in search) {\n urlparams.push(s + \"=\" + encodeURIComponent(search[s]));\n }\n if (urlparams.length > 0)\n url = url + \"?\" + urlparams.join(\"&\");\n\n //console.log(url);\n $(\"#xapi-query\").val(url);\n\n ADL.XAPIWrapper.getStatements(search, more, function(r) { \n //console.log(r);\n var response = $.parseJSON(r.response);\n\n // update the status in the HTML\n if (r.status == 200) {\n\n // Handle case where only a single statement is returned\n // using statementId or voidedStatementId\n if (response.hasOwnProperty('statements')) {\n var stmts = response.statements;\n var length = stmts.length;\n } else {\n var stmt = response;\n var length = 1;\n }\n\n $.notify({ message: \"Status \" + r.status + \" \" + r.statusText }, notificationSettings);\n\n if (response.more != \"\") {\n gmore = response.more;\n } else {\n gmore = null;\n }\n //console.log(gmore);\n\n if (length > 0) {\n if (stmt) {\n var stmts = $.parseJSON(\"[\" + JSON.stringify(stmt) + \"]\");\n } else {\n var stmts = $.parseJSON(JSON.stringify(stmts));\n //console.log(stmts);\n }\n }\n\n $('#statement-list').DataTable().rows.add(stmts).draw();\n $('#statement-list').DataTable().page(curPage).draw(false);\n prettyPrint();\n }\n });\n }", "function getDataFromApi(upcCode) {\n console.log(\"searching for \"+upcCode);\n const URL=`https://api.edamam.com/api/food-database/parser?upc=${upcCode}&app_id=${foodAPI_id}&app_key=${foodAPI_key}`;\n $.getJSON(URL, upcCode, displaySearchData);\n}", "function reformatResponse(res){\n\n var jsonObj = {};\n var jsonData = [];\n\n // res.forEach(function(data){\n jsonObj[\"source\"] = res.OriginLocation;\n jsonObj[\"destination\"] = res.DestinationLocation;\n //To Construct the json Object acc to our req from the searchResults data\n jsonData.push(jsonObj);\n // });\n console.log(jsonData);\n }", "function createSearch(request, response) {\n let url = \"https://www.googleapis.com/books/v1/volumes?q=\";\n\n console.log(request.body);\n console.log(request.body.search);\n\n if (request.body.search[1] === \"title\") {\n url += `+intitle:${request.body.search[0]}`;\n }\n if (request.body.search[1] === \"author\") {\n url += `+inauthor:${request.body.search[0]}`;\n }\n\n // WARNING: won't work as is. Why not?\n // superagent.get(url)\n // .then(apiResponse => console.log(util.inspect(apiResponse.body.items, {showhidden: false, depth: null})))\n // .then(results => response.render('pages/searches/show', {searchResults: results})\n // )}\n superagent\n .get(url)\n .then(apiResponse =>\n apiResponse.body.items.map(bookResult => new Book(bookResult.volumeInfo))\n )\n .then(results =>\n response.render(\"pages/searches/show\", { searchResults: results })\n );\n}", "function brewerQueryResponse(response, searchType) {\n\t\tmyData.length = 0; //empty myData array\n\t\tmyMetaData.length = 0;\n\n\t\tconsole.log('brewerQueryResponse GET success');\n\t\tconsole.log('response = ');\n\t\tconsole.log(response);\n\t\tObject.keys(response).forEach(function (key) {\n\t\t\tvar responseObj = response[key];\n\t\t\tconsole.log('responseObj = ');\n\t\t\tconsole.log(responseObj);\n\n\t\t\tcurrentPage = responseObj.page;\n\t\t\tnumPages = responseObj.numPages;\n\t\t\ttotalResponses = responseObj.data.length;\n\t\t\tparams = responseObj.params;\n\n\t\t\tmyMetaData.push({\n\t\t\t\ttotalResponses: totalResponses,\n\t\t\t\tcurrentPage: currentPage,\n\t\t\t\tnumPages: numPages,\n\t\t\t\tparams: params\n\t\t\t});\n\n\t\t\tvar breweries = responseObj.data;\n\t\t\tconsole.log('breweries = ');\n\t\t\tconsole.log(breweries);\n\n\t\t\tfor (var i = 0; i < breweries.length; i++) {\n\t\t\t\tvar breweryName = breweries[i].name;\n\t\t\t\tvar breweryImages = breweries[i].images;\n\t\t\t\tvar breweryDesc = breweries[i].description;\n\t\t\t\tvar breweryDescShort;\n\t\t\t\tvar breweryWebsite = breweries[i].website;\n\t\t\t\tvar breweryWebsiteDisplay;\n\t\t\t\tvar breweryEstablished = breweries[i].established;\n\n\t\t\t\t//build content object\n\t\t\t\tmyData.push({\n\t\t\t\t\tbreweryName: breweryName,\n\t\t\t\t\tbreweryImages: breweryImages,\n\t\t\t\t\tbreweryDesc: breweryDesc,\n\t\t\t\t\tbreweryDescShort: breweryDescShort,\n\t\t\t\t\tbreweryWebsite: breweryWebsite,\n\t\t\t\t\tbreweryWebsiteDisplay: breweryWebsiteDisplay,\n\t\t\t\t\tbreweryEstablished: breweryEstablished\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t\tconsole.log('myMetaData =');\n\t\tconsole.log(myMetaData);\n\t\tconsole.log('myData =');\n\t\tconsole.log(myData);\n\t\tpopulateData(myData, myMetaData, searchType);\n\t}", "function search() {\n\tevent.preventDefault();\n\tvar response_text;\n\tvar title = document.getElementById(\"title\").value;\n\tif (!title)\n\t\tdocument.getElementById(\"searchResults\").innerHTML = \"You must enter a title!\";\n\telse {\n\t\tvar URL = \"http://www.omdbapi.com/?s=\" + title;\n\t\tvar httpRequest = createHttpRequestObject(); \n\t\thttpRequest.onreadystatechange = function() {\n\t\t\tif (httpRequest.readyState != 4) {\n\t\t\t\treturn; \n\t\t\t}\n\t\t\tif (httpRequest.readyState === 4 && httpRequest.status === 200) {\n\t\t\t\tresponse_text = JSON.parse(httpRequest.responseText);\n\t\t\t\tdisplay(response_text);\n\t\t\t} else {\n\t\t\t\talert('There was a problem with the request.'); \n\t\t\t}\n\n\t\t}\n\t\thttpRequest.open(\"GET\", URL, true);\n\t\thttpRequest.send();\n\t}\n}", "function callDataAPI() {\n var xhr = new XMLHttpRequest();\n xhr.open(\n \"GET\",\n \"https://api.coronavirus.data.gov.uk/v1/data?filters=areaType%3Dnation%3BareaName%3Dengland&structure=%7B%22date%22%3A%22date%22%2C%22name%22%3A%22areaName%22%2C%22code%22%3A%22areaCode%22%2C%22cases%22%3A%7B%22daily%22%3A%22newCasesByPublishDate%22%2C%22cumulative%22%3A%22cumCasesByPublishDate%22%7D%2C%22deaths%22%3A%7B%22daily%22%3A%22newDeathsByDeathDate%22%2C%22cumulative%22%3A%22cumDeathsByDeathDate%22%7D%2C%22vaccines%22%3A%7B%22weekly2nddose%22%3A%22weeklyPeopleVaccinatedSecondDoseByVaccinationDate%22%2C%22weekly1stdose%22%3A%22weeklyPeopleVaccinatedFirstDoseByVaccinationDate%22%2C%22cum1stdose%22%3A%22cumPeopleVaccinatedFirstDoseByVaccinationDate%22%2C%22cum2nddose%22%3A%22cumPeopleVaccinatedSecondDoseByVaccinationDate%22%7D%7D\",\n false\n );\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.send(null);\n \n var jsonObject = JSON.parse(xhr.responseText);\n return jsonObject;\n }", "function search_call() {\n\tvar url_string = window.location.href\n\tvar params = url_string.split(\"?\")[1];\n\t\n\tvar query = \"https://images-api.nasa.gov/search?\" + params;\n\tvar result = httpGetAsync(query, parse);\n}", "function searchWeather(searchTerm) {\n getSearchMethod(searchTerm);\n fetch(\n `https://cors-anywhere.herokuapp.com/http://api.openweathermap.org/data/2.5/weather?${searchMethod}=${searchTerm}&APPID=${appid}&units=metric`\n )\n .then((result) => {\n return result.json();\n })\n .then((result) => {\n console.log(result);\n if (result.cod != \"404\") {\n useLatAndLong(result.coord);\n init(result);\n } else {\n error.innerHTML = \"Location not available\";\n }\n })\n .catch((err) => {\n console.log(err);\n });\n}", "function searchBIT (input) {\n // Requiring moment to format the concert date\n var moment = require(\"moment\");\n // Bands in Town Request\n request(\"https://rest.bandsintown.com/artists/\" + input + \"/events?app_id=codingbootcamp\", function (error, response, body) {\n if (error) {\n console.log(\"An error occured: \" + error)\n } else {\n // console.log(body);\n console.log(\n \"Lineup: \" + JSON.parse(body)[0].lineup +\n \"\\nVenue name: \" + JSON.parse(body)[0].venue.name +\n \"\\nLocation: \" + JSON.parse(body)[0].venue.city +\n \"\\nEvent Date: \" + moment(JSON.parse(body)[0].venue.datetime).format(\"MM/DD/YYYY\")\n );\n };\n })\n}", "function getSearchResponse(text) {\n // First, get bing :( response\n let res = rp(`https://www.bing.com/search?q=${text}`).then((body) => {\n var soup = new JSSoup(body);\n // Get the regular responses\n var resultsHTML = soup.findAll('li', 'b_algo');\n const DESC_SIZE = 100;\n let results = resultsHTML.slice(0, 4).map(e => {\n let titleHtml = e.find(\"h2\");\n if (titleHtml) {\n let urlHtml = titleHtml.find(\"a\");\n let descHtml = e.find(\"p\") ? e.find(\"p\") : e.find(\"span\");\n if (urlHtml && descHtml) {\n return {\n title: titleHtml.text,\n url: urlHtml.attrs[\"href\"],\n desc: descHtml.text.substring(0, DESC_SIZE - 3) + \"...\"\n }\n } else {\n return null\n }\n }\n }).filter(e => e != null);\n // Get the card, if there is one\n let x = soup.find(\"div\", \"b_entityTP\");\n if (x) {\n // Ensure the card has the right things in it\n let descHtml = x.find(\"div\", \"b_snippet\")\n let urlHtml = x.find(\"div\", \"infoCardIcons\") ? x.find(\"div\", \"infoCardIcons\").find(\"a\") : null;\n let titleHtml = x.find(\"div\", \"b_clearfix\") || x.find(\"h2\"); \n const CARD_DESC_SIZE = 300;\n if (descHtml && urlHtml && titleHtml) {\n results = results.concat({\n type: \"card\",\n desc: descHtml.text.substring(0, CARD_DESC_SIZE - 3) + \"...\",\n url: urlHtml.attrs[\"href\"],\n title: titleHtml.text\n });\n }\n }\n return results;\n });\n return res;\n}", "function retrieveEventfulEventsResults(data, formattedAddress, lat, long) {\n var events = data.getElementsByTagName('event');\n for (var i = 0, len = events.length; i < len; i++) {\n var e = events[i];\n var title = sanitizeEventTitle(\n e.getElementsByTagName('title')[0].textContent);\n if (eventWithSimilarTitleExists(title)) {\n continue;\n }\n var start = e.getElementsByTagName('start_time')[0].textContent;\n var latitude = e.getElementsByTagName('latitude')[0].textContent;\n var longitude = e.getElementsByTagName('longitude')[0].textContent;\n var venueName = e.getElementsByTagName('venue_name')[0].textContent;\n var commonLocation = formattedAddress.split(',')[0];\n var eventId = 'event_' + createRandomId();\n if (!eventMediaItems[eventId]) {\n eventMediaItems[eventId] = {};\n }\n var imageSrc = '';\n if ((e.getElementsByTagName('image')) &&\n (e.getElementsByTagName('image').length > 0)) {\n var image = e.getElementsByTagName('image')[0];\n if ((image.getElementsByTagName('url')) &&\n (image.getElementsByTagName('url').length > 0)) {\n imageSrc = image.getElementsByTagName('url')[0].textContent;\n }\n }\n var eventHtml =\n htmlFactory.event(eventId, title, start, imageSrc, 'Eventful');\n eventPages[eventId] = addPage(eventHtml);\n // use the exacter event venue location\n getMediaItems(title, venueName, latitude, longitude, eventId,\n eventHtml);\n // use the less exact search location\n getMediaItems(title, commonLocation, lat, long, eventId,\n eventHtml);\n\n }\n\n\n}", "async function getSearch(){\n const res = await fetch(`https://www.omdbapi.com/?apikey=1a241340&s=${search.value}&type=movie&page=${page}`)\n const data = await res.json()\n if (data.Response === 'False'){\n results.innerHTML = `There is no results for search ${search.value}`\n }\n else { displayMovies(data.Search, Number(data.totalResults))}\n}", "function concertThis() {\n let artist = searchTerm;\n let concertURL = \"https://rest.bandsintown.com/artists/\" + artist + \"/events?app_id=codingbootcamp\";\n axios.get(concertURL).then(response => {\n for (i = 0; i < 3; i++) {\n let data = response.data\n let date = moment(data[i].datetime).format(\"MM-DD-YYYY\")\n console.log(\"\\nVenue: \" + data[i].venue.name + \"\\nLocation: \" + data[i].venue.city + \", \" + data[i].venue.region + \"\\nDate: \" + date);\n };\n }).catch(error => {\n console.log(error);\n });\n}", "function movieThis(search){\n axios.get(\"https://www.omdbapi.com/?t=\" + search + \"&y=&plot=short&apikey=trilogy\")\n .then(function(response) {\n console.log(\n `--------------------------------------------------------------------\nMovie Title: ${response.data.Title}\nYear of Release: ${response.data.Year}\nIMDB Rating: ${response.data.imdbRating}\nRotten Tomatoes Rating: ${response.data.Ratings[1].Value}\nLanguage: ${response.data.Language}\nCast: ${response.data.Actors}\nPlot: ${response.data.Plot}`\n );\n \n })\n .catch(function (error) {\n console.log(error);\n });\n \n}", "async function searchClinic({name,state,from,to}) {\n\n\n ///get all clinics from the API\n const clinics = await getClinicFromApi();\n let search = clinics;\n\n //filter clinic by name if present\n if(name){\n search = clinics.filter(cl=>{\n const n = cl.clinicName || cl.name;\n return n.toLowerCase().includes(name.toLowerCase());\n })\n }\n\n //filter clinic by state if present\n if(state){\n search = clinics.filter(cl=>{\n const s = cl.stateCode || cl.stateName;\n return s.toLowerCase().includes(state.toLowerCase());\n })\n }\n\n //filter clinic by availability: from if present\n if(from){\n search = search.filter(cl=> {\n const avail = cl.availability || cl.opening;\n return avail.from===from\n });\n }\n\n //filter clinic by availability: to if present\n if(to){\n search = search.filter(cl=> {\n const avail = cl.availability || cl.opening;\n return avail.to===to\n });\n }\n return search;\n\n}" ]
[ "0.66069025", "0.66008765", "0.6473155", "0.6405202", "0.63661987", "0.6336309", "0.6201802", "0.6135798", "0.6096908", "0.6095673", "0.60842526", "0.60638577", "0.6046756", "0.60341024", "0.6010977", "0.5998806", "0.5962297", "0.5958549", "0.5953394", "0.59469163", "0.5939827", "0.59385437", "0.5919886", "0.59077746", "0.58928883", "0.589162", "0.5889797", "0.5886776", "0.5870286", "0.58348906", "0.5824467", "0.5814294", "0.5808945", "0.57966644", "0.5793833", "0.57879233", "0.5785246", "0.5783922", "0.57783777", "0.57738864", "0.577099", "0.57631713", "0.57463557", "0.57394063", "0.5734112", "0.5710721", "0.57089233", "0.5703608", "0.57033104", "0.57025546", "0.57008195", "0.56991136", "0.56962496", "0.5695921", "0.5693537", "0.5689038", "0.56846976", "0.5681347", "0.56795394", "0.5678112", "0.5674778", "0.56701493", "0.56672263", "0.56588924", "0.5653934", "0.56492645", "0.5643698", "0.5643623", "0.5640672", "0.5621788", "0.5618833", "0.56184816", "0.5612084", "0.5610131", "0.5607012", "0.5606754", "0.56042886", "0.5599053", "0.5595007", "0.55938625", "0.5586367", "0.55862296", "0.5585086", "0.55831206", "0.5577627", "0.55772936", "0.5567706", "0.5563939", "0.5563009", "0.55571955", "0.55488026", "0.5547537", "0.554506", "0.5544111", "0.55440503", "0.55414885", "0.5536768", "0.55262905", "0.5523793", "0.5523356", "0.5520733" ]
0.0
-1
Function created to extract data from the GitHub API
function createJobListForGitHub(dataInfo) { let result = ""; for (let i = 0; i < dataInfo.length; i++) { result += "<div class='list' style='cursor: pointer;' onclick='window.location=" + '"' + dataInfo[i].url + '"' + ";'> "; // If logo not found, display GitHub Jobs logo if(dataInfo[i].company_logo == undefined) { result += "<img src='https://pbs.twimg.com/profile_images/625760778554093568/dM7xD4SQ_400x400.png'></img>"; } else { result += "<img src='" + dataInfo[i].company_logo + "'></img>" } result += "<div> <h1>" + dataInfo[i].title + "</h1> </div>"; result += "<div> <h2>" + dataInfo[i].company + "</h2> </div>"; let location = dataInfo[i].location.split(";"); let fixedLocation = ""; for (let y = 0; y < location.length; y++) { fixedLocation += location[y] + "<br/>"; } result += "<div> <h2>" + fixedLocation + "</h2> </div>"; // Date format DD MM YYYY result += "<div> <h3>" + dataInfo[i].created_at.slice(8,10) + " " + dataInfo[i].created_at.slice(3,8)+ " " + dataInfo[i].created_at.slice(24) + "</h3> </div>"; result += "</div> " } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function smallDataFetch(search){\n return fetch('https://api.github.com/repos/'+search+'/stats/contributors')\n .then(data=>data.json())\n .then(data=>{\n let betterData = []\n for(i=0; i<data.length; i++){\n betterData.push({'total':data[i].total,'user':data[i].author.login})\n }\n return betterData\n })\n}", "function fetchGithubData(full_name) {\n let gitHub = 'https://api.github.com/repos/' + full_name;\n // actions.push();\n fetch(gitHub)\n .then(res => res.json())\n .then(res => updateTable(res))\n // Update the chart too!\n .then(res => updateChart())\n}", "function getExternal() {\n fetch('https://api.github.com/users')\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n console.log(data);\n let op = '';\n data.forEach(function (user) {\n op+= `<li>${user.login}</li>`\n });\n document.getElementById('output').innerHTML = op;\n })\n .catch(function (err) {\n console.log(err);\n });\n}", "function getExternal() {\n fetch(\"https://api.github.com/users\")\n .then(function (res) {\n return res.json();\n })\n .then(function (data) {\n console.log(data);\n let output = \"\";\n data.forEach(function (user) {\n output += `<li>${user.login}</li>`;\n });\n document.getElementById(\"output\").innerHTML = output;\n })\n .catch(function (err) {\n console.log(err);\n });\n}", "function getExternal(){\n fetch('https://api.github.com/users')\n .then(res => res.json())\n .then(data =>{\n\n console.log(data);\n let output = '';\n data.forEach(function(user){\n\n output += `<li>${user.login}</li>`\n });\n document.getElementById('output').innerHTML = output;\n \n\n })\n .catch(err => console.log(err));\n\n}", "function getDetailsFromGithubCommits() {\n return new Promise((resolve, reject) => {\n let numberOfPagesToRequest = 0;\n getPagedGithubCommits(0).then((data) => {\n data.headers.forEach((val, key) => {\n let indexOfFirstPage = val.indexOf(\"page=\");\n if(indexOfFirstPage > -1) {\n let indexOfSecondPage = val.substring(indexOfFirstPage+5, val.length).indexOf(\"page=\");\n if(indexOfSecondPage > -1) {\n let restOfString = val.substring(indexOfFirstPage + indexOfSecondPage + 10, val.length);\n numberOfPagesToRequest = Number(restOfString.substring(0, restOfString.indexOf('>')));\n getCommitsAndProcess(numberOfPagesToRequest).then((data) => {\n resolve(data);\n });\n }\n }\n });\n }); \n });\n}", "function getAPI(){\n fetch('https://api.github.com/users')\n .then(function (respnse) {\n return respnse.json();\n }).then(function (data) {\n console.log(data);\n let output ='';\n data.forEach(function(user){\n output+=`<li>${user.login}</li>`;\n })\n document.getElementById('output').innerHTML = output;\n }).catch(function(err){\n console.log(err);\n });\n}", "function getExternal() {\n fetch('https://api.github.com/users')\n .then(function(res){\n return res.json();\n })\n .then(function(data) {\n console.log(data);\n let output = '';\n data.forEach(function(user) {\n output += `<li>${user.login}</li>`;\n });\n document.getElementById('output').innerHTML = output;\n })\n .catch(function(err){\n console.log(err);\n });\n}", "async getWithToken(url,token) {\n \n // Awaiting for fetch response\n const response = await fetch(url,{\n \"method\": \"GET\",\n \"headers\": {\n \"Authorization\": \"token \"+token,\n \"Accept\": \"application/vnd.github.v3+json\"\n }\n });\n \n // Awaiting for response.json()\n const data = await response.json();\n\n // Awaiting for data.sha\n const resData = await data.sha;\n \n // Returning result data\n return resData;\n }", "function getExternal(){\n fetch('https://api.github.com/users')\n .then(res => res.json())\n .then(data => {\n console.log(data);\n let output = '';\n data.forEach(function(user){\n output += `<li>${user.login}</li>`;\n });\n document.getElementById('output').innerHTML = output;\n })\n .catch(err => console.log(err));\n}", "async function getGithubData(owner, name, contentfulName) {\n try {\n const response = await githubApiClient.request(`\n query {\n repository(owner:\"${owner}\", name:\"${name}\") {\n name\n description\n diskUsage\n issues {\n totalCount\n }\n stargazers {\n totalCount\n }\n licenseInfo {\n spdxId\n url\n }\n pushedAt\n releases(last: 2) {\n nodes {\n name\n isPrerelease\n isDraft\n publishedAt\n tagName\n url\n }\n }\n }\n }\n `);\n return response;\n } catch (error) {\n console.log('Cannot get data for Github repo: ', `${contentfulName} - ${owner}/${name}`);\n return null;\n }\n}", "async function getGithubData(owner, name, contentfulName) {\n try {\n const response = await githubApiClient.request(`\n query {\n repository(owner:\"${owner}\", name:\"${name}\") {\n name\n description\n diskUsage\n issues {\n totalCount\n }\n stargazers {\n totalCount\n }\n licenseInfo {\n spdxId\n url\n }\n pushedAt\n }\n }\n `);\n return response;\n } catch (error) {\n console.log('Cannot get data for Github repo: ', `${contentfulName} - ${owner}/${name}`);\n return null;\n }\n }", "function bigDataFetch(search){\n //search should be in form ':owner/:repo'\n return fetch('https://api.github.com/repos/'+search+'/commits')\n .then(data=>data.json())\n .then(data=>{\n\n //collect the commit ids\n let commitsID = [];\n for(i = 0; i < data.length; i++){\n commitsID.push(data[i].sha)\n }\n\n //make group of fetches\n let requests = commitsID.map(id=>{\n return fetch('https://api.github.com/repos/'+search+'/commits/'+id)\n })\n\n //parse the fetches\n return Promise.all(requests)\n .then(body=>{\n let requests = body.map(res=>{\n return res.json()\n })\n return Promise.all(requests)\n .then(data=>{\n //now we have the new and improved data, but still need language info\n return fetch('https://api.github.com/repos/'+search+'/languages')\n .then(data=>data.json())\n .then(lang=>{\n let finalData = {'commits': data,'languages':lang}\n console.log(finalData)\n return finalData\n })\n .catch(error=>{\n console.error('Error:',error)\n })\n })\n })\n .catch(error=>{\n console.error('Error:',error)\n })\n })\n .catch(error=>{\n console.error('Error:',error)\n })\n}", "function getGitHubData(){\n\n var counterArray = [];\n console.dir(counterArray);\n\n // CREATING THE URL FOR THE GITHUB API CALL\n var time = yesterday;\n var url = \"https://api.github.com/search/repositories?q=+created:>\"+time+\"&per_page=1000&sort=stars\";\n console.log(\"GitHub API url: \" + url);\n\n $.ajax({\n async: false,\n url: url,\n type: 'GET',\n dataType: 'json',\n error: function(err){\n console.log(\"Could not get data from GitHub :(\");\n console.log(err);\n },\n success: function(data){\n\n var repositories = data.items;\n console.log(\"We got some data... :)\");\n console.dir(data);\n\n // COUNTING NUMBER OF NEW GITHUB REPOSITORIES PER LANGUAGE\n for (var i = 0; i < repositories.length; i++){\n\n var language = repositories[i].language;\n var exists = 0;\n\n if (language === null){\n continue;\n }\n\n for (var n = 0; n < counterArray.length; n++) {\n if (counterArray[n].name == language) {\n counterArray[n].repos++;\n exists = 1;\n break;\n }\n }\n\n if(exists === 0) {\n counterArray.push({\n name: language,\n repos: 1\n });\n }\n\n if (counterArray.length == 10) {\n break;\n }\n }\n\n\n // SORTING COUNTERARRAY ACCORDING TO NUMBER OF NEW REPOSITORIES\n function compareForSort(a,b){\n if (a.repos == b.repos)\n return 0;\n if (a.repos > b.repos)\n return -1;\n else\n return 1;\n }\n\n counterArray = counterArray.sort(compareForSort);\n\n\n // ADDING PERCENT PROPERTY TO EACH LANGUAGE OBJECT ON THE ARRAY\n var sumRepositories = 0;\n for (i = 0; i < counterArray.length; i++){\n sumRepositories = sumRepositories + counterArray[i].repos;\n }\n\n for (i = 0; i < counterArray.length; i++){\n counterArray[i].repos_percent = Math.round(counterArray[i].repos / sumRepositories * 100);\n }\n // console.log(counterArray);\n },\n });\n console.log(\"Here's the data from GitHub:\");\n console.dir(counterArray);\n return counterArray;\n}", "function getUserInfo(name) {\n console.log();\n const url = `https://api.github.com/users/${name}/repos`;\n //fetch api GET calls github api\n fetch(url)\n .then( response => {\n //check for errors before returning response.json \n if (response.ok) {\n return response.json() ;\n }\n //send eror status text to .catch\n throw new Error(response.statusText) ;\n })\n //do something \n .then(responseJson => displayResults(responseJson))\n .catch( err => {$( '#js-error-message' ).text(`something went wrong: ${err.message}`);\n });\n}", "async getUserData(){\n let urlProfile = `http://api.github.com/users/${this.user}?client_id=${this.client_id}&client_secrt=${this.client_secret}`;\n let urlRepos = `http://api.github.com/users/${this.user}/repos?per_page=${this.repos_count}&sort=${this.repos_sort}&${this.client_id}&client_secrt=${this.client_secret}`;\n\n\n const profileResponse = await fetch(urlProfile);\n const reposResponse = await fetch(urlRepos);\n\n const profile = await profileResponse.json();\n const repo = await reposResponse.json();\n\n\n return{\n profile,\n repo\n }\n }", "function api (response) {\n // TODO: Return promise for GitHub api response to get user data.\n // (Hint: Use axios to send a get request and return the promise created by calling axios.get())\n function getUser(username) {\n const queryUrl = \"https://api.github.com/users/\"+{username}+\"/repos?per_page=100\";\n\n axios.get(queryUrl).then(function(res) {\n const repo = res.data;\n console.log(repo)\n });\n };\n}", "function obter_dados_do_repo() {\n \n const url2 = API_REPO\n \n let r = fetch(url2)\n r.then(function(response) { \n \n var data = response.json()\n\n .then(complete_os_dados_do_repositório)\n })\n}", "function getJsonGit(){\n fetch('https://api.github.com/users')\n .then(resp => resp.json())\n .then(data => {\n console.log(data);\n\n const dataDisplay = data.map(item => {\n return `<li>${item.login} <img src='${item.avatar_url}' width='200px' height='200-x' > </li>`\n });\n\n output.innerHTML = `<ul>${dataDisplay.join('')}</ul>`;\n });\n}", "function parseGitHubTrendingRepos(err, body) {\n\tif (err) { return tubesio.finish(err); }\n\n\t// Load the raw HTML into a cheerio object so we can traverse\n\t// the data using CSS selectors ala jQuery.\n\tvar $ = cheerio.load(body),\n\t\tresult = {\n\t\t\ttitle: $('title').text(),\n\t\t\ttrending: []\n\t\t};\n\n\t// Iterate over the trending repositories extracting the names\n\t// and hyperlinks.\n\t$('#trending-repositories > ol > li').each(function (i, e) {\n\t\tresult.trending.push({\n\t\t\tname: us.trim($(e).find('h3').text()),\n\t\t\thref: 'https://github.com' + $(e).find('a').last().attr('href')\n\t\t});\n\t});\n\n\t// Return our results object\n\ttubesio.finish(result);\t\n}", "function getGithubRepos() {\n return fetch(\n \"https://api.github.com/search/repositories?q=stars:>25000+language:javascript&sort=stars&order=desc\"\n ).then(data => data.json());\n}", "function getinformationUser(user) {\n return fetch(`https://api.github.com/users/${user}`)\n .then((data)=> data.json())\n .then(data => {\n console.log(data);\n return data\n } );\n}", "function githubRepos(){\n $http({\n method: 'GET',\n url: '/github/repos/'\n }).then(function(response) {\n console.log(response.data);\n repos.data = response.data;\n });\n }", "function getRepositories() {\n\n// conditional -- handling exceptions\n if (SearchInput.value === '') {\n \n alert('Please Enter Project name');\n\n } \n else {\n responseTag.innerHTML=''; \n //declaring variables to handle the required data\n var ProjectName; var RepoLink; var Description; var UserProfile;\n // sending the request and fetching the JSON file -- resuming that we are getting 10 items per page -- will add pagination later\n var url=`https://api.github.com/search/repositories?q=${SearchInput.value}&page=1&per_page=10` \n var response=fetch(url)\n .then(response => response.json())\n .then(data => {\n console.log(data.items);\n items=JSON.parse(JSON.stringify(data.items));\n items.forEach(item =>{\n\n // assigning the variables \n\n UserProfile = item.owner.url;\n ProjectName=item.full_name;\n RepoLink = item.html_url;\n Description = item.description;\n\n //-----------------------------------------------------------------------\n\n //create a div and text for the project name\n let ProjectDiv = document.createElement('div');\n \n //modification for var ${name}\n let ProjectNameNode = document.createTextNode(`Project Name: ${ProjectName}`);\n\n //appends the username to a div(userDive)\n ProjectDiv.appendChild(ProjectNameNode);\n\n //appends the div(userDive) to the main Response div(responseTag)\n responseTag.appendChild(ProjectDiv);\n\n // //-----------------------------------------------------------------------\n\n //create a div and text for the project name\n let DescriptionDiv = document.createElement('div');\n \n //modification for var ${name}\n let DescriptionNode = document.createTextNode(`Project Description: ${Description}`);\n\n //appends the username to a div(userDive)\n DescriptionDiv.appendChild(DescriptionNode);\n\n //appends the div(userDive) to the main Response div(responseTag)\n responseTag.appendChild(DescriptionDiv);\n\n //-----------------------------------------------------------------------\n\n // create a div and text for the User Profile\n let UserProfileDiv = document.createElement('div');\n \n //modification for var ${bio}\n let UserProfileNode= document.createTextNode(`User Prfile: ${UserProfile}`);\n\n // appends the bio to a div(bioDiv)\n UserProfileDiv.appendChild(UserProfileNode);\n\n // appends the div(bioDiv) to the main Response div(responseTag)\n responseTag.appendChild(UserProfileDiv);\n\n //--------------------------------------------------------------------------\n\n //create a div and a link for the profile repo link\n\n let RepoLinkDiv = document.createElement('div');\n let RepoLinkElement = document.createElement('a');\n let RepoLinkText = document.createTextNode(`Checkout the Repository here!`);\n // specifices the path of the url and opens it in a new tab\n RepoLinkElement.href = RepoLink;\n RepoLinkElement.setAttribute('target', '_blank');\n\n //appends the text (RepoLinkDiv) to the <a> (accountLink)\n RepoLinkElement.appendChild(RepoLinkText);\n\n //appends the <a> (RepoLinkElemment) to a div (accountDiv)\n RepoLinkDiv.appendChild(RepoLinkElement);\n\n // appends the div (RepoLinkDev) to the main Response Div(responseTag)\n responseTag.appendChild(RepoLinkDiv); \n\n }) \n \n })\n\n //clearing the input after searching\n SearchInput.value='';\n\n }\n }", "function getData() {\n\tvar query = \"http://api.nytimes.com/svc/search/v2/articlesearch.json?q=\" + search + \"&api-key=\" + key;\n\trequest({\n\t\turl: query,\n\t\tjson: true\n\t}, \n\tfunction(error, response, data) {\n\t\tif (error) {\n\t\t\tthrow error;\n\t\t}\n\t\tvar urls = [];\n\t\tvar docs = data.response.docs;\n\t\tfor (var d in docs) {\n\t\t\turls.push(docs[d].web_url);\n\t\t}\n\t\tconsole.log(urls);\n\t});\n}", "function getGithubData($http, callback) {\n $http({\n method : 'GET',\n url : serviceUrl + '/api/preview/recentGithubActivity'\n })\n .then(function success(response) {\n return callback(null, response.data);\n }, function error(response) {\n return callback(response);\n });\n}", "async function getRepoData(repoUrl) {\n try {\n const res = await axios.get(`${repoUrl}`, {\n headers: {\n Authorization: `token ${process.env.PAT}`,\n },\n });\n //return response.items[0].login+\":\"+response.items[0].id;\n console.log(\"FROM REPO FETCHING FUNCTION: \\n\\n\" + JSON.stringify(res.data));\n return res.data;\n } catch (err) {\n console.log(err);\n }\n}", "async function getTopGitHubRepos(searchValue, count){\n \n // create blank array of objects\n var arrGitHubObjects = [];\n \n // create queryString URL\n var gitHubQueryString = \"https://api.github.com/search/repositories?q=language:\"+searchValue+\"+\"+searchValue+\"&sort=stars&order=desc\";\n \n // START gitHub API call\n await $.ajax({\n // use GET to return api data\n type: \"GET\",\n // queryString url\n url: gitHubQueryString,\n // data returned will be in json format\n dataType: \"json\" \n // then promise\n }).then(function(response) {\n \n console.log(response);\n // START iterate through top five objects in response \n for (var i = 0; i < count; i++){\n\n // create var for current repo object\n var repo = response.items[i];\n \n // assign repo title and link to object at current index\n arrGitHubObjects.push({name: repo.name, url: repo.html_url}); \n\n }\n // END iterate through top five objects in response\n\n });\n // END gitHub API call\n\n return arrGitHubObjects;\n\n}", "static parseResponse(response) {\n\n const {data} = response;\n\n const createdAt = (data.gh_created_at) ? new Date(data.gh_created_at * 1000) : null;\n const updatedAt = (data.gh_last_updated_at) ? new Date(data.gh_last_updated_at * 1000) : null;\n const pushedAt = (data.gh_last_pushed_at) ? new Date(data.gh_last_pushed_at * 1000) : null;\n\n return {\n name: data.name,\n shortDescription: data.gh_description,\n fullDescription: data.description,\n url: data.gh_url,\n status: data.status,\n repoCreatedAt: createdAt,\n repoLastPushedAt: pushedAt,\n repoLastUpdatedAt: updatedAt,\n cloneUrl: data.gh_clone_url,\n homepage: data.gh_homepage,\n repoSize: data.gh_size,\n repoLanguages: data.gh_languages,\n owner: data.github_user\n };\n\n }", "async getBlogDetails(url){\n\n let resp = await fetch(url)\n\n let respData = await resp.json()\n\n return respData\n }", "function getPaginationInfoFromHeader(username) {\n\n return fetch_retry(GITHUB_API_HOST + \"/users/\" + username + \"/repos\", {\n headers: {\n \"Content-Type\": \"application/json\",'Authorization': 'token ' + process.env.GITHUB_API_TOKEN \n \n }, \n }, 3).then(function (response) {\n // console.log(response)\n if (response.ok) {\n return response.headers.get('link');\n }\n // else\n const error = new Error(response.statusText)\n error.response = response\n throw error\n });\n}", "function getListOfRepos(data){\n var list = [];\n data.forEach(function(d){ //go through the list of the repo objects\n var description = '';\n if(d['description'] == null){\n description = 'Repository has no description.' //check if repo has no description, then set a default description\n }\n else{\n description = d['description']; //if has description, then give var description that value\n }\n var content = { //objects of content will be passed onto the list\n 'fullname':d['full_name'],\n 'url':d['html_url'],\n 'update':repoUtils.formatDate(d['updated_at'].split(\"T\")[0]),\n 'des':description\n };\n list.push(content);\n });\n return repoUtils.sortByDate(list);\n}", "async function fetchDataFromGithub() {\n let data = [];\n let currentPage = 0;\n\n while (true) {\n await delay();\n const currentPageData = await fetchCommitApi(currentPage);\n if (currentPageData.length === 0) break;\n\n data = [...data, ...currentPageData];\n currentPage++;\n }\n\n return data;\n}", "function getRepos() {\n let repo;\n\n// if (theInput.value == \"\") { // If Value Is Empty\n\n// reposData.innerHTML = \"<span>Please Write Github Username.</span>\";\n\n// } else {\n var dates = [];\n var projects = [];\n var pName_andDate = [];\n\n fetch(`https://api.github.com/users/rakan-mz/repos?sort=updated&per_page=4`)\n\n .then((response) => response.json())\n\n .then((repositories) => {\n\n // Empty The Container\n reposData.innerHTML = '';\n\n // Loop On Repositories\n repositories.forEach(repo => {\n\n // Create The Main Div Element\n let mainDiv = document.createElement(\"div\");\n\n // Create Repo Name Text\n let repoName = document.createTextNode(repo.name);\n \n let repoSpan = document.createElement(\"text\");\n repoSpan.className = 'col-xl-6 col-lg-5 col-md-5 col-xs-12 mb-2 mb-md-0 text-center align-self-center repo-name';\n\n\n let repoText = document.createTextNode(repo.name);\n\n // Add Stars Count Text To Stars Span\n repoSpan.appendChild(repoText);\n\n // Append Stars Count Span To Main Div\n mainDiv.appendChild(repoSpan);\n\n\n if(repo.name == 'Xi-Store'){\n alert(\"dsd\");\n }\n // console.log();\n\n // Append The Text To Main Div\n // mainDiv.appendChild(repoName);\n\n // console.log(repo.updated_at);\n\n // Create Repo URL Anchor\n let theUrl = document.createElement('a');\n theUrl.className = 'col-xl-2 col-lg-3 col-md-3 col-xs-6';\n\n \n\n // Create Repo Url Text\n let theUrlText = document.createTextNode(\"Visit\");\n\n // Append The Repo Url Text To Anchor Tag\n theUrl.appendChild(theUrlText);\n\n // Add Thje Hypertext Reference \"href\"\n theUrl.href = `https://github.com/rakan-mz/${repo.name}`;\n\n // Set Attribute Blank\n theUrl.setAttribute('target', '_blank');\n\n // Append Url Anchor To Main Div\n mainDiv.appendChild(theUrl);\n\n // Create Stars Count Span\n let one = document.createElement(\"span\");\n one.className = 'col-xl-3 col-lg-3 col-md-3 col-xs-6 mb-2 mb-md-0 ';\n\n let two = document.createElement(\"text\");\n\n // Create The date Text\n let u = repo.updated_at;\n let x = u.toString(); \n const months = [\"JAN\", \"FEB\", \"MAR\",\"APR\", \"MAY\", \"JUN\", \"JUL\", \"AUG\", \"SEP\", \"OCT\", \"NOV\", \"DEC\"];\n const d = new Date(x);\n const date1 = d.getDate();\n const date2 = d.getMonth();\n const date3 = d.getFullYear();\n let date = date1+ \"-\" +months[date2]+ \"-\" +date3;\n let starsText = document.createTextNode(`Last Update: `);\n let starsText2 = document.createTextNode(`${date}`);\n\n var xi = document.getSelection(starsText2);\n two.className = \"textDate\";\n\n dates.push(date);\n projects.push(repo.name);\n\n // Add Stars Count Text To Stars Span\n one.appendChild(starsText);\n two.appendChild(starsText2);\n\n // Append Stars Count Span To Main Div\n mainDiv.appendChild(one);\n one.appendChild(two);\n\n // Add Class On Main Div\n mainDiv.className = 'repo-box row';\n // mainDiv.className = '';\n mainDiv.appendChild(theUrl);\n\n // Append The Main Div To Container\n reposData.appendChild(mainDiv);\n\n });\n});\n\n// }\n\n}", "function getContributions(author, permlink) {\r\n var url = `https://utopian.rocks/api/posts?author=`+author;\r\n var m_body = '';\r\n https.get(url, function(res) {\r\n res.on('data', function(chunk) {\r\n m_body += String(chunk);\r\n });\r\n res.on('end', function() {\r\n try {\r\n const response = JSON.parse(m_body);\r\n console.log(\"Total Contributions \", response.length);\r\n if (response.length > 0) {\r\n var contributionsObj = {\r\n \"total\": response.length,\r\n \"approved\": 0,\r\n \"staff_picked\": 0,\r\n \"total_payout\": 0.0\r\n };\r\n \r\n var first_contribution_date = timeConverter(response[0].created.$date);\r\n \r\n contributionsObj['category'] = {};\r\n contributionsObj['approved'] = response.filter(function (el) { return el.voted_on == true;});\r\n contributionsObj['staff_picked'] = response.filter(function (el) { return el.staff_picked == true;});\r\n\r\n contributionsObj['category']['analysis'] = response.filter(function (el) { return el.category === 'analysis' && el.voted_on === true;});\r\n contributionsObj['category']['blog'] = response.filter(function (el) { return el.category === 'blog' && el.voted_on === true;});\r\n contributionsObj['category']['bughunting'] = response.filter(function (el) { return el.category === 'bug-hunting' && el.voted_on === true;});\r\n contributionsObj['category']['copywriting'] = response.filter(function (el) { return el.category === 'copywriting' && el.voted_on === true;});\r\n contributionsObj['category']['development'] = response.filter(function (el) { return el.category === 'development' && el.voted_on === true;});\r\n contributionsObj['category']['documentation'] = response.filter(function (el) { return el.category === 'documentation' && el.voted_on === true;});\r\n contributionsObj['category']['graphics'] = response.filter(function (el) { return el.category === 'graphics' && el.voted_on === true;});\r\n contributionsObj['category']['suggestions'] = response.filter(function (el) { return el.category === 'suggestions' && el.voted_on === true;});\r\n contributionsObj['category']['taskrequests'] = response.filter(function (el) { return el.category === 'task-requests' && el.voted_on === true;});\r\n contributionsObj['category']['tutorials'] = response.filter(function (el) { return el.category === 'tutorials' && el.voted_on === true;});\r\n contributionsObj['category']['videotutorials'] = response.filter(function (el) { return el.category === 'video-tutorials' && el.voted_on === true;});\r\n contributionsObj['category']['translations'] = response.filter(function (el) { return el.category === 'translations' && el.voted_on === true;});\r\n contributionsObj['category']['iamutopian'] = response.filter(function (el) { return el.category === 'iamutopian' && el.voted_on === true;}); \r\n contributionsObj['category']['task'] = response.filter(function (el) { return el.category.startsWith(\"task\") && el.voted_on === true;});\r\n contributionsObj['category']['ideas'] = response.filter(function (el) { return el.category === 'ideas' && el.voted_on === true;});\r\n contributionsObj['category']['visibility'] = response.filter(function (el) { return el.category === 'visibility' && el.voted_on === true;});\r\n\r\n response.forEach(function(contribution) {\r\n if(contribution.voted_on === true){\r\n contributionsObj.total_payout = contributionsObj.total_payout + contribution.total_payout;\r\n }\r\n });\r\n\r\n for(var key in contributionsObj.category) {\r\n const value = contributionsObj.category[key];\r\n if(value.length == 0){\r\n delete contributionsObj.category[key];\r\n }\r\n }\r\n\r\n commentOnAuthorPost(contributionsObj, first_contribution_date, author, permlink);\r\n }\r\n } catch (e) {\r\n console.log('Err' + e);\r\n }\r\n });\r\n }).on('error', function(e) {\r\n req.abort();\r\n console.log(\"Got an error: \", e);\r\n });\r\n}", "async function fetchUserDetailsWithStats() {\n for (name of [\"nkgokul\", \"BrendanEich\", \"gaearon\"]) {\n userDetails = await fetch(\"https://api.github.com/users/\" + name);\n userDetailsJSON = await userDetails.json();\n }\n}", "function parseGithubURL(url_input) {\n var data = {'user':'', 'repo':'', 'path':'', 'name':''};\n if (url_input == null){\n return data;\n }\n // attempt a single file match\n // example: https://github.com/tiggerntatie/brython-student-test/blob/master/hello.py\n // example: https://github.com/tiggerntatie/hhs-cp-site/blob/master/hhscp/static/exemplars/c02hello.py\n // example subtree: https://github.com/tiggerntatie/hhs-cp-site/tree/master/hhscp/static/exemplars\n var gittreematch = url_input.match(/.*github\\.com\\/([^/]+)\\/([^/]+)\\/tree\\/master\\/(.+)/);\n var gitfilematch = url_input.match(/.*github\\.com\\/([^/]+)\\/([^/]+)\\/blob\\/master\\/([^/]+)/);\n var gittreefilematch = url_input.match(/.*github\\.com\\/([^/]+)\\/([^/]+)\\/blob\\/master\\/(.+)\\/([^/]+)/);\n var gitrepomatch = url_input.match(/.*github\\.com\\/([^/]+)\\/([^/]+).*/);\n var gisturlmatch = url_input.match(/.*gist\\.github\\.com(\\/[^/]+)?\\/([0-9,a-f]+)/);\n var gistmatch = url_input.match(/^[0-9,a-f]+$/);\n if (gisturlmatch || gistmatch) {\n var gist = gisturlmatch ? gisturlmatch[2] : gistmatch[0];\n data = {'user':'', 'repo':'', 'path':'', 'name':gist};\n }\n else if (gitrepomatch) {\n data = {'user':gitrepomatch[1], 'repo':gitrepomatch[2], 'path':'', 'name':''};\n if (gittreematch) {\n data['path'] = gittreematch[3];\n }\n if (gittreefilematch) {\n data['path'] = gittreefilematch[3];\n data['name'] = gittreefilematch[4];\n }\n else if (gitfilematch) {\n data['name'] = gitfilematch[3];\n }\n }\n return data;\n }", "function parseGithubURL(url_input) {\n var data = { 'user': '', 'repo': '', 'path': '', 'name': '' };\n if (url_input == null) {\n return data;\n }\n // attempt a single file match\n // example: https://github.com/tiggerntatie/brython-student-test/blob/master/hello.py\n // example: https://github.com/tiggerntatie/hhs-cp-site/blob/master/hhscp/static/exemplars/c02hello.py\n // example subtree: https://github.com/tiggerntatie/hhs-cp-site/tree/master/hhscp/static/exemplars\n var gittreematch = url_input.match(/.*github\\.com\\/([^/]+)\\/([^/]+)\\/tree\\/master\\/(.+)/);\n var gitfilematch = url_input.match(/.*github\\.com\\/([^/]+)\\/([^/]+)\\/blob\\/master\\/([^/]+)/);\n var gittreefilematch = url_input.match(/.*github\\.com\\/([^/]+)\\/([^/]+)\\/blob\\/master\\/(.+)\\/([^/]+)/);\n var gitrepomatch = url_input.match(/.*github\\.com\\/([^/]+)\\/([^/]+).*/);\n var gisturlmatch = url_input.match(/.*gist\\.github\\.com(\\/[^/]+)?\\/([0-9,a-f]+)/);\n var gistmatch = url_input.match(/^[0-9,a-f]+$/);\n if (gisturlmatch || gistmatch) {\n var gist = gisturlmatch ? gisturlmatch[2] : gistmatch[0];\n data = { 'user': '', 'repo': '', 'path': '', 'name': gist };\n }\n else if (gitrepomatch) {\n data = { 'user': gitrepomatch[1], 'repo': gitrepomatch[2], 'path': '', 'name': '' };\n if (gittreematch) {\n data['path'] = gittreematch[3];\n }\n if (gittreefilematch) {\n data['path'] = gittreefilematch[3];\n data['name'] = gittreefilematch[4];\n }\n else if (gitfilematch) {\n data['name'] = gitfilematch[3];\n }\n }\n return data;\n }", "function parseGithubURL(url_input) {\n var data = { 'user': '', 'repo': '', 'path': '', 'name': '' };\n if (url_input == null) {\n return data;\n }\n // attempt a single file match\n // example: https://github.com/tiggerntatie/brython-student-test/blob/master/hello.py\n // example: https://github.com/tiggerntatie/hhs-cp-site/blob/master/hhscp/static/exemplars/c02hello.py\n // example subtree: https://github.com/tiggerntatie/hhs-cp-site/tree/master/hhscp/static/exemplars\n var gittreematch = url_input.match(/.*github\\.com\\/([^/]+)\\/([^/]+)\\/tree\\/master\\/(.+)/);\n var gitfilematch = url_input.match(/.*github\\.com\\/([^/]+)\\/([^/]+)\\/blob\\/master\\/([^/]+)/);\n var gittreefilematch = url_input.match(/.*github\\.com\\/([^/]+)\\/([^/]+)\\/blob\\/master\\/(.+)\\/([^/]+)/);\n var gitrepomatch = url_input.match(/.*github\\.com\\/([^/]+)\\/([^/]+).*/);\n var gisturlmatch = url_input.match(/.*gist\\.github\\.com(\\/[^/]+)?\\/([0-9,a-f]+)/);\n var gistmatch = url_input.match(/^[0-9,a-f]+$/);\n if (gisturlmatch || gistmatch) {\n var gist = gisturlmatch ? gisturlmatch[2] : gistmatch[0];\n data = { 'user': '', 'repo': '', 'path': '', 'name': gist };\n }\n else if (gitrepomatch) {\n data = { 'user': gitrepomatch[1], 'repo': gitrepomatch[2], 'path': '', 'name': '' };\n if (gittreematch) {\n data['path'] = gittreematch[3];\n }\n if (gittreefilematch) {\n data['path'] = gittreefilematch[3];\n data['name'] = gittreefilematch[4];\n }\n else if (gitfilematch) {\n data['name'] = gitfilematch[3];\n }\n }\n return data;\n }", "function getData () {\n return requestService.getTop()\n .then(response => {\n return parser.parseBody(response);\n })\n}", "function get_first_ten_releases_from_api(){\n return new Promise(function (resolve, reject) {\n \n let response = \"\"\n let request = new XMLHttpRequest();\n let downloads = []\n\n let get_versions = 'https://api.github.com/repos' + url.pathname +\n '?&page=1&per_page=10'\n request.onreadystatechange = function () {\n if (request.readyState == 4 && request.status == 200) {\n response = JSON.parse(request.responseText);\n for (i = 0; i < response.length; ++i) {\n version = response[i]['name']\n assets_json = response[i]['assets']\n for (j = 0; j < assets_json.length; ++j) {\n downloads.push(assets_json[j]['download_count'])\n }\n }\n resolve(downloads)\n } else if (request.status != 200 && request.status != 0) {\n msg = \"Status error retrieving releases from API: \" \n var reason = new Error(msg + request.status);\n reject(reason)\n }\n };\n request.open('GET', get_versions);\n request.send();\n });\n}", "function getUser(username) {\n const queryUrl = \"https://api.github.com/users/\"+{username}+\"/repos?per_page=100\";\n\n axios.get(queryUrl).then(function(res) {\n const repo = res.data;\n console.log(repo)\n });\n }", "function get_repositorie(){\n let xhr = new XMLHttpRequest();\n let search = document.getElementById(\"git\").value;\n xhr.open(\"GET\",\"https://api.github.com/search/repositories?q=\"+search, true);\n xhr.onload = () => show_list(JSON.parse(xhr.responseText));\n xhr.send();\n}", "getGithubStats() {\n if(this.username) {\n this.user = {};\n fetch(GITHUB_URL + this.username)\n .then(response => {\n console.log(response);\n if(response.ok) {\n return response.json();\n } else {\n throw Error(response);\n }\n })\n .then(githubUser => {\n console.log(githubUser);\n this.user = {\n id: githubUser.id,\n name: githubUser.name,\n image: githubUser.avatar_url,\n blog: githubUser.blog,\n about: githubUser.bio,\n repos: githubUser.public_repos,\n gists: githubUser.public_gists,\n followers: githubUser.followers\n };\n })\n .catch(error => console.log(error))\n } else {\n alert('Please specify a username');\n }\n }", "getGithubInfo(username) {\n // axios.all allows to take more functions and wait till all\n // the promises are resolved and then it will pass an array\n // of data that we got back from all invokations\n return axios.all([\n getRepos(username),\n getUserInfo(username)\n ]).then(arr => ({repos: arr[0].data, bio: arr[1].data }));\n }", "function getRepos(username){\n return axios.get('https://api.github.com/users/' + username + '/repos').then(function(response){\n if(!response.headers.link){\n return response.data;\n }\n else{\n var data = response.data;\n var rels = getRels(response.headers.link)\n var calls = makeCalls(username, rels.total);\n return axios.all(calls)\n .then(function(arr){\n for(var i = 0; i < arr.length; i++){\n data = data.concat(arr[i].data);\n console.log(\"DATA:\", data)\n }\n return data;\n })\n }\n });;\n}", "function getGhInfo(Name) {\n\n // default stream values\n var stream = {\n name: Name,\n location: \"\",\n logo: \"https://jpk-image-hosting.s3.amazonaws.com/twitch-app/no-image-available.jpg\",\n link: \"#\",\n followers: \"\"\n }\n \n // assemble the github api url\n function buildUrl(name) {\n return \"https://api.github.com/users/\"+name;\n }\n \n // make ajax call to github api\n $.getJSON(buildUrl(Name), function(streamData) {\n \n if (streamData.id !== null) {\n \n stream.name = streamData.name;\n stream.location = streamData.location;\n stream.logo = streamData.avatar_url || \"https://jpk-image-hosting.s3.amazonaws.com/twitch-app/no-image-available.jpg\";\n stream.link = streamData.html_url;\n stream.followers = streamData.followers;\n ghAccountObj.push(stream);\n // insert this stream into the DOM\n insertStream(stream);\n \n // if no account exists, keep the default account\n } else if (streamData.message === \"Not Found\") {\n stream.name = \"no account found\";\n stream.location = \"\";\n stream.logo =\"https://jpk-image-hosting.s3.amazonaws.com/twitch-app/no-image-available.jpg\";\n stream.link = \"#\";\n stream.followers = 0;\n ghAccountObj.push(stream);\n // insert this stream into the DOM\n insertStream(stream);\n \n } \n }).fail(error);\n \n function error() {\n alert(\"Error connecting to Github API!\");\n }\n } // /getGhInfo", "function get_all_info(template,callback)\n{\n var api_response = {};\n api_response[\"quote\"] = getRegexData(template,'<div class=\"quote\">(.*?)<\\/div>',0);\n api_response[\"author_name\"] = getRegexData(template,'<div class=\"author_name\">(.*?)<\\/div>',0);\n api_response[\"author_info\"] = getRegexData(template,'<div class=\"author_info\">(.*?)<\\/div>',0);\n\n var tags_links = getRegexData(template,'<div class=\"tags\">(.*?)<\\/div>',0);\n api_response[\"tags\"] = getTextFromLinks(tags_links);\n\n var reference_link = getRegexData(template,'<div class=\"reference_link\">(.*?)<\\/div>',0);\n api_response[\"ref_link\"] = getReferenceLink(reference_link);\n\n callback(api_response);\n\n}", "getCommits(username) {\r\n // Create a request variable and assign a new XMLHttpRequest object to it.\r\n var request = new XMLHttpRequest();\r\n request.open('GET', 'https://api.github.com/repos/' + username + \"/\" + this.selectedProject + \"/commits?since=\" + this.dateSince + \"T00:00:00Z&until=\" + this.dateUntil + \"T23:59:59Z\", true);\r\n request.setRequestHeader(\"Authorization\", \"token \" + config.token);\r\n listCommits = [];\r\n request.onload = function () {\r\n if (request.status >= 200) {\r\n var dataCommits = JSON.parse(this.response);\r\n console.log(JSON.parse(this.response))\r\n dataCommits.forEach(aCommit => {\r\n listCommits.push(\r\n { \r\n \"author\": aCommit.commit.author.name,\r\n \"date\": aCommit.commit.author.date,\r\n \"message\": aCommit.commit.message\r\n }\r\n );\r\n })\r\n } else {\r\n console.log(error);\r\n }\r\n }\r\n // Send request\r\n console.log(\"commit:\", listCommits)\r\n request.send();\r\n \r\n this.isDisplay = true;\r\n }", "function getData(username) {\n // console.log('Function called: getData()');\n const url = `https://api.github.com/users/${username}`;\n fetch(url).then((response) => {\n return response.json();\n }).then((data) => {\n let navbarUsername = document.getElementById('navbar-username');\n let navbarPhoto = document.getElementById('navbar-photo');\n navbarUsername.innerHTML = data.name.toLowerCase();\n navbarPhoto.src = `${data.avatar_url}`;\n\n console.warn(\"--- User Data fetched successfully!\");\n console.log(\"User Api Data:\", data);\n return userProfile(data);\n }).catch((error) => {\n console.log(error);\n });\n}", "function fetchTheData() {\r\n let baseURL = \"https://newsapi.org/v2/top-headlines\";\r\n deleteOld();\r\n let search = \"?q=\" + id(\"search\").value;\r\n id(\"searchTerm\").textContent = id(\"search\").value;\r\n let apiKey = \"&apiKey=c1c6c8286a5449b7a7fcc01deb46437c\";\r\n fetch(baseURL + search + apiKey)\r\n .then(checkStatus)\r\n .then(response => response.json()) // if json\r\n .then(processResponse)\r\n .catch(handleError);\r\n }", "function getRepos(username) {\n fetch(`https://api.github.com/users/${username}/repos`)\n .then(response => {\n if (response.ok) {\n return response.json();\n }\n throw new Error(response.statusText);\n })\n .then(responseJson => displayResults(responseJson))\n .catch(error => {\n $('#results-list').empty();\n $('.results').empty();\n $('#js-error-message').text(`Something went wrong - ${error.message}`);\n \n });\n}", "static async getAll() {\n const query = `{\n projectCollection(order: [order_ASC]) {\n total\n items {\n sys {\n id\n }\n name\n description\n link\n linkText\n order\n gitHubRepoName\n image {\n ${GraphQLStringBlocks.imageAsset()}\n }\n }\n }\n }`;\n\n const response = await this.callContentful(query);\n\n const projectCollection = response.data.projectCollection.items\n ? response.data.projectCollection.items\n : [];\n\n const mergeProjectsWithGitHubData = async (_) => {\n const promises = projectCollection.map(async (project) => {\n return {\n ...project,\n gitHubStats: await GitHub.getRepoForksAndStars(\n project.gitHubRepoName,\n ),\n };\n });\n\n return await Promise.all(promises);\n };\n\n const fullData = await mergeProjectsWithGitHubData();\n\n return fullData;\n }", "function getRepositories(username) {\n // console.log('Function called: getRepositories()');\n let urlRepository = `https://api.github.com/users/${username}/repos`;\n fetch(urlRepository).then((response) => {\n return response.json();\n }).then((repo) => {\n userRepositories(repo);\n }).catch((error) => {\n console.log(error);\n });\n}", "function fetchUsers() {\n return fetch('https://api.github.com/users')\n .then(response => response.json());\n}", "function fetchAPIAll(urlAPI) {\n fetch(urlAPI)\n .then((res) => res.json()) //tranform data to json\n .then(function (data) {\n let dataLength = data.length;\n\n for (let index = 0; index < dataLength; index++) {\n let objEditor = JSON.parse(data[index].editorState);\n let dateEditor = data[index].date;\n let name_author = data[index].authors[0].user.full_name;\n let name_author_id = data[index].authors[0].user.name;\n let objBlockEditor = objEditor.blocks.length;\n\n\n let arrayObjImage = [];\n arrayObjImage = objEditor.entityMap;\n\n if (Object.keys(arrayObjImage).length != 0) {\n\n let images = arrayObjImage[0].data.src;\n let title = data[index].title;\n\n componentHeadline(images, title);\n\n for (let indexObj = 0; indexObj < objBlockEditor; indexObj++) {\n let textEditor = objEditor.blocks[indexObj].text;\n\n if (textEditor != \"\" && textEditor != \" \") {\n let content = objEditor.blocks[indexObj].text;\n let date_publish = new Date(dateEditor);\n\n year = date_publish.getFullYear();\n month = date_publish.getMonth() + 1;\n dt = date_publish.getDate();\n\n if (dt < 10) {\n dt = '0' + dt;\n }\n if (month < 10) {\n month = '0' + month;\n }\n date_publish = month + \" \" + dt + \" \" + year;\n\n componentContent(name_author_id, name_author, date_publish, content);\n }\n }\n }\n }\n }).catch(function (error) {\n console.log(error, \"Fetching API error\");\n });\n}", "function extractRepositories(html){\n let selectorTool= cheerio.load(html);\n let RepoLinkArr= selectorTool(`.d-flex.flex-justify-between.my-3 .text-bold`); // get all Links\n\n let TopicName= selectorTool(\".h1-mktg\").text();\n TopicName=TopicName.trim();\n console.log(TopicName);\n\n dirCreator(TopicName); // Func to create Directory for each Topics \n \n for(let i=0;i<8;i++){\n let link=selectorTool(RepoLinkArr[i]).attr('href');\n let fullLink=homeUrl+link;\n // Repo-Name will be at the end of the link- fullLink\n let repoName= fullLink.split('/').pop();\n repoName=repoName.trim();\n\n createFile(repoName,TopicName); // Create Repo-File\n \n let fullRepoLink= fullLink+\"/issues\"; // Directly getting Issues-Link\n getIssues(fullRepoLink,repoName,TopicName);\n }\n}", "static async pullData(input) {\n\n const params = new URLSearchParams();\n params.append('method', 'GET');\n params.append('api_key', configPackage.apiKey);\n params.append('format', 'json');\n\n if (input != '') params.append('q', input);\n const response = await fetch((input == '' ? configPackage.trendingUrl : configPackage.url) + params);\n const result = await response.json();\n return result.data;\n }", "function getReleaseData() {\n\t\tconst newReleaseURL = `${newReleaseOptions.api}${newReleaseOptions.endpoint}?api_key=${newReleaseOptions.key}&format=${newReleaseOptions.format}&limit=${newReleaseOptions.limit}&sort=${newReleaseOptions.sort}&filter=expected_release_year:${newReleaseOptions.filterYear},expected_release_month:${newReleaseOptions.filterMonth}`;\n\n\t\tfetch('https://cors-anywhere.herokuapp.com/' + newReleaseURL)\n\t\t\t.then((response) => response.json())\n\t\t\t.then((response) => {\n\t\t\t\tsetReleaseData(response.results);\n\t\t\t})\n\t\t\t.catch(alert.error);\n\t}", "function getUrl() {\n var url = \"https://raw.githubusercontent.com/radytrainer/test-api/master/test.json\";\n return url;\n}", "function getRepos(username){\n return axios.get(\n 'https://api.github.com/users/' + username + '/repos' + param + '&per_page=100'\n );\n}", "function gatherResearchPapers(callback){\r\n $.getJSON(GITHUB_RESEARCH, function(data){\r\n \r\n research = data.filter(function(item){\r\n if (item.name != \"readme.json\"){\r\n return item;\r\n }\r\n });\r\n $.getJSON(GITHUB_RESEARCH_INFO, function(data){\r\n research_description = data;\r\n return callback();\r\n })\r\n });\r\n}", "async function fetchUser(username) { \n const response = await fetch('https://api.github.com/users/' + username); \n const userData = await response.json(); \n console.log(userData); \n return userData; }", "getData(cb){\n\t\tlet promArray = [];\n\t\tthis.allUserNames.map((userName)=>{\n\t\t\tpromArray.push(fetch(`https://api.github.com/users/${userName}`).then(res=>res.json()))\n\t\t})\n\n\t\tPromise.all(promArray)\n\t\t\t.then(data => {\n\t\t \t\t// do something with the data\n\t\t \t\t cb(data);\n\t\t\t})\n\n\t}", "async function getUserData(){\n\ntry{\n\t\tconst data = await fetch(\"https://api.github.com/users/yagovaluchedevs\")\n\t\tconst response = await data.json();\n\tconsole.log(response);\n\n\tconst image = document.createElement(\"img\");\n\t\timage.src = response.avatar_url;\n\t\timage.style.width = \"250px\";\n\t\timage.style.borderRadius = \"100%\";\n\n\t\tcontainerRoot.appendChild(image);\n\n\tconst bioGit = document.createElement(\"p\");\n\t\tbioGit.innerText = response.bio;\n\t\tbioGit.style.fontSize = \"20px\";\n\t\tcontainerRoot.appendChild(bioGit);\n\n\tconst locationUser = document.createElement(\"h2\");\n\t\tlocationUser.innerText = response.location;\n\t\tcontainerRoot.appendChild(locationUser);\n\n\tconst followersUser = document.createElement(\"h3\");\n\t\tfollowersUser.innerText = `Followers: ${response.followers}`;\n\t\tcontainerRoot.appendChild(followersUser);\n\n\tconst followingUser = document.createElement(\"h3\");\n\t\tfollowingUser.innerText = `Following: ${response.following}`;\n\t\tcontainerRoot.appendChild(followingUser);\n\n\n\tconst link = document.createElement(\"a\");\n\t\tlink.innerText = \"link\";\n\n\t\tlink.setAttribute(\"href\",`${response.html_url}`);\n\t\tlink.setAttribute(\"target\",\"_blank\");\n\t\t\n\n\t\tcontainerRoot.appendChild(link);\n\n\t}catch(error){\n\t\tconsole.log(`Meu erro: ${error}`);\n\t}\n\n\n\n\n}", "async function displayDataCommits() {\n try {\n const user = await getUser(1);\n const repos = await getRepositories(user.gitHubUsername);\n console.log(repos);\n } catch (err) {\n console.log(err.message);\n }\n}", "fetchContributors() {\n return Util.fetchJSON(this.data.contributors_url);\n }", "function getPRInfo(body) {\n var prBody = body['pull_request'];\n var number = prBody.number;\n var name = prBody.head.repo.name;\n\n return {\n number: number,\n name: name\n };\n}", "function webScrape(username){\n\n return new Promise(resolve => {\n let data = []\n request('https://github.com/' + username, function (error, response, html) {\n if (!error && response.statusCode == 200) {\n var $ = cheerio.load(html);\n //Grabs information on user's contributions from their github page\n $('div.js-calendar-graph > svg > g > g > rect').each(function(i, element){\n const contributions = $(this).attr('data-count');\n const dataDate = $(this).attr('data-date');\n let object = {\n contribution: contributions,\n dataDate: dataDate\n };\n data.push(object)\n })\n resolve(data)\n }\n })\n })\n}", "function getWikiInfo(query){\n const cors = `https://cors-anywhere.herokuapp.com/`\n const wiki = `https://en.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&exintro=&explaintext=&redirects=1&titles=${query}`\n const wikiUrl = `${cors}${wiki}`\n fetch(wikiUrl)\n .then(response => {\n console.log(response)\n if (response.ok) {\n return response.json();\n }\n throw new Error(response.statusText);\n })\n .then(responseJson => displayWikiResults(responseJson))\n .catch(err => {\n $('#err').text(`Something went wrong: ${err.message}`);\n });\n}", "function paginatedUserRepoUris(pagInfoFromHeader) {\n const regex = /(https:\\/\\/api\\.github\\.com\\/user\\/([0-9]+)\\/repos\\?page\\=)([0-9]+)\\>; rel\\=\"last\"/gm;\n const matches = regex.exec(pagInfoFromHeader);\n const numPages = parseInt(matches[3])\n const array1 = range(numPages)\n const array2 = array1.map(x => x + 1)\n const array3 = array2.map(page => '' + matches[1] + page);\n const res = array3.map(uri => uri.replace(\"https://api.github.com\", GITHUB_API_HOST))\n // console.log(res);\n return res\n}", "async function printCommentData() {\n try {\n // GET commit comments and store user names\n const commitsUsers = await http\n .get(`/repos/${repo}/comments?per_page=100`)\n .then(res => {\n // create an array to store the login\n let users = new Array()\n // loop over each comment and add login name to users Array\n res.data.forEach(function(comment) {\n users.push(comment.user.login)\n })\n // count number of comments user made on all of the repo\n return users\n })\n\n // GET issues comments and store user names\n const issuesUsers = await http\n .get(`/repos/${repo}/issues/comments?per_page=100`)\n .then(res => {\n // create an array to store the login\n let users = new Array()\n // loop over each comment and add login name to users Array\n res.data.forEach(function(comment) {\n users.push(comment.user.login)\n })\n // count number of comments user made on all of the repo\n return users\n })\n\n // GET pull request comments and store user names\n const pullsUsers = await http\n .get(`/repos/${repo}/pulls/comments?per_page=100`)\n .then(res => {\n // create an array to store the login\n let users = new Array()\n // loop over each comment and add login name to users Array\n res.data.forEach(function(comment) {\n users.push(comment.user.login)\n })\n // count number of comments user made on all of the repo\n return users\n })\n\n // comments array with all of the instances a name shows up from comments\n const comments = commitsUsers.concat(issuesUsers, pullsUsers)\n\n // GET number contributors and store as object in an array called stats\n // GET /repos/:owner/:repo/stats/contributors\n const stats = await http\n .get(`/repos/${repo}/stats/contributors`)\n .then(res => {\n let users = new Array()\n res.data.forEach(function(contributor) {\n // define a user object to go into the users array\n let user = {\n name: contributor.author.login,\n totalCommits: Number(contributor.total),\n totalComments: null,\n }\n users.push(user)\n })\n // Sort users object by number of commits\n users.sort(function(a, b) {\n return parseFloat(b.totalCommits) - parseFloat(a.totalCommits)\n })\n // return users array of user objects to be saved as const stats\n return users\n })\n\n // loop over the comments and compare to users to determine totalComments\n for (let user of stats) {\n user.totalComments = countInArray(comments, user.name)\n console.log(\n `${leftPad(user.totalCommits, 4)} comments, ${user.name}`,\n `(${user.totalComments} commits)`,\n )\n }\n } catch (err) {\n console.error(chalk.red(err))\n console.dir(err.response.data, { colors: true, depth: 4 })\n }\n}", "getAll() {\n return fetch(API_URL + '?api-key=' + API_KEY + '&show-fields=trailText,thumbnail')\n .then(response => response.json())\n .then(res => res.response && res.response.results)\n }", "function getData(){\r\n return fetch('https://soroushf79.github.io/TechAssistTesting/data.json') // Hosted the updated new data on here\r\n .then(function(response) {\r\n if (!response.ok){\r\n throw Error(response.statusText);\r\n }\r\n console.log(\"Bueno\");\r\n return response.json();\r\n })\r\n .catch(function(error) {\r\n console.log(\"No bueno\");\r\n });\r\n }", "function getUserInfo(username){\n return axios.get('https://api.github.com/users/' + username);\n}", "function makeTheCall(userName){\n\n fetch(gitHubURL + userName +\"/repos\")\n .then(response => response.json())\n .then(responseJson => listOnlyName(responseJson)); \n}", "function getCongressExtract() {\n fetch(wikiEndpointExtract + congressPerson + \"?redirect=true\")\n .then(function (responseExtract) {\n return responseExtract.json();\n })\n .then(function (responseExtract) {\n console.log(\"testing\");\n console.log(responseExtract);\n //returns summary of wiki page\n congressExtract = responseExtract.extract;\n //gives url link to official photo\n congressPic = responseExtract.originalimage.source;\n //Gives state/title if they have one (ex. senate majority leader, etc)\n $(\"#rep-bio\").text(congressExtract);\n $(\"#modal-image\").attr(\"src\", congressPic);\n });\n }", "async function getUserRepositories(url) {\n let fURL = url + \"/repos\";\n try {\n let response = await fetch(fURL);\n\n if (response.status >= 400) {\n showError(`Request (Repo) failed with error ${response.status}`)\n return Promise.reject(`Request failed with error ${response.status}`)\n }\n return response.json();\n } catch (e) {\n console.log(e);\n }\n}", "function getUser(user) {\n const endpoint = `https://api.github.com/users/${user}/repos`;\n fetch(endpoint)\n .then(response => response.json())\n .then(responseJson => displayRepos(responseJson))\n .catch(error => console.log(error));\n}", "async function fetch_data_for_single_user(handle,repo,fullname){\n str = \"https://api.github.com/users/\" + handle + \"/events?per_page=100&access_token=\" + auth_token\n console.log(str)\n const response = await fetch(str);\n const myJson = await response.json();\n console.log(myJson)\n add_table_row(handle, myJson,repo,fullname)\n \n}", "fetchData() {\n const url = 'http://data.unhcr.org/api/population/regions.json';\n return fetch(url, {\n method: 'GET',\n })\n .then((resp) => resp.json())\n .then((json) => this.parseRefugeeData(json))\n .catch((error) => Notification.logError(error, 'RefugeeCampMap.fetchData'));\n }", "async function getData() {\n try {\n const res2 = await fetch(\"https://api.covid19api.com/summary\");\n const resSummary = await res2.json();\n const restCoun = await fetch(\"https://restcountries.eu/rest/v2/lang/ar\");\n const restArabicCountry = await restCoun.json();\n return { resSummary, restArabicCountry }\n } catch (err) {\n console.log(err + \"Summary error\");\n }\n}", "function fetchData () {\n return fetch(`${config.API_URL}`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': 'Bearer ComicClanVettIO2019'}}) \n}", "function getRepoContributors(repoOwner, repoName, cb) {\n var requestURL = 'https://'+ GITHUB_USER + ':' + GITHUB_TOKEN + '@api.github.com/repos/' + repoOwner + '/' + repoName + '/contributors';\n var requestOptions = {\n url: requestURL,\n headers: {\n 'User-Agent' : 'VidushanK'\n }\n };\n// request options and parse the body and output the avatar_url and invoke DownloadImageByURL function to create the images\n request.get(requestOptions,function(err, result, body){\n\n if (!err && result.statusCode === 200) {\n var parsedData = JSON.parse(body);\n parsedData.forEach(function (releaseObject) {\n var dir = \"./avatars/\"\n var loginFileName = dir + releaseObject.login + \".jpg\";\n console.log(releaseObject.avatar_url);\n downloadImageByURL(releaseObject.avatar_url, loginFileName);\n });\n }\n });\n\n}", "async function callApi() {\n let j = 1;\n //--starting with 2 pages of 30 entries--//\n for (j = 1; j <= 3; j++) {\n let ans;\n\n try {\n let repoSearchURL =\n \"https://api.github.com/search/repositories?q=\" +\n projkey +\n \"&page=\" +\n j;\n if (j === 1) {\n ans = await axios.get(repoSearchURL);\n } else {\n let pager = repoSearchURL + \"; rel='next'\";\n ans = await axios.get(pager);\n }\n repoIterate(ans);\n } catch (error) {\n console.log(error);\n }\n }\n console.log(logRepos);\n}", "function getApiInfo () {\n fetch('https://randomuser.me/api/')\n .then( res => res.json() )\n .then( data => fillInInfo(data))\n}", "getUsersGitHub() {\n fetch('https://api.github.com/users/FerdinandObermeier')\n .then(res => \n res.json().then(data => {\n this.setState({gitHubUser: data});\n fetch(this.state.gitHubUser.repos_url).then(res => res.json().then(data => {\n this.setState({userReposDefault: data, userRepos: data});\n }));\n }));\n }", "function ct_importprofile() {\n fetch('https://hastebin.com/raw/mojohavode') // testing json\n .then(response => response.json())\n .then(data => console.log(data))\n}", "function getRepos() {\n var username = 'kevinstock';\n \n\tvar request = {access_token: '8a5baccc4a904b12e75a447bd35803bc3358101b'};\n\t\n\tvar result = $.ajax({\n\t\turl: 'http://api.github.com/users/' + username + '/repos',\n\t\tdata: request,\n\t\tdataType: 'jsonp',\n\t\ttype: 'GET',\t\n\t})\n\t.done(function(result) {\n\t\t\n\t\t// get each repo object\n\t\t$.each(result.data, function(i, repo) {\n \t\t\n \t\t// check for repo name matches on the filter list\n \t\tvar matches = 0;\n for (var j = 0; j < repoFilter.length; j++) {\n if (repo.name == repoFilter[j]) {\n matches++; }\n }\n \n // if repo is not on the filter list then create the repo HTML\n if (matches == 0) {\n \n createRepos(repo);\n }\n\t\t})\n\t\t\n\t})\n\t.fail(function(jqXHR, error, errorThrown) {\n\t\t$('.error').append(error);\n\t});\n}", "function getRepos(callback) {\n if (ns.repoData.length > 0){\n callback(ns.repoData);\n return;\n }\n $.ajax({\n type: 'GET',\n url: 'https://api.github.com/user/repos',\n dataType: 'json',\n headers: {\n Authorization: \"token \" + ns.userToken\n },\n success: function (data){\n ns.repoData = data;\n console.log(data);\n callback(ns.repoData);\n },\n error: function (){\n callback(null);\n }\n });\n }", "function getParks(states, maxResults) {\n console.log('getParks ran');\n //Initiate endPoint variable\n const endPoint = `https://api.nps.gov/api/v1/parks`\n //pass user's parameters to form query string\n const queryString = formatQueryParams(states, maxResults)\n //Combine endPoint and queryString to form url to pull data from\n const url = endPoint + '?' + queryString + '&fields=addresses'\n console.log(url);\n\n const options = {\n headers: new Headers({\n \"X-Api-Key\": apiKey})\n };\n //Asynchronous request to GitHub API\n fetch(url)\n //if repsonse is good, returns results in JSON format\n .then(response => {\n if (response.ok) {\n return response.json();\n }\n //if reponse is not ok,then throw an error\n throw new Error(response.statusText);\n })\n //if reponse is ok, then we pass the JSON results into displayResults to be rendered in DOM\n .then(responseJson => displayResults(responseJson))\n //if reponse is not ok, then the error we threw will be passed as a parameter in the displayError function and rendered in DOM\n .catch(err => {\n displayError(err.message);\n });\n}", "function getUserInfo(username) {\n return axios.get('https://api.github.com/users/' + username);\n}", "function getUserRepos(uri, repos) {\n return request({\n \"method\": \"GET\",\n \"uri\": uri,\n \"json\": true,\n \"resolveWithFullResponse\": true,\n \"headers\": {\n \"User-Agent\": \"sbolande\"\n }\n }).then(function (response) {\n /* If the arrat repos doesn't exist (the first time the call is made), create it */\n if (!repos) {\n repos = [];\n }\n /* For each repo, it will push a json object with the name, clone url, if there are open issues, and url in github */\n response.body.forEach(repo => {\n repos.push({\n name: repo.name,\n clone_url: repo.clone_url,\n open_issues: repo.open_issues,\n url: repo.html_url\n });\n cloneUrls.push(`'${repo.clone_url}'`);\n });\n console.log(repos.length + \" repos so far\");\n /* Checks the response header to see if there are more calls to be made (if there are more repos) since it willonly grab 100 per call */\n if (response.headers.link.split(\",\").filter(function (link) { return link.match(/rel=\"next\"/) }).length > 0) {\n var next = new RegExp(/<(.*)>/).exec(response.headers.link.split(\",\").filter(function (link) { return link.match(/rel=\"next\"/) })[0])[1];\n return getUserRepos(next, repos);\n }\n writeToCsv(repos);\n writeCloneUrlsToJson(cloneUrls);\n return repos;\n });\n}", "function getData(){\n fetch(url)\n .then(function(response) {\n return response.json();\n })\n .then(function(myJSON) {\n var spaceObj = JSON.stringify(myJson.near_earth_objects);\n id = myJSON.near_earth_objects.id;\n name = myJSON.near_earth_objects.name;\n console.log(name);\n\n });\n \n }", "function gitFetch(user, repo, index, callback) {\n let url = `https://api.github.com/repos/${user}/${repo}`;\n fetch(url).then(function(response) {\n return response.json();\n }).then(function(data) {\n callback(data, repo, index);\n })\n}", "function peiticionLibro(title){\n title = title.replace(/\\s/g,\"+\");\n //console.log(title);\n request.get(`http://openlibrary.org/search.json?q=/${title}/`,(err,response,body) =>{\n //console.log(err);\n //console.log(response.statusCode);\n const json = JSON.parse(body);\n console.log(json.docs[0].title);\n console.log('Authors');\n json.docs[0].author_name.forEach(element => console.log(element));\n\n });\n }", "async function consumiendo(user){\n const api = \"https://api.github.com\"\n const response = await fetch(api + \"/users/\"+user)\n const data = await response.json\n return data\n}", "function fetchFeed() {\n\t// get a new date\n\tconst today = new Date()\n\n\treturn fetch(API +`?start_date=${formatDate(today)}&api_key=${API_KEY}`)\n\n\t// the code below is the single line short hand for writing this:\n\t.then((res) => {\n\t\tconsole.log(res);\n\t\treturn res.json()\n\t})\n\t// .then((res) => res.json())\n\t.then((res) => res.near_earth_objects)\n}", "function getRepoContributors(repoOwner, repoName, cb) {\n\n var options = {\n url: \"https://api.github.com/repos/\" + repoOwner + \"/\" + repoName + \"/contributors\",\n headers: {\n 'User-Agent': 'request',\n 'Authorization' : 'token ' + token.GITHUB_TOKEN\n }\n };\n // parses the body into a readable JSON format\n request(options, function(err, res, body) {\n var data = JSON.parse(body);\n console.log(typeof(data));\n cb(err, data);\n });\n}", "function getJSON(url, callback) {\n let request = new XMLHttpRequest();\n request.open('GET', url, true);\n\n request.onload = function() {\n if (this.status >= 200 && this.status < 400) {\n callback(JSON.parse(this.response));\n } else {\n conosle.log(\"GitHub Cards Update error: \" + this.response);\n }\n };\n\n request.onerror = function() {\n console.log(\"GitHub Cards could not connect to Github!\");\n };\n\n request.send()\n }", "function repoInfo(data) {\r\n const leftContainer = document.getElementById('leftContainer');\r\n leftContainer.innerHTML = '';\r\n\r\n const ul = createAndAppend('ul', leftContainer, {\r\n id: 'ulLeftContr'\r\n });\r\n\r\n fetchJSON(data)\r\n .then(data => {\r\n createAndAppend('li', ul, {\r\n html: 'Name : ' + \"<a href=\" + data.html_url + ' target=\"_blank\" >' + data.name + \"</a>\",\r\n });\r\n createAndAppend('li', ul, {\r\n html: 'Description : ' + data.description\r\n });\r\n createAndAppend('li', ul, {\r\n html: 'Forks : ' + data.forks\r\n });\r\n createAndAppend('li', ul, {\r\n html: 'Updated : ' + data.updated_at\r\n });\r\n })\r\n .catch(error => {\r\n console.log(error.message);\r\n });\r\n}" ]
[ "0.70566154", "0.68153846", "0.67723554", "0.662757", "0.66255426", "0.66205907", "0.66160524", "0.661236", "0.65927804", "0.65598136", "0.6531574", "0.65167135", "0.65033126", "0.64917696", "0.648345", "0.64240247", "0.64116985", "0.63572", "0.63380253", "0.6311581", "0.6295366", "0.6282668", "0.62210625", "0.6161826", "0.6137198", "0.6136266", "0.61242723", "0.61051947", "0.6099859", "0.6096701", "0.6090298", "0.6056681", "0.60537124", "0.60530967", "0.60472786", "0.60456616", "0.6044765", "0.60434353", "0.60434353", "0.6019364", "0.6004264", "0.60018283", "0.59841967", "0.597402", "0.5966034", "0.5962565", "0.59472656", "0.5940559", "0.5932239", "0.5927387", "0.592034", "0.5919906", "0.5914354", "0.5895983", "0.5875431", "0.5868935", "0.58666533", "0.5848762", "0.5838824", "0.5837654", "0.58311605", "0.5830777", "0.58226985", "0.5809327", "0.58029103", "0.5790799", "0.57759696", "0.57741004", "0.57708615", "0.57612544", "0.5760745", "0.5757788", "0.57502717", "0.574318", "0.5742645", "0.5739514", "0.5730996", "0.57305145", "0.5721742", "0.57153434", "0.57148635", "0.5711691", "0.57036763", "0.5703027", "0.57016337", "0.56981397", "0.5691455", "0.5690859", "0.5682208", "0.56815827", "0.56621104", "0.5661323", "0.56603914", "0.56597435", "0.5659198", "0.56578237", "0.5651948", "0.5644735", "0.5635849", "0.5632146", "0.56258667" ]
0.0
-1
A light source. This type describes an interface and is not intended to be instantiated directly. Together, color and intensity produce a highdynamicrange light color. intensity can also be used individually to dim or brighten the light without changing the hue.
function Light() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LightSource(x, y, intensity, color, timing, startrad, radlen) {\r\n this.x = x;\r\n this.y = y;\r\n this.intensity = intensity;\r\n this.timing = 0;\r\n if (timing) {\r\n this.timing = timing;\r\n }\r\n this.color = {r: 255, g: 255, b: 255};\r\n if (color)\r\n {\r\n this.color = color;\r\n }\r\n this.startrad = 0;\r\n this.radlen = 2 * Math.PI;\r\n if (startrad && radlen) {\r\n this.startrad = startrad;\r\n this.radlen = radlen;\r\n }\r\n}", "function Light( structure ){\n\t\n\t/**\n * Light name\n */\n\tthis.name = structure[\"name\"];\n\t\n\t/**\n * Light position [x, y, z]\n */\n\tthis.position = structure[\"position\"];\n\t\n\t/**\n * Lights diffuse color\n */\n\tthis.diffuseColor = structure[\"diffuse_color\"];\n\t\n\t/**\n * Intensity inhibition\n */\n\tthis.coeficients = structure[\"coeficients\"];\n\t\n\t/**\n * Maximal range that is affected by light\n */\n\tthis.maxRange = structure[\"max_range\"];\n}", "function LightSource(primitives, type, args) {\r\n this.primitives = primitives;\r\n this.type = type; // 0 : point light source\r\n this.args = args;\r\n}", "function Light(_ref) {\n var _ref$color = _ref.color,\n color = _ref$color === undefined ? new _Color.Color({ r: 0, b: 0, g: 0 }) : _ref$color,\n _ref$position = _ref.position,\n position = _ref$position === undefined ? new _Point3D.Point3D(0, 0, 0) : _ref$position;\n\n _classCallCheck(this, Light);\n\n this.__color = color;\n this.__position = position;\n }", "function Light() {\n\t\tvar light = new pc.Entity();\n\t\tlight.setPosition(10, 10, 10);\n\t\tlight.setEulerAngles(45, 45, 0);\n\t\tlight.addComponent('light', {\n\t\t\ttype: \"spot\",\n\t\t\tintensity: 1.5,\n\t\t\tcastShadows: true,\n\t\t\trange: 40\n \t});\n \tlight.light.shadowResolution = 2048;\n \tlight.light.shadowDistance = 8;\n \tlight.light.shadowBias = 0.005;\n \tlight.light.normalOffsetBias = 0.01;\n \tapp.root.addChild(light);\n \tthis.entity = light;\n }", "function Light(name,scene){var _this=_super.call(this,name,scene)||this;_this.diffuse=new BABYLON.Color3(1.0,1.0,1.0);_this.specular=new BABYLON.Color3(1.0,1.0,1.0);_this.intensity=1.0;_this.range=Number.MAX_VALUE;/**\n * Cached photometric scale default to 1.0 as the automatic intensity mode defaults to 1.0 for every type\n * of light.\n */_this._photometricScale=1.0;_this._intensityMode=Light.INTENSITYMODE_AUTOMATIC;_this._radius=0.00001;_this._excludeWithLayerMask=0;_this._includeOnlyWithLayerMask=0;_this._lightmapMode=0;_this._excludedMeshesIds=new Array();_this._includedOnlyMeshesIds=new Array();_this.getScene().addLight(_this);_this._uniformBuffer=new BABYLON.UniformBuffer(_this.getScene().getEngine());_this._buildUniformLayout();_this.includedOnlyMeshes=new Array();_this.excludedMeshes=new Array();_this._resyncMeshes();return _this;}", "function LogicNodeLightComponent() {\n\t\tLogicNode.call(this);\n\t\tthis.logicInterface = LogicNodeLightComponent.logicInterface;\n\t\tthis.type = 'LightComponent';\n\t}", "function Lighting() {\n\n // Set the frame rate of all changes\n this.durationBetweenFrames = 1000 / 60\n\n // Exposure settings\n this.exposureSpeedChange = 0.02\n this.exposureTimer = null\n\n // The zones the user is currently inside of\n this.zones = []\n\n}", "function addLight(source, xpos, ypos, zpos) {\n var light = source;\n light.position.x = xpos;\n light.position.y = ypos;\n light.position.z = zpos;\n scene.add(light);\n }", "function lightDiffuse() {\n return lightIntensity.multiply(k_d).multiply(dotLN)\n }", "function Light({ x, y, xv, yv, color, radius }) {\n this.x = x;\n this.y = y;\n this.xv = xv;\n this.yv = yv;\n this.radius = radius;\n this.color = color;\n\n //makes sure the gradient displays its position accurately\n this.resetGradient = () => {\n this.radialGradient = context.createRadialGradient(\n this.x,\n this.y,\n 0,\n this.x,\n this.y,\n this.radius\n );\n this.radialGradient.addColorStop(\n 0.0,\n `rgba(${color[0]}, ${color[1]}, ${color[2]}, 0.5)`\n );\n this.radialGradient.addColorStop(\n 1.0,\n `rgba(${color[0]}, ${color[1]}, ${color[2]}, 0)`\n );\n };\n\n //draws the object at its current x and y position\n this.draw = () => {\n context.beginPath();\n context.arc(this.x, this.y, this.radius, 0, 2 * Math.PI);\n context.fillStyle = this.radialGradient;\n context.fill();\n };\n\n //changes the x and y position of the object\n this.update = () => {\n if (this.x >= WIDTH || this.x <= 0) {\n this.xv = -this.xv;\n }\n if (this.y >= HEIGHT || this.y <= 0) {\n this.yv = -this.yv;\n }\n this.x += this.xv;\n this.y += this.yv;\n\n this.resetGradient();\n this.draw();\n };\n }", "function light(position, properties){\r\n \r\n // create light\r\n let light;\r\n light = new THREE.PointLight( properties.color, properties.intensity, properties.distance );\r\n // positioning the light\r\n light.position.set( position.x, position.y, position.z );\r\n\r\n return light;\r\n\r\n}", "createLight()\n {\n const light = new THREE.PointLight(0xff4200, this.maxIntensity, 30)\n light.position.y = 2.8\n if(this.onWall)\n {\n light.position.z = 2\n }\n this.threeObject.add(light)\n\n return light\n }", "function addLight( h, s, l, x, y, z, scene ) {\n\n var light = new THREE.PointLight( 0xffffff, 1.5, 4500 );\n light.color.setHSL( h, s, l );\n light.position.set( x, y, z );\n scene.add( light );\n\n var flareColor = new THREE.Color( 0xffffff );\n flareColor.setHSL( h, s, l + 0.5 );\n\n var lensFlare = new THREE.LensFlare( textureFlare0, 700, 0.0, THREE.AdditiveBlending, flareColor );\n\n lensFlare.add( textureFlare2, 512, 0.0, THREE.AdditiveBlending );\n lensFlare.add( textureFlare2, 512, 0.0, THREE.AdditiveBlending );\n lensFlare.add( textureFlare2, 512, 0.0, THREE.AdditiveBlending );\n\n lensFlare.add( textureFlare3, 60, 0.6, THREE.AdditiveBlending );\n lensFlare.add( textureFlare3, 70, 0.7, THREE.AdditiveBlending );\n lensFlare.add( textureFlare3, 120, 0.9, THREE.AdditiveBlending );\n lensFlare.add( textureFlare3, 70, 1.0, THREE.AdditiveBlending );\n\n lensFlare.customUpdateCallback = lensFlareUpdateCallback;\n lensFlare.position = light.position;\n\n scene.add( lensFlare );\n }", "function LightEmitting(lightlevel) {\n\tthis.light = lightlevel;\n\tthis.ignite = function() {\n\t this.setLight(lightlevel);\n\t}\n\tthis.extinguish = function() {\n this.setLight(0);\n\t}\n\tthis.setLight = function(light) {\n\t if (this.light !== 0) {\n\t this.getHomeMap().removeMapLight(this.getSerial(), this.light, this.getx(), this.gety());\n\t }\n\t if (light !== 0) {\n\t this.getHomeMap().setMapLight(this,light,this.getx(),this.gety());\n\t }\n \n if (this.getHomeMap() === PC.getHomeMap()) {\n DrawMainFrame(\"draw\", PC.getHomeMap(), PC.getx(), PC.gety());\n }\n\t this.light = light;\n\t}\n\tthis.getLight = function() {\n\t if (parseFloat(this.light) === \"NaN\") { alert(this.getName() + \" has lightlevel that is NaN.\"); }\n\t\treturn parseFloat(this.light);\n\t}\n}", "static impactLight()\n\t\t{\n\t\t\tthis.impact(ImpactFeedbackStyle.Light);\n\t\t}", "function new_light (r, g, b, x, y, z) {\r\n append(lights, new Light(r, g, b, x, y, z));\r\n}", "function handleSetLight(data) {\n var parsedData = JSON.parse(data);\n console.log(\"Light intensity: \" + parsedData.intensity);\n setLight(parsedData.intensity)\n}", "function Light(props) {\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\tclassName={`rounded-circle p-5`}\n\t\t\t\tstyle={{\n\t\t\t\t\tbackgroundColor: props.color,\n\t\t\t\t\topacity: props.active ? 1 : 0.4\n\t\t\t\t}}\n\t\t\t\tvalue={props.active}\n\t\t\t\tonClick={props.func}></div>\n\t\t</>\n\t);\n}", "function makeLight(brightness, radius, coordinates, oscillator, coreRadius, diffusion, framesBetweenMovements, movementDirection, directionChangeChance, deathChance, allCellsList, lightsArray) {\n var light = {\n 'brightness': brightness,\n 'radius': radius,\n 'coreRadius': coreRadius,\n 'diffusion': diffusion,\n 'oscillator': oscillator,\n 'deathChance': deathChance,\n 'parentCellsArray': allCellsList, // large cellsList of which light's cell is a part\n 'entityParentArray': lightsArray, // lights array\n 'coordinates': coordinates,\n 'framesBetweenMovements': framesBetweenMovements,\n 'movementDirection': movementDirection, // 0-7 because it got weirdly broken to try to use the allDirecitons array\n 'directionChangeChance': directionChangeChance,\n 'cell': allCellsList[coordinatesToIndex(coordinates)],\n 'cellIndex': coordinatesToIndex(coordinates),\n 'entityType': 'light',\n 'personality': settings.lightPersonalities[5]/*\n (arrayOfRandomNumbers[randomNumberIndex] * (settings.lightPersonalities.length - 1)) -\n (arrayOfRandomNumbers[randomNumberIndex] * (settings.lightPersonalities.length - 1)) % 1\n ]*/\n };\n if (randomNumberIndex < arrayOfRandomNumbers.length) randomNumberIndex++;\n else randomNumberIndex = 0;\n return light;\n}", "function Lights() {\n /**\n * Holds the scene lights.\n * @type {Array.<!Light>}\n * @private\n */\n this.lights_ = new Array();\n}", "function loadAllLights(){\n\tvar fullLight = {\n\t\t'type' : '', // (AmbientLight, PointLight, DirectionalLight, HemisphereLight, SpotLight)\n\t\t'color' : '', // Needed: AmbientLight Optional: PointLight, SpotLight, DirectionalLight, SpotLight\n\t\t'intensity' : '', // Needed: AmbientLight Optional: PointLight, SpotLight, DirectionalLight, HemisphereLight, SpotLight\n\t\t'distance' : '', // Needed: PointLight, SpotLight\n\t\t'angle' : '', // Needed: SpotLight\n\t\t'penumbra' : 0.5, // Needed: SpotLight (0-1)\n\t\t'decay' : '', // Needed: PointLight, SpotLight\n\t\t'size' : '', // Needed: HemisphereLight Optional: PointLight, DirectionalLight\n\t\t'position' : { // Needed: PointLight, DirectionalLight, SpotLight\n\t\t\t'x' : 10.0,\n\t\t\t'y' : 15.0,\n\t\t\t'z' : 1\n\t\t},\n\t\t'target' : { // Needed: DirectionalLight\n\t\t\t'x' : 10.0,\n\t\t\t'y' : 15.0,\n\t\t\t'z' : 1\n\t\t},\n\t\t'showLight' : { // what is this?\n\t\t\t'size': 1,\n\t\t\t'color' : 0x404040\n\t\t},\n\t\t'skyColor' : 0xffffbb, // Optional: HemisphereLight\n\t\t'groundColor' : 0x080820 // Optional: HemisphereLight\n\t};\n\n\tvar AmbientLight = { // works well\n\t\t'type' : 'AmbientLight',\n\t\t'color' : 0xff0000,\n\t\t'intensity' : 2\n\t}\n\n\tvar PointLight = { // works without if statements\n\t\t'type' : 'PointLight',\n 'color' : 0xff0000,\n\t\t'distance' : 50,\n\t\t'decay' : 2,\n 'position' : {\n 'x' : 0,\n 'y' : -20,\n 'z' : 50\n }\n\n\n\t}\n\n\tvar DirectionalLight = {\n\t\t'type' : 'DirectionalLight',\n\t\t'color' : 0xff0000,\n\t\t'intensity' : 5,\n\t\t'size' : 2,\n\t\t'position' : { //why doesn't target work???\n\t\t\t'x' : 0,\n\t\t\t'y' : 100,\n\t\t\t'z' : 0\n\t\t},\n\t\t'target' : {\n\t\t\t'x' : 0,\n\t\t\t'y' : 100,\n\t\t\t'z' : 0\n\t\t}\n\t}\n\tvar HemisphereLight = { // works\n\t\t'type' : 'HemisphereLight',\n\t\t'skyColor' : 0xff0000,\n\t\t'groundColor' : 0x0000FF,\n\t\t'intensity' : 1,\n\t\t'size' : 2\n\t}\n\n\tvar SpotLight = { // needs fix with position\n\t\t'type' : 'SpotLight',\n\t\t'color' : 0xffffff ,\n\t\t'intensity' : 10,\n\t\t'distance' : 200,\n\t\t'position' : {\n\t\t\t'x' : 0,\n\t\t\t'y' : 80,\n\t\t\t'z' : 50\n\t\t},\n\t\t'angle' : Math.PI/4\n\t\t//'position' : { // how do i set position?\n\t\t//\t'x' : 0,\n\t\t//\t'y' : 6,\n\t\t//\t'z' : 1\n\t\t//}\n\t}\n\n\t//---------------------CREATE AND SET LIGHTS HERE------------------\n\tvar PointLight1 = {\n\t\t'type' : 'PointLight',\n\t\t'distance' : 100,\n\t\t'size' : 10,\n 'position' : {\n 'x' : 40,\n 'y' : 20,\n 'z' : 100\n }\n\t}\n\tvar PointLight2 = {\n\t\t'type' : 'PointLight',\n\t\t'distance' : 100,\n\t\t'size' : 10,\n 'position' : {\n 'x' : 40,\n 'y' : 20,\n 'z' : -100\n }\n\t}\n\tvar PointLight3 = {\n\t\t'type' : 'PointLight',\n\t\t'distance' : 100,\n\t\t'size' : 10,\n 'position' : {\n 'x' : -170,\n 'y' : 20,\n 'z' : 100\n }\n\t}\n\tvar PointLight4 = {\n\t\t'type' : 'PointLight',\n\t\t'distance' : 100,\n\t\t'size' : 10,\n 'position' : {\n 'x' : -170,\n 'y' : 20,\n 'z' : -100\n }\n\t}\n\tvar AmbientLight = { // works well\n\t\t'type' : 'AmbientLight',\n\t\t'intensity' : 0.01\n\t}\n\tcreateLight(PointLight1);\n\tcreateLight(PointLight2);\n\tcreateLight(PointLight3);\n\tcreateLight(PointLight4);\n\tcreateLight(AmbientLight);\n}", "function LightType() {}", "function setLight(intensity) {\n // Check if it is within range of 0 to 100\n if (intensity >= 0 && intensity <= 100) {\n let duty_cycle = Math.round(10_000 * intensity);\n led.hardwarePwmWrite(10000, duty_cycle); // 0 to 1_000_000;\n } else led.hardwarePwmWrite(10000, 0); // 0 to 1_000_000;\n}", "function SmartLight (id, controller) {\n\t// Call superconstructor first (AutomationModule)\n\tSmartLight.super_.call(this, id, controller);\n\n\t// by default dimmer button status not pressed\n\tthis.dimmerButtonStatus = 0;\n\n\t// Sensor Enable or Disable\n\tthis.sensorEnable = 1;\n\n\tthis.timerSmartLight = null;\n\n\t// Create instance variables\n\tthis.timerAutoOff = null;\n}", "function lightingSystem()\r\n{\r\n ambLight.intensity = timeLeft/totalTime;\r\n}", "function ambient_light (r, g, b) {\r\n a_red = r;\r\n a_green = g;\r\n a_blue = b;\r\n}", "drawLight(unit){}", "AddLight(light) {\n this._lights.push(light);\n }", "function LightRenderable(myTexture){\n \tSpriteAnimateRenderable.call(this, myTexture);\n \tRenderable.prototype._setShader.call(this, gEngine.DefaultResources.getLightShader());\n\n \tthis.mLights = [];\n }", "function setupLightForObject(gl, wgl, model) {\n var vec = vec3.create(); // Placeholder vector to store outputs of vec3.multiply\n gl.uniform3fv(wgl.uniformLocations.ambientLightColor, \n vec3.multiply(vec, model.ambientReflectivity, wgl.ambientLight));\n gl.uniform3fv(wgl.uniformLocations.diffuseLightColor, \n vec3.multiply(vec, model.diffuseReflectivity, wgl.diffuseLight));\n gl.uniform3fv(wgl.uniformLocations.specularLightColor,\n vec3.multiply(vec, model.specularReflectivity, wgl.specularLight));\n gl.uniform1f(wgl.uniformLocations.shininess, model.shininess);\n}", "function lighting(lightValue) {\n if (lightValue !== 0) {\n lightsaver = lightValue;\n }\n\n // Lighting\n\n if (LED_STATE) {\n newBrightnessRaw = lightValue; // value between 1-100\n newBrightnessScaled = (newBrightnessRaw / 100) * 1024; // scaled value between 10.24 and 1024\n\n if (newBrightnessScaled === oldBrightnessScaled) {\n rpio.pwmSetData(LED_PIN, newBrightnessScaled);\n }\n\n if (newBrightnessScaled > oldBrightnessScaled) {\n for (let i = oldBrightnessScaled; i < newBrightnessScaled; i++) {\n rpio.pwmSetData(LED_PIN, newBrightnessScaled);\n }\n }\n if (newBrightnessScaled < oldBrightnessScaled) {\n for (let i = oldBrightnessScaled; i > newBrightnessScaled; i--) {\n rpio.pwmSetData(LED_PIN, newBrightnessScaled);\n }\n }\n oldBrightnessScaled = newBrightnessScaled;\n }\n}", "function addLight(ambient, diffuse, x, y, z) {\n ambient = typeof ambient !== 'undefined' ? ambient : LIGHT.ambient;\n diffuse = typeof diffuse !== 'undefined' ? diffuse : LIGHT.diffuse;\n x = typeof x !== 'undefined' ? x : LIGHT.xPos;\n y = typeof y !== 'undefined' ? y : LIGHT.yPos;\n z = typeof z !== 'undefined' ? z : LIGHT.zOffset;\n renderer.clear();\n light = new FSS.Light(ambient, diffuse);\n light.ambientHex = light.ambient.format();\n light.diffuseHex = light.diffuse.format();\n light.setPosition(x, y, z);\n scene.add(light);\n LIGHT.diffuse = diffuse;\n LIGHT.proxy = light;\n LIGHT.pickedup = true;\n LIGHT.currIndex++;\n }", "function LightOnCommand(light) {\n this.light = light;\n }", "function addLight(ambient, diffuse, x, y, z) {\n ambient = typeof ambient !== 'undefined' ? ambient : LIGHT.ambient;\n diffuse = typeof diffuse !== 'undefined' ? diffuse : LIGHT.diffuse;\n x = typeof x !== 'undefined' ? x : LIGHT.xPos;\n y = typeof y !== 'undefined' ? y : LIGHT.yPos;\n z = typeof z !== 'undefined' ? z : LIGHT.zOffset;\n\n renderer.clear();\n light = new FSS.Light(ambient, diffuse);\n light.ambientHex = light.ambient.format();\n light.diffuseHex = light.diffuse.format();\n light.setPosition(x, y, z);\n scene.add(light);\n LIGHT.diffuse = diffuse;\n LIGHT.proxy = light;\n LIGHT.pickedup = true;\n LIGHT.currIndex++;\n }", "function calculateColor(light) {\n switch(light.config.state.colormode) {\n case 'xy':\n var cx = light.config.state.xy[0];\n var cy = light.config.state.xy[1];\n if (!inReachOfLamps(light.model, cx, cy)) {\n\n }\n\n // TODO: Patch the brightess to 0.1 < x < 1.0, as brightness 0 is not off\n // We can't do this yet, as the XY conversion is, ahem, less-than-perfect. A simple patching of the range\n // from 0-100% to 10% to 100% results in a very abrupt \"off\" at the bottom end of the range. I suspect\n // that's down to the dodgy conversion from XY. When that's fixed, we can patch the brightness\n var rgb = xyToRgb(cx, cy, light.config.state.bri / 255.0);\n light.color = rgb;\n break;\n\n case 'hs':\n var hsb = {\n hue: light.config.state.hue / 65535.0\n , sat : light.config.state.sat / 255\n , bri : light.config.state.bri / 255\n };\n light.color = hsbToRgb(hsb); // hslToRgb(hsb.hue, hsb.sat, hsb.bri);\n\n break;\n\n\n case 'ct':\n light.color = ctToRgb(light.config.state.ct, light.config.state.bri / 255);\n break;\n }\n\n}", "function addLight(light)\n{\n\tthis.lights.push(light);\n}", "function createLight() {\n // scene.add(new THREE.AmbientLight(0x333333));\n\n // const dLight2 = new THREE.DirectionalLight(0xffffff, 1);\n // dLight2.position.set(5, 3, 5);\n // scene.add(dLight2);\n\n const color = 0xffffff;\n const intensity = 0.75;\n const dLight = new THREE.DirectionalLight(color, intensity);\n dLight.position.set(0, 10, 5);\n dLight.target.position.set(-5, 0, 0);\n scene.add(dLight);\n scene.add(dLight.target);\n\n const intensityHem = 0.55;\n const skyColor = 0xb1e1ff;\n const groundColor = 0xb97a20;\n const hemLight = new THREE.HemisphereLight(\n skyColor,\n groundColor,\n intensityHem\n );\n\n scene.add(dLight);\n scene.add(hemLight);\n}", "function addLight(ambient, diffuse, x, y, z) {\n ambient = typeof ambient !== 'undefined' ? ambient : LIGHT.ambient;\n diffuse = typeof diffuse !== 'undefined' ? diffuse : LIGHT.diffuse;\n x = typeof x !== 'undefined' ? x : LIGHT.xPos;\n y = typeof y !== 'undefined' ? y : LIGHT.yPos;\n z = typeof z !== 'undefined' ? z : LIGHT.zOffset;\n\n renderer.clear();\n var light = new FSS.Light(ambient, diffuse);\n light.ambientHex = light.ambient.format();\n light.diffuseHex = light.diffuse.format();\n light.setPosition(x, y, z);\n scene.add(light);\n LIGHT.diffuse = diffuse;\n LIGHT.proxy = light;\n LIGHT.pickedup = true;\n LIGHT.currIndex++;\n}", "function setLightness(r, g, b, l) {\n var hsl = rgbToHsl(r, g, b)\n hsl.l = clamp(l, 0, 1)\n var {r, g, b} = hslToRgb(hsl.h, hsl.s, hsl.l)\n return {r: Math.round(r), g: Math.round(g), b: Math.round(b)}\n}", "function addLight(h, s, l, x, y, z) {\n console.log('sun added at position: ',x,y,z);\n _sunLight = new THREE.PointLight(0xffffff, 1.5, 4500);\n _sunLight.color.setHSL(h, s, l);\n _sunLight.position.set(x, y, z);\n // _scene.add( _sunLight );\n\n var flareColor = new THREE.Color(0xffffff);\n flareColor.setHSL(h, s, l + 0.5);\n\n _lensFlare = new THREE.LensFlare(textureFlare0, 700, 0.0, THREE.AdditiveBlending, flareColor);\n\n _lensFlare.add(textureFlare2, 512, 0.0, THREE.AdditiveBlending);\n _lensFlare.add(textureFlare2, 512, 0.0, THREE.AdditiveBlending);\n _lensFlare.add(textureFlare2, 512, 0.0, THREE.AdditiveBlending);\n\n _lensFlare.add(textureFlare3, 60, 0.6, THREE.AdditiveBlending);\n _lensFlare.add(textureFlare3, 70, 0.7, THREE.AdditiveBlending);\n _lensFlare.add(textureFlare3, 120, 0.9, THREE.AdditiveBlending);\n _lensFlare.add(textureFlare3, 700, 6.0, THREE.AdditiveBlending);\n\n //lensFlare.customUpdateCallback = lensFlareUpdateCallback;\n _lensFlare.position = _sunLight.position;\n\n _scene.add(_lensFlare);\n\n }", "function Game_Light() { this.initialize.apply(this, arguments); }", "function hsl(hue, saturation, lightness) {\n\t// console.log(hue, saturation, lightness)\n\tif (!lightness)\n\t\treturn off;\n\treturn {\n\t\ton: true,\n\t\thue: cycle(65535, Math.round(hue * 65535 / 360)),\n\t\tsat: clamp(0, 255, Math.round(saturation * 255)),\n\t\tbri: clamp(0, 255, Math.round(lightness * 255))\n\t};\n}", "@route(GET, '/hue/light/:id')\n onGetLightInfo(request, response, light_id) {\n return this.service_.getLightById(light_id).then(light => {\n if (!light)\n throw new Error('Invalid light supplied');\n\n response.end(JSON.stringify({\n id: light.getId(),\n name: light.getName(),\n power: light.hasPower(),\n color: light.getColor(),\n effect: light.getEffect(),\n alert: light.getAlert()\n }));\n });\n }", "update(time) {\n /*light.intensity = (Math.sin(time)+1.5)/1.5;\n light.color.setHSL( Math.sin(time), 0.5, 0.5 );\n */\n }", "function AdaptiveLuminosityMaterial() {\n\t\t\t\t\t\tclassCallCheck(this, AdaptiveLuminosityMaterial);\n\t\t\t\t\t\treturn possibleConstructorReturn(this, (AdaptiveLuminosityMaterial.__proto__ || Object.getPrototypeOf(AdaptiveLuminosityMaterial)).call(this, {\n\n\t\t\t\t\t\t\t\t\ttype: \"AdaptiveLuminosityMaterial\",\n\n\t\t\t\t\t\t\t\t\tdefines: {\n\n\t\t\t\t\t\t\t\t\t\t\t\tMIP_LEVEL_1X1: \"0.0\"\n\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\tuniforms: {\n\n\t\t\t\t\t\t\t\t\t\t\t\ttPreviousLum: new __WEBPACK_IMPORTED_MODULE_0_three__[\"_35\" /* Uniform */](null),\n\t\t\t\t\t\t\t\t\t\t\t\ttCurrentLum: new __WEBPACK_IMPORTED_MODULE_0_three__[\"_35\" /* Uniform */](null),\n\t\t\t\t\t\t\t\t\t\t\t\tminLuminance: new __WEBPACK_IMPORTED_MODULE_0_three__[\"_35\" /* Uniform */](0.01),\n\t\t\t\t\t\t\t\t\t\t\t\tdelta: new __WEBPACK_IMPORTED_MODULE_0_three__[\"_35\" /* Uniform */](0.0),\n\t\t\t\t\t\t\t\t\t\t\t\ttau: new __WEBPACK_IMPORTED_MODULE_0_three__[\"_35\" /* Uniform */](1.0)\n\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\tfragmentShader: fragment,\n\t\t\t\t\t\t\t\t\tvertexShader: vertex,\n\n\t\t\t\t\t\t\t\t\tdepthWrite: false,\n\t\t\t\t\t\t\t\t\tdepthTest: false\n\n\t\t\t\t\t\t}));\n\t\t\t}", "function calculateHSL(){\n\n // get the maximum and range of the RGB component values\n var maximum = Math.max(rgb.r, rgb.g, rgb.b);\n var range = maximum - Math.min(rgb.r, rgb.g, rgb.b);\n\n // determine the lightness in the range [0,1]\n var l = maximum / 255 - range / 510;\n\n // store the HSL components\n hsl =\n {\n 'h' : getHue(maximum, range),\n 's' : (range == 0 ? 0 : range / 2.55 / (l < 0.5 ? l * 2 : 2 - l * 2)),\n 'l' : 100 * l\n };\n\n }", "function _YLightSensor(str_func)\n {\n //--- (YLightSensor constructor)\n\n // inherit from YFunction (=== YAPI.newFunction)\n YAPI.newFunction.call(this, 'LightSensor', str_func);\n \n // public\n this.LOGICALNAME_INVALID = \"!INVALID!\";\n this.ADVERTISEDVALUE_INVALID = \"!INVALID!\";\n this.UNIT_INVALID = \"!INVALID!\";\n this.CURRENTVALUE_INVALID = -Number.MAX_VALUE;\n this.LOWESTVALUE_INVALID = -Number.MAX_VALUE;\n this.HIGHESTVALUE_INVALID = -Number.MAX_VALUE;\n this.CURRENTRAWVALUE_INVALID = -Number.MAX_VALUE;\n this.CALIBRATIONPARAM_INVALID = \"!INVALID!\";\n this.RESOLUTION_INVALID = -Number.MAX_VALUE;\n this._calibrationOffset = 0;\n this.get_logicalName = YLightSensor_get_logicalName;\n this.logicalName = YLightSensor_get_logicalName;\n this.get_logicalName_async = YLightSensor_get_logicalName_async;\n this.logicalName_async = YLightSensor_get_logicalName_async;\n this.set_logicalName = YLightSensor_set_logicalName;\n this.setLogicalName = YLightSensor_set_logicalName;\n this.get_advertisedValue = YLightSensor_get_advertisedValue;\n this.advertisedValue = YLightSensor_get_advertisedValue;\n this.get_advertisedValue_async = YLightSensor_get_advertisedValue_async;\n this.advertisedValue_async = YLightSensor_get_advertisedValue_async;\n this.get_unit = YLightSensor_get_unit;\n this.unit = YLightSensor_get_unit;\n this.get_unit_async = YLightSensor_get_unit_async;\n this.unit_async = YLightSensor_get_unit_async;\n this.set_currentValue = YLightSensor_set_currentValue;\n this.setCurrentValue = YLightSensor_set_currentValue;\n this.get_currentValue = YLightSensor_get_currentValue;\n this.currentValue = YLightSensor_get_currentValue;\n this.get_currentValue_async = YLightSensor_get_currentValue_async;\n this.currentValue_async = YLightSensor_get_currentValue_async;\n this.calibrate = YLightSensor_calibrate;\n this.set_lowestValue = YLightSensor_set_lowestValue;\n this.setLowestValue = YLightSensor_set_lowestValue;\n this.get_lowestValue = YLightSensor_get_lowestValue;\n this.lowestValue = YLightSensor_get_lowestValue;\n this.get_lowestValue_async = YLightSensor_get_lowestValue_async;\n this.lowestValue_async = YLightSensor_get_lowestValue_async;\n this.set_highestValue = YLightSensor_set_highestValue;\n this.setHighestValue = YLightSensor_set_highestValue;\n this.get_highestValue = YLightSensor_get_highestValue;\n this.highestValue = YLightSensor_get_highestValue;\n this.get_highestValue_async = YLightSensor_get_highestValue_async;\n this.highestValue_async = YLightSensor_get_highestValue_async;\n this.get_currentRawValue = YLightSensor_get_currentRawValue;\n this.currentRawValue = YLightSensor_get_currentRawValue;\n this.get_currentRawValue_async = YLightSensor_get_currentRawValue_async;\n this.currentRawValue_async = YLightSensor_get_currentRawValue_async;\n this.get_calibrationParam = YLightSensor_get_calibrationParam;\n this.calibrationParam = YLightSensor_get_calibrationParam;\n this.get_calibrationParam_async = YLightSensor_get_calibrationParam_async;\n this.calibrationParam_async = YLightSensor_get_calibrationParam_async;\n this.set_calibrationParam = YLightSensor_set_calibrationParam;\n this.setCalibrationParam = YLightSensor_set_calibrationParam;\n this.calibrateFromPoints = YLightSensor_calibrateFromPoints;\n this.loadCalibrationPoints = YLightSensor_loadCalibrationPoints;\n this.get_resolution = YLightSensor_get_resolution;\n this.resolution = YLightSensor_get_resolution;\n this.get_resolution_async = YLightSensor_get_resolution_async;\n this.resolution_async = YLightSensor_get_resolution_async;\n this.nextLightSensor = YLightSensor_nextLightSensor;\n //--- (end of YLightSensor constructor)\n }", "function makeLight(color) {\n var light = new THREE.PointLight(color || 0xFFFFFF, 1, 0);\n\n light.castShadow = true;\n light.shadow.mapSize.width = 512;\n light.shadow.mapSize.height = 512;\n light.shadow.camera.near = 0.1;\n light.shadow.camera.far = 120;\n light.shadow.bias = 0.9;\n light.shadow.radius = 5;\n\n light.power = 9;\n\n // var sphereSize = 20;\n // var pointLightHelper = new THREE.PointLightHelper( light, sphereSize );\n //light.add( pointLightHelper ); //err: not defined\n\n return light;\n}", "function lighten(color, l) {\n var hsl = rgbToHsl(r, g, b)\n hsl.l = clamp(hsl.l - l, 0, 1)\n var {r, g, b} = hslToRgb(hsl.h, hsl.s, hsl.l)\n return {r: Math.round(r), g: Math.round(g), b: Math.round(b)}\n}", "function yFirstLightSensor()\n{\n return YLightSensor.FirstLightSensor();\n}", "set intensity(value) {}", "static fromJson(data) {\n\n\t\tvar light = new directionalLight(data.color, data.intensity);\n\n\t\t// Light fromJson\n\t\tlight = super.fromJson(data, light);\n\n\t\treturn light;\n\t}", "get luminance() { return this.hsl[2]; }", "function trafficLight (color) {\n switch (color) {\n case \"green\":\n return \"keep going\";\n case \"yellow\":\n return \"slow down\";\n case \"red\":\n return \"stop\";\n default:\n return \"I dont know\";\n }\n }", "function adjustLightIntensity(i, value) {\n lightIntensity = value;\n spotlights[i-1].intensity = lightIntensity/100;\n updateIntensityLabel(i);\n render();\n}", "function Light(){\n SceneNode.call( this );\n}", "get intensity() {}", "function DirectionalLight(color)\n{\n\tthis.type = \"DirectionalLight\";\n\t\n\tthis.color = color !== undefined ? color : new Color(0.3, 0.3, 0.3);\n\tthis.position = new Vector3(0.0, 0.0, 0.0);\n}", "function lightListener(lightEvent){\n\n\tvar currentLux = lightEvent.value; // Contains ambient light sensor data\n\n\tif (currentLux > 10) {\n\t\tif(dark){\n\t\t\tdark = false;\n\t\t\ttoggleDarkness();\n\t\t\tdocument.body.style.background = \"#E6E6E6\";\n\t\t}\n\t}else{\n\t\tif(!dark){\n\t\t\ttoggleDarkness();\n\t\t\tdark = true;\n\t\t\tdocument.body.style.background = \"#070d0d\";\n\t\t}\n\t}\n}", "constructor() {\n this.red = null;\n this.green = null;\n this.blue = null;\n this.x = null;\n this.y = null;\n this.brightness = null;\n this.hue = null;\n this.saturation = null;\n this.temperature = null;\n this.originalColor = null;\n }", "function lightness(light, setting) {\r\n\tif (mapDone == 1) {\r\n\t\tvar newHSL = [\r\n\t\t\t{\r\n\t\t\t\tfeatureType: \"all\",\r\n\t\t\t\telementType: \"all\",\r\n\t\t\t\tstylers: [ \r\n\t\t\t\t\t{hue: setting.saturation},\r\n\t\t\t\t\t{saturation: setting.saturation},\r\n\t\t\t\t\t{lightness: light}\r\n\t\t\t\t]\r\n\t\t\t}\r\n\t\t];\r\n\t\treturn newHSL;\r\n\t\t\r\n\t} else {\r\n\t\treturn;\r\n\t}\r\n}", "function OnTypicalLights_Change( e )\r\n{\r\n Alloy.Globals.ShedModeInfrastructure[\"TYPICAL_LIGHTS\"] = e.id ;\r\n}", "setLight(context) {\n this.setLightPosition(context);\n this.setLightUniforms(context);\n }", "function filter_luminosity(dict) {\n\tconst l = \tdict['intensity'] \t|| 1.2;\n\n\treturn function (img) {\n\t\tconst H = filter_getHSLChannel({ c: 'h' })(img);\n\t\tconst S = filter_getHSLChannel({ c: 's' })(img);\n\t\tconst L = filter_getHSLChannel({ c: 'l' })(img);\n\t\tconst Lp = L.map((e, i) => (i % 4 === 3) ? 255 : Math.min(255, l * e));\n\t\treturn gatherHSLChannels(H, S, Lp);\n\t};\n}", "createLights() {\n var ambientLight = new THREE.AmbientLight(0xccddee, 2);\n // La añadimos a la escena\n this.add(ambientLight);\n\n var light = new THREE.PointLight(0xff0000, 1, 100);\n light.position.set(500, 500, 500);\n this.add(light);\n\n }", "createChangedHSLColor( color, changes) {\n let hueChange = changes.hueChange\n let satChange = changes.satChange\n let lightChange = changes.lightChange\n let hsl = color.hsl\n let hue = (hsl.hue + hueChange) % 360\n let sat = hsl.sat + satChange\n sat = sat == 100 ? sat : sat % 100\n let light = hsl.light + lightChange\n light = light == 100 ? light : light % 100\n this.setAllFromHSL(hue, sat, light)\n }", "init() {\n\n let\n lights = this.get('lightsService'),\n id = this.get('light');\n\n this._super(...arguments);\n\n // set light id\n this.set('lightId', id);\n\n // set range positions\n this.set('lightState', lights.getStatus(id)).then( res => {\n\n this.setProperties({\n power: res.state.on,\n lightName: res.name,\n hue: res.state.hue,\n bri: res.state.bri,\n sat: res.state.sat,\n ct: res.state.ct,\n type: res.type,\n modelid: res.modelid\n });\n\n if (!res.state.on) {\n\n // Set values to zero to better represent 'off' state\n this.setProperties({ power: false, sat: 0, bri: 0, hue: 0 });\n }\n });\n }", "static create(scene, config) {\n switch (config.type) {\n case 'point':\n return new PointLight(scene, config);\n case 'directional':\n return new DirectionalLight(scene, config);\n case 'spotlight':\n return new SpotLight(scene, config);\n /* falls through */\n default:\n return new NoLight(scene, config);\n }\n }", "function addLight() {\n gl.uniform3f(shaderProgram.ambientColorUniform, 0.8, 0.8, 0.7);\n var lightingDirection = Vector.create([0.85, 0.8, 0.75]);\n var adjustedLD = lightingDirection.toUnitVector().x(-1);\n var flatLD = adjustedLD.flatten();\n gl.uniform3f(shaderProgram.lightingDirectionUniform, flatLD[0], flatLD[1], flatLD[2]);\n gl.uniform3f(shaderProgram.directionalColorUniform, 0.7, 0.7, 0.7);\n gl.uniform3f(shaderProgram.pointLightingLocationUniform, 0, -10, -400);\n gl.uniform3f(shaderProgram.pointLightingSpecularColorUniform, 0.8, 0.8, 0.8);\n gl.uniform1f(shaderProgram.materialShininessUniform, 30.0);\n}", "initLights() {\n // Reads the lights from the scene graph.\n this.lightsState = {};\n\n // disable all lights\n Object.keys(this.lights).forEach(key => {\n this.lights[key].setVisible(false);\n this.lights[key].disable();\n this.lights[key].update();\n });\n\n // enable defined lights in current ambient\n const lights = this.graph.ambients[this.graph.selectedAmbient].lights;\n Object.keys(lights).forEach((key, index) => {\n if (index < 8) { // Only eight lights allowed by WebGL.\n const light = lights[key];\n\n const attenuation = light[6];\n this.lights[index].setPosition(light[2][0], light[2][1], light[2][2], light[2][3]);\n this.lights[index].setAmbient(light[3][0], light[3][1], light[3][2], light[3][3]);\n this.lights[index].setDiffuse(light[4][0], light[4][1], light[4][2], light[4][3]);\n this.lights[index].setSpecular(light[5][0], light[5][1], light[5][2], light[5][3]);\n if (attenuation.constant) this.lights[index].setConstantAttenuation(attenuation.constant);\n if (attenuation.linear) this.lights[index].setLinearAttenuation(attenuation.linear);\n if (attenuation.quadratic) this.lights[index].setQuadraticAttenuation(attenuation.quadratic);\n\n if (light[1] == 'spot') {\n this.lights[index].setSpotCutOff(light[8]);\n this.lights[index].setSpotExponent(light[9]);\n this.lights[index].setSpotDirection(light[10][0], light[10][1], light[10][2]);\n }\n\n this.lights[index].setVisible(true);\n if (light[0]) this.lights[index].enable();\n else this.lights[index].disable();\n\n this.lights[index].update();\n this.lightsState[key] = {\n isEnabled: light[0],\n lightIndex: index\n };\n }\n\n });\n\n this.addLightsToInterface();\n }", "function LightSwitch(state) { // Very simple\n this.state = state; // LightSwitch\n} // object. ", "function updateLight() {\n \"use strict\";\n // Parameters for the light sources.\n var color = 0xffffff;\n var intensity = 0.6;\n var distance = 10000;\n var decay = 2;\n\n var light = new THREE.Group();\n light.add(new THREE.AmbientLight(0xffffff, 0.25));\n\n var gridPosition = new GridPosition(0,0,0);\n POINT_LIGHT_POSITIONS.readable.forEach(function(item) {\n var point = new THREE.PointLight(color, intensity, distance, decay);\n point.position.copy(gridPosition.setPosition(item[0], item[1], item[2]).getVector3());\n light.add(point);\n var point_helper = new THREE.PointLightHelper(point, 25);\n light.add(point_helper);\n });\n\n scene.add(light);\n}", "function YLightSensor_FindLightSensor(str_func)\n {\n if(str_func == undefined) return null;\n var obj_func = YAPI.getFunction('LightSensor', str_func);\n if(obj_func) return obj_func;\n return new YLightSensor(str_func);\n }", "function addLights() {\n let light = new THREE.AmbientLight(0xffffff);\n light.intensity = 0.05;\n scene.add(light);\n\n const intensity = 0.3;\n let pointLight1 = new THREE.PointLight(0xffffff, intensity);\n pointLight1.position.set(4, 3, 1);\n pointLight1.castShadow = true;\n scene.add(pointLight1);\n\n let pointLight2 = new THREE.PointLight(0xffffff, intensity);\n pointLight2.position.set(4, 3, 11);\n pointLight2.castShadow = true;\n scene.add(pointLight2);\n\n let sun = new THREE.PointLight(0xf48037)\n sun.intensity = 0.9\n sun.position.set(15, 5, 90)\n scene.add(sun);\n}", "function generateLightGrey(hue) {\n flag = 'false';\n // saturation = random # 0 to 15 inclusive\n satMin = 0;\n satMax = 15;\n\n // lightness = random # 66 to 85 inclusive\n lightMin = 66;\n lightMax = 85;\n\n saturation = randomIntFromInterval(satMin, satMax);\n lightness = randomIntFromInterval(lightMin, lightMax);\n\n // Error checking?\n if (isLightnessWithinConstraints(lightness, lightMin, lightMax)\n && isSaturationWithinConstraints(saturation, satMin, satMax)) {\n }\n hsl = \"hsl(\" + hue + \", \" + saturation + \"%, \" + lightness + \"%)\";\n debug(hsl); // test\n return hsl;\n}", "get lights(): Array<M_AbstractLight>{\n return this._lights;\n }", "function isLight(color) {\n return ((color.r * 299) + (color.g * 587) + (color.b * 114)) / 1000 >= 128;\n}", "initLights() {\n\n // Array for lights' UI\n this.lightSwitches = [];\n\n // Setup lights with XML values\n this.graph.lights.forEach((value, key) => {\n var light = value;\n var i = light[0];\n\n this.lights[i].setPosition(light[3][0], light[3][1], light[3][2], light[3][3]);\n this.lights[i].setAmbient(light[4][0], light[4][1], light[4][2], light[4][3]);\n this.lights[i].setDiffuse(light[5][0], light[5][1], light[5][2], light[5][3]);\n this.lights[i].setSpecular(light[6][0], light[6][1], light[6][2], light[6][3]);\n\n this.lights[i].setConstantAttenuation(light[7]);\n this.lights[i].setLinearAttenuation(light[8]);\n this.lights[i].setQuadraticAttenuation(light[9]);\n\n if (light[2] == \"spot\") {\n this.lights[i].setSpotCutOff(light[10]);\n this.lights[i].setSpotExponent(light[11]);\n this.lights[i].setSpotDirection(light[12][0], light[12][1], light[12][2]);\n }\n\n this.lights[i].setVisible(true);\n if (light[1]) {\n this.lights[i].enable();\n this.lightSwitches.push(true); \n }\n else {\n this.lights[i].disable();\n this.lightSwitches.push(false);\n }\n \n // Create light UI\n this.interface.addLight(this.lightSwitches, i, key);\n\n // Update light to reflect changes\n this.lights[i].update();\n });\n }", "function initLight(color) {\n\tscene.add(new THREE.AmbientLight(color,0.8));\n\tvar light = new THREE.HemisphereLight( 0xffffbb, 0x080820, 1 );\n\tlight.position.set(0,0,8000);\n\tscene.add( light );\n}", "initLights() {\n // Reads the lights from the scene graph.\n this.lightsState={};\n Object.keys(this.graph.lights).forEach((key, index) => {\n if (index < 8) { // Only eight lights allowed by WebGL.\n const light = this.graph.lights[key];\n\n const attenuation = light[6];\n this.lights[index].setPosition(light[2][0], light[2][1], light[2][2], light[2][3]);\n this.lights[index].setAmbient(light[3][0], light[3][1], light[3][2], light[3][3]);\n this.lights[index].setDiffuse(light[4][0], light[4][1], light[4][2], light[4][3]);\n this.lights[index].setSpecular(light[5][0], light[5][1], light[5][2], light[5][3]);\n if (attenuation.constant) this.lights[index].setConstantAttenuation(attenuation.constant);\n if (attenuation.linear) this.lights[index].setLinearAttenuation(attenuation.linear);\n if (attenuation.quadratic) this.lights[index].setQuadraticAttenuation(attenuation.quadratic);\n\n if (light[1] == 'spot') {\n this.lights[index].setSpotCutOff(light[8]);\n this.lights[index].setSpotExponent(light[9]);\n this.lights[index].setSpotDirection(light[10][0], light[10][1], light[10][2]);\n }\n\n this.lights[index].setVisible(true);\n if (light[0]) this.lights[index].enable();\n else this.lights[index].disable();\n\n this.lights[index].update();\n this.lightsState[key] = {\n isEnabled: light[0],\n lightIndex: index\n };\n }\n\n });\n\n this.addLightsToInterface();\n }", "get saturation() { return this.hsl[1]; }", "intensity(val) {\n this._intensity = val;\n return this;\n }", "function colorDemo() {\n\tif (systemState != \"demo\") {\n\t\t//no more\n\t\treturn;\n\t}\n\n\tfor (var id in hue) {\n\t\tvar payload = {\n\t\t\ton : true,\n\t\t\tbri: 255,\n\t\t\thue: hueValue,\n\t\t\tsat: 255\n\t\t};\n\t\t//console.log(JSON.stringify(payload))\n\t\tif (!put('/api/loganrooper/lights/'+hue[id]+'/state', payload)) {\n\t\t\t//errors\n\t\t\tconsole.log('connection to hue has errors');\n\t\t}\n\t}\n\thueValue += 3000*n;\n\tif (hueValue > 65535 || hueValue < 1) {\n\t\tn *= -1;\n\t}\n\n}", "function addGlowEffect()\n\t{\n\t\t// clear previous glow interval (if any)\n\t\tif (_glowInterval != null)\n\t\t{\n\t\t\tclearInterval(_glowInterval);\n\t\t}\n\n\t\t// create gradient color generator\n\t\tvar gradient = new Rainbow();\n\t\tvar range = 16;\n\t\tvar index = 0;\n\t\tgradient.setNumberRange(0, range - 1);\n\t\tgradient.setSpectrum(_options.highlightGradient[0].replace(\"#\", \"\"),\n\t\t _options.highlightGradient[1].replace(\"#\", \"\"));\n\n\t\t// convert positions to script positions\n\t\tvar scriptPositions = null;\n\n\t\t// set new interval\n\t\t_glowInterval = setInterval(function() {\n\t\t\tvar highlightCount = _.size(_highlighted);\n\n\t\t\tif (highlightCount > 0)\n\t\t\t{\n\t\t\t\t// TODO update script position each time _highlighted is updated\n\t\t\t\tif (scriptPositions == null ||\n\t\t\t\t scriptPositions.length != highlightCount)\n\t\t\t\t{\n\t\t\t\t\tscriptPositions = _scriptGen.highlightScriptPositions(_highlighted);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (scriptPositions != null &&\n\t\t\t scriptPositions.length > 0)\n\t\t\t{\n\t\t\t\tvar color = \"#\" + gradient.colorAt(index);\n\t\t\t\tvar script = _scriptGen.highlightScript(\n\t\t\t\t\tscriptPositions, color, _options, _chain);\n\n\t\t\t\t// convert array to a single string\n\t\t\t\tscript = script.join(\" \");\n\n\t\t\t\t// send script string to the app\n\t\t\t\t_3dApp.script(script);\n\n\t\t\t\tindex = (index + 1) % range;\n\t\t\t}\n\t\t}, 50);\n\t}", "constructor(lightMin){\r\n this.lightMin = lightMin; //minimum light value for any Tile in this Scene\r\n\r\n this.lightMap = []; //grid of light values\r\n this.layers = []; //list of layers of grids of lists of Tiles\r\n this.rigids = []; //list of copy of rigid Tiles (for increased collision check performance)\r\n this.dynamicTiles = []; //list of DynamicTiles\r\n this.lights = []; //list of light objects used to generate lightMap\r\n this.dynamicLights = []; //list of DynamicTiles with light property\r\n this.animatedTiles = []; //list of AnimatedTiles (for update in Renderer)\r\n }", "function slidersForHSL() {\n const div4GBC = document.querySelector(\"#grayScaleBGC\");\n const rangeHue = document.querySelector(\"#rangeHue\").value;\n const rangeSaturation = document.querySelector(\"#rangeSaturation\").value;\n const rangeLightness = document.querySelector(\"#rangeLightness\").value;\n console.log(417, rangeHue, rangeSaturation, rangeLightness);\n div4GBC.style.backgroundColor =\n \"hsl(\" + rangeHue + \",\" + rangeSaturation + \"% ,\" + rangeLightness + \"%)\";\n document.querySelector(\"#hueValue\").innerHTML = rangeHue + \"°\";\n document.querySelector(\"#saturationValue\").innerHTML = rangeSaturation + \"%\";\n document.querySelector(\"#lightnessValue\").innerHTML = rangeLightness + \"%\";\n // Live HSL values\n const HSLvalue4 = document.querySelector(\"#HSLvalue4\");\n HSLvalue4.innerHTML = `HSL Values: <span>${rangeHue}°, ${rangeSaturation}%, ${rangeLightness}%</span>`;\n}", "lighten(factor = 0.1) {\n this.addEffect(new Effects.Lighten(factor));\n }", "constructor(x, y) {\n this.x = x;\n this.y = y;\n this.size = 100;\n this.maxSize = 700;\n this.minSize = 100;\n this.vx = 0;\n this.vy = 0;\n this.speed = 5;\n this.growRate = 1; // How much larger we get each frame\n this.jitteriness = 0.25; // How likely the Light is to change direction\n this.on = true; // The Light starts out on!\n }", "lighten(amount = 10) {\n const hsl = this.toHsl();\n hsl.l += amount / 100;\n hsl.l = util_1.clamp01(hsl.l);\n return new TinyColor(hsl);\n }", "function turnTrafficLightRed() {\n\tvar state = arguments[0];\n\tL[0][3] = 0;\n\tif(state == 0) {\n\t\tfor(var l = 0; l < L.length; l++) {\n\t\t\tL[l][2] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n\t\t}\n\t} else {\n\t\tfor(var l = 0; l < L.length; l++) {\n\t\t\tL[l][2] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1];\n\t\t}\n\t}\n\tlightState = state;\n}", "initLights() {\n var i = 0; // Light index in this.lights array\n this.lightsMap = new Map(); // Map that associates light id with index for use with MyInterface\n\n // Reads the lights from the scene graph.\n for (let [key, light] of this.graph.lights) {\n if (i >= 8)\n break; // Only eight lights allowed by WebCGF on default shaders.\n\n // Sets light parameters\n this.lights[i].setPosition(...light[1]);\n this.lights[i].setAmbient(...light[2]);\n this.lights[i].setDiffuse(...light[3]);\n this.lights[i].setSpecular(...light[4]);\n this.lights[i].setVisible(true);\n if (light[0])\n this.lights[i].enable();\n else\n this.lights[i].disable();\n\n this.lights[i].update();\n\n this.lightsMap.set(key, i);\n\n i++;\n }\n }", "initLights() {\r\n var i = 0;\r\n // Lights index.\r\n\r\n // Reads the lights from the scene graph.\r\n for (var key in this.graph.lights) {\r\n if (i >= 8)\r\n break; // Only eight lights allowed by WebGL.\r\n\r\n if (this.graph.lights.hasOwnProperty(key)) {\r\n var light = this.graph.lights[key];\r\n\r\n this.lights[i].setPosition(light[2][0], light[2][1], light[2][2], light[2][3]);\r\n this.lights[i].setAmbient(light[3][0], light[3][1], light[3][2], light[3][3]);\r\n this.lights[i].setDiffuse(light[4][0], light[4][1], light[4][2], light[4][3]);\r\n this.lights[i].setSpecular(light[5][0], light[5][1], light[5][2], light[5][3]);\r\n\r\n if (light[1] == \"spot\") {\r\n this.lights[i].setSpotCutOff(light[6]);\r\n this.lights[i].setSpotExponent(light[7]);\r\n this.lights[i].setSpotDirection(light[8][0], light[8][1], light[8][2]);\r\n }\r\n\r\n this.lights[i].setVisible(true);\r\n if (light[0])\r\n this.lights[i].enable();\r\n else\r\n this.lights[i].disable();\r\n\r\n this.lights[i].update();\r\n\r\n i++;\r\n }\r\n }\r\n }", "function hslo_2_low8high( hue, sat, light, lowOpacity, highOpacity )\n {\n highOpacity = typeof highOpacity === 'undefined' ? 1 : highOpacity;\n //ns.pars2colors = function( HUE, SATURATION, LIGHTNESS, OPACITY )\n var corRack = ns.pars2colors( hue, sat, light, lowOpacity );\n rgba_low = corRack.rgba;\n rgbaCSS = corRack.rgbaCSS;\n var corRack = ns.pars2colors( hue, sat, light, highOpacity );\n rgba_high = corRack.rgba;\n return { rgba_low, rgba_high, lowOpacity, highOpacity }; \n }", "get hue() { return this.hsl[0]; }", "function setLight(intensity) {\n // execute('LEDControl', [intensity])\n execFile('./scripts/LEDControl', [intensity], (error, stdout, stderr) => {\n if (error) {\n console.error('stderr', stderr);\n throw error;\n }\n console.log(stdout);\n })\n}", "function generateLighting(num) {\r\n var pointLHelper1, pointLHelper2, dirLightHelper;\r\n if (num === 0) {\r\n pointLight1.intensity = 0.8;\r\n pointLight1.color.setHex(0xcccccc);\r\n pointLight1.position.set(3, 5, -5);\r\n\r\n pointLight2.intensity = 0.2;\r\n pointLight2.color.setHex(0x648038);\r\n pointLight2.position.set(-3, -5, -5);\r\n\r\n hemisphereLight.intensity = 0.2;\r\n hemisphereLight.color.setHex(0x3e1c09);\r\n hemisphereLight.groundColor.setHex(0xb92d12);\r\n\r\n// pointLight1.name = \"pointLight1\";\r\n// hemisphereLight.name = \"hemisphereLight\";\r\n// scene.add(pointLight1, hemisphereLight);\r\n } else if (num == 1) {\r\n pointLight1.intensity = 0.8;\r\n pointLight1.color.setHex(getRandomColour(0xcc, 0xfa, 0xc5, 0xfa, 0xcc, 0xfa));\r\n pointLight1.position.set(0, 9, 0);\r\n\r\n hemisphereLight.intensity = 0.5;\r\n hemisphereLight.color.setHex(0x3e1c09);\r\n hemisphereLight.groundColor.setHex(0x9b5649);\r\n\r\n// pointLight1.name = \"pointLight1\";\r\n// scene.add(pointLight1);\r\n } else if (num == 2) {\r\n pointLight1.intensity = 6;\r\n pointLight1.color.setHex(0xffc682);\r\n pointLight1.position.set(14, 18, -23);\r\n\r\n directionalLight.intensity = 0.5;\r\n directionalLight.color.setHex(0xddcccc);\r\n directionalLight.position.set(0, 10, 0);\r\n\r\n// pointLight1.name = \"pointLight1\";\r\n// directionalLight.name = \"directionalLight\";\r\n// scene.add(pointLight1, directionalLight);\r\n } else if (num == 3) {\r\n hemisphereLight.intensity = 0.5;\r\n hemisphereLight.color.setHex(0x427a98);\r\n hemisphereLight.groundColor.setHex(0x24221f);\r\n\r\n pointLight1.intensity = 1;\r\n pointLight1.color.setHex(0xff9327);\r\n pointLight1.position.set(8, 10, -25);\r\n\r\n pointLight2.intensity = 1;\r\n pointLight2.color.setHex(0xff9327);\r\n pointLight2.position.set(-8, 10, -25);\r\n\r\n pointLight3.intensity = 1;\r\n pointLight3.color.setHex(0xff9327);\r\n pointLight3.position.set(16, 10, -25);\r\n\r\n pointLight4.intensity = 1;\r\n pointLight4.color.setHex(0xff9327);\r\n pointLight4.position.set(-16, 10, -25);\r\n\r\n// pointLHelper1 = new THREE.PointLightHelper(pointLight1, 10);\r\n// pointLHelper2 = new THREE.PointLightHelper(pointLight2, 10);\r\n\r\n// hemisphereLight.name = \"hemisphereLight\";\r\n// pointLight1.name = \"pointLight1\";\r\n// pointLight2.name = \"pointLight2\";\r\n// pointLight3.name = \"pointLight3\";\r\n// pointLight4.name = \"pointLight4\";\r\n// scene.add(pointLight1, pointLight2, pointLight3, pointLight4,\r\n// hemisphereLight);\r\n } else if (num == 4) {\r\n pointLight1.intensity = 1.2;\r\n pointLight1.color.setHex(0xff6026);\r\n pointLight1.position.set(0, -10, -6);\r\n\r\n pointLight2.intensity = 0.6;\r\n pointLight2.color.setHex(0x7c9aaa);\r\n pointLight2.position.set(11, -10, -8);\r\n\r\n pointLight3.intensity = 0.6;\r\n pointLight3.color.setHex(0xc3a2d0);\r\n pointLight3.position.set(-11, -10, -8);\r\n\r\n// pointLight1.name = \"pointLight1\";\r\n// pointLight2.name = \"pointLight2\";\r\n// pointLight3.name = \"pointLight3\";\r\n// scene.add(pointLight1, pointLight2, pointLight3);\r\n } else if (num == 5) {\r\n hemisphereLight.intensity = 0.5;\r\n hemisphereLight.color.setHex(0x427a98);\r\n hemisphereLight.groundColor.setHex(0x24221f);\r\n\r\n pointLight1.intensity = 3;\r\n pointLight1.distance = 4.4;\r\n pointLight1.color.set(0xf2d24b);\r\n pointLight1.position.set(1.8, 2.5, -6);\r\n// pointLHelper1 = new THREE.PointLightHelper(pointLight1, 2);\r\n\r\n directionalLight.intensity = 0.5;\r\n directionalLight.color.setHex(0xf2d24b);\r\n directionalLight.position.set(4, 20, -5);\r\n// dirLightHelper = new THREE.DirectionalLightHelper(directionalLight, 20);\r\n\r\n// pointLight1.name = \"pointLight1\";\r\n// directionalLight.name = \"directionalLight\";\r\n// hemisphereLight.name = \"hemisphereLight\";\r\n// scene.add(hemisphereLight, directionalLight, pointLight1);\r\n } else if (num == 6) {\r\n pointLight1.intensity = 0.6;\r\n pointLight1.color.setHex(0xff0000);\r\n pointLight1.position.set(5, 10, -4);\r\n\r\n pointLight2.intensity = 0.6;\r\n pointLight2.color.setHex(0x00ff00);\r\n pointLight2.position.set(-7, 10, -9);\r\n\r\n pointLight3.intensity = 0.6;\r\n pointLight3.color.setHex(0x0000ff);\r\n pointLight3.position.set(-0.3, -2, -4);\r\n\r\n// pointLight1.name = \"pointLight1\";\r\n// pointLight2.name = \"pointLight2\";\r\n// pointLight3.name = \"pointLight3\";\r\n// scene.add(pointLight1, pointLight2, pointLight3);\r\n }\r\n console.log(\"Objects in scene: \");\r\n console.log(scene.children);\r\n}", "initLights() {\n var i = 0;\n // Lights index.\n\n // Reads the lights from the scene graph.\n for (var key in this.graph.lights) {\n if (i >= 8)\n break; // Only eight lights allowed by WebGL.\n\n if (this.graph.lights.hasOwnProperty(key)) {\n var light = this.graph.lights[key];\n\n this.lights[i].setPosition(light[2][0], light[2][1], light[2][2], light[2][3]);\n this.lights[i].setAmbient(light[3][0], light[3][1], light[3][2], light[3][3]);\n this.lights[i].setDiffuse(light[4][0], light[4][1], light[4][2], light[4][3]);\n this.lights[i].setSpecular(light[5][0], light[5][1], light[5][2], light[5][3]);\n this.lights[i].setConstantAttenuation(light[6]);\n this.lights[i].setLinearAttenuation(light[7]);\n this.lights[i].setQuadraticAttenuation(light[8]);\n\n if (light[1] == \"spot\") {\n this.lights[i].setSpotCutOff(light[9]);\n this.lights[i].setSpotExponent(light[10]);\n this.lights[i].setSpotDirection(light[11][0], light[11][1], light[11][2]);\n }\n\n this.lights[i].setVisible(true);\n if (light[0])\n this.lights[i].enable();\n else\n this.lights[i].disable();\n\n this.lights[i].update();\n\n i++;\n }\n }\n }", "initLights() {\n var i = 0;\n // Lights index.\n\n // Reads the lights from the scene graph.\n for (var key in this.graph.lights) {\n if (i >= 8)\n break; // Only eight lights allowed by WebGL.\n\n if (this.graph.lights.hasOwnProperty(key)) {\n var light = this.graph.lights[key];\n\n //lights are predefined in cgfscene\n this.lights[i].setPosition(light.location[0], light.location[1], light.location[2], light.location[3]);\n this.lights[i].setAmbient(light.ambient[0], light.ambient[1], light.ambient[2], light.ambient[3]);\n this.lights[i].setDiffuse(light.diffuse[0], light.diffuse[1], light.diffuse[2], light.diffuse[3]);\n this.lights[i].setSpecular(light.specular[0], light.specular[1], light.specular[2], light.specular[3]);\n\n this.lights[i].setVisible(true);\n if (light.enabled)\n this.lights[i].enable();\n else\n this.lights[i].disable();\n\n if(light.angle != null) {\n this.lights[i].setSpotCutOff(light.angle);\n this.lights[i].setSpotDirection(light.target[0]-light.location[0], light.target[1]-light.location[1], light.target[2]-light.location[2]);\n this.lights[i].setSpotExponent(light.exponent);\n }\n\n this.lights[i].update();\n\n i++;\n }\n }\n }", "initLights() {\n var i = 0;\n // Lights index.\n\n // Reads the lights from the scene graph.\n for (var key in this.graphs[this.currGraph].lights) {\n if (i >= 8)\n break; // Only eight lights allowed by WebGL.\n\n if (this.graphs[this.currGraph].lights.hasOwnProperty(key)) {\n var light = this.graphs[this.currGraph].lights[key];\n\n let pos = light.locationLight;\n let ambient = light.ambientIllumination;\n let diffuse = light.diffuseIllumination;\n let specular = light.specularIllumination;\n\n this.lights[i].setAmbient(ambient.r, ambient.g, ambient.b, ambient.a);\n this.lights[i].setDiffuse(diffuse.r, diffuse.g, diffuse.b, diffuse.a);\n this.lights[i].setSpecular(specular.r, specular.g, specular.b, specular.a);\n this.lights[i].setPosition(pos.x, pos.y, pos.z, pos.w);\n\n if (light.type == \"spot\") {\n let angle = light.angle;\n let exponent = light.exponent;\n let target = light.targetLight;\n\n this.lights[i].setSpotDirection(target.x - pos.x, target.y - pos.y, target.z - pos.z);\n this.lights[i].setSpotExponent(exponent);\n this.lights[i].setSpotCutOff(angle);\n }\n\n //lights are predefined in cgfscene\n\n this.lights[i].setVisible(true);\n if (light.enabled)\n this.lights[i].enable();\n else\n this.lights[i].disable();\n\n this.lights[i].update();\n\n this[key] = light.enabled;\n\n i++;\n }\n }\n }" ]
[ "0.75867665", "0.6660433", "0.6113195", "0.6092757", "0.606568", "0.6062579", "0.592106", "0.59023035", "0.5828595", "0.57889444", "0.57036", "0.56835806", "0.562803", "0.55945426", "0.5563289", "0.55441725", "0.5532543", "0.55298793", "0.5465395", "0.5434022", "0.5418213", "0.53987634", "0.53968567", "0.539472", "0.53917533", "0.53746283", "0.53486955", "0.53464884", "0.53275687", "0.5308135", "0.52958965", "0.5291275", "0.5280246", "0.52764195", "0.5275588", "0.52690005", "0.52656305", "0.5253871", "0.5253861", "0.524486", "0.524479", "0.5219622", "0.5217946", "0.51964706", "0.51854813", "0.5158747", "0.5157381", "0.5155157", "0.51343316", "0.51277065", "0.509249", "0.5085739", "0.5081111", "0.5078812", "0.5078405", "0.50649726", "0.50525105", "0.50482506", "0.5046264", "0.50445044", "0.5041864", "0.50294596", "0.50290364", "0.50201905", "0.5011599", "0.50111204", "0.50110507", "0.49905676", "0.49898857", "0.4973103", "0.4970477", "0.4921845", "0.491813", "0.4915136", "0.49038512", "0.4903064", "0.4897742", "0.4882934", "0.48809332", "0.4879741", "0.4879204", "0.48692402", "0.48595643", "0.48532134", "0.48475516", "0.48449874", "0.48380557", "0.48330197", "0.48310506", "0.48296648", "0.4827842", "0.48259807", "0.4825886", "0.48241064", "0.48239237", "0.4814147", "0.48128304", "0.48123914", "0.48108813", "0.48099822" ]
0.58202857
9
Reload tiles on pan and zoom
function zoomed() { // Get the height and width height = el.clientHeight; width = el.clientWidth; // Set the map tile size tile.size([width, height]); // Get the current display bounds var bounds = display.llBounds(); // Project the bounds based on the current projection var psw = projection(bounds[0]); var pne = projection(bounds[1]); // Based the new scale and translation vector off the current one var scale = projection.scale() * 2 * Math.PI; var translate = projection.translate(); var dx = pne[0] - psw[0]; var dy = pne[1] - psw[1]; scale = scale * (1 / Math.max(dx / width, dy / height)); projection .translate([width / 2, height / 2]) .scale(scale / 2 / Math.PI); // Reproject the bounds based on the new scale and translation vector psw = projection(bounds[0]); pne = projection(bounds[1]); var x = (psw[0] + pne[0]) / 2; var y = (psw[1] + pne[1]) / 2; translate = [width - x, height - y]; // Update the Geo tiles tile .scale(scale) .translate(translate); // Get the new set of tiles and render renderTiles(tile()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "refreshZoom() {}", "zoomMap() {\n PaintGraph.Pixels.zoomExtent(this.props.map, this.props.bbox)\n window.refreshTiles()\n window.updateTiles()\n }", "refresh() {\n this.props.loadGrid(5);\n this.resetTiles();\n }", "function load()\n {\n\n var tiles = this.getVisibleTiles( this.latitude, this.longitude, this.zoom, this.viewRect );\n\n if( tiles.length == 0 && this.tiles.length == 0 )\n {\n this.eventEmitter.emit( Map.ON_LOAD_COMPLETE, -1 );\n return;\n }\n\n for ( var i = 0; i < tiles.length; i++ ) {\n tiles[ i ].eventEmitter.on( Tile.ON_TILE_LOADED, this.appendTile );\n tiles[ i ].load();\n }\n\n this.tiles = this.tiles.concat( tiles );\n\n }", "function load()\n {\n\n var tiles = this.getVisibleTiles( this.latitude, this.longitude, this.zoom, this.viewRect );\n\n if( tiles.length == 0 && this.tiles.length == 0 )\n {\n this.eventEmitter.emit( Map.ON_LOAD_COMPLETE, -1 );\n return;\n }\n\n for ( var i = 0; i < tiles.length; i++ ) {\n tiles[ i ].eventEmitter.on( Tile.ON_TILE_LOADED, this.appendTile );\n tiles[ i ].load();\n }\n\n this.tiles = this.tiles.concat( tiles );\n\n }", "function refreshTiles() {\n updater.postMessage({ refresh: true })\n }", "function reloadTiles() {\n var pages = ntpApiHandle.mostVisited;\n var cmds = [];\n for (var i = 0; i < Math.min(MAX_NUM_TILES_TO_SHOW, pages.length); ++i) {\n cmds.push({cmd: 'tile', rid: pages[i].rid});\n }\n cmds.push({cmd: 'show'});\n\n $(IDS.TILES_IFRAME).contentWindow.postMessage(cmds, '*');\n}", "function zoomed() {\n \n var transform = d3.event.transform;\n\n projection\n .scale(transform.k / tau)\n .translate([transform.x, transform.y]);\n\n var currTiles = tile\n .scale(transform.k)\n .translate([transform.x,transform.y])();\n\n var mapTiles = rasterLayer\n .attr('transform', stringify(currTiles.scale, currTiles.translate))\n .selectAll('image')\n .data(currTiles, d => d);\n\n mapTiles.exit()\n .transition()\n .duration(1000)\n .attr(\"opacity\", 0)\n .remove();\n\n mapTiles.enter().append('image')\n .attr( \"xlink:href\", d => getTileUrl(d))\n .attr('x', d => d.tx )\n .attr('y', d => d.ty )\n .attr('opacity', 0)\n .attr('width', 256)\n .attr('height', 256)\n .on(\"load\", function (){\n d3.select(this).transition().duration(750)\n .attr(\"opacity\", 1);\n });\n\n rasterLayer\n .style('opacity',.5)\n .transition().duration(500)\n .style('opacity',1);\n\n drawMonuments();\n}", "function zoom_changed_handler ( )\n\t{\n\t\tclearAllMarkers();\n\t\tg_main_map.init_listener = google.maps.event.addListener ( g_main_map, \"tilesloaded\", tiles_loaded_handler );\n\t}", "function zoomed() {\n\n // Create an transform based on our transformation \n var transform = d3.event.transform;\n \n // Rescale the new tiles based on our new hieght\n var tiles = tile\n .scale(transform.k)\n .translate([transform.x, transform.y])\n ();\n \n // Update our projection to handle the fact that we have now zoomed in, and translate to the correct view\n projection\n .scale(transform.k / tau)\n .translate([transform.x, transform.y]);\n \n // Set the new path\n vector.attr('d', path);\n \n // Get updated rasterized tile images\n var image = raster\n .attr('transform', stringify(tiles.scale, tiles.translate))\n .selectAll('image')\n .data(tiles, function(d) { return d; });\n \n // Remove any images that are no longer in the render\n image.exit().remove();\n \n // Add new images to the render with the proper call to the image server (annoying string manipulation needed).\n // After fetching the images set them to the appropriate size\n image.enter().append('image')\n .attr('xlink:href', function(d) {\n return 'http://' + 'abc'[d[1] % 3] + '.basemaps.cartocdn.com/rastertiles/voyager/' +\n d[2] + \"/\" + d[0] + \"/\" + d[1] + \".png\";\n })\n .attr('x', function(d) { return d[0] * 256; })\n .attr('y', function(d) { return d[1] * 256; })\n .attr('width', 256)\n .attr('height', 256);\n}", "function UpdateTileMap() {\n// set up a dynamic array based on current OPC position to populate the tiles\n\tzoomPosition = [OPC.currentPos -11, OPC.currentPos -10, OPC.currentPos -9, OPC.currentPos -1, OPC.currentPos, OPC.currentPos +1, OPC.currentPos +9, OPC.currentPos +10, OPC.currentPos +11];\n\tswitch(gridZoom) {\n\t\tcase 3: // update the tile map for a 3x3 grid (zoomed in)\n\t\t\tfor(i=0; i < zoomPosition.length; i++) {\n\t\t\t\tswitch(i) {\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\tgridValid = Math.floor(zoomPosition[i] / 10) + 1 == Math.floor(zoomPosition[4] / 10)\t\t\t\t\t\t\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\tgridValid = Math.floor(zoomPosition[i] / 10) == Math.floor(zoomPosition[4] / 10)\t\t\t\t\t\t\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 6:\n\t\t\t\t\t\t\tgridValid = Math.floor(zoomPosition[i] / 10) - 1 == Math.floor(zoomPosition[4] / 10)\t\t\t\t\t\t\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tgridValid = Math.floor(zoomPosition[i] / 10) + 1 == Math.floor(zoomPosition[4] / 10)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 5:\n\t\t\t\t\t\t\tgridValid = Math.floor(zoomPosition[i] / 10) == Math.floor(zoomPosition[4] / 10)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 8:\n\t\t\t\t\t\t\tgridValid = Math.floor(zoomPosition[i] / 10) - 1 == Math.floor(zoomPosition[4] / 10)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tgridValid = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tif(zoomPosition[i] >= 0 &&\n\t\t\t\t\tzoomPosition[i] < 100 &&\n\t\t\t\t\tgridValid) {\n\t\t\t\t\tif(gridArr[zoomPosition[i]].explored < 1) {\n\t\t\t\t\t\tdocument.getElementById(\"tz\" + i.toString()).style.backgroundColor = \"rgba(255,255,255,1)\";\n\t\t\t\t\t}\n\t\t\t\t\tif(gridArr[zoomPosition[i]].explored > 0) {\n\t\t\t\t\t\tdocument.getElementById(\"tz\" + i.toString()).style.backgroundColor = \"rgba(255,255,255,0)\";\n\t\t\t\t\t}\n\t\t\t\t\tif(i == 4) {\n\t\t\t\t\t\tif(OPC.lightLoc == \"offHand\") {\n\t\t\t\t\t\t\tswitch(OPC.offHand) {\n\t\t\t\t\t\t\t\tcase torch:\n\t\t\t\t\t\t\t\t\tlightLifeBar = OPC.lightLife / 6;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase lantern:\n\t\t\t\t\t\t\t\t\tlightLifeBar = OPC.lightLife / 36;\t\t\t\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tlightLifeBar = 100;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdocument.getElementById(\"tz\" + i.toString()).style.backgroundColor = \"rgba(255,\" + lightLifeBar * 2.55 + \",0,0.5)\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tdocument.getElementById(\"tz\" + i.toString()).style.backgroundColor = \"rgba(255,255,255,1)\";\n\t\t\t\t}\t\t\n\t\t\t}\n\t\t\tUpdateGraphicsZoomMap();\n\t\t\tUpdateNoteGrid();\n\t\t\tbreak;\n\t\tcase 10: // update the tile map for a 10x10 grid (zoomed out)\n\t\t\tfor(i=0; i < zoomPosition.length; i++) { // clear the 3x3\n//\t\t\t\tdocument.getElementById(\"tz\" + i.toString()).innerHTML = \"\";\n\t\t\t\tdocument.getElementById(\"tz\" + i.toString()).style.backgroundColor = \"rgba(0,0,0,0)\";\n\t\t\t}\n\t\t\tfor(i=0; i<gridArr.length; i++) { // do for the whole map array\n\t\t\t\tdocument.getElementById(\"t\" + i.toString()).innerHTML = \"\"; // clears the letters off the map\n\t\t\t\tif(gridArr[i].open == 1) {\n//\t\t\t\t\tdocument.getElementById(\"t\" + i.toString()).innerHTML = gridArr[i].pathValue;\n//\t\t\t\t\tdocument.getElementById(\"t\" + i.toString()).innerHTML = gridArr[i].explored;\n\t\t\t\t}\n\t\t\t\tif(gridArr[i].room == \"R\") { // tile is a room\n//\t\t\t\t\tdocument.getElementById(\"t\" + i.toString()).innerHTML = \"R\";\n\t\t\t\t}\n\t\t\t\tif(gridArr[i].room == \"SC\") { // tile is a secret chamber\n//\t\t\t\t\tdocument.getElementById(\"t\" + i.toString()).innerHTML = \"SC\";\n\t\t\t\t}\n\t\t\t\tif(gridArr[i].sDoor > 0) { // tile has a secret door\n//\t\t\t\t\tdocument.getElementById(\"t\" + i.toString()).innerHTML = \"D\";\n\t\t\t\t}\n\t\t\t\tif(gridArr[i].encounter == \"combat\") { // tile has a combat encounter\n//\t\t\t\t\tgridName = \"\";\n//\t\t\t\t\tfor(iGN = 0; iGN < gridArr[i].nonPC.name.length; iGN ++) {\n//\t\t\t\t\t\tif(gridArr[i].nonPC.name.charAt(iGN) == gridArr[i].nonPC.name.charAt(iGN).toUpperCase() && // is an upper case letter\n//\t\t\t\t\t\t\tgridArr[i].nonPC.name.charAt(iGN) !== \" \"){ // is not a space\n//\t\t\t\t\t\t\tgridName += gridArr[i].nonPC.name.charAt(iGN);\n//\t\t\t\t\t\t}\n//\t\t\t\t\t}\n//\t\t\t\t\tdocument.getElementById(\"t\" + i.toString()).innerHTML = gridName + \" \" + gridArr[i].nonPC.hpCurrent;\n\t\t\t\t}\n\t\t\t\tif(gridArr[i].pathValue !== 0) { // tile has an exit path value\n\t\t\t\t\tdocument.getElementById(\"t\" + i.toString()).innerHTML = gridArr[i].pathValue;\n\t\t\t\t}\t\t\t\t\n\t\t\t\tif(gridArr[i].pathValue == 0) { // tile does not have an exit path value\n\t\t\t\t\tdocument.getElementById(\"t\" + i.toString()).innerHTML = \"\";\n\t\t\t\t}\n\t\t\t\tif(gridArr[i].encounter == \"trap\" && // tile has a trap\n\t\t\t\t\tgridArr[i].trapState == 4) { // trap is in state for (discovered by unsprung)\n//\t\t\t\t\tdocument.getElementById(\"t\" + i.toString()).innerHTML = \"-T-\";\n\t\t\t\t}\n\t\t\t\tif(gridArr[i].explored < 1) { // tile has been explored\n\t\t\t\t\tdocument.getElementById(\"t\" + i.toString()).style.backgroundColor = \"rgba(255,255,255,1)\";\n\t\t\t\t}\n\t\t\t\telse if(gridArr[i].explored > 0) { // tile has not been explored\n\t\t\t\t\tdocument.getElementById(\"t\" + i.toString()).style.backgroundColor = \"rgba(255,255,255,0)\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(OPC.currentPos >= 0) {\n\t\t\t\tif(OPC.lightLoc == \"offHand\") {\n\t\t\t\t\tswitch(OPC.offHand) {\n\t\t\t\t\t\tcase torch:\n\t\t\t\t\t\t\tlightLifeBar = OPC.lightLife / 6;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase lantern:\n\t\t\t\t\t\t\tlightLifeBar = OPC.lightLife / 36;\t\t\t\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tlightLifeBar = 100;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdocument.getElementById(\"t\" + OPC.currentPos.toString()).style.backgroundColor = \"rgba(255,\" + lightLifeBar * 2.55 + \",0,0.5)\";\n\t\t\t}\n\t\t\tbreak;\n\t}\n}", "function resetMap() {\n\ttileScale = 24;\n\ttileSize = Math.round(2**(tileScale*.25));\n\tmapUpdate();\n\tupdateTileSize(tileSize);\n\t$(\"#mapSize\").text(\"Map tile size: \" + tileScale + \"(\"+tileSize+\")\");\n}", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }" ]
[ "0.73879206", "0.70817816", "0.66822094", "0.6676514", "0.6676514", "0.66381276", "0.66329783", "0.6629257", "0.6604387", "0.65883344", "0.6573622", "0.65008533", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563", "0.6447563" ]
0.6762653
2
Get the 3D Transform Matrix
function matrix3d(scale, translate) { var k = scale / 256, r = scale % 1 ? Number : Math.round; return 'matrix3d(' + [k, 0, 0, 0, 0, k, 0, 0, 0, 0, k, 0, r(translate[0] * scale), r(translate[1] * scale), 0, 1] + ')'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gettransMatrix(x,y,z){\n var obj = new THREE.Matrix4().set(1,0,0,x, 0,1,0,y, 0,0,1,z, 0,0,0,1);\n return obj;\n}", "getMatrix() {\n let x, y;\n\n x = this.transform.getPosition().x;\n y = this.transform.getPosition().y;\n\n this._transformMatrix.identity();\n\n //mat4.translate(this._transformMatrix, this._transformMatrix, [x, y, 0]);\n //mat4.rotate(this._transformMatrix, this._transformMatrix, this.transform.getRotation(), [0.0, 0.0, 1.0]);\n //mat4.translate(this._transformMatrix, this._transformMatrix, [-x, -y, 0]);\n\n this._transformMatrix.translate([x, y, 0]);\n\n return this._transformMatrix.asArray();\n }", "apply() {\n var transMatrix = mat4.create();\n mat4.identity(transMatrix);\n\n mat4.translate(transMatrix, transMatrix, [this.centerX, this.centerY, this.centerZ]);\n mat4.translate(transMatrix, transMatrix, this.position);\n mat4.rotate(transMatrix, transMatrix, this.angle, [0, 1, 0]);\n\n return transMatrix;\n }", "getMatrix() {\n let x, y;\n\n x = this.transform.getPosition().x;\n y = this.transform.getPosition().y;\n\n this._transformMatrix.identity();\n\n //mat4.translate(this._transformMatrix, this._transformMatrix, [x, y, 0]);\n // eslint-disable-next-line\n //mat4.rotate(this._transformMatrix, this._transformMatrix, this.transform.getRotation(), [0.0, 0.0, 1.0]);\n //mat4.translate(this._transformMatrix, this._transformMatrix, [-x, -y, 0]);\n\n this._transformMatrix.translate([x, y, 0]);\n\n return this._transformMatrix.asArray();\n }", "getRotationMatrix3() {\n mat3.set(rotationMatrix3, this._m0.gain.value, this._m1.gain.value, this._m2.gain.value, this._m3.gain.value, this._m4.gain.value, this._m5.gain.value, this._m6.gain.value, this._m7.gain.value, this._m8.gain.value);\n return rotationMatrix3;\n }", "getTransformation() {\n let globalUp = vec3.fromValues(0, 0, 1);\n let direction = vec3.fromValues(0, 0, 0);\n vec3.subtract(direction, this.p2.position, this.p1.position);\n let angleRadians = this.getCounterClockwiseAngle(globalUp, direction);\n let globalRotate = vec3.fromValues(0, 1, 0);\n let rotationQuat = quat.create();\n quat.setAxisAngle(rotationQuat, globalRotate, angleRadians);\n let translate = this.midpoint();\n let scaleX = this.isHighway ? 15 : 5;\n let scaleY = 1;\n let scaleZ = vec3.length(direction);\n let scaleVector = vec3.fromValues(scaleX, scaleY, scaleZ);\n let transformationMat = mat4.create();\n mat4.fromRotationTranslationScale(transformationMat, rotationQuat, translate, scaleVector);\n return transformationMat;\n }", "get localTransform() {\n // use simple caching to save on this calculation\n const key = `${this.translateX},${this.translateY},${this.width},${this.height},${this.scale},${this.rotate}`;\n if (this.transformCachedKey !== key) {\n // update cache key\n this.transformCachedKey = key;\n // our local transform\n this.transform.translate = new Vector2D(this.translateX, this.translateY);\n this.transform.rotate = this.rotate;\n this.transform.scale = new Vector2D(this.scale, this.scale);\n this.matrixCached = this.transform.getTransformationMatrix(this.width, this.height);\n }\n return this.matrixCached.clone();\n }", "function translate( x, y, z )\n{\n if(arguments.length!=2 && arguments.length != 3) {\n throw \"translate(): not a mat3 or mat4\";\n }\n if(arguments.length == 2) {\n result = mat3();\n result[0][2] = x;\n result[1][2] = y;\n\n return result;\n }\n result = mat4();\n\n result[0][3] = x;\n result[1][3] = y;\n result[2][3] = z;\n\n return result;\n\n}", "translationMat3v(v, dest) {\n const m = dest || math.identityMat3();\n m[6] = v[0];\n m[7] = v[1];\n return m;\n }", "getTransformMatrix() {\n return Matrix.from(this.element);\n }", "static make3DTranslationMatrix(vector){\n if(vector.length == null || vector.length != 3){\n return null;\n }\n let M = Matrix.makeIdentity(4,4);\n M.matrix[0][3] = vector[0];\n M.matrix[1][3] = vector[1];\n M.matrix[2][3] = vector[2];\n return M;\n}", "toRotMat3x3(m) {\nreturn RQ.setRotMat3x3FromQV(m, this.xyzw, true, true);\n}", "OLDtranslateMat4c(x, y, z, m) {\n\n const m12 = m[12];\n m[0] += m12 * x;\n m[4] += m12 * y;\n m[8] += m12 * z;\n\n const m13 = m[13];\n m[1] += m13 * x;\n m[5] += m13 * y;\n m[9] += m13 * z;\n\n const m14 = m[14];\n m[2] += m14 * x;\n m[6] += m14 * y;\n m[10] += m14 * z;\n\n const m15 = m[15];\n m[3] += m15 * x;\n m[7] += m15 * y;\n m[11] += m15 * z;\n\n return m;\n }", "get transformationMatrix() {\n // bring in parent if we have one, otherwise just our matrix\n return this.parent\n ? this.parent.transformationMatrix.multiplyMatrix(this.localTransform)\n : this.localTransform;\n }", "function Matrix3() {\n\t\tthis.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]);\n\t}", "function getscaleMatrix(x,y,z){\n var obj = new THREE.Matrix4().set(x,0,0,0, 0,y,0,0, 0,0,z,0, 0,0,0,1);\n return obj;\n}", "get modelViewMatrixTranspose$() {\n\t\treturn (this._mv.t || (this._mv.t = SpiderGL.Math.Mat4.transpose(this.modelViewMatrix$)));\n\t}", "function computeTMatrixFromTransforms(params) {\n var defaults = {\n pos: [0, 0, 0],\n rot: [0, 0, 0],\n sca: [1, 1, 1]\n };\n\n var _Object$assign = Object.assign({}, defaults, params),\n pos = _Object$assign.pos,\n rot = _Object$assign.rot,\n sca = _Object$assign.sca;\n // create transform matrix\n\n\n var transforms = _glMat2.default.identity([]);\n _glMat2.default.translate(transforms, transforms, pos); // [pos[0], pos[2], pos[1]]// z up\n _glMat2.default.rotateX(transforms, transforms, rot[0]);\n _glMat2.default.rotateY(transforms, transforms, rot[1]);\n _glMat2.default.rotateZ(transforms, transforms, rot[2]);\n _glMat2.default.scale(transforms, transforms, sca); // [sca[0], sca[2], sca[1]])\n\n return transforms;\n}", "function makeTranslationMatrix(x, y, z){\n var col1 = Vec4(1, 0, 0, x),\n col2 = Vec4(0, 1, 0, y),\n col3 = Vec4(0, 0, 1, z),\n col4 = Vec4(0, 0, 0, 1)\n return Mat4(col1, col2, col3, col4)\n }", "function matrix( transform ) {\n\ttransform = transform.split(\")\");\n\tvar\n\t\t\ttrim = $.trim\n\t\t, i = -1\n\t\t// last element of the array is an empty string, get rid of it\n\t\t, l = transform.length -1\n\t\t, split, prop, val\n\t\t, prev = supportFloat32Array ? new Float32Array(6) : []\n\t\t, curr = supportFloat32Array ? new Float32Array(6) : []\n\t\t, rslt = supportFloat32Array ? new Float32Array(6) : [1,0,0,1,0,0]\n\t\t;\n\n\tprev[0] = prev[3] = rslt[0] = rslt[3] = 1;\n\tprev[1] = prev[2] = prev[4] = prev[5] = 0;\n\n\t// Loop through the transform properties, parse and multiply them\n\twhile ( ++i < l ) {\n\t\tsplit = transform[i].split(\"(\");\n\t\tprop = trim(split[0]);\n\t\tval = split[1];\n\t\tcurr[0] = curr[3] = 1;\n\t\tcurr[1] = curr[2] = curr[4] = curr[5] = 0;\n\n\t\tswitch (prop) {\n\t\t\tcase _translate+\"X\":\n\t\t\t\tcurr[4] = parseInt(val, 10);\n\t\t\t\tbreak;\n\n\t\t\tcase _translate+\"Y\":\n\t\t\t\tcurr[5] = parseInt(val, 10);\n\t\t\t\tbreak;\n\n\t\t\tcase _translate:\n\t\t\t\tval = val.split(\",\");\n\t\t\t\tcurr[4] = parseInt(val[0], 10);\n\t\t\t\tcurr[5] = parseInt(val[1] || 0, 10);\n\t\t\t\tbreak;\n\n\t\t\tcase _rotate:\n\t\t\t\tval = toRadian(val);\n\t\t\t\tcurr[0] = Math.cos(val);\n\t\t\t\tcurr[1] = Math.sin(val);\n\t\t\t\tcurr[2] = -Math.sin(val);\n\t\t\t\tcurr[3] = Math.cos(val);\n\t\t\t\tbreak;\n\n\t\t\tcase _scale+\"X\":\n\t\t\t\tcurr[0] = +val;\n\t\t\t\tbreak;\n\n\t\t\tcase _scale+\"Y\":\n\t\t\t\tcurr[3] = val;\n\t\t\t\tbreak;\n\n\t\t\tcase _scale:\n\t\t\t\tval = val.split(\",\");\n\t\t\t\tcurr[0] = val[0];\n\t\t\t\tcurr[3] = val.length>1 ? val[1] : val[0];\n\t\t\t\tbreak;\n\n\t\t\tcase _skew+\"X\":\n\t\t\t\tcurr[2] = Math.tan(toRadian(val));\n\t\t\t\tbreak;\n\n\t\t\tcase _skew+\"Y\":\n\t\t\t\tcurr[1] = Math.tan(toRadian(val));\n\t\t\t\tbreak;\n\n\t\t\tcase _matrix:\n\t\t\t\tval = val.split(\",\");\n\t\t\t\tcurr[0] = val[0];\n\t\t\t\tcurr[1] = val[1];\n\t\t\t\tcurr[2] = val[2];\n\t\t\t\tcurr[3] = val[3];\n\t\t\t\tcurr[4] = parseInt(val[4], 10);\n\t\t\t\tcurr[5] = parseInt(val[5], 10);\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// Matrix product (array in column-major order)\n\t\trslt[0] = prev[0] * curr[0] + prev[2] * curr[1];\n\t\trslt[1] = prev[1] * curr[0] + prev[3] * curr[1];\n\t\trslt[2] = prev[0] * curr[2] + prev[2] * curr[3];\n\t\trslt[3] = prev[1] * curr[2] + prev[3] * curr[3];\n\t\trslt[4] = prev[0] * curr[4] + prev[2] * curr[5] + prev[4];\n\t\trslt[5] = prev[1] * curr[4] + prev[3] * curr[5] + prev[5];\n\n\t\tprev = [rslt[0],rslt[1],rslt[2],rslt[3],rslt[4],rslt[5]];\n\t}\n\treturn rslt;\n}", "get modelViewMatrixTranspose() {\n\t\treturn SpiderGL.Math.Mat4.dup(this.modelViewMatrixTranspose$);\n\t}", "mat4To3(m) {\n return [\n m[0], m[1], m[2],\n m[4], m[5], m[6],\n m[8], m[9], m[10]\n ];\n }", "function getTransformMatrix(m, position, angle, rotation, type) {\r\n // Update position based on previous node scale\r\n var s = 1;\r\n if (type === 'perno_f') {\r\n s = scalings.get('falange_c') - 1;\r\n } else if (type === 'falangina_t') {\r\n s = scalings.get('falangina_c');\r\n }\r\n // Position\r\n m = mult(m, translate(position[0], position[1] * s, position[2]));\r\n // Rotations\r\n m = mult(m, rotate(angle[0], vec3(1, 0, 0)));\r\n m = mult(m, rotate(angle[1], vec3(0, 1, 0)));\r\n m = mult(m, rotate(angle[2], vec3(0, 0, 1)));\r\n m = mult(m, rotate(rotation[0], vec3(1, 0, 0)));\r\n m = mult(m, rotate(rotation[1], vec3(0, 1, 0)));\r\n m = mult(m, rotate(rotation[2], vec3(0, 0, 1)));\r\n return m;\r\n}", "get transpose$() {\n\t\treturn (this._t || (this._t = SpiderGL.Math.Mat4.transpose(this._m)));\n\t}", "apply(){\n var transform = mat4.create();\n mat4.identity(transform);\n\n mat4.translate(transform, transform, [this.x_center,this.y_center,this.z_center]);\n mat4.rotate(transform, transform, this.elapsedAngle, [0, 1, 0]);\n\n mat4.translate(transform,transform,[this.radius,0,0]);\n\n if(this.direction == 1){\n mat4.rotate(transform,transform,Math.PI,[0,1,0]);\n }\n return transform;\n }", "get modelViewProjectionMatrixTranspose$() {\n\t\treturn (this._mvp.t || (this._mvp.t = SpiderGL.Math.Mat4.transpose(this.modelViewProjectionMatrix$)));\n\t}", "get viewProjectionMatrixTranspose() {\n\t\treturn SpiderGL.Math.Mat4.dup(this.viewProjectionMatrixTranspose$);\n\t}", "get projectionMatrixTranspose() {\n\t\treturn this._p.transpose;\n\t}", "get modelViewProjectionMatrixTranspose() {\n\t\treturn SpiderGL.Math.Mat4.dup(this.modelViewProjectionMatrixTranspose$);\n\t}", "get viewProjectionMatrixTranspose$() {\n\t\treturn (this._vp.t || (this._vp.t = SpiderGL.Math.Mat4.transpose(this.viewProjectionMatrix$)));\n\t}", "get viewMatrixTranspose() {\n\t\treturn this._v.transpose;\n\t}", "transpose() {\n let result = new Matrix();\n result._matrix = ExtMath.transpose(this._matrix);\n return result;\n }", "transformVec3(v, out) {\n //GLSL - vecQuatRotation(model.rotation, a_position.xyz * model.scale) + model.position;\n return (out || v)\n .fromMul(v, this.scl)\n .transformQuat(this.rot)\n .add(this.pos);\n }", "transformed(transformation) {\n let rotateVertex = ([x, y, z]) => mult(transformation, [x, y, z, 1]).slice(0, 3),\n rotateNormal = ([x, y, z]) => normalize(mult(transformation, [x, y, z, 1]).slice(0, 3));\n\n let vertices = this.vertices.map(rotateVertex),\n faceNormals = this.faceNormals.map(rotateNormal),\n vertexNormals = this.vertexNormals.map(rotateNormal);\n\n return new Mesh(vertices, this.faces, faceNormals, vertexNormals, false);\n }", "function getTransform(elem) {\r\n const computedStyle = getComputedStyle(elem, null);\r\n const val = computedStyle.transform;\r\n const matrix = parseMatrix(val);\r\n const rotateY = Math.asin(-matrix.m13)\r\n const rotateX = Math.atan2(matrix.m23, matrix.m33);\r\n const rotateZ = Math.atan2(matrix.m12, matrix.m11);\r\n return {\r\n transformStyle: val,\r\n matrix: matrix,\r\n rotate: {\r\n x: rotateX,\r\n y: rotateY,\r\n z: rotateZ\r\n },\r\n translate: {\r\n x: matrix.m41,\r\n y: matrix.m42,\r\n z: matrix.m43\r\n }\r\n };\r\n}", "setFromRotMat3x3(m) {\nvar DIV_4W, EPS, SQRT_T, T, dorotx, doroty, dorotz, tx, ty, tz;\n//---------------\n// The given matrix is :\n// m[0] m[3] m[6] m00 m01 m02\n// m[1] m[4] m[7] == m10 m11 m12\n// m[2] m[5] m[8] m20 m21 m22\nEPS = 1e-4;\n[tx, ty, tz] = [m[0], m[4], m[8]];\nT = tx + ty + tz + 1;\nif (1 <= T + EPS) {\n// Normal case: 1 <= T\nSQRT_T = Math.sqrt(T);\nDIV_4W = 0.5 / SQRT_T;\nthis.set_xyzw((m[5] - m[7]) * DIV_4W, (m[6] - m[2]) * DIV_4W, (m[1] - m[3]) * DIV_4W, 0.5 * SQRT_T); // m21 - m12 // m02 - m20 // m10 - m01\n} else {\n// To avoid instability, we need to adjust both the matrix\n// m and the quaternion (this) by introducing a prior\n// rotation by PI about one of the three axes (X, Y or Z).\n// First, decide which axis by finding the one with the\n// largest t-value:\ndorotx = doroty = dorotz = false;\nif (tz <= ty) {\nif (ty <= tx) {\ndorotx = true;\n} else {\ndoroty = true;\n}\n} else {\nif (tz <= tx) {\ndorotx = true;\n} else {\ndorotz = true;\n}\n}\nif (dorotx) {\nthis._setFromMatWithXRot(m);\n} else if (doroty) {\nthis._setFromMatWithYRot(m);\n} else if (dorotz) {\nthis._setFromMatWithZRot(m);\n}\n}\nreturn this;\n}", "function d3_v3_transform(m) {\n var r0 = [m.a, m.b],\n r1 = [m.c, m.d],\n kx = d3_v3_transformNormalize(r0),\n kz = d3_v3_transformDot(r0, r1),\n ky = d3_v3_transformNormalize(d3_v3_transformCombine(r1, r0, -kz)) || 0;\n if (r0[0] * r1[1] < r1[0] * r0[1]) {\n r0[0] *= -1;\n r0[1] *= -1;\n kx *= -1;\n kz *= -1;\n }\n this.rotate = (kx ? Math.atan2(r0[1], r0[0]) : Math.atan2(-r1[0], r1[1])) * d3_v3_transformDegrees;\n this.translate = [m.e, m.f];\n this.scale = [kx, ky];\n this.skew = ky ? Math.atan2(kz, ky) * d3_v3_transformDegrees : 0;\n}", "convertToMat4x4(m) {\n//--------------\nm[3] = m[7] = m[11] = 0;\nTRX.setMat4x4Trans(m, this._t);\nreturn TRX.setMat4x4Rot(m, this._r);\n}", "get modelMatrixTranspose() {\n\t\treturn this._m.transpose;\n\t}", "get viewMatrix() {\n if (!this._viewMatrix) {\n return this.scene.camera.viewMatrix;\n }\n if (this._viewMatrixDirty) {\n math.mulMat4(this.scene.camera.viewMatrix, this._worldMatrix, this._viewMatrix);\n math.inverseMat4(this._viewMatrix, this._viewNormalMatrix);\n math.transposeMat4(this._viewNormalMatrix);\n this._viewMatrixDirty = false;\n }\n return this._viewMatrix;\n }", "function getTransforms(translate3d){\r\n return {\r\n '-webkit-transform': translate3d,\r\n '-moz-transform': translate3d,\r\n '-ms-transform':translate3d,\r\n 'transform': translate3d\r\n };\r\n }", "function getTransforms(translate3d){\r\n return {\r\n '-webkit-transform': translate3d,\r\n '-moz-transform': translate3d,\r\n '-ms-transform':translate3d,\r\n 'transform': translate3d\r\n };\r\n }", "function getTransforms(translate3d){\r\n return {\r\n '-webkit-transform': translate3d,\r\n '-moz-transform': translate3d,\r\n '-ms-transform':translate3d,\r\n 'transform': translate3d\r\n };\r\n }", "function getTransforms(translate3d){\r\n return {\r\n '-webkit-transform': translate3d,\r\n '-moz-transform': translate3d,\r\n '-ms-transform':translate3d,\r\n 'transform': translate3d\r\n };\r\n }", "function getTransforms(translate3d){\r\n return {\r\n '-webkit-transform': translate3d,\r\n '-moz-transform': translate3d,\r\n '-ms-transform':translate3d,\r\n 'transform': translate3d\r\n };\r\n }", "function getMatrix(obj) {\n\t\t var matrix = obj.css(\"-webkit-transform\") ||\n\t\t obj.css(\"-moz-transform\") ||\n\t\t obj.css(\"-ms-transform\") ||\n\t\t obj.css(\"-o-transform\") ||\n\t\t obj.css(\"transform\");\n\t\t return matrix;\n\t\t}", "function getMatrix(obj) {\n\t\t var matrix = obj.css(\"-webkit-transform\") ||\n\t\t obj.css(\"-moz-transform\") ||\n\t\t obj.css(\"-ms-transform\") ||\n\t\t obj.css(\"-o-transform\") ||\n\t\t obj.css(\"transform\");\n\t\t return matrix;\n\t\t}", "function getMatrix(obj) {\n\t\t var matrix = obj.css(\"-webkit-transform\") ||\n\t\t obj.css(\"-moz-transform\") ||\n\t\t obj.css(\"-ms-transform\") ||\n\t\t obj.css(\"-o-transform\") ||\n\t\t obj.css(\"transform\");\n\t\t return matrix;\n\t\t}", "get projectionMatrixTranspose$() {\n\t\treturn this._p.transpose$;\n\t}", "translateMat4v(xyz, m) {\n return math.translateMat4c(xyz[0], xyz[1], xyz[2], m);\n }", "function getModelMatrix (rb) {\n var ms = rb.getMotionState()\n\n if (ms) {\n ms.getWorldTransform(transformTemp)\n var p = transformTemp.getOrigin()\n var q = transformTemp.getRotation()\n\n return mat4.fromRotationTranslation(\n [], [q.x(), q.y(), q.z(), q.w()], [p.x(), p.y(), p.z()])\n }\n}", "get transpose() {\n\t\treturn SpiderGL.Math.Mat4.dup(this.transpose$);\n\t}", "multNormalMatrix(matrix) {\n let x = this[0];\n let y = this[1];\n let z = this[2];\n\n let S = new J3DIMatrix4(matrix);\n S.invert();\n S.transpose();\n\n this[0] = S.$matrix.m41 + x * S.$matrix.m11 + y * S.$matrix.m21 + z * S.$matrix.m31;\n this[1] = S.$matrix.m42 + x * S.$matrix.m12 + y * S.$matrix.m22 + z * S.$matrix.m32;\n this[2] = S.$matrix.m43 + x * S.$matrix.m13 + y * S.$matrix.m23 + z * S.$matrix.m33;\n let w = S.$matrix.m44 + x * S.$matrix.m14 + y * S.$matrix.m24 + z * S.$matrix.m34;\n if (w != 1 && w != 0) {\n this[0] /= w;\n this[1] /= w;\n this[2] /= w;\n }\n\n return this;\n }", "function Transform() {\n this.position = new Vector3();\n this.orientation = new Quaternion();\n this.scale = 1;\n this._invalidate();\n this.matrix = new Matrix4();\n}", "function getTransforms(translate3d){\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform':translate3d,\n 'transform': translate3d\n };\n }", "function getTransforms(translate3d){\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform':translate3d,\n 'transform': translate3d\n };\n }", "function getTransforms(translate3d){\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform':translate3d,\n 'transform': translate3d\n };\n }", "function getTransforms(translate3d){\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform':translate3d,\n 'transform': translate3d\n };\n }", "function getTransforms(translate3d){\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform':translate3d,\n 'transform': translate3d\n };\n }", "function getTransforms(translate3d){\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform':translate3d,\n 'transform': translate3d\n };\n }", "function getTransforms(translate3d){\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform':translate3d,\n 'transform': translate3d\n };\n }", "toRotMatRows3x4(m) {\n//--------------\nreturn RQ.setRotMatRows3x4FromQV(m, this.xyzw, false, false, false);\n}", "parseTranslate(matrix, transformation, transformationID) {\r\n var args = this.parseCoordinates3D(transformation, transformationID); //parse translate arguments\r\n if (!Array.isArray(args)) {\r\n this.onXMLError(\"Error while parsing coords (\" + args + \") in: \" + transformationID);\r\n return matrix;\r\n }\r\n\r\n matrix = mat4.translate(matrix, matrix, args);\r\n return matrix;\r\n }", "function createTransformMatrix(transformStack){\n var resultTransformMatrix = identityMatrix;\n var transformMatrix;\n for(i = 0 ; i < transformStack.length; i++){\n if(transformStack[i][0] == 'R'){\n transformMatrix = createRotateMatrix(transformStack[i][1]);\n }\n else if(transformStack[i][0] == 'S'){\n transformMatrix = createScaleMatrix(transformStack[i][1]);\n }\n else{\n transformMatrix = createTranslateMatrix(transformStack[i][1]);\n }\n resultTransformMatrix = mat4Multiply(transformMatrix, resultTransformMatrix);\n }\n}", "updateViewMatrix() {\n //Optimize camera transform update, no need for scale nor rotateZ\n if (this.mode == 0) {\n this.transform.matView.reset()\n .vtranslate(this.transform.position)\n .rotateX(this.transform.rotation.x * this.transform.deg2Rad)\n .rotateY(this.transform.rotation.y * this.transform.deg2Rad);\n }\n else {\n this.transform.matView.reset()\n .rotateX(this.transform.rotation.x * this.transform.deg2Rad)\n .rotateY(this.transform.rotation.y * this.transform.deg2Rad)\n .vtranslate(this.transform.position);\n }\n this.transform.updateDirection();\n //Cameras work by doing the inverse transformation on all meshes, the camera itself is a lie :)\n C_Matrix4.invert(this.viewMatrix, this.transform.matView.raw);\n return this.viewMatrix;\n }", "function getRotMatrix(p, str){\n switch(str)\n {case \"x\":\n var obj = new THREE.Matrix4().set(1, 0, 0, 0, \n 0, Math.cos(p),-Math.sin(p), 0, \n 0, Math.sin(p), Math.cos(p), 0,\n 0, 0, 0, 1);\n return obj;\n break;\n\n case \"y\":\n var obj = new THREE.Matrix4().set(Math.cos(p), 0, -Math.sin(p), 0, \n 0, 1, 0, 0, \n Math.sin(p), 0, Math.cos(p), 0,\n 0, 0, 0, 1);\n return obj;\n break;\n\n case \"z\":\n var obj = new THREE.Matrix4().set(Math.cos(p), -Math.sin(p), 0, 0, \n Math.sin(p), Math.cos(p), 0, 0, \n 0, 0, 1, 0,\n 0, 0, 0, 1);\n return obj;\n break;\n\n\n default:\n break;\n\n }\n\n}", "function Aff3d() {\r\n\r\n this.values = new Float32Array(16);\r\n\r\n this.setToZero = function() {\r\n var i;\r\n for(i=0; i<16; ++i) this.values[i] = 0;\r\n }\r\n\r\n this.setToIdentity = function() {\r\n var i;\r\n for(i=0; i<16; ++i) this.values[i] = 0;\r\n for(i=0; i< 4; ++i) this.values[4*i+i] = 1;\r\n }\r\n\r\n // Calculates a camera matrix\r\n this.lookAt = function(pos, center, up) {\r\n if(pos.sub(center).norm2() == 0) {\r\n this.setToIdentity();\r\n } else {\r\n\r\n var dirNormalized = center.sub(pos).normalize();\r\n var somehowUpNormalized = up.normalize();\r\n var thirdDirection = dirNormalized.cross(somehowUpNormalized).normalize();\r\n var upNormalized = thirdDirection.cross(dirNormalized).normalize();\r\n\r\n this.values[ 0] = thirdDirection.x;\r\n this.values[ 4] = thirdDirection.y;\r\n this.values[ 8] = thirdDirection.z;\r\n\r\n this.values[ 1] = upNormalized.x;\r\n this.values[ 5] = upNormalized.y;\r\n this.values[ 9] = upNormalized.z; \r\n\r\n this.values[ 2] = -dirNormalized.x;\r\n this.values[ 6] = -dirNormalized.y;\r\n this.values[10] = -dirNormalized.z;\r\n\r\n this.values[ 3] = 0;\r\n this.values[ 7] = 0;\r\n this.values[11] = 0;\r\n this.values[15] = 1;\r\n\r\n this.values[12] = -thirdDirection.dot(pos);\r\n this.values[13] = -upNormalized.dot(pos);\r\n this.values[14] = dirNormalized.dot(pos); \r\n }\r\n }\r\n\r\n // Calculates a projection matrix\r\n this.perspective = function(fovy, aspect, near, far) {\r\n this.setToZero();\r\n var f = cot(fovy * Math.PI / 360.0);\r\n this.values[ 0] = f / aspect;\r\n this.values[ 5] = f;\r\n this.values[10] = (far + near) / (near - far);\r\n this.values[11] = -1;\r\n this.values[14] = (2 * far * near) / (near - far);\r\n }\r\n\r\n this.data = function() {\r\n return this.values;\r\n }\r\n }", "matrixArrayToCssMatrix(array) {\n return 'matrix3d(' + array.join(',') + ')';\n }", "function translate(Out, A, V) {\n /*\n * 1 0 0 x\n * 0 1 0 y\n * Out = A × 0 0 1 z\n * 0 0 0 1\n */\n Out = Out|0; // mat4\n A = A|0; // mat4\n V = V|0; // vec3\n var x = 0.0,\n y = 0.0,\n z = 0.0;\n x = +vec3_get(~~V, 0);\n y = +vec3_get(~~V, 1);\n z = +vec3_get(~~V, 2);\n if((A|0) != (Out|0)) {\n copy(Out, A);\n }\n set(Out, 0, 3, +get(A, 0, 0) * x + +get(A, 0, 1) * y + +get(A, 0, 2) * z + +get(A, 0, 3));\n set(Out, 1, 3, +get(A, 1, 0) * x + +get(A, 1, 1) * y + +get(A, 1, 2) * z + +get(A, 1, 3));\n set(Out, 2, 3, +get(A, 2, 0) * x + +get(A, 2, 1) * y + +get(A, 2, 2) * z + +get(A, 2, 3));\n set(Out, 3, 3, +get(A, 3, 0) * x + +get(A, 3, 1) * y + +get(A, 3, 2) * z + +get(A, 3, 3));\n return;\n }", "transpose()\r\n {\r\n var newArray = [];\r\n\r\n // dimensions are inversed (new matrix has n rows and m columns)\r\n for (var r = 0; r < this.n; r++)\r\n newArray.push([]);\r\n\r\n // loop through matrix in column-major order\r\n // add each element to new matrix in row-major order\r\n for (var c = 0; c < this.n; c++)\r\n {\r\n for (var r = 0; r < this.m; r++)\r\n newArray[c][r] = this.matrix[r][c];\r\n }\r\n return new Matrix(newArray);\r\n }", "function getTranslate3d(){\n if (options.direction !== 'vertical') {\n return 'translate3d(100%, 0px, 0px)';\n }\n\n return 'translate3d(0px, 100%, 0px)';\n }", "function getTransform(target, ancestor) {\n var mat = zrender_lib_core_matrix__WEBPACK_IMPORTED_MODULE_1__[/* identity */ \"d\"]([]);\n\n while (target && target !== ancestor) {\n zrender_lib_core_matrix__WEBPACK_IMPORTED_MODULE_1__[/* mul */ \"f\"](mat, target.getLocalTransform(), mat);\n target = target.parent;\n }\n\n return mat;\n}", "function gTranslate(x,y,z) {\n modelMatrix = mult(translate(x,y,z), modelMatrix) ;\n}", "get viewNormalMatrix() {\n if (!this._viewNormalMatrix) {\n return this.scene.camera.viewNormalMatrix;\n }\n if (this._viewMatrixDirty) {\n math.mulMat4(this.scene.camera.viewMatrix, this._worldMatrix, this._viewMatrix);\n math.inverseMat4(this._viewMatrix, this._viewNormalMatrix);\n math.transposeMat4(this._viewNormalMatrix);\n this._viewMatrixDirty = false;\n }\n return this._viewNormalMatrix;\n }", "setRotationMatrix3(rotationMatrix3) {\n this._m0.gain.value = rotationMatrix3[0];\n this._m1.gain.value = rotationMatrix3[1];\n this._m2.gain.value = rotationMatrix3[2];\n this._m3.gain.value = rotationMatrix3[3];\n this._m4.gain.value = rotationMatrix3[4];\n this._m5.gain.value = rotationMatrix3[5];\n this._m6.gain.value = rotationMatrix3[6];\n this._m7.gain.value = rotationMatrix3[7];\n this._m8.gain.value = rotationMatrix3[8];\n }", "static getTransform ({ x = null, y = null, zoom = null }) {\n const transforms = []\n if (x !== null || y !== null) {\n transforms.push(`translate3d(${x || 0}px,${y || 0}px,0)`)\n }\n if (zoom !== null) {\n transforms.push(`scale3d(${zoom},${zoom},1)`)\n }\n return { transform: transforms.length === 0 ? 'none' : transforms.join(' ') }\n }", "static getIdentity() {\n const transform = new Transform();\n\n transform[0] = [1, 0, 0, 0];\n transform[1] = [0, 1, 0, 0];\n transform[2] = [0, 0, 1, 0];\n transform[3] = [0, 0, 0, 1];\n\n return transform;\n }", "get viewMatrixTranspose$() {\n\t\treturn this._v.transpose$;\n\t}", "static getTransform({ x = 0, y = 0, zoom = 1, width, targetWidth }) {\n let nextX = x;\n const windowWidth = getWindowWidth();\n if (width > windowWidth) {\n nextX += (windowWidth - width) / 2;\n }\n const scaleFactor = zoom * (targetWidth / width);\n\n return {\n transform: `translate3d(${nextX}px,${y}px,0) scale3d(${scaleFactor},${scaleFactor},1)`,\n };\n }", "get modelMatrixTranspose$() {\n\t\treturn this._m.transpose$;\n\t}", "transformed(transform){\n let result = new AffineTransform();\n\n result.position = this.position.copy();\n result.position.mult(transform.scale);\n\n let rotated = new p5.Vector(result.position.x, result.position.y).rotate(transform.rotation);\n\n result.position.x = rotated.x;\n result.position.y = rotated.y;\n result.position.add(transform.position);\n\n result.scale = this.scale.copy();\n result.scale.mult(transform.scale);\n\n result.rotation = this.rotation + transform.rotation;\n\n return result;\n }", "init_tran(x, y, z) {\n this.ctm = mult(this.ctm, translate(x, y, z));\n\n\n }", "get modelViewMatrixInverseTranspose$() {\n\t\treturn (this._mv.it || (this._mv.it = SpiderGL.Math.Mat4.transpose(this.modelViewMatrixInverse$)));\n\t}", "function GetModelViewMatrix( translationX, translationY, translationZ, rotationX, rotationY )\n{\n\t// [TO-DO] Modify the code below to form the transformation matrix.\n\tvar trans = [\n\t\t1, 0, 0, 0,\n\t\t0, 1, 0, 0,\n\t\t0, 0, 1, 0,\n\t\ttranslationX, translationY, translationZ, 1\n\t];\n\tvar Xrotation = [\n\t\t1, 0 ,0 ,0,\n\t\t0, cos(rotationX), sin(rotationX), 0,\n\t\t0, -sin(rotationX), cos(rotationX), 0,\n\t\t0, 0, 0, 1\n\t];\n\tvar Yrotation = [\n\t\tcos(rotationY), 0, -sin(rotationY), 0,\n\t\t0, 1, 0, 0,\n\t\tsin(rotationY), 0, cos(rotationY), 0,\n\t\t0, 0, 0, 1\n\t];\n\n\tvar mv = MatrixMult(trans,MatrixMult(Xrotation, Yrotation));\n\treturn mv;\n}", "function d3_transform(m) {\n var r0 = [m.a, m.b],\n r1 = [m.c, m.d],\n kx = d3_transformNormalize(r0),\n kz = d3_transformDot(r0, r1),\n ky = d3_transformNormalize(d3_transformCombine(r1, r0, -kz)) || 0;\n if (r0[0] * r1[1] < r1[0] * r0[1]) {\n r0[0] *= -1;\n r0[1] *= -1;\n kx *= -1;\n kz *= -1;\n }\n this.rotate = (kx ? Math.atan2(r0[1], r0[0]) : Math.atan2(-r1[0], r1[1])) * d3_transformDegrees;\n this.translate = [m.e, m.f];\n this.scale = [kx, ky];\n this.skew = ky ? Math.atan2(kz, ky) * d3_transformDegrees : 0;\n}", "function d3_transform(m) {\n var r0 = [m.a, m.b],\n r1 = [m.c, m.d],\n kx = d3_transformNormalize(r0),\n kz = d3_transformDot(r0, r1),\n ky = d3_transformNormalize(d3_transformCombine(r1, r0, -kz)) || 0;\n if (r0[0] * r1[1] < r1[0] * r0[1]) {\n r0[0] *= -1;\n r0[1] *= -1;\n kx *= -1;\n kz *= -1;\n }\n this.rotate = (kx ? Math.atan2(r0[1], r0[0]) : Math.atan2(-r1[0], r1[1])) * d3_transformDegrees;\n this.translate = [m.e, m.f];\n this.scale = [kx, ky];\n this.skew = ky ? Math.atan2(kz, ky) * d3_transformDegrees : 0;\n}", "createFinalMatrix(){\n this.matrix = mat4.create(); \n\n // Fetches the translation\n const translateCoordinates = [0, 0, 0];\n\n // Computes the matrix\n this.matrix = mat4.translate(this.matrix, this.matrix, translateCoordinates);\n }", "get modelViewMatrixInverseTranspose() {\n\t\treturn SpiderGL.Math.Mat4.dup(this.modelViewMatrixInverseTranspose$);\n\t}", "getRotationMatrix(matrix = new three_1.Matrix4()) {\n return matrix.makeBasis(this.xAxis, this.yAxis, this.zAxis);\n }", "transpose() {\n let result = new Matrix(this.width, this.height);\n\n for (let i = 0; i < this.height; i++) {\n for (let j = 0; j < this.width; j++) {\n // current (i, j) position is (j, i) position in new Matrix\n result.data[j][i] = this.data[i][j];\n }\n }\n\n return result;\n }", "function getTransform(el) {\n // @ts-ignore\n var transform = window.getComputedStyle(el)[transformProperty];\n if (!transform || transform === 'none') {\n transform = 'matrix(1, 0, 0, 1, 0, 0)';\n }\n return transform.replace(/\\(|\\)|matrix|\\s+/g, '').split(',');\n}", "function transformMatrix( matIn, matOut, type, x, y, z, rad ) {\n let transform = glMatrix.mat4.create();\n \n if( type == 's' ) {\n glMatrix.mat4.scale( matOut, matIn, [x, y, z] );\n } else if ( type == 't' ) {\n glMatrix.mat4.translate( matOut, matIn, [x, y, z]);\n } else if( type == 'rx' ) {\n glMatrix.mat4.rotateX( matOut, matIn, rad );\n } else if( type == 'ry' ) {\n glMatrix.mat4.rotateY( matOut, matIn, rad );\n } else if( type == 'rz' ) {\n glMatrix.mat4.rotateZ( matOut, matIn, rad );\n }\n return matOut;\n}", "static translation(v)\n\t{\n\t\t// TODO construct a 4x4 translation matrix for a translation along\n\t\t// the 3D vector v\n\t\treturn new Float32Array([\n\t\t\t1, 0, 0, 0, \n\t\t\t0, 1, 0, 0, \n\t\t\t0, 0, 1, 0, \n\t\t\tv.x, v.y, v.z, 1]);\n\t}", "function generate_translation_matrix(tx, ty, tz) {\n let mat = generate_identity(4);\n mat[0][3] = tx;\n mat[1][3] = ty;\n mat[2][3] = tz;\n return mat;\n}", "function getTransforms(translate3d) {\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform': translate3d,\n 'transform': translate3d\n };\n }", "getWorldMatrix(rotation, dir) {\n Vec3.negate(_dir_negate, dir);\n\n const distance = Math.sqrt(2) * this._sphere.radius;\n\n Vec3.multiplyScalar(_vec3_p, _dir_negate, distance);\n Vec3.add(_vec3_p, _vec3_p, this._sphere.center);\n Mat4.fromRT(_mat4_trans, rotation, _vec3_p);\n return _mat4_trans;\n }", "function matrice3x(...nc){\n\tvar A3x, B3x, C3x;\n\tmatrice2x(nc[4], nc[5], nc[7], nc[8]);\n\tA3x = nc[0] * result2x;\n\tmatrice2x(nc[1], nc[2], nc[7], nc[8]);\n\tB3x = nc[3] * result2x;\n\tmatrice2x(nc[1], nc[2], nc[4], nc[5]);\n\tC3x = nc[6] * result2x;\n\tresult3x = A3x - B3x + C3x;\n}", "function getTransforms(translate3d) {\n return {\n '-webkit-transform': translate3d,\n '-moz-transform': translate3d,\n '-ms-transform': translate3d,\n 'transform': translate3d\n };\n }", "get modelViewMatrix$() {\n\t\treturn (this._mv.m || (this._mv.m = SpiderGL.Math.Mat4.mul(this.viewMatrix$, this.modelMatrix$)));\n\t}", "get viewProjectionMatrixInverseTranspose() {\n\t\treturn SpiderGL.Math.Mat4.dup(this.viewProjectionMatrixInverseTranspose$);\n\t}" ]
[ "0.75727534", "0.7211375", "0.7081503", "0.70688283", "0.7024047", "0.6907114", "0.6874175", "0.6870416", "0.68625015", "0.6768968", "0.6766473", "0.6758295", "0.67460614", "0.6712685", "0.66226155", "0.65945375", "0.6571049", "0.6561792", "0.6559732", "0.6504042", "0.6481886", "0.64397496", "0.64270735", "0.6397393", "0.63925725", "0.63763595", "0.6341777", "0.6331388", "0.6330764", "0.6330112", "0.63232034", "0.6271013", "0.6267741", "0.62662965", "0.6265016", "0.6212963", "0.6209477", "0.6200689", "0.6192245", "0.619224", "0.6173434", "0.6173434", "0.6173434", "0.6173434", "0.6173434", "0.6172369", "0.6172369", "0.6172369", "0.6164896", "0.61517614", "0.61483115", "0.61444193", "0.61400044", "0.61374456", "0.6123908", "0.6123908", "0.6123908", "0.6123908", "0.6123908", "0.6123908", "0.6123908", "0.6114152", "0.61129487", "0.61082864", "0.60968894", "0.608109", "0.60397875", "0.60389274", "0.60377985", "0.6031818", "0.6031008", "0.60217124", "0.6018882", "0.6015289", "0.6014095", "0.6007873", "0.5995523", "0.59908754", "0.59871525", "0.59824425", "0.59781426", "0.59714186", "0.5971339", "0.5965104", "0.5961813", "0.5961813", "0.59592724", "0.5955717", "0.5954017", "0.5948002", "0.59460187", "0.5941999", "0.5939431", "0.5931303", "0.593015", "0.5914664", "0.59101975", "0.5902929", "0.5902802", "0.590008" ]
0.7177795
2
Match the transform prefix
function prefixMatch(p) { var i = -1, n = p.length, s = document.body.style; while (++i < n) if (p[i] + 'Transform' in s) return '-' + p[i].toLowerCase() + '-'; return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function prefixMatch(name, prefix) {\n if (name.length < prefix.length)\n return false;\n if (name.substr(0, prefix.length) != prefix)\n return false;\n if (name[prefix.length] && name[prefix.length] != '/')\n return false;\n return true;\n }", "get _idPrefix() { return \"Transform\" }", "function regExpPrefix(re) {\n\t\t\tvar prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n\t\t\treturn (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n\t\t}", "function regExpPrefix(re) {\n\t var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n\t return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n\t }", "function regExpPrefix(re) {\n\t var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n\t return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n\t }", "function startAfterRegExpPrefix(value, prefix) {\n var match = prefix.exec(value);\n if (!match) {\n return;\n }\n if (match.index !== 0) {\n return;\n }\n return match[0].length;\n}", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function isPrefixedBy(prefix, document, position) {\n let prefixes = false;\n let fullDocument = document.getText(new vscode.Range(new vscode.Position(0, 0), position));\n prefix = prefix.replace(/\\./g, \"\\\\s*\\\\.\\\\s*\");\n let positionOffset = document.offsetAt(position);\n let wordPosition = fullDocument.search(\"\\\\w+$\");\n let fullWord = fullDocument.substring(wordPosition, positionOffset);\n let prefixRegex = new RegExp(`(?<=${prefix})${fullWord}`, \"i\");\n if (prefixRegex.exec(fullDocument) != null) {\n prefixes = true;\n }\n return prefixes;\n}", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n\n return (prefix !== null && prefix !== undefined) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "startsWith(t){}", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function hasTestFunctionPrefix(name) {\r\n return name.startsWith('Test') || name.startsWith('Example');\r\n}", "get transform() {}", "get transform() {}", "get transform() {}", "get transform() {}", "_startWith (string, prefix) {\n if (typeof string != 'string') {\n return false;\n\n } else {\n for (var i = 0, length = prefix.length; i < length; i += 1) {\n var p = prefix[i];\n var s = string[i];\n if (p !== s) {\n return false;\n }\n }\n }\n return true;\n }", "startWith(prefix) {\n this.addBefore(`^${Rule(prefix).source}`);\n return this;\n }", "function prefixMatches(prefix, path) {\n // Allow an empty string as a prefix of any relative path.\n if (path[0] != '/' && !prefix) {\n return true;\n }\n // Check whether any bytes of the prefix differ.\n if (!path.startsWith(prefix)) {\n return false;\n }\n // Ignore trailing slashes in directory names.\n let i = prefix.length;\n while (i > 0 && prefix[i - 1] == '/') {\n --i;\n }\n // Match only complete path components.\n let last = path[i];\n return last === '/' || last === '\\0';\n }", "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 }", "set transform(value) {}", "set transform(value) {}", "set transform(value) {}", "set transform(value) {}", "cleanPrefix(prefix) {\n if (!prefix) {\n return this;\n }\n this.input = this.input.replace(new RegExp(`^${prefix}[-_]?`, 'i'), '');\n return this;\n }", "function match(PM){\n\tthis.PM = PM;\n\ttransform.call(this, {objectMode: true});\n}", "function fileViewerStartsWith(str, prefix) {\n return str.indexOf(prefix) === 0;\n }", "function PoundResolverPlugin (source, target, prefix, to) {\n this.source = source || `resolve`;\n this.target = target || `resolve`;\n if (!prefix) throw new Error(`prefix is required`);\n if (!to) throw new Error(`to is required`);\n this.prefix = prefix;\n this.to = to;\n this.re = new RegExp(`^${prefix}([A-Z][a-z\\\\d]*)\\\\.js$`);\n // console.log(this.re);\n}", "function starts_with(str, prefix) {\n\t\treturn str.lastIndexOf(prefix, 0) === 0;\n\t}", "function startsWith(str, prefix) {\n\t str = toString(str);\n\t prefix = toString(prefix);\n\n\t return str.indexOf(prefix) === 0;\n\t }", "function makePrefixRe(str) {\n if (typeof str !== 'string') {\n throw new RangeError('invalid template');\n }\n let template = str.replace(\n /-|\\||\\{|\\}|\\(|\\)|\\\\|\\?|\\./g,\n match => {\n return `\\\\${match}`;\n }\n );\n return new RegExp(`^${template}(.*)$`);\n }", "fnmatch(pattern) {\n if (pattern.indexOf('*') === -1) {\n return filename => pattern === filename;\n } else {\n let reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n let escaped = pattern.replace(reRegExpChar, '\\\\$&');\n let matcher = new RegExp('^' + escaped.replace(/\\\\\\*/g, '.*') + '$');\n return filename => matcher.test(filename);\n }\n }", "function detectPrefixes() {\n var transform = void 0;\n var transition = void 0;\n var transitionEnd = void 0;\n var hasTranslate3d = void 0;\n\n (function () {\n var el = document.createElement('_');\n var style = el.style;\n\n var prop = void 0;\n\n if (style[prop = 'webkitTransition'] === '') {\n transitionEnd = 'webkitTransitionEnd';\n transition = prop;\n }\n\n if (style[prop = 'transition'] === '') {\n transitionEnd = 'transitionend';\n transition = prop;\n }\n\n if (style[prop = 'webkitTransform'] === '') {\n transform = prop;\n }\n\n if (style[prop = 'msTransform'] === '') {\n transform = prop;\n }\n\n if (style[prop = 'transform'] === '') {\n transform = prop;\n }\n\n document.body.insertBefore(el, null);\n style[transform] = 'translate3d(0, 0, 0)';\n hasTranslate3d = !!global.getComputedStyle(el).getPropertyValue(transform);\n document.body.removeChild(el);\n })();\n\n return {\n transform: transform,\n transition: transition,\n transitionEnd: transitionEnd,\n hasTranslate3d: hasTranslate3d\n };\n}", "startsWith(t) { return true }", "function createStartsWithFilter(startsWith) {\n // YOUR CODE BELOW HERE //\n return Starting => Starting.charAt(0).toLowerCase() === startsWith.toLowerCase();\n}", "compile(match) {\n const { rule, prefix, items } = match\n const results = (prefix && prefix.compile()) || {}\n const name = rule.rule.argument || rule.rule.name\n results[name] = items.map(item => item.compile())\n return results\n }", "static transform() {}", "startsWith(t){ return false }", "function startswith (string, prefix)\n{\n\treturn string.indexOf(prefix) == 0;\n}", "function isPrefix(candidate) {\n return function(xs) {\n if (candidate.length > xs.length) return false;\n for (var idx = 0; idx < candidate.length; idx += 1) {\n if (candidate[idx] !== xs[idx]) return false;\n }\n return true;\n };\n }", "function strStartsWith(input, match) {\n return input.substring(0, match.length) === match;\n }", "prefixed(prop, prefix) {\n let spec\n ;[spec, prefix] = flexSpec(prefix)\n if (spec === 2009) {\n return prefix + 'box-align'\n }\n if (spec === 2012) {\n return prefix + 'flex-align'\n }\n return super.prefixed(prop, prefix)\n }", "function pattern_prefix(schema, identifier) {\n if ( schema ) {\n // to match a table name including schema prefix\n // name should not be part of another name, so we require\n // to start a at a word boundary\n if ( identifier[0] !== '\"' ) {\n return '\\\\b';\n } else {\n return '';\n }\n } else {\n // to match a table name without schema\n // name should not begin right after a dot (i.e. have a explicit schema)\n // nor be part of another name\n // since the pattern matches the first character of the table\n // it must be put back in the replacement text\n replacement = '$01'+replacement;\n return '([^\\.a-z0-9_]|^)';\n }\n }", "startsWith(string,node){\n node = node || this.root\n //base case \n if(string.length === 0){\n return true;\n }\n\n if(node.keys.get(string[0])){\n return this.startsWith(string.substr(1),node.keys.get(string[0]));\n }\n else{\n return false\n }\n }", "function getModuleNameTest(moduleFormat, expected) {\n var result = transform(\"foo('bar');\", {\n filename: \"foo/bar/index\",\n modules: moduleFormat,\n moduleIds: true,\n getModuleId: function (name) {\n return name.replace(/\\/index$/, \"\");\n }\n });\n\n assert.equal(result.code, expected);\n }", "match(input, start, end){}", "match(input, start, end) {\n start = start || 0\n end = end || input.length\n if(typeof input === 'string') input = new Source(input)\n if(this.startsWith(input.get(start)))\n return this.token(input,start,start+1,input.get(start))\n else \n return this.error(input,start,start+1)\n }", "canTransform(filename) {\n const entry = this.findTransformer(filename);\n return !!entry;\n }", "function doesStringStartWith(s, prefix) {\r\n return s.substr(0, prefix.length) === prefix;\r\n}", "function doesStringStartWith(s, prefix) {\r\n return s.substr(0, prefix.length) === prefix;\r\n}", "function startsWith(str, prefix)\n{\n return (str.substr(0, prefix.length) == prefix);\n}", "transform ($input) {\n return String ($input).length > 0 ? new RegExp ($input, 'i') : undefined;\n }", "transform ($input) {\n return String ($input).length > 0 ? new RegExp ($input, 'i') : undefined;\n }", "function strBeginsWith(str, prefix) {\n return str.indexOf(prefix) === 0;\n}", "function strStartsWith ( input, match ) {\n\t\treturn input.substring(0, match.length) === match;\n\t}", "function strStartsWith ( input, match ) {\n\t\treturn input.substring(0, match.length) === match;\n\t}", "function startsWith(str, start) {\n var tr = str;\n\n if (tr.toLowerCase().startsWith(start)) {\n tr = str + 'pe';\n }\n\n return tr;\n}", "function strStartsWith ( input, match ) {\r\n\t\treturn input.substring(0, match.length) === match;\r\n\t}", "function strStartsWith ( input, match ) {\r\n\t\treturn input.substring(0, match.length) === match;\r\n\t}", "function strStartsWith(input, match) {\n return input.substring(0, match.length) === match;\n }", "function createStartsWithFilter(startsWith) {\n // YOUR CODE BELOW HERE //\n return function (str){\n // Testing wether the first index of a given string is the same as starstWith no matter if lower case or uppercase.\n if(str[0].toUpperCase() === startsWith || str[0].toLowerCase() === startsWith){\n return true;\n } else {\n return false;\n }\n };\n \n \n \n // YOUR CODE ABOVE HERE //\n}", "function doesStringStartWith(s, prefix) {\n return s.substr(0, prefix.length) === prefix;\n}", "transform ($input) {\n return String ($input).length > 0 ? new RegExp ($input, 'i') : undefined;\n }", "startsWith(c){ return false }", "startsWith(c){ return false }", "startsWith(c) {\n var consumed = this.match(new Source(\"inner-lexeme\",\"\"+c),this.tree)\n return consumed[1]>=1\n }", "function createStartsWithFilter(startsWith) {\n // YOUR CODE BELOW HERE //\n //Create a function expression with the argument of string that tests whether string[0] (first letter of string) is === startsWith character when \n //forced to uppercase or is === startsWith character when forced to lowercase\n var startsWithExpression = function(string) {\n if (string[0] === startsWith.toUpperCase() || string[0] === startsWith.toLowerCase()) {\n return true;\n } else {\n return false;\n }\n }\n //Return the startsWithExpression\n return startsWithExpression;\n // YOUR CODE ABOVE HERE //\n}", "function stringStartsWith(string, prefix) {\n return string.slice(0, prefix.length) == prefix;\n }", "function strStartsWith(input, match) {\n return input.substring(0, match.length) === match;\n }", "function isVisualPrefix( prefix, string ) {\n\t\t// Pre-base vowel signs of Indic languages. A vowel sign is called pre-base if\n\t\t// consonant + vowel becomes [vowel][consonant] when rendered. Eg: ക + െ => കെ\n\t\tvar prebases = 'െേൈൊോൌெேைொோௌେୈୋୌિਿिিেৈোৌෙේෛොෝෞ';\n\t\treturn prebases.indexOf( string[prefix.length] ) <= 0;\n\t}", "function patternPrefix (schema, identifier) {\n if (schema) {\n // to match a table name including schema prefix\n // name should not be part of another name, so we require\n // to start a at a word boundary\n if (identifier[0] !== '\"') {\n return '\\\\b';\n } else {\n return '';\n }\n } else {\n // to match a table name without schema\n // name should not begin right after a dot (i.e. have a explicit schema)\n // nor be part of another name\n // since the pattern matches the first character of the table\n // it must be put back in the replacement text\n replacement = '$01' + replacement;\n return '([^\\.a-z0-9_]|^)'; // eslint-disable-line no-useless-escape\n }\n }", "resolve(prefix) {\n var _a, _b;\n let uri = this.topNS[prefix];\n if (uri !== undefined) {\n return uri;\n }\n const { tags } = this;\n for (let index = tags.length - 1; index >= 0; index--) {\n uri = tags[index].ns[prefix];\n if (uri !== undefined) {\n return uri;\n }\n }\n uri = this.ns[prefix];\n if (uri !== undefined) {\n return uri;\n }\n return (_b = (_a = this.opt).resolvePrefix) === null || _b === void 0 ? void 0 : _b.call(_a, prefix);\n }", "function getEventName(match, prefix, eventName) {\n\t return eventName.toUpperCase();\n\t }", "function Transform$7() {}", "function Guidewire_FMSourceFileMatch(FROM_URL,LOCAL_FILENAME) {\n\tvar varFileURL = FROM_URL.toLowerCase();\n\tvar varFileActual = LOCAL_FILENAME.toLowerCase();\n\n\t// SPECIAL CASE FOR UPGRADE GUIDE PROCEDURES -- BASICALLY \n\tif (varFileURL.search(/^procedure-/) != -1) {\n\t if (varFileActual.search(/^procedure-/) != -1) { \n\t\t return (varFileURL == Guidewire_FMSourceFileExtract(varFileActual)); \n\t\t} else { \n\t\t return false; \n\t }\n\t }\n\telse {\n\t // basically, the default is to say they match... \n\t // if it's one of these specially-handled files, just let it work \n\t return true; \n\t}\n}", "function Guidewire_FMSourceFileMatch(FROM_URL,LOCAL_FILENAME) {\n\tvar varFileURL = FROM_URL.toLowerCase();\n\tvar varFileActual = LOCAL_FILENAME.toLowerCase();\n\n\t// SPECIAL CASE FOR UPGRADE GUIDE PROCEDURES -- BASICALLY \n\tif (varFileURL.search(/^procedure-/) != -1) {\n\t if (varFileActual.search(/^procedure-/) != -1) { \n\t\t return (varFileURL == Guidewire_FMSourceFileExtract(varFileActual)); \n\t\t} else { \n\t\t return false; \n\t }\n\t }\n\telse {\n\t // basically, the default is to say they match... \n\t // if it's one of these specially-handled files, just let it work \n\t return true; \n\t}\n}", "function Guidewire_FMSourceFileMatch(FROM_URL,LOCAL_FILENAME) {\n\tvar varFileURL = FROM_URL.toLowerCase();\n\tvar varFileActual = LOCAL_FILENAME.toLowerCase();\n\n\t// SPECIAL CASE FOR UPGRADE GUIDE PROCEDURES -- BASICALLY \n\tif (varFileURL.search(/^procedure-/) != -1) {\n\t if (varFileActual.search(/^procedure-/) != -1) { \n\t\t return (varFileURL == Guidewire_FMSourceFileExtract(varFileActual)); \n\t\t} else { \n\t\t return false; \n\t }\n\t }\n\telse {\n\t // basically, the default is to say they match... \n\t // if it's one of these specially-handled files, just let it work \n\t return true; \n\t}\n}", "function Guidewire_FMSourceFileMatch(FROM_URL,LOCAL_FILENAME) {\n\tvar varFileURL = FROM_URL.toLowerCase();\n\tvar varFileActual = LOCAL_FILENAME.toLowerCase();\n\n\t// SPECIAL CASE FOR UPGRADE GUIDE PROCEDURES -- BASICALLY \n\tif (varFileURL.search(/^procedure-/) != -1) {\n\t if (varFileActual.search(/^procedure-/) != -1) { \n\t\t return (varFileURL == Guidewire_FMSourceFileExtract(varFileActual)); \n\t\t} else { \n\t\t return false; \n\t }\n\t }\n\telse {\n\t // basically, the default is to say they match... \n\t // if it's one of these specially-handled files, just let it work \n\t return true; \n\t}\n}", "function Guidewire_FMSourceFileMatch(FROM_URL,LOCAL_FILENAME) {\n\tvar varFileURL = FROM_URL.toLowerCase();\n\tvar varFileActual = LOCAL_FILENAME.toLowerCase();\n\n\t// SPECIAL CASE FOR UPGRADE GUIDE PROCEDURES -- BASICALLY \n\tif (varFileURL.search(/^procedure-/) != -1) {\n\t if (varFileActual.search(/^procedure-/) != -1) { \n\t\t return (varFileURL == Guidewire_FMSourceFileExtract(varFileActual)); \n\t\t} else { \n\t\t return false; \n\t }\n\t }\n\telse {\n\t // basically, the default is to say they match... \n\t // if it's one of these specially-handled files, just let it work \n\t return true; \n\t}\n}", "function matchPattern( val, tmpl ) {\n // TODO!\n }", "enterPrefixedname(ctx) {\n\t}" ]
[ "0.5740492", "0.5598484", "0.5527312", "0.5523422", "0.5523422", "0.54414165", "0.5412586", "0.5411533", "0.5409869", "0.5356969", "0.5333388", "0.53262943", "0.53262943", "0.53262943", "0.53262943", "0.53262943", "0.53262943", "0.53262943", "0.53262943", "0.53262943", "0.53262943", "0.53262943", "0.53262943", "0.53262943", "0.53262943", "0.53262943", "0.53262943", "0.53262943", "0.53262943", "0.53262943", "0.5317325", "0.5308531", "0.5308531", "0.5308531", "0.5308531", "0.5283132", "0.5219528", "0.51920754", "0.5160891", "0.511308", "0.511308", "0.511308", "0.511308", "0.5088473", "0.50637025", "0.5045516", "0.50314593", "0.50182974", "0.5007071", "0.4995061", "0.49928525", "0.4955354", "0.49514878", "0.4944062", "0.49321982", "0.49226385", "0.49222738", "0.49206603", "0.4907286", "0.4866354", "0.48597354", "0.48460907", "0.48399994", "0.48327425", "0.48112354", "0.4809038", "0.4807515", "0.47819388", "0.47819388", "0.47796452", "0.4777042", "0.4777042", "0.4774039", "0.4770973", "0.4770973", "0.47621852", "0.47601753", "0.47601753", "0.47484726", "0.47392246", "0.47375986", "0.4731974", "0.47319102", "0.47319102", "0.47283202", "0.472818", "0.47224292", "0.47095722", "0.47089365", "0.4708669", "0.4698118", "0.46917057", "0.4689299", "0.46866885", "0.46866885", "0.46866885", "0.46866885", "0.46866885", "0.4681182", "0.46807903" ]
0.67472386
0
Since it is often desirable to operate on bounding data before the final rendering, wrapping can be precalced here
static wrap(str, targetWidth, opts={}) { const words = str.split(' ') const lines = [] const lineHeight = 1.1 let line = [] let lineBounds = Bounds.empty() _.each(words, (word, i) => { let nextLine = line.concat([word]) let nextBounds = Bounds.forText(nextLine.join(' '), opts) if (nextBounds.width > targetWidth && line.length >= 1) { lines.push({ str: line.join(' '), width: lineBounds.width, height: lineBounds.height }) line = [word] lineBounds = Bounds.forText(word, opts) } else { line = nextLine lineBounds = nextBounds } }) if (line.length > 0) lines.push({ str: line.join(' '), width: lineBounds.width, height: lineBounds.height }) let height = 0 let width = 0 _.each(lines, (line) => { height += line.height width = Math.max(width, line.width) }) return { lines: lines, lineHeight: lineHeight, width: width, height: height } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleWrapping() {\n // Off the left or right\n if (this.x < 0) {\n this.x += width;\n } else if (this.x > width) {\n this.x -= width;\n }\n // Off the top or bottom\n if (this.y < 0) {\n this.y += height;\n } else if (this.y > height) {\n this.y -= height;\n }\n }", "handleWrapping() {\n // Off the left or right\n if (this.x < 0) {\n this.x += width;\n } else if (this.x > width) {\n this.x -= width;\n }\n // Off the top or bottom\n if (this.y < 0) {\n this.y += height;\n } else if (this.y > height) {\n this.y -= height;\n }\n }", "handleWrapping() {\n // Off the left or right\n if (this.x < 0) {\n this.x += width;\n }\n else if (this.x > width) {\n this.x -= width;\n }\n constrain(this.y, 0, height);\n }", "handleWrapping() {\n// Off the left or right\n if (this.x < -100) {\n this.x += width;\n this.y = random(0,height);\n }\n else if (this.x > width) {\n this.x -= width;\n }\n }", "OnRebuildBounds()\n {\n sph3.fromMat4(this._boundingSphere, this._localTransform);\n box3.fromSph3(this._boundingBox, this._boundingSphere);\n this._boundsDirty = false;\n }", "function SVGWrap() {}", "handleWrapping() {\n // Check if target went off screen\n if (this.x > width + 50) {\n // If so, set x position to -50 and id to 1 so that it would be shown and could be counted again.\n this.x = -50;\n this.id = 1;\n }\n }", "drawTextMultiLine (lines, [x, y], size, { stroke, stroke_width = 0, transform, align, supersample }, type) {\n let line_height = size.line_height;\n let height = y;\n for (let line_num=0; line_num < lines.length; line_num++) {\n let line = lines[line_num];\n this.drawTextLine(line, [x, height], size, { stroke, stroke_width, transform, align, supersample }, type);\n height += line_height;\n }\n\n // Draw bounding boxes for debugging\n if (debugSettings.draw_label_collision_boxes) {\n this.context.save();\n\n let dpr = Utils.device_pixel_ratio * supersample;\n let horizontal_buffer = dpr * (this.horizontal_text_buffer + stroke_width);\n let vertical_buffer = dpr * this.vertical_text_buffer;\n let collision_size = size.collision_size;\n let lineWidth = 2;\n\n this.context.strokeStyle = 'blue';\n this.context.lineWidth = lineWidth;\n this.context.strokeRect(x + horizontal_buffer, y + vertical_buffer, dpr * collision_size[0], dpr * collision_size[1]);\n if (type === 'curved'){\n this.context.strokeRect(x + size.texture_size[0] + horizontal_buffer, y + vertical_buffer, dpr * collision_size[0], dpr * collision_size[1]);\n }\n\n this.context.restore();\n }\n\n if (debugSettings.draw_label_texture_boxes) {\n this.context.save();\n\n let texture_size = size.texture_size;\n let lineWidth = 2;\n\n this.context.strokeStyle = 'green';\n this.context.lineWidth = lineWidth;\n // stroke is applied internally, so the outer border is the edge of the texture\n this.context.strokeRect(x + lineWidth, y + lineWidth, texture_size[0] - 2 * lineWidth, texture_size[1] - 2 * lineWidth);\n\n if (type === 'curved'){\n this.context.strokeRect(x + lineWidth + size.texture_size[0], y + lineWidth, texture_size[0] - 2 * lineWidth, texture_size[1] - 2 * lineWidth);\n }\n\n this.context.restore();\n }\n }", "function adjustFaceWrap() {\n const ratioWidth = displayImage.width() / image.width;\n const ratioHeight = displayImage.height() / image.height;\n\n $rects.map(function (i) {\n const { origRectWidth, origRectHeight, origRectTop, origRectLeft, statPosition, statBlock } = $origRectSpecs[i];\n jQuery(this).css({\n \"width\": `${origRectWidth * ratioWidth}px`,\n \"height\": `${origRectHeight * ratioHeight}px`,\n \"top\": `${origRectTop * ratioHeight}px`,\n \"left\": `${origRectLeft * ratioWidth}px`\n });\n\n if (statBlock) {\n jQuery(statBlock).css({\n \"top\": `${statPosition.origStatTop * ratioHeight}px`,\n \"left\": `${statPosition.origStatLeft * ratioWidth}px`\n });\n }\n })\n }", "updateTextureWrapping()\n {\n this.quadMaterial.setTextureWrap(this.wrappingMethods[this.wrapS], this.wrappingMethods[this.wrapT]);\n }", "wrap() {\n if (this.x > width) {\n this.x -= width;\n }\n }", "_calculateBounds() {\n // FILL IN//\n }", "function wrapAround(data, wrap) {\n if (wrap) {\n return [data[data.length - 1]].concat(data).concat([data[0], data[1]]);\n }\n return data;\n}", "function wrapAround(array) {\r\n \r\n }", "function wrap(d){\n var sel = d3.select(this),\n tokens = sel.text().split(\"\\n\");\n\n if(tokens.length > 1) {\n var h = sel.node().getBBox().height,\n x = sel.attr('x'),\n y = sel.attr('y');\n\n sel.text(null);\n\n for(var i = 0, l = tokens.length; i < l; i++) {\n sel.append('tspan').attr('x', x).attr('y', y).attr('dy', h * i).text(tokens[i].trim());\n }\n }\n }", "constructor(collisionBoxArray: CollisionBoxArray,\n anchor: Anchor,\n featureIndex: number,\n sourceLayerIndex: number,\n bucketIndex: number,\n shaped: Object,\n boxScale: number,\n padding: number,\n alignLine: boolean,\n rotate: number) {\n\n this.boxStartIndex = collisionBoxArray.length;\n\n if (alignLine) {\n // Compute height of the shape in glyph metrics and apply collision padding.\n // Note that the pixel based 'text-padding' is applied at runtime\n let top = shaped.top;\n let bottom = shaped.bottom;\n const collisionPadding = shaped.collisionPadding;\n\n if (collisionPadding) {\n top -= collisionPadding[1];\n bottom += collisionPadding[3];\n }\n\n let height = bottom - top;\n\n if (height > 0) {\n // set minimum box height to avoid very many small labels\n height = Math.max(10, height);\n this.circleDiameter = height;\n }\n } else {\n let y1 = shaped.top * boxScale - padding;\n let y2 = shaped.bottom * boxScale + padding;\n let x1 = shaped.left * boxScale - padding;\n let x2 = shaped.right * boxScale + padding;\n\n const collisionPadding = shaped.collisionPadding;\n if (collisionPadding) {\n x1 -= collisionPadding[0] * boxScale;\n y1 -= collisionPadding[1] * boxScale;\n x2 += collisionPadding[2] * boxScale;\n y2 += collisionPadding[3] * boxScale;\n }\n\n if (rotate) {\n // Account for *-rotate in point collision boxes\n // See https://github.com/mapbox/mapbox-gl-js/issues/6075\n // Doesn't account for icon-text-fit\n\n const tl = new Point(x1, y1);\n const tr = new Point(x2, y1);\n const bl = new Point(x1, y2);\n const br = new Point(x2, y2);\n\n const rotateRadians = rotate * Math.PI / 180;\n\n tl._rotate(rotateRadians);\n tr._rotate(rotateRadians);\n bl._rotate(rotateRadians);\n br._rotate(rotateRadians);\n\n // Collision features require an \"on-axis\" geometry,\n // so take the envelope of the rotated geometry\n // (may be quite large for wide labels rotated 45 degrees)\n x1 = Math.min(tl.x, tr.x, bl.x, br.x);\n x2 = Math.max(tl.x, tr.x, bl.x, br.x);\n y1 = Math.min(tl.y, tr.y, bl.y, br.y);\n y2 = Math.max(tl.y, tr.y, bl.y, br.y);\n }\n collisionBoxArray.emplaceBack(anchor.x, anchor.y, x1, y1, x2, y2, featureIndex, sourceLayerIndex, bucketIndex);\n }\n\n this.boxEndIndex = collisionBoxArray.length;\n }", "handleWrapping() {\n // When the snow goes off screen, more will come down\n if (this.y > height) {\n this.x = random(0, width);\n this.y -= height;\n }\n }", "function addLappedElement(vis, data) {\n\n if (data != undefined) {\n\n var width = SCALES.x(1) - SCALES.x(0);\n\n vis.selectAll('rect.lapped')\n .data(data)\n .enter()\n .append('svg:rect')\n .attr('class', 'lapped zoom')\n .attr('x', function(d, i) {\n\n return SCALES.x(i + 0.5);\n })\n .attr('y', function(d) {\n\n return SCALES.y(d > 0 ? d - 1.5 : 0);\n })\n .attr('height', function(d) {\n\n return d > 0 ? SCALES.y.range()[1] - SCALES.y(d - 1.5) : 0;\n })\n .attr('width', function(d) {\n\n return d > 0 ? width : 0;\n });\n }\n}", "function spanAffectsWrapping() { return false; }", "function spanAffectsWrapping() { return false; }", "function spanAffectsWrapping() { return false; }", "function spanAffectsWrapping() { return false; }", "function BoundingBoxRect() { }", "function fitGeoInside(featureBounds, width, height) {\n var bbox = getFeaturesBox(featureBounds);\n var scale = 1 / Math.max(bbox.width / width, bbox.height / height);\n var trans = [-(bbox.x + bbox.width / 2) * scale + width / 2, -(bbox.y + bbox.height / 2) * scale + height / 2];\n\n return { scale: scale, trans: trans };\n }", "wrapText(textElement, cWidth) {\n // Allow 'function' and 'this', for D3...\n /* eslint-disable func-names, no-invalid-this */\n textElement.each(function () {\n const thisText = Dthree.select(this);\n // Extract properties from D3 bound data, since they\n // don't seem to survive the call...\n thisText.attr({\n 'content': (ddd) => ddd.content,\n 'class': (ddd) => ddd.class,\n 'wrapwidth': (ddd) => ddd.wrapwidth,\n 'leading': (ddd) => ddd.leading,\n 'x': (ddd) => {\n let xVal = ddd.x;\n // Right-aligned?\n if (xVal < 0) {\n xVal += cWidth;\n }\n return xVal;\n },\n });\n const wrapWidth = thisText.attr('wrapwidth');\n // String content as reversed array, by word\n const content = thisText.attr('content');\n const words = content.split(/\\s+/).reverse();\n // X pos for tspans\n const xPos = `${ thisText.attr('x') }px`;\n // Bostock's original had a linecounter, but I don't seem to need that...\n let line = [];\n const leading = `${ thisText.attr('leading') }px`;\n let tspan = thisText.text(null).append('tspan').attr('x', xPos).attr('dy', 0);\n while (words.length > 0) {\n const word = words.pop();\n line.push(word);\n tspan.text(line.join(' '));\n if (tspan.node().getComputedTextLength() > wrapWidth) {\n // debugger;\n line.pop();\n tspan.text(line.join(' '));\n line = [ word ];\n tspan = thisText.append('tspan').attr('x', xPos).attr('dy', leading).text(word);\n }\n }\n });\n }", "_updateBoundingRect() {\n this._elBoundingRect = this.$el.getBoundingClientRect();\n\n // this has been introduced in 6c8234bb83d2df3e56f1b21a0caea4e4ef657eb4 and\n // breaks a lot of things... respecify the behavior when\n // normalizeCoordinates === false, because is not related to the given\n // element (this.$el) as implemented.\n // (the only app that depends on this option is probably coloop, so check it)\n // this._elBoundingRect = {\n // top: 0,\n // bottom: 0,\n // left: 0,\n // right: 0,\n // width: window.innerWidth,\n // height: window.innerHeight,\n // };\n }", "function jt(e,t,a){var n=e.options.lineWrapping,r=n&&zt(e);if(!t.measure.heights||n&&t.measure.width!=r){var f=t.measure.heights=[];if(n){t.measure.width=r;for(var o=t.text.firstChild.getClientRects(),i=0;i<o.length-1;i++){var s=o[i],c=o[i+1];Math.abs(s.bottom-c.bottom)>2&&f.push((s.bottom+c.top)/2-a.top)}}f.push(a.bottom-a.top)}}", "function renderBoundingBox (ctx) {\n // This function takes a bounding box returned by a method getBoundingBox()\n var boundingBox = getBoundingBox();\n\n ctx.save();\n ctx.lineWidth = 2;\n ctx.strokeStyle = 'rgba(255,255,255,1)';\n ctx.beginPath();\n ctx.moveTo(boundingBox.x, boundingBox.y);\n ctx.lineTo(boundingBox.x + boundingBox.width, boundingBox.y);\n ctx.lineTo(boundingBox.x + boundingBox.width, boundingBox.y + boundingBox.height);\n ctx.lineTo(boundingBox.x, boundingBox.y + boundingBox.height);\n ctx.lineTo(boundingBox.x, boundingBox.y);\n ctx.stroke();\n ctx.closePath();\n ctx.restore();\n }", "draw_bounding_box(annotation_object, ctx, demo=false, offset=null, subtask=null) {\n const px_per_px = this.config[\"px_per_px\"];\n let diffX = 0;\n let diffY = 0;\n if (offset != null) {\n diffX = offset[\"diffX\"];\n diffY = offset[\"diffY\"];\n }\n\n let line_size = null;\n if (\"line_size\" in annotation_object) {\n line_size = annotation_object[\"line_size\"];\n }\n else {\n line_size = this.get_line_size(demo);\n }\n \n // Prep for bbox drawing\n let color = this.get_annotation_color(annotation_object[\"classification_payloads\"], false, subtask);\n ctx.fillStyle = color;\n ctx.strokeStyle = color;\n ctx.lineJoin = \"round\";\n ctx.lineWidth = line_size*px_per_px;\n ctx.imageSmoothingEnabled = false;\n ctx.globalCompositeOperation = \"source-over\";\n \n // Draw the box\n const sp = annotation_object[\"spatial_payload\"][0];\n const ep = annotation_object[\"spatial_payload\"][1];\n ctx.beginPath();\n ctx.moveTo((sp[0] + diffX)*px_per_px, (sp[1] + diffY)*px_per_px);\n ctx.lineTo((sp[0] + diffX)*px_per_px, (ep[1] + diffY)*px_per_px);\n ctx.lineTo((ep[0] + diffX)*px_per_px, (ep[1] + diffY)*px_per_px);\n ctx.lineTo((ep[0] + diffX)*px_per_px, (sp[1] + diffY)*px_per_px);\n ctx.lineTo((sp[0] + diffX)*px_per_px, (sp[1] + diffY)*px_per_px);\n ctx.closePath();\n ctx.stroke();\n }", "_calculateBounds() {\n this.updateText(true);\n this.calculateVertices();\n // if we have already done this on THIS frame.\n this._bounds.addQuad(this.vertexData);\n }", "drawtext() {\n \n if (this.internal.showdecorations===false)\n return;\n \n if (this.internal.volume===null) \n return;\n \n if (this.internal.simplemode)\n return;\n\n let fullwidth=this.internal.layoutcontroller.getviewerwidth();\n let dw=fullwidth*this.cleararea[1];\n \n if (dw<200)\n return;\n\n let frame=this.internal.slicecoord[3];\n let imageframe=frame;\n let objmapframe=frame;\n if (imageframe>=this.internal.imagedim[3])\n imageframe=this.internal.imagedim[3]-1;\n let imagecoord=[ this.internal.slicecoord[0],\n this.internal.slicecoord[1],\n this.internal.slicecoord[2],\n imageframe ];\n \n\n \n let value=util.scaledround(this.internal.volume.getVoxel(imagecoord),this.internal.imagescale);\n if (this.internal.objectmap!==null) {\n let newc=this.getobjectmapcoordinates();\n let coord=[ 0,0,0,0];\n \n if (objmapframe>=this.internal.objectmapnumframes)\n objmapframe=this.internal.objectmapnumframes-1;\n \n coord[3]=objmapframe;\n\n for (let i=0;i<=2;i++)\n coord[i]=Math.round(newc[i]/this.internal.objectmapspa[i]);\n let v2=util.scaledround(this.internal.objectmap.getVoxel(coord),this.internal.objectmapscale);\n \n let sum=0.0;\n for (let i=0;i<=2;i++)\n sum+=Math.abs(imagecoord[i]-coord[i]);\n let nf=0;\n nf=Math.abs(this.internal.objectmapnumframes-this.internal.imagedim[3]);\n\n \n if (sum>0) {\n if (this.internal.objectmapnumframes<2 && this.maxnumframes<2)\n coord.splice(3,1);\n value=value+', Ovr: ('+coord.join(',')+')='+v2;\n } else if (nf>0) {\n value=value+', Ovr: ( fr='+objmapframe+')='+v2;\n } else {\n value=value+', Ovr:'+v2;\n }\n }\n\n let s=\"\";\n if (this.is_slave_viewer)\n s=\"V2:\";\n if (this.slave_viewer!==null)\n s=\"V1:\";\n if (this.internal.imagedim[3]<2)\n imagecoord.splice(3,1);\n s=s+' Img ('+imagecoord.join(',')+') ='+value;\n\n\n var dh=this.internal.layoutcontroller.getviewerheight();\n var y0=0.97*dh;\n \n var context=this.internal.layoutcontroller.context;\n var fnsize=webutil.getfontsize(context.canvas);\n\n context.font=fnsize+\"px Arial\";\n let m=context.measureText(s).width;\n\n while (m>0.45*dw) {\n fnsize=Math.round(0.9*fnsize);\n context.font=fnsize+\"px Arial\";\n m=context.measureText(s).width;\n }\n if (this.internal.layoutcontroller.isCanvasDark())\n context.fillStyle = \"#dddddd\";\n else\n context.fillStyle = \"#222222\";\n context.clearRect(this.cleararea[0]*fullwidth+2,y0,0.5*dw-4,dh-y0);\n context.textAlign=\"left\";\n context.textBaseline=\"bottom\";\n context.fillText(s,(this.cleararea[0]+0.01)*fullwidth,dh-1);\n \n }", "function wrapCoords(c, bound) {\n if(c < 0) { \n c += bound; \n } else if(c >= bound) {\n c -= bound;\n }\n return c;\n}", "_estimateBoundingBox()\n\t{\n\t\t// take the alignment into account:\n\t\tthis._boundingBox = new PIXI.Rectangle(\n\t\t\tthis._pos[0] - this._size[0] / 2.0,\n\t\t\tthis._pos[1] - this._size[1] / 2.0,\n\t\t\tthis._size[0],\n\t\t\tthis._size[1],\n\t\t);\n\t}", "_calculateBounds() {\n this.finishPoly();\n var lb = this.geometry.bounds;\n this._bounds.addFrame(this.transform, lb.minX, lb.minY, lb.maxX, lb.maxY);\n }", "wrap(wrapper){wrapper.appendChild(this.range.extractContents());this.range.insertNode(wrapper)}", "renderInsidePatch() {\n\t\tif (this.component_.wasRendered && !this.shouldUpdate(this.changes_)) {\n\t\t\tthis.skipRerender_();\n\t\t\treturn;\n\t\t}\n\t\tthis.renderInsidePatchDontSkip_();\n\t}", "get boundingBox() {\n return this._boundingBox;\n }", "get boundingBox() {\n }", "get lineWrapping() { return this.viewState.heightOracle.lineWrapping; }", "function InteractiveBound(renderableObj, moveBounds = [], reportObject = null ) {\n InteractiveObject.call(this, renderableObj);\n this.mWidth = 15;\n this.mHeight = 15;\n this.mDrawClones = false;\n this.mMoveBounds = moveBounds;\n this.mReportObject = reportObject;\n this.mClones = [];\n this.mMarkers = [];\n this.mMarkersPos = [];\n \n renderableObj.setColor([1, 1, 1, 0]);\n renderableObj.getXform().setPosition(50, 25);\n renderableObj.getXform().setSize(this.mWidth, this.mHeight);\n \n // This object gets 4 clones, offset to the right by this.width.\n for (var i = 0; i < 4; i++){\n this.mClones.push(new InteractiveObject( \n new TextureRenderable(renderableObj.getTexture())));\n var xForm = this.mClones[i].getXform();\n xForm.setXPos(renderableObj.getXform().getXPos() + ((i + 1) * this.mWidth));\n xForm.setYPos(renderableObj.getXform().getYPos());\n xForm.setSize(this.mWidth, this.mHeight);\n }\n // Set positions of side markers\n xForm = this.getXform();\n this.mMarkersPos = [ [ xForm.getXPos() + (this.mWidth / 2.0 ), xForm.getYPos() ],\n [ xForm.getXPos(), xForm.getYPos() + (this.mHeight / 2.0 ) ],\n [ xForm.getXPos() - (this.mWidth / 2.0 ), xForm.getYPos() ],\n [ xForm.getXPos(), xForm.getYPos() - (this.mHeight / 2.0 )] \n ];\n \n // Instantiate corner markers\n for (var j = 0; j < 4; j++){\n var randColor = [ j/4.0, j/4.0, j/4.0, 1];\n this.mMarkers.push(new Renderable());\n this.mMarkers[j].setColor(randColor);\n // Set position\n this.mMarkers[j].getXform().setPosition( this.mMarkersPos[j][0], this.mMarkersPos[j][1]);\n this.mMarkers[j].getXform().setSize(2, 2);\n }\n}", "function OverlayFit() { }", "render(context, object, elapsedTime, clipping, player) {\n if (!this.image.complete) return;\n let center = player.center;\n // if (clipping.offset.y === 0) {\n // this.renderToOverlay(context, object, elapsedTime, clipping, center);\n // }\n\n if (clipping) {\n if (clipping.offset.y === 0) {\n this.renderToTempCanvas(context, object, elapsedTime, clipping, center);\n }\n clipping.offset.y = clipping.offset.y - (this.ul.y - object.position.y);\n\n // TRICKY: subtract 1 since clipping adds 1 to height by default to avoid artifacts on most other images\n let height = Math.min(clipping.dimensions.height, this.canvas.height - clipping.offset.y) - 1;\n // if (window.debug) {\n // context.lineWidth = 1;\n // context.strokeStyle = \"red\";\n // context.strokeRect(this.ul.x + clipping.offset.x, this.ul.y + clipping.offset.y, this.canvas.width, height);\n // }\n\n context.drawImage(this.canvas, clipping.offset.x, clipping.offset.y, this.canvas.width, height,\n this.ul.x + clipping.offset.x, this.ul.y + clipping.offset.y, this.canvas.width, height);\n } else {\n this.renderToTempCanvas(context, object, elapsedTime, clipping, center);\n context.drawImage(this.canvas, 0, 0, this.canvas.width, this.canvas.height,\n this.ul.x, this.ul.y, context.canvas.width, context.canvas.height);\n }\n }", "_afterRender () {\n this.adjust();\n }", "function wrap( value, height ) {\n\treturn value - (Math.floor( value / height ) * height);\n}", "wrapText(textTextureRender, text, wordWrapWidth) {\n // Greedy wrapping algorithm that will wrap words as the line grows longer.\n // than its horizontal bounds.\n let lines = text.split(/\\r?\\n/g);\n let allLines = [];\n let realNewlines = [];\n for (let i = 0; i < lines.length; i++) {\n let resultLines = [];\n let result = '';\n let spaceLeft = wordWrapWidth;\n let words = lines[i].split(' ');\n for (let j = 0; j < words.length; j++) {\n let wordWidth = textTextureRender._context.measureText(words[j]).width;\n let wordWidthWithSpace = wordWidth + textTextureRender._context.measureText(' ').width;\n if (j === 0 || wordWidthWithSpace > spaceLeft) {\n // Skip printing the newline if it's the first word of the line that is.\n // greater than the word wrap width.\n if (j > 0) {\n resultLines.push(result);\n result = '';\n }\n result += words[j];\n spaceLeft = wordWrapWidth - wordWidth;\n }\n else {\n spaceLeft -= wordWidthWithSpace;\n result += ' ' + words[j];\n }\n }\n\n if (result) {\n resultLines.push(result);\n result = '';\n }\n\n allLines = allLines.concat(resultLines);\n\n if (i < lines.length - 1) {\n realNewlines.push(allLines.length);\n }\n }\n\n return {l: allLines, n: realNewlines};\n }", "updateTransform()\n {\n\n this._boundsID++;\n \n this.transform.updateTransform(this.parent.transform);\n // TODO: check render flags, how to process stuff here\n this.worldAlpha = this.alpha * this.parent.worldAlpha;\n \n for (let i = 0, j = this.children.length; i < j; ++i)\n {\n const child = this.children[i];\n\n if (child.visible)\n {\n \n child.updateTransform();\n \n\n \n }\n }\n\n if(this._filters){\n // this._filters.forEach(filter=>filter.worldTransform =this.transform.worldTransform)\n const bounds = this._bounds;\n const width = this.width || this.style.width || bounds.maxX - bounds.minX;\n const height = this.height || this.style.height || bounds.maxY - bounds.minY;\n /**\n * if check on cliip bug on scroll after setState from App.js scrollHeight !!!!!!\n */\n // if(this._clip){\n\n // console.log(this.transform.worldTransform.ty)\n this.filterArea = new PIXI.Rectangle(\n this.transform.worldTransform.tx,\n this.transform.worldTransform.ty,\n width,\n height\n )\n // / }\n \n }\n \n }", "function wrapDraw() {\n // do modular arithmetic since the end of the track should be the beginning\n draw(theCanvas, Number(theSlider.value) % thePoints.length);\n }", "function updateWrap(className, d3graph_container) {\n var x = d3.scale.ordinal()\n .rangeRoundBands([0, 50], .1, .3);\n\n d3graph_container.selectAll(className + ' text')\n .call(wrap, x.rangeBand());\n}", "function GeometryDataProcessor () {}", "rectifyBBox (bbox) {\n // horizontal top\n if (bbox[0].y != bbox[1].y) {\n let ymin = Math.min(bbox[0].y, bbox[1].y)\n bbox[0].y = ymin\n bbox[1].y = ymin\n }\n\n // horizontal bottom\n if (bbox[3].y != bbox[2].y) {\n let ymax = Math.max(bbox[3].y, bbox[2].y)\n bbox[3].y = ymax\n bbox[2].y = ymax\n }\n\n // vertical right\n if (bbox[1].x != bbox[2].x) {\n let xmax = Math.max(bbox[1].x, bbox[2].x)\n bbox[1].x = xmax\n bbox[2].x = xmax\n }\n\n // vertical left\n if (bbox[0].x != bbox[3].x) {\n let xmin = Math.min(bbox[0].x, bbox[3].x)\n bbox[0].x = xmin\n bbox[3].x = xmin\n }\n\n return bbox\n }", "_updateRendering() {\n this._domElement.style.width = this._width + 'px'\n this._domElement.style.height = this._height + 'px'\n this._adjustAll()\n }", "calculateBounds() {\n var minX = Infinity;\n var maxX = -Infinity;\n var minY = Infinity;\n var maxY = -Infinity;\n if (this.graphicsData.length) {\n var shape = null;\n var x = 0;\n var y = 0;\n var w = 0;\n var h = 0;\n for (var i = 0; i < this.graphicsData.length; i++) {\n var data = this.graphicsData[i];\n var type = data.type;\n var lineWidth = data.lineStyle ? data.lineStyle.width : 0;\n shape = data.shape;\n if (type === ShapeSettings_1.ShapeSettings.SHAPES.RECT || type === ShapeSettings_1.ShapeSettings.SHAPES.RREC) {\n x = shape.x - (lineWidth / 2);\n y = shape.y - (lineWidth / 2);\n w = shape.width + lineWidth;\n h = shape.height + lineWidth;\n minX = x < minX ? x : minX;\n maxX = x + w > maxX ? x + w : maxX;\n minY = y < minY ? y : minY;\n maxY = y + h > maxY ? y + h : maxY;\n }\n else if (type === ShapeSettings_1.ShapeSettings.SHAPES.CIRC) {\n x = shape.x;\n y = shape.y;\n w = shape.radius + (lineWidth / 2);\n h = shape.radius + (lineWidth / 2);\n minX = x - w < minX ? x - w : minX;\n maxX = x + w > maxX ? x + w : maxX;\n minY = y - h < minY ? y - h : minY;\n maxY = y + h > maxY ? y + h : maxY;\n }\n else if (type === ShapeSettings_1.ShapeSettings.SHAPES.ELIP) {\n x = shape.x;\n y = shape.y;\n w = shape.width + (lineWidth / 2);\n h = shape.height + (lineWidth / 2);\n minX = x - w < minX ? x - w : minX;\n maxX = x + w > maxX ? x + w : maxX;\n minY = y - h < minY ? y - h : minY;\n maxY = y + h > maxY ? y + h : maxY;\n }\n else {\n // POLY\n var points = shape.points;\n var x2 = 0;\n var y2 = 0;\n var dx = 0;\n var dy = 0;\n var rw = 0;\n var rh = 0;\n var cx = 0;\n var cy = 0;\n for (var j = 0; j + 2 < points.length; j += 2) {\n x = points[j];\n y = points[j + 1];\n x2 = points[j + 2];\n y2 = points[j + 3];\n dx = Math.abs(x2 - x);\n dy = Math.abs(y2 - y);\n h = lineWidth;\n w = Math.sqrt((dx * dx) + (dy * dy));\n if (w < 1e-9) {\n continue;\n }\n rw = ((h / w * dy) + dx) / 2;\n rh = ((h / w * dx) + dy) / 2;\n cx = (x2 + x) / 2;\n cy = (y2 + y) / 2;\n minX = cx - rw < minX ? cx - rw : minX;\n maxX = cx + rw > maxX ? cx + rw : maxX;\n minY = cy - rh < minY ? cy - rh : minY;\n maxY = cy + rh > maxY ? cy + rh : maxY;\n }\n }\n }\n }\n else {\n minX = 0;\n maxX = 0;\n minY = 0;\n maxY = 0;\n }\n var padding = this.boundsPadding;\n this._bounds.minX = minX - padding;\n this._bounds.maxX = maxX + padding;\n this._bounds.minY = minY - padding;\n this._bounds.maxY = maxY + padding;\n }", "allowPatchingOuterBounds(): boolean {\n return true;\n }", "get localBounds() {\n return {\n x: this.x, //I changed this, it was \"x: 0,\"\n y: this.y, //I changed this, it was \"y: 0,\"\n width: this.width,\n height: this.height\n } \n }", "set wrapMode(value) {}", "function W(){var t=l.getBoundingClientRect(),e=\"offset\"+[\"Width\",\"Height\"][i.ort];return 0===i.ort?t.width||l[e]:t.height||l[e]}", "function wrapDraw() {\n // do modular arithmetic since the end of the track should be the beginning\n draw(theCanvas, Number(theSlider.value) % thePoints.length);\n }", "toJSON() {\r\n let raw = {\r\n x: this.x / MIN_SIZE,\r\n y: this.y / MIN_SIZE,\r\n w: this.width / MIN_SIZE,\r\n h: this.height / MIN_SIZE,\r\n r: this._rendererName\r\n };\r\n\r\n if(this.left) {\r\n raw.l = this.left.toJSON();\r\n }\r\n\r\n if(this.above) {\r\n raw.a = this.above.toJSON();\r\n }\r\n\r\n return raw;\r\n }", "function wrap(text,width){text.each(function(){var text=d3.select(this),words=text.text().split(/\\s+/).reverse(),word,line=[],lineNumber=0,lineHeight=1.1, // ems\n\ty=text.attr(\"y\"),dy=parseFloat(text.attr(\"dy\")),tspan=text.text(null).append(\"tspan\").attr(\"x\",0).attr(\"y\",y).attr(\"dy\",dy+\"em\");while(word=words.pop()){line.push(word);tspan.text(line.join(\" \"));if(tspan.node().getComputedTextLength()>width){line.pop();tspan.text(line.join(\" \"));line=[word];tspan=text.append(\"tspan\").attr(\"x\",0).attr(\"y\",y).attr(\"dy\",++lineNumber*lineHeight+dy+\"em\").text(word);}}});}", "render() {\n const total = this.values.reduce((a, b) => a + b, 0);\n\n const rest = 100 - total;\n const dataset = rest > 0 ? [...this.values, rest] : this.values;\n\n this._renderSvg();\n this._renderGroups(dataset, rest);\n this._renderRects(dataset);\n this._renderMarkers();\n }", "fit() {\n let workspace = this.elements.bbox.getBoundingClientRect();\n let width = workspace.width / this.scale;\n let height = workspace.height / this.scale;\n\n // no contents...\n if (!width || !height) {\n this.center();\n return;\n }\n\n // zoom to fit the view minus the padding\n const padding = this.settings.fitPadding * 2;\n const scaleX = (this.elements.blueprint.offsetWidth - padding) / width;\n const scaleY = (this.elements.blueprint.offsetHeight - padding) / height;\n const scale = Math.min(scaleX, scaleY);\n\n this.zoom(scale);\n\n // move the workspace at center of the view\n const blueprint = this.elements.blueprint.getBoundingClientRect();\n workspace = this.elements.bbox.getBoundingClientRect();\n width = (blueprint.width - workspace.width) / 2;\n height = (blueprint.height - workspace.height) / 2;\n\n this.pan({\n x: -workspace.left + blueprint.left + width,\n y: -workspace.top + blueprint.top + height\n });\n }", "function BoxRenderer() {}", "updateGraphicsData() {\n // override\n }", "calculateBounds() {\n this._bounds.clear();\n this._calculateBounds();\n for (var i = 0; i < this.children.length; i++) {\n var child = this.children[i];\n if (!child.visible || !child.renderable) {\n continue;\n }\n child.calculateBounds();\n // TODO: filter+mask, need to mask both somehow\n if (child._mask) {\n child._mask.calculateBounds();\n this._bounds.addBoundsMask(child._bounds, child._mask._bounds);\n }\n else if (child.filterArea) {\n this._bounds.addBoundsArea(child._bounds, child.filterArea);\n }\n else {\n this._bounds.addBounds(child._bounds);\n }\n }\n this._lastBoundsID = this._boundsID;\n }", "function Wr(e,t,a,n,f){\n // Shared markers (across linked documents) are handled separately\n // (markTextShared will call out to this again, once per\n // document).\n if(n&&n.shared)return Vr(e,t,a,n,f);\n // Ensure we are in an operation.\n if(e.cm&&!e.cm.curOp)return pn(e.cm,Wr)(e,t,a,n,f);var o=new Li(e,f),i=P(t,a);\n // Don't connect empty markers unless clearWhenEmpty is false\n if(n&&u(n,o,!1),i>0||0==i&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(\n // Showing up as a widget implies collapsed (widget replaces text)\n o.collapsed=!0,o.widgetNode=r(\"span\",[o.replacedWith],\"CodeMirror-widget\"),n.handleMouseEvents||o.widgetNode.setAttribute(\"cm-ignore-events\",\"true\"),n.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(le(e,t.line,t,a,o)||t.line!=a.line&&le(e,a.line,t,a,o))throw new Error(\"Inserting collapsed marker partially overlapping an existing one\");W()}o.addToHistory&&fr(e,{from:t,to:a,origin:\"markText\"},e.sel,NaN);var s,c=t.line,l=e.cm;if(e.iter(c,a.line+1,function(e){l&&o.collapsed&&!l.options.lineWrapping&&de(e)==l.display.maxLine&&(s=!0),o.collapsed&&c!=t.line&&O(e,0),Q(e,new V(o,c==t.line?t.ch:null,c==a.line?a.ch:null)),++c}),\n // lineIsHidden depends on the presence of the spans, so needs a second pass\n o.collapsed&&e.iter(t.line,a.line+1,function(t){he(e,t)&&O(t,0)}),o.clearOnEnter&&ni(o,\"beforeCursorEnter\",function(){return o.clear()}),o.readOnly&&($(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Ii,o.atomic=!0),l){if(\n // Sync editor state\n s&&(l.curOp.updateMaxLine=!0),o.collapsed)bn(l,t.line,a.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var d=t.line;d<=a.line;d++)yn(l,d,\"text\");o.atomic&&Sr(l.doc),wt(l,\"markerAdded\",l,o)}return o}", "_updateRenderedRange() {\n if (!this._viewport) {\n return;\n }\n const renderedRange = this._viewport.getRenderedRange();\n const newRange = { start: renderedRange.start, end: renderedRange.end };\n const viewportSize = this._viewport.getViewportSize();\n const dataLength = this._viewport.getDataLength();\n let scrollOffset = this._viewport.measureScrollOffset();\n // Prevent NaN as result when dividing by zero.\n let firstVisibleIndex = (this._itemSize > 0) ? scrollOffset / this._itemSize : 0;\n // If user scrolls to the bottom of the list and data changes to a smaller list\n if (newRange.end > dataLength) {\n // We have to recalculate the first visible index based on new data length and viewport size.\n const maxVisibleItems = Math.ceil(viewportSize / this._itemSize);\n const newVisibleIndex = Math.max(0, Math.min(firstVisibleIndex, dataLength - maxVisibleItems));\n // If first visible index changed we must update scroll offset to handle start/end buffers\n // Current range must also be adjusted to cover the new position (bottom of new list).\n if (firstVisibleIndex != newVisibleIndex) {\n firstVisibleIndex = newVisibleIndex;\n scrollOffset = newVisibleIndex * this._itemSize;\n newRange.start = Math.floor(firstVisibleIndex);\n }\n newRange.end = Math.max(0, Math.min(dataLength, newRange.start + maxVisibleItems));\n }\n const startBuffer = scrollOffset - newRange.start * this._itemSize;\n if (startBuffer < this._minBufferPx && newRange.start != 0) {\n const expandStart = Math.ceil((this._maxBufferPx - startBuffer) / this._itemSize);\n newRange.start = Math.max(0, newRange.start - expandStart);\n newRange.end = Math.min(dataLength, Math.ceil(firstVisibleIndex + (viewportSize + this._minBufferPx) / this._itemSize));\n }\n else {\n const endBuffer = newRange.end * this._itemSize - (scrollOffset + viewportSize);\n if (endBuffer < this._minBufferPx && newRange.end != dataLength) {\n const expandEnd = Math.ceil((this._maxBufferPx - endBuffer) / this._itemSize);\n if (expandEnd > 0) {\n newRange.end = Math.min(dataLength, newRange.end + expandEnd);\n newRange.start = Math.max(0, Math.floor(firstVisibleIndex - this._minBufferPx / this._itemSize));\n }\n }\n }\n this._viewport.setRenderedRange(newRange);\n this._viewport.setRenderedContentOffset(this._itemSize * newRange.start);\n this._scrolledIndexChange.next(Math.floor(firstVisibleIndex));\n }", "_updateRenderedRange() {\n if (!this._viewport) {\n return;\n }\n const renderedRange = this._viewport.getRenderedRange();\n const newRange = { start: renderedRange.start, end: renderedRange.end };\n const viewportSize = this._viewport.getViewportSize();\n const dataLength = this._viewport.getDataLength();\n let scrollOffset = this._viewport.measureScrollOffset();\n let firstVisibleIndex = scrollOffset / this._itemSize;\n // If user scrolls to the bottom of the list and data changes to a smaller list\n if (newRange.end > dataLength) {\n // We have to recalculate the first visible index based on new data length and viewport size.\n const maxVisibleItems = Math.ceil(viewportSize / this._itemSize);\n const newVisibleIndex = Math.max(0, Math.min(firstVisibleIndex, dataLength - maxVisibleItems));\n // If first visible index changed we must update scroll offset to handle start/end buffers\n // Current range must also be adjusted to cover the new position (bottom of new list).\n if (firstVisibleIndex != newVisibleIndex) {\n firstVisibleIndex = newVisibleIndex;\n scrollOffset = newVisibleIndex * this._itemSize;\n newRange.start = Math.floor(firstVisibleIndex);\n }\n newRange.end = Math.max(0, Math.min(dataLength, newRange.start + maxVisibleItems));\n }\n const startBuffer = scrollOffset - newRange.start * this._itemSize;\n if (startBuffer < this._minBufferPx && newRange.start != 0) {\n const expandStart = Math.ceil((this._maxBufferPx - startBuffer) / this._itemSize);\n newRange.start = Math.max(0, newRange.start - expandStart);\n newRange.end = Math.min(dataLength, Math.ceil(firstVisibleIndex + (viewportSize + this._minBufferPx) / this._itemSize));\n }\n else {\n const endBuffer = newRange.end * this._itemSize - (scrollOffset + viewportSize);\n if (endBuffer < this._minBufferPx && newRange.end != dataLength) {\n const expandEnd = Math.ceil((this._maxBufferPx - endBuffer) / this._itemSize);\n if (expandEnd > 0) {\n newRange.end = Math.min(dataLength, newRange.end + expandEnd);\n newRange.start = Math.max(0, Math.floor(firstVisibleIndex - this._minBufferPx / this._itemSize));\n }\n }\n }\n this._viewport.setRenderedRange(newRange);\n this._viewport.setRenderedContentOffset(this._itemSize * newRange.start);\n this._scrolledIndexChange.next(Math.floor(firstVisibleIndex));\n }", "_calculateBounds()\n {\n const trim = this._texture.trim;\n const orig = this._texture.orig;\n\n // First lets check to see if the current texture has a trim..\n if (!trim || (trim.width === orig.width && trim.height === orig.height))\n {\n // no trim! lets use the usual calculations..\n this.calculateVertices();\n this._bounds.addQuad(this.vertexData);\n }\n else\n {\n // lets calculate a special trimmed bounds...\n this.calculateTrimmedVertices();\n this._bounds.addQuad(this.vertexTrimmedData);\n }\n }", "function markAsWrapped () {\n if (!parent._ractiveWraps) parent._ractiveWraps = {};\n parent._ractiveWraps[keypath] = child;\n }", "function drawBoundingBox(ctx, object) {\n ctx.fillStyle = 'rgba(255, 0, 0, 0.1)'\n ctx.fillRect(\n object.lowX(),\n object.lowY(),\n object.highX() - object.lowX(),\n object.highY() - object.lowY()\n );\n}", "function wrap(img) {\n if (!!(img.getContext && img.getContext('2d'))) {\n return img;\n }\n var canv = document.createElement('canvas');\n canv.width = img.width;\n canv.height = img.height;\n canv.getContext('2d').drawImage(img, 0, 0, img.width, img.height);\n return canv;\n}", "function getIntersectionBBOX()\n{\n var mapBounds = map.getExtent();\n var mapBboxEls = mapBounds.toBBOX().split(',');\n // bbox is the bounding box of the currently-visible layer\n var layerBboxEls = bbox.split(',');\n var newBBOX = Math.max(parseFloat(mapBboxEls[0]), parseFloat(layerBboxEls[0])) + ',';\n newBBOX += Math.max(parseFloat(mapBboxEls[1]), parseFloat(layerBboxEls[1])) + ',';\n newBBOX += Math.min(parseFloat(mapBboxEls[2]), parseFloat(layerBboxEls[2])) + ',';\n newBBOX += Math.min(parseFloat(mapBboxEls[3]), parseFloat(layerBboxEls[3]));\n return newBBOX;\n}", "getLogicalBox() {\n let rv = {};\n if (!this.updatedMetrics) {\n this._calculateBlockIndex();\n }\n const adjBox = (box) => {\n const nbox = svgHelpers.smoBox(box);\n nbox.y = nbox.y - nbox.height;\n return nbox;\n };\n this.blocks.forEach((block) => {\n if (!rv.x) {\n rv = svgHelpers.smoBox(adjBox(block));\n } else {\n rv = svgHelpers.unionRect(rv, adjBox(block));\n }\n });\n return rv;\n }", "set postWrapMode(value) {}", "function _labelIsWrapping(){\n\n\t\tif (this.getWrapping && !this.isPropertyInitial(\"wrapping\")) {\n\t\t\treturn this.getWrapping();\n\t\t}\n\n\t\treturn true;\n\n\t}", "_estimateBoundingBox()\n\t{\n\t\tconst size = this._getDisplaySize();\n\t\tif (typeof size !== \"undefined\")\n\t\t{\n\t\t\tthis._boundingBox = new PIXI.Rectangle(\n\t\t\t\tthis._pos[0] - size[0] / 2,\n\t\t\t\tthis._pos[1] - size[1] / 2,\n\t\t\t\tsize[0],\n\t\t\t\tsize[1],\n\t\t\t);\n\t\t}\n\n\t\t// TODO take the orientation into account\n\t}", "_updateRenderedRange() {\n if (!this._viewport) {\n return;\n }\n\n const renderedRange = this._viewport.getRenderedRange();\n\n const newRange = {\n start: renderedRange.start,\n end: renderedRange.end\n };\n\n const viewportSize = this._viewport.getViewportSize();\n\n const dataLength = this._viewport.getDataLength();\n\n let scrollOffset = this._viewport.measureScrollOffset(); // Prevent NaN as result when dividing by zero.\n\n\n let firstVisibleIndex = this._itemSize > 0 ? scrollOffset / this._itemSize : 0; // If user scrolls to the bottom of the list and data changes to a smaller list\n\n if (newRange.end > dataLength) {\n // We have to recalculate the first visible index based on new data length and viewport size.\n const maxVisibleItems = Math.ceil(viewportSize / this._itemSize);\n const newVisibleIndex = Math.max(0, Math.min(firstVisibleIndex, dataLength - maxVisibleItems)); // If first visible index changed we must update scroll offset to handle start/end buffers\n // Current range must also be adjusted to cover the new position (bottom of new list).\n\n if (firstVisibleIndex != newVisibleIndex) {\n firstVisibleIndex = newVisibleIndex;\n scrollOffset = newVisibleIndex * this._itemSize;\n newRange.start = Math.floor(firstVisibleIndex);\n }\n\n newRange.end = Math.max(0, Math.min(dataLength, newRange.start + maxVisibleItems));\n }\n\n const startBuffer = scrollOffset - newRange.start * this._itemSize;\n\n if (startBuffer < this._minBufferPx && newRange.start != 0) {\n const expandStart = Math.ceil((this._maxBufferPx - startBuffer) / this._itemSize);\n newRange.start = Math.max(0, newRange.start - expandStart);\n newRange.end = Math.min(dataLength, Math.ceil(firstVisibleIndex + (viewportSize + this._minBufferPx) / this._itemSize));\n } else {\n const endBuffer = newRange.end * this._itemSize - (scrollOffset + viewportSize);\n\n if (endBuffer < this._minBufferPx && newRange.end != dataLength) {\n const expandEnd = Math.ceil((this._maxBufferPx - endBuffer) / this._itemSize);\n\n if (expandEnd > 0) {\n newRange.end = Math.min(dataLength, newRange.end + expandEnd);\n newRange.start = Math.max(0, Math.floor(firstVisibleIndex - this._minBufferPx / this._itemSize));\n }\n }\n }\n\n this._viewport.setRenderedRange(newRange);\n\n this._viewport.setRenderedContentOffset(this._itemSize * newRange.start);\n\n this._scrolledIndexChange.next(Math.floor(firstVisibleIndex));\n }", "_calculateBounds() {\n var trim = this._texture.trim;\n var orig = this._texture.orig;\n // First lets check to see if the current texture has a trim..\n if (!trim || (trim.width === orig.width && trim.height === orig.height)) {\n // no trim! lets use the usual calculations..\n this.calculateVertices();\n this._bounds.addQuad(this.vertexData);\n }\n else {\n // lets calculate a special trimmed bounds...\n this.calculateTrimmedVertices();\n this._bounds.addQuad(this.vertexTrimmedData);\n }\n }", "constructor(olMap, $slider, dynamicLayerRenderer1, dynamicLayerRenderer2) {\n\n dynamicLayerRenderer1.getVectorLayer().on('precompose', function(event) {\n const percent = $slider.val() / 100;\n var ctx = event.context;\n var width = ctx.canvas.width * percent;\n\n ctx.save();\n ctx.beginPath();\n ctx.rect(0, 0, width, ctx.canvas.height);\n ctx.clip();\n\n });\n\n dynamicLayerRenderer1.getVectorLayer().on('postcompose', function(event) {\n var ctx = event.context;\n ctx.restore();\n });\n\n dynamicLayerRenderer2.getVectorLayer().on('precompose', function(event) {\n const percent = $slider.val() / 100;\n var ctx = event.context;\n var width = ctx.canvas.width * percent;\n\n ctx.save();\n ctx.beginPath();\n ctx.rect(width, 0, ctx.canvas.width - width, ctx.canvas.height);\n ctx.clip();\n\n // Draw a separating vertical line.\n if (percent < 100) {\n ctx.beginPath();\n ctx.moveTo(width, 0);\n ctx.lineTo(width, ctx.canvas.height);\n ctx.stroke();\n }\n\n });\n\n dynamicLayerRenderer2.getVectorLayer().on('postcompose', function(event) {\n var ctx = event.context;\n ctx.restore();\n });\n\n $slider.on('input change', function() {\n olMap.render();\n });\n\n }", "function wrap( text, width, yheight, lineheight ) {\n\ttext.each( function () {\n\t\tvar text = d3.select( this ),\n\t\t\twords = text.text().split( /\\s+/ ).reverse(),\n\t\t\tword,\n\t\t\tline = [],\n\t\t\tlineNumber = 0,\n\t\t\tlineHeight = /*1.1*/ lineheight, // ems\n\t\t\ty = 0 /*text.attr( \"y\" )*/ ,\n\t\t\tdy = parseFloat( yheight ),\n\t\t\ttspan = text.text( null ).append( \"tspan\" ).attr( \"x\", 0 ).attr( \"y\", y ).attr( \"dy\", dy + \"em\" );\n\t\twhile ( word = words.pop() ) {\n\t\t\tline.push( word );\n\t\t\t// console.log( \"wrap\", line, y, yheight );\n\t\t\ttspan.text( line.join( \" \" ) );\n\t\t\t// console.log( line, \"comp text length\", tspan.node().getComputedTextLength(), width );\n\t\t\t//console.log( y );\n\t\t\tif ( tspan.node().getComputedTextLength() > width ) {\n\t\t\t\tline.pop();\n\t\t\t\ttspan.text( line.join( \" \" ) );\n\t\t\t\tline = [ word ];\n\t\t\t\ttspan = text.append( \"tspan\" ).attr( \"x\", 0 ).attr( \"y\", y ).attr( \"dy\", dy + ( lineHeight * ++lineNumber ) + \"em\" ).text( word );\n\t\t\t\t// console.log( dy + ( lineHeight * lineNumber ) );\n\t\t\t\t// console.log( tspan );\n\t\t\t}\n\t\t}\n\t} );\n\n\t// This is calling an updated height.\n\tif ( pymChild ) {\n\t\tpymChild.sendHeight();\n\t}\n}", "get boundingBox() { return GeoJsonUtils.getBoundingBox(this.item); }", "_setBoundingBoxStyles(origin, position) {\n const boundingBoxRect = this._calculateBoundingBoxRect(origin, position);\n // It's weird if the overlay *grows* while scrolling, so we take the last size into account\n // when applying a new size.\n if (!this._isInitialRender && !this._growAfterOpen) {\n boundingBoxRect.height = Math.min(boundingBoxRect.height, this._lastBoundingBoxSize.height);\n boundingBoxRect.width = Math.min(boundingBoxRect.width, this._lastBoundingBoxSize.width);\n }\n const styles = {};\n if (this._hasExactPosition()) {\n styles.top = styles.left = '0';\n styles.bottom = styles.right = styles.maxHeight = styles.maxWidth = '';\n styles.width = styles.height = '100%';\n }\n else {\n const maxHeight = this._overlayRef.getConfig().maxHeight;\n const maxWidth = this._overlayRef.getConfig().maxWidth;\n styles.height = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__[\"coerceCssPixelValue\"])(boundingBoxRect.height);\n styles.top = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__[\"coerceCssPixelValue\"])(boundingBoxRect.top);\n styles.bottom = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__[\"coerceCssPixelValue\"])(boundingBoxRect.bottom);\n styles.width = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__[\"coerceCssPixelValue\"])(boundingBoxRect.width);\n styles.left = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__[\"coerceCssPixelValue\"])(boundingBoxRect.left);\n styles.right = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__[\"coerceCssPixelValue\"])(boundingBoxRect.right);\n // Push the pane content towards the proper direction.\n if (position.overlayX === 'center') {\n styles.alignItems = 'center';\n }\n else {\n styles.alignItems = position.overlayX === 'end' ? 'flex-end' : 'flex-start';\n }\n if (position.overlayY === 'center') {\n styles.justifyContent = 'center';\n }\n else {\n styles.justifyContent = position.overlayY === 'bottom' ? 'flex-end' : 'flex-start';\n }\n if (maxHeight) {\n styles.maxHeight = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__[\"coerceCssPixelValue\"])(maxHeight);\n }\n if (maxWidth) {\n styles.maxWidth = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__[\"coerceCssPixelValue\"])(maxWidth);\n }\n }\n this._lastBoundingBoxSize = boundingBoxRect;\n extendStyles(this._boundingBox.style, styles);\n }", "function wrap(textObj, width) {\n textObj.each(function() {\n var textLineObj = d3.select(this);\n var text = textLineObj.text().replace(\"\\n\",\" **newline** \");\n var words = text.split(/\\s+/).reverse(),\n word,\n line = [],\n lineNumber = 0,\n lineHeight = 1.1, // ems\n y = textLineObj.attr(\"y\"),\n dy = parseFloat(textLineObj.attr(\"dy\")),\n tspan = textLineObj.text(null).append(\"tspan\").attr(\"x\", textLineObj.attr(\"x\")).attr(\"y\", y);\n while (word = words.pop()) {\n var newline = (word != \"**newline**\");\n if(newline) line.push(word);\n else word = \"\";\n tspan.text(line.join(\" \"));\n if (tspan.node().getComputedTextLength() > width || word == \"**newline**\") {\n line.pop();\n tspan.text(line.join(\" \"));\n line = [word];\n tspan = textLineObj.append(\"tspan\").attr(\"x\", textLineObj.attr(\"x\")).attr(\"y\", y).attr(\"dy\", ++lineNumber * lineHeight + dy + \"em\").text(word);\n //console.log(tspan);\n }\n }\n //console.log(\"wrap done: \"+text.text());\n });\n}", "function RowLayoutResult(){this.layoutedBounds=new RectangleF(0,0,0,0);}", "function v(a,b,c){// overlayEnd is exclusive\nc&&ya.build();for(var d=Xa(a,b),e=0;e<d.length;e++){var f=d[e];q(w(f.row,f.leftCol,f.row,f.rightCol))}}", "function wrap(text, baseline) {\n text.each(function() {\n var text = d3.select(this);\n var lines = text.text().split(/\\n/);\n\n var y = text.attr('y');\n var x = text.attr('x');\n var dy = parseFloat(text.attr('dy'));\n\n text\n .text(null)\n .append('tspan')\n .attr('x', x)\n .attr('y', y)\n .attr('dy', dy + 'em')\n .attr('dominant-baseline', baseline)\n .text(lines[0]);\n\n for (var lineNum = 1; lineNum < lines.length; lineNum++) {\n text\n .append('tspan')\n .attr('x', x)\n .attr('y', y)\n .attr('dy', lineNum * 1.1 + dy + 'em')\n .attr('dominant-baseline', baseline)\n .text(lines[lineNum]);\n }\n });\n }", "updateBoundingBox() {\n this.sceneObject.updateMatrixWorld();\n let box = this.sceneObject.geometry.boundingBox.clone();\n box.applyMatrix4(this.sceneObject.matrixWorld);\n this.boundingBox = box;\n }", "drawSvgWrapper() {\n //Construct Body\n var body = d3.select(\"#root\")\n\n //Construct SVG\n var svg = body\n .append(\"div\")\n .append(\"svg\")\n .attr(\"class\", \"svg\")\n .attr(\"id\", \"content\")\n .attr(\"width\", this.width)\n .attr(\"height\", this.height)\n .attr(\"viewBox\", this.viewBox)\n .attr(\n \"transform\",\n \"translate(\" +\n this.width / 2 +\n \",\" +\n this.height / 2 +\n \")\"\n )\n ;\n //Draw G for map\n return svg;\n }", "function _onEventWrapper(evt, callback){\n return function(){\n if(!layer.active()){ return; }\n if(arguments[0].constructor !== Object){\n console.error('First argument of event handler must be an object!');\n return;\n }\n var data = arguments[0].data;\n var eventObj = arguments[0].event;\n \n if(data === undefined){\n console.error('Must pass in data for clicked object');\n return;\n }\n\n //include a boundingClientRect in the function args\n var bb = layer.getBoundingClientRect({\n data: data,\n event: eventObj\n });\n arguments[0].bb = bb;\n \n console.debug(evt+' '+data.name);\n callback.apply(layer, arguments); \n }\n }", "function UpdateRubberbandSizeData(loc) {\r\n // Height & width are the difference between were clicked\r\n // and current mouse position\r\n shapeBoundingBox.width = Math.abs(loc.x - mousedown.x)\r\n shapeBoundingBox.height = Math.abs(loc.y - mousedown.y)\r\n \r\n // If mouse is below where mouse was clicked originally\r\n if(loc.x > mousedown.x) {\r\n // Store mousedown because it is farthest left\r\n shapeBoundingBox.left = mousedown.x\r\n } else {\r\n // Store mouse location because it is most left\r\n shapeBoundingBox.left = loc.x\r\n }\r\n // If mouse location is below where clicked originally\r\n if(loc.y > mousedown.y) {\r\n // Store mousedown because it is closer to the top of the canvas\r\n shapeBoundingBox.top = mousedown.y\r\n } else {\r\n // Otherwise store mouse position\r\n shapeBoundingBox.top = loc.y\r\n }\r\n}", "createWrapper() {\n return false;\n }", "_resetBoundingBoxStyles() {\n extendStyles(this._boundingBox.style, {\n top: '0',\n left: '0',\n right: '0',\n bottom: '0',\n height: '',\n width: '',\n alignItems: '',\n justifyContent: '',\n });\n }", "wrap(sprite) {\n\t\tsprite.x = mod(sprite.x, this.offset.x)\n\t\tsprite.y = mod(sprite.y, this.offset.y)\n\t}", "function Renderable() {\n\tthis.mPos = new Vec2(0, 0);\n\tthis.mSize = new Vec2(0, 0);\n\tthis.mOrigin = new Vec2(0, 0);\n\tthis.mAbsolute = false;\n\t\n\tthis.mDepth = 0;\n\t\n\tthis.mTransformation = new Matrix3();\n\tthis.mScale = new Vec2(1.0, 1.0);\n\tthis.mRotation = 0;\n\tthis.mSkew = new Vec2();\n\tthis.mAlpha = 1.0;\n\tthis.mCompositeOp = \"source-over\";\n\t\n\tthis.mLocalBoundingBox = new Polygon(); // the local bounding box is in object coordinates (no transformations applied)\n\tthis.mGlobalBoundingBox = new Polygon(); // the global bounding box is in world coordinates (transformations applied)\n\t\n\tthis.mLocalMask = new Polygon();\n\tthis.mGlobalMask = new Polygon();\n}", "function getBounds(obj, rounded) {\n var bounds = { x: Infinity, y: Infinity, width: 0, height: 0 };\n\n if (obj instanceof Container) {\n var children = object.children, l = children.length, cbounds, c;\n for (c = 0; c < l; c++) {\n cbounds = getBounds(children[c]);\n if (cbounds.x < bounds.x) bounds.x = cbounds.x;\n if (cbounds.y < bounds.y) bounds.y = cbounds.y;\n if (cbounds.width > bounds.width) bounds.width = cbounds.width;\n if (cbounds.height > bounds.height) bounds.height = cbounds.height;\n }\n } else {\n var gp, imgr;\n if (obj instanceof Bitmap) {\n gp = obj.localToGlobal(0, 0);\n imgr = { width: obj.image.width, height: obj.image.height };\n } else if (obj instanceof BitmapAnimation) {\n gp = obj.localToGlobal(0, 0);\n imgr = obj.spriteSheet._frames[obj.currentFrame];\n } else {\n return bounds;\n }\n\n bounds.width = imgr.width * Math.abs(obj.scaleX);\n if (obj.scaleX >= 0) {\n bounds.x = gp.x;\n } else {\n bounds.x = gp.x - bounds.width;\n }\n\n bounds.height = imgr.height * Math.abs(obj.scaleY);\n if (obj.scaleX >= 0) {\n bounds.y = gp.y;\n } else {\n bounds.y = gp.y - bounds.height;\n }\n }\n if (rounded) {\n bounds.x = (bounds.x + (bounds.x > 0 ? .5 : -.5)) | 0;\n bounds.y = (bounds.y + (bounds.y > 0 ? .5 : -.5)) | 0;\n bounds.width = (bounds.width + (bounds.width > 0 ? .5 : -.5)) | 0;\n bounds.height = (bounds.height + (bounds.height > 0 ? .5 : -.5)) | 0;\n }\n return bounds;\n}", "bbox() {\n let width = this.box.attr(\"width\");\n let height = this.box.attr(\"height\");\n let x = this.box.attr(\"x\");\n let y = this.box.attr(\"y\");\n let cy = y + height / 2;\n let cx = x + width / 2;\n\n return {\n width: width,\n height: height,\n x: x,\n y: y,\n cx: cx,\n cy: cy\n };\n }", "_getNonTransformedDimensions() {\n // Object dimensions\n return new fabric.Point(this.width, this.height).scalarAdd(\n this.padding + boundingBoxPadding\n )\n }", "async boundingBox() {\n throw new Error('Not implemented');\n }", "async boundingBox() {\n throw new Error('Not implemented');\n }", "function boundingBox(x,y,xextent,yextent)\n{\n \n this.x1=x;\n this.y1=y;\n this.x2=x+xextent;\n this.y2=y+yextent;\n this.toString=function(){ return 'boundingBox(('+this.x1+','+this.y1+'),('+this.x2+','+this.y2+'))'; }\n}", "getWraperElement() {\n return this._domElement\n }" ]
[ "0.6963676", "0.6963676", "0.6497933", "0.58999884", "0.58678913", "0.586718", "0.573446", "0.5566548", "0.55641305", "0.5530922", "0.5503147", "0.5433796", "0.5421997", "0.5417514", "0.5388392", "0.53417534", "0.5322144", "0.5319725", "0.53148735", "0.53148735", "0.53148735", "0.53148735", "0.5299408", "0.5285416", "0.5264986", "0.5239794", "0.52150744", "0.5214441", "0.5195099", "0.51940125", "0.5191595", "0.517409", "0.5147379", "0.5147291", "0.51330596", "0.51086295", "0.5105333", "0.5103494", "0.5100841", "0.50899154", "0.5079946", "0.50623", "0.5060518", "0.50531405", "0.5051474", "0.50415707", "0.50413966", "0.50407207", "0.50288904", "0.50227934", "0.5021874", "0.5011192", "0.4999438", "0.49990788", "0.49950945", "0.4980621", "0.49636468", "0.49620682", "0.4953463", "0.49523073", "0.49428135", "0.49357292", "0.49324974", "0.49262932", "0.49245468", "0.4920941", "0.4919073", "0.49172893", "0.49166784", "0.491404", "0.49113455", "0.49101293", "0.49060628", "0.49056476", "0.48918438", "0.48827115", "0.4880619", "0.48745924", "0.4871531", "0.4869877", "0.48569876", "0.48564917", "0.48523757", "0.48491848", "0.48483634", "0.48397732", "0.48382133", "0.48278308", "0.4825929", "0.4823361", "0.48220912", "0.48216593", "0.48173246", "0.4811835", "0.48117334", "0.4809767", "0.48030996", "0.47971058", "0.47971058", "0.4795723", "0.47950932" ]
0.0
-1
LA FONCTION TRAITER FLUX
function traiterFluxConnexion(flux){ var ERROR = ''; switch( flux['ERROR'] ) { case 1: ERROR = 'Please fill all the fields.'; break; case 2: ERROR = 'Account doesn\'t exists.'; break; case 3: ERROR = 'Wrong password.'; break; case 4: //Redirige le particulier vers l'index2 document.location.href="index.php?url=showcoupons"; break; case 5: //Redirige l'entreprise vers la page de gestion document.location.href="index.php?url=addbusiness"; break; } affiche_error_connexion(ERROR); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FunctionalComponent() {}", "function jT(e){let{basename:t,children:n,window:r}=e,i=S.useRef();i.current==null&&(i.current=HC({window:r,v5Compat:!0}));let o=i.current,[s,a]=S.useState({action:o.action,location:o.location});return S.useLayoutEffect(()=>o.listen(a),[o]),S.createElement(NT,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:o})}", "init(){\n this.initFunctional();\n }", "function fm(){}", "function loadFTUX () {\n var width = $(\"#sidebar\").css(\"width\");\n //Hide everything!\n $(\"#sidebar\").css(\"left\", \"-\" + width);\n $(\"#project-settings, #printConsoleTitle, #printConsole .alert, #printConsole .panel\").fadeOut();\n $(\"#viewStatusNav\").addClass(\"hide\");\n //Show FTUX\n $(\"#ftux\").fadeIn(\"slow\");\n }", "function rp(e){let{basename:n,children:t,window:r}=e,l=Y.useRef();l.current==null&&(l.current=Gd({window:r,v5Compat:!0}));let o=l.current,[i,u]=Y.useState({action:o.action,location:o.location}),s=Y.useCallback(c=>{\"startTransition\"in jc?Y.startTransition(()=>u(c)):u(c)},[u]);return Y.useLayoutEffect(()=>o.listen(s),[o,s]),Y.createElement(tp,{basename:n,children:t,location:i.location,navigationType:i.action,navigator:o})}", "transition(f)\n\t{\n\t\tvar arr=[];\n\t\tthis.each(\n\t\t\t(key, value)=>{\n\t\t\t\tarr.push( f(key, value) );\n\t\t\t}\n\t\t);\n\t\t\n\t\t/*if (isBrowser()) return Runtime.Collection.create(arr);*/\n\t\treturn use(\"Runtime.Collection\").create(arr);\n\t}", "function FurnitureShop() {}", "componentDidMount () {\n const referencedArray = [ \n this.swimlanes.backlog.current, \n this.swimlanes.inProgress.current,\n this.swimlanes.complete.current\n ]\n this.dragulaDecorator(referencedArray); \n }", "function ih(e){let{basename:t,children:n,window:r}=e,l=y.exports.useRef();l.current==null&&(l.current=sm({window:r,v5Compat:!0}));let o=l.current,[i,u]=y.exports.useState({action:o.action,location:o.location});return y.exports.useLayoutEffect(()=>o.listen(u),[o]),E(lh,{basename:t,children:n,location:i.location,navigationType:i.action,navigator:o})}", "view(model){\r\n //kreiraj listu napravljenih templejta u koji su ugurani podaci\r\n const airports = model.airports.reduce((html, airport) => html + chooseAirportItem(airport), '');\r\n const flightsHTML = model.flights.reduce((html, flight) => html + `<li>${flightsTemplate(flight)}</li>`, '');\r\n return `\r\n <div class = \"container\">\r\n ${flightFilterTemplate(airports)}\r\n ${flightSortTemplate}\r\n <br/>\r\n <ul class=\"list-unstyled\">\r\n ${flightsHTML}\r\n </ul>\r\n </div>\r\n `;\r\n // const flights = model.flights.reduce((html, flight) => html + flightsTemplate(flight), '');\r\n // return flightsContainerTemplate(flights);\r\n }", "function NJ(e){let{basename:t,children:r,window:n}=e,i=b.useRef();i.current==null&&(i.current=BG({window:n,v5Compat:!0}));let l=i.current,[a,o]=b.useState({action:l.action,location:l.location});return b.useLayoutEffect(()=>l.listen(o),[l]),b.createElement(FJ,{basename:t,children:r,location:a.location,navigationType:a.action,navigator:l})}", "function D8(t){let{basename:e,children:n,window:r}=t,i=ve.exports.useRef();i.current==null&&(i.current=$5({window:r,v5Compat:!0}));let s=i.current,[o,a]=ve.exports.useState({action:s.action,location:s.location});return ve.exports.useLayoutEffect(()=>s.listen(a),[s]),U(N8,{basename:e,children:n,location:o.location,navigationType:o.action,navigator:s})}", "function fechaserver() {\n}", "function FLIPON(state) {\n if (exports.DEBUG) {\n console.log(state.step, 'FLIPON[]');\n }\n state.autoFlip = true;\n }", "static buscarLaurelesPorAprobar() {\n\t\treturn LaurelController.buscarLaurelesPorAprobar();\n\t}", "function Bv(e){let{basename:t,children:n,window:r}=e,l=X.exports.useRef();l.current==null&&(l.current=gv({window:r}));let o=l.current,[i,u]=X.exports.useState({action:o.action,location:o.location});return X.exports.useLayoutEffect(()=>o.listen(u),[o]),X.exports.createElement(Fv,{basename:t,children:n,location:i.location,navigationType:i.action,navigator:o})}", "function fuctionPanier(){\n\n}", "function fyv(){\n \n }", "function initMegaFolio() {\n\t\tvar api=jQuery('.megafolio-container').megafoliopro(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfilterChangeAnimation:\"pagebottom\",\n\t\t\t\t\t\t\tfilterChangeSpeed:400,\n\t\t\t\t\t\t\tfilterChangeRotate:99,\n\t\t\t\t\t\t\tfilterChangeScale:0.6,\n\t\t\t\t\t\t\tdelay:20,\n\t\t\t\t\t\t\tdefaultWidth:980,\n\t\t\t\t\t\t\tpaddingHorizontal:10,\n\t\t\t\t\t\t\tpaddingVertical:10,\n\t\t\t\t\t\t\tlayoutarray:[9,11,5,3,7,12,4,6,13]\n\t\t\t\t\t\t});\n\n\t}", "function Fv(){var t=this;ci()(this,{$style:{enumerable:!0,get:function(){return t.$olObject}},$map:{enumerable:!0,get:function(){return t.$services&&uu()(t.$services)}},$view:{enumerable:!0,get:function(){return t.$services&&t.$services.view}},$stylesContainer:{enumerable:!0,get:function(){return t.$services&&t.$services.stylesContainer}}})}", "render() {\n return this._flux.render(this._flux.state);\n }", "render() {\n const store = this.props;\n let mode3d = store.mode3d;\n if (mode3d > 1) {\n mode3d = 1;\n }\n const slider3dr = store.slider3d_r;\n const slider3dg = store.slider3d_g;\n const wArr = [slider3dr, slider3dg];\n const sliderOpacity = store.sliderOpacity;\n const sliderIsosurface = store.sliderIsosurface;\n const wArrOpacity = [sliderOpacity];\n const wArrIsosurface = [sliderIsosurface];\n\n const jsxVolumeTF =\n <ul className=\"list-group\" >\n <li className=\"list-group-item\">\n <Nouislider onSlide={this.onChangeSliderTF.bind(this)} ref={'sliderTF'}\n range={{ min: 0.0, max: 1.0 }}\n start={wArr} connect={[false, true, false]} step={0.02} tooltips={true} />\n </li>\n <li className=\"list-group-item\">\n <p> Opacity </p>\n <Nouislider onSlide={this.onChangeSliderOpacity.bind(this)} ref={'sliderOpacity'}\n range={{ min: 0.0, max: 1.0 }}\n start={wArrOpacity} connect={[false, true]} step={0.02} tooltips={true} />\n </li>\n </ul>\n const jsxIsoTF =\n <ul className=\"list-group\">\n <li className=\"list-group-item\">\n <p> Isosurface </p>\n <Nouislider onSlide={this.onChangeSliderIsosurface.bind(this)} ref={'sliderIsosurface'}\n range={{ min: 0.0, max: 1.0 }}\n start={wArrIsosurface} connect={[false, true]} step={0.02} tooltips={true} />\n </li>\n </ul>\n const jsxArray = [jsxIsoTF, jsxVolumeTF];\n const jsxRet = jsxArray[1];\n return jsxRet;\n }", "_reflow() {\n this._init();\n }", "function Home({films, removeMoviesAction, addToFavoritesAction}) {\n\n\n function renderMovie() {\n let film = films[0]\n return (\n <Card \n rightClick= {addFav}\n leftClick= {nextMovie} \n {...film} />\n )\n }\n\n //Posibilita otras acciones como la inclusion de animaciones o notificaciones\n function nextMovie(){\n removeMoviesAction();\n }\n\n function addFav(){\n addToFavoritesAction();\n }\n\n return (\n <div className={styles.container}>\n <h2>Movies</h2>\n <div>\n {renderMovie()}\n </div>\n </div>\n )\n}", "caricaFlussi() {\n\t\tthis.serviceFlussi.all(this.riempiFlussi)\n\t}", "function FLIPON(state) {\n if (exports.DEBUG) console.log(state.step, 'FLIPON[]');\n state.autoFlip = true;\n}", "act(state){\n\n }", "bindHooks() {\n //\n }", "componentDidMount () {\n FluentRevealEffect.applyEffect(\".effect-group-container\", {\n clickEffect: true,\n lightColor: \"rgba(20,20,20,0.8)\",\n gradientSize: 80,\n isContainer: true,\n children: {\n borderSelector: \".btn-border\",\n elementSelector: \".btn\",\n lightColor: \"rgba(20,20,20,0.3)\",\n gradientSize: 150\n }\n })\n\n //For .title\n FluentRevealEffect.applyEffect(\".title\", {\n lightColor: \"rgba(255,255,255,0.4)\",\n gradientSize: 150\n })\n }", "function FrontEnd(){\n}", "render() {\r\n\t\tvar clicarFilaAux = this.props.clicarFila;\r\n\t\tvar filMuesAux = this.props.filaMuestra;\r\n\t\tvar tam = this.props.tamanio;\r\n\t\tvar i = this.props.indice;\r\n\t\treturn (\r\n\t\t <div className=\"board-row\">\r\n\t\t\t\t{this.creaCasillasDeFila(i,tam,filMuesAux,clicarFilaAux)}\r\n\t\t </div>\r\n\t\t);\r\n\t}", "render() {\n\n return(\n <FishRender\n width={this.state.width}\n height={this.state.height}\n hooks={this.state.hooks}\n totalg={this.state.totalg}\n hookprices={this.state.hookprices}\n hookdesc={this.state.hookdesc}\n addCommas={this.props.addCommas}\n buyHook={(hooknum) => this.buyHook(hooknum)}\n />\n )\n }", "function FLIPON(state) {\n if (DEBUG) console.log(state.step, 'FLIPON[]');\n state.autoFlip = true;\n}", "render() {\n return <Layout>\n <h3>Active Gestures</h3>\n\n {this.renderActiveGestures()}\n </Layout>\n }", "function forestry_production(){\n a_FAO_i='forestry_production';\n initializing_change();\n change();\n}", "function app () {\n renderUI()\n // tabulateLifetimeTotals();\n}", "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)", "constructor() {\n super();\n this.state = {\n faucetinfo: null\n };\n }", "function affichageTshirt(){\r\n\t\t$.getJSON(\r\n\t\t\t\"dispatcher.php\",\r\n\t\t\t{\r\n\t\t\t\t// Je veux que DISPATCHER me donne une info spécifique\r\n\t\t\t\toperation : \"tri\",\r\n\t\t\t\tcreateur : \t$($selectCreateurs+\" option:selected\").text(),\r\n\t\t\t\tmatiere : \t$($selectMatieres+\" option:selected\").text(),\r\n\t\t\t\tcategorie : $($selectCategories+\" option:selected\").text()\r\n\r\n\t\t\t},\r\n\t\t\tfunction(data){\r\n\t\t\t\t// fonction créée dans le fichier JS \"fonctionUtile.js\"\r\n\t\t\t\tsupprimerEnfant(\"section#tshirt ul.lTshirt\");\r\n\t\t\t\tboucleFor(data[\"tabNomsTshirt\"],\"li\",$(\"section#tshirt ul.lTshirt\"),\"prod_nom\",\"prod_id\");\r\n\t\t\t\tsetTimeout(lesIcones,10,$(\"section#tshirt ul.lTshirt li\"));\r\n\t\t\t}\r\n\t\t);\r\n\t}", "fa () {\n\t\tfor (let i = 0; i < 3; i++)\n\t\t\tthis.f();\n\t}", "function livestock_production(){\n a_FAO_i='livestock_production';\n initializing_change();\n change();\n}", "setupEffectController(){\n this.effectControllerGUI = new dat.GUI({\n height:28*2 - 1\n });\n\n this.effectControllerGUI.domElement.id = 'effect-controller';\n\n this.effectControllerGUI.add(this.effectController, 'showGround').name(\"Show Ground Plane\");\n this.effectControllerGUI.add(this.effectController, 'showAxes').name(\"Show Axes\");\n this.effectControllerGUI.add(this.effectController,'viewSide', { front:1, back: 2, left: 3,right:4 }).name(\"View Side\");\n this.effectControllerGUI.add(this.effectController, 'lightType',{ default:1, spotlight:2}).name(\"Light Type\");\n\n }", "applyForceLayout() {\n const state = this.store.getState();\n applyForce(\n state.areas.list,\n state.data.list,\n state.chart.width,\n (newAreas) =>\n this.store.dispatch(applyForceAreas(newAreas, state.chart.height)),\n (newPapers) =>\n this.store.dispatch(applyForcePapers(newPapers, state.chart.height)),\n this.config\n );\n }", "componentDidMount() {\n let fabtn = document.querySelectorAll(\".fixed-action-btn\");\n M.FloatingActionButton.init(fabtn, {});\n\n let tooltips = document.querySelectorAll(\".tooltipped\");\n M.Tooltip.init(tooltips, {});\n }", "afterRender() {\n\n application.map.setZoom(6);\n this.resetMapData();\n $('#welcomeModal').modal('hide');\n $('#legend-toggle').trigger('click');\n\n L.Icon.Default.imagePath = \"../static/img\";\n\n // Display average precipitation layer - this sort of thing happens in tour step action methods hereafter\n $('#apLayer-switch').trigger('click');\n\n // Avg Precip explanation step\n this.tour.addStep('ap-step', {\n title: 'Annual Precipitation',\n text: 'The Annual Precipitation layer shows how total rain and snowfall each year is projected to grow by the 2040-2070 period. More annual precipitation means more water going into rivers, lakes and snowbanks, a key risk factor for bigger floods. These projections come from the National Oceanic and Atmospheric Administration (2014).',\n attachTo: '#apToggle top',\n buttons: [{\n text: 'Next',\n action() {\n $('#epLayer-switch').trigger('click');\n return tour.next();\n }\n }\n ]\n });\n\n // Ext Precip explanation step\n this.tour.addStep('ep-step', {\n title: 'Storm Frequency',\n text: 'The Storm Frequency layer shows how days with heavy rain or snow (over 1 inch per day) are projected to come more often by the 2040-2070 period. More storm frequency means more rapid surges of water into rivers and lakes, a key risk factor for more frequent flooding. These projections also come from the National Oceanic and Atmospheric Administration (2014).',\n attachTo: '#stormsToggle top',\n buttons: [{\n text: 'Next',\n action() {\n $('#floods-switch').trigger('click');\n return tour.next();\n }\n }\n ]\n });\n\n // Floods explanation step\n this.tour.addStep('flood-step', {\n title: 'Flood Zones',\n text: 'The Flood Zones show the areas that already are at major risk for flooding, based on where floods have historically reached. If floods become larger and more frequent, many neighboring areas to these historical flood zones are likely to start experience flooding. This information comes from the Federal Emergency Management Administration (2014).',\n attachTo: '#floodZonesToggle top',\n buttons: [{\n text: 'Next',\n action: tour.next\n }\n ]\n });\n\n // Display search step\n this.tour.addStep('search-step', {\n title: 'Search',\n text: 'Search for a specific address, city or landmark. Try using the search bar now to find a location you care about in the Midwest.',\n attachTo: '.search-input bottom',\n buttons: [{\n text: 'Next',\n action() {\n return setTimeout(() => tour.next()\n , 450);\n }\n }\n ]\n });\n\n // Display query step\n // TODO: Not totally in love w/ the animation here - play around with it some more.\n this.tour.addStep('query-step', {\n title: 'Inspect',\n text: '<p>Right click anywhere on the map to inspect the numbers for that specific place.</p><br /><p>Take a tour of some communities at high risk for worsened flooding.</p>',\n attachTo: '#query left',\n buttons: [{\n text: 'Take a Tour',\n action() {\n let latlng = [44.519, -88.019];\n application.layout.views['map'].setAddress(latlng, 13);\n if (application.map.marker) {\n application.map.removeLayer(application.map.marker);\n }\n let marker = application.map.marker = L.marker(latlng, { icon: defaultIcon }).addTo(application.map);\n return tour.next();\n }\n }\n , {\n text: 'Stop Tour',\n action: this.resetMapAfterTour\n }\n ]\n });\n\n // The following steps show particular regions on the map\n this.tour.addStep('map-lambeau', {\n title: 'Green Bay, WI',\n text: 'The home of the Packers has a large neighborhood of paper plants and homes at high risk of worsened flooding, with storm days increasing nearly 40% and annual precipitation rising 10% in the next few decades.',\n attachTo: '.leaflet-marker-icon left',\n buttons: [{\n text: 'Continue',\n action() {\n let latlng = [43.1397, -89.3375];\n application.layout.views['map'].setAddress(latlng, 13);\n if (application.map.marker) {\n application.map.removeLayer(application.map.marker);\n }\n let marker = application.map.marker = L.marker(latlng, { icon: defaultIcon }).addTo(application.map);\n return tour.next();\n }\n }\n , {\n text: 'Stop Tour',\n action: this.resetMapAfterTour\n }\n ]\n });\n\n this.tour.addStep('map-dane', {\n title: 'Madison, WI Airport',\n text: 'Airports are often built on flat areas near rivers, placing them at serious risk of flooding, like Madison’s main airport, serving 1.6 million passengers per year.',\n attachTo: '.leaflet-marker-icon left',\n buttons: [{\n text: 'Continue',\n action() {\n let latlng = [42.732072157891224, -84.50576305389404];\n application.layout.views['map'].setAddress([42.73591782230738, -84.48997020721437], 13);\n if (application.map.marker) {\n application.map.removeLayer(application.map.marker);\n }\n let marker = application.map.marker = L.marker(latlng, { icon: defaultIcon }).addTo(application.map);\n return tour.next();\n }\n }\n , {\n text: 'Stop Tour',\n action: this.resetMapAfterTour\n }\n ]\n });\n\n this.tour.addStep('map-lansing', {\n title: 'Lansing, MI',\n text: 'A large stretch of downtown businesses and homes are at risk of worsened flooding, as well as part of the Michigan State campus.',\n attachTo: '.leaflet-marker-icon left',\n buttons: [{\n text: 'Continue',\n action() {\n let latlng = [41.726, -90.310];\n application.layout.views['map'].setAddress([41.7348457153312, -90.310], 13);\n if (application.map.marker) {\n application.map.removeLayer(application.map.marker);\n }\n let marker = application.map.marker = L.marker(latlng, { icon: defaultIcon }).addTo(application.map);\n\n return tour.next();\n }\n }\n , {\n text: 'Stop Tour',\n action: this.resetMapAfterTour\n }\n ]\n });\n\n this.tour.addStep('map-quadcities', {\n title: 'Quad Cities Nuclear Generating Station',\n text: 'Power plants, including nuclear plants like the one here, are frequently built on riverbanks to use water for cooling. Larger, more frequent future floods could place these power plants and their communities at risk.',\n attachTo: '.leaflet-marker-icon bottom',\n buttons: [{\n text: 'Stop Tour',\n action: this.resetMapAfterTour\n }\n ]\n });\n\n return this.tour.start();\n }", "render(){\r\n\r\n\t}", "constructor(objeto,view,...parametros){\n let proxy= ProxyFactory.create(objeto, parametros, (model) => view.update(model));\n view.update(proxy);\n //retorna uma instancia no proprio construtor\n return proxy;\n }", "function LaserficheFields()\n{\n var self = this;\n function LoadData() {\n if (window.parent !== window && window.parent.webAccessApi !== undefined) {\n var metadata = window.parent.webAccessApi.getFields();\n self.fieldData = metadata.fields.templateFields.concat(metadata.fields.supplementalFields);\n return self.fieldData;\n }\n else {\n return undefined;\n }\n }\n function GetField(fieldName) {\n var self = this;\n var fieldData = self.FieldData;\n return $(fieldData).filter(function(i, e) { return e.name === fieldName; });\n }\n function FillFields(fieldName, suppress) {\n var self = this;\n var fields;\n var i;\n var j;\n var selector;\n var element;\n var tempDate;\n var target;\n var field;\n var fieldType;\n var fieldData;\n var values;\n var val;\n \n suppress = (suppress === true);\n fieldData = self.FieldData;\n //If no field name is given fill all fields\n if(fieldName === undefined) {\n fields = fieldData;\n }\n else {\n //Find the field name and add it to the processing queue\n fields = self.GetField(fieldName);\n }\n \n if (typeof fields === 'undefined')\n return;\n \n \n //Fill the fields\n for(i = 0; i < fields.length; i += 1) {\n element = undefined; //reset value\n tempDate = undefined;\n target = undefined;\n field = undefined;\n fieldType = undefined;\n values = undefined;\n v = undefined;\n \n field = fields[i];\n \n \n\n var inTable = false;\n element = $('li.form-q[attr=\"' + field.name.replace(/\\W/g, '_') + '\"]')\n \n if(element.length > 0) {\n //Assume we are only supporting text and dropdowns.\n fieldType = GetFieldType(element);\n target = GetDataFields(element, fieldType);\n \n //If a multivalued field click ADD enough times to get the correct number of fields.\n if(Array.isArray(field.value) && target.length < field.value.length) {\n if (inTable) {\n var tableParent = element.closest(\".cf-table_parent\");\n for(j = 0; j < field.value.length - target.length; j += 1) {\n tableParent.find('.cf-table-add-row').click();\n }\n\n element = tableParent.find('td[data-title=\"' + field.name + '\"]');\n }\n else {\n for(j = 0; j < field.value.length - target.length; j += 1) {\n $('a[ref-id=\"' + element.attr('id') + '\"]').click();\n }\n }\n \n target = GetDataFields(element, fieldType);\n }\n\n \n //Handle multivalue fields\n field.value = Array.isArray(field.value) ? field.value : [field.value];\n target.each(function(index, element){\n v = field.value[index];\n element = element instanceof jQuery ? element : $(element);\n if(v) {\n \t//add allowed field types here\n if(fieldType === 'text' || fieldType === 'longtext' || fieldType === 'number' || fieldType === 'email' || fieldType === 'currency') { \n element.val(v);\n }\n //The dropdown menu may be filled by a lookup. In this case the option does not\n //exist. Add the option and then reselect it.\n else if(fieldType === 'select') {\n element.val(v);\n if(element.val() === null) {\n element.append('<option value=\"' + v + '\">' + v + '</option>') \n .val(v);\n }\n }\n //Format date strings so that we omit timestamps and convert to a user-readable format\n \t//JavaScript epoc date is 1/1/1900\n \t//JavaScript months are base 0\n else if(fieldType === 'date' && v !== null) {\n tempDate = new Date(v);\n element.val((tempDate.getMonth() + 1) + '/' + tempDate.getDate() + '/' + (tempDate.getYear() + 1900));\n } \n }\n });\n }\n }\n }\n \n\n self.FieldData = LoadData();\n self.Refresh = LoadData;\n self.Fill = FillFields;\n self.GetField = GetField;\n \n return this;\n}", "function hooks(){return hookCallback.apply(null,arguments)}", "function hooks(){return hookCallback.apply(null,arguments)}", "onAfterRendering() {}", "function environment_fertilizers(){\n a_FAO_i='environment_fertilizers';\n initializing_change();\n change();\n}", "function ftux () {\n if (scout.projects.length < 1) {\n loadFTUX();\n autoGuessProjectsFolder();\n autoGrabProjects();\n updatePanelContent();\n ftuxEvents();\n ftuxUnlock();\n } else {\n unloadFTUX();\n }\n }", "function visa_c_countryActions(){\n/**\n * Go initialize VTS tabs component\n */\n\nvtsTabs();\n\n// $('.documents-list__grid').masonry({\n// // options\n// itemSelector: '.documents-list__grid-item',\n// columnWidth: '.documents-list__grid-item'\n// });\n\n}", "function sf(){}", "init() {\n return store.getFavs().map((fav) => {\n if (fav.category === 'shows') return new FavShow(fav);\n return new FavActor(fav);\n });\n }", "function createNewFunctionView() {\n // json set\n var dataSet = pluto.loadedDataSet[pluto.selectedPlutoName];\n \n // gets the pluto\n var layer = pluto.loadedPluto[pluto.selectedPlutoName];\n // create layer.\n layer.loadFillLayer(thr, pluto.selectedFunctionName, dataSet);\n }", "function LView(){}", "renderFlights(obj, startpl, pagination) {\n const flights = Object.keys(obj).map(i => obj[i]);\n const sp = Object.keys(startpl).map(i => startpl[i]);\n //if the user uses the next-button and then uses a filter, we have to reset the index-nrs. of the flight to use the slice-methode\n let itemsToShowIndex = (pagination === 0 || pagination < (this.state.itemsToShowStart/this.state.numberOfShowItems)) ? 0 : this.state.itemsToShowStart;\n let itemsToShowIndexMax = (pagination === 0 || pagination < (this.state.itemsToShowStart/this.state.numberOfShowItems)) ? this.state.numberOfShowItems : this.state.itemsToShow;\n return flights.slice(itemsToShowIndex, itemsToShowIndexMax).map((x) => {\n return sp.map((z)=>{\n if(x.startplace.area === z.id){\n let startplaceName = _.find(z.startplaces, { id: x.startplace.startplace }).name;\n let isactiveuser = x.pilot.email === this.props.activeUser ? true : false;\n return (\n <tr className=\"table__row table__row--animated\" key={x.id}>\n <td className=\"table__date\">{x.date}</td>\n <td className=\"table__pilot\">{x.pilot.name}</td> \n <td className=\"table__start\">{`${z.name}, ${startplaceName}`}</td>\n <td className=\"table__duration\">{utils.timeToHourMinString(x.flighttime)}</td>\n <td className=\"table__distance\">{x.xcdistance}&nbsp;km</td>\n <td className=\"table__details\"><Link className=\"anchor table__link\" to={routes.FLUG + x.id}>Flugdetails</Link></td>\n <td className=\"table__details table__details--icons\"> \n {isactiveuser ? <Link className=\"table__icon\" to={routes.FLUGDATEN_ERFASSEN + \"/\" + x.id}>\n <svg version=\"1.1\" className=\"svg-icon svg-icon--edit\" x=\"0px\" y=\"0px\" viewBox=\"0 0 23.7 23.7\">\n <path className=\"svg-icon__path\" d=\"M20.5,6.3l2.4-2.4l-3.1-3.1l-2.4,2.4\"/>\n <path className=\"svg-icon__path\" d=\"M6.4,20.3l14.1-14l-3.1-3.1l-14.1,14l-2.5,5.5L6.4,20.3z M3.3,17.2l3.1,3.1\"/>\n </svg>\n </Link> : null}\n <button className=\"table__icon\" onClick={(event) => {this.copyFlight(event, x.id)}}>\n <svg version=\"1.1\" className=\"svg-icon svg-icon--copy\" x=\"0px\" y=\"0px\" viewBox=\"0 0 23.7 23.7\" >\n <path className=\"svg-icon__path\" d=\"M5.9,6h16.9v16.9H5.9V6z\"/>\n <path className=\"svg-icon__path\" d=\"M5.9,17.7H0.8V0.8h16.9v5.1\"/>\n </svg>\n </button>\n {isactiveuser ? <button className=\"table__icon\" onClick={(event) => {this.showMessageBox(event, x.id, x.imgUrl)}}>\n <svg version=\"1.1\" className=\"svg-icon svg-icon--delete\" x=\"0px\" y=\"0px\" viewBox=\"0 0 23.7 23.7\">\n <path className=\"svg-icon__path\" d=\"M2.2,3.7h19 M8.1,3.7V2.2c0-0.8,0.6-1.4,1.4-1.4H14c0.8,0,1.4,0.6,1.4,1.4l0,0v1.5 M19.2,3.7L18.1,21\n c0,1-0.8,1.8-1.8,1.8H7.1c-1,0-1.8-0.8-1.8-1.8L4.2,3.7\"/>\n <path className=\"svg-icon__path\" d=\"M11.7,6.7v13.2 M8.1,6.7l0.7,13.2 M15.4,6.7l-0.7,13.2\"/>\n </svg>\n </button> : null}\n </td>\n </tr>\n );\n }\n return null;\n })\n }); \n }", "function JFather() {\r\n\t}", "show (args){ this.transitioner.show(args) }", "inject(_context, _carrier) { }", "inject(_context, _carrier) { }", "onStoreFilter() {}", "function reduxActionFunctions(dispatch){\n return bindActionCreators({\n set_sampleString : set_sampleString,\n set_is_logged : set_is_logged\n\t\t// si set_sampleString function kay makit an sa actions folder\n },dispatch);\n }", "function reduxActionFunctions(dispatch){\n return bindActionCreators({\n set_sampleString : set_sampleString,\n set_is_logged : set_is_logged\n\t\t// si set_sampleString function kay makit an sa actions folder\n },dispatch);\n }", "function U(He){Le&&(He._devtoolHook=Le,Le.emit('vuex:init',He),Le.on('vuex:travel-to-state',function(Ne){He.replaceState(Ne)}),He.subscribe(function(Ne,je){Le.emit('vuex:mutation',Ne,je)}))}", "function nectarFancyUlInit() {\r\n\t\t\t\t\t\r\n\t\t\t\t\t$($fullscreenSelector + '.nectar-fancy-ul').each(function () {\r\n\r\n\t\t\t\t\t\tvar $icon = $(this).attr('data-list-icon'),\r\n\t\t\t\t\t\t$color = $(this).attr('data-color'),\r\n\t\t\t\t\t\t$animation = $(this).attr('data-animation'),\r\n\t\t\t\t\t\t$animationDelay = 0; \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif($(this).is('[data-animation-delay]') && \r\n\t\t\t\t\t\t\t$(this).attr('data-animation-delay').length > 0 && \r\n\t\t\t\t\t\t\t$(this).attr('data-animation') != 'false') {\r\n\t\t\t\t\t\t\t$animationDelay = $(this).attr('data-animation-delay');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$(this).find('li').each(function () {\r\n\t\t\t\t\t\t\tif ($(this).find('> i').length == 0) {\r\n\t\t\t\t\t\t\t\t$(this).prepend('<i class=\"icon-default-style ' + $icon + ' ' + $color + '\"></i> ');\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\t\t\t\t\t\tif ($animation == 'true') {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar $that = $(this),\r\n\t\t\t\t\t\t\twaypoint \t= new Waypoint({\r\n\t\t\t\t\t\t\t\telement: $that,\r\n\t\t\t\t\t\t\t\thandler: function () {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif ($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) {\r\n\t\t\t\t\t\t\t\t\t\twaypoint.destroy();\r\n\t\t\t\t\t\t\t\t\t\treturn;\r\n\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\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t\t\t\t$that.find('li').each(function (i) {\r\n\t\t\t\t\t\t\t\t\t\t\tvar $that = $(this);\r\n\t\t\t\t\t\t\t\t\t\t\t$that.delay(i * 220).transition({\r\n\t\t\t\t\t\t\t\t\t\t\t\t'opacity': '1',\r\n\t\t\t\t\t\t\t\t\t\t\t\t'left': '0'\r\n\t\t\t\t\t\t\t\t\t\t\t}, 220, 'easeOutCubic');\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t}, $animationDelay);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$that.addClass('animated-in');\r\n\t\t\t\t\t\t\t\t\twaypoint.destroy();\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\toffset: 'bottom-in-view'\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t});\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});\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function ForageablesContainer() {\n const [forageables, setForageables] = useState([]);\n const [forageablesCount, setForageablesCount] = useState(-1);\n \n\n //useEffect hook to setForageables and setForageablesCount whenever forageables or forageablesCount changes\n useEffect(() => {\n if (forageables.length === forageablesCount) return;\n fetch(\"http://localhost:3004/forageables\")\n .then (r => r.json())\n .then (data => setForageables(data))\n setForageablesCount(forageables.length);\n },[forageables, forageablesCount]);\n \n //returns a div with the ForageablesCollection component. \n //Passes down props and callback functions to ForageablesCollection \n return (\n <div>\n <ForageablesCollection onChange={setForageables} setForageables={setForageables} forageables={forageables} forageablesCount={forageablesCount} setForageablesCount={setForageablesCount} />\n </div>\n )\n}", "function addHooksToAf() {\n _(that.pageMap).pluck('form').forEach(function(formId) {\n if (formId) {\n AutoForm.addHooks(formId, that.autoFormHooks(), true);\n }\n }\n )\n }", "function Xie(e){let{basename:t,children:r,window:n}=e,i=T.exports.useRef();i.current==null&&(i.current=Cie({window:n,v5Compat:!0}));let a=i.current,[o,l]=T.exports.useState({action:a.action,location:a.location});return T.exports.useLayoutEffect(()=>a.listen(l),[a]),R(Yie,{basename:t,children:r,location:o.location,navigationType:o.action,navigator:a})}", "function MultiFlattener() {}", "function L() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (Clef.DEBUG) _vex__WEBPACK_IMPORTED_MODULE_0__[\"Vex\"].L('Vex.Flow.Clef', args);\n}", "function useStudyProgramBase() {\n // hooks\n const studyProgram = useSelector((store) => store[typeStore.STUDY_PROGRAM]);\n const dispatch = useDispatch();\n let studyProgramObj = {};\n studyProgram.length > 0 &&\n studyProgram.map((item) => (studyProgramObj[item.id] = item));\n\n // handle func\n // handle func\n const postStudyProgram = async (obj = {}) => {\n const { message, data } = await baseAPI.add(url_api.STUDY_PROGRAM, obj);\n if (message === 'OK') {\n studyProgram.push(data);\n dispatch({\n type: typeAction.STUDY_PROGRAM.POST,\n payload: { data: [...studyProgram] },\n });\n debugger; // MongLV\n messageAnt.success('Thêm thành công');\n } else messageAnt.warn(message);\n };\n const getListStudyProgram = async (obj) => {\n const { message, data } = await baseAPI.getAll(url_api.STUDY_PROGRAM, obj);\n if (message === 'OK') {\n let objData = {};\n data.map((item) => (objData[item.id] = item));\n const newObj = { ...studyProgramObj, ...objData };\n dispatch({\n type: typeAction.STUDY_PROGRAM.GET_LIST,\n payload: { data: [...Object.values(newObj)] },\n });\n } else messageAnt.warn(message);\n };\n const putStudyProgram = async (data = {}) => {\n const { message } = await baseAPI.update(url_api.STUDY_PROGRAM, data);\n const id = data.id;\n if (message === 'OK') {\n const newData = studyProgram.map((item) => {\n if (item.id === id) return { ...item, ...data };\n return item;\n });\n dispatch({\n type: typeAction.STUDY_PROGRAM.GET_LIST,\n payload: { data: [...newData] },\n });\n } else messageAnt.warn(message);\n };\n return {\n studyProgram,\n studyProgramObj,\n postStudyProgram,\n getListStudyProgram,\n putStudyProgram,\n };\n}", "function useProductBase() {\n // hooks\n const product = useSelector((store) => store[typeStore.PRODUCT]);\n const dispatch = useDispatch();\n let productObj = {};\n product.map((item) => (productObj[item.id] = item));\n\n // handle func\n const postProduct = async (obj = {}) => {\n const { message, data } = await baseAPI.add(url_api.PRODUCT, obj);\n if (message === 'OK') {\n product.push(data);\n dispatch({ type: typeAction.PRODUCT.POST, payload: { data: [...product] } });\n messageAnt.success('Thêm thành công');\n } else messageAnt.warn(message);\n };\n\n const getListProduct = async (obj = {}) => {\n const { message, data } = await baseAPI.getAll(url_api.PRODUCT, obj);\n if (message === 'OK') {\n dispatch({ type: typeAction.PRODUCT.GET_LIST, payload: { data: [...data] } });\n } else messageAnt.warn(message);\n };\n\n const updateProduct = async (obj = {}) => {\n const { message } = await baseAPI.update(url_api.PRODUCT, obj);\n if (message === 'OK') {\n const newData = product.map((item) => {\n if (item.id === obj.id) return { ...item, ...obj };\n return item;\n });\n dispatch({\n type: typeAction.PRODUCT.GET_LIST,\n payload: { data: [...newData] },\n });\n messageAnt.success('Thành công');\n } else messageAnt.warn(message);\n };\n const hideProduct = async (obj = {}) => {\n if (obj.id) {\n obj.status = obj.status === 0 ? 1 : 0;\n await updateProduct(obj);\n }\n };\n\n return {\n product,\n productObj,\n postProduct,\n getListProduct,\n hideProduct,\n updateProduct,\n };\n}", "function App() {\n \n \n return (\n <div className=\"App\">\n <div className=\"count\">\n \n {/* <HookuseState/>\n <HookuseState2/>\n <UseStateArray/>\n <HookMouse/> */}\n {/* <MouseContainer/> */}\n <firstName.Provider value = {{name:\"pavan \" ,lastname:\"kmar\" , number:861545}}>\n \n <ConA/>\n \n </firstName.Provider>\n \n </div>\n </div>\n );\n}", "function LEAD_FORM_HANDLER(state, collection) {\n if (collection.apntVisible) {\n state.leadsFormHandler.apntVisible = collection.apntVisible;\n state.leadsFormHandler.divshow = collection.divshow;\n console.log(collection);\n } else if (collection.dateTimeVisible) {\n state.leadsFormHandler.dateTimeVisible = collection.dateTimeVisible;\n console.log(collection);\n } else if (collection.showChildFields) {\n state.leadsFormHandler.showChildFields = collection.showChildFields;\n }\n // console.log(collection);\n\n // Fresh Lead Indicator :\n else if (collection.freshLead) {\n // if (state.leadsFormHandler.freshLead === true) {\n state.leadsFormHandler.freshLead = collection.freshLead;\n // } else if (state.leadsFormHandler.freshLead === false) {\n // state.leadsFormHandler.freshLead = true\n // }\n } else if (collection.httpMethod) {\n // It Accept String POST or PUT\n state.leadsFormHandler.httpMethod = collection.httpMethod; /** Http Method POST and PUT */\n console.log('HTTP METHOD: ', collection.httpMethod);\n } else if (collection._leadId) {\n state.leadsFormHandler._leadId = collection._leadId;\n }\n}", "function callHooks(currentView,arr){for(var i=0;i<arr.length;i+=2){arr[i+1].call(currentView[arr[i]]);}}", "function styleApp(el, data) {\r\n\t var _tram = tram(el);\r\n\r\n\t // Get computed transition value\r\n\t el.css('transition', '');\r\n\t var computed = el.css('transition');\r\n\r\n\t // If computed is set to none, clear upstream\r\n\t if (computed === transNone) computed = _tram.upstream = null;\r\n\r\n\t // Set upstream transition to none temporarily\r\n\t _tram.upstream = transNone;\r\n\r\n\t // Set values immediately\r\n\t _tram.set(tramify(data));\r\n\r\n\t // Only restore upstream in preview mode\r\n\t _tram.upstream = computed;\r\n\t }", "onRender () {\n\n }", "state (...args) {\n return MVC.ComponentJS(this).state(...args)\n }", "function LessonPreview(props) {\n const [state, dispatch] = useReducer(lessonReducer, initialState);\n\n useEffect(() => {\n\n if (!props.lesson) {\n return\n }\n let x = (props.lesson);\n var result = Object.keys(x).map(function (key) {\n return x[key];\n });\n // setTools(result)\n console.log(result);\n dispatch(editStaggedTools(result));\n }, [props.lesson]);\n\n return (\n <TOOLS_STATE.Provider value={{ state, dispatch }}>\n <section style={{position:'fixed'}}>\n <Tools isPreview/>\n <div className=\"row\">\n <MainEditor isPreview/>\n <StagedTools isPreview />\n <ResourceEditor isPreview/>\n </div>\n </section>\n </TOOLS_STATE.Provider>\n );\n}", "function LView() { }", "function LView() { }", "function actionSliders(arr) {\n \"use strict\";\n\n //planet distance\n arr[0].noUiSlider.on('slide', function( values, handle) {\n var newvalue = values[handle];\n document.getElementById('orbdis').value = newvalue;\n });\n //planets size\n arr[1].noUiSlider.on('slide', function( values, handle) {\n var newvalue = values[handle];\n newvalue /= 5;\n newvalue = newvalue.toFixed(2);\n document.getElementById('plansize').value = newvalue;\n });\n //planet speed\n arr[2].noUiSlider.on('slide', function( values, handle) {\n var newvalue = values[handle];\n newvalue /= 20;\n newvalue = newvalue.toFixed(1);\n document.getElementById('spchange').value = newvalue;\n });\n\n}", "constructor() {\n // initialize view listener\n this._view = new FilterView();\n // set view backward\n this._view.backward = this.backward;\n // set view dispatch\n this._view.dispatch = this.dispatch;\n // set view handler\n this._view.handler = this.handler;\n // set view filter\n this._view.filter = this.filter;\n // set view write\n this._view.write = this.write;\n // initialize firebase service\n this._firebase = new FirebaseService(config.firebase);\n // bind an event handler to verify authentication user\n firebase.auth().onAuthStateChanged((authentication) => {\n // verify user is signed in\n if (authentication) {\n // initialize authentication\n this._authentication = authentication;\n // verify authentication permission\n if (this._authentication.email === config.admin) {\n // initialize odor data store\n this._store = new OdorDataStore();\n // set added event in store\n this._store.added = this.added;\n // set changed event in store\n this._store.changed = this.changed;\n // set removed event in store\n this._store.removed = this.removed;\n // initialize odors maps\n this._odors = new Map();\n // dispatch filter service to listener\n this.filter();\n } else {\n // redirect to master page\n window.location.replace(\"/master\");\n }\n } else {\n // redirect to activation page\n window.location.replace(\"/activation\");\n }\n });\n }", "function TableConfigurator({onSubmit}) {\n const curLang = useLangHandler(state => state.state);\n //antd form hook\n const [form] = Form.useForm();\n //form values state\n const [values, setValues] = useState({length: 2.0, width: 0.75, chair: 0.45, offset: 1.5});\n\n return (\n <Form \n form={form}\n onValuesChange={(changedValues, allValues) => {\n setValues(allValues);\n }}\n onReset={() => form.resetFields()}\n onFinish={onSubmit}\n initialValues={values}\n colon={false}\n >\n <Form.Item name=\"length\" label={Language[curLang][\"length\"]+\": \"+values.length+\"m\"}>\n <Slider min={0.10} max={10} step={0.01} name=\"length\"/>\n </Form.Item> \n <Form.Item name=\"width\" label={Language[curLang][\"width\"]+\": \"+values.width+\"m\"}>\n <Slider min={0.10} max={5.0} step={0.01} name=\"width\"/>\n </Form.Item>\n <Form.Item name=\"chair\" label={Language[curLang][\"chair\"]+\": \"+values.chair+\"m\"}>\n <Slider min={0.10} max={1.0} step={0.01} name=\"chair\" />\n </Form.Item>\n <Form.Item name=\"offset\" label={Language[curLang][\"offset\"]+\": \"+values.offset+\"m\"}>\n <Slider min={1.0} max={3.0} step={0.1} name=\"offset\"/>\n </Form.Item> \n <Button type=\"primary\" htmlType=\"submit\">{Language[curLang][\"add\"]}</Button>\n </Form>\n )\n}", "function royalLivePreview( db, name, changeFunc ) {\n\n\t\t// wp.customize object - works only on 'transport' => 'postMessage'\n\t\twp.customize( 'royal_'+ db +'['+ name +']', function( value ) {\n\n\t\t\tvalue.bind( function( nValue ) {\n\n\t\t\t\t// don't trigger when new design is loading\n\t\t\t\tif ( $('.style-load').length > 0 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// callback function\n\t\t\t\tchangeFunc( nValue );\n\n\t\t\t} );\n\n\t\t} );\n\n\t}", "function Header({index}){\n let rawFlightData, flightData\n const buildData = (data, listType) => {\n rawFlightData = data\n flightData = listType === \"arrive\" ? rawFlightData.arrive_info : rawFlightData.depart_info\n }\n return(\n <Consumer>\n { context => (\n <React.Fragment>\n\n {buildData(context.flights[index], context.listType)}\n\n <div className=\"ft-head\">\n\n <div className=\"ft-info\">\n <div className=\"ft-remote-city\">\n {rawFlightData.remote_city}\n </div>\n <div className=\"ft-quick-info\">\n <span className=\"ft-full-id\">\n {rawFlightData.f_id}\n </span> \n <span className=\"ft-naa-gate\">\n <span>\n {flightValues.getGateLabel(flightData)}\n </span>\n {flightValues.getGateValue(flightData)}\n </span>\n </div> \n </div>\n\n <div className=\"ft-status in-the-air\">\n <span className=\"ft-status-label\">\n {flightValues.getStatus(rawFlightData)}\n </span>\n <span className=\"ft-status-time\">\n {flightValues.getTime(flightData.scheduled_gate)}\n </span>\n <span className=\"ft-status-icon status-in-air\"></span>\n </div>\n\n </div>\n </React.Fragment>\n )}\n </Consumer>\n )\n }", "function activate_fare_carousel(list)\r\n\t\t\t{\r\n\t\t\t\tvar imgPath = _airline_lg_path;\r\n\t\t\t\tvar data_list = '';\r\n\t\t\t\t$.each(list, function(k, v) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tdata_list += '<div class=\"item\" title=\"'+v.tip+'\">';\r\n\t\t\t\t\t\tdata_list += '<a class=\"pricedates add_days_todate\" data-journey-date=\"'+v.start+'\">';\r\n\t\t\t\t\t\tdata_list += '<div class=\"imgemtrx_plusmin\"><img alt=\"Flight\" src=\"'+imgPath+v.data_id+'.gif\"></div>';\r\n\t\t\t\t\t\tdata_list += '<div class=\"alsmtrx\">';\r\n\t\t\t\t\t\tdata_list += '<strong>'+v.start_label+'</strong>';\r\n\t\t\t\t\t\tdata_list += '<span class=\"mtrxprice\">'+v.title+'</span>';\r\n\t\t\t\t\t\tdata_list += '</div>';\r\n\t\t\t\t\t\tdata_list += '</a>';\r\n\t\t\t\t\tdata_list += '</div>';\r\n\t\t\t\t});\r\n\t\t\t\t$('#farecal').html(data_list);\r\n\t\t\t\tfare_carousel();\r\n\t\t\t}", "function hooks() {\n \"use strict\";\n}", "function CounterThree() {\n // 2 paramater, pertama reducer function, yang kedua initialstate \n const [count, dispatch] = useReducer(reducer, initialState)\n // useReducer itu return currentState yaitu = count dan dispatch\n // currentState itu maksudnya state yang baru jadi pertamanya itu valuenya sama dengan initialState\n\n const [countTwo, dispatchTwo] = useReducer(reducer, initialState)\n\n return (\n <div>\n <div>count- {count}</div>\n <button onClick={() => dispatch('increment')}>Increment</button>\n <button onClick={() => dispatch('decrement')}>Decrement</button>\n <button onClick={() => dispatch('reset')}>Reset</button>\n\n <div>count- {countTwo}</div>\n <button onClick={() => dispatchTwo('increment')}>Increment</button>\n <button onClick={() => dispatchTwo('decrement')}>Decrement</button>\n <button onClick={() => dispatchTwo('reset')}>Reset</button>\n </div>\n )\n}", "stocker_local_trajet() {}", "function FunctionComponent(props) {\n // 管理许多 数据、链表\n // \n // fiber.memoizedState => hook0(next) => hook1(next) \n // workInProgressHook\n // const [count1, setCount1] = useState(0) //hook0\n const [count2, setCount2] = useReducer((x) => x + 1,0 ) //hook1\n \n return (\n <div className=\"border\">\n <p>{props.name}</p>\n {/* <button onClick={() => setCount1(count1 + 1)}>\n {count1}\n </button> */}\n <button onClick={() => {\n setCount2()\n }}>\n {count2}\n </button>\n </div>\n )\n}", "function frankenApp({ id, func, state, actions }) {\n let _view;\n let _eventMap;\n\n let _target = document.getElementById(id);\n let _func = func;\n let _state = state || {};\n let _actions = actions || {};\n\n function render(view, target) {\n _eventMap = getEventMap(view);\n listenForEvents(_eventMap, target);\n target.appendChild(createElement(view));\n }\n\n function update(view) {\n _eventMap = getEventMap(view);\n const patches = diff(_view, view);\n patch(_target, patches);\n _view = view;\n }\n\n // TODO: Patch event listeners on update\n function listenForEvents({ events, uniqueEvents }, target) {\n uniqueEvents.forEach(event => {\n target.addEventListener(event, e => routeEvent(e, e.target));\n });\n }\n\n function routeEvent(e, target) {\n if (!target) return;\n\n const eventHandlers = _eventMap.events[target.id];\n if (eventHandlers && eventHandlers[e.type]) {\n return eventHandlers[e.type](e);\n }\n\n routeEvent(e, target.parentElement);\n }\n\n function dispatch(updateFunc) {\n _state = updateFunc(_state);\n update(_func({ actions: _actions, state: _state, dispatch }));\n }\n\n return function() {\n _view = _func({ actions: _actions, state: _state, dispatch });\n render(_view, _target);\n };\n}", "function Fi(t) {\n return Kr(t, Mr.store);\n}", "render() {\n\n\t}", "render() {\n\n\t}", "function useReducerReplacement() {\n const dispatcher = resolveDispatcher();\n function reducerWithTracker(state, action) {\n const newState = reducer(state, action);\n timeTravelLList.tail.value.actionDispatched = true;\n window.postMessage({\n type: 'DISPATCH',\n data: {\n state: newState,\n action,\n },\n });\n return newState;\n }\n return dispatcher.useReducer(reducerWithTracker, initialArg, init);\n}" ]
[ "0.5591639", "0.5526943", "0.5496889", "0.54299366", "0.537102", "0.5348672", "0.52790433", "0.52532446", "0.5217039", "0.51681733", "0.51662445", "0.51312584", "0.5122255", "0.5114822", "0.50758934", "0.5075797", "0.5050161", "0.50327957", "0.50119686", "0.4992939", "0.4992787", "0.4978457", "0.49426785", "0.49230158", "0.4884505", "0.48811844", "0.48725438", "0.48711547", "0.4864264", "0.48579577", "0.48481667", "0.4830844", "0.4830264", "0.48241416", "0.48235887", "0.4818691", "0.48181754", "0.4806949", "0.48003477", "0.4795931", "0.4793571", "0.47905704", "0.47836286", "0.47727314", "0.47670823", "0.4764275", "0.47564524", "0.47510117", "0.47429878", "0.4738849", "0.4738849", "0.47349787", "0.4731887", "0.47269344", "0.47243688", "0.472368", "0.47230396", "0.472228", "0.4720837", "0.4718216", "0.4716876", "0.47042853", "0.47034413", "0.47034413", "0.47031698", "0.47028002", "0.47028002", "0.4701584", "0.46983433", "0.4697736", "0.46795976", "0.46762967", "0.46726537", "0.4670302", "0.4670259", "0.46685278", "0.46668893", "0.46588552", "0.46581867", "0.46549362", "0.46519232", "0.46509603", "0.464917", "0.46478656", "0.46478656", "0.4646431", "0.46449083", "0.4644623", "0.46442467", "0.46431094", "0.46409866", "0.4638126", "0.4637648", "0.46369064", "0.4628615", "0.4627376", "0.46246785", "0.46196225", "0.46196225", "0.46194485" ]
0.48308617
31
LA FONCTION AFFICHE ERROR
function affiche_error_connexion(ERROR){ $(".msg_error").html(ERROR); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fallo() {\n return error(\"Reportar fallo\");\n}", "function onError(error) {\n\n\t\t$.each(fiches_patrimoine, function(index, fiche) {\n\t \tfiche.distanceLabel = \"Position indisponible\";\n \t\t });\n\n\t\tbuildListePatrimoine();\n\t\tshouldDisplayListe = true;\n }", "function muestraError(cadena) {\n self.ErrorEnviar = cadena;\n self.showErrorForm = true;\n cfpLoadingBar.complete();\n }", "function errback(error) {\n console.error(\"Creating legend failed. \", error);\n }", "function deuErro() {\n toastr.error(\"Algo deu errado. Tente novamente.\");\n }", "static get ERROR() { return 3 }", "function La(a,b){this.code=a;this.a=Ma[a]||\"unknown error\";this.message=b||\"\";a=this.a.replace(/((?:^|\\s+)[a-z])/g,function(a){return a.toUpperCase().replace(/^[\\s\\xa0]+/g,\"\")});b=a.length-5;if(0>b||a.indexOf(\"Error\",b)!=b)a+=\"Error\";this.name=a;a=Error(this.message);a.name=this.name;this.stack=a.stack||\"\"}", "async _checkErrors(operation, results)\n\t{\n\t\tconst res = results[operation+'Result'];\n\n\t\tif (operation === 'FECAESolicitar' && res.FeDetResp) {\n\t\t\tif (Array.isArray(res.FeDetResp.FECAEDetResponse)) {\n\t\t\t\tres.FeDetResp.FECAEDetResponse = res.FeDetResp.FECAEDetResponse[0];\n\t\t\t}\n\t\t\t\n\t\t\tif (res.FeDetResp.FECAEDetResponse.Observaciones && res.FeDetResp.FECAEDetResponse.Resultado !== 'A') {\n\t\t\t\tres.Errors = { Err : res.FeDetResp.FECAEDetResponse.Observaciones.Obs };\n\t\t\t}\n\t\t}\n\n\t\tif (res.Errors) {\n\t\t\tconst err = Array.isArray(res.Errors.Err) ? res.Errors.Err[0] : res.Errors.Err;\n\t\t\tthrow new Error(`(${err.Code}) ${err.Msg}`, err.Code);\n\t\t}\n\t}", "function onFail(d) { console.log(\"ERR:ON FAIL\"+d); logm(\"ERR\",1,\"ON FAIL\",d); }", "function dataError(e){\r\n console.log(\"An error occured\");\r\n}", "function esconderError() {\n setError(null);\n }", "function Lo(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function Lo(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function Lo(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "static get ERROR () { return 0 }", "function errore_old(nome_form,lungh_ta){\nvar lungh=nome_form.value.length;\n\n if(lungh ==(lungh_ta-1)) {stringa.value=nome_form.value;}\n if(lungh >(lungh_ta-1)) {\n\nalert('Attenzione: e\\' stato raggiunto il limite dei caratteri da inserire:');\nnome_form.value=stringa.value;\n}\nreturn(true);\n}", "function loading_error() {\n console.log(\"ERRRR...OR\");\n}", "function triggerError() {\n throw new Error('Mismatch number of variables: ' + arguments[0] + ', ' + JSON.stringify(args));\n }", "function Fl(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function OnErrorCallMaladie(jqXHR, status) {\n\t\t\tbrief.save();\n\t\t\tnotif(\"warning\", \"Brief sauvegardé avec <strong>succès</strong> !\");\n\n\t\t}", "function generateLeafletError(err) {\n\t\tconst errMessages = {\n\t\t\t2004: 'Příliš vzdálené cíle (musí být blíže než 6000 km)',\n\t\t\t2009: 'Nenalezena trasa mezi zadanými cíli'\n\t\t};\n\t\tif(typeof err !== 'object' || !err.message) {return err;}\n\t\tlet obj = JSON.parse(err.message);\n\t\tif(!obj.error || !obj.error.code || !errMessages[obj.error.code]) {return err;}\n\t\treturn errMessages[obj.error.code];\n\t}", "function wikiError(){\r\n self.errorMessage(\"Error in accessing wikipedia\");\r\n self.apiError(true);\r\n}", "error (msg, ...rest) {\n if (_shouldOutputMessage(this, \"error\", \"errors\")) {\n console.error(this.theme.error(`${this.getContextName()} laments:`, msg), ...rest);\n }\n return this;\n }", "function VeryBadError() {}", "function OnErr() {\r\n}", "function loading_error(error, filename, lineno) {\n console.log(\"Dosyaları yüklerken hata meydana geldi: \" + error);\n}", "function errorInsertarBitacora(rpta){console.log(rpta)}", "function ofteU2FError(resp) {\n if (!('errorCode' in resp)) {\n return '';\n }\n if (resp.errorCode === u2f.ErrorCodes['OK']) {\n return '';\n }\n let msg = 'ofte error code ' + resp.errorCode;\n for (name in u2f.ErrorCodes) {\n if (u2f.ErrorCodes[name] === resp.errorCode) {\n msg += ' (' + name + ')';\n }\n }\n if (resp.errorMessage) {\n msg += ': ' + resp.errorMessage;\n }\n if (ofte.config.debug) {\n console.log('CTAP1/Ofte Error:', msg)\n }\n return msg;\n }", "function SC_onError(e,t){$.scriptcam.SC_onError(e,t)}", "setErros() {\n this.displayCalc = \"Error\";\n }", "error(error) {}", "function errback(err) {\n //alert(err.toString());\n rdbAdmin.showErrorMessage('<pre>' + err[0] + ':' + err[1] + '</pre>');\n }", "function ERROR$static_(){ValidationState.ERROR=( new ValidationState(\"error\"));}", "function calcError(mInicial, mFinal){\n var mError = [];\n for (var i = 0; i < mInicial.length; i++) {\n mError.push(Math.abs(mFinal[i] - mInicial[i]))\n }\n return Math.max(...mError).toFixed(5)\n}", "__init12() {this.error = null}", "function getAircraftFailed(err) {\n vm.showAddButton = false;\n vm.showDeleteButton = true;\n vm.showUpdateButton = true;\n vm.message = LOGBOOK_CONSTANT.MSG_AIRCRAFT_GET_ERROR;\n vm.working = false;\n }", "function Lo(t){return Object.prototype.toString.call(t).indexOf(\"Error\")>-1}", "function Lo(t){return Object.prototype.toString.call(t).indexOf(\"Error\")>-1}", "function createOrderError() {\n\t $scope.editOrder.replacing = false;\n\t $rootScope.load_notification('replace_error');\n\n\t if (!$scope.offers[$scope.editOrder.seq]) $rootScope.load_notification('replace_error_gone');\n\t }", "setError(){\n this.displayCalc = \"Sintaxe Error \";\n }", "function CustomError() {}", "function error() {\n _error.apply(null, utils.toArray(arguments));\n }", "function dbfLoadError() {\n console.log('dbf file failed to load');\n}", "function error(args) {\n console.log('ERROR : ', args.target, ' : ', args.error);\n\n d3.select(args.target).select('.mg-chart-title')\n .append('i')\n .attr('class', 'fa fa-x fa-exclamation-circle warning');\n}", "function addServerError(lei, year, status, updateFn) {\n updateFn(state => ({\n errors: [...state.errors, { lei, year, status }]\n }))\n}", "function setRestrauntDataError(){\n resNameElement.innerHTML = \"Error unknown restraunt\";\n}", "error(message, prev){\n\t\tif (message == undefined) message=\"\";\n\t\tif (prev == undefined) prev=null;\n\t}", "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error ini : \" + error); \n}", "onError(err){\n\n /*const data = err.response.data ;\n const msg = data.errors[0];\n this.showErr(msg);*/\n\n console.log(err);\n\n }", "function error (args) {\n console.log('ERROR : ', args.target, ' : ', args.error);\n\n d3.select(args.target).select('.mg-chart-title')\n .append('i')\n .attr('class', 'fa fa-x fa-exclamation-circle warning');\n}", "function afase_luna(njd){\n\n // calcola l'angolo di fase della luna per la data (njd)\n // gennaio 2012\n\n var dati_luna=pos_luna(njd); // recupero fase/elongazione (1)\n var dati_sole=pos_sole(njd);\n\n var elongazione1=dati_luna[4]; // elongazione in gradi sessadecimali.\n var dist_luna=dati_luna[7]/149597870; \n var dist_sole=dati_sole[4]; // distanza del sole in UA.\n\n elongazione=Math.abs(elongazione1)*1;\n\n var dist_sl=dist_luna*dist_luna+dist_sole*dist_sole-2*dist_luna*dist_sole*Math.cos(Rad(elongazione)); // distanza sole-luna\n dist_sl=Math.sqrt(dist_sl);\n\n // calcolo dell'angolo di fase in gradi . \n\n var Dpt= dist_luna; // distanza pianeta-terra.\n var Dts= dist_sole; // distanza terra-sole.\n var Dps= dist_sl; // distanza pianeta-sole.\n\n // teorema del coseno\n\n var delta_fase=(Dts*Dts+Dps*Dps-Dpt*Dpt)/(2*Dps*Dts);\n delta_fase=Math.acos(delta_fase); \n delta_fase=Rda(delta_fase);\n\n var angolo_fase=180-elongazione-delta_fase; // angolo di fase in gradi.\n\n if(elongazione1<0) {angolo_fase=-angolo_fase; }\n\n return angolo_fase;\n\n}", "function showError() {\n transitionSteps(getCurrentStep(), $('.demo-error'));\n }", "function evalError_12xx() {\n\n\tblink_one = document.getElementById('blink_one').value;\n\tblink_two = document.getElementById('blink_two').value;\n\t\n\tfor(var v = 0; v < codes_12xx.length; v++) {\n\t\tif(codes_12xx[v].blink_one == blink_one && codes_12xx[v].blink_two == blink_two) {\n\t\t\tdocument.getElementById('problemDesc').innerHTML = \"<br/><br/><u>\" + codes_12xx[v].error_desc + \"</u>\";\n\t\t\tdocument.getElementById('problemDesc').innerHTML += \"<br/><br/>\" + codes_12xx[v].error_res;\n\t\t\treturn;\n\t\t}\n\t}\n\t\n\tdocument.getElementById('problemDesc').innerHTML = \"<br/><br/>Not a valid error.\";\n}", "function show_error(a,b){\n\t\t$('error_creacion').innerHTML=b+' : '+errores[a];\n\t}", "function errox(id) {\n\tsw12u=id.substring(id.length-6,id.length-4)+id.substring(id.length-3,id.length-1);\n\tvar sw12x=sw12u.toUpperCase();\n\tmsg(\"debug\",\"sw12 = \"+sw12x+\" : \"+err[sw12x]);\t\n}", "function addAircraftFailed(err) {\n vm.message = LOGBOOK_CONSTANT.MSG_AIRCRAFT_ADD_ERROR;\n vm.working = false;\n }", "function validar(){\r\n\tvar funcion=document.getElementById('funcion').value;\r\n\tvar fun=document.getElementById('fun').value;\r\n\tvar a=document.getElementById('aa').value;\r\n\tvar enlace=document.getElementById('enlace');\r\n\r\n\tif(funcion==''){alert('Ingrese su g(x)');}\r\n\tif(fun==''){alert('Ingrese su f(x)');}\r\n\tif(a==''){alert('Ingrese el valor de la primera aproximacion');}\r\n\r\n\tvar derivada = math.derivative(funcion, 'x').eval({x: a})\r\n\tderivada = Math.abs(derivada);\r\n console.log(derivada);\r\n \t\r\n\r\n\tif(funcion!='' && a!='' && fun!=''){\r\n\t\tif(derivada>1){\r\n\t\t\talert('No existe raiz en el intervalo ingresado');\r\n\t\t}else{\r\n\t\t\tenlace.href=\"#tabla\"\r\n\t\t\tmostrarTabla();\r\n\t\t}\r\n\t}\r\n\r\n}", "function afficheErreur(numeroErreur)\r\n{\r\n\talert(tableauErreurs[numeroErreur]);\r\n}", "function updateAircraftFailed(err) {\n vm.message = LOGBOOK_CONSTANT.MSG_AIRCRAFT_UPDATE_ERROR;\n vm.working = false;\n }", "function F(a){return a&&\"object\"==typeof a?\"AbortError\"===a.name:!1}", "function report_writeRunoffError(totals, totalArea)\n//\n// Input: totals = accumulated runoff totals\n// totalArea = total area of all subcatchments\n// Output: none\n// Purpose: writes runoff continuity error to report file.\n//\n{\n // Values for string translation\n let val1 = 0;\n let val2 = 0;\n\n if ( Frunoff.mode == USE_FILE )\n {\n WRITE(\"\");\n Frpt.contents +=\n \"\\n **************************\"\n +\"\\n Runoff Quantity Continuity\"\n +\"\\n **************************\"\n +`\\n Runoff supplied by interface file ${Frunoff.name}`\n WRITE(\"\");\n return;\n }\n\n if ( totalArea == 0.0 ) return;\n WRITE(\"\");\n\n Frpt.contents +=\n \"\\n ************************** Volume Depth\";\n if ( UnitSystem == US) Frpt.contents += \n \"\\n Runoff Quantity Continuity acre-feet inches\";\n else Frpt.contents += \n \"\\n Runoff Quantity Continuity hectare-m mm\";\n Frpt.contents += \n \"\\n ************************** --------- -------\";\n\n if ( totals.initStorage > 0.0 )\n {\n val1 = (totals.initStorage * UCF(LENGTH) * UCF(LANDAREA)).toFixed(3).padStart(14, ' ');\n val2 = (totals.initStorage / totalArea * UCF(RAINDEPTH)).toFixed(3).padStart(14, ' ');\n Frpt.contents += `\\n Initial LID Storage ......${val1}${val2}`;\n }\n\n if ( Nobjects[SNOWMELT] > 0 )\n {\n val1 = (totals.initSnowCover * UCF(LENGTH) * UCF(LANDAREA)).toFixed(3).padStart(14, ' ');\n val2 = (totals.initSnowCover / totalArea * UCF(RAINDEPTH)).toFixed(3).padStart(14, ' ');\n Frpt.contents += `\\n Initial Snow Cover .......${val1}${val2}`;\n }\n\n val1 = (totals.rainfall * UCF(LENGTH) * UCF(LANDAREA)).toFixed(3).padStart(14, ' ');\n val2 = (totals.rainfall / totalArea * UCF(RAINDEPTH)).toFixed(3).padStart(14, ' ');\n Frpt.contents += `\\n Total Precipitation ......${val1}${val2}`;\n\n if ( totals.runon > 0.0 )\n {\n val1 = (totals.runon * UCF(LENGTH) * UCF(LANDAREA)).toFixed(3).padStart(14, ' ');\n val2 = (totals.runon / totalArea * UCF(RAINDEPTH)).toFixed(3).padStart(14, ' ');\n Frpt.contents += `\\n Outfall Runon ............${val1}${val2}`;\n }\n\n val1 = (totals.evap * UCF(LENGTH) * UCF(LANDAREA)).toFixed(3).padStart(14, ' ');\n val2 = (totals.evap / totalArea * UCF(RAINDEPTH)).toFixed(3).padStart(14, ' ');\n Frpt.contents += `\\n Evaporation Loss .........${val1}${val2}`\n\n val1 = (totals.infil * UCF(LENGTH) * UCF(LANDAREA)).toFixed(3).padStart(14, ' ');\n val2 = (totals.infil / totalArea * UCF(RAINDEPTH)).toFixed(3).padStart(14, ' ');\n Frpt.contents += `\\n Infiltration Loss ........${val1}${val2}`;\n\n val1 = (totals.runoff * UCF(LENGTH) * UCF(LANDAREA)).toFixed(3).padStart(14, ' ');\n val2 = (totals.runoff / totalArea * UCF(RAINDEPTH)).toFixed(3).padStart(14, ' ');\n Frpt.contents += `\\n Surface Runoff ...........${val1}${val2}`\n\n if ( totals.drains > 0.0 )\n {\n val1 = (totals.drains * UCF(LENGTH) * UCF(LANDAREA)).toFixed(3).padStart(14, ' ');\n val2 = (totals.drains / totalArea * UCF(RAINDEPTH)).toFixed(3).padStart(14, ' ');\n Frpt.contents += `\\n LID Drainage .............${val1}${val2}`\n }\n\n if ( Nobjects[SNOWMELT] > 0 )\n {\n val1 = (totals.snowRemoved * UCF(LENGTH) * UCF(LANDAREA)).toFixed(3).padStart(14, ' ');\n val2 = (totals.snowRemoved / totalArea * UCF(RAINDEPTH)).toFixed(3).padStart(14, ' ');\n Frpt.contents += `\\n Snow Removed .............${val1}${val2}`\n\n val1 = (totals.finalSnowCover * UCF(LENGTH) * UCF(LANDAREA)).toFixed(3).padStart(14, ' ');\n val2 = (totals.finalSnowCover / totalArea * UCF(RAINDEPTH)).toFixed(3).padStart(14, ' ');\n Frpt.contents += `\\n Final Snow Cover .........${val1}${val2}`\n }\n\n val1 = (totals.finalStorage * UCF(LENGTH) * UCF(LANDAREA)).toFixed(3).padStart(14, ' ');\n val2 = (totals.finalStorage / totalArea * UCF(RAINDEPTH)).toFixed(3).padStart(14, ' ');\n Frpt.contents += `\\n Final Storage ............${val1}${val2}`\n\n Frpt.contents += `\\n Continuity Error (%%) .....${totals.pctError}`\n WRITE(``);\n}", "function createOrderError() {\n $scope.editOrder.replacing = false;\n $rootScope.load_notification('replace_error');\n\n if (!$scope.offers[$scope.editOrder.seq]) $rootScope.load_notification('replace_error_gone');\n }", "function logerror(error){\n\t\tif(error.type){\n\t\tvar errorstring='';\n\t\tswitch (error.type) {\n\t\t\t\tcase 1: errorstring='Please use other name, this word '+(error.setname?'\\''+error.setname+'\\'':'')+' is reserved';break;\t\t\t\n\t\t\t\tcase 2: errorstring='This variable name '+(error.setname?'\\''+error.setname+'\\'':'')+' cannot be found';break;\n\t\t\t\tcase 3: errorstring='The range input for this fuzzy set '+(error.setname?'\\''+error.setname+'\\'':'')+' is incorrect. The correct format is n to m where n and m represents start and stop points of the range respectively.';break;\n\t\t\t\tcase 4: errorstring='The range input for this fuzzy set '+(error.setname?'\\''+error.setname+'\\'':'')+' is not a number';break;\t\t\t\t\n\t\t\t\tcase 5: errorstring='The definition for fuzzy term '+(error.termname?'\\''+error.termname+'\\'':'')+' is not found';break;\n\t\t\t\tcase 6: errorstring='The membership function for this fuzzy term '+(error.termname?'\\''+error.termname+'\\'':'')+' is invalid';break;\n\t\t\t\tcase 7: errorstring='The step size for fuzzy set '+(error.setname?'\\''+error.setname+'\\'':'')+' is not found or invalid';break;\n\t\t\t\tcase 8: errorstring='The point/s defined for '+(error.termname?'\\''+error.termname+'\\'':'')+' term are beyond the fuzzy set range';break;\n\t\t\t\tcase 9: errorstring='There is dimension mismatch in the min operation between 2 fuzzy terms';break;\n\t\t\t\tdefault: errorstring='error';\t\t\t\t\t\n\t\t\t}\t\t\t\n\t\t\talert(errorstring); //temporary. It should not be alerting, instead just keep the error log for debugging purpose\n\t\t}\n\t}", "trace(...errors) {\n\n }", "function addOneErrorEvent() {\n window.onerror = function (message, url, lineNo, columnNo, errorObj) {\n console.log(message, url, lineNo, columnNo, errorObj);\n var oneErrorParams = {\n message: (errorObj === null || errorObj === void 0 ? void 0 : errorObj.message) || message,\n lineNo: lineNo,\n columnNo: columnNo,\n url: url,\n type: getOnerrorType(message)\n };\n computedErrorObject(oneErrorParams);\n };\n}", "get animationScaleError() {}", "function maj_in_baseDemande_deblocage_daaf_validation_daaf(demande_deblocage_daaf_validation_daaf,suppression)\n {\n //add\n var config =\n {\n headers : {'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'}\n };\n \n var datas = $.param({\n supprimer: suppression,\n id: demande_deblocage_daaf_validation_daaf.id,\n ref_demande: demande_deblocage_daaf_validation_daaf.ref_demande , \n id_compte_daaf: demande_deblocage_daaf_validation_daaf.compte_daaf.id ,\n id_tranche_deblocage_daaf: demande_deblocage_daaf_validation_daaf.tranche.id ,\n prevu: demande_deblocage_daaf_validation_daaf.prevu ,\n cumul: demande_deblocage_daaf_validation_daaf.cumul ,\n anterieur: demande_deblocage_daaf_validation_daaf.anterieur ,\n reste: demande_deblocage_daaf_validation_daaf.reste ,\n objet: demande_deblocage_daaf_validation_daaf.objet ,\n ref_demande: demande_deblocage_daaf_validation_daaf.ref_demande ,\n date: convertionDate(demande_deblocage_daaf_validation_daaf.date) ,\n validation: 1,\n situation: 1,\n id_convention_ufp_daaf_entete: vm.selectedItemConvention_ufp_daaf_entete.id \n });\n console.log(datas);\n //factory\n apiFactory.add(\"demande_deblocage_daaf/index\",datas, config).success(function (data)\n {\n\n vm.alldemande_deblocage_daaf = vm.alldemande_deblocage_daaf.filter(function(obj)\n {\n return obj.id !== demande_deblocage_daaf_validation_daaf.id;\n });\n vm.validation_item=1;\n demande_deblocage_daaf_validation_daaf.validation=1;\n vm.stepTwo = false;\n vm.showbuttonValidation = false;\n \n }).error(function (data){vm.showAlert('Error','Erreur lors de l\\'insertion de donnée');});\n\n }", "error() {}", "function processErrors(data){\n \n}", "function Fi(t){return Object.prototype.toString.call(t).indexOf(\"Error\")>-1}", "function t(e,a){return function(n){for(var t=new Array(arguments.length),i=this,o=\"error\"===e?n:null,r=0;r<t.length;r++)t[r]=arguments[r];a(o,i,e,t)}}", "function showError() {}", "function errback(err) {\n rdbAdmin.showErrorMessage('<pre>' + err[0] + ':' + err[1] + '</pre>');\n }", "function erreurGeo(error){\n var e='';\n switch(error.code){\n case error.TIMEOUT:\n e+=\" !TIMEOUT! \" ;\n break;\n case error.PERMISSION_DENIED:\n e+=\" !PERMISSION_DENIED! \" ;\n break;\n case error.POSITION_UNAVAILABLE:\n e+=\" !POSITION_UNAVAILABLE! \" ;\n break;\n case error.UNKNOW_ERROR:\n e+=\" !POSITION_UNAVAILABLE! \" ;\n break;\n }\n \n }", "function err(strm,errorCode){strm.msg=msg[errorCode];return errorCode;}", "get bisectBatchOnFunctionErrorInput() {\n return this._bisectBatchOnFunctionError;\n }", "function errorlogging(err) \r\n{\r\n\talert(\"Error processing SQL: Main err\"+err.code);\r\n}", "function fixError() {\n /* exploit = \"installFix\";\n switch (checkFw()) {\n case \"7.02\":\n localStorage.setItem(\"exploit702\", SCMIRA702(\"miraForFix\"));\n document.location.href = \"mira.html\";\n break;\n case \"6.72\":\n let func2 = SCMIRA(\"c-code\");\n let func1 = SCMIRA(\"MiraForFix\");\n newScript(func1);\n newScript(func2);\n setTimeout(function () {\n loadPayload(\"Todex\");\n }, 8000);\n break;\n }*/\n}", "function Bo(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function errorLocation(error){\r\n console.log(error);\r\n}", "error(err) {\n this.checkDate();\n console.error(`[${red(`ERROR ${dayjs().format(\"HH:mm:ss\")}`)}]: ${err.message + (err.stack ? \"\\n\"+err.stack.split('\\n').splice(1).join('\\n'):\"\")}\\n`);\n }", "function Ho(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function Lr(t){return Object.prototype.toString.call(t).indexOf(\"Error\")>-1}", "function queryAircraftFailed(err) {\n resetPagination();\n vm.message = LOGBOOK_CONSTANT.MSG_AIRCRAFT_QUERY_ERROR;\n vm.working = false;\n }", "function processErrorResult(e) {\n /*let rep = {\n start: start,\n end: end,\n duration: (end-start)*1000,\n error: e\n }*/\n setBindings(undefined)\n setReport({error: e})\n }", "function onError(e) {\n\t\talert(\"chyba:\" + e);\n\t}", "function errorHandler(err) {\n //alert(\"An error occured\\n\" + err.message + \"\\n\" + err.details.join(\"\\n\"));\n }", "function adderr(txt) { return !fields.attr(\"required\", false).mbError(txt); }", "function error(error) {\n //Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "function gribError(wdb, lvl, stat, msg) {\n // alert(msg);\n dbg(lvl, msg);\n wdb.statusMsg = msg;\n wdb.status = stat;\n\tthrow error;\n return wdb;\n}", "function mostrarError(err){\n console.log('Error', err);\n }", "function mostrarError(err){\n console.log('Error', err);\n }", "argumentError() {\n if (\"error\" in this.argument) {\n return this.argument.error;\n }\n return \"NO ERROR!!!\";\n }", "argumentError() {\n if (\"error\" in this.argument) {\n return this.argument.error;\n }\n return \"NO ERROR!!!\";\n }", "function Di(t){return Object.prototype.toString.call(t).indexOf(\"Error\")>-1}", "recoveryFactor() {\n return -pmt(\n this.params['WACC [%]'] / 100,\n this.params['Economic Lifetime [years]'],\n 1\n )\n }", "function errorModificar(e) {\n alert(\"Error: \"+e);\n \n}", "onError() {}", "function escribir(variableError){\n var mensaje= \"Error! El campo \"+ variableError + \" se encuentra vacío. Completelo.\";\n document.getElementById('alertaError').innerHTML= mensaje;\n }", "function fireErrorDialog(errorCode, description, severity){\nalert(\"calGuiasFrm.errCodigo = \" + errorCode);\n\n\tset('calGuiasFrm.errCodigo', errorCode);\n\tset('calGuiasFrm.errDescripcion', description);\n\tset('calGuiasFrm.errSeverity', severity);\n\tfMostrarMensajeError();\n}", "function msgFalhaBaixarArquivo() {\n $scope.showErrorMessage(\"Falha ao fazer o download do arquivo.\");\n }" ]
[ "0.6021847", "0.58426523", "0.5744112", "0.57429934", "0.5739135", "0.57275105", "0.5657397", "0.5655892", "0.56383514", "0.55890566", "0.5568116", "0.55483764", "0.55483764", "0.55483764", "0.5535928", "0.55299985", "0.5503031", "0.54895383", "0.5483835", "0.5477989", "0.5470928", "0.54627484", "0.5450793", "0.5448364", "0.54428685", "0.54424155", "0.54371846", "0.5426466", "0.5407093", "0.5400612", "0.5389221", "0.5384963", "0.53836673", "0.5382736", "0.53713185", "0.53679913", "0.5365579", "0.5365579", "0.5360973", "0.53601986", "0.53581613", "0.5355427", "0.5331644", "0.5316107", "0.5313956", "0.5312791", "0.53076595", "0.5303136", "0.52966106", "0.52936643", "0.52859044", "0.5282423", "0.5274292", "0.5274044", "0.5262171", "0.5261696", "0.52570933", "0.52438337", "0.5243363", "0.5238761", "0.5236287", "0.5222202", "0.5217127", "0.5215173", "0.52129894", "0.52129585", "0.52033687", "0.52031416", "0.5201395", "0.51965475", "0.51822907", "0.5181478", "0.51813334", "0.5159647", "0.5154087", "0.51515394", "0.5132101", "0.5130846", "0.51294607", "0.5127486", "0.5126812", "0.5125186", "0.5119235", "0.51176304", "0.511161", "0.51033294", "0.50972503", "0.5093401", "0.5091334", "0.5090873", "0.50906736", "0.50906736", "0.5089325", "0.5089325", "0.50857073", "0.50808567", "0.5074373", "0.50674886", "0.5066911", "0.50551516", "0.5054595" ]
0.0
-1
1.function gcb_manifest_content will write any other files underpackage of course builder. / 2.function gcb_manifest will call gcb_manifest_content() to write the manifest.json. / function gcb_manifest_content will write any other files under package of course builder.
function gcb_manifest_content(filepath){ var fs = require("fs"); var y = document.getElementById("fileImportDialog"); var file = y.files[0]; var new_file_name = file.name.replace(/ELO/, ""); var gcb_path = file.path.replace(file.name, "") + "GCB" + new_file_name.replace(/ /g, "_"); fs.appendFile(gcb_path + "/manifest.json", "\n\t{\n\t \"is_draft\": false,\n\t \"path\": " + filepath + "\n\t},", function(err){ if(err) throw err; console.log(' gcb_manifest_content was complete!'); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gcb_manifest(){\n\tvar fs = require(\"fs\");\n\tvar y = document.getElementById(\"fileImportDialog\");\n\tvar file = y.files[0];\n\tvar new_file_name = file.name.replace(/ELO/, \"\");\n\tvar gcb_path = file.path.replace(file.name, \"\") + \"GCB\" + new_file_name.replace(/ /g, \"_\");\n\tvar count = 0;\n\n\tfs.open(gcb_path + \"/manifest.json\", \"w\", function(err,fd){\n\t\tif(err) throw err;\n\n\t\telse{\n\t\t\tvar buf = new Buffer(\"{\\n \\\"entities\\\": [\");\n\n\t\t\tfs.write(fd, buf, 0, buf.length, 0, function(err, written, buffer){\n\t\t\t\tif(err) throw err;\n \t\t\tconsole.log(err, written, buffer);\n\t\t\t})\n\n\t\t\tfs.readdir(gcb_path + \"/files/assets/css/\", function(err, files){\n\t\t\t\tfor(var i = 0 in files){\n\n\t\t\t\t\tvar n = files[i].lastIndexOf(\".\");\n \t\t\t\t\tif(files[i].substr(n+1, files[i].length) == \"css\"){\n\t\t\t\t\t\tgcb_manifest_content(\"\\\"files/assets/css/\" + files[i] + \"\\\"\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tfs.readdir(gcb_path + \"/files/assets/html/\", function(err, files){\n\t\t\t\tfor(var i = 0 in files){\n\t\t\t\t\tgcb_manifest_content(\"\\\"files/assets/html/\" + files[i] + \"\\\"\");\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tfs.readdir(gcb_path + \"/files/assets/img/\", function(err, files){\n\t\t\t\tfor(var i = 0 in files){\n\t\t\t\t\tgcb_manifest_content(\"\\\"files/assets/img/\" + files[i] + \"\\\"\");\n\t\t\t\t}\n\n\t\t\t\tfs.appendFile(gcb_path + \"/manifest.json\", \n\t\t\t\t\"\\n\\t{\\n\\t \\\"is_draft\\\": false,\\n\\t \\\"path\\\": \\\"files/course.yaml\\\"\\n\\t},\", function(err){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tif(err) throw err;\n \t\t\t\tconsole.log(\"record course.yaml was complete!\");\n\t\t\t\t})\n\n\t\t\t\tconsole.log(\"image\");\n\t\t\t})\n\n\t\t\tfs.readdir(gcb_path + \"/files/data/\", function(err, files){\n\t\t\t\tfor(var i = 0 in files){\n\t\t\t\t\tgcb_manifest_content(\"\\\"files/data/\" + files[i] + \"\\\"\");\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tfs.readdir(gcb_path + \"/models/\", function(err, files){\n\t\t\t\tfor(var i = 0 in files){\n\t\t\t\t\tcount += 1;\n\t\t\t\t\tconsole.log(count);\n\t\t\t\t\tif( files.length == count){\n\t\t\t\t\t\tfs.appendFile(gcb_path + \"/manifest.json\",\n\t\t\t\t\t\t\"\\n\\t{\\n\\t \\\"is_draft\\\": false,\\n\\t \\\"path\\\": \\\"models/\" + files[i] + \"\\\"\\n\\t}\", function(err){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tif(err) throw err;\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\tgcb_manifest_content(\"\\\"models/\" + files[i] + \"\\\"\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tsetTimeout(function(){\n\t\t\t\tfs.appendFile(gcb_path + \"/manifest.json\",\n\t\t\t\t\"\\n ],\\n \\\"raw\\\": \\\"course:/new_course::ns_new_course\\\",\\n \\\"version\\\": \\\"1.3\\\"\\n}\", function(err){\n\t\t\t\t\n\t\t\t\tif(err) throw err;\n\t\t\t\tconsole.log(\"raw was added\");\n\t\t\t\t})\n\t\t\t}, 20)\n\n\t\t\tfs.close(fd, function(err){\t\t\t\t\t\t\t\t\t\t//close course.yaml file\n\t\t\t\tif(err) throw err;\n\t\t\t\tconsole.log(\"manifest.json closed successfully !\");\n\t\t\t})\n\n\t\t}\n\t})\n\n}", "function generateManifest() {\n var stream = gulp.src(MANIFEST_SOURCE_FILES)\n .pipe(manifest({name: 'manifest.json'}))\n .pipe(gulp.dest('build/'));\n stream.on('end', function () {\n gulpUtil.log('Updated asset manifest');\n });\n}", "async writeBuildManifest ({ build }) {\n let output_directory = build.id || ''\n const dest = path.join(this.options.cwd, OUTPUT_DIRECTORY, output_directory, build.blueprint.identifier);\n await this.ensureDir(dest)\n\n return new Promise((resolve, reject) => {\n fs.writeFileSync(path.join(dest + '/codotype-build.json'), JSON.stringify(build, null, 2))\n fs.writeFileSync(path.join(dest + `/${build.blueprint.identifier}-codotype-blueprint.json`), JSON.stringify(build.blueprint, null, 2))\n return resolve()\n });\n }", "function writeManifestToFile() {\n var jsonContent = JSON.stringify(this.manifest, null, \" \");\n var strFileName = io.appendPath(conf.manifestPath, this.strManifestFileName);\n io.writeFile(strFileName, jsonContent);\n}", "function createManifest() {\n if (this.arrBookStructureEntries == null) return;\n if (this.arrPageXmlFiles == null) return;\n if (this.iPageXmlsLoaded != this.arrPageXmlFiles.length) return;\n //this.manifest = {label: \"Manifest for img\", sequences: \"lol\"};\n\n this.manifest = {\n label: conf.bookTitle,\n \"@type\": \"sc:Manifest\",\n \"@id\": conf.manifestUrl+this.strManifestFileName,\n \"@context\": \"http://iiif.io/api/presentation/2/context.json\",\n \"license\": conf.license,\n \"logo\": conf.logo,\n \"attribution\": conf.attribution,\n \"metadata\": [],\n \"sequences\": [],\n \"structures\": []\n };\n addMetadataToManifest();\n addSequenceAndStructureToManifest();\n writeManifestToFile();\n}", "static get manifest() { return 'package.json'; }", "function manifest(ignored) {}", "function main(filePath) {\n /*// NON-CHEERIO WAY:\nvar manifestObject = generateManifestObject(filePath);\nvar formattedManifest = mapManifestData(manifestObject);*/\n\n // CHEERIO WAY:\n filePath = 'imsmanifest.xml';\n generateManifestObject(filePath);\n formattedManifest = mapManifestData();\n\n return formattedManifest;\n}", "function manifest({source, destination}){\n return function() {\n const common = gulp.src(`${settings.source}/manifest.json`)\n const additions = gulp.src(`${source}/manifest_additions.json`)\n manifest_stream = mergeStream(additions, common)\n .pipe(mergeJSON('manifest.json'))\n .pipe(jeditor(function(json) {\n json.version=settings.version\n return json\n }))\n if (destination){\n return manifest_stream.pipe(gulp.dest(destination));\n } else {\n return manifest_stream\n }\n }\n}", "function addJsaseManifest() {\n var jsaseManifest = {};\n\n function getLocations() {\n return manifest['locations'].map(function(location) {\n return {\n 'key': location['id'],\n 'rank': location['rank'],\n 'level': location['level'],\n 'weight': location['weight']\n };\n });\n }\n\n function getServers() {\n var serverList = manifest['cdns'];\n\n return serverList.map(function(server) {\n return {\n 'name': server['name'],\n 'type': server['type'],\n 'id': server['id'],\n 'key': server['locationId'],\n 'rank': server['rank'],\n 'lowgrade': server['isLowgrade']\n };\n });\n }\n\n function getAudioTrackList() {\n var audioTracks = manifest['audioTracks'];\n\n return audioTracks.map(function(audioTrack) {\n return {\n 'id': audioTrack['id'],\n 'channels': audioTrack['channels'],\n 'language': audioTrack['bcp47'],\n 'languageDescription': audioTrack['language'],\n 'trackType': audioTrack['trackType']\n };\n });\n }\n\n function getUrls(urls) {\n var urlList = [];\n for (var key in urls) {\n if (urls.hasOwnProperty(key)) {\n urlList.push({\n 'cdn_id': key,\n 'url': urls[key]\n });\n }\n }\n return urlList;\n }\n\n function getAudioTracks() {\n var audioTracks = manifest['audioTracks'];\n\n function getStreams(streams, audioTrack) {\n return streams.map(function(stream) {\n return {\n 'type': 0,\n 'trackType': audioTrack['trackType'],\n 'content_profile': stream['contentProfile'],\n 'downloadable_id': stream['downloadableId'],\n 'bitrate': stream['bitrate'],\n 'channels': audioTrack['channels'],\n 'language': audioTrack['bcp47'],\n 'urls': getUrls(stream['urls'])\n };\n });\n }\n\n return audioTracks.map(function(audioTrack) {\n return {\n 'type': 0,\n 'track_id': audioTrack['id'],\n 'channels': audioTrack['channels'],\n 'language': audioTrack['bcp47'],\n 'languageDescription': audioTrack['language'],\n 'trackType': audioTrack['trackType'],\n 'streams': getStreams(audioTrack['downloadables'], audioTrack)\n };\n });\n }\n\n function getVideoTracks() {\n var videoTracks = manifest['videoTracks'];\n\n function getStreams(streams, trackType) {\n var streamList = streams.map(function(stream) {\n return {\n 'type': 1,\n 'trackType': trackType,\n 'content_profile': stream['contentProfile'],\n 'downloadable_id': stream['downloadableId'],\n 'bitrate': stream['bitrate'],\n 'urls': getUrls(stream['urls'])\n };\n });\n\n // sort list of tracks because ASE code assumes it\n arraySortByProperty(streamList, 'bitrate');\n return streamList;\n }\n\n return videoTracks.map(function(videoTrack) {\n return {\n 'type': 1,\n 'streams': getStreams(videoTrack['downloadables'], videoTrack['trackType'])\n };\n });\n }\n\n\n /**\n *\n * Get the default audio track by looking up its trackID.\n * If no trackID is given, assume this is video and return 0 by default\n * since we only have one videoTrack.\n *\n * @param {Array} trackList\n * @param {String=} trackId\n * @returns {number}\n */\n function findDefaultTrackIndex(trackList, trackId) {\n var index = 0;\n trackList.some(\n function (t, i) {\n if (t[\"track_id\"] == trackId) {\n index = i;\n return true;\n }\n return false;\n });\n return index;\n }\n\n jsaseManifest['movieId'] = manifest['movieId'];\n jsaseManifest['duration'] = manifest['runtime'];\n jsaseManifest['locations'] = getLocations();\n jsaseManifest['servers'] = getServers();\n jsaseManifest['audio_tracks'] = getAudioTracks();\n jsaseManifest['video_tracks'] = getVideoTracks();\n jsaseManifest['tracks'] = jsaseManifest['video_tracks'].concat(jsaseManifest['audio_tracks']);\n\n playback.defaultAudioTrackIndex = findDefaultTrackIndex(jsaseManifest['audio_tracks'], defaultAudioTrack.trackId);\n playback.defaultVideoTrackIndex = findDefaultTrackIndex(jsaseManifest['video_tracks'], defaultVideoTrack.trackId);\n\n return jsaseManifest;\n }", "function packageJSON(cb) {\n const json = Object.assign({}, packageJson);\n delete json['scripts'];\n if (!fs.existsSync(packageDistribution)) {\n fs.mkdirSync(packageDistribution);\n }\n fs.writeFileSync(`${packageDistribution}/package.json`,\n JSON.stringify(json, null, 2));\n cb();\n}", "function chromeAppAssets() {\n\tgulp.src('manifest.json')\n\t\t.pipe(gulp.dest('./build'));\n\n\treturn gulp.src('icon.png')\n\t\t.pipe(gulp.dest('./build'));\n}", "_writeNewContent() {\n this.packageJsonContent.version = this._formatVersion()\n fs.writeFileSync(packagePath, JSON.stringify(this.packageJsonContent, null, 2))\n }", "getBlankBuildManifest() {\n return {\n pages: {\n ssr: {\n dynamic: {},\n nonDynamic: {}\n },\n html: {}\n },\n publicFiles: {},\n cloudFrontOrigins: {}\n };\n }", "function generateClientManifest(compiler,assetMap,rewrites){const compilerSpan=_profilingPlugin.spans.get(compiler);const genClientManifestSpan=compilerSpan==null?void 0:compilerSpan.traceChild('NextJsBuildManifest-generateClientManifest');return genClientManifestSpan==null?void 0:genClientManifestSpan.traceFn(()=>{const clientManifest={// TODO: update manifest type to include rewrites\n__rewrites:rewrites};const appDependencies=new Set(assetMap.pages['/_app']);const sortedPageKeys=(0,_utils.getSortedRoutes)(Object.keys(assetMap.pages));sortedPageKeys.forEach(page=>{const dependencies=assetMap.pages[page];if(page==='/_app')return;// Filter out dependencies in the _app entry, because those will have already\n// been loaded by the client prior to a navigation event\nconst filteredDeps=dependencies.filter(dep=>!appDependencies.has(dep));// The manifest can omit the page if it has no requirements\nif(filteredDeps.length){clientManifest[page]=filteredDeps;}});// provide the sorted pages as an array so we don't rely on the object's keys\n// being in order and we don't slow down look-up time for page assets\nclientManifest.sortedPages=sortedPageKeys;return(0,_devalue.default)(clientManifest);});}", "function writeManifest(manifest,manifestFilename,appendManifest, workingDir) {\n\treturn new Promise(function (resolve,reject) {\n\t\tmanifest = transformManifest(manifest, workingDir);\n\n\t\tlet appendPromise;\n\t\tif (appendManifest) {\n\t\t\tappendPromise = fsp.readJSON(manifestFilename);\n\t\t} else {\n\t\t\tappendPromise = Promise.resolve({});\n\t\t}\n\n\t\tappendPromise.then(function (oldManifest) {\n\t\t\tmanifest = Object.assign(oldManifest, manifest);\n\t\t\tresolve(fsp.writeJSON(manifest, manifestFilename));\n\t\t}).catch(function (err) {\n\t\t\tif (err.message.match(/ENOENT: no such file or directory/)) {\n\t\t\t\tresolve(fsp.writeJSON(manifest, manifestFilename));\n\t\t\t} else {\n\t\t\t\treject(err);\n\t\t\t}\n\t\t});\n\t});\n}", "async function loadManifest( opts, source ) {\n const path = Path.join( source, ContentManifestName );\n const manifest = await readJSON( path, DefaultContentManifest );\n // If the manifest specifies a \"pwa\" section then ensure that it has\n // a minimum set of properties.\n const { pwa } = manifest;\n if( pwa ) {\n manifest.pwa = Object.assign(\n {},\n DefaultPWASettings,\n pwa );\n }\n return manifest;\n}", "function buildManifest(env) {\n return gulp.src(PATHS.src.manifest)\n // print out the file deets\n .pipe(size(SIZE_OPTS))\n // write the result\n .pipe(gulp.dest(`${PATHS.build[env].root}`));\n}", "function writePackageJSON (btrc) {\n let packageJSONObject = btrc;\n packageJSONObject[\"name\"] = name;\n packageJSONObject[\"version\"] = \"0.1.0\";\n let packageJSONString = JSON.stringify(packageJSONObject);\n return new Promise((res, rej) => {\n fs.writeFile(path + \"/package.json\", packageJSONString, (err) => {\n return err ? rej(err) : res();\n });\n });\n }", "function handleManifest(manifest, walkContext) {\n const async = manifest.async;\n if (async) {\n // create jobs to build each async package\n for (const asyncName in async) {\n if (hasOwn.call(async, asyncName)) {\n if (!hasOwn.call(foundAsyncPackages, asyncName)) {\n foundAsyncPackages[asyncName] = true;\n buildAsyncPackagesWorkQueue.push({\n asyncPackageName: asyncName,\n dependencies: async[asyncName]\n });\n }\n }\n }\n }\n }", "function manifestCheck() {\r\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_tslib__[\"__awaiter\"])(this, void 0, void 0, function () {\r\n var manifestTag, manifestContent, response, e_1;\r\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_tslib__[\"__generator\"])(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n manifestTag = document.querySelector('link[rel=\"manifest\"]');\r\n if (!manifestTag) {\r\n return [2 /*return*/];\r\n }\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 4, , 5]);\r\n return [4 /*yield*/, fetch(manifestTag.href)];\r\n case 2:\r\n response = _a.sent();\r\n return [4 /*yield*/, response.json()];\r\n case 3:\r\n manifestContent = _a.sent();\r\n return [3 /*break*/, 5];\r\n case 4:\r\n e_1 = _a.sent();\r\n // If the download or parsing fails allow check.\r\n // We only want to error if we KNOW that the gcm_sender_id is incorrect.\r\n return [2 /*return*/];\r\n case 5:\r\n if (!manifestContent || !manifestContent.gcm_sender_id) {\r\n return [2 /*return*/];\r\n }\r\n if (manifestContent.gcm_sender_id !== '103953800507') {\r\n throw errorFactory.create(ERROR_CODES.INCORRECT_GCM_SENDER_ID);\r\n }\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}", "_fetchManifest() {\n if (this.debug) {\n this.CACHE = {}\n return\n }\n\n const manifest_path = this.getManifestPath()\n\n process.on('SIGINT', this._deleteManifest)\n process.on('beforeExit', this._deleteManifest)\n\n if (fs.existsSync(manifest_path)) {\n try {\n this.CACHE = JSON.parse( fs.readFileSync(manifest_path).toString('utf8') ).ASSETS\n } catch(e) {\n this.CACHE = {}\n this._updateManifest()\n }\n } else {\n this.CACHE = {}\n this._updateManifest()\n }\n }", "function getManifest() {\n if (cachedManifest)\n return cachedManifest;\n\n // Do a synchronous XHR to get the manifest.\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", \"extension/manifest.json\", false);\n xhr.send(null);\n return xhr.responseText;\n}", "addManualFilesToManifest() {\n this.manualFiles.forEach(\n file => this.manifest.add(file, this.generateHashedFilePath(file))\n );\n }", "function manifestCheck() {\n return Object(__WEBPACK_IMPORTED_MODULE_1_tslib__[\"__awaiter\"])(this, void 0, void 0, function () {\n var manifestTag, manifestContent, response, e_1;\n return Object(__WEBPACK_IMPORTED_MODULE_1_tslib__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n manifestTag = document.querySelector('link[rel=\"manifest\"]');\n if (!manifestTag) {\n return [2 /*return*/];\n }\n _a.label = 1;\n case 1:\n _a.trys.push([1, 4, , 5]);\n return [4 /*yield*/, fetch(manifestTag.href)];\n case 2:\n response = _a.sent();\n return [4 /*yield*/, response.json()];\n case 3:\n manifestContent = _a.sent();\n return [3 /*break*/, 5];\n case 4:\n e_1 = _a.sent();\n // If the download or parsing fails allow check.\n // We only want to error if we KNOW that the gcm_sender_id is incorrect.\n return [2 /*return*/];\n case 5:\n if (!manifestContent || !manifestContent.gcm_sender_id) {\n return [2 /*return*/];\n }\n if (manifestContent.gcm_sender_id !== '103953800507') {\n throw errorFactory.create(ERROR_CODES.INCORRECT_GCM_SENDER_ID);\n }\n return [2 /*return*/];\n }\n });\n });\n}", "function manifestCheck() {\n return Object(__WEBPACK_IMPORTED_MODULE_1_tslib__[\"__awaiter\"])(this, void 0, void 0, function () {\n var manifestTag, manifestContent, response, e_1;\n return Object(__WEBPACK_IMPORTED_MODULE_1_tslib__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n manifestTag = document.querySelector('link[rel=\"manifest\"]');\n if (!manifestTag) {\n return [2 /*return*/];\n }\n _a.label = 1;\n case 1:\n _a.trys.push([1, 4, , 5]);\n return [4 /*yield*/, fetch(manifestTag.href)];\n case 2:\n response = _a.sent();\n return [4 /*yield*/, response.json()];\n case 3:\n manifestContent = _a.sent();\n return [3 /*break*/, 5];\n case 4:\n e_1 = _a.sent();\n // If the download or parsing fails allow check.\n // We only want to error if we KNOW that the gcm_sender_id is incorrect.\n return [2 /*return*/];\n case 5:\n if (!manifestContent || !manifestContent.gcm_sender_id) {\n return [2 /*return*/];\n }\n if (manifestContent.gcm_sender_id !== '103953800507') {\n throw errorFactory.create(ERROR_CODES.INCORRECT_GCM_SENDER_ID);\n }\n return [2 /*return*/];\n }\n });\n });\n}", "function manifestContentResponse( error, response, body ) {\n\n const parsedResponse = JSON.parse( body );\n const manifestFile = fs.createWriteStream( 'manifest.zip' );\n\n req\n .get( 'https://www.bungie.net' + parsedResponse.Response.mobileWorldContentPaths.en )\n .pipe( manifestFile )\n .on( 'close', contentDownloaded );\n\n}", "retrieveManifest() {\n return new Promise((resolve, reject) => {\n this.app.getManifest((manifest) => {\n this.manifest = manifest;\n console.log(\"got Manifest!\");\n resolve(manifest);\n }, () => {\n reject(\"App created from new Application - No Manifest Available\");\n });\n });\n }", "function loadManifest(manifest) {\n let data = utils.readFile(manifest);\n let json = data.join(' '); \n return JSON.parse(json);\n}", "function build_content(path) {\r\n var _con = content,\r\n // package.json\r\n json = '{' + eol, ce = program.css, dir_arr = build_path(path), engine = program.template;\r\n json += ' \"name\": \"' + program.name + '\" \\'' + eol;\r\n json += '+\\' , \"version\": \"0.0.1-alpha\" \\'' + eol;\r\n json += '+\\' , \"private\": true \\'' + eol;\r\n json += '+\\' , \"dependencies\": { \\'' + eol;\r\n if(program.css)\r\n json += '+\\' \"' + program.css + '\": \">= 0.0.1\" \\'' + eol;\r\n if(program.template)\r\n json += ' +\\' , \"' + program.template + '\": \">= 0.0.1\" \\'' + eol;\r\n json += '+\\' } \\'' + eol;\r\n json += '+\\'}';\r\n var css_content = 'var ' + engine + 'Layout=' + config.template[engine + 'Layout'] + eol + 'var ' + engine + 'Index=' + config.template[engine + 'Index'] + eol;\r\n _con = _con.replace(\"{name}\", program.name).replace(\"{json}\", json.replace(/\\r\\n/,''));\r\n _con = _con.replace(\"{css_template}\", css_content);\r\n _con = _con.replace(\"{create_css}\", ' write(path + \"' + config.custum_dir.css[ce] + '/style.css\", \"/*please write your '+ program.css +' code here!*/\");' + eol);\r\n _con = _con.replace(\"{create_js}\", '//todo: choose some lib to use ' + program.architec + ' by yourself!'+eol);\r\n _con = _con.replace(\"{create_template}\", '//todo: load template to use ' + program.css + ' by yourself!' + eol);\r\n _con = _con.replace(\"{create_html}\", 'write(path +\"/index.html\",index_html);'+eol);\r\n _con = _con.replace(\"{dir}\",\"'\"+ dir_arr+\"'.split(',').join(' '+path).split(' ').slice(1)\"+eol);\r\n return _con;\r\n}", "function loadManifest(manifest, fromLocalStorage, timeout) {\r\n // Safety timeout. If BOOTSTRAP_OK is not defined,\r\n // it will delete the 'localStorage' version and revert to factory settings.\r\n if (fromLocalStorage) {\r\n setTimeout(function() {\r\n if (!window.BOOTSTRAP_OK) {\r\n console.warn('BOOTSTRAP_OK !== true; Resetting to original manifest.json...');\r\n localStorage.removeItem('manifest');\r\n location.reload();\r\n }\r\n }, timeout);\r\n }\r\n\r\n if (!manifest.load) {\r\n console.error('Manifest has nothing to load (manifest.load is empty).', manifest);\r\n return;\r\n }\r\n\r\n manifest.root = manifest.root || './';\r\n\r\n var el,\r\n loadAsScript = (isFirefox == true && manifest.root == './') || !isFirefox,\r\n head = document.getElementsByTagName('head')[0],\r\n scripts = manifest.load.concat(),\r\n now = Date.now(),\r\n loading = [],\r\n count = 0,\r\n index = 0,\r\n scriptsContent = \"\",\r\n cssContent = \"\";\r\n\r\n function finishLoadingFromFS() {\r\n index++;\r\n if (index == loading.length) {\r\n var el = document.createElement('style');\r\n el.type = 'text/css';\r\n el.innerHTML = cssContent;\r\n head.appendChild(el);\r\n\r\n var el = document.createElement('script');\r\n el.type = 'text/javascript';\r\n console.log(\"appending script\")\r\n el.innerHTML = scriptsContent;\r\n head.appendChild(el);\r\n }\r\n }\r\n\r\n function loadNextFromFS(index) {\r\n if ((loading.length - 1) >= index) {\r\n var element = loading[index][0];\r\n var source = loading[index][1];\r\n window.__fs.root.getFile(source, {},\r\n function(fileEntry) { //onSuccess\r\n fileEntry.file(function(file) {\r\n var reader = new FileReader();\r\n reader.onloadend = function() {\r\n index++;\r\n loadNextFromFS(index);\r\n if (element.type == \"text/javascript\") {\r\n scriptsContent = scriptsContent + \"\\n\" + this.result.toString();\r\n } else {\r\n cssContent = cssContent + \"\\n\" + this.result.toString();\r\n }\r\n finishLoadingFromFS();\r\n }\r\n reader.readAsText(file);\r\n });\r\n },\r\n function() {} //onError\r\n )\r\n }\r\n }\r\n\r\n // Load Scripts\r\n function loadScripts() {\r\n scripts.forEach(function(src) {\r\n if (!src) return;\r\n // Ensure the 'src' has no '/' (it's in the root already)\r\n if (src[0] === '/') src = src.substr(1);\r\n //Don't use the root manifest when loading from local storage for Firefox\r\n if (loadAsScript) {\r\n src = manifest.root + src;\r\n } else {\r\n src = \"app/\" + src;\r\n }\r\n // Load javascript\r\n if (src.substr(-5).indexOf(\".js\") > -1) {\r\n el = document.createElement('script');\r\n el.type = 'text/javascript';\r\n el.async = false;\r\n el.defer = true;\r\n //TODO: Investigate if cache busting is nessecary for some platforms, apparently it does not work in IEMobile 10\r\n if (loadAsScript) {\r\n el.src = src;\r\n } else {\r\n loading.push([el, src]);\r\n }\r\n // Load CSS\r\n } else {\r\n el = document.createElement(loadAsScript ? 'link' : 'style');\r\n el.rel = \"stylesheet\";\r\n if (loadAsScript) {\r\n el.href = src;\r\n } else {\r\n loading.push([el, src]);\r\n }\r\n el.type = \"text/css\";\r\n }\r\n head.appendChild(el);\r\n });\r\n if (!loadAsScript) {\r\n loadNextFromFS(count);\r\n }\r\n }\r\n\r\n //---------------------------------------------------\r\n // Step 3: Ensure the 'root' end with a '/'\r\n if (manifest.root.length > 0 && manifest.root[manifest.root.length - 1] !== '/')\r\n manifest.root += '/';\r\n\r\n // Step 4: Save manifest for next time\r\n if (!fromLocalStorage)\r\n localStorage.setItem('manifest', JSON.stringify(manifest));\r\n\r\n // Step 5: Load Scripts\r\n // If we're loading Cordova files, make sure Cordova is ready first!\r\n if (typeof window.cordova !== 'undefined') {\r\n document.addEventListener(\"deviceready\", loadScripts, false);\r\n } else {\r\n if (loadAsScript) {\r\n loadScripts();\r\n } else {\r\n window.requestFileSystem(1, 20 * 1024 * 1024, function(fs) {\r\n window.__fs = fs;\r\n loadScripts();\r\n }, function() {});\r\n }\r\n }\r\n // Save to global scope\r\n window.Manifest = manifest;\r\n }", "checkManifest(e){return e.icons&&e.icons[0]?e.name?e.description?void 0:void console.error(\"Your web manifest must have a description listed\"):void console.error(\"Your web manifest must have a name listed\"):void console.error(\"Your web manifest must have atleast one icon listed\")}", "function manifestCheck() {\r\n return Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__awaiter\"])(this, void 0, void 0, function () {\r\n var manifestTag, manifestContent, response, e_1;\r\n return Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__generator\"])(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n manifestTag = document.querySelector('link[rel=\"manifest\"]');\r\n if (!manifestTag) {\r\n return [2 /*return*/];\r\n }\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 4, , 5]);\r\n return [4 /*yield*/, fetch(manifestTag.href)];\r\n case 2:\r\n response = _a.sent();\r\n return [4 /*yield*/, response.json()];\r\n case 3:\r\n manifestContent = _a.sent();\r\n return [3 /*break*/, 5];\r\n case 4:\r\n e_1 = _a.sent();\r\n // If the download or parsing fails allow check.\r\n // We only want to error if we KNOW that the gcm_sender_id is incorrect.\r\n return [2 /*return*/];\r\n case 5:\r\n if (!manifestContent || !manifestContent.gcm_sender_id) {\r\n return [2 /*return*/];\r\n }\r\n if (manifestContent.gcm_sender_id !== '103953800507') {\r\n throw errorFactory.create(\"incorrect-gcm-sender-id\" /* INCORRECT_GCM_SENDER_ID */);\r\n }\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}", "function createPackage(next) {\n var pkg = JSON.parse(fs.readFileSync(path.join(scaffold, 'package.json'), 'utf8'));\n\n pkg.name = name;\n pkg.dependencies.flatiron = flatiron.version;\n\n app.log.info('Writing ' + 'package.json'.grey);\n fs.writeFile(path.join(root, 'package.json'), JSON.stringify(pkg, null, 2) + '\\n', next);\n }", "function manifestCheck() {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__awaiter\"])(this, void 0, void 0, function () {\n var manifestTag, manifestContent, response, e_1;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n manifestTag = document.querySelector('link[rel=\"manifest\"]');\n\n if (!manifestTag) {\n return [2\n /*return*/\n ];\n }\n\n _a.label = 1;\n\n case 1:\n _a.trys.push([1, 4,, 5]);\n\n return [4\n /*yield*/\n , fetch(manifestTag.href)];\n\n case 2:\n response = _a.sent();\n return [4\n /*yield*/\n , response.json()];\n\n case 3:\n manifestContent = _a.sent();\n return [3\n /*break*/\n , 5];\n\n case 4:\n e_1 = _a.sent(); // If the download or parsing fails allow check.\n // We only want to error if we KNOW that the gcm_sender_id is incorrect.\n\n return [2\n /*return*/\n ];\n\n case 5:\n if (!manifestContent || !manifestContent.gcm_sender_id) {\n return [2\n /*return*/\n ];\n }\n\n if (manifestContent.gcm_sender_id !== '103953800507') {\n throw errorFactory.create(\"incorrect-gcm-sender-id\"\n /* INCORRECT_GCM_SENDER_ID */\n );\n }\n\n return [2\n /*return*/\n ];\n }\n });\n });\n}", "function create_prod_test_manifest() {\n const creds = read_json(DEV_CREDS_PATH);\n return { ...MANIFEST_BASE, ...PROD_TEST_CONFIG, ...creds };\n}", "confirmConfigAndReport(manifest) {\n let userNotification = __webpack_require__(56).default;\n // definitions to drive verification of config object\n const REQUIRED_STRING = configUtil_1.ConfigUtilInstance.REQUIRED_STRING;\n const REQUIRED_OBJECT = configUtil_1.ConfigUtilInstance.REQUIRED_OBJECT;\n var configVerifyObject = {\n finsemble: {\n applicationRoot: REQUIRED_STRING,\n moduleRoot: REQUIRED_STRING,\n bootTasks: REQUIRED_OBJECT,\n system: {\n FSBLVersion: REQUIRED_STRING,\n requiredServicesConfig: REQUIRED_OBJECT\n },\n workspaceTemplates: REQUIRED_OBJECT,\n servicesRoot: REQUIRED_STRING\n }\n };\n // do an initial sanity check on the boot config\n var configOk = configUtil_1.ConfigUtilInstance.verifyConfigObject(\"manifest\", manifest, configVerifyObject);\n // if any config problems at this level then catastrophic, so report error \"everywhere\"; logger may not come up so use console too\n if (!configOk) {\n let errorMsg = \"Manifest Error: probably cause is the `finsemble` JSON in manifest file is not correct. See system manager console errors for more information.\";\n systemLog_1.default.error({}, errorMsg);\n console.error(errorMsg, \"manifest.finsemble\", manifest.finsemble);\n logger_1.default.system.error(\"forceObjectsToLogger\", errorMsg, \"manifest.finsemble\", manifest.finsemble);\n // notification URL is not pulled from finsemble.notificationURL because config may be corrupted\n userNotification.alert(\"system\", \"ONCE-SINCE-STARTUP\", \"FSBL-Internal-MANIFEST-Error\", errorMsg);\n }\n else {\n logger_1.default.system.log(\"APPLICATION LIFECYCLE:STARTUP: Finsemble Version\", manifest.finsemble.system.FSBLVersion);\n }\n }", "async function copyPackageJson() {\n const packageJson = await fsExtra.readFile(path.resolve(__dirname, '../package.json'), 'utf8');\n const { scripts, devDependencies, files, ...packageDataOther } = JSON.parse(packageJson);\n\n const newPackageJson = {\n ...packageDataOther,\n main: './index.js',\n module: './index.es.js',\n };\n\n const output = path.resolve(__dirname, '../dist/package.json');\n\n await fsExtra.writeFile(output, JSON.stringify(newPackageJson, null, 2), 'utf8');\n console.log(`Created ${output}`);\n}", "function createManifest(files) {\n var manifest = {};\n for (var filename in files) {\n var file = files[filename];\n var sha = Crypto.createHash(\"sha1\").update(file).digest(\"hex\");\n manifest[Path.basename(filename)] = sha;\n }\n return JSON.stringify(manifest);\n}", "function addElements(){\n\tdocument.getElementById(\"extensionVersion\").innerText=manifest.version;\n\tdocument.getElementById(\"extensionName\").innerText=manifest.name;\n}", "function writePreferences(context, preferences) {\n // read manifest\n const manifest = getManifest(context);\n\n // update manifest\n manifest.file = updateBranchMetaData(manifest.file, preferences);\n manifest.file = removeDeprecatedInstalReferrerBroadcastReceiver(manifest.file);\n manifest.file = updateLaunchOptionToSingleTask(\n manifest.file,\n manifest.mainActivityIndex\n );\n manifest.file = updateBranchURIScheme(\n manifest.file,\n manifest.mainActivityIndex,\n preferences\n );\n manifest.file = updateBranchAppLinks(\n manifest.file,\n manifest.mainActivityIndex,\n preferences\n );\n\n // save manifest\n xmlHelper.writeJsonAsXml(manifest.path, manifest.file);\n }", "async function copy() {\n await makeDir('build');\n await Promise.all([\n writeFile(\n 'build/package.json',\n JSON.stringify(\n {\n private: true,\n engines: pkg.engines,\n dependencies: pkg.dependencies,\n scripts: {\n start: 'node server.js',\n },\n },\n null,\n 2,\n ),\n ),\n copyFile('LICENSE.txt', 'build/LICENSE.txt'),\n copyFile('yarn.lock', 'build/yarn.lock'),\n copyDir('public', 'build/public'),\n copyDir('gcp', 'build/gcp'),\n ]);\n}", "function manifest(req, res, next) {\n\tvar manifest = process_manifest(req, req.params.id);\n\tif (!manifest) {\n\t\tres.send(404, '404 Not Found');\n\t\treturn next();\n\t}\n\tres.send(process_manifest(req, req.params.id));\n\treq.log.info(\"served up /datasets/\" + req.params.id);\n\treturn next();\n}", "readRootManifest() {\n return this.readManifest(this.cwd, 'npm', true);\n }", "function makeManifest(exercises, dest, done) {\n var dir = path.join(dest, 'types');\n async.parallel({\n files: fs.readdir.bind(null, dir),\n tags: getTags\n }, function (err, data) {\n if (err) {\n return done(err);\n }\n var manifest = processExercises(exercises, processTags(data.tags), data.files);\n var dest = path.join(dir, 'problemTypes.json');\n console.log('manu', dest);\n fs.writeFile(dest, JSON.stringify(manifest, null, 4), done);\n });\n}", "createPackageFile() {\n // check if `package.json` file already exist\n if (!fs.existsSync(`${this.server}/package.json`)) {\n\n const file = path.join(__dirname, '../files/package.json');\n fs.readFile(file, \"utf-8\", (err, data) => {\n if (err) {\n console.error(err);\n return;\n }\n\n // write package.json file\n fs.writeFile(`${this.server}/package.json`, data, (err) => {\n if (err) {\n console.error('Error creating package.json file');\n return;\n }\n\n console.info(\"Successfully created package.json.\");\n });\n });\n\n return;\n }\n\n console.error(`package.json already exists`);\n }", "function setupManifest() {\n manifest = [\n {\n src: \"images/background.png\",\n id: \"background\"\n },\n {\n src: \"images/treaties/1.png\",\n id: \"treaty_1\"\n },\n {\n src: \"images/treaties/2.png\",\n id: \"treaty_2\"\n },\n {\n src: \"images/treaties/3.png\",\n id: \"treaty_3\"\n },\n {\n src: \"images/treaties/4.png\",\n id: \"treaty_4\"\n },\n {\n src: \"images/treaties/5.png\",\n id: \"treaty_5\"\n },\n {\n src: \"images/treaties/6.png\",\n id: \"treaty_6\"\n },\n {\n src: \"images/treaties/7.png\",\n id: \"treaty_7\"\n },\n {\n src: \"images/treaties/8.png\",\n id: \"treaty_8\"\n },\n {\n src: \"images/treaties/9.png\",\n id: \"treaty_9\"\n },\n {\n src: \"images/treaties/10.png\",\n id: \"treaty_10\"\n },\n {\n src: \"images/treaties/11.png\",\n id: \"treaty_11\"\n },\n {\n src: \"images/treaties/douglas.png\",\n id: \"treaty_douglas\"\n },\n {\n src: \"images/treaties/peace.png\",\n id: \"treaty_peace\"\n },\n {\n src: \"images/treaties/robinson.png\",\n id: \"treaty_robinson\"\n },\n {\n src: \"images/treaties/upper.png\",\n id: \"treaty_upper\"\n },\n {\n src: \"images/treaties/williams.png\",\n id: \"treaty_williams\"\n },\n {\n src: \"images/panel.png\",\n id: \"panel\"\n }\n ];\n}", "function createManifest() {\n const manifest = glob.sync(`${DEST}/*.css`).reduce((acc, file) => {\n const { original, fingerprinted } = fingerprint(file)\n const { publicPath } = baseConfig.output\n return {\n ...acc,\n [original]: publicPath + fingerprinted,\n }\n }, {})\n return manifest\n}", "function Manifest() {\n _classCallCheck(this, Manifest);\n\n this.contents = {};\n this.options = {};\n this.bootstrap = null;\n }", "function injectContent() {\r\n\tvar data = require(\"sdk/self\").data;\r\n\trequire('sdk/page-mod').PageMod({\r\n\t\tinclude: [\"*.gaiamobile.org\"],\r\n\t\tcontentScriptFile: [\r\n\t\t\tdata.url(\"ffos_runtime.js\"),\r\n\t\t\tdata.url(\"hardware.js\"),\r\n\r\n\t\t\tdata.url(\"lib/activity.js\"),\r\n\t\t\tdata.url(\"lib/apps.js\"),\r\n\t\t\tdata.url(\"lib/bluetooth.js\"),\r\n\t\t\tdata.url(\"lib/cameras.js\"),\r\n\t\t\tdata.url(\"lib/idle.js\"),\r\n\t\t\tdata.url(\"lib/keyboard.js\"),\r\n\t\t\tdata.url(\"lib/mobile_connection.js\"),\r\n\t\t\tdata.url(\"lib/power.js\"),\r\n\t\t\tdata.url(\"lib/set_message_handler.js\"),\r\n\t\t\tdata.url(\"lib/settings.js\"),\r\n\t\t\tdata.url(\"lib/wifi.js\")\r\n\t\t],\r\n\t\tcontentScriptWhen: \"start\",\r\n\t\tattachTo: ['existing', 'top', 'frame']\r\n\t})\r\n\r\n\trequire('sdk/page-mod').PageMod({\r\n\t\tinclude: [\"*.homescreen.gaiamobile.org\"],\r\n\t\tcontentScriptFile: [\r\n\t\t\tdata.url(\"apps/homescreen.js\")\r\n\t\t],\r\n\t\tcontentScriptWhen: \"start\",\r\n\t\tattachTo: ['existing', 'top', 'frame']\r\n\t})\r\n\r\n}", "getDistributableFile(name) {\n return new Promise((resolve, reject) => {\n try {\n let bundlePath = `${this.rootPath}/${name}/Manifest.json`;\n fs_1.access(bundlePath, fs_1.constants.R_OK, (error) => {\n if (error) {\n reject(error);\n }\n else {\n resolve(bundlePath);\n }\n });\n }\n catch (error) {\n reject(error);\n }\n });\n }", "function handlePackageFile({path, scope, componentName}) {\n const packageJson = require(path);\n packageJson.name = `${scope}/${componentName}`;\n fs.writeFileSync(path, packageJson);\n}", "async make() {\n try {\n this.log.verbose(`clearing ${this.$.env.paths.electronApp.rootName}`);\n await this.clear();\n } catch (e) {\n this.log.error(\n `error while removing ${this.$.env.paths.electronApp.root}: `, e\n );\n process.exit(1);\n }\n\n this.createAppRoot();\n\n this.copySkeletonApp();\n\n // TODO: hey, wait, .gitignore is not needed - right?\n /*\n this.log.debug('creating .gitignore');\n fs.writeFileSync(this.$.env.paths.electronApp.gitIgnore, [\n 'node_modules'\n ].join('\\n'));\n */\n this.log.verbose('writing package.json');\n fs.writeFileSync(\n this.$.env.paths.electronApp.packageJson, JSON.stringify(this.packageJson, null, 2)\n );\n }", "async writing() {\n // read async from fs\n const reader = async (filepath) => {\n console.log(`read ${filepath}`)\n return fs.promises\n .readFile(this.templatePath(filepath))\n .then((b) => b.toString())\n }\n\n // write sync to memfs\n const writer = (filepath, content) =>\n this.fs.write(this.destinationPath(filepath), content)\n\n // filter git ignored files\n const gitDir = await scaffold.GitDir.New(this.sourceRoot())\n await scaffold.ScaffoldProcessGeneric(\n gitDir.walk(),\n reader,\n writer,\n this.answers\n )\n\n const content = this.fs.readJSON(this.destinationPath('package.json'))\n content.name = this.answers.name\n content.description = this.answers.description\n content.author = this.answers.author\n content.repository.url = this.answers.repository_url\n this.fs.writeJSON(this.destinationPath('package.json'), content, null, 2)\n\n }", "addonLinkersLinkerKeyValuesPut(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n let defaultClient = Bitbucket.ApiClient.instance;\n // Configure API key authorization: api_key\n let api_key = defaultClient.authentications['api_key'];\n api_key.apiKey = incomingOptions.apiKey;\n // Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n api_key.apiKeyPrefix = incomingOptions.apiKeyPrefix || 'Token';\n // Configure HTTP basic authorization: basic\n let basic = defaultClient.authentications['basic'];\n basic.username = 'YOUR USERNAME';\n basic.password = 'YOUR PASSWORD';\n // Configure OAuth2 access token for authorization: oauth2\n let oauth2 = defaultClient.authentications['oauth2'];\n oauth2.accessToken = incomingOptions.accessToken;\n\n let apiInstance = new Bitbucket.AddonApi(); // String |\n /*let linkerKey = \"linkerKey_example\";*/ apiInstance.addonLinkersLinkerKeyValuesPut(\n incomingOptions.linkerKey,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, data, response);\n }\n }\n );\n }", "@memoizeForProp(\"contents\")\n get files() {\n return Object.values(this.manifest).map((item) => item.file)\n }", "function process_manifest(req, uuid) {\n\tvar manifest;\n\ttry {\n\t\tmanifest = require(path.join(serve_dir, uuid + '/manifest'));\n\t\tvar url_prefix = config.prefix + req.header('Host') + config.suffix + \"/datasets/\" + uuid + \"/\";\n\t\tfor (entry in manifest.files) {\n\t\t\tmanifest.files[entry].url = url_prefix + manifest.files[entry].path\n\t\t};\n\t\treturn manifest;\n\t}\n\tcatch(err) {\n\t\treq.log.error(\"Failed to parse manifest for \" + uuid + \" error: \" + err);\n\t\treturn false;\n\t}\n}", "function assemble() {\n // clear previous data\n // deleteFolderSync(path.join(__dirname, '../static'));\n // fs.mkdirSync(path.join(__dirname, '../static'));\n\n // copy data to static\n copyFolderSync(path.join(__dirname, '../data'), path.join(__dirname, '../static'));\n}", "async function copy({ watch } = {}) {\n const ncp = Promise.promisify(require('ncp'));\n\n await Promise.all([\n ncp('./favicon.ico', 'build/util/favicon.ico'),\n ncp('./apple-touch-icon-114x114.png', 'build/util/apple-touch-icon-114x114.png'),\n ncp('./css/lib', 'build/util/css/lib'),\n ncp('./js/lib', 'build/util/js/lib'),\n ncp('./public', 'build/util/public'),\n ncp('./views', 'build/util/views')\n ]);\n\n await fs.writeFile('./build/util/package.json', JSON.stringify({\n private: true,\n engines: pkg.engines,\n dependencies: pkg.dependencies,\n scripts: {\n stop: 'forever stop 0',\n start: 'forever start js/server.js',\n },\n }, null, 2));\n\n}", "function adjustPackageJSON(generator) {\n const packageJSONStorage = generator.createStorage('server/package.json');\n const dependenciesStorage = packageJSONStorage.createStorage('dependencies');\n const dependabotPackageJSON = utils.getDependabotPackageJSON(generator, true);\n\n dependenciesStorage.set('@nestjs/graphql', dependabotPackageJSON.dependencies['@nestjs/graphql']);\n dependenciesStorage.set('graphql', dependabotPackageJSON.dependencies.graphql);\n dependenciesStorage.set('graphql-tools', dependabotPackageJSON.dependencies['graphql-tools']);\n dependenciesStorage.set('graphql-subscriptions', dependabotPackageJSON.dependencies['graphql-subscriptions']);\n dependenciesStorage.set('apollo-server-express', dependabotPackageJSON.dependencies['apollo-server-express']);\n\n const scriptsStorage = packageJSONStorage.createStorage('scripts');\n scriptsStorage.set('start:dev', 'npm run copy-resources && nest start -w');\n scriptsStorage.set('start:nest', 'npm run copy-resources && nest start');\n scriptsStorage.set('build:schema-gql', 'ts-node scripts/build-schema.ts');\n packageJSONStorage.save();\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 }", "tryManifest(dir, registry, isRoot) {\n var _this6 = this;\n\n return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {\n const filename = (_index2 || _load_index2()).registries[registry].filename;\n\n const loc = path.join(dir, filename);\n if (yield (_fs || _load_fs()).exists(loc)) {\n const data = yield _this6.readJson(loc);\n data._registry = registry;\n data._loc = loc;\n return (0, (_index || _load_index()).default)(data, dir, _this6, isRoot);\n } else {\n return null;\n }\n })();\n }", "function makeAssets(\n cxt,\n cb\n) {\n var options = cxt.options,\n details = cxt.details,\n packageMap = cxt.packageMap,\n mostRecentJSDate = cxt.mostRecentJSDate,\n deps = cxt.deps,\n depsFileMap = cxt.depsFileMap,\n cssFileMap = cxt.cssFileMap,\n cssMostRecentDate = cxt.cssMostRecentDate;\n\n async.forEach(details.other, function (f, cb) {\n publishAsset(\n options,\n details.name,\n details.dirname,\n f,\n cb\n );\n }, cb);\n}", "async function main() {\n const program = new Command();\n program.parse(process.argv);\n await fs.mkdir(\"build\", { recursive: true });\n await fs.writeFile(\n \"build/config.json\",\n JSON.stringify(await getDeployConfig(), null, 2) + \"\\n\"\n );\n console.log(\"wrote build/config.json\");\n process.exit(0);\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 }", "async save () {\n let cid\n try {\n cid = await io.write(this._ipfs, 'dag-cbor', {\n contractAddress: this.address,\n abi: JSON.stringify(this.abi, null, 2)\n })\n } catch (e) {\n console.log('ContractAccessController.save ERROR:', e)\n }\n // return the manifest data\n return { address: cid }\n }", "function saveImageManifest() {\n // checks to see if data from all teams have been collected\n if (loaded_images_from_tba == teams.length) {\n fs.writeFileSync(\"data/images/manifest.json\", JSON.stringify(manifest_images));\n // reloads the page afterwards\n window.location.reload();\n }\n}", "function AddVersionString(){\n var manifestData = chrome.runtime.getManifest();\n document.getElementById('versionString').innerHTML = manifestData.version;\n}", "get assetBundleManifestPath() {}", "function publishContent(currentDirectory, statyckConfig, callback) {\n if (!(typeof currentDirectory === 'string')) {\n throw new TypeError(\"Value of argument \\\"currentDirectory\\\" violates contract.\\n\\nExpected:\\nstring\\n\\nGot:\\n\" + _inspect(currentDirectory));\n }\n\n if (!(statyckConfig instanceof Object)) {\n throw new TypeError(\"Value of argument \\\"statyckConfig\\\" violates contract.\\n\\nExpected:\\nObject\\n\\nGot:\\n\" + _inspect(statyckConfig));\n }\n\n if (!(typeof callback === 'function')) {\n throw new TypeError(\"Value of argument \\\"callback\\\" violates contract.\\n\\nExpected:\\nFunction\\n\\nGot:\\n\" + _inspect(callback));\n }\n\n // Calculate the path to the content we have built\n const contentDir = _path2.default.resolve(currentDirectory, statyckConfig.general.outputDirSymlink);\n\n const execOptions = {\n cwd: contentDir\n };\n\n // TODO: Add a check that we can read the dir\n _fs2.default.access(contentDir, _fs2.default.constants.R_OK, FAErr => {\n if (FAErr) {\n return callback(FAErr, null, null);\n }\n\n (0, _child_process.exec)(`gsutil mb -l EU gs://${ statyckConfig.publishing.bucketHame }`, execOptions, (MBErr, MBStdout, MBStderr) => {\n // Ugly but basically, don't error out if the bucket exists already\n if (MBErr && MBStderr.indexOf(\"already exists\") === -1) {\n return callback(MBErr, MBStdout, MBStderr);\n }\n\n const metadata = `-h \"Cache-Control: public, max-age=10\"`;\n\n (0, _child_process.exec)(`gsutil -m ${ metadata } rsync -d -r . gs://${ statyckConfig.publishing.bucketHame }`, execOptions, (SErr, SStdout, SStderr) => {\n return callback(SErr, SStdout, SStderr);\n });\n });\n });\n}", "copyFiles(options) {\n let {\n files,\n kitQuestions,\n folderPath,\n kitPath,\n kit,\n ver,\n isSteamerKit,\n projectName,\n kitConfig\n } = options;\n // 脚手架相关配置问题\n let prompt = inquirer.createPromptModule();\n prompt(kitQuestions)\n .then(answers => {\n\n answers = Object.assign({}, answers, {\n projectName\n });\n\n // 复制文件前的自定义行为\n if (kitConfig.beforeInstallCopy && _.isFunction(kitConfig.beforeInstallCopy)) {\n kitConfig.beforeInstallCopy.bind(this)(answers, folderPath);\n }\n\n files = files.filter(item => {\n return !this.ignoreFiles.includes(item);\n });\n\n files.forEach(item => {\n let srcFiles = path.join(kitPath, item),\n destFile = path.join(folderPath, item);\n\n if (this.fs.existsSync(srcFiles)) {\n this.fs.copySync(srcFiles, destFile);\n }\n });\n\n if (answers.webserver) {\n this.fs.ensureFileSync(\n path.join(folderPath, \"config/steamer.config.js\")\n );\n this.fs.writeFileSync(\n path.join(folderPath, \"config/steamer.config.js\"),\n \"module.exports = \" + JSON.stringify(answers, null, 4)\n );\n }\n\n // 复制文件后的自定义行为\n if (kitConfig.afterInstallCopy && _.isFunction(kitConfig.afterInstallCopy)) {\n kitConfig.afterInstallCopy.bind(this)(answers, folderPath);\n }\n\n if (isSteamerKit) {\n this.createPluginConfig(\n {\n kit: kit,\n version: ver\n },\n folderPath\n );\n }\n\n // 替换项目名称\n if (!!projectName) {\n const oldPkgJson = this.getPkgJson(folderPath);\n let pkgJson = _.merge({}, oldPkgJson, {\n name: projectName\n });\n this.fs.writeFileSync(\n path.join(folderPath, \"package.json\"),\n JSON.stringify(pkgJson, null, 4),\n \"utf-8\"\n );\n }\n // \bbeforeInstall 自定义行为\n if (kitConfig.beforeInstallDep && _.isFunction(kitConfig.beforeInstallDep)) {\n kitConfig.beforeInstallDep.bind(this)(answers, folderPath);\n }\n\n // 安装项目node_modules包\n this.spawn.sync(this.config.NPM, [\"install\"], {\n stdio: \"inherit\",\n cwd: folderPath\n });\n\n // afterInstall 自定义行为\n if (kitConfig.afterInstallDep && _.isFunction(kitConfig.afterInstallDep)) {\n kitConfig.afterInstallDep.bind(this)(answers, folderPath);\n }\n\n this.success(\n `The project is initiated success in ${folderPath}`\n );\n })\n .catch(e => {\n this.error(e.stack);\n });\n }", "_bundleFiles(file, callback) {\n// Instantiate the jsonTransform....\n const JSONTransform = new jsonTransform()\n\n// Set up options with a transforms array....\n let transforms = [],\n opts = {\n transform: transforms\n }\n\n if (this.options.babel) {\n opts.transform.push(this._processBabel)\n }\n\n// invoke module-deps by passing in the entry point file\n let mDeps = moduleDependencies(opts),\n parser = JSONStream.parse(['file'])\n\n mDeps\n .pipe(JSONStream.stringify())\n .pipe(this._esWait())\n .on('data', (data)=> {\n// Store json data into memory....\n this.moduleDepsJSON = JSON.parse(data)\n })\n .pipe(JSONTransform)\n .pipe(browserPack( {\n prelude: this.prelude,\n preludePath: this.preludePath\n } ))\n .pipe(this._esWait())\n .on('data', (data)=> {\n let bundle\n // log('DATA', 'yellow'); log(data)\n// Tack on/ remove any additional needed code....\n if (this.options.strict) {\n if (this.options.reloading) {\n bundle = this._addHMRClientCode(data)\n } else {\n bundle = String(data)\n }\n } else {\n if (this.options.reloading) {\n bundle = this._loosyGoosy(\n this._addHMRClientCode(data)\n )\n } else {\n bundle = this._loosyGoosy(String(data))\n }\n }\n // log('BUNDLE', 'yellow');log(bundle)\n// Write the data to bundle string file....\n fs.writeFile(this.outputFile, bundle, (err)=> {\n if (err) {\n log(err, ['red', 'bold'])\n return\n }\n\n// Call the callBack....\n if (typeof callback === 'function') {\n// Call the callback....\n callback()\n// Bundle success message.....\n log(\n `🎶 ${chalk.hex('#161616').bgWhite.bold(` Mixolydian `)}${chalk.hex('#4073ff').bold(' bundle written in: ')}${chalk.hex('#fccd1b').bold(`${this.ms}ms.`)} 🎶\\n`\n )\n\n// If This is the first bundle from the initial command....\n if (this.firstBundle) {\n/// If the watch option is set....\n if (this.options.watch && this.options.mode !== 'production') {\n/// log out dev server started message....\n log(`${chalk.white.bold(`Development Server started on port ${app.get('port')}. Press Ctrl-C to terminate.`)}\n ${this.options.jc? chalk.hex('#fccd1b').bold('\\n⛪️ Jesus is King!! ⛪️') : ''}\n `)\n process.stdout.write(`\\n`)\n }\n }\n\n// Check for jc option, if present, praise Jesus Christ!\n if (this.options.jc && !this.firstBundle) {\n log(`${chalk.hex('#fccd1b').bold(`🙏 Praise the Lord! 🙏\\n`)}`)\n }\n if (this.firstBundle) {\n this.firstBundle = false\n }\n }\n })\n })\n// End the stream....\n mDeps.end({\n file: path.join(process.env.PWD, file)\n })\n }", "_manifestChanged(newValue,oldValue){if(newValue&&newValue.metadata&&newValue.items){// ensure there's a dynamicELementLoader defined\n// @todo this could also be a place to mix in criticals\n// that are system required yet we lazy load like grid-plate\nif(!newValue.metadata.dynamicElementLoader){newValue.metadata.dynamicElementLoader={\"a11y-gif-player\":\"@lrnwebcomponents/a11y-gif-player/a11y-gif-player.js\",\"citation-element\":\"@lrnwebcomponents/citation-element/citation-element.js\",\"hero-banner\":\"@lrnwebcomponents/hero-banner/hero-banner.js\",\"image-compare-slider\":\"@lrnwebcomponents/image-compare-slider/image-compare-slider.js\",\"license-element\":\"@lrnwebcomponents/license-element/license-element.js\",\"lrn-aside\":\"@lrnwebcomponents/lrn-aside/lrn-aside.js\",\"lrn-calendar\":\"@lrnwebcomponents/lrn-calendar/lrn-calendar.js\",\"lrn-math\":\"@lrnwebcomponents/lrn-math/lrn-math.js\",\"lrn-table\":\"@lrnwebcomponents/lrn-table/lrn-table.js\",\"lrn-vocab\":\"@lrnwebcomponents/lrn-vocab/lrn-vocab.js\",\"lrndesign-blockquote\":\"@lrnwebcomponents/lrndesign-blockquote/lrndesign-blockquote.js\",\"magazine-cover\":\"@lrnwebcomponents/magazine-cover/magazine-cover.js\",\"media-behaviors\":\"@lrnwebcomponents/media-behaviors/media-behaviors.js\",\"media-image\":\"@lrnwebcomponents/media-image/media-image.js\",\"meme-maker\":\"@lrnwebcomponents/meme-maker/meme-maker.js\",\"multiple-choice\":\"@lrnwebcomponents/multiple-choice/multiple-choice.js\",\"paper-audio-player\":\"@lrnwebcomponents/paper-audio-player/paper-audio-player.js\",\"person-testimonial\":\"@lrnwebcomponents/person-testimonial/person-testimonial.js\",\"place-holder\":\"@lrnwebcomponents/place-holder/place-holder.js\",\"q-r\":\"@lrnwebcomponents/q-r/q-r.js\",\"full-width-image\":\"@lrnwebcomponents/full-width-image/full-width-image.js\",\"self-check\":\"@lrnwebcomponents/self-check/self-check.js\",\"simple-concept-network\":\"@lrnwebcomponents/simple-concept-network/simple-concept-network.js\",\"stop-note\":\"@lrnwebcomponents/stop-note/stop-note.js\",\"tab-list\":\"@lrnwebcomponents/tab-list/tab-list.js\",\"task-list\":\"@lrnwebcomponents/task-list/task-list.js\",\"video-player\":\"@lrnwebcomponents/video-player/video-player.js\",\"wave-player\":\"@lrnwebcomponents/wave-player/wave-player.js\",\"wikipedia-query\":\"@lrnwebcomponents/wikipedia-query/wikipedia-query.js\"}}_haxcmsSiteStore.store.manifest=newValue;this.dispatchEvent(new CustomEvent(\"json-outline-schema-changed\",{bubbles:!0,composed:!0,cancelable:!1,detail:newValue}))}}", "function getManifest (backup) {\n return new Promise(async (resolve, reject) => {\n // Try the new sqlite file database.\n try {\n log.verbose('Trying sqlite manifest...')\n let item = await getSqliteFileManifest(backup)\n return resolve(item)\n } catch (e) {\n log.verbose('Trying sqlite manifest... [failed]', e)\n }\n\n // Try the mbdb file database\n try {\n log.verbose('Trying mbdb manifest...')\n let item = await getMBDBFileManifest(backup)\n return resolve(item)\n } catch (e) {\n log.verbose('Trying mbdb manifest...[failed]', e)\n }\n\n reject(new Error('Could not find a manifest.'))\n })\n}", "function processManifest(manifest, basePathStr) {\n try {\n var entries = manifest[defaults.manifestEntriesPropertyName];\n //if there aren't any entries, or the array is empty nothin to do\n if (is.nill(entries) || !is.array(entries) || is.empty(entries)) {\n return promise.resolve(manifest);\n }\n //if the entries array is only objects then nothin to do\n if (entries.join(\"\").match(OBJ_ONLY_ENTRY_PATT)) {\n return promise.resolve(manifest);\n }\n //create an array of manifest path loading procs and their keys\n return loadManifestPathEntries(\n entries\n , basePathStr\n )\n .then(function thenReturnManifest(loadedMAnifests) {\n return promise.resolve(manifest);\n });\n }\n catch(ex) {\n return promise.reject(ex);\n }\n }", "function setBoilerPlate(){\n rl.question('Please enter a file directory path ', (answer) => {\n // TODO: Log the answer in a database\n return fs.exists(answer, (exist)=>{\n if(exist === false){\n console.log('Error: directory does not exist.');\n setBoilerPlate();\n }else{\n fs.readFile('./server-starter.js', 'utf8', (err, data) => {\n if (err) throw err;\n fs.writeFile('./boilerplate/app.js', data, (err, data) => {\n if (err) throw err;\n console.log('File has been sucessfully copied!')\n })\n });\n }\n })\n rl.close();\n });\n}", "function onInstall_() {\n\n Log_.functionEntryPoint();\n var ui = SpreadsheetApp.getUi()\n var settingsSheet = SpreadsheetApp.getActive().getSheetByName('Settings')\n\n // Ask where the copy is to be made to\n \n do {\n \n var response = ui.prompt('What\\'s the ID of the destination folder', ui.ButtonSet.OK_CANCEL)\n var clientFolderId = response.getResponseText()\n \n if (response.getSelectedButton() == ui.Button.CANCEL) {\n return\n }\n\n } while (clientFolderId === '') \n\n // Get a copy of the config sheet template and put it in the client's folder\n \n var configSheetTemplateId = settingsSheet.getRange('A2').getValue()\n var configSheet = SpreadsheetApp.openById(configSheetTemplateId).copy('Config Sheet')\n var configSheetId = configSheet.getId()\n var configSheetFile = DriveApp.getFileById(configSheetId)\n var configSheetParentFolder = configSheetFile.getParents().next()\n \n DriveApp.getFolderById(clientFolderId).addFile(configSheetFile)\n configSheetParentFolder.removeFile(configSheetFile)\n \n Log_.info('Created Config sheet ' + configSheetId)\n \n // Register this user to it\n \n var user = Session.getEffectiveUser().getEmail()\n \n if (user === '') {\n \n Log_.warning('Failed to register user with config sheet')\n \n } else {\n \n Config.initialise({\n email: user,\n spreadsheetId: configSheetId,\n })\n \n Log_.info('Registered ' + user + ' on sheet ' + configSheetId)\n }\n \n // Copy the template folder tree \n \n var fileList = Utils_.getList('Files');\n var folderList = Utils_.getList('Folders');\n var templateFolderId = settingsSheet.getRange('A3').getValue()\n Copy_.startCopy(templateFolderId, clientFolderId, fileList, folderList);\n ui.alert('CloudFire successfully installed to ' + clientFolderId)\n \n} // onInstall_() ", "function scaffoldNPM() {\n // CSS Scripts\n if (cssChoice) {\n packageJSON['scripts'][cssChoice] = packageScriptTemplates[cssChoice];\n packageJSON['scripts']['build:styles'] =\n packageScriptTemplates['build:styles'].replace('%s', cssChoice);\n }\n // JS Scripts\n if (jsChoice) {\n packageJSON['scripts'][jsChoice] = packageScriptTemplates[jsChoice];\n packageJSON['scripts']['build:scripts'] =\n packageScriptTemplates['build:scripts'].replace('%s', jsChoice);\n packageJSON['devDependencies'][(devDependencyTemplates[jsChoice])] = 'latest';\n }\n // Write out the completed package.json template\n fs.writeJsonSync(workingDir + 'package.json', packageJSON);\n\n teardown(); // Go to last step\n}", "_fileChanged(newValue,oldValue){if(typeof newValue!==typeof void 0){this.$.manifest.generateRequest()}}", "async function copy({ watch } = {}) {\n const ncp = Promise.promisify(require('ncp'));\n\n await Promise.all([\n ncp('src/public', 'build/public'),\n ncp('src/content', 'build/content'),\n ]);\n\n await fs.writeFile('./build/package.json', JSON.stringify({\n private: true,\n engines: pkg.engines,\n dependencies: pkg.dependencies,\n scripts: {\n start: 'node server.js',\n },\n }, null, 2));\n\n if (watch) {\n const watcher = await new Promise((resolve, reject) => {\n gaze('src/content/**/*.*', (err, val) => err ? reject(err) : resolve(val));\n });\n watcher.on('changed', async (file) => {\n const relPath = file.substr(path.join(__dirname, '../src/content/').length);\n await ncp(`src/content/${relPath}`, `build/content/${relPath}`);\n });\n }\n}", "function convertWithFileCopy (program) {\n return new Promise((resolve, reject) => {\n let preAppx = path.join(program.outputDirectory, 'pre-appx')\n let app = path.join(preAppx, 'app')\n let manifest = path.join(preAppx, 'AppXManifest.xml')\n let manifestTemplate = path.join(__dirname, '..', 'template', 'AppXManifest.xml')\n let assets = path.join(preAppx, 'assets')\n let assetsTemplate = path.join(__dirname, '..', 'template', 'assets')\n\n utils.log(chalk.green.bold('Starting Conversion...'))\n utils.debug(`Using pre-appx folder: ${preAppx}`)\n utils.debug(`Using app from: ${app}`)\n utils.debug(`Using manifest template from: ${manifestTemplate}`)\n utils.debug(`Using asset template from ${assetsTemplate}`)\n\n // Clean output folder\n utils.log(chalk.green.bold('Cleaning pre-appx output folder...'))\n fs.emptyDirSync(preAppx)\n\n // Copy in the new manifest, app, assets\n utils.log(chalk.green.bold('Copying data...'))\n fs.copySync(manifestTemplate, manifest)\n utils.debug('Copied manifest template to destination')\n fs.copySync(assetsTemplate, assets)\n utils.debug('Copied asset template to destination')\n fs.copySync(program.inputDirectory, app)\n utils.debug('Copied input app files to destination')\n\n // Then, overwrite the manifest\n fs.readFile(manifest, 'utf8', (err, data) => {\n utils.log(chalk.green.bold('Creating manifest..'))\n let result = data\n let executable = program.packageExecutable || `app\\\\${program.packageName}.exe`\n\n if (err) {\n utils.debug(`Could not read manifest template. Error: ${JSON.stringify(err)}`)\n return utils.log(err)\n }\n\n result = result.replace(/\\${publisherName}/g, program.publisher)\n result = result.replace(/\\${publisherDisplayName}/g, program.publisherDisplayName || 'Reserved')\n result = result.replace(/\\${identityName}/g, program.identityName || program.packageName)\n result = result.replace(/\\${packageVersion}/g, program.packageVersion)\n result = result.replace(/\\${packageName}/g, program.packageName)\n result = result.replace(/\\${packageExecutable}/g, executable)\n result = result.replace(/\\${packageDisplayName}/g, program.packageDisplayName || program.packageName)\n result = result.replace(/\\${packageDescription}/g, program.packageDescription || program.packageName)\n result = result.replace(/\\${packageBackgroundColor}/g, program.packageBackgroundColor || '#464646')\n\n let extensions = '';\n\n if (program.protocols && program.protocols.length > 0) {\n extensions = '<Extensions>';\n \n program.protocols.forEach(item => {\n const protocol = Object.keys(item) && Object.keys(item).length > 0 && Object.keys(item)[0];\n const name = protocol && item[protocol];\n\n protocol && name && (extensions += `<uap:Extension Category=\"windows.protocol\"><uap:Protocol Name=\"${protocol}\"><uap:DisplayName>${name}</uap:DisplayName></uap:Protocol></uap:Extension>`);\n });\n\n extensions += '</Extensions>';\n }\n\n result = result.replace(/\\${extensions}/g, extensions);\n\n fs.writeFile(manifest, result, 'utf8', (err) => {\n if (err) {\n const errorMessage = `Could not write manifest file in pre-appx location. Error: ${JSON.stringify(err)}`\n utils.debug(errorMessage)\n return reject(new Error(errorMessage))\n }\n\n resolve()\n })\n })\n })\n}", "function copyReleaseToExamples(ctxt, callback) {\n\t\tvar exampleBundlePath = path.join(__dirname, '../examples/public/j2j-' + version + '.js');\n\t\tfs.readFile(ctxt.bundlePath, { encoding: 'utf8' }, function (err, content) {\n\t\t\tif (err) {\n\t\t\t\tcallback(err);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfs.writeFile(exampleBundlePath, content, callback);\n\t\t});\n\t}", "addonLinkersLinkerKeyValuesPost(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n let defaultClient = Bitbucket.ApiClient.instance;\n // Configure API key authorization: api_key\n let api_key = defaultClient.authentications['api_key'];\n api_key.apiKey = incomingOptions.apiKey;\n // Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n api_key.apiKeyPrefix = incomingOptions.apiKeyPrefix || 'Token';\n // Configure HTTP basic authorization: basic\n let basic = defaultClient.authentications['basic'];\n basic.username = 'YOUR USERNAME';\n basic.password = 'YOUR PASSWORD';\n // Configure OAuth2 access token for authorization: oauth2\n let oauth2 = defaultClient.authentications['oauth2'];\n oauth2.accessToken = incomingOptions.accessToken;\n\n let apiInstance = new Bitbucket.AddonApi(); // String |\n /*let linkerKey = \"linkerKey_example\";*/ apiInstance.addonLinkersLinkerKeyValuesPost(\n incomingOptions.linkerKey,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, data, response);\n }\n }\n );\n }", "async generated () {\n // @todo check context.markdown.$data.typeLinks for existence\n return fs.copy(metadataDir, path.resolve(context.outDir, 'metadata'))\n }", "function convertFromBase(manifestInfo, callback) {\n\n//check to make sure you have a manifest before you try to transform it\n if (!manifestInfo || !manifestInfo.content) {\n return Q.reject(new Error('Manifest content is empty or not initialized.')).nodeify(callback);\n }\n\n //good to have a local ref to work with. You'll see that you work work off of manifestInfo.content in platform.js\n var originalManifest = manifestInfo.content;\n\n\n//here we are going to convert the W3C manifest to our strawman app\n//note that you might need to re-map some values, or add some new ones\n var manifest = {\n '$schema': 'https://developer.microsoft.com/en-us/json-schemas/teams/v1.5/MicrosoftTeams.schema.json',\n 'manifestVersion': '1.5',\n 'version': '1.0.0',\n 'id': utils.newGuid(),\n 'name': {\n 'short': originalManifest.short_name || 'TODO: Enter short name (30 characters or less)',\n 'full': originalManifest.name || ''\n },\n 'description': {\n 'short': originalManifest.short_description || 'TODO: Enter short description (80 characters or less)',\n 'full': originalManifest.long_description || 'TODO: Enter full description (4000 characters or less)'\n },\n 'developer': {\n 'name': originalManifest.developer_name || 'TODO: Enter developer name',\n 'websiteUrl': originalManifest.start_url || 'TODO: Enter website url',\n 'privacyUrl': originalManifest.privacyUrl || 'TODO: Enter privacy url',\n 'termsOfUseUrl': originalManifest.termsOfUseUrl || 'TODO: Enter terms of use url'\n },\n 'configurableTabs': [\n         {\n             'configurationUrl': originalManifest.start_url || 'TODO: Enter webpage URL',\n             'canUpdateConfiguration': true,\n             'scopes': [\n                 'team',\n                 'groupchat'\n             ]\n         }\n     ],\n 'permissions': ['identity', 'messageTeamMembers'],\n 'validDomains': [\n url.parse(originalManifest.start_url).hostname\n ]\n };\n\n // Create package name (reverse URL domain)\n var packageName = '';\n if (originalManifest.start_url && originalManifest.start_url.length) {\n var hostnameArray = url.parse(originalManifest.start_url).hostname.split('.');\n for (var i = hostnameArray.length - 1; i > 0; i--) {\n packageName = packageName + hostnameArray[i] + '.';\n }\n packageName = packageName + hostnameArray[0];\n manifest.packageName = packageName;\n } else {\n manifest.packageName = 'TODO: Enter package name. Ex: \"com.microsoft.teams.devapp\"';\n }\n\n // Select optional accent color (must be in hex format; ex: #FFFFFF)\n if (originalManifest.theme_color && originalManifest.theme_color[0] === '#') {\n manifest.accentColor = originalManifest.theme_color;\n } else if (originalManifest.background_color && originalManifest.background_color[0] === '#') {\n manifest.accentColor = originalManifest.background_color;\n }\n\n // Here's a pretty standard practice of mapping the icons from the W3C to the manifest object you pass back to platform.js\n //if you don't use images in your platform, delete this stuff\n if (originalManifest.icons && originalManifest.icons.length) {\n var icons = {};\n for (var j = 0; j < originalManifest.icons.length; j++) {\n var icon = originalManifest.icons[j];\n var size = ['32x32', '192x192'].indexOf(icon.sizes); //specify which size icons from manifest to keep\n if(size >=0){\n if (icon.sizes == '32x32') {\n icons.outline = icon.src;\n } else if (icon.sizes == '192x192') {\n icons.color = icon.src;\n }\n }\n }\n manifest.icons = icons;\n }\n\n // NOTE: you may need to map permissions in this file as well, if your app supports permissions, pull them from\n //originalManifest.mjs_api_access\n\n//This is important, this will be converted into a file that lives on your project root. Manifoldjs uses it, and it's a good record\n//to have around, so make sure you leave this. Add extra info to it if you think it would be handy\n var convertedManifestInfo = {\n 'content': manifest,\n 'format': lib.constants.STRAWMAN_MANIFEST_FORMAT\n };\n //this is the return, that's all she wrote!\n return Q.resolve(convertedManifestInfo).nodeify(callback);\n}", "installGenre(genreName, genreAddress, f=null) {\n\t\tconsole.log(\"Creating: \" + genreAddress);\n\t\tvar data_inner_path = \"merged-ZeroLSTN/\" + indexAddress + \"/data/users/\" + app.siteInfo.auth_address + \"/data.json\";\n\t\tvar content_inner_path = \"merged-ZeroLSTN/\" + indexAddress + \"/data/users/\" + app.siteInfo.auth_address + \"/content.json\";\n\t\tthis.cmd(\"fileGet\", { \"inner_path\": data_inner_path, \"required\": false }, (data) => {\n\t\t\tif (!data) {\n\t\t\t\tconsole.log(\"Creating default data.json...\");\n\t\t\t\tdata = {};\n\t\t\t} else {\n\t\t\t\tdata = JSON.parse(data);\n\t\t\t}\n\n\t\t\t// Create \"genres\" object if it doesn't exist\n\t\t\tif (!data.genres) {\n\t\t\t\tdata.genres = {};\n\t\t\t}\n\n\t\t\t// Add genre name and address to the index\n\t\t\tdata.genres[genreAddress] = {\n\t\t\t\tname: genreName,\n\t\t\t\tdate_added: Date.now()\n\t\t\t}\t\t\t\n\n\t\t\t// Write (and Sign and Publish)\n\t\t\tvar json_raw = unescape(encodeURIComponent(JSON.stringify(data, undefined, \"\\t\")));\n\t\t\tthis.cmd(\"fileWrite\", [data_inner_path, btoa(json_raw)], (res) => {\n\t\t\t\tif (res === \"ok\") {\n\t\t\t\t\tthis.cmd(\"siteSign\", { \"inner_path\": content_inner_path }, () => {\n\t\t\t\t\t\tthis.cmd(\"sitePublish\", { \"inner_path\": content_inner_path, \"sign\": false }, () => {\n\t\t\t\t\t\t\t// Run callback function\n\t\t\t\t\t\t\tif (f !== null && typeof f === \"function\") f();\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tthis.cmd(\"wrapperNotification\", [\"error\", \"File write error: \" + JSON.stringify(res)]);\n\t\t\t\t\tif (f !== null && typeof f === \"function\") f();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "function getClientBuildManifest() {\n if (self.__BUILD_MANIFEST) {\n return Promise.resolve(self.__BUILD_MANIFEST);\n }\n\n const onBuildManifest = new Promise(resolve => {\n // Mandatory because this is not concurrent safe:\n const cb = self.__BUILD_MANIFEST_CB;\n\n self.__BUILD_MANIFEST_CB = () => {\n resolve(self.__BUILD_MANIFEST);\n cb && cb();\n };\n });\n return resolvePromiseWithTimeout(onBuildManifest, MS_MAX_IDLE_DELAY, markAssetError(new Error('Failed to load client build manifest')));\n}", "function getClientBuildManifest() {\n if (self.__BUILD_MANIFEST) {\n return Promise.resolve(self.__BUILD_MANIFEST);\n }\n\n const onBuildManifest = new Promise(resolve => {\n // Mandatory because this is not concurrent safe:\n const cb = self.__BUILD_MANIFEST_CB;\n\n self.__BUILD_MANIFEST_CB = () => {\n resolve(self.__BUILD_MANIFEST);\n cb && cb();\n };\n });\n return resolvePromiseWithTimeout(onBuildManifest, MS_MAX_IDLE_DELAY, markAssetError(new Error('Failed to load client build manifest')));\n}", "function getClientBuildManifest() {\n if (self.__BUILD_MANIFEST) {\n return Promise.resolve(self.__BUILD_MANIFEST);\n }\n\n const onBuildManifest = new Promise(resolve => {\n // Mandatory because this is not concurrent safe:\n const cb = self.__BUILD_MANIFEST_CB;\n\n self.__BUILD_MANIFEST_CB = () => {\n resolve(self.__BUILD_MANIFEST);\n cb && cb();\n };\n });\n return resolvePromiseWithTimeout(onBuildManifest, MS_MAX_IDLE_DELAY, markAssetError(new Error('Failed to load client build manifest')));\n}", "function getClientBuildManifest() {\n if (self.__BUILD_MANIFEST) {\n return Promise.resolve(self.__BUILD_MANIFEST);\n }\n\n var onBuildManifest = new Promise(function (resolve) {\n // Mandatory because this is not concurrent safe:\n var cb = self.__BUILD_MANIFEST_CB;\n\n self.__BUILD_MANIFEST_CB = function () {\n resolve(self.__BUILD_MANIFEST);\n cb && cb();\n };\n });\n return Promise.race([onBuildManifest, idleTimeout(MS_MAX_IDLE_DELAY, markAssetError(new Error('Failed to load client build manifest')))]);\n}", "function getClientBuildManifest() {\n if (self.__BUILD_MANIFEST) {\n return Promise.resolve(self.__BUILD_MANIFEST);\n }\n\n var onBuildManifest = new Promise(function (resolve) {\n // Mandatory because this is not concurrent safe:\n var cb = self.__BUILD_MANIFEST_CB;\n\n self.__BUILD_MANIFEST_CB = function () {\n resolve(self.__BUILD_MANIFEST);\n cb && cb();\n };\n });\n return Promise.race([onBuildManifest, idleTimeout(MS_MAX_IDLE_DELAY, markAssetError(new Error('Failed to load client build manifest')))]);\n}", "function getClientBuildManifest() {\n if (self.__BUILD_MANIFEST) {\n return Promise.resolve(self.__BUILD_MANIFEST);\n }\n\n var onBuildManifest = new Promise(function (resolve) {\n // Mandatory because this is not concurrent safe:\n var cb = self.__BUILD_MANIFEST_CB;\n\n self.__BUILD_MANIFEST_CB = function () {\n resolve(self.__BUILD_MANIFEST);\n cb && cb();\n };\n });\n return Promise.race([onBuildManifest, idleTimeout(MS_MAX_IDLE_DELAY, markAssetError(new Error('Failed to load client build manifest')))]);\n}", "function addManifestLinkTag(optionalCustomUrl) {\n const url = new URL(window.location.href);\n let manifestUrl = url.searchParams.get('manifest');\n if (!manifestUrl) {\n manifestUrl = optionalCustomUrl || 'basic.json';\n }\n\n var linkTag = document.createElement(\"link\");\n linkTag.id = \"manifest\";\n linkTag.rel = \"manifest\";\n linkTag.href = `./${manifestUrl}`;\n document.head.append(linkTag);\n}", "function readManifest() {\n\n // read course manifest file\n var oImsmanifestXML = getXmlDocument(launchData.CourseLocation + \"/imsmanifest.xml\");\n\n if (!oImsmanifestXML) {\n alert(\"The imsmanifest.xml file course cannot be read.\");\n return null;\n }\n\n var aScormVersion = $(oImsmanifestXML).find(\"schemaversion\");\n if (!aScormVersion.length) {\n alert(\"The version of SCORM could not be determined.\");\n return null;\n } else {\n launchData.ScormVersion = $(aScormVersion[0]).text();\n if (!launchData.ScormVersion) {\n alert(\"The version of SCORM could not be determined.\");\n return null;\n }\n }\n\n // check the number of SCOs by counting organization item tags\n var SCOs = $(oImsmanifestXML).find(\"organizations organization item\");\n if (!SCOs.length || SCOs.length > 1) {\n alert(\"The manifest file has an invalid number of SCOs.\");\n return null;\n }\n // get the course title from the item title child element\n launchData.CourseTitle = $(\"title\", SCOs[0]).text();\n // get the launch URL\n launchData.LaunchURL = $(oImsmanifestXML).find(\"resources resource[identifier=\" + $(SCOs[0]).attr(\"identifierref\") + \"]\").attr(\"href\");\n // everything looks good so far, return true if we found a valid SCORM version in the manifest\n if (launchData.ScormVersion == \"1.2\" || launchData.ScormVersion == \"CAM 1.3\" || launchData.ScormVersion == \"2004 3rd Edition\" || launchData.ScormVersion == \"2004 4th Edition\") {\n return SCOs[0];\n } else {\n // invalid SCORM version\n alert(\"The version of SCORM could not be determined.\");\n }\n return null;\n}", "function getClientBuildManifest() {\n if (self.__BUILD_MANIFEST) {\n return Promise.resolve(self.__BUILD_MANIFEST);\n }\n\n var onBuildManifest = new Promise(function (resolve) {\n // Mandatory because this is not concurrent safe:\n var cb = self.__BUILD_MANIFEST_CB;\n\n self.__BUILD_MANIFEST_CB = function () {\n resolve(self.__BUILD_MANIFEST);\n cb && cb();\n };\n });\n return resolvePromiseWithTimeout(onBuildManifest, MS_MAX_IDLE_DELAY, markAssetError(new Error('Failed to load client build manifest')));\n}", "function getClientBuildManifest() {\n if (self.__BUILD_MANIFEST) {\n return Promise.resolve(self.__BUILD_MANIFEST);\n }\n\n var onBuildManifest = new Promise(function (resolve) {\n // Mandatory because this is not concurrent safe:\n var cb = self.__BUILD_MANIFEST_CB;\n\n self.__BUILD_MANIFEST_CB = function () {\n resolve(self.__BUILD_MANIFEST);\n cb && cb();\n };\n });\n return resolvePromiseWithTimeout(onBuildManifest, MS_MAX_IDLE_DELAY, markAssetError(new Error('Failed to load client build manifest')));\n}", "function getClientBuildManifest() {\n if (self.__BUILD_MANIFEST) {\n return Promise.resolve(self.__BUILD_MANIFEST);\n }\n\n var onBuildManifest = new Promise(function (resolve) {\n // Mandatory because this is not concurrent safe:\n var cb = self.__BUILD_MANIFEST_CB;\n\n self.__BUILD_MANIFEST_CB = function () {\n resolve(self.__BUILD_MANIFEST);\n cb && cb();\n };\n });\n return resolvePromiseWithTimeout(onBuildManifest, MS_MAX_IDLE_DELAY, markAssetError(new Error('Failed to load client build manifest')));\n}", "function getClientBuildManifest() {\n if (self.__BUILD_MANIFEST) {\n return Promise.resolve(self.__BUILD_MANIFEST);\n }\n\n var onBuildManifest = new Promise(function (resolve) {\n // Mandatory because this is not concurrent safe:\n var cb = self.__BUILD_MANIFEST_CB;\n\n self.__BUILD_MANIFEST_CB = function () {\n resolve(self.__BUILD_MANIFEST);\n cb && cb();\n };\n });\n return resolvePromiseWithTimeout(onBuildManifest, MS_MAX_IDLE_DELAY, markAssetError(new Error('Failed to load client build manifest')));\n}", "function getClientBuildManifest() {\n if (self.__BUILD_MANIFEST) {\n return Promise.resolve(self.__BUILD_MANIFEST);\n }\n\n var onBuildManifest = new Promise(function (resolve) {\n // Mandatory because this is not concurrent safe:\n var cb = self.__BUILD_MANIFEST_CB;\n\n self.__BUILD_MANIFEST_CB = function () {\n resolve(self.__BUILD_MANIFEST);\n cb && cb();\n };\n });\n return resolvePromiseWithTimeout(onBuildManifest, MS_MAX_IDLE_DELAY, markAssetError(new Error('Failed to load client build manifest')));\n}", "function getClientBuildManifest() {\n if (self.__BUILD_MANIFEST) {\n return Promise.resolve(self.__BUILD_MANIFEST);\n }\n\n var onBuildManifest = new Promise(function (resolve) {\n // Mandatory because this is not concurrent safe:\n var cb = self.__BUILD_MANIFEST_CB;\n\n self.__BUILD_MANIFEST_CB = function () {\n resolve(self.__BUILD_MANIFEST);\n cb && cb();\n };\n });\n return resolvePromiseWithTimeout(onBuildManifest, MS_MAX_IDLE_DELAY, markAssetError(new Error('Failed to load client build manifest')));\n}" ]
[ "0.7450435", "0.6612072", "0.6487672", "0.64505833", "0.6382626", "0.6315528", "0.6282556", "0.59809566", "0.59745485", "0.585672", "0.5856709", "0.5847147", "0.5835128", "0.5802598", "0.57041276", "0.56962323", "0.56509733", "0.5643752", "0.56177825", "0.5606977", "0.55103606", "0.548167", "0.54148257", "0.53991383", "0.5378362", "0.5378362", "0.5378203", "0.5373132", "0.53576636", "0.5349701", "0.53406656", "0.53159714", "0.53133154", "0.5310586", "0.53055143", "0.5270737", "0.52661914", "0.5242623", "0.524051", "0.5237879", "0.52320457", "0.52160376", "0.521599", "0.5202412", "0.5201372", "0.5193744", "0.5189508", "0.5181457", "0.5173071", "0.5160871", "0.5156088", "0.51385444", "0.5135673", "0.5131357", "0.51266855", "0.51092136", "0.5086331", "0.5077272", "0.5072333", "0.50720954", "0.5068666", "0.50653803", "0.5064594", "0.5028437", "0.5007234", "0.5006513", "0.4995457", "0.49728176", "0.49715477", "0.4971477", "0.49712875", "0.49514222", "0.49457014", "0.49392143", "0.4930901", "0.4930269", "0.4928401", "0.4927857", "0.4924248", "0.49224296", "0.4901347", "0.48785982", "0.48760423", "0.48710427", "0.48621595", "0.48576123", "0.4848551", "0.4848551", "0.4848551", "0.48409945", "0.48409945", "0.48409945", "0.48376155", "0.48323184", "0.48279476", "0.48279476", "0.48279476", "0.48279476", "0.48279476", "0.48279476" ]
0.7219483
1
function gcb_manifest will call gcb_manifest_content() to write the manifest.json.
function gcb_manifest(){ var fs = require("fs"); var y = document.getElementById("fileImportDialog"); var file = y.files[0]; var new_file_name = file.name.replace(/ELO/, ""); var gcb_path = file.path.replace(file.name, "") + "GCB" + new_file_name.replace(/ /g, "_"); var count = 0; fs.open(gcb_path + "/manifest.json", "w", function(err,fd){ if(err) throw err; else{ var buf = new Buffer("{\n \"entities\": ["); fs.write(fd, buf, 0, buf.length, 0, function(err, written, buffer){ if(err) throw err; console.log(err, written, buffer); }) fs.readdir(gcb_path + "/files/assets/css/", function(err, files){ for(var i = 0 in files){ var n = files[i].lastIndexOf("."); if(files[i].substr(n+1, files[i].length) == "css"){ gcb_manifest_content("\"files/assets/css/" + files[i] + "\""); } } }) fs.readdir(gcb_path + "/files/assets/html/", function(err, files){ for(var i = 0 in files){ gcb_manifest_content("\"files/assets/html/" + files[i] + "\""); } }) fs.readdir(gcb_path + "/files/assets/img/", function(err, files){ for(var i = 0 in files){ gcb_manifest_content("\"files/assets/img/" + files[i] + "\""); } fs.appendFile(gcb_path + "/manifest.json", "\n\t{\n\t \"is_draft\": false,\n\t \"path\": \"files/course.yaml\"\n\t},", function(err){ if(err) throw err; console.log("record course.yaml was complete!"); }) console.log("image"); }) fs.readdir(gcb_path + "/files/data/", function(err, files){ for(var i = 0 in files){ gcb_manifest_content("\"files/data/" + files[i] + "\""); } }) fs.readdir(gcb_path + "/models/", function(err, files){ for(var i = 0 in files){ count += 1; console.log(count); if( files.length == count){ fs.appendFile(gcb_path + "/manifest.json", "\n\t{\n\t \"is_draft\": false,\n\t \"path\": \"models/" + files[i] + "\"\n\t}", function(err){ if(err) throw err; }) } else{ gcb_manifest_content("\"models/" + files[i] + "\""); } } }) setTimeout(function(){ fs.appendFile(gcb_path + "/manifest.json", "\n ],\n \"raw\": \"course:/new_course::ns_new_course\",\n \"version\": \"1.3\"\n}", function(err){ if(err) throw err; console.log("raw was added"); }) }, 20) fs.close(fd, function(err){ //close course.yaml file if(err) throw err; console.log("manifest.json closed successfully !"); }) } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writeManifestToFile() {\n var jsonContent = JSON.stringify(this.manifest, null, \" \");\n var strFileName = io.appendPath(conf.manifestPath, this.strManifestFileName);\n io.writeFile(strFileName, jsonContent);\n}", "function gcb_manifest_content(filepath){\n\tvar fs = require(\"fs\");\n\tvar y = document.getElementById(\"fileImportDialog\");\n\tvar file = y.files[0];\n\tvar new_file_name = file.name.replace(/ELO/, \"\");\n\tvar gcb_path = file.path.replace(file.name, \"\") + \"GCB\" + new_file_name.replace(/ /g, \"_\");\n\n\n\tfs.appendFile(gcb_path + \"/manifest.json\", \n\t\"\\n\\t{\\n\\t \\\"is_draft\\\": false,\\n\\t \\\"path\\\": \" + filepath + \"\\n\\t},\", function(err){\n\t\t\t\t\t\t\t\t\t\t\n\t\tif(err) throw err;\n \t\tconsole.log(' gcb_manifest_content was complete!');\n\t})\n}", "function generateManifest() {\n var stream = gulp.src(MANIFEST_SOURCE_FILES)\n .pipe(manifest({name: 'manifest.json'}))\n .pipe(gulp.dest('build/'));\n stream.on('end', function () {\n gulpUtil.log('Updated asset manifest');\n });\n}", "function manifest(ignored) {}", "function loadManifest(manifest) {\n let data = utils.readFile(manifest);\n let json = data.join(' '); \n return JSON.parse(json);\n}", "static get manifest() { return 'package.json'; }", "function writeManifest(manifest,manifestFilename,appendManifest, workingDir) {\n\treturn new Promise(function (resolve,reject) {\n\t\tmanifest = transformManifest(manifest, workingDir);\n\n\t\tlet appendPromise;\n\t\tif (appendManifest) {\n\t\t\tappendPromise = fsp.readJSON(manifestFilename);\n\t\t} else {\n\t\t\tappendPromise = Promise.resolve({});\n\t\t}\n\n\t\tappendPromise.then(function (oldManifest) {\n\t\t\tmanifest = Object.assign(oldManifest, manifest);\n\t\t\tresolve(fsp.writeJSON(manifest, manifestFilename));\n\t\t}).catch(function (err) {\n\t\t\tif (err.message.match(/ENOENT: no such file or directory/)) {\n\t\t\t\tresolve(fsp.writeJSON(manifest, manifestFilename));\n\t\t\t} else {\n\t\t\t\treject(err);\n\t\t\t}\n\t\t});\n\t});\n}", "function createManifest() {\n if (this.arrBookStructureEntries == null) return;\n if (this.arrPageXmlFiles == null) return;\n if (this.iPageXmlsLoaded != this.arrPageXmlFiles.length) return;\n //this.manifest = {label: \"Manifest for img\", sequences: \"lol\"};\n\n this.manifest = {\n label: conf.bookTitle,\n \"@type\": \"sc:Manifest\",\n \"@id\": conf.manifestUrl+this.strManifestFileName,\n \"@context\": \"http://iiif.io/api/presentation/2/context.json\",\n \"license\": conf.license,\n \"logo\": conf.logo,\n \"attribution\": conf.attribution,\n \"metadata\": [],\n \"sequences\": [],\n \"structures\": []\n };\n addMetadataToManifest();\n addSequenceAndStructureToManifest();\n writeManifestToFile();\n}", "_fetchManifest() {\n if (this.debug) {\n this.CACHE = {}\n return\n }\n\n const manifest_path = this.getManifestPath()\n\n process.on('SIGINT', this._deleteManifest)\n process.on('beforeExit', this._deleteManifest)\n\n if (fs.existsSync(manifest_path)) {\n try {\n this.CACHE = JSON.parse( fs.readFileSync(manifest_path).toString('utf8') ).ASSETS\n } catch(e) {\n this.CACHE = {}\n this._updateManifest()\n }\n } else {\n this.CACHE = {}\n this._updateManifest()\n }\n }", "function manifest({source, destination}){\n return function() {\n const common = gulp.src(`${settings.source}/manifest.json`)\n const additions = gulp.src(`${source}/manifest_additions.json`)\n manifest_stream = mergeStream(additions, common)\n .pipe(mergeJSON('manifest.json'))\n .pipe(jeditor(function(json) {\n json.version=settings.version\n return json\n }))\n if (destination){\n return manifest_stream.pipe(gulp.dest(destination));\n } else {\n return manifest_stream\n }\n }\n}", "function getManifest() {\n if (cachedManifest)\n return cachedManifest;\n\n // Do a synchronous XHR to get the manifest.\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", \"extension/manifest.json\", false);\n xhr.send(null);\n return xhr.responseText;\n}", "function packageJSON(cb) {\n const json = Object.assign({}, packageJson);\n delete json['scripts'];\n if (!fs.existsSync(packageDistribution)) {\n fs.mkdirSync(packageDistribution);\n }\n fs.writeFileSync(`${packageDistribution}/package.json`,\n JSON.stringify(json, null, 2));\n cb();\n}", "function loadManifest(manifest, fromLocalStorage, timeout) {\r\n // Safety timeout. If BOOTSTRAP_OK is not defined,\r\n // it will delete the 'localStorage' version and revert to factory settings.\r\n if (fromLocalStorage) {\r\n setTimeout(function() {\r\n if (!window.BOOTSTRAP_OK) {\r\n console.warn('BOOTSTRAP_OK !== true; Resetting to original manifest.json...');\r\n localStorage.removeItem('manifest');\r\n location.reload();\r\n }\r\n }, timeout);\r\n }\r\n\r\n if (!manifest.load) {\r\n console.error('Manifest has nothing to load (manifest.load is empty).', manifest);\r\n return;\r\n }\r\n\r\n manifest.root = manifest.root || './';\r\n\r\n var el,\r\n loadAsScript = (isFirefox == true && manifest.root == './') || !isFirefox,\r\n head = document.getElementsByTagName('head')[0],\r\n scripts = manifest.load.concat(),\r\n now = Date.now(),\r\n loading = [],\r\n count = 0,\r\n index = 0,\r\n scriptsContent = \"\",\r\n cssContent = \"\";\r\n\r\n function finishLoadingFromFS() {\r\n index++;\r\n if (index == loading.length) {\r\n var el = document.createElement('style');\r\n el.type = 'text/css';\r\n el.innerHTML = cssContent;\r\n head.appendChild(el);\r\n\r\n var el = document.createElement('script');\r\n el.type = 'text/javascript';\r\n console.log(\"appending script\")\r\n el.innerHTML = scriptsContent;\r\n head.appendChild(el);\r\n }\r\n }\r\n\r\n function loadNextFromFS(index) {\r\n if ((loading.length - 1) >= index) {\r\n var element = loading[index][0];\r\n var source = loading[index][1];\r\n window.__fs.root.getFile(source, {},\r\n function(fileEntry) { //onSuccess\r\n fileEntry.file(function(file) {\r\n var reader = new FileReader();\r\n reader.onloadend = function() {\r\n index++;\r\n loadNextFromFS(index);\r\n if (element.type == \"text/javascript\") {\r\n scriptsContent = scriptsContent + \"\\n\" + this.result.toString();\r\n } else {\r\n cssContent = cssContent + \"\\n\" + this.result.toString();\r\n }\r\n finishLoadingFromFS();\r\n }\r\n reader.readAsText(file);\r\n });\r\n },\r\n function() {} //onError\r\n )\r\n }\r\n }\r\n\r\n // Load Scripts\r\n function loadScripts() {\r\n scripts.forEach(function(src) {\r\n if (!src) return;\r\n // Ensure the 'src' has no '/' (it's in the root already)\r\n if (src[0] === '/') src = src.substr(1);\r\n //Don't use the root manifest when loading from local storage for Firefox\r\n if (loadAsScript) {\r\n src = manifest.root + src;\r\n } else {\r\n src = \"app/\" + src;\r\n }\r\n // Load javascript\r\n if (src.substr(-5).indexOf(\".js\") > -1) {\r\n el = document.createElement('script');\r\n el.type = 'text/javascript';\r\n el.async = false;\r\n el.defer = true;\r\n //TODO: Investigate if cache busting is nessecary for some platforms, apparently it does not work in IEMobile 10\r\n if (loadAsScript) {\r\n el.src = src;\r\n } else {\r\n loading.push([el, src]);\r\n }\r\n // Load CSS\r\n } else {\r\n el = document.createElement(loadAsScript ? 'link' : 'style');\r\n el.rel = \"stylesheet\";\r\n if (loadAsScript) {\r\n el.href = src;\r\n } else {\r\n loading.push([el, src]);\r\n }\r\n el.type = \"text/css\";\r\n }\r\n head.appendChild(el);\r\n });\r\n if (!loadAsScript) {\r\n loadNextFromFS(count);\r\n }\r\n }\r\n\r\n //---------------------------------------------------\r\n // Step 3: Ensure the 'root' end with a '/'\r\n if (manifest.root.length > 0 && manifest.root[manifest.root.length - 1] !== '/')\r\n manifest.root += '/';\r\n\r\n // Step 4: Save manifest for next time\r\n if (!fromLocalStorage)\r\n localStorage.setItem('manifest', JSON.stringify(manifest));\r\n\r\n // Step 5: Load Scripts\r\n // If we're loading Cordova files, make sure Cordova is ready first!\r\n if (typeof window.cordova !== 'undefined') {\r\n document.addEventListener(\"deviceready\", loadScripts, false);\r\n } else {\r\n if (loadAsScript) {\r\n loadScripts();\r\n } else {\r\n window.requestFileSystem(1, 20 * 1024 * 1024, function(fs) {\r\n window.__fs = fs;\r\n loadScripts();\r\n }, function() {});\r\n }\r\n }\r\n // Save to global scope\r\n window.Manifest = manifest;\r\n }", "async writeBuildManifest ({ build }) {\n let output_directory = build.id || ''\n const dest = path.join(this.options.cwd, OUTPUT_DIRECTORY, output_directory, build.blueprint.identifier);\n await this.ensureDir(dest)\n\n return new Promise((resolve, reject) => {\n fs.writeFileSync(path.join(dest + '/codotype-build.json'), JSON.stringify(build, null, 2))\n fs.writeFileSync(path.join(dest + `/${build.blueprint.identifier}-codotype-blueprint.json`), JSON.stringify(build.blueprint, null, 2))\n return resolve()\n });\n }", "function addJsaseManifest() {\n var jsaseManifest = {};\n\n function getLocations() {\n return manifest['locations'].map(function(location) {\n return {\n 'key': location['id'],\n 'rank': location['rank'],\n 'level': location['level'],\n 'weight': location['weight']\n };\n });\n }\n\n function getServers() {\n var serverList = manifest['cdns'];\n\n return serverList.map(function(server) {\n return {\n 'name': server['name'],\n 'type': server['type'],\n 'id': server['id'],\n 'key': server['locationId'],\n 'rank': server['rank'],\n 'lowgrade': server['isLowgrade']\n };\n });\n }\n\n function getAudioTrackList() {\n var audioTracks = manifest['audioTracks'];\n\n return audioTracks.map(function(audioTrack) {\n return {\n 'id': audioTrack['id'],\n 'channels': audioTrack['channels'],\n 'language': audioTrack['bcp47'],\n 'languageDescription': audioTrack['language'],\n 'trackType': audioTrack['trackType']\n };\n });\n }\n\n function getUrls(urls) {\n var urlList = [];\n for (var key in urls) {\n if (urls.hasOwnProperty(key)) {\n urlList.push({\n 'cdn_id': key,\n 'url': urls[key]\n });\n }\n }\n return urlList;\n }\n\n function getAudioTracks() {\n var audioTracks = manifest['audioTracks'];\n\n function getStreams(streams, audioTrack) {\n return streams.map(function(stream) {\n return {\n 'type': 0,\n 'trackType': audioTrack['trackType'],\n 'content_profile': stream['contentProfile'],\n 'downloadable_id': stream['downloadableId'],\n 'bitrate': stream['bitrate'],\n 'channels': audioTrack['channels'],\n 'language': audioTrack['bcp47'],\n 'urls': getUrls(stream['urls'])\n };\n });\n }\n\n return audioTracks.map(function(audioTrack) {\n return {\n 'type': 0,\n 'track_id': audioTrack['id'],\n 'channels': audioTrack['channels'],\n 'language': audioTrack['bcp47'],\n 'languageDescription': audioTrack['language'],\n 'trackType': audioTrack['trackType'],\n 'streams': getStreams(audioTrack['downloadables'], audioTrack)\n };\n });\n }\n\n function getVideoTracks() {\n var videoTracks = manifest['videoTracks'];\n\n function getStreams(streams, trackType) {\n var streamList = streams.map(function(stream) {\n return {\n 'type': 1,\n 'trackType': trackType,\n 'content_profile': stream['contentProfile'],\n 'downloadable_id': stream['downloadableId'],\n 'bitrate': stream['bitrate'],\n 'urls': getUrls(stream['urls'])\n };\n });\n\n // sort list of tracks because ASE code assumes it\n arraySortByProperty(streamList, 'bitrate');\n return streamList;\n }\n\n return videoTracks.map(function(videoTrack) {\n return {\n 'type': 1,\n 'streams': getStreams(videoTrack['downloadables'], videoTrack['trackType'])\n };\n });\n }\n\n\n /**\n *\n * Get the default audio track by looking up its trackID.\n * If no trackID is given, assume this is video and return 0 by default\n * since we only have one videoTrack.\n *\n * @param {Array} trackList\n * @param {String=} trackId\n * @returns {number}\n */\n function findDefaultTrackIndex(trackList, trackId) {\n var index = 0;\n trackList.some(\n function (t, i) {\n if (t[\"track_id\"] == trackId) {\n index = i;\n return true;\n }\n return false;\n });\n return index;\n }\n\n jsaseManifest['movieId'] = manifest['movieId'];\n jsaseManifest['duration'] = manifest['runtime'];\n jsaseManifest['locations'] = getLocations();\n jsaseManifest['servers'] = getServers();\n jsaseManifest['audio_tracks'] = getAudioTracks();\n jsaseManifest['video_tracks'] = getVideoTracks();\n jsaseManifest['tracks'] = jsaseManifest['video_tracks'].concat(jsaseManifest['audio_tracks']);\n\n playback.defaultAudioTrackIndex = findDefaultTrackIndex(jsaseManifest['audio_tracks'], defaultAudioTrack.trackId);\n playback.defaultVideoTrackIndex = findDefaultTrackIndex(jsaseManifest['video_tracks'], defaultVideoTrack.trackId);\n\n return jsaseManifest;\n }", "retrieveManifest() {\n return new Promise((resolve, reject) => {\n this.app.getManifest((manifest) => {\n this.manifest = manifest;\n console.log(\"got Manifest!\");\n resolve(manifest);\n }, () => {\n reject(\"App created from new Application - No Manifest Available\");\n });\n });\n }", "function handleManifest(manifest, walkContext) {\n const async = manifest.async;\n if (async) {\n // create jobs to build each async package\n for (const asyncName in async) {\n if (hasOwn.call(async, asyncName)) {\n if (!hasOwn.call(foundAsyncPackages, asyncName)) {\n foundAsyncPackages[asyncName] = true;\n buildAsyncPackagesWorkQueue.push({\n asyncPackageName: asyncName,\n dependencies: async[asyncName]\n });\n }\n }\n }\n }\n }", "_writeNewContent() {\n this.packageJsonContent.version = this._formatVersion()\n fs.writeFileSync(packagePath, JSON.stringify(this.packageJsonContent, null, 2))\n }", "function manifest(req, res, next) {\n\tvar manifest = process_manifest(req, req.params.id);\n\tif (!manifest) {\n\t\tres.send(404, '404 Not Found');\n\t\treturn next();\n\t}\n\tres.send(process_manifest(req, req.params.id));\n\treq.log.info(\"served up /datasets/\" + req.params.id);\n\treturn next();\n}", "function writePackageJSON (btrc) {\n let packageJSONObject = btrc;\n packageJSONObject[\"name\"] = name;\n packageJSONObject[\"version\"] = \"0.1.0\";\n let packageJSONString = JSON.stringify(packageJSONObject);\n return new Promise((res, rej) => {\n fs.writeFile(path + \"/package.json\", packageJSONString, (err) => {\n return err ? rej(err) : res();\n });\n });\n }", "async function loadManifest( opts, source ) {\n const path = Path.join( source, ContentManifestName );\n const manifest = await readJSON( path, DefaultContentManifest );\n // If the manifest specifies a \"pwa\" section then ensure that it has\n // a minimum set of properties.\n const { pwa } = manifest;\n if( pwa ) {\n manifest.pwa = Object.assign(\n {},\n DefaultPWASettings,\n pwa );\n }\n return manifest;\n}", "function processManifest(manifest, basePathStr) {\n try {\n var entries = manifest[defaults.manifestEntriesPropertyName];\n //if there aren't any entries, or the array is empty nothin to do\n if (is.nill(entries) || !is.array(entries) || is.empty(entries)) {\n return promise.resolve(manifest);\n }\n //if the entries array is only objects then nothin to do\n if (entries.join(\"\").match(OBJ_ONLY_ENTRY_PATT)) {\n return promise.resolve(manifest);\n }\n //create an array of manifest path loading procs and their keys\n return loadManifestPathEntries(\n entries\n , basePathStr\n )\n .then(function thenReturnManifest(loadedMAnifests) {\n return promise.resolve(manifest);\n });\n }\n catch(ex) {\n return promise.reject(ex);\n }\n }", "function writePreferences(context, preferences) {\n // read manifest\n const manifest = getManifest(context);\n\n // update manifest\n manifest.file = updateBranchMetaData(manifest.file, preferences);\n manifest.file = removeDeprecatedInstalReferrerBroadcastReceiver(manifest.file);\n manifest.file = updateLaunchOptionToSingleTask(\n manifest.file,\n manifest.mainActivityIndex\n );\n manifest.file = updateBranchURIScheme(\n manifest.file,\n manifest.mainActivityIndex,\n preferences\n );\n manifest.file = updateBranchAppLinks(\n manifest.file,\n manifest.mainActivityIndex,\n preferences\n );\n\n // save manifest\n xmlHelper.writeJsonAsXml(manifest.path, manifest.file);\n }", "function main(filePath) {\n /*// NON-CHEERIO WAY:\nvar manifestObject = generateManifestObject(filePath);\nvar formattedManifest = mapManifestData(manifestObject);*/\n\n // CHEERIO WAY:\n filePath = 'imsmanifest.xml';\n generateManifestObject(filePath);\n formattedManifest = mapManifestData();\n\n return formattedManifest;\n}", "function Manifest() {\n _classCallCheck(this, Manifest);\n\n this.contents = {};\n this.options = {};\n this.bootstrap = null;\n }", "function buildManifest(env) {\n return gulp.src(PATHS.src.manifest)\n // print out the file deets\n .pipe(size(SIZE_OPTS))\n // write the result\n .pipe(gulp.dest(`${PATHS.build[env].root}`));\n}", "function manifestContentResponse( error, response, body ) {\n\n const parsedResponse = JSON.parse( body );\n const manifestFile = fs.createWriteStream( 'manifest.zip' );\n\n req\n .get( 'https://www.bungie.net' + parsedResponse.Response.mobileWorldContentPaths.en )\n .pipe( manifestFile )\n .on( 'close', contentDownloaded );\n\n}", "function createManifest(files) {\n var manifest = {};\n for (var filename in files) {\n var file = files[filename];\n var sha = Crypto.createHash(\"sha1\").update(file).digest(\"hex\");\n manifest[Path.basename(filename)] = sha;\n }\n return JSON.stringify(manifest);\n}", "function process_manifest(req, uuid) {\n\tvar manifest;\n\ttry {\n\t\tmanifest = require(path.join(serve_dir, uuid + '/manifest'));\n\t\tvar url_prefix = config.prefix + req.header('Host') + config.suffix + \"/datasets/\" + uuid + \"/\";\n\t\tfor (entry in manifest.files) {\n\t\t\tmanifest.files[entry].url = url_prefix + manifest.files[entry].path\n\t\t};\n\t\treturn manifest;\n\t}\n\tcatch(err) {\n\t\treq.log.error(\"Failed to parse manifest for \" + uuid + \" error: \" + err);\n\t\treturn false;\n\t}\n}", "function AddVersionString(){\n var manifestData = chrome.runtime.getManifest();\n document.getElementById('versionString').innerHTML = manifestData.version;\n}", "function chromeAppAssets() {\n\tgulp.src('manifest.json')\n\t\t.pipe(gulp.dest('./build'));\n\n\treturn gulp.src('icon.png')\n\t\t.pipe(gulp.dest('./build'));\n}", "function createManifest() {\n const manifest = glob.sync(`${DEST}/*.css`).reduce((acc, file) => {\n const { original, fingerprinted } = fingerprint(file)\n const { publicPath } = baseConfig.output\n return {\n ...acc,\n [original]: publicPath + fingerprinted,\n }\n }, {})\n return manifest\n}", "function saveImageManifest() {\n // checks to see if data from all teams have been collected\n if (loaded_images_from_tba == teams.length) {\n fs.writeFileSync(\"data/images/manifest.json\", JSON.stringify(manifest_images));\n // reloads the page afterwards\n window.location.reload();\n }\n}", "readManifest() {\n let /** Array<Uint8> */ manifest_raw = new Uint8Array(this.buffer.slice(\n this.cursor, this.cursor + this.manifest_len\n ))\n this.cursor += this.manifest_len\n this.manifest = update_metadata_pb.DeltaArchiveManifest\n .decode(manifest_raw)\n }", "function manifestCheck() {\r\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_tslib__[\"__awaiter\"])(this, void 0, void 0, function () {\r\n var manifestTag, manifestContent, response, e_1;\r\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_tslib__[\"__generator\"])(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n manifestTag = document.querySelector('link[rel=\"manifest\"]');\r\n if (!manifestTag) {\r\n return [2 /*return*/];\r\n }\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 4, , 5]);\r\n return [4 /*yield*/, fetch(manifestTag.href)];\r\n case 2:\r\n response = _a.sent();\r\n return [4 /*yield*/, response.json()];\r\n case 3:\r\n manifestContent = _a.sent();\r\n return [3 /*break*/, 5];\r\n case 4:\r\n e_1 = _a.sent();\r\n // If the download or parsing fails allow check.\r\n // We only want to error if we KNOW that the gcm_sender_id is incorrect.\r\n return [2 /*return*/];\r\n case 5:\r\n if (!manifestContent || !manifestContent.gcm_sender_id) {\r\n return [2 /*return*/];\r\n }\r\n if (manifestContent.gcm_sender_id !== '103953800507') {\r\n throw errorFactory.create(ERROR_CODES.INCORRECT_GCM_SENDER_ID);\r\n }\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}", "readRootManifest() {\n return this.readManifest(this.cwd, 'npm', true);\n }", "function generateClientManifest(compiler,assetMap,rewrites){const compilerSpan=_profilingPlugin.spans.get(compiler);const genClientManifestSpan=compilerSpan==null?void 0:compilerSpan.traceChild('NextJsBuildManifest-generateClientManifest');return genClientManifestSpan==null?void 0:genClientManifestSpan.traceFn(()=>{const clientManifest={// TODO: update manifest type to include rewrites\n__rewrites:rewrites};const appDependencies=new Set(assetMap.pages['/_app']);const sortedPageKeys=(0,_utils.getSortedRoutes)(Object.keys(assetMap.pages));sortedPageKeys.forEach(page=>{const dependencies=assetMap.pages[page];if(page==='/_app')return;// Filter out dependencies in the _app entry, because those will have already\n// been loaded by the client prior to a navigation event\nconst filteredDeps=dependencies.filter(dep=>!appDependencies.has(dep));// The manifest can omit the page if it has no requirements\nif(filteredDeps.length){clientManifest[page]=filteredDeps;}});// provide the sorted pages as an array so we don't rely on the object's keys\n// being in order and we don't slow down look-up time for page assets\nclientManifest.sortedPages=sortedPageKeys;return(0,_devalue.default)(clientManifest);});}", "function addElements(){\n\tdocument.getElementById(\"extensionVersion\").innerText=manifest.version;\n\tdocument.getElementById(\"extensionName\").innerText=manifest.name;\n}", "function registerChrome(data) {\n let aomStartup = Cc[\"@mozilla.org/addons/addon-manager-startup;1\"]\n .getService(Ci.amIAddonManagerStartup);\n const manifestURI = Services.io.newURI(\"manifest.json\", null, data.context.extension.rootURI);\n chromeHandle = aomStartup.registerChrome(manifestURI, [\n [\"content\", \"aboutsync\", \"data/\"],\n ]);\n}", "function manifestCheck() {\r\n return Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__awaiter\"])(this, void 0, void 0, function () {\r\n var manifestTag, manifestContent, response, e_1;\r\n return Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__generator\"])(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n manifestTag = document.querySelector('link[rel=\"manifest\"]');\r\n if (!manifestTag) {\r\n return [2 /*return*/];\r\n }\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 4, , 5]);\r\n return [4 /*yield*/, fetch(manifestTag.href)];\r\n case 2:\r\n response = _a.sent();\r\n return [4 /*yield*/, response.json()];\r\n case 3:\r\n manifestContent = _a.sent();\r\n return [3 /*break*/, 5];\r\n case 4:\r\n e_1 = _a.sent();\r\n // If the download or parsing fails allow check.\r\n // We only want to error if we KNOW that the gcm_sender_id is incorrect.\r\n return [2 /*return*/];\r\n case 5:\r\n if (!manifestContent || !manifestContent.gcm_sender_id) {\r\n return [2 /*return*/];\r\n }\r\n if (manifestContent.gcm_sender_id !== '103953800507') {\r\n throw errorFactory.create(\"incorrect-gcm-sender-id\" /* INCORRECT_GCM_SENDER_ID */);\r\n }\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}", "function manifestCheck() {\n return Object(__WEBPACK_IMPORTED_MODULE_1_tslib__[\"__awaiter\"])(this, void 0, void 0, function () {\n var manifestTag, manifestContent, response, e_1;\n return Object(__WEBPACK_IMPORTED_MODULE_1_tslib__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n manifestTag = document.querySelector('link[rel=\"manifest\"]');\n if (!manifestTag) {\n return [2 /*return*/];\n }\n _a.label = 1;\n case 1:\n _a.trys.push([1, 4, , 5]);\n return [4 /*yield*/, fetch(manifestTag.href)];\n case 2:\n response = _a.sent();\n return [4 /*yield*/, response.json()];\n case 3:\n manifestContent = _a.sent();\n return [3 /*break*/, 5];\n case 4:\n e_1 = _a.sent();\n // If the download or parsing fails allow check.\n // We only want to error if we KNOW that the gcm_sender_id is incorrect.\n return [2 /*return*/];\n case 5:\n if (!manifestContent || !manifestContent.gcm_sender_id) {\n return [2 /*return*/];\n }\n if (manifestContent.gcm_sender_id !== '103953800507') {\n throw errorFactory.create(ERROR_CODES.INCORRECT_GCM_SENDER_ID);\n }\n return [2 /*return*/];\n }\n });\n });\n}", "function manifestCheck() {\n return Object(__WEBPACK_IMPORTED_MODULE_1_tslib__[\"__awaiter\"])(this, void 0, void 0, function () {\n var manifestTag, manifestContent, response, e_1;\n return Object(__WEBPACK_IMPORTED_MODULE_1_tslib__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n manifestTag = document.querySelector('link[rel=\"manifest\"]');\n if (!manifestTag) {\n return [2 /*return*/];\n }\n _a.label = 1;\n case 1:\n _a.trys.push([1, 4, , 5]);\n return [4 /*yield*/, fetch(manifestTag.href)];\n case 2:\n response = _a.sent();\n return [4 /*yield*/, response.json()];\n case 3:\n manifestContent = _a.sent();\n return [3 /*break*/, 5];\n case 4:\n e_1 = _a.sent();\n // If the download or parsing fails allow check.\n // We only want to error if we KNOW that the gcm_sender_id is incorrect.\n return [2 /*return*/];\n case 5:\n if (!manifestContent || !manifestContent.gcm_sender_id) {\n return [2 /*return*/];\n }\n if (manifestContent.gcm_sender_id !== '103953800507') {\n throw errorFactory.create(ERROR_CODES.INCORRECT_GCM_SENDER_ID);\n }\n return [2 /*return*/];\n }\n });\n });\n}", "checkManifest(e){return e.icons&&e.icons[0]?e.name?e.description?void 0:void console.error(\"Your web manifest must have a description listed\"):void console.error(\"Your web manifest must have a name listed\"):void console.error(\"Your web manifest must have atleast one icon listed\")}", "getBlankBuildManifest() {\n return {\n pages: {\n ssr: {\n dynamic: {},\n nonDynamic: {}\n },\n html: {}\n },\n publicFiles: {},\n cloudFrontOrigins: {}\n };\n }", "function setupManifest() {\n manifest = [\n {\n src: \"images/background.png\",\n id: \"background\"\n },\n {\n src: \"images/treaties/1.png\",\n id: \"treaty_1\"\n },\n {\n src: \"images/treaties/2.png\",\n id: \"treaty_2\"\n },\n {\n src: \"images/treaties/3.png\",\n id: \"treaty_3\"\n },\n {\n src: \"images/treaties/4.png\",\n id: \"treaty_4\"\n },\n {\n src: \"images/treaties/5.png\",\n id: \"treaty_5\"\n },\n {\n src: \"images/treaties/6.png\",\n id: \"treaty_6\"\n },\n {\n src: \"images/treaties/7.png\",\n id: \"treaty_7\"\n },\n {\n src: \"images/treaties/8.png\",\n id: \"treaty_8\"\n },\n {\n src: \"images/treaties/9.png\",\n id: \"treaty_9\"\n },\n {\n src: \"images/treaties/10.png\",\n id: \"treaty_10\"\n },\n {\n src: \"images/treaties/11.png\",\n id: \"treaty_11\"\n },\n {\n src: \"images/treaties/douglas.png\",\n id: \"treaty_douglas\"\n },\n {\n src: \"images/treaties/peace.png\",\n id: \"treaty_peace\"\n },\n {\n src: \"images/treaties/robinson.png\",\n id: \"treaty_robinson\"\n },\n {\n src: \"images/treaties/upper.png\",\n id: \"treaty_upper\"\n },\n {\n src: \"images/treaties/williams.png\",\n id: \"treaty_williams\"\n },\n {\n src: \"images/panel.png\",\n id: \"panel\"\n }\n ];\n}", "function setRealUrlToManifest(options, manifest) {\n const { urlPrefix, cdnPrefix } = options;\n if (!urlPrefix) {\n return manifest;\n }\n\n if (manifest.app_worker && manifest.app_worker.url) {\n manifest.app_worker.url = cdnPrefix + manifest.app_worker.url;\n }\n\n if (manifest.pages && manifest.pages.length > 0) {\n manifest.pages = manifest.pages.map((page) => {\n // has frames\n if (page.frames && page.frames.length > 0) {\n page.frames = page.frames.map((frame) => {\n return changePageInfo(options, frame, manifest);\n });\n }\n\n return changePageInfo(options, page, manifest);\n });\n }\n\n return manifest;\n}", "addManualFilesToManifest() {\n this.manualFiles.forEach(\n file => this.manifest.add(file, this.generateHashedFilePath(file))\n );\n }", "function manifestCheck() {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__awaiter\"])(this, void 0, void 0, function () {\n var manifestTag, manifestContent, response, e_1;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n manifestTag = document.querySelector('link[rel=\"manifest\"]');\n\n if (!manifestTag) {\n return [2\n /*return*/\n ];\n }\n\n _a.label = 1;\n\n case 1:\n _a.trys.push([1, 4,, 5]);\n\n return [4\n /*yield*/\n , fetch(manifestTag.href)];\n\n case 2:\n response = _a.sent();\n return [4\n /*yield*/\n , response.json()];\n\n case 3:\n manifestContent = _a.sent();\n return [3\n /*break*/\n , 5];\n\n case 4:\n e_1 = _a.sent(); // If the download or parsing fails allow check.\n // We only want to error if we KNOW that the gcm_sender_id is incorrect.\n\n return [2\n /*return*/\n ];\n\n case 5:\n if (!manifestContent || !manifestContent.gcm_sender_id) {\n return [2\n /*return*/\n ];\n }\n\n if (manifestContent.gcm_sender_id !== '103953800507') {\n throw errorFactory.create(\"incorrect-gcm-sender-id\"\n /* INCORRECT_GCM_SENDER_ID */\n );\n }\n\n return [2\n /*return*/\n ];\n }\n });\n });\n}", "function addManifestLinkTag(optionalCustomUrl) {\n const url = new URL(window.location.href);\n let manifestUrl = url.searchParams.get('manifest');\n if (!manifestUrl) {\n manifestUrl = optionalCustomUrl || 'basic.json';\n }\n\n var linkTag = document.createElement(\"link\");\n linkTag.id = \"manifest\";\n linkTag.rel = \"manifest\";\n linkTag.href = `./${manifestUrl}`;\n document.head.append(linkTag);\n}", "async function copyPackageJson() {\n const packageJson = await fsExtra.readFile(path.resolve(__dirname, '../package.json'), 'utf8');\n const { scripts, devDependencies, files, ...packageDataOther } = JSON.parse(packageJson);\n\n const newPackageJson = {\n ...packageDataOther,\n main: './index.js',\n module: './index.es.js',\n };\n\n const output = path.resolve(__dirname, '../dist/package.json');\n\n await fsExtra.writeFile(output, JSON.stringify(newPackageJson, null, 2), 'utf8');\n console.log(`Created ${output}`);\n}", "@memoizeForProp(\"contents\")\n get files() {\n return Object.values(this.manifest).map((item) => item.file)\n }", "confirmConfigAndReport(manifest) {\n let userNotification = __webpack_require__(56).default;\n // definitions to drive verification of config object\n const REQUIRED_STRING = configUtil_1.ConfigUtilInstance.REQUIRED_STRING;\n const REQUIRED_OBJECT = configUtil_1.ConfigUtilInstance.REQUIRED_OBJECT;\n var configVerifyObject = {\n finsemble: {\n applicationRoot: REQUIRED_STRING,\n moduleRoot: REQUIRED_STRING,\n bootTasks: REQUIRED_OBJECT,\n system: {\n FSBLVersion: REQUIRED_STRING,\n requiredServicesConfig: REQUIRED_OBJECT\n },\n workspaceTemplates: REQUIRED_OBJECT,\n servicesRoot: REQUIRED_STRING\n }\n };\n // do an initial sanity check on the boot config\n var configOk = configUtil_1.ConfigUtilInstance.verifyConfigObject(\"manifest\", manifest, configVerifyObject);\n // if any config problems at this level then catastrophic, so report error \"everywhere\"; logger may not come up so use console too\n if (!configOk) {\n let errorMsg = \"Manifest Error: probably cause is the `finsemble` JSON in manifest file is not correct. See system manager console errors for more information.\";\n systemLog_1.default.error({}, errorMsg);\n console.error(errorMsg, \"manifest.finsemble\", manifest.finsemble);\n logger_1.default.system.error(\"forceObjectsToLogger\", errorMsg, \"manifest.finsemble\", manifest.finsemble);\n // notification URL is not pulled from finsemble.notificationURL because config may be corrupted\n userNotification.alert(\"system\", \"ONCE-SINCE-STARTUP\", \"FSBL-Internal-MANIFEST-Error\", errorMsg);\n }\n else {\n logger_1.default.system.log(\"APPLICATION LIFECYCLE:STARTUP: Finsemble Version\", manifest.finsemble.system.FSBLVersion);\n }\n }", "_manifestChanged(newValue,oldValue){if(newValue){this.set(\"items\",newValue.items);this.notifyPath(\"items.*\")}}", "tryManifest(dir, registry, isRoot) {\n var _this6 = this;\n\n return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {\n const filename = (_index2 || _load_index2()).registries[registry].filename;\n\n const loc = path.join(dir, filename);\n if (yield (_fs || _load_fs()).exists(loc)) {\n const data = yield _this6.readJson(loc);\n data._registry = registry;\n data._loc = loc;\n return (0, (_index || _load_index()).default)(data, dir, _this6, isRoot);\n } else {\n return null;\n }\n })();\n }", "function create_prod_test_manifest() {\n const creds = read_json(DEV_CREDS_PATH);\n return { ...MANIFEST_BASE, ...PROD_TEST_CONFIG, ...creds };\n}", "get manifest () {\n\t\treturn this._signed_.media ? this._signed_.media.split('\\n').map((item, index) => {\n\t\t\tconst s = item.split('/');\n\t\t\treturn { mediaName: s[0], infoHash: s[1], size: parseInt(s[2]) };\n\t\t}) : [];\n\t}", "addVersion(version) {\n this.manifest.version = version;\n }", "function makeManifest(exercises, dest, done) {\n var dir = path.join(dest, 'types');\n async.parallel({\n files: fs.readdir.bind(null, dir),\n tags: getTags\n }, function (err, data) {\n if (err) {\n return done(err);\n }\n var manifest = processExercises(exercises, processTags(data.tags), data.files);\n var dest = path.join(dir, 'problemTypes.json');\n console.log('manu', dest);\n fs.writeFile(dest, JSON.stringify(manifest, null, 4), done);\n });\n}", "function create(manifest_url) {\n var embed = load_util.embed(manifest_url);\n simple_test.addTestListeners(embed);\n document.body.appendChild(embed);\n}", "function getManifest (backup) {\n return new Promise(async (resolve, reject) => {\n // Try the new sqlite file database.\n try {\n log.verbose('Trying sqlite manifest...')\n let item = await getSqliteFileManifest(backup)\n return resolve(item)\n } catch (e) {\n log.verbose('Trying sqlite manifest... [failed]', e)\n }\n\n // Try the mbdb file database\n try {\n log.verbose('Trying mbdb manifest...')\n let item = await getMBDBFileManifest(backup)\n return resolve(item)\n } catch (e) {\n log.verbose('Trying mbdb manifest...[failed]', e)\n }\n\n reject(new Error('Could not find a manifest.'))\n })\n}", "function collectGulpRevManifest(assetManifest) {\n return through2.obj(function (file, enc, cb) {\n // this transform is just a spy, always push throuhg the file:\n this.push(file)\n\n // Ignore all non-rev'd files\n\t\tif (!file.path || !file.revOrigPath) {\n\t\t\tcb()\n\t\t\treturn\n\t\t}\n\n const revisionedFile = path.relative(file.base, file.path)\n\t\tconst originalFile = path.join(path.dirname(revisionedFile), path.basename(file.revOrigPath))\n\n assetManifest[originalFile] = revisionedFile\n cb()\n })\n}", "readManifest(dir, priorityRegistry, isRoot = false) {\n var _this4 = this;\n\n return this.getCache(`manifest-${dir}`, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {\n const manifest = yield _this4.maybeReadManifest(dir, priorityRegistry, isRoot);\n\n if (manifest) {\n return manifest;\n } else {\n throw new (_errors || _load_errors()).MessageError(_this4.reporter.lang('couldntFindPackagejson', dir), 'ENOENT');\n }\n }));\n }", "function ManifestClient(logging, host, port, credentials) {\n var address = [host, port].join(':');\n this._log = logging;\n this._deadline = 30;\n this._log.info('ManifestClient at:', address);\n this._client = new GrpcManifestClient(\n address\n , credentials || grpc.credentials.createInsecure()\n , {\n 'grpc.max_send_message_length': 80 * 1024 * 1024\n , 'grpc.max_receive_message_length': 80 * 1024 * 1024\n }\n );\n}", "async function loadManifest(manifestBucket, manifestKey) {\n try {\n var getParams = {\n Bucket: manifestBucket,\n Key: manifestKey,\n };\n\n console.log(\"[INFO] loading manifest using: %j\", getParams);\n\n var getObjectResponse = await s3.getObject(getParams).promise();\n\n var body = getObjectResponse.Body.toString();\n\n console.log(\"[INFO] got body: %s\", body);\n\n return JSON.parse(body).manifest;\n } catch (error) {\n console.log(\"[ERROR] failed to load manifest\", error);\n throw error;\n }\n}", "function signManifest(template, manifest, callback) {\n var identifier = template.passTypeIdentifier().replace(/^pass./, \"\");\n\n var args = [\n \"smime\",\n \"-sign\", \"-binary\",\n \"-signer\", Path.resolve(template.keysPath, identifier + \".pem\"),\n \"-certfile\", Path.resolve(template.keysPath, \"wwdr.pem\"),\n ];\n args.push(\"-passin\", \"pass:\" + template.password)\n var sign = execFile(\"openssl\", args, { stdio: \"pipe\" }, function(error, stdout, stderr) {\n if (error) {\n callback(new Error(stderr));\n } else {\n var signature = stdout.split(/\\n\\n/)[3];\n callback(null, new Buffer(signature, \"base64\"));\n }\n });\n sign.stdin.write(manifest);\n sign.stdin.end();\n}", "_fileChanged(newValue,oldValue){if(typeof newValue!==typeof void 0){this.$.manifest.generateRequest()}}", "get assetBundleManifestPath() {}", "function convertFromBase(manifestInfo, callback) {\n\n//check to make sure you have a manifest before you try to transform it\n if (!manifestInfo || !manifestInfo.content) {\n return Q.reject(new Error('Manifest content is empty or not initialized.')).nodeify(callback);\n }\n\n //good to have a local ref to work with. You'll see that you work work off of manifestInfo.content in platform.js\n var originalManifest = manifestInfo.content;\n\n\n//here we are going to convert the W3C manifest to our strawman app\n//note that you might need to re-map some values, or add some new ones\n var manifest = {\n '$schema': 'https://developer.microsoft.com/en-us/json-schemas/teams/v1.5/MicrosoftTeams.schema.json',\n 'manifestVersion': '1.5',\n 'version': '1.0.0',\n 'id': utils.newGuid(),\n 'name': {\n 'short': originalManifest.short_name || 'TODO: Enter short name (30 characters or less)',\n 'full': originalManifest.name || ''\n },\n 'description': {\n 'short': originalManifest.short_description || 'TODO: Enter short description (80 characters or less)',\n 'full': originalManifest.long_description || 'TODO: Enter full description (4000 characters or less)'\n },\n 'developer': {\n 'name': originalManifest.developer_name || 'TODO: Enter developer name',\n 'websiteUrl': originalManifest.start_url || 'TODO: Enter website url',\n 'privacyUrl': originalManifest.privacyUrl || 'TODO: Enter privacy url',\n 'termsOfUseUrl': originalManifest.termsOfUseUrl || 'TODO: Enter terms of use url'\n },\n 'configurableTabs': [\n         {\n             'configurationUrl': originalManifest.start_url || 'TODO: Enter webpage URL',\n             'canUpdateConfiguration': true,\n             'scopes': [\n                 'team',\n                 'groupchat'\n             ]\n         }\n     ],\n 'permissions': ['identity', 'messageTeamMembers'],\n 'validDomains': [\n url.parse(originalManifest.start_url).hostname\n ]\n };\n\n // Create package name (reverse URL domain)\n var packageName = '';\n if (originalManifest.start_url && originalManifest.start_url.length) {\n var hostnameArray = url.parse(originalManifest.start_url).hostname.split('.');\n for (var i = hostnameArray.length - 1; i > 0; i--) {\n packageName = packageName + hostnameArray[i] + '.';\n }\n packageName = packageName + hostnameArray[0];\n manifest.packageName = packageName;\n } else {\n manifest.packageName = 'TODO: Enter package name. Ex: \"com.microsoft.teams.devapp\"';\n }\n\n // Select optional accent color (must be in hex format; ex: #FFFFFF)\n if (originalManifest.theme_color && originalManifest.theme_color[0] === '#') {\n manifest.accentColor = originalManifest.theme_color;\n } else if (originalManifest.background_color && originalManifest.background_color[0] === '#') {\n manifest.accentColor = originalManifest.background_color;\n }\n\n // Here's a pretty standard practice of mapping the icons from the W3C to the manifest object you pass back to platform.js\n //if you don't use images in your platform, delete this stuff\n if (originalManifest.icons && originalManifest.icons.length) {\n var icons = {};\n for (var j = 0; j < originalManifest.icons.length; j++) {\n var icon = originalManifest.icons[j];\n var size = ['32x32', '192x192'].indexOf(icon.sizes); //specify which size icons from manifest to keep\n if(size >=0){\n if (icon.sizes == '32x32') {\n icons.outline = icon.src;\n } else if (icon.sizes == '192x192') {\n icons.color = icon.src;\n }\n }\n }\n manifest.icons = icons;\n }\n\n // NOTE: you may need to map permissions in this file as well, if your app supports permissions, pull them from\n //originalManifest.mjs_api_access\n\n//This is important, this will be converted into a file that lives on your project root. Manifoldjs uses it, and it's a good record\n//to have around, so make sure you leave this. Add extra info to it if you think it would be handy\n var convertedManifestInfo = {\n 'content': manifest,\n 'format': lib.constants.STRAWMAN_MANIFEST_FORMAT\n };\n //this is the return, that's all she wrote!\n return Q.resolve(convertedManifestInfo).nodeify(callback);\n}", "function writePackageJson(results) {\n if (results.packageRepo.length > 0) {\n remote = results.packageRepo;\n }\n return fsp.readFile(path.join(__dirname, 'finalPackage.json'), 'utf-8')\n .then((contents) => {\n return contents\n .replace(\n /<packageName>/gi,\n results.packageName || defaultName\n )\n .replace(\n /<packageDesc>/gi,\n results.packageDesc || defaultDesc\n )\n .replace(\n /<packageVersion>/gi,\n results.packageVersion || defaultVersion\n )\n .replace(\n /<packageAuthor>/gi,\n results.packageAuthor || defaultAuthor\n )\n .replace(\n /<packageLicense>/gi,\n results.packageLicense || defaultLicense\n )\n .replace(\n /<packageRepo>/gi,\n results.packageRepo\n )\n .replace(\n / +\"repository\": \"\",\\n/gi,\n ''\n );\n })\n .then((contents) => {\n fsp.writeFile(path.join(__dirname, 'package.json'), contents);\n });\n}", "function getManifests() {\r\n // Clone manifestsArray\r\n var manifests = JSON.parse(JSON.stringify(MANIFESTS_ARRAY));\r\n var manifestsFileUrl = __webpack_require__.p;\r\n if (manifestsFileUrl && manifestsFileUrl !== '') {\r\n manifests.forEach(function (manifest) {\r\n if (!manifest.loaderConfig.internalModuleBaseUrls || manifest.loaderConfig.internalModuleBaseUrls.length === 0) {\r\n manifest.loaderConfig.internalModuleBaseUrls = [manifestsFileUrl];\r\n }\r\n });\r\n }\r\n else {\r\n console.error(\"Unable to determine \" + \"manifests.js\" + \" file URL. Using default base URL. \" +\r\n 'This is expected if you are running \"gulp serve.\"');\r\n }\r\n return manifests;\r\n}", "FromManifest(raw) {\n let json = JSON.parse(raw.trim(), true);\n for (let prop in json) {\n // Manifest V1\n let isManifestV2 = false;\n switch(prop) {\n case \"name\":\n this.Name = json[prop];\n this.FullName = json[prop];\n break;\n case \"version_number\":\n this.Version.ConvertFromString(json[prop]);\n break;\n case \"website_url\":\n this.URL = json[prop];\n break;\n case \"description\":\n this.Description = json[prop];\n break;\n case \"dependencies\":\n for (let i=0; i<json[prop].length; i++) {\n let dep = new Dependency();\n dep.FromString(json[prop][i])\n this.Dependencies.push(dep);\n }\n break\n default:\n // TODO: Add support for Manifest V2\n this.Manifest = 2;\n return false;\n }\n // Manifest is V1.\n this.Manifest = 1;\n }\n return true\n }", "set assetBundleManifestPath(value) {}", "function handlePackageFile({path, scope, componentName}) {\n const packageJson = require(path);\n packageJson.name = `${scope}/${componentName}`;\n fs.writeFileSync(path, packageJson);\n}", "_installUpdate() {\n browser.runtime.onInstalled.addListener((details) => {\n // Note that console logging doesn't work within this event.\n if (details.reason === 'install') {\n this.app.setState({\n app: {\n installed: true,\n updated: false,\n version: {\n current: chrome.runtime.getManifest().version,\n },\n },\n })\n } else if (details.reason === 'update') {\n this.app.setState({\n app: {\n installed: false,\n updated: true,\n version: {\n current: chrome.runtime.getManifest().version,\n previous: details.previousVersion,\n },\n },\n })\n }\n })\n }", "function postProcess() {\r\n for (var key in _opf.manifest) {\r\n var mediaType = _opf.manifest[key][\"media-type\"];\r\n var href = _opf.manifest[key][\"href\"];\r\n var result = '';\r\n\r\n if (mediaType === \"text/css\") {\r\n result = postProcessCSS(href);\r\n } else if (mediaType === \"application/xhtml+xml\") {\r\n result = postProcessHTML(href);\r\n }\r\n //only change the current file stored in _files if result is defined.\r\n if (result) {\r\n _files[href] = result;\r\n }\r\n }\r\n publish(EVENT.BOOKDATA_READY, STATE.OK, MSG.INIT_EBOOK_READER);\r\n }", "function createPackage(next) {\n var pkg = JSON.parse(fs.readFileSync(path.join(scaffold, 'package.json'), 'utf8'));\n\n pkg.name = name;\n pkg.dependencies.flatiron = flatiron.version;\n\n app.log.info('Writing ' + 'package.json'.grey);\n fs.writeFile(path.join(root, 'package.json'), JSON.stringify(pkg, null, 2) + '\\n', next);\n }", "async getManifest(manifestUrl) {\n try {\n const url = extendUrl(manifestUrl, { query: this._queryParams });\n const result = await this._fetchWithTimeout(url);\n return result ? await result.json() : null;\n } catch (e) {\n if (!e) {\n e = new Error('Unknown error');\n }\n if (!(e instanceof Error)) {\n e = new Error(e.data || `status ${e.statusText || e.status}`);\n }\n throw new Error(`Unable to retrieve manifest from ${manifestUrl}: ${e.message}`);\n }\n }", "writePackageJson(mpath, cb) {\n const semver = require(\"semver\");\n return fs.stat(mpath, function(err, stat) {\n if (err) { return cb(err); }\n const f = stat.isDirectory() ? bna.dir.npmDependencies : bna.npmDependencies;\n return f(mpath, function(err, deps) {\n if (err) { return cb(err); }\n if (stat.isFile()) {\n ({ mpath } = bna.identify(mpath));\n }\n const pkgJsonFile = path.join(mpath, \"package.json\");\n let pkgJson = {};\n if (fs.existsSync(pkgJsonFile)) {\n pkgJson = JSON.parse(fs.readFileSync(pkgJsonFile, \"utf8\"));\n }\n const oldDep = pkgJson.dependencies || {};\n const newdep = {};\n const errList = [];\n // merge into oldDep\n _(deps).each(function(version, name) {\n if (version === null) {\n //errList.push(util.format(\"%s is not versioned!\",name));\n return;\n } else if (!(name in oldDep)) {\n return newdep[name] = version;\n } else { // use semver to check\n const oldVer = oldDep[name];\n if (/:\\/\\//.test(oldVer)) { // test for url pattern\n log(util.format(\"Package %s is ignored due to non-semver %s\", name, oldVer));\n delete oldDep[name];\n return newdep[name] = oldVer; // keep old value\n } else if (!semver.satisfies(version, oldVer)) {\n return errList.push(util.format(\"%s: actual version %s does not satisfy package.json's version %s\", name, version, oldVer));\n } else {\n delete oldDep[name];\n return newdep[name] = oldVer;\n }\n }\n });\n if (errList.length > 0) {\n return cb(new Error(errList.join(\"\\n\")));\n } else {\n pkgJson.dependencies = newdep;\n return fs.writeFile(pkgJsonFile, JSON.stringify(pkgJson, null, 2), \"utf8\", err => cb(err, _(oldDep).keys()));\n }\n });\n });\n }", "function publishContent(currentDirectory, statyckConfig, callback) {\n if (!(typeof currentDirectory === 'string')) {\n throw new TypeError(\"Value of argument \\\"currentDirectory\\\" violates contract.\\n\\nExpected:\\nstring\\n\\nGot:\\n\" + _inspect(currentDirectory));\n }\n\n if (!(statyckConfig instanceof Object)) {\n throw new TypeError(\"Value of argument \\\"statyckConfig\\\" violates contract.\\n\\nExpected:\\nObject\\n\\nGot:\\n\" + _inspect(statyckConfig));\n }\n\n if (!(typeof callback === 'function')) {\n throw new TypeError(\"Value of argument \\\"callback\\\" violates contract.\\n\\nExpected:\\nFunction\\n\\nGot:\\n\" + _inspect(callback));\n }\n\n // Calculate the path to the content we have built\n const contentDir = _path2.default.resolve(currentDirectory, statyckConfig.general.outputDirSymlink);\n\n const execOptions = {\n cwd: contentDir\n };\n\n // TODO: Add a check that we can read the dir\n _fs2.default.access(contentDir, _fs2.default.constants.R_OK, FAErr => {\n if (FAErr) {\n return callback(FAErr, null, null);\n }\n\n (0, _child_process.exec)(`gsutil mb -l EU gs://${ statyckConfig.publishing.bucketHame }`, execOptions, (MBErr, MBStdout, MBStderr) => {\n // Ugly but basically, don't error out if the bucket exists already\n if (MBErr && MBStderr.indexOf(\"already exists\") === -1) {\n return callback(MBErr, MBStdout, MBStderr);\n }\n\n const metadata = `-h \"Cache-Control: public, max-age=10\"`;\n\n (0, _child_process.exec)(`gsutil -m ${ metadata } rsync -d -r . gs://${ statyckConfig.publishing.bucketHame }`, execOptions, (SErr, SStdout, SStderr) => {\n return callback(SErr, SStdout, SStderr);\n });\n });\n });\n}", "async function copy({ watch } = {}) {\n const ncp = Promise.promisify(require('ncp'));\n\n await Promise.all([\n ncp('./favicon.ico', 'build/util/favicon.ico'),\n ncp('./apple-touch-icon-114x114.png', 'build/util/apple-touch-icon-114x114.png'),\n ncp('./css/lib', 'build/util/css/lib'),\n ncp('./js/lib', 'build/util/js/lib'),\n ncp('./public', 'build/util/public'),\n ncp('./views', 'build/util/views')\n ]);\n\n await fs.writeFile('./build/util/package.json', JSON.stringify({\n private: true,\n engines: pkg.engines,\n dependencies: pkg.dependencies,\n scripts: {\n stop: 'forever stop 0',\n start: 'forever start js/server.js',\n },\n }, null, 2));\n\n}", "function getClientBuildManifest() {\n if (self.__BUILD_MANIFEST) {\n return Promise.resolve(self.__BUILD_MANIFEST);\n }\n\n var onBuildManifest = new Promise(function (resolve) {\n // Mandatory because this is not concurrent safe:\n var cb = self.__BUILD_MANIFEST_CB;\n\n self.__BUILD_MANIFEST_CB = function () {\n resolve(self.__BUILD_MANIFEST);\n cb && cb();\n };\n });\n return resolvePromiseWithTimeout(onBuildManifest, MS_MAX_IDLE_DELAY, markAssetError(new Error('Failed to load client build manifest')));\n}", "function getClientBuildManifest() {\n if (self.__BUILD_MANIFEST) {\n return Promise.resolve(self.__BUILD_MANIFEST);\n }\n\n var onBuildManifest = new Promise(function (resolve) {\n // Mandatory because this is not concurrent safe:\n var cb = self.__BUILD_MANIFEST_CB;\n\n self.__BUILD_MANIFEST_CB = function () {\n resolve(self.__BUILD_MANIFEST);\n cb && cb();\n };\n });\n return resolvePromiseWithTimeout(onBuildManifest, MS_MAX_IDLE_DELAY, markAssetError(new Error('Failed to load client build manifest')));\n}", "function getClientBuildManifest() {\n if (self.__BUILD_MANIFEST) {\n return Promise.resolve(self.__BUILD_MANIFEST);\n }\n\n var onBuildManifest = new Promise(function (resolve) {\n // Mandatory because this is not concurrent safe:\n var cb = self.__BUILD_MANIFEST_CB;\n\n self.__BUILD_MANIFEST_CB = function () {\n resolve(self.__BUILD_MANIFEST);\n cb && cb();\n };\n });\n return resolvePromiseWithTimeout(onBuildManifest, MS_MAX_IDLE_DELAY, markAssetError(new Error('Failed to load client build manifest')));\n}", "function getClientBuildManifest() {\n if (self.__BUILD_MANIFEST) {\n return Promise.resolve(self.__BUILD_MANIFEST);\n }\n\n var onBuildManifest = new Promise(function (resolve) {\n // Mandatory because this is not concurrent safe:\n var cb = self.__BUILD_MANIFEST_CB;\n\n self.__BUILD_MANIFEST_CB = function () {\n resolve(self.__BUILD_MANIFEST);\n cb && cb();\n };\n });\n return resolvePromiseWithTimeout(onBuildManifest, MS_MAX_IDLE_DELAY, markAssetError(new Error('Failed to load client build manifest')));\n}", "function getClientBuildManifest() {\n if (self.__BUILD_MANIFEST) {\n return Promise.resolve(self.__BUILD_MANIFEST);\n }\n\n var onBuildManifest = new Promise(function (resolve) {\n // Mandatory because this is not concurrent safe:\n var cb = self.__BUILD_MANIFEST_CB;\n\n self.__BUILD_MANIFEST_CB = function () {\n resolve(self.__BUILD_MANIFEST);\n cb && cb();\n };\n });\n return resolvePromiseWithTimeout(onBuildManifest, MS_MAX_IDLE_DELAY, markAssetError(new Error('Failed to load client build manifest')));\n}", "function getClientBuildManifest() {\n if (self.__BUILD_MANIFEST) {\n return Promise.resolve(self.__BUILD_MANIFEST);\n }\n\n var onBuildManifest = new Promise(function (resolve) {\n // Mandatory because this is not concurrent safe:\n var cb = self.__BUILD_MANIFEST_CB;\n\n self.__BUILD_MANIFEST_CB = function () {\n resolve(self.__BUILD_MANIFEST);\n cb && cb();\n };\n });\n return resolvePromiseWithTimeout(onBuildManifest, MS_MAX_IDLE_DELAY, markAssetError(new Error('Failed to load client build manifest')));\n}", "function getClientBuildManifest() {\n if (self.__BUILD_MANIFEST) {\n return Promise.resolve(self.__BUILD_MANIFEST);\n }\n\n var onBuildManifest = new Promise(function (resolve) {\n // Mandatory because this is not concurrent safe:\n var cb = self.__BUILD_MANIFEST_CB;\n\n self.__BUILD_MANIFEST_CB = function () {\n resolve(self.__BUILD_MANIFEST);\n cb && cb();\n };\n });\n return resolvePromiseWithTimeout(onBuildManifest, MS_MAX_IDLE_DELAY, markAssetError(new Error('Failed to load client build manifest')));\n}", "function getClientBuildManifest() {\n if (self.__BUILD_MANIFEST) {\n return Promise.resolve(self.__BUILD_MANIFEST);\n }\n\n var onBuildManifest = new Promise(function (resolve) {\n // Mandatory because this is not concurrent safe:\n var cb = self.__BUILD_MANIFEST_CB;\n\n self.__BUILD_MANIFEST_CB = function () {\n resolve(self.__BUILD_MANIFEST);\n cb && cb();\n };\n });\n return resolvePromiseWithTimeout(onBuildManifest, MS_MAX_IDLE_DELAY, markAssetError(new Error('Failed to load client build manifest')));\n}", "function getClientBuildManifest() {\n if (self.__BUILD_MANIFEST) {\n return Promise.resolve(self.__BUILD_MANIFEST);\n }\n\n var onBuildManifest = new Promise(function (resolve) {\n // Mandatory because this is not concurrent safe:\n var cb = self.__BUILD_MANIFEST_CB;\n\n self.__BUILD_MANIFEST_CB = function () {\n resolve(self.__BUILD_MANIFEST);\n cb && cb();\n };\n });\n return Promise.race([onBuildManifest, idleTimeout(MS_MAX_IDLE_DELAY, markAssetError(new Error('Failed to load client build manifest')))]);\n}", "function getClientBuildManifest() {\n if (self.__BUILD_MANIFEST) {\n return Promise.resolve(self.__BUILD_MANIFEST);\n }\n\n var onBuildManifest = new Promise(function (resolve) {\n // Mandatory because this is not concurrent safe:\n var cb = self.__BUILD_MANIFEST_CB;\n\n self.__BUILD_MANIFEST_CB = function () {\n resolve(self.__BUILD_MANIFEST);\n cb && cb();\n };\n });\n return Promise.race([onBuildManifest, idleTimeout(MS_MAX_IDLE_DELAY, markAssetError(new Error('Failed to load client build manifest')))]);\n}", "function getClientBuildManifest() {\n if (self.__BUILD_MANIFEST) {\n return Promise.resolve(self.__BUILD_MANIFEST);\n }\n\n var onBuildManifest = new Promise(function (resolve) {\n // Mandatory because this is not concurrent safe:\n var cb = self.__BUILD_MANIFEST_CB;\n\n self.__BUILD_MANIFEST_CB = function () {\n resolve(self.__BUILD_MANIFEST);\n cb && cb();\n };\n });\n return Promise.race([onBuildManifest, idleTimeout(MS_MAX_IDLE_DELAY, markAssetError(new Error('Failed to load client build manifest')))]);\n}", "function download_history() {\n // get all data\n chrome.storage.local.get({username: '', password: '', history: []}, function(o) { \n prefs = o; \n\n // do some hacking to download the data as a file\n var el = document.createElement(\"dummy\");\n el.innerText = \"\" + JSON.stringify(prefs); \n var escapedHTML = el.innerHTML;\n // Use dummy link tag <a> to save\n var link = document.createElement(\"a\");\n link.download = 'data.json';\n link.href = \"data:application/json,\"+escapedHTML;\n \n link.click(); // trigger click/download\n });\n\n}", "async function writeJSON (dstPath, data) {\n const stream = await createGCSStream(dstPath);\n return new Promise ((resolve, reject) => {\n const manifest = stream\n .on('error', (err) => reject(err))\n .on('finish', () => resolve());\n manifest.write(JSON.stringify(data, null, 2)); // pretty-print with 2 spaces\n manifest.end();\n });\n}", "function processManifest(scriptElem, startIndex) {\n\t\t\tvar scriptText = scriptElem.text;\n\t\t\tvar libPropertiesStartIndex = startIndex;\n\t\t\tif(libPropertiesStartIndex > -1) {\n\t\t\t\t// find the beginBrace\n\t\t\t\tvar libPropertiesEndIndex = scriptText.indexOf(';', libPropertiesStartIndex);\n\t\t\t\tvar libPropOpenBraceIndex = scriptText.indexOf('{', libPropertiesStartIndex);\n\t\t\t\tif(libPropOpenBraceIndex > -1) {\n\t\t\t\t\t// find the closing brace\n\t\t\t\t\tvar libPropCloseBraceIndex = findEndingBrace(scriptText, libPropOpenBraceIndex, \"{}\");\n\t\t\t\t\tif(libPropCloseBraceIndex > -1) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tvar libPropsString = \"(\" + scriptText.substring(libPropOpenBraceIndex, libPropCloseBraceIndex+1) + \")\";\n\t\t\t\t\t\t\tlibPropsString = libPropsString.replace(/[\\t\\n\\r]+/gm, ' ');\n\t\t\t\t\t\t\tvar libsPropsObj = eval(libPropsString);\n\n\t\t\t\t\t\t\tif(libsPropsObj && libsPropsObj.hasOwnProperty(\"manifest\")) {\n\t\t\t\t\t\t\t\t// go through manifest and remove unused SpriteSheets\n\t\t\t\t\t\t\t\tvar prePost = \"\";\n\t\t\t\t\t\t\t\tvar insertPre = \"\\n\";\n\n\t\t\t\t\t\t\t\tfunction manItemToString(item) {\n\t\t\t\t\t\t\t\t\tvar periodIndex = item.src.lastIndexOf('.');\n\t\t\t\t\t\t\t\t\tif(periodIndex > -1) {\n\t\t\t\t\t\t\t\t\t\tvar testExt = item.src.substring(periodIndex+1, item.src.length);\n\t\t\t\t\t\t\t\t\t\tif(\t((testExt == 'jpg') ||\n\t\t\t\t\t\t\t\t\t\t\t\t(testExt == 'jpeg') ||\n\t\t\t\t\t\t\t\t\t\t\t\t(testExt == 'png') ||\n\t\t\t\t\t\t\t\t\t\t\t\t(testExt == 'gif') ||\n\t\t\t\t\t\t\t\t\t\t\t\t(testExt == 'bmp')) && makeDataURI) {\n\t\t\t\t\t\t\t\t\t\t\tvar variableName = \"dataURI_\" + dataIndex++;\n\t\t\t\t\t\t\t\t\t\t\tvar imageAsData = convertImgToDataURI(item.src);\n\t\t\t\t\t\t\t\t\t\t\tvar midFix = variableName + \" = \\\"\" + imageAsData + \"\\\";\\n\";\n\t\t\t\t\t\t\t\t\t\t\tinsertPre = insertPre + midFix;\n\n\t\t\t\t\t\t\t\t\t\t\treturn (\"{src: \" + variableName + \", id: \\\"\" + item.id + \"\\\", type: \\\"image\\\"}\");\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse if((testExt == 'js') && inline) {\n\t\t\t\t\t\t\t\t\t\t\tvar scriptAsString = getScriptString(item.src);\n\t\t\t\t\t\t\t\t\t\t\tinsertPre = insertPre + scriptAsString + \"\\n\\n\";\n\t\t\t\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tvar itemKeys = Object.keys(item);\n\t\t\t\t\t\t\t\t\treturn \"{\" + itemKeys.reduce( (tot, cur, curInd) => {\n\t\t\t\t\t\t\t\t\t\tvar isString = typeof(item[cur]) == \"string\";\n\t\t\t\t\t\t\t\t\t\treturn ((curInd > 0) ? tot + \", \" : \"\") + cur + \":\" + (isString ? \"\\\"\" : \"\") + item[cur] + (isString ? \"\\\"\" : \"\");\n\t\t\t\t\t\t\t\t\t}, \"\") + \"}\";\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tvar newManifestString = libsPropsObj.manifest.reduce( (newManTotal, newManCurrent, newManCurInd) => {\n\t\t\t\t\t\t\t\t\tvar manItemString = manItemToString(newManCurrent);\n\t\t\t\t\t\t\t\t\tif(!!manItemString)\n\t\t\t\t\t\t\t\t\t\treturn ( (newManCurInd > 0) ? newManTotal + \",\\n\" : \"\" ) + \"\\t\\t\" + manItemString;\n\t\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t\t}, \"\");\n\n\t\t\t\t\t\t\t\t// now get the full libProps string\n\t\t\t\t\t\t\t\tvar libPropsString = scriptText.substring(libPropertiesStartIndex, libPropertiesEndIndex+1);\n\n\t\t\t\t\t\t\t\t// replace the manigest with our new one\n\t\t\t\t\t\t\t\tif(!newManifestString)\n\t\t\t\t\t\t\t\t\tnewManifestString = \"\";\n\n\t\t\t\t\t\t\t\tvar newLibPropsString = libPropsString.replace(/\\b(manifest\\:\\s\\[)([\\s.\\S][^\\]]*)(\\])\\B/gm, \"$1\\n\" + newManifestString + \"\\n\\t$3\");\n\n\t\t\t\t\t\t\t\tvar newScriptText = (insertPre\n\t\t\t\t\t\t\t\t\t+ scriptText.substring(0, libPropertiesStartIndex)\n\t\t\t\t\t\t\t\t\t+ newLibPropsString\n\t\t\t\t\t\t\t\t\t+ scriptText.substring(libPropertiesEndIndex+1, scriptText.length)\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tvar par = scriptElem.parentNode;\n\t\t\t\t\t\t\t\t// var elmnt = dom.window.document.createElement(\"script\");\n\t\t\t\t\t\t\t\tvar elmnt = scriptElem.cloneNode();\n\n\t\t\t\t\t\t\t\tvar textnode = dom.window.document.createTextNode(newScriptText);\n\t\t\t\t\t\t\t\telmnt.appendChild(textnode);\n\t\t\t\t\t\t\t\tpar.replaceChild(elmnt, scriptElem);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch(err) {\n\t\t\t\t\t\t\tconsole.log(err);\n\t\t\t\t\t\t\treturn 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\treturn true;\n\t\t}", "function setupManifest(_xmlid) {\n\t\t\tmanifest = [{\n\t\t\t\tsrc: 'https://offers.seteventshowroom.com/xml/' + _xmlid + '.xml',\n\t\t\t\tid: \"myxml\"\n\t\t\t}];\n\t\t}", "function getClientBuildManifest() {\n if (self.__BUILD_MANIFEST) {\n return Promise.resolve(self.__BUILD_MANIFEST);\n }\n\n const onBuildManifest = new Promise(resolve => {\n // Mandatory because this is not concurrent safe:\n const cb = self.__BUILD_MANIFEST_CB;\n\n self.__BUILD_MANIFEST_CB = () => {\n resolve(self.__BUILD_MANIFEST);\n cb && cb();\n };\n });\n return resolvePromiseWithTimeout(onBuildManifest, MS_MAX_IDLE_DELAY, markAssetError(new Error('Failed to load client build manifest')));\n}", "function getClientBuildManifest() {\n if (self.__BUILD_MANIFEST) {\n return Promise.resolve(self.__BUILD_MANIFEST);\n }\n\n const onBuildManifest = new Promise(resolve => {\n // Mandatory because this is not concurrent safe:\n const cb = self.__BUILD_MANIFEST_CB;\n\n self.__BUILD_MANIFEST_CB = () => {\n resolve(self.__BUILD_MANIFEST);\n cb && cb();\n };\n });\n return resolvePromiseWithTimeout(onBuildManifest, MS_MAX_IDLE_DELAY, markAssetError(new Error('Failed to load client build manifest')));\n}", "function getClientBuildManifest() {\n if (self.__BUILD_MANIFEST) {\n return Promise.resolve(self.__BUILD_MANIFEST);\n }\n\n const onBuildManifest = new Promise(resolve => {\n // Mandatory because this is not concurrent safe:\n const cb = self.__BUILD_MANIFEST_CB;\n\n self.__BUILD_MANIFEST_CB = () => {\n resolve(self.__BUILD_MANIFEST);\n cb && cb();\n };\n });\n return resolvePromiseWithTimeout(onBuildManifest, MS_MAX_IDLE_DELAY, markAssetError(new Error('Failed to load client build manifest')));\n}", "createPackageFile() {\n // check if `package.json` file already exist\n if (!fs.existsSync(`${this.server}/package.json`)) {\n\n const file = path.join(__dirname, '../files/package.json');\n fs.readFile(file, \"utf-8\", (err, data) => {\n if (err) {\n console.error(err);\n return;\n }\n\n // write package.json file\n fs.writeFile(`${this.server}/package.json`, data, (err) => {\n if (err) {\n console.error('Error creating package.json file');\n return;\n }\n\n console.info(\"Successfully created package.json.\");\n });\n });\n\n return;\n }\n\n console.error(`package.json already exists`);\n }", "function addPackageJsonFiles() {\n const distPath = path.resolve(__dirname, '../dist');\n const esmPath = path.join(distPath, 'esm');\n\n const directories = [];\n const esmModulesDirectories = fs.readdirSync(esmPath);\n\n for (const file of esmModulesDirectories) {\n const fileStat = fs.statSync(path.join(esmPath, file));\n\n if (fileStat.isDirectory()) {\n directories.push(file);\n const content = {\n sideEffects: false,\n module: path.join('../esm', file, 'index.js'),\n };\n\n fs.writeFileSync(\n path.join(distPath, file, 'package.json'),\n JSON.stringify(content, null, 2),\n );\n }\n }\n}" ]
[ "0.71355593", "0.68693477", "0.6838236", "0.64548486", "0.6330793", "0.63183814", "0.6239282", "0.61496115", "0.6144178", "0.611945", "0.6096671", "0.60907567", "0.6086794", "0.6053947", "0.5905843", "0.58320963", "0.5776444", "0.5727883", "0.57065827", "0.5663672", "0.56286716", "0.5600683", "0.5574775", "0.557178", "0.55513185", "0.55305266", "0.55301267", "0.5506122", "0.5496596", "0.5430803", "0.54207826", "0.53640187", "0.53418404", "0.53404534", "0.532398", "0.5262814", "0.5261413", "0.52437246", "0.5217316", "0.52122736", "0.5208967", "0.5208967", "0.5198366", "0.51869434", "0.51689285", "0.51537645", "0.5105712", "0.5087771", "0.50815994", "0.5075848", "0.5069686", "0.5069313", "0.5064625", "0.5057186", "0.50443053", "0.50324214", "0.5026596", "0.49943078", "0.4963754", "0.4955144", "0.4907704", "0.48934716", "0.48916876", "0.48590887", "0.4855836", "0.48544908", "0.48276377", "0.48263052", "0.4826024", "0.48143706", "0.47838378", "0.47822762", "0.47773066", "0.47757122", "0.47662133", "0.4755845", "0.4744995", "0.4738494", "0.47283396", "0.47122836", "0.47013935", "0.47013935", "0.47013935", "0.47013935", "0.47013935", "0.47013935", "0.47013935", "0.47013935", "0.46934742", "0.46934742", "0.46934742", "0.46899915", "0.4684448", "0.46766758", "0.467383", "0.4668404", "0.4668404", "0.4668404", "0.46681243", "0.46660486" ]
0.687763
1
This page gets the code and saves the access token to local storage and updates the Redux state
function Login() { const query = useQuery() const history = useHistory() const store = useStore() const dispatch = useDispatch() useEffect(() => { // do not login twice const u = store.getState().user if (Object.keys(u).length) { return history.push('/') } // get access token const code = query.get('code') fetch_token(code) async function fetch_token(code) { const access_token_res = await get_token(code) let access_token = access_token_res.data localStorage.setItem('user', JSON.stringify(access_token)) dispatch(set_user(access_token)) history.push('/') } }) return ( <div className="loader"> <Loader type="TailSpin" color="#3b42bf" height={100} width={100} timeout={6000} /> </div> ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAccessToken() {\n /*\n *The access token is returned in the hash part of the document.location\n * #access_token=1234&response_type=token\n */\n\n const response = hash.replace(/^#/, '').split('&').reduce((result, pair) => {\n const keyValue = pair.split('=');\n result[keyValue[0]] = keyValue[1];\n return result;\n }, {});\n\n\n\n if (!localStorage.getItem(response.state)) {\n // We need to verify the random state we have set before starting the request,\n // otherwise this could be an access token belonging to someone else rather than our user\n document.getElementById('step-2').style.display = 'none';\n alert(\"CSRF Attack\");\n return;\n }\n\n if (response.access_token) {\n document.getElementById('step-1').style.display = 'none';\n } else {\n start();\n const error = document.createElement('p');\n error.innerHTML = response.error_description.split('+').join(' ');\n document.getElementById('step-1').appendChild(error);\n return;\n }\n\n localStorage.removeItem(response.state);\n\n // The token is removed from the URL\n document.location.hash = '';\n\n // The token is used to fetch the user's list of sites from the account API\n fetch('https://account-api.datocms.com/sites', {\n headers: {\n 'Authorization': 'Bearer ' + response.access_token,\n 'Accept': 'application/json',\n }\n }).then((response) => {\n return response.json();\n }).then((json) => {\n showOutput('Your sites: ' + json.data.map((site) => {\n const domain = site.attributes.domain || site.attributes.internal_domain;\n const url = `https://${domain}/`;\n const accessUrl = `${url}enter?access_token=${site.attributes.access_token}`;\n return `<a href=\"${accessUrl}\">${site.attributes.name}</a>`;\n }).join(', '));\n }).catch((error) => {\n showOutput(`Error fetching sites: ${error}`);\n });\n}", "async authenticate(code) {\n const tokenResponse = await fetch('https://accounts.spotify.com/api/token', {\n method: 'POST',\n headers: {\n 'Authorization': 'Basic ' + Buffer.from(clientId + ':' + clientSecret).toString('base64')\n },\n mode: 'cors',\n body: new URLSearchParams({\n 'code': code,\n 'redirect_uri': redirectUri,\n 'grant_type': 'authorization_code'\n }\n )\n });\n const tokens = await tokenResponse.json();\n const accessToken = tokens.access_token;\n const refreshToken = tokens.refresh_token;\n console.log(\"Authorization token retrieved: \" + accessToken);\n this.setTokens(accessToken, refreshToken);\n }", "function tokenRequest(code) {\n var tokenUrl = localStorage.getItem('base_url') + \"/login/oauth2/token\";\n var formData = \"grant_type=authorization_code\" +\n \"&client_id=\" + localStorage.getItem('client_id') +\n \"&client_secret=\" + localStorage.getItem('client_secret') +\n \"&redirect_uri=\" + localStorage.getItem('redirect_uri') +\n \"&code=\" + code;\n console.log(\"FormData: \" + formData);\n console.log(\"url: \" + tokenUrl);\n \n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", tokenUrl, true);\n xhr.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n xhr.onreadystatechange = function() {\n if (xhr.readyState === 4) {\n if (xhr.status === 200) {\n localStorage.setItem('access_token',JSON.parse(xhr.responseText).access_token);\n console.log(JSON.parse(xhr.responseText).access_token);\n } else {\n console.log(\"Error:\" + xhr.status);\n console.log(xhr.responseText);\n } \n }\n };\n xhr.send(formData);\n}", "_processTokenOrCode(_url) {\n\n var code = _url.split(\"code=\")[1].split(\"&\")[0]\n\n console.log(_url)\n\n fetch(\"https://github.com/login/oauth/access_token?\",\n {\n method: \"POST\",\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n \"client_id\": \"2d2838a445a8c0681c15\",\n \"client_secret\": \"39101055c1b37dea00f755943c860f7194fae944\",\n \"code\": code\n })\n })\n .then((response) => response.json())\n .then((responseData) => {\n console.log(responseData)\n\n // login to Firebase using the credential returned from GitHub\n this.props.fbRef.authWithOAuthToken(\"github\", responseData.access_token,\n function (error, authData) {\n if (error) {\n console.log(\"Login Failed!\", error);\n } else {\n console.log(\"Authenticated successfully with payload:\", authData);\n }\n });\n })\n // when don clear the url so the component can render the proper\n // login state UI\n .done(() => { this.setState({ url: null }) });\n }", "function login() {\n const kc = this;\n const state = uuid();\n const queryParams = getQueryParams();\n const qsCode = queryParams.code;\n const qsState = queryParams.state;\n\n // if we have no code or state in the URL\n // then we want to redirect to the KC login page.\n if (!qsCode) {\n kc.cache.purge();\n kc.cache.add('state', qsState || state);\n const url = buildOauthRedirectUrl(kc, qsState || state);\n if (kc.debug) {\n console.info('[SSI.KEYCLOAK] Redirecting to:', url);\n }\n window.location = url;\n return;\n }\n\n // If we do have a code and state in the URL\n // use them to get and process the token.\n let params = {\n grant_type: 'authorization_code',\n client_id: kc.clientId,\n redirect_uri: kc.redirectUri,\n code: qsCode\n };\n\n return getToken(kc, params, (err, tok) => {\n if (err) {\n console.error('[SSI.KEYCLOAK] Error getting token:', err);\n } else {\n kc.cache.add('token', tok);\n }\n // redirecting to a page without ?code or ?state.\n // token will be processed during the init, after\n // the redirect.\n window.location = kc.redirectUri;\n });\n }", "function handleSubmit(event) {\n event.preventDefault()\n\n //console.log(username);\n //console.log(password);\n const paramdict = {\n 'name': username,\n 'password': password\n }\n const config = {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(paramdict)\n }\n console.log(\"sending out:\");\n console.log(paramdict);\n\n //print(\"Signin.js: fetching from \" + `${process.env.REACT_APP_API_SERVICE_URL}/login`)\n // verify user/pwd, get encoded userid as access and refresh tokens in return\n //fetch(\"http://localhost:5000/login\", config)\n //fetch(`${process.env.REACT_APP_BE_NETWORK}:${process.env.REACT_APP_BE_PORT}/login`, config)\n //fetch(`${process.env.REACT_APP_API_SERVICE_URL}/login`, config)\n // fetch(\"http://aa1f1319b43a64c5388b2505b86edfe8-1002164639.us-east-1.elb.amazonaws.com:5000/login\", config)\n //fetch(\"http://localhost:5000/login\", config)\n fetch(`${process.env.REACT_APP_API_SERVICE_URL}:5000/login`, config)\n .then(response => response.json())\n .then(data => {\n\n // save to local storage\n console.log(\"received these keys in return:\")\n console.log(data);\n\n if (typeof Storage !== 'undefined') {\n try {\n localStorage.setItem(\"username\", username);\n // alert(username);\n } catch (ex) {\n console.log(ex);\n }\n } else {\n // No web storage Support :-(\n }\n\n console.log(data[0].access_token);\n console.log(data[0].refresh_token);\n console.log('---');\n saveAuthorisation({\n access: data[0].access_token,\n refresh: data[0].refresh_token,\n });\n\n // back to landing page!\n history.push(\"/\");\n })\n .catch( (err) => {\n alert(err);\n console.log(err);\n });\n }", "function tradeCodeForAccessToken() {\n return axios.post(`https://${process.env.REACT_APP_AUTH0_DOMAIN}/oauth/token`, payload).catch(error => {\n console.log('--- error getting access token ---', error); \n })\n }", "authLoadToken({ dispatch }) {\n const token = window.localStorage.getItem('auth_token');\n if (token) dispatch('authSetToken', token);\n }", "changeAccessToken(code) {\n reqwest({\n url: `http://${config.redirectUrl}/auth?code=${code}`,\n method: \"GET\",\n crossOrigin: true,\n type: \"json\"\n })\n .then(function(res) {\n global.location.search = null;\n AuthStore.login(res);\n // window.location = `${config.redirectUrl}`\n })\n .catch(err => {\n console.log(err);\n });\n }", "updateToken(state, newToken) {\n if(newToken.access){\n localStorage.setItem('accessToken', newToken.access);\n state.jwt_access = newToken.access;\n }\n if(newToken.refresh){\n localStorage.setItem('refreshToken', newToken.refresh);\n state.jwt_refresh = newToken.refresh;\n }\n }", "async function getAccessToken() {\n let response = await fetch('https://manc.hu/api/oauth/token', {\n method: 'post',\n mode: \"cors\",\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n },\n body: \"client_id=6nqtHYGpTc&client_secret=uv179ZWxI5rfIw6ilYGfA87TeAAAls5I&grant=client_credentials&scope=lexicon\"\n })\n //Store the key after request\n let key = await response.json();\n //Now do the request with the access token\n return key.access_token;\n}", "function exchangeCode() {\n return new Promise(function (resolve, reject) {\n // Return if there is already an access code, or no OAuth Code:\n if(accessToken || !oauthCode) {\n resolve();\n return;\n }\n\n pushLog(LogType.ACTION, \"Exchange Code\", \"Exchanging OAuth code for auth tokens.\");\n\n // Calculate redirect URI for current window:\n let redirectURI = window.location.origin + '/auth';\n\n // Request Payload:\n let payload = {\n code: oauthCode,\n client_id: clientId,\n client_secret: clientSecret,\n redirect_uri: redirectURI,\n grant_type: 'authorization_code'\n };\n\n // Create Http Request:\n let xhr = new XMLHttpRequest();\n xhr.open('POST', TOKEN_ENDPOINT);\n xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');\n\n // Http Response Callback:\n xhr.onload = function () {\n if(xhr.status === 200) { // HTTP OK Response\n // Log Http response:\n let responsePayload = \"* Payload: \\n\" + xhr.responseText;\n pushLog(LogType.HTTP, \"POST Response\", responsePayload);\n\n // Process tokens and sign in:\n let parsedResponse = JSON.parse(xhr.responseText);\n updateAccessToken(parsedResponse.access_token);\n updateRefreshToken(parsedResponse.refresh_token);\n updateSignedIn(true);\n resolve();\n\n } else { // HTTP Error Response\n pushError(LogType.HTTP, \"POST Response\", xhr.responseText);\n\n // Invalidate tokens and sign out:\n updateAccessToken(undefined);\n updateRefreshToken(undefined);\n updateSignedIn(false);\n resolve();\n }\n };\n\n // Log Http request:\n let requestEndpoint = \"* Endpoint: \\n\" + TOKEN_ENDPOINT;\n let requestPayload = \"* Payload: \\n\" + JSON.stringify(payload, null, 4);\n pushLog(LogType.HTTP, \"POST Request\", requestEndpoint + \"\\n\\n\" + requestPayload);\n\n // Send Http request:\n xhr.send(JSON.stringify(payload));\n });\n}", "function tradeCodeForAccessToken() {\n return axios.post(`https://${process.env.REACT_APP_AUTH0_DOMAIN}/oauth/token`, payload)\n }", "SAVE_TOKEN(state, token) {\n localStorage.setItem(\"auth-token\", token);\n }", "function uploadCode() {\n code = cm.getValue();\n localStorage.setItem(\"code\",code)\n worker.postMessage({code:code});\n codeUploaded = true;\n}", "retriveToken(context, data) {\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\taxios.post(\"/login\", data).then((res) => {\n\t\t\t\t\tconst token = res.data.access_token;\n\t\t\t\t\tlocalStorage.setItem('access_token', token);\n\t\t\t\t\tcontext.commit('RETIVE_TOKEN', token)\n\t\t\t\t\tresolve(res);\n\t\t\t\t})\n\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t});\n\t\t\t})\n\n\t\t}", "GetAccessToken() {\n return localStorage.getItem(\"access_token\");\n }", "async getNewAccessToken() {\n const tokenUrl = await this.getTokenUrl();\n const jwt = this.createJWT();\n\n console.log(tokenUrl);\n const tokenAuthUrl = `${tokenUrl}?scope=system/*.read&grant_type=client_credentials&client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&client_assertion=${jwt}`;\n const { data } = await axios.post(tokenAuthUrl);\n this.setState({ accessToken: data.access_token });\n return data.access_token;\n }", "token(value){ window.localStorage.setItem('token', value)}", "login(state, data) {\r\n state.token = data.token\r\n state.refreshToken = data.refreshToken\r\n state.user = data.user\r\n state.isAuth = true\r\n }", "function onPageLoad() {\n\n clientId = sessionStorage.getItem(\"client_id\");\n clientSec = sessionStorage.getItem(\"client_secret\");\n if (clientId === null || clientId == null || clientId.length < 32 || clientSec < 32) {\n document.getElementById(\"tokenSection\").style.display = 'block';\n } else if (window.location.search.length > 0) {\n handleRedirect();\n } else {\n access_token = sessionStorage.getItem(\"access_token\");\n if (access_token === null) {\n requestAuthorization()\n } else {\n refresh_token = sessionStorage.getItem(\"refresh_token\");\n sendTokens(access_token, refresh_token);\n // document.getElementById(\"songSelection\").style.display = 'block';\n // callSpotifyApi(\"GET\", PLAYBACKSTATE + \"?market=US\", null, handleCurrentlyPlayingResponse);\n }\n }\n}", "setToken (state, params) {\n // token 写入本地存储\n localStorage.token = params\n state.token = params\n }", "function handleResponse(data){\r\n if(data.authenticated){\r\n const token = data.accessToken;\r\n localStorage.setItem('accessToken', token);\r\n setTimeout(()=>{\r\n window.location='https://ciobotaruva.github.io/crud-movie-application.github.io/';\r\n }, 3000);\r\n };\r\n}", "getAccessToken() {\n if (this.accessToken) {\n localStorage.setItem('access_token', this.accessToken);\n return this.accessToken;\n } else if (window.location.href.match(/access_token=([^&]*)/)) {\n // If no authorization token already saved, this function tries to obtain token from URL.\n this.accessToken = window.location.href.match(/access_token=([^&]*)/)[1];\n // Sets the window timeout once the access token has been obtained.\n this.expiresIn = Number(\n window.location.href.match(/expires_in=([^&]*)/)[1]\n );\n window.setTimeout(() => (this.accessToken = null), this.expiresIn * 1000);\n console.log(`Access expires in ${this.expiresIn} seconds`);\n window.history.pushState('Access Token', null, '/');\n localStorage.setItem('access_token', this.accessToken);\n return this.accessToken;\n } else if (window.location.href.match(/error=access_denied/)) {\n window.history.pushState('Access Token', null, '/');\n this.redirectURI = window.location.href;\n }\n }", "static save(accessToken) {\n Authentication.accessToken = accessToken;\n }", "function storeJWT(data) {\n // Store Jwt locally\n localStorage.setItem('token', data.authToken);\n console.log('JWT in local storage: ' + localStorage.getItem('token'));\n retrievePage('/api/protected',\n {\n dataType: 'json',\n contentType: \"application/json\",\n beforeSend: function (request)\n {\n request.setRequestHeader(\"Authorization\", \"Bearer \" + localStorage.getItem('token'));\n },\n type: 'GET',\n success: window.location.href=\"/profile\",\n error: reportError\n }\n );\n}", "getAccessToken() {\r\n return this.store.getState().authenticationState.access_token;\r\n }", "function setToken(){\n var token = document.getElementById(\"token\").value;\n localStorage.setItem('token', token);\n}", "function fetchToken(code, callback) {\n\t//https request\n\taxios({\n\t\tmethod: 'post',\n\t\turl: TOKEN_URL,\n\t\theaders:{\n\t\t\t\"Authorization\": ENCODED_ID_SECRET,\n\t\t\t\"Content-Type\": CONTENT_TYPE\n\t\t},\n\t\tdata: querystring.stringify({\n\t\t\t\"grant_type\": GRANT_TYPE,\n\t\t\t\"redirect_uri\": REDIRECT_URI,\n\t\t\t\"code\":code\n\t\t})\n\t}).then(function(response){\n\t\tvar access_token = response.data['access_token'];\n\t\tcallback(null, access_token);\n\t}).catch(function(error){\n\t\t//pass error to async.waterfall\n\t\tcallback(error, null);\n\t});\n}", "function setToken({ access_token, refresh_token }) {\n localStorage.setItem('accessToken', access_token);\n localStorage.setItem('refreshToken', refresh_token);\n\n Http.defaults.headers.common['Authorization'] = `Bearer ${access_token}`;\n}", "componentDidMount() {\n // Set token\n let _token = hash.access_token;\n if (_token) {\n // Set token\n this.setState({\n token: _token\n });\n }\n }", "function storeAuth(data){\n\tAUTHORIZATION_CODE = data.authToken;\n\tlocalStorage.auth = data.authToken;\n\t$(\"#js-login-user-form\").unbind().submit();\n}", "handleSignin(login, password) {\n if(login.length == 0 || password.length < 8){\n //checking for the user length\n if(login.length == 0){\n this.setState({statusLog:\"danger\", captionLog: \"You need to enter your username\"})\n }\n //checking for the password length\n if(password.length < 8){\n this.setState({statusPass:\"danger\", captionPass: \"Password should at least contain 8 symbols\"})\n }}\n //checking the login\n else{\n authentification(login, password)\n .then(response => {\n \n if (response[\"success\"] === 0) {\n this.setState({statuspass:\"danger\", statusLog:\"danger\", captionPass: response[\"explanation\"] })\n\n }\n else {\n let token = response[\"data\"][\"access_tokens\"][0];\n this.setState({ token: token});\n \n this.context.handleToken(token)\n storeData({authToken: token, signIn: \"drawer\"},\"@storage_Key\")\n this.props.navigation.navigate(\"drawer\")\n }\n \n });\n }}", "constructor(props) {\n super(props);\n\n this.state = {\n // Store the tokens from the params. Replace is called to remove the string fields\n // and store only the code part\n aToken: this.props.match.params.atoken.replace('access_token=', ''),\n rToken: this.props.match.params.rtoken.replace('refresh_token=', ''),\n };\n }", "function getAccessToken(){\n return sessionStorage.getItem('accessToken');\n}", "load () {\n if (!this.initialized) {\n // wire dom events to service handlers\n $('#gh-new-personal-access-token-button').click(this.onOpenNewGhPersonalAccessTokenClick)\n $('#gh-sync-enabled').change(this.onGhSyncEnabledToggle)\n $('#gh-personal-access-token').change(this.onGhPersonalAccessTokenChange)\n $('#gh-api-endpoint').change(this.onGhApiEndpointChange)\n $('#gh-repository').change(this.onGhRepositoryChange)\n\n this.initialized = true\n }\n\n const {\n ghSyncEnabled,\n ghPersonalAccessToken,\n ghApiEndpoint,\n ghRepository\n } = this.getSettings()\n\n // load state\n $('#gh-personal-access-token').val(ghPersonalAccessToken)\n $('#gh-api-endpoint').val(ghApiEndpoint)\n $('#gh-repository').val(ghRepository)\n $('#gh-sync-enabled').prop('checked', ghSyncEnabled)\n $('#gh-sync-enabled-text').text(this.getGhSyncEnabledText())\n }", "function handleRedirect() {\n let code = getAuthCode();\n fetchAccessToken(code);\n window.history.pushState(\"\", \"\", redirectUri);\n}", "function fetchAccessToken(code) {\n let body = \"grant_type=authorization_code\";\n body += \"&code=\" + code;\n body += \"&redirect_uri=\" + encodeURI(redirectUri);\n body += \"&client_id=\" + clientId;\n body += \"&client_secret=\" + clientSec;\n callAuthorizationApi(body);\n}", "async function oauth(req, res, next) {\n\n let code = req.query.code;\n let token = `https://api.login.yahoo.com/oauth2/get_token`;\n // let remoteUserURL = ``;\n\n try {\n const access_token = await exchangeCodeForToken(code);\n }\n\n}", "function getNewTokens() {\n const fakeQuery = {\n state: state,\n code: //Enter your code here\n }\n\n reddit.oAuthTokens(\n state,\n fakeQuery,\n function (success) {\n // Print the access and refresh tokens we just retrieved\n console.log(reddit.access_token);\n console.log(reddit.refresh_token);\n }\n );\n}", "updateAccessToken() {\n const { keys, selectedKeyType } = this.state;\n let accessToken;\n\n if (keys.get(selectedKeyType)) {\n ({ accessToken } = keys.get(selectedKeyType).token);\n }\n this.setState({ accessToken });\n }", "updateAccessToken() {\n const { keys, selectedKeyType } = this.state;\n let accessToken;\n\n if (keys.get(selectedKeyType)) {\n ({ accessToken } = keys.get(selectedKeyType).token);\n }\n this.setState({ accessToken });\n }", "updateAccessToken(state, key) {\n state.access_token = key\n }", "getAccessToken() {\n //check if there is an accessToken defined, if so return it's value\n if (accessToken) {\n return accessToken;\n }\n //if not already set check the URL to see if it has just been obtained\n //window.location.href checks the current url and .match() with Regex to check for the token\n const accessTokenMatch = window.location.href.match(/access_token=([^&]*)/);\n //now use same object/method (different regex) to get the experation time\n const expiresInMatch = window.location.href.match(/expires_in=([^&]*)/);\n //now check if accessTokenMatch and expiresInMatch are in url\n if (accessTokenMatch && expiresInMatch) {\n //set the value of accessToken\n accessToken = accessTokenMatch[1];\n //make variable for the expiration time\n let expiresIn = Number(expiresInMatch[1]);\n //Clear the parameters so we can grab a new access token when it expires\n window.setTimeout(() => accessToken = '', expiresIn * 1000);\n window.history.pushState('Access Token', null, '/');\n return accessToken;\n //if you still don't have the accessToken redirect users with window.location\n } else {\n const accessUrl = `https://accounts.spotify.com/authorize?client_id=${clientId}&response_type=token&scope=playlist-modify-public&redirect_uri=${redirectUri}`\n window.location = accessUrl;\n }\n }", "getAccessToken() {\n this.accessToken = window.localStorage.getItem(this.accessTokenKey);\n return this.accessToken;\n }", "function handleFastSignIn() {\n\n const paramdict = getAuthorisation();\n const config = {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(paramdict)\n }\n\n //print(\"Signin.js: fetching from \" + `${process.env.REACT_APP_API_SERVICE_URL}/fastlogin`)\n // verify user/pwd, get encoded userid as access and refresh tokens in return\n //fetch(\"http://localhost:5000/fastlogin\", config)\n //fetch(`${process.env.REACT_APP_BE_NETWORK}:${process.env.REACT_APP_BE_PORT}/fastlogin`, config)\n //fetch(`${process.env.REACT_APP_API_SERVICE_URL}/fastlogin`, config)\n fetch(\"http://aa1f1319b43a64c5388b2505b86edfe8-1002164639.us-east-1.elb.amazonaws.com:5000/fastlogin\", config)\n //fetch(\"http://localhost:5000/fastlogin\", config)\n // fetch(`${process.env.REACT_APP_API_SERVICE_URL}/fastlogin`, config)\n .then(response => response.json())\n .then(data => {\n\n // save to local storage\n console.log(\"received these keys in return:\")\n console.log(data);\n saveAuthorisation({\n access: data[0][0],\n refresh: data[0][1],\n });\n\n // back to landing page!\n history.push(\"/\");\n })\n .catch( (err) => {\n alert(err);\n console.log(err);\n });\n }", "getAccessToken({ state }) {\n return state.accessToken;\n }", "refresh() {\n const token = JSON.parse(this.getToken())\n Http.setHeader(token)\n this.whoami()\n store.commit('LoggedUser/loggedIn') \n }", "async componentDidMount(){\n const searchStr = window.location.search\n const urlParams = queryString.parse(searchStr);\n if(urlParams.code)\n {\n const accessToken = await fbUtils.getAccessTokenFromCode(urlParams.code);\n if(accessToken){\n document.getElementById('my-login-card').innerHTML = this.uiComponent.accessTokenUI(accessToken);\n } else {\n document.getElementById('my-login-card').innerHTML = this.uiComponent.defaultErrorUI();\n }\n }\n\n }", "getToken(redirect_uri, code, res) {\n var that = this;\n\n //Parâmetros necessários para o request do access_token\n let postOptions = {\n url: config.instagram.url.access_token,\n form: {\n client_id: config.instagram.client_id,\n client_secret: config.instagram.client_secret,\n grant_type: config.instagram.grant_type,\n redirect_uri: redirect_uri,\n code: code\n }\n };\n\n request.post(postOptions, function(error, response, body){\n if(!error && response.statusCode == 200){\n if(body){\n let data = JSON.parse(response.body);\n that.saveToken(data.user.username, data.access_token, res);\n }\n } else {\n res.render('../src/views/index.ejs', {username: '', msgError: 'Erro ao requisitar o token do Instagram.'});\n }\n });\n }", "saveTokens(params) {\n const {access_token, refresh_token} = params;\n\n localStorage.setItem('access_token', access_token);\n localStorage.setItem('refresh_token', refresh_token);\n this.setState({ accessToken: access_token, refreshToken: refresh_token, error: null});\n\n // Automatically add access token\n var interceptor = axios.interceptors.request.use((config) => {\n config.headers = {'Authorization': 'Bearer '+ access_token};\n return config;\n });\n\n InterceptorUtil.setInterceptor(interceptor)\n }", "getAccessToken() {}", "storeNewTokenLink (code, teamId) {\n let credentials = this.getClientSecret()\n var clientSecret = credentials.installed.client_secret\n var clientId = credentials.installed.client_id\n var redirectUrl = credentials.installed.redirect_uris[0]\n var auth = new GoogleAuth()\n var oauth2Client = new auth.OAuth2(clientId, clientSecret, redirectUrl)\n oauth2Client.getToken(code, (err, token) => {\n if (err) {\n console.log('Error while trying to retrieve access token', err)\n return\n }\n\n let dbInput = {token: JSON.stringify(token), teamId}\n db.AuthToken.create(dbInput)\n })\n }", "getAccessToken() {\n // if token already saved\n if (accessToken) {\n return accessToken;\n }\n // if not saved, check if access token in URL of current page; Spotify example success response = https://example.com/callback#access_token=NwAExz...BV3O2Tk&token_type=Bearer&expires_in=3600&state=123\n const accessTokenMatch = window.location.href.match(/access_token=([^&]*)/); \n const expiresInMatch = window.location.href.match(/expires_in=([^&]*)/);\n if (accessTokenMatch && expiresInMatch) {\n accessToken = accessTokenMatch[1];\n const expiresIn = Number(expiresInMatch[1]);\n // clear access token param from URL so app doesn't get it after expiration\n window.setTimeout(() => accessToken = '', expiresIn * 1000);\n window.history.pushState('Access Token', null, '/');\n return accessToken;\n } else {\n // redirect user as per: https://developer.spotify.com/documentation/general/guides/authorization-guide/#implicit-grant-flow\n const baseURL = 'https://accounts.spotify.com/authorize?';\n const queryParams = `client_id=${clientId}&redirect_uri=${redirectURI}&scope=playlist-modify-public&response_type=token`;\n const accessURL = baseURL + queryParams;\n window.location = accessURL;\n }\n }", "async setAccessToken(accessToken) {\n /*console.log('set accessToken: ', accessToken);*/\n\n await AsyncStorage.setItem(\n `${this.namespace}:${storegeKey}`,\n JSON.stringify(accessToken),\n );\n }", "componentWillMount() {\n //get token save to state\n const url = window.location.href\n const token = /access_token=(.*)/g.exec(url)[1]\n this.setState({token: token })\n }", "function getToken() {\n var data = {\n grant_type: 'client_credentials',\n client_id: API_USER_ID,\n client_secret: API_SECRET\n }\n console.log(`sendpulse.js: Getting token for client_id: ${API_USER_ID}, client_secret: ${API_SECRET}`);\n sendRequest('oauth/access_token', 'POST', data, false, saveToken);\n function saveToken(data) {\n if (data.access_token) {\n TOKEN = data.access_token;\n console.log(`sendpulse.js: Token received: ${TOKEN}`);\n var hashName = md5(API_USER_ID + '::' + API_SECRET);\n fs.writeFileSync(path.join(TOKEN_STORAGE, hashName), TOKEN);\n } else {\n console.log(`sendpulse.js: No token received: ${JSON.stringify(data)}`)\n }\n }\n}", "function loginCode() {\r\n\r\n var code;\r\n\r\n // Save local storage\r\n code = document.getElementById(\"login\").value;\r\n code = localStorage.setItem(\"accessCode\", code);\r\n\r\n var access = localStorage.getItem(\"accessCode\");\r\n\r\n // Verify if input is as stated (\"625415\")\r\n if(access == 625415)\r\n {\r\n // Redirect to \"index.html\"\r\n document.getElementById(\"loginMessage\").innerHTML = (\"Logging in!\");\r\n location.href = \"teacher-create.html\"\r\n }\r\n\r\n // Display \"Wrong Code\" and do not redirect\r\n else\r\n {\r\n document.getElementById(\"loginMessage\").innerHTML = (\"That code is wrong! Please try again!\");\r\n }\r\n}", "async function login() {\n //autorization \n let response1 = await fetch(\"http://mumstudents.org/api/login\",\n {\n method: \"POST\",\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ \"username\": \"mwp\", \"password\": \"123\" })\n })\n data = await response1.json();\n document.getElementById(\"outlet\").innerHTML = animationTemplate\n getAnimation()\n //accesed token\n }", "[AUTH_MUTATIONS.SET_PAYLOAD](state, access_token) {\n state.access_token = access_token;\n }", "async function fetchAccessTokens (code) {\n console.log('code')\n const reqHeader = await axios.post(GITHUB_TOKEN_URL, qs.stringify({\n code,\n client_id: '8fcf3e5c2d3d5dd78188',\n redirect_uri: 'http://127.0.0.1:8000',\n grant_type: 'authorization_code',\n client_secret: '0e102c56021e1aa28005b469b3c83ef7cb7e5b0e',\n scope: ['user:email','read:user']\n }), {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Set-Cookie': 'dotcom_user',\n },\n })\n\n console.log('reqheaders', reqHeader.headers);\n\n\n\n\n const response = await axios.post(GITHUB_TOKEN_URL, qs.stringify({\n code,\n client_id: '8fcf3e5c2d3d5dd78188',\n redirect_uri: 'http://127.0.0.1:8000',\n grant_type: 'authorization_code',\n client_secret: '0e102c56021e1aa28005b469b3c83ef7cb7e5b0e',\n scope: ['user:email','read:user']\n }), {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Set-Cookie': 'dotcom_user',\n },\n })\n console.log('inside fetchgithub token', JSON.stringify(response));\n //return response.data?\n return response\n}", "manageVerificationCode(){\n fetch(SMS_VERIFICATION_DIRECTION, {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n },\n body:JSON.stringify({\n user:{\n smsCode:this.state.verification,\n phone:this.state.phone\n }\n })\n \n }).then((response) => response.json())\n .then((responseJson) => {\n AsyncStorage.setItem(\"token\",responseJson.token)\n console.log(responseJson)\n })\n .catch((error) => {\n console.log(error);\n });\n \n }", "async getAccessToken() {\n const token = await localforage.getItem('access_token')\n\n // if the token is null here we are logged out.\n if (token === null) return\n\n const then = new Date(token.date)\n const now = new Date()\n const eol = then.getTime() + (token.expires_in - 300) * 1000\n const ttl = eol - now.getTime()\n if (ttl > 0) {\n console.log(`Access token valid for ${Math.round(ttl / 1000)} seconds.`)\n return token.access_token\n }\n\n console.log('Access token stale.')\n\n const credentials = await localforage.getItem('credentials')\n const res = await fetch(urls.token, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n grant_type: 'client_credentials',\n client_id: credentials.userId,\n client_secret: credentials.secret,\n }),\n })\n\n if (res.status === 400) {\n throw new Error(`Invalid credentials ${res.status} ${res.statusText}`)\n }\n\n if (!res.ok) {\n throw new Error(`Invalid response: ${res.status} ${res.statusText}`)\n }\n\n const json = await res.json()\n // lets be a bit paranoid\n if (\n !json.hasOwnProperty('access_token') ||\n !json.hasOwnProperty('expires_in')\n ) {\n console.warn(json)\n throw new Error('Something is not right with the access_token Response.')\n }\n\n json.date = new Date()\n localforage.setItem('access_token', json)\n\n return json.access_token\n }", "setToken(value) {\n localStorage.setItem('token', value);\n }", "getAccessToken () {\n const accessToken = localStorage.getItem('access_token')\n if (!accessToken) {\n throw new Error('No access token found')\n }\n return accessToken\n }", "login(token, cb) {\n localStorage.setItem(\"safe-token\", token);\n cb();\n }", "function login() {\n const OKTA_clientId = '0oa6fm8j4G1xfrthd4h6';\n const redirectUri = window.location.origin;\n\n const config = {\n logo: '//logo.clearbit.com/cdc.gov',\n language: 'en',\n features: {\n registration: false, // Enable self-service registration flow\n rememberMe: false, // Setting to false will remove the checkbox to save username\n router: true, // Leave this set to true for the API demo\n },\n el: \"#okta-login-container\",\n baseUrl: `https://hhs-prime.okta.com`,\n clientId: `${OKTA_clientId}`,\n redirectUri: redirectUri,\n authParams: {\n issuer: `https://hhs-prime.okta.com/oauth2/default`\n }\n };\n\n new OktaSignIn(config)\n .showSignInToGetTokens({ scopes: ['openid', 'email', 'profile'] })\n .then(function (tokens) {\n const jwt = tokens.accessToken.value;\n window.sessionStorage.setItem('jwt', jwt);\n window.location.replace(`${window.location.origin}/daily-data/`);\n });\n}", "function fetchToken() {\n $.getJSON(buildTokenUrl(), {command: 'request'}, response => {\n token = response.token;\n console.log(`session token fetched: ${token}`);\n });\n}", "async getToken(payload) {\n const code = payload.authCode;\n try {\n await this.authManager.getToken(code);\n } catch (error) {\n console.log(error);\n return { success: false, error: error.toString() }\n }\n return {\n success: true,\n accessToken: this.authManager.accessToken,\n refreshToken: this.authManager.refreshToken\n }\n }", "getToken(code) {\r\n var params = new url.URLSearchParams();\r\n params.append('code', code);\r\n params.append('grant_type', 'authorization_code');\r\n params.append('client_id', this.clientId);\r\n var that = this;\r\n\r\n return fetch(this.getTokenRequestUrl(), {\r\n method: 'post',\r\n headers: {\r\n 'Authorization': 'Basic ' + this.basicToken\r\n },\r\n body: params\r\n }).then(data => data.json()).then(data => {\r\n that.token = {\r\n accessToken: data.access_token,\r\n refreshToken: data.refresh_token,\r\n expiresIn: data.expires_in,\r\n scope: data.scope\r\n };\r\n return that.token;\r\n }).catch((err) => {\r\n return err;\r\n });\r\n }", "function getToken(){\n return localStorage.getItem(\"token\");\n}", "async requestToken(authorizationCode, authorizationGrantHost) {\n \n // Post parameters.\n const params = new URLSearchParams();\n params.append('client_id', this.clientId);\n params.append('client_secret', this.clientSecret);\n params.append('grant_type', 'authorization_code');\n params.append('redirect_uri', `http://${authorizationGrantHost}/auth_grant`);\n params.append('vg', 'nl-NL'); // TODO: This should actually be macthing clientID/secret registration country.\n params.append('code', authorizationCode);\n // Redact client secret in log.\n console.log('Token request post params: '+params.toString().replace(/client_secret=.*&grant_type/, 'client_secret=****&grant_type'));\n\n const config = {\n headers: { \n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Accept': 'application/json;charset=utf-8',\n },\n };\n\n try {\n // Retrieve token.\n const response = await axios.post(TOKEN_REQUEST_URL, params, config);\n //console.log('Token request response: '+JSON.stringify(response.data)); // Cannot print. Contains sensitive data.\n this.pushEvent('token-status-changed', 'token_received');\n\n let tokenData = response.data;\n tokenData.creation_date = new Date();\n\n tokenStorage.setItem(TOKEN_STORAGE_NAME, tokenData);\n this.pushEvent('token-status-changed', 'token_stored');\n\n } catch(err) {\n console.error('Request token error: '+err.message);\n this.pushEvent('error', {message: err.message, title: 'Failed to request token'});\n } finally {\n if(this.mieleResponseTimeout) {\n clearTimeout(this.mieleResponseTimeout);\n }\n }\n }", "getAuthHeader() {\n return {\n Authorization: `Bearer ${localStorage.getItem('access_token')}`,\n };\n }", "fetchAccessToken (code, onSuccess, onError) {\n\n\t\tif (!code) {\n\t\t\tcode = this.extractOAuthCode();\n\t\t\tif (!code) {\n\t\t\t\tonError && onError();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tfetch(this.config.gatekeeperAccessTokenURL + code)\n\t\t.then(rsp => {\n\t\t\treturn rsp.json().then(j => {\n\t\t\t\tif (j.token) {\n\t\t\t\t\tthis.setToken(j.token);\n\t\t\t\t\tonSuccess && onSuccess(this.getToken());\n\t\t\t\t} else if (j.error) {\n\t\t\t\t\tonError && onError(j.error);\n\t\t\t\t}\n\n\t\t\t});\n\t\t});\n\n\t}", "UPDATE_USER_INFO (state, payload) {\n const userInfo = {\n token : payload.access_token,\n expiry : (new Date()).getTime() + payload.expires_in,\n user : payload.user\n }\n // Store data in localStorage\n localStorage.setItem('userInfo', JSON.stringify(userInfo))\n\n }", "function getAccessToken()\n{ \n let url = \"about:blank\"; \n chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) { \n\n url = tab.url;\n console.log(\"url: \" + url);\n let code = url.split(\"code=\")[1];\n console.log(code);\n\n $.ajax(\n {\n method: \"POST\",\n url: \"https://accounts.spotify.com/api/token\",\n headers: {'Content-Type':'application/x-www-form-urlencoded'},\n data: {\n \"grant_type\": \"authorization_code\",\n \"code\": code,\n \"redirect_uri\": \"https://maximilianklackl.github.io/YoutubeToSpotifyChromeExtension/downloaded.html\",\n \"client_secret\": Secrets.client_secret,\n \"client_id\": Secrets.client_id,\n },\n success: function(response) {\n console.log(response);\n let accessToken = response.access_token;\n let refreshToken = response.refresh_token;\n \n setTokensInStorge(accessToken, refreshToken);\n },\n error: function(err){\n console.log(err);\n }\n }\n );\n });\n}", "setAuth(state, userData) {\n state.authenticated = true\n localStorage.setItem('id_token', userData.id_token)\n if (userData.refresh_token) {\n localStorage.setItem('refresh', userData.refresh_token)\n }\n ApiService\n .setHeader(userData.id_token)\n }", "async function exchangeCode(code) {\n const oAuth2Client = new OAuth2Client(\n keys.installed.client_id,\n keys.installed.client_secret,\n keys.installed.redirect_uris[0]\n );\n\n const r = await oAuth2Client.getToken(code);\n console.info(r.tokens);\n return r.tokens;\n}", "getAccessToken() {\n if (accessToken) {\n return accessToken;\n }\n\n const accessTokenMatch = window.location.href.match(/access_token=([^&]*)/);\n const expiresInMatch = window.location.href.match(/expires_in=([^&]*)/);\n if (accessTokenMatch && expiresInMatch) {\n accessToken = accessTokenMatch[1];\n const expiresIn = Number(expiresInMatch[1]);\n window.setTimeout(() => accessToken = '', expiresIn * 1000);\n // Clears the parameters, allowing a new access token to be pulled when it expires.\n window.history.pushState('Access Token', null, '/');\n return accessToken;\n } else {\n const accessURI = `${accessURIBase}?client_id=${clientId}&response_type=token&scope=playlist-modify-public&redirect_uri=${redirectURI}`;\n window.location = accessURI;\n }\n }", "function fetchAuthToken() { \r\n _authToken();\r\n }", "onLoggedIn(authData) {\n this.props.setUser(authData.user);\n localStorage.setItem('token', authData.token);\n localStorage.setItem('user' , authData.user.Username);\n }", "function setToken(response) {\n var auth = {};\n auth.is_highest_role_level = false;\n auth.token = response.data['token'];\n auth.name = response.data['name'];\n auth.role_name = response.data['role_name'];\n auth.state = response.data['state'];\n auth.district = response.data['district'];\n auth.block = response.data['block'];\n auth.level = response.data['level_id'];\n auth.state_id = response.data['state_id'];\n auth.district_id = response.data['district_id'];\n auth.block_id = response.data['block_id'];\n\n auth.permissions = response.data['permissions'];\n auth.role = response.data[\"role\"];\n auth.warehouse = response.data[\"warehouse\"];\n auth.is_highest_role_level = response.data[\"is_highest_role_level\"];\n localStorage.setItem('authUser', JSON.stringify(auth));\n}", "verifyLogin() {\n const obj = getFromStorage('the_main_app');\n console.log(\"Obj.token from storage \" + obj.token)\n if (obj && obj.token) {\n fetch('/api/account/verify?token=' + obj.token)\n .then(res => res.json())\n .then(json => {\n if (json.success) {\n this.setState({\n token: obj.token,\n });\n }\n /*This is where everything needed for the page is loaded when a user \n session is found or not found, so this is the time to render something*/\n this.setState({ isAuthenticating: false })\n });\n }\n }", "function getAccessToken(ready) {\n var ret;\n\n if(typeof window.localStorage.access_token === 'undefined') {\n\n window.console.log('No access token stored!!!');\n\n var hash = window.location.hash;\n\n if(hash.length > 0) {\n if(hash.indexOf(ACC_T) === 1) {\n var end = hash.length;\n var expires = hash.indexOf('&');\n if(expires !== -1) {\n end = expires;\n }\n\n ret = hash.substring(ACC_T.length + 2,end);\n\n window.localStorage.access_token = ret;\n window.localStorage.expires = end * 1000;\n window.localStorage.token_ts = Date.now();\n\n window.console.log('Access Token %s. Expires: %s',ret,end);\n }\n } else {\n startOAuth();\n }\n }\n else {\n var timeEllapsed = Date.now() - window.localStorage.token_ts;\n\n if(timeEllapsed < window.localStorage.expires) {\n ret = window.localStorage.access_token;\n window.console.log('Reusing existing access token:',ret);\n }\n else {\n window.console.log('Access Token has expired');\n startOAuth();\n }\n }\n\n if(typeof ready === 'function' && typeof ret !== 'undefined') {\n ready(ret);\n }\n }", "async saveTokenToSecureStorage(token){\n SecureStore.setItemAsync(\"token\", token)\n this.setState({\n token: token\n })\n }", "render(){\n\t\tvar CLIENT_ID = \"e3fc4b772f51672f9b31\"\n\t\tvar REDIRECT_URI = \"http://localhost:3000/\"\n var STATE = \"fbdfuvue839984jd\"\n\treturn <div>\n<a\n href={`https://github.com/login/oauth/authorize?client_id=${CLIENT_ID}&scope=user&redirect_uri=${REDIRECT_URI}`}\n ><center>\n Login</center>\n </a>\n\t </div>\n\t}", "static set(access_token, dontUpdateStorage) {\n AccessToken._accessToken = access_token;\n\n return new Promise((resolve, reject) => {\n if (! dontUpdateStorage) {\n localStorage.setItem(Config.Storage.ACCESS_TOKEN, access_token);\n // cookie used to authenticate on server-side\n Utils.createCookie(Config.Storage.ACCESS_TOKEN, access_token, 365);\n }\n\n resolve(access_token);\n })\n }", "componentDidMount() {\n const token = localStorage.getItem(\"token\");\n this.setState({ token: token });\n console.log(\"token\", JSON.stringify(token));\n }", "async function gettoken() {\n\n const resp = await fetch(\"http://www.mumstudents.org/api/login\", {\n method: \"POST\",\n headers: { \"content-type\": \"application/json\" },\n body: JSON.stringify({\n username: 'mwp', password: '123'\n })\n })\n const respBody = await resp.json();\n console.log(respBody);\n token = respBody.token;\n\n myAnimantion();\n }", "function newToken(){\n spotifyApi.clientCredentialsGrant().then(\n function(data) {\n console.log('The access token expires in ' + data.body['expires_in']);\n // console.log('The access token is ' + data.body['access_token']);\n \n // Save the access token so that it's used in future calls\n spotifyApi.setAccessToken(data.body['access_token']);\n return data.body['access_token']\n },\n function(err) {\n console.log('Something went wrong when retrieving an access token', err);\n }\n );\n}", "function App() {\n\n // --------------------------\n // 1 - LOGIN HANDLING\n // --------------------------\n\n const initialLoginState = {\n isLoading: true,\n userToken: null,\n refreshToken: null,\n };\n\n // Login reducer function\n const loginReducer = (prevState, action) => {\n switch (action.type) {\n case 'RETRIEVE_TOKEN':\n // globalUserToken = action.token;\n return {\n ...prevState,\n isLoading: false,\n userToken: action.userToken,\n refreshToken: action.refreshToken,\n };\n case 'LOGIN':\n return {\n ...prevState,\n isLoading: false,\n userToken: action.userToken,\n refreshToken: action.refreshToken,\n };\n case 'LOGOUT':\n return {\n ...prevState,\n isLoading: false,\n userToken: null,\n refreshToken: null,\n };\n case 'REGISTER':\n return {\n ...prevState,\n isLoading: false,\n userToken: action.userToken,\n refreshToken: action.refreshToken,\n };\n }\n };\n\n\n const [loginState, dispatch] = React.useReducer(\n loginReducer,\n initialLoginState,\n );\n\n const authContext = React.useMemo(\n () => ({\n // Log In\n logIn: async user => {\n const userToken = String(user.userToken.token);\n const refreshToken = String(user.userToken.refreshToken);\n // console.log(\"token ===== \" + userToken);\n // Store the token in the local storage\n try \n {\n await AsyncStorage.setItem('userToken', userToken);\n await AsyncStorage.setItem('refreshToken', refreshToken);\n // Action\n dispatch({type: 'LOGIN', userToken: userToken, refreshToken: refreshToken});\n } \n catch (e) \n {\n console.log(e);\n }\n },\n\n // Sign Out\n signOut: async () => {\n // Delete the token from the local storage\n try \n {\n await AsyncStorage.removeItem('userToken');\n await AsyncStorage.removeItem('refreshToken');\n // Action\n dispatch({type: 'LOGOUT'});\n } \n catch (e) {\n console.log(e);\n }\n },\n \n // Sign Up\n signUp: () => {},\n // Toggle Theme\n // toggleTheme: () => {\n // setIsDarkTheme( isDarkTheme => !isDarkTheme );\n // }\n }),\n [],\n );\n\n\n useEffect(() => {\n setTimeout(async () => {\n // setIsLoading(false);\n let userToken = null;\n let refreshToken = null;\n try \n {\n userToken = await AsyncStorage.getItem('userToken');\n refreshToken = await AsyncStorage.getItem('refreshToken');\n // globalUserToken = userToken;\n dispatch({type: 'RETRIEVE_TOKEN', userToken: userToken, refreshToken: refreshToken});\n } \n catch (e) \n {\n console.log(e);\n }\n }, 1000);\n });\n\n\n\n\n if (loginState.isLoading) {\n return (\n <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>\n <ActivityIndicator size=\"large\" />\n </View>\n );\n }\n\n // Set the userToken global variable to be used in all screens\n global.userTokenConst = loginState.userToken;\n global.refreshTokenConst = loginState.refreshToken;\n\n\n\n\n return (\n //Navigation container is responsible for controlling the themes, states, restoring states\n <AuthContext.Provider value={authContext}>\n <NavigationContainer>\n {/*Check if user is logged in */}\n \n {loginState.userToken !== null ? (\n <MainStackScreen/>\n ) : (\n <AuthenticationStackScreen />\n )}\n </NavigationContainer>\n </AuthContext.Provider>\n );\n\n\n // return (\n // <AuthContext.Provider value={authContext}>\n // <NavigationContainer>\n // <MainStackScreen/>\n // </NavigationContainer>\n // </AuthContext.Provider>\n // );\n}", "accessTokenUI(accessToken){\n return `<p style='font-size: 14px;'>My access token: ${accessToken}</p>`\n }", "getAccessToken() {\n if(accessToken)\n return accessToken;\n else if(window.location.href.match(/access_token=([^&]*)/) && window.location.href.match(/expires_in=([^&]*)/))\n {\n accessToken = window.location.href.match(/access_token=([^&]*)/)[1];\n expiresIn = window.location.href.match(/expires_in=([^&]*)/)[1];\n \n window.setTimeout(() => accessToken = '', expiresIn*1000);\n window.history.pushState('Access Token', null, '/');\n \n return accessToken;\n }\n else\n {\n let url = `https://accounts.spotify.com/authorize?client_id=${clientID}&response_type=token&scope=playlist-modify-public&redirect_uri=${redirectURI}`;\n window.location = url;\n }\n }", "handleLoginClick() {\n const { store } = this.props;\n\n const data = { cpf: this.cpf1.value, password: this.pwd1.value };\n console.log(data);\n\n // Chama a api de clientes\n fetch('http://mc437.ddns.net:5000/client/auth', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(data)\n }).then(response => response.json()).then((data) => {\n console.log(data);\n if (data.error_code) {\n store.snackbar = { active: true, message: 'Usuario não cadastrado ou senha invalida ' + data.error_code, success: false };\n\n } else {\n store.userinfo = {logged: true, user_id: data.payload.id, token: data.payload.token}\n\n console.log(store.userinfo)\n\n // Segundo fetch pra pegar os dados do usuario\n fetch('http://mc437.ddns.net:5000/client/' + store.userinfo.user_id, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n 'x-access-token': store.userinfo.token\n }\n }).then(response => response.json()).then((data) => {\n store.userinfo.name = data.payload.name;\n store.userinfo.phone = data.payload.phone;\n store.userinfo.cpf = data.payload.cpf;\n store.userinfo.phone = data.payload.phone;\n\n });\n\n // Volta pra home\n store.snackbar = { active: true, message: 'Bem vindo (: ', success: true };\n this.props.history.push('/');\n }\n });\n\n }", "async function getToken(){\n var api = await spotifyApi.clientCredentialsGrant();\n spotifyApi.setAccessToken(api.body['access_token']);\n console.log('The access token expires in ' + api.body['expires_in']);\n console.log('The access token is ' + api.body['access_token']);\n}", "function getNewToken(oAuth2Client, callback) {\n\tconst authUrl = oAuth2Client.generateAuthUrl({\n\t\taccess_type: \"offline\",\n\t\tscope: SCOPES,\n\t});\n\tconsole.log(\"Authorize this app by visiting this url:\", authUrl);\n\tconst rl = readline.createInterface({\n\t\tinput: process.stdin,\n\t\toutput: process.stdout,\n\t});\n\trl.question(\"Enter the code from that page here: \", (code) => {\n\t\trl.close();\n\t\toAuth2Client.getToken(code, (err, token) => {\n\t\t\tif (err) return console.error(\"Error retrieving access token\", err);\n\t\t\toAuth2Client.setCredentials(token);\n\t\t\t// Store the token to disk for later program executions\n\t\t\tfs.writeFile(TOKEN_PATH, JSON.stringify(token), (err) => {\n\t\t\t\tif (err) return console.error(err);\n\t\t\t\tconsole.log(\"Token stored to\", TOKEN_PATH);\n\t\t\t});\n\t\t\tcallback(oAuth2Client);\n\t\t});\n\t});\n}", "onLocalLogin() {\n let accessToken = localStorage.getItem('access_token');\n let refreshToken = localStorage.getItem('refresh_token');\n let user = JSON.parse(localStorage.getItem('user'));\n\n if (accessToken && refreshToken && user) {\n this.saveTokens({access_token: accessToken, refresh_token: refreshToken});\n this.loginSuccess(user, true);\n }\n }", "async function login() {\n const uid = document.getElementById('usernameLogin').value;\n const pwd = document.getElementById('passwordLogin').value;\n\n const response = await fetch('api/auth/login?uid=' + uid + '&pwd=' +pwd);\n token = await response.text();\n toggleView(\"ads\");\n\n}", "componentDidMount() {\r\n fetch('http://localhost:5000/checkToken', {\r\n method: 'POST',\r\n body: JSON.stringify({ token: localStorage.getItem('token') }), // The AUTHORISATION relies on token to be transferred across pages. This parses the TOKEN through the body of the browser to be read elsewhere. This is an alternative to using cookies.\r\n headers: {\r\n 'Content-Type': 'application/json'\r\n }\r\n })\r\n .then(res => res.text()) // The expected response is a 200 or 'OK', it is not json, it is just raw text and res.json() is not needed in order to parse it through the rest of the code\r\n .then(res => {\r\n if (res === 'OK') {\r\n this.setState({ loading: false }); // If the res is 200, we change the LOADING value to false and allow the page to be rendered\r\n } else {\r\n const error = new Error(res.error);\r\n throw error;\r\n }\r\n })\r\n .catch(err => {\r\n console.error(err);\r\n this.setState({ loading: false, redirect: true }); // If the user is not authorised, they are redirected to the login page by setting the REDIRECT value to true\r\n });\r\n }", "function getToken(){\n var token = localStorage.getItem('token', token);\n if (token != ''){\n document.getElementById(\"token\").value = token;\n }\n return token;\n}" ]
[ "0.6530216", "0.6521224", "0.6401203", "0.62646776", "0.62597233", "0.6186736", "0.61462903", "0.6140405", "0.6137285", "0.6071918", "0.6046987", "0.60310996", "0.6028939", "0.6028723", "0.5999013", "0.59963614", "0.59857714", "0.5967867", "0.59616613", "0.59514266", "0.593108", "0.58915836", "0.58882296", "0.5866731", "0.58576113", "0.5851664", "0.5839923", "0.5830324", "0.5813974", "0.5803712", "0.5799629", "0.5794642", "0.57904154", "0.57827795", "0.5773516", "0.5772909", "0.5769683", "0.5762337", "0.5759978", "0.57595885", "0.5755691", "0.5755691", "0.5747832", "0.57398087", "0.5734217", "0.5730923", "0.5728844", "0.57260185", "0.5724537", "0.5720471", "0.5710254", "0.5696761", "0.56929237", "0.5687085", "0.56781083", "0.56764466", "0.5676299", "0.5673415", "0.56670314", "0.5648028", "0.56460834", "0.5642991", "0.5639639", "0.5629374", "0.5627499", "0.5622214", "0.5619621", "0.5610264", "0.5609892", "0.5599571", "0.55993503", "0.5593001", "0.5585895", "0.5585136", "0.5580094", "0.5577406", "0.5576019", "0.5569773", "0.556916", "0.5567932", "0.55667025", "0.55624366", "0.5556017", "0.5553509", "0.5548845", "0.5543359", "0.55427116", "0.5535938", "0.5527564", "0.5526206", "0.5524282", "0.5523458", "0.5522625", "0.5522057", "0.5519479", "0.5514702", "0.55133575", "0.5510743", "0.55090135", "0.5506519" ]
0.61889124
5
output swf object,return string
function swf(w,h,p){ var pm=$.extend({path:'',wmode:'opaque',quality:'high'},p||{}),rswf; if($.browser.msie){ rswf='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cabversion=6,0,0,0" width="' + w + '" height="' + h + '">\n'; for(var i in pm){ if(i=='path'){ rswf+='<param name="movie" value="'+pm[i]+'">'; }else{ rswf+='<param name="'+ i +'" value="'+pm[i]+'">'; } } return rswf + '</object>'; }else{ rswf='<embed width="' + w + '" height="' + h +'"'; for(var i in pm){ if(i=='path'){ rswf+=' src="'+pm[i]+'"'; }else{ rswf+=' '+ i +'="'+pm[i]+'"'; } } return rswf + ' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function WriteFlash(txtObject)\r\n{\r\n document.write(txtObject);\r\n}", "function WriteSwfObject(strSwfFile, nWidth, nHeight, strScale, strAlign, strQuality, strBgColor, bCaptureRC, strWMode, strFlashVars, targetElement, bFillWindow)\n{\n\tvar strHtml = \"\";\n\tvar strWidth = nWidth + \"px\";\n\tvar strHeight = nHeight + \"px\";\n\tvar strPublishSize = \"&vPublishWidth=\" + nWidth + \"&vPublishHeight=\" + nHeight;\n\tg_oInterfaceObject = getInterfaceObject(strFlashVars);\n\n\tif (g_strResizeType === \"fit\")\n\t{\n\t\tstrWidth = \"100%\";\n\t\tstrHeight = \"100%\";\n\t}\n\n\t// If there are flashvars defined append a delimitor\n\tif (strFlashVars != \"\")\n\t{\n\t\tstrFlashVars += \"&\";\n\t}\n\n\tstrFlashVars += \"vHtmlContainer=true\";\n\tstrFlashVars += \"&TinCan=\" + (g_bTinCan ? \"true\" : \"false\");\n\tstrFlashVars += \"&vRise=\" + (g_oInterfaceObject.isRise ? \"true\" : \"false\");\n\n\tif (navigator.userAgent.toLowerCase().indexOf(\"chrome\") >= 0 && strWMode != \"transparent\")\n\t{\n\t\tstrWMode = \"opaque\";\n\t}\n\tif (bCaptureRC && strWMode == \"window\")\n\t{\n\t\tstrFlashVars += \"&vCaptureRC=true\";\n\t\tif(strWMode != \"transparent\")\n\t\t{\n\t\t\tstrWMode = \"opaque\";\n\t\t}\n\t}\n\n\tif (g_strQuery.indexOf(\"artcommid\") >= 0 && strWMode == \"window\")\n\t{\n\t\tstrWMode = \"opaque\";\n\t}\n\n\t// Whether or not we are loaded by an LMS\n\tstrFlashVars += \"&vLMSPresent=\" + g_bLMSPresent;\n\n\t// Whether or not we are loaded by AO\n\tstrFlashVars += \"&vAOSupport=\" + g_bAOSupport;\n\n\t// Set the publish width and height\n\tstrFlashVars += strPublishSize;\n\n\t// Set the theme info\n\tstrFlashVars += \"&vThemeName=\" + g_strThemeName;\n\tstrFlashVars += \"&vPreloaderColor=\" + g_strPreloaderColor;\n\n\t// Set the LMS Resume data\n\tif (g_bLMSPresent)\n\t{\n\t\tRetrieveStateData();\n\n\t\tstrFlashVars += \"&vResumeData=\" + encodeURI(g_strResumeData);\n\t}\n\n\tstrFlashVars += GetHostVars();\n\n\tvar strLocProtocol = location.protocol;\n\n\tif (strLocProtocol.indexOf(\"file\") >= 0)\n\t{\n\t\tstrLocProtocol = \"http:\";\n\t}\n\n\tvar strRole = \"\";\n\n\tif (gtIEWin7)\n\t{\n\t\tstrRole = \" role='application'\";\n\t}\n\n\t// create the swf div\n\tvar divSwf = document.createElement(\"div\");\n\tdivSwf.setAttribute(\"role\", \"application\");\n\tdivSwf.setAttribute(\"id\", \"divSwf\");\n\tdivSwf.style.width = strWidth;\n\tdivSwf.style.height = strHeight;\n\n\tif (!targetElement)\n\t{\n\t\tdocument.body.appendChild(divSwf);\n\t\tg_bFillWindow = true;\n\t}\n\telse\n\t{\n\t\tg_bFillWindow = bFillWindow\n\t\tg_bElement = true;\n\t\tg_oContainer = targetElement;\n\t\ttargetElement.appendChild(divSwf);\n\t}\n\n\t// Get the swf dims\n\tif (isChrome && bFillWindow && g_strResizeType === \"fit\" && strScale === \"noscale\") {\n\t\tstrWidth = divSwf.clientWidth + \"px\";\n\t\tstrHeight = divSwf.clientHeight + \"px\";\n\t\tInitResizeListeners();\n\t}\n\n\tstrHtml += \"<object type='application/x-shockwave-flash' data='\" + strSwfFile +\"' width='\" + strWidth + \"' height='\" + strHeight + \"' align='\" + strAlign + \"' id='player'>\";\n\tstrHtml += \"<param name='scale' value='\" + strScale + \"' />\";\n\tstrHtml += \"<param name='movie' value='\" + strSwfFile + \"' />\";\n\tstrHtml += \"<param name='quality' value='\" + strQuality + \"' />\";\n\tstrHtml += \"<param name='name' value='player' />\";\n\tstrHtml += \"<param name='allowFullScreen' value='true' />\";\n\tstrHtml += \"<param name='bgcolor' value='\" + strBgColor + \"' />\";\n\tstrHtml += \"<param name='flashvars' value='\" + strFlashVars + \"' />\";\n\tstrHtml += \"<param name='wmode' value='\" + strWMode + \"'/>\";\n\tstrHtml += \"<param name='allowScriptAccess' value='always'>\";\n\tstrHtml += \"</object>\";\n\n\tdivSwf.innerHTML = strHtml;\n\n\tif (bCaptureRC)\n\t{\n\t\tAddRightClickListener();\n\t}\n\n\tsetTimeout(SetPlayerFocus, 500);\n\n\tdocument.addEventListener(\"visibilitychange\", UpdateVisibility);\n}", "function sw(args) {\n\n // Shift\n var self = this;\n\n // Prepare\n var h = args.h;\n var p = args.p;\n var v = args.v;\n var w = args.w;\n\n // Mission\n var codebase = \"http://fpdownload.macromedia.com\";\n codebase += \"/pub/shockwave/cabs/flash\";\n codebase += \"/swflash.cab#version=9,0,0,0\";\n\n var embed = {\n align : \"middle\",\n allowFullScreen : \"true\",\n allowScriptAccess : \"always\",\n bgcolor : \"#000000\",\n FlashVars : v,\n height : h,\n name : \"player\",\n pluginspage : \"http://www.macromedia.com/go/getflashplayer\",\n quality : \"high\",\n scale : \"noscale\",\n src : p,\n type : \"application/x-shockwave-flash\",\n width : w\n };\n\n var param = {\n allowFullScreen : \"true\",\n allowScriptAccess : \"always\",\n bgcolor : \"#000000\",\n FlashVars : v,\n movie : p,\n quality : \"high\",\n scale : \"noscale\"\n };\n\n var object = {\n align : \"middle\",\n classid : \"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\",\n codebase : codebase,\n height : h,\n id : \"player\",\n width : w\n };\n\n document.write('<object id=\"zp\"');\n\n for (var name in object) {\n document.write(' ');\n document.write(name);\n document.write('=\"');\n document.write(object[name]);\n document.write('\"');\n }\n\n document.write('>');\n\n for (var name in param) {\n document.write('<param name=\"');\n document.write(name);\n document.write('\" value=\"');\n document.write(param[name]);\n document.write('\" />');\n }\n\n document.write('<embed name=\"zp\"');\n\n for (var name in embed) {\n document.write(' ');\n document.write(name);\n document.write('=\"');\n document.write(embed[name]);\n document.write('\"');\n }\n\n document.write(' />');\n document.write('</object>');\n}", "function fscommandMovie(){\n\tdocument.write(\"<object classid=\\\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\\\" codebase=\\\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\\\" id=\\\"laxChalkboardDesign\\\" width=\\\"577\\\" height=\\\"450\\\" align=\\\"middle\\\">\");\n\tdocument.write(\"<param name=\\\"allowScriptAccess\\\" value=\\\"sameDomain\\\" />\");\n\tdocument.write(\"<param name=\\\"movie\\\" value=\\\"movies/laxChalkboardDesign2.swf\\\" />\");\n\tdocument.write(\"<param name=\\\"loop\\\" value=\\\"false\\\" />\");\n\tdocument.write(\"<param name=\\\"quality\\\" value=\\\"high\\\" />\");\n\tdocument.write(\"<param name=\\\"bgcolor\\\" value=\\\"#ffffff\\\" />\");\n\tdocument.write(\"<embed src=\\\"movies/laxChalkboardDesign2.swf\\\" loop=\\\"false\\\" quality=\\\"high\\\" bgcolor=\\\"#ffffff\\\" width=\\\"577\\\" height=\\\"450\\\" swLiveConnect=true id=\\\"laxChalkboardDesign\\\" name=\\\"laxChalkboardDesign\\\" align=\\\"middle\\\" allowScriptAccess=\\\"sameDomain\\\" type=\\\"application/x-shockwave-flash\\\" pluginspage=\\\"http://www.macromedia.com/go/getflashplayer\\\" />\");\n\tdocument.write(\"</object>\");\n}", "function view_flash(url,width,height,t)\n{\n\tdocument.write(\"<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='\" + width + \"' height='\" + height + \"'>\");\n\tdocument.write(\"<param name='movie' value='\" + url + \"'>\");\n\tdocument.write(\"<param name='wmode' value='\" + t + \"'>\");\n\tdocument.write(\"<param name='quality' value='high'>\");\n\tdocument.write(\"<param name='allowScriptAccess' value='always'>\");\n\tdocument.write(\"<embed src='\" + url + \"' quality='high' allowScriptAccess='always' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='\" + width + \"' height='\" + height + \"' Wmode='\"+t+\"'></embed></object>\");\n}", "function getavatar(avatar){\n if( avatar.indexOf('.swf',0)!=-1) {\n document.write('<object width=\"48\" height=\"60\" name=\"movie\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" class=\"headeravaflash\">'\n + '<param name=movie value=' + avatar + '>'\n + '<param name=quality value=high>'\n + '<embed src=' + avatar + ' quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" class=\"headeravaflash\">'\n + '</embed></object>');\n }\n else {\n document.write('<img src=\"' + avatar + '\" width=\"48\" />');\n }\n}", "function getavatarsmall(avatar){\n if( avatar.indexOf('.swf',0)!=-1) {\n document.write('<object name=\"movie\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" class=\"headeravaflash\">'\n + '<param name=movie value=' + avatar + '>'\n + '<param name=quality value=high>'\n + '<embed src=' + avatar + ' quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" class=\"headeravaflash\">'\n + '</embed></object>');\n }\n else\t{\n document.write('<img src=\"' + avatar + '\" />');\n }\n}", "function dwSwf(_sName, _sSrc, _sWidth, _sHeight, _sMode, _aValue) {\n var sValue = '';\n var aFlashVars = [];\n if (_aValue) {\n for (var key in _aValue) {\n aFlashVars[aFlashVars.length] = key + \"=\" + _aValue[key];\n }\n sValue = aFlashVars.join('&');\n }\n _sMode = _sMode ? 'wmode=\"transparent\"' : '';\n if(_sName == \"calendar\" || _sName ==\"musicFlash2\" ){\n\n\treturn '<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width=\"' + _sWidth + '\" height=\"' + _sHeight + '\" id=\"' + _sName + '\" align=\"middle\" ><param name=\"movie\" value=\"' + _sSrc + '?' + sValue + '\" /><param name=allowScriptAccess value=always><param name=wmode value=transparent><embed name=\"' + _sName + '\" src=\"' + _sSrc + '\" ' + _sMode + ' quality=\"high\" align=\"top\" salign=\"lt\" allowScriptAccess=\"always\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"' + _sWidth + '\" height=\"' + _sHeight + '\" flashVars=\"' + sValue + '\" \\/><\\/object>';\n }else{\n\treturn '<embed id=\"' + _sName + '\" name=\"' + _sName + '\" src=\"' + _sSrc + '\" ' + _sMode + ' quality=\"high\" align=\"top\" salign=\"lt\" allowScriptAccess=\"always\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"' + _sWidth + '\" height=\"' + _sHeight + '\" flashVars=\"' + sValue + '\" \\/>';\n }\n}", "function _swf(uri, _, uid) {\n if (init) {\n return;\n }\n init = true;\n var o = '<object id=\"' + ID +\n '\" type=\"application/x-shockwave-flash\" data=\"' +\n uri + '\" width=\"0\" height=\"0\">' +\n '<param name=\"movie\" value=\"' +\n uri + '\" />' +\n '<param name=\"FlashVars\" value=\"yid=' +\n _ + '&uid=' +\n uid +\n '&host=KISSY.IO\" />' +\n '<param name=\"allowScriptAccess\" value=\"always\" />' +\n '</object>',\n c = doc.createElement('div');\n Dom.prepend(c, doc.body || doc.documentElement);\n c.innerHTML = o;\n }", "function printFlash(id, src, wmode, menu, bgcolor, width, height, quality, base, flashvars, noflash){\r\n \r\n if(MM_FlashCanPlay){\r\n \r\n flashString = '<object id= \"' + id + 'Flash\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"' + width + '\" height=\"' + height + '\"><param name=\"movie\" value=\"' + src + '\"></param><param name=\"quality\" value=\"' + quality + '\"></param>';\r\n if(base){\r\n flashString+='<param name=\"base\" value=\"' + base + '\"/>';\r\n }\r\n \r\n flashString+='<param name=\"flashvars\" value=\"' + flashvars + '\" ></param><param name=\"bgcolor\" value=\"' + bgcolor + '\" ></param><param name=\"menu\" value=\"' + menu + '\" ></param><param name=\"wmode\" value=\"' + wmode + '\" ></param><param name=\"salign\" value=\"tl\" ></param><embed name= \"' + id + 'Flash\" src=\"' + src + '\" wmode=\"' + wmode + '\" menu=\"' + menu + '\" bgcolor=\"' + bgcolor + '\" width=\"' + width + '\" height=\"' + height + '\" quality=\"' + quality + '\" pluginspage=\"http://www.macromedia.com/go/getflas/new-hplayer\" type=\"application/x-shockwave-flash\" salign=\"tl\" base=\"' + base + '\" flashvars=\"' + flashvars + '\" /></object>';\r\n \r\n }else{\r\n \r\n flashString=noflash;\r\n\r\n }\r\n \r\n if(id==\"loader\" && !is_moz)\r\n flashString=noflash;\r\n document.getElementById(id).innerHTML = flashString;\r\n document.getElementById(id).style.display=\"block\";\r\n \r\n}", "function viewFlash(src, w, h, loop, play)\n{\n var width = parseInt(w);\n var height = parseInt(h);\n\n//alert('adWidth = '+width+ '\\n Height = '+height);\n\n eval(\"win = window.open('','Flash', 'toolbar=0,scrollbars=0,location=0,status=0,resizable=1,menubar=0,width=\"+width+\",height=\"+height+\"');\");\n win.document.writeln('<html>');\n win.document.writeln('<head><title>' + ICtxgopub.pe_txt10 +'</title></head>');\n win.document.writeln('<body>');\n\n // for IE users use <object> tag\n objectTag = '<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"../download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0/#version=5,0,0,0/default.htm\"';\n win.document.write(objectTag);\n win.document.write(' width=\"'+width+'\"');\n win.document.writeln(' height=\"'+height+'\">');\n win.document.writeln('<param name=\"movie\" value=\"'+src+'\">');\n win.document.writeln('<param name=\"loop\" value=\"'+loop+'\">');\n win.document.writeln('<param name=\"play\" value=\"'+play+'\">');\n\n // for Netscape users use <embed> tag\n win.document.writeln('<embed src=\"'+src+'\" loop=\"'+loop+'\" play=\"'+play+'\" width=\"'+width+'\" height=\"'+height+'\" type=\"application/x-shockwave-flash\" pluginspage=\"../www.macromedia.com/shockwave/download/index.cgi@P1_Prod_Version=ShockwaveFlash\" />'); \n win.document.writeln('</object>');\n win.document.writeln('</body></html>');\n\n}", "function createSWF(attObj, parObj, id) {\n var r, el = getElementById(id);\n if (ua.wk && ua.wk < 312) { return r; }\n if (el) {\n if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content\n attObj.id = id;\n }\n if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML\n var att = \"\";\n for (var i in attObj) {\n if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries\n if (i.toLowerCase() == \"data\") {\n parObj.movie = attObj[i];\n }\n else if (i.toLowerCase() == \"styleclass\") { // 'class' is an ECMA4 reserved keyword\n att += ' class=\"' + attObj[i] + '\"';\n }\n else if (i.toLowerCase() != \"classid\") {\n att += ' ' + i + '=\"' + attObj[i] + '\"';\n }\n }\n }\n var par = \"\";\n for (var j in parObj) {\n if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries\n par += '<param name=\"' + j + '\" value=\"' + parObj[j] + '\" />';\n }\n }\n el.outerHTML = '<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"' + att + '>' + par + '</object>';\n objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)\n r = getElementById(attObj.id); \n }\n else { // well-behaving browsers\n var o = createElement(OBJECT);\n o.setAttribute(\"type\", FLASH_MIME_TYPE);\n for (var m in attObj) {\n if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries\n if (m.toLowerCase() == \"styleclass\") { // 'class' is an ECMA4 reserved keyword\n o.setAttribute(\"class\", attObj[m]);\n }\n else if (m.toLowerCase() != \"classid\") { // filter out IE specific attribute\n o.setAttribute(m, attObj[m]);\n }\n }\n }\n for (var n in parObj) {\n if (parObj[n] != Object.prototype[n] && n.toLowerCase() != \"movie\") { // filter out prototype additions from other potential libraries and IE specific param element\n createObjParam(o, n, parObj[n]);\n }\n }\n el.parentNode.replaceChild(o, el);\n r = o;\n }\n }\n return r;\n }", "function createSWF(attObj, parObj, id) {\n var r, el = getElementById(id);\n if (ua.wk && ua.wk < 312) { return r; }\n if (el) {\n if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content\n attObj.id = id;\n }\n if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML\n var att = \"\";\n for (var i in attObj) {\n if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries\n if (i.toLowerCase() == \"data\") {\n parObj.movie = attObj[i];\n }\n else if (i.toLowerCase() == \"styleclass\") { // 'class' is an ECMA4 reserved keyword\n att += ' class=\"' + attObj[i] + '\"';\n }\n else if (i.toLowerCase() != \"classid\") {\n att += ' ' + i + '=\"' + attObj[i] + '\"';\n }\n }\n }\n var par = \"\";\n for (var j in parObj) {\n if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries\n par += '<param name=\"' + j + '\" value=\"' + parObj[j] + '\" />';\n }\n }\n el.outerHTML = '<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"' + att + '>' + par + '</object>';\n objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)\n r = getElementById(attObj.id); \n }\n else { // well-behaving browsers\n var o = createElement(OBJECT);\n o.setAttribute(\"type\", FLASH_MIME_TYPE);\n for (var m in attObj) {\n if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries\n if (m.toLowerCase() == \"styleclass\") { // 'class' is an ECMA4 reserved keyword\n o.setAttribute(\"class\", attObj[m]);\n }\n else if (m.toLowerCase() != \"classid\") { // filter out IE specific attribute\n o.setAttribute(m, attObj[m]);\n }\n }\n }\n for (var n in parObj) {\n if (parObj[n] != Object.prototype[n] && n.toLowerCase() != \"movie\") { // filter out prototype additions from other potential libraries and IE specific param element\n createObjParam(o, n, parObj[n]);\n }\n }\n el.parentNode.replaceChild(o, el);\n r = o;\n }\n }\n return r;\n }", "function displayBMPname(obj, Type) {\r\n \t var objectDiv = document.getElementById(obj);\r\n \t if (Type == 'show') { objectDiv.style.display = 'block';}\r\n \t if (Type == 'hide') { objectDiv.style.display = 'none';}\r\n \t }", "function createSWF(attObj, parObj, id) {\n var r, el = getElementById(id);\n if (ua.wk && ua.wk < 312) { return r; }\n if (el) {\n if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content\n attObj.id = id;\n }\n if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML\n var att = \"\";\n for (var i in attObj) {\n if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries\n if (i.toLowerCase() == \"data\") {\n parObj.movie = attObj[i];\n }\n else if (i.toLowerCase() == \"styleclass\") { // 'class' is an ECMA4 reserved keyword\n att += ' class=\"' + attObj[i] + '\"';\n }\n else if (i.toLowerCase() != \"classid\") {\n att += ' ' + i + '=\"' + attObj[i] + '\"';\n }\n }\n }\n var par = \"\";\n for (var j in parObj) {\n if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries\n par += '<param name=\"' + j + '\" value=\"' + parObj[j] + '\" />';\n }\n }\n el.outerHTML = '<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"' + att + '>' + par + '</object>';\n objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)\n r = getElementById(attObj.id);\n }\n else { // well-behaving browsers\n var o = createElement(OBJECT);\n o.setAttribute(\"type\", FLASH_MIME_TYPE);\n for (var m in attObj) {\n if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries\n if (m.toLowerCase() == \"styleclass\") { // 'class' is an ECMA4 reserved keyword\n o.setAttribute(\"class\", attObj[m]);\n }\n else if (m.toLowerCase() != \"classid\") { // filter out IE specific attribute\n o.setAttribute(m, attObj[m]);\n }\n }\n }\n for (var n in parObj) {\n if (parObj[n] != Object.prototype[n] && n.toLowerCase() != \"movie\") { // filter out prototype additions from other potential libraries and IE specific param element\n createObjParam(o, n, parObj[n]);\n }\n }\n el.parentNode.replaceChild(o, el);\n r = o;\n }\n }\n return r;\n }", "function objectTag()\n{\n var flashButtonCmdURL, flashButtonDoc, retVal, theURL;\n if (!dw.getDocumentPath(\"document\"))\n {\n alert(MSG_PleaseSaveDocument);\n\treturn \"\";\n }\n\n if (dreamweaver.getDocumentDOM().getIsTemplateDocument())\n\tif (!confirm(MSG_ConfirmTemplateSWF))\n return \"\";\n\n retVal = callCommand(\"Flash Text\");\n return \"\";\n}", "function addFlashObj(swf, wasDropped) {\r\n\tvar o = document.createElement('object');\r\n\to.setAttribute('data', swf);\r\n\to.setAttribute('width', '400');\r\n\to.setAttribute('height', '400');\r\n\t\r\n\tvar p = document.createElement('param');\r\n\tp.setAttribute('name', 'movie');\r\n\tp.setAttribute('value', swf);\r\n\to.appendChild(p);\r\n\t\r\n\tp = document.createElement('param');\r\n\tp.setAttribute('name', 'quality');\r\n\tp.setAttribute('value', 'high');\r\n\to.appendChild(p);\r\n\t\r\n\tvar embed = document.createElement('embed');\r\n\tembed.setAttribute('src',Util.removePath(swf,false));\r\n\tembed.setAttribute('quality', 'high');\r\n\tembed.setAttribute('pluginspage', 'http://www.macromedia.com/go/getflashplayer');\r\n\tembed.setAttribute('type', 'application/x-shockwave-flash');\r\n\t//o.appendChild(embed);\r\n\t\r\n\tvar bgBox = addNewBox(currentObject, 0, 0, \"\", false, false, wasDropped);\r\n\tbgBox.appendChild(o);\r\n}", "function createSWF(attObj, parObj, id) {\n\t\tvar r, el = getElementById(id);\n\t\tif (ua.wk && ua.wk < 312) { return r; }\n\t\tif (el) {\n\t\t\tif (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content\n\t\t\t\tattObj.id = id;\n\t\t\t}\n\t\t\tif (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML\n\t\t\t\tvar att = \"\";\n\t\t\t\tfor (var i in attObj) {\n\t\t\t\t\tif (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries\n\t\t\t\t\t\tif (i.toLowerCase() == \"data\") {\n\t\t\t\t\t\t\tparObj.movie = attObj[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (i.toLowerCase() == \"styleclass\") { // 'class' is an ECMA4 reserved keyword\n\t\t\t\t\t\t\tatt += ' class=\"' + attObj[i] + '\"';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (i.toLowerCase() != \"classid\") {\n\t\t\t\t\t\t\tatt += ' ' + i + '=\"' + attObj[i] + '\"';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar par = \"\";\n\t\t\t\tfor (var j in parObj) {\n\t\t\t\t\tif (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries\n\t\t\t\t\t\tpar += '<param name=\"' + j + '\" value=\"' + parObj[j] + '\" />';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tel.outerHTML = '<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"' + att + '>' + par + '</object>';\n\t\t\t\tobjIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)\n\t\t\t\tr = getElementById(attObj.id);\t\n\t\t\t}\n\t\t\telse { // well-behaving browsers\n\t\t\t\tvar o = createElement(OBJECT);\n\t\t\t\to.setAttribute(\"type\", FLASH_MIME_TYPE);\n\t\t\t\tfor (var m in attObj) {\n\t\t\t\t\tif (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries\n\t\t\t\t\t\tif (m.toLowerCase() == \"styleclass\") { // 'class' is an ECMA4 reserved keyword\n\t\t\t\t\t\t\to.setAttribute(\"class\", attObj[m]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (m.toLowerCase() != \"classid\") { // filter out IE specific attribute\n\t\t\t\t\t\t\to.setAttribute(m, attObj[m]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (var n in parObj) {\n\t\t\t\t\tif (parObj[n] != Object.prototype[n] && n.toLowerCase() != \"movie\") { // filter out prototype additions from other potential libraries and IE specific param element\n\t\t\t\t\t\tcreateObjParam(o, n, parObj[n]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tel.parentNode.replaceChild(o, el);\n\t\t\t\tr = o;\n\t\t\t}\n\t\t}\n\t\treturn r;\n\t}", "function createSWF(attObj, parObj, id) {\n\t\tvar r, el = getElementById(id);\n\t\tif (ua.wk && ua.wk < 312) { return r; }\n\t\tif (el) {\n\t\t\tif (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content\n\t\t\t\tattObj.id = id;\n\t\t\t}\n\t\t\tif (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML\n\t\t\t\tvar att = \"\";\n\t\t\t\tfor (var i in attObj) {\n\t\t\t\t\tif (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries\n\t\t\t\t\t\tif (i.toLowerCase() == \"data\") {\n\t\t\t\t\t\t\tparObj.movie = attObj[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (i.toLowerCase() == \"styleclass\") { // 'class' is an ECMA4 reserved keyword\n\t\t\t\t\t\t\tatt += ' class=\"' + attObj[i] + '\"';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (i.toLowerCase() != \"classid\") {\n\t\t\t\t\t\t\tatt += ' ' + i + '=\"' + attObj[i] + '\"';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar par = \"\";\n\t\t\t\tfor (var j in parObj) {\n\t\t\t\t\tif (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries\n\t\t\t\t\t\tpar += '<param name=\"' + j + '\" value=\"' + parObj[j] + '\" />';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tel.outerHTML = '<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"' + att + '>' + par + '</object>';\n\t\t\t\tobjIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)\n\t\t\t\tr = getElementById(attObj.id);\t\n\t\t\t}\n\t\t\telse { // well-behaving browsers\n\t\t\t\tvar o = createElement(OBJECT);\n\t\t\t\to.setAttribute(\"type\", FLASH_MIME_TYPE);\n\t\t\t\tfor (var m in attObj) {\n\t\t\t\t\tif (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries\n\t\t\t\t\t\tif (m.toLowerCase() == \"styleclass\") { // 'class' is an ECMA4 reserved keyword\n\t\t\t\t\t\t\to.setAttribute(\"class\", attObj[m]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (m.toLowerCase() != \"classid\") { // filter out IE specific attribute\n\t\t\t\t\t\t\to.setAttribute(m, attObj[m]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (var n in parObj) {\n\t\t\t\t\tif (parObj[n] != Object.prototype[n] && n.toLowerCase() != \"movie\") { // filter out prototype additions from other potential libraries and IE specific param element\n\t\t\t\t\t\tcreateObjParam(o, n, parObj[n]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tel.parentNode.replaceChild(o, el);\n\t\t\t\tr = o;\n\t\t\t}\n\t\t}\n\t\treturn r;\n\t}", "function createSWF(attObj, parObj, id) {\n\t\tvar r, el = getElementById(id);\n\t\tif (ua.wk && ua.wk < 312) { return r; }\n\t\tif (el) {\n\t\t\tif (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content\n\t\t\t\tattObj.id = id;\n\t\t\t}\n\t\t\tif (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML\n\t\t\t\tvar att = \"\";\n\t\t\t\tfor (var i in attObj) {\n\t\t\t\t\tif (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries\n\t\t\t\t\t\tif (i.toLowerCase() == \"data\") {\n\t\t\t\t\t\t\tparObj.movie = attObj[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (i.toLowerCase() == \"styleclass\") { // 'class' is an ECMA4 reserved keyword\n\t\t\t\t\t\t\tatt += ' class=\"' + attObj[i] + '\"';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (i.toLowerCase() != \"classid\") {\n\t\t\t\t\t\t\tatt += ' ' + i + '=\"' + attObj[i] + '\"';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar par = \"\";\n\t\t\t\tfor (var j in parObj) {\n\t\t\t\t\tif (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries\n\t\t\t\t\t\tpar += '<param name=\"' + j + '\" value=\"' + parObj[j] + '\" />';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tel.outerHTML = '<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"' + att + '>' + par + '</object>';\n\t\t\t\tobjIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)\n\t\t\t\tr = getElementById(attObj.id);\t\n\t\t\t}\n\t\t\telse { // well-behaving browsers\n\t\t\t\tvar o = createElement(OBJECT);\n\t\t\t\to.setAttribute(\"type\", FLASH_MIME_TYPE);\n\t\t\t\tfor (var m in attObj) {\n\t\t\t\t\tif (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries\n\t\t\t\t\t\tif (m.toLowerCase() == \"styleclass\") { // 'class' is an ECMA4 reserved keyword\n\t\t\t\t\t\t\to.setAttribute(\"class\", attObj[m]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (m.toLowerCase() != \"classid\") { // filter out IE specific attribute\n\t\t\t\t\t\t\to.setAttribute(m, attObj[m]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (var n in parObj) {\n\t\t\t\t\tif (parObj[n] != Object.prototype[n] && n.toLowerCase() != \"movie\") { // filter out prototype additions from other potential libraries and IE specific param element\n\t\t\t\t\t\tcreateObjParam(o, n, parObj[n]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tel.parentNode.replaceChild(o, el);\n\t\t\t\tr = o;\n\t\t\t}\n\t\t}\n\t\treturn r;\n\t}", "function writeStage()\r\n{\r\n\tvar tml = document.getTimeline();\r\n writeString (\"<Component>\\n\");\r\n for(var i=0; i< tml.layers.length ; i++)\r\n {\r\n\t\twriteLayer(tml.layers[i]);\r\n }\r\n writeString (\"</Component>\\n\");\r\n}", "function _createSWF(attObj, parObj, id) {\n\t\tvar r,\n\t\t el = getElementById(id);\n\t\tif (ua.wk && ua.wk < 312) {\n\t\t\treturn r;\n\t\t}\n\t\tif (el) {\n\t\t\tif (_typeof(attObj.id) == UNDEF) {\n\t\t\t\t// if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content\n\t\t\t\tattObj.id = id;\n\t\t\t}\n\t\t\tif (ua.ie && ua.win) {\n\t\t\t\t// Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML\n\t\t\t\tvar att = \"\";\n\t\t\t\tfor (var i in attObj) {\n\t\t\t\t\tif (attObj[i] != Object.prototype[i]) {\n\t\t\t\t\t\t// filter out prototype additions from other potential libraries\n\t\t\t\t\t\tif (i.toLowerCase() == \"data\") {\n\t\t\t\t\t\t\tparObj.movie = attObj[i];\n\t\t\t\t\t\t} else if (i.toLowerCase() == \"styleclass\") {\n\t\t\t\t\t\t\t// 'class' is an ECMA4 reserved keyword\n\t\t\t\t\t\t\tatt += ' class=\"' + attObj[i] + '\"';\n\t\t\t\t\t\t} else if (i.toLowerCase() != \"classid\") {\n\t\t\t\t\t\t\tatt += ' ' + i + '=\"' + attObj[i] + '\"';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar par = \"\";\n\t\t\t\tfor (var j in parObj) {\n\t\t\t\t\tif (parObj[j] != Object.prototype[j]) {\n\t\t\t\t\t\t// filter out prototype additions from other potential libraries\n\t\t\t\t\t\tpar += '<param name=\"' + j + '\" value=\"' + parObj[j] + '\" />';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tel.outerHTML = '<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"' + att + '>' + par + '</object>';\n\t\t\t\tobjIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)\n\t\t\t\tr = getElementById(attObj.id);\n\t\t\t} else {\n\t\t\t\t// well-behaving browsers\n\t\t\t\tvar o = createElement(OBJECT);\n\t\t\t\to.setAttribute(\"type\", FLASH_MIME_TYPE);\n\t\t\t\tfor (var m in attObj) {\n\t\t\t\t\tif (attObj[m] != Object.prototype[m]) {\n\t\t\t\t\t\t// filter out prototype additions from other potential libraries\n\t\t\t\t\t\tif (m.toLowerCase() == \"styleclass\") {\n\t\t\t\t\t\t\t// 'class' is an ECMA4 reserved keyword\n\t\t\t\t\t\t\to.setAttribute(\"class\", attObj[m]);\n\t\t\t\t\t\t} else if (m.toLowerCase() != \"classid\") {\n\t\t\t\t\t\t\t// filter out IE specific attribute\n\t\t\t\t\t\t\to.setAttribute(m, attObj[m]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (var n in parObj) {\n\t\t\t\t\tif (parObj[n] != Object.prototype[n] && n.toLowerCase() != \"movie\") {\n\t\t\t\t\t\t// filter out prototype additions from other potential libraries and IE specific param element\n\t\t\t\t\t\tcreateObjParam(o, n, parObj[n]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tel.parentNode.replaceChild(o, el);\n\t\t\t\tr = o;\n\t\t\t}\n\t\t}\n\t\treturn r;\n\t}", "function OutFile() {\r\n}", "function embedWamiSWF(id, initfn) {\r\n\t\tvar flashVars = {\r\n\t\t\tvisible : false,\r\n\t\t\tloadedCallback : initfn\r\n\t\t};\r\n\r\n\t\tvar params = {\r\n\t\t\tallowScriptAccess : \"always\"\r\n\t\t};\r\n\r\n\t\tif (supportsTransparency()) {\r\n\t\t\tparams.wmode = \"transparent\";\r\n\t\t}\r\n\r\n\t\tif (typeof console !== 'undefined') {\r\n\t\t\tflashVars.console = true;\r\n\t\t}\r\n\r\n\t\tvar version = '10.0.0';\r\n\t\tdocument.getElementById(id).innerHTML = \"WAMI requires Flash \"\r\n\t\t\t\t+ version\r\n\t\t\t\t+ \" or greater<br />https://get.adobe.com/flashplayer/\";\r\n\r\n\t\t// This is the minimum size due to the microphone security panel\r\n\t\tWami.swfobject.embedSWF(swfurl, id, 214, 137, version, null, flashVars,\r\n\t\t\t\tparams);\r\n\r\n\t\t// Without this line, Firefox has a dotted outline of the flash\r\n\t\tWami.swfobject.createCSS(\"#\" + id, \"outline:none\");\r\n\t}", "function objectTag()\n{\n var dom = dw.getDocumentDOM();\n\n if (dom.getIsLibraryDocument())\n {\n alert(dw.loadString(\"flashvideo/cant insert into library\"));\n return '';\n }\n\n if (dom.getIsTemplateDocument())\n {\n alert(dw.loadString(\"flashvideo/cant insert into template\"));\n return '';\n }\n \n var theObj = dom.getSelectedNode();\n while (theObj) \n {\n theObj = theObj.parentNode;\n if (theObj && theObj.nodeType == 1 && theObj.nodeName.toLowerCase() == \"object\") \n {\n alert(dw.loadString(\"flashvideo/no flash video inside alt content\"));\n return '';\n }\n }\n\n var filePath = dw.getDocumentPath(\"document\");\n\n // save document if not saved\n if (!filePath) \n {\n if (confirm(MSG_NeedToSaveDocumentForFlashVideoObj) && \n dw.canSaveDocument(dreamweaver.getDocumentDOM())) \n {\n dw.saveDocument(dreamweaver.getDocumentDOM());\n filePath = dw.getDocumentPath(\"document\");\n }\n }\n \n if (!filePath)\n return '';\n\n dwscripts.callCommand(\"FlashVideo.htm\");\n\n return \"\";\n}", "function showFlash(){\nvar SWidth = screen.width;\nvar stmt_swf = \"\";\n\nif (!useRedirect) { \n if(hasRightVersion) { \n\n if (SWidth > 800) {\n stmt_swf += \"<object classid=\\\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\\\" codebase=\\\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\\\" width=\\\"710\\\" height=\\\"250\\\" border=\\\"0\\\">\"; \n stmt_swf += \"<param name=movie value=\\\"\"+daBaseURL+\"/media/images/currentPromos/swfx107.swf\\\">\";\n stmt_swf += \"<param name=quality value=high>\";\n stmt_swf += \"<param name=menu value=false>\";\n stmt_swf += \"<embed src=\\\"\"+daBaseURL+\"/media/images/currentPromos/swfx107.swf\\\" quality=high pluginspage=\\\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\\\" type=\\\"application/x-shockwave-flash\\\" width=\\\"710\\\" height=\\\"250\\\" border=\\\"0\\\">\";\n stmt_swf += \"</embed>\";\n stmt_swf += \"</object>\";\n } else {\n stmt_swf += \"<object classid=\\\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\\\" codebase=\\\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\\\" width=\\\"540\\\" height=\\\"165\\\" border=\\\"0\\\">\"; \n stmt_swf += \"<param name=movie value=\\\"\"+daBaseURL+\"/media/images/currentPromos/swfx86.swf\\\">\";\n stmt_swf += \"<param name=quality value=high>\";\n stmt_swf += \"<param name=menu value=false>\";\n stmt_swf += \"<embed src=\\\"\"+daBaseURL+\"/media/images/currentPromos/swfx86.swf\\\" quality=high pluginspage=\\\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\\\" type=\\\"application/x-shockwave-flash\\\" width=\\\"540\\\" height=\\\"165\\\">\";\n stmt_swf += \"</embed>\";\n stmt_swf += \"</object>\";\n }\n \n } else { \n \n if (SWidth > 800) {\n stmt_swf += \"<a href=\\\"javascript:SiteIndx('currentPromos/promoFlash','personalbanking','/index.upb','')\\\">\";\n stmt_swf += \"<img src=\\\"\"+daBaseURL+\"/media/images/currentPromos/noFlash_107.jpg\\\" width=\\\"710\\\" height=\\\"250\\\" border=\\\"0\\\">\" \n stmt_swf += \"</a>\";\n } else {\n stmt_swf += \"<a href=\\\"javascript:SiteIndx('currentPromos/promoFlash','personalbanking','/index.upb','')\\\">\";\n stmt_swf += \"<img src=\\\"\"+daBaseURL+\"/media/images/currentPromos/noFlash_86.jpg\\\" width=\\\"540\\\" height=\\\"165\\\" border=\\\"0\\\">\"\n stmt_swf += \"</a>\";\n }\n \n }\n}\nreturn stmt_swf;\n}", "function PopupVideo(swfsrc) {\n\tcustomModalBox.htmlBox('', '<div id=\"yt-flashcontent\">Video flash here</div>', 'TributeVideo');\n\tvar so = new SWFObject(swfsrc, 'yt-TributeVideo', '720', '480', '7', '#000000');\t\n\tso.addParam(\"wmode\", \"transparent\");\n\tso.write(\"yt-flashcontent\");\n}", "function Capture(obj)\n{\n\tdocument.write(obj);\t\n}", "function flashVarsMovie(){\n\tvar r = document.playbook.teamMasterRef.value;\n\tvar g = document.playbook.gender.value;\n\tdocument.write(\"<object classid=\\\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\\\" codebase=\\\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\\\" width=\\\"577\\\" height=\\\"450\\\" id=\\\"laxChalkboardDesign_FV\\\" align=\\\"middle\\\">\");\n\tdocument.write(\"<param name=\\\"FlashVars\\\" value=\\\"setTMR=\" + r + \"&setGender=\" + g + \"\\\" />\");\n\tdocument.write(\"<param name=\\\"allowScriptAccess\\\" value=\\\"sameDomain\\\" />\");\n\tdocument.write(\"<param name=\\\"movie\\\" value=\\\"movies/laxChalkboardDesign_FV.swf\\\" />\");\n\tdocument.write(\"<param name=\\\"loop\\\" value=\\\"false\\\" />\");\n\tdocument.write(\"<param name=\\\"quality\\\" value=\\\"high\\\" />\");\n\tdocument.write(\"<param name=\\\"bgcolor\\\" value=\\\"#ffffff\\\" />\");\n\tdocument.write(\"<embed src=\\\"movies/laxChalkboardDesign_FV.swf\\\" loop=\\\"false\\\" quality=\\\"high\\\" bgcolor\\\"#ffffff\\\" width=\\\"577\\\" height=\\\"450\\\" name=\\\"laxChalkboardDesign_FV\\\" id=\\\"laxChalkboardDesign_FV\\\" FlashVars=\\\"setTMR=\" + r + \"&setGender=\" + g + \"\\\" align=\\\"middle\\\" allowScriptAccess=\\\"sameDomain\\\" type=\\\"application/x-shockwave-flash\\\" pluginspage=\\\"http://www.macromedia.com/go/getflashplayer\\\" />\");\n\tdocument.write(\"</object>\");\n}", "constructor() {\n /**\n * @member {number}\n * @default\n * @private\n */\n this.code = tags.FILE_ATTRIBUTES;\n\n /**\n * If true, the SWF file uses hardware acceleration to blit graphics to the screen, where such acceleration is available.\n * If false, the SWF file will not use hardware accelerated graphics facilities.\n * Minimum file version is 10.\n *\n * @member {boolean}\n * @default\n */\n this.useDirectBlit = false;\n\n /**\n * If true, the SWF file uses GPU compositing features when drawing graphics, where such acceleration is available.\n * If false, the SWF file will not use hardware accelerated graphics facilities.\n * Minimum file version is 10.\n *\n * @member {boolean}\n * @default\n */\n this.useGPU = false;\n\n /**\n * If true, the SWF file contains the Metadata tag.\n * If false, the SWF file does not contain the Metadata tag.\n *\n * @member {boolean}\n * @default\n */\n this.hasMetadata = false;\n\n /**\n * If true, this SWF uses ActionScript 3.0.\n * If false, this SWF uses ActionScript 1.0 or 2.0.\n * Minimum file format version is 9.\n *\n * @member {boolean}\n * @default\n */\n this.actionScript3 = false;\n\n /**\n * If true, this SWF file is given network file access when loaded locally.\n * If false, this SWF file is given local file access when loaded locally.\n *\n * @member {boolean}\n * @default\n */\n this.useNetwork = false;\n }", "function play_qt_file(obj)\n{\n\tvar rectangle = obj.GetRectangle();\n\n\tif (rectangle)\n\t{\n\t\trectangle = rectangle.split(',');\n\t\tvar x1 = parseInt(rectangle[0]);\n\t\tvar x2 = parseInt(rectangle[2]);\n\t\tvar y1 = parseInt(rectangle[1]);\n\t\tvar y2 = parseInt(rectangle[3]);\n\n\t\tvar width = (x1 < 0) ? (x1 * -1) + x2 : x2 - x1;\n\t\tvar height = (y1 < 0) ? (y1 * -1) + y2 : y2 - y1;\n\t}\n\telse\n\t{\n\t\tvar width = 200;\n\t\tvar height = 0;\n\t}\n\n\tobj.width = width;\n\tobj.height = height + 16;\n\n\tobj.SetControllerVisible(true);\n\tobj.Play();\n}", "function createSWF(attObj, parObj, id) {\n var r, el = getElementById(id);\n id = getId(id); // ensure id is truly an ID and not an element\n\n if (ua.wk && ua.wk < 312) {\n return r;\n }\n\n if (el) {\n var o = (ua.ie) ? createElement(\"div\") : createElement(OBJECT),\n attr,\n attrLower,\n param;\n\n if (typeof attObj.id === UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the fallback content\n attObj.id = id;\n }\n\n //Add params\n for (param in parObj) {\n //filter out prototype additions from other potential libraries and IE specific param element\n if (parObj.hasOwnProperty(param) && param.toLowerCase() !== \"movie\") {\n createObjParam(o, param, parObj[param]);\n }\n }\n\n //Create IE object, complete with param nodes\n if (ua.ie) {\n o = createIeObject(attObj.data, o.innerHTML);\n }\n\n //Add attributes to object\n for (attr in attObj) {\n if (attObj.hasOwnProperty(attr)) { // filter out prototype additions from other potential libraries\n attrLower = attr.toLowerCase();\n\n // 'class' is an ECMA4 reserved keyword\n if (attrLower === \"styleclass\") {\n o.setAttribute(\"class\", attObj[attr]);\n } else if (attrLower !== \"classid\" && attrLower !== \"data\") {\n o.setAttribute(attr, attObj[attr]);\n }\n }\n }\n\n if (ua.ie) {\n objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)\n } else {\n o.setAttribute(\"type\", FLASH_MIME_TYPE);\n o.setAttribute(\"data\", attObj.data);\n }\n\n el.parentNode.replaceChild(o, el);\n r = o;\n }\n\n return r;\n }", "function saveFile()\n{\n // Save document\n var tmpFile = new File( '/tmp/temp.psd');\n psdOpts = new PhotoshopSaveOptions();\n psdOpts.embedColorProfile = true;\n psdOpts.alphaChannels = true;\n psdOpts.layers = true;\n app.activeDocument.saveAs(tmpFile, psdOpts, true, Extension.LOWERCASE);\n}", "function ui_w(str_text){\n\tdocument.write(str_text);\n}", "function printStructure( obj ){\r\tvar result = toStringObj( obj );\r\tif( result == null || result == undefined ) {\r\t\talert(\"non result\");\r\t\treturn;\r\t}\r\t\r\tvar outputPath = baseURL+ baseDir;\r\tvar filePath = outputPath;\r\t\r if(File.fs == \"Windows\" ) {\r filePath.replace(/([A-Za-z]+)\\:(.*)/,\"file:///\" +RegExp.$1+\"|\"+RegExp.$2 );\r filePath = \"file:///\" +RegExp.$1+\"|\"+RegExp.$2;\r }\r else {\r //dir.replace(/([A-Za-z]+)\\:(.*)/,\"file:///\" +RegExp.$1+\"|\"+RegExp.$2 );\r filePath = \"file://Macintosh HD\" + filePath;\r }\r\r var htmlFile = new File( outputPath + getNameRemovedExtendType(document) + \".html\");\r\thtmlFile.open(\"w\");\r\thtmlFile.encoding = \"utf-8\";\r \r var cssFileName = getNameRemovedExtendType(document) + \".css\";\r var cssFile = new File( outputPath + cssFileName);\r\tcssFile.open(\"w\");\r\tcssFile.encoding = \"utf-8\";\r var css = [];\r var html = [\r '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">',\r'<html>',\r'\t<head>',\r'\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />',\r'\t\t<title></title>',\r'\t\t<link rel=\"stylesheet\" charset=\"utf-8\" href=\"' + cssFileName + '\" media=\"all\" />',\r'\t</head>',\r'\t<body>'];\r \r css.push('.artlayer { position: absolute; overflow: hidden; }');\r css.push('.text { position: absolute; }');\r for (var i=0,l=obj.length;i<l;i++)\r {\r if (obj[i].type == \"image\")\r {\r html.push('\t\t<div id=\"image' + i + '\" class=\"artlayer\"></div>');\r css.push('#image' + i + ' { left:' + parseInt( obj[i].position[0] ) +'px; top: ' + parseInt( obj[i].position[1] ) +'px; width: ' + obj[i].width + 'px; height: ' + obj[i].height + 'px; background-image: url(\"' + unescape(obj[i].filename) + '\"); background-size: ' + obj[i].width + 'px ' + obj[i].height + 'px; }');\r }\r else\r {\r html.push('\t\t<div id=\"text' + i + '\" class=\"text\">' + obj[i].text +'</div>');\r css.push('#text' + i + ' { left:' + parseInt( obj[i].position[0] ) +'px; top: ' + parseInt( obj[i].position[1] ) +'px; width: ' + obj[i].width + 'px; height: ' + obj[i].height + 'px; }');\r }\r }\r \r html.push('\t</body>');\r html.push('</html>');\r htmlFile.write(html.join(\"\\n\"));\r htmlFile.close();\r cssFile.write(css.join(\"\\n\"));\r cssFile.close();\r \r}", "function swPrint(txt) {\n document.getElementById(\"display\").innerHTML = txt;\n}", "function flv() {\r\n if (navigator.mimeTypes && typeof (navigator.mimeTypes[\"application/x-shockwave-flash\"]) !== \"undefined\" && navigator.mimeTypes[\"application/x-shockwave-flash\"].enabledPlugin) {\r\n return ((navigator.plugins[\"Shockwave Flash 2.0\"] || navigator.plugins[\"Shockwave Flash\"]).description.match(/[0-9]+.*/)[0] || 0).replace(/,/g, ' ')\r\n } else {\r\n try { f = new ActiveXObject(\"ShockwaveFlash.ShockwaveFlash\") } catch (a) { return 0 }\r\n return f ? (f.GetVariable('$version').match(/[0-9]+.*/)[0] || 0).replace(/,/g, ' ') : 0\r\n }\r\n }", "function createPanoViewer(e){function ut(e){return(\"\"+e).toLowerCase()}function at(e,t){return e[d](t)>=0}function ft(){var t,r,i,s,o,u,a,f,l=n.location;l=l.search||l.hash;if(l){t=\".html5.flash.wmode.mobilescale.fakedevice.\",r=l[R](1)[j](\"&\");for(i=0;i<r[M];i++)s=r[i],o=s[d](\"=\"),o==-1&&(o=s[M]),u=s[R](0,o),a=ut(u),f=s[R](o+1),t[d](\".\"+a)>=0?e[a]=f:a[N](0,9)==\"initvars.\"?(e[O]||(e[O]={}),e[O][u[N](9)]=f):e.addVariable(u,f)}}function lt(e){return e[P]=ft,e}function ct(){function x(){var e,n,i,s,o,u,a;if(t.plugins){e=t.plugins[\"Shockwave Flash\"];if(typeof e==\"object\"){n=e.description;if(n){i=v,t[q]&&(s=t[q][\"application/x-shockwave-flash\"],s&&(s.enabledPlugin||(i=p)));if(i){o=n[j](\" \");for(u=0;u<o[M];++u){a=parseFloat(o[u]);if(isNaN(a))continue;return a}}}}}if(r[G])try{e=new ActiveXObject(\"ShockwaveFlash.ShockwaveFlash\");if(e){n=e.GetVariable(\"$version\");if(n)return parseFloat(n[j](\" \")[1][j](\",\").join(\".\"))}}catch(f){}return 0}function T(){var e,t,i=p,s=n[Z](\"div\");for(e=0;e<5;e++)if(typeof s.style[[\"p\",\"msP\",\"MozP\",\"WebkitP\",\"OP\"][e]+\"erspective\"]!=U){i=v,e==3&&r.matchMedia&&(t=r.matchMedia(\"(-webkit-transform-3d)\"),t&&(i=t.matches==v));break}return i}function C(){var e,t,i={failIfMajorPerformanceCaveat:v};if(r._krpWGL==v)return v;try{e=n[Z](\"canvas\");for(t=0;t<4;t++)if(e.getContext([B,\"experimental-webgl\",\"moz-webgl\",\"webkit-3d\"][t],i))return r._krpWGL=v,v}catch(s){}return p}var l,c,h,m,g,y,b,w,E,S;if(s>0)return;l=p,c=p,h=p,c=C();if(e.isDevice(\"iphone|ipad|ipod\")&&i[d](\"opera mini\")<0)a=f=v,l=v;else{o=x(),o>=10.1&&(u=v),l=T(),m=ut(t.platform),g=0,y=0,b=0,w=i[d](\"firefox/\"),w<0&&(w=i[d](\"gecko/\")),w>=0&&(g=parseInt(i[N](1+i[d](\"/\",w)),10)),h=!!r[et],w=i[d](et),w>0&&(b=parseInt(i[N](w+7),10),h=v),w=i[d](tt),w>0&&(y=parseInt(i[N](w+8),10),g>=18&&(y=4)),l&&(y>0&&y<4&&(l=p),g>3&&g<18&&y>1&&(c=l=p),c||(m[d](Q)<0&&g>3&&y<1&&(l=p),h&&(l=p)));if(l||c){a=v,E=i[d](\"blackberry\")>=0||i[d](\"rim tablet\")>=0||i[d](\"bb10\")>=0,S=(t.msMaxTouchPoints|0)>1;if(y>=4||E||S)f=v}}s=1|l<<1|c<<2|h<<3}function ht(e){function L(e){function a(){r[m]?(r[m](\"DOMMouseScroll\",c,p),r[m](\"mousewheel\",c,p),n[m](\"mousedown\",f,p),n[m](\"mouseup\",l,p)):(r.opera?r.attachEvent(_,c):r[_]=n[_]=c,n.onmousedown=f,n.onmouseup=l)}function f(e){e||(e=r.event,e[w]=e[X]),u=e?e[w]:x}function l(e){var t,i,s,a,f,l,c,h;e||(e=r.event,e[w]=e[X]),t=0,i=o[M];for(t=0;t<i;t++){s=o[t];if(s){a=n[s.id];if(a&&s.needfix){f=a[S](),l=a==e[w],c=a==u,h=e.clientX>=f.left&&e.clientX<f.right&&e.clientY>=f.top&&e.clientY<f.bottom;if((l||c)&&h==p)try{a[I]&&a[I](0,\"mouseUp\")}catch(d){}}}}return v}function c(t){var i,u,a,f,l,c;t||(t=r.event,t[w]=t[X]),i=0,u=p,t.wheelDelta?(i=t.wheelDelta/120,r.opera&&s&&(i/=4/3)):t.detail&&(i=-t.detail,s==p&&(i/=3));if(i){a=0,f=o[M];for(a=0;a<f;a++){l=o[a];if(l){c=n[l.id];if(c&&c==t[w]){try{c.jswheel?c.jswheel(i):c[b]?c[b](i):c[k]&&(c[k](),c[b]&&c[b](i))}catch(h){}u=v;break}}}}e[$]==p&&(u=p);if(u)return t[nt]&&t[nt](),t[st]&&t[st](),t.cancelBubble=v,t.cancel=v,n[m]||(t.returnValue=p),p}var i,s=ut(t.appVersion)[d](Q)>=0,o=r._krpMW,u=x;o||(o=r._krpMW=new Array,a()),i=e[y],o.push({id:e.id,needfix:s||!!r[et]||i==\"opaque\"||i==\"transparent\"})}var i,s,o,u,a,f,l=encodeURIComponent,c=\"\",h=e[rt],T=e[H],N=e.id;for(;;){s=n[E](N);if(!s)break;N+=String.fromCharCode(48+Math.floor(9*Math.random())),e.id=N}e[y]&&(T[y]=e[y]),e[C]&&(T[C]=e[C]),e[z]!==undefined&&(h[z]=e[z]),e[y]=ut(T[y]),T.allowfullscreen=\"true\",T.allowscriptaccess=it,i=\"browser.\",c=i+\"useragent=\"+l(t.userAgent)+\"&\"+i+\"location=\"+l(r.location.href);for(i in h)c+=\"&\"+l(i)+\"=\"+l(h[i]);i=O,h=e[i];if(h){c+=\"&\"+i+\"=\";for(i in h)c+=\"%26\"+l(escape(i))+\"=\"+l(escape(h[i]))}T.flashvars=c,e[A]&&(T.base=e[A]),o=\"\",u=' id=\"'+N+'\" width=\"'+e.width+'\" height=\"'+e.height+'\" style=\"outline:none;\" ',a=\"_krpcb_\"+N,!e[F]||(r[a]=function(){try{delete r[a]}catch(t){r[a]=x}e[F](n[E](N))});if(t.plugins&&t[q]&&!r[G]){o='<embed name=\"'+N+'\"'+u+'type=\"application/x-shockwave-flash\" src=\"'+e.swf+'\" ';for(i in T)o+=i+'=\"'+T[i]+'\" ';o+=\" />\"}else{o=\"<object\"+u+'classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"><param name=\"movie\" value=\"'+e.swf+'\" />';for(i in T)o+='<param name=\"'+i+'\" value=\"'+T[i]+'\" />';o+=\"</object>\"}e[g].innerHTML=o,e.focus===v&&(f=n[E](N),f&&f.focus()),L(e)}function pt(e){typeof embedpanoJS!==U?embedpanoJS(e):e[T](\"krpano HTML5 Viewer not available!\")}function dt(n,r){var u,a,f,l;n==1?(o>=11.4&&(u=v,ut(t.platform)[d](Q)>=0&&ut(t.vendor)[d](\"apple\")>=0&&(a=i[d](\"webkit/\"),a>0&&(a=parseFloat(i[N](a+7)),!isNaN(a)&&a>0&&a<534&&(u=p))),u&&(e[y]==x&&!e[H][y]?e[y]=s&8?\"window\":\"direct\":(f=(\"\"+e[y])[d](\"-flash\"),f>0&&(e[y]=e[y][N](0,f))))),ht(e)):n==2?pt(e):(l=\"\",r<2&&(l+=\"Adobe Flashplayer\"),r==0&&(l+=\" or<br/>\"),r!=1&&(l+=\"HTML5 Browser with WebGL \",at(ut(e[W]),B)||(l+=\"or CSS3D \"),l+=\"support\"),l+=\" required!\",e[T](l))}function vt(){var t='Local usage with <span style=\"border:1px solid gray;padding:0px 3px;\">file://</span> urls is limited due browser security restrictions!<br><br>Use a localhost server (like the <a href=\"http://krpano.com/tools/ktestingserver/#top\" style=\"color:white;\">krpano Testing Server</a>) for local testing!<br>Just start the krpano Testing Server and refresh this page.<br><br><a href=\"http://krpano.com/docu/localusage/#top\" style=\"color:gray;font-style:italic;text-decoration:none;\">More information...</a>';e[T](t)}function mt(e,t,n){var r;try{r=new XMLHttpRequest,r.responseType=\"text\",r.open(\"GET\",e,v),r.onreadystatechange=function(){var e;r.readyState===4&&(e=r.status,e==0&&r.responseText||e==200?t():n())},r.send(x)}catch(i){n()}}var t,n,r,i,s,o,u,a,f,l,c,h,p=!1,d=\"indexOf\",v=!0,m=\"addEventListener\",g=\"targetelement\",y=\"wmode\",b=\"externalMouseEvent\",w=\"target\",E=\"getElementById\",S=\"getBoundingClientRect\",x=null,T=\"onerror\",N=\"slice\",C=\"bgcolor\",k=\"enable_mousewheel_js_bugfix\",L=\"localfallback\",A=\"flashbasepath\",O=\"initvars\",M=\"length\",_=\"onmousewheel\",D=\"fallback\",P=\"passQueryParameters\",H=\"params\",B=\"webgl\",j=\"split\",F=\"onready\",I=\"externalMouseEvent2\",q=\"mimeTypes\",R=\"substring\",U=\"undefined\",z=\"xml\",W=\"html5\",X=\"srcElement\",V=\"basepath\",$=\"mwheel\",J=\"flash\",K=\"consolelog\",Q=\"mac\",G=\"ActiveXObject\",Y=\"never\",Z=\"createElement\",et=\"chrome\",tt=\"android\",nt=\"stopPropagation\",rt=\"vars\",it=\"always\",st=\"preventDefault\",ot=\"only\";return t=navigator,n=document,r=window,i=ut(t.userAgent),s=0,o=0,u=p,a=p,f=v,e||(e={}),l=e[P]===v,e.swf||(e.swf=\"krpano.swf\"),e[z]===undefined&&(e[z]=e.swf[j](\".swf\").join(\".xml\")),e.id||(e.id=\"krpanoSWFObject\"),e.width||(e.width=\"100%\"),e.height||(e.height=\"100%\"),e[C]||(e[C]=\"#000000\"),e[y]||(e[y]=x),e[w]||(e[w]=x),e[W]||(e[W]=\"auto\"),e[J]||(e[J]=x),e[$]===undefined&&(e[$]=v),e[rt]||(e[rt]={}),e[H]||(e[H]={}),e[F]||(e[F]=x),e.mobilescale||(e.mobilescale=.5),e.fakedevice||(e.fakedevice=x),e[L]||(e[L]=\"http://localhost:8090\"),e[V]?e[A]=e[V]:(c=\"./\",h=e.swf.lastIndexOf(\"/\"),h>=0&&(c=e.swf[N](0,h+1)),e[V]=c),e.isDevice=function(e){var t,n,r,s=\"all\",o=[\"ipad\",\"iphone\",\"ipod\",tt];for(t=0;t<4;t++)i[d](o[t])>=0&&(s+=\"|\"+o[t]);e=ut(e)[j](\"|\");if(e==x)return v;n=e[M];for(t=0;t<n;t++){r=e[t];if(s[d](r)>=0)return v}return p},e.addVariable=function(t,n){t=ut(t),t==\"pano\"||t==z?e[z]=n:e[rt][t]=n},e.addParam=function(t,n){e[H][ut(t)]=n},e.useHTML5=function(t){e[W]=t},e.isHTML5possible=function(){return ct(),a},e.isFlashpossible=function(){return ct(),u},e[T]||(e[T]=function(t){var n=e[g];n?n.innerHTML='<table style=\"width:100%;height:100%;\"><tr style=\"vertical-align:middle;text-align:center;\"><td>ERROR:<br><br>'+t+\"<br><br></td></tr></table>\":alert(\"ERROR: \"+t)}),e.embed=function(t){var i,o,f,c,h,m;t&&(e[w]=t),e[g]=n[E](e[w]),e[g]?(l&&ft(),e.focus===undefined&&e[g][S]&&(i=e[g][S](),e.focus=i.top==0&&i.left==0&&i.right>=r.innerWidth&&i.bottom>=r.innerHeight),e[$]==p&&(e[rt][\"control.disablewheel\"]=v),e[K]&&(e[rt][K]=e[K]),s==0&&ct(),o=ut(e[W]),f=e[J],f&&(f=ut(f),f==\"prefer\"?o=D:f==D?o=\"prefer\":f==ot?o=Y:f==Y&&(o=ot)),c=0,h=0,m=a,m&&at(o,B)&&(m=s&4),o==Y?(c=u?1:0,h=1):at(o,ot)?(c=m?2:0,h=2):at(o,it)?c=h=2:o==D?c=u?1:a?2:0:c=m?2:u?1:0,c==2&&ut(location.href[N](0,7))==\"file://\"?mt(location.href,function(){dt(c,h)},function(){var t,n=ut(e[L]);n==J?u?dt(1,0):vt():n==\"none\"?dt(c,h):n[d](\"://\")>0?(t=new Image,t[T]=vt,t.onload=function(){location.href=n+\"/krpanotestingserverredirect.html?\"+location.href},t.src=n+\"/krpanotestingserver.png\"):vt()}):dt(c,h)):e[T](\"No Embedding Target\")},lt(e)}", "function krpano() {\n return document.getElementById('krpanoSWFObject');\n}", "function print() {\n\tvar text = editor.getText();\n var compiler = new SlickCompiler();\n const input = compiler.compile(text);\n dialog.showSaveDialog({filters: [{name: 'pdf', extensions: ['pdf']},\n]}, function(filename){\n\tconsole.log(filename.toString())\n\t\tprintHelper(filename, input);\n });\n}", "function OLlayerWrite(txt){\r\ntxt+=\"\\n\";\r\nif(OLns4){over.document.write(txt);over.document.close();\r\n}else if(typeof over.innerHTML!='undefined'){if(OLieM)over.innerHTML='';over.innerHTML=txt;\r\n}else{range=o3_frame.document.createRange();range.setStartAfter(over);\r\ndomfrag=range.createContextualFragment(txt);\r\nwhile(over.hasChildNodes()){over.removeChild(over.lastChild);}\r\nover.appendChild(domfrag);}\r\n}", "function showfile(){\n ele = document.getElementById(\"fileout\");\n ele.src = File[8]; \n ele.data = File[8];\n console.log(\"showing file: \" + ele.data);\n}", "function makevid(preformer){\r\n\r\n// image\r\n\tprefimg='<img class=\"png\" width=\"180\" height=\"148\" src=\"http://cdn-i.highwebmedia.com/roomimage/'+preformer+'.jpg\" img style=\"float:right;margin-right:100px;margin-top:10px;border-width:5px;border-style:double; \">';\r\n\tFversion=readCookie(\"CBversion\")\r\n\tif(!Fversion){Fversion=\"http://ccstatic.highwebmedia.com/static/flash/CBV_2p644.swf\"}\r\n\tvideodata2 = videodata2.replace(\"ladroop\",preformer);\r\n\tnewvid=document.createElement('div');\r\n\tnewvid.style.clear=\"both\";\r\n\tnewvid.innerHTML=prefimg+videodata1+Fversion+videodata2;\r\n\tdocument.getElementsByClassName('block')[0].appendChild(newvid)}", "function printScreen() {\n var renderer = new THREE.WebGLRenderer({ preserveDrawingBuffer: true });\n\n window.open(renderer.domElement.toDataURL('image/png'), 'screenshot');\n\n}", "function SavePSD(saveFile){\n\n psdSaveOptions = new PhotoshopSaveOptions();\n\n psdSaveOptions.embedColorProfile = true;\n\n psdSaveOptions.alphaChannels = true;\n\n activeDocument.saveAs(saveFile, psdSaveOptions, false,\n\nExtension.LOWERCASE);\n\n}", "function loadHSVideo(name) {\n\tkrpano().call(\"closeallobjects();set(plugin[\"+name +\"object].visible,true);\" +\n \"tween(plugin[\"+ name +\"object].alpha, 1);\" + \n \"stoppanosounds();plugin[\" + name + \"object].play();\");\n}", "function save(filename) {\n var desc1 = new ActionDescriptor();\n var desc2 = new ActionDescriptor();\n desc2.putInteger( stringIDToTypeID( \"extendedQuality\" ), 12 );\n desc2.putEnumerated( stringIDToTypeID( \"matteColor\" ), stringIDToTypeID( \"matteColor\" ), stringIDToTypeID( \"none\" ) );\n desc1.putObject( stringIDToTypeID( \"as\" ), stringIDToTypeID( \"JPEG\" ), desc2 );\n desc1.putPath( stringIDToTypeID( \"in\" ), new File( filename ) );\n desc1.putInteger( stringIDToTypeID( \"documentID\" ), app.activeDocument.id);\n desc1.putBoolean( stringIDToTypeID( \"copy\" ), true );\n desc1.putBoolean( stringIDToTypeID( \"lowerCase\" ), true );\n desc1.putEnumerated( stringIDToTypeID( \"saveStage\" ), stringIDToTypeID( \"saveStageType\" ), stringIDToTypeID( \"saveSucceeded\" ) );\n executeAction( stringIDToTypeID( \"save\" ), desc1, DialogModes.NO );\n}", "function addShockwaveVBscript() {\n var dom = dw.getDocumentDOM();\n if (dom && dom.documentElement.innerHTML.indexOf(VBScriptCodename)==-1) {//if not already on page, add it\n dom.body.outerHTML += \"\\n\"+\n\"<script name=\\\"\" + VBScriptCodename + \"\\\" language=\\\"javascript\\\">\\n\"+\n\"<!\"+\"--\\n\"+\n\"with (navigator) if (appName.indexOf('Microsoft')!=-1 && appVersion.indexOf('Mac')==-1) document.write(''+\\n\"+\n\"'<scr'+'ipt language=\\\"VBScript\\\">\\\\nOn error resume next\\\\n'+\\n\"+\n\"'MM_dir = IsObject(CreateObject(\\\"SWCtl.SWCtl\\\"))\\\\n'+\\n\"+\n\"'MM_flash = NOT IsNull(CreateObject(\\\"ShockwaveFlash.ShockwaveFlash\\\"))\\\\n</scr'+'ipt>');\\n\"+\n\"//--\"+\">\\n\"+\n\"</scr\"+\"ipt>\\n\";\n }\n}", "function wfs() {\n return dfs('wfFrame' + pdf('CurrentDesk'));\n}", "function printMovieDetail() {\n if (movie.bkgimage != null) {\n bkgImageElt.css('background-image', `url(${movie.bkgimage})`);\n }\n else {\n bkgImageElt.css('background-image', `linear-gradient(rgb(81, 85, 115), rgb(21, 47, 123))`);\n }\n\n titleElt.text(movie.title);\n modalTitle.text(movie.title);\n originaltitleElt.text(movie.originaltitle);\n resumeElt.text(movie.resume);\n dateElt.text(printDateFr(movie.date));\n durationElt.text(printDuration(movie.duration));\n imgElt.attr('src', movie.image);\n iframe.attr('src', movie.traileryt + \"?version=3&enablejsapi=1\");\n // Afficher la liste des acteurs\n var actorsStr = '';\n for (var actor of movie.actors) {\n actorsStr += actor + ' | ';\n }\n actorsElt.text(actorsStr);\n // afficher le réalisteur\n directorElt.text(movie.director);\n}", "function swfDispatcher( func )\r\n\t\t\t{\r\n\t\t\t\tif( arguments.length > 1 )\r\n\t\t\t\t{\r\n\t\t\t\t\tswfobject.getObjectById( 'swf' )[func]( Array.prototype.slice.call(arguments).slice(1)[0]);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tswfobject.getObjectById( 'swf' )[func]();\r\n\t\t\t\t}\r\n\t\t\t}", "function addSwf(domain){\n // the differentiating query argument is needed in Flash9 to avoid a caching issue where LocalConnection would throw an error.\n var url = config.swf + \"?host=\" + config.isHost;\n var id = \"easyXDM_swf_\" + Math.floor(Math.random() * 10000);\n\n // prepare the init function that will fire once the swf is ready\n easyXDM.Fn.set(\"flash_loaded\" + domain.replace(/[\\-.]/g, \"_\"), function(){\n easyXDM.stack.FlashTransport[domain].swf = swf = swfContainer.firstChild;\n var queue = easyXDM.stack.FlashTransport[domain].queue;\n for (var i = 0; i < queue.length; i++) {\n queue[i]();\n }\n queue.length = 0;\n });\n\n if (config.swfContainer) {\n swfContainer = (typeof config.swfContainer == \"string\") ? document.getElementById(config.swfContainer) : config.swfContainer;\n }\n else {\n // create the container that will hold the swf\n swfContainer = document.createElement('div');\n\n // http://bugs.adobe.com/jira/browse/FP-4796\n // http://tech.groups.yahoo.com/group/flexcoders/message/162365\n // https://groups.google.com/forum/#!topic/easyxdm/mJZJhWagoLc\n apply(swfContainer.style, HAS_FLASH_THROTTLED_BUG && config.swfNoThrottle ? {\n height: \"20px\",\n width: \"20px\",\n position: \"fixed\",\n right: 0,\n top: 0\n } : {\n height: \"1px\",\n width: \"1px\",\n position: \"absolute\",\n overflow: \"hidden\",\n right: 0,\n top: 0\n });\n document.body.appendChild(swfContainer);\n }\n\n // create the object/embed\n var flashVars = \"callback=flash_loaded\" + encodeURIComponent(domain.replace(/[\\-.]/g, \"_\"))\n + \"&proto=\" + global.location.protocol\n + \"&domain=\" + encodeURIComponent(getDomainName(global.location.href))\n + \"&port=\" + encodeURIComponent(getPort(global.location.href))\n + \"&ns=\" + encodeURIComponent(namespace);\n swfContainer.innerHTML = \"<object height='20' width='20' type='application/x-shockwave-flash' id='\" + id + \"' data='\" + url + \"'>\" +\n \"<param name='allowScriptAccess' value='always'></param>\" +\n \"<param name='wmode' value='transparent'>\" +\n \"<param name='movie' value='\" +\n url +\n \"'></param>\" +\n \"<param name='flashvars' value='\" +\n flashVars +\n \"'></param>\" +\n \"<embed type='application/x-shockwave-flash' FlashVars='\" +\n flashVars +\n \"' allowScriptAccess='always' wmode='transparent' src='\" +\n url +\n \"' height='1' width='1'></embed>\" +\n \"</object>\";\n }", "function PickNewVideo(iVideoInfo, iAutoPlay, iQuote, iPageObjectIds)\r\r\n{\r\r\n DebugLn(\"PickNewVideo\");\r\r\n if (isObject(iVideoInfo))\r\r\n {\r\r\n DebugLn(\"iVideoInfo.Description = \" + iVideoInfo.Description);\r\r\n DebugLn(\"iVideoInfo.Link = \" + iVideoInfo.Link);\r\r\n \r\r\n if (iVideoInfo.Link && \r\r\n iVideoInfo.Link.length > 0)\r\r\n {\r\r\n pageObjectIds = {VideoDiv: \"VideoDiv\", \r\r\n NamePar: \"VideoName\", \r\r\n DescPar: \"VideoDesc\"};\r\r\n \r\r\n if (isObject(iPageObjectIds))\r\r\n {\r\r\n if (StringLength(iPageObjectIds.VideoDiv) > 0)\r\r\n pageObjectIds.VideoDiv = iPageObjectIds.VideoDiv;\r\r\n if (StringLength(iPageObjectIds.NamePar) > 0)\r\r\n pageObjectIds.NamePar = iPageObjectIds.NamePar;\r\r\n if (StringLength(iPageObjectIds.DescPar) > 0)\r\r\n pageObjectIds.DescPar = iPageObjectIds.DescPar;\r\r\n }\r\r\n \r\r\n // Reset video division\r\r\n SetElementHtml(pageObjectIds.VideoDiv,LoadingHtml());\r\r\n\r\r\n // Set video link \r\r\n DebugLn(\"iVideoInfo.AudioPlayer = \" + iVideoInfo.AudioPlayer);\r\r\n videoLink = iVideoInfo.Link;\r\r\n if (StringLength(iVideoInfo.AudioPlayer) > 0)\r\r\n {\r\r\n videoLink = iVideoInfo.AudioPlayer;\r\r\n }\r\r\n DebugLn(\"videoLink = \" + videoLink);\r\r\n\r\r\n // Put video on page.\r\r\n var so = new SWFObject(videoLink, \"VideoEmbed\", \"425\", \"355\", \"9\", \"#6f7a9e\");\r\r\n if (so)\r\r\n {\r\r\n DebugLn(\"Have swf object.\");\r\r\n\r\r\n if (iVideoInfo.Attribute)\r\r\n\t{\r\r\n DebugLn(\"iVideoInfo.Attribute.length = \" + iVideoInfo.Attribute.length);\r\r\n for (iiAtt=0; iiAtt<iVideoInfo.Attribute.length; iiAtt++)\r\r\n {\r\r\n DebugLn('iiAtt = ' + iiAtt + \": \" + \r\r\n iVideoInfo.Attribute[iiAtt].Name + \" = \" + iVideoInfo.Attribute[iiAtt].Value);\r\r\n so.addVariable(iVideoInfo.Attribute[iiAtt].Name, iVideoInfo.Attribute[iiAtt].Value);\r\r\n }\r\r\n\t}\r\r\n\r\r\n if (iAutoPlay)\r\r\n so.addVariable(\"autoplay\", 1);\r\r\n\r\r\n if (StringLength(iVideoInfo.AudioPlayer) > 0)\r\r\n so.addVariable(\"playlist_url\", iVideoInfo.Link);\r\r\n\r\r\n swfHtml = so.getSWFHTML();\r\r\n if (swfHtml && \r\r\n swfHtml.length > 0)\r\r\n\t{\r\r\n DebugLn(\"swfHtml = \" + swfHtml.replace(/</, \"@\"));\r\r\n SetElementHtml(pageObjectIds.VideoDiv,swfHtml);\r\r\n //so.write(pageObjectIds.VideoDiv);\r\r\n }\r\r\n else\r\r\n {\r\r\n SetElementHtml(pageObjectIds.VideoDiv,BadFlashErrorHtml());\r\r\n }\r\r\n }\r\r\n else\r\r\n {\r\r\n SetElementHtml(pageObjectIds.VideoDiv,JavascriptErrorHtml());\r\r\n }\r\r\n\r\r\n // Put name with video.\r\r\n videoName = iVideoInfo.Name;\r\r\n DebugLn(\"videoName = \" + videoName);\r\r\n SetElementHtml(pageObjectIds.NamePar, videoName);\r\r\n \r\r\n // Put description with video.\r\r\n videoDesc = \"\";\r\r\n if (StringLength(iVideoInfo.Description) > 0)\r\r\n {\r\r\n videoDesc = iVideoInfo.Description;\r\r\n if (iQuote)\r\r\n videoDesc = '\"' + videoDesc +'\"';\r\r\n else\r\r\n videoDesc = videoDesc;\r\r\n }\r\r\n else if (StringLength(iVideoInfo.Date) > 0)\r\r\n {\r\r\n if (StringLength(iVideoInfo.Number) > 0)\r\r\n videoDesc += \"Message \" + iVideoInfo.Number;\r\r\n videoDesc += \"<br/>\" + iVideoInfo.Date;\r\r\n if (StringLength(iVideoInfo.Speaker) > 0)\r\r\n videoDesc += \"<br/>\" + iVideoInfo.Speaker;\r\r\n }\r\r\n DebugLn(\"videoDesc = \" + videoDesc);\r\r\n SetElementHtml(pageObjectIds.DescPar, videoDesc);\r\r\n }\r\r\n }\r\r\n}", "function getEmbed(config, x) {\n var flashvars = [];\n for(var i=1; i<arguments.length; i+=2) {\n flashvars.push(encodeURIComponent(arguments[i]) + '=' + encodeURIComponent(arguments[i+1]));\n }\n var swf = (config.player_id.length>0 ? config.player_id + '.swf' : 'v.swf');\n return('<object width=\"'+config.player_width+'\" height=\"'+config.player_height+'\" classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" style=\"width:'+config.player_width+'px; height:'+config.player_height+'px;\"><param name=\"movie\" value=\"http://' + config.domain + '/' + swf + '\"></param><param name=\"FlashVars\" value=\"'+flashvars.join('&')+'\"></param><param name=\"allowfullscreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://' + config.domain + '/' + swf + '\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"'+config.player_width+'\" height=\"'+config.player_height+'\" FlashVars=\"'+flashvars.join('&')+'\"></embed></object>');\n}", "function downloadFile() {\n let filename = $(\"#fileName\").val();\n // if filename has not been defined set to untitled\n if(filename === ''){\n filename = 'untitled';\n }\n let output = \"\";\n if ($(\"#saveCode\")[0].checked)\n output+= app.editor.getCode();\n if ($(\"#saveLayout\")[0].checked) {\n output+=\"\\nvisualiser_json_layout:\";\n output+= JSON.stringify(app.models.getJSON());\n }\n const blob = new Blob(\n [output],\n {type: 'text/plain;charset=utf-8'});\n require(\"file-saver\").saveAs(blob, filename + '.txt');\n}", "function OutString() {\r\n}", "function SFShowSWF(swfUrl /* string */,\n swfId /* string */,\n swfWidth /* integer */,\n swfHeight /* integer */,\n flashVars /* string */,\n requiredMajorVersion,\n requiredMinorVersion,\n requiredRevision\n ) {\n this.register();\n assert(swfUrl, \"URL to SWF is required\");\n assert(swfId, \"SWF ID is required\");\n this._swfUrl = swfUrl;\n this._swfId = swfId;\n this._swfWidth = swfWidth;\n this._swfHeight = swfHeight;\n if (flashVars) this._flashVars = flashVars;\n this._requiredMajorVersion = requiredMajorVersion;\n this._requiredMinorVersion = requiredMinorVersion;\n this._requiredRevision = requiredRevision;\n}", "function Export() {\n\n var element = document.createElement('a');\n element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(Canvas.toDataURL()));\n element.setAttribute('download', \"img\");\n element.style.display = 'none';\n document.body.appendChild(element);\n element.click();\n document.body.removeChild(element);\n}", "function download() {\n var stegimgbytes = putDataBlock(rawData, document.getElementById('editor').value);\n var stegDiv = document.getElementById('stegimgdiv');\n stegDiv.style.visibility=\"visible\";\n var stegImage = document.getElementById(\"stegimg\");\n stegImage.src = bmphdr + \",\" + btoa(stegimgbytes);\n}", "function addSwf(domain){\r\n // the differentiating query argument is needed in Flash9 to avoid a caching issue where LocalConnection would throw an error.\r\n var url = config.swf + \"?host=\" + config.isHost;\r\n var id = \"easyXDM_swf_\" + Math.floor(Math.random() * 10000);\r\n \r\n // prepare the init function that will fire once the swf is ready\r\n easyXDM.Fn.set(\"flash_loaded\" + domain.replace(/[\\-.]/g, \"_\"), function(){\r\n easyXDM.stack.FlashTransport[domain].swf = swf = swfContainer.firstChild;\r\n var queue = easyXDM.stack.FlashTransport[domain].queue;\r\n for (var i = 0; i < queue.length; i++) {\r\n queue[i]();\r\n }\r\n queue.length = 0;\r\n });\r\n \r\n if (config.swfContainer) {\r\n swfContainer = (typeof config.swfContainer == \"string\") ? document.getElementById(config.swfContainer) : config.swfContainer;\r\n }\r\n else {\r\n // create the container that will hold the swf\r\n swfContainer = document.createElement('div');\r\n \r\n // http://bugs.adobe.com/jira/browse/FP-4796\r\n // http://tech.groups.yahoo.com/group/flexcoders/message/162365\r\n // https://groups.google.com/forum/#!topic/easyxdm/mJZJhWagoLc\r\n apply(swfContainer.style, HAS_FLASH_THROTTLED_BUG && config.swfNoThrottle ? {\r\n height: \"20px\",\r\n width: \"20px\",\r\n position: \"fixed\",\r\n right: 0,\r\n top: 0\r\n } : {\r\n height: \"1px\",\r\n width: \"1px\",\r\n position: \"absolute\",\r\n overflow: \"hidden\",\r\n right: 0,\r\n top: 0\r\n });\r\n document.body.appendChild(swfContainer);\r\n }\r\n \r\n // create the object/embed\r\n var flashVars = \"callback=flash_loaded\" + encodeURIComponent(domain.replace(/[\\-.]/g, \"_\"))\r\n + \"&proto=\" + global.location.protocol\r\n + \"&domain=\" + encodeURIComponent(getDomainName(global.location.href))\r\n + \"&port=\" + encodeURIComponent(getPort(global.location.href))\r\n + \"&ns=\" + encodeURIComponent(namespace);\r\n swfContainer.innerHTML = \"<object height='20' width='20' type='application/x-shockwave-flash' id='\" + id + \"' data='\" + url + \"'>\" +\r\n \"<param name='allowScriptAccess' value='always'></param>\" +\r\n \"<param name='wmode' value='transparent'>\" +\r\n \"<param name='movie' value='\" +\r\n url +\r\n \"'></param>\" +\r\n \"<param name='flashvars' value='\" +\r\n flashVars +\r\n \"'></param>\" +\r\n \"<embed type='application/x-shockwave-flash' FlashVars='\" +\r\n flashVars +\r\n \"' allowScriptAccess='always' wmode='transparent' src='\" +\r\n url +\r\n \"' height='1' width='1'></embed>\" +\r\n \"</object>\";\r\n }", "function layerWrite(txt) {\r\n\ttxt += \"\\n\";\r\n\tif (olNs4) {\r\n\t\tvar lyr = o3_frame.document.layers['overDiv'].document\r\n\t\tlyr.write(txt)\r\n\t\tlyr.close()\r\n\t} else if (typeof over.innerHTML != 'undefined') {\r\n\t\tif (olIe5 && isMac) over.innerHTML = '';\r\n\t\tover.innerHTML = txt;\r\n\t} else {\r\n\t\trange = o3_frame.document.createRange();\r\n\t\trange.setStartAfter(over);\r\n\t\tdomfrag = range.createContextualFragment(txt);\r\n\t\t\r\n\t\twhile (over.hasChildNodes()) {\r\n\t\t\tover.removeChild(over.lastChild);\r\n\t\t}\r\n\t\t\r\n\t\tover.appendChild(domfrag);\r\n\t}\r\n}", "function load_video(){\n var flashvars = {};\n\t\tflashvars.xml = \"config.xml\";\n\t\tflashvars.font = \"font.swf\";\t\t\n\t\tvar attributes = {};\n\t\tattributes.wmode = \"transparent\";\n\t\tattributes.bgcolor = \"#c72e42\";\n\t\tattributes.id = \"slider\";\n\t\tswfobject.embedSWF(\"cu3er.swf\", \"cuber\", \"961\", \"359\", \"9\", \"expressInstall.swf\", flashvars, attributes);\n \n}", "function TF_GetSwfVer() {\r\n\t// NS/Opera version >= 3 check for Flash plugin in plugin array\r\n\tvar flashVer = -1;\r\n\r\n\tif (navigator.plugins != null && navigator.plugins.length > 0) {\r\n\t\tif (navigator.plugins[\"Shockwave Flash 2.0\"] || navigator.plugins[\"Shockwave Flash\"]) {\r\n\t\t\tvar swVer2 = navigator.plugins[\"Shockwave Flash 2.0\"] ? \" 2.0\" : \"\";\r\n\t\t\tvar flashDescription = navigator.plugins[\"Shockwave Flash\" + swVer2].description;\r\n\t\t\tvar descArray = flashDescription.split(\" \");\r\n\t\t\tvar tempArrayMajor = descArray[2].split(\".\");\r\n\t\t\tvar versionMajor = tempArrayMajor[0];\r\n\t\t\tvar versionMinor = tempArrayMajor[1];\r\n\t\t\tvar versionRevision = descArray[3];\r\n\t\t\tif (versionRevision == \"\") {\r\n\t\t\t\tversionRevision = descArray[4];\r\n\t\t\t}\r\n\t\t\tif (versionRevision[0] == \"d\") {\r\n\t\t\t\tversionRevision = versionRevision.substring(1);\r\n\t\t\t} else if (versionRevision[0] == \"r\") {\r\n\t\t\t\tversionRevision = versionRevision.substring(1);\r\n\t\t\t\tif (versionRevision.indexOf(\"d\") > 0) {\r\n\t\t\t\t\tversionRevision = versionRevision.substring(0, versionRevision.indexOf(\"d\"));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar flashVer = versionMajor + \".\" + versionMinor + \".\" + versionRevision;\r\n\t\t}\r\n\t}\r\n\t// MSN/WebTV 2.6 supports Flash 4\r\n\telse if (navigator.userAgent.toLowerCase().indexOf(\"webtv/2.6\") != -1) flashVer = 4;\r\n\t// WebTV 2.5 supports Flash 3\r\n\telse if (navigator.userAgent.toLowerCase().indexOf(\"webtv/2.5\") != -1) flashVer = 3;\r\n\t// older WebTV supports Flash 2\r\n\telse if (navigator.userAgent.toLowerCase().indexOf(\"webtv\") != -1) flashVer = 2;\r\n\telse if (isIE && isWin && !isOpera) {\r\n\t\tflashVer = TF_ControlVersion();\r\n\t}\r\n\treturn flashVer;\r\n}", "function print() {\n message += \"<h2>\" + parkList[pick].name + \"</h2>\" + parkList[pick].picture + \"<p>\" + parkList[pick].description + \"</p>\";\n document.write(message);\n}", "function getSwfUrl() {\n var scripts = document.getElementsByTagName(\"script\"), i, matches;\n for (i = 0; i < scripts.length; i++) {\n matches = scripts[i].src.match(/(.*)socket\\.js$/);\n if (matches) {\n return matches[1] + \"flash/chatSocket.swf\";\n }\n }\n return \"chatSocket.swf\";\n }", "function toggleOutputformatObject(){\n //Si le style cliquer est celui qui est deplie\n //alert(classe+\" \"+style+\" \"+mapFile.currentStyle);\n var oDiv=$('mapfile_outputformat_attr');\n if(oDiv.style.display==\"none\"){\n mapFile.outputformatObject.expand=true;\n oDiv.style.display=\"block\";\n mapFile.outputformatObject.initGUI();\n }else{\n mapFile.outputformatObject.expand=false;\n oDiv.style.display=\"none\";\n }\n}", "function sc_display(o, p) {\n if (p === undefined) // we assume not given\n\tp = SC_DEFAULT_OUT;\n p.appendJSString(sc_toDisplayString(o));\n}", "preview () {\n const frag = this.outputFragment()\n const artboard = frag.querySelector('#artboard')\n const printPreview = window.open('about:blank', 'print_preview')\n const printDocument = printPreview.document\n cleanDOM(frag)\n let styles = this.getCss(frag)\n printDocument.open()\n printDocument.write(\n `<!DOCTYPE html>\n <html>\n <head>\n <title>${this.title}</title>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <style>\n ${styles}\n </style>\n </head>\n <body>\n ${artboard.innerHTML}\n <script src=\"${window.location.origin + '/js/cjs.js'}\"></script>\n <body>\n </html>`\n )\n }", "function saveKF(){\r\n var dataStr = \"data:text/json;charset=utf-8,\" + encodeURIComponent(JSON.stringify({speed,polygon,keyframes}));\r\n var downloadAnchorNode = document.createElement('a');\r\n downloadAnchorNode.setAttribute(\"href\", dataStr);\r\n downloadAnchorNode.setAttribute(\"download\", \"data.json\");\r\n downloadAnchorNode.click();\r\n downloadAnchorNode.remove();\r\n }", "function layerWrite(txt) {\n if (ns4) {\n var lyr = document.abc.document\n lyr.write(txt)\n lyr.close()\n }\n else if (ie4) document.all[\"abc\"].innerHTML = txt\n if (tr) { }\n}", "function printSchedule() {\n var win=window.open();\n win.document.write(\"<head><title>My Class Schedule</title>\");\n win.document.write(\"<style> img { border: 2.5px solid gray; } h1 { font-family: 'Arial'; }</style></head>\");\n win.document.write(\"<body><h1 style='text-align: center; width: 1080;'>\"+_schedule+\"</h1>\");\n win.document.write(\"<img src='\"+_canvas.toDataURL()+\"'></body>\");\n win.print();\n win.close();\n }", "function GetSwfVer(){\n // NS/Opera version >= 3 check for Flash plugin in plugin array\n var flashVer = -1;\n \n if (navigator.plugins != null && navigator.plugins.length > 0) {\n if (navigator.plugins[\"Shockwave Flash 2.0\"] || navigator.plugins[\"Shockwave Flash\"]) {\n var swVer2 = navigator.plugins[\"Shockwave Flash 2.0\"] ? \" 2.0\" : \"\";\n var flashDescription = navigator.plugins[\"Shockwave Flash\" + swVer2].description;\n var descArray = flashDescription.split(\" \");\n var tempArrayMajor = descArray[2].split(\".\"); \n var versionMajor = tempArrayMajor[0];\n var versionMinor = tempArrayMajor[1];\n var versionRevision = descArray[3];\n if (versionRevision == \"\") {\n versionRevision = descArray[4];\n }\n if (versionRevision[0] == \"d\") {\n versionRevision = versionRevision.substring(1);\n } else if (versionRevision[0] == \"r\") {\n versionRevision = versionRevision.substring(1);\n if (versionRevision.indexOf(\"d\") > 0) {\n versionRevision = versionRevision.substring(0, versionRevision.indexOf(\"d\"));\n }\n }\n var flashVer = versionMajor + \".\" + versionMinor + \".\" + versionRevision;\n //alert(\"flashVer=\"+flashVer);\n }\n }\n // MSN/WebTV 2.6 supports Flash 4\n else if (navigator.userAgent.toLowerCase().indexOf(\"webtv/2.6\") != -1) flashVer = 4;\n // WebTV 2.5 supports Flash 3\n else if (navigator.userAgent.toLowerCase().indexOf(\"webtv/2.5\") != -1) flashVer = 3;\n // older WebTV supports Flash 2\n else if (navigator.userAgent.toLowerCase().indexOf(\"webtv\") != -1) flashVer = 2;\n else if ( isIE && isWin && !isOpera ) {\n flashVer = ControlVersion();\n } \n return flashVer;\n}", "function showOnScreen(input){\n output.html(input);\n }", "function PixFileDownload() {\n}", "function saveAsPascalVOC(){\n\n if(!imgSelected){\n showSnackBar(\"This option is applicable on the image loaded in workarea.\");\n return;\n }else if(labellingData[ imgSelected.name ].shapes.length === 0){\n showSnackBar(\"You need to label the currently loaded image.\");\n return;\n }else{\n var data = pascalVocFormater.toPascalVOC();\n askFileName(Object.keys(labellingData[ imgSelected.name ].shapes.length ).length + \"_pvoc_imglab.xml\", function(fileName){\n analytics_reportExportType(\"pascal_voc\");\n download(data, fileName, \"text/xml\", \"utf-8\");\n });\n }\n\n}", "function main() {\r\n\r\n var exportInfo = new Object();\r\n initExportInfo(exportInfo);\r\n try {\r\n var docName = app.activeDocument.name; // save the app.activeDocument name before duplicate.\r\n var compsName = new String(\"none\");\r\n var compsCount = app.activeDocument.layerComps.length;\r\n if ( compsCount < 1 ) {\r\n if ( DialogModes.NO != app.playbackDisplayDialogs ) {\r\n alert ( strAlertNoLayerCompsFound );\r\n }\r\n\t \treturn 'cancel'; // quit, returning 'cancel' (dont localize) makes the actions palette not record our script\r\n } else {\r\n app.activeDocument = app.documents[docName];\r\n docRef = app.activeDocument;\r\n \r\n\r\n app.preferences.maximizeCompatibility = QueryStateType.ALWAYS ;\r\n for ( compsIndex = 0; compsIndex < compsCount; compsIndex++ ) {\r\n var compRef = docRef.layerComps[ compsIndex ];\r\n if (exportInfo.selectionOnly && !compRef.selected) continue; // selected only\r\n compRef.apply();\r\n var duppedDocument = app.activeDocument.duplicate();\r\n var fileNameBody = exportInfo.fileNamePrefix;\r\n fileNameBody += \"_\" + zeroSuppress(compsIndex, 4);\r\n fileNameBody += \"_\" + compRef.name;\r\n if (null != compRef.comment) fileNameBody += \"_\" + compRef.comment;\r\n fileNameBody = fileNameBody.replace(/[:\\/\\\\*\\?\\\"\\<\\>\\|\\\\\\r\\\\\\n]/g, \"_\"); // '/\\:*?\"<>|\\r\\n' -> '_'\r\n if (fileNameBody.length > 120) fileNameBody = fileNameBody.substring(0,120);\r\n saveFile(duppedDocument, fileNameBody, exportInfo);\r\n duppedDocument.close(SaveOptions.DONOTSAVECHANGES);\r\n }\r\n\r\n\r\n\r\n\r\n \r\n if ( DialogModes.ALL == app.playbackDisplayDialogs ) {\r\n alert(strTitle + strAlertWasSuccessful);\r\n }\r\n\r\n app.playbackDisplayDialogs = DialogModes.ALL;\r\n\r\n }\r\n } \r\n catch (e) {\r\n if ( DialogModes.NO != app.playbackDisplayDialogs ) {\r\n alert(e);\r\n }\r\n \treturn 'cancel'; // quit, returning 'cancel' (dont localize) makes the actions palette not record our script\r\n }\r\n\r\n}", "function DisplayWord() {\n\tvar wordToPrint : String;\n\tvar hWord : GameObject;\n\t//var offset : float;\n\tswitch(this.kana) {\n\t\tcase \"a\":\n\t\t\twordToPrint = \"あ り\";\n\t\tbreak;\n\t\t\n\t\tcase \"i\":\n\t\t\twordToPrint = \"い な ず ま\";\n\t\tbreak;\n\t\t\n\t\tcase \"u\":\n\t\t\twordToPrint = \"う さ ぎ\";\n\t\tbreak;\n\t\t\t\t\t\n\t\tcase \"e\":\n\t\t\twordToPrint = \"え ん\";\n\t\tbreak;\n\t\t\t\n\t\tcase \"o\":\n\t\t\twordToPrint = \"お す\";\n\t\tbreak;\n\t\t\t\n\t\tcase \"ka\":\n\t\t\twordToPrint = \"か た な\";\n\t\tbreak;\n\t\t\t\n\t\tcase \"ki\":\n\t\t\twordToPrint = \"き り か ぶ\";\n\t\tbreak;\n\t\t\t\n\t\tcase \"ku\":\n\t\t\twordToPrint = \"く さ り\";\n\t\tbreak;\n\t\t\t\n\t\tcase \"ke\":\n\t\t\twordToPrint = \"け る\";\n\t\tbreak;\n\t\t\t\n\t\tcase \"ko\":\n\t\t\twordToPrint = \"こ ぶ し\";\n\t\tbreak;\n\t\t\n\t\tdefault:\n\t\t\t;\n\t\t\t\t\n\t}\n\t//hWord = Instantiate(this.word, this.player.transform.position, Quaternion.identity);\n\t//offset = .005 * wordToPrint.Length;\n\thWord = Instantiate(this.word, new Vector3(0.45, 0.6, -8), Quaternion.identity);\n\thWord.guiText.text = wordToPrint;\n}", "function getObjString() {\n\tlet objString = \"# cube.obj\\r\\n#\\r\\n\\r\\nmtllib \" + fileName + \".mtl\\r\\n\\r\\ng cube\\r\\n\\r\\n\";\n\tfor (let v=0;v<objVertices.length;v++) {\n\t\tlet vert = objVertices[v];\n\t\tobjString += `v ${vert[0]} ${vert[1]} ${vert[2]}\\r\\n`;\n\t}\n\tfor (let m=0;m<objMtl.length;m++)\n\t{\n\t\tobjString += `g ${objMtl[m][1]}\\r\\nusemtl ${objMtl[m][1]}\\r\\n`;\n\t\tfor (let p=0;p<objMtl[m][2].length;p++)\n\t\t{\n\t\t\tlet offset = objMtl[m][2][p];\n\t\t\tfor (let side=0;side<6;side++)\n\t\t\t{\n\t\t\t\tlet face = objFaces[offset+side];\n\t\t\t\tobjString += `f ${face[0]} ${face[1]} ${face[2]} ${face[3]}\\r\\n`;\n\t\t\t}\n\t\t}\n\t}\n\treturn objString;\n}", "function exportLoom()\n{\n let width = parseInt(Math.floor(win.getBounds()[\"width\"] / 2) * 2);\n let height = parseInt(Math.floor(win.getBounds()[\"height\"] / 2) * 2);\n let window_size = width + \":\" + height;\n let cmd =\n process.platform === \"win32\"\n ? \"generate_loom.bat \"\n : \"./generate_loom.sh \";\n spawn(cmd + window_size + \" \" + GC.initial_video_path, function(output) {\n console.log(output);\n });\n}", "function writePlayer() {\n\t\t\t\t\n\t\t\t\t// in case of multiple embedded players\n\t\t\t\tvar pID = Math.round(Math.random()*1000000);\n\t\t\t\t \n \t\tvar HTML_anchorOpenStart = \"<a href=\\\"\";\n \t\tvar HTML_anchorOpenEnd = \"\\\" target=\\\"new\\\" style=\\\"display:inline\\\">\";\n \t\tvar HTML_iconImageTag = \"<img src=\\\"http://graphics8.nytimes.com/images/multimedia/icons/audio_icon.gif\\\" height=\\\"10\\\" width=\\\"13\\\">\";\n \t\tvar HTML_anchorClose = \"</a>\";\n \t\tvar HTML_beforeMP3 = \"&nbsp;(\";\n \t\tvar HTML_MP3 = \"mp3\";\n \t\tvar HTML_afterMP3 = \")\";\n \t\tvar HTML_br = \"<br/>\"\n\t\t\t\t\n\t\t\t\t//var htmlStr = \"\\<script src=\\\"http://graphics8.nytimes.com/packages/html/multimedia/js/swfobject.js\\\"\\>\\</script\\>\\n\"; \n\t\t\t\t\n\t\t\t\tvar htmlStr = \"<style type='text/css'>.refer .inlinePlayer .refer{font-size:1em}</style>\";\n\t\t\t\t\n\t\t\t\t//htmlStr += \"<style type=\\\"text/css\\\">\\n\";\n\t\t\t\t//htmlStr += \"html>body .outerInlinePlayer, html>body .inlinePlayer { display: inline-block; }\\n\";\n\t\t\t\t//htmlStr += \"body:first-of-type .outerInlinePlayer, body:first-of-type .inlinePlayer { display: block; }\\n\";\n\t\t\t\t//htmlStr += \".inlinePlayer { overflow: auto; }\\n\";\n\t\t\t\t//htmlStr += \"</style>\\n\";\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//htmlStr += \"\\<div class=\\\"outerInlinePlayer\\\" style=\\\"padding:0; margin:0;\\\"\\>\"\n\t\t\t\thtmlStr += \"\\<div class=\\\"inlinePlayer box\\\"\\>\"\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(mm.IU != \"\") {\n\t\t\t\t\thtmlStr += \"<div class=\\\"story\\\"><div class=\\\"callout\\\"><img src=\\\"\";\n \t\t\thtmlStr += mm.IU;\n \t\t\thtmlStr += \"\\\" alt=\\\"\\\"></div></div>\";\n \t\t}\n\n\t\t\t\thtmlStr += \"<div class='refer'>\";\n\t\t\t\t\n\t\t\t\tif((mm.DI == true) || (mm.DI == \"true\")) {\n \n\t\t\t\t\t\t// we are. See if we are linking it to the audio.\n \t\t\tif((mm.LI == true) || (mm.LI == \"true\")) {\n \n\t\t\t\t\t\t\t\t// add link begin\n\t\t\t\t\n \t\t\t\thtmlStr += HTML_anchorOpenStart;\n\n // add URL\n \t\t\t\thtmlStr += mm.AU;\n\n // add link end\n \t\t\t\thtmlStr += HTML_anchorOpenEnd;\n\n // add icon image\n \t\t\t\thtmlStr += HTML_iconImageTag;\n\n // add close of link\n \t\t\t\thtmlStr += HTML_anchorClose;\n \t\t\t} else {\n \n\t\t\t\t\t\t\thtmlStr += HTML_iconImageTag;\n \t\t\t}\n\n \t\t// add a space after the image\n \t\thtmlStr += \"&nbsp;\";\n \t\t}\n\n \t\t// if there is a headline, add it.\n \t\tif((mm.AH != null) && (mm.AH != \"\")) {\n \n\t\t\t\t\t\t// add the headline.\n \t\t\thtmlStr += mm.AH;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif((mm.LI == true) || (mm.LI == \"true\")) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// add the \"(mp3)\" with the \"mp3\" linked to the audio file.\n\t\t\t\t\t\t\thtmlStr += HTML_beforeMP3;\n\t\t\t\t\t\t\thtmlStr += HTML_anchorOpenStart;\n\t\t\t\t\t\t\thtmlStr += mm.AU;\n\t\t\t\t\t\t\thtmlStr += HTML_anchorOpenEnd;\n\t\t\t\t\t\t\thtmlStr += HTML_MP3;\n\t\t\t\t\t\t\thtmlStr += HTML_anchorClose;\n\t\t\t\t\t\t\thtmlStr += HTML_afterMP3;\n\t\t\t\t\t\t}\n \t\t}\n\t\t\t\t\n\t\t\t\thtmlStr+=\"\\</div>\";\n\t\t\t\tif(mm.ID == null || mm.ID == \"\") {\n\t\t\t\t\thtmlStr+=\"\\<div id=\\\"p\"+pID+\"\\\" style=\\\"margin:0;padding:0;width:100%;height:25;\\\">\\</div\\>\\n\";\n\t\t\t\t}\n\t\t\t\thtmlStr+=\"\\</div\\>\\n\";\n\t\t\t\t\n\t\t\t\t//htmlStr+=\"\\<script src=\\\"http://graphics8.nytimes.com/packages/html/multimedia/js/NYTInlineEmbed.js\\\" \\>\\</script\\>\\n\";\n\t\t\t\t//htmlStr+=\"\\<script\\>embedNYTInline(\\\"\"+audioURL+\"\\\",\\\"\"+audioDuration+\"\\\",\\\"p\"+pID+\"\\\");\\</script\\>\";\n\t\t\t\t\n\t\t\t\t\n\t\t\t\thtmlStr+=\"\\<script\\>\\n\";\n\t\t\t\thtmlStr+=\"var so = new SWFObject(\\\"\"+loaderURL+\"\\\", \\\"p\"+pID+\"\\\", \\\"100%\\\", \\\"25\\\", \\\"8\\\", \\\"#FFFFFF\\\");\\n\";\n\t\t\t\t\n\t\t\t\thtmlStr+=\"so.addVariable(\\\"mp3\\\",\\\"\"+mm.AU+\"\\\")\\n\";\n\t\t\t\thtmlStr+=\"so.addVariable(\\\"duration\\\",\\\"\"+mm.AD+\"\\\")\\n\";\n\t\t\t\thtmlStr+=\"so.addVariable(\\\"contentPath\\\",\\\"\"+playerURL+\"\\\")\\n\";\n\t\t\t\thtmlStr+=\"so.addParam(\\\"allowScriptAccess\\\", \\\"always\\\");\\n\";\n\t\t\t\thtmlStr+=\"so.addParam(\\\"wmode\\\", \\\"opaque\\\");\\n\";\n\t\t\t\n\t\t\t\tif(mm.ID == null || mm.ID == \"\") {\n\t\t\t\t\thtmlStr+=\"so.write(\\\"p\"+pID+\"\\\");\\n\\</script\\>\";\n\t\t\t\t} else {\n\t\t\t\t\thtmlStr+=\"so.write(\\\"\"+mm.ID+\"\\\");\\n\\</script\\>\";\n\t\t\t\t}\n\t\t\n\t\t\t\t//tf.value = htmlStr;\n\t\t\t\tif(!(document.location.search==\"?noflash\")) { document.write(htmlStr); }\n\t\t}", "function showFileContent(file) {\n filewrapper.style.display = 'block'\n filename.innerHTML = file.name\n filewrapper.style.color = 'green'\n filewrapper.classList.add('animation');\n}", "function onClickCreateIso(value) {\n\tif (!value)\n\t\treturn;\n\tif (value.indexOf(\"?\") >= 0)\n\t\tmessageMsg(\"Select or drag-drop your density cube or JVXL file onto the 'browse' button, then press the 'load' button.\");\n\tcreateSurface(value, true);\n}", "function SafariFlashPopup() {\r\n self.name = \"safaripopupparent\";\r\n\r\n newwindow2=window.open('','flashDemo1','height=550,width=750,top=200,left=200');\r\n var tmp = newwindow2.document;\r\n tmp.write('<html><head><title>Safari Flash Demo</title>');\r\n tmp.write('<style type=\"text/css\">body{padding: 10px;background:#000;color:#FFF;font-family:verdana,sans-serif;font-size:11px;}a{color:#FFF;text-decoration:none;font-weight:bold;}a:hover{text-decoration:underline;}</style>');\r\n tmp.write('</head><body><iframe id=\"demoflash\" src=\"http://www.safaribooksonline.com/\" width=\"700\" height=\"450\" marginwidth=\"0\" marginheight=\"0\" hspace=\"0\" vspace=\"0\" frameborder=\"1\" scrolling=\"no\"></iframe>');\r\n tmp.write('<p><a href=\"javascript:self.close();\">Close Window</a></p>');\r\n tmp.write('</body></html>');\r\n tmp.close();\r\n}", "function _getObjectHTML(url, type, dims, classid) {\n\t\treturn '<object' + _getAsAttributeList($.extend({\n\t\t\t\tclassid: 'clsid:' + classid\n\t\t\t}, dims)) + '>' +\n\t\t\t_getAsParameterList({\n\t\t\t\tmovie: url\n\t\t\t}) +\n\t\t\t'<!--[if IE lt 9]>--><object' + _getAsAttributeList($.extend({\n\t\t\t\ttype: type,\n\t\t\t\tdata: url\n\t\t\t}, dims)) + '></object><!--<![endif]-->' +\n\t\t'</object>';\n\t}", "function GetSwfVer(){\r\n\t// NS/Opera version >= 3 check for Flash plugin in plugin array\r\n\tvar flashVer = -1;\r\n\t\r\n\tif (navigator.plugins != null && navigator.plugins.length > 0) {\r\n\t\tif (navigator.plugins[\"Shockwave Flash 2.0\"] || navigator.plugins[\"Shockwave Flash\"]) {\r\n\t\t\tvar swVer2 = navigator.plugins[\"Shockwave Flash 2.0\"] ? \" 2.0\" : \"\";\r\n\t\t\tvar flashDescription = navigator.plugins[\"Shockwave Flash\" + swVer2].description;\r\n\t\t\tvar descArray = flashDescription.split(\" \");\r\n\t\t\tvar tempArrayMajor = descArray[2].split(\".\");\t\t\t\r\n\t\t\tvar versionMajor = tempArrayMajor[0];\r\n\t\t\tvar versionMinor = tempArrayMajor[1];\r\n\t\t\tvar versionRevision = descArray[3];\r\n\t\t\tif (versionRevision == \"\") {\r\n\t\t\t\tversionRevision = descArray[4];\r\n\t\t\t}\r\n\t\t\tif (versionRevision[0] == \"d\") {\r\n\t\t\t\tversionRevision = versionRevision.substring(1);\r\n\t\t\t} else if (versionRevision[0] == \"r\") {\r\n\t\t\t\tversionRevision = versionRevision.substring(1);\r\n\t\t\t\tif (versionRevision.indexOf(\"d\") > 0) {\r\n\t\t\t\t\tversionRevision = versionRevision.substring(0, versionRevision.indexOf(\"d\"));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar flashVer = versionMajor + \".\" + versionMinor + \".\" + versionRevision;\r\n\t\t}\r\n\t}\r\n\t// MSN/WebTV 2.6 supports Flash 4\r\n\telse if (navigator.userAgent.toLowerCase().indexOf(\"webtv/2.6\") != -1) flashVer = 4;\r\n\t// WebTV 2.5 supports Flash 3\r\n\telse if (navigator.userAgent.toLowerCase().indexOf(\"webtv/2.5\") != -1) flashVer = 3;\r\n\t// older WebTV supports Flash 2\r\n\telse if (navigator.userAgent.toLowerCase().indexOf(\"webtv\") != -1) flashVer = 2;\r\n\telse if ( isIE && isWin && !isOpera ) {\r\n\t\tflashVer = ControlVersion();\r\n\t}\t\r\n\treturn flashVer;\r\n}", "function GetSwfVer(){\r\n\t// NS/Opera version >= 3 check for Flash plugin in plugin array\r\n\tvar flashVer = -1;\r\n\t\r\n\tif (navigator.plugins != null && navigator.plugins.length > 0) {\r\n\t\tif (navigator.plugins[\"Shockwave Flash 2.0\"] || navigator.plugins[\"Shockwave Flash\"]) {\r\n\t\t\tvar swVer2 = navigator.plugins[\"Shockwave Flash 2.0\"] ? \" 2.0\" : \"\";\r\n\t\t\tvar flashDescription = navigator.plugins[\"Shockwave Flash\" + swVer2].description;\r\n\t\t\tvar descArray = flashDescription.split(\" \");\r\n\t\t\tvar tempArrayMajor = descArray[2].split(\".\");\t\t\t\r\n\t\t\tvar versionMajor = tempArrayMajor[0];\r\n\t\t\tvar versionMinor = tempArrayMajor[1];\r\n\t\t\tvar versionRevision = descArray[3];\r\n\t\t\tif (versionRevision == \"\") {\r\n\t\t\t\tversionRevision = descArray[4];\r\n\t\t\t}\r\n\t\t\tif (versionRevision[0] == \"d\") {\r\n\t\t\t\tversionRevision = versionRevision.substring(1);\r\n\t\t\t} else if (versionRevision[0] == \"r\") {\r\n\t\t\t\tversionRevision = versionRevision.substring(1);\r\n\t\t\t\tif (versionRevision.indexOf(\"d\") > 0) {\r\n\t\t\t\t\tversionRevision = versionRevision.substring(0, versionRevision.indexOf(\"d\"));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar flashVer = versionMajor + \".\" + versionMinor + \".\" + versionRevision;\r\n\t\t}\r\n\t}\r\n\t// MSN/WebTV 2.6 supports Flash 4\r\n\telse if (navigator.userAgent.toLowerCase().indexOf(\"webtv/2.6\") != -1) flashVer = 4;\r\n\t// WebTV 2.5 supports Flash 3\r\n\telse if (navigator.userAgent.toLowerCase().indexOf(\"webtv/2.5\") != -1) flashVer = 3;\r\n\t// older WebTV supports Flash 2\r\n\telse if (navigator.userAgent.toLowerCase().indexOf(\"webtv\") != -1) flashVer = 2;\r\n\telse if ( isIE && isWin && !isOpera ) {\r\n\t\tflashVer = ControlVersion();\r\n\t}\t\r\n\treturn flashVer;\r\n}", "function exportIt() {\n\n\t\talert('The Export-Feature is currently being implemented. When finished, it will give you a handy ZIP file which includes a standalone version of your Hypervideo.');\n\n\t}", "function MJ_textSwapper(thisObj) {\r try{\r var textSwapper = {};\r textSwapper.doc = app.activeDocument;\r textSwapper.imagesFolder = null;\r textSwapper.files = null;\r textSwapper.textObjs = [];\r textSwapper.imageSize = 60;\r textSwapper.swappedCounter = 0;\r textSwapper.targetLayer = textSwapper.doc.layers.getByName(\"new images\");\r //textSwapper.oldLayer = textSwapper.doc.layers.getByName(\"old images\");\r textSwapper.sourceLayer = textSwapper.doc.layers.getByName(\"bases\");\r \r textSwapper.sourceFolder = Folder.selectDialog(\"Select the folder with your images.\");\r if ((textSwapper.sourceFolder !== null) && textSwapper.sourceFolder.exists)\r {\r textSwapper.imagesFolder = textSwapper.sourceFolder;\r } else {return alert(\"Please select a source folder to use this script.\")}\r textSwapper.files = textSwapper.imagesFolder.getFiles();\r \r if (textSwapper.sourceLayer.textFrames.length) {\r textSwapper.textObjs = textSwapper.sourceLayer.textFrames;\r } else { return alert(\"Please select a layer with text layers.\");}\r \r for (var i = 0; i < textSwapper.textObjs.length; i++) {\r var t = textSwapper.textObjs[i];\r var tc = t.contents.replace(/\\s+/g, ''); // removes white space from the text in the text objects\r var newImg;\r for (var f = 0; f < textSwapper.files.length; f++) {\r var filename = textSwapper.files[f].name.toLowerCase();\r var n = filename.substr(0,filename.indexOf(\"_\"));\r //alert(n+\" is \"+tc+\" \");\r if (tc.toLowerCase() === n){\r //alert(\"matched \"+n);\r var s = textSwapper.imageSize;\r var poly = textSwapper.targetLayer.pathItems.rectangle( t.top, t.left, s, s );\r poly.fillColor.red = 255;\r poly.fillColor.blue = 255;\r poly.fillColor.green = 255;\r poly.stroked = false;\r newImg = textSwapper.targetLayer.placedItems.add();\r newImg.file = textSwapper.files[f];\r newImg.left = t.left;\r newImg.top = t.top;\r newImg.height = s;\r newImg.width = s;\r textSwapper.swappedCounter++;\r textSwapper.files.splice(f,1);\r break;\r }\r }\r }\r return alert(\"Placed \"+textSwapper.swappedCounter+\" images.\");\r } catch(e) {alert(e+\"\\r\"+e.line)}\r}", "function embedFlash(gb_whichElement) {\n while (gb_whichElement.id.indexOf('_toolbar') == -1) {\n \tgb_whichElement = gb_whichElement.parentNode;\n }\n fieldID = gb_whichElement.id;\n fieldID = fieldID.substring(0,fieldID.indexOf('_toolbar'));\n RTE_SaveSelection(fieldID);\n var generator=window.open('','question','height=300,width=300,scrollbar=no,menu=no,toolbar=no,status=no,location=no');\n generator.document.write('<html><head><title>'+erte_lang[0]+'</title>' + \n '<script type=\"text/javascript\">function insertFlash() { \\n' + \n 'var finalString = \"<span class=erte_embed id=\" \\n' + \n 'finalString += escape(document.getElementById(\"embed\").innerText) \\n' + \n 'finalString += \">\" \\n' + \n 'finalString += document.getElementById(\"alt\").value\\n' + \n 'finalString += \"</span>\"\\n' + \n 'window.opener.RTE_GetSelection(document.getElementById(\"field\").value).pasteHTML(finalString)\\n' + \n 'window.close()\\n;' +\n '}'+\"<\\/script>\" +\n '</head><body style=\"margin:10px; font-family: verdana; font-size: 10px;\">' + \n '<strong>'+erte_lang[1]+':</strong> <input id=\"alt\" type=\"text\" style=\"border: 1px black solid; width: 200px; font-family: verdana; font-size: 10px;\"/><br/><span style=\"color: gray\">('+erte_lang[2]+')</span>' + \n '<br/> <br/><strong>'+erte_lang[3]+':</strong><br/>' + \n '<textarea id=\"embed\" style=\"width: 250px; height: 100px; border: 1px black solid; font-family: verdana; font-size: 10px;\"></textarea>' + \n '<br/><span style=\"color: gray\">('+erte_lang[4]+')</span><br/>' +\n '<input type=\"hidden\" id=\"field\" value=\"'+fieldID+'\"' + \n '<br/> <br/><button style=\"font-family: verdana; font-size: 10px;\" onclick=\"insertFlash()\">'+erte_lang[5]+'</button>' +\n '&nbsp;&nbsp;<button style=\"font-family: verdana; font-size: 10px;\" onclick=\"window.close()\">'+erte_lang[6]+'</button>' + \n '</body></html>');\n generator.document.close();\n}", "function GetSwfVer() {\n // NS/Opera version >= 3 check for Flash plugin in plugin array\n var flashVer = -1;\n\n if (navigator.plugins != null && navigator.plugins.length > 0) {\n if (navigator.plugins[\"Shockwave Flash 2.0\"] || navigator.plugins[\"Shockwave Flash\"]) {\n var swVer2 = navigator.plugins[\"Shockwave Flash 2.0\"] ? \" 2.0\" : \"\";\n var flashDescription = navigator.plugins[\"Shockwave Flash\" + swVer2].description;\n var descArray = flashDescription.split(\" \");\n var tempArrayMajor = descArray[2].split(\".\");\n var versionMajor = tempArrayMajor[0];\n var versionMinor = tempArrayMajor[1];\n var versionRevision = descArray[3];\n if (versionRevision == \"\") {\n versionRevision = descArray[4];\n }\n if (versionRevision[0] == \"d\") {\n versionRevision = versionRevision.substring(1);\n } else if (versionRevision[0] == \"r\") {\n versionRevision = versionRevision.substring(1);\n if (versionRevision.indexOf(\"d\") > 0) {\n versionRevision = versionRevision.substring(0, versionRevision.indexOf(\"d\"));\n }\n }\n var flashVer = versionMajor + \".\" + versionMinor + \".\" + versionRevision;\n }\n }\n // MSN/WebTV 2.6 supports Flash 4\n else if (navigator.userAgent.toLowerCase().indexOf(\"webtv/2.6\") != -1) flashVer = 4;\n // WebTV 2.5 supports Flash 3\n else if (navigator.userAgent.toLowerCase().indexOf(\"webtv/2.5\") != -1) flashVer = 3;\n // older WebTV supports Flash 2\n else if (navigator.userAgent.toLowerCase().indexOf(\"webtv\") != -1) flashVer = 2;\n else if (isIE && isWin && !isOpera) {\n flashVer = ControlVersion();\n }\n return flashVer;\n}", "function exportLocalShowfile() {\n\tvar showText = Timeline.tracksToShowfile();\n\t\n\tvar saveName = Timeline.projectData.id;\n\tif(saveName == \"\") saveName = \"untitled\";\n\t\n\tdownloadPlaintext(saveName + \".txt\", showText);\n}", "function ksPeekHw(iHwId , sTitle){\n var iframeurl = \"http://docs.google.com/gview?url=http://\"+ window.location.host + \"/filemanager/downloadhw/id/\"+ iHwId +\"&embedded=true\";\n $(\"#peeking_iframe\").html(\"\");\n $('<iframe />', {\n name: 'myFrame',\n id: 'myFrame',\n src: iframeurl,\n width: \"100%\",\n height: \"100%\"\n }).appendTo('#peeking_iframe');\n $('#glassnoloading').fadeIn('fast');\n $(\"#peeking\").css('display' , 'block');\n $('#peeking * h2').text(sTitle);\n}", "function GetSwfVer() {\n // NS/Opera version >= 3 check for Flash plugin in plugin array\n var flashVer = -1;\n\n if (navigator.plugins != null && navigator.plugins.length > 0) {\n if (navigator.plugins[\"Shockwave Flash 2.0\"] || navigator.plugins[\"Shockwave Flash\"]) {\n var swVer2 = navigator.plugins[\"Shockwave Flash 2.0\"] ? \" 2.0\" : \"\";\n var flashDescription = navigator.plugins[\"Shockwave Flash\" + swVer2].description;\n var descArray = flashDescription.split(\" \");\n var tempArrayMajor = descArray[2].split(\".\");\n var versionMajor = tempArrayMajor[0];\n var versionMinor = tempArrayMajor[1];\n var versionRevision = descArray[3];\n if (versionRevision == \"\") {\n versionRevision = descArray[4];\n }\n if (versionRevision[0] == \"d\") {\n versionRevision = versionRevision.substring(1);\n } else if (versionRevision[0] == \"r\") {\n versionRevision = versionRevision.substring(1);\n if (versionRevision.indexOf(\"d\") > 0) {\n versionRevision = versionRevision.substring(0, versionRevision.indexOf(\"d\"));\n }\n }\n var flashVer = versionMajor + \".\" + versionMinor + \".\" + versionRevision;\n\n }\n }\n // MSN/WebTV 2.6 supports Flash 4\n else if (navigator.userAgent.toLowerCase().indexOf(\"webtv/2.6\") != -1) flashVer = 4;\n // WebTV 2.5 supports Flash 3\n else if (navigator.userAgent.toLowerCase().indexOf(\"webtv/2.5\") != -1) flashVer = 3;\n // older WebTV supports Flash 2\n else if (navigator.userAgent.toLowerCase().indexOf(\"webtv\") != -1) flashVer = 2;\n else if (isIE && isWin && !isOpera) {\n flashVer = ControlVersion();\n }\n return flashVer;\n}", "function ExportSave() {\n Gameboy.Core.exportSave();\n}", "function soapboxgetimagefilename(nrating){\r\n return \"sbrating\" + nrating + \".bmp\";\r\n}", "function main() { //入口函数\n\tvar docName = '',\n\t\tdupDoc,\n\t\texportInfo = {},\n\t\tlayerCount = 0,\n\t\tlayerSetsCount = 0;\n\n\tif (app.documents.length <= 0) {\n\t\tif (DialogModes.NO != app.playbackDisplayDialogs) {\n\t\t\talert(strAlertDocumentMustBeOpened);\n\t\t}\n\t\treturn 'cancel'; // quit, returning 'cancel' (dont localize) makes the actions palette not record our script\n\t}\n\n\tinitExportInfo(exportInfo);\n\n\t// kpedt this was where descriptorToObject calls were in 'Export layers to files.jsx'\n\n\tif (DialogModes.ALL == app.playbackDisplayDialogs) {\n\t\tif (cancelButtonID == settingDialog(exportInfo)) {\n\t\t\treturn 'cancel'; // quit, returning 'cancel' (dont localize) makes the actions palette not record our script\n\t\t}\n\t}\n\n\ttry {\n\n\t\tdocName = app.activeDocument.name; // save the app.activeDocument name before duplicate.\n\n\t\tlayerCount = app.documents[docName].layers.length;\n\t\tlayerSetsCount = app.documents[docName].layerSets.length;\n\n\t\tif ((layerCount <= 1) && (layerSetsCount <= 0)) {\n\n\t\t\tif (DialogModes.NO != app.playbackDisplayDialogs) {\n\t\t\t\talert(strAlertNeedMultipleLayers);\n\t\t\t\treturn 'cancel'; // quit, returning 'cancel' (dont localize) makes the actions palette not record our script\n\t\t\t}\n\t\t} else {\n\n\t\t\tapp.activeDocument = app.documents[docName];\n\n\t\t\tsetExportHeader(app.activeDocument, exportInfo);\n\n\t\t\tdupDoc = app.activeDocument.duplicate();\n\n\t\t\tungroupAllLayerSets(dupDoc);\n\n\t\t\tremoveInvisibleArtLayers(dupDoc);\n\n\t\t\tdupDoc.activeLayer = dupDoc.layers[dupDoc.layers.length - 1];\n\n\t\t\tsetInvisibleAllArtLayers(dupDoc);\n\t\t\texportChildren(dupDoc, exportInfo);\n\t\t\tdupDoc.close(SaveOptions.DONOTSAVECHANGES);\n\n\t\t\tif (DialogModes.ALL == app.playbackDisplayDialogs) {\n\n\t\t\t\twriteTxtFiles();\n\t\t\t\tapp.preferences.rulerUnits = originalUnit;\n\n\t\t\t\talert('导出IMG/CSS/HTML' + strAlertWasSuccessful);\n\t\t\t}\n\n\t\t\tapp.playbackDisplayDialogs = DialogModes.ALL;\n\t\t}\n\n\t} catch (e1) {\n\t\tif (DialogModes.NO != app.playbackDisplayDialogs) {\n\t\t\talert(e1);\n\t\t}\n\n\t\tapp.preferences.rulerUnits = originalUnit;\n\n\t\treturn 'cancel'; // quit, returning 'cancel' (dont localize) makes the actions palette not record our script\n\t}\n}", "function GetSwfVer(){\r\n\t// NS/Opera version >= 3 check for Flash plugin in plugin array\r\n\tvar flashVer = -1;\r\n\r\n\tif (navigator.plugins != null && navigator.plugins.length > 0) {\r\n\t\tif (navigator.plugins[\"Shockwave Flash 2.0\"] || navigator.plugins[\"Shockwave Flash\"]) {\r\n\t\t\tvar swVer2 = navigator.plugins[\"Shockwave Flash 2.0\"] ? \" 2.0\" : \"\";\r\n\t\t\tvar flashDescription = navigator.plugins[\"Shockwave Flash\" + swVer2].description;\r\n\t\t\tvar descArray = flashDescription.split(\" \");\r\n\t\t\tvar tempArrayMajor = descArray[2].split(\".\");\t\t\t\r\n\t\t\tvar versionMajor = tempArrayMajor[0];\r\n\t\t\tvar versionMinor = tempArrayMajor[1];\r\n\t\t\tvar versionRevision = descArray[3];\r\n\t\t\tif (versionRevision == \"\") {\r\n\t\t\t\tversionRevision = descArray[4];\r\n\t\t\t}\r\n\t\t\tif (versionRevision[0] == \"d\") {\r\n\t\t\t\tversionRevision = versionRevision.substring(1);\r\n\t\t\t} else if (versionRevision[0] == \"r\") {\r\n\t\t\t\tversionRevision = versionRevision.substring(1);\r\n\t\t\t\tif (versionRevision.indexOf(\"d\") > 0) {\r\n\t\t\t\t\tversionRevision = versionRevision.substring(0, versionRevision.indexOf(\"d\"));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar flashVer = versionMajor + \".\" + versionMinor + \".\" + versionRevision;\r\n\t\t}\r\n\t}\r\n\t// MSN/WebTV 2.6 supports Flash 4\r\n\telse if (navigator.userAgent.toLowerCase().indexOf(\"webtv/2.6\") != -1) flashVer = 4;\r\n\t// WebTV 2.5 supports Flash 3\r\n\telse if (navigator.userAgent.toLowerCase().indexOf(\"webtv/2.5\") != -1) flashVer = 3;\r\n\t// older WebTV supports Flash 2\r\n\telse if (navigator.userAgent.toLowerCase().indexOf(\"webtv\") != -1) flashVer = 2;\r\n\telse if ( isIE && isWin && !isOpera ) {\r\n\t\tflashVer = ControlVersion();\r\n\t}\t\r\n\t\r\n\treturn flashVer;\r\n}", "function GetSwfVer(){\n\t// NS/Opera version >= 3 check for Flash plugin in plugin array\n\tvar flashVer = -1;\n\t\n\tif (navigator.plugins != null && navigator.plugins.length > 0) {\n\t\tif (navigator.plugins[\"Shockwave Flash 2.0\"] || navigator.plugins[\"Shockwave Flash\"]) {\n\t\t\tvar swVer2 = navigator.plugins[\"Shockwave Flash 2.0\"] ? \" 2.0\" : \"\";\n\t\t\tvar flashDescription = navigator.plugins[\"Shockwave Flash\" + swVer2].description;\n\t\t\tvar descArray = flashDescription.split(\" \");\n\t\t\tvar tempArrayMajor = descArray[2].split(\".\");\t\t\t\n\t\t\tvar versionMajor = tempArrayMajor[0];\n\t\t\tvar versionMinor = tempArrayMajor[1];\n\t\t\tvar versionRevision = descArray[3];\n\t\t\tif (versionRevision == \"\") {\n\t\t\t\tversionRevision = descArray[4];\n\t\t\t}\n\t\t\tif (versionRevision[0] == \"d\") {\n\t\t\t\tversionRevision = versionRevision.substring(1);\n\t\t\t} else if (versionRevision[0] == \"r\") {\n\t\t\t\tversionRevision = versionRevision.substring(1);\n\t\t\t\tif (versionRevision.indexOf(\"d\") > 0) {\n\t\t\t\t\tversionRevision = versionRevision.substring(0, versionRevision.indexOf(\"d\"));\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar flashVer = versionMajor + \".\" + versionMinor + \".\" + versionRevision;\n\t\t\t//alert(\"flashVer=\"+flashVer);\n\t\t}\n\t}\n\t// MSN/WebTV 2.6 supports Flash 4\n\telse if (navigator.userAgent.toLowerCase().indexOf(\"webtv/2.6\") != -1) flashVer = 4;\n\t// WebTV 2.5 supports Flash 3\n\telse if (navigator.userAgent.toLowerCase().indexOf(\"webtv/2.5\") != -1) flashVer = 3;\n\t// older WebTV supports Flash 2\n\telse if (navigator.userAgent.toLowerCase().indexOf(\"webtv\") != -1) flashVer = 2;\n\telse if ( isIE && isWin && !isOpera ) {\n\t\tflashVer = ControlVersion();\n\t}\t\n\treturn flashVer;\n}", "function setName() {\n\n document.getElementById(\"prog\").innerHTML = fileName;\n\n}", "function GetSwfVer() {\n // NS/Opera version >= 3 check for Flash plugin in plugin array\n var flashVer = -1;\n\n if (navigator.plugins != null && navigator.plugins.length > 0) {\n if (navigator.plugins[\"Shockwave Flash 2.0\"] || navigator.plugins[\"Shockwave Flash\"]) {\n var swVer2 = navigator.plugins[\"Shockwave Flash 2.0\"] ? \" 2.0\" : \"\";\n var flashDescription = navigator.plugins[\"Shockwave Flash\" + swVer2].description;\n var descArray = flashDescription.split(\" \");\n var tempArrayMajor = descArray[2].split(\".\");\n var versionMajor = tempArrayMajor[0];\n var versionMinor = tempArrayMajor[1];\n if (descArray[3] != \"\") {\n tempArrayMinor = descArray[3].split(\"r\");\n } else {\n tempArrayMinor = descArray[4].split(\"r\");\n }\n var versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;\n var flashVer = versionMajor + \".\" + versionMinor + \".\" + versionRevision;\n }\n }\n // MSN/WebTV 2.6 supports Flash 4\n else if (navigator.userAgent.toLowerCase().indexOf(\"webtv/2.6\") != -1) flashVer = 4;\n // WebTV 2.5 supports Flash 3\n else if (navigator.userAgent.toLowerCase().indexOf(\"webtv/2.5\") != -1) flashVer = 3;\n // older WebTV supports Flash 2\n else if (navigator.userAgent.toLowerCase().indexOf(\"webtv\") != -1) flashVer = 2;\n else if (isIE && isWin && !isOpera) {\n flashVer = ControlVersion();\n }\n return flashVer;\n}" ]
[ "0.67393667", "0.6662848", "0.6519858", "0.64617425", "0.64402497", "0.6374038", "0.63086313", "0.6263122", "0.61251736", "0.6041687", "0.5904372", "0.57356757", "0.57356757", "0.5706012", "0.56840575", "0.56354696", "0.56339085", "0.55923235", "0.55923235", "0.55923235", "0.5560617", "0.5531498", "0.5514304", "0.54744875", "0.54271436", "0.5413313", "0.53676724", "0.5361618", "0.5321115", "0.5313539", "0.53067195", "0.52720064", "0.5177122", "0.51465493", "0.51175755", "0.50948536", "0.5064405", "0.5056627", "0.5043478", "0.5014197", "0.50114256", "0.4974228", "0.49719608", "0.49477765", "0.49417675", "0.4917617", "0.49157974", "0.4915456", "0.49146467", "0.49057144", "0.49051088", "0.48866364", "0.48750064", "0.48744985", "0.48741817", "0.48702228", "0.48691848", "0.48661208", "0.4865748", "0.48529541", "0.48496026", "0.48432174", "0.48430425", "0.48333594", "0.48303565", "0.48275474", "0.4825251", "0.48222983", "0.48169947", "0.48163673", "0.4811193", "0.48054686", "0.47997868", "0.4796975", "0.47936413", "0.47930387", "0.47918388", "0.47898465", "0.4789629", "0.47895548", "0.478895", "0.47877225", "0.47872698", "0.47852808", "0.47839764", "0.47839764", "0.4783354", "0.47790378", "0.4774702", "0.4772727", "0.47674772", "0.4762177", "0.4759326", "0.47494283", "0.4745565", "0.4745383", "0.4744487", "0.4739339", "0.47366413", "0.47301838" ]
0.699041
0
Find a store on Store Number Search
function searchStore(storeNumber) { //Clear Form $('#region').prop('selectedIndex', 0); $('#district').prop('selectedIndex', 0); // If empty if (storeNumber === '' || storeNumber === null) { // Search all stores $.get('/stores/findAllStores', function (stores) { // Pass returned variable to create table function createTable(stores); }); } else { // Send Post Request $.get('/stores/findStoreByStoreNumber/' + storeNumber, function (stores) { createTable(stores); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchStore( isMore, sType ) {\r\n\tsearchType = sType;\r\n\t\r\n\tif( !isMore ) {\r\n\t\tclearStorInfo( true );\t// Clear data.\r\n\t}\r\n\t\r\n\t// Validation of phone number.\r\n\tif( !chkPhoneNo( \"telNo\", false ) ) {\r\n\t\t// 매장 전화번호를 확인해 주세요\r\n\t\tshowComModal( {msg:mLang.get(\"checkstorephonenumber\"),closeCallbackFnc:function(){ document.querySelector( 'input[name=\"telNo\"]' ).focus() }} );\r\n\t\treturn;\r\n\t}\r\n\t\t\r\n\t// Send ajax data.\r\n\tajaxSend( \"./findStore.json\" \r\n\t\t\t, { telNo\t\t: document.querySelector( 'input[name=\"telNo\"]' ).value\r\n\t\t\t\t, storNm\t: document.querySelector( \"#idStorNm\" ).value\r\n\t\t\t\t, isVisited : document.querySelector( \"#isVisited\" ).checked\r\n\t\t\t\t, pageNo\t: ( isMore ? ++pageStorNo : firstPageNo )\r\n\t\t\t\t, sType\t\t: sType\r\n\t\t\t }\r\n\t\t\t, searchStoreAft );\r\n}", "function searchStores() {\n var foundStores = [];\n var zipCode = document.getElementById('zip-code-input').value;\n console.log(zipCode) // zipCode entered in search area\n \n if(zipCode) {\n foundStores = stores.filter(function(store, index) {\n return zipCode === store.address.postalCode.substring(0, 5);\n });\n } else {\n foundStores = stores;\n }\n console.log(\"FOUND STORES : \", foundStores);\n \n clearLocations();\n displayStores(foundStores); //will display searched dtores according to zipcode entered in search area\n showMarkers(foundStores); // will show markers on map for found satores only\n setOnClickListener(); // onclick in store-list display area will pop up marker info on map\n}", "function getItemFromShop(itemName){\n return data.store.find(storeItem => {\n return storeItem.Item === itemName;\n })\n}", "function lookupRecored2({\n\tstore = \"person-records\",\n\tid = -1\n}) {\n\tconsole.log(store, id); // person-records 42\n}", "function lookupRecord(store = \"person-records\", id= -1) {\n // ..\n}", "searchStores() {\n StoreService.getStores((data) => {\n this.setState({ stores: data });\n });\n }", "function searchProduct(itemstore, itemid){\n for(var i = 0; i < jsonArr.length; i++){\n if(jsonArr[i]._id === itemstore){\n for(var j = 0; j < jsonArr[i].items.length; j++){\n if(jsonArr[i].items[j]._id === itemid){\n jsonArr[i].items[j].number = 0;\n return jsonArr[i].items[j];\n }\n }\n }\n }\n }", "function getStoreInfo(userInput) {\n $.get(\"/api/register\", function(data) {\n for (var i = 0; i < data.length; i++) {\n if (userInput === data[i].routeName) {\n window.location.href = \"/results/\" + userInput;\n } else {\n // alert(\"cannot find\");\n }\n }\n });\n }", "function getProductsByStoreId(storeID, callable){\n console.log(\"(model/product.js) Started getProductsByStoreId()\");\n product.find({'StoreID': storeID}).sort({Name: 1}).exec(function(err, docs){\n if (err){\n console.log(err)\n }\n else{\n callable(null, docs);\n }\n })\n}", "getStore(params) {\n return Resource.get(this).resource('SupplierCompany:getStore', params);\n }", "function searchStoreProduct(store_id){\r\n\t//var keyword = $('#itxt_search').val();\r\n\tvar keyword = document.getElementById('istore_txt_search').value;\r\n\tkeyword=keyword.toLowerCase();\r\n\t\r\n\tvar base_url = document.domain + window.location.pathname;\r\n\tdocument.location.href = 'http://' + base_url + '?cat=q&q=' + keyword;\r\n}", "searchByWeight( weightToSearch ) {\n let itemId = this.ItemNotFound;\n let list = this.state[this.townName];\n \n for( let indx=0; indx<list.length; ++indx ) {\n if( list[indx].weight.toString() === weightToSearch ) {\n itemId = list[indx].id;\n break;\n }\n }\n console.log('searchByWeight :',itemId);\n\n return itemId;\n }", "function findNearby(address) {\n var menuNearest = new Promise(function(resolve, reject) {\n pizzapi.Util.findNearbyStores(\n address, // this is super dang picky!\n 'Delivery',\n function(storeData){\n var storeID = storeData.result.Stores[0];\n var myStore = new pizzapi.Store({ID: storeID}); // note: this could all be wrong\n myStore.ID = storeData.result.Stores[0].StoreID;\n myStore.getMenu(\n function(storeData){\n menuObj = getMenuObj(storeData);\n resolve(menuObj)\n }\n )\n }\n );\n\n var getMenuObj = function(storeData){\n var menuObj = {};\n for(var item in storeData.menuByCode){\n if(isNaN(parseInt(storeData.menuByCode[item].menuData.Code)) && storeData.menuByCode[item].menuData.ProductType){\n menuObj[storeData.menuByCode[item].menuData.Name]=storeData.menuByCode[item].menuData;\n }\n }\n return menuObj\n }\n })\n return menuNearest\n}", "function locate() {\n if('geolocation' in navigator) {\n console.log('geolocation available');\n navigator.geolocation.getCurrentPosition(async position => {\n const lat = position.coords.latitude;\n const lng = position.coords.longitude;\n const data = {lat,lng};\n const options = {\n method:'POST',\n headers:{\n 'Content-Type': 'application/json'\n },\n body:JSON.stringify(data)\n };\n\n const response = await fetch('store/', options);\n const json = await response.json();\n store_number = json[0];\n });\n\n }\n}", "function getStores(req, res) {\n \n //Can only query with storename and/or category\n if (!req.query.address && !req.query.id){ //Might not need to check this\n \n Stores.find(req.query,function(err, result) {\n if (err) throw err;\n \n //res.render('index', {errors: {}, user: JSON.stringify(result)});\n \n //return a JSON object containing a field users which is an array of User Objects.\n return res.json({stores: result});\n\n \n }).sort({__id: 1}); //Sort the query with username ascending\n\n } else {\n\n return res.json({ error: 'Invalid: Gave an address or id' });\n }\n\n}", "function doStore() {\r\n\tstoreTotal=0;\r\n\tstatus(\"checking store\",true);\r\n\tGM_get(document.location.host + \"/backoffice.php?which=1\",pushStore);\r\n\t\r\n\tfunction pushStore(details) {\r\n\t\tparser.innerHTML = details;\r\n\t\tvar a=parser.getElementsByTagName('input');\r\n\t\tstatus(\"checking \"+a.length+\" store items\",false);\r\n\t\tfor(var i=0;i<a.length;i++) {\r\n\t\t\tvar id,info;\r\n\t\t\tif(a[i].name && (id=/price\\[(\\d*)\\]/.exec(a[i].name)) && (id=id[1])) {\r\n\t\t\t\tvar q,info,itemName,val,total,static;\r\n\t\t\t\titemName = a[i].parentNode.previousSibling.previousSibling.textContent;\r\n\t\t\t\tq = parseInt(a[i].parentNode.previousSibling.textContent);\r\n\t\t\t\tif(!(val = prices[id])){val=0}else{val=val[0]}\r\n\t\t\t\tif(!(static = prices[id])){static=false}else{static=static[1]};\r\n\t\t\t\ttotal=q*val;\r\n\t\t\t\tstoreTotal+=total;\r\n\t\t\t\tstoreList.push([itemName,q,val,total,id]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tstatus(\"sorting store list\",false);\r\n\t\tstoreList.sort(sortbyTotal);\r\n\t\tstoreCurrentLists();\r\n\t}\r\n}", "getStore(index) {\n return(this.store[index]);\n }", "function getSelectedStore(floatingSelect) {\n var selectedStore = floatingSelect.value;\n store = \"Costco_\" + selectedStore;\n}", "function getStoreNameById(storeId, callable) {\n console.log(\"(model/store.js) Started getStoreNameById()\");\n store.find({StoreID: storeId}, function (err, docs) {\n if (err) {\n console.log(err);\n }\n else {\n callable(null, docs);\n }\n });\n}", "function lookupRecored1(store = \"person-records\", id = -1) {\n\tconsole.log(store, id); // {id: 42} -1\n}", "searchByName( nameToSearch ) {\n let itemId = this.ItemNotFound;\n let list = this.state[this.townName];\n let nameToSearchLowerCase = nameToSearch.toLocaleLowerCase();\n let nameToSearchSplit = nameToSearchLowerCase.split(' ');\n let name0ToSearch = nameToSearchSplit[0];\n let name1ToSearch = nameToSearchSplit[1];\n \n \n for( let indx=0; indx<list.length; ++indx ) {\n let name = list[indx].name.toString().toLocaleLowerCase();\n let nameSplit= name.split(' ');\n let name0 = nameSplit[0];\n let name1 = nameSplit[1];\n \n if( name0ToSearch && name1ToSearch && nameToSearchLowerCase === name ) {\n itemId = list[indx].id;\n break;\n } else\n if( !name1ToSearch && name0ToSearch && (name0 === name0ToSearch || name1 === name0ToSearch) ) {\n itemId = list[indx].id;\n break;\n }\n }\n console.log('searchByName :',itemId);\n \n return itemId;\n }", "function searchSpotify (trackName, itemNum) {\n\n\tspotify.search({ type: 'track', query: trackName }, function(err, data) {\n\t\tif (err) {\n\t\t\tconsole.log('Error occurred: ' + err);\n\t\treturn;\n\t\t}\n\n\t// extract the desired song details from the spotify json object\n\n\t\tconsole.log(\"\\nMy Song:\");\n\t\tconsole.log(\"\\nArtist Name: \" + data.tracks.items[itemNum].album.artists[0].name);\n\t \tconsole.log(\"Song Name: \" + data.tracks.items[itemNum].name);\n\t \tconsole.log(\"Preview URL: \" + data.tracks.items[itemNum].preview_url);\n\t \tconsole.log(\"Album Name: \" + data.tracks.items[itemNum].album.name);\n\n\t }); // end function to search Spotify\n\n} // function to search OMDB using the request package", "find(marketplaceId, opts) {\n let url = Nilavu.getURL(\"/marketplaces/\") + marketplacesId;\n\n const data = {};\n if (opts.provider) {\n data.provider = opts.provider;\n }\n\n\n // Check the preload store. If not, load it via JSON\n return Nilavu.ajax(url + \".json\", { data: data });\n }", "function chooseProduct(el){\n return searchProduct($(el).closest(\"section\").data(\"store\"), $(el).data(\"productid\"));\n }", "function SearchBy(omodel, _comptenumber) {\n var getquery = omodel.findOne(({ _id: _comptenumber }), {});\n return getquery;\n}", "search (modelName, query, options, directives) {\n assert(`You need to pass a model name to the store's search method`, isPresent(modelName));\n assert(`You need to pass a query hash to the store's search method`, query);\n assert(\n `Passing classes to store methods has been removed. Please pass a dasherized string instead of ${modelName}`,\n typeof modelName === 'string'\n );\n\n let adapterOptionsWrapper = {};\n\n if (options && options.adapterOptions) {\n adapterOptionsWrapper.adapterOptions = options.adapterOptions;\n }\n\n let normalizedModelName = DS.normalizeModelName (modelName);\n return this._search (normalizedModelName, query, null, adapterOptionsWrapper, directives);\n }", "searchByProfessions( professionSearch ) {\n let itemId = this.ItemNotFound;\n let list = this.state[this.townName];\n \n \n for( let indx=0; indx<list.length; ++indx ) {\n for( let indxProf=0; indxProf<list[indx].professions.length; ++indxProf ) {\n if( list[indx].professions[indxProf].toLowerCase() === professionSearch.toLowerCase() ) {\n itemId = list[indx].id;\n break;\n } \n }\n }\n console.log('searchByProfessions :',itemId);\n\n return itemId;\n }", "function indexCalculator(number){\n /*\n for(let i = 0; i < products.length; i++){\n if( products[i].productNo == number) return i;\n }\n */\n let currProduct = products.find(object => object.productNo === displayNum.innerHTML);\n return products.indexOf(currProduct);\n}", "function eSearchShop(event,shopId){\n\t\tvar x = event.which || event.keyCode;\n\t\tif(x == 13){\n\t\t\tsellPageGet(shopId);\n\t\t}\n}", "getFindStoresEntities() {\r\n return this.store.pipe(select(StoreFinderSelectors.getFindStoresEntities));\r\n }", "findStoresAction(queryText, searchConfig, longitudeLatitude, countryIsoCode, useMyLocation, radius) {\r\n if (useMyLocation && this.winRef.nativeWindow) {\r\n this.clearWatchGeolocation(new StoreFinderActions.FindStoresOnHold());\r\n this.geolocationWatchId = this.winRef.nativeWindow.navigator.geolocation.watchPosition((pos) => {\r\n const position = {\r\n longitude: pos.coords.longitude,\r\n latitude: pos.coords.latitude,\r\n };\r\n this.clearWatchGeolocation(new StoreFinderActions.FindStores({\r\n queryText: queryText,\r\n searchConfig: searchConfig,\r\n longitudeLatitude: position,\r\n countryIsoCode: countryIsoCode,\r\n radius: radius,\r\n }));\r\n }, () => {\r\n this.globalMessageService.add({ key: 'storeFinder.geolocationNotEnabled' }, GlobalMessageType.MSG_TYPE_ERROR);\r\n this.routingService.go(['/store-finder']);\r\n });\r\n }\r\n else {\r\n this.clearWatchGeolocation(new StoreFinderActions.FindStores({\r\n queryText: queryText,\r\n searchConfig: searchConfig,\r\n longitudeLatitude: longitudeLatitude,\r\n countryIsoCode: countryIsoCode,\r\n radius: radius,\r\n }));\r\n }\r\n }", "function doFind() {\n const found = people.results.find((person) => {\n return person.location.state === 'Minas Gerais';\n });\n console.log(found);\n}", "function searchSpotify(search){\n\tvar Spotify = require('node-spotify-api');\n \n\tvar spotify = new Spotify({\n\t\tid: 'da97b33e9f4640e08420c513eed1b7e2',\n\t\tsecret: '7fc8dcaebc8a40cb9f47b20f9f9f2e43'\n\t});\n\t \n\tspotify.search({ type: 'track', query: search }, function(err, data) {\n\t\tif (err) {\n\t \treturn searchSpotify(\"The Sign Ace\");\n\t\t}else{ \n\t\t\tconsole.log(\"Band Name: \" + data.tracks.items[0].artists[0].name); \n\t\t\tconsole.log(\"Song Name: \"+ data.tracks.items[0].name);\n\t\t\tconsole.log(\"Album Name: \" + data.tracks.items[0].album.name);\n\t\t\tconsole.log(\"Spotify Link: \" + data.tracks.href);\n\t\t\tlog(\"Band Name: \" + data.tracks.items[0].artists[0].name);\n\t\t\tlog(\"Song Name: \"+ data.tracks.items[0].name);\n\t\t\tlog(\"Album Name: \" + data.tracks.items[0].album.name);\n\t\t\tlog(\"Spotify Link: \" + data.tracks.href);\n\t \t}\n\t});\n}", "findStoresAction(queryText, searchConfig, longitudeLatitude, countryIsoCode, useMyLocation, radius) {\r\n if (useMyLocation && this.winRef.nativeWindow) {\r\n this.clearWatchGeolocation(new FindStoresOnHold());\r\n this.geolocationWatchId = this.winRef.nativeWindow.navigator.geolocation.watchPosition((pos) => {\r\n const position = {\r\n longitude: pos.coords.longitude,\r\n latitude: pos.coords.latitude,\r\n };\r\n this.clearWatchGeolocation(new FindStores({\r\n queryText: queryText,\r\n searchConfig: searchConfig,\r\n longitudeLatitude: position,\r\n countryIsoCode: countryIsoCode,\r\n radius: radius,\r\n }));\r\n }, () => {\r\n this.globalMessageService.add({ key: 'storeFinder.geolocationNotEnabled' }, _spartacus_core__WEBPACK_IMPORTED_MODULE_1__[\"GlobalMessageType\"].MSG_TYPE_ERROR);\r\n this.routingService.go(['/store-finder']);\r\n });\r\n }\r\n else {\r\n this.clearWatchGeolocation(new FindStores({\r\n queryText: queryText,\r\n searchConfig: searchConfig,\r\n longitudeLatitude: longitudeLatitude,\r\n countryIsoCode: countryIsoCode,\r\n radius: radius,\r\n }));\r\n }\r\n }", "searchByAge( ageToSearch ) {\n let itemId = this.ItemNotFound;\n let list = this.state[this.townName];\n \n for( let indx=0; indx<list.length; ++indx ) {\n if( list[indx].age.toString() === ageToSearch ) {\n itemId = list[indx].id;\n break;\n }\n }\n console.log('searchByAge :',itemId);\n \n return itemId;\n }", "query(store, type, query) {\n return this.findQuery(store, type, query);\n }", "function foundStoresCallback(results, status) {\n\n\t if (status === google.maps.places.PlacesServiceStatus.OK) {\n\n\t for (var i = 0; i < results.length; i++) {\n\n\t createMarker(results[i]);\n\n\t }\n\t }\n\t}", "searchFor(query) {\n return BooksAPI.search(query).then(results => results && !results.error ? results : []).then((results) => {\n return results.map(book => {\n const shelvedBookIndex = this.state.books.findIndex(shelvedBook => shelvedBook.id===book.id)\n var shelf;\n if (shelvedBookIndex === -1) {\n shelf = 'none';\n } else shelf = this.state.books[shelvedBookIndex].shelf;\n return Object.assign({shelf}, book);\n }) \n })\n }", "get selectStore() {\n return $('#select-store').selectByAttribute('value', 'valleyfair');\n }", "function searchStoreAft( responseText ) {\r\n\t\r\n\tif( responseText != NOT_EXIST_DATA ) {\r\n\t\t// Fill searched data.\r\n\t\tviewStor( JSON.parse(responseText) );\r\n\t} else {\r\n\t\t// There's no data. \r\n\t\tshowComModal( {msg:mLang.get(\"nosearchdata\")} );\t// 조회 내역이 없습니다\r\n\t \treturn false;\r\n\t}\r\n}", "function foundStoresCallback(results, status) {\n\n if (status === google.maps.places.PlacesServiceStatus.OK) {\n\n for (var i = 0; i < results.length; i++) {\n\n createMarker(results[i]);\n\n }\n\n }\n\n }", "function store(storeLookup){\n\nvar storeLookup = {\n\n england: \"2 Bank Street, London, EC1, Tel:123456\",\n ireland: \"Temple Bar, Dublin 2, Tel: 123456\",\n wales: \"21 David's Avenue, Cardiff, Tel:123456\",\n scotland: \"South Bridge, Edinburgh EH8, Tel:123456\",\n};\n\n var country = document.getElementById(\"country\");\n if (country.value == \"england\") {\n document.getElementById(\"storeAddress\").innerHTML = storeLookup.england;\n }\n\n else if (country.value == \"ireland\") {\n document.getElementById(\"storeAddress\").innerHTML = storeLookup.ireland;\n }\n\n else if (country.value == \"wales\") {\n document.getElementById(\"storeAddress\").innerHTML = storeLookup.wales;\n }\n\n else if (country.value == \"scotland\") {\n document.getElementById(\"storeAddress\").innerHTML = storeLookup.scotland;\n }\n \n else {\n document.getElementById(\"storeAddress\").innerHTML = \"Sorry there's an error\";\n }\n }", "function doFind() {\n const minasGerais = people.results.find((person) => {\n return person.location.state === 'Minas Gerais';\n });\n}", "function findProviders(featureLayer, searchPnt){\n\n if(initialSearch){\n findOptimalSearchRadius(featureLayer,searchPnt, \"1=1\");\n initialSearch = false;\n }\n else{\n var radius = searchFilters.getSearchRadius()\n \n queryProvidersService(radius,searchPnt,featureLayer); \n }\n }", "function addStoresDistance(stores, query, callback) {\n var self = this, pStores = [], si, sl, st, lat, lon, checkDistance = false, fromPoint = null, toPoint = null;\n \n lat = query.location ? query.location.lat : undefined;\n lon = query.location ? query.location.lon : undefined;\n \n checkDistance = typeof lat !== 'undefined' ? true : false;\n if (checkDistance) {\n fromPoint = new Point(lat, lon);\n \n for (si = 0, sl = stores.length; si < sl; si += 1) {\n st = stores[si].fields; \n toPoint = new Point(st.location.lat, st.location.lon);\n st.distance = Math.round(fromPoint.distanceTo(toPoint));\n pStores.push(st);\n }\n }\n else {\n pStores = stores;\n }\n \n callback(null, pStores);\n}", "searchBook(dataId) {\n for (let item of myLibrary) {\n if (item.id == dataId) {\n console.log('found');\n return myLibrary.indexOf(item);\n }\n }\n console.log('Not found');\n }", "getStores() {\n Service.get(this).getStores(state.get(this).params.companyId);\n }", "function search(){\n\tvar inputHandle = document.getElementById(\"searchBar\");\n\tvar typedValue = inputHandle.value;\n for(post in store){\n if(store[post].tag.indexOf(typedValue) > -1){\n displayElement(store, post);\n console.log(store[post].url + \" is the url\");\n }\n else{\n console.log(\"not found\");\n }\n }\n}", "function getStoreId() {\n var id = \"\";\n for(var i in dd.records){\n if(i!=\"remove\"){\n id = dd.records[i].id;\n }\n }\n return id;\n }", "function find(element) {\n for (var i = 0; i < this.dataStore.length; i++) {\n if (this.dataStore[i] === element) {\n return i;\n }\n }\n return -1;\n}", "function search(location) {\r\n switch (carType) {\r\n case \"gus\":\r\n searchGus(location);\r\n break;\r\n case \"eletric\":\r\n searchEletric(location);\r\n }\r\n}", "function dockerIdSeach(search, defaultId, store, success, args, config) {\n if(store === \"\") return;\n this.config = config = config || this.config || {}; // I know. I don't get it either. Codevolution@Work here.\n search = search || defaultId || \"mongodb\";\n exec(\"docker ps --format '{{.ID}}: {{.Command}} Names:{{.Names}}' | egrep '\" + search + \"' | sed 's/:.*//';\", function (error, stdout) {\n if (error !== null) {\n console.log(error.toString().bold.red);\n }\n else {\n config[store] = stdout.toString().replace(/(\\r\\n|\\n|\\r)/gm, \"\");\n if(config.vbs) console.log(search + \" = \" + config[store]);\n if(success !== undefined) success(args);\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 lookupRecord(searchStr) {\n\t\t\ttry {\n\t\t\t\tvar id = getRecord(searchStr);\n\t\t\t}\n\t\t\tcatch(err) {\n\t\t\t\tvar id = -1;\n\t\t\t}\n\n\t\t\treturn id;\n\t\t}", "async function findCoords() {\n // get store data\n const response = await axios.get(`${BACKEND_URL}/api/stores`);\n const allStores = response.data.stores;\n\n // all stores name. First element is zero so that the first store of id 1,\n // also gets the index 1 position in the arary.\n const storesName = [];\n for (let i = 0; i < allStores.length; i += 1) {\n // storesName.push(allStores[i].login);\n storesName.push(allStores[i]);\n }\n\n // get store cords\n const storeCoords = await Promise.all(storesName.map((data) => findLatLng(data)));\n\n return storeCoords;\n}", "function searchProduct(id) {\n for (let k = 0; k < shoppingProducts.length; k++) {\n if (shoppingProducts[k].idproduct === id) {\n return shoppingProducts[k];\n }\n }\n return null;\n}", "customer(){\n return store.customers.find(customer=>{\n return customer.id === this.customerId\n })\n }", "function findTheSign() {\n \t\tspotify.search({ type:\"track\", query:\"The Sign\" }, function(err, data) {\n \t\t\tvar firstStep = data.tracks;\n \t\t\tvar secondStep = data.tracks.items;\n \t\t\tfor (var i = 0; i < secondStep.length; i++) {\n \t \t\t\tif (firstStep.items[i].artists[0].name === \"Ace of Base\") {\n\t \t\t\t\tif (firstStep.items[i].album.name != \"Greatest Hits\") {\n\t \t\t\t\t\tconsole.log(firstStep.items[i].artists[0].name);\n\t\t\t\t\t\tconsole.log(firstStep.items[i].name);\n\t\t\t\t\t\tconsole.log(firstStep.items[i].preview_url);\n\t\t\t\t\t\tconsole.log(firstStep.items[i].album.name);\n\t\t\t\t\t}\n\t \t\t\t}\n \t\t\t}\n \t\t});\t\t\t\n\t}", "function find(key) {\r\nreturn this.datastore[key];\r\n}", "static findByName(id, title, cb) {\n getProductsFromFile((products) => {\n console.log('Get Product by name', title, \"--\", id);\n // Sequencial Search\n // const product = products.find(p => p.title === title);\n\n // Implement Binary Search\n const product = binarySearch(products, title);\n\n cb(product);\n });\n }", "viewStoreById(storeId) {\r\n this.clearWatchGeolocation(new StoreFinderActions.FindStoreById({ storeId }));\r\n }", "search() {\n // If the search base is the id, just load the right card.\n if (this.queryData['searchBase'] == 'id' && this.queryData['search']) {\n this.selectItem(this.queryData['search']);\n } else {\n this.loadData();\n }\n }", "function catalogFind(){\n var catalog=returnCatalog(\"item\");\n // console.log(catalog);\n if(catalog != null){\n productArray = processArray(catalog,1);\n nowArray = productArray;\n // console.log(productArray);\n getSortMethod(nowArray);\n updateBrandAmount();\n changeDisplayAmount(displayType,1);\n }\n}", "function getProductsStore(selectedStoreName) {\n \n // get the data in the active sheet \n var sheet = getOutputSheet(1); \n \n var cell = getOutputFirstCell(1);\n \n cell.setFormula(\"=QUERY('Base de Datos'!A:M;\\\"select F, G, H, K, sum(I), max(L) where J='No Vendido' and K='\"+selectedStoreName+\"' group by G, F, H, K\\\")\");\n \n\t// create a 2 dim area of the data in the carrier names column and codes \n\tvar products = sheet.getRange(2, 1, sheet.getLastRow() -1, 6).getValues().reduce( \n\t\tfunction(p, c) { \n \n // add the product to the list\n\t\t\tp.push(c); \n\t\t\treturn p; \n\t\t}, []); \n \n return JSON.stringify(products);\n}", "function searchSpotify (input) {\n // If nothing is searched, The Sign will be used\n if (input == \"\") {\n input = \"The Sign Ace of Base\"\n };\n // Searching Spotify for track information\n spotify.search({type: \"track\", query: input}, function(error, data) {\n if (error) {\n console.log(\"An error occurred: \" + error);\n } else {\n console.log(\n \"Song title: \" + data.tracks.items[0].name +\n \"\\nArtist: \" + data.tracks.items[0].artists[0].name +\n \"\\nAlbum: \" + data.tracks.items[0].album.name +\n \"\\nSong preview: \" + data.tracks.items[0].href\n );\n };\n });\n}", "function getRecordsWithStores(req, res) {\n return RecordModel.findById(req.params.recordId)\n .populate('shops').exec((err, record) => {\n if (err) {\n res.status(500);\n res.send('Error found by finding records');\n } else {\n res.json(record);\n }\n });\n}", "getAvailableStores() {\n // Call the function to load all available stores\n var data = autocomplete.cloudLoadAvailableStores().then((value) => {\n // Get the stores and ids\n var titles = value.titles;\n var ids = value.ids;\n var addrs = value.addrs;\n var names = value.names;\n\n // Save the names and ids to the state\n var temp = [];\n for (var i = 0; i < ids.length; i++) {\n temp.push({\n title: titles[i],\n id: ids[i],\n addr: addrs[i],\n storeName: names[i]\n });\n }\n\n temp.push({\n title: \"Register a store...\",\n id: -1\n });\n\n return temp;\n });\n\n return data;\n }", "function find(element) {\n\tfor (var i = 0; i < this.dataStore.length; i++){\n\t\t/*If the element is found, the function returns the position \n\t\twhere the element was found.*/\n\t\tif(this.dataStore[i] == element) { \n\t\t\treturn i;\n\t\t}\n\t}\n\treturn - 1;\n}", "async function getStores() {\n\n try {\n const response = await HTTP.get('/services/stores');\n return response.data.stores;\n\n } catch (error) {\n console.error(error);\n }\n }", "findBook(searchBook) {\n return this.state.books.find(book => book.id === searchBook.id);\n }", "getStores(companyId) {\n // Reset\n this.displayData.stores = [];\n // Retrieve stores and store\n return Resource.get(this).resource('Store:getStores', {companyId})\n .then((stores) => {\n // Remove extra stuff\n this.displayData.stores = stores.filter((store) => {\n return store._id;\n });\n });\n }", "async find(productStr, callback) {\n // this.EanSearchScrapper.searchForProduct(this.props.barCode, (productInfo) => {\n // if (!productInfo) {console.log(\"NULL\"); return; }\n //\n // this.props.setProductName(productInfo.name);\n // this.props.setProductPhotoUrl(productInfo.photoUrl);\n // this.setState({\n // loading: false\n // });\n // });\n\n this.GoogleSearchProductFinder.searchForProductV2(productStr, (productInfo) => {\n callback(productInfo);\n });\n\n // this.allegroScrapper.searchForProduct(this.props.barCode, (productInfo) => {\n // if (!productInfo) return;\n //\n // this.props.setProductName(productInfo.name);\n // this.props.setProductPhotoUrl(productInfo.photoUrl);\n // this.setState({\n // loading: false\n // });\n // });\n }", "static get service() {\n return 'stores';\n }", "function determineSearch(key, status, category, order, pageNum) {\n\tvar filter = \"\";\n\tif(status) {\n\t\tfilter += \" AND status = \" + status;\n\t}\n\tif(category) {\n\t\tfilter += \" AND category = \" + category;\n\t}\n\tif(!order) {\n\t\torder = \"post_date DESC\";\n\t}\n\tconsole.log(filter)\n\tif(isNaN(Number(key))) {\n\t\treturn addressSearch(key, filter, order, pageNum);\n\t} else {\n\t\treturn zipSearch(key, filter, order, pageNum);\n\t}\n}", "function findById(id) {\n return store.items.find(item => item.id === id);\n }", "function searchByTerm(searchTerm){\n knexInstance\n .select('*')\n .from('shopping_list')\n .where('name', 'ILIKE', `%${searchTerm}%`)\n .then(result => {\n console.log('Drill 1:', result)\n })\n}", "function addStore(store) {\n storesList.push(store);\n // set storeNumber to the new length of the list (array)\n store.storeNumber = storesList.length;\n}", "function getSearches(cb) {\n const query = \"recipes.searches\"\n db.findOneSorted({\"_id\": \"server\", [query] : { \"$exists\" : true }}, { [query] : 1 }, data => {\n if (!data) {\n const err = {\n \"error\" : 404,\n \"payload\" : \"There is no recipe search info\"\n }\n return cb(err);\n };\n return cb(null, data.recipes.searches);\n });\n}", "function addressSearch(key, filter, order, pageNum) {\n\tvar term = \"'%\" + key + \"%'\";\n\tvar pageSize = 10;\n\tvar subQueryToFetchNumOfResults = 'count(*) OVER() AS numresults, ';\n\tvar subQueryToFetchPageCount = 'ceil((count(*) OVER())::numeric/'+ pageSize + ') AS numpages ';\n\tvar subQueryToHandlePagination = ' LIMIT ' + 10 + ' OFFSET ' + ((pageNum - 1 ) * 10);\n\treturn db.any('SELECT *, ' + subQueryToFetchNumOfResults + subQueryToFetchPageCount + ' FROM listings WHERE LOWER(address) LIKE LOWER(' + term + ') ' + filter + ' ORDER BY ' + order + ' ' + subQueryToHandlePagination);\n}", "function zipSearch(key, filter, order, pageNum) {\n\tvar term = \"'\" + key + \"%'\"\n\tvar pageSize = 10;\n\tvar subQueryToFetchNumOfResults = 'count(*) OVER() AS numresults, ';\n\tvar subQueryToFetchPageCount = 'ceil((count(*) OVER())::numeric/'+ pageSize + ') AS numpages ';\n\tvar subQueryToHandlePagination = ' LIMIT ' + 10 + ' OFFSET ' + ((pageNum - 1 ) * 10);\n\treturn db.any('SELECT *, ' + subQueryToFetchNumOfResults + subQueryToFetchPageCount + ' FROM listings WHERE zipcode LIKE ' + term + filter + ' ORDER BY ' + order + ' ' + subQueryToHandlePagination);\n}", "searchByHairColor( hairColorToSearch ) {\n let itemId = this.ItemNotFound;\n let list = this.state[this.townName];\n \n for( let indx=0; indx<list.length; ++indx ) {\n if( list[indx].hair_color.toLowerCase() === hairColorToSearch.toLowerCase() ) {\n itemId = list[indx].id;\n break;\n }\n }\n console.log('searchByHairColor :',itemId);\n\n return itemId;\n }", "function find(key) {\n\treturn this.dataStore[key];\n}", "function searchMates(query,array){\n\n\tfor(var i = 0; i<array.length; i++){\n\t\tif(query === array[i].name){\n\t\t\treturn array[i]\n\t\t}\n\t\n\t}\n\treturn \"this name not found\"\n}", "getStoreOrderID(payload){ // payload = {storeName (req)};\n var orderID;\n\n if (payload.hasOwnProperty('storeName') && payload.storeName){\n if(this.state.orderIDs.hasOwnProperty(payload.storeName) && this.state.orderIDs[payload.storeName]){\n orderID = this.state.orderIDs[payload.storeName]\n }\n else if (this.warnDebug) console.warn(\"WARNING: getStoreOrderID:\\t\\torderID not found for store - \" + this.payloadToStr(payload));\n }\n else if (this.errDebug) console.error(\"ERROR: getStoreOrderID:\\t\\tpayload - storename - \" + this.payloadToStr(payload));\n\n return orderID;\n }", "function getCashRegistryByShopId(shopId) {\r\n var cashRegistryDetails;\r\n if (parseVariable(shopId) && String(shopId).indexOf(',') == -1) {\r\n getCashRegistryForCurrUser();\r\n if (parseVariable(userCashRegistryList, true)) {\r\n var selectedCashRegistryDetails = $.grep(userCashRegistryList, function (obj, idx) {\r\n return (String(obj.ShopID) == String(shopId));\r\n });\r\n if (selectedCashRegistryDetails.length > 0) {\r\n cashRegistryDetails = selectedCashRegistryDetails;\r\n }\r\n }\r\n }\r\n return cashRegistryDetails;\r\n}", "function doubleSearch () {}", "async getStoreByTags() {\n // Get result\n const result = await StoreService.getStoreByTags(this.tags, this.page.number, this.page.orderby, this.page.limit);\n\n // Update the state\n\t\tthis.setState({\n isLoading: false,\n stores: result.data.response.length > 0 ? result.data.response : null\n\t\t});\n }", "function enterStore(event){\n event.preventDefault();\n\n var name = event.target.store.value; // this is targeting the value of the input\n var maxCust = parseInt(event.target.max.value);\n var minCust = parseInt(event.target.min.value);\n var avgCookies = parseInt(event.target.avgSold.value);\n var newStore = new createStore(name, maxCust, minCust, avgCookies);\n\n newStore.cookiesPurchased();\n totalByStore(newStore);\n rowRow(newStore);\n \n console.log('did it work?', storeArr);\n}", "searchByHeight( heightToSearch ) {\n let itemId = this.ItemNotFound;\n let list = this.state[this.townName];\n \n for( let indx=0; indx<list.length; ++indx ) {\n if( list[indx].height.toString() === heightToSearch ) {\n itemId = list[indx].id;\n break;\n }\n }\n console.log('searchByHeight :',itemId);\n\n return itemId;\n }", "function find_hotel_sale (cb, results) {\n const criteriaObj = {\n checkInDate: sessionObj.checkindate,\n checkOutDate: sessionObj.checkoutdate,\n numberOfGuests: sessionObj.guests,\n numberOfRooms: sessionObj.rooms,\n hotel: results.create_hotel.id,\n or: [\n { saleType: 'fixed' },\n { saleType: 'auction' }\n ]\n }\n HotelSale.find(criteriaObj)\n .then(function (hotelSale) {\n sails.log.debug('Found hotel sales: ')\n sails.log.debug(hotelSale)\n\n if (hotelSale && Array.isArray(hotelSale)) {\n sails.log.debug('checking hotel sails')\n const sales = hotelSale.filter(function (sale) {\n const dateDif = new Date(sale.checkindate) - new Date()\n const hours = require('../utils/TimeUtils').createTimeUnit(dateDif).Milliseconds.toHours()\n if ((sale.saleType == 'auction' && hours <= 24) || (sale.saleType == 'fixed' && hours <= 0)) {\n _this.process_hotel_sale(sale)\n return false\n }else if (sale.status == 'closed') {\n return false\n }else {\n return true\n }\n })\n if (sales.length)\n sails.log.debug('Found hotel sales ')\n return cb(null, sales)\n } else {\n sails.log.debug('Did not find any sales, creating new sale')\n return cb(null, null)\n }\n }).catch(function (err) {\n sails.log.error(err)\n return cb({\n wlError: err,\n error: new Error('Error finding hotel sale')\n })\n })\n }", "finder(productName, inventory){\n return inventory.find(product => product.productName === productName)\n }", "function songfind() {\n\nvar spotify = new Spotify(\n keys.spotify\n);\n var songTitle = process.argv.slice(2);\nspotify.search({ type: 'track', query: songTitle, limit: 1 }, function(err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n\n // console.log(\"Artist: \" + \"\");\n console.log(\"Song: \" + data.tracks.items[0].name);\n console.log(\"Spotify URL: \" + data.tracks.items[0].preview_url);\n console.log(\"Album Name:\" + data.tracks.items[0].album.name)\n\t\n})}", "function inventorySearch() {\n var query = \"SELECT * FROM bamazon.products;\";\n connection.query(query, function (err, res) {\n for (var i = 0; i < res.length; i++) {\n console.table(res[i]);\n }\n idSearch();\n });\n}", "function searchByChain()\n{\n\t\n\tvar searchChain = $(\"#searchChain\").val();\n\tif(searchChain =='' || searchChain == null)\n\t{\n\t\tsearchChain = undefined;\n\t}\n\tgetChainList(searchChain,0,0,'asc');\n}", "function findItem(item) {\n\t\tvar cart = sessionStorage.getItem('cartItems');\n\t\tvar prdcts = JSON.parse(cart);\n\t\tfor (var i = 0; i < prdcts.productsInCart.length; i++) {\n\t\t\tif (prdcts.productsInCart[i].p_id == item) {\n\t\t\t\treturn [prdcts.productsInCart[i], i];\n\t\t\t}\n\t\t}\n\t}", "function spotifySearch(){\n spotify.search({ type: 'track', query: songToSearch}, function(error, data){\n if(!error){\n for(var i = 0; i < data.tracks.items.length; i++){\n var song = data.tracks.items[i];\n console.log(\"Artist: \" + song.artists[0].name);\n console.log(\"Song: \" + song.name);\n console.log(\"Preview: \" + song.preview_url);\n console.log(\"Album: \" + song.album.name);\n console.log(\"-----------------------\");\n }\n } else{\n console.log('Error occurred.');\n }\n });\n }", "function search(current){\n\n}", "function search() {\n var input, filter, searchItem = [];\n input = document.getElementById(\"search-item\");\n filter = input.value.toLowerCase();\n console.log(\"filter \" + filter);\n products.forEach((item, index) => {\n console.log(\"filter \" + filter + \"\" + item.name.indexOf(filter));\n if (item.name.indexOf(filter) != -1) {\n searchItem.push(item);\n const storeItem = document.getElementById(\"store-items\");\n storeItem.innerHTML = \"\"\n loadHtml(searchItem);\n }\n })\n}", "function searchTrack() {\n if (searchQuery.length === 0) {\n searchQuery = \"The Sign Ace of Base\"\n }\n spotify.search({ type: 'track', query: searchQuery }, function (err, data) {\n if (err) {\n return console.log('Error: ' + err);\n }\n console.log(`Artist: ${data.tracks.items[0].artists[0].name}`);\n console.log(`Song: ${data.tracks.items[0].name}`);\n console.log(`Album: ${data.tracks.items[0].album.name}`);\n console.log(`Preview Link: ${data.tracks.items[0].preview_url}`);\n });\n}", "static async getCrateSearchIndex(name) {\n let searchIndex = await storage.getItem(`@${name}`);\n if (searchIndex) {\n return searchIndex;\n } else {\n let crates = await CrateDocManager.getCrates();\n let crate = Object.entries(crates).find(([_, { crateName }]) => crateName == name);\n if (crate) {\n let libName = crate[0];\n return await storage.getItem(`@${libName}`);\n } else {\n return null;\n }\n }\n }" ]
[ "0.6748883", "0.62277853", "0.6093353", "0.5794093", "0.5776255", "0.57494336", "0.56563085", "0.5615086", "0.5604466", "0.5597354", "0.5587947", "0.5543716", "0.55373484", "0.55329365", "0.54986095", "0.544252", "0.54330754", "0.54229265", "0.5417769", "0.5407844", "0.5391667", "0.5347432", "0.5339508", "0.53349704", "0.5326885", "0.53256375", "0.53158206", "0.53111976", "0.5310311", "0.5301548", "0.5266726", "0.5261675", "0.5249707", "0.5243799", "0.5233189", "0.5232095", "0.52147007", "0.5210986", "0.5199928", "0.5195258", "0.5167965", "0.5166361", "0.51522386", "0.51419604", "0.5134762", "0.51233846", "0.5121939", "0.50996435", "0.509694", "0.50935924", "0.50925195", "0.50381005", "0.50219595", "0.50210655", "0.5020698", "0.5011685", "0.5010183", "0.50077575", "0.50006604", "0.49979863", "0.49769992", "0.49650347", "0.49637276", "0.4953932", "0.49530384", "0.4945423", "0.49432606", "0.49392468", "0.4934841", "0.4928585", "0.492629", "0.49113482", "0.48832878", "0.48812133", "0.48766282", "0.48710886", "0.48703274", "0.48665735", "0.4864297", "0.48634794", "0.48628384", "0.48614788", "0.484724", "0.48460224", "0.48427367", "0.4838543", "0.48370618", "0.48367816", "0.4835253", "0.48346272", "0.48319873", "0.48311445", "0.4829818", "0.48260367", "0.48198718", "0.4818056", "0.48179525", "0.4815718", "0.4806305", "0.4797543" ]
0.5910084
3
Find stores by district
function searchDistrict(districtID) { //Clear Form $('#region').prop('selectedIndex', 0); $('#store').prop('value', ''); //Send Post Request $.get('/stores/findStoreByDistrictManagerID/' + districtID, function (stores) { createTable(stores); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "loadDistricts(callback) {\n const searchQuery = {\n index: districtIndex,\n body: {\n size: 100,\n _source: ['properties', 'center', 'geometry'],\n },\n }\n client\n .search(searchQuery, ((error, body) => {\n if (error) {\n console.trace('error', error.message)\n }\n let districts = []\n if (body && body.hits) {\n const results = body.hits.hits\n for (const { _id, _source: { properties: district, center: { coordinates }, geometry } } of results) {\n districts.push({\n id: _id,\n name: district.Name,\n number: district.Nr,\n centerLat: coordinates[1],\n centerLon: coordinates[0],\n polygon: geometry,\n })\n }\n }\n // sort\n districts = districts.sort((a, b) => a.name.localeCompare(b.name))\n callback(districts)\n }))\n }", "function populateDistricts() {\n\n\tvar countyId = $('#select_filter_districts_by_county').val();\n\tvar searchDistrict = $(\"#id_input_search_district\").val();\n\n\trequest_url = DISTRICTS_URL;\n\trequest_params = ACTION_TYPE + \"=\" + ACTION_QUERY + \"&\" + SEARCH_KEY + \"=\"\n\t\t\t+ searchDistrict + \"&county=\" + countyId;\n\trequest_intent = INTENT_QUERY_DISTRICTS;\n\tsendPOSTHttpRequest(request_url, request_params, request_intent);\n}", "function districtSets() {\n let defaultFilter = feature => {\n return (\n feature.properties.SWCDIST_N &&\n feature.properties.SWCDIST_N.match(/\\s+[0-9]+$/)\n );\n };\n let defaultGrouping = feature => {\n return feature.properties.SWCDIST;\n };\n let defaultParser = input => {\n // Get parent name\n let parentTitle = input.SWCDIST_N.replace(/\\s+[0-9]+$/, '').trim();\n\n // Get subdistrict\n let subdistrict = input.SWCDIST_N.match(/\\s+([0-9]+)$/)[1];\n\n return {\n localId: `27-${input.SWCDIST.toString().padStart(4, '0')}`,\n title: `${parentTitle} Soil and Water Conservation District Subdistrict ${subdistrict}`,\n shortTitle: `${parentTitle} Subdistrict ${subdistrict}`,\n parentTitle,\n allCounties: _.uniq(\n input.fullGroup.map(p => {\n return p.COUNTYFIPS.toString().padStart(3, '0');\n })\n )\n };\n };\n\n return {\n 2018: {\n url:\n 'https://www.gis.leg.mn/php/shptoGeojson.php?file=/geo/data/vtd/vtd2018general',\n output: 'vtd2018general.geo.json',\n start: moment('2018-01-01'),\n end: moment('2019-12-31'),\n parser: defaultParser,\n filter: defaultFilter,\n grouping: defaultGrouping,\n countyParentYear: 2017\n },\n 2016: {\n url:\n 'https://www.gis.leg.mn/php/shptoGeojson.php?file=/geo/data/vtd/vtd2016general',\n output: 'vtd2016general.geo.json',\n start: moment('2016-01-01'),\n end: moment('2017-12-31'),\n parser: defaultParser,\n filter: defaultFilter,\n grouping: defaultGrouping,\n countyParentYear: 2017\n },\n 2014: {\n url:\n 'https://www.gis.leg.mn/php/shptoGeojson.php?file=/geo/data/vtd/vtd2014general',\n output: 'vtd2014general.geo.json',\n start: moment('2014-01-01'),\n end: moment('2015-12-31'),\n parser: defaultParser,\n filter: defaultFilter,\n grouping: defaultGrouping,\n countyParentYear: 2017\n }\n // Doesn't have name, so we can't determine the larger districts\n // 2012: {\n // url:\n // 'https://www.gis.leg.mn/php/shptoGeojson.php?file=/geo/data/vtd/vtd2012general',\n // output: 'vtd2014general.geo.json',\n // start: moment('2012-01-01'),\n // end: moment('2013-12-31'),\n // parser: defaultParser,\n // filter: defaultFilter,\n // grouping: defaultGrouping,\n // countyParentYear: 2017\n // }\n };\n}", "highlightDistrict(geoid) {\n let filterSettings;\n // Filter for which district has been selected.\n if (typeof geoid === 'object') {\n filterSettings = ['any'];\n\n geoid.forEach((i) => {\n filterSettings.push(['==', 'GEOID', i]);\n });\n } else {\n if (geoid.substring(0, 2) === '42') {\n filterSettings = ['all', ['==', 'DISTRICT', geoid.substring(2)]];\n this.toggleFilters('selected-border-pa', filterSettings);\n return;\n }\n filterSettings = ['all', ['==', 'GEOID', geoid]];\n }\n // Set that layer filter to the selected\n this.toggleFilters('selected-fill', filterSettings);\n this.toggleFilters('selected-border', filterSettings);\n }", "function searchStores() {\n var foundStores = [];\n var zipCode = document.getElementById('zip-code-input').value;\n console.log(zipCode) // zipCode entered in search area\n \n if(zipCode) {\n foundStores = stores.filter(function(store, index) {\n return zipCode === store.address.postalCode.substring(0, 5);\n });\n } else {\n foundStores = stores;\n }\n console.log(\"FOUND STORES : \", foundStores);\n \n clearLocations();\n displayStores(foundStores); //will display searched dtores according to zipcode entered in search area\n showMarkers(foundStores); // will show markers on map for found satores only\n setOnClickListener(); // onclick in store-list display area will pop up marker info on map\n}", "queryDistrictByCoordinates({ latitude, longitude }) {\n const searchQuery = {\n index: districtIndex,\n body: {\n size: 1,\n _source: ['properties.Name'],\n query: {\n geo_shape: {\n geometry: {\n relation: 'contains',\n shape: {\n type: 'point',\n coordinates: [\n longitude, latitude,\n ],\n },\n },\n },\n },\n },\n }\n\n return new Promise(((resolve, reject) => {\n client\n .search(searchQuery, ((error, body) => {\n if (error) {\n console.trace('error', error.message)\n return reject(error)\n }\n if (body && body.hits) {\n const result = body.hits.hits[0]\n if (result) {\n return resolve(result._source.properties.Name)\n }\n }\n return resolve('')\n }))\n }))\n }", "function getDistrict(LatLng) {\r\n for (var i = 0; i < 71; i++) {\r\n if(geoShapeType[i]==\"Polygon\"){\r\n if(google.maps.geometry.poly.containsLocation(LatLng, locationPolygon[i])) {\r\n return geoShapeBOROCD[i];\r\n }\r\n }else{\r\n for (var j = 0; j < locationPolygon[i].length; j++) {\r\n if(google.maps.geometry.poly.containsLocation(LatLng, locationPolygon[i][j])) {\r\n return geoShapeBOROCD[i];\r\n }\r\n }\r\n }\r\n }\r\n}", "function get_covid_all_location(districts) {\n\tfor (let district of districts.districts) {\n\t\tfetch(`http://103.148.57.200:5000/districts/${district.id}`)\n\t\t\t.then(function (response) {\n\t\t\t\treturn response.json();\n\t\t\t})\n\t\t\t.then((data) => {\n\t\t\t\tresult = {\n\t\t\t\t\tplace: district.title,\n\t\t\t\t\ttotalPositive: data.summary.totalPositive,\n\t\t\t\t\tsummary: data.summary,\n\t\t\t\t\twards: data.wards,\n\t\t\t\t};\n\t\t\t\tcovid_data.push(result);\n\t\t\t})\n\t\t\t.catch(function (err) {\n\t\t\t\tconsole.log(\"Error: \", err);\n\t\t\t});\n\t}\n}", "function show_state_wise_districts(state_id){\n\n\t$.ajax({\n\t\turl:root_path+\"/api/get_state_wise_districts.php\",\n\t\tdataType:\"JSON\",\n\t\tdata:{state_id:state_id},\n\t\ttype:\"POST\",\n\t\tsuccess: function(response){\n\t\t\tvar option=\"<option>Select District</option>\";\n\t\t\t$.each(response,function(i,v){\n\t\t\t\toption+=\"<option value='\"+v.rec_id+\"'>\"+v.district_name+\"</option>\";\n\t\t\t});\n\t\t\t$(\"#district_drop_down\").html(option);\n\t\t\t$(\"#district_drop_down_edit_mandal\").html(option);\n\t\t\t$(\"#district_drop_down_edit_village\").html(option);\n\t\t\t$(\"#district_drop_down_edit_branches\").html(option);\n\n\n\t\t}\n\t});\t\n}", "function searchRegion(regionID) {\n //Clear Form\n $('#district').prop('selectedIndex', 0);\n $('#store').prop('value', '');\n //Send Post Request\n $.get('/stores/findStoreByRegionManagerID/' + regionID, function (stores) {\n createTable(stores);\n });\n}", "function addDistrict (feature) {\n let foundId;\n for (const districtId of Object.keys(districtToGeoJSON)) {\n //console.log(`Checking if ${feature.geometry.type} is within ${districtToGeoJSON[districtId].geometry.type}`)\n\n if (within(feature, districtToGeoJSON[districtId])) {\n console.log(`\\tAdding Council District ${districtId}`)\n foundId = districtId;\n break;\n }\n }\n\n if (!foundId) {\n console.log(\"\\tWARNING: Found No matching District\")\n }\n return foundId;\n}", "function populateTrashedDistricts() {\n\n\tvar countyId = $('#select_filter_deleted_districts_by_county').val();\n\tvar searchDistrict = $(\"#id_input_search_deleted_district\").val();\n\n\trequest_url = DISTRICTS_URL;\n\trequest_params = ACTION_TYPE + \"=\" + ACTION_QUERY + \"&\" + SEARCH_KEY + \"=\"\n\t\t\t+ searchDistrict + \"&county=\" + countyId;\n\trequest_intent = INTENT_QUERY_DELETED_DISTRICTS;\n\tsendPOSTHttpRequest(request_url, request_params, request_intent);\n}", "function includesFilter(states) {\n return states.filter(state => state.includes(\"Dakota\"));\n}", "function filterByLanduse(landuse) {\n\t\tconst stations = new Set();\n\n\t\tif (!Array.isArray(landuse)) {\n\t\t\treturn { stations };\n\t\t}\n\n\t\topts.data.forEach(function (o) {\n\t\t\tif (landuse.indexOf(o.Landuse) < 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tstations.add(o.ID);\n\t\t});\n\n\t\treturn { stations };\n\t}", "getDistrictData (filterParams) {\n this.setState({districts: null})\n axios.get(url.api_url + 'district/filter?filter=' +\n JSON.stringify(filterParams)).then((response) => {\n if (response.data.length === 0) {\n this.setState({districts: -2, cur_page: -1, displayed_districts: -2})\n } else {\n this.setState({\n districts: response.data,\n cur_page: response.data.length / 16,\n displayed_districts: response.data.subarray(0, 16)\n })\n }\n }).catch((error) => {\n if (error) {\n this.setState({districts: -1})\n }\n })\n }", "function districtQuery(postcode, $targetControl) {\n 'use strict';\n\n // GET using Ajax\n var jqxhr = $.ajax({\n type: 'GET',\n url: '/service/postcode/' + postcode + '/district',\n dataType: 'json',\n success: function() { writeDistrictResults(jqxhr.responseText, $targetControl); },\n error: function() { bootbox.alert('Error looking up District'); },\n fail: function() { bootbox.alert('Problem reaching District service'); }\n });\n}", "function findStates()\n{\n var filter = '';\n\n superGroupSearchService.findStates(filter, populateStates);\n\n return false;\n}", "function selectDefaultDistrict() {\n usStatelayer.queryFeatures({\n where: propertyNames.StateLayer.Name + \"='\" + selectedMemberLocation.state + \"'\",\n returnGeometry: true,\n outFields: [propertyNames.StateLayer.Id]\n }).then(function (response) {\n var features = response.features;\n var stateFp = features[0].attributes[propertyNames.StateLayer.Id];\n stateSelected(stateFp);\n goTo(features[0].geometry, true);\n usdistrictlayer.queryFeatures({\n where: propertyNames.DistrictLayer.DistrictNumber + \"=\" + selectedMemberLocation.districtNum + \" and \" +\n propertyNames.DistrictLayer.StateId + \"=\" + stateFp,\n returnGeometry: true,\n outFields: [\"*\"]\n }).then(function (districtResponse) {\n usdistrictlayer.popupEnabled = true;\n var features = districtResponse.features;\n mapview.popup.content = (isDefined(features) && isDefined(features[0]) && isDefined(features[0].attributes)) ? getDistrictInfoByGeoid(features[0].attributes) : \"\";\n mapview.popup.open();\n });\n });\n }", "function getSelectedDistrict() {\n\treturn getCache(EXTRA_DISTRICT);\n}", "getStores() {\n Service.get(this).getStores(state.get(this).params.companyId);\n }", "function findHometownByState(state) {\r\n return users.find( x => x.hometown.state === state);\r\n}", "function getAllStations() {\n return Station.find({});\n}", "function lookupStation(stationID, year){\n if (year == 13){\n stations = stations13;\n }\n else if (year == 17) {\n stations = stations17;\n };\n\n return stations.filter(\n function(stations){ return stations.id == stationID; }\n );\n}", "function loadDistsProv(prov)\n{\n var censusId = document.distForm.censusId.value;\n var censusYear = censusId.substring(2);\n\n // get the district information file \n HTTP.getXML(\"CensusGetDistricts.php?Census=\" + censusId +\n \"&Province=\" + prov,\n gotDistFile,\n noDistFile);\n}", "function setDistrict(district) {\n return { type: 'SET_DISTRICT', district };\n}", "function getStudentCity(std_name) { // \"SK\"\n var obj = data.find(function(item) { return item.name == std_name });\n\n if (obj) {\n return obj.city;\n\n } else {\n return \"NO City Found\";\n }\n}", "function loadDistsProv(prov)\n{\n var censusSelect = document.distForm.Census;\n var census = censusSelect.value;\n var censusYear = census.substring(2);\n var xmlName;\n if (censusYear < \"1871\")\n { // pre-confederation\n xmlName = \"CensusGetDistricts.php?Census=\" + prov + censusYear;\n } // pre-confederation\n else\n { // post-confederation\n xmlName = \"CensusGetDistricts.php?Census=\" + census +\n \"&Province=\" + prov;\n } // post-confederation\n var tdNode = document.getElementById('DivisionCell');\n tdNode.innerHTML = '';\n\n // get the district information file \n HTTP.getXML(xmlName,\n gotDistFile,\n noDistFile);\n}", "function findHometownByState(state) {\n return users.find(function (val) {\n return val[state] = val.hometown.state\n })\n}", "function getFilteredTripsByDistrict(){\n let num_studios = app.num_studios;\n let num_1bed = app.num_1bed;\n let num_2bed = app.num_2bed;\n let num_3bed = app.num_3bed;\n let tot_num_bedrooms = num_studios + num_1bed + (2*app.num_2bed) + (3*app.num_3bed);\n let attr;\n let rate;\n let rate_key;\n let unit;\n let scalar;\n let proxyLandUse;\n \n for (let district of geoDistricts) {\n let personTrips = {};\n let vehicleTrips = {};\n let totalPersonTrips = {};\n let totalVehicleTripsByMode = {};\n let geoId;\n \n switch(selectedDistribution) {\n case 'district':\n geoId = addressDistrictNum;\n break;\n case 'place-type':\n geoId = addressPlaceType;\n break;\n case 'city':\n geoId = 1;\n break;\n default:\n geoId = addressDistrictNum;\n break;\n }\n \n for (let landUse of landUses) {\n attr = landUseToAttr[landUse];\n rate_key = attr['rate_key'];\n scalar = attr['scalar'];\n unit = attr['unit'];\n proxyLandUse = attr['proxyLandUse'];\n \n switch (selectedTimePeriod) {\n case 'pm':\n rate = tripGenRates[rate_key].pkhr_rate;\n break;\n case 'daily':\n rate = tripGenRates[rate_key].daily_rate;\n break;\n }\n \n let mode2=selectedMode;\n if (selectedMode == 'tnc/taxi'){\n mode2='tnc_taxi';\n }\n \n personTrips[landUse] = (rate*scalar)*filterModeSplitData(proxyLandUse, app.placetype)[0][mode2]* \n getDistProps(selectedDistribution, geoId, district,\n selectedMode, selectedDirection, proxyLandUse,\n selectedTimePeriod, selectedPurpose)\n vehicleTrips[landUse] = personTrips[landUse]/(filterAvoData(proxyLandUse.toLowerCase(), selectedTimePeriod, selectedDistribution, geoId));\n }\n //if any of the land uses are undefined b/c no input, set them equal to 0. landUses is a global array of all 5 land uses\n personTrips[\"total\"] = 0\n vehicleTrips[\"total\"] = 0\n for (let landUse of landUses) {\n if (!(personTrips[landUse])){\n personTrips[landUse] == 0;\n }\n if (!(vehicleTrips[landUse])){\n vehicleTrips[landUse] == 0;\n }\n personTrips[\"total\"] += personTrips[landUse]\n vehicleTrips[\"total\"] += vehicleTrips[landUse]\n }\n districtPersonTrips[district.dist] = personTrips; //this creates a dictionary of dictionaries, with one dictionary for every district where the keys are the land uses/total\n //and the dictionary is populated by the time period\n districtVehicleTrips[district.dist] = vehicleTrips;\n }\n}", "function setUpDistrictChart()\n{ \n let selection_area = document.getElementById(\"counties-selection-area\");\n district_selected_county = selection_area.options[selection_area.selectedIndex].text;\n let district_data = population_data.filter((population) =>\n {\n if (population.county === district_selected_county)\n {\n return true;\n }\n return false;\n });\n let districts_name = getDistrictName(district_data);\n let male_population_per_district = getMalePopulationPerDistrct(district_data);\n let female_population_per_district = getFemalePopulationPerDistrct(district_data);\n updateDistrictChart(district_chart,districts_name,male_population_per_district,female_population_per_district);\n}", "function createDistricts(){\n if (districts) {\n //create a Leaflet GeoJSON layer and add it to the map\n if (courtDistricts && typeof courtDistricts.remove === 'function') {\n courtDistricts.remove();\n }\n courtDistricts = L.geoJson(districts, {\n style: style\n }).addTo(map);\n jsonCheck = 1;\n updateActiveCases();\n\n } else if (typeof courtDistricts != 'undefined'){\n courtDistricts.remove();\n }\n console.log(courtDistricts);\n\n }", "function setPrecinctDistrict(precinctID, district) {\n precinctDistricts[precinctID] = district;\n}", "function databaseLocateWantedLocation (areaName, response, callback) {\n\tbaner.find({ $or: [ {omrade: areaName },\n\t\t{baner: { $elemMatch: { banesjef: areaName } } }, \n\t\t{baner: { $elemMatch: { banestrekninger: { $elemMatch: { banestrekning: areaName } } } } },\n\t\t{baner: { $elemMatch: { banestrekninger: { $elemMatch: { stasjoner: { $elemMatch: { \"properties.tags.name\": areaName } } } } } } } ] }, \n\t\t function(err, docs){\n\t\tif (err) {\n\t\t\tconsole.log(err);\n\t\t\tresponse.send(500)\n\t\t} else {\n\t\t\tif (docs.length > 0) {\n\t\t\t\tcallback(docs);\n\t\t\t} else {\n\t\t\t\tconsole.log(docs);\n\t\t\t\tresponse.send(500);\n\t\t\t}\n\t\t}\n\t});\n}", "function getStores(req, res) {\n \n //Can only query with storename and/or category\n if (!req.query.address && !req.query.id){ //Might not need to check this\n \n Stores.find(req.query,function(err, result) {\n if (err) throw err;\n \n //res.render('index', {errors: {}, user: JSON.stringify(result)});\n \n //return a JSON object containing a field users which is an array of User Objects.\n return res.json({stores: result});\n\n \n }).sort({__id: 1}); //Sort the query with username ascending\n\n } else {\n\n return res.json({ error: 'Invalid: Gave an address or id' });\n }\n\n}", "function district() {\n\n\t\tvar cur_districts = document.getElementsByClassName('#districts');\n\t\tif (cur_districts.length != 0) {\n\t\t\tcur_districts[0].innerHTML = \"\";\n\t\t}\n\n\t\tvar cur_legend = document.getElementsByClassName('key');\n\t\tlen = cur_legend.length;\n\t\tfor (var i = 0; i < len; i++) {\n\t\t\tcur_legend[i].parentElement.removeChild(cur_legend[i]);\n\t\t}\n\n\t\tsetselanddisptxt();\n\n\t\tsetdomains();\n\n\t\tdisplegend();\n\n\t\tdistrictsvg.selectAll(\"path\")\n\t\t.data(topojson.feature(districts, districts.objects.Dist).features)\n\t\t.enter().append(\"path\")\n\t\t.filter(function (d) {\n\t\t\tvar valcolor;\n\t\t\tif (display == \"Total\") {\n\t\t\t\tvalcolor = +d.properties[selected] * 0.0001;\n\t\t\t} else {\n\t\t\t\tif (+d.properties[selected.replace(/OSC/i, \"total\")] != 0) {\n\t\t\t\t\tvalcolor = (+d.properties[selected] / +d.properties[selected.replace(/OSC/i, \"total\")]) * 100;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t(d.properties.name != \"Pak Occupied Kashmir\") &&\n\t\t\t\t((+d.properties[selected.replace(/OSC/i, \"total\")] != 0) ||\n\t\t\t\t\t(display == \"Total\")) &&\n\t\t\t\t(statename == \"India\" || d.properties.statename == statename) &&\n\t\t\t\t((bound1 == 0 && bound2 == 0) || ((valcolor >= bound1 && valcolor <= bound2))));\n\t\t})\n\t\t.attr(\"style\", function (d) {\n\n\t\t\tvar districtcolor;\n\n\t\t\tif (display == \"Total\") {\n\t\t\t\tdistrictcolor = \"fill:\" + color(+d.properties[selected] * 0.0001) + \";opacity:1;stroke-opacity: 0;stroke-width: 0.4;\";\n\t\t\t} else {\n\t\t\t\tdistrictcolor = \"fill:\" + color((+d.properties[selected] / +d.properties[selected.replace(/OSC/i, \"total\")]) * 100) + \";opacity:1;stroke-opacity: 0;stroke-width: 0.4;\";\n\t\t\t}\n\t\t\treturn districtcolor;\n\t\t})\n\t\t.attr(\"d\", path)\n\t\t.on(\"mouseover\", displaytooltip)\n\t\t// fade out tooltip on mouse out\n\t\t.on(\"mouseout\", hidetooltip);\n\n\t}", "getNearBy(geoLoc, database, distance) {\n return database.filter((elementSearched) => {\n let userLoc = this.toGeo(elementSearched.location);\n let distance_diff = geolib.getDistance({ latitude: userLoc[0], longitude: userLoc[1] }, { latitude: geoLoc[0], longitude: geoLoc[1] });\n return distance_diff <= distance;\n });\n }", "function getAllStates(req, res) {\n const q = `\n SELECT DISTINCT STATE\n FROM County\n ORDER BY STATE\n `;\n execQuery(q, res);\n}", "function searchPlace(place, AddressBook) {\n function check(contact) {\n console.log(place);\n console.log(contact.city);\n if (contact.city == place || contact.state == place) return true;\n }\n const temp = AddressBook.filter(check);\n console.log(temp);\n}", "function search(data, countryFromList) {\n let obj = data.find((o) => o.Country === countryFromList);\n printResults(obj);\n}", "function searchContactOnCityState(firstName,city,state){\n let citySearch=record.filter(contact=>contact.firstName==firstName&&contact.city==city);\n let stateSearch=record.filter(contact=>contact.firstName==firstName&&contact.state==state);\n if (citySearch==undefined){\n if (stateSearch==undefined){\n console.log(firstName+\" does not exist.\");\n }else {console.log(contact);}\n }else {console.log(contact);}\n}", "getFindStoresEntities() {\r\n return this.store.pipe(select(StoreFinderSelectors.getFindStoresEntities));\r\n }", "function getStopCountsForDistrict(allStops, district, stopField) {\n return getStopCounts(\n allStops.filter(({ [stopField]: districtId }) => {\n return districtId && districtId === district.id;\n })\n );\n}", "function addStoresDistance(stores, query, callback) {\n var self = this, pStores = [], si, sl, st, lat, lon, checkDistance = false, fromPoint = null, toPoint = null;\n \n lat = query.location ? query.location.lat : undefined;\n lon = query.location ? query.location.lon : undefined;\n \n checkDistance = typeof lat !== 'undefined' ? true : false;\n if (checkDistance) {\n fromPoint = new Point(lat, lon);\n \n for (si = 0, sl = stores.length; si < sl; si += 1) {\n st = stores[si].fields; \n toPoint = new Point(st.location.lat, st.location.lon);\n st.distance = Math.round(fromPoint.distanceTo(toPoint));\n pStores.push(st);\n }\n }\n else {\n pStores = stores;\n }\n \n callback(null, pStores);\n}", "function chooseStations(stations) {\n // initiating the final array\n let goodStations = [];\n // iterate through the arrays or locations\n for (let station of stations) {\n // check for requirements\n if (station[1] >= 20 && (station[2] == \"school\" || station[2] == \"community centre\")) {\n // push the matches to our final array\n goodStations.push(station[0]);\n }\n }\n // return the goods\n return goodStations;\n}", "searchByProfessions( professionSearch ) {\n let itemId = this.ItemNotFound;\n let list = this.state[this.townName];\n \n \n for( let indx=0; indx<list.length; ++indx ) {\n for( let indxProf=0; indxProf<list[indx].professions.length; ++indxProf ) {\n if( list[indx].professions[indxProf].toLowerCase() === professionSearch.toLowerCase() ) {\n itemId = list[indx].id;\n break;\n } \n }\n }\n console.log('searchByProfessions :',itemId);\n\n return itemId;\n }", "searchStores() {\n StoreService.getStores((data) => {\n this.setState({ stores: data });\n });\n }", "function getPlaces(latitude, longitude) {\n\n var latLong = new google.maps.LatLng(latitude, longitude),\n\n mapOptions = {\n\n center: new google.maps.LatLng(latitude, longitude),\n zoom: 15,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n\n };\n Map = new google.maps.Map(document.getElementById('places'), mapOptions);\n\n Infowindow = new google.maps.InfoWindow();\n\n var service = new google.maps.places.PlacesService(Map);\n service.nearbySearch({\n\n location: latLong,\n radius: 500,\n type: ['restaurant']\n }, foundStoresCallback);\n\n }", "function searchbyCityOrState() {\n let inputCity = prompt(\"Enter city to search person : \");\n let inputState = prompt(\"Enter state to search person : \");\n addressBookArray.forEach(addressBook => {\n if(addressBook.city == inputCity || addressBook.state == inputState) {\n console.log(\"Person in city \" +inputCity+ \" and state \" +inputState);\n }\n });\n addressBookArray.filter(contact => contact.city == inputCity)\n addressBookArray.filter(contact => contact.city == inputCity)\n addressBookArray.forEach(contact => console.log(addressBookArray));\n}", "function getNearbyStations(nearbyList){\n //creo un array vacío para luego hacer push de los objetos(info completa de las estaciones cercanas.)\n var nearReturn = []\n\n//Creo un bucle for, que pase por todos los valores de la lista principal (sationList)\n for(i=0; i<stationsList.length; i++){\n //para cada objeto en cada indice del array station list,\n //quiero averiguar si el id coincide con el valor de\n //mi array en nearbyList.\n //\n //o sea, quiero llegar al valor de mi id:\n //---- primero encuentro cada una de las estaciones:\n var station = station[i];\n //--- luego encuentro el id de esa estación:\n var stationId = station.id;\n // o sea que stationId será un número que tengo que comparar con el\n //los valores dentro de mi arrat nearbyList[i]\n //\n //usando indexOf(numero que no existe) = -1 podemos decir que:\n if (nearbyList.indexOf(stationId) !== -1){\n console.log(station);\n }\n }\n\n return nearReturn = [{},{},{}];\n}", "function searchStore(storeNumber) {\n //Clear Form\n $('#region').prop('selectedIndex', 0);\n $('#district').prop('selectedIndex', 0);\n\n // If empty\n if (storeNumber === '' || storeNumber === null) {\n // Search all stores\n $.get('/stores/findAllStores', function (stores) {\n // Pass returned variable to create table function\n createTable(stores);\n });\n } else {\n // Send Post Request\n $.get('/stores/findStoreByStoreNumber/' + storeNumber, function (stores) {\n createTable(stores);\n });\n } \n}", "function getDistrict()\n{\n // get district\n $.ajax({\n type: \"GET\",\n url: burl + \"/district/get/\" + $(\"#province\").val(),\n success: function (data) {\n var opts = \"\";\n for(var i=0; i<data.length; i++)\n {\n opts +=\"<option value='\" + data[i].id + \"'>\" + data[i].name + \"</option>\";\n }\n $(\"#district\").html(opts);\n }\n });\n}", "function locateStations() {\n\n // iterate through each station list in the subStations array\n subStations.forEach(function (subStationList) {\n\n // increase the delay time for the api call (rate limit on api)\n subStationDelay += 1000;\n\n // wrap setTimeout in an IIFE to preserve argument values\n (function (subStationList, subStationDelay){\n \n setTimeout(function() {\n console.log('All stations aggregated so far: ', allStations.length);\n\n // attach postal code and borough for each station\n subStationList.forEach(function (station) {\n services.getStationLocation(station);\n });\n }, subStationDelay);\n\n }(subStationList, subStationDelay));\n\n });\n }", "function chooseStations() {\n let goodStations = [];\n\n for (let data of stations) {\n let value = data[1];\n if (value > 20) {\n let place = data[2];\n if (place === 'school' || place === 'community centre') {\n goodStations.push(data[0]);\n }\n }\n }\n return goodStations;\n}", "function findStateAndCity (zipCode) {\t\n\tvar queryURL = 'https://maps.googleapis.com/maps/api/geocode/json?address='+zipCode;\n\t$.ajax({\n\t\turl: queryURL,\n\t\tmethod: 'GET'\n\t}).done(function (response) {\n\t\t//extract State and longitude/latitude from Zip Code\n\t\tvar state;\n\t\tvar longitude, latitude;\n\t\tconsole.log(response);\n\t\tvar test = response.results[0].geometry.location;\n\t\tlongitude = response.results[0].geometry.location.lng;\n\t\tlatitude = response.results[0].geometry.location.lat;\n\t\tvar baseCenterMap = 'https://www.google.com/maps/embed/v1/view?key='+googleMapsAPI+'&center='+latitude+','+longitude+'&zoom=12';\n\t\t//Check if location is in USA first\n\t\tvar inUSA=false;\n\t\t//look through elements in components\n\t\t//check Long Name to see if equal to United States\n\t\tfor(elements in response.results[0].address_components){\n\t\t\tvar long_name = response.results[0].address_components[elements].long_name;\n\t\t\t// console.log(response.results[0].address_components[elements].short_name);\n\t\t\tif (long_name === 'United States') {\n\t\t\t\tconsole.log('It\\'s in the USA!');\n\t\t\t\tinUSA = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t//Check if in America\n\t\t//if not in the USA, throw error message on DOM\n\t\t\t//If NO\n\t\t\t\t//Tell user to enter American postal \n\t\tif(!inUSA){\n\t\t\tMaterialize.toast('Please enter a ZipCode in the USA', 4000);\n\t\t} else{\n\t\t\tfor(elements in response.results[0].address_components){\n\t\t\t\tvar short_name = response.results[0].address_components[elements].short_name;\n\t\t\t\t// console.log(response.results[0].address_components[elements].short_name);\n\t\t\t\tif (short_name.length === 2) {\n\t\t\t\t\tstate=short_name;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$('#gMap').attr('src', baseCenterMap);\n\t\t\t//If YES\n\t\t\t//clear current reps/senators\n\t\t\tclearMembers();\n\t\t\t//Get what STATE they are from in and feed it to Propublica \n\t\t\tproPublicaAPI(state, 'senate');\n\t\t\tproPublicaAPI(state, 'house');\n\t\t\t\t\t//Propublica Sends request for members using STATE\n\t\t\t\t\t\t//Propublica recieves State senators info and twitter handle\n\t\t\t\t\t\t\t//feed twitter Handle to twitterGetProfilePics() function\n\t\t\t\t\t\t\t\t//populate DOM with\t\n\t\t}\n\t});\n}", "async function findCoords() {\n // get store data\n const response = await axios.get(`${BACKEND_URL}/api/stores`);\n const allStores = response.data.stores;\n\n // all stores name. First element is zero so that the first store of id 1,\n // also gets the index 1 position in the arary.\n const storesName = [];\n for (let i = 0; i < allStores.length; i += 1) {\n // storesName.push(allStores[i].login);\n storesName.push(allStores[i]);\n }\n\n // get store cords\n const storeCoords = await Promise.all(storesName.map((data) => findLatLng(data)));\n\n return storeCoords;\n}", "function doFind() {\n const minasGerais = people.results.find((person) => {\n return person.location.state === 'Minas Gerais';\n });\n}", "getStore(params) {\n return Resource.get(this).resource('SupplierCompany:getStore', params);\n }", "getStores(parameters) {\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/restaurants/?filters=%7B%0A%0A%7D&latitude=${parameters.latitude}&longitude=${parameters.longitude}&mode=filter&version=3`,\n headers: { 'x-core-session-id': this.store.sessionId }\n });\n return response.data.restaurants;\n });\n }", "function districtLayer() {\n var districtsLayer = new ol.layer.Vector({\n source: new ol.source.Vector({\n url: 'https://raw.githubusercontent.com/codeforamerica/click_that_hood/master/public/data/frankfurt-main.geojson',\n format: new ol.format.GeoJSON({\n defaultDataProjection :'EPSG:4326', \n projection: 'EPSG:3857'\n })\n })\n });\n return districtsLayer;\n}", "function getListOfDistrict() {\n loadingDistrictsMaster();\n $.each(district, function(i, resData) {\n var districts = \"<option value=\" + resData.districtID + \">\" + resData.districtName + \"</option>\";\n $(districts).appendTo('#statutory_districtID');\n });\n $('#statutory_districtID').trigger(\"chosen:updated\");\n $(\"#statutory_districtID\").chosen();\n}", "function getPaymentCenters(zip) {\n var queryURI = \"/bin/services/paymentcenters.\" + zip + \".json\";\n //console.log(\"Fetching locations from: \", queryURI);\n\n $.getJSON(queryURI, function(data) {\n $.each(data.locations, function(idx, pc) {\n // Store unique identifier for this center\n this['id'] = idx;\n\n // Save lat/lon and build formatted address here for convenience\n var lat = parseFloat(this.location.lat);\n var lng = parseFloat(this.location.lng);\n this.address = this.location.addressLine1 + '<br/>' + this.location.city + ', ' + this.location.state + ' ' + this.location.zip;\n this.streetLoc = this.location.addressLine1;\n this.city = this.location.city;\n this.state = this.location.state;\n this.zip = this.location.zip;\n this.cityState = this.location.city + ', ' + this.location.state + ' ' + this.location.zip;\n // Do an initial great circle distance estimate to filter out far away results within this region\n var greatCircleDistance = distance({lat: ClientContext.get('/profile/startlat1'), lon: ClientContext.get('/profile/startlng1')}, {lat:lat, lon:lng}, 'm');\n if(greatCircleDistance <= MAX_DISTANCE) {\n paymentCenters.push({\n gcDistance: greatCircleDistance,\n paymentCenter: this\n });\n }\n });\n\n if(paymentCenters.length <= 0) {\n $('#payment-center-notice').html('No locations found near address. Please try entering a different address.');\n $('.paymentcenterresults').append(\n $('<li>').append(\n $('.paymentcenterNoStoresFound').val()\n ));\n }\n\n if(paymentCenters.length > MAX_RESULTS) {\n paymentCenters.prune(MAX_RESULTS, paymentCenters.length-1);\n }\n\n // Perform more granular distance calculation using DistanceMatrix service\n calcDistGoogle();\n });\n }", "function extractCouncilDistricts (jsonPath) {\n const districtFileContents = fs.readFileSync(jsonPath)\n const councilFeatureCollection = JSON.parse(districtFileContents)\n\n // keys are district numbers, values are GeoJSONn boundaries\n let idToBoundaryMap = {}\n\n councilFeatureCollection.features.forEach(feature => {\n const districtId = feature.properties['DISTRICT']\n if (districtId) {\n // District 1 is represented by three MultiPolygons. The first wo are are for tiny\n // islands where no sidewalks were built, so we only consider the third\n // which has an ID of \"CityCouncilDistricts.8\"\n if (districtId === 1) {\n if (feature.id === \"CityCouncilDistricts.8\") {\n console.log(`Found boundary for City Council district 1.`)\n idToBoundaryMap[districtId] = feature;\n }\n else {\n console.log(`Dicarding tiny island from District 1 where no sidewalks were built.`)\n }\n }\n else {\n console.log(`Found boundary for City Council district ${districtId}.`)\n idToBoundaryMap[districtId] = feature;\n }\n }\n })\n\n return idToBoundaryMap;\n}", "function GetAvalibleDistricts(){\n var url = config.api.url + \"wijk?ex={'k':'beschikbaar', 'v':'true'}\";\n $http({\n url: url,\n method: 'GET'\n }).success(function(data, status, headers, config) {\n $scope.avalibleWijken = data;\n console.log(\"WijkData load succesfull\");\n }).error(function(data, status, headers, config) {\n console.log(\"WijkData load failed\");\n }); \n }", "function findNearby(address) {\n var menuNearest = new Promise(function(resolve, reject) {\n pizzapi.Util.findNearbyStores(\n address, // this is super dang picky!\n 'Delivery',\n function(storeData){\n var storeID = storeData.result.Stores[0];\n var myStore = new pizzapi.Store({ID: storeID}); // note: this could all be wrong\n myStore.ID = storeData.result.Stores[0].StoreID;\n myStore.getMenu(\n function(storeData){\n menuObj = getMenuObj(storeData);\n resolve(menuObj)\n }\n )\n }\n );\n\n var getMenuObj = function(storeData){\n var menuObj = {};\n for(var item in storeData.menuByCode){\n if(isNaN(parseInt(storeData.menuByCode[item].menuData.Code)) && storeData.menuByCode[item].menuData.ProductType){\n menuObj[storeData.menuByCode[item].menuData.Name]=storeData.menuByCode[item].menuData;\n }\n }\n return menuObj\n }\n })\n return menuNearest\n}", "function searchGus(location) {\r\n hideListings();\r\n var service = new google.maps.places.PlacesService(map);\r\n service.nearbySearch({\r\n location: location,\r\n radius: radius,\r\n type: ['gas_station']\r\n }, callback);\r\n}", "function filterProvince(datum){\n if (province == null){\n return true;\n }\n else {\n return province.includes(datum);\n }\n }", "function filterProvince(datum){\n if (province == null){\n return true;\n }\n else {\n return province.includes(datum);\n }\n }", "function getPlaces(latitude, longitude) {\n\n\t var latLong = new google.maps.LatLng(latitude, longitude);\n\n\t var mapOptions = {\n\n\t center: new google.maps.LatLng(latitude, longitude),\n\t zoom: 15,\n\t mapTypeId: google.maps.MapTypeId.ROADMAP\n\n\t };\n\n\t Map = new google.maps.Map(document.getElementById(\"places\"), mapOptions);\n\n\t Infowindow = new google.maps.InfoWindow();\n\n\t var service = new google.maps.places.PlacesService(Map);\n\t service.nearbySearch({\n\n\t location: latLong,\n\t radius: 500,\n\t type: ['atm']\n\t }, foundStoresCallback);\n\n\t}", "function /*void*/ mapCityDistrict() {\n\tvar cityId = 0; \t//e.g. cityId = 1343 (set cityId to get all districts for the specified city)\n new Ajax.Request (\n 'ajaxXML', // url\n { // options\n method: 'get', // http method\n parameters: 'provider=CityDistrictMapProvider&cityId=' + cityId, // request parameters\n //indicator: 'throbbing'\n onSuccess: processCityDistrictMapSuccess,\n onFailure: processFailure\n }\n );\n}", "function gotDomains(obj)\n{\n if (obj && typeof(obj) == 'object')\n {\n var provSelect = document.distForm.Province;\n provSelect.options.length = 0; // clear the list\n\n for(var id in obj.domains)\n {\n var domain = obj.domains[id];\n var option = document.createElement('option')\n option.value = id.substring(2);\n option.text = domain;\n provSelect.add(option);\n }\n provSelect.selectedIndex = 0;\n\n // check for province passed as a parameter\n var province = 'ON';\n if ('province' in args)\n {\n province = args[\"province\"];\n }\n \n var provOpts = provSelect.options;\n for(var i = 0; i < provOpts.length; i++)\n {\n if (provOpts[i].value == province)\n { // found matching entry\n provSelect.selectedIndex = i;\n break;\n } // found matching entry\n }\n }\n else\n alert('ReqUpdateDists.js: gotDomains: ' . obj);\n}", "loadEast ({ commit }) {\n Vue.axios.get('https://wad2-hallallinone.et.r.appspot.com/restaurant/search/region/east').then(response => {\n commit('GET_RESTAURANTS', response.data)\n }).catch(error => {\n throw new Error(`API ${error}`)\n })\n }", "get selectStore() {\n return $('#select-store').selectByAttribute('value', 'valleyfair');\n }", "function showUserListDistrict(stateCode) {\n\n\tvar roleId = document.getElementById(\"roleId\").value;\n\tvar myurl = \"userdirectorydistrictlist?stateCode=\" + stateCode \n\t+ \"&roleId=\" + roleId;\n\thttpObj = new getXMLHTTPRequest();\n\thttpObj.open(\"GET\", myurl, true);\n\thttpObj.onreadystatechange = showUserListDistrictResponse;\n\thttpObj.send(null);\n\treturn true;\n}", "function getDistrictInfoByGeoid(attributes) {\n if (isDefined(attributes)) {\n var geoid = attributes.GEOID\n for (var i = 0; i < members.length; i++) {\n if (members[i].GEOID === geoid) {\n return `\n <div class=\"borderedRow\">\n <div class=\"col6\">\n <p>State: ${members[i].StateCode}</p>\n <p>District: ${members[i].StateDistrict}</p>\n <p>Representative: ${members[i].Member}</p>\n </div>\n <div class=\"col6\">\n <a href=\"${memberLink + members[i].Id}\" target=\"_blank\">\n <img src=\"https://clerkpreview.house.gov/content/assets/img/members/${members[i].Id}.jpg\"/>\n </a>\n </div>\n </div>\n `;\n }\n }\n }\n return \"\";\n }", "function handleSearch(feature) {\n clearPoint();\n if (isDefined(feature)) {\n if ((isDefined(feature.attributes.City) && feature.attributes.City !== \"\") ||\n (isDefined(feature.attributes.StAddr) && feature.attributes.StAddr !== \"\")) {\n addPoint(feature.geometry);\n usdistrictlayer.queryFeatures({\n geometry: feature.geometry,\n returnGeometry: true,\n outFields: [\"*\"]\n }).then(function (response) {\n mapview.popup.open({\n title: \"Info\",\n content: getDistrictInfoByGeoid(response.features[0].attributes),\n });\n });\n }\n }\n }", "function gettingSearchCenter(zip) {\n return dispatch => {\n dispatch(loadingPetSubmit());\n fetch(\n `https://api.mapbox.com/geocoding/v5/mapbox.places/${zip}.json?access_token=${MAPBOX_KEY}&country=us&types=postcode&limit=1`\n )\n .then(resp => resp.json())\n .then(c => {\n c.features.length === 0\n ? dispatch(didNotFetch())\n : dispatch(fetchedSearchCenter(c.features[0].center.reverse()));\n });\n };\n}", "function getTax(province){\n \t\t\tvar columns = ['itemid','internalid','state','country'];\n \t\t\tvar taxSearch = search.create({\n \t\t\t\ttype:search.Type.TAX_GROUP,\n \t\t\t\ttitle:'Find tax group',\n \t\t\t\tcolumns:columns,\n \t\t\t\tfilters:[['description','contains',province]]\n \t\t\t});\n\n \t\t\tvar results = taxSearch.run().getRange({start: 0, end: 1000});\n \t\t\tlog.debug ({\n title: 'Finding tax results',\n details: results.length\n });\n\n\t\t\tvar internalid = searchResults(results,columns);\n\t\t\t//handle outside canada\n\t\t\tif(!internalid){\n\t\t\t\tinternalid = 4288;\n\t\t\t}\n\t\t\tlog.debug ({\n title: 'Tax result',\n details: internalid\n });\n\t \t\treturn internalid;\n\t\t }", "async getLocationCity(latitude, longitude) {\r\n this.filterItemsJson = [];\r\n const apiCurrentLocation = `${process.env.GOOGLE_GEO_CODE_URL}${latitude},${longitude}&key=${this.apiKey}`;\r\n const filterItemsJson = await dxp.api(apiCurrentLocation);\r\n const currentCountryLocation = filterItemsJson.results[1].address_components;\r\n const city = this.findResult(currentCountryLocation, 'locality');\r\n const state = this.findResult(currentCountryLocation, 'administrative_area_level_1');\r\n const country = this.findResult(currentCountryLocation, 'country');\r\n const currentLocationSearch = {};\r\n currentLocationSearch['description'] = `${city}, ${state}, ${country}`;\r\n return currentLocationSearch;\r\n }", "getStores(companyId) {\n // Reset\n this.displayData.stores = [];\n // Retrieve stores and store\n return Resource.get(this).resource('Store:getStores', {companyId})\n .then((stores) => {\n // Remove extra stuff\n this.displayData.stores = stores.filter((store) => {\n return store._id;\n });\n });\n }", "neighborhood(){\n return store.neighborhoods.find(neighborhood=>{\n return neighborhood.id === this.neighborhoodId\n })\n }", "function getDistrictName(district_data)\n{\n let districts_name = [];\n for (let i = 0; i < district_data.length; i++)\n {\n districts_name.push(district_data[i].district);\n }\n return districts_name;\n}", "function filterByState(state){\r\n\r\n let filtered = countyNames.filter(e=> e.state === state)\r\n let result = []\r\n filtered.forEach(e=>result.push(e.county+ \":\" + e.state))\r\n //result.push(\"all:\"+state)\r\n return(result)\r\n}", "function doFind() {\n const found = people.results.find((person) => {\n return person.location.state === 'Minas Gerais';\n });\n console.log(found);\n}", "static lookupLocation(country, state) {\n return this.locationsForCountry(country)\n .find(x => x.state === state);\n\n }", "function findData (d, countryCodes, country_data) {\n var country_name = \"\";\n for (var j = 0; j < countryCodes.length; j++)\n {\n if (countryCodes[j].id == d.id)\n {\n country_name = countryCodes[j].name;\n break;\n }\n }\n\n for (j = 0; j < country_data.length; j++)\n {\n if (country_data[j].Name == country_name)\n {\n return (country_data[j]);\n }\n }\n}", "function getSearches(cb) {\n const query = \"recipes.searches\"\n db.findOneSorted({\"_id\": \"server\", [query] : { \"$exists\" : true }}, { [query] : 1 }, data => {\n if (!data) {\n const err = {\n \"error\" : 404,\n \"payload\" : \"There is no recipe search info\"\n }\n return cb(err);\n };\n return cb(null, data.recipes.searches);\n });\n}", "function load_district_ps(district_id, ps_id, state_val, district_val, ps_val, sameasper_val, sameasper_id){\n data = {\"state\":state_val};\n reset_select(district_id, \"Select District\");\n $.ajax({ url: district_url,\n data: data,\n success: function(data){\n $.each(data, function(key, resource) {\n if(resource[0] == district_val){\n $('#'+district_id).append($(\"<option></option>\").attr(\"value\",resource[0]).attr('selected', 'selected').text(resource[1]));\n }else{\n $('#'+district_id).append($(\"<option></option>\").attr(\"value\",resource[0]).text(resource[1]));\n }\n });\n\n //Police Station\n data = {\"state\": state_val, \"district\":district_val };\n reset_select(\"fir_victimpolicestation\", \"Select Police Station\");\n\n $.ajax({ url: police_station_url,\n data: data,\n success: function(data){\n $.each(data, function(key, resource) {\n if(resource[0] == ps_val){\n $('#'+ps_id).append($(\"<option></option>\").attr(\"value\",resource[0]).attr('selected', 'selected').text(resource[1]));\n }else{\n $('#'+ps_id).append($(\"<option></option>\").attr(\"value\",resource[0]).text(resource[1]));\n }\n });\n if(sameasper_val==\"Yes\"){\n $('#'+sameasper_id).click();\n }\n }});\n\n\n }\n });\n}", "function load_district_ps(district_id, ps_id, state_val, district_val, ps_val, sameasper_val, sameasper_id){\n data = {\"state\":state_val};\n reset_select(district_id, \"Select District\");\n $.ajax({ url: district_url,\n data: data,\n success: function(data){\n $.each(data, function(key, resource) {\n if(resource[0] == district_val){\n $('#'+district_id).append($(\"<option></option>\").attr(\"value\",resource[0]).attr('selected', 'selected').text(resource[1]));\n }else{\n $('#'+district_id).append($(\"<option></option>\").attr(\"value\",resource[0]).text(resource[1]));\n }\n });\n\n //Police Station\n data = {\"state\": state_val, \"district\":district_val };\n reset_select(\"fir_victimpolicestation\", \"Select Police Station\");\n\n $.ajax({ url: police_station_url,\n data: data,\n success: function(data){\n $.each(data, function(key, resource) {\n if(resource[0] == ps_val){\n $('#'+ps_id).append($(\"<option></option>\").attr(\"value\",resource[0]).attr('selected', 'selected').text(resource[1]));\n }else{\n $('#'+ps_id).append($(\"<option></option>\").attr(\"value\",resource[0]).text(resource[1]));\n }\n });\n if(sameasper_val==\"Yes\"){\n $('#'+sameasper_id).click();\n }\n }});\n\n\n }\n });\n}", "function getDoctors(data,callback){\n MongoClient.connect(uri, function (err, db) {\n assert.equal(null, err);\n var conditions;\n if(data === \"all\"){\n conditions = null;\n }else {\n conditions = {\n $text: {\n $search: data,\n $language: \"en\",\n $caseSensitive: false,\n $diacriticSensitive: false\n }\n };\n }\n db.collection('doctors').find(conditions).toArray(function(err, docs){\n assert.equal(null, err);\n callback(docs);\n db.close();\n });\n\n });\n}", "function searchData(){\n var dd = dList\n var q = document.getElementById('filter').value;\n var data = dd.filter(function (thisData) {\n return thisData.name.toLowerCase().includes(q) ||\n thisData.rotation_period.includes(q) ||\n thisData.orbital_period.includes(q) || \n thisData.diameter.includes(q) || \n thisData.climate.includes(q) ||\n thisData.gravity.includes(q) || \n thisData.terrain.includes(q) || \n thisData.surface_water.includes (q) ||\n thisData.population.includes(q)\n });\n showData(data); // mengirim data ke function showData\n}", "showAllCities (items) {\n let containsName = items.filter(item => item.name.toLocaleLowerCase().includes(this.searching.toLocaleLowerCase()) && item.fcodeName !== 'airport')\n\n containsName.forEach(place => {\n if (place.bbox) {\n let places = {\n 'key': place.name,\n 'value': place.countryName,\n 'north': place.bbox.north,\n 'south': place.bbox.south,\n 'west': place.bbox.west,\n 'east': place.bbox.east,\n 'lat': place.lat,\n 'lng': place.lng\n }\n this.cityPlace.push(places)\n }\n }\n )\n }", "async getAllStations() {\n let url = this.getStationsUnrestrictedEndpoint(\"\")\n try {\n let response = await this.performRequest(url)\n if(response.error) return {error: response.error}\n return response.locations\n } catch(e) {\n return {error:e}\n }\n\n }", "async function getStores() {\n\n try {\n const response = await HTTP.get('/services/stores');\n return response.data.stores;\n\n } catch (error) {\n console.error(error);\n }\n }", "async function locateBusiness(req, res) {\n \n try {\n const businesses = await db.any(\n \"SELECT * FROM businesses WHERE street_address=${street_address} AND city=${city} AND state=${state} AND zip=${zip}\",\n req.body\n );\n return res.status(200).json(businesses);\n } catch (err) {\n res.status(500).json(err.message);\n }\n}", "function studentsInHouse(house) {\n const houseStudents = students.filter(inHouse);\n function inHouse(student) {\n if (student.house === house) {\n return true;\n } else {\n return false;\n }\n }\n return houseStudents;\n}", "function showDistricts(str) {\n if (str==\"\") {\n document.getElementById(\"s_district\").innerHTML=\"\";\n return;\n }\n if (window.XMLHttpRequest) {\n // code for IE7+, Firefox, Chrome, Opera, Safari\n xmlhttp=new XMLHttpRequest();\n } else { // code for IE6, IE5\n xmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n xmlhttp.onreadystatechange=function() {\n if (this.readyState==4 && this.status==200) {\n document.getElementById(\"s_district\").innerHTML=this.responseText;\n }\n };\n xmlhttp.open(\"GET\",\"http://localhost/storelocator/supports/ajax_calls/getDristicts.php?q=\"+str,true);\n xmlhttp.send();\n}", "function findStations (stop) {\n\tfor (i = 0; i < trainLines.length; i++) {\n\t\tif (trainLines[i].stations.includes(stop)) {\n\t\t\treturn trainLines[i].stations.indexOf(stop);\t\t\t\n\t\t}\n\t}\n}", "[TYPE.M_SAVE_CINEMA_LIST](state,name){\n let newList = storageUtils.readDistrict();\n state.cinemaList = newList.filter(item=>item.districtName === name) \n }", "static async findByPostalCode(req, res) {\n let result,\n logger = Logger.create(\"findByPostalCode\", req.trackId);\n\n logger.info(\"enter\", {query: req.query});\n\n // Try to find records\n try {\n result = await AddressSrv.client.findByPostalCode(\n req.params.code,\n req.query.countryCode,\n logger.trackId\n );\n\n logger.info(\"address service findByPostalCode success\", result);\n }\n catch(error) {\n logger.error(\"address service findByPostalCode error\", error);\n return res.serverError(error);\n }\n\n res.success(result);\n }", "async function query(currCountry, currCity) {\n let db = await mongoService.connect();\n let res = await db\n .collection(USERS_COLLECTION)\n .find({ \"address.city\": currCity, \"address.country\": currCountry })\n .toArray();\n return res;\n}" ]
[ "0.6052889", "0.59486824", "0.5925734", "0.5824342", "0.5639068", "0.5557288", "0.55348706", "0.5528033", "0.54513234", "0.5431554", "0.5410327", "0.53406394", "0.5332917", "0.52601254", "0.52437896", "0.52402973", "0.5229046", "0.52225107", "0.5187601", "0.515177", "0.5150854", "0.5148448", "0.51475084", "0.5111199", "0.5098623", "0.502422", "0.5018484", "0.50012684", "0.49891573", "0.49783128", "0.4972461", "0.49527055", "0.4941155", "0.4940277", "0.49310276", "0.49200878", "0.48499423", "0.48480818", "0.4846374", "0.48334992", "0.4830156", "0.48119336", "0.48104918", "0.48070467", "0.48036185", "0.4791414", "0.478875", "0.47860545", "0.47669217", "0.47667384", "0.4764317", "0.47602108", "0.4759396", "0.475892", "0.4748098", "0.47467065", "0.47445402", "0.47424194", "0.4741212", "0.4737617", "0.47360304", "0.47298554", "0.47287798", "0.47285822", "0.47137934", "0.4713139", "0.4713139", "0.4712438", "0.4692029", "0.46843538", "0.46680987", "0.4667645", "0.46535966", "0.465234", "0.46500638", "0.46491227", "0.46359432", "0.462942", "0.46280828", "0.4627906", "0.46241927", "0.46171746", "0.46144843", "0.46112838", "0.46007928", "0.45897716", "0.45865315", "0.45865315", "0.4583797", "0.45777392", "0.4573703", "0.456376", "0.45622814", "0.45622167", "0.4552008", "0.45479167", "0.45458663", "0.45453635", "0.45449865", "0.45438203" ]
0.6341829
0
Find stores by region
function searchRegion(regionID) { //Clear Form $('#district').prop('selectedIndex', 0); $('#store').prop('value', ''); //Send Post Request $.get('/stores/findStoreByRegionManagerID/' + regionID, function (stores) { createTable(stores); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchStores() {\n var foundStores = [];\n var zipCode = document.getElementById('zip-code-input').value;\n console.log(zipCode) // zipCode entered in search area\n \n if(zipCode) {\n foundStores = stores.filter(function(store, index) {\n return zipCode === store.address.postalCode.substring(0, 5);\n });\n } else {\n foundStores = stores;\n }\n console.log(\"FOUND STORES : \", foundStores);\n \n clearLocations();\n displayStores(foundStores); //will display searched dtores according to zipcode entered in search area\n showMarkers(foundStores); // will show markers on map for found satores only\n setOnClickListener(); // onclick in store-list display area will pop up marker info on map\n}", "function searchRegion (name,valuePlace,data)\r\n {\r\n _.forEach(data, function(value)\r\n {\r\n if(value.name == valuePlace && value.region == name)\r\n {\r\n console.log(value);\r\n returnVal = [name+\" \" + valuePlace + \" is Found\",value];\r\n return false;\r\n }\r\n else\r\n searchRegion(name,valuePlace,value.place);\r\n });\r\n return returnVal;\r\n }", "function getInfoByregion(region, typeOfInfo = 0) {\n currentRegionInfo = []\n regionInfo[region].forEach(el => {\n el && currentRegionInfo.push([el, coronaInfo[el]])\n })\n\n currentRegionInfo = Object.values(currentRegionInfo).filter((el) => { /// filter undefineds prevents bugs\n if (el[1]) {\n return true;\n } else false;\n })\n}", "getStores(parameters) {\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/restaurants/?filters=%7B%0A%0A%7D&latitude=${parameters.latitude}&longitude=${parameters.longitude}&mode=filter&version=3`,\n headers: { 'x-core-session-id': this.store.sessionId }\n });\n return response.data.restaurants;\n });\n }", "getStores() {\n Service.get(this).getStores(state.get(this).params.companyId);\n }", "function getRegion(coords){\n for (var region of regions){\n if (region.has(coords)){\n return region\n }\n }\n\n // No existing regions had the cell\n return undefined\n }", "getFindStoresEntities() {\r\n return this.store.pipe(select(StoreFinderSelectors.getFindStoresEntities));\r\n }", "get regions() {\n return this.getNodeByVariableCollectionId('regions').variableCollection;\n }", "function getIslandRegions (island, db = connection) {\n if (island === 'all') {\n island = '%'\n }\n\n return db('regions')\n .where(db.raw('LOWER(island)'), 'like', island.toLowerCase())\n}", "static getAllRegions() {\n const url = `${API_URL}/region/`\n return axios.get(url)\n }", "function regionLookup(client, regionName, cache, cb) {\n if (cache[regionName]) cb(null, cache[regionName]);\n else regionRequester(client, regionName, function(err, result) {\n if (err) cb(err);\n else {\n for(var i = 0; i < result.length; i++) {\n if (result[i].regionName == regionName) {\n cache[regionName] = result[i];\n cb(null, result[i]);\n return;\n }\n }\n cb(new Error((\"Region not found: \" + regionName)));\n }\n });\n }", "function allLocations(store){\n pushHoursOpen(store);\n perHour(store);\n pushToSales(store);\n}", "function filterResult(region) {\n const result = []\n if (region == \"All\") {\n renderResult(data)\n\n }\n else {\n for (let country of data) {\n if (country['region'] == region) {\n result.push(country)\n }\n }\n renderResult(result)\n }\n\n}", "function loopStores(){\n for (var i = 0; i < storeObjects.length; i++){\n allLocations(storeObjects[i]);\n }\n}", "getAvailableStores() {\n // Call the function to load all available stores\n var data = autocomplete.cloudLoadAvailableStores().then((value) => {\n // Get the stores and ids\n var titles = value.titles;\n var ids = value.ids;\n var addrs = value.addrs;\n var names = value.names;\n\n // Save the names and ids to the state\n var temp = [];\n for (var i = 0; i < ids.length; i++) {\n temp.push({\n title: titles[i],\n id: ids[i],\n addr: addrs[i],\n storeName: names[i]\n });\n }\n\n temp.push({\n title: \"Register a store...\",\n id: -1\n });\n\n return temp;\n });\n\n return data;\n }", "async findRegion(req, res, next) {\n let region = await Region.findOne({ \n where: { regionID: req.params.id },\n include: [\n {\n model: Country,\n attributes: [\n \"countryID\",\n \"countryName\"\n ],\n include: [ {\n model: City,\n attributes: [\n \"cityName\",\n \"cityID\",\n ],\n } \n ],\n },\n ], \n });\n\n if (!region) {\n res.status(404).json({ \n status: 404,\n ok: false,\n title: 'Not Found',\n detail: 'There are no registered users in the database',\n message: 'Region not found' });\n } else {\n req.region = region;\n next();\n }\n }", "function selectRegion(){\n let selectedOption = document.getElementById('region-filter')\n let selectedValue = selectedOption.options[selectedOption.selectedIndex].value\n if(selectedValue === 'Africa'){\n countryToShow = state.countryList.filter((country) =>\n country.region.includes(selectedValue)\n );\n renderCountries(countryToShow);\n }else if(selectedValue === 'America'){\n countryToShow = state.countryList.filter((country) =>\n country.region.includes(selectedValue)\n );\n renderCountries(countryToShow);\n }else if(selectedValue === 'Asia'){\n countryToShow = state.countryList.filter((country) =>\n country.region.includes(selectedValue)\n );\n renderCountries(countryToShow);\n }else if(selectedValue === 'Europe'){\n countryToShow = state.countryList.filter((country) =>\n country.region.includes(selectedValue)\n );\n renderCountries(countryToShow);\n }else if(selectedValue === 'Oceania'){\n countryToShow = state.countryList.filter((country) =>\n country.region.includes(selectedValue)\n );\n renderCountries(countryToShow);\n }else {\n renderCountries(state.countryList);\n return;\n }\n }", "function getLocation(lat, lng) {\n\tvar region = false;\n\tvar regionID;\n\tvar regions = [\n\t\t['Monschau', 'Schleiden', 'Bad Münstereifel', 'Rheinland-Pfalz', 'Rheinland-Pfalz', 'Rheinland-Pfalz', 'Hessen', 'Hessen', 'Hessen', 'Hessen'],\n\t\t['Aachen', 'Zülpich', 'Euskirchen', 'Bonn', 'Rheinland-Pfalz', 'Rheinland-Pfalz', 'Hessen', 'Hessen', 'Hessen', 'Hessen'],\n\t\t['Geilenkirchen', 'Düren', 'Köln', 'Köln-Mülheim', 'Waldbröl', 'Freudenberg', 'Siegen', 'Hessen', 'Hessen', 'Hessen'],\n\t\t['Heinsberg', 'Mönchengladbach', 'Neuss', 'Solingen', 'Gummersbach', 'Olpe', 'Schmallenberg', 'Bad Berleburg', 'Hessen', 'Hessen'],\n\t\t['Nettetal', 'Krefeld', 'Düsseldorf', 'Wuppertal', 'Hagen', 'Iserlohn', 'Arnsberg', 'Brilon', 'Hessen', 'Hessen'],\n\t\t['Geldern', 'Moers', 'Duisburg', 'Essen', 'Dortmund', 'Unna', 'Soest', 'Büren', 'Marsberg', 'Warburg'],\n\t\t['Kleve', 'Wesel', 'Dorsten', 'Recklinghausen', 'Lünen', 'Hamm/Westfalen', 'Beckum', 'Lippstadt', 'Paderborn', 'Bad Driburg'],\n\t\t['Emmerich am Rhein', 'Bocholt', 'Borken', 'Coesfeld', 'Münster', 'Warendorf', 'Rheda-Wiedenbrück', 'Gütersloh', 'Detmold', 'Bad Pyrmont'],\n\t\t['The Netherlands', 'The Netherlands', 'Vreden', 'Ahaus', 'Steinfurt', 'Lengerich', 'Bad Ilburg', 'Bielefeld', 'Herford', 'Niedersachsen'],\n\t\t['The Netherlands', 'The Netherlands', 'The Netherlands', 'Niedersachsen', 'Rheine', 'Ibbenbüren', 'Niedersachsen', 'Lübbecke', 'Minden', 'Niedersachsen']\n\t];\n\tif ( lat >= 50.4 && lat < 52.4 && lng >= 6.0 && lng < 9.333333 ) {\n\t\tvar latIndex = Math.floor((lat-50.4)*5); // 5 tiles per degree\n\t\tvar lngIndex = Math.floor((lng-6.0)*3); // 3 tiles per degree\n\t\tregion = regions[latIndex][lngIndex];\n\t};\n if ( region != 'The Netherlands' ) {\n regionID = 5500-latIndex*200+lngIndex*2+2;\n\t};\n\tif ( lat >= 50.9 && lat < 51.1 && lng >= 5.666666 && lng < 6.0 ) {\n\t\tregion = 'Selfkant';\n\t\tregionID = 5000;\n\t};\n return [ region, regionID ];\n}", "function search(location) {\r\n switch (carType) {\r\n case \"gus\":\r\n searchGus(location);\r\n break;\r\n case \"eletric\":\r\n searchEletric(location);\r\n }\r\n}", "async function findCoords() {\n // get store data\n const response = await axios.get(`${BACKEND_URL}/api/stores`);\n const allStores = response.data.stores;\n\n // all stores name. First element is zero so that the first store of id 1,\n // also gets the index 1 position in the arary.\n const storesName = [];\n for (let i = 0; i < allStores.length; i += 1) {\n // storesName.push(allStores[i].login);\n storesName.push(allStores[i]);\n }\n\n // get store cords\n const storeCoords = await Promise.all(storesName.map((data) => findLatLng(data)));\n\n return storeCoords;\n}", "function getRegionFromCountry(cc) {\n var region;\n for (var regionKey in LoLRegions) {\n var countries = LoLRegions[regionKey].countries;\n _.forOwn(countries, function(key, countryIndex) {\n if (cc == countries[countryIndex]) {\n region = LoLRegions[regionKey];\n return LoLRegions[regionKey];\n }\n });\n }\n\n //if no region, set name to noserver\n if (!region) {\n region = {name: 'noserver'};\n }\n return region;\n }", "findStoresAction(queryText, searchConfig, longitudeLatitude, countryIsoCode, useMyLocation, radius) {\r\n if (useMyLocation && this.winRef.nativeWindow) {\r\n this.clearWatchGeolocation(new StoreFinderActions.FindStoresOnHold());\r\n this.geolocationWatchId = this.winRef.nativeWindow.navigator.geolocation.watchPosition((pos) => {\r\n const position = {\r\n longitude: pos.coords.longitude,\r\n latitude: pos.coords.latitude,\r\n };\r\n this.clearWatchGeolocation(new StoreFinderActions.FindStores({\r\n queryText: queryText,\r\n searchConfig: searchConfig,\r\n longitudeLatitude: position,\r\n countryIsoCode: countryIsoCode,\r\n radius: radius,\r\n }));\r\n }, () => {\r\n this.globalMessageService.add({ key: 'storeFinder.geolocationNotEnabled' }, GlobalMessageType.MSG_TYPE_ERROR);\r\n this.routingService.go(['/store-finder']);\r\n });\r\n }\r\n else {\r\n this.clearWatchGeolocation(new StoreFinderActions.FindStores({\r\n queryText: queryText,\r\n searchConfig: searchConfig,\r\n longitudeLatitude: longitudeLatitude,\r\n countryIsoCode: countryIsoCode,\r\n radius: radius,\r\n }));\r\n }\r\n }", "findStoresAction(queryText, searchConfig, longitudeLatitude, countryIsoCode, useMyLocation, radius) {\r\n if (useMyLocation && this.winRef.nativeWindow) {\r\n this.clearWatchGeolocation(new FindStoresOnHold());\r\n this.geolocationWatchId = this.winRef.nativeWindow.navigator.geolocation.watchPosition((pos) => {\r\n const position = {\r\n longitude: pos.coords.longitude,\r\n latitude: pos.coords.latitude,\r\n };\r\n this.clearWatchGeolocation(new FindStores({\r\n queryText: queryText,\r\n searchConfig: searchConfig,\r\n longitudeLatitude: position,\r\n countryIsoCode: countryIsoCode,\r\n radius: radius,\r\n }));\r\n }, () => {\r\n this.globalMessageService.add({ key: 'storeFinder.geolocationNotEnabled' }, _spartacus_core__WEBPACK_IMPORTED_MODULE_1__[\"GlobalMessageType\"].MSG_TYPE_ERROR);\r\n this.routingService.go(['/store-finder']);\r\n });\r\n }\r\n else {\r\n this.clearWatchGeolocation(new FindStores({\r\n queryText: queryText,\r\n searchConfig: searchConfig,\r\n longitudeLatitude: longitudeLatitude,\r\n countryIsoCode: countryIsoCode,\r\n radius: radius,\r\n }));\r\n }\r\n }", "loadEast ({ commit }) {\n Vue.axios.get('https://wad2-hallallinone.et.r.appspot.com/restaurant/search/region/east').then(response => {\n commit('GET_RESTAURANTS', response.data)\n }).catch(error => {\n throw new Error(`API ${error}`)\n })\n }", "searchStores() {\n StoreService.getStores((data) => {\n this.setState({ stores: data });\n });\n }", "async function getRegions() {\n let fetchRegions = await fetch(`${APP_SERVER}/regions`, {\n method: 'GET',\n headers: {\n \"Content-Type\": \"application/json\",\n \"Authorization\": `Bearer ${token}`\n }\n });\n\n let allRegions = await fetchRegions.json();\n let regions = allRegions.data;\n \n console.log(regions);\n\n if (regions) {\n return regions;\n } else {\n console.log(\"[ERROR] Regions: NO REGIONS FOUND!, error msg: \" + regions);\n }\n}", "getRegions(stage) {\n return this.meta.getRegions(stage);\n }", "function FindMetaDataForRegion(region) {\n // Check in the region cache first. This will find all entries we have\n // already resolved (parsed from a string encoding).\n var md = regionCache[region];\n if (md)\n return md;\n for (var countryCode in dataBase) {\n var entry = dataBase[countryCode];\n // Each entry is a string encoded object of the form '[\"US..', or\n // an array of strings. We don't want to parse the string here\n // to save memory, so we just substring the region identifier\n // and compare it. For arrays, we compare against all region\n // identifiers with that country code. We skip entries that are\n // of type object, because they were already resolved (parsed into\n // an object), and their country code should have been in the cache.\n if (Array.isArray(entry)) {\n for (var n = 0; n < entry.length; n++) {\n if (typeof entry[n] == \"string\" && entry[n].substr(2,2) == region) {\n if (n > 0) {\n // Only the first entry has the formats field set.\n // Parse the main country if we haven't already and use\n // the formats field from the main country.\n if (typeof entry[0] == \"string\")\n entry[0] = ParseMetaData(countryCode, entry[0]);\n var formats = entry[0].formats;\n var current = ParseMetaData(countryCode, entry[n]);\n current.formats = formats;\n return entry[n] = current;\n }\n\n entry[n] = ParseMetaData(countryCode, entry[n]);\n return entry[n];\n }\n }\n continue;\n }\n if (typeof entry == \"string\" && entry.substr(2,2) == region)\n return dataBase[countryCode] = ParseMetaData(countryCode, entry);\n }\n }", "async getStoreByTags() {\n // Get result\n const result = await StoreService.getStoreByTags(this.tags, this.page.number, this.page.orderby, this.page.limit);\n\n // Update the state\n\t\tthis.setState({\n isLoading: false,\n stores: result.data.response.length > 0 ? result.data.response : null\n\t\t});\n }", "static getAllRegionsById(region_id) {\n const url = `${API_URL}/region/${region_id}`\n return axios.get(url)\n }", "function findStates()\n{\n var filter = '';\n\n superGroupSearchService.findStates(filter, populateStates);\n\n return false;\n}", "async function getStores() {\n\n try {\n const response = await HTTP.get('/services/stores');\n return response.data.stores;\n\n } catch (error) {\n console.error(error);\n }\n }", "static regions() {\n return new NS1Request('get', `/monitoring/regions`)\n }", "static get regions() {\n\t\treturn [];\n\t}", "getStore(params) {\n return Resource.get(this).resource('SupplierCompany:getStore', params);\n }", "function search(destination, type) {\n\t\"use strict\";\n\tvar i;\n\tfor (i = 0; i < listAllDestinations.length; i += 1) {\n\t\tif (listAllDestinations[i].region === destination && listAllDestinations[i].packageType === type) {\n\t\t\treturn listAllDestinations[i];\n\t\t}\n\t}\n}", "_findSpotPricesForRegion({pricePoints}) {\n debugger;\n let zones = {};\n\n for (let pricePoint of pricePoints) {\n let instanceType = pricePoint.InstanceType;\n let time = new Date(pricePoint.Timestamp);\n let price = toFloat(pricePoint.SpotPrice, 10);\n let zone = pricePoint.AvailabilityZone;\n\n if (!zones[zone]) {\n zones[zone] = {};\n }\n if (!zones[zone][instanceType]) {\n zones[zone][instanceType] = [];\n }\n\n zones[zone][instanceType].push({price, time});\n }\n\n let prices = [];\n\n for (let zone in zones) {\n for (let instanceType in zones[zone]) {\n let price = this._findSpotPriceForInstanceType(zones[zone][instanceType]);\n prices.push({zone, instanceType, price});\n }\n }\n\n return prices;\n }", "function getRegions (req, res, next) {\n return db.Countries\n .findAll({\n attributes: ['region'],\n group: 'region'\n })\n .map(data => data.region)\n .then(data => {\n req.resJson = { data }\n return next()\n })\n .catch(error => next(error))\n}", "function getRegion($region_ville){\n $('input.autocomplete-region').autocomplete({\n data: $region_ville,\n limit: 20, // The max amount of results that can be shown at once. Default: Infinity.\n onAutocomplete: function(val) {\n // Callback function when value is autcompleted.\n $.ajax({\n url: '/booking/city_or_region/'+val,\n type: 'GET',\n cache: false,\n contentType: false,\n processData: false,\n beforeSend: function(){},\n success: function(data_json){\n data = $.parseJSON(data_json);\n if (data.status==\"ok\") {\n if (data.page==\"search\") {\n $('#autocompelet-center').empty();\n $('#autocompelet-center').html(data.html);\n $('select').material_select();\n }\n }\n },\n error: function() {\n alert(\"Une erreur est survenue\");\n }\n\n });\n },\n minLength: 1, // The minimum length of the input for the autocomplete to start. Default: 1.\n });\n }", "getAllRegions() {\n return document.getElementsByClassName(A11yClassNames.REGION);\n }", "regionFilter(event) {\n const regionValue = event.target.value\n // updates search value to filter countries by region\n this.setState({ regionValue })\n }", "function filterByRegion(){\n for(var i = 0; i < regions.length; i++){\n regions[i].addEventListener(\"click\", function(){showCountries(\"region/\" + this.getAttribute(\"data-region\"));\n filterDiv.style.display = \"none\";\n });\n }\n}", "async getRegionItems(name) {\n const values = await this.cockpit.regionData(name);\n const template = await this.cockpit.regionGet(name);\n return { data: {values, template}, name };\n }", "getStores(companyId) {\n // Reset\n this.displayData.stores = [];\n // Retrieve stores and store\n return Resource.get(this).resource('Store:getStores', {companyId})\n .then((stores) => {\n // Remove extra stuff\n this.displayData.stores = stores.filter((store) => {\n return store._id;\n });\n });\n }", "function regions(request, response) {\n\n console.log(\"get all regions\");\n\n db.find({\"agency.region\": new RegExp('.')}, function (err, docs) {\n\n var map = new HashMap();\n var result = [];\n\n for(var i = 0; i < docs.length; i++) {\n\n var agency = docs[i].agency;\n var key = agency.region;\n\n if(!map.has(key)) {\n map.set(key, key);\n result.push(\n {\n region: agency.region,\n lat: agency.lat,\n lon: agency.lon,\n geohash: agency.geohash\n })\n console.log('regions:key:' + key + ' = ' + JSON.stringify(agency));\n }\n }\n\n result.sort(function(regionA, regionB) {\n if(regionA.region < regionB.region )\n return -1;\n else if (regionA.region > regionB.region)\n return 1;\n else\n return 0;\n });\n\n response.send(JSON.stringify(result))\n\n });\n\n}", "function getStoreLocs(addLat, addLong) {\n let url = 'parsed.json';\n $.getJSON(url, function (json) {\n let storeArr = json;\n findNearest(addLat, addLong, storeArr)\n })\n}", "function doFind() {\n const minasGerais = people.results.find((person) => {\n return person.location.state === 'Minas Gerais';\n });\n}", "function test_service_catalog_orchestration_global_region() {}", "function databaseLocateWantedLocation (areaName, response, callback) {\n\tbaner.find({ $or: [ {omrade: areaName },\n\t\t{baner: { $elemMatch: { banesjef: areaName } } }, \n\t\t{baner: { $elemMatch: { banestrekninger: { $elemMatch: { banestrekning: areaName } } } } },\n\t\t{baner: { $elemMatch: { banestrekninger: { $elemMatch: { stasjoner: { $elemMatch: { \"properties.tags.name\": areaName } } } } } } } ] }, \n\t\t function(err, docs){\n\t\tif (err) {\n\t\t\tconsole.log(err);\n\t\t\tresponse.send(500)\n\t\t} else {\n\t\t\tif (docs.length > 0) {\n\t\t\t\tcallback(docs);\n\t\t\t} else {\n\t\t\t\tconsole.log(docs);\n\t\t\t\tresponse.send(500);\n\t\t\t}\n\t\t}\n\t});\n}", "handleChangeRegion(e, index, region) {\n let flightData = this.state.flightData;\n flightData.region = region;\n\n this.setState({ flightData: flightData });\n\n //Get cities data by region\n this.getCities(region);\n this.setState({ disableCity: false });\n }", "function getCountriesInRegion(cc) {\n var region = { countries: '' };\n for (var regionKey in LoLRegions) {\n var countries = LoLRegions[regionKey].countries;\n _.forOwn(countries, function(key, countryIndex) {\n if (cc == countries[countryIndex]) {\n region = LoLRegions[regionKey];\n return LoLRegions[regionKey];\n }\n });\n }\n return region;\n }", "function getPlaces(latitude, longitude) {\n\n var latLong = new google.maps.LatLng(latitude, longitude),\n\n mapOptions = {\n\n center: new google.maps.LatLng(latitude, longitude),\n zoom: 15,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n\n };\n Map = new google.maps.Map(document.getElementById('places'), mapOptions);\n\n Infowindow = new google.maps.InfoWindow();\n\n var service = new google.maps.places.PlacesService(Map);\n service.nearbySearch({\n\n location: latLong,\n radius: 500,\n type: ['restaurant']\n }, foundStoresCallback);\n\n }", "function findInCity(name, city, region) {\n var url = getByNameUrl.format(city, region, escape(name));\n return $http({ method: 'GET', url: url })\n .then(\n function (data, status, headers, config) {\n return data.data;\n },\n function (error) {\n logger.error(error);\n return error;\n }\n );\n }", "function findRegion(country) {\n\tvar region = autoRegionMap[country];\n\tif (region) {\n\t\t$(\"#selRegion\").val(region);\n\t\t$(\"#selRegionEdit\").val(region);\n\t}\n}", "function searchMarkerRegion() {\n\t\t\tconsole.log(\"searchMarkerRegion()\");\n\n if (vm.markerRegionSearch == null) {\n addMarkerRegion();\n }\n\n\t\t\tif (\n vm.apiDomain.alleleKey == \"\"\n || vm.markerRegionSearch.chromosome == \"\"\n || vm.markerRegionSearch.chromosome == null\n || vm.markerRegionSearch.startCoordinate == \"\"\n || vm.markerRegionSearch.startCoordinate == null\n || vm.markerRegionSearch.endCoordinate == \"\"\n || vm.markerRegionSearch.endCoordinate == null\n || vm.markerRegionSearch.relationshipTermKey == \"\"\n || vm.markerRegionSearch.relationshipTermKey == null\n ) {\n alert(\"Search Marker Count Required Fields:\\n\\nAllele\\nChr\\nStart Coordinate\\nEnd Coordinate\\nRelationship Type\");\n\t\t\t\tdocument.getElementById(\"startCoordinate\").focus();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar params = {};\n\t\t\tparams.chromosome = vm.markerRegionSearch.chromosome;\n\t\t\tparams.startCoordinate = vm.markerRegionSearch.startCoordinate;\n\t\t\tparams.endCoordinate = vm.markerRegionSearch.endCoordinate;\n\t\t\tparams.alleleKey = vm.apiDomain.alleleKey;\n\t\t\tparams.relationshipTermKey = vm.markerRegionSearch.relationshipTermKey;\n \n\t\t\tpageScope.loadingStart();\n\n\t\t\tAlleleFearGetMarkerByRegionAPI.search(params, function(data) {\n\t\t\t\tif (data.length == 0) {\n vm.markerRegionSearch.markerCount = 0;\n\t\t\t\t\talert(\"No Markers Available for this Allele:\\n\\n\" + \n vm.markerRegionSearch.chromosome + \n \"\\n\" + vm.markerRegionSearch.startCoordinate + \n \"\\n\" + vm.markerRegionSearch.endCoordinate);\n\t\t\t\t\tdocument.getElementById(\"startCoordinate\").focus();\n\t\t\t pageScope.loadingEnd();\n\t\t\t\t} else {\n vm.markerRegion = data;\n vm.markerRegionSearch.markerCount = data.length;\n\t\t\t pageScope.loadingEnd();\n }\n\t\t\t}, function(err) {\n\t\t\t\tpageScope.handleError(vm, \"API ERROR: GetMarkerByRegionAPI.search\");\n\t\t\t pageScope.loadingEnd();\n\t\t\t\tdocument.getElementById(\"startCoordinate\").focus();\n\t\t\t});\n\t\t}", "async getRegionByID(req, res) {\n res.status(200).json({\n region: req.region,\n status: 200,\n ok: true,\n title: 'Successful request',\n message: 'Region Found',\n });\n }", "get selectStore() {\n return $('#select-store').selectByAttribute('value', 'valleyfair');\n }", "function getStores(req, res) {\n \n //Can only query with storename and/or category\n if (!req.query.address && !req.query.id){ //Might not need to check this\n \n Stores.find(req.query,function(err, result) {\n if (err) throw err;\n \n //res.render('index', {errors: {}, user: JSON.stringify(result)});\n \n //return a JSON object containing a field users which is an array of User Objects.\n return res.json({stores: result});\n\n \n }).sort({__id: 1}); //Sort the query with username ascending\n\n } else {\n\n return res.json({ error: 'Invalid: Gave an address or id' });\n }\n\n}", "function getPlaces(latitude, longitude) {\n\n\t var latLong = new google.maps.LatLng(latitude, longitude);\n\n\t var mapOptions = {\n\n\t center: new google.maps.LatLng(latitude, longitude),\n\t zoom: 15,\n\t mapTypeId: google.maps.MapTypeId.ROADMAP\n\n\t };\n\n\t Map = new google.maps.Map(document.getElementById(\"places\"), mapOptions);\n\n\t Infowindow = new google.maps.InfoWindow();\n\n\t var service = new google.maps.places.PlacesService(Map);\n\t service.nearbySearch({\n\n\t location: latLong,\n\t radius: 500,\n\t type: ['atm']\n\t }, foundStoresCallback);\n\n\t}", "function searchGus(location) {\r\n hideListings();\r\n var service = new google.maps.places.PlacesService(map);\r\n service.nearbySearch({\r\n location: location,\r\n radius: radius,\r\n type: ['gas_station']\r\n }, callback);\r\n}", "function loadAllRegions() {\n var allRegions = 'ACAC Member, AFCAC Member, LACAC, European Civil Aviation Commission';\n return allRegions.split(/, +/g).map(function (region) {\n var index = 1;\n return {\n value: region.toLowerCase(),\n //value: index++,\n display: region\n };\n });\n }", "function getStores() {\n return [MainStore];\n}", "function getRegionFromCurrData(id) {\n\t// If the id is less than 1,000 then it's a state code. Convert to 5-digit FIPS\n\tid = (currData.resolution === \"state\") ? id * 1000: id;\n\treturn currData.regions[currData.regions_idx[id]];\n}", "async getLocationCity(latitude, longitude) {\r\n this.filterItemsJson = [];\r\n const apiCurrentLocation = `${process.env.GOOGLE_GEO_CODE_URL}${latitude},${longitude}&key=${this.apiKey}`;\r\n const filterItemsJson = await dxp.api(apiCurrentLocation);\r\n const currentCountryLocation = filterItemsJson.results[1].address_components;\r\n const city = this.findResult(currentCountryLocation, 'locality');\r\n const state = this.findResult(currentCountryLocation, 'administrative_area_level_1');\r\n const country = this.findResult(currentCountryLocation, 'country');\r\n const currentLocationSearch = {};\r\n currentLocationSearch['description'] = `${city}, ${state}, ${country}`;\r\n return currentLocationSearch;\r\n }", "function getRegion() {\n try {\n let config = require(configFile);\n let region = config.region;\n\n return region;\n } catch(err) {\n throw new Error(\"Cannot find configuration file: \"+ configFile);\n }\n }", "async getCockpitRegions() {\n const regions = await this.getRegionNames();\n return Promise.all(regions.map(name => {\n var i = this.getRegionItems(name);\n return i;\n }));\n }", "function fetchRegions() {\n return (dispatch, getState) => {\n const store = getState();\n const {\n primaryMetricId,\n relatedMetricIds,\n filters,\n currentStart,\n currentEnd\n } = store.primaryMetric;\n\n const metricIds = [primaryMetricId, ...relatedMetricIds].join(',');\n // todo: identify better way for query params\n return fetch(`/data/anomalies/ranges?metricIds=${metricIds}&start=${currentStart}&end=${currentEnd}&filters=${encodeURIComponent(filters)}`)\n .then(res => res.json())\n .then(res => dispatch(loadRegions(res)))\n .catch(() => {\n dispatch(requestFail());\n });\n\n };\n}", "function findProviders(featureLayer, searchPnt){\n\n if(initialSearch){\n findOptimalSearchRadius(featureLayer,searchPnt, \"1=1\");\n initialSearch = false;\n }\n else{\n var radius = searchFilters.getSearchRadius()\n \n queryProvidersService(radius,searchPnt,featureLayer); \n }\n }", "function doFind() {\n const found = people.results.find((person) => {\n return person.location.state === 'Minas Gerais';\n });\n console.log(found);\n}", "async function locations(zone, type, coord){\r\n \r\n let query, headers, queryURL\r\n \r\n let locationTypes = ['PARKING_ZONE','TRAFFIC_LANE','WALKWAY']\r\n \r\n // (typeof(coord) === undefined) ? tenant.bbox : coord\r\n if (coord === undefined) {coord = '-90:-180,90:180'}\r\n \r\n if (type === 'bbox') {\r\n console.debug('querying locations by bbox')\r\n query = '/locations/search?bbox='+coord\r\n } else if (locationTypes.indexOf(type) >= 0) {\r\n console.debug('querying locations by locationType')\r\n query = '/locations/search?bbox='+coord+'&q=locationType:'+type \r\n } else {\r\n console.debug('querying locations by locationUid')\r\n query = '/locations/'+type\r\n }\r\n\r\n headers = {authorization: 'Bearer '+client_token, 'predix-zone-id': zone} \r\n queryURL = tenant.metadataservice+query\r\n console.log('Query URL: '+queryURL)\r\n \r\n let response = (await request(queryURL,headers))\r\n return (response.content === undefined) ? response : response.content \r\n }", "function getAllRegions() {\n var allRegions = ['All regions'];\n currentCountries.map(country => \n country.region && allRegions.push(country.region));\n return [...new Set(allRegions)];\n }", "setCurrentRegion(region) {\n this.setState({\n currentRegion: region,\n filteredWines: _.filter(this.props.wines, (wine) => (\n wine.appelation === region\n )),\n currentWine: null\n });\n }", "validateRegionExists(stage, region) {\n return this.meta.validateRegionExists(stage, region);\n }", "function get_selected_region() {\n\tconst dropdown = document.getElementById(\"region\")\n\treturn dropdown.options[dropdown.selectedIndex].value\n}", "find(marketplaceId, opts) {\n let url = Nilavu.getURL(\"/marketplaces/\") + marketplacesId;\n\n const data = {};\n if (opts.provider) {\n data.provider = opts.provider;\n }\n\n\n // Check the preload store. If not, load it via JSON\n return Nilavu.ajax(url + \".json\", { data: data });\n }", "getAllSectionsForRegion(region) {\n if (!region) {\n return null;\n }\n return region.getElementsByClassName(A11yClassNames.SECTION);\n }", "getViewAllStoresEntities() {\r\n return this.store.pipe(select(StoreFinderSelectors.getViewAllStoresEntities));\r\n }", "function isRegion(index, level) {\n for (var x = 0 ; x < regions[level].length; x++) {\n\tfor (var y=0; y < regions[level][x].length; y++) {\n\t if (regions[level][x][y]==index) return x; //regions[level][x]; //return the region array index\n\t}\n }\n return -1; //failed to find it in an existing region\n}", "function locationFinder() {\n\t\tvar locations = [];\n\t\tlocations.push(bio.contacts.location);\n\t\tfor (var school in education.schools) {\n\t\t\tlocations.push(education.schools[school].location);\n\t\t}\n\t\tfor (var job in work.jobs) {\n\t\t\tlocations.push(work.jobs[job].location);\n\t\t}\n\t\treturn locations;\n\t}", "function get_map(){\n var filter = get_filter_params();\n fetch_map_values(filter);\n\n //si une region (ville ou pays) est selectionnee on raffraichit aussi la liste correspondante\n if(selected_region.type){\n //on ajoute le parametre country_id\n var country_or_city_json = $.parseJSON('{\"'+selected_region.type+'\":\"'+selected_region.id+'\"}');\n //on join les trois tableaux de parametres\n $.extend(filter,country_or_city_json);\n new_search('get_experiences_map',filter);\n }\n}", "function search4location(inLat,inLng){\n //console.log(input + \" \" + typeof input)\n //console.log(tableData)\n let key = 0;\n let outputRows = [];\n\n for(key = 0; key < grid.getDataLength(); key++){\n if((inLat==grid.getDataItem(key).lat) && (inLng==grid.getDataItem(key).lng)){\n outputRows.push(key)\n }\n /* if(((grid.getDataItem(key).user_location).localeCompare(input))== 0){\n console.log(\"Found it. Key = \" + key)\n break;\n }*/\n }\n\n return outputRows;\n}", "function search4location(inLat,inLng){\n //console.log(input + \" \" + typeof input)\n //console.log(tableData)\n let key = 0;\n let outputRows = [];\n\n for(key = 0; key < grid.getDataLength(); key++){\n if((inLat==grid.getDataItem(key).lat) && (inLng==grid.getDataItem(key).lng)){\n outputRows.push(key)\n }\n /* if(((grid.getDataItem(key).user_location).localeCompare(input))== 0){\n console.log(\"Found it. Key = \" + key)\n break;\n }*/\n }\n\n return outputRows;\n}", "findRegions(state) {\n let lang = state.facet(language);\n if ((lang === null || lang === void 0 ? void 0 : lang.data) == this.data)\n return [{ from: 0, to: state.doc.length }];\n if (!lang || !lang.allowsNesting)\n return [];\n let result = [];\n let explore = (tree, from) => {\n if (tree.prop(languageDataProp) == this.data) {\n result.push({ from, to: from + tree.length });\n return;\n }\n let mount = tree.prop(common.NodeProp.mounted);\n if (mount) {\n if (mount.tree.prop(languageDataProp) == this.data) {\n if (mount.overlay)\n for (let r of mount.overlay)\n result.push({ from: r.from + from, to: r.to + from });\n else\n result.push({ from: from, to: from + tree.length });\n return;\n }\n else if (mount.overlay) {\n let size = result.length;\n explore(mount.tree, mount.overlay[0].from + from);\n if (result.length > size)\n return;\n }\n }\n for (let i = 0; i < tree.children.length; i++) {\n let ch = tree.children[i];\n if (ch instanceof common.Tree)\n explore(ch, tree.positions[i] + from);\n }\n };\n explore(syntaxTree(state), 0);\n return result;\n }", "function getStudentCity(std_name) { // \"SK\"\n var obj = data.find(function(item) { return item.name == std_name });\n\n if (obj) {\n return obj.city;\n\n } else {\n return \"NO City Found\";\n }\n}", "function region(address, lat, lng){\n\n\tvar places = address.split(\", \");\n\n\n\tif (places.length<=1){\n\t\treturn \"International\"\n\t}\n\tplaces[1] = places[1].replace(/[0-9]/g, '').trim();\n\t//console.log(places)\n\n\tif(places[1] == 'CA'){\n\t\tif(lat >34.3 && lat <36.74){\n\t\t\treturn \"Centeral Cal\";\n\t\t}\n\t\telse if (lat <34.3){\n\t\t\treturn \"SoCal\";\n\t\t}\n\t\telse{\n\t\t\treturn \"NorCal\";\n\t\t}\n\t}\n\telse if(places[2] =='USA'){\n\t\treturn (\"Out of State\" );\n\t}\n\telse{\n\t\treturn \"International\";\n\t}\n\n}", "function searchRegion(searchText)\n{\n\tconsole.log(\"search region\");\n\tconsole.log(searchText);\n\t\n\tvar src = \"regions.php\";\n\tvar output= \"\";\n\tvar regionName = \"\";\n\tvar lat = \"\";\n\tvar lng = \"\";\n\tvar flag = \"\";\n\tvar location = \"\";\n\tvar images = [];\n\t\n\t$.get(src, function(data){\n\t\t\n\t\tvar json = $.parseJSON(data);\n\t\t\n\t\tfor (var i in json.regions)\n\t\t{\n\t\t\t//checks to see if the searched text exists in the returned data\n\t\t\t//allows for part of the name of a city to give the correct\n\t\t\t//search results\n\t\t\tif (json.regions[i].region_name.includes(searchText))\n\t\t\t{\n\t\t\t\tconsole.log(\"TRUE\");\n\t\t\t\tregionName = json.regions[i].region_name;\n\t\t\t\tlat = json.regions[i].lat;\n\t\t\t\tlng = json.regions[i].long;\n\t\t\t\tflag = json.regions[i].flag;\n\t\t\t\tlocation = json.regions[i].location;\n\t\t\t\t\n\t\t\t\tfor (var j in json.regions[i].images)\n\t\t\t\t{\n\t\t\t\t\timages.push(json.regions[i].images[j].url);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\talert('Incorrect Search data entered. Please try again.');\n\t\t\t}\n\t\t}\n\t})\n\t\n\toutput += \"<br><img src='./images/\" + images[0] + \"' style='width:300px;height:200px;'/>\";\n\toutput += \"<img src='./images/\" + images[1] + \"' style='width:300px;height:200x;'/>\";\n\toutput += \"<img src='./images/\" + images[2] + \"' style='width:300px;height:200x;'/>\";\n\toutput += \"<br>Region Name: \" + regionName;\n\toutput += \"<br>Lat: \" + lat;\n\toutput += \"<br>Long: \" + lng;\n\toutput += \"<br>Flag: <img src='./images/\" + flag + \"' style='width:300px;height:200x;'/>\";\n\toutput += \"<br>Location : <img src='./images/\" + location + \"' style='width:300px;height:200x;'/>\";\n\toutput += \"<img src='./images/flickr.png' style='width:200px; height:75px;' />\"\n\toutput += \"<div id='flickr' style='display:none'></div>\";\n\t\n\tdocument.getElementById(\"regionSearch\").innerHTML = output;\n\tdocument.getElementById(\"regionSearch\").style.display = 'block';\n\tdocument.getElementById(\"map\").style.display = 'none';\n\tdocument.getElementById(\"citySearch\").style.display = 'none';\n\tdocument.getElementById(\"teamSearch\").style.display = 'none';\n\t\n\tvar url = \"http://api.flickr.com/services/feeds/photos_public.gne?tags=\" + regionName + \"&format=json&jsoncallback=?\";\n\t$.getJSON(url, function(data) {\n\t\t$.each(data.items, function(i,item){\n\t\t\t$(\"<img/>\").attr(\"src\", item.media.m).appendTo(document.getElementById('flickr')).height(100).width(100);\n\t\t\treturn (i == 20) ? false : null;\n\t\t\t});\n\t});\n}", "queryDistrictByCoordinates({ latitude, longitude }) {\n const searchQuery = {\n index: districtIndex,\n body: {\n size: 1,\n _source: ['properties.Name'],\n query: {\n geo_shape: {\n geometry: {\n relation: 'contains',\n shape: {\n type: 'point',\n coordinates: [\n longitude, latitude,\n ],\n },\n },\n },\n },\n },\n }\n\n return new Promise(((resolve, reject) => {\n client\n .search(searchQuery, ((error, body) => {\n if (error) {\n console.trace('error', error.message)\n return reject(error)\n }\n if (body && body.hits) {\n const result = body.hits.hits[0]\n if (result) {\n return resolve(result._source.properties.Name)\n }\n }\n return resolve('')\n }))\n }))\n }", "countySelected() {\n document.querySelector('#admin-user-form-region-selector').hidden = false;\n let county_selector = document.querySelector('#admin-user-form-county-selector');\n let county_id = county_selector[county_selector.selectedIndex].value;\n\n let regionService = new RegionService();\n regionService.getAllRegionGivenCounty(county_id)\n .then((regions: Region[]) => {\n this.regions = regions;\n })\n .catch((error: Error) => console.error(error));\n }", "function StoreLocation(name, minCust, maxCust, avgCookiesPerCust) {\n this.name = name;\n this.minCust = minCust;\n this.maxCust = maxCust;\n this.avgCookiesPerCust = avgCookiesPerCust;\n this.hourlySales = [];\n this.dailySales = 0;\n StoreLocation.all.push(this);\n}", "function geoIdentify() {\n var searchCity = $(\"#inputGroupSelect03\").val();\n console.log(searchCity);\n localStorage.setItem(\"cityName\", searchCity);\n selectedCity = searchCity;\n $.ajax({\n url: apiBase + searchCity,\n method: \"GET\",\n }).done(function (response) {\n console.log(response);\n querySecondURL =\n response._embedded[\"city:search-results\"][0]._links[\"city:item\"].href;\n urbanSlug();\n });\n }", "getFindStoresEntities() {\r\n return this.store.pipe(Object(_ngrx_store__WEBPACK_IMPORTED_MODULE_2__[\"select\"])(getFindStoresEntities));\r\n }", "show(req, res) {\n Region.findAll({\n where: { id : req.query.regionid},\n include: [{\n model : models.Location,\n where: {visible : true}\n }]\n })\n .then(function (author) {\n res.status(200).json(author);\n })\n .catch(function (error){\n console.log('Error is returning response===>');\n console.log(error);\n res.status(500).json(error);\n });\n }", "loadAll(filterQuery) {\r\n var esQuery = '';\r\n if( filterQuery != \"\" ){\r\n esQuery = filterQuery;\r\n }\r\n var defer = this.$q.defer();\r\n var vm = this;\r\n this.esClient.msearch({\r\n body: [\r\n {\r\n index: ES_Details.NaprawaSpawarekIndex,\r\n type: 'main',\r\n size: 10000\r\n },\r\n { query: { match_all: {} } },\r\n {\r\n index: ES_Details.ManufacturerIndex,\r\n type: 'main',\r\n size: 10000\r\n },\r\n { query: { match_all: {} } },\r\n {\r\n index: ES_Details.MachineryIndex,\r\n type: 'main',\r\n size: 10000\r\n },\r\n { query: { match_all: {} } },\r\n {\r\n index: ES_Details.CustomersIndex,\r\n type: 'main',\r\n size: 10000\r\n },\r\n { query: { match_all: {} } }\r\n ]\r\n })\r\n .then(function(result) {\r\n console.log(\"Result:\",result);\r\n // wszystko oprocz stanow idzie do jednego wora\r\n for (var i = 1; i < result.responses.length; i++) {\r\n var response = result.responses[i];\r\n response.hits.hits.forEach(hit => {\r\n vm.dataStore[hit._id] = hit._source;\r\n });\r\n }\r\n // stany ida do osobnego wora\r\n result.responses[0].hits.hits.forEach(hit => {\r\n var hitData = hit._source;\r\n hitData.id = hit._id;\r\n hitData.Klient = vm.dataStore[hitData.idKlienta];\r\n hitData.Urzadzenie = vm.dataStore[hitData.idModelu];\r\n hitData.Urzadzenie.Producent = vm.dataStore[hitData.Urzadzenie.idProducenta];\r\n vm.inWarehouse.push(hitData);\r\n });\r\n\r\n console.log(\"Processed Result:\",vm.dataStore);\r\n console.log(\"Processed Result:\",vm.inWarehouse);\r\n defer.resolve(vm.inWarehouse);\r\n });\r\n return defer.promise;\r\n }", "function geocode(searchText){\n gs.geocode({ text: searchText, sourceCountry:\"USA\"},function(err, res){\n if(res.locations && res.locations.length > 0){\n var geom = res.locations[0].feature.geometry;\n var params = {\n studyAreas:[{\"geometry\":{\"x\":geom.x,\"y\":geom.y},\n \"areaType\":\"StandardGeography\",\"intersectingGeographies\":[{\"sourceCountry\":\"US\",\"layer\":\"US.ZIP5\"}]}],\n returnGeometry:false\n }\n enrich(params);\n }else{\n alert('Sorry. No matches found.');\n }\n });\n}", "function locationFinder() {\n\n var locations = [];\n locations.push(bio.contacts.location);\n \n // iterates through school locations and appends each location to the locations array.\n education.schools.forEach(function(school){\n locations.push(school.location);\n });\n\n // iterates through work locations and appends each location to the locations array.\n work.jobs.forEach(function(job){\n locations.push(job.location);\n });\n return locations;\n }", "function filterRegion(value) {\n const sheetoffilter = viz\n .getWorkbook()\n .getActiveSheet()\n .getWorksheets()\n .get(\"Sales Map\");\n console.log(sheetoffilter);\n\n sheetoffilter.applyFilterAsync(\n \"Region\",\n value,\n tableau.FilterUpdateType.REPLACE\n );\n}", "get regions() {\n let domElements = this.sortElementsByAttributeOrder(this.regionHTMLCollection);\n domElements = domElements.filter((element) => {\n return this.elementIsVisible(element);\n });\n return domElements;\n }", "placesWithinArea(area) {\n let results = turf.collect(area, this.fbData,\n 'typeNum', 'placeTypes')\n return results\n }", "function getEntriesInRegion(lat, lon, maxDistance, collection){\n\tsubCollection= [];\n\tfor(var c = 0;c < collection.length;c++){\n\t\tif(collection[c][reclat] === \"\" || collection[c][reclong] === \"\") continue;\n\t\t\tvar d = findDistance(lat, lon, collection[c][reclat], collection[c][reclong]);\n\t\tif(d <= maxDistance)\n\t\t\tsubCollection.push(collection[c]);\n\n\t}\n}", "function getRegionalStates(){\n var regionalCode = $.request.parameters.get('regionalCode');\n \tvar output = {\n\t\tresults: []\n\t};\n\toutput.results.push({});\n\tvar connection = $.db.getConnection();\n\tvar pstmtState = '';\n\tvar queryState = '';\n\ttry {\n\t\tqueryState = 'select ST.STATE_CODE,ST.STATE_NAME from \"MDB_DEV\".\"TRN_REGIONAL\" as TR inner join \"MDB_DEV\".\"STATESDATA\" as ST on TR.STATE_CODE = ST.STATE_CODE where TR.REGIONAL_CODE = ?';\n\t\t//'SELECT REGIONAL_CODE,REGIONAL_NAME FROM \"MDB_DEV\".\"MST_REGIONAL\" ';\n\t\tpstmtState = connection.prepareStatement(queryState);\n\t\tpstmtState.setString(1,regionalCode);\n\t\tvar rsState = pstmtState.executeQuery();\n\t\twhile (rsState.next()) {\n\t\t\tvar record = {};\n\t\t\trecord.StateCode = rsState.getString(1);\n\t\t\trecord.StateName = rsState.getString(2);\n\t\t\toutput.results.push(record);\n\t\t}\n\n\t\tconnection.close();\n\t} catch (e) {\n\n\t\t$.response.status = $.net.http.INTERNAL_SERVER_ERROR;\n\t\t$.response.setBody(e.message);\n\t\treturn;\n\t}\n\n\tvar body = JSON.stringify(output);\n\t$.response.contentType = 'application/json';\n\t$.response.setBody(body);\n\t$.response.status = $.net.http.OK;\n}" ]
[ "0.58368534", "0.57639545", "0.5550132", "0.55342746", "0.55314344", "0.5512601", "0.5496436", "0.54734695", "0.5456566", "0.54498345", "0.5440358", "0.5416627", "0.5407859", "0.53666186", "0.5363098", "0.5304816", "0.5286601", "0.52518666", "0.52494156", "0.52399844", "0.5229464", "0.520469", "0.51903385", "0.5157617", "0.515551", "0.5137968", "0.5132291", "0.5126867", "0.5114877", "0.51112443", "0.5107226", "0.51031446", "0.5102385", "0.5084272", "0.507176", "0.5069046", "0.50623506", "0.50595206", "0.50578934", "0.5057386", "0.5038368", "0.50360125", "0.5022538", "0.5019432", "0.5004532", "0.50027275", "0.49979678", "0.49938804", "0.49889177", "0.4981184", "0.49785075", "0.49588868", "0.49536908", "0.49438646", "0.49311373", "0.49285537", "0.48973647", "0.48931482", "0.4890627", "0.48850086", "0.48843443", "0.4881106", "0.48800528", "0.4869462", "0.48563835", "0.48555478", "0.48487797", "0.48477125", "0.48447043", "0.48409307", "0.4840772", "0.4840023", "0.4836434", "0.48353913", "0.48333263", "0.48321772", "0.48293418", "0.48280314", "0.4822765", "0.48190328", "0.4811663", "0.4811663", "0.4809198", "0.48070788", "0.48056543", "0.47939584", "0.47914082", "0.47817475", "0.47805074", "0.47774434", "0.477247", "0.47699133", "0.47679776", "0.47609144", "0.47594336", "0.47578573", "0.47549093", "0.47546995", "0.47535738", "0.47524062" ]
0.5816194
1
Create table with store search
function createTable(stores) { // Clear Table $('#table').empty(); // check if array if (stores !== undefined && stores.length > 0) { // Loop through stores array stores.forEach(store => { // Clean null values so they dont show up as null if (store.storeRM === null) { store.storeRM = { regionNumber: '' }; } if (store.storeDM === null) { store.storeDM = { districtNumber: '' }; } //Add html to table with store info $('#table').append('<div class="container-fluid"><a id="tableItem" href="/stores/' + store.storeNumber + '"><div class="row"><div class= "col">Store: ' + store.storeNumber + '</div><div class="col">Phone: ' + store.storeContact.phoneNumber + '</div><div class="col">' + store.storeContact.streetAddress + '</div></div><div class="row"><div class="col">District: ' + store.storeDM.districtNumber + '</div><div class="col">Fax: ' + store.storeContact.faxNumber + '</div><div class="col">' + store.storeContact.city + ', ' + store.storeContact.state + ' ' + store.storeContact.zip + '</div></div><div class="row"><div class="col">Region: ' + store.storeRM.regionNumber + '</div><div class="col">Manager: ' + store.storeContact.firstName + ' ' + store.storeContact.lastName + '</div><div class="col"></div></div></a></div>'); }); } else { $('#table').append('<div class="container-fluid"><h4 style="color: red;">There are no stores with that store number.</h4></div>'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "create_search_history_table(){\n\t\tvar create_search_history_cols = \"(id integer PRIMARY KEY AUTOINCREMENT, project_id integer, keyword varchar, file_name varchar, file_line integer, file_pos integer, user_id integer, created_at datetime, updated_at datetime)\";\n\t\tvar create_search_history_query = \"CREATE TABLE IF NOT EXISTS search_histories \" + create_search_history_cols + \";\";\n\t\tthis.sqlite3_db.exec(create_search_history_query);\n\t}", "function create_table() {\n \n/* $(\".userdata_search\").html(\"\"); */\n $(\".userdata_search tbody\").html(\"\");\n \n var tbl = $('<table></table>').attr({ class: \"userdata_search\" });\n var row2 = $('<thead></thead>').attr({ class: [\"class5\"].join(' ') }).appendTo(tbl);\n var row = $('<tr></tr>').attr({ class: [\"class1\"].join(' ')}).appendTo(tbl);\n \n\t// $('#result_set_from_search').append('<tr><th>ItemID</th><th>Name</th><th>Category</th></tr>');\n\t \n\t// $('#result_set_from_search tr:last').after('<tr><th>ItemID</th></tr><tr><th>Name</th><th>Category</th></tr>');\n\t \n\t// $('<tr><th>ItemID</th><th>Name</th><th>Category</th></tr>').appendTo(tbl);\n\t\n\t// prepei na ftiaxtei me append to thead ta results apo to query\n\t\n\t$('<th></th>').text(\"ItemID\").appendTo(row);\n $('<th></th>').text(\"Name\").appendTo(row); \n $('<th></th>').text(\"Category\").appendTo(row); \n\t$('<th></th>').text(\"url\").appendTo(row); \n\n tbl.appendTo($(\".userdata_search tbody\")); \n}", "function newTable() {\n connection.query(\"Select * FROM storefront\", (err, results) => {\n if (err) throw err;\n table.draw(results);\n pointOfSale();\n });\n}", "function createTable() {\n\n db.transaction(function (tx) { tx.executeSql(createStatement, [], showRecords, onError); });\n\n}", "function createDbTable(t, dbInfo, callback, errorCallback) {\n t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' ' + '(id INTEGER PRIMARY KEY, key unique, value)', [], callback, errorCallback);\n } // Open the WebSQL database (automatically creates one if one didn't", "function createDbTable(t, dbInfo, callback, errorCallback) {\n\t t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' ' + '(id INTEGER PRIMARY KEY, key unique, value)', [], callback, errorCallback);\n\t}", "function setupTable(tx) {\r\n\ttx.executeSql('CREATE TABLE IF NOT EXISTS HIMM (id INTEGER PRIMARY KEY AUTOINCREMENT, Title TEXT NOT NULL, Content TEXT NOT NULL,Category INTEGER, FileURI TEXT,Longitude TEXT, Latitude TEXT,weather,updated)');\r\n}", "static createTableStore(data) {\n return new TableStore(data);\n }", "function makeTable() {\n var queryfortable = \"Select * FROM products\";\n connection.query(queryfortable, function(error, results){\n if(error) throw error;\n var tableMaker = new Table ({\n head: [\"ID\", \"Product Name\", \"Department\", \"Price\", \"Stock\"],\n colWidths: [10,25,20,10,20]\n });\n for(var i = 0; i < results.length; i++){\n tableMaker.push(\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(tableMaker.toString());\n firstPrompt()\n })\n }", "function createTable() {\n var conn = Jdbc.getCloudSqlConnection(dbUrl, user, userPwd);\n conn.createStatement().execute('CREATE TABLE entries ' +\n '(guestName VARCHAR(255), content VARCHAR(255), ' +\n 'entryID INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(entryID));');\n}", "function createDbTable(t, dbInfo, callback, errorCallback) {\n t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' ' + '(id INTEGER PRIMARY KEY, key unique, value)', [], callback, errorCallback);\n}", "function createDbTable(t, dbInfo, callback, errorCallback) {\n t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' ' + '(id INTEGER PRIMARY KEY, key unique, value)', [], callback, errorCallback);\n}", "function createDbTable(t, dbInfo, callback, errorCallback) {\n t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' ' + '(id INTEGER PRIMARY KEY, key unique, value)', [], callback, errorCallback);\n}", "function createDbTable(t, dbInfo, callback, errorCallback) {\n t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' ' + '(id INTEGER PRIMARY KEY, key unique, value)', [], callback, errorCallback);\n}", "function createDbTable(t, dbInfo, callback, errorCallback) {\n t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' ' + '(id INTEGER PRIMARY KEY, key unique, value)', [], callback, errorCallback);\n}", "function createDbTable(t, dbInfo, callback, errorCallback) {\n t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' ' + '(id INTEGER PRIMARY KEY, key unique, value)', [], callback, errorCallback);\n}", "function myTable() {\n connection.query('SELECT * FROM orders', (err, res) => {\n const myTable = [];\n\n res.forEach(element => {\n let newRow = {};\n newRow.id = element.id;\n newRow.name = element.name;\n newRow.price = element.price;\n newRow.stock_quantity = element.stock_quantity;\n myTable.push(newRow);\n });\n console.table(myTable);\n });\n \n start(); //moves on to the store questions\n}", "function buildTable(){\n\n}", "function createTables() {\n\n var db = getDatabase();\n db.transaction(\n function(tx) {\n tx.executeSql('CREATE TABLE IF NOT EXISTS jenkins_data(id INTEGER PRIMARY KEY AUTOINCREMENT, jenkins_name TEXT, jenkins_url TEXT)');\n });\n }", "function createNewTable(){\n\ttopRefugeesTable.addColumn('Country');\n\ttopRefugeesTable.addColumn('Total');\n\tfor (var i = 0; i < refugeeTable.getRowCount(); i++) {\n\t\tvar totalRefugees = refugeeTable.getNum(i, 'Total');\n\t\tif (totalRefugees >= 100000) {\n\t\t\tvar newRow = topRefugeesTable.addRow()\n\t\t\tnewRow.setString('Country', refugeeTable.getString(i, 'Country'));\n\t\t\tnewRow.setNum('Total', refugeeTable.getNum(i, 'Total'));\n\t\t}\n\t}\n\tprint('New top refugee table created...');\n}", "function createTable() {\n rethink\n .db(\"test\")\n .tableCreate(\"authors\")\n .run(connection, (err, result) => {\n if (err) throw err;\n console.log(\"Table Creation results:\");\n console.log(JSON.stringify(result, null, 2));\n insertData();\n });\n}", "function crearTablaAscensorValoresFotografias(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_valores_fotografias (k_codusuario,k_codinspeccion,k_coditem,n_fotografia,n_directorio,o_estado_envio)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function renderTable(search_data) { \n $tbody.innerHTML = \"\";\n for (var i = 0; i < search_data.length; i++) {\n \n var sighting = search_data[i];\n var fields = Object.keys(sighting);\n \n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = sighting[field];\n }\n }\n}", "function crearTablaEscalerasValoresFotografias(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE escaleras_valores_fotografias (k_codusuario,k_codinspeccion,k_coditem,n_fotografia,n_directorio,o_estado_envio)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function crearTablaInformeValoresAudios(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE informe_valores_audios (k_codusuario,k_codinforme,n_audio,n_directorio,o_estado_envio)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function createTable(){\n//Display information to page using table\n\n divEl = document.getElementById('storeSales');\n tableElem = initializeTable();\n\n //Render all store location data\n renderAllDailySales();\n\n makeTotalRow(tableElem);\n\n //display the store location\n divEl.append(tableElem);\n}", "async createStagingTable() { \t\n\tconst sqlStatement = `CREATE TEMPORARY TABLE IF NOT EXISTS \"JSON_STAGING\"(\"DATA\" JSON)`;\t\t\t\t\t \n\tconst results = await this.executeSQL(sqlStatement);\n\treturn results;\n }", "function setupTable(tx) {\n tx.executeSql(\"CREATE TABLE IF NOT EXISTS setting(id INTEGER PRIMARY KEY,theme)\");\n tx.executeSql(\"CREATE TABLE IF NOT EXISTS levels(id INTEGER PRIMARY KEY,board_row_size INTEGER,board_col_size INTEGER,floor_details,tile_details,powerup_details,max_moves,completed,help_used INTEGER)\");\n tx.executeSql(\"CREATE TABLE IF NOT EXISTS powerup(id INTEGER PRIMARY KEY, details)\");\n createSetting();\n}", "function makeTableRow(store, storeDataArr, total ){\n // make a tr\n var trEl = createPageElement('tr');\n\n //create store name cell\n createTableItem(store, trEl, 'td');\n\n //create cookie sales cells\n for (var index = 0; index < storeDataArr.length; index++){\n createTableItem(storeDataArr[index], trEl, 'td');\n }\n\n //add total sales\n createTableItem(total, trEl, 'td');\n return trEl;\n}", "async create() {\n await this.db.schema.createTable(this.name, colGen => {\n for (const name in this.columns) {\n if (this.columns.hasOwnProperty(name)) {\n const element = this.columns[name];\n if(typeof element === \"object\")\n tableColumnGen(this, colGen, element.type, name, element);\n else\n tableColumnGen(this, colGen, element, name);\n }\n }\n });\n\n return;\n }", "function createTbl(tx) {\n tx.executeSql('CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY AUTOINCREMENT, role BOOL NOT NULL, name VARCHAR, username VARCHAR NOT NULL, email VARCHAR NOT NULL, password VARCHAR NOT NULL, description VARCHAR)');\n}", "function createTableRecord(tx) {\n\t\n\t console.log(\"Entering createTableRecord\");\n\t \n\t var sqlStr = 'CREATE TABLE IF NOT EXISTS records (type TEXT, date DATE)';\n\t console.log(sqlStr);\n\t \n\t tx.executeSql(sqlStr, [], onSqlSuccess, onSqlError);\n\t console.log(\"Leaving createTableRecord\");\n\t}", "function crearTablaAscensorValoresProteccion(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_valores_proteccion (k_codusuario,k_codinspeccion,k_coditem,v_sele_inspector,v_sele_empresa,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores protección...Espere\");\n console.log('transaction creada ok');\n });\n}", "function crearTablaAscensorValoresAudios(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_valores_audios (k_codusuario,k_codinspeccion,n_audio,n_directorio,o_estado_envio)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function crearTablaAscensorValoresMaquinas(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_valores_maquinas (k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores maquinas...Espere\");\n console.log('transaction creada ok');\n });\n}", "function createTable() {\n const sql = `CREATE TABLE ${table} (c1 int, c2 int)`;\n const request = new Request(sql, (err, rowCount) => {\n if (err) {\n throw err;\n }\n\n console.log(`'${table}' created!`);\n prepareSQL();\n });\n\n connection.execSql(request);\n}", "function generateTable(performer = 'All', song = 'All', year = 'All', peakpos = 'All') {\n\n if (song == 'All' && performer == 'All' && year == 'All' && peakpos == 'All') {\n // Need to build query to gather information and the dropdown menus\n url = local + \"/get_top100_sql/search/*\";\n first = true\n }\n else {\n // Need to build query to gather information.\n\n songParms = \"name=\" + song + \"/performer=\" + performer + \"/chartyear=\" + year + \"/top_position=\" + peakpos\n url = local + \"/get_top100_sql/search/\" + songParms;\n }\n \n populateTable(url);\n\n}", "function crearTablaAscensorValoresFoso(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_valores_foso (k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores foso...Espere\");\n console.log('transaction creada ok');\n });\n}", "function crearTablaEscalerasValoresAudios(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE escaleras_valores_audios (k_codusuario,k_codinspeccion,n_audio,n_directorio,o_estado_envio)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function crearTablaAscensorValoresPreliminar(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_valores_preliminar (k_codusuario,k_codinspeccion,k_coditem_preli,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores preliminares...Espere\");\n console.log('transaction creada ok');\n });\n}", "function crearTablaAscensorValoresIniciales(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_valores_iniciales (k_codusuario,k_codinspeccion,n_cliente,n_equipo,n_empresamto,o_tipoaccion,v_capacperson,v_capacpeso,v_paradas,f_fecha,v_codigo,o_consecutivoinsp,ultimo_mto,inicio_servicio,ultima_inspeccion,h_hora,o_tipo_informe)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores iniciales...Espere\");\n console.log('transaction creada ok');\n });\n}", "function setupTable(tx){\n console.log(\"before execute sql for studentProfile Database\");\n tx.executeSql(\"CREATE TABLE IF NOT EXISTS students(id INTEGER PRIMARY KEY,name,image)\");\n console.log(\"Created table if not existed for studentProfile Database\");\n console.log(\"after execute sql in studentProfile Database\");\n}", "function crearTablaPuertasValoresFotografias(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_valores_fotografias (k_codusuario,k_codinspeccion,k_coditem,n_fotografia,n_directorio,o_estado_envio)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function crearTablaAscensorItemsFoso(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_items_foso (k_coditem_foso, v_item, o_descripcion, v_clasificacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function createTable(UFOdata){\n // clear table of all previous searches\n tbody.html(\"\")\n // Loop through each data entry to create a table row for each entry\n UFOdata.forEach((sighting) => {\n console.log(sighting);\n var row=tbody.append('tr');\n // Add table columns for each key value pair in each entry\n Object.values(sighting).forEach((value) =>{\n console.log(value);\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "function createUserListTable() {\n db.transaction((tx) => {\n tx.executeSql(\n \"create table if not exists userlist (id integer primary key not null, title text not null, imgURL text not null, notes text);\",\n [],\n () => {\n console.log(\"Created userlist table in database!\");\n }\n );\n });\n }", "function crearTablaAscensorValoresElementos(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_valores_elementos (k_codusuario,k_codinspeccion,k_coditem,o_descripcion,v_selecion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores elementos...Espere\");\n console.log('transaction creada ok');\n });\n}", "function crearTablaEscalerasValoresIniciales(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE escaleras_valores_iniciales (k_codusuario,k_codinspeccion,n_cliente,n_equipo,n_empresamto,v_velocidad,o_tipo_equipo,v_inclinacion,v_ancho_paso,f_fecha,ultimo_mto,inicio_servicio,ultima_inspeccion,v_codigo,o_consecutivoinsp,h_hora,o_tipo_informe)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores iniciales...Espere\");\n console.log('transaction creada ok');\n });\n}", "function crearTablaEscalerasItemsProteccion(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE escaleras_items_proteccion(k_coditem, o_descripcion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function crearTablaPuertasValoresAudios(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_valores_audios (k_codusuario,k_codinspeccion,n_audio,n_directorio,o_estado_envio)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function crearTablaEscalerasValoresPreliminar(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE escaleras_valores_preliminar (k_codusuario,k_codinspeccion,k_coditem_preli,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores preliminares...Espere\");\n console.log('transaction creada ok');\n });\n}", "function crearTablaPuertasItemsElectrica(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_items_electrica(k_coditem_electrica, o_descripcion, v_clasificacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function CreateTableQuery() \n{\nthis.columns = [];\nthis.constraints = [];\n}", "function crearTablaAscensorValoresPozo(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_valores_pozo (k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores pozo...Espere\");\n console.log('transaction creada ok');\n });\n}", "function crearTablaEscalerasValoresProteccion(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE escaleras_valores_proteccion (k_codusuario,k_codinspeccion,k_coditem,v_sele_inspector,v_sele_empresa,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores protección...Espere\");\n console.log('transaction creada ok');\n });\n}", "function crearTablaAscensorItemsProteccion(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_items_proteccion(k_coditem, o_descripcion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function crearTablaPuertasValoresElectrica(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_valores_electrica (k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores electrica...Espere\");\n console.log('transaction creada ok');\n });\n}", "function createTable() {\n const sql = `CREATE TABLE ${table} (c1 int UNIQUE) `;\n const request = new Request(sql, (err, rowCount) => {\n if (err) {\n console.log('error occured!');\n throw err;\n }\n\n console.log(`'${table}' created!`);\n\n createTransaction();\n });\n\n connection.execSql(request);\n}", "function setupTableForLessons(tx){\n console.log(\"before execute sql for Lessons Database\");\n tx.executeSql(\"CREATE TABLE IF NOT EXISTS lessons(lessonRow_id INTEGER,teacher_id INTEGER,lesson_id INTEGER,exercise_id INTEGER,exercise_title,exercise_detail,\\\n exercise_voice,exercise_image,PRIMARY KEY(lessonRow_id))\");\n console.log(\"Created table if not existed for Lessons Database\");\n}", "function crearTablaInforme(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE informe (k_codinforme,v_consecutivoinforme,k_codusuario,f_informe)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores informe...Espere\");\n console.log('transaction creada ok');\n });\n}", "function iniciarTablaHistorial(tx) {\n\ttx.executeSql('CREATE TABLE IF NOT EXISTS Historial (IDUsuario, CuentaDesde, CuentaHasta, Monto, FechaHora)');\n}", "createTable () {\n this.table = new Table([this.features.declensions, this.features.genders,\n this.features.types, this.features.numbers, this.features.cases])\n\n let features = this.table.features // eslint-disable-line prefer-const\n features.columns = [\n this.constructor.model.typeFeature(Feature.types.declension),\n this.constructor.model.typeFeature(Feature.types.gender),\n this.constructor.model.typeFeature(Feature.types.type)\n ]\n features.rows = [\n this.constructor.model.typeFeature(Feature.types.number),\n this.constructor.model.typeFeature(Feature.types.grmCase)\n ]\n features.columnRowTitles = [\n this.constructor.model.typeFeature(Feature.types.grmCase)\n ]\n features.fullWidthRowTitles = [\n this.constructor.model.typeFeature(Feature.types.number)\n ]\n }", "function searchtb(table,fields)\n {\n \n \n }", "function createTable()\n{\n \n\tfilesDB.transaction(\n function (transaction) {\n transaction.executeSql('CREATE TABLE IF NOT EXISTS files(id VARCHAR NOT NULL PRIMARY KEY, LastModified TIMESTAMP NOT NULL, name TEXT NOT NULL, json BLOB NOT NULL DEFAULT \"\");', [], nullDataHandler, killTransaction);\n \t}\n\t);\n}", "function makeCoffeeTable() {\n createTableTitle('Beans Needed By Location Each Day');\n createTable('coffeeTable'); //create empty table\n createHeaderRow('coffeeTable', 'Daily Location Total'); //create header row\n for (var index in allStores) {\n createCoffeeRow('coffeeTable', allStores[index]);\n }\n createCoffeeTotalsRow(); //create coffee table totals row\n}", "function createTable(table) {\n if (user.id == table.owner_id) {\n sittedTable = new Table(table.id,true);\n }\n}", "function crearTablaAscensorItemsPreliminar(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_items_preliminar(k_coditem_preli, o_descripcion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function crearTablaEscalerasItemsPreliminar(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE escaleras_items_preliminar(k_coditem, o_descripcion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function crearTablaAscensorItemsPozo(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_items_pozo(k_coditem_pozo, v_item, o_descripcion, v_clasificacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function crearTablaAscensorItemsMaquinas(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_items_maquinas(k_coditem_maquinas, v_item, o_descripcion, v_clasificacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function populateDB(tx) {\r\n \r\n var sql = \"CREATE TABLE IF NOT EXISTS Client ( \"\r\n + \"cin INTEGER PRIMARY KEY, \"\r\n + \"prenom VARCHAR(50), \" + \"nom VARCHAR(50), \"\r\n + \"age INTEGER,\" + \"telephone INTEGER,\"+ \"adress VARCHAR(50),\" + \"code INTEGER, \" + \"email VARCHAR(50), \" + \"login VARCHAR(50),\" + \"password VARCHAR(200))\";\r\n tx.executeSql(sql);\r\n }", "function crearTablaEscalerasItemsDefectos(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE escaleras_items_defectos(k_coditem_escaleras, o_descripcion, v_clasificacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function crearTablaAscensorValoresCabina(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_valores_cabina (k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores cabina...Espere\");\n console.log('transaction creada ok');\n });\n}", "function crearTablaPuertasValoresOtras(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_valores_otras (k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores otras...Espere\");\n console.log('transaction creada ok');\n });\n}", "function createTable() {\n Promise.all([BookService.getBooks(), AuthorService.getAuthors()])\n .then(([books, authors]) => {\n books = Library.sortBooksByTitle(books, 1);\n updateTable(books, authors);\n })\n}", "function crearTablaPuertasItemsOtras(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_items_otras(k_coditem_otras, o_descripcion, v_clasificacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function crearTablaAscensorItemsCabina(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_items_cabina (k_coditem_cabina, v_item, o_descripcion, v_clasificacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function crearTablaPuertasValoresPreliminar(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_valores_preliminar (k_codusuario,k_codinspeccion,k_coditem_preli,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores preliminares...Espere\");\n console.log('transaction creada ok');\n });\n}", "function createtable() {\n $tbody.innerHTML = \"\";\n for (var i = 0; i < ufoData.length; i++) {\n // Get current fields\n var info = ufoData[i];\n var fields = Object.keys(info);\n // insert new fields in the tbody\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = info[field];\n }\n }\n}", "function crearTablaPuertasValoresMotorizacion(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_valores_motorizacion (k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores motorizacion...Espere\");\n console.log('transaction creada ok');\n });\n}", "async createInTable (columns, table, conditions, escaped) {\n return this.client.query(`INSERT INTO ${table} (${columns}) VALUES (${conditions})`, escaped)\n }", "function createTables() {\n var db = getDatabase();\n\n db.transaction(\n function(tx) {\n tx.executeSql('CREATE TABLE IF NOT EXISTS configuration(id INTEGER PRIMARY KEY AUTOINCREMENT, param_name TEXT, param_value TEXT)');\n tx.executeSql('CREATE TABLE IF NOT EXISTS temperature(id INTEGER PRIMARY KEY AUTOINCREMENT, date TEXT, temperature_value REAL)');\n }\n );\n}", "function crearTablaEscalerasValoresElementos(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE escaleras_valores_elementos (k_codusuario,k_codinspeccion,k_coditem,o_descripcion,v_selecion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores elementos...Espere\");\n console.log('transaction creada ok');\n });\n}", "function create(options) {\n const tbl = new cli_table3_1.default({ ...api._options, ...options });\n api._rows.forEach(r => tbl.push(r));\n return tbl;\n }", "function create(data) {\n\t\tdebug('create request', data);\n\t\tdata = normalize(data);\n\t\tdelete data[pk]; // deleting any passed pk field because databases get to choose\n\t\tvar query = table.insert(data).returning(\"*\").toQuery();\n\t\t\n\t\tdebug(query.text, query.values, typeof query.values[0]);\n\t\tdb.query(query.text, query.values, function(err, resp){\n\t\t\tdebug('create resp:', err);\n\t\t\tif (err) {\n\t\t\t\temit(routes.create, {\"error\": \"db error\"}); // TODO better specific error reporting\n\t\t\t} else {\n\t\t\t\tdebug(resp.rows);\n\t\t\t\tbroadcast(routes.create, resp.rows);\n\t\t\t}\n\t\t});\n\t}", "make(data, tableName) {\n\t\tlet results = data.results,\n\t\t\tfields = data.fields,\n\t\t\tpks = data.primaryKeys;\n\t\tlog('Fields: ', fields);\n\t\tlet table = $('<table />', {class: 'table table-striped'});\n\t\tlet heading = $('<tr />');\n\t\tfields.forEach(col => {\n\t\t\theading.append(`<th>${col.name}</th>`);\n\t\t});\n\t\theading = $('<thead />').append(heading);\n\t\ttable.append(heading);\n\t\tlet tbody = $('<tbody />');\n\t\tresults.forEach(r => {\n\t\t\tvar row = $('<tr />');\n\t\t\tfields.forEach(fname => {\n\t\t\t\tvar col = $('<td />');\n\t\t\t\tvar input = $('<input />');\n\t\t\t\tinput.val(r[fname.name]);\n\t\t\t\tinput.data({\n\t\t\t\t\ttable: tableName,\n\t\t\t\t\tcondition: this.generateCondition(pks, r),\n\t\t\t\t\tfield: fname.name\n\t\t\t\t});\n\t\t\t\tlog(input.data());\n\t\t\t\tthis.bindUpdateEvent(input);\n\t\t\t\tcol.append(input);\n\t\t\t\trow.append(col);\n\t\t\t});\n\t\t\ttbody.append(row);\n\t\t});\n\t\ttable.append(tbody);\n\t\treturn table;\n\t}", "function createModuleTable( tx ) {\n\tvar query = \"CREATE TABLE IF NOT EXISTS \" + tableModules + \" (\" +\n\t\t\t\"id INTEGER PRIMARY KEY AUTOINCREMENT, \" +\n\t\t\t\"name TEXT NOT NULL, \" +\n\t\t\t\"description TEXT NULL, \" +\n\t\t\t\"category INT NOT NULL, \" +\n\t\t\t\"cost REAL NOT NULL, \" +\n\t\t\t\"quantity INT NOT NULL, \" +\n\t\t\t\"image TEXT NULL)\";\n\t\n\ttx.executeSql( query, [], function ( tx, result ) {\n\t\tconsole.log( \"Table \" + tableModules + \" created successfully\" );\n\t}, errorCB );\n\t\n\tquery = \"CREATE INDEX IF NOT EXISTS category ON \" + tableModules + \" (category)\";\n\t \n\ttx.executeSql( query, [], function ( tx, result ) {\n\t\tconsole.log( \"Index in \" + tableModules + \" created successfully\" );\n\t}, errorCB );\n}", "function crearTablaPuertasValoresIniciales(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_valores_iniciales (k_codusuario,k_codinspeccion,n_cliente,n_equipo,n_empresamto,o_desc_puerta,o_tipo_puerta,o_motorizacion,o_acceso,o_accionamiento,o_operador,o_hoja,o_transmision,o_identificacion,f_fecha,v_ancho,v_alto,v_codigo,o_consecutivoinsp,ultimo_mto,inicio_servicio,ultima_inspeccion,h_hora,o_tipo_informe)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores iniciales...Espere\");\n console.log('transaction creada ok');\n });\n}", "function _init_my_job_and_quote_count_info_table(db){\n db.execute('CREATE TABLE IF NOT EXISTS my_job_and_quote_count_info('+\n 'id INTEGER PRIMARY KEY autoincrement,'+\n 'date TEXT,'+\n 'job_count INTEGER,'+\n 'quote_count INTEGER)'); \n }", "function build_table(){\n S.table = new Tabulator(\"#config-table\", {\n data: S.config.json.table || [],\n columns: C.column.map(function(e){\n e.downloadTitle = e.field;\n return e;\n }),\n //fit columns to width of table\n layout: \"fitColumns\",\n //hide columns that dont fit on the table\n responsiveLayout: \"hide\",\n //show tool tips on cells\n tooltips: true,\n //when adding a new row, add it to the top of the table\n addRowPos: \"top\",\n //allow undo and redo actions on the table\n history: true,\n //paginate the data\n pagination: \"local\",\n //allow 7 rows per page of data\n paginationSize: 10,\n //allow column order to be changed\n movableColumns: true,\n //allow row order to be changed\n resizableRows: true,\n /* set height of table (in CSS or here),\n * this enables the Virtual DOM and\n * improves render speed dramatically (can be any valid css height value)\n */\n height: 360\n });\n }", "function newTable (head) {\n // var table = new Table();\n var table = new Table({\n head: head || [],\n chars: {\n 'mid': '',\n 'left-mid': '',\n 'mid-mid': '',\n 'right-mid': ''\n }\n })\n return table\n}", "function crearTablaPuertasItemsMotorizacion(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_items_motorizacion(k_coditem_motorizacion, o_descripcion, v_clasificacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function addtable() {\n tbody.html(\"\");\n console.log(`There are ${tableDatashape.length} records in this table.`);\n console.log(\"----------\");\n tableDatashape.forEach(function(sighting) {\n var row = tbody.append(\"tr\");\n Object.entries(sighting).forEach(function([key, value]) {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n }", "function createTable() {\n console.log(\"Available products: \")\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n var table = new cliTable({\n head: [\"item_id\", \"product_name\", \"department_name\", \"price\", \"stock_quantity\"],\n colWidths: [10, 45, 18, 10, 18]\n }); \n for (var i = 0; i < res.length; i++) {\n var tableId = res[i].item_id;\n var productName = res[i].product_name;\n var deptName = res[i].department_name;\n var price = res[i].price;\n var stockQuan = res[i].stock_quantity;\n \n table.push([tableId, productName, deptName, price, stockQuan]\n ); \n }\n console.log(table.toString());\n inquire();\n })\n}", "function EchidnaTable(name, schema){\n this.name = name;\n this.schema = schema;\n // maybe this should be an object?\n this.data = [];\n // left data as an array... maybe make it a (multi?) heap though--future impl\n //moved create in the table, since this method is for the table!\n this.create = function(data){\n console.log(\"in create\")\n var hash = \"\";\n // make an id for each which will only rarely be duplicated (a hash key).\n for (var i = 0; i < 14; i ++){\n hash += Math.floor(Math.random()*10);\n }\n // uses that hash\n data._id = hash;\n this.data.push(data);\n console.log(this);\n return this;\n }\n\n // there are a few things wrong here! get it to work!\n // NEW AS OF DAY2\n this.findData = function(skey, svalue){\n var return_array =[ ];\n data.forEach(function(tvalue, tkey){\n // console.log(tvalue, \"tvalue\", skey);\n // console.log(tvalue[skey]);\n if (tvalue[skey] == svalue){\n return_array.push(tvalue);\n }\n });\n\n }\n}", "function createTable() {\r\n $tbody.innerHTML = \"\";\r\n \r\n var sighting, sightingKeys;\r\n var dom;\r\n var columnValue;\r\n \r\n for (var i = 0; i < ufoData.length; i++) {\r\n sighting = ufoData[i];\r\n sightingKeys = Object.keys(sighting);\r\n\t\r\n $dom = $tbody.insertRow(i);\r\n\t/* insert the column values: 0=date, 1=city, 2=state, 3=country, 4=shape, 5=duration, 6=comments*/\t\r\n for (var j = 0; j < sightingKeys.length; j++) {\r\n columnValue = sightingKeys[j];\r\n $dom.insertCell(j).innerText = sighting[columnValue];\r\n }\r\n }\r\n}", "function crearTablaEscalerasValoresDefectos(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE escaleras_valores_defectos (k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores defectos...Espere\");\n console.log('transaction creada ok');\n });\n}", "async _createTable (silent = true) {\n\t\tconst fn = `${this._tableName}._createTable`\n\t\tconst create = `CREATE TABLE IF NOT EXISTS ${this._tableName} ();`\n\t\tlet res;\n\t\tif (!silent) log.info('DB._createTable', create)\n\t\ttry {\n\t\t\tawait this.query(create)\n\t\t} catch (err) {\n\t\t\tif (err.code === '42P07') {\n\t\t\t\tif (!silent) log.info(fn, `TABLE ${this._tableName} already exists`)\n\t\t\t} else {\n\t\t\t\tlog.error(fn, { err: err })\n\t\t\t}\n\t\t}\n\t\tif (!silent && res) log.info(fn, `Created TABLE ${this._tableName}`)\n\t\tawait this._describeTable()\n\t}", "function crearTablaPuertasValoresManiobras(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_valores_maniobras (k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores maniobras...Espere\");\n console.log('transaction creada ok');\n });\n}", "function createUserTable(){\n knex.select('*').from('userdetail')\n .then((data)=>{\n for(var i of data){\n userTable(i.email.split('@')[0]+i.password)\n // console.log(i.fullname+i.id)\n\n }\n })\n }" ]
[ "0.68993884", "0.6390192", "0.6312664", "0.62736255", "0.6247299", "0.6235868", "0.62232095", "0.6168056", "0.6139181", "0.60783637", "0.6055402", "0.6055402", "0.6055402", "0.6055402", "0.6055402", "0.6055402", "0.6048085", "0.60276055", "0.60185426", "0.5995055", "0.5989276", "0.5984816", "0.5980174", "0.5960554", "0.5954262", "0.5942924", "0.59369266", "0.59275746", "0.59028894", "0.58915764", "0.588287", "0.5871126", "0.5848041", "0.5841579", "0.5840724", "0.5825245", "0.58191633", "0.5815516", "0.5808833", "0.58078814", "0.5795145", "0.57929724", "0.57823414", "0.57786", "0.5773733", "0.5766311", "0.5766101", "0.576112", "0.5761007", "0.5759042", "0.5757394", "0.57570845", "0.5756494", "0.57553667", "0.57493985", "0.57487524", "0.5741885", "0.57389545", "0.57341605", "0.57328206", "0.57223594", "0.57208014", "0.5716456", "0.57144403", "0.57127017", "0.5707814", "0.57039005", "0.5701956", "0.5701153", "0.56953824", "0.5694285", "0.5686318", "0.56799376", "0.5675839", "0.5674342", "0.56720537", "0.5661321", "0.5658183", "0.5655946", "0.56553733", "0.5655204", "0.56548375", "0.56517047", "0.56508255", "0.56460875", "0.5643395", "0.56389606", "0.56360865", "0.56357133", "0.56310284", "0.56223345", "0.5621794", "0.56191427", "0.56183267", "0.5617581", "0.5610916", "0.56101596", "0.559572", "0.5595051", "0.55887705" ]
0.58418673
33
Go back to prior page
function goBack() { window.history.back(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "goBackToPreviousPage() {\n this.location.back();\n }", "goBackToPreviousPage() {\n this.location.back();\n }", "function goBack() {\n history.go(-1);\n }", "function goBack() {\n\t\t\t$window.history.back();\n\t\t}", "function previousPage()\r\n{\r\n\thistory.go(-1);\r\n}", "function navigateOnePageBack() {\n window.history.back();\n}", "goToPrevious() {\n if (this.history.getPagesCount()) {\n this.transition = this.history.getCurrentPage().transition;\n if (!_.isEmpty(this.transition)) {\n this.transition += '-exit';\n }\n this.history.pop();\n this.isPageAddedToHistory = true;\n window.history.back();\n }\n }", "function goBack() {\n window.history.back();\n }", "function goBack(){\n // *Navigating back:\n window.history.back();\n }", "function goBack() {\n\t\ttogglePage();\n\t\tdisposeThrownShurikens();\n\t\tupdateThrownShurikenCount();\n\t\tcleanBelt();\n\t}", "function goBack() {\n window.history.back();\n }", "function goBack() {\n window.history.back();\n }", "function goBack() {\n window.history.back();\n }", "function goToPreviousPage() {\n\t\tif ( canPreviousPage() ) {\n\t\t\tgoToPage( currentPage() - 1 );\n\t\t}\n\t}", "function goBack() {\n\t\t\t$state.go('^');\n\t\t}", "function goBack() { $window.history.back(); }", "function redirectToBack(){\n\t\thistory.go(-1);\n\t}", "function goToPrevious() {\n goTo(_currentContext.previous);\n }", "goBack() {\n history.back();\n window.scroll(0,0);\n }", "function pageBackAction() {\n if (typeof(navigator) != 'undefined' && typeof(navigator.app) != 'undefined' && typeof(navigator.app.backHistory) == 'function')\n navigator.app.backHistory();\n else\n history.go(-1);\n}", "function returnBack() {\n window.history.back()\n}", "back() {\n // if we're on the first page of a step, return to the previous step.\n // otherwise, if we're still navigating within the same step, just update the page number.\n if (scope.currentStep().currentPageIndex == 0) {\n scope.currentStepIndex--;\n }\n\n else {\n scope.currentStep().currentPageIndex--;\n }\n }", "function goBack() {\r\n window.history.go(-1)\r\n}", "function goPrevious() {\n if (pageNum <= 1)\n return;\n pageNum--;\n renderPage(pageNum);\n }", "function goBack() {\n window.history.go(-1);\n}", "function goback() \n{\nhistory.go(-1);\n}", "function goBack() {\n window.history.back();\n} // nu merge, mai este si forward, merge inainte spre urmatorul url din history", "function onBack() {\n resetPageState();\n }", "function goBack() {\r\n window.history.back();\r\n}", "function goPrevious() {\n\tif (pageNum <= 1)\n\t\treturn;\n\tpageNum--;\n\trenderPage(pageNum);\n}", "function goToPrevious() {\n var prevId = getPreviousLocationIndex();\n if (prevId != null) {\n setCurrentLocation(prevId);\n }\n }", "function goBack() { // go back function\n history.go(-1);\n}", "function goBack(){\n\twindow.history.back();\n}", "function goBack() {\n return history.goBack();\n }", "function atras() {\n history.back();\n}", "return() {\n this.location.back();\n }", "function previousPage(){\n if (page > 1)\n {\n setPage(page - 1);\n }\n else {\n // do nothing\n }\n }", "back() {\n this.page = 0;\n }", "function goBack() {\n history.go(-1);\n location.reload();\n}", "function goBackTo() {\n window.history.back()\n}", "function back () {\n\t\n\t window.history.back();\n\t \n}", "function goBack() {\n window.history.back();\n}", "function goBack() {\n window.history.back();\n}", "function navigateBack() {\n try {\n window.history.back();\n console.log(\"status pass : Navigated one step back from current position in recent history\" + url);\n } catch (err) {\n console.log(\"status fail : Broken link or no network connection\");\n }\n}", "function goBack() {\r\n window.history.back();\r\n}", "function previousPage() {\n\t\tsetCurrentPage((page) => page - 1);\n\t}", "function goBack() {\r\n\twindow.history.back();\r\n}", "function goBackToPreviousPage() {\n\t// get saved storage first\n\tvar domianPath = getContextPathDomain();\n\tvar savedArray = $.jStorage.get(domianPath + PREVIOUS_PAGE_DATA, []);\n\t// check size of array\n\tif (savedArray.length > 1) {\n\t\t// remove last element (current page)\n\t\tsavedArray.pop();\n\t\t// save to storage\n\t\t$.jStorage.set(domianPath + PREVIOUS_PAGE_DATA, savedArray);\n\t\t// get previous page object\n\t\tvar previousPageObj = savedArray[savedArray.length - 1];\n\t\t// count the number of keys in object\n\t\tvar size = Object.keys(previousPageObj).length;\n\t\t// check the size\n\t\tif (size > 1) {\n\t\t\t// page with initialization parameter\n\t\t\t// loop through object to create form\n\t\t\tvar formInputString = \"\";\n\t\t\tfor (var key in previousPageObj) {\n\t\t\t\tif (previousPageObj.hasOwnProperty(key)) {\n\t\t\t\t\tformInputString += '<input type=\"hidden\" id=\"' + key + '\" name=\"'\n\t\t\t\t\t\t\t\t\t\t+ key + '\" value=\"' + previousPageObj[key] + '\" />';\n\t\t\t\t}\n\t\t\t}\n\t\t\t// create form starts\n\t\t\t$('<form>', {\n\t\t\t\t\"id\": \"formChangePage\",\n\t\t\t\t\"html\": formInputString,\n\t\t\t\t\"method\": 'POST',\n\t\t\t\t\"action\": previousPageObj[\"url\"]\n\t\t\t}).appendTo(document.body).submit();\n\t\t} else {\n\t\t\t// normal page with no initialization parameter\n\t\t\twindow.location = previousPageObj[\"url\"];\n\t\t}\n\t} else {\n\t\t// last page, back to login page\n\t\tjQuestion_confirm(LOGOUT_MESSAGE, DIALOG_TITLE, DIALOG_YES_BUTTON, DIALOG_NO_BUTTON, function(val) {\n\t\t\tif (val) {\n\t\t\t\twindow.top.location = getContextPath() + \"/login\";\n\t\t\t}\n\t\t});\n\t}\n}", "function goBack(){\n window.history.back();\n}", "function back(){\r\n window.history.back();\r\n}", "function goBack() {\n // remove latest from directory arrays\n dirs.pop()\n // browse to our new route\n navigate()\n}", "function back(){\n\twindow.history.back();\n}", "function goPrevious() {\n //console.log(\"goPrevious: \" + options.currentPage);\n if (options.currentPage != 1) {\n var p = options.currentPage - 1;\n loadData(p);\n setCurrentPage(p);\n options.currentPage = p;\n pageInfo();\n }\n }", "function goBack(num)\n{\n parent.history.go(num);\n}", "function goBack() {\n\tloadElements();\n}", "function onGoBack() {\n setFormDataEdit(null);\n setStep('Menu');\n }", "function previous(){\n var goToPage = parseInt(pager.data(\"curr\")) - 1;\n goTo(goToPage);\n }", "function goBack() {\n\t\t\t$state.go('^.detail', {id: vm.order._id});\n\t\t}", "function goBack() {\n $ionicHistory.goBack();\n }", "function goBack() {\n window.location.reload();\n }", "back()\n {\n\n\n history.back();\n\n\n }", "function goBack() {\n $state.go('tribes.list');\n }", "function goBack() {\r\n \t\t$state.go('main.afiliado.edit.examen.list', {afiliadoId: $stateParams.afiliadoId});\r\n \t}", "function onGoBack() {\n // history.goBack();\n history.push(location?.state?.from ?? \"/\");\n }", "_previous() {\n if (this._page === 1) return;\n\n this._page--;\n this._loadCurrentPage();\n }", "function voltarHistory()\n\t{\n\t\twindow.history.back();\n\t}", "function back() {\n window.history.back();\n //director.navigateTo({ path: 'customer-service-dashboard' });\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 navBack(prevState) {\n $state.go(prevState, {}, {reload: true}); // reload to get reslove data again\n }", "function previous(){\n\twindow.location.href = previousurl;\n}", "navigateBack() {\r\n this.isExplicitNavigationBack = true;\r\n this.history.navigateBack();\r\n }", "function lastpage() {\n window.history.back();\n}", "goback() { this.back = true; }", "function goBack() {\n PathStore.pop();\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 goBack() {\r\n window.location = '/';\r\n}", "function GoToPreviousPage() {\n if (previousPageURL != '') {\n window.location.href = previousPageURL;\n return false;\n }\n}", "goBack() {\n try {\n browser.back();\n return true;\n }\n catch (ex) {\n return false;\n }\n }", "previousPage() {\n\t\tthis.setPage(this.state.previous);\n\t}" ]
[ "0.8395198", "0.8395198", "0.8380944", "0.8265042", "0.8262944", "0.82248926", "0.8205531", "0.81706524", "0.8133696", "0.81112975", "0.80715114", "0.80715114", "0.80715114", "0.8013673", "0.798435", "0.7966998", "0.7934467", "0.7918586", "0.79010165", "0.79003525", "0.78253114", "0.7814763", "0.780957", "0.7805724", "0.7799622", "0.7791875", "0.7788211", "0.7783011", "0.77702194", "0.7769624", "0.77674776", "0.7756592", "0.7749309", "0.77437", "0.77230144", "0.77204454", "0.77155507", "0.7710666", "0.7709994", "0.76945907", "0.7680777", "0.76776236", "0.76776236", "0.7677449", "0.7665052", "0.7662133", "0.764226", "0.7619646", "0.76068336", "0.75772965", "0.7567945", "0.7562856", "0.75575703", "0.75534004", "0.7551556", "0.7549859", "0.7544149", "0.75248575", "0.75173736", "0.75027734", "0.7500221", "0.7494053", "0.74837935", "0.7483491", "0.7468699", "0.74633396", "0.7461341", "0.7459238", "0.7459238", "0.7459238", "0.7459238", "0.7459238", "0.7459238", "0.7459238", "0.7459238", "0.7459238", "0.7459238", "0.7459238", "0.7459238", "0.7459238", "0.7459238", "0.7459238", "0.7459238", "0.7459238", "0.7451033", "0.7448512", "0.7447032", "0.7445466", "0.7445365", "0.7444869", "0.74398994", "0.7412434", "0.7411515", "0.7405409", "0.73983896" ]
0.7628234
50
Want to populate the initial state with any missing items. Might not be necessary if the server does this for us, but no bad thing to have
didReceiveAttrs () { get(this, 'populateFunctions').buildState(get(this, 'form.state'), get(this, 'form.formElements')) .then(state => { set(this, 'form.state', state) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addEmptyItemIfNeeded(initialItems: ?Object): Object {\n return _.isEmpty(initialItems) ? { '1': null } : initialItems;\n }", "getInitialItems(props) {\n if (props.showAllItems) {\n return props.items;\n }\n else {\n return [];\n }\n }", "initState() {\n return {\n items: [],\n }\n }", "refreshItems() {\n var self = this;\n self.lastQuery = null;\n\n if (self.isSetup) {\n self.addItems(self.items);\n }\n\n self.updateOriginalInput();\n self.refreshState();\n }", "async resetItemsHandler() {\n const items = await this.getItemsFromAPI();\n this.localItemsBackup = items;\n this.setState({items});\n }", "function fetchItemsAction () {\n fetchTodoItems().then((response) => {\n return response.json()\n }).then((serverItemModel) => {\n if (serverItemModel.data) {\n viewState.items.length = 0\n serverItemModel.data.forEach((item) => {\n viewState.items.push(\n serverItemModelToClientItemModel(item)\n )\n })\n fillItems()\n }\n })\n}", "constructor() {\n this.items = {}\n }", "resetAndReturn() {\n data.input = JSON.parse(JSON.stringify(data.emptyForm));\n data.items = [];\n this.props.returnToStart();\n }", "function updateValuesAndStates() {\n [values, states] = generateDefaultStateArray(getItemCount());\n}", "reset() {\n this._items = [];\n }", "componentDidMount() {\n const { testItems, contactItems, items } = this.state;\n if (testItems.length === 0) {\n const newTestItems = localStorage.getItem('testItems') !== null ? JSON.parse(localStorage.getItem('testItems')) : [];\n this.setState({ testItems: newTestItems });\n }\n if (items.length === 0) {\n const newItems = localStorage.getItem('items') !== null ? JSON.parse(localStorage.getItem('items')) : [];\n this.setState({ items: newItems });\n\n }\n if (contactItems.length === 0) {\n const newContactItems = localStorage.getItem('contactItems') !== null ? JSON.parse(localStorage.getItem('contactItems')) : [];\n this.setState({ contactItems: newContactItems });\n }\n }", "function init() {\n dimDefinitions.getDefinitions().then((defs) => {\n vm.fullItem = dimItemService.getItem({ id: $stateParams.itemId });\n if (!vm.fullItem) {\n return;\n }\n vm.item = angular.copy(vm.fullItem);\n vm.originalItem = vm.item.originalItem;\n vm.definition = defs.InventoryItem.get(vm.item.hash);\n delete vm.item.originalItem;\n\n vm.store = dimStoreService.getStore(vm.item.owner);\n });\n }", "reset() {\n\t\tthis.items.length = 0;\n\t}", "function initBlacklistedItems(collection) {\n\t\tlogTrace('invoking initBlacklistedItems($)', collection);\n\n\t\tconst itemTypes = [\n\t\t\t'categories',\n\t\t\t'channels',\n\t\t\t'tags',\n\t\t\t'titles'\n\t\t];\n\n\t\t// base container\n\t\tif (typeof collection !== 'object') {\n\n\t\t\tcollection = {};\n\t\t}\n\n\t\tconst itemTypesLength = itemTypes.length;\n\t\tfor (let i = 0; i < itemTypesLength; i++) {\n\n\t\t\tlet itemType = itemTypes[i];\n\n\t\t\tif (collection[itemType] === undefined) {\n\n\t\t\t\tcollection[itemType] = {};\n\t\t\t}\n\t\t}\n\n\t\treturn collection;\n\t}", "function setupItems() {\n let items = getLocalStorage();\n\n if (items.length > 0) {\n items.forEach((item) => {\n createAllItems(item.id, item.value);\n });\n allList.classList.add(\"visible\");\n }\n}", "init() {\n this._super(...arguments);\n this.set('items', []);\n this.set('total', 0);\n }", "initData() {\n this.items = [];\n }", "constructor() {\n\t\tthis.items = [];\n\t}", "prepareItems(items) {\n if(!items)\n return items;\n \n if (items.total_count)\n this.total_count = items.total_count;\n \n if(items.items)\n items = items.items; // this is an exceptional behavior for Magento2 api for attributes\n\n return items;\n }", "constructor () {\n\t\tthis.items = [];\n\t}", "parseData(serverData) {\n let parsedData = [];\n let listOfNames = [];\n let dataLength = Object.entries(serverData.inventory.items).length;\n let inventoryData = Object.entries(serverData.inventory.items);\n this.setState({ listOfFood: [] });\n for (let i = 0; i < dataLength; i++) {\n if (\"quantities\" in inventoryData[i][1]) {\n let inventoryDataQuantities = Object.entries(\n inventoryData[i][1].quantities\n );\n for (let j = 0; j < inventoryDataQuantities.length; j++) {\n let tempItem = new Item(\n inventoryData[i][1]._id,\n inventoryData[i][1].name,\n inventoryDataQuantities[j][0],\n inventoryDataQuantities[j][1],\n inventoryData[i][1].note\n );\n parsedData.push(tempItem);\n }\n } else {\n (\"Empty item\");\n }\n listOfNames.push({ name: inventoryData[i][1].name });\n }\n this.setState({ listOfFood: listOfNames });\n return parsedData;\n }", "function _getEmptyState() {\n\tconst { uid } = _store.getState().Main.user;\n\tlet ret = [\n\t\tDiv({className: 'empty-state'},[\n\t\t\tH3({}, !uid ? 'Need to login to enter a match' : 'No active matchs, create One')\n\t\t]),\n\t\t...getEmptyRows([])\n\t]\n\treturn ret;\n}", "constructor() {\n this.items = []; // {1}\n }", "constructor(initId) {\n this.id = initId;\n this.name = \"Unknown\";\n this.items = [];\n }", "function clearData () {\n getSetUpList().forEach(function (entry) {\n if (entry.list) {\n entry.factory.initList(entry.id);\n } else {\n entry.factory.initObj(entry.id);\n }\n });\n }", "componentDidMount() {\n var itemsDefault = this.props.model;\n\t\tvar itemsLength = itemsDefault.length;\n\t\tfor (var i = 0; i < itemsLength; i++) {\n\t\t this.setState({\n\t\t \t[itemsDefault[i].name]: \"NA\"\n\t\t });\n\t\t \n\t\t}\n\t\t\n }", "SET_EMPTY_LIST_STRUCTURE (state, o) { state.emptyList = o }", "render() {\n const {loading, listOfItems} = this.state;\n return (\n <div className='itemsPage'>\n <h1>ITEMS LIST</h1>\n {!loading && listOfItems.map(item => {\n\n if (!item.isBought) {\n return (<ListItem key={item._id} updateList={this.getAllItems} item={item}/>)\n }\n })\n }\n </div>\n )\n }", "cacheInitialItems() {\n this.initialItemElements = this.containerDirectChildren.map(child => child.cloneNode(true));\n if (!this.initialItemElements.length) {\n throw new Error('Could not find any items');\n }\n\n this.initialItemsWidth = this.containerDirectChildren.reduce(\n (sum, item) => sum + getWidth(item),\n 0,\n );\n }", "redefine() {\n // go threw all added items\n for (var i = 0; i < this.__items.length; i++) {\n var item = this.__items[i].item;\n // set the new init value for the item\n this.__items[i].init = item.getValue();\n }\n }", "emptyList(){\n let text = 'Du hast noch keine Abzeichen. Du kannst diese Ansicht aktualisieren, indem du die Liste nach unten ziehst.';\n console.log('EMPTY');\n this.setState({\n dataSource:this.state.dataSource.cloneWithRows([{id:'empty', text:text}]),\n loaded: true, refreshing: false\n });\n }", "onNewItemsReady(items) {\n return items;\n }", "initItem(item) {\n if (!item || typeof(item)!==\"object\") item = {};\n return item;\n }", "fetchItems() {\n this._$itemStorage.getAllItems().then((items) => {\n if (!angular.equals(items, this.items)) {\n if (!!this.reshuffle) {\n this.items = this.reshuffleItems(items);\n } else {\n this.items = items;\n }\n }\n });\n }", "function addMissingImages(items) {\n return items.map(function (item, index) {\n if (item.images.length === 0) {\n item.images = [{url: 'images/no-image.png'}];\n }\n return item;\n });\n }", "getInitialState(props) {\n this.state = Object.create(null,{})\n this.setState({\n items : [],\n isLoading:true\n })\n let data = !props?{}:props.data\n data.count = 5\n this._handleAjaxCall(data);\n }", "async fetchInitialData() {\n try {\n let tasks = await Helpers.fetch('/api/tasks', {\n method: 'GET'\n });\n this.setState({tasks: tasks});\n\n let tags = await Helpers.fetch('/api/tags', {\n method: 'GET'\n });\n this.setState({tags: tags, draftTags: tags, loaded: true});\n } catch (error) {\n if (error.response.status === 401) {\n this.props.history.replace('/login');\n } else if (error.response.status === 400) {\n // error in response, display could not load error message\n this.setState({error: error});\n }\n }\n }", "function initialize() {\n setToStorage('todoItems', seedData);\n setToStorage('initialized', true);\n}", "constructor() {\r\n this.items = [];\r\n }", "storeChangeHandler() {\n this.setState({\n items: ItemStore.get('items'),\n loading: ItemStore.get('loading'),\n });\n }", "static async loadState(state) {\n const itemsString = await AsyncStorage.getItem('@MobilePocket:items');\n console.log('itemsString', itemsString);\n if (itemsString === null) {\n console.log('there are no persisted items yet');\n return {...state};\n }\n return {\n ...state,\n items: JSON.parse(itemsString)\n };\n }", "initItem(itemId) {\n if(itemId) {\n return this.fetch({ id: itemId });\n } else {\n this.item = this._newItem();\n return $q.when(this.item);\n }\n }", "componentDidMount(){\n fetch('/api/todo')\n .then(response => response.json())\n .then(data => {\n this.setState({\n items: [...data.payload]\n })\n // data.payload.map((todo)=> {\n // let item = todo.toDo;\n // this.setState((prevState) => ({\n // items:[...prevState.items,{items:item}]\n // }))\n // })\n });\n}", "_setInitialValues() {\n const that = this;\n\n that._mapFieldsToMenu();\n that._localizeInitialValues();\n that.$.conditionsMenu.dropDownAppendTo = that.$.container;\n that.$.conditionsMenu.dataSource = that._groupOperationDescriptions;\n\n that._valueFlat = [];\n that._lastProcessedItemInCurrentGroup = { parentId: null, id: null, position: null };\n }", "prepopulateClear() {\n this.setState(function(prevState,props){\n return ({jobsFound: [] });\n });\n }", "constructor()\r\n {\r\n this.items = [];\r\n }", "incomplete(item) {\n\t\tlet unfinishedKey = this.props.finished.indexOf( item );\n\t\tlet unfinishedVal = this.props.finished[ unfinishedKey ];\n\n\t\tif ( this.props.todos.indexOf( unfinishedVal ) !== -1 ) {\n\t\t\tthis.dupeWarn();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.props.finished.splice( unfinishedKey, 1 );\n\t\tthis.props.todos.push( unfinishedVal );\n\t\tlocalStorage.setItem( 'todos', JSON.stringify( this.props.todos ) );\n\t\tlocalStorage.setItem( 'finished', JSON.stringify( this.props.finished ) );\n\t\tthis.setState( {\n\t\t\ttodos: this.props.todos,\n\t\t\tfinished: this.props.finished,\n\t\t} );\n\t}", "constructor(props) {\n super(props);\n this.state = {\n items: [],\n isloaded: false,\n }\n }", "empty() {\n this.items = []\n }", "constructor(props){\n super(props)\n this.state = {\n items : []\n }\n }", "constructor(){\n super();\n this.state = {\n item: [],\n isLoaded: false,\n }\n }", "clear() {\n this._items = {};\n }", "function fillInitialEntries() {\n console.log(\"notesService: Create some dummy entries...\");\n\n //\n // fill with default /test data:\n //\n var notes = [];\n\n var note = new Note(\"CAS FEE Selbststudium / Projekt-Aufgabe erledigen\", new Date(2016, 10, 20),\n \"HTML für die Notes Application erstellen.<br>CSS erstellen für die Notes Application<br>TODO<br>TODO\", 1,\n new Date(2016, 7, 17));\n note.finishedDate = new Date(2016, 8, 23);\n publicSaveNote(note);\n\n note = new Note(\"Einkaufen\", new Date(2016, 9, 12), \"Butter<br>Eier<br>Brot<br>...\", 2, new Date(2016, 8, 22));\n publicSaveNote(note);\n\n note = new Note(\"Mami anrufen\", null, \"888 888 88 88<br>Termin vereinbaren<br>Weihnachtsgeschenke<br>Ferienabwesenheit besprechen\", 3, new Date(2016, 8, 19));\n publicSaveNote(note);\n}", "function resetListOfTrackedItems() {\n var itemList = [];\n DataCollectorService.storeLocal(\"usage_item_list\", itemList);\n }", "constructor() {\n this.items = [];\n }", "constructor(props) {\n super(props);\n\n this.state = {\n items: [],\n isLoaded: false\n };\n }", "constructor() {\n this.items = [];\n }", "constructor() {\n this.items = [];\n }", "constructor() {\n this.items = [];\n }", "constructor() {\n this.items = [];\n }", "constructor() {\n this.items = [];\n }", "constructor() {\n this.items = [];\n }", "constructor() {\n this.items = [];\n }", "constructor(props) {\n super(props);\n this.state = {\n items: props.items\n };\n }", "handleSave() { \n\n if (this.state.listItem.priority === '') {\n console.log('need priority item');\n } else {\n let prioritiesArray = [...this.state.prioritiesList];\n prioritiesArray.unshift(this.state.listItem);\n\n// sets the listItem states back to blank for user\n\n this.setState({\n prioritiesList: prioritiesArray,\n listItem: { \n priority: ''}});\n } \n }", "get initialItems () {\n const firstParsed =\n (this.currentAstNode.parent.nodes[0] === this.currentAstNode) &&\n (this.currentAstNode.parent.parent.type === 'root')\n\n if (firstParsed) {\n return this.#initialItems\n }\n\n if (this.currentAstNode.prev().type === 'combinator') {\n return this.#inventory\n }\n return this.currentResults\n }", "getInitialState() {\n return this.items;\n }", "getItems(){\n\t\tthis.setState({\n\t\t\titems: ItemsStore.getAll(),\n\t\t\tprogess: this.getProgress(),\n\t\t});\n\t}", "getAllItems() {\n // called in componentDidMount\n fetch('/item/all')\n .then((res) => res.json())\n .then((res) => {\n this.setState({ allItems: res.items });\n })\n .catch((err) => {\n console.log('/item/all GET error: ', err);\n });\n }", "handleNewValues () {\n const newValue = this.get(`value.${this.get('bunsenId')}`) || []\n const oldValue = this.get('items')\n\n if (!_.isEqual(newValue, oldValue)) {\n this.set('items', A(newValue))\n }\n }", "constructor() { \n this.items = []; \n }", "constructor() { \n this.items = []; \n }", "componentWillMount() {\n if (!this.props.items.length) {\n this.props.fetchResources({\n query: { ...this.props.filters },\n });\n }\n }", "constructor() {\n super();\n this.state = {\n error: null,\n isLoaded: false,\n items: []\n };\n }", "getEntity() {\n fetch('/search-entity')\n .then((response) => response.json())\n .then((entities) => {\n if (entities === undefined || entities.length == 0) {\n console.error('no result found');\n } else {\n // Item entity does not have items field.\n if (typeof entities[0].items === 'undefined') {\n this.setState({kind: 'item'});\n this.setState({items: entities});\n } else {\n this.setState({kind: 'receipt'});\n this.setState({receipts: entities});\n }\n }\n })\n .catch((error) => {\n console.error(error);\n });\n }", "function create(items, isIncomplete) {\r\n return { items: items ? items : [], isIncomplete: !!isIncomplete };\r\n }", "function create(items, isIncomplete) {\r\n return { items: items ? items : [], isIncomplete: !!isIncomplete };\r\n }", "reset() {\n this.items = [];\n }", "getInitialTickets() {\n this.setState({\n initialLoading: true,\n initialLoadText: 'tickets...',\n loadError: false\n });\n this.subscribe(\n TicketsService.listAll(),\n data => {\n this.setState(state => ({\n tickets: data,\n initialLoading: false,\n lastUpdate: moment().format(config.DATETIME_FORMAT)\n }));\n },\n (err) => this.setState({loadError: true, initialLoading: false}),\n () => this.getInitialRequests()\n );\n }", "constructor() {\n super();\n this.items = [];\n }", "function create(items, isIncomplete) {\r\n return { items: items ? items : [], isIncomplete: !!isIncomplete };\r\n }", "function create(items, isIncomplete) {\r\n return { items: items ? items : [], isIncomplete: !!isIncomplete };\r\n }", "function create(items, isIncomplete) {\r\n return { items: items ? items : [], isIncomplete: !!isIncomplete };\r\n }", "function create(items, isIncomplete) {\r\n return { items: items ? items : [], isIncomplete: !!isIncomplete };\r\n }", "constructor({\n title = '',\n name = title,\n status = 'unknown',\n experimental = false,\n date = new Date().toISOString(),\n publisher = '',\n description = '',\n items = [],\n ...restProps\n } = {}) {\n\n // Initialize fields\n this.title = title;\n this.name = name;\n this.status = status;\n this.experimental = experimental;\n this.date = date;\n this.publisher = publisher;\n this.description = description;\n this.items = items;\n Object.assign(this, restProps);\n\n // Check for uniqueness in itemIds\n const itemStack = [...items];\n const seenIds = new Set();\n while (itemStack.length) {\n const { itemId, items } = itemStack.pop();\n if (seenIds.has(itemId))\n throw new Error(`Item id ${itemId} is not unique.`);\n seenIds.add(itemId);\n itemStack.push(...items);\n }\n }", "resetList() {\n let originalList = this.state.products;\n originalList.forEach((product) => {\n if (!product.addedCount) {\n product.inventory = product.inventory;\n\n } else if (product.addedCount && product.inventory === 0) {\n product.inventory = product.addedCount;\n delete product.addedCount;\n delete product.remaningCount;\n\n } else {\n product.inventory = product.addedCount + product.remaningCount;\n delete product.addedCount;\n delete product.remaningCount;\n }\n });\n\n this.setState({\n products: originalList\n });\n }", "preFetchItemById( id ) {\n\t\tthis.getItemById( id );\n\t}", "function buildInitialListOfGames() {\n for (var i = 0; i < dataForPreSelectedGames.length; i++) {\n new BuildGameItem(dataForPreSelectedGames[i][0], dataForPreSelectedGames[i]\n [1], dataForPreSelectedGames[i][2], dataForPreSelectedGames[i][3],\n dataForPreSelectedGames[i][4], dataForPreSelectedGames[i][5],\n dataForPreSelectedGames[i][6], dataForPreSelectedGames[i][7], 'gameId' + [\n i\n ], false);\n }\n}", "createModalityItems(){\n let modalityItems = this.state.modalityItems;\n if(modalityItems.length){\n modalityItems.splice(0, modalityItems.length);\n }\n for (var i = 0; i < this.state.modalities.length; i++) {\n modalityItems.push(this.state.modalities[i].name);\n }\n this.setState({\n modalityItems: modalityItems,\n });\n }", "function setupItems() {\n let items = getLocalStorage();\n if (items.length > 0) {\n items.forEach(function (item) {\n createListItem(item.id, item.value);\n });\n container.classList.add('show-container');\n }\n}", "function addItemsToFullState (newItems, fullStateItems, indexer) {\n newItems.forEach((item) => {\n if (!item) {\n //check for null\n } else if (indexer[item.id] || indexer[item.id] === 0) {\n //we've added this item id already, so we can look it up and add the count\n fullStateItems[indexer[item.id]].quantity += item.count\n } else {\n //new item.id, add to full state and indexer\n indexer[item.id] = fullStateItems.length\n let itemFormattedForDB = {\n item_id: item.id,\n quantity: item.count,\n binding: item.binding,\n upgrades: (item.upgrades) ? item.upgrades.toString() : null\n }\n fullStateItems.push(itemFormattedForDB)\n }\n\n })\n\n}", "constructor()\n {\n this.items = [];\n }", "constructor()\n {\n this.items = [];\n }", "constructor()\n {\n this.items = [];\n }", "constructor()\n {\n this.items = [];\n }", "constructor()\n {\n this.items = [];\n }", "constructor()\n {\n this.items = [];\n }", "constructor()\n {\n this.items = [];\n }", "setInitialData(initialData, {noResetSnapshots} = {}) {\n this.fields.replace(initialData || {});\n this.initialData = this.fields.toJSON() || {};\n\n if (noResetSnapshots) {\n return;\n }\n\n this.snapshots = [new Map(this.fields)];\n }", "constructor() {\n super();\n this.state = {\n error: null,\n isLoaded: false,\n items: [],\n feats: []\n };\n }", "componentWillReceiveProps(nextProps) {\n if (nextProps !== this.state) {\n this.setState({ items: this.props.item.items_data.items });\n }\n }" ]
[ "0.65540034", "0.6526892", "0.6374483", "0.63715225", "0.6247323", "0.6238908", "0.61368346", "0.60796964", "0.60468864", "0.6043633", "0.6017442", "0.6001874", "0.5963538", "0.5954484", "0.5949951", "0.5949812", "0.5916636", "0.5911915", "0.5909339", "0.5902661", "0.5890988", "0.58866143", "0.5886052", "0.5885677", "0.58846796", "0.5865709", "0.5859747", "0.58352727", "0.58270043", "0.5799724", "0.5784819", "0.5784311", "0.5782609", "0.5773216", "0.57613194", "0.57572407", "0.57524526", "0.5742592", "0.5739196", "0.5726907", "0.5721979", "0.56991535", "0.56985396", "0.56938636", "0.5692785", "0.5691443", "0.5690346", "0.5680419", "0.5674492", "0.5664543", "0.5663547", "0.5662205", "0.56465393", "0.5644514", "0.5638474", "0.5635956", "0.5635597", "0.5635597", "0.5635597", "0.5635597", "0.5635597", "0.5635597", "0.5635597", "0.562657", "0.5617263", "0.5616052", "0.5602469", "0.55857897", "0.5585739", "0.5583799", "0.5583489", "0.5583489", "0.55800056", "0.557785", "0.55767375", "0.55723554", "0.55723554", "0.5570038", "0.5564443", "0.5555659", "0.5551128", "0.5551128", "0.5551128", "0.5551128", "0.5549328", "0.55465823", "0.5543775", "0.55392003", "0.5533566", "0.55294305", "0.5522641", "0.5522052", "0.5522052", "0.5522052", "0.5522052", "0.5522052", "0.5522052", "0.5522052", "0.5520565", "0.55201334", "0.55162024" ]
0.0
-1
UI function that displays the current username on top banner
function displayCurrentUser(username) { if(username) $("#CurrentLogin").html("Logged in as: " + username); else $("#CurrentLogin").html("Not logged in"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayUserName(data) {\n\t$('.welcome_message').html(`Welcome ${data.currentUser.username}, you are now logged into`)\n}", "function showLoggedInUser(user) {\n login_status.text(\"Logged in as: \" + user.profile.name);\n login_button.text(\"Logout\");\n }", "function onGetUserNameSuccess() {\n $('#message').text('Hello ' + user.get_title());\n }", "function onGetUserNameSuccess() {\n $('#message').text('Hello ' + user.get_title());\n }", "function onGetUserNameSuccess() {\n $('#message').text('Hello ' + user.get_title());\n }", "function onGetUserNameSuccess() {\n $('#message').text('Hello ' + user.get_title());\n }", "function showUserName(userName) {\r\n $(\".showUserName\").html(\"Hi \" + userName);\r\n }", "function onGetUserNameSuccess() {\n $('#message').text('Hello ' + user.get_title());\n}", "function showUsername() {\n const cookies = decodeURIComponent(document.cookie).split(';');\n\n if (cookies.length < 1 || cookies[0] === \"\") {\n // if theres no cookie, do nothing\n return;\n }\n\n const username = cookies[0].split('=')[1];\n\n loginButton.hide();\n\n navBar.append(`\n <li class=\"nav-item\">\n <a class=\"nav-link text-success\" href=\"#\">Welcome, ${username}</a>\n </li>\n `);\n }", "function displayUserName() {\n\tshowname = document.getElementById('displayName');\n\tshowname.innerHTML=localStorage.getItem('user'); \n}", "function userLoggedIn() {\n let span = $('#loggedInUser');\n let username = localStorage.getItem('username');\n span.text(`Wellcome ${username}`);\n span.show();\n\n $('#linkHome').show();\n $('#linkListAds').show();\n $('#linkCreateAd').show();\n $('#linkLogout').show();\n\n $('#linkLogin').hide();\n $('#linkRegister').hide();\n }", "function userget(){\n document.getElementById('current-user').innerHTML = current_user;\n }", "function showUser(data, status){\n\t\t console.log(status);\n\t\t var username = \"<h3> How are my repos? </h3><br>\";\n\t\t $(\"#username\").append(username);\n\t\t // debugger;\n\t\t}", "function updateHeader(){\n if(currentUser){\n document.getElementById(\"me\").innerHTML = currentUser.username;\n } else {\n document.getElementById(\"me\").innerHTML = \"LOGIN\";\n }\n}", "function updateUserNameDisplay(fullName) {\n\t$(\"#environmentData .profileName\").text(fullName);\n}", "function setWelcome(){\n var fullName = getUserFullName(VIP_id); //Calls function in class \"Loader\", which returns the users name.\n $(\"#welcome_userName\").text(fullName);\n}", "function renderUsername() {\n\n $(\".username-text\").text(firebase.auth().currentUser.email);\n\n}", "function showInfo() {\n $('#user-name').text(curUser.first_name + ' ' + curUser.last_name);\n $('#first-name').text(curUser.first_name);\n $('#last-name').text(curUser.last_name);\n $('#email').text(curUser.email);\n $('#phone').text(curUser.phone_number);\n }", "function showUserInfo(oneUser) {\n // Show user info bar if it's hidden..\n if(!infoVisibleFlag) {\n $('#other-userinfo').fadeIn(1000);\n infoVisibleFlag = true;\n }\n\n\n $('#panel-userinfo').fadeIn(1000);\n $('#other-infopanel').fadeOut(1000);\n\n var state = \"\";\n\n // Set user name, image of this user..\n $('#userinfo-name').text(oneUser.username);\n $('#userinfo-img').attr('src', oneUser.img);\n // Hide more details panel..\n $('#other-info').attr('style', 'display: none;');\n\n if(oneUser.id == \"BOT\") {\n // Set bot information..\n $('#userinfo-mood').text(\"This is a chat bot! Talk with him a fun!\");\n // Fet online status of bot..\n state = \"status contacted-online\";\n }\n else if(oneUser.id == \"CONCIERGE\") {\n // Set bot information..\n $('#userinfo-mood').text(\"Link to the serivce! Have a talk with administrator!\");\n // Fet online status of bot..\n state = \"status contacted-online\";\n }\n else {\n // Set email of this user..\n $('#userinfo-mood').text(\"Email address : \" + oneUser.email);\n // Get online status of this user..\n state = getUserOnlineStatus(oneUser);\n }\n\n // Set online status of this user..\n $('#userinfo-status').attr('class', state);\n\n // Set the name of this user to the main title..\n $('#span-mainTitle').text(oneUser.username);\n}", "function getUser(data) {\n\t$(\"#usernameBox\").show();\n\t$(\".overlay\").show();\n}", "function fillUserInfo(){\n $('#usrname').text(`${currentUser.username}`)\n $profileName.text(`Name: ${currentUser.name}`)\n $profileUsername.text(`Username: ${currentUser.username}`)\n $profileAccountDate.text(`Account Created: ${currentUser.createdAt.slice(0,10)}`)\n }", "function showUserInfo() {\n\tvar currentUser = sessionStorage.getItem('currentUser');\n\tif(currentUser === null){\n\t\t$(\"#loginBtn\").html(\"<span class=\\\"glyphicon glyphicon-log-in\\\" style=\\\"margin-right: 5px\\\"></span>Login\");\n\t}\n\telse{\n\t\tcurrentUser = JSON.parse(currentUser);\n\t\t$(\"#loginBtn\").attr('href', '#');\n\t\t$(\"#loginBtn\").click(closeSession);\n\t\t$(\"#loginBtn\").html(\"<span class=\\\"glyphicon glyphicon-log-out\\\" style=\\\"margin-right: 5px\\\"></span>Salir\");\n\t\t$(\"#right-navBar\").append(\"<li><a href=\\\"#\\\" style=\\\"text-transform: capitalize\\\"><span class=\\\"glyphicon glyphicon-user\\\" style=\\\"margin-right: 5px;\\\"></span>\"+currentUser.user_info.name+\"</a></li>\");\n\t}\n}", "function printUsername() {\n let usernameDOM = document.getElementById('label-username');\n usernameDOM.innerHTML = user.username;\n}", "function onGetUserNameSuccess() {\n $('#message').append('<p>Hello ' + user.get_title() + user.get_email()+'</p>');\n}", "function showUser(){\n\t$(\".profile-user-nickname\").html(userData.prezdivka);\n\t$(\".profile-user-name\").html(\"<p>\"+userData.jmeno+\" \"+userData.prijmeni+\"</p>\");\n\t$(\".profile-user-age-status\").html(userData.vek+checkStatus(userData.stav));\n\t$(\".profile-user-status\").html(userData.stav);\n\tif(userStatus){\n\t\t$(\".profile-user-bounty\").html(\"<p style='color: #938200;'>Bounty: \"+userData.vypsana_odmena+\" gold</p>\");\n\t}\n\telse{\n\t\t$(\".profile-user-bounty\").html(\"<p style='color: #938200;'>\" + 0 + \" gold</p>\");\n\t}\n}", "function displayNameUser(responseAsJson, div, authToken, apiUrl, content){\n\tconst username = document.createElement(\"h1\");\n\tusername.style.textAlign = \"center\"; //display username\n\tusername.textContent = \"@\" + responseAsJson.username;\n\tusername.className = \"listAll\"; //make username linkable to public profile\n\tusername.onclick = function(){let userPage = createUserPage(div,\n\t\t\t\t\t\t\t\t\t\t responseAsJson.username, authToken, apiUrl);\n\t\t\t\t\t\t\t\t\t\t openEdit(div, userPage)};\n\tcontent.appendChild(username);\n\tconst n = document.createElement(\"h2\"); //display name\n\tn.style.textAlign = \"center\";\n\tn.style.color = \"var(--reddit-blue)\";\n\tn.textContent = responseAsJson.name;\n\tcontent.appendChild(n);\n\treturn content;\n}", "function userNameText(userName, userCompany) {\n $(document).ready(function(){\n document.getElementById('user_name_text').innerHTML = `${userName} - ${userCompany}`;\n })\n }", "function setGreeting(){\n let username = localStorage.getItem(\"username\");\n\n if(username !== null){\n loggedIn.show();\n loggedIn.text(`Welcome, ${username}`);\n loginLink.hide();\n registerLink.hide();\n listAdsLink.show();\n createAdLink.show();\n logoutLink.show();\n\n }else{\n loggedIn.hide();\n loginLink.show();\n registerLink.show();\n listAdsLink.hide();\n createAdLink.hide();\n logoutLink.hide();\n }\n }", "function setCurrentUserInfo(){\n\t$(\"#current-user-picture\").attr(\"src\", currentUserPictureURL);\n\t$(\"#current-user-name\").text(currentUserFullName);\n\t$(\"#chat-current-user-div\").css(\"display\",\"block\");\n}", "function setNickNameUser(nickName){\n\tif (checkUsrSubscription()){\n\t\t$(\"#user-name\").html(nickName);\n\t\t$(\"#headBoxLogin .notlogged\").css(\"display\", \"none\");\n\t\t$(\"#headBoxLogin .logged\").css(\"display\", \"inline\");\n\t}\n}", "function setUserNameFromPopup(popup_userName){\n\tuserName = popup_userName;\n\tvar userDashboard = document.getElementById('userDashboard');\n\tif(userName != ''){\n\t\tuserDashboard.innerHTML = userName+' : RED';\n\t}\n\telse{\n\t\tuserDashboard.innerHTML = 'You : RED';\n\t}\n}", "function getUsername() {\n if (username === null) {\n console.log('no name');\n insertName(\"\");\n } else {\n console.log(username.value)\n insertName(username.value);\n }\n setTimeout( function() {\n wrapper.style.display = \"none\";\n body.style.backgroundColor = \"white\";\n list.style.display = \"block\";\n }, 500);\n}", "function current_user_name() {\n document.getElementById(\"current_user_name\").innerHTML = \"Current User: \" + localStorage.getItem(\"currentUser\");\n document.getElementById(\"footer_paragraph\").innerHTML = \"\";\n \n}", "function showLoginName(){\r\n\r\n\tif(typeof login_name != 'undefined')\r\n\t\t$(\"#loginName\").text(_user+': '+login_name);\r\n\telse\r\n\t\t$(\"#loginName\").text(_user+': '+'admin');\r\n\r\n}", "function sayGreeting() {\r\n let username = sessionStorage.getItem('username');\r\n if (username != undefined) {\r\n $('#loggedInUser').text(`Welcome ${username}!`);\r\n updateNavigation();\r\n }\r\n else\r\n {\r\n $('#viewHome').show();\r\n $('#linkLogin').show();\r\n $('#linkRegister').show(); \r\n $('#linkListBooks').hide();\r\n $('#linkCreateBook').hide();\r\n $('#linkLogout').hide();\r\n $('#loggedInUser').text('');\r\n showPage('viewHome');\r\n }\r\n }", "function setName(){\n $('#identity-frm').slideUp(200);\n $('#share-frm').slideDown(200);\n username = $('#username').val();\n $('#tracker_name').html(username + ' (you)');\n}", "function getName() {\n applicationState.user = userName.value;\n document.getElementById(\n \"userinfo\"\n ).innerHTML = `welcome ${applicationState.user}`;\n applicationState.gameStart = true;\n startTime = Date.now();\n}", "function getUserName() {\n\t$.ajax({\n\t\turl : 'rest/user/names',\n\t\ttype : \"GET\",\n\t\tdataType : \"text\"\n\t}).always(function(data) {\n\t\tif (typeof data != 'undefined') {\n\t\t\t$(\".welcome-greeting\").css(\"display\", \"inline\");\n\t\t\t$(\"#user-holder\").text(data);\n\t\t}\n\t});\n}", "function user_getAndDisplay() {\n communicator.getUsername().then((username) => {\n var lbUsername = document.getElementById('lbUsername')\n lbUsername.innerText = 'Hello ' + username\n }, () => {\n lbUsername.innerText = 'Error while displaying username'\n })\n}", "function setName(){\n\t//$('div#statBar label#fname').text('User: ' + userStats.fn.toString() );\n}", "function loggedinUser() {\n $(\".loggedin-user\").append(`Welcome ${STATE.authUser.name}!`);\n}", "renderUserLabel() {\n if(this.props.isLoggedIn) {\n return \"Welcome, \" + this.state.cUsername;\n }\n return \"Hello, Guest\";\n }", "function displayLoginInfo() {\n\t\tif (curAcct == \"\") {\n\t\t\tcurAcct = web3.eth.defaultAccount;\n\t\t}\n\t\n\t\tif (curAcct == \"0\") {\n\t\t\t$('#user .login .result').html('<b>Logged out</b>' +\n\t\t\t\t'<br />Enter Ethereum address to login');\n\t\t}\n\t\telse {\n\t\t\t$('#user .login .result').html('<b>Your account info</b> <br />' +\n\t\t\t\t'Currently logged in as: <code>' + curAcct + '</code>' +\n\t\t\t\t'<br />Account balance: ' + getEtherBalance(curAcct) + ' ETH' +\n\t\t\t\t'<br />Credit score: ');\n\t\t\tLoanDB.getCreditScore(curAcct, {from:curAcct}).then(function(score) { \n\t\t\t $('#user .login .result').append(score.toNumber());\n\t\t });\t\t\t\n\t\t}\n\t}", "updateUILogin(username) {\n $('.anon').hide()\n $('.auth').show()\n\n $('.my-games').show().attr('href', '#users/'+username+'/games')\n }", "function updateUserProfile() {\n // $('#profile-name)\n $(\"#show-name\").html(` ${currentUser.name}`);\n $(\"#show-username\").html(` ${currentUser.username}`);\n $(\"#show-date\").html(` ${currentUser.createdAt.slice(0, 10)}`);\n }", "function UserNameReplace() {\n if(typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName == null) return;\n $('.insertusername').html(wgUserName); }", "function show_name()\n{\n let showname = localStorage.getItem('username');\n if (!localStorage.getItem('username'))\n document.getElementById(\"displaynm\").innerHTML = \"Type in Your Display Name.\";\n else\n document.getElementById(\"displaynm\").innerHTML = \"Welcome, \" + showname;\n\n}", "function renderUserInfo(username) {\n $(\"#username\").text(username);\n $(\"#userWins\").text(usersRefSnap.child(username).val().wins);\n $(\"#userLosses\").text(usersRefSnap.child(username).val().losses);\n}", "function viewUsersession(a) {\n $(\"li.actparent\").toggleClass(\"actparent\");\n $(\".username.act\").toggleClass(\"act\");\n //name = $(\".username.act\").html()\n $(a).find(\".username\").toggleClass(\"act\");\n $(a).toggleClass(\"actparent\");\n name = $(\".username.act\").html();\n console.log(name);\n $(\".usrnam\").text(name);\n $(\"#userhistorypane\").css(\"opacity\", \"0\");\n dbOperations(\"sessions\", \"select_operation\", [\"users_session\", \"username\", String($(\".username.act\").html())]);\n check_for_active_row(\"username\", \"acc\");\n $(\"#userhistorypane\").animate({\n opacity: 1\n })\n}", "function grantUserAccess(username) {\n \n document.getElementById(\"greeting-name\").innerHTML = username; //rewrite greeting to 'Hello, <username>!'\n document.getElementById(\"greeting\").style = 'visibility: visible';\n \n enableCommentBox(); //for posting comments\n hideEnterButton(false); //for posting comments\n hideLogoutButton(false);\n hideLoginAndSignupButtons(true);\n hideUsersEditAndDoneEditButtons(false);\n\n}", "function showUser(id,name) {\n\tlight = new LightFace.IFrame({\n\t\theight:400,\n\t\twidth:500,\n\t\turl: 'show_user_float.php?u_id='+id,\n\t\ttitle: name\n\t\t}).addButton('Close', function() { light.close(); },true).open();\n\t}", "function showUser(id,name) {\n\tlight = new LightFace.IFrame({\n\t\theight:400,\n\t\twidth:500,\n\t\turl: 'show_user_float.php?u_id='+id,\n\t\ttitle: name\n\t\t}).addButton('Close', function() { light.close(); },true).open();\n\t}", "function displayUserData(flash) {\n if (user.displayName === null) {\n setTimeout(function() {\n $(\"#user-name\").text(user.displayName);\n }, 200);\n } else {\n $(\"#user-name\").text(user.displayName);\n }\n $(\"#user-rank\").text(flash.val().rank);\n $(\"#user-wins\").text(flash.val().wins);\n $(\"#user-losses\").text(flash.val().losses);\n $(\"#user-games-played\").text(flash.val().gamesPlayed);\n if (player === 1) {\n $(\"#player-name\").text(user.displayName);\n }\n if (player === 2) {\n $(\"#opponent-name\").text(user.displayName);\n }\n}", "function associateUsername(username) {\n USERNAME = username;\n addSystemMessage(textElement('Your username is:'), usernameElement(username));\n}", "function showChangeUsernameForm() {\n\tresetForm();\n\tdocument.getElementById(\"changeDetailsMessageBox\").style.color = \"white\";\n\tdocument.getElementById(\"changeDetailsMessageBox\").innerText = \"You are logged as \" + getUserFromJWT();\n\tdocument.getElementById(\"changeDetailsMessageBox\").style.display = \"block\";\n\tfor (let i = 0; i < document.getElementsByClassName(\"changeName\").length; i++) {\n\t\tdocument.getElementsByClassName(\"changeName\")[i].style.display = \"block\";\n\t}\n\tdocument.getElementById(\"changeUserDetailsBox\").style.display = \"block\";\n}", "function MUA_headertext(mode) {\n let header_text = (mode === \"update\") ? loc.User + \": \" + mod_MUA_dict.username : loc.Add_user;\n if(mod_MUA_dict.user_schoolbase_pk){ header_text = loc.Add_user_to + mod_MUA_dict.user_schoolname;}\n document.getElementById(\"id_MUA_header\").innerText = header_text;\n } // MUA_headertext", "function display_user() {\r\n show(user);\r\n hide(admin);\r\n}", "function showUserName() {\n\tvar div = document.getElementById(\"usernameDiv\");\n\tdiv.style.display=\"block\";\n\tdocument.getElementById(\"username\").focus();\n\tdocument.getElementById(\"username\").select();\n}", "function UserNameReplace() {\n if(typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName == null) return;\n $(\"span.insertusername\").text(wgUserName);\n }", "function functionsToExecuteIfUserIsLoggedIn(username) {\n setCurrentUser(username);\n showLoggedInUserInformation(username);\n unlockSubscriptionButtons();\n}", "function setUsername() {\n up.user = vw.getUsername();\n\n signallingConnection.sendToServer({\n user: up.user,\n date: Date.now(),\n id: up.clientID,\n type: \"username\",\n act: \"username\"\n });\n}", "function UserNameReplace() {\n if(typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName == null) return;\n $(\"span.insertusername\").html(wgUserName);\n }", "function setUsername(){\n currentUser = document.getElementById(\"username\").value;\n closeModal();\n setupSelf();\n}", "function updateDisplay() {\n UserService.getUserInfo().then(function(response) {\n displayLogs();\n })\n }", "function UserNameReplace() {\n if (typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName == null) return;\n $(\"span.insertusername\").text(wgUserName);\n}", "function detectLogin()\n {\n $.when(api.whoami()).done(function(user)\n {\n // update the UI to reflect the currently logged in user.\n topnav.update(user.firstName + ' ' + user.lastName);\n }).fail(function()\n {\n topnav.clear();\n });\n }", "function showProfile(profile, currentUser) {\n profile.children.item(0).innerHTML = currentUser.username;\n profile.children.item(1).innerHTML = currentUser.title;\n profile.children.item(2).innerHTML = currentUser.score;\n profile.children.item(1).style.color = '#e40046';\n profile.children.item(1).style.fontWeight = 'bold';\n profile.children.item(2).style.color = '#e40046';\n profile.children.item(2).style.fontWeight = 'bold';\n profile.children.item(3).innerHTML = currentUser.email;\n return;\n}", "function setUsername () {\n username = $usernameInput.val().trim();\n $(\"#username_field\").html(username);\n // If the username is valid\n if (username) {\n $loginPage.fadeOut();\n $chatPage.show();\n $loginPage.off('click');\n $currentInput = $inputMessage.focus();\n\n // Tell the server your username\n socket.emit('login', { uid: username });\n $('#view').attr('src', \"/\");\n }\n }", "function updateCurrentStatus(user) {\n $(\"#current-status\").empty().append(\n `<h4>` + user[\"family_name\"] + \", \" + user[\"given_name\"] + `</h4>\n <h4>UIN: ` + user[\"uin\"] + `</h4>\n <p>Current Entry Status = ` + user[\"status\"] + `</p>`\n ).show();\n}", "function showSelfInfo(selfInfo) {\n var state = \"\";\n\n // Set user name, image of this user..\n $('#selfinfo-name').text(selfInfo.username);\n $('#selfinfo-img').attr('src', selfInfo.img);\n\n if(selfInfo.id == \"BOT\") {\n // Set bot information..\n $('#selfinfo-mood').text(\"The bot of this chat!\");\n }\n else if(selfInfo.id == \"CONCIERGE\") {\n // Set bot information..\n $('#selfinfo-mood').text(\"Administrator of this chat!\");\n }\n else {\n // Set email of this user..\n $('#selfinfo-mood').text(selfInfo.email);\n }\n}", "function displayName(user) {\n const html = `<br><br>\n <h1>${user.first_name} ${user.last_name}</h1>\n `;\n const display = document.getElementById('display-name')\n display.innerHTML = html\n return html\n}", "function showuser() {\n var user = document.getElementById('userinfo');\n if (user.style.display === \"none\") {\n user.style.display = \"block\";\n } else {\n user.style.display = \"none\";\n }\n }", "function showuser() {\n var user = document.getElementById('userinfo');\n if (user.style.display === \"none\") {\n user.style.display = \"block\";\n } else {\n user.style.display = \"none\";\n }\n }", "function showUserName() {\r\n userName = document.getElementById(\"user-input\").value;\r\n\r\n // Proceeding only after receiving the name as an input from the user:\r\n if (document.getElementById(\"user-input\").value == \"\") {\r\n alert(\"Please enter your name to continue.\");\r\n return false;\r\n }\r\n document.getElementById(\"list-name\").innerHTML = `Hi ${userName}! Start adding your items in the box below and create your list now!`;\r\n document.getElementById(\"head\").innerHTML = `${userName}'s todo list!`\r\n\r\n // Emptying the box to get a new name:\r\n document.getElementById(\"user-input\").value = \"\";\r\n\r\n}", "function setUserName() {\n\n // Update on input\n $userName.change(function() {\n $welcomeText.html('Hello ' + $userName.val() + '!');\n console.log($welcomeText.html());\n\n // Reveal next profile question\n setTimeout(function() {\n $userProfile.filter('h3').filter(':nth-child(3)').fadeIn();\n $datePicker.fadeIn();\n },500);\n\n });\n\n}", "function snagUserInfo(credential) {\n document.getElementById(\"sign-in\").innerHTML =\n '<span class=\"phone-hide\">' + credential.userId + \"</span>\";\n }", "function setLoggedUserName() {\n\t\t// Get hold of link of inbox\n\t\tvar bannerDiv = getElementByClass(getElementsByName(document,'div'),'banner');\n\t\tvar navGroup = getElementByClass(getElementsByName(bannerDiv,'ul'),'nav');\n\t\tvar navList = getElementsByName(navGroup,'li');\n\t\tfor(var linkIndx=0; linkIndx < navList.length; ++linkIndx) {\n\t\t\tvar anchor = getElementsByName(navList[linkIndx],'a')[0];\n\t\t\tif(anchor.href.indexOf(\"/inbox\") != -1) {\n\t\t\t\tvar anchorHrefSplit = anchor.href.split('/');\n\t\t\t\tloggedUserName = anchorHrefSplit[anchorHrefSplit.length-1];\n\t\t\t\treturn;\n\t\t\t}\n\t\t} \t\t\n\t}", "function getCurrentUserData(username) {\n $.get(\"/spotAFriends/users/\" + username, function(data) {\n if (data) {\n $(\"#currentUser\").text(\"@\" + data[0].username);\n $(\"#currentUserInfo\").text(data[0].bio);\n }\n });\n }", "function getDisplayTextOfUser() {\n if (_userInformation.DisplayName != null) {\n return _userInformation.DisplayName;\n }\n return _userInformation.UserName;\n }", "function renderUserDiv() {\n return (\n <p>Check out this cool site, {currentUser.first_name}!</p>\n )\n }", "function showUserInformation(user){\n setSideBar(user)\n setLists(user)\n}", "function setPageTitle(nickName, viewingSelf) {\n if (viewingSelf == true){\n document.getElementById('page-title').innerText = 'Welcome home! ' + nickName.replace(/(\\n|\\r|\\r\\n)/g, '') + ' ^_^';\n }\n else{\n if (nickName == ''){\n document.getElementById('page-title').innerText = 'Hello! My owner hasn\\'t set my name yet! Please remind him/her to give me a name ^_^';\n }\n else{\n document.getElementById('page-title').innerText = 'Helloooo! This is ' + nickName.replace(/(\\n|\\r|\\r\\n)/g, '') + \". Welcome to my page ^_^\";\n }\n }\n document.title = parameterUsername + ' - User Page';\n}", "function view_user(username) {\r\n\t// Close userlist dialog pop-up, if opened\r\n\t$('#userList').dialog('destroy');\r\n\t\r\n\tif (username.length < 1) return;\r\n\t$('#view_user_progress').css({'visibility':'visible'});\r\n\t$('#user_search_btn').prop('disabled',true);\r\n\t$('#user_search').prop('disabled',true);\r\n\t$.get(app_path_webroot+'ControlCenter/user_controls_ajax.php', { user_view: 'view_user', view: 'user_controls', username: username },\r\n\t\tfunction(data) {\r\n\t\t\t$('#view_user_div').html(data);\r\n\t\t\thighlightTable('indv_user_info',1000);\r\n\t\t\tenableUserSearch();\r\n\t\t}\r\n\t);\r\n}", "function updateUsername() {\n\t\tif(this.usernameText.textContent !== username)\n\t\t\trequestUsername(this.usernameText.textContent);\n\t}", "function sayHello() {\n firebase.auth().onAuthStateChanged(function (user) {\n if (user) {\n // User is signed in.\n // Change Login in the navbar to the user name. \n console.log(user.uid);\n db.collection(\"users\").doc(user.uid)\n .get()\n .then(function (doc) {\n var n = doc.data().name;\n console.log(n);\n document.getElementById(\"username\").innerText = n;\n })\n } else {\n // No user is signed in.\n }\n });\n }", "function updateUserInterface(){\n\n\t$(\"#loginForm\").hide();\n\t$(\"#username\").text(user.alias);\n\t$(\"#userDetails\").show();\n}", "function updateUserView(user) {\n console.log(`updating view with user ${user ? user.displayName : ''}`);\n $(\".username\").html(user ? user.displayName : \"anonymous\");\n $(\".userpic\").attr(\"src\", user ? user.photoURL : \"//placehold.it/30x30\");\n}", "function set_user_name(new_name){\n //TODO Validate User String\n current_user_name = new_name\n nameSpace.innerHTML=(\"User: \" + current_user_name)\n \n}", "function changeUserText(userName) {\n document.getElementById('intro').id = \"hide\";\n document.getElementsByTagName('form')[0].className = \"hide\";\n var textNode = document.createTextNode(userName + \", click on the image you like best.\");\n document.getElementById('username').appendChild(textNode);\n}", "function displayLogIn(username) {\n\tif (window.location.pathname == \"/\") {\n\t\t$(\"main\").load(\"modules/tipping.html\", function() {\n\t\t $.getScript(\"scripts/index.js\");\n\t\t\tprocessURL();\n\t\t});\n\t} else if (window.location.pathname == \"/leagues\") {\n\t\t$(\"main\").load(\"modules/leagues.html\", function() {\n\t\t $.getScript(\"scripts/leagues.js\");\n\t\t\tprocessURL();\n\t\t});\n\t} else if (window.location.pathname == \"/profile\") {\n\t\tconsole.log(window.location.pathname);\n\t\t$(\"main\").load(\"modules/profile.html\", function() {\n\t\t\t$.getScript(\"scripts/profile.js\");\n\t\t\tprocessURL();\n\t\t});\n\t} else if (window.location.pathname ==\"/password-reset\") {\n\t\tcommitLogOff();\n\t}\n\t$(\".username-container span span:nth-child(1)\").html(\"<b>\" + username + \"</b>\");\n\t$(\"nav ul li:nth-child(1)\").show().html(\"<a href='javascript:fullLogOff();'>Log off</a>\");\n\t$(\"nav ul li:nth-child(2) a:not(.selected)\").attr(\"href\", \"/\");\n\t$(\"nav ul li:nth-child(3) a:not(.selected)\").attr(\"href\", \"/leagues\");\n\t$(\"nav ul li:nth-child(4) a:not(.selected)\").attr(\"href\", \"/profile\");\n\t$(\".offline input:not([type='submit'])\").each(function() {\n\t\t$(this).val(\"\");\n\t});\n}", "function ShowName(){\r\n SaveName.hide();\r\n displayName.html(\"HELLO \"+NameBar.value())\r\n displayName.position(100,height/2-190);\r\n displayName.style('color',col)\r\n displayName.style('color', 'white');\r\n displayName.style('font-size', '100px');\r\n NameBar.hide();\r\n StartButton.show();\r\n title.hide();\r\n InfoButton.show();\r\n gameState = \"NAMEHIDE\"\r\n\r\n}", "get username() { // get uinique username. In your api use ${utils.username}\n return new Date().getTime().toString();\n }", "update() {\n this.nameText.text = 'Submit Name to Leaderboard:\\n ' + this.userName + '\\n(Submits on New Game)';\n\n }", "function displayMainPage() {\n const userNameInput = getUserInputID()\n if (!userNameInput) {\n _domUpdates_js__WEBPACK_IMPORTED_MODULE_4__.default.renderLoginFailedMsg()\n } else {\n getFetchedData(userNameInput)\n getTrips(userNameInput, tripsData, date)\n verifyLoginInput(userNameInput)\n }\n}", "function setWelcomeMsg(userObject) {\n if (userObject.displayName) {\n welcomeMsg.innerHTML = \"Welcome \" + userObject.displayName + \"!\";\n }\n else if (userObject.username) {\n welcomeMsg.innerHTML = \"Welcome \" + userObject.username + \"!\";\n }\n else {\n welcomeMsg.innerHTML = \"Welcome guest!\";\n }\n }", "function usernameClick() {\n history.pushState(null, null, '/Name/');\n document.getElementById(\"title\").innerHTML = \"Username ändern\";\n document.getElementById(\"startseite\").innerHTML = \"\";\n document.getElementById(\"startseite\").style.visibility = \"hidden\";\n document.getElementById(\"changepic\").style.visibility = \"hidden\";\n document.getElementById(\"plus\").style.visibility = \"hidden\";\n document.getElementById(\"addReise\").style.visibility = \"hidden\";\n document.getElementById(\"showReise\").style.visibility = \"hidden\";\n document.getElementById(\"navlinks\").style.visibility = \"hidden\";\n document.getElementById(\"navrechts\").style.visibility = \"hidden\";\n document.getElementById(\"changename\").style.visibility = \"visible\"; //Seite zum Name ändern wird angezeigt\n\n document.getElementById(\"startseite\").style.display = \"none\";\n document.getElementById(\"changepic\").style.display = \"none\";\n document.getElementById(\"showReise\").style.display = \"none\";\n document.getElementById(\"addReise\").style.display = \"none\";\n document.getElementById(\"changename\").style.display = \"block\";\n\n sessionStorage.removeItem(\"activeReise\");\n}", "function _displayLoggedInUI() {\n $('.logged-in').show();\n $('.logged-out').hide();\n\n $(\"#startup\").hide();\n $('#chat').show();\n}", "function showPerson() {\n $('body').find('.name').text(\"Name: \" + muArray[number].name);\n $('body').find('.git').text(\"github: \" + muArray[number].git_username);\n $('body').find('.shoutout').text(\"Shoutout: \" + muArray[number].shoutout);\n }", "function displayHeadUser() {\n const welcomeMsg = document.createElement(\"h2\");\n welcomeMsg.id = \"welcome-message\"\n welcomeMsg.textContent = \"Welcome back, \" + localStorage.username + \"!\";\n head.append(welcomeMsg);\n\n const logoutBtn = document.createElement(\"button\");\n logoutBtn.id = \"logout-btn\";\n logoutBtn.textContent = \"Log out\";\n logoutBtn.addEventListener(\"click\", logout)\n head.append(logoutBtn);\n}", "function activeUser(user) {\n\tViewHeader.activeUser(user);\n}" ]
[ "0.7615899", "0.75988203", "0.74327683", "0.74327683", "0.74327683", "0.74327683", "0.72426176", "0.7141142", "0.7066686", "0.70350623", "0.7016093", "0.69467944", "0.69455683", "0.6917003", "0.68814", "0.687251", "0.6860499", "0.68435514", "0.6815681", "0.6809622", "0.68019915", "0.68019336", "0.6746919", "0.6710524", "0.6707186", "0.67068946", "0.66992325", "0.6685137", "0.6674302", "0.66731524", "0.66632223", "0.66616064", "0.66606456", "0.66479534", "0.66290253", "0.6628448", "0.6623684", "0.6620416", "0.66191834", "0.66173345", "0.6607767", "0.65894467", "0.6565649", "0.65621036", "0.65529674", "0.65478826", "0.65443414", "0.6505375", "0.6501128", "0.64925015", "0.64855945", "0.64855945", "0.6482574", "0.64776605", "0.6461304", "0.64603496", "0.64580977", "0.6445003", "0.6443863", "0.6431319", "0.6409228", "0.64090043", "0.64081", "0.6399271", "0.63958746", "0.63946366", "0.638509", "0.6379642", "0.6368228", "0.6365447", "0.636463", "0.6356374", "0.6356374", "0.63180065", "0.6317626", "0.63117003", "0.6308373", "0.6302289", "0.6289561", "0.6285785", "0.62799174", "0.626081", "0.62500006", "0.6227022", "0.6226793", "0.6223791", "0.62114525", "0.6204243", "0.62028766", "0.61946034", "0.6190669", "0.6187777", "0.61840385", "0.61774224", "0.6175015", "0.61558485", "0.61541337", "0.6150092", "0.61480963", "0.61398417" ]
0.75920707
2
called immediately after login
function postLogin() { displayCurrentUser(global_username); $(".prelogin-content, #landingpagebutton, .login-hide").fadeOut( function() { $(".postlogin-content").fadeIn(); $(".login-show").fadeIn().css("display","inline"); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loginCompleted() {\n }", "function login() {\n self.isLoggedIn = true;\n }", "function loginUserCallback() {\n loginUser();\n }", "function onLogin() {}", "function handleLoginOnStartUp() {\n //if user is signed in, show their profile info\n if (blockstack.isUserSignedIn()) {\n var user = blockstack.loadUserData().profile\n //blockstack.loadUserData(function(userData) {\n // showProfile(userData.profile)\n //})\n }\n //signin pending, \n else if (blockstack.isSignInPending()) {\n blockstack.handlePendingSignIn.then((userData) => {window.location = window.location.origin})\n }\n\n}", "function authLoginSuccess(e) {\n\t\tif (e.origin !== global.bom.settings.url)\n\t\t\treturn;\n\t\tsetAuthCookie(e.data);\n\t\tlocation.reload(true);\n\t}", "function login() {\n User.login(self.user, handleLogin);\n }", "function authLogin() {\n\t\tpopup(tools.urlLogin, 'BOM - Login', 302, 320);\n\t\teventer(messageEvent, authLoginSuccess, false);\n\t}", "login() {\n if (!this.API)\n return;\n this.API.redirectAuth();\n }", "function login() {\n // We give username and password to log the user in\n // In case there is something wrong with the credentials\n // we use the setError to display it\n // If the user logs in successfully then the loginCallback is called.\n setLoading(true);\n databaseLogin(username, password, loginCallback, showError);\n }", "function login() {}", "handleLogin() {\n this.authenticate();\n }", "function login () {\n vm.isloading= true;\n authUser.loginApi(vm.credential);\n }", "function loginAfterRegister()\n {\n UserService.login($scope.user)\n .then(function(response) {\n if (response.status === 200) {\n //Should return a token\n $window.localStorage[\"userID\"] = response.data.userId;\n $window.localStorage['token'] = response.data.id;\n $ionicHistory.nextViewOptions({\n historyRoot: true,\n disableBack: true\n });\n $state.go('lobby');\n } else {\n // invalid response\n $state.go('landing');\n }\n resetFields();\n }, function(response) {\n // something went wrong\n $state.go('landing');\n resetFields();\n });\n }", "async login() {\n await auth0.loginWithPopup();\n this.user = await auth0.getUser();\n if(this.user) _isLoggedIn = true;\n }", "function proceed () {\n\t\t\tif (!store.getters.getBearerToken) {\n\t\t\t\tnext ();\n\t\t\t} else {\n\t\t\t\tconsole.log('Already logged in');\n\t\t\t} \n\t\t}", "function detectLogin()\n {\n $.when(api.whoami()).done(function(user)\n {\n // update the UI to reflect the currently logged in user.\n topnav.update(user.firstName + ' ' + user.lastName);\n }).fail(function()\n {\n topnav.clear();\n });\n }", "login() {\n let that = this;\n if (!this.user) {\n this.clear();\n loadTemplate('templates/login.html',function(responseText) {\n hideMenu();\n $('#content').html(eval('`' + responseText + '`'));\n $('#loginAlert').hide();\n let loginForm = $('#loginForm');\n\n loginForm.submit(function(event) {\n event.preventDefault();\n deleteCookie('connect.sid');\n let username = $('input[name=username]').val();\n let password = $('input[name=password]').val();\n loadTemplate('api/login',function(userData) {\n that.user = JSON.parse(userData);\n /* First time we log in */\n if (that.user.defaultSubject === 'default') {\n console.log(\"addSubject in login\");\n addSubject(updateFromServer);\n //updateFromServer();\n /* We are veteran/recurrent users */\n }else {\n setCookie('user',userData,7);\n updateFromServer();\n }\n },'POST','username=' + username + '&password=' + password,false);\n return false; //Avoid form submit\n });\n });\n }else {\n generateMenu();\n that.getTemplateRanking();\n }\n }", "ready(){super.ready();this.addEventListener(\"ajax-response\",e=>this._loginStatus(e))}", "function localLogin() {\n Message.loading();\n User.login({}, LoginModel.form).$promise\n .then(function(userWrapper) {\n Message.hide();\n console.log(\"---------- userWrapper ----------\");\n console.log(userWrapper);\n AppStorage.user = userWrapper.user;\n AppStorage.token = userWrapper.token;\n AppStorage.isFirstTime = false;\n U.goToState('Main.MainTab.PostList.PostListRecent', null, 'forward');\n })\n .catch(function(err) {\n console.log(\"---------- err ----------\");\n console.log(err);\n if (err.status === 403) {\n return Message.alert('로그인 알림', '비밀번호/이메일이 틀렸습니다. 다시 입력해주세요');\n } else {\n return Message.alert();\n }\n });\n }", "function autoLoginAfterRefresh() {\n\t\tif(g_UserName) {\n\t\t\tconst username = localStorage.getItem(g_UserName +'.username'); // get it from cookie\n\t\t\tconst password = localStorage.getItem(g_UserName +'.password'); // get it from cookie\n\t\t\tif(username && username) login(username, password);\n\t\t}\n\t}", "loginStart() {\n\n }", "function handleLogin() {\r\n if ((!assetEmpty(email) && !assetEmpty(password))\r\n && assertEquals(email, registeredState.email)\r\n && assertEquals(password, registeredState.password)\r\n ) {\r\n setPassword('');\r\n global.nameLogin = registeredState.name;\r\n navigation.replace('BottomStack');\r\n } else {\r\n Alert.alert(\r\n 'Não foi possível entrar:',\r\n 'E-mail/senha incorretos!'\r\n );\r\n }\r\n }", "function processSuccessLogin(result) {\n // Success Login save the id and the loginId to the footer\n // Can't save to session or anything here\n $($pt.landPage.session.id).text(result[0].id);\n $($pt.landPage.session.user).text(result[0].loginId);\n $($pt.landPage.session.email).text(result[0].email);\n\n // Notifications\n if (result[0].notify !== 0) {\n $($pt.landPage.session.notify).attr(\"data-badge\", result[0].notify);\n $(document).attr(\"title\", \"* PhotoThief\");\n $(\"#favicon\").attr(\"href\", \"favicon2.ico\");\n }\n\n // Hide slogan\n $($pt.landPage.section.slogan).addClass(\"hidden\").removeClass(\"show\");\n // Hide signup button\n $($pt.landPage.action.signup).addClass(\"hidden\").removeClass(\"show\");\n // Show demand button\n $($pt.landPage.action.demand).addClass(\"show\").removeClass(\"hidden\");\n // Show upload button\n $($pt.landPage.action.upload).addClass(\"show\").removeClass(\"hidden\");\n // Show user info\n $($pt.landPage.session.info).addClass(\"show\").removeClass(\"hidden\");\n\n // Toggle the login Button to say logout\n $($pt.landPage.action.icon).text(\"exit_to_app\");\n $($pt.landPage.action.text).text(\"Logout\");\n $($pt.landPage.action.login).addClass(($pt.landPage.action.logout).substr(1));\n $($pt.landPage.action.login).removeClass(($pt.landPage.action.login).substr(1));\n\n // Confirm leaving webapp\n window.onbeforeunload = function() {\n return \"\";\n };\n\n // Reload the main page with carousel with user specific data ???\n //initialize();\n }", "function login_account () {\n\tdb_account_exists().then(function() {\n\t\tvar date;\n\t\tdate = new Date();\n\t\tdate = date.getUTCFullYear() + '-' +\n\t\t\t\t\t ('00' + (date.getUTCMonth() + 1)).slice(-2) + '-' +\n\t\t\t\t\t ('00' + date.getUTCDate()).slice(-2) + ' ' +\n\t\t\t\t\t ('00' + date.getUTCHours()).slice(-2) + ':' +\n\t\t\t\t\t ('00' + date.getUTCMinutes()).slice(-2) + ':' +\n\t\t\t\t\t ('00' + date.getUTCSeconds()).slice(-2);\n\t\tlet inputs = {\n\t\t\t\t\tusername: $(\"#loginuser\").val(),\n\t\t\t\t\tdate: date\n\t\t\t\t\t};\n\t\tlet params = {\n\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\turl: \"/api/user/lastlogin\",\n\t\t\t\t\tdata: inputs\n\t\t\t\t\t};\n\t\t$.ajax(params).done(function(data) {\n\t\t\t\tdocument.getElementById(\"greetings\").innerHTML = \"Welcome back \"+localStorage.getItem('username')+\"!\";\n\t\t\t\tset_local($(\"#loginuser\").val());\n\t\t\t\tset_update();\n\t\t\t\tyour_stats($(\"#loginuser\").val());\n\t\t\t\tcurrent_stage=\"stage\";\n\t\t\t\tswitch_stage();\n\t\t\t});\n\t\t}).catch(function (err) {\n\t\t\tconsole.log(err);\n\t\t});\n}", "function handleClientLoad() {\n\t\t console.log(\"handle login\") \n gapi.client.setApiKey(apiKey);\n window.setTimeout(checkAuth,1);\n }", "function loginComplete() \r\n {\r\n\t\t\t\t//alert('loginComplete: ' + FB.Facebook.apiClient._session);\r\n\t\t\t\t\r\n\t\t\t\tvar session = FB.Facebook.apiClient._session;\r\n\t\t\t\t\r\n\t\t\t\tvar parameters = {\r\n\t\t\t\t\tapiKey: API_KEY,\r\n\t\t\t\t\texpires: session.expires,\r\n\t\t\t\t\tsecret: session.secret,\r\n\t\t\t\t\tsessionKey: session.session_key,\r\n\t\t\t\t\tsig: session.sig,\r\n\t\t\t\t\tuid: session.uid\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\tswfDispatcher( 'loginComplete', parameters );\r\n }", "function authenticate() {\n success.value = true;\n fail.value = false; \n setTimeout(setLoggedIn, 100);\n}", "function init() {\t \n\t notify = new Notify(Play.getId('altLogin'));\n\t\tform = new FormOk(frmLogin);\n\t\tif(sessionStorage.length > 0){\t\t\t\n\t\t\tvar message = sessionStorage.getItem(Constants.SESSIONSTORAGE_MESSAGE);\n\t\t\tsessionStorage.clear();\t\t\t\n\t\t\tif( message === null){\n\t\t\t\tnotify.close();\t\t\t\t\n\t\t\t}else {\n\t\t\t\tnotify.success(message);\t\t\t\t\n\t\t\t}\t\t\t\t\n\t\t} else {\t\n\t\t\tnotify.close();\n\t\t}\n\t\tformLoginAction();\t\n\t}", "async handleLogin () {\n\t\tconst { email, password, teamId } = this.request.body;\n\t\tthis.user = await new LoginCore({\n\t\t\trequest: this\n\t\t}).login(email, password, teamId);\n\t}", "_eventLogin() {\n console.info('Successfully logged in! Initializing wiki listeners...');\n this._readLine();\n }", "function login() {\n if (ctrl.remember) {\n $window.localStorage.setItem('ldap_username', ctrl.username);\n $window.localStorage.setItem('ldap_password', ctrl.password);\n }\n ctrl.loading = true;\n ipcRenderer.send('do-log-in', ctrl.username, ctrl.password);\n }", "async login() {}", "function loginn(){\n // localStorage.setItem('user-pizza', 'Paul');\n setLog(!log)\n }", "function cmisLoginOk() {\n login.loginOk(initializeCmisApp);\n}", "login(cb) {\n this.authenticated = true;\n cb();\n }", "checkLoggedIn() {\n this.isLoggedIn(null);\n }", "authCallback() {\n console.log('authCallback');\n /* this.renderLoginButton().then(() => {\n console.log('redirect to the landing page');\n }).catch(() => {\n console.log('start yolo');\n this.initYolo();\n });*/\n }", "function callback() {\n deleteUsuarioLogado();\n onChangeView(VIEW_LOGIN_KEY);\n }", "function registerSuccessFn() {\n\t\t\t\t\tAuthentication.login($scope.username, $scope.password)\n\t\t\t\t\t\t.then(function (response) {\n\t\t\t\t\t\t\tAuthentication.setAuthenticatedAccount(response.data);\n\t\t\t\t\t\t\twindow.location = '/#/users/' + response.data.username;\n\t\t\t\t\t\t\twindow.location.reload();\n\t\t\t\t\t\t});\n\t\t\t\t}", "function loginClick() {\n\t username = $(\"#userName\").val();\n\t password = $(\"#password\").val();\n\t getRememberMestatus();\n\t var params = {\"username\":username,\"password\":password};\n\t var callerId = \"login\";\n\t var url = \"/logon\";\n\t reqManager.sendPost(callerId, url, params, loginSuccessHandler, loginErrorHandler, null);\n\t}", "function login() {\n\n // User has not compeleted the tutorial\n if (!eCon.local.firstRun) {\n eCon.Container.pagecontainer('change', 'help.html');\n return;\n }\n\n /**\n * Variable tracking whether the user needs to log in\n * @type {boolean}\n */\n var login = true;\n\n\n if (eCon.local.ID) { // Previously logged into a conference\n if (moment(eCon.local.EXP).isAfter(moment())) { // Conference expiration is after now\n login = false;\n } else {\n eCon.local.ID = null;\n eCon.local.EXP = null;\n eCon.local.Profile = null;\n deleteData();\n }\n }\n\n if (!login) {\n $('body').pagecontainer('change', 'conference.html', {});\n } else {\n $('body').pagecontainer('change', 'login.html', {changeHash: 'false'});\n }\n}", "login() {\r\n this.authenticated = true;\r\n localStorage.setItem(\"islogedin\", true);\r\n }", "function login()\r\n\t\t\t{\r\n\t\t\t\t//alert('login');\r\n\t\t\t\tFB.Connect.requireSession( loginComplete, loginCancelled );\r\n\t\t\t}", "onLoginSuccess() {\n\t\tApp.navigatePrevious();\n\t}", "function proceed () {\n\t\t\t/*\n\t\t\t\tIf the user has been loaded determine where we should\n\t\t\t\tsend the user.\n\t\t\t*/\n\t\t\tif (store.getters.getBearerToken) {\n\t\t\t\tnext();\n\t\t\t} else {\n\t\t\t\t//user is not logged in\n\t\t\t\tconsole.log('you are not logged in');\n\t\t\t}\n\t\t}", "async function handleRedirectAfterLogin() {\n//??-- var ses = await solidClientAuthentication.handleIncomingRedirect({restorePreviousSession: true});\n await solidClientAuthentication.handleIncomingRedirect();\n\n const session = solidClientAuthentication.getDefaultSession();\n console.log('handleRedirectAfterLogin(): session:', session);\n console.log('handleRedirectAfterLogin(): session.info.isLoggedIn: ', session.info.isLoggedIn);\n if (session.info.isLoggedIn) {\n console.log('handleRedirectAfterLogin(): session.info.webId: ', session.info.webId);\n // Update the page with the login status.\n gAppState.updateLoginState();\n }\n}", "function afterLoginAttemp(item) {\n\tvar ok = false;\n\n\tif (item.result != 'OK') {\n\t\talert(\"Failed to login as: \" + login.value + \", reason: \"\n\t\t\t\t+ item.message);\n\t} else {\n\t\tok = true;\n\t\tloggedInUser = item.login.replace(/['\"]+/g, '');\n\t\tstatusLogin.innerHTML = \"Logged: \" + loggedInUser;\n\t\tbtnCreateRoom.disabled = false;\n\t}\n\n\tloginPanel.style.visibility = 'hidden';\n\tglassPanel.style.visibility = 'hidden';\n\n\t/* get user location */\n\tif (ok && navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(saveGeoPosition);\n\t} else {\n\t\tconsole.log(\"unable get location!\");\n\t}\n\n}", "function proceed() {\r\n $scope.status = ''\r\n $scope.logo.class = 'animated zoomOutDown'\r\n AppService.getMutualMatches() // load in the background\r\n // disable the back button\r\n $ionicHistory.nextViewOptions({\r\n historyRoot: true,\r\n disableBack: true\r\n })\r\n\r\n // the timeout is to give the drop CSS animation time\r\n $timeout(() => AppService.goToNextLoginState(), 1000)\r\n\r\n var profile = AppService.getProfile();\r\n var user = {\r\n userId: profile.uid,\r\n name: profile.name,\r\n custom_attributes: {\r\n Name: profile.name,\r\n user_id: profile.uid\r\n }\r\n };\r\n\r\n intercom.updateUser(user, function() {\r\n intercom.displayMessenger();\r\n });\r\n }", "function initAuth() {\n // Check initial connection status.\n if (localStorage.token) {\n processAuth();\n }\n if (!localStorage.token && localStorage.user) {\n // something's off, make sure user is properly logged out\n GraphHelper.logout();\n }\n }", "function checkLastLogin() {\n\n }", "setupAuthentication(loginSuccess) {\n this.lock.on(\"authenticated\", authResult => {\n this.postLogin(authResult, loginSuccess);\n });\n }", "onlog() {}", "async function handlerLogin() {\n // alert('Entrando');\n MyContext.setTokenUser('aasdasd7as89d7as98d7a89sd7a9s8d7')\n navigation.navigate('logged')\n }", "function loadLogin() {\n console.log(\"User is now logged out.\");\n}", "function dummyLogin() {\n// loginAs( dummyFilters );\n loginAs(memberSearchFilters);\n }", "function handleSimpleLogin () {\n $scope.setFormStatus('simpleLogin');\n }", "handleLogin() {\n notification.success({\n message: 'Abrkadabra - Dokumentų valdymo sistema - 2019',\n description: \"Prisijungimas sėkmingas.\",\n });\n this.loadCurrentUser();\n this.props.history.push(\"/pagrindinis\");\n }", "function forceNewLogin() {\n window.location.href = getWebServerRelativeUrl() + '_layouts/closeConnection.aspx?loginasanotheruser=true';\n }", "_successfulLogin (data, status, xhr) {\n console.log('_successfulLogin', this)\n this.set('loggedIn', true)\n console.log(data)\n }", "function init() {\n debugger;\n $scope.GetUserInformation = SessionManagement.Get(\"UserInfo\");\n userInformation = SessionManagement.Get(\"UserInfo\");\n if ($scope.GetUserInformation == null || $scope.GetUserInformation.Role < 2)\n CommonMethod.LogOut();\n SessionManagement.Set(\"EntryManagementUserId\", 0);\n }", "Start(){\n // si non securisee on enregistre un token anonyme\n if(this._AppIsSecured == \"false\"){localStorage.setItem(this._DbKeyLogin, \"Anonyme\")}\n // Get Token\n this._LoginToken = this.GetTokenLogin() \n if(this._LoginToken != null){\n this.LoadApp()\n } else {\n const OptionCoreXLogin = {Site:this._Site, CallBackLogedIn:this.LoginDone.bind(this), Color: this._Color, AllowSignUp: this._AllowSignUp}\n let MyLogin = new CoreXLogin(OptionCoreXLogin) // afficher le UI de login\n MyLogin.Render()\n }\n }", "function login() {\n function newLoginHappened(user) {\n // User is signed in\n if (user) {\n // Check for new User\n if (app.userIsNew(user.uid)) {\n app.addUserToDatabase(user);\n } else {\n app.currentUser = user.uid;\n }\n // If no signed in user authenticate\n } else {\n var provider = new firebase.auth.GoogleAuthProvider();\n firebase.auth().signInWithRedirect(provider);\n }\n }\n firebase.auth().onAuthStateChanged(newLoginHappened);\n}", "async completeLogin(startup) {\n let loggedIn = this.accessToken && this.accountId;\n this.appObject.loggedIn = loggedIn;\n\n if (!this.accessToken || this.accountId) {\n return; // EARLY RETURN -- either we're not logged in, or we're completely logged in\n }\n\n // We have an access token and need the user info: fetch the user info\n if (process.env.OVERRIDE_ACCOUNT_ID === '0') {\n // The normal case\n await this.setDefaultAccount(startup)\n } else {\n if (startup) {this.appObject.telemetry.start()}\n this.name = process.env.OVERRIDE_NAME;\n this.email = process.env.OVERRIDE_EMAIL;\n this.accountId = process.env.OVERRIDE_ACCOUNT_ID;\n this.accountName = process.env.OVERRIDE_ACCOUNT_NAME;\n this.baseUri = process.env.OVERRIDE_BASE_URL \n }\n \n if (this.accountId) {\n // accountId and other settings were fetched\n this.appObject.loggedIn = true;\n } \n }", "function login() {\n function newLoginHappened() {\n if (user) {\n app(user);\n } else {\n var provider = new firebase.auth.GoogleAuthProvider();\n firebase.auth().sighnInWithRedirect(provider);\n }\n }\n\n firebase.auth().onAuthStateChanged(newLoginHappened);\n}", "function login() {\n Auth.login(authCtrl.user).then(function(){\n $state.go('home');\n });\n }", "function onLoadCB() { \n checkAuth(true); \n }", "function updateUIOnUserLogin() {\n console.debug(\"updateUIOnUserLogin\");\n\n putStoriesOnPage(); \n\n // $allStoriesList.show();\n\n updateNavOnLogin();\n}", "submitLogin() {\n if (!login(this.state.values.get('username'), this.state.values.get('password')))\n window.location = '#login-failed';\n }", "function loginCompleted(data) {\n if (data.token) {\n $state.go('main');\n } else { window.alert('Invalid Credentials'); }\n }", "checkLoggedInStatus() {\n this.bitski.getUser().then(user => {\n this.toggleLoading(false);\n this.validateUser(user);\n }).catch(error => {\n this.toggleLoading(false);\n this.setError(error);\n showLoginButton();\n });\n }", "function proceed() {\n\t\t/*\n\t\t\tIf the user has been loaded determine where we should\n\t\t\tsend the user.\n\t\t*/\n if (store.getters.getUserLoadStatus == 2) {\n next();\n } else if (store.getters.getUserLoadStatus == 3) {\n //user is not logged in\n console.log('you are not logged in');\n }\n }", "function switchToLogin(){\n\t\tturnService.closeWaitingAlert();\n\t\t$userLoginArea.show();\t\t\n\t\t$pageWrapper.hide();\n\t}", "async handleLogin(event) {\n try {\n\n //prevent actual submit and page refresh\n event.preventDefault();\n\n const userRepository = new UserRepository();\n\n\n //Find the username and password\n const username = $(this).find(\"[name='login-username']\").val();\n const password = $(this).find(\"[name='login-password']\").val();\n\n // Check if value exists\n if (!username || !password) {\n notificationManager.alert(\"warning\", \"Vul alle velden in!\");\n return false;\n }\n\n\n if (password.length < 6) {\n notificationManager.alert(\"warning\", \"Wachtwoord is te kort!\");\n return false;\n }\n\n //await keyword 'stops' code until data is returned - can only be used in async function\n const user = await userRepository.login(username, password);\n\n sessionManager.set(\"userID\", user.userID);\n notificationManager.alert(\"success\", \"U wordt ingelogd!\");\n location.reload();\n } catch (e) {\n console.log(e);\n notificationManager.alert(\"error\", \"Account bestaat niet\");\n }\n }", "async function handleRedirectAfterLogin() {\n\t await handleIncomingRedirect();\n\n\t session = getDefaultSession();\n\n\t if (session.info.isLoggedIn) {\n\t // Update the page with the status.\n\t await setLoggedIn(true);\n\t await setWebId(session.info.webId);\n\t let newPodUrl = getPODUrlFromWebId(session.info.webId);\n\t await setPodUrl(newPodUrl);\n\t }\n\t}", "successfulLogin(user, authHead) { //\n this.setupAxiosInterceptors(authHead)\n sessionStorage.setItem('authenticatedUserEmail', user.email);\n sessionStorage.setItem('authenticatedUserName', user.name);\n sessionStorage.setItem('authenticatedUserContact', user.contact);\n sessionStorage.setItem('authenticatedUserRole', user.role);\n }", "function handleLoginSuccess(data) {\n\n if (data.message) {\n // remove loader\n $scope.loginLoader = false;\n $scope.LoginMessage = data.message;\n } else {\n // handle login success (store info in cookies and redirect to dashboard)\n $cookies.put('managerId', data.id);\n $cookies.put('managerToken', data.token);\n $state.go('loggedIn.hotels');\n }\n }", "function login() {\n\n}", "function authUser() {\n FB.login(checkLoginStatus, {scope:'read_stream'});\n }", "onLoggedIn() {\r\n this.controller = new MainController(this.login.pryvUserConnection, \"event-view\", \"category-events\");\r\n this.controller.init();\r\n }", "handleLogin() {\n notification.success({\n message: 'Seminar App',\n description: \"You're successfully logged in.\",\n });\n this.loadCurrentUser();\n this.props.history.push(\"/\");\n }", "load_() {\n const url = `${this.baseUrl_}/${RouteSuffix.IS_LOGGED_IN}`;\n this.$http_.get(url, {withCredentials: true}).then(\n this.handleLogin_.bind(this, true)\n );\n }", "function handleLogin() {\n if (email === \"\" || password === \"\") {\n alert(\"Please fill out email and password\");\n return;\n }\n dispatch(loginUser(email, password));\n setLoginAttempts(loginAttempts + 1);\n }", "async login(event) {\n\t\tthis.setState({ loading: true });\n\n\t\tvar appx = await AppX.login(this.state.username, this.state.password, this.state.eid, this.environment);\n\n\t\tthis.setUserData();\n\t\tthis.setState({ loading: false });\n\t\tif (appx.data) {\n\t\t\tif (__DEV__) {\n\t\t\t\tthis.setCredentials()\n\t\t\t}\n\n\t\t\tthis.props.navigator.resetTo({\n\t\t\t\tscreen: 'ThreadList'\n\t\t\t});\n\t\t} else {\n\t\t\tsetTimeout(() => { alert('Login failed. Please try again.') }, 1000);\n\t\t}\n\t}", "function onHotmailLogin() {\r\n\t\tvar session = WL.getSession();\r\n\t\tif (session) {\r\n\t\t\tgetHotmailUser(session);\r\n\t\t}\r\n\t}", "function login(event)\n{\n event.preventDefault();\n\tvar l_username = $('#username').val();\n\tvar l_password = $('#password').val();\n var l_Storefront = 'Storefront';\n var l_start ='Storefront';\n\tapi_async.auth.login(l_username, l_password,\n\t\tfunction (p_data)\n\t\t{\n\t\t\t$.cookie('user_id', p_data.user_id, { expires: 2, path: '/' });\n\t\t\t$.cookie('user_hash', p_data.user_hash, { expires: 2, path: '/' });\n\t\t\t$.cookie('expiration_date', p_data.expiration_date, { expires: 2, path: '/' });\n var session = api_sync.auth.get_current_user();\n window.location = '/';\n if (session.scope)\n {\n if(session.scope_name[0] == '') \n {\n window.location = '/';\n $('#error_msg').text('Succes');\n }\n \n else\n {\n window.location = '/';\n $('#error_msg').text('Succes');\n }\n }\n\t\t},\n\t\tfunction ()\n\t\t{\n\t\t\t$('#password').val('');\n\t\t\t$('#error_msg').text('Wrong Credentials!');\n\t\t});\n}", "function autoLogin() {\n var env = detectEnvironment();\n if (settings['login' + env] && settings['password' + env] && !$('.auth-top-messages').text().replace(/\\s/g, '').length) {\n $(\"#Login\").val(settings['login' + env]);\n $(\"#Password\").val(settings['password' + env]);\n $('#Login[type=submit]').click();\n }\n }", "login() {\n if (this.$solid) {\n console.debug(\"logging in\");\n this.$solid.auth.popupLogin({ popupUri: this.popupUri });\n }\n }", "authentication_complete() {\n\t\tlet selected_session = $( '.selected' ).attr( 'data-session-id' ),\n\t\t\terr_msg = _config.translations.auth_failed;\n\n\t\tthis.auth_pending = false;\n\n\t\t_config._set( selected_session, 'user', lightdm.authentication_user, 'session' );\n\n\t\t$( '#timerArea' ).hide();\n\n\t\tif ( lightdm.is_authenticated ) {\n\t\t\t// The user entered the correct password. Let's start the session.\n\t\t\t$( 'body' ).fadeOut( 1000, () => lightdm.start_session( selected_session ) );\n\n\t\t} else {\n\t\t\t// The user did not enter the correct password. Show error message.\n\t\t\tthis.show_message( err_msg, 'error' );\n\t\t}\n\t}", "function beginLogin() {\n\treturn { type: types.MANUAL_LOGIN_USER };\n}", "_handleLogin() {\n if (this.$.loginForm.validate()) {\n let loginPostObj = { phoneNumber: parseInt(this.$.username.value), password: this.$.password.value };\n this.$.loginForm.reset();\n this.action = 'list';\n this._makeAjax('http://10.117.189.147:9090/foreignexchange/login', 'post', loginPostObj);\n }\n }", "function logIn(){\n loggedIn = true;\n\tloginPlayer();\n}", "async logIn(){\n let email = this.baseEl.find('#login-email').val();\n let password = this.baseEl.find('#login-password').val();\n \n let login = new Login({ \n email : email,\n password : password\n })\n\n await login.save()\n \n if( !login.loggedIn ) { return this.validatesLogin(login)} \n App.loggedIn = true;\n UserLogin.current.hideModal();\n NavBar.current.toggleRegisterButton();\n BookingPage.current.smoothLogIn();\n Salon.current.click();\n }", "processLogin(result, platform) {\n this.setUserData(result, platform);\n this.setState({ refresh: false });\n this.props.goHome(result, platform);\n }", "onCompleted({ login }) {\n\t\t\tlocalStorage.setItem('token', login.token);\n\t\t\t//Client recognizes user is logged in\n\t\t\tclient.writeData({ data: { isLoggedIn: true } });\n\t\t}", "loginEventListenter() {\n\t\tdocument.querySelector('#login-btn').addEventListener('click', () => {\n\t\t\tconst emailValue = document.querySelector('#login-email').value;\n\t\t\tconst passwordValue = document.querySelector('#login-password').value;\n\n\t\t\t//fetches any user with the an email and password matching the inputs\n\t\t\tfetch(`http://localhost:8088/users?email=${emailValue}&password=${passwordValue}`)\n\t\t\t\t.then((r) => r.json())\n\t\t\t\t.then((user) => {\n\t\t\t\t\t//If a user is returned\n\t\t\t\t\tif (user.length != 0) {\n\t\t\t\t\t\t//Sets the userId in session storage to the id of the user that was fetched, deactivates the modal, and clears the values in the form\n\t\t\t\t\t\tsessionStorage.setItem('userId', user[0].id);\n sessionStorage.setItem(\"username\", user[0].username);\n nutLogin.deactivateModal();\n location.reload(true);\n\t\t\t\t\t\tdocument.querySelector('#login-email').value = '';\n\t\t\t\t\t\tdocument.querySelector('#login-password').value = '';\n\n\t\t\t\t\t\t//If it didn't find a match it returns an error message\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdocument.querySelector('#login-error-container').innerHTML = 'email or password is incorrect!';\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t});\n\t}", "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 pageLoad_welcome() {\n console.log(\"On welcome page\");\n var loggedInUser = persist.getLoggedInUser();\n if (loggedInUser.id) {\n console.log(loggedInUser.username + \" already logged in\");\n navigateToScreen(SCREENS.MAIN);\n }\n}", "function init(){\r\n checkSession(); \r\n}", "static init() {\n if (!this.isLogged()) {\n this.getSession();\n } \n }", "orderAccess() {\n loginPage.open();\n loginPage.username.setValue('pepeamigo@gmail.com');\n loginPage.password.setValue('pepito');\n loginPage.submit();\n }" ]
[ "0.76315916", "0.7506858", "0.7211727", "0.7104413", "0.69989294", "0.6981114", "0.6943253", "0.6918658", "0.689412", "0.6876089", "0.6873072", "0.6871407", "0.6859591", "0.6846437", "0.6839957", "0.68332255", "0.68320006", "0.6807252", "0.68036205", "0.67986095", "0.67936754", "0.67718893", "0.6757571", "0.6755364", "0.673224", "0.67174524", "0.6712356", "0.6706992", "0.66821843", "0.6678119", "0.6624159", "0.66193897", "0.66096056", "0.660705", "0.6599737", "0.65961075", "0.65926945", "0.65911245", "0.658633", "0.65817", "0.65748584", "0.6573725", "0.65588623", "0.65574616", "0.6556184", "0.6554937", "0.6541721", "0.6533085", "0.6531541", "0.65244246", "0.6517229", "0.6513158", "0.65090287", "0.6475591", "0.64704067", "0.6461861", "0.6453768", "0.6445581", "0.6430577", "0.6427382", "0.642596", "0.6415317", "0.6407437", "0.64033043", "0.6399046", "0.6395299", "0.63936114", "0.63893646", "0.6384794", "0.6383729", "0.63813347", "0.6373333", "0.63634795", "0.63632375", "0.63621366", "0.6360503", "0.63537645", "0.63490236", "0.6348206", "0.63463295", "0.6334545", "0.63333464", "0.6331841", "0.6330956", "0.6328815", "0.6328287", "0.6328169", "0.63272476", "0.6325657", "0.63214356", "0.6311546", "0.63112247", "0.6309158", "0.63051105", "0.6302644", "0.63002646", "0.63000554", "0.62911296", "0.6290397", "0.62889385", "0.62870306" ]
0.0
-1
Fade for successful data submission
function postSubmit() { $('#successAlert').fadeTo( 400, .75 ) $('#successAlert').delay(2000).fadeTo( 400, 0 ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FADER() {\n $('.FADE').hide(0).delay(500).fadeIn(500);\n console.log('done');\n }", "function formEventHaveBeenSubmitted() {\n $('.event_not_yet').hide();\n $('.event_submitted').fadeIn();\n}", "function setSucessMessageWithFade(message){\n setSucessMessage(message);\n setTimeout(function() {\n setSucessMessage('');\n }, 3000);\n }", "ClickAddRest() {\n $(\"#addRestForm\").fadeIn();\n }", "function submitForm() {\n\n $('#change-password-menu').fadeOut(\"fast\");\n $('#add-question-menu').fadeOut(\"fast\");\n $('#show-questions-menu').fadeOut(\"fast\");\n\n return true ;\n}", "function failedsent() {\n console.error(\"Invio delle notizie non riuscito!\")\n $(\"#formerr\").fadeIn(750);\n $(\"#infomsg\").text(\"Invio delle notizie non riuscito!\");\n $(\"#formerr\").delay(3000).fadeOut(2000);\n}", "function fadeErrorDisplay(event){\n\tevent.preventDefault();\t\n\t$(\".errorDisplayOptions\").hide();\n\t$(\"#errorDisplay\").fadeOut(3000, function(){\n\t\t//allow the user to retrieve the message after fade out has completed\n\t\tretrieve(); \n\t});\n}", "function showLoadingGifOnFormSubmit(){\r\n\t$(\"form\").on('submit',function(){$(\".se-pre-con\").show();});\r\n}", "function afterSubmit(data) {\n var form = data.form;\n var redirect = data.redirect;\n var success = data.success;\n\n // Redirect to a success url if defined\n if (success && redirect) {\n Webflow.location(redirect);\n return;\n }\n\n // Show or hide status divs\n data.done.toggle(success);\n data.fail.toggle(!success);\n\n // Hide form on success\n form.toggle(!success);\n\n // Reset data and enable submit button\n reset(data);\n }", "function CantFinishLook() {\n $('.create-finish').fadeOut(400);\n $('.create-finish').delay(1500).fadeIn(400);\n}", "function fadeDetailsDisplay(event){\n\tevent.preventDefault();\n\t$(\".detailsDisplay\").fadeOut(3000, function(){\t\n\t\t//allow the user to retrieve the errors after fade out has completed\n\t\tretrieve(); \n\t\t\n\t});\n}", "function massFadeIn(){\n $(\"#question, #timer, #picture, #question, #answers, #gameMessage, #tryAgain\").fadeIn();\n}", "function errorDisplay() {\n $('#errorMsg').fadeIn(10);\n $('#errorMsg').html(\"WRONG !\");\n $('#errorMsg').fadeOut(900);\n}", "function submit_success(form, evt, data, status, xhr) {\n var html = xhr.responseText\n var body = $(featherlight_selector());\n body.empty();\n body.append(html);\n}", "function afterSubmit(data) {\n var form = data.form;\n var wrap = form.closest('div.w-form');\n var redirect = data.redirect;\n var success = data.success;\n\n // Redirect to a success url if defined\n if (success && redirect) {\n Webflow.location(redirect);\n return;\n }\n\n // Show or hide status divs\n data.done.toggle(success);\n data.fail.toggle(!success);\n\n // Hide form on success\n form.toggle(!success);\n\n // Reset data and enable submit button\n reset(data);\n }", "function nextQuestion(){\n currentQuestion++;\n if (currentQuestion > numQuestions){\n var currentQuestionId = \"question_\" + (currentQuestion - 1);\n $(\"#\" + currentQuestionId).fadeOut(FADE_TIME, function(){\n form.submit()\n }); \n }\n var currentQuestionId = \"question_\" + (currentQuestion - 1);\n var nextQuestionId = \"question_\" + currentQuestion;\n\n $(\"#\" + currentQuestionId).fadeOut(FADE_TIME);\n $(\"#\" + nextQuestionId).delay( FADE_TIME ).fadeIn(FADE_TIME);\n}", "function afterSubmit(data) {\r\n\t var form = data.form;\r\n\t var wrap = form.closest('div.w-form');\r\n\t var redirect = data.redirect;\r\n\t var success = data.success;\r\n\r\n\t // Redirect to a success url if defined\r\n\t if (success && redirect) {\r\n\t Webflow.location(redirect);\r\n\t return;\r\n\t }\r\n\r\n\t // Show or hide status divs\r\n\t data.done.toggle(success);\r\n\t data.fail.toggle(!success);\r\n\r\n\t // Hide form on success\r\n\t form.toggle(!success);\r\n\r\n\t // Reset data and enable submit button\r\n\t reset(data);\r\n\t }", "function displaySuccessMessage() {\n $(\"#feedback\").html(\"Success! Please wait...\");\n $(\"#feedback\").css({\n color: \"green\"\n });\n $(\"#feedback\").show(0);\n $(\"#feedback\").fadeOut(1000);\n setTimeout(function () {\n // Refresh the page (will be redirected if there are no more quests to approve)\n location.reload();\n }, 1000);\n}", "function submitDataCallback() {\n\tif (validate_variables()) {\n\t\tdocument.variables.submit();\n\t\treturn false;\n\t}\n\telse {\n\t\tunfade();\n\t\treturn false;\t\n\t}\n}", "function successPopup(message) {\n $(\"#success\").text(message);\n $(\"#success\").show().delay(3000).hide(1);\n}", "function solicitarPrestamo() {\n $(\"#datosPersonales\").fadeIn(\"slow\");\n}", "function showFormMessage( message, success, callback )\n{\n\tvar target = $( \"#results_div\" );\n\tvar result_class = ( success != \"1\" ) ? \"color_red_bg\" : \"\";\n\t\n\t//apply class and show message, do callback\n\ttarget.addClass( result_class );\n\ttarget.html( message );\n\tcallback();\n\t\n}//showFormMessage()", "function showEnd() {\n $(\"#ui_3\").fadeOut(null, ()=>{\n $(\"#ui_end\").fadeIn();\n postLog();\n });\n}", "function successfullysent() {\n console.log(\"Invio delle notizie riuscito!\");\n $(\"#dialog\").fadeIn(750);\n $(\"#infomsg\").text(\"Invio delle notizie riuscito!\");\n $(\"#dialog\").delay(3000).fadeOut(2000);\n}", "function alertMessageDisplay(updateStatus) {\n $('#toastMessage').fadeIn(400).delay(2000).fadeOut(400);\n if (updateStatus) {\n $('#toastMessage').attr('class', 'w3-container w3-green');\n $('#toastMessage').html('Update Was Successfully Done');\n } else {\n $('#toastMessage').attr('class', 'w3-container w3-red');\n $('#toastMessage').html('An Error Occurred While Updating The Field.! ');\n }\n\n}", "function displayResult(id) {\r\n $('.feedback').hide();\r\n $(id).show()\r\n .delay(2000)\r\n .fadeOut('fast');\r\n}", "function alertSuccess(time) {\n var $elem = $('.app-alert-success');\n $elem.fadeIn();\n setTimeout(function () {\n $elem.fadeOut();\n }, time || 3000);\n }", "function setSuccess(blink) {\n blink.fadeToRGB(500, 0, 100, 0); // millisec, r, g, b: 0 - 255\n}", "function mostrarLoader(){\n $(\"#loader_gif\").fadeIn(\"slow\");\n }", "function updateFailure(message) {\n document.getElementById('update-danger-alert').innerText = message;\n $('#update-danger-alert').show();\n\n $(\"#update-danger-alert\").fadeTo(5000, 500).slideUp(500, function () {\n $(\"#update-danger-alert\").slideUp(500);\n });\n}", "function formAlert(message) {\n let alertBox = $('.form__message').fadeIn(100);\n let alert = $('.form__message-text');\n alert.html(message);\n setTimeout(function() {\n alertBox.fadeOut('500');\n }, 3000);\n }", "function successfulSubmit() {\n console.log(\"Successful submit\");\n\n // Publish a \"form submitted\" event\n $.publish(\"successfulSubmit\");\n\n // Hide the form and show the thanks\n $('#form').slideToggle();\n $('#thanks').slideToggle();\n\n if($('#address-search-prompt').is(\":hidden\")) {\n $('#address-search-prompt').slideToggle();\n }\n if($('#address-search').is(\":visible\")) {\n $('#address-search').slideToggle();\n }\n\n // Reset the form for the next submission.\n resetForm();\n }", "function reactivateSubmit(form)\n{\n $(form).find('.processing_form_msg').html('Successfully saved!').css({'float':'none'}).show().pulse(false);\n $(form).find('.save_button').removeClass('in_use').parents('span').show();\n setTimeout(function() { $(form).find('.processing_form_msg').hide() }, 4000);\n}", "function successMessageEdit() {\n $('<div class=\"alert alert-success\"><strong>Redigert!</strong> Lager er redigert. </div>').appendTo('#success')\n .delay(2000).fadeOut(500, function () {\n $(this).remove();\n });\n ;\n}", "function callback() {\n setTimeout(function() {\n $( \"#bRegister\" ).removeAttr( \"style\" ).hide().fadeIn();\n }, 0 );\n }", "function successMessageEdit() {\n $('<div class=\"alert alert-success\"><strong>Redigert!</strong> Bruker er redigert. </div>').appendTo('#success')\n .delay(2000).fadeOut(500, function () {\n $(this).remove();\n });\n ;\n}", "function displaySuccess () {\n $('.validationText').hide();\n $('#wishForm').hide();\n return $(\"#successMsg\").show();\n }", "function send_color_into_db(submit_form, hide_div){\n\t\t$(submit_form).submit(function(evt){\n\t\t\tevt.preventDefault();\n\t\t\tvar postData = $(this).serialize();\n\t\t\tvar url = $(this).attr('action');\n\t\t\t\n\t\t\t$.post(url, postData, function(php_table_data){\n\t\t\t\t$(hide_div).hide();\n\t\t\t});\n\t\t});\t\n\t}", "function ejecutaAlertaOK() { \n\n var valor= obtenerValorParametro(\"OK\");\n var valorEdit= obtenerValorParametro(\"OKEdit\");\n\n if (valor){\n $('#alerta').fadeIn(); \n setTimeout(function() {\n $(\"#alerta\").fadeOut(); \n },2000);\n \n }\n\n if (valorEdit){\n $('#alertaEdit').fadeIn(); \n setTimeout(function() {\n $(\"#alertaEdit\").fadeOut(); \n },2000);\n \n }\n\n}", "function successProductAdd(){\n let messageSuccess = document.getElementById(\"message_success\");\n messageSuccess.style.visibility = \"visible\";\n messageSuccess.style.opacity = \"1\";\n messageSuccess.classList.add('transitionClean');\n setTimeout(hiddenMessageAddProduct,2250);\n function hiddenMessageAddProduct(){\n messageSuccess.style.opacity = \"0\";\n messageSuccess.style.visibility = \"hidden\";\n messageSuccess.classList.remove('transitionClean');\n }\n}", "function successMessage() {\n $('#success').slideDown(1000);\n $('#success').delay(1000);\n $('#success').slideUp(1000);\n}", "function onSubmit() {\t\t\r\t\t\r\t\tvar donnees = $(\"#contact-form\").serialize();\r\t\t\t\t\r\t\t$(\"#contact-form\").find(\":input\").attr(\"disabled\", \"disabled\");\t\t\r\t\t$(\"#close\").fadeOut();\t\t\r\t\t$(\"#result\").fadeOut();\t\t\r\t\t$(\"#contact-form\").fadeOut(function(){\t\t\t\t\r\t\t\t$(this).find(\":input\").removeAttr(\"disabled\");\t\t\t\t\r\t\t\t$.ajax({\t\t\t\t\t\r\t\t\t\turl: $(\"#contact-form\").attr(\"action\"),\t\t\t \r\t\t\t\ttype: $(\"#contact-form\").attr(\"method\"),\t\t\t\t\t\r\t\t\t\tdata: donnees,\t\t\t\t\t\r\t\t\t\tsuccess: function(data) {\t\t\t\t\t\t\r\t\t\t\t\tif(data.success) {\t\r\t\t\t\t\t\t\t\t\t\t\t\r\t\t\t\t\t\t$(\"#result\").css({\t\t\t\t\t\t\t\t\r\t\t\t\t\t\t\t\"background-color\": \"green\",\t\t\t\t\t\t\t\t\r\t\t\t\t\t\t\t\"font-size\": \"25px\",\t\t\t\t\t\t\t\t\r\t\t\t\t\t\t\t\"color\": \"white\"\t\t\t\t\t\t\t\r\t\t\t\t\t\t});\t\r\t\t\t\t\t\t\t\t\t\t\t\r\t\t\t\t\t} else {\t\r\t\t\t\t\t\t\t\t\t\t\t\r\t\t\t\t\t\t$(\"#result\").css({\t\t\t\t\t\t\t\t\r\t\t\t\t\t\t\t\"background-color\": \"red\",\t\t\t\t\t\t\t\t\r\t\t\t\t\t\t\t\"font-size\": \"18px\",\r\t\t\t\t\t\t\t\"color\": \"white\"\t\t\t\t\t\t\t\r\t\t\t\t\t\t});\t\t\t\t\t\t\t\r\t\t\t\t\t\t\r\t\t\t\t\t\t$(\"#contact-form\").fadeIn();\t\t\t\t\t\t\r\t\t\t\t\t}\t\t\t\t\t\t\r\t\t\t\t\t\r\t\t\t\t\t$(\"#close\").fadeIn();\t\t\t\t\t\t\r\t\t\t\t\t$(\"#result\").fadeIn().text(data.message);\t\t\t\t\t\r\t\t\t\t},\t\t\t\t\t\r\t\t\t\terror: function(data) {\t\t\t\t\t\t\r\t\t\t\t\talert(\"Erreur lors de l'envoi des données en Ajax.\");\t\t\t\t\t\t\r\t\t\t\t\t$(\"#contact-form\").fadeIn();\t\t\t\t\t\r\t\t\t\t}\t\t\t \r\t\t\t});\t\t\t\r\t\t});\t\t\t\t\r\t\t\r\t\treturn false;\t\r\t}", "function submitFinished( response ) {\n\n response = $.trim( response );\n \n $('#sendingMessage').fadeOut();\n\n if ( response == \"success\" ) {\n\n // Form submitted successfully:\n // 1. Display the success message\n // 2. Clear the form fields\n // 3. Fade the content back in\n\n $('#successMessage').fadeIn().delay(messageDelay).fadeOut();\n $('#senderName').val( \"\" );\n $('#senderEmail').val( \"\" );\n $('#message').val( \"\" );\n $('#content').delay(messageDelay + 500).fadeTo( 'slow', 1 );\n //$('.email-form').delay(messageDelay + 500).remove();\n\n } else {\n\n // Form submission failed: Display the failure message,\n // then redisplay the form\n $('#failureMessage').fadeIn().delay(messageDelay).fadeOut();\n $('#contactForm').delay(messageDelay + 500).fadeIn();\n }\n }", "htmlAnyResult(textX){\n\t $(\"#resultFinal\").stop().fadeOut(\"slow\",function(){ \n\t \n $(this).html(textX)\n\t \n }).fadeIn(11000);\n\n $(\"#resultFinal\").css(\"border\",\"1px solid red\"); // set red border for result div \n }", "function submit() {\n axios.post('/api/jobs', {\n company_name: company,\n job_title: job_title,\n status: status,\n color: color\n })\n .then(res => {\n props.add(res.data);\n props.hide();\n })\n }", "function flash_error( msg ){\n\t\tj('#errob').html( msg ).fadeIn()\n\t\tsetTimeout( \"j('#errob').fadeOut()\", 5000 )\n\t}", "function onSuccess(data) {\n\t\t\t\n\t\t\t/* update the deal list container with the new deals */\n\t\t\t$('#deal-list-container').html(data['html']);\n\n\t\t\t/* fade out the feedback div, and fade it back in with the new status */\n\t\t\t$('#feedback').fadeOut(\n\t\t\t\t1000, \n\t\t\t\tfunction() \n\t\t\t\t{\n\t\t\t\t\n\t\t\t\t\tif(data['error']) $(this).html('<div class=\"error\"><p>'+data['error']+'</p></div>');\n\t\t\t\t\t\n\t\t\t\t\tif(data['success']) $(this).html('<div class=\"updated\"><p>'+data['success']+'</p></div>');\n\t\t\t\t\t\n\t\t\t\t\t$(this).fadeIn();\n\t\t\t\n\t\t\t\t}\n\t\t\t);\n\t\t\t\n\t\t\t/* If we just added a deal, and it was successfull we want to clear our form */\n\t\t\t\n\t\t\tif(!data['error'] && data['action'] == 'AddDeal') $('#add-deal').clearForm();\n\t\t\t\n\t\t}", "function displayCommentSuccess(){\n $('#comment-section').removeClass('comment-sec');\n $('#comment-section').addClass('comment-success');\n $('#comment-section').text('Success');\n $('#comment-section').css({\"opacity\":\"1\"});\n }", "function exibeDivLoading() {\n $('#div-fade-loading').css('visibility', 'visible');\n}", "function startFade() {\n fader.addClass('fadeOut');\n setTimeout(teardownFade, FADE_DURATION_MS);\n }", "function status(message, borderColor) {\n $('#status').fadeOut(10);\n $('#status').text(message);\n $('.status').css(\"border-color\", borderColor);\n $('#status').fadeIn();\n} // end of fucntion status", "function show() {\n\t var time = arguments.length <= 0 || arguments[0] === undefined ? 200 : arguments[0];\n\t\n\t this.transition().duration(time).style('opacity', 1);\n\t }", "startFade(){\n this.last_update = Date.now();\n this.color = \"#f4d742\";\n this.fade_rate = .2; //fades 20% every 100 ms\n this.transparency = 1;\n }", "function espereshow ()\n{\n $('.espere').fadeIn('fast');\n}", "cancel() {\n $(\"#addRestForm\").fadeOut();\n }", "function thankYouFadeOut(){\n $('#thank-you-message').fadeOut();\n }", "function startFade(src_name, data) {\n $(\"body\").fadeOut(function () {});\n}", "function displayError(message) {\n $(\"#messageBox span\").html(message);\n $(\"#messageBox\").fadeIn();\n $(\"#messageBox\").fadeOut(10000);\n}", "function productCatSubmit()\n {\n\n // masking..\n $('.view-product-facets').mask('loading..');\n\n // submits form\n $('#edit-submit-product-facets').click();\n\n }", "function showResults () {\n $('#results').fadeIn();\n }", "function success(){\n var msgHost = document.getElementById('response');\n let formWrapper = document.getElementById('form-content');\n let response = JSON.parse(this.responseText);\n \n switch(response.status){\n case 200:\n msgHost.style.backgroundColor = \"green\"; \n msgHost.innerHTML = response.msg;\n break;\n case 201:\n msgHost.style.backgroundColor = \"green\";\n msgHost.innerHTML = response.msg;\n formWrapper.innerHTML = generateForm(response.content);\n validate();\n break;\n case 300:\n msgHost.innerHTML = `${response.msg}`;\n break;\n case 400:\n msgHost.innerHTML = `${response.msg}`;\n break;\n case 403:\n msgHost.style.backgroundColor = \"red\";\n msgHost.innerHTML = `Invalid Call Number`;\n formWrapper.innerHTML = generateForm(response.content);\n validate();\n break;\n case 404:\n msgHost.style.backgroundColor = \"red\";\n msgHost.innerHTML = `No record of stack with id: ${response.id}`;\n formWrapper.innerHTML = generateForm(response.content);\n validate();\n break;\n }\n \n msgHost.classList = 'response show';\n setTimeout(function(){\n msgHost.classList = \"response hide\";\n }, 3000);\n}", "function successBankAlert(){\n $(\"#successBank\").addClass(\"in\"); //adds fade in animation\n /*\n Alert with timer\n http://stackoverflow.com/questions/23101966/bootstrap-alert-auto-close\n */\n $(\"#successBank\").fadeTo(2000, 500).slideUp(500, function(){\n $(\"#successBank\").hide(); //hide it (not alert) to show it again for error purposes.\n });\n}", "function showFeedback(postResponse, action) {\r\n console.log('post success');\r\n console.log(postResponse);\r\n\r\n // change button background to green\r\n switch (action) {\r\n case 'delete':\r\n $('#delete-one').css({\r\n 'background-color': 'green' \r\n }); \r\n break;\r\n\r\n case 'update':\r\n $('#update-one').css({\r\n 'background-color': 'green' \r\n }); \r\n break;\r\n\r\n case 'create':\r\n $('#create-one').css({\r\n 'background-color': 'green' \r\n }); \r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n}", "function showAjaxWaiting() {\n\t\t// show the loading img\n\t\t$(\"#loadingImg\").show();\n\n\t\t// disable the submit button and show loadingimg\n\t\t$(\"#submit-button\").bind(\"click\", function(event) {\n\t\t\tevent.preventDefault();\n\t\t});\n\n\t\t// hide the error message\n\t\t$(\"#error\").hide();\n\t\t$(\"#noMatch\").hide();\n\t}", "function SuccessMessage(msg) {\n $(\"#message\").html('');\n $(\"#message\").html(msg);\n $(\"#message\").show();\n $('#message').delay(400).slideDown(400).delay(3000).slideUp(400);\n}", "function callback() {\n\t\tsetTimeout(function() {\n\t\t\t$( \"#effect\" ).removeAttr( \"style\" ).hide().fadeIn();\n\t\t\t}, 1000 \n\t\t);\n\t}", "function submit_photo() {\n\t// display the loading texte\n\t$('#loading_progress').html('<img src=\"images/loader.gif\"> Uploading your photo...');\n}", "function afterSuccess(){\n $('#submit-btn').show(); //hide submit button\n $('#loading-img').hide(); //hide submit button\n $('#progressbox').delay( 1000 ).fadeOut(); //hide progress bar\n //var filename = $(\"#output\").html();\n // parseFile(filename);\n}", "function loading_show(){\n $('#loading3').html(\"<img src='../assets/img/loading.gif'/>\").fadeIn('fast');\n }", "function loading_show(){\n \t\t$('#loading').html(\"<img src='img/loading.gif'/>\").fadeIn('fast');\n }", "function cerrar(){ \n $(\"#loadMe\").animate({\"opacity\":\"0\"},1000,function(){$(\"#loadMe\").css(\"display\",\"none\");}); \n }", "function displayQuizResultLoading() {\n var $l = $('#quiz-result-loading');\n $l.fadeIn(300).delay(1500).fadeOut(300);\n $l.css('display', 'flex');\n $l.css('align-items', 'center');\n $l.css('justify-content', 'center');\n}", "function successForm(data) {\n\t\t\tvar serverAnswer = $.parseJSON(data);\n\t\t\t$('.callback-form__message').next().text(serverAnswer.result);\n\t\t\tconsole.log(serverAnswer.result);\n\t\t\tif (serverAnswer.result == \"pass\") {\n\t\t\t\t$(\".callback-form__errors\").empty();\n\t\t\t\t$('.callback-form').trigger(\"reset\");\n\t\t\t\t$('.callback-form__button').prop('disabled', false);\n\t\t\t\t$(\".callback-block\").hide(0.607);\n\t\t\t\t$('.сallback-close').hide(0.607);\n\t\t\t\t$(\".callback-status\").show(0.607);\n\t\t\t} else {\n\t\t\t\tvar showError = $('.callback-errors').attr(\"data-errors-server\");\n\t\t\t\t$('.callback-status__message').text(showError);\n\t\t\t\t$(\".callback-block\").hide(0.607);\n\t\t\t\t$(\".callback-status\").show(0.607);\n\t\t\t\tsetTimeout(reloadPage, 5000);\n\t\t\t}\n\t\t}", "function displayOverlay() {\n $(\"div.container\").css({\n opacity: .3,\n });\n $(\"div#submitted\").show();\n}", "function successMessagedelivery() {\n $('<div class=\"alert alert-success\"><strong>Levert!</strong> Vareleveringen er registrert. </div>').appendTo('#success')\n .delay(2000).fadeOut(500, function () {\n $(this).remove();\n });\n ;\n}", "function addNewLead() {\n $('#LeadDetails').hide();\n $('#AddLead').fadeIn(500, null);\n}", "fadeIn() {\n const self = this;\n const $el = $(this.newContainer);\n // Hide old Container\n $(this.oldContainer).hide();\n\n $el.css({\n visibility: 'visible',\n opacity: 0\n });\n\n TweenMax.to($el, 0.4, {\n opacity: 1,\n onComplete: () => {\n this.done();\n }\n });\n }", "function notify(message, fadeout = true) {\n if (fadeout) {\n $(\"#message\").html(message).fadeTo(500, 1).delay(6000).fadeTo(500, 0);\n }\n else {\n $(\"#message\").html(message).fadeTo(500, 1);\n }\n}", "function successUpdate() {\n updateForm.style.display = \"none\";\n updateSuccessView.style.display = \"block\";\n setTimeout(closeUpdateModal, 1500);\n }", "function show_animation() {\n $('#saving_container').css('display', 'block');\n $('#saving').css('opacity', '.7');\n }", "function sendMsg(msg) {\n $('#divResult').addClass(\"alert-danger\")\n $('#result').html(msg)\n $('#divResult').fadeIn(500)\n return false\n}", "function sendMsg(msg) {\n $('#divResult').addClass(\"alert-danger\")\n $('#result').html(msg)\n $('#divResult').fadeIn(500)\n return false\n}", "function showUploadSuccess(formInputErrorObject, elementIdToAdjust) {\r\n if (jQuery.isEmptyObject(formInputErrorObject)) {\r\n $('#' + elementIdToAdjust).parent().children('md-icon').css('opacity', '1');\r\n // $('#utility-bill-input').parent().children().first().css('opacity', '1');\r\n } else {\r\n $('#' + elementIdToAdjust).parent().children('md-icon').css('opacity', '0');\r\n }\r\n }", "function fadeIn(elem) {\n setTimeout(function () {\n var op = 0;\n var timer = setInterval(function () {\n if (op >= 1) {\n clearInterval(timer);\n } else {\n elem.style.opacity = op;\n elem.style.filter = 'alpha(opacity=' + op * 100 + \")\";\n op += 0.1;\n }\n }, 10);\n }, 200);\n }", "function showLoading()\n{\n\t$chatlogs.append($('#loadingGif'));\n\t$(\"#loadingGif\").show();\n\n\t// $('#submit').css('visibility', 'hidden');\n\t// $('input').css('visibility', 'hidden');\n\n\t$('.chat-form').css('visibility', 'hidden');\n }", "function flashError(data)\n{\n $('#wrapper').prepend($(document.createElement(\"DIV\")).addClass(\"flash\").addClass(\"error\").html(data));\n setTimeout('$(\".flash\").fadeOut(1000)', 10000);\n $(\"html, body\").animate({ scrollTop: 0 }, \"slow\");\n}", "function formSender(){\r\n\t\t$('#form').submit(function(e) {\t\r\n\t\t\te.preventDefault();\r\n\t\t\t$(this).ajaxSubmit({ \r\n\t\t\t\ttarget: '#target', \r\n\t\t\t\tbeforeSubmit: function() {\r\n\t\t\t\t $('#form').css({backgroundColor:'rgba(83,50,83,0.2)', opacity:'0.3'}).prepend('<img src=\"img/loading.gif\" alt=\"...\" class=\"load\"/>');\r\n\t\t\t\t\t\r\n\t\t\t\t},\r\n\t\t\t\tsuccess:function (){\r\n\t\t\t\t\t$(\".load\").hide();\r\n\t\t\t\t\t$('#target').fadeIn(); //Show the target block\r\n\t\t\t\t\tstatus();\r\n\t\t\t\t\tcounter();\r\n\t\t\t\t\tresetForm();\r\n\t\t\t\t},\r\n\t\t\t\tresetForm: false\r\n\t\t\t}); \r\n\t\t\treturn false;\r\n\t\t});\r\n\t}", "function success() {\n\n Modal.success({\n okText:\"Done\",\n title: 'Submit successful!',\n // content: 'View your requests to see your new entry.',\n onOk() {\n doneRedirect();\n }\n });\n }", "function displayAlertBox() {\n $(\"#alertBox\").fadeIn(1500, function () {\n $(this).delay(20).fadeOut(1500);\n });\n}", "function loading_show(){\n $('#loading2').html(\"<img src='../assets/img/loading.gif'/>\").fadeIn('fast');\n }", "function showDone(){\n\t$('BODY').prepend('<div class=\"middleMsg all-rounded-10px\">Done!</div>');\n\tsetTimeout( function(){\n\t\t$('.middleMsg').remove();\n\t\tif ( $('input[name=content_id]').val() == 0 ){\n\t\t\twindow.location.reload()\n\t\t}\n\t\t\n\t}, 2000 );\n\t\n//\t$('BODY').hide();\n\t\n}", "function showResponse(data) {\n\n\t\tif (!data.flag) {\n\t\t\t// hide the loading img\n\t\t\t$(\"#loadingImg\").hide();\n\n\t\t\t// enable the button\n\t\t\t$(\"#submit-button\").unbind(\"click\");\n\n\t\t\t// show the error message\n\t\t\t$(\"#error\").show();\n\t\t\t$(\"#noMatch\").show();\n\n\t\t\t// show the failedTimes\n\t\t\t$(\"#errorTimes\").text(data.failedTimes);\n\t\t} else {\n\t\t\twindow.location.href = \"/home\";\n\t\t}\n\n\t}", "function successMessageStock() {\n $('<div class=\"alert alert-success\"><strong>Oppdatert!</strong> Lagerbeholdning er oppdatert. </div>').appendTo('#success')\n .delay(2000).fadeOut(500, function () {\n $(this).remove();\n });\n ;\n}", "function addSuccess(self) {\n if (!self.error | self.validations == 1) {\n // If fv-valid-func exists then run the JS method\n if ($(self).attr('fv-valid-func') != \"undefined\") {\n var func = $(self).attr('fv-valid-func');\n\n Function('\"use strict\";return(' + func + ')')();\n }\n\n $(self).removeClass('fv-error').addClass('fv-success');\n if($(self).siblings('.fv-error-message').length > 0) {\n var id = $(self).attr('data-fvid');\n $('small[data-fvid=\"'+id+'\"]').remove();\n $(self).removeAttr('data-fvid');\n }\n $(self).closest('form').find('input[type=\"submit\"]').prop('disabled', false);\n } else {\n self.error = false;\n }\n }", "function doShowSuccess(message){\n $('#olShowSuccess').find('div#showSuccess').remove();\n var html = '<div class=\"alert alert-default valider alertWidth\" id=\"showSuccess\" role=\"alert\">' +\n '<span class=\"fa fa-exclamation-triangle\" aria-hidden=\"true\"></span>' +\n '<span class=\"sr-only\">Error:</span></div>';\n $('#olShowSuccess').prepend(html);\n $('#showSuccess').html('');\n $('#showSuccess').append(message);\n $('#showSuccess').fadeIn();\n setTimeout(function(){ $('#showSuccess').fadeOut(); }, 5000);\n}", "function sentSuccess(){\n //User denied action\n swal({\n title: \"Transaction Successful!\",\n text: \"Reloading Data\",\n type: \"success\",\n timer: 3000,\n showConfirmButton: false\n });\n\n }", "function loading_show(){\n $('#loading').html(\"<img src='../assets/img/loading.gif'/>\").fadeIn('fast');\n }", "function callback() {\r\n setTimeout(function () {\r\n $(\"#effect\").removeAttr(\"style\").hide().fadeIn();\r\n }, 1000);\r\n }", "function callback() {\r\n setTimeout(function () {\r\n $(\"#effect\").removeAttr(\"style\").hide().fadeIn();\r\n }, 1000);\r\n }", "function showSuccess() {\n transitionSteps(getCurrentStep(), $('.demo-success'));\n }" ]
[ "0.68984556", "0.6705069", "0.6659334", "0.664806", "0.6635045", "0.66007245", "0.6485719", "0.64496183", "0.6443553", "0.6421428", "0.638331", "0.63638717", "0.63483256", "0.6344242", "0.6341263", "0.6251685", "0.62480515", "0.62372655", "0.6221893", "0.6216189", "0.61609465", "0.61581653", "0.61564416", "0.6141739", "0.6131057", "0.6125492", "0.6119379", "0.61043906", "0.6074619", "0.6056805", "0.6040265", "0.6038607", "0.6023776", "0.6023603", "0.60184926", "0.6007598", "0.59957206", "0.5989288", "0.59736437", "0.5967465", "0.5964133", "0.5962687", "0.5952776", "0.5949438", "0.59437335", "0.59393203", "0.5936015", "0.5923003", "0.59164894", "0.59153825", "0.5914663", "0.59017", "0.5896447", "0.58884895", "0.58867306", "0.5880182", "0.58767277", "0.5873772", "0.5872256", "0.585527", "0.58506614", "0.5842873", "0.5840302", "0.58376473", "0.5833587", "0.5832942", "0.5814713", "0.58102006", "0.5807549", "0.57997453", "0.5798856", "0.57978445", "0.5794547", "0.57896096", "0.57886183", "0.5787524", "0.5786328", "0.5785929", "0.57790345", "0.5776149", "0.57725936", "0.57725936", "0.57648903", "0.57608527", "0.5756093", "0.5749784", "0.5747869", "0.5745109", "0.5744058", "0.57426035", "0.5741541", "0.57381743", "0.5737657", "0.57361585", "0.5735889", "0.5735634", "0.57297134", "0.57279587", "0.57279587", "0.57259285" ]
0.80628824
0
Called after loading forms from db
function postFormLoad(requestedDate) { $(".tables").fadeIn(function() { var length = Patient2Date[global_patientInfo.currentPatient].length; var index = length - Patient2Date[global_patientInfo.currentPatient].indexOf(requestedDate.toString()) - 1; var scroll = document.getElementById('Forms').scrollWidth/length * index; $(".forms").animate({ scrollLeft: 0}, 0); $(".forms").animate({ scrollLeft: scroll}, 400); }); $('html, body').animate({ scrollTop: $("#BreakOne").offset().top }, 400); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _qForm_loadFields(){\n\tvar strPackage = _getCookie(\"qForm_\" + this._name + \"_\" + _c_strName);\n\t// there is no form saved\n\tif( strPackage == null ) return false;\n\n\tthis.setFields(_readCookiePackage(strPackage), null, true);\n}", "function loadExistingFormValues() {\n\n // lesion has been found, load data and fill out form\n if( meCompletedLesions[meCurrentLesion] ) {\n\tloadExistingQuestion4();\n\tloadExistingQuestion5();\n\tloadExistingQuestion6();\n\tloadExistingQuestion7();\n\tloadExistingQuestion8();\n\tloadExistingQuestion9();\n\tloadExistingQuestion10();\n loadExistingQuestion11();\n loadExistingComment();\n showSaveButton();\n }\n}", "function initForm(){\n\t\tsetActions();\n\t\tvalidateForm();\n\t}", "function onFormRestored(err) {\n if (err) {\n // form event with empty response prevents server zombie on error\n Y.log( 'Could not load or create form document: ' + err, 'warn', NAME );\n template.raise( 'mapcomplete', {} );\n return;\n }\n\n Y.log('Form state initialized, redrawing in mode: ' + template.mode, 'debug', NAME);\n template.render( onTemplateRendered );\n }", "function eventDSEditOnLoad() {\n var form = EventEditForm.getForm();\n form.setValues(eventDS.getAt(0).data);\n}", "function user_form_onload(){\n\tif (myTabsFrame.selectedTabName == 'page4b') {\n\t\tvar grid = Ab.view.View.getControl('', 'fields_grid');\n\t\tif (grid) {\n\t\t\t// override default filter listener to check previously selected fields\n\t\t\tgrid.filterListener = checkFieldsFilter;\n\n\t\t\t// override default clearFilter listener to check previously selected fields\n\t\t\tgrid.clearFilterListener = checkFieldsClearFilter;\n\t\t\t\n\t\t\t// override default selectAllRowsSelected function\n\t\t\tgrid.setAllRowsSelected = function (selected){\n\t\t\t\t\n\t\t\t\t// reset the summary panel to avoid adding duplicate fields\n\t\t\t\tvar table = document.getElementById(\"selectedFields\");\n\t\t\t\tvar tBody = table.tBodies[0];\n\t\t\t\tremoveExistingRows(tBody);\n\t\t\n\t\t\t\tvar setSelectedTrue = ((typeof selected == 'undefined') || selected == true) ? true : false;\n\t\t\t\tvar selectedRows = new Array();\t\t\t\t\n\t\t\t\tvar dataRows = this.getDataRows();\n\t\t\t\t\n\t\t\t\tfor (var r = 0; r < dataRows.length; r++) {\n\t\t\t\t\tvar dataRow = dataRows[r];\n\t\t\t\t\t\n\t\t\t\t\tvar selectionCheckbox = dataRow.firstChild.firstChild;\n\t\t\t\t\t\n\t\t\t\t\tif (typeof selectionCheckbox.checked != 'undefined') {\n\t\t\t\t\t\tselectionCheckbox.checked = setSelectedTrue;\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t// add or remove selected field from view object\n\t\t\t\t\t\tonCheck(this.rows[r]);\n\t\t\t\t\t\tselectedRows.push(this.rows[r]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn selectedRows;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif (myTabsFrame.selectedTabName == 'page4d') {\n\t\tvar grid = Ab.view.View.getControl('', 'field_grid');\n\t\tif (grid) {\n\t\t\tgrid.enableSelectAll(false);\n\t\t\t\n\t\t\t// override default index listener to check previously selected fields\n\t\t\tgrid.indexListener = checkStandardsIndex;\n\n\t\t\t// override default filter listener to check previously selected fields\n\t\t\tgrid.filterListener = checkStandardsFilter;\n\n\t\t\t// override default clearFilter listener to check previously selected fields\n\t\t\tgrid.clearFilterListener = checkStandardsClearFilter;\n\t\t\t\t\t\t\t\t\t\n\t\t\t// override, default onMultipleSelectionChange\n\t\t\tgrid.addEventListener('onMultipleSelectionChange', function(row){\n\t\t\t\tsaveStandards(row);\n\t\t\t});\n\t\t\t\n\t\t\t// show filter\n\t\t\tgrid.isCollapsed = false;\n\t\t\tgrid.showIndexAndFilter();\n\t\t}\n\t}\n}", "function initForms () {\n selectize.initSelectize()\n forms.initDefaultForm()\n comment.initCommentForm()\n tutorial.initTutorialForm()\n}", "function initializeForm() {\n editor.afform = editor.data.definition;\n if (!editor.afform) {\n alert('Error: unknown form');\n }\n if (editor.mode === 'clone') {\n delete editor.afform.name;\n delete editor.afform.server_route;\n editor.afform.is_dashlet = false;\n editor.afform.title += ' ' + ts('(copy)');\n }\n $scope.canvasTab = 'layout';\n $scope.layoutHtml = '';\n editor.layout = {'#children': []};\n $scope.entities = {};\n\n if (editor.getFormType() === 'form') {\n editor.allowEntityConfig = true;\n editor.layout['#children'] = afGui.findRecursive(editor.afform.layout, {'#tag': 'af-form'})[0]['#children'];\n $scope.entities = _.mapValues(afGui.findRecursive(editor.layout['#children'], {'#tag': 'af-entity'}, 'name'), backfillEntityDefaults);\n\n if (editor.mode === 'create') {\n editor.addEntity(editor.entity);\n editor.afform.create_submission = true;\n editor.layout['#children'].push(afGui.meta.elements.submit.element);\n }\n }\n\n else if (editor.getFormType() === 'block') {\n editor.layout['#children'] = editor.afform.layout;\n editor.blockEntity = editor.afform.join_entity || editor.afform.entity_type;\n $scope.entities[editor.blockEntity] = backfillEntityDefaults({\n type: editor.blockEntity,\n name: editor.blockEntity,\n label: afGui.getEntity(editor.blockEntity).label\n });\n }\n\n else if (editor.getFormType() === 'search') {\n editor.layout['#children'] = afGui.findRecursive(editor.afform.layout, {'af-fieldset': ''})[0]['#children'];\n editor.searchDisplay = afGui.findRecursive(editor.layout['#children'], function(item) {\n return item['#tag'] && item['#tag'].indexOf('crm-search-display-') === 0;\n })[0];\n editor.searchFilters = getSearchFilterOptions();\n }\n\n // Set changesSaved to true on initial load, false thereafter whenever changes are made to the model\n $scope.changesSaved = editor.mode === 'edit' ? 1 : false;\n $scope.$watch('editor.afform', function () {\n $scope.changesSaved = $scope.changesSaved === 1;\n }, true);\n }", "function loadAndReset() {\n\n resetForm();\n\n showRecords();\n \n}", "function formLoad() {\n setFormElementsFromRdb();\n\n // Update derived radio button elements\n if ($(\"#id_enabled\").val() == '1') {\n $(\"#enabledButton_0\").attr(\"checked\", \"checked\");\n } else {\n $(\"#enabledButton_1\").attr(\"checked\", \"checked\");\n }\n\n displayInstalledFiles(cbqFiles);\n}", "function init_inpt_formulario_cargar_recorrido() {\n // Inputs del formulario para inicializar\n}", "function loadPreviousElementSeedForm() {\n currentState = \"ElementSeedForm\";\n elementSeedIndex -= 1;\n if (elementSeedIndex == -1) loadTerrainModificationSelectionForm();else if (elementSeedForms[elementSeedIndex].selected) loadElementSeedForm();else loadPreviousElementSeedForm();\n}", "function initCustomForms() {\n\t\tjcf.replaceAll();\n\t}", "loadForm() {\n const fieldModel = this.fieldModel;\n\n // Generate a DOM-compatible ID for the form container DOM element.\n const id = `quickedit-form-for-${fieldModel.id.replace(\n /[/[\\]]/g,\n '_',\n )}`;\n\n // Render form container.\n const $formContainer = $(\n Drupal.theme('quickeditFormContainer', {\n id,\n loadingMsg: Drupal.t('Loading…'),\n }),\n );\n this.$formContainer = $formContainer;\n $formContainer\n .find('.quickedit-form')\n .addClass(\n 'quickedit-editable quickedit-highlighted quickedit-editing',\n )\n .attr('role', 'dialog');\n\n // Insert form container in DOM.\n if (this.$el.css('display') === 'inline') {\n $formContainer.prependTo(this.$el.offsetParent());\n // Position the form container to render on top of the field's element.\n const pos = this.$el.position();\n $formContainer.css('left', pos.left).css('top', pos.top);\n } else {\n $formContainer.insertBefore(this.$el);\n }\n\n // Load form, insert it into the form container and attach event handlers.\n const formOptions = {\n fieldID: fieldModel.get('fieldID'),\n $el: this.$el,\n nocssjs: false,\n // Reset an existing entry for this entity in the PrivateTempStore (if\n // any) when loading the field. Logically speaking, this should happen\n // in a separate request because this is an entity-level operation, not\n // a field-level operation. But that would require an additional\n // request, that might not even be necessary: it is only when a user\n // loads a first changed field for an entity that this needs to happen:\n // precisely now!\n reset: !fieldModel.get('entity').get('inTempStore'),\n };\n Drupal.quickedit.util.form.load(formOptions, (form, ajax) => {\n Drupal.AjaxCommands.prototype.insert(ajax, {\n data: form,\n selector: `#${id} .placeholder`,\n });\n\n $formContainer\n .on('formUpdated.quickedit', ':input', (event) => {\n const state = fieldModel.get('state');\n // If the form is in an invalid state, it will persist on the page.\n // Set the field to activating so that the user can correct the\n // invalid value.\n if (state === 'invalid') {\n fieldModel.set('state', 'activating');\n }\n // Otherwise assume that the fieldModel is in a candidate state and\n // set it to changed on formUpdate.\n else {\n fieldModel.set('state', 'changed');\n }\n })\n .on('keypress.quickedit', 'input', (event) => {\n if (event.keyCode === 13) {\n return false;\n }\n });\n\n // The in-place editor has loaded; change state to 'active'.\n fieldModel.set('state', 'active');\n });\n }", "function NewEntryForm() {\n $(\"#addCancel\").click(this.clearForm);\n $(\"#addButton\").click(this.submitForm);\n }", "function on_form_loaded() {\n Survana.Storage.Get(context, function (result) {\n context = result;\n context.current |= 0; //convert 'current' to a number\n set_progress(context.current, context.workflow.length);\n }, on_storage_error);\n }", "function loadPreviousAnomalyForm() {\n currentState = \"AnomalyForm\";\n anomalyIndex -= 1;\n if (anomalyIndex == -1) loadPreviousTerrainModificationForm();else if (anomalyForms[anomalyIndex][\"selected\"]) loadAnomalyForm();else loadPreviousAnomalyForm();\n}", "function initializePage() {\n \t$('#editEmailForm').submit(editEmailListener);\n \t$('#editPasswordForm').submit(editPasswordListener);\n \t$('#editAddressForm').submit(editAddressListener);\n \t$('#editZipForm').submit(editZipListener);\n \t$('#editAboutMeForm').submit(editAboutMeListener);\n }", "function loadCreationForm() {\n /* Cacher le formulaire qui est déjà affiché, s'il y a lieu */\n $(\"#updateProjetForm\").hide(\"slide\", {direction: \"right\"}, 500);\n /* Afficher creationForm*/\n $(\"#creerProjetForm\").toggle(\"slide\", {direction: \"right\"}, 500);\n $(\"#creerProjetForm\").focus();\n}", "formChanged() {}", "function loadForm(company) {\n\n if (isSuperUser) {\n // Load the master roles \n loadMasterRolesByCompany(localCompany.CompanyID, populateMasterRoles, errorHandler);\n\n }\n else {\n // Load the master roles \n loadMasterRoles(populateMasterRoles, errorHandler);\n\n }\n }", "resetFormContent() {\n ContentUtils.updateElementContent(\"delimiter\", \"?\");\n ContentUtils.updateElementContent(\"hasHeaderRow\", \"?\");\n ContentUtils.updateElementContent(\"fileSize\", 0);\n ContentUtils.updateElementContent(\"totalRecords\", 0);\n ContentUtils.updateElementContent(\"badRecords\", 0);\n ContentUtils.updateElementContent(\"inputCsvTable\", \"\");\n ContentUtils.updateElementContent(\"badCsvTable\", \"\");\n ContentUtils.updateElementContent(\"interpolatedCsvTable\", \"\");\n ContentUtils.updateElementContent(\"invalidData\", \"\");\n }", "function initializeUI()\r\n{\r\n var elts;\r\n\r\n _RecordsetName.initializeUI();\r\n _MasterPageFields.initializeUI();\r\n _LinkField.initializeUI();\r\n _UniqueKeyField.initializeUI();\r\n _NumRecs.initializeUI();\r\n _DetailPageName.initializeUI();\r\n _DetailPageFields.initializeUI();\r\n _Numeric.initializeUI();\r\n\r\n elts = document.forms[0].elements;\r\n if (elts && elts.length)\r\n elts[0].focus();\r\n}", "function loadCreatingCourseForm(){\n\t\t$(\".create_course_open_modal\").click(function(){\n\t\t\t$(\"#course_editing_modal\").empty();\n\t\t\t$(\"#course_creating_modal\").load(\"../Tab_Course/course_create.php\", function(){\n\t\t\t\tadd_prereq();\n\t\t\t\tremoveAddedPrereq();\n\t\t\t\tclickPrereqSearch();\n\t\t\t\tcreationConfirmation();\n\t\t\t});\n\t\t});\n\t}", "function populateJs2Form(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('maeEstatProduFrm.accion'), \n\t\tget('maeEstatProduFrm.origen'));\n\n\n\tset('maeEstatProduFrm.id', jsMaeEstatProduId);\n\tset('maeEstatProduFrm.paisOidPais', [jsMaeEstatProduPaisOidPais]);\n\tset('maeEstatProduFrm.codEstaProd', jsMaeEstatProduCodEstaProd);\n\tif(mode == MMG_MODE_CREATE || mode == MMG_MODE_UPDATE_FORM){\n\t\tunbuildLocalizedString('maeEstatProduFrm', 1, jsMaeEstatProduDescripcion)\n\t\tloadLocalizationWidget('maeEstatProduFrm', 'Descripcion', 1);\n\t}else{\n\t\tset('maeEstatProduFrm.Descripcion', jsMaeEstatProduDescripcion);\t\t\n\t}\n\t\n}", "onSaving() {\n var ptr = this;\n this.formView.applyValues();\n this.record.save(function () {\n ptr.onSaved();\n });\n this.saving.raise();\n }", "function resetAddMenuItemForm(){\r\n MenuItemNameField.reset();\r\n \tMenuItemDescField.reset();\r\n // \tMenuItemValidFromField.reset();\r\n MenuItemValidToField.reset();\r\n \tMenuItemPriceField.reset();\r\n \tMenuItemTypePerField.reset();\r\n\t\t\t\t\t \r\n }", "function loadForm() {\n var $this = $(this),\n type = $this.attr('id').split('-')[2],\n opts = options[type];\n\n $.showCustomModal(\n opts.buttonText,\n opts.form,\n {\n id: 'requestWindow',\n width: 650,\n buttons: [{\n id: 'cancel',\n message: 'Cancel',\n handler: function () {\n $('#requestWindow').closeModal();\n }\n }, {\n id: 'submit',\n defaultButton: true,\n message: 'Save',\n handler: function () {\n submitForm(opts);\n }\n }],\n callback: function() {\n // Fire hook for scripts that use the form\n mw.hook('vstf.reportsform').fire();\n }\n }\n );\n }", "initalizeForm() {\n const self = this;\n\n self.annotonPresentation = self.getAnnotonPresentation(this.annoton);\n\n }", "function bindFormEvents() {\n\n\t\t// Capture enter key in form fields to move to next\n\t\t$('input').keypress(function (e) {\n if(e.which == 13) {\n if(!$(this).hasClass(\"last\")){\n e.preventDefault();\n $(\":input:eq(\" + ($(\":input\").index(this) + 1) + \")\").focus();\n }\n }\n }); \n\n\t\t// Previous link clicks\n $(\"a#previous-slice\").click(function (e) {\n \tconsole.log(\"Previous slice link clicked\");\n \te.preventDefault();\n \tvar currentSlice = getCurrentSlice();\n \tvar slices = loadSlices();\n \tloadPreviousSlice(currentSlice, slices);\n });\n\n // All done link click\n $(\"a#all-done\").click(function (e) {\n \te.preventDefault();\n \talert(\"Thanks!\");\n });\n\n // Save-but-don't-change link click\n $(\"a#save-header-no-next\").click(function (e) {\n \te.preventDefault();\n \t// Save the header details into localStorage but not the slice\n \tlocalStorage.setItem(\"header\", JSON.stringify($(\"#transcribe_form\").values()));\n \t// Don't load the next slice, stay here and reload the form\n \tloadCurrentForm(null);\n });\n\n // This is a header button click\n $(\"#is-header-button\").click(function () {\n \tloadForm(\"#header-form\", true, headerLegend, \"#header-actions\");\n });\n\n // Tooltips on focus\n // Make new tooltips\n console.log(\"making new tooltips\");\n $('input').tooltip({\n \t\ttrigger: 'focus',\n \t\ttitle: function() {\n \t\t\treturn $(this).attr(\"placeholder\");\n \t\t},\n \t\tplacement: 'top'\n \t}\n );\n\n // Trigger the tooltip on autofocussed elements\n $('input[autofocus]').trigger('focus');\n\n // Change events on the document type select elements\n console.log(\"Binding to document type change events\");\n $('select#document-type').change(filterTemplateOptions);\n\t}", "function init_config_form(){\n load_config();\n build_table();\n render_plugin_data();\n }", "function loadNextElementSeedForm() {\n currentState = \"ElementSeedForm\";\n elementSeedIndex += 1;\n if (elementSeedIndex == elementSeedForms.length) loadNextTerrainModificationForm();else if (elementSeedForms[elementSeedIndex].selected) loadElementSeedForm();else loadNextElementSeedForm();\n}", "function loadForm(company) {\n var targetUrl;\n var myOrg = new Organization();\n\n // myOrg.load(loadOrganizationList);\n loadOrganizationsByCompany(company.CompanyID, populateOrganizationList, pmmodaErrorHandler)\n// loadOrganizations(loadOrganizationList, loadOrgErrorHandler);\n\n\n if (editMode == \"new\") {\n updateReady = new $.Deferred();\n // Set the org value to -1 when the form is fully loaded\n $.when(updateReady).then(function () { setFormMode(\"new\"); });\n }\n }", "function afterAlertsLoad() {\n if (sessionStorage.getItem(\"search_all_selected_obj\") !== null) {\n var obj,\n index;\n obj = JSON.parse(sessionStorage.getItem(\"search_all_selected_obj\"));\n index = TableUtil.getTableIndexById('#tblAlerts', obj.Id);\n $(\"#tblAlerts\").bootstrapTable(\"check\", index);\n showEditDialog();\n sessionStorage.removeItem(\"search_all_selected_obj\");\n }\n }", "function initializePage_editArticle()\r\n{\r\n page_editArticle.initializeForm(page_editUserArticle);\r\n page_editArticle.initializeButton(page_deleteUserArticle);\r\n}", "function loaded() {\r\n\r\n const $loginForm = classifyForm('.login-popup');\r\n\r\n if ($loginForm.length) {\r\n registerLoginValidation($loginForm);\r\n }\r\n\r\n }", "function __initFormTable($dom) {\r\n}", "function loadHandler() {\n reject(\n 'record view form should not be loading with object api name unset'\n );\n }", "_initFormBehaviorManager() {\n FormBehaviorManager.add(GroupTable);\n FormBehaviorManager.add(UserTable);\n }", "function afterTasksLoad() {\n if (sessionStorage.getItem(\"search_all_selected_obj\") !== null) {\n var obj,\n index;\n obj = JSON.parse(sessionStorage.getItem(\"search_all_selected_obj\"));\n index = TableUtil.getTableIndexById('#tblTasks', obj.Id);\n $(\"#tblTasks\").bootstrapTable(\"check\", index);\n showEditDialog();\n sessionStorage.removeItem(\"search_all_selected_obj\");\n }\n }", "function onFormMapped(err) {\n if (err) {\n // form event with empty response prevents server zombie on error\n Y.log( 'Could not map the form from current activity: ' + err, 'warn', NAME );\n template.raise( 'mapcomplete', {} );\n return;\n }\n\n context.attachments.updateFormDoc( context, template, onFormRestored );\n }", "function setSavedState() {\n const state = JSON.parse(localStorage.getItem('collecting_together_form'));\n if (state) {\n cfSelect.value = state.cf ? state.cf : '';\n gfSelect.value = state.gf ? state.gf : '';\n mfSelect.value = state.mf ? state.mf : '';\n amSelect.value = state.am ? state.am : '';\n }\n }", "function productFormLoaded() {\n var form = $(PRODUCT_FORM_SEL)[0];\n\n if (!form || form.dataset.hss_setup) {\n return;\n }\n form.dataset.hss_setup = 'true';\n\n var formItems = $('.form-item.field', form);\n formItems = [].slice.call(formItems);\n\n formItems.forEach(function (formItem) {\n var label = $('label.title', formItem)[0];\n\n if (!label) {\n return;\n }\n\n if (isClothColorLabel(label)) {\n setupClothColorField(formItem);\n }\n else if (isLogoArtworkLabel(label)) {\n setupLogoArtworkField(formItem);\n }\n });\n\n var submitProductForm = $(SUBMIT_PRODUCT_FORM_BUTTON_SEL, form)[0];\n\n if (submitProductForm) {\n submitProductForm.addEventListener('click', submitProductFormClicked);\n }\n}", "function afterOrdersLoad() {\r\n $(userEditing());\r\n $(adminRejecting());\r\n $(checkRejection());\r\n $(checkRejectedChanges());\r\n }", "function populateJs2Form(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('segPaisViewFrm.accion'), \n\t\tget('segPaisViewFrm.origen'));\n\n\n\tset('segPaisViewFrm.id', jsSegPaisViewId);\n\tset('segPaisViewFrm.codPais', jsSegPaisViewCodPais);\n\tset('segPaisViewFrm.moneOidMone', [jsSegPaisViewMoneOidMone]);\n\tset('segPaisViewFrm.moneOidMoneAlt', [jsSegPaisViewMoneOidMoneAlt]);\n\tif(mode == MMG_MODE_CREATE || mode == MMG_MODE_UPDATE_FORM){\n\t\tunbuildLocalizedString('segPaisViewFrm', 1, jsSegPaisViewDescripcion)\n\t\tloadLocalizationWidget('segPaisViewFrm', 'Descripcion', 1);\n\t}else{\n\t\tset('segPaisViewFrm.Descripcion', jsSegPaisViewDescripcion);\t\t\n\t}\n\tset('segPaisViewFrm.indInteGis', [jsSegPaisViewIndInteGis]);\n\tset('segPaisViewFrm.valIden', [jsSegPaisViewValIden]);\n\tset('segPaisViewFrm.indSaldUnic', jsSegPaisViewIndSaldUnic);\n\tset('segPaisViewFrm.valProgEjec', jsSegPaisViewValProgEjec);\n\tset('segPaisViewFrm.valPorcAlar', jsSegPaisViewValPorcAlar);\n\tset('segPaisViewFrm.indCompAuto', jsSegPaisViewIndCompAuto);\n\tset('segPaisViewFrm.numDiasMora', jsSegPaisViewNumDiasMora);\n\tset('segPaisViewFrm.indTratAcumDesc', jsSegPaisViewIndTratAcumDesc);\n\tset('segPaisViewFrm.valTiemRezo', jsSegPaisViewValTiemRezo);\n\tset('segPaisViewFrm.valConfSecuCcc', [jsSegPaisViewValConfSecuCcc]);\n\tset('segPaisViewFrm.numDiasFact', jsSegPaisViewNumDiasFact);\n\tset('segPaisViewFrm.numLimiDifePago', jsSegPaisViewNumLimiDifePago);\n\tset('segPaisViewFrm.indEmisVenc', jsSegPaisViewIndEmisVenc);\n\tset('segPaisViewFrm.valMaxiDifeAnlsComb', jsSegPaisViewValMaxiDifeAnlsComb);\n\tset('segPaisViewFrm.numPosiNumeClie', jsSegPaisViewNumPosiNumeClie);\n\tset('segPaisViewFrm.valFormFech', [jsSegPaisViewValFormFech]);\n\tset('segPaisViewFrm.valSepaMile', [jsSegPaisViewValSepaMile]);\n\tset('segPaisViewFrm.valSepaDeci', [jsSegPaisViewValSepaDeci]);\n\tset('segPaisViewFrm.numPeriEgre', jsSegPaisViewNumPeriEgre);\n\tset('segPaisViewFrm.numPeriReti', jsSegPaisViewNumPeriReti);\n\tset('segPaisViewFrm.fopaOidFormPago', [jsSegPaisViewFopaOidFormPago]);\n\tset('segPaisViewFrm.valCompTele', jsSegPaisViewValCompTele);\n\tset('segPaisViewFrm.indFletZonaUbig', [jsSegPaisViewIndFletZonaUbig]);\n\tset('segPaisViewFrm.valIndiSecuMoni', jsSegPaisViewValIndiSecuMoni);\n\tset('segPaisViewFrm.indSecu', [jsSegPaisViewIndSecu]);\n\tset('segPaisViewFrm.indBalaAreaCheq', [jsSegPaisViewIndBalaAreaCheq]);\n\tset('segPaisViewFrm.valUrl', jsSegPaisViewValUrl);\n\t\n}", "function user_form_afterSelect(){\n // disable \"Save\" and \"Publish\" parent tabs if not alter view wizard.\n if (!isAlterWizard()) {\n tabsFrame.setTabEnabled(\"page6\", false);\n tabsFrame.setTabEnabled(\"page7\", false);\n\n \tif((myTabsFrame.selectedTabName == 'page4a')){\n\t\tvar view = tabsFrame.newView;\n \t\tif(!view.hasOwnProperty('actionProperties')){\n \t\t\tvar actionProperty = new Object();\t\n \t\t\tview.actionProperties = [actionProperty,actionProperty,actionProperty];\n \t\t\ttabsFrame.newView = view;\n\t\t}\n \t}\n\n }\n else {\n // hide \"Add Standard\" tab if alter view wizard.\n myTabsFrame.hideTab('page4d', true);\n }\n\t\n var viewType = tabsFrame.typeRestriction;\n var view = tabsFrame.newView;\n pattern = tabsFrame.patternRestriction;\n\tnumberOfTblgrps = Number(tabsFrame.tablegroupsRestriction);\n\tbIsPaginatedHighlight = pattern.match(/paginated-highlight/gi);\n\tbIsPaginatedHighlightThematic = pattern.match(/paginated-highlight-thematic/gi);\n\tbIsPaginatedHighlightRestriction = pattern.match(/paginated-highlight-restriction/gi);\n\tif (bIsPaginatedHighlightRestriction && (tabsFrame.selectedTableGroup == 2) && (tabsFrame.fileToConvert == null)){\n\t\tbSetPaginatedRestrictionLegend = true;\n\t}\n\n\tif (bIsPaginatedHighlightThematic && (tabsFrame.selectedTableGroup == 2) && (tabsFrame.fileToConvert == null)){\n\t\tbSetPaginatedThematicLegend = true;\n\t}\n\t\t\t\t\n // warn if no pattern was selected\n if ((tabsFrame.patternRestriction == undefined) || (tabsFrame.patternRestriction == \"\")) {\n alert(getMessage('noPattern'));\n tabsFrame.selectTab('page2');\n }\n else \n if (view.tableGroups.length == 0) {\n // warn if no tablegroups were selected\n alert(getMessage('noTables'));\n tabsFrame.selectTab('page3');\n }\n else {\n \n // setup display of view depending upon which tab was selected\n switch (myTabsFrame.selectedTabName) {\n \n case \"page4a\":\n \n // if \"View Summary\" tab was selected\n var summaryPanel = Ab.view.View.getControl('', 'tgFrame_page4a');\n if (summaryPanel) {\n \n // explicitly display the button and status rows for the owner2 and owner tablegroups\n $('drill2Checklist').style.display = \"\";\n $('drillChecklist').style.display = \"\";\n $('drill2Characteristics').style.display = \"\";\n $('drillCharacteristics').style.display = \"\";\n \n // explicitly reset the title\n $('viewTitle').value = getMessage('viewTitleText');\n \n // show button text (for localization)\n var buttonArr = [\"selectFields\", \"setSortOrder\", \"addStandard\", \"setRestriction\", \"setOptions\"];\n for (var i = 0; i < buttonArr.length; i++) {\n\t\t\t\t\t\t\tdocument.getElementById('setSortOrder0')\n $(buttonArr[i] + \"0\").value = getMessage(buttonArr[i]);\n $(buttonArr[i] + \"1\").value = getMessage(buttonArr[i]);\n $(buttonArr[i] + \"2\").value = getMessage(buttonArr[i]);\n }\n \n // clear any restrictions\n tabsFrame.restriction = null;\n \n // get the view title from view object and display\n var title = view.title;\n if (title != undefined) {\n $('viewTitle').value = replaceXMLAmp(title);\n }\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (pattern.match(/paginated-highlight/gi)){\n\t\t\t\t\t\t\t$('drawingOptions').style.display = \"\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// hide sort, restriction, and options for label datasource\n\t\t\t\t\t\t\t$('drillSrt').style.display = \"none\";\n\t\t\t\t\t\t\t$('drillRst').style.display = \"none\";\n\t\t\t\t\t\t\t$('drillOpt').style.display = \"none\";\n\t\t\t\t\t\t\t$('setSortOrder1').style.display = \"none\";\n\t\t\t\t\t\t\t$('setRestriction1').style.display = \"none\";\n\t\t\t\t\t\t\t$('setOptions1').style.display = \"none\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$('drawingOptions').style.display = \"none\";\t\n\t\t\t\t\t\t\t$('drillSrt').style.display = \"\";\n\t\t\t\t\t\t\t$('drillRst').style.display = \"\";\n\t\t\t\t\t\t\t$('drillOpt').style.display = \"\";\t\n\t\t\t\t\t\t\t$('setSortOrder1').style.display = \"\";\n\t\t\t\t\t\t\t$('setRestriction1').style.display = \"\";\n\t\t\t\t\t\t\t$('setOptions1').style.display = \"\";\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\tif (pattern.match(/paginated-highlight-thematic/gi)) {\n\t\t\t\t\t\t\t$('drill2Opt').style.display = \"none\";\n\t\t\t\t\t\t\t$('setOptions2').style.display = \"none\";\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else{\n\t\t\t\t\t\t\t$('drill2Opt').style.display = \"\";\n\t\t\t\t\t\t\t$('setOptions2').style.display = \"\";\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\n /* \n // if this is summary report, set the tab title and button to \"Set Grouping\"\n if ((viewType == 'summaryReports') || (pattern.match(/paginated/gi) && hasSummarizeBySortOrder(view.tableGroups[index]))) {\n $('setSortOrder' + index).value = getMessage(\"setGrouping\");\n myTabsFrame.setTabTitle('page4c', getMessage(\"setGrouping\"));\n }\n else {\n \n // otherwise, set the tab title and button to \"Set Sort Order\"\n $('setSortOrder' + index).value = getMessage(\"setSortOrder\");\n myTabsFrame.setTabTitle('page4c', getMessage(\"selectSortOrder\"));\n }\n */ \n // restrict options according to the number of tablegroups available\n switch (numberOfTblgrps) {\n case 1:\n \n // if one tablegroup was selected, hide the owner and owner2 rows (both buttons and status rows)\n $('drill2Checklist').style.display = \"none\";\n $('drillChecklist').style.display = \"none\";\n $('drill2Characteristics').style.display = \"none\";\n $('drillCharacteristics').style.display = \"none\";\n \n // fill in the table name in input box\n $('dataTable').value = tabsFrame.datagrpRestriction;\n \n // update the status for each characteristic (Required, Optional, or Checked)\n markCheckList('data', view.tableGroups[0]);\n \n // if table empty warn and navigate to \"Select Data\" tab\n if ($('dataTable').value == \"\") {\n alert(getMessage(\"noTables\"));\n tabsFrame.selectTab(\"page3\");\n }\n break;\n \n case 2:\n \n // if two tablegroups were selected, hide the owner row (both buttons and status rows)\n $('drill2Checklist').style.display = \"none\";\n $('drill2Characteristics').style.display = \"none\";\n \n // fill in the table names of each tablegroup\n $('dataTable').value = tabsFrame.datagrpRestriction;\n $('drillDownTable').value = tabsFrame.ownergrpRestriction;\n \n // update the status for each characteristic (Required, Optional, or Checked)\n markCheckList(\"data\", view.tableGroups[1]);\n markCheckList(\"drill\", view.tableGroups[0]);\n \n // warn if table were not selected and navigate to \"Select Data\" tab\n if (($('drillDownTable').value == '') || ($('dataTable').value == '')) {\n alert(getMessage('noTables'));\n tabsFrame.selectTab('page3');\n }\n \n break;\n \n case 3:\n \n\t\t\t\t\t\t\t\t// display appropriate table labels\n\t\t\t\t\t\t\t\tif (pattern.match(/paginated-highlight/gi)){\n\t\t\t\t\t\t\t\t\t$('drillDown2Title').innerHTML = getMessage('highlightTable');\t\n\t\t\t\t\t\t\t\t\t$('drillDownTitle').innerHTML = getMessage('labelTable');\t\n\t\t\t\t\t\t\t\t\t$('dataTitle').innerHTML = getMessage('legendTable');\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tvar bSyncLegend = $('syncLegendCheckBox').checked;\n\t\t\t\t\t\t\t\t\tif (bSyncLegend == true){\n\t\t\t\t\t\t\t\t\t\tcopyDataBand(view);\n\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$('drillDown2Title').innerHTML = getMessage('drillDown2Table');\t\n\t\t\t\t\t\t\t\t\t$('drillDownTitle').innerHTML = getMessage('drillDownTable');\t\n\t\t\t\t\t\t\t\t\t$('dataTitle').innerHTML = getMessage('dataTable');\t\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 three tablegroups were selected, fill in the table names\n $('dataTable').value = tabsFrame.datagrpRestriction;\n $('drillDownTable').value = tabsFrame.ownergrpRestriction;\n $('drillDownTable2').value = tabsFrame.owner2grpRestriction;\n \n // update the status for each characteristic (Required, Optional, or Checked)\n markCheckList(\"data\", view.tableGroups[2]);\n markCheckList(\"drill\", view.tableGroups[1]);\n markCheckList(\"drill2\", view.tableGroups[0]);\n \n // if no table was selected, warn and navigate back to \"Select Data\" tab\n if (($('drillDownTable').value == '') || ($('dataTable').value == '') || ($('drillDownTable2').value == '')) {\n alert(getMessage('noTables'));\n tabsFrame.selectTab('page3');\n }\n break;\n }\n }\n break;\n \n case \"page4b\":\n // if \"Select Fields\" tab was selected\n showAddVFButton();\n\n\t\t\t\t\tvar numberOfTgrps = view.tableGroups.length;\n\t\t\t\t\t// find the index\n\t\t\t\t\tvar index = numberOfTgrps - tabsFrame.selectedTableGroup - 1;\n\t\t\t\t\t// show/hide parameters restriction based on pattern and which tablegroup\n\t\t\t\t\tif (pattern.match(/paginated-parent/gi) && (index < (numberOfTgrps - 1))){\n\t\t\t\t\t\t$('restrictionParameterColumn').style.display = \"\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$('restrictionParameterColumn').style.display = \"none\";\t\n\t\t\t\t\t}\n\n\t\t\t\t\tif (pattern.match(/editform/gi) && (index == (numberOfTblgrps - 1))){\n\t\t\t\t\t\t$('showSelectValueActionColumn').style.display = \"\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$('showSelectValueActionColumn').style.display = \"none\";\t\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n // reset summary table\n resetTable('selectedFields');\n \n var table = $('selectedFields');\n var tBody = table.tBodies[0];\n \n // get the table name from the passed in restriction, if there is one\n if (tabsFrame.restriction.clauses) {\n var table_name = tabsFrame.restriction.clauses[0].value;\n }\n \n // array of field properties \n //var fieldsList = [\"field_name\", \"ml_heading\", \"data_type\", \"afm_type\", \"primary_key\", \"table_name\"];\n var fieldsList = [\"field_name\", \"ml_heading\", \"data_type\", \"afm_type\", \"primary_key\", \"table_name\", \"ml_heading_english\"];\n \n // find the main table based on index\n var main_table = view.tableGroups[index].tables[0].table_name;\n \n // show only fields that pertain to the main table of the tablegroup\n if (main_table == tabsFrame.restriction.clauses[0].value) {\n var fields = view.tableGroups[index].fields;\n }\n \n // set restriction on grid to show only fields with selected table name\n setRestrictionOnGrid();\n \n // check check boxes for selected fields\n checkBoxesForSelectedFields();\n\n\t\t\t\t\t// auto-pkey: highlight primary keys for restriction drawing or paginated-parent reports\n\t\t\t\t\tif ( pattern.match(/ab-viewdef-report|edit|columnreport/gi) || pattern == 'ab-viewdef-paginated' || (pattern.match(/highlight-restriction/gi) && ((index == 0) || (index == 2))) || pattern.match(/paginated-parent/gi)){\n\t\t\t\t\t\tif ((fields == undefined) || fields == '') {\n\t\t\t\t\t\t\tcheckPKeysAsDefaults();\n\t\t\t\t\t\t\t// highlightPKeyRows();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// if paginated parent (not a child tablegroup), set restriction parameters on primary keys as default\n\t\t\t\t\t\t\tif (isPaginatedParent()){\n\t\t\t\t\t\t\t\tsetPKeysAsRestrictionParams();\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\t\t\t\t\t\t\n\t\t\t\t\tvar status = 'none';\t\t\t\t\t\n\t\t\t\t\tif (pattern.match(/paginated-parent/gi) && (index < (numberOfTblgrps - 1))){\n\t\t\t\t\t\tstatus = '';\t\n\t\t\t\t\t}\n\t \n // create the summary table\n if (fields != undefined) {\n for (m = 0; m < fields.length; m++) {\n \n // create the row and give it an id\n var new_tr = document.createElement('tr');\n new_tr.id = \"row\" + m;\n \n // get field object\n var fldObj = fields[m];\n new_tr.ml_heading_english = fldObj['ml_heading_english'];\n if(valueExistsNotEmpty(fldObj.ml_heading_english_original)){\n \tnew_tr.ml_heading_english_original = fldObj['ml_heading_english_original'];\n }\n if(valueExistsNotEmpty(fldObj.rowspan)){\n \tnew_tr.rowspan = fldObj['rowspan'];\n }\n if(valueExistsNotEmpty(fldObj.colspan)){\n \tnew_tr.colspan = fldObj['colspan'];\n } \n \n // loop through and fill in the field property values in the summary table\n for (var j = 0; j < fieldsList.length; j++) {\n var new_td = document.createElement('td');\n new_td.innerHTML = fldObj[fieldsList[j]];\n if((j > 2 ) && (fieldsList[j] == 'ml_heading_english')){\n \tnew_td.style.display = 'none';\n \tif(valueExistsNotEmpty(fldObj['ml_heading_english_original'])){\n \t\tnew_td.innerHTML = fldObj['ml_heading_english_original'];\n \t}\n }\t\n new_tr.appendChild(new_td);\n if(fldObj['is_virtual'] && fldObj['sql']){\n \tvar sql = fldObj['sql'];\n \tif(typeof(sql) == 'string'){\n \t sql = eval(\"(\" + fldObj['sql'] + \")\");\n \t}\n \tvar sqlMsg = '<b>' + getMessage('generic') + '</b> ' + sql.generic + '<br/><b>' + getMessage('oracle') + '</b> ' + sql.oracle + '<br/><b>' + getMessage('sqlServer') + '</b> ' + sql.sqlServer + '<br/><b>' + getMessage('sybase') + '</b> ' + sql.sybase;\n \tnew_td.setAttribute('ext:qtip', sqlMsg);\n \tnew_td.vf = fldObj;\n \tnew_td.sql = sql;\n }\n }\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// add restriction parameter column\n var new_td = document.createElement('td');\n\t\t\t\t\t\t\tvar id = 'td_' + fldObj.table_name + '.' + fldObj.field_name;\n\t\t\t\t\t\t\tnew_td.id = id;\n\t\t\t\t\t\t\tnew_td.style.display = status;\n\t\t\t\t\t\t\tvar temp = '<input id=\"param_' + fldObj.table_name + '.' + fldObj.field_name + '\" type=\"checkBox\" onclick=\"getFieldValues()\"';\n\t\t\t\t\t\t\tif (fldObj.hasOwnProperty('restriction_parameter') ){\t\t// for new view\n\t\t\t\t\t\t\t\tif (fldObj.restriction_parameter != '') {\n\t\t\t\t\t\t\t\t\ttemp += 'checked=\"checked\"';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttemp += '/>';\n\t\t\t\t\t\t\tnew_td.innerHTML = temp;\n new_tr.appendChild(new_td);\n\n\t\t\t\t\t\t\t// add showselectvalueaction column\n var new_td = document.createElement('td');\n\t\t\t\t\t\t\tvar id = 'td_' + fldObj.table_name + '.' + fldObj.field_name;\n\t\t\t\t\t\t\tnew_td.id = id;\t\n\n\t\t\t\t\t\t\t// show\t\t\t\t\t\t\n\t\t\t\t\t\t\tvar temp = '<input id=\"showSelectValueAction_' + fldObj.table_name + '.' + fldObj.field_name + '\" type=\"checkBox\" onclick=\"getFieldValues();showSelectVWarning(this.checked);\" value=\"true\" ';\n\t\t\t\t\t\t\tif (fldObj.hasOwnProperty('showSelectValueAction') ){\t\t// for new view\n\t\t\t\t\t\t\t\tif (fldObj.showSelectValueAction == true) {\n\t\t\t\t\t\t\t\t\ttemp += 'checked=\"checked\"';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\t\ttemp += 'style=\"';\n\t\t\t\t\t\t\tif ((fldObj['primary_key'] == 0) && pattern.match(/editform/) && (index == (numberOfTblgrps - 1))) {\n\t\t\t\t\t\t\t\ttemp += '\"/>';\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttemp += 'display:none\"></input>';\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t} \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tnew_td.innerHTML = temp;\n new_tr.appendChild(new_td);\n\t\t\t\t\t\t\t/*\n var new_td = document.createElement('td');\n\t\t\t\t\t\t\tvar id = 'td_' + fldObj.table_name + '.' + fldObj.field_name;\n\t\t\t\t\t\t\tnew_td.id = id;\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// show\t\t\t\t\t\t\n\t\t\t\t\t\t\tvar temp = '<input name=\"showSelectValueAction_' + fldObj.table_name + '.' + fldObj.field_name + '\" type=\"radio\" onclick=\"getFieldValues()\" value=\"true\" ';\n\t\t\t\t\t\t\tif (fldObj.hasOwnProperty('showSelectValueAction') ){\t\t// for new view\n\t\t\t\t\t\t\t\tif (fldObj.showSelectValueAction == true) {\n\t\t\t\t\t\t\t\t\ttemp += 'checked=\"checked\"';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\t\ttemp += 'style=\"';\n\t\t\t\t\t\t\tif ((fldObj['primary_key'] == 0) && pattern.match(/editform/) && (index == (numberOfTblgrps - 1))) {\n\t\t\t\t\t\t\t\ttemp += '\">' + getMessage('show') + '</input>&nbsp;&nbsp;';\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttemp += 'display:none\"></input>';\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\n\t\t\t\t\t\t\t// hide \n\t\t\t\t\t\t\ttemp += '<input name=\"showSelectValueAction_' + fldObj.table_name + '.' + fldObj.field_name + '\" type=\"radio\" onclick=\"getFieldValues()\" value=\"false\" ';\n\t\t\t\t\t\t\tif (fldObj.hasOwnProperty('showSelectValueAction') ){\t\t// for new view\n\t\t\t\t\t\t\t\tif (fldObj.showSelectValueAction == false) {\n\t\t\t\t\t\t\t\t\ttemp += 'checked=\"checked\"';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttemp += 'style=\"';\n\t\t\t\t\t\t\tif ((fldObj['primary_key'] == 0) && pattern.match(/editform/) && (index == (numberOfTblgrps - 1))) {\n\t\t\t\t\t\t\t\ttemp += '\">' + getMessage('hide') + '</input>';\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttemp += 'display:none\"></input>';\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\t\tnew_td.innerHTML = temp;\n new_tr.appendChild(new_td);\n\t\t\t\t\t\t\t*/\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\t\t \n // add extra column\n var new_td = document.createElement('td');\n new_td.innerHTML = fldObj['is_virtual'];\n new_td.sql = fldObj['sql'];\n new_tr.appendChild(new_td);\n \n // add the \"Remove\", \"Up\", and \"Dn\" buttons\n var new_td = document.createElement('td');\n new_td.setAttribute(\"nowrap\", \"nowrap\");\t\n createButton(\"Remove\", \"removeRow\", getMessage(\"remove\"), \"selectedFields\", new_td);\n createButton(\"Up\", \"moveUp\", getMessage(\"up\"), \"selectedFields\", new_td);\n createButton(\"Down\", \"moveDown\", getMessage(\"dn\"), \"selectedFields\", new_td);\n if(fldObj.afm_type == 'Virtual Field'){\n \tcreateButton(\"Edit\", \"editVirtualField\", getMessage(\"edit\"), \"selectedFields\", new_td); \t\n }\n new_tr.appendChild(new_td);\n \t\t\t\t\t\t\t \n // add extra column\n var new_td = document.createElement('td');\n new_tr.appendChild(new_td);\n \n // add to summary table\n tBody.appendChild(new_tr);\n }\n }\n break;\n \n case \"page4c\":\n \n // if \"Set Sort Order\" (aka \"Set Grouping\") tab was selected, create the summary table \n onLoadSortSummary();\n \n // set primary keys as default\n if(pattern.match(/ab-viewdef-report|edit/gi) && !(pattern.match(/edit/) && (index == view.tableGroups.length-1))){\n \tsetPKeysAsSortDefaults();\n }\n \n break;\n \n case \"page4d\":\n // if \"Add Standard\" was selected\n\t\t\t\t\t\t\t \n\t\t\t\t\t// only show button if drawing pattern\n\t\t\t\t\tif (pattern.match(/paginated-highlight/gi)){\n\t\t\t\t\t\t$('showOnlyHightlightsPkeys').style.display = '';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$('showOnlyHightlightsPkeys').style.display = 'none';\n\t\t\t\t\t}\n\n\t\t\t\t\t// if index had been used, reset to show top level\n var grid = Ab.view.View.getControl('', 'field_grid');\n\t\t\t\t\tgrid.enableSelectAll(false);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tif (grid.indexLevel > 0){\n\t\t\t\t\t\tgrid.indexLevel = 0;\n\t\t\t\t\t\tgrid.refresh();\n\t\t\t\t\t}\n\n\t\t\t\t\t// check checkboxes of previously selected standards\n\t\t\t\t\tcheckStandards();\n\t\t\t\t\t\n break;\n \n case \"page4e\":\n // if \"Set Restriction\" tab was selected\n \n // display button text (for localization)\n $('addButton').value = getMessage(\"add\");\n \n // set up the restriction form\n loadRestrictionForm();\n \n // get restrictions from view object\n var index = view.tableGroups.length - tabsFrame.selectedTableGroup - 1;\n var restrictions = view.tableGroups[index].parsedRestrictionClauses;\n \n // if previously selected restrictions exist, display them in a summary table\n if (restrictions != undefined) {\n resetTable('restrictionSummary');\n for (j = 0; j < restrictions.length; j++) {\n var field = restrictions[j].table_name + \".\" + restrictions[j].field_name;\n var relop = restrictions[j].relop;\n var value = restrictions[j].value;\n var op = restrictions[j].op;\n createRestrictionSummary(relop, field, op, value);\n }\n }\n \n break;\n \n case \"page4f\":\n\n\t\t\t\t\t// if \"Set Options\" tab was selected\n\t\t\t\t\tvar index = view.tableGroups.length - tabsFrame.selectedTableGroup - 1;\n\t\t\t\t\tvar summaryPanel = Ab.view.View.getControl('', 'statsOptionsPanel');\n\t\t\t\t\tvar panel_title = view.tableGroups[index].title;\n\t\t\t\t\t\n\t\t\t\t\t// display button text (for localization)\n\t\t\t\t\t$('panelTitle').value = getMessage('panelTitle');\n\t\t\t\t\t\n\t\t\t\t\t// if a panel title exists, show title\n\t\t\t\t\tif (panel_title != undefined) {\n\t\t\t\t\t\t$('panelTitle').value = replaceXMLAmp(panel_title);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tvar numberOfTblgrps = Number(tabsFrame.tablegroupsRestriction);\n\t\t\t\t\tif((pattern.match(/editform|columnreport/) && (index == (numberOfTblgrps - 1))) || (pattern.match(/editform-drilldown-console/) && (index == 0))){\n\t\t\t\t\t\t$('numberOfColumns').style.display = \"\";\t\t\t\t\t\t\t\n\t\t\t\t\t\tdisplayNumberOfColumns();\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$('numberOfColumns').style.display = \"none\";\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// get statistics and chart options panels\n\t\t\t\t\tvar statsOptionsPanel = Ab.view.View.getControl('', 'statsOptionsPanel');\n\t\t\t\t\tvar chartOptionsPanel = Ab.view.View.getControl('', 'chartOptionsPanel');\n\t\t\t\t\tvar paginatedOptionsPanel = Ab.view.View.getControl('', 'paginatedOptionsPanel');\n\t\t\t\t\tvar columnReportOptionsPanel = Ab.view.View.getControl('', 'columnReportOptionsPanel');\n\t\t\t\t\t\n\t\t\t\t\t// get list of field objects from view object\n\t\t\t\t\tvar fields = view.tableGroups[index].fields;\n\t\t\t\t\t\n\t\t\t\t\t// if fields were not selected for this tablegroup, warn and go back to summary tab\t\t\t\t\t\n\t\t\t\t\tif (fields == undefined) {\n\t\t\t\t\t\talert(getMessage(\"noFields\"));\n\t\t\t\t\t\tmyTabsFrame.selectTab('page4a');\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\n\t\t\t\t\t\t// otherwise, explicity reset/delete all rows from the summary table \n\t\t\t\t\t\tresetTable('measuresSummary');\n\n\t\t\t\t\t\t// redraw the summary table per selected tablegroup's field specifications\n\t\t\t\t\t\tcreateMeasuresSummaryTable(view, index);\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\t\t\t\t\n\t\t\t\t\t\t// check checkboxes\n\t\t\t\t\t\tmarkSelectedMeasures(view, index);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// for redisplaying\n\t\t\t\t\t\t$('measuresSummary').style.display = \"\";\n\t\t\t\t\t\t$('enableDrilldownTable').style.display = \"\";\n\t\t\t\t\t\t$('paginatedPanelOptions').style.display = \"none\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t// if paginated, hide the enable drilldown option and show the paginated options panel\n\t\t\t\t\t\tif (pattern.match(/paginated/gi)) {\t\t\t\t\t\t\n\t\t\t\t\t\t\t$('enableDrilldownTable').style.display = \"none\";\n\t\t\t\t\t\t\t$('paginatedPanelOptions').style.display = \"\";\n\t\t\t\t\t\t\tvar curTgrp = view.tableGroups[index];\n\t\t\t\t\t\t\tif (hasSummarizeBySortOrder(curTgrp) || (pattern.match(/paginated-stats-data/gi) && index == 0) ){\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$('summarizeBySortOrder').checked = true;\n\t\t\t\t\t\t\t\t// $('measuresSummary').style.display = \"\";\n\t\t\t\t\t\t\t\tshowStatisticsColumns('', '')\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$('summarizeBySortOrder').checked = false;\n\t\t\t\t\t\t\t\tshowStatisticsColumns('', 'none')\n\t\t\t\t\t\t\t\t// $('measuresSummary').style.display = \"none\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// check box as disabled\n\t\t\t\t\t\t\tif(pattern.match(/paginated-stats-data/gi) && index == 0){\n\t\t\t\t\t\t\t\t$('summarizeBySortOrder').disabled= true;\n\t\t\t\t\t\t\t\t// set property\n\t\t\t\t\t\t\t\tsetPaginatedPanelProperty('summarizeBySortOrder', 'summarizeBySortOrder');\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$('summarizeBySortOrder').disabled= false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// don't allow statistics or summarizebysortorder for drawings\n\t\t\t\t\t\t\tif(pattern.match(/paginated-highlight-restriction/gi)){\n\t\t\t\t\t\t\t\t$('summarizeBySortOrder').checked = false;\n\t\t\t\t\t\t\t\t$('measuresSummary').style.display = \"none\";\n\t\t\t\t\t\t\t\t$('summarizeBySortOrderOption').style.display = \"none\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$('measuresSummary').style.display = \"\";\n\t\t\t\t\t\t\t\t$('summarizeBySortOrderOption').style.display = \"\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(pattern.match(/highlight-restriction/gi) || pattern.match(/paginated-parent|paginated-highlight-thematic/gi) && ($('summarizeBySortOrder').checked == false)){\n\t\t\t\t\t\t\t// if(pattern.match(/paginated-parent/gi) && (index != (numberOfTblgrps-1)) && ($('summarizeBySortOrder').checked == false)){\n\t\t\t\t\t\t\t\t$('measuresSummary').style.display = \"none\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$('measuresSummary').style.display = \"\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (!curTgrp.hasOwnProperty('paginatedPanelProperties')){\n\t\t\t\t\t\t\t\tcurTgrp.paginatedPanelProperties = new Object();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar paginatedPanelProperties = curTgrp.paginatedPanelProperties;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (paginatedPanelProperties.hasOwnProperty('pageBreakBefore')) {\n\t\t\t\t\t\t\t\t$('pageBreakBefore').value = paginatedPanelProperties.pageBreakBefore;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (paginatedPanelProperties.hasOwnProperty('format')) {\n\t\t\t\t\t\t\t\tif (paginatedPanelProperties.format == 'table'){\n\t\t\t\t\t\t\t\t\t$('groupBandFormat').value = paginatedPanelProperties.format + '-';\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$('groupBandFormat').value = paginatedPanelProperties.format + '-' + paginatedPanelProperties.column;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\t} \n }\n \n // if a viewType was specified\t\t \n if (viewType != \"undefined\") {\n \n // if view is a summary report and the selected tablegroup is data tablegroup \n // if ((viewType.match(/summaryReports|paginated/gi)) && (tabsFrame.selectedTableGroup == 0)) {\n if ((viewType.match(/summaryReports/gi) && (tabsFrame.selectedTableGroup == 0)) || pattern.match(/chart-2d/gi) || (pattern.match(/paginated/gi))) { \n // if it is a statistics report, show only stats options and explicity hide chart options \n if (!pattern.match(/chart/)) {\n chartOptionsPanel.show(false);\n statsOptionsPanel.show();\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\tif (pattern.match(/paginated-highlight/gi) && (index != 2) ){\n\t\t\t\t\t\t\t\t\t// only show the statsOptionsPanel for legend data band\n \tchartOptionsPanel.show(false);\n \tstatsOptionsPanel.show(false);\n \tpaginatedOptionsPanel.show();\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n \t\telse \n \t\t*/\n\t\t\t\t\t\t\t\tif (pattern.match(/paginated/)) {\n \tchartOptionsPanel.show(false);\n \tstatsOptionsPanel.show();\n \tpaginatedOptionsPanel.show();\n \t} else {\n \tpaginatedOptionsPanel.show(false);\n \t}\n\n } \n \n else {\n // if not first tgrp in 2d chart, show both panels\n if(!(pattern.match(/summary-chart-2d/gi) && (tabsFrame.selectedTableGroup == 1))){ \n \tchartOptionsPanel.show();\n }\n statsOptionsPanel.show();\n \n\t\t\t\t\t\t\t\t// reset chart options in form\n\t\t\t\t\t\t\t\tresetChartOptions();\n\t\t\t\t\t\t\t\t\n // get chart properties\n var chartProperties = view.chartProperties;\n \n // check or uncheck \"Enable Chart Drilldown\" option based on configuration\n if (view.enableChartDrilldown == true) {\n $('drilldown').checked = true;\n }\n else {\n $('drilldown').checked = false;\n }\n \n // if chart properties have been specified\n if (chartProperties != null) {\n \n // display selected chart properties\n for (var i in chartProperties) {\n\t\t\t\t\t\t\t\t\t\tif (chartProperties.hasOwnProperty(i)) {\n\t\t\t\t\t\t\t\t\t\t\tvar propertyObj = $(i);\n\t\t\t\t\t\t\t\t\t\t\t// code for filling in properties displayed in a select box\n\t\t\t\t\t\t\t\t\t\t\tif (propertyObj.type.match(/select/)) {\n\t\t\t\t\t\t\t\t\t\t\t\tvar options = propertyObj.options;\n\t\t\t\t\t\t\t\t\t\t\t\tfor (var x = 0; x < options.length; x++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (chartProperties[i].match(options[x].value)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpropertyObj.selectedIndex = x;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t// code for displaying height and width properties which has a '%'\n\t\t\t\t\t\t\t\t\t\t\t\tvar value = chartProperties[i];\n\t\t\t\t\t\t\t\t\t\t\t\tvar strValue = String(chartProperties[i]);\n\t\t\t\t\t\t\t\t\t\t\t\tvar last_char = strValue.substring(strValue.length - 1, strValue.length);\n\t\t\t\t\t\t\t\t\t\t\t\tif ((i == 'width') || (i == 'height')) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (last_char == '%') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar temp = strValue.substring(0, value.length - 1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpropertyObj.value = Number(temp);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\telse {\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t// otherwise, just display the value as-is\n\t\t\t\t\t\t\t\t\t\t\t\t\tpropertyObj.value = value;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n }\n \n // display the autoCalculateTickSizeInterval property depending upon certain conditions\n // var autocalc = $('autoCalculateTickSizeInterval');\n // toggleRelatedProperty('autoCalculateTickSizeInterval', autocalc.options[autocalc.selectedIndex].value)\n }\n \n\t\t\t\t\t\t\t\t\t\t\t\t// show totals and counts for edit and report forms\n\t\t\t\t\t\t\t\t\t\t\t\t}else if(!hasFieldsWithSameName(view.tableGroups[index].fields) && (pattern.match(/ab-viewdef-report/) || (pattern.match(/editform/)) && (pattern.match(/editform-drilldown-popup/gi) || (index != (numberOfTblgrps-1)) ) )){\n \t statsOptionsPanel.show(true);\n \t showStatisticsColumns('', 'none');\n \t $('enableDrilldownTable').style.display = \"none\";\n }else{\n \n // if view is not a summary report or if the tableggroup is not data group, hide stats and chart options \n chartOptionsPanel.show(false);\n statsOptionsPanel.show(false);\n paginatedOptionsPanel.show(false);\n }\n }\n \n if (((viewType == 'columnReports') && (index == (numberOfTblgrps-1)))){\n \t$('columnReportSummary').style.display = '';\n \tresetTable('columnReportSummary');\n \tcreateColumnReportSummaryTable(view, index);\n } else {\n \t$('columnReportSummary').style.display = 'none';\n }\t\n \n // only show action button options for report views\n var actionsPanel = Ab.view.View.getControl('', 'actionOptionsPanel');\n actionsPanel.show( ((viewType == 'reports') || ((viewType == 'summaryReports')) && (index == (numberOfTblgrps-1))) );\n var bDataTgrp = (index == numberOfTblgrps - 1) ? true : false;\n showSelectedActionOptions(view.actionProperties[index], index, bDataTgrp);\n \n \n }\n }\n}", "function init() {\n mostrarform(false);\n listar();\n\n $(\"#formulario\").on(\"submit\", function (e) {\n guardaryeditar(e);\n })\n}", "function refreshForm() {\n loadSettings(function(settings) {\n loadForm(settings);\n });\n}", "function initializePage_editAccount()\r\n{\r\n page_editAccount.initializeForm(page_editUserAccount);\r\n page_editAccount.initializeButton(deleteAccount);\r\n}", "function loadNextAnomalyForm() {\n currentState = \"AnomalyForm\";\n anomalyIndex += 1;\n if (anomalyIndex == anomalyForms.length) loadReviewPage();else if (anomalyForms[anomalyIndex][\"selected\"]) loadAnomalyForm();else loadNextAnomalyForm();\n}", "function loadRestrictionForm(){\n var table_name = tabsFrame.restriction.clauses[0].value;\n var view = tabsFrame.newView;\n var index = view.tableGroups.length - tabsFrame.selectedTableGroup - 1;\n \n // Find the array of fields\n if (view.tableGroups[index].tables[0].table_name == table_name) {\n var fields = view.tableGroups[index].fields;\n }\n \n // Populate the Field dropdown list\n if (fields) {\n var fieldNames = new Array();\n var texts = new Array();\n var fieldTypes = new Array();\n for (k = 0; k < fields.length; k++) {\n var value = fields[k].table_name + \".\" + fields[k].field_name;\n var text = fields[k].ml_heading + \" (\" + fields[k].table_name + \".\" + fields[k].field_name + \")\";\n fieldNames.push(value);\n texts.push(text);\n fieldTypes.push(fields[k].data_type);\n }\n // reset options\n resetTable('restrictionSummary');\n $('fieldName').options.length = 1;\n addOptionsToDropDown(\"fieldName\", fieldNames, texts, fieldTypes);\n \n }\n else {\n alert(getMessage(\"noField\"));\n tabsFrame.selectTab('page4');\n }\n}", "handleEditFormSubmission() {\n\t\tthis.getPortfolioItemData();\n\t}", "createForm () {\n if (document.getElementById('leaderboardButton')) {\n document.getElementById('leaderboardButton').remove();\n }\n crDom.createLeaderboardButton();\n crDom.createForm();\n crDom.createCategoriesChoice(this.filter.category);\n crDom.createDifficultyChoice(this.filter.difficulty);\n crDom.createRangeSlider(this.filter.limit);\n crDom.createStartButton();\n }", "function initCustomForms() {\n\tjcf.replaceAll();\n}", "function initCustomForms() {\n\tjcf.replaceAll();\n}", "function loadPreviousTerrainModificationForm() {\n currentState = \"TerrainModificationForm\";\n terrainModificationIndex -= 1;\n if (terrainModificationIndex == -1) loadPreviousElementSeedForm();else if (terrainModificationForms[terrainModificationIndex][\"selected\"]) loadTerrainModificationForm();else loadPreviousTerrainModificationForm();\n}", "function user_form_onload()\n{ \n var floorGrid = View.getControl(\"\", \"withLegendFloorSelector_floors\");\n\n if (floorGrid != undefined)\n {\n \t// overrides Grid.onChangeMultipleSelection to load a drawing\n \tfloorGrid.addEventListener('onMultipleSelectionChange', function(row) {\n\t\t\tView.getControl('', 'withLegendFloorSelector_cadPanel').addDrawing(row, null);\n\t });\n } \n}", "function initOnLoad ()\r\n{\r\n\t//die listenelemnte der Navigation sollen anklickbar sein\r\n\tnavigationEventhandler();\r\n\t//öffne die datenbank\r\n\tdatenbankOeffnen();\r\n\t//lade die felder und buttons der kontakt seite in die variablen\r\n\tgetForms();\r\n}", "function loadFormState() {\n const formData = storage.getItem('form');\n if (formData == null || typeof formData !== 'string') return;\n formKeyValue = JSON.parse(formData);\n for (var item in formKeyValue) {\n if (typeof document.getElementsByName(item)[0] !== 'undefined') {\n document.getElementsByName(item)[0].value = formKeyValue[item];\n }\n }\n //dropdownSet(protocol, storage.getItem('protocol'));\n}", "function loadEditingCourseForm(){\n\t\t$(\".edit_course_open_modal\").click(function(){\n\t\t\t$(\"#course_creating_modal\").empty();\n\t\t\tvar id = $(\"#info_course_id\").text().trim();\n\t\t\t$(\"#course_editing_modal\").load(\"../Tab_Course/course_edit.php\",{\n\t\t\t\tid: id\n\t\t\t}, function(){\n\t\t\t\tadd_prereq();\n\t\t\t\tremoveAddedPrereq();\n\t\t\t\teditingConfirmation();\n\t\t\t});\n\t\t})\n\t}", "function resetEditMenuForm(){\r\n EMenuNameField.reset();\r\n EMenuDescField.reset();\r\n EMStartDateField.reset();\r\n EMEndDateField.reset();\r\n\t\t\t\t\t \r\n }", "function appAdminPagesOnLoad() {\n\tif (appRun.kvs.admin.pages_form.already_loaded)\n\t\treturn;\n\n\tappRun.kvs.admin.pages_form.already_loaded = true;\n\tappAdminPagesOnChangeLanguage();\n}", "function init (){\n mostrarform(false);\n listar();\n $(\"#formulario\").on(\"submit\",function(e)\n\t{\n\t\tguardaryeditar(e);\t\n\t})\n}", "function resetAddForm(){\r\n TelephoneField.reset();\r\n FNameField.reset();\r\n LNameField.reset();\r\n TitleField.reset();\r\n MailField.reset();\r\n AddField.reset();\r\n MobileField.reset();\r\n }", "function resetEditMenuItemForm(){\r\n EMenuItemNameField.reset();\r\n \tEMenuItemDescField.reset();\r\n \tEMenuItemValidFromField.reset();\r\n EMenuItemValidToField.reset();\r\n \tEMenuItemPriceField.reset();\r\n \tEMenuItemTypePerField.reset();\r\n\t\t\t\t\t \r\n }", "function populateJs2Form(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('calGuiasFrm.accion'), \n\t\tget('calGuiasFrm.origen'));\n\n\n\tset('calGuiasFrm.id', jsCalGuiasId);\n\tset('calGuiasFrm.codGuia', jsCalGuiasCodGuia);\n\tset('calGuiasFrm.dpteOidDepa', [jsCalGuiasDpteOidDepa]);\n\tset('calGuiasFrm.valTitu', jsCalGuiasValTitu);\n\tset('calGuiasFrm.fecInicVali', jsCalGuiasFecInicVali);\n\tset('calGuiasFrm.fecFinVali', jsCalGuiasFecFinVali);\n\tset('calGuiasFrm.valDescGuia', jsCalGuiasValDescGuia);\n\tset('calGuiasFrm.paisOidPais', [jsCalGuiasPaisOidPais]);\n\t\n}", "function initializePage_submitArticle()\r\n{\r\n page_submitArticle.initializeForm(page_submitUserArticle);\r\n}", "clearForm() {\n // clear any previous highlighted row\n this.clearPrevHighlight();\n // clear the inputs\n $(\"#item_id\").val(0);\n $(\"#item_title\").val(\"\");\n $(\"#item_author_first_name\").val(\"\");\n $(\"#item_author_surname\").val(\"\");\n $(\"#item_year\").val(\"\");\n // disable buttons dependent on a table row having been clicked\n $(\"#btn_search\").prop(\"disabled\", true);\n $(\"#btn_add_item\").prop(\"disabled\", true);\n $(\"#btn_update_item\").prop(\"disabled\", true);\n $(\"#btn_delete_item\").prop(\"disabled\", true);\n // disable link to author page\n $(\"#link_current_author\").removeClass(\"text-primary\");\n $(\"#link_current_author\").addClass(\"text-muted\");\n // hide editions page\n $(\"#page_editions\").hide(\"slow\");\n }", "function loadAnomalyForm() {\n currentState = \"AnomalyForm\";\n var anomalyType = anomalyForms[anomalyIndex][\"anomaly\"];\n customInputsTitle.innerText = anomalyType + \" \" + (anomalyIndex - anomalyTypeIndexes[anomalyType] + 1);\n customInputsContent.innerHTML = \"\";\n var formData = anomalyForms[anomalyIndex][\"json\"][\"fields\"];\n var formFields = (0, _FormBuilder.buildFormFields)(formData);\n for (var i in formFields) {\n var field = formFields[i];\n customInputsContent.appendChild(field);\n }\n}", "function loadForm(templateId, isHeader, legend, actions) {\n\t\t// Kill any old tooltips\n console.log(\"killing old tooltips\");\n $('input').tooltip('destroy');\n\n // unbind any old events\n $('input, select, a').unbind();\n\n\t\t// Load the right div into the form\n\t\t$(\"#form-fields\").html($(templateId).html());\n\t\t// Set the instructions\n\t\t$(\"#instructions\").text(legend);\n\t\t// Load the actions\n\t\t$(\"#transcribe_form .form-actions\").html($(actions).html());\n\t\t// Toggle the \"this is a header\" button\n\t\t$(\"#is-header-button\").toggle(!isHeader);\n\t\t// Toggle the form classes to identify it's purpose\n\t\t$(\"#transcribe_form\").toggleClass(\"header\", isHeader);\n\t\t$(\"#transcribe_form\").toggleClass(\"segment\", !isHeader);\n\n\t\t// Rebind form events\n\t\tconsole.log(\"rebinding events\");\n\t\tbindFormEvents();\n\n\t\t// Filter the template options if we're on a header form\n\t\tif(isHeader) {\n\t\t\t$('select#document-type').trigger('change');\n\t\t}\n\t}", "function hookupForm(){\n\n var wholeForm = $(scope.challengeForm);\n\n // Bind up inputs to ng-models\n wholeForm.find('input, textarea, select').each(function(){\n var elem = $(this);\n var name = elem.attr('name') || elem.attr('id');\n if(name){\n elem.attr('ng-model', 'formData.' + name);\n\n // Assign any specified default value\n scope.formData[name] = elem.attr('value');\n }\n });\n\n // Stick it in the dom\n $(el).html(wholeForm);\n\n $compile(wholeForm)(scope);\n }", "function initialiseForm() {\n\n // utility functions\n function rollback($form) {\n $form.find('input[type=text]').each(function () {\n var $this = $(this);\n $this.val($this.data('rollback'));\n });\n }\n function updateDetails($form, data) {\n $form.find('#fullname').val(data.displayName);\n $form.find('#email').val(data.emailAddress);\n $form.find('input[type=text]').each(function () {\n var $this = $(this);\n $this.data('rollback', $this.val());\n });\n }\n function closeEditDetails($form) {\n $form.removeClass('editing').find('#fullname, #email').attr('readonly', 'readonly');\n $('#ajax-status-message').empty();\n clearErrors();\n }\n\n // event bindings\n $('#edit-details').click(function (e) {\n $('.panel-details form.editable').addClass('editing').find('#fullname, #email').removeAttr('readonly');\n if (e.target.id !== 'email') {\n $('#fullname', '.panel-details form.editable').focus();\n }\n e.preventDefault();\n });\n $('.panel-details form.editable').keyup(function (e) {\n if (e.which === AJS.keyCode.ESCAPE) {\n $('a.cancel', this).click();\n }\n });\n $('.cancel', '.panel-details form.editable').click(function (e) {\n e.preventDefault();\n var $form = $(this).parents('form');\n rollback($form);\n closeEditDetails($form);\n return false;\n });\n $('.panel-details form.editable').submit(function (e) {\n e.preventDefault();\n clearErrors();\n var $form = $(this);\n var displayName = $form.find('#fullname').val();\n ajax.rest({\n url: $form.attr('action'),\n type: 'PUT',\n data: {\n name: $form.find('#name').val(),\n displayName: displayName,\n email: $form.find('#email').val()\n },\n statusCode: { // these errors are handled locally.\n '500': function _() {\n return false;\n },\n '404': function _() {\n return false;\n },\n '401': function _() {\n return false;\n },\n '400': function _() {\n return false;\n }\n }\n }).done(function (data) {\n updateDetails($form, data);\n closeEditDetails($form);\n notifySuccess(AJS.I18n.getText('bitbucket.web.user.update.success', displayName));\n }).fail(function (xhr, textStatus, errorThrown, data) {\n var errors = data && data.errors ? data.errors : AJS.I18n.getText('bitbucket.web.user.update.failure');\n notifyErrors(errors);\n });\n });\n }", "constructor() {\n this.setUpAddForm();\n this.setUpRemoveForm();\n this.updateButton();\n }", "function populateJs2Form(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('cobUsuarEtapaCobraDetalFrm.accion'), \n\t\tget('cobUsuarEtapaCobraDetalFrm.origen'));\n\n\n\tset('cobUsuarEtapaCobraDetalFrm.id', jsCobUsuarEtapaCobraDetalId);\n\tset('cobUsuarEtapaCobraDetalFrm.ueccOidUsuaEtapCobr', [jsCobUsuarEtapaCobraDetalUeccOidUsuaEtapCobr]);\n\tset('cobUsuarEtapaCobraDetalFrm.edtcOidEtapDeudTipoCarg', [jsCobUsuarEtapaCobraDetalEdtcOidEtapDeudTipoCarg]);\n\tset('cobUsuarEtapaCobraDetalFrm.zsgvOidSubgVent', [jsCobUsuarEtapaCobraDetalZsgvOidSubgVent]);\n\tset('cobUsuarEtapaCobraDetalFrm.zorgOidRegi', [jsCobUsuarEtapaCobraDetalZorgOidRegi]);\n\tset('cobUsuarEtapaCobraDetalFrm.zzonOidZona', [jsCobUsuarEtapaCobraDetalZzonOidZona]);\n\tset('cobUsuarEtapaCobraDetalFrm.zsccOidSecc', [jsCobUsuarEtapaCobraDetalZsccOidSecc]);\n\tset('cobUsuarEtapaCobraDetalFrm.terrOidTerr', [jsCobUsuarEtapaCobraDetalTerrOidTerr]);\n\tset('cobUsuarEtapaCobraDetalFrm.melcOidMetoLiquCobr', [jsCobUsuarEtapaCobraDetalMelcOidMetoLiquCobr]);\n\tset('cobUsuarEtapaCobraDetalFrm.eucoOidEstaUsuaEtapCobr', [jsCobUsuarEtapaCobraDetalEucoOidEstaUsuaEtapCobr]);\n\tset('cobUsuarEtapaCobraDetalFrm.gacaOidGuioArguCabe', [jsCobUsuarEtapaCobraDetalGacaOidGuioArguCabe]);\n\tset('cobUsuarEtapaCobraDetalFrm.valObse', jsCobUsuarEtapaCobraDetalValObse);\n\t\n}", "function flush() {\n CodeSnippetForm.tracker.forEach(form => {\n form.dispose();\n });\n }", "function resetAddMenuForm(){\r\n MenuNameField.reset();\r\n MenuDescField.reset();\r\n MStartDateField.reset();\r\n // MEndDateField.reset();\r\n\t\t\t\t\t \r\n }", "function initializeForm() {\r\n formImg.value = \"\";\r\n formTitle.value = \"\";\r\n formAuthor.value = \"\";\r\n formPages.value = \"\";\r\n formRead.value = \"yes\";\r\n}", "addForm() {\n // Creates a new form based on TEMPLATE\n let template = document.importNode(TEMPLATE.content, true);\n FORMSET_BODY.appendChild(template);\n let form = FORMSET_BODY.children[FORMSET_BODY.children.length -1];\n\n // Updates the id's of the form to unique values\n form.innerHTML = form.innerHTML.replace(MATCH_FORM_IDS, this.updateMatchedId.bind(this, form));\n\n let index = FORMSET_BODY.children.length;\n FORMSET.querySelector('[name=\"form-TOTAL_FORMS\"]').value = index;\n this.updateButton();\n }", "_loadPreview(event) {\n var data = this.$form.find('form').serialize();\n var init = event && event.type == 'init';\n var change = event && event.type == 'change';\n var changed = this.formValues && data != this.formValues;\n\n if (init && this.formValid()) {\n this._getPreview(this.activeShortcode);\n }\n\n if (change && changed) {\n this.formValues = data;\n\n if (this.formValid()) {\n this._getPreview(this.activeShortcode);\n } else {\n this.$preview.html(this.$empty);\n }\n }\n\n this._toggleInsert();\n }", "removeForm() {\n if (this.$formContainer === null) {\n return;\n }\n\n delete this.formSaveAjax;\n // Allow form widgets to detach properly.\n Drupal.detachBehaviors(this.$formContainer.get(0), null, 'unload');\n this.$formContainer\n .off('change.quickedit', ':input')\n .off('keypress.quickedit', 'input')\n .remove();\n this.$formContainer = null;\n }", "function formContainerSaveHandler(){}", "function loadClassForm(diagram, erClass) {\n // Always make changes in a transaction, except when initializing the diagram.\n diagram.startTransaction(\"add fields\");\n diagram.selection.each(function(node) {\n if (node instanceof go.Node) { // ignore any selected Links and simple Parts\n // Examine and modify the data, not the Node directly.\n var data = node.data;\n var fields = data.fields;\n //Clear fields\n var flen = fields.length;\n for (i=1; i <= flen; i++){ diagram.model.removeArrayItem(fields, 0); }\n //Update form name\n diagram.model.setDataProperty(data, \"class\", erClass.name);\n //Load fields from class' properties\n for (i=0; i < erClass.properties.length; i++){\n diagram.model.addArrayItem(fields, {\n name: erClass.properties[i].name, \n type: erClass.properties[i].type, \n unique: erClass.properties[i].unique,\n nullable: erClass.properties[i].nullable,\n display: true\n })\n }\n }\n });\n diagram.commitTransaction(\"add fields\");\n}", "function formready(formid)\n{\nformhandler('#'+formid); \n}", "function iisadvanceeditor_form_refresh_before_submit(form,editor){\n\tif (form)\n\tfor (var name in window.owForms){\n\t\tvar thisForm=window.owForms[name]\n\t\tif (thisForm.form && thisForm.form===form) {\n\t\t\t$(thisForm.form).unbind('submit').bind('submit',{form:thisForm},function(e){\n\t\t\t\teditor.updateElement();\n\t\t\t\treturn e.data.form.submitForm();\n\t\t\t});\n\t\t\tbreak;\n\t\t}\n\t}\n}", "function limpiar_vent_gen(){\n contenGen.getForm().reset();\n ventGen.hide();\n}", "componentWillMount() {\n this.formFields = this.createFormStructure();\n }", "function loadNextTerrainModificationForm() {\n currentState = \"TerrainModificationForm\";\n terrainModificationIndex += 1;\n if (terrainModificationIndex == terrainModificationForms.length) loadNextAnomalyForm();else if (terrainModificationForms[terrainModificationIndex][\"selected\"]) loadTerrainModificationForm();else loadNextTerrainModificationForm();\n}", "function loadForm(typeOfForm) {\n\tvar formPath = \"forms/\"+typeOfForm+\"Form.html\" + \"?\" + new Date().getTime();\n\n\t$.get(formPath, function(formHTML) {\n\n\t\t// Set the form we got\n\t\t$('div[class=\"tab-content\"]').html(formHTML);\n\n\t\t// Now fill the form with data\n\t\tpopulateForm(typeOfForm);\n\t});\n}", "function init(){\n\tmostrarform(false);\n\tlistar();\n\n\t$(\"#formulario\").on(\"submit\",function(e){\n\t\tguardaryeditar(e);\n\t});\n\n}", "function eventDSOnLoad() {\n var form = EventViewForm.getForm();\n form.setValues(eventDS.getAt(0).data);\n form.findField('tripsDisplayFieldEvent').setValue(buildStringFromArray(eventDS.getAt(0).data.trips, \"name\", \"<br/>\"));\n}", "function refreshForm() {\n // Clear any current Dimension detail values\n clearUnitDetails();\n // Clear the current dimensions listbox\n clearUnits();\n // reload the current dimension values\n var targetUrl = DimensionUrl;\n\n // Clear the NAtural Unit and Dimension collections\n var index = 0;\n while (index < currentOrg.NaturalUnits.length) {\n currentOrg.NaturalUnits[index].Dimensions.length = 0;\n index++;\n }\n currentOrg.NaturalUnits.length = 0;\n currentOrg.Dimensions.length = 0;\n\n // reload the current data\n loadFormData();\n\n }", "function init()\n{\n\tview.clearGroupList();\n\tmodel.getEditors(ker.wrap(this, init_OK));\n}", "fillForm ( data ) {\n this.title.value = data.title;\n this.body.value = data.body;\n this.id.value = data.id;\n\n // change form state\n this.changeFormState( \"edit\" )\n\n }", "function populateJs2Form(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('cobEtapaDeudaFrm.accion'), \n\t\tget('cobEtapaDeudaFrm.origen'));\n\n\n\tset('cobEtapaDeudaFrm.id', jsCobEtapaDeudaId);\n\tset('cobEtapaDeudaFrm.codEtapDeud', jsCobEtapaDeudaCodEtapDeud);\n\tset('cobEtapaDeudaFrm.valDesc', jsCobEtapaDeudaValDesc);\n\tset('cobEtapaDeudaFrm.indExcl', jsCobEtapaDeudaIndExcl);\n\tset('cobEtapaDeudaFrm.valEdadInic', jsCobEtapaDeudaValEdadInic);\n\tset('cobEtapaDeudaFrm.valEdadFina', jsCobEtapaDeudaValEdadFina);\n\tset('cobEtapaDeudaFrm.indTelf', jsCobEtapaDeudaIndTelf);\n\tset('cobEtapaDeudaFrm.impDesd', jsCobEtapaDeudaImpDesd);\n\tset('cobEtapaDeudaFrm.impHast', jsCobEtapaDeudaImpHast);\n\tset('cobEtapaDeudaFrm.numDiasGracCompPago', jsCobEtapaDeudaNumDiasGracCompPago);\n\tset('cobEtapaDeudaFrm.valPorcIncu', jsCobEtapaDeudaValPorcIncu);\n\tset('cobEtapaDeudaFrm.mensOidMens', [jsCobEtapaDeudaMensOidMens]);\n\tset('cobEtapaDeudaFrm.melcOidMetoLiquCobr', [jsCobEtapaDeudaMelcOidMetoLiquCobr]);\n\tset('cobEtapaDeudaFrm.tbalOidTipoBala', [jsCobEtapaDeudaTbalOidTipoBala]);\n\tset('cobEtapaDeudaFrm.gacaOidGuioArguCabe', [jsCobEtapaDeudaGacaOidGuioArguCabe]);\n\tset('cobEtapaDeudaFrm.paisOidPais', [jsCobEtapaDeudaPaisOidPais]);\n\tset('cobEtapaDeudaFrm.oredOidEtapDeu1', [jsCobEtapaDeudaOredOidEtapDeu1]);\n\tset('cobEtapaDeudaFrm.oredOidEtapDeu2', [jsCobEtapaDeudaOredOidEtapDeu2]);\n\tset('cobEtapaDeudaFrm.oredOidEtapDeu3', [jsCobEtapaDeudaOredOidEtapDeu3]);\n\t\n}", "function renderData() {\n this.id_form;\n this.sql;\n}", "function loadProjectForms() {\n\t\tAPI.getProjectForms()\n\t\t\t.then((res) => setProjectForms(res.data))\n\t\t\t.catch((err) => console.log(err));\n\t}", "function clearFields(){\n\t\t$scope.easyLoad = {};\n\t}", "async function getForm() {\n try {\n const formComponent = (await doesDBExist()) ? (\n <Unlock setStore={setStore} />\n ) : (\n <InitialLock setStore={setStore} />\n );\n setForm(formComponent);\n } catch (err) {\n console.error('Error connecting to database: \\n' + err);\n setForm(<ErrorCard databaseError />);\n }\n }", "function storeForm() {\n /*jshint validthis:true */\n var form = $(this);\n var formId = form[0].id;\n if (!formId) return;\n var formJSON = app.formToData(form);\n if (!formJSON) return;\n app.formStoreData(formId, formJSON);\n form.trigger('store form:storedata', {data: formJSON});\n }", "function _initializeForm(areaId) {\n if(areaId > 0) {\n let ar = AreaById.query({id: areaId});\n ar.$promise.then(function (data) {\n vm.area = data[0];\n vm.menu({id: vm.area.id, title: vm.area.title});\n });\n } else {\n vm.area = {id: 0, title: '', linkLabel: '', image: '', searchLabel: '', description: ''};\n }\n }", "function resetPresidentForm(){\n fechaInicioField.setValue('');\n descripcionEventoField.setValue('');\n }" ]
[ "0.68086445", "0.66354704", "0.6361539", "0.63008463", "0.62909263", "0.62107235", "0.6209275", "0.61616904", "0.61513704", "0.61452925", "0.6125843", "0.60595214", "0.6002192", "0.59995353", "0.5994709", "0.5991958", "0.5988343", "0.5926666", "0.5850189", "0.5849011", "0.58425564", "0.5839371", "0.58337986", "0.5831137", "0.5822912", "0.5814081", "0.5795329", "0.5794125", "0.5791014", "0.57872754", "0.57806146", "0.5777578", "0.5771971", "0.5770586", "0.5767526", "0.5748797", "0.5748365", "0.57400423", "0.5734869", "0.5723013", "0.5710652", "0.57027286", "0.5702411", "0.5699715", "0.5697167", "0.5695373", "0.5695153", "0.5691525", "0.5689532", "0.5686318", "0.56826735", "0.56826276", "0.56778073", "0.56767607", "0.56767607", "0.5676744", "0.5672576", "0.56721556", "0.5667179", "0.5666837", "0.5651763", "0.56458616", "0.5645817", "0.5645678", "0.5645631", "0.5638392", "0.56355214", "0.56342536", "0.5630871", "0.56246483", "0.56241673", "0.56237763", "0.561655", "0.56123656", "0.56067413", "0.5597484", "0.5596958", "0.55918264", "0.5591199", "0.55878335", "0.5584986", "0.55723673", "0.5563898", "0.5563311", "0.5561374", "0.55577195", "0.554232", "0.5540539", "0.55356085", "0.55349946", "0.55312", "0.5531055", "0.5525413", "0.552497", "0.5524781", "0.55233926", "0.55211735", "0.5513923", "0.55131125", "0.5511786", "0.55115736" ]
0.0
-1
Called after closing a patient injury
function postCloseInjury() { removeForms(); $('html, body').animate({ scrollTop: 0 }, 400); $("#queryResetButton").click(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onClose() {\n\t\t}", "_close() {\n // mark ourselves inactive without doing any work.\n this._active = false;\n }", "function doneClosing()\n\t{\n\t\tthat.terminate();\n\t}", "onClose(){}", "onClose() {}", "onClose() {}", "onClosed() {\r\n // Stub\r\n }", "onClose() {\n this.reset();\n if (this.closed_by_user === false) {\n this.host.reportDisconnection();\n this.run();\n } else {\n this.emit('close');\n }\n }", "function onclose(id) {\n\tthis.db.chsUnsub(id);\n}", "function Close_Instruction() {\r\n}", "function close() {\n\t\t\t\t\t\t$scope.currentSubType = null;\n\t\t\t\t\t\t$scope.currentMeasureClass = null;\n\t\t\t\t\t\t$rootScope.$broadcast(\"DataTypeDetails:close\");\n\t\t\t\t\t}", "function Close() {\n } // Close", "_close() {\n set(this, 'isOpen', false);\n set(this, 'isToStep', false);\n\n let action = get(this, 'attrs.closeAction');\n let vals = get(this, '_dates');\n let isRange = get(this, 'range');\n\n if (action) {\n action(isRange ? vals : vals[0] || null);\n }\n\n this._destroyOutsideListener();\n }", "handle_closing() {\n if (!this.app || !this.element) {\n return;\n }\n /* The AttentionToaster will take care of that for AttentionWindows */\n /* InputWindow & InputWindowManager will take care of visibility of IM */\n if (!this.app.isAttentionWindow && !this.app.isCallscreenWindow &&\n !this.app.isInputMethod) {\n this.app.setVisible && this.app.setVisible(false);\n }\n this.switchTransitionState('closing');\n }", "_onCloseButtonTap() {\n this.fireDataEvent(\"close\", this);\n }", "_onClosing() {\n this._watcher.stop();\n this.emit(\"closing\");\n }", "close() {\n if (!this.isOpen) {\n return;\n }\n this.onClose.emit(this);\n this.isOpen = false;\n this.changeDetection.markForCheck();\n this.onClosed.emit(this);\n }", "close()\n {\n this.makeUntouchable();\n Notif.closeByObject(this.object);\n }", "function endEarlyButton() {\n endEarlyDetails();\n}", "close() {\n\t\tthis._killCheckPeriod();\n\t}", "function CloseEvent() {}", "function close() {\n var desc1 = new ActionDescriptor();\n desc1.putEnumerated( stringIDToTypeID( \"saving\" ), stringIDToTypeID( \"yesNo\" ), stringIDToTypeID( \"no\" ) );\n desc1.putInteger( stringIDToTypeID( \"documentID\" ), app.activeDocument.id);\n desc1.putBoolean( stringIDToTypeID( \"forceNotify\" ), true );\n executeAction( stringIDToTypeID( \"close\" ), desc1, DialogModes.NO );\n}", "closeOutParty() {\n this.props.closeOutParty(this.props.party._id);\n }", "function onClose() {\n\tprocess.exit( 0 );\n}", "function onClose() {\n\tprocess.exit( 0 );\n}", "close() {\n\t\tif (!this.open) throw \"la encuesta ya está cerrada.\"\n\t\tthis.open = false;\n\t\tthis.save();\n\t}", "function endChange()\n{\n window.close();\n}", "function closeQuest() {\n if ($scope.userToPay.user) {\n Issues.payAndClose(Number($scope.userToPay.user), $scope.questBounty, $scope.chosenQuest.id);\n $state.go('questFeed');\n } else {\n toastr.error(\"Please select the user who solved your issue\", {\n closeButton: true,\n timeOut: 5000,\n extendedTimeOut: 10000\n });\n }\n }", "function handleInterceptedCloseCall_() {\n\t\tif (currentParent_ === tree_) {\n\t\t\tIncrementalDomAop.stopInterception();\n\t\t\tisCapturing_ = false;\n\t\t\tcallback_(tree_);\n\t\t\tcallback_ = null;\n\t\t\tcurrentParent_ = null;\n\t\t\trenderer_ = null;\n\t\t\ttree_ = null;\n\t\t} else {\n\t\t\tcurrentParent_ = currentParent_.parent;\n\t\t}\n\t}", "_onClosed() {\n this.emit(\"closed\");\n }", "function closelitebochs() {\n $('[data-element=\"litebochs\"]').attr('data-state', 'closed')\n}", "function ForceClose() {\r\n}", "beforeClose() {\n\t\t}", "function close() {\n $uibModalInstance.dismiss('exit');\n }", "function close() {\n $uibModalInstance.dismiss('exit');\n }", "function close() {\n $uibModalInstance.dismiss('exit');\n }", "function _onProjectClose() {\n // console.log('[' + EXTENSION_ID + '] :: _onProjectClose');\n if ($appButton.hasClass('active')) {\n Resizer.toggle($appPanel);\n _command.setChecked(false);\n _command.setEnabled(false);\n $appButton.removeClass('active');\n }\n if (!_.isNull($issuesList) && $issuesList.length) {\n $issuesList.html('');\n }\n $appButton.hide();\n $issuesList = null;\n _repositoryUrl = false;\n }", "function closeCongratulations() {\n\t$('#container').css('z-index', '10');\n\t$('#overlay').hide();\n\t$('#congratulations').hide();\n //$('#special-instructions').html('<ol><li>Research each gene by clicking it and reading about what it does in HEALTHY DRAKES.</li><li>Based on the description, select the gene that you think could be related to bog breath.</li><li>Click \"Sequence it\" to send a blood sample from BOG BREATH DRAKES to the lab for DNA sequencing!</li><li>When you find the allele that is different in bog breath drakes, translate the protein and find the exact difference!</li></ol>');\n $('#special-instructions').css({'background': 'url(_assets/img/otc-initial-state.png) no-repeat 0 20px'});\n\t$('#special-instructions').show();\n}", "function cust_ChildWindowClosed(){\n \n}", "function closeThis() {\n $('#patientBedsDiv').hide();\n return false;\n}", "exit() {\n this.controller.loadContext(\"continuity\", {\n dotType: this._continuity.dotType,\n });\n }", "onClose(removed) {}", "function onClosed()\n\t{\n\t\t//cancel dialog with no data\n\t\tModalDialog.close();\n\t}", "function pageUnload()\n{\n\t//storing of open input text is now performed in presnav.js in the goNext() function\n\tparent.booContentLoaded = false; // This is to tell the program that this page is being unloaded from the browser.\n}", "exitA85(ctx) {\n\t}", "function close()\n{\n closeFrame();\n} // function close", "externalClickCallback() {\n this.opened = false;\n this.behave(\"close\");\n }", "function endEvent(){}", "function _close() {\n var selectedTxt = selectItems[selected].text;\n selectedTxt != $label.text() && $original.change();\n $label.text(selectedTxt);\n\n $outerWrapper.removeClass(classOpen);\n isOpen = false;\n\n options.onClose.call(this);\n }", "function onClose() {\n\tmain( opts, done );\n}", "exitA90(ctx) {\n\t}", "function _onBeforeUnload() {\n _startClosing();\n }", "function _onBeforeUnload() {\n _startClosing();\n }", "function fhArrival_close() {\n\t\n\tif (fhArrival_data.currentMode == \"EDIT\") {\n\t\tif (!confirm(\"Sei sicuro di uscire senza salvare?\")) {\n\t\t\treturn false;\n\t\t}\n\t} \n\t\n\twindow.location = 'index.php?controller=arrival';\n\t\t\n}", "function onUnload() {\r\n log('onUnload');\r\n stop();\r\n }", "function onUnload() {\r\n \tcontrols.log('onUnload');\r\n stop();\r\n }", "function closeNewSession()\n{\n\tvar newSessionPopUp = document.getElementById('newStudySession');\n\tnewSessionPopUp.style.display = 'none';\n\tvar newSessionPopUp = document.getElementById('blur');\n\tnewSessionPopUp.style.display = 'none';\n buddiesClickedOn = new Array();\n}", "close() {\n if(!this.opened){\n return;\n }\n this.opened = false;\n }", "function dialedExit(dialed, bridge) {\n console.log(\n 'Dialed channel %s has left our application, destroying bridge %s',\n dialed.name, bridge.id);\n\n bridge.destroy(function(err) {\n if (err) {\n throw err;\n }\n });\n }", "BunnyAtExit() {\n if (this.UpdatePoppedEggCount()) {\n this.Complete();\n } else {\n ui.AlarmEggCount();\n ui.Tip(\"You haven't got all the eggs yet - go back in\");\n }\n }", "exitA83(ctx) {\n\t}", "function dialedExit(dialed, bridge) {\n console.log(\n 'Dialed channel %s has left our application, destroying bridge %s',\n dialed.name, bridge.id);\n\n bridge.destroy(function(err) {\n if (err) {\n throw err;\n }\n });\n }", "exitA45(ctx) {\n\t}", "_after() {\n this._exitContext();\n }", "close() {\n this.connection.sendBeacon({type: 'disconnect', session: this.sessionId})\n this.messageSubscription.unsubscribe()\n clearTimeout(this.resendReportTimer)\n clearInterval(this.performPurgeTimer)\n clearTimeout(this.changeReportDebounceTimer)\n }", "exitA82(ctx) {\n\t}", "handleFinish(useful) {\n recordFinish(this.state.currentGuide.id, useful);\n closeGuide();\n }", "close() {\n const that = this;\n\n if (!that.opened) {\n return;\n }\n\n that._close();\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 onCloseButtonClick(event) {\n //delete app-container\n _iframe.tell('close-app-view', {});\n }", "onEnrollmentFinished_() {\n this.closeEnrollment_('done');\n }", "function closeOtherInfo() {\n if (infoObj.length > 0) {\n infoObj[0].set(\"marker\", null);\n infoObj[0].close();\n infoObj[0].length = 0;\n }\n }", "function closeOtherInfo() {\n if (infoObj.length > 0) {\n infoObj[0].set(\"marker\", null);\n infoObj[0].close();\n infoObj[0].length = 0;\n }\n }", "function closeOtherInfo() {\n if (infoObj.length > 0) {\n infoObj[0].set(\"marker\", null);\n infoObj[0].close();\n infoObj[0].length = 0;\n }\n }", "function closeOtherInfo() {\n if (infoObj.length > 0) {\n infoObj[0].set(\"marker\", null);\n infoObj[0].close();\n infoObj[0].length = 0;\n }\n }", "static recordsound_recordclose(keep,fcn) {\n if (window.Settings.enableLog)\n WebUtils.log(\"Web.recordsound_recordclose({0})\".format(keep));\n RecordSound.recordsound_recordclose(keep,fcn);\n }", "function close() {\n state = 'closed';\n czarTimerEnd = Date.now() + (1000 * game.czarTime);\n czarTimerInterval = setInterval(checkCzarTime, 100);\n roundTimerEnd = false;\n clearInterval(roundTimerInterval);\n game.sendMessage('The answers are in. Waiting on the Card Czar...');\n }", "terminating() {}", "close() {\n console.log(`disconnected from ${this.address}`)\n Connection.all.delete(this.address)\n if (this.name != null && Connection.waiting.has(this.name)) {\n Connection.waiting.delete(this.name)\n }\n this.endGame(this.gameID)\n }", "function unload() {\n}", "function C012_AfterClass_Jennifer_TestUnbind() {\n\n\t// Bound and gagged, there's not much she can do\n\tif (ActorIsGagged() && ActorIsRestrained()) {\n\t\tC012_AfterClass_Jennifer_GaggedAnswer();\n\t}\n\telse {\n\n\t\t// Before the next event time, she will always refuse (skip is owned)\n\t\tif (!GameLogQuery(CurrentChapter, CurrentActor, \"EventGeneric\") || Common_ActorIsOwned) {\n\t\t\t\n\t\t\t// Check if the event succeeds randomly (skip is owned)\n\t\t\tif (EventRandomChance(\"Love\") || Common_ActorIsOwned) {\n\t\t\t\t\n\t\t\t\t// Can only release if not restrained\n\t\t\t\tif (!ActorIsRestrained()) {\n\t\t\t\t\tif (ActorIsGagged()) OverridenIntroText = GetText(\"ReleasePlayerGagged\");\n\t\t\t\t\telse OverridenIntroText = GetText(\"ReleasePlayer\");\t\t\t\t\n\t\t\t\t\tPlayerReleaseBondage();\n\t\t\t\t\tCurrentTime = CurrentTime + 50000;\n\t\t\t\t} else OverridenIntroText = GetText(\"CannotReleasePlayer\");\n\t\t\t\t\n\t\t\t} else EventSetGenericTimer();\n\n\t\t}\n\n\t}\n\n}", "exitA88(ctx) {\n\t}", "function close() {\n $modalInstance.dismiss();\n }", "function death() {\n\tded = true;\n\tlet eatNotify = false;\n\tlet cureNotify = false;\n\tlet petNotify = false;\n\tnotifications.forEach(notify => notify.close());\n\t//turn off event listeners\n\tdocument.removeEventListener('touchend', stopCare);\n\tbuttonsList.removeEventListener('touchstart', takeCare);\n\tclearInterval(called);\n\tcalled = 0;\n\tclearInterval(changeIcon);\n\tchangeIcon = 0;\n\tclearInterval(pressTimer);\n\tpressTimer = 0;\n\t//change icon\n\tanimal.src = \"img/dead.png\";\n\t//show revive button\n\treviveBtn.style.display = \"block\";\n\treviveBtn.addEventListener('click', revive);\n}", "handleClose() {\n this.room.leave(this);\n this.room.broadcast({\n type: 'note',\n text: `${this.name} left ${this.room.name}.`\n });\n }", "function onClosed() {\n Users.requestsDomainListData = previousValueOfRequestsDomainListData;\n deselectUserOverlay(selectedUserUUID);\n stopUpdateInterval();\n removeAllOverlays();\n stopListening();\n }", "close() {\n this.sendAction('close');\n }", "exit() {\n this.exit();\n }", "function C010_Revenge_SidneyJennifer_GoOutside() {\n\tCurrentTime = CurrentTime + 300000;\n\tActorLoad(\"Jennifer\", \"\");\n\tLeaveIcon = \"\";\n\tActorSpecificSetPose(\"Sidney\", \"Angry\");\n\tActorSpecificSetPose(\"Jennifer\", \"Angry\");\n}", "function endCondition_outOfTime() {\n outOfTime_count++;\n let headingText = \"Out of Time\";\n let giveDetails = \"The correct answer was:\";\n callModal(headingText, giveDetails);\n }", "function closeLaserAttack(){\n\tdocument.getElementById(\"modal-backdrop-laser-attack\").classList.add(\"inactive\");\n\tdocument.getElementById(\"modal-laser-attack\").classList.add(\"inactive\");\n\topenSonar();\n}", "function closeFlipper() {\n\t\t\t\t\tflipperService.close(id);\n\t\t\t\t}", "escrowClosed() {\n $(\"#concludeEscrowResultSuccess\").show();\n\n addAlertElement(\"Escrow Closed successfully\",\"success\");\n\n // only visible to auctionhouse\n $(\"#destroyContractListElement\").show();\n }", "exitA84(ctx) {\n\t}", "function onClosed() {\n // save lastTab that the user was on\n dynamicData.state.activeTabName = currentTab;\n MyAvatar.hasScriptedBlendshapes = false;\n addRemoveFlowDebugSpheres(false);\n deleteMirror();\n }", "endGame() {\r\n setTimeout(function () {\r\n alert(currentEnnemy.name + ' a gagné. Cliquez sur OK pour relancer la partie'),\r\n window.location.reload()\r\n }, 200)\r\n }", "function onLeavingChallengesAdvertising() {\n $timeout.cancel(updaterHndl);\n }", "closeDialog_(event) {\n this.userActed('close');\n }", "close () {\n this.opened = false;\n }", "close() {\n if (this._open) {\n this._open = false;\n this._resetContainer();\n this._closed$.next();\n this.openChange.emit(false);\n this._changeDetector.markForCheck();\n }\n }" ]
[ "0.6687301", "0.6391017", "0.625934", "0.62345546", "0.6136394", "0.6136394", "0.61324286", "0.60531926", "0.60444236", "0.60337144", "0.6001027", "0.5998009", "0.5996477", "0.5972554", "0.5969136", "0.5947968", "0.5944226", "0.5928413", "0.59108454", "0.59066826", "0.5893836", "0.5872552", "0.58665246", "0.5864176", "0.5864176", "0.5862136", "0.5856804", "0.5841417", "0.5837711", "0.58198535", "0.58191425", "0.58041644", "0.57750195", "0.57613623", "0.57613623", "0.57613623", "0.5756816", "0.5737229", "0.5731295", "0.5723404", "0.5711887", "0.5701044", "0.56985444", "0.56833714", "0.5679182", "0.5669349", "0.56687224", "0.5665493", "0.56616396", "0.56588584", "0.5652707", "0.5646454", "0.5646454", "0.56433254", "0.56359863", "0.5628304", "0.56281346", "0.5618208", "0.56140244", "0.56036854", "0.5599814", "0.5598273", "0.5597682", "0.5585241", "0.5584943", "0.5583007", "0.5582893", "0.5576666", "0.55729836", "0.55587596", "0.55434924", "0.5541613", "0.5541558", "0.5541558", "0.5541558", "0.5541558", "0.553932", "0.55374163", "0.55315006", "0.5529325", "0.5523608", "0.55229604", "0.5517552", "0.5517001", "0.55162746", "0.5514168", "0.55126446", "0.5510102", "0.5504499", "0.5503879", "0.55028343", "0.550152", "0.55013174", "0.54968876", "0.54966176", "0.5496301", "0.549219", "0.5490653", "0.5488393", "0.5488018", "0.5487863" ]
0.0
-1
Called after creating a new patient entry (not a new form within a patient)
function postCreateNewForm() { $(".tables").fadeIn(function () { $(".forms").animate({ scrollLeft: scroll}, 400); }); $('html, body').animate({ scrollTop: $("#BreakOne").offset().top }, 400); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addPatient(){\n \n var pname = readline.question('\\nEnter patient name : ');\n var pmobile = readline.questionInt('Enter Mobile number : ');\n var page = readline.questionInt('Enter patient age : ');\n \n var patient = {\n \"PName\" : pname,\n \"PMobile\" : pmobile,\n \"PID\" : this.pid,\n \"PAge\" : page\n }\n this.pfile.Patients.push(patient);\n this.savePatientData();\n }", "function createOne() {\n var participantForm = session.forms.giftregistry.event.participant;\n\n Form.get(session.forms.giftregistry).clear();\n\n participantForm.firstName.value = customer.profile.firstName;\n participantForm.lastName.value = customer.profile.lastName;\n participantForm.email.value = customer.profile.email;\n\n app.getView().render('account/giftregistry/eventparticipant');\n}", "addNewQualification() {\n\t\tthis.newQualification.doctor = this.doctorId;\n\t\tthis.addNewQualificationState = true;\n\t}", "create() {\n this.id = 0;\n this.familyName = null;\n this.givenNames = null;\n this.dateOfBirth = null;\n\n this.validator.resetForm();\n $(\"#form-section-legend\").html(\"Create\");\n this.sectionSwitcher.swap('form-section');\n }", "function _finishNewEntryCreation(response) {\n eventManager.fireEvent(NewODActionButtonClicked);\n eventManager.fireEvent(NewODCreated, response);\n var msg = localizationService.translate('Messages.RecordSavedSuccessfully');\n notificationService.showNotification(msg);\n }", "newHandler() {\n\n // We're adding a new task, so set the editing flag and create an ID.\n wxPIM.isEditingExisting = false;\n wxPIM.editingID = new Date().getTime();\n\n // Now show the details form and clear it, then set any defaults. Don't\n // forget to disable the delete button since we obviously can't delete\n // during an add.\n $$(\"moduleTasks-details\").show();\n $$(\"moduleTasks-detailsForm\").clear();\n $$(\"moduleTasks-category\").setValue(1);\n $$(\"moduleTasks-deleteButton\").disable();\n\n }", "function createNewAdminPhone() {\n vm.new_admin_phone.submit = true;\n if (vm.new_admin_phone_form.$valid) {\n Merchant.create('admin_phone',vm.new_admin_phone).then(function(response) {\n vm.admin_phones.push(response.data);\n\n vm.new_admin_phone_form.name.$faded = false;\n vm.new_admin_phone_form.phone_no.$faded = false;\n //Set Admin Email Form to be New Again\n vm.new_admin_phone = {};\n vm.new_admin_phone.success = true;\n\n $(\"#add-admin-phone-modal\").modal('toggle');\n\n $timeout(resetForm, 3500);\n });\n }\n }", "function add_patient(ap)\n{\n\tif(ap.p_name.value==\"\")\n\t{\n\t\talert(\"enter patient name\");\n\t\tap.p_name.focus();\n\t\treturn false;\n\t}\n\n\tif(ap.p_age.value==\"\")\n\t{\n\t\talert(\"enter patient age\");\n\t\tap.p_age.focus();\n\t\treturn false;\n\t}\nif(ap.p_weight.value==\"\")\n\t{\n\t\talert(\"enter patient weight\");\n\t\tap.p_weight.focus();\n\t\treturn false;\n\t}\n\nif(ap.p_city.value==\"\")\n\t{\n\t\talert(\"enter patient city\");\n\t\tap.p_city.focus();\n\t\treturn false;\n\t}\n\nif(ap.p_bg.value==\"\")\n\t{\n\t\talert(\"enter patient blood group\");\n\t\tap.p_bg.focus();\n\t\treturn false;\n\t}\n\nif(ap.p_precent.value==\"\")\n\t{\n\t\talert(\"enter patient blood precentage\");\n\t\tap.p_precent.focus();\n\t\treturn false;\n\t}\n\nif(ap.p_insurance.value==\"\")\n\t{\n\t\talert(\"enter patient insuranceid\");\n\t\tap.p_insurance.focus();\n\t\treturn false;\n\t}\n\nif(ap.p_date.value==\"\")\n\t{\n\t\talert(\"enter joining date\");\n\t\tap.p_date.focus();\n\t\treturn false;\n\t}\n\nif(ap.p_contact.value==\"\")\n\t{\n\t\talert(\"enter patient contact no\");\n\t\tap.p_contact.focus();\n\t\treturn false;\n\t}\n\nif(ap.p_email.value==\"\")\n\t{\n\t\talert(\"enter patient email\");\n\t\tap.p_email.focus();\n\t\treturn false;\n\t}\n\nif(ap.p_problem.value==\"\")\n\t{\n\t\talert(\"enter patient problem\");\n\t\tap.p_problem.focus();\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "function createPatient() {\n const patient = {\n name: document.getElementById('name').value,\n sex: document.getElementById('sex').value,\n gender: document.getElementById('gender').value,\n age: document.getElementById('age').value,\n date_of_birth: document.getElementById('date_of_birth').value\n }\n fetch(\"http://localhost:3000/patients\", {\n method: 'POST',\n headers: {\n \"Content-Type\": \"application/json\",\n \"Accept\": \"application/json\"\n },\n body: JSON.stringify(patient)\n })\n .then(resp => resp.json())\n .then(patient => {\n clearPatientHtml()\n getPatients()\n Patient.newPatientForm()\n })\n}", "function postEntry() {\n var entry = cfg.defaultEntry(),\n useLocation = $(cfg.select.ids.formLocation).prop('checked');\n\n entry.entryID = cfg.counter + 1;\n entry.title = $(cfg.select.ids.formTitle).val();\n entry.description = $(cfg.select.ids.formDesc).val();\n\n if (!entry.title || !entry.description) {\n return;\n }\n\n addEntryToDOM([entry]);\n storeEntry(entry);\n addMarker(entry);\n notifyUser('Your entry was posted successfully!');\n\n if (true === useLocation) {\n updateLocation(entry.entryID);\n }\n }", "function addNewRecord() {\n let country = $('#newCountryText').val();\n let capital = $('#newCapitalText').val();\n if (country.length === 0 || capital.length === 0) return; // Do not add empty records\n addRow(country, capital);\n fixActionFieldOptions();\n }", "async postCreate () {\n\t}", "create() {\n try {\n this._toggleEditThrobber();\n var latin_name = document.getElementById('latin_name').value;\n var outputEl = this._clearOutput();\n var jsonObj = this.dao.retrieve(latin_name);\n if (!jsonObj || !jsonObj.species) throw `Error reading taxonomic data. Is the latin name spelled correctly?`; \n this._showOutput(latin_name, jsonObj);\n \n } catch(e) {\n console.log(e);\n alert(e);\n }\n this._toggleEditThrobber();\n }", "handleCreated(event) {\n //If \"Create Issue and Upload Screenshot\" button has been clicked then we can use this flag to show file dialog after Issue has been crated\n if(this.fileUploadButtonClicked){\n this.showUploadFileDialog = true;\n }\n this.newIssueRecordId = event.detail.id;\n //Reset the form so we can enter more data for next issue; if needed\n this.handleResetFields();\n this.dispatchEvent(\n new ShowToastEvent({\n title: 'Success',\n message: '{0} was successfully created!',\n \"messageData\": [\n {\n url: '/'+ event.detail.id,\n label: 'Issue:: ' + event.detail.fields.Name.value\n }\n ],\n variant: 'success'\n })\n );\n }", "function formPatientMessage() {\n\n }", "addNewDoctorQualification() {\n\t\tthis.profileData.qualification.push(\n\t\t\t{\n\t\t\t\tqualification: \"\"\n\t\t\t}\n\t\t);\n\t}", "function create() {\n if (document.getElementById('compose').value == '') {\n showModal('Error', 'Please compose your entry above before submitting.')\n return\n }\n \n let entryContent = document.getElementById('compose').value\n\n if (tagLocation) {\n entryContent += ` @_location ${lat} ${lon}`\n }\n\n entryContent += ` @_time ${getCurrentTimeString()}`\n\n postFromButton('submitEntryButton', 'Submitting...', '/jrnlAPI/create',\n {\n entry: entryContent\n },\n (data)=>{\n if (data.success == true) {\n document.getElementById('compose').value = ''\n let tagGPS = document.getElementById('tagGPS')\n tagGPS.checked = false\n tagCurrentLocation(tagGPS)\n showModal('Entry added', `<strong>Your entry has been added successfully.</strong><br /><small>stdout: \"${data.stdo}\" stderr: \"${data.stde}\"</small>`)\n }\n })\n}", "function handleNewPlantSubmit(e){\n let targetFormId = parseInt(e.target.id)\n let newPlantField = document.querySelector(`#new-plant-form-${targetFormId}`)\n let plantInput = newPlantField.querySelectorAll(\"input#plant\")\n let newPlantObj = {\n garden_id: plantInput[0].value,\n plantName: plantInput[1].value,\n plantType: plantInput[2].value,\n plantFamily: plantInput[3].value\n }\n Api.newPlant(newPlantObj)\n location.reload()\n}", "submitNewPatient()\n\t\t{\n\t\t\tvar self = this;\n\t\t\tvar value= document.getElementById('value');\n\t\t\tconsole.log(this.get('l_Name'));\n var val = value.options[value.selectedIndex].text;\n\t\t\tlet ajaxPost = this.get('ajax').request('/api/patients',\n\t\t\t{\n\t\t\t\tmethod: 'POST',\n\t\t\t\ttype: 'application/json',\n\t\t\t\tdata: { patient:\n\t\t\t\t\t{\n\n\t\t\t\t\tclient: this.get('c_ID'),\n\t\t\t\t\tspecies: \tthis.get('patientSpecies'),\n\t\t\t\t\tfirst_name: this.get('patientFirstName'),\n\t\t\t\t\tlast_name: this.get('l_Name'),\n\t\t\t\t\tdateOfBirth: \t\tJSON.stringify(formatDate(document.getElementById('patientAge').value)),\n\t\t\t\t\tcolour: \tthis.get('patientColor'),\n\t\t\t\t\ttattoo: \tthis.get('patientTatoo'),\n\t\t\t\t\tmicrochip: \tthis.get('patientMicrochip'),\n\t\t\t\t\tsex: \tval\n\t\t\t\t}\n\t\t\t}, \n\t\t\n\t\t\t});\n\t\t\tajaxPost.then(function(data){\n\t\t\t\tself.transitionToRoute('search-patient');\n\t\t\t},\n\t\t\tfunction(response){\n\t\t\t\tif (response === false){\n\t\t\t\t\tif (self.get('session.isAuthenticated')){\n\t\t\t\t\t\tself.get('session').invalidate();\n\t\t\t\t\t}\n\t\t\t\tself.transitionToRoute('/login');\n\t\t\t}\n\t\t\telse{\n showAlert(response.errors[0].title, false, \"failure\");\n }\n\t\t\t});\n\t\treturn ajaxPost;\n\t}", "_onRegistrationInitiated(event) {\n this._assignFields(event);\n this._state = this.STATES.creatingCustomer;\n }", "addPatient({state, commit}, patient) {\n\t\t\tif (patient.patient_id == -1) {\n\t\t\t\tpatient.patient_id = state.addPatients.length\n\t\t\t}\n\t\t\tcommit('addPatient', patient)\n\t\t\treturn patient.patient_id\n\t\t}", "function create_person(data) {\n\t\t$('#submissions').loadTemplate($('#submission-template'), data, {append: true});\n\t}", "function createCase(){\n /**\n * This function reads the data from the doctor and the patient, and consequently creates a case.\n * Finally it fills the case's input inside the analysis request form.\n */\n var patientuid = $('input#ar_0_Patient').attr('uid');\n var doctoruid = $('input#ar_0_Doctor').attr('uid');\n var clientuid = $('input#ar_0_Client_uid').val();\n var request_data = {\n obj_path: '/Plone/batches',\n obj_type: 'Batch',\n Patient: \"catalog_name:bika_patient_catalog|portal_type:Patient|UID:\" + patientuid,\n Doctor:\"portal_type:Doctor|UID:\" + doctoruid,\n Client:\"portal_type:Client|UID:\" + clientuid\n };\n $.ajaxSetup({async: false});\n $.ajax({\n type: \"POST\",\n dataType: \"json\",\n url: window.portal_url + \"/@@API/create\",\n data: request_data,\n success: function(data){\n // To obtain the case's uid\n window.bika.lims.jsonapi_read({\n catalog_name: 'bika_catalog',\n content_type: 'Batch',\n id: data['obj_id']\n }, function (dataobj) {\n // Writing the case's uid inside the analysis request creation's form. Thus when the analysis\n // request form submits, it will catch the case's uid and create it.\n $('form#analysisrequest_edit_form input#ar_0_Batch').attr('uid', dataobj.objects[0]['UID']);\n $('form#analysisrequest_edit_form input#ar_0_Batch_uid').val(dataobj.objects[0]['UID']);\n });\n // The case's input also needs their id.\n $('form#analysisrequest_edit_form input#ar_0_Batch').val(data['obj_id']);\n },\n error: function(XMLHttpRequest, statusText) {\n window.bika.lims.portalMessage(statusText);\n window.scroll(0,0);\n $(\"input[class~='context']\").prop(\"disabled\", false);\n }\n });\n $.ajaxSetup({async: true});\n }", "function addNewPatient(){\r\n var name = $(\"#name\").val();\r\n /*var emergencyId = $(\"#emergencyid\").val();*/\r\n var age = $(\"#age\").val();\r\n var address = $(\"#address\").val();\r\n if (name === \"\")\r\n bootstrap_alert.warning(\"No name entered. Please enter name and try again\");\r\n /*else if (emergencyId === \"\")\r\n bootstrap_alert.warning(\"No emergencyid. Please enter emergencyid and try again\");*/\r\n else if (age === \"\")\r\n bootstrap_alert.warning(\"No age. Please enter age and try again\");\r\n else if (address === \"\")\r\n bootstrap_alert.warning(\"No address. Please enter address and try again\");\r\n else{\r\n var input = {};\r\n input.name = name;\r\n /*input.emergencyId = emergencyId;*/\r\n input.age = age;\r\n input.extraNotes = \"\";\r\n input.address = address;\r\n\r\n var response = addPatient(input);\r\n if (response.valid === true){\r\n alert(\"Patient added sucessfully!!\");\r\n bootstrap_alert.success(\"User added\");\r\n }\r\n else{\r\n alert(\"Patient failed!!\")\r\n bootstrap_alert.warning(\"Invalid username or password was given.\");\r\n }\r\n }\r\n}", "create(e) {\n e.preventDefault();\n let id = $(\"#id\").val();\n let des = $(\"#description\").val();\n let price = $(\"#price\").val();\n let rooms = $(\"#rooms\").val();\n let mail = $(\"#mail\").val();\n let name = $(\"#name\").val();\n let pho = $(\"#phoneNr\").val();\n let re = new Rent(id, des, price, rooms, mail, name, pho);\n reReg.create(re, function () {\n window.location.href='/view/Rent.html';\n });\n }", "function NewEntryForm() {\n $(\"#addCancel\").click(this.clearForm);\n $(\"#addButton\").click(this.submitForm);\n }", "function newRegister(event) {\n event.preventDefault();\n\n var info = event.target.elements['info'].value;\n Register.setInfo(info, {from: defaultAccount, gas: 1000000});\n \n event.target.elements['info'].value = '';\n event.target.elements['info'].focus(); \n}", "function postCreate(data){\n $.post(location, data).done(function(_data){\n clearForm();\n updateTableCrate(_data);\n });\n }", "function onAdd() {\n\n var tmp = $scope.section.rows[$scope.section.rows.length - 1];\n if (tmp.cols.length > 0) {\n if (tmp.cols[0].fields.length > 0) {\n $scope.section.rows.push(OdsFormService.newRowObject());\n }\n }\n }", "function addNewPatron(e) {\n\te.preventDefault();\n\n\t// Add a new patron to global array\n // Can either use querySelector OR ...\n let name = e.target.children[0].value;\n // const name = document.querySelector('#newPatronName').value\n const patron = new Patron(name);\n patrons.push(patron);\n\n\t// Call addNewPatronEntry() to add patron to the DOM\n addNewPatronEntry(patron);\n}", "function CreateNewPatient(username, password, email, phone, firstname, lastname) {\r\n var patient = new Object();\r\n patient.username = username;\r\n patient.password = password;\r\n patient.email = email;\r\n patient.phone = phone;\r\n return patient;\r\n}", "'submit .medicine-entry'(event){\n\t\tevent.preventDefault();\n\n\t\tvar medicineIndex = event.target.medicineIndex.value;\n\t\tvar medicineName = event.target.medicineName.value;\n\t\tvar maxTemp = event.target.maxTemp.value;\n\t\tvar minTemp = event.target.minTemp.value;\n\n\t\tvar template = Template.instance();\n\n\t\tmyContract.addMedicine(medicineIndex, medicineName, maxTemp, minTemp, {data: code}, function (err, res){});\n\n\t\tevent.target.medicineIndex.value = \"\";\n\t\tevent.target.medicineName.value = \"\";\n\t\tevent.target.maxTemp.value = \"\";\n\t\tevent.target.minTemp.value = \"\";\n\n\t}", "function addNewContact() {\n if (validateInput()) {\n ContactsController.Add(\n $(\"#contactSupIDInput\")[0].value,\n $(\"#contactFullNameInput\")[0].value,\n $(\"#contactPhoneNoInput\")[0].value,\n onAddNewContact\n );\n }\n}", "function bookNewAppointment() {\n \tvm.flags.custInfoFormSubmitted = true;\n \tif(vm.model.selectedLocation != 'Choose Location' && \n\t\t(vm.model.selectedDate != undefined || vm.model.selectedDate != \"\") &&\n\t\t (vm.model.timeslot != null)) {\n \t\tif(vm.custInfoForm.$valid) {\n\t \t\tvar uid = $cookies.get('u_id');\n\t \t\tif(vm.custInfoFormFields.lastName == \"\" || vm.custInfoFormFields.lastName == undefined) {\n\t \t\t\tvar name = vm.custInfoFormFields.firstName;\n\t \t\t} else {\n\t \t\t\tvar name = vm.custInfoFormFields.firstName+ \" \"+vm.custInfoFormFields.lastName;\n\t \t\t}\t \t\t\n\t \t\tvar dateInstance = $('#booking1-dt').data(\"DateTimePicker\").date().format(\"YYYYMMDD\");\n\t \t\tvar year = $('#booking1-dt').data(\"DateTimePicker\").date().format(\"YYYY\");\n\t \t\tvar month = $('#booking1-dt').data(\"DateTimePicker\").date().format(\"MM\") - 1;\n\t \t\tvar day = $('#booking1-dt').data(\"DateTimePicker\").date().format(\"DD\");\n\t \t\tvar period = vm.model.timeslot.starttime.split(\" \")[1];\n\t \t\tif(period == \"PM\"){\n\t \t\t\tif(parseInt(vm.model.timeslot.starttime.split(\" \")[0].split(\":\")[0]) < 12) {\n\t \t\t\t\tvar apptHrs = parseInt(vm.model.timeslot.starttime.split(\" \")[0].split(\":\")[0]) + 12;\n\t \t\t\t} else {\n\t \t\t\t\tvar apptHrs = vm.model.timeslot.starttime.split(\" \")[0].split(\":\")[0];\n\t \t\t\t}\n\t \t\t}\n\t \t\telse {\n\t \t\t\tvar apptHrs = vm.model.timeslot.starttime.split(\" \")[0].split(\":\")[0];\n\t \t\t} \t\t\n\t \t\tvar apptMins = vm.model.timeslot.starttime.split(\" \")[0].split(\":\")[1];\n\n\t \t\t/*from epoch time*/\n\t \t\tvar fromCurrentDate = new Date(year, month, day);\n\t \t\tfromCurrentDate.setHours(apptHrs);\n\t \t\tfromCurrentDate.setMinutes(apptMins);\n\t \t\tvar apptstarttime = moment(fromCurrentDate).format(\"YYYY-MM-DD hh:mm A\");\n\n\t \t\t/* Customer information object for taking new appointment */\n\t \t\tif(vm.promoobj.promocodeid == '' || vm.promoobj.promocodeid == null) {\n\t \t\t\tvar apptObj = {\n\t\t \t\t\t\"customer\": {\n\t\t\t\t\t\t\t\"cityid\": localVariables.cityId,\n\t\t\t\t\t\t\t\"name\": name,\n\t\t\t\t\t\t\t\"phone\": vm.custInfoFormFields.mobile,\n\t\t\t\t\t\t\t\"email\": vm.custInfoFormFields.email,\n\t\t\t\t\t\t\t\"pincode\": vm.model.selectedLocation.pincodeid,\n\t\t\t\t\t\t\t\"address\": vm.custInfoFormFields.address,\n\t\t\t\t\t\t\t\"problem\": vm.model.problemName,\n\t\t\t\t\t\t\t\"gender\": vm.custInfoFormFields.gender,\n\t\t\t\t\t\t\t\"signMeUp\": vm.custInfoFormFields.signup\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"apptslots\": [apptstarttime],\n\t\t\t\t\t\t\"adminid\": uid,\n\t\t\t\t\t\t\"comments\": vm.custInfoFormFields.comments,\n\t\t\t\t\t\t\"zoneid\": vm.model.selectedLocation.zoneid,\n\t\t\t\t\t\t\"serviceid\": vm.model.physiotherapyId,\n\t\t\t\t\t\t\"address\": vm.custInfoFormFields.address,\n\t\t\t\t\t\t\"usecustomeraddress\": false,\n\t\t\t\t\t\t\"locality\": vm.model.selectedLocation.localities,\n\t\t\t\t\t\t\"apptRootId\": \"\"\n\t\t \t\t};\n\t \t\t} else {\n\t \t\t\tvar apptObj = {\n\t\t \t\t\t\"customer\": {\n\t\t\t\t\t\t\t\"cityid\": localVariables.cityId,\n\t\t\t\t\t\t\t\"name\": name,\n\t\t\t\t\t\t\t\"phone\": vm.custInfoFormFields.mobile,\n\t\t\t\t\t\t\t\"email\": vm.custInfoFormFields.email,\n\t\t\t\t\t\t\t\"pincode\": vm.model.selectedLocation.pincodeid,\n\t\t\t\t\t\t\t\"address\": vm.custInfoFormFields.address,\n\t\t\t\t\t\t\t\"problem\": vm.model.problemName,\n\t\t\t\t\t\t\t\"gender\": vm.custInfoFormFields.gender,\n\t\t\t\t\t\t\t\"signMeUp\": vm.custInfoFormFields.signup\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"apptslots\": [apptstarttime],\n\t\t\t\t\t\t\"adminid\": uid,\n\t\t\t\t\t\t\"comments\": vm.custInfoFormFields.comments,\n\t\t\t\t\t\t\"zoneid\": vm.model.selectedLocation.zoneid,\n\t\t\t\t\t\t\"serviceid\": vm.model.physiotherapyId,\n\t\t\t\t\t\t\"address\": vm.custInfoFormFields.address,\n\t\t\t\t\t\t\"usecustomeraddress\": false,\n\t\t\t\t\t\t\"locality\": vm.model.selectedLocation.localities,\n\t\t\t\t\t\t\"apptRootId\": \"\",\n\t\t\t\t\t\t\"promocode\": vm.promoobj.promocode\n\t\t \t\t};\n\t \t\t}\n\t \t\t\n\t \t\tconsole.log(apptObj);\n\n\t \t\t/*API for taking new appointment*/\n\t \t\tcustApi.createNewAppointment(apptObj).\n\t \t\tsuccess(function (data, status, headers, config) {\n\t \t\t\tconsole.log(\"Appointment booked successfully\");\n\t \t\t\t\n\t \t\t\t// CompleteRegistration\n\t \t\t\t// Track when a registration form is completed (ex. complete subscription, sign up for a service)\n\t \t\t\ttry {\n\t \t\t\t\tfbq('track', 'CompleteRegistration');\n\t \t\t\t} catch(err) {}\n\n\t \t\t\t// Google Analytics - 'Appointment Booked' event\n\t \t\t\ttry {\n\t \t\t\t\tga('send', 'event', 'Appointment Booked', 'click');\n\t \t\t\t} catch(err) {}\n\n\t \t\t\t// load Google Conversion script now\n\t \t\t\tvm.method.loadConversionScript();\n\t \t\t\t\n\t \t\t\tconsole.log(data);\n\t \t\t\tvm.model.appointmentRefNumber = data.payload[0].refno;\n\t \t\t\t/*alert(\"Thank you for confirming appointment. Appointment reference number is: \"+vm.model.appointmentRefNumber);*/\n\t \t\t\tvar confirmationObj = {\n\t \t\t\t\t\"address\": data.payload[0].address,\n\t \t\t\t\t\"startdate\": $('#booking1-dt').data(\"DateTimePicker\").date().format(\"DD-MM-YYYY\"),\n\t \t\t\t\t\"time\": vm.model.timeslot.starttime,\n\t \t\t\t\t\"price\": \"Consulting charges Rs. \"+vm.model.apptCost,\n\t \t\t\t\t\"custName\": data.payload[0].apptpatientname,\n\t \t\t\t\t\"spname\": data.payload[0].spname\n\t \t\t\t};\n\t \t\t\tcustportalGetSetService.setConfirmObj(confirmationObj);\n\t \t\t\t$state.go(\"bookingConfirmation\");\n\t \t\t}).\n\t \t\terror(function (data, status, headers, config) {\n\t \t\t\t//alert(data.error.message);\n\t \t\t\tvm.flags.confirmAppointmentError = true;\n\t \t\t\tvm.flags.bookingErrorContainer = vm.flags.confirmAppointmentError;\n\t\t\t\t\tvm.model.bookingErrorMessageContainer = data.error.message;\n\t\t\t\t\t$timeout(function () { vm.flags.bookingErrorContainer = false; vm.flags.confirmAppointmentError = false; }, 5000);\n\t \t\t\tconsole.log(\"Appointment booking Failed\");\n\t \t\t});\n\t \t} else {\n\t \t\twindow.scrollTo(0,0);\n\t \t}\n \t} else {\n \t\t//alert(\"Please fill the Booking Details in the top panel to proceed.\");\n \t\tvm.flags.innerPageBookNowError = true;\n\t\t\tvm.flags.bookingErrorContainer = vm.flags.innerPageBookNowError;\n\t\t\tvm.model.bookingErrorMessageContainer = 'Please fill the Booking Details in the top panel to proceed.';\n\t\t\t$timeout(function () { vm.flags.bookingErrorContainer = false; vm.flags.innerPageBookNowError = false; }, 5000);\n \t} \t\n }", "function entryAddSuccess(entry) {\n entryAddRow(entry);\n formClear();\n}", "function newEntryListener() {\n $('#new-entry-form').on('submit', function(event) {\n let formInput = {\n acronym: $('#acronym-input').val(),\n spellOut: $('#spell-out-input').val(),\n categoryTitle: $('#category-input').val()\n }\n //handle optional definition field\n if ($('#definition-input').val()) {\n formInput.definition = $('#definition-input').val();\n }\n\n $.ajax({\n type: 'POST',\n url: BASE_URL + 'acronyms',\n processData: false,\n contentType: 'application/json',\n data: JSON.stringify(formInput),\n success: function() {\n location.reload();\n }\n });\n });\n}", "function update_patient(up)\n{\n\tif(up.patient_id.value==\"\")\n\t{\n\t\talert(\"enter patient-id\");\n\t\tup.patient_id.focus();\n\t\treturn false;\n\n\t}\n\treturn true;\n}", "function addPerson() {\n if (!haveNewValue) {\n return;\n }\n\n var name = $newName.val();\n var location = $newFrom.val();\n var mode = $(\"input[name='newMode']:checked\", $newPersonForm).val();\n\n geocoder.geocode({\n \"address\": location, \"region\": \"GB\", componentRestrictions: {country: 'UK'}\n }, function (results, status) {\n if (status === google.maps.GeocoderStatus.OK && results[0].address_components.length > 1) { //Length of one is address of \"UK\" means it wasn't found.\n var latLng = results[0].geometry.location;\n if (editingPerson === undefined || editingPerson === null) { //Don't rely on falsy since person ids start from 0\n new Person(name, location, latLng, mode);\n } else {\n people[editingPerson].person.update(name, location, latLng, mode);\n editingPerson = null;\n }\n\n $newPersonForm[0].reset();\n haveNewValue = false;\n $addPersonBtn.addClass(\"disabled\");\n\n if (personId >= 2) {\n $submitButton.prop(\"disabled\", false);\n }\n\n $newName.focus()\n } else {\n addError(\"UNKNOWN_LOCATION\");\n }\n });\n }", "function handleAddNewPhone() {\n setPersonPhone([\n ...personPhone,\n { id: uuidV4(), phoneNumber: '' }\n ]);\n }", "function addNewProblemTypeToParentForm() {\n\tvar openerView = View.getOpenerView();\n\tif (openerView) {\n\n\t\tvar parentController = openerView.controllers.get('wrCreateController');\n\n\t\tif (parentController) {\n\n\t\t\t// re-load the parent problem types in parent form\n\t\t\tparentController.showParentProblemType();\n\n\t\t\tvar currntController = View.controllers.get('addNewProbTypeController');\n\t\t\tif (currntController.isFirstTier) {\n\n\t\t\t\t// if the new problem type is first tier, set the first tier in parent form\n\t\t\t\tparentController.createRequestForm.setFieldValue('prob_type_parent', currntController.addNewProbTypeForm.getFieldValue(\"probtype.prob_type\"));\n\t\t\t\tparentController.showSubProblemTypeByParent();\n\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t//get first tier and second tier\n\t\t\t\tvar secondTier = currntController.addNewProbTypeForm.getFieldValue(\"probtype.prob_type\");\n\t\t\t\tvar firstTier = secondTier.split('|')[0];\n\n\t\t\t\t// set the first tier and second tier in parent form\n\t\t\t\tparentController.createRequestForm.setFieldValue('prob_type_parent', firstTier);\n\t\t\t\tparentController.showSubProblemTypeByParent();\n\t\t\t\tparentController.createRequestForm.setFieldValue('prob_type_sub', secondTier);\n\n\t\t\t}\n\n\t //set problem type for priority\n\t\t parentController.setProblemType();\n\t\t\t\n\t\t\t// show priority\n\t\t\tparentController.priorityField.showPriority();\n\t\t}\n\n\t}\n}", "onNewTab(){\n console.log(\"onNewTab\");\n\n Session.set('selectedPatient', false);\n Session.set('patientDetailState', false);\n }", "function attachNewUserToIncident() {\n attachNewUser = true;\n $(\"#user_add_username\").val($(\"#user_name\").val());\n openAddUser();\n }", "function createNewNote(event) {\n event.preventDefault()\n // console.log(event.target.title.value, event.target.content.value)\n const newNoteObj = {}\n newNoteObj.color_id = event.target.color_id.value\n newNoteObj.title = event.target.title.value\n newNoteObj.content = event.target.content.value\n // console.log(newNoteObj) // newNoteObj structure is working: {title: \"meh\", content: \"mehmeh\"}\n postNewNote(newNoteObj) // invoking our postNewNote function here\n renderNoteOnColorShowPage(newNoteObj) // recycling this function (finally, learning to recycle!) Mother Earth you fucking owe me. It works!\n // question for later: wtf happened to those pink notes I created before I added this render? Oh lol I mislabeled it white nvm\n}", "submit(data, formRef) {\n const { date, type, location, associated, notes } = data;\n const owner = Meteor.user().username;\n Events.insert({ date, type, location, associated, notes, owner },\n (error) => {\n if (error) {\n swal('Error', error.message, 'error');\n } else {\n swal('Success', 'Item added successfully', 'success');\n formRef.reset();\n }\n });\n }", "function fhArrival_newArrival() {\n\t\n\tfhArrival_editMode();\n\tfhArrival_data = {};\n\tfhArrival_data.arrivalId = -1;\n\tfhArrival_data.arrival = {};\n\tfhArrival_data.arrival.ldvs = Array();\n\t\n}", "function newObject() {\r\n dojo.byId(\"newButton\").blur();\r\n id = dojo.byId('objectId');\r\n if (id) {\r\n id.value = \"\";\r\n unselectAllRows(\"objectGrid\");\r\n loadContent(\"objectDetail.php\", \"detailDiv\", dojo.byId('listForm'));\r\n } else {\r\n showError(i18n(\"errorObjectId\"));\r\n }\r\n}", "async postProcess () {\n\t\tawait this.creator.postCreate();\t\t\n\t}", "onCreate (item) {\n\t\t// Hide the create form\n\t\tthis.toggleCreateModal(false);\n\t\t// Redirect to newly created item path\n\t\tconst list = this.props.currentList;\n\t\tthis.context.router.push(`${Keystone.adminPath}/${list.path}/${item.id}`);\n\t}", "recordNewEntry() {\n\n document.getElementById(\"record\").addEventListener(\"click\", function () { // listen for a click <--\n let dateValue = document.getElementById(\"date-input\").value\n let conceptValue = document.getElementById(\"concept-input\").value\n let entryValue = document.getElementById(\"entry-input\").value\n let moodValue = document.getElementById(\"mood-input\").value\n\n const regex = /[^A-Za-z0-9;:{entryValue}()\\s]+/g\n\n if (conceptValue.match(regex) || entryValue.match(regex) || dateValue === \"\" || entryValue === \"\" || conceptValue === \"\") {\n window.alert(\"PLEASE REVIEW THE ENTERED INFO\")\n } else {\n console.log(dateValue, conceptValue, entryValue, moodValue)\n let journalFactoryObject = entryManager.entriesFactory(dateValue, conceptValue, entryValue, moodValue)\n\n console.log(journalFactoryObject)\n\n API.postJournalEntries(journalFactoryObject)\n }\n event.preventDefault();\n })\n }", "'click .add'(e, t) {\n \t\te.preventDefault();\n\n \t/*-------------- Get the value of form elements ---------*/ \n\n \t\tvar fname = t.find('#fname').value;\n \t\tvar lname = t.find('#lname').value;\n \t\tvar email = t.find('#email').value;\n \t\tvar address = t.find('#address').value;\n\n \t/*------------ Call insertRecord method -------------*/\n\n\t\tMeteor.call(\"insertRecord\", fname, lname, email, address);\n \t}", "function addNewItem() { switchToView('edit-form'); }", "function handleSubmit(e) {\n // function to create a new contact and then close the model\n e.preventDefault();\n createContact(idRef.current.value,nameRef.current.value);\n closeModal();\n\n // create contact\n }", "function handleChange(e) {\n const value = e.target.value;\n\n setNewPatient({\n ...newPatient,\n [e.target.name]: value,\n });\n }", "static createPatient(userId, name, email, dob, sex) {\n return admin.database().ref('patients/' + userId).set({\n name: name,\n email: email,\n dob: dob,\n sex: sex,\n prescription : [\"\"],\n doctors: [\"\"]\n }, log);\n\n }", "function addParentForm() {\n $('.add-parent-popup').show();\n $('.overlay').show();\n $('#edit-button').hide();\n $('#add-button').show();\n $(\"#pin-label\").text(\"* PIN #:\")\n $(\"#header\").text(\"Add Parent(s)\");\n $(\"#sign-instructions\").text(\"Please add parent first and last name(s) for one family.\");\n $('#p1-fn-input').focus();\n document.getElementById(\"PIN\").required = true;\n}", "onBtnNewClick() {\n\t\tthis.changeTripReportMode('add');\n\t}", "function createNewPlantForm(e){\n clearDivPlantField()\n clearDivNewPlantForm()\n let targetGardenId = parseInt(e.target.parentNode.id)\n let newPlantField = document.querySelector(`#new-plant-form-${targetGardenId}`)\n newPlantField.innerHTML = `\n <input hidden id=\"plant\" value=\"${targetGardenId}\" />\n Plant Name:\n <input id=\"plant\" type=\"text\"/>\n <br>\n Plant Type:\n <input id=\"plant\" type=\"text\"/>\n <br>\n Plant Family:\n <input id=\"plant\" type=\"text\"/>\n <br>\n <span class=\"plant-submit\" id=\"${targetGardenId}\">Submit</span>\n `\n let plantSubmit = document.querySelector(`.plant-submit`)\n plantSubmit.addEventListener(\"click\", handleNewPlantSubmit)\n}", "function setUpAdd() {\n refreshId();\n $('input[name=_method]').val('post');\n $('h2.title').text('Add New Record Page');\n $('input[name=product]').val('');\n $('input[name=quantity]').val('');\n $('input[name=price]').val('');\n $('.add-record').hide();\n }", "function newEvent(request, response){\n var contextData = {\n 'allowedDateInfo': allowedDateInfo\n };\n response.render('create-event.html', contextData);\n}", "function newEvent(request, response){\n var contextData = {\n 'allowedDateInfo': allowedDateInfo\n };\n response.render('create-event.html', contextData);\n}", "function onSubmit (fields, { setSubmitting } ) {\n console.log(\"From onSubmit these are the fields: \" + JSON.stringify(fields)); \n alertService.clear();\n subService.create(fields)\n .then(() => {\n // const { from } = location.state || { from: { pathname: \"/\" } };\n // history.push(from);\n alertService.success('Application submitted successfully', { keepAfterRouteChange: true });\n history.push('.');\n })\n .catch(error => {\n setSubmitting(false);\n alertService.error(error);\n });\n\n }", "addNew() {\n this.props.addMember();\n this.toggleCircle(document.getElementById('new-member-circle'));\n this.toggleFormDisplay();\n }", "function watchCreationForm() {\n $('#new-client-form').submit(event => {\n event.preventDefault();\n const newDogOwner = {\n firstName: $('#firstName-new-client').val(),\n lastName: $('#lastName-new-client').val(),\n dogNames: $('#dogNames-new-client').val(),\n address: $('#address-new-client').val(),\n notes: $('#notes-new-client').val(),\n walkTimeRange: $('#walkTimeRange-new-client').val(),\n walkDays: $('#walkDays-new-client').val(),\n phoneNumber: $('#phoneNumber-new-client').val(),\n email: $('#email-new-client').val()\n };\n\n HTTP.createDogOwner({\n jwtToken: STATE.authUser.jwtToken,\n newDogOwner: newDogOwner,\n onSuccess: owner => {\n alert('New Client added successfully.');\n window.open('/user/hub.html', '_self');\n },\n onError: err => {\n $('#error-message').html(`\n <p>There was an issue processing your request. Please verify that all entries are valid.</p>\n `);\n console.error(err);\n }\n });\n });\n}", "function aDashboardActionCreatePerson( p, el ) {\n\tlet windowTitle = `New Person...`;\n\n\tlet values = { name: 'Please, provide a name', descr: 'Please, provide a description...', position: 'Please, provide a position', icon:null };\n\t\n\tlet keyProperties = { descr: { height:'200px' } };\n\tlet rightPaneHTML = `<h1 align=center>Creating a New Person</h1>`;\n\n\tlet keys = [ 'name', 'position', 'descr', 'icon' ];\n\n\taDisplayDashboardDataArrayEditWindow( windowTitle, keys, values, \n\t\t{ rightPaneHTML:rightPaneHTML, keyProperties:keyProperties, saveURL:'/a_persons_new' } );\n}", "function setUpForm()\r\n {\r\n var form = {\r\n patients : patients,\r\n phlebotomists : phlebotomists,\r\n pscs : pscs,\r\n labTests : labTests,\r\n diagnoses : diagnoses\r\n };\r\n\r\n if (appId)\r\n {\r\n form.title = \"Updating Appointment \" + appId;\r\n // fill form with preexisting appointment info\r\n } else\r\n form.title = \"Create New Appointment\";\r\n\r\n container.append(appointmentFormTemplate(form));\r\n\r\n // Updating fields\r\n $(\"select#patient\").change(function()\r\n {\r\n $(\"span#patient\").html(patients[$(this).val()].name);\r\n $(\"span#physician\").html(patients[$(this).val()].physician.name);\r\n }).change();\r\n\r\n $(\"select#phlebotomist\").change(function()\r\n {\r\n $(\"span#phlebotomist\").html(phlebotomists[$(this).val()].name);\r\n }).change();\r\n\r\n $(\"select#psc\").change(function()\r\n {\r\n $(\"span#psc\").html(pscs[$(this).val()].name);\r\n }).change();\r\n\r\n $(\"input#addLabTest\").click(function()\r\n {\r\n $(\"div#labTestsBlock\").append(labTestTemplate(form));\r\n\r\n $(\"select#labTests\").change(function()\r\n {\r\n $(this).parent().children(\"span#labTest\").html(labTests[$(this).val()].name);\r\n }).change();\r\n\r\n $(\"select#diagnosis\").change(function()\r\n {\r\n $(this).parent().children(\"span#diagnosis\").html(diagnoses[$(this).val()].name);\r\n }).change();\r\n });\r\n\r\n $(\"input#pushAppointment\").click(function()\r\n {\r\n // convert to XML and send to server\r\n var app = {\r\n date : $(\"input#date\").val(),\r\n time : $(\"input#time\").val(),\r\n patient : $(\"select#patient\").val(),\r\n physician : patients[$(\"select#patient\").val()].physician.id,\r\n psc : $(\"select#psc\").val(),\r\n phlebotomist : $(\"select#phlebotomist\").val(),\r\n labTests : {}\r\n };\r\n\r\n $.each(_.map($(\"div#labTestsBlock\").children(\"div\"), function(val)\r\n {\r\n return {\r\n id : $(val).children(\"p\").children(\"select\")[0].value,\r\n dxcode : $(val).children(\"p\").children(\"select\")[1].value\r\n };\r\n }), function(i, o)\r\n {\r\n app.labTests[o.id] = o.dxcode;\r\n });\r\n\r\n var xml = appointmentXMLTemplate(app);\r\n\r\n function success(resp)\r\n {\r\n container.empty();\r\n var app = $(resp).children().children(\"uri\").html();\r\n var title = appId ? \"Appointment \" + appId + \" Updated\" : \"New Appointment Created\";\r\n container.append(\"<h3>\" + title + \"</h3><p style='padding-left:40px;'><a href='\" + app + \"'>\" + app + \"</a></p>\");\r\n appointmentWidget.refresh();\r\n }\r\n function error(resp)\r\n {\r\n container.empty();\r\n container.append($(resp.responseText).children(\"error\"));\r\n }\r\n\r\n if (appId)\r\n {\r\n $.ajax({\r\n url : serverURL + \"Appointments/\" + appId,\r\n method : \"PUT\",\r\n async : false,\r\n contentType : \"application/xml\",\r\n data : xml.trim()\r\n }).done(success).fail(error);\r\n } else\r\n {\r\n $.ajax({\r\n url : serverURL + \"Appointments\",\r\n method : \"POST\",\r\n async : false,\r\n contentType : \"application/xml\",\r\n data : xml.trim()\r\n }).done(success).fail(error);\r\n }\r\n });\r\n\r\n if (appId)\r\n {\r\n var app = appointments[appId];\r\n\r\n $(\"input#date\")[0].defaultValue = app.appointment.date;\r\n $(\"input#time\")[0].defaultValue = app.appointment.time;\r\n $(\"select#patient\").val(app.patient.id).change();\r\n $(\"select#phlebotomist\").val(app.phlebotomist.id).change();\r\n $(\"select#psc\").val(app.psc.id).change();\r\n\r\n // For as many labtests as this appointment has, click addLabTest\r\n // They are returned in order, so fill them in order\r\n for (var i = 0; i < app.labTests.tests.length; i++)\r\n $(\"input#addLabTest\").click();\r\n\r\n $.each($(\"select#labTests\"), function(i)\r\n {\r\n $(this).val(app.labTests.tests[i].labTest.id).change();\r\n });\r\n\r\n $.each($(\"select#diagnosis\"), function(i)\r\n {\r\n $(this).val(app.labTests.tests[i].diagnosis.dxcode).change();\r\n });\r\n\r\n } else\r\n {\r\n $(\"input#date\")[0].defaultValue = \"2015-05-20\";\r\n $(\"input#time\")[0].defaultValue = \"10:00\";\r\n }\r\n }", "addNewReport() {\n \n }", "'submit .add-course'(event, template) {\n event.preventDefault();\n \n const target = event.target;\n \n var course = {\n create_date: new Date(), \n name: target.name.value,\n semester: target.semester.value,\n year: target.year.value,\n professor: Meteor.user().username,\n students: [],\n days: [],\n chat: false,\n messages: [],\n code_snippets: []\n };\n //validating form before inserting\n if (validateForm()){\n Meteor.call('courses.insert', course, template.students.get(), function(error, result) {\n template.courseId.set(result);\n }); \n $(\"#course-added-message\").fadeIn(1000);\n $(\"#course-added-message\").fadeOut(4000);\n target.name.value = '';\n target.semester.value = 'Spring';\n target.year.value = '';\n template.students.set([]);\n }\n }", "function addNewActivity() {\n\n // get the name of the activity\n // and check that it's not empty\n var name = view.activityName.val();\n if (name == '') {\n event.preventDefault();\n event.stopPropagation();\n view.activityNameErrorLabel.addClass('error');\n return;\n }\n\n // get the length of the activity\n // and check that the value is numerical and greater than 0\n var length = view.activityLength.val();\n if (isNumber(length)) {\n if (length <= 0) {\n event.preventDefault();\n event.stopPropagation();\n view.activityLengthErrorLabel.html('Length must be greater than 0.');\n view.activityLengthErrorLabel.addClass('error');\n return;\n }\n } else {\n event.preventDefault();\n event.stopPropagation();\n view.activityLengthErrorLabel.html('Value must be numerical.');\n view.activityLengthErrorLabel.addClass('error');\n return;\n }\n // the value we got from the dialog is a string and we have to convert\n // it to an integer, otherwise we get weird results when computing the total\n // length of a day (found out the hard way ;-))\n length = parseInt(length);\n\n // get the type of the activity\n var type = view.activityType.val();\n switch (type) {\n case '0':\n type = 0; break;\n case '1':\n type = 1; break;\n case '2':\n type = 2; break;\n case '3':\n type = 3; break;\n default:\n console.log(\"Error: unknown activity type\");\n }\n\n // get the description of the activity\n var description = view.activityDescription.val();\n\n // create new activity and add it to the model\n var newActivity = new Activity(name, length, type, description);\n model.addParkedActivity(newActivity);\n\n }", "function addData(data) {\n console.log(` Adding: ${data.name} (${data.owner})`);\n Patients.insert(data);\n}", "function populatePatientInfo( patient, showinfo, modify, holderId, singleMatch ) {\n\n var holder = getHolder(holderId);\n\n populateInputFieldCalllog(holder.find(\".calllog-patient-id-radio\"),patient,'id',modify);\n disableField(holder.find(\".calllog-patient-id-radio\"),false);\n\n //calllog-patient-id\n populateInputFieldCalllog(holder.find(\".calllog-patient-id\"),patient,'id',modify);\n holder.find(\".calllog-patient-id\").trigger('change');\n holder.find(\".calllog-patient-id\").change();\n\n //patienttype-patient-id\n populateInputFieldCalllog(holder.find(\".patienttype-patient-id\"),patient,'id',modify);\n holder.find(\".patienttype-patient-id\").trigger('change');\n holder.find(\".patienttype-patient-id\").change();\n\n //testing!!!\n // if( patient ) {\n // var disableStr = \"disabled\";\n // var mrntype = holder.find('.mrntype-combobox');\n // var mrnid = holder.find('.patientmrn-mask');\n // calllogAddMrnType(patient);\n // mrntype.prop(disableStr, false);\n // mrnid.prop(disableStr, false);\n // //\"readonly\"\n // mrntype.prop(\"readonly\", false);\n // mrnid.prop(\"readonly\", false);\n // return; //testing\n // }\n\n processMrnFieldsCalllog(patient,modify,holderId);\n\n populateInputFieldCalllog(holder.find(\".patient-dob-date\"),patient,'dob',modify);\n\n populateInputFieldCalllog(holder.find(\".encounter-lastName\"),patient,'lastname',modify);\n\n populateInputFieldCalllog(holder.find(\".encounter-firstName\"),patient,'firstname',modify);\n\n populateInputFieldCalllog(holder.find(\".encounter-middleName\"),patient,'middlename');\n\n populateInputFieldCalllog(holder.find(\".encounter-suffix\"),patient,'suffix');\n\n populateSelectFieldCalllog(holder.find(\".encountersex-field\"),patient,'sex');\n\n populateInputFieldCalllog(holder.find(\".patient-phone\"),patient,'phone',modify);\n\n populateInputFieldCalllog(holder.find(\".patient-email\"),patient,'email',modify);\n\n //console.log('middlename='+middlename+'; suffix='+suffix+'; sex='+sex);\n //console.log('showinfo='+showinfo);\n if( patient && patient.id || showinfo ) {\n //console.log('show encounter info');\n holder.find('#encounter-info').show(_transTime); //collapse(\"show\");\n holder.find('#addnew_patient_button').hide(_transTime);\n } else {\n //console.log('hide encounter info');\n holder.find('#encounter-info').hide(_transTime); //collapse(\"hide\");\n }\n\n// //change the \"Find or Add Patient\" button title to \"Re-enter Patient\"\n// if( patient && patient.id && patient.lastname && patient.firstname && patient.dob ) {\n// holder.find('#search_patient_button').html('Re-enter Patient');\n// } else {\n// holder.find('#search_patient_button').html('Find Patient');\n// }\n\n //when the patient is selected change the title of the accordion from \"Patient Info\" to:\n // \"LastName, FirstName MiddleName Suffix | MM-DD-YYYYY | M | MRN Type: MRN\"\n if( patient ) {\n calllogSetPatientAccordionTitle(patient, holderId);\n }\n\n calllogShowHideListPreviousEntriesBtn(patient);\n if( patient ) {\n //click btn\n $('#calllog-list-previous-entries-btn').click();\n $('#calllog-list-previous-tasks-btn').click();\n }\n\n //TODO: add previous encounters to the \".combobox-previous-encounters\"\n if( patient ) {\n calllogAddPreviousEncounters(patient);\n }\n\n //console.log('populate PatientInfo: finished');\n}", "recordsubmit(angForm) {\n console.log(angForm.value);\n this.gms.insertData(angForm.value);\n angForm.reset();\n //this.route.navigate(['/home/view-expense']);\n // this.toastr.success('successfully Added');\n }", "NewItemForm(e) {\n if (typeof this.props.onNew === 'function') {\n var props = {\n type: \"existing\",\n item_id: this.props.menu[1].item_id,\n menu: {\n \"name\": this.props.menu[0],\n \"category\": this.props.menu[1].category,\n \"price\" : this.props.menu[1].price,\n \"calories\": this.props.menu[1].calories,\n \"in_stock\": this.props.menu[1].in_stock,\n \"description\": this.props.menu[1].description\n }\n }\n this.props.onNew(props);\n }\n }", "showCreateForm(data) {\n this.clearNewOrgan(data);\n this.changeFormMode(this.FORM_MODES.CREATE);\n }", "function new_alt_loc() {\n\t \n\t $.ajax({\n\t\t type: \"POST\",\n\t\t url: \"/advertiser_admin/form_actions/advert_alt_loc_frm.deal\",\n\t\t success: function(msg){\n\t\t jQuery(\"#alt_loc_form_area\").html(msg);\n\t\t }\n\t });\n\t \n }", "function createMeeting(formInfoObj){\n\n\t\n}", "function handleClick(){\n base('reservation').create([\n {\n \"fields\": {\n \"res_cus_id\" : [newCustomerId],\n \"res_date\": moment(newDate).format('YYYY-MM-DDTHH:mm:ssZ'),\n \"res_em_id\": [newEmployeeId],\n \"res_remark\" : newRemark,\n }\n }\n ], function(err, records) {\n if (err) {\n console.error(err);\n alert(err);\n return;\n }\n records.forEach(function (record) {\n console.log(record.getId());\n alert(\"完成新增\");\n });\n });\n handleClose();\n }", "function toPatientDetail(uid){\n document.getElementById('input_uid').value = uid;\n document.getElementById('patient_detail_form').submit();\n}", "function Save() {\n if ($('#ab041AddEdit').valid()) {\n if (vm.isNew) {\n dataContext.add(\"/api/ab041\",vm.ab041).then(function (data) {\n notify.showMessage('success', \"ab041 record added successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab041/\";\n });\n } else {\n dataContext.upDate(\"/api/ab041\", vm.ab041).then(function (data) {\n notify.showMessage('success', \"ab041 record updated successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab041/\";\n });\n }\n }\n }", "saveNewQualification() {\n\t\tif (this.newQualification.description !== \"\" && this.newQualification.description !== null) {\n\t\t\tthis.PersonalDependenciesService.createQualification(this.newQualification).then((response) => {\n\t\t\t\tthis.qualificationList.push(response.data);\n\t\t\t\tthis.cancelNewQualification();\n\t\t\t\talertify.success(\"Сохранено\", 5);\n\t\t\t});\n\t\t} else {\n\t\t\talertify.error(\"Квалификация не заполнена\", 5);\n\t\t}\n\t}", "onNew(handler) {\n return this.onEvent(handler, 'issue.new');\n }", "function submitBtn(){\n\n window.alert(\"it worked!\");\n\n //Config the Model\n var newResource = {\n techFirstName: document.getElementById(\"firstName\").value, //Put the tech first name here\n techLastName: document.getElementById(\"lastName\").value //Put the tech last name here\n };\n\n resourceRef.push(newResource);\n window.location = \"success.html\";\n\n}", "function createNewFaculty(facultyInstance) {\n var faculty = {};\n faculty.facultyName = facultyInstance;\n facultyService.insertNewFaculty(faculty).then(function (response) {\n if (response.status === 200) {\n swal('success', \"insert new faculty\", 'success');\n getFacultyData();\n } else {\n swal('Error', 'Not inserted record', 'error');\n }\n });\n }", "function addNewContact(model) {\n var selectedType = {};\n selectedType.type = model == 'medical_provider' ? 'medicalBillsproviderid' : '';\n var modalInstance = contactFactory.openContactModal(selectedType);\n modalInstance.result.then(function (response) {\n response['firstname'] = response.first_name;\n response['lastname'] = response.last_name;\n response['contactid'] = (response.contact_id).toString();\n vm.newMedicalBillInfo[model] = response;\n setType(response);\n }, function () { });\n }", "'submit .entity-entry'(event){\n\t\tevent.preventDefault();\n\n\t\tvar mtd = event.target.mtd.value;\n\t\tvar entityAddr = event.target.entityAddr.value;\n\t\tvar entityName = event.target.entityName.value;\n\n\t\tvar template = Template.instance();\n\n\t\tmyContract.addEntity(mtd, entityAddr, entityName, {data: code}, function (err, res){\n\t\t\tconsole.log(err);\n\t\t});\n\n\t\tevent.target.mtd.value = \" \";\n\t\tevent.target.entityAddr.value = \" \";\n\t\tevent.target.entityName.value = \" \";\n\t}", "function initAddPatientSection(){\r\n\t/*\r\n\t * DEFINE ELEMNTS\r\n\t * */\r\n\t\r\n\t$(\"#dob-value\").datepicker({changeMonth: true,yearRange: \"1900:\"+moment().year(),dateFormat: \"yy-mm-dd\",changeYear: true});\r\n\t$(\"#dod-value\").datepicker({changeMonth: true,yearRange: \"1900:\"+moment().year(),dateFormat: \"yy-mm-dd\",changeYear: true});\r\n\t$(\"#ddate-value\").datepicker({changeMonth: true,yearRange: \"1900:\"+moment().year(),dateFormat: \"yy-mm-dd\",changeYear: true});\r\n\r\n\t$(community).each(function(index, value) {$(\"#idcommunity-value\").append($(\"<option />\").val(index).text(value));});\r\n\t$(dtype).each(function(index, value) {$(\"#dtype-value\").append($(\"<option />\").val(index).text(value));});\r\n\r\n\t$(\"input[name='iscree']\").filter(\"[value='0']\").prop('checked', true);\r\n\t$(\"input[name='iscree']\").val(0);\r\n\t$(\"input[name='deceased']\").filter(\"[value='0']\").prop('checked', true);\r\n\t$(\"input[name='deceased']\").val(0);\r\n\t$(\"#deceased-section\").hide();\r\n\t$(\"#dtype-value\").val(0);\r\n\t$(\"#idcommunity-value\").val(0);\r\n\r\n\t/*\r\n\t * MAIN\r\n\t * */\r\n\t$(\".cdismenu\").hide();\r\n\t$(\".side\").hide();\r\n\t$(\".cdisbody_addpatient\").fadeIn(350);\r\n\t$(\".fnew\").hide();\r\n\t$(\".freports\").hide();\r\n\tresetForm($(\"#addpatient-form\"));\r\n\tinitAutocompleteHcp($(\"#chr\"));\r\n\tinitAutocompleteHcp($(\"#md\"));\r\n\tinitAutocompleteHcp($(\"#nur\"));\r\n\tinitAutocompleteHcp($(\"#nut\"));\r\n\t/*\r\n\t * EVENTS\r\n\t * */\r\n\t$(\"#radio-deceased input[type=radio]\").on(\"change\",function() {\r\n\t\tif($(\"input[name='deceased']:checked\").attr(\"id\") == \"deceased-yes-value\"){\r\n\t\t\t$(\"input[name='deceased']:checked\").val(\"1\");\r\n\t\t\t$(\"#deceased-section\").show();\r\n\t\t\t$(\"#deceased-yes-value\").prop(\"checked\",true);\r\n\t\t\t$(\"#deceased-no-value\").prop(\"checked\",false);\r\n\t\t}else{\r\n\t\t\t$(\"input[name='deceased']:checked\").val(\"0\");\r\n\t\t\t$(\"#deceased-section\").hide();\r\n\t\t\t$(\"#deceased-yes-value\").prop(\"checked\",false);\r\n\t\t\t$(\"#deceased-no-value\").prop(\"checked\",true);\r\n\t\t}\r\n\t});\r\n\t$(\"#radio-sex label\").on(\"change\",function() {$(\"input[name='sex']\").val($(this).find(\"input[type='radio']\").val());});\r\n\t$(\"#cancel-addpatient\").on(\"click\",function() {gts(sid,\"en\");});\r\n\t$(\"#add-patient\").on(\"click\",addPatient);\r\n\t$('#myModal').on('show.bs.modal', populateAddPatientConfirm);\r\n\t$(\"#save-addpatient\").on(\"click\",showAddPatientConfirm);\r\n}", "function saveNewOp() {\n let newEntry = {\n date: new Date().toJSON(),\n cat: pageDialog.category.value,\n amount: pageDialog.amount.value,\n desc: pageDialog.desc.value\n };\n entriesDb.insert(newEntry);\n displayEntries();\n }", "function storeNewEntry() {\r\n dojo.xhrPost({\r\n url: \"/rpc/insert\",\r\n content: {\r\n \"board_id\": boardID,\r\n \"name\": newName,\r\n \"rotations\": newRotations\r\n },\r\n load: storeNewEntrySucceeded,\r\n error: storeNewEntryFailed\r\n });\r\n }", "function new_customer(e){\r\n\t\te.preventDefault();\r\n\t\ttest.templateScenariosPromise = prepare_scenario_check();\r\n\t\t//after the template data has loaded, we create the the customer\r\n\t\ttest.templateScenariosPromise.always(create_customer);\r\n \t}", "function handleNewItemSubmit() {\r\n $('main').on('submit','#new-bookmark-form', event => {\r\n console.log(\"new item submit is listening\");\r\n event.preventDefault();\r\n let data = serializeJson(event.target)\r\n console.log(data)\r\n api.createBookmark(data)\r\n .then((newItem) => {\r\n console.log(newItem);\r\n store.addItem(newItem);\r\n store.error=null;\r\n store.filter = 0;\r\n store.adding = false;\r\n render();\r\n })\r\n .catch((error) => {\r\n store.setError(error.message);\r\n renderError();\r\n });\r\n })\r\n}", "onSubmit(e) {\n this.addPerson(this.state.person);\n e.preventDefault();\n }", "function submitPatientBtn(holderId) {\n\n var holder = getHolder(holderId);\n\n var addBtn = $(\"#submit_patient_button\").get(0);\n var lbtn = Ladda.create( addBtn );\n calllogStartBtn(lbtn);\n\n //calllog-patient-id-patient-holder-1\n //console.log(\"id=\"+\"#calllog-patient-id-\"+holderId);\n var patientId = holder.find(\"#calllog-patient-id-\"+holderId).val();\n //console.log(patientIdField);\n //var patientId = $(\"#calllog-patient-id-\"+holderId).val();\n //console.log(\"patientId=\"+patientId);\n\n var mrntype = holder.find(\".mrntype-combobox\").select2('val');\n mrntype = trimWithCheck(mrntype);\n\n var mrn = holder.find(\".patientmrn-mask\").val();\n mrn = trimWithCheck(mrn);\n\n var dob = holder.find(\".patient-dob-date\").val();\n dob = trimWithCheck(dob);\n\n var lastname = holder.find(\".encounter-lastName\").val();\n lastname = trimWithCheck(lastname);\n\n var firstname = holder.find(\".encounter-firstName\").val();\n firstname = trimWithCheck(firstname);\n\n var middlename = holder.find(\".encounter-middleName\").val();\n middlename = trimWithCheck(middlename);\n\n var suffix = holder.find(\".encounter-suffix\").val();\n suffix = trimWithCheck(suffix);\n\n var sex = holder.find(\".encountersex-field\").select2('val');\n sex = trimWithCheck(sex);\n\n var phone = holder.find(\".patient-phone\").val();\n phone = trimWithCheck(phone);\n\n var email = holder.find(\".patient-email\").val();\n email = trimWithCheck(email);\n\n if( 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(String(email).toLowerCase()) ) {\n //email is valid\n } else {\n holder.find('#calllog-danger-box').html(\"Please enter a valid email address.\");\n holder.find('#calllog-danger-box').show(_transTime);\n calllogStopBtn(lbtn);\n return false;\n }\n }\n\n //check if \"Last Name\" field + DOB field, or \"MRN\" fields are not empty\n //if( !mrn || !mrntype || !lastname || !dob ) {\n if( mrntype && mrn || lastname && dob ) {\n //if( mrntype && mrn || lastname ) {\n //ok\n } else {\n holder.find('#calllog-danger-box').html(\"Please enter at least an MRN or Last Name and Date of Birth.\");\n //holder.find('#calllog-danger-box').html(\"Please enter at least an MRN or Last Name.\");\n holder.find('#calllog-danger-box').show(_transTime);\n\n calllogStopBtn(lbtn);\n return false;\n }\n\n //\"Are You sure you would like to create a new patient registration record for\n //MRN: Last Name: First Name: Middle Name: Suffix: Sex: DOB: Alias(es):\n var confirmMsg = \"Are You sure you would like to update the patient record for patient ID #\"+patientId+\". \";\n\n if( mrn )\n confirmMsg += \" MRN:\"+mrn;\n if( lastname )\n confirmMsg += \" Last Name:\"+lastname;\n if( firstname )\n confirmMsg += \" First Name:\"+firstname;\n if( middlename )\n confirmMsg += \" Middle Name:\"+middlename;\n if( suffix )\n confirmMsg += \" Suffix:\"+suffix;\n if( sex )\n confirmMsg += \" Gender:\"+sex;\n if( dob )\n confirmMsg += \" DOB:\"+dob;\n if( phone )\n confirmMsg += \" Phone:\"+phone;\n if( email )\n confirmMsg += \" E-Mail:\"+email;\n\n if( confirm(confirmMsg) == true ) {\n //x = \"You pressed OK!\";\n } else {\n //x = \"You pressed Cancel!\";\n calllogStopBtn(lbtn);\n return false;\n }\n\n var metaphone = calllogGetMetaphoneValue(holderId);\n\n //Clicking \"Ok\" in the Dialog confirmation box should use the variables\n // to create a create the new patient on the server via AJAX/Promise,\n // then lock the Patient Info fields, and change the title of the \"Find Patient\" button to \"Re-enter Patient\"\n //ajax\n var url = Routing.generate('calllog_edit_patient_record_ajax');\n $.ajax({\n url: url,\n timeout: _ajaxTimeout,\n async: true,\n data: {patientId: patientId, mrntype: mrntype, mrn: mrn, dob: dob, lastname: lastname, firstname: firstname, middlename: middlename, phone: phone, email: email, suffix: suffix, sex: sex, metaphone:metaphone},\n }).success(function(data) {\n //console.log(\"output=\"+data);\n if( data == \"OK\" ) {\n //console.log(\"Patient has been created\");\n //hide find patient and add new patient\n holder.find('#search_patient_button').hide(_transTime);\n holder.find('#addnew_patient_button').hide(_transTime);\n //show Re-enter Patient\n holder.find('#reenter_patient_button').show(_transTime);\n //clean error message\n holder.find('#calllog-danger-box').html('');\n holder.find('#calllog-danger-box').hide(_transTime);\n\n //disable all fields\n disableAllFields(true,holderId);\n\n //show edit patient info button\n holder.find('#edit_patient_button').show(_transTime);\n\n } else {\n //console.log(\"Patient has not been created\");\n holder.find('#calllog-danger-box').html(data);\n holder.find('#calllog-danger-box').show(_transTime);\n }\n }).done(function() {\n calllogStopBtn(lbtn);\n });\n\n\n}", "processCreateNewList() {\n // MAKE A BRAND NEW LIST\n window.todo.model.loadNewList();\n\n // CHANGE THE SCREEN\n window.todo.model.goList();\n }", "function addFormPopUp(container, e) {\n\t\t\t\te.preventDefault()\n\t\t\t\tXenForo.ajax(\n\t\t\t\t\tadd_entry_html,\n\t\t\t\t\t{},\n\t\t\t\t\tfunction (ajaxData, textStatus) {\n\t\t\t\t\t\tif (ajaxData.templateHtml) {\n\t\t\t\t\t\t\tnew XenForo.ExtLoader(e, function() {\n\t\t\t\t\t\t\t\tXenForo.createOverlay('',ajaxData.templateHtml, '').load();\n\t\t\t\t\t\t\t\tconsole.log($(container));\n\t\t\t\t\t\t\t\t$('div.overlayHeading').text(\"Add Frag Entry\");\n\t\t\t\t\t\t\t\t$('[name=dbtc_thread_id]').val($(container).find('div#dbtc_thread_id').attr('value'));\n\t\t\t\t\t\t\t\t// id of donor is in the dbtc_username value field\n\t\t\t\t\t\t\t\t$('[name=dbtc_donor_id]').val($(container).find('div#dbtc_receiver_id').attr('value'));\n\t\t\t\t\t\t\t\t$('[name=dbtc_date]').val($(container).find('div#dbtc_date').text());\n\t\t\t\t\t\t\t\t$('[name=dbtc_parent_transaction_id]').val($(container).attr('data-id'));\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}", "function enterPersonalDetails() {\n // common.setHiddenButton(\"firstTime\", true)\n // personalInfo().presentForm;\n console.log(\"before Getfirsttime: \" + common.getFirstTime());\n common.setFirstTime(false);\n console.log(\"after Getfirsttime: \" + common.getFirstTime());\n console.log(\"before firstTIme hiddenbutton: \"+ common.hiddenButton.firstTime);\n common.setHiddenButton(\"firstTime\", true);\n console.log(\"after firstTIme hiddenbutton: \"+ common.hiddenButton.firstTime);\n personalDetails().startForm();\n }", "function populatePatientInformation(data) {\n visible.patientFirstName = data.patientFirstName;\n visible.patientLastName = data.patientLastName;\n visible.patientAge = data.patientAge;\n visible.patientGender = data.patientGender;\n visible.nihiiOrg = data.nihiiOrg;\n }", "function onNewContact(e) {\n \n if (typeof Contact !== \"undefined\") {\n \n contactForm.buildContactForm(null); \n $.mobile.changePage(\"#edit_contact_page\", { transition: \"pop\" });\n }\n collapse(e, \"new_contact_button\");\n $(\"#options_popup\").popup(\"close\");\n return cancelEventBubbling(e);\n}", "handleAccountCreated(evt) {\n this.createStatus = `Account record created. Id is ${evt.detail.id}.`;\n\n const event = new CustomEvent('newrecord', {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: { data: evt.detail },\n });\n this.dispatchEvent(event);\n }", "addNew(code, description, project, id){\n let error = !code || !description\n if(error){\n set(project,'error',error);\n }\n else{\n let step = this.get('store').findRecord('step',1);\n let story = this.get('store').createRecord('story',{code:code,description:description,step:step});\n set(story,'project',project);\n story.save().then(()=>{project.save();});\n //Set des valeurs de l'input à RIEN pour avoir le form vide\n set(project,'code','');\n set(project,'description','');\n this.transitionTo('projects.stories',id);\n }}", "function popupDdt_newDdt() {\n\t\n\tpopupDdt_data = {};\n\tpopupDdt_data.ddt = {};\n\tpopupDdt_data.ddtId = -1;\n\tpopupDdt_data.ddt.rows = Array();\n\t\n}", "'submit .new-note'(event) {\n // Prevent default browser form submit\n event.preventDefault();\n\n // Get value from form element\n const target = event.target;\n const text = target.text.value;\n\n // Insert a note into the collection\n Meteor.call('notes.insert', text);\n\n // Clear form\n target.text.value = '';\n }", "function directUserFromAddInfo() {\n if (nextStep == \"A new department\") {\n addDepartmenet();\n }\n if (nextStep == \"A new role\") {\n addRole();\n }\n if (nextStep == \"A new employee\") {\n addEmployee();\n } \n }" ]
[ "0.65605295", "0.63394827", "0.6076077", "0.59873825", "0.5979979", "0.59717774", "0.58715147", "0.5827756", "0.57883996", "0.5781332", "0.57645655", "0.5680425", "0.56733364", "0.5669627", "0.56656396", "0.5658745", "0.5657888", "0.5656485", "0.56321526", "0.56216335", "0.560231", "0.5601526", "0.5601208", "0.560064", "0.55909467", "0.5590454", "0.5562873", "0.5552465", "0.55477005", "0.5520418", "0.5519726", "0.55165374", "0.55104226", "0.5509683", "0.5508696", "0.55051315", "0.54899573", "0.5488886", "0.5485631", "0.54839814", "0.5480259", "0.5463668", "0.5456332", "0.54562336", "0.54531765", "0.54384834", "0.54383475", "0.5432796", "0.5426995", "0.54183847", "0.5413875", "0.5404414", "0.54022706", "0.54005885", "0.53997254", "0.5395522", "0.53938854", "0.5385731", "0.5385052", "0.5385052", "0.5382273", "0.537545", "0.5370225", "0.53647304", "0.5362033", "0.5361136", "0.53549016", "0.5347109", "0.5342798", "0.534128", "0.5335133", "0.53350246", "0.53275144", "0.5310768", "0.53094965", "0.53053635", "0.53044134", "0.5301922", "0.53018", "0.53011906", "0.52974415", "0.5288191", "0.52879125", "0.5283706", "0.52776206", "0.52711505", "0.52680224", "0.5267564", "0.52675384", "0.52648395", "0.5255106", "0.52522403", "0.5251291", "0.52503365", "0.5249293", "0.5239742", "0.5236856", "0.5234986", "0.5234431", "0.52331597", "0.523245" ]
0.0
-1
Called after patient deletion
function postDeleteAll() { $(".forms").animate({ scrollLeft: 0}, 400); removeForms(); $('html, body').animate({ scrollTop: 0 }, 400); $("#queryResetButton").click(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removePatient(id) {\n\tmyDB.transaction(function(transaction) {\n\t\ttransaction.executeSql(\"DELETE FROM patients_local where id=?\", [id], function(tx, result) {\n\t\t\tmyDB.transaction(function(transaction) {\n\t\t\t\ttransaction.executeSql(\"DELETE FROM drawings_local where pid=?\", [id], function(tx, result) {\n\t\t\t\t\tlocation.reload();\n\t\t\t\t},\n\t\t\t\tfunction(error){ navigator.notification.alert('Something went Wrong deleting drawings.');});\n\t\t\t});\n\t\t},\n\t\tfunction(error){ navigator.notification.alert('Something went Wrong');});\n\t});\n}", "async function handleRemovePatient() {\n \n Object.values(patients).map((patient) => {\n Object.values(patient.events).map((event) => {\n if (event.images) {\n Object.values(event.images).map((image) => {\n // Create a reference to the file to delete\n const path = getDefaultOrgID + '/' + image;\n var ref = storageRef.child(path);\n // Delete the file\n ref\n .delete()\n .then(() => {\n // File deleted successfully\n })\n .catch((error) => {\n props.handleSetError(14);\n });\n });\n return null;\n }\n return null;\n });\n return null;\n });\n setAllowUItoRefresh(false);\n const pid = focusPatientID; //need temporary id if not setFocusPatientID will reset the data and error will occure\n setFocusPatientID(null);\n await be_deletePatient(\n getDefaultOrgID,\n pid,\n (res) => {\n //Respond OK\n },\n (err) => {\n props.handleSetError(13);\n }\n );\n }", "onDeleted () {\n this.log('device deleted');\n }", "delete() {\n this.deleted = true;\n }", "onDeleted() {\n // this.log('device deleted');\n }", "destroy() {\n CommonUtils.callback('onDelete', this);\n }", "delete() {\n\t\tthis.data.delete();\n\t}", "delete_patient(patientID) {\n var inserts = [patientID];\n return this.pool.getConnection().then(connection => {\n var delete_indiv_user_query = mysql.format(general_sql.delete_user_sql, inserts);\n connection.release();\n var res = connection.query(delete_indiv_user_query)\n return res;\n }).then(res => {\n if (res.affectedRows !== 0) {\n return\n } else {\n throw new Error(\"No User Deleted\");\n }\n })\n }", "onDeleted() {\n\t\t\tthis.removeAllListeners();\n\t\t\tthis.signal.unregister(this);\n\t\t\tthis.signal.removeListener('data', this._onDataListener);\n\t\t\tthis.signal = null;\n\t\t}", "afterDelete() {\n let event = this.events[this.self.name];\n let index = event.indexOf(this.self.callback);\n event.splice(index, 1)\n }", "onDeleted() {\n\t\t// stop polling\n\t\tclearInterval(this.intervalIdDevicePoll);\n\t\tthis.log('device deleted');\n\t}", "async onDeleted() {\n this.log('device deleted', this.getName(), this.settings.serialNumber);\n this.client && this.client.end();\n this.timeout && clearTimeout(this.timeout);\n this.shouldSync = false;\n this.setUnavailable();\n }", "onDeleted() {\n\t\tthis.isDeleted = true;\n\t\tthis.getDriver().removeListener('nodes_changed', this.onNodesChanged);\n\t}", "afterDelete(result, params) {\n console.log(\"Hereeeeeeeeeee 16\");\n }", "function deleteIt(){\n \tupdateDB(\"delete\", pageElements.alertText.dataset.id);\n }", "function deleteSelectedDevice() {\n // TODO diagram: delete selected device\n if (selectedDevice){\n $(document).find(\"#\"+selectedDevice.type+selectedDevice.index).remove();\n devicesCounter.alterCount(-1);\n }\n }", "function delete_person(data) {\n\t\t$('#' + data['old_id']).remove();\n\t}", "deleteAccessory(event) {\n let ind = this.accesList.findIndex(record => record.Id === event.target.dataset.id);\n this.accesList.splice(ind, 1);\n this.countTotalAmontOnchange();\n }", "function deleteAppointment() {\n\n transition(\"DELETING\", true)\n \n // Async call to initiate cancel appointment\n props.cancelInterview(props.id).then((response) => {\n\n transition(\"EMPTY\")\n }).catch((err) => {\n\n transition(\"ERROR_DELETE\", true);\n });\n }", "function deletePannier() {\n dispatch({\n type: \"RESET\"\n })\n }", "onAfterDeleteEntity(data_obj) {\n\t\t//TODO: Override this as needed;\n\t}", "_onTempDelete(entry) {\n this._removeEntries([entry])\n }", "function _onDeleteSuccess() {\n var eventList = vm.items;\n var removeIndex = eventList.findIndex(function (element, index, eventList) {\n return element._id === vm.items._id;\n });\n eventList.splice(removeIndex, 1);\n vm.item = null;\n vm.toggleAdd = !vm.toggleAdd;\n }", "deleteRecord() {\n this._super(...arguments);\n const gist = this.gist;\n if(gist) {\n gist.registerDeletedFile(this.id);\n\n // Following try/catch should not be necessary. Bug in ember data?\n try {\n gist.get('files').removeObject(this);\n } catch(e) {\n /* squash */\n }\n }\n }", "onRegionDelete(deleted_region) {\n this.regions.splice(this.regions.indexOf(deleted_region), 1);\n }", "function flagToDelete() {\n _this.canDelete = true;\n }", "function fnOnDeleted(result) { }", "onAfterDeleteSelected(data_obj) {\n\t\t//TODO: Override this as needed;\n\t}", "onRecipeDelete() {\n this.recipeservice.deleteRecipe(this.Id);\n this.router.navigate(['/recipes']);\n }", "deleteTattoo () {\n\n }", "disconnectedCallback() {\r\n\t\t\tconsole.log(\"deleted\");\r\n\t\t}", "confirmDelete() {\n // this.order.destroyRecord();\n console.log('you have confired the delete for the order', this.order);\n }", "function deletePerson3(person) {\n document.getElementById('tblPerson').removeChild(person);\n}", "function deleteEntry(event){\n\n // important info to send\n var target = document.location.href;\n var patientID = event.dataset.patient;\n var operation = event.dataset.operation;\n var uniqid = event.dataset.uniqid;\n\n //creates a package that will be sent as a request to the server\n $.post(target, {operation: operation, patientID: patientID,uniqid: uniqid})\n\n}", "'click .btn-deleteLoc' (event) {\n\t\tthis.trip.get().dayArray[this.dayIndex].splice(this.locIndex, 1);\n\t\tthis.trip.set(this.trip.get());\n\t}", "function deleted(numero){\n \n //console.log(numero);\n Eliminarcore(numero);\n cargarTablaRecibidos();\n cargarTablaPrincipal();\n \n}", "function deleteVehicle() {\r\n\t\t\t\t\r\n\t\t\t\tself.confirm_title = 'Delete';\r\n\t\t\t\tself.confirm_type = BootstrapDialog.TYPE_DANGER;\r\n\t\t\t\tself.confirm_msg = self.confirm_title+ ' ' + self.vehicle.vehicle_regno + ' vehicle reg no?';\r\n\t\t\t\tself.confirm_btnclass = 'btn-danger';\r\n\t\t\t\tConfirmDialogService.confirmBox(self.confirm_title, self.confirm_type, self.confirm_msg, self.confirm_btnclass)\r\n\t\t\t\t.then(\r\n\t\t\t\t\t\tfunction (res) {\r\n\t\t\t\t\t\t\tVehicleService.deleteVehicle(self.vehicle.vehicle_id)\r\n\t\t\t\t\t\t\t.then(\r\n\t\t\t\t\t\t\t\t\tfunction (msg) {\r\n\t\t\t\t\t\t\t\t\t\tself.message = self.vehicle.vehicle_regno+ \" vehicle reg no Deleted..!\";\r\n\t\t\t\t\t\t\t\t\t\tsuccessAnimate('.success');\r\n\t\t\t\t\t\t\t\t\t\twindow.setTimeout(function(){\r\n\t\t\t\t\t\t\t\t\t\t\tnewOrClose();\r\n\t\t\t\t\t\t\t\t\t\t},5000);\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\tvar index=self.vehicles.indexOf(self.vehicle);\r\n\t\t\t\t\t\t\t\t\t\tself.vehicles.splice(index,1);\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t},function(referdata) {\r\n\t\t\t\t\t\t\t\t\t\tself.message = self.vehicle.vehicle_regno+ \" referred in Add Manifest..!\";\r\n\t\t\t\t\t\t\t\t\t\tsuccessAnimate('.failure');\r\n\t\t\t\t\t\t\t\t\t\twindow.setTimeout(function(){\r\n\t\t\t\t\t\t\t\t\t\t\tnewOrClose();\r\n\t\t\t\t\t\t\t\t\t\t},5000);\r\n\t\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\tfunction (errResponse) {\r\n\t\t\t\t\t\t\t\t\t\tconsole.error('Error while Delete vehicle' + errResponse);\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}\r\n\t\t\t\t\t )\r\n\t\t\t}", "function deleteDog() {}", "function OnDelete(meta) {\n log('deleting document', meta.id);\n delete dst_bucket[meta.id]; // DELETE operation\n}", "fileDeleted(){\n let form = this\n let file = ''\n $('#fileupload').bind('fileuploaddestroy', function (e, data) {\n // remove inputs named 'selected_files[]' that will interfere with the back end\n $(\"input[name='selected_files[]']\").remove();\n $(\"input[name='sf_ids']\").each(function(){\n $('div.fields-div').find(`input[name^='${$(this).val()}']`).remove();\n });\n //then remove yourself?\n // $(\"input[name='sf_ids']\").remove();\n });\n $('#fileupload').bind('fileuploaddestroyed', function (e, data) {\n // if student deletes uploaded primary file, we need to remove this param because the backend uses it to know when a browse-everything file is primary\n $('#be_primary_pcdm').remove();\n form.validatePDF()\n });\n\n $('#supplemental_fileupload').bind('fileuploaddestroy', function (e, data) {\n file = $(data.context).find('p.name span').text();\n });\n\n $('#supplemental_fileupload').bind('fileuploaddestroyed', function (e, data) {\n $('#supplemental_files_metadata tr').each(function(){\n if ($(this).find('td').first().text() === file) {\n $(this).remove();\n }\n });\n form.validateSupplementalFiles()\n })\n }", "function deleteData(){\n getIDs();\n}", "function remove_patient_click(id,patient,path){\n swal({\n title: \"Are you sure?\",\n text: `Cancel appointment for ${patient}?`,\n type: \"warning\",\n showCancelButton: true,\n confirmButtonColor: '#dc3545',\n cancelButtonColor: '#6c757d',\n confirmButtonText: 'Yes',\n cancelButtonText: 'No',\n reverseButtons: true\n })\n .then((result) => {\n if (result.value) {\n post(`${path}`,\n {'remove_id':id});\n }\n })\n }", "function onDelete() {\n setFileURL(false)\n console.log(\"delete file\");\n }", "deleteDSP(todelete) {\n if (todelete)\n faust.deleteDSPWorkletInstance(todelete);\n }", "deleteQualification(qualification) {\n\t\tthis.PersonalDependenciesService.deleteQualification(qualification).then(() => {\n\t\t\t_remove(this.qualificationList, (qual) => qual.id === qualification.id);\n\t\t\talertify.success(\"Квалификация удалена\", 5);\n\t\t}, () => {\n\t\t\talertify.error(\"Ошибка\", 5);\n\t\t});\n\t}", "delete() {\n this.afterDelete();\n Fiber.yield(true)\n }", "function deletePatient() {\r\n if (isAmbulanceOrdered()) {\r\n $('#deleteALERT').modal('hide');\r\n $(\"#trasanoModalHeader\").empty();\r\n $(\"#trasanoModalBody\").empty();\r\n $(\"#trasanoModalFooter\").empty();\r\n $(\"#trasanoModalBody\").append(\r\n \"<div class='alert alert-danger' role='alert'>\" + \r\n \"<p><span class='glyphicon glyphicon-alert' aria-hidden='true'></span> \" + \r\n \"<strong>Error!</strong> No se puede eliminar el usuario.</p>\" +\r\n \"</div>\" + \r\n \"<div class='alert alert-info' role='alert'>\" + \r\n \"<p><span class='glyphicon glyphicon-info-sign' aria-hidden='true'></span> Una ambulancia ha sido <strong>solicitada</strong>.</p>\" + \r\n \"<p><span class='glyphicon glyphicon-info-sign' aria-hidden='true'>\" + \r\n \"</span> Espere a que finalice el servicio o cancele el servicio si desea eliminar el usuario.</p>\" + \r\n \"</div>\"\r\n ); \r\n $(\"#trasanoModalHeader\").append(\"<h4>Eliminar paciente</h4>\");\r\n $(\"#trasanoModalFooter\").append(\"<button type='button' class='btn btn-primary' data-dismiss='modal'>CERRAR</button>\");\r\n $('#trasanoMODAL').modal('show');\r\n\r\n } else {\r\n localStorage.removeItem(\"dni\");\r\n localStorage.removeItem(\"name\");\r\n localStorage.removeItem(\"numss\");\r\n localStorage.removeItem(\"surname\");\r\n localStorage.removeItem(\"patientHome\");\r\n localStorage.removeItem(\"ambulance\");\r\n localStorage.removeItem(\"tagcode\");\r\n localStorage.removeItem(\"serviceTime\");\r\n localStorage.removeItem(\"lastClaim\");\r\n //navigator.notification.vibrate(500);\r\n window.location = \"registeredUser.html\";\r\n } \r\n}", "function handleDelete (info) {\n remove(info.toString());\n printReminder(information);\n }", "onRemove() {}", "onPressDeleted(indicedacancellare){\n this.listTodo.splice(indicedacancellare, 1);\n\n }", "function dremove(deviceid) {\n swal({\n title: \"Are you sure?\",\n text: \"Once deleted from the domain, the device will be available in its owner's sandbox.\",\n icon: \"warning\",\n buttons: true,\n dangerMode: true,\n })\n .then((willDelete) => {\n if (willDelete) {\n db.collection('devices').doc(deviceid).set({\n domain: \"\"\n }, { merge: true }).then(function () {\n swal({\n title: \"The device has been removed successfully.\",\n text: \"Do you want to rebuild your navigation tree?\",\n icon: \"warning\",\n buttons: true,\n dangerMode: true,\n }).then((willDelete) => {\n if (willDelete) {\n rebuildtree();\n } else {\n swal(\"You might be able to see the changes until you rebuild your navigation tree. Profile -> Rebuild.\");\n }\n });\n })\n .catch(function (error) {\n swal({\n title: \"Erro\",\n text: \"Sorry, the device can not be removed. : \" + error,\n icon: \"warning\",\n buttons: true,\n dangerMode: true,\n })\n });\n loaddata1(domainid);\n } else {\n swal(\"The device has not been removed.\");\n }\n });\n}", "handleDelete() {\n deleteRecord(this.recordId)\n .then(() => {\n console.log(\"record is deleted\");\n })\n .catch((error) => {\n console.log(JSON.stringify(error));\n });\n }", "delete() {\n\n }", "function handleResponseDelete() {\n var currentResponse = $(this)\n .parent()\n .parent()\n .data(\"response\");\n deleteResponse(currentResponse.id);\n }", "function deleteTreatment(name) {\n var tracker = $q.defer();\n pdbMain.get($rootScope.amGlobals.configDocIds.treatment).then(treatmentDocFound).catch(failure);\n return tracker.promise;\n \n function treatmentDocFound(res) {\n res.regular[name]._deleted = true;\n pdbMain.save(res).then(success).catch(failure);\n }\n \n function success(res) {\n tracker.resolve(res);\n }\n \n function failure(err) {\n tracker.reject(err);\n }\n }", "Delete(\n\t\tfn // (err?) -> Void\n\t) {\n\t\tconst self = this\n\t\tself.emit(self.EventName_willBeDeleted(), self._id)\n\t\tcontact_persistence_utils.DeleteFromDisk(\n\t\t\tself,\n\t\t\tfunction(err) {\n\t\t\t\tif (err) {\n\t\t\t\t\tfn(err)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tself.emit(self.EventName_deleted(), self._id)\n\t\t\t\tfn()\n\t\t\t}\n\t\t)\n\t}", "delete() {\n this.dbUpdater.checkOkToDelete();\n\n // TODO: What is the right way to test this?\n //if (this.last) {\n // throw \"cannot delete account with any transactions\";\n //}\n\n if (this.parent) {\n let parent = this.parent;\n parent.children.delete(this.data.name);\n parent._notifySubscribers();\n // TODO:\n // Should we notify the account itself?\n // Then any view that depends on it could just\n // redirect somewhere else?\n }\n\n this.db.accountsByGuid.delete(this.data.guid);\n this.dbUpdater.delete()\n }", "willDestroy() {}", "willDestroy() {}", "function Delete(){ \n\n\t\t$('.additionalInfo').hide();\n\n\t\tvar grandParent = $(this).parent().parent(); \n\n\t\tvar tdName = grandParent.children(\"td:nth-child(1)\");\n\t\tvar tdGrams = grandParent.children(\"td:nth-child(2)\");\n\t\tvar tdDate = grandParent.children(\"td:nth-child(5)\");\n\n\t\tvar name = tdName.text();\n\t\tvar grams = tdGrams.text();\n\t\tvar date = tdDate.text();\n\n\t\tfoodToBeRemovedObject = {name: name, grams:grams, dateadded:date};\n\n\t\tremoveUserFood();\n\n\t grandParent.next().remove();\t\t\t \n grandParent.remove();\n\n addEmptyRow();\n\n\t\tappendDatabaseRowsForChosenDate(date);\n\n}", "onDelete(){\n let id = this.state.details.id;\n axios.delete(`http://localhost:3000/api/patients/${id}`)\n .then(response => {\n this.props.history.push('/patients')\n }).catch(err => console.log(err))\n }", "beforeDelete(params) {\n console.log(\"Hereeeeeeeeeee 15\");\n }", "function DELETE(){\n\n}", "function dispatchpartydetails_Delete() \r\n\t{\r\n\t\tcommon_delete(\"dispatchpartydetails\");\r\n\t}", "removeCard() { this.df = null; }", "function _delete(diag){\n \n var deferred = Q.defer();\n var id= diag._id;\n\n db.diagrama.remove(\n {_id: mongo.helper.toObjectID(diag._id)},\n function(err){\n \tif(err) deferred.reject(err);\n \t\n \tdeferred.resolve();\n });\n return deferred.promise;\n}", "function handleDeductionDelete(personIdx, idxToDelete) {\n setReceipt((prevReceipt) => {\n let updatedPeople = [...prevReceipt.people];\n updatedPeople[personIdx].deductions = updatedPeople[\n personIdx\n ].deductions.filter((ele, idx) => {\n return idx !== idxToDelete;\n });\n\n return { ...prevReceipt, people: updatedPeople };\n });\n\n setDeduction(defaultDeductionState);\n }", "function handlenoteDelete() {\n var currentnote = $(this).parents(\".note-panel\").data(\"id\");\n deletenote(currentnote);\n }", "function use_del(uid) {\n Personals.use_del(uid).then(useSuccessFn, useErrorFn);\n /**\n * @name useSuccessFn\n * @desc Update ClubCard array on view\n */\n function useSuccessFn(data, status, headers, config) {\n activate();\n }\n /**\n * @name useErrorFn\n * @desc console log error\n */\n function useErrorFn(data, status, headers, config) {\n console.log(data);\n }\n }", "function handleDelete(item){\n //console.log(item);\n const extra = [...deletedAdvertisements, item];\n setdeletedAdvertisements(extra);\n const temp = {...advertisements};\n delete temp[item];\n setAdvertisements(temp);\n // firebase.firestore()\n // .collection(KEYS.DATABASE.COLLECTIONS.ADVERTISEMENT)\n // .doc(\"list\")\n // .set(advertisements)\n }", "deleteNote(privateNote) {\n privateNote.deleteRecord();\n privateNote.save();\n }", "function Q(t,e){var n=x.annos[e].splice(t,1)[0];x.activepage&&x.activepage._paper&&x.activepage._paper._annos.exclude(n.getObject()),x.activeanno===n&&(x.activeanno=null),n.dispose(),x.activepage&&x.activepage._grips&&x.activepage._grips.repaint(),s.trigger({type:\"annotationdeleted\",page:e,index:t})}", "function deleteAfterClick(event){\n event.target.parentNode.remove();\n }", "function onDelete(e) {\n\tif (e !== false) {\n\t\tmap.deletePage();\n\t}\n}", "deletePacman(){\n this.remove(this.pacman);\n }", "remove () {\n // cleanup\n }", "delete() {\n let _this = this;\n\n delete _this._parent._children[_this._childId];\n\n _this._releaseListeners();\n\n //TODO: send delete message ?\n }", "function onDeleteStudent() {\n 'use strict';\n if (lastCheckedStudent === -1) {\n window.alert(\"Warning: No student selected !\");\n return;\n }\n\n var student = FirebaseStudentsModule.getStudent(lastCheckedStudent);\n txtStudentToDelete.value = student.firstname + ' ' + student.lastname;\n dialogDeleteStudent.showModal();\n }", "onRowsRemoved(dataset) {\n super.onRowsRemoved(dataset);\n for (var i = 0; i < dataset.rows.count; i++) {\n var row = dataset.rows.item(i);\n var record = row.tag;\n record.remove(function () { latte.sprintf(\"Removed: \" + record.recordId); });\n }\n this.confirmRowsRemoved();\n }", "function DeleteDamage(id, desc) {\r\n\r\nif (confirm(\"Are you sure you want to delete this damage: \" + desc + \"?\")) {\r\n \r\n // delete from database here\r\n\tdb.transaction(function(tx) {\r\n\t\ttx.executeSql(\"delete from op_damages where internal_id = '\" + id + \"';\", [], $(\"#\" + id).remove(), errorCB);\r\n\t});\r\n\r\n\ttx.executeSql(\"select op_damages.*, master_damage.damage_desc as damage_code_desc, master_lookup.master_desc as damage_group_desc\" +\r\n\t\t\t\" from op_damages inner join master_damage on master_damage.damage_group = op_damages.damage_group and master_damage.damage_code = op_damages.damage_code\" +\r\n\t\t\t\" inner join master_lookup on master_lookup.master_id = op_damages.damage_group \" +\r\n\t\t\t\" where master_lookup.master_type = 'DAMAGEGROUP' and damage_notification = '\" + current_notification.internal_id + \"' ;\", [], ReLoadDamages_querySuccess, errorCB);\r\n\r\n\t}\r\n\r\n}", "_deletePill() {\n this._broadcast(MESSAGE_TYPES.PILL_DELETED, this.get('pillData'));\n }", "function notifydeleted(){\n\tdpost(\"notifydeleted function called\\n\");\n// \tcpost(\"ABOUT to got deleted\\n\");\n\tdeletenodeFromDB(myNodeName);\n\n\t// call all nodes inside the same nodespace and tell them\n\t// to remove connections to this node from the database\n\tmessnamed(myNodeSpace + \"::vpl::nodespace\", \"removeConnection\", myNodeName);\n messnamed(myNodeID + \"::props\", \"close\");\n// \tcpost(myNodeName + \" got deleted\\n\");\n myIOlets.freepeer();\n}", "restore() {\r\n this.deleted = false;\r\n }", "deleteTodo(todo) {\r\n this.todos.splice(todo, 1);\r\n // console.log(todo);\r\n }", "function deletePatient(id) {\n fetch(`http://localhost:3000/patients/${id}`, {\n method: 'DELETE'\n }).then(res => {\n if (!res.error) {\n location.reload()\n }\n }).catch(err => {\n console.log('Error during process ', err)\n })\n}", "function eliminarDetalle(index){\r\n if(detallesOrden.length == 1){\r\n sessionStorage.removeItem(\"DetallesOrden\");\r\n document.getElementById(\"tablaDetalles\").innerHTML = \"\";\r\n return;\r\n }\r\n detallesOrden.splice(index,1);\r\n guardarDetalles();\r\n poblarDetalle();\r\n}", "onDeleteFail() {\n this.deletionMessage = 'Deletion failed. Please try again.'\n toastr.error(this.deletionMessage);\n }", "function deleteDirector(){\n\t//Recoge el valor del boton pulsado\n\tvar dir = this.value;\n\t/* LINEAS AÑADIDAS EN LA PRACTICA 8 */\n\t//Abre la conexion con la base de datos categorias\n\tvar directoresDB = indexedDB.open(nombreDB);\n\t//Si ha salido bien\n\tdirectoresDB.onsuccess = function(event) { \n\t\t\tvar db = event.target.result; \n\t\t\tvar deleteObjectStore = db.transaction([\"directores\"],\"readwrite\").objectStore(\"directores\");\n\t\t\tvar objeto = deleteObjectStore.get(dir);\n\t\t\tobjeto.onsuccess = function(event) {\n\t\t\t\tvar objetoDirector = new Person (objeto.result.name, objeto.result.lastName1, objeto.result.born, objeto.result.lastName2, objeto.result.picture);\n\t\t\t\t//Se elimina por el key path\n\t\t\t\tdeleteObjectStore.delete(objetoDirector.completo);\n\t\t\t\t//Abre la conexion con la base de datos\n\t\t\t\tvar directoresDB = indexedDB.open(nombreDB);\n\t\t\t\t//Si ha salido bien\n\t\t\t\tdirectoresDB.onsuccess = function(event) { \n\t\t\t\t\t\tvar db = event.target.result; \n\t\t\t\t\t\tvar deleteObjectStore = db.transaction([\"directorPro\"],\"readwrite\").objectStore(\"directorPro\");\n\t\t\t\t\t\tvar borrar = deleteObjectStore.delete(objetoDirector.completo);\n\t\t\t\t\t\tborrar.onsuccess = function(event) {\n\t\t\t\t\t\t\t//Muestra el modal y la pagina de inicio\n\t\t\t\t\t\t\texito();\n\t\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};//FIn de objeto.onsuccess\n\t};//Fin de directoresDB.onsuccess\n}//Fin de deleteDirector", "function fhArrival_delete() {\n\t\n\tif (confirm(\"L'operazione non è reversibile. Eliminare il DDT?\")) {\n\t\tjQuery.post(\n\t\t 'index.php?controller=arrival&task=jsonDelete&type=json',\n\t\t {\n\t\t \t\"arrivalId\": fhArrival_data.arrival.arrival_id\n\t\t },\n\t\t function (data) {\n\t\t \t\n\t\t \tvar result = DMResponse.validateJson(data);\n\t\t \t\n\t\t \tif ((result != false) && (result.result >= 0)) {\t\n\t\t \t\talert(\"Documento eliminato\");\n\t\t \t\twindow.location = 'index.php?controller=arrival';\n\t\t \t} else {\n\t\t \t\talert(\"Si è verificato un errore (\" + result.result + \"): \" + result.description);\n\t\t \t}\n\t\t \t\n\t\t }\n\t\t);\n\t}\n\t\n}", "eventDeleteItem(record) {\n this.selected_index = parseInt(record.id.replace(\"delete\", \"\"));\n this.delete();\n this.read();\n }", "function subtaskWasDeleted(data) {\n s.header.siblings('.container').html(data.partial);\n }", "onDeleteClicked(sector_id) {\n this.props.onRemoveSector(this.state.enterprise_id, sector_id).then(res=>{\n this.props.flashSuccess({\n text: \"Se ha eliminado el registro\",\n target: \"list\"\n })\n this.resetForm();\n }).catch(_=>{\n this.props.flashError({\n text: \"Hubo un error eliminando el registro\",\n target: \"list\"\n })\n }); \n }", "function postObjectDelete() {\n\t\t\tconsole.log(\"postObjectDelete()\");\n\n\t\t\t// remove ldb (and thumbnail, if it exists)\n\t\t\tremoveSearchResultsItem(vm.apiDomain.logicalDBKey);\n\n\t\t\t// clear if now empty; otherwise, load next row\n\t\t\tif (vm.results.length == 0) {\n\t\t\t\tclear();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// adjust selected results index as needed, and load ldb\n\t\t\t\tif (vm.selectedIndex > vm.results.length -1) {\n\t\t\t\t\tvm.selectedIndex = vm.results.length -1;\n\t\t\t\t}\n\t\t\t\tloadLDB();\n\t\t\t}\n\t\t}", "function handleDreamsDelete() {\n var currentDream = $(this)\n .parent()\n .parent()\n .parent()\n .data(\"dream\");\n deleteDream(currentDream.id);\n window.location.href = \"/my-dreams\";\n }", "cancelNewDoctorQualification(qualification) {\n\t\tlet index = this.profileData.qualification.indexOf(qualification);\n\t\tthis.profileData.qualification.splice(index, 1);\n\t}", "function stoogeDeleted(model, error) {\n if (typeof error != 'undefined') {\n callback(error);\n return;\n }\n // model parameter is what was deleted\n self.shouldBeTrue(undefined === model.get('id')); // ID removed\n self.shouldBeTrue(model.get('name') == 'Curly'); // the rest remains\n // Is it really dead?\n var curly = new self.Stooge();\n curly.set('id', self.deletedModelId);\n spec.integrationStore.getModel(curly, hesDeadJim);\n }", "willDestroy() { }", "function deleteDeptRecord(deptName) {\n db.query(`DELETE FROM department WHERE name = ?`, deptName, (err, result) => {\n if (err) {\n console.log(err);\n }\n console.log(chalk.white.bold(`====================================================================================`));\n console.log(chalk.white.bold( ` Department Successfully Removed `));\n console.log(chalk.white.bold(`====================================================================================`));\n // Display Department Table\n viewAllDepts();\n });\n}", "destroy() {\n //TODO this.\n }", "function handleMemberRemove() {\n $scope.getGroupingInformation();\n $scope.syncDestArray = [];\n }", "ondelete(deltas) { /* ?? */}" ]
[ "0.67174804", "0.66252625", "0.66109514", "0.65196264", "0.64667106", "0.6379333", "0.63758755", "0.6369018", "0.63427943", "0.6326941", "0.6283064", "0.6272925", "0.621679", "0.6215669", "0.6193164", "0.6180675", "0.61581457", "0.6155598", "0.6140773", "0.6138371", "0.6131747", "0.6102714", "0.6099368", "0.6094352", "0.60842496", "0.6073147", "0.6036928", "0.60177004", "0.60024625", "0.5989335", "0.5972846", "0.59702855", "0.59633005", "0.59537244", "0.59489006", "0.5941492", "0.592806", "0.591826", "0.5916977", "0.5902057", "0.590136", "0.586395", "0.5861113", "0.58588904", "0.5847435", "0.5845566", "0.58422816", "0.58314425", "0.5824276", "0.5809493", "0.5802612", "0.57883066", "0.5780456", "0.5774451", "0.57702094", "0.57588905", "0.5755501", "0.5754151", "0.5754151", "0.5743824", "0.573242", "0.5724671", "0.5724404", "0.57208544", "0.57202256", "0.5710421", "0.57085764", "0.57070196", "0.57052785", "0.570331", "0.57024163", "0.5702114", "0.56990194", "0.56878895", "0.56858885", "0.5682944", "0.56667227", "0.5666537", "0.56634957", "0.5661712", "0.56605256", "0.5650812", "0.5648669", "0.5645255", "0.5639774", "0.56343025", "0.5632632", "0.56316876", "0.5631372", "0.56286424", "0.56268543", "0.56202894", "0.5613165", "0.56101406", "0.56084037", "0.5607934", "0.56071174", "0.5605065", "0.56049037", "0.5604165", "0.5600318" ]
0.0
-1
Called after user logs out
function postLogout() { $(".postlogin-content, .login-show, #successAlert").fadeOut( function() { $(".prelogin-content, #landingpagebutton, .logout-show").fadeIn(); $("#queryResetButton").click(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _onLogout() {\n\t sitools.userProfile.LoginUtils.logout();\n\t}", "function handleLogout() {\n\t\ttry {\n\t\t\t//Resetting the user info\n\t\t\tuserContext.setUserInfo({ username: \"\", id: \"\" });\n\n\t\t\t//Changing authenticated to false\n\t\t\tuserContext.setIsAuthenticated(false);\n\n\t\t\t//Deleting the JWT from local storage;\n\t\t\tlocalStorage.removeItem(\"auth-token\");\n\t\t} catch (error) {\n\t\t\tconsole.log(error.message);\n\t\t}\n\t}", "function logOut(){\n clearCurrentUser();\n showLoggedOutView();\n}", "function logout() {\n\n }", "function logout()\n {\n\n }", "doLogout() {\n this.user = null;\n }", "logOut() {\n authContextApi.logOut();\n }", "handleLogout() {\n UserService.logOut();\n }", "onLogout() {\n\t\tlocalStorage.removeItem('userToken');\n\t}", "function log_out() {\n if (is_logged_in()) {\n remove_param('last_sync');\n remove_param('last_sync_user');\n set_cookie(\"user\", \"\");\n clean_db(function() { window.location = \"index.html\"; });\n }\n}", "function logoff() {\n authService.logout().then(function (response) {\n $state.go('home');\n }, function (err) {\n vm.signupErrorMsg = \"Sorry, there was an error loging you out. Try again\";\n });\n }", "onLogOut() {\r\n this.controller.remove();\r\n this.controller = null;\r\n this.login.logOut();\r\n }", "function logoutUser() {\n sessionStorage.clear();\n showHideMenuLinks();\n showHomeView();\n}", "function handleLogout(){\n /**\n * Send request to backend\n */\n request.user.logout(function(result) {\n console.log(result);\n if (result === constants.RESPONSE_CODES.SUCCESS) {\n /**\n * Reset on success\n */\n request.user.dataSources = [\n {\n id: 9999,\n email: 'doofenshmirtz.evil.inc.cos@gmail.com',\n sourceurl: 'https://services.odata.org/V2/Northwind/Northwind.svc',\n sourcetype: 0,\n sourcename: 'Northwind',\n islivedata: 'true',\n }\n ];\n props.handlePageType('home');\n props.setDashboardIndex('');\n props.setDashboardStage('dashboardHome');\n props.setIsAddingDashboard(false);\n props.setExploreStage('dataConnection');\n dispatch({ isLoggedIn: false }); \n logoutSuccessNotification('bottomRight');\n }\n });\n }", "logout() { Backend.auth.logout(); }", "logout() {\n _handleUserLogout();\n userDb.logout(this.user);\n this.userId = null;\n }", "function logout() {\n\n /* Cleanning up user's history */\n PStorage.drop();\n PStorage.init(function () {\n PStorage.set('logout', JSON.stringify({\n lat: userModel.get('latitude'),\n lon: userModel.get('longitude')\n }), function () {\n facebookConnectPlugin.logout(function () {\n location.reload();\n });\n\n });\n });\n}", "function Logout(){\n AuthenticationService.ClearCredentials();\n $state.go('Login');\n }", "logoutUser() {\n // Only call change user if the elevio library has been loaded.\n this._callIfElevioIsLoaded('logoutUser');\n }", "onLoggedOut() {\n\t\tlocalStorage.clear();\n\t\tthis.setState({\n\t\t\tuser: null,\n\t\t});\n\t}", "function logout() {\n var user = $stamplay.User().Model;\n user.logout();\n }", "function logout() {\n setCurrentUser(null);\n setToken(null);\n }", "function handleLogout() {\n window.localStorage.clear();\n setToken(\"\");\n setCurrentUser({});\n history.push('/');\n }", "onLogoutClicked() {\n AuthActions.logoutUser();\n }", "function logout()\n {\n setUserData({\n token: undefined,\n user: undefined\n })\n localStorage.setItem(\"auth-token\", \"\")\n }", "function _logOutUser () {\n \tserverRequestService.serverRequest(PROJET_HEADER_CTRL_API_OBJECT.logout, 'GET');\n }", "function handleLogout(e) {\r\n console.log('i am loging out');\r\n const resetUser = {\r\n username: '',\r\n password: '',\r\n remember: false,\r\n };\r\n setUser(resetUser);\r\n }", "logout() {\n\t\tUser.users.splice(User.users.indexOf(this), 1); // Remove user from memory.\n\t\t\n\t\tglobals.onLogout(this);\n\t\t\n\t\tthis.#connection.off(\"data\");\n\t\tthis.#connection.off(\"logout\");\n\t\tthis.#connection.leave(\"users\");\n\t\tthis.#connection.on(\"login\", data => User.tryLogin(this.#connection, data));\n\n\t\tthis.#connection.alert({msg:\"Logged out\", type:\"info\"});\n\t\tprint(`Web-CLI user has (been) logged out.`, `User-ID: ${this.id}`, `(Connection-ID: ${this.#connection.id})`);\n\t}", "function logout() {\n setToken(null);\n setCurrentUser(null);\n }", "function logout() {\n window.Lemonade.Mirror.send('logout', CookieManager.getCookie('loggedIn_user'), CookieManager.getCookie('loggedIn_session'));\n\n Store.AuthStore.dispatch(Auth.LOGOUT_ACTION());\n CookieManager.removeCookie('loggedIn');\n CookieManager.removeCookie('loggedIn_user');\n CookieManager.removeCookie('loggedIn_session');\n}", "function sign_out() {}", "function logout() {\r\n authenticationService.logout();\r\n toastr.success('Goodbye!');\r\n }", "function logUserOut(){\n\tif(sessionStorage.getItem(\"firstName\")){\n\t\tgenerateGoodbyeJumbotron();\n\t\tsessionStorage.clear();\n\t}\n\telse{\n\t\tloadJumbotron();\n\t}\n\tloadNavbar();\n\tgenerateCarousels();\n}", "function handleLogout() {\n // limpa os dados de login da ong\n localStorage.clear();\n // redireciona o usuario para a pagina de logon\n history.push('/');\n }", "function logoutUser(){\n updateViewToLoggedOut();\n}", "function logout() {\n delete $localStorage.currentUser;\n $window.location.reload();\n }", "function logOut() {\n localStorage.removeItem('idToken');\n localStorage.removeItem('username');\n localStorage.removeItem('profilePicture');\n localStorage.removeItem('userId');\n window.location.href='http://clrksanford.github.io/date-night/';\n}", "function handleLogout(user) {\n setLoginStatus(false)\n ls.removeItem('token')\n ls.removeItem('user_id')\n }", "function Logout()\n {\n\n //elimino las cookies\n $.session.remove(\"EmailUser\");\n $.session.remove(\"PasswordUser\");\n detectLogin();\n\n\n }", "logOut() {\n\t \tsessionStorage.removeItem('jwtToken');\n\t \tsessionStorage.removeItem('userData');\n\n\t \tthis.setState( {\n\t \t\tjwtToken: '',\n\t \t\tisAuthenticated: false,\n\t \t\tisCheckingAuth: false,\n\t \t\tdisplayName: '',\n\t \t\tniceName: '',\n\t \t\temail: '',\n\t \t});\n\n\t \tconsole.log('logOut(): User data has been deleted');\n\t}", "function logout() {\n //$cookies.remove('token');\n }", "function logout() {\n //$cookies.remove('token');\n }", "handleSignOut() {\n // Sign out the user -- this will trigger the onAuthStateChanged() method\n\n }", "function logOut(){\n auth.signOut().then(()=>{\n setUser(\"\")\n })\n }", "logOut() {\n var event = new CustomEvent(\"authoff\");\n document.dispatchEvent(event);\n }", "logOut() {\n var event = new CustomEvent(\"authoff\");\n document.dispatchEvent(event);\n }", "function logout() {\n _basicLogin.logout();\n _handleSuccessLogin(null);\n}", "onOk() {\n\t\t\t\t\t\t\t\t\tsetLoggingOut(true)\n\t\t\t\t\t\t\t\t\tlogout()\n\t\t\t\t\t\t\t\t\t\t.then(res => {\n\t\t\t\t\t\t\t\t\t\t\t// window.spDebug(\"logout success\")\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t.catch(err => {\n\t\t\t\t\t\t\t\t\t\t\tconsole.error(err)\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t.then(() => {\n\t\t\t\t\t\t\t\t\t\t\tsetLoggingOut(false)\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"logout, set account null\")\n\t\t\t\t\t\t\t\t\t\t\tstorageManager.set(\"account\", null)\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t}", "function userLogout(){\r\n delCookie();\r\n}", "function logout() {\n TokenService.removeToken();\n self.all = [];\n self.user = {};\n CurrentUser.clearUser();\n $window.location.reload();\n }", "logout() {\n\t\tgetRequest(\"/user/logout\");\n\t\tthis.setState({ user: { loginname: \"\", score: \"\", title: \"\" } });\n\t}", "logout () {\n\n }", "function logout() {\n setToken(); // set token to undefined\n // Clear user\n $localStorage.user = undefined;\n\n // Clear activity filter data\n $localStorage.activityFilterData = undefined;\n\n // Clear form data\n $localStorage.selectedUser = undefined;\n $localStorage.selectedCompany = undefined;\n $localStorage.selectedDomain = undefined;\n $localStorage.userMainAccount = undefined;\n \n clearAuthHeaderForAPI();\n clearAll();\n }", "function logout() {\n vm.loggedIn = false;\n vm.userData = null;\n vm.role = null;\n var cookies = $cookies.getAll();\n for (var x in cookies) {\n $cookies.remove(x);\n }\n }", "function logOut() {\n $.post('core/action-design.php', {\n 'act': 'logout'\n })\n .success(function(data) {\n login = false;\n info('<label style=\"color:green\">Success for Logout</label>');\n });\n }", "function logout() {\n tokenStore['igtoken'] = undefined;\n }", "function logout(){\n\t\t\tParse.User.logOut();\n\t\t}", "logout() {\n localStorage.removeItem(\"user\");\n }", "function logout(){\n currentUser = null;\n updateHeader();\n toggleView(\"login\");\n}", "logOutCurrentUser() {\n var self = this;\n self.auth.signOut();\n }", "logout() {\r\n this.authenticated = false;\r\n localStorage.removeItem(\"islogedin\");\r\n localStorage.removeItem(\"token\");\r\n localStorage.removeItem(\"user\");\r\n }", "logOut(e) {\n\t\t// prevent default behavior\n\t\te.preventDefault();\n\n\t\t// authenticate login\n\t\tauth.logout( (loggedOut) => {\n\t\t\t// if we register the user\n\t\t\tif (loggedOut) {\n\t\t\t\t// send us to their profile page\n\t\t\t\tthis.context.router.push({pathname: '/'})\n\t\t\t}\n\t\t})\n\t}", "logout() {\n Backend.logout();\n }", "logOutUser() {\n this.__userAdmin__ = null\n this.__userToken__ = null\n this.removeStorage()\n window.location.reload()\n }", "function signOut() {\n localStorage.removeItem('curUser');\n}", "logout() {\n // remove authentication credentials\n this.credentials = null;\n }", "function logoutUser() {\n auth.logout()\n .then(() => {\n sessionStorage.clear();\n showInfo('Logout successful.');\n userLoggedOut();\n }).catch(handleError);\n }", "function logout(){\n $rootScope.$broadcast('flashMessage', {\n type: 'warning',\n content: 'Come back soon!'\n });\n $auth.logout();\n $state.go('craveIndex');\n }", "function logOut(){\n localStorage.removeItem(\"user\");\n localStorage.removeItem(\"token\");\n templateController();\n}", "function logout (){\n collectionOfUser.update(\n {\n id : loginUser.id,\n logIN : false,\n },\n function(){},\n error\n );\n clear();\n }", "logout() {\n localStorage.removeItem('user');\n }", "logOut() {\n let confirmLogout = window.confirm(\"Are you sure you want to log-out?\");\n if (confirmLogout) {\n Cookies.remove('application_user_data');\n this.setState({loggedInCookie: false})\n this.props.resetState();\n }\n this.props.updateDisplayMessage(null);\n }", "function logout() {\n JoblyApi.token = null;\n setCurrentUser(null);\n localStorage.removeItem(\"token\");\n localStorage.removeItem(\"currentUser\");\n }", "logout() {\n $cookies.remove('token');\n currentUser = {};\n }", "function authLogout() {\n\t\tif (getAuthCookie() !== null)\n\t\t\trequest('GET', tools.urlLogout, authLogoutSuccess, authLogoutError);\n\t}", "function logout() {\n\tcurrent_user_profile_picture_path = \"\";\n\tregisterUserRole(\"anonymous\");\n\tdxRequestInternal(getServerRootPath()+\"api/global_functions/logoutCurrentAccount\",\n\t\t{AuthenticationToken:getAuthenticationToken()},\n\t\tfunction(data_obj) {\n\t\t\tif (data_obj.LogoutResult === true) {\n\t\t\t\tif (!isNative()) {\n\t\t\t\t\tloadUserRoleLandingPage(\"anonymous\");\n\t\t\t\t} else {\n\t\t\t\t\tloadUserRoleLandingPage(\"native_landing\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Could not logout user: \"+JSON.stringify(data_obj));\n\t\t\t}\n\t\t},\n\t\tfunction(data_obj) {\n\t\t\tthrow new Error(\"Could not logout user: \"+JSON.stringify(data_obj));\n\t\t})\n}", "function logout() {\n localStorage.removeItem('id_token');\n localStorage.removeItem('AWS.config.credentials');\n authManager.unauthenticate();\n $state.reload();\n }", "function safeLogout() {\n clearCache();\n toDashboard.url = '';\n m.siteAlias = '';\n $location.path('/login');\n }", "function logout() {\n localStorage.removeItem('user');\n}", "function logout() {\n localStorage.removeItem('user');\n $location.path('/');\n }", "function logOut() {\n localStorage.clear();\n \n window.location.reload();\n }", "function LogOut(e){\n console.log(\"triggered\");\n db.auth().signOut();\n \n}", "function Logout() {\n localStorage.removeItem('user_id')\n}", "function doLogOut() {\n\t\tif(!UserContext.isUserAuthenticated()) {\n\t\t\treturn;\n\t\t}\n\n\t\tresetStatus();\n\t\t$scope.status.loading = true;\n\n\t\tUserContext.logOutUser($stateParams.sessionEnded)\n\t\t\t.finally(function () {\n\t\t\t\tresetStatus();\n\t\t\t\t$scope.status.active = true;\n\t\t\t\tif($stateParams.sessionEnded){\n\t\t\t\t\t$scope.status.sessionEnded = true;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$scope.status.loggedOut = true;\n\t\t\t\t}\n\n\n\t\t\t});\n\t\treturn true;\n\t}", "logout() {\n this.authenticated = false;\n\n localStorage.removeItem('user');\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}", "logOut(state) {\n state.user = null;\n state.authToken = null;\n state.authTenants = null;\n state.currentSection = null;\n state.error = null;\n }", "function setLoggedOut() {\n\t//clean up the user before initailising\n\tcurrentUserID = null;\n\tcurrentUserFirstName = null;\n\tcurrentUserLastName = null;\n\tcurrentUserFullName = null;\n\tcurrentUserPictureURL = null;\n\n\t\n\t//Disable the components on screen\n\t$(\"#chat-facebook-login\").removeAttr(\"disabled\");\n\t$(\"#chat-facebook-logout\").attr(\"disabled\", \"disabled\");\n\t$(\"#current-user\").text(\"\");\n\t\n\t$(\"#drumkit\").hide();\n\t$(\"#chat-main-div\").hide();\n}", "function onAfterLogout() {\n\t\twindow.location = \"/\";\n\t}", "function logout() {\n sessionStorage.removeItem('user')\n sessionStorage.removeItem('isLogged')\n}", "function logout() {\n svc.token = null;\n svc.identity = null;\n delete $window.localStorage['authToken']; \n }", "function logOut() {\n localStorage[config.data[0].storage_key+'_Session'] = null;\n clearCart();\n var CouponDetail = new Object();\n CouponDetail[\"apply_to_shipping\"] = \"\";\n CouponDetail[\"simple_action\"] = \"\";\n CouponDetail[\"discount_amount\"] = \"\";\n CouponDetail[\"discount_qty\"] = \"\";\n CouponDetail[\"shipmyidonly\"] = \"\";\n localStorage[config.data[0].storage_key+\"_coupondetails\"] = JSON.stringify(CouponDetail);\n localStorage[config.data[0].storage_key+\"_couponapplied\"] = \"0\";\n localStorage[config.data[0].storage_key+\"_coupon_code\"] = JSON.stringify(\"\");\n if (config.data[0].platform == 'ios' || config.data[0].platform == 'android') {\n navigator.notification.alert(locale.message.alert[\"sign_out_message\"], function() {}, config.data[0].app_name, locale.message.button[\"close\"]);\n } else {\n alert(locale.message.alert[\"sign_out_message\"]);\n }\n visitHomePage();\n }", "_logout() {\n this._closeMenu();\n AuthActions.logout();\n }", "function onSignOut() {\n console.log('>onSignOut');\n //showSignedOutUserControls();\n}", "function logOut() {\n localStorage.removeItem('id_token')\n showWelcome()\n}", "function handleLogout() {\n window.localStorage.clear();\n setToken(localStorage.getItem(\"token\"));\n setCurrentUser({});\n console.log(\"localStorage is:\", localStorage);\n history.push('/login');\n }", "function logOut() {\n localStorage.removeItem(\"userid\");\n localStorage.removeItem(\"fetch-path\");\n location.replace(\"login.html\");\n }", "function logout() {\n $auth.logout();\n localStorageService.remove(\"currentUser\");\n $state.go('home', {}, {reload: true});\n }", "logout() {\n localStorage.removeItem(\"auth\");\n }", "function logOut() {\n FB.logout();\n buttonView('logOut')\n }", "getLogout(e) {\n window.sessionStorage.clear();\n this.userHasAuthenticated(false);\n window.location = '/';\n }" ]
[ "0.8253849", "0.7945836", "0.7901897", "0.78789586", "0.78309596", "0.78073835", "0.7718061", "0.771072", "0.7692442", "0.7652144", "0.7638575", "0.762981", "0.75814915", "0.755828", "0.75564253", "0.75453377", "0.7545109", "0.7529268", "0.75284123", "0.749999", "0.74986994", "0.74887896", "0.746447", "0.7455527", "0.74361396", "0.7435904", "0.7435789", "0.7434736", "0.7433366", "0.7433205", "0.7423884", "0.7420764", "0.7416936", "0.740922", "0.74045914", "0.73825455", "0.7354158", "0.73511606", "0.73442394", "0.73409283", "0.73403555", "0.73403555", "0.7333598", "0.73272216", "0.7325174", "0.7325174", "0.7314183", "0.730225", "0.72983396", "0.7296308", "0.72896427", "0.7287858", "0.728431", "0.72770345", "0.7275924", "0.72711766", "0.72702056", "0.725904", "0.7250225", "0.7240662", "0.7239576", "0.72395205", "0.7238182", "0.7237619", "0.72348076", "0.7228179", "0.72280324", "0.7227628", "0.72270393", "0.72258055", "0.7224489", "0.72241193", "0.7224025", "0.7221869", "0.7218247", "0.7213826", "0.7205368", "0.719869", "0.7192033", "0.7187889", "0.71856195", "0.7176242", "0.7172979", "0.7167834", "0.71658623", "0.71627265", "0.7161129", "0.71605253", "0.7158463", "0.7157632", "0.7153172", "0.7147828", "0.7146527", "0.71461874", "0.71461105", "0.7141324", "0.713559", "0.713328", "0.71323544", "0.71299547", "0.712984" ]
0.0
-1
without access to workspace
async function getBoardById(boardId) { const workspaces = await storageService.query(STORAGE_KEY) const workspace = workspaces.find(workspace => { return workspace.boards.find(board => board._id === boardId) }) const board = workspace.boards.find(board => board._id === boardId) return board }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function WorkspacePlain() {\n }", "static clearWorkspace() {\n Gamepad.workspace.clear();\n }", "clearWorkspace(){\n this.ffauWorkspace.clear();\n }", "function _____SHARED_functions_____(){}", "StartWorkspaceEx() {\n\n }", "StartWorkspaceEx2() {\n\n }", "private internal function m248() {}", "private public function m246() {}", "clearWorkspace() {\n this.ffauWorkspace.clear();\n }", "function StatRepository() {\n}", "getcurrentprojects() { }", "refresh()\n\t{\n\t}", "function firstRun ( ws ){\n //const ws = path.resolve ( app.get ( 'workspace' ))\n const source = path.resolve ( 'whoobe/workspace' )\n fs.ensureDir ( ws ).then ( () => {\n console.log ( 'Default Workspace created!')\n fs.copy ( source + '/default' , ws + '/default' )\n }).catch ( error => {\n console.log ( error )\n })\n}", "function WorkspaceIndexer(){\n\tthis._init();\n}", "static private internal function m121() {}", "function main() {\n try {\n var idoc = app.activeDocument;\n } catch (e) {\n alert('Open a document and try again');\n return;\n }\n\n var emptyLayers = [];\n getEmptyLayers(idoc, emptyLayers);\n\n for (var a = 0; a < emptyLayers.length; a++) {\n //$.writeln(emptyLayers[a].name);\n //$.writeln(emptyLayers[a].canDelete);\n emptyLayers[a].remove();\n }\n}", "transient protected internal function m189() {}", "function GitStorage () {}", "firstRun() { }", "function main_script(meta_wgl){\rapp.beginUndoGroup(\"wihihihiggle\");\r\r meta_wgl.unique_num = randomNum();\r meta_wgl.unique_ctrlname = meta_wgl.ctrlname +(\"_\"+ String(meta_wgl.unique_num));\r\r if(meta_wgl.ctrlExists == true ){\r\r meta_wgl.unique_ctrlname = meta_wgl.ctrlname ;\r };\r\r var curComp = app.project.activeItem;\r\r if (!curComp || !(curComp instanceof CompItem))\r {\r alert(\"Please select a Composition.\");\r return;\r };\r\r var theExpression = buildExpression(meta_wgl);\r var props = new Array();\r\r\r app.beginSuppressDialogs();// dont want any warnings\r\r var myLayers = curComp.selectedLayers;\r if(myLayers.length > 0){\r \rfor (var i = 0; i < myLayers.length; i++){\r \r var lprops = myLayers[i].selectedProperties;\r\r for(var j = 0; j < lprops.length; j++){\r props.push(lprops[j]);\r };\r };\r\rif((!meta_wgl.ctrlExists)&&(meta_wgl.simple == false)) createController(curComp, meta_wgl);\r\rif((meta_wgl.simple==true)&&(meta_wgl.add_simple_ctrl==true)) createController(curComp, meta_wgl);\r\rfor (var i = props.length - 1; i >= 0; i--) {\r p = props[i];\r\r if(p.canSetExpression == true){\r\r try{\r p.expression = theExpression.join(\"\\n\");\r p.expressionEnabled = true;\r }catch(e){\r p.expressionEnabled = false;\r alert(\"There is an error in the expression.\\nI will disable it. Sry mate.\");\r };\r };\r\r};\r\r\r app.endSuppressDialogs(false);\r\r\r\r}else{\r\r if((!meta_wgl.ctrlExists)&&(meta_wgl.simple == false)) createController(curComp, meta_wgl);\r\r // alert(\"Please select at least one layer.\");\r\r return;\r };\rapp.endUndoGroup();\r}", "async getAllWorkspaces(){\n const workspaceRepository = locator.get('iworkspaceRepository');\n var workspaces = await workspaceRepository.getAllWorkspaces();\n return workspaces;\n\n }", "function main(){\n\n\n}", "static final private internal function m106() {}", "function MASH_FileManager() {\n\n\n}", "function goToWorkspace() {\n\n\tshowConfirm('You will lose existing changes. Would you like to continue?',\n\t\tfunction() {\n\n\t\t\twindow.open(\"../workspace\",\"_self\");\n\n\t\t});\n\n}", "static submitWorkspace() {\n run(Blockly.JavaScript.workspaceToCode(Gamepad.workspace));\n }", "function Main()\n {\n \n }", "build () {}", "exportWorkspace() {\n const workspace = this.workspace;\n this.circuit.gates.sort((a, b) => a.time - b.time);\n const gates = [];\n for (let key in workspace.gates) {\n const gate = workspace.gates[key];\n if (gate.std) {\n continue;\n }\n gates.push({\n name: key,\n qubits: gate.circuit.nqubits,\n circuit: gate.circuit.toJSON(),\n title: ''\n });\n }\n return {\n gates: gates,\n circuit: this.circuit.toJSON(),\n qubits: this.circuit.nqubits,\n input: this.editor.input\n };\n }", "StartWorkspace(string, string, string, string, int, int) {\n\n }", "protected internal function m252() {}", "function initializeWorkspaces() {\n chrome.storage.sync.get({workspaces: {}, order: []}, function(data) {\n workspaces = data.workspaces;\n\t\torder = data.order;\n\t\tloadWorkspaces();\n\t\tupdateNoWorkspaceMessage();\n });\n}", "function run() {\n\n }", "transient private protected internal function m182() {}", "getScope() {}", "function getWorkspace(id) {\n return workspaces[id];\n}", "__init4() {this.scopes = []}", "static _getSpaceRoot(){\n return process.cwd(); //path.dirname(module.parent.paths[0])\n }", "addCommands() {\n this.disposables.add(atom.commands.add('atom-workspace', {\n 'project-viewer-plus:open-editor': () => {\n this.openEditor();\n },\n 'project-viewer-plus:read-file': async () => {\n const content = await this.readFile();\n console.log(content);\n _state2.default.initializeState(content, true);\n },\n 'project-viewer-plus:read-legacy-file': async () => {\n const content = await this.readLegacyFile();\n _state2.default.initializeState((0, _legacy.transformLegacyContent)(content.root), true);\n },\n 'project-viewer-plus:toggle-visibility': () => this.toggleMainVisibility(),\n 'project-viewer-plus:toggle-focus': () => this.toggleMainFocus(),\n 'project-viewer-plus:toggle-list': () => this.toggleSelectList()\n }), atom.commands.add(this.mainContainer.element, {\n 'core:move-up': function () {\n console.log('core:move-up');\n },\n 'core:move-down': function () {\n console.log('core:move-down');\n },\n 'core:move-left': function () {\n console.log('core:move-left');\n },\n 'core:move-right': function () {\n console.log('core:move-right');\n },\n 'core:confirm': function () {\n console.log('core:confirm');\n }\n }), atom.workspace.getLeftDock().onDidStopChangingActivePaneItem(item => console.log('left', item)), atom.workspace.getRightDock().onDidStopChangingActivePaneItem(item => console.log('right', item)), atom.config.onDidChange(`${_base.PLUGIN_NAME}.dock.position`, () => {\n this.mainContainer.destroyMainItem();\n this.addItemToDock();\n this.mainContainer.update();\n }));\n }", "function main(){\n\t\n}", "function WorkbookAllModule(){Workbook.Inject(DataBind,WorkbookSave,WorkbookNumberFormat,WorkbookCellFormat,WorkbookEdit,WorkbookFormula,WorkbookOpen,WorkbookSort,WorkbookHyperlink,WorkbookFilter,WorkbookInsert,WorkbookDelete,WorkbookFindAndReplace,WorkbookProtectSheet,WorkbookDataValidation,WorkbookMerge,WorkbookConditionalFormat,WorkbookImage,WorkbookChart);}", "function HTML5_SolutionStorage() {\n}", "function workspaceToText () {\n\tvar current_xml = Blockly.Xml.workspaceToDom(Blockly.mainWorkspace);\n var current_xml_text = Blockly.Xml.domToText(current_xml);\n \n return current_xml_text;\n\n\n}", "transient private internal function m185() {}", "refreshTree() {\r\n files = [];\r\n files = findFiles(path.join(resLocation, \"CNC files\"));\r\n files.unshift(allFilesName);\r\n let additionalFolders = vscode.workspace.getConfiguration(\"AutodeskPostUtility\").get(\"customCNCLocations\")\r\n if (additionalFolders.folders) {\r\n for (let i = 0; i < additionalFolders.folders.length; i++) {\r\n if (fs.existsSync(additionalFolders.folders[i])) {\r\n files = files.concat([[path.basename(additionalFolders.folders[i]),additionalFolders.folders[i]]]); \r\n }\r\n }\r\n }\r\n this._onDidChangeTreeData.fire();\r\n }", "function oi(){}", "transient private protected public internal function m181() {}", "saveRunFile () {\n var editor = atom.workspace.getActiveTextEditor()\n\n if (editor && editor.getGrammar().scopeName === 'source.matlab') {\n var savePromise = editor.save()\n savePromise.then((result) => { MatlabEditor.runFile() }, (err) => { console.log(err) })\n }\n }", "function OpenRepoWork() {\r\n\t\tvar fname=Editor.currentView.files[Editor.currentView.file];\r\n\t\tif (!(/^(R:\\\\|U:\\\\)/i.test(fname))) {\r\n\t\t\tEditor.alert(\"Use \"+this+\" only with SDD Desktop Connection using drive letters R: and U:\")\r\n\t\t\treturn\r\n\t\t}\r\n\r\n\t\tvar fso = new ActiveXObject(\"Scripting.FileSystemObject\");\r\n\r\n\t\tif ((/^R:\\\\/i.test(fname))) {\r\n\t\t\tvar re=/^R:\\\\/i;\r\n\t\t\tvar fnameOther=fname.replace(re,\"U:\\\\\");\r\n\t\t}\r\n\t\telse if ((/^U:\\\\/i.test(fname))) {\r\n\t\t\tvar re=/^U:\\\\/i;\r\n\t\t\tvar fnameOther=fname.replace(re,\"R:\\\\\");\r\n\t\t}\r\n\t\t// alert(fnameOther)\r\n\r\n\t\tif (fso.FileExists(fnameOther)) {\r\n\t\t\tEditor.open(fnameOther);\r\n\t\t}\r\n\r\n\t}", "lastSolutionToString () {}", "function getGlobDataAPI(){\n\n}", "function fm(){}", "function run() {\n\n}", "run () {\n }", "function jessica() {\n $log.debug(\"TODO\");\n }", "function $f(a){a=a||B;var b;if(a.Db)b=a.Db();else if(a.Za)b=a.Za();else throw\"Not Block or Workspace: \"+a;a=Object.create(null);for(var c=0;c<b.length;c++){var d=b[c].Yb;if(d)for(var d=d.call(b[c]),e=0;e<d.length;e++){var h=d[e];h&&(a[h.toLowerCase()]=h)}}b=[];for(var k in a)b.push(a[k]);return b}", "function oob_system(){\n\t\ntest_find_conflict();\n}//end function oob_system", "function getWork(){\n //self.works = workService.getWork();\n }", "static loadWorkspace(xml_text) {\n Gamepad.clearWorkspace();\n const xml = Blockly.Xml.textToDom(xml_text);\n Blockly.Xml.domToWorkspace(xml, Gamepad.workspace);\n }", "function refreshProject() {\n\n function refreshNode(node) {\n node.load().complete(function() {\n node.children().forEach(function(child) {\n if (child.children && child.children().length !== 0){\n refreshNode(child);\n }\n });\n });\n }\n refreshNode(tree);\n }", "function wa(){}", "function setup() {\n\n\n}", "function setup() {\n\n\n}", "function initCompSyntaxTools()\n{\n quadruples = [];\n quadruples[0] = [Operation.GOTO, null, null, null]; //first quadruple should be goint to main\n dirProcs = {};\n constMem = 45000;\n constants = {};\n}", "function main(){\r\n}", "function kp() {\n $log.debug(\"TODO\");\n }", "function createCurrentCallObject() {\n\n}", "import() {\n }", "static clear(){\n SourceRepository._repository = {};\n }", "function CMProjector() \r\n{\r\n\t\r\n}", "obtain(){}", "function _main() {\n window.tools = {} || window.tools;\n window.tools.log = _log;\n }", "function browse() {\r\n\r\n}", "function compCode_20160614_154125() {\r\rapp.beginUndoGroup(\"massiveBusiness\");\r\rtry {\r\r// Create Folder hierarchy\r\tvar zcompcodescripts_folder = getItem(\"Z_Compcode_Scripts\", FolderItem, app.project.rootFolder);\r\tif (zcompcodescripts_folder === null) {\r\t\tzcompcodescripts_folder = app.project.items.addFolder(\"Z_Compcode_Scripts\");\r\t}\r\tvar buildings_folder = getItem(\"Buildings\", FolderItem, zcompcodescripts_folder);\r\tif (buildings_folder === null) {\r\t\tbuildings_folder = app.project.items.addFolder(\"Buildings\");\r\t\tbuildings_folder.parentFolder = zcompcodescripts_folder;\r\t}\r\tvar out_folder = getItem(\"OUT\", FolderItem, buildings_folder);\r\tif (out_folder === null) {\r\t\tout_folder = app.project.items.addFolder(\"OUT\");\r\t\tout_folder.parentFolder = buildings_folder;\r\t}\r\tvar precomps_folder = getItem(\"PreComps\", FolderItem, buildings_folder);\r\tif (precomps_folder === null) {\r\t\tprecomps_folder = app.project.items.addFolder(\"PreComps\");\r\t\tprecomps_folder.parentFolder = buildings_folder;\r\t}\r\r// Create Compositions\r\tvar massivebusiness_comp = app.project.items.addComp(\"massiveBusiness\", 412, 412, 1, 2.8, 25);\r\t\tmassivebusiness_comp.time = 2.76;\r\t\tmassivebusiness_comp.bgColor = [0,0,0];\r\t\tmassivebusiness_comp.parentFolder = out_folder;\r\tvar massivebusinessanimation_comp = getItem(\"massiveBusiness_animation\", CompItem, precomps_folder);\r\tvar massivebusinessanimation_comp_populate = false;\r\tif (massivebusinessanimation_comp === null) {\r\t\tmassivebusinessanimation_comp = app.project.items.addComp(\"massiveBusiness_animation\", 412, 412, 1, 2.8, 25);\r\t\tmassivebusinessanimation_comp.time = 0.04;\r\t\tmassivebusinessanimation_comp.bgColor = [0,0,0];\r\t\tmassivebusinessanimation_comp.workAreaDuration = 1.08010005950928;\r\t\tmassivebusinessanimation_comp.motionBlur = true;\r\t\tmassivebusinessanimation_comp.parentFolder = precomps_folder;\r\t\tmassivebusinessanimation_comp_populate = true;\r\t}\r\r// Working with comp \"massiveBusiness\", varName \"massivebusiness_comp\";\r\tmassivebusiness_comp.openInViewer();\r\t// Add existing composition \"massiveBusiness_animation\", varName \"massivebusinessanimation_comp\";\r\tvar massivebusinessanimation = massivebusiness_comp.layers.add(massivebusinessanimation_comp);\r\t\tmassivebusinessanimation.collapseTransformation = true;\r\t\tmassivebusinessanimation.motionBlur = true;\r\t\tmassivebusinessanimation.moveToEnd();\r\t\tmassivebusinessanimation.timeRemapEnabled = true;\r\t\tvar massivebusinessanimationTimeRemap = massivebusinessanimation.property(\"ADBE Time Remapping\");\r\t\t\tmassivebusinessanimationTimeRemap.setValueAtTime(99999, massivebusinessanimationTimeRemap.keyValue(1));\r\t\t\tmassivebusinessanimationTimeRemap.removeKey(2);\r\t\t\tmassivebusinessanimationTimeRemap.removeKey(1);\r\t\t\tvar massivebusinessanimationTimeRemap_keyTimesArray = [0,1.2,1.6,2.8];\r\t\t\tvar massivebusinessanimationTimeRemap_valuesArray = [0,1.2,1.2,0];\r\t\t\tmassivebusinessanimationTimeRemap.setValuesAtTimes(massivebusinessanimationTimeRemap_keyTimesArray, massivebusinessanimationTimeRemap_valuesArray);\r\t\t\tmassivebusinessanimationTimeRemap.removeKey(massivebusinessanimationTimeRemap.nearestKeyIndex(99999));\r\t\tmassivebusinessanimation.selected = false;\r\t// Add Shape Layer \"Icon_bg_mask\", varName \"iconbgmask\";\r\tvar iconbgmask = massivebusiness_comp.layers.addShape();\r\t\ticonbgmask.name = \"Icon_bg_mask\";\r\t\ticonbgmask.enabled = false;\r\t\ticonbgmask.motionBlur = true;\r\t\ticonbgmask.moveToEnd();\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).name = \"chemicals Outlines - Group 22\";\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).addProperty(\"ADBE Vector Group\");\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).name = \"Group 22\";\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar iconbgmaskPath = iconbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\tvar iconbgmaskPath_newShape = new Shape();\r\t\t\ticonbgmaskPath_newShape.vertices = [[144, 0], [0, 144], [-144, 0], [0, -144]];\r\t\t\ticonbgmaskPath_newShape.inTangents = [[0, -79.5289916992188], [79.5289916992188, 0], [0, 79.5289916992188], [-79.5290069580078, 0]];\r\t\t\ticonbgmaskPath_newShape.outTangents = [[0, 79.5289916992188], [-79.5290069580078, 0], [0, -79.5289916992188], [79.5289916992188, 0]];\r\t\t\ticonbgmaskPath_newShape.closed = true;\r\t\ticonbgmaskPath.setValue(iconbgmaskPath_newShape);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).addProperty(\"ADBE Vector Graphic - Stroke\");\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Color\").setValue([0,0,0,1]);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Width\").setValue(12);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Line Cap\").setValue(2);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Line Join\").setValue(2);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(3).property(\"ADBE Vector Anchor\").setValue([206,206]);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(1).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).name = \"chemicals Outlines - Group 23\";\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(2).addProperty(\"ADBE Vector Group\");\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).name = \"Group 23\";\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar iconbgmaskPath = iconbgmask.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\tvar iconbgmaskPath_newShape = new Shape();\r\t\t\ticonbgmaskPath_newShape.vertices = [[144, 0], [0, 144], [-144, 0], [0, -144]];\r\t\t\ticonbgmaskPath_newShape.inTangents = [[0, -79.5289916992188], [79.5289916992188, 0], [0, 79.5289916992188], [-79.5290069580078, 0]];\r\t\t\ticonbgmaskPath_newShape.outTangents = [[0, 79.5289916992188], [-79.5290069580078, 0], [0, -79.5289916992188], [79.5289916992188, 0]];\r\t\t\ticonbgmaskPath_newShape.closed = true;\r\t\ticonbgmaskPath.setValue(iconbgmaskPath_newShape);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).addProperty(\"ADBE Vector Graphic - Fill\");\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).property(2).property(\"ADBE Vector Fill Color\").setValue([0.14100000718061,0.67099998324525,0.88999998803232,1]);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(3).property(\"ADBE Vector Anchor\").setValue([206,206]);\r\t\ticonbgmask.property(\"ADBE Root Vectors Group\").property(2).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbgmask.property(\"ADBE Transform Group\").property(\"ADBE Anchor Point\").setValue([206,206,0]);\r\t\tvar iconbgmaskScale = iconbgmask.property(\"ADBE Transform Group\").property(\"ADBE Scale\");\r\t\t\tvar iconbgmaskScale_keyTimesArray = [0,0.4,2.4,2.76];\r\t\t\tvar iconbgmaskScale_valuesArray = [[0,0,100],[100,100,100],[100,100,100],[0,0,100]];\r\t\t\ticonbgmaskScale.setValuesAtTimes(iconbgmaskScale_keyTimesArray, iconbgmaskScale_valuesArray);\r\t\t\tvar iconbgmaskScale_easeInSpeedArray = [[0,0,0],[0,0,0],[0,0,0],[0,0,0]];\r\t\t\tvar iconbgmaskScale_easeInInfluArray = [[50,50,50],[50,50,50],[50,50,50],[50,50,50]];\r\t\t\tvar iconbgmaskScale_easeOutSpeedArray = [[0,0,0],[0,0,0],[0,0,0],[0,0,0]];\r\t\t\tvar iconbgmaskScale_easeOutInfluArray = [[50,50,50],[50,50,50],[50,50,50],[50,50,50]];\r\t\t\tvar iconbgmaskScale_keyInInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tvar iconbgmaskScale_keyOutInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tapplyEasing(iconbgmaskScale, iconbgmaskScale_keyTimesArray, [iconbgmaskScale_easeInSpeedArray, iconbgmaskScale_easeInInfluArray], [iconbgmaskScale_easeOutSpeedArray, iconbgmaskScale_easeOutInfluArray], [iconbgmaskScale_keyInInterpolationType, iconbgmaskScale_keyOutInterpolationType]);\r\r\t\ticonbgmask.selected = false;\r\t// Add existing composition \"massiveBusiness_animation\", varName \"massivebusinessanimation_comp\";\r\tvar shadow = massivebusiness_comp.layers.add(massivebusinessanimation_comp);\r\t\tshadow.name = \"shadow\";\r\t\tshadow.collapseTransformation = true;\r\t\tshadow.motionBlur = true;\r\t\tshadow.moveToEnd();\r\t\tshadow.trackMatteType = TrackMatteType.ALPHA;\r\t\tshadow.timeRemapEnabled = true;\r\t\tvar shadowTimeRemap = shadow.property(\"ADBE Time Remapping\");\r\t\t\tshadowTimeRemap.setValueAtTime(99999, shadowTimeRemap.keyValue(1));\r\t\t\tshadowTimeRemap.removeKey(2);\r\t\t\tshadowTimeRemap.removeKey(1);\r\t\t\tvar shadowTimeRemap_keyTimesArray = [0,1.2,1.6,2.8];\r\t\t\tvar shadowTimeRemap_valuesArray = [0,1.2,1.2,0];\r\t\t\tshadowTimeRemap.setValuesAtTimes(shadowTimeRemap_keyTimesArray, shadowTimeRemap_valuesArray);\r\t\t\tshadowTimeRemap.removeKey(shadowTimeRemap.nearestKeyIndex(99999));\r\t\tshadow.property(\"ADBE Effect Parade\").addProperty(\"ADBE Fill\");\r\t\tshadow.property(\"ADBE Effect Parade\").property(1).property(\"ADBE Fill-0002\").setValue([0,0,0,1]);\r\t\tvar shadowPosition = shadow.property(\"ADBE Transform Group\").property(\"ADBE Position\");\r\t\t\tvar shadowPosition_keyTimesArray = [0.28,0.6,2.2,2.48];\r\t\t\tvar shadowPosition_valuesArray = [[206,206,0],[227.5,218.5,0],[227.5,218.5,0],[206,206,0]];\r\t\t\tshadowPosition.setValuesAtTimes(shadowPosition_keyTimesArray, shadowPosition_valuesArray);\r\t\t\tvar shadowPosition_inSpatialTangents = [[-3.58333325386047,-2.08333325386047,0],[-3.58333325386047,-2.08333325386047,0],[0,0,0],[3.58333325386047,2.08333325386047,0]];\r\t\t\tvar shadowPosition_outSpatialTangents = [[3.58333325386047,2.08333325386047,0],[0,0,0],[-3.58333325386047,-2.08333325386047,0],[-3.58333325386047,-2.08333325386047,0]];\r\t\t\tapplySpatialTangents(shadowPosition, shadowPosition_keyTimesArray, shadowPosition_inSpatialTangents, shadowPosition_outSpatialTangents);\r\t\t\tvar shadowPosition_easeInSpeedArray = [0,0,0,0];\r\t\t\tvar shadowPosition_easeInInfluArray = [16.666666667,50,50,16.666666667];\r\t\t\tvar shadowPosition_easeOutSpeedArray = [0,0,0,0];\r\t\t\tvar shadowPosition_easeOutInfluArray = [50,16.666666667,16.666666667,50];\r\t\t\tvar shadowPosition_keyInInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tvar shadowPosition_keyOutInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tapplyEasing(shadowPosition, shadowPosition_keyTimesArray, [shadowPosition_easeInSpeedArray, shadowPosition_easeInInfluArray], [shadowPosition_easeOutSpeedArray, shadowPosition_easeOutInfluArray], [shadowPosition_keyInInterpolationType, shadowPosition_keyOutInterpolationType]);\r\r\t\tshadow.property(\"ADBE Transform Group\").property(\"ADBE Opacity\").setValue(20);\r\t\tshadow.selected = false;\r\t// Add Shape Layer \"Icon_bg\", varName \"iconbg\";\r\tvar iconbg = massivebusiness_comp.layers.addShape();\r\t\ticonbg.name = \"Icon_bg\";\r\t\ticonbg.motionBlur = true;\r\t\ticonbg.moveToEnd();\r\t\ticonbg.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).name = \"chemicals Outlines - Group 22\";\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).addProperty(\"ADBE Vector Group\");\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).name = \"Group 22\";\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar iconbgPath = iconbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\tvar iconbgPath_newShape = new Shape();\r\t\t\ticonbgPath_newShape.vertices = [[144, 0], [0, 144], [-144, 0], [0, -144]];\r\t\t\ticonbgPath_newShape.inTangents = [[0, -79.5289916992188], [79.5289916992188, 0], [0, 79.5289916992188], [-79.5290069580078, 0]];\r\t\t\ticonbgPath_newShape.outTangents = [[0, 79.5289916992188], [-79.5290069580078, 0], [0, -79.5289916992188], [79.5289916992188, 0]];\r\t\t\ticonbgPath_newShape.closed = true;\r\t\ticonbgPath.setValue(iconbgPath_newShape);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).addProperty(\"ADBE Vector Graphic - Stroke\");\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Color\").setValue([0,0,0,1]);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Width\").setValue(12);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Line Cap\").setValue(2);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(2).property(2).property(\"ADBE Vector Stroke Line Join\").setValue(2);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(3).property(\"ADBE Vector Anchor\").setValue([206,206]);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(1).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).name = \"chemicals Outlines - Group 23\";\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(2).addProperty(\"ADBE Vector Group\");\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).name = \"Group 23\";\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar iconbgPath = iconbg.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\tvar iconbgPath_newShape = new Shape();\r\t\t\ticonbgPath_newShape.vertices = [[144, 0], [0, 144], [-144, 0], [0, -144]];\r\t\t\ticonbgPath_newShape.inTangents = [[0, -79.5289916992188], [79.5289916992188, 0], [0, 79.5289916992188], [-79.5290069580078, 0]];\r\t\t\ticonbgPath_newShape.outTangents = [[0, 79.5289916992188], [-79.5290069580078, 0], [0, -79.5289916992188], [79.5289916992188, 0]];\r\t\t\ticonbgPath_newShape.closed = true;\r\t\ticonbgPath.setValue(iconbgPath_newShape);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).addProperty(\"ADBE Vector Graphic - Fill\");\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).property(2).property(\"ADBE Vector Fill Color\").setValue([0.1410000026226,0.6710000038147,0.88999998569489,1]);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(2).property(2).property(\"ADBE Vector Fill Opacity\").setValue(60);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(2).property(1).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(3).property(\"ADBE Vector Anchor\").setValue([206,206]);\r\t\ticonbg.property(\"ADBE Root Vectors Group\").property(2).property(3).property(\"ADBE Vector Position\").setValue([206,206]);\r\t\ticonbg.property(\"ADBE Transform Group\").property(\"ADBE Anchor Point\").setValue([206,206,0]);\r\t\tvar iconbgScale = iconbg.property(\"ADBE Transform Group\").property(\"ADBE Scale\");\r\t\t\tvar iconbgScale_keyTimesArray = [0,0.4,2.4,2.76];\r\t\t\tvar iconbgScale_valuesArray = [[0,0,100],[100,100,100],[100,100,100],[0,0,100]];\r\t\t\ticonbgScale.setValuesAtTimes(iconbgScale_keyTimesArray, iconbgScale_valuesArray);\r\t\t\tvar iconbgScale_easeInSpeedArray = [[0,0,0],[0,0,0],[0,0,0],[0,0,0]];\r\t\t\tvar iconbgScale_easeInInfluArray = [[50,50,50],[50,50,50],[50,50,50],[50,50,50]];\r\t\t\tvar iconbgScale_easeOutSpeedArray = [[0,0,0],[0,0,0],[0,0,0],[0,0,0]];\r\t\t\tvar iconbgScale_easeOutInfluArray = [[50,50,50],[50,50,50],[50,50,50],[50,50,50]];\r\t\t\tvar iconbgScale_keyInInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tvar iconbgScale_keyOutInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tapplyEasing(iconbgScale, iconbgScale_keyTimesArray, [iconbgScale_easeInSpeedArray, iconbgScale_easeInInfluArray], [iconbgScale_easeOutSpeedArray, iconbgScale_easeOutInfluArray], [iconbgScale_keyInInterpolationType, iconbgScale_keyOutInterpolationType]);\r\r\t\ticonbg.selected = false;\r// Working with comp \"massiveBusiness_animation\", varName \"massivebusinessanimation_comp\";\rif (massivebusinessanimation_comp_populate === true) {\r\t// Add Shape Layer \"massiveBusiness Outlines - Group 1\", varName \"massivebusinessOutlinesGroup1\";\r\tvar massivebusinessOutlinesGroup1 = massivebusinessanimation_comp.layers.addShape();\r\t\tmassivebusinessOutlinesGroup1.name = \"massiveBusiness Outlines - Group 1\";\r\t\tmassivebusinessOutlinesGroup1.startTime = 0.24;\r\t\tmassivebusinessOutlinesGroup1.inPoint = 0.36;\r\t\tmassivebusinessOutlinesGroup1.outPoint = 3.04;\r\t\tmassivebusinessOutlinesGroup1.motionBlur = true;\r\t\tmassivebusinessOutlinesGroup1.moveToEnd();\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Root Vectors Group\").addProperty(\"ADBE Vector Group\");\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Root Vectors Group\").property(1).property(2).addProperty(\"ADBE Vector Shape - Group\");\r\t\tvar massivebusinessOutlinesGroup1Path = massivebusinessOutlinesGroup1.property(\"ADBE Root Vectors Group\").property(1).property(2).property(1).property(\"ADBE Vector Shape\");\r\t\t\tvar massivebusinessOutlinesGroup1Path_keyTimesArray = [0.36, 0.48, 0.68, 1.08];\r\t\t\tvar massivebusinessOutlinesGroup1Path_object = {};\r\t\t\t\tmassivebusinessOutlinesGroup1Path_object.closed = true;\r\t\t\t\tmassivebusinessOutlinesGroup1Path_object.vertices = [[[-9.59049987792969, 70.5160064697266], [14.5905151367188, 70.5160064697266], [13.9830322265625, 70.4839935302734], [10.3190307617188, 70.4839935302734], [10.2295227050781, 70.5890045166016], [3.76750183105469, 70.5890045166016], [3.85700988769531, 70.4839935302734], [1.54403686523438, 70.1714935302734], [1.45449829101562, 70.2454986572266], [-2.00997924804688, 70.2884979248047], [-2.04048156738281, 70.2454986572266], [-5.70198059082031, 70.2884979248047], [-5.73248291015625, 70.2454986572266], [-9.39398193359375, 70.2884979248047]], [[-84.5904998779297, 70.5160064697266], [84.5905151367188, 70.5160064697266], [83.9830322265625, 70.4839935302734], [57.8190307617188, 70.4839935302734], [57.7295227050781, 70.5890045166016], [46.2675170898438, 70.5890045166016], [46.3570251464844, 70.4839935302734], [24.0440216064453, 70.1714935302734], [23.9545135498047, 70.2454986572266], [-12.0099792480469, 70.2884979248047], [-12.0404815673828, 70.2454986572266], [-48.2019805908203, 70.2884979248047], [-48.2324829101562, 70.2454986572266], [-84.3939819335938, 70.2884979248047]], [[-84.5904998779297, 70.5160064697266], [84.5905151367188, 70.5160064697266], [79.6790161132812, 6.48399353027344], [57.8900146484375, 6.48399353027344], [57.8005065917969, 6.58900451660156], [46.3385009765625, 6.58900451660156], [46.4280090332031, 6.48399353027344], [24.1150054931641, 6.17149353027344], [24.0254974365234, 5.68299865722656], [-11.9389953613281, 5.72599792480469], [-11.9694976806641, 5.68299865722656], [-48.1309967041016, 5.72599792480469], [-48.1614990234375, 5.68299865722656], [-84.322998046875, 5.72599792480469]], [[-84.5904998779297, 70.5160064697266], [84.5905151367188, 70.5160064697266], [79.5895080566406, -70.5160064697266], [57.8005065917969, -70.5160064697266], [57.8005065917969, 6.58900451660156], [46.3385009765625, 6.58900451660156], [46.3385009765625, -70.5160064697266], [24.0254974365234, -70.5160064697266], [24.0254974365234, 5.68299865722656], [-11.9694976806641, -16.0240020751953], [-11.9694976806641, 5.68299865722656], [-48.1614990234375, -16.0240020751953], [-48.1614990234375, 5.68299865722656], [-84.3535003662109, -16.0240020751953]]];\r\t\t\taddShapeKeyframes(massivebusinessOutlinesGroup1Path, massivebusinessOutlinesGroup1Path_keyTimesArray, massivebusinessOutlinesGroup1Path_object);\r\t\t\tvar massivebusinessOutlinesGroup1Path_easeInSpeedArray = [0,0,2.83349473266731,0];\r\t\t\tvar massivebusinessOutlinesGroup1Path_easeInInfluArray = [65,65,65,65];\r\t\t\tvar massivebusinessOutlinesGroup1Path_easeOutSpeedArray = [0,0,2.83347893605559,0];\r\t\t\tvar massivebusinessOutlinesGroup1Path_easeOutInfluArray = [65,65,65,16.666666667];\r\t\t\tvar massivebusinessOutlinesGroup1Path_keyInInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tvar massivebusinessOutlinesGroup1Path_keyOutInterpolationType = [KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER,KeyframeInterpolationType.BEZIER];\r\t\t\tapplyEasing(massivebusinessOutlinesGroup1Path, massivebusinessOutlinesGroup1Path_keyTimesArray, [massivebusinessOutlinesGroup1Path_easeInSpeedArray, massivebusinessOutlinesGroup1Path_easeInInfluArray], [massivebusinessOutlinesGroup1Path_easeOutSpeedArray, massivebusinessOutlinesGroup1Path_easeOutInfluArray], [massivebusinessOutlinesGroup1Path_keyInInterpolationType, massivebusinessOutlinesGroup1Path_keyOutInterpolationType]);\r\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Root Vectors Group\").property(1).property(2).addProperty(\"ADBE Vector Graphic - Stroke\");\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Root Vectors Group\").property(1).property(2).property(2).property(\"ADBE Vector Stroke Color\").setValue([0,0,0,1]);\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Root Vectors Group\").property(1).property(2).property(2).property(\"ADBE Vector Stroke Width\").setValue(8.55399990081787);\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Root Vectors Group\").property(1).property(2).property(2).property(\"ADBE Vector Stroke Line Join\").setValue(2);\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Root Vectors Group\").property(1).property(2).addProperty(\"ADBE Vector Graphic - Fill\");\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Root Vectors Group\").property(1).property(2).property(3).property(\"ADBE Vector Fill Color\").setValue([1,1,1,1]);\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Root Vectors Group\").property(1).property(3).property(\"ADBE Vector Position\").setValue([203.999893188477,194.181503295898]);\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Transform Group\").property(\"ADBE Anchor Point\").setValue([203.999893188477,194.181503295898,0]);\r\t\tmassivebusinessOutlinesGroup1.property(\"ADBE Transform Group\").property(\"ADBE Position\").setValue([203.999893188477,194.181503295898,0]);\r\t\tmassivebusinessOutlinesGroup1.selected = false;\r}\rmassivebusiness_comp.openInViewer();\r\r} catch(e) {\r\talert(e.toString() + \"\\nError on line: \" + e.line.toString());\r}\rapp.endUndoGroup();\r\r\rfunction getItem(itemName, itemInstanceName, locationObject) {\r\tif (locationObject.numItems > 0) {\r\t\tfor (var i = 1; i <= locationObject.numItems; i ++) {\r\t\t\tvar curItem = locationObject.item(i);\r\t\t\tif (curItem.name === itemName) {\r\t\t\t\tif (curItem instanceof itemInstanceName || (curItem.mainSource !== \"undefined\" && curItem.mainSource instanceof itemInstanceName)) {\r\t\t\t\t\treturn curItem;\r\t\t\t\t}\r\t\t\t}\r\t\t}\r\t}\r\treturn null;\r}\r\rfunction applyEasing(property, keyTimesArray, easeInArray, easeOutArray, keyInterpolationArray) {\r\tfor (var i = 0; i < keyTimesArray.length; i ++) {\r\t\tif (property.propertyValueType === PropertyValueType.TwoD) {\r\t\t\tvar easeIn0 = new KeyframeEase(easeInArray[0][i][0], easeInArray[1][i][0]);\r\t\t\tvar easeOut0 = new KeyframeEase(easeOutArray[0][i][0], easeOutArray[1][i][0]);\r\t\t\tvar easeIn1 = new KeyframeEase(easeInArray[0][i][1], easeInArray[1][i][1]);\r\t\t\tvar easeOut1 = new KeyframeEase(easeOutArray[0][i][1], easeOutArray[1][i][1]);\r\t\t\tproperty.setTemporalEaseAtKey(i+1, [easeIn0, easeIn1], [easeOut0, easeOut1]);\r\t\t} else if (property.propertyValueType === PropertyValueType.ThreeD) {\r\t\t\tvar easeIn0 = new KeyframeEase(easeInArray[0][i][0], easeInArray[1][i][0]);\r\t\t\tvar easeOut0 = new KeyframeEase(easeOutArray[0][i][0], easeOutArray[1][i][0]);\r\t\t\tvar easeIn1 = new KeyframeEase(easeInArray[0][i][1], easeInArray[1][i][1]);\r\t\t\tvar easeOut1 = new KeyframeEase(easeOutArray[0][i][1], easeOutArray[1][i][1]);\r\t\t\tvar easeIn2 = new KeyframeEase(easeInArray[0][i][2], easeInArray[1][i][2]);\r\t\t\tvar easeOut2 = new KeyframeEase(easeOutArray[0][i][2], easeOutArray[1][i][2]);\r\t\t\tproperty.setTemporalEaseAtKey(i+1, [easeIn0, easeIn1, easeIn2], [easeOut0, easeOut1, easeOut2]);\r\t\t} else {\r\t\t\tvar easeIn = new KeyframeEase(easeInArray[0][i], easeInArray[1][i]);\r\t\t\tvar easeOut = new KeyframeEase(easeOutArray[0][i], easeOutArray[1][i]);\r\t\t\tif (keyInterpolationArray[1][i] !== KeyframeInterpolationType.HOLD) {\r\t\t\t\tproperty.setTemporalEaseAtKey(i+1, [easeIn], [easeOut]);\r\t\t\t} else {\r\t\t\t\tproperty.setTemporalEaseAtKey(i+1, [easeIn]);\r\t\t\t}\r\t\t}\r\t\tproperty.setInterpolationTypeAtKey(i+1, keyInterpolationArray[0][i], keyInterpolationArray[1][i]);\r\t}\r}\r\rfunction applySpatialTangents(property, keyTimesArray, inSpatialTangentsArray, outSpatialTangentsArray) {\r\tfor (var sp = 0; sp < keyTimesArray.length; sp ++) {\r\t\tproperty.setSpatialTangentsAtKey(sp+1, inSpatialTangentsArray[sp], outSpatialTangentsArray[sp]);\r\t}\r}\rfunction addShapeKeyframes(myPath, keyTimesArray, myShapeObject) {\r\tvar valuesArray = [];\r\tfor (var i = 0, il = keyTimesArray.length; i < il; i ++) {\r\t\tvar newShape = new Shape();\r\t\tfor (var prop in myShapeObject) {\r\t\t\tif (myShapeObject[prop] instanceof Array) { newShape[prop] = myShapeObject[prop][i]; }\r\t\t\telse { newShape[prop] = myShapeObject[prop]; }\r\t\t}\r\t\tvaluesArray.push(newShape);\r\t}\r\tmyPath.setValuesAtTimes(keyTimesArray, valuesArray);\r}\r\r}", "isFetchingContent() {\n return this.props.workspace.isFetching;\n }", "function run() {\n }", "function rc(){}", "function checkPath () {\n $scope.alreadyOpen_ws = null;\n var loc = $location.path();\n var index = loc.indexOf('workspace/');\n if (index > -1) {\n var workspaceSubstr = loc.substring(index+10);\n var lastindex = workspaceSubstr.indexOf('/');\n if (lastindex > -1) {\n $scope.alreadyOpen_ws = workspaceSubstr.substring(0, lastindex);\n if ($scope.workspaces) { // only open if workspaces already fetched\n reopenWorkspaceFolder();\n }\n }\n }\n }", "run() {\n setDestGlobals(this, this._run);\n }", "function mainImpl(doc) {\n\n}", "function initSelectedWorkspace() {\n var selectedName = StorageService.get('selectedWorkspaceName');\n\n if (!selectedName) {\n selectedName = defaultWorkspace.name;\n StorageService.set('selectedWorkspaceName', selectedName);\n }\n\n var currRepos = repositories();\n for (var i = 0; i < currRepos.length; ++i) {\n if (currRepos[i].name == selectedName)\n return currRepos[i];\n }\n\n return null;\n }", "function Yf(a){var b;if(a.pb)b=a.pb();else if(a.ob)b=a.ob();else throw\"Not Block or Workspace: \"+a;a=Object.create(null);for(var c=0;c<b.length;c++){var d=b[c].rc;if(d)for(var d=d.call(b[c]),e=0;e<d.length;e++){var g=d[e];g&&(a[g.toLowerCase()]=g)}}b=[];for(var h in a)b.push(a[h]);return b}", "contClick() {\n // temporarily goes right to the workspace registration\n app.goto('/init/newworkspace');\n }", "populateWorkspaceWithComponents() {\n this.fs.createFile('utils', 'is-type.js', fixtures().isType);\n this.addComponentUtilsIsType();\n this.fs.createFile('utils', 'is-string.js', fixtures().isString);\n this.addComponentUtilsIsString();\n this.createComponentBarFoo(fixtures().barFooFixture);\n this.addComponentBarFoo();\n }", "reset() {\n let d = new Date();\n d = new Date(d.getTime() - 1000 * 60);\n let offset_sec = d.getTimezoneOffset() * 60;\n // sublime = 1, vscode = 2, eclipse = 3, intelliJ = 4,\n // visual studio = 6, atom = 7\n this.pluginId = utilMgr.getPluginId();\n // the value that goes with this object, which is a Number\n // but kept as a String\n this.keystrokes = 0;\n // unique set of file names\n this.source = {};\n // start time in seconds\n this.start = Math.round(Date.now() / 1000);\n // end time in seconds\n this.local_start = this.start - offset_sec;\n // setting a default, but this will be set within the constructor\n this.version = utilMgr.getVersion();\n this.os = utilMgr.getOs();\n this.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n this.elapsed_seconds = 0;\n this.project = new Project();\n this.cumulative_editor_seconds = 0;\n this.cumulative_session_seconds = 0;\n this.elapsed_seconds = 0;\n this.project_null_error = '';\n this.workspace_name = '';\n }", "static private protected internal function m118() {}", "work() {}", "function main() {\n\n}", "SaveSourceState() {\n\n }", "function _main() {\n try {\n // the modules own main routine\n //_logCalls();\n\n // enable a global accessability from window\n window.tools = {} || window.tools;\n window.tools._log = _log;\n window.tools._addNavigation = _addNavigation;\n } catch (error) {\n console.log(error);\n }\n\n }", "function Utils() {}", "function Utils() {}", "function run() {}", "function TestRoot() {}", "static private public function m119() {}", "function Drive() {\r\n}", "initializing() {\n this.getParentProject();\n }", "function SmalltalkRoot () {\n }", "Run() {\n\n }", "load() {}", "load() {}" ]
[ "0.65282273", "0.5814893", "0.5784608", "0.5768638", "0.5717587", "0.5606703", "0.55839086", "0.5496288", "0.54780936", "0.53287315", "0.525075", "0.52214694", "0.5207095", "0.52064526", "0.5197071", "0.51900536", "0.5188168", "0.5171612", "0.51608986", "0.5155399", "0.5153506", "0.51466876", "0.51371944", "0.5136075", "0.51334614", "0.512334", "0.51187414", "0.51157206", "0.51070946", "0.50879407", "0.50829005", "0.507469", "0.5073176", "0.5068555", "0.50605774", "0.5051363", "0.5047596", "0.50464404", "0.5040661", "0.5039447", "0.5009294", "0.5008062", "0.49970767", "0.49958205", "0.49866945", "0.49799034", "0.497378", "0.49695346", "0.49581563", "0.49532273", "0.49501634", "0.4947815", "0.49404275", "0.49335095", "0.4912829", "0.49111426", "0.49085578", "0.4898242", "0.4897142", "0.4890023", "0.48888257", "0.4888467", "0.4888467", "0.48829204", "0.48755887", "0.48626822", "0.4858558", "0.48543233", "0.48514807", "0.4848791", "0.4844717", "0.48392206", "0.4837721", "0.48361522", "0.48316365", "0.48286477", "0.4817902", "0.4814797", "0.48089543", "0.48082447", "0.48080483", "0.4807854", "0.4806547", "0.48059815", "0.48053658", "0.48027354", "0.48018298", "0.48009092", "0.47940296", "0.47772682", "0.47766954", "0.47766954", "0.47725934", "0.47723046", "0.4771938", "0.47691366", "0.47683704", "0.47665432", "0.47643507", "0.47632152", "0.47632152" ]
0.0
-1
Contains the liceses for assets used in this we app
function Licenses() { const classes = useStyles; return ( <Card className={classes.root}> <CardContent> <Typography className={classes.title} color="textSecondary" gutterBottom > Icon Licenses </Typography> <Typography variant="h5" component="h2"> Weather Icons </Typography> <Typography variant="body2" component="p"> <div> Icons made by{" "} <a href="https://www.flaticon.com/authors/iconixar" title="iconixar" > iconixar </a>{" "} from{" "} <a href="https://www.flaticon.com/" title="Flaticon"> www.flaticon.com </a> </div> <br /> </Typography> </CardContent> <CardContent> <Typography className={classes.title} color="textSecondary" gutterBottom > Icon Licenses </Typography> <Typography variant="h5" component="h2"> Github Icon </Typography> <Typography variant="body2" component="p"> <div> Icons made by{" "} <a href="https://www.flaticon.com/authors/pixel-perfect" title="Pixel perfect" > Pixel perfect </a>{" "} from{" "} <a href="https://www.flaticon.com/" title="Flaticon"> www.flaticon.com </a> </div> <br /> </Typography> </CardContent> <CardContent> <Typography className={classes.title} color="textSecondary" gutterBottom > Icon Licenses </Typography> <Typography variant="h5" component="h2"> Licenses Icon </Typography> <Typography variant="body2" component="p"> <div> Icons made by{" "} <a href="https://www.flaticon.com/authors/wanicon" title="wanicon"> wanicon </a>{" "} from{" "} <a href="https://www.flaticon.com/" title="Flaticon"> www.flaticon.com </a> </div> <br /> </Typography> </CardContent> </Card> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLostvibeAssets() {\n\n}", "get mainAsset() {}", "function createAssets(){\n assets = [];\n assets.push(path.join(__dirname, '../plug/pip_resolve.py'));\n assets.push(path.join(__dirname, '../plug/distPackage.py'));\n assets.push(path.join(__dirname, '../plug/package.py'));\n assets.push(path.join(__dirname, '../plug/reqPackage.py'));\n assets.push(path.join(__dirname, '../plug/utils.py'));\n\n assets.push(path.join(__dirname, '../plug/requirements/fragment.py'));\n assets.push(path.join(__dirname, '../plug/requirements/parser.py'));\n assets.push(path.join(__dirname, '../plug/requirements/requirement.py'));\n assets.push(path.join(__dirname, '../plug/requirements/vcs.py'));\n assets.push(path.join(__dirname, '../plug/requirements/__init__.py'));\n\n return assets;\n}", "getAssetRoots() {\n return getRoots()\n }", "LoadAllAssets() {}", "async GetAllAssets(ctx) {\n const allResults = [];\n // range query with empty string for startKey and endKey does an open-ended query of all assets in the chaincode namespace.\n const iterator = await ctx.stub.getStateByRange(\"\", \"\");\n let result = await iterator.next();\n while (!result.done) {\n const strValue = Buffer.from(result.value.value.toString()).toString(\n \"utf8\",\n );\n allResults.push({ Key: result.value.key, Value: strValue });\n result = await iterator.next();\n }\n return JSON.stringify(allResults);\n }", "function loadAssets () {\n OasisAssets = {};\n\n // terrain\n OasisAssets['grass'] = getImage('../../res/', 'grass.png');\n OasisAssets['sand'] = getImage('../../res/', 'sand.png');\n OasisAssets['shore'] = getImage('../../res/', 'shore.png');\n OasisAssets['ocean'] = getImage('../../res/', 'ocean.png');\n OasisAssets['stone'] = getImage('../../res/', 'stone.png');\n OasisAssets['tree'] = getImage('../../res/', 'tree.png');\n OasisAssets['leaves'] = getImage('../../res/', 'leaves.png');\n}", "function chromeAppAssets() {\n\tgulp.src('manifest.json')\n\t\t.pipe(gulp.dest('./build'));\n\n\treturn gulp.src('icon.png')\n\t\t.pipe(gulp.dest('./build'));\n}", "function getAssetList() {\r\n let url = API_URL + 'assets/' + '?key=' + API_KEY;\r\n return fetchAssets(url);\r\n}", "preload() {\n const images = Object.keys(ASSET.IMAGE).map(\n (imgKey) => ASSET.IMAGE[imgKey]\n );\n for (let image of images) {\n this.load.image(image.KEY, image.ASSET);\n }\n }", "async GetAllAssets(ctx) {\n const allResults = [];\n // range query with empty string for startKey and endKey does an open-ended query of all assets in the chaincode namespace.\n const iterator = await ctx.stub.getStateByRange('', '');\n let result = await iterator.next();\n while (!result.done) {\n const strValue = Buffer.from(result.value.value.toString()).toString('utf8');\n let record;\n try {\n record = JSON.parse(strValue);\n } catch (err) {\n console.log(err);\n record = strValue;\n }\n allResults.push({ Key: result.value.key, Record: record });\n result = await iterator.next();\n }\n return JSON.stringify(allResults);\n }", "incrementLoadedAssets () {\n this._loadedAssets += 1;\n }", "assets(path) {\n // Retrieve asset chunk file names\n // (which are output by client side Webpack build)\n const result = { ...parameters.chunks() }\n\n // Webpack entry point (can be used for code splitting)\n result.entry = 'main'\n\n // // Clear Webpack require() cache for hot reload in development mode\n // // (this is not necessary)\n // if (process.env.NODE_ENV !== 'production') {\n // delete require.cache[require.resolve('../assets/images/icon.png')]\n // }\n\n // Add \"favicon\"\n result.icon = require('../assets/images/zolaicon.png')\n\n\n // Return assets\n return result\n }", "async GetAllAssets(ctx) {\r\n const allResults = [];\r\n // range query with empty string for startKey and endKey does an open-ended query of all assets in the chaincode namespace.\r\n const iterator = await ctx.stub.getStateByRange('', '');\r\n let result = await iterator.next();\r\n while (!result.done) {\r\n const strValue = Buffer.from(result.value.value.toString()).toString('utf8');\r\n let record;\r\n try {\r\n record = JSON.parse(strValue);\r\n } catch (err) {\r\n console.log(err);\r\n record = strValue;\r\n }\r\n allResults.push({ Key: result.value.key, Record: record });\r\n result = await iterator.next();\r\n }\r\n return JSON.stringify(allResults);\r\n }", "function getAssets() {\n axios\n .get(process.env.REACT_APP_API_URL + \"/assets\")\n .then((res) => {\n setAssets(res.data);\n // console.log(res.data);\n })\n .catch((err) => {\n console.log(\"Error listing the assets\");\n });\n }", "function AssetCache() {\n\n this.DEFAULT_CATEGORY = 'general';\n\n this.cache = {};\n this.loadStaging = [];\n\n this.cache[this.DEFAULT_CATEGORY] = {};\n\n}", "function game_queueData() {\n\t\tvar data = [\n\t\t\t\"img/awesome.png\",\n\t\t\t\"img/awesome_rays.png\"\n\t\t];\n\t\tg_ASSETMANAGER.queueAssets(data);\n\t\tdata = [\n\t\t];\n\t\tg_SOUNDMANAGER.loadSounds(data);\n}", "function AssetsLoader() {\n this.images = [];\n this.hasLoaded = false;\n}", "async _loadAssetsAsync() {\n\n const imageAssets = _cacheFiles([\n ..._getImages()\n ])\n\n const soundsAsset = _cacheFiles([\n ..._getAudios()\n ])\n\n const fontAssets = _cacheFonts([\n {name: 'alcubierre', font: require('./src/assets/fonts/Alcubierre/Alcubierre.otf')},\n {name: 'rubik-black', font: require('./src/assets/fonts/Rubik/Rubik-Black.ttf')},\n {name: 'rubik-bold', font: require('./src/assets/fonts/Rubik/Rubik-Bold.ttf')},\n {name: 'rubik-medium', font: require('./src/assets/fonts/Rubik/Rubik-Medium.ttf')},\n {name: 'rubik-regular', font: require('./src/assets/fonts/Rubik/Rubik-Regular.ttf')},\n {name: 'rubik-light', font: require('./src/assets/fonts/Rubik/Rubik-Light.ttf')}\n ])\n\n //await Promise.all([...fontAssets])\n await Promise.all([...fontAssets, ...imageAssets, ...soundsAsset])\n\n }", "function AssetLoader() {\n this._things = [];\n this._thingsToLoad = 0;\n this._thingsLoaded = 0;\n}", "loadResources(){\n\n const directory = \"./assets/images/\";\n\n //Load Character-related textures\n this.gameContent.skins.forEach(({skin,texture}) => {\n this.loader.add(`skin_${skin}`,`${directory}/skins/${texture}`);\n });\n\n //Load Map textures\n this.gameContent.maps.forEach(({map,source,obstacle}) => {\n\n this.loader\n .add(`map_${map}`,`${directory}/${source}`)\n .add(`obstacle_${map}`,`${directory}/${obstacle.texture}`);\n\n });\n\n //Load UI-related textures\n this.loader\n .add(\"ui_background\", `${directory}/${this.gameContent.ui.background}`)\n .add(\"ui_button\", `${directory}/${this.gameContent.ui.button}`)\n .add(\"ui_button2\", `${directory}/${this.gameContent.ui.button2}`)\n .add(\"ui_button3\", `${directory}/${this.gameContent.ui.button3}`)\n .add(\"ui_arrow\", `${directory}/${this.gameContent.ui.arrow}`)\n .add(\"ui_loader\", `${directory}/${this.gameContent.ui.loader}`)\n .add(\"ui_sound\", `${directory}/${this.gameContent.ui.sound}`)\n .add(\"ui_muted\", `${directory}/${this.gameContent.ui.muted}`);\n\n //Load Sounds *****\n\n }", "LoadAssetWithSubAssets() {}", "function AssetManager() {\n\tthis.successCount = 0;\n this.errorCount = 0;\n this.cache = {};\n \tthis.downloadQueue = [];\n}", "static preload() {\n\n\t\tlet _onAssetsLoaded = function(e, ressources) {\n\t\t\tShooter.assets = ressources;\n\n\t\t\tShooter.setup();\n\t\t}\n\n\t\tShooter.loader\n\t\t\t.add(Shooter.assetsDir + \"background.jpg\") //TODO : use json objects with index\n\t\t\t.add(Shooter.assetsDir + \"space_ship.png\")\n\t\t\t.add(Shooter.assetsDir + \"space_ship_hit.png\")\n\t\t\t.add(Shooter.assetsDir + \"enemy.png\")\n\t\t\t.add(Shooter.assetsDir + \"bullet.png\")\n\t\t\t.add(Shooter.assetsDir + \"explode.json\");\n\t\t\t\n\t\tShooter.loader.load(_onAssetsLoaded);\n\t}", "get assetNames() {}", "loadResources() {\n lbs.loader.scripts = lbs.loader.scripts.filter(this.uniqueFilter)\n lbs.loader.styles = lbs.loader.styles.filter(this.uniqueFilter)\n lbs.loader.libs = lbs.loader.libs.filter(this.uniqueFilter)\n\n lbs.log.debug(`Scripts to load:${lbs.loader.scripts}`)\n lbs.log.debug(`Styles to load: ${lbs.loader.styles}`)\n lbs.log.debug(`Libs to load: ${lbs.loader.libs}`)\n\n $.each(lbs.loader.libs, (i) => {\n lbs.loader.loadScript(lbs.loader.libs[i])\n })\n\n $.each(lbs.loader.scripts, (i) => {\n lbs.loader.loadScript(lbs.loader.scripts[i])\n })\n\n $.each(lbs.loader.styles, (i) => {\n lbs.loader.loadStyle(lbs.loader.styles[i])\n })\n }", "loadAssets() {\n AssetLoader.load(this.setupGame, this.onLoadProgress);\n }", "getAssetRoots() {\n return [__dirname];\n }", "function Asset(name, imgPath) {\n this.name = name;\n this.imgPath = imgPath;\n this.votes = 0;\n this.timesShown = 0;\n\n // you might not see this in production code depending on where you work but it is a handy way of getting every goat into the allGoat array every time you make one\n Asset.allAssets.push(this)\n}", "preload() {\n\n // loading assets\n this.load.image(\"wheel\", Utils.UrlRoot + \"minigame/wheel/wheel.png\");\n this.load.image(\"pin\", Utils.UrlRoot + \"minigame/wheel/pin.png\");\n }", "splitUrls() {\n // All Assets Urls\n this.urls = this.assets.map(function (item) {\n return item.href;\n }.bind(this)); // Css Urls\n\n this.cssUrls = this.css.map(function (item) {\n return item.href;\n });\n }", "downloadAds() {\n const adsString = JSON.stringify(this.ads);\n let adUrls = getUrls(adsString);\n adUrls = Array.from(adUrls)\n this.cacheAssets(adUrls);\n }", "LoadAllAssetsAsync() {}", "static listGfx(){\n let assets = new Array();\n assets.push(\"gfx/sign_danger.png\");\n assets.push(\"gfx/turtle.png\");\n assets.push(\"gfx/turtle_in_shell_r0.png\");\n assets.push(\"gfx/squished.png\");\n assets.push(\"gfx/spring_jump_up.png\");\n assets.push(\"gfx/bomb.png\");\n assets.push(\"gfx/block_fall_on_touch_damaged_02.png\");\n assets.push(\"gfx/block_pushable.png\");\n assets.push(\"gfx/cloud.png\");\n assets.push(\"gfx/button_floor.png\");\n assets.push(\"gfx/bg-forest.png\");\n assets.push(\"gfx/vampire_wannabe.png\");\n assets.push(\"gfx/stompy.png\");\n assets.push(\"gfx/platform_left_right.png\");\n assets.push(\"gfx/gorilla_projectile.png\");\n assets.push(\"gfx/tombstone.png\");\n assets.push(\"gfx/flying_fire.png\");\n assets.push(\"gfx/jumpee.png\");\n assets.push(\"gfx/l0_splash.png\");\n assets.push(\"gfx/bomb_started.png\");\n assets.push(\"gfx/lava.png\");\n assets.push(\"gfx/block_fall_on_touch.png\");\n assets.push(\"gfx/canon_horizontal.png\");\n assets.push(\"gfx/sphere_within_sphere.png\");\n assets.push(\"gfx/explosion_big.png\");\n assets.push(\"gfx/bush_branch.png\");\n assets.push(\"gfx/elephanko_mad.png\");\n assets.push(\"gfx/button_floor_pressed.png\");\n assets.push(\"gfx/stars_black_sky.png\");\n assets.push(\"gfx/spring_jump_up_extended.png\");\n assets.push(\"gfx/elephanko.png\");\n assets.push(\"gfx/doggy.png\");\n assets.push(\"gfx/pants_gorilla_l0.png\");\n assets.push(\"gfx/explosion_small.png\");\n assets.push(\"gfx/ground_lr.png\");\n assets.push(\"gfx/fancy_city_dweller.png\");\n assets.push(\"gfx/canon_horizontal_shoot_soon.png\");\n assets.push(\"gfx/hero_r0.png\");\n assets.push(\"gfx/wood_texture.png\");\n assets.push(\"gfx/mr_spore.png\");\n assets.push(\"gfx/bomb_ignited.png\");\n assets.push(\"gfx/block_level_transition.png\");\n assets.push(\"gfx/brick_gray_bg.png\");\n assets.push(\"gfx/turtle_in_shell_l0.png\");\n assets.push(\"gfx/door_next_level_wide.png\");\n assets.push(\"gfx/turtle_in_shell.png\");\n assets.push(\"gfx/unknown.png\");\n assets.push(\"gfx/fancy_city_dweller_hat.png\");\n assets.push(\"gfx/canon_bullet_left.png\");\n assets.push(\"gfx/spikes.png\");\n assets.push(\"gfx/ground_lr2.png\");\n assets.push(\"gfx/spike_ceiling.png\");\n assets.push(\"gfx/block_fall_on_touch_damaged.png\");\n assets.push(\"gfx/fountain.png\");\n assets.push(\"gfx/turtle_r0.png\");\n assets.push(\"gfx/sign_its_safe.png\");\n assets.push(\"gfx/door_next_level.png\");\n assets.push(\"gfx/spike_ceiling_falling.png\");\n assets.push(\"gfx/smoke_dust.png\");\n assets.push(\"gfx/bush_stackable.png\");\n assets.push(\"gfx/magic_potion.png\");\n assets.push(\"gfx/pants_gorilla_r0.png\");\n assets.push(\"gfx/rabbit_house.png\");\n assets.push(\"gfx/augustus_of_prima_rabitta.png\");\n assets.push(\"gfx/hero_l0.png\");\n assets.push(\"gfx/turtle_l0.png\");\n assets.push(\"levels/l_00_rabbit_in_house.json\");\n assets.push(\"levels/l_01.json\");\n assets.push(\"levels/l_02_vampire_weekend.json\");\n assets.push(\"levels/l_exp.json\");\n assets.push(\"levels/l_05.json\");\n assets.push(\"levels/l_02.json\");\n assets.push(\"levels/l_04.json\");\n assets.push(\"levels/l_03.json\");\n assets.push(\"levels/l_99_rabbit_in_safe_house.json\");\n assets.push(\"levels/gorilla.json\");\n assets.push(\"levels/l_bug_stomp.json\");\n return assets;\n }", "function AssetManager() {\n this.successCount = 0;\n this.errorCount = 0;\n this.cache = [];\n this.downloadQueue = [];\n}", "function preloadAssets() {\n let assets = BEM.getBEMNodes('asset');\n let promises = [];\n\n for (let i=0; i<assets.length; i++) {\n let promise = new Promise((resolve, reject) => {\n let asset = assets[i]\n let img = new Image();\n img.onload = resolve;\n img.onerror = reject;\n img.src = asset.src;\n });\n\n promises.push(promise);\n }\n\n return promises;\n}", "function deleteAssets() {\n console.log(globals.assets.length);\n for (var i=0; i<globals.assets.length; i++){\n globals.assets[i].remove(function(){console.log(\"Removed\");}, fsError);\n }\n globals.assets.splice(0,globals.assets.length);\n \n var aReader = globals.assetDirectory.createReader();\n aReader.readEntries(function(results){\n console.log(\"in read entries result\", results);\n });\n /*\n var rmFile = globals.assetDirectory.getFile(globals.assets[0].fullPath, {create:false}, function(aFile){\n console.log(globals.assets);\n aFile.remove(function(){console.log(\"Removed\");}, fsError);\n globals.assets.splice(0,1);\n }, fsError);\n */\n}", "get assetPath() {}", "get assetPath() {}", "preloadAssets()\n {\n // Create our manifest of files to load\n // PreloadJS will try to automatically parse what kind of file we're loading \n // We can consider making a seperate JSON file that has all of this info in it\n manifest = [\n\t\t\t{\n src: \"leave_these_alone/audio.js\",\n },\n\t\t\t{\n src: \"leave_these_alone/utils.js\",\n },\n\t\t\t{\n src: \"leave_these_alone/ui/screen.js\",\n },\n\t\t\t{\n src: \"leave_these_alone/ui/ui.js\",\n },\n\t\t\t{\n src: \"leave_these_alone/ui/endscreen.js\",\n },\n\t\t\t{\n src: \"leave_these_alone/ui/gamescreen.js\",\n },\n\t\t\t{\n src: \"leave_these_alone/ui/helpscreen.js\",\n },\n\t\t\t{\n src: \"leave_these_alone/ui/mainmenu.js\",\n },\n\t\t\t{\n src: \"leave_these_alone/gameobjects/actor.js\",\n },\n\t\t\t{\n src: \"leave_these_alone/gameobjects/bullet.js\",\n },\n\t\t\t{\n src: \"leave_these_alone/gameobjects/enemy.js\",\n },\n\t\t\t{\n src: \"leave_these_alone/gameobjects/pickups.js\",\n },\n\t\t\t{\n src: \"leave_these_alone/effects/particle.js\",\n },\n\t\t\t{\n src: \"leave_these_alone/effects/effects.js\",\n },\n \n ];\n\n\t\t// Add user defined assets to the manifest\n\t\tmanifest = manifest.concat(mediaManifest);\n\n // Set the root filepath for our assets\n this.queue = new createjs.LoadQueue(true);\n \n // Use the following to use 'mp3' if 'ogg' doesn't work on browser\n createjs.Sound.alternateExtensions = [\"mp3\"];\n\n // Be sure to install the createjs sound plugin or your sounds won't play\n this.queue.installPlugin(createjs.Sound);\n \n // Set some callbacks\n this.queue.on(\"progress\", this.loadProgress, this);\n this.queue.on(\"fileload\", this.fileLoaded, this);\n this.queue.on(\"complete\", this.loadComplete, this);\n this.queue.loadManifest(manifest);\n }", "async findAllResources() {\n var t = this;\n var db = this.__db;\n if (!db.resources) {\n db.resources = {};\n }\n t.__librariesByResourceUri = {};\n this.__allResourceUris = null;\n this.__assets = {};\n\n await qx.Promise.all(\n t.__analyser.getLibraries().map(async library => {\n var resources = db.resources[library.getNamespace()];\n if (!resources) {\n db.resources[library.getNamespace()] = resources = {};\n }\n var unconfirmed = {};\n for (let relFile in resources) {\n unconfirmed[relFile] = true;\n }\n\n const scanResources = async resourcePath => {\n // If the root folder exists, scan it\n var rootDir = path.join(\n library.getRootDir(),\n library.get(resourcePath)\n );\n\n await qx.tool.utils.files.Utils.findAllFiles(\n rootDir,\n async filename => {\n var relFile = filename\n .substring(rootDir.length + 1)\n .replace(/\\\\/g, \"/\");\n var fileInfo = resources[relFile];\n delete unconfirmed[relFile];\n if (!fileInfo) {\n fileInfo = resources[relFile] = {};\n }\n fileInfo.resourcePath = resourcePath;\n fileInfo.mtime = await qx.tool.utils.files.Utils.safeStat(\n filename\n ).mtime;\n\n let asset = new qx.tool.compiler.resources.Asset(\n library,\n relFile,\n fileInfo\n );\n\n this.__addAsset(asset);\n }\n );\n };\n\n await scanResources(\"resourcePath\");\n await scanResources(\"themePath\");\n\n // Check the unconfirmed resources to make sure that they still exist;\n // delete from the database if they don't\n await qx.Promise.all(\n Object.keys(unconfirmed).map(async filename => {\n let fileInfo = resources[filename];\n if (!fileInfo) {\n delete resources[filename];\n } else {\n let stat = await qx.tool.utils.files.Utils.safeStat(filename);\n if (!stat) {\n delete resources[filename];\n }\n }\n })\n );\n })\n );\n\n await qx.tool.utils.Promisify.poolEachOf(\n Object.values(this.__assets),\n 10,\n async asset => {\n await asset.load();\n let fileInfo = asset.getFileInfo();\n if (fileInfo.meta) {\n for (var altPath in fileInfo.meta) {\n let lib = this.findLibraryForResource(altPath);\n if (!lib) {\n lib = asset.getLibrary();\n }\n let otherAsset =\n this.__assets[lib.getNamespace() + \":\" + altPath];\n if (otherAsset) {\n otherAsset.addMetaReferee(asset);\n asset.addMetaReferTo(otherAsset);\n } else {\n qx.tool.compiler.Console.warn(\n \"Cannot find asset \" + altPath + \" referenced in \" + asset\n );\n }\n }\n }\n if (fileInfo.dependsOn) {\n let dependsOn = [];\n fileInfo.dependsOn.forEach(str => {\n let otherAsset = this.__assets[str];\n if (!otherAsset) {\n qx.tool.compiler.Console.warn(\n \"Cannot find asset \" + str + \" depended on by \" + asset\n );\n } else {\n dependsOn.push(otherAsset);\n }\n });\n if (dependsOn.length) {\n asset.setDependsOn(dependsOn);\n }\n }\n return null;\n }\n );\n }", "function vxlAssetManager(){\r\n\tthis.firstLoadedModel = false; //analyze\r\n\tthis.toLoad = new Array(); //analyze\r\n\tthis.assets = [];\r\n\tvxl.go.notifier.addSource(vxl.events.MODELS_LOADED,this);\r\n}", "function getPrecachedAssets(depsIndex, project) {\n let precachedAssets = new Set(project.analyzer.allFragments);\n precachedAssets.add(project.entrypoint);\n for (let depImports of depsIndex.fragmentToFullDeps.values()) {\n depImports.imports.forEach((s) => precachedAssets.add(s));\n depImports.scripts.forEach((s) => precachedAssets.add(s));\n depImports.styles.forEach((s) => precachedAssets.add(s));\n }\n return Array.from(precachedAssets);\n}", "getTrustedAssets() {\n let image = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQIAAAECCAYAAAAVT9lQAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAACKFJREFUeNrs3T1yG8kZBuBe2YEz0pkzwJkzMHRG+ATUDaAbcG8A3YBHAJ3ZEbjZOiJ0AlAnIPYEoDJn9HRxYEEUqSWJv+n+nqeqi9JulQqYnnnZ/U1PT0oAAAAAAAAAAAAAAAAAAAAAAI/85BBUo9e0ftNOmnbc/rnf/r/Vf3uLRduyu6bdtH++Wfv7F4dfELB/g/biXrVhBz7TbC0YZm14/KarBAHbvfCHa+24kM9914bCKhw+6UpBwOuctRf9+7Uhfg1mbbtq2mfdDE//5r9o2rJp9wHabdMmbehBaEdNGzVtHuTif64t21AYOCWIpBfst/9rRwrnbUhCtQEwcbG/apTQc9ogALR7gUANNYCxC1kgENdZO991AW+/XaghUMI04NrFupcawrnTjS4aJXcC9t1y6LrtSGdqAVMX5UHb2GnIIQ3UAjo1OlBM5CBTARdg92oHp05N9uXCRWeqQOx6gMVB5aw7gJ2EwNwFVlSbJ2sOEAKaMEAIaMIAIaAJA4SAJgzYAncH6mxTpzYvZZ2AW4sEZ8VgjDZyqtvO/Dn52YEbhyGE/O6FYQq+tbogeLo4mEOg71CEcdOGQdhXt/3BOfCdfzXt7w5DKH9p2p+a9h+HAnUBLewTi6YGX/XaIeKxQxHWIj28VDbcFMHU4Kv8Lr6/OQyh5V8C/00BX9ZqRPB1SnDpMNDqp2CvdDcieLhL8Gt6KBbBKgj+HekLv9Pn6aO6AI/kV9GHKhxGnxrkAuHCec8TZk37hyCIYdqmfwQ37cl904bf4nfmwavfiMN2qLz6GUn+zp8SVcsneoSHavJr17b1yG0eQeU3C0V5LNtDSQHU+kqy/H6Fcdr98/aDFOMRbe9IMBoobi//Q2zfXft7Hm2JXnltoLZNNg694855qvOdj7culzr1KhsFdOl5+kGlYXDmsqnPpKIQ6OIbgGsMA0XDyhxVcpLOU7dfA15bGCxdOnUZJSMBBVmPKH8n2rMGl+lhE4pSlbSt1mqx0rCScycfexuXKBIqWr3RbSUjgrlLqA6lb01+Uehxr2mK4KUoFSj5N9Nt4SdhLQuOqq0TRHkMORfX+gV//g+p7O2zLis5j4YJ04J0uFWDNajhdmK1r0mLMiIoOcl/rqQPrir4DjawKVjJdwtqWtF2VkmdgEKVvIiotkdgBYGpgWnBK81SfTvpzir4DqeCQBDs02WFfeHFsoLgYPWBfoGfOy9n/WeF/bFwyQmCQzgp9HNfVdofNYwIjgWBIBAEm490nFOCQH3ghX6ptD8+JwSB9H6RmdMSQbA9R4XO5wSB/hEE5nKCAEEgCNxrRxBsVYnTgkUq+3FjBEHnDAsNAhAEwakPmLoJgi0rsUZwV/lFNKjgO3wRBGoEftvE6xNTA9iyoambINinUp8Z/1R5EJwkBAFGBEYEgoDYcqGw9BrBnSCAzXyo4DtUW8ytNQg8bNQ97wVBd/2x4iCYOck6I29l3i/8OyyS5d+wkRrefTituYPUCNi1fCt3WMH3mOlKeLuS30K93ga6Et5mXEkILHUlvM2gkhCo7R2UagTsTd4v8rKi73OlS+H1phWNBu7bYANeYVJZCEx0KbzOqLIQyO1Mt0LsELjVrRA7BHIb61qIWRNYXzugSAiBQ0CREF4g/6acVxwCufV0MzxvECAE1AbgB87auXPNIaA2AD8wrjwAVm2kq+HpesA0SAhc626IWQ9YnxIoEMIjowD1gPV2rsvhWxeBAqD6/QjhLfWA62AhcJvcJYBv6gG3wUJgmexFCGHrAR4xhkfOAwaA9QKwZiIEQAgIAQgqwpODQgCEgBAAIfD9LUIhAIFrAtYJQPAQyKMfDxFBK+I6gUmybBj+7yxgCHiKENb0Uqxlw/m7nup2+FakOwTXpgLwvXGgELDjMDzhNMXZR8CtQXhGhD0FpqYCEHdKYJUg/I7a7xJYIAQvUPPqwQvdCy8bDdQ6FbCdGAQeDZgKQPDRgGcFIPhowLMC8EpHqZ47BeoB8EajZAMRCK+GB4ssFYYN1FAknCdFQdjIhRAASp4WqAlA8GmBEOigdw5Bkd4X/Nl/btpnXQibmyYPD0F4JS4imus22J5BoaMBdQE1ArbopMDP/FFdALartPUDt7rMiAAjgo+6rPt+cgiKc1/QZ1007a+6zIiA7Sptxx6jAdiBkl5estRdRgTsRr+gz3qpuwQBgkAQCAJ25LiQz7lI1g0IAnamlFuHV7pKEMDMIRAEcOMQCAJiu2vabw6DIMBoAEEACAJAEACCABAEgCAABAEgCABBAAgCQBAA5bKLcVny24K6vjlJfujIpiQAAAAAAAAAAAAAAAAAAAAAAKWzQ1H9jpo2bNpJ+zO1f17f6Wi29vOm/fnFoYPyL/7zps2bdv/GNm//jSOHE8rSa9qkacsNAuBxW7b/Zs/hhe4bbzkAngqEscMM3TTYcArwlinDwGGH7hjteBTwo9HByOGHboTA/YGbMIDgISAMQAgIAziUwYFqAi9pCoiwJ/OOhkBut8niI9i5cYdDYNWsM4Ad6hUQAqtmBSLsyKSgIJjoLti+o4JCwKigUO8cgs774DMDXb5T8KM7CMCW9AoMAdMDUwO2bFjwZ3+v+wQBguBE9wkCtqPvs7MPNi/ttvxcwXGhn/2uaX/WhYKAzd07vzA1AAQBIAgAQUB6KLiBIAjupuDPPtN9goDtWBjNIAgwIkAQUPTFJAhgi/IjvR5DxogguCufGShxTwJ7EcAOTAsKgWvdBbsxKCgITnUX7E4JW5rbyhx2LG9rvuxwCCyTV57BXpx2OAjOdA/sTxffgeidhxC8XqAuAMHDQAhA8GnChcMP3ZGLdPu8m7BMCoPQSfm23T5WH06TW4TQefn24nXazbJhKwahMHlJ8mTDKcOy/TcEQABeQBFjlDBsWz89/yqyRdtmbfvk0AEAAAAAAAAAAAAAAAAAAAAABPY/AQYAy0Q5AZlICSYAAAAASUVORK5CYII=\";\n let site = 'Smartland.io';\n let tokenName = \"SLT\";\n let newArray = this.setFullList();\n\n let trustlines = this.props.trustlines.map(asset => (\n {\n code: asset.code,\n issuer: asset.issuer,\n //TODO get data from StellarTools AssetUid()\n value: AssetUid(asset),\n //TODO get data from Asset.js getAssetString()\n text: `${asset.code} | ${site} \\n ${asset.issuer}`,\n image: AssetComponent.setNewData(image)\n })).map(trustline => {\n newArray.forEach((newItem) => {\n let value = newItem.value.split(':');\n let text= newItem.text.split(' ');\n if (trustline.code === value[0] && trustline.issuer === value[1]) {\n trustline.text = text[0]+\" \"+text[1]+\" \"+text[2]+\" \"+text[3]+\" \"+text[4].substring(0,9)+\"...\"+text[4].substring(text[4].length-9,text[4].length);\n trustline.image = AssetComponent.setNewData(newItem.image);\n }\n });\n return trustline;\n });\n\n trustlines.filter(v=> {\n return v.issuer\n });\n\n let addNotTrustlines = newArray.filter(arrayItem=>{\n trustlines.forEach((trustline) => {\n let value = arrayItem.value.split(':');\n if (trustline.code === value[0] && trustline.issuer === value[1]) {\n arrayItem.filter = true\n }\n });\n if(arrayItem.filter ||arrayItem.value==='XLM:null'){\n return false;\n }else{\n return true;\n }\n\n });\n\n let toDelete = new Set(['XLM']);\n\n let newTrustlinesArray = trustlines.filter(obj => !toDelete.has(obj.code));\n newTrustlinesArray.unshift(newTrustlinesArray.splice(newTrustlinesArray.findIndex(elt => elt.code === 'SLT'), 1)[0]);\n this.base.trustLinesLength = addNotTrustlines.length;\n // this.getDropdownList(this.base.trustLinesLength);\n newTrustlinesArray.push(...addNotTrustlines);\n return newTrustlinesArray;\n\n // return trustlines.filter(v=> {\n // return v.issuer\n // })\n\n }", "function drawAssets(loadImageDataArray) {\n const assetBoard = document.getElementById('assetBoard');\n const keys = Object.keys(assetData);\n loadImageDataArray = []\n for(i = 0; i < keys.length; i++) { \n assetBoard.appendChild(cloneAssetCategory(keys[i]));\n let d1 = assetData[keys[i]];\n let d1Keys = Object.keys(d1); \n for(ii=0; ii < d1Keys.length; ii++) {\n document.getElementById(`ac_${keys[i]}`).appendChild(cloneAssetGroup(d1Keys[ii]));\n d1[d1Keys[ii]].forEach( function(ele) {\n document.getElementById(`ag_${d1Keys[ii]}`).appendChild(cloneAsset(ele));\n loadImageDataArray.push(`asset_${ele.name.split('.')[0]}`)\n })\n }\n }\n return loadImageDataArray \n }", "@memoizeForProp(\"contents\")\n get activeImports() {\n const { manifest } = this\n return this.imports //\n .filter((item) => item.active)\n .map((item) => manifest[item.path]?.file)\n }", "function loadResources(assets, whenLoaded) {\n document.fonts.load('30px AtariST').then(() => {\n let imgCounter = 0;\n let sfxCounter = 0;\n assets.IMGS.forEach(function(path){\n let img = document.createElement('img');\n img.src = path;\n let fileName = path.split(/[\\./]/).slice(-2, -1)[0];\n img.onload = function(){\n ctx.clearRect(15, 50, gameWindow.width, 30);\n ctx.fillText(\"Img \" + imgCounter + \"/\" + assets.IMGS.length, 15, 80);\n imgs[fileName] = img;\n imgCounter++;\n (assets.IMGS.length == imgCounter) && (assets.SFX.length == sfxCounter) ? whenLoaded() : console.log('suspenseful loading time...');\t\n };\n });\n assets.SFX.forEach(function(path){\n let sfx = document.createElement('audio');\n sfx.src = path;\n let fileName = path.split(/[\\./]/).slice(-2, -1)[0];\n sfx.onloadeddata = function() {\n ctx.clearRect(15, 100, gameWindow.width, gameWindow.height);\n ctx.fillText(\"Sfx \" + sfxCounter + \"/\" + assets.SFX.length, 15, 130);\n sfxs[fileName] = sfx;\n\t\t\t sfxCounter++;\n (assets.IMGS.length == imgCounter) && (assets.SFX.length == sfxCounter) ? whenLoaded() : console.log('suspenseful loading time...');\n };\n });\n });\n}", "loadAssets() {\n this.load.image('room2_one_lesson_BG', 'assets/one_lesson_BG.png');\n this.load.image('room2_character_north', 'assets/character_north.png');\n this.load.image('room2_character_east', 'assets/character_east.png');\n this.load.image('room2_character_south', 'assets/character_south.png');\n this.load.image('room2_character_west', 'assets/character_west.png');\n this.load.image('room2_activity1A', 'assets/Panels/RoomTwo/PanelOneA.png');\n\t// this.load.image('room2_activity1B', 'assets/Panels/RoomTwo/PanelOneB.png');\n\t// this.load.image('room2_activity1C', 'assets/Panels/RoomTwo/PanelOneC.png');\n\t// this.load.image('room2_activity1D', 'assets/Panels/RoomTwo/PanelOneD.png');\n this.load.image('room2_activity2A', 'assets/Panels/RoomTwo/PanelTwoA.png');\n this.load.image('room2_activity2B', 'assets/Panels/RoomTwo/PanelTwoB.png');\n\t// this.load.image('room2_activity2C', 'assets/Panels/RoomTwo/PanelTwoC.png');\n\t// this.load.image('room2_activity2D', 'assets/Panels/RoomTwo/PanelTwoD.png');\n this.load.image('room2_activity3A', 'assets/Panels/RoomTwo/PanelThreeA.png');\n this.load.image('room2_activity3B', 'assets/Panels/RoomTwo/PanelThreeB.png');\n this.load.image('room2_activity4A', 'assets/Panels/RoomTwo/PanelFourA.png');\n this.load.image('room2_activity4B', 'assets/Panels/RoomTwo/PanelFourB.png');\n\t// this.load.image('room2_activity4C', 'assets/Panels/RoomTwo/PanelFourC.png');\n\t// this.load.image('room2_activity4D', 'assets/Panels/RoomTwo/PanelFourD.png');\n\t// this.load.image('room2_activity4E', 'assets/Panels/RoomTwo/PanelFourE.png');\n this.load.image('room2_activity5A', 'assets/Panels/RoomTwo/PanelFiveA.png');\n this.load.image('room2_activity5B', 'assets/Panels/RoomTwo/PanelFiveB.png');\n\t// this.load.image('room2_activity5C', 'assets/Panels/RoomTwo/PanelFiveC.png');\n\t// this.load.image('room2_activity5D', 'assets/Panels/RoomTwo/PanelFiveD.png');\n\t// this.load.image('room2_activity5E', 'assets/Panels/RoomTwo/PanelFiveE.png');\n\t// this.load.image('room2_activity5F', 'assets/Panels/RoomTwo/PanelFiveF.png');\n this.load.image('room2_activity6A', 'assets/Panels/RoomTwo/PanelSixA.png');\n this.load.image('room2_activity6B', 'assets/Panels/RoomTwo/PanelSixB.png');\n this.load.image('room2_activity6C', 'assets/Panels/RoomTwo/PanelSixC.png');\n this.load.image('room2_activity6D', 'assets/Panels/RoomTwo/PanelSixD.png');\n this.load.image('room2_activity6E', 'assets/Panels/RoomTwo/PanelSixE.png');\n this.load.image('room2_E_KeyImg', 'assets/E_Key.png');\n this.load.image('room2_wall_info_1', 'assets/wall_art.png');\n this.load.image('room2_wall_info_2', 'assets/wall_art.png');\n this.load.image('room2_wall_info_3', 'assets/wall_art.png');\n this.load.image('room2_wall_info_4', 'assets/wall_art.png');\n this.load.image('room2_wall_info_5', 'assets/wall_art.png');\n this.load.image('room2_wall_info_6', 'assets/wall_art.png');\n this.load.image('room2_floor', 'assets/Room2/floor_1.jpg');\n this.load.image('room2_hole_activity', 'assets/Room2/crackedHole.png');\n this.load.image('room2_hole_nextRoom', 'assets/hole.png');\n this.load.image('room2_map', 'assets/featNotAvail.png');\n this.load.image('room2_notebook', 'assets/featNotAvail.png');\n this.load.image('room2_activityLocked', 'assets/activityLocked.png');\n this.load.image('room2_help_menu', 'assets/help_menu.png');\n this.load.image('rightArrow' , 'assets/rightArrowTest.png');\n\tthis.load.image('returnDoor', 'assets/dooropen_100x100.png');\n this.load.image('singleCoin', 'assets/Coin/singleCoin.png');\n this.load.image('profile','assets/character_south.png');\n }", "_read() {\n\n if (!this.headerSent) {\n perf(`bundling: BUNDLE_HEADER::${this.entryScriptIdentity}`);\n let proceed = this.push(BUNDLE_HEADER(this.entryScriptIdentity));\n this.headerSent = true;\n if (!proceed) {\n return;\n }\n }\n\n while (this.includeList.length) {\n\n let fileToProcess = this.includeList.shift();\n\n perf(`bundling: ${fileToProcess}`);\n\n //remove it to ensure we don't repeat files\n let fileContent = this.readFile(fileToProcess);\n let proceed = this.push(fileContent);\n if (!proceed) {\n return;\n }\n }\n\n perf(`bundling: BUNDLE_FOOTER::${this.entryScriptIdentity}`);\n this.push(BUNDLE_FOOTER(this.entryScriptIdentity));\n\n this.push(null);\n }", "function getAssetInfo(){\n\treturn {\n\t\t'position': {\"x\":-18,\"y\":-17,\"w\":37,\"h\":17},\n\t\t'thumb': \"iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM\\/rhtAAAAHElEQVR42u3BAQEAAACCIP+vbkhA\\nAQAAAAAAfBoZKAABfmfvpAAAAABJRU5ErkJggg==\",\n\t};\n}", "function refresh_asset_paths()\n{\n\t function walk(dir, done) {\n\t\tvar results = [];\n\t\ttry\n\t\t{\n\t\t\tvar list = fs.readdirSync(dir);\n\t\t\tvar i = 0;\n\n\t\t\t(function next() {\n\t\t\t var file = list[i++];\n\t\t\t if (!file) return done(null, results);\n\t\t\t file = dir + '/' + file;\n\t\t\t fs.stat(file, function(err, stat) {\n\t\t\t if (stat && stat.isDirectory()) {\n\t\t\t walk(file, function(err, res) {\n\t\t\t results = results.concat(res);\n\t\t\t next();\n\t\t\t });\n\t\t\t } else {\n\t\t\t results.push(file.replace('\\\\', '/').replace('static/', ''));\n\t\t\t next();\n\t\t\t }\n\t\t\t });\n\t\t\t})();\n\t\t}\n\t\tcatch(e)\n\t\t{\n\t\t\tconsole.error('Could not walk ' + dir + ' ' + e);\n\t\t}\n\t};\n\n\tasset_paths = [];\n\twalk('static/voxels', (err, paths) => { asset_paths = asset_paths.concat(paths); });\n\twalk('static/imgs', (err, paths) => { asset_paths = asset_paths.concat(paths); });\n\twalk('static/sounds', (err, paths) => { asset_paths = asset_paths.concat(paths); });\n\twalk('static/shaders', (err, paths) => { asset_paths = asset_paths.concat(paths); });\n\twalk('static/meshes', (err, paths) => { asset_paths = asset_paths.concat(paths); });\n}", "load(key) {\n this.assets[key].load();\n return this.assets[key];\n }", "function initOptions () {\n\n var uuids = settings.uuids;\n var rawAssets = settings.rawAssets;\n var assetTypes = settings.assetTypes;\n var realRawAssets = settings.rawAssets = {};\n for (var mount in rawAssets) {\n var entries = rawAssets[mount];\n var realEntries = realRawAssets[mount] = {};\n for (var id in entries) {\n var entry = entries[id];\n var type = entry[1];\n // retrieve minified raw asset\n if (typeof type === 'number') {\n entry[1] = assetTypes[type];\n }\n // retrieve uuid\n realEntries[uuids[id] || id] = entry;\n }\n }\n var scenes = settings.scenes;\n for (var i = 0; i < scenes.length; ++i) {\n var scene = scenes[i];\n if (typeof scene.uuid === 'number') {\n scene.uuid = uuids[scene.uuid];\n }\n }\n var packedAssets = settings.packedAssets;\n for (var packId in packedAssets) {\n var packedIds = packedAssets[packId];\n for (var j = 0; j < packedIds.length; ++j) {\n if (typeof packedIds[j] === 'number') {\n packedIds[j] = uuids[packedIds[j]];\n }\n }\n }\n var subpackages = settings.subpackages;\n for (var subId in subpackages) {\n var uuidArray = subpackages[subId].uuids;\n if (uuidArray) {\n for (var k = 0, l = uuidArray.length; k < l; k++) {\n if (typeof uuidArray[k] === 'number') {\n uuidArray[k] = uuids[uuidArray[k]];\n }\n }\n }\n }\n\n // asset library options\n const assetOptions = {\n libraryPath: 'res/import',\n rawAssetsBase: 'res/raw-',\n rawAssets: settings.rawAssets,\n packedAssets: settings.packedAssets,\n md5AssetsMap: settings.md5AssetsMap,\n subPackages: settings.subpackages\n };\n const options = {\n scenes: settings.scenes,\n debugMode: settings.debug ? 1 : 3, // cc.debug.DebugMode.INFO : cc.debug.DebugMode.ERROR,\n showFPS: !false && settings.debug,\n frameRate: 60,\n groupList: settings.groupList,\n collisionMatrix: settings.collisionMatrix,\n renderPipeline: settings.renderPipeline,\n adapter: prepare.findCanvas('GameCanvas'),\n assetOptions,\n customJointTextureLayouts: settings.customJointTextureLayouts || [],\n };\n return options;\n}", "function getBundledPrecachedAssets(project) {\n let precachedAssets = new Set(project.analyzer.allFragments);\n precachedAssets.add(project.entrypoint);\n precachedAssets.add(project.bundler.sharedBundleUrl);\n return Array.from(precachedAssets);\n}", "LoadAsset() {}", "parseAssets () {\n const { data : { assets, framework } } = this;\n\n if (framework.frameworkPath) {\n assets.forEach(asset => {\n if (asset.remote) {\n if (asset.code) {\n asset.code = asset.code.replace('{frameworkPath}', framework.frameworkPath);\n }\n\n if (asset.name) {\n asset.name = asset.name.replace('{frameworkPath}', framework.frameworkPath);\n }\n }\n });\n }\n\n assets.forEach(asset => {\n if (asset.remote) {\n if (/^http/i.test(asset.code)) {\n asset.name = asset.code;\n asset.code = '__remote__';\n }\n }\n });\n }", "get assetImporter() {}", "function preload() {\n for (var i = 0; i < assets.length; i++) {\n images[i] = loadImage('assets/' + assets[i]);\n }\n for (var i = 0; i < fish.length; i++) {\n fishimg[i] = loadImage('assets/' + fish[i] + '.png');\n }\n}", "function Asset(filename){\n return HtmlService.createTemplateFromFile(app.assets_dir+filename).evaluate().getContent();\n}", "function preload() {\n images[0] = loadImage('assets/up.png');\n images[1] = loadImage('assets/down.png');\n\n \n clickablesManager = new ClickableManager('data/clickableLayout.csv');\n content = new Content_Man('data/Content.csv');\n adventureManager = new AdventureManager(\"data/adventureStates.csv\", \"data/interactionTable.csv\");\n}", "function AssetController() {\n\n }", "function loadResources() {\n var images = [];\n images = images.concat(Player.getSprites());\n images = images.concat(Block.getSprites());\n images = images.concat(Gem.getSprites());\n\n images.push(Enemy.sprite);\n images.push(Heart.sprite);\n images.push(Star.sprite);\n images.push(Key.sprite);\n\n Resources.load(images);\n Resources.onReady(init);\n }", "function preload() {\n managers.Assets.init();\n managers.Assets.loader.addEventListener(\"complete\", init);\n}", "function preload() {\n managers.Assets.init();\n managers.Assets.loader.addEventListener(\"complete\", init);\n}", "function preload(){\n drain_img = loadImage(\"assets/drain.png\");\n bear_img = loadImage(\"assets/bear.png\");\n tiger_img = loadImage(\"assets/tiger.png\");\n mouse_img = loadImage(\"assets/mouse.png\");\n}", "set mainAsset(value) {}", "getAssetFiles(assets) {\n const files = _.uniq(Object.keys(assets).filter(assetType => assetType !== 'chunks' && assets[assetType])\n .reduce((files, assetType) => {\n if (['entryId', 'entryFile'].includes(assetType)) return files;\n let asset = assets[assetType];\n return files.concat(Array.isArray(asset) ? asset.map(v => v.file || '') : asset);\n }, []));\n files.sort();\n return files;\n }", "function preload() {\n tarotData = loadJSON(TAROT_DATA_URL);\n objectsData = loadJSON(OBJECT_DATA_URL);\n instrumentsData = loadJSON(INSTRUMENT_DATA_URL);\n colorsData = loadJSON(COLORS_DATA_URL);\n bomb = loadImage('assets/images/bomb.gif');\n // bomb_gif = createImg('assets/images/da-bomb.gif');\n}", "function loadAssets() {\n PIXI.loader\n .add([\n \"./assets/tileset10.png\",\n ])\n .load(gameCreate);\n}", "function preload () {\n loadAssets();\n enableCrispRendering();\n}", "function getAssetsPath() {\r\n return getBuildPath() + config.build.assetsPath;\r\n}", "@memoizeForProp(\"contents\")\n get files() {\n return Object.values(this.manifest).map((item) => item.file)\n }", "preload() {\n\n\t\t// Get our type based on the key in the manifest\n\t\tlet _type = Object.keys(this.manifest)[this.preloader.package_loaded];\n\n\t\t// Check to see if our total loaded is < our manifest\n\t\tif(this.preloader.package_loaded < Object.keys(this.manifest).length){\n\t\t\tthis.preloader.load(_type, this.manifest[_type]);\n\t\t} else {\n\t\t\tthis.trigger('assets_loaded');\n\t\t}\n\t}", "function preload() {\n images[0] = loadImage('assets/allday.png');\n images[1] = loadImage('assets/sleep.png');\n images[2] = loadImage('assets/eat.png');\n images[3] = loadImage('assets/goout.png');\n images[4] = loadImage('assets/splash.png');\n \n}", "function preload() {\n managers.Assets.init();\n //after assets loaded, invoke init function\n managers.Assets.loader.addEventListener(\"complete\", init);\n}", "function AddAssets()\n{\n\t//Add static background sprites\n\tbackColor = gfx.CreateRectangle(1, 1, 0xfffdad )\n\tgfx.AddGraphic( backColor, 0 , 0 )\n\tgfx.AddSprite( face, 0, 0.886, 1 )\n\tgfx.AddSprite( pasta, 0.85, 0.08, 0.1 )\n\tgfx.AddSprite( pastaIcon, 0.85, 0.08, 0.1 )\n\tgfx.AddSprite( paperIcon, 0.86, 0.15, 0.08 )\n \n //Add counters.\n\tgfx.AddText( pastaTxt, 0.8, 0.09 );\n\tgfx.AddText( paperTxt, 0.8, 0.15 );\n \n //Add scores\n\tgfx.AddText( score, 0.012, 0.01 );\n\tgfx.AddText( immune, 0.68, 0.02 );\n\tgfx.AddSprite( heart, 0.86, 0.02, 0.08 )\n\t\n\t//Add game objects to screen.\n\tAddHandSan()\n \n //Create a batch containers for our virus and drop sprites.\n //(gives higher performance for lots of same sprite/particle)\n batchVirus = gfx.CreateBatch()\n gfx.AddBatch( batchVirus )\n batchDrops = gfx.CreateBatch()\n gfx.AddBatch( batchDrops )\n \n //Hack to provide missing funcs in GameView.\n batchVirus.RemoveSprite = function( sprite ) { batchVirus.removeChild( sprite.sprite ); sprite.added = false; }\n batchDrops.RemoveSprite = function( sprite ) { batchDrops.removeChild( sprite.sprite ); sprite.added = false; }\n \n\t//Show splash screen.\n gfx.AddSprite( screens, 0, 0, 1,1 )\n \n \n //Start game.\n gfx.Play()\n \n\n\tscreens.PlayRange(2,8,0.08*animationSpeed,false)\n\tsetTimeout(function(){screens.Goto(0); ready=true},2500)\n}", "function preload() {\n wordHolder = loadJSON(\"words.json\");\n\n dream = loadImage(\"assets/cloud.jpg\");\n}", "function assets() {\n return gulp.src('packages/assets/**').pipe(gulp.dest('dist/assets/'))\n}", "loadResources(callback) {\n\t\tthis.manager = new RC.LoadingManager();\n\t\tthis.objLoader = new RC.ObjLoader(this.manager);\n\t\tthis.imageLoader = new RC.ImageLoader(this.manager);\n\n\t\tlet urls = [];\n\t\t/*for(var x = 1; x <= 14; x++) {\n\t\t\turls.push(\"data/models/mitos/mito_\"+x+\"_out.obj\");\n\t\t}*/\n\t\t// Mitochondrias\n\t\tfor(var x = 1; x <= 15; x++) {\n\t\t\turls.push(\"data/models/mito_new/structure_id_\"+x+\".obj\");\n\t\t}\n\t\t// Endolysosomes\n\t\tvar end = 'structure_id_405.obj,structure_id_334.obj,structure_id_336.obj,structure_id_333.obj,structure_id_535.obj,structure_id_395.obj,structure_id_502.obj,structure_id_375.obj,structure_id_390.obj,structure_id_660.obj,structure_id_703.obj,structure_id_623.obj,structure_id_359.obj,structure_id_608.obj,structure_id_618.obj,structure_id_595.obj,structure_id_552.obj'\n\t\tfor (var s of end.split(\",\")) {\n\t\t\turls.push(\"data/models/endolysosomes_new/\"+s)\n\t\t}\n\t\t// Fusiform Vesicles\n\t\tvar fv = 'structure_id_816.obj,structure_id_815.obj,structure_id_818.obj,structure_id_822.obj,structure_id_820.obj,structure_id_821.obj'\n\t\tfor (var s of fv.split(\",\")) {\n\t\t\turls.push(\"data/models/fusiform_vesicles_new/\"+s)\n\t\t}\n\n\t\tconst makeRepeated = (arr, repeats) =>\n\t\t\t[].concat(...Array.from({ length: repeats }, () => arr));\n\n\t\tlet augmented_dataset = makeRepeated(urls, 5)\n\n\t\tfunction shuffleArray(array) {\n\t\t\tfor (var i = array.length - 1; i > 0; i--) {\n\t\t\t\tvar j = Math.floor(Math.random() * (i + 1));\n\t\t\t\tvar temp = array[i];\n\t\t\t\tarray[i] = array[j];\n\t\t\t\tarray[j] = temp;\n\t\t\t}\n\t\t}\n\t\tshuffleArray(urls)\n\t\tshuffleArray(augmented_dataset)\n\n\t\tthis.augmented_three_d_model_count = augmented_dataset.length;\n\t\tthis.three_d_model_count = urls.length;\n\t\tthis.resources = [];\n\n\t\t/*for (let i = 0; i < urls.length; ++i) {\n\t\t\tthis.resources[i] = false;\n\t\t\tthis.objLoader.load(urls[i], (obj) => {\n\t\t\t\tthis.resources[i] = obj;\n\n\t\t\t});\n\t\t}*/\n\n\t\tfor (let i = 0; i < augmented_dataset.length; ++i) {\n\t\t\tthis.resources[i] = false;\n\t\t\tthis.objLoader.load(augmented_dataset[i], (obj) => {\n\t\t\t\tthis.resources[i] = obj;\n\n\t\t\t});\n\t\t}\n\n\t\tlet wait = (function() {\n\t\t\tif (this.resources.every((el) => { return el !== false; })) {\n\t\t\t\tthis.setupObjectsInHemiSphere();\n\t\t\t\tcallback();\n\t\t\t} else {\n\t\t\t\tsetTimeout(wait, 500);\n\t\t\t}\n\t\t}).bind(this);\n\t\twait();\n\t}", "@memoizeForProp(\"contents\")\n get imports() {\n if (!this.contents?.imports) return []\n return this.contents.imports.map(({ path, active, contents }) => {\n const location = SpellLocation.getFileLocation(this.projectId, path)\n const file = SpellProject.getFileForPath(location.path)\n if (contents !== undefined) file.setContents(contents)\n return {\n path: location.path,\n active,\n location,\n file\n }\n })\n }", "function preload() {\n //spritesheets\n playerSS = loadImage('assets/collector.png');\n playerJSON = loadJSON('assets/collector.json');\n trashSS = loadImage('assets/bottle.png');\n trashJSON = loadJSON('assets/bottle.json');\n}", "function assets() {\n var mask;\n var stream = require('merge-stream')();\n for (var subfolder in PATHS.assets) {\n mask = PATHS.assets[subfolder];\n stream.add(gulp.src(mask).pipe(gulp.dest(PATHS.dist + '/' + subfolder)));\n }\n return stream.isEmpty() ? null : stream;\n}", "function preload(){\n images[0] = loadImage('assets/house.png');\n images[1] = loadImage('assets/hallway.png');\n images[2] = loadImage('assets/livingroom.png');\n images[3] = loadImage('assets/diningroom.png');\n images[4] = loadImage('assets/kitchen.png');\n images[5] = loadImage('assets/bathroom.png');\n images[6] = loadImage('assets/bedroom.png');\n}", "function assetsLoaded()\n{\n APP.isAssetsLoaded = true;\n // once we finished preloading \n console.log(\"Loaded assets.\");\n\n if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent))\n USING_PHONE = true;\n\n HUD.onAssetsLoaded();\n\n //CAMERA.setTargetPosition(50 * 256, 50 * 256);\n CAMERA.setPosition(50 * -256 + (window.innerWidth / 2), 50 * -256 - (window.innerHeight / 2));\n\n CAMERA.interruptedCameraPathing = true;\n\n ticker.maxFPS = 144;\n // render loop\n ticker.add((delta) => \n {\n\n APP.elapsedTime += ticker.elapsedMS;\n\n CAMERA.update();\n HUD.update();\n \n devContainer.visible = DEVELOPER_MODE;\n \n renderer.render(stage);\n })\n\n ConnectToBackend();\n ticker.start();\n \n document.body.appendChild(APP.view);\n}", "function preload() {\n costumeObjectArray[0] = new CostumeObject(780, 300, 100, 70, \"assets/lips.png\");\n costumeObjectArray[1] = new CostumeObject(780, 150, 150, 43, \"assets/moustache.png\");\n costumeObjectArray[2] = new CostumeObject(780, 400, 200, 139, \"assets/beard.png\");\n costumeObjectArray[3] = new CostumeObject(780, 10, 200, 100, \"assets/glasses.png\");\n costumeObjectArray[4] = new CostumeObject(5, 170, 325, 449, \"assets/hair.png\");\n costumeObjectArray[5] = new CostumeObject(25, 5, 210, 167, \"assets/hat.png\"); \n// loading the buttons \n imgReset = loadImage(\"assets/buttonReset.png\");\n imgSave = loadImage(\"assets/buttonSave.png\");\n imgFilters = loadImage(\"assets/buttonFilters.png\"); \n imgStage = loadImage(\"assets/backgroundStage.png\")\n}", "function injectingassets() {\n\n\n var injectSrc = gulp.src(\n [\n './assets/javascripts/vendor/jquery*.js',\n './assets/javascripts/govuk/selection-buttons.js',\n './assets/javascripts/vendor/polyfills/bind.js',\n './assets/javascripts/vendor/details.polyfill.js',\n './assets/javascripts/main.js'\n ], {\n read: false\n });\n\n var options = {\n bowerJson: require('../bower.json'),\n ignorePath: '..'\n };\n\n return gulp.src('./views/**/*.hbs')\n .pipe(wiredep(options))\n .pipe(inject(injectSrc))\n .pipe(gulp.dest('./views'));\n}", "function preload(){\n for (let i = 0; i < NUM_ANIMAL_IMAGES; i++){\n let animalImage = loadImage(`assets/images/animal${i}.png`); //${_} allows for a variables to be used in call, must be ``(one with ~)\n animalImages.push(animalImage);\n }\n //load other images\n sausageDogImage = loadImage(\"assets/images/sausage-dog.png\");\n bark = loadSound(\"assets/sounds/bark.wav\");\n titleImage = loadImage(\"assets/images/title.png\");\n}", "function preload(){\n for (let i = 0; i < NUM_ANIMAL_IMG; i++){\n let animalImage = loadImage(`assets/images/animal${i}.png`);\n animalImages.push(animalImage);\n }\n\n sausageDogImg = loadImage(`assets/images/sausage-dog.png`);\n sausageDogBark = loadSound(`assets/sounds/bark.wav`);\n}", "function getAssets(list, assetType) {\n debug('getAssets', list.length, 'items');\n const {defAttr, defObj, errorMessage} = ASSET_INFO[assetType];\n\n function getCorrectedList(item) {\n var filePath = item[defAttr];\n var isModule = item.type === 'module';\n var tempDefAttr = defAttr;\n\n if (isModule ) {\n if (ABS_PATH_RE.test(filePath)) {\n throw new TypeError('Modules must not use an absolute path: '+filePath);\n }\n else {\n filePath = path.join('/'+moduleRoot, filePath);\n if (moduleRoot !== 'mjs') {\n // Tell system to use `require` instead of `import`\n delete item.type;\n delete item[defAttr];\n tempDefAttr = 'require';\n usingRequire = true;\n }\n }\n }\n else if (EXTERNAL_PATH_RE.test(filePath)) {\n return [item];\n }\n\n debug('getAssets.rootFolder', filePath);\n var mmOptions = {nodupes: true};\n if (item.ignore) {\n mmOptions.ignore = item.ignore;\n // TODO: Should we delete `item.ignore`?\n }\n\n // Convert a globby list into a real list of existing assets\n const filtered = micromatch(listOfAssets, filePath, mmOptions);\n\n // Make sure that all items are of the correct object type\n return filtered.map(fileName => Object.assign({}, item, {[tempDefAttr]:fileName}));\n }\n\n return list.reduce((acc,assetItem) => {\n var item = assetItem;\n if (typeof item === 'string') {\n item = {[defAttr]:item};\n }\n else if (!item[defAttr]) {\n throw new TypeError(errorMessage+'\\n'+JSON.stringify(item));\n }\n\n if (defObj) {\n item = Object.assign({}, defObj, item);\n }\n\n // Create a valid path for these resources including globs\n var newObjs = getCorrectedList(item);\n\n // Deduplicate\n newObjs = newObjs.reduce((objList, obj) => {\n const name = obj[defAttr];\n if (!Object.keys(assetList).includes(name)) {\n objList.push(obj);\n assetList[name] = obj;\n }\n else {\n debug('Duplicate asset requested. Previous request will be used:', JSON.stringify(assetList[name]));\n }\n\n return objList;\n }, []);\n\n return acc.concat(newObjs);\n }, []);\n }", "constructor() {\n super();\n this.trackedAssets = new Map();\n this.totalTransferredBytes = 0;\n }", "preload() {\n this.load.image('background', 'assets/images/background.png');\n this.load.image('glow', 'assets/images/glow.png');\n this.load.image('bomb', 'assets/images/bomb.png');\n this.load.image('pauseButton', 'assets/images/pause_button.png');\n this.load.image('pauseButtonHover', 'assets/images/pause_button_hover.png');\n this.load.image('buttonBg', 'assets/images/button_bg.png');\n this.load.image('buttonBgHover', 'assets/images/button_bg_hover.png');\n\n this.load.image('fullscreenBut', 'assets/images/fullscreen_but.png');\n this.load.image('fullscreenButHover', 'assets/images/fullscreen_but_hover.png');\n\n this.load.image('border', 'assets/images/border.png');\n\n gameConfig.fruits.forEach(fruit => {\n this.load.image(fruit, 'assets/images/fruits/' + fruit + '.png');\n this.load.image(fruit + FRUIT_CUT_SUFFIX, 'assets/images/fruits/' + fruit + FRUIT_CUT_SUFFIX + '.png');\n });\n\n this.load.audio('music', 'assets/audio/music.ogg');\n this.load.audio('sliceSound', 'assets/audio/slice.ogg');\n this.load.audio('explosionSound', 'assets/audio/explosion.ogg');\n this.load.audio('fruitLostSound', 'assets/audio/fruitLost.ogg');\n this.load.audio('buttonClickSound', 'assets/audio/buttonClick.ogg');\n }", "function loadAssets(event)\r\n{\r\n\tfor (var i = 0; i < buttons.length; i++)\r\n\t{\r\n\t\tvar tempBtn = new Image();\r\n\t\ttempBtn.src = buttons[i].img;\r\n\t\ttempBtn.addEventListener(\"load\", onAssetLoad);\r\n\t\tbuttons[i].img = tempBtn; // .img used to hold the path string, now it holds the actual image object.\r\n\t\tvar tempBtnO = new Image();\r\n\t\ttempBtnO.src = buttons[i].imgO;\r\n\t\ttempBtnO.addEventListener(\"load\", onAssetLoad);\r\n\t\tbuttons[i].imgO = tempBtnO;\r\n\t}\r\n}", "function setExtraAssetsTop(){if(screenSize===\"large\"||screenSize===\"x-large\"){var e=$(\"#extra-assets\"),t=$(\"#top_assets\");e.length>0&&t.length>0&&e.css(\"margin-top\",t.outerHeight()+\"px\")}}", "function preload() {\n\n QRCode = loadImage(\"assets/qr-code.png\");\n logo = loadImage(\"assets/logo.svg\");\n soundtrack = loadSound(\"assets/soundtrack.mp3\");\n\n}", "constructor() {\n this._ah = new igcext.AssetHandler();\n this._id_gen = 0;\n this._objectIdentitiesToIds = {};\n }", "function getAssets(p, platform) {\n return getAllElements(p, platform, 'asset');\n}", "function preload() {\n\n\n //LoadSounds();\n //LoadAssets();\n \n\n}", "function generateAssets() {\r\n\r\n\r\n loadJSON('json/assets.json', function (text) {\r\n\r\n var allItems = JSON.parse(text);\r\n\t\tvar arrID = [];\r\n var arrLand = [];\r\n var arr2013 = [];\r\n var arr2014 = [];\r\n var arr2015 = [];\r\n var arr2016 = [];\r\n\t\tvar arr2017 = [];\r\n \r\n\r\n\r\n var arrLength = allItems.assetList.length;\r\n\r\n for (var i = 0; i < allItems.assetList.length; i++) {\r\n\r\n var singleAsset = allItems.assetList[i];\r\n var AssetID = singleAsset.ID;\r\n\t\t var AssetLand = singleAsset.Land;\r\n var Asset2013 = singleAsset.j2013;\r\n var Asset2014 = singleAsset.j2014;\r\n var Asset2015 = singleAsset.j2015;\r\n var Asset2016 = singleAsset.j2016;\r\n var Asset2017 = singleAsset.j2017;\r\n \r\n \r\n\t \t\tarrID.push(AssetID);\r\n arrLand.push(AssetLand);\r\n arr2013.push(Asset2013);\r\n arr2014.push(Asset2014);\r\n arr2015.push(Asset2015);\r\n arr2016.push(Asset2016);\r\n arr2017.push(Asset2017);\r\n\r\n }\r\n\t\t\t\t\t\r\n\t\t for (var i = 1; i < allItems.assetList.length; i++) {\r\n\r\n\t\t\t mouseLand(arrID, arrID[i], arrLand[i], arr2013[i], arr2014[i], arr2015[i], arr2016[i], arr2017[i]);\r\n\t\t\t \r\n\t\t\t }\r\n\r\n svgButtons (arrID, arrLand, arr2013, arr2014, arr2015, arr2016, arr2017);\r\n\r\n });\r\n\r\n}", "async function loadAssets() {\n\tconsole.log(\"Loading assets...\");\n\tawait Promise.all([\n\t\tutils.load('./static/shaders/vertex.glsl').then(text => vs = text),\n\t\tutils.load('./static/shaders/fragment.glsl').then(text => fs = text),\n\t\tutils.load('./static/assets/objects/drone_no_prop.obj').then( text => droneObj = text),\n\t\tutils.load('./static/assets/objects/prop.obj').then( text => dronePropObj = text),\n\t\tutils.load('./static/assets/objects/terrain_scaled.obj').then( text => terrainObj = text),\n\t\tutils.load('./static/assets/objects/skyBox.obj').then( text => skyBoxObj = text),\n\t\tutils.load('./static/assets/objects/cottage_obj.obj').then( text => cottageObj = text),\n\t\tutils.load('./static/assets/objects/tree.obj').then( text => treeObj = text),\n\t\tutils.load('./static/assets/objects/world.obj').then( text => worldObj = text),\n\t]);\n\tconsole.log(\"Done.\")\n}", "cacheItems() {\n this.items = getDirectChildren(this.slider);\n }", "function get_assets(name, extension = 'js')\n\t{\n\t\tlet chunk = json.assetsByChunkName[name]\n\n\t\t// a chunk could be a string or an array, so make sure it is an array\n\t\tif (!(Array.isArray(chunk)))\n\t\t{\n\t\t\tchunk = [chunk]\n\t\t}\n\n\t\treturn chunk\n\t\t\t// filter by extension\n\t\t\t.filter(name => path.extname(extract_path(name)) === `.${extension}`)\n\t\t\t// adjust the real path (can be http, filesystem)\n\t\t\t.map(name => options.assets_base_url + name)\n\t}" ]
[ "0.63874334", "0.6268631", "0.62115675", "0.61566925", "0.6150884", "0.59513843", "0.59396005", "0.59266645", "0.5908541", "0.59050435", "0.58907056", "0.5887752", "0.58661747", "0.58569646", "0.57613844", "0.5746067", "0.5719985", "0.5717615", "0.5712064", "0.5703589", "0.56935793", "0.5684956", "0.56389743", "0.5636621", "0.5598615", "0.5598004", "0.5565817", "0.55534995", "0.5546244", "0.5521582", "0.5519142", "0.55175805", "0.5512881", "0.5512721", "0.5511687", "0.54994047", "0.54981744", "0.5471419", "0.5471419", "0.5461167", "0.5457456", "0.54296046", "0.54103917", "0.5410046", "0.54037476", "0.5398266", "0.5390894", "0.538849", "0.53842574", "0.5374037", "0.53558266", "0.53506625", "0.53478456", "0.5346434", "0.5333612", "0.5313462", "0.53109217", "0.53078765", "0.5285195", "0.5267522", "0.52421016", "0.5237921", "0.52343863", "0.52343863", "0.52331424", "0.52288496", "0.52280545", "0.52217275", "0.5219197", "0.52185243", "0.52075535", "0.5207219", "0.52037585", "0.52011615", "0.51964486", "0.51697105", "0.5164015", "0.51600796", "0.5155292", "0.51533103", "0.5149175", "0.5144529", "0.514073", "0.5135957", "0.5131045", "0.5118023", "0.5111721", "0.5110384", "0.51019055", "0.5099894", "0.50992143", "0.5098422", "0.509179", "0.50910604", "0.50904644", "0.50893325", "0.50871754", "0.5084888", "0.5082112", "0.5080451", "0.50781655" ]
0.0
-1
Prisma ==> Node ==> Client (GrapfQL Playground)
subscribe(parent, { postId }, { prisma }, info) { // Se recomienda que los atributos que devuelve Prisma en la suscripción coincidadn con los del backend con los clientes // return prisma.subscription.comment({ where: { node: { post: { id: postId } } } }, info) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function main() {\n\n // // Create a new user with a new post\n // const newUser = await prisma\n // .createUser({\n // name: \"Chris\",\n // email: \"chris@prisma.io\",\n // trips: {\n // create: [{\n // country: \"US\",\n // }, {\n // country: \"Italy\",\n // }]\n // },\n // })\n // console.log(`Created new user: ${newUser.name} (ID: ${newUser.id})`)\n\n // Read all users from the database and print them to the console\n const allUsers = await prisma.users()\n console.log('users: ', allUsers)\n \n // List all trips from DB\n const allTrips = await prisma.trips()\n console.log('trips: ', allTrips)\n\n // Read the previously created user from the database and print their posts to the console\n const tripsByUser = await prisma\n .user({ email: \"chris@prisma.io\" })\n .trips()\n console.log(`All trips by that user: ${JSON.stringify(tripsByUser)}`)\n}", "async function main() {\n\n // Create a new user with a new post\n const newUser = await prisma\n .createUser({\n name: \"Bob\",\n email: \"bob@prisma.io\",\n posts: {\n create: [{\n title: \"Join us for GraphQL Conf in 2019\",\n comments: {\n create: [{bodyText: 'I loved the conference!'}, {bodyText: 'I love graphQl!'}]\n }\n }, {\n title: \"Subscribe to GraphQL Weekly for GraphQL news\",\n }]\n },\n })\n console.log(`Created new user: ${newUser.name} (ID: ${newUser.id})`)\n\n // Read all users from the database and print them to the console\n const allUsers = await prisma.users()\n console.log(allUsers)\n\n const allPosts = await prisma.posts()\n console.log(allPosts)\n}", "function createServer() {\n return new GraphQLServer({\n typeDefs: 'src/schema.graphql',\n resolvers: {\n Mutation,\n Query,\n Date: new GraphQLScalarType({ // https://www.apollographql.com/docs/apollo-server/features/scalars-enums.html#custom-scalars\n name: 'Date',\n description: 'Date custom scalar type',\n parseValue(value) {\n return new Date(value); // value from the client\n },\n serialize(value) {\n return new Date(value).getTime(); // value sent to the client\n },\n parseLiteral(ast) {\n if (ast.kind === Kind.INT) {\n return parseInt(ast.value, 10); // ast value is always in string format\n }\n return null;\n },\n }),\n User: {\n posts: parent => prisma.user({ id: parent.id }).posts(),\n following: parent => prisma.user({ id: parent.id }).following(),\n followers: parent => prisma.user({ id: parent.id }).followers(),\n likes: parent => prisma.user({ id: parent.id }).likes(),\n comments: parent => prisma.user({ id: parent.id }).comments()\n },\n Post: {\n author: parent => prisma.post({ id: parent.id }).author(),\n likes: parent => prisma.post({ id: parent.id }).likes(),\n comments: parent => prisma.post({ id: parent.id }).comments(),\n content: parent => prisma.post({ id: parent.id }).content()\n },\n Like: {\n user: parent => prisma.like({ id: parent.id }).user(),\n post: parent => prisma.like({ id: parent.id }).post()\n },\n Comment: {\n writtenBy: parent => prisma.comment({ id: parent.id }).writtenBy()\n }\n },\n resolverValidationOptions: {\n requireResolversForResolveType: false\n },\n context: req => ({ ...req, prisma})\n });\n}", "async function main() {\n const newLink = await prisma.link.create({\n data: {\n description: \"Fullstack tutorial for GraphQL\",\n url: \"www.howtographql.com\",\n },\n });\n const allLinks = await prisma.link.findMany();\n console.log(allLinks);\n}", "async function main() {\n // Retrieve all published posts\n const allPosts = await photon.posts.findMany({\n where: { published: true },\n })\n console.log(`Retrieved all published posts: `, allPosts)\n\n // Create a new post (written by an already existing user with email alice@prisma.io)\n const newPost = await photon.posts.create({\n data: {\n title: 'Join the Prisma Slack community',\n content: 'http://slack.prisma.io',\n published: false,\n // author: {\n // connect: {\n // email: 'alice@prisma.io', // Should have been created during initial seeding\n // },\n // },\n },\n })\n console.log(`Created a new post: `, newPost)\n\n // Publish the new post\n const updatedPost = await photon.posts.update({\n where: {\n id: newPost.id,\n },\n data: {\n published: true,\n },\n })\n console.log(`Published the newly created post: `, updatedPost)\n\n // Retrieve all posts by user with email alice@prisma.io\n // TODO: Bring this back after nested connect works with required relations\n // const postsByUser = await photon.users\n // .findOne({\n // email: 'alice@prisma.io',\n // })\n // .posts()\n // console.log(`Retrieved all posts from a specific user: `, postsByUser)\n}", "async function main() {\n\tconst endpoint = process.env.ENDPOINT;\n\tif(!endpoint || endpoint.indexOf(\"your-wordpress-blog.orlocalhost\") !== -1){\n\t\tconsole.log(\"please set ENDPOINT environment variable to your graphql endpoint, aborting\")\n\t\treturn;\n\t}\n\tconst introspectionQuery = getIntrospectionQuery();\n\tconst response = await fetch(endpoint, {\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t},\n\t\tbody: JSON.stringify({ query: introspectionQuery }),\n\t});\n\tconst { data } = await response.json();\n\tconst schema = buildClientSchema(data);\n\tconst outputFile = \"./wpgraphql-schema.gql\";\n\tfs.writeFileSync(outputFile, printSchema(schema));\n}", "async function main() {\n\n prisma.order.create() // this is not defined\n prisma.serviceCategory.create() //this is not defined\n prisma.service.create() // this is not defined\n prisma.user.create()//this is defined\n prisma.location.create()//this has a geography field and is defined\n\n}", "query() { }", "async function main() {\n const introspectionQuery = getIntrospectionQuery();\n const response = await fetch('https://instaparade.com/graphql', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({ query: introspectionQuery }),\n });\n const { data } = await response.json();\n const schema = buildClientSchema(data);\n const outputFile = './wpgraphql-schema.gql';\n fs.writeFileSync(outputFile, printSchema(schema));\n}", "async function graphQLFetcher( { graphQLParams, schemaPath } ) {\n // console.log( graphQLParams )\n const url = `${config.baseUrl}${schemaPath}`\n\n const data = await fetch( url, {\n method: \"post\",\n headers: {\n Accept: 'application/json',\n \"Content-Type\": \"application/json\"\n },\n credentials: 'same-origin',\n body: JSON.stringify( graphQLParams )\n } )\n const res = await data.json().catch( () => data.text() )\n // try {\n // const schema = buildClientSchema( res.data )\n // console.log( validateSchema( schema ) )\n // } catch ( e ) {\n // console.log( e )\n // }\n // console.log( res )\n return res\n}", "async function start() {\n // 2. Call express() to create an Express application\n const app = express()\n app.use('/img/photos', express.static(join(__dirname, 'assets', 'photos')))\n const dbClient = await MongoClient.connect(dbUrl, {useNewUrlParser: true, useUnifiedTopology: true})\n const db = dbClient.db()\n const pubsub = new PubSub()\n const server = new ApolloServer({\n typeDefs,\n resolvers,\n validationRules: [\n depthLimit(5),\n createComplexityLimitRule(1000, { onCost: cost => console.log(`Query Cost = ${cost}`) }),\n ],\n context: async ({req, connection}) => {\n const githubToken = req ? req.headers.authorization : connection.context.Authorization\n const currentUser = await db.collection('users').findOne({githubToken})\n return { db, currentUser, pubsub }\n },\n })\n // 3. Call `applyMiddleware()` to allow middleware mounted on the same path\n server.applyMiddleware({ app })\n // 4. Create a home route ('/'), a GraphQL endpoint ('/graphql'), a playground route ('/playground)\n app.get('/', (req, res) => res.end('Welcome to the PhotoShare API'))\n app.get('/playground', expressPlayground({endpoint: '/graphql'}))\n // 5. Create an HttpServer using the express app instance\n const httpServer = createServer(app)\n // 6. Enable subscription support at ws://localhost:<PORT>/graphql\n server.installSubscriptionHandlers(httpServer)\n httpServer.timeout = 5000;\n // 6. Listen on a specific port\n httpServer.listen(4000, ()=>console.log(`GraphQL Server running @ http://localhost:4000${server.graphqlPath}`))\n}", "function graphQLFetcher(graphQLParams) {\n return fetch(window.location.origin + '/graphql', {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(graphQLParams),\n }).then(response => response.json());\n}", "async query(query) {\n\n }", "async function main() {\n\n // Create the user\n const newUser = await prisma.user.create({\n data: {},\n })\n\n // Create a Category\n const newCategory = await prisma.category.create({\n data: {},\n })\n\n // Create a post\n const newPost = await prisma.post.create({\n data: {\n // ✅\n // author: {\n // connect: {\n // id: newUser.id\n // }\n // },\n // 🛑\n authorId: newUser.id,\n categories: {\n connect: {\n id: newCategory.id\n }\n },\n },\n })\n\n}", "run(){\n let [q, ...args] = this._getQuery();\n return this.client._query(q, args, {emitter: this}).then(data => {\n this.emit('data', data);\n return data;\n });\n }", "constructor(options = {}) {Prisma.prototype.__init.call(this);\n\t if (isValidPrismaClient(options.client)) {\n\t this._client = options.client;\n\t } else {\n\t (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&\n\t logger.warn(\n\t `Unsupported Prisma client provided to PrismaIntegration. Provided client: ${JSON.stringify(options.client)}`,\n\t );\n\t }\n\t }", "function createServer() {\n return new GraphQLServer({\n typeDefs: \"src/schema.graphql\",\n resolvers: {\n Mutation: Mutation,\n Query: Query,\n Issue: Issue,\n Project: Project,\n User: User,\n Comment: Comment,\n Log: Log,\n File,\n },\n resolverValidationOptions: {\n requireResolversForResolveType: false,\n },\n context: (req) => ({ ...req, prisma }),\n });\n}", "async function creatApolloClient() {\n let schema = await simpleClient\n .request(query)\n .then(x => x)\n const myFragmentMatcher = await new IntrospectionFragmentMatcher({introspectionQueryResultData: schema})\n const networkInterface = await createNetworkInterface({\n uri: 'https://api.github.com/graphql',\n opts: {\n headers: {\n // https://help.github.com/articles/creating-a-personal-access-token-for-the-com\n // mand-line/\n \"Authorization\": `Bearer ${process.env.REACT_APP_TOKEN}`\n }\n }\n });\n const client = await new ApolloClient({networkInterface, fragmentMatcher: myFragmentMatcher});\n return await class App extends Component {\n render() {\n return (\n <ApolloProvider client={client}>\n <div>\n <Header/>\n <Body/>\n </div>\n </ApolloProvider>\n )\n }\n }\n}", "getFatQuery() {\r\n // CreateLinkPayload type that was defined for us on the server by Relay.Mutation helper we used.\r\n return Relay.QL`\r\n fragment on CreateLinkPayload {\r\n linkEdge,\r\n store { linkConnection }\r\n }\r\n `;\r\n\r\n\r\n // Return an array of configuration\r\n // Mutator configuration are basically insturctions on how to use the response payload\r\n // for each mutation to update the client-side store\r\n //\r\n // rangeBehaviors object is a map between a certain state for our connection and the operation that we want relay to do for that state.\r\n getConfigs() {\r\n return [{\r\n type: 'RANGE_ADD',\r\n parentName: 'store',\r\n parentID: this.props.store.id,\r\n connectionName: 'linkConnection',\r\n edgeName: 'linkEdge',\r\n rangeBehaviors:{\r\n // Append the new the new edge\r\n // Preend to add as the first item in the list\r\n '':'prepend',\r\n },\r\n }]\r\n }\r\n\r\n //relay supports \"optimistic updates\". give the user immediate feedback about the\r\n // operation they just did. then handle the response when it's official from the server\r\n getOptimisticResponse(){\r\n // this function returns will be used immediately after. by getConfig's behavior we defined\r\n return {\r\n // in this case we want to insert the link immediately. so we'll just make a copy of it here\r\n // the node can use the props from the input directly. aka what the user entered\r\n linkEdge: {\r\n node: {\r\n title: this.props.title,\r\n url: this.props.url,\r\n\r\n }\r\n }\r\n }\r\n }\r\n}", "constructor(options = {}) {Prisma.prototype.__init.call(this);\n if (isValidPrismaClient(options.client)) {\n this._client = options.client;\n } else {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&\n logger.warn(\n `Unsupported Prisma client provided to PrismaIntegration. Provided client: ${JSON.stringify(options.client)}`,\n );\n }\n }", "constructor() {\n super();\n this.query = gql`\n query Poblados($term: String!) {\n poblados(search: $term) {\n results {\n id\n nombre @capitalize\n municipio {\n id\n nombre @capitalize\n }\n }\n }\n }\n `;\n }", "constructor(options = {}) {;Prisma.prototype.__init.call(this);\n if (isValidPrismaClient(options.client)) {\n this._client = options.client;\n } else {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&\n utils.logger.warn(\n `Unsupported Prisma client provided to PrismaIntegration. Provided client: ${JSON.stringify(options.client)}`,\n );\n }\n }", "getFatQuery() {\n return Relay.QL`\n fragment on UpdateLinkPayload {\n link \n store { linkConnection }\n }\n `\n }", "getFatQuery() {\n return Relay.QL`\n fragment on AddLinkPayload {\n link,\n store { linkConnection }\n }\n `\n }", "function addGraphQLServer(app) {\n const schema = makeExecutableSchema({\n typeDefs,\n resolvers\n });\n\n const server = new ApolloServer({ schema });\n server.applyMiddleware({ app });\n\n}", "function graphql(args) {\n const {\n schema,\n source,\n rootValue,\n contextValue,\n variableValues,\n operationName,\n fieldResolver,\n typeResolver,\n } = args;\n // Validate Schema\n const schemaValidationErrors = validateSchema(schema);\n if (schemaValidationErrors.length > 0) {\n return { errors: schemaValidationErrors };\n }\n // Parse\n let document;\n try {\n document = parse(source);\n } catch (syntaxError) {\n return { errors: [syntaxError] };\n }\n // Validate\n const validationErrors = validate(schema, document);\n if (validationErrors.length > 0) {\n return { errors: validationErrors };\n }\n // Execute\n return execute({\n schema,\n document,\n rootValue,\n contextValue,\n variableValues,\n operationName,\n fieldResolver,\n typeResolver,\n });\n}", "function graphQLFetcher (params) {\n return fetch(window.location.origin + \"{{graphqlFetchURL}}\", {{graphqlFetchOpts}})\n .then(function (response) {\n if (response.status >= 200 && response.status < 300)\n statusLine(\"success\", \"GraphQL request succeeded\")\n else\n statusLine(\"error\", \"GraphQL request failed\")\n return response.text()\n }).then(function (responseBody) {\n try {\n return JSON.parse(responseBody)\n } catch (error) {\n return responseBody\n }\n })\n }", "runQuery() {\n this.props.client\n .query({\n query: getSelectedCountry,\n variables: { id: 1 }\n })\n .then(data => {\n console.log(data);\n });\n\n // this.props.client.mutate({})\n }", "function main() {\n var client = new protoDefinition.NeoTv('localhost:50051',\n grpc.credentials.createInsecure());\n\n \n app.get('/', (req, res) => res.send('Hello World!'))\n app.get('/neotv', (req, res) => {\n const data = req.query;\n return client.GetNeoTvStatus({username: data.username, password: data.password, carrier: data.carrier}, (err, status) => {\n res.send(status);\n })\n })\n\n app.listen(port, () => console.log(`Example app listening on port ${port}!`))\n app.use(bodyParser.json());\n}", "function submitCustomQuery() { \r\n\tvar q = $(\"#query\").val();\r\n\t\r\n\tProvenance().cypherQuery({\r\n\t\tquery : q,\r\n\t\tsuccess: function(provGraph) {\r\n\t\t\tvar html = \"<p><strong>Results:</strong></p><ul>\";\r\n\t\t\t\r\n\t\t\tprovGraph.nodes(function (n) { \r\n\t\t\t\thtml = html + \"<li>\" + n.name + \"</li>\";\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\thtml = html + \"</ul>\";\r\n\t\t\t\r\n\t\t\t$(\"#customQueryResults\").html(html);\r\n\t\t},\r\n\t\terror: function(jqXHR, textStatus, errorThrown) {\t\t\t\r\n\t\t\t$(\"#customQueryResults\").html(\r\n\t\t\t\t\t\"Error executing custom query: <pre>\" +\r\n\t\t\t\t\tjqXHR.responseText + \"</pre>\"\r\n\t\t\t);\r\n\t\t} \r\n\t});\r\n}", "function runQuery() {\n const WOQL = TerminusDB.WOQL\n\n const query = WOQL.or(\n WOQL.triple('v:Person', 'knows', 'v:OtherPerson'),\n WOQL.triple('v:OtherPerson', 'knows', 'v:Person'),\n )\n\n return client.query(query)\n}", "async function main() {\n await prisma.rider.createMany({\n data: [\n { firstName: 'Gino', lastName: 'Bartali', nationality: 'ITA'}, // 1\n { firstName: 'Jean', lastName: 'Robic', nationality: 'FRA'}, // 2\n { firstName: 'Pierre', lastName: 'Brambilla', nationality: 'ITA'}, // 1947 KOM | DONE 30\n { firstName: 'Fausto', lastName: 'Coppi', nationality: 'ITA'}, // 1949 & 1952 GC && 1949 & 1952 KOM | DONE 31\n { firstName: 'Ferdinand', lastName: 'Kübler', nationality: 'SWI'}, // 1950 GC && 1954 SPRINT | DONE 32\n { firstName: 'Hugo', lastName: 'Koblet', nationality: 'SWI'}, // 1951 GC | DONE DONE 33\n { firstName: 'Raphaël', lastName: 'Géminiani', nationality: 'FRA'}, // 1951 KOM | DONE 34\n { firstName: 'Louison', lastName: 'Bobet', nationality: 'FRA'}, // 1953, 1954 & 1955 GC && 1950 KOM | DONE 35\n { firstName: 'Jesùs', lastName: 'Loroño', nationality: 'ESP'}, // 1953 KOM | DONE 36\n { firstName: 'Fritz', lastName: 'Schär', nationality: 'SWI'}, // 1953 SPRINT | DONE 37\n { firstName: 'Stan', lastName: 'Ockers', nationality: 'BEL'}, // 1955 & 1956 SPRINT | DONE 38\n { firstName: 'Roger', lastName: 'Walkowiak', nationality: 'FRA'}, // 1956 GC | DONE 39\n { firstName: 'Jacques', lastName: 'Anquetil', nationality: 'FRA'}, // 1957, 1961, 1962, 1963, 1964 GC | DONE 40\n { firstName: 'Jean', lastName: 'Forestier', nationality: 'FRA'}, // 1957 SPRINT | DONE 41\n { firstName: 'Charly', lastName: 'Gaul', nationality: 'LUX'}, // 1958 GC && 1955 & 1956 KOM | DONE 42\n { firstName: 'Jean', lastName: 'Graczyk', nationality: 'FRA'}, // 1958 & 1960 SPRINT | DONE 43\n { firstName: 'Federico', lastName: 'Bahamontes', nationality: 'ESP'}, // 1959 GC && 1954, 1958, 1959, 1962, 1963 & 1964 KOM | DONE 44\n { firstName: 'André', lastName: 'Darrigade', nationality: 'FRA'}, // 1959 & 1961 SPRINT | DONE 45\n { firstName: 'Gastone', lastName:'Nencini', nationality: 'ITA'}, // 1960 GC && 1957 KOM | DONE 46\n { firstName: 'Imerio', lastName: 'Massignan', nationality: 'ITA'}, // 1960 & 1961 KOM | DONE 47\n { firstName: 'Rudi', lastName: 'Altig', nationality: 'GER'}, // 1962 SPRINT | DONE 48\n { firstName: 'Rik', lastName: 'Van Looy', nationality: 'BEL'}, // 1963 SPRINT | DONE 49\n ]\n })\n}", "function authedGraphqlRequest({ keystone, query, variables }) {\n return keystone.executeGraphQL({ query, variables });\n}", "posts(parent, args, { prisma }, info) {\n // if (!args.query) {\n // return db.posts\n // }\n\n // return db.posts.filter((post) => {\n // const isTitleMatch = post.title.toLowerCase().includes(args.query.toLowerCase())\n // const isBodyMatch = post.body.toLowerCase().includes(args.query.toLowerCase())\n // return isTitleMatch || isBodyMatch\n // })\n \n //set up object for operation arguments \n const opArgs = {}\n //if query is provided, modify object to return only posts that have string in title or body\n if (args.query){\n opArgs.where = {\n OR:[{\n title_contains: args.query\n },{\n body_contains: args.query\n }\n ]\n }\n\n }\n return prisma.query.posts(opArgs, info)\n\n }", "function graphqlHandler(options) {\n if (!options) {\n throw new Error('Apollo Server requires options.');\n }\n if (arguments.length > 1) {\n throw new Error(`Apollo Server expects exactly one argument, got ${arguments.length}`);\n }\n return async (req, res) => {\n var _a, _b, _c, _d, _e;\n try {\n if (req.method !== 'GET' && req.method !== 'POST') {\n return utils_1.sendError(res, http_errors_1.default(400, 'Only GET and POST requests allowed'));\n }\n const query = req.method === 'POST' ? await parse_body_1.parseBody(req) : parse_body_1.parseQuery(req);\n if (Either_1.isLeft(query)) {\n return utils_1.sendError(res, query.left);\n }\n const { graphqlResponse, responseInit } = await apollo_server_core_1.runHttpQuery([req, res], {\n method: (_a = req.method) !== null && _a !== void 0 ? _a : 'GET',\n options,\n query: query.right,\n request: apollo_server_core_1.convertNodeHttpToRequest(req),\n });\n setHeaders(res, (_b = responseInit.headers) !== null && _b !== void 0 ? _b : {});\n utils_1.sendJSON(res, 200, 'Success', {}, JSON.parse(graphqlResponse));\n }\n catch (error) {\n if ('HttpQueryError' !== error.name) {\n throw error;\n }\n const e = error;\n res.statusCode = (_c = e.statusCode) !== null && _c !== void 0 ? _c : 500;\n res.statusMessage = e.name;\n if (e.isGraphQLError) {\n utils_1.sendJSON(res, res.statusCode, res.statusMessage, (_d = e.headers) !== null && _d !== void 0 ? _d : {}, JSON.parse(e.message));\n }\n else {\n utils_1.sendJSON(res, res.statusCode, res.statusMessage, (_e = e.headers) !== null && _e !== void 0 ? _e : {}, { message: e.message });\n }\n }\n };\n}", "async function startServer(){\n // inicializamos el server\n const app = express()\n //inicializamos apollo-server\n const apolloServer = new ApolloServer({\n //incluimos el esquema.\n typeDefs,\n resolvers,\n });\n \n //despues de la construccion del esquema el servidor apollo queda en espera\n await apolloServer.start();\n\n apolloServer.applyMiddleware({ app: app });\n\n app.use((req, res) => {\n res.send('Hola desde apollo server');\n })\n\n app.listen(4000, () => console.log('corriendo en el puerto 4000'));\n\n}", "function getClient() {\n return new Client({\n host: 'my_postgres_container',\n user: 'admin',\n password: 'admin',\n database: 'hgop'\n });\n}", "function fetchQuery(\n\t\toperation,\n\t\tvariables,\n\t\tcacheConfig,\n\t\tuploadables,\n\t) {\n\t\treturn fetch('http://localhost:5000/graphql', {\n\t\t\tmethod: 'POST',\n\t\t\theaders: {\n\t\t\t\t// Add authentication and other headers here\n\t\t\t\t'content-type': 'application/json'\n\t\t\t},\n\t\t\tbody: JSON.stringify({\n\t\t\t\tquery: operation.text, // GraphQL text from input\n\t\t\t\tvariables,\n\t\t\t}),\n\t\t}).then(response => {\n\t\t\treturn response.json();\n\t\t});\n\t}", "handleGraphqlRequestsWithPlayground({ req, res, }) {\n const middlewareOptions = Object.assign({ endpoint: this.graphqlPath, subscriptionEndpoint: this.subscriptionsPath }, this.playgroundOptions);\n res.setHeader('Content-Type', 'text/html; charset=utf-8');\n res.statusCode = 200;\n res.statusMessage = 'Success';\n utils_1.sendResponse(res, 'text/html', graphql_playground_html_1.renderPlaygroundPage(middlewareOptions));\n }", "function Query(port) {\n let http = require('http');\n\n //We need a function which handles requests and send response\n function handleRequest(request, response){\n let param = request.url.split(\"/\");\n let action = param[param.length - 1];\n if(action == \"serverInfo\") {\n let server_config = JSON.parse(g_server.config);\n let server_info = GetServer();\n\n let data = {\n name: server_info.serverName,\n maxPlayers: server_info.maxPlayers,\n serverMode: server_config.mode,\n serverMap: server_config.map,\n playersOnline: g_players.length\n };\n return response.end(JSON.stringify(data));\n return response.end(msg);\n }\n else if(action == \"playersList\") {\n let players = [];\n let msg = \"\";\n for(let p of g_players) {\n players.push({id: p.client.networkId, name: p.name});\n }\n return response.end(JSON.stringify(players));\n return response.end(msg);\n }\n return response.end(\"/serverInfo - Server info\\n/playerList - List of players\");\n }\n\n let server = http.createServer(handleRequest);\n server.listen(port, function(){\n console.log(\"Server listening on: http://localhost:%s\", port);\n });\n}", "function main () {\n console.log(\"Registering Events...\");\n gm.events.register();\n\n console.log(\"Server started!\");\n Query(8080); //You can change your port\n\n // ---- This is for check database connection ----- //\n\n /*let testdb = gm.utility.dbConnect();\n\n testdb.connect(function(err) {\n if(err) {\n console.log(\"Error connecting to the database ... \");\n throw err;\n } else {\n console.log('Database connected!')\n }\n });\n\n testdb.end();*/\n}", "getGqlClient() {\n if (isEmpty(this.state.gqlClient)) {\n const gqlClient = new ApolloClient({\n link: new BatchHttpLink({ uri: serverLoc + \"/gql\", credentials: 'include' }),\n cache: new InMemoryCache(),\n onError: (e) => { console.log(\"Apollo Client Error:\", e) }\n })\n this.setState({ gqlClient: gqlClient })\n return gqlClient\n }\n else { return this.state.gqlClient }\n }", "getFatQuery() {\n return Relay.QL`\n fragment on UpdatePostPayload @relay(pattern: true) {\n post {\n id\n title \n published_at\n tags\n items {\n id\n text {\n id\n description\n }\n image {\n id\n caption\n }\n twitter {\n id\n twitter_id\n }\n }\n } \n }\n `\n }", "async function startServer() {\n logger.info(\"Initializing server\");\n const app = express();\n const corsOptions = {\n methods: [\"GET\", \"PUT\", \"POST\"],\n credentials: false,\n preflightContinue: false,\n maxAge: 86400,\n origin: [\n /^https?:\\/\\/admin\\.chingu\\.io\\/?[\\s]?$/,\n /^https?:\\/\\/localhost(?:\\:[0-9]{1,4})?\\/?[\\s]?$/\n ],\n };\n app.use(cors(corsOptions));\n app.use(morgan());\n\n logger.info(\"Initializing database client\");\n const sequelize = await initializeDatabase();\n\n logger.info(\"Initializing Apollo Server\");\n const apollo = new ApolloServer({\n typeDefs,\n resolvers,\n schemaDirectives,\n introspection: true,\n playground: true,\n dataSources: initializeDataSources,\n context: async ({ req }) => ({\n token: req.headers.authorization,\n logger,\n }),\n formatError: err => {\n const userErrors = [\n \"UNAUTHENTICATED\",\n \"UNAUTHORIZED\",\n \"FORBIDDEN\",\n \"BAD_USER_INPUT\",\n \"INTERNAL_SERVER_ERROR\",\n ];\n if (!err.extensions || !userErrors.includes(err.extensions.code)) {\n logger.error(err);\n\n // Mask errors in production\n if (NODE_ENV === \"production\") {\n return new ApolloError(\n \"An error occurred. Please try again later.\",\n \"INTERNAL_SERVER_ERROR\",\n );\n }\n }\n\n return err;\n },\n // Exposed on /.well-known/apollo/server-health\n onHealthCheck: () =>\n new Promise((resolve, reject) => {\n sequelize\n .authenticate()\n .then(resolve)\n .catch(reject);\n }),\n });\n apollo.applyMiddleware({ app, path: \"/graphql\", cors: corsOptions });\n\n const server = http.createServer(app);\n server.listen({ port: PORT }, () => {\n logger.info(`Server ready on :${PORT}/graphql`);\n });\n}", "async generateQuery() {\n return await this.dagObj.generateQuery();\n }", "get DATABASE_URL() {\r\n const domain = `https://mws-pwa.appspot.com`;\r\n // const domain = 'http://localhost:'\r\n const port = 1337; // Change this to your server port\r\n // const origin = `${domain}${port}`;\r\n const origin = `${domain}`\r\n return {\r\n restaurants: `${origin}/restaurants/`, // GET: All restaurants, or 1 with ID\r\n restaurantsFavorites: `${origin}/restaurants/?is_favorite=true`, // GET: All favorited restaurants\r\n restaurantReviews: `${origin}/reviews/?restaurant_id=`, // GET: All reviews by restaurant ID\r\n reviews: `${origin}/reviews/`, // GET: All reviews, or 1 with ID\r\n faveRestaurant: id => `${origin}/restaurants/${id}/?is_favorite=true`, // PUT: Favorite a restaurant by ID\r\n unfaveRestaurant: id => `${origin}/restaurants/${id}/?is_favorite=false`, // PUT: Unfavorite a restaurant by ID\r\n editReview: id => `${origin}/reviews/${id}` // PUT = update, DELETE = delete review\r\n };\r\n }", "async function example_query_get_one_species(queryResolver) {\n\n const query = {\n get: {\n species: { // Query for \"species\" entity.\n args: {\n name: \"Hutt\", // Gets the one species that matches this name.\n },\n },\n },\n };\n\n const result = await miniql(query, queryResolver, {}); // Invokes MiniQL.\n console.log(JSON.stringify(result, null, 4)); // Displays the query result.\n}", "async function graphQlOperations() {\n await generateGraphQlOperations()\n}", "async function startApolloServer() {\n const app = express();\n const httpServer = createServer(app);\n const graphqlPath = \"/\";\n\n const schema = makeExecutableSchema({\n typeDefs: readFileSync(join(__dirname, \"schema.graphql\"), \"utf8\"),\n resolvers,\n });\n\n const subscriptionServer = SubscriptionServer.create(\n {\n schema,\n execute,\n subscribe,\n },\n {\n server: httpServer,\n path: graphqlPath,\n }\n );\n\n const apolloServer = new ApolloServer({\n schema,\n context: ({ req }) => {\n return {\n req,\n };\n },\n plugins: [\n {\n async serverWillStart() {\n return {\n async drainServer() {\n subscriptionServer.close();\n },\n };\n },\n },\n ],\n });\n\n await apolloServer.start();\n\n apolloServer.applyMiddleware({\n app,\n path: graphqlPath,\n });\n\n const port = 4000;\n await new Promise((resolve) => httpServer.listen({ port }, resolve));\n console.log(\n `Server is running on http://localhost:${port}${apolloServer.graphqlPath}`\n );\n}", "static get DATABASE_URL_REVIEWS() {\n const port = 1337 // Change this to your server port\n return `http://localhost:${port}/reviews`;\n }", "async gqlClient({ commit, state }, useAuth) {\n return new GraphQLClient(\n GQL_ENDPOINT,\n useAuth && state.token\n ? { headers: { authorization: `Bearer ${state.token}` } }\n : {}\n );\n }", "function fetchQuery(operation, variables/* , cacheConfig, uploadables*/) {\n // Caching and relay records merge here\n // console.log(operation, variables);\n // console.log(store._recordSource._records);\n const { token } = hasValidJwtToken()\n const authorization = token ? `Bearer ${token}` : ''\n return fetch('/graphql', {\n method: 'POST',\n credentials: 'same-origin',\n headers: {\n authorization,\n Accept: 'application/json',\n 'Content-Type': 'application/json'\n }, // Add authentication and other headers here\n body: JSON.stringify({\n query: operation.text, // GraphQL text from input\n variables\n })\n }).then(response => response.json())\n}", "static get DATABASE_URL () {\r\n const port = 1337; // Change this to your server port\r\n return `http://localhost:${port}/api`;\r\n }", "function fetchQuery(operation, variables) {\n // eslint-disable-next-line\n return fetch('http://localhost:5000/graphql', {\n method: 'POST',\n headers: {\n // Add authentication and other headers here\n 'content-type': 'application/json',\n },\n body: JSON.stringify({\n query: operation.text, // GraphQL text from input\n variables,\n }),\n }).then(response => response.json());\n}", "function pgQuery(qString, callback){\n var username = process.env.USER;\n var password = username + '123';\n\n\t// Example URL string: 'pg://control_tower:password@localhost:5432/control_tower'\n var defaultUrl = 'pg://' + username + \":\" + password + \"@localhost:5432/\" + username;\n\tconst pool = new pg.Pool(defaultUrl);\n\tvar connectionString = process.env.DATABASE_URL || defaultUrl;\n\n\tpool.connect(function(err, client, done) {\n\t if(err) {\n\t return console.error('error fetching client from pool', err);\n\t } client.query(qString, function(err, result) {\n\t //call `done()` to release the client back to the pool\n\t done();\n\t if(err) {\n\t return console.error('error running query', err);\n\t }\n callback(result)\n client.end();\n\t });\n });\n}", "function storefront(){\n connection.query(\n \"SELECT * FROM products;\",\n function(error, results){\n if(error) throw error;\n //using the console table package to display the items\n console.table(results);\n select();\n }\n )\n}", "function getApplicationQuery(id){\n\n const REV_QUERY = gql`\n {\n applicationById(id: \"${id}\") {\n applicant {\n id\n name\n }\n professor {\n id\n name\n }\n dateSubmitted\n areasOfResearch\n resumeDocumentId\n diplomaDocumentId\n auditDocumentId\n reviews {\n id\n title\n dateSubmitted\n ranking\n body\n }\n }\n }\n\n `;\n\n return REV_QUERY;\n}", "function graphql() {\n require('fbjs/lib/invariant')(false, 'graphql: Unexpected invocation at runtime. Either the Babel transform ' + 'was not set up, or it failed to identify this call site. Make sure it ' + 'is being used verbatim as `graphql`.');\n}", "async function postgresDbConnector(fastify, options) {\n\n const decoratorName = options.decoratorName || \"database\";\n const requestDecorator = options.requestDecoratorName || \"dbClient\";\n\n const logger = fastify.log.child({ plugin: decoratorName });\n\n const pool = new pg.Pool({\n // @ts-ignore\n Client: pg.Client,\n // @ts-ignore\n client: pg.Client,\n connectionString: options.url,\n connectionTimeoutMillis: options.connectionTimeout || 5000,\n\n ssl: {\n require: true,\n rejectUnauthorized: false,\n },\n\n keepAlive: options.keepAlive !== undefined ? options.keepAlive : true,\n max: options.maxConnections || 20,\n\n application_name: options.appName || \"fastify-postgres\"\n });\n\n pool.on(\"error\", (err) => {\n logger.error(\"Unexpected error on idle client:\", { error: err.message });\n });\n\n logger.info(\"Connecting to database\");\n let client = null;\n try {\n client = await pool.connect();\n } catch (err) {\n logger.error(\"Failed to connect:\", { error: err });\n process.exit(-1);\n return;\n }\n await client.release();\n\n const database = new Database(fastify, { logger, pool, requestDecorator, timeoutMs: options.timeoutMs });\n database.registerHooks();\n fastify.decorate(decoratorName, database);\n}", "function fetchQuery(operation, variables, cacheConfig, uploadables) {\n return fetch(process.env.NEXT_PUBLIC_RELAY_ENDPOINT, {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n }, // Add authentication and other headers here\n body: JSON.stringify({\n query: operation.text, // GraphQL text from input\n variables,\n }),\n }).then((response) => response.json())\n}", "function connectPostgres(params) {\n return new Promise((resolve) => {\n client = new Client(params)\n client.connect()\n resolve(client)\n })\n}", "async getClient() {\n return this._pgpool.connect();\n }", "constructor() {\n super();\n\n this.reloadable = true;\n this.runlevel = 1;\n this.name = 'graphql';\n this.henri = null;\n\n this.typesList = [];\n this.resolversList = [];\n\n this.types = null;\n this.resolvers = null;\n this.schema = null;\n this.endpoint = '/_henri/gql';\n this.active = false;\n\n this.graphqlServer = null;\n\n this.init = this.init.bind(this);\n this.extract = this.extract.bind(this);\n this.merge = this.merge.bind(this);\n this.run = this.run.bind(this);\n this.reload = this.reload.bind(this);\n\n this.ApolloError = ApolloError;\n this.toApolloError = toApolloError;\n this.SyntaxError = SyntaxError;\n this.ValidationError = ValidationError;\n this.AuthenticationError = AuthenticationError;\n this.ForbiddenError = ForbiddenError;\n this.UserInputError = UserInputError;\n }", "_buildQueryHelper(defaultContext) {\n /**\n * An executable function for running a query\n *\n * @param queryString String A graphQL query string\n * @param options.skipAccessControl Boolean By default access control _of\n * the user making the initial request_ is still tested. Disable all\n * Access Control checks with this flag\n * @param options.variables Object The variables passed to the graphql\n * query for the given queryString.\n * @param options.context Object Overrides to the default context used when\n * making a query. Useful for setting the `schemaName` for example.\n *\n * @return Promise<Object> The graphql query response\n */\n return (\n queryString,\n { skipAccessControl = false, variables, context = {}, operationName } = {}\n ) => {\n let passThroughContext = {\n ...defaultContext,\n ...context,\n };\n\n if (skipAccessControl) {\n passThroughContext.getCustomAccessControlForUser = () => true;\n passThroughContext.getListAccessControlForUser = () => true;\n passThroughContext.getFieldAccessControlForUser = () => true;\n }\n\n const graphQLQuery = this._graphQLQuery[passThroughContext.schemaName];\n\n if (!graphQLQuery) {\n return Promise.reject(\n new Error(\n `No executable schema named '${passThroughContext.schemaName}' is available. Have you setup '@keystonejs/app-graphql'?`\n )\n );\n }\n\n return graphQLQuery(queryString, passThroughContext, variables, operationName);\n };\n }", "async function main() {\n\n\tawait prisma.vote.deleteMany();\n\tawait prisma.candidate.deleteMany();\n\n\tconst candidateData = [\n\t\t{ name: \"John Doe\" },\n\t\t{ name: \"Steve Jobs\" },\n\t\t{ name: \"Alan Turing\" },\n\t];\n\n\tfor (const candidate of candidateData) {\n\t\tconst maxVotes = 10000;\n\t\tconst minVotes = 1;\n\t\tconst votesCount = Math.floor(Math.random() * maxVotes + minVotes);\n\t\tconst votes = [...Array(votesCount).keys()].map( i => ({}));\n\t\tconst item = await prisma.candidate.create({\n\t\t\tdata: {\n name: candidate.name,\n }\n\t\t});\n\t\tawait prisma.candidate.update({\n\t\t\twhere: {\n\t\t\t\tid: item.id,\n\t\t\t},\n\t\t\tdata: {\n\t\t\t\tvotes: {\n\t\t\t\t\tcreate: votes,\n\t\t\t\t},\n\t\t\t},\n\t\t});\n\t}\n}", "function localInterface(context) {\n return _apolloLocalQuery2.default.createLocalInterface(graphql, _config2.default.graphQLSchema, {\n // Attach the request's context, which certain GraphQL queries might\n // need for accessing cookies, auth headers, etc.\n context\n });\n }", "getArgoServerNS() {\n return client.query({ query: Query.argoServerNS })\n }", "function test_candu_graphs_datastore_vsphere6() {}", "query( ...args ) {\n return this._queryStream( ...args )\n .flatten()\n .map( ( result ) => {\n // These objects are not alterable, so we create a copy using JSON so downstream processes\n // can manipulate them if necessary.\n var object = JSON.parse( JSON.stringify( result.node.data ) );\n return object;\n });\n }", "async function example_query_get_all_species(queryResolver) {\n\n const query = {\n get: {\n species: { // Query for \"species\" entity.\n // No arguments gets all entities.\n },\n },\n };\n\n const result = await miniql(query, queryResolver, {}); // Invokes MiniQL.\n console.log(JSON.stringify(result, null, 4)); // Displays the query result.\n}", "async createQuery(queryContents) {\n let language = await this.getLanguage();\n return language.query(queryContents);\n }", "async handleGraphqlRequestsWithServer({ req, res, }) {\n const handler = graphqlHandler(() => {\n return this.createGraphQLServerOptions(req, res);\n });\n await handler(req, res);\n }", "async execute(msg, client, CONFIG, npm, mmbr) {\n ////////////////////////////////////\n //We fetch the channel here\n //We can easely send with this const\n ////////////////////////////////////\n const snd = await client.channels.cache.get(msg.channel_id);\n\n ////////////////////////////////////\n //Defining the arguments here\n //Splits can happen later if needed\n ////////////////////////////////////\n const prefix = await CONFIG.PREFIX(msg.guild_id);\n const comName = module.exports.name;\n const arguments = await msg.content.slice(\n prefix.length + comName.length + 1\n );\n\n ////////////////////////////////////\n //Main command starts here\n //Comments might get smaller here\n ////////////////////////////////////\n request(\n `https://store.steampowered.com/api/storesearch/?term=${arguments}&l=english&cc=US&currency=1`,\n {\n json: true,\n },\n async (err, res, body) => {\n //if something went wrong\n if (err) return snd.send(\"An error occured!\");\n\n //redefine the first entry\n let found = body.items[0];\n\n //if err\n if (!found) return snd.send(\"Game not found!\");\n\n //Define stuff\n let gameName = found.name;\n let gameId = found.id;\n let gameThumb = found.tiny_image;\n let gameScore = found.metascore;\n let gameLinux = found.platforms.linux;\n\n //next request\n request(\n `https://www.protondb.com/api/v1/reports/summaries/${gameId}.json`,\n {\n json: true,\n },\n (err, res, body) => {\n //if something went wrong\n if (err) return snd.send(\"An error occured!\");\n\n //Embed to send\n const embed = new Discord.MessageEmbed()\n .setTitle(`${gameName} (${gameScore})`)\n .setURL(\"https://www.protondb.com/app/\" + gameId)\n .setThumbnail(gameThumb)\n .setDescription(\"Native: \" + gameLinux)\n .addField(\"Rating confidence: \", body.confidence)\n .addField(\"Tier: \", body.tier)\n .addField(\"Trending Tier: \", body.trendingTier)\n .addField(\"Best rating given\", body.bestReportedTier)\n .addField(\n \"Steam Link\",\n \"https://store.steampowered.com/app/\" + gameId\n )\n .addField(\n \"ProtonDB Link: \",\n \"https://www.protondb.com/app/\" + gameId\n )\n .setImage(gameThumb)\n .setColor(\"#RANDOM\");\n\n if (found.price) {\n if (found.price.final) {\n let price = found.price.final.toString();\n let len = price.length;\n let x =\n \"$\" + price.slice(0, len - 2) + \",\" + price.slice(len - 2);\n embed.addField(\"Price: \", x);\n }\n }\n\n snd.send({\n embed: embed,\n });\n }\n );\n }\n );\n }", "function Posts() {\n return knex('post');\n}", "static get DATABASE_URL() {\n const port = 1337 // Change this to your server port\n return `http://localhost:${port}/restaurants`;\n }", "static get DATABASE_URL() {\n const port = 1337 // Change this to your server port\n return `http://localhost:${port}/restaurants`;\n }", "static get DATABASE_URL() {\r\n const port = 8081 // Change this to your server port\r\n // return `http://localhost:${port}/data/restaurants.json`;\r\n return `http://localhost:1337/restaurants`;\r\n }", "static get DATABASE_URL() {\n const port = 1337 // Change this to your server port\n return `http://localhost:${port}/`;\n }", "function CustomQuery() {\n\n}", "function TQueries() {}", "function TQueries() {}", "function TQueries() {}", "function database(query) {\n var result = \"\";\n const {\n Client\n } = require('pg');\n\n const client = new Client({\n connectionString: \"postgres://xbmqawcfcgjhll:4296b0167991fbbcf2a98369e07b8f3db38bb0147ff6cf27143b39b2347a9c59@ec2-54-204-46-236.compute-1.amazonaws.com:5432/dd54f2u0f74q9c\",\n ssl: true,\n });\n\n client.connect();\n\n console.log(query);\n\n client.query(query, (err, res) => {\n if (err) throw err;\n\n for (let row of res.rows) {\n result = JSON.stringify(row);\n console.log(JSON.stringify(row));\n }\n client.end();\n });\n\n return result;\n}", "cars(parent, args, { prisma }, info) {\n \n const opArgs = {\n skip: args.skip,\n first: args.first,\n orderBy: args.orderBy,\n after: args.after, \n };\n \n if(args.query){\n opArgs.where = {\n OR: [\n {\n color: args.query.color\n },\n {\n plateNumber: args.query.plateNumber\n },\n {\n passengers: args.query.passengers\n },\n {\n make_contains: args.query.make\n },\n {\n description_contains: args.query.description\n }\n ]\n }\n }\n \n return prisma.query.cars(opArgs, info); \n }", "async findByGoal(goalID){ \n let data = await schema.find({associatedGoal: goalID}) \n return data;\n }", "async function database(req, res, next) {\n if (!client.isConnected()) await client.connect();\n req.dbClient = client;\n req.db = client.db(\"database\"); //The name of our database is called database so that is what we are connecting to\n return next();\n}", "async function mostrarPokemons() {\n\n const result = await databaseConnection('pokemons')\n\n return result\n}", "function createServer() {\n\treturn new ApolloServer({\n\t\ttypeDefs,\n\t\tresolvers: {\n\t\t\tMutation,\n\t\t\tQuery,\n\t\t\tSubscription,\n\t\t},\n\t\tintrospection: true,\n\t\tresolverValidationOptions: {\n\t\t\trequireResolversForResolveType: false,\n\t\t},\n\t\tcontext: (req) => {\n\t\t\t// console.log('context req: ', req);\n\t\t\treturn { ...req, db };\n\t\t},\n\t});\n}", "async function main() {\n\n const uri = \"mongodb+srv://thisIsMark:L9uMD3TqPYGuNUoX@cluster0.ga461.mongodb.net/ems?retryWrites=true&w=majority\";\n \n const client = new MongoClient(uri);\n\n try {\n\n await client.connect();\n await listDatabases(client);\n } catch (e) {\n console.error(e);\n }\n finally {\n await client.close();\n }\n \n}", "function createClient(options) {\n const host = options.host || ''\n\n // TODO: The change for headers and host should be replicated in Backstage.\n // Or we should finally pull Roulade out.\n const headers = options.token ? {\n authorization: `Token token='${options.token}'`,\n } : {}\n\n return new Lokka({\n transport: new Transport(host + '/graphql', {headers}),\n })\n}", "start() {\n const app = express_1.default();\n let query = new user_serv_1.default();\n // route for GET /\n // returns items\n app.get('/', (request, response) => __awaiter(this, void 0, void 0, function* () {\n let data = yield query.find({});\n response.send(data);\n }));\n app.get('/register', (request, response) => __awaiter(this, void 0, void 0, function* () {\n let user = new user_1.default();\n let answer = yield query.register(user);\n if (answer.result)\n response.send();\n else\n response.status(500).send(answer);\n }));\n // Server is listening to port defined when Server was initiated\n app.listen(this.port, () => {\n console.log(\"Server is running on port \" + this.port);\n });\n }", "function runQuery(thisPathwayNumber) {\n console.log(thisPathwayNumber);\n var pathwayNumberAsLetters = String(thisPathwayNumber).split('').map(function(number) {\n return String.fromCharCode(number % 26 + 97);\n }).join('');\n\n var config = {\n \"datasource\": \"http://localhost:5000/\" + pathwayNumberAsLetters,\n \"prefixes\": {\n \"rdf\": \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\",\n \"gpml\": \"https://wikipathways.firebaseio.com/.json\"\n }\n };\n\n var query = 'SELECT * WHERE { ?s <http://www.biopax.org/release/biopax-level3.owl#UnificationXref> ?o } LIMIT 10';\n\n var client = new LinkedDataFragmentsClient(config),\n querySolver = new SparqlQuerySolver(client, config.prefixes);\n querySolver.getQueryResults(query)\n .then(function (result) {\n // Display result rows\n if (result.rows) {\n console.log(JSON.stringify(result.rows, null, ' '));\n }\n // Display Turtle\n else {\n var writer = new N3.Writer(config.prefixes);\n writer.addTriples(result.triples);\n writer.end(function (error, turtle) {\n // Display error or Turtle result\n if (error) return console.log(error);\n console.log(turtle);\n });\n }\n })\n .fail(function (error) { console.log(error.message); })\n .fin(function () { $execute.prop('disabled', false); });\n}", "async function basicQuery() {\n const query = {\n query: \"Resources | project id, name, type, location, tags | limit 3\",\n subscriptions: [\"cfbbd179-59d2-4052-aa06-9270a38aa9d6\"],\n };\n const credential = new DefaultAzureCredential();\n const client = new ResourceGraphClient(credential);\n const result = await client.resources(query);\n console.log(result);\n}", "static get DATABASE_URL() {\r\n const port = 8000 // Change this to your server port\r\n return `http://localhost:${port}/data/restaurants.json`;\r\n }", "queryOne( ...args ) {\n return this.query( ...args ).head();\n }", "function TraversalAPI(db) {\n var path = \"/_api/traversal/\";\n\n return {\n\t/**\n\t *\n\t * @param {String} startVertex - id of the startVertex, e.g. \"users/foo\".\n\t * @param {String} edgeCollection - the edge collection containing the edges.\n\t * @param {Object} options - a JSON Object contatining optional parameter:\n\t * @param {String} [options.filter] - body (JavaScript code) of custom filter function\n\t * (signature (config, vertex, path) -> mixed) can return four different string values: <br>- \"exclude\" -> this\n\t * vertex will not be visited.<br>- \"prune\" -> the edges of this vertex will not be followed.<br>- \"\" or\n\t * undefined -> visit the vertex and follow it's edges.<br>- Array -> containing any combination of the above.\n\t * @param {Number} [options.minDepth] - visits only nodes in at least the given depth\n\t * @param {Number} [options.maxDepth] - visits only nodes in at most the given depth\n\t * @param {String} [options.visitor] - body (JavaScript) code of custom visitor function (signature: (config,\n\t * result, vertex, path) -> void visitor). Function can do anything, but its return value is ignored. To populate\n\t * a result, use the result variable by reference.\n\t * @param {String} [options.direction] - direction for traversal. if set, must be either \"outbound\", \"inbound\",\n\t * or \"any\" , if not set, the expander attribute must be specified.\n\t * @param {String} [options.init] - body (JavaScript) code of custom result initialisation function (signature\n\t * (config, result) -> void) initialise any values in result with what is required,\n\t * @param {String} [options.expander] - body (JavaScript) code of custom expander function must be set if\n\t * direction attribute is not set. function (signature (config, vertex, path) -> array) expander must return an\n\t * array of the connections for vertex.Each connection is an object with the attributes edge and vertex\n\t * @param {String} [options.strategy] - traversal strategy can be \"depthfirst\" or \"breadthfirst\"\n\t * @param {String} [options.order] - traversal order can be \"preorder\" or \"postorder\"\n\t * @param {String} [options.itemOrder] - item iteration order can be \"forward\" or \"backward\"\n\t * @param {String} [options.uniqueness] - specifies uniqueness for vertices and edges visited if set, must be an\n\t * object like this: \"uniqueness\": {\"vertices\": \"none\"|\"global\"|path\", \"edges\": \"none\"|\"global\"|\"path\"}.\n\t * @param {Number} [options.maxIterations] - Maximum number of iterations in each traversal. This number can be\n\t * set to prevent endless loops in traversal of cyclic graphs. When a traversal performs as many iterations as\n\t * the maxIterations value, the traversal will abort with an error. If maxIterations is not set, a\n\t * server-defined value may be used.\n\t * @method start\n\t * @return{Promise}\n\t */\n\t\"start\": function (startVertex, edgeCollection, options) {\n\n\t options = options || {};\n\t \n\t options.startVertex = startVertex;\n\t options.edgeCollection = edgeCollection;\n\n\t return db.post(path, options);\n\t}\n };\n}", "static get DATABASE_URL() {\r\n const port = 1337; // Change this to your server port\r\n return `http://localhost:${port}/restaurants`;\r\n }", "static get DATABASE_URL() {\r\n const port = 1337 // Change this to your server port\r\n return `http://localhost:${port}/restaurants`;\r\n }", "static get DATABASE_URL() {\r\n const port = 1337 // Change this to your server port\r\n return `http://localhost:${port}/restaurants`;\r\n }", "static get DATABASE_URL() {\r\n const port = 1337 // Change this to your server port\r\n return `http://localhost:${port}/restaurants`;\r\n }", "static get DATABASE_URL() {\r\n const port = 1337 // Change this to your server port\r\n return `http://localhost:${port}/restaurants`;\r\n }" ]
[ "0.65022564", "0.64900005", "0.6258283", "0.6217162", "0.61853683", "0.6086763", "0.6044733", "0.60078126", "0.598656", "0.5985974", "0.5849738", "0.5717077", "0.56887454", "0.5666524", "0.56056833", "0.5576886", "0.5575047", "0.55744165", "0.55226535", "0.54728675", "0.54645413", "0.5440713", "0.5408311", "0.54020834", "0.54004234", "0.5392334", "0.53787833", "0.53459775", "0.5342613", "0.53164244", "0.53103393", "0.53027356", "0.5294454", "0.5285291", "0.5267178", "0.5219959", "0.51999855", "0.51917297", "0.51864433", "0.516727", "0.5165426", "0.5154993", "0.5146644", "0.5125552", "0.5089822", "0.5088853", "0.5075156", "0.50573045", "0.50542873", "0.50444037", "0.501638", "0.50138015", "0.5003067", "0.49993128", "0.49876624", "0.49862072", "0.49838236", "0.4983217", "0.49827346", "0.49697706", "0.49651486", "0.49643177", "0.49609062", "0.4957694", "0.49550182", "0.4954468", "0.49398905", "0.4939469", "0.49307242", "0.49288243", "0.49274454", "0.4925975", "0.49190935", "0.4915316", "0.4913203", "0.4913203", "0.49112675", "0.49103853", "0.4908691", "0.48920152", "0.48920152", "0.48920152", "0.4889131", "0.48857158", "0.48789454", "0.48701492", "0.48672214", "0.48656234", "0.48640314", "0.4863978", "0.48613995", "0.48592862", "0.4853209", "0.4853166", "0.4851523", "0.48500222", "0.48453322", "0.4836094", "0.4836094", "0.4836094", "0.4836094" ]
0.0
-1
Signs the given transaction data and sends it. Abstracts some of the details of buffering and serializing the transaction for web3.
function sendSigned(txData,privKey, cb) { const privateKey = new Buffer(privKey, 'hex') const transaction = new Tx(txData) transaction.sign(privateKey) const serializedTx = transaction.serialize().toString('hex') web3.eth.sendSignedTransaction('0x' + serializedTx, cb) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sign(err, data) {\n if (err !== null) {\n console.log(err);\n } else {\n var tx = data;\n console.log(\"Recieved: \" + data.tx.received);\n console.log(\"Transaction recieved, signing...\");\n\n\n tx.pubkeys = [];\n tx.signatures = data.tosign.map(function (tosign) {\n tx.pubkeys.push(networkkeys.public);\n //output of tx is not readble so we are coverting into the hex\n var signature = key.sign(Buffer.from(tosign, \"hex\"));\n return signature.toString(\"hex\");\n });\n\n //Attempt to send the signed transaction by below code.\n console.log(\"\\nSending signed transaction...\");\n bcapi.sendTX(tx, function (err, data) {\n if (err !== null) {\n console.log(err);\n } else {\n console.log(\"Recieved: \" + data.tx.received);\n console.log(\"\\nTransaction Success.\");\n }\n\n });\n }\n}", "function sendSigned (txData, cb) {\n web3.eth.sendSignedTransaction('0x' + signTx(txData).toString('hex'), cb)\n}", "function sendSigned(txData, cb) {\n const privateKey = new Buffer(privKey, 'hex');\n const transaction = new Tx(txData);\n transaction.sign(privateKey);\n const serializedTx = transaction.serialize().toString('hex');\n web3.eth.sendSignedTransaction('0x' + serializedTx, cb);\n}", "signTransaction(signingKey) {\n if (signingKey.getPublic('hex') != this.fromAddress) {\n throw new Error(\"You cannot sign transactions for other valets\");\n }\n const hashTx = this.calculateTransactionHash();\n //signing hash of our transaction\n const sig = signingKey.sign(hashTx, 'base64');\n //storing the signature in some format\n this.signature = sig.toDER('hex');\n }", "signTransaction(signingKey) {\n if (signingKey.getPublic('hex') !== this.sender && this.sender !== 'MINING REWARD') {\n throw new Error('You cant sign this transaction!')\n }\n\n const transactionHash = this.calculateHash();\n const sign = signingKey.sign(transactionHash, 'base64');\n this.signature = sign.toDER('hex');\n }", "signTransaction(signingKey){\n //Check if public key equals the fromAddress\n //Can spend coins from the wallets that we have the private key for\n //Because private key is linked to the public key,fromAddress has to equal public key\n if(signingKey.getPublic(\"hex\")!==this.fromAddress){\n throw new Error(\"You cannot sign transactions for other wallets\");\n }\n //create hash of our transaction\n const hashTx = this.calculateHash();\n //Create signature and sign hash of our transaction\n const sig = signingKey.sign(hashTx,\"base64\");\n //Store the signature created into the transaction\n this.signature = sig.toDER(\"hex\");\n }", "signTransaction(signinKey) {\n if (signinKey.getPublic(\"hex\") !== this.fromAddress) {\n throw new Error(\"You cannot sign transactions for other wallets!\");\n }\n\n // Calculate the hash of this transaction\n const hashTx = this.calculateHash();\n const sig = signinKey.sign(hashTx, \"base64\"); // Sign the hash of the transaction with base64\n this.signature = sig.toDER(\"hex\");\n }", "function signAndSend(data, destination, callback) {\n var tx = {\n \"from\": sessionStorage['address'],\n \"to\": destination,\n \"data\": data,\n \"gasPrice\": 0\n };\n tx.gas = web3.eth.estimateGas(tx);\n console.log(\"Estimated gas cost: \" + tx.gas);\n tx.gas = Math.round(tx.gas * 1.25);\n console.log(\"Heightened to: \" + tx.gas);\n\n var blockgaslimit = web3.eth.getBlock('latest').gasLimit;\n if (tx.gas >= blockgaslimit * 0.8) {\n alert(\"Kosten zu hoch. Transaktion zurzeit nicht möglich.\");\n return;\n }\n var transactionHash;\n\n var row = document.createElement('div');\n row.className = \"row sticky-row\";\n var transactioninfo = document.createElement('div');\n transactioninfo.className = \"column center-column hover-column\";\n\n row.insertAdjacentElement('beforeend', transactioninfo);\n document.getElementsByClassName('container')[0].insertAdjacentElement('beforeend', row);\n\n blockpass.latestfilter = web3.eth.filter('latest');\n blockpass.latestfilter.watch((error, result) => {\n if (!error) {\n var transactionHashes = web3.eth.getBlock(result).transactions;\n console.log(transactionHashes);\n console.log(transactionHash);\n for (var i = 0; i < transactionHashes.length; ++i) {\n if (transactionHashes[i] == transactionHash) {\n transactioninfo.innerText = \"Fertig\";\n blockpass.latestfilter.stopWatching();\n callback(false, true);\n break;\n }\n }\n }\n });\n\n transactioninfo.innerText = \"Sende Transaktion...\";\n\n setTimeout(() => {\n transactionHash = web3.personal.sendTransaction(tx, sessionStorage['password']);\n transactioninfo.innerText = `Warte auf Transaktion mit Hash: ${transactionHash}...`;\n }, 1 * 1000);\n}", "function sendSignedTx(transactionObject, cb) {\n let transaction = new EthTx(transactionObject);\n const privateKey = new Buffer.from(privKey, \"hex\");\n transaction.sign(privateKey);\n const serializedEthTx = transaction.serialize().toString(\"hex\");\n web3.eth.sendSignedTransaction(`0x${serializedEthTx}`, cb);\n}", "function sendSignedTx(transactionObject, cb) {\n let transaction = new EthTx(transactionObject);\n const privateKey = new Buffer.from(privKey, \"hex\");\n transaction.sign(privateKey);\n const serializedEthTx = transaction.serialize().toString(\"hex\");\n web3.eth.sendSignedTransaction(`0x${serializedEthTx}`, cb);\n}", "_signTransaction(raw) {\n raw['from'] = this.address;\n\n return new Promise(function(resolve, reject) {\n web3.eth.sendTransaction(raw, function(err, res) {\n if (err) {\n reject(err);\n }\n resolve(res);\n });\n });\n }", "async signAndSend(originalTx, privateKey, web3, safer = false, time = 2000) {\n const ob = await this.signTx(originalTx, privateKey, web3);\n if(safer) {\n return await this.send(ob.serializedTx, web3, safer, time);\n } else {\n return await this.send(ob.serializedTx, web3);\n }\n }", "function sendRaw(rawTx) {\n\t\n var privateKey = new Buffer(keyTx, 'hex'); // Reference Error, Buffer is not defined. проверял в библиотеке ethereum-tx Buffer описан, вроед должно работать, но нет\n \t\t\t\t\t\t\t\t\t\t\t// в мануалах свежих вызывают Buffer.from(key.Tx,'hex') но тоже не работает.\n var transaction = new tx(rawTx); // не совсем ясно обращение здесь new tx ИЛИ new transaction - в разных мануалах по разному описано.\n transaction.sign(privateKey);\n //web3.eth.personal.sign(transaction, \"0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe\", \"test password!\").then(console.log); онлайн подпись через Web3.JS\n var serializedTx = transaction.serialize().toString('hex');\n console.log('Serialized TX: '+serializedTx);\n var feeCost = transaction.getUpfrontCost();\n\ttransaction.gas = feeCost;\n\tconsole.log('Gas cost: '+feeCost);\n web3.eth.sendRawTransaction(\n '0x' + serializedTx, function(err, result) {\n if(err) {\n console.log('Error: ' + err);\n throw(err);\n; } else {\n console.log('Success: ' + result);\n console.log(result);\n return result;\n }\n });\n}", "_web3_send_funds(to, amount, pass){\r\n var core = this;\r\n\t\ttry{\r\n\t var abiArray = core._contract_abi;\r\n\t\t\tvar contractAddress = core._contract_address;\r\n\t\t\tlet privateKey = ethereumjs.Buffer.Buffer(ethereumjs.Util.toBuffer(\"0x\" + pass), 'hex');\r\n\r\n\t var count = core._web3.eth.getTransactionCount(core._wallet_address);\r\n\t var contract = core._web3.eth.contract(abiArray).at(contractAddress);\r\n\r\n\t\t \tlet gasData = JSON.parse(core._app_ret_buffer._gas_estimated_cost);\r\n\t let txParams = {\r\n\t\t\t\tdata: contract.transfer.getData(to, (amount * 100000000)),\r\n\t nonce: core._web3.toHex(count),\r\n\t gasPrice: core._web3.toHex(((parseInt(gasData.average) / 10) * core._wallet_txs_gas_multiplier) * 1000000000), // Multiple of 1000000000 produces Gwei level value\r\n\t gasLimit: core._web3.toHex(parseInt(gasData.average) * 10000),\r\n\t value: '0x0',\r\n\t to: contractAddress\r\n\t }\r\n\t let tx = new ethereumjs.Tx(txParams);\r\n\t tx.sign(privateKey);\r\n\t let serializedTx = tx.serialize().toString('hex');\r\n\r\n\t\t\tif(core._app_verbose) console.log(txParams);\r\n\r\n\t core._web3.eth.sendRawTransaction('0x' + serializedTx, function(err, hash) {\r\n\t if(!err){\r\n\t core._transaction_current_hash = hash;\r\n\r\n\t\t\t\t\t\t// Add TX record to tx_queue (app_conf) - this allows the app to track all pending tx\r\n\t\t\t\t\t\tcore._web3_create_pending_tx(amount, hash, -1, core._wallet_address, to, \"...\", (((parseInt(gasData.average) / 10) * core._wallet_txs_gas_multiplier) * 1000000000), 0);\r\n\r\n\t } else {\r\n\t\t\t\t\t\tconsole.log(\"An error has occured while processing transaction: \" + err);\r\n\t\t\t core._ui_event_portals(\"send_funds_failed\");\r\n\t }\r\n\t });\r\n\r\n\t\t\t// !important, gas cost must be nulled after the transaction\r\n\t\t\t// gas cost is checked for tx confirmation process\r\n\t\t\tcore._app_ret_buffer._gas_estimated_cost = null;\r\n\r\n\t\t} catch(err){\r\n\t\t\tconsole.log(\"An error has occured while processing transaction: \" + err);\r\n\t\t\tcore._ui_event_portals(\"send_funds_failed\");\r\n\t\t\tcore._app_ret_buffer._gas_estimated_cost = null;\r\n\t\t}\r\n\r\n }", "function signData(tmAddress, investorAddress, fromTime, toTime, expiryTime, restricted, validFrom, validTo, nonce, pk) {\n let packedData = utils\n .solidityKeccak256(\n [\"address\", \"address\", \"uint256\", \"uint256\", \"uint256\", \"bool\", \"uint256\", \"uint256\", \"uint256\"],\n [tmAddress, investorAddress, fromTime, toTime, expiryTime, restricted, validFrom, validTo, nonce]\n )\n .slice(2);\n packedData = new Buffer(packedData, \"hex\");\n console.log(\"PackedData 1: \" + packedData);\n packedData = Buffer.concat([new Buffer(`\\x19Ethereum Signed Message:\\n${packedData.length.toString()}`), packedData]);\n packedData = web3.utils.sha3(`0x${packedData.toString(\"hex\")}`, { encoding: \"hex\" });\n console.log(\"PackedData 2: \" + packedData);\n return ethUtil.ecsign(new Buffer(packedData.slice(2), \"hex\"), new Buffer(pk, \"hex\"));\n}", "function transact() {\n try {\n console.log(\"Transaction occurring! Switching to signing state!\");\n state = \"signing\";\n\n let transaction;\n xdr = t.buildTransaction(s(transactions));\n\n\n\n // Send a message to all signers\n for (transaction of transactions) {\n\n let name = transaction.fromUsername + \",\" + bot.myInfo().username;\n console.log(\"Channel name is:\", name);\n let channel = {\n name: name,\n public: false,\n topicType: \"chat\"\n };\n bot.chat.send(channel, {\n body: \"Type `keybase wallet sign --xdr \" + xdr + \" --account \" + transaction.from + \"` to sign the transaction to \" +\n transaction.toUsername + \" for \" + transaction.value + \" lumens! \\n Then send the signature to the bot with `!sign <signature>`\"\n });\n }\n\n console.log(\"Transactions occurring: \", transactions);\n } catch (e) {\n console.log(e);\n }\n\n}", "function signRequest(data, sign_key) {\n console.time('signing_time');\n var signature = curve.sign.detached(json2buf(data, encoding='ascii'), sign_key);\n signature = Buffer.from(signature).toString('base64');\n console.timeEnd('signing_time');\n\n return signature;\n}", "function signData(tmAddress, investorAddress, fromTime, toTime, expiryTime, restricted, validFrom, validTo, nonce, pk) {\n let packedData = utils\n .solidityKeccak256(\n [\"address\", \"address\", \"uint256\", \"uint256\", \"uint256\", \"bool\", \"uint256\", \"uint256\", \"uint256\"],\n [tmAddress, investorAddress, fromTime, toTime, expiryTime, restricted, validFrom, validTo, nonce]\n )\n .slice(2);\n packedData = new Buffer(packedData, \"hex\");\n packedData = Buffer.concat([new Buffer(`\\x19Ethereum Signed Message:\\n${packedData.length.toString()}`), packedData]);\n packedData = web3.sha3(`0x${packedData.toString(\"hex\")}`, { encoding: \"hex\" });\n return ethUtil.ecsign(new Buffer(packedData.slice(2), \"hex\"), new Buffer(pk, \"hex\"));\n}", "function publish( txn ){\n\n\tcheckForMissingArg( txn, \"transaction\" );\n\t\n\treturn Blockchain.sign(txn);\n}", "function SubmitSignedTransaction(n) {\n // Create a RED node\n RED.nodes.createNode(this,n);\n\n // copy \"this\" object in case we need it in context of callbacks of other functions.\n var node = this;\n // create a msg object\n var msg = {};\n\n var server = RED.nodes.getNode(n.server);\n server.connect();\n\n // when an input is recieved\n this.on('input', function (msg) {\n var signedTransaction;\n\n if (n.signedTransaction != \"\") signedTransaction = n.signedTransaction;\n else signedTransaction= msg.payload.signedTX.signedTransaction;\n\n if (server.isConnected()){\n try {\n XRPLib.submitSignedTransaction(server, signedTransaction).then((txResult) => {\n msg.payload.txResult = txResult;\n this.send(msg);\n }).catch((e) => {\n msg.payload = e;\n this.send(msg);\n });\n } catch (e) {\n msg.payload = e;\n this.send(msg);\n }\n }\n else {\n msg.payload = \"Error, Disconnected from RippleAPI\";\n this.send(msg);\n }\n });\n\n this.on(\"close\", function() {\n // Called when the node is shutdown - eg on redeploy.\n // Allows ports to be closed, connections dropped etc.\n // eg: node.client.disconnect();\n });\n }", "function _serialize(transaction, signature) {\n properties_1.checkProperties(transaction, allowedTransactionKeys);\n var raw = [];\n transactionFields.forEach(function (fieldInfo) {\n var value = transaction[fieldInfo.name] || ([]);\n var options = {};\n if (fieldInfo.numeric) {\n options.hexPad = \"left\";\n }\n value = bytes_1.arrayify(bytes_1.hexlify(value, options));\n // Fixed-width field\n if (fieldInfo.length && value.length !== fieldInfo.length && value.length > 0) {\n logger.throwArgumentError(\"invalid length for \" + fieldInfo.name, (\"transaction:\" + fieldInfo.name), value);\n }\n // Variable-width (with a maximum)\n if (fieldInfo.maxLength) {\n value = bytes_1.stripZeros(value);\n if (value.length > fieldInfo.maxLength) {\n logger.throwArgumentError(\"invalid length for \" + fieldInfo.name, (\"transaction:\" + fieldInfo.name), value);\n }\n }\n raw.push(bytes_1.hexlify(value));\n });\n var chainId = 0;\n if (transaction.chainId != null) {\n // A chainId was provided; if non-zero we'll use EIP-155\n chainId = transaction.chainId;\n if (typeof (chainId) !== \"number\") {\n logger.throwArgumentError(\"invalid transaction.chainId\", \"transaction\", transaction);\n }\n }\n else if (signature && !bytes_1.isBytesLike(signature) && signature.v > 28) {\n // No chainId provided, but the signature is signing with EIP-155; derive chainId\n chainId = Math.floor((signature.v - 35) / 2);\n }\n // We have an EIP-155 transaction (chainId was specified and non-zero)\n if (chainId !== 0) {\n raw.push(bytes_1.hexlify(chainId)); // @TODO: hexValue?\n raw.push(\"0x\");\n raw.push(\"0x\");\n }\n // Requesting an unsigned transation\n if (!signature) {\n return RLP.encode(raw);\n }\n // The splitSignature will ensure the transaction has a recoveryParam in the\n // case that the signTransaction function only adds a v.\n var sig = bytes_1.splitSignature(signature);\n // We pushed a chainId and null r, s on for hashing only; remove those\n var v = 27 + sig.recoveryParam;\n if (chainId !== 0) {\n raw.pop();\n raw.pop();\n raw.pop();\n v += chainId * 2 + 8;\n // If an EIP-155 v (directly or indirectly; maybe _vs) was provided, check it!\n if (sig.v > 28 && sig.v !== v) {\n logger.throwArgumentError(\"transaction.chainId/signature.v mismatch\", \"signature\", signature);\n }\n }\n else if (sig.v !== v) {\n logger.throwArgumentError(\"transaction.chainId/signature.v mismatch\", \"signature\", signature);\n }\n raw.push(bytes_1.hexlify(v));\n raw.push(bytes_1.stripZeros(bytes_1.arrayify(sig.r)));\n raw.push(bytes_1.stripZeros(bytes_1.arrayify(sig.s)));\n return RLP.encode(raw);\n}", "function _serialize(transaction, signature) {\n properties_1.checkProperties(transaction, allowedTransactionKeys);\n var raw = [];\n transactionFields.forEach(function (fieldInfo) {\n var value = transaction[fieldInfo.name] || ([]);\n var options = {};\n if (fieldInfo.numeric) {\n options.hexPad = \"left\";\n }\n value = bytes_1.arrayify(bytes_1.hexlify(value, options));\n // Fixed-width field\n if (fieldInfo.length && value.length !== fieldInfo.length && value.length > 0) {\n logger.throwArgumentError(\"invalid length for \" + fieldInfo.name, (\"transaction:\" + fieldInfo.name), value);\n }\n // Variable-width (with a maximum)\n if (fieldInfo.maxLength) {\n value = bytes_1.stripZeros(value);\n if (value.length > fieldInfo.maxLength) {\n logger.throwArgumentError(\"invalid length for \" + fieldInfo.name, (\"transaction:\" + fieldInfo.name), value);\n }\n }\n raw.push(bytes_1.hexlify(value));\n });\n var chainId = 0;\n if (transaction.chainId != null) {\n // A chainId was provided; if non-zero we'll use EIP-155\n chainId = transaction.chainId;\n if (typeof (chainId) !== \"number\") {\n logger.throwArgumentError(\"invalid transaction.chainId\", \"transaction\", transaction);\n }\n }\n else if (signature && !bytes_1.isBytesLike(signature) && signature.v > 28) {\n // No chainId provided, but the signature is signing with EIP-155; derive chainId\n chainId = Math.floor((signature.v - 35) / 2);\n }\n // We have an EIP-155 transaction (chainId was specified and non-zero)\n if (chainId !== 0) {\n raw.push(bytes_1.hexlify(chainId)); // @TODO: hexValue?\n raw.push(\"0x\");\n raw.push(\"0x\");\n }\n // Requesting an unsigned transation\n if (!signature) {\n return RLP.encode(raw);\n }\n // The splitSignature will ensure the transaction has a recoveryParam in the\n // case that the signTransaction function only adds a v.\n var sig = bytes_1.splitSignature(signature);\n // We pushed a chainId and null r, s on for hashing only; remove those\n var v = 27 + sig.recoveryParam;\n if (chainId !== 0) {\n raw.pop();\n raw.pop();\n raw.pop();\n v += chainId * 2 + 8;\n // If an EIP-155 v (directly or indirectly; maybe _vs) was provided, check it!\n if (sig.v > 28 && sig.v !== v) {\n logger.throwArgumentError(\"transaction.chainId/signature.v mismatch\", \"signature\", signature);\n }\n }\n else if (sig.v !== v) {\n logger.throwArgumentError(\"transaction.chainId/signature.v mismatch\", \"signature\", signature);\n }\n raw.push(bytes_1.hexlify(v));\n raw.push(bytes_1.stripZeros(bytes_1.arrayify(sig.r)));\n raw.push(bytes_1.stripZeros(bytes_1.arrayify(sig.s)));\n return RLP.encode(raw);\n}", "async function send() {\n // make sure `data` starts with 0x\n const contract = new caver.klay.Contract(LoonGEM.abi, '0x5B30A206Fb33256e92BB43F715F5FeCCb66383eF');\n const pebToken = caver.utils.toPeb(50000000, 'KLAY');\n const data = await contract.methods.transfer(receiverAddress, pebToken).encodeABI();\n\n const { rawTransaction: senderRawTransaction } = await caver.klay.accounts.signTransaction({\n type: 'FEE_DELEGATED_SMART_CONTRACT_EXECUTION',\n from: sender.address,\n to: '0x5B30A206Fb33256e92BB43F715F5FeCCb66383eF',\n data: data,\n gas: '3000000',\n value: 0,\n }, sender.privateKey);\n\n // signed raw transaction\n console.log(\"Raw TX:\\n\", senderRawTransaction);\n \n // send fee delegated transaction with fee payer information\n caver.klay.sendTransaction({\n senderRawTransaction: senderRawTransaction,\n feePayer: payer.address\n })\n .on('transactionHash', function (hash) {\n console.log(\">>> tx_hash for deploy =\", hash);\n })\n .on('receipt', function (receipt) {\n console.log(\">>> receipt arrived: \", receipt);\n })\n .on('error', function (err) {\n console.error(\">>> error: \", err);\n });\n}", "sendTransaction(transaction) {\n this._checkProvider(\"sendTransaction\");\n return this.populateTransaction(transaction).then((tx) => {\n return this.signTransaction(tx).then((signedTx) => {\n return this.provider.sendTransaction(signedTx);\n });\n });\n }", "sendTransaction(transaction) {\n this._checkProvider(\"sendTransaction\");\n return this.populateTransaction(transaction).then((tx) => {\n return this.signTransaction(tx).then((signedTx) => {\n return this.provider.sendTransaction(signedTx);\n });\n });\n }", "signTransaction (address, tx) {\n console.log('signing transaction for address: ' + address)\n console.log(JSON.stringify(tx))\n // original implementation:\n // const wallet = this._getWalletForAccount(address)\n // var privKey = wallet.getPrivateKey()\n // tx.sign(privKey)\n // return Promise.resolve(tx)\n\n return new Promise((resolve, reject) => {\n let wsUri = this.sdkdConfig.sdkdWsHost + '/cable'\n let websocket = new WebSocket(wsUri)\n let ts = Date.now()\n let identifier = {\n channel: \"MessagesChannel\",\n user_id: this.sdkdConfig.userId\n }\n websocket.onopen = (evt) => {\n console.log(evt)\n console.log(\"CONNECTED\")\n\n // subscribe\n let msg = {\n command: \"subscribe\",\n identifier: JSON.stringify(identifier)\n }\n websocket.send(JSON.stringify(msg))\n }\n websocket.onclose = (evt) => { console.log(evt) }\n websocket.onerror = (evt) => { console.log(evt) }\n websocket.onmessage = (evt) => {\n let data = JSON.parse(evt.data)\n if (data.type == 'ping') {\n return // don't print pings\n }\n console.log(evt)\n // if subscription confirmation, then send signing request\n if (data.type === 'confirm_subscription') {\n // send txn\n let data = {\n action: 'create_tx',\n tx_params: tx,\n request_ts: ts\n }\n let msg = {\n command: 'message',\n identifier: JSON.stringify(identifier),\n data: JSON.stringify(data)\n }\n websocket.send(JSON.stringify(msg))\n return\n }\n\n if (!data.message) {\n return\n }\n\n let signedTx = data.message.tx\n\n if (signedTx !== undefined && signedTx.status === 'signed' && signedTx.request_ts === ts.toString()) {\n console.log('signed tx is included')\n let signedTx = data.message.tx\n let newTx = new Transaction(signedTx.signed_tx)\n // make sure the parsed unserialized tx has the same \"to\" and \"value\"\n if (tx.to.toString('hex') === newTx.to.toString('hex') && tx.value.toString('hex') === newTx.value.toString('hex')) {\n console.log('tx matches, resolving promise and closing websocket')\n websocket.close()\n resolve(newTx)\n }\n }\n }\n })\n }", "origSendTransaction(options) {\n\t\treturn this.origSend(\"eth_sendTransaction\", [options])\n\t}", "async send(serializedTx, web3, safer = false, time = 2000) { \n if(safer) {\n if(this.previousTransaction != null) {\n const receipt = await web3.eth.getTransactionReceipt(this.previousTransaction.transactionHash);\n if(receipt.blockNumber > 0) {\n this.previousTransaction = await web3.eth.sendSignedTransaction(serializedTx);\n return this.previousTransaction;\n } else {\n await this.sleep(time); // sleep time\n return await this.send(serializedTx, web3, safer, time); // call it again... :)\n }\n } \n }\n this.previousTransaction = await web3.eth.sendSignedTransaction(serializedTx);\n return this.previousTransaction;\n }", "sign(data) {\n\t\treturn this.keyPair.sign(cryptoHash(data));\n\t}", "async add_transaction_to_blockchain(key, data) {\n if(global.localhost) {\n return \"Stop wasting credit!\";\n }\n var [error, pendingResponse, response_data] = await this.blockchain.invoke(\"add_transaction\", {}, { args: [key, data] });\n\n return {error: false, response: response_data};\n }", "constructor(data, wallet) {\n this.id = ChainUtil.id();\n this.from = wallet.publicKey;\n console.log('>>>>>>Transaction Entry @>>>>>>', new Date)\n this.input = { data: data, timestamp: new Date };\n console.log('>>>>>>>> input', this.input)\n this.hash = ChainUtil.hash(this.input);\n this.signature = wallet.sign(this.hash);\n }", "async function initTransaction(data) {\n const { sender, receiver } = data;\n let base58publicKey = new PublicKey(\n \"9Ayh2hS3k5fTn6V9Ks7NishUp5Jz19iosK3tYPAcNhsp\"\n );\n const senderaddress = new PublicKey(sender); \n const recepientaddress = new PublicKey(data.receiver);\n let validProgramAddress_pub = await PublicKey.findProgramAddress(\n [senderaddress.toBuffer()],\n base58publicKey\n );\n const validProgramAddress = validProgramAddress_pub[0].toBase58();\n\n //sender and receiver address\n\n let sender_recipient_pub = await PublicKey.findProgramAddress(\n [senderaddress.toBuffer(), recepientaddress.toBuffer()],\n base58publicKey\n );\n\n const senderPda = sender_recipient_pub[0].toBase58();\n\n const PROGRAM_ID = \"9Ayh2hS3k5fTn6V9Ks7NishUp5Jz19iosK3tYPAcNhsp\"; // Zebec program id\n const instruction = new TransactionInstruction({\n keys: [\n {\n pubkey: new PublicKey(sender),\n isSigner: true,\n isWritable: true,\n },\n {\n pubkey: new PublicKey(receiver), //recipient\n isSigner: false,\n isWritable: true,\n },\n {\n // master pda to store fund\n pubkey: validProgramAddress,\n isSigner: false,\n isWritable: true,\n },\n // pda to store data //sender and recepient\n {\n pubkey: senderPda,\n isSigner: false,\n isWritable: true,\n },\n {\n pubkey: SystemProgram.programId, //system program required to make a transfer\n isSigner: false,\n isWritable: false,\n },\n ],\n programId: new PublicKey(PROGRAM_ID),\n data: encodeInstructionData(data),\n });\n const transaction = new Transaction().add(instruction);\n const connection = new Connection(clusterApiUrl(\"devnet\"));\n const signerTransac = async () => {\n try {\n transaction.recentBlockhash = (\n await connection.getRecentBlockhash()\n ).blockhash;\n transaction.feePayer = window.solana.publicKey;\n const signed = await window.solana.signTransaction(transaction);\n const signature = await connection.sendRawTransaction(signed.serialize());\n const finality = \"confirmed\";\n await connection.confirmTransaction(signature, finality);\n const explorerhash = {\n transactionhash: signature,\n };\n return explorerhash;\n } catch (e) {\n console.warn(e);\n return false;\n }\n };\n signerTransac();\n}", "async sendAsset() {\n if (!this.state.sendAssetTo || !this.state.sendAssetAmount) return;\n let value = this.makeBigNumber(this.state.sendAssetAmount.toString(), 18);\n await web3.fsntx.buildSendAssetTx({\n from: this.state.account.address.toLowerCase(),\n to: this.state.sendAssetTo,\n value: value.toString(),\n asset: _FSNASSETID,\n })\n .then(tx => {\n tx.from = this.state.account.address.toLowerCase();\n tx.chainId = parseInt(_CHAINID);\n return web3.fsn.signAndTransmit(tx, this.state.account.signTransaction)\n .then(txHash => {\n this.addOutput(`Transaction Hash : ${txHash}`);\n });\n });\n }", "function multiSigningData(transaction, signingAccount) {\n var prefix = hash_prefixes_1.HashPrefix.transactionMultiSig;\n var suffix = types_1.coreTypes.AccountID.from(signingAccount).toBytes();\n return serializeObject(transaction, {\n prefix: prefix,\n suffix: suffix,\n signingFieldsOnly: true,\n });\n}", "function _serialize(transaction, signature) {\n Object(properties_lib_esm[\"b\" /* checkProperties */])(transaction, allowedTransactionKeys);\n const raw = [];\n transactionFields.forEach(function (fieldInfo) {\n let value = transaction[fieldInfo.name] || ([]);\n const options = {};\n if (fieldInfo.numeric) {\n options.hexPad = \"left\";\n }\n value = Object(bytes_lib_esm[\"a\" /* arrayify */])(Object(bytes_lib_esm[\"i\" /* hexlify */])(value, options));\n // Fixed-width field\n if (fieldInfo.length && value.length !== fieldInfo.length && value.length > 0) {\n logger.throwArgumentError(\"invalid length for \" + fieldInfo.name, (\"transaction:\" + fieldInfo.name), value);\n }\n // Variable-width (with a maximum)\n if (fieldInfo.maxLength) {\n value = Object(bytes_lib_esm[\"o\" /* stripZeros */])(value);\n if (value.length > fieldInfo.maxLength) {\n logger.throwArgumentError(\"invalid length for \" + fieldInfo.name, (\"transaction:\" + fieldInfo.name), value);\n }\n }\n raw.push(Object(bytes_lib_esm[\"i\" /* hexlify */])(value));\n });\n let chainId = 0;\n if (transaction.chainId != null) {\n // A chainId was provided; if non-zero we'll use EIP-155\n chainId = transaction.chainId;\n if (typeof (chainId) !== \"number\") {\n logger.throwArgumentError(\"invalid transaction.chainId\", \"transaction\", transaction);\n }\n }\n else if (signature && !Object(bytes_lib_esm[\"k\" /* isBytesLike */])(signature) && signature.v > 28) {\n // No chainId provided, but the signature is signing with EIP-155; derive chainId\n chainId = Math.floor((signature.v - 35) / 2);\n }\n // We have an EIP-155 transaction (chainId was specified and non-zero)\n if (chainId !== 0) {\n raw.push(Object(bytes_lib_esm[\"i\" /* hexlify */])(chainId)); // @TODO: hexValue?\n raw.push(\"0x\");\n raw.push(\"0x\");\n }\n // Requesting an unsigned transation\n if (!signature) {\n return rlp_lib_esm[\"encode\"](raw);\n }\n // The splitSignature will ensure the transaction has a recoveryParam in the\n // case that the signTransaction function only adds a v.\n const sig = Object(bytes_lib_esm[\"n\" /* splitSignature */])(signature);\n // We pushed a chainId and null r, s on for hashing only; remove those\n let v = 27 + sig.recoveryParam;\n if (chainId !== 0) {\n raw.pop();\n raw.pop();\n raw.pop();\n v += chainId * 2 + 8;\n // If an EIP-155 v (directly or indirectly; maybe _vs) was provided, check it!\n if (sig.v > 28 && sig.v !== v) {\n logger.throwArgumentError(\"transaction.chainId/signature.v mismatch\", \"signature\", signature);\n }\n }\n else if (sig.v !== v) {\n logger.throwArgumentError(\"transaction.chainId/signature.v mismatch\", \"signature\", signature);\n }\n raw.push(Object(bytes_lib_esm[\"i\" /* hexlify */])(v));\n raw.push(Object(bytes_lib_esm[\"o\" /* stripZeros */])(Object(bytes_lib_esm[\"a\" /* arrayify */])(sig.r)));\n raw.push(Object(bytes_lib_esm[\"o\" /* stripZeros */])(Object(bytes_lib_esm[\"a\" /* arrayify */])(sig.s)));\n return rlp_lib_esm[\"encode\"](raw);\n}", "async function sendTx() {\n console.log('sending transaction...')\n txResponse = await wallet.sendTransaction(txData)\n const txReceipt = await txResponse.wait()\n console.log('\\nView Tx with Block Explorer:\\n', '\\nhttps://alfajores-blockscout.celo-testnet.org/search?q='+txReceipt.transactionHash+'\\n')\n}", "function signingData(transaction, prefix) {\n if (prefix === void 0) { prefix = hash_prefixes_1.HashPrefix.transactionSig; }\n return serializeObject(transaction, { prefix: prefix, signingFieldsOnly: true });\n}", "sendTransaction(socket, transaction) \n\t{\n \t\tsocket.send(JSON.stringify({ type: MESSAGE_TYPES.transaction, transaction }));\n \t}", "send(payload, callback) {\n var requests = payload;\n if (!(requests instanceof Array)) {\n requests = [requests];\n }\n\n for (var request of requests) {\n if (request.method == \"eth_sendTransaction\") {\n throw new Error(\"HookedWeb3Provider does not support synchronous transactions. Please provide a callback.\")\n }\n }\n\n var finishedWithRewrite = () => {\n return super.send(payload, callback);\n };\n\n return this.rewritePayloads(0, requests, {}, finishedWithRewrite);\n }", "signMessage (withAccount, data) {\n const wallet = this._getWalletForAccount(withAccount)\n const message = ethUtil.stripHexPrefix(data)\n var privKey = wallet.getPrivateKey()\n var msgSig = ethUtil.ecsign(new Buffer(message, 'hex'), privKey)\n var rawMsgSig = ethUtil.bufferToHex(sigUtil.concatSig(msgSig.v, msgSig.r, msgSig.s))\n return Promise.resolve(rawMsgSig)\n }", "signMessage (withAccount, data) {\n const wallet = this._getWalletForAccount(withAccount)\n const message = ethUtil.stripHexPrefix(data)\n var privKey = wallet.getPrivateKey()\n var msgSig = ethUtil.ecsign(new Buffer(message, 'hex'), privKey)\n var rawMsgSig = ethUtil.bufferToHex(sigUtil.concatSig(msgSig.v, msgSig.r, msgSig.s))\n return Promise.resolve(rawMsgSig)\n }", "async function withdrawTransaction(data) {\n const { sender, receiver } = data;\n let base58publicKey = new PublicKey(\n \"9Ayh2hS3k5fTn6V9Ks7NishUp5Jz19iosK3tYPAcNhsp\"\n );\n const senderaddress = new PublicKey(sender);\n const recepientaddress = new PublicKey(data.receiver);\n let validProgramAddress_pub = await PublicKey.findProgramAddress(\n [senderaddress.toBuffer()],\n base58publicKey\n );\n const validProgramAddress = validProgramAddress_pub[0].toBase58();\n\n //sender and receiver address\n\n let sender_recipient_pub = await PublicKey.findProgramAddress(\n [senderaddress.toBuffer(), recepientaddress.toBuffer()],\n base58publicKey\n );\n\n const senderPda = sender_recipient_pub[0].toBase58();\n const PROGRAM_ID = \"9Ayh2hS3k5fTn6V9Ks7NishUp5Jz19iosK3tYPAcNhsp\";\n const instruction = new TransactionInstruction({\n keys: [\n {\n pubkey: new PublicKey(sender),\n isSigner: false,\n isWritable: true,\n },\n {\n pubkey: new PublicKey(receiver), //recipient\n isSigner: true,\n isWritable: true,\n },\n {\n // master pda\n pubkey: validProgramAddress,\n isSigner: false,\n isWritable: true,\n },\n {\n // data storage pda\n pubkey: senderPda,\n isSigner: false,\n isWritable: true,\n },\n {\n pubkey: SystemProgram.programId, //system program required to make a transfer\n isSigner: false,\n isWritable: false,\n },\n ],\n programId: new PublicKey(PROGRAM_ID),\n data: encodeWithdrawInstructionData(data),\n });\n const transaction = new Transaction().add(instruction);\n const connection = new Connection(clusterApiUrl(\"devnet\"));\n const signerTransac = async () => {\n try {\n transaction.recentBlockhash = (\n await connection.getRecentBlockhash()\n ).blockhash;\n transaction.feePayer = window.solana.publicKey;\n const signed = await window.solana.signTransaction(transaction);\n const signature = await connection.sendRawTransaction(signed.serialize());\n const finality = \"confirmed\";\n await connection.confirmTransaction(signature, finality);\n return signature;\n } catch (e) {\n console.warn(e);\n return false;\n }\n };\n signerTransac();\n}", "async signAndSubmitTransaction(transaction, wallet) {\n const signedTransaction = xpring_common_js_1.Signer.signTransaction(transaction, wallet);\n if (!signedTransaction) {\n throw xrp_error_1.default.signingError;\n }\n const submitTransactionRequest = this.networkClient.SubmitTransactionRequest();\n submitTransactionRequest.setSignedTransaction(signedTransaction);\n const response = await this.networkClient.submitTransaction(submitTransactionRequest);\n return xpring_common_js_1.Utils.toHex(response.getHash_asU8());\n }", "async function pauseTransaction(data) {\n const { sender, receiver } = data;\n let base58publicKey = new PublicKey(\n \"9Ayh2hS3k5fTn6V9Ks7NishUp5Jz19iosK3tYPAcNhsp\"\n );\n const senderaddress = new PublicKey(data.sender);\n const recepientaddress = new PublicKey(data.receiver);\n\n //sender and receiver address\n\n let sender_recipient_pub = await PublicKey.findProgramAddress(\n [senderaddress.toBuffer(), recepientaddress.toBuffer()],\n base58publicKey\n );\n\n const senderPda = sender_recipient_pub[0].toBase58();\n const PROGRAM_ID = \"9Ayh2hS3k5fTn6V9Ks7NishUp5Jz19iosK3tYPAcNhsp\";\n const instruction = new TransactionInstruction({\n keys: [\n {\n pubkey: new PublicKey(sender),\n isSigner: true,\n isWritable: true,\n },\n {\n pubkey: new PublicKey(receiver),\n isSigner: false,\n isWritable: true,\n },\n {\n pubkey: senderPda,\n isSigner: false,\n isWritable: true,\n },\n {\n pubkey: SystemProgram.programId, //system program required to make a transfer\n isSigner: false,\n isWritable: false,\n },\n ],\n programId: new PublicKey(PROGRAM_ID),\n data: encodePauseInstructionData(data),\n });\n const transaction = new Transaction().add(instruction);\n const connection = new Connection(clusterApiUrl(\"devnet\"));\n const signerTransac = async () => {\n try {\n transaction.recentBlockhash = (\n await connection.getRecentBlockhash()\n ).blockhash;\n transaction.feePayer = window.solana.publicKey;\n const signed = await window.solana.signTransaction(transaction);\n const signature = await connection.sendRawTransaction(signed.serialize());\n const finality = \"confirmed\";\n await connection.confirmTransaction(signature, finality);\n return signature;\n } catch (e) {\n console.warn(e);\n return false;\n }\n };\n signerTransac();\n}", "function signRequestBox(data, sign_key) {\n return Buffer.from(curve.sign(data, sign_key)).toString('base64');\n}", "function sendTransaction (\n address,\n amount,\n privateKey,\n gas,\n gasPrice,\n input,\n isTokenTransaction,\n nonce,\n addressFrom\n) {\n return new Promise((resolve, reject) => {\n const transaction = {\n nonce,\n data: input,\n gasPrice,\n to: address,\n value: amount,\n gas,\n chainId: ETH_CHAIN_ID,\n }\n\n web3.eth.accounts.signTransaction(transaction, privateKey)\n .then((signedTransaction) => {\n web3.eth.sendSignedTransaction(signedTransaction.rawTransaction)\n .once('transactionHash', (hash) => {\n // console.log([`transferToReceiver ${coin.addr} Trx Hash:${hash}`])\n resolve(1)\n })\n .once('receipt', (receipt) => {\n console.log(['transferToReceiver Receipt:', receipt])\n })\n .on('confirmation', (confirmationNumber) => {\n console.log(`transferToReceiver confirmation: ${confirmationNumber}`)\n })\n .on('error', console.error)\n .then((receipt) => {\n console.log(receipt)\n })\n .catch(reject)\n })\n })\n}", "function composePersonalDataToSign () {\n const fromAddr = address= config.fromAddr;\n const transactionCount = web3.eth.getTransactionCount(config.fromAddr);\n\n //txtype, nonce, gasPrice, gasLimit, to, value, data, chainId, 0, 0\n argsList = [1, transactionCount, config.gasPrice, config.gasLimit, \n config.toAddr, config.sendAmount, 0, \n config.chainId, 0, 0];\n argsBufferList = [];\n\n for (var i = 0; i < argsList.length; i++) { \n argHex = web3.toHex(argsList[i])\n if (argsList[i] != 0) {\n argsBufferList.push (ethUtil.toBuffer(argHex))\n } else {\n argsBufferList.push (ethUtil.toBuffer())\n }\n }\n\n console.log(argsBufferList);\n\n const encodedData = RLP.encode(argsBufferList);\n\n console.log(encodedData);\n\n return encodedData;\n}", "function post_transaction(){\n signed_transacion = unsigned_transaction;\n signed_transacion['signatures'] = [$(\"[name='signed-data']\").val()];\n signed_transacion['pubkeys'] = [$(\"[name='public-key']\").val()];\n\n ajaxPost('/blockcypher/post_transaction',JSON.stringify(signed_transacion),function(response){\n\n modal_html = '<p>Transaction id has been posted:'+response['tx']['hash']+'</p>';\n $(\"#confirmationModal .modal-body\").html(modal_html);\n $(\"#confirmationModal .modal-footer\").empty();\n $(\"#confirmationModal\").modal('show');\n\n },function(error){\n showError(error);\n })\n}", "function generateTransaction(data, gas) {\n\tlet transaction = {\n\t\tfrom: '127.0.0.1', // ip of the user\n\t\tmessage: data,\n\t\tgas,\n\t\tminedBy: '',\n\t\tblockNumber: 0\n\t}\n\n\tunprocessedTransactions.push(transaction)\n\tconst currentContent = JSON.parse(fs.readFileSync('transactions.json', 'utf-8'))\n\tcurrentContent.push(transaction)\n\tconst stringTransaction = JSON.stringify(currentContent, null, 2)\n\t// Save the transaction on the file\n\tfs.writeFileSync('transactions.json', stringTransaction)\n\t// Broadcast the transaction to the ofther users connected to the node\n\twsServer.sendAllMessage(stringTransaction)\n\tif(isMining) mineBlock()\n}", "toSign(type, data) {\n const t = enums.signature;\n\n switch (type) {\n case t.binary:\n if (data.text !== null) {\n return util.encodeUtf8(data.getText(true));\n }\n return data.getBytes(true);\n\n case t.text: {\n const bytes = data.getBytes(true);\n // normalize EOL to \\r\\n\n return util.canonicalizeEOL(bytes);\n }\n case t.standalone:\n return new Uint8Array(0);\n\n case t.certGeneric:\n case t.certPersona:\n case t.certCasual:\n case t.certPositive:\n case t.certRevocation: {\n let packet;\n let tag;\n\n if (data.userId) {\n tag = 0xB4;\n packet = data.userId;\n } else if (data.userAttribute) {\n tag = 0xD1;\n packet = data.userAttribute;\n } else {\n throw new Error('Either a userId or userAttribute packet needs to be ' +\n 'supplied for certification.');\n }\n\n const bytes = packet.write();\n\n return util.concat([this.toSign(t.key, data),\n new Uint8Array([tag]),\n util.writeNumber(bytes.length, 4),\n bytes]);\n }\n case t.subkeyBinding:\n case t.subkeyRevocation:\n case t.keyBinding:\n return util.concat([this.toSign(t.key, data), this.toSign(t.key, {\n key: data.bind\n })]);\n\n case t.key:\n if (data.key === undefined) {\n throw new Error('Key packet is required for this signature.');\n }\n return data.key.writeForHash(this.version);\n\n case t.keyRevocation:\n return this.toSign(t.key, data);\n case t.timestamp:\n return new Uint8Array(0);\n case t.thirdParty:\n throw new Error('Not implemented');\n default:\n throw new Error('Unknown signature type.');\n }\n }", "async sign(unsignedTx, txContext) {\n // this.connectedOrThrow(this);\n if (typeof txContext.path === 'undefined') {\n this.lastError = 'context should include the account path';\n throw new Error('context should include the account path');\n }\n // console.log('txContext', txContext);\n const bytesToSign = txs.getBytesToSign(unsignedTx, txContext);\n const response = await this.app.sign(txContext.path, bytesToSign);\n\n return response;\n }", "async function Transaction(wallet, signerAddress, msgs, fee, memo = \"\") {\n const cosmJS = await SigningStargateClient.connectWithSigner(\n tendermintRPCURL,\n wallet\n );\n return await cosmJS.signAndBroadcast(signerAddress, msgs, fee, memo);\n}", "function create_transaction(){\n\n var data_sent = {\n input_address: bitcoin_address,\n output_address:$(\"[name='recipient-bitcoin-address']\").val(),\n value: parseInt($(\"[name='amount']\").val())\n };\n\n unsigned_transaction={}\n ajaxPost('/blockcypher/create_transaction',JSON.stringify(data_sent), function(response){\n unsigned_transaction = response;\n $(\"#tosign-data\").text(unsigned_transaction.tosign[0]);\n $(\"#step-2\").removeAttr('hidden');\n\n\n },function(error){\n showError(error);\n });\n}", "sendTransaction(socket, transaction)\n {\n // .send funzione della libreria ws\n socket.send(JSON.stringify(\n { \n type: MESSAGE_TYPES.transaction,\n transaction\n }));\n }", "function createTransactionObjectJson(){\n var transObject = {};\n // get the from and to account\n transObject.from = document.getElementById('send_from_account').value;\n transObject.to = document.getElementById('send_to_account_value').value;\n // Get the value in ether and convert to wie\n var valueInEther = document.getElementById('send_value_in_ether').value\n var valueInWei = web3.toWei(valueInEther,'ether');\n transObject.value = valueInWei;\n // set the gas and gasPrice\n if(document.getElementById('send_gas').value !== 'default')\n transObject.gas = document.getElementById('send_gas').value;\n if(document.getElementById('send_gas_price').value !== 'default')\n transObject.gasPrice = document.getElementById('send_gas_price').value;\n // set the data\n if(document.getElementById('send_data').value !== 'default'){\n // convert the ascii to hex\n var data = document.getElementById('send_data').value;\n transObject.data = web3.toHex(data);\n }\n // set the nonce\n if(document.getElementById('send_nonce').value !== 'default')\n transObject.nonce = document.getElementById('send_nonce').value;\n\n return transObject;\n}", "signTransaction(transaction, from) {\n return privates.get(this).keyring.signTransaction(transaction, from);\n }", "async sign() {\n const { room, storage } = this.swap\n\n this.storage.update({\n isSignFetching: true,\n })\n\n await this.ethSwap.sign(\n {\n myAddress: storage.data.me.ethData.address,\n participantAddress: storage.data.participant.eth.address,\n },\n (signTransactionUrl) => {\n this.storage.update({\n signTransactionUrl,\n })\n }\n )\n\n this.storage.update({\n isSignFetching: false,\n isMeSigned: true,\n })\n\n room.sendMessage(storage.data.participant.peer, [\n {\n event: 'swap:signed',\n data: {\n orderId: storage.data.id,\n },\n },\n ])\n\n const { isMeSigned, isParticipantSigned } = this.storage.data\n\n if (isMeSigned && isParticipantSigned) {\n this.finishStep()\n }\n }", "async sendCUSD(){\n\n //Show the sending modal. \n this.setState({\n accountModalVisible : false,\n paymentsModalVisible : false,\n sendingModal : true,\n })\n\n /* Personal credentials to send CUSD. */\n let from_eth = this.state.publicKey\n let privateK = this.state.privateKey\n\n /* Person we will send eth to */\n let to_eth = this.state.eth_address\n \n // Amount to send. \n let amount = web3.utils.toWei(this.state.amount, 'ether')\n\n // // Ropsten URL \n let ropstenRPC = 'https://ropsten.infura.io/c7b70fc4ec0e4ca599e99b360894b699'\n\n // Create a Web3 instance with the url. \n let web3js = new web3(new web3.providers.HttpProvider(ropstenRPC));\n\n\n // Contract ABI’s\n let ABI = require(\"../contracts/MetaToken.json\");\n\n // Contract Ropsten Addresses\n let ADDRESS = \"0x67450c8908e2701abfa6745be3949ad32acf42d8\";\n\n let jsonFile = ABI;\n let abi = jsonFile.abi;\n let deployedAddress = ADDRESS;\n let cusd = new web3js.eth.Contract(abi, deployedAddress);\n\n\n //Create an ether wallet with the private key. \n let wallet = new ethers.Wallet(privateK)\n \n \n let to = cusd.options.address\n\n let data = cusd.methods.transfer(to_eth, amount).encodeABI()\n\n // let gasPrice = web3.utils.toWei('25', 'gwei')\n let gasPrice = await web3js.eth.getGasPrice()\n\n let gas = Math.ceil((await cusd.methods.transfer(to_eth, amount).estimateGas({ from: from_eth }))*1.2)\n \n // let nonce = await cusd.methods.replayNonce(from_eth).call();\n\n let nonce = await web3js.eth.getTransactionCount(from_eth);\n\n\n\n let transaction = {\n nonce: nonce,\n gasPrice: \"0x\" + gasPrice * 1.40, \n gasLimit: 2100000,\n to: to,\n value: 0,\n data: data,\n chainId: 3\n }\n \n // web3js.eth.signTransaction(tx, privateK).then((s) => {\n // console.log(s)\n // })\n \n \n\n //Sign promise. \n let signPromise = wallet.sign(transaction)\n\n \n\n // //Sign promise and return the transaction. \n signPromise.then((signedTransaction) => {\n\n\n web3js.eth.sendSignedTransaction(signedTransaction).on('receipt', (receipt) => { \n \n }).catch((err) => {\n \n }).then((final_receipt) => {\n\n //Make send success true. \n this.setState({\n sendSuccess : true \n })\n\n });\n\n })\n\n\n\n\n\n }", "async function sendTransaction(to, value, gasLimit, gasPrice) {\n const from = (await web3.eth.getAccounts())[0];\n web3.eth\n .sendTransaction({\n from,\n to,\n value,\n gas: gasLimit ? gasLimit : undefined,\n gasPrice: gasPrice ? gasPrice : undefined,\n })\n .on(\"transactionHash\", (transactionHash) => {\n window.web3gl.sendTransactionResponse = transactionHash;\n })\n .on(\"error\", (error) => {\n window.web3gl.sendTransactionResponse = error.message;\n });\n}", "function sign( file, key, publish, paymentIn, feeIn ){\n\n\tcheckForMissingArg( file, \"file\" );\n\tcheckForMissingArg( key, \"key\" );\n\n\tvar payment = (paymentIn == undefined) ? minimumPayment : paymentIn;\n\tvar fee = (feeIn == undefined) ? minimumFee : feeIn;\n\n\treturn send( key, file, payment, fee, publish );\n}", "async transfer({\n account,\n key\n }, {\n token,\n to,\n amount\n }) {\n let confirmSig = null;\n let from = account;\n let response = await this.client.request(\"transact\", {\n token,\n from,\n to,\n amount,\n confirmSig,\n }).catch(err => {\n throw err;\n });\n\n let json = response.result.result;\n if (!json) {\n throw \"Invalid transaction\";\n }\n let tx = Transaction.fromJSON(json);\n\n // let prefix = \"\\x19Ethereum Signed Message:\\n32\";\n // let txHashed = this.web3.utils.soliditySha3(prefix, tx.hash());\n let txHashed = tx.hash();\n let signature = await this.web3.eth.accounts.sign(txHashed, key).signature;\n tx.setSignature(signature);\n\n let signedTransaction = tx.toJSON();\n response = await this.client.request(\"submitTransact\", {\n signedTransaction,\n }).catch(err => {\n throw err;\n });\n\n // wait for the tx to be mined\n let found = -1;\n let blkNum;\n let root;\n let nTries = 0;\n while (found < 0 && nTries < 20) {\n await utils.sleep(500);\n // get latest block\n response = await this.client.request(\"getLatestBlock\", {}).catch(err => {\n throw err;\n });\n if (!response || !response.result || !response.result.result) {\n throw \"Blocks do not exist\";\n }\n let block = Block.fromJSON(response.result.result);\n blkNum = block.blockHeader.blockNumber;\n root = utils.addHexPrefix(block.blockHeader.merkleRoot);\n let txData = tx.data();\n found = block.transactions.findIndex(_tx => {\n return _tx === txData;\n });\n nTries += 1;\n }\n if (found < 0) {\n throw \"Transaction to confirm is not found or has yet been mined. This could mean that the transaction is not valid or insufficient balance.\";\n }\n let txIndex = found;\n\n // wait for the tx to be mined and then submit confirm signature\n // let confirmationHashed = this.web3.utils.soliditySha3(\n // prefix,\n // this.web3.utils.soliditySha3(tx.hash(), root),\n // );\n let confirmationHashed = this.web3.utils.soliditySha3(tx.hash(), root);\n let confirmSignature = await this.web3.eth.accounts.sign(confirmationHashed, key).signature;\n\n // submit confirm\n response = await this.client.request(\"confirmTx\", {\n blkNum,\n txIndex,\n confirmSignature,\n }).catch(err => {\n throw err;\n });\n\n return response;\n }", "function prepareTransaction() {\r\n let amountInt=0;\r\n if (amount.value == \"\") {\r\n amount.focus();\r\n return false;\r\n }\r\n amountInt = parseInt(amount.value);\r\n \r\n if (recipient == \"\") {\r\n recipient.focus();\r\n return false;\r\n }\r\n let recipientAdr = recipient.value;\r\n\r\n let pubkey = publickey.value;\r\n if (pubkey == \"\") {\r\n publickey.focus();\r\n return false;\r\n }\r\n let prvkey = privatekey.value;\r\n if (prvkey == \"\") {\r\n privatekey.focus();\r\n return false;\r\n }\r\n\r\n let ts = _getTimestamp();\r\n let due = network.value === 'T' ? 60 : 24 * 60;\r\n let deadline = ts + due * 60;\r\n const payload = \"4e454d20415049204578616d706c657320666f72206c6561726e696e67\"; //NEM API Examples for learning \r\n const fee = 500000;\r\n const typeTx = 257;\r\n let data = {\r\n \"transaction\": {\r\n \"timeStamp\": _getTimestamp(),\r\n \"amount\": amountInt,\r\n \"fee\": fee,\r\n \"recipient\": recipientAdr,\r\n \"type\": typeTx,\r\n \"deadline\": deadline,\r\n \"message\": {\r\n \"payload\": payload,\r\n \"type\": 1\r\n },\r\n \"version\": _getVersion(1),\r\n \"signer\": pubkey,\r\n \"mosaics\": []\r\n },\r\n \"privateKey\": prvkey\r\n };\r\n\r\n _doPost('/transaction/prepare-announce', data);\r\n }", "function signatureTx (state, tx, context) {\n let { signatoryIndex, signatures } = tx\n let { signingTx, signatoryKeys } = state\n\n if (signingTx == null) {\n throw Error('No pending outgoing transaction')\n }\n if (signingTx.signatures[signatoryIndex] != null) {\n throw Error('Signatures for this signatory already exist')\n }\n\n if (!Number.isInteger(signatoryIndex)) {\n throw Error('Invalid signatory index')\n }\n if (!Array.isArray(signatures)) {\n throw Error('\"signatures\" should be an array')\n }\n if (signatures.length !== signingTx.inputs.length) {\n throw Error('Incorrect signature count')\n }\n for (let signature of signatures) {\n if (!Buffer.isBuffer(signature)) {\n throw Error('Invalid signature')\n }\n }\n\n let signatorySet = getSignatorySet(context.validators)\n let signatory = signatorySet[signatoryIndex]\n if (signatory == null) {\n throw Error('Invalid signatory index')\n }\n let signatoryKey = signatoryKeys[signatory.validatorKey]\n\n // compute hashes that should have been signed\n let bitcoinTx = buildOutgoingTx(signingTx, context.validators, signatoryKeys)\n // TODO: handle dynamic signatory sets\n let p2ss = createWitnessScript(context.validators, signatoryKeys)\n let sigHashes = signingTx.inputs.map((input, i) =>\n bitcoinTx.hashForWitnessV0(i, p2ss, input.amount, bitcoin.Transaction.SIGHASH_ALL))\n\n // verify each signature against its corresponding sighash\n for (let i = 0; i < sigHashes.length; i++) {\n let sigHash = sigHashes[i]\n let signatureDER = signatures[i]\n let signature = secp256k1.signatureImport(signatureDER)\n if (!secp256k1.verify(sigHash, signature, signatoryKey)) {\n throw Error('Invalid signature')\n }\n }\n\n // sigs are valid, update signing state\n signingTx.signatures[signatoryIndex] = signatures\n signingTx.signedVotingPower += signatory.votingPower\n let votingPowerThreshold = getVotingPowerThreshold(signatorySet)\n if (signingTx.signedVotingPower >= votingPowerThreshold) {\n // done signing, now the tx is valid and can be relayed\n state.prevSignedTx = state.signedTx\n state.signedTx = signingTx\n state.signingTx = null\n\n // add change output to our UTXOs\n let txHash = bitcoinTx.getHash()\n let changeIndex = bitcoinTx.outs.length - 1\n let changeOutput = bitcoinTx.outs[changeIndex]\n state.utxos.push({\n txid: txHash,\n index: changeIndex,\n amount: changeOutput.value\n })\n state.processedTxs[txHash.toString('base64')] = true\n }\n }", "function get_message_to_sign(param_types, params, nonce, function_name, sender){\n params.push(nonce);\n param_types.push(\"uint256\");\n params.push(function_name);\n param_types.push(\"string\");\n //var encoded_a = abi.rawEncode([ \"address\",\"uint256\", \"string\"], [ wallet2, nonce, \"add_signer\" ]);\n let encoded_a = abi.rawEncode(param_types, params);\n //let encoded = abi.rawEncode([\"bytes\", \"address\"], [encoded_a, wallet1]);\n return abi.rawEncode([\"bytes\", \"address\"], [encoded_a, sender]);\n\n}", "function signAndSend (signer, { nonce }, status) {\n const { type, args } = this\n status({ events: [], status: { isInBlock:1 } })\n\n const user = _newUser(signer, { nonce }, status)\n if (!user) return console.error('NO USER', user)\n\n if (type === 'publishFeedAndPlan') _publishFeedAndPlan(user, { nonce }, status, args)\n else if (type === 'registerEncoder') _registerEncoder(user, { nonce }, status, args)\n else if (type === 'registerAttestor') _registerAttestor(user, { nonce }, status, args)\n else if (type === 'registerHoster') _registerHoster(user, { nonce }, status, args)\n else if (type === 'encodingDone') _encodingDone(user, { nonce }, status, args)\n else if (type === 'hostingStarts') _hostingStarts(user, { nonce }, status, args)\n else if (type === 'requestProofOfStorageChallenge') _requestProofOfStorageChallenge(user, { nonce }, status, args)\n else if (type === 'requestAttestation') _requestAttestation(user, { nonce }, status, args)\n else if (type === 'submitProofOfStorage') _submitProofOfStorage(user, { nonce }, status, args)\n else if (type === 'submitAttestationReport') _submitAttestationReport(user, { nonce }, status, args)\n // else if ...\n}", "send() {\n // Disable send button;\n this.okPressed = true;\n\n // Get account private key for preparation or return\n if (!this._Wallet.decrypt(this.common)) return this.okPressed = false;\n\n // Prepare the transaction\n let entity = this.prepareTransaction();\n\n // Use wallet service to serialize and send\n this._Wallet.transact(this.common, entity).then(() => {\n this._$timeout(() => {\n // Reset all\n this.init();\n return;\n });\n }, () => {\n this._$timeout(() => {\n // Delete private key in common\n this.common.privateKey = '';\n // Enable send button\n this.okPressed = false;\n return;\n });\n });\n }", "sign(accountKey) {\n const block = this.params;\n if(!('type' in block) || !(block.type in TYPES))\n throw new FieldError('type');\n\n const fields = Object.keys(REQUIRED_FIELDS).reduce((out, param) => {\n if(REQUIRED_FIELDS[param].types.indexOf(TYPES[block.type]) !== -1) out.push(param);\n return out;\n }, []);\n\n const header = Uint8Array.from([\n 0x52, // magic number\n 0x43, // 43 for mainnet, 41 for testnet\n 0x05, // version max\n 0x05, // version using\n 0x01, // version min\n 0x03, // type (3 = publish)\n 0x00, // extensions 16-bits\n TYPES[block.type], // extensions 16-bits ( block type )\n ]);\n\n const values = concat_uint8(fields.map(field => {\n if(!(field in block))\n throw new FieldError(field)\n\n const value = hex_uint8(valueForHash(field, block[field]));\n if(value.length !== REQUIRED_FIELDS[field].length)\n throw new FieldError(field);\n\n return value;\n }));\n\n const context = blake2bInit(32, null);\n blake2bUpdate(context, values);\n const hash = blake2bFinal(context);\n\n const signature = nacl.sign.detached(hash, hex_uint8(accountKey));\n const work = hex_uint8(block.work).reverse();\n\n return {\n msg: [ header, values, signature, work ].map(part => uint8_hex(part)).join(''),\n hash: uint8_hex(hash)\n };\n }", "async txSubmit(signedTx) {\n const txBody = {\n tx: signedTx.value,\n mode: 'async',\n };\n const url = `${GAIA_NODE_URL_LSD}/txs`;\n // const url = 'https://phobos.cybernode.ai/lcd/txs';\n console.log(JSON.stringify(txBody));\n return axios.post(url, JSON.stringify(txBody)).then(\n (r) => r,\n (e) => wrapError(this, e)\n );\n }", "signTransaction(address, tx) {\n return new Promise((resolve, reject) => {\n this.unlock()\n .then((status) => {\n setTimeout((_) => {\n trezor_connect_1.default.ethereumSignTransaction({\n path: this._pathFromAddress(address),\n transaction: {\n to: this._normalize(tx.to),\n value: this._normalize(tx.value),\n data: this._normalize(tx.data),\n chainId: tx._chainId,\n nonce: this._normalize(tx.nonce),\n gasLimit: this._normalize(tx.gasLimit),\n gasPrice: this._normalize(tx.gasPrice),\n },\n })\n .then((response) => {\n if (response.success) {\n tx.v = response.payload.v;\n tx.r = response.payload.r;\n tx.s = response.payload.s;\n const signedTx = new ethereumjs_tx_1.default(tx);\n const addressSignedWith = ethUtil.toChecksumAddress(`0x${signedTx.from.toString('hex')}`);\n const correctAddress = ethUtil.toChecksumAddress(address);\n if (addressSignedWith !== correctAddress) {\n reject(new Error('signature doesnt match the right address'));\n }\n resolve(signedTx);\n }\n else {\n reject(new Error((response.payload && response.payload.error) ||\n 'Unknown error'));\n }\n })\n .catch((e) => {\n reject(new Error((e && e.toString()) || 'Unknown error'));\n });\n // This is necessary to avoid popup collision\n // between the unlock & sign trezor popups\n }, status === 'just unlocked' ? DELAY_BETWEEN_POPUPS : 0);\n })\n .catch((e) => {\n reject(new Error((e && e.toString()) || 'Unknown error'));\n });\n });\n }", "async function cancelTransaction(data) {\n const { sender, receiver } = data;\n let base58publicKey = new PublicKey(\n \"9Ayh2hS3k5fTn6V9Ks7NishUp5Jz19iosK3tYPAcNhsp\"\n );\n const senderaddress = new PublicKey(sender);\n const recepientaddress = new PublicKey(data.receiver);\n let validProgramAddress_pub = await PublicKey.findProgramAddress(\n [senderaddress.toBuffer()],\n base58publicKey\n );\n const validProgramAddress = validProgramAddress_pub[0].toBase58();\n\n //sender and receiver address\n\n let sender_recipient_pub = await PublicKey.findProgramAddress(\n [senderaddress.toBuffer(), recepientaddress.toBuffer()],\n base58publicKey\n );\n\n const senderPda = sender_recipient_pub[0].toBase58();\n const PROGRAM_ID = \"9Ayh2hS3k5fTn6V9Ks7NishUp5Jz19iosK3tYPAcNhsp\";\n const instruction = new TransactionInstruction({\n keys: [\n {\n pubkey: new PublicKey(sender),\n isSigner: true,\n isWritable: true,\n },\n {\n pubkey: new PublicKey(receiver), //recipient\n isSigner: false,\n isWritable: true,\n },\n {\n // master pda\n pubkey: validProgramAddress,\n isSigner: false,\n isWritable: true,\n },\n {\n // data storage pda\n pubkey: senderPda,\n isSigner: false,\n isWritable: true,\n },\n {\n pubkey: SystemProgram.programId, //system program required to make a transfer\n isSigner: false,\n isWritable: false,\n },\n ],\n programId: new PublicKey(PROGRAM_ID),\n data: encodeCancelInstructionData(data),\n });\n const transaction = new Transaction().add(instruction);\n const connection = new Connection(clusterApiUrl(\"devnet\"));\n const signerTransac = async () => {\n try {\n transaction.recentBlockhash = (\n await connection.getRecentBlockhash()\n ).blockhash;\n transaction.feePayer = window.solana.publicKey;\n const signed = await window.solana.signTransaction(transaction);\n const signature = await connection.sendRawTransaction(signed.serialize());\n const finality = \"confirmed\";\n await connection.confirmTransaction(signature, finality);\n return signature;\n } catch (e) {\n console.warn(e);\n return false;\n }\n };\n signerTransac();\n}", "signTypedData (withAccount, typedData) {\n const wallet = this._getWalletForAccount(withAccount)\n const privKey = ethUtil.toBuffer(wallet.getPrivateKey())\n const sig = sigUtil.signTypedData(privKey, { data: typedData })\n return Promise.resolve(sig)\n }", "async send (inputs, outputs, replaceable = true, locktime = null) {\n assert(typeof replaceable === 'boolean', 'replaceable flag must be a boolean')\n\n const rawTx = await this.client.createRawTransaction(inputs, outputs, locktime, replaceable)\n const signedTx = await this.client.signRawTransactionWithWallet(rawTx)\n const txid = await this.client.sendRawTransaction(signedTx.hex)\n\n return txid\n }", "function submitTransactionPrivateData(config, userName, contractName, contractMethod, args, privateData) {\n return __awaiter(this, void 0, void 0, function () {\n var gateway, network, contract, tx, privateDataJSON, error_2;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, connectToGateway(userName, config)];\n case 1:\n gateway = _a.sent();\n return [4 /*yield*/, gateway.getNetwork(String(config.channel))];\n case 2:\n network = _a.sent();\n _a.label = 3;\n case 3:\n _a.trys.push([3, 6, , 7]);\n contract = network.getContract(contractName);\n tx = contract.createTransaction(contractMethod);\n if (privateData != null) {\n privateDataJSON = JSON.parse(privateData);\n tx.setTransient({\n encryptedData: Buffer.from(privateDataJSON.encryptedData),\n key: Buffer.from(privateDataJSON.key),\n iv: Buffer.from(privateDataJSON.iv)\n });\n }\n // Submit the transaction to hyperledger\n return [4 /*yield*/, tx.submit.apply(tx, args)];\n case 4:\n // Submit the transaction to hyperledger\n _a.sent();\n console.log(\"Transaction \" + tx.getTransactionID + \" has been submitted\");\n // Disconnect from the gateway.\n return [4 /*yield*/, gateway.disconnect()];\n case 5:\n // Disconnect from the gateway.\n _a.sent();\n return [3 /*break*/, 7];\n case 6:\n error_2 = _a.sent();\n throw error_2;\n case 7: return [2 /*return*/];\n }\n });\n });\n}", "function testSign(data) {\n return arCrypt.sign(orgSignKey,data);\n}", "uploadWalletTransaction(payload) {\n return this.request.post(``, payload);\n }", "function withdrawTokens() {\n newSender.setAddress(document.getElementById(\"public_key_input\").value);\n var toAddress = web3.utils.toChecksumAddress(newContract.getAddress());\n var fromAddress = web3.utils.toChecksumAddress(newSender.getAddress());\n var output_string = \"\";\n try {\n web3.eth.getBalance(toAddress, function(error, wei) {\n if (!error) {\n\n var de2 = newContract.getContractInstanceObject().methods.withdrawEther(fromAddress, wei).encodeABI();\n try {\n web3.eth.getGasPrice(function(error, gas_price) {\n console.log(\"Gas price: \" + gas_price);\n if (!error) {\n web3.eth.getBlock(\"latest\", function(error, block) {\n if (!error) {\n var transaction_object = {\n chainId: newBlockchain.getChainId(),\n from: newSender.getAddress(),\n gasPrice: gas_price,\n gas: block.gasLimit,\n to: toAddress,\n data: de2\n };\n web3.eth.accounts.signTransaction(transaction_object, document.getElementById(\"private_key_input\").value, function(error, signed_tx) {\n if (!error) {\n web3.eth.sendSignedTransaction(signed_tx.rawTransaction, function(error, sent_tx) {\n if (!error) {\n console.log(\"Send signed transaction success:\\n\" + sent_tx);\n } else {\n console.log(\"Send signed transaction failed:\\n\" + error);\n }\n });\n } else {\n console.log(error);\n }\n });\n\n } else {\n console.log(error);\n }\n });\n\n } else {\n console.log(error);\n }\n });\n } catch (err) {\n console.log(err);\n }\n\n\n } else {\n console.log(\"Error obtaining balance from contract\");\n }\n });\n } catch (err) {\n console.log(err);\n }\n}", "async function transfer(fromAddress,privateKeyFrom,toAddress,tokenCount){\n if(!web3.utils.checkAddressChecksum(fromAddress)){\n console.log(\"CheckSum Failed:\" + fromAddress);\n throw(\"CheckSum Failed\");\n }\n if(!web3.utils.checkAddressChecksum(toAddress)){\n console.log(\"CheckSum Failed:\" + toAddress);\n throw(\"CheckSum Failed\");\n }\n let gasLimit = await contract.methods.transfer(toAddress,tokenCount).estimateGas({\"from\":fromAddress});\n return promise = new Promise( (resolve,reject)=>{ \n try{\n \n //Documentation Link : https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#signtransaction\n var rawTx = {\n \"from\": fromAddress,\n \"gasLimit\": web3.utils.toHex(gasLimit),\n \"to\": contractAddress,\n \"value\": \"0x0\",\n \"data\": contract.methods.transfer(toAddress,tokenCount).encodeABI(),\n };\n \n web3.eth.accounts.signTransaction(rawTx,privateKeyFrom,(err,result) =>{\n if(err){\n console.log(\"Error during Signing : \" + err);\n reject(err);\n }\n else{\n web3.eth.sendSignedTransaction(result.rawTransaction,(err,hash)=>{\n if(err){\n console.log(\"Error during sending signed Tx : \" + err);\n reject(err);\n }\n else{\n console.log(\"*****************************\")\n console.log(\"Transaction Success!\");\n console.log(\"From: \" + fromAddress);\n console.log(\"To: \" + toAddress);\n console.log(\"Transaction Hash : \" + hash);\n console.log(\"*****************************\")\n resolve(hash);\n }\n })\n }\n } );\n \n }catch(err){\n console.log(\"Error in Transaction: \" + err);\n reject(err);\n }\n });\n}", "signTypedData (withAccount, typedData) {\n const wallet = this._getWalletForAccount(withAccount)\n const privKey = ethUtil.toBuffer(wallet.getPrivateKey())\n const signature = sigUtil.signTypedData(privKey, { data: typedData })\n return Promise.resolve(signature)\n }", "signTransaction (address, tx) {\n const wallet = this._getWalletForAccount(address)\n var privKey = wallet.getPrivateKey()\n tx.sign(privKey)\n return Promise.resolve(tx)\n }", "async function sendTransactionManual(web3, params, promiEvent) {\n debug(\"executing manually!\");\n //set up ethers provider\n const ethersProvider = new ethers.providers.Web3Provider(\n web3.currentProvider\n );\n //let's clone params and set it up properly\n const { transaction, from } = setUpParameters(params, web3);\n //now: if the from address is in the wallet, web3 will sign the transaction before\n //sending, so we have to account for that\n const account = web3.eth.accounts.wallet[from];\n const ethersSigner = account\n ? new ethers.Wallet(account.privateKey, ethersProvider)\n : ethersProvider.getSigner(from);\n debug(\"got signer\");\n let txHash, receipt, ethersResponse;\n try {\n //note: the following code won't work with ethers v5.\n //wth ethers v5, in the getSigner() case, you'll need to\n //use sendUncheckedTransaction instead of sendTransaction.\n //I don't know why.\n ethersResponse = await ethersSigner.sendTransaction(transaction);\n txHash = ethersResponse.hash;\n receipt = await ethersProvider.waitForTransaction(txHash);\n debug(\"no error\");\n } catch (error) {\n ({ txHash, receipt } = handleError(error));\n if (!receipt) {\n receipt = await ethersProvider.waitForTransaction(txHash);\n }\n }\n debug(\"txHash: %s\", txHash);\n receipt = translateReceipt(receipt);\n promiEvent.setTransactionHash(txHash); //this here is why I wrote this function @_@\n return await handleResult(receipt, transaction.to == null);\n}", "async function transferTokens() {\n var transfer_tokens_button = document.querySelector('#transfer_tokens');\n transfer_tokens_button.disable = true;\n transfer_tokens_button.innerText = \"Single-use button only; please refresh page and use new external account if you want to transfer more tokens\"\n transfer_tokens_button.disable = true;\n newSender.setAddress(document.getElementById(\"public_key_input\").value);\n var toAddress = web3.utils.toChecksumAddress(newContract.getAddress());\n var fromAddress = web3.utils.toChecksumAddress(newSender.getAddress());\n var output_string = \"\";\n while (true) {\n if (!newDataset.isWaiting()) {\n newDataset.wait();\n if (!newDataset.isEmpty()) {\n var newOneHundredItems = new OneHundredItems();\n while(!newOneHundredItems.isReady()){\n var data = newDataset.getNextItem();\n newOneHundredItems.setAddress(data[0]);\n newOneHundredItems.setAmount(data[1]);\n }\n if (newOneHundredItems.isReady()) {\n var de = newContract.getContractInstanceObject().methods.bulkSendEth(newOneHundredItems.getAddresses(), newOneHundredItems.getAmounts()).encodeABI();\n var toAmount = newOneHundredItems.getTotalValuePerHundred();\n try {\n web3.eth.getGasPrice(function(error, gas_price) {\n console.log(\"Gas price: \" + gas_price);\n if (!error) {\n web3.eth.getBlock(\"latest\", function(error, block) {\n if (!error) {\n var transaction_object = {\n chainId: newBlockchain.getChainId(),\n from: newSender.getAddress(),\n gasPrice: gas_price,\n gas: block.gasLimit,\n to: toAddress,\n value: toAmount,\n data: de\n };\n web3.eth.accounts.signTransaction(transaction_object, document.getElementById(\"private_key_input\").value, function(error, signed_tx) {\n if (!error) {\n web3.eth.sendSignedTransaction(signed_tx.rawTransaction, function(error, sent_tx) {\n if (!error) {\n waitBlock(signed_tx.transactionHash, toAddress, toAmount);\n } else {\n console.log(\"*\\nSend signed transaction failed: \" + error);\n newDataset.go();\n }\n });\n } else {\n console.log(error);\n }\n });\n\n } else {\n console.log(error);\n }\n });\n\n } else {\n console.log(error);\n }\n });\n } catch (err) {\n console.log(err);\n }\n newOneHundredItems.flush();\n } else {\n console.log(\"Still adding items ...\" + JSON.stringify(newOneHundredItems.getAddresses()));\n await sleep(1000);\n }\n\n } else {\n console.log(\"Finished sending transactions\");\n break;\n }\n\n } else {\n console.log(\"Waiting for most recent transaction to be included in a block ...\");\n await sleep(1000);\n }\n }\n}", "async function sign_tx(api, settings){\n var xrp_secret = document.getElementById(\"xrp_secret\");\n var xrp_address = document.getElementById(\"xrp_address\");\n var eth_address = document.getElementById(\"eth_address\")\n var keyPair = {}\n\n // generate the keyPair to use for signing purposes, \n // either from the private key, or the secret, \n // depending on what was specified\n if (offline_api.isValidSecret(xrp_secret.value)) {\n // a secret key was specified\n keyPair = offline_api.deriveKeypair(xrp_secret.value);\n } else {\n // a private key was specified (either 64 chars, or 66 chars\n // as either secp256k1 [prefix 00] or ed255519 [prefix ED])\n const privateKey = xrp_secret.value.length == 64 ? '00' + xrp_secret.value : xrp_secret.value\n keyPair = {\n privateKey: privateKey,\n publicKey: privateKey.slice(2) == 'ED' \n ? 'ED' + bytesToHex(ed25519.keyFromSecret(privateKey.slice(2)).pubBytes())\n : bytesToHex(secp256k1.keyFromPrivate(privateKey.slice(2)).getPublic().encodeCompressed())\n }\n }\n\n const instructions = settings.offline ? {\n fee : settings.fee,\n sequence : settings.sequence,\n maxLedgerVersion : settings.maxLedgerVersion\n } : {};\n\n // Specified xrp address or convert secret to public address\n const xrp_addr = settings.specify_account ?\n xrp_address.value :\n offline_api.deriveAddress(keyPair.publicKey);\n\n // Eth address to message key\n const message_key = ('02' + (new Array(25).join(\"0\")) + eth_address.value.substr(2)).toUpperCase()\n\n // Create AccountSet transaction, setting the message key, and sign\n const prepared = await api.prepareSettings(xrp_addr, {messageKey: message_key}, instructions)\n return api.sign(prepared.txJSON, keyPair)\n}", "function sign(params) {\n params.key = key;\n params.timestamp = Math.round(new Date().getTime());\n params.signature = crypto.createHmac('sha256', secret).update(params.key + params.timestamp).digest('hex');\n return params;\n}", "function addTransaction(tx) {\n if (!$scope.account.Balance) {\n // if account is unfunded, then there is no need to ask user for a key\n // Add transaction to the queue.\n // (Will be submitted as soon as account gets funding)\n var item = {\n tx_json: tx.tx_json,\n type: tx.tx_json.TransactionType\n };\n\n // Additional details depending on a transaction type\n if ('TrustSet' === item.type) {\n item.details = tx.tx_json.LimitAmount;\n }\n\n var saveTx = function(e1, r1) {\n if (e1) {\n console.warn(e1);\n return;\n }\n $scope.userBlob.unshift('/clients/rippletradecom/txQueue', item);\n };\n\n if ($scope.userBlob.data && !$scope.userBlob.data.clients) {\n // there is bug in RippleLib with unshift operation - if \n // there is empty nodes in the path, it tries to create array node,\n // and nothing gets created under it, so create '/clients' explicitly\n $scope.userBlob.set('/clients', { rippletradecom: {} }, saveTx);\n } else if ($scope.userBlob.data && $scope.userBlob.data.clients && _.isArray($scope.userBlob.data.clients)) {\n // if '/clients' already set to array, clear it\n $scope.userBlob.unset('/clients', function(e, r) {\n if (e) return;\n $scope.userBlob.set('/clients', { rippletradecom: {} }, saveTx);\n });\n } else {\n saveTx();\n }\n } else {\n // Get user's secret key\n keychain.requestSecret(id.account, id.username, function(err, secret) {\n if (err) {\n console.log('client: txQueue: error while unlocking wallet: ', err);\n return;\n }\n\n var transaction = ripple.Transaction.from_json(tx.tx_json);\n\n transaction.remote = network.remote;\n transaction.secret(secret);\n\n api.getUserAccess().then(function(res) {\n // If account is funded submit the transaction right away\n transaction.submit();\n }, function(err2) {\n // err\n });\n\n });\n }\n }", "newTransaction(publicKey, nonce, recipient, amount = 0.0, data = null, signature) {\n var sender_addr = utils.getAddress(publicKey);\n var txn_str = utils.transactionToString(sender_addr, nonce, recipient, amount, data);\n var txn_id = utils.hash(txn_str);\n var transaction = this.currentTransactionById(txn_id);\n if(!transaction) {\n if(utils.verifySign(publicKey, txn_str, signature)) {\n transaction = {\n sender: sender_addr,\n nonce: nonce,\n recipient: recipient,\n amount: amount,\n data: data,\n timestamp: utils.timestamp(),\n publicKey: publicKey,\n signature: signature,\n id: txn_id\n };\n this.currentTransactions.push(transaction);\n } else {\n throw('Signature invalid');\n }\n }\n return transaction;\n }", "async function sendCoins() {\n if (typeof window.ethereum !== 'undefined') {\n await requestAccount()\n const provider = new ethers.providers.Web3Provider(window.ethereum);\n const signer = provider.getSigner();\n const contract = new ethers.Contract(bvgTokenAddress, BVGToken.abi, signer);\n // We parse the amount to be sent. eg : amount of BVG to be sent = ethers.utils.parseEther(amount BVG written on the UI)\n // since BVG and Ether has the same decimal 18\n // For a token with another value of the decimal, we should update our parse method\n const parsedAmount = ethers.utils.parseEther(amount);\n const transation = await contract.transfer(userAccount, parsedAmount);\n await transation.wait();\n console.log(`${ethers.utils.formatEther(parsedAmount)} BVG successfully sent to ${userAccount}`);\n }\n }", "sign(dataHash) {\n return this.keyPair.sign(dataHash);\n }", "async function makeRawTransaction(web3, fromAddr, contractAddress, nonce, abi) {\n\n //let chainId = '5777'; //ganache\n let chainId = '5'; //testnet : goerli \n let gasPriceGwei = web3.utils.toWei('2', 'gwei');\n let gasLimit = 210000;\n\n let rawTransaction = {\n \"from\": fromAddr,\n \"nonce\": \"0x\" + nonce.toString(16),\n \"gasPrice\": web3.utils.toHex(gasPriceGwei),\n \"gasLimit\": web3.utils.toHex(gasLimit),\n \"to\": contractAddress,\n \"value\": \"0x0\",\n \"data\": abi,\n \"chainId\": web3.utils.toHex(chainId)\n };\n\n return rawTransaction;\n}", "function sendTransaction(tx, txOptions) {\n if (txOptions === void 0) { txOptions = {}; }\n return __awaiter(this, void 0, void 0, function () {\n var txParams, gas, inflactionFactor, _a, _b, promiEvent;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n txParams = {\n from: txOptions.from,\n gasCurrency: txOptions.gasCurrency,\n gasPrice: '0',\n };\n gas = txOptions.estimatedGas;\n if (!(gas === undefined)) return [3 /*break*/, 2];\n inflactionFactor = txOptions.gasInflationFactor || 1;\n _b = (_a = Math).round;\n return [4 /*yield*/, tx.estimateGas(txParams)];\n case 1:\n gas = _b.apply(_a, [(_c.sent()) * inflactionFactor]);\n debug('estimatedGas: %s', gas);\n _c.label = 2;\n case 2:\n promiEvent = tx.send({\n from: txOptions.from,\n // @ts-ignore\n gasCurrency: txOptions.gasCurrency,\n // TODO needed for locally signed tx, ignored by now (celo-blockchain with set it)\n // gasFeeRecipient: txOptions.gasFeeRecipient,\n gas: gas,\n // Hack to prevent web3 from adding the suggested gold gas price, allowing geth to add\n // the suggested price in the selected gasCurrency.\n // TODO this won't work for locally signed TX\n gasPrice: '0',\n });\n return [2 /*return*/, tx_result_1.toTxResult(promiEvent)];\n }\n });\n });\n}", "async function createTransaction() {\n // Get a fee estimate from Smart Fee:\n const smartFeeResponse = await request({\n url: `https://api.smartfee.live/latest`,\n headers: {\n 'X-API-KEY': smartFeeApiKey\n }\n })\n const smartFeeResponseObject = JSON.parse(smartFeeResponse)\n // Use the 2-block target.\n const twoBlockFeeRateSatsPerKb = smartFeeResponseObject.feeByBlockTarget[\"2\"]\n\n\n // Send a BitGo transaction with a custom fee rate:\n const wallet = await bitgo.coin('tbtc').wallets().get({ id: WALLET_ID })\n const sendParams = {\n feeRate: twoBlockFeeRateSatsPerKb,\n // TODO: replace below with your transaction info:\n /*\n recipients: [{\n amount: 0.01 * 1e8,\n address: '2NFfxvXpAWjKng7enFougtvtxxCJ2hQEMo4',\n }, {\n amount: 0.01 * 1e8,\n address: '2MsMFw75RKRiMb548q6W4jrJ63jwvvDdR2w',\n }],\n walletPassphrase: 'secretpassphrase1a5df8380e0e30'\n */\n }\n const result = await wallet.sendMany(sendParams)\n console.dir(result)\n}", "async function testTokenSend(token_to_ota_addr, token_to_ota, stamp, stampHoderKeystore, tokenHoderKeystore) {\n console.log(\"testTokenSend...\");\n let cxtInterfaceCallData = TokenInstance.otatransfer.getData(token_to_ota_addr, token_to_ota, 888);\n\n let otaSet = web3.wan.getOTAMixSet(stamp, 8);\n console.log(\"fetch ota stamp set: \",otaSet);\n\n let otaSetBuf = [];\n for(let i=0; i<otaSet.length; i++){\n let rpkc = new Buffer(otaSet[i].slice(2,68),'hex');\n let rpcu = secp256k1.publicKeyConvert(rpkc, false);\n otaSetBuf.push(rpcu);\n }\n\n let otaSk = wanUtil.computeWaddrPrivateKey(stamp, stampHoderKeystore.privKeyA,stampHoderKeystore.privKeyB);\n let otaPub = wanUtil.recoverPubkeyFromWaddress(stamp);\n\n let ringArgs = wanUtil.getRingSign(new Buffer(tokenHoderKeystore.address.slice(2),'hex'), otaSk,otaPub.A,otaSetBuf);\n if(!wanUtil.verifyRinSign(ringArgs)){\n console.log(\"ring sign is wrong@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\");\n return;\n }\n let KIWQ = generatePubkeyIWQforRing(ringArgs.PubKeys,ringArgs.I, ringArgs.w, ringArgs.q);\n let glueContractDef = web3.eth.contract([{\"constant\":false,\"type\":\"function\",\"inputs\":[{\"name\":\"RingSignedData\",\"type\":\"string\"},{\"name\":\"CxtCallParams\",\"type\":\"bytes\"}],\"name\":\"combine\",\"outputs\":[{\"name\":\"RingSignedData\",\"type\":\"string\"},{\"name\":\"CxtCallParams\",\"type\":\"bytes\"}]}]);\n let glueContract = glueContractDef.at(\"0x0000000000000000000000000000000000000000\");\n let combinedData = glueContract.combine.getData(KIWQ, cxtInterfaceCallData);\n //let all = TokenInstance.\n var serial = '0x' + web3.eth.getTransactionCount(tokenHoderKeystore.address).toString(16);\n var rawTx = {\n Txtype: '0x06',\n nonce: serial,\n gasPrice: gGasPrice,\n gasLimit: gGasLimit,\n to: TokenAddress,\n value: '0x00',\n data: combinedData\n };\n console.log(\"payload: \" + rawTx.data.toString('hex'));\n\n var tx = new Tx(rawTx);\n tx.sign(tokenHoderKeystore.privKeyA);\n var serializedTx = tx.serialize();\n let hash = web3.eth.sendRawTransaction('0x' + serializedTx.toString('hex'));\n console.log(\"serializeTx:\" + serializedTx.toString('hex'));\n console.log('tx hash:'+hash);\n let receipt = await getTransactionReceipt(hash);\n console.log(receipt);\n console.log(\"Token balance of \",token_to_ota_addr, \" is \", TokenInstance.otabalanceOf(token_to_ota_addr).toString(), \"key is \", TokenInstance.otaKey(token_to_ota_addr));\n}", "function Transaction() {\n if (!(this instanceof Transaction)) {\n return new Transaction();\n }\n this.Type = DEFAULT_TYPE;\n this.PayloadVer = PAYLOAD_VERSION;\n this.LockTime = DEFAULT_NLOCKTIME;\n this.Attributes = [];\n this.UTXOInputs = [];\n this.Outputs = [];\n this.CrossChainAsset = [];\n this.Programs = [];\n this.Amount = undefined;\n this.Memo = undefined;\n this.Fee = undefined;\n this.json = undefined;\n this.rawTx = undefined;\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 saveSigning() {\t\n saveToServer();\n}", "stake(amount) {\n const self = this;\n assert_1.assert.isBigNumber('amount', amount);\n const functionSignature = 'stake(uint256)';\n return {\n sendTransactionAsync(txData, opts = { shouldValidate: true }) {\n return __awaiter(this, void 0, void 0, function* () {\n const txDataWithDefaults = yield self._applyDefaultsToTxDataAsync(Object.assign({ data: this.getABIEncodedTransactionData() }, txData), this.estimateGasAsync.bind(this));\n if (opts.shouldValidate !== false) {\n yield this.callAsync(txDataWithDefaults);\n }\n return self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);\n });\n },\n awaitTransactionSuccessAsync(txData, opts = { shouldValidate: true }) {\n return self._promiseWithTransactionHash(this.sendTransactionAsync(txData, opts), opts);\n },\n estimateGasAsync(txData) {\n return __awaiter(this, void 0, void 0, function* () {\n const txDataWithDefaults = yield self._applyDefaultsToTxDataAsync(Object.assign({ data: this.getABIEncodedTransactionData() }, txData));\n return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);\n });\n },\n callAsync(callData = {}, defaultBlock) {\n return __awaiter(this, void 0, void 0, function* () {\n base_contract_1.BaseContract._assertCallParams(callData, defaultBlock);\n const rawCallResult = yield self._performCallAsync(Object.assign({ data: this.getABIEncodedTransactionData() }, callData), defaultBlock);\n const abiEncoder = self._lookupAbiEncoder(functionSignature);\n base_contract_1.BaseContract._throwIfUnexpectedEmptyCallResult(rawCallResult, abiEncoder);\n return abiEncoder.strictDecodeReturnValue(rawCallResult);\n });\n },\n getABIEncodedTransactionData() {\n return self._strictEncodeArguments(functionSignature, [amount]);\n },\n };\n }", "async signData(privateKey, data) {\n const hash = createKeccakHash('keccak256').update(data).digest()\n \n const sig = EllipticCurve.sign(hash, ethUtil.toBuffer(\"0x\" + privateKey)); \n return [...sig.signature, sig.recovery + 27];\n }", "function rawSubmitChainso(thisbtn, network) {\n\t$(thisbtn).val('Please wait, loading...').attr('disabled',true);\n\ttxhex = $(\"#rawTransaction\").val().trim();\n\t$.ajax({\n\t\ttype: \"GET\",\n\t\turl: `https://`+ multiWalletApiDomain +`/chainso/broadcast/${network}/${txhex}`,\n\t\terror: function(data) {\n\t\t\tif(data) {\n\t\t\t\tvar txid = data; // is this right?\n\t\t\t\t$(\"#rawTransactionStatus\").addClass('alert-success').removeClass('alert-danger').removeClass(\"hidden\").html(' TXID: ' + txid.responseText + '<br> <a href=\"https://chain.so/tx/'+network+'/' + txid.responseText + '\" target=\"_blank\">View on Blockchain Explorer</a>');\n\t\t\t} else {\n\t\t\t\t$(\"#rawTransactionStatus\").addClass('alert-danger').removeClass('alert-success').removeClass(\"hidden\").html(' Unexpected error, please try again').prepend('<span class=\"glyphicon glyphicon-exclamation-sign\"></span>');\n\t\t\t}\n\t\t},\n\t\tsuccess: function(data) {\n\t\t\tif(data) {\n\t\t\t\tvar txid = data; // is this right?\n\t\t\t\t$(\"#rawTransactionStatus\").addClass('alert-success').removeClass('alert-danger').removeClass(\"hidden\").html(' TXID: ' + txid.responseText + '<br> <a href=\"https://chain.so/tx/'+network+'/' + txid.responseText + '\" target=\"_blank\">View on Blockchain Explorer</a>');\n\t\t\t} else {\n\t\t\t\t$(\"#rawTransactionStatus\").addClass('alert-danger').removeClass('alert-success').removeClass(\"hidden\").html(' Unexpected error, please try again').prepend('<span class=\"glyphicon glyphicon-exclamation-sign\"></span>');\n\t\t\t}\n\t\t},\n\t\tcomplete: function (data, status) {\n\t\t\t$(\"#rawTransactionStatus\").fadeOut().fadeIn();\n\t\t\t$(thisbtn).val('Submit').attr('disabled',false);\n\t\t}\n\t});\n\t/* $(thisbtn).val('Please wait, loading...').attr('disabled',true);\n\t$.ajax ({\n\ttype: \"POST\",\n\turl: \"https://chain.so/api/v2/send_tx/\"+network+\"/\", // Fix me\n\tdata: {\"tx_hex\":$(\"#rawTransaction\").val()},\n\tdataType: \"json\",\n\terror: function(data) {\n\tvar obj = $.parseJSON(data.responseText);\n\tvar r = ' ';\n\tr += (obj.data.tx_hex) ? obj.data.tx_hex : '';\n\tr = (r!='') ? r : ' Failed to broadcast'; // build response\n\t$(\"#rawTransactionStatus\").addClass('alert-danger').removeClass('alert-success').removeClass(\"hidden\").html(r).prepend('<span class=\"glyphicon glyphicon-exclamation-sign\"></span>');\n},\nsuccess: function(data) {\nif(data.status && data.data.txid) {\n$(\"#rawTransactionStatus\").addClass('alert-success').removeClass('alert-danger').removeClass(\"hidden\").html(' TXID: ' + data.data.txid + '<br> <a href=\"https://chain.so/tx/'+network+'/' + data.data.txid + '\" target=\"_blank\">View on Blockchain Explorer</a>');\n} else {\n$(\"#rawTransactionStatus\").addClass('alert-danger').removeClass('alert-success').removeClass(\"hidden\").html(' Unexpected error, please try again').prepend('<span class=\"glyphicon glyphicon-exclamation-sign\"></span>');\n}\n},\ncomplete: function(data, status) {\n$(\"#rawTransactionStatus\").fadeOut().fadeIn();\n$(thisbtn).val('Submit').attr('disabled',false);\n}\n}); */\n}", "function shovelToBitcoin(message) {\n //TODO: for now assume ascii text, later need to distinguish from hex string\n //console.log(`shoveling to bitcoin >${message}<`);\n let split = utils.splitString(message)\n console.log(split)\n\n if (!DEBUG) {\n datapay.send({\n data: split,\n pay: { key: wallet.wif }\n }, function sendResult(err,txid) {\n if (err) {\n console.log(err);\n }\n if (txid) {\n console.log(`txid:${txid}`);\n }\n });\n }\n //TODO:could raise event saying that tx was sent\n}", "signTransfer(unsigned_txset, export_raw) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield this.request(\"sign_transfer\", {\n unsigned_txset,\n export_raw,\n });\n });\n }", "addWalletTransaction(payload) {\n return this.request.post('transaction', payload);\n }" ]
[ "0.7808991", "0.7243803", "0.7177426", "0.7037895", "0.69075143", "0.68765384", "0.6782755", "0.67223024", "0.6698356", "0.6698356", "0.6660681", "0.6656824", "0.6370981", "0.63476235", "0.6275696", "0.6179538", "0.6166933", "0.61061424", "0.60243094", "0.6010027", "0.5988504", "0.5988504", "0.5980418", "0.5948927", "0.5948927", "0.5910973", "0.591017", "0.5875914", "0.5848215", "0.5837803", "0.58196974", "0.5817135", "0.57921284", "0.57905775", "0.57804674", "0.57685274", "0.5756891", "0.57511836", "0.5737883", "0.57172734", "0.57172734", "0.56978214", "0.5687067", "0.5659658", "0.56534666", "0.5645872", "0.5639859", "0.56386584", "0.56057435", "0.55969214", "0.55811536", "0.55771345", "0.55607235", "0.553971", "0.55200166", "0.55195093", "0.55105567", "0.5509362", "0.5497847", "0.54791397", "0.5466016", "0.54430217", "0.5390671", "0.538946", "0.53836435", "0.53834385", "0.53814137", "0.538033", "0.5379461", "0.5373031", "0.53531957", "0.53521264", "0.5346588", "0.5342468", "0.5335794", "0.5329593", "0.53261936", "0.53213435", "0.53005904", "0.5284807", "0.52775604", "0.5276905", "0.52709633", "0.52697283", "0.52254933", "0.52196634", "0.52194774", "0.52181166", "0.5200912", "0.52008754", "0.5195996", "0.5190753", "0.5188624", "0.51831615", "0.5177033", "0.51749265", "0.51699096", "0.5135881", "0.51299644", "0.510993" ]
0.7201386
2
construct object, with constructor function constructor is so obverious
function Person(firstName, lastName, dob){ this.firstName = firstName; this.lastName = lastName; this.dob = new Date(dob); this.getBirthYear = function(){ return this.dob.getFullYear(); } this.getFullName = function(){ return `${this.firstName} ${this.lastName}`; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructur() {}", "function construct() { }", "function Constructor() {}", "function Constructor() {}", "function Constructor() {}", "function _ctor() {\n\t}", "function _construct()\n\t\t{;\n\t\t}", "function Ctor() {}", "construct (target, args) {\n return new target(...args)\n }", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor (){}", "constructor( ) {}", "constructor() {\n copy(this, create());\n }", "function NewObj(){}", "consructor() {\n }", "function construct(constructor, args) {\n var c = function () {\n return constructor.apply(this, args);\n };\n c.prototype = constructor.prototype;\n return new c();\n }", "function construct(constructor, args) {\n var c = function () {\n return constructor.apply(this, args);\n };\n c.prototype = constructor.prototype;\n return new c();\n }", "function tempCtor() {}", "function Ctor() {\r\n }", "function construct(constructor, argList) {\r\n for (var argNames = '', i = argList.length; i--;) {\r\n argNames += (argNames ? ',a' : 'a') + i;\r\n }\r\n return Function(argNames, 'return new this(' + argNames + ')').apply(constructor, argList);\r\n }", "function construct(constructor, args) {\n var c = function () {\n return constructor.apply(this, args);\n };\n c.prototype = constructor.prototype;\n return new c();\n }", "function construct(constructor, args) {\n var c = function () {\n return constructor.apply(this, args);\n };\n c.prototype = constructor.prototype;\n return new c();\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() {}", "new() {\n let newInstance = Object.create(this);\n\n newInstance.init(...arguments);\n\n return newInstance;\n }", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function construct(constructor, args) {\n var c = function () {\n return new constructor();\n // return constructor.apply(this, args);\n };\n c.prototype = constructor.prototype;\n return new c();\n }", "function _constructor(dom) {\n\t\tthis.dom = dom;\n\t\t// capture 'this'\n\t\tlet thiz = this;\n\n\t\t_init.call(thiz);\n\n\t\t_setObserver.call(thiz);\n\n\t\t_getOptions.call(thiz);\n\n\t\t_setListeners.call(thiz);\n\n\t\treturn thiz;\n\t}", "function temporaryConstructor() {}", "function construct(constructor, args) {\n\t function F() {\n\t return constructor.apply(this, args);\n\t }\n\t F.prototype = constructor.prototype;\n\t return new F();\n\t}", "function HelperConstructor() {}", "Constructor(args, returns, options = {}) {\r\n return { ...options, kind: exports.ConstructorKind, type: 'constructor', arguments: args, returns };\r\n }", "function NewObj() {}", "constructor() {\n\t\t// ...\n\t}", "function funConstructor(arg1, arg2) {\n this.fname = arg1;\n this.lname = arg2;\n}", "function Constructor() {\n // All construction is actually done in the init method\n if ( this.initialize )\n this.initialize.apply(this, arguments);\n }", "function Ctor() {\n\t// Empty...\n}", "function createObj(a, b)\n{\n //var newObject = {}; // Not needed ctor function\n this.a = a; //newObject.a = a;\n this.b = b; //newObject.b = b;\n //return newObject; // Not needed for ctor function\n}", "function construct(constructor, args) {\n var c = function () {\n return constructor.apply(this, args);\n };\n c.prototype = constructor.prototype;\n var instance = new c();\n instance._serviceUrl = serviceUrl;\n return instance;\n }", "function construct(args) {\n args = args.map(deserialize);\n var constructor = args[0];\n\n // The following code solves the problem of invoking a JavaScript\n // constructor with an unknown number arguments.\n // First bind the constructor to the argument list using bind.apply().\n // The first argument to bind() is the binding of 'this', make it 'null'\n // After that, use the JavaScript 'new' operator which overrides any binding\n // of 'this' with the new instance.\n args[0] = null;\n var factoryFunction = constructor.bind.apply(constructor, args);\n return serialize(new factoryFunction());\n }", "function construct(ctor, args) {\r\n function F() {\r\n return ctor.apply(this, args);\r\n }\r\n F.prototype = ctor.prototype;\r\n return new F();\r\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "constructor(){\r\n }", "function Construct(o) {\n var F = function () {};\n F.prototype = o;\n var that = new F();\n that.id = uuidv4();\n that.print = function(){console.log(that);};\n return that;\n}", "function construct(constructor, args) {\n function F() {\n constructor.apply(this, args);\n }\n F.prototype = constructor.prototype;\n return new F();\n }", "constructor(x, y) { // Constructor function to initialize new instances.\n this.x = x; // This keyword is the new object being initialized.\n this.y = y; // Store function arguments as object properties.\n }", "static create () {}", "constructor(){\r\n\t}", "function construct(/*name, */constructor, args) {\n function F() {\n return constructor.apply(this, args);\n }\n F.prototype = constructor.prototype;\n return new F();\n /*\n this[name] = function() {\n return constructor.apply(this, args);\n };\n this[name].prototype = constructor.prototype;\n return new this[name]();\n */\n}" ]
[ "0.83247906", "0.8264945", "0.78754985", "0.78754985", "0.78754985", "0.7595078", "0.7570385", "0.7475717", "0.72375315", "0.72144437", "0.72144437", "0.72144437", "0.72144437", "0.72144437", "0.72144437", "0.72144437", "0.7148642", "0.71142364", "0.7107709", "0.7094159", "0.7087945", "0.7086212", "0.7056463", "0.6996127", "0.69837505", "0.69806916", "0.69689643", "0.69689643", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6960477", "0.6929583", "0.6928365", "0.6928365", "0.6928365", "0.6928365", "0.6928365", "0.6928365", "0.6928352", "0.6926664", "0.69080716", "0.6890577", "0.68806654", "0.6821315", "0.6818037", "0.67774403", "0.67687684", "0.67644435", "0.6759591", "0.6758314", "0.675591", "0.67538154", "0.6734486", "0.67204195", "0.67204195", "0.67204195", "0.67204195", "0.67204195", "0.67204195", "0.67204195", "0.67204195", "0.67204195", "0.66831094", "0.66768485", "0.6668813", "0.66618973", "0.6654679", "0.66428804", "0.66411996" ]
0.0
-1
The dummy class constructor
function Class() { // All construction is actually done in the init method if ( !initializing && this.init ) this.init.apply(this, arguments); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructur() {}", "function DummyClass() {\r\n // All construction is actually done in the construct method\r\n if ( !init && this.construct )\r\n this.construct.apply(this, arguments);\r\n }", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "function Constructor() {}", "function Constructor() {}", "function 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() {}", "constructor() {}", "constructor() {}", "function _ctor() {\n\t}", "function Ctor() {\n\t// Empty...\n}", "function Ctor() {}", "function Ctor() {\r\n }", "function _construct()\n\t\t{;\n\t\t}", "function HelperConstructor() {}", "consructor() {\n }", "constructor() {\n\t\t// ...\n\t}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "function tempCtor() {}", "function construct() { }", "function temporaryConstructor() {}", "constructor() {\r\n // ohne Inhalt\r\n }", "constructor(){\r\n }", "function SimpleClass() {\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(){\r\n\t}", "constructor() {\r\n }", "constructor() {\n\t}", "constructor() {\n\t}", "constructor(data) { }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }", "constructor() {\n }" ]
[ "0.83117235", "0.8150335", "0.8125716", "0.8125716", "0.8125716", "0.8125716", "0.8125716", "0.8125716", "0.8125716", "0.81216276", "0.81216276", "0.81216276", "0.80153376", "0.80066764", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7822476", "0.7804496", "0.7792796", "0.77391064", "0.75758344", "0.7529224", "0.7496081", "0.74399453", "0.7405994", "0.74001706", "0.74001706", "0.74001706", "0.74001706", "0.74001706", "0.74001706", "0.73304474", "0.73304474", "0.73304474", "0.73304474", "0.73304474", "0.73304474", "0.73304474", "0.73304474", "0.73304474", "0.73304474", "0.73304474", "0.7300504", "0.72488594", "0.7130759", "0.7126093", "0.7071154", "0.70354575", "0.70098794", "0.69566053", "0.6950232", "0.69419897", "0.69419897", "0.69357425", "0.6926384", "0.6926384", "0.6926384", "0.6926384", "0.6926384", "0.6926384", "0.6926384", "0.6926384", "0.6926384", "0.6926384", "0.6926384", "0.6926384", "0.6926384", "0.6926384", "0.6926384" ]
0.0
-1
alias transcendable > transcends server and client, javascript and php, ajax act()s on it when done, html can refer to it via callMethod()
function Stateable(arr,realThis) { var that = realThis != undefined ? realThis : this; this.objectId = -1; // necessary to receive html events - stored when object displays received html (on act) - also re-stored again on re-creation when deserializing an already stored object. // if parent is declared it is also a registered listener of html events after the child event method is called - see Stateable.callMethod() this.parentObjectId = -1; this.did = 0; this.selectorStatus = ""; // a text status if some user error and we dont need to refresh entire slector html - just the error message this.embeddedHTML = ""; // stored on deserialization, some objects are embedded and will therefore never get their act called. this.wrapperId = ""; // embeddedHTML elem(a Stateable object embedded inside another Stateable object has a placeHolder - so to show the child it is just a matter of setting the innerHTML - no ajax send - or playing with dialogs) this.dialogType = 1; // should be moved to a class called Selector All selectors should have an associated dialog object or type so when their dialog is created, setDialog knows what type to use. var html = ""; // stored on act() this.getDialogType = function() { return that.dialogType; } this.setDialogType = function(t) { that.dialogType = t; } this.getSelectorStatus = function() { // MUST use "this" instead of "that" here - I dont know why it works right here "that" will fail and return only LOCAL snapshot version - i.e. 0 // I think what is happeneing is "this" is really the subclass version, ie the version of this being passed is from the subclass only populated if // deseriliazeAndPopulateFrom() method was called with an object i.e. meaning we got the object from the server return that.selectorStatus; }; this.setSelectorStatus = function(s) { this.selectorStatus = s; }; this.showStatus = function(s) { // warning! clears existing status variable so it will not be displayed again unless set by server again if (document.getElementById("selectorStatus") == undefined) { if (that.selectorStatus != "") { var d = new Dialog(); d.showMessage("Error",that.selectorStatus,"ok"); } return; } if (s) { document.getElementById("selectorStatus").innerHTML = s; } else if (that.getSelectorStatus() != "") { // put this in super document.getElementById("selectorStatus").innerHTML = that.getSelectorStatus(); } else { document.getElementById("selectorStatus").innerHTML = ""; } this.setSelectorStatus(""); } Stateable.prototype.act = function(data) { }; /** Stateable.prototype.getName = function() { if (this.className != undefined) { return this.className; } if (this.name != undefined) { return this.name; } return ""; }; */ // only serializables that can receive the ajax can be aborted, therefore this is here and not in Serializable Stateable.prototype.aborted = function() { // an ajax return was aborted due to global server error handler or local handler flagged. // do screen cleanup any button re-enabling here - no resend. That should be decided in a timeout method var d = new Dialog(); d.showMessage("Request Timed Out","Please try your request again. Internet traffic is high.","Ok"); return; }; this.store = function(refresh) { // when new version of the SAME object (e same object ID) is deserialized we do not want the NEW version stored here - rather we merge new into old, see populateFrom(). // certin stateales A that contain Stateable B may have B initialized at the server so when B acts and wants to store itself // it will store itself with the empty string as it will not have an objectId!!!! The way we stop that automatically is // by sensing here in THIS function. If object does not have an object ID and it is being stored, then we know it was created at the server // so, let's give it its client-side unique objectId NOW - then we can store it! (objectId could not be set at the server) that.setObjectId(); // Does NOT set if it is already set! if (!(("A"+that.objectId) in Stateable.storedObjects) || Stateable.storedObjects["A"+that.objectId] == null) { Stateable.storedObjects["A"+that.getObjectId()] = that; } // alert("CLASS.store(): A"+that.getObjectId()); if (refresh != undefined) { that.setRefresh(refresh); } }; this.unstore = function() { // garbage collect - used when Stateables contain Stateables, upon closing the parent, parent should call unstore on all its child stateables if (("A"+that.objectId) in Stateable.storedObjects) { delete(Stateable.storedObjects["A"+that.getObjectId()]); } that.setRefresh(false); } this.setRefresh = function(refreshable) { if (refreshable != undefined && refreshable) { if (!(("A"+that.objectId) in Stateable.refreshableObjects) || Stateable.refreshableObjects["A"+that.objectId] == null) { Stateable.refreshableObjects["A"+that.getObjectId()] = that; } } else if ( ("A"+that.getObjectId()) in Stateable.refreshableObjects) { delete(Stateable.refreshableObjects["A"+that.getObjectId()]); } }; // by setting parent ID it is like registering a listener // as any html event that calls the parent via Stateable.callMethod() (the only way) will trigger that same event to be passed // to childEvent(methodName,arg1,arg2,arg3...) on the parent. this.setParentObjectId = function(id) { this.parentObjectId = id; } this.getParentObjectId = function() { return that.parentObjectId; } this.isEmbedded = function() { return (this.parentObjectId > 0 && !Utils.isEmpty(that.wrapperId) ); } this.clearParent = function() { this.parentObjectId = -1; } this.getParent = function() { return Stateable.getById(that.parentObjectId); } this.setObjectId = function() { if (that.objectId != undefined && !isNaN(that.objectId) && that.objectId > 0) { // safety, should only be set once return that.objectId; } that.objectId = Stateable.storedObjectsTotal; Stateable.storedObjectsTotal++; return that.objectId; }; this.getObjectId = function() { // MUST use "this" instead of "that" here - I dont know why it works right here "that" will fail and return only LOCAL snapshot version - i.e. 0 // I think what is happeneing is "this" is really the subclass version, ie the version of this being passed is from the subclass only populated if // deseriliazeAndPopulateFrom() method was called with an object i.e. meaning we got the object from the server return that.setObjectId(); }; this.superAct = function(data) { if ("html" in data) { html = data.html; } }; this.setLastHTML = function(h) { html = h; } this.getLastHTML = function() { return html; } this.superShow = function(type,noIScroll) { if (!Utils.isEmpty(html)) { if (type != undefined) { setDialog(html,null,null,type,noIScroll); // noIscroll as some dialogs like search have its own iscrolls on the search result and selected result columns g(dialogHTML,dialog,silent,type,noIScroll) } else { setDialog(html); } return true; } return false; }; this.getEmbeddedHTML = function() { return that.embeddedHTML; } this.setEmbeddedHTML = function() { if (Utils.isEmpty(that.wrapperId)) { return; } that.embeddedHTML = document.getElementById(that.wrapperId).innerHTML; } this.setWrapperId = function(id) { that.wrapperId = id; } this.showEmbedded = function() { if (("task" in that) && ("html" in that.task) && ("getClassName" in that) && (document.getElementById(that.getClassName()) != undefined)) { document.getElementById(that.getClassName()).innerHTML = that.task["html"]; // alert("class.js.showEmbedded() this option should not be used"); // admin add products still uses this it may be ok... return; } if (Utils.isEmpty(that.wrapperId) || document.getElementById(that.wrapperId) == undefined) { return; } document.getElementById(that.wrapperId).innerHTML = that.getEmbeddedHTML(); } this.hideEmbedded = function() { that.setEmbeddedHTML(); if (Utils.isEmpty(that.wrapperId) || document.getElementById(that.wrapperId) == undefined) { return; } if (Utils.isEmpty(h)) { return; } Utils.setInnerHTML(document.getElementById(that.wrapperId),emptyHTML); } this.isShowingEmbedded = function() { return !Utils.isEmpty(that.wrapperId) && document.getElementById(that.wrapperId) != undefined && !Utils.isEmpty(document.getElementById(that.wrapperId).innerHTML); } // if the object was not found we create it and STORE it too as it was clearly needed to be stored if this method was called Stateable.getCreateStore = function(type) { for (var i in Stateable.storedObjects) { if (Stateable.storedObjects[i] instanceof eval(type)) { //alert("OLD:"+type+" objectId:"+Stateable.storedObjects[i].objectId); return Stateable.storedObjects[i]; } } var newObj = eval("new "+type+"()"); newObj.store(); //alert("NEW:"+type+" objectId:"+newObj.objectId); return newObj; }; Stateable.getById = function(id) { if (id != -1 && Stateable.storedObjects["A"+id] != undefined && Stateable.storedObjects["A"+id] != "") { return Stateable.storedObjects["A"+id]; } else { return false; } }; // RENAME TO: showOrCreateSendAct() get it it if here - perform send if not or if no show method in subclass // warning this WILL use the stored object of passed type if here and if no show method exists, a send will be performed. Stateable.getAndShow = function(type,arg) { for (var i in Stateable.storedObjects) { if (Stateable.storedObjects[i] instanceof eval(type)) { // is there a show method? if ("show" in Stateable.storedObjects[i]) { if (arg == undefined) { Stateable.storedObjects[i].show(); } else { Stateable.storedObjects[i].show(arg); } } else if (arg != undefined) { Stateable.storedObjects[i].send(arg); } else { Stateable.storedObjects[i].send(); } return; } } var newObj = eval("new "+type+"()"); if (arg != undefined) { newObj.send(arg); } else { newObj.send(); } } // 1) gets or creates an object of the passed subclass type // 2) calls the subclass send() method - assumes subclass HAS a send method! If not, some defualt send here should be performed Stateable.send = function(type,arg) { for (var i in Stateable.storedObjects) { if (Stateable.storedObjects[i] instanceof eval(type)) { //alert("OLD:"+type+" objectId:"+Stateable.storedObjects[i].objectId); if (arg != undefined) { Stateable.storedObjects[i].send(arg); } else { Stateable.storedObjects[i].send(); } return; } } var newObj = eval("new "+type+"()"); if (arg != undefined) { newObj.send(arg); } else { newObj.send(); } }; // 1) gets or creates an object of the passed subclass type // 2) calls the subclass send() method - assumes subclass HAS a send method! If not, some defualt send here should be performed Stateable.refresh = function(type,args) { for (var i in Stateable.refreshableObjects) { // setTimeout(function() {Stateable.send("RegionHistorySelector");},200); // REFRESH regionHistorySelector in case publishable privacy state has changed if (type == undefined || !(type) || Stateable.refreshableObjects[i] instanceof eval(type)) { // setTimeout("Stateable.refreshableObjects['"+i+"'].refresh("+(args == undefined ? "" : args)+")",200); Stateable.refreshableObjects[i].refresh(args); } } }; // RESTORING all vars in arr to what they were - is performed in Serializable via populateFrom - and takes care of this subclass - however after that is done, there may be some // post processing needed - but since javascript sucks for being able to overload methods like a postProcess() which would trickle up to all super classes - instead, for now, we sense for some items in arr and do this processing now // VERY IMPORTANT!!!!!! deserializing creates a NEW object so if the former version of this object was previously stored - (ie same objectId) // while we want to retain the original and do a populateFrom() adding the new, // we CAN'T store this NEW object with the SAME objectId that it had here and now because // the FIRST object in the chain is deserialized - like all the objects under it - however, // when complete the act() of the top object via deserializeAdnPopulateFrom() will next call populateFrom USING the EXISTING top object which referenced deserialize in the first place!!!! // so the top object is exempt from checking to see if it already exists - as it was the top object that already existsed that called deserialize // hence the problem remains with only the embedded STateables being deserialized - but are also stored herein. // The solution is now in populateFrom(newlyDeserializedObject) whereby if any of the newly deserilaized embedded objects exist, // the existing will be embedded and will get IT'S populateFrom called using the newly deserialized same type object as the argument // The alternative is for all subclasses to retore themselves but what a drag for the same for loop to appear in each subclass - and you could not depend on "this" variables to limit the scope to the class so you would need // a bunch of conditionals for each variable to restore! // Setting store herein using the NEW would fail as new object would not have the local vars that old object had - even more when the old object is the base // all old "that" vars are lost upon next get - so getAndShow() will get a bad version of the object // anyway we redesigned store so it will not store if the object is already there. // so now we have the best solution for when embedding stateable objects inside other stateables - when they are deserialized, we get their contents via sensing in Serializable.populateFrom() // objectId is the ONLY var that can't be started on a server, so if server-side object is first constructed there then when arriving here it will have an objectIf of 0 or -1 // In that case, a new objectId should be created here or on store(). // this should not make a difference because caller is in the middle of a deseriliazation so we have noi access to the ORIGINAL objectId - "this" is just a NEW object about to get the contents of arr // so no need to set itsobjetId to that orf thsi which has an objectId that will never be used by anyone!!! if (arr != undefined && (typeof arr == 'array' || typeof arr == 'object') && ("objectId" in arr)) { if (parseInt(arr["objectId"]) < 1) { arr["objectId"] = this.setObjectId(); // the objectId in arr will be used to set this.objectId when populateFrom is called in the next line of the sub classes constructor - so make SURE we set the arr.objectId now too!!! } // however, setting this.objectID now at all is really unnecessary as store could do it - with the premise that we only need an objectId once store is called. else { this.setObjectId(); } } else { this.setObjectId(); // fucking javascript - only vars from sublcasses are included in "this", functions are not - functions of a subclass are not accessible from the superclass. Bravo javascript - NOT } // NOW that all properties and methods are defined, call super Serializable.call(that,arr); //this.superConstructor.call(that,arr); <== "this" is the subclass as we called Stateable using the subclass "this" via "call" so the code on the left will call stateable in infinite recursion!!!! // NOW perform any additional actions you want to perform in subclass that depend on supercalss being complete //if (realThis != undefined) { // Stateable.getById(realThis.getObjectId()).test(); //} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TransformedAjaxCommand(xslt, xml, templParms, handler)\n{\n\tPromise.apply(this);\n\tif(handler) this.setOnAvail(handler);\n\n\tvar self = this;\n\tthis.xsltSource = new TemplateQuery(xslt, function(xslt)\n\t{\n\t\tself.onLoaded(xslt, xml);\n\t});\n}", "function EngineWrapper(adapter) {\n var AjaxEngine = function () {\n function AjaxEngine() {\n _classCallCheck(this, AjaxEngine);\n\n this.requestHeaders = {};\n this.readyState = 0;\n this.timeout = 0; // 0 stands for no timeout\n this.responseURL = \"\";\n this.responseHeaders = {};\n }\n\n _createClass(AjaxEngine, [{\n key: \"_call\",\n value: function _call(name) {\n this[name] && this[name].apply(this, [].splice.call(arguments, 1));\n }\n }, {\n key: \"_changeReadyState\",\n value: function _changeReadyState(state) {\n this.readyState = state;\n this._call(\"onreadystatechange\");\n }\n }, {\n key: \"open\",\n value: function open(method, url) {\n this.method = method;\n if (!url) {\n url = location.href;\n } else {\n url = util.trim(url);\n if (url.indexOf(\"http\") !== 0) {\n // Normalize the request url\n if (isBrowser) {\n var t = document.createElement(\"a\");\n t.href = url;\n url = t.href;\n }\n }\n }\n this.responseURL = url;\n this._changeReadyState(1);\n }\n }, {\n key: \"send\",\n value: function send(arg) {\n var _this = this;\n\n arg = arg || null;\n var self = this;\n if (adapter) {\n var request = {\n method: self.method,\n url: self.responseURL,\n headers: self.requestHeaders || {},\n body: arg\n };\n util.merge(request, self._options || {});\n if (request.method === \"GET\") {\n request.body = null;\n }\n self._changeReadyState(3);\n var timer = void 0;\n self.timeout = self.timeout || 0;\n if (self.timeout > 0) {\n timer = setTimeout(function () {\n if (self.readyState === 3) {\n _this._call(\"onloadend\");\n self._changeReadyState(0);\n self._call(\"ontimeout\");\n }\n }, self.timeout);\n }\n request.timeout = self.timeout;\n adapter(request, function (response) {\n\n function getAndDelete(key) {\n var t = response[key];\n delete response[key];\n return t;\n }\n\n // If the request has already timeout, return\n if (self.readyState !== 3) return;\n clearTimeout(timer);\n\n // Make sure the type of status is integer\n self.status = getAndDelete(\"statusCode\") - 0;\n\n var responseText = getAndDelete(\"responseText\");\n var statusMessage = getAndDelete(\"statusMessage\");\n\n // Network error, set the status code 0\n if (!self.status) {\n self.statusText = responseText;\n self._call(\"onerror\", { msg: statusMessage });\n } else {\n // Parsing the response headers to array in a object, because\n // there may be multiple values with the same header name\n var responseHeaders = getAndDelete(\"headers\");\n var headers = {};\n for (var field in responseHeaders) {\n var value = responseHeaders[field];\n var key = field.toLowerCase();\n // Is array\n if ((typeof value === \"undefined\" ? \"undefined\" : _typeof(value)) === \"object\") {\n headers[key] = value;\n } else {\n headers[key] = headers[key] || [];\n headers[key].push(value);\n }\n }\n var cookies = headers[\"set-cookie\"];\n if (isBrowser && cookies) {\n cookies.forEach(function (e) {\n // Remove the http-Only property of the cookie\n // so that JavaScript can operate it.\n document.cookie = e.replace(/;\\s*httpOnly/ig, \"\");\n });\n }\n self.responseHeaders = headers;\n // Set the fields of engine from response\n self.statusText = statusMessage || \"\";\n self.response = self.responseText = responseText;\n self._response = response;\n self._changeReadyState(4);\n self._call(\"onload\");\n }\n self._call(\"onloadend\");\n });\n } else {\n console.error(\"Ajax require adapter\");\n }\n }\n }, {\n key: \"setRequestHeader\",\n value: function setRequestHeader(key, value) {\n this.requestHeaders[util.trim(key)] = value;\n }\n }, {\n key: \"getResponseHeader\",\n value: function getResponseHeader(key) {\n return (this.responseHeaders[key.toLowerCase()] || \"\").toString() || null;\n }\n }, {\n key: \"getAllResponseHeaders\",\n value: function getAllResponseHeaders() {\n var str = \"\";\n for (var key in this.responseHeaders) {\n str += key + \":\" + this.getResponseHeader(key) + \"\\r\\n\";\n }\n return str || null;\n }\n }, {\n key: \"abort\",\n value: function abort(msg) {\n this._changeReadyState(0);\n this._call(\"onerror\", { msg: msg });\n this._call(\"onloadend\");\n }\n }], [{\n key: \"setAdapter\",\n value: function setAdapter(requestAdapter) {\n adapter = requestAdapter;\n }\n }]);\n\n return AjaxEngine;\n }();\n\n return AjaxEngine;\n}", "function EngineWrapper(adapter) {\n var AjaxEngine = function () {\n function AjaxEngine() {\n _classCallCheck(this, AjaxEngine);\n\n this.requestHeaders = {};\n this.readyState = 0;\n this.timeout = 0; // 0 stands for no timeout\n this.responseURL = \"\";\n this.responseHeaders = {};\n }\n\n _createClass(AjaxEngine, [{\n key: \"_call\",\n value: function _call(name) {\n this[name] && this[name].apply(this, [].splice.call(arguments, 1));\n }\n }, {\n key: \"_changeReadyState\",\n value: function _changeReadyState(state) {\n this.readyState = state;\n this._call(\"onreadystatechange\");\n }\n }, {\n key: \"open\",\n value: function open(method, url) {\n this.method = method;\n if (!url) {\n url = location.href;\n } else {\n url = util.trim(url);\n if (url.indexOf(\"http\") !== 0) {\n // Normalize the request url\n if (isBrowser) {\n var t = document.createElement(\"a\");\n t.href = url;\n url = t.href;\n }\n }\n }\n this.responseURL = url;\n this._changeReadyState(1);\n }\n }, {\n key: \"send\",\n value: function send(arg) {\n var _this = this;\n\n arg = arg || null;\n var self = this;\n if (adapter) {\n var request = {\n method: self.method,\n url: self.responseURL,\n headers: self.requestHeaders || {},\n body: arg\n };\n util.merge(request, self._options || {});\n if (request.method === \"GET\") {\n request.body = null;\n }\n self._changeReadyState(3);\n var timer = void 0;\n self.timeout = self.timeout || 0;\n if (self.timeout > 0) {\n timer = setTimeout(function () {\n if (self.readyState === 3) {\n _this._call(\"onloadend\");\n self._changeReadyState(0);\n self._call(\"ontimeout\");\n }\n }, self.timeout);\n }\n request.timeout = self.timeout;\n adapter(request, function (response) {\n\n function getAndDelete(key) {\n var t = response[key];\n delete response[key];\n return t;\n }\n\n // If the request has already timeout, return\n if (self.readyState !== 3) return;\n clearTimeout(timer);\n\n // Make sure the type of status is integer\n self.status = getAndDelete(\"statusCode\") - 0;\n\n var responseText = getAndDelete(\"responseText\");\n var statusMessage = getAndDelete(\"statusMessage\");\n\n // Network error, set the status code 0\n if (!self.status) {\n self.statusText = responseText;\n self._call(\"onerror\", { msg: statusMessage });\n } else {\n // Parsing the response headers to array in a object, because\n // there may be multiple values with the same header name\n var responseHeaders = getAndDelete(\"headers\");\n var headers = {};\n for (var field in responseHeaders) {\n var value = responseHeaders[field];\n var key = field.toLowerCase();\n // Is array\n if ((typeof value === \"undefined\" ? \"undefined\" : _typeof(value)) === \"object\") {\n headers[key] = value;\n } else {\n headers[key] = headers[key] || [];\n headers[key].push(value);\n }\n }\n var cookies = headers[\"set-cookie\"];\n if (isBrowser && cookies) {\n cookies.forEach(function (e) {\n // Remove the http-Only property of the cookie\n // so that JavaScript can operate it.\n document.cookie = e.replace(/;\\s*httpOnly/ig, \"\");\n });\n }\n self.responseHeaders = headers;\n // Set the fields of engine from response\n self.statusText = statusMessage || \"\";\n self.response = self.responseText = responseText;\n self._response = response;\n self._changeReadyState(4);\n self._call(\"onload\");\n }\n self._call(\"onloadend\");\n });\n } else {\n console.error(\"Ajax require adapter\");\n }\n }\n }, {\n key: \"setRequestHeader\",\n value: function setRequestHeader(key, value) {\n this.requestHeaders[util.trim(key)] = value;\n }\n }, {\n key: \"getResponseHeader\",\n value: function getResponseHeader(key) {\n return (this.responseHeaders[key.toLowerCase()] || \"\").toString() || null;\n }\n }, {\n key: \"getAllResponseHeaders\",\n value: function getAllResponseHeaders() {\n var str = \"\";\n for (var key in this.responseHeaders) {\n str += key + \":\" + this.getResponseHeader(key) + \"\\r\\n\";\n }\n return str || null;\n }\n }, {\n key: \"abort\",\n value: function abort(msg) {\n this._changeReadyState(0);\n this._call(\"onerror\", { msg: msg });\n this._call(\"onloadend\");\n }\n }], [{\n key: \"setAdapter\",\n value: function setAdapter(requestAdapter) {\n adapter = requestAdapter;\n }\n }]);\n\n return AjaxEngine;\n }();\n\n return AjaxEngine;\n}", "function js(obj,tx) {\n\t\t\tvar t = obj.getElementsByTagName('script');\n\t\t\tdeb('vai js '+t.length+' '+tx);\n\t\t\t//ie ignora script em ajax...\n\t\t\tif (t.length==0 && tx.indexOf('<script>')!=-1) {\n\t\t\t\tvar t = ''+tx;\n\t\t\t\twhile (t.indexOf('<script>')!=-1) {\n\t\t\t\t\tvar e = substrAtAt(t,'<script>','</script>');\n\t\t\t\t\tdeb('vai js IE... '+e);\n\t\t\t\t\teval(e);\n\t\t\t\t\tt = substrAt(t,'</script>');\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (var i=0;i<t.length;i++) {\n\t\t\t\ttry {\n\t\t\t\t\teval(t[i].innerHTML);\n\t\t\t\t} catch (e) {\n\t\t\t\t\talert('ajax erro: '+e+'\\n em javaScript:\\n '+troca(t[i].innerHTML,';',';\\n'));\n\t\t\t\t}\n\t\t\t}\n\t\t}", "toggleTranscript(){\n this.showTranscript = !this.showTranscript;\n this.generateToc();\n this.displayTranscript();\n }", "perform() {\r\n $.ajax(this.REQUEST)\r\n }", "function TreatJSOut() {\n if(!(this instanceof TreatJSOut)) return new TreatJSOut();\n}", "function IAjaxHttpHook() { }", "useAjax( ajax ) {\n this._ajax = ajax;\n }", "useAjax( ajax ) {\n this._ajax = ajax;\n }", "function Tr(t) {\n return new mr((function(e, n) {\n t.onsuccess = function(t) {\n var n = t.target.result;\n e(n);\n }, t.onerror = function(t) {\n var e = Nr(t.target.error);\n n(e);\n };\n }));\n}", "onClick(andThen) {\n let $self = $(`#${this.idDOM}`);\n $.ajax({\n url: '/Vuvuzela/services/article/actions.php',\n type: 'POST',\n data: {\n type: this.type,\n article: this.articleID,\n action: this.active ? 'remove' : 'add'\n },\n success: (message) => {\n if(message['status'] === 'error') {\n this.article.showError('Error cannot perform action');\n console.log(\"Error: \" + message['errorMsg']);\n } else if(message['status'] === 'success') {\n this.active = !this.active;\n $self.text(this.active ? this.activeText : this.inactiveText)\n }\n if(andThen !== undefined) andThen();\n },\n error: (jqXHR, textStatus, errorThrown ) => {\n this.article.showError('Error cannot perform action');\n console.log(\"Error: \" + errorThrown + \" \" + textStatus)\n },\n dataType: 'json'\n });\n }", "function microAjax(B,A){this.bindFunction=function(E,D){return function(){return E.apply(D,[D])}};this.stateChange=function(D){if(this.request.readyState==4){this.callbackFunction(this.request.responseText)}};this.getRequest=function(){if(window.ActiveXObject){return new ActiveXObject(\"Microsoft.XMLHTTP\")}else{if(window.XMLHttpRequest){return new XMLHttpRequest()}}return false};this.postBody=(arguments[2]||\"\");this.callbackFunction=A;this.url=B;this.request=this.getRequest();if(this.request){var C=this.request;C.onreadystatechange=this.bindFunction(this.stateChange,this);if(this.postBody!==\"\"){C.open(\"POST\",B,true);C.setRequestHeader(\"X-Requested-With\",\"XMLHttpRequest\");C.setRequestHeader(\"Content-type\",\"application/x-www-form-urlencoded\");C.setRequestHeader(\"Connection\",\"close\")}else{C.open(\"GET\",B,true)}C.send(this.postBody)}}", "function ajaxInvoke(phpFunction, searchParams, container, htmlOperation, lastLoadedVehicleId, limit)\n{\n $.ajax({\n url: url,\n data: { phpFunction: phpFunction, searchParams: searchParams, lastLoadedVehicleId: lastLoadedVehicleId, limit: limit},\n type: \"POST\",\n dataType: \"html\"\n }).done(function (output)\n {\n if (htmlOperation === \"html\") {\n $(\"#\" + container).html(output);\n }\n else if (htmlOperation === \"append\") {\n $(\"#\" + container).append(output);\n }\n });\n}", "performTransaction(){\n if(this.tps.hasTransactionToRedo()){\n this.view.enableRedoButton();\n }\n else{\n this.view.disableRedoButton();\n }\n if(this.tps.hasTransactionToUndo()){\n this.view.enableUndoButton();\n }\n else{\n this.view.disableUndoButton();\n }\n }", "transact(e) {\n const event = 'transact';\n if (!e || !e.ctx) {\n throw new TypeError(errors.redirectParams(event));\n }\n let msg = cct.tx('tx');\n const sTag = getTagName(e);\n if (sTag) {\n msg += cct.tx('(') + cct.value(sTag) + cct.tx(')');\n }\n if (e.ctx.finish) {\n msg += cct.tx('/end');\n } else {\n msg += cct.tx('/start');\n }\n if (e.ctx.finish) {\n const duration = formatDuration(e.ctx.finish - e.ctx.start);\n msg += cct.tx('; duration: ') + cct.value(duration) + cct.tx(', success: ') + cct.value(!!e.ctx.success);\n }\n print(e, event, msg);\n }", "function Adaptor() {}", "function posthtm(url, id, verbs, is) { //is null or 1\n var doc = $(\"#\"+id);\n load(id);\n //\tdoc.innerHTML='<span><img src=\"image/load.gif\"/>Loading...</span>';\n var xmlhttp = false;\n if (doc != null) {\n doc.css(\"visibility\",\"visible\");\n if (doc.css(\"visibility\") == \"visible\") {\n\t\t\t$.ajax({\n\t\t\t\ttype:'POST',\n\t\t\t\tdata:verbs,\n\t\t\t\turl:url,\n\t\t\t\tdataType:'html',\n\t\t\t\t//ifModified:true,\n\t\t\t\ttimeout:90000,\n\t\t\t\tsuccess: function(s){\n if (is || is == null) {\n doc.html(s);\n } else {\n var data = {};\n data = eval('(' + s + ')');\n doc.html(data.main);\n eval(data.js);\n }\n\t\t\t\t}\n\t\t\t});\n }\n }\n}", "function html() {\n\t// Your code here\n}", "function ajax2() {\n\n }", "function t(t,n,r){return r=p(n,r),this.on(\"click.pjax\",t,function(t){var n=r;n.container||(n=e.extend({},r),n.container=e(this).attr(\"data-pjax\")),a(t,n)})}", "function ajax ( type, fichier, variables /* , fonction */ ) \r\n{ \r\n\tif ( window.XMLHttpRequest ) var req = new XMLHttpRequest();\r\n\telse if ( window.ActiveXObject ) var req = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n\telse alert(\"Votre navigateur n'est pas assez récent pour accéder à cette fonction, ou les ActiveX ne sont pas autorisés\");\r\n\tif ( arguments.length==4 ) var fonction = arguments[3];\r\n\r\n\tif (type.toLowerCase()==\"post\") {\r\n\t\treq.open(\"POST\", _URL+fichier, true);\r\n\t\treq.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=iso-8859-1');\r\n\t\treq.send(variables);\r\n\t} else if (type.toLowerCase()==\"get\") {\r\n\t\treq.open('get', _URL+fichier+\"?\"+variables, true);\r\n\t\treq.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=iso-8859-1');\r\n\t\treq.send(null);\r\n\t} else { \r\n\t\talert(\"Méthode d'envoie des données invalide\"); \r\n\t}\r\n\r\n\treq.onreadystatechange = function() { \r\n\t\tif (req.readyState == 4 && req.responseText != null )\r\n\t\t{\t\t\t\t\r\n\t\t\tif (fonction) eval( fonction + \"('\"+escape(req.responseText)+\"')\");\r\n\t\t\t\r\n\t\t} \r\n\t}\r\n}", "function ajax ( type, fichier, variables /* , fonction */ ) \r\n{ \r\n\tif ( window.XMLHttpRequest ) var req = new XMLHttpRequest();\r\n\telse if ( window.ActiveXObject ) var req = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n\telse alert(\"Votre navigateur n'est pas assez récent pour accéder à cette fonction, ou les ActiveX ne sont pas autorisés\");\r\n\tif ( arguments.length==4 ) var fonction = arguments[3];\r\n\r\n\tif (type.toLowerCase()==\"post\") {\r\n\t\treq.open(\"POST\", _URL+fichier, true);\r\n\t\treq.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=iso-8859-1');\r\n\t\treq.send(variables);\r\n\t} else if (type.toLowerCase()==\"get\") {\r\n\t\treq.open('get', _URL+fichier+\"?\"+variables, true);\r\n\t\treq.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=iso-8859-1');\r\n\t\treq.send(null);\r\n\t} else { \r\n\t\talert(\"Méthode d'envoie des données invalide\"); \r\n\t}\r\n\r\n\treq.onreadystatechange = function() { \r\n\t\tif (req.readyState == 4 && req.responseText != null )\r\n\t\t{\t\t\t\t\r\n\t\t\tif (fonction) eval( fonction + \"('\"+escape(req.responseText)+\"')\");\r\n\t\t\t\r\n\t\t} \r\n\t}\r\n}", "function ajax(e) {\n if (e) {\n e.preventDefault();\n }\n\n // gets the POST params\n var data = t.serialize();\n\n // adds the button field\n data += '&' + escape('action[subscribe]') + '=Send';\n\n // ajax request\n $.ajax({\n type: 'POST',\n url: opts.url,\n data: data,\n dataType: 'json',\n success: function (data) {\n if (!data.error && data['@attributes'] && data['@attributes'].result == 'success') {\n if (data['@attributes'].result) {\n\n if ($.isFunction(opts.complete)) {\n opts.complete.call(t, data);\n }\n }\n } else if ($.isFunction(opts.error)) {\n opts.error.call(t, data);\n }\n } ,\n error: function (data) {\n if ($.isFunction(opts.error)) {\n opts.error.call(t, data);\n }\n }\n });\n\n return false;\n }", "function xAR(options) { return AjaxRequest(options); }", "render(tp, params={}) {\n if (tp.nodeType==1 && tp.tagName==\"TEMPLATE\") {\n tp=tp.content; //templates are not valid just its content\n }\n //for the templates we let original unmodified\n if (tp.nodeType==11) tp=tp.cloneNode(true);\n\n let scriptElements=[];\n if (tp.tagName==\"SCRIPT\") scriptElements.push(tp); //For when there is no descendents\n else scriptElements=Array.from(tp.querySelectorAll(\"SCRIPT\")); //inner elements\n scriptElements.forEach(scriptElement => {\n //To avoid script execution limitation for the request we make a copy of the script to a \"brand new\" script node\n //Also to execute script <script> for an already loaded element when we use render\n const myScript=document.createElement(\"SCRIPT\");\n for (const at of scriptElement.attributes) {\n myScript.setAttribute(at.name, at.value);\n }\n //adding scope (encapsulation) so this variables are local and can't be modified from another scripts.\n //Also async type allows awiat in scripts\n myScript.textContent=\"(async (thisElement, thisNode, thisParams)=>{\" + scriptElement.textContent + \"})(document.currentScript.previousElementSibling, document.currentScript.thisNode, document.currentScript.thisParams);\";\n myScript.thisNode=this;\n myScript.thisParams=params;\n const container=scriptElement.parentNode; // !!Document Fragment is not an Element => *parentNode*\n container.insertBefore(myScript, scriptElement);\n container.removeChild(scriptElement);\n });\n return tp;\n }", "function Truck () {}", "function CuentaAjax()\n{ \n\t/* Crea el objeto AJAX. Esta funcion es generica para cualquier utilidad de este tipo, por\n\tlo que se puede copiar tal como esta aqui */\n\tvar xmlhttp=false;\n\ttry\n\t{\n\t\t// Creacion del objeto AJAX para navegadores no IE\n\t\txmlhttp=new ActiveXObject(\"Msxml2.XMLHTTP\");\n\t}\n\tcatch(e)\n\t{\n\t\ttry\n\t\t{\n\t\t\t// Creacion del objet AJAX para IE\n\t\t\txmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t}\n\t\tcatch(E)\n\t\t{\n\t\t\tif (!xmlhttp && typeof XMLHttpRequest!='undefined') xmlhttp=new XMLHttpRequest();\n\t\t}\n\t}\n\treturn xmlhttp; \n}", "function ajaxFunction(controller,elementID)\r\n{\r\n\tajaxFunction(controller,elementID,'');\r\n\r\n}", "function manipulationTarget(elem,content){return jQuery.nodeName(elem,\"table\")&&jQuery.nodeName(content.nodeType===1?content:content.firstChild,\"tr\")?elem.getElementsByTagName(\"tbody\")[0]||elem.appendChild(elem.ownerDocument.createElement(\"tbody\")):elem;}// Replace/restore the type attribute of script elements for safe DOM manipulation", "static get observers(){return[\"_render(html)\"]}", "function getTranscludedText(url) {\n var retval = null;\n $.ajax({\n url: url,\n async: false,\n cache: false,\n type: \"GET\",\n dataType: \"text\",\n beforeSend: forceTextResponse,\n success: function (text, textStatus, xhr) {\n retval = $.trim(text);\n }\n });\n return retval;\n }", "function htmlEncode() {\n utilitymanager_1.um.utilityManager({\n utilType: utilitymanager_1.um.TIXUtilityType.utTransform,\n sp: utilitymanager_1.um.TIXSelPolicy.Line,\n }, function (up) {\n var d = document.createElement('div');\n d.textContent = up.intext;\n return d.innerHTML;\n });\n }", "function manipulationTarget(elem,content){if(nodeName(elem,\"table\")&&nodeName(content.nodeType!==11?content:content.firstChild,\"tr\")){return jQuery(elem).children(\"tbody\")[0]||elem;}return elem;}// Replace/restore the type attribute of script elements for safe DOM manipulation", "function manipulationTarget(elem,content){return jQuery.nodeName(elem,\"table\")&&jQuery.nodeName(content.nodeType!==11?content:content.firstChild,\"tr\")?elem.getElementsByTagName(\"tbody\")[0]||elem.appendChild(elem.ownerDocument.createElement(\"tbody\")):elem;}// Replace/restore the type attribute of script elements for safe DOM manipulation", "function ajax_link(divid, url, method, params){\n\t\n\turl = url + getNoCacheValue(url);\n\tvar status = divid + '-status';\n\tvar link = divid + '-link';\n\tvar wait = divid + '-wait';\n\tvar prev_str= document.getElementById(link).innerHTML;\n\tvar store_class= document.getElementById(link).className;\n\tdocument.getElementById(link).innerHTML = prev_str + '<img src=\"system/GUI/graphics/icons/waiting.gif\" class=\"link-wait\" />';\n\tdocument.getElementById(link).className = store_class + \"link-disabled\";\t\n\tdocument.getElementById(link).style.pointerEvents = \"none\";\n\tvar ajaxRequest = getXMLHttpRequest();\n\tvar link_height = document.getElementById(link).style.fontSize;\n\tif (link_height !='') {\n\t\tdocument.getElementById(link).style.height= link_height;\n\t\t\n\t}\n\tajaxRequest.onreadystatechange = function(){\n\t\t\t\t\t\t\t\t\t\tif (ajaxRequest.readyState == 4) {\n\t\t\t\t\t\t\t\t\t\t\tif (ajaxRequest.status == 200) {\n\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(link).innerHTML = prev_str;\n\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(divid).innerHTML = '<div class=\"placeholder-status\" id=\"' + status + '\"><i class=\"fa fa-check-circle-o status-check fade-in\"></i></div>' + ajaxRequest.responseText;\n\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(status).innerHTML = '<i class=\"fa fa-check-circle-o status-check fade-in\"></i>';\n\t\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(link).className = store_class;\n\t\t\t\t\t\t\t\t\t\t\t\tinvokeScript(divid);\n\t\t\t\t\t\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(status).innerHTML = '<i class=\"fa fa-exclamation-triangle status-error fade-in\"></i>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(link).style.pointerEvents = \"auto\";\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t};\n\tMakeResponse(ajaxRequest, method, url, params);\n}", "function manipulationTarget(elem,content){return jQuery.nodeName(elem,\"table\")&&jQuery.nodeName(content.nodeType!==11?content:content.firstChild,\"tr\")?elem.getElementsByTagName(\"tbody\")[0]||elem.appendChild(elem.ownerDocument.createElement(\"tbody\")):elem;} // Replace/restore the type attribute of script elements for safe DOM manipulation", "function manipulationTarget(elem,content){return jQuery.nodeName(elem,\"table\")&&jQuery.nodeName(content.nodeType!==11?content:content.firstChild,\"tr\")?elem.getElementsByTagName(\"tbody\")[0]||elem.appendChild(elem.ownerDocument.createElement(\"tbody\")):elem;} // Replace/restore the type attribute of script elements for safe DOM manipulation", "function manipulationTarget(elem,content){if(nodeName(elem,\"table\")&&nodeName(content.nodeType!==11?content:content.firstChild,\"tr\")){return jQuery(\">tbody\",elem)[0]||elem;}return elem;}// Replace/restore the type attribute of script elements for safe DOM manipulation", "function ajax_exec(data, target) {\n\tif(data.flash && typeof flash_set == 'function') flash_set(data.flash);\n\tif(data.exec) eval(data.exec);\n\tif(data.js) eval(data.js);\n\tif(data.reload) window.location.reload();\n}", "function tell_editor(editor)\n {\n var transobj = {funname:\"setEditorobjForInivitation_forRemoteWebpage\", param:null}; \t \n $(editor).attr(\"fnRemoteHtmlReq-event-param\", JSON.stringify(transobj)); \n //$(editor).trigger(\"fnRemoteHtmlReq-event\") // is it work\n var event = document.createEvent(\"HTMLEvents\"); \n event.initEvent(\"fnRemoteHtmlReq-event\", true, false); \n editor.dispatchEvent(event);\n }", "function setInnerHTMLAjax(targetUrl, sendData, innerHtmlID, firstOption, isJSON, isChosen) {\n if (typeof(firstOption) === 'undefined') {\n firstOption = 0;\n }\n if (typeof(isJSON) === 'undefined') {\n isJSON = 0;\n }\n if (typeof(isChosen) === 'undefined') {\n isChosen = 0;\n }\n $.post(targetUrl, sendData).done(function (data) { //alert(data);\n if (isJSON == 1) {\n var result = JSON.parse(data);\n } else {\n var result = data;\n }\n\n if (result != \"\") {\n if (firstOption != 0) {\n result = firstOption + result;\n }\n $(innerHtmlID).html(result);\n } else {\n if (firstOption != 0) {\n result = firstOption;\n }\n $(innerHtmlID).html(result);\n }\n\n\n //console.log(\"result = \"+result);\n\n if (isChosen != 0) {\n $(innerHtmlID).trigger(\"chosen:updated\");\n }\n }, \"json\");\n}", "function SaveTranscript(data) {\r\n data = data + \"<style>*{color:black !important;background:white !important;text-align:left !important}</style>\";\r\n if (!webPlayer && transcriptString != '') { UIEvent(\"SaveTranscript\", data); }\r\n transcriptString += data;\r\n}", "onApplyTemplate() {\r\n this.i.ac();\r\n }", "function mySuperScript(){\n\t\t\n\t\t\t\n\t\t\tvar line = document.createElement(\"BR\");\n\t\t\tdocument.body.appendChild(line);\n\t\t\t\n\t\t\tvar num = document.createElement(\"INPUT\");\n\t\t\tnum.type = \"text\";\n\t\t\tnum.setAttribute(\"id\",\"sup\");\n\t\t\t\n\t\t\t$(element).find(\"#hello\").get(0).appendChild(num);\t\t\t\n\t\t\tvar superb = document.createElement(\"BUTTON\");\n\t\n\t\t\tvar superText = document.createTextNode(\"SuperScript\");\n\t\t\t\n\t\t\t\n\t\t\tsuperb.addEventListener(\"click\", superscript);\n\t\t\tsuperb.appendChild(superText);\n\t\t\n\t\t\t$(element).find(\"#hello\").get(0).appendChild(superb);\t\n\t\t}", "function invoke(id,className, methodName, parameters, callBackFunction) {\n\t// On remet a jour l'invoker : désactivation puis instanciation\n\tinvokers[id] = false;\n\tinvokers[id] = httpFactory();\n\t// IE n'autorise pas les lignes suivantes ...\n\t//if (invokers[id] == -1)\n\t//\treturn;\n\n\t// Creation de la requete :\n\tvar xmlQuery = createBalloonXmlQuery(className, methodName, parameters);\t\n\t// On instancie la fonction de callback :\n\tinvokers[id].onreadystatechange = function() {\n\t\tswitch(invokers[id].readyState) {\t\t\t\n\t\t\tcase 0:\n\t\t\t bajaxStatus(\"Invocateur distant non initialisé\");\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tbajaxStatus(\"Début du transfert des données\");\n\t\t\t\tbreak;\n\t\t\tcase 2: \n\t\t\t\tbajaxStatus(\"Données transférées\");\n\t\t\t\tbreak;\n\t\t\tcase 3: \n\t\t\t bajaxStatus(\"Les données sont disponible partiellement\");\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tbajaxStatus(\"Les données ont été recues !\");\n\t\t\t\tif (invokers[id].status == 200) {\n\t \tcallBackFunction(invokers[id].responseText);\n\t \tbajaxHide();\n\t }\n\t\t\t\telse {\n\t\t var msg = \"Erreur d'invocation distante :\";\n\t\t msg += \" Erreur HTTP : \" + invokers[id].status;\n\t \t \tcallBackFunction(msg);\n\t \t }\n\t \t break;\n\t\t}\n\t} \t\n\t\n\t// Ouverture de la connexion au serveur Bajax\n\tinvokers[id].open(\"POST\",serverUrl, true);\t\n\t// On met en place le bon header pour l'envoi de données :\n\tinvokers[id].setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\tinvokers[id].setRequestHeader(\"Charset\", \"utf-8\");\n\t// On prépare l'envoie de la requete XML, en échappant les caractères URL :\n\tvar query = \"request=\"+escape(xmlQuery);\n\t// On envoie !\t\n\tinvokers[id].send(query);\n}", "function resultTrans(successMsg) {\n\treturn function(v) {return toResultDom(v,successMsg);};}", "function ajaxCallBack(opt,a) {\n\tif (opt.ajaxCallback==undefined || opt.ajaxCallback==\"\" || opt.ajaxCallback.length<3)\n\t\treturn false;\n\n\tvar splitter = opt.ajaxCallback.split(')'),\n\t\tsplitter = splitter[0].split('('),\n\t\tcallback = splitter[0],\n\t\targuments = splitter.length>1 && splitter[1]!=\"\" ? splitter[1]+\",\" : \"\",\n\t\tobj = new Object();\n\n\ttry{\n\t\tobj.containerid = \"#\"+opt.ajaxContentTarget,\n\t\tobj.postsource = a.data('ajaxsource'),\n\t\tobj.posttype = a.data('ajaxtype');\n\n\t\tif (opt.ajaxCallbackArgument == \"on\")\n\t\t\teval(callback+\"(\"+arguments+\"obj)\");\n\t\telse\n\t\t\teval(callback+\"(\"+arguments+\")\");\n\t\t} catch(e) { console.log(\"Callback Error\"); console.log(e)}\n}", "function do_script2(e) {\r\n\r\n\tif(e.target.innerHTML.indexOf(\"window.location.reload()\")!= -1){\r\n\tif(!e.target.id){\r\n\r\n\tscript=e.target.innerHTML;\r\n\te.preventDefault();\r\n\te.stopPropagation();\r\n\te.target.parentNode.removeChild(e.target);\r\n\r\n\tscrip=document.createElement('script');\r\n\tscrip.id=\"done\";\r\n\r\n\tscript=script.replace(\"window.location.reload()\",\"return\");\r\n\r\n\tscrip.innerHTML=script;\r\n\tdocument.getElementsByTagName('body')[0].appendChild(scrip);\r\n\t}\r\n\t}}", "origSendTransaction(options) {\n\t\treturn this.origSend(\"eth_sendTransaction\", [options])\n\t}", "function js(res) {\n if (is.registered(res)) {\n return;\n }var proto = Object.create(HTMLElement.prototype),\n opts = { prototype: proto },\n extend = res.headers[\"extends\"];\n\n extend && (opts[\"extends\"] = extend);\n proto.attachedCallback = proto.attributeChangedCallback = node;\n document.registerElement(res.name, opts);\n }", "transclude (element) {\n if (this.dom_parser.elements.length === 0) { return; }\n const body = this.dom_parser.document.body.cloneNode(true);\n\n while (element.firstChild) {\n const child = element.removeChild(element.firstChild);\n let transcluder;\n if (child.nodeType === Node.ELEMENT_NODE) {\n transcluder = this.transcluders.find(t => {\n return t.tag_name === child.tagName;\n });\n }\n if (transcluder) {\n transcluder.elements.push(child);\n } else if (this.default_transcluder) {\n this.default_transcluder.elements.push(child);\n } else {\n throw new Error(\"Transcluder is not found\");\n }\n }\n\n for (const t of this.transcluders) t.set_placeholder(body);\n if (this.default_transcluder) {\n this.default_transcluder.set_placeholder(body);\n }\n\n for (const t of this.transcluders) t.transclude();\n this.default_transcluder && this.default_transcluder.transclude();\n\n while (body.firstChild) element.appendChild(body.firstChild);\n }", "function Tdo(arry,request)\n{\n\tswitch(arry['action'])\n\t{\n\t\tcase \"expand\":\n\t\t\tTjump(\"modify&expandset=\" + EXPANDSET + \"&group=\" + arry['value']);\n\t\t\tbreak;\n\t\tcase \"customize\":\n\t\t\tTjump(\"add&dostyleid=\" + arry['styleid'] + \"&title=\" + arry['value'] + \"&group=\" + GROUP);\n\t\t\tbreak;\n\t\tcase \"edit\":\n\t\t\tswitch(request)\n\t\t\t{\n\t\t\t\tcase \"vieworiginal\":\n\t\t\t\t\twindow.open(\"template.php?s=\" + SESSIONHASH + \"&do=view&title=\" + out['selectedtext']);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"killtemplate\":\n\t\t\t\t\tTjump(\"delete&templateid=\" + arry['value'] + \"&dostyleid=\" + arry['styleid'] + \"&group=\" + GROUP);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tTjump(\"edit&templateid=\" + arry['value'] + \"&group=\" + GROUP);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"editinherited\":\n\t\t\tif (request == \"vieworiginal\")\n\t\t\t{\n\t\t\t\twindow.open(\"template.php?s=\" + SESSIONHASH + \"&do=view&title=\" + out['selectedtext']);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tTjump(\"add&dostyleid=\" + arry['styleid'] + \"&templateid=\" + arry['value'] + \"&group=\" + GROUP);\n\t\t\t}\n\t\t\tbreak;\n\t}\n}", "function tiendaPutAjaxLoader(container, text, suffix) {\r\n\tif (!suffix || suffix == '')\r\n\t\tsuffix = '_transp';\r\n\r\n\ttext_element = '';\r\n\tif (text != null && text != '')\r\n\t\ttext_element = '<span> ' + text + '</span>';\r\n\tvar img_loader = '<img src=\"' + window.com_tienda.jbase + 'media/com_tienda/images/ajax-loader' + suffix + '.gif' + '\"/>';\r\n\tif (document.getElementById(container)) {\r\n\t document.getElementById(container).set('html', img_loader + text_element);\r\n\t}\r\n}", "function addTaiChi() {\r\n executeAJAX('tai_chi', 'Tai Chi');\r\n}", "function OnBtnServerSynch_Click( e )\r\n{\r\n OnBtnServerSynch() ;\r\n}", "function fn_to_ajax(a,div)\n{\n //scommentare per bypassare\n //return true;\n var url = a.href;\n var xsreq;\n if (ajaxOk)\n {\n ajaxOk = false;\n fn_loading(div);\n }\n else\n {\n //alert (\"redirect\");\n window.location = url;\n return false;\n }\n if (window.XMLHttpRequest) {\n xsreq = new XMLHttpRequest();\n }\n else if (window.ActiveXObject) {\n xsreq = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n if (xsreq) {\n\n xsreq.onreadystatechange = function() {\n try{\n fn_ajDone(url, div,xsreq);\n }catch(e){\n //alert(e);\n window.location = url;\n }\n };\n xsreq.open(\"POST\", url, true);\n xsreq.send(\"fn_to_ajax_href=\"+a.href+\"&fn_to_ajax_div=\"+div);\n }\n return false;\n}", "function make_ready_ajax_callers(oTable){\n\t//find ajax_callers\n\t\n\tvar statusText = top.frames[\"main\"].document;\n\t\n\tvar container_body = $(statusText).find(\"#container_body > div\");\n\n\tvar a_ajax_caller = $(container_body).find(\"a.ajax_caller\");\n\n\t//find the ajax_caller child\n\tvar a_ajax_caller_child = a_ajax_caller.find(\"img\");\n\n\ta_ajax_caller.click(function(event){\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\tvar call = $(this).attr(\"href\");\n\t\tvar me = $(this).parent(\"td\").parent(\"tr\").get(0);\n\n\t\tcall_me_baby_one_more_time(call,me);\n\t\treturn false;\n\t});\n\n\ta_ajax_caller_child.click(function(event){\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\t//call GET as a default\n\t\tvar call = $(this).parent().attr(\"href\");\n\n\t\tvar me = $(this).parent(\"a\").parent(\"td\").parent(\"tr\").get(0);\n\n\t\tcall_me_baby_one_more_time(call, me);\n\t\treturn false;\n\t});\n\n\tfunction call_me_baby_one_more_time(call_what, me) {\n\n\t\t$.ajax({\n\t\t\ttype: \"GET\",\n\t\t\turl: call_what,\n\t\t\tsuccess : function(result){\n\t\t\t\ttry {\n\t\t\t\t\tresult = JSON.parse(result);\n\t\t\t\t\t\tif (result.success == 1){\n\t\t\t\t\t\t$().toastmessage('showErrorToast', result.message);\n\t\t\t\t\t\t// oTable.fnDeleteRow(oTable.fnGetPosition(me));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$().toastmessage('showSuccessToast', result.message);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (ex) {\n\t\t\t\t\t$().toastmessage('showSuccessToast', result.message);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\twindow.location.reload();\n\t\t\t},\n\t\t\terror: function() {\n\t\t\t\t$().toastmessage('showErrorToast', \"Action was unsuccessful. Please retry\");\n\t\t\t}\n\t\t});\n\t}\n}", "function addGoogTrans() {\r\n\treturn ''; // NOT USING YET\r\n}", "function XHRSyncLayer() {\n\n}", "function registerAjaxProvenanceCalls() {\n ajaxEngine.registerRequest('getProvenance','getDatasetProvenance');\n ajaxEngine.registerAjaxElement('parentGraph');\n}", "function registerAjaxProvenanceCalls() {\n ajaxEngine.registerRequest('getProvenance','getDatasetProvenance');\n ajaxEngine.registerAjaxElement('parentGraph');\n}", "function HTML_AJAX_Queue_Immediate() {}", "function delayed_ajax_post_call(url, args, callback, error_callback, completion_callback, response_type, stringify, delay) {\n if(response_type == null) response_type='html';\n if(stringify == null) stringify=false;\n if(error_callback == null) error_callback=ajax_error;\n if(delay == null) delay = 180000;\n setTimeout(function () {ajax_post_call(url , args, callback, error_callback, completion_callback, response_type, stringify); }, delay );\n }", "function extension_ancoraAutoTralha(){\n\tvar getTralha = decodeURIComponent(procurarTralha[1]);\n\tif(getTralha.split(\"?\")[1]!=undefined){ //Se tiver parametro nessa tralha (ex: #tralha?param=value), retiramos ele da variavel\n\t\tgetTralha=getTralha.split(\"?\")[0];\n\t}\n\tvar getTralhaSelector=\"\";\n\n\t//primeiro, posicionamos no topo para depois poder rolar\n\t//window.scrollTo(0,0);\n\t//window.scrollBy(0,0);\n\tif($(\"a[name=\"+getTralha+\"]\").length > 0) { //Se existir a ancora-padrao citada na tralha da url\n\t\tgetTralhaSelector = \"a[name=\"+getTralha+\"]\"; //Original-anchor\n\n\t}else if($(\".\"+getTralha).length > 0 || $(\"#\"+getTralha).length > 0) { //Se nao existir, buscamos por class ou id (É possivel usar #tralha para ancorar seletores)\n\t\tif($(\"#\"+getTralha).length > 0){\n\t\t\tgetTralhaSelector = \"#\"+getTralha; //Id-anchor\n\t\t}else{\n\t\t\tgetTralhaSelector = \".\"+getTralha; //Class-anchor\n\t\t}\n\t\n\t}else{ //Se nao tem ancora, nem class ou id, tentamos pela logica do ui_anchorPoint\n\t\textension_ancoraAutoParam();\n\t}\n\n\t//Ancoragem animada:\n\t//window.setTimeout('goToByScroll(\"'+getTralhaSelector+'\");', 600);\n\t\n\twindow.setTimeout(function() {\n\t\t//Ancoragem animada:\n\t\tgoToByScroll(getTralhaSelector);\n\n\t\t\n\t}, 600);\n}", "function ajaxJsExec(url, fAction){\r\n\t$.ajax({ \r\n\t\t type: \"GET\",\r\n\t\t url: url,\r\n\t\t dataType: \"script\",\r\n\t\t success: function(msg){\r\n\t\t\t var r = msg;\r\n\t\t\t if (r!=null) {\r\n\t\t\t\t r = $.trim(r);\r\n\t\t\t\t eval(r);\r\n\t\t\t}\r\n\t\t\t if (fAction!=null) {\r\n\t\t\t \t\tfAction();\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t}\r\n\t});\t\r\n}", "function _ajaxLink($link) {\n var $target = $($link.data('target')),\n action = $link.data('ajax');\n\n $.ajax({\n url: $link.attr('href'),\n method: $link.data('method') || 'post',\n params: $link.data('params'),\n success: function (content) {\n if ($target.length) {\n if (action === 'remove') {\n $target.remove();\n\n } else if (action === 'success') {\n $target.toggleClass('bg-success');\n\n } else if (action === 'select') {\n $target.toggleClass('is-selected');\n\n } else if (action === 'replace') {\n $target.html(content);\n Skeleton.initContent($target);\n }\n }\n }\n });\n }", "function manipulationTarget(elem,content){return jQuery.nodeName(elem,\"table\") && jQuery.nodeName(content.nodeType !== 11?content:content.firstChild,\"tr\")?elem.getElementsByTagName(\"tbody\")[0] || elem.appendChild(elem.ownerDocument.createElement(\"tbody\")):elem;} // Replace/restore the type attribute of script elements for safe DOM manipulation", "function yt(e,t){return function(r){var a=\"\";typeof r==\"string\"&&(a=Wu(\"on-\".concat(r)));for(var o=arguments.length,i=new Array(o>1?o-1:0),l=1;l<o;l++)i[l-1]=arguments[l];typeof e[a]==\"function\"?e[a].apply(e,i):t.apply(void 0,[r].concat(i))}}", "function tran(req, res){\r\n\t\t\t\tif(!req || !res || !req.body || !req.headers){ return }\r\n\t\t\t\tif(req.url){ req.url = url.format(req.url) }\r\n\t\t\t\tvar msg = req.body;\r\n\t\t\t\t// AUTH for non-replies.\r\n\t\t\t\tif(gun.wsp.msg(msg['#'])){ return }\r\n\t\t\t\tgun.wsp.on('network', Gun.obj.copy(req));\r\n\t\t\t\tif(msg['@']){ return } // no need to process.\r\n\t\t\t\tif(msg['$'] && msg['$']['#']){ return tran.get(req, res) }\r\n\t\t\t\t//if(Gun.is.lex(msg['$'])){ return tran.get(req, res) }\r\n\t\t\t\telse { return tran.put(req, res) }\r\n\t\t\t\tcb({body: {hello: 'world'}});\r\n\t\t\t\t// TODO: BUG! server put should push.\r\n\t\t\t}", "function template_addListener_busquedas(fcnBuscar, fcnBuscarPOST) {\n\t//eventos para mostrar las opciones de busqueda avanzada\n\t$(\".template_contenedorBusquedaAvanzada .textBusquedaAvanzada\").on({\n\t\tclick: function() {\n\t\t\tif ($(\".template_contenedorBusquedaAvanzada .busquedaAvanzada\").eq(0).css(\"display\") == \"none\") {\n\t\t\t\t$(\".template_contenedorBusquedaAvanzada .busquedaAvanzada\").show();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$(\".template_contenedorBusquedaAvanzada .busquedaAvanzada\").hide();\n\t\t\t}\n\t\t\t\n\t\t\t$(\".template_contenedorBusquedaAvanzada .opcionBusquedaAvanzada2\").hide();\n\t\t}\n\t});\n\t\n\t//eventos para los submenus de la busqueda avanzada (muestra y oculta)\n\t$(\".template_contenedorBusquedaAvanzada .opcionBusquedaAvanzada\").each(function(index){\n\t\t$(this).on({\n\t\t\tclick: function() {\n\t\t\t\tvar isActivo = $(\".template_contenedorBusquedaAvanzada .opcionBusquedaAvanzada2\").eq(index).css(\"display\") == \"none\" ? false : true;\n\t\t\t\t$(\".template_contenedorBusquedaAvanzada .opcionBusquedaAvanzada2\").hide();\n\t\t\t\t\n\t\t\t\tif (!isActivo)\n\t\t\t\t\t$(\".template_contenedorBusquedaAvanzada .opcionBusquedaAvanzada2\").eq(index).show();\n\t\t\t}\n\t\t});\n\t});\n\t\n\t//oculta todos las opciones de precios minimos y maximos hasta que se seleccione una transaccion\n\t$(\"#template_busqueda_precios_min li.lista li,#template_busqueda_precios_max li.lista li\").hide();\n\t\n\t//agrega evento para cuando se cambie de transaccion; y ajusta los valores de precios maximos y minimos\n\t$(\"#template_busqueda_transaccion\").each(function(){\n\t\tvar elemento = $(this);\n\t\t\n\t\t$(this).find(\"li.lista li\").on({\n\t\t\tclick: function() {\n\t\t\t\t_transaccion = $(this).attr(\"data-value\");\n\t\t\t\t$(\"#template_busqueda_precios_min li.lista li,#template_busqueda_precios_max li.lista li\").hide();\n\t\t\t\t$(\"#template_busqueda_precios_min p,#template_busqueda_precios_max p,#template_busqueda_tipoInmueble p\").attr(\"data-value\", -1);\n\t\t\t\t$(\"#template_busqueda_precios_min p,#template_busqueda_precios_max p,#template_busqueda_tipoInmueble p\").text(\"\");\n\t\t\t\t\n\t\t\t\t$(\"#template_busqueda_precios_min li.lista li,#template_busqueda_precios_max li.lista li\").each(function(){\n\t\t\t\t\ttempArray = $(this).attr(\"data-transaccion\").split(\",\");\n\t\t\t\t\t\n\t\t\t\t\tif ($.inArray(_transaccion, tempArray) > -1)\n\t\t\t\t\t\t$(this).show();\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t$(\"#template_busqueda_tipoInmueble li.lista li\").show();\n\t\t\t\tif (parseInt(_transaccion) == 3) {\n\t\t\t\t\t$(\"#template_busqueda_tipoInmueble li.lista li\").hide();\n\t\t\t\t\t$(\"#template_busqueda_tipoInmueble li.lista li[data-transaccion='3']\").show();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n\t\n\t\n\t//agrega evento para cuando se cambie de estado, actualizar la ciudad\n\t$(\"#template_busqueda_estado\").each(function(){\n\t\tvar elemento = $(this);\n\t\t\n\t\t$(this).find(\"li.lista li\").on({\n\t\t\tclick: function() {\n\t\t\t\ttemplate_actualizar_ciudad(elemento.prop(\"id\"));\n\t\t\t}\n\t\t});\n\t});\n\t\n\t\n\t//agrega evento cuando se cambian elementos flotantes\n\t$(\"#template_busqueda_cuotaMantenimiento\").on({\n\t\tchange: function() {\n\t\t\tif (!isVacio($(this).val())) {\n\t\t\t\tif (!flotante($(this).val(), $(this).attr(\"placeholder\"))) {\n\t\t\t\t\t$(this).val(\"\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\t\n\t\n\t//agrega evento cuando se cambian elementos enteros\n\t$(\"#template_busqueda_elevador,#template_busqueda_estacionamientoVisitas,#template_busqueda_numeroOficinas\").on({\n\t\tchange: function() {\n\t\t\tif (!isVacio($(this).val())) {\n\t\t\t\tif (!entero($(this).val(), $(this).attr(\"placeholder\"))) {\n\t\t\t\t\t$(this).val(\"\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\t\n\t\n\t//agrega el evento para realizar la busqueda\n\t$(\".template_contenedorBusquedaAvanzada p.buscar,.template_contenedorBusquedaAvanzada p.titulo\").on({\n\t\tclick: function() {\n\t\t\tif (parseInt($(\"#template_busqueda_transaccion\").find(\"p\").attr(\"data-value\")) > 0) {\n\t\t\t\tfcnBuscar();\n\t\t\t}\n\t\t\telse {\n\t\t\t\talert(\"Seleccione un tipo de transacción de busqueda\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t});\n\t\n\t\n\t//se recibieron parametros por post; por lo tanto se hacen los ajustes en los selects\n\tif (typeof post_transaccion !== 'undefined') {\n\t\tif (parseInt(post_transaccion) != -1) {\n\t\t\t$(\"#template_busqueda_transaccion li.lista li[data-value='\"+post_transaccion+\"']\").click();\n\t\t\t$(\"#template_busqueda_transaccion li.lista\").hide();\n\t\t}\n\t\tif (parseInt(post_preciosMin) != -1) {\n\t\t\t$(\"#template_busqueda_precios_min li.lista li[data-value='\"+post_preciosMin+\"']\").click();\n\t\t\t$(\"#template_busqueda_precios_min li.lista\").hide();\n\t\t}\n\t\tif (parseInt(post_preciosMax) != -1) {\n\t\t\t$(\"#template_busqueda_precios_max li.lista li[data-value='\"+post_preciosMax+\"']\").click();\n\t\t\t$(\"#template_busqueda_precios_max li.lista\").hide();\n\t\t}\n\t\tif (parseInt(post_wcs) != -1) {\n\t\t\t$(\"#template_busqueda_wcs li.lista li[data-value='\"+post_wcs+\"']\").click();\n\t\t\t$(\"#template_busqueda_wcs li.lista\").hide();\n\t\t}\n\t\tif (parseInt(post_recamaras) != -1) {\n\t\t\t$(\"#template_busqueda_recamaras li.lista li[data-value='\"+post_recamaras+\"']\").click();\n\t\t\t$(\"#template_busqueda_recamaras li.lista\").hide();\n\t\t}\n\t\t\n\t\t\n\t\t//selects opcionales\n\t\tif (typeof post_antiguedad !== 'undefined') {\n\t\t\tif (parseInt(post_antiguedad) != -1) {\n\t\t\t\t$(\"#template_busqueda_antiguedad li.lista li[data-value='\"+post_antiguedad+\"']\").click();\n\t\t\t\t$(\"#template_busqueda_antiguedad li.lista\").hide();\n\t\t\t}\n\t\t}\n\t\tif (typeof post_estadoConservacion !== 'undefined') {\n\t\t\tif (parseInt(post_estadoConservacion) != -1) {\n\t\t\t\t$(\"#template_busqueda_estadoConservacion li.lista li[data-value='\"+post_estadoConservacion+\"']\").click();\n\t\t\t\t$(\"#template_busqueda_estadoConservacion li.lista\").hide();\n\t\t\t}\n\t\t}\n\t\tif (typeof post_amueblado !== 'undefined') {\n\t\t\tif (parseInt(post_amueblado) != -1) {\n\t\t\t\t$(\"#template_busqueda_amueblado li.lista li[data-value='\"+post_amueblado+\"']\").click();\n\t\t\t\t$(\"#template_busqueda_amueblado li.lista\").hide();\n\t\t\t}\n\t\t}\n\t\tif (typeof post_dimensionTotalMin !== 'undefined') {\n\t\t\tif (parseInt(post_dimensionTotalMin) != -1) {\n\t\t\t\t$(\"#template_busqueda_dimensionTotalMin li.lista li[data-value='\"+post_dimensionTotalMin+\"']\").click();\n\t\t\t\t$(\"#template_busqueda_dimensionTotalMin li.lista\").hide();\n\t\t\t}\n\t\t}\n\t\tif (typeof post_dimensionTotalMax !== 'undefined') {\n\t\t\tif (parseInt(post_dimensionTotalMax) != -1) {\n\t\t\t\t$(\"#template_busqueda_dimensionTotalMax li.lista li[data-value='\"+post_dimensionTotalMax+\"']\").click();\n\t\t\t\t$(\"#template_busqueda_dimensionTotalMax li.lista\").hide();\n\t\t\t}\n\t\t}\n\t\tif (typeof post_dimensionConstruidaMin !== 'undefined') {\n\t\t\tif (parseInt(post_dimensionConstruidaMin) != -1) {\n\t\t\t\t$(\"#template_busqueda_dimensionConstruidaMin li.lista li[data-value='\"+post_dimensionConstruidaMin+\"']\").click();\n\t\t\t\t$(\"#template_busqueda_dimensionConstruidaMin li.lista\").hide();\n\t\t\t}\n\t\t}\n\t\tif (typeof post_dimensionConstruidaMax !== 'undefined') {\n\t\t\tif (parseInt(post_dimensionConstruidaMax) != -1) {\n\t\t\t\t$(\"#template_busqueda_dimensionConstruidaMax li.lista li[data-value='\"+post_dimensionConstruidaMax+\"']\").click();\n\t\t\t\t$(\"#template_busqueda_dimensionConstruidaMax li.lista\").hide();\n\t\t\t}\n\t\t}\n\t\t\n\t\t//continua con la asignacion de post para luego hacer la busqueda de acuerdo a los parametros recibidos\n\t\tif (parseInt(post_transaccion) != -1) {\n\t\t\t$(\"#template_busqueda_tipoInmueble li.lista li[data-value='\"+post_tipoInmueble+\"']\").click();\n\t\t\t$(\"#template_busqueda_tipoInmueble li.lista\").hide();\n\t\t\t\n\t\t\t//en caso de mandar parametros de estado, ciudad y colonia\n\t\t\tif (parseInt(post_estado) != -1) {\n\t\t\t\t$(\"#template_busqueda_estado p\").attr(\"data-value\", post_estado);\n\t\t\t\t$(\"#template_busqueda_estado p\").text($(\"#template_busqueda_estado li.lista li[data-value='\"+post_estado+\"']\").text());\n\t\t\t\ttemplate_actualizar_ciudad(\"template_busqueda_estado\", post_ciudad, post_colonia);\n\t\t\t\t\n\t\t\t\tsetTimeout(function(){\n\t\t\t\t\tif (fcnBuscarPOST != null)\n\t\t\t\t\t\tfcnBuscarPOST();\n\t\t\t\t\telse\n\t\t\t\t\t\t$(\".template_contenedorBusquedaAvanzada p.buscar\").click();\n\t\t\t\t}, 1800);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (fcnBuscarPOST != null)\n\t\t\t\t\tfcnBuscarPOST();\n\t\t\t\telse\n\t\t\t\t\t$(\".template_contenedorBusquedaAvanzada p.buscar\").click();\n\t\t\t}\n\t\t}\n\t}\n}", "function ajaxFunction(controller,errElementID,successElementID,hideElementID)\r\n{\r\n\tajaxFunction(controller,errElementID,successElementID,hideElementID,'');\r\n}", "function AjaxHelper(url, dataType, type, async, element) {\n $.ajax({\n url: url,\n dataType: dataType,\n type: type,\n async: async,\n success: function (data) {\n $(element).html(data);\n },\n error: function (jqXhr, textStatus, errorThrown) {\n alert('Error!');\n }\n });\n}", "function object_ajax()\n{\n\tvar dinamic_ajax=false;\n\ttry {\n\t\tdinamic_ajax = new ActiveXObject(\"Msxml2.XMLHTTP\");\n\t} catch (e)\n\t{\n\t\ttry {\n\t\t\tdinamic_ajax = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t} catch (E) {\n\t\t\tdinamic_ajax = false;\n\t\t\t}\n\t\t}\n\t\n\tif (!dinamic_ajax && typeof XMLHttpRequest!='undefined') {\n\t\tdinamic_ajax = new XMLHttpRequest();\n\t}\n\treturn dinamic_ajax;\n}", "function doAjax(type, url, parameters)\r\n{\r\n\tif (typeof parameters == \"undefined\")\r\n\t{\r\n\t\tparameters = new Object();\r\n\t}\r\n\r\n\tvar response = $.ajax({\r\n\t\ttype: type,\r\n\t\turl: url,\r\n\t\tdata: parameters,\r\n\t\tasync: false\r\n\t}).responseText;\r\n\t\r\n\treturn response;\r\n}", "function atavola(diff) { \r\n //aggiungo i poster delle scelte\r\n setTimeout(function() {\r\n $('#table').after('<a-image class=\"atavola clickable\" id=\"tav1\" material=\"src: Immagini/atavola/colazione.png\" position=\"2 4 0.3\" scale=\"2.2 2.2 0.1\" onclick=\"choiceTavola(\\'1\\')\"></a-image>');\r\n $('#table').after('<a-image class=\"atavola clickable\" id=\"tav2\" material=\"src: Immagini/atavola/pranzo.png\" position=\"4.5 4 0.3\" scale=\"2.2 2.2 0.1\" onclick=\"choiceTavola(\\'2\\')\"></a-image>');\r\n $('#table').after('<a-image class=\"atavola clickable\" id=\"tav3\" material=\"src: Immagini/atavola/merenda.png\" position=\"7 4 0.3\" scale=\"2.2 2.2 0.5\" onclick=\"choiceTavola(\\'3\\')\"></a-image>');\r\n $('#table').after('<a-image class=\"atavola clickable\" id=\"tav4\" material=\"src: Immagini/atavola/cena.png\" position=\"9.5 4 0.3\" scale=\"2.2 2.2 0.7\" onclick=\"choiceTavola(\\'4\\')\"></a-image>');\r\n }, 1000);\r\n \r\n $.getScript('Script/ajaxCall.js', function() { \r\n var elm;\r\n getTavolaAjax(diff, function(results) {\r\n elm = results;\r\n alt = [\r\n {dbelement: elm, graphicid: 'elem'}\r\n ];\r\n\r\n });\r\n \r\n }); \r\n}", "function cm_engine_std(){\n\t// instalar propriedades basicas para operacao com motor\n\tvar _defaults = {\n\t\tagent: 'uAjaxCM',\t\t\t// nome do componente no lado cliente\n\t\t\n\t\t// ancoragem e instalacao\n\t\tanchor: '',\t\t\t\t\t// ancora, se o DOM com esse ID deixar de existir o motor morre automaticamente\n\t\tdomid: '',\t\t\t\t\t// dom de instalacao do conteudo obtido\n\n\t\tcleanup: false,\t\t\t\t// destruir componente quando atividades encerrarem?\n\t\terrno: 0,\t\t\t\t\t// codigo do erro durante execucao\n\t\tdatatype: '',\t\t\t\t// tipo de conversao da resposta, padrao: text. Opcoes: text/xhr,float,integer,xml,json\n\n\t\t// conteudo de retornos remotos\n\t\tcontent: \"\",\t\t\t\t// conteudo obtido remotamente, padro para datatype = text\n\t\t// o conteudo será convertido de acordo com o tipo de 'datatype' em:\n\t\tjson: false,\t\t\t\t// objeto JSON\n\t\txml: false,\t\t\t\t\t// objeto XML\n\t\tinteger: 0,\t\t\t\t\t// numero inteiro\n\t\tfloat: 0.0,\t\t\t\t\t// numero de ponto flutuante\n\n\t\t// quando datatype = text/xhr, procurar tag SCRIPT e executa o codigo transportado com eval\n\t\texec: true,\n\t\tinner: true,\t\t\t\t// aplicar texto obtido dentrod e domid?\n\t\tseqid: 0,\t\t\t\t\t// numero sequencial para controle de requisicoes\n\n\t\t// controle de cache\n\t\tcache: false,\t\t\t\t// permitir cache? RECOMENDAVEL: FALSE\n\t\tcachetime: 0,\t\t\t\t// se cache=true, cachetime determina o tempo para manter em cache (segundos)\n\t\tcache_id: 0,\t\t\t\t// id de cache\n\t\tcache_expire: 0,\t\t\t// timestamp unix de quando o cache expira\n\t\t/*\n\t\t\tflag para ignorar conteudo repetido\n\t\t\tmodified compara o conteudo recebido com o anterior\n\t\t\t\tfalse - todos os eventos de processamento de dados serão processados mesmo sendo igual\n\t\t\t\ttrue - so irá disparar eventos de processamento de dados se as informacoes enviadas\n\t\t\t\t\t\tforem diferentes da ultima resposta\n\t\t*/\n\t\tmodified: true,\n\t\t// keepalive: -1,\t// -1 = nao mexer, 0/false = nao, 1/true = sim\n\n\t\t// controle de cabeçalhos\n\t\theaders: {},\t\t\t\t// cabecalhos a serem enviados\n\n\t\t// tipo do cabecalho Content-Type - application/x-www-form-urlencoded\n\t\tcontentType: 'application/x-www-form-urlencoded',\n\t\tcharset: 'UTF-8',\n\t\t/*\n\t\tjQuery: contentType: \"application/x-www-form-urlencoded; charset=UTF-8\"\n\t\tcontentType: \"application/x-www-form-urlencoded; charset=UTF-8\"\n\t\tareq.setRequestHeader(\"Content-Type\",\"application/x-javascript; charset:ISO-8859-1\"); \t\t\n\t\ttry { \n\t\t\tresponse.setCharacterEncoding(\"UTF-8\"); \n\t\t\tresponse.getWriter().write(\"this._data = \" + js + \";\"); \n\t\t\tresponse.flushBuffer(); \n\t\t} catch (Exception e) { \n\t\t\t// ignore exception here \n\t\t} \n\t\thttp_request.overrideMimeType('text/xml; charset=iso-8859-1');\n\t\tif (http_request.overrideMimeType) { \n\t\t\thttp_request.overrideMimeType('text/xml; charset=iso-8859-1'); \n\t\t}\n\t\t*/\n\t\t\n\t\t// eventos\n\t\tonplay: false,\t\t\t\t// funcao a executar (sempre) antes de disparar o motor contra o servidor\n\t\tonstatuschange: false,\t\t// funcao a executar quando o status do objeto xhr mudar\n\t\tontimeout: false,\t\t\t// funcao a executar quando o servidor remoto nao responder\n\t\tonretry: false,\t\t\t\t// funcao a executar antes de tentar nova requisicao com o servidor\n\t\tonerror: false,\t\t\t\t// funcao a executar quando houver erro na requisicao\n\t\tonreply: false,\t\t\t\t// funcao apos receber retorno do conteudo remoto com sucesso\n\t\tondestroy: false,\t\t\t// funcao a executar quando o motor for finalizado, antes da destruicao em si\n\t\tonpause: false,\t\t\t\t// funcao a executar quando o motor entrar em modo pause\n\t\tonrepeatover: false,\t\t// funcao a executar quando repeat atingido\n\t\tondatarx: false,\t\t\t// funcao de traducao de dados recebidos\n\n\t\t// objeto do motor XHR\n\t\thttp_status: 0,\n\t\txhttp: false,\t\t\t\t// var que contera objeto XmlHttpRequest\n\t\tmethod: 'POST',\t\t\t\t// metodo de postagem de parametros, GET ou POST\n\n\t\t// array ou objeto de parametros submetidos\n\t\tdata: false,\t\t\t\t// objeto com parametro:valor a ser enviado (via GET ou POST, depende de .method\n\t\tedata: false,\t\t\t\t// semelhante a 'data', usado para auxilio em refresh do objeto sem reescrita do 'data'\n\t\ttdata: false,\t\t\t\t// dados extras a serem enviados uma unica vez (temporario)\n\n\t\t// alvo remoto a ser requisitado (URN), nao pode conter um dominio/ip/porta diferente\n\t\turl: \"\",\t\t\t\t\t// url dos metodos: xhr, iframe\n\t\tquery_string: \"\",\t\t\t// INTERNA: string completa de requisicao GET (url com querystring)\n\t\tpost_string: \"\",\t\t\t// INTERNA: string completa de requisicao POST (apenas variaveis de data, edata e tdata)\n\n\t\t// modo XHR sincrono/assincrono\n\t\tasync: true,\n\n\t\t// controle para pemitir stop/start do motor\n\t\txstatus: 0,\t\t\t\t\t/*\tcontrole de stop/start\n\t\t\t\t\t\t\t\t\t\t0=nao iniciado\n\t\t\t\t\t\t\t\t\t\t1-4 - status xhttp/XHR\n\t\t\t\t\t\t\t\t\t\t5 - servico concluido\n\t\t\t\t\t\t\t\t\t\t6 - evento onstatechange impediu continuacao\n\t\t\t\t\t\t\t\t\t\t7=pausado\n\t\t\t\t\t\t\t\t\t\t8=pausado aguardando wait (tempo de pause)\n\t\t\t\t\t\t\t\t\t\t9=parado\n\t\t\t\t\t\t\t\t\t\t10 - reposta http invalida recebida pelo servidor\n\t\t\t\t\t\t\t\t\t\t11 - ancora desconectada\n\t\t\t\t\t\t\t\t\t\t12 - motor parado em transito\n\t\t\t\t\t\t\t\t\t*/\n\n\t\t// codico http da ultima resposta do servidor\n\t\tstatuscode: false,\n\n\t\t// controle de requisicoes\n\t\twait: 0,\t\t\t\t\t// (float) tempo de espera antes de iniciar a tarefa (aguarda antes requsicao inicial)\n\t\tpause: 0,\t\t\t\t\t// (float) tempo de espera apos pause antes de reiniciar o motor\n\t\tinterval: 0,\t\t\t\t// (float) intervalo de re-carregamento automatico para metodo xhr\n\t\trepeat: 0,\t\t\t\t\t// (int) numero limite de requisicoes a serem solicitadas no servidor a cada .interval\n\t\tretries: 0,\t\t\t\t\t// (int) numero de tentativas, inicializar com >0 para decrescer nas tentativas\n\t\ttimeout: 0,\t\t\t\t\t// (float) tempo a aguardar a resposta do servidor, se demorar mais do que timeout, o motor considera que o servidor esta com problemas\n\t\tping: 0,\t\t\t\t\t// tempo em milisecundos que o servidor demorou para responder\n\n\t\t// variaveis internas\n\t\tprocess: 0,\t\t\t\t\t// flag de sinalizacao de processamento XHR ativo, 0=nao esta em execucao, 1=em execucao\n\n\t\t// controle de tempo\n\t\tlifetime: 0,\t\t\t\t// (float) se definido, determina o tempo de vida do motor em ms a partir da requisicao\n\n\t\tstarttime: 0,\t\t\t\t// microtimetamp do momento de criacao do motor\n\t\tstoptime: 0,\t\t\t\t// microtimestamp do momento em que o motor parou (trabalho concluido)\n\t\tplaytime: 0,\t\t\t\t// microtimestamp do momento em que a requisicao foi criada\n\t\tendtime: 0,\t\t\t\t\t// microtimestamp do momento em que a requisicao foi finalizada\n\t\tlastreply: 0,\t\t\t\t// microtimestamp da ultima resposta do servidor remoto (statuschange)\n\n\t\t// CONTROLE INTERNO\n\t\tstats: {\n\t\t\treplies: 0,\n\t\t\ttimeout: 0,\n\t\t\terr: 0,\n\t\t\trequest: 0,\n\t\t\tretries: 0,\n\t\t\tmaxretries: 0,\n\t\t\tlifetime: 0,\n\t\t\tdownload: 0,\n\t\t\tupload: 0\n\t\t},\t\t\t\t\t/* objeto com estatisticas:\n\t\t\t\t\t\t\t\t\t\t.replies: numero de requisicoes atendidas pelo servidor\n\t\t\t\t\t\t\t\t\t\t.timeout: numero de requisicoes em timeout\n\t\t\t\t\t\t\t\t\t\t.err: numero de erros do lado servidor (timeout, crash, etc...)\n\t\t\t\t\t\t\t\t\t\t.request: numero de requisicoes enviadas ao servidor\n\t\t\t\t\t\t\t\t\t\t.retries: numero de vezes que a requisicao foi repetida (retentativas)\n\t\t\t\t\t\t\t\t\t\t.lifetime: tempo de vida do motor desde sua criacao\n\t\t\t\t\t\t\t\t\t\t.download: numero de bytes recebidos\n\t\t\t\t\t\t\t\t\t\t.upload: numero de bytes enviados\n\t\t\t\t\t\t\t\t\t*/\n\n\t\t// variaveis internas para controle de intervalo e timeout em javascript setTimeout e setInterval\n\t\tjstimer_wait: 0,\t\t\t// tempo de aguardo para iniciar motor - TIMEOUT\n\t\tjstimer_interval: 0,\t\t// tempo de aguardo entre requisicoes repetitivas via .interval - TIMEOUT\n\t\tjstimer_lifetime: 0,\t\t// tempo de aguardo antes de destruir o motor por lifetime maximo - TIMEOUT\n\t\tjstimer_pause: 0,\t\t\t// tempo de aguardo em pause antes de reinciair motor - TIMEOUT\n\t\tjstimer_timeout: 0\t\t\t// tempo de aguardo ate o tempo limite de timeout (sem resposta) - TIMEOUT\n\n\t};\n\t\n\t// forcar parametros globais nas opcoes padroes\n\tfor(var _ix in cm_engine_globals) _defaults[_ix] = (cm_engine_globals[_ix]);\n\t\n\t// zerar stats\n\t//for(var _jx in _defaults.stats) _defaults.stats[_jx] = 0;\n\n\treturn _defaults;\n}", "function getAjaxTransport() {\n\treturn validFuncOf(\n function() {return new XMLHttpRequest()},\n function() {return new ActiveXObject('Msxml2.XMLHTTP')},\n function() {return new ActiveXObject('Microsoft.XMLHTTP')}\n ) \n}", "function fnUpdateXEditableTransaction() {\n jQuery('#AdmTransactionTable .xEditTransaction').editable({\n type: 'text',\n url: bittionUrlProjectAndController + 'fnUpdateXEditableTransaction',\n title: 'Descripción',\n validate: function(value) {\n if (jQuery.trim(value) === '')\n return 'No puede estar vacio';\n },\n ajaxOptions: {\n dataType: 'json' //assuming json response\n },\n success: function(response, newValue) {\n if (response['status'] === 'SUCCESS') {\n bittionShowGrowlMessage(response['status'],response['title'],response['content']);\n } else {\n bittionShowGrowlMessage(response['status'],response['title'],response['content']);\n }\n fnRead(jQuery('#selectController').val());\n }\n });\n }", "function ajax_legacy() {\n /* + when */\n jQuery.ajax\n (\n jQuery.extend\n (\n true , {} ,\n settings.ajax ,\n callbacks ,\n {\n url : url ,\n beforeSend : function () {\n XMLHttpRequest = arguments[ 0 ] ;\n \n XMLHttpRequest.setRequestHeader( settings.nss.requestHeader , 'true' ) ;\n XMLHttpRequest.setRequestHeader( settings.nss.requestHeader + '-Area' , settings.area ) ;\n XMLHttpRequest.setRequestHeader( settings.nss.requestHeader + '-CSS' , settings.load.css ) ;\n XMLHttpRequest.setRequestHeader( settings.nss.requestHeader + '-Script' , settings.load.script ) ;\n \n fire( settings.callbacks.ajax.beforeSend , context , [ event , settings.parameter , XMLHttpRequest ] , settings.callbacks.async ) ;\n } ,\n success : function () {\n data = arguments[ 0 ] ;\n dataType = arguments[ 1 ] ;\n XMLHttpRequest = arguments[ 2 ] ;\n \n fire( settings.callbacks.ajax.success , context , [ event , settings.parameter , data , dataType , XMLHttpRequest ] , settings.callbacks.async ) ;\n \n update() ;\n } ,\n error : function () {\n XMLHttpRequest = arguments[ 0 ] ;\n textStatus = arguments[ 1 ] ;\n errorThrown = arguments[ 2 ] ;\n \n /* validate */ var validate = plugin_data[ settings.id ] && plugin_data[ settings.id ].validate ? plugin_data[ settings.id ].validate.clone( { name : 'jquery.pjax.js - drive()' } ) : validate ;\n /* validate */ validate && validate.start() ;\n /* validate */ validate && validate.test( '++', 1, [ url, win.location.href ], 'ajax_legacy()' ) ;\n /* validate */ validate && validate.test( '++', 1, [ XMLHttpRequest, textStatus, errorThrown ], 'ajax error' ) ;\n fire( settings.callbacks.ajax.error , context , [ event , settings.parameter , XMLHttpRequest , textStatus , errorThrown ] , settings.callbacks.async ) ;\n if ( settings.fallback ) { return typeof settings.fallback === 'function' ? settings.fallback( event ) : fallback( event , validate ) ; } ;\n /* validate */ validate && validate.end() ;\n }\n }\n )\n )\n /* - when */\n }", "function evaluateTransclusions() {\n //Get all nodes in the document.\n var nodes = ve.init.target.getSurface().getModel().getDocument().getDocumentNode();\n //Filter the result so we only keep the 'transclusion nodes' (templates).\n var transclusions = getTransclusions(nodes);\n //iterate over our transclusions\n for (var i = 0; i < transclusions.length; i++) {\n //retrieve the template name.\n var templateName = getTemplate(transclusions[i]);\n //execute an ask query for every template, checking the categories the template belongs to.\n new mw.Api().get({\n action: \"query\",\n prop: \"categories\",\n titles: templateName,\n formatversion: 2\n }).done(function (data) {\n if (data.query == null) return;\n var page = data.query.pages[0]; // we're only asking for a single page.\n for (var y = 0; y < page.categories.length; y++) {\n //Does the template have the 'System' template?\n if (page.categories[y].title.split(\":\").pop() == \"EMont core protected\") {\n //if so, add it to our list of protected templates.\n protectedTemplates[page.title.replace(/ /g,\"_\")] = true;\n }\n }\n if (Object.keys(protectedTemplates).length > 0 && overriden == false) {\n overrides();\n overriden = true;\n }\n })\n }\n }", "function _cjEventListener()\n{\n if (typeof(jQuery) !== 'undefined') {\n $.post('transferevents.php', {'action': 'listen_for_event'}, function (data) {_cjEventHandler(data)});\n } else if (typeof(Prototype) !== 'undefined') {\n new Ajax.Request('transferevents.php', {'method': 'post', 'parameters' : {'action': 'raise_event'},\n onSuccess: function (data) {_cjEventHandler(data.responseJSON);}\n });\n } else {\n alert('You need JQuery or Prototype to use this library!');\n }\n}", "function sendAjax(method,params,onResponse,url,elm)\n{\n var xmlhttp;\n if (elm)\n elm.setAttribute(\"value\", \"Please wait...\");\n if (window.XMLHttpRequest)\n {// code for IE7+, Firefox, Chrome, Opera, Safari\n xmlhttp=new XMLHttpRequest();\n }\n else\n {// code for IE6, IE5\n xmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n xmlhttp.onreadystatechange=function(){\n if (xmlhttp.readyState==4 && xmlhttp.status==200)\n onResponse(xmlhttp);\n };\n if (method==\"POST\")\n {\n xmlhttp.open(\"POST\",url,true);\n \n xmlhttp.setRequestHeader(\"Content-type\",\"application/x-www-form-urlencoded\");\n xmlhttp.send(params);\n }\n else\n {\n if (params!=\"\" && params !=null)\n url=url+\"?\"+params;\n xmlhttp.open(\"GET\",url,true);\n xmlhttp.send();\n }\n \n}", "function SetAjaxRollback() {\n\t$('.mw-rollback-link').click(function(e) {\n\t\te.preventDefault();\n\t\tvar $rblink = $(this);\n\t\tvar href = this.getElementsByTagName('a')[0].href;\n\t\tthis.innerHTML = ' <img src=\"http://images2.wikia.nocookie.net/dev/images/8/82/Facebook_throbber.gif\" style=\"vertical-align: baseline;\" border=\"0\" alt=\"Rollbacking...\" />';\n\t\t$.ajax({\n\t\t\turl: href,\n\t\t\tsuccess: function() {\n\t\t\t\t$rblink.text(function (i, val) {return val + ' [success]';});\n\t\t\t\tloadPageData();\n\t\t\t},\n\t\t\terror: function() {\n\t\t\t\t$rblink.text(function (i, val) {return val + ' [failed]';});\n\t\t\t\tloadPageData();\n\t\t\t}\n\t\t});\n\t});\n}", "function ajaxTranslateCallback(response) {\t\n\tif (response.length > 0) {\t\t\t\n\t\ttraduccionSugerida = response;\n\t\t//navigator.notification.confirm(\"La traduccion se ha recibido con exito: \"+traduccionSugerida);\n\t\t$('#lblTraduccionObtenida').html(response.toString());\n\t\t$('#pnlResultadoTraduccion').addClass(\"in\").css('zIndex', 300);\n\t\t$('.tooltip-inner').textfill({maxFontPixels: 200, minFontPixels:4}); \n\t\tif (liteVersion){\n\t\t\tnumTraducciones++;\n\t\t} \n\t}\t\n}", "function uuajaxcreate() { // @return XMLHttpRequest/null:\r\n return win.ActiveXObject ? new ActiveXObject(\"Microsoft.XMLHTTP\") :\r\n win.XMLHttpRequest ? new XMLHttpRequest() : null;\r\n}", "function ajaxob(){\n\t\t\ttry{\n\t\t\t\treturn new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari\n\t\t\t}\n\t\t\tcatch (e){\n\t\t\t\ttry{\n\t\t\t\t\treturn new ActiveXObject(\"Msxml2.XMLHTTP\"); // Internet Explorer\n\t\t\t\t}\n\t\t\t\tcatch (e){\n\t\t\t\t\ttry{\n\t\t\t\t\t\treturn new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t\t\t\t}\n\t\t\t\t\tcatch (e){\n\t\t\t\t\t\talert(\"Sorry AJAX is not supported by your browser.\");\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function doAjax(settings) {\n settings = $.extend({\n\n }, settings);\n\n return $.ajax(settings);\n}", "function wirejQueryInterceptor() {\n $(document).ajaxStart(function () { processRequest(); });\n $(document).ajaxComplete(function () { processResponse(); });\n $(document).ajaxError(function () { processResponse(); });\n }", "function TagMenu_applyServerBehavior(sbObj, paramObj) {\r\n var tagNode = this.listControl.getValue();\r\n paramObj[this.paramName] = tagNode;\r\n \r\n //set the selection property, so that fixUpSelection is not called again\r\n if (typeof tagNode == \"string\" && tagNode.indexOf(\"createAtSelection\") != -1) {\r\n paramObj.MM_selection = tagNode.substring(tagNode.indexOf(\"+\"));\r\n }\r\n \r\n return \"\";\r\n}", "function CB_UIView(params) {\r\n\tthis.controlObj = null;\r\n\tthis.settings = null;\r\n\t\r\n\tthis.setting = function(params) {\r\n\t\tif (typeof params!=='undefined') {\r\n\t\t\tif (this.settings===null) {\r\n\t\t\t\tthis.settings = params;\r\n\t\t\t} else {\r\n\t\t\t\tthis.settings = jQuery.extend(this.settings, params);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\t\r\n\t// can be overrided event\r\n\tthis.themeLoading=function(params){};\r\n\tthis.themeLoaded=function(params){};\r\n\tthis.htmlError=function(params){};\r\n\t\r\n\t// get theme HTML through ajax, can be overrided\r\n\tthis.getHtml=function(params){\r\n\t\tparams = jQuery.extend({async:false}, params);\r\n\t\tvar href = null;\r\n\t\tif (this.settings.app==\"sys\") {\r\n\t\t\thref = this.settings.base+\"/sys/\"+this.settings.version+\"/\"+this.settings.module+\"/\"+this.settings.control+\"/theme/\"+this.settings.theme+\"/\"+this.settings.control+\".html\";\r\n\t\t} else {\r\n\t\t\thref = this.settings.base+\"/apps/\"+this.settings.app+\"/\"+this.settings.version+\"/\"+this.settings.module+\"/\"+this.settings.control+\"/theme/\"+this.settings.theme+\"/\"+this.settings.control+\".html\";\r\n\t\t}\r\n\t\tjQuery.ajax({\r\n\t\t\tasync: params.async,\r\n\t\t\ttype: 'GET', \r\n\t\t\turl: href,\r\n\t\t\tdataType: 'html',\r\n\t\t\tsuccess: jQuery.proxy(function(data){\r\n\t\t\t\tthis.setHtml(data);\r\n\t\t\t\tthis.setting({isAjaxHtml:true});\r\n\t\t\t}, this),\r\n\t\t\terror: jQuery.proxy(function(jqXHR,textStatus,errorThrown){\r\n\t\t\t\tthis.setting({isAjaxHtml:false});\r\n\t\t\t\tthis.htmlError({obj:jqXHR,status:textStatus,error:errorThrown});\r\n\t\t\t},this),\r\n\t\t}).done();\r\n\t\treturn null;\r\n\t};\r\n\t\r\n\tthis.setHtml = function(data){\r\n\t\tif ((typeof this.settings.isAjaxHtml!=='undefined')&&(this.settings.isAjaxHtml==true)) return;\r\n\t\tif ((typeof data!=='undefined')&&(data!==null)) {\r\n\t\t\tif (this.TYPE==\"PAGE_VIEW\") {\r\n\t\t\t\tvar tag = \"body\"; \r\n\t\t\t} else {\r\n\t\t\t\tvar tag = this.settings.target;\r\n\t\t\t}\r\n\t\t\tjQuery(tag).html(data);\r\n\t\t\tthis.themeLoaded(params);\r\n\t\t}\r\n\t};\r\n\r\n\tthis.loadCss=function(){\r\n\t\tvar href = null;\r\n\t\tif (this.settings.app==\"sys\") {\r\n\t\t\thref = this.settings.base+\"/sys/\"+this.settings.version+\"/\"+this.settings.module+\"/\"+this.settings.control+\"/theme/\"+this.settings.theme+\"/\"+this.settings.control+\".css\";\r\n\t\t} else {\r\n\t\t\thref = this.settings.base+\"/apps/\"+this.settings.app+\"/\"+this.settings.version+\"/\"+this.settings.module+\"/\"+this.settings.control+\"/theme/\"+this.settings.theme+\"/\"+this.settings.control+\".css\";\r\n\t\t}\r\n\t\tif (jQuery(\"head link[href=\\\"\"+href+\"\\\"]\").size()==0) \r\n\t\t\tjQuery(\"head\").append('<link rel=\"stylesheet\" href=\"'+ href +'\" type=\"text/css\" />');\r\n\t};\r\n\r\n\t/*\r\n\t *\tparams.async\t\tload theme asynchronously\r\n\t *\tparams.htmlLoaded after html load\r\n\t */\r\n\tthis.loadTheme = function(params) {\r\n\t\tthis.themeLoading(params);\r\n\t\tthis.loadCss();\r\n\t\tvar data = this.getHtml(params);\r\n\t\tthis.setHtml(data);\r\n\t};\r\n}", "function cb_wrapper(req) {\n var text = req.responseText;\n\n // replace call of \"retrieveURL\"\n text = text.replace(/retrieveURL\\(/g, \"cb_link_wrapper('\"+CB_REQ_CONTAINER.id+\"', \");\n\n // replace call of \"show_player\"\n text = text.replace(/show_player\\(/g, \"cb_show_play_wrapper('\"+CB_REQ_CONTAINER.id+\"', \");\n\n return text;\n}", "function manipulationTarget(elem, content) {\n return jQuery.nodeName(elem, \"table\") && jQuery.nodeName(content.nodeType !== 11 ? content : content.firstChild, \"tr\") ? elem.getElementsByTagName(\"tbody\")[0] || elem.appendChild(elem.ownerDocument.createElement(\"tbody\")) : elem;\n } // Replace/restore the type attribute of script elements for safe DOM manipulation", "function ANT() { }", "function tell_to_box( tobox)\n {\n var transobj = {funname:\"setReceiptobjForInivitation_forRemoteWebpage\", param:null}; \t \n $(tobox).attr(\"fnRemoteHtmlReq-event-param\", JSON.stringify(transobj)); \n //$(tobox).trigger(\"fnRemoteHtmlReq-event\") // is it work\n var event = document.createEvent(\"HTMLEvents\"); \n event.initEvent(\"fnRemoteHtmlReq-event\", true, false); \n tobox.dispatchEvent(event);\n }", "interact(){}", "_callObserver (transaction, parentSubs, remote) {\n this._callEventHandler(transaction, new YXmlEvent(this, parentSubs, remote, transaction));\n }", "function Toastz(x,y,z)\n{\nlet priority = x;\nlet title = y;\nlet message = z;\n\n$.toaster({ priority : priority, title : title, message : message });\n}", "onAfterAjax() {\n }", "function tinyMc_ajax(submit_button, full_content, db_column_name, address, load_tinyMc_div, content_for_loading){\n\t\t$(submit_button).click(function(){\n\t\t\tvar content = tinyMCE.get(full_content).getContent();\n\t\t\tvar function_name = $(db_column_name).attr('rel'); //take a column name\n\t\t\talert(function_name);\n\t\t\t$.ajax({\n\t\t\t\ttype: \"POST\",\n\t\t\t\turl: address,\n\t\t\t\tdata: {function_name:function_name,content:content},\n\t\t\t\tsuccess: function(msg){\n\t\t\t\t\t$(load_tinyMc_div).load(content_for_loading);\n\t\t\t\t\t$(\"#remodal\").modal('hide');\n\t\t\t\t},\n\t\t\t\terror: function(){\n\t\t\t\t\talert(\"failure\");\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "function $t(text,on) {\r\n var e = document.createTextNode(text);\r\n if (on) on.appendChild(e);\r\n return e;\r\n}" ]
[ "0.51261014", "0.502349", "0.502349", "0.49813956", "0.49795645", "0.4917732", "0.4911214", "0.4903649", "0.48723844", "0.48723844", "0.48585975", "0.48149747", "0.4808979", "0.4802675", "0.4779681", "0.4751991", "0.47223747", "0.47164014", "0.47143552", "0.46962377", "0.46848553", "0.4669031", "0.4669031", "0.4635579", "0.46297446", "0.46221912", "0.4613364", "0.4609568", "0.46045128", "0.45997024", "0.45961735", "0.45916498", "0.4559981", "0.4558027", "0.45495346", "0.4545909", "0.45252502", "0.45252502", "0.45202127", "0.4510591", "0.45003402", "0.44983578", "0.44980696", "0.44913414", "0.44768527", "0.44759184", "0.44667533", "0.44661808", "0.4456437", "0.44557172", "0.4448344", "0.44470087", "0.4442828", "0.44399616", "0.443624", "0.4433914", "0.44287676", "0.4427598", "0.44226003", "0.4421528", "0.44188988", "0.44188988", "0.4418373", "0.44181177", "0.44170535", "0.44161004", "0.44124937", "0.44120705", "0.44084558", "0.44037908", "0.4400568", "0.44005227", "0.43983293", "0.43947566", "0.4394162", "0.43887427", "0.43823946", "0.43819657", "0.4381748", "0.43807906", "0.4375299", "0.43705708", "0.43689916", "0.43588918", "0.43543687", "0.4349636", "0.43408582", "0.43361902", "0.43343425", "0.4333707", "0.43336496", "0.43318862", "0.4330462", "0.43290824", "0.43268904", "0.43177503", "0.43165603", "0.43138802", "0.4306607", "0.43050578", "0.43027803" ]
0.0
-1
assumes html already trimmed and tag names are lowercase
function computeContainerTag(html) { return containerTagHash[html.substr(0, 3) // faster than using regex ] || 'div'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function captureTagName() {\n var startIdx = currentTag.idx + (currentTag.isClosing ? 2 : 1);\n return html.slice(startIdx, charIdx).toLowerCase();\n }", "function captureTagName() {\n var startIdx = currentTag.idx + (currentTag.isClosing ? 2 : 1);\n return html.slice(startIdx, charIdx).toLowerCase();\n }", "function parseOutTags(htmlRecipeName) {console.log(\"recipehtmlName: \" + htmlRecipeName);\n\t\tvar cleanRecipeName = '';\n\t\tvar insideTag = 0;\n\t\tfor (var i = 0; i < htmlRecipeName.length; i++)\n\t\t{console.log(\"clean recipe is: \" + cleanRecipeName);\n\t\t\tif (htmlRecipeName[i] == '<')\n\t\t\t{\n\t\t\t\ti = i + 1;\n\t\t\t\twhile (htmlRecipeName[i] != '>')\n\t\t\t\t{console.log(\"skipping: \" + htmlRecipeName[i]);\n\t\t\t\t\ti = i + 1;\n\t\t\t\t}\n\t\t\t\ti = i + 1;\n\t\t\t}\n\t\t\tif (i < htmlRecipeName.length && htmlRecipeName[i] != '<')\n\t\t\t{\n\t\t\t\tcleanRecipeName += htmlRecipeName[i];\n\t\t\t}\n\t\t}\n\t\treturn cleanRecipeName;\n\t}", "function normalizeTag(tag){\r\n\treturn tag.trim()\r\n}", "function strip_tags (input, allowed) {\n // making sure the allowed arg is a string containing only tags in lowercase\n // (<a><b><c>)\n allowed = (((allowed || '') + '').toLowerCase()\n .match(/<[a-z][a-z0-9]*>/g) || []).join('');\n var tags = /<\\/?([a-z][a-z0-9]*)\\b[^>]*>/gi,\n commentsAndPhpTags = /<!--[\\s\\S]*?-->|<\\?(?:php)?[\\s\\S]*?\\?>/gi;\n return input.replace(commentsAndPhpTags, '').replace(tags, function ($0, $1) {\n return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '';\n });\n}", "function ParseTagName (data) {\n return(data.replace(reTrimEndTag, \"/\").replace(reTrimTag, \"\").split(reWhitespace).shift().toLowerCase());\n}", "function sanitizeTagName(name) {\n\treturn name.toLowerCase().replace(/[^0-9a-z]+/g, \"-\");\n}", "function fixTag(tag) {\n var temp = '<';\n for (var i = 1; i < tag.length; ++i) {\n if (tag.charAt(i).match(/[a-z\\-]/i)) {\n temp += tag.charAt(i);\n } else {\n break;\n }\n }\n return temp;\n\n}", "function strip_tags(input, allowed) {\n var tags = /<\\/?([a-z][a-z0-9]*)\\b[^>]*>/gi,\n commentsAndPhpTags = /<!--[\\s\\S]*?-->|<\\?(?:php)?[\\s\\S]*?\\?>/gi;\n\n // making sure the allowed arg is a string containing only tags in lowercase (<a><b><c>)\n allowed = (((allowed || \"\") + \"\").toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join('');\n\n return input.replace(commentsAndPhpTags, '').replace(tags, function($0, $1) {\n return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '';\n });\n }", "function parseTags(text) {\n\tvar result = '';\n\n\tfor (var i = 0; i < text.length; i += 1) {\n\t\tif (text[i] == '<' && text[i + 1] == 'u') {\n\t\t\ti += 8;\n\t\t\twhile (text[i] != '<') {\n\t\t\t\tresult += text[i].toUpperCase();\n\t\t\t\ti += 1;\n\t\t\t}\n\t\t\tif (text[i + 1] == '/') {\n\t\t\t\ti += 8;\n\t\t\t} else {\n\t\t\t\ti--;\n\t\t\t}\n\t\t} else if (text[i] == '<' && text[i + 1] == 'l') {\n\t\t\ti += 9;\n\t\t\twhile (text[i] != '<') {\n\t\t\t\tresult += text[i].toLowerCase();\n\t\t\t\ti += 1;\n\t\t\t}\n\t\t\tif (text[i + 1] == '/') {\n\t\t\t\ti += 9;\n\t\t\t} else {\n\t\t\t\ti--;\n\t\t\t}\n\t\t} else if (text[i] == '<' && text[i + 1] == 'm') {\n\t\t\ti += 9;\n\t\t\twhile (text[i] != '<') {\n\t\t\t\tif (Math.random() < 0.5) {\n\t\t\t\t\tresult += text[i].toUpperCase();\n\t\t\t\t\ti += 1;\n\t\t\t\t} else {\n\t\t\t\t\tresult += text[i].toLowerCase();\n\t\t\t\t\ti += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (text[i + 1] == '/') {\n\t\t\t\ti += 9;\n\t\t\t} else {\n\t\t\t\ti--;\n\t\t\t}\n\t\t} else {\n\t\t\tresult += text[i];\n\t\t}\n\t}\n\n\treturn result;\n}", "function balanceTags(html)\n {\n\n if (html == \"\")\n return \"\";\n\n var re = /<\\/?\\w+[^>]*(\\s|$|>)/g;\n // convert everything to lower case; this makes\n // our case insensitive comparisons easier\n var tags = html.toLowerCase().match(re);\n\n // no HTML tags present? nothing to do; exit now\n var tagcount = (tags || []).length;\n if (tagcount == 0)\n return html;\n\n var tagname, tag;\n var ignoredtags = \"<p><img><br><li><hr>\";\n var match;\n var tagpaired = [];\n var tagremove = [];\n var needsRemoval = false;\n\n // loop through matched tags in forward order\n for (var ctag = 0; ctag < tagcount; ctag++)\n {\n tagname = tags[ctag].replace(/<\\/?(\\w+).*/, \"$1\");\n // skip any already paired tags\n // and skip tags in our ignore list; assume they're self-closed\n if (tagpaired[ctag] || ignoredtags.search(\"<\" + tagname + \">\") > -1)\n continue;\n\n tag = tags[ctag];\n match = -1;\n\n if (!/^<\\//.test(tag))\n {\n // this is an opening tag\n // search forwards (next tags), look for closing tags\n for (var ntag = ctag + 1; ntag < tagcount; ntag++)\n {\n if (!tagpaired[ntag] && tags[ntag] == \"</\" + tagname + \">\")\n {\n match = ntag;\n break;\n }\n }\n }\n\n if (match == -1)\n needsRemoval = tagremove[ctag] = true; // mark for removal\n else\n tagpaired[match] = true; // mark paired\n }\n\n if (!needsRemoval)\n return html;\n\n // delete all orphaned tags from the string\n\n var ctag = 0;\n html = html.replace(re, function (match)\n {\n var res = tagremove[ctag] ? \"\" : match;\n ctag++;\n return res;\n });\n return html;\n }", "function strip(html)\n {\n html = html.replace(/<b>/g, \"\");\n html = html.replace(/<\\/b>/g, \"\");\n html = html.replace(/<(?:.|\\n)*?>/gm, \"\");\n return html;\n }", "function balanceTags(html) {\n\n if (html == \"\")\n return \"\";\n\n var re = /<\\/?\\w+[^>]*(\\s|$|>)/g;\n // convert everything to lower case; this makes\n // our case insensitive comparisons easier\n var tags = html.toLowerCase().match(re);\n\n // no HTML tags present? nothing to do; exit now\n var tagcount = (tags || []).length;\n if (tagcount == 0)\n return html;\n\n var tagname, tag;\n var ignoredtags = \"<p><img><br><li><hr>\";\n var match;\n var tagpaired = [];\n var tagremove = [];\n var needsRemoval = false;\n\n // loop through matched tags in forward order\n for (var ctag = 0; ctag < tagcount; ctag++) {\n tagname = tags[ctag].replace(/<\\/?(\\w+).*/, \"$1\");\n // skip any already paired tags\n // and skip tags in our ignore list; assume they're self-closed\n if (tagpaired[ctag] || ignoredtags.search(\"<\" + tagname + \">\") > -1)\n continue;\n\n tag = tags[ctag];\n match = -1;\n\n if (!/^<\\//.test(tag)) {\n // this is an opening tag\n // search forwards (next tags), look for closing tags\n for (var ntag = ctag + 1; ntag < tagcount; ntag++) {\n if (!tagpaired[ntag] && tags[ntag] == \"</\" + tagname + \">\") {\n match = ntag;\n break;\n }\n }\n }\n\n if (match == -1)\n needsRemoval = tagremove[ctag] = true; // mark for removal\n else\n tagpaired[match] = true; // mark paired\n }\n\n if (!needsRemoval)\n return html;\n\n // delete all orphaned tags from the string\n\n var ctag = 0;\n html = html.replace(re, function (match) {\n var res = tagremove[ctag] ? \"\" : match;\n ctag++;\n return res;\n });\n return html;\n }", "function striptags(html) { // quick and dirty, don't reuse (\"Lame\" according to TJ)\n return String(html).replace(/<\\/?([^>]+)>/g, '');\n}", "clean(html) {\n\t\treturn html\n\t\t\t.replace(/(&#xA0;)+/g, ' ')\n\t\t\t.replace(' ', ' ')\n\t\t\t.replace(/\\s*([<>])\\s*/g, '$1');\n\t}", "function removeTags(html) {\n var text = html.replace(/<[^>]*>/g, '\\n');\n text = text.replace(/^\\s*[\\r\\n]/gm,\"\");\n return text;\n}", "function purifyHtml(input, allowed) {\n if (!_.isString(input) || input.indexOf(\"<\") < 0) {\n return input;\n }\n if (allowed === undefined) {\n allowed = default_allowed;\n }\n if (!allowed_split[allowed]) {\n allowed_split[allowed] = (((allowed || \"\") + \"\").toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join(''); // making sure the allowed arg is a string containing only tags in lowercase (<a><b><c>)\n }\n return input.replace(commentsAndPhpTags, '').replace(tags, function ($0, $1) {\n return allowed_split[allowed].indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '';\n });\n }", "function unhtmlify(original) {\n original = original.trim();\n // Also remove any newlines, adding a space if there was none otherwise.\n original = original.replace(/( (\\r\\n|\\n|\\r)+|(\\r\\n|\\n|\\r)+ |(\\r\\n|\\n|\\r)+)/gm,\" \");\n var testversion = original.replace(/^ *<p>/i, '').replace(/<\\/p> *$/i, '');\n if(!html_only_regex.test(testversion)) {\n testversion = dounescape(testversion);\n if(!html_regex.test(testversion)) return testversion;\n }\n return original;\n}", "function stripHTML(){\n\tvar re = /<\\S[^><]*>/g;\n\treturn arguments[0].replace(re, \"\");\n}", "function sanitizeText(html) {\n\t\tif (typeof html !== 'string') {\n\t\t\treturn html;\n\t\t}\n\t\tvar value = \"<div>\" + html.replace(/(\\s)(on(?:\\w+))(\\s*=)/, '$1xss-$2$3') + \"</div>\";\n\t\tvar elems = $($.parseHTML(value, null, false));\n\n\t\telems.find('*').each(function() {\n\t\t\tsanitizeElement(this);\n });\n\n\t\treturn elems.html();\n\t}", "function tagCleanup() {\n\n\t}", "function onIgnoreTagStripAll() {\n return \"\";\n}", "function onIgnoreTagStripAll() {\n return \"\";\n}", "function onIgnoreTagStripAll() {\n return \"\";\n }", "function stripHtml(str, originalOpts) {\n // const\n // ===========================================================================\n const start = Date.now();\n const definitelyTagNames = new Set([\"!doctype\", \"abbr\", \"address\", \"area\", \"article\", \"aside\", \"audio\", \"base\", \"bdi\", \"bdo\", \"blockquote\", \"body\", \"br\", \"button\", \"canvas\", \"caption\", \"cite\", \"code\", \"col\", \"colgroup\", \"data\", \"datalist\", \"dd\", \"del\", \"details\", \"dfn\", \"dialog\", \"div\", \"dl\", \"doctype\", \"dt\", \"em\", \"embed\", \"fieldset\", \"figcaption\", \"figure\", \"footer\", \"form\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"head\", \"header\", \"hgroup\", \"hr\", \"html\", \"iframe\", \"img\", \"input\", \"ins\", \"kbd\", \"keygen\", \"label\", \"legend\", \"li\", \"link\", \"main\", \"map\", \"mark\", \"math\", \"menu\", \"menuitem\", \"meta\", \"meter\", \"nav\", \"noscript\", \"object\", \"ol\", \"optgroup\", \"option\", \"output\", \"param\", \"picture\", \"pre\", \"progress\", \"rb\", \"rp\", \"rt\", \"rtc\", \"ruby\", \"samp\", \"script\", \"section\", \"select\", \"slot\", \"small\", \"source\", \"span\", \"strong\", \"style\", \"sub\", \"summary\", \"sup\", \"svg\", \"table\", \"tbody\", \"td\", \"template\", \"textarea\", \"tfoot\", \"th\", \"thead\", \"time\", \"title\", \"tr\", \"track\", \"ul\", \"var\", \"video\", \"wbr\", \"xml\"]);\n const singleLetterTags = new Set([\"a\", \"b\", \"i\", \"p\", \"q\", \"s\", \"u\"]);\n const punctuation = new Set([\".\", \",\", \"?\", \";\", \")\", \"\\u2026\", '\"', \"\\u00BB\"]); // \\u00BB is &raquo; - guillemet - right angled quote\n // \\u2026 is &hellip; - ellipsis\n // we'll gather opening tags from ranged-pairs here:\n\n const rangedOpeningTags = []; // we'll put tag locations here\n\n const allTagLocations = [];\n let filteredTagLocations = []; // variables\n // ===========================================================================\n // records the info about the suspected tag:\n\n let tag = {};\n\n function resetTag() {\n tag = {\n attributes: []\n };\n }\n\n resetTag(); // records the beginning of the current whitespace chunk:\n\n let chunkOfWhitespaceStartsAt = null; // records the beginning of the current chunk of spaces (strictly spaces-only):\n\n let chunkOfSpacesStartsAt = null; // temporary variable to assemble the attribute pieces:\n\n let attrObj = {}; // marker to store captured href, used in opts.dumpLinkHrefsNearby.enabled\n\n let hrefDump = {\n tagName: \"\",\n hrefValue: \"\",\n openingTagEnds: undefined\n }; // used to insert extra things when pushing into ranges array\n\n let stringToInsertAfter = \"\"; // state flag\n\n let hrefInsertionActive = false; // marker to keep a note where does the whitespace chunk that follows closing bracket end.\n // It's necessary for opts.trimOnlySpaces when there's closing bracket, whitespace, non-space\n // whitespace character (\"\\n\", \"\\t\" etc), whitspace, end-of-file. Trim will kick in and will\n // try to trim up until the EOF, be we'll have to pull the end of trim back, back to the first\n // character of aforementioned non-space whitespace character sequence.\n // This variable will tell exactly where it is located.\n\n let spacesChunkWhichFollowsTheClosingBracketEndsAt = null; // functions\n // ===========================================================================\n\n function existy(x) {\n return x != null;\n }\n\n function isStr(something) {\n return typeof something === \"string\";\n }\n\n function treatRangedTags(i, opts, rangesToDelete) {\n\n if (Array.isArray(opts.stripTogetherWithTheirContents) && (opts.stripTogetherWithTheirContents.includes(tag.name) || opts.stripTogetherWithTheirContents.includes(\"*\"))) {\n // it depends, is it opening or closing range tag:\n // We could try to distinguish opening from closing tags by presence of\n // slash, but that would be a liability for dirty code cases where clash\n // is missing. Better, instead, just see if an entry for that tag name\n // already exists in the rangesToDelete[].\n\n if (Array.isArray(rangedOpeningTags) && rangedOpeningTags.some(obj => obj.name === tag.name && obj.lastClosingBracketAt < i)) {\n // if (tag.slashPresent) { // closing tag.\n // filter and remove the found tag\n\n for (let y = rangedOpeningTags.length; y--;) {\n if (rangedOpeningTags[y].name === tag.name) {\n // we'll remove from opening tag's opening bracket to closing tag's\n // closing bracket because whitespace will be taken care of separately,\n // when tags themselves will be removed.\n // Basically, for each range tag there will be 3 removals:\n // opening tag, closing tag and all from opening to closing tag.\n // We keep removing opening and closing tags along whole range\n // because of few reasons: 1. cases of broken/dirty code, 2. keeping\n // the algorithm simpler, 3. opts that control whitespace removal\n // around tags.\n // 1. add range without caring about surrounding whitespace around\n // the range // also, tend filteredTagLocations in the output - tags which are to be\n // deleted with contents should be reported as one large range in\n // filteredTagLocations - from opening to closing - not two ranges\n /* istanbul ignore else */\n\n if (opts.stripTogetherWithTheirContents.includes(tag.name) || opts.stripTogetherWithTheirContents.includes(\"*\")) {\n filteredTagLocations = filteredTagLocations.filter(([from, upto]) => (from < rangedOpeningTags[y].lastOpeningBracketAt || from >= i + 1) && (upto <= rangedOpeningTags[y].lastOpeningBracketAt || upto > i + 1));\n }\n\n let endingIdx = i + 1;\n\n if (tag.lastClosingBracketAt) {\n endingIdx = tag.lastClosingBracketAt + 1;\n }\n filteredTagLocations.push([rangedOpeningTags[y].lastOpeningBracketAt, endingIdx]);\n /* istanbul ignore else */\n\n if (punctuation.has(str[i]) && opts.cb) {\n opts.cb({\n tag: tag,\n deleteFrom: rangedOpeningTags[y].lastOpeningBracketAt,\n deleteTo: i + 1,\n insert: null,\n rangesArr: rangesToDelete,\n proposedReturn: [rangedOpeningTags[y].lastOpeningBracketAt, i, null]\n }); // null will remove any spaces added so far. Opening and closing range tags might\n // have received spaces as separate entities, but those might not be necessary for range:\n // \"text <script>deleteme</script>.\"\n } else if (opts.cb) {\n opts.cb({\n tag: tag,\n deleteFrom: rangedOpeningTags[y].lastOpeningBracketAt,\n deleteTo: i,\n insert: \"\",\n rangesArr: rangesToDelete,\n proposedReturn: [rangedOpeningTags[y].lastOpeningBracketAt, i, \"\"]\n });\n } // 2. delete the reference to this range from rangedOpeningTags[]\n // because there might be more ranged tags of the same name or\n // different, overlapping or encompassing ranged tags with same\n // or different name.\n\n\n rangedOpeningTags.splice(y, 1); // 3. stop the loop\n\n break;\n }\n }\n } else {\n // opening tag.\n rangedOpeningTags.push(tag);\n }\n }\n }\n\n function calculateWhitespaceToInsert(str2, // whole string\n currCharIdx, // current index\n fromIdx, // leftmost whitespace edge around tag\n toIdx, // rightmost whitespace edge around tag\n lastOpeningBracketAt, // tag actually starts here (<)\n lastClosingBracketAt // tag actually ends here (>)\n ) {\n let strToEvaluateForLineBreaks = \"\";\n\n if (Number.isInteger(fromIdx) && fromIdx < lastOpeningBracketAt) {\n strToEvaluateForLineBreaks += str2.slice(fromIdx, lastOpeningBracketAt);\n }\n\n if (Number.isInteger(toIdx) && toIdx > lastClosingBracketAt + 1) {\n // limit whitespace that follows the tag, stop at linebreak. That's to make\n // the algorithm composable - we include linebreaks in front but not after.\n const temp = str2.slice(lastClosingBracketAt + 1, toIdx);\n\n if (temp.includes(\"\\n\") && isOpeningAt(toIdx, str2)) {\n strToEvaluateForLineBreaks += \" \";\n } else {\n strToEvaluateForLineBreaks += temp;\n }\n }\n\n if (!punctuation.has(str2[currCharIdx]) && str2[currCharIdx] !== \"!\") {\n const foundLineBreaks = strToEvaluateForLineBreaks.match(/\\n/g);\n\n if (Array.isArray(foundLineBreaks) && foundLineBreaks.length) {\n if (foundLineBreaks.length === 1) {\n return \"\\n\";\n }\n\n if (foundLineBreaks.length === 2) {\n return \"\\n\\n\";\n } // return three line breaks maximum\n\n\n return \"\\n\\n\\n\";\n } // default spacer - a single space\n\n\n return \" \";\n } // default case: space\n\n\n return \"\";\n }\n\n function calculateHrefToBeInserted(opts) {\n if (opts.dumpLinkHrefsNearby.enabled && hrefDump.tagName && hrefDump.tagName === tag.name && tag.lastOpeningBracketAt && (hrefDump.openingTagEnds && tag.lastOpeningBracketAt > hrefDump.openingTagEnds || !hrefDump.openingTagEnds)) {\n hrefInsertionActive = true;\n }\n\n if (hrefInsertionActive) {\n const lineBreaks = opts.dumpLinkHrefsNearby.putOnNewLine ? \"\\n\\n\" : \"\";\n stringToInsertAfter = `${lineBreaks}${hrefDump.hrefValue}${lineBreaks}`;\n }\n }\n\n function isOpeningAt(i, customStr) {\n if (customStr) {\n return customStr[i] === \"<\" && customStr[i + 1] !== \"%\";\n }\n\n return str[i] === \"<\" && str[i + 1] !== \"%\";\n }\n\n function isClosingAt(i) {\n return str[i] === \">\" && str[i - 1] !== \"%\";\n } // validation\n // ===========================================================================\n\n\n if (typeof str !== \"string\") {\n throw new TypeError(`string-strip-html/stripHtml(): [THROW_ID_01] Input must be string! Currently it's: ${(typeof str).toLowerCase()}, equal to:\\n${JSON.stringify(str, null, 4)}`);\n }\n\n if (originalOpts && !isObj(originalOpts)) {\n throw new TypeError(`string-strip-html/stripHtml(): [THROW_ID_02] Optional Options Object must be a plain object! Currently it's: ${(typeof originalOpts).toLowerCase()}, equal to:\\n${JSON.stringify(originalOpts, null, 4)}`);\n } // eslint-disable-next-line consistent-return\n\n\n function resetHrefMarkers() {\n // reset the hrefDump\n if (hrefInsertionActive) {\n hrefDump = {\n tagName: \"\",\n hrefValue: \"\",\n openingTagEnds: undefined\n };\n hrefInsertionActive = false;\n }\n } // prep opts\n // ===========================================================================\n\n\n const opts = { ...defaults,\n ...originalOpts\n };\n\n if (Object.prototype.hasOwnProperty.call(opts, \"returnRangesOnly\")) {\n throw new TypeError(`string-strip-html/stripHtml(): [THROW_ID_03] opts.returnRangesOnly has been removed from the API since v.5 release.`);\n } // filter non-string or whitespace entries from the following arrays or turn\n // them into arrays:\n\n\n opts.ignoreTags = prepHopefullyAnArray(opts.ignoreTags, \"opts.ignoreTags\");\n opts.onlyStripTags = prepHopefullyAnArray(opts.onlyStripTags, \"opts.onlyStripTags\"); // let's define the onlyStripTagsMode. Since opts.onlyStripTags can cancel\n // out the entries in opts.onlyStripTags, it can be empty but this mode has\n // to be switched on:\n\n const onlyStripTagsMode = !!opts.onlyStripTags.length; // if both opts.onlyStripTags and opts.ignoreTags are set, latter is respected,\n // we simply exclude ignored tags from the opts.onlyStripTags.\n\n if (opts.onlyStripTags.length && opts.ignoreTags.length) {\n opts.onlyStripTags = without(opts.onlyStripTags, ...opts.ignoreTags);\n }\n\n if (!isObj(opts.dumpLinkHrefsNearby)) {\n opts.dumpLinkHrefsNearby = { ...defaults.dumpLinkHrefsNearby\n };\n } // Object.assign doesn't deep merge, so we take care of opts.dumpLinkHrefsNearby:\n\n\n opts.dumpLinkHrefsNearby = defaults.dumpLinkHrefsNearby;\n\n if (originalOpts && Object.prototype.hasOwnProperty.call(originalOpts, \"dumpLinkHrefsNearby\") && existy(originalOpts.dumpLinkHrefsNearby)) {\n /* istanbul ignore else */\n if (isObj(originalOpts.dumpLinkHrefsNearby)) {\n opts.dumpLinkHrefsNearby = { ...defaults.dumpLinkHrefsNearby,\n ...originalOpts.dumpLinkHrefsNearby\n };\n } else if (originalOpts.dumpLinkHrefsNearby) {\n // checking to omit value as number zero\n throw new TypeError(`string-strip-html/stripHtml(): [THROW_ID_04] Optional Options Object's key dumpLinkHrefsNearby was set to ${typeof originalOpts.dumpLinkHrefsNearby}, equal to ${JSON.stringify(originalOpts.dumpLinkHrefsNearby, null, 4)}. The only allowed value is a plain object. See the API reference.`);\n }\n }\n\n if (!opts.stripTogetherWithTheirContents) {\n opts.stripTogetherWithTheirContents = [];\n } else if (typeof opts.stripTogetherWithTheirContents === \"string\" && opts.stripTogetherWithTheirContents.length) {\n opts.stripTogetherWithTheirContents = [opts.stripTogetherWithTheirContents];\n }\n\n const somethingCaught = {};\n\n if (opts.stripTogetherWithTheirContents && Array.isArray(opts.stripTogetherWithTheirContents) && opts.stripTogetherWithTheirContents.length && !opts.stripTogetherWithTheirContents.every((el, i) => {\n if (!(typeof el === \"string\")) {\n somethingCaught.el = el;\n somethingCaught.i = i;\n return false;\n }\n\n return true;\n })) {\n throw new TypeError(`string-strip-html/stripHtml(): [THROW_ID_05] Optional Options Object's key stripTogetherWithTheirContents was set to contain not just string elements! For example, element at index ${somethingCaught.i} has a value ${somethingCaught.el} which is not string but ${(typeof somethingCaught.el).toLowerCase()}.`);\n } // prep the opts.cb\n\n if (!opts.cb) {\n opts.cb = ({\n rangesArr,\n proposedReturn\n }) => {\n if (proposedReturn) {\n rangesArr.push(...proposedReturn);\n }\n };\n } // if the links have to be on a new line, we need to increase the allowance for line breaks\n // in Ranges class, it's the ranges-push API setting opts.limitLinebreaksCount\n // see https://www.npmjs.com/package/ranges-push#optional-options-object\n\n const rangesToDelete = new Ranges({\n limitToBeAddedWhitespace: true,\n limitLinebreaksCount: 2\n }); // TODO: it's chummy - ranges will be unreliable if initial str has changed\n // use ranges-ent-decode\n\n if (!opts.skipHtmlDecoding) {\n while (str !== decode(str, {\n scope: \"strict\"\n })) {\n // eslint-disable-next-line no-param-reassign\n str = decode(str, {\n scope: \"strict\"\n });\n }\n } // step 1.\n // ===========================================================================\n\n\n for (let i = 0, len = str.length; i < len; i++) { // catch the first ending of the spaces chunk that follows the closing bracket.\n // -------------------------------------------------------------------------\n // There can be no space after bracket, in that case, the result will be that character that\n // follows the closing bracket.\n // There can be bunch of spaces that end with EOF. In that case it's fine, this variable will\n // be null.\n\n if (Object.keys(tag).length > 1 && tag.lastClosingBracketAt && tag.lastClosingBracketAt < i && str[i] !== \" \" && spacesChunkWhichFollowsTheClosingBracketEndsAt === null) {\n spacesChunkWhichFollowsTheClosingBracketEndsAt = i;\n } // catch the closing bracket of dirty tags with missing opening brackets\n // -------------------------------------------------------------------------\n\n\n if (isClosingAt(i)) { // tend cases where opening bracket of a tag is missing:\n\n if ((!tag || Object.keys(tag).length < 2) && i > 1) { // traverse backwards either until start of string or \">\" is found\n\n for (let y = i; y--;) {\n\n if (str[y - 1] === undefined || isClosingAt(y)) {\n const startingPoint = str[y - 1] === undefined ? y : y + 1;\n const culprit = str.slice(startingPoint, i + 1); // Check if the culprit starts with a tag that's more likely a tag\n // name (like \"body\" or \"article\"). Single-letter tag names are excluded\n // because they can be plausible, ie. in math texts and so on.\n // Nobody uses puts comparison signs between words like: \"article > \",\n // but single letter names can be plausible: \"a > b\" in math.\n\n if (str !== `<${trim(culprit.trim(), \"/>\")}>` && // recursion prevention\n [...definitelyTagNames].some(val => trim(culprit.trim().split(/\\s+/).filter(val2 => val2.trim()).filter((_val3, i3) => i3 === 0), \"/>\").toLowerCase() === val) && stripHtml(`<${culprit.trim()}>`, opts).result === \"\") {\n /* istanbul ignore else */\n if (!allTagLocations.length || allTagLocations[allTagLocations.length - 1][0] !== tag.lastOpeningBracketAt) {\n allTagLocations.push([startingPoint, i + 1]);\n }\n /* istanbul ignore else */\n\n\n if (!filteredTagLocations.length || filteredTagLocations[filteredTagLocations.length - 1][0] !== tag.lastOpeningBracketAt) {\n filteredTagLocations.push([startingPoint, i + 1]);\n }\n\n const whiteSpaceCompensation = calculateWhitespaceToInsert(str, i, startingPoint, i + 1, startingPoint, i + 1);\n let deleteUpTo = i + 1;\n\n if (str[deleteUpTo] && !str[deleteUpTo].trim()) {\n for (let z = deleteUpTo; z < len; z++) {\n if (str[z].trim()) {\n deleteUpTo = z;\n break;\n }\n }\n }\n opts.cb({\n tag: tag,\n deleteFrom: startingPoint,\n deleteTo: deleteUpTo,\n insert: whiteSpaceCompensation,\n rangesArr: rangesToDelete,\n proposedReturn: [startingPoint, deleteUpTo, whiteSpaceCompensation]\n });\n }\n\n break;\n }\n }\n }\n } // catch slash\n // -------------------------------------------------------------------------\n\n\n if (str[i] === \"/\" && !(tag.quotes && tag.quotes.value) && Number.isInteger(tag.lastOpeningBracketAt) && !Number.isInteger(tag.lastClosingBracketAt)) {\n tag.slashPresent = i;\n } // catch double or single quotes\n // -------------------------------------------------------------------------\n\n\n if (str[i] === '\"' || str[i] === \"'\") {\n if (tag.nameStarts && tag.quotes && tag.quotes.value && tag.quotes.value === str[i]) {\n // 1. finish assembling the \"attrObj{}\"\n attrObj.valueEnds = i;\n attrObj.value = str.slice(attrObj.valueStarts, i);\n tag.attributes.push(attrObj); // reset:\n\n attrObj = {}; // 2. finally, delete the quotes marker, we don't need it any more\n\n tag.quotes = undefined; // 3. if opts.dumpLinkHrefsNearby.enabled is on, catch href\n\n let hrefVal;\n\n if (opts.dumpLinkHrefsNearby.enabled && // eslint-disable-next-line\n tag.attributes.some(obj => {\n if (obj.name && obj.name.toLowerCase() === \"href\") {\n hrefVal = `${opts.dumpLinkHrefsNearby.wrapHeads || \"\"}${obj.value}${opts.dumpLinkHrefsNearby.wrapTails || \"\"}`;\n return true;\n }\n })) {\n hrefDump = {\n tagName: tag.name,\n hrefValue: hrefVal,\n openingTagEnds: undefined\n };\n }\n } else if (!tag.quotes && tag.nameStarts) {\n // 1. if it's opening marker, record the type and location of quotes\n tag.quotes = {};\n tag.quotes.value = str[i];\n tag.quotes.start = i; // 2. start assembling the attribute object which we'll dump into tag.attributes[] array:\n\n if (attrObj.nameStarts && attrObj.nameEnds && attrObj.nameEnds < i && attrObj.nameStarts < i && !attrObj.valueStarts) {\n attrObj.name = str.slice(attrObj.nameStarts, attrObj.nameEnds);\n }\n }\n } // catch the ending of the tag name:\n // -------------------------------------------------------------------------\n\n\n if (tag.nameStarts !== undefined && tag.nameEnds === undefined && (!str[i].trim() || !characterSuitableForNames(str[i]))) {\n // 1. mark the name ending\n tag.nameEnds = i; // 2. extract the full name string\n\n tag.name = str.slice(tag.nameStarts, tag.nameEnds + (\n /* istanbul ignore next */\n !isClosingAt(i) && str[i] !== \"/\" && str[i + 1] === undefined ? 1 : 0));\n\n if ( // if we caught \"----\" from \"<----\" or \"---->\", bail:\n str[tag.nameStarts - 1] !== \"!\" && // protection against <!--\n !tag.name.replace(/-/g, \"\").length || // if tag name starts with a number character\n /^\\d+$/.test(tag.name[0])) {\n tag = {};\n continue;\n }\n\n if (isOpeningAt(i)) {\n // process it because we need to tackle this new tag\n calculateHrefToBeInserted(opts); // calculateWhitespaceToInsert() API:\n // str, // whole string\n // currCharIdx, // current index\n // fromIdx, // leftmost whitespace edge around tag\n // toIdx, // rightmost whitespace edge around tag\n // lastOpeningBracketAt, // tag actually starts here (<)\n // lastClosingBracketAt // tag actually ends here (>)\n\n const whiteSpaceCompensation = calculateWhitespaceToInsert(str, i, tag.leftOuterWhitespace, i, tag.lastOpeningBracketAt, i); // only on pair tags, exclude the opening counterpart and closing\n // counterpart if whole pair is to be deleted\n\n if (opts.stripTogetherWithTheirContents.includes(tag.name) || opts.stripTogetherWithTheirContents.includes(\"*\")) {\n /* istanbul ignore next */\n\n filteredTagLocations = filteredTagLocations.filter(([from, upto]) => !(from === tag.leftOuterWhitespace && upto === i));\n } // console.log(\n // `1011 ${`\\u001b[${32}m${`PUSH`}\\u001b[${39}m`} [${\n // tag.leftOuterWhitespace\n // }, ${i}] to filteredTagLocations`\n // );\n // filteredTagLocations.push([tag.leftOuterWhitespace, i]);\n\n\n opts.cb({\n tag: tag,\n deleteFrom: tag.leftOuterWhitespace,\n deleteTo: i,\n insert: `${whiteSpaceCompensation}${stringToInsertAfter}${whiteSpaceCompensation}`,\n rangesArr: rangesToDelete,\n proposedReturn: [tag.leftOuterWhitespace, i, `${whiteSpaceCompensation}${stringToInsertAfter}${whiteSpaceCompensation}`]\n });\n resetHrefMarkers(); // also,\n\n treatRangedTags(i, opts, rangesToDelete);\n }\n } // catch beginning of an attribute value\n // -------------------------------------------------------------------------\n\n\n if (tag.quotes && tag.quotes.start && tag.quotes.start < i && !tag.quotes.end && attrObj.nameEnds && attrObj.equalsAt && !attrObj.valueStarts) {\n attrObj.valueStarts = i;\n } // catch rare cases when attributes name has some space after it, before equals\n // -------------------------------------------------------------------------\n\n\n if (!tag.quotes && attrObj.nameEnds && str[i] === \"=\" && !attrObj.valueStarts && !attrObj.equalsAt) {\n attrObj.equalsAt = i;\n } // catch the ending of the whole attribute\n // -------------------------------------------------------------------------\n // for example, <a b c> this \"c\" ends \"b\" because it's not \"equals\" sign.\n // We even anticipate for cases where whitespace anywhere between attribute parts:\n // < article class = \" something \" / >\n\n\n if (!tag.quotes && attrObj.nameStarts && attrObj.nameEnds && !attrObj.valueStarts && str[i].trim() && str[i] !== \"=\") {\n // if (!tag.attributes) {\n // tag.attributes = [];\n // }\n tag.attributes.push(attrObj);\n attrObj = {};\n } // catch the ending of an attribute's name\n // -------------------------------------------------------------------------\n\n\n if (!tag.quotes && attrObj.nameStarts && !attrObj.nameEnds) {\n\n if (!str[i].trim()) {\n attrObj.nameEnds = i;\n attrObj.name = str.slice(attrObj.nameStarts, attrObj.nameEnds);\n } else if (str[i] === \"=\") {\n /* istanbul ignore else */\n\n if (!attrObj.equalsAt) {\n attrObj.nameEnds = i;\n attrObj.equalsAt = i;\n attrObj.name = str.slice(attrObj.nameStarts, attrObj.nameEnds);\n }\n } else if (str[i] === \"/\" || isClosingAt(i)) {\n attrObj.nameEnds = i;\n attrObj.name = str.slice(attrObj.nameStarts, attrObj.nameEnds); // if (!tag.attributes) {\n // tag.attributes = [];\n // }\n\n tag.attributes.push(attrObj);\n attrObj = {};\n } else if (isOpeningAt(i)) { // TODO - address both cases of onlyPlausible\n\n attrObj.nameEnds = i;\n attrObj.name = str.slice(attrObj.nameStarts, attrObj.nameEnds); // if (!tag.attributes) {\n // tag.attributes = [];\n // }\n\n tag.attributes.push(attrObj);\n attrObj = {};\n }\n } // catch the beginning of an attribute's name\n // -------------------------------------------------------------------------\n\n\n if (!tag.quotes && tag.nameEnds < i && !str[i - 1].trim() && str[i].trim() && !`<>/!`.includes(str[i]) && !attrObj.nameStarts && !tag.lastClosingBracketAt) {\n attrObj.nameStarts = i;\n } // catch \"< /\" - turn off \"onlyPlausible\"\n // -------------------------------------------------------------------------\n\n\n if (tag.lastOpeningBracketAt !== null && tag.lastOpeningBracketAt < i && str[i] === \"/\" && tag.onlyPlausible) {\n tag.onlyPlausible = false;\n } // catch character that follows an opening bracket:\n // -------------------------------------------------------------------------\n\n\n if (tag.lastOpeningBracketAt !== null && tag.lastOpeningBracketAt < i && str[i] !== \"/\" // there can be closing slashes in various places, legit and not\n ) {\n // 1. identify, is it definite or just plausible tag\n if (tag.onlyPlausible === undefined) {\n if ((!str[i].trim() || isOpeningAt(i)) && !tag.slashPresent) {\n tag.onlyPlausible = true;\n } else {\n tag.onlyPlausible = false;\n }\n } // 2. catch the beginning of the tag name. Consider custom HTML tag names\n // and also known (X)HTML tags:\n\n\n if (str[i].trim() && tag.nameStarts === undefined && !isOpeningAt(i) && str[i] !== \"/\" && !isClosingAt(i) && str[i] !== \"!\") {\n tag.nameStarts = i;\n tag.nameContainsLetters = false;\n }\n } // Catch letters in the tag name. Necessary to filter out false positives like \"<------\"\n\n\n if (tag.nameStarts && !tag.quotes && str[i].toLowerCase() !== str[i].toUpperCase()) {\n tag.nameContainsLetters = true;\n } // catch closing bracket\n // -------------------------------------------------------------------------\n\n\n if ( // it's closing bracket\n isClosingAt(i) && //\n // precaution against JSP comparison\n // kl <c:when test=\"${!empty ab.cd && ab.cd > 0.00}\"> mn\n // ^\n // we're here, it's false ending\n //\n notWithinAttrQuotes(tag, str, i)) {\n\n if (tag.lastOpeningBracketAt !== undefined) {\n // 1. mark the index\n tag.lastClosingBracketAt = i; // 2. reset the spacesChunkWhichFollowsTheClosingBracketEndsAt\n\n spacesChunkWhichFollowsTheClosingBracketEndsAt = null; // 3. push attrObj into tag.attributes[]\n\n if (Object.keys(attrObj).length) { // if (!tag.attributes) {\n // tag.attributes = [];\n // }\n\n tag.attributes.push(attrObj);\n attrObj = {};\n } // 4. if opts.dumpLinkHrefsNearby.enabled is on and we just recorded an href,\n\n\n if (opts.dumpLinkHrefsNearby.enabled && hrefDump.tagName && !hrefDump.openingTagEnds) {\n // finish assembling the hrefDump{}\n hrefDump.openingTagEnds = i; // or tag.lastClosingBracketAt, same\n }\n }\n } // catch the ending of the tag\n // -------------------------------------------------------------------------\n // the tag is \"released\" into \"rApply\":\n\n\n if (tag.lastOpeningBracketAt !== undefined) {\n\n if (tag.lastClosingBracketAt === undefined) {\n\n if (tag.lastOpeningBracketAt < i && !isOpeningAt(i) && ( // to prevent cases like \"text <<<<<< text\"\n str[i + 1] === undefined || isOpeningAt(i + 1)) && tag.nameContainsLetters) { // find out the tag name earlier than dedicated tag name ending catching section:\n // if (str[i + 1] === undefined) {\n\n tag.name = str.slice(tag.nameStarts, tag.nameEnds ? tag.nameEnds : i + 1).toLowerCase(); // submit tag to allTagLocations\n\n /* istanbul ignore else */\n\n if (!allTagLocations.length || allTagLocations[allTagLocations.length - 1][0] !== tag.lastOpeningBracketAt) {\n allTagLocations.push([tag.lastOpeningBracketAt, i + 1]);\n }\n\n if ( // if it's an ignored tag\n opts.ignoreTags.includes(tag.name) || // or just plausible and unrecognised\n tag.onlyPlausible && !definitelyTagNames.has(tag.name)) {\n tag = {};\n attrObj = {};\n continue;\n } // if the tag is only plausible (there's space after opening bracket) and it's not among\n // recognised tags, leave it as it is:\n\n if ((definitelyTagNames.has(tag.name) || singleLetterTags.has(tag.name)) && (tag.onlyPlausible === false || tag.onlyPlausible === true && tag.attributes.length) || str[i + 1] === undefined) {\n calculateHrefToBeInserted(opts);\n const whiteSpaceCompensation = calculateWhitespaceToInsert(str, i, tag.leftOuterWhitespace, i + 1, tag.lastOpeningBracketAt, tag.lastClosingBracketAt);\n opts.cb({\n tag: tag,\n deleteFrom: tag.leftOuterWhitespace,\n deleteTo: i + 1,\n insert: `${whiteSpaceCompensation}${stringToInsertAfter}${whiteSpaceCompensation}`,\n rangesArr: rangesToDelete,\n proposedReturn: [tag.leftOuterWhitespace, i + 1, `${whiteSpaceCompensation}${stringToInsertAfter}${whiteSpaceCompensation}`]\n });\n resetHrefMarkers(); // also,\n\n treatRangedTags(i, opts, rangesToDelete);\n }\n /* istanbul ignore else */\n\n if (!filteredTagLocations.length || filteredTagLocations[filteredTagLocations.length - 1][0] !== tag.lastOpeningBracketAt && filteredTagLocations[filteredTagLocations.length - 1][1] !== i + 1) { // filter out opening/closing tag pair because whole chunk\n // from opening's opening to closing's closing will be pushed\n\n if (opts.stripTogetherWithTheirContents.includes(tag.name) || opts.stripTogetherWithTheirContents.includes(\"*\")) { // get the last opening counterpart of the pair\n // iterate rangedOpeningTags from the, pick the first\n // ranged opening tag whose name is same like current, closing's\n\n let lastRangedOpeningTag;\n\n for (let z = rangedOpeningTags.length; z--;) {\n /* istanbul ignore else */\n if (rangedOpeningTags[z].name === tag.name) {\n lastRangedOpeningTag = rangedOpeningTags[z];\n }\n }\n /* istanbul ignore else */\n\n\n if (lastRangedOpeningTag) {\n filteredTagLocations = filteredTagLocations.filter(([from]) => from !== lastRangedOpeningTag.lastOpeningBracketAt);\n filteredTagLocations.push([lastRangedOpeningTag.lastOpeningBracketAt, i + 1]);\n } else {\n /* istanbul ignore next */\n filteredTagLocations.push([tag.lastOpeningBracketAt, i + 1]);\n }\n } else {\n // if it's not ranged tag, just push it as it is to filteredTagLocations\n filteredTagLocations.push([tag.lastOpeningBracketAt, i + 1]);\n }\n }\n }\n } else if (i > tag.lastClosingBracketAt && str[i].trim() || str[i + 1] === undefined) { // case 2. closing bracket HAS BEEN met\n // we'll look for a non-whitespace character and delete up to it\n // BUT, we'll wipe the tag object only if that non-whitespace character\n // is not a \">\". This way we'll catch and delete sequences of closing brackets.\n // part 1.\n\n let endingRangeIndex = tag.lastClosingBracketAt === i ? i + 1 : i;\n\n if (opts.trimOnlySpaces && endingRangeIndex === len - 1 && spacesChunkWhichFollowsTheClosingBracketEndsAt !== null && spacesChunkWhichFollowsTheClosingBracketEndsAt < i) {\n endingRangeIndex = spacesChunkWhichFollowsTheClosingBracketEndsAt;\n } // if it's a dodgy suspicious tag where space follows opening bracket, there's an extra requirement\n // for this tag to be considered a tag - there has to be at least one attribute with equals if\n // the tag name is not recognised. // submit tag to allTagLocations\n\n /* istanbul ignore else */\n\n if (!allTagLocations.length || allTagLocations[allTagLocations.length - 1][0] !== tag.lastOpeningBracketAt) {\n allTagLocations.push([tag.lastOpeningBracketAt, tag.lastClosingBracketAt + 1]);\n }\n\n if (!onlyStripTagsMode && opts.ignoreTags.includes(tag.name) || onlyStripTagsMode && !opts.onlyStripTags.includes(tag.name)) {\n // ping the callback with nulls:\n opts.cb({\n tag: tag,\n deleteFrom: null,\n deleteTo: null,\n insert: null,\n rangesArr: rangesToDelete,\n proposedReturn: null\n }); // don't submit the tag onto \"filteredTagLocations\"\n // then reset:\n tag = {};\n attrObj = {}; // continue;\n } else if (!tag.onlyPlausible || // tag name is recognised and there are no attributes:\n tag.attributes.length === 0 && tag.name && (definitelyTagNames.has(tag.name.toLowerCase()) || singleLetterTags.has(tag.name.toLowerCase())) || // OR there is at least one equals that follow the attribute's name:\n tag.attributes && tag.attributes.some(attrObj2 => attrObj2.equalsAt)) {\n // submit tag to filteredTagLocations\n\n /* istanbul ignore else */\n if (!filteredTagLocations.length || filteredTagLocations[filteredTagLocations.length - 1][0] !== tag.lastOpeningBracketAt) {\n filteredTagLocations.push([tag.lastOpeningBracketAt, tag.lastClosingBracketAt + 1]);\n } // if this was an ignored tag name, algorithm would have bailed earlier,\n // in stage \"catch the ending of the tag name\".\n\n\n const whiteSpaceCompensation = calculateWhitespaceToInsert(str, i, tag.leftOuterWhitespace, endingRangeIndex, tag.lastOpeningBracketAt, tag.lastClosingBracketAt); // calculate optional opts.dumpLinkHrefsNearby.enabled HREF to insert\n\n stringToInsertAfter = \"\";\n hrefInsertionActive = false;\n calculateHrefToBeInserted(opts);\n let insert;\n\n if (isStr(stringToInsertAfter) && stringToInsertAfter.length) {\n insert = `${whiteSpaceCompensation}${stringToInsertAfter}${\n /* istanbul ignore next */\n whiteSpaceCompensation === \"\\n\\n\" ? \"\\n\" : whiteSpaceCompensation}`;\n } else {\n insert = whiteSpaceCompensation;\n }\n\n if (tag.leftOuterWhitespace === 0 || !right(str, endingRangeIndex - 1)) {\n insert = \"\";\n } // pass the range onto the callback function, be it default or user's\n opts.cb({\n tag: tag,\n deleteFrom: tag.leftOuterWhitespace,\n deleteTo: endingRangeIndex,\n insert,\n rangesArr: rangesToDelete,\n proposedReturn: [tag.leftOuterWhitespace, endingRangeIndex, insert]\n });\n resetHrefMarkers(); // also,\n\n treatRangedTags(i, opts, rangesToDelete);\n } else {\n tag = {};\n } // part 2.\n\n\n if (!isClosingAt(i)) {\n tag = {};\n }\n }\n } // catch an opening bracket\n // -------------------------------------------------------------------------\n\n\n if (isOpeningAt(i) && !isOpeningAt(i - 1) && !`'\"`.includes(str[i + 1]) && (!`'\"`.includes(str[i + 2]) || /\\w/.test(str[i + 1])) && //\n // precaution JSP,\n // against <c:\n !(str[i + 1] === \"c\" && str[i + 2] === \":\") && // against <fmt:\n !(str[i + 1] === \"f\" && str[i + 2] === \"m\" && str[i + 3] === \"t\" && str[i + 4] === \":\") && // against <sql:\n !(str[i + 1] === \"s\" && str[i + 2] === \"q\" && str[i + 3] === \"l\" && str[i + 4] === \":\") && // against <x:\n !(str[i + 1] === \"x\" && str[i + 2] === \":\") && // against <fn:\n !(str[i + 1] === \"f\" && str[i + 2] === \"n\" && str[i + 3] === \":\") && //\n // kl <c:when test=\"${!empty ab.cd && ab.cd < 0.00}\"> mn\n // ^\n // we're here, it's false alarm\n notWithinAttrQuotes(tag, str, i)) { // cater sequences of opening brackets \"<<<<div>>>\"\n\n if (isClosingAt(right(str, i))) {\n // cater cases like: \"<><><>\"\n continue;\n } else { // 1. Before (re)setting flags, check, do we have a case of a tag with a\n // missing closing bracket, and this is a new tag following it.\n\n if (tag.nameEnds && tag.nameEnds < i && !tag.lastClosingBracketAt) {\n\n if (tag.onlyPlausible === true && tag.attributes && tag.attributes.length || tag.onlyPlausible === false) { // tag.onlyPlausible can be undefined too\n\n const whiteSpaceCompensation = calculateWhitespaceToInsert(str, i, tag.leftOuterWhitespace, i, tag.lastOpeningBracketAt, i);\n opts.cb({\n tag: tag,\n deleteFrom: tag.leftOuterWhitespace,\n deleteTo: i,\n insert: whiteSpaceCompensation,\n rangesArr: rangesToDelete,\n proposedReturn: [tag.leftOuterWhitespace, i, whiteSpaceCompensation]\n }); // also,\n\n treatRangedTags(i, opts, rangesToDelete); // then, for continuity, mark everything up accordingly if it's a new bracket:\n\n tag = {};\n attrObj = {};\n }\n } // 2. if new tag starts, reset:\n\n\n if (tag.lastOpeningBracketAt !== undefined && tag.onlyPlausible && tag.name && !tag.quotes) {\n // reset:\n tag.lastOpeningBracketAt = undefined;\n tag.name = undefined;\n tag.onlyPlausible = false;\n }\n\n if ((tag.lastOpeningBracketAt === undefined || !tag.onlyPlausible) && !tag.quotes) {\n tag.lastOpeningBracketAt = i;\n tag.slashPresent = false;\n tag.attributes = []; // since 2.1.0 we started to care about not trimming outer whitespace which is not spaces.\n // For example, \" \\t <a> \\n \". Tag's whitespace boundaries should not extend to string\n // edges but until \"\\t\" on the left and \"\\n\" on the right IF opts.trimOnlySpaces is on.\n\n if (chunkOfWhitespaceStartsAt === null) {\n tag.leftOuterWhitespace = i;\n } else if (opts.trimOnlySpaces && chunkOfWhitespaceStartsAt === 0) {\n // if whitespace extends to the beginning of a string, there's a risk it might include\n // not only spaces. To fix that, switch to space-only range marker:\n\n /* istanbul ignore next */\n tag.leftOuterWhitespace = chunkOfSpacesStartsAt || i;\n } else {\n tag.leftOuterWhitespace = chunkOfWhitespaceStartsAt;\n } // tag.leftOuterWhitespace =\n // chunkOfWhitespaceStartsAt === null ? i : chunkOfWhitespaceStartsAt; // tend the HTML comments: <!-- --> or CDATA: <![CDATA[ ... ]]>\n // if opening comment tag is detected, traverse forward aggressively\n // until EOL or \"-->\" is reached and offset outer index \"i\".\n\n if (`${str[i + 1]}${str[i + 2]}${str[i + 3]}` === \"!--\" || `${str[i + 1]}${str[i + 2]}${str[i + 3]}${str[i + 4]}${str[i + 5]}${str[i + 6]}${str[i + 7]}${str[i + 8]}` === \"![CDATA[\") { // make a note which one it is:\n\n let cdata = true;\n\n if (str[i + 2] === \"-\") {\n cdata = false;\n }\n let closingFoundAt;\n\n for (let y = i; y < len; y++) {\n\n if (!closingFoundAt && cdata && `${str[y - 2]}${str[y - 1]}${str[y]}` === \"]]>\" || !cdata && `${str[y - 2]}${str[y - 1]}${str[y]}` === \"-->\") {\n closingFoundAt = y;\n }\n\n if (closingFoundAt && (closingFoundAt < y && str[y].trim() || str[y + 1] === undefined)) {\n let rangeEnd = y;\n\n if (str[y + 1] === undefined && !str[y].trim() || str[y] === \">\") {\n rangeEnd += 1;\n } // submit the tag\n\n /* istanbul ignore else */\n\n\n if (!allTagLocations.length || allTagLocations[allTagLocations.length - 1][0] !== tag.lastOpeningBracketAt) {\n allTagLocations.push([tag.lastOpeningBracketAt, closingFoundAt + 1]);\n }\n /* istanbul ignore else */\n\n\n if (!filteredTagLocations.length || filteredTagLocations[filteredTagLocations.length - 1][0] !== tag.lastOpeningBracketAt) {\n filteredTagLocations.push([tag.lastOpeningBracketAt, closingFoundAt + 1]);\n }\n\n const whiteSpaceCompensation = calculateWhitespaceToInsert(str, y, tag.leftOuterWhitespace, rangeEnd, tag.lastOpeningBracketAt, closingFoundAt);\n opts.cb({\n tag: tag,\n deleteFrom: tag.leftOuterWhitespace,\n deleteTo: rangeEnd,\n insert: whiteSpaceCompensation,\n rangesArr: rangesToDelete,\n proposedReturn: [tag.leftOuterWhitespace, rangeEnd, whiteSpaceCompensation]\n }); // offset:\n\n i = y - 1;\n\n if (str[y] === \">\") {\n i = y;\n } // resets:\n\n\n tag = {};\n attrObj = {}; // finally,\n\n break;\n }\n }\n }\n }\n }\n } // catch whitespace\n // -------------------------------------------------------------------------\n\n\n if (!str[i].trim()) {\n // 1. catch chunk boundaries:\n if (chunkOfWhitespaceStartsAt === null) {\n chunkOfWhitespaceStartsAt = i;\n\n if (tag.lastOpeningBracketAt !== undefined && tag.lastOpeningBracketAt < i && tag.nameStarts && tag.nameStarts < tag.lastOpeningBracketAt && i === tag.lastOpeningBracketAt + 1 && // insurance against tail part of ranged tag being deleted:\n !rangedOpeningTags.some( // eslint-disable-next-line no-loop-func\n rangedTagObj => rangedTagObj.name === tag.name)) {\n tag.onlyPlausible = true;\n tag.name = undefined;\n tag.nameStarts = undefined;\n }\n }\n } else if (chunkOfWhitespaceStartsAt !== null) { // 1. piggyback the catching of the attributes with equal and no value\n\n if (!tag.quotes && attrObj.equalsAt > chunkOfWhitespaceStartsAt - 1 && attrObj.nameEnds && attrObj.equalsAt > attrObj.nameEnds && str[i] !== '\"' && str[i] !== \"'\") {\n /* istanbul ignore else */\n if (isObj(attrObj)) {\n tag.attributes.push(attrObj);\n } // reset:\n\n\n attrObj = {};\n tag.equalsSpottedAt = undefined;\n } // 2. reset whitespace marker\n\n\n chunkOfWhitespaceStartsAt = null;\n } // catch spaces-only chunks (needed for outer trim option opts.trimOnlySpaces)\n // -------------------------------------------------------------------------\n\n\n if (str[i] === \" \") {\n // 1. catch spaces boundaries:\n if (chunkOfSpacesStartsAt === null) {\n chunkOfSpacesStartsAt = i;\n }\n } else if (chunkOfSpacesStartsAt !== null) {\n // 2. reset the marker\n chunkOfSpacesStartsAt = null;\n } // log all\n // ------------------------------------------------------------------------- // console.log(\n // `${`\\u001b[${33}m${`chunkOfSpacesStartsAt`}\\u001b[${39}m`} = ${JSON.stringify(\n // chunkOfSpacesStartsAt,\n // null,\n // 4\n // )}`\n // ); // console.log(\n // `${`\\u001b[${33}m${`chunkOfWhitespaceStartsAt`}\\u001b[${39}m`} = ${JSON.stringify(\n // chunkOfWhitespaceStartsAt,\n // null,\n // 4\n // )}`\n // );\n } // trim but in ranges\n // first tackle the beginning on the string\n\n if (str && ( // if only spaces were meant to be trimmed,\n opts.trimOnlySpaces && // and first character is a space\n str[0] === \" \" || // if normal trim is requested\n !opts.trimOnlySpaces && // and the first character is whitespace character\n !str[0].trim())) {\n\n for (let i = 0, len = str.length; i < len; i++) {\n if (opts.trimOnlySpaces && str[i] !== \" \" || !opts.trimOnlySpaces && str[i].trim()) {\n rangesToDelete.push([0, i]);\n break;\n } else if (!str[i + 1]) {\n // if end has been reached and whole string has been trimmable\n rangesToDelete.push([0, i + 1]);\n }\n }\n }\n\n if (str && ( // if only spaces were meant to be trimmed,\n opts.trimOnlySpaces && // and last character is a space\n str[str.length - 1] === \" \" || // if normal trim is requested\n !opts.trimOnlySpaces && // and the last character is whitespace character\n !str[str.length - 1].trim())) {\n for (let i = str.length; i--;) {\n if (opts.trimOnlySpaces && str[i] !== \" \" || !opts.trimOnlySpaces && str[i].trim()) {\n rangesToDelete.push([i + 1, str.length]);\n break;\n } // don't tackle end-to-end because it would have been already caught on the\n // start-to-end direction loop above.\n\n }\n } // last correction, imagine we've got text-whitespace-tag.\n // That last part \"tag\" was removed but \"whitespace\" in between is on the left.\n // We need to trim() that too if applicable.\n // By now we'll be able to tell, is starting/ending range array touching\n // the start (index 0) or end (str.length - 1) character indexes, and if so,\n // their inner sides will need to be trimmed accordingly, considering the\n // \"opts.trimOnlySpaces\" of course.\n\n\n const curr = rangesToDelete.current();\n\n if ((!originalOpts || !originalOpts.cb) && curr) {\n // check front - the first range of gathered ranges, does it touch start (0)\n if (curr[0] && !curr[0][0]) {\n curr[0][1]; // check the character at str[startingIdx] // manually edit Ranges class:\n\n rangesToDelete.ranges[0] = [rangesToDelete.ranges[0][0], rangesToDelete.ranges[0][1]];\n } // check end - the last range of gathered ranges, does it touch the end (str.length)\n // PS. remember ending is not inclusive, so ranges covering the whole ending\n // would go up to str.length, not up to str.length - 1!\n\n\n if (curr[curr.length - 1] && curr[curr.length - 1][1] === str.length) {\n curr[curr.length - 1][0]; // check character at str[startingIdx - 1] // remove third element from the last range \"what to add\" - because\n // ranges will crop aggressively, covering all whitespace, but they\n // then restore missing spaces (in which case it's not missing).\n // We already have tight crop, we just need to remove that \"what to add\"\n // third element.\n // hard edit:\n\n /* istanbul ignore else */\n\n if (rangesToDelete.ranges) {\n let startingIdx2 = rangesToDelete.ranges[rangesToDelete.ranges.length - 1][0];\n\n if (str[startingIdx2 - 1] && (opts.trimOnlySpaces && str[startingIdx2 - 1] === \" \" || !opts.trimOnlySpaces && !str[startingIdx2 - 1].trim())) {\n startingIdx2 -= 1;\n }\n\n const backupWhatToAdd = rangesToDelete.ranges[rangesToDelete.ranges.length - 1][2];\n rangesToDelete.ranges[rangesToDelete.ranges.length - 1] = [startingIdx2, rangesToDelete.ranges[rangesToDelete.ranges.length - 1][1]]; // for cases of opts.dumpLinkHrefsNearby\n\n if (backupWhatToAdd && backupWhatToAdd.trim()) {\n rangesToDelete.ranges[rangesToDelete.ranges.length - 1].push(backupWhatToAdd.trimEnd());\n }\n }\n }\n }\n\n const res = {\n log: {\n timeTakenInMilliseconds: Date.now() - start\n },\n result: rApply(str, rangesToDelete.current()),\n ranges: rangesToDelete.current(),\n allTagLocations,\n filteredTagLocations\n };\n return res;\n}", "function cleanHTMLContent(str){\n\tstr = str.toLowerCase();\n\tvar body_pos = str.indexOf(\"<body>\");\n\tstr = str.substring(body_pos);\n\tstr = str.replace(\"<body>\",\"<div>\");\n\tstr = str.replace(\"</body>\",\"</div>\");\n\tstr = str.replace(\"</html>\",\"\");\n\treturn str;\n}", "function rmHtmlTags(str){\n if(typeof str !== 'string'){\n throw new Error(\"parameter should be a string\");\n }\n let regex= /<[a-zA-Z/]*>/g;\n return str.replace(regex, \"\");\n \n \n}", "function onIgnoreTagStripAll() {\n return \"\";\n }", "function onIgnoreTagStripAll() {\n return \"\";\n }", "function onIgnoreTagStripAll(){return\"\";}", "function hstrip(eme){\r\n\teme = eme.replace(/\\n/g,\"\\\\n\")\r\n\teme = eme.replace(/<a.+?addclass.+?see more<\\/a>/g,\"\");/*special case: \"see more\" is a meme-spreading group. adding that to your blocklist will generate A TON of false-positivies.*/\r\n\teme = eme.replace(/<\\/?a ?.+?>/g,\"\");/*don't look *inside* tags*/\r\n\teme = eme.replace(/<\\/?i ?.+?>/g,\"\");/*don't look *inside* tags*/\r\n\teme = eme.replace(/<\\/?img ?.+?>/g,\"\");/*don't look *inside* tags*/\r\n\teme = eme.replace(/<\\/?div ?.+?>/g,\"\");/*don't look *inside* tags*/\r\n\teme = eme.replace(/<\\/?h5 ?.+?>/g,\"\");/*don't look *inside* tags*/\r\n\teme = eme.replace(/<\\/?li ?.+?>/g,\"\");/*don't look *inside* tags*/\r\n\teme = eme.replace(/<\\/?form ?.+?>/g,\"\");/*don't look *inside* tags*/\r\n\teme = eme.replace(/<\\/?span ?.+?>/g,\"\");/*don't look *inside* tags*/\r\n\teme = eme.replace(/<\\/?label ?.+?>/g,\"\");/*don't look *inside* tags*/\r\n\teme = eme.replace(/&quot;/g,'\"');/*basic stuff that apparently caused problems.*/\r\n\teme = eme.replace(/&amp;/g,'&');\r\n\teme = eme.replace(/&lt;/g,'<');\r\n\teme = eme.replace(/&gt;/g,'>');\r\n\treturn eme\r\n}", "function normalize(html) {\n return html.replace(/\\s*/g, '');\n}", "function stripHtmlTags(str){\n\t str = toString(str);\n\n\t return str.replace(/<[^>]*>/g, '');\n\t }", "function cleanHTML(someHTML) {\n\t/*\tthis function is disgusting\n\t**\t\tbasic attribute check logic is sound\n\t**\t\tthe flow is insanity\n\t**\t\tneed to redo, but just want to go faster\n\t*/\n\n\tconsole.log(\"cleaning some html; \" + someHTML);\n\tvar squeeky = someHTML;\n\tvar first, second, tag, last, chugger = 0;\n\t//\tref is for attribute keys (references), reflink href=\"reflink\",\n\t//\t\treftext is <a...>reftext</a>, refflag is currently used for\n\t//\t\temojis, as to use the same attribute check loop to get the \n\t//\t\tlink and title, a bit of a dirty hack but leaving it for the \n\t//\t\tmoment\n\tvar ref, reflink, reftext, refflag;\n\n\tvar loopflag;\n\t//\tthis chugger variable will act as a counter outside scope of tag\n\t//\t\tcheck loop, will provide reference for safe tags, and\n\t//\t\tposition to start next tag search from\n\tif ((squeeky.indexOf('<') >= 0) && (chugger < squeeky.length)) {\n\t\t//\ttodo, add that jsdom handling mechanism\n\t\t//\t\tand then redo all of the brute force madness below\n\t\tloopflag = true;\n\t} else {\n\t\tconsole.log(\" there is \" + ((squeeky.indexOf('<') >= 0) ? \"a\" : \"no\") + \" < | the counter; \" + chugger + \"; is \"+((chugger < squeeky.length)?\"less\":\"geater (or equal to)\")+\" than the total length; \" + squeeky.length);\n\t\tconsole.log(\" not processing, nothing left to clean\")\n\t\tloopflag = false;\n\t}\n\twhile (loopflag == true) {\n\t\t//\tneed to check for;\n\t\t//\t\t<b> tags, used in handles in the form;\n\t\t//\t\t\t\"@<b>everysnake</b>\"\n\t\t//\t\t<a> tags, main links, images, other users, etc.\n\t\t//\t\t<span>, I've seen it in some tweets, not sure on usage\n\t\t//\t\t<img> tags for user profile pictures\n\n\t\t//\tget the tag\n\t\t//\ttodo; need to get index of angles AFTER value of (last + len\n\t\t//\t\tthis would actually cancel out recursion idea, and is \n\t\t//first = squeeky.indexOf('<');\n\t\t//second = squeeky.indexOf('>');\n\t\t//\tto continue on to next tag after a cst tag\n\t\tfirst = squeeky.substr(chugger).indexOf('<') + chugger;\n\t\tsecond = squeeky.substr(chugger).indexOf('>') + chugger;\n\t\ttag = \"\";\n\n\t\t//\tadding one to first to check everything after the <\n\t\tfirst++;\n\t\t//\tgetting the actual tag, i.e. <a href=...., take just the a\n\t\twhile ((first < second) && (squeeky.charAt(first) != ' ')) {\n\t\t\t//console.log(\"chtml, char at; \" + first + \"; is; \" + squeeky.charAt(first));\n\t\t\ttag += squeeky.charAt(first);\n\t\t\tfirst++;\n\t\t}\n\n\t\t//\tget the closign tag 'last'\n\t\t//last = squeeky.indexOf(\"</\" + tag + \">\");\n\t\t//last = squeeky.substr(chugger).indexOf(\"</\" + tag + \">\") + chugger;\n\t\t//\tlooks like we've slipped a rung on the sanity ladder\n\t\t//last = chugger + (squeeky.substr(chugger).length - (squeeky.substr(chugger).split(\"\").reverse().join(\"\").indexOf((\"</\" + tag + \">\").split(\"\").reverse().join(\"\")) + (\"</\" + tag + \">\").length));\n\t\t//\tyeah pure madness\n\t\t//\t\tfeel like I should definitely figure out recursion\n\t\tif (tag == \"img\") {\n\t\t\tlast = second;\n\t\t} else {\n\t\t\tlast = squeeky.substr(chugger).indexOf(\"</\" + tag + \">\") + chugger;\n\t\t}\n\n\n\t\t//console.log(\"frst; \" + first + \"; scnd; \" + second);\nvar sizeflag = 50;\n//if ((chugger > 0) || ((last - second) > sizeflag)) {\n\tconsole.log(\" tot text is; \" + replaceSpace(squeeky));\n\tconsole.log(\" sub text is; \" + replaceSpace(squeeky.substr(chugger)));\n\tconsole.log(\" first < is; \" + padSpace(first - 2 - chugger));\n\tconsole.log(\" second > is; \" + padSpace(second - chugger));\n\tconsole.log(\" 1st lst tag; \" + padSpace(last - chugger));\n\tconsole.log(\" first; \"+(first-2)+\"; second;\"+second+\"; last;\"+last+\"; length; \" + squeeky.length + \"; and count for this message check is last - second; \"+(last-second)+\"; at \" + sizeflag);\n//}\n\n\t\t//\tcheck for nested tags, i.e.\n\t\t//\t\t<span ...><span ....>something</span></span>\n\t\tif ((squeeky.substr(second + 1).indexOf(\"<\" + tag)) >= 0) {\n\nconsole.log(\" prefugg text; \" + squeeky.substr(second + 1));\nconsole.log(\" where <tag; \" + padSpace(squeeky.substr(second + 1).indexOf(\"<\" + tag), (\"<\" + tag)));\n\n\t\t\tvar ffugger = (squeeky.substr(second + 1).indexOf(\"<\" + tag)) + (second + 1);\n\n\t\t\t//\teffectively, < exists (greater than 0 i.e. second+1, and\n\t\t\t//\t\tfugger is less than last, so doesn't overrun\n\t\t\twhile ((ffugger >= (second + 1)) && (ffugger < last)) {\n\tconsole.log(\" fugg text f;\" + squeeky);\n\tconsole.log(\" fugg first;\" + padSpace(ffugger));\n\tconsole.log(\" just last;\" + padSpace(last));\n\n\t\t\t\t//\tlittle bit more madness, maybe it's recursion\n\t\t\t\tvar squ = squeeky.slice(0, ffugger);\n\t\t\t\tvar eee = squeeky.slice(ffugger, (last + (\"</\"+tag+\">\").length));\n\t\t\t\tvar key = squeeky.slice((last + (\"</\"+tag+\">\").length), squeeky.length);\n\t\t\t\t//\tsend off the questionable bit\n\t\t\t\tvar ee = cleanHTML(eee);\n//console.log(\" squ ; \" + squ);\n//console.log(\" ee ; \" + ee);\n//console.log(\" eee ; \" + eee);\n//console.log(\" key ; \" + key);\nconsole.log(\" old squee ; \" + squeeky);\n\t\t\t\tsqueeky = \"\" + squ + \"\" + ee + \"\" + key + \"\";\n\n\t\t\t\t//\tnot actually sure if this substr produces a \n\t\t\t\t//\t\tchar 0 of \"content\" or of \">content\", but \n\t\t\t\t//\t\tdoesn't really matter\nconsole.log(\" old last is; \" + padSpace(last, \"^\"+last+\"\"));\n\t\t\t\t//\n\t\t\t\t//last = squeeky.substr(last + (\"</\" + tag + \">\").length).indexOf(\"</\" + tag + \">\") + chugger;\n\nconsole.log(\" second; \" + padSpace(second, \"|\"+second+\"\"));\n\n//console.log(\" new fugg is; \" + padSpace(ffugger, \"^\"+ffugger+\"\"));\nconsole.log(\" new squee ; \" + squeeky);\n\n\t\t\t\tffugger = (squeeky.substr(ffugger + 1).indexOf(\"<\"+tag)) + ffugger + 1;\n\t\t\t\tif (squeeky.substr(ffugger + 1).indexOf(\"<\"+tag)) {\n\t\t\t\t\tconsole.log(\"no more tags, fugg over\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\nconsole.log(\" fuckufckufuckfucukfkcufk \" + (squeeky.substr(ffugger + 1).indexOf(\"<\"+tag)) + \" + \" + ffugger + \" + 1\");\nconsole.log(\" chkstr; \" + squeeky.substr(ffugger + 1));\nconsole.log(\" <; \" + padSpace(squeeky.substr(ffugger + 1).indexOf(\"<\" + tag), \"<\"+tag));\nconsole.log(\" fuckufckufuckfucukfkcufk\");\n\t\t\t\tlast = (squeeky.substr(ffugger).indexOf(\"</\"+tag+\">\")) + ffugger;\n\t\t\t\t//last -= (eee.length - ee.length);\n\t\t\t\t//last = ();\n\tconsole.log(\" fugg after;\" + padSpace(ffugger, \"^\"+ffugger+\"\"));\n\tconsole.log(\" new last;\" + padSpace(last, \"^\"+last+\"\"));\n\tconsole.log(\" goes on while ; f (\"+ffugger+\") >= s+1 (\"+(second+1)+\")\");\n\tconsole.log(\" and ; f (\"+ffugger+\") < 1ast (\"+last+\")\");\n\t\t\t}\n\t\t}\n\n\t\t//console.log(\" got tag; \" + tag);\n\t\t//\tget the tag ATTRIBUTES in the case of the above tag ending\n\t\t//\t\ton a \" \" space rather than a close angle bracket >\n\t\twhile (squeeky.charAt(first) == \" \") {\n\t\t\tconsole.log(\" \" + tag + \" tag has attributes, searching...\");\n\t\t\tfirst++;\n\t\t\tref = \"\";\n\t\t\t//\tgetting attrubute name\n\t\t\twhile (squeeky.charAt(first) != \"=\") {\n\t\t\t\tref += squeeky.charAt(first);\n\t\t\t\tfirst++;\n\t\t\t}\n\t\t\tconsole.log(\" found attr; \" + ref);\n\t\t\t//\tattribute is href, get link url and text\n\n\n\t\t\t/*\tthis is the attribure check / process\n\t\t\t*/\n\t\t\tif (ref == \"class\") {\n\t\t\t\t//\tchecking emojis\n\t\t\t\tfirst += 2;\t//\tskip the = and the \"\n\t\t\t\treflink = \"\";\n\t\t\t\twhile (squeeky.charAt(first) != \"\\\"\") {\n\t\t\t\t\t//console.log(\"gettin ref, char \" + first + \" is; \" + squeeky.charAt(first));\n\t\t\t\t\treflink += squeeky.charAt(first);\n\t\t\t\t\tfirst++;\n\t\t\t\t}\n\t\t\t\tconsole.log(\" \" + ref + \" val; \" + reflink);\n\t\t\t\tif (reflink == \"Emoji Emoji--forLinks\") {\n\t\t\t\t\t//\tgoing to do a html img for emoji's\n\t\t\t\t\t//\t\t<img src=\"https....\" width height style\n\t\t\t\t\t//\t\t\talt text (class ?)> \n\t\t\t\t\t//\ttodo; aww shit time to recurse for the emoji's;\n\t\t\t\t\t//\t\trun the cleanHTML on the span emoji class\n\t\t\t\t\t//\t\t\tto get the attribute \n\t\t\t\t\t//\t\tactually recursion might not be the best to\n\t\t\t\t\t//\t\t\timplement as a default because of this\n\t\t\t\t\t//\t\t\tone fringe case, think it might be\n\t\t\t\t\t//\t\t\teasier to just cycle through other attrs\n\t\t\t\t\t//\t\t\tfrom here to get 'style' and 'title'\n\t\t\t\t\tconsole.log(\" got an emoji, getting other attr's\");\n\t\t\t\t\t//\tthis is a bit manky\n\t\t\t\t\trefflag = \"emoji\";\n\t\t\t\t\t//\tsetting up so that the attribute while has to do\n\t\t\t\t\t//\t\tanother cycle and pick up on the emoji deets\n\t\t\t\t\twhile (squeeky.charAt(first) != \" \") {\n\t\t\t\t\t\t//console.log(\"next attr char; \" + squeeky.charAt(first));\n\t\t\t\t\t\tfirst++;\n\t\t\t\t\t}\n\t\t\t\t} else if (reflink == \"Emoji Emoji--forText\") {\n\t\t\t\t\tconsole.log(\" got a text emoji, getting other attr's\");\n\t\t\t\t\t//\tthis is a bit manky\n\t\t\t\t\trefflag = \"emojitxt\";\n\t\t\t\t\t//\tsetting up so that the attribute while has to do\n\t\t\t\t\t//\t\tanother cycle and pick up on the emoji deets\n\t\t\t\t\twhile (squeeky.charAt(first) != \" \") {\n\t\t\t\t\t\t//console.log(\"next attr char; \" + squeeky.charAt(first));\n\t\t\t\t\t\tfirst++;\n\t\t\t\t\t}\n\t\t\t\t} else if ( (reflink == \"link-cst\")\n\t\t\t\t\t|| (reflink == \"emoji-cst\") \n\t\t\t\t\t|| (reflink == \"image-cst\") ){\n\t\t\t\t\t//\tthese are all good, need to jump to next tag\n\t\t\t\t\trefflag = \"cst\";\n\t\t\t\t}\n\t\t\t} else if (ref == \"href\") {\n\t\t\t\t//console.log(\"got a href=\");\n\t\t\t\tfirst += 2;\t//\tskip the = and the \"\n\t\t\t\treflink = \"\";\n\t\t\t\twhile (squeeky.charAt(first) != \"\\\"\") {\n\t\t\t\t\t//console.log(\"gettin ref, char \" + first + \" is; \" + squeeky.charAt(first));\n\t\t\t\t\treflink += squeeky.charAt(first);\n\t\t\t\t\tfirst++;\n\t\t\t\t}\n\t\t\t\tif (reflink.charAt(0) == \"/\") {\n\t\t\t\t\tconsole.log(\" got twtter relative link; \" + reflink + \"; changing\");\n\t\t\t\t\treflink = \"https://twitter.com\" + reflink;\n\t\t\t\t}\n\t\t\t\tconsole.log(\" href; \" + reflink);\n\t\t\t\t//\tget the link text i.e. <a ...>thisTextHere</a>\n\t\t\t\t//reftext = squeeky.slice(second + 1, last);\nconsole.log(\" rftext bad; \" + replaceSpace(squeeky));\nconsole.log(\" slice from; \" + padSpace(second + 1));\nconsole.log(\" up until; \" + padSpace(last));\n\t\t\t\tconsole.log(\" got ref text; \" + squeeky.slice(second + 1, last));\n\t\t\t\treftext = cleanHTML(squeeky.slice(second + 1, last));\n\t\t\t\tconsole.log(\" new ref text; \" + reftext);\n\t\t\t\t//\tlinks relative to twitter\n\t\t\t} else if ((ref == \"style\") && (refflag == \"emoji\")) {\n\t\t\t\t//\treflink\n\t\t\t\tfirst += 2;\t//\tskip the = and the \"\n\t\t\t\treflink = \"\";\n\t\t\t\t//\tskipping ahead to link signifier; ' (single quote)\n\t\t\t\twhile (squeeky.charAt(first) != \"'\") {\n\t\t\t\t\tfirst++;\n\t\t\t\t}\n\t\t\t\tfirst++;\n\t\t\t\t//\ttaking everything within the single quotes\n\t\t\t\twhile (squeeky.charAt(first) != \"'\") {\n\t\t\t\t\t//console.log(\"gettin ref, char \" + first + \" is; \" + squeeky.charAt(first));\n\t\t\t\t\treflink += squeeky.charAt(first);\n\t\t\t\t\tfirst++;\n\t\t\t\t}\n\t\t\t\tconsole.log(\" reflink val; \" + reflink);\n\t\t\t\t//\tresetting to get next attribute through while loop\n\t\t\t\twhile ( (first < second) \n\t\t\t\t\t&& (squeeky.charAt(first) != \" \") ) { \n\t\t\t\t\tfirst++;\n\t\t\t\t}\n\t\t\t} else if ((ref == \"title\") && ((refflag == \"emoji\") || (refflag == \"emojitxt\"))) {\n\t\t\t\t//\treftext\n\t\t\t\tfirst += 2;\t//\tskip the = and the \"\n\t\t\t\treftext = \"\";\n\t\t\t\t//\tskipping ahead to link signifier; ' (single quote)\n\t\t\t\twhile (squeeky.charAt(first) != \"\\\"\") {\n\t\t\t\t\treftext += squeeky.charAt(first);\n\t\t\t\t\tfirst++;\n\t\t\t\t}\n\t\t\t\tconsole.log(\" reftext val; \" + reftext);\n\t\t\t\twhile ( (first < second) \n\t\t\t\t\t&& (squeeky.charAt(first) != \" \") ) { \n\t\t\t\t\tfirst++;\n\t\t\t\t}\n\t\t\t} else if ((ref == \"src\") && (refflag == \"emojitxt\")) {\n\t\t\t\t//\treflink\n\t\t\t\tfirst += 2;\t//\tskip the = and the \"\n\t\t\t\treflink = \"\";\n\t\t\t\t//\tskipping ahead to link signifier; ' (single quote)\n\t\t\t\twhile (squeeky.charAt(first) != \"\\\"\") {\n\t\t\t\t\treflink += squeeky.charAt(first);\n\t\t\t\t\tfirst++;\n\t\t\t\t}\n\t\t\t\tconsole.log(\" reflink val; \" + reflink);\n\t\t\t\twhile ( (first < second) \n\t\t\t\t\t&& (squeeky.charAt(first) != \" \") ) { \n\t\t\t\t\tfirst++;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//\tunaccounted attribute\n\t\t\t\t//\tgo to the next attribute\n\t\t\t\twhile (squeeky.charAt(first) != \"\\\"\") {\n\t\t\t\t\tfirst++;\n\t\t\t\t}\n\t\t\t\t//\toff the \" and on to the space, to continue the \n\t\t\t\t//\t\tattribute loop\n\t\t\t\tfirst++;\n\t\t\t}\n\t\t}\n\n\n\t\t//\treset 'first' to first instance of the left angle bracket\n\t\t//\t\tMAKE SURE this doesn't take the second angle bracket or\n\t\t//\t\tsomething weird\n\t\tfirst = squeeky.substr(chugger).indexOf('<') + chugger;\n\n\t\t/*\thandle different types of tags, this will get messy\n\t\t*/\n\t\t//\tswitch (tag) { case 'b': squeeky replace; break; case: }\n\t\tif ( (tag == \"b\") || (tag == \"s\") ) {\n\t\t\t//\ttwitter user handles use b tags\n\t\t\tsqueeky = squeeky.replace(\"<\" + tag + \">\",\"\");\n\t\t\tsqueeky = squeeky.replace(\"</\" + tag + \">\",\"\");\n\t\t\t//\t'last' going to be used for multiple tag situations\n\t\t\tlast -= (\"<\"+tag+\">\").length;\n\t\t} else if ((tag == \"a\") || (tag == \"/a\")) {\n\t\t\tif (refflag == \"cst\") {\n\t\t\t\t//\tall good, ignore, skip to next tag\n\t\t\t\t//\t'last' should actually still be fairly relevant\n\t\t\t\t//\t\tno changes needed for that\n\t\t\t\tconsole.log(\" this is a cst a tag, ignoring\");\n\t\t\t} else {\n\t\t\t\t//\tdouble think on this, you need to retain full text in\n\t\t\t\t//\t\tcase of multiple links\n\t\t\t\t//squeeky = squeeky.replace(\"</a>\",\"\");\n\t\t\t\t//\tsq = sq(0 to first) + (new a ref tag) + sq(second to end\n\t\t\t\tvar ahref = \"<a class=\\\"link-cst\\\" href=\\\"\" + reflink;\n\t\t\t\tahref += \"\\\" target=\\\"_blank\\\">\" + reftext + \"</a>\";\n\n\t\t\t\t//\ttodo; definitely redo this with proper values in mind\n\t\t\t\t//\t\talso change to slices of originally passed string\n\t\t\t\t//\t\tmaybe change the whole project to them, I was \n\t\t\t\t//\t\tanticipating more in-place editing\n\t\t\t\t//squeeky = (squeeky.slice(0,first)) + ahref + (squeeky.slice(second + 1, last));\n\t\t\t\t//\tset up to continue right instead of returning\n//\tchecking stirng\nconsole.log(\" og string is; \" + replaceSpace(squeeky));\n//console.log(\"current last; \" + padSpace(last));\n//console.log(\" current lend; \" + padSpace(last + (\"</\" + tag + \">\").length));\n\n\nconsole.log(\" sq slc 0to1; \" + replaceSpace(squeeky.slice(0, first)));\nconsole.log(\" sq ahref; \" + ahref);\nconsole.log(\" sq slc to end; \" + (squeeky.slice((last + (\"</\" + tag + \">\").length), squeeky.length)));\n\n\t\t\t\tsqueeky = (squeeky.slice(0, first)) + ahref + (squeeky.slice((last + (\"</\" + tag + \">\").length), squeeky.length));\n\t\t\t\tlast = squeeky.slice(0, first).length + ahref.length;\n\n\nconsole.log(\" nu string is; \" + replaceSpace(squeeky));\n//console.log(\" current last; \" + padSpace(last));\n//console.log(\"current lend; \" + padSpace(last + (\"</\" + tag + \">\").length));\n\t\t\t\t//chugger = lest;\n\t\t\t\t//chugger = last;\n\n\t\t\t\t//\tretaining an angel bracket tag, so main loop is going to\n\t\t\t\t//\t\tgo infinite if allowed to check, so returning the\n\t\t\t\t//\t\tvalue straight from here\n\t\t\t\t//\ttodo; definite consideration to make is multiple links\n\t\t\t\t//\t\tgonna be twitter style, won't work here\n\t\t\t\t//console.log(\"returning; \" + squeeky + \"\\ndone cleaning\");\n\t\t\t\t//return squeeky;\n\n\t\t\t\t//console.log(\" did a href, cur line is; \" + replaceSpace(squeeky));\n\t\t\t}\n\t\t} else if (((tag == \"span\") && (refflag == \"emoji\")) \n\t\t\t|| ((tag == \"img\") && (refflag == \"emojitxt\"))) {\n\n\t\t\tvar emojiref = \"<img class=\\\"emoji-cst\\\" \";\n\t\t\t//\tneed to implement this across the actual lines and that\n\t\t\t//\t\to wait\n\t\t\t//\t\timplement this on the website's css, not hard coded\n\t\t\t//\t\tglad I realised that\n\t\t\t//if (htmlstyle != null) {\n\t\t\t//\temojiref += \"style=\\\"\" + htmlstyle + \"\\\" \";\n\t\t\t//}\n\t\t\temojiref += \"alt=\\\"\" + reftext + \"\\\" \";\n\t\t\temojiref += \"src=\\\"\" + reflink + \"\\\">\";\n\t\t\tconsole.log(\" sq sl 0 frst; \" + squeeky.slice(0, first));\n\t\t\tconsole.log(\" sq emojirefr; \" + emojiref);\n\t\t\tconsole.log(\" sq sl scnd l; \" + (squeeky.slice((last + (\"</\" + tag + \">\").length), squeeky.length)));\n\n\t\t\t//\tthe emoji tag has a symbol value in to to get rid of,\n\t\t\t//\t\talso need to take everything after 'last' (+ len)\n\t\t\t//squeeky = (squeeky.slice(0,first)) + emojiref + (squeeky.slice(second + 1, last));\n\t\t\t//squeeky = (squeeky.slice(0,first)) + emojiref;\n\t\t\tsqueeky = (squeeky.slice(0,first)) + emojiref + (squeeky.slice((last + (\"</\" + tag + \">\").length), squeeky.length));\n\t\t\t//\tlast going to be used for next tag calc\n\t\t\tlast = squeeky.slice(0,first).length + emojiref.length;\n\n\t\t\t//\tretaining an angel bracket tag, so main loop is going to\n\t\t\t//\t\tgo infinite if allowed to check, so returning the\n\t\t\t//\t\tvalue straight from here\n\t\t\t//\ttodo; definite consideration to make is multiple links,\n\t\t\t//\t\tgonna be twitter style, won't work here\n\t\t\t//console.log(\"returning; \" + squeeky + \"\\ndone cleaning\");\n\t\t\t//return squeeky;\n\n\t\t\t//console.log(\" did an emoji, cur line is; \" + squeeky);\n\t\t} else if (tag == \"span\") {\n\t\t\t//\tas far as I've seen, span's that aren't emojis are\n\t\t\t//\t\tuseless and should be cut\n\n\t\t\t//\tthis line will retain the content inside the span tag\n\t\t\t//\t\tbut miss out on everything after the first set tags\n\t\t\t//squeeky = (squeeky.slice(0,first)) + (squeeky.slice(second + 1, last));\n\n\t\t\t//\tthis will take before the span and after the span,\n\t\t\t//\t\tignoring the contents of the tag\n\t\t\tsqueeky = (squeeky.slice(0,first)) + (squeeky.slice((last + (\"</\" + tag + \">\").length), squeeky.length));\n\t\t\tlast = squeeky.slice(0,first).length;\n\t\t\t//console.log(\"returning; \" + squeeky + \"\\ndone cleaning\");\n\t\t\t//return squeeky;\n\t\t\t//console.log(\" removed a span, cur line is; \" + squeeky);\n\t\t} else if ((tag == \"img\") && (refflag == \"cst\")) {\n\t\t\t//\tthat's good, do nothing\n\t\t\tconsole.log(\" got a cst image, continuing\");\n\t\t} else if ((tag == \"img\") \n\t\t\t\t&& (reflink == \"avatar js-action-profile-avatar\")) {\n\t\t\tconsole.log(\"got a profile pic div\");\n\t\t\t//\ttrying to get jusst the img src link\n\t\t\t//\tindexof to find a string\n\t\t\tconsole.log(\" squee; \" + replaceSpace(squeeky));\n\t\t\tconsole.log(\" ind s;\" + padSpace( squeeky.indexOf(\"src=\\\"\", 0) + 5));\n\t\t\tconsole.log(\" meta ;\" + padSpace(squeeky.indexOf(\"\\\"\", squeeky.indexOf(\"src=\\\"\", 0) + 5)));\n\t\t\t//console.log(\"ind of src=\\\";\" + squeeky.indexOf(\"src=\\\"\", 0));\n\t\t\t//console.log(\"squeeky is; \" + squeeky);\n\t\t\tsqueeky = squeeky.slice(\n\t\t\t\t(squeeky.indexOf(\"src=\\\"\", 0) + 5),\n\t\t\t\t(squeeky.indexOf(\"\\\"\", squeeky.indexOf(\"src=\\\"\", 0) + 5))\n\t\t\t);\n\t\t\tconsole.log(\"new squeek; \" + squeeky);\n\t\t\t//margin-bottom:0.5em;\n\t\t\t//margin-top:1em;\n\t\t\t//squeeky = \"<img class=\\\"image-cst\\\" style=\\\"width:16px;height:16px;\\\" src=\\\"\" + squeeky + \"\\\">\";\n\t\t\t//style=\"margin-bottom: 0.5em;\" width=\"16px\" height=\"16px\" align=\"middle\"\n\t\t\tsqueeky = \"<img class=\\\"image-cst\\\" style=\\\"margin-bottom:0.5em;\\\" width=\\\"16px\\\" height=\\\"16px\\\" align=\\\"middle\\\" src=\\\"\" + squeeky + \"\\\">\";\n\t\t} else {\n\t\t\tconsole.log(\" don't know how to deal with tag; \" + tag);\n\t\t\tconsole.log(\"FAILed cleaning\");\n\t\t\treturn \"fail on \" + tag;\n\t\t}\n\n\t\t//console.log(\" did a \" + tag + \" tag, cur line is; \" + replaceSpace(squeeky));\n\t\tconsole.log(\" did a \" + tag + \" tag\");\n\n\t\t/*\tprepare loop flag\n\t\t*/\n\t\t//\treset ref tags\n\t\tref = \"\";\n\t\treflink = \"\";\n\t\treftext = \"\";\n\t\trefflag = \"\";\n\t\t//\tchugger to get to next tag ok\n\t\t//chugger = (last + (\"</\" + tag + \">\").length);\n\n\t\t//\tnecessary, don't mess with\n\t\t//\t\twait maybe not\n\t\t//\t\twait yeah, it is\n\t\tchugger = last;\n\n\nif (chugger < squeeky.length) {\n\tconsole.log(\" og text is; \" + replaceSpace(someHTML));\n\tconsole.log(\" the text is; \" + replaceSpace(squeeky));\n\tconsole.log(\" chugger len; \" + padSpace(chugger));\n\tconsole.log(\" last len; \" + padSpace(last));\n\tconsole.log(\" chugger; \" + chugger + \" out of \" + squeeky.length);\n\tconsole.log(\" chug txt is; \" + squeeky.substr(chugger));\n\tconsole.log(\" any <'s ; \" + padSpace(squeeky.substr(chugger).indexOf('<')));\n}\n\n//console.log(\"chugger new; \" + padSpace(chugger));\n//console.log(\"chgr as last only; \" + chugger);\n//console.log(\"chgr as last only char; \" + squeeky.charAt(chugger));\n\t\tif ((squeeky.substr(chugger).indexOf('<') >= 0) && (chugger < squeeky.length)) {\n\t\t\tloopflag = true;\n\t\t} else {\n\t\t\tloopflag = false;\n\t\t}\n\t}\n\tconsole.log(\" returning; \" + squeeky + \"\\ndone cleaning\");\n\treturn squeeky;\n}", "function cleanHtml(html) {\n \tvar body = html.match(/<body[^>]*>([\\S\\s]*)<\\/body>/i);\n \tif (!body || !body[1])\n \t\treturn html;\n\n \treturn body[1];\n }", "function isTag(input){\n\treturn input.startsWith(\"<\");\n}", "function cleanNodesAndAttributes(s) { \n \n // Get all of the start tags\n var htmlPattern = new RegExp('<[ ]*([\\\\w]+).*?>', 'gi');\n s = s.replace(htmlPattern, function(ref) {\n \n var cleanStartTag = \"\"; // for storing the result\n \n // Separate the tag name from its attributes\n var ref = ref.replace('^<[ ]*', '<'); // remove beginning whitespace\n var ndx = ref.search(/\\s/); // returns index of first match of whitespace \n var tagname = ref.substring(0 ,ndx);\n var attributes = ref.substring(ndx, ref.length);\n \n // Make tag name lower case\n if (ndx == -1) return ref.toLowerCase(); // no attr/value pairs (i.e. <p>)\n cleanStartTag += tagname.toLowerCase();\n \n // Clean up attribute/value pairs \n var pairs = attributes.match(/[\\w]+\\s*=\\s*(\"[^\"]*\"|[^\">\\s]*)/gi);\n if (pairs) {\n for (var t = 0; t < pairs.length; t++) {\n var pair = pairs[t];\n var ndx = pair.search(/=/); // returns index of first match of equals (=) \n \n // Make attribute names lower case \n var attrname = pair.substring(0, ndx).toLowerCase();\n \n // Put double-quotes around values that don't have them\n var attrval = pair.substring(ndx, pair.length);\n var wellFormed = new RegExp('=[ ]*\"[^\"]*\"', \"g\");\n if (!wellFormed.test(attrval)) {\n var attrvalPattern = new RegExp('=(.*?)', 'g');\n attrval = attrval.replace(attrvalPattern, '=\\\"$1');\n // there's an IE bug that prevent this endquote from being appended\n // after the backreference. no, seriously.\n attrval += '\"';\n }\n // join the attribute parts\n var attr = attrname + attrval;\n cleanStartTag += \" \" + attr;\n }\n } \n cleanStartTag += \">\";\n\n return cleanStartTag;\n });\n\n // Makes all of the end tags lower case\n s = s.replace(/<\\/\\s*[\\w]*\\s*>/g, function (ref) {return ref.toLowerCase();});\n\n return s;\n}", "function normaliseContentEditableHTML(html, trim) {\n html = html.replace(initialBreaks, '$1\\n\\n')\n .replace(initialBreak, '$1\\n')\n .replace(wrappedBreaks, '\\n')\n .replace(openBreaks, '')\n .replace(breaks, '\\n')\n .replace(allTags, '')\n .replace(newlines, '<br>')\n\n if (trim) {\n html = html.replace(trimWhitespace, '')\n }\n\n return html\n}", "function normalizeHtml(html) {\n return html && html.toString &&\n html.toString()\n .replace(/ about=\"[^\"]+\"(?=[/> ])|<meta property=\"mw:TimeUuid\"[^>]{0,128}>/g, '');\n}", "function reformatHtml (html) {\n if(!html) return html;\n\n // break up HTML into tags and text\n var hh = [],\n h = html;\n while (h) {\n var i = h.indexOf('<');\n if (i === -1) {\n hh.push(h);\n break;\n } else if (i > 0) {\n hh.push(h.substring(0, i));\n h = h.substring(i);\n } else {\n var j = h.indexOf('>');\n hh.push(h.substring(0, j + 1));\n h = h.substring(j + 1);\n }\n }\n\n // combine common elements together\n var hhh = [],\n k = 0,\n len = hh.length;\n while (k < len) {\n hhk = hh[k];\n\n // text\n if (hhk.charAt(0) !== '<' || hhk.substr(0, 2) === '</') {\n hhh.push(hhk);\n k += 1;\n continue;\n }\n\n // <li ...><a ...>text</a></li>\n if (k < len - 5 && hh[k].substr(0, 3) === '<li' &&\n hh[k+1].substr(0, 2) === '<a' && hh[k+2].charAt(0) !== '<' &&\n hh[k+3] === '</a>' && hh[k+4] === '</li>') {\n hhh.push('~' + hhk + hh[k+1] + hh[k+2] + hh[k+3] + hh[k+4]);\n k += 5;\n continue;\n }\n\n i = hhk.indexOf(' ');\n j = hhk.indexOf('>');\n var tag = hhk.substr(0, Math.min(i !== -1 ? i : 9999, j !== -1 ? j : 9999)),\n endTag = '</' + tag.substr(1) + '>';\n\n // <tag ...>text</tag>\n if (k < len - 3 && hh[k+1].charAt(0) !== '<' && hh[k+2] === endTag) {\n hhh.push('~' + hhk + hh[k+1] + hh[k+2]);\n k += 3;\n continue;\n }\n\n // <tag ...></tag>\n if (k < len - 2 && hh[k+1] === endTag) {\n hhh.push('~' + hhk + hh[k+1]);\n k += 2;\n continue;\n }\n\n hhh.push(hhk);\n k += 1;\n\n }\n\n // reassemble HTML\n var lead = 0,\n str = '';\n for (k = 0, len = hhh.length; k < len; k += 1) {\n var hhk = hhh[k];\n if (hhk.charAt(0) === '~') {\n str += '\\n' + indent(lead + 1) + hhk.substr(1);\n } else if (hhk.charAt(0) !== '<') {\n str += '\\n' + indent(lead) + hhk;\n } else if (hhk.substr(0, 2) === '</') {\n str += '\\n' + indent(lead) + hhk;\n lead -= 1;\n } else {\n lead += 1;\n str += '\\n' + indent(lead) + hhk;\n }\n }\n\n return str;\n\n function indent (lead) { return new Array(lead * 3 - 2).join(' '); }\n }", "function edt_cleanDeprecated()\n {\n var oEditor=eval(\"idContent\"+this.oName);\n\n var elements;\n \n elements=oEditor.document.body.getElementsByTagName(\"STRIKE\");\n this.cleanTags(elements,\"line-through\");\n elements=oEditor.document.body.getElementsByTagName(\"S\");\n this.cleanTags(elements,\"line-through\");\n \n elements=oEditor.document.body.getElementsByTagName(\"U\");\n this.cleanTags(elements,\"underline\");\n\n this.replaceTags(\"DIR\",\"DIV\");\n this.replaceTags(\"MENU\",\"DIV\"); \n this.replaceTags(\"CENTER\",\"DIV\");\n this.replaceTags(\"XMP\",\"PRE\");\n this.replaceTags(\"BASEFONT\",\"SPAN\");//will be removed by cleanEmptySpan()\n \n elements=oEditor.document.body.getElementsByTagName(\"APPLET\");\n var count=elements.length;\n while(count>0) \n {\n f=elements[0];\n f.removeNode(false); \n count--;\n }\n \n this.cleanFonts();\n this.cleanEmptySpan();\n\n return true;\n }", "function getTagName(o) {\n if(o && o.hasOwnProperty('tagName')) {\n return o.tagName;\n } else if(typeof o === 'string') {\n return o.replace(/<|>/g, '');\n } else {\n return '';\n }\n }", "function sanitize_tag (tag) {\n\t\t\t\t\t\t\treturn tag.replace(/ /g, '\\\\ ').replace(/,/g, '\\\\,').replace(/=/g, '\\\\=');\n\t\t\t\t\t\t}", "function parseName(tag) {\n\tlet name = tag.name\n\tname = name.replace(/_/g, ' ');\n\tname = name.replace(/\\b\\w/g, l => l.toUpperCase());\n\treturn name;\n}", "function Calendar_fixupTags( wtext )\n{\norig = new String( wtext )\norig = this.replaceStr( orig, \"<br>\", \"*br*\" )\norig = this.replaceStr( orig, \" \", \"&nbsp\" )\norig = this.replaceStr( orig, \"<\", \"<\" )\norig = this.replaceStr( orig, \">\", \">\" )\norig = this.replaceStr( orig, \"*br*\", \"<br>\" )\nreturn orig\n}", "function parseTag(tagText) {\n \n}", "function fromHtml(html) {\n return html.replace(/<p>&nbsp;<\\/p>/ig, \"\\n\")\n .replace(/<p>/ig,\"\")\n .replace(/<\\/p>/ig, \"\\n\")\n .replace(/<br \\/>/ig, \"\\n\")\n .replace(/(&nbsp;|\\xa0|\\u2005)/ig, \" \")\n // While copying widgets with text, CKEditor adds these html elements\n .replace(/<span\\b[^>]*?id=\"?cke_bm_\\d+\\w\"?\\b[^>]*?>.*?<\\/span>/ig, \"\")\n .replace(/<span\\b[^>]*?data-cke-copybin-(start|end)[^<]*?<\\/span>/ig, \"\")\n // CKEditor uses zero-width spaces as markers\n // and sometimes they leak out (on copy/paste?)\n .replace(/\\u200b+/ig, \" \")\n // fixup final </p>, which is is not a newline\n .replace(/\\n$/, \"\");\n }", "function stripHtml(...args) {\n // let extractedInputs = new Set(\n // JSON.parse(\n // fs.readFileSync(path.resolve(\"./test/util/extractedInputs.json\"), \"utf8\")\n // )\n // );\n // if (typeof args[0] === \"string\" && args[0].trim().length > 3) {\n // extractedInputs.add(args[0]);\n // fs.writeFileSync(\n // path.resolve(\"./test/util/extractedInputs.json\"),\n // JSON.stringify([...extractedInputs], null, 0)\n // );\n // }\n\n let { result, ranges, allTagLocations, filteredTagLocations } =\n originalStripHtml(...args);\n return { result, ranges, allTagLocations, filteredTagLocations };\n}", "function cut_out_tags(value) {\n return value.replace(/<.+>/g, \"\");\n}", "function htmlToText(e){return e.replace(/<\\/div>\\n/gi,\"\").replace(/<\\/p>/gi,\"\").replace(/<\\/span>/gi,\"\").replace(/<\\/div>/gi,\"\").replace(/<\\/ul>/gi,\"\").replace(/<\\/li>/gi,\"\").replace(/<\\/strong>/gi,\"\").replace(/<\\/center>/gi,\"\").replace(/<\\/pre>/gi,\"\").replace(/<\\s*p[^>]*>/gi,\"\").replace(/<\\s*span[^>]*>/gi,\"\").replace(/<\\s*div[^>]*>/gi,\"\").replace(/<\\s*ul[^>]*>/gi,\"\").replace(/<\\s*li[^>]*>/gi,\"\").replace(/<\\s*strong[^>]*>/gi,\"\").replace(/<\\s*center[^>]*>/gi,\"\").replace(/<\\s*pre[^>]*>/gi,\"\").replace(/<hr>/gi,\"\").replace(/<div><br>/gi,\"\\n\").replace(/<div>/gi,\"\").replace(/<\\s*br[^>]*>/gi,\"\\n\").replace(/<\\s*\\/li[^>]*>/gi,\"\").replace(/<\\s*script[^>]*>[\\s\\S]*?<\\/script>/gim,\"\").replace(/<\\s*style[^>]*>[\\s\\S]*?<\\/style>/gim,\"\").replace(/<!--.*?-->/gim,\"\").replace(/<\\s*a[^>]*href=['\"](.*?)['\"][^>]*>([\\s\\S]*?)<\\/\\s*a\\s*>/gi,\"$2 ($1)\").replace(/&([^;]+);/g,decodeHtmlEntity)}", "strip_tags(...args) {\n return strip_tags(...args)\n }", "function removeTags(text) {\n\t//return text ? text.replace(tagsRegex, \"\") : text;\n\treturn text ? text.replace(/<p>/, \"\").replace(/<\\p>/, \"\") : text;\n}", "function cleanHtml(string){\n var regex = /(<([^>]+)>)/ig;\n \n return string.replace(regex, \"\")\n}", "function parseTagName(source) {\n if (source.currentChar() !== '<') {\n throw Error('This is not a HTML tag. HTML tag has to start with \"<\"');\n }\n\n let name = '';\n let char = source.nextChar();\n while (char) {\n // space or closed\n if (isSpace(char) || isClosed(char)) {\n break;\n } else {\n name += char;\n }\n char = source.nextChar();\n }\n return name;\n}", "function removeTag() {\n return {\n name: \"removeTag\",\n transform(code, id) {\n return { code: code.replace(/(css|html)\\s*`/g, \"`\") };\n },\n };\n}", "function getContent(html) {\n return html.replace(/<[^>]*>/g, '');\n}", "function stripHtmlToText(e){var t=document.createElement(\"DIV\");t.innerHTML=e;var n=t.textContent||t.innerText||\"\";return n.replace(\"​\",\"\"),n=n.trim()}", "tagName(source, onError) {\n if (source === '!')\n return '!'; // non-specific tag\n if (source[0] !== '!') {\n onError(`Not a valid tag: ${source}`);\n return null;\n }\n if (source[1] === '<') {\n const verbatim = source.slice(2, -1);\n if (verbatim === '!' || verbatim === '!!') {\n onError(`Verbatim tags aren't resolved, so ${source} is invalid.`);\n return null;\n }\n if (source[source.length - 1] !== '>')\n onError('Verbatim tags must end with a >');\n return verbatim;\n }\n const [, handle, suffix] = source.match(/^(.*!)([^!]*)$/);\n if (!suffix)\n onError(`The ${source} tag has no suffix`);\n const prefix = this.tags[handle];\n if (prefix)\n return prefix + decodeURIComponent(suffix);\n if (handle === '!')\n return source; // local tag\n onError(`Could not resolve tag: ${source}`);\n return null;\n }", "function strip(html){\n let tmp = document.createElement(\"div\");\n tmp.innerHTML = html;\n return tmp.textContent || tmp.innerText || \"\";\n }", "function ie(text) {\n var list = [],\n parts;\n\n parts = lowercase(text).\n replace('<', '').\n replace('>', '').\n split(' ');\n parts.sort();\n forEach(parts, function(value, key){\n if (value.substring(0,3) == 'ng-') {\n } else {\n list.push(value.replace('=\"\"', ''));\n }\n });\n return '<' + list.join(' ') + '>';\n }", "sanitize(htmlStr) {\r\n return DOMPurify.sanitize(htmlStr, {\r\n FORBID_TAGS: ['figure','figcaption']\r\n });\r\n }", "function cleanFieldHtml(fieldHtml, pos) {\n html = fieldHtml\n }", "function removeHtmlTag(text) {\n\tlet TagRegExp = /<[^<>]+\\/?>/g;\n\treturn text.replace(TagRegExp, '');\n}", "function stripTags(tag, s, doc) {\n var div = doc.createElement('div');\n div.innerHTML = s;\n var tags = div.getElementsByTagName(tag);\n var i = tags.length;\n while (i--) {\n tags[i].parentNode.removeChild(tags[i]);\n }\n return div.innerHTML;\n}", "function untag( s) {\r\n return s.replace( /<(..*?)>/g, '');\r\n}", "function sanitizeHtml(html,options,_recursing){var result='';// Used for hot swapping the result variable with an empty string in order to \"capture\" the text written to it.\nvar tempResult='';function Frame(tag,attribs){var that=this;this.tag=tag;this.attribs=attribs||{};this.tagPosition=result.length;this.text='';// Node inner text\nthis.updateParentNodeText=function(){if(stack.length){var parentFrame=stack[stack.length-1];parentFrame.text+=that.text;}};}if(!options){options=sanitizeHtml.defaults;options.parser=htmlParserDefaults;}else{options=extend(sanitizeHtml.defaults,options);if(options.parser){options.parser=extend(htmlParserDefaults,options.parser);}else{options.parser=htmlParserDefaults;}}// Tags that contain something other than HTML, or where discarding\n// the text when the tag is disallowed makes sense for other reasons.\n// If we are not allowing these tags, we should drop their content too.\n// For other tags you would drop the tag but keep its content.\nvar nonTextTagsArray=options.nonTextTags||['script','style','textarea'];var allowedAttributesMap;var allowedAttributesGlobMap;if(options.allowedAttributes){allowedAttributesMap={};allowedAttributesGlobMap={};each(options.allowedAttributes,function(attributes,tag){allowedAttributesMap[tag]=[];var globRegex=[];attributes.forEach(function(obj){if(isString(obj)&&obj.indexOf('*')>=0){globRegex.push(quoteRegexp(obj).replace(/\\\\\\*/g,'.*'));}else{allowedAttributesMap[tag].push(obj);}});allowedAttributesGlobMap[tag]=new RegExp('^('+globRegex.join('|')+')$');});}var allowedClassesMap={};each(options.allowedClasses,function(classes,tag){// Implicitly allows the class attribute\nif(allowedAttributesMap){if(!has(allowedAttributesMap,tag)){allowedAttributesMap[tag]=[];}allowedAttributesMap[tag].push('class');}allowedClassesMap[tag]=classes;});var transformTagsMap={};var transformTagsAll;each(options.transformTags,function(transform,tag){var transFun;if(typeof transform==='function'){transFun=transform;}else if(typeof transform===\"string\"){transFun=sanitizeHtml.simpleTransform(transform);}if(tag==='*'){transformTagsAll=transFun;}else{transformTagsMap[tag]=transFun;}});var depth=0;var stack=[];var skipMap={};var transformMap={};var skipText=false;var skipTextDepth=0;var parser=new htmlparser.Parser({onopentag:function onopentag(name,attribs){if(skipText){skipTextDepth++;return;}var frame=new Frame(name,attribs);stack.push(frame);var skip=false;var hasText=!!frame.text;var transformedTag;if(has(transformTagsMap,name)){transformedTag=transformTagsMap[name](name,attribs);frame.attribs=attribs=transformedTag.attribs;if(transformedTag.text!==undefined){frame.innerText=transformedTag.text;}if(name!==transformedTag.tagName){frame.name=name=transformedTag.tagName;transformMap[depth]=transformedTag.tagName;}}if(transformTagsAll){transformedTag=transformTagsAll(name,attribs);frame.attribs=attribs=transformedTag.attribs;if(name!==transformedTag.tagName){frame.name=name=transformedTag.tagName;transformMap[depth]=transformedTag.tagName;}}if(options.allowedTags&&options.allowedTags.indexOf(name)===-1||options.disallowedTagsMode==='recursiveEscape'&&!isEmptyObject(skipMap)){skip=true;skipMap[depth]=true;if(options.disallowedTagsMode==='discard'){if(nonTextTagsArray.indexOf(name)!==-1){skipText=true;skipTextDepth=1;}}skipMap[depth]=true;}depth++;if(skip){if(options.disallowedTagsMode==='discard'){// We want the contents but not this tag\nreturn;}tempResult=result;result='';}result+='<'+name;if(!allowedAttributesMap||has(allowedAttributesMap,name)||allowedAttributesMap['*']){each(attribs,function(value,a){if(!VALID_HTML_ATTRIBUTE_NAME.test(a)){// This prevents part of an attribute name in the output from being\n// interpreted as the end of an attribute, or end of a tag.\ndelete frame.attribs[a];return;}var parsed;// check allowedAttributesMap for the element and attribute and modify the value\n// as necessary if there are specific values defined.\nvar passedAllowedAttributesMapCheck=false;if(!allowedAttributesMap||has(allowedAttributesMap,name)&&allowedAttributesMap[name].indexOf(a)!==-1||allowedAttributesMap['*']&&allowedAttributesMap['*'].indexOf(a)!==-1||has(allowedAttributesGlobMap,name)&&allowedAttributesGlobMap[name].test(a)||allowedAttributesGlobMap['*']&&allowedAttributesGlobMap['*'].test(a)){passedAllowedAttributesMapCheck=true;}else if(allowedAttributesMap&&allowedAttributesMap[name]){var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator10=allowedAttributesMap[name][Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator10.next()).done);_iteratorNormalCompletion=true){var o=_step.value;if(isPlainObject(o)&&o.name&&o.name===a){passedAllowedAttributesMapCheck=true;var newValue='';if(o.multiple===true){// verify the values that are allowed\nvar splitStrArray=value.split(' ');var _iteratorNormalCompletion2=true;var _didIteratorError2=false;var _iteratorError2=undefined;try{for(var _iterator11=splitStrArray[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator11.next()).done);_iteratorNormalCompletion2=true){var s=_step2.value;if(o.values.indexOf(s)!==-1){if(newValue===''){newValue=s;}else{newValue+=' '+s;}}}}catch(err){_didIteratorError2=true;_iteratorError2=err;}finally{try{if(!_iteratorNormalCompletion2&&_iterator11[\"return\"]!=null){_iterator11[\"return\"]();}}finally{if(_didIteratorError2){throw _iteratorError2;}}}}else if(o.values.indexOf(value)>=0){// verified an allowed value matches the entire attribute value\nnewValue=value;}value=newValue;}}}catch(err){_didIteratorError=true;_iteratorError=err;}finally{try{if(!_iteratorNormalCompletion&&_iterator10[\"return\"]!=null){_iterator10[\"return\"]();}}finally{if(_didIteratorError){throw _iteratorError;}}}}if(passedAllowedAttributesMapCheck){if(options.allowedSchemesAppliedToAttributes.indexOf(a)!==-1){if(naughtyHref(name,value)){delete frame.attribs[a];return;}}if(name==='iframe'&&a==='src'){var allowed=true;try{// naughtyHref is in charge of whether protocol relative URLs\n// are cool. We should just accept them\nparsed=url.parse(value,false,true);var isRelativeUrl=parsed&&parsed.host===null&&parsed.protocol===null;if(isRelativeUrl){// default value of allowIframeRelativeUrls is true unless allowIframeHostnames specified\nallowed=has(options,\"allowIframeRelativeUrls\")?options.allowIframeRelativeUrls:!options.allowedIframeHostnames;}else if(options.allowedIframeHostnames){allowed=options.allowedIframeHostnames.find(function(hostname){return hostname===parsed.hostname;});}}catch(e){// Unparseable iframe src\nallowed=false;}if(!allowed){delete frame.attribs[a];return;}}if(a==='srcset'){try{parsed=srcset.parse(value);each(parsed,function(value){if(naughtyHref('srcset',value.url)){value.evil=true;}});parsed=filter(parsed,function(v){return!v.evil;});if(!parsed.length){delete frame.attribs[a];return;}else{value=srcset.stringify(filter(parsed,function(v){return!v.evil;}));frame.attribs[a]=value;}}catch(e){// Unparseable srcset\ndelete frame.attribs[a];return;}}if(a==='class'){value=filterClasses(value,allowedClassesMap[name]);if(!value.length){delete frame.attribs[a];return;}}if(a==='style'){try{var abstractSyntaxTree=postcss.parse(name+\" {\"+value+\"}\");var filteredAST=filterCss(abstractSyntaxTree,options.allowedStyles);value=stringifyStyleAttributes(filteredAST);if(value.length===0){delete frame.attribs[a];return;}}catch(e){delete frame.attribs[a];return;}}result+=' '+a;if(value&&value.length){result+='=\"'+escapeHtml(value,true)+'\"';}}else{delete frame.attribs[a];}});}if(options.selfClosing.indexOf(name)!==-1){result+=\" />\";}else{result+=\">\";if(frame.innerText&&!hasText&&!options.textFilter){result+=frame.innerText;}}if(skip){result=tempResult+escapeHtml(result);tempResult='';}},ontext:function ontext(text){if(skipText){return;}var lastFrame=stack[stack.length-1];var tag;if(lastFrame){tag=lastFrame.tag;// If inner text was set by transform function then let's use it\ntext=lastFrame.innerText!==undefined?lastFrame.innerText:text;}if(options.disallowedTagsMode==='discard'&&(tag==='script'||tag==='style')){// htmlparser2 gives us these as-is. Escaping them ruins the content. Allowing\n// script tags is, by definition, game over for XSS protection, so if that's\n// your concern, don't allow them. The same is essentially true for style tags\n// which have their own collection of XSS vectors.\nresult+=text;}else{var escaped=escapeHtml(text,false);if(options.textFilter){result+=options.textFilter(escaped,tag);}else{result+=escaped;}}if(stack.length){var frame=stack[stack.length-1];frame.text+=text;}},onclosetag:function onclosetag(name){if(skipText){skipTextDepth--;if(!skipTextDepth){skipText=false;}else{return;}}var frame=stack.pop();if(!frame){// Do not crash on bad markup\nreturn;}skipText=false;depth--;var skip=skipMap[depth];if(skip){delete skipMap[depth];if(options.disallowedTagsMode==='discard'){frame.updateParentNodeText();return;}tempResult=result;result='';}if(transformMap[depth]){name=transformMap[depth];delete transformMap[depth];}if(options.exclusiveFilter&&options.exclusiveFilter(frame)){result=result.substr(0,frame.tagPosition);return;}frame.updateParentNodeText();if(options.selfClosing.indexOf(name)!==-1){// Already output />\nreturn;}result+=\"</\"+name+\">\";if(skip){result=tempResult+escapeHtml(result);tempResult='';}}},options.parser);parser.write(html);parser.end();return result;function escapeHtml(s,quote){if(typeof s!=='string'){s=s+'';}if(options.parser.decodeEntities){s=s.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/\\>/g,'&gt;');if(quote){s=s.replace(/\\\"/g,'&quot;');}}// TODO: this is inadequate because it will pass `&0;`. This approach\n// will not work, each & must be considered with regard to whether it\n// is followed by a 100% syntactically valid entity or not, and escaped\n// if it is not. If this bothers you, don't set parser.decodeEntities\n// to false. (The default is true.)\ns=s.replace(/&(?![a-zA-Z0-9#]{1,20};)/g,'&amp;')// Match ampersands not part of existing HTML entity\n.replace(/</g,'&lt;').replace(/\\>/g,'&gt;');if(quote){s=s.replace(/\\\"/g,'&quot;');}return s;}function naughtyHref(name,href){// Browsers ignore character codes of 32 (space) and below in a surprising\n// number of situations. Start reading here:\n// https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet#Embedded_tab\n// eslint-disable-next-line no-control-regex\nhref=href.replace(/[\\x00-\\x20]+/g,'');// Clobber any comments in URLs, which the browser might\n// interpret inside an XML data island, allowing\n// a javascript: URL to be snuck through\nhref=href.replace(/<\\!\\-\\-.*?\\-\\-\\>/g,'');// Case insensitive so we don't get faked out by JAVASCRIPT #1\nvar matches=href.match(/^([a-zA-Z]+)\\:/);if(!matches){// Protocol-relative URL starting with any combination of '/' and '\\'\nif(href.match(/^[\\/\\\\]{2}/)){return!options.allowProtocolRelative;}// No scheme\nreturn false;}var scheme=matches[1].toLowerCase();if(has(options.allowedSchemesByTag,name)){return options.allowedSchemesByTag[name].indexOf(scheme)===-1;}return!options.allowedSchemes||options.allowedSchemes.indexOf(scheme)===-1;}/**\n * Filters user input css properties by whitelisted regex attributes.\n *\n * @param {object} abstractSyntaxTree - Object representation of CSS attributes.\n * @property {array[Declaration]} abstractSyntaxTree.nodes[0] - Each object cointains prop and value key, i.e { prop: 'color', value: 'red' }.\n * @param {object} allowedStyles - Keys are properties (i.e color), value is list of permitted regex rules (i.e /green/i).\n * @return {object} - Abstract Syntax Tree with filtered style attributes.\n */function filterCss(abstractSyntaxTree,allowedStyles){if(!allowedStyles){return abstractSyntaxTree;}var filteredAST=cloneDeep(abstractSyntaxTree);var astRules=abstractSyntaxTree.nodes[0];var selectedRule;// Merge global and tag-specific styles into new AST.\nif(allowedStyles[astRules.selector]&&allowedStyles['*']){selectedRule=mergeWith(cloneDeep(allowedStyles[astRules.selector]),allowedStyles['*'],function(objValue,srcValue){if(Array.isArray(objValue)){return objValue.concat(srcValue);}});}else{selectedRule=allowedStyles[astRules.selector]||allowedStyles['*'];}if(selectedRule){filteredAST.nodes[0].nodes=astRules.nodes.reduce(filterDeclarations(selectedRule),[]);}return filteredAST;}/**\n * Extracts the style attribues from an AbstractSyntaxTree and formats those\n * values in the inline style attribute format.\n *\n * @param {AbstractSyntaxTree} filteredAST\n * @return {string} - Example: \"color:yellow;text-align:center;font-family:helvetica;\"\n */function stringifyStyleAttributes(filteredAST){return filteredAST.nodes[0].nodes.reduce(function(extractedAttributes,attributeObject){extractedAttributes.push(attributeObject.prop+':'+attributeObject.value);return extractedAttributes;},[]).join(';');}/**\n * Filters the existing attributes for the given property. Discards any attributes\n * which don't match the whitelist.\n *\n * @param {object} selectedRule - Example: { color: red, font-family: helvetica }\n * @param {array} allowedDeclarationsList - List of declarations which pass whitelisting.\n * @param {object} attributeObject - Object representing the current css property.\n * @property {string} attributeObject.type - Typically 'declaration'.\n * @property {string} attributeObject.prop - The CSS property, i.e 'color'.\n * @property {string} attributeObject.value - The corresponding value to the css property, i.e 'red'.\n * @return {function} - When used in Array.reduce, will return an array of Declaration objects\n */function filterDeclarations(selectedRule){return function(allowedDeclarationsList,attributeObject){// If this property is whitelisted...\nif(selectedRule.hasOwnProperty(attributeObject.prop)){var matchesRegex=selectedRule[attributeObject.prop].some(function(regularExpression){return regularExpression.test(attributeObject.value);});if(matchesRegex){allowedDeclarationsList.push(attributeObject);}}return allowedDeclarationsList;};}function filterClasses(classes,allowed){if(!allowed){// The class attribute is allowed without filtering on this tag\nreturn classes;}classes=classes.split(/\\s+/);return classes.filter(function(clss){return allowed.indexOf(clss)!==-1;}).join(' ');}}// Defaults are accessible to you so that you can use them as a starting point", "function sanitize(markup) {\n return (\"\" + markup)\n .trim()\n .replace(/[\\r|\\n]/g, ' ')\n .replace(/>\\s+</g, '><');\n }", "function SafeHtml() {}", "function SafeHtml() {}", "function SafeHtml() {}", "function SafeHtml() {}", "function SafeHtml() {}", "function sanitizeHtml(html, options, _recursing) {\n var result = '';\n\n function Frame(tag, attribs) {\n var that = this;\n this.tag = tag;\n this.attribs = attribs || {};\n this.tagPosition = result.length;\n this.text = ''; // Node inner text\n\n this.updateParentNodeText = function() {\n if (stack.length) {\n var parentFrame = stack[stack.length - 1];\n parentFrame.text += that.text;\n }\n };\n }\n\n if (!options) {\n options = sanitizeHtml.defaults;\n options.parser = htmlParserDefaults;\n } else {\n options = extend(sanitizeHtml.defaults, options);\n if (options.parser) {\n options.parser = extend(htmlParserDefaults, options.parser);\n } else {\n options.parser = htmlParserDefaults;\n }\n }\n\n // Tags that contain something other than HTML, or where discarding\n // the text when the tag is disallowed makes sense for other reasons.\n // If we are not allowing these tags, we should drop their content too.\n // For other tags you would drop the tag but keep its content.\n var nonTextTagsArray = options.nonTextTags || [ 'script', 'style', 'textarea' ];\n var allowedAttributesMap;\n var allowedAttributesGlobMap;\n if(options.allowedAttributes) {\n allowedAttributesMap = {};\n allowedAttributesGlobMap = {};\n each(options.allowedAttributes, function(attributes, tag) {\n allowedAttributesMap[tag] = [];\n var globRegex = [];\n attributes.forEach(function(name) {\n if(name.indexOf('*') >= 0) {\n globRegex.push(quoteRegexp(name).replace(/\\\\\\*/g, '.*'));\n } else {\n allowedAttributesMap[tag].push(name);\n }\n });\n allowedAttributesGlobMap[tag] = new RegExp('^(' + globRegex.join('|') + ')$');\n });\n }\n var allowedClassesMap = {};\n each(options.allowedClasses, function(classes, tag) {\n // Implicitly allows the class attribute\n if(allowedAttributesMap) {\n if (!has(allowedAttributesMap, tag)) {\n allowedAttributesMap[tag] = [];\n }\n allowedAttributesMap[tag].push('class');\n }\n\n allowedClassesMap[tag] = classes;\n });\n\n var transformTagsMap = {};\n var transformTagsAll;\n each(options.transformTags, function(transform, tag) {\n var transFun;\n if (typeof transform === 'function') {\n transFun = transform;\n } else if (typeof transform === \"string\") {\n transFun = sanitizeHtml.simpleTransform(transform);\n }\n if (tag === '*') {\n transformTagsAll = transFun;\n } else {\n transformTagsMap[tag] = transFun;\n }\n });\n\n var depth = 0;\n var stack = [];\n var skipMap = {};\n var transformMap = {};\n var skipText = false;\n var skipTextDepth = 0;\n\n var parser = new htmlparser.Parser({\n onopentag: function(name, attribs) {\n if (skipText) {\n skipTextDepth++;\n return;\n }\n var frame = new Frame(name, attribs);\n stack.push(frame);\n\n var skip = false;\n var hasText = frame.text ? true : false;\n var transformedTag;\n if (has(transformTagsMap, name)) {\n transformedTag = transformTagsMap[name](name, attribs);\n\n frame.attribs = attribs = transformedTag.attribs;\n\n if (transformedTag.text !== undefined) {\n frame.innerText = transformedTag.text;\n }\n\n if (name !== transformedTag.tagName) {\n frame.name = name = transformedTag.tagName;\n transformMap[depth] = transformedTag.tagName;\n }\n }\n if (transformTagsAll) {\n transformedTag = transformTagsAll(name, attribs);\n\n frame.attribs = attribs = transformedTag.attribs;\n if (name !== transformedTag.tagName) {\n frame.name = name = transformedTag.tagName;\n transformMap[depth] = transformedTag.tagName;\n }\n }\n\n if (options.allowedTags && options.allowedTags.indexOf(name) === -1) {\n skip = true;\n if (nonTextTagsArray.indexOf(name) !== -1) {\n skipText = true;\n skipTextDepth = 1;\n }\n skipMap[depth] = true;\n }\n depth++;\n if (skip) {\n // We want the contents but not this tag\n return;\n }\n result += '<' + name;\n if (!allowedAttributesMap || has(allowedAttributesMap, name) || allowedAttributesMap['*']) {\n each(attribs, function(value, a) {\n if (!allowedAttributesMap ||\n (has(allowedAttributesMap, name) && allowedAttributesMap[name].indexOf(a) !== -1 ) ||\n (allowedAttributesMap['*'] && allowedAttributesMap['*'].indexOf(a) !== -1 ) ||\n (has(allowedAttributesGlobMap, name) && allowedAttributesGlobMap[name].test(a)) ||\n (allowedAttributesGlobMap['*'] && allowedAttributesGlobMap['*'].test(a))) {\n if ((a === 'href') || (a === 'src')) {\n if (naughtyHref(name, value)) {\n delete frame.attribs[a];\n return;\n }\n }\n if (a === 'class') {\n value = filterClasses(value, allowedClassesMap[name]);\n if (!value.length) {\n delete frame.attribs[a];\n return;\n }\n }\n result += ' ' + a;\n if (value.length) {\n result += '=\"' + escapeHtml(value) + '\"';\n }\n } else {\n delete frame.attribs[a];\n }\n });\n }\n if (options.selfClosing.indexOf(name) !== -1) {\n result += \" />\";\n } else {\n result += \">\";\n if (frame.innerText && !hasText && !options.textFilter) {\n result += frame.innerText;\n }\n }\n },\n ontext: function(text) {\n if (skipText) {\n return;\n }\n var lastFrame = stack[stack.length-1];\n var tag;\n\n if (lastFrame) {\n tag = lastFrame.tag;\n // If inner text was set by transform function then let's use it\n text = lastFrame.innerText !== undefined ? lastFrame.innerText : text;\n }\n\n if ((tag === 'script') || (tag === 'style')) {\n // htmlparser2 gives us these as-is. Escaping them ruins the content. Allowing\n // script tags is, by definition, game over for XSS protection, so if that's\n // your concern, don't allow them. The same is essentially true for style tags\n // which have their own collection of XSS vectors.\n result += text;\n } else {\n var escaped = escapeHtml(text);\n if (options.textFilter) {\n result += options.textFilter(escaped);\n } else {\n result += escaped;\n }\n }\n if (stack.length) {\n var frame = stack[stack.length - 1];\n frame.text += text;\n }\n },\n onclosetag: function(name) {\n\n if (skipText) {\n skipTextDepth--;\n if (!skipTextDepth) {\n skipText = false;\n } else {\n return;\n }\n }\n\n var frame = stack.pop();\n if (!frame) {\n // Do not crash on bad markup\n return;\n }\n skipText = false;\n depth--;\n if (skipMap[depth]) {\n delete skipMap[depth];\n frame.updateParentNodeText();\n return;\n }\n\n if (transformMap[depth]) {\n name = transformMap[depth];\n delete transformMap[depth];\n }\n\n if (options.exclusiveFilter && options.exclusiveFilter(frame)) {\n result = result.substr(0, frame.tagPosition);\n return;\n }\n\n frame.updateParentNodeText();\n\n if (options.selfClosing.indexOf(name) !== -1) {\n // Already output />\n return;\n }\n\n result += \"</\" + name + \">\";\n }\n }, options.parser);\n parser.write(html);\n parser.end();\n\n return result;\n\n function escapeHtml(s) {\n if (typeof(s) !== 'string') {\n s = s + '';\n }\n return s.replace(/\\&/g, '&amp;').replace(/</g, '&lt;').replace(/\\>/g, '&gt;').replace(/\\\"/g, '&quot;');\n }\n\n function naughtyHref(name, href) {\n // Browsers ignore character codes of 32 (space) and below in a surprising\n // number of situations. Start reading here:\n // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet#Embedded_tab\n href = href.replace(/[\\x00-\\x20]+/g, '');\n // Clobber any comments in URLs, which the browser might\n // interpret inside an XML data island, allowing\n // a javascript: URL to be snuck through\n href = href.replace(/<\\!\\-\\-.*?\\-\\-\\>/g, '');\n // Case insensitive so we don't get faked out by JAVASCRIPT #1\n var matches = href.match(/^([a-zA-Z]+)\\:/);\n if (!matches) {\n // Protocol-relative URL: \"//some.evil.com/nasty\"\n if (href.match(/^\\/\\//)) {\n return !options.allowProtocolRelative;\n }\n\n // No scheme\n return false;\n }\n var scheme = matches[1].toLowerCase();\n\n if (has(options.allowedSchemesByTag, name)) {\n return options.allowedSchemesByTag[name].indexOf(scheme) === -1;\n }\n\n return !options.allowedSchemes || options.allowedSchemes.indexOf(scheme) === -1;\n }\n\n function filterClasses(classes, allowed) {\n if (!allowed) {\n // The class attribute is allowed without filtering on this tag\n return classes;\n }\n classes = classes.split(/\\s+/);\n return classes.filter(function(clss) {\n return allowed.indexOf(clss) !== -1;\n }).join(' ');\n }\n}", "function sanitizeHtml(html, options, _recursing) {\n var result = '';\n\n function Frame(tag, attribs) {\n var that = this;\n this.tag = tag;\n this.attribs = attribs || {};\n this.tagPosition = result.length;\n this.text = ''; // Node inner text\n\n this.updateParentNodeText = function() {\n if (stack.length) {\n var parentFrame = stack[stack.length - 1];\n parentFrame.text += that.text;\n }\n };\n }\n\n if (!options) {\n options = sanitizeHtml.defaults;\n options.parser = htmlParserDefaults;\n } else {\n options = extend(sanitizeHtml.defaults, options);\n if (options.parser) {\n options.parser = extend(htmlParserDefaults, options.parser);\n } else {\n options.parser = htmlParserDefaults;\n }\n }\n\n // Tags that contain something other than HTML, or where discarding\n // the text when the tag is disallowed makes sense for other reasons.\n // If we are not allowing these tags, we should drop their content too.\n // For other tags you would drop the tag but keep its content.\n var nonTextTagsArray = options.nonTextTags || [ 'script', 'style', 'textarea' ];\n var allowedAttributesMap;\n var allowedAttributesGlobMap;\n if(options.allowedAttributes) {\n allowedAttributesMap = {};\n allowedAttributesGlobMap = {};\n each(options.allowedAttributes, function(attributes, tag) {\n allowedAttributesMap[tag] = [];\n var globRegex = [];\n attributes.forEach(function(name) {\n if(name.indexOf('*') >= 0) {\n globRegex.push(quoteRegexp(name).replace(/\\\\\\*/g, '.*'));\n } else {\n allowedAttributesMap[tag].push(name);\n }\n });\n allowedAttributesGlobMap[tag] = new RegExp('^(' + globRegex.join('|') + ')$');\n });\n }\n var allowedClassesMap = {};\n each(options.allowedClasses, function(classes, tag) {\n // Implicitly allows the class attribute\n if(allowedAttributesMap) {\n if (!has(allowedAttributesMap, tag)) {\n allowedAttributesMap[tag] = [];\n }\n allowedAttributesMap[tag].push('class');\n }\n\n allowedClassesMap[tag] = classes;\n });\n\n var transformTagsMap = {};\n var transformTagsAll;\n each(options.transformTags, function(transform, tag) {\n var transFun;\n if (typeof transform === 'function') {\n transFun = transform;\n } else if (typeof transform === \"string\") {\n transFun = sanitizeHtml.simpleTransform(transform);\n }\n if (tag === '*') {\n transformTagsAll = transFun;\n } else {\n transformTagsMap[tag] = transFun;\n }\n });\n\n var depth = 0;\n var stack = [];\n var skipMap = {};\n var transformMap = {};\n var skipText = false;\n var skipTextDepth = 0;\n\n var parser = new htmlparser.Parser({\n onopentag: function(name, attribs) {\n if (skipText) {\n skipTextDepth++;\n return;\n }\n var frame = new Frame(name, attribs);\n stack.push(frame);\n\n var skip = false;\n var hasText = frame.text ? true : false;\n var transformedTag;\n if (has(transformTagsMap, name)) {\n transformedTag = transformTagsMap[name](name, attribs);\n\n frame.attribs = attribs = transformedTag.attribs;\n\n if (transformedTag.text !== undefined) {\n frame.innerText = transformedTag.text;\n }\n\n if (name !== transformedTag.tagName) {\n frame.name = name = transformedTag.tagName;\n transformMap[depth] = transformedTag.tagName;\n }\n }\n if (transformTagsAll) {\n transformedTag = transformTagsAll(name, attribs);\n\n frame.attribs = attribs = transformedTag.attribs;\n if (name !== transformedTag.tagName) {\n frame.name = name = transformedTag.tagName;\n transformMap[depth] = transformedTag.tagName;\n }\n }\n\n if (options.allowedTags && options.allowedTags.indexOf(name) === -1) {\n skip = true;\n if (nonTextTagsArray.indexOf(name) !== -1) {\n skipText = true;\n skipTextDepth = 1;\n }\n skipMap[depth] = true;\n }\n depth++;\n if (skip) {\n // We want the contents but not this tag\n return;\n }\n result += '<' + name;\n if (!allowedAttributesMap || has(allowedAttributesMap, name) || allowedAttributesMap['*']) {\n each(attribs, function(value, a) {\n if (!allowedAttributesMap ||\n (has(allowedAttributesMap, name) && allowedAttributesMap[name].indexOf(a) !== -1 ) ||\n (allowedAttributesMap['*'] && allowedAttributesMap['*'].indexOf(a) !== -1 ) ||\n (has(allowedAttributesGlobMap, name) && allowedAttributesGlobMap[name].test(a)) ||\n (allowedAttributesGlobMap['*'] && allowedAttributesGlobMap['*'].test(a))) {\n if ((a === 'href') || (a === 'src')) {\n if (naughtyHref(name, value)) {\n delete frame.attribs[a];\n return;\n }\n }\n if (a === 'class') {\n value = filterClasses(value, allowedClassesMap[name]);\n if (!value.length) {\n delete frame.attribs[a];\n return;\n }\n }\n result += ' ' + a;\n if (value.length) {\n result += '=\"' + value + '\"';\n }\n } else {\n delete frame.attribs[a];\n }\n });\n }\n if (options.selfClosing.indexOf(name) !== -1) {\n result += \" />\";\n } else {\n result += \">\";\n if (frame.innerText && !hasText && !options.textFilter) {\n result += frame.innerText;\n }\n }\n },\n ontext: function(text) {\n if (skipText) {\n return;\n }\n var lastFrame = stack[stack.length-1];\n var tag;\n\n if (lastFrame) {\n tag = lastFrame.tag;\n // If inner text was set by transform function then let's use it\n text = lastFrame.innerText !== undefined ? lastFrame.innerText : text;\n }\n\n if ((tag === 'script') || (tag === 'style')) {\n // htmlparser2 gives us these as-is. Escaping them ruins the content. Allowing\n // script tags is, by definition, game over for XSS protection, so if that's\n // your concern, don't allow them. The same is essentially true for style tags\n // which have their own collection of XSS vectors.\n result += text;\n } else {\n if (options.textFilter) {\n result += options.textFilter(text);\n } else {\n result += text;\n }\n }\n if (stack.length) {\n var frame = stack[stack.length - 1];\n frame.text += text;\n }\n },\n onclosetag: function(name) {\n\n if (skipText) {\n skipTextDepth--;\n if (!skipTextDepth) {\n skipText = false;\n } else {\n return;\n }\n }\n\n var frame = stack.pop();\n if (!frame) {\n // Do not crash on bad markup\n return;\n }\n skipText = false;\n depth--;\n if (skipMap[depth]) {\n delete skipMap[depth];\n frame.updateParentNodeText();\n return;\n }\n\n if (transformMap[depth]) {\n name = transformMap[depth];\n delete transformMap[depth];\n }\n\n if (options.exclusiveFilter && options.exclusiveFilter(frame)) {\n result = result.substr(0, frame.tagPosition);\n return;\n }\n\n frame.updateParentNodeText();\n\n if (options.selfClosing.indexOf(name) !== -1) {\n // Already output />\n return;\n }\n\n result += \"</\" + name + \">\";\n }\n }, options.parser);\n parser.write(html);\n parser.end();\n\n return result;\n\n function naughtyHref(name, href) {\n // Browsers ignore character codes of 32 (space) and below in a surprising\n // number of situations. Start reading here:\n // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet#Embedded_tab\n href = href.replace(/[\\x00-\\x20]+/g, '');\n // Clobber any comments in URLs, which the browser might\n // interpret inside an XML data island, allowing\n // a javascript: URL to be snuck through\n href = href.replace(/<\\!\\-\\-.*?\\-\\-\\>/g, '');\n // Case insensitive so we don't get faked out by JAVASCRIPT #1\n var matches = href.match(/^([a-zA-Z]+)\\:/);\n if (!matches) {\n // No scheme = no way to inject js (right?)\n return false;\n }\n var scheme = matches[1].toLowerCase();\n\n if (has(options.allowedSchemesByTag, name)) {\n return options.allowedSchemesByTag[name].indexOf(scheme) === -1;\n }\n\n return !options.allowedSchemes || options.allowedSchemes.indexOf(scheme) === -1;\n }\n\n function filterClasses(classes, allowed) {\n if (!allowed) {\n // The class attribute is allowed without filtering on this tag\n return classes;\n }\n classes = classes.split(/\\s+/);\n return classes.filter(function(clss) {\n return allowed.indexOf(clss) !== -1;\n }).join(' ');\n }\n}", "function strip_tags (str, allowed_tags) {\r\n // Strips HTML and PHP tags from a string \r\n // \r\n // version: 908.406\r\n // discuss at: http://phpjs.org/functions/strip_tags\r\n // + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\r\n // + improved by: Luke Godfrey\r\n // + input by: Pul\r\n // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\r\n // + bugfixed by: Onno Marsman\r\n // + input by: Alex\r\n // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\r\n // + input by: Marc Palau\r\n // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\r\n // + input by: Brett Zamir (http://brett-zamir.me)\r\n // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\r\n // + bugfixed by: Eric Nagel\r\n // + input by: Bobby Drake\r\n // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\r\n // + bugfixed by: Tomasz Wesolowski\r\n // * example 1: strip_tags('<p>Kevin</p> <br /><b>van</b> <i>Zonneveld</i>', '<i><b>');\r\n // * returns 1: 'Kevin <b>van</b> <i>Zonneveld</i>'\r\n // * example 2: strip_tags('<p>Kevin <img src=\"someimage.png\" onmouseover=\"someFunction()\">van <i>Zonneveld</i></p>', '<p>');\r\n // * returns 2: '<p>Kevin van Zonneveld</p>'\r\n // * example 3: strip_tags(\"<a href='http://kevin.vanzonneveld.net'>Kevin van Zonneveld</a>\", \"<a>\");\r\n // * returns 3: '<a href='http://kevin.vanzonneveld.net'>Kevin van Zonneveld</a>'\r\n // * example 4: strip_tags('1 < 5 5 > 1');\r\n // * returns 4: '1 < 5 5 > 1'\r\n var key = '', allowed = false;\r\n var matches = [];\r\n var allowed_array = [];\r\n var allowed_tag = '';\r\n var i = 0;\r\n var k = '';\r\n var html = '';\r\n var replacer = function (search, replace, str) {\r\n return str.split(search).join(replace);\r\n };\r\n // Build allowes tags associative array\r\n if (allowed_tags) {\r\n allowed_array = allowed_tags.match(/([a-zA-Z0-9]+)/gi);\r\n }\r\n str += '';\r\n // Match tags\r\n matches = str.match(/(<\\/?[\\S][^>]*>)/gi);\r\n // Go through all HTML tags\r\n for (key in matches) {\r\n if (isNaN(key)) {\r\n // IE7 Hack\r\n continue;\r\n }\r\n // Save HTML tag\r\n html = matches[key].toString();\r\n // Is tag not in allowed list? Remove from str!\r\n allowed = false;\r\n // Go through all allowed tags\r\n for (k in allowed_array) {\r\n // Init\r\n allowed_tag = allowed_array[k];\r\n i = -1;\r\n if (i != 0) { i = html.toLowerCase().indexOf('<'+allowed_tag+'>');}\r\n if (i != 0) { i = html.toLowerCase().indexOf('<'+allowed_tag+' ');}\r\n if (i != 0) { i = html.toLowerCase().indexOf('</'+allowed_tag) ;}\r\n\r\n // Determine\r\n if (i == 0) {\r\n allowed = true;\r\n break;\r\n }\r\n }\r\n if (!allowed) {\r\n str = replacer(html, \"\", str); // Custom replace. No regexing\r\n }\r\n }\r\n return str;\r\n}", "function sanitizeHtml(html, options, _recursing) {\n var result = '';\n\n function Frame(tag, attribs) {\n var that = this;\n this.tag = tag;\n this.attribs = attribs || {};\n this.tagPosition = result.length;\n this.text = ''; // Node inner text\n\n this.updateParentNodeText = function () {\n if (stack.length) {\n var parentFrame = stack[stack.length - 1];\n parentFrame.text += that.text;\n }\n };\n }\n\n if (!options) {\n options = sanitizeHtml.defaults;\n options.parser = htmlParserDefaults;\n } else {\n options = extend(sanitizeHtml.defaults, options);\n if (options.parser) {\n options.parser = extend(htmlParserDefaults, options.parser);\n } else {\n options.parser = htmlParserDefaults;\n }\n }\n\n // Tags that contain something other than HTML, or where discarding\n // the text when the tag is disallowed makes sense for other reasons.\n // If we are not allowing these tags, we should drop their content too.\n // For other tags you would drop the tag but keep its content.\n var nonTextTagsArray = options.nonTextTags || ['script', 'style', 'textarea'];\n var allowedAttributesMap;\n var allowedAttributesGlobMap;\n if (options.allowedAttributes) {\n allowedAttributesMap = {};\n allowedAttributesGlobMap = {};\n each(options.allowedAttributes, function (attributes, tag) {\n allowedAttributesMap[tag] = [];\n var globRegex = [];\n attributes.forEach(function (obj) {\n if (isString(obj) && obj.indexOf('*') >= 0) {\n globRegex.push(quoteRegexp(obj).replace(/\\\\\\*/g, '.*'));\n } else {\n allowedAttributesMap[tag].push(obj);\n }\n });\n allowedAttributesGlobMap[tag] = new RegExp('^(' + globRegex.join('|') + ')$');\n });\n }\n var allowedClassesMap = {};\n each(options.allowedClasses, function (classes, tag) {\n // Implicitly allows the class attribute\n if (allowedAttributesMap) {\n if (!has(allowedAttributesMap, tag)) {\n allowedAttributesMap[tag] = [];\n }\n allowedAttributesMap[tag].push('class');\n }\n\n allowedClassesMap[tag] = classes;\n });\n\n var transformTagsMap = {};\n var transformTagsAll;\n each(options.transformTags, function (transform, tag) {\n var transFun;\n if (typeof transform === 'function') {\n transFun = transform;\n } else if (typeof transform === \"string\") {\n transFun = sanitizeHtml.simpleTransform(transform);\n }\n if (tag === '*') {\n transformTagsAll = transFun;\n } else {\n transformTagsMap[tag] = transFun;\n }\n });\n\n var depth = 0;\n var stack = [];\n var skipMap = {};\n var transformMap = {};\n var skipText = false;\n var skipTextDepth = 0;\n\n var parser = new htmlparser.Parser({\n onopentag: function onopentag(name, attribs) {\n if (skipText) {\n skipTextDepth++;\n return;\n }\n var frame = new Frame(name, attribs);\n stack.push(frame);\n\n var skip = false;\n var hasText = frame.text ? true : false;\n var transformedTag;\n if (has(transformTagsMap, name)) {\n transformedTag = transformTagsMap[name](name, attribs);\n\n frame.attribs = attribs = transformedTag.attribs;\n\n if (transformedTag.text !== undefined) {\n frame.innerText = transformedTag.text;\n }\n\n if (name !== transformedTag.tagName) {\n frame.name = name = transformedTag.tagName;\n transformMap[depth] = transformedTag.tagName;\n }\n }\n if (transformTagsAll) {\n transformedTag = transformTagsAll(name, attribs);\n\n frame.attribs = attribs = transformedTag.attribs;\n if (name !== transformedTag.tagName) {\n frame.name = name = transformedTag.tagName;\n transformMap[depth] = transformedTag.tagName;\n }\n }\n\n if (options.allowedTags && options.allowedTags.indexOf(name) === -1) {\n skip = true;\n if (nonTextTagsArray.indexOf(name) !== -1) {\n skipText = true;\n skipTextDepth = 1;\n }\n skipMap[depth] = true;\n }\n depth++;\n if (skip) {\n // We want the contents but not this tag\n return;\n }\n result += '<' + name;\n if (!allowedAttributesMap || has(allowedAttributesMap, name) || allowedAttributesMap['*']) {\n each(attribs, function (value, a) {\n if (!VALID_HTML_ATTRIBUTE_NAME.test(a)) {\n // This prevents part of an attribute name in the output from being\n // interpreted as the end of an attribute, or end of a tag.\n delete frame.attribs[a];\n return;\n }\n var parsed;\n // check allowedAttributesMap for the element and attribute and modify the value\n // as necessary if there are specific values defined.\n var passedAllowedAttributesMapCheck = false;\n if (!allowedAttributesMap || has(allowedAttributesMap, name) && allowedAttributesMap[name].indexOf(a) !== -1 || allowedAttributesMap['*'] && allowedAttributesMap['*'].indexOf(a) !== -1 || has(allowedAttributesGlobMap, name) && allowedAttributesGlobMap[name].test(a) || allowedAttributesGlobMap['*'] && allowedAttributesGlobMap['*'].test(a)) {\n passedAllowedAttributesMapCheck = true;\n } else if (allowedAttributesMap && allowedAttributesMap[name]) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = allowedAttributesMap[name][Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var o = _step.value;\n\n if (isPlainObject(o) && o.name && o.name === a) {\n passedAllowedAttributesMapCheck = true;\n var newValue = '';\n if (o.multiple === true) {\n // verify the values that are allowed\n var splitStrArray = value.split(' ');\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = splitStrArray[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var s = _step2.value;\n\n if (o.values.indexOf(s) !== -1) {\n if (newValue === '') {\n newValue = s;\n } else {\n newValue += ' ' + s;\n }\n }\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n } else if (o.values.indexOf(value) >= 0) {\n // verified an allowed value matches the entire attribute value\n newValue = value;\n }\n value = newValue;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n if (passedAllowedAttributesMapCheck) {\n if (options.allowedSchemesAppliedToAttributes.indexOf(a) !== -1) {\n if (naughtyHref(name, value)) {\n delete frame.attribs[a];\n return;\n }\n }\n if (name === 'iframe' && a === 'src') {\n //Check if value contains proper hostname prefix\n if (value.substring(0, 2) === '//') {\n var prefix = 'https:';\n value = prefix.concat(value);\n }\n try {\n parsed = url.parse(value);\n if (options.allowedIframeHostnames) {\n var whitelistedHostnames = options.allowedIframeHostnames.find(function (hostname) {\n return hostname === parsed.hostname;\n });\n if (!whitelistedHostnames) {\n delete frame.attribs[a];\n return;\n }\n }\n } catch (e) {\n // Unparseable iframe src\n delete frame.attribs[a];\n return;\n }\n }\n if (a === 'srcset') {\n try {\n parsed = srcset.parse(value);\n each(parsed, function (value) {\n if (naughtyHref('srcset', value.url)) {\n value.evil = true;\n }\n });\n parsed = filter(parsed, function (v) {\n return !v.evil;\n });\n if (!parsed.length) {\n delete frame.attribs[a];\n return;\n } else {\n value = srcset.stringify(filter(parsed, function (v) {\n return !v.evil;\n }));\n frame.attribs[a] = value;\n }\n } catch (e) {\n // Unparseable srcset\n delete frame.attribs[a];\n return;\n }\n }\n if (a === 'class') {\n value = filterClasses(value, allowedClassesMap[name]);\n if (!value.length) {\n delete frame.attribs[a];\n return;\n }\n }\n if (a === 'style') {\n try {\n var abstractSyntaxTree = postcss.parse(name + \" {\" + value + \"}\");\n var filteredAST = filterCss(abstractSyntaxTree, options.allowedStyles);\n\n value = stringifyStyleAttributes(filteredAST);\n\n if (value.length === 0) {\n delete frame.attribs[a];\n return;\n }\n } catch (e) {\n delete frame.attribs[a];\n return;\n }\n }\n result += ' ' + a;\n if (value.length) {\n result += '=\"' + escapeHtml(value) + '\"';\n }\n } else {\n delete frame.attribs[a];\n }\n });\n }\n if (options.selfClosing.indexOf(name) !== -1) {\n result += \" />\";\n } else {\n result += \">\";\n if (frame.innerText && !hasText && !options.textFilter) {\n result += frame.innerText;\n }\n }\n },\n ontext: function ontext(text) {\n if (skipText) {\n return;\n }\n var lastFrame = stack[stack.length - 1];\n var tag;\n\n if (lastFrame) {\n tag = lastFrame.tag;\n // If inner text was set by transform function then let's use it\n text = lastFrame.innerText !== undefined ? lastFrame.innerText : text;\n }\n\n if (tag === 'script' || tag === 'style') {\n // htmlparser2 gives us these as-is. Escaping them ruins the content. Allowing\n // script tags is, by definition, game over for XSS protection, so if that's\n // your concern, don't allow them. The same is essentially true for style tags\n // which have their own collection of XSS vectors.\n result += text;\n } else {\n var escaped = escapeHtml(text);\n if (options.textFilter) {\n result += options.textFilter(escaped);\n } else {\n result += escaped;\n }\n }\n if (stack.length) {\n var frame = stack[stack.length - 1];\n frame.text += text;\n }\n },\n onclosetag: function onclosetag(name) {\n\n if (skipText) {\n skipTextDepth--;\n if (!skipTextDepth) {\n skipText = false;\n } else {\n return;\n }\n }\n\n var frame = stack.pop();\n if (!frame) {\n // Do not crash on bad markup\n return;\n }\n skipText = false;\n depth--;\n if (skipMap[depth]) {\n delete skipMap[depth];\n frame.updateParentNodeText();\n return;\n }\n\n if (transformMap[depth]) {\n name = transformMap[depth];\n delete transformMap[depth];\n }\n\n if (options.exclusiveFilter && options.exclusiveFilter(frame)) {\n result = result.substr(0, frame.tagPosition);\n return;\n }\n\n frame.updateParentNodeText();\n\n if (options.selfClosing.indexOf(name) !== -1) {\n // Already output />\n return;\n }\n\n result += \"</\" + name + \">\";\n }\n }, options.parser);\n parser.write(html);\n parser.end();\n\n return result;\n\n function escapeHtml(s) {\n if (typeof s !== 'string') {\n s = s + '';\n }\n return s.replace(/\\&/g, '&amp;').replace(/</g, '&lt;').replace(/\\>/g, '&gt;').replace(/\\\"/g, '&quot;');\n }\n\n function naughtyHref(name, href) {\n // Browsers ignore character codes of 32 (space) and below in a surprising\n // number of situations. Start reading here:\n // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet#Embedded_tab\n href = href.replace(/[\\x00-\\x20]+/g, '');\n // Clobber any comments in URLs, which the browser might\n // interpret inside an XML data island, allowing\n // a javascript: URL to be snuck through\n href = href.replace(/<\\!\\-\\-.*?\\-\\-\\>/g, '');\n // Case insensitive so we don't get faked out by JAVASCRIPT #1\n var matches = href.match(/^([a-zA-Z]+)\\:/);\n if (!matches) {\n // Protocol-relative URL starting with any combination of '/' and '\\'\n if (href.match(/^[\\/\\\\]{2}/)) {\n return !options.allowProtocolRelative;\n }\n\n // No scheme\n return false;\n }\n var scheme = matches[1].toLowerCase();\n\n if (has(options.allowedSchemesByTag, name)) {\n return options.allowedSchemesByTag[name].indexOf(scheme) === -1;\n }\n\n return !options.allowedSchemes || options.allowedSchemes.indexOf(scheme) === -1;\n }\n\n /**\n * Filters user input css properties by whitelisted regex attributes.\n *\n * @param {object} abstractSyntaxTree - Object representation of CSS attributes.\n * @property {array[Declaration]} abstractSyntaxTree.nodes[0] - Each object cointains prop and value key, i.e { prop: 'color', value: 'red' }.\n * @param {object} allowedStyles - Keys are properties (i.e color), value is list of permitted regex rules (i.e /green/i).\n * @return {object} - Abstract Syntax Tree with filtered style attributes.\n */\n function filterCss(abstractSyntaxTree, allowedStyles) {\n if (!allowedStyles) {\n return abstractSyntaxTree;\n }\n\n var filteredAST = cloneDeep(abstractSyntaxTree);\n var astRules = abstractSyntaxTree.nodes[0];\n var selectedRule;\n\n // Merge global and tag-specific styles into new AST.\n if (allowedStyles[astRules.selector] && allowedStyles['*']) {\n selectedRule = mergeWith(cloneDeep(allowedStyles[astRules.selector]), allowedStyles['*'], function (objValue, srcValue) {\n if (Array.isArray(objValue)) {\n return objValue.concat(srcValue);\n }\n });\n } else {\n selectedRule = allowedStyles[astRules.selector] || allowedStyles['*'];\n }\n\n if (selectedRule) {\n filteredAST.nodes[0].nodes = astRules.nodes.reduce(filterDeclarations(selectedRule), []);\n }\n\n return filteredAST;\n }\n\n /**\n * Extracts the style attribues from an AbstractSyntaxTree and formats those\n * values in the inline style attribute format.\n *\n * @param {AbstractSyntaxTree} filteredAST\n * @return {string} - Example: \"color:yellow;text-align:center;font-family:helvetica;\"\n */\n function stringifyStyleAttributes(filteredAST) {\n return filteredAST.nodes[0].nodes.reduce(function (extractedAttributes, attributeObject) {\n extractedAttributes.push(attributeObject.prop + ':' + attributeObject.value + ';');\n return extractedAttributes;\n }, []).join('');\n }\n\n /**\n * Filters the existing attributes for the given property. Discards any attributes\n * which don't match the whitelist.\n *\n * @param {object} selectedRule - Example: { color: red, font-family: helvetica }\n * @param {array} allowedDeclarationsList - List of declarations which pass whitelisting.\n * @param {object} attributeObject - Object representing the current css property.\n * @property {string} attributeObject.type - Typically 'declaration'.\n * @property {string} attributeObject.prop - The CSS property, i.e 'color'.\n * @property {string} attributeObject.value - The corresponding value to the css property, i.e 'red'.\n * @return {function} - When used in Array.reduce, will return an array of Declaration objects\n */\n function filterDeclarations(selectedRule) {\n return function (allowedDeclarationsList, attributeObject) {\n // If this property is whitelisted...\n if (selectedRule.hasOwnProperty(attributeObject.prop)) {\n var matchesRegex = selectedRule[attributeObject.prop].some(function (regularExpression) {\n return regularExpression.test(attributeObject.value);\n });\n\n if (matchesRegex) {\n allowedDeclarationsList.push(attributeObject);\n }\n }\n return allowedDeclarationsList;\n };\n }\n\n function filterClasses(classes, allowed) {\n if (!allowed) {\n // The class attribute is allowed without filtering on this tag\n return classes;\n }\n classes = classes.split(/\\s+/);\n return classes.filter(function (clss) {\n return allowed.indexOf(clss) !== -1;\n }).join(' ');\n }\n}", "function checkForTags()\n\t\t\t{\n\t\t\t\tif (dialogueLabel.text[tempPosition] == \"<\")\n\t\t\t\t{\n\t\t\t\t\twhile (dialogueLabel.text[tempPosition] != \">\")\n\t\t\t\t\t\ttempPosition++;\n\t\t\t\t\tif (dialogueLabel.text[tempPosition] == \">\")\n\t\t\t\t\t\ttempPosition++;\n\t\t\t\t}\n\t\t\t}", "function untagSelectedText( fTag, fAttrs, ld, rd, fDirectEditing) {\r\n var input = self.el;\r\n /* internet explorer */\r\n if( typeof document.selection != 'undefined') {\r\n var range = document.selection.createRange();\r\n var selText = range.text;\r\n /* für Direct-Editing */\r\n if ( fDirectEditing) {\r\n var inpValue = input.value;\r\n /* Preceding selected text */\r\n var fullText = untag( inpValue);\r\n var aRange = range.duplicate();\r\n while ( fullText.indexOf( aRange.text) != 0)\r\n aRange.moveStart( 'word', -1);\r\n aRange.moveEnd( 'word', -1);\r\n /* Find Preceding selected text in raw-html of input */\r\n var start = taggedStart( inpValue, aRange.text);\r\n while ( inpValue.charAt( start) == ' ')\r\n start++;\r\n var aTag = ld+fTag+rd;\r\n var eTag = ld+'/'+fTag+rd;\r\n var taggedText = selText;\r\n /* Strip trailing blanks */\r\n while ( taggedText.length > 0 && taggedText.charAt( taggedText.length - 1) == ' ') {\r\n taggedText = taggedText.substr( 0, taggedText.length - 1);\r\n eTag += ' ';\r\n }\r\n /* Apply value */\r\n if ( inpValue.substr( start).indexOf( aTag + taggedText + eTag) == 0 ||\r\n inpValue.substr( start).indexOf( aTag.toUpperCase() + taggedText + eTag.toUpperCase()) == 0 ) {\r\n input.value = inpValue.substr( 0, start) + selText + inpValue.substr( start + (aTag + taggedText + eTag).length);\r\n return true;\r\n }\r\n }\r\n else {\r\n var startTag = ld+fTag;\r\n var endTag = ld+'/'+fTag+rd;\r\n if ( selText.indexOf(startTag) == 0 && selText.lastIndexOf(endTag) == selText.length - endTag.length) {\r\n selText = selText.substr( startTag.length + 1, selText.lastIndexOf( endTag) - startTag.length - 1); \r\n /* Apply value */\r\n range.text = selText;\r\n return true;\r\n }\r\n else {\r\n range.moveStart('character', -(startTag.length+1));\r\n range.moveEnd('character', endTag.length);\r\n var taggedText = range.text;\r\n if ( taggedText.indexOf(startTag) == 0 && taggedText.lastIndexOf(endTag) == taggedText.length - endTag.length) {\r\n /* Apply value */\r\n range.text = selText;\r\n return true;\r\n }\r\n else if ( fAttrs.length > 0) {\r\n startTag += fAttrs;\r\n range.moveStart('character', -fAttrs.length);\r\n var taggedText = range.text;\r\n if ( taggedText.indexOf(startTag) == 0 && taggedText.lastIndexOf(endTag) == taggedText.length - endTag.length) {\r\n /* Apply value */\r\n range.text = selText;\r\n return true;\r\n }\r\n }\r\n } \r\n }\r\n }\r\n /* newer gecko-based browsers */\r\n else if( typeof input.selectionStart != 'undefined') {\r\n var start = self.selectionStart;\r\n var end = self.selectionEnd;\r\n var inpValue = input.value;\r\n var selText = inpValue.substring( start, end);\r\n var tagStart = inpValue.substr( 0, start);\r\n var i = tagStart.length;\r\n var c = tagStart.charAt( i - 1);\r\n if ( c == '>') {\r\n /* Handle DTML in a.href */\r\n i--;\r\n var l = 1;\r\n while ( l > 0 && i > 0) {\r\n c = tagStart.charAt( i - 1);\r\n if ( c == rd)\r\n l++;\r\n if ( c == ld)\r\n l--;\r\n i--;\r\n }\r\n if ( i >= 0) {\r\n var tag = tagStart.substr( i);\r\n tagStart = tagStart.substr( 0, i);\r\n if ( tag.indexOf(ld+fTag) == 0 && tag.indexOf(rd) > 0) {\r\n var tagEnd = inpValue.substr( end);\r\n if ( tagEnd.indexOf(rd) > 0) {\r\n var tag = tagEnd.substr( 0, tagEnd.indexOf(rd) + 1);\r\n tagEnd = tagEnd.substr( tagEnd.indexOf(rd) + 1);\r\n if ( tag.indexOf(ld+'/'+fTag+rd) == 0) {\r\n input.value = tagStart + selText + tagEnd;\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return false;\r\n}", "function SafeHtml() { }", "function SafeHtml() { }", "function SafeHtml() { }", "function stripHtml(input) {\n\t\tif (typeof input === 'undefined') {\n\t\t\treturn '';\n\t\t}\n\t\t// note this is not a good way to do this with normal HTML, but works for GW2's item db\n\t\tvar stripped = input.replace(/<br>/ig, '\\n');\n\t\tstripped = stripped.replace(/(<([^>]+)>)/ig, '');\n\t\tstripped = stripped.replace(/\\n|\\\\n/g, '<br>');\n\t\treturn stripped;\n\t}", "stripTags(text) {\n return text.trim().replace(/(^\\{)|(\\-{2})|(\\}$)+/g, '').split('=')\n }", "function sanitizeHtml(html) {\n return defaultHtmlSanitizer.sanitize(html);\n}", "function _sanitizeHtml(html) {\n return html.replace(/\\<\\s*script/gi, '');\n }", "function strip_HTML(str) {\n var findHtml = /<(.|\\n)*?>/gi;\n return str.replace(findHtml,\"\");\n}", "function fixEmptyTags(xmlString) {\n return xmlString.replace(/<(([\\w:.-]+)(?:\\s[^>]*|))\\/>/g, \"<$1></$2>\");\n }", "function stripHtmlTags(str) {\n str = toString_1[\"default\"](str);\n return str.replace(/<[^>]*>/g, '');\n}", "function strip_tags(aString)\n{\n\treturn aString.replace(/<[^>]*>/g,\"\");\n}", "function cleanUpRTEHtmlMarkup(msg) {\n msg = msg.replace(/(<p><\\/p>)/ig,\"\"); //replace <p></p> - globally\n msg = msg.replace(/<p/ig,\"<span\"); //replace all open paragraphs with span\n msg = msg.replace(/<\\/p>/ig,\"</span></br>\"); //replace all closing paragraphs with closing span and break. Please note that <br/> keeps the indentation in-tact - where as <p/> invalidates it.\n return msg;\n }", "function validateTagName(tagname) {\n return util.isName(tagname) /* && !tagname.match(startsWithXML) */;\n}", "function validateTagName(tagname) {\n return util.isName(tagname) /* && !tagname.match(startsWithXML) */;\n}", "function validateTagName(tagname) {\n return util.isName(tagname) /* && !tagname.match(startsWithXML) */;\n}", "function validateTagName(tagname) {\n return util.isName(tagname) /* && !tagname.match(startsWithXML) */;\n}", "function validateTagName(tagname) {\n return util.isName(tagname) /* && !tagname.match(startsWithXML) */;\n}", "function stripTags(srcString)\r\n{\r\n return decodeHTML(srcString).replace(new RegExp(\"> <\", \"g\"), \"><\")\r\n .replace(new RegExp(\"><\", \"g\"), \">\\r\\n<\")\r\n .replace(new RegExp(\"(^<[\\\\s\\\\S]+?>)\", \"gm\"), \"\")\r\n .replace(new RegExp(\"\\r\", \"g\"), \"\")\r\n .replace(new RegExp(\"\\n{2,}\", \"g\"), \"\\n\\n\")\r\n .replace(new RegExp(\"</pre>\", \"g\"), \"\")\r\n .replace(new RegExp(\"</h3>\", \"g\"), \"\")\r\n .replace(new RegExp(\"</font>\", \"g\"), \"\");\r\n}", "function stripTags(text) {\n return text ? text.replace(/<[^>]*>/g, \"\") : text;\n}", "function cleanUp(str) {\n\treturn str.replace(/<!--[\\w\\W]+?-->/g,'')\n\t\t.replace(/\\sclass=\"[^\"]*\"/g,'')\n\t\t.replace(/<span>\\s*([\\w\\W]+?)\\s*<\\/span>/g, '$1')\n\t\t.replace(/\\s+/g,' ')\n\t\t.replace(/\\s+([;,.])/g,'$1')\n\t\t.replace(/(\\d+)\\s+(min|sec|g)/g, '$1&nbsp;$2')\n\t\t.replace(/(speed)\\s+(\\d+)/g, '$1&nbsp;$2')\n\t\t//.replace(/(<(span)[^>]*>)\\s*([^<]+?)\\s*(<\\/\\2)/g,'$1$3$4')\n}", "function htmlStrip(string) {\n\n var output = string.replace(/<(.*?)>/g, '');\n return output;\n\n}", "tagName(source, onError) {\n if (source === '!')\n return '!'; // non-specific tag\n if (source[0] !== '!') {\n onError(`Not a valid tag: ${source}`);\n return null;\n }\n if (source[1] === '<') {\n const verbatim = source.slice(2, -1);\n if (verbatim === '!' || verbatim === '!!') {\n onError(`Verbatim tags aren't resolved, so ${source} is invalid.`);\n return null;\n }\n if (source[source.length - 1] !== '>')\n onError('Verbatim tags must end with a >');\n return verbatim;\n }\n const [, handle, suffix] = source.match(/^(.*!)([^!]*)$/);\n if (!suffix)\n onError(`The ${source} tag has no suffix`);\n const prefix = this.tags[handle];\n if (prefix)\n return prefix + decodeURIComponent(suffix);\n if (handle === '!')\n return source; // local tag\n onError(`Could not resolve tag: ${source}`);\n return null;\n }", "function processStartTag(startTag) {\n var stripped = stripExistingShuffleAttribute(startTag);\n var test = \"<choiceInteraction$1\" + \" shuffle=\\\"true\\\"\" + \"$2\";\n return stripped.replace(/<choiceInteraction([.\\s\\S]*?)([>|/>])/gm, test).replace(/ /g, \" \");\n }" ]
[ "0.7300031", "0.7180153", "0.69721156", "0.66043717", "0.6506701", "0.64355326", "0.6374739", "0.6302117", "0.6286601", "0.6213519", "0.61980546", "0.6160311", "0.6159732", "0.6108086", "0.60845923", "0.6064076", "0.6051057", "0.5988401", "0.59689945", "0.59150696", "0.59148127", "0.5910002", "0.5910002", "0.5902527", "0.5890366", "0.58879155", "0.58876526", "0.5881665", "0.5875546", "0.5868084", "0.5865547", "0.5834404", "0.5825539", "0.5806962", "0.578775", "0.5779069", "0.57613736", "0.57560664", "0.5745383", "0.5729055", "0.57269937", "0.572401", "0.57202315", "0.570837", "0.5688267", "0.5684293", "0.56799096", "0.5672126", "0.5649063", "0.56357473", "0.5634333", "0.56343323", "0.56219065", "0.55807173", "0.5563444", "0.5558481", "0.55583435", "0.555135", "0.55432963", "0.55411655", "0.55393827", "0.55253655", "0.5523831", "0.5518078", "0.5514892", "0.55114204", "0.55096805", "0.5506783", "0.5506783", "0.5506783", "0.5506783", "0.5506783", "0.55067664", "0.55067664", "0.55062956", "0.550035", "0.5494439", "0.549029", "0.54842097", "0.54842097", "0.54842097", "0.5483244", "0.5480672", "0.5477347", "0.5474949", "0.54705906", "0.54636836", "0.5448366", "0.5447105", "0.54360354", "0.5427626", "0.5427626", "0.5427626", "0.5427626", "0.5427626", "0.54116595", "0.5409425", "0.5408399", "0.5406828", "0.54034895", "0.54018325" ]
0.0
-1
accepts multiple subject els returns a real array. good for methods like forEach
function findElements(container, selector) { var containers = container instanceof HTMLElement ? [container] : container; var allMatches = []; for (var i = 0; i < containers.length; i++) { var matches = containers[i].querySelectorAll(selector); for (var j = 0; j < matches.length; j++) { allMatches.push(matches[j]); } } return allMatches; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function make_array( subject ) {\n\treturn Array.isArray( subject ) ? subject : [ subject ];\n}", "function makeArray( subject ) {\n\treturn Array.isArray( subject ) ? subject : [ subject ];\n}", "function make_array(subject) {\n return Array.isArray(subject) ? subject : [subject];\n}", "function make_array(subject) {\n return Array.isArray(subject) ? subject : [subject];\n}", "function makeArray(subject) {\n return Array.isArray(subject) ? subject : [subject];\n}", "function makeArray(subject) {\n return Array.isArray(subject) ? subject : [subject];\n}", "function makeArray (subject) {\n return Array.isArray(subject)\n ? subject\n : [subject]\n}", "function makeArray (subject) {\n return Array.isArray(subject)\n ? subject\n : [subject]\n}", "function makeArray (subject) {\n return Array.isArray(subject)\n ? subject\n : [subject]\n}", "function makeArray (subject) {\n return Array.isArray(subject)\n ? subject\n : [subject]\n}", "function makeArray (subject) {\n return Array.isArray(subject)\n ? subject\n : [subject]\n}", "function subject(card) {\n let subs = [];\n for (let i = 0; i < card.length; i++) {\n subs.push(card[i].subject);\n }\n return subs;\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}", "getSubjects(predicate, object, graph) {\n const results = [];\n this.forSubjects(s => {\n results.push(s);\n }, predicate, object, graph);\n return results;\n }", "getSubjects(predicate, object, graph) {\n var results = [];\n this.forSubjects(function (s) {\n results.push(s);\n }, predicate, object, graph);\n return results;\n }", "getSubjects(data) {\n let subjects = [];\n for (const course of Object.values(data)) {\n if (subjects.indexOf(course.subject) === -1)\n subjects.push(course.subject);\n }\n return subjects;\n }", "function collectortoarray(q,c){\n \n var inpt=[];\n let counter = 0;\n \n c.forEach((value) => {\n inpt[counter]=[q[counter][0],value.content];\n counter++;\n });\n\n console.log(inpt);\n return inpt;\n}", "function ma(a){var b,c,d,e=[];for(b=0;b<a.length;b++)for(c=a[b],d=0;d<c.length;d++)e.push(c[d]);return e}", "getObjects(subject, predicate, graph) {\n var results = [];\n this.forObjects(function (o) {\n results.push(o);\n }, subject, predicate, graph);\n return results;\n }", "getObjects(subject, predicate, graph) {\n const results = [];\n this.forObjects(o => {\n results.push(o);\n }, subject, predicate, graph);\n return results;\n }", "function generateScheduleList(days, subjects) {\n var schedules = [];\n var k = 0;\n for (var i = 0; i < days.length; i++) {\n var schedule = {\n day: days[i]\n };\n //var subs = [subjects[i].length / 3];\n var subs = [];\n for (var j = 0; j < subjects[i].length; j += 3) {\n var day = subjects[i];\n var sub = {\n title: day[j],\n time: day[j + 1],\n room: day[j + 2]\n };\n subs[k++] = sub;\n }\n schedule.subjects = subs;\n schedules.push(schedule);\n k = 0;\n }\n return schedules;\n}", "function makeArrayOfItems () {\n return Array.from(arguments)\n}", "function i$1(e,t){if(!e||!t)return null;const n=[];for(let a=0;a<e.length;a++)n.push(e[a]),n.push(t[a]);return n}", "function findElements(container, selector) {\n var containers = container instanceof HTMLElement ? [container] : container;\n var allMatches = [];\n\n for (var i = 0; i < containers.length; i++) {\n var matches = containers[i].querySelectorAll(selector);\n\n for (var j = 0; j < matches.length; j++) {\n allMatches.push(matches[j]);\n }\n }\n\n return allMatches;\n } // accepts multiple subject els", "function Topics() {\n var arr = [];\n arr.push.apply(arr, arguments);\n arr.__proto__ = Topics.prototype;\n return arr;\n}", "function t() {\n var n = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : I;\n return [n[0], n[1], n[2], n[3]];\n }", "function convertToArrs(elem) {\n return function(el) {\n return el.qs.map(convertTo(elem));\n };\n }", "toArray() {}", "toArray() {}", "toArray() {}", "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 }", "subscribe(e, s) {\n this.has(e) || (this.events[e] = []);\n let t = [];\n if (Array.isArray(s)) for (const r of s) t.push(...this.subscribe(e, r)); else this.events[e].push(s), \n t.push((() => this.removeListener(e, s)));\n return t;\n }", "function byAtt(n, a, e) {\r\n var r = new Array();\r\n for (var i = 0; i < n.length; i++) {\r\n if (e.test(objAtt(n[i], a))) {\r\n r[r.length] = n[i];\r\n }\r\n }\r\n return r;\r\n}", "function getArray(items) {\n return new Array().concat(items);\n}", "function getArray(items) {\n return new Array().concat(items);\n}", "function getArray(items) {\n return new Array().concat(items);\n}", "function getItems(...items) {\n const el = [];\n for (let i of items) {\n for (let j of data) {\n if (i == j.title) el.push(j);\n }\n }\n return el;\n}", "function toArray(enu) {\n var arr = [];\n\n for (var i = 0, l = enu.length; i < l; i++)\n arr.push(enu[i]);\n\n return arr;\n}", "getQuads(subject, predicate, object, graph) {\n return [...this.readQuads(subject, predicate, object, graph)];\n }", "function authorSolution(...arrays) {\n return arrays.flat();\n}", "toArray () {\n return this._content.map(function (x, i) {\n return x.val\n })\n }", "toArray() {\n let arr = [];\n let n = this._dummy.next;\n\n while (n !== this._dummy) {\n arr.push(n.data);\n n = n.next;\n }\n\n return arr;\n }", "function $a(a) {\n var r = new Array();\n for (var i = 0, l = a.length; i < l; i++) {\n r.push(a[i]);\n }\n return r;\n}", "function _filterSubjects(state, subjects, frame, flags) {\n // filter subjects in @id order\n var rval = {};\n for(var i = 0; i < subjects.length; ++i) {\n var id = subjects[i];\n var subject = state.subjects[id];\n if(_filterSubject(subject, frame, flags)) {\n rval[id] = subject;\n }\n }\n return rval;\n}", "function _filterSubjects(state, subjects, frame, flags) {\n // filter subjects in @id order\n var rval = {};\n for(var i = 0; i < subjects.length; ++i) {\n var id = subjects[i];\n var subject = state.subjects[id];\n if(_filterSubject(subject, frame, flags)) {\n rval[id] = subject;\n }\n }\n return rval;\n}", "function _filterSubjects(state, subjects, frame, flags) {\n // filter subjects in @id order\n var rval = {};\n for(var i = 0; i < subjects.length; ++i) {\n var id = subjects[i];\n var subject = state.subjects[id];\n if(_filterSubject(subject, frame, flags)) {\n rval[id] = subject;\n }\n }\n return rval;\n}", "function _filterSubjects(state, subjects, frame, flags) {\n // filter subjects in @id order\n var rval = {};\n for(var i = 0; i < subjects.length; ++i) {\n var id = subjects[i];\n var subject = state.subjects[id];\n if(_filterSubject(subject, frame, flags)) {\n rval[id] = subject;\n }\n }\n return rval;\n}", "function triple(subject, predicate, object, language) {\n var triple = [];\n triple[0] = subject;\n triple[1] = predicate;\n triple[2] = object;\n \n if (typeof language === 'undefined') {\n } else {\n triple[3] = language;\n }\n \n return triple;\n}", "function getData(keywords, from, to) {\n var dataSets = keywords.map(function (kw) {\n return dataPointsForSubject(kw, from, to);\n })\n return dataSets;\n}", "function _filterSubjects(state, subjects, frame) {\n // filter subjects in @id order\n var rval = {};\n for(var i = 0; i < subjects.length; ++i) {\n var id = subjects[i];\n var subject = state.subjects[id];\n if(_filterSubject(subject, frame)) {\n rval[id] = subject;\n }\n }\n return rval;\n}", "function getElementIDsToArray(selector) {\n /*\n * param eles: cy.elements\n * return: array of element id strings\n */\n\n var idArray = [];\n try {\n cy.elements(selector).forEach(function (el) {\n var id = el.id();\n var filter = content.filter.toLowerCase();\n var filterIncludes = id.toLowerCase().includes(filter);\n\n if (content.filter == '' || content.filter == 'undefined') {\n idArray.push(id);\n } else {\n if (filterIncludes) {\n idArray.push(id);\n }\n }\n });\n } catch (e) {\n console.error(e);\n }\n return idArray;\n }", "function siswaArr(){\n var y=[];\n $('.siswaTR').each(function(id,item){\n y.push($(this).attr('val'));\n });return y;\n }", "function getScheduleSubjects(responseBody) {\n var subjects = [];\n var doc = getDocumentFromResponseBody(responseBody);\n\n var tables = doc.querySelector(\"div.tabcontents\").getElementsByTagName(\"table\");\n for (var i = 0; i < tables.length; i++) {\n var trs = tables[i].getElementsByTagName(\"tr\");\n var subj = [];\n for (var j = 1; j < trs.length; j++) {\n var tds = trs[j].getElementsByTagName(\"td\");\n for (var k = 0; k < tds.length; k++) {\n subj.push(tds[k].innerText);\n }\n }\n subjects.push(subj);\n }\n return subjects;\n}", "function getArray1(items) {\n return new Array().concat(items);\n}", "function Arr(){ return Literal.apply(this,arguments) }", "function arr(elementsByClassName) {\n result = [];\n for(var i = 0;i<elementsByClassName.length; i++){\n result[i] = elementsByClassName[i];\n }\n return result;\n}", "function coll2array(coll) {\r\n return coll && ('tagName' in coll ? [coll] : (function() {\r\n for (var i=0, len=coll.length, arr=new Array(len); i<len; i++) arr[i]=coll[i];\r\n return arr\r\n })());\r\n}", "function qsa(element, selector) {\n return toArray(element.querySelectorAll(selector));\n}", "function qsa(element, selector) {\n return toArray(element.querySelectorAll(selector));\n}", "function qsa(element, selector) {\n return toArray(element.querySelectorAll(selector));\n}", "static getPossibleSubjects(chunked) {\n let vpStart = chunked.indexOf('[VP');\n if (vpStart === -1) {\n return [];\n }\n let numParenthesis = 0;\n let possibleSubjects = []\n for (let i = vpStart; i < chunked.length; i++) {\n if (chunked[i] === '[') {\n numParenthesis++;\n } else if (chunked[i] === ']') {\n numParenthesis--;\n }\n if (numParenthesis === 0) {\n const vp = chunked.substring(vpStart, i+1);\n possibleSubjects.push(vp.trim());\n vpStart = chunked.substring(i).indexOf('[VP');\n if (vpStart === -1) {\n break;\n }\n vpStart = vpStart + i - 1\n i = vpStart;\n numParenthesis = 0;\n // numClosing = 0\n }\n }\n return possibleSubjects;\n }", "function arr (args) {\n\tvar result = [];\n\tfor (var i=0; i<args.length; i++) {\n\t result.push(args[i]);\n\t}\n\treturn result;\n }", "function x(e){var t=[];for(var n in e){if(e.hasOwnProperty(n)){t.push(e[n])}}return t}", "toArray()\n\t{\n\t\t//TODO: done\n\t\treturn [this.x, this.y, this.z];\n\t}", "function u(a) {\n var rv = [];\n for (var i = 0, l = a.length; i < l; i++) {\n var e = a[i];\n // Is this entry a helper function?\n if (typeof e === 'function') {\n i++;\n e.apply(rv, a[i]);\n } else {\n rv.push(e);\n }\n }\n return rv;\n }", "function u(a) {\n var rv = [];\n for (var i = 0, l = a.length; i < l; i++) {\n var e = a[i];\n // Is this entry a helper function?\n if (typeof e === 'function') {\n i++;\n e.apply(rv, a[i]);\n } else {\n rv.push(e);\n }\n }\n return rv;\n }", "function getAllSubjects() {\n return SubjectCollection.find()\n}", "function $A(iterable)\n{\n\tif (!iterable) return [];\n\tif (iterable.toArray) return iterable.toArray();\n\tvar length = iterable.length, results = new Array(length);\n\twhile (length--)\n\t{\n\t\tresults[length] = iterable[length];\n\t}\n\treturn results;\n}", "function _filterSubjects(state, subjects, frame, flags) {\n // filter subjects in @id order\n const rval = {};\n for (const id of subjects) {\n const subject = state.graphMap[state.graph][id];\n if (_filterSubject(state, subject, frame, flags)) {\n rval[id] = subject;\n }\n }\n return rval;\n}", "function map(subject, callback) {\n var result;\n\n if (callback && !isFunction(callback)) {\n throw new Error('Iterator requires the second argument to be a callback.');\n }\n\n if (isArray(subject)) {\n result = [];\n for (var current, i = 0, l = subject.length; i < l; i++) {\n current = callback.apply(subject[i], [i, subject[i]]);\n if (current !== null || typeof current !== TYPE_UNDEFINED) {\n result.push(current);\n }\n }\n }\n else if (isObject(subject)) {\n result = {};\n for (var current, keys = Object.keys(subject), i = 0, l = keys.length; i < l; i++) {\n current = callback.apply(subject[keys[i]], [keys[i], subject[keys[i]]]);\n if (current !== null || typeof current !== TYPE_UNDEFINED) {\n result[keys[i]] = current;\n }\n }\n }\n else {\n throw new Error('Iterator requires the first argument to be an array or object');\n }\n\n return result;\n }", "function _filterSubjects(state, subjects, frame, flags) {\n // filter subjects in @id order\n const rval = {};\n for(const id of subjects) {\n const subject = state.graphMap[state.graph][id];\n if(_filterSubject(state, subject, frame, flags)) {\n rval[id] = subject;\n }\n }\n return rval;\n}", "getAnswers () {\n\t\tlet ansArray = [];\n\t\tfor (let x of this.answers)\n\t\t\tansArray.push(x.title);\n\n\t\treturn ansArray;\n\t}", "messagesToArray(){\n // for (let value of this.messages.values()){\n // var arr = [];\n // arr.push(value);\n // }\n // return arr;\n // }\n return Array.from(this.messages.values());\n }", "function wrapElements(a) {\n var result = [];\n for (var i = 0, n = a.length; i < n; i++) {\n (function() {\n var j = i;\n results[i] = function() { return a[j]; };\n })();\n }\n return result;\n}", "function u(a) {\n var rv = [];\n for (var i = 0, l = a.length; i < l; i++) {\n var e = a[i];\n // Is this entry a helper function?\n if (typeof e === 'function') {\n i++;\n e.apply(rv, a[i]);\n } else {\n rv.push(e);\n }\n }\n return rv;\n}", "function u(a) {\n var rv = [];\n for (var i = 0, l = a.length; i < l; i++) {\n var e = a[i];\n // Is this entry a helper function?\n if (typeof e === 'function') {\n i++;\n e.apply(rv, a[i]);\n } else {\n rv.push(e);\n }\n }\n return rv;\n}", "listsSubjects(){ \n this.favSubjects.forEach(e=>{\n console.log(e)\n })\n }", "function args(o) { var a = []; for(var i=0, l=o.length; i<l; i++) a.push(o[i]); return a}", "function u$2(a) {\n var rv = [];\n for (var i = 0, l = a.length; i < l; i++) {\n var e = a[i];\n // Is this entry a helper function?\n if (typeof e === 'function') {\n i++;\n e.apply(rv, a[i]);\n } else {\n rv.push(e);\n }\n }\n return rv;\n}", "function wrapElementsI(a){\n var result = [],i,n;\n for(i = 0;i<a.length;i++){\n result[i] = function(){ return a[i];}\n }\n return result;\n}", "function addAllToArray(items,arr){for(var i=0;i<items.length;i++){arr.push(items[i]);}}", "function getNodeList(ary) {\n return ary.map((d) => d['sub'])\n}", "function subject2identifiers(subject) {\n var results = { datapred: \"id=\" + subject['id'],\n dataname: \"id=\" + subject['id'],\n dtype: 'blank'\n };\n\n {\n\t/* TODO: search a prepared list of unique tagnames;\n\t if subject[tagname] is found non-NULL, override defaults and break loop...\n\n\t results.datapred = encodeSafeURIComponent(tagname) + \"=\" + encodeSafeURIComponent(subject[tagname]);\n\t results.dataname = tagname + \"=\" + subject[tagname];\n\t results.dtype = tagname;\n\t */\n\t\t $.each(unique_tags, function(i, tagname) {\n\t\t \tif (subject[tagname] != null) {\n\t\t\t results.datapred = encodeSafeURIComponent(tagname) + \"=\" + encodeSafeURIComponent(subject[tagname]);\n\t\t\t results.dataname = tagname + \"=\" + subject[tagname];\n\t\t\t results.dtype = tagname;\n\t\t\t return false;\n\t\t \t}\n\t\t });\n }\n\n if (subject['url']) {\n\t\tresults.dtype = 'url';\n }\n else if (subject['bytes']) {\n\t\tresults.dtype = 'file';\n }\n\n return results;\n}", "function collectAnimals(...animals) { \n return animals \n}", "function collectAnimals(...animals) {\n return animals;\n}", "toArray() {\n\n }", "function __(elm) { return document.querySelectorAll(elm) }", "function test_arr(s1,s2){\n return [s1,s2];\n}", "function h$listToArray(xs) {\n var a = [], i = 0;\n while(((xs).f === h$ghczmprimZCGHCziTypesziZC_con_e)) {\n a[i++] = ((((xs).d1)).d1);\n xs = ((xs).d2);\n }\n return a;\n}", "function h$listToArray(xs) {\n var a = [], i = 0;\n while(((xs).f === h$ghczmprimZCGHCziTypesziZC_con_e)) {\n a[i++] = ((((xs).d1)).d1);\n xs = ((xs).d2);\n }\n return a;\n}", "function h$listToArray(xs) {\n var a = [], i = 0;\n while(((xs).f === h$ghczmprimZCGHCziTypesziZC_con_e)) {\n a[i++] = ((((xs).d1)).d1);\n xs = ((xs).d2);\n }\n return a;\n}", "function h$listToArray(xs) {\n var a = [], i = 0;\n while(((xs).f === h$ghczmprimZCGHCziTypesziZC_con_e)) {\n a[i++] = ((((xs).d1)).d1);\n xs = ((xs).d2);\n }\n return a;\n}", "function h$listToArray(xs) {\n var a = [], i = 0;\n while(((xs).f === h$ghczmprimZCGHCziTypesziZC_con_e)) {\n a[i++] = ((((xs).d1)).d1);\n xs = ((xs).d2);\n }\n return a;\n}", "function arrayMake(args) {\n return Array.prototype.slice.call(args);\n }", "function u$1(a) {\n var rv = [];\n for (var i = 0, l = a.length; i < l; i++) {\n var e = a[i];\n // Is this entry a helper function?\n if (typeof e === 'function') {\n i++;\n e.apply(rv, a[i]);\n } else {\n rv.push(e);\n }\n }\n return rv;\n}", "function $qsa(el) {\n return document.querySelectorAll(el);\n }", "[Symbol.iterator]() { return this._notes.values() }", "toArray() {\n let arr = [];\n this.map((data) => { arr.push(data); return data});\n return arr;\n }", "_getAllTextElementsForChangingColorScheme() {\n let tagNames = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'label']\n let allItems = [];\n\n for (let tagname of tagNames) {\n allitems = Array.prototype.concat.apply(allitems, x.getElementsByTagName(tagname));\n }\n // allitems = Array.prototype.concat.apply(allitems, x.getElementsByTagName(\"h1\"));\n\n return allItems;\n }", "function theBeatlesPlay (musicians, instruments) { // two array parameters\n let beatles_arr = []; // initialize an empty array\n \n for (let i = 0; i < musicians.length; i++) { // iterate through musicians\n beatles_arr[i] = `${musicians[i]} plays ${instruments[i]}`;\n } // a string with the name of each beatle and their instruments\n \n return beatles_arr; // return the array\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.66539496", "0.661664", "0.65957767", "0.65957767", "0.658102", "0.658102", "0.65661657", "0.65661657", "0.65661657", "0.65661657", "0.65661657", "0.6491883", "0.63846815", "0.61401844", "0.602592", "0.5959882", "0.580902", "0.570216", "0.569725", "0.5681502", "0.56532896", "0.55963004", "0.5574765", "0.5567014", "0.5503885", "0.54937714", "0.54046714", "0.5371382", "0.5371382", "0.5371382", "0.5370318", "0.53680396", "0.53566635", "0.5313356", "0.5313356", "0.5313356", "0.53098863", "0.5302976", "0.5297982", "0.52961886", "0.52958614", "0.5283996", "0.52673", "0.52625555", "0.52625555", "0.52625555", "0.52625555", "0.5250474", "0.5248675", "0.52476805", "0.52446806", "0.52445096", "0.52393776", "0.52381945", "0.52247953", "0.5206362", "0.5199649", "0.5197853", "0.5197853", "0.5197853", "0.5187685", "0.51810294", "0.5169678", "0.5166371", "0.5153816", "0.5153816", "0.5149409", "0.5143888", "0.51229435", "0.51227033", "0.51224625", "0.51145923", "0.5095195", "0.50855714", "0.50772023", "0.50772023", "0.50579774", "0.50534385", "0.50501806", "0.5048702", "0.5042714", "0.5029716", "0.50288564", "0.5022818", "0.5012758", "0.5012391", "0.49897635", "0.49833715", "0.497792", "0.497792", "0.497792", "0.497792", "0.497792", "0.49766618", "0.49760297", "0.49662492", "0.49621624", "0.494893", "0.49486038", "0.4946037", "0.49454558" ]
0.0
-1
accepts multiple subject els only queries direct child elements
function findChildren(parent, selector) { var parents = parent instanceof HTMLElement ? [parent] : parent; var allMatches = []; for (var i = 0; i < parents.length; i++) { var childNodes = parents[i].children; // only ever elements for (var j = 0; j < childNodes.length; j++) { var childNode = childNodes[j]; if (!selector || elementMatches(childNode, selector)) { allMatches.push(childNode); } } } return allMatches; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function __(elm) { return document.querySelectorAll(elm) }", "function qsa(parent, selector){return [].slice.call(parent.querySelectorAll(selector) )}", "function findElements(container, selector) {\n var containers = container instanceof HTMLElement ? [container] : container;\n var allMatches = [];\n\n for (var i = 0; i < containers.length; i++) {\n var matches = containers[i].querySelectorAll(selector);\n\n for (var j = 0; j < matches.length; j++) {\n allMatches.push(matches[j]);\n }\n }\n\n return allMatches;\n } // accepts multiple subject els", "concat(toAttach, filterDoubles = true) {\n let domQueries = this.asArray;\n const ret = new DomQuery(...domQueries.concat(toAttach.asArray));\n // we now filter the doubles out\n if (!filterDoubles) {\n return ret;\n }\n let idx = {}; // ie11 does not support sets, we have to fake it\n return new DomQuery(...ret.asArray.filter(node => {\n const notFound = !(idx === null || idx === void 0 ? void 0 : idx[node.value.value.outerHTML]);\n idx[node.value.value.outerHTML] = true;\n return notFound;\n }));\n }", "concat(toAttach, filterDoubles = true) {\n let domQueries = this.asArray;\n const ret = new DomQuery(...domQueries.concat(toAttach.asArray));\n // we now filter the doubles out\n if (!filterDoubles) {\n return ret;\n }\n let idx = {}; // ie11 does not support sets, we have to fake it\n return new DomQuery(...ret.asArray.filter(node => {\n const notFound = !(idx === null || idx === void 0 ? void 0 : idx[node.value.value.outerHTML]);\n idx[node.value.value.outerHTML] = true;\n return notFound;\n }));\n }", "function _queryAllR3(parentElement, predicate, matches, elementsOnly) {\n var context = loadLContext(parentElement.nativeNode);\n var parentTNode = context.lView[TVIEW].data[context.nodeIndex];\n _queryNodeChildrenR3(parentTNode, context.lView, predicate, matches, elementsOnly, parentElement.nativeNode);\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}", "parentsWhileMatch(selector) {\n const retArr = [];\n let parent = this.parent().filter(item => item.matchesSelector(selector));\n while (parent.isPresent()) {\n retArr.push(parent);\n parent = parent.parent().filter(item => item.matchesSelector(selector));\n }\n return new DomQuery(...retArr);\n }", "parentsWhileMatch(selector) {\n const retArr = [];\n let parent = this.parent().filter(item => item.matchesSelector(selector));\n while (parent.isPresent()) {\n retArr.push(parent);\n parent = parent.parent().filter(item => item.matchesSelector(selector));\n }\n return new DomQuery(...retArr);\n }", "findAll(qs) {\n if (!this.element) return false;\n return Array.from(this.element.querySelectorAll(qs)).map((e) => enrich(e));\n }", "function $qsa(el) {\n return document.querySelectorAll(el);\n }", "function $qsa(el) {\n return document.querySelectorAll(el);\n }", "function iqsa(item, query) {\n return item.querySelectorAll(query);\n}", "allParents(selector) {\n let parent = this.parent();\n let ret = [];\n while (parent.isPresent()) {\n if (parent.matchesSelector(selector)) {\n ret.push(parent);\n }\n parent = parent.parent();\n }\n return new DomQuery(...ret);\n }", "allParents(selector) {\n let parent = this.parent();\n let ret = [];\n while (parent.isPresent()) {\n if (parent.matchesSelector(selector)) {\n ret.push(parent);\n }\n parent = parent.parent();\n }\n return new DomQuery(...ret);\n }", "static getChildren(el, klass) {\n const results = [];\n if (el == null)\n return results;\n for (let node = el.firstElementChild; node != null; node = node === null || node === void 0 ? void 0 : node.nextElementSibling) {\n if (Dom.hasClass(node, klass))\n results.push(node);\n }\n return results;\n }", "function elementChildren(children, predicate = () => true) {\n return react__WEBPACK_IMPORTED_MODULE_0__[\"Children\"].toArray(children).filter(child => /*#__PURE__*/Object(react__WEBPACK_IMPORTED_MODULE_0__[\"isValidElement\"])(child) && predicate(child));\n}", "get childElements() {\n return this.childNodes.filter(isElement);\n }", "queryAll(selector) {\n return res.concat(Array.prototype.slice.call(document.querySelectorAll(selector)))\n }", "function elementChildren(children, predicate) {\n if (predicate === void 0) { predicate = function () { return true; }; }\n return Children.toArray(children).filter(function (child) { return isValidElement(child) && predicate(child); });\n}", "function __( el )\n{\n return document.querySelectorAll( el );\n}", "function qa(s) {return document.querySelectorAll(s)}", "function _queryNodeChildrenInContainer(lContainer, predicate, matches, elementsOnly, rootNativeNode) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const childView = lContainer[i];\n const firstChild = childView[TVIEW].firstChild;\n if (firstChild) {\n _queryNodeChildren(firstChild, childView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n}", "function query(element, elementQuery) {\n if (!element.content) {\n return [];\n }\n\n if (!lodash.isArray(element.content)) {\n return [];\n }\n\n const results = lodash.where(element.content, elementQuery);\n\n return lodash\n .chain(element.content)\n .map((nestedElement) => {\n return query(nestedElement, elementQuery);\n })\n .flatten()\n .concat(results)\n .value();\n}", "getAllChildren() {\n const children = this.jq.wrapper.find(this.jq.child)\n return children\n }", "function usingQuerySelectorAll() {\n var nestedDivs = document.querySelectorAll('div > div');\n printInElement('Using query selection: ' + nestedDivs.length, true);\n}", "next (selector = '*') {\n let result = new Set()\n\n for (let item of this) {\n let nextNode = getNextNodeSibling(this[GET_NODE_PARENT](item), item)\n\n if (nextNode) {\n result.add(nextNode)\n }\n }\n\n let $elements = new this.constructor([...result])\n\n return $elements.filter(selector)\n }", "function SelectDescendants(arg0, arg1)\n{\n\treturn 10;\n}", "function elementChildren(children, predicate) {\n if (predicate === void 0) {\n predicate = function () {\n return true;\n };\n }\n\n return Children.toArray(children).filter(function (child) {\n return isValidElement(child) && predicate(child);\n });\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 _queryNodeChildrenInContainerR3(lContainer, predicate, matches, elementsOnly, rootNativeNode) {\n for (var i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n var childView = lContainer[i];\n var firstChild = childView[TVIEW].firstChild;\n\n if (firstChild) {\n _queryNodeChildrenR3(firstChild, childView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n }", "getChildNodeIterator() {}", "function getElements(ids, isParent) {\n var elems = [];\n if (\n Array.isArray(ids) &&\n ids[0] != \"CONTAINER\" &&\n ids[0] != \"WINDOW\" &&\n ids[0] != \"DOCUMENT\" &&\n ids[0] != \"BODY\" &&\n ids[0] != \"QUERYSELECTOR\"\n ) {\n for (var i = 0; i < ids.length; i++)\n elems.push(getElement(ids[i], isParent));\n } else {\n elems.push(getElement(ids, isParent));\n }\n return elems;\n }", "function getElements(ids, isParent) {\n var elems = [];\n if (\n Array.isArray(ids) &&\n ids[0] != \"CONTAINER\" &&\n ids[0] != \"WINDOW\" &&\n ids[0] != \"DOCUMENT\" &&\n ids[0] != \"BODY\" &&\n ids[0] != \"QUERYSELECTOR\"\n ) {\n for (var i = 0; i < ids.length; i++)\n elems.push(getElement(ids[i], isParent));\n } else {\n elems.push(getElement(ids, isParent));\n }\n return elems;\n }", "function findChildren(parent, selector) {\n var parents = parent instanceof HTMLElement ? [parent] : parent;\n var allMatches = [];\n\n for (var i = 0; i < parents.length; i++) {\n var childNodes = parents[i].children; // only ever elements\n\n for (var j = 0; j < childNodes.length; j++) {\n var childNode = childNodes[j];\n\n if (!selector || elementMatches(childNode, selector)) {\n allMatches.push(childNode);\n }\n }\n }\n\n return allMatches;\n } // Attributes", "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 qsa(query) {\n return document.querySelectorAll(query);\n }", "function getNodeList(ary) {\n return ary.map((d) => d['sub'])\n}", "byTagName(tagName, includeRoot, deep) {\n var _a;\n let res = [];\n if (includeRoot) {\n res = new Es2019Array(...((_a = this === null || this === void 0 ? void 0 : this.rootNode) !== null && _a !== void 0 ? _a : []))\n .filter(element => (element === null || element === void 0 ? void 0 : element.tagName) == tagName)\n .reduce((reduction, item) => reduction.concat([item]), res);\n }\n (deep) ? res.push(this.querySelectorAllDeep(tagName)) : res.push(this.querySelectorAll(tagName));\n return new DomQuery(...res);\n }", "function _queryNodeChildrenInContainerR3(lContainer, predicate, matches, elementsOnly, rootNativeNode) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const childView = lContainer[i];\n const firstChild = childView[TVIEW].firstChild;\n if (firstChild) {\n _queryNodeChildrenR3(firstChild, childView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n}", "function _queryNodeChildrenInContainerR3(lContainer, predicate, matches, elementsOnly, rootNativeNode) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const childView = lContainer[i];\n const firstChild = childView[TVIEW].firstChild;\n if (firstChild) {\n _queryNodeChildrenR3(firstChild, childView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n}", "function _queryNodeChildrenInContainerR3(lContainer, predicate, matches, elementsOnly, rootNativeNode) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const childView = lContainer[i];\n const firstChild = childView[TVIEW].firstChild;\n if (firstChild) {\n _queryNodeChildrenR3(firstChild, childView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n}", "function _queryNodeChildrenInContainerR3(lContainer, predicate, matches, elementsOnly, rootNativeNode) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const childView = lContainer[i];\n const firstChild = childView[TVIEW].firstChild;\n if (firstChild) {\n _queryNodeChildrenR3(firstChild, childView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n}", "function _queryNodeChildrenInContainerR3(lContainer, predicate, matches, elementsOnly, rootNativeNode) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const childView = lContainer[i];\n const firstChild = childView[TVIEW].firstChild;\n if (firstChild) {\n _queryNodeChildrenR3(firstChild, childView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\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 _queryNodeChildrenInContainerR3(lContainer, predicate, matches, elementsOnly, rootNativeNode) {\n for (var i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n var childView = lContainer[i];\n var firstChild = childView[TVIEW].firstChild;\n\n if (firstChild) {\n _queryNodeChildrenR3(firstChild, childView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n}", "function selector(el, multi) {\n try {\n var requestedElem;\n var itemsArray;\n if (multi) {\n itemsArray = el instanceof Array && el.every(function (x) { return x instanceof Element; });\n requestedElem = el instanceof HTMLCollection || el instanceof NodeList || itemsArray\n ? el : document.querySelectorAll(el);\n } else {\n requestedElem = el instanceof Element || el === window // scroll\n ? el : document.querySelector(el);\n }\n return requestedElem;\n } catch (e) {\n throw TypeError((\"KUTE.js - Element(s) not found: \" + el + \".\"));\n }\n }", "byTagName(tagName, includeRoot, deep) {\n var _a;\n let res = [];\n if (includeRoot) {\n res = new Es2019Array_1.Es2019Array(...((_a = this === null || this === void 0 ? void 0 : this.rootNode) !== null && _a !== void 0 ? _a : []))\n .filter(element => (element === null || element === void 0 ? void 0 : element.tagName) == tagName)\n .reduce((reduction, item) => reduction.concat([item]), res);\n }\n (deep) ? res.push(this.querySelectorAllDeep(tagName)) : res.push(this.querySelectorAll(tagName));\n return new DomQuery(...res);\n }", "function qsa(selector) {\n return document.querySelectorAll(selector);\n}", "function findElements(container, selector) {\n var containers = container instanceof HTMLElement ? [container] : container;\n var allMatches = [];\n\n for (var i = 0; i < containers.length; i++) {\n var matches = containers[i].querySelectorAll(selector);\n\n for (var j = 0; j < matches.length; j++) {\n allMatches.push(matches[j]);\n }\n }\n\n return allMatches;\n }", "get items() {\n if (!this.target) {\n return [];\n }\n var nodes = this.target !== this ? (this.itemsSelector ? \n this.target.querySelectorAll(this.itemsSelector) : \n this.target.children) : this.$.items.getDistributedNodes();\n return Array.prototype.filter.call(nodes, this.itemFilter);\n }", "constructor(mixed, parentNode) {\n if (mixed instanceof HTMLElement) this.elements = [mixed];\n else if (parentNode !== undefined) this.elements = parentNode.querySelectorAll(selector);\n else this.elements = document.querySelectorAll(mixed);\n this.length = this.elements.length;\n }", "function queryFromAll(el, allResults) {\n if (!el) {\n return allResults;\n }\n if (el.assignedSlot) {\n el = el.assignedSlot;\n }\n const rootNode = getRootNode(el);\n const results = Array.from(rootNode.querySelectorAll(selector));\n const uniqueResults = results.filter((result) => !allResults.includes(result));\n allResults = [...allResults, ...uniqueResults];\n const host = getHost(rootNode);\n return host ? queryFromAll(host, allResults) : allResults;\n }", "function findDirectChildren(parent, selector) {\n var parents = parent instanceof HTMLElement ? [parent] : parent;\n var allMatches = [];\n for (var i = 0; i < parents.length; i += 1) {\n var childNodes = parents[i].children; // only ever elements\n for (var j = 0; j < childNodes.length; j += 1) {\n var childNode = childNodes[j];\n if (!selector || elementMatches(childNode, selector)) {\n allMatches.push(childNode);\n }\n }\n }\n return allMatches;\n }", "function getAnchorChildren(){\n let kids = document.querySelectorAll('a > span')\n for (let kid of kids){\n console.log(kid.innerText)\n }\n}", "function getChildren(el) {\n\n }", "function getElements(ids, isParent) {\n var elems = [];\n if (Array.isArray(ids) && ids[0] != 'CONTAINER' && ids[0] != 'WINDOW' &&\n ids[0] != 'DOCUMENT' && ids[0] != 'BODY' && ids[0] != 'QUERYSELECTOR') {\n for (var i = 0; i < ids.length; i++)\n elems.push(getElement(ids[i], isParent));\n } else {\n elems.push(getElement(ids, isParent));\n }\n return elems;\n}", "function qsa(selector) {\n\t\treturn document.querySelectorAll(selector);\n\t}", "function queryElements(elem, selector) {\n try {\n return Array.prototype.slice.call(elem.querySelectorAll(selector), 0);\n } catch(e) {\n return [];\n }\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 }", "all(el, callback) {\n el = this.s(el);\n el.forEach((data) => {\n callback(this.toNodeList(data));\n });\n }", "get childNodes()\n\t{\n\t\tvar result = [];\n\n\t\tif (this.distLists.length > 0) {\n\t\t\tfor each(var distList in this.distLists) {\n\t\t\t\tresult.push(distList);\n\t\t\t}\n\t\t}\n\t\treturn exchWebService.commonFunctions.CreateSimpleEnumerator(result);\n\t}", "function findElements(container, selector) {\n var containers = container instanceof HTMLElement ? [container] : container;\n var allMatches = [];\n for (var i = 0; i < containers.length; i += 1) {\n var matches = containers[i].querySelectorAll(selector);\n for (var j = 0; j < matches.length; j += 1) {\n allMatches.push(matches[j]);\n }\n }\n return allMatches;\n }", "function getAnchorChildren() {\r\n let span = document.querySelectorAll(\"a span\");\r\n for (let s of span) console.log(s.innerHTML);\r\n}", "function findElements(container, selector) {\n var containers = container instanceof HTMLElement ? [container] : container;\n var allMatches = [];\n for (var i = 0; i < containers.length; i++) {\n var matches = containers[i].querySelectorAll(selector);\n for (var j = 0; j < matches.length; j++) {\n allMatches.push(matches[j]);\n }\n }\n return allMatches;\n }", "function findElements(container, selector) {\n var containers = container instanceof HTMLElement ? [container] : container;\n var allMatches = [];\n for (var i = 0; i < containers.length; i++) {\n var matches = containers[i].querySelectorAll(selector);\n for (var j = 0; j < matches.length; j++) {\n allMatches.push(matches[j]);\n }\n }\n return allMatches;\n }", "function findElements(container, selector) {\n var containers = container instanceof HTMLElement ? [container] : container;\n var allMatches = [];\n for (var i = 0; i < containers.length; i++) {\n var matches = containers[i].querySelectorAll(selector);\n for (var j = 0; j < matches.length; j++) {\n allMatches.push(matches[j]);\n }\n }\n return allMatches;\n }", "function _queryNodeChildrenInContainerR3(lContainer, predicate, matches, elementsOnly, rootNativeNode) {\n for (var i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n var childView = lContainer[i];\n _queryNodeChildrenR3(childView[TVIEW].node, childView, predicate, matches, elementsOnly, rootNativeNode);\n }\n}", "function qAll (selector) {\n return document.querySelectorAll(selector)\n}", "parent (selector = '*') {\n let result = new Set()\n let selectorData = cssParser(selector)\n\n for (let item of this) {\n let parent = item.parent\n\n if (!parent || !selectorData) {\n continue\n }\n\n if (cssMatch(parent, selectorData[0])) {\n result.add(parent)\n }\n }\n\n let $elements = new this.constructor([...result])\n\n return $elements\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 }", "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 }", "get items() {\n return [...this._el.querySelectorAll(`${this._itemSelector}`)];\n }", "GetComponentsInChildren() {}", "GetComponentsInChildren() {}", "GetComponentsInChildren() {}", "GetComponentsInChildren() {}", "function _queryNativeNodeDescendants(parentNode, predicate, matches, elementsOnly) {\n const nodes = parentNode.childNodes;\n const length = nodes.length;\n for (let i = 0; i < length; i++) {\n const node = nodes[i];\n const debugNode = getDebugNode(node);\n if (debugNode) {\n if (elementsOnly && (debugNode instanceof DebugElement) && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n else if (!elementsOnly && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n _queryNativeNodeDescendants(node, predicate, matches, elementsOnly);\n }\n }\n}", "function matchedItems(elem, selector) {\n let items = elem.find(selector).not(noinitExcludes);\n if (elem.filter(selector).length) {\n items = items.add(elem);\n }\n return items;\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 subjectXMLTree(subject, stats) {\n var results = [];\n var type, t, st, pred;\n var sts = stats.subjects[this.toStr(subject)]; // relevant statements\n if (typeof sts == 'undefined') {\n throw('Serializing XML - Cant find statements for '+subject);\n }\n\n\n // Sort only on the predicate, leave the order at object\n // level undisturbed. This leaves multilingual content in\n // the order of entry (for partner literals), which helps\n // readability.\n //\n // For the predicate sort, we attempt to split the uri\n // as a hint to the sequence\n sts.sort(function(a,b) {\n var ap = a.predicate.uri;\n var bp = b.predicate.uri;\n if(ap.substring(0,liPrefix.length) == liPrefix || bp.substring(0,liPrefix.length) == liPrefix) {\t//we're only interested in sorting list items\n return ap.localeCompare(bp);\n }\n\n var as = ap.substring(liPrefix.length);\n var bs = bp.substring(liPrefix.length);\n var an = parseInt(as);\n var bn = parseInt(bs);\n if(isNaN(an) || isNaN(bn) ||\n an != as || bn != bs) {\t//we only care about integers\n return ap.localeCompare(bp);\n }\n\n return an - bn;\n });\n\n\n for (var i=0; i<sts.length; i++) {\n st = sts[i];\n // look for a type\n if(st.predicate.uri == 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type' && !type && st.object.termType == \"symbol\") {\n type = st.object;\n continue;\t//don't include it as a child element\n }\n\n // see whether predicate can be replaced with \"li\"\n pred = st.predicate;\n if(pred.uri.substr(0, liPrefix.length) == liPrefix) {\n var number = pred.uri.substr(liPrefix.length);\n // make sure these are actually numeric list items\n var intNumber = parseInt(number);\n if(number == intNumber.toString()) {\n // was numeric; don't need to worry about ordering since we've already\n // sorted the statements\n pred = new $rdf.NamedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#li');\n }\n }\n\n t = qname(pred);\n switch (st.object.termType) {\n case 'bnode':\n if(stats.incoming[st.object].length == 1) {\t//there should always be something in the incoming array for a bnode\n results = results.concat(['<'+ t +'>',\n subjectXMLTree(st.object, stats),\n '</'+ t +'>']);\n } else {\n results = results.concat(['<'+ t +' rdf:nodeID=\"'\n +st.object.toNT().slice(2)+'\"/>']);\n }\n break;\n case 'symbol':\n results = results.concat(['<'+ t +' rdf:resource=\"'\n + relURI(st.object)+'\"/>']);\n break;\n case 'literal':\n results = results.concat(['<'+ t\n + (st.object.datatype ? ' rdf:datatype=\"'+escapeForXML(st.object.datatype.uri)+'\"' : '')\n + (st.object.lang ? ' xml:lang=\"'+st.object.lang+'\"' : '')\n + '>' + escapeForXML(st.object.value)\n + '</'+ t +'>']);\n break;\n case 'collection':\n results = results.concat(['<'+ t +' rdf:parseType=\"Collection\">',\n collectionXMLTree(st.object, stats),\n '</'+ t +'>']);\n break;\n default:\n throw \"Can't serialize object of type \"+st.object.termType +\" into XML\";\n } // switch\n }\n\n var tag = type ? qname(type) : 'rdf:Description';\n\n var attrs = '';\n if (subject.termType == 'bnode') {\n if(!stats.incoming[subject] || stats.incoming[subject].length != 1) { // not an anonymous bnode\n attrs = ' rdf:nodeID=\"'+subject.toNT().slice(2)+'\"';\n }\n } else {\n attrs = ' rdf:about=\"'+ relURI(subject)+'\"';\n }\n\n return [ '<' + tag + attrs + '>' ].concat([results]).concat([\"</\"+ tag +\">\"]);\n }", "querySelectorAll(selectors) {\n const vm = getAssociatedVM(this);\n\n {\n assert.isFalse(isBeingConstructed(vm), `this.querySelectorAll() cannot be called during the construction of the custom element for ${getComponentTag(vm)} because no children has been added to this element yet.`);\n }\n\n const {\n elm\n } = vm;\n return elm.querySelectorAll(selectors);\n }", "function propertyXMLTree(subject, stats) {\n var results = []\n var sts = stats.subjects[this.toStr(subject)]; // relevant statements\n if (sts == undefined) return results; // No relevant statements\n sts.sort();\n for (var i=0; i<sts.length; i++) {\n var st = sts[i];\n switch (st.object.termType) {\n case 'bnode':\n if(stats.rootsHash[st.object.toNT()]) { // This bnode has been done as a root -- no content here @@ what bout first time\n results = results.concat(['<'+qname(st.predicate)+' rdf:nodeID=\"'+st.object.toNT().slice(2)+'\">',\n '</'+qname(st.predicate)+'>']);\n } else {\n results = results.concat(['<'+qname(st.predicate)+' rdf:parseType=\"Resource\">',\n propertyXMLTree(st.object, stats),\n '</'+qname(st.predicate)+'>']);\n }\n break;\n case 'symbol':\n results = results.concat(['<'+qname(st.predicate)+' rdf:resource=\"'\n + relURI(st.object)+'\"/>']);\n break;\n case 'literal':\n results = results.concat(['<'+qname(st.predicate)\n + (st.object.datatype ? ' rdf:datatype=\"'+escapeForXML(st.object.datatype.uri)+'\"' : '')\n + (st.object.lang ? ' xml:lang=\"'+st.object.lang+'\"' : '')\n + '>' + escapeForXML(st.object.value)\n + '</'+qname(st.predicate)+'>']);\n break;\n case 'collection':\n results = results.concat(['<'+qname(st.predicate)+' rdf:parseType=\"Collection\">',\n collectionXMLTree(st.object, stats),\n '</'+qname(st.predicate)+'>']);\n break;\n default:\n throw \"Can't serialize object of type \"+st.object.termType +\" into XML\";\n\n } // switch\n }\n return results;\n }", "function getAllChildren(e) {\n\t // Returns all children of element. Workaround required for IE5/Windows. Ugh.\n\t return e.all ? e.all : e.getElementsByTagName('*');\n\t }", "function getAnchorChildren(){\n let anchortag = document.querySelectorAll('a');\n for (let i = 0; i < anchortag.length; i++) {\n if(anchortag[i].getElementsByTagName('span').length == 1){\n console.log(anchortag[i].getElementsByTagName('span')[0].innerHTML)\n }\n }\n}", "function qsa(element, selector) {\n return toArray(element.querySelectorAll(selector));\n}", "function qsa(element, selector) {\n return toArray(element.querySelectorAll(selector));\n}", "function qsa(element, selector) {\n return toArray(element.querySelectorAll(selector));\n}", "function findElements(container, selector) {\n var containers = container instanceof HTMLElement ? [container] : container;\n var allMatches = [];\n for (var i = 0; i < containers.length; i++) {\n var matches = containers[i].querySelectorAll(selector);\n for (var j = 0; j < matches.length; j++) {\n allMatches.push(matches[j]);\n }\n }\n return allMatches;\n}", "findChildren(selector) {\n return $(this.getMountPoint()).find(selector);\n }", "function _queryNativeNodeDescendants(parentNode, predicate, matches, elementsOnly) {\n var nodes = parentNode.childNodes;\n var length = nodes.length;\n\n for (var i = 0; i < length; i++) {\n var node = nodes[i];\n var debugNode = getDebugNode$1(node);\n\n if (debugNode) {\n if (elementsOnly && debugNode instanceof DebugElement__POST_R3__ && predicate(debugNode) && matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n } else if (!elementsOnly && predicate(debugNode) && matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n\n _queryNativeNodeDescendants(node, predicate, matches, elementsOnly);\n }\n }\n }", "function getChildren(x) {\n if (!x) return false;\n var item = !!x.element;\n var children = $(x.element || x).find('ul:first>li');\n if (x instanceof $) return children; \n var res = [];\n children.each(function(idx,el){\n res.push(item ? asItem(el) : el); \n });\n return res;\n}", "function getAllChildren(e) {\r\n\t // Returns all children of element. Workaround required for IE5/Windows. Ugh.\r\n\t return e.all ? e.all : e.getElementsByTagName('*');\r\n\t}", "getChildren () {\n const doc = this.getDocument()\n const id = this.id\n const schema = this.getSchema()\n let result = []\n for (let p of schema) {\n const name = p.name\n if (p.isText()) {\n let annos = doc.getAnnotations([id, name])\n forEach(annos, a => result.push(a))\n } else if (p.isReference() && p.isOwned()) {\n let val = this[name]\n if (val) {\n if (p.isArray()) {\n result = result.concat(val.map(id => doc.get(id)))\n } else {\n result.push(doc.get(val))\n }\n }\n }\n }\n return result\n }", "function descendantDfs(nodeMultiSet, node, remaining, matcher, andSelf, attrIndices, attrNodes) {\n while (0 < remaining.length && null != remaining[0].ownerElement) {\n var attr = remaining.shift();\n if (andSelf && matcher.matches(attr)) {\n attrNodes.push(attr);\n attrIndices.push(nodeMultiSet.nodes.length);\n }\n }\n if (null != node && !andSelf) {\n if (matcher.matches(node))\n nodeMultiSet.addNode(node);\n }\n var pushed = false;\n if (null == node) {\n if (0 === remaining.length) return;\n node = remaining.shift();\n nodeMultiSet.pushSeries();\n pushed = true;\n } else if (0 < remaining.length && node === remaining[0]) {\n nodeMultiSet.pushSeries();\n pushed = true;\n remaining.shift();\n }\n if (andSelf) {\n if (matcher.matches(node))\n nodeMultiSet.addNode(node);\n }\n // TODO: use optimization. Also try element.getElementsByTagName\n // var nodeList = 1 === nodeTypeNum && null != node.children ? node.children : node.childNodes;\n var nodeList = node.childNodes;\n for (var j = 0; j < nodeList.length; ++j) {\n var child = nodeList[j];\n descendantDfs(nodeMultiSet, child, remaining, matcher, andSelf, attrIndices, attrNodes);\n }\n if (pushed) {\n nodeMultiSet.popSeries();\n }\n }", "function descendantDfs(nodeMultiSet, node, remaining, matcher, andSelf, attrIndices, attrNodes) {\n while (0 < remaining.length && null != remaining[0].ownerElement) {\n var attr = remaining.shift();\n if (andSelf && matcher.matches(attr)) {\n attrNodes.push(attr);\n attrIndices.push(nodeMultiSet.nodes.length);\n }\n }\n if (null != node && !andSelf) {\n if (matcher.matches(node))\n nodeMultiSet.addNode(node);\n }\n var pushed = false;\n if (null == node) {\n if (0 === remaining.length) return;\n node = remaining.shift();\n nodeMultiSet.pushSeries();\n pushed = true;\n } else if (0 < remaining.length && node === remaining[0]) {\n nodeMultiSet.pushSeries();\n pushed = true;\n remaining.shift();\n }\n if (andSelf) {\n if (matcher.matches(node))\n nodeMultiSet.addNode(node);\n }\n // TODO: use optimization. Also try element.getElementsByTagName\n // var nodeList = 1 === nodeTypeNum && null != node.children ? node.children : node.childNodes;\n var nodeList = node.childNodes;\n for (var j = 0; j < nodeList.length; ++j) {\n var child = nodeList[j];\n descendantDfs(nodeMultiSet, child, remaining, matcher, andSelf, attrIndices, attrNodes);\n }\n if (pushed) {\n nodeMultiSet.popSeries();\n }\n }", "function findChildren(parent, selector) {\n var parents = parent instanceof HTMLElement ? [parent] : parent;\n var allMatches = [];\n\n for (var i = 0; i < parents.length; i++) {\n var childNodes = parents[i].children; // only ever elements\n\n for (var j = 0; j < childNodes.length; j++) {\n var childNode = childNodes[j];\n\n if (!selector || elementMatches(childNode, selector)) {\n allMatches.push(childNode);\n }\n }\n }\n\n return allMatches;\n }", "function query( elem, selector ) {\n // append to fragment if no parent\n if ( !elem.parentNode ) {\n appendToFragment( elem );\n }\n\n // match elem with all selected elems of parent\n var elems = elem.parentNode.querySelectorAll( selector );\n for ( var j=0, jLen = elems.length; j < jLen; j++ ) {\n // return true if match\n if ( elems[j] === elem ) {\n return true;\n }\n }\n // otherwise return false\n return false;\n }", "getQuads(subject, predicate, object, graph) {\n return [...this.readQuads(subject, predicate, object, graph)];\n }", "function propertyXMLTree(subject, stats) {\r\n\t\t\tvar results = [];\r\n\t\t\tvar sts = stats.subjects[sz.toStr(subject)]; // relevant\r\n\t\t\t// statements\r\n\t\t\tif (sts == undefined)\r\n\t\t\t\treturn results; // No relevant statements\r\n\t\t\tsts.sort();\r\n\t\t\tfor ( var i = 0; i < sts.length; i++) {\r\n\t\t\t\tvar st = sts[i];\r\n\t\t\t\tswitch (st.object.termType) {\r\n\t\t\t\tcase 'bnode':\r\n\t\t\t\t\tif (stats.rootsHash[st.object.toNT()]) { // This bnode\r\n\t\t\t\t\t\t// has been done\r\n\t\t\t\t\t\t// as a root --\r\n\t\t\t\t\t\t// no content\r\n\t\t\t\t\t\t// here @@ what\r\n\t\t\t\t\t\t// bout first\r\n\t\t\t\t\t\t// time\r\n\t\t\t\t\t\tresults = results.concat([\r\n\t\t\t\t\t\t\t\t'<' + qname(st.predicate) + ' rdf:nodeID=\"'\r\n\t\t\t\t\t\t\t\t\t\t+ st.object.toNT().slice(2) + '\">',\r\n\t\t\t\t\t\t\t\t'</' + qname(st.predicate) + '>' ]);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tresults = results.concat([\r\n\t\t\t\t\t\t\t\t'<' + qname(st.predicate)\r\n\t\t\t\t\t\t\t\t\t\t+ ' rdf:parseType=\"Resource\">',\r\n\t\t\t\t\t\t\t\tpropertyXMLTree(st.object, stats),\r\n\t\t\t\t\t\t\t\t'</' + qname(st.predicate) + '>' ]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'symbol':\r\n\t\t\t\t\tresults = results.concat([ '<' + qname(st.predicate)\r\n\t\t\t\t\t\t\t+ ' rdf:resource=\"' + relURI(st.object) + '\"/>' ]);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'literal':\r\n\t\t\t\t\tresults = results.concat([ '<'\r\n\t\t\t\t\t\t\t+ qname(st.predicate)\r\n\t\t\t\t\t\t\t+ (st.object.datatype ? ' rdf:datatype=\"'\r\n\t\t\t\t\t\t\t\t\t+ escapeForXML(st.object.datatype.uri)\r\n\t\t\t\t\t\t\t\t\t+ '\"' : '')\r\n\t\t\t\t\t\t\t+ (st.object.lang ? ' xml:lang=\"' + st.object.lang\r\n\t\t\t\t\t\t\t\t\t+ '\"' : '') + '>'\r\n\t\t\t\t\t\t\t+ escapeForXML(st.object.value) + '</'\r\n\t\t\t\t\t\t\t+ qname(st.predicate) + '>' ]);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'collection':\r\n\t\t\t\t\tresults = results.concat([\r\n\t\t\t\t\t\t\t'<' + qname(st.predicate)\r\n\t\t\t\t\t\t\t\t\t+ ' rdf:parseType=\"Collection\">',\r\n\t\t\t\t\t\t\tcollectionXMLTree(st.object, stats),\r\n\t\t\t\t\t\t\t'</' + qname(st.predicate) + '>' ]);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthrow \"Can't serialize object of type \"\r\n\t\t\t\t\t\t\t+ st.object.termType + \" into XML\";\r\n\r\n\t\t\t\t} // switch\r\n\t\t\t}\r\n\t\t\treturn results;\r\n\t\t}" ]
[ "0.60676503", "0.59663564", "0.5962775", "0.57596546", "0.57596546", "0.57036203", "0.56000346", "0.5528174", "0.5528174", "0.5519154", "0.54946864", "0.54843074", "0.5441801", "0.5434945", "0.5434945", "0.543411", "0.5377221", "0.5373684", "0.53438085", "0.5337317", "0.5327149", "0.53210914", "0.53130716", "0.529857", "0.5261023", "0.5244792", "0.5226004", "0.5217494", "0.52033204", "0.5200792", "0.5198712", "0.51907074", "0.51831406", "0.51831406", "0.51784444", "0.51709706", "0.51550287", "0.51376355", "0.51183015", "0.51106375", "0.51106375", "0.51106375", "0.51106375", "0.51106375", "0.50980365", "0.5092119", "0.5090423", "0.506532", "0.5061483", "0.50596356", "0.5040035", "0.5031671", "0.5030022", "0.4998283", "0.4998131", "0.49939018", "0.49902079", "0.49867776", "0.49728134", "0.49685764", "0.49610007", "0.4955795", "0.49486715", "0.49444515", "0.4939381", "0.4939381", "0.4939381", "0.4933275", "0.49232566", "0.49184874", "0.4914179", "0.4914179", "0.49128592", "0.49074018", "0.48964173", "0.48964173", "0.48964173", "0.48964173", "0.48894963", "0.48862582", "0.48862273", "0.48846275", "0.48821157", "0.48802447", "0.4879586", "0.48771736", "0.48754677", "0.48754677", "0.48754677", "0.4867609", "0.48631716", "0.48604345", "0.4857988", "0.48568216", "0.4855069", "0.4853657", "0.4853657", "0.4852592", "0.48476505", "0.48444983", "0.48360357" ]
0.0
-1
Returns a new rectangle that is the intersection of the two rectangles. If they don't intersect, returns false
function intersectRects(rect1, rect2) { var res = { left: Math.max(rect1.left, rect2.left), right: Math.min(rect1.right, rect2.right), top: Math.max(rect1.top, rect2.top), bottom: Math.min(rect1.bottom, rect2.bottom) }; if (res.left < res.right && res.top < res.bottom) { return res; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function intersectRects(rect1,rect2){var res={left:Math.max(rect1.left,rect2.left),right:Math.min(rect1.right,rect2.right),top:Math.max(rect1.top,rect2.top),bottom:Math.min(rect1.bottom,rect2.bottom)};if(res.left<res.right&&res.top<res.bottom){return res;}return false;}", "function intersect(rectangle1, rectangle2) {\n let x1 = Math.max(rectangle1.x, rectangle2.x);\n let y1 = Math.max(rectangle1.y, rectangle2.y);\n let x2 = Math.min(rectangle1.x + rectangle1.width, rectangle2.x + rectangle2.width);\n let y2 = Math.min(rectangle1.y + rectangle1.height, rectangle2.y + rectangle2.height);\n if (x2 >= x1 && y2 >= y1)\n return { x: x1, y: y1, width: x2 - x1, height: y2 - y1 };\n else\n return { x: 0, y: 0, width: 0, height: 0 };\n}", "function intersectRects(rect1, rect2) {\n var res = {\n left: Math.max(rect1.left, rect2.left),\n right: Math.min(rect1.right, rect2.right),\n top: Math.max(rect1.top, rect2.top),\n bottom: Math.min(rect1.bottom, rect2.bottom)\n };\n\n if (res.left < res.right && res.top < res.bottom) {\n return res;\n }\n\n return false;\n }", "function intersectRects(rect1, rect2) {\n var res = {\n left: Math.max(rect1.left, rect2.left),\n right: Math.min(rect1.right, rect2.right),\n top: Math.max(rect1.top, rect2.top),\n bottom: Math.min(rect1.bottom, rect2.bottom)\n };\n if (res.left < res.right && res.top < res.bottom) {\n return res;\n }\n return false;\n}", "function intersectRects(rect1, rect2) {\n var res = {\n left: Math.max(rect1.left, rect2.left),\n right: Math.min(rect1.right, rect2.right),\n top: Math.max(rect1.top, rect2.top),\n bottom: Math.min(rect1.bottom, rect2.bottom)\n };\n if (res.left < res.right && res.top < res.bottom) {\n return res;\n }\n return false;\n}", "function intersectRects(rect1, rect2) {\n var res = {\n left: Math.max(rect1.left, rect2.left),\n right: Math.min(rect1.right, rect2.right),\n top: Math.max(rect1.top, rect2.top),\n bottom: Math.min(rect1.bottom, rect2.bottom)\n };\n if (res.left < res.right && res.top < res.bottom) {\n return res;\n }\n return false;\n}", "function intersectRects(rect1, rect2) {\n var res = {\n left: Math.max(rect1.left, rect2.left),\n right: Math.min(rect1.right, rect2.right),\n top: Math.max(rect1.top, rect2.top),\n bottom: Math.min(rect1.bottom, rect2.bottom)\n };\n if (res.left < res.right && res.top < res.bottom) {\n return res;\n }\n return false;\n}", "function intersectRects(rect1, rect2) {\n var res = {\n left: Math.max(rect1.left, rect2.left),\n right: Math.min(rect1.right, rect2.right),\n top: Math.max(rect1.top, rect2.top),\n bottom: Math.min(rect1.bottom, rect2.bottom)\n };\n if (res.left < res.right && res.top < res.bottom) {\n return res;\n }\n return false;\n}", "function intersectRects(rect1, rect2) {\n var res = {\n left: Math.max(rect1.left, rect2.left),\n right: Math.min(rect1.right, rect2.right),\n top: Math.max(rect1.top, rect2.top),\n bottom: Math.min(rect1.bottom, rect2.bottom),\n };\n if (res.left < res.right && res.top < res.bottom) {\n return res;\n }\n return false;\n }", "function intersectRects(rect1, rect2) {\n var res = {\n left: Math.max(rect1.left, rect2.left),\n right: Math.min(rect1.right, rect2.right),\n top: Math.max(rect1.top, rect2.top),\n bottom: Math.min(rect1.bottom, rect2.bottom)\n };\n\n if (res.left < res.right && res.top < res.bottom) {\n return res;\n }\n return false;\n }", "function intersectRects(rect1, rect2) {\n\tvar res = {\n\t\tleft: Math.max(rect1.left, rect2.left),\n\t\tright: Math.min(rect1.right, rect2.right),\n\t\ttop: Math.max(rect1.top, rect2.top),\n\t\tbottom: Math.min(rect1.bottom, rect2.bottom)\n\t};\n\n\tif (res.left < res.right && res.top < res.bottom) {\n\t\treturn res;\n\t}\n\treturn false;\n}", "function intersectRects(rect1, rect2) {\n\tvar res = {\n\t\tleft: Math.max(rect1.left, rect2.left),\n\t\tright: Math.min(rect1.right, rect2.right),\n\t\ttop: Math.max(rect1.top, rect2.top),\n\t\tbottom: Math.min(rect1.bottom, rect2.bottom)\n\t};\n\n\tif (res.left < res.right && res.top < res.bottom) {\n\t\treturn res;\n\t}\n\treturn false;\n}", "function intersectRects(rect1, rect2) {\n\tvar res = {\n\t\tleft: Math.max(rect1.left, rect2.left),\n\t\tright: Math.min(rect1.right, rect2.right),\n\t\ttop: Math.max(rect1.top, rect2.top),\n\t\tbottom: Math.min(rect1.bottom, rect2.bottom)\n\t};\n\n\tif (res.left < res.right && res.top < res.bottom) {\n\t\treturn res;\n\t}\n\treturn false;\n}", "function intersectRects(rect1, rect2) {\n\tvar res = {\n\t\tleft: Math.max(rect1.left, rect2.left),\n\t\tright: Math.min(rect1.right, rect2.right),\n\t\ttop: Math.max(rect1.top, rect2.top),\n\t\tbottom: Math.min(rect1.bottom, rect2.bottom)\n\t};\n\n\tif (res.left < res.right && res.top < res.bottom) {\n\t\treturn res;\n\t}\n\treturn false;\n}", "function intersectRects(rect1, rect2) {\n\tvar res = {\n\t\tleft: Math.max(rect1.left, rect2.left),\n\t\tright: Math.min(rect1.right, rect2.right),\n\t\ttop: Math.max(rect1.top, rect2.top),\n\t\tbottom: Math.min(rect1.bottom, rect2.bottom)\n\t};\n\n\tif (res.left < res.right && res.top < res.bottom) {\n\t\treturn res;\n\t}\n\treturn false;\n}", "function intersectRects(rect1, rect2) {\n\tvar res = {\n\t\tleft: Math.max(rect1.left, rect2.left),\n\t\tright: Math.min(rect1.right, rect2.right),\n\t\ttop: Math.max(rect1.top, rect2.top),\n\t\tbottom: Math.min(rect1.bottom, rect2.bottom)\n\t};\n\n\tif (res.left < res.right && res.top < res.bottom) {\n\t\treturn res;\n\t}\n\treturn false;\n}", "function intersectRects(rect1, rect2) {\n\tvar res = {\n\t\tleft: Math.max(rect1.left, rect2.left),\n\t\tright: Math.min(rect1.right, rect2.right),\n\t\ttop: Math.max(rect1.top, rect2.top),\n\t\tbottom: Math.min(rect1.bottom, rect2.bottom)\n\t};\n\n\tif (res.left < res.right && res.top < res.bottom) {\n\t\treturn res;\n\t}\n\treturn false;\n}", "function intersectRects(rect1, rect2) {\n\tvar res = {\n\t\tleft: Math.max(rect1.left, rect2.left),\n\t\tright: Math.min(rect1.right, rect2.right),\n\t\ttop: Math.max(rect1.top, rect2.top),\n\t\tbottom: Math.min(rect1.bottom, rect2.bottom)\n\t};\n\n\tif (res.left < res.right && res.top < res.bottom) {\n\t\treturn res;\n\t}\n\treturn false;\n}", "function intersection(rect1, rect2) {\n return (\n within(rect1.x, rect1.x + rect1.width, rect2.x, rect2.x + rect2.width) &&\n within(rect1.y, rect1.y + rect1.height, rect2.y, rect2.y + rect2.height);\n );\n}", "function intersectRects(rect1, rect2) {\n\t\tvar res = {\n\t\t\tleft: Math.max(rect1.left, rect2.left),\n\t\t\tright: Math.min(rect1.right, rect2.right),\n\t\t\ttop: Math.max(rect1.top, rect2.top),\n\t\t\tbottom: Math.min(rect1.bottom, rect2.bottom)\n\t\t};\n\n\t\tif (res.left < res.right && res.top < res.bottom) {\n\t\t\treturn res;\n\t\t}\n\t\treturn false;\n\t}", "function intersectRect(r1, r2) {\n\treturn !(\n\t\tr2.left > r1.right ||\n\t\tr2.right < r1.left ||\n\t\tr2.top > r1.bottom ||\n\t\tr2.bottom < r1.top\n\t);\n}", "function constructIntersection(rectangle1, rectangle2) {\n let x1 = Math.max(rectangle1.x, rectangle2.x);\n let y1 = Math.max(rectangle1.y, rectangle2.y);\n let x2 = Math.min(rectangle1.x + rectangle1.width, rectangle2.x + rectangle2.width);\n let y2 = Math.min(rectangle1.y + rectangle1.height, rectangle2.y + rectangle2.height);\n if (x2 >= x1 && y2 >= y1)\n return { x: x1, y: y1, width: x2 - x1, height: y2 - y1 };\n else\n return { x: 0, y: 0, width: 0, height: 0 };\n}", "intersects(otherRectangle: _Rectangle): boolean {\n return !(\n this.right < otherRectangle.left ||\n this.bottom < otherRectangle.top ||\n this.left > otherRectangle.right ||\n this.top > otherRectangle.bottom\n )\n }", "function intersect(rect1, rect2) {\n rect1left = rect1.x + 3;\n rect1top = rect1.y + 5;\n rect1right = rect1.x + rect1.width - 3;\n rect1bottom = rect1.y + rect1.height - 5;\n\n rect2left = rect2.x + 3;\n rect2top = rect2.y + 5;\n rect2right = rect2.x + rect2.width - 3;\n rect2bottom = rect2.y + rect2.height - 5;\n\n return !(\n rect1left > rect2right ||\n rect1right < rect2left ||\n rect1top > rect2bottom ||\n rect1bottom < rect2top\n );\n }", "function rectIntersection(x1, y1, w1, h1, x2, y2, w2, h2) {\n if (x1 <= x2 + w2 && x1 + w1 >= x2 && y1 <= y2 + h2 && y1 + h1 >= y2) {\n return true;\n }\n return false;\n}", "intersection(_rect) {\n return new HRect(\n Math.max(this.left, _rect.left), Math.max(this.top, _rect.top),\n Math.min(this.right, _rect.right), Math.min(this.bottom, _rect.bottom)\n );\n }", "function checkIntersection(r1, r2) {\n console.log(`checking instersetions`);\n let intersects = !(\n r2.left > r1.right ||\n r2.right < r1.left ||\n r2.top > r1.bottom ||\n r2.bottom < r1.top\n );\n if (!intersects) {\n console.log(intersects);\n return false;\n }\n\n let leftX = Math.max(r1.x, r2.x);\n let rightX = Math.min(r1.x + r1.w, r2.x + r2.w);\n let topY = Math.max(r1.y, r2.y);\n let bottomY = Math.min(r1.y + r1.h, r2.y + r2.h);\n\n if (leftX < rightX && topY < bottomY) {\n rect4 = new Block(leftX, topY, rightX - leftX, bottomY - topY, true);\n let a1 = r1.area;\n let a2 = r2.area;\n let a3 = rect4.area;\n if (a1 == a2) return true;\n return !(a3 >= a2 || a3 >= a1);\n } else {\n intersects = false;\n return intersects;\n // Rectangles do not overlap, or overlap has an area of zero (edge/corner overlap)\n }\n console.log(intersects);\n return intersects;\n}", "function intersect (r1, r2) {\n return r1.left < r2.right\n && r1.right > r2.left\n && r1.top < r2.bottom\n && r1.bottom > r2.top;\n }", "function intersect(a, b) {\n return !(\n a.x2 - 1 < b.x1 ||\n a.x1 + 1 > b.x2 ||\n a.y2 - 1 < b.y1 ||\n a.y1 + 1 > b.y2\n );\n}", "function intersect(a, b) {\n return !(\n a.x2 - 1 < b.x1 ||\n a.x1 + 1 > b.x2 ||\n a.y2 - 1 < b.y1 ||\n a.y1 + 1 > b.y2\n );\n}", "function rectIntersects(rect1, rect2) {\r\n return (rect1[TOP_LEFT][X] <= rect2[BOTTOM_RIGHT][X] &&\r\n rect2[TOP_LEFT][X] <= rect1[BOTTOM_RIGHT][X] &&\r\n rect1[TOP_LEFT][Y] <= rect2[BOTTOM_RIGHT][Y] &&\r\n rect2[TOP_LEFT][Y] <= rect1[BOTTOM_RIGHT][Y]);\r\n}", "function intersect$1(a, b) {\n return !(\n a.x2 - 1 < b.x1 ||\n a.x1 + 1 > b.x2 ||\n a.y2 - 1 < b.y1 ||\n a.y1 + 1 > b.y2\n );\n }", "function rectIntersection(rectA, rectB) {\n\t\t// condition:\n\t\tif (rectA.left <= rectB.right && rectA.right >= rectB.left &&\n\t\t\trectA.top <= rectB.bottom && rectA.bottom >= rectB.top ) {\n\n\t\t\treturn rectIntArea(rectA, rectB);\n\t\t}\n\t\treturn 0;\n\t}", "function unionRectangles(rect1, rect2) {\n var rect = {\n top: (Math.min(rect1.top, rect2.top)),\n bottom: (Math.max(rect1.bottom, rect2.bottom)),\n left: (Math.min(rect1.left, rect2.left)),\n right: (Math.max(rect1.right, rect2.right))\n }\n rect.width = rect.right - rect.left;\n rect.height = rect.bottom - rect.top;\n\n return rect;\n }", "function subtract(rect1, rect2) {\n // Calculate a set of rects such that their union is rect1-rect2.\n let [x11, x12, y11, y12] = rect1\n let [x21, x22, y21, y22] = rect2\n\n let rects = []\n // Let's look at the options for x. There are six:\n // 1. x11<x12<x21<x22\n // 2. x11<x21<x12<x22\n // 3. x21<x11<x12<x22\n // 4. x11<x21<x22<x12\n // 5. x21<x11<x22<x12\n // 6. x21<x22<x11<x12\n // (where inequalities are sometimes strict and sometimes weak)\n\n // Options 1 and 6: no overlap at all\n // Strong inequality, because if they are equal then there's an overlap of 1.\n if (x12 < x21 || x22 < x11) {\n // Ditch immediately. There is no overlap between the two rects.\n return [rect1]\n }\n\n // Option 3: rect1 is completely inside rect2. Keep the rects as is.\n else if (x21 <= x11 && x12 <= x22) {\n }\n\n /* previously...\n // Option 4: rect2 is completely inside rect1. Split out the left and right parts of rect1 and set it to be just the middle.\n else if (x11 <= x21 && x22 <= x12) {\n rects.push([x11, x21-1, y11, y12])\n rects.push([x22+1, x12, y11, y12])\n x11 = x21\n x12 = x22\n }\n\n // Option 2: Right part of rect2 overlaps with the left part of rect1. Create\n // a rectangle that is just the right part of rect1\n else if (x11 < x21) {\n rects.push([x11, x21-1, y11, y12])\n x11 = x21\n }\n\n // Option 5: Same as 2 but with the directions reversed\n else if (x22 < x12) {\n rects.push([x22+1, x12, y11, y12])\n x12 = x22\n }*/\n\n // Handle options 2, 4, 5 simultaneously:\n else {\n if (x11 < x21) {\n rects.push([x11, x21-1, y11, y12])\n x11 = x21\n }\n if (x22 < x12) {\n rects.push([x22+1, x12, y11, y12])\n x12 = x22\n }\n }\n\n\n // OK, now copy that over for y.\n if (y12 < y21 || y22 < y11) {\n return [rect1]\n }\n else if (y21 <= y11 && y12 <= y22) {\n }\n else {\n if (y11 < y21) {\n rects.push([x11, x12, y11, y21-1])\n y11 = y21\n }\n if (y22 < y12) {\n rects.push([x11, x12, y22+1, y12])\n y12 = y22\n }\n }\n\n return rects\n \n /* Old version for posterity\n if (x21 <= x11) {\n // rect2 starts to the left of rect1. Split rect1 into two, and only deal\n // with the left-hand side from now on. Unless rect2 ends to the right of\n // rect1, then don't do that.\n if (x22 >= x12 || x22 < x11) {\n // Nothing\n } else {\n rects.push([x22+1, x12, y11, y12])\n x12 = x22\n }\n } else if (x21 < x22) {\n // rect2 starts in the middle of rect1. Same kind of split except in the\n // other direction, and no need to worry about that special case.\n rects.push([x11, x21-1, y11, y12])\n x11 = x21-1\n } else {\n // rect2's leftmost corner is to the right of all of rect1, so just return rect1.\n return [rect1]\n }\n if (y21 <= y11) {\n // rect2 starts to the left of rect1. Split rect1 into two, and only deal\n // with the left-hand side from now on. Unless rect2 ends to the right of\n // rect1, then don't do that.\n if (y22 >= y12 || x22 < x11) {\n // Nothing\n } else {\n rects.push([x11, x12, y22+1, y12])\n y12 = y22\n }\n } else if (y21 < y22) {\n // rect2 starts in the middle of rect1. Same kind of split except in the\n // other direction, and no need to worry about that special case.\n rects.push([x11, x12, y11, y21-1])\n y11 = y21-1\n } else {\n // rect2's leftmost corner is to the right of all of rect1, so just return rect1.\n return [rect1]\n }\n return [...rects, [x11, x12, y11, y12]]*/\n}", "function unionRectangles(rect1, rect2) {\r\n\t\tvar rect = {\r\n\t\t\ttop : (Math.min(rect1.top, rect2.top)),\r\n\t\t\tbottom : (Math.max(rect1.bottom, rect2.bottom)),\r\n\t\t\tleft : (Math.min(rect1.left, rect2.left)),\r\n\t\t\tright : (Math.max(rect1.right, rect2.right))\r\n\t\t}\r\n\t\trect.width = rect.right - rect.left;\r\n\t\trect.height = rect.bottom - rect.top;\r\n\r\n\t\treturn rect;\r\n\t}", "function SPF_DoesRectanglesOverlap(point_l1, point_r1, point_l2, point_r2) {\n\n // If one rectangle is on left side of other\n if (point_l1.x > point_r2.x || point_l2.x > point_r1.x)\n return false;\n\n // If one rectangle is above other\n if (point_l1.y > point_r2.y || point_l2.y > point_r1.y)\n return false;\n\n return true;\n\n}", "function Position_Rect_IntersectWith(otherRect)\n{\n\t//modify our rect\n\tthis.left = Math.max(this.left, otherRect.left);\n\tthis.top = Math.max(this.top, otherRect.top);\n\tthis.right = Math.min(this.right, otherRect.right);\n\tthis.bottom = Math.min(this.bottom, otherRect.bottom);\n\tthis.width = this.right - this.left;\n\tthis.height = this.bottom - this.top;\n\t//empty rect?\n\tif (this.width <= 0 || this.height <= 0)\n\t{\n\t\t//make us empty\n\t\tthis.left = 0;\n\t\tthis.top = 0;\n\t\tthis.right = 0;\n\t\tthis.bottom = 0;\n\t\tthis.width = 0;\n\t\tthis.height = 0;\n\t}\n}", "function doesIntersect(p0, b0, p1, b1) {\r\n\t\tif(p0.x + b0.width - 1 < p1.x) return false;\r\n\t\tif(p0.y + b0.height - 1 < p1.y) return false;\r\n\t\t\r\n\t\tif(p1.x + b1.width - 1 < p0.x) return false;\r\n\t\tif(p1.y + b1.height - 1 < p0.y) return false;\r\n\t\t\r\n\t\treturn true;\r\n\t}", "function xIntersection(e1, e2, o)\r\n{\r\n var ix1, iy2, iw, ih, intersect = true;\r\n var e1x1 = xPageX(e1);\r\n var e1x2 = e1x1 + xWidth(e1);\r\n var e1y1 = xPageY(e1);\r\n var e1y2 = e1y1 + xHeight(e1);\r\n var e2x1 = xPageX(e2);\r\n var e2x2 = e2x1 + xWidth(e2);\r\n var e2y1 = xPageY(e2);\r\n var e2y2 = e2y1 + xHeight(e2);\r\n // horizontal\r\n if (e1x1 <= e2x1) {\r\n ix1 = e2x1;\r\n if (e1x2 < e2x1) intersect = false;\r\n else iw = Math.min(e1x2, e2x2) - e2x1;\r\n }\r\n else {\r\n ix1 = e1x1;\r\n if (e2x2 < e1x1) intersect = false;\r\n else iw = Math.min(e1x2, e2x2) - e1x1;\r\n }\r\n // vertical\r\n if (e1y2 >= e2y2) {\r\n iy2 = e2y2;\r\n if (e1y1 > e2y2) intersect = false;\r\n else ih = e2y2 - Math.max(e1y1, e2y1);\r\n }\r\n else {\r\n iy2 = e1y2;\r\n if (e2y1 > e1y2) intersect = false;\r\n else ih = e1y2 - Math.max(e1y1, e2y1);\r\n }\r\n // intersected rectangle\r\n if (intersect && typeof(o)=='object') {\r\n o.x = ix1;\r\n o.y = iy2 - ih;\r\n o.w = iw;\r\n o.h = ih;\r\n }\r\n return intersect;\r\n}", "function combineGeoRect( rect1, rect2 ){\r\n\tif(!rect1.is_valid && !rect2.is_valid){\r\n\t\treturn new GeoRect();\r\n\t}\r\n\t\r\n\tif(rect1.is_valid && !rect2.is_valid){\r\n\t\treturn rect1.clone();\r\n\t}\r\n\t\r\n\tif(!rect1.is_valid && rect2.is_valid){\r\n\t\treturn rect2.clone();\r\n\t}\r\n\t\r\n\tvar merge = new GeoRect();\r\n\tmerge.is_valid = true;\r\n\t\r\n\tmerge.min_lat = rect1.min_lat < rect2.min_lat ? rect1.min_lat : rect2.min_lat;\r\n\tmerge.max_lat = rect1.max_lat > rect2.max_lat ? rect1.max_lat : rect2.max_lat;\r\n\tmerge.min_lng = rect1.min_lng < rect2.min_lng ? rect1.min_lng : rect2.min_lng;\r\n\tmerge.max_lng = rect1.max_lng > rect2.max_lng ? rect1.max_lng : rect2.max_lng;\r\n\t\r\n\treturn merge;\r\n}", "function intersect_Rect2d_Rect2d (pRectA, pRectB, pResult) {\n debug_assert(pResult, \"a result address must be provided\");\n pResult.fX0 = Math.max(pRectA.fX0, pRectB.fX0);\n pResult.fX1 = Math.min(pRectA.fX1, pRectB.fX1);\n if (pResult.fX0 < pResult.fX1) {\n pResult.fY0 = Math.max(pRectA.fY0, pRectB.fY0);\n pResult.fY1 = Math.min(pRectA.fY1, pRectB.fY1);\n if (pResult.fY0 < pResult.fY1) {\n return true;\n }\n }\n return false;\n}", "rectangleCollision(loc1, rectWidth1, rectHeight1, loc2, rectWidth2, rectHeight2) {\n if (this.range(loc1.x, loc1.x + rectWidth1, loc2.x, loc2.x + rectWidth2) &&\n this.range(loc1.y, loc1.y + rectHeight1, loc2.y, loc2.y + rectHeight2)) {\n return true;\n }\n }", "function Position_Rect_Intersects(otherRect)\n{\n\t//check and confirm\n\treturn !(otherRect.left > this.right || otherRect.right < this.left || otherRect.top > this.bottom || otherRect.bottom < this.top);\n}", "function hitTestRectangle(r1, r2) {\n\n //Define the variables we'll need to calculate\n let hit, combinedHalfWidths, combinedHalfHeights, vx, vy;\n\n //hit will determine whether there's a collision\n hit = false;\n\n //Find the center points of each sprite\n r1.centerX = r1.x + r1.width / 8;\n r1.centerY = r1.y + r1.height / 8;\n r2.centerX = r2.x + r2.width / 8;\n r2.centerY = r2.y + r2.height / 8;\n\n //Find the half-widths and half-heights of each sprite\n r1.halfWidth = r1.width / 8;\n r1.halfHeight = r1.height / 8;\n r2.halfWidth = r2.width / 8;\n r2.halfHeight = r2.height / 8;\n\n //Calculate the distance vector between the sprites\n vx = r1.centerX - r2.centerX;\n vy = r1.centerY - r2.centerY;\n\n //Figure out the combined half-widths and half-heights\n combinedHalfWidths = r1.halfWidth + r2.halfWidth;\n combinedHalfHeights = r1.halfHeight + r2.halfHeight;\n\n //Check for a collision on the x axis\n if (Math.abs(vx) < combinedHalfWidths) {\n\n //A collision might be occuring. Check for a collision on the y axis\n if (Math.abs(vy) < combinedHalfHeights) {\n\n //There's definitely a collision happening\n hit = true;\n } else {\n\n //There's no collision on the y axis\n hit = false;\n }\n } else {\n\n //There's no collision on the x axis\n hit = false;\n }\n\n //`hit` will be either `true` or `false`\n return hit;\n}", "function collision(rect1, rect2) {\n if (rect1.x < rect2.x + rect2.width &&\n rect1.x + rect1.width > rect2.x &&\n rect1.y < rect2.y + rect2.height &&\n rect1.y + rect1.height > rect2.y) {\n return true;\n }\n}", "static unionRect(b1, b2) {\n\t\tvar x = Math.min(b1.x, b2.x);\n\t\tvar y = Math.min(b1.y, b2.y);\n\t\tvar width = Math.max(b1.x + b1.width, b2.x + b2.width) - x;\n\t\tvar height = Math.max(b1.y + b1.height, b2.y + b2.height) - y;\n\t\treturn {\n\t\t\tx: x,\n\t\t\ty: y,\n\t\t\twidth: width,\n\t\t\theight: height\n\t\t};\n\t}", "function hitTestRectangle(r1, r2) {\n\n //Define the variables we'll need to calculate\n var hit, combinedHalfWidths, combinedHalfHeights, vx, vy;\n //hit will determine whether there's a collision\n hit = false;\n\n //Find the center points of each sprite\n r1.centerX = r1.x + r1.width / 2;\n r1.centerY = r1.y + r1.height / 2;\n r2.centerX = r2.x + r2.width / 2;\n r2.centerY = r2.y + r2.height / 2;\n\n //Find the half-widths and half-heights of each sprite\n r1.halfWidth = r1.width / 2;\n r1.halfHeight = r1.height / 2;\n r2.halfWidth = r2.width / 2;\n r2.halfHeight = r2.height / 2;\n\n //Calculate the distance vector between the sprites\n vx = r1.centerX - r2.centerX;\n vy = r1.centerY - r2.centerY;\n\n //Figure out the combined half-widths and half-heights\n combinedHalfWidths = r1.halfWidth + r2.halfWidth;\n combinedHalfHeights = r1.halfHeight + r2.halfHeight;\n\n //Check for a collision on the x axis\n if (Math.abs(vx) < combinedHalfWidths) {\n //A collision might be occuring. Check for a collision on the y axis\n if (Math.abs(vy) < combinedHalfHeights) {\n //There's definitely a collision happening\n hit = true;\n } else {\n //There's no collision on the y axis\n hit = false;\n }\n } else {\n //There's no collision on the x axis\n hit = false;\n }\n //`hit` will be either `true` or `false`\n return hit;\n}", "function intersects(x1, y1, w1, h1, x2, y2, w2, h2)\n{\nif(y2 + h2 < y1 ||\nx2 + w2 < x1 ||\nx2 > x1 + w1 ||\ny2 > y1 + h1)\n{\nreturn false;\n}\nreturn true;\n}", "function rectCollision(aX, aY, aW, aH, bX, bY, bW, bH) {\n\t// rect A collides with rect B if any of the corner\n\t// points of A is within B\n\t// OR lets not forget (lol) if B is within A !\n\n\treturn _oneOfPointsWithinRect(aX, aY, aW, aH, bX, bY, bW, bH) ||\n\t\t\t\t_oneOfPointsWithinRect(bX, bY, bW, bH, aX, aY, aW, aH);\n}", "function testCollisionRectRect(rect1, rect2) {\n\treturn rect1.x <= rect2.x + rect2.width \n\t\t&& rect2.x <= rect1.x + rect1.width\n\t\t&& rect1.y <= rect2.y + rect2.height\n\t\t&& rect2.y <= rect1.y + rect1.height;\n}", "function testCollision(A,B )//compare 2 rectangles/boxes if they intersecting\n{\n //The contradictory logic because it is simpler.\n return !(A.bottom< B.top ||\n A.top >B.bottom||\n A.left > B.right||\n A.right<B.left);\n}", "function checkCollision(rect1, rect2) {\n first = rect1.getBoundingClientRect();\n second = rect2.getBoundingClientRect();\n\n if (\n first.left < second.left + $(rect2).width() &&\n first.left + $(rect1).width() > second.left &&\n first.top < second.top + $(rect2).height() &&\n first.top + $(rect1).height() > second.top\n ) {\n return true;\n } else {\n return false;\n }\n}", "function hitTestRectangle(r1, r2) { \n //Define the variables we'll need to calculate\n let hit, combinedHalfWidths, combinedHalfHeights, vx, vy; \n //hit will determine whether there's a collision\n hit = false; \n //Find the center points of each sprite\n r1.centerX = r1.x + r1.width / 2;\n r1.centerY = r1.y + r1.height / 2;\n r2.centerX = r2.x + r2.width / 2;\n r2.centerY = r2.y + r2.height / 2; \n //Find the half-widths and half-heights of each sprite\n r1.halfWidth = r1.width / 2;\n r1.halfHeight = r1.height / 2;\n r2.halfWidth = r2.width / 2;\n r2.halfHeight = r2.height / 2; \n //Calculate the distance vector between the sprites\n vx = r1.centerX - r2.centerX;\n vy = r1.centerY - r2.centerY; \n //Figure out the combined half-widths and half-heights\n combinedHalfWidths = r1.halfWidth + r2.halfWidth;\n combinedHalfHeights = r1.halfHeight + r2.halfHeight; \n //Check for a collision on the x axis\n if (Math.abs(vx) < combinedHalfWidths) { \n //A collision might be occurring. Check for a collision on the y axis\n if (Math.abs(vy) < combinedHalfHeights) { \n //There's definitely a collision happening\n hit = true;\n } else {\n \n //There's no collision on the y axis\n hit = false;\n }\n } else {\n \n //There's no collision on the x axis\n hit = false;\n }\n \n //`hit` will be either `true` or `false`\n return hit;\n}", "function isWithinBounds(rectArr, rect2) {\n var match = null;\n rectArr.forEach(rect1 => {\n var r1 = {\n top: rect1.position().y,\n bottom: rect1.position().y + rect1.height(),\n left: rect1.position().x,\n right: rect1.position().x + rect1.width()\n };\n var r2 = {\n top: rect2.position().y,\n bottom: rect2.position().y + rect2.height(),\n left: rect2.position().x,\n right: rect2.position().x + rect2.width()\n };\n\n if(!(r2.left > r1.right || \n r2.right < r1.left || \n r2.top > r1.bottom ||\n r2.bottom < r1.top)) {\n match = rect1;\n }\n });\n \n return match;\n}", "function areRectanglesTouching( r1, r2 ) {\r\n\tif(\r\n\t\t(r1.x < r2.x + r2.width)\r\n\t\t&& (r1.x + r1.width > r2.x)\r\n\t\t&& (r1.y < r2.y + r2.height)\r\n\t\t&& (r1.y + r1.height > r2.y )\r\n\t\t) {\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n} //end areRectanglesTouching", "function has_intersection(x1, x2, y1, y2, bound){\n\t \n\t//top edge\n\tvar tx = (bound.min_y - y1) * (x2-x1)/(y2-x2) + x1;\n\tif((tx >= x1 && tx <= x2 || tx <= x1 && tx >= x2) && tx >= bound.min_x && tx <= bound.max_x){\n\t\treturn true;\n\t}\n\t\n\t//bottom edge\n\tvar bx = (bound.max_y - y1) * (x2-x1)/(y2-x2) + x1;\n\tif((bx >= x1 && bx <= x2 || bx <= x1 && bx >= x2) && bx >= bound.min_x && bx <= bound.max_x){\n\t\treturn true;\n\t}\n\t//left edge\n\tvar ly = (bound.min_x - x1) * (y2-x2) / (x2 - x1) + x1;\n\tif((ly >= y1 && ly <= y2 || ly <= y1 && ly >= y2) && ly >= bound.min_y && ly <= bound.max_y){\n\t\treturn true;\n\t}\n\t//right edge\n\tvar ry = (bound.max_x - x1) * (y2-x2) / (x2 - x1) + x1;\n\tif((ry >= y1 && ry <= y2 || ry <= y1 && ry >= y2) && ry >= bound.min_y && ry <= bound.max_y){\n\t\treturn true;\n\t}\n\treturn false;\n}", "function checkOverlap(rect1, rect2) {\n\tlet rightBottom1 = {x: rect1.x + rect1.width, y: rect1.y - rect1.width};\n\tlet rightBottom2 = {x: rect2.x + rect2.width, y: rect2.y - rect2.width};\n\tif (rect1.x > rightBottom2.x || rect2.x > rightBottom1.x) return false;\n\tif (rect1.y < rightBottom2.y || rect2.y < rightBottom1.y) return false;\n\treturn true;\n}", "function rectangleCollision(rect1,rect2) {\n // Rects defined as [x,y,width,height]\n var r1 = {\n x1: rect1[0],\n y1: rect1[1],\n w: rect1[2],\n h: rect1[3],\n x2: rect1[0] + rect1[2],\n y2: rect1[1] + rect1[3]\n };\n var r2 = {\n x1: rect2[0],\n y1: rect2[1],\n w: rect2[2],\n h: rect2[3],\n x2: rect2[0] + rect2[2],\n y2: rect2[1] + rect2[3]\n };\n\n // Inside degrees assumind r2 bigger\n /*\n 0 - Full left/top\n 1 - part left/top\n 2 - inside\n 3- part right\n 4- full right/down\n */\n var horizontalIn = 0;\n var verticalIn = 0;\n\n if (r1.x2 < r2.x1) {\n horizontalIn = 0\n }else if ((r1.x2 > r2.x1) && (r1.x1 < r2.x1)) {\n horizontalIn = 1;\n }else if ((r1.x2 < r2.x2) && (r1.x1 > r2.x1)) {\n horizontalIn = 2;\n }else if ((r1.x2 > r2.x2) && (r1.x1 < r2.x2)) {\n horizontalIn = 3;\n }else if (r1.x1 > r2.x2) {\n horizontalIn = 4;\n }\n\n if (r1.y2 < r2.y1) {\n verticalIn = 0\n }else if ((r1.y2 > r2.y1) && (r1.y1 < r2.y1)) {\n verticalIn = 1;\n }else if ((r1.y2 < r2.y2) && (r1.y1 > r2.y1)) {\n verticalIn = 2;\n }else if ((r1.y2 > r2.y2) && (r1.y1 < r2.y2)) {\n verticalIn = 3;\n }else if (r1.y1 > r2.y2) {\n verticalIn = 4;\n }\n\n // If neither then not in\n if (horizontalIn == 0 || verticalIn == 0 || horizontalIn == 4 || verticalIn == 4) {\n return 0;\n }\n // Fully in\n else if(horizontalIn == 2 && verticalIn==2){\n return -1;\n }\n // Priority to horizontalIn\n else if(horizontalIn == 1){\n return 1;\n }\n else if (horizontalIn == 3) {\n return 2;\n }\n // horizontalIn as 2 for full in\n else {\n if (verticalIn == 1) {\n return 3;\n }else if (verticalIn == 3) {\n return 4;\n }\n\n }\n}", "function overlap(obj1, obj2) {\n var right1 = obj1.x + obj1.width;\n var right2 = obj2.x + obj2.width;\n var left1 = obj1.x;\n var left2 = obj2.x;\n var top1 = obj1.y;\n var top2 = obj2.y;\n var bottom1 = obj1.y + obj1.height;\n var bottom2 = obj2.y + obj2.height;\n\n if (left1 < right2 && left2 < right1 && top1 < bottom2 && top2 < bottom1) {\n return true;\n }\n return false;\n }", "function square_square_overlap(rect1, rect2) {\n // rect: pos (lower left), size (w || h)\n // test each corner of one rect against dimension bounds of other\n // crit: if ANY corner is inside BOTH dimensions (x, y)\n\n // 1. calculate each point of rect2\n var list_of_points = [];\n list_of_points.push({x: rect2.pos.x, y: rect2.pos.y});\n list_of_points.push({x: rect2.pos.x + rect2.size, y: rect2.pos.y});\n list_of_points.push({x: rect2.pos.x, y: rect2.pos.y + rect2.size});\n list_of_points.push({x: rect2.pos.x + rect2.size, y: rect2.pos.y + rect2.size});\n\n // test each point, break if any overlap\n for (let i = 0; i < list_of_points.length; i++) {\n const c = list_of_points[i];\n if ((c.x >= rect1.pos.x && c.x <= rect1.pos.x + rect1.size) \n && ( c.y >= rect1.pos.y && c.y <= rect1.pos.y + rect1.size)) {\n return true;\n }\n }\n\n return false;\n}", "AABB(rect1, rect2){\n var collision = false;\n if (rect1.x < rect2.x + rect2.w &&\n rect1.x + rect1.w > rect2.x &&\n rect1.y < rect2.y + rect2.h &&\n rect1.h + rect1.y > rect2.y) {\n // collision detected!\n collision = true;\n }\n return collision;\n }", "function collision(rect1, rect2) {\r\n // check if they are overlapping\r\n if (typeof rect1 != \"undefined\" && typeof rect2 != \"undefined\") {\r\n if (rect1.x <= rect2.x + rect2.width && rect1.x + rect1.width >= rect2.x &&\r\n rect1.y <= rect2.y + rect2.height && rect1.y + rect1.height > rect2.y) {\r\n // If they are colliding, return true\r\n return true;\r\n } else {\r\n // If they are not colliding, return false\r\n return false;\r\n }\r\n } else {\r\n return false;\r\n }\r\n\r\n}", "function overlapTest(a, b) {\n return a.x < b.x + b.w && a.x + a.w > b.x &&\n a.y < b.y + b.h && a.y + a.h > b.y\n}", "function overlapTest(a, b) {\n return a.x < b.x + b.w && a.x + a.w > b.x &&\n a.y < b.y + b.h && a.y + a.h > b.y\n}", "function collisionRect(x1,y1,w1,h1,x2,y2,w2,h2) {\n\treturn (x1 < x2 + w2) && (x1 + w1 > x2) && (y1 < y2 + h2) && (y1 + h1 > y2);\n}", "function overlapTest(a, b) {\n return a.x < b.x + b.w && a.x + a.w > b.x &&\n\t\t a.y < b.y + b.h && a.y + a.h > b.y\n}", "function intersect(e1, e2) {\n return (area(e1.u, e1.v, e2.u) > 0 && area(e1.u, e1.v, e2.v) < 0)\n || (area(e1.u, e1.v, e2.u) < 0 && area(e1.u, e1.v, e2.v) > 0);\n}", "static intersectsPolygon(a, b) {\n var p = a;\n do {\n if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&\n GraphicsGeometry.intersects(p, p.next, a, b)) {\n return true;\n }\n p = p.next;\n } while (p !== a);\n return false;\n }", "overlapsRectangle(rectangle, includeBoundary = true) {\n if (includeBoundary) {\n return !(this.bottom < rectangle.top || this.top > rectangle.bottom\n || this.right < rectangle.left || this.left > rectangle.right);\n }\n return !(this.bottom <= rectangle.top || this.top >= rectangle.bottom\n || this.right <= rectangle.left || this.left >= rectangle.right);\n }", "function pointInRect(a, b, c) {\n\t return c[0] <= Math.max(a[0], b[0]) && c[0] >= Math.min(a[0], b[0]) && c[1] <= Math.max(a[1], b[1]) && c[1] >= Math.min(a[1], b[1]);\n\t}", "function isRectAOutsideRectB(a, b) {\n if (a.left > b.left + b.width) return true; // to the right\n if (a.left + a.width < b.left) return true; // to the left\n if (a.top > b.top + b.height) return true; // below\n if (a.top + a.height < b.top) return true; // above\n return false;\n }", "function objectsOverlap(obj1, obj2){\n let obj1_b = obj1['boundingBox'];\n let obj2_b = obj2['boundingBox'];\n\n if(!obj1_b || !obj2_b)//one of the two objs has no bounding box\n return 0;\n\n //first consider the case in which the overlap is not possible, so the result is 0\n if(obj1_b['br']['x'] < obj2_b['bl']['x'] || obj1_b['bl']['x'] > obj2_b['br']['x'])//considering x\n // when the gFaceRect finished before the start of azure one (or the opposite)\n return 0;\n\n else if(obj1_b['bl']['y'] < obj2_b['tl']['y'] || obj1_b['tl']['y'] > obj2_b['bl']['y'])//considering y\n // when the gFaceRect finished before the start of azure one (or the opposite)\n return 0;\n\n else{ //there is an overlap\n\n // remind that\n // - x goes from 0 -> N (left -> right)\n // - y goes from 0 -> N (top -> bottom)\n let xc1 = Math.max(obj1_b['bl']['x'], obj2_b['bl']['x']);\n let xc2 = Math.min(obj1_b['br']['x'], obj2_b['br']['x']);\n let yc1 = Math.max(obj1_b['bl']['y'], obj2_b['bl']['y']);\n let yc2 = Math.min(obj1_b['tl']['y'], obj2_b['tl']['y']);\n let xg1 = obj1_b['bl']['x'];\n let xg2 = obj1_b['br']['x'];\n let yg1 = obj1_b['bl']['y'];\n let yg2 = obj1_b['tl']['y'];\n\n let areaO = (xc2-xc1) * (yc2 - yc1); //area covered by the overlapping\n let areaI = (xg2-xg1) * (yg2 - yg1); //area covered by the first bounding box\n\n return areaO/areaI;\n }\n}", "function collision_detector(first, second) {\r\n var x1 = first.get(\"X\");\r\n var y1 = first.get(\"Y\");\r\n var width1 = first.get(\"width\");\r\n var height1 = first.get(\"height\");\r\n var x2 = second.get(\"X\");\r\n var y2 = second.get(\"Y\");\r\n var width2 = second.get(\"width\");\r\n var height2 = second.get(\"height\");\r\n\r\n if (x2 > x1 && x2 < x1 + width1 || x1 > x2 && x1 < x2 + width2) {\r\n if (y2 > y1 && y2 < y1 + height1 || y1 > y2 && y1 < y2 + height2) {\r\n return true;\r\n }\r\n } else {\r\n return false;\r\n }\r\n}", "function rectanglesEqual(rect1, rect2) {\r\n\t\tif (!rect1 && !rect2)\r\n\t\t\treturn true;\r\n\t\tif (!rect1)\r\n\t\t\treturn false;\r\n\t\tif (!rect2)\r\n\t\t\treturn false;\r\n\t\tif (rect1.top != rect2.top)\r\n\t\t\treturn false;\r\n\t\tif (rect1.bottom != rect2.bottom)\r\n\t\t\treturn false;\r\n\t\tif (rect1.left != rect2.left)\r\n\t\t\treturn false;\r\n\t\tif (rect1.right != rect2.right)\r\n\t\t\treturn false;\r\n\t\tif (rect1.width != rect2.width)\r\n\t\t\treturn false;\r\n\t\tif (rect1.height != rect2.height)\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t}", "function collisionDetection(first, second) {\n var firstBounds = first.getBounds();\n var secondBounds = second.getBounds();\n\n return firstBounds.x + firstBounds.width > secondBounds.x\n && firstBounds.x < secondBounds.x + secondBounds.width \n && firstBounds.y + firstBounds.height > secondBounds.y\n && firstBounds.y < secondBounds.y + secondBounds.height;\n}", "hitTestRectangle(r1, r2, global = false) {\n //Add collision properties\n if (!r1._bumpPropertiesAdded)\n this.addCollisionProperties(r1);\n if (!r2._bumpPropertiesAdded)\n this.addCollisionProperties(r2);\n let hit, combinedHalfWidths, combinedHalfHeights, vx, vy;\n //A variable to determine whether there's a collision\n hit = false;\n //Calculate the distance vector\n if (global) {\n vx = (r1.gx + Math.abs(r1.halfWidth) - r1.xAnchorOffset) - (r2.gx + Math.abs(r2.halfWidth) - r2.xAnchorOffset);\n vy = (r1.gy + Math.abs(r1.halfHeight) - r1.yAnchorOffset) - (r2.gy + Math.abs(r2.halfHeight) - r2.yAnchorOffset);\n }\n else {\n vx = (r1.x + Math.abs(r1.halfWidth) - r1.xAnchorOffset) - (r2.x + Math.abs(r2.halfWidth) - r2.xAnchorOffset);\n vy = (r1.y + Math.abs(r1.halfHeight) - r1.yAnchorOffset) - (r2.y + Math.abs(r2.halfHeight) - r2.yAnchorOffset);\n }\n //Figure out the combined half-widths and half-heights\n combinedHalfWidths = Math.abs(r1.halfWidth) + Math.abs(r2.halfWidth);\n combinedHalfHeights = Math.abs(r1.halfHeight) + Math.abs(r2.halfHeight);\n //Check for a collision on the x axis\n if (Math.abs(vx) < combinedHalfWidths) {\n //A collision might be occuring. Check for a collision on the y axis\n if (Math.abs(vy) < combinedHalfHeights) {\n //There's definitely a collision happening\n hit = true;\n }\n else {\n //There's no collision on the y axis\n hit = false;\n }\n }\n else {\n //There's no collision on the x axis\n hit = false;\n }\n //`hit` will be either `true` or `false`\n return hit;\n }", "function rectanglesEqual(rect1, rect2) {\n if (!rect1 && !rect2) return true;\n if (!rect1) return false;\n if (!rect2) return false;\n if (rect1.top != rect2.top) return false;\n if (rect1.bottom != rect2.bottom) return false;\n if (rect1.left != rect2.left) return false;\n if (rect1.right != rect2.right) return false;\n if (rect1.width != rect2.width) return false;\n if (rect1.height != rect2.height) return false;\n return true;\n }", "function doCollide(obj1, obj2) {\n var left1 = { \"x\": obj1.x, \"y\": obj1.y };\n var right1 = { \"x\": obj1.x + obj1.width, \"y\": obj1.y + obj1.height};\n var left2 = { \"x\": obj2.x, \"y\": obj2.y };\n var right2 = { \"x\": obj2.x + obj2.width, \"y\": obj2.y + obj2.height};\n \n // If one rectangle is on left side of other they do not overlap\n if (left2.x > right1.x || left1.x > right2.x) {\n return false; \n }\n \n // If one rectangle is above other they do not overlap\n if (right2.y < left1.y || right1.y < left2.y) {\n return false; \n }\n \n return true;\n }", "function intersects(a, b) {\n if ((a.h && b.h) || (a.v && b.v)) return;\n\n const h = a.h ? a : b;\n const v = a.v ? a : b;\n const hasIntersection = (h.y >= v.ymin && h.y <= v.ymax) \n && (v.x >= h.xmin && v.x <= h.xmax);\n if (hasIntersection) {\n return [v.x, h.y];\n }\n}", "function checkCollisionRectangle(x1, y1, width1, height1, x2, y2, width2, height2) {\n if (x1 > x2) {\n if (y1 > y2) {\n if (x1 - x2 < width2 && y1 - y2 < height2) {\n if (x1 - x2 > y1 - y2) { return 1; }\n return 2;\n }\n } else {\n if (x1 - x2 < width2 && y2 - y1 < height1) {\n if (x1 - x2 > y2 - y1) { return 1; }\n return 3;\n }\n }\n } else {\n if (y1 > y2) {\n if (x2 - x1 < width1 && y1 - y2 < height2) {\n if (x2 - x1 > y1 - y2) { return 0; }\n return 2;\n }\n } else {\n if (x2 - x1 < width1 && y2 - y1 < height1) {\n if (x2 - x1 > y2 - y1) { return 0; }\n return 3;\n }\n }\n }\n return -1;\n}", "union(_rect) {\n return new HRect(\n Math.min(this.left, _rect.left), Math.min(this.top, _rect.top),\n Math.max(this.right, _rect.right), Math.max(this.bottom, _rect.bottom)\n );\n }", "intersection(range, another) {\n var rest = _objectWithoutProperties(range, _excluded$2);\n\n var [s1, e1] = Range.edges(range);\n var [s2, e2] = Range.edges(another);\n var start = Point.isBefore(s1, s2) ? s2 : s1;\n var end = Point.isBefore(e1, e2) ? e1 : e2;\n\n if (Point.isBefore(end, start)) {\n return null;\n } else {\n return _objectSpread$5({\n anchor: start,\n focus: end\n }, rest);\n }\n }", "function blockCollision(rectOne, rectTwo) {\n \n // Check whether there is a collision on the x and y\n return Math.abs((rectOne.x + rectOne.width / 2) - (rectTwo.x + rectTwo.width / 2)) < rectOne.width / 2 + rectTwo.width / 2 && Math.abs((rectOne.y + rectOne.height / 2) - (rectTwo.y + rectTwo.height / 2)) < rectOne.height / 2 + rectTwo.height / 2;\n \n}", "intersection(range, another) {\n var rest = _objectWithoutProperties(range, [\"anchor\", \"focus\"]);\n\n var [s1, e1] = Range.edges(range);\n var [s2, e2] = Range.edges(another);\n var start = Point.isBefore(s1, s2) ? s2 : s1;\n var end = Point.isBefore(e1, e2) ? e1 : e2;\n\n if (Point.isBefore(end, start)) {\n return null;\n } else {\n return _objectSpread$3({\n anchor: start,\n focus: end\n }, rest);\n }\n }", "function hitTestRectangle(r1, r2) {\n\n //Define the variables we'll need to calculate\n var hit, combinedHalfWidths, combinedHalfHeights, vx, vy, globalZero;\n\n //hit will determine whether there's a collision\n hit = false;\n\n //Find the center points of each sprite\n globalZero = new PIXI.Point(0, 0);\n r1.centerX = r1.toGlobal(globalZero).x;\n r1.centerY = r1.toGlobal(globalZero).y;\n r2.centerX = r2.toGlobal(globalZero).x;\n r2.centerY = r2.toGlobal(globalZero).y;\n\n // Find the half-widths and half-heights of each sprite\n // note: modiified the width and height by a descale factor found in globals.js\n r1.halfWidth = r1.width*HITBOX_SIZE_FACTOR / 2;\n r1.halfHeight = r1.height*HITBOX_SIZE_FACTOR / 2;\n r2.halfWidth = r2.width*HITBOX_SIZE_FACTOR / 2;\n r2.halfHeight = r2.height*HITBOX_SIZE_FACTOR / 2;\n\n //Calculate the distance vector between the sprites\n vx = r1.centerX - r2.centerX;\n vy = r1.centerY - r2.centerY;\n\n //Figure out the combined half-widths and half-heights\n combinedHalfWidths = r1.halfWidth + r2.halfWidth;\n combinedHalfHeights = r1.halfHeight + r2.halfHeight;\n\n //Check for a collision on the x axis\n if (Math.abs(vx) < combinedHalfWidths) {\n\n //A collision might be occuring. Check for a collision on the y axis\n if (Math.abs(vy) < combinedHalfHeights) {\n\n //There's definitely a collision happening\n hit = true;\n } else {\n\n //There's no collision on the y axis\n hit = false;\n }\n } else {\n\n //There's no collision on the x axis\n hit = false;\n }\n\n //`hit` will be either `true` or `false`\n return hit;\n}", "function intersect(pos1, size1, pos2, size2) {\r\n return (pos1.x < pos2.x + size2.w && pos1.x + size1.w > pos2.x &&\r\n pos1.y < pos2.y + size2.h && pos1.y + size1.h > pos2.y);\r\n}", "function intersect(pos1, size1, pos2, size2) {\r\n return (pos1.x < pos2.x + size2.w && pos1.x + size1.w > pos2.x &&\r\n pos1.y < pos2.y + size2.h && pos1.y + size1.h > pos2.y);\r\n}", "function intersect(pos1, size1, pos2, size2) {\r\n return (pos1.x < pos2.x + size2.w && pos1.x + size1.w > pos2.x &&\r\n pos1.y < pos2.y + size2.h && pos1.y + size1.h > pos2.y);\r\n}", "function boundsIntersect(bounds1, bounds2) {\n let topEdge1 = bounds1.endY;\n let rightEdge1 = bounds1.endX;\n let leftEdge1 = bounds1.startX;\n let bottomEdge1 = bounds1.startY;\n let topEdge2 = bounds2.endY;\n let rightEdge2 = bounds2.endX;\n let leftEdge2 = bounds2.startX;\n let bottomEdge2 = bounds2.startY;\n\n return (\n leftEdge1 < rightEdge2 &&\n rightEdge1 > leftEdge2 &&\n bottomEdge1 < topEdge2 &&\n topEdge1 > bottomEdge2\n );\n}", "overlaps(_rect, _insetbyX, _insetByY) {\n return this.intersects(_rect, _insetbyX, _insetByY);\n }", "function intersect(pos1, size1, pos2, size2) {\n return (pos1.x < pos2.x + size2.w && pos1.x + size1.w > pos2.x &&\n pos1.y < pos2.y + size2.h && pos1.y + size1.h > pos2.y);\n}", "function intersectsPolygon(a, b) {\n var p = a;\n do {\n if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i && intersects(p, p.next, a, b)) return true;\n p = p.next;\n } while (p !== a);\n\n return false;\n}", "function intersectsPolygon(a, b) {\n var p = a;\n do {\n if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i && intersects(p, p.next, a, b)) return true;\n p = p.next;\n } while (p !== a);\n\n return false;\n}", "function intersect(pos1, size1, pos2, size2) {\n return (pos1.x < pos2.x + size2.w && pos1.x + size1.w > pos2.x &&\n pos1.y < pos2.y + size2.h && pos1.y + size1.h > pos2.y);\n}", "function intersect(pos1, size1, pos2, size2) {\n return (pos1.x < pos2.x + size2.w && pos1.x + size1.w > pos2.x &&\n pos1.y < pos2.y + size2.h && pos1.y + size1.h > pos2.y);\n}", "function intersectsPolygon(a, b) {\n var p = a;\n do {\n if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&\n intersects(p, p.next, a, b)) return true;\n p = p.next;\n } while (p !== a);\n\n return false;\n}", "function intersectsPolygon(a, b) {\n var p = a;\n do {\n if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&\n intersects(p, p.next, a, b)) return true;\n p = p.next;\n } while (p !== a);\n\n return false;\n}" ]
[ "0.7830384", "0.76907814", "0.76501125", "0.7638328", "0.7638328", "0.7638328", "0.7638328", "0.7638328", "0.75928366", "0.7586829", "0.7566629", "0.7566629", "0.7566629", "0.7566629", "0.7566629", "0.7566629", "0.7566629", "0.7566629", "0.7507798", "0.7495892", "0.7448045", "0.74312574", "0.7390408", "0.7382088", "0.73175895", "0.72639096", "0.72454727", "0.70247245", "0.70117164", "0.70117164", "0.69956416", "0.6983292", "0.6977638", "0.6912", "0.6903117", "0.6885853", "0.6822249", "0.673295", "0.67145264", "0.6632744", "0.6630375", "0.6624084", "0.658506", "0.6570463", "0.65554965", "0.65460074", "0.6530691", "0.6526623", "0.6512933", "0.6497411", "0.64772666", "0.64651465", "0.64538896", "0.6451725", "0.64411396", "0.6420738", "0.64046085", "0.6392523", "0.6386323", "0.6377971", "0.6377849", "0.6353668", "0.63441384", "0.6297942", "0.6297942", "0.6294615", "0.62898254", "0.6284494", "0.62780195", "0.6257656", "0.62391794", "0.62185913", "0.6180504", "0.61697716", "0.61693585", "0.61662924", "0.6152542", "0.6150979", "0.61503935", "0.61338985", "0.61326367", "0.6122701", "0.611175", "0.61103684", "0.6108141", "0.6107255", "0.60934436", "0.60934436", "0.60934436", "0.6091565", "0.6086286", "0.60860646", "0.6085551", "0.6085551", "0.6085111", "0.6085111", "0.60841525", "0.6077641" ]
0.7594002
10
Returns a new point that will have been moved to reside within the given rectangle
function constrainPoint(point, rect) { return { left: Math.min(Math.max(point.left, rect.left), rect.right), top: Math.min(Math.max(point.top, rect.top), rect.bottom) }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _movePointOnRectangleToPoint(rect, rectanglePoint, targetPoint) {\n var leftCornerXDifference = rectanglePoint.x - rect.left;\n var leftCornerYDifference = rectanglePoint.y - rect.top;\n return _moveTopLeftOfRectangleToPoint(rect, { x: targetPoint.x - leftCornerXDifference, y: targetPoint.y - leftCornerYDifference });\n }", "function _movePointOnRectangleToPoint(rect, rectanglePoint, targetPoint) {\n var leftCornerXDifference = rectanglePoint.x - rect.left;\n var leftCornerYDifference = rectanglePoint.y - rect.top;\n return _moveTopLeftOfRectangleToPoint(rect, { x: targetPoint.x - leftCornerXDifference, y: targetPoint.y - leftCornerYDifference });\n }", "function constrainPoint(point,rect){return{left:Math.min(Math.max(point.left,rect.left),rect.right),top:Math.min(Math.max(point.top,rect.top),rect.bottom)};}", "function constrainPoint(point, rect) {\n return {\n left: Math.min(Math.max(point.left, rect.left), rect.right),\n top: Math.min(Math.max(point.top, rect.top), rect.bottom)\n };\n }", "function constrainPoint(point, rect) {\n\treturn {\n\t\tleft: Math.min(Math.max(point.left, rect.left), rect.right),\n\t\ttop: Math.min(Math.max(point.top, rect.top), rect.bottom)\n\t};\n}", "function constrainPoint(point, rect) {\n\treturn {\n\t\tleft: Math.min(Math.max(point.left, rect.left), rect.right),\n\t\ttop: Math.min(Math.max(point.top, rect.top), rect.bottom)\n\t};\n}", "function constrainPoint(point, rect) {\n\treturn {\n\t\tleft: Math.min(Math.max(point.left, rect.left), rect.right),\n\t\ttop: Math.min(Math.max(point.top, rect.top), rect.bottom)\n\t};\n}", "function constrainPoint(point, rect) {\n\treturn {\n\t\tleft: Math.min(Math.max(point.left, rect.left), rect.right),\n\t\ttop: Math.min(Math.max(point.top, rect.top), rect.bottom)\n\t};\n}", "function constrainPoint(point, rect) {\n\treturn {\n\t\tleft: Math.min(Math.max(point.left, rect.left), rect.right),\n\t\ttop: Math.min(Math.max(point.top, rect.top), rect.bottom)\n\t};\n}", "function constrainPoint(point, rect) {\n\treturn {\n\t\tleft: Math.min(Math.max(point.left, rect.left), rect.right),\n\t\ttop: Math.min(Math.max(point.top, rect.top), rect.bottom)\n\t};\n}", "function constrainPoint(point, rect) {\n\treturn {\n\t\tleft: Math.min(Math.max(point.left, rect.left), rect.right),\n\t\ttop: Math.min(Math.max(point.top, rect.top), rect.bottom)\n\t};\n}", "function constrainPoint(point, rect) {\n\treturn {\n\t\tleft: Math.min(Math.max(point.left, rect.left), rect.right),\n\t\ttop: Math.min(Math.max(point.top, rect.top), rect.bottom)\n\t};\n}", "adhereToRect(rect) {\n if (!util.containsPoint(rect, this)) {\n this.x = Math.min(Math.max(this.x, rect.x), rect.x + rect.width);\n this.y = Math.min(Math.max(this.y, rect.y), rect.y + rect.height);\n }\n return this;\n }", "function constrainPoint(point, rect) {\n\t\treturn {\n\t\t\tleft: Math.min(Math.max(point.left, rect.left), rect.right),\n\t\t\ttop: Math.min(Math.max(point.top, rect.top), rect.bottom)\n\t\t};\n\t}", "function constrainPoint(point, rect) {\n return {\n left: Math.min(Math.max(point.left, rect.left), rect.right),\n top: Math.min(Math.max(point.top, rect.top), rect.bottom)\n };\n}", "function constrainPoint(point, rect) {\n return {\n left: Math.min(Math.max(point.left, rect.left), rect.right),\n top: Math.min(Math.max(point.top, rect.top), rect.bottom)\n };\n}", "function constrainPoint(point, rect) {\n return {\n left: Math.min(Math.max(point.left, rect.left), rect.right),\n top: Math.min(Math.max(point.top, rect.top), rect.bottom)\n };\n}", "function constrainPoint(point, rect) {\n return {\n left: Math.min(Math.max(point.left, rect.left), rect.right),\n top: Math.min(Math.max(point.top, rect.top), rect.bottom)\n };\n}", "function constrainPoint(point, rect) {\n return {\n left: Math.min(Math.max(point.left, rect.left), rect.right),\n top: Math.min(Math.max(point.top, rect.top), rect.bottom)\n };\n}", "function constrainPoint(point, rect) {\n return {\n left: Math.min(Math.max(point.left, rect.left), rect.right),\n top: Math.min(Math.max(point.top, rect.top), rect.bottom),\n };\n }", "function getCoordinate(event) {\n let ne = rectangle.getBounds().getNorthEast();\n let sw = rectangle.getBounds().getSouthWest();\n\n rightUpLat = ne.lat();\n rightUpLng = ne.lng();\n leftDownLat = sw.lat();\n leftDownLng = sw.lng();\n\n let rectangleLength = rightUpLng - leftDownLng;\n let rectangleWidth = rightUpLat - leftDownLat;\n let check = false;\n\n if (rectangleWidth > maxWidth) {\n\n let newBounds = {\n north: rightUpLat,\n south: rightUpLat - maxWidth + 0.02,\n east: rightUpLng,\n west: leftDownLng\n };\n\n rectangle.setBounds(newBounds);\n check = true;\n }\n\n if (rectangleLength > maxLength) {\n\n let newBounds = {\n north: rightUpLat,\n south: leftDownLat,\n east: rightUpLng,\n west: rightUpLng - maxLength + 0.02\n };\n\n rectangle.setBounds(newBounds);\n check = true;\n }\n\n\n if (check) {\n alert('Превышен максимальный размер области');\n }\n}", "function snap(old_pos,mouse_pos,location) {\n\n\tif (mouse_pos.subtract(location).magnitude()<.15)\n\t{\n\t\t// console.log(mouse_pos.subtract(location).magnitude()<.15)\n\t\treturn(location)\n\t}\n\telse\n\t{\n\t\t// console.log(old_pos)\n\t\treturn(old_pos)\n\t}\n\n}", "function pointInRectangle(p, r) {\n return p.x >= r.left && p.x <= r.right && p.y >= r.top && p.y <= r.bottom;\n}", "function moveActiveRectangle(x, y) {\n if (active == null)\n return;\n\n x = x - activatedX; // from the new coordinates subtract the original\n y = y - activatedY; // activation difference.\n positionRectangle(active, x, y);\n}", "addPoint(x, y) {\n // console.log('addpoint', x, y)\n this.xPoints[this.nPoints] = x\n this.yPoints[this.nPoints] = y\n this.nPoints++\n // Update bounding rectangle\n if (x < this.x1) this.x1 = x\n if (x > this.x2) this.x2 = x\n if (y < this.y1) this.y1 = y\n if (y > this.y2) this.y2 = y\n }", "boundPoint(good, bad) {\n const dx = good.x - bad.x\n const dy = good.y - bad.y\n const fixed = new Victor(bad.x, bad.y)\n let distance = 0\n\n if (bad.x < -this.sizeX || bad.x > this.sizeX) {\n if (bad.x < -this.sizeX) {\n // we are leaving the left\n fixed.x = -this.sizeX\n } else {\n // we are leaving the right\n fixed.x = this.sizeX\n }\n\n distance = (fixed.x - good.x) / dx\n fixed.y = good.y + distance * dy\n\n // We fixed x, but y might have the same problem, so we'll rerun this, with different points.\n return this.boundPoint(good, fixed)\n }\n\n if (bad.y < -this.sizeY || bad.y > this.sizeY) {\n if (bad.y < -this.sizeY) {\n // we are leaving the bottom\n fixed.y = -this.sizeY\n } else {\n // we are leaving the top\n fixed.y = this.sizeY\n }\n\n distance = (fixed.y - good.y) / dy\n fixed.x = good.x + distance * dx\n }\n\n return fixed\n }", "function positionRectangle(rect, x, y) {\n if (x >= 0 && x + rect.width <= canvas.width) {\n rect.left = x;\n rect.right = rect.left + rect.width;\n } else if (x < 0) {\n rect.left = 0;\n rect.right= rect.width;\n } else if (x + rect.width > canvas.width) {\n rect.left = canvas.width - rect.width;\n rect.right = canvas.width;\n }\n if (y >= 0 && y + rect.height <= canvas.height) {\n rect.top = y;\n rect.bottom = rect.top + rect.height;\n } else if (y < 0) {\n rect.top = 0;\n rect.bottom = rect.height;\n } else if (y + rect.height > canvas.height) {\n rect.top = canvas.height - rect.height;\n rect.bottom = canvas.height; \n }\n}", "function outFromUnderRobot(newX,newY){\r\n\tvar extrX = -((Math.round(newX/numPiecesX) * 2) - 1); //extracts from player/enemy towards centre\r\n\tvar extrY = -((Math.round(newY/numPiecesY) * 2) - 1);\r\n\twhile(\t\t\t\r\n\t\t\t(newX >= player.myX && newX < player.myX + player.width && newX >= player.myY && newX < player.myY + player.height)\r\n\t\t\t\r\n\t\t\t|| (newX >= enemy.myX && newX < enemy.myX + enemy.width && newX >= enemy.myY && newX < enemy.myY + enemy.height)\r\n\t\t){\r\n\t\tnewX += extrX;\r\n\t\tnewY += extrY; \r\n\t}\r\n\tif(gameGrid[newX] != undefined && gameGrid[newX][newY] != undefined && gameGrid[newX][newY] == 1)\r\n\t\treturn {newX,newY}\r\n\telse\r\n\t\treturn null;\r\n}", "function move2(rect){\n\t\tvar temp = rect.id;\n\t\tvar temp2 = temp.split(\"-\");\n\t\tvar row = parseInt(temp2[0]);\n\t\tvar col = parseInt(temp2[1]);\n\t\tvar dx = parseInt(emptyrow - row);\n\t\tvar dy = parseInt(emptycol - col);\n\t\tif(dx == 0){\n\t\t\tvar oldY = parseInt(window.getComputedStyle(rect).top);\n\t\t\trect.style.top = oldY + 100 * dy + \"px\";\n\t\t\temptycol = emptycol - dy;\n\t\t}else{\n\t\t\tvar oldX = parseInt(window.getComputedStyle(rect).left);\n\t\t\trect.style.left = oldX + 100 * dx + \"px\";\n\t\t\temptyrow = emptyrow - dx;\n\t\t}\n\t\tvar newrow = row + dx;\n\t\tvar newcol = col + dy;\n\t\trect.id = newrow + \"-\" + newcol;\n\t}", "function clipPoint(p1, p2, rect){\n var p = [p1.x - p2.x, p2.x - p1.x, p1.y - p2.y, p2.y - p1.y];\n var q = [p1.x - rect.left, rect.right - p1.x, p1.y - rect.top, rect.bottom - p1.y];\n \n var u1 = 0;\n var u2 = 1;\n d3.range(4).forEach(function(k){\n // Completely outside the rectangle\n if(p[k] == 0){\n if(q[k] < 0){ return null; }\n }\n else{\n var u = q[k] / p[k];\n // Outside -> inside\n if(p[k] < 0 && u1 < u){ u1 = u; }\n // Inside -> outside\n else if(p[k] > 0 && u2 > u){ u2 = u; }\n }\n });\n \n // Completely outside the rectangle\n if (u1 > u2){ return null; }\n \n // Return the clipping point of the line where it passes from inside\n // of the rectangle to the outside\n return {\n x: p1.x + (p[1] * u2), \n y: p1.y + (p[3] * u2),\n };\n }", "function point_in_rectangle(x, y, r){\n var inside = true;\n var nx = n_x(r.x, r.y, r.x+r.width, r.y);\n var ny = n_y(r.x, r.y, r.x+r.width, r.y);\n var distance = ((r.x - x) * nx + (r.y - y) * ny);\n if(distance > epsilon){\n inside = false;\n }\n nx = n_x(r.x+r.width, r.y, r.x+r.width, r.y+r.height);\n ny = n_y(r.x+r.width, r.y, r.x+r.width, r.y+r.height);\n distance = ((r.x+r.width - x) * nx + (r.y - y) * ny);\n if(distance > epsilon){\n inside = false;\n }\n nx = n_x(r.x+r.width, r.y+r.height, r.x, r.y+r.height);\n ny = n_y(r.x+r.width, r.y+r.height, r.x, r.y+r.height);\n distance = ((r.x+r.width - x) * nx + (r.y+r.height - y) * ny);\n if(distance > epsilon){\n inside = false;\n }\n nx = n_x(r.x, r.y+r.height, r.x, r.y);\n ny = n_y(r.x, r.y+r.height, r.x, r.y);\n distance = ((r.x - x) * nx + (r.y+r.height - y) * ny);\n if(distance > epsilon){\n inside = false;\n }\n return inside;\n}", "function handlePointChange(evt) {\n if(!rect) return\n\n const { pageX: x, pageY: y } = evt\n const { left, top, right, bottom, width } = rect\n\n const calc = numberScope(x, { min: left, max: right }) - left\n\n setPoint({ x: calc, y: 0 })\n setValue(calc / width)\n }", "handleSnapToPoint(props, { x, y }, source) {\n if (!source) {\n // Draw from top left to x, y\n return {\n x,\n y\n };\n } else {\n // Draw from source point to x, y with x, y matching top left of rectangle\n return {\n x,\n y,\n width: source.x - x,\n height: source.y - y\n };\n }\n // Snap the top left of this rectangle to x, y\n return {\n x,\n y,\n width: props.width + (props.x - x),\n height: props.height + (props.y - y)\n };\n }", "function pointToRect (point) {\n return { left: point.x, top: point.y, \n right: point.x, bottom: point.y };\n }", "function MoveRectangle(bounds) {\n rectangle.setMap(map); // Ensure it is visible if not\n rectangle.setBounds(bounds);\n}", "function move(p, v) {\n // Move rectangle along x axis\n for (var i = 0; i < world.boxes.length; i++) {\n var b = world.boxes[i];\n var c = box(vec2(p.pos.x + v.x * (v.x < 0), p.pos.y), vec2(p.size.x + Math.abs(v.x), p.size.y));\n if (c.overlaps(b)) {\n if (v.x < 0) v.x = b.pos.x + b.size.x - p.pos.x;\n else if (v.x > 0) v.x = b.pos.x - p.pos.x - p.size.x;\n }\n }\n p.pos.x += v.x;\n\n // Move rectangle along y axis\n for (var i = 0; i < world.boxes.length; i++) {\n var b = world.boxes[i];\n var c = box(vec2(p.pos.x, p.pos.y + v.y * (v.y < 0)), vec2(p.size.x, p.size.y + Math.abs(v.y)));\n if (c.overlaps(b)) {\n if (v.y < 0) v.y = b.pos.y + b.size.y - p.pos.y;\n else if (v.y > 0) v.y = b.pos.y - p.pos.y - p.size.y;\n }\n }\n p.pos.y += v.y;\n}", "function getRectCenter(rect){return{left:(rect.left+rect.right)/2,top:(rect.top+rect.bottom)/2};}", "function updateDrawingRectangleOfAPeer(oldRectangleObject, newRectangleObject) {\n oldRectangleObject.set({\n left: newRectangleObject.left,\n top: newRectangleObject.top,\n width: newRectangleObject.width,\n height: newRectangleObject.height\n });\n}", "move(x, y) {\n return this.x(x).y(y);\n }", "function getPosition(rect) {\r\n return {\r\n \"top\" : window.scrollY + Math.round(rect.top),\r\n \"right\" : Math.round(rect.left + rect.width),\r\n \"bottom\" : window.scrollY + Math.round(rect.top + rect.height),\r\n \"left\" : Math.round(rect.left),\r\n \"leftCenter\" : Math.round(rect.left + rect.width/2)\r\n };\r\n }", "boundedMove(move, bound) {\n this.x += move.x;\n this.y += move.y;\n if (this.x < bound.left) {\n this.x = bound.left;\n }\n if (this.x > bound.right) {\n this.x = bound.right;\n }\n if (this.y < bound.top) {\n this.y = bound.top;\n }\n if (this.y > bound.down) {\n this.y = bound.down;\n }\n }", "constrainTo(_rect) {\n if (this.x < _rect.left) {\n this.x = _rect.left;\n }\n if (this.y < _rect.top) {\n this.y = _rect.top;\n }\n if (this.x > _rect.right) {\n this.x = _rect.right;\n }\n if (this.y > _rect.bottom) {\n this.y = _rect.bottom;\n }\n return this;\n }", "function boundPoint(good, bad, size_x, size_y) {\n var dx = good.x - bad.x;\n var dy = good.y - bad.y;\n\n var fixed = Vertex(bad.x, bad.y);\n var distance = 0;\n if (bad.x < -size_x || bad.x > size_x) {\n if (bad.x < -size_x) {\n // we are leaving the left\n fixed.x = -size_x;\n } else {\n // we are leaving the right\n fixed.x = size_x;\n }\n distance = (fixed.x - good.x) / dx;\n fixed.y = good.y + distance * dy;\n // We fixed x, but y might have the same problem, so we'll rerun this, with different points.\n return boundPoint(good, fixed, size_x, size_y);\n }\n if (bad.y < -size_y || bad.y > size_y) {\n if (bad.y < -size_y) {\n // we are leaving the bottom\n fixed.y = -size_y;\n } else {\n // we are leaving the top\n fixed.y = size_y;\n }\n distance = (fixed.y - good.y) / dy;\n fixed.x = good.x + distance * dx;\n }\n return fixed;\n}", "function randomInsideRect(rect) {\r\n return new components_1.Vector(rect.x + randomRange(0, rect.width), rect.y + randomRange(0, rect.height));\r\n}", "function copyRect(rect) {\r\n return {\r\n left: rect.left,\r\n right: rect.right,\r\n top: rect.top,\r\n bottom: rect.bottom\r\n };\r\n}", "function move(p, vx, vy) {\n // Move rectangle along x axis\n for (var i = 0; i < rects.length; i++) {\n var c = { x: p.x + vx, y: p.y, w: p.w, h: p.h }\n if (overlapTest(c, rects[i])) {\n if (vx < 0) vx = rects[i].x + rects[i].w - p.x\n else if (vx > 0) vx = rects[i].x - p.x - p.w\n }\n }\n p.x += vx\n\n // Move rectangle along y axis\n for (var i = 0; i < rects.length; i++) {\n var c = { x: p.x, y: p.y + vy, w: p.w, h: p.h }\n if (overlapTest(c, rects[i])) {\n if (vy < 0) vy = rects[i].y + rects[i].h - p.y\n else if (vy > 0) vy = rects[i].y - p.y - p.h\n }\n }\n p.y += vy\n}", "function activateRectangle(x, y) {\n active = null;\n\n if (rectA.isPointInRectangle(x, y) && rectB.isPointInRectangle(x, y)) {\n if (lastActive != rectB) {\n active = rectA;\n } else {\n active = rectB;\n }\n } else if (rectA.isPointInRectangle(x, y)) {\n active = rectA;\n } else if (rectB.isPointInRectangle(x, y)) {\n active = rectB;\n }\n\n if (active != null) {\n activatedX = x - active.left;\n activatedY = y - active.top;\n }\n}", "translate(x,y) {\n return new Point({\n x: this.x + x,\n y: this.y + y\n })\n }", "move() {\n this.geometricMidpoint = this.setGeometricMidpoint();\n this.in.X = this.position.X - this.geometricMidpoint.X;\n this.in.Y = this.position.Y - this.geometricMidpoint.Y;\n }", "function getPosition(event) {\r\n\t\tposX = event.clientX;\r\n\t\tposY = event.clientY;\r\n\t\t$('#map-hover-box').css({\r\n\t\t\t'left': posX - ($('#map-hover-box').outerWidth(true) / 2),\r\n\t\t\t'top': posY + 15\r\n\t\t});\r\n\t}", "function pointRect(point, rect) {\n return (point.x >= rect.x && point.x <= rect.x + rect.w && point.y >= rect.y && point.y <= rect.y + rect.h);\n}", "move() \n\t{\n\t\tthis.raindrop.nudge(0,-1,0);\n\n\t\tif (this.raindrop.getY() <= this.belowplane ) \n\t\t{\n\t\t\t//setting the y value to a certain number\n\t\t\tthis.raindrop.setY(random(200,400))\n\t\t}\n\t}", "function moveCircleRight (){\n\nxpos = xpos + 30;\n\n}", "function rect1(rectX, rectY){\n rect(rectX, rectY, rectXX, rectYY, 20);\n\t}", "constrain() {\n if(this.pos.x + this.r > this.constrainX){ //if x_over\n this.pos.x = this.constrainX - this.r;\n }else if(this.pos.x - this.r < -this.constrainX){ //if x_under\n this.pos.x = -this.constrainX + this.r;\n }\n\n if(this.pos.y + this.r > this.constrainY){//if y_over\n this.pos.y = this.constrainY - this.r;\n }else if(this.pos.y - this.r < -this.constrainY){//if y_under\n this.pos.y = -this.constrainY + this.r;\n }\n\n }", "setStart(x, y){\n if (this.alive == false){\n this.x = x + 130;\n this.y = y + 17;\n }\n }", "function pointInsideRect(x,y,obj,countScreen = false){\r\n\tlet objX = obj.x;\r\n\tlet objY = obj.y;\r\n\tlet objW = obj.w;\r\n\tlet objH = obj.h;\r\n\t\r\n\tif (countScreen){\r\n\t\tobjX += screen.x;\r\n\t\tobjY += screen.y;\r\n\t}\r\n\t\r\n\tif (x > objX && y > objY &&\r\n\tx < objX + objW && y < objY + objH){\r\n\t\t\r\n\t\treturn true;\r\n\t\t\r\n\t}\r\n\treturn false;\r\n}", "function intersectRect(rect, p) {\n var cx = rect.x, cy = rect.y, dx = p.x - cx, dy = p.y - cy, w = rect.width / 2, h = rect.height / 2;\n\n if (dx == 0)\n return { \"x\": p.x, \"y\": rect.y + (dy > 0 ? h : -h) };\n\n var slope = dy / dx;\n\n var x0 = null, y0 = null;\n if (Math.abs(slope) < rect.height / rect.width) {\n // intersect with the left or right edges of the rect\n x0 = rect.x + (dx > 0 ? w : -w);\n y0 = cy + slope * (x0 - cx);\n } else {\n y0 = rect.y + (dy > 0 ? h : -h);\n x0 = cx + (y0 - cy) / slope;\n }\n\n return { \"x\": x0, \"y\": y0 };\n }", "moveTo(x, y) {\n this.params.x = x\n this.params.y = y\n this.updateParams()\n }", "move(event){\n this.xyE = this.getXY(event);\n }", "function getNewPosition(oldPos, direction) {\r\n switch (direction) {\r\n case \"west\":\r\n return [oldPos[0] - SPRITE_SIZE, oldPos[1]];\r\n case \"east\":\r\n return [oldPos[0] + SPRITE_SIZE, oldPos[1]];\r\n case \"north\":\r\n return [oldPos[0], oldPos[1] - SPRITE_SIZE];\r\n case \"south\":\r\n return [oldPos[0], oldPos[1] + SPRITE_SIZE];\r\n }\r\n }", "function determinePosition(x, y) {\n return new Point(x, y);\n}", "function syncPoint() {\n if(!rect) return\n setPoint({ x: _value * rect.width, y: 0 })\n }", "rtnStartPos() {\n this.x = this.plyrSrtPosX;\n this.y = this.plyrSrtPosY;\n}", "moveTo(x, y) {\n this.x = x;\n this.y = y;\n }", "function getPointForPosition(xscreen, yscreen) {\n // figure out the ratio of mouse position to the canvas, for x and y\n var xratio = xscreen / targetWidth;\n var yratio = yscreen / targetHeight;\n var x,y;\n if (fractalType==BURNING_SHIP) {\n // this is rendered so that x and y axis are mirrored\n x = xmax - (xmax - xmin) * xratio;\n y = ymin + (ymax - ymin) * yratio;\n } else {\n x = xmin + (xmax - xmin) * xratio;\n y = ymax - (ymax - ymin) * yratio;\n }\n return new Point(x, y);\n}", "function move(event) {\r\n if (createRect) {\r\n // create rectangle\r\n\r\n // get cursor location from SVG element\r\n var endX = event.layerX;\r\n var endY = event.layerY;\r\n\r\n // show ROI on selector\r\n var points_array = $(\"#poly\").attr('points').split(' ');\r\n var first_point = points_array[0].split(',');\r\n var points_of_poly = points_array[0] + ' ' + endX + ',' + first_point[1] + ' ' + endX + ',' + endY + ' ' + first_point[0] + ',' + endY;\r\n $('#poly').attr('points', points_of_poly)\r\n\r\n // allow doing mouse up event when doing moving event\r\n window.event.cancelBubble = true;\r\n window.event.returnValue = false;\r\n } else if (moveEndPoint) {\r\n // dragging handle\r\n\r\n // get cursor location from SVG element\r\n var newPoint = event.layerX + ',' + event.layerY\r\n \r\n // get current location of ROI\r\n var points_array = $(\"#poly\").attr('points').split(' ');\r\n\r\n // set new ROI by each dragged handle\r\n switch (obj.id) {\r\n case \"first_poly_point\":\r\n var points_of_poly = newPoint + ' ' + points_array[1] + ' ' + points_array[2] + ' ' + points_array[3];\r\n $('#poly').attr('points', points_of_poly)\r\n border($(\"#poly\"), 'add');\r\n break;\r\n case \"second_poly_point\":\r\n var points_of_poly = points_array[0] + ' ' + newPoint + ' ' + points_array[2] + ' ' + points_array[3];\r\n $('#poly').attr('points', points_of_poly)\r\n border($(\"#poly\"), 'add');\r\n break;\r\n case \"third_poly_point\":\r\n var points_of_poly = points_array[0] + ' ' + points_array[1] + ' ' + newPoint + ' ' + points_array[3];\r\n $('#poly').attr('points', points_of_poly)\r\n border($(\"#poly\"), 'add');\r\n break;\r\n case \"fourth_poly_point\":\r\n var points_of_poly = points_array[0] + ' ' + points_array[1] + ' ' + points_array[2] + ' ' + newPoint;\r\n $('#poly').attr('points', points_of_poly)\r\n border($(\"#poly\"), 'add');\r\n break;\r\n }\r\n }\r\n\r\n}", "function dragRect(event,d){\n //get mouse coordinates\n var xCoor = event.x;\n var yCoor = event.y;\n //set mouse coordinates on object\n d3.select(this)\n .attr(\"x\", xCoor)\n .attr(\"y\", yCoor);\n // put object on top\n this.parentNode.appendChild(this); // https://stackoverflow.com/a/18362953\n }", "getExactPoint(x, y) {\n for (let i = 0; i < this.circleArray.length; i++) {\n if (x > this.circleArray[i].x - 30 && x < this.circleArray[i].x + 30 && y > this.circleArray[i].y - 30 && y < this.circleArray[i].y + 30) {\n return {\n x: this.circleArray[i].x,\n y: this.circleArray[i].y\n }\n\n }\n }\n }", "function rectify(p1, p2, action){\n var dx = Math.abs(p2.x - p1.x)\n ,dy = Math.abs(p2.y - p1.y);\n\n if( action == 'y' ){\n p2.y = p1.y;\n return 'y';\n }\n else if(action == 'x'){\n p2.x = p1.x;\n return 'x';\n }\n\n if( dx > dy ){\n p2.y = p1.y;\n return 'y';\n }\n else{\n p2.x = p1.x;\n return 'x';\n }\n }", "move() {\n this.x = mouseX;\n this.y = mouseY;\n }", "function newPos(){\n //Triangle3: using triangle 1 sine, define triangle 3, side A will be the strike power (with correction)\n var triangle3A = strike * 6;\n var triangle3B = Math.round(sine1 * triangle3A,0);\n var triangle3C = Math.round(Math.pow(Math.pow(triangle3A,2)-Math.pow(triangle3B,2),0.5),0);\n\n //Define the new coordinates (newPosX and newPosY), depending on (if) which side mouse is pointing\n if (mousePosX > ballNewPosX){\n ballNewPosX = ballNewPosX - triangle3C - ballWidth/2;\n ballNewPosY = ballNewPosY + triangle3B - ballHeight/2;\n }\n if (mousePosX <= ballNewPosX){\n ballNewPosX = ballNewPosX + triangle3C - ballWidth/2;\n ballNewPosY = ballNewPosY + triangle3B - ballHeight/2;\n }\n}", "function getLocation(x, y) {\n return {\n x: (x - canvas.getBoundingClientRect().left) > 0 ? (x - canvas.getBoundingClientRect().left) : 0,\n y: (y - canvas.getBoundingClientRect().top) > 0 ? (y - canvas.getBoundingClientRect().top) : 0,\n }\n}", "move() {\n this.x += this.xdir * .5;\n this.y += this.ydir * .5;\n }", "rectanglePointCollision(x, y, loc, rectWidth, rectHeight) {\n if (this.inRange(x, loc.x, loc.x + rectWidth) && inRange(y, loc.y, loc.y + rectHeight)) {\n return true;\n }\n }", "function rectangle(y,x){\n right(90)\n forward(y);\n right(90);\n forward(x);\n right(90)\n forward(y)\n right(90)\n forward(x)\n}", "function _moveRectangleToAnchorRectangle(rect, rectSide, rectPercent, anchorRect, anchorSide, anchorPercent, gap) {\n if (gap === void 0) { gap = 0; }\n var rectTargetPoint = _getPointOnEdgeFromPercent(rect, rectSide, rectPercent);\n var anchorTargetPoint = _getPointOnEdgeFromPercent(anchorRect, anchorSide, anchorPercent);\n var positionedRect = _movePointOnRectangleToPoint(rect, rectTargetPoint, anchorTargetPoint);\n return _moveRectangleInDirection(positionedRect, gap, anchorSide);\n }", "function _moveRectangleToAnchorRectangle(rect, rectSide, rectPercent, anchorRect, anchorSide, anchorPercent, gap) {\n if (gap === void 0) { gap = 0; }\n var rectTargetPoint = _getPointOnEdgeFromPercent(rect, rectSide, rectPercent);\n var anchorTargetPoint = _getPointOnEdgeFromPercent(anchorRect, anchorSide, anchorPercent);\n var positionedRect = _movePointOnRectangleToPoint(rect, rectTargetPoint, anchorTargetPoint);\n return _moveRectangleInDirection(positionedRect, gap, anchorSide);\n }", "function moveCircleLeft (){\n\nxpos = xpos - 30;\n\n}", "function intoCoordSystem(cm, lineObj, rect, context) {\n if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) {\n var size = widgetHeight(lineObj.widgets[i]);\n rect.top += size; rect.bottom += size;\n }\n if (context == \"line\") return rect;\n if (!context) context = \"local\";\n var yOff = heightAtLine(cm, lineObj);\n if (context == \"local\") yOff += paddingTop(cm.display);\n else yOff -= cm.display.viewOffset;\n if (context == \"page\" || context == \"window\") {\n var lOff = getRect(cm.display.lineSpace);\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY());\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX());\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect;\n }", "function intoCoordSystem(cm, lineObj, rect, context) {\n if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) {\n var size = widgetHeight(lineObj.widgets[i]);\n rect.top += size; rect.bottom += size;\n }\n if (context == \"line\") return rect;\n if (!context) context = \"local\";\n var yOff = heightAtLine(cm, lineObj);\n if (context == \"local\") yOff += paddingTop(cm.display);\n else yOff -= cm.display.viewOffset;\n if (context == \"page\" || context == \"window\") {\n var lOff = getRect(cm.display.lineSpace);\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY());\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX());\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect;\n }", "function intoCoordSystem(cm, lineObj, rect, context) {\n if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) {\n var size = widgetHeight(lineObj.widgets[i]);\n rect.top += size; rect.bottom += size;\n }\n if (context == \"line\") return rect;\n if (!context) context = \"local\";\n var yOff = heightAtLine(cm, lineObj);\n if (context == \"local\") yOff += paddingTop(cm.display);\n else yOff -= cm.display.viewOffset;\n if (context == \"page\" || context == \"window\") {\n var lOff = getRect(cm.display.lineSpace);\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY());\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX());\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect;\n }", "function intoCoordSystem(cm, lineObj, rect, context) {\n if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) {\n var size = widgetHeight(lineObj.widgets[i]);\n rect.top += size; rect.bottom += size;\n }\n if (context == \"line\") return rect;\n if (!context) context = \"local\";\n var yOff = heightAtLine(cm, lineObj);\n if (context == \"local\") yOff += paddingTop(cm.display);\n else yOff -= cm.display.viewOffset;\n if (context == \"page\" || context == \"window\") {\n var lOff = getRect(cm.display.lineSpace);\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY());\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX());\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect;\n }", "newPosition(x, y)\n {\n this.x = x;\n this.y = y;\n }", "moveTo(x, y) {\n\n this.tr.x = x;\n this.tr.y = y;\n }", "function cloneOffsetRect(rect) {\n return {\n top: rect.top,\n left: rect.left,\n width: rect.width,\n height: rect.height\n };\n}", "setTarget(x, y) {\n this.targetX = x;\n this.targetY = y;\n //Check if the distance is a lot (40 min)\n //console.log(x - this.x);\n // this.setPosition(x, y);\n }", "function intersectRect(node, point) {\n var x = node.x;\n var y = node.y;\n var dx = point.x - x;\n var dy = point.y - y;\n var w = $(\"#\" + node.customId).attr('width') / 2;\n var h = $(\"#\" + node.customId).attr('height') / 2;\n var sx = 0,\n sy = 0;\n if (Math.abs(dy) * w > Math.abs(dx) * h) {\n // Intersection is top or bottom of rect.\n if (dy < 0) {\n h = -h;\n }\n sx = dy === 0 ? 0 : h * dx / dy;\n sy = h;\n } else {\n // Intersection is left or right of rect.\n if (dx < 0) {\n w = -w;\n }\n sx = w;\n sy = dx === 0 ? 0 : w * dy / dx;\n }\n return {\n x: x + sx,\n y: y + sy\n };\n}", "function intersectRect(node, point) {\n var x = node.x;\n var y = node.y;\n var dx = point.x - x;\n var dy = point.y - y;\n var w = $(\"#\" + node.customId).attr('width') / 2;\n var h = $(\"#\" + node.customId).attr('height') / 2;\n var sx = 0,\n sy = 0;\n if (Math.abs(dy) * w > Math.abs(dx) * h) {\n // Intersection is top or bottom of rect.\n if (dy < 0) {\n h = -h;\n }\n sx = dy === 0 ? 0 : h * dx / dy;\n sy = h;\n } else {\n // Intersection is left or right of rect.\n if (dx < 0) {\n w = -w;\n }\n sx = w;\n sy = dx === 0 ? 0 : w * dy / dx;\n }\n return {\n x: x + sx,\n y: y + sy\n };\n}", "function intoCoordSystem(cm, lineObj, rect, context) {\n if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) {\n var size = widgetHeight(lineObj.widgets[i]);\n rect.top += size; rect.bottom += size;\n }\n if (context == \"line\") return rect;\n if (!context) context = \"local\";\n var yOff = heightAtLine(cm, lineObj);\n if (context != \"local\") yOff -= cm.display.viewOffset;\n if (context == \"page\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (window.pageYOffset || (document.documentElement || document.body).scrollTop);\n var xOff = lOff.left + (window.pageXOffset || (document.documentElement || document.body).scrollLeft);\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect;\n }", "function intoCoordSystem(cm, lineObj, rect, context) {\n if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) {\n var size = widgetHeight(lineObj.widgets[i]);\n rect.top += size; rect.bottom += size;\n }\n if (context == \"line\") return rect;\n if (!context) context = \"local\";\n var yOff = heightAtLine(cm, lineObj);\n if (context != \"local\") yOff -= cm.display.viewOffset;\n if (context == \"page\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (window.pageYOffset || (document.documentElement || document.body).scrollTop);\n var xOff = lOff.left + (window.pageXOffset || (document.documentElement || document.body).scrollLeft);\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect;\n }", "function intoCoordSystem(cm, lineObj, rect, context) {\n if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) {\n var size = widgetHeight(lineObj.widgets[i]);\n rect.top += size; rect.bottom += size;\n }\n if (context == \"line\") return rect;\n if (!context) context = \"local\";\n var yOff = heightAtLine(cm, lineObj);\n if (context != \"local\") yOff -= cm.display.viewOffset;\n if (context == \"page\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (window.pageYOffset || (document.documentElement || document.body).scrollTop);\n var xOff = lOff.left + (window.pageXOffset || (document.documentElement || document.body).scrollLeft);\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect;\n }", "function transition_point(px, py, qx, qy, ly) {\n if (px == qx && py == qy)\n throw \"invalid: points are equal\";\n if (py == qy && px > qx)\n throw \"invalid: py == qy and px > qx\";\n let points = intersection_points(px, py, qx, qy, ly);\n if (py == qy)\n return points[0]; /* there should be only one */\n else if (py < qy)\n return points[0];\n else\n return points[1];\n}", "function snap_to( x, z ){\n\tmoved_piece.father_chess_info.lerp_to.x = board[ x ][ z ].position.x;\n\tmoved_piece.father_chess_info.lerp_to.z = board[ x ][ z ].position.z;\n\n\t//in case the square is occupied by an enemy piece - raise our chess piece in the 3D space, otherwise return to default height\n\tif( virtual_board[ x ][ z ].color != \"empty\" && !(x == moved_piece.father_chess_info.object.x && z == moved_piece.father_chess_info.object.z) ){\n\t\tvirtual_board[ x ][ z ].object.geometry.computeBoundingBox();\n\t\tmoved_piece.father_chess_info.lerp_to.y = virtual_board[ x ][ z ].object.geometry.boundingBox.max.y*10;\n\t} else {\n\t\tmoved_piece.father_chess_info.lerp_to.y = piece_height/2;\n\t}\n\n\t//if the mouse button is released now, this will be registered as the new square in the 'game' logic\n\tselected_move = { x: x, z: z };\n}", "function doesRectangleContainPoint(rect, point) {\n return (point.left >= rect.left && point.left <= (rect.left + rect.width))\n && (point.top >= rect.top && point.top <= (rect.top + rect.height));\n}", "_updatePosFromCenter() {\n let half = this._size.$multiply(0.5);\n this._topLeft = this._center.$subtract(half);\n this._bottomRight = this._center.$add(half);\n }", "function rectangle(width, height, x, y) {\n if (!_utils_Type__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"](x)) {\n x = 0;\n }\n if (!_utils_Type__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"](y)) {\n y = 0;\n }\n return moveTo({ x: x, y: y }) + lineTo({ x: x + width, y: y }) + lineTo({ x: x + width, y: y + height }) + lineTo({ x: x, y: y + height }) + closePath();\n}" ]
[ "0.7201602", "0.7201602", "0.68819237", "0.65519136", "0.6524093", "0.6524093", "0.6524093", "0.6524093", "0.6524093", "0.6524093", "0.6524093", "0.6524093", "0.6495272", "0.64936244", "0.6491237", "0.6491237", "0.6491237", "0.6491237", "0.6491237", "0.6420683", "0.6376799", "0.6176183", "0.611882", "0.6091575", "0.59695125", "0.59461516", "0.588856", "0.5871666", "0.58305365", "0.582926", "0.5828782", "0.5815192", "0.5783767", "0.5744289", "0.57345134", "0.5711201", "0.56141543", "0.56032366", "0.5590667", "0.55822814", "0.5542772", "0.5533229", "0.55291784", "0.55207026", "0.5509032", "0.5508151", "0.5506057", "0.54997927", "0.5485366", "0.54836065", "0.54821557", "0.5474074", "0.54727507", "0.54709816", "0.5468564", "0.54641885", "0.5462223", "0.54588634", "0.54486036", "0.54485327", "0.5446692", "0.54318863", "0.5431289", "0.5413343", "0.5399254", "0.538658", "0.5381134", "0.5377357", "0.53537047", "0.53533465", "0.53513783", "0.53512114", "0.53451157", "0.53443134", "0.53411543", "0.5333687", "0.5332917", "0.5332917", "0.5331156", "0.5331104", "0.5331104", "0.5331104", "0.5331104", "0.53301", "0.53296506", "0.53284794", "0.53209704", "0.5315758", "0.5315758", "0.5305164", "0.5305164", "0.5305164", "0.5295763", "0.5286858", "0.5285351", "0.5279901", "0.527658" ]
0.6418015
22
Returns a point that is the center of the given rectangle
function getRectCenter(rect) { return { left: (rect.left + rect.right) / 2, top: (rect.top + rect.bottom) / 2 }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRectCenter(rect){return{left:(rect.left+rect.right)/2,top:(rect.top+rect.bottom)/2};}", "function computeCenter(rect) {\n return {\n top: rect.top + (rect.height / 2),\n left: rect.left + (rect.width / 2)\n };\n}", "function getRectCenter(rect) {\n return {\n left: (rect.left + rect.right) / 2,\n top: (rect.top + rect.bottom) / 2\n };\n}", "function getRectCenter(rect) {\n return {\n left: (rect.left + rect.right) / 2,\n top: (rect.top + rect.bottom) / 2\n };\n}", "function getRectCenter(rect) {\n return {\n left: (rect.left + rect.right) / 2,\n top: (rect.top + rect.bottom) / 2\n };\n}", "function getRectCenter(rect) {\n return {\n left: (rect.left + rect.right) / 2,\n top: (rect.top + rect.bottom) / 2\n };\n}", "function getRectCenter(rect) {\n return {\n left: (rect.left + rect.right) / 2,\n top: (rect.top + rect.bottom) / 2\n };\n}", "function getRectCenter(rect) {\n return {\n left: (rect.left + rect.right) / 2,\n top: (rect.top + rect.bottom) / 2\n };\n }", "function getRectCenter(rect) {\n\treturn {\n\t\tleft: (rect.left + rect.right) / 2,\n\t\ttop: (rect.top + rect.bottom) / 2\n\t};\n}", "function getRectCenter(rect) {\n\treturn {\n\t\tleft: (rect.left + rect.right) / 2,\n\t\ttop: (rect.top + rect.bottom) / 2\n\t};\n}", "function getRectCenter(rect) {\n\treturn {\n\t\tleft: (rect.left + rect.right) / 2,\n\t\ttop: (rect.top + rect.bottom) / 2\n\t};\n}", "function getRectCenter(rect) {\n\treturn {\n\t\tleft: (rect.left + rect.right) / 2,\n\t\ttop: (rect.top + rect.bottom) / 2\n\t};\n}", "function getRectCenter(rect) {\n\treturn {\n\t\tleft: (rect.left + rect.right) / 2,\n\t\ttop: (rect.top + rect.bottom) / 2\n\t};\n}", "function getRectCenter(rect) {\n\treturn {\n\t\tleft: (rect.left + rect.right) / 2,\n\t\ttop: (rect.top + rect.bottom) / 2\n\t};\n}", "function getRectCenter(rect) {\n\treturn {\n\t\tleft: (rect.left + rect.right) / 2,\n\t\ttop: (rect.top + rect.bottom) / 2\n\t};\n}", "function getRectCenter(rect) {\n\treturn {\n\t\tleft: (rect.left + rect.right) / 2,\n\t\ttop: (rect.top + rect.bottom) / 2\n\t};\n}", "function getRectCenter(rect) {\n return {\n left: (rect.left + rect.right) / 2,\n top: (rect.top + rect.bottom) / 2,\n };\n }", "function getRectCenter(rect) {\n\t\treturn {\n\t\t\tleft: (rect.left + rect.right) / 2,\n\t\t\ttop: (rect.top + rect.bottom) / 2\n\t\t};\n\t}", "function getRectCenterOffset(rect) {\n return { x: rect.width / 2, y: rect.height / 2 };\n }", "findCenter() {\n return {\n x: (this.right - this.left)/2 + this.left,\n y: (this.bottom - this.top)/2 + this.top\n };\n }", "function getCenter(boundingRect) {\n return {\n 'x': boundingRect.x + ((boundingRect.right - boundingRect.left) / 2),\n 'y': boundingRect.y + ((boundingRect.bottom - boundingRect.top) / 2),\n };\n}", "function getCenter(a, b) {\n return {\n x: (b.x + a.x) / 2,\n y: (b.y + a.y) / 2\n };\n}", "getCenter(){\n\t\treturn {\n\t\t\tx: 2,\n\t\t\ty: 2\n\t\t};\n\t}", "function getCenterPoint() {\n var p = root.createSVGPoint();\n // center of 1024, 768\n p.x = 512;\n p.y = 384;\n return p;\n}", "function getCenterXY() {\r\n\t\tvar sets = $['mapsettings'];\r\n\t\tvar $this = sets.element;\r\n\t\tvar centerx = ($this.innerWidth()/2)-parseInt($('#inner').css('left'));\r\n\t\tvar centery = ($this.innerHeight()/2)-parseInt($('#inner').css('top'));\r\n\t\treturn new Point(centerx,centery);\r\n\t}", "circumcenter(ax, ay, bx, by, cx, cy) \n {\n bx -= ax;\n by -= ay;\n cx -= ax;\n cy -= ay;\n\n var bl = bx * bx + by * by;\n var cl = cx * cx + cy * cy;\n\n var d = bx * cy - by * cx;\n\n var x = (cy * bl - by * cl) * 0.5 / d;\n var y = (bx * cl - cx * bl) * 0.5 / d;\n\n return {\n x: ax + x,\n y: ay + y\n };\n }", "center(x, y) {\n return this.cx(x).cy(y);\n }", "getCenterPoint() {\n return this.getIntermediatePoint(0.5);\n }", "function getCenterOfUnitDrawing(unit) {\n return {\n x:unit.drawingX + unit.pixelWidth / 2,\n y:unit.drawingY + unit.pixelHeight / 2\n };\n}", "function computePositionToCenterAreaInBounds(area, bounds) {\n var boundsCenter = computeCenter(bounds);\n return {\n top: boundsCenter.top - (area.height / 2),\n left: boundsCenter.left - (area.width / 2)\n };\n}", "getCenterX() {\n return this.x + this.width/2\n }", "function centerGraphic(rect, boundingRect) {\n\t // Set rect to center, keep width / height ratio.\n\t var aspect = boundingRect.width / boundingRect.height;\n\t var width = rect.height * aspect;\n\t var height;\n\t\n\t if (width <= rect.width) {\n\t height = rect.height;\n\t } else {\n\t width = rect.width;\n\t height = width / aspect;\n\t }\n\t\n\t var cx = rect.x + rect.width / 2;\n\t var cy = rect.y + rect.height / 2;\n\t return {\n\t x: cx - width / 2,\n\t y: cy - height / 2,\n\t width: width,\n\t height: height\n\t };\n\t }", "function boundingBoxCenter(polygon) {\n var result = [];\n var x = polygon.left + 0.5*polygon.width;\n var y = polygon.top - 0.5*polygon.height;\n result = [x, y];\n return result; \n}", "get center(): _Point {\n return Point(\n this.position.x + this.width / 2,\n this.position.y + this.height / 2\n )\n }", "normalizeToCenter( point, el, callback ) {\n\t\t\tlet result = new Three.Vector2();\n\t\t\tresult.x = ( point.x / el.clientWidth ) * 2 - 1;\n\t\t\tresult.y = -( point.y / el.clientHeight ) * 2 + 1;\n\t\t\tif ( typeof callback === \"function\" ) {\n\t\t\t\tcallback( result );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn result;\n\t\t}", "function getCenterCoordinates() {\n return {\n x: getXAverage(),\n y: getYAverage()\n }\n }", "function getTriangleCenter(x,y,size) {\n return {\n x: Math.floor((x + x+size + x) / 3),\n y: Math.floor((y + y+size + y+size) / 3)\n }\n}", "function centerGraphic(rect, boundingRect) {\n // Set rect to center, keep width / height ratio.\n var aspect = boundingRect.width / boundingRect.height;\n var width = rect.height * aspect;\n var height;\n\n if (width <= rect.width) {\n height = rect.height;\n } else {\n width = rect.width;\n height = width / aspect;\n }\n\n var cx = rect.x + rect.width / 2;\n var cy = rect.y + rect.height / 2;\n return {\n x: cx - width / 2,\n y: cy - height / 2,\n width: width,\n height: height\n };\n}", "getCenter(){\n\t\tlet element = this.element;\n\t\tlet to_ret = {};\n\t\tto_ret.x = this.getDivXRange().reduce((a,b) => a+b) / 2.; // take the average of the length-two array <range>\n\t\tto_ret.y = this.getDivYRange().reduce((a,b) => a+b) / 2.;\n\t\treturn to_ret;\n\t}", "getCenterPosition() {\n\t\tlet center = this.getCenter();\n\t\treturn {\n\t\t\tx: this.x + center.x,\n\t\t\ty: this.y + center.y\n\t\t};\n\t}", "getCenterPoint() {\n var x1 = this.point1.getX();\n var y1 = this.point1.getY();\n var x2 = this.point2.getX();\n var y2 = this.point2.getY();\n var centerX = (x1 - x2) / 2 + x2;\n var centerY = (y1 - y2) / 2 + y2;\n return new Point2D({x: centerX, y: centerY});\n }", "function centerCoordinates(xy){\n for (var i = 0; i < xy.length; i++){\n xy[i][0] = xy[i][0] + width/2;\n xy[i][1] = xy[i][1] + height/2;\n }\n return xy;\n}", "function calcMidpoint(x1, y1, x2, y2) {\n return {\n x: (x1 + x2)/2,\n y: (y1 + y2)/2\n };\n}", "function getCenter(points) {\n var center = {x: 0, y: 0};\n for (var i =0; i < points.length; ++i ) {\n center.x += points[i].x;\n center.y += points[i].y;\n }\n center.x /= points.length;\n center.y /= points.length;\n return center;\n}", "function _centerEdgeToPoint(rect, edge, point) {\n var positiveEdge = _getFlankingEdges(edge).positiveEdge;\n var elementMiddle = _getCenterValue(rect, edge);\n var distanceToMiddle = elementMiddle - _getEdgeValue(rect, positiveEdge);\n return _moveEdge(rect, positiveEdge, point - distanceToMiddle);\n}", "function _centerEdgeToPoint(rect, edge, point) {\n var positiveEdge = _getFlankingEdges(edge).positiveEdge;\n var elementMiddle = _getCenterValue(rect, edge);\n var distanceToMiddle = elementMiddle - _getEdgeValue(rect, positiveEdge);\n return _moveEdge(rect, positiveEdge, point - distanceToMiddle);\n}", "function getPixelCenter(x, y) {\n\tvar pixelX = x*(canvas.width/grid.x)+((canvas.width/grid.x)/2);\n\tvar pixelY = y*(canvas.height/grid.y)+((canvas.height/grid.y)/2);\n\treturn {\"x\": pixelX, \"y\": pixelY};\n}", "function intersectRectCenter(x1,y1,w1,h1,x2,y2,w2,h2) {\n\treturn {\"x\" : .5*((w1 + w2) - Math.abs(x1 - x2) * 2),\n \"y\" : .5*((h1 + h2) - Math.abs(y1 - y2) * 2)};\n}", "function getCenter(points) {\n var center = {\n x: 0,\n y: 0\n };\n\n for (var i = 0; i < points.length; ++i) {\n center.x += points[i].x;\n center.y += points[i].y;\n }\n\n center.x /= points.length;\n center.y /= points.length;\n return center;\n }", "function getCanvasCentrePosition() {\n\tvar canvas = document.getElementById(\"myCanvas\");\n\n\treturn {\n\t\tx: canvas.width / 2,\n\t\ty: canvas.height / 2\n\t};\n}", "get mid_x() { //center of x position\n return this.x + this.w / 2;\n }", "function getCenter(points) {\n var center = {x: 0, y: 0};\n for (var i =0; i < points.length; ++i ) {\n center.x += points[i].x;\n center.y += points[i].y;\n }\n center.x /= points.length;\n center.y /= points.length;\n return center;\n }", "function getCenter(points) {\n var center = { x: 0, y: 0 };\n for (var i = 0; i < points.length; ++i) {\n center.x += points[i].x;\n center.y += points[i].y;\n }\n center.x /= points.length;\n center.y /= points.length;\n return center;\n }", "function getCenter(points) {\n var center = { x: 0, y: 0 };\n for (var i = 0; i < points.length; ++i) {\n center.x += points[i].x;\n center.y += points[i].y;\n }\n center.x /= points.length;\n center.y /= points.length;\n return center;\n }", "get centerPoint() {\n return {\n type : 'Point',\n geometry : {\n coordinates : this.center\n }\n };\n }", "function getCenterX()/*:Number*/ {\n return this.getLeftX() + this.getMyWidth() / 2;\n }", "function getCenter(points) {\n\t var center = {\n\t x: 0,\n\t y: 0\n\t };\n\n\t for (var i = 0; i < points.length; ++i) {\n\t center.x += points[i].x;\n\t center.y += points[i].y;\n\t }\n\n\t center.x /= points.length;\n\t center.y /= points.length;\n\t return center;\n\t}", "function calculateCenter (array) {\n \n var x = 0, y = 0;\n\n array.forEach(function(point){\n x += point.x;\n y += point.y;\n });\n\n x = x / array.length;\n y = y / array.length;\n\n return {x: x,y: y};\n\n}", "get center() {\r\n return {\r\n x: this.x + this.width / 2,\r\n y: this.y + this.height / 2\r\n }\r\n }", "get center() {\n return {\n x: this.width / 2,\n y: this.height / 2\n };\n }", "function getMiddlePoint(p1, p2) {\n return createVector((p1.x + p2.x) / 2, (p1.y + p2.y) / 2);\n}", "function center(iv: Interval) {\n return Math.floor((iv.stop + iv.start) / 2);\n }", "_getCenterCoordinates() {\n const that = this,\n offset = that.$.container.getBoundingClientRect(),\n radius = that._measurements.radius,\n scrollLeft = document.body.scrollLeft || document.documentElement.scrollLeft,\n scrollTop = document.body.scrollTop || document.documentElement.scrollTop;\n return { x: offset.left + scrollLeft + radius, y: offset.top + scrollTop + radius };\n }", "function get_center(feature,layer){\n var center =(layer.getBounds().getCenter());\n return center;\n\n}", "function selectedCenter() {\n var sel = $(svgRoot).find('.selected').closest('g');\n if ( sel.length > 0 && ! sel.hasClass('dragging') ) {\n var rect = sel[0].getBBox();\n if ( rect.width == 0 && rect.height == 0 )\n return;\n return { x: rect.x + 0.5*rect.width, y: rect.y + 0.5*rect.height };\n }\n else\n return self.util.mouseCoords;\n }", "_getCenter(o, dimension, axis) {\n if (o.anchor !== undefined) {\n if (o.anchor[axis] !== 0) {\n return 0;\n } else {\n return dimension / 2;\n }\n } else {\n return dimension; \n }\n }", "function center(left, top, width, height) {\r\n if (width == null && height == null) {\r\n width = left;\r\n height = top;\r\n top = 0;\r\n left = 0;\r\n }\r\n\r\n return [left + (width / 2), top + (height / 2)];\r\n}", "function centroid(){\n var xc = 0;\n var yc = 0;\n for(var i = 0; i < conHull.length; i++){\n xc += conHull[i].x;\n yc += conHull[i].y;\n }\n xc = xc/conHull.length;\n yc = yc/conHull.length;\n return {\n x: xc,\n y: yc\n };\n}", "normalizeCenter( input, el ) {\n\t\t\treturn new Three.Vector2(\n\t\t\t\t( input.x / el.clientWidth ) * 2 - 1,\n\t\t\t\t-( input.y / el.clientHeight ) * 2 + 1\n\t\t\t);\n\t\t}", "getCenter() {\n let point = L.CRS.EPSG3857.latLngToPoint(this.map.getCenter(), this.map.getZoom());\n let rMap = document.getElementById(this.id);\n if (rMap.clientWidth > rMap.clientHeight) {\n point.x -= this.map.getSize().x * 0.15;\n } else {\n //point.y += this.map.getSize().y * 0.15;\n }\n let location = L.CRS.EPSG3857.pointToLatLng(point, this.map.getZoom());\n return location;\n }", "function mouseToCenter(){\n return dist(mouseX, mouseY, center.x, center.y);\n}", "get positionCentre()\n {\n return new Vector2D(\n this.position.x + this.#width/2,\n this.position.y + this.#height/2\n );\n }", "getPositionFromCenter(e) {\n const { boxCenterPoint } = this.state;\n const fromBoxCenter = {\n x: e.clientX - boxCenterPoint.x,\n y: -(e.clientY - boxCenterPoint.y)\n };\n return fromBoxCenter;\n }", "function getCenterPoint(points) {\n return [0, 1].map(function (i) {\n return average(points.map(function (pos) {\n return pos[i];\n }));\n });\n }", "_getCenter(o, dimension, axis) {\n if (o.anchor !== undefined) {\n if (o.anchor[axis] !== 0) {\n return 0;\n }\n else {\n //console.log(o.anchor[axis])\n return dimension / 2;\n }\n }\n else {\n return dimension;\n }\n }", "function _getCenterValue(rect, edge) {\n var edges = _getFlankingEdges(edge);\n return (_getEdgeValue(rect, edges.positiveEdge) + _getEdgeValue(rect, edges.negativeEdge)) / 2;\n}", "function _getCenterValue(rect, edge) {\n var edges = _getFlankingEdges(edge);\n return (_getEdgeValue(rect, edges.positiveEdge) + _getEdgeValue(rect, edges.negativeEdge)) / 2;\n}", "getCenter() {\n return this._center;\n }", "function calculateCenter(){\n center = map.getCenter();\n }", "function get_touchcenter(event) {\n\tx = (event.originalEvent.touches[0].clientX + event.originalEvent.touches[1].clientX)/2;\n\ty = (event.originalEvent.touches[0].clientY + event.originalEvent.touches[1].clientY)/2;\n\treturn new Seadragon.Point(x,y);\n}", "get Center() {}", "get Center() { return [this.x1 + (0.5 * this.x2 - this.x1), this.y1 + (0.5 * this.y2 - this.y1)]; }", "get Center() { return [this.x1 + (0.5 * this.x2 - this.x1), this.y1 + (0.5 * this.y2 - this.y1)]; }", "function center(iv) {\n return Math.floor((iv.stop + iv.start) / 2);\n }", "getCenterX() {\n return this.x;\n }", "getCenterX() {\n return this.x;\n }", "getCenterX() {\n return this.x;\n }", "putCenter(b, xOffset = 0, yOffset = 0) { \n let a = this\n b.x = (a.x + a.halfWidth - b.halfWidth) + xOffset \n b.y = (a.y + a.halfHeight - b.halfHeight) + yOffset \n }", "function calculateCenter() {\n center = map.getCenter();\n}", "function getDivCenter(obj) {\n var pos = new esri.geometry.Point();\n pos.spatialReference = map.spatialReference;\n // divHeight = obj.style.height;\n // divWidth = obj.style.width;\n // pos.y = parseInt(divHeight.substr(0, divHeight.length)) / 2;\n // pos.x = parseInt(divWidth.substr(0, divWidth.length)) / 2;\n pos.y = obj.offsetHeight / 2;\n pos.x = obj.offsetWidth / 2;\n return pos;\n}", "function centerElement(el, x, y) {\n let bounds = el.getBoundingClientRect();\n x = x - bounds.width / 2;\n y = y - bounds.height / 2;\n el.style.left = x + 'px';\n el.style.top = y + 'px';\n}", "function getCenter(d, projection) {\n var center = projection(d3.geoCentroid(d));\n\n // Add necessary special casing here.\n return center;\n}", "function getCenter(d, projection) {\n var center = projection(d3.geoCentroid(d));\n\n // Add necessary special casing here.\n return center;\n}", "getCenter() {\n return this.state[CIRCLE].getCenter()\n }", "function getMapCenter() {\n \n var mapCenterCoords = [30, 0];\n\n return mapCenterCoords;\n \n}", "function midpoint(a, b) {\n return new Vec2( (a.x+b.x)/2.0, (a.y+b.y)/2.0 );\n}", "function calculateCenter() {\r\n center = map.getCenter();\r\n}" ]
[ "0.76871496", "0.7517487", "0.73158824", "0.73158824", "0.73158824", "0.73158824", "0.73158824", "0.7304731", "0.7200921", "0.7200921", "0.7200921", "0.7200921", "0.7200921", "0.7200921", "0.7200921", "0.7200921", "0.7182221", "0.7140653", "0.7130934", "0.7116732", "0.7073354", "0.7069315", "0.7012293", "0.6989789", "0.68997824", "0.67826587", "0.675524", "0.6752698", "0.6707267", "0.67001593", "0.6678593", "0.6665445", "0.66563034", "0.66399145", "0.66284716", "0.6624015", "0.6618278", "0.6590505", "0.6585902", "0.65664995", "0.6557486", "0.65389436", "0.6535221", "0.65069544", "0.64946026", "0.64946026", "0.6465579", "0.64569974", "0.6456096", "0.64423954", "0.64399505", "0.64369994", "0.6428465", "0.6428465", "0.6422967", "0.6403487", "0.6399087", "0.6396223", "0.63682586", "0.6337816", "0.6324862", "0.6316611", "0.6309465", "0.6294634", "0.6290081", "0.62785953", "0.6273646", "0.62676454", "0.62607074", "0.62499654", "0.6244817", "0.6221242", "0.6216624", "0.61990964", "0.6177602", "0.6177299", "0.6177299", "0.6177191", "0.61742914", "0.6166778", "0.6132597", "0.6130511", "0.6130511", "0.61281294", "0.61104155", "0.61104155", "0.61104155", "0.61001027", "0.6086536", "0.6064181", "0.60613346", "0.60444796", "0.60444796", "0.6043083", "0.6032624", "0.60307807", "0.60174555" ]
0.7206926
10
Subtracts point2's coordinates from point1's coordinates, returning a delta
function diffPoints(point1, point2) { return { left: point1.left - point2.left, top: point1.top - point2.top }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function diffPoints(point1,point2){return{left:point1.left-point2.left,top:point1.top-point2.top};}", "function diffPoints(point1, point2) {\n return {\n left: point1.left - point2.left,\n top: point1.top - point2.top,\n };\n }", "function diffPoints(point1, point2) {\n return {\n left: point1.left - point2.left,\n top: point1.top - point2.top\n };\n }", "function disatnceBetweenPoints(p1, p2) {\n var dx = p2.x - p1.x;\n var dy = p2.y - p1.y;\n var dist = Math.sqrt(dx * dx + dy * dy);\n return dist;\n}", "function diffPoints(point1, point2) {\n return {\n left: point1.left - point2.left,\n top: point1.top - point2.top\n };\n}", "function diffPoints(point1, point2) {\n return {\n left: point1.left - point2.left,\n top: point1.top - point2.top\n };\n}", "function diffPoints(point1, point2) {\n return {\n left: point1.left - point2.left,\n top: point1.top - point2.top\n };\n}", "function diffPoints(point1, point2) {\n return {\n left: point1.left - point2.left,\n top: point1.top - point2.top\n };\n}", "function diffPoints(point1, point2) {\n return {\n left: point1.left - point2.left,\n top: point1.top - point2.top\n };\n}", "function diffPoints(point1, point2) {\n\t\treturn {\n\t\t\tleft: point1.left - point2.left,\n\t\t\ttop: point1.top - point2.top\n\t\t};\n\t}", "function diffPoints(point1, point2) {\n\treturn {\n\t\tleft: point1.left - point2.left,\n\t\ttop: point1.top - point2.top\n\t};\n}", "function diffPoints(point1, point2) {\n\treturn {\n\t\tleft: point1.left - point2.left,\n\t\ttop: point1.top - point2.top\n\t};\n}", "function diffPoints(point1, point2) {\n\treturn {\n\t\tleft: point1.left - point2.left,\n\t\ttop: point1.top - point2.top\n\t};\n}", "function diffPoints(point1, point2) {\n\treturn {\n\t\tleft: point1.left - point2.left,\n\t\ttop: point1.top - point2.top\n\t};\n}", "function diffPoints(point1, point2) {\n\treturn {\n\t\tleft: point1.left - point2.left,\n\t\ttop: point1.top - point2.top\n\t};\n}", "function diffPoints(point1, point2) {\n\treturn {\n\t\tleft: point1.left - point2.left,\n\t\ttop: point1.top - point2.top\n\t};\n}", "function diffPoints(point1, point2) {\n\treturn {\n\t\tleft: point1.left - point2.left,\n\t\ttop: point1.top - point2.top\n\t};\n}", "function diffPoints(point1, point2) {\n\treturn {\n\t\tleft: point1.left - point2.left,\n\t\ttop: point1.top - point2.top\n\t};\n}", "subtract(x, y) {\n if (arguments.length === 1 && x.hasAncestor && x.hasAncestor(HPoint)) {\n return new HPoint(this.x - x.x, this.y - x.y);\n }\n else if (arguments.length === 1 && x instanceof Array && x.length === 2) {\n return new HPoint(this.x - x[0], this.y - x[1]);\n }\n else if (arguments.length === 2) {\n return new HPoint(this.x - x, this.y - y);\n }\n else {\n throw new Error('HPoint#subtract: Invalid arguments.');\n }\n }", "function subtraction(p1, p2) {\n return p1 - p2;\n}", "function delta(relative, vertex1, vertex2)\n{\n return relative ? vertex2 : vertex2 - vertex1;\n}", "function disPoint(x1,y1,x2,y2){\n var distanceX=Math.pow((x1-x2),2)\n var distanceY=Math.pow((y1-y2),2)\n return Math.sqrt(distanceX+distanceY);\n \n}", "static Subtract(vec1, vec2) {\n vec1 = new Vec2(vec1);\n vec2 = new Vec2(vec2);\n return new Vec2(vec1.x - vec2.x, vec1.y - vec2.y);\n }", "substract(x,y){\n let point = new Point(x,y); //this will handle the 'x' being numbers, array, a simple object, or another Point \n this.x -= point.x;\n this.y -= point.y;\n return this;\n }", "function distance (point1, point2) {\n var deltaX = point1[0] - point2[0]\n var deltaY = point1[1] - point2[1]\n\n var deltaXSquared = Math.pow(deltaX, 2)\n var deltaYSquared = Math.pow(deltaY, 2)\n\n var answer = Math.sqrt(deltaXSquared + deltaYSquared)\n return answer\n}", "function getDistance(point1, point2) {\n return Math.pow(point1.x - point2.x, 2) + Math.pow(point1.y - point2.y, 2);\n}", "function diff(v1, v2) {\n return {\n x: v1.x - v2.x,\n y: v1.y - v2.y\n };\n}", "function sub( p0, p1 ) {\n return {x: p0.x - p1.x, y: p0.y - p1.y};\n}", "function distance(point1, point2) {\n return Math.hypot(point1.x-point2.x, point1.y-point2.y);\n}", "function calculateDistance(point1, point2) {\n\treturn Math.sqrt(Math.pow((point1.x - point2.x), 2) + Math.pow((point1.y - point2.y), 2));\n}", "function distance(point1, point2) {\n var xDiff = point2.cx - point1.cx;\n var\tyDiff = point2.cy - point1.cy;\n return Math.sqrt( xDiff*xDiff + yDiff*yDiff);\n}", "function subtract (x,y){\n return x-y;\n}", "function distance(p1, p2) {\n var firstPoint;\n var secondPoint;\n var theXs;\n var theYs;\n var result;\n\n firstPoint = new createjs.Point();\n secondPoint = new createjs.Point();\n\n firstPoint.x = p1.x;\n firstPoint.y = p1.y;\n\n secondPoint.x = p2.x;\n secondPoint.y = p2.y;\n\n theXs = secondPoint.x - firstPoint.x;\n theYs = secondPoint.y - firstPoint.y;\n\n theXs = theXs * theXs;\n theYs = theYs * theYs;\n\n result = Math.sqrt(theXs + theYs);\n\n return result;\n}", "static distance(p1, p2) {\n const dx = (p1.x - p2.x);\n const dy = (p1.y - p2.y);\n return Math.sqrt(dx * dx + dy * dy);\n }", "distanceBetweenPoints(p1, p2) {\n const dx = Math.abs(p1.x - p2.x),\n dy = Math.abs(p1.y - p2.y);\n return Math.sqrt((dx * dx) + (dy * dy));\n }", "function getDist(point1, point2) {\r\n\tif (samePoint(point1, nullPoint) || samePoint(point2, nullPoint))\r\n\t\treturn -1;\r\n\treturn game.math.distance(point1.x, point1.y, point2.x, point2.y);\r\n}", "function distanceBetweenPoints(a, b) {\n \n return Math.hypot(a.x-b.x, a.y-b.y)\n}", "function delta(a, b) {\r\n return a - b;\r\n}", "function subtract(x,y) {\n return x - y;\n}", "function dist(p1, p2)\n{\n return (p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y);\n}", "static subtract(v1,v2) {\r\n try {\r\n if (!(v1 instanceof Vector) || !(v2 instanceof Vector))\r\n throw \"Vector.subtract: non-vector parameter\";\r\n else {\r\n var v = new Vector(v1.x-v2.x,v1.y-v2.y,v1.z-v2.z);\r\n //v.toConsole(\"Vector.subtract: \");\r\n return(v);\r\n }\r\n } // end try\r\n\r\n catch(e) {\r\n console.log(e);\r\n return(new Vector(NaN,NaN,NaN));\r\n }\r\n }", "minus(p1, p2) {\n return [(p1[0] - p2[0]), (p1[1] - p2[1])];\n }", "function distance(p1, p2) {\n\t\treturn Math.sqrt(Math.pow(p2.y - p1.y, 2) + Math.pow(p2.x - p1.x, 2));\n\t}", "static subtract(v1,v2) {\n try {\n if (!(v1 instanceof Vector) || !(v2 instanceof Vector))\n throw \"Vector.subtract: non-vector parameter\";\n else {\n var v = new Vector(v1.x-v2.x,v1.y-v2.y,v1.z-v2.z);\n //v.toConsole(\"Vector.subtract: \");\n return(v);\n }\n } // end try\n \n catch(e) {\n console.log(e);\n return(new Vector(NaN,NaN,NaN));\n }\n }", "function distance(pt1, pt2) { \n\n return Math.sqrt(Math.pow((pt1.x - pt2.x), 2) + Math.pow((pt1.y - pt2.y), 2));\n}", "function subtract(x,y){\n return x-y;\n}", "function distance(p1, p2) {\n var deltaX = p1[0] - p2[0],\n deltaY = p1[1] - p2[1];\n return sqrt(deltaX * deltaX + deltaY * deltaY);\n }", "function subtract(x,y) {\n return x - y;\n}", "function subtract(x,y) {\n return x - y;\n}", "function geta(point1,point2) {\n if (point1 == point2) { return makeV(0,0) }\n var res = point1.sub(point2).imul((-1 / point1.distance(point2)))\n return res\n }", "function subtract( x, y ) {\n return ( ( +x ) - ( +y ) );\n}", "function subtract(p1, p2) {\n console.log(\"sub = \" + (p1 - p2));\n}", "function minus(p1, p2) {\n\treturn [p1[0]-p2[0], p1[1]-p2[1], p1[2]-p2[2], p1[3]];\n}", "function distance (x1, y1, x2, y2){\r\n return Math.sqrt( (x2-=x1)*x2 + (y2-=y1)*y2 );\r\n}", "function getDistance(p1, p2) {\n return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2)); \n }", "function subtract (x, y) {\n var answer = x - y\n return answer\n}", "function subtract_points(P, B){\n var final = [];\n final.push(P[0] - B[0]);\n final.push(P[1] - B[1]);\n return final;\n}", "function getDistanceBetweenPoints(point1, point2) {\n var left1 = point1.left || point1.x || 0;\n var top1 = point1.top || point1.y || 0;\n var left2 = point2.left || point2.x || 0;\n var top2 = point2.top || point2.y || 0;\n /* eslint-enable deprecation/deprecation */\n var distance = Math.sqrt(Math.pow(left1 - left2, 2) + Math.pow(top1 - top2, 2));\n return distance;\n}", "function getPelnas2(x1, x2){\nvar pelnas = x1 - x2;\nreturn pelnas;\n}", "function dist (pos1, pos2){\n const diffX = Math.abs(pos1[0] - pos2[0])\n const diffY = Math.abs(pos1[1] - pos2[1])\n console.log(diffX, diffY)\n return Math.max(diffX, diffY)\n}", "function distance(p1, p2) {\n\treturn Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));\n}", "function getTwoPointsDistance(x1, y1, x2, y2) {\n return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n }", "static pointDistance(p1, p2) {\n return Math.sqrt((p2.x-p1.x)*(p2.x-p1.x) + (p2.y-p1.y)*(p2.y-p1.y));\n }", "function distance(p1, p2) { return length_v2(diff_v2(p1, p2)); }", "function getDistance(p1, p2) {\n return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));\n}", "function getDistance(p1, p2) {\n return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));\n}", "function getDistance(p1, p2) {\n return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));\n}", "function getDistance(p1, p2) {\n return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));\n}", "function pointDistance(a, b) {\n // get the distance between two points.\n return Math.abs(Math.sqrt(((a.x - b.x) ** 2) + ((a.y - b.y) ** 2)))\n}", "function subtract(n1, n2) {\n return n1 - n2;\n }", "function distance(P1, P2) {\n var x1 = P1[0];\n var y1 = P1[1];\n var x2 = P2[0];\n var y2 = P2[1];\n var d = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n return d;\n}", "function pointDistance(p1, p2) {\n var d1 = p1.x - p2.x;\n var d2 = p1.y - p2.y;\n return Math.sqrt(d1 * d1 + d2 * d2);\n}", "function getDistanceBetweenPoints(point1, point2) {\n var distance = Math.sqrt(Math.pow(point1.x - point2.x, 2) + Math.pow(point1.y - point2.y, 2));\n return distance;\n}", "function getDistanceBetweenPoints(point1, point2) {\n var distance = Math.sqrt(Math.pow(point1.x - point2.x, 2) + Math.pow(point1.y - point2.y, 2));\n return distance;\n}", "function distanceTo(pointA, pointB) {\n var dx = Math.abs(pointA.x - pointB.x);\n var dy = Math.abs(pointA.y - pointB.y);\n return Math.sqrt(dx * dx + dy * dy);\n }", "function distance(p1, p2) {\n return Math.sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y));\n }", "function distanceBetweenPoints(a, b) {\n return Math.sqrt(Math.pow(b.x - a.x, 2) + Math.pow(b.y - a.y, 2));\n}", "function calculateDelta(scores1, scores2) {\n var diff = 0;\n for (var i = 0; i < scores1.length; i++) {\n diff += Math.abs(scores1[i] - scores2[i]);\n }\n return diff;\n}", "function distance(p1, p2)\n{\n return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));\n}", "function distance(x1, y1, x2, y2) {\n return Math.abs(x1 - x2) + Math.abs(y1 - y2)\n}", "function difference(a, b) {\n return Math.abs(a - b);\n }", "function distance(p1, p2) {\n return Math.sqrt((p1.x - p2.x) * (p1.x - p2.x) +\n (p1.y - p2.y) * (p1.y - p2.y));\n }", "function dist(x1,y1,x2,y2) {\n return Math.sqrt( (x2-=x1)*x2 + (y2-=y1)*y2 );\n}", "function distance(p1, p2) {\n return Math.sqrt((p1.x - p2.x) * (p1.x - p2.x) +\n (p1.y - p2.y) * (p1.y - p2.y));\n}", "function positionDelta(key1, key2) {\n var a = key2point(key1), b = key2point(key2);\n return {dx: b[0] - a[0], dy: b[1] - a[1], dz: b[2] - a[2]};\n\n }", "function calculateLengthAbsolute( point1, point2){\r\n return Math.abs(point1-point2);\r\n}", "function distance(point1, point2){\n return Math.sqrt(Math.pow(point1[0]-point2[0], 2) + Math.pow(point1[1]-point2[1], 2));\n}", "function distance(p1, p2) {\n\t return Math.sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y));\n\t}", "function distance(p1, p2) {\n return Math.sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y));\n }", "function distance(p1, p2) {\n return Math.sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y));\n }", "function distBetweenPoints(a,b){\r\n return Math.sqrt((a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y));\r\n}", "function _distance(point1, point2) {\n return Math.sqrt((point1[0] - point2[0]) * (point1[0] - point2[0]) + (point1[1] - point2[1]) * (point1[1] - point2[1]) + (point1[2] - point2[2]) * (point1[2] - point2[2]));\n}", "Subtract(x, y) {\n let vec = new Vec2(x, y);\n this.x -= vec.x;\n this.y -= vec.y;\n return this;\n }", "function diffSubtract(date1, date2) {\n\treturn date2 - date1;\n}", "function distance(p1, p2) {\n return Math.floor(Math.sqrt(Math.pow((p2.x - p1.x), 2) + Math.pow((p2.y - p1.y), 2)));\n }", "function dist2(p1, p2) {\n var dx = p2.x - p1.x;\n var dy = p2.y - p1.y;\n return (dx*dx+dy*dy);\n}", "function dist(p1, p2) {\n var dx = p1.x - p2.x;\n var dy = p1.y - p2.y;\n return Math.sqrt(dx*dx + dy*dy);\n}" ]
[ "0.7472936", "0.7177514", "0.71587425", "0.7150767", "0.7145625", "0.7145625", "0.7145625", "0.7145625", "0.7145625", "0.7013921", "0.699561", "0.699561", "0.699561", "0.699561", "0.699561", "0.699561", "0.699561", "0.699561", "0.6977615", "0.6808039", "0.67970824", "0.67922544", "0.67711", "0.67267436", "0.67241544", "0.6723876", "0.67019737", "0.6649198", "0.6572783", "0.6571219", "0.65697753", "0.65674233", "0.65630674", "0.6547192", "0.6542271", "0.65230966", "0.6488215", "0.6485001", "0.6471161", "0.64703363", "0.64692724", "0.6455369", "0.6450182", "0.6447147", "0.6444646", "0.6443744", "0.6436467", "0.643287", "0.643287", "0.6417404", "0.64039826", "0.639541", "0.638798", "0.63834655", "0.6379097", "0.6371554", "0.63594735", "0.63511425", "0.63502073", "0.63501596", "0.6345952", "0.6341428", "0.6339003", "0.6337298", "0.6324275", "0.6324275", "0.6324275", "0.6324275", "0.63155735", "0.63102794", "0.6305503", "0.6305223", "0.63028467", "0.63028467", "0.6298453", "0.62961906", "0.62955785", "0.6290943", "0.6285475", "0.6275223", "0.6261984", "0.625687", "0.6255928", "0.6251817", "0.62498665", "0.62448156", "0.624139", "0.6241315", "0.6237633", "0.6237633", "0.6234901", "0.6229514", "0.62292176", "0.62285805", "0.6221724", "0.6215085", "0.6211663" ]
0.7157248
6
The scrollbar width computations in computeEdges are sometimes flawed when it comes to retina displays, rounding, and IE11. Massage them into a usable value.
function sanitizeScrollbarWidth(width) { width = Math.max(0, width); // no negatives width = Math.round(width); return width; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateEdgeWidth() {\n var windowWidth = $(window).width();\n var slideWidth = $('.slide.active').outerWidth();\n return (windowWidth - slideWidth) / 2;\n }", "function getScrollbarWidth() {\n return window.innerWidth - document.documentElement.clientWidth;\n}", "function returnScrollbarWidth() {\n let scrollbarWidth = innerWindowWidth() - document.querySelector('html').clientWidth;\n \n return scrollbarWidth;\n}", "function returnScrollbarWidth() {\n let scrollbarWidth = innerWindowWidth() - doc.querySelector('html').clientWidth;\n\n return scrollbarWidth;\n}", "function getGraphWidth() {\n\t\treturn width - xOffset * 2;\n\t}", "function sizeScrollbar(){\n\t\tvar remainder = scrollContent.width() - scrollPane.width();\n\t\tvar proportion = remainder / scrollContent.width();\n\t\tvar handleSize = scrollPane.width() - (proportion * scrollPane.width());\n\t\tscrollbar.find('.ui-slider-handle').css({\n\t\t\twidth: handleSize,\n\t\t\t'margin-left': -handleSize/2\n\t\t});\n\t\thandleHelper.width('').width( scrollbar.width() - handleSize);\n\t}", "_getWidth() {\n const measurer = this._document.createElement('div');\n measurer.className = 'modal-scrollbar-measure';\n const body = this._document.body;\n body.appendChild(measurer);\n const width = measurer.getBoundingClientRect().width - measurer.clientWidth;\n body.removeChild(measurer);\n return width;\n }", "getRenderedWidth(){return e.System.Services.controlManager.checkControlGeometryByControl(this),this.__renderedSizeCache.width}", "function sizeScrollbar() {\nvar remainder = scrollContent.width() - scrollPane.width();\nvar proportion = remainder / scrollContent.width();\nvar handleSize = scrollPane.width() - ( proportion * scrollPane.width() );\nscrollbar.find( \".ui-slider-handle\" ).css({\nwidth: handleSize,\n\"margin-left\": -handleSize / 2\n});\nhandleHelper.width( \"\" ).width( scrollbar.width() - handleSize );\n}", "calculateWithDif() {\n return (this._$window.innerWidth - this.interactiveDomWidth) / 2;\n }", "function sizeScrollbar() {\r\n\t\t\tvar remainder = scrollContent.width() - scrollPane.width();\r\n\t\t\tvar proportion = remainder / scrollContent.width();\r\n\t\t\tvar handleSize = scrollPane.width() - ( proportion * scrollPane.width() );\r\n\t\t\tscrollbar.find( \".ui-slider-handle\" ).css({\r\n\t\t\t\twidth: handleSize,\r\n\t\t\t\t\"margin-left\": -handleSize / 2\r\n\t\t\t});\r\n\t\t\thandleHelper.width( \"\" ).width( scrollbar.width() - handleSize );\r\n\t\t}", "function sizeScrollbar() {\n var remainder = $scrollContent.width() - $scrollPane.width();\n var proportion = remainder / $scrollContent.width();\n var handleSize = $scrollPane.width() - (proportion * $scrollPane.width());\n $scrollbar.find(\".ui-slider-handle\").css({\n width: handleSize,\n \"margin-left\": -handleSize / 2\n });\n handleHelper.width(\"\").width($scrollbar.width() - handleSize);\n }", "function innerCanvasArea() {\n var total = parseInt(innerCanvas.style.width) * 2;\n return total;\n }", "function computeScrollbarWidthsForEl(el) {\n return {\n x: el.offsetHeight - el.clientHeight,\n y: el.offsetWidth - el.clientWidth,\n };\n }", "function getScrollbarWidths(el){var leftRightWidth=el[0].offsetWidth-el[0].clientWidth;var bottomWidth=el[0].offsetHeight-el[0].clientHeight;var widths;leftRightWidth=sanitizeScrollbarWidth(leftRightWidth);bottomWidth=sanitizeScrollbarWidth(bottomWidth);widths={left:0,right:0,top:0,bottom:bottomWidth};if(getIsLeftRtlScrollbars()&&el.css('direction')==='rtl'){// is the scrollbar on the left side?\nwidths.left=leftRightWidth;}else{widths.right=leftRightWidth;}return widths;}", "function getScrollBarWidth() {\n var inner = document.createElement(\"p\");\n inner.style.width = \"100%\";\n inner.style.height = \"200px\";\n var outer = document.createElement(\"div\");\n outer.style.position = \"absolute\";\n outer.style.top = \"0px\";\n outer.style.left = \"0px\";\n outer.style.visibility = \"hidden\";\n outer.style.width = \"200px\";\n outer.style.height = \"150px\";\n outer.style.overflow = \"hidden\";\n outer.appendChild(inner);\n document.body.appendChild(outer);\n var w1 = inner.offsetWidth;\n outer.style.overflow = \"scroll\";\n var w2 = inner.offsetWidth;\n\n if (w1 == w2) {\n w2 = outer.clientWidth;\n }\n\n document.body.removeChild(outer);\n return w1 - w2;\n}", "function getScrollBarWidth() {\n var inner = document.createElement(\"p\");\n inner.style.width = \"100%\";\n inner.style.height = \"200px\";\n var outer = document.createElement(\"div\");\n outer.style.position = \"absolute\";\n outer.style.top = \"0px\";\n outer.style.left = \"0px\";\n outer.style.visibility = \"hidden\";\n outer.style.width = \"200px\";\n outer.style.height = \"150px\";\n outer.style.overflow = \"hidden\";\n outer.appendChild(inner);\n document.body.appendChild(outer);\n var w1 = inner.offsetWidth;\n outer.style.overflow = \"scroll\";\n var w2 = inner.offsetWidth;\n\n if (w1 == w2) {\n w2 = outer.clientWidth;\n }\n\n document.body.removeChild(outer);\n return w1 - w2;\n}", "function Browser_InnerWidth()\n{\n\t//use the body\n\treturn document.body.offsetWidth;\n}", "function calcWidth(maxX) {\n // icons are 16pixels wide. 20 for graphic border.\n // Extra 22 is for window border (required).\n return (maxX+1)*16+20 +22 +8; }", "function getWidth(){\n\tif( $(\"#visualizationDiv\").width() > MAXWIDTH )\treturn MAXWIDTH - LEGENDWIDHT-20;\n\tif ($(\"#visualizationDiv\").width() < MOBILEBREAKPOINT ) return $(\"#visualizationDiv\").width();\n\treturn $(\"#visualizationDiv\").width() -LEGENDWIDHT-20;\n}", "function sizeScrollbar() {\n\tvar remainder = scrollContent.width() - scrollPane.width();\n\tif(remainder < 1){\n\t\t//remainder = scrollContent.width();\n\t\tscrollbar.find( \".ui-slider-handle\" ).hide();\n\t}else{\n\t\tscrollbar.find( \".ui-slider-handle\" ).show();\n\t}\n\tvar proportion = remainder / scrollContent.width();\n\tvar handleSize = scrollPane.width() - ( proportion * scrollPane.width() );\n\tscrollbar.find( \".ui-slider-handle\" ).css({\n\t\twidth: handleSize,\n\t\t\"margin-left\": -handleSize / 2\n\t});\n\thandleHelper.width( \"\" ).width( scrollbar.width() - handleSize );\n}", "function getScrollbarWidth() {\n if ($(\"html\").is(\"[data-minimalscrollbar]\")) {\n return 0\n }\n let $t = $(\"<div/>\").css({\n position: \"absolute\",\n top: \"-100px\",\n overflowX: \"hidden\",\n overflowY: \"scroll\"\n }).prependTo(\"body\")\n let out = $t[0].offsetWidth - $t[0].clientWidth\n $t.remove()\n return out\n }", "function setOuterWidth() {\n outerWidth = wrap.offsetWidth;\n dragBarPos = calcDragBarPosFromCss() || Math.floor(outerWidth / 2) - 5;\n }", "function calculateGraphDim() {\n const w = window.innerWidth;\n const h = window.innerHeight;\n\n function greatestCommonDivisor(x, y) {\n if (typeof x !== 'number' || typeof y !== 'number') return false;\n x = Math.abs(x);\n y = Math.abs(y);\n while (y) {\n var t = y;\n y = x % y;\n x = t;\n }\n return x > 30 ? x : 30; // The minimal size of the table boxes is 20px\n }\n\n const gcd = greatestCommonDivisor(w, h);\n const tableW = Math.floor(w / gcd);\n const tableH = Math.floor(h / gcd);\n return [tableW, tableH];\n }", "function getScrollbarWidth() {\n var div = $('<div style=\"width:50px;height:50px;overflow:hidden;position:absolute;top:-200px;left:-200px;\"><div style=\"height:100px;\"></div></div>');\n $('body').append(div);\n var w1 = $('div', div).innerWidth();\n div.css('overflow-y', 'auto');\n var w2 = $('div', div).innerWidth();\n $(div).remove();\n return (w1 - w2);\n }", "function getClientDim() {\n\tvar nwX, nwY, seX, seY;\n\tif (self.pageYOffset) // all except Explorer\n\t{\n\t nwX = self.pageXOffset;\n\t seX = self.innerWidth + nwX;\n\t nwY = self.pageYOffset;\n\t seY = self.innerHeight + nwY;\n\t}\n\telse if (document.documentElement && document.documentElement.scrollTop) // Explorer 6 Strict\n\t{\n\t nwX = document.documentElement.scrollLeft;\n\t seX = document.documentElement.clientWidth + nwX;\n\t nwY = document.documentElement.scrollTop;\n\t seY = document.documentElement.clientHeight + nwY;\n\t}\n\telse if (document.body) // all other Explorers\n\t{\n\t nwX = document.body.scrollLeft;\n\t seX = document.body.clientWidth + nwX;\n\t nwY = document.body.scrollTop;\n\t seY = document.body.clientHeight + nwY;\n\t}\n\treturn {'nw' : new coordinate(nwX, nwY), 'se' : new coordinate(seX, seY)};\n}", "function getWidth() {\r\n return Math.max(\r\n document.body.scrollWidth,\r\n document.documentElement.scrollWidth,\r\n document.body.offsetWidth,\r\n document.documentElement.offsetWidth,\r\n document.documentElement.clientWidth\r\n );\r\n}", "updateResize(event) {\n const me = this,\n context = me.context; // flip which edge is being dragged depending on whether we're to the right or left of the mousedown\n\n if (me.allowEdgeSwitch) {\n if (me.direction === 'horizontal') {\n context.edge = context.currentX > context.startX ? 'right' : 'left';\n } else {\n context.edge = context.currentY > context.startY ? 'bottom' : 'top';\n }\n }\n\n const // limit to outerElement if set\n deltaX = context.currentX - context.startX,\n deltaY = context.currentY - context.startY,\n minWidth = DomHelper.getExtremalSizePX(context.element, 'minWidth') || me.minWidth,\n maxWidth = DomHelper.getExtremalSizePX(context.element, 'maxWidth') || me.maxWidth,\n minHeight = DomHelper.getExtremalSizePX(context.element, 'minHeight') || me.minHeight,\n maxHeight = DomHelper.getExtremalSizePX(context.element, 'maxHeight') || me.maxHeight,\n // dragging right edge right increases width, dragging left edge right decreases width\n sign = context.edge === 'right' || context.edge === 'bottom' ? 1 : -1,\n // new width, not allowed to go below minWidth\n newWidth = context.elementWidth + deltaX * sign,\n newHeight = context.elementHeight + deltaY * sign;\n let width = Math.max(minWidth, newWidth),\n height = Math.max(minHeight, newHeight);\n\n if (maxWidth > 0) {\n width = Math.min(width, maxWidth);\n }\n\n if (maxHeight > 0) {\n height = Math.min(height, maxHeight);\n } // remove flex when resizing\n\n if (context.element.style.flex) {\n context.element.style.flex = '';\n }\n\n if (me.direction === 'horizontal') {\n context.element.style.width = Math.abs(width) + 'px';\n context.newWidth = width; // when dragging left edge, also update position (so that right edge remains in place)\n\n if (context.edge === 'left' || width < 0) {\n context.newX = Math.max(Math.min(context.elementStartX + context.elementWidth - me.minWidth, context.elementStartX + deltaX), 0);\n\n if (!me.skipTranslate) {\n DomHelper.setTranslateX(context.element, context.newX);\n }\n } // When dragging the right edge and we're allowed to flip the drag from left to right\n // through the start point (eg drag event creation) the element must be at its initial X position\n else if (context.edge === 'right' && me.allowEdgeSwitch && !me.skipTranslate) {\n DomHelper.setTranslateX(context.element, context.elementStartX);\n }\n } else {\n context.element.style.height = Math.abs(height) + 'px';\n context.newHeight = height; // when dragging top edge, also update position (so that bottom edge remains in place)\n\n if (context.edge === 'top' || height < 0) {\n context.newY = Math.max(Math.min(context.elementStartY + context.elementHeight - me.minHeight, context.elementStartY + deltaY), 0);\n\n if (!me.skipTranslate) {\n DomHelper.setTranslateY(context.element, context.newY);\n }\n } // When dragging the bottom edge and we're allowed to flip the drag from top to bottom\n // through the start point (eg drag event creation) the element must be at its initial Y position\n else if (context.edge === 'bottom' && me.allowEdgeSwitch && !me.skipTranslate) {\n DomHelper.setTranslateY(context.element, context.elementStartY);\n }\n }\n }", "_getScrollbarWidth() {\n if (this._scrollbarWidth === null) {\n const $el = $('<div>test</div>')\n .css({\n visibility: 'hidden',\n position: 'absolute',\n left: -10000,\n top: -10000,\n })\n .appendTo(document.body);\n const width = $el.width();\n\n $el.css('overflow-y', 'scroll');\n const newWidth = $el.width();\n\n $el.remove();\n\n this._scrollbarWidth = newWidth - width;\n }\n\n return this._scrollbarWidth;\n }", "function clickSize() { return width() / 40; }", "function getScrollbarWidth() {\n const inner = document.createElement('p');\n\n inner.style.width = '100%';\n inner.style.height = '200px';\n\n const outer = document.createElement('div');\n\n outer.style.position = 'absolute';\n outer.style.top = '0px';\n outer.style.left = '0px';\n outer.style.visibility = 'hidden';\n outer.style.width = '200px';\n outer.style.height = '150px';\n outer.style.overflow = 'hidden';\n outer.appendChild(inner);\n\n document.body.appendChild(outer);\n\n const w1 = inner.offsetWidth;\n\n outer.style.overflow = 'scroll';\n\n let w2 = inner.offsetWidth;\n\n if (w1 === w2) {\n w2 = outer.clientWidth;\n }\n\n document.body.removeChild(outer);\n\n return (w1 - w2);\n}", "getWidth() {\n return this.$node.innerWidth();\n }", "function changeCanvasElementsWidth() {\n canvasWrapperParentElement.style.width = `calc(100% - ${rightSideBar.width + leftSideBar.width}px)`;\n // could be the reason for uneven results\n zoomOverflowWrapperParentElement.style.width = `calc(100% - ${rightSideBar.width + leftSideBar.width + 1}px)`;\n}", "function getScrollBarWidth() {\n const $outer = $('<div>').css({ visibility: 'hidden', width: 100, overflow: 'scroll' }).appendTo('body');\n const widthWithScroll = $('<div>').css({ width: '100%' }).appendTo($outer).outerWidth();\n $outer.remove();\n return Math.ceil(100 - widthWithScroll);\n}", "function get_scroll_bar_width() {\n\n // no need on responsive mode.\n if ($(\"body\").hasClass(\"yp-responsive-device-mode\")) {\n return 0;\n }\n\n // If no scrollbar, return zero.\n if (iframe.height() <= $(window).height() && $(\"body\").hasClass((\"yp-metric-disable\"))) {\n return 0;\n }\n\n var inner = document.createElement('p');\n inner.style.width = \"100%\";\n inner.style.height = \"200px\";\n\n var outer = document.createElement('div');\n outer.style.position = \"absolute\";\n outer.style.top = \"0px\";\n outer.style.left = \"0px\";\n outer.style.visibility = \"hidden\";\n outer.style.width = \"200px\";\n outer.style.height = \"150px\";\n outer.style.overflow = \"hidden\";\n outer.appendChild(inner);\n\n document.body.appendChild(outer);\n var w1 = inner.offsetWidth;\n outer.style.overflow = 'scroll';\n var w2 = inner.offsetWidth;\n if (w1 == w2) w2 = outer.clientWidth;\n\n document.body.removeChild(outer);\n\n return (w1 - w2);\n\n }", "function getWidth() {\n return Math.max(\n document.body.scrollWidth,\n document.documentElement.scrollWidth,\n document.body.offsetWidth,\n document.documentElement.offsetWidth,\n document.documentElement.clientWidth\n );\n}", "function getWidth() {\n return Math.max(\n document.body.scrollWidth,\n document.documentElement.scrollWidth,\n document.body.offsetWidth,\n document.documentElement.offsetWidth,\n document.documentElement.clientWidth\n );\n}", "function getScrollBarWidth () {\n var $outer = $('<div>').css({visibility: 'hidden', width: 100, overflow: 'scroll'}).appendTo('body'),\n widthWithScroll = $('<div>').css({width: '100%'}).appendTo($outer).outerWidth();\n $outer.remove();\n return 100 - widthWithScroll;\n}", "function getScrollBarWidth () {\n var $outer = $('<div>').css({visibility: 'hidden', width: 100, overflow: 'scroll'}).appendTo('body'),\n widthWithScroll = $('<div>').css({width: '100%'}).appendTo($outer).outerWidth();\n $outer.remove();\n return 100 - widthWithScroll;\n}", "function xClientWidth()\r\n{\r\n var v=0,d=document,w=window;\r\n if(d.compatMode == 'CSS1Compat' && !w.opera && d.documentElement && d.documentElement.clientWidth)\r\n {v=d.documentElement.clientWidth;}\r\n else if(d.body && d.body.clientWidth)\r\n {v=d.body.clientWidth;}\r\n else if(xDef(w.innerWidth,w.innerHeight,d.height)) {\r\n v=w.innerWidth;\r\n if(d.height>w.innerHeight) v-=16;\r\n }\r\n return v;\r\n}", "function sanitizeScrollbarWidth(width) {\n width = Math.max(0, width); // no negatives\n width = Math.round(width);\n return width;\n}", "function sanitizeScrollbarWidth(width) {\n width = Math.max(0, width); // no negatives\n width = Math.round(width);\n return width;\n}", "function sanitizeScrollbarWidth(width) {\n width = Math.max(0, width); // no negatives\n width = Math.round(width);\n return width;\n}", "function sanitizeScrollbarWidth(width) {\n width = Math.max(0, width); // no negatives\n width = Math.round(width);\n return width;\n}", "function sanitizeScrollbarWidth(width) {\n width = Math.max(0, width); // no negatives\n width = Math.round(width);\n return width;\n}", "updateResize(event) {\n const me = this,\n context = me.context;\n\n // flip which edge is being dragged depending on whether we're to the right or left of the mousedown\n if (me.allowEdgeSwitch) {\n if (me.direction === 'horizontal') {\n context.edge = context.currentX > context.startX ? 'right' : 'left';\n } else {\n context.edge = context.currentY > context.startY ? 'bottom' : 'top';\n }\n }\n\n let // limit to outerElement if set\n deltaX = context.currentX - context.startX,\n deltaY = context.currentY - context.startY,\n minWidth = DomHelper.getExtremalSizePX(context.element, 'minWidth') || me.minWidth,\n maxWidth = DomHelper.getExtremalSizePX(context.element, 'maxWidth') || me.maxWidth,\n minHeight = DomHelper.getExtremalSizePX(context.element, 'minHeight') || me.minHeight,\n maxHeight = DomHelper.getExtremalSizePX(context.element, 'maxHeight') || me.maxHeight,\n // dragging right edge right increases width, dragging left edge right decreases width\n sign = context.edge === 'right' || context.edge === 'bottom' ? 1 : -1,\n // new width, not allowed to go below minWidth\n newWidth = context.elementWidth + deltaX * sign,\n width = Math.max(minWidth, newWidth),\n newHeight = context.elementHeight + deltaY * sign,\n height = Math.max(minHeight, newHeight);\n\n if (maxWidth > 0) {\n width = Math.min(width, maxWidth);\n }\n\n if (maxHeight > 0) {\n height = Math.min(height, maxHeight);\n }\n\n // remove flex when resizing\n if (context.element.style.flex) {\n context.element.style.flex = '';\n }\n\n if (me.direction === 'horizontal') {\n context.element.style.width = Math.abs(width) + 'px';\n context.newWidth = width;\n\n // when dragging left edge, also update position (so that right edge remains in place)\n if (context.edge === 'left' || width < 0) {\n context.newX = Math.max(\n Math.min(context.elementStartX + context.elementWidth - me.minWidth, context.elementStartX + deltaX),\n 0\n );\n if (!me.skipTranslate) {\n DomHelper.setTranslateX(context.element, context.newX);\n }\n }\n // When dragging the right edge and we're allowed to flip the drag from left to right\n // through the start point (eg drag event creation) the element must be at its initial X position\n else if (context.edge === 'right' && me.allowEdgeSwitch && !me.skipTranslate) {\n DomHelper.setTranslateX(context.element, context.elementStartX);\n }\n } else {\n context.element.style.height = Math.abs(height) + 'px';\n context.newHeight = height;\n\n // when dragging top edge, also update position (so that bottom edge remains in place)\n if (context.edge === 'top' || height < 0) {\n context.newY = Math.max(\n Math.min(context.elementStartY + context.elementHeight - me.minHeight, context.elementStartY + deltaY),\n 0\n );\n if (!me.skipTranslate) {\n DomHelper.setTranslateY(context.element, context.newY);\n }\n }\n // When dragging the bottom edge and we're allowed to flip the drag from top to bottom\n // through the start point (eg drag event creation) the element must be at its initial Y position\n else if (context.edge === 'bottom' && me.allowEdgeSwitch && !me.skipTranslate) {\n DomHelper.setTranslateY(context.element, context.elementStartY);\n }\n }\n }", "function getScrollbarWidth() {\n var outer = document.createElement(\"div\");\n outer.style.visibility = \"hidden\";\n outer.style.width = \"100px\";\n outer.style.msOverflowStyle = \"scrollbar\"; // needed for WinJS apps\n\n document.body.appendChild(outer);\n\n var widthNoScroll = outer.offsetWidth;\n // force scrollbars\n outer.style.overflow = \"scroll\";\n\n // add innerdiv\n var inner = document.createElement(\"div\");\n inner.style.width = \"100%\";\n outer.appendChild(inner); \n\n var widthWithScroll = inner.offsetWidth;\n\n // remove divs\n outer.parentNode.removeChild(outer);\n\n return widthNoScroll - widthWithScroll;\n}", "function sanitizeScrollbarWidth(width){width=Math.max(0,width);// no negatives\nwidth=Math.round(width);return width;}// Logic for determining if, when the element is right-to-left, the scrollbar appears on the left side", "function getWidth()\n\t{\n\t\tvar A=0;\n\t\tvar B=getScrollXY()[0];\n\t\tif(self.innerWidth)\n\t\t{\n\t\t\tA=self.innerWidth+B*2\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(document.documentElement&&document.documentElement.clientHeight)\n\t\t\t{\n\t\t\t\tA=document.documentElement.clientWidth+B*2\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(document.body)\n\t\t\t\t{\n\t\t\t\t\tA=document.body.clientWidth+B*2\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn A\n\t}", "getHandleWidth () {\n return this.props.dividerWidth + this.props.handleBleed * 2\n }", "function W(){var t=l.getBoundingClientRect(),e=\"offset\"+[\"Width\",\"Height\"][i.ort];return 0===i.ort?t.width||l[e]:t.height||l[e]}", "get colliderWidth () {\n\t\tlet leftMostX = this.isSignMagnitude ? this.signLabel.x : ZERO;\n\t\tlet rightMostX = this.textLabel.x + this.textLabel.width;\n\t\treturn rightMostX - leftMostX;\n\t}", "smallestScreenEdge() {\n return Math.min(this.canvas.height, this.canvas.width)\n }", "function xClientWidth()\n{\n var v=0,d=document,w=window;\n if((!d.compatMode || d.compatMode == 'CSS1Compat') && !w.opera && d.documentElement && d.documentElement.clientWidth)\n {v=d.documentElement.clientWidth;}\n else if(d.body && d.body.clientWidth)\n {v=d.body.clientWidth;}\n else if(xDef(w.innerWidth,w.innerHeight,d.height)) {\n v=w.innerWidth;\n if(d.height>w.innerHeight) v-=16;\n }\n return v;\n}", "function SHW() {\n if (document.body && document.body.clientWidth != 0) {\n width = document.body.clientWidth;\n height = document.body.clientHeight;\n }\n if (\n document.documentElement &&\n document.documentElement.clientWidth != 0 &&\n document.body.clientWidth + 20 >= document.documentElement.clientWidth\n ) {\n width = document.documentElement.clientWidth;\n height = document.documentElement.clientHeight;\n }\n return [width, height];\n}", "function Themes_GetClientEdgeThickness(interfaceLook)\n{\n\t//switch according to the theme\n\tswitch (interfaceLook)\n\t{\n\t\tcase __NEMESIS_LOOK_WINDOWS_10:\n\t\t\t//use 1\n\t\t\treturn 1;\n\t\tdefault:\n\t\t\t//use default\n\t\t\treturn 2;\n\t}\n}", "function getScrollbarWidth() {\n // Create the measurement node\n var scrollDiv = document.createElement(\"div\");\n scrollDiv.className = \"scrollbar-measure\";\n document.body.appendChild(scrollDiv);\n\n // Get the scrollbar width\n var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;\n\n // Delete the DIV\n document.body.removeChild(scrollDiv);\n\n return scrollbarWidth;\n }", "function getWidthBrowser()\n{\n\treturn j(window).width();\n}", "function getWidthBrowser()\n{\n\treturn j(window).width();\n}", "function getScrollbarWidth() {\n\n // Creating invisible container\n const outer = document.createElement('div');\n outer.style.visibility = 'hidden';\n outer.style.overflow = 'scroll'; // forcing scrollbar to appear\n outer.style.msOverflowStyle = 'scrollbar'; // needed for WinJS apps\n document.body.appendChild(outer);\n \n // Creating inner element and placing it in the container\n const inner = document.createElement('div');\n outer.appendChild(inner);\n \n // Calculating difference between container's full width and the child width\n const scrollbarWidth = (outer.offsetWidth - inner.offsetWidth);\n \n // Removing temporary elements from the DOM\n outer.parentNode.removeChild(outer);\n \n return scrollbarWidth;\n }", "function sanitizeScrollbarWidth(width) {\n width = Math.max(0, width); // no negatives\n\n width = Math.round(width);\n return width;\n }", "function getScrollbarWidth() {\n var outer = document.createElement(\"div\");\n outer.style.visibility = \"hidden\";\n outer.style.width = \"100px\";\n document.body.appendChild(outer);\n\n var widthNoScroll = outer.offsetWidth;\n // force scrollbars\n outer.style.overflow = \"scroll\";\n\n // add innerdiv\n var inner = document.createElement(\"div\");\n inner.style.width = \"100%\";\n outer.appendChild(inner);\n\n var widthWithScroll = inner.offsetWidth;\n\n // remove divs\n outer.parentNode.removeChild(outer);\n\n return widthNoScroll - widthWithScroll;\n }", "function getHorEdge(b) {\n\t\treturn parseFloat($(b).css('padding-left')) + parseFloat($(b).css('padding-right')) \n\t\t\t\t\t+ parseFloat($(b).css('margin-left')) + parseFloat($(b).css('margin-right'))\n\t\t\t\t\t+ parseFloat($(b).css('border-left')) + parseFloat($(b).css('border-right'));\n\t}", "function scrollbarWidth() {\n if (typeof document === 'undefined') {\n return 0;\n }\n\n var body = document.body;\n var box = document.createElement('div');\n var boxStyle = box.style;\n boxStyle.position = 'fixed';\n boxStyle.left = 0;\n boxStyle.visibility = 'hidden';\n boxStyle.overflowY = 'scroll';\n body.appendChild(box);\n var width = box.getBoundingClientRect().right;\n body.removeChild(box);\n return width;\n}", "function getScrollbarWidths(el) {\n var leftRightWidth = el.innerWidth() - el[0].clientWidth; // the paddings cancel out, leaving the scrollbars\n var widths = {\n left: 0,\n right: 0,\n top: 0,\n bottom: el.innerHeight() - el[0].clientHeight // the paddings cancel out, leaving the bottom scrollbar\n };\n\n if (getIsLeftRtlScrollbars() && el.css('direction') == 'rtl') { // is the scrollbar on the left side?\n widths.left = leftRightWidth;\n }\n else {\n widths.right = leftRightWidth;\n }\n\n return widths;\n }", "get getBoundingClientRects() {\n if (!this._boundingClientRects) {\n const innerBox = this._innerBoxHelper.nativeElement.getBoundingClientRect();\n const clientRect = this.element.getBoundingClientRect();\n this._boundingClientRects = {\n clientRect,\n innerWidth: innerBox.width,\n innerHeight: innerBox.height,\n scrollBarWidth: clientRect.width - innerBox.width,\n scrollBarHeight: clientRect.height - innerBox.height,\n };\n const resetCurrentBox = () => this._boundingClientRects = undefined;\n if (this._isScrolling) {\n this.scrolling.pipe(filter(scrolling => scrolling === 0), take(1)).subscribe(resetCurrentBox);\n }\n else {\n requestAnimationFrame(resetCurrentBox);\n }\n }\n return this._boundingClientRects;\n }", "function calcInnerSliderWidth(){\n const sliderWidth = document.querySelector(\".slider\").offsetWidth;\n const innerSlider = document.querySelector(\".inner-slider\");\n let rangeWidth = (sliderWidth/100)*backersPercentage();\n innerSlider.style.width = `${rangeWidth}px`;\n}", "_getWinSize(){return{width:document.documentElement.clientWidth,height:c.innerHeight}}", "function sanitizeScrollbarWidth(width) {\n width = Math.max(0, width); // no negatives\n\n width = Math.round(width);\n return width;\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n };\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n };\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n };\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n };\n }", "function measureForScrollbars(cm) {\n var d = cm.display,\n gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth,\n clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n };\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }", "function innerWidth(el){\n var style = window.getComputedStyle(el, null);\n return el.clientWidth -\n parseInt(style.getPropertyValue('padding-left'), 10) -\n parseInt(style.getPropertyValue('padding-right'), 10);\n }", "function f_clientWidth() {\n\treturn $(window).width();\n}", "function getScrollbarWidths(el) {\n\t\tvar leftRightWidth = el.innerWidth() - el[0].clientWidth; // the paddings cancel out, leaving the scrollbars\n\t\tvar widths = {\n\t\t\tleft: 0,\n\t\t\tright: 0,\n\t\t\ttop: 0,\n\t\t\tbottom: el.innerHeight() - el[0].clientHeight // the paddings cancel out, leaving the bottom scrollbar\n\t\t};\n\n\t\tif (getIsLeftRtlScrollbars() && el.css('direction') == 'rtl') { // is the scrollbar on the left side?\n\t\t\twidths.left = leftRightWidth;\n\t\t}\n\t\telse {\n\t\t\twidths.right = leftRightWidth;\n\t\t}\n\n\t\treturn widths;\n\t}", "function adjustLowerScrollbarSize() {\n\tvar hscroll_size = (windowsize / _COLLENGTH)*100;\n\tif(hscroll_size < 5) hscroll_size=5;\n\tLOWERSCROLLNUB = Math.round(hscroll_size);\n\t$(\"#hscroll .nub_x\").css(\"width\", LOWERSCROLLNUB+\"%\");\n\t$(\"#hscroll .ghost_x\").css(\"width\", LOWERSCROLLNUB+\"%\");\n}", "function _fnScrollBarWidth ()\n\t\t{ \n\t\t\tvar inner = document.createElement('p'); \n\t\t\tvar style = inner.style;\n\t\t\tstyle.width = \"100%\"; \n\t\t\tstyle.height = \"200px\"; \n\t\t\t\n\t\t\tvar outer = document.createElement('div'); \n\t\t\tstyle = outer.style;\n\t\t\tstyle.position = \"absolute\"; \n\t\t\tstyle.top = \"0px\"; \n\t\t\tstyle.left = \"0px\"; \n\t\t\tstyle.visibility = \"hidden\"; \n\t\t\tstyle.width = \"200px\"; \n\t\t\tstyle.height = \"150px\"; \n\t\t\tstyle.overflow = \"hidden\"; \n\t\t\touter.appendChild(inner); \n\t\t\t\n\t\t\tdocument.body.appendChild(outer); \n\t\t\tvar w1 = inner.offsetWidth; \n\t\t\touter.style.overflow = 'scroll'; \n\t\t\tvar w2 = inner.offsetWidth; \n\t\t\tif ( w1 == w2 )\n\t\t\t{\n\t\t\t\tw2 = outer.clientWidth; \n\t\t\t}\n\t\t\t\n\t\t\tdocument.body.removeChild(outer); \n\t\t\treturn (w1 - w2); \n\t\t}", "function sanitizeScrollbarWidth(width) {\n\twidth = Math.max(0, width); // no negatives\n\twidth = Math.round(width);\n\treturn width;\n}", "function sanitizeScrollbarWidth(width) {\n\twidth = Math.max(0, width); // no negatives\n\twidth = Math.round(width);\n\treturn width;\n}", "function sanitizeScrollbarWidth(width) {\n\twidth = Math.max(0, width); // no negatives\n\twidth = Math.round(width);\n\treturn width;\n}", "function sanitizeScrollbarWidth(width) {\n\twidth = Math.max(0, width); // no negatives\n\twidth = Math.round(width);\n\treturn width;\n}", "function sanitizeScrollbarWidth(width) {\n\twidth = Math.max(0, width); // no negatives\n\twidth = Math.round(width);\n\treturn width;\n}" ]
[ "0.6753931", "0.64934933", "0.64165056", "0.6389134", "0.63150173", "0.61602956", "0.61571985", "0.61508745", "0.6126553", "0.6110899", "0.609638", "0.6074233", "0.60657185", "0.6063914", "0.60432935", "0.6031688", "0.6031688", "0.6025472", "0.60207087", "0.5964213", "0.5949011", "0.5939825", "0.5938773", "0.5934389", "0.59320456", "0.59166485", "0.59036434", "0.58868015", "0.58791137", "0.5870894", "0.5862504", "0.5862135", "0.5858419", "0.5852099", "0.5848209", "0.5822096", "0.5812384", "0.57962453", "0.57962453", "0.57811904", "0.57761544", "0.57761544", "0.57761544", "0.57761544", "0.57761544", "0.5767993", "0.5767612", "0.57675797", "0.57506615", "0.574674", "0.5737725", "0.57291836", "0.5729135", "0.5727891", "0.5727702", "0.5726043", "0.5723124", "0.572271", "0.572271", "0.5715584", "0.5701368", "0.569594", "0.56873065", "0.5684314", "0.5683997", "0.5679921", "0.5678451", "0.56738764", "0.56729054", "0.5670737", "0.5670737", "0.5670737", "0.5670737", "0.5665146", "0.5661184", "0.5661184", "0.5661184", "0.5661184", "0.5661184", "0.5661184", "0.5661184", "0.5661184", "0.5661184", "0.5661184", "0.5661184", "0.5661184", "0.5661184", "0.5661184", "0.5661184", "0.5661184", "0.5661184", "0.5660522", "0.56532", "0.56482327", "0.5644555", "0.56385756", "0.5633961", "0.5633961", "0.5633961", "0.5633961", "0.5633961" ]
0.0
-1
does not return window
function getClippingParents(el) { var parents = []; while (el instanceof HTMLElement) { // will stop when gets to document or null var computedStyle = window.getComputedStyle(el); if (computedStyle.position === 'fixed') { break; } if ((/(auto|scroll)/).test(computedStyle.overflow + computedStyle.overflowY + computedStyle.overflowX)) { parents.push(el); } el = el.parentNode; } return parents; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_getWindow() {\n return this._document.defaultView || window;\n }", "_getWindow() {\n return this._document.defaultView || window;\n }", "_getWindow() {\n const doc = this._getDocument();\n\n return doc.defaultView || window;\n }", "_getWindow() {\n return this._document.defaultView || window;\n }", "_getWindow() {\n return this._document.defaultView || window;\n }", "_getWindow() {\n return this._document.defaultView || window;\n }", "_getWindow() {\n const doc = this._getDocument();\n return doc.defaultView || window;\n }", "_getWindow() {\n const doc = this._getDocument();\n return doc.defaultView || window;\n }", "_getWindow() {\n const doc = this._getDocument();\n return doc.defaultView || window;\n }", "_getWindow() {\n const doc = this._getDocument();\n return doc.defaultView || window;\n }", "_getWindow() {\n const doc = this._getDocument();\n return doc.defaultView || window;\n }", "_getWindow() {\n const doc = this._getDocument();\n return doc.defaultView || window;\n }", "function getWindow() {\n return window;\n}", "_getWindow() {\n const win = this._document.defaultView || window;\n return typeof win === 'object' && win ? win : null;\n }", "function getWindow(){\n return this;\n}", "function getWindow(elem){return jQuery.isWindow(elem)?elem:elem.nodeType===9&&elem.defaultView;}", "function getWindow(elem){return jQuery.isWindow(elem)?elem:elem.nodeType===9&&elem.defaultView;}", "function getWindow(elem){return jQuery.isWindow(elem)?elem:elem.nodeType===9&&elem.defaultView;}", "function getWindow(elem){return jQuery.isWindow(elem)?elem:elem.nodeType===9&&elem.defaultView;}", "function getWindow(elem){return jQuery.isWindow(elem)?elem:elem.nodeType===9?elem.defaultView||elem.parentWindow:false;}", "function getWindow(elem){return jQuery.isWindow(elem)?elem:elem.nodeType === 9 && elem.defaultView;}", "function getWindow(elem) {\n return jQuery.isWindow(elem) ?\n elem :\n elem.nodeType === 9 ?\n elem.defaultView || elem.parentWindow :\n false;\n }", "function Get_Window(html)\n{\n\t//try to get its document\n\tvar doc = Get_Document(html);\n\t//if its valid get its window\n\treturn doc ? doc.defaultView : null;\n}", "getDefaultWindow() {\n return this._windows.get('Default');\n }", "function getWindowWithInteraction() {\n\t\t\tvar $windowDragging = $(\n\t\t\t\t\t\".\" + self.classes.window +\n\t\t\t\t\t\".\" + self.classes.uiDraggableDragging\n\t\t\t\t),\n\t\t\t $windowResizing = $(\n\t\t\t \t\".\" + self.classes.window +\n\t\t\t \t\".\" + self.classes.uiResizableResizing\n\t\t\t ),\n\t\t\t windowInstance;\n\n\t\t\tif ( $windowDragging.length || $windowResizing.length ) {\n\t\t\t\tvar $elem = ( $windowDragging.length\n\t\t\t\t\t? $windowDragging\n\t\t\t\t\t: $windowResizing )\n\t\t\t\t\t.children( \".\" + self.classes.windowContent );\n\n\t\t\t\tif ( $elem.is( self.windows() ) ) {\n\t\t\t\t\treturn $elem;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $();\n\t\t}", "function getWindow(elem) {\n return jQuery.isWindow(elem) ? elem : elem.nodeType === 9 ? elem.defaultView || elem.parentWindow : false;\n }", "_getWindow() {\n const doc = this._getDocument();\n const win = (doc === null || doc === void 0 ? void 0 : doc.defaultView) || window;\n return typeof win === 'object' && win ? win : null;\n }", "getWindowHandle() {\r\n var window = browser.getAllWindowHandles();\r\n window.then((handles) => {\r\n let childWindow = handles[0];\r\n let parentWindow = handles[1];\r\n browser.getWindowHandle().then((window) => {\r\n if (childWindow == window) {\r\n browser.switchTo().window(parentWindow);\r\n } else {\r\n browser.switchTo().window(childWindow);\r\n }\r\n });\r\n });\r\n }", "function getWindow(elem) {\n return jQuery.isWindow(elem) ? elem : elem.nodeType === 9 && elem.defaultView;\n }", "function getWindow() {\n return BrowserWindow.getAllWindows()[0];\n}", "function getNodeWindow(node){\r\n\t\treturn node.ownerDocument.defaultView;\r\n\t}", "function getWindow(elem) {\n return jQuery.isWindow(elem) ? elem : elem.nodeType === 9 && elem.defaultView;\n }", "function h$ghcjs_currentWindow() {\n return window;\n}", "function MainPopInWindow() {\n\treturn main.document.getElementById(\"popInWindow_n\");\n}", "function Window() {}", "get windowParent() {\n\t\treturn this.nativeElement ? this.nativeElement.windowParent : undefined;\n\t}", "function locateWindow() {\n if (typeof window !== \"undefined\") {\n return window;\n }\n else if (typeof self !== \"undefined\") {\n return self;\n }\n return fallbackWindow;\n}", "function locateWindow() {\n if (typeof window !== \"undefined\") {\n return window;\n }\n else if (typeof self !== \"undefined\") {\n return self;\n }\n return fallbackWindow;\n}", "function locateWindow() {\n if (typeof window !== \"undefined\") {\n return window;\n }\n else if (typeof self !== \"undefined\") {\n return self;\n }\n return fallbackWindow;\n}", "function getWindow( elem ) {\r\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\r\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}", "function getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}" ]
[ "0.7417811", "0.7417811", "0.730527", "0.72826046", "0.72826046", "0.72826046", "0.7259252", "0.7259252", "0.7259252", "0.7259252", "0.7259252", "0.7259252", "0.72521734", "0.7209393", "0.7180999", "0.7130325", "0.7130325", "0.7130325", "0.7130325", "0.7104723", "0.7103669", "0.70077276", "0.69774556", "0.6925873", "0.6916439", "0.69161004", "0.687835", "0.6862709", "0.686043", "0.68189573", "0.6701553", "0.66925097", "0.66837054", "0.6666894", "0.6644104", "0.6636477", "0.6633986", "0.6633986", "0.6633986", "0.66308236", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691", "0.6591691" ]
0.0
-1
Stops a mouse/touch event from doing it's native browser action
function preventDefault(ev) { ev.preventDefault(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "cancelTouch() {\n this.stopTouching_();\n this.endTracking_();\n // If clients needed to be aware of this, we could fire a cancel event\n // here.\n }", "stopDrag() {\n document.body.onmousemove = null;\n document.body.onmouseup = null;\n }", "stopTouching_() {\n // Mark as no longer being touched\n this.activeTouch_ = undefined;\n\n // If we're waiting for a long press, stop\n window.clearTimeout(this.longPressTimeout_);\n\n // Stop listening for move/end events until there's another touch.\n // We don't want to leave handlers piled up on the document.\n // Note that there's no harm in removing handlers that weren't added, so\n // rather than track whether we're using mouse or touch we do both.\n this.events_.remove(document, 'touchmove');\n this.events_.remove(document, 'touchend');\n this.events_.remove(document, 'touchcancel');\n this.events_.remove(document, 'mousemove');\n this.events_.remove(document, 'mouseup');\n }", "disable() {\n this.stopTouching_();\n this.events_.removeAll();\n }", "function spStopMouseEvent() {\n//\tUnregister the capturing event handlers.\n\tif (document.removeEventListener) { // DOM Event Model\n\t\tdocument.removeEventListener(\"mouseup\", spMouseUpEvent, true);\n\t}\n\telse if (document.detachEvent) { // IE 5+ Event Model\n\t\tdocument.detachEvent(\"onmouseup\", spMouseUpEvent);\n\t}\n\telse { // IE 4 Event Model\n\t\tdocument.onmouseup = spOldHandler;\n\t}\n}", "function spStopMouseEvent() {\n//\tUnregister the capturing event handlers.\n\tif (document.removeEventListener) { // DOM Event Model\n\t\tdocument.removeEventListener(\"mouseup\", spMouseUpEvent, true);\n\t}\n\telse if (document.detachEvent) { // IE 5+ Event Model\n\t\tdocument.detachEvent(\"onmouseup\", spMouseUpEvent);\n\t}\n\telse { // IE 4 Event Model\n\t\tdocument.onmouseup = spOldHandler;\n\t}\n}", "function disableMouseTouch() {\n var originalOnTouch = L.Draw.Polyline.prototype._onTouch;\n L.Draw.Polyline.prototype._onTouch = e => {\n if( e.originalEvent.pointerType != 'mouse' ) {\n return originalOnTouch.call(this, e);\n }\n }\n }", "function stopMouseEventHandlers() {\r\n\r\n me._bStopMouseEventHandlers = true;\r\n \r\n window.setTimeout(function () {\r\n \r\n me._bStopMouseEventHandlers = false;\r\n \r\n }, 10);\r\n\r\n }", "function stop() {\n view.root.removeEventListener(\"mouseup\", stop);\n view.root.removeEventListener(\"dragstart\", stop);\n view.root.removeEventListener(\"mousemove\", move);\n if (key.getState(view.state) != null) { view.dispatch(view.state.tr.setMeta(key, -1)); }\n }", "function touch_end_handler(e) {\n if (!e.touches) mouse.down = false; //If there are no more touches on the screen, sets \"down\" to false.\n }", "function cancelTouch()\n\t\t\t {\n\t\t\t\t document.removeEventListener('touchend', onTouchEnd);\n\t\t\t\t document.removeEventListener('touchmove', onTouchMove);\n\t\t\t\t \n\t\t\t\t startX = endX = null;\n\t\t\t }", "_stopTouchObserver() {\n for (var i = 0; i < this.__touchEventNames.length; i++) {\n qx.bom.Event.removeNativeListener(\n this.__target,\n this.__touchEventNames[i],\n this.__onTouchEventWrapper\n );\n }\n }", "function touchMoved() {\n // do some stuff\n return false;\n}", "function stopDrag() {\n document.documentElement.removeEventListener(\"mousemove\", doDrag, false);\n document.documentElement.removeEventListener(\"pointerup\", stopDrag, false);\n document.documentElement.removeEventListener(\"mouseup\", stopDrag, false);\n }", "function touchMoved() {\n // do some stuff\n return false;\n}", "function touchMoved() {\n // do some stuff\n return false;\n}", "function touchMoved() {\n // do some stuff\n return false;\n}", "function touchMoved() {\n return false;\n}", "stopEvent(event) {\n return false;\n }", "function mouseUp(e) {\n clickObj.mouseDown = false;\n $(window).unbind('mousemove');\n }", "function mousePressed(){\n\treturn false;\n}", "_stop_mouse_track() {\n\t\t\tif (this.track_id) {\n\t\t\t\tthis.track_id = clearInterval(this.track_id);\n\t\t\t}\n\t\t\tthis.add_info('movement', this.current_mouse_movement, 'shape');\n\t\t}", "function clickHandler(){\n\t\taudioContext.resume();\n\t\tdocument.body.removeEventListener( \"click\", clickHandler );\n\t\tdocument.body.removeEventListener( \"touchend\", clickHandler);\n\t}", "function disablePoint() {\n\t if (!_enabled) {\n\t return;\n\t }\n\t\n\t _enabled = false;\n\t document.removeEventListener('mouseup', handleDocumentMouseup);\n\t}", "function myUp() {\n canvas.onmousemove = null;\n}", "function disableTouch (element) {\n $(element).off('CornerstoneToolsTouchStart', dragStartCallback);\n}", "function touchMoved() {\n // do some stuff\n return false;\n }", "function onMouseMoveEventOffHandler(ev){\n if(WorkStore.isSelected()) return;\n\n\n window.removeEventListener(MOUSE_DOWN, onMouseDownHandler);\n document.body.classList.remove(\"drag\");\n document.body.classList.remove(\"dragging\");\n}", "function touch( event ) {\n\t\thalt_counter = halt_threshold;\n\n\t\tif ( dir_vertical )\n\t\t\tmouse_pos = viewport.getBoundingClientRect().top + y_position( event );\n\t\telse\n\t\t\tmouse_pos = viewport.getBoundingClientRect().left + x_position( event );\n\t\tlast_time = Date.now();\n\t\tclearInterval( accumulator_ticker );\n\t\twindow.addEventListener( 'mousemove', handle_mouse_move );\n\t\twindow.addEventListener( 'mouseup', release );\n\t\taccumulator_ticker = setInterval( track_drag, 100 );\n\t\tprev_mouse_pos = mouse_pos;\n\t\tticker_pos = mouse_pos;\n\t\tevent.stopPropagation();\n\t\treturn false;\n\t}", "function unTouch() {\r\n // Clears setInterval timer\r\n clearInterval(time);\r\n}", "function mousePressed(e) {\n return false;\n}", "off(eventType, callback)\n\t{\n\t\tif(typeof this.mouseEvents[eventType] !== 'undefined')\n\t\t\tthis.mouseEvents[eventType] = null;\n\t}", "function disableMouse() {\n\tnoMouse = true;\n}", "static stopEvent(evt) {\n evt.preventDefault(); evt.stopPropagation(); \n }", "function unTouch() {\n // Clears setInterval timer\n clearInterval(time);\n}", "function mousePressed() {\n return false;\n}", "function StopEvent(e)\n{\n if(window.event)\n {\n window.event.cancelBubble = true;\n window.event.returnValue = false; \n }\n \n if(e && e.stopPropagation && e.preventDefault)\n {\n e.stopPropagation();\n e.preventDefault(); \n }\n}", "handletouchend() {\n var mouseEvent = new MouseEvent(\"mouseup\", {});\n this.canvas.dispatchEvent(mouseEvent);\n }", "function doTouchout(e) {\n console.log(e.type);\n //ctx.closePath();\n dragging = false;\n}", "function myUp(){\n canvas.onmousemove=null;\n}", "function stopSlider() {\n document.removeEventListener('mousemove', moveSlider);\n slider.style.cursor = 'grab';\n }", "function onMouseUp(e){\n mouseDown = false;\n}", "function unlistenDrag(){\n S.lib.removeEvent(document, 'mousemove', positionDrag);\n S.lib.removeEvent(document, 'mouseup', unlistenDrag); // clean up\n\n if(S.client.isGecko)\n U.get(drag_id).style.cursor = '-moz-grab';\n }", "function stopEvents(e){ \n items.classList.remove(\"active\"); \n this.removeEventListener('mousemove', scrollPosition); \n}", "function dragStop(event) {\n // Stop capturing mousemove and mouseup events.\n document.removeEventListener(\"mousemove\", dragGo, true);\n document.removeEventListener(\"mouseup\", dragStop, true);\n d = null;\n}", "function stopPainting() {\n if (artPad.localUser && artPad.localUser.painting == true) {\n artPad.localUser.painting = false;\n artPad.localUser.inputSequence.push([4, false]);\n artPad.localUser.handleLocalInput([4, false]);\n } \n document.body.classList.remove(\"unselectable\");\n}", "function mouseOff() {\r\ndocument.body.style.cursor = \"default\";\r\n}", "function mouse_up_handler() {\n mouse.down = false; \n }", "function disableMouse(clic) {\r\n document.addEventListener(\"click\", e => {\r\n if (clic) {\r\n e.stopPropagation();\r\n e.preventDefault();\r\n }\r\n }, true);\r\n}", "function stopDrag() {\n document.removeEventListener('mousemove', moveAlong);\n document.removeEventListener('mouseup', stopDrag);\n }", "function trapClickAndEnd(event) {\n var untrap; // trap the click in case we are part of an active\n // drag operation. This will effectively prevent\n // the ghost click that cannot be canceled otherwise.\n\n if (context.active) {\n untrap = install(eventBus); // remove trap after minimal delay\n\n setTimeout(untrap, 400); // prevent default action (click)\n\n preventDefault(event);\n }\n\n end(event);\n }", "function onTouchEnd(event) {\n\n touch.handled = false;\n\n }", "function ignorePendingMouseEvents() { ignore_mouse = guac_mouse.touchMouseThreshold; }", "touchHandler(e) {\n var touches = e.changedTouches, first = touches[0], type = \"\";\n switch (e.type){\n case \"touchstart\":\n type = \"mousedown\";\n break;\n case \"touchmove\":\n type = \"mousemove\";\n break;\n case \"touchend\":\n type = \"mouseup\";\n break;\n case \"touchcancel\":\n type = \"mouseup\";\n break;\n default:\n return;\n }\n var simulatedEvent = document.createEvent(\"MouseEvent\");\n simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0/*left*/, null);\n first.target.dispatchEvent(simulatedEvent);\n e.preventDefault();\n }", "function CALCULATE_TOUCH_UP_OR_MOUSE_UP() {\r\n \r\n GLOBAL_CLICK.CLICK_PRESSED = false;\r\n \r\n }", "function onCanvasTouchEnd() {\n window.mouseDown = false;\n window.lastCellClicked = null;\n event.preventDefault();\n}", "function closeDragElement(e) {\n document.onmouseup = null;\n document.onmousemove = null;\n document.onpointerup = null;\n }", "function $stopEvent(e) {\r\n\t\tif (e.preventDefault) e.preventDefault();\r\n\t\telse e.returnValue = false;\t\t\r\n\t\tif (e.stopPropagation) e.stopPropagation;\r\n\t\telse e.cancelBubble = true;\r\n\t}", "function pointerDown(event) {\n\t\t\tif (event.pointerType === 'touch') {\n\t\t\t\ttouchStart();\n\t\t\t}\n\t\t}", "function box_touchstartHandler(event) {\r\n dragging = false;\r\n }", "function disableClick() {\n body.style.pointerEvents = 'none';\n setTimeout(function() {body.style.pointerEvents = 'auto';}, 1000);\n}", "function mouseReleased() {\r\n mouseIsDown = false;\r\n}", "_onMouseUp () {\n document.removeEventListener(\"mousemove\", this._onMouseMove);\n document.removeEventListener(\"touchmove\", this._onMouseMove);\n\n document.removeEventListener(\"mouseup\", this._onMouseUp);\n document.removeEventListener(\"touchend\", this._onMouseUp);\n }", "function disableClick(){\r\n body.style.pointerEvents='none';\r\n setTimeout(function() {body.style.pointerEvents='auto';},1000);\r\n}", "function stop() {\n\t\t\t/* Stop the engine. */\n\t\t\tengine.stop();\n\t\t\tdisplay.canvas.removeEventListener(\"touchstart\", touchStartDisplay);\n\t\t\twindow.removeEventListener(\"resize\", resizeWindow);\n\t\t}", "_mouseUp() {\n if (this._currentHandle) {\n this._currentHandle.style.cursor = 'grab';\n this._currentHandle.classList.remove('is-dragged');\n }\n document.body.classList.remove('u-coral-closedHand');\n\n events.off('mousemove.Slider', this._draggingHandler);\n events.off('touchmove.Slider', this._draggingHandler);\n events.off('mouseup.Slider', this._mouseUpHandler);\n events.off('touchend.Slider', this._mouseUpHandler);\n events.off('touchcancel.Slider', this._mouseUpHandler);\n\n this._currentHandle = null;\n this._draggingHandler = null;\n this._mouseUpHandler = null;\n }", "stopEventPropagation(){\n var anchor = this.anchor;\n anchor.style.cursor = 'auto';\n \n ['click', 'dblclick', 'contextmenu', 'wheel', 'mousedown', 'touchstart',\n 'pointerdown']\n .forEach(function(event) {\n anchor.addEventListener(event, function(e) {\n e.stopPropagation();\n });\n });\n }", "function stopEvent(e) {\n //var eve = e || window.event;\n e.preventDefault && e.preventDefault();\n e.stopPropagation && e.stopPropagation();\n e.returnValue = false;\n e.cancelBubble = true;\n return false;\n}", "function unblock_user_interaction(paper) {\n paper.setInteractivity(true);\n}", "function stopDrawing(event) {\n\tdrawingMode = false;\n\tmouseUpDownLabel.innerHTML = \"Mouse Button Up (moving mode)\";\n}", "stopEvent () {\n this._stop = true;\n }", "function touchEnd(event) {ALLOW_ACTION_ON_SWIPE_END=true;} // last touch end event sets to allow clicks.", "function documentMouseUpHandler(event) {\n mouseIsDown = false;\n }", "function mouseup(){\n mouse_down = false;\n}", "function mousedownForCanvas(event)\n{\n global_mouseButtonDown = true;\n event.preventDefault(); //need? (maybe not on desktop)\n}", "function killEvent(e) {\r if(e.preventDefault) {\r\t if(typeof(e.preventDefault)=='function') e.preventDefault();\r\t if(typeof(e.stopPropagation)=='function')\te.stopPropagation();\r\t else e.stopPropagation = e.cancelable;\r }else{\r\t e.returnValue = false;\r\t e.cancelBubble = true;\r }\r}", "function preventTouchClick() {\n const onClick = function(event){\n event.preventDefault();\n\n document.removeEventListener('click', onClick);\n };\n document.addEventListener('click', onClick);\n setTimeout(function() {\n document.removeEventListener('click', onClick);\n }, 100);\n }", "function release( event ) {\n\t\tclearInterval( accumulator_ticker );\n\t\twindow.removeEventListener( 'mousemove', handle_mouse_move );\n\t\twindow.removeEventListener( 'mouseup', release );\n\t\thand_control = false;\n\t\tinit_inertia();\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t\treturn false;\n\t}", "function uueventstop(eventObject) { // @param EventObject:\r\n // @return EventObject:\r\n uu.ie ? (eventObject.cancelBubble = true) : eventObject.stopPropagation();\r\n uu.ie ? (eventObject.returnValue = false) : eventObject.preventDefault();\r\n return eventObject;\r\n}", "function stopDraw(e) {\n\t\tbrush_size = 1;\n\t\te.preventDefault();\n\t\tcanvas.onmousemove = null;\t\n\t}", "stop() {\n\t\tif (this.hasDeviceMotion) {\n\t\t\twindow.removeEventListener('devicemotion', this, false);\n\t\t}\n\t\tthis.reset();\n\t}", "function stopEvent(e) {\n\t\te = e || window.event;\n\t\t\n\t\tif (e.preventDefault) {\n\t\t\te.stopPropagation();\n\t\t\te.preventDefault();\n\t\t\t\n\t\t} else {\n\t\t\te.returnValue = false;\t\n\t\t\te.cancelBubble = true;\n\t\t} \n\t\treturn false;\n\t}", "function stopDrawing(event) {\n isDrawing = false;\n [lastX, lastY] = [0, 0];\n}", "function removeTouchHandler(){\n \t\t\tif(isTouchDevice || isTouch){\n \t\t\t\t//Microsoft pointers\n \t\t\t\tMSPointer = getMSPointer();\n\n \t\t\t\t$(document).off('touchstart ' + MSPointer.down);\n \t\t\t\t$(document).off('touchmove ' + MSPointer.move);\n \t\t\t}\n \t\t}", "function trapClickAndEnd(event) {\n\n var untrap;\n\n // trap the click in case we are part of an active\n // drag operation. This will effectively prevent\n // the ghost click that cannot be canceled otherwise.\n if (context.active) {\n\n untrap = installClickTrap(eventBus);\n\n // remove trap after minimal delay\n setTimeout(untrap, 400);\n\n // prevent default action (click)\n preventDefault(event);\n }\n\n end(event);\n }", "function onPointerDown(event) {\n\n if (event.pointerType === event.MSPOINTER_TYPE_TOUCH) {\n event.touches = [{clientX: event.clientX, clientY: event.clientY}];\n onTouchStart(event);\n }\n\n }", "touchEnd(event) {\n event.stopPropagation();\n }", "function stopEvent(event)\n{\n event = event || window.event;\n\n if(event)\n {\n if(event.stopPropagation) event.stopPropagation();\n if(event.preventDefault) event.preventDefault();\n\n if(typeof event.cancelBubble != \"undefined\")\n {\n event.cancelBubble = true;\n event.returnValue = false;\n }\n }\n\n return false;\n}", "_onMouseUpWithHandMode() {\n const canvas = this.getCanvas();\n const { moveHand, stopHand } = this._listeners;\n\n canvas.off({\n 'mouse:move': moveHand,\n 'mouse:up': stopHand,\n });\n\n this._startHandPoint = null;\n }", "function stopEvent(e) {\n\t\tif (e.stopPropagation) e.stopPropagation();\n\t\tif (e.preventDefault) e.preventDefault();\n\t\te.cancelBubble = true;\n\t\te.returnValue = false;\n\t\treturn false;\n\t}", "pointercancel(payload) {\n domEventSequences.pointercancel(node, payload);\n }", "function stopEvent(e) {\n\n\tif (!e) {\n\t\tvar e = window.event;\n\t}\n\t//e.cancelBubble is supported by IE -\n\t// this will kill the bubbling process.\n\te.cancelBubble = true;\n\te.returnValue = false;\n\n\t//e.stopPropagation works only in Firefox.\n\tif (e.stopPropagation) {\n\t\te.stopPropagation();\n\t}\n\tif (e.preventDefault) {\n\t\te.preventDefault();\n\t}\n\n\n\treturn false;\n}", "function Browser_CancelBubbleOnly(event)\n{\n\t//cancel bubble\n\tevent.cancelBubble = true;\n\t//if we have designer controller\n\tif (__DESIGNER_CONTROLLER)\n\t{\n\t\t//notify selection\n\t\tWI4_PlugIn_Generic_ForwardEvent(event);\n\t}\n\t//was this a right click? with a prevent default?\n\tif (event.type === __BROWSER_EVENT_MOUSERIGHT && event.preventDefault)\n\t{\n\t\t//trigger it\n\t\tevent.preventDefault();\n\t}\n}", "function trapClickAndEnd(event) {\n\n var untrap;\n\n // trap the click in case we are part of an active\n // drag operation. This will effectively prevent\n // the ghost click that cannot be canceled otherwise.\n if (context.active) {\n\n untrap = install(eventBus);\n\n // remove trap after minimal delay\n setTimeout(untrap, 400);\n\n // prevent default action (click)\n preventDefault(event);\n }\n\n end(event);\n }", "function mouseReleased () {\n noLoop();\n}", "function stopEvent(event)\r\n {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n }", "_onMouseMove()\n {\n this.deactivate();\n }", "function removeTouchHandler(){\n if(isTouchDevice || isTouch){\n //Microsoft pointers\n var MSPointer = getMSPointer();\n\n $(WRAPPER_SEL).off('touchstart ' + MSPointer.down);\n $(WRAPPER_SEL).off('touchmove ' + MSPointer.move);\n }\n }", "function removeTouchHandler(){\n if(isTouchDevice || isTouch){\n //Microsoft pointers\n var MSPointer = getMSPointer();\n\n $(WRAPPER_SEL).off('touchstart ' + MSPointer.down);\n $(WRAPPER_SEL).off('touchmove ' + MSPointer.move);\n }\n }", "function killEvent(evt)\n {\n evt.preventDefault(); \n evt.stopPropagation();\n return false; \n }", "handletouchstart(e) {\n var touch = e.touches[0];\n var mouseEvent = new MouseEvent(\"mousedown\", {\n clientX: touch.clientX,\n clientY: touch.clientY\n })\n this.canvas.dispatchEvent(mouseEvent);\n e.preventDefault();\n }" ]
[ "0.7440415", "0.73385", "0.7294391", "0.72323716", "0.7153118", "0.7153118", "0.7078613", "0.7012811", "0.6898709", "0.6885639", "0.68139887", "0.6790691", "0.6758636", "0.6741793", "0.6721983", "0.6721983", "0.6721983", "0.6711374", "0.6703125", "0.6611802", "0.66071373", "0.65828425", "0.6579331", "0.6539973", "0.65044117", "0.65026426", "0.6483618", "0.64831716", "0.64662206", "0.6464471", "0.6461039", "0.64544755", "0.64514947", "0.644775", "0.64459515", "0.6443943", "0.6437405", "0.6434029", "0.6425828", "0.64143026", "0.6410731", "0.6408541", "0.6396273", "0.63956726", "0.63919246", "0.638245", "0.63813806", "0.63736606", "0.6370039", "0.636971", "0.63659275", "0.6362245", "0.6353578", "0.63458073", "0.6336261", "0.63320345", "0.6323827", "0.63188905", "0.6315582", "0.6309229", "0.63027793", "0.629515", "0.6293942", "0.6289033", "0.6287035", "0.62708664", "0.6268044", "0.6261901", "0.625808", "0.62533474", "0.62526816", "0.6227312", "0.6217394", "0.62168217", "0.62125766", "0.6211679", "0.6210617", "0.62092465", "0.62061703", "0.6204513", "0.6192961", "0.61839044", "0.61766946", "0.6169916", "0.61626184", "0.61541504", "0.61394733", "0.6129454", "0.6127568", "0.61160845", "0.6113056", "0.61104596", "0.61081296", "0.6106067", "0.60911417", "0.60870886", "0.6086192", "0.6084323", "0.6084323", "0.60829794", "0.6075208" ]
0.0
-1
triggered only when the next single subsequent transition finishes
function whenTransitionDone(el, callback) { var realCallback = function (ev) { callback(ev); transitionEventNames.forEach(function (eventName) { el.removeEventListener(eventName, realCallback); }); }; transitionEventNames.forEach(function (eventName) { el.addEventListener(eventName, realCallback); // cross-browser way to determine when the transition finishes }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "transitionCompleted() {\n // implement if needed\n }", "function delayTransitionInComplete() { \n\t\t//setTimeout(transitionInComplete, 0);\n\t\ttransitionInComplete();\n\t}", "function completeOnTransitionEnd(ev) {\n if (ev.target !== this) return;\n transitionComplete();\n }", "function completeOnTransitionEnd(ev) {\n if (ev.target !== this) return;\n transitionComplete();\n }", "function whenTransitionDone(el, callback) {\n var realCallback = function realCallback(ev) {\n callback(ev);\n transitionEventNames.forEach(function (eventName) {\n el.removeEventListener(eventName, realCallback);\n });\n };\n\n transitionEventNames.forEach(function (eventName) {\n el.addEventListener(eventName, realCallback); // cross-browser way to determine when the transition finishes\n });\n }", "function next() {\n\t\n\tif (currentTransformStep === transformSteps.length) {\n\t\tconsole.log('all transformations performed')\n\t}\n\telse\n\t\ttransformSteps[currentTransformStep++]()\n\t\t\n}", "onTransitionEnd () {\n this.setState((prevState) => {\n return prevState.movingTo ? this.silentState : {}\n })\n\n // set next index if transition buffer has something else\n if (this.transitionBuffer.length > 0) {\n this.gotoSlide(this.transitionBuffer.shift())\n } else {\n // re-start autoplay\n this.setAutoPlay()\n }\n }", "runOneStepForwards() {\n this.stateHistory.nextState();\n }", "function whenTransitionDone(el, callback) {\n var realCallback = function realCallback(ev) {\n callback(ev);\n transitionEventNames.forEach(function (eventName) {\n el.removeEventListener(eventName, realCallback);\n });\n };\n\n transitionEventNames.forEach(function (eventName) {\n el.addEventListener(eventName, realCallback); // cross-browser way to determine when the transition finishes\n });\n }", "checkOnTransition() {\n this.timeout = 0;\n if( ! this.transitionStarted) {\n console.warn('Transition failed to start for: ', this.cssName, this.target);\n this.cleanup();\n this.events.emit('complete', transitionEvent(this));\n }\n }", "function finished(ev){if(ev&&ev.target!==element[0])return;if(ev)$timeout.cancel(timer);element.off($mdConstant.CSS.TRANSITIONEND,finished);// Never reject since ngAnimate may cause timeouts due missed transitionEnd events\n\tresolve();}", "stateTransition(){return}", "function whenTransitionDone(el, callback) {\n var realCallback = function (ev) {\n callback(ev);\n transitionEventNames.forEach(function (eventName) {\n el.removeEventListener(eventName, realCallback);\n });\n };\n transitionEventNames.forEach(function (eventName) {\n el.addEventListener(eventName, realCallback); // cross-browser way to determine when the transition finishes\n });\n}", "function transitionThreeUp(){\n\n}", "function start() {\n classes.isTransition = true;\n original.addEventListener('transitionend', end);\n }", "onTransitionEnd() {\n this.nextKeyframe();\n }", "function finished(ev) {\n if ( ev && ev.target !== element[0]) return;\n\n if ( ev ) $timeout.cancel(timer);\n element.off($mdConstant.CSS.TRANSITIONEND, finished);\n\n // Never reject since ngAnimate may cause timeouts due missed transitionEnd events\n resolve();\n\n }", "notifyAnimationEnd() {}", "willTransition() {\n this.refresh();\n console.log(\"WILL TANSITION\");\n }", "async _step() {\n\t\t// Close our stand if it was open\n\t\tthis.close_stand();\n\n\t\tfor (let state of this.states) {\n\t\t\tif (state.predicate && !state.predicate()) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tthis.state.name = state.name;\n\t\t\twindow.set_message(state.name);\n\t\t\tawait this._current_state();\n\t\t\treturn;\n\t\t}\n\n\t\tLogging.error('No states found!')\n\t\tthis.stop();\n\t}", "function _transitionComplete() {\n this.dispatchEvent( BaseTransition.END_EVENT, { target: this } );\n\n if ( element.scrollHeight > previousHeight ) {\n element.style.maxHeight = element.scrollHeight + 'px';\n }\n }", "function finished(ev) {\n if ( ev && ev.target !== element[0]) return;\n\n if ( ev ) $timeout.cancel(timer);\n element.off($mdConstant.CSS.TRANSITIONEND, finished);\n\n // Never reject since ngAnimate may cause timeouts due missed transitionEnd events\n resolve();\n\n }", "pageAnimatingInCompleted() {\n eventBus.trigger(eventBus.eventKeys.PAGE_ANIMATED_IN_COMPLETE);\n }", "onFinish() {}", "function finished(ev) {\n if (ev && ev.target !== element[0]) return;\n\n if (ev) $timeout.cancel(timer);\n element.off($mdConstant.CSS.TRANSITIONEND, finished);\n\n // Never reject since ngAnimate may cause timeouts due missed transitionEnd events\n resolve();\n\n }", "function onNext() {\n\n\t\tif (step < 3) {\n\t\t\tdispatch(INCREMENT_STEP());\n\t\t}\n\n\t\t// update button state\n\t\tsetBackButtonDisabled(false);\n\t}", "didTransition() {\n this.controller.set('isTransitionDone', true);\n // This is needed in order to update the links in this parent route,\n // giving the \"currentRouteName\" time to resolve\n later(this, () => {\n if (this.router.currentRouteName.includes('explore')) {\n this.controller.set('isEditModeActive', false);\n }\n });\n }", "function launchTransition()\n\t\t{\n\t\t\t// delete active_class before change :\n\t\t\t_this.$refs.medias.removeClass(_this._getSetting('classes.active'));\n\n\t\t\t// delete active_class before change :\n\t\t\t_this.$refs.current.addClass(_this._getSetting('classes.active'));\n\n\t\t\t// check transition type :\n\t\t\tif (_this._getSetting('transition') && _this._isNativeTransition(_this._getSetting('transition.callback'))) _this._transition(_this._getSetting('transition.callback'));\n\t\t\telse if (_this._getSetting('transition') && _this._getSetting('transition.callback')) _this._getSetting('transition.callback')(_this);\n\t\t\t\n\t\t\t// callback :\n\t\t\tif (_this._getSetting('onChange')) _this._getSetting('onChange')(_this);\n\t\t\t$this.trigger('slidizle.change', [_this]);\n\n\t\t\t// check if the current if greater than the previous :\n\t\t\tif (_this.$refs.current.index() == 0 && _this.$refs.previous)\n\t\t\t{\n\t\t\t\tif (_this.$refs.previous.index() == _this.$refs.medias.length-1) {\n\t\t\t\t\tif (_this._getSetting('onNext')) _this._getSetting('onNext')(_this);\n\t\t\t\t\t$this.trigger('slidizle.next', [_this]);\n\t\t\t\t} else {\n\t\t\t\t\tif (_this._getSetting('onPrevious')) _this._getSetting('onPrevious')(_this);\n\t\t\t\t\t$this.trigger('slidizle.previous', [_this]);\n\t\t\t\t}\n\t\t\t} else if (_this.$refs.current.index() == _this.$refs.medias.length-1 && _this.$refs.previous)\n\t\t\t{\n\t\t\t\tif (_this.$refs.previous.index() == 0) {\n\t\t\t\t\tif (_this._getSetting('onPrevious')) _this._getSetting('onPrevious')(_this);\n\t\t\t\t\t$this.trigger('slidizle.previous', [_this]);\n\t\t\t\t} else {\n\t\t\t\t\tif (_this._getSetting('onNext')) _this._getSetting('onNext')(_this);\n\t\t\t\t\t$this.trigger('slidizle.next', [_this]);\n\t\t\t\t}\n\t\t\t} else if (_this.$refs.previous) {\n\t\t\t\tif (_this.$refs.current.index() > _this.$refs.previous.index()) {\n\t\t\t\t\tif (_this._getSetting('onNext')) _this._getSetting('onNext')(_this);\n\t\t\t\t\t$this.trigger('slidizle.next', [_this]);\n\t\t\t\t} else {\n\t\t\t\t\tif (_this._getSetting('onPrevious')) _this._getSetting('onPrevious')(_this);\n\t\t\t\t\t$this.trigger('slidizle.previous', [_this]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (_this._getSetting('onNext')) _this._getSetting('onNext')(_this);\n\t\t\t\t$this.trigger('slidizle.next', [_this]);\n\t\t\t}\n\n\t\t\t// init the timer :\n\t\t\tif (_this._getSetting('timeout') && _this.$refs.medias.length > 1 && _this.isPlaying && !_this.timer) {\n\t\t\t\tclearInterval(_this.timer);\n\t\t\t\t_this.timer = setInterval(function() {\n\t\t\t\t\t_this._tick();\n\t\t\t\t}, _this._getSetting('timerInterval'));\n\t\t\t}\n\t\t}", "function fireNextFrame() {\n // Trigger event for animator.\n // Notice, when animator handles the event, it also gives the callback event back.\n // Then, the flow automatically continues also here.\n firePause();\n changeToNextFrame();\n }", "function fireNextFrame() {\n // Trigger event for animator.\n // Notice, when animator handles the event, it also gives the callback event back.\n // Then, the flow automatically continues also here.\n firePause();\n changeToNextFrame();\n }", "function updateTransitions() {\r\n\r\n if (motion.currentTransition !== nullTransition) {\r\n // is this a new transition?\r\n if (motion.currentTransition.progress === 0) {\r\n // do we have overlapping transitions?\r\n if (motion.currentTransition.lastTransition !== nullTransition) {\r\n // is the last animation for the nested transition the same as the new animation?\r\n if (motion.currentTransition.lastTransition.lastAnimation === avatar.currentAnimation) {\r\n // then sync the nested transition's frequency time wheel for a smooth animation blend\r\n motion.frequencyTimeWheelPos = motion.currentTransition.lastTransition.lastFrequencyTimeWheelPos;\r\n }\r\n }\r\n }\r\n if (motion.currentTransition.updateProgress() === TRANSITION_COMPLETE) {\r\n motion.currentTransition = nullTransition;\r\n }\r\n }\r\n}", "function finished(ev) {\n if ( ev && ev.target !== element[0]) return;\n\n if ( ev ) $timeout.cancel(timer);\n element.off($mdConstant.CSS.TRANSITIONEND, finished);\n\n // Never reject since ngAnimate may cause timeouts due missed transitionEnd events\n resolve();\n\n }", "function finished(ev) {\n if ( ev && ev.target !== element[0]) return;\n\n if ( ev ) $timeout.cancel(timer);\n element.off($mdConstant.CSS.TRANSITIONEND, finished);\n\n // Never reject since ngAnimate may cause timeouts due missed transitionEnd events\n resolve();\n\n }", "function animateToEndState() {\n if (transition == null)\n throw new Error('Transition was already finished or never started.');\n\n for (const anim of document.getAnimations())\n anim.currentTime = anim.effect.getTiming().duration - 1;\n}", "finishTransition(transition) {\n // Unset the Semantic UI classes & styles for transitioning.\n transition.classes.forEach(c => this._renderer.removeClass(this._element, c));\n this._renderer.removeClass(this._element, `animating`);\n this._renderer.removeClass(this._element, transition.directionClass);\n this._renderer.removeStyle(this._element, `animationDuration`);\n this._renderer.removeStyle(this._element, `display`);\n if (transition.direction === TransitionDirection.In) {\n // If we have just animated in, we are now visible.\n this._isVisible = true;\n }\n else if (transition.direction === TransitionDirection.Out) {\n // If we have transitioned out, we should be invisible and hidden.\n this._isVisible = false;\n this._isHidden = true;\n }\n if (transition.onComplete) {\n // Call the user-defined transition callback.\n transition.onComplete();\n }\n // Delete the transition from the queue.\n this._queue.shift();\n this._isAnimating = false;\n this._changeDetector.markForCheck();\n // Immediately attempt to perform another transition.\n this.performTransition();\n }", "function fireTransition(transition,arcs1,arcs2) {\r\n let inplaces = collectInplaces(transition,arcs1),\r\n outplaces = collectOutplaces(transition,arcs2);\r\n for (let i = 0; i < inplaces.length; i++) {\r\n inplaces[i].set('tokens',inplaces[i].get('tokens') - 1);\r\n }\r\n for (let i = 0; i < outplaces.length; i++) {\r\n outplaces[i].set('tokens',outplaces[i].get('tokens') + 1);\r\n }\r\n }", "function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n } // Resets transitions and removes motion-specific classes", "function nextStep() {\n $scope.$evalAsync(() =>{\n $scope.$emit('menu_update_needed');\n $route.reload();\n });\n }", "function showSuccess() {\n transitionSteps(getCurrentStep(), $('.demo-success'));\n }", "function onEnd() {\n wrapper.classed( 'no-transition', true );\n wrapperNode.removeEventListener( 'transitionend', onEnd );\n }", "function animcompleted() {\n\t\t\t\t\t\t}", "handleNext() {\n this.currentMovePrevented = false;\n\n // Call the bound `onNext` handler if available\n const currentStep = this.steps[this.currentStep];\n if (currentStep && currentStep.options && currentStep.options.onNext) {\n currentStep.options.onNext(this.overlay.highlightedElement);\n }\n\n if (this.currentMovePrevented) {\n return;\n }\n\n this.moveNext();\n }", "run(){\n var a = this.action();\n while (a.isComplete()) {\n a.cleanUp();\n var oldState = this.state;\n this.preStateChange(a);\n this.stateTransition();\n this.enterState(oldState);\n if (oldState === this.state) {\n // if (this.state() != 'wait') self.debug('No state change from ' + this.name() + ':' + this.state());\n return;\n }\n a = this.action();\n }\n // this.debug('Run ' + a.string());\n a.run();\n }", "wait_GM_1st_AnimationEnd(){\n if(this.check_Reset())\n return;\n if (this.numberOfTries > this.maxNumberOfTries) {\n this.numberOfTries = -1;\n\n if (this.currentPlayer == 2)\n {\n this.scene.update_CameraRotation();\n this.state = 'WAIT_GM_CAMERA_ANIMATION_END';\n }\n else\n this.state = 'GAME_MOVIE';\n\n }\n this.numberOfTries++;\n }", "onTransitionEnd() {\n this.isInAnimation = false;\n // if any method in queue, then invoke it\n if (this.visualEffectQueue.length) {\n let action = this.visualEffectQueue.shift(); // remove method from queue and invoke it\n this.isInAnimation = action.isAnimated;\n action.action();\n }\n }", "applyTransition(percentDone) {\n return percentDone;\n }", "onFinish() {\n this.props.store.dispatch(ACTIONS.FINISH);\n }", "function confirm() {\n transition(CONFIRM);\n }", "function stepOne() {\n return new Promise(resolveStepOne => {\n // need a better shared reference to all of the cards\n const transitions = allTheCards.map((cardEl, i) => {\n return new Promise(resolve => {\n if (i === 0) {\n self.removeFirstCardClasses(cardEl);\n }\n cardEl.addEventListener('transitionend', function stepOneTransition () {\n cardEl.removeEventListener('transitionend', stepOneTransition);\n resolve();\n });\n const transition = 'top 1s';\n cardEl.style.transition = transition;\n cardEl.style.webkitTransition = transition;\n cardEl.style.MozTransition = transition;\n cardEl.style.msTransition = transition;\n cardEl.style.OTransition = transition;\n cardEl.style.top = '-1px';\n })\n });\n Promise.all(transitions).then(() => {\n resolveStepOne();\n });\n })\n }", "finish() {\n this.done = true;\n }", "function transitionEnd() {\n\t\t\t\t\tif (bouncing) {\n\t\t\t\t\t\tbouncing = false;\n\t\t\t\t\t\treboundScroll();\n\t\t\t\t\t}\n\n\t\t\t\t\tclearTimeout(timeoutID);\n\t\t\t\t}", "wait_GM_Camera_AnimationEnd(){\n if(this.check_Reset())\n return;\n if (this.scene.camera_rotation == 0) {\n this.state = 'GAME_MOVIE';\n }\n }", "function finish() {\n// if (--finished == 0) {\n if (!isFinished) {\n isFinished = true;\n Physics.there.style(self.from.getContainerBodyId(), {\n opacity: 0\n });\n\n self.dfd.resolve();\n }\n }", "function endall(transition, callback) { \n var n = 0; \n transition \n .each(function() { ++n; }) \n .each(\"end\", function() { if (!--n) callback.apply(this, arguments); }); \n}", "function endall(transition, callback) { \n var n = 0; \n transition \n .each(function() { ++n; }) \n .each(\"end\", function() { if (!--n) callback.apply(this, arguments); }); \n}", "function _sh_switch_workspace_tween_completed( ){\n\tTweener.removeTweens( this );\n}", "function drawCompleteNotify(transition, node) {\n if (transition.ease) {\n transition.each(\"end\", report);\n } else {\n report();\n }\n\n function report() {\n var eventInfo = {detail: {drawComplete:true}, bubbles:true};\n node.dispatchEvent(new CustomEvent(\"chart\", eventInfo));\n }\n }", "onFinish() {\n\t\tif (this.props.onFinish) {\n\t\t\tthis.props.onFinish();\n\t\t}\n\t}", "performTransition (trans) {\n if (trans === Transition.NullTransition) {\n return\n }\n const id = this.currentState.GetOutputState(trans)\n if (id === StateId.NullStateId) {\n return\n }\n // Update currentState\n this.currentStateId = id\n const state = this.states.find((s) => s.Id === id)\n if (state !== undefined) {\n // Post processing of old state\n this.currentState.DoBeforeLeaving()\n this.currentState = state\n // Reset the state to its desired condition before it can reason or act\n this.currentState.DoBeforeEntering()\n }\n }", "function onTransitionedIn(duration, callback) {\n onTransitionEnd(duration, callback);\n }", "_complete() {\n this._resetCurrent(true);\n\n super._complete();\n }", "_runTransitionHooks(nextState) {\n var hooks = this._getTransitionHooks(nextState);\n var nextLocation = this.nextLocation;\n\n try {\n for (var i = 0, len = hooks.length; i < len; ++i) {\n hooks[i]();\n\n if (this.nextLocation !== nextLocation)\n break; // No need to proceed further.\n }\n } catch (error) {\n this.handleError(error);\n return false;\n }\n\n // Allow the transition if nextLocation hasn't changed.\n return this.nextLocation === nextLocation;\n }", "function onTransitionedIn(duration, callback) {\n onTransitionEnd(duration, callback);\n }", "function transition() {\n generateNewColour();\n\n for (var key in Colour) {\n if(colour[key] > nextColour[key]) {\n colour[key] -= delta[key];\n if(colour[key] <= nextColour[key]) {\n delta[key] = 0;\n }\n }\n else {\n colour[key] += delta[key];\n if(colour[key] >= nextColour[key]) {\n delta[key] = 0;\n }\n }\n }\n }", "immediate() {\n this.frame = 0;\n this._timeout = 0;\n const event = transitionEvent(this);\n event.isFastForward = true;\n\n this.events.emit('firstframe', event);\n this.events.emit('secondframe', event);\n this.events.emit('complete', event);\n }", "function isFirstTransition() {\n return previousState == null;\n }", "function TweenComplete() {\n tweenSlide.eventComplete(function () {\n // Reset 'style' & 'transform' for slide\n that.ResetTFSlideCss();\n // Update the variable in toggle-end\n that.TOSLIDE.End();\n fxCSS.status = null;\n });\n }", "_onAnimationDone(event) {\n this._animationDone.next(event);\n this._isAnimating = false;\n }", "async onFinished() {}", "function endall(transition, callback) { \n\tvar n = 0; \n\ttransition \n\t\t.each(function() { ++n; }) \n\t\t.each(\"end\", function() { if (!--n) callback.apply(this, arguments); }); \n}", "function continueSlide() {\n self.slide = parseInt(newSlide);\n self.changingSlide = true;\n\n slidePos = self.slideRefs[newSlide].position;\n slideRot = self.slideRefs[newSlide].rotation;\n\n newTranslate = 'translate(-' + slidePos[0] + 'px, -' + slidePos[1] + 'px)';\n\n $m.css({\n msTransform: newTranslate,\n webkitTransform: newTranslate,\n transform: newTranslate\n });\n\n // Calculate the new HTML rotation\n if (slideRot < 0) {\n // Negative rotation\n slideRot -= 3;\n } else if (slideRot > 0) {\n // Positive rotation\n slideRot += 3;\n }\n\n newWindowRotate = 'rotate(' + (slideRot * -1) + 'deg)';\n\n $($M).css({\n msTransform: newWindowRotate,\n webkitTransform: newWindowRotate,\n transform: newWindowRotate\n });\n\n // When transition complete, reset changingSlide\n $m.one(transitionEnd, function () {\n // Previous slide and a popover needs to display\n if (isPrev && self.slidePopovers[newSlide].length > 0) {\n // Retrieve the last (numerically) popover for this slide\n lastPopover = Math.max.apply(null, self.slidePopovers[newSlide]);\n\n self.changePopover(self.slide + popoverDelim + lastPopover);\n } else {\n self.changingSlide = false;\n }\n });\n }", "function transition() {\n\n linePath.transition()\n .duration(7500)\n .attrTween(\"stroke-dasharray\", tweenDash)\n .on(\"end\", function() {\n d3.select(this).call(transition);// infinite loop\n }); \n }", "function finishAnimations() {\n if (transition == null)\n throw new Error('Transition was already finished or never started.');\n\n for (const anim of document.getAnimations())\n anim.finish();\n}", "preStateChange(action){return;}", "onTranslationEnded() {\n }", "endTransitionHandler(e) {\n if (this.active === true) {\n this.changeToDeactive();\n } else if (this.active === false) {\n this.transitionEndListenerOff();\n }\n }", "function checkIfNextScene (){\n\n if(currentScene === `scene1`){\n displayItemsLeft(itemChecklist.scene1Checklist);\n if(itemChecklist.scene1Checklist >=4){\n currentState = `cutscene`;\n currentScene = `scene1Transition_1`;\n generateDialogue(cutsceneDialogues.scene1TransitionDialogues_1);\n currentdialogueNbr ++;\n }\n }\n}", "__finishStep() {\n if (this.activeStep._nestedValidate() && this.activeStep.validate()) {\n this.openNextStep();\n this._setFinish(true);\n this.dispatchEvent(new CustomEvent('stepper-finished', {\n bubbles: true,\n composed: true,\n }));\n // console.log(\"caribou-stepper finished.\");\n } else {\n this.activeStep.fireInvalidStep();\n }\n }", "function step() {\n paused = true;\n executeNext(true);\n }", "function execute(transition) {\n return us(transition);\n }", "next() {\n const self = this;\n if (!self.isAnimating) { self.index += 1; self.to(self.index); }\n }", "function transition(execute) {\n from();\n to();\n return execute();\n }", "onAnimationEnd() {\n\n }", "transition(wizard, destinationIndex) {\n wizard.currentStepIndex = destinationIndex;\n }", "nextTo(level) {\n if(!this.nextTriggered) {\n this.nextCallback(level);\n this.nextTriggered = true;\n }\n }", "function onComplete(target) {\r\n\t\ttarget.style.setProperty('-webkit-transition', \".25s all ease-out\");\r\n\t\ttarget.style.setProperty('-o-transition', \".25s all ease-out\");\r\n\t\ttarget.style.setProperty('-moz-transition', \".25s all ease-out\");\r\n\t\ttarget.style.setProperty('transition', \".25s all ease-out\");\r\n\t}", "transitionInCustom() {\n // hello from the other side\n }", "function TransitionFromMapLoadingScreen()\n{\n var preGame = $.GetContextPanel();\n preGame.AddClass( 'MapLoadingOutro' );\n\n // Poke the C++ when the transition is finished\n var mapLoadingOutroDuration = 5.0;\n $.Schedule( mapLoadingOutroDuration, function () {\n $.GetContextPanel().MapLoadingOutroFinished();\n } );\n}", "step(action){\r\n\r\n }", "_onFinishedEvent() {\n this._finished += 1;\n\n if (this._finished === this._babylonNumAnimations) {\n this._looped = 0;\n this._finished = 0;\n\n // Pause the animations\n this._babylonAnimatables.forEach(animatable => {\n animatable.speedRatio = 0;\n });\n\n this._promises.play.resolve();\n\n // Stop evaluating interpolators if they have already completed\n if (!this.weightPending && !this.timeScalePending) {\n this._paused = true;\n }\n }\n }", "function onAnimationDone() {\n sourceFrameIndex = currentFrameIndex;\n if (playing) {\n waitTimeout();\n }\n }", "function fadeOut() {\n transitionPlane.emit('fadeOut');\n setTimeout(setBackwards, 100);\n}", "_routerDidTransition() {\n schedule('afterRender', this, function() {\n this._updateMessageContainers(\n this._pullAdditionsFromQueue()\n );\n });\n }", "function checkEndAll(transition, callback) {\n var n = 0;\n transition\n .each(function() { ++n; })\n .each(\"end\", function() {\n if (!--n) callback.apply(this, arguments);\n });\n}", "onTransitionStart() {\n this.seed = Math.random() * 45000;\n }", "function _nextScreen() {\n console.log('nextScreen called');\n setTimeout(function () {\n $state.go(targetState);\n }, 2500);\n\n }", "function originNextStep() {\n $scope.originStep = 'navigationhidden';\n $scope.destinationStep = 'navigationshown';\n $scope.geosuccess = 'navigationhidden';\n }" ]
[ "0.8053293", "0.6732831", "0.6469532", "0.6469532", "0.63581985", "0.6311598", "0.6296233", "0.62911075", "0.62775064", "0.6253864", "0.62344706", "0.62264836", "0.6170652", "0.60836476", "0.6074085", "0.6068321", "0.6050904", "0.6034632", "0.60260266", "0.60075784", "0.5997233", "0.59799486", "0.5971686", "0.5959319", "0.594672", "0.594661", "0.59459853", "0.59397507", "0.5932353", "0.5932353", "0.59308904", "0.5928191", "0.5928191", "0.59222364", "0.590623", "0.5879498", "0.5876207", "0.58618945", "0.58561665", "0.5854622", "0.5823278", "0.57752424", "0.5765104", "0.5763367", "0.5756519", "0.5749116", "0.5747845", "0.5746964", "0.57448137", "0.57218325", "0.57189935", "0.57151717", "0.5715059", "0.57096004", "0.57096004", "0.57040834", "0.57024574", "0.5702195", "0.56937635", "0.56889015", "0.5675851", "0.5669286", "0.56675786", "0.56672454", "0.5667167", "0.566452", "0.56630784", "0.56601465", "0.564188", "0.5636786", "0.563525", "0.5632975", "0.5627498", "0.5622269", "0.56151104", "0.5614253", "0.5612434", "0.5608579", "0.5605202", "0.5601763", "0.55845916", "0.5580852", "0.5577089", "0.5572199", "0.5569768", "0.5550025", "0.5548518", "0.5547588", "0.55465984", "0.55444014", "0.55399907", "0.5527611", "0.5523294", "0.5523089", "0.55219346", "0.55089396", "0.5507789" ]
0.6236204
13
Diffing (all return floats)
function diffWeeks(m0, m1) { return diffDays(m0, m1) / 7; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function diff(a, b) {\n totalDifference += Math.abs(a - b);\n }", "function diff(v1, v2) {\n return {\n x: v1.x - v2.x,\n y: v1.y - v2.y\n };\n}", "function difference(a, b) {\n return Math.abs(a - b);\n }", "function diff(a, b) {\n if (a == null || b == null || isNaN(a) || isNaN(b))\n return 0;\n else\n return Math.max(a - b, 0);\n}", "function find_difference(a, b) {\n return Math.abs(a[0]*a[1]*a[2] - b[0]*b[1]*b[2]);\n}", "function findDifference(a, b) {\n return Math.abs(a.reduce(function(x,y){return x*y;}) - b.reduce(function(x,y){return x*y;}))\n}", "function diff(a, b)\n{\n if (a == null || b == null)\n return 0;\n else\n return Math.max(a - b, 0);\n}", "function diff(a, b)\n{\n if (a == null || b == null)\n return 0;\n else\n return Math.max(a - b, 0);\n}", "function delta(a, b) {\r\n return a - b;\r\n}", "function diffPoints(point1,point2){return{left:point1.left-point2.left,top:point1.top-point2.top};}", "function diff(a, b) {\n if (a == null || b == null || isNaN(a) || isNaN(b))\n return undefined;\n else if (a<b)\n return undefined; // int rolled over, ignore the value\n else\n return a - b;\n}", "function Diff() {}", "function Diff() {}", "function Diff() {}", "function Diff() {}", "function Diff() {}", "function Diff() {}", "function Diff(current, next) {\r\n return delta_1.ValueDelta.Diff(current, next);\r\n }", "function diff_v2(v1, v2) { return [v1[0] - v2[0], v1[1] - v2[1]]; }", "function difference(a, b) {\n // console.log(Math.abs(a - b))\n a = parseInt(a)\n b = parseInt(b)\n return Math.abs(a - b);\n}", "function getPelnas2(x1, x2){\nvar pelnas = x1 - x2;\nreturn pelnas;\n}", "function difference() {\n\t\t\tvar s = 0;\n\t\t\tfor (var i = 0 ; i <= n ; i++)\n\t\t\t\ts += (-1)**i * this.binomial(n,i) * f(x + (n-2*i)*h);\n\t\t\treturn s / (2*h)**n\n\t\t}", "function difference(a, b){\n\t\treturn Math.max(a, b) - Math.min(a, b);\n\t}", "function findDifference(a, b) {\nlet summA = 1;\nlet summB = 1;\nfor(let i = 0; i<a.length; i++){\n summA *= a[i];\n}\nfor(let x = 0; x<b.length; x++){\n summB *= b[x];\n}\nlet result;\nif(summA>summB){\n result=summA-summB\n} else {result = summB - summA}\nreturn result\n}", "function calculateDelta(scores1, scores2) {\n var diff = 0;\n for (var i = 0; i < scores1.length; i++) {\n diff += Math.abs(scores1[i] - scores2[i]);\n }\n return diff;\n}", "getDifference(other) {\n return {\n xDiff: other.x - this.x,\n yDiff: other.y - this.y,\n };\n }", "function difference(num1, num2) {\n return num1 - num2;\n}", "function findedge (l, p1 , p2) {\n var m = (p1[1] - p2[1])/(p1[0] - p2[0]);\n var b = p1[1] - m*p1[0];\n var y = l + p1[1];\n \n return [(y - b)/m, y];\n }", "function getDiff(a, b) {\n const isBefore = a.isBefore(b)\n const later = isBefore ? b : a\n let earlier = isBefore ? a : b\n earlier = earlier.clone()\n const diff = {\n years: 0,\n months: 0,\n days: 0,\n hours: 0,\n minutes: 0,\n seconds: 0\n }\n Object.keys(diff).forEach((unit) => {\n if (earlier.isSame(later, unit)) {\n return\n }\n let max = earlier.diff(later, unit)\n earlier = earlier.add(max, unit)\n diff[unit] = max\n })\n //reverse it, if necessary\n if (isBefore) {\n Object.keys(diff).forEach((u) => {\n if (diff[u] !== 0) {\n diff[u] *= -1\n }\n })\n }\n return diff\n}", "function differenceAccuracy(target, data1, data2) {\n\n\t}", "function diff(num1, num2) {\n\tconsole.log(\"2) \" + (num1 - num2));\n\n}", "function vectorDiff(a, b) {\r\n return [b[0] - a[0], b[1] - a[1]];\r\n}", "function diffByUnit(a,b,unit){return moment.duration(Math.round(a.diff(b,unit,true)),// returnFloat=true\nunit);}", "function sortFloat(a, b) {\n return a - b;\n }", "function revDivided(v1,v2){\r\n //return v1/v2;\r\n console.log(v1/v2);\r\n }", "function get_tr_diff_us (tr1, tr2)\n{\n\tvar diff;\n\n\tif (tr1.sample > tr2.sample)\n\t{\n\t\tdiff = (((tr1.sample - tr2.sample) * 1000000) / sample_rate);\n\t}\n\telse\n\t{\n\t\tdiff = (((tr2.sample - tr1.sample) * 1000000) / sample_rate);\n\t}\n\n\treturn diff\n}", "function getTheDifference() {\t\n\tvar difference;\n\tvar leftSet = parseFloat($(\"#LR\").text());\n\tvar rightSet = parseFloat($(\"#RR\").text());\n\tif(isNaN(rightSet)) rightSet = 0;\n\tif(isNaN(leftSet)) leftSet = 0;\n\t// reset the difference counter\t\n\tclearTheDifference();\n\t// check if the sets aren't empty\t\n\tif ( leftSet==0 && rightSet==0 ) {\n\t\tresetSetSizeIndicators();\n\t\tclearTheDifference();\n\t}\n\telse { \n\t\tif( leftSet>rightSet) {\n\t\t\tdifference = leftSet-rightSet;\n\t\t\t// remove 'bigger' and 'smaller'\n\t\t\tresetSetSizeIndicators();\n\t\t\t$('#leftSubSum').append('Bigger');\n\t\t\t$('#rightSubSum').append('Smaller');\n\t\t\t\n\t\t\tif(difference < 1) {\n\t\t\t\t// display decimal places\n\t\t\t\tvar trimmedDifference = displayDecimalPlaces(difference);\n\t\t\t\t$('#result').append(trimmedDifference);\n\t\t\t\t// used for json\n\t\t\t\t$('#realDifference').append(difference);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// round up\n\t\t\t\t$('#result').append(Math.round(difference));\n\t\t\t\t// used for json\n\t\t\t\t$('#realDifference').append(difference);\n\t\t\t}\n\t\t}\n\telse if( leftSet<rightSet ) {\n\t\tdifference = rightSet-leftSet;\n\t\tresetSetSizeIndicators();\n\t\t$('#rightSubSum').append('Bigger');\n\t\t$('#leftSubSum').append('Smaller');\n\t\t\t\n\t\t\tif(difference < 1) {\n\t\t\t// display decimal places\n\t\t\tvar trimmedDifference = displayDecimalPlaces(difference);\n\t\t\t$('#result').append(trimmedDifference);\n\t\t\t// used for json\n\t\t\t$('#realDifference').append(difference);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// round up\n\t\t\t\t$('#result').append(parseInt(difference));\n\t\t\t\t// used for json\n\t\t\t\t$('#realDifference').append(difference);\n\t\t\t}\n\t}\n\t}\n}", "function difference (num1, num2) {\r\n if (num1 > num2) {\r\n return num1 - num2\r\n } else {\r\n return num2 - num1\r\n }\r\n }", "diff () {\n if (this.stopped.length === 0) {\n throw new Error('Timer has not been stopped.')\n }\n\n return this.stopped[0] * 1e9 + this.stopped[1]\n }", "function testDifference() {\n emptyBoxes();\n testCommon();\n $(\"#diffBox\").append(\"<h3>Test znamének diferencí</h3>\");\n\n // TEST ZNAMENEK DIFFERENCI\n var diffE = (n - 1) / 2;\n var diffD = (n + 1) / 12\n\n var diffC = 0;\n for(i = 0; i < n - 1; i++) {\n if (listNumbers[i + 1] > listNumbers[i]) {\n diffC += 1;\n }\n }\n\n var diffU = (diffC - diffE) / Math.sqrt(diffD);\n\n $(\"#diffBox\").append(\"$H_0:$ Posloupnost čísel je náhodná<br/>\");\n $(\"#diffBox\").append(\"$H_1:$ Posloupnost čísel není náhodná<br/><br/>\");\n $(\"#diffBox\").append(\"$n$ = \" + n + \"<br/>\");\n $(\"#diffBox\").append(\"$C$ = \" + diffC + \"<br/>\");\n $(\"#diffBox\").append(\"$E(C)$ = \" + diffE + \"<br/>\");\n $(\"#diffBox\").append(\"$D(C)$ = \" + diffD.toFixed(4) + \"<br/>\");\n $(\"#diffBox\").append(\"$u$ = \" + diffU.toFixed(4) + \"<br/><br/>\");\n\n var resultRejected = Math.abs(diffU) > u0975;\n if (resultRejected) {\n $(\"#diffBox\").append(\"$|u| > u_{1-{\\\\alpha / 2}}$<br/>\");\n $(\"#diffBox\").append(Math.abs(diffU).toFixed(4) + \" $>$ \" + u0975.toFixed(2) + \"<br/>\");\n $(\"#diffBox\").append(\"<span class='text-red'><b>Zamítá</b></span> se hypotéza o náhodnosti v uspořádání řady hodnot.\");\n } else {\n $(\"#diffBox\").append(\"$|u| \\\\leq u_{1-{\\\\alpha / 2}}$<br/>\");\n $(\"#diffBox\").append(Math.abs(diffU).toFixed(4) + \" $\\\\leq$ \" + u0975.toFixed(2) + \"<br/>\");\n $(\"#diffBox\").append(\"<span class='text-green'><b>Nezamítá</b></span> se hypotéza o náhodnosti v uspořádání řady hodnot.\");\n }\n\n refreshMathJax()\n}", "function getScaleDiffFn(points1, points2) {\n\n // Find remaining points with predictable position\n var src = [];\n var dst = [];\n var i, j, a, b, matchJ = 0;\n var len1 = points1.length;\n var len2 = points2.length;\n for (i = 0; i < len1; i++) {\n a = points1[i];\n for (j = matchJ; j < len2; j++) {\n b = points2[j];\n if (a.id === b.id) {\n matchJ = j + 1;\n src.push(a);\n dst.push(b);\n break;\n }\n }\n }\n\n if (src.length < 1 || dst.length < 1) {\n // Applying scale difference will not be possible\n return (d => d);\n }\n\n var numProps = Object.keys(src[0])\n .filter(prop => typeof src[0][prop] === 'number')\n .filter(prop => prop !== 'id');\n\n var propDiffs = {};\n var createPropDiffFn = (a0, b0, a, b) => (c0) => (\n b +\n (c0 - b0) *\n (b - a) /\n (b0 - a0)\n );\n var createSimpleDiffFn = (a0, a) => (c0) => (c0 - a0 + a);\n numProps.forEach(prop => {\n var a0 = src[0][prop];\n var a = dst[0][prop];\n for (var i = src.length - 1, b0, b; i > 0; i--) {\n b0 = src[i][prop];\n if (b0 !== a0) {\n b = dst[i][prop];\n propDiffs[prop] = createPropDiffFn(a0, b0, a, b);\n return;\n }\n }\n propDiffs[prop] = createSimpleDiffFn(a0, a);\n });\n\n return (c0) => {\n var c = Object.assign({}, c0);\n numProps.forEach(p => {\n c[p] = propDiffs[p](c0[p]);\n });\n return c;\n };\n}", "difference(a, b) {\n return Math.abs(a - b) % 360\n }", "function arrayDiff(a1, a2) {\n\tvar totalDiff = 0;\n\ta2.forEach((elem, index) => {\n\t\ttotalDiff += Math.abs(elem - a1[index]);\n\t});\n\treturn totalDiff;\n}", "function getSpaceDiffernece(lat1, lat2, lon1, lon2){\n\n\t\t\t\tvar R = 6371000; // metres\n\t\t\t\tvar φ1 = Math.radians(lat1);\n\t\t\t\tvar φ2 = Math.radians(lat2);\n\t\t\t\tvar temp1 = (lat2-lat1)\n\t\t\t\tvar Δφ = Math.radians(temp1);\n\t\t\t\tvar temp2 = (lon2-lon1)\n\t\t\t\tvar Δλ = Math.radians(temp2);\n\n\t\t\t\tvar a = Math.sin(Δφ/2) * Math.sin(Δφ/2) +\n\t\t\t\tMath.cos(φ1) * Math.cos(φ2) *\n\t\t\t\tMath.sin(Δλ/2) * Math.sin(Δλ/2);\n\t\t\t\tvar c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));\n\n\t\t\t\tvar d = R * c;\n\t\t\t\treturn d\n\n\t\t\t}", "function numericDiffFilter(context) {\n if (\n typeof context.left === 'number' &&\n typeof context.right === 'number'\n ) {\n // store number delta, eg. useful for distributed counters\n context\n .setResult([0, context.right - context.left, NUMERIC_DIFFERENCE])\n .exit();\n }\n }", "xpDiff (swapSkater) {\n let skaterOverall = this.props.selectedSkater.edges + this.props.selectedSkater.jumps + this.props.selectedSkater.form + this.props.selectedSkater.presentation;\n let swapSkaterOverall = swapSkater.edges + swapSkater.jumps + swapSkater.form + swapSkater.presentation;\n return swapSkaterOverall - skaterOverall;\n }", "function getDelta(initMetric, endMetric)\n{\n\tvar deltaValue = 0;\n\tvar decimalPlaces = 2;\n\tvar date = new Date().toISOString();\n\t\n\tif (parseFloat(endMetric.value) < parseFloat(initMetric.value))\n\t{\t\n\t\tdeltaValue = parseFloat(endMetric.value).toFixed(decimalPlaces);\n\t}\n\telse\n\t{\t\n\t\tvar elapsedTime = (new Date(endMetric.timestamp).getTime() - new Date(initMetric.timestamp).getTime()) / 1000;\t\n\t\tdeltaValue = ((parseFloat(endMetric.value) - parseFloat(initMetric.value))/elapsedTime).toFixed(decimalPlaces);\n\t}\n\t\n\treturn deltaValue;\n}", "function getDelta(initMetric, endMetric)\n{\n\tvar deltaValue = 0;\n\tvar decimalPlaces = 2;\n\tvar date = new Date().toISOString();\n\t\n\tif (parseFloat(endMetric.value) < parseFloat(initMetric.value))\n\t{\t\n\t\tdeltaValue = parseFloat(endMetric.value).toFixed(decimalPlaces);\n\t}\n\telse\n\t{\t\n\t\tvar elapsedTime = (new Date(endMetric.timestamp).getTime() - new Date(initMetric.timestamp).getTime()) / 1000;\t\n\t\tdeltaValue = ((parseFloat(endMetric.value) - parseFloat(initMetric.value))/elapsedTime).toFixed(decimalPlaces);\n\t}\n\t\n\treturn deltaValue;\n}", "function compatibility(arr1, arr2) {\n var totalDiff = 0;\n for (let i in arr1) {\n totalDiff = totalDiff + difference(arr1[i], arr2[i])\n }\n return totalDiff\n}", "function Eq_second_degre(a, b, c) {\r\n\tvar rep = new Array();\r\n\tvar delta = b*b - 4*a*c; \r\n\tif(delta < 0) {alert('delta = ' + delta);}\r\n\tif(delta == 0) {rep.push(-b/(2*a));}\r\n\tif(delta > 0) {\r\n\t\t var d = Math.sqrt(delta);\r\n\t\t rep.push((-b -d)/(2*a), (-b + d)/(2*a));\r\n\t\t //alert('rep = ' + rep);\r\n\t\t}\r\n\r\n\treturn rep;\r\n}", "function _VirtualDom_diff(x, y)\n{\n\tvar patches = [];\n\t_VirtualDom_diffHelp(x, y, patches, 0);\n\treturn patches;\n}", "function _VirtualDom_diff(x, y)\n{\n\tvar patches = [];\n\t_VirtualDom_diffHelp(x, y, patches, 0);\n\treturn patches;\n}", "function _VirtualDom_diff(x, y)\n{\n\tvar patches = [];\n\t_VirtualDom_diffHelp(x, y, patches, 0);\n\treturn patches;\n}", "function _VirtualDom_diff(x, y)\n{\n\tvar patches = [];\n\t_VirtualDom_diffHelp(x, y, patches, 0);\n\treturn patches;\n}", "function _VirtualDom_diff(x, y)\n{\n\tvar patches = [];\n\t_VirtualDom_diffHelp(x, y, patches, 0);\n\treturn patches;\n}", "function _VirtualDom_diff(x, y)\n{\n\tvar patches = [];\n\t_VirtualDom_diffHelp(x, y, patches, 0);\n\treturn patches;\n}", "function _VirtualDom_diff(x, y)\n{\n\tvar patches = [];\n\t_VirtualDom_diffHelp(x, y, patches, 0);\n\treturn patches;\n}", "function _VirtualDom_diff(x, y)\n{\n\tvar patches = [];\n\t_VirtualDom_diffHelp(x, y, patches, 0);\n\treturn patches;\n}", "function _VirtualDom_diff(x, y)\n{\n\tvar patches = [];\n\t_VirtualDom_diffHelp(x, y, patches, 0);\n\treturn patches;\n}", "function _VirtualDom_diff(x, y)\n{\n\tvar patches = [];\n\t_VirtualDom_diffHelp(x, y, patches, 0);\n\treturn patches;\n}", "function _VirtualDom_diff(x, y)\n{\n\tvar patches = [];\n\t_VirtualDom_diffHelp(x, y, patches, 0);\n\treturn patches;\n}", "function _VirtualDom_diff(x, y)\n{\n\tvar patches = [];\n\t_VirtualDom_diffHelp(x, y, patches, 0);\n\treturn patches;\n}", "function _VirtualDom_diff(x, y)\n{\n\tvar patches = [];\n\t_VirtualDom_diffHelp(x, y, patches, 0);\n\treturn patches;\n}", "function _VirtualDom_diff(x, y)\n{\n\tvar patches = [];\n\t_VirtualDom_diffHelp(x, y, patches, 0);\n\treturn patches;\n}", "function _VirtualDom_diff(x, y)\n{\n\tvar patches = [];\n\t_VirtualDom_diffHelp(x, y, patches, 0);\n\treturn patches;\n}", "function _VirtualDom_diff(x, y)\n{\n\tvar patches = [];\n\t_VirtualDom_diffHelp(x, y, patches, 0);\n\treturn patches;\n}", "function difference(){\n\t\t\tfor (var j = 0; j<totalArray.length; j++) {\n\t\t\t\tdifferenceTotal = Math.abs(parseInt(totalNew) - parseInt(totalArray[j]));\n\t\t\t\tdiffArray.push(differenceTotal);\n\t\t\t\tdifferenceTotal = 0;\n\t\t\t}\n\t\t\tconsole.log(\"This is the diffarray \" + diffArray);\n\t\t\tindexOfSmallest();\n\t\t}", "function datediff(results){\n var created = results.created;\n var date = new Date();\n var a = moment(date);\n var b = moment(created);\n var diff = a.diff(b, 'years', true) //[days, years, months, seconds, ...]\n console.log('sadsad', diff); \n if (diff >=1){\n /*a = p(1+ r/100)^n*/\n var a = results.currentprice / results.price;\n var r = (Math.pow(a.toFixed(2), diff.toFixed(2)) * 100) - 100;\n console.log('cagr annual', r); \n results.annual = r;\n }\n else {\n var b = results.currentprice / results.price;\n console.log('das', b);\n var r = (Math.pow(b, diff * 12) * 1200) - 1200;\n console.log('cagr monthly', r);\n results.monthly = r;\n }\n return results;\n}", "function getDisOf(b1, b2){\n\t var delta_x = Math.abs(b1.x - b2.x),\n\t delta_y = Math.abs(b1.y - b2.y);\n\n\t return Math.sqrt(delta_x*delta_x + delta_y*delta_y);\n\t}", "function diff(img1, img2) {\n return blend(img1, img2, function(a, b){\n var c = new Color();\n c.r = Math.abs(a.r - b.r);\n c.g = Math.abs(a.g - b.g);\n c.b = Math.abs(a.b - b.b);\n c.a = 255;\n return c;\n });\n}", "function difference() {\n return new Promise((resolve, reject) => {\n Promise.all([currPrice, yesterdaysPrice])\n .then(prices => (prices[0] - prices[1]))\n .then(difference => {\n resolve(difference)\n })\n .catch(err => {\n reject(err);\n })\n });\n}", "function diffPoints(point1, point2) {\n return {\n left: point1.left - point2.left,\n top: point1.top - point2.top\n };\n}", "function diffPoints(point1, point2) {\n return {\n left: point1.left - point2.left,\n top: point1.top - point2.top\n };\n}", "function diffPoints(point1, point2) {\n return {\n left: point1.left - point2.left,\n top: point1.top - point2.top\n };\n}", "function diffPoints(point1, point2) {\n return {\n left: point1.left - point2.left,\n top: point1.top - point2.top\n };\n}", "function diffPoints(point1, point2) {\n return {\n left: point1.left - point2.left,\n top: point1.top - point2.top\n };\n}", "function diffPoints(point1, point2) {\n return {\n left: point1.left - point2.left,\n top: point1.top - point2.top\n };\n }", "function getDisOf(b1, b2){\r\n var delta_x = Math.abs(b1.x - b2.x),\r\n delta_y = Math.abs(b1.y - b2.y);\r\n\r\n return Math.sqrt(delta_x*delta_x + delta_y*delta_y);\r\n}", "function Subtract(tal1,tal2){\n let differens = tal1-tal2\n return differens\n}", "function f1(points) {\n\tp1 = points[0];\n\tp2 = points[2];\n\treturn (p2.X - p1.X) / Distance(p1, p2);\n}", "function compare(a,b) {\n return b[0]-(sin(a[0]*a[0]))\n // return (b[0]-b[1]) - (a[0]-a[1])\n }", "function getDisOf(b1, b2){\n var delta_x = Math.abs(b1.x - b2.x),\n delta_y = Math.abs(b1.y - b2.y);\n\n return Math.sqrt(delta_x*delta_x + delta_y*delta_y);\n}", "function d(a,b)\r\n {\r\n return b-a;\r\n }", "function friendDifference (array1, array2) {\r\n\r\n\tvar diffArray = [];\r\n\tvar singleDiff\r\n\tvar diffTotal = 0\r\n\t\r\n\tfor (var i = 0; i < array1.length; i++) {\r\n\t\tsingleDiff = array1[i] - array2[i]\r\n\t\tsingleDiff = Math.abs(singleDiff)\r\n\t\tdiffArray.push(singleDiff)\r\n\t}\r\n\r\n\tfor (var j = 0; j < diffArray.length; j++) {\r\n\t\tdiffTotal += diffArray[j]\r\n\t}\r\n\r\n\tconsole.log(diffTotal)\r\n\treturn diffTotal\r\n\r\n}", "function diff(target, data1, data2){\n if (data1.length != data2.length) return null;\n var i=0;\n while(i<(data1.length/4)){\n\n target[i*4] = data1[4*i] == 0 ? 0 : fastAbs(data1[4*i] - data2[4*i+1]);\n target[i*4+1] = data1[4*i+1] == 0 ? 0 : fastAbs(data1[4*i+1] - data2[4*i+1]);\n target[i*4+2] = data1[4*i+2] == 0 ? 0 : fastAbs(data1[4*i+2] - data2[4*i+2]);\n target[i*4+3] = 0xFF;\n \n i++;\n }\n}", "function floatEqual (f1, f2) {\n return (Math.abs(f1 - f2) < 0.000001);\n }", "function floatEqual (f1, f2) {\n return (Math.abs(f1 - f2) < 0.000001);\n }", "function floatEqual (f1, f2) {\n return (Math.abs(f1 - f2) < 0.000001);\n }", "function diff (x, y) {\n if (x > y) {\n var tmp = x; // tmp is function-scoped to diff(), not block-scoped.\n x = y;\n y = tmp;\n }\n\n return y - x;\n}", "function percentDiff(a, b) {\n let divideBy = (a > b) ? a : b;\n return Math.abs(a - b) / divideBy * 100;\n }", "function getDateDiff( date1, date2 ){\n if(date1 instanceof Date && date2 instanceof Date){\n var d1 = date1.valueOf(), d2 = date2.valueOf();\n \n return d2 - d1;\n }\n else { return 0; }\n }", "function getDisOf(b1, b2) {\n var delta_x = Math.abs(b1.x - b2.x),\n delta_y = Math.abs(b1.y - b2.y);\n\n return Math.sqrt(delta_x * delta_x + delta_y * delta_y);\n }", "function d(b, a, bnds){\n return(\n b.select(bnds).subtract(a.select(bnds))\n );\n}", "function anglediff(x1,y1,x2,y2) {\n var rad = cart2rad(x2,y2) - cart2rad(x1,y1);\n return (rad < -Math.PI) ? rad+Math.PI : (rad >= Math.PI) ? rad-Math.PI : rad;\n }", "function diffDates(date1, date0) { // date1 - date0\n if (largeUnit) {\n return diffByUnit(date1, date0, largeUnit);\n }\n else if (newProps.allDay) {\n return diffDay(date1, date0);\n }\n else {\n return diffDayTime(date1, date0);\n }\n }", "function diffPoints(point1, point2) {\n return {\n left: point1.left - point2.left,\n top: point1.top - point2.top\n };\n }", "function diffPoints(point1, point2) {\n return {\n left: point1.left - point2.left,\n top: point1.top - point2.top\n };\n }", "function diffPoints(point1, point2) {\n return {\n left: point1.left - point2.left,\n top: point1.top - point2.top\n };\n }", "function diffPoints(point1, point2) {\n return {\n left: point1.left - point2.left,\n top: point1.top - point2.top\n };\n }", "function diffDates(date1, date0) { // date1 - date0\n\t\t\t\tif (largeUnit) {\n\t\t\t\t\treturn diffByUnit(date1, date0, largeUnit);\n\t\t\t\t}\n\t\t\t\telse if (newProps.allDay) {\n\t\t\t\t\treturn diffDay(date1, date0);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn diffDayTime(date1, date0);\n\t\t\t\t}\n\t\t\t}", "function diffPoints(point1, point2) {\n return {\n left: point1.left - point2.left,\n top: point1.top - point2.top,\n };\n }" ]
[ "0.6974578", "0.6840192", "0.6753703", "0.6678451", "0.6586779", "0.64633137", "0.6445426", "0.6445426", "0.64208776", "0.63634884", "0.6357478", "0.6332286", "0.6332286", "0.6332286", "0.6332286", "0.6332286", "0.6332286", "0.63061816", "0.63023365", "0.6285084", "0.62376", "0.6236893", "0.61658585", "0.61360174", "0.6136017", "0.6087146", "0.60698164", "0.60628456", "0.60508215", "0.6042307", "0.6027762", "0.60273105", "0.59860533", "0.5985846", "0.5985603", "0.5978033", "0.59474945", "0.59465307", "0.5931939", "0.59078634", "0.58913136", "0.5874324", "0.5856384", "0.5853099", "0.5851003", "0.584248", "0.58378565", "0.58378565", "0.58336335", "0.5826662", "0.5804593", "0.5804593", "0.5804593", "0.5804593", "0.5804593", "0.5804593", "0.5804593", "0.5804593", "0.5804593", "0.5804593", "0.5804593", "0.5804593", "0.5804593", "0.5804593", "0.5804593", "0.5804593", "0.58004326", "0.5796207", "0.57918143", "0.57896763", "0.57692826", "0.5765164", "0.5765164", "0.5765164", "0.5765164", "0.5765164", "0.5763507", "0.5755099", "0.5751831", "0.5748588", "0.5741268", "0.5721008", "0.5713414", "0.57132196", "0.5710428", "0.5708699", "0.5708699", "0.5708699", "0.57025653", "0.5702323", "0.5686466", "0.56777066", "0.56722957", "0.56721103", "0.56564796", "0.5649821", "0.5649821", "0.5649821", "0.5649821", "0.56487626", "0.5646236" ]
0.0
-1
Conversions "Rough" because they are based on averagecase Gregorian months/years
function asRoughYears(dur) { return asRoughDays(dur) / 365; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calcGregorian() { updateFromGregorian(); }", "function JtoG($, _, n, y) { function a($, _) { return Math.floor($ / _) } for ($g_days_in_month = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31), $j_days_in_month = new Array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29), $jy = $ - 979, $jm = _ - 1, $jd = n - 1, $j_day_no = 365 * $jy + 8 * a($jy, 33) + a($jy % 33 + 3, 4), $i = 0; $i < $jm; ++$i)$j_day_no += $j_days_in_month[$i]; for ($j_day_no += $jd, $g_day_no = $j_day_no + 79, $gy = 1600 + 400 * a($g_day_no, 146097), $g_day_no %= 146097, $leap = !0, 36525 <= $g_day_no && ($g_day_no-- , $gy += 100 * a($g_day_no, 36524), $g_day_no %= 36524, 365 <= $g_day_no ? $g_day_no++ : $leap = !1), $gy += 4 * a($g_day_no, 1461), $g_day_no %= 1461, 366 <= $g_day_no && ($leap = !1, $g_day_no-- , $gy += a($g_day_no, 365), $g_day_no %= 365), $i = 0; $g_day_no >= $g_days_in_month[$i] + (1 == $i && $leap); $i++)$g_day_no -= $g_days_in_month[$i] + (1 == $i && $leap); return $gm = $i + 1, $gd = $g_day_no + 1, y && null != y ? $gy + \"/\" + $gm + \"/\" + $gd : { y: $gy, m: $gm, d: $gd } }", "function calcGregorian()\n {\n updateFromGregorian();\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 }", "toGregorian(hDate) {\n const hYear = hDate.year;\n const hMonth = hDate.month - 1;\n const hDay = hDate.day;\n let gDate = new Date(GREGORIAN_FIRST_DATE);\n let dayDiff = hDay - 1;\n if (hYear >= HIJRI_BEGIN && hYear <= HIJRI_END) {\n for (let y = 0; y < hYear - HIJRI_BEGIN; y++) {\n for (let m = 0; m < 12; m++) {\n dayDiff += +MONTH_LENGTH[y][m] + 29;\n }\n }\n for (let m = 0; m < hMonth; m++) {\n dayDiff += +MONTH_LENGTH[hYear - HIJRI_BEGIN][m] + 29;\n }\n gDate.setDate(GREGORIAN_FIRST_DATE.getDate() + dayDiff);\n }\n else {\n gDate = super.toGregorian(hDate);\n }\n return gDate;\n }", "function DateNorm(date1)\n{\n var day1 = addZero(date1.getDate());\n var month1 = addZero(parseInt(date1.getMonth(), 10) + 1);\n var year1 = date1.getFullYear(); \n var date = String(day1) + \"/\" + String(month1) + \"/\" + String(year1);\n return date;\n}", "function yearsToMS(years){\r\treturn years * 365.25 * 24 * 60 * 60 * 1000;\r}", "toGregorian(hDate) {\n const hYear = hDate.year;\n const hMonth = hDate.month - 1;\n const hDay = hDate.day;\n const julianDay = hDay + Math.ceil(29.5 * hMonth) + (hYear - 1) * 354 + Math.floor((3 + 11 * hYear) / 30) + ISLAMIC_EPOCH - 1;\n const wjd = Math.floor(julianDay - 0.5) + 0.5, depoch = wjd - GREGORIAN_EPOCH, quadricent = Math.floor(depoch / 146097), dqc = mod(depoch, 146097), cent = Math.floor(dqc / 36524), dcent = mod(dqc, 36524), quad = Math.floor(dcent / 1461), dquad = mod(dcent, 1461), yindex = Math.floor(dquad / 365);\n let year = quadricent * 400 + cent * 100 + quad * 4 + yindex;\n if (!(cent === 4 || yindex === 4)) {\n year++;\n }\n const gYearStart = GREGORIAN_EPOCH + 365 * (year - 1) + Math.floor((year - 1) / 4) - Math.floor((year - 1) / 100) +\n Math.floor((year - 1) / 400);\n const yearday = wjd - gYearStart;\n const tjd = GREGORIAN_EPOCH - 1 + 365 * (year - 1) + Math.floor((year - 1) / 4) - Math.floor((year - 1) / 100) +\n Math.floor((year - 1) / 400) + Math.floor(739 / 12 + (isGregorianLeapYear(new Date(year, 3, 1)) ? -1 : -2) + 1);\n const leapadj = wjd < tjd ? 0 : isGregorianLeapYear(new Date(year, 3, 1)) ? 1 : 2;\n const month = Math.floor(((yearday + leapadj) * 12 + 373) / 367);\n const tjd2 = GREGORIAN_EPOCH - 1 + 365 * (year - 1) + Math.floor((year - 1) / 4) - Math.floor((year - 1) / 100) +\n Math.floor((year - 1) / 400) +\n Math.floor((367 * month - 362) / 12 + (month <= 2 ? 0 : isGregorianLeapYear(new Date(year, month - 1, 1)) ? -1 : -2) +\n 1);\n const day = wjd - tjd2 + 1;\n return new Date(year, month - 1, day);\n }", "fromGregorian(gdate) {\r\n let g2d = this.gregorianToDay(gdate.getFullYear(), gdate.getMonth() + 1, gdate.getDate());\r\n return this.dayToJalali(g2d);\r\n }", "function heb2civ(h, type){\r\n\ttype = type || 2; // for most calendarical calculations, use type==2\r\n\t// dates through Cheshvan are completely determined by pesach\r\n\tif (h.m < 6) return new Date (h.y-3760, 2, Gauss(h.y)-15+h.d+Math.ceil(h.m*29.5));\r\n\tif (h.m < 8) return new Date (h.y-3761, 2, Gauss(h.y-1)-15+h.d+Math.ceil(h.m*29.5));\r\n\tvar pesach = Gauss(h.y-1);\r\n\tvar yearlength = Gauss(h.y)-pesach+365+(leap(h.y-3760)?1:0);\r\n\tvar yeartype = yearlength%30-24; // -1 is chaser, 0 is ksidrah, +1 is male\r\n\tvar isleap = yearlength > 360;\r\n\tvar m = h.m;\r\n\tif (isleap && m==11){\r\n\t\tm += type;\r\n\t}else if (!isleap && m>11){\r\n\t\tm = 11;\r\n\t}\r\n\tvar day = pesach-15+h.d+Math.ceil(m*29.5)+yeartype;\r\n\tif (m > 11) day -= 29; // we added an extra month in there (in years with an Adar I or II, there is no plain Adar)\r\n\tvar d = new Date (h.y-3761, 2, day);\r\n\t// if the hebrew date was valid but wrong (Cheshvan or Kislev 30 in a haser year; Adar I 30 in a non-leap year) then move it back a day to the 29th\r\n\t// we won't try to correct an actually invalid date \r\n\tif (h.d < 30 || civ2heb(d).m == m) return d; // it worked\r\n\treturn new Date (h.y-3761, 2, day-1);\r\n}", "__toDegree(date)\n {\n return date * 360 / 60;\n }", "function normalizeDate(year, month, day) {\n return [year.padStart(4, '2000'), month.padStart(2, '0'), day.padStart(2, '0')];\n }", "function calcGregorian(year, month, day){\r\n month--;\r\n \r\n var j, weekday;\r\n \r\n // Update Julian day\r\n \r\n j = gregorian_to_jd(year, month + 1, day) +\r\n (Math.floor(0 + 60 * (0 + 60 * 0) + 0.5) / 86400.0);\r\n \r\n // Update Persian Calendar\r\n perscal = jd_to_persian(j);\r\n weekday = jwday(j);\r\n return new Array(perscal[0], perscal[1], perscal[2], weekday);\r\n}", "function Date2Days(yy,mm,dd)\n{\nif (mm > 2)\n{\nvar bis = Math.floor(yy/4) - Math.floor(yy/100) + Math.floor(yy/400);\nvar zy = Math.floor(yy * 365 + bis);\nvar zm = (mm-1) * 31 - Math.floor(mm * 0.4 + 2.3);\nreturn (zy + zm + dd);\n}\nelse\n{\nvar bis = Math.floor((yy-1)/4) - Math.floor((yy-1)/100) + Math.floor((yy-1)/400);\nvar zy = Math.floor(yy * 365 + bis);\nreturn (zy + (mm-1) * 31 + dd);\n}\n}", "function yearsToMS(years){\n\treturn years * 365.25 * 24 * 60 * 60 * 1000;\n}", "fromGregorian(gDate) {\n const gYear = gDate.getFullYear(), gMonth = gDate.getMonth(), gDay = gDate.getDate();\n let julianDay = GREGORIAN_EPOCH - 1 + 365 * (gYear - 1) + Math.floor((gYear - 1) / 4) +\n -Math.floor((gYear - 1) / 100) + Math.floor((gYear - 1) / 400) +\n Math.floor((367 * (gMonth + 1) - 362) / 12 + (gMonth + 1 <= 2 ? 0 : isGregorianLeapYear(gDate) ? -1 : -2) + gDay);\n julianDay = Math.floor(julianDay) + 0.5;\n const days = julianDay - ISLAMIC_EPOCH;\n const hYear = Math.floor((30 * days + 10646) / 10631.0);\n let hMonth = Math.ceil((days - 29 - getIslamicYearStart(hYear)) / 29.5);\n hMonth = Math.min(hMonth, 11);\n const hDay = Math.ceil(days - getIslamicMonthStart(hYear, hMonth)) + 1;\n return new NgbDate(hYear, hMonth + 1, hDay);\n }", "function jd_to_gregorian(jd) {\n\n var wjd, depoch, quadricent, dqc, cent, dcent, quad, dquad,\n yindex, year, yearday, leapadj;\n\n wjd = Math.floor(jd - 0.5) + 0.5;\n depoch = wjd - GREGORIAN_EPOCH;\n quadricent = Math.floor(depoch / 146097);\n dqc = mod(depoch, 146097);\n cent = Math.floor(dqc / 36524);\n dcent = mod(dqc, 36524);\n quad = Math.floor(dcent / 1461);\n dquad = mod(dcent, 1461);\n yindex = Math.floor(dquad / 365);\n year = (quadricent * 400) + (cent * 100) + (quad * 4) + yindex;\n if (!((cent == 4) || (yindex == 4))) {\n\n year++;\n\n }\n yearday = wjd - gregorian_to_jd(year, 1, 1);\n leapadj = ((wjd < gregorian_to_jd(year, 3, 1)) ? 0\n :\n (leap_gregorian(year) ? 1 : 2)\n );\n var month = Math.floor((((yearday + leapadj) * 12) + 373) / 367);\n var day = (wjd - gregorian_to_jd(year, month, 1)) + 1;\n\n return new Array(year, month, day);\n\n}", "fromGregorian(gDate) {\n let hDay = 1, hMonth = 0, hYear = 1300;\n let daysDiff = getDaysDiff(gDate, GREGORIAN_FIRST_DATE);\n if (gDate.getTime() - GREGORIAN_FIRST_DATE.getTime() >= 0 && gDate.getTime() - GREGORIAN_LAST_DATE.getTime() <= 0) {\n let year = 1300;\n for (let i = 0; i < MONTH_LENGTH.length; i++, year++) {\n for (let j = 0; j < 12; j++) {\n let numOfDays = +MONTH_LENGTH[i][j] + 29;\n if (daysDiff <= numOfDays) {\n hDay = daysDiff + 1;\n if (hDay > numOfDays) {\n hDay = 1;\n j++;\n }\n if (j > 11) {\n j = 0;\n year++;\n }\n hMonth = j;\n hYear = year;\n return new NgbDate(hYear, hMonth + 1, hDay);\n }\n daysDiff = daysDiff - numOfDays;\n }\n }\n return null;\n }\n else {\n return super.fromGregorian(gDate);\n }\n }", "dayToJalali(julianDayNumber) {\r\n let gy = this.dayToGregorion(julianDayNumber).getFullYear(), // Calculate Gregorian year (gy).\r\n jalaliYear = gy - 621,\r\n r = this.jalCal(jalaliYear),\r\n gregorianDay = this.gregorianToDay(gy, 3, r.march),\r\n jalaliDay,\r\n jalaliMonth,\r\n numberOfDays;\r\n // Find number of days that passed since 1 Farvardin.\r\n numberOfDays = julianDayNumber - gregorianDay;\r\n if (numberOfDays >= 0) {\r\n if (numberOfDays <= 185) {\r\n // The first 6 months.\r\n jalaliMonth = 1 + div(numberOfDays, 31);\r\n jalaliDay = mod(numberOfDays, 31) + 1;\r\n return { year: jalaliYear, month: jalaliMonth, day: jalaliDay };\r\n } else {\r\n // The remaining months.\r\n numberOfDays -= 186;\r\n }\r\n } else {\r\n // Previous Jalali year.\r\n jalaliYear -= 1;\r\n numberOfDays += 179;\r\n if (r.leap === 1) {\r\n numberOfDays += 1;\r\n }\r\n }\r\n jalaliMonth = 7 + div(numberOfDays, 30);\r\n jalaliDay = mod(numberOfDays, 30) + 1;\r\n return { year: jalaliYear, month: jalaliMonth, day: jalaliDay };\r\n }", "function Calendar_calcMonthYear( p_Month, p_Year, incr )\n{\n/*\nWill return an 1-D array with 1st element being the calculated month \nand second being the calculated year \nafter applying the month increment/decrement as specified by 'incr' parameter.\n'incr' will normally have 1/-1 to navigate thru the months.\n*/\nvar ret_arr = new Array();\nif( incr == -1 ) {\n// B A C K W A R D\nif( p_Month == 0 ) {\nret_arr[0] = 11;\nret_arr[1] = parseInt( p_Year ) - 1;\n}\nelse {\nret_arr[0] = parseInt( p_Month ) - 1;\nret_arr[1] = parseInt( p_Year );\n}\n} else if( incr == 1 ) {\n// F O R W A R D\nif( p_Month == 11 ) {\nret_arr[0] = 0;\nret_arr[1] = parseInt( p_Year ) + 1;\n}\nelse {\nret_arr[0] = parseInt( p_Month ) + 1;\nret_arr[1] = parseInt( p_Year );\n}\n}\nreturn ret_arr;\n}", "toGregorian(pDate) {\n return window.Helper.jalaaliToGregorian(pDate);\n }", "function __JD2Gregorian(jd) \n{\n\tjd = new Number(jd);\n var wjd, depoch, quadricent, dqc, cent, dcent, quad, dquad,\n yindex, dyindex, year, yearday, leapadj;\n\n wjd = Math.floor(jd - 0.5) + 0.5;\n depoch = wjd - this.GREGORIAN_EPOCH;\n quadricent = Math.floor(depoch / 146097);\n dqc = this.Mod(depoch, 146097);\n cent = Math.floor(dqc / 36524);\n dcent = this.Mod(dqc, 36524);\n quad = Math.floor(dcent / 1461);\n dquad = this.Mod(dcent, 1461);\n yindex = Math.floor(dquad / 365);\n year = (quadricent * 400) + (cent * 100) + (quad * 4) + yindex;\n if (!((cent == 4) || (yindex == 4))) {\n year++;\n }\n yearday = wjd - this.Gregorian2JD(year, 1, 1);\n leapadj = ((wjd < this.Gregorian2JD(year, 3, 1)) ? 0\n :\n (this.LeapGregorian(year) ? 1 : 2)\n );\n month = Math.floor((((yearday + leapadj) * 12) + 373) / 367);\n day = (wjd - this.Gregorian2JD(year, month, 1)) + 1;\n\n return new Array(year, month, day);\n}", "function fromGregorian$1(gdate) {\n var date = new Date(gdate);\n var gYear = date.getFullYear(),\n gMonth = date.getMonth(),\n gDay = date.getDate();\n var julianDay = GREGORIAN_EPOCH$1 - 1 + 365 * (gYear - 1) + Math.floor((gYear - 1) / 4) - Math.floor((gYear - 1) / 100) + Math.floor((gYear - 1) / 400) + Math.floor((367 * (gMonth + 1) - 362) / 12 + (gMonth + 1 <= 2 ? 0 : isGregorianLeapYear$1(gYear) ? -1 : -2) + gDay);\n julianDay = Math.floor(julianDay + 0.5);\n var daysSinceHebEpoch = julianDay - 347997;\n var monthsSinceHebEpoch = Math.floor(daysSinceHebEpoch * PARTS_PER_DAY / PARTS_PER_MONTH);\n var hYear = Math.floor((monthsSinceHebEpoch * 19 + 234) / 235) + 1;\n var firstDayOfThisYear = numberOfFirstDayInYear(hYear);\n var dayOfYear = daysSinceHebEpoch - firstDayOfThisYear;\n\n while (dayOfYear < 1) {\n hYear--;\n firstDayOfThisYear = numberOfFirstDayInYear(hYear);\n dayOfYear = daysSinceHebEpoch - firstDayOfThisYear;\n }\n\n var hMonth = 1;\n var hDay = dayOfYear;\n\n while (hDay > getDaysInHebrewMonth(hMonth, hYear)) {\n hDay -= getDaysInHebrewMonth(hMonth, hYear);\n hMonth++;\n }\n\n return new NgbDate(hYear, hMonth, hDay);\n}", "function fromGregorian$1(gdate) {\n const date = new Date(gdate);\n const gYear = date.getFullYear(), gMonth = date.getMonth(), gDay = date.getDate();\n let julianDay = GREGORIAN_EPOCH$1 - 1 + 365 * (gYear - 1) + Math.floor((gYear - 1) / 4) -\n Math.floor((gYear - 1) / 100) + Math.floor((gYear - 1) / 400) +\n Math.floor((367 * (gMonth + 1) - 362) / 12 + (gMonth + 1 <= 2 ? 0 : isGregorianLeapYear$1(gYear) ? -1 : -2) + gDay);\n julianDay = Math.floor(julianDay + 0.5);\n let daysSinceHebEpoch = julianDay - 347997;\n let monthsSinceHebEpoch = Math.floor(daysSinceHebEpoch * PARTS_PER_DAY / PARTS_PER_MONTH);\n let hYear = Math.floor((monthsSinceHebEpoch * 19 + 234) / 235) + 1;\n let firstDayOfThisYear = numberOfFirstDayInYear(hYear);\n let dayOfYear = daysSinceHebEpoch - firstDayOfThisYear;\n while (dayOfYear < 1) {\n hYear--;\n firstDayOfThisYear = numberOfFirstDayInYear(hYear);\n dayOfYear = daysSinceHebEpoch - firstDayOfThisYear;\n }\n let hMonth = 1;\n let hDay = dayOfYear;\n while (hDay > getDaysInHebrewMonth(hMonth, hYear)) {\n hDay -= getDaysInHebrewMonth(hMonth, hYear);\n hMonth++;\n }\n return new NgbDate(hYear, hMonth, hDay);\n}", "function jd_to_gregorian(jd) {\n var wjd, depoch, quadricent, dqc, cent, dcent, quad, dquad, yindex, year, month, day, yearday, leapadj;\n\n wjd = Math.floor(jd - 0.5) + 0.5;\n depoch = wjd - GREGORIAN_EPOCH;\n quadricent = Math.floor(depoch / 146097);\n dqc = mod(depoch, 146097);\n cent = Math.floor(dqc / 36524);\n dcent = mod(dqc, 36524);\n quad = Math.floor(dcent / 1461);\n dquad = mod(dcent, 1461);\n yindex = Math.floor(dquad / 365);\n year = (quadricent * 400) + (cent * 100) + (quad * 4) + yindex;\n if (!((cent == 4) || (yindex == 4))) {\n year++;\n }\n yearday = wjd - gregorian_to_jd(year, 1, 1);\n leapadj = ((wjd < gregorian_to_jd(year, 3, 1)) ? 0\n :\n (leap_gregorian(year) ? 1 : 2)\n );\n month = Math.floor((((yearday + leapadj) * 12) + 373) / 367);\n day = (wjd - gregorian_to_jd(year, month, 1)) + 1;\n return new Array(year, month, day);\n}", "function jd_to_gregorian(jd){\r\n var wjd, depoch, quadricent, dqc, cent, dcent, quad, dquad, yindex, dyindex, year, yearday, leapadj;\r\n \r\n wjd = Math.floor(jd - 0.5) + 0.5;\r\n depoch = wjd - GREGORIAN_EPOCH;\r\n quadricent = Math.floor(depoch / 146097);\r\n dqc = mod(depoch, 146097);\r\n cent = Math.floor(dqc / 36524);\r\n dcent = mod(dqc, 36524);\r\n quad = Math.floor(dcent / 1461);\r\n dquad = mod(dcent, 1461);\r\n yindex = Math.floor(dquad / 365);\r\n year = (quadricent * 400) + (cent * 100) + (quad * 4) + yindex;\r\n if (!((cent == 4) || (yindex == 4))) {\r\n year++;\r\n }\r\n yearday = wjd - gregorian_to_jd(year, 1, 1);\r\n leapadj = ((wjd < gregorian_to_jd(year, 3, 1)) ? 0 : (leap_gregorian(year) ? 1 : 2));\r\n month = Math.floor((((yearday + leapadj) * 12) + 373) / 367);\r\n day = (wjd - gregorian_to_jd(year, month, 1)) + 1;\r\n \r\n return new Array(year, month, day);\r\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 }", "convertToMonthYear(dateM)\n{\n let date= new Date(dateM);\n var month = new Array();\n month[0] = \"Jan\";\n month[1] = \"Feb\";\n month[2] = \"March\";\n month[3] = \"April\";\n month[4] = \"May\";\n month[5] = \"June\";\n month[6] = \"July\";\n month[7] = \"Aug\";\n month[8] = \"Sept\";\n month[9] = \"Oct\";\n month[10] = \"Nov\";\n month[11] = \"Dec\";\n var m = month[date.getMonth()];\n date= new Date(dateM);\n let year= (date.getFullYear()).toString();\n return m+' '+year;\n\n}", "convertData(data) {\n const formatNumber = (num, exp = 2) => Math.round(num * (10 ** exp)) / (10 ** exp);\n const average = data.reduce((acc, { close }) => acc + close, 0) / data.length;\n\n return data.map(({ date, adjClose }) => ({\n date,\n average: formatNumber(average),\n close: formatNumber(adjClose),\n }));\n }", "function toGregorian$1(hebrewDate) {\n const hYear = hebrewDate.year;\n const hMonth = hebrewDate.month;\n const hDay = hebrewDate.day;\n let days = numberOfFirstDayInYear(hYear);\n for (let i = 1; i < hMonth; i++) {\n days += getDaysInHebrewMonth(i, hYear);\n }\n days += hDay;\n let diffDays = days - HEBREW_DAY_ON_JAN_1_1970;\n let after = diffDays >= 0;\n if (!after) {\n diffDays = -diffDays;\n }\n let gYear = 1970;\n let gMonth = 1;\n let gDay = 1;\n while (diffDays > 0) {\n if (after) {\n if (diffDays >= (isGregorianLeapYear$1(gYear) ? 366 : 365)) {\n diffDays -= isGregorianLeapYear$1(gYear) ? 366 : 365;\n gYear++;\n }\n else if (diffDays >= getDaysInGregorianMonth(gMonth, gYear)) {\n diffDays -= getDaysInGregorianMonth(gMonth, gYear);\n gMonth++;\n }\n else {\n gDay += diffDays;\n diffDays = 0;\n }\n }\n else {\n if (diffDays >= (isGregorianLeapYear$1(gYear - 1) ? 366 : 365)) {\n diffDays -= isGregorianLeapYear$1(gYear - 1) ? 366 : 365;\n gYear--;\n }\n else {\n if (gMonth > 1) {\n gMonth--;\n }\n else {\n gMonth = 12;\n gYear--;\n }\n if (diffDays >= getDaysInGregorianMonth(gMonth, gYear)) {\n diffDays -= getDaysInGregorianMonth(gMonth, gYear);\n }\n else {\n gDay = getDaysInGregorianMonth(gMonth, gYear) - diffDays + 1;\n diffDays = 0;\n }\n }\n }\n }\n return new Date(gYear, gMonth - 1, gDay);\n}", "function calcPersiana()\n {\n setJulian(persiana_to_jd((new Number(document.persiana.year.value)),\n\t\t\t document.persiana.month.selectedIndex + 1,\n\t\t\t (new Number(document.persiana.day.value))) + 0.5);\n }", "function setFromGregorianDate() {\n // Check if it's before 1 BE or after 356 BE (which we can't handle)\n if (gregDate.isBefore(validRangeGreg[0]) || gregDate.isAfter(validRangeGreg[1])) {\n setInvalid();\n } else {\n var gregYear = gregDate.year();\n // Old implementation for days before Naw-Rúz 172\n if (gregDate.isBefore(moment.utc('2015-03-21'))) {\n if (gregDate.isBefore(gregYear + '-03-21')) {\n nawRuz = moment.utc((gregYear -1).toString() + '-03-21');\n badiYear = gregYear - 1844;\n } else {\n nawRuz = moment.utc(gregYear.toString() + '-03-21');\n badiYear = gregYear - 1843;\n }\n ayyamiHaLength = oldAyyamiHaLength(nawRuz);\n // New implementation\n } else {\n yearData = unpackYear(gregYear - 1843);\n if (gregDate.isBefore(moment.utc(yearData.NR))) {\n yearData = unpackYear(gregYear - 1844);\n badiYear = gregYear - 1844;\n } else {\n badiYear = gregYear - 1843;\n }\n nawRuz = moment.utc(yearData.NR);\n ayyamiHaLength = yearData.aHL;\n }\n // Now need to get Badí' month and date from the gregorian date\n var monthDay = badiMonthDay();\n badiMonth = monthDay[0];\n badiDay = monthDay[1];\n }\n }", "function calcPowerContractValues(){\r\n\t\t$scope.energyContractKWH_Year = $scope.fhemPower.Readings.energy_contract_kWh_Year.Value;\r\n\t\t$scope.energyContractKWH_Month = $scope.energyContractKWH_Year / 12;\r\n\t\t$scope.energyContractKWH_Day = $scope.energyContractKWH_Month / moment().daysInMonth();\r\n\t\t$scope.energyContractKWH_Week = $scope.energyContractKWH_Day * 7;\r\n\r\n\t\tcalcPowerPercentToYearValues();\r\n\t}", "function asRoughYears(dur) {\n return asRoughDays(dur) / 365;\n}", "yearToAcademicYear () {\n return this + \"-\" + (Number(this) + 1).toString().slice(-2);\n }", "function gregorian_to_hijri(g)\n{\n var y, m, d;\n // ...\n return new Array(y, m, d);\n}", "function calcIndianCivilCalendar()\n {\n setJulian(indian_civil_to_jd(\n\t\t\t (new Number(document.indiancivilcalendar.year.value)),\n\t\t\t document.indiancivilcalendar.month.selectedIndex + 1,\n\t\t\t (new Number(document.indiancivilcalendar.day.value))));\n }", "function acuerdop2012(){\r\n var aump=/*aump_2012||*/[0.15,0.09];\r\n for(var g=0;g<=4;g++){\r\n //Meses posteriores a abril de 2012\r\n for(var m=23;m<tope_mes;m++){\r\n \r\n //Recorro categorías\r\n for(var c=0;c<bas[g][0].length;c++){\r\n switch(m){\r\n case 23://Mayo 2012\r\n bas[g][m][c][4]=bas[g][22][c][0]*aump[0];\r\n break;\r\n case 29://Noviembre 2012\r\n bas[g][m][c][4]=bas[g][22][c][0]*aump[1];\r\n break;\r\n case 35://Mayo 2013\r\n bas[g][m][c][4]=0;\r\n break;\r\n default://Otro mes\r\n bas[g][m][c][4]=bas[g][m-1][c][4];\r\n break;\r\n }\r\n if(m>34){\t\t\t//Remunerativo [0] desde mayo 2013\t(2º cuota)\r\n bas[g][m][c][0]=bas[g][34][c][0]+(bas[g][34][c][4])*gr_up;\r\n }else if(m>28){\t\t//Remunerativo [0] desde noviembre de 2012 (1º cuota)\r\n \tbas[g][m][c][0]=bas[g][28][c][0]+(bas[g][23][c][4])*gr_up;\r\n }\r\n }\r\n }\r\n } \r\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 toGregorian (jy, jm, jd) {\n return d2g(j2d(jy, jm, jd))\n }", "function changeByYear(month, year, back) {\n back = back || false;\n var numDaysInMo,\n addend = 1;\n if (back) {\n addend = -1;\n }\n year = year + addend;\n numDaysInMo = daysInMonth(month, year);\n return {year: year, numDaysInMo: numDaysInMo};\n }", "function asRoughYears(dur) {\n return asRoughDays(dur) / 365;\n }", "function days2mdhms(year, days)\r\n// int& mon, int& day, int& hr, int& minute, double& sec\r\n// )\r\n{\r\n var i, inttemp, dayofyr;\r\n var temp;\r\n var lmonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\r\n\r\n dayofyr = Math.floor(days);\r\n /* ----------------- find month and day of month ---------------- */\r\n if ( (year % 4) == 0 ) {\r\n lmonth[1] = 29;\r\n }\r\n\r\n i = 1;\r\n inttemp = 0;\r\n while ((dayofyr > inttemp + lmonth[i-1]) && (i < 12)) {\r\n inttemp = inttemp + lmonth[i-1];\r\n i++;\r\n }\r\n mon = i;\r\n day = dayofyr - inttemp;\r\n\r\n /* ----------------- find hours minutes and seconds ------------- */\r\n temp = (days - dayofyr) * 24.0;\r\n hr = Math.floor(temp);\r\n temp = (temp - hr) * 60.0;\r\n minute = Math.floor(temp);\r\n sec = (temp - minute) * 60.0;\r\n return {month: mon, day: day, hour: hr, minute: minute, second: sec}\r\n} // end days2mdhms", "function CalculateDate(Date1, Date2) {\n var yr1 = Date1.substr(7, 4);\n var yr2 = Date2.substr(7, 4);\n var mm1 = Date1.substr(3, 3);\n var mm2 = Date2.substr(3, 3);\n var dd1 = Date1.substr(0, 2);\n var dd2 = Date2.substr(0, 2);\n\n var nmm1;\n switch (mm1.toLowerCase()) {\n case \"jan\": nmm1 = \"01\";\n break;\n case \"feb\": nmm1 = \"02\";\n break;\n case \"mar\": nmm1 = \"03\";\n break;\n case \"apr\": nmm1 = \"04\";\n break;\n case \"may\": nmm1 = \"05\";\n break;\n case \"jun\": nmm1 = \"06\";\n break;\n case \"jul\": nmm1 = \"07\";\n break;\n case \"aug\": nmm1 = \"08\";\n break;\n case \"sep\": nmm1 = \"09\";\n break;\n case \"oct\": nmm1 = \"10\";\n break;\n case \"nov\": nmm1 = \"11\";\n break;\n case \"dec\": nmm1 = \"12\";\n break;\n }\n var nmm2;\n switch (mm2.toLowerCase()) {\n case \"jan\": nmm2 = \"01\";\n break;\n case \"feb\": nmm2 = \"02\";\n break;\n case \"mar\": nmm2 = \"03\";\n break;\n case \"apr\": nmm2 = \"04\";\n break;\n case \"may\": nmm2 = \"05\";\n break;\n case \"jun\": nmm2 = \"06\";\n break;\n case \"jul\": nmm2 = \"07\";\n break;\n case \"aug\": nmm2 = \"08\";\n break;\n case \"sep\": nmm2 = \"09\";\n break;\n case \"oct\": nmm2 = \"10\";\n break;\n case \"nov\": nmm2 = \"11\";\n break;\n case \"dec\": nmm2 = \"12\";\n break;\n }\n dt1 = nmm1 + \"/\" + dd1 + \"/\" + yr1;\n dt2 = nmm2 + \"/\" + dd2 + \"/\" + yr2;\n return;\n}", "jalCal(jalaliYear) {\r\n // Jalali years starting the 33-year rule.\r\n let breaks = [-61, 9, 38, 199, 426, 686, 756, 818, 1111, 1181, 1210, 1635, 2060, 2097, 2192, 2262, 2324, 2394, 2456, 3178],\r\n breaksLength = breaks.length,\r\n gYear = jalaliYear + 621,\r\n leapJ = -14,\r\n jp = breaks[0],\r\n jm,\r\n jump,\r\n leap,\r\n leapG,\r\n march,\r\n n,\r\n i;\r\n if (jalaliYear < jp || jalaliYear >= breaks[breaksLength - 1]) {\r\n throw new Error('Invalid Jalali year ' + jalaliYear);\r\n }\r\n // Find the limiting years for the Jalali year jalaliYear.\r\n for (i = 1; i < breaksLength; i += 1) {\r\n jm = breaks[i];\r\n jump = jm - jp;\r\n if (jalaliYear < jm) {\r\n break;\r\n }\r\n leapJ = leapJ + div(jump, 33) * 8 + div(mod(jump, 33), 4);\r\n jp = jm;\r\n }\r\n n = jalaliYear - jp;\r\n // Find the number of leap years from AD 621 to the beginning\r\n // of the current Jalali year in the Persian calendar.\r\n leapJ = leapJ + div(n, 33) * 8 + div(mod(n, 33) + 3, 4);\r\n if (mod(jump, 33) === 4 && jump - n === 4) {\r\n leapJ += 1;\r\n }\r\n // And the same in the Gregorian calendar (until the year gYear).\r\n leapG = div(gYear, 4) - div((div(gYear, 100) + 1) * 3, 4) - 150;\r\n // Determine the Gregorian date of Farvardin the 1st.\r\n march = 20 + leapJ - leapG;\r\n // Find how many years have passed since the last leap year.\r\n if (jump - n < 6) {\r\n n = n - jump + div(jump + 4, 33) * 33;\r\n }\r\n leap = mod(mod(n + 1, 33) - 1, 4);\r\n if (leap === -1) {\r\n leap = 4;\r\n }\r\n return {\r\n leap: leap,\r\n gy: gYear,\r\n march: march\r\n };\r\n }", "function buildDataByMonth(dataMap){\n var ret = {}; //the result data map\n var i = 1; //next month index\n var sum = 0; //the sum for current month\n var count = 0; //the day count for current month\n var m; //the month index for the current day\n for(var day in dataMap){\n m = new Date(day).getMonth() + 1;\n if(m > i) { // now we got to the first day of the next month, we need to caculate the current month firstly\n ret[\"2016年\"+(i++)+\"月\"] = sum / count;\n sum = count = 0;\n }\n sum += dataMap[day];\n ++count;\n }\n ret[\"2016年\"+(i)+\"月\"] = sum / count; //for the final month;\n return ret;\n}", "function asRoughYears(dur) {\n return asRoughDays(dur) / 365;\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 toGregorian$1(hebrewDate) {\n var hYear = hebrewDate.year;\n var hMonth = hebrewDate.month;\n var hDay = hebrewDate.day;\n var days = numberOfFirstDayInYear(hYear);\n\n for (var i = 1; i < hMonth; i++) {\n days += getDaysInHebrewMonth(i, hYear);\n }\n\n days += hDay;\n var diffDays = days - HEBREW_DAY_ON_JAN_1_1970;\n var after = diffDays >= 0;\n\n if (!after) {\n diffDays = -diffDays;\n }\n\n var gYear = 1970;\n var gMonth = 1;\n var gDay = 1;\n\n while (diffDays > 0) {\n if (after) {\n if (diffDays >= (isGregorianLeapYear$1(gYear) ? 366 : 365)) {\n diffDays -= isGregorianLeapYear$1(gYear) ? 366 : 365;\n gYear++;\n } else if (diffDays >= getDaysInGregorianMonth(gMonth, gYear)) {\n diffDays -= getDaysInGregorianMonth(gMonth, gYear);\n gMonth++;\n } else {\n gDay += diffDays;\n diffDays = 0;\n }\n } else {\n if (diffDays >= (isGregorianLeapYear$1(gYear - 1) ? 366 : 365)) {\n diffDays -= isGregorianLeapYear$1(gYear - 1) ? 366 : 365;\n gYear--;\n } else {\n if (gMonth > 1) {\n gMonth--;\n } else {\n gMonth = 12;\n gYear--;\n }\n\n if (diffDays >= getDaysInGregorianMonth(gMonth, gYear)) {\n diffDays -= getDaysInGregorianMonth(gMonth, gYear);\n } else {\n gDay = getDaysInGregorianMonth(gMonth, gYear) - diffDays + 1;\n diffDays = 0;\n }\n }\n }\n }\n\n return new Date(gYear, gMonth - 1, gDay);\n}", "function akanday(cc,yy,dd,mm){\n return ((((cc/4)-2*cc-1) + ((5*yy/4)) + ((26*(mm+1)/10)) + dd)%7);\n}", "function convertiData (data) {\n // +1 poiché getMonth() restituisce valori da 0 (Gennaio) a 11 (Dicembre).\n const mese = (data.getMonth() + 1).toString().padStart(2, \"0\");\n const anno = data.getFullYear();\n return anno + \"-\" + mese;\n }", "function calculateAge(){\n var DOB = document.getElementById('DOB').value; //DOB = date of birth\n var DOM = document.getElementById('DOM').value; //DOM = date of measurement\n\n //convert DOB - NZ to US formatting to allow for calculations\n var DOB_US = moment(DOB, \"DD/MM/YYYY\").format(\"MM/DD/YYYY\");\n var DOBasdate = moment(DOB_US, \"MM/DD/YYYY\");\n\n //convert DOM - NZ to US formatting to allow for calculations\n var DOM_US = moment(DOM, \"DD/MM/YYYY\").format(\"MM/DD/YYYY\");\n var DOMasdate = moment(DOM_US, \"MM/DD/YYYY\");\n\n //calculate difference in days between DOM and date of birth\n var ageInDays = DOMasdate.diff(DOBasdate, 'days');\n var humanAge = convertToYearsOld(DOBasdate, DOMasdate);\n\n return [ageInDays,humanAge];\n\n\n\n\n}", "function getDateFromFormat(val,format) {\r\n\tval=val+\"\";\r\n\tformat=format+\"\";\r\n\tvar i_val=0;\r\n\tvar i_format=0;\r\n\tvar c=\"\";\r\n\tvar token=\"\";\r\n\tvar token2=\"\";\r\n\tvar x,y;\r\n\tvar now=new Date();\r\n\tvar year=now.getYear();\r\n\tvar month=now.getMonth()+1;\r\n\tvar date=1;\r\n\tvar hh=now.getHours();\r\n\tvar mm=now.getMinutes();\r\n\tvar ss=now.getSeconds();\r\n\tvar ampm=\"\";\r\n\r\n\twhile (i_format < format.length) {\r\n\t\t// Get next token from format string\r\n\t\tc=format.charAt(i_format);\r\n\t\ttoken=\"\";\r\n\t\twhile ((format.charAt(i_format)==c) && (i_format < format.length)) {\r\n\t\t\ttoken += format.charAt(i_format++);\r\n\t\t\t}\r\n\t\t// Extract contents of value based on format token\r\n\t\tif (token==\"yyyy\" || token==\"yy\" || token==\"y\") {\r\n\t\t\tif (token==\"yyyy\") { x=4;y=4; }\r\n\t\t\tif (token==\"yy\") { x=2;y=2; }\r\n\t\t\tif (token==\"y\") { x=2;y=4; }\r\n\t\t\tyear=_getInt(val,i_val,x,y);\r\n\t\t\tif (year==null) { return 0; }\r\n\t\t\ti_val += year.length;\r\n\t\t\tif (year.length==2) {\r\n\t\t\t\t//START RT Changed this Code\r\n\t\t\t\tvar this_year_2d = \"\"+now.getFullYear();\r\n\t\t\t\tthis_year_2d = this_year_2d.substring(2)*1;\r\n\t\t\t\tyear = (year <= (this_year_2d+10)) ? (year-0+2000) : (year-0+1900);\r\n\t\t\t\t//END RT Changed this Code\t\t\t\t\r\n\t\t\t\t//START PH Changed this Code\r\n\t\t\t\t//The code now assumes any 2 digit year is in the future if \r\n\t\t\t\t//within 5 years of this year or in the past if otherwise.\r\n\t\t\t\t// var thisyear=now.getYear();\r\n\t\t\t\t// year=2000+(year-0);\r\n\t\t\t\t// if (year>thisyear+5){\r\n\t\t\t\t\t// year=year-100;\r\n\t\t\t\t// }\r\n\t\t\t\t//WAS\r\n\t\t\t\t//if (year > 70) { year=1900+(year-0); }\r\n\t\t\t\t//else { year=2000+(year-0); }\r\n\t\t\t\t//END PH Changed this Code\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\telse if (token==\"MMM\"||token==\"NNN\"){\r\n\t\t\tmonth=0;\r\n\t\t\tfor (var i=0; i<MONTH_NAMES.length; i++) {\r\n\t\t\t\tvar month_name=MONTH_NAMES[i];\r\n\t\t\t\tif (val.substring(i_val,i_val+month_name.length).toLowerCase()==month_name.toLowerCase()) {\r\n\t\t\t\t\tif (token==\"MMM\"||(token==\"NNN\"&&i>11)) {\r\n\t\t\t\t\t\tmonth=i+1;\r\n\t\t\t\t\t\tif (month>12) { month -= 12; }\r\n\t\t\t\t\t\ti_val += month_name.length;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\tif ((month < 1)||(month>12)){return 0;}\r\n\t\t\t}\r\n\t\telse if (token==\"EE\"||token==\"E\"){\r\n\t\t\tfor (var i=0; i<DAY_NAMES.length; i++) {\r\n\t\t\t\tvar day_name=DAY_NAMES[i];\r\n\t\t\t\tif (val.substring(i_val,i_val+day_name.length).toLowerCase()==day_name.toLowerCase()) {\r\n\t\t\t\t\ti_val += day_name.length;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\telse if (token==\"MM\"||token==\"M\") {\r\n\t\t\tmonth=_getInt(val,i_val,token.length,2);\r\n\t\t\tif(month==null||(month<1)||(month>12)){return 0;}\r\n\t\t\ti_val+=month.length;}\r\n\t\telse if (token==\"dd\"||token==\"d\") {\r\n\t\t\tdate=_getInt(val,i_val,token.length,2);\r\n\t\t\tif(date==null||(date<1)||(date>31)){return 0;}\r\n\t\t\ti_val+=date.length;}\r\n\t\telse if (token==\"hh\"||token==\"h\") {\r\n\t\t\thh=_getInt(val,i_val,token.length,2);\r\n\t\t\tif(hh==null||(hh<1)||(hh>12)){return 0;}\r\n\t\t\ti_val+=hh.length;}\r\n\t\telse if (token==\"HH\"||token==\"H\") {\r\n\t\t\thh=_getInt(val,i_val,token.length,2);\r\n\t\t\tif(hh==null||(hh<0)||(hh>23)){return 0;}\r\n\t\t\ti_val+=hh.length;}\r\n\t\telse if (token==\"KK\"||token==\"K\") {\r\n\t\t\thh=_getInt(val,i_val,token.length,2);\r\n\t\t\tif(hh==null||(hh<0)||(hh>11)){return 0;}\r\n\t\t\ti_val+=hh.length;}\r\n\t\telse if (token==\"kk\"||token==\"k\") {\r\n\t\t\thh=_getInt(val,i_val,token.length,2);\r\n\t\t\tif(hh==null||(hh<1)||(hh>24)){return 0;}\r\n\t\t\ti_val+=hh.length;hh--;}\r\n\t\telse if (token==\"mm\"||token==\"m\") {\r\n\t\t\tmm=_getInt(val,i_val,token.length,2);\r\n\t\t\tif(mm==null||(mm<0)||(mm>59)){return 0;}\r\n\t\t\ti_val+=mm.length;}\r\n\t\telse if (token==\"ss\"||token==\"s\") {\r\n\t\t\tss=_getInt(val,i_val,token.length,2);\r\n\t\t\tif(ss==null||(ss<0)||(ss>59)){return 0;}\r\n\t\t\ti_val+=ss.length;}\r\n\t\telse if (token==\"a\") {\r\n\t\t\tif (val.substring(i_val,i_val+2).toLowerCase()==\"am\") {ampm=\"AM\";}\r\n\t\t\telse if (val.substring(i_val,i_val+2).toLowerCase()==\"pm\") {ampm=\"PM\";}\r\n\t\t\telse {return 0;}\r\n\t\t\ti_val+=2;}\r\n\t\telse {\r\n\t\t\tif (val.substring(i_val,i_val+token.length)!=token) {return 0;}\r\n\t\t\telse {i_val+=token.length;}\r\n\t\t\t}\r\n\t\t}\r\n\t// If there are any trailing characters left in the value, it doesn't match\r\n\tif (i_val != val.length) { return 0; }\r\n\t// Is date valid for month?\r\n\tif (month==2) {\r\n\t\t// Check for leap year\r\n\t\tif ( ( (year%4==0)&&(year%100 != 0) ) || (year%400==0) ) { // leap year\r\n\t\t\tif (date > 29){ return 0; }\r\n\t\t\t}\r\n\t\telse { if (date > 28) { return 0; } }\r\n\t\t}\r\n\tif ((month==4)||(month==6)||(month==9)||(month==11)) {\r\n\t\tif (date > 30) { return 0; }\r\n\t\t}\r\n\t// Correct hours value\r\n\tif (hh<12 && ampm==\"PM\") { hh=hh-0+12; }\r\n\telse if (hh>11 && ampm==\"AM\") { hh-=12; }\r\n\tvar newdate=new Date(year,month-1,date,hh,mm,ss);\r\n\treturn newdate.getTime();\r\n\t}", "function fromGregorian(gdate) {\n let g2d = gregorianToJulian(gdate.getFullYear(), gdate.getMonth() + 1, gdate.getDate());\n return julianToJalali(g2d);\n}", "function CalculateMonthlyAverage(data){\n let monthName = \"\"; // to use for calculating of monthly average value\n var janSum, febSum, marSum, aprSum, maySum, junSum, julSum, augSum, sepSum, octSum, novSum, decSum;\n janSum = febSum = marSum = aprSum = maySum = junSum = julSum = augSum = sepSum = octSum = novSum = decSum = 0; // variable for each monthly total\n var janAvg, febAvg, marAvg, aprAvg, mayAvg, junAvg, julAvg, augAvg, sepAvg, octAvg, novAvg, decAvg;\n janAvg = febAvg = marAvg = aprAvg = mayAvg = junAvg = julAvg = augAvg = sepAvg = octAvg = novAvg = decAvg = 0; // variable for each monthly average\n let counter = 0; // count only the day that has a valid value \n let month, day = \"\";\n \n for (let m=1; m<13; m++){ // loop over months\n if (m<10) month=\"0\"+m;\n else month=m.toString();\n \n for (let d=1; d<32; d++){ // loop over days\n if(monthName == \"\" || monthName != month){ // first calculation of the average or calculation of the new month\n monthName = month;\n counter = 0;\n } \n \n if (d<10) day=\"0\"+d; \n else day=d;\n \n let ymd = \"2020-\"+month+\"-\"+day; // ymd : year-month-day\n \n data.forEach(function(element){\n if(element[ymd] == undefined || element[ymd] == \"\" || element[ymd] == null ){\n // set 0 for undefined value \n element[ymd] = 0 \n }else{\n counter++ \n \n switch(month){\n case \"01\":\n janSum += parseFloat(element[ymd])\n janAvg = janSum/counter\n\n element[month] = janAvg.toFixed(2)\n break;\n case \"02\":\n febSum += parseFloat(element[ymd])\n febAvg = febSum /counter\n element[month] = febAvg.toFixed(2)\n break;\n case \"03\":\n marSum += parseFloat(element[ymd])\n marAvg = marSum /counter\n element[month] = marAvg.toFixed(2)\n break;\n case \"04\":\n aprSum += parseFloat(element[ymd])\n aprAvg = aprSum /counter\n element[month] = aprAvg.toFixed(2)\n break;\n case \"05\":\n maySum += parseFloat(element[ymd])\n mayAvg = maySum /counter\n element[month] = mayAvg.toFixed(2)\n break;\n case \"06\":\n junSum += parseFloat(element[ymd])\n junAvg = junSum /counter\n element[month] = junAvg.toFixed(2)\n break;\n case \"07\":\n julSum += parseFloat(element[ymd])\n julAvg = julSum /counter\n element[month] = julAvg.toFixed(2)\n break;\n case \"08\":\n augSum += parseFloat(element[ymd])\n augAvg = augSum /counter\n element[month] = augAvg.toFixed(2)\n break;\n case \"09\":\n sepSum += parseFloat(element[ymd])\n sepAvg = sepSum /counter\n element[month] = sepAvg.toFixed(2)\n break;\n case \"10\": \n octSum += parseFloat(element[ymd])\n octAvg = octSum /counter\n element[month] = octAvg.toFixed(2)\n break;\n case \"11\":\n novSum += parseFloat(element[ymd])\n novAvg = novSum /counter\n element[month] = novAvg.toFixed(2)\n break;\n case \"12\":\n decSum += parseFloat(element[ymd])\n decAvg = decSum /counter\n element[month] = decAvg.toFixed(2)\n break;\n default:\n }\n }\n });\n }}\n }", "function updateFromGregorian()\n {\n var j, year, mon, mday, hour, min, sec,\n\t weekday, julcal, hebcal, islcal, hmindex, utime, isoweek,\n\t may_countcal, mayhaabcal, maytzolkincal, bahcal, frrcal,\n\t indcal, isoday, xgregcal;\n\n year = new Number(document.gregorian.year.value);\n mon = document.gregorian.month.selectedIndex;\n mday = new Number(document.gregorian.day.value);\n hour = min = sec = 0;\n hour = new Number(document.gregorian.hour.value);\n min = new Number(document.gregorian.min.value);\n sec = new Number(document.gregorian.sec.value);\n\n // Update Julian day\n\n j = gregorian_to_jd(year, mon + 1, mday) +\n\t (Math.floor(sec + 60 * (min + 60 * hour) + 0.5) / 86400.0);\n\n document.julianday.day.value = j;\n document.modifiedjulianday.day.value = j - JMJD;\n\n // Update day of week in Gregorian box\n\n weekday = jwday(j);\n document.gregorian.wday.value = Weekdays[weekday];\n\n // Update leap year status in Gregorian box\n\n document.gregorian.leap.value = NormLeap[leap_gregorian(year) ? 1 : 0];\n\n // Update Julian Calendar\n\n julcal = jd_to_julian(j);\n document.juliancalendar.year.value = julcal[0];\n document.juliancalendar.month.selectedIndex = julcal[1] - 1;\n document.juliancalendar.day.value = julcal[2];\n document.juliancalendar.leap.value = NormLeap[leap_julian(julcal[0]) ? 1 : 0];\n weekday = jwday(j);\n document.juliancalendar.wday.value = Weekdays[weekday];\n\n // Update Hebrew Calendar\n\n hebcal = jd_to_hebrew(j);\n if (hebrew_leap(hebcal[0])) {\n\t document.hebrew.month.options.length = 13;\n\t document.hebrew.month.options[11] = new Option(\"Adar I\");\n\t document.hebrew.month.options[12] = new Option(\"Veadar\");\n } else {\n\t document.hebrew.month.options.length = 12;\n\t document.hebrew.month.options[11] = new Option(\"Adar\");\n }\n document.hebrew.year.value = hebcal[0];\n document.hebrew.month.selectedIndex = hebcal[1] - 1;\n document.hebrew.day.value = hebcal[2];\n hmindex = hebcal[1];\n if (hmindex == 12 && !hebrew_leap(hebcal[0])) {\n\t hmindex = 14;\n }\n document.hebrew.hebmonth.src = \"figures/hebrew_month_\" +\n\t hmindex + \".gif\";\n switch (hebrew_year_days(hebcal[0])) {\n\t case 353:\n\t document.hebrew.leap.value = \"Common deficient (353 days)\";\n\t break;\n\n\t case 354:\n\t document.hebrew.leap.value = \"Common regular (354 days)\";\n\t break;\n\n\t case 355:\n\t document.hebrew.leap.value = \"Common complete (355 days)\";\n\t break;\n\n\t case 383:\n\t document.hebrew.leap.value = \"Embolismic deficient (383 days)\";\n\t break;\n\n\t case 384:\n\t document.hebrew.leap.value = \"Embolismic regular (384 days)\";\n\t break;\n\n\t case 385:\n\t document.hebrew.leap.value = \"Embolismic complete (385 days)\";\n\t break;\n\n\t default:\n\t document.hebrew.leap.value = \"Invalid year length: \" +\n\t\t hebrew_year_days(hebcal[0]) + \" days.\";\n\t break;\n }\n\n // Update Islamic Calendar\n\n islcal = jd_to_islamic(j);\n document.islamic.year.value = islcal[0];\n document.islamic.month.selectedIndex = islcal[1] - 1;\n document.islamic.day.value = islcal[2];\n document.islamic.wday.value = \"yawm \" + ISLAMIC_WEEKDAYS[weekday];\n document.islamic.leap.value = NormLeap[leap_islamic(islcal[0]) ? 1 : 0];\n\n // Update Persian Calendar\n\n perscal = jd_to_persian(j);\n document.persian.year.value = perscal[0];\n document.persian.month.selectedIndex = perscal[1] - 1;\n document.persian.day.value = perscal[2];\n document.persian.wday.value = PERSIAN_WEEKDAYS[weekday];\n document.persian.leap.value = NormLeap[leap_persian(perscal[0]) ? 1 : 0];\n\n // Update Persian Astronomical Calendar\n\n perscal = jd_to_persiana(j);\n document.persiana.year.value = perscal[0];\n document.persiana.month.selectedIndex = perscal[1] - 1;\n document.persiana.day.value = perscal[2];\n document.persiana.wday.value = PERSIAN_WEEKDAYS[weekday];\n document.persiana.leap.value = NormLeap[leap_persiana(perscal[0]) ? 1 : 0];\n\n // Update Mayan Calendars\n\n may_countcal = jd_to_mayan_count(j);\n document.mayancount.baktun.value = may_countcal[0];\n document.mayancount.katun.value = may_countcal[1];\n document.mayancount.tun.value = may_countcal[2];\n document.mayancount.uinal.value = may_countcal[3];\n document.mayancount.kin.value = may_countcal[4];\n mayhaabcal = jd_to_mayan_haab(j);\n document.mayancount.haab.value = \"\" + mayhaabcal[1] + \" \" + MAYAN_HAAB_MONTHS[mayhaabcal[0] - 1];\n maytzolkincal = jd_to_mayan_tzolkin(j);\n document.mayancount.tzolkin.value = \"\" + maytzolkincal[1] + \" \" + MAYAN_TZOLKIN_MONTHS[maytzolkincal[0] - 1];\n\n // Update Bahai Calendar\n\n bahcal = jd_to_bahai(j);\n document.bahai.kull_i_shay.value = bahcal[0];\n document.bahai.vahid.value = bahcal[1];\n document.bahai.year.selectedIndex = bahcal[2] - 1;\n document.bahai.month.selectedIndex = bahcal[3] - 1;\n document.bahai.day.selectedIndex = bahcal[4] - 1;\n document.bahai.weekday.value = BAHAI_WEEKDAYS[weekday];\n document.bahai.leap.value = NormLeap[leap_gregorian(year) ? 1 : 0]; // Bahai uses same leap rule as Gregorian\n\n // Update Indian Civil Calendar\n\n indcal = jd_to_indian_civil(j);\n document.indiancivilcalendar.year.value = indcal[0];\n document.indiancivilcalendar.month.selectedIndex = indcal[1] - 1;\n document.indiancivilcalendar.day.value = indcal[2];\n document.indiancivilcalendar.weekday.value = INDIAN_CIVIL_WEEKDAYS[weekday];\n document.indiancivilcalendar.leap.value = NormLeap[leap_gregorian(indcal[0] + 78) ? 1 : 0];\n\n // Update French Republican Calendar\n\n frrcal = jd_to_french_revolutionary(j);\n document.french.an.value = frrcal[0];\n document.french.mois.selectedIndex = frrcal[1] - 1;\n document.french.decade.selectedIndex = frrcal[2] - 1;\n document.french.jour.selectedIndex = ((frrcal[1] <= 12) ? frrcal[3] : (frrcal[3] + 11)) - 1;\n\n // Update Gregorian serial number\n\n if (document.gregserial != null) {\n\t document.gregserial.day.value = j - J0000;\n }\n\n // Update Excel 1900 and 1904 day serial numbers\n\n document.excelserial1900.day.value = (j - J1900) + 1 +\n\t /* Microsoft marching morons thought 1900 was a leap year.\n\t\t Adjust dates after 1900-02-28 to compensate for their\n\t\t idiocy. */\n\t ((j > 2415078.5) ? 1 : 0)\n\t ;\n document.excelserial1904.day.value = j - J1904;\n\n // Update Unix time()\n\n utime = (j - J1970) * (60 * 60 * 24 * 1000);\n document.unixtime.time.value = Math.round(utime / 1000);\n\n // Update ISO Week\n\n isoweek = jd_to_iso(j);\n document.isoweek.year.value = isoweek[0];\n document.isoweek.week.value = isoweek[1];\n document.isoweek.day.value = isoweek[2];\n\n // Update ISO Day\n\n isoday = jd_to_iso_day(j);\n document.isoday.year.value = isoday[0];\n document.isoday.day.value = isoday[1];\n }", "function asRoughYears$1(dur) {\n return asRoughDays$1(dur) / 365;\n }", "function fromGregorian(gdate) {\n var g2d = gregorianToJulian(gdate.getFullYear(), gdate.getMonth() + 1, gdate.getDate());\n return julianToJalali(g2d);\n}", "gregorianToDay(gy, gm, gd) {\r\n let day = div((gy + div(gm - 8, 6) + 100100) * 1461, 4) + div(153 * mod(gm + 9, 12) + 2, 5) + gd - 34840408;\r\n day = day - div(div(gy + 100100 + div(gm - 8, 6), 100) * 3, 4) + 752;\r\n return day;\r\n }", "function dateToMoonAngle(d) {\n var periods = (d - epoch) / moonPeriodMsec;\n return periods - Math.floor(periods);\n}", "function calcYearProjection(data) {\n\tlet projection = data.ytd;\n\tconst today = new Date();\n\tconst dd = today.getDate();\n\tconst mm = today.getMonth() + 1;\n\tconst yyyy = today.getFullYear();\n\tconst todayStr = mm + '/' + dd + '/' + yyyy;\n\tconst endDate = '12/31/' + yyyy;\n\n\tconst date1 = new Date(todayStr);\n\tconst date2 = new Date(endDate);\n\tconst timeDiff = Math.abs(date2.getTime() - date1.getTime());\n\tconst diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24));\n\tconst diffWeek = Math.ceil(diffDays / 7);\n\tconst diffMonth = Math.ceil(diffDays / 30);\n\tconst diffYear = Math.ceil(diffDays / 365);\n\tswitch (data.schedule) {\n\t\tcase \"day\": projection += data.amount * diffDays; break;\n\t\tcase \"week\": projection += data.amount * diffWeek; break;\n\t\tcase \"month\": projection += data.amount * diffMonth; break;\n\t\tcase \"year\": projection += data.amount * diffYear; break;\n\t}\n\treturn projection;\n}", "function calcPersian()\n {\n setJulian(persian_to_jd((new Number(document.persian.year.value)),\n\t\t\t document.persian.month.selectedIndex + 1,\n\t\t\t (new Number(document.persian.day.value))));\n }", "function convert2yrCourseReport(){\n convertCourseReport(2);\n}", "function moon_facts()\n{\n with (Math) {\n\n var dt_as_str, mm, yy, i, tmp, k, t;\n var M, M1, F, NM_FM, FQ_LQ, RAD = 180 / PI;\n var jd_temp, d_of_w, dow_str, zz, ff, alpha;\n var aa, bb, cc, dd, ee, calendar_day, month;\n var calendar_month, int_day, hours, minutes;\n\n moon_data = \"\";\n phase[0] = \"New Moon \";\n phase[1] = \"Moon at first quarter \";\n phase[2] = \"Full Moon \";\n phase[3] = \"Moon at last quarter \";\n\n dt_as_str = document.planets.date_txt.value;\n yy = eval(dt_as_str.substring(6,10));\n mm = eval(dt_as_str.substring(0,2));\n dd = eval(dt_as_str.substring(3,5));\n\n tmp = floor(((yy + (mm - 1) / 12 + dd / 365.25) - 1900.0) * 12.3685);\n\n for (i=0; i<4; i++)\n {\n k = tmp + i * 0.25;\n t = k / 1236.85;\n M = proper_ang(359.2242 + 29.10535608 * k - 0.0000333 * pow(t,2) - 0.00000347 * pow(t,3)) / RAD;\n M1 = proper_ang(306.0253 + 385.81691806 * k + 0.0107306 * pow(t,2) + 0.00001236 * pow(t,3)) / RAD;\n F = proper_ang(21.2964 + 390.67050646 * k - 0.0016528 * pow(t,2) - 0.00000239 * pow(t,3)) / RAD;\n NM_FM = (0.1734 - 0.000393 * t) * sin(M) + 0.0021 * sin(2 * M) - 0.4068 * sin(M1) + 0.0161 * sin(2 * M1) - 0.0004 * sin(3 * M1) + 0.0104 * sin(2 * F) - 0.0051 * sin(M + M1) - 0.0074 * sin(M - M1) + 0.0004 * sin(2 * F + M) - 0.0004 * sin(2 * F - M) - 0.0006 * sin(2 * F + M1) + 0.0010 * sin(2 * F - M1) + 0.0005 * sin(M + 2 * M1);\n FQ_LQ = (0.1721 - 0.0004 * t) * sin(M) + 0.0021 * sin(2 * M) - 0.628 * sin(M1) + 0.0089 * sin(2 * M1) - 0.0004 * sin(3 * M1) + 0.0079 * sin(2 * F) - 0.0119 * sin(M + M1) - 0.0047 * sin(M - M1) + 0.0003 * sin(2 * F + M) - 0.0004 * sin(2 * F - M) - 0.0006 * sin(2 * F + M1) + 0.0021 * sin(2 * F - M1) + 0.0003 * sin(M + 2 * M1) + 0.0004 * sin(M - 2 * M1) - 0.0003 * sin(2 * M + M1);\n phases[i] = 2415020.75933 + 29.53058868 * k + 0.0001178 * pow(t,2) - 0.000000155 * pow(t,3) + 0.00033 * sin(2.907 + 2.319 * t - 1.6e-4 * pow(t,2));\n if (i == 0 || i == 2) phases[i] += NM_FM;\n if (i == 1) phases[i] = phases[i] + FQ_LQ + 0.0028 - 0.0004 * cos(M) + 0.0003 * cos(M1);\n if (i == 3) phases[i] = phases[i] + FQ_LQ - 0.0028 + 0.0004 * cos(M) - 0.0003 * cos(M1);\n }\n new_moon = phases[0];\n\n for (i=0; i<4; i++)\n {\n jd_temp = phases[i] + 0.5;\n\n d_of_w = floor(jd_temp + 1.0) % 7;\n if (d_of_w == 0) dow_str = \"Sun.\";\n if (d_of_w == 1) dow_str = \"Mon.\";\n if (d_of_w == 2) dow_str = \"Tue.\";\n if (d_of_w == 3) dow_str = \"Wed.\";\n if (d_of_w == 4) dow_str = \"Thu.\";\n if (d_of_w == 5) dow_str = \"Fri.\";\n if (d_of_w == 6) dow_str = \"Sat.\";\n\n zz = floor(jd_temp);\n ff = jd_temp - zz;\n alpha = floor((zz - 1867216.25) / 36524.25);\n aa = zz + 1 + alpha - floor(alpha / 4);\n bb = aa + 1524;\n cc = floor((bb - 122.1) / 365.25);\n dd = floor(365.25 * cc);\n ee = floor((bb - dd) / 30.6001);\n calendar_day = bb - dd - floor(30.6001 * ee) + ff;\n calendar_month = ee;\n if (ee < 13.5) calendar_month = ee - 1;\n if (ee > 13.5) calendar_month = ee - 13;\n calendar_year = cc;\n if (calendar_month > 2.5) calendar_year = cc - 4716;\n if (calendar_month < 2.5) calendar_year = cc - 4715;\n int_day = floor(calendar_day);\n hours = (calendar_day - int_day) * 24;\n minutes = floor((hours - floor(hours)) * 60 + 0.5);\n hours = floor(hours);\n if (minutes > 59)\n {minutes = 0; hours = hours + 1;}\n if (hours < 10) hours = \"0\" + hours;\n if (minutes < 10) minutes = \"0\" + minutes;\n if (int_day < 10) int_day = \"0\" + int_day;\n\n if (calendar_month == 1) month = \"Jan.\";\n if (calendar_month == 2) month = \"Feb.\";\n if (calendar_month == 3) month = \"Mar.\";\n if (calendar_month == 4) month = \"Apr.\";\n if (calendar_month == 5) month = \"May \";\n if (calendar_month == 6) month = \"Jun.\";\n if (calendar_month == 7) month = \"Jul.\";\n if (calendar_month == 8) month = \"Aug.\";\n if (calendar_month == 9) month = \"Sep.\";\n if (calendar_month == 10) month = \"Oct.\";\n if (calendar_month == 11) month = \"Nov.\";\n if (calendar_month == 12) month = \"Dec.\";\n\n moon_data += dow_str + \" \" + month + \" \" + int_day + \", \" + calendar_year + \" \" + phase[i] + \"(\" + hours + \":\" + minutes + \" UT)\";\n\n if (i == 1 || i == 3)\n {\n moon_data += \"\\n\"\n }\n else\n {\n moon_data += \" \";\n }\n\n }\n\n }\n}", "jalaliToDay(jYear, jMonth, jDay) {\r\n let r = this.jalCal(jYear);\r\n return this.gregorianToDay(r.gy, 3, r.march) + (jMonth - 1) * 31 - div(jMonth, 7) * (jMonth - 7) + jDay - 1;\r\n }", "function libraryFine(d1, m1, y1, d2, m2, y2) {\n // I would start off comparing the years...\n // if the year it was returned is greater than the due date year, return 10,000.\n if(y1 > y2){\n return 10000\n // else if the year is equal to the due date year...\n } else if(y1 === y2){\n // we check if the month is greater than the due date month..\n if(m1 > m2){\n // we check if the day it was returned is greater or equal than the due date day, and also if the year it was returned is greater than the due date year.\n if(d1 >= d2 && y1 > y2){\n // if it is, we return 10,000..\n return 10000\n // otherwise, it has not been more than a year so... \n } else {\n // we subtract the returned month minus the due date month..\n let result = Math.abs(m1 - m2)\n // and we return the multiplication of the result times 500.\n return 500 * result\n }\n // else if the month is returned is less than the due date month, we return 0.\n } else if(m1 < m2){\n return 0\n }\n // if the day is greater than the due date day...\n if(d1 > d2){\n // we subtract the returned day minus the due date day..\n let result = Math.abs(d1 - d2)\n // and return the result times 15.\n return 15 * result\n }\n }\n // if none of this returns anything, there might be an edge case that it was not returned late, so we still need to return 0.\n return 0\n}", "function j2h(hdn) {\n var gy = j2g(hdn).gy // Calculate Gregorian year (gy).\n , hy = gy - 621\n , r = solarHijriCal(hy)\n , hdn1l = g2j(gy, 9, r.startDate)// Julian day number of 1st Libra(Mizān)\n , leap = r.leap ? 1:0\n , hd\n , hm\n , k;\n\n k = hdn - hdn1l;\n if(k >= 0 && k <= 99) {\n // 23/9G to 31/12G\n hm = 1 + div(k, 30);\n hd = mod(k, 30) + 1;\n return { hy: hy\n , hm: hm\n , hd: hd\n }\n } else {\n // k is less than 0\n // Previous SolarHijri year.\n k += 365;\n hy -= 1;\n r = solarHijriCal(hy);\n leap = r.leap ? 1:0;\n\n\n if(k <= 178) {\n // the 4th to 6th month are 30 days.\n k += leap;\n hm = 1 + div(k, 30);\n hd = mod(k, 30) + 1;\n return { hy: hy\n , hm: hm\n , hd: hd\n }\n } else {\n // the 7th to 12th month are 31 days.\n k -= 179;\n hm = 7 + div(k, 31);\n hd = mod(k, 31) + 1;\n return { hy: hy\n , hm: hm\n , hd: hd\n }\n }\n\n }\n\n\n}", "function dateToMillisUN(date) {\r\n\t// Ensure the date is in a format we can work with.\r\n\tif(date!=null)\r\n\t\t//date = date.split('-').join('/');\r\n\t\tif(date.indexOf(\"\\.\") != -1 ){\r\n\t\t\tdate = date.replace(/\\./g,'/')\r\n\t\t}\r\n\t\tif(date.indexOf(\"-\")!=-1){\r\n\t\t\tdate = date.replace(/\\-/g,'/');\r\n\t\t}\r\n\t\tif(date.indexOf(\"/\")==-1){\r\n\t\t\tif(date.length == 8){\r\n\t\t\t\tvar dayDeli = date.substr(0,2);\r\n\t\t\t\tvar monthDeli = date.substr(2,2);\r\n\t\t\t\tvar yearDeli = date.substr(4,8);\r\n\t\t\t\tdate = dayDeli+\"/\"+monthDeli+\"/\"+yearDeli;\r\n\t\t\t}\r\n\t\t\telse if(date.length == 6){\r\n\t\t\t\tvar dayDeli = date.substr(0,2);\r\n\t\t\t\tvar monthDeli = date.substr(2,2);\r\n\t\t\t\tvar yearDeli = date.substr(4,6);\r\n\t\t\t\tdate = dayDeli+\"/\"+monthDeli+\"/\"+yearDeli;\r\n\t\t\t}\r\n\t\t\r\n\t\t}\r\n\tvar splitDate = date.split(\"/\");\r\n\t\r\n\tvar theday=splitDate[0];\r\n\tvar themonth=splitDate[1];\r\n\tvar theyear=splitDate[2];\r\n\t\r\n\t//IWS-255: When the user enters \"08\" in date box for the 'year, it automatically gets selected as \"1908\" instead of \"2008\".\r\n\t// 1. If user enters 00 to 49 as year, it sets to 2000 to 2049.\r\n\t// 2. If user enters 50 to 99 as year, it sets to 1950 to 1999.\r\n\tif (theyear.length == 2){ \r\n\t\tvar newyear = \"20\" + theyear;\r\n\t\tif (newyear < \"2050\"){ theyear = newyear; }\r\n\t\telse { theyear = \"19\" + theyear}\r\n\t}\r\n\r\n\tdateString = (themonth+\"/\"+theday+\"/\"+theyear);\r\n\t\r\n\tvar useDate = new Date(dateString);\r\n\tvar themillis = Date.parse(useDate);\r\n\t\r\n\treturn themillis;\r\n}", "function calculatedayOfweek(){\n year = document.getElementById(\"year\").value;\n var CC = parseInt(year.substring(0,2));\n var YY = parseInt(year.substring(2,4));\n month = parseInt(document.getElementById(\"month\").value);\n day = parseInt(document.getElementById(\"date\").value);\n //Zellar Algorithms\n d = ( ( (CC/4) -2*CC-1) + ( (5*YY/4) ) + ((26*(month+1)/10) ) + day)%7;\n console.log(d);\n return (Math.floor(d));\n}", "function Gauss(year) {\r\n\tvar a,b,c;\r\n\tvar m;\r\n\tvar\tMar;\t// \"day in March\" on which Pesach falls (return value)\r\n\r\n\ta = Math.floor((12 * year + 17) % 19);\r\n\tb = Math.floor(year % 4);\r\n\tm = 32.044093161144 + 1.5542417966212 * a + b / 4.0 - 0.0031777940220923 * year;\r\n\tif (m < 0)\r\n\t\tm -= 1;\r\n\tMar = Math.floor(m);\r\n\tif (m < 0)\r\n\t\tm++;\r\n\tm -= Mar;\r\n\r\n\tc = Math.floor((Mar + 3 * year + 5 * b + 5) % 7);\r\n\tif(c == 0 && a > 11 && m >= 0.89772376543210 )\r\n\t\tMar++;\r\n\telse if(c == 1 && a > 6 && m >= 0.63287037037037)\r\n\t\tMar += 2;\r\n\telse if(c == 2 || c == 4 || c == 6)\r\n\t\tMar++;\r\n\r\n\tMar += Math.floor((year - 3760) / 100) - Math.floor((year - 3760) / 400) - 2;\r\n\treturn Mar;\r\n}", "function a(e,a,t){return e+\" \"+function(e,a){return 2===a?function(e){var a={m:\"v\",b:\"v\",d:\"z\"};return void 0===a[e.charAt(0)]?e:a[e.charAt(0)]+e.substring(1)}(e):e}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[t],e)}", "function cal_to_jd( y, m, d )\r\n{\r\n var jy, ja, jm; //scratch\r\n if( y == 0 ) {\r\n alert(\"There is no year 0 in the Julian system!\");\r\n return \"invalid\";\r\n }\r\n if( y == 1582 && m == 10 && d > 4 && d < 15 && era == \"CE\" ) {\r\n alert(\"The dates 5 through 14 October, 1582, do not exist in the Gregorian system!\");\r\n return \"invalid\";\r\n }\r\n\r\n// if( y < 0 ) ++y;\r\n if( m > 2 ) {\r\n jy = y;\r\n jm = m + 1;\r\n } else {\r\n jy = y - 1;\r\n jm = m + 13;\r\n }\r\n\r\n var intgr = Math.floor( Math.floor(365.25*jy) + Math.floor(30.6001*jm) + d + 1720995 );\r\n\r\n //check for switch to Gregorian calendar\r\n var gregcal = 15 + 31*( 10 + 12*1582 );\r\n if( d + 31*(m + 12*y) >= gregcal ) {\r\n ja = Math.floor(0.01*jy);\r\n intgr += 2 - ja + Math.floor(0.25*ja);\r\n }\r\n\r\n return intgr;\r\n}", "function toGregorian(hy, hm, hd) {\n return j2g(h2j(hy, hm, hd))\n}", "function calcIslamic()\n {\n setJulian(islamic_to_jd((new Number(document.islamic.year.value)),\n\t\t\t document.islamic.month.selectedIndex + 1,\n\t\t\t (new Number(document.islamic.day.value))));\n }", "function datediff(results){\n var created = results.created;\n var date = new Date();\n var a = moment(date);\n var b = moment(created);\n var diff = a.diff(b, 'years', true) //[days, years, months, seconds, ...]\n console.log('sadsad', diff); \n if (diff >=1){\n /*a = p(1+ r/100)^n*/\n var a = results.currentprice / results.price;\n var r = (Math.pow(a.toFixed(2), diff.toFixed(2)) * 100) - 100;\n console.log('cagr annual', r); \n results.annual = r;\n }\n else {\n var b = results.currentprice / results.price;\n console.log('das', b);\n var r = (Math.pow(b, diff * 12) * 1200) - 1200;\n console.log('cagr monthly', r);\n results.monthly = r;\n }\n return results;\n}", "function compute(form) {\n var val1 = parseInt(form.day.value, 10)\n if ((val1 < 0) || (val1 > 31)) {\n alert(\"Day is out of range\")\n }\n var val2 = parseInt(form.month.value, 10)\n if ((val2 < 0) || (val2 > 12)) {\n alert(\"Month is out of range\")\n }\n var val2x = parseInt(form.month.value, 10)\n var val3 = parseInt(form.year.value, 10)\n if (val3 < 1900) {\n alert(\"You're that old!\")\n }\n if (val2 == 1) {\n val2x = 13;\n val3 = val3-1\n }\n if (val2 == 2) {\n val2x = 14;\n val3 = val3-1\n }\n var val4 = parseInt(((val2x+1)*3)/5, 10)\n var val5 = parseInt(val3/4, 10)\n var val6 = parseInt(val3/100, 10)\n var val7 = parseInt(val3/400, 10)\n var val8 = val1+(val2x*2)+val4+val3+val5-val6+val7+2\n var val9 = parseInt(val8/7, 10)\n var val0 = val8-(val9*7)\n form.result1.value = months[val2]+\" \"+form.day.value +\", \"+form.year.value\n form.result2.value = days[val0]\n}", "function y2k(number) { return (number < 1000) ? number + 1900 : number; }", "function calcAge1(birthYear) {\n return 2037 - birthYear;\n}", "function a(e,a,t){var n=\" \";return(e%100>=20||e>=100&&e%100==0)&&(n=\" de \"),e+n+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"}[t]}", "dayToGregorion(julianDayNumber) {\r\n let j, i, gDay, gMonth, gYear;\r\n j = 4 * julianDayNumber + 139361631;\r\n j = j + div(div(4 * julianDayNumber + 183187720, 146097) * 3, 4) * 4 - 3908;\r\n i = div(mod(j, 1461), 4) * 5 + 308;\r\n gDay = div(mod(i, 153), 5) + 1;\r\n gMonth = mod(div(i, 153), 12) + 1;\r\n gYear = div(j, 1461) - 100100 + div(8 - gMonth, 6);\r\n return new Date(gYear, gMonth - 1, gDay);\r\n }", "howOld(birthday){\n \n // convert birthday into a numeric value\n\n // convert current date into a numeric value\n\n // subtract birthday numeric value from current date value to get the numeric value of time elapsed\n\n // convert the time elapsed value into years\n\n // round down the converted years value\n\n // return the rounded years value\n\n let date = new Date().getFullYear();\n let age = date-birthyear\n \n return age;\n return -1;\n }", "function time_conversion(time) {\n const current_date = new Date();\n\n const months = [\"\", \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n\n const days = [\"\", \"Mon\", \"Tue\", \"Wed\", \"Thur\", \"Fri\", \"Sat\", \"Sun\"];\n\n const actual_date = new Date(time * 1000); //convert timestamp to date\n\n var date_difference = current_date - actual_date;\n\n var date_difference_in_seconds = Math.floor((date_difference) / 1000);\n\n var date_difference_in_minutes = Math.floor(date_difference_in_seconds / 60);\n\n var date_difference_in_hours = Math.floor(date_difference_in_minutes / 60);\n\n var date_difference_in_days = Math.floor(date_difference_in_hours / 24);\n\n var date_difference_in_years = Math.floor(date_difference_in_days / 365.25);\n\n // console.log(date_difference_in_hours);\n\n if (date_difference_in_seconds < 60) {\n //if less than 1 minute ago\n time = date_difference_in_seconds + 'sec';\n } else if ((date_difference_in_minutes >= 1) && (date_difference_in_minutes < 60)) {\n //if between 1 minute and 1 hour ago\n time = date_difference_in_minutes + 'min';\n } else if ((date_difference_in_hours >= 1) && (date_difference_in_hours < 24)) {\n //if date between 1 hour and 1 day ago\n time = date_difference_in_hours + 'h';\n } else if ((date_difference_in_days >= 1) && (date_difference_in_days < 7)) {\n //if date between 1 day and 7 days ago\n time = days[date_difference_in_days];\n } else if ((date_difference_in_days >= 7) && (date_difference_in_years < 1)) {\n time = months[actual_date.getUTCMonth()] + ', ' + actual_date.getDate();\n } else if (date_difference_in_years > 1) {\n time = actual_date.getFullYear() + ', ' + months[actual_date.getMonth()] + ' ' + actual_date.getDate();\n }\n\n return time;\n}", "function jd_to_persiana(jd)\n {\n var year, month, day,\n\t adr, equinox, yday;\n\n jd = Math.floor(jd) + 0.5;\n adr = persiana_year(jd);\n year = adr[0];\n equinox = adr[1];\n day = Math.floor((jd - equinox) / 30) + 1;\n \n yday = (Math.floor(jd) - persiana_to_jd(year, 1, 1)) + 1;\n month = (yday <= 186) ? Math.ceil(yday / 31) : Math.ceil((yday - 6) / 30);\n day = (Math.floor(jd) - persiana_to_jd(year, month, 1)) + 1;\n\n return new Array(year, month, day);\n }", "ageEarthYears() {\n const birthdate = new Date(this.dob);\n let today = new Date();\n let calcAge = today - birthdate; \n let ageInYears = Math.floor(calcAge/(365.25 * 24 * 60 * 60 * 1000 )); // year * day * minutes per hour * seconds per minute * 1000 millisecs per sec // I am 30 years old\n\n return ageInYears;\n }", "function __Gregorian2JD(year, month, day)\n{\n\tyear = new Number(year);\n\tmonth = new Number(month);\n\tday = new Number(day);\n\n return (this.GREGORIAN_EPOCH - 1) +\n (365 * (year - 1)) +\n Math.floor((year - 1) / 4) +\n (-Math.floor((year - 1) / 100)) +\n Math.floor((year - 1) / 400) +\n Math.floor((((367 * month) - 362) / 12) +\n ((month <= 2) ? 0 :\n (this.LeapGregorian(year) ? -1 : -2)\n ) +\n day);\n}", "function from_CLDR(data) {\n\t// the usual time measurement units\n\tvar units = ['second', 'minute', 'hour', 'day', 'week', 'month', 'year'];\n\n\t// result\n\tvar converted = { long: {} };\n\n\t// detects the short flavour of labels (yr., mo., etc)\n\tvar short = /-short$/;\n\n\tvar locale = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_object_keys___default()(data.main)[0];\n\tdata = data.main[locale].dates.fields;\n\n\tvar _iteratorNormalCompletion5 = true;\n\tvar _didIteratorError5 = false;\n\tvar _iteratorError5 = undefined;\n\n\ttry {\n\t\tfor (var _iterator5 = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_get_iterator___default()(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_object_keys___default()(data)), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {\n\t\t\tvar key = _step5.value;\n\n\t\t\t// take only the usual time measurement units\n\t\t\tif (units.indexOf(key) < 0 && units.indexOf(key.replace(short, '')) < 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvar entry = data[key];\n\t\t\tvar converted_entry = {};\n\n\t\t\t// if a key ends with `-short`, then it's a \"short\" flavour\n\t\t\tif (short.test(key)) {\n\t\t\t\tif (!converted.short) {\n\t\t\t\t\tconverted.short = {};\n\t\t\t\t}\n\n\t\t\t\tconverted.short[key.replace(short, '')] = converted_entry;\n\t\t\t} else {\n\t\t\t\tconverted.long[key] = converted_entry;\n\t\t\t}\n\n\t\t\t// the \"relative\" values aren't suitable for \"ago\" or \"in a\" cases,\n\t\t\t// because \"1 year ago\" != \"last year\"\n\n\t\t\t// if (entry['relative-type--1'])\n\t\t\t// {\n\t\t\t// \tconverted_entry.previous = entry['relative-type--1']\n\t\t\t// }\n\n\t\t\t// if (entry['relative-type-0'])\n\t\t\t// {\n\t\t\t// \tconverted_entry.current = entry['relative-type-0']\n\t\t\t// }\n\n\t\t\t// if (entry['relative-type-1'])\n\t\t\t// {\n\t\t\t// \tconverted_entry.next = entry['relative-type-1']\n\t\t\t// }\n\n\t\t\tif (entry['relativeTime-type-past']) {\n\t\t\t\tvar past = entry['relativeTime-type-past'];\n\t\t\t\tconverted_entry.past = {};\n\n\t\t\t\tvar _iteratorNormalCompletion6 = true;\n\t\t\t\tvar _didIteratorError6 = false;\n\t\t\t\tvar _iteratorError6 = undefined;\n\n\t\t\t\ttry {\n\t\t\t\t\tfor (var _iterator6 = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_get_iterator___default()(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_object_keys___default()(past)), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {\n\t\t\t\t\t\tvar subkey = _step6.value;\n\n\t\t\t\t\t\tvar prefix = 'relativeTimePattern-count-';\n\t\t\t\t\t\tvar converted_subkey = subkey.replace(prefix, '');\n\n\t\t\t\t\t\tconverted_entry.past[converted_subkey] = past[subkey];\n\t\t\t\t\t}\n\t\t\t\t} catch (err) {\n\t\t\t\t\t_didIteratorError6 = true;\n\t\t\t\t\t_iteratorError6 = err;\n\t\t\t\t} finally {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (!_iteratorNormalCompletion6 && _iterator6.return) {\n\t\t\t\t\t\t\t_iterator6.return();\n\t\t\t\t\t\t}\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tif (_didIteratorError6) {\n\t\t\t\t\t\t\tthrow _iteratorError6;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (entry['relativeTime-type-future']) {\n\t\t\t\tvar future = entry['relativeTime-type-future'];\n\t\t\t\tconverted_entry.future = {};\n\n\t\t\t\tvar _iteratorNormalCompletion7 = true;\n\t\t\t\tvar _didIteratorError7 = false;\n\t\t\t\tvar _iteratorError7 = undefined;\n\n\t\t\t\ttry {\n\t\t\t\t\tfor (var _iterator7 = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_get_iterator___default()(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_object_keys___default()(future)), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) {\n\t\t\t\t\t\tvar _subkey = _step7.value;\n\n\t\t\t\t\t\tvar _prefix = 'relativeTimePattern-count-';\n\t\t\t\t\t\tvar _converted_subkey = _subkey.replace(_prefix, '');\n\n\t\t\t\t\t\tconverted_entry.future[_converted_subkey] = future[_subkey];\n\t\t\t\t\t}\n\t\t\t\t} catch (err) {\n\t\t\t\t\t_didIteratorError7 = true;\n\t\t\t\t\t_iteratorError7 = err;\n\t\t\t\t} finally {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (!_iteratorNormalCompletion7 && _iterator7.return) {\n\t\t\t\t\t\t\t_iterator7.return();\n\t\t\t\t\t\t}\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tif (_didIteratorError7) {\n\t\t\t\t\t\t\tthrow _iteratorError7;\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} catch (err) {\n\t\t_didIteratorError5 = true;\n\t\t_iteratorError5 = err;\n\t} finally {\n\t\ttry {\n\t\t\tif (!_iteratorNormalCompletion5 && _iterator5.return) {\n\t\t\t\t_iterator5.return();\n\t\t\t}\n\t\t} finally {\n\t\t\tif (_didIteratorError5) {\n\t\t\t\tthrow _iteratorError5;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn converted;\n}", "function dateToEarthAngle(d) {\n var periods = (d - epoch) / earthPeriodMSec;\n return periods - Math.floor(periods);\n}", "function get_current(arr) {\n //translate day\n var d = parseInt(arr[0]);\n if(isNaN(d)) {\n return false;\n }\n else {\n arr[0] = d;\n } \n \n //translate month\n var s = arr[1];\n while(s.substr(0,1)==\"0\") {\n s = s.substr(1); //trim leading zeros else \"parseInt\" thinks it's octal not decimal\n }\n var m = parseInt(s); \n if(isNaN(m)) {\n s = arr[1];\n if(s.length > 2) { //check length\n switch(s.substr(0,3).toUpperCase()) { //translate value\n case \"JAN\":\n arr[1] = 0;\n break;\n case \"FEB\":\n arr[1] = 1;\n break;\n case \"MAR\":\n arr[1] = 2;\n break;\n case \"APR\":\n arr[1] = 3;\n break;\n case \"MAY\":\n arr[1] = 4;\n break;\n case \"JUN\":\n arr[1] = 5;\n break;\n case \"JUL\":\n arr[1] = 6;\n break;\n case \"AUG\":\n arr[1] = 7;\n break;\n case \"SEP\":\n arr[1] = 8;\n break;\n case \"OCT\":\n arr[1] = 9;\n break;\n case \"NOV\":\n arr[1] = 10;\n break;\n case \"DEC\":\n arr[1] = 11;\n break;\n default:\n return false;\n }\n }\n }\n else {\n if(m>0 && m<13) {\n arr[1] = m-1;\n }\n else {\n return false;\n }\n } \n \n //translate year\n var y = parseInt(arr[2]);\n if(isNaN(y)) {\n return false;\n }\n else {\n arr[2] = y;\n } \n \n return true;\n}", "function calcJulianCalendar()\n {\n setJulian(julian_to_jd((new Number(document.juliancalendar.year.value)),\n\t\t\t document.juliancalendar.month.selectedIndex + 1,\n\t\t\t (new Number(document.juliancalendar.day.value))));\n }", "function compute(form) {\n var val1 = parseInt(form.day.value, 10)\n if ((val1 < 0) || (val1 > 31)) {\n alert(\"Day is out of range\")\n }\n var val2 = parseInt(form.month.value, 10)\n if ((val2 < 0) || (val2 > 12)) {\n alert(\"Month is out of range\")\n } \n var val2x = parseInt(form.month.value, 10)\n var val3 = parseInt(form.year.value, 10)\n if (val3 < 1900) {\n alert(\"You're that old!\")\n }\n if (val2 == 1) {\n val2x = 13;\n val3 = val3-1\n }\n if (val2 == 2) {\n val2x = 14;\n val3 = val3-1\n }\n var val4 = parseInt(((val2x+1)*3)/5, 10)\n var val5 = parseInt(val3/4, 10)\n var val6 = parseInt(val3/100, 10)\n var val7 = parseInt(val3/400, 10)\n var val8 = val1+(val2x*2)+val4+val3+val5-val6+val7+2\n var val9 = parseInt(val8/7, 10)\n var val0 = val8-(val9*7)\n form.result1.value = months[val2]+\" \"+form.day.value +\", \"+form.year.value\n form.result2.value = days[val0]\n \n }", "function getUTCMs(year, month = 1, day = 1, hour = 0, minute = 0, second = 0, millisecond = 0) {\n if (year > 99 || year < 0) {\n return Date.UTC(year, month - 1, day, hour, minute, second, millisecond);\n }\n const d = new Date(0);\n d.setUTCFullYear(year);\n d.setUTCMonth(month - 1);\n d.setUTCDate(day);\n d.setUTCHours(hour);\n d.setUTCMinutes(minute);\n d.setUTCSeconds(second, millisecond);\n return d.valueOf();\n}", "function ka(e,t,n){return e+\" \"+function(e,t){if(2===t)return function(e){var t={m:\"v\",b:\"v\",d:\"z\"};if(void 0===t[e.charAt(0)])return e;return t[e.charAt(0)]+e.substring(1)}(e);return e}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[n],e)}", "function tras_tsg_tmg(TSG_DEC){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy). dicembre 2009\n // TSG_DEC: Tempo siderale a Greenwich in ore decimali.\n // restituisce il valore numerico TMG in ore decimali.\n // calcolo effettuato per la data corrente.\n\n var data=new Date();\n var anno =data.getYear(); // anno.\n\n if (anno<1900) { anno=anno+1900; } // correzione anno per il browser.\n\n var valore_jda=calcola_jda(); // giorno giuliano 0.0 gennaio anno corrente.\n\n // calcolare il valore di B\n\n var S=valore_jda-2415020;\n var T=S/36525;\n var R=6.6460656+(2400.051262*T)+(0.00002581*T*T);\n var U=R-(24*(anno-1900));\n var B=24-U;\n\n B=ore_24(B); // riporta l'intervallo di B tra 0-24 ore.\n\n// valore di B\n\nvar valore_jd=calcola_jd(); // valore del giorno giuliano per la data corrente U.T. GREENWICH.\nvar num_day=Math.floor(valore_jd-valore_jda);\n\n\n var TO=(num_day*0.0657098)-B;\n\n TO= ore_24(TO); // intervallo 0-24 ore.\n\nvar TMG=TSG_DEC-TO; // valore del tempo medio a Greenwich\n\n TMG= ore_24(TMG); // intervallo 0-24 ore.\n\nTMG=TMG*0.997270;\n\nreturn TMG;\n}", "function jd_to_indian_civil(jd)\n {\n var Caitra, Saka, greg, greg0, leap, start, year, yday, mday;\n\n Saka = 79 - 1; // Offset in years from Saka era to Gregorian epoch\n start = 80; // Day offset between Saka and Gregorian\n\n jd = Math.floor(jd) + 0.5;\n greg = jd_to_gregorian(jd); // Gregorian date for Julian day\n leap = leap_gregorian(greg[0]); // Is this a leap year?\n year = greg[0] - Saka; // Tentative year in Saka era\n greg0 = gregorian_to_jd(greg[0], 1, 1); // JD at start of Gregorian year\n yday = jd - greg0; // Day number (0 based) in Gregorian year\n Caitra = leap ? 31 : 30; // Days in Caitra this year\n\n if (yday < start) {\n\t // Day is at the end of the preceding Saka year\n\t year--;\n\t yday += Caitra + (31 * 5) + (30 * 3) + 10 + start;\n }\n\n yday -= start;\n if (yday < Caitra) {\n\t month = 1;\n\t day = yday + 1;\n } else {\n\t mday = yday - Caitra;\n\t if (mday < (31 * 5)) {\n\t month = Math.floor(mday / 31) + 2;\n\t day = (mday % 31) + 1;\n\t } else {\n\t mday -= 31 * 5;\n\t month = Math.floor(mday / 30) + 7;\n\t day = (mday % 30) + 1;\n\t }\n }\n\n return new Array(year, month, day);\n }", "function file_yearmo(date) {\n var dateObj = new Date(date);\n var year = dateObj.getUTCFullYear();\n var month = (\"0\" + (dateObj.getUTCMonth() + 1)).slice(-2); //months from 1-12\n var yearmo = year + \"/\" + month;\n return yearmo;\n }", "function calcAge1(birthYear1) {\n return 2037 - birthYear1;\n}", "function convert(timePassport, timeWorkpermit, timeVisa) {\n\n // Unixtimestamp\n // get now date in seconds\n let now = Math.round(+new Date() / changeSeconds);\n\n // elapsed time in day\n let elapsedPassport = Math.ceil((timePassport - now) / secondsPerDay)\n let elapsedWorkpermit = Math.ceil((timeWorkpermit - now) / secondsPerDay)\n let elapsedVisa = Math.ceil((timeVisa - now) / secondsPerDay)\n // Months array\n let months_arr = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n\n // Convert timestamp to milliseconds\n let dateP = new Date(timePassport * changeSeconds);\n let dateW = new Date(timeWorkpermit * changeSeconds)\n let dateV = new Date(timeVisa * changeSeconds)\n // Year\n let yearP = dateP.getFullYear();\n let yearW = dateW.getFullYear();\n let yearV = dateV.getFullYear();\n\n // Month\n let monthP = months_arr[dateP.getMonth()];\n let monthW = months_arr[dateW.getMonth()];\n let monthV = months_arr[dateV.getMonth()];\n\n // Day\n let dayP = dateP.getDate();\n let dayW = dateW.getDate();\n let dayV = dateV.getDate();\n\n // Display date time in dd-MM-yyyy h:m:s format\n let convdataTimeP = dayP + ' ' + monthP + ' ' + yearP\n let convdataTimeW = dayW + ' ' + monthW + ' ' + yearW\n let convdataTimeV = dayV + ' ' + monthV + ' ' + yearV\n\n // Check status\n let { passportStatus, workpermitStatus, visaStatus } =\n checkStatus(elapsedPassport, elapsedWorkpermit, elapsedVisa)\n\n return {\n datePassport: convdataTimeP,\n remainingPassport: elapsedPassport,\n passportStatus: passportStatus,\n dateWorkpermit: convdataTimeW,\n remainingWorkpermit: elapsedWorkpermit,\n workpermitStatus: workpermitStatus,\n dateVisa: convdataTimeV,\n remainingVisa: elapsedVisa,\n visaStatus: visaStatus\n };\n}" ]
[ "0.63384634", "0.6263492", "0.624544", "0.60358506", "0.60230696", "0.59796584", "0.5967904", "0.59665346", "0.59378636", "0.5937252", "0.58944184", "0.5768215", "0.576375", "0.57607144", "0.57513475", "0.57389665", "0.5721542", "0.57164466", "0.568165", "0.5678887", "0.5662693", "0.56514454", "0.5641374", "0.5636896", "0.56232524", "0.56189245", "0.5601691", "0.55770195", "0.5573143", "0.5542493", "0.55344033", "0.5516417", "0.5507262", "0.5504668", "0.54828763", "0.5476809", "0.54747", "0.54727477", "0.5466479", "0.5464358", "0.54636985", "0.5461493", "0.54602104", "0.5454955", "0.5447381", "0.54468244", "0.5442513", "0.5437209", "0.54362905", "0.54307675", "0.54267913", "0.54055107", "0.54037195", "0.5392917", "0.5381806", "0.5380941", "0.5380914", "0.5375405", "0.53716075", "0.5363831", "0.5362041", "0.5359443", "0.5359092", "0.53499794", "0.5340662", "0.53406006", "0.5331492", "0.5328897", "0.53257227", "0.53232193", "0.5323186", "0.53222245", "0.5317521", "0.5312544", "0.5310926", "0.53107184", "0.53050464", "0.5297117", "0.52914107", "0.5283142", "0.5282598", "0.52698785", "0.5264918", "0.5262853", "0.52618897", "0.52601403", "0.5253961", "0.52522635", "0.5251013", "0.52509856", "0.5248492", "0.5248177", "0.5218118", "0.52165437", "0.5214265", "0.5211477", "0.5201914" ]
0.5324381
72
FullCalendarspecific DOM Utilities Given the scrollbar widths of some other container, create borders/margins on rowEls in order to match the left and right space that was offset by the scrollbars. A 1pixel border first, then margin beyond that.
function compensateScroll(rowEl, scrollbarWidths) { if (scrollbarWidths.left) { applyStyle(rowEl, { borderLeftWidth: 1, marginLeft: scrollbarWidths.left - 1 }); } if (scrollbarWidths.right) { applyStyle(rowEl, { borderRightWidth: 1, marginRight: scrollbarWidths.right - 1 }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compensateScroll(rowEls,scrollbarWidths){if(scrollbarWidths.left){rowEls.css({'border-left-width':1,'margin-left':scrollbarWidths.left-1});}if(scrollbarWidths.right){rowEls.css({'border-right-width':1,'margin-right':scrollbarWidths.right-1});}}", "function compensateScroll(rowEls, scrollbarWidths) {\n if (scrollbarWidths.left) {\n rowEls.css({\n 'border-left-width': 1,\n 'margin-left': scrollbarWidths.left - 1\n });\n }\n if (scrollbarWidths.right) {\n rowEls.css({\n 'border-right-width': 1,\n 'margin-right': scrollbarWidths.right - 1\n });\n }\n}", "function compensateScroll(rowEls, scrollbarWidths) {\n if (scrollbarWidths.left) {\n rowEls.css({\n 'border-left-width': 1,\n 'margin-left': scrollbarWidths.left - 1\n });\n }\n if (scrollbarWidths.right) {\n rowEls.css({\n 'border-right-width': 1,\n 'margin-right': scrollbarWidths.right - 1\n });\n }\n}", "function compensateScroll(rowEls, scrollbarWidths) {\n if (scrollbarWidths.left) {\n rowEls.css({\n 'border-left-width': 1,\n 'margin-left': scrollbarWidths.left - 1\n });\n }\n if (scrollbarWidths.right) {\n rowEls.css({\n 'border-right-width': 1,\n 'margin-right': scrollbarWidths.right - 1\n });\n }\n}", "function compensateScroll(rowEls, scrollbarWidths) {\n if (scrollbarWidths.left) {\n rowEls.css({\n 'border-left-width': 1,\n 'margin-left': scrollbarWidths.left - 1\n });\n }\n if (scrollbarWidths.right) {\n rowEls.css({\n 'border-right-width': 1,\n 'margin-right': scrollbarWidths.right - 1\n });\n }\n}", "function compensateScroll(rowEls, scrollbarWidths) {\n if (scrollbarWidths.left) {\n rowEls.css({\n 'border-left-width': 1,\n 'margin-left': scrollbarWidths.left - 1\n });\n }\n if (scrollbarWidths.right) {\n rowEls.css({\n 'border-right-width': 1,\n 'margin-right': scrollbarWidths.right - 1\n });\n }\n }", "function compensateScroll(rowEl, scrollbarWidths) {\n if (scrollbarWidths.left) {\n applyStyle(rowEl, {\n borderLeftWidth: 1,\n marginLeft: scrollbarWidths.left - 1\n });\n }\n\n if (scrollbarWidths.right) {\n applyStyle(rowEl, {\n borderRightWidth: 1,\n marginRight: scrollbarWidths.right - 1\n });\n }\n } // Undoes compensateScroll and restores all borders/margins", "function compensateScroll(rowEl, scrollbarWidths) {\n if (scrollbarWidths.left) {\n dom_manip_1.applyStyle(rowEl, {\n borderLeftWidth: 1,\n marginLeft: scrollbarWidths.left - 1\n });\n }\n\n if (scrollbarWidths.right) {\n dom_manip_1.applyStyle(rowEl, {\n borderRightWidth: 1,\n marginRight: scrollbarWidths.right - 1\n });\n }\n }", "function compensateScroll(rowEl, scrollbarWidths) {\n if (scrollbarWidths.left) {\n applyStyle(rowEl, {\n borderLeftWidth: 1,\n marginLeft: scrollbarWidths.left - 1\n });\n }\n if (scrollbarWidths.right) {\n applyStyle(rowEl, {\n borderRightWidth: 1,\n marginRight: scrollbarWidths.right - 1\n });\n }\n}", "function compensateScroll(rowEls, scrollbarWidths) {\n\tif (scrollbarWidths.left) {\n\t\trowEls.css({\n\t\t\t'border-left-width': 1,\n\t\t\t'margin-left': scrollbarWidths.left - 1\n\t\t});\n\t}\n\tif (scrollbarWidths.right) {\n\t\trowEls.css({\n\t\t\t'border-right-width': 1,\n\t\t\t'margin-right': scrollbarWidths.right - 1\n\t\t});\n\t}\n}", "function compensateScroll(rowEls, scrollbarWidths) {\n\tif (scrollbarWidths.left) {\n\t\trowEls.css({\n\t\t\t'border-left-width': 1,\n\t\t\t'margin-left': scrollbarWidths.left - 1\n\t\t});\n\t}\n\tif (scrollbarWidths.right) {\n\t\trowEls.css({\n\t\t\t'border-right-width': 1,\n\t\t\t'margin-right': scrollbarWidths.right - 1\n\t\t});\n\t}\n}", "function compensateScroll(rowEls, scrollbarWidths) {\n\tif (scrollbarWidths.left) {\n\t\trowEls.css({\n\t\t\t'border-left-width': 1,\n\t\t\t'margin-left': scrollbarWidths.left - 1\n\t\t});\n\t}\n\tif (scrollbarWidths.right) {\n\t\trowEls.css({\n\t\t\t'border-right-width': 1,\n\t\t\t'margin-right': scrollbarWidths.right - 1\n\t\t});\n\t}\n}", "function compensateScroll(rowEls, scrollbarWidths) {\n\tif (scrollbarWidths.left) {\n\t\trowEls.css({\n\t\t\t'border-left-width': 1,\n\t\t\t'margin-left': scrollbarWidths.left - 1\n\t\t});\n\t}\n\tif (scrollbarWidths.right) {\n\t\trowEls.css({\n\t\t\t'border-right-width': 1,\n\t\t\t'margin-right': scrollbarWidths.right - 1\n\t\t});\n\t}\n}", "function compensateScroll(rowEls, scrollbarWidths) {\n\tif (scrollbarWidths.left) {\n\t\trowEls.css({\n\t\t\t'border-left-width': 1,\n\t\t\t'margin-left': scrollbarWidths.left - 1\n\t\t});\n\t}\n\tif (scrollbarWidths.right) {\n\t\trowEls.css({\n\t\t\t'border-right-width': 1,\n\t\t\t'margin-right': scrollbarWidths.right - 1\n\t\t});\n\t}\n}", "function compensateScroll(rowEls, scrollbarWidths) {\n\tif (scrollbarWidths.left) {\n\t\trowEls.css({\n\t\t\t'border-left-width': 1,\n\t\t\t'margin-left': scrollbarWidths.left - 1\n\t\t});\n\t}\n\tif (scrollbarWidths.right) {\n\t\trowEls.css({\n\t\t\t'border-right-width': 1,\n\t\t\t'margin-right': scrollbarWidths.right - 1\n\t\t});\n\t}\n}", "function compensateScroll(rowEls, scrollbarWidths) {\n\tif (scrollbarWidths.left) {\n\t\trowEls.css({\n\t\t\t'border-left-width': 1,\n\t\t\t'margin-left': scrollbarWidths.left - 1\n\t\t});\n\t}\n\tif (scrollbarWidths.right) {\n\t\trowEls.css({\n\t\t\t'border-right-width': 1,\n\t\t\t'margin-right': scrollbarWidths.right - 1\n\t\t});\n\t}\n}", "function compensateScroll(rowEls, scrollbarWidths) {\n\tif (scrollbarWidths.left) {\n\t\trowEls.css({\n\t\t\t'border-left-width': 1,\n\t\t\t'margin-left': scrollbarWidths.left - 1\n\t\t});\n\t}\n\tif (scrollbarWidths.right) {\n\t\trowEls.css({\n\t\t\t'border-right-width': 1,\n\t\t\t'margin-right': scrollbarWidths.right - 1\n\t\t});\n\t}\n}", "function compensateScroll(rowEl, scrollbarWidths) {\n if (scrollbarWidths.left) {\n applyStyle$1(rowEl, {\n borderLeftWidth: 1,\n marginLeft: scrollbarWidths.left - 1\n });\n }\n if (scrollbarWidths.right) {\n applyStyle$1(rowEl, {\n borderRightWidth: 1,\n marginRight: scrollbarWidths.right - 1\n });\n }\n }", "function compensateScroll(rowEls, scrollbarWidths) {\n\t\tif (scrollbarWidths.left) {\n\t\t\trowEls.css({\n\t\t\t\t'border-left-width': 1,\n\t\t\t\t'margin-left': scrollbarWidths.left - 1\n\t\t\t});\n\t\t}\n\t\tif (scrollbarWidths.right) {\n\t\t\trowEls.css({\n\t\t\t\t'border-right-width': 1,\n\t\t\t\t'margin-right': scrollbarWidths.right - 1\n\t\t\t});\n\t\t}\n\t}", "function getClientRect(el,origin){var offset=el.offset();var scrollbarWidths=getScrollbarWidths(el);var left=offset.left+getCssFloat(el,'border-left-width')+scrollbarWidths.left-(origin?origin.left:0);var top=offset.top+getCssFloat(el,'border-top-width')+scrollbarWidths.top-(origin?origin.top:0);return{left:left,right:left+el[0].clientWidth,top:top,bottom:top+el[0].clientHeight// clientHeight includes padding but NOT scrollbars\n};}", "function uncompensateScroll(rowEls){rowEls.css({'margin-left':'','margin-right':'','border-left-width':'','border-right-width':''});}", "function getClientRect(el) {\n var offset = el.offset();\n var scrollbarWidths = getScrollbarWidths(el);\n var left = offset.left + getCssFloat(el, 'border-left-width') + scrollbarWidths.left;\n var top = offset.top + getCssFloat(el, 'border-top-width') + scrollbarWidths.top;\n\n return {\n left: left,\n right: left + el[0].clientWidth, // clientWidth includes padding but NOT scrollbars\n top: top,\n bottom: top + el[0].clientHeight // clientHeight includes padding but NOT scrollbars\n };\n }", "function getScrollbarWidths(el){var leftRightWidth=el[0].offsetWidth-el[0].clientWidth;var bottomWidth=el[0].offsetHeight-el[0].clientHeight;var widths;leftRightWidth=sanitizeScrollbarWidth(leftRightWidth);bottomWidth=sanitizeScrollbarWidth(bottomWidth);widths={left:0,right:0,top:0,bottom:bottomWidth};if(getIsLeftRtlScrollbars()&&el.css('direction')==='rtl'){// is the scrollbar on the left side?\nwidths.left=leftRightWidth;}else{widths.right=leftRightWidth;}return widths;}", "static getAdjustedRect(elem, style, includePadding) {\n //Apparently it only uses padding + boarder (not margin) in the computation for bounding client rect\n let rect = elem.getBoundingClientRect();\n if (includePadding) {\n return { top: rect.top + window.scrollY,\n bottom: rect.bottom + window.scrollY,\n left: rect.left + window.scrollX,\n right: rect.right + window.scrollX,\n width: rect.width,\n height: rect.height };\n }\n var borderLeft = parseInt(style.borderLeftWidth || \"\") || 0;\n var borderRight = parseInt(style.borderRightWidth || \"\") || 0;\n var borderTop = parseInt(style.borderTopWidth || \"\") || 0;\n var borderBottom = parseInt(style.borderBottomWidth || \"\") || 0;\n var paddingLeft = parseInt(style.paddingLeft || \"\") || 0;\n var paddingRight = parseInt(style.paddingRight || \"\") || 0;\n var paddingTop = parseInt(style.paddingTop || \"\") || 0;\n var paddingBottom = parseInt(style.paddingBottom || \"\") || 0;\n return { top: rect.top + window.scrollY + paddingTop + borderTop,\n bottom: rect.bottom + window.scrollY - paddingBottom - borderBottom,\n left: rect.left + window.scrollX + paddingLeft + borderLeft,\n right: rect.right + window.scrollX - paddingRight - borderRight,\n width: rect.width - paddingLeft - paddingRight - borderLeft - borderRight,\n height: rect.height - paddingTop - paddingBottom - borderTop - borderBottom };\n }", "_updateSizeRowsCols() {\n const that = this;\n\n that.$.container.removeAttribute('style');\n\n setTimeout(function () {\n if ((that.horizontalScrollBarVisibility === 'disabled' || that.horizontalScrollBarVisibility === 'hidden') && (that.verticalScrollBarVisibility === 'disabled' || that.verticalScrollBarVisibility === 'hidden')) {\n return;\n }\n\n const rectObject = that.getBoundingClientRect();\n\n that.$.container.style.width = rectObject.width + 'px';\n that.$.container.style.height = rectObject.height + 'px';\n }, 0);\n }", "findLineBoxRange(relaxWidowsAndOrphans) {\n let { widows, orphans } = this.containerRules;\n\n widows = widows || 2;\n orphans = orphans || 2;\n\n if (relaxWidowsAndOrphans) {\n widows = 1;\n orphans = 1;\n }\n\n let lineBoxes = [];\n let overflow = false;\n let overflowIndex;\n\n for (const lineBox of lineBoxGenerator(this.nodes)) {\n if (!overflow) {\n const rect = lineBox.getBoundingClientRect();\n if (rect.bottom > (this.rootRect.bottom - this.bottomSpace)) {\n overflow = lineBox;\n overflowIndex = lineBoxes.length;\n }\n }\n if (overflow && lineBoxes.length > overflowIndex + widows - 1) {\n break;\n }\n lineBoxes.push(lineBox);\n }\n\n if (overflowIndex !== undefined) {\n if (overflowIndex < orphans) {\n // Insufficient orphans\n return null;\n }\n\n lineBoxes = lineBoxes.slice(orphans);\n }\n\n return lineBoxes[lineBoxes.length - widows] || null;\n }", "function getScrollbarWidths(el) {\n var leftRightWidth = el.innerWidth() - el[0].clientWidth; // the paddings cancel out, leaving the scrollbars\n var widths = {\n left: 0,\n right: 0,\n top: 0,\n bottom: el.innerHeight() - el[0].clientHeight // the paddings cancel out, leaving the bottom scrollbar\n };\n\n if (getIsLeftRtlScrollbars() && el.css('direction') == 'rtl') { // is the scrollbar on the left side?\n widths.left = leftRightWidth;\n }\n else {\n widths.right = leftRightWidth;\n }\n\n return widths;\n }", "function getClientRect(el) {\n\tvar offset = el.offset();\n\tvar scrollbarWidths = getScrollbarWidths(el);\n\tvar left = offset.left + getCssFloat(el, 'border-left-width') + scrollbarWidths.left;\n\tvar top = offset.top + getCssFloat(el, 'border-top-width') + scrollbarWidths.top;\n\n\treturn {\n\t\tleft: left,\n\t\tright: left + el[0].clientWidth, // clientWidth includes padding but NOT scrollbars\n\t\ttop: top,\n\t\tbottom: top + el[0].clientHeight // clientHeight includes padding but NOT scrollbars\n\t};\n}", "shiftWidgetsForRtlTable(clientArea, tableWidget) {\n let clientAreaX = tableWidget.x;\n let clientAreaRight = clientArea.right;\n let cellSpace = 0;\n if (tableWidget.tableFormat && tableWidget.tableFormat.cellSpacing > 0) {\n cellSpace = tableWidget.tableFormat.cellSpacing;\n }\n for (let i = 0; i < tableWidget.childWidgets.length; i++) {\n let rowWidget = tableWidget.childWidgets[i];\n let rowX = rowWidget.x;\n let left = clientAreaRight - (rowX - clientAreaX);\n for (let j = 0; j < rowWidget.childWidgets.length; j++) {\n let cellWidget = rowWidget.childWidgets[j];\n left = left -\n (cellWidget.width + cellWidget.margin.left + cellWidget.margin.right - cellWidget.rightBorderWidth + cellSpace);\n cellWidget.updateWidgetLeft(left + cellWidget.margin.left);\n }\n }\n }", "function getScrollbarWidths(el) {\n\t\tvar leftRightWidth = el.innerWidth() - el[0].clientWidth; // the paddings cancel out, leaving the scrollbars\n\t\tvar widths = {\n\t\t\tleft: 0,\n\t\t\tright: 0,\n\t\t\ttop: 0,\n\t\t\tbottom: el.innerHeight() - el[0].clientHeight // the paddings cancel out, leaving the bottom scrollbar\n\t\t};\n\n\t\tif (getIsLeftRtlScrollbars() && el.css('direction') == 'rtl') { // is the scrollbar on the left side?\n\t\t\twidths.left = leftRightWidth;\n\t\t}\n\t\telse {\n\t\t\twidths.right = leftRightWidth;\n\t\t}\n\n\t\treturn widths;\n\t}", "function getScrollbarWidths(el) {\n\tvar leftRightWidth = el.innerWidth() - el[0].clientWidth; // the paddings cancel out, leaving the scrollbars\n\tvar widths = {\n\t\tleft: 0,\n\t\tright: 0,\n\t\ttop: 0,\n\t\tbottom: el.innerHeight() - el[0].clientHeight // the paddings cancel out, leaving the bottom scrollbar\n\t};\n\n\tif (getIsLeftRtlScrollbars() && el.css('direction') == 'rtl') { // is the scrollbar on the left side?\n\t\twidths.left = leftRightWidth;\n\t}\n\telse {\n\t\twidths.right = leftRightWidth;\n\t}\n\n\treturn widths;\n}", "function getScrollbarWidths(el) {\n\tvar leftRightWidth = el.innerWidth() - el[0].clientWidth; // the paddings cancel out, leaving the scrollbars\n\tvar widths = {\n\t\tleft: 0,\n\t\tright: 0,\n\t\ttop: 0,\n\t\tbottom: el.innerHeight() - el[0].clientHeight // the paddings cancel out, leaving the bottom scrollbar\n\t};\n\n\tif (getIsLeftRtlScrollbars() && el.css('direction') == 'rtl') { // is the scrollbar on the left side?\n\t\twidths.left = leftRightWidth;\n\t}\n\telse {\n\t\twidths.right = leftRightWidth;\n\t}\n\n\treturn widths;\n}", "function getScrollbarWidths(el) {\n\tvar leftRightWidth = el.innerWidth() - el[0].clientWidth; // the paddings cancel out, leaving the scrollbars\n\tvar widths = {\n\t\tleft: 0,\n\t\tright: 0,\n\t\ttop: 0,\n\t\tbottom: el.innerHeight() - el[0].clientHeight // the paddings cancel out, leaving the bottom scrollbar\n\t};\n\n\tif (getIsLeftRtlScrollbars() && el.css('direction') == 'rtl') { // is the scrollbar on the left side?\n\t\twidths.left = leftRightWidth;\n\t}\n\telse {\n\t\twidths.right = leftRightWidth;\n\t}\n\n\treturn widths;\n}", "function setOuterWidth() {\n outerWidth = wrap.offsetWidth;\n dragBarPos = calcDragBarPosFromCss() || Math.floor(outerWidth / 2) - 5;\n }", "function computeScrollbarWidthsForEl(el) {\n return {\n x: el.offsetHeight - el.clientHeight,\n y: el.offsetWidth - el.clientWidth,\n };\n }", "function getContentRect(el,origin){var offset=el.offset();// just outside of border, margin not included\nvar left=offset.left+getCssFloat(el,'border-left-width')+getCssFloat(el,'padding-left')-(origin?origin.left:0);var top=offset.top+getCssFloat(el,'border-top-width')+getCssFloat(el,'padding-top')-(origin?origin.top:0);return{left:left,right:left+el.width(),top:top,bottom:top+el.height()};}", "setScrollToEndMargin(id){\n\n let currentCommentId = this.state.currentCommentId;\n if(currentCommentId === undefined){ currentCommentId = id; }\n if(currentCommentId === undefined){ return; }\n\n let elem = document.getElementById(currentCommentId);\n let childRect = elem.getBoundingClientRect();\n let gridElem = elem.parentElement;\n\n //padding has already occurred\n //console.log('gridElem: ', gridElem, ' - ', gridElem.lastElementChild);\n if(Array.from(gridElem.children).some(item => item.className === 'commentBox--blank')){ return; }\n\n let multiplier = Math.floor(gridElem.clientWidth / childRect.width);\n let offset = gridElem.children.length;\n\n for(let i=0; i<multiplier; i++){\n\n let e = document.createElement(elem.tagName.toLowerCase());\n e.className = 'commentBox--blank';\n e.style.gridRow = elem.style.gridRow;\n e.style.gridColumn = offset + i + 1;\n\n gridElem.appendChild(e);\n }\n\n //console.log('margin calc: ', multiplier, ' : ', elem);\n }", "function getScrollbarWidths(el) {\n var leftRightWidth = el[0].offsetWidth - el[0].clientWidth;\n var bottomWidth = el[0].offsetHeight - el[0].clientHeight;\n var widths;\n leftRightWidth = sanitizeScrollbarWidth(leftRightWidth);\n bottomWidth = sanitizeScrollbarWidth(bottomWidth);\n widths = { left: 0, right: 0, top: 0, bottom: bottomWidth };\n if (getIsLeftRtlScrollbars() && el.css('direction') === 'rtl') { // is the scrollbar on the left side?\n widths.left = leftRightWidth;\n }\n else {\n widths.right = leftRightWidth;\n }\n return widths;\n}", "insertSplittedCellWidgets(viewer, tableCollection, rowWidget, previousRowIndex) {\n let left = rowWidget.x;\n let tableWidth = 0;\n tableWidth = HelperMethods.convertPointToPixel(rowWidget.ownerTable.tableHolder.tableWidth);\n for (let i = 0; i < rowWidget.childWidgets.length; i++) {\n let cellWidget = rowWidget.childWidgets[i];\n if (Math.round(left) < Math.round(cellWidget.x - cellWidget.margin.left)) {\n if (this.insertRowSpannedWidget(rowWidget, viewer, left, i)) {\n i--;\n continue;\n }\n let length = rowWidget.childWidgets.length;\n this.insertEmptySplittedCellWidget(rowWidget, tableCollection, left, i, previousRowIndex);\n if (length < rowWidget.childWidgets.length) {\n i--;\n continue;\n }\n }\n left += cellWidget.margin.left + cellWidget.width + cellWidget.margin.right;\n if (i === rowWidget.childWidgets.length - 1 && Math.round(left) < Math.round(rowWidget.x + tableWidth)) {\n if (this.insertRowSpannedWidget(rowWidget, viewer, left, i + 1)) {\n continue;\n }\n this.insertEmptySplittedCellWidget(rowWidget, tableCollection, left, i + 1, previousRowIndex);\n continue;\n }\n }\n // tslint:disable-next-line:max-line-length\n // Special case: when the child widgets of row is equal to 0 then the splitted widgets in the viewer is added in the table row widgets. \n if ((isNullOrUndefined(rowWidget.childWidgets) || rowWidget.childWidgets.length === 0) && viewer.splittedCellWidgets.length > 0) {\n for (let j = 0; j < viewer.splittedCellWidgets.length; j++) {\n let widget = viewer.splittedCellWidgets[j];\n if (Math.round(left) <= Math.round(widget.x - widget.margin.left)) {\n if (this.insertRowSpannedWidget(rowWidget, viewer, left, j)) {\n j--;\n continue;\n }\n let count = rowWidget.childWidgets.length;\n this.insertEmptySplittedCellWidget(rowWidget, tableCollection, left, j, previousRowIndex);\n if (count < rowWidget.childWidgets.length) {\n j--;\n continue;\n }\n }\n left += widget.margin.left + widget.width + widget.margin.right;\n if (j === rowWidget.childWidgets.length - 1 && Math.round(left) <\n Math.round(rowWidget.x + tableWidth)) {\n if (this.insertRowSpannedWidget(rowWidget, viewer, left, j + 1)) {\n continue;\n }\n this.insertEmptySplittedCellWidget(rowWidget, tableCollection, left, j + 1, previousRowIndex);\n continue;\n }\n }\n }\n if (viewer.splittedCellWidgets.length > 0) {\n viewer.splittedCellWidgets = [];\n }\n }", "function createScrollBarForAll(){\n if($('body').hasClass(RESPONSIVE)){\n removeResponsiveScrollOverflows();\n }\n else{\n forEachSectionAndSlide(createScrollBar);\n }\n }", "function getScrollbarWidths(el) {\n var leftRightWidth = el[0].offsetWidth - el[0].clientWidth;\n var bottomWidth = el[0].offsetHeight - el[0].clientHeight;\n var widths;\n leftRightWidth = sanitizeScrollbarWidth(leftRightWidth);\n bottomWidth = sanitizeScrollbarWidth(bottomWidth);\n widths = { left: 0, right: 0, top: 0, bottom: bottomWidth };\n if (getIsLeftRtlScrollbars() && el.css('direction') === 'rtl') {\n widths.left = leftRightWidth;\n }\n else {\n widths.right = leftRightWidth;\n }\n return widths;\n}", "function getScrollbarWidths(el) {\n var leftRightWidth = el[0].offsetWidth - el[0].clientWidth;\n var bottomWidth = el[0].offsetHeight - el[0].clientHeight;\n var widths;\n leftRightWidth = sanitizeScrollbarWidth(leftRightWidth);\n bottomWidth = sanitizeScrollbarWidth(bottomWidth);\n widths = { left: 0, right: 0, top: 0, bottom: bottomWidth };\n if (getIsLeftRtlScrollbars() && el.css('direction') === 'rtl') {\n widths.left = leftRightWidth;\n }\n else {\n widths.right = leftRightWidth;\n }\n return widths;\n}", "function getScrollbarWidths(el) {\n var leftRightWidth = el[0].offsetWidth - el[0].clientWidth;\n var bottomWidth = el[0].offsetHeight - el[0].clientHeight;\n var widths;\n leftRightWidth = sanitizeScrollbarWidth(leftRightWidth);\n bottomWidth = sanitizeScrollbarWidth(bottomWidth);\n widths = { left: 0, right: 0, top: 0, bottom: bottomWidth };\n if (getIsLeftRtlScrollbars() && el.css('direction') === 'rtl') {\n widths.left = leftRightWidth;\n }\n else {\n widths.right = leftRightWidth;\n }\n return widths;\n}", "function getClientRect(el, origin) {\n var offset = el.offset();\n var scrollbarWidths = getScrollbarWidths(el);\n var left = offset.left + getCssFloat(el, 'border-left-width') + scrollbarWidths.left - (origin ? origin.left : 0);\n var top = offset.top + getCssFloat(el, 'border-top-width') + scrollbarWidths.top - (origin ? origin.top : 0);\n return {\n left: left,\n right: left + el[0].clientWidth,\n top: top,\n bottom: top + el[0].clientHeight // clientHeight includes padding but NOT scrollbars\n };\n}", "function getClientRect(el, origin) {\n var offset = el.offset();\n var scrollbarWidths = getScrollbarWidths(el);\n var left = offset.left + getCssFloat(el, 'border-left-width') + scrollbarWidths.left - (origin ? origin.left : 0);\n var top = offset.top + getCssFloat(el, 'border-top-width') + scrollbarWidths.top - (origin ? origin.top : 0);\n return {\n left: left,\n right: left + el[0].clientWidth,\n top: top,\n bottom: top + el[0].clientHeight // clientHeight includes padding but NOT scrollbars\n };\n}", "function getClientRect(el, origin) {\n var offset = el.offset();\n var scrollbarWidths = getScrollbarWidths(el);\n var left = offset.left + getCssFloat(el, 'border-left-width') + scrollbarWidths.left - (origin ? origin.left : 0);\n var top = offset.top + getCssFloat(el, 'border-top-width') + scrollbarWidths.top - (origin ? origin.top : 0);\n return {\n left: left,\n right: left + el[0].clientWidth,\n top: top,\n bottom: top + el[0].clientHeight // clientHeight includes padding but NOT scrollbars\n };\n}", "function getClientRect(el, origin) {\n var offset = el.offset();\n var scrollbarWidths = getScrollbarWidths(el);\n var left = offset.left + getCssFloat(el, 'border-left-width') + scrollbarWidths.left - (origin ? origin.left : 0);\n var top = offset.top + getCssFloat(el, 'border-top-width') + scrollbarWidths.top - (origin ? origin.top : 0);\n return {\n left: left,\n right: left + el[0].clientWidth,\n top: top,\n bottom: top + el[0].clientHeight // clientHeight includes padding but NOT scrollbars\n };\n}", "function createScrollBarForAll() {\n if ($('body').hasClass(RESPONSIVE)) {\n removeResponsiveScrollOverflows();\n } else {\n forEachSectionAndSlide(createScrollBar);\n }\n }", "function sanitizeScrollbarWidth(width){width=Math.max(0,width);// no negatives\nwidth=Math.round(width);return width;}// Logic for determining if, when the element is right-to-left, the scrollbar appears on the left side", "addTableCellWidget(cell, area, maxCellMarginTop, maxCellMarginBottom) {\n //let tableCellWidget: TableCellWidget = new TableCellWidget(cell);\n let prevColumnIndex = 0;\n let cellspace = 0;\n let left = 0;\n let top = maxCellMarginTop;\n let right = 0;\n let bottom = maxCellMarginBottom;\n if (!isNullOrUndefined(cell.cellFormat)) {\n if (cell.cellFormat.containsMargins()) {\n // tslint:disable-next-line:max-line-length\n left = isNullOrUndefined(cell.cellFormat.leftMargin) ? HelperMethods.convertPointToPixel(cell.ownerTable.tableFormat.leftMargin) : HelperMethods.convertPointToPixel(cell.cellFormat.leftMargin);\n right = isNullOrUndefined(cell.cellFormat.rightMargin) ? HelperMethods.convertPointToPixel(cell.ownerTable.tableFormat.rightMargin) : HelperMethods.convertPointToPixel(cell.cellFormat.rightMargin);\n }\n else {\n if (cell.columnIndex === 0 && cell.ownerRow.rowFormat.hasValue('leftMargin')) {\n left = HelperMethods.convertPointToPixel(cell.ownerRow.rowFormat.leftMargin);\n }\n else {\n left = HelperMethods.convertPointToPixel(cell.ownerTable.tableFormat.leftMargin);\n }\n if (cell.columnIndex === cell.ownerTable.tableHolder.columns.length - 1 &&\n cell.ownerRow.rowFormat.hasValue('rightMargin')) {\n right = HelperMethods.convertPointToPixel(cell.ownerRow.rowFormat.rightMargin);\n }\n else {\n right = HelperMethods.convertPointToPixel(cell.ownerTable.tableFormat.rightMargin);\n }\n }\n }\n cell.margin = new Margin(left, top, right, bottom);\n cell.width = HelperMethods.convertPointToPixel(cell.cellFormat.cellWidth);\n if (!isNullOrUndefined(cell.previousWidget)) {\n // tslint:disable-next-line:max-line-length\n prevColumnIndex = cell.previousWidget.columnIndex + cell.previousWidget.cellFormat.columnSpan;\n }\n // tslint:disable-next-line:max-line-length\n cellspace = !isNullOrUndefined(cell.ownerTable) && !isNullOrUndefined(cell.ownerTable.tableFormat) ? HelperMethods.convertPointToPixel(cell.ownerTable.tableFormat.cellSpacing) : 0;\n let prevSpannedCellWidth = 0;\n if (prevColumnIndex < cell.columnIndex) {\n // tslint:disable-next-line:max-line-length\n prevSpannedCellWidth = HelperMethods.convertPointToPixel(cell.ownerTable.tableHolder.getPreviousSpannedCellWidth(prevColumnIndex, cell.columnIndex));\n if (prevColumnIndex === 0) {\n prevSpannedCellWidth = prevSpannedCellWidth - cellspace / 2;\n }\n }\n cell.x = area.x + prevSpannedCellWidth + cell.margin.left;\n cell.y = area.y + cell.margin.top + cellspace;\n cell.width = cell.width - cell.margin.left - cell.margin.right;\n if (cellspace > 0) {\n cell.x += cellspace;\n if (cell.ownerTable.tableHolder.columns.length === 1) {\n cell.width -= cellspace * 2;\n }\n else if (cell.columnIndex === 0 || cell.columnIndex === cell.ownerTable.tableHolder.columns.length - 1) {\n cell.width -= ((cellspace * 2) - cellspace / 2);\n }\n else {\n cell.width -= cellspace;\n }\n }\n let leftBorderWidth = HelperMethods.convertPointToPixel(TableCellWidget.getCellLeftBorder(cell).getLineWidth());\n let rightBorderWidth = HelperMethods.convertPointToPixel(TableCellWidget.getCellRightBorder(cell).getLineWidth());\n // update the margins values respect to layouting of borders.\n // for normal table cells only left border is rendred. for last cell left and right border is rendred.\n // this border widths are not included in margins.\n cell.leftBorderWidth = !cell.ownerTable.isBidiTable ? leftBorderWidth : rightBorderWidth;\n let isLeftStyleNone = (cell.cellFormat.borders.left.lineStyle === 'None');\n let isRightStyleNone = (cell.cellFormat.borders.right.lineStyle === 'None');\n cell.x += (!isLeftStyleNone) ? 0 : (cell.leftBorderWidth > 0) ? 0 : cell.leftBorderWidth;\n cell.width -= (!isLeftStyleNone) ? 0 : (cell.leftBorderWidth > 0) ? 0 : cell.leftBorderWidth;\n let lastCell = !cell.ownerTable.isBidiTable ? cell.cellIndex === cell.ownerRow.childWidgets.length - 1\n : cell.cellIndex === 0;\n if (cellspace > 0 || cell.cellIndex === cell.ownerRow.childWidgets.length - 1) {\n cell.rightBorderWidth = !cell.ownerTable.isBidiTable ? rightBorderWidth : leftBorderWidth;\n if (!cell.ownerTable.tableFormat.allowAutoFit) {\n cell.width -= cell.rightBorderWidth;\n }\n }\n //Add the border widths to respective margin side.\n cell.margin.left += (isLeftStyleNone) ? 0 : (cell.leftBorderWidth);\n cell.margin.right += (isRightStyleNone) ? 0 : (cell.rightBorderWidth);\n //cell.ownerWidget = owner;\n return cell;\n }", "function getScrollbarWidths(el) {\n\tvar leftRightWidth = el[0].offsetWidth - el[0].clientWidth;\n\tvar bottomWidth = el[0].offsetHeight - el[0].clientHeight;\n\tvar widths;\n\n\tleftRightWidth = sanitizeScrollbarWidth(leftRightWidth);\n\tbottomWidth = sanitizeScrollbarWidth(bottomWidth);\n\n\twidths = { left: 0, right: 0, top: 0, bottom: bottomWidth };\n\n\tif (getIsLeftRtlScrollbars() && el.css('direction') == 'rtl') { // is the scrollbar on the left side?\n\t\twidths.left = leftRightWidth;\n\t}\n\telse {\n\t\twidths.right = leftRightWidth;\n\t}\n\n\treturn widths;\n}", "function getScrollbarWidths(el) {\n\tvar leftRightWidth = el[0].offsetWidth - el[0].clientWidth;\n\tvar bottomWidth = el[0].offsetHeight - el[0].clientHeight;\n\tvar widths;\n\n\tleftRightWidth = sanitizeScrollbarWidth(leftRightWidth);\n\tbottomWidth = sanitizeScrollbarWidth(bottomWidth);\n\n\twidths = { left: 0, right: 0, top: 0, bottom: bottomWidth };\n\n\tif (getIsLeftRtlScrollbars() && el.css('direction') == 'rtl') { // is the scrollbar on the left side?\n\t\twidths.left = leftRightWidth;\n\t}\n\telse {\n\t\twidths.right = leftRightWidth;\n\t}\n\n\treturn widths;\n}", "function getScrollbarWidths(el) {\n\tvar leftRightWidth = el[0].offsetWidth - el[0].clientWidth;\n\tvar bottomWidth = el[0].offsetHeight - el[0].clientHeight;\n\tvar widths;\n\n\tleftRightWidth = sanitizeScrollbarWidth(leftRightWidth);\n\tbottomWidth = sanitizeScrollbarWidth(bottomWidth);\n\n\twidths = { left: 0, right: 0, top: 0, bottom: bottomWidth };\n\n\tif (getIsLeftRtlScrollbars() && el.css('direction') == 'rtl') { // is the scrollbar on the left side?\n\t\twidths.left = leftRightWidth;\n\t}\n\telse {\n\t\twidths.right = leftRightWidth;\n\t}\n\n\treturn widths;\n}", "function getScrollbarWidths(el) {\n\tvar leftRightWidth = el[0].offsetWidth - el[0].clientWidth;\n\tvar bottomWidth = el[0].offsetHeight - el[0].clientHeight;\n\tvar widths;\n\n\tleftRightWidth = sanitizeScrollbarWidth(leftRightWidth);\n\tbottomWidth = sanitizeScrollbarWidth(bottomWidth);\n\n\twidths = { left: 0, right: 0, top: 0, bottom: bottomWidth };\n\n\tif (getIsLeftRtlScrollbars() && el.css('direction') == 'rtl') { // is the scrollbar on the left side?\n\t\twidths.left = leftRightWidth;\n\t}\n\telse {\n\t\twidths.right = leftRightWidth;\n\t}\n\n\treturn widths;\n}", "function getScrollbarWidths(el) {\n\tvar leftRightWidth = el[0].offsetWidth - el[0].clientWidth;\n\tvar bottomWidth = el[0].offsetHeight - el[0].clientHeight;\n\tvar widths;\n\n\tleftRightWidth = sanitizeScrollbarWidth(leftRightWidth);\n\tbottomWidth = sanitizeScrollbarWidth(bottomWidth);\n\n\twidths = { left: 0, right: 0, top: 0, bottom: bottomWidth };\n\n\tif (getIsLeftRtlScrollbars() && el.css('direction') == 'rtl') { // is the scrollbar on the left side?\n\t\twidths.left = leftRightWidth;\n\t}\n\telse {\n\t\twidths.right = leftRightWidth;\n\t}\n\n\treturn widths;\n}", "function getContentRect(el) {\n var offset = el.offset(); // just outside of border, margin not included\n var left = offset.left + getCssFloat(el, 'border-left-width') + getCssFloat(el, 'padding-left');\n var top = offset.top + getCssFloat(el, 'border-top-width') + getCssFloat(el, 'padding-top');\n\n return {\n left: left,\n right: left + el.width(),\n top: top,\n bottom: top + el.height()\n };\n }", "function adjustContainerWidth() {\r\n\tvar width = (elmWidth + 2) * elements.length;\r\n\t$('#thecontainer').attr('style', 'width: ' + width + 'px;' );\r\n}", "function testScrollbarWidth() {\n var width = goog.style.getScrollbarWidth();\n assertTrue(width > 0);\n\n var outer = goog.dom.getElement('test-scrollbarwidth');\n var inner = goog.dom.getElementsByTagNameAndClass(\n goog.dom.TagName.DIV, null, outer)[0];\n assertTrue('should have a scroll bar', hasVerticalScroll(outer));\n assertTrue('should have a scroll bar', hasHorizontalScroll(outer));\n\n // Get the inner div absolute width\n goog.style.setStyle(outer, 'width', '100%');\n assertTrue('should have a scroll bar', hasVerticalScroll(outer));\n assertFalse('should not have a scroll bar', hasHorizontalScroll(outer));\n var innerAbsoluteWidth = inner.offsetWidth;\n\n // Leave the vertical scroll and remove the horizontal by using the scroll\n // bar width calculation.\n goog.style.setStyle(outer, 'width', (innerAbsoluteWidth + width) + 'px');\n assertTrue('should have a scroll bar', hasVerticalScroll(outer));\n assertFalse('should not have a scroll bar', hasHorizontalScroll(outer));\n\n // verify by adding 1 more pixel (brings back the vertical scroll bar).\n goog.style.setStyle(outer, 'width', (innerAbsoluteWidth + width - 1) + 'px');\n assertTrue('should have a scroll bar', hasVerticalScroll(outer));\n assertTrue('should have a scroll bar', hasHorizontalScroll(outer));\n}", "function adjustPagesForScrollBar() {\n var scrollBarWidth = 0;\n $.each($(\".page\"), function () {\n var $page = $(this);\n if ($page.css(\"display\") != \"none\") {\n var $pageRowScrollContainer = $page.children(\".pageRowScrollContainer\");\n if ($pageRowScrollContainer.outerWidth(true) > $pageRowScrollContainer.children(\".pageRow\").outerWidth(true)) {\n scrollBarWidth = $pageRowScrollContainer.outerWidth(true) - $pageRowScrollContainer.children(\".pageRow\").outerWidth(true);\n $page.children(\".pageTitles\").css(\"padding-right\", scrollBarWidth + \"px\");\n } else {\n $page.children(\".pageTitles\").css(\"padding-right\", \"\");\n }\n }\n });\n\n var $comparePage = $(\".comparePage\");\n if ($comparePage.css(\"display\") != \"none\") {\n var $compareRowsContainer = $comparePage.children(\".compareRows\");\n if ($compareRowsContainer.outerWidth(true) > $compareRowsContainer.children(\".pageRow\").outerWidth(true)) {\n scrollBarWidth = $compareRowsContainer.outerWidth(true) - $compareRowsContainer.children(\".pageRow\").outerWidth(true);\n $comparePage.children(\".comparePageTitles\").css(\"padding-right\", scrollBarWidth + \"px\");\n } else {\n $comparePage.children(\".comparePageTitles\").css(\"padding-right\", \"\");\n }\n }\n }", "function getClientRect(el, origin) {\n\t\tvar offset = el.offset();\n\t\tvar scrollbarWidths = getScrollbarWidths(el);\n\t\tvar left = offset.left + getCssFloat(el, 'border-left-width') + scrollbarWidths.left - (origin ? origin.left : 0);\n\t\tvar top = offset.top + getCssFloat(el, 'border-top-width') + scrollbarWidths.top - (origin ? origin.top : 0);\n\n\t\treturn {\n\t\t\tleft: left,\n\t\t\tright: left + el[0].clientWidth, // clientWidth includes padding but NOT scrollbars\n\t\t\ttop: top,\n\t\t\tbottom: top + el[0].clientHeight // clientHeight includes padding but NOT scrollbars\n\t\t};\n\t}", "function wa(e){for(var t=e.display,a={},n={},r=t.gutters.clientLeft,f=t.gutters.firstChild,o=0;f;f=f.nextSibling,++o)a[e.options.gutters[o]]=f.offsetLeft+f.clientLeft+r,n[e.options.gutters[o]]=f.clientWidth;return{fixedPos:xa(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:a,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}", "function alterBorder() {\r\n var scrollTable = query(queryText)[0];\r\n if (scrollTable.offsetHeight >= visibleAreaHeight) { //scrollbar visible & active\r\n //dont want a border on final row, if an odd row\r\n var lastRow = query(\".odd-last-row\", scrollTable)[0];\r\n if (typeof lastRow != \"undefined\") {\r\n domClass.add(lastRow, \"no-bottom-border\");\r\n }\r\n }\r\n else if (scrollTable.offsetHeight < visibleAreaHeight) { //scrollbar visible & inactive\r\n //we want a border on final row, if an even row\r\n var lastRow = query(\".even-last-row\", scrollTable)[0];\r\n if (typeof lastRow != \"undefined\") {\r\n domClass.add(lastRow, \"add-bottom-border\");\r\n }\r\n }\r\n else {\r\n curam.debug.log(\"curam.util.alterScrollableListBottomBorder: \" \r\n + bundle.getProperty(\"curam.util.code\"));\r\n }\r\n }", "function setLeft(depth) {\n var leftWidth = (depth * 100) + 70 + 30; // 주파수, 그래프\n\n $(\"#tableTopLeft\").css(\"width\",leftWidth);\n $(\"#tableTopLeftAfter\").css(\"width\",leftWidth);\n $(\"#tableMiddleLeft\").css(\"width\",leftWidth);\n $(\"#tableMiddleLeftAfter\").css(\"width\",leftWidth);\n $(\"#tableBottomLeft\").css(\"width\",leftWidth);\n\n $(\"#tableTopLeft\").unwrap();\n $(\"#tableTopLeft\").wrap(\"<div name='divTopLeft' id='divTopLeft'></div>\");\n $(\"#tableTopLeftAfter\").unwrap();\n $(\"#tableTopLeftAfter\").wrap(\"<div name='divTopLeft' id='divTopLeftAfter'></div>\");\n $(\"#tableBottomLeft\").unwrap();\n $(\"#tableBottomLeft\").wrap(\"<div name='divBottomLeft' id='divBottomLeft'></div>\");\n\n var middleWidth = 790 + 100 * (3-depth); //620 : css에서 div[name=divTopRight] width 값, 100 : title 그룹의 width 값\n //hide 된 td의 padding & margin 분 추가\n if(depth === 1) {\n middleWidth += 20;\n } else if (depth === 2) {\n middleWidth += 10;\n }\n $(\"#tableTopRight\").unwrap();\n $(\"#tableTopRight\").wrap(\"<div name='divTopRight' id='divTopRight' style='width:\"+middleWidth+\"px;'></div>\");\n $(\"#tableTopRightAfter\").unwrap();\n $(\"#tableTopRightAfter\").wrap(\"<div name='divTopRight' id='divTopRightAfter' style='width:\"+middleWidth+\"px;'></div>\");\n $(\"#tableMiddleRight\").unwrap();\n $(\"#tableMiddleRight\").wrap(\"<div name='divMiddleRight' id='divMiddleRight' onscroll='javascript:scrollY();' style='width:\"+(middleWidth+16)+\"px;'></div>\"); //16 : scroll width 값\n $(\"#tableMiddleRightAfter\").unwrap();\n $(\"#tableMiddleRightAfter\").wrap(\"<div name='divMiddleRight' id='divMiddleRightAfter' onscroll='javascript:scrollYAfter();' style='width:\"+(middleWidth+16)+\"px;'></div>\"); //16 : scroll width 값\n $(\"#tableBottomRight\").unwrap();\n $(\"#tableBottomRight\").wrap(\"<div name='divBottomRight' id='divBottomRight' onscroll='javascript:scrollX();' style='width:\"+middleWidth+\"px;'></div>\");\n\n $(\"#tableMiddleLeft tbody\").empty();\n $(\"#tableMiddleLeftAfter tbody\").empty();\n $(\"#tableMiddleRight tbody\").empty();\n $(\"#tableMiddleRightAfter tbody\").empty();\n //$(\"#tableBottomRight\").find(\"td\").html(\"&nbsp;\");\n\n}", "function getClientRect(el, origin) {\n\tvar offset = el.offset();\n\tvar scrollbarWidths = getScrollbarWidths(el);\n\tvar left = offset.left + getCssFloat(el, 'border-left-width') + scrollbarWidths.left - (origin ? origin.left : 0);\n\tvar top = offset.top + getCssFloat(el, 'border-top-width') + scrollbarWidths.top - (origin ? origin.top : 0);\n\n\treturn {\n\t\tleft: left,\n\t\tright: left + el[0].clientWidth, // clientWidth includes padding but NOT scrollbars\n\t\ttop: top,\n\t\tbottom: top + el[0].clientHeight // clientHeight includes padding but NOT scrollbars\n\t};\n}", "function getClientRect(el, origin) {\n\tvar offset = el.offset();\n\tvar scrollbarWidths = getScrollbarWidths(el);\n\tvar left = offset.left + getCssFloat(el, 'border-left-width') + scrollbarWidths.left - (origin ? origin.left : 0);\n\tvar top = offset.top + getCssFloat(el, 'border-top-width') + scrollbarWidths.top - (origin ? origin.top : 0);\n\n\treturn {\n\t\tleft: left,\n\t\tright: left + el[0].clientWidth, // clientWidth includes padding but NOT scrollbars\n\t\ttop: top,\n\t\tbottom: top + el[0].clientHeight // clientHeight includes padding but NOT scrollbars\n\t};\n}", "function getClientRect(el, origin) {\n\tvar offset = el.offset();\n\tvar scrollbarWidths = getScrollbarWidths(el);\n\tvar left = offset.left + getCssFloat(el, 'border-left-width') + scrollbarWidths.left - (origin ? origin.left : 0);\n\tvar top = offset.top + getCssFloat(el, 'border-top-width') + scrollbarWidths.top - (origin ? origin.top : 0);\n\n\treturn {\n\t\tleft: left,\n\t\tright: left + el[0].clientWidth, // clientWidth includes padding but NOT scrollbars\n\t\ttop: top,\n\t\tbottom: top + el[0].clientHeight // clientHeight includes padding but NOT scrollbars\n\t};\n}", "function getClientRect(el, origin) {\n\tvar offset = el.offset();\n\tvar scrollbarWidths = getScrollbarWidths(el);\n\tvar left = offset.left + getCssFloat(el, 'border-left-width') + scrollbarWidths.left - (origin ? origin.left : 0);\n\tvar top = offset.top + getCssFloat(el, 'border-top-width') + scrollbarWidths.top - (origin ? origin.top : 0);\n\n\treturn {\n\t\tleft: left,\n\t\tright: left + el[0].clientWidth, // clientWidth includes padding but NOT scrollbars\n\t\ttop: top,\n\t\tbottom: top + el[0].clientHeight // clientHeight includes padding but NOT scrollbars\n\t};\n}", "function getClientRect(el, origin) {\n\tvar offset = el.offset();\n\tvar scrollbarWidths = getScrollbarWidths(el);\n\tvar left = offset.left + getCssFloat(el, 'border-left-width') + scrollbarWidths.left - (origin ? origin.left : 0);\n\tvar top = offset.top + getCssFloat(el, 'border-top-width') + scrollbarWidths.top - (origin ? origin.top : 0);\n\n\treturn {\n\t\tleft: left,\n\t\tright: left + el[0].clientWidth, // clientWidth includes padding but NOT scrollbars\n\t\ttop: top,\n\t\tbottom: top + el[0].clientHeight // clientHeight includes padding but NOT scrollbars\n\t};\n}", "function getClientRect(el, origin) {\n\tvar offset = el.offset();\n\tvar scrollbarWidths = getScrollbarWidths(el);\n\tvar left = offset.left + getCssFloat(el, 'border-left-width') + scrollbarWidths.left - (origin ? origin.left : 0);\n\tvar top = offset.top + getCssFloat(el, 'border-top-width') + scrollbarWidths.top - (origin ? origin.top : 0);\n\n\treturn {\n\t\tleft: left,\n\t\tright: left + el[0].clientWidth, // clientWidth includes padding but NOT scrollbars\n\t\ttop: top,\n\t\tbottom: top + el[0].clientHeight // clientHeight includes padding but NOT scrollbars\n\t};\n}", "function getClientRect(el, origin) {\n\tvar offset = el.offset();\n\tvar scrollbarWidths = getScrollbarWidths(el);\n\tvar left = offset.left + getCssFloat(el, 'border-left-width') + scrollbarWidths.left - (origin ? origin.left : 0);\n\tvar top = offset.top + getCssFloat(el, 'border-top-width') + scrollbarWidths.top - (origin ? origin.top : 0);\n\n\treturn {\n\t\tleft: left,\n\t\tright: left + el[0].clientWidth, // clientWidth includes padding but NOT scrollbars\n\t\ttop: top,\n\t\tbottom: top + el[0].clientHeight // clientHeight includes padding but NOT scrollbars\n\t};\n}", "function layoutStyles(gd) {\n\t return Lib.syncOrAsync([Plots.doAutoMargin, lsInner], gd);\n\t}", "function addBodyScrollbarOffset() {\n $('html').css('margin-right', window.innerWidth - document.documentElement.clientWidth);\n}", "function createNodeScrollBar() {\r\n\tfor (let i = 0; i < nodesPayload.length; i++) {\r\n\t\tcreateNodeElement(nodesPayload[i]);\r\n\t}\r\n}", "static borderLayout(horizontal, gap, percentages = {\n top: 0.2,\n left: 0.2,\n right: 0.2,\n bottom: 0.2,\n }, padding = LayoutUtils.noPadding) {\n function BorderLayout(elems, w, h, parent) {\n w -= padding.left + padding.right;\n h -= padding.top + padding.bottom;\n let x = padding.top;\n let y = padding.left;\n let wc = w;\n let hc = h;\n const pos = new Map();\n pos.set('top', []);\n pos.set('center', []);\n pos.set('left', []);\n pos.set('right', []);\n pos.set('bottom', []);\n elems.forEach((elem) => {\n let border = elem.layoutOption('border', 'center');\n if (!pos.has(border)) {\n border = 'center'; // invalid one\n }\n pos.get(border).push(elem);\n });\n const promises = [];\n if (pos.get('top').length > 0) {\n y += h * percentages.top;\n hc -= h * percentages.top;\n promises.push(LayoutUtils.flowLayout(true, gap)(pos.get('top'), w, h * percentages.top, parent));\n }\n if (pos.get('bottom').length > 0) {\n hc -= h * percentages.bottom;\n promises.push(LayoutUtils.flowLayout(true, gap)(pos.get('bottom'), w, h * percentages.bottom, parent));\n }\n if (pos.get('left').length > 0) {\n x += w * percentages.left;\n wc -= w * percentages.left;\n promises.push(LayoutUtils.flowLayout(false, gap)(pos.get('left'), w * percentages.left, hc, parent));\n }\n if (pos.get('right').length > 0) {\n wc -= w * percentages.right;\n promises.push(LayoutUtils.flowLayout(false, gap)(pos.get('right'), w * percentages.right, hc, parent));\n }\n if (pos.get('center').length > 0) {\n promises.push(LayoutUtils.flowLayout(true, gap)(pos.get('center'), wc, hc, parent));\n }\n return LayoutUtils.waitFor(promises);\n }\n return BorderLayout;\n }", "get getBoundingClientRects() {\n if (!this._boundingClientRects) {\n const innerBox = this._innerBoxHelper.nativeElement.getBoundingClientRect();\n const clientRect = this.element.getBoundingClientRect();\n this._boundingClientRects = {\n clientRect,\n innerWidth: innerBox.width,\n innerHeight: innerBox.height,\n scrollBarWidth: clientRect.width - innerBox.width,\n scrollBarHeight: clientRect.height - innerBox.height,\n };\n const resetCurrentBox = () => this._boundingClientRects = undefined;\n if (this._isScrolling) {\n this.scrolling.pipe(filter(scrolling => scrolling === 0), take(1)).subscribe(resetCurrentBox);\n }\n else {\n requestAnimationFrame(resetCurrentBox);\n }\n }\n return this._boundingClientRects;\n }", "static borderLayout(horizontal, gap, percentages = {\n top: 0.2,\n left: 0.2,\n right: 0.2,\n bottom: 0.2\n }, padding = LayoutUtils.noPadding) {\n function BorderLayout(elems, w, h, parent) {\n w -= padding.left + padding.right;\n h -= padding.top + padding.bottom;\n let x = padding.top, y = padding.left, wc = w, hc = h;\n const pos = new Map();\n pos.set('top', []);\n pos.set('center', []);\n pos.set('left', []);\n pos.set('right', []);\n pos.set('bottom', []);\n elems.forEach((elem) => {\n let border = elem.layoutOption('border', 'center');\n if (!pos.has(border)) {\n border = 'center'; //invalid one\n }\n pos.get(border).push(elem);\n });\n const promises = [];\n if (pos.get('top').length > 0) {\n y += h * percentages.top;\n hc -= h * percentages.top;\n promises.push(LayoutUtils.flowLayout(true, gap)(pos.get('top'), w, h * percentages.top, parent));\n }\n if (pos.get('bottom').length > 0) {\n hc -= h * percentages.bottom;\n promises.push(LayoutUtils.flowLayout(true, gap)(pos.get('bottom'), w, h * percentages.bottom, parent));\n }\n if (pos.get('left').length > 0) {\n x += w * percentages.left;\n wc -= w * percentages.left;\n promises.push(LayoutUtils.flowLayout(false, gap)(pos.get('left'), w * percentages.left, hc, parent));\n }\n if (pos.get('right').length > 0) {\n wc -= w * percentages.right;\n promises.push(LayoutUtils.flowLayout(false, gap)(pos.get('right'), w * percentages.right, hc, parent));\n }\n if (pos.get('center').length > 0) {\n promises.push(LayoutUtils.flowLayout(true, gap)(pos.get('center'), wc, hc, parent));\n }\n return LayoutUtils.waitFor(promises);\n }\n return BorderLayout;\n }", "function setBoxWidths() {\n var leftWidth = dragBarPos - 2,\n rightWidth = outerWidth - dragBarPos - 12;\n\n left.css('width', '' + toPercent(leftWidth) + '%');\n right.css('width', '' + toPercent(rightWidth) + '%');\n }", "function snapTabLayout(tabs) {\n var layout = new Array(tabs.length);\n for (var i = 0, n = tabs.length; i < n; ++i) {\n var node = tabs[i].node;\n var left = node.offsetLeft;\n var width = node.offsetWidth;\n var cstyle = window.getComputedStyle(node);\n var margin = parseInt(cstyle.marginLeft, 10) || 0;\n layout[i] = { margin: margin, left: left, width: width };\n }\n return layout;\n}", "function createScrollBarHandler(){\n $(SECTION_SEL).each(function(){\n var slides = $(this).find(SLIDE_SEL);\n\n if(slides.length){\n slides.each(function(){\n createScrollBar($(this));\n });\n }else{\n createScrollBar($(this));\n }\n\n });\n afterRenderActions();\n }", "function createScrollBarHandler(){\n $(SECTION_SEL).each(function(){\n var slides = $(this).find(SLIDE_SEL);\n\n if(slides.length){\n slides.each(function(){\n createScrollBar($(this));\n });\n }else{\n createScrollBar($(this));\n }\n\n });\n afterRenderActions();\n }", "function getBoundingClientRectWithBorderOffset(node) {\n const dimensions = getElementDimensions(node);\n return mergeRectOffsets([\n node.getBoundingClientRect(),\n {\n top: dimensions.borderTop,\n left: dimensions.borderLeft,\n bottom: dimensions.borderBottom,\n right: dimensions.borderRight,\n // This width and height won't get used by mergeRectOffsets (since this\n // is not the first rect in the array), but we set them so that this\n // object typechecks as a ClientRect.\n width: 0,\n height: 0,\n },\n ]);\n} // Add together the top, left, bottom, and right properties of", "get _width() {\n // The container event's width is determined by the maximum number of\n // events in any of its rows.\n if (this.rows) {\n const columns =\n this.rows.reduce((max, row) => {\n return Math.max(max, row.leaves.length + 1) // add itself\n }, 0) + 1 // add the container\n\n return 100 / columns\n }\n\n const availableWidth = 100 - this.container._width\n\n // The row event's width is the space left by the container, divided\n // among itself and its leaves.\n if (this.leaves) {\n return availableWidth / (this.leaves.length + 1)\n }\n\n // The leaf event's width is determined by its row's width\n return this.row._width\n }", "getSplittedWidgetForRow(bottom, tableCollection, rowCollection, tableRowWidget) {\n let splittedWidget = undefined;\n let rowIndex = tableRowWidget.index;\n for (let i = 0; i < tableRowWidget.childWidgets.length; i++) {\n let cellWidget = tableRowWidget.childWidgets[i];\n let splittedCell = this.getSplittedWidget(bottom, true, tableCollection, rowCollection, cellWidget);\n if (!isNullOrUndefined(splittedCell)) {\n if (splittedCell === cellWidget) {\n //Returns if the whole content of the row does not fit in current page.\n return tableRowWidget;\n }\n if (tableRowWidget.childWidgets.indexOf(splittedCell) !== -1) {\n tableRowWidget.childWidgets.splice(tableRowWidget.childWidgets.indexOf(splittedCell), 1);\n }\n if (i === 0 || tableRowWidget.height < cellWidget.height + cellWidget.margin.top + cellWidget.margin.bottom) {\n tableRowWidget.height = cellWidget.height + cellWidget.margin.top + cellWidget.margin.bottom;\n }\n if (isNullOrUndefined(splittedWidget)) {\n //Creates new widget, to hold the splitted contents.\n splittedWidget = new TableRowWidget();\n splittedWidget.containerWidget = tableRowWidget.containerWidget;\n splittedWidget.index = tableRowWidget.index;\n splittedWidget.rowFormat = tableRowWidget.rowFormat;\n this.updateWidgetLocation(tableRowWidget, splittedWidget);\n splittedWidget.height = 0;\n rowCollection.push(splittedWidget);\n }\n let rowSpan = 1;\n // tslint:disable-next-line:max-line-length\n rowSpan = (isNullOrUndefined(splittedCell) || isNullOrUndefined(splittedCell.cellFormat)) ? rowSpan : splittedCell.cellFormat.rowSpan;\n if (rowIndex - splittedCell.rowIndex === rowSpan - 1\n && splittedWidget.height < splittedCell.height + splittedCell.margin.top + splittedCell.margin.bottom) {\n splittedWidget.height = splittedCell.height + splittedCell.margin.top + splittedCell.margin.bottom;\n }\n splittedWidget.childWidgets.push(splittedCell);\n splittedCell.containerWidget = splittedWidget;\n }\n }\n return splittedWidget;\n }", "splitWidthToTableCells(tableClientWidth, isZeroWidth) {\n for (let row = 0; row < this.childWidgets.length; row++) {\n this.childWidgets[row].splitWidthToRowCells(tableClientWidth, isZeroWidth);\n }\n }", "@computed(\n 'hasFixedColumn',\n 'bodyColumns.firstObject.width',\n 'allColumnWidths',\n '_width'\n ) get horizontalScrollWrapperStyle() {\n let columns = this.get('bodyColumns');\n let visibility = this.get('_width') < this.get('allColumnWidths') ? 'visibility' : 'hidden';\n let left;\n if (get(columns, 'length') > 0 && this.get('hasFixedColumn')) {\n left = get(columns[0], 'width');\n } else {\n left = 0;\n }\n\n return htmlSafe(`visibility: ${visibility}; left: ${left}px; right: 0px;`);\n }", "function getContentRect(el) {\n\tvar offset = el.offset(); // just outside of border, margin not included\n\tvar left = offset.left + getCssFloat(el, 'border-left-width') + getCssFloat(el, 'padding-left');\n\tvar top = offset.top + getCssFloat(el, 'border-top-width') + getCssFloat(el, 'padding-top');\n\n\treturn {\n\t\tleft: left,\n\t\tright: left + el.width(),\n\t\ttop: top,\n\t\tbottom: top + el.height()\n\t};\n}", "alignTabOpeningBoxes() {\r\n const widths = {};\r\n const rows = $(\"tabopening\").querySelectorAll(\"hbox\");\r\n function updateGrid(fn) {\r\n for (let row of rows) {\r\n let id = 0;\r\n const cols = row.querySelectorAll(\"vbox\");\r\n for (let col of cols) {\r\n if (++id && col.hasAttribute(\"setWidth\")) {\r\n fn(col, id);\r\n }\r\n }\r\n }\r\n }\r\n updateGrid((col, id) => {\r\n widths[id] = Math.max(widths[id] || 0, col.boxObject.width);\r\n });\r\n\r\n updateGrid((col, id) => {\r\n col.style.setProperty(\"width\", widths[id] + \"px\", \"important\");\r\n });\r\n }", "function createScrollBarHandler(){\r\n $(SECTION_SEL).each(function(){\r\n var slides = $(this).find(SLIDE_SEL);\r\n\r\n if(slides.length){\r\n slides.each(function(){\r\n createScrollBar($(this));\r\n });\r\n }else{\r\n createScrollBar($(this));\r\n }\r\n\r\n });\r\n afterRenderActions();\r\n }", "function createScrollBarHandler(){\r\n $(SECTION_SEL).each(function(){\r\n var slides = $(this).find(SLIDE_SEL);\r\n\r\n if(slides.length){\r\n slides.each(function(){\r\n createScrollBar($(this));\r\n });\r\n }else{\r\n createScrollBar($(this));\r\n }\r\n\r\n });\r\n afterRenderActions();\r\n }", "function grid(dimensions = 16) {\r\n for(let i = 0; i < dimensions; i++) {\r\n divRows[i] = document.createElement(\"div\");\r\n divRows[i].classList.add(\"rows\");\r\n divRows[i].style.height = `calc(100% / ${dimensions})`;\r\n container.appendChild(divRows[i]);\r\n }\r\n \r\n for(let i = 0; i < dimensions; i++) {\r\n for(let j = 0; j < dimensions; j++) {\r\n divCols[j] = document.createElement(\"div\");\r\n divCols[j].classList.add(\"cols\");\r\n divRows[i].appendChild(divCols[j]);\r\n \r\n divRows[i].children[j].onmouseover = function() {\r\n divRows[i].children[j].style.backgroundColor = setColor();\r\n }\r\n \r\n }\r\n }\r\n}", "updateClientAreaForCell(cell, beforeLayout) {\n // tslint:disable-next-line:max-line-length\n let rowWidget = cell.ownerRow;\n let cellWidget = cell;\n if (beforeLayout) {\n this.clientActiveArea.x = this.clientArea.x = cellWidget.x;\n this.clientActiveArea.y = cellWidget.y;\n this.clientActiveArea.width = this.clientArea.width = cellWidget.width > 0 ? cellWidget.width : 0;\n if (this instanceof PageLayoutViewer) {\n this.clientActiveArea.height = Number.POSITIVE_INFINITY;\n }\n this.clientArea = new Rect(this.clientArea.x, this.clientArea.y, this.clientArea.width, this.clientArea.height);\n // tslint:disable-next-line:max-line-length\n this.clientActiveArea = new Rect(this.clientActiveArea.x, this.clientActiveArea.y, this.clientActiveArea.width, this.clientActiveArea.height);\n }\n else {\n this.clientActiveArea.x = this.clientArea.x = cellWidget.x + cellWidget.width + cellWidget.margin.right;\n if (rowWidget.x + rowWidget.width - this.clientArea.x < 0) {\n this.clientActiveArea.width = this.clientArea.width = 0;\n }\n else {\n this.clientActiveArea.width = this.clientArea.width = rowWidget.x + rowWidget.width - this.clientArea.x;\n }\n // tslint:disable-next-line:max-line-length\n this.clientActiveArea.y = cellWidget.y - cellWidget.margin.top - HelperMethods.convertPointToPixel(cell.ownerTable.tableFormat.cellSpacing);\n if (!cell.ownerTable.isInsideTable) {\n this.clientActiveArea.height = this.clientArea.bottom - rowWidget.y > 0 ? this.clientArea.bottom - rowWidget.y : 0;\n }\n this.clientArea = new Rect(this.clientArea.x, this.clientArea.y, this.clientArea.width, this.clientArea.height);\n // tslint:disable-next-line:max-line-length\n this.clientActiveArea = new Rect(this.clientActiveArea.x, this.clientActiveArea.y, this.clientActiveArea.width, this.clientActiveArea.height);\n }\n }", "function uncompensateScroll(rowEls) {\n rowEls.css({\n 'margin-left': '',\n 'margin-right': '',\n 'border-left-width': '',\n 'border-right-width': ''\n });\n}", "function uncompensateScroll(rowEls) {\n rowEls.css({\n 'margin-left': '',\n 'margin-right': '',\n 'border-left-width': '',\n 'border-right-width': ''\n });\n}", "function uncompensateScroll(rowEls) {\n rowEls.css({\n 'margin-left': '',\n 'margin-right': '',\n 'border-left-width': '',\n 'border-right-width': ''\n });\n}", "function uncompensateScroll(rowEls) {\n rowEls.css({\n 'margin-left': '',\n 'margin-right': '',\n 'border-left-width': '',\n 'border-right-width': ''\n });\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "getTableLeftBorder(borders) {\n if (!isNullOrUndefined(borders.left)) {\n return borders.left;\n }\n else {\n let border = new WBorder(borders);\n border.lineStyle = 'Single';\n border.lineWidth = 0.66;\n return border;\n }\n }", "function m(a){void 0===a&&(a=oa),oa=a,bb={};var b=$.position().top,c=ia.position().top,d=Math.min(// total body height, including borders\na-b,// when scrollbars\nla.height()+c+1);da.height(d-x(ca)),ea.css(\"top\",b),ia.height(d-c-1);\n// the stylesheet guarantees that the first row has no border.\n// this allows .height() to work well cross-browser.\nvar e=la.find(\"tr:first\").height()+1,f=la.find(\"tr:eq(1)\").height();\n// HACK: i forget why we do this, but i think a cross-browser issue\nva=(e+f)/2,xa=sa/wa,ya=va/xa}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }" ]
[ "0.7313346", "0.6622791", "0.6622791", "0.6622791", "0.6622791", "0.6530672", "0.6396445", "0.6375848", "0.6332526", "0.62115324", "0.62115324", "0.62115324", "0.62115324", "0.62115324", "0.62115324", "0.62115324", "0.62115324", "0.6177679", "0.6138433", "0.6054187", "0.59617496", "0.5871573", "0.5787581", "0.5743896", "0.57406414", "0.57305205", "0.57090116", "0.56962305", "0.56852657", "0.5660394", "0.5652482", "0.5652482", "0.5652482", "0.5640095", "0.5558959", "0.5539806", "0.5504351", "0.5492394", "0.54923123", "0.5483756", "0.5479054", "0.5479054", "0.5479054", "0.5452148", "0.5452148", "0.5452148", "0.5452148", "0.5445618", "0.539981", "0.5386235", "0.5375678", "0.5375678", "0.5375678", "0.5375678", "0.5375678", "0.5346006", "0.5342472", "0.533128", "0.5315258", "0.5309309", "0.53093004", "0.5305431", "0.5301572", "0.5297164", "0.5297164", "0.5297164", "0.5297164", "0.5297164", "0.5297164", "0.5297164", "0.52771527", "0.5273486", "0.5270988", "0.5246752", "0.5237884", "0.52325076", "0.5221429", "0.52178514", "0.52039814", "0.52039814", "0.5202874", "0.52024394", "0.52023745", "0.5202364", "0.5200359", "0.5191656", "0.51884896", "0.51798844", "0.51798844", "0.51797676", "0.51598877", "0.51419705", "0.51419705", "0.51419705", "0.51419705", "0.51418644", "0.5133127", "0.51267385", "0.5122262" ]
0.6240635
10
Undoes compensateScroll and restores all borders/margins
function uncompensateScroll(rowEl) { applyStyle(rowEl, { marginLeft: '', marginRight: '', borderLeftWidth: '', borderRightWidth: '' }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function uncompensateScroll(rowEls){rowEls.css({'margin-left':'','margin-right':'','border-left-width':'','border-right-width':''});}", "function uncompensateScroll(rowEl) {\n dom_manip_1.applyStyle(rowEl, {\n marginLeft: '',\n marginRight: '',\n borderLeftWidth: '',\n borderRightWidth: ''\n });\n }", "function uncompensateScroll(rowEl) {\n applyStyle$1(rowEl, {\n marginLeft: '',\n marginRight: '',\n borderLeftWidth: '',\n borderRightWidth: ''\n });\n }", "function uncompensateScroll(rowEl) {\n applyStyle(rowEl, {\n marginLeft: '',\n marginRight: '',\n borderLeftWidth: '',\n borderRightWidth: ''\n });\n}", "function uncompensateScroll(rowEls) {\n rowEls.css({\n 'margin-left': '',\n 'margin-right': '',\n 'border-left-width': '',\n 'border-right-width': ''\n });\n}", "function uncompensateScroll(rowEls) {\n rowEls.css({\n 'margin-left': '',\n 'margin-right': '',\n 'border-left-width': '',\n 'border-right-width': ''\n });\n}", "function uncompensateScroll(rowEls) {\n rowEls.css({\n 'margin-left': '',\n 'margin-right': '',\n 'border-left-width': '',\n 'border-right-width': ''\n });\n}", "function uncompensateScroll(rowEls) {\n rowEls.css({\n 'margin-left': '',\n 'margin-right': '',\n 'border-left-width': '',\n 'border-right-width': ''\n });\n}", "function uncompensateScroll(rowEls) {\n rowEls.css({\n 'margin-left': '',\n 'margin-right': '',\n 'border-left-width': '',\n 'border-right-width': ''\n });\n }", "function uncompensateScroll(rowEls) {\n\t\trowEls.css({\n\t\t\t'margin-left': '',\n\t\t\t'margin-right': '',\n\t\t\t'border-left-width': '',\n\t\t\t'border-right-width': ''\n\t\t});\n\t}", "function uncompensateScroll(rowEls) {\n\trowEls.css({\n\t\t'margin-left': '',\n\t\t'margin-right': '',\n\t\t'border-left-width': '',\n\t\t'border-right-width': ''\n\t});\n}", "function uncompensateScroll(rowEls) {\n\trowEls.css({\n\t\t'margin-left': '',\n\t\t'margin-right': '',\n\t\t'border-left-width': '',\n\t\t'border-right-width': ''\n\t});\n}", "function uncompensateScroll(rowEls) {\n\trowEls.css({\n\t\t'margin-left': '',\n\t\t'margin-right': '',\n\t\t'border-left-width': '',\n\t\t'border-right-width': ''\n\t});\n}", "function uncompensateScroll(rowEls) {\n\trowEls.css({\n\t\t'margin-left': '',\n\t\t'margin-right': '',\n\t\t'border-left-width': '',\n\t\t'border-right-width': ''\n\t});\n}", "function uncompensateScroll(rowEls) {\n\trowEls.css({\n\t\t'margin-left': '',\n\t\t'margin-right': '',\n\t\t'border-left-width': '',\n\t\t'border-right-width': ''\n\t});\n}", "function uncompensateScroll(rowEls) {\n\trowEls.css({\n\t\t'margin-left': '',\n\t\t'margin-right': '',\n\t\t'border-left-width': '',\n\t\t'border-right-width': ''\n\t});\n}", "function uncompensateScroll(rowEls) {\n\trowEls.css({\n\t\t'margin-left': '',\n\t\t'margin-right': '',\n\t\t'border-left-width': '',\n\t\t'border-right-width': ''\n\t});\n}", "function uncompensateScroll(rowEls) {\n\trowEls.css({\n\t\t'margin-left': '',\n\t\t'margin-right': '',\n\t\t'border-left-width': '',\n\t\t'border-right-width': ''\n\t});\n}", "function compensateScroll(rowEl, scrollbarWidths) {\n if (scrollbarWidths.left) {\n applyStyle(rowEl, {\n borderLeftWidth: 1,\n marginLeft: scrollbarWidths.left - 1\n });\n }\n\n if (scrollbarWidths.right) {\n applyStyle(rowEl, {\n borderRightWidth: 1,\n marginRight: scrollbarWidths.right - 1\n });\n }\n } // Undoes compensateScroll and restores all borders/margins", "function compensateScroll(rowEls,scrollbarWidths){if(scrollbarWidths.left){rowEls.css({'border-left-width':1,'margin-left':scrollbarWidths.left-1});}if(scrollbarWidths.right){rowEls.css({'border-right-width':1,'margin-right':scrollbarWidths.right-1});}}", "function resetContent() {\n \tscrollLine.scroffset = 0;\n \tscrollOffScreen.clear();\n \tscrollScreen.clear();\n \tcurrentScrollBackPos = 10;\n }", "function disarmWindowScroller() {\n window.removeEventListener('mousemove', updateMousePosition);\n window.removeEventListener('touchmove', updateMousePosition);\n mousePosition = undefined;\n window.clearTimeout(next$1);\n resetScrolling$1();\n }", "_restoreRowsOutOfView() {\n this.body.style.removeProperty(CSS_PROPERTY_HEIGHT_BEFORE);\n this.body.style.removeProperty(CSS_PROPERTY_HEIGHT_AFTER);\n this._resizingVisibleRows.forEach((dom) => dom.classList.remove(CLASS_RESIZING_VISIBLE));\n this._resizingVisibleRows.length = 0;\n this.dom.scrollTop = this._prevScrollTop;\n }", "restoreScroll(state = this.storedScrollState) {\n const me = this;\n\n // TODO: Implement special multi-element Scroller subclass for Grids which\n // encapsulates the x axis only Scrollers of all its SubGrids.\n me.eachSubGrid((subGrid) => {\n subGrid.scrollable.x = state.scrollLeft[subGrid.region];\n });\n\n me.scrollable.y = state.scrollTop;\n }", "restoreScroll(state = this.storedScrollState) {\n const me = this; // TODO: Implement special multi-element Scroller subclass for Grids which\n // encapsulates the x axis only Scrollers of all its SubGrids.\n\n me.eachSubGrid(subGrid => {\n subGrid.scrollable.x = state.scrollLeft[subGrid.region];\n });\n me.scrollable.y = state.scrollTop;\n }", "function compensateScroll(rowEl, scrollbarWidths) {\n if (scrollbarWidths.left) {\n dom_manip_1.applyStyle(rowEl, {\n borderLeftWidth: 1,\n marginLeft: scrollbarWidths.left - 1\n });\n }\n\n if (scrollbarWidths.right) {\n dom_manip_1.applyStyle(rowEl, {\n borderRightWidth: 1,\n marginRight: scrollbarWidths.right - 1\n });\n }\n }", "undoSiteAdjust() {\r\n\t\t$( '.main-header' ).removeClass( 'adjustedMargin' );\r\n\t}", "function startTheScroll () {\n $('body').css({\n 'overflow': '',\n })\n }", "function setUnfixed() {\n // Only unfix the target element and the spacer if we need to.\n if (!isUnfixed()) {\n lastOffsetLeft = -1;\n\n // Hide the spacer now that the target element will fill the\n // space.\n spacer.css('display', 'none');\n\n // Remove the style attributes that were added to the target.\n // This will reverse the target back to the its original style.\n target.css({\n 'z-index' : originalZIndex,\n 'width' : '',\n 'position' : originalPosition,\n 'left' : '',\n 'top' : originalOffsetTop,\n 'margin-left' : ''\n });\n\n target.removeClass('scroll-to-fixed-fixed');\n\n if (base.options.className) {\n target.removeClass(base.options.className);\n }\n\n position = null;\n }\n }", "function setUnfixed() {\r\n // Only unfix the target element and the spacer if we need to.\r\n if (!isUnfixed()) {\r\n lastOffsetLeft = -1;\r\n\r\n // Hide the spacer now that the target element will fill the\r\n // space.\r\n spacer.css('display', 'none');\r\n\r\n // Remove the style attributes that were added to the target.\r\n // This will reverse the target back to the its original style.\r\n target.css({\r\n 'z-index' : originalZIndex,\r\n 'width' : '',\r\n 'position' : originalPosition,\r\n 'left' : '',\r\n 'top' : originalOffsetTop,\r\n 'margin-left' : ''\r\n });\r\n\r\n target.removeClass('scroll-to-fixed-fixed');\r\n\r\n if (base.options.className) {\r\n target.removeClass(base.options.className);\r\n }\r\n\r\n position = null;\r\n }\r\n }", "function disarmWindowScroller() {\n console.debug('disarming window scroller');\n window.removeEventListener('mousemove', updateMousePosition);\n window.removeEventListener('touchmove', updateMousePosition);\n mousePosition = undefined;\n window.clearTimeout(next$1);\n resetScrolling$1();\n}", "function resetBkmkDragScroll () {\n isBkmkDragActive = false;\n refBkmkScrollLeft = refBkmkScrollTop = -1;\n if (bkmkDragTimerID != undefined) {\n\tclearTimeout(bkmkDragTimerID);\n\tbkmkDragTimerID = undefined; // Do not restart a timer\n }\n if (bkmkDragoverSimulTimerID != undefined) {\n\tclearTimeout(bkmkDragoverSimulTimerID);\n\tbkmkDragoverSimulTimerID = undefined;\n }\n if (isBkmkScrollInhibited) {\n\tenableBkmkScroll();\n }\n isBkmkScrollReactivated = false;\n}", "function resetMaxScrolls()\n {\n var offsets = getPageOffsets();\n\n var x = offsets[0];\n minXOffset = x;\n maxXOffset = x;\n\n var y = offsets[1];\n minYOffset = y;\n maxYOffset = y;\n }", "function compensateScroll(rowEl, scrollbarWidths) {\n if (scrollbarWidths.left) {\n applyStyle$1(rowEl, {\n borderLeftWidth: 1,\n marginLeft: scrollbarWidths.left - 1\n });\n }\n if (scrollbarWidths.right) {\n applyStyle$1(rowEl, {\n borderRightWidth: 1,\n marginRight: scrollbarWidths.right - 1\n });\n }\n }", "function unsetScroller(containerEl) {\n containerEl.height('').removeClass('fc-scroller');\n }", "function compensateScroll(rowEl, scrollbarWidths) {\n if (scrollbarWidths.left) {\n applyStyle(rowEl, {\n borderLeftWidth: 1,\n marginLeft: scrollbarWidths.left - 1\n });\n }\n if (scrollbarWidths.right) {\n applyStyle(rowEl, {\n borderRightWidth: 1,\n marginRight: scrollbarWidths.right - 1\n });\n }\n }", "function compensateScroll(rowEl, scrollbarWidths) {\n if (scrollbarWidths.left) {\n applyStyle(rowEl, {\n borderLeftWidth: 1,\n marginLeft: scrollbarWidths.left - 1\n });\n }\n if (scrollbarWidths.right) {\n applyStyle(rowEl, {\n borderRightWidth: 1,\n marginRight: scrollbarWidths.right - 1\n });\n }\n }", "function resetScroll() {\n var viewer = $find(viewerID);\n\n // Check the isLoading client-side property before using the reportAreaScrollPosition property.\n // Otherwise an exception will be thrown.\n if (!viewer.get_isLoading()) {\n viewer.set_reportAreaScrollPosition(new Sys.UI.Point(0,0));\n }\n}", "function removeUnnecessaryScrollWindows() {\n if ($('.home-features-stories-cont .custom-scroll').length > 0) {\n $('.home-features-stories-cont .custom-scroll').removeClass('custom-scroll');\n }\n\n if ($('.todays-varian-item.referrals.auto-section .custom-scroll').length > 0) {\n $('.todays-varian-item.referrals.auto-section .custom-scroll').removeClass('custom-scroll');\n }\n\n if ($('.todays-varian-item.our-people-bg.auto-section .custom-scroll').length > 0) {\n $('.todays-varian-item.our-people-bg.auto-section .custom-scroll').removeClass('custom-scroll');\n }\n\n if ($('.todays-varian-item.our-location-bg.auto-section .custom-scroll').length > 0) {\n $('.todays-varian-item.our-location-bg.auto-section .custom-scroll').removeClass('custom-scroll');\n }\n\n if ($('.todays-varian-item.how-do-i.auto-section .custom-scroll').length > 0) {\n $('.todays-varian-item.how-do-i.auto-section .custom-scroll').removeClass('custom-scroll');\n }\n\n if ($('.Emergency-bg .custom-scroll').length > 0) {\n $('.Emergency-bg .custom-scroll').removeClass('custom-scroll');\n }\n }", "static resetScrollBarWidth() {\n scrollBarWidth = null;\n }", "static resetScrollBarWidth() {\n scrollBarWidth = null;\n }", "function compensateScroll(rowEls, scrollbarWidths) {\n if (scrollbarWidths.left) {\n rowEls.css({\n 'border-left-width': 1,\n 'margin-left': scrollbarWidths.left - 1\n });\n }\n if (scrollbarWidths.right) {\n rowEls.css({\n 'border-right-width': 1,\n 'margin-right': scrollbarWidths.right - 1\n });\n }\n }", "removeScrollPosition() {\n this.scrollElement.scrollTop = this.scrollTop\n body.style.removeProperty('top')\n }", "function unsetScroller(containerEl) {\n\tcontainerEl.height('').removeClass('fc-scroller');\n}", "function compensateScroll(rowEls, scrollbarWidths) {\n\t\tif (scrollbarWidths.left) {\n\t\t\trowEls.css({\n\t\t\t\t'border-left-width': 1,\n\t\t\t\t'margin-left': scrollbarWidths.left - 1\n\t\t\t});\n\t\t}\n\t\tif (scrollbarWidths.right) {\n\t\t\trowEls.css({\n\t\t\t\t'border-right-width': 1,\n\t\t\t\t'margin-right': scrollbarWidths.right - 1\n\t\t\t});\n\t\t}\n\t}", "function resetScroll() {\n // Set the element to it original positioning.\n target.trigger('preUnfixed.ScrollToFixed');\n setUnfixed();\n target.trigger('unfixed.ScrollToFixed');\n\n // Reset the last offset used to determine if the page has moved\n // horizontally.\n lastOffsetLeft = -1;\n\n // Capture the offset top of the target element.\n offsetTop = target.offset().top;\n\n // Capture the offset left of the target element.\n offsetLeft = target.offset().left;\n\n // If the offsets option is on, alter the left offset.\n if (base.options.offsets) {\n offsetLeft += (target.offset().left - target.position().left);\n }\n\n if (originalOffsetLeft == -1) {\n originalOffsetLeft = offsetLeft;\n }\n\n position = target.css('position');\n\n // Set that this has been called at least once.\n isReset = true;\n\n if (base.options.bottom != -1) {\n target.trigger('preFixed.ScrollToFixed');\n setFixed();\n target.trigger('fixed.ScrollToFixed');\n }\n }", "function resetScroll() {\r\n // Set the element to it original positioning.\r\n target.trigger('preUnfixed.ScrollToFixed');\r\n setUnfixed();\r\n target.trigger('unfixed.ScrollToFixed');\r\n\r\n // Reset the last offset used to determine if the page has moved\r\n // horizontally.\r\n lastOffsetLeft = -1;\r\n\r\n // Capture the offset top of the target element.\r\n offsetTop = target.offset().top;\r\n\r\n // Capture the offset left of the target element.\r\n offsetLeft = target.offset().left;\r\n\r\n // If the offsets option is on, alter the left offset.\r\n if (base.options.offsets) {\r\n offsetLeft += (target.offset().left - target.position().left);\r\n }\r\n\r\n if (originalOffsetLeft == -1) {\r\n originalOffsetLeft = offsetLeft;\r\n }\r\n\r\n position = target.css('position');\r\n\r\n // Set that this has been called at least once.\r\n isReset = true;\r\n\r\n if (base.options.bottom != -1) {\r\n target.trigger('preFixed.ScrollToFixed');\r\n setFixed();\r\n target.trigger('fixed.ScrollToFixed');\r\n }\r\n }", "function unfreeze() {\n if($(\"html\").css(\"position\") == \"fixed\") {\n var top = $(\"html\").scrollTop() ? $(\"html\").scrollTop() : $(\"body\").scrollTop();\n $(\"html\").css(\"position\", \"static\");\n $(\"html, body\").scrollTop(-parseInt($(\"html\").css(\"top\")));\n $(\"html\").removeAttr('style');\n //$(\"html\").css({\"position\": \"\", \"width\": \"\", \"height\": \"\", \"top\": \"\", \"overflow-y\": \"\"});\n\n // Prevent top banner going down for IE\n if (checkIE()) {\n $('.topbar').css('padding-top', top);\n }else{\n $('.topbar').css('padding-top', -top);\n }\n }\n }", "function compensateScroll(rowEl, scrollbarWidths) {\n if (scrollbarWidths.left) {\n applyStyle(rowEl, {\n borderLeftWidth: 1,\n marginLeft: scrollbarWidths.left - 1\n });\n }\n if (scrollbarWidths.right) {\n applyStyle(rowEl, {\n borderRightWidth: 1,\n marginRight: scrollbarWidths.right - 1\n });\n }\n}", "function onscrollstop() {\n scroller.classList.remove('scrolling');\n frozenTHead.style.clip = getClipRect(scroller.scrollLeft, scrollerRect.width);\n frozenTHead.style.top = offsetTop + 'px';\n frozenTHead.style.transform = 'translateX(' + -scroller.scrollLeft + 'px)';\n }", "function compensateScroll(rowEls, scrollbarWidths) {\n\tif (scrollbarWidths.left) {\n\t\trowEls.css({\n\t\t\t'border-left-width': 1,\n\t\t\t'margin-left': scrollbarWidths.left - 1\n\t\t});\n\t}\n\tif (scrollbarWidths.right) {\n\t\trowEls.css({\n\t\t\t'border-right-width': 1,\n\t\t\t'margin-right': scrollbarWidths.right - 1\n\t\t});\n\t}\n}", "function compensateScroll(rowEls, scrollbarWidths) {\n\tif (scrollbarWidths.left) {\n\t\trowEls.css({\n\t\t\t'border-left-width': 1,\n\t\t\t'margin-left': scrollbarWidths.left - 1\n\t\t});\n\t}\n\tif (scrollbarWidths.right) {\n\t\trowEls.css({\n\t\t\t'border-right-width': 1,\n\t\t\t'margin-right': scrollbarWidths.right - 1\n\t\t});\n\t}\n}", "function compensateScroll(rowEls, scrollbarWidths) {\n\tif (scrollbarWidths.left) {\n\t\trowEls.css({\n\t\t\t'border-left-width': 1,\n\t\t\t'margin-left': scrollbarWidths.left - 1\n\t\t});\n\t}\n\tif (scrollbarWidths.right) {\n\t\trowEls.css({\n\t\t\t'border-right-width': 1,\n\t\t\t'margin-right': scrollbarWidths.right - 1\n\t\t});\n\t}\n}", "function compensateScroll(rowEls, scrollbarWidths) {\n\tif (scrollbarWidths.left) {\n\t\trowEls.css({\n\t\t\t'border-left-width': 1,\n\t\t\t'margin-left': scrollbarWidths.left - 1\n\t\t});\n\t}\n\tif (scrollbarWidths.right) {\n\t\trowEls.css({\n\t\t\t'border-right-width': 1,\n\t\t\t'margin-right': scrollbarWidths.right - 1\n\t\t});\n\t}\n}", "function compensateScroll(rowEls, scrollbarWidths) {\n\tif (scrollbarWidths.left) {\n\t\trowEls.css({\n\t\t\t'border-left-width': 1,\n\t\t\t'margin-left': scrollbarWidths.left - 1\n\t\t});\n\t}\n\tif (scrollbarWidths.right) {\n\t\trowEls.css({\n\t\t\t'border-right-width': 1,\n\t\t\t'margin-right': scrollbarWidths.right - 1\n\t\t});\n\t}\n}", "function compensateScroll(rowEls, scrollbarWidths) {\n\tif (scrollbarWidths.left) {\n\t\trowEls.css({\n\t\t\t'border-left-width': 1,\n\t\t\t'margin-left': scrollbarWidths.left - 1\n\t\t});\n\t}\n\tif (scrollbarWidths.right) {\n\t\trowEls.css({\n\t\t\t'border-right-width': 1,\n\t\t\t'margin-right': scrollbarWidths.right - 1\n\t\t});\n\t}\n}", "function compensateScroll(rowEls, scrollbarWidths) {\n\tif (scrollbarWidths.left) {\n\t\trowEls.css({\n\t\t\t'border-left-width': 1,\n\t\t\t'margin-left': scrollbarWidths.left - 1\n\t\t});\n\t}\n\tif (scrollbarWidths.right) {\n\t\trowEls.css({\n\t\t\t'border-right-width': 1,\n\t\t\t'margin-right': scrollbarWidths.right - 1\n\t\t});\n\t}\n}", "function compensateScroll(rowEls, scrollbarWidths) {\n\tif (scrollbarWidths.left) {\n\t\trowEls.css({\n\t\t\t'border-left-width': 1,\n\t\t\t'margin-left': scrollbarWidths.left - 1\n\t\t});\n\t}\n\tif (scrollbarWidths.right) {\n\t\trowEls.css({\n\t\t\t'border-right-width': 1,\n\t\t\t'margin-right': scrollbarWidths.right - 1\n\t\t});\n\t}\n}", "function removeOverflow() {\n $document.find('body').addClass('no-overflow');\n }", "function compensateScroll(rowEls, scrollbarWidths) {\n if (scrollbarWidths.left) {\n rowEls.css({\n 'border-left-width': 1,\n 'margin-left': scrollbarWidths.left - 1\n });\n }\n if (scrollbarWidths.right) {\n rowEls.css({\n 'border-right-width': 1,\n 'margin-right': scrollbarWidths.right - 1\n });\n }\n}", "function compensateScroll(rowEls, scrollbarWidths) {\n if (scrollbarWidths.left) {\n rowEls.css({\n 'border-left-width': 1,\n 'margin-left': scrollbarWidths.left - 1\n });\n }\n if (scrollbarWidths.right) {\n rowEls.css({\n 'border-right-width': 1,\n 'margin-right': scrollbarWidths.right - 1\n });\n }\n}", "function compensateScroll(rowEls, scrollbarWidths) {\n if (scrollbarWidths.left) {\n rowEls.css({\n 'border-left-width': 1,\n 'margin-left': scrollbarWidths.left - 1\n });\n }\n if (scrollbarWidths.right) {\n rowEls.css({\n 'border-right-width': 1,\n 'margin-right': scrollbarWidths.right - 1\n });\n }\n}", "function compensateScroll(rowEls, scrollbarWidths) {\n if (scrollbarWidths.left) {\n rowEls.css({\n 'border-left-width': 1,\n 'margin-left': scrollbarWidths.left - 1\n });\n }\n if (scrollbarWidths.right) {\n rowEls.css({\n 'border-right-width': 1,\n 'margin-right': scrollbarWidths.right - 1\n });\n }\n}", "function restore() {\n if (isPrevented) {\n const { body } = document;\n if (previousStyles) {\n body.setAttribute('style', previousStyles);\n } else {\n body.removeAttribute('style');\n }\n\n window.scrollTo(...previousPosition);\n resizeUtil.removeEventListener('', recalculate);\n isPrevented = false;\n }\n}", "function disableBodyScroll() {\n var htmlNode = body.parentNode;\n var restoreHtmlStyle = htmlNode.getAttribute('style') || '';\n var restoreBodyStyle = body.getAttribute('style') || '';\n var scrollOffset = body.scrollTop + body.parentElement.scrollTop;\n var clientWidth = body.clientWidth;\n\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 }", "function disableBodyScroll() {\n var htmlNode = body.parentNode;\n var restoreHtmlStyle = htmlNode.getAttribute('style') || '';\n var restoreBodyStyle = body.getAttribute('style') || '';\n var scrollOffset = body.scrollTop + body.parentElement.scrollTop;\n var clientWidth = body.clientWidth;\n\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 }", "function unbind_article_scrollbar_mousemove()\n\t\t\t{\n\t\t\t\t\t $('.scroll-bar-container').off('mousemove',article_scrollbar_mousemove_handler);\t\n\t\t\t}", "function enableScroll() {\n $(window).off(\"scroll\", cancelScroll);\n $(window).off(\"wheel\", checkScroll);\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 }", "_unsetFixedHeight() {\n if (!this._fixedHeight) {\n return;\n }\n let panels = this.getElementsByTagName('pf-accordion-template');\n for (let i = 0; i < panels.length; i++) {\n let element = panels[i];\n\n // Set the max-height and vertical scroll of the scroll element\n if (element._oldStyle) {\n element.style.maxHeight = element._oldStyle.maxHeight;\n element.style.overflowY = element._oldStyle.overflowY;\n element._oldStyle = null;\n }\n }\n this.style.overflowY = this._oldStyle.overflowY;\n this._oldStyle = null;\n window.removeEventListener('resize', this._fixedHeihtListener);\n this._fixedHeight = false;\n }", "_resetMouseScrollState() {\n this.mouseScrollTimeStamp = 0;\n this.mouseScrollDelta = 0;\n }", "function fixScroll(editor) {\n // Below is copied from the CodeMirror window resize handler, codeMirror.refresh() didn't work...\n const d = editor.display\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null\n d.scrollbarsClipped = false\n editor.setSize()\n}", "function disableBodyScroll() {\n var htmlNode = body.parentNode;\n var restoreHtmlStyle = htmlNode.getAttribute('style') || '';\n var restoreBodyStyle = body.getAttribute('style') || '';\n var scrollOffset = body.scrollTop + body.parentElement.scrollTop;\n var clientWidth = body.clientWidth;\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 }", "function noscroll() {\n\t\tif(!lockScroll) {\n\t\t\tlockScroll = true;\n\t\t\txscroll = scrollContainer.scrollLeft;\n\t\t\tyscroll = scrollContainer.scrollTop;\n\t\t}\n\t\tscrollContainer.scrollTop = yscroll;\n\t\tscrollContainer.scrollLeft = xscroll;\n\t}", "function removeScrollEffects(element) {\n\t\tif (element && (element.get(0).scrollHeight <= element.height())) {\n\t\t\telement.removeClass('list--save__scroll');\n\t\t}\n\t}", "function disableBodyScroll() {\n var htmlNode = body.parentNode;\n var restoreHtmlStyle = htmlNode.style.cssText || '';\n var restoreBodyStyle = body.style.cssText || '';\n var scrollOffset = $mdUtil.scrollTop(body);\n var clientWidth = body.clientWidth;\n\n if (body.scrollHeight > body.clientHeight + 1) {\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) applyStyles(body, {overflow: 'hidden'});\n\n return function restoreScroll() {\n body.style.cssText = restoreBodyStyle;\n htmlNode.style.cssText = restoreHtmlStyle;\n body.scrollTop = scrollOffset;\n htmlNode.scrollTop = scrollOffset;\n };\n }", "function initScroll() {\n this.leftButton.onmousedown = handleScrollClick;\n this.leftButton.onmouseup = handleScrollStop;\n\n this.rightButton.onmousedown = handleScrollClick;\n this.rightButton.onmouseup = handleScrollStop;\n disableNavigation(0,0);\n disableNavigation(0,1);\n var isIEMac = (navigator.appName.indexOf(\"Explorer\") != -1 && navigator.userAgent.indexOf(\"Mac\") != -1);\n if (!isIEMac) {\n document.getElementById(\"theInnerContainer\").style.overflow = \"hidden\";\n }\n}", "function disableBodyScroll() {\n var htmlNode = body.parentNode;\n var restoreHtmlStyle = htmlNode.style.cssText || '';\n var restoreBodyStyle = body.style.cssText || '';\n var scrollOffset = $mdUtil.scrollTop(body);\n var clientWidth = body.clientWidth;\n\n if (body.scrollHeight > body.clientHeight + 1) {\n applyStyles(body, {\n position: 'fixed',\n width: '100%',\n top: -scrollOffset + 'px'\n });\n\n htmlNode.style.overflowY = 'scroll';\n }\n\n if (body.clientWidth < clientWidth) applyStyles(body, {overflow: 'hidden'});\n\n return function restoreScroll() {\n body.style.cssText = restoreBodyStyle;\n htmlNode.style.cssText = restoreHtmlStyle;\n body.scrollTop = scrollOffset;\n htmlNode.scrollTop = scrollOffset;\n };\n }", "_resetSidebarScroll() {\n // sidebar - scroll container\n $('.slimscroll-menu').slimscroll({\n height: 'auto',\n position: 'right',\n size: '5px',\n color: '#9ea5ab',\n wheelStep: 5,\n touchScrollStep: 20,\n });\n }", "function disableBodyScroll() {\n var htmlNode = body.parentNode;\n var restoreHtmlStyle = htmlNode.style.cssText || '';\n var restoreBodyStyle = body.style.cssText || '';\n var scrollOffset = $mdUtil.scrollTop(body);\n var clientWidth = body.clientWidth;\n\n if (body.scrollHeight > body.clientHeight + 1) {\n applyStyles(body, {\n position: 'fixed',\n width: '100%',\n top: -scrollOffset + 'px'\n });\n\n htmlNode.style.overflowY = 'scroll';\n }\n\n if (body.clientWidth < clientWidth) applyStyles(body, {overflow: 'hidden'});\n\n return function restoreScroll() {\n body.style.cssText = restoreBodyStyle;\n htmlNode.style.cssText = restoreHtmlStyle;\n body.scrollTop = scrollOffset;\n htmlNode.scrollTop = scrollOffset;\n };\n }", "function stopTheScroll () {\n $('body').css({\n 'overflow': 'hidden',\n })\n }", "function resetScroll() {\n if (isIOS) {\n setRootScrollTop(getRootScrollTop());\n }\n}", "function disableBodyScroll() {\n var htmlNode = body.parentNode;\n var restoreHtmlStyle = htmlNode.getAttribute('style') || '';\n var restoreBodyStyle = body.getAttribute('style') || '';\n var scrollOffset = $mdUtil.scrollTop(body);\n var clientWidth = body.clientWidth;\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) applyStyles(body, {overflow: 'hidden'});\n\n return function restoreScroll() {\n body.setAttribute('style', restoreBodyStyle);\n htmlNode.setAttribute('style', restoreHtmlStyle);\n body.scrollTop = scrollOffset;\n };\n }", "function scrollReset(){\n el[0].style.overflowY = 'hidden';\n el[0].scrollTop = 0;\n setTimeout(function(){\n el[0].style.overflowY = 'scroll';\n }, 500);\n }", "function customCasClientScroll(){\n\tfor (var key in niceScrolls){\n\t\t // virer les scrollbars qui trainent\n\t try {\n\t\t niceScrolls[key].resize().hide().remove();\n \t } catch (e) {}\n\t}\n\tniceScrolls = [];\n\tif($(window).width()>767){\n\t\tniceScrolls.push($(\"#masque-slides-cas-clients\").niceScroll({\n\t\t\tcursorcolor: \"#054b90\",\n\t\t\tcursorwidth: \"3px\",\n\t\t\tcursorborderradius: \"3px\",\n\t\t\trailalign: \"right\",\n\t\t\tbackground: \"rgba(255, 255, 255, 0.2)\",\n\t\t\tcursorborder: \"none\",\n\t\t\tautohidemode: \"none\"\n\t\t}));\n\t}\n}", "function disableScrollBars() {\n\tdocument.documentElement.style.overflow = 'hidden'; // firefox, chrome\n\tdocument.body.style.overflow = \"hidden\";\n\tdocument.body.scroll = \"no\"; // ie only\n}", "function handleWindowScroll() {\n centerElement();\n }", "_setScrollBars() {\r\n const that = this;\r\n\r\n if (!that._scrollView) {\r\n that._scrollView = new LW.Utilities.Scroll(that.$.timeline, that.$.horizontalScrollBar, that.$.verticalScrollBar);\r\n }\r\n\r\n const vScrollBar = that._scrollView.vScrollBar,\r\n hScrollBar = that._scrollView.hScrollBar;\r\n\r\n hScrollBar.$.addClass('lw-hidden');\r\n vScrollBar.$.addClass('lw-hidden');\r\n\r\n //Cancel Style/Resize observers of the ScrollBars\r\n vScrollBar.hasStyleObserver = false;\r\n hScrollBar.hasStyleObserver = false;\r\n vScrollBar.hasResizeObserver = false;\r\n hScrollBar.hasResizeObserver = false;\r\n\r\n hScrollBar.wait = false;\r\n vScrollBar.wait = false;\r\n\r\n //Refreshes the ScrollBars\r\n that._refresh();\r\n }", "function cancelScroll() {\n $(window).scrollTop(savedY);\n}", "function scrollear(){\n\tvar left = 0;\n\tvar top = 0;\n\tvar img = elemImagen;\n\tvar offset = img;\n\twhile(offset){\n\t\tleft += offset.offsetLeft;\n\t\ttop += offset.offsetTop;\n\t\toffset = offset.offsetParent;\n\t}\n\tvar size = winsize();\n\n\tvar x = scrollx;\n\tif(x == 'L') x = left;\n\telse if(x == 'R') x = left + img.offsetWidth - size.w;\n\telse if(x == 'M') x = left + (img.offsetWidth - size.w)/2;\n\telse if(typeof(x) == 'function') x = x();\n\n\tvar y = scrolly;\n\tif(y == 'U') y = top - bordey;\n\telse if(y == 'D') y = top + img.offsetHeight - size.h + bordey;\n\telse if(y == 'M') y = top + (img.offsetHeight - size.h)/2;\n\telse if(typeof(y) == 'function') y = y();\n\n\tscroll(x, y);\n}", "hackScrollbar() {\n\t\tif (this.state.hackScrollbar) {\n\t\t\tdocument.querySelector(\"html\").style.overflowY = \"hidden\";\n\t\t\tdocument.querySelector(\"body\").style.overflowY = \"auto\";\n\t\t}\n\t}", "function disableBodyScroll() {\n var documentElement = $document[0].documentElement;\n\n var prevDocumentStyle = documentElement.style.cssText || '';\n var prevBodyStyle = body.style.cssText || '';\n\n var viewportTop = $mdUtil.getViewportTop();\n $mdUtil.disableScrollAround._viewPortTop = viewportTop;\n var clientWidth = body.clientWidth;\n var hasVerticalScrollbar = body.scrollHeight > body.clientHeight + 1;\n\n // Scroll may be set on <html> element (for example by overflow-y: scroll)\n // but Chrome is reporting the scrollTop position always on <body>.\n // scrollElement will allow to restore the scrollTop position to proper target.\n var scrollElement = documentElement.scrollTop > 0 ? documentElement : body;\n\n if (hasVerticalScrollbar) {\n angular.element(body).css({\n position: 'fixed',\n width: '100%',\n top: -viewportTop + 'px'\n });\n }\n\n if (body.clientWidth < clientWidth) {\n body.style.overflow = 'hidden';\n }\n\n return function restoreScroll() {\n // Reset the inline style CSS to the previous.\n body.style.cssText = prevBodyStyle;\n documentElement.style.cssText = prevDocumentStyle;\n\n // The scroll position while being fixed\n scrollElement.scrollTop = viewportTop;\n };\n }", "function fixScrollBar(elem, direction){\n\tif((!direction || direction == \"vertical\") && elem.clientHeight < elem.scrollHeight){\n\t\telem.style.paddingRight = getScrollBarWidth();\n\t\telem.style.overflowX = \"hidden\";\n\t}\n\tif((!direction || direction == \"horizontal\") && elem.clientWidth < elem.scrollWidth){\n\t\telem.style.paddingBottom = getScrollBarWidth();\n\t\telem.style.overflowY = \"hidden\";\n\t}\n}", "_removeContainerFixedHeight() {\n const that = this;\n\n for (let i = 0; i < that._containersFixedHeight.length; i++) {\n const container = that._containersFixedHeight[i];\n\n container.style.height = '';\n container.itemContainer.$.removeClass('scroll-buttons-shown');\n container.itemContainer.$.removeClass('one-button-shown');\n container.children[0].$.addClass('jqx-hidden');\n container.children[2].$.addClass('jqx-hidden');\n container.itemContainer.checkOverflow = true;\n }\n }", "function cancelScroll() {\n\tif (!o3_followscroll || typeof over.scroller == 'undefined') return;\n\tover.scroller.canScroll = 1;\n\t\n\tif (over.scroller.timer) {\n\t\tclearTimeout(over.scroller.timer);\n\t\tover.scroller.timer=null;\n\t}\n}", "function ResetSizeOnInner() {\n va.$pagInner\n .css({\n 'width': '',\n 'height': '',\n 'margin-right': '',\n 'margin-bottom': ''\n })\n .removeClass(wfit + ' ' + hfit);\n // Reset kich thuoc cua Pag Item\n va.$pagItem.each(function () { $(this).css({ 'width': '', 'height': '' }); });\n }", "function destroySideScroll() {\n $('.sidebar-inner').mCustomScrollbar(\"destroy\");\n}", "function destroySideScroll() {\n $('.sidebar-inner').mCustomScrollbar(\"destroy\");\n}", "function setMarginScroll() {\n if (isIE6 && !modal.blocker) {\n if (document.documentElement) {\n currentSettings.marginScrollLeft = document.documentElement.scrollLeft;\n currentSettings.marginScrollTop = document.documentElement.scrollTop;\n } else {\n currentSettings.marginScrollLeft = document.body.scrollLeft;\n currentSettings.marginScrollTop = document.body.scrollTop;\n }\n } else {\n currentSettings.marginScrollLeft = 0;\n currentSettings.marginScrollTop = 0;\n }\n }" ]
[ "0.7537144", "0.7326638", "0.7144274", "0.70553714", "0.7036137", "0.7036137", "0.7036137", "0.7036137", "0.6989386", "0.69088274", "0.68808717", "0.68808717", "0.68808717", "0.68808717", "0.68808717", "0.68808717", "0.68808717", "0.68808717", "0.67463994", "0.6733815", "0.66698843", "0.6441361", "0.64131373", "0.6261004", "0.6234971", "0.61915225", "0.6173654", "0.6162444", "0.615951", "0.6141182", "0.61216605", "0.61053854", "0.6078629", "0.6077347", "0.60595095", "0.60503805", "0.60503805", "0.6020048", "0.60162354", "0.6014718", "0.6014718", "0.6006234", "0.59784615", "0.5961026", "0.59577256", "0.59306455", "0.5929778", "0.59256667", "0.58852595", "0.5884413", "0.5881114", "0.5881114", "0.5881114", "0.5881114", "0.5881114", "0.5881114", "0.5881114", "0.5881114", "0.5849848", "0.584367", "0.584367", "0.584367", "0.584367", "0.57984984", "0.57931125", "0.57931125", "0.5780268", "0.57483566", "0.5742065", "0.5730158", "0.57268995", "0.57251793", "0.5718451", "0.5717724", "0.57123303", "0.57065934", "0.5701299", "0.5689747", "0.5682902", "0.56632066", "0.5662979", "0.5635141", "0.5618126", "0.5609304", "0.5600276", "0.5593077", "0.5570249", "0.5557881", "0.5554773", "0.55546904", "0.55523455", "0.5539925", "0.55391616", "0.5532996", "0.5515432", "0.5505429", "0.5490351", "0.5490351", "0.549002" ]
0.7100836
4
Make the mouse cursor express that an event is not allowed in the current area
function disableCursor() { document.body.classList.add('fc-not-allowed'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function disableCursor() {\n\t\t$('body').addClass('fc-not-allowed');\n\t}", "function disableCursor() {\n $('body').addClass('fc-not-allowed');\n }", "function ignorePendingMouseEvents() { ignore_mouse = guac_mouse.touchMouseThreshold; }", "function onMouseNothing(e) {\n e.preventDefault();\n e.stopPropagation();\n return false;\n}", "function OLcursorOff(){\r\nif(OLovertwoPI&&over==over2)return false;\r\nvar left=parseInt(over.style.left),top=parseInt(over.style.top);\r\nvar right=left+o3_width,bottom=top+((OLbubblePI&&o3_bubble)?OLbubbleHt:over.offsetHeight);\r\nif(o3_x<left||o3_x>right||o3_y<top||o3_y>bottom)return true;\r\nreturn false;\r\n}", "function disableMouse() {\n\tnoMouse = true;\n}", "function disableCursor() {\n\t$('body').addClass('fc-not-allowed');\n}", "function disableCursor() {\n\t$('body').addClass('fc-not-allowed');\n}", "function disableCursor() {\n\t$('body').addClass('fc-not-allowed');\n}", "function disableCursor() {\n\t$('body').addClass('fc-not-allowed');\n}", "function disableCursor() {\n\t$('body').addClass('fc-not-allowed');\n}", "function disableCursor() {\n\t$('body').addClass('fc-not-allowed');\n}", "function disableCursor() {\n\t$('body').addClass('fc-not-allowed');\n}", "function disableCursor() {\n\t$('body').addClass('fc-not-allowed');\n}", "function disableCursor(){$('body').addClass('fc-not-allowed');}", "function enableCursor() {\n\t\t$('body').removeClass('fc-not-allowed');\n\t}", "function enableCursor(){$('body').removeClass('fc-not-allowed');}", "function disableCursor() {\n document.body.classList.add('fc-not-allowed');\n }", "function enableCursor() {\n $('body').removeClass('fc-not-allowed');\n }", "function escapeFlag() {\n canvas.removeEventListener('mousemove', showFlag);\n canvas_flag_active = false;\n canvas_flag_position = {x:undefined,y:undefined};\n}", "function mousePressed() {\n return false;\n}", "function disableCursor() {\n $('body').addClass('fc-not-allowed');\n}", "function disableCursor() {\n $('body').addClass('fc-not-allowed');\n}", "function disableCursor() {\n $('body').addClass('fc-not-allowed');\n}", "function disableCursor() {\n $('body').addClass('fc-not-allowed');\n}", "function mousePressed(){\n\treturn false;\n}", "function mousePressed(e) {\n return false;\n}", "function enableCursor() {\n\t$('body').removeClass('fc-not-allowed');\n}", "function enableCursor() {\n\t$('body').removeClass('fc-not-allowed');\n}", "function enableCursor() {\n\t$('body').removeClass('fc-not-allowed');\n}", "function enableCursor() {\n\t$('body').removeClass('fc-not-allowed');\n}", "function enableCursor() {\n\t$('body').removeClass('fc-not-allowed');\n}", "function enableCursor() {\n\t$('body').removeClass('fc-not-allowed');\n}", "function enableCursor() {\n\t$('body').removeClass('fc-not-allowed');\n}", "function enableCursor() {\n\t$('body').removeClass('fc-not-allowed');\n}", "function onMouseUp(event){if(preventMouseUp){event.preventDefault();}}", "function cursorOff() {\r\n\tvar left = parseInt(over.style.left);\r\n\tvar top = parseInt(over.style.top);\r\n\tvar right = left + (over.offsetWidth >= parseInt(o3_width) ? over.offsetWidth : parseInt(o3_width));\r\n\tvar bottom = top + (over.offsetHeight >= o3_aboveheight ? over.offsetHeight : o3_aboveheight);\r\n\r\n\tif (o3_x < left || o3_x > right || o3_y < top || o3_y > bottom) return true;\r\n\r\n\treturn false;\r\n}", "function disablePointSelection(){\r\n\taddPointMode = false;\r\n}", "function ignoreDragging() {\n try {\n window.event.returnValue = false; }\n catch (e) {}\n return false; }", "function shadow_cursorOff() {\n var left = parseInt(over.style.left);\n var top = parseInt(over.style.top);\n var right = left + (o3_shadow ? o3_width : over.offsetWidth);\n var bottom = top + (o3_shadow ? o3_aboveheight : over.offsetHeight);\n\n if (o3_x < left || o3_x > right || o3_y < top || o3_y > bottom) return true;\n return false;\n }", "function enableCursor() {\n $('body').removeClass('fc-not-allowed');\n}", "function enableCursor() {\n $('body').removeClass('fc-not-allowed');\n}", "function enableCursor() {\n $('body').removeClass('fc-not-allowed');\n}", "function enableCursor() {\n $('body').removeClass('fc-not-allowed');\n}", "function enableCursor() {\n document.body.classList.remove('fc-not-allowed');\n }", "function enableCursor() {\n document.body.classList.remove('fc-not-allowed');\n }", "function enableCursor() {\n document.body.classList.remove('fc-not-allowed');\n }", "function enableCursor() {\n document.body.classList.remove('fc-not-allowed');\n }", "function enableMouse() {\n\tnoMouse = false;\n}", "function enableCursor() {\n document.body.classList.remove('fc-not-allowed');\n }", "function disableMouse(clic) {\r\n document.addEventListener(\"click\", e => {\r\n if (clic) {\r\n e.stopPropagation();\r\n e.preventDefault();\r\n }\r\n }, true);\r\n}", "function noCursor() {\n _displaycontrol &= ~LCD_CURSORON;\n command(LCD_DISPLAYCONTROL | _displaycontrol);\n}", "function disablePoint() {\n\t if (!_enabled) {\n\t return;\n\t }\n\t\n\t _enabled = false;\n\t document.removeEventListener('mouseup', handleDocumentMouseup);\n\t}", "function myUp(){\n canvas.onmousemove=null;\n}", "function disableCursor() {\n document.body.classList.add('fc-not-allowed');\n}", "function __onMouseSelectionBlocker() {\n $('body').addClass('wcDisableSelection');\n }", "function dontPosSelect() {\n return false;\n }", "function myUp() {\n canvas.onmousemove = null;\n}", "function fix_mouse(e,a)\n{\n\tif ( e && e.preventDefault )\n\te.preventDefault();\n\telse \n\twindow.event.returnValue=false;\n\ta.focus();\n\n}", "function themeMouseMove() {\n screen_has_mouse = true;\n }", "function handleMouseMove(evt){\n\t\tdocument.getElementById(\"box\").style.cursor=\"crosshair\";\n\t}", "function hide_cursor() {\n // canvas objects that show stim/probes\n var canvas = document.getElementById('task_box');\n canvas.style.cursor = 'none';\n }", "function mouseOff() {\r\ndocument.body.style.cursor = \"default\";\r\n}", "function disable() {\n mouse_highlight.destroy();\n}", "mousemove_handler(e) {\n if (!this.mouseDown) { return true; }\n\n const local = this.getLocalCoords(this.mainCanvas, e);\n\n this.scratchLine(local.x, local.y, false);\n\n e.preventDefault();\n return false;\n }", "function cursorInBounds() {\n var boundOb = $(event.currentTarget);\n try {boundOb.offset();} catch {return false;}\n var xTest = boundOb.offset().left;\n var yTest = boundOb.offset().top;\n\n if(event.pageX >= xTest && event.pageY >= yTest && event.pageX <= xTest+boundOb.width() && event.pageY <= yTest+boundOb.height()) {\n return true;\n }\n return false;\n}", "function cursorInvisible() {\r\n\r\n\t\tcursorTime = cursorTime-1; //decrease time by 1\r\n\r\n\t\tif(cursorTime == 0) {\r\n\t\t\t$('body').css(\"cursor\", \"none\");\r\n\t\t\tclearInterval(cursor);\r\n\t\t}; //if time = 0, cursor disappears\r\n\r\n\t}", "function dontDraw() {\n coordinates = getCanvasMousePosition(canvas, event)\n\n //For loop to loop through panels and check if the mouse position is at the bottom right corner of one of the panels\n for(let i = 0; i < panels[whichPanel].length; i++)\n {\n if(coordinates.x > (panels[whichPanel][i].width + panels[whichPanel][i].x - 5) && coordinates.x < (panels[whichPanel][i].width + panels[whichPanel][i].x + 5))\n {\n if(coordinates.y > (panels[whichPanel][i].height + panels[whichPanel][i].y - 5) && coordinates.y < (panels[whichPanel][i].height + panels[whichPanel][i].y + 5))\n {\n changeCursor(\"nw-resize\")\n document.removeEventListener('mousedown', whileDrawing)\n break\n }\n }\n //Loop to check if the cursor is in the top left for moving\n else if(coordinates.x > panels[whichPanel][i].x - 5 && coordinates.x < panels[whichPanel][i].x + 5)\n {\n if(coordinates.y > panels[whichPanel][i].y - 5 && coordinates.y < panels[whichPanel][i].y + 5)\n {\n changeCursor(\"move\")\n document.removeEventListener('mousedown', whileDrawing)\n break\n }\n }\n else if(coordinates.y > canvas.height*0.93)\n {\n document.removeEventListener('mousedown', whileDrawing)\n }\n else\n {\n changeCursor(\"default\")\n document.addEventListener('mousedown', whileDrawing)\n }\n }\n}", "function handleMouseUp(evt)\r\n{\r\n\tisClicked = false;\r\n\tmapFrame.style.cursor = \"default\";\r\n}", "function mouseReleased() {\n stamped =false;\n}", "function gcb_ignoreClick (x, y, nopop, noadd)\r\n{\r\n for (var i=0;i<gcb_clickPointX.length;i++)\r\n {\r\n var testX = gcb_clickPointX[i];\r\n var testY = gcb_clickPointY[i];\r\n\t\t// Hack by Nex: we don't need threshold\r\n //if ( ( Math.abs(x - testX) < 15 ) && ( Math.abs(y - testY) < 15 ) )\r\n if ((x == testX) && (y == testY))\r\n return true;\r\n }\r\n\tif (!noadd)\r\n\t\tgcb_addClick (x, y, nopop);\r\n return false;\r\n}", "function u(e){if(!m(e))return Q.props.interactive?(document.body.addEventListener(\"mouseleave\",s),void document.addEventListener(\"mousemove\",Y)):void s()}", "function noDragStart() {\r\n return false;\r\n}", "function stopDraw(e) {\n\t\tbrush_size = 1;\n\t\te.preventDefault();\n\t\tcanvas.onmousemove = null;\t\n\t}", "canBeInteractedWith() { return false; }", "function mouseReleased() {\r\n mouseIsDown = false;\r\n}", "function mouseReleased(){\n\tdrawing = false;\n}", "function noDragStart() {\n return false;\n}", "function noDragStart() {\n return false;\n}", "function noDragStart() {\n return false;\n}", "function disableMouseTouch() {\n var originalOnTouch = L.Draw.Polyline.prototype._onTouch;\n L.Draw.Polyline.prototype._onTouch = e => {\n if( e.originalEvent.pointerType != 'mouse' ) {\n return originalOnTouch.call(this, e);\n }\n }\n }", "function mouseLeaveEvent() {\n\tleft_click_drag_flag = false;\n\tright_click_drag_flag = false;\n}", "static _lockChangeAlert() {\n const canvas = EngineToolbox.getCanvas();\n if (document.pointerLockElement === canvas) {\n document.addEventListener(\"mousemove\", Input._updatePosition, false);\n } else {\n document.removeEventListener(\"mousemove\", Input._updatePosition, false);\n }\n }", "_onMouseUp () {\n Actions.changeDragging(false);\n }", "function enableCursor() {\n document.body.classList.remove('fc-not-allowed');\n}", "async mouseAway() {\n await this._actions().mouseMove(this.element(), { x: -1, y: -1 }).perform();\n await this._stabilize();\n }", "function Start()\n{\n Cursor.visible = false;\n}", "function mouseReleased() {\n UseCases.forEach( function( obj ) {\n obj.locked = false;\n });\n\n Actors.forEach( function( obj ) {\n obj.locked = false;\n });\n}", "cancelXPointerEntry() {\n this.$el.find(\".cb-xf-xpointer\").removeClass('active');\n this.toggleXPointer();\n }", "function onMouseClick(event) {\n freeze = !freeze;\n }", "function mouseDragged() {\n if (!running) {\n var x = parseInt(mouseX / w);\n var y = parseInt(mouseY / h);\n if (pencil) {\n try {\n grid[x][y].obstacle = true;\n start.obstacle = false;\n } catch (error) {\n console.log(\"Click out of canvas\");\n }\n } else if (eraser) {\n try {\n grid[x][y].obstacle = false;\n } catch (error) {\n console.log(\"Click out of canvas\");\n }\n }\n\n if (cursorX !== x || cursorY !== y) {\n cursorX = x.valueOf();\n cursorY = y.valueOf();\n }\n }\n\n return false;\n}", "function validatePosition(){\n if (cursorPos.x < 0){\n cursorPos.x = 0;\n }\n\n if (cursorPos.x + img.width > canvasCrosshair.width){\n cursorPos.x = canvasCrosshair.width - img.width;\n }\n\n if (cursorPos.y < 0){\n cursorPos.y = 0;\n }\n\n if (cursorPos.y +img.height > canvasCrosshair.height){\n cursorPos.y = canvasCrosshair.height - img.height;\n }\n\n}", "function Start()\n{\n Screen.showCursor = false;\n}", "function out(e) {\n // Remove the move cursor and green box-shadow\n e.target.style.cursor = '';\n e.target.style.boxShadow = '';\n}", "function onMouseUp(event) {\n if (preventMouseUp) {\n event.preventDefault();\n }\n }", "function mouseOutOfRegion(e) {\n // reset the hover state, returning the border to normal\n e.feature.setProperty(\"state\", \"normal\");\n}", "function mOvr(src) {\r\n\t/*\r\n\tif (!src.contains(event.FROMElement)) {\r\n\t\t src.style.cursor = 'hand';\r\n\t}\r\n\t*/\r\n\t//\tCON INTERNETEXPLORER VIEJO DA ERROR.... COMPROBAR QUE CON LAS DEMAS NO LO DA\r\n}" ]
[ "0.70906544", "0.6955675", "0.69034046", "0.6894298", "0.6821689", "0.68163365", "0.68157244", "0.68157244", "0.68157244", "0.68157244", "0.68157244", "0.68157244", "0.68157244", "0.68157244", "0.680039", "0.66946816", "0.66603494", "0.6659255", "0.66155076", "0.66128623", "0.66115725", "0.65954125", "0.65954125", "0.65954125", "0.65954125", "0.6584239", "0.6521556", "0.6506759", "0.6506759", "0.6506759", "0.6506759", "0.6506759", "0.6506759", "0.6506759", "0.6506759", "0.6498283", "0.64454806", "0.6427505", "0.64186233", "0.6412091", "0.63558716", "0.63558716", "0.63558716", "0.63558716", "0.6339619", "0.6339619", "0.6339619", "0.6339619", "0.6322842", "0.6319411", "0.62875813", "0.6283931", "0.62763464", "0.6260573", "0.62408626", "0.623752", "0.6233903", "0.6213627", "0.61977506", "0.61759734", "0.61724436", "0.6155022", "0.61528987", "0.6145957", "0.6132209", "0.61142546", "0.6104838", "0.61032254", "0.6092247", "0.6090441", "0.60838103", "0.6080536", "0.6072886", "0.60648614", "0.6056983", "0.6054257", "0.60426503", "0.6038792", "0.6038792", "0.6038792", "0.60362333", "0.6032223", "0.6030163", "0.6015972", "0.59849644", "0.59620386", "0.5959852", "0.5959052", "0.5957257", "0.59501904", "0.5947316", "0.5943319", "0.59430265", "0.59261936", "0.5919053", "0.5903747", "0.5895383" ]
0.6657292
21
Returns the mouse cursor to its original look
function enableCursor() { document.body.classList.remove('fc-not-allowed'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeCursor(newCursor) {\n canvas.style.cursor = newCursor\n}", "showCursor() {\n this.canvas.style.cursor = CURRENT_CURSOR;\n }", "get cursor() {\n return this.element.style.cursor;\n }", "function getCursor() {\r\n\treturn [cursorLine,cursorColumn];\r\n}", "function deriveCursorForDocument(paramMouseX, paramMouseY, paramDocument) {\r\n\r\n\t// Calculate line and column number based on mouse position\r\n\tvar currow = Math.floor((mouseY - PADDING_TOP)/FONT_HEIGHT);\r\n\tvar curcol = Math.floor((mouseX - PADDING_LEFT)/FONT_WIDTH);\r\n\t\r\n\t// Perform sanity check on calculated values:\r\n\t// If the calculated line is below the last line, then set cursor at last character in document\r\n\tif (currow > paramDocument.getDocumentLength()-1) {\r\n\t\tcurrow = paramDocument.getDocumentLength()-1;\r\n\t\tcurcol = paramDocument.getLineLength( paramDocument.getDocumentLength() );\r\n\t}\r\n\t// If the calculated cursor is beyond the first or last character in a line, \r\n\t// then set the cursor to the first or last character, respectively\r\n\telse {\t\t\r\n\t\tif ( curcol < 0 ) curcol = 0;\r\n\t\tif ( curcol > paramDocument.getLineLength(currow) ) curcol = paramDocument.getLineLength(currow);\r\n\t}\r\n\t\r\n\t// Before we move the cursor there, make sure that the line isn't locked\r\n\tif( paramDocument.getLineLockingUser( currow ) != null ){\r\n\t\talert(\"Another user is currently on line \"+currow+\", and it is locked.\");\r\n\t\treturn;\r\n\t}\r\n\t\r\n\t// Store the calculated values\r\n\tsetCursor(currow,curcol);\r\n}", "function changeCursor (evt) {\n\t\t\t\tif (evt.dragging) { return;}\n\t\t\t\tvar pixel = GlobalMap.getEventPixel(evt.originalEvent);\n\t\t\t\tvar hit = GlobalMap.hasFeatureAtPixel(pixel, {layerFilter: function(layer){\n\t\t\t\t\treturn isEditLayerPopupOnInfo || layer.get('name') !== 'EditLayer';\n\t\t\t\t}});\n\t\t\t\tGlobalMap.getTargetElement().style.cursor = hit ? 'pointer' : '';\n\n\t}", "GetCursorScreenPos()\n {\n let win = this.getCurrentWindowRead();\n return win.DC.CursorPos.Clone();\n }", "function updateSelectionCursor(cm) {\n var display = cm.display, pos = cursorCoords(cm, cm.doc.sel.head, \"div\");\n display.cursor.style.left = pos.left + \"px\";\n display.cursor.style.top = pos.top + \"px\";\n display.cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n display.cursor.style.display = \"\";\n\n if (pos.other) {\n display.otherCursor.style.display = \"\";\n display.otherCursor.style.left = pos.other.left + \"px\";\n display.otherCursor.style.top = pos.other.top + \"px\";\n display.otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n } else { display.otherCursor.style.display = \"none\"; }\n }", "function updateSelectionCursor(cm) {\n var display = cm.display, pos = cursorCoords(cm, cm.doc.sel.head, \"div\");\n display.cursor.style.left = pos.left + \"px\";\n display.cursor.style.top = pos.top + \"px\";\n display.cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n display.cursor.style.display = \"\";\n\n if (pos.other) {\n display.otherCursor.style.display = \"\";\n display.otherCursor.style.left = pos.other.left + \"px\";\n display.otherCursor.style.top = pos.other.top + \"px\";\n display.otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n } else { display.otherCursor.style.display = \"none\"; }\n }", "function updateSelectionCursor(cm) {\n var display = cm.display, pos = cursorCoords(cm, cm.doc.sel.head, \"div\");\n display.cursor.style.left = pos.left + \"px\";\n display.cursor.style.top = pos.top + \"px\";\n display.cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n display.cursor.style.display = \"\";\n\n if (pos.other) {\n display.otherCursor.style.display = \"\";\n display.otherCursor.style.left = pos.other.left + \"px\";\n display.otherCursor.style.top = pos.other.top + \"px\";\n display.otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n } else { display.otherCursor.style.display = \"none\"; }\n }", "function updateSelectionCursor(cm) {\n var display = cm.display, pos = cursorCoords(cm, cm.doc.sel.head, \"div\");\n display.cursor.style.left = pos.left + \"px\";\n display.cursor.style.top = pos.top + \"px\";\n display.cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n display.cursor.style.display = \"\";\n\n if (pos.other) {\n display.otherCursor.style.display = \"\";\n display.otherCursor.style.left = pos.other.left + \"px\";\n display.otherCursor.style.top = pos.other.top + \"px\";\n display.otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n } else { display.otherCursor.style.display = \"none\"; }\n }", "setMouseCursor (type = 'crosshair') {\n this.canvas.style.cursor = type;\n }", "function CursorInfo() { }", "static SetCursor() {}", "function updateSelectionCursor(cm) {\n var display = cm.display, pos = cursorCoords(cm, cm.view.sel.head, \"div\");\n display.cursor.style.left = pos.left + \"px\";\n display.cursor.style.top = pos.top + \"px\";\n display.cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n display.cursor.style.display = \"\";\n\n if (pos.other) {\n display.otherCursor.style.display = \"\";\n display.otherCursor.style.left = pos.other.left + \"px\";\n display.otherCursor.style.top = pos.other.top + \"px\";\n display.otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n } else { display.otherCursor.style.display = \"none\"; }\n }", "function updateSelectionCursor(cm) {\n var display = cm.display, pos = cursorCoords(cm, cm.view.sel.head, \"div\");\n display.cursor.style.left = pos.left + \"px\";\n display.cursor.style.top = pos.top + \"px\";\n display.cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n display.cursor.style.display = \"\";\n\n if (pos.other) {\n display.otherCursor.style.display = \"\";\n display.otherCursor.style.left = pos.other.left + \"px\";\n display.otherCursor.style.top = pos.other.top + \"px\";\n display.otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n } else { display.otherCursor.style.display = \"none\"; }\n }", "function updateSelectionCursor(cm) {\n var display = cm.display, pos = cursorCoords(cm, cm.view.sel.head, \"div\");\n display.cursor.style.left = pos.left + \"px\";\n display.cursor.style.top = pos.top + \"px\";\n display.cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n display.cursor.style.display = \"\";\n\n if (pos.other) {\n display.otherCursor.style.display = \"\";\n display.otherCursor.style.left = pos.other.left + \"px\";\n display.otherCursor.style.top = pos.other.top + \"px\";\n display.otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n } else { display.otherCursor.style.display = \"none\"; }\n }", "onMouseMove(e) {\n this.setCursor(this.cursor);\n }", "function drawSelectionCursor(cm, head, output) {\n\t\t var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n\t\t var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n\t\t cursor.style.left = pos.left + \"px\";\n\t\t cursor.style.top = pos.top + \"px\";\n\t\t cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n\t\t if (/\\bcm-fat-cursor\\b/.test(cm.getWrapperElement().className)) {\n\t\t var charPos = charCoords(cm, head, \"div\", null, null);\n\t\t var width = charPos.right - charPos.left;\n\t\t cursor.style.width = (width > 0 ? width : cm.defaultCharWidth()) + \"px\";\n\t\t }\n\n\t\t if (pos.other) {\n\t\t // Secondary cursor, shown when on a 'jump' in bi-directional text\n\t\t var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n\t\t otherCursor.style.display = \"\";\n\t\t otherCursor.style.left = pos.other.left + \"px\";\n\t\t otherCursor.style.top = pos.other.top + \"px\";\n\t\t otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n\t\t }\n\t\t }", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (/\\bcm-fat-cursor\\b/.test(cm.getWrapperElement().className)) {\n var charPos = charCoords(cm, head, \"div\", null, null);\n var width = charPos.right - charPos.left;\n cursor.style.width = (width > 0 ? width : cm.defaultCharWidth()) + \"px\";\n }\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (/\\bcm-fat-cursor\\b/.test(cm.getWrapperElement().className)) {\n var charPos = charCoords(cm, head, \"div\", null, null);\n var width = charPos.right - charPos.left;\n cursor.style.width = (width > 0 ? width : cm.defaultCharWidth()) + \"px\";\n }\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "_setCursorToPointer() {\n document.body.style.cursor = 'pointer';\n }", "function setCursores(){\n\timgCursor(ultimoevt);\n\tget('wcr_btn-1').style.cursor = cursor(-1, 'btns');\n\tget('wcr_btn1').style.cursor = cursor(1, 'btns');\n}", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, head, output) {\n\t var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n\t var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n\t cursor.style.left = pos.left + \"px\";\n\t cursor.style.top = pos.top + \"px\";\n\t cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n\t if (pos.other) {\n\t // Secondary cursor, shown when on a 'jump' in bi-directional text\n\t var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n\t otherCursor.style.display = \"\";\n\t otherCursor.style.left = pos.other.left + \"px\";\n\t otherCursor.style.top = pos.other.top + \"px\";\n\t otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n\t }\n\t }", "function drawSelectionCursor(cm, head, output) {\n\t var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n\t var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n\t cursor.style.left = pos.left + \"px\";\n\t cursor.style.top = pos.top + \"px\";\n\t cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n\t if (pos.other) {\n\t // Secondary cursor, shown when on a 'jump' in bi-directional text\n\t var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n\t otherCursor.style.display = \"\";\n\t otherCursor.style.left = pos.other.left + \"px\";\n\t otherCursor.style.top = pos.other.top + \"px\";\n\t otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n\t }\n\t }", "function holdCursor() {\n changeCursor(\"move\")\n }", "function drawSelectionCursor(cm, head, output) {\n\t var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\t\n\t var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n\t cursor.style.left = pos.left + \"px\";\n\t cursor.style.top = pos.top + \"px\";\n\t cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\t\n\t if (pos.other) {\n\t // Secondary cursor, shown when on a 'jump' in bi-directional text\n\t var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n\t otherCursor.style.display = \"\";\n\t otherCursor.style.left = pos.other.left + \"px\";\n\t otherCursor.style.top = pos.other.top + \"px\";\n\t otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n\t }\n\t }", "GetCursorPos()\n {\n let win = this.getCurrentWindowRead();\n return new Vec2(win.DC.CursorPos.x - win.Pos.x + win.Scroll.x,\n win.DC.CursorPos.y - win.Pos.y + win.Scroll.y);\n }", "setCursor(type) {\n CURRENT_CURSOR = type;\n this.showCursor();\n }", "function drawSelectionCursor(cm, head, output) {\n\t\t var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\t\t\n\t\t var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n\t\t cursor.style.left = pos.left + \"px\";\n\t\t cursor.style.top = pos.top + \"px\";\n\t\t cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\t\t\n\t\t if (pos.other) {\n\t\t // Secondary cursor, shown when on a 'jump' in bi-directional text\n\t\t var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n\t\t otherCursor.style.display = \"\";\n\t\t otherCursor.style.left = pos.other.left + \"px\";\n\t\t otherCursor.style.top = pos.other.top + \"px\";\n\t\t otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n\t\t }\n\t\t }", "function setCursor( look )\n{\n\tdocument.body.style.cursor = look;\n}", "function setCursor(x, y, select){\n cursor.x = x\n cursor.y = y\n cursor.selected = select\n display.setCursor(x,y,select)\n }", "setPanCursorDown() {\n this.setCursor(ToolkitUtils.getGrabbingCursor());\n }", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine)\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"))\n cursor.style.left = pos.left + \"px\"\n cursor.style.top = pos.top + \"px\"\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\"\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"))\n otherCursor.style.display = \"\"\n otherCursor.style.left = pos.other.left + \"px\"\n otherCursor.style.top = pos.other.top + \"px\"\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\"\n }\n}", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine)\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"))\n cursor.style.left = pos.left + \"px\"\n cursor.style.top = pos.top + \"px\"\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\"\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"))\n otherCursor.style.display = \"\"\n otherCursor.style.left = pos.other.left + \"px\"\n otherCursor.style.top = pos.other.top + \"px\"\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\"\n }\n}", "function drawSelectionCursor(cm, head, output) {\r\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\r\n\r\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\r\n cursor.style.left = pos.left + \"px\";\r\n cursor.style.top = pos.top + \"px\";\r\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\r\n\r\n if (pos.other) {\r\n // Secondary cursor, shown when on a 'jump' in bi-directional text\r\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\r\n otherCursor.style.display = \"\";\r\n otherCursor.style.left = pos.other.left + \"px\";\r\n otherCursor.style.top = pos.other.top + \"px\";\r\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\r\n }\r\n}", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n}", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n}", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n}", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n}", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n}", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n}", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n}", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n}", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n}", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n}", "function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n}", "update() {\n // Reset local scroll data after updating\n this.cursor.wheel.deltaY = this._wheelDeltaY;\n this._wheelDeltaY = 0;\n\n this.cursor.prevPosition.copy(this.cursor.position);\n this.cursor.position.copy(this._currentPosition);\n\n return this.cursor;\n }", "restoreCursor(params) {\n this._bufferService.buffer.x = this._bufferService.buffer.savedX || 0;\n this._bufferService.buffer.y = Math.max(this._bufferService.buffer.savedY - this._bufferService.buffer.ybase, 0);\n this._curAttrData.fg = this._bufferService.buffer.savedCurAttrData.fg;\n this._curAttrData.bg = this._bufferService.buffer.savedCurAttrData.bg;\n this._charsetService.charset = this._savedCharset;\n if (this._bufferService.buffer.savedCharset) {\n this._charsetService.charset = this._bufferService.buffer.savedCharset;\n }\n this._restrictCursor();\n return true;\n }", "mouseMove(prev, pt) {}", "function restoreCursor() {\n if (inputRef.value && selectionRef.value && focused.value) {\n try {\n var value = inputRef.value.value;\n var _selectionRef$value = selectionRef.value,\n beforeTxt = _selectionRef$value.beforeTxt,\n afterTxt = _selectionRef$value.afterTxt,\n start = _selectionRef$value.start;\n var startPos = value.length;\n if (value.endsWith(afterTxt)) {\n startPos = value.length - selectionRef.value.afterTxt.length;\n } else if (value.startsWith(beforeTxt)) {\n startPos = beforeTxt.length;\n } else {\n var beforeLastChar = beforeTxt[start - 1];\n var newIndex = value.indexOf(beforeLastChar, start - 1);\n if (newIndex !== -1) {\n startPos = newIndex + 1;\n }\n }\n inputRef.value.setSelectionRange(startPos, startPos);\n } catch (e) {\n (0,_vc_util_warning__WEBPACK_IMPORTED_MODULE_1__.warning)(false, \"Something warning of cursor restore. Please fire issue about this: \".concat(e.message));\n }\n }\n }", "function getMouse(selector)\n {\n var selector = selector;\n var input = document.getElementById(selector);\n var startPosition = input.selectionStart;\n var endPosition = input.selectionEnd;\n return {start: startPosition, end: endPosition};\n }", "lookAtMouse () {\n\t\tconst diff = this.lastMousePosition.subtract(this.position);\n\t\tthis.setDirection(diff);\n\t}", "get CursorElement() { return this.cursorElement; }", "function dropCursor() {\n return [dropCursorPos, drawDropCursor];\n}", "function cursorInScene( cursor = \"crosshair\" ){\n\t\n\tdocument.getElementById(\"renderSpace\").style.cursor = cursor;\n\t\n}", "function cursorCell() {\n\t\t\treturn cellAt(cursor.y, cursor.x);\n\t\t}", "function updateCursor() {\n var start, end, x, y, i, el, cls;\n\n if (typeof cursor === 'undefined') {\n return;\n }\n\n if (cursor.getAttribute('id') !== 'cursor') {\n return;\n }\n\n start = input.selectionStart;\n end = input.selectionEnd;\n if (start > end) {\n end = input.selectionStart;\n start = input.selectionEnd;\n }\n\n if (editor.childNodes.length <= start) {\n return;\n }\n\n el = editor.childNodes[start];\n if (el) {\n x = el.offsetLeft;\n y = el.offsetTop;\n cursor.style.left = x + 'px';\n cursor.style.top = y + 'px';\n cursor.style.opacity = 1;\n }\n\n // If there is a selection, add the CSS class 'selected'\n // to all nodes inside the selection range.\n cursor.style.opacity = (start === end) ? 1 : 0;\n for (i = 0; i < editor.childNodes.length; i += 1) {\n el = editor.childNodes[i];\n cls = el.getAttribute('class');\n if (cls !== null) {\n cls = cls.replace(' selected', '');\n if (i >= start && i < end) {\n cls += ' selected';\n }\n el.setAttribute('class', cls);\n }\n }\n }", "function detectCursorGrab() {\r\n if (!self.isie || self.isie9) { // some old IE return false positive\r\n var lst = ['grab', '-moz-grab', '-webkit-grab'];\r\n for (var a = 0; a < lst.length; a++) {\r\n var p = lst[a];\r\n domtest.style['cursor'] = p;\r\n if (domtest.style['cursor'] == p) return p;\r\n }\r\n }\r\n return 'url(http://www.google.com/intl/en_ALL/mapfiles/openhand.cur),n-resize';\r\n }", "changeToMove(){document.body.style.cursor = \"move\";}", "function restoreCursor() {\n if (input && selectionRef.current && focused) {\n try {\n var value = input.value;\n var _selectionRef$current = selectionRef.current,\n beforeTxt = _selectionRef$current.beforeTxt,\n afterTxt = _selectionRef$current.afterTxt,\n start = _selectionRef$current.start;\n var startPos = value.length;\n\n if (value.endsWith(afterTxt)) {\n startPos = value.length - selectionRef.current.afterTxt.length;\n } else if (value.startsWith(beforeTxt)) {\n startPos = beforeTxt.length;\n } else {\n var beforeLastChar = beforeTxt[start - 1];\n var newIndex = value.indexOf(beforeLastChar, start - 1);\n\n if (newIndex !== -1) {\n startPos = newIndex + 1;\n }\n }\n\n input.setSelectionRange(startPos, startPos);\n } catch (e) {\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_rc_util_es_warning__[\"a\" /* default */])(false, \"Something warning of cursor restore. Please fire issue about this: \".concat(e.message));\n }\n }\n }", "function appxGetCursorPos() {\r\n var c = appxFixCursorCol(ab2int32(appx_session.current_show.cursorcol));\r\n var r = appxFixCursorRow(ab2int32(appx_session.current_show.cursorrow));\r\n return {\r\n \"col\": c,\r\n \"row\": r\r\n };\r\n}", "function getCursorMode() {\n cursorMode = {\n brush: $('#brushRadio').is(':checked'),\n select: $('#selectRadio').is(':checked'),\n };\n}", "function updateCursor()\n {\n var ctx = cursorCanvas.getContext(\"2d\");\n\n // convert penColor to rgb\n var elem = document.body.appendChild(document.createElement('fictum'));\n elem.style.color = penColor;\n var color = getComputedStyle(elem).color;\n var rgb = color.substring(color.indexOf('(')+1, color.lastIndexOf(')')).split(/,\\s*/);\n document.body.removeChild(elem);\n\n // setup color gradient with pen color\n var col1 = \"rgba(\" + rgb[0] + \",\" + rgb[1] + \",\" + rgb[2] + \",1.0)\";\n var col2 = \"rgba(\" + rgb[0] + \",\" + rgb[1] + \",\" + rgb[2] + \",0.0)\";\n var grdPen = ctx.createRadialGradient(10, 10, 1, 10, 10, 3);\n grdPen.addColorStop(0, col1);\n grdPen.addColorStop(1, col2);\n\n // render pen cursor\n ctx.clearRect(0, 0, 20, 20); \n ctx.fillStyle = grdPen;\n ctx.fillRect(0, 0, 20, 20);\n penCursor = \"url(\" + cursorCanvas.toDataURL() + \") 10 10, auto\";\n\n // render eraser cursor\n ctx.clearRect(0, 0, 20, 20); \n ctx.strokeStyle = \"rgba(128, 128, 128, 0.8)\";\n ctx.fillStyle = \"rgba(255, 255, 255, 0.8)\";\n ctx.lineWidth = 1;\n ctx.beginPath();\n ctx.arc(10, 10, eraserRadius*Reveal.getScale(), 0, 2*Math.PI);\n ctx.fill(); \n ctx.stroke(); \n eraserCursor = \"url(\" + cursorCanvas.toDataURL() + \") 10 10, auto\";\n\n // reset cursor\n container.style.cursor = tool ? 'none' : '';\n }", "function cursorHoldLoc(x,y) {\n pointingAtX = x;\n pointingAtY = y; \n forceFocus(); }", "function CursorTrack() {}", "_setCursorToDefault() {\n document.body.style.cursor = 'default';\n }", "function drawSelectionCursor(cm, range, output) {\n var pos = cursorCoords(cm, range.head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, range, output) {\n var pos = cursorCoords(cm, range.head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, range, output) {\n var pos = cursorCoords(cm, range.head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, range, output) {\n var pos = cursorCoords(cm, range.head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, range, output) {\n var pos = cursorCoords(cm, range.head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, range, output) {\n var pos = cursorCoords(cm, range.head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function drawSelectionCursor(cm, range, output) {\n var pos = cursorCoords(cm, range.head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }", "function restoreCursor() {\n if (input && selectionRef.current && focused) {\n try {\n var value = input.value;\n var _selectionRef$current = selectionRef.current,\n beforeTxt = _selectionRef$current.beforeTxt,\n afterTxt = _selectionRef$current.afterTxt,\n start = _selectionRef$current.start;\n var startPos = value.length;\n\n if (value.endsWith(afterTxt)) {\n startPos = value.length - selectionRef.current.afterTxt.length;\n } else if (value.startsWith(beforeTxt)) {\n startPos = beforeTxt.length;\n } else {\n var beforeLastChar = beforeTxt[start - 1];\n var newIndex = value.indexOf(beforeLastChar, start - 1);\n\n if (newIndex !== -1) {\n startPos = newIndex + 1;\n }\n }\n\n input.setSelectionRange(startPos, startPos);\n } catch (e) {\n (0,rc_util_es_warning__WEBPACK_IMPORTED_MODULE_1__.default)(false, \"Something warning of cursor restore. Please fire issue about this: \".concat(e.message));\n }\n }\n }", "function getMousePos() {\n\t\t\t\t\t\t\treturn (mouseTopPerc * 400) + 10;\n\t\t\t\t\t\t}", "cursorTo() {}", "function drawSelectionCursor(cm, range, output) {\r\n var pos = cursorCoords(cm, range.head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\r\n\r\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\r\n cursor.style.left = pos.left + \"px\";\r\n cursor.style.top = pos.top + \"px\";\r\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\r\n\r\n if (pos.other) {\r\n // Secondary cursor, shown when on a 'jump' in bi-directional text\r\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\r\n otherCursor.style.display = \"\";\r\n otherCursor.style.left = pos.other.left + \"px\";\r\n otherCursor.style.top = pos.other.top + \"px\";\r\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\r\n }\r\n }", "function crosshairCursor(options = {}) {\n let [code, getter] = keys[options.key || \"Alt\"];\n let plugin = ViewPlugin.fromClass(class {\n constructor(view) {\n this.view = view;\n this.isDown = false;\n }\n set(isDown) {\n if (this.isDown != isDown) {\n this.isDown = isDown;\n this.view.update([]);\n }\n }\n }, {\n eventHandlers: {\n keydown(e) {\n this.set(e.keyCode == code || getter(e));\n },\n keyup(e) {\n if (e.keyCode == code || !getter(e))\n this.set(false);\n },\n mousemove(e) {\n this.set(getter(e));\n }\n }\n });\n return [\n plugin,\n EditorView.contentAttributes.of(view => { var _a; return ((_a = view.plugin(plugin)) === null || _a === void 0 ? void 0 : _a.isDown) ? showCrosshair : null; })\n ];\n}", "externalActiveMouseMove() {\n //TODO: check for mouse button active\n this._strikeActiveMouseMove();\n this._localPointer._mouseX = this.getPointer()._mouseX;\n this._localPointer._mouseY = this.getPointer()._mouseY;\n }", "function ksfCanvas_setCursor(cursor)\n{\n\t$(GRAPH_ID).css( 'cursor', cursor );\n}", "GetCursorStartPos()\n {\n let win = this.getCurrentWindowRead();\n return Vec2.Subtract(win.DC.CursorStartPos, win.Pos);\n }", "function themeMouseMove() {\n screen_has_mouse = true;\n }", "function getCaret() {\n\t\tvar range = selectionRange.get_selection_range();\n\n\t\tselection.start = range[0];\n\t\tselection.end = range[1];\n\t}", "function getCursorToDrag() {\n if (opts.status === \"movable\") {\n return opts.dragableCursor;\n }\n }" ]
[ "0.6688787", "0.662058", "0.6609745", "0.6585528", "0.64344704", "0.63849705", "0.63757133", "0.6317564", "0.6317564", "0.6317564", "0.6317564", "0.6294201", "0.62843525", "0.62513316", "0.62478805", "0.62478805", "0.62478805", "0.6245575", "0.6236398", "0.62335247", "0.62335247", "0.6231953", "0.6231403", "0.6219223", "0.6219223", "0.6219223", "0.6219223", "0.6219223", "0.6219223", "0.6219223", "0.6219223", "0.6219223", "0.6219223", "0.6219223", "0.6219223", "0.6219223", "0.6219223", "0.6219223", "0.6219223", "0.6217139", "0.6217139", "0.62170506", "0.62152123", "0.6206457", "0.6206092", "0.62022656", "0.61824405", "0.61638534", "0.61243737", "0.61197037", "0.61197037", "0.611476", "0.6114646", "0.6114646", "0.6114646", "0.6114646", "0.6114646", "0.6114646", "0.6114646", "0.6114646", "0.6114646", "0.6114646", "0.6114646", "0.6112957", "0.6107434", "0.607982", "0.60690165", "0.60682076", "0.6043268", "0.6038185", "0.6036132", "0.6020044", "0.6019942", "0.5996267", "0.5991756", "0.5987533", "0.5987137", "0.59783036", "0.59644705", "0.59570843", "0.5950142", "0.5947918", "0.59469545", "0.591564", "0.591564", "0.591564", "0.591564", "0.591564", "0.591564", "0.591564", "0.5914523", "0.59125453", "0.5909724", "0.59036225", "0.59001154", "0.5868881", "0.58619475", "0.5861655", "0.58453417", "0.5844886", "0.5841296" ]
0.0
-1
Given a total available height to fill, have `els` (essentially child rows) expand to accomodate. By default, all elements that are shorter than the recommended height are expanded uniformly, not considering any other els that are already too tall. if `shouldRedistribute` is on, it considers these tall rows and reduces the available height.
function distributeHeight(els, availableHeight, shouldRedistribute) { // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions, // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars. var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE* var flexEls = []; // elements that are allowed to expand. array of DOM nodes var flexOffsets = []; // amount of vertical space it takes up var flexHeights = []; // actual css height var usedHeight = 0; undistributeHeight(els); // give all elements their natural height // find elements that are below the recommended height (expandable). // important to query for heights in a single first pass (to avoid reflow oscillation). els.forEach(function (el, i) { var minOffset = i === els.length - 1 ? minOffset2 : minOffset1; var naturalHeight = el.getBoundingClientRect().height; var naturalOffset = naturalHeight + computeVMargins(el); if (naturalOffset < minOffset) { flexEls.push(el); flexOffsets.push(naturalOffset); flexHeights.push(naturalHeight); } else { // this element stretches past recommended height (non-expandable). mark the space as occupied. usedHeight += naturalOffset; } }); // readjust the recommended height to only consider the height available to non-maxed-out rows. if (shouldRedistribute) { availableHeight -= usedHeight; minOffset1 = Math.floor(availableHeight / flexEls.length); minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE* } // assign heights to all expandable elements flexEls.forEach(function (el, i) { var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1; var naturalOffset = flexOffsets[i]; var naturalHeight = flexHeights[i]; var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding if (naturalOffset < minOffset) { // we check this again because redistribution might have changed things el.style.height = newHeight + 'px'; } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function distributeHeight(els, availableHeight, shouldRedistribute) {\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\n var flexOffsets = []; // amount of vertical space it takes up\n\n var flexHeights = []; // actual css height\n\n var usedHeight = 0;\n undistributeHeight(els); // give all elements their natural height\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n\n els.forEach(function (el, i) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = dom_geom_1.computeHeightAndMargins(el);\n\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push(el.offsetHeight);\n } else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n }); // readjust the recommended height to only consider the height available to non-maxed-out rows.\n\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n } // assign heights to all expandable elements\n\n\n flexEls.forEach(function (el, i) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n if (naturalOffset < minOffset) {\n // we check this again because redistribution might have changed things\n el.style.height = newHeight + 'px';\n }\n });\n }", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n var flexOffsets = []; // amount of vertical space it takes up\n var flexHeights = []; // actual css height\n var usedHeight = 0;\n undistributeHeight(els); // give all elements their natural height\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n els.forEach(function (el, i) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalHeight = el.getBoundingClientRect().height;\n var naturalOffset = naturalHeight + computeVMargins(el);\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push(naturalHeight);\n }\n else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n });\n // readjust the recommended height to only consider the height available to non-maxed-out rows.\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n }\n // assign heights to all expandable elements\n flexEls.forEach(function (el, i) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n if (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n el.style.height = newHeight + 'px';\n }\n });\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\n var flexOffsets = []; // amount of vertical space it takes up\n\n var flexHeights = []; // actual css height\n\n var usedHeight = 0;\n undistributeHeight(els); // give all elements their natural height\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n\n els.forEach(function (el, i) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalHeight = el.getBoundingClientRect().height;\n var naturalOffset = naturalHeight + computeVMargins(el);\n\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push(naturalHeight);\n } else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n }); // readjust the recommended height to only consider the height available to non-maxed-out rows.\n\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n } // assign heights to all expandable elements\n\n\n flexEls.forEach(function (el, i) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n if (naturalOffset < minOffset) {\n // we check this again because redistribution might have changed things\n el.style.height = newHeight + 'px';\n }\n });\n } // Undoes distrubuteHeight, restoring all els to their natural height", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n var flexOffsets = []; // amount of vertical space it takes up\n var flexHeights = []; // actual css height\n var usedHeight = 0;\n undistributeHeight(els); // give all elements their natural height\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n els.forEach(function (el, i) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalHeight = el.getBoundingClientRect().height;\n var naturalOffset = naturalHeight + computeVMargins$1(el);\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push(naturalHeight);\n }\n else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n });\n // readjust the recommended height to only consider the height available to non-maxed-out rows.\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n }\n // assign heights to all expandable elements\n flexEls.forEach(function (el, i) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n if (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n el.style.height = newHeight + 'px';\n }\n });\n }", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n var flexOffsets = []; // amount of vertical space it takes up\n var flexHeights = []; // actual css height\n var usedHeight = 0;\n undistributeHeight(els); // give all elements their natural height\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n els.forEach(function (el, i) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = computeHeightAndMargins(el);\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push(el.offsetHeight);\n }\n else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n });\n // readjust the recommended height to only consider the height available to non-maxed-out rows.\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n }\n // assign heights to all expandable elements\n flexEls.forEach(function (el, i) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n if (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n el.style.height = newHeight + 'px';\n }\n });\n }", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n\n\t// *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n\t// and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n\n\tvar minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\tvar minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\tvar flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\tvar flexOffsets = []; // amount of vertical space it takes up\n\tvar flexHeights = []; // actual css height\n\tvar usedHeight = 0;\n\n\tundistributeHeight(els); // give all elements their natural height\n\n\t// find elements that are below the recommended height (expandable).\n\t// important to query for heights in a single first pass (to avoid reflow oscillation).\n\tels.each(function(i, el) {\n\t\tvar minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = $(el).outerHeight(true);\n\n\t\tif (naturalOffset < minOffset) {\n\t\t\tflexEls.push(el);\n\t\t\tflexOffsets.push(naturalOffset);\n\t\t\tflexHeights.push($(el).height());\n\t\t}\n\t\telse {\n\t\t\t// this element stretches past recommended height (non-expandable). mark the space as occupied.\n\t\t\tusedHeight += naturalOffset;\n\t\t}\n\t});\n\n\t// readjust the recommended height to only consider the height available to non-maxed-out rows.\n\tif (shouldRedistribute) {\n\t\tavailableHeight -= usedHeight;\n\t\tminOffset1 = Math.floor(availableHeight / flexEls.length);\n\t\tminOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n\t}\n\n\t// assign heights to all expandable elements\n\t$(flexEls).each(function(i, el) {\n\t\tvar minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = flexOffsets[i];\n\t\tvar naturalHeight = flexHeights[i];\n\t\tvar newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n\t\tif (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n\t\t\t$(el).height(newHeight);\n\t\t}\n\t});\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n\n\t// *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n\t// and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n\n\tvar minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\tvar minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\tvar flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\tvar flexOffsets = []; // amount of vertical space it takes up\n\tvar flexHeights = []; // actual css height\n\tvar usedHeight = 0;\n\n\tundistributeHeight(els); // give all elements their natural height\n\n\t// find elements that are below the recommended height (expandable).\n\t// important to query for heights in a single first pass (to avoid reflow oscillation).\n\tels.each(function(i, el) {\n\t\tvar minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = $(el).outerHeight(true);\n\n\t\tif (naturalOffset < minOffset) {\n\t\t\tflexEls.push(el);\n\t\t\tflexOffsets.push(naturalOffset);\n\t\t\tflexHeights.push($(el).height());\n\t\t}\n\t\telse {\n\t\t\t// this element stretches past recommended height (non-expandable). mark the space as occupied.\n\t\t\tusedHeight += naturalOffset;\n\t\t}\n\t});\n\n\t// readjust the recommended height to only consider the height available to non-maxed-out rows.\n\tif (shouldRedistribute) {\n\t\tavailableHeight -= usedHeight;\n\t\tminOffset1 = Math.floor(availableHeight / flexEls.length);\n\t\tminOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n\t}\n\n\t// assign heights to all expandable elements\n\t$(flexEls).each(function(i, el) {\n\t\tvar minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = flexOffsets[i];\n\t\tvar naturalHeight = flexHeights[i];\n\t\tvar newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n\t\tif (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n\t\t\t$(el).height(newHeight);\n\t\t}\n\t});\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n\n\t// *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n\t// and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n\n\tvar minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\tvar minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\tvar flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\tvar flexOffsets = []; // amount of vertical space it takes up\n\tvar flexHeights = []; // actual css height\n\tvar usedHeight = 0;\n\n\tundistributeHeight(els); // give all elements their natural height\n\n\t// find elements that are below the recommended height (expandable).\n\t// important to query for heights in a single first pass (to avoid reflow oscillation).\n\tels.each(function(i, el) {\n\t\tvar minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = $(el).outerHeight(true);\n\n\t\tif (naturalOffset < minOffset) {\n\t\t\tflexEls.push(el);\n\t\t\tflexOffsets.push(naturalOffset);\n\t\t\tflexHeights.push($(el).height());\n\t\t}\n\t\telse {\n\t\t\t// this element stretches past recommended height (non-expandable). mark the space as occupied.\n\t\t\tusedHeight += naturalOffset;\n\t\t}\n\t});\n\n\t// readjust the recommended height to only consider the height available to non-maxed-out rows.\n\tif (shouldRedistribute) {\n\t\tavailableHeight -= usedHeight;\n\t\tminOffset1 = Math.floor(availableHeight / flexEls.length);\n\t\tminOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n\t}\n\n\t// assign heights to all expandable elements\n\t$(flexEls).each(function(i, el) {\n\t\tvar minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = flexOffsets[i];\n\t\tvar naturalHeight = flexHeights[i];\n\t\tvar newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n\t\tif (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n\t\t\t$(el).height(newHeight);\n\t\t}\n\t});\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n\n\t// *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n\t// and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n\n\tvar minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\tvar minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\tvar flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\tvar flexOffsets = []; // amount of vertical space it takes up\n\tvar flexHeights = []; // actual css height\n\tvar usedHeight = 0;\n\n\tundistributeHeight(els); // give all elements their natural height\n\n\t// find elements that are below the recommended height (expandable).\n\t// important to query for heights in a single first pass (to avoid reflow oscillation).\n\tels.each(function(i, el) {\n\t\tvar minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = $(el).outerHeight(true);\n\n\t\tif (naturalOffset < minOffset) {\n\t\t\tflexEls.push(el);\n\t\t\tflexOffsets.push(naturalOffset);\n\t\t\tflexHeights.push($(el).height());\n\t\t}\n\t\telse {\n\t\t\t// this element stretches past recommended height (non-expandable). mark the space as occupied.\n\t\t\tusedHeight += naturalOffset;\n\t\t}\n\t});\n\n\t// readjust the recommended height to only consider the height available to non-maxed-out rows.\n\tif (shouldRedistribute) {\n\t\tavailableHeight -= usedHeight;\n\t\tminOffset1 = Math.floor(availableHeight / flexEls.length);\n\t\tminOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n\t}\n\n\t// assign heights to all expandable elements\n\t$(flexEls).each(function(i, el) {\n\t\tvar minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = flexOffsets[i];\n\t\tvar naturalHeight = flexHeights[i];\n\t\tvar newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n\t\tif (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n\t\t\t$(el).height(newHeight);\n\t\t}\n\t});\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n\n\t// *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n\t// and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n\n\tvar minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\tvar minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\tvar flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\tvar flexOffsets = []; // amount of vertical space it takes up\n\tvar flexHeights = []; // actual css height\n\tvar usedHeight = 0;\n\n\tundistributeHeight(els); // give all elements their natural height\n\n\t// find elements that are below the recommended height (expandable).\n\t// important to query for heights in a single first pass (to avoid reflow oscillation).\n\tels.each(function(i, el) {\n\t\tvar minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = $(el).outerHeight(true);\n\n\t\tif (naturalOffset < minOffset) {\n\t\t\tflexEls.push(el);\n\t\t\tflexOffsets.push(naturalOffset);\n\t\t\tflexHeights.push($(el).height());\n\t\t}\n\t\telse {\n\t\t\t// this element stretches past recommended height (non-expandable). mark the space as occupied.\n\t\t\tusedHeight += naturalOffset;\n\t\t}\n\t});\n\n\t// readjust the recommended height to only consider the height available to non-maxed-out rows.\n\tif (shouldRedistribute) {\n\t\tavailableHeight -= usedHeight;\n\t\tminOffset1 = Math.floor(availableHeight / flexEls.length);\n\t\tminOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n\t}\n\n\t// assign heights to all expandable elements\n\t$(flexEls).each(function(i, el) {\n\t\tvar minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = flexOffsets[i];\n\t\tvar naturalHeight = flexHeights[i];\n\t\tvar newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n\t\tif (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n\t\t\t$(el).height(newHeight);\n\t\t}\n\t});\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n\n\t// *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n\t// and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n\n\tvar minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\tvar minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\tvar flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\tvar flexOffsets = []; // amount of vertical space it takes up\n\tvar flexHeights = []; // actual css height\n\tvar usedHeight = 0;\n\n\tundistributeHeight(els); // give all elements their natural height\n\n\t// find elements that are below the recommended height (expandable).\n\t// important to query for heights in a single first pass (to avoid reflow oscillation).\n\tels.each(function(i, el) {\n\t\tvar minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = $(el).outerHeight(true);\n\n\t\tif (naturalOffset < minOffset) {\n\t\t\tflexEls.push(el);\n\t\t\tflexOffsets.push(naturalOffset);\n\t\t\tflexHeights.push($(el).height());\n\t\t}\n\t\telse {\n\t\t\t// this element stretches past recommended height (non-expandable). mark the space as occupied.\n\t\t\tusedHeight += naturalOffset;\n\t\t}\n\t});\n\n\t// readjust the recommended height to only consider the height available to non-maxed-out rows.\n\tif (shouldRedistribute) {\n\t\tavailableHeight -= usedHeight;\n\t\tminOffset1 = Math.floor(availableHeight / flexEls.length);\n\t\tminOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n\t}\n\n\t// assign heights to all expandable elements\n\t$(flexEls).each(function(i, el) {\n\t\tvar minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = flexOffsets[i];\n\t\tvar naturalHeight = flexHeights[i];\n\t\tvar newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n\t\tif (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n\t\t\t$(el).height(newHeight);\n\t\t}\n\t});\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n\n\t// *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n\t// and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n\n\tvar minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\tvar minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\tvar flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\tvar flexOffsets = []; // amount of vertical space it takes up\n\tvar flexHeights = []; // actual css height\n\tvar usedHeight = 0;\n\n\tundistributeHeight(els); // give all elements their natural height\n\n\t// find elements that are below the recommended height (expandable).\n\t// important to query for heights in a single first pass (to avoid reflow oscillation).\n\tels.each(function(i, el) {\n\t\tvar minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = $(el).outerHeight(true);\n\n\t\tif (naturalOffset < minOffset) {\n\t\t\tflexEls.push(el);\n\t\t\tflexOffsets.push(naturalOffset);\n\t\t\tflexHeights.push($(el).height());\n\t\t}\n\t\telse {\n\t\t\t// this element stretches past recommended height (non-expandable). mark the space as occupied.\n\t\t\tusedHeight += naturalOffset;\n\t\t}\n\t});\n\n\t// readjust the recommended height to only consider the height available to non-maxed-out rows.\n\tif (shouldRedistribute) {\n\t\tavailableHeight -= usedHeight;\n\t\tminOffset1 = Math.floor(availableHeight / flexEls.length);\n\t\tminOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n\t}\n\n\t// assign heights to all expandable elements\n\t$(flexEls).each(function(i, el) {\n\t\tvar minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = flexOffsets[i];\n\t\tvar naturalHeight = flexHeights[i];\n\t\tvar newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n\t\tif (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n\t\t\t$(el).height(newHeight);\n\t\t}\n\t});\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n\n\t// *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n\t// and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n\n\tvar minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\tvar minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\tvar flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\tvar flexOffsets = []; // amount of vertical space it takes up\n\tvar flexHeights = []; // actual css height\n\tvar usedHeight = 0;\n\n\tundistributeHeight(els); // give all elements their natural height\n\n\t// find elements that are below the recommended height (expandable).\n\t// important to query for heights in a single first pass (to avoid reflow oscillation).\n\tels.each(function(i, el) {\n\t\tvar minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = $(el).outerHeight(true);\n\n\t\tif (naturalOffset < minOffset) {\n\t\t\tflexEls.push(el);\n\t\t\tflexOffsets.push(naturalOffset);\n\t\t\tflexHeights.push($(el).height());\n\t\t}\n\t\telse {\n\t\t\t// this element stretches past recommended height (non-expandable). mark the space as occupied.\n\t\t\tusedHeight += naturalOffset;\n\t\t}\n\t});\n\n\t// readjust the recommended height to only consider the height available to non-maxed-out rows.\n\tif (shouldRedistribute) {\n\t\tavailableHeight -= usedHeight;\n\t\tminOffset1 = Math.floor(availableHeight / flexEls.length);\n\t\tminOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n\t}\n\n\t// assign heights to all expandable elements\n\t$(flexEls).each(function(i, el) {\n\t\tvar minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = flexOffsets[i];\n\t\tvar naturalHeight = flexHeights[i];\n\t\tvar newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n\t\tif (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n\t\t\t$(el).height(newHeight);\n\t\t}\n\t});\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n var flexOffsets = []; // amount of vertical space it takes up\n var flexHeights = []; // actual css height\n var usedHeight = 0;\n undistributeHeight(els); // give all elements their natural height\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n els.each(function (i, el) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = $(el).outerHeight(true);\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push($(el).height());\n }\n else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n });\n // readjust the recommended height to only consider the height available to non-maxed-out rows.\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n }\n // assign heights to all expandable elements\n $(flexEls).each(function (i, el) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n if (naturalOffset < minOffset) {\n $(el).height(newHeight);\n }\n });\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n var flexOffsets = []; // amount of vertical space it takes up\n var flexHeights = []; // actual css height\n var usedHeight = 0;\n undistributeHeight(els); // give all elements their natural height\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n els.each(function (i, el) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = $(el).outerHeight(true);\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push($(el).height());\n }\n else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n });\n // readjust the recommended height to only consider the height available to non-maxed-out rows.\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n }\n // assign heights to all expandable elements\n $(flexEls).each(function (i, el) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n if (naturalOffset < minOffset) {\n $(el).height(newHeight);\n }\n });\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n var flexOffsets = []; // amount of vertical space it takes up\n var flexHeights = []; // actual css height\n var usedHeight = 0;\n undistributeHeight(els); // give all elements their natural height\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n els.each(function (i, el) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = $(el).outerHeight(true);\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push($(el).height());\n }\n else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n });\n // readjust the recommended height to only consider the height available to non-maxed-out rows.\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n }\n // assign heights to all expandable elements\n $(flexEls).each(function (i, el) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n if (naturalOffset < minOffset) {\n $(el).height(newHeight);\n }\n });\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n var flexOffsets = []; // amount of vertical space it takes up\n var flexHeights = []; // actual css height\n var usedHeight = 0;\n undistributeHeight(els); // give all elements their natural height\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n els.each(function (i, el) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = $(el).outerHeight(true);\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push($(el).height());\n }\n else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n });\n // readjust the recommended height to only consider the height available to non-maxed-out rows.\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n }\n // assign heights to all expandable elements\n $(flexEls).each(function (i, el) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n if (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n $(el).height(newHeight);\n }\n });\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n var flexOffsets = []; // amount of vertical space it takes up\n var flexHeights = []; // actual css height\n var usedHeight = 0;\n\n undistributeHeight(els); // give all elements their natural height\n\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n els.each(function (i, el) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = $(el).outerHeight(true);\n\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push($(el).height());\n }\n else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n });\n\n // readjust the recommended height to only consider the height available to non-maxed-out rows.\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n }\n\n // assign heights to all expandable elements\n $(flexEls).each(function (i, el) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n if (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n $(el).height(newHeight);\n }\n });\n }", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n\n\t\t// *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n\t\t// and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n\n\t\tvar minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\t\tvar minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\t\tvar flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\t\tvar flexOffsets = []; // amount of vertical space it takes up\n\t\tvar flexHeights = []; // actual css height\n\t\tvar usedHeight = 0;\n\n\t\tundistributeHeight(els); // give all elements their natural height\n\n\t\t// find elements that are below the recommended height (expandable).\n\t\t// important to query for heights in a single first pass (to avoid reflow oscillation).\n\t\tels.each(function(i, el) {\n\t\t\tvar minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n\t\t\tvar naturalOffset = $(el).outerHeight(true);\n\n\t\t\tif (naturalOffset < minOffset) {\n\t\t\t\tflexEls.push(el);\n\t\t\t\tflexOffsets.push(naturalOffset);\n\t\t\t\tflexHeights.push($(el).height());\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// this element stretches past recommended height (non-expandable). mark the space as occupied.\n\t\t\t\tusedHeight += naturalOffset;\n\t\t\t}\n\t\t});\n\n\t\t// readjust the recommended height to only consider the height available to non-maxed-out rows.\n\t\tif (shouldRedistribute) {\n\t\t\tavailableHeight -= usedHeight;\n\t\t\tminOffset1 = Math.floor(availableHeight / flexEls.length);\n\t\t\tminOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n\t\t}\n\n\t\t// assign heights to all expandable elements\n\t\t$(flexEls).each(function(i, el) {\n\t\t\tvar minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n\t\t\tvar naturalOffset = flexOffsets[i];\n\t\t\tvar naturalHeight = flexHeights[i];\n\t\t\tvar newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n\t\t\tif (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n\t\t\t\t$(el).height(newHeight);\n\t\t\t}\n\t\t});\n\t}", "function distributeHeight(els,availableHeight,shouldRedistribute){// *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n// and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\nvar minOffset1=Math.floor(availableHeight/els.length);// for non-last element\nvar minOffset2=Math.floor(availableHeight-minOffset1*(els.length-1));// for last element *FLOORING NOTE*\nvar flexEls=[];// elements that are allowed to expand. array of DOM nodes\nvar flexOffsets=[];// amount of vertical space it takes up\nvar flexHeights=[];// actual css height\nvar usedHeight=0;undistributeHeight(els);// give all elements their natural height\n// find elements that are below the recommended height (expandable).\n// important to query for heights in a single first pass (to avoid reflow oscillation).\nels.each(function(i,el){var minOffset=i===els.length-1?minOffset2:minOffset1;var naturalOffset=$(el).outerHeight(true);if(naturalOffset<minOffset){flexEls.push(el);flexOffsets.push(naturalOffset);flexHeights.push($(el).height());}else{// this element stretches past recommended height (non-expandable). mark the space as occupied.\nusedHeight+=naturalOffset;}});// readjust the recommended height to only consider the height available to non-maxed-out rows.\nif(shouldRedistribute){availableHeight-=usedHeight;minOffset1=Math.floor(availableHeight/flexEls.length);minOffset2=Math.floor(availableHeight-minOffset1*(flexEls.length-1));// *FLOORING NOTE*\n}// assign heights to all expandable elements\n$(flexEls).each(function(i,el){var minOffset=i===flexEls.length-1?minOffset2:minOffset1;var naturalOffset=flexOffsets[i];var naturalHeight=flexHeights[i];var newHeight=minOffset-(naturalOffset-naturalHeight);// subtract the margin/padding\nif(naturalOffset<minOffset){// we check this again because redistribution might have changed things\n$(el).height(newHeight);}});}", "function undistributeHeight(els) {\n els.height('');\n}", "function undistributeHeight(els) {\n els.height('');\n}", "function undistributeHeight(els) {\n els.height('');\n}", "function undistributeHeight(els) {\n els.height('');\n}", "function undistributeHeight(els) {\n els.height('');\n }", "function undistributeHeight(els){els.height('');}", "function undistributeHeight(els) {\n els.forEach(function (el) {\n el.style.height = '';\n });\n }", "function undistributeHeight(els) {\n els.forEach(function (el) {\n el.style.height = '';\n });\n }", "function undistributeHeight(els) {\n els.forEach(function (el) {\n el.style.height = '';\n });\n }", "function undistributeHeight(els) {\n\tels.height('');\n}", "function undistributeHeight(els) {\n\tels.height('');\n}", "function undistributeHeight(els) {\n\tels.height('');\n}", "function undistributeHeight(els) {\n\tels.height('');\n}", "function undistributeHeight(els) {\n\tels.height('');\n}", "function undistributeHeight(els) {\n\tels.height('');\n}", "function undistributeHeight(els) {\n\tels.height('');\n}", "function undistributeHeight(els) {\n\tels.height('');\n}", "function undistributeHeight(els) {\n\t\tels.height('');\n\t}", "function resizeElementsByRows(boxes, options) {\n\t\tvar currentRow = $(), maxHeight, maxCalcHeight = 0, firstOffset = boxes.eq(0).offset().top;\n\t\tboxes.each(function(ind){\n\t\t\tvar curItem = $(this);\n\t\t\tif(curItem.offset().top === firstOffset) {\n\t\t\t\tcurrentRow = currentRow.add(this);\n\t\t\t} else {\n\t\t\t\tmaxHeight = getMaxHeight(currentRow);\n\t\t\t\tmaxCalcHeight = Math.max(maxCalcHeight, resizeElements(currentRow, maxHeight, options));\n\t\t\t\tcurrentRow = curItem;\n\t\t\t\tfirstOffset = curItem.offset().top;\n\t\t\t}\n\t\t});\n\t\tif(currentRow.length) {\n\t\t\tmaxHeight = getMaxHeight(currentRow);\n\t\t\tmaxCalcHeight = Math.max(maxCalcHeight, resizeElements(currentRow, maxHeight, options));\n\t\t}\n\t\tif(options.biggestHeight) {\n\t\t\tboxes.css(options.useMinHeight && supportMinHeight ? 'minHeight' : 'height', maxCalcHeight);\n\t\t}\n\t}", "function resizeElementsByRows(boxes, options) {\n\t\tvar currentRow = $(), maxHeight, maxCalcHeight = 0, firstOffset = boxes.eq(0).offset().top;\n\t\tboxes.each(function(ind){\n\t\t\tvar curItem = $(this);\n\t\t\tif(curItem.offset().top === firstOffset) {\n\t\t\t\tcurrentRow = currentRow.add(this);\n\t\t\t} else {\n\t\t\t\tmaxHeight = getMaxHeight(currentRow);\n\t\t\t\tmaxCalcHeight = Math.max(maxCalcHeight, resizeElements(currentRow, maxHeight, options));\n\t\t\t\tcurrentRow = curItem;\n\t\t\t\tfirstOffset = curItem.offset().top;\n\t\t\t}\n\t\t});\n\t\tif(currentRow.length) {\n\t\t\tmaxHeight = getMaxHeight(currentRow);\n\t\t\tmaxCalcHeight = Math.max(maxCalcHeight, resizeElements(currentRow, maxHeight, options));\n\t\t}\n\t\tif(options.biggestHeight) {\n\t\t\tboxes.css(options.useMinHeight && supportMinHeight ? 'minHeight' : 'height', maxCalcHeight);\n\t\t}\n\t}", "function resizeElementsByRows(boxes, options) {\n\t\tvar currentRow = $(), maxHeight, maxCalcHeight = 0, firstOffset = boxes.eq(0).offset().top;\n\t\tboxes.each(function(ind){\n\t\t\tvar curItem = $(this);\n\t\t\tif(curItem.offset().top === firstOffset) {\n\t\t\t\tcurrentRow = currentRow.add(this);\n\t\t\t} else {\n\t\t\t\tmaxHeight = getMaxHeight(currentRow);\n\t\t\t\tmaxCalcHeight = Math.max(maxCalcHeight, resizeElements(currentRow, maxHeight, options));\n\t\t\t\tcurrentRow = curItem;\n\t\t\t\tfirstOffset = curItem.offset().top;\n\t\t\t}\n\t\t});\n\t\tif(currentRow.length) {\n\t\t\tmaxHeight = getMaxHeight(currentRow);\n\t\t\tmaxCalcHeight = Math.max(maxCalcHeight, resizeElements(currentRow, maxHeight, options));\n\t\t}\n\t\tif(options.biggestHeight) {\n\t\t\tboxes.css(options.useMinHeight && supportMinHeight ? 'minHeight' : 'height', maxCalcHeight);\n\t\t}\n\t}", "function resizeElementsByRows(boxes, options) {\n\t\tvar currentRow = $(), maxHeight, maxCalcHeight = 0, firstOffset = boxes.eq(0).offset().top;\n\t\tboxes.each(function(ind){\n\t\t\tvar curItem = $(this);\n\t\t\tif(curItem.offset().top === firstOffset) {\n\t\t\t\tcurrentRow = currentRow.add(this);\n\t\t\t} else {\n\t\t\t\tmaxHeight = getMaxHeight(currentRow);\n\t\t\t\tmaxCalcHeight = Math.max(maxCalcHeight, resizeElements(currentRow, maxHeight, options));\n\t\t\t\tcurrentRow = curItem;\n\t\t\t\tfirstOffset = curItem.offset().top;\n\t\t\t}\n\t\t});\n\t\tif(currentRow.length) {\n\t\t\tmaxHeight = getMaxHeight(currentRow);\n\t\t\tmaxCalcHeight = Math.max(maxCalcHeight, resizeElements(currentRow, maxHeight, options));\n\t\t}\n\t\tif(options.biggestHeight) {\n\t\t\tboxes.css(options.useMinHeight && supportMinHeight ? 'minHeight' : 'height', maxCalcHeight);\n\t\t}\n\t}", "function undistributeHeight(els) {\n els.forEach(function (el) {\n el.style.height = '';\n });\n}", "function resizeElementsByRows(boxes, options) {\n var currentRow = $(), maxHeight, maxCalcHeight = 0, firstOffset = boxes.eq(0).offset().top;\n boxes.each(function (ind) {\n var curItem = $(this);\n if (curItem.offset().top === firstOffset) {\n currentRow = currentRow.add(this);\n } else {\n maxHeight = getMaxHeight(currentRow);\n maxCalcHeight = Math.max(maxCalcHeight, resizeElements(currentRow, maxHeight, options));\n currentRow = curItem;\n firstOffset = curItem.offset().top;\n }\n });\n if (currentRow.length) {\n maxHeight = getMaxHeight(currentRow);\n maxCalcHeight = Math.max(maxCalcHeight, resizeElements(currentRow, maxHeight, options));\n }\n if (options.biggestHeight) {\n boxes.css(options.useMinHeight && supportMinHeight ? 'minHeight' : 'height', maxCalcHeight);\n }\n }", "function resizeElementsByRows(boxes, options) {\n var currentRow = $(), maxHeight, maxCalcHeight = 0, firstOffset = boxes.eq(0).offset().top;\n boxes.each(function (ind) {\n var curItem = $(this);\n if (curItem.offset().top === firstOffset) {\n currentRow = currentRow.add(this);\n } else {\n maxHeight = getMaxHeight(currentRow);\n maxCalcHeight = Math.max(maxCalcHeight, resizeElements(currentRow, maxHeight, options));\n currentRow = curItem;\n firstOffset = curItem.offset().top;\n }\n });\n if (currentRow.length) {\n maxHeight = getMaxHeight(currentRow);\n maxCalcHeight = Math.max(maxCalcHeight, resizeElements(currentRow, maxHeight, options));\n }\n if (options.biggestHeight) {\n boxes.css(options.useMinHeight && supportMinHeight ? 'minHeight' : 'height', maxCalcHeight);\n }\n }", "function resizeElementsByRows(boxes, options) {\n var currentRow = $(), maxHeight, maxCalcHeight = 0, firstOffset = boxes.eq(0).offset().top;\n boxes.each(function (ind) {\n var curItem = $(this);\n if (curItem.offset().top === firstOffset) {\n currentRow = currentRow.add(this);\n } else {\n maxHeight = getMaxHeight(currentRow);\n maxCalcHeight = Math.max(maxCalcHeight, resizeElements(currentRow, maxHeight, options));\n currentRow = curItem;\n firstOffset = curItem.offset().top;\n }\n });\n if (currentRow.length) {\n maxHeight = getMaxHeight(currentRow);\n maxCalcHeight = Math.max(maxCalcHeight, resizeElements(currentRow, maxHeight, options));\n }\n if (options.biggestHeight) {\n boxes.css(options.useMinHeight && supportMinHeight ? 'minHeight' : 'height', maxCalcHeight);\n }\n }", "function undistributeHeight(els) {\n els.forEach(function (el) {\n el.style.height = '';\n });\n }", "updateInnerHeightDependingOnChilds(){this.__cacheWidthPerColumn=null,this.__asyncWorkData[\"System.TcHmiGrid.triggerRebuildAll\"]=!0,this.__asyncWorkData[\"System.TcHmiGrid.triggerRecheckHeight\"]=!0,this.__requestAsyncWork()}", "reflow (el) {\n var last = []\n var cols = [...el.querySelectorAll('.js-col')]\n\n for (let i = 0, len = cols.length, col; i < len; i++) {\n col = cols[i]\n if (col.childElementCount <= 1) continue\n last.push(...Array.prototype.slice.call(col.childNodes, -1))\n col.removeChild(col.lastElementChild)\n }\n\n for (let i = 0, len = last.length; i < len; i++) {\n var shortest = cols.reduce((min, el) => {\n var height = el.offsetHeight\n return !min || height < min.height ? { el, height } : min\n }, null)\n shortest.el.appendChild(last[i])\n }\n }", "function resizeElementsByRows(boxes, options) {\n\t\tvar currentRow = jQuery(), maxHeight, firstOffset = boxes.eq(0).offset().top;\n\t\tboxes.each(function(ind){\n\t\t\tvar curItem = jQuery(this);\n\t\t\tif(curItem.offset().top === firstOffset) {\n\t\t\t\tcurrentRow = currentRow.add(this);\n\t\t\t} else {\n\t\t\t\tmaxHeight = getMaxHeight(currentRow);\n\t\t\t\tresizeElements(currentRow, maxHeight, options);\n\t\t\t\tcurrentRow = curItem;\n\t\t\t\tfirstOffset = curItem.offset().top;\n\t\t\t}\n\t\t});\n\t\tif(currentRow.length) {\n\t\t\tmaxHeight = getMaxHeight(currentRow);\n\t\t\tresizeElements(currentRow, maxHeight, options);\n\t\t}\n\t}", "updateInnerHeightDependingOnChilds(){}", "function setSameElementHeight(e) {\n\tvar tallest = 0;\n\t$(e).each(function() {\n\t\t$(this).css('height','auto'); // reset height in case an empty div has been populated\n\t\tif ($(this).height() > tallest) {\n\t\t\ttallest = $(this).height();\n\t\t}\n\t});\n\t$(e).height(tallest);\n}", "innerHeightDependsOnChilds(){if(this.__controlStretchedHeight)return!0;if(this.__rowOptions)for(const rowOption of this.__rowOptions)if(\"Content\"===rowOption.heightMode)return!0;return super.innerHeightDependsOnChilds()}", "reflow () {\n var last = []\n var cols = [...this.element.querySelectorAll('.js-col')]\n\n for (let i = 0, len = cols.length, col; i < len; i++) {\n col = cols[i]\n last.push(...Array.prototype.slice.call(col.childNodes, -2))\n if (col.childElementCount) col.removeChild(col.lastElementChild)\n if (col.childElementCount) col.removeChild(col.lastElementChild)\n }\n\n for (let i = 0, len = last.length; i < len; i++) {\n var shortest = cols.reduce((min, el) => {\n var height = el.offsetHeight\n return !min || height < min.height ? {el, height} : min\n }, null)\n shortest.el.appendChild(last[i])\n }\n }", "function resize() {\n\t\tvar done = [];\n\t\t$('[data-equal-height]').each(function() {\n\t\t\tvar elem = $(this),\n\t\t\t\telems = elem.data('equal-height');\n\n\t\t\tif( $.inArray(elems, done) < 0 ) {\n\t\t\t\tresizeGroup('[data-equal-height=\"'+ elems +'\"]');\n\t\t\t\tdone.push(elems);\n\t\t\t}\n\t\t});\n\t}", "function initExpandCollapse() {\r\n if (!document.getElementById)\r\n return;\r\n\r\n var groupCount = 0;\r\n\r\n // Examine all table rows in the document.\r\n var rows = document.body.getElementsByTagName(\"tr\");\r\n for (var i=0; i<rows.length; i+=1) {\r\n\r\n var cellCount=0, newGroupCreated = false;\r\n\r\n // Examine all divs in a table row.\r\n var divs = rows[i].getElementsByTagName(\"div\");\r\n for (var j=0; j<divs.length; j+=1) {\r\n\r\n var expandableDiv = divs[j];\r\n\r\n if (expandableDiv.className.indexOf(\"expandable\") == -1)\r\n continue;\r\n\r\n if (expandableDiv.offsetHeight <= CLIP_HEIGHT)\r\n continue;\r\n\r\n // We found a div wrapping a cell content whose height exceeds \r\n // CLIP_HEIGHT.\r\n var originalHeight = expandableDiv.offsetHeight;\r\n // Unique postfix for ids for generated nodes for a given cell.\r\n var idxStr = \"_\" + groupCount + \"_\" + cellCount;\r\n // Create an expander and an additional wrapper for a cell content.\r\n //\r\n // --- expandableDiv ----\r\n // --- expandableDiv --- | ------ data ------ |\r\n // | cell content | -> | | cell content | | \r\n // --------------------- | ------------------ |\r\n // | ---- expander ---- |\r\n // ----------------------\r\n var data = document.createElement(\"div\");\r\n data.className = \"data\";\r\n data.id = \"data\" + idxStr;\r\n data.innerHTML = expandableDiv.innerHTML;\r\n with (data.style) { height = (CLIP_HEIGHT - EXPANDER_HEIGHT) + \"px\";\r\n overflow = \"hidden\" }\r\n\r\n var expander = document.createElement(\"img\");\r\n with (expander.style) { display = \"block\"; paddingTop = \"5px\"; }\r\n expander.src = imgPath + \"ellipses_light.gif\";\r\n expander.id = \"expander\" + idxStr;\r\n\r\n // Add mouse calbacks to expander.\r\n expander.onclick = function() {\r\n expandCollapse(this.id);\r\n // Hack for Opera - onmouseout callback is not invoked when page \r\n // content changes dinamically and mouse pointer goes out of an element.\r\n this.src = imgPath + \r\n (getCellInfo(this.id).expanded ? \"arrows_light.gif\"\r\n : \"ellipses_light.gif\");\r\n }\r\n expander.onmouseover = function() { \r\n this.src = imgPath + \r\n (getCellInfo(this.id).expanded ? \"arrows_dark.gif\"\r\n : \"ellipses_dark.gif\");\r\n }\r\n expander.onmouseout = function() { \r\n this.src = imgPath + \r\n (getCellInfo(this.id).expanded ? \"arrows_light.gif\"\r\n : \"ellipses_light.gif\");\r\n }\r\n\r\n expandableDiv.innerHTML = \"\";\r\n expandableDiv.appendChild(data);\r\n expandableDiv.appendChild(expander);\r\n expandableDiv.style.height = CLIP_HEIGHT + \"px\";\r\n expandableDiv.id = \"cell\"+ idxStr;\r\n\r\n // Keep original cell height and its ecpanded/cpllapsed state.\r\n if (!newGroupCreated) {\r\n CellsInfo[groupCount] = [];\r\n newGroupCreated = true;\r\n }\r\n CellsInfo[groupCount][cellCount] = { 'height' : originalHeight,\r\n 'expanded' : false };\r\n cellCount += 1;\r\n }\r\n groupCount += newGroupCreated ? 1 : 0;\r\n }\r\n}", "function addItem(){\n var cols = document.getElementsByClassName(\"waterfall-col\");\n var newItem = createItem();\n var i, min = cols[0].scrollHeight, index = 0;\n for (i=1; i<cols.length; i++){\n if (cols[i].scrollHeight < min){\n index = i;\n min =cols[i].scrollHeight;\n }\n }\n cols[index].appendChild(newItem);\n}", "expandAll() {\n const data = this.dataManager.getData();\n const parentsToExpand = [];\n\n arrayEach(data, (elem) => {\n if (this.dataManager.hasChildren(elem)) {\n parentsToExpand.push(elem);\n }\n });\n\n this.expandMultipleChildren(parentsToExpand);\n\n this.renderAndAdjust();\n }", "_adjustHeightValue(currentHeight) {\n const that = this,\n itemsCount = that._items.length;\n let expandedItem, collapsedItem;\n\n for (let i = 0; i < itemsCount; i++) {\n that._items[i].expanded ? expandedItem = that._items[i] : collapsedItem = that._items[i];\n\n if (expandedItem && collapsedItem) {\n break;\n }\n }\n\n if (!expandedItem) {\n expandedItem = that._items[0];\n }\n\n if (!expandedItem && !collapsedItem) {\n return;\n }\n\n const expandedItemState = expandedItem.expanded;\n\n expandedItem.expanded = true;\n\n const expandedStyles = window.getComputedStyle(expandedItem, null),\n collapsedStyles = collapsedItem ? window.getComputedStyle(collapsedItem, null) : false,\n expandedOffset = parseInt(expandedStyles.getPropertyValue('margin-top')) + parseInt(expandedStyles.getPropertyValue('margin-bottom')),\n collapsedOffset = collapsedStyles ? parseInt(collapsedStyles.getPropertyValue('margin-top')) + parseInt(collapsedStyles.getPropertyValue('margin-bottom')) : 0;\n\n expandedItem.expanded = expandedItemState;\n\n return (currentHeight - ((itemsCount - 1) * collapsedOffset + expandedOffset));\n }", "_autoFitItems() {\n const that = this,\n itemsCount = that._items.length;\n\n if (itemsCount === 0 || that.autoFitMode === 'overflow') {\n return;\n }\n\n let lastItem,\n lockedItems = [],\n collapsedItems = [],\n itemsWithoutSize = [];\n\n for (let i = itemsCount - 1; i >= 0; i--) {\n if (that._items[i].collapsed) {\n collapsedItems.push(that._items[i]);\n }\n else if (that._items[i].locked) {\n lockedItems.push(that._items[i]);\n }\n else if (!lastItem) {\n lastItem = that._items[i];\n }\n else if (!that._items[i].size) {\n itemsWithoutSize.push(that._items[i]);\n }\n }\n\n if (lastItem && lastItem.size && itemsWithoutSize.length > 0) {\n lastItem = itemsWithoutSize.filter(item => !item.max && !item._sizeLimits[that._measurements.maxDimension])[0] || lastItem;\n }\n\n if (collapsedItems.length === itemsCount) {\n lastItem = collapsedItems[0];\n lastItem.expand();\n lastItem.unlock();\n }\n\n that._autoFitLastItem(lastItem, collapsedItems, lockedItems);\n }", "function resize(elem, cols, rows) {\n const container = elem.parentNode; \n const [widthAvail, heightAvail] = getClientRect(container);\n const sizeLed = Math.floor(Math.min(heightAvail/rows, widthAvail/cols));\n //const sizeLed = Math.max(1, Math.min(heightAvail/rows, widthAvail/cols));\n elem.width = sizeLed * cols;\n elem.height = sizeLed * rows;\n }", "resizeToFitContent() {\n const {\n grid\n } = this,\n {\n store\n } = grid,\n {\n count\n } = store;\n\n if (count && !this.hidden) {\n const cellElement = grid.element.querySelector(`.b-grid-cell[data-column-id=${this.id}]`); // cellElement might not exist, e.g. when trial is expired\n\n if (cellElement) {\n const cellPadding = parseInt(DomHelper.getStyleValue(cellElement, 'padding-left')),\n maxWidth = DomHelper.measureText(count, cellElement);\n this.width = maxWidth + 2 * cellPadding;\n }\n }\n }", "expandAllRows() {\r\n const that = this;\r\n\r\n if (!that.hasAttribute('hierarchy') || that.grouping) {\r\n return;\r\n }\r\n\r\n function expand(siblings) {\r\n for (let i = 0; i < siblings.length; i++) {\r\n const sibling = siblings[i];\r\n\r\n if (sibling.leaf) {\r\n continue;\r\n }\r\n\r\n if (sibling.children) {\r\n expand(sibling.children);\r\n }\r\n\r\n if (!sibling.expanded) {\r\n that.expandRow(sibling.$.id);\r\n }\r\n }\r\n }\r\n\r\n expand(that.dataSource.boundHierarchy);\r\n }", "function unifyHeights(item) {\n var maxHeight = 0;\n item.css('height', 'auto');\n item.each(function () {\n var height = $(this).outerHeight();\n if (height > maxHeight) {\n maxHeight = height;\n }\n });\n item.css('height', maxHeight);\n}", "updateElementsHeight() {\n const me = this;\n me.rowManager.storeKnownHeight(me.id, me.height); // prevent unnecessary style updates\n\n if (me.lastHeight !== me.height) {\n const elements = me._elementsArray;\n\n for (let i = 0; i < elements.length; i++) {\n elements[i].style.height = `${me.offsetHeight}px`;\n }\n\n me.lastHeight = me.height;\n }\n }", "resizeToFitContent() {\n const grid = this.grid,\n store = grid.store,\n count = store.count;\n\n if (count && !this.hidden) {\n const cellElement = grid.element.querySelector(`.b-grid-cell[data-column-id=${this.id}]`);\n\n // cellElement might not exist, e.g. when trial is expired\n if (cellElement) {\n const cellStyle = window.getComputedStyle(cellElement),\n cellPadding = parseInt(cellStyle['padding-left']),\n maxWidth = DomHelper.measureText(count, cellElement);\n\n this.width = maxWidth + 2 * cellPadding;\n }\n }\n }", "_autoFitItemsProportionally(newItem, splitterBar) {\n const that = this,\n uncollapsedItems = that._items.filter(item => !item.collapsed);\n let newItemSize = newItem[that._measurements.size],\n totalItemSize = 0;\n\n uncollapsedItems.map(item => totalItemSize += item._sizeBeforeCollapse || item[that._measurements.size]);\n\n if (splitterBar) {\n totalItemSize -= splitterBar[that._measurements.size];\n }\n\n if (newItem.size && !newItem.isCompleted) {\n newItem._setSize('size', newItemSize);\n newItemSize = newItem._sizeBeforeCollapse;\n }\n\n newItemSize = Math.min(that.$.container[that._measurements.size] / 2, newItem[that._measurements.size]);\n newItem.style[that._measurements.dimension] = newItemSize + 'px';\n\n let currentItemSize, newSize, itemMinSize;\n\n for (let i = 0; i < uncollapsedItems.length; i++) {\n currentItemSize = uncollapsedItems[i]._sizeBeforeCollapse || uncollapsedItems[i][that._measurements.size];\n newSize = (totalItemSize - newItemSize) * (currentItemSize / totalItemSize);\n\n //Check for item min size\n itemMinSize = uncollapsedItems[i]._sizeLimits[that._measurements.minDimension] || 0;\n uncollapsedItems[i].style[that._measurements.dimension] = (uncollapsedItems[i]._sizeBeforeCollapse = Math.max(itemMinSize, newSize)) + 'px';\n }\n }", "expand() {\n const that = this;\n\n if (that._ignorePropertyValue || that.collapsed) {\n const ownerElement = (that.getRootNode() ? that.getRootNode().host : null) || that.closest('jqx-splitter');\n\n if (!ownerElement) {\n that.collapsed = true;\n return;\n }\n\n if (!that._neighbourItem) {\n that.collapsed = true;\n return;\n }\n\n delete that._ignorePropertyValue;\n\n if (!that._neighbourItem._ignorePropertyValue && that._neighbourItem.collapsed) {\n let neighbourItemIndex = ownerElement._items.indexOf(that._neighbourItem);\n const direction = ownerElement._items.indexOf(that) > ownerElement._items.indexOf(that._neighbourItem) ? -1 : 1;\n\n that._neighbourItem = ownerElement._items[neighbourItemIndex];\n\n while (that._neighbourItem) {\n if (!that._neighbourItem.collapsed) {\n break;\n }\n\n neighbourItemIndex += direction;\n that._neighbourItem = ownerElement._items[neighbourItemIndex];\n }\n }\n\n if (!that._neighbourItem) {\n that.collapsed = true;\n return;\n }\n\n if (that.min) {\n that._setSize('min', that.min, true);\n }\n\n const totalSpace = that._neighbourItem._sizeBeforeCollapse,\n minSize = that._sizeLimits[ownerElement._measurements.minDimension],\n neighbourItemMin = that._neighbourItem._sizeLimits[ownerElement._measurements.minDimension],\n spaceAvailable = totalSpace - minSize;\n\n if (totalSpace && spaceAvailable < neighbourItemMin) {\n that.collapsed = true;\n return;\n }\n\n if (!that._neighbourItem._paddings) {\n const computedStyle = getComputedStyle(that._neighbourItem);\n\n that._neighbourItem._paddings = (parseFloat(computedStyle.getPropertyValue('padding-' + ownerElement._measurements.position)) || 0) +\n (parseFloat(computedStyle.getPropertyValue('padding-' + ownerElement._measurements.position2)) || 0);\n }\n\n if (!that._paddings) {\n const computedStyle = getComputedStyle(that);\n\n that._paddings = (parseFloat(computedStyle.getPropertyValue('padding-' + ownerElement._measurements.position)) || 0) +\n (parseFloat(computedStyle.getPropertyValue('padding-' + ownerElement._measurements.position2)) || 0);\n }\n\n if ((that.size + '').indexOf('%') > -1 && (!that._sizeBeforeCollapse || that._sizeBeforeCollapse === 0) && that._neighbourItem._sizeBeforeCollapse) {\n let totalItemSize = 0;\n\n ownerElement._items.map(item => totalItemSize += !item.collapsed ?\n (item.style[ownerElement._measurements.dimension] && item.style[ownerElement._measurements.dimension].indexOf('%') < -1 && item._sizeBeforeCollapse ?\n item._sizeBeforeCollapse : item.getBoundingClientRect()[ownerElement._measurements.dimension]) : 0);\n that._sizeBeforeCollapse = totalItemSize * parseFloat(that.size) / 100;\n }\n\n const previousSize = Math.min(Math.max(minSize, that._sizeBeforeCollapse), totalSpace - that._neighbourItem._paddings - that._paddings - neighbourItemMin);\n\n if (previousSize < 0) {\n that.collapsed = true;\n return;\n }\n\n //Add animation class\n if (that.hasAnimation && !ownerElement._isInitializing) {\n that.$.addClass('animate');\n that._neighbourItem.$.addClass('animate');\n\n that.addEventListener('transitionend', that._transitionEndHandler, { once: true });\n that.addEventListener('transitioncancel', that._transitionEndHandler, { once: true });\n that._neighbourItem.addEventListener('transitionend', that._transitionEndHandler, { once: true });\n that._neighbourItem.addEventListener('transitioncancel', that._transitionEndHandler, { once: true });\n }\n\n //Restore the size before collapsing\n that.style.padding = '';\n that.style[ownerElement._measurements.minDimension] = that.min ? that._sizeLimits[ownerElement._measurements.minDimension] + 'px' : '';\n that.style[ownerElement._measurements.dimension] = (that._sizeBeforeCollapse = previousSize) + 'px';\n\n that._neighbourItem.style[ownerElement._measurements.dimension] =\n (that._neighbourItem._sizeBeforeCollapse = Math.max(that._neighbourItem._sizeLimits[ownerElement._measurements.minDimension], totalSpace - previousSize)) + 'px';\n\n if (that._neighbourItem._sizeLimits[ownerElement._measurements.maxDimension]) {\n that._neighbourItem.style[ownerElement._measurements.maxDimension] = that._neighbourItem._sizeLimits[ownerElement._measurements.maxDimension] + 'px';\n }\n\n that.collapsed = false;\n ownerElement.$.fireEvent('expand', { itemIndex: ownerElement._items.indexOf(that) });\n\n if (ownerElement._items.indexOf(that) > ownerElement._items.indexOf(that._neighbourItem)) {\n that.previousElementSibling.itemCollapsed = false;\n that.previousElementSibling.showNearButton = that._neighbourItem.collapsible;\n }\n else {\n that.nextElementSibling.itemCollapsed = false;\n that.nextElementSibling.showFarButton = that._neighbourItem.collapsible;\n }\n\n const previousElement = ownerElement._items[ownerElement._items.indexOf(that) - 1],\n nextElement = ownerElement._items[ownerElement._items.indexOf(that) + 1];\n\n if (previousElement) {\n const previousSplitterBar = previousElement.nextElementSibling;\n\n if (previousSplitterBar && previousSplitterBar instanceof JQX.SplitterBar) {\n if (!previousElement.collapsed) {\n previousSplitterBar.itemCollapsed = false;\n previousSplitterBar.showNearButton = previousElement.collapsible;\n previousSplitterBar.showFarButton = that.collapsible;\n }\n else {\n previousSplitterBar.showNearButton = that.collapsible;\n }\n }\n }\n\n if (nextElement) {\n const nextSplitterBar = nextElement.previousElementSibling;\n\n if (nextSplitterBar && nextSplitterBar instanceof JQX.SplitterBar) {\n if (!nextElement.collapsed) {\n nextSplitterBar.itemCollapsed = false;\n nextSplitterBar.showNearButton = that.collapsible;\n nextSplitterBar.showFarButton = nextElement.collapsible;\n }\n else {\n nextSplitterBar.showFarButton = nextElement.collapsed;\n }\n }\n }\n\n delete that._neighbourItem;\n }\n }", "function expandCollapse(id) {\r\n var cellInfo = getCellInfo(id);\r\n var idx = getCellIdx(id);\r\n\r\n // New height of a row.\r\n var newHeight;\r\n // Smart page scrolling may be done after collapse.\r\n var mayNeedScroll;\r\n\r\n if (cellInfo.expanded) {\r\n // Cell is expanded - collapse the row height to CLIP_HEIGHT.\r\n newHeight = CLIP_HEIGHT;\r\n mayNeedScroll = true;\r\n }\r\n else {\r\n // Cell is collapsed - expand the row height to the cells original height.\r\n newHeight = cellInfo.height;\r\n mayNeedScroll = false;\r\n }\r\n\r\n // Update all cells (height and expanded/collapsed state) in a row according \r\n // to the new height of the row.\r\n for (var i = 0; i < CellsInfo[idx.group].length; i++) {\r\n var idxStr = \"_\" + idx.group + \"_\" + i;\r\n var expandableDiv = document.getElementById(\"cell\" + idxStr);\r\n expandableDiv.style.height = newHeight + \"px\";\r\n var data = document.getElementById(\"data\" + idxStr);\r\n var expander = document.getElementById(\"expander\" + idxStr);\r\n var state = CellsInfo[idx.group][i];\r\n\r\n if (state.height > newHeight) {\r\n // Cell height exceeds row height - collapse a cell.\r\n data.style.height = (newHeight - EXPANDER_HEIGHT) + \"px\";\r\n expander.src = imgPath + \"ellipses_light.gif\";\r\n CellsInfo[idx.group][i].expanded = false;\r\n } else {\r\n // Cell height is less then or equal to row height - expand a cell.\r\n data.style.height = \"\";\r\n expander.src = imgPath + \"arrows_light.gif\";\r\n CellsInfo[idx.group][i].expanded = true;\r\n }\r\n }\r\n\r\n if (mayNeedScroll) {\r\n var idxStr = \"_\" + idx.group + \"_\" + idx.cell;\r\n var clickedExpandableDiv = document.getElementById(\"cell\" + idxStr);\r\n // Scroll page up if a row is collapsed and the rows top is above the \r\n // viewport. The amount of scroll is the difference between a new and old \r\n // row height.\r\n if (!isElemTopVisible(clickedExpandableDiv)) {\r\n window.scrollBy(0, newHeight - cellInfo.height);\r\n }\r\n }\r\n}", "function TNodes_doDOM_FitHeightEnh(nd,dh,caller){\n\t\t\tdh=dh || 0;\n\t\t\tcaller=caller || 'default'; // the function, calling this routine\n\t\t\tvar myalign = 'none';\n\t\t\tvar myspin = nd.Spin;\n\n // first the zeroNode\n this.Item[0].changeHeight(dh);\n this.Item[0].doDOM_Refresh();\n this.Height+=dh;\n\n\t\t\t// node HasParent ??? ==> normal node or zeronode\n if (nd.ZeroNodeType=='none') {\n\t\t\t\tvar cursplit = nd.Parent;\n\n // 1. ::::> \n //set the current split from the node that triggered the change of height \n\t\t\t\t\n\t\t\t\tcursplit.doFitHeight(dh, nd.Align);\t\t\t\t\n\n // 2. ::::> \n\t\t\t\t// the line of the parentnode has been dragged, position * is changed\n\t\t\t\t// fit the UpNode-Child of the bifork-split\n\t\t\t\t/*\t\t\t\t|-- +\n\t\t\t\t * \t|--\t* --\n\t\t\t\t * 0 --\t\t|-- +\n\t\t\t\t *\t\t|--\n\t\t\t\t * \n\t\t\t\t */\n\t\t\t\t\n\t\t\t\tif (cursplit.Orientation == 'h') {\n\t\t\t\t\tif (nd.Spin == 1) {\n\t\t\t\t\t\tif (cursplit.UpNode.HasChild) {\n\t\t\t\t\t\t\tcursplit.UpNode.Child.doRecursiveDrillDownFitHeight(dh, cursplit.UpNode.Align);// call through down node\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}\n\t\t\t\t}\n\n // 3. ::::> \n\t\t\t\t// call recursiv down for drilldown all splits below\n\t\t\t\t// call it just for the opposite node \n\t\t\t\tif (cursplit.Orientation == 'v') {\n\t\t\t\t\tif (nd.Spin == 1) {\n\t\t\t\t\t\tif (cursplit.DownNode.HasChild) {\n\t\t\t\t\t\t\tcursplit.DownNode.Child.doRecursiveDrillDownFitHeight(dh, cursplit.DownNode.Align);// call through down node\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\tif (cursplit.UpNode.HasChild) {\n\t\t\t\t\t\t\tcursplit.UpNode.Child.doRecursiveDrillDownFitHeight(dh, cursplit.UpNode.Align);// call through up node \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// 4. ::::>\n\t\t\t\t// query for list of all split-above the current split\n\t\t\t\t// in down to up order, parent is from type node\n\t\t\t\tif (cursplit.HasParent) {\n\t\t\t\t\tvar splitlist = this.doStepper('upsplits', cursplit.Parent);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\n\t\t\t\t// node is zero-node !!!\n\t\t\t\t}\n\t\t\t\t\n \t\t\tmyalign = cursplit.Parent.Align; // tell last align \n\t\t\t\tmyspin = cursplit.Parent.Spin; // tell last spin (means up- or down-node)\n\t\t\t\tfor (var e in splitlist) {\n\t\t\t\t\tcursplit = splitlist[e];\n\t\t\t\t\tcursplit.doFitHeight(dh, myalign);\n\t\t\t\t\tif (cursplit.Orientation == 'v') {\n\t\t\t\t\t\tif (myspin == 1) {\n\t\t\t\t\t\t\tif (cursplit.DownNode.HasChild) {\n\t\t\t\t\t\t\t\tcursplit.DownNode.Child.doRecursiveDrillDownFitHeight(dh, cursplit.DownNode.Align);// call through down node\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tif (cursplit.UpNode.HasChild) {\n\t\t\t\t\t\t\t\tcursplit.UpNode.Child.doRecursiveDrillDownFitHeight(dh, cursplit.UpNode.Align);// call through up node \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\t\n\t\t\t\t\tmyalign = cursplit.Parent.Align;\n\t\t\t\t\tmyspin = cursplit.Parent.Spin;\n\t\t\t\t}\n\t\t\t}// has parent\n\t\t\telse{\n\t\t\t\t// else is zero-node\n // 2. ::::> \n\n // fit the Node-Child of the zero-node --> this.Item[0]\n if (nd.ZeroNodeType=='root'){ \n if (nd.HasChild){\n nd.Child.doRecursiveDrillDownFitHeight(dh, 'bottom')\n } \n if (nd.ContainerList.Count==1){\n if (nd.ContainerList.Item[1].IsFitToParent){\n // calculate the new height ( = dh for the moment)\n var ctdh=this.Item[0].Height-nd.ContainerList.Item[1].Height;\n nd.ContainerList.Item[1].doFitToParent(nd.Height);\n }\n }\n }\t\t\t\t\n if (nd.ZeroNodeType=='container'){\n //if (this.Item[0].Owner.Owner.IsFitToParent){\n if (nd.HasChild){\n nd.Child.doRecursiveDrillDownFitHeight(dh, 'bottom');\n } \n //}\n } \n /* STICKER_mp \n if (nd.ZeroNodeType=='sticker'){\n doPrint('nodes-heightEnh sticker ->' + nd.Ident)\n nd.ContainerList.Item[1].doFitToParent(nd.Height);\n }\n */\n\t\t\t} \n\t\t\t\t\t\t\t\t\t \t\t\t\n\t\t\tvar i=0;\t\n\n\t\t} // end of Fit Height", "function campaignEqualHeight() {\n var heights = new Array();\n $('.campaign-item-wrap').each(function() { \n $(this).css('min-height', '166px');\n $(this).css('max-height', 'none');\n $(this).css('height', 'auto');\n heights.push($(this).height());\n });\n var max = Math.max.apply( Math, heights );\n $('.campaign-item-wrap').each(function() {\n $(this).css('height', max + 'px');\n }); \n }", "function expandResize() {\n const allPanels = document.querySelectorAll('[x-ref=\"panel\"]');\n allPanels.forEach((panel) => {\n const panelStatus = panel.parentElement.getAttribute('x-data');\n if (panelStatus === '{ selected: true }') {\n panel.style.setProperty('max-height', `${panel.scrollHeight}px`);\n }\n });\n}", "function equalheight(container) {\r\n\r\n\tvar currentTallest = 0, \r\n\t\tcurrentRowStart = 0, \r\n\t\trowDivs = new Array(), \r\n\t\t$el, topPosition = 0;\r\n\t\t\r\n\t$(container).each(function() {\r\n\t\t$el = $(this);\r\n\t\t$($el).height('auto')\r\n\t\ttopPostion = $el.position().top;\r\n\r\n\t\tif (currentRowStart != topPostion) {\r\n\t\t\tfor (currentDiv = 0; currentDiv < rowDivs.length; currentDiv++) {\r\n\t\t\t\trowDivs[currentDiv].height(currentTallest);\r\n\t\t\t}\r\n\t\t\trowDivs.length = 0; // empty the array\r\n\t\t\tcurrentRowStart = topPostion;\r\n\t\t\tcurrentTallest = $el.height();\r\n\t\t\trowDivs.push($el);\r\n\t\t} else {\r\n\t\t\trowDivs.push($el);\r\n\t\t\tcurrentTallest = (currentTallest < $el.height()) ? ($el.height()) : (currentTallest);\r\n\t\t}\r\n\t\tfor (currentDiv = 0; currentDiv < rowDivs.length; currentDiv++) {\r\n\t\t\trowDivs[currentDiv].height(currentTallest);\r\n\t\t}\r\n\t});\r\n}", "function expandPanel()\n\t{\n\t\t// resize to full size\n\t\tvar fullHeight = calcHeight(_options.elHeight);\n\t\t_svg.transition().duration(_options.animationDuration).attr(\"height\", fullHeight);\n\t}", "expandAllRows() {\n this.bodyComponent.toggleAllRows(true);\n }", "function setRowsHeight() {\n var ulHeight = (options.items * options.height) + \"px\";\n rows.css(\"height\", ulHeight);\n }", "function set_height_scroll_only(wrapper, el1, el2, el3, el4, el_set_heigth, outWidth) {\r\n var wrapper_el = $(wrapper);\r\n var h_wrapper = wrapper_el.height();\r\n var h_el1 = wrapper_el.find(el1).outerHeight(true);\r\n var h_el2 = wrapper_el.find(el2).outerHeight(true);\r\n var h_el3 = wrapper_el.find(el3).outerHeight(true);\r\n var h_el4 = wrapper_el.find(el4).outerHeight(true);\r\n\r\n var set_height_element = h_wrapper - h_el1 - h_el2 - h_el3 - h_el4 - 40 - outWidth;\r\n wrapper_el.find(el_set_heigth).css('height', set_height_element + 'px');\r\n}", "stretchChildren(size) {\n if (this.hasChildren()) {\n for (let child of this.children) {\n if (child.horizontalAlignment === 'Stretch' || child.desiredSize.width === undefined) {\n child.desiredSize.width = size.width - child.margin.left - child.margin.right;\n }\n if (child.verticalAlignment === 'Stretch' || child.desiredSize.height === undefined) {\n child.desiredSize.height = size.height - child.margin.top - child.margin.bottom;\n }\n if (child instanceof Container) {\n child.stretchChildren(child.desiredSize);\n }\n }\n }\n }", "function resizeUntilStable(elements) {\n\n //console.log('resizeUntilStable ', elements.length);\n\n if (elements.length) {\n var start = new Date();\n\n var loopCount = 0;\n\n var changed = changedElements(elements);\n\n while (changed.length && loopCount < maxEvalCycles) {\n _.forEach(_.map(elements, 'element'), resize);\n calcParentSizes(elements);\n changed = changedElements(elements);\n }\n\n if (loopCount >= maxEvalCycles) {\n console.error('spEditFormLayoutManager: Exceeded maximum evaluation cycles. Probably loop.');\n }\n\n var duration = new Date() - start;\n console.log('spEditFormLayoutManager: resize duration/elements/cycles: ', duration, '/', _.size(elements), '/', loopCount);\n }\n }", "_autoFitLastItem(lastItem, collapsedItems, lockedItems) {\n const that = this,\n itemsCount = that._items.length;\n let lastLockedItem;\n\n if (itemsCount === 1 && that._items[0].locked) {\n lastLockedItem = that._items[0];\n lastLockedItem.locked = false;\n }\n\n if (lockedItems.length === itemsCount) {\n lockedItems[0].unlock();\n }\n\n if (!lastItem) {\n lastItem = lockedItems[0];\n lastItem.unlock();\n }\n\n let totalItemSize = 0,\n totalBarsSize = 0;\n\n that._items.map(item => totalItemSize += !item.collapsed ?\n (item.style[that._measurements.dimension] && item.style[that._measurements.dimension].indexOf('%') < -1 && item._sizeBeforeCollapse ?\n item._sizeBeforeCollapse : item.getBoundingClientRect()[that._measurements.dimension]) : 0);\n\n that.bars.map(bar => totalBarsSize += bar[that._measurements.size]);\n\n const currentSplitterSize = totalItemSize + totalBarsSize,\n containerSize = that.$.container.getBoundingClientRect()[that._measurements.dimension];\n\n if (currentSplitterSize !== containerSize) {\n let lastItemSize;\n\n if (lastItem.style[that._measurements.dimension].indexOf('%') < -1) {\n lastItemSize = lastItem._sizeBeforeCollapse ? lastItem._sizeBeforeCollapse : lastItem.getBoundingClientRect()[that._measurements.dimension];\n }\n else {\n lastItemSize = lastItem.getBoundingClientRect()[that._measurements.dimension];\n }\n\n let sizeDifference = Math.abs(containerSize - currentSplitterSize),\n sign = currentSplitterSize < containerSize ? 1 : -1;\n\n lastItem.style[that._measurements.dimension] =\n (lastItem._sizeBeforeCollapse = Math.max(0, (lastItemSize + sign * sizeDifference))) + 'px';\n\n if (lastItem._sizeLimits[that._measurements.maxDimension] && lastItem._sizeBeforeCollapse > lastItem._sizeLimits[that._measurements.maxDimension]) {\n lastItem.style[that._measurements.maxDimension] = (lastItem._sizeLimits[that._measurements.maxDimension] = lastItem._sizeBeforeCollapse) + 'px';\n }\n }\n\n if (lastLockedItem) {\n lastLockedItem.locked = true;\n }\n }", "setLayout() {\n const {\n container,\n state,\n } = this\n const {\n heights,\n } = state\n var element = document.querySelector('.masonry-panel'),\n elements = document.querySelectorAll('.masonry-panel'),\n style = window.getComputedStyle(element),\n width = style.getPropertyValue('width');\n width = width.replace('px', '');\n width = width/window.innerWidth;\n var cols = Math.ceil(1/width) - 1;\n var number = (Math.ceil(elements.length/cols) + 1);\n this.state.maxHeight = (Math.max(...heights));\n var targetHeight = this.state.maxHeight + (17 * number);\n container.style.height = `${targetHeight}px`\n }", "function resizeGroup(selector) {\n\t\tvar elems = $(selector);\n\n\t\tif(elems.length < 1) { return false; }\n\n\t\tvar heights = [];\n\n\t\telems.css('min-height', 0);\n\t\telems.each(function() { heights.push($(this).outerHeight()); });\n\n\t\t// Get the highest value\n\t\tvar highestCol = Math.max.apply(null, heights);\n\n\t\t// Set highest value to all elements\n\t\telems.css('min-height', highestCol+'px');\n\t}", "function bfa_equal_columns() {\r\n\tjQuery('.ehc').each( function() {\r\n\t\tvar row = jQuery(this);\r\n\t\tif ( ua.msie && parseInt( ua.version, 10 ) < 8 ) {\r\n\t\t\tvar height = row.outerHeight(); // outerheight for IE < 8\r\n\t\t} else {\r\n\t\t\t// var height = row.height();\r\n\t\t\tvar height = row.outerHeight();\r\n\t\t}\r\n\t\trow.find('> div').each( function() { \r\n\t\t\tjQuery(this).height( height ); \r\n\t\t});\r\n\t});\r\n}", "function auto_grow(element) {\n element.style.height = \"5px\";\n element.style.height = (element.scrollHeight) + \"px\";\n}", "measure(availableSize) {\n let desired = undefined;\n let desiredBounds = undefined;\n if (this.hasChildren()) {\n //Measuring the children\n for (let child of this.children) {\n if (child instanceof TextElement) {\n if (child.canMeasure) {\n availableSize.width = availableSize.width || this.maxWidth || this.minWidth;\n child.measure(availableSize);\n }\n else {\n break;\n }\n }\n else if (!(child instanceof TextElement)) {\n child.measure(availableSize);\n }\n let childSize = child.desiredSize.clone();\n if (child.rotateAngle !== 0) {\n childSize = rotateSize(childSize, child.rotateAngle);\n }\n let right = childSize.width + child.margin.right;\n let bottom = childSize.height + child.margin.bottom;\n let childBounds = new Rect(child.margin.left, child.margin.top, right, bottom);\n if (child.float) {\n let position = child.getAbsolutePosition(childSize);\n if (position !== undefined) {\n continue;\n }\n }\n if ((!(child instanceof TextElement)) || (child instanceof TextElement && child.canConsiderBounds)) {\n if (desiredBounds === undefined) {\n desiredBounds = childBounds;\n }\n else {\n desiredBounds.uniteRect(childBounds);\n }\n }\n }\n if (desiredBounds) {\n let leftMargin = 0;\n let topMargin = 0;\n leftMargin = Math.max(desiredBounds.left, 0);\n topMargin = Math.max(desiredBounds.top, 0);\n desired = new Size(desiredBounds.width + leftMargin, desiredBounds.height + topMargin);\n }\n }\n desired = super.validateDesiredSize(desired, availableSize);\n super.stretchChildren(desired);\n this.desiredSize = desired;\n return desired;\n }", "function expandSection(s) {\n var text = tbody.children('tr').children('td').children('.wm_c_desc');\n var scH = 0;\n var taH = 0;\n var loops = 0;\n liH = getLiHeight();\n liHeight = getLiHeight();\n if (that.children('i').hasClass('fa-plus-square-o')) {\n console.log(\"expanding course\");\n tbody.children('tr').children('.wm_c_prof').html(parseProf(s.sectionProfessors));\n tbody.children('tr').children('.wm_c_time').html(s.sectionTime);\n tbody.children('tr').children('.wm_c_loc').html(s.sectionLocation);\n tbody.children('tr').children('.wm_c_seats').html('seats: ' + s.sectionSeats_available);\n \n info.children('.wm-table').removeClass('hidden');\n \n that.html(\"<i class='fa fa-minus-square-o fa-3x'></i>\");\n info.addClass('wm-info-expanded');\n \n console.log(\"liH: \"+liH+\"\\t\");\n li.children('.wm_c_dnum').height(dim[1] / 10);\n \n scH = text[0].scrollHeight;\n taH = text.innerHeight();\n \n if (li.data().liHeight) {\n li.height(li.data().liHeight);\n }\n else {\n while (scH > (text.innerHeight())) {\n console.log('liH: '+liH+'\\t');\n console.log('taH: '+taH+'\\t');\n console.log('The scrollHeight '+text[0].scrollHeight+' is bigger than the textheight '+text.innerHeight());\n console.log(\"liHeight \"+li.height());\n li.height(liHeight + 10);\n liHeight += 10;\n text.height(taH + 10);\n taH += 10;\n loops += 1;\n if (loops > 300) {\n break;\n }\n console.log(\"liH: \"+liH+\"\\t\");\n }\n li.height(li.height() + dim[1] / 2.5);\n li.data(\"liHeight\", li.height());\n }\n }\n else {\n console.log(\"collapsing course\");\n console.log(\"liH: \"+liH+\"\\t\");\n that.html(\"<i class='fa fa-plus-square-o fa-3x'></i>\");\n info.removeClass('wm-info-expanded');\n info.children('.wm-table').addClass('hidden');\n console.log('collapsing liH: '+liH+'\\t');\n li.height(dim[1] / 10);\n }\n }", "_validateItemsSizeOverflowing(sizeDifference, noStyleChangedIgnoring) {\n const that = this,\n itemsCount = that._items.length;\n let newSize = 0,\n initialSize, itemsLocked = [], currentSize, currentlySetSize, lastLockedItem,\n containerRect = that.$.container.getBoundingClientRect();\n\n for (let i = 0; i < that._items.length; i++) {\n //Note: If the size is set in percentages via CSS, it's not possible check if it's really percentages or not \n //because even getComputedStyle returns the computed size not the original.\n //The only way to work is by setting the size property to a percentage value !\n currentlySetSize = that._items[i].style[that._measurements.dimension];\n currentSize = currentlySetSize.indexOf('%') > -1 ? currentlySetSize : that._items[i][that._measurements.size];\n\n if (!currentlySetSize && !that._items[i].size && that._items[i].size !== 0) {\n delete that._items[i]._originalSize;\n }\n\n that._items[i]._originalSize = that._items[i]._originalSize ? that._items[i]._originalSize : currentSize;\n itemsLocked.push(that._items[i].locked);\n }\n\n if (itemsLocked.indexOf(false) < 0) {\n lastLockedItem = that._items[that._items.length - 1];\n lastLockedItem.locked = false;\n }\n\n //Check how many items should be resized to fit\n for (let i = itemsCount - 1; i >= 0; i--) {\n if (that._items[i].collapsed || that._items[i].locked) {\n continue;\n }\n\n if ((that._items[i]._originalSize + '').indexOf('%') > -1) {\n that._items[i].style[that._measurements.dimension] = that._items[i]._originalSize;\n that._items[i]._sizeBeforeCollapse = containerRect[that._measurements.dimension] * parseFloat(that._items[i]._originalSize) / 100;\n continue;\n }\n\n if (sizeDifference === 0) {\n continue;\n }\n\n //Doesn't include the item paddings\n initialSize = that._items[i].getBoundingClientRect()[that._measurements.dimension];\n\n newSize = initialSize - sizeDifference;\n\n //May trigger the styleChanged event\n that._items[i].style[that._measurements.dimension] =\n (that._items[i]._sizeBeforeCollapse = Math.max(that._items[i]._sizeLimits ? that._items[i]._sizeLimits[that._measurements.minDimension] : 0, newSize)) + 'px';\n\n sizeDifference -= initialSize - that._items[i]._sizeBeforeCollapse;\n }\n\n //Reduce the min-sizes if necessary\n if (sizeDifference > 0) {\n for (let i = itemsCount - 1; i >= 0; i--) {\n if (that._items[i].collapsed) {\n continue;\n }\n\n initialSize = that._items[i].getBoundingClientRect()[that._measurements.dimension];\n newSize = initialSize - sizeDifference;\n\n let itemMin = that._items[i]._sizeLimits[that._measurements.minDimension] || that._items[i].min;\n\n if (itemMin) {\n if ((itemMin + '').indexOf('%') > -1) {\n itemMin = parseFloat(itemMin) / 100 * that._items[i].parentElement[that._measurements.size];\n }\n else {\n itemMin = parseFloat(itemMin);\n }\n\n if (itemMin > newSize) {\n //Ignore the StyleChanged event\n that._items[i]._sizeLimits.ignoreUpdate = noStyleChangedIgnoring ? false : true;\n that._items[i].style[that._measurements.minDimension] = Math.max(0, newSize) + 'px';\n }\n }\n\n if (that._items[i]._originalSize && (that._items[i]._originalSize + '').indexOf('%') > -1) {\n continue;\n }\n\n that._items[i]._sizeLimits.ignoreUpdate = noStyleChangedIgnoring ? false : true;\n that._items[i].style[that._measurements.dimension] = (that._items[i]._sizeBeforeCollapse = Math.max(0, newSize)) + 'px';\n\n sizeDifference -= initialSize - that._items[i]._sizeBeforeCollapse;\n }\n }\n\n if (lastLockedItem) {\n lastLockedItem.locked = true;\n }\n }", "function wrapExpandables (sel) {\n // Wrap snippets\n !function () {\n var $snippets = $('.is-snippet-wrapper').filter(':visible');\n\n _.forEach($snippets, function (snippet) {\n var snippetHeight = snippet.clientHeight,\n codeHeight,\n $snippet;\n\n // This snippet is most likely limited via CSS\n // The value we're looking for is 200, but since we're comparing with clientHeight (which doesn't include borders)\n // we're using 198 as the comparison, allowing for a 1px border. We could use offsetHeight instead, but that's\n // considered slower than clientHeight.\n if (snippetHeight >= (200 - 2)) {\n snippet.className.indexOf('is-expandable') === -1 &&\n (snippet.className += ' is-expandable');\n }\n });\n }();\n\n // Wrap tables in the markdown\n !function () {\n var $tables = $('.is-table-wrapper');\n\n _.forEach($tables, function (table) {\n var tableHeight = table.clientHeight,\n tableWidth = $(table).children('table').get(0).clientWidth,\n maxWidth = table.clientWidth,\n codeHeight,\n $table;\n\n // This table is most likely limited via CSS\n if (tableHeight >= 500 || tableWidth > maxWidth) {\n table.className.indexOf('is-expandable') === -1 &&\n (table.className += ' is-expandable');\n }\n });\n }();\n}", "function sizeToFit() {\n gridManager.sizeToFit();\n}", "updateHeightForRowWidget(viewer, isUpdateVerticalPosition, tableCollection, rowCollection, rowWidget, isLayouted, endRowWidget, isInitialLayout) {\n for (let i = 0; i < rowWidget.childWidgets.length; i++) {\n let cellspacing = 0;\n let cellWidget = undefined;\n let childWidget = rowWidget.childWidgets[i];\n // if (childWidget instanceof TableCellWidget) {\n cellWidget = childWidget;\n // }\n let rowSpan = 1;\n rowSpan = cellWidget.cellFormat.rowSpan;\n cellspacing = HelperMethods.convertPointToPixel(cellWidget.ownerTable.tableFormat.cellSpacing);\n if (rowSpan > 1) {\n let currentRowWidgetIndex = rowWidget.containerWidget.childWidgets.indexOf(rowWidget);\n // tslint:disable-next-line:max-line-length\n let rowSpanWidgetEndIndex = currentRowWidgetIndex + rowSpan - 1 - (rowWidget.index - cellWidget.rowIndex);\n if (!isInitialLayout && (viewer.clientArea.bottom < cellWidget.y + cellWidget.height + cellWidget.margin.bottom\n || rowSpanWidgetEndIndex >= currentRowWidgetIndex + 1)) {\n this.splitSpannedCellWidget(cellWidget, tableCollection, rowCollection, viewer);\n }\n let spanEndRowWidget = rowWidget;\n if (rowSpanWidgetEndIndex > 0) {\n if (rowSpanWidgetEndIndex < rowWidget.containerWidget.childWidgets.length) {\n let childWidget = rowWidget.containerWidget.childWidgets[rowSpanWidgetEndIndex];\n if (childWidget instanceof TableRowWidget) {\n spanEndRowWidget = childWidget;\n if (spanEndRowWidget === endRowWidget) {\n spanEndRowWidget = rowWidget;\n }\n }\n }\n else {\n // tslint:disable-next-line:max-line-length\n spanEndRowWidget = rowWidget.containerWidget.childWidgets[rowWidget.containerWidget.childWidgets.length - 1];\n }\n }\n if (cellWidget.y + cellWidget.height + cellWidget.margin.bottom < spanEndRowWidget.y + spanEndRowWidget.height) {\n cellWidget.height = spanEndRowWidget.y + spanEndRowWidget.height - cellWidget.y - cellWidget.margin.bottom;\n // tslint:disable-next-line:max-line-length\n }\n else if (isLayouted && spanEndRowWidget && (spanEndRowWidget.y !== 0 && spanEndRowWidget.height !== 0) && cellWidget.y + cellWidget.height + cellWidget.margin.bottom > spanEndRowWidget.y + spanEndRowWidget.height) {\n spanEndRowWidget.height = cellWidget.y + cellWidget.height + cellWidget.margin.bottom - spanEndRowWidget.y;\n // tslint:disable-next-line:max-line-length\n //Update the next rowlayout widget location. Reason for the updation is previous row height is updated when cell height is greater. So already layouted next row location has to be updated again.\n // if (rowWidget === spanEndRowWidget && rowWidget.nextWidget instanceof TableRowWidget) {\n // let nextRow: TableRowWidget = rowWidget.nextWidget as TableRowWidget;\n // // Need to update on this further\n // // if (viewer.renderedElements.containsKey(nextRow)) {\n // // let nextWidget: TableRowWidget[] = viewer.renderedElements.get(nextRow) as TableRowWidget[];\n // // if (nextWidget.length > 0) {\n // // nextWidget[0].x = nextWidget[0].x;\n // // nextWidget[0].y = rowWidget.y + rowWidget.height;\n // // }\n // // }\n // }\n }\n }\n else {\n if (cellspacing > 0) {\n // In the Case of tableWidget is greater than one and rowWidget is start at the Top Position of the page. \n // In such case we have update the cell height with half of cell spacing.\n // Remaining cases we have to update the entire hight\n // tslint:disable-next-line:max-line-length\n if (tableCollection.length > 1 && rowWidget.y === viewer.clientArea.y && viewer instanceof PageLayoutViewer) {\n cellspacing = cellspacing / 2;\n }\n }\n cellWidget.height = rowWidget.height - cellWidget.margin.top - cellWidget.margin.bottom - cellspacing;\n }\n this.updateHeightForCellWidget(viewer, tableCollection, rowCollection, cellWidget);\n let widget = rowWidget.containerWidget;\n while (widget.containerWidget instanceof Widget) {\n widget = widget.containerWidget;\n }\n let page = undefined;\n if (widget instanceof BodyWidget) {\n page = widget.page;\n }\n // tslint:disable-next-line:max-line-length\n if ((viewer instanceof PageLayoutViewer && viewer.visiblePages.indexOf(page) !== -1) || isUpdateVerticalPosition) {\n this.updateCellVerticalPosition(cellWidget, false, false);\n }\n //Renders the current table row contents, after relayout based on editing.\n // if (viewer instanceof PageLayoutViewer && (viewer as PageLayoutViewer).visiblePages.indexOf(page) !== -1) {\n // //Added proper undefined condition check for Asynchronous operation.\n // if (!isNullOrUndefined(rowWidget.tableRow) && !isNullOrUndefined(rowWidget.tableRow.rowFormat)) {\n // this.viewer.updateScrollBars();\n // //this.render.renderTableCellWidget(page, cellWidget);\n // }\n // }\n }\n }", "function expanded_size(_foldedSizeX, _foldedSizeY, _unfoldedSizeX, _unfoldedSizeY){\n //post(\"expanded_size \" + _foldedSizeX + \" | \" + _foldedSizeY + \" | \" + _unfoldedSizeX + \" | \" + _unfoldedSizeY + \"\\n\");\n myNodeSizes[1] = new Array(_foldedSizeX, _foldedSizeY);\n myNodeSizes[2] = new Array(_unfoldedSizeX, _unfoldedSizeY);\n expand();\n}", "function equalizeHeights(tabContentCol){\r\n\t\t\tvar tallest = getTallestHeight(tabContentCol);\r\n\t\t\t//alert(\"Equalize heights to: \" + tallest);\r\n\t\t\tsetMinHeight(tabContentCol,tallest);\r\n\t\t}", "function takeExpand() {\n var coll = document.getElementsByClassName(\"collapsible\");\n var i;\n\n for (i = 0; i < coll.length; i++) {\n coll[i].addEventListener(\"click\", function() {\n this.classList.toggle(\"active\");\n var content = this.nextElementSibling;\n if (content.style.maxHeight) {\n content.style.maxHeight = null;\n } else {\n content.style.maxHeight = content.scrollHeight + \"px\";\n }\n });\n }\n}", "updateInnerWidthDependingOnChilds(){this.__cacheWidthPerColumn=null,this.__asyncWorkData[\"System.TcHmiGrid.triggerRebuildAll\"]=!0,this.__requestAsyncWork()}", "measureRowHeight() {\n const me = this,\n // Create a fake subgrid with one row, since styling for row is specified on .b-grid-subgrid .b-grid-row\n rowMeasureElement = DomHelper.createElement({\n tag: 'div',\n // TODO: should either get correct widgetClassList or query features for measure classes\n className: 'b-grid ' + (me.features.stripe ? 'b-stripe' : ''),\n style: 'position: absolute; visibility: hidden',\n html: '<div class=\"b-grid-subgrid\"><div class=\"b-grid-row\"></div></div>',\n parent: document.getElementById(me.appendTo) || document.body\n });\n\n // Use style height or default height from config.\n // Not using clientHeight since it will have some value even if no height specified in CSS\n const rowEl = rowMeasureElement.firstElementChild.firstElementChild,\n styleHeight = parseInt(DomHelper.getStyleValue(rowEl, 'height')),\n borderTop = parseInt(DomHelper.getStyleValue(rowEl, 'border-top-width')),\n borderBottom = parseInt(DomHelper.getStyleValue(rowEl, 'border-bottom-width'));\n\n // Change rowHeight if specified in styling, also remember that value to replace later if theme changes and\n // user has not explicitly set some other height\n if (me.rowHeight == null || me.rowHeight === me._rowHeightFromStyle) {\n me.rowHeight = !isNaN(styleHeight) && styleHeight ? styleHeight : me.defaultRowHeight;\n me._rowHeightFromStyle = me.rowHeight;\n }\n\n // this measurement will be added to rowHeight during rendering, to get correct cell height\n me._rowBorderHeight = borderTop + borderBottom;\n\n me._isRowMeasured = true;\n\n rowMeasureElement.remove();\n\n // There is a ticket about measuring the actual first row instead:\n // https://app.assembla.com/spaces/bryntum/tickets/5735-measure-first-real-rendered-row-for-rowheight/details\n }", "function trx_addons_sc_fullheight_init(e, container) {\n \"use strict\";\n\n if (arguments.length < 2) var container = jQuery('body');\n if (container===undefined || container.length === undefined || container.length == 0) return;\n\n container.find('.trx_addons_stretch_height').each(function () {\n \"use strict\";\n var fullheight_item = jQuery(this);\n // If item now invisible\n if (jQuery(this).parents('div:hidden,article:hidden').length > 0) {\n return;\n }\n var wh = 0;\n var fullheight_row = jQuery(this).parents('.vc_row-o-full-height');\n if (fullheight_row.length > 0) {\n wh = fullheight_row.css('height') != 'auto' ? fullheight_row.height() : 'auto';\n } else {\n if (screen.height > 1000) {\n var adminbar = jQuery('#wpadminbar');\n wh = alices_win.height() - (adminbar.length > 0 ? adminbar.height() : 0);\n } else\n wh = 'auto';\n }\n if (wh == 'auto' || wh > 0) fullheight_item.height(wh);\n });\n}", "calculateAllRowHeights(silent = false) {\n const {\n store,\n rowManager\n } = this,\n count = Math.min(store.count, this.preCalculateHeightLimit); // Allow opt out by specifying falsy value.\n\n if (count) {\n rowManager.clearKnownHeights();\n\n for (let i = 0; i < count; i++) {\n // This will both calculate and store the height\n this.getRowHeight(store.getAt(i));\n } // Make sure height is reflected on scroller etc.\n\n if (!silent) {\n rowManager.estimateTotalHeight(true);\n }\n }\n }", "function setSameHeight(opt) {\r\n // default options\r\n var options = {\r\n holder: null,\r\n skipClass: 'same-height-ignore',\r\n leftEdgeClass: 'same-height-left',\r\n rightEdgeClass: 'same-height-right',\r\n elements: '>*',\r\n flexible: false,\r\n multiLine: false,\r\n useMinHeight: false,\r\n biggestHeight: false\r\n };\r\n for(var p in opt) {\r\n if(opt.hasOwnProperty(p)) {\r\n options[p] = opt[p];\r\n }\r\n }\r\n\r\n // init script\r\n if(options.holder) {\r\n var holders = lib.queryElementsBySelector(options.holder);\r\n lib.each(holders, function(ind, curHolder){\r\n var curElements = [], resizeTimer, postResizeTimer;\r\n var tmpElements = lib.queryElementsBySelector(options.elements, curHolder);\r\n\r\n // get resize elements\r\n for(var i = 0; i < tmpElements.length; i++) {\r\n if(!lib.hasClass(tmpElements[i], options.skipClass)) {\r\n curElements.push(tmpElements[i]);\r\n }\r\n }\r\n if(!curElements.length) return;\r\n\r\n // resize handler\r\n function doResize() {\r\n for(var i = 0; i < curElements.length; i++) {\r\n curElements[i].style[options.useMinHeight && SameHeight.supportMinHeight ? 'minHeight' : 'height'] = '';\r\n }\r\n\r\n if(options.multiLine) {\r\n // resize elements row by row\r\n SameHeight.resizeElementsByRows(curElements, options);\r\n } else {\r\n // resize elements by holder\r\n SameHeight.setSize(curElements, curHolder, options);\r\n }\r\n }\r\n doResize();\r\n\r\n // handle flexible layout / font resize\r\n function flexibleResizeHandler() {\r\n clearTimeout(resizeTimer);\r\n resizeTimer = setTimeout(function(){\r\n doResize();\r\n clearTimeout(postResizeTimer);\r\n postResizeTimer = setTimeout(doResize, 100);\r\n },1);\r\n }\r\n if(options.flexible) {\r\n addEvent(window, 'resize', flexibleResizeHandler);\r\n addEvent(window, 'orientationchange', flexibleResizeHandler);\r\n FontResizeEvent.onChange(flexibleResizeHandler);\r\n }\r\n // handle complete page load including images and fonts\r\n addEvent(window, 'load', flexibleResizeHandler);\r\n });\r\n }\r\n\r\n // event handler helper functions\r\n function addEvent(object, event, handler) {\r\n if(object.addEventListener) object.addEventListener(event, handler, false);\r\n else if(object.attachEvent) object.attachEvent('on'+event, handler);\r\n }\r\n}", "function fit_elm(item){\n\t\tvar tw = item.elm.parent().width();\n\t\tvar uw = item.minWidth;\n\n\t\tvar zoom = tw/uw;\n\n\t\tif(zoom < 1){\n\t\t\tvar options = {itemId:item.id, itemTitle: item.title};\n\t\t\tif( typeof(_tplLink) == 'function' ){\n\t\t\t\titem.elm.html( _tplLink(options) );\n\t\t\t}else{\n\t\t\t\titem.elm.html( bindContents(_tplLink, options) );\n\t\t\t}\n\t\t}else{\n\t\t\titem.elm.html(item.elmSrc);\n\t\t}\n\n\t}", "function resize() {\n var sentinel = false;\n\n for(var i = 0; i < visCount; i++) {\n if ((d3.select(\"#vis\" + i)).attr(\"height\") < 400)\n sentinel = true;\n }\n if(sentinel) {\n height *= 2;\n\n d3.selectAll(\".assignmentContainer\")\n .attr( \"height\", height );\n d3.selectAll(\".svg\")\n .attr( \"height\", height );\n } else {\n height /= 2;\n\n d3.selectAll(\".assignmentContainer\")\n .attr(\"height\", height);\n d3.selectAll(\".svg\")\n .attr(\"height\", height);\n }\n}" ]
[ "0.809538", "0.8044173", "0.8043992", "0.8038227", "0.8015", "0.8012711", "0.8012711", "0.8012711", "0.8012711", "0.8012711", "0.8012711", "0.8012711", "0.8012711", "0.79982144", "0.79982144", "0.79982144", "0.79982144", "0.79920906", "0.79196715", "0.7593259", "0.5908195", "0.5908195", "0.5908195", "0.5908195", "0.5858649", "0.5854948", "0.5740684", "0.5740684", "0.5740684", "0.5738154", "0.5738154", "0.5738154", "0.5738154", "0.5738154", "0.5738154", "0.5738154", "0.5738154", "0.5734798", "0.5727732", "0.5727732", "0.5727732", "0.5727732", "0.57157063", "0.57155156", "0.57155156", "0.57155156", "0.5710988", "0.52461505", "0.5243788", "0.52130455", "0.50828993", "0.5060664", "0.5039014", "0.50175405", "0.4991681", "0.49656785", "0.49367976", "0.49359855", "0.4932026", "0.4902078", "0.48911655", "0.487969", "0.48784465", "0.48681733", "0.48393208", "0.48388767", "0.48331562", "0.48303196", "0.4828822", "0.48163676", "0.4791828", "0.47878826", "0.47699308", "0.4748853", "0.4736481", "0.47347742", "0.47264454", "0.470377", "0.470155", "0.4700961", "0.46909344", "0.46532127", "0.46463105", "0.4642057", "0.46374068", "0.4633737", "0.46220475", "0.46194464", "0.46063003", "0.46045956", "0.45803267", "0.45725054", "0.4570589", "0.4569307", "0.45560706", "0.45476398", "0.45461246", "0.45396104", "0.4538759", "0.45336384" ]
0.80237633
4
Undoes distrubuteHeight, restoring all els to their natural height
function undistributeHeight(els) { els.forEach(function (el) { el.style.height = ''; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function undistributeHeight(els){els.height('');}", "function undistributeHeight(els) {\n els.height('');\n}", "function undistributeHeight(els) {\n els.height('');\n}", "function undistributeHeight(els) {\n els.height('');\n}", "function undistributeHeight(els) {\n els.height('');\n}", "function undistributeHeight(els) {\n\tels.height('');\n}", "function undistributeHeight(els) {\n\tels.height('');\n}", "function undistributeHeight(els) {\n\tels.height('');\n}", "function undistributeHeight(els) {\n\tels.height('');\n}", "function undistributeHeight(els) {\n\tels.height('');\n}", "function undistributeHeight(els) {\n\tels.height('');\n}", "function undistributeHeight(els) {\n\tels.height('');\n}", "function undistributeHeight(els) {\n\tels.height('');\n}", "function undistributeHeight(els) {\n els.height('');\n }", "function undistributeHeight(els) {\n\t\tels.height('');\n\t}", "function undistributeHeight(els) {\n els.forEach(function (el) {\n el.style.height = '';\n });\n }", "function undistributeHeight(els) {\n els.forEach(function (el) {\n el.style.height = '';\n });\n}", "clearKnownHeights() {\n this.heightMap.clear();\n this.averageRowHeight = this.totalKnownHeight = 0;\n }", "function normalizeHeight () {\n var $boxes = $('.height-normalize');\n var tempHeight = 0;\n $boxes.each(function (index, element) {\n var $this = $(this);\n var height = $this.height();\n tempHeight = (height > tempHeight) ? height : tempHeight;\n });\n if (tempHeight > 0) {\n $boxes.height(tempHeight);\n }\n }", "function reset_u_heights() {\n let heights = {};\n $(\".frames .view-back li\").each(function (index, value) {\n heights[$(this).data('num-u')] = $(this).height();\n // console.log('li' + index + ':' + $(this).data('num-u') + ' -> ' + $(this).height());\n });\n jQuery.each(heights, function (index, value) {\n $(\".frames .view-front li[data-num-u='\" + index + \"']\").height(value + 'px');\n });\n}", "function normalizeHeightsFunc() {\n\t\t// Declare variables\n\t\tvar items = jQuery(container).find(elements), //grab all slides\n\t\t\theights = [], //create empty array to store height values\n\t\t\ttallest; //create variable to make note of the tallest slide\n\t\t// Foreach post, clear min-height and check true height\n\t\titems.each(function() { //add heights to array\n\t\t\tjQuery(this).css('min-height','0');\n\t\t\theights.push(jQuery(this).height()); \n\t\t});\n\t\t// ID the tallest\n tallest = Math.max.apply(null, heights)+1+addon; //cache largest value + 1 to round up\n // Set min-heights to match the tallest\n items.each(function() {\n jQuery(this).css('min-height',tallest + 'px');\n });\n console.log('normalizeHeights: '+container+' '+elements+' to '+tallest+'px')\n\t}", "function setUnripeHeight(proportion) {\n var defaultHeight = parseInt($(\"#unripe\").height());\n var stemHeight = 0.22 * defaultHeight;\n var tomatoHeight = defaultHeight - stemHeight;\n var newHeight = proportion * tomatoHeight + stemHeight;\n $(\"#unripeContainer\").height(newHeight);\n unripeHeight = proportion;\n }", "updateElementsHeight() {\n const me = this;\n // prevent unnecessary style updates\n if (me.lastHeight !== me.height) {\n const elements = me._elementsArray;\n\n for (let i = 0; i < elements.length; i++) {\n elements[i].style.height = `${me.offsetHeight}px`;\n }\n me.lastHeight = me.height;\n }\n }", "function sortByHeight() {}", "function normalize() {\n var i,hMax,hMin,range;\n \n hMax = -32000;\n hMin = 32000;\n \n for (i = 0; i < pixelCount; i++) {\n if (heightMap[i] > hMax) { hMax = heightMap[i]; }\n if (heightMap[i] < hMin) { hMin = heightMap[i]; } \n }\n range = hMax - hMin;\n \n for (i = 0; i < pixelCount; i++) {\n heightMap[i] = (heightMap[i] - hMin) / range;\n }\n}", "updateElementsHeight() {\n const me = this;\n me.rowManager.storeKnownHeight(me.id, me.height); // prevent unnecessary style updates\n\n if (me.lastHeight !== me.height) {\n const elements = me._elementsArray;\n\n for (let i = 0; i < elements.length; i++) {\n elements[i].style.height = `${me.offsetHeight}px`;\n }\n\n me.lastHeight = me.height;\n }\n }", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\n var flexOffsets = []; // amount of vertical space it takes up\n\n var flexHeights = []; // actual css height\n\n var usedHeight = 0;\n undistributeHeight(els); // give all elements their natural height\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n\n els.forEach(function (el, i) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = dom_geom_1.computeHeightAndMargins(el);\n\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push(el.offsetHeight);\n } else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n }); // readjust the recommended height to only consider the height available to non-maxed-out rows.\n\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n } // assign heights to all expandable elements\n\n\n flexEls.forEach(function (el, i) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n if (naturalOffset < minOffset) {\n // we check this again because redistribution might have changed things\n el.style.height = newHeight + 'px';\n }\n });\n }", "__smTeardown() {\n const heightProp = this.heightProperty;\n\n if (!this.alwaysUseDefaultHeight && this.element && this.get('contentInserted')) {\n this.element.style[heightProp] = `${this.satellite.geography.height}px`;\n }\n this.setProperties({ contentCulled: true, contentHidden: false, contentInserted: false });\n }", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\n var flexOffsets = []; // amount of vertical space it takes up\n\n var flexHeights = []; // actual css height\n\n var usedHeight = 0;\n undistributeHeight(els); // give all elements their natural height\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n\n els.forEach(function (el, i) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalHeight = el.getBoundingClientRect().height;\n var naturalOffset = naturalHeight + computeVMargins(el);\n\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push(naturalHeight);\n } else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n }); // readjust the recommended height to only consider the height available to non-maxed-out rows.\n\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n } // assign heights to all expandable elements\n\n\n flexEls.forEach(function (el, i) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n if (naturalOffset < minOffset) {\n // we check this again because redistribution might have changed things\n el.style.height = newHeight + 'px';\n }\n });\n } // Undoes distrubuteHeight, restoring all els to their natural height", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n\n\t\t// *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n\t\t// and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n\n\t\tvar minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\t\tvar minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\t\tvar flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\t\tvar flexOffsets = []; // amount of vertical space it takes up\n\t\tvar flexHeights = []; // actual css height\n\t\tvar usedHeight = 0;\n\n\t\tundistributeHeight(els); // give all elements their natural height\n\n\t\t// find elements that are below the recommended height (expandable).\n\t\t// important to query for heights in a single first pass (to avoid reflow oscillation).\n\t\tels.each(function(i, el) {\n\t\t\tvar minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n\t\t\tvar naturalOffset = $(el).outerHeight(true);\n\n\t\t\tif (naturalOffset < minOffset) {\n\t\t\t\tflexEls.push(el);\n\t\t\t\tflexOffsets.push(naturalOffset);\n\t\t\t\tflexHeights.push($(el).height());\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// this element stretches past recommended height (non-expandable). mark the space as occupied.\n\t\t\t\tusedHeight += naturalOffset;\n\t\t\t}\n\t\t});\n\n\t\t// readjust the recommended height to only consider the height available to non-maxed-out rows.\n\t\tif (shouldRedistribute) {\n\t\t\tavailableHeight -= usedHeight;\n\t\t\tminOffset1 = Math.floor(availableHeight / flexEls.length);\n\t\t\tminOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n\t\t}\n\n\t\t// assign heights to all expandable elements\n\t\t$(flexEls).each(function(i, el) {\n\t\t\tvar minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n\t\t\tvar naturalOffset = flexOffsets[i];\n\t\t\tvar naturalHeight = flexHeights[i];\n\t\t\tvar newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n\t\t\tif (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n\t\t\t\t$(el).height(newHeight);\n\t\t\t}\n\t\t});\n\t}", "function resetHeight() {\n var height = 0;\n\n for (var i = 0; i < images.length; i++) {\n var childHeight = Number.parseFloat(window.getComputedStyle(images[i]).getPropertyValue(\"height\"));\n if (childHeight > height) {\n height = childHeight;\n }\n }\n\n container.style.height = height + \"px\";\n images[0].style.zIndex = 0;\n }", "function distributeHeight(els,availableHeight,shouldRedistribute){// *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n// and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\nvar minOffset1=Math.floor(availableHeight/els.length);// for non-last element\nvar minOffset2=Math.floor(availableHeight-minOffset1*(els.length-1));// for last element *FLOORING NOTE*\nvar flexEls=[];// elements that are allowed to expand. array of DOM nodes\nvar flexOffsets=[];// amount of vertical space it takes up\nvar flexHeights=[];// actual css height\nvar usedHeight=0;undistributeHeight(els);// give all elements their natural height\n// find elements that are below the recommended height (expandable).\n// important to query for heights in a single first pass (to avoid reflow oscillation).\nels.each(function(i,el){var minOffset=i===els.length-1?minOffset2:minOffset1;var naturalOffset=$(el).outerHeight(true);if(naturalOffset<minOffset){flexEls.push(el);flexOffsets.push(naturalOffset);flexHeights.push($(el).height());}else{// this element stretches past recommended height (non-expandable). mark the space as occupied.\nusedHeight+=naturalOffset;}});// readjust the recommended height to only consider the height available to non-maxed-out rows.\nif(shouldRedistribute){availableHeight-=usedHeight;minOffset1=Math.floor(availableHeight/flexEls.length);minOffset2=Math.floor(availableHeight-minOffset1*(flexEls.length-1));// *FLOORING NOTE*\n}// assign heights to all expandable elements\n$(flexEls).each(function(i,el){var minOffset=i===flexEls.length-1?minOffset2:minOffset1;var naturalOffset=flexOffsets[i];var naturalHeight=flexHeights[i];var newHeight=minOffset-(naturalOffset-naturalHeight);// subtract the margin/padding\nif(naturalOffset<minOffset){// we check this again because redistribution might have changed things\n$(el).height(newHeight);}});}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n var flexOffsets = []; // amount of vertical space it takes up\n var flexHeights = []; // actual css height\n var usedHeight = 0;\n undistributeHeight(els); // give all elements their natural height\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n els.forEach(function (el, i) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = computeHeightAndMargins(el);\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push(el.offsetHeight);\n }\n else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n });\n // readjust the recommended height to only consider the height available to non-maxed-out rows.\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n }\n // assign heights to all expandable elements\n flexEls.forEach(function (el, i) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n if (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n el.style.height = newHeight + 'px';\n }\n });\n }", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n var flexOffsets = []; // amount of vertical space it takes up\n var flexHeights = []; // actual css height\n var usedHeight = 0;\n\n undistributeHeight(els); // give all elements their natural height\n\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n els.each(function (i, el) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = $(el).outerHeight(true);\n\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push($(el).height());\n }\n else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n });\n\n // readjust the recommended height to only consider the height available to non-maxed-out rows.\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n }\n\n // assign heights to all expandable elements\n $(flexEls).each(function (i, el) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n if (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n $(el).height(newHeight);\n }\n });\n }", "function makeSameHieght(element) {\n $(element).css('min-height', 'initial');\n var highest = 0;\n $(element).each(function() {\n if ($(this).outerHeight() >= highest) {\n highest = $(this).outerHeight();\n $(element).css('min-height', highest + 'px');\n highest = 0;\n }\n })\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n var flexOffsets = []; // amount of vertical space it takes up\n var flexHeights = []; // actual css height\n var usedHeight = 0;\n undistributeHeight(els); // give all elements their natural height\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n els.forEach(function (el, i) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalHeight = el.getBoundingClientRect().height;\n var naturalOffset = naturalHeight + computeVMargins$1(el);\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push(naturalHeight);\n }\n else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n });\n // readjust the recommended height to only consider the height available to non-maxed-out rows.\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n }\n // assign heights to all expandable elements\n flexEls.forEach(function (el, i) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n if (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n el.style.height = newHeight + 'px';\n }\n });\n }", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n var flexOffsets = []; // amount of vertical space it takes up\n var flexHeights = []; // actual css height\n var usedHeight = 0;\n undistributeHeight(els); // give all elements their natural height\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n els.forEach(function (el, i) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalHeight = el.getBoundingClientRect().height;\n var naturalOffset = naturalHeight + computeVMargins(el);\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push(naturalHeight);\n }\n else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n });\n // readjust the recommended height to only consider the height available to non-maxed-out rows.\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n }\n // assign heights to all expandable elements\n flexEls.forEach(function (el, i) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n if (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n el.style.height = newHeight + 'px';\n }\n });\n }", "function unifyHeights(item) {\n var maxHeight = 0;\n item.css('height', 'auto');\n item.each(function () {\n var height = $(this).outerHeight();\n if (height > maxHeight) {\n maxHeight = height;\n }\n });\n item.css('height', maxHeight);\n}", "function equalizeHeight()\n{\n\tvar boxHeight = 0;\n\n\t$(\".eq-height\").removeAttr(\"style\");\n\n\t$(\".row\").each(function(){\n\n\t\t$(this).find(\".eq-height\").each(function(){\n\t\t\tvar currentBoxHeight = $(this).innerHeight();\n\t\t\tif(currentBoxHeight > boxHeight) boxHeight = currentBoxHeight;\n\t\t});\n\n\t\t$(this).find(\".eq-height\").css({\"height\":boxHeight-51+\"px\"});\n\t\t$(\".container\").css({\"height\":boxHeight+\"px\"});\n\n\t});\n}", "reset() {\n let el = this.$();\n if (!el) { return; }\n\n delete this._y;\n delete this._x;\n\n el.css({ transform: '' });\n el.height(); // Force-apply styles\n }", "function setHeight(val) {\n bookshelf.height = val;\n voronoi.setDimensions(bookshelf.width,bookshelf.height);\n\n}", "function resetRowsRegionsHeight(row) {\n // when called by each, first argument is a number instead of a row value\n var row = (typeof row === 'number') ? $(this) : row;\n\n var rowChildren = $(row).children();\n for (var x = 0; x < rowChildren.length; x++) {\n // reset to 5, the initial value before dragging\n $(rowChildren.get(x)).css(\"padding-bottom\", 5);\n }\n }", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n var flexOffsets = []; // amount of vertical space it takes up\n var flexHeights = []; // actual css height\n var usedHeight = 0;\n undistributeHeight(els); // give all elements their natural height\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n els.each(function (i, el) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = $(el).outerHeight(true);\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push($(el).height());\n }\n else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n });\n // readjust the recommended height to only consider the height available to non-maxed-out rows.\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n }\n // assign heights to all expandable elements\n $(flexEls).each(function (i, el) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n if (naturalOffset < minOffset) {\n $(el).height(newHeight);\n }\n });\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n var flexOffsets = []; // amount of vertical space it takes up\n var flexHeights = []; // actual css height\n var usedHeight = 0;\n undistributeHeight(els); // give all elements their natural height\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n els.each(function (i, el) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = $(el).outerHeight(true);\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push($(el).height());\n }\n else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n });\n // readjust the recommended height to only consider the height available to non-maxed-out rows.\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n }\n // assign heights to all expandable elements\n $(flexEls).each(function (i, el) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n if (naturalOffset < minOffset) {\n $(el).height(newHeight);\n }\n });\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n var flexOffsets = []; // amount of vertical space it takes up\n var flexHeights = []; // actual css height\n var usedHeight = 0;\n undistributeHeight(els); // give all elements their natural height\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n els.each(function (i, el) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = $(el).outerHeight(true);\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push($(el).height());\n }\n else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n });\n // readjust the recommended height to only consider the height available to non-maxed-out rows.\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n }\n // assign heights to all expandable elements\n $(flexEls).each(function (i, el) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n if (naturalOffset < minOffset) {\n $(el).height(newHeight);\n }\n });\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n var flexOffsets = []; // amount of vertical space it takes up\n var flexHeights = []; // actual css height\n var usedHeight = 0;\n undistributeHeight(els); // give all elements their natural height\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n els.each(function (i, el) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = $(el).outerHeight(true);\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push($(el).height());\n }\n else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n });\n // readjust the recommended height to only consider the height available to non-maxed-out rows.\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n }\n // assign heights to all expandable elements\n $(flexEls).each(function (i, el) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n if (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n $(el).height(newHeight);\n }\n });\n}", "function resetElementHeight(e) {\n\t$(e).each(function() {\n\t\t$(this).css('height','auto');\n\t});\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n\n\t// *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n\t// and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n\n\tvar minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\tvar minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\tvar flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\tvar flexOffsets = []; // amount of vertical space it takes up\n\tvar flexHeights = []; // actual css height\n\tvar usedHeight = 0;\n\n\tundistributeHeight(els); // give all elements their natural height\n\n\t// find elements that are below the recommended height (expandable).\n\t// important to query for heights in a single first pass (to avoid reflow oscillation).\n\tels.each(function(i, el) {\n\t\tvar minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = $(el).outerHeight(true);\n\n\t\tif (naturalOffset < minOffset) {\n\t\t\tflexEls.push(el);\n\t\t\tflexOffsets.push(naturalOffset);\n\t\t\tflexHeights.push($(el).height());\n\t\t}\n\t\telse {\n\t\t\t// this element stretches past recommended height (non-expandable). mark the space as occupied.\n\t\t\tusedHeight += naturalOffset;\n\t\t}\n\t});\n\n\t// readjust the recommended height to only consider the height available to non-maxed-out rows.\n\tif (shouldRedistribute) {\n\t\tavailableHeight -= usedHeight;\n\t\tminOffset1 = Math.floor(availableHeight / flexEls.length);\n\t\tminOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n\t}\n\n\t// assign heights to all expandable elements\n\t$(flexEls).each(function(i, el) {\n\t\tvar minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = flexOffsets[i];\n\t\tvar naturalHeight = flexHeights[i];\n\t\tvar newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n\t\tif (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n\t\t\t$(el).height(newHeight);\n\t\t}\n\t});\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n\n\t// *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n\t// and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n\n\tvar minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\tvar minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\tvar flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\tvar flexOffsets = []; // amount of vertical space it takes up\n\tvar flexHeights = []; // actual css height\n\tvar usedHeight = 0;\n\n\tundistributeHeight(els); // give all elements their natural height\n\n\t// find elements that are below the recommended height (expandable).\n\t// important to query for heights in a single first pass (to avoid reflow oscillation).\n\tels.each(function(i, el) {\n\t\tvar minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = $(el).outerHeight(true);\n\n\t\tif (naturalOffset < minOffset) {\n\t\t\tflexEls.push(el);\n\t\t\tflexOffsets.push(naturalOffset);\n\t\t\tflexHeights.push($(el).height());\n\t\t}\n\t\telse {\n\t\t\t// this element stretches past recommended height (non-expandable). mark the space as occupied.\n\t\t\tusedHeight += naturalOffset;\n\t\t}\n\t});\n\n\t// readjust the recommended height to only consider the height available to non-maxed-out rows.\n\tif (shouldRedistribute) {\n\t\tavailableHeight -= usedHeight;\n\t\tminOffset1 = Math.floor(availableHeight / flexEls.length);\n\t\tminOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n\t}\n\n\t// assign heights to all expandable elements\n\t$(flexEls).each(function(i, el) {\n\t\tvar minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = flexOffsets[i];\n\t\tvar naturalHeight = flexHeights[i];\n\t\tvar newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n\t\tif (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n\t\t\t$(el).height(newHeight);\n\t\t}\n\t});\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n\n\t// *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n\t// and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n\n\tvar minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\tvar minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\tvar flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\tvar flexOffsets = []; // amount of vertical space it takes up\n\tvar flexHeights = []; // actual css height\n\tvar usedHeight = 0;\n\n\tundistributeHeight(els); // give all elements their natural height\n\n\t// find elements that are below the recommended height (expandable).\n\t// important to query for heights in a single first pass (to avoid reflow oscillation).\n\tels.each(function(i, el) {\n\t\tvar minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = $(el).outerHeight(true);\n\n\t\tif (naturalOffset < minOffset) {\n\t\t\tflexEls.push(el);\n\t\t\tflexOffsets.push(naturalOffset);\n\t\t\tflexHeights.push($(el).height());\n\t\t}\n\t\telse {\n\t\t\t// this element stretches past recommended height (non-expandable). mark the space as occupied.\n\t\t\tusedHeight += naturalOffset;\n\t\t}\n\t});\n\n\t// readjust the recommended height to only consider the height available to non-maxed-out rows.\n\tif (shouldRedistribute) {\n\t\tavailableHeight -= usedHeight;\n\t\tminOffset1 = Math.floor(availableHeight / flexEls.length);\n\t\tminOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n\t}\n\n\t// assign heights to all expandable elements\n\t$(flexEls).each(function(i, el) {\n\t\tvar minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = flexOffsets[i];\n\t\tvar naturalHeight = flexHeights[i];\n\t\tvar newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n\t\tif (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n\t\t\t$(el).height(newHeight);\n\t\t}\n\t});\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n\n\t// *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n\t// and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n\n\tvar minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\tvar minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\tvar flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\tvar flexOffsets = []; // amount of vertical space it takes up\n\tvar flexHeights = []; // actual css height\n\tvar usedHeight = 0;\n\n\tundistributeHeight(els); // give all elements their natural height\n\n\t// find elements that are below the recommended height (expandable).\n\t// important to query for heights in a single first pass (to avoid reflow oscillation).\n\tels.each(function(i, el) {\n\t\tvar minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = $(el).outerHeight(true);\n\n\t\tif (naturalOffset < minOffset) {\n\t\t\tflexEls.push(el);\n\t\t\tflexOffsets.push(naturalOffset);\n\t\t\tflexHeights.push($(el).height());\n\t\t}\n\t\telse {\n\t\t\t// this element stretches past recommended height (non-expandable). mark the space as occupied.\n\t\t\tusedHeight += naturalOffset;\n\t\t}\n\t});\n\n\t// readjust the recommended height to only consider the height available to non-maxed-out rows.\n\tif (shouldRedistribute) {\n\t\tavailableHeight -= usedHeight;\n\t\tminOffset1 = Math.floor(availableHeight / flexEls.length);\n\t\tminOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n\t}\n\n\t// assign heights to all expandable elements\n\t$(flexEls).each(function(i, el) {\n\t\tvar minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = flexOffsets[i];\n\t\tvar naturalHeight = flexHeights[i];\n\t\tvar newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n\t\tif (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n\t\t\t$(el).height(newHeight);\n\t\t}\n\t});\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n\n\t// *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n\t// and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n\n\tvar minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\tvar minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\tvar flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\tvar flexOffsets = []; // amount of vertical space it takes up\n\tvar flexHeights = []; // actual css height\n\tvar usedHeight = 0;\n\n\tundistributeHeight(els); // give all elements their natural height\n\n\t// find elements that are below the recommended height (expandable).\n\t// important to query for heights in a single first pass (to avoid reflow oscillation).\n\tels.each(function(i, el) {\n\t\tvar minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = $(el).outerHeight(true);\n\n\t\tif (naturalOffset < minOffset) {\n\t\t\tflexEls.push(el);\n\t\t\tflexOffsets.push(naturalOffset);\n\t\t\tflexHeights.push($(el).height());\n\t\t}\n\t\telse {\n\t\t\t// this element stretches past recommended height (non-expandable). mark the space as occupied.\n\t\t\tusedHeight += naturalOffset;\n\t\t}\n\t});\n\n\t// readjust the recommended height to only consider the height available to non-maxed-out rows.\n\tif (shouldRedistribute) {\n\t\tavailableHeight -= usedHeight;\n\t\tminOffset1 = Math.floor(availableHeight / flexEls.length);\n\t\tminOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n\t}\n\n\t// assign heights to all expandable elements\n\t$(flexEls).each(function(i, el) {\n\t\tvar minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = flexOffsets[i];\n\t\tvar naturalHeight = flexHeights[i];\n\t\tvar newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n\t\tif (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n\t\t\t$(el).height(newHeight);\n\t\t}\n\t});\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n\n\t// *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n\t// and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n\n\tvar minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\tvar minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\tvar flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\tvar flexOffsets = []; // amount of vertical space it takes up\n\tvar flexHeights = []; // actual css height\n\tvar usedHeight = 0;\n\n\tundistributeHeight(els); // give all elements their natural height\n\n\t// find elements that are below the recommended height (expandable).\n\t// important to query for heights in a single first pass (to avoid reflow oscillation).\n\tels.each(function(i, el) {\n\t\tvar minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = $(el).outerHeight(true);\n\n\t\tif (naturalOffset < minOffset) {\n\t\t\tflexEls.push(el);\n\t\t\tflexOffsets.push(naturalOffset);\n\t\t\tflexHeights.push($(el).height());\n\t\t}\n\t\telse {\n\t\t\t// this element stretches past recommended height (non-expandable). mark the space as occupied.\n\t\t\tusedHeight += naturalOffset;\n\t\t}\n\t});\n\n\t// readjust the recommended height to only consider the height available to non-maxed-out rows.\n\tif (shouldRedistribute) {\n\t\tavailableHeight -= usedHeight;\n\t\tminOffset1 = Math.floor(availableHeight / flexEls.length);\n\t\tminOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n\t}\n\n\t// assign heights to all expandable elements\n\t$(flexEls).each(function(i, el) {\n\t\tvar minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = flexOffsets[i];\n\t\tvar naturalHeight = flexHeights[i];\n\t\tvar newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n\t\tif (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n\t\t\t$(el).height(newHeight);\n\t\t}\n\t});\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n\n\t// *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n\t// and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n\n\tvar minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\tvar minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\tvar flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\tvar flexOffsets = []; // amount of vertical space it takes up\n\tvar flexHeights = []; // actual css height\n\tvar usedHeight = 0;\n\n\tundistributeHeight(els); // give all elements their natural height\n\n\t// find elements that are below the recommended height (expandable).\n\t// important to query for heights in a single first pass (to avoid reflow oscillation).\n\tels.each(function(i, el) {\n\t\tvar minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = $(el).outerHeight(true);\n\n\t\tif (naturalOffset < minOffset) {\n\t\t\tflexEls.push(el);\n\t\t\tflexOffsets.push(naturalOffset);\n\t\t\tflexHeights.push($(el).height());\n\t\t}\n\t\telse {\n\t\t\t// this element stretches past recommended height (non-expandable). mark the space as occupied.\n\t\t\tusedHeight += naturalOffset;\n\t\t}\n\t});\n\n\t// readjust the recommended height to only consider the height available to non-maxed-out rows.\n\tif (shouldRedistribute) {\n\t\tavailableHeight -= usedHeight;\n\t\tminOffset1 = Math.floor(availableHeight / flexEls.length);\n\t\tminOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n\t}\n\n\t// assign heights to all expandable elements\n\t$(flexEls).each(function(i, el) {\n\t\tvar minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = flexOffsets[i];\n\t\tvar naturalHeight = flexHeights[i];\n\t\tvar newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n\t\tif (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n\t\t\t$(el).height(newHeight);\n\t\t}\n\t});\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n\n\t// *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n\t// and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n\n\tvar minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\tvar minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\tvar flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\tvar flexOffsets = []; // amount of vertical space it takes up\n\tvar flexHeights = []; // actual css height\n\tvar usedHeight = 0;\n\n\tundistributeHeight(els); // give all elements their natural height\n\n\t// find elements that are below the recommended height (expandable).\n\t// important to query for heights in a single first pass (to avoid reflow oscillation).\n\tels.each(function(i, el) {\n\t\tvar minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = $(el).outerHeight(true);\n\n\t\tif (naturalOffset < minOffset) {\n\t\t\tflexEls.push(el);\n\t\t\tflexOffsets.push(naturalOffset);\n\t\t\tflexHeights.push($(el).height());\n\t\t}\n\t\telse {\n\t\t\t// this element stretches past recommended height (non-expandable). mark the space as occupied.\n\t\t\tusedHeight += naturalOffset;\n\t\t}\n\t});\n\n\t// readjust the recommended height to only consider the height available to non-maxed-out rows.\n\tif (shouldRedistribute) {\n\t\tavailableHeight -= usedHeight;\n\t\tminOffset1 = Math.floor(availableHeight / flexEls.length);\n\t\tminOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n\t}\n\n\t// assign heights to all expandable elements\n\t$(flexEls).each(function(i, el) {\n\t\tvar minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = flexOffsets[i];\n\t\tvar naturalHeight = flexHeights[i];\n\t\tvar newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n\t\tif (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n\t\t\t$(el).height(newHeight);\n\t\t}\n\t});\n}", "reflow () {\n var last = []\n var cols = [...this.element.querySelectorAll('.js-col')]\n\n for (let i = 0, len = cols.length, col; i < len; i++) {\n col = cols[i]\n last.push(...Array.prototype.slice.call(col.childNodes, -2))\n if (col.childElementCount) col.removeChild(col.lastElementChild)\n if (col.childElementCount) col.removeChild(col.lastElementChild)\n }\n\n for (let i = 0, len = last.length; i < len; i++) {\n var shortest = cols.reduce((min, el) => {\n var height = el.offsetHeight\n return !min || height < min.height ? {el, height} : min\n }, null)\n shortest.el.appendChild(last[i])\n }\n }", "function resetRowsRegionsHeight(row) {\n // when called by each, first argument is a number instead of a row value\n var row = (typeof row === 'number') ? $(this) : row;\n\n var rowChildren = $(row).children();\n for (var x = 0; x < rowChildren.length; x++) {\n // reset to 5, the initial value before dragging\n $(rowChildren.get(x)).css(\"padding-bottom\", 5);\n }\n }", "correctHeight(){\n this.graphicalObject.position.y = this.heightModifier + this.room.brickThickness * this.room.roomDataArray[this.positionX][this.positionY].bricks;\n }", "function TSplit_doFitHeightFix(d,align){\n var du = d;\n var dd = d;\n\n switch(this.Orientation) {\n case 'v':\n break;\n case 'h':\n switch (align) {\n case 'top':\n this.UpNode.changeHeight(+du);\n this.DownNode.changeHeight(-dd);\n break;\n case 'bottom':\n this.UpNode.changeHeight(-du);\n this.DownNode.changeHeight(+dd);\n break;\n case 'nil':\n this.DownNode.changeHeight(dd);\n break;\n }\n case 'n':\n break;\n }\n this.doDOM_Refresh();\n }", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n var flexOffsets = []; // amount of vertical space it takes up\n var flexHeights = []; // actual css height\n var usedHeight = 0;\n undistributeHeight(els); // give all elements their natural height\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n els.forEach(function (el, i) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalHeight = el.getBoundingClientRect().height;\n var naturalOffset = naturalHeight + computeVMargins(el);\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push(naturalHeight);\n }\n else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n });\n // readjust the recommended height to only consider the height available to non-maxed-out rows.\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n }\n // assign heights to all expandable elements\n flexEls.forEach(function (el, i) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n if (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n el.style.height = newHeight + 'px';\n }\n });\n}", "function reflowSMHeight(){\n let $parent = $('.selectedManga .main-container')\n let heightTaken = $parent.children('.header-wrapper').height()\n \n $parent.find('.desc-wrapper, .cl-wrapper')\n .height($parent.height() - heightTaken)\n }", "setLastSize(width, height) {\n const priv = privatePool.get(this);\n\n [priv.lastWidth, priv.lastHeight] = [width, height];\n }", "function initialize() {\n heightMap[0] = displace(1);\n heightMap[pixelCount - 1] = displace(1);\n interpolate(0,pixelCount);\n}", "normalizeCarouselSlideHeights(slides) {\n\t\tlet items = slides, //grab all slides\n\t\t\theights = [], //create empty array to store height values\n\t\t\ttallest = 0; //create variable to make note of the tallest slide\n\n\t\titems.each(() => {\n\t\t\titems.css('min-height', '0'); //reset min-height\n\t\t});\n\n\t\titems.each((index, value) => { //add heights to array\n\t\t\theights.push(items.height());\n\t\t});\n\n\t\ttallest = Math.max.apply(null, heights); //store largest value\n\n\t\titems.each(() => {\n\t\t\titems.css('min-height', tallest + 'px');\n\t\t});\n\t}", "function resizeHeightPage() {\n\t\tvar newSizeH = sizeWin-recalculPadding(pages);\n\t\tconsole.log(newSizeH);\n\t\tpages.css({\"min-height\":sizeWin});\n\t}", "set height(value) {}", "function getHeightData() {\n if (!wpdtEditor.allHeights) {\n wpdtEditor.allHeights = typeof (wpdtEditor.getSettings().rowHeights) == 'object' ? wpdtEditor.getSettings().rowHeights : [];\n }\n }", "function resetHiddenItemSize() {\n TweenLite.to(_element, 0, {scale: 1});\n }", "calculateSize() {\n let node = ReactDOM.findDOMNode(this).cloneNode(true),\n body = document.body;\n\n node.style.maxWidth = '100%';\n node.style.maxHeight = '100%';\n body.appendChild(node);\n\n this.setState({\n size: (this.props.direction === 'vertical') ? node.offsetHeight : node.offsetWidth\n });\n\n body.removeChild(node);\n }", "function adaptiveHeight() {\n\t\tlet takeHeihgt = [];\n\t\t$('.header_slider__item').each(function(item, index) {\n\t\t\ttakeHeihgt.push($(this).outerHeight());\n\t\t});\n\t\t$('.header_slider__item').css('height', Math.max.apply(null, takeHeihgt));\n\t}", "function create2D(heightMap, mapSize)\n{\n \n for(i = 0; i < mapSize+1; i++)\n {\n heightMap[i] = new Array();\n for(j = 0; j < mapSize+1; j++)\n {\n \n if((i == 0 && j == 0) ||\n (i == 0 && j == mapSize) ||\n (i == mapSize && j == 0) ||\n (i == mapSize && j == mapSize))\n {\n heightMap[i][j] = Math.random(); //make height \n }\n \n else\n {\n heightMap[i][j] = 0; \n }\n \n } \n }\n console.log(heightMap[0][0]);\n \n}", "function adjustVizHeight(){\n viz.style(\"height\", function(){\n w = parseInt(viz.style(\"width\"), 10);\n h = w*heightRatio;\n return h;\n })\n}", "function unscaleY(yvar){\r\n yvar = yvar + yShift;\r\n\r\n yvar = 800 - yvar;\r\n yvar /= mapScale;\r\n\r\n var yMin = getMin(y);\r\n if(yMin < 0){\r\n yvar += yMin;\r\n }\r\n\r\n return yvar;\r\n\r\n}", "get estimatedHeight() { return -1; }", "updateDimensions() {\n let height = 0.0;\n let depth = 0.0;\n let maxFontSize = 1.0;\n if (this.children) {\n this.children.forEach(x => {\n if (x.height > height) height = x.height;\n if (x.depth > depth) depth = x.depth;\n if (x.maxFontSize > maxFontSize) maxFontSize = x.maxFontSize;\n });\n }\n this.height = height;\n this.depth = depth;\n this.maxFontSize = maxFontSize;\n }", "function TSplit_doFitHeight(d,align){\n\tswitch(this.Orientation) {\n\tcase 'v':\n this.UpNode.changeHeight(d);\n this.DownNode.changeHeight(d);\n\t\t\tthis.Height+=d;\t\t\t\t\t\n\t\tbreak;\n\tcase 'h':\n\t\t\tswitch (align) {\n\t\t\t\tcase 'top':\n this.UpNode.changeHeight(d);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'bottom':\n this.DownNode.changeHeight(d);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'nil':\n this.DownNode.changeHeight(d);\n\t\t\t\t\tbreak;\n\t\t\t}\t\t\t\t\t\n\t\t\tthis.Height += d;\n\t\tbreak;\n\tcase 'n':\n\t\tbreak;\n\t}\n\tthis.doDOM_Refresh();\n}", "function updateWorldHeight() {\n const unit = document.querySelector(\"#options-height-unit\").value;\n const value = Math.max(0.000000001, document.querySelector(\"#options-height-value\").value);\n const oldHeight = config.height;\n\n setWorldHeight(oldHeight, math.unit(value, unit));\n}", "function oldOuterHeight(element){\r\n //return 100;\r\n return element.height();\r\n}", "changeHeight() {\n\n // Get a random height and store in variable\n this.height = Math.floor(Math.random() * 200);\n\n // Check if height is less then 30\n if(this.height < 30) {\n // Set the height to 30\n this.height = 30;\n }\n\n // Set the y value of the pipe\n this.y = board.height - this.height;\n\n // Store the y-value in variable\n y_value = this.y;\n\n }", "function heightses(){\n\t\t$('.page__catalog .catalog-products-list__title').height('auto').equalHeights();\n\t}", "function getHeight( t, a ) {\n\n\tvar h = 0,\n\t\ti;\n\n\tt.children().each( function() {\n\n\t\ti = $( this ).outerHeight( true );\n\n\t\th = h + i;\n\n\t});\n\n\tt.attr( 'data-height', h );\n\n}", "function resize() {\n\t\tvar done = [];\n\t\t$('[data-equal-height]').each(function() {\n\t\t\tvar elem = $(this),\n\t\t\t\telems = elem.data('equal-height');\n\n\t\t\tif( $.inArray(elems, done) < 0 ) {\n\t\t\t\tresizeGroup('[data-equal-height=\"'+ elems +'\"]');\n\t\t\t\tdone.push(elems);\n\t\t\t}\n\t\t});\n\t}", "reset() {\n const {\n container,\n } = this\n this.state.heights = []\n const fillers = container.querySelectorAll(`.${CLASSES.PAD}`)\n if (fillers.length) {\n for(let f = 0; f < fillers.length; f++) {\n fillers[f].parentNode.removeChild(fillers[f])\n }\n }\n this.panels = document.querySelectorAll(`.masonry-panel`)\n container.removeAttribute('style')\n }", "function setHeight2() {\n for (var i = 1; i < 5; i++) {\n $('.js-head' + i).css('height', 'auto');\n var maxHeight2 = Math.max.apply(null, $(\".js-head\" + i).map(function() {\n return $(this).height();\n }).get());\n $('.js-head' + i).height(maxHeight2);\n \n }\n\n\n }", "function positionFixup(){\n\t\tfor (var i = tiles.length - 1; i >= 0; i--) {\n\t\t\tvar layout = returnBalanced(maxCols, maxHeight);\n\t\t\tvar t = $('#'+tiles[i]);\n\t\t\tt.attr({\n\t\t\t\t'row': layout[tiles.length-1][i].row(maxHeight),\n\t\t\t\t'col': layout[tiles.length-1][i].col(maxCols),\n\t\t\t\t'sizex': layout[tiles.length-1][i].sizex(maxCols),\n\t\t\t\t'sizey': layout[tiles.length-1][i].sizey(maxHeight)\n\t\t\t});\n\t\t\tvar tile_offset = offset_from_location(parseInt(t.attr('row')), parseInt(t.attr('col')));\n\t\t\tt.css({\n\t\t\t\t\"top\": tile_offset.top,\n\t\t\t\t\"left\":tile_offset.left,\n\t\t\t\t\"width\":t.attr('sizex')*tileWidth,\n\t\t\t\t\"height\":t.attr('sizey')*tileHeight});\n\t\t\tupdate_board(tiles[i]);\n\t\t};\n\t}", "function setThighDown (bodypart, height){\n // $(\"#jQueryThigh\").width(thighheight);\n // $(\"#jQueryThigh\").height(thighwidth);\n}", "function swap(el1, el2) {\r\n \r\n let temp = el1.style.height;\r\n el1.style.height = el2.style.height;\r\n el2.style.height = temp;\r\n \r\n}", "function resizetable() {\n var elem = $('#boardGrid');\n var newGridWidth = elem.outerWidth();\n elem.outerHeight(newGridWidth);\n }", "function Ba(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var a=e.widgets[t],n=a.node.parentNode;n&&(a.height=n.offsetHeight)}}", "reflow (el) {\n var last = []\n var cols = [...el.querySelectorAll('.js-col')]\n\n for (let i = 0, len = cols.length, col; i < len; i++) {\n col = cols[i]\n if (col.childElementCount <= 1) continue\n last.push(...Array.prototype.slice.call(col.childNodes, -1))\n col.removeChild(col.lastElementChild)\n }\n\n for (let i = 0, len = last.length; i < len; i++) {\n var shortest = cols.reduce((min, el) => {\n var height = el.offsetHeight\n return !min || height < min.height ? { el, height } : min\n }, null)\n shortest.el.appendChild(last[i])\n }\n }", "function resize() {\n var sentinel = false;\n\n for(var i = 0; i < visCount; i++) {\n if ((d3.select(\"#vis\" + i)).attr(\"height\") < 400)\n sentinel = true;\n }\n if(sentinel) {\n height *= 2;\n\n d3.selectAll(\".assignmentContainer\")\n .attr( \"height\", height );\n d3.selectAll(\".svg\")\n .attr( \"height\", height );\n } else {\n height /= 2;\n\n d3.selectAll(\".assignmentContainer\")\n .attr(\"height\", height);\n d3.selectAll(\".svg\")\n .attr(\"height\", height);\n }\n}", "function setSameElementHeight(e) {\n\tvar tallest = 0;\n\t$(e).each(function() {\n\t\t$(this).css('height','auto'); // reset height in case an empty div has been populated\n\t\tif ($(this).height() > tallest) {\n\t\t\ttallest = $(this).height();\n\t\t}\n\t});\n\t$(e).height(tallest);\n}", "function setSameHeight(opt) {\r\n // default options\r\n var options = {\r\n holder: null,\r\n skipClass: 'same-height-ignore',\r\n leftEdgeClass: 'same-height-left',\r\n rightEdgeClass: 'same-height-right',\r\n elements: '>*',\r\n flexible: false,\r\n multiLine: false,\r\n useMinHeight: false,\r\n biggestHeight: false\r\n };\r\n for(var p in opt) {\r\n if(opt.hasOwnProperty(p)) {\r\n options[p] = opt[p];\r\n }\r\n }\r\n\r\n // init script\r\n if(options.holder) {\r\n var holders = lib.queryElementsBySelector(options.holder);\r\n lib.each(holders, function(ind, curHolder){\r\n var curElements = [], resizeTimer, postResizeTimer;\r\n var tmpElements = lib.queryElementsBySelector(options.elements, curHolder);\r\n\r\n // get resize elements\r\n for(var i = 0; i < tmpElements.length; i++) {\r\n if(!lib.hasClass(tmpElements[i], options.skipClass)) {\r\n curElements.push(tmpElements[i]);\r\n }\r\n }\r\n if(!curElements.length) return;\r\n\r\n // resize handler\r\n function doResize() {\r\n for(var i = 0; i < curElements.length; i++) {\r\n curElements[i].style[options.useMinHeight && SameHeight.supportMinHeight ? 'minHeight' : 'height'] = '';\r\n }\r\n\r\n if(options.multiLine) {\r\n // resize elements row by row\r\n SameHeight.resizeElementsByRows(curElements, options);\r\n } else {\r\n // resize elements by holder\r\n SameHeight.setSize(curElements, curHolder, options);\r\n }\r\n }\r\n doResize();\r\n\r\n // handle flexible layout / font resize\r\n function flexibleResizeHandler() {\r\n clearTimeout(resizeTimer);\r\n resizeTimer = setTimeout(function(){\r\n doResize();\r\n clearTimeout(postResizeTimer);\r\n postResizeTimer = setTimeout(doResize, 100);\r\n },1);\r\n }\r\n if(options.flexible) {\r\n addEvent(window, 'resize', flexibleResizeHandler);\r\n addEvent(window, 'orientationchange', flexibleResizeHandler);\r\n FontResizeEvent.onChange(flexibleResizeHandler);\r\n }\r\n // handle complete page load including images and fonts\r\n addEvent(window, 'load', flexibleResizeHandler);\r\n });\r\n }\r\n\r\n // event handler helper functions\r\n function addEvent(object, event, handler) {\r\n if(object.addEventListener) object.addEventListener(event, handler, false);\r\n else if(object.attachEvent) object.attachEvent('on'+event, handler);\r\n }\r\n}", "changeClosetHeight(height) {\n if (height > 0) {\n var axesHeight = height / 2;\n var heighpos = this.faces.get(FaceOrientation.TOP).Y()[4]; //TODO: Remove heighpos ?\n this.faces.get(FaceOrientation.TOP).changeYAxis((this.faces.get(FaceOrientation.TOP).Y()-this.faces.get(FaceOrientation.LEFT).height()/2)+axesHeight);\n this.faces.get(FaceOrientation.TOP).changeYAxis((this.faces.get(FaceOrientation.BASE).Y()+this.faces.get(FaceOrientation.LEFT).height()/2)-axesHeight);\n this.faces.get(FaceOrientation.LEFT).changeHeight(height);\n this.faces.get(FaceOrientation.RIGHT).changeHeight(height);\n this.faces.get(FaceOrientation.BACK).changeHeight(height);\n for(let closetSlot of this.getSlotFaces()){\n closetSlot.changeHeight(height);\n }\n }\n }", "function swap(xp, yp) {\r\n\r\n let tmp = array[xp];\r\n array[xp] = array[yp];\r\n array[yp] = tmp;\r\n\r\n tmp = document.getElementById(xp).style.height;\r\n document.getElementById(xp).style.height = document.getElementById(yp).style.height;\r\n document.getElementById(yp).style.height = tmp;\r\n\r\n}", "function setHeiHeight() {\n\t $('.full__height').css({\n\t minHeight: $(window).height() + 'px'\n\t });\n\t}", "function setHeiHeight() {\n\t $('.full__height').css({\n\t minHeight: $(window).height() + 'px'\n\t });\n\t}", "function heightTest(){\r\n let heightTotal = 4 + ((startHeight - 1) * 2)\r\n for(let i = 199; i > (20-heightTotal) * width; i--){\r\n let r = Math.random() * 2\r\n if (r < 1){\r\n let rcolor = Math.floor(Math.random()*theTetrominoes.length)\r\n squares[i].classList.add('taken')\r\n squares[i].classList.add('tetromino')\r\n squares[i].style.backgroundColor = colors[rcolor]\r\n squares[i].innerHTML = \"<img id=\\\"img_block\\\" src=\\\"blocks/\" + img_colors[rcolor] + \".png\\\" width=\\\"20\\\" height=\\\"20\\\">\"\r\n }\r\n }\r\n }" ]
[ "0.7625745", "0.7465431", "0.7465431", "0.7465431", "0.7465431", "0.74344325", "0.74344325", "0.74344325", "0.74344325", "0.74344325", "0.74344325", "0.74344325", "0.74344325", "0.740191", "0.7360089", "0.72297835", "0.7191031", "0.61986786", "0.6076183", "0.584065", "0.57682055", "0.57163286", "0.57127106", "0.5708416", "0.5627625", "0.5627064", "0.557081", "0.5552613", "0.5511219", "0.5501996", "0.5482235", "0.54816604", "0.54599917", "0.54583395", "0.54490167", "0.5448969", "0.54413515", "0.5426898", "0.54203117", "0.5417501", "0.53914857", "0.5380453", "0.5378164", "0.5378164", "0.5378164", "0.5378164", "0.53751785", "0.5370481", "0.5370481", "0.5370481", "0.5370481", "0.5370481", "0.5370481", "0.5370481", "0.5370481", "0.53571254", "0.5346161", "0.53343946", "0.5331055", "0.5330095", "0.53175735", "0.53080165", "0.5297415", "0.529523", "0.5267119", "0.52486694", "0.52469003", "0.5237611", "0.52324766", "0.52129376", "0.52116305", "0.52055794", "0.51983386", "0.5195551", "0.5181319", "0.51811695", "0.5171095", "0.5163338", "0.5160548", "0.5146257", "0.5145977", "0.5145816", "0.5144511", "0.5128477", "0.51149386", "0.5111848", "0.50932014", "0.5091619", "0.5083814", "0.5083385", "0.50799185", "0.5072473", "0.50709003", "0.5067675", "0.5063779", "0.50622374", "0.50622374", "0.50590146" ]
0.7114636
19
Given `els`, a set of cells, find the cell with the largest natural width and set the widths of all the cells to be that width. PREREQUISITE: if you want a cell to take up width, it needs to have a single inner element w/ display:inline
function matchCellWidths(els) { var maxInnerWidth = 0; els.forEach(function (el) { var innerEl = el.firstChild; // hopefully an element if (innerEl instanceof HTMLElement) { var innerWidth_1 = innerEl.getBoundingClientRect().width; if (innerWidth_1 > maxInnerWidth) { maxInnerWidth = innerWidth_1; } } }); maxInnerWidth++; // sometimes not accurate of width the text needs to stay on one line. insurance els.forEach(function (el) { el.style.width = maxInnerWidth + 'px'; }); return maxInnerWidth; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function matchCellWidths(els) {\n var maxInnerWidth = 0;\n els.forEach(function (el) {\n var innerEl = el.firstChild; // hopefully an element\n\n if (innerEl instanceof HTMLElement) {\n var innerWidth_1 = innerEl.getBoundingClientRect().width;\n\n if (innerWidth_1 > maxInnerWidth) {\n maxInnerWidth = innerWidth_1;\n }\n }\n });\n maxInnerWidth++; // sometimes not accurate of width the text needs to stay on one line. insurance\n\n els.forEach(function (el) {\n el.style.width = maxInnerWidth + 'px';\n });\n return maxInnerWidth;\n } // Given one element that resides inside another,", "function matchCellWidths(els) {\n var maxInnerWidth = 0;\n els.forEach(function (el) {\n var innerEl = el.firstChild; // hopefully an element\n if (innerEl instanceof HTMLElement) {\n var innerWidth_1 = innerEl.getBoundingClientRect().width;\n if (innerWidth_1 > maxInnerWidth) {\n maxInnerWidth = innerWidth_1;\n }\n }\n });\n maxInnerWidth++; // sometimes not accurate of width the text needs to stay on one line. insurance\n els.forEach(function (el) {\n el.style.width = maxInnerWidth + 'px';\n });\n return maxInnerWidth;\n}", "function matchCellWidths(els) {\n var maxInnerWidth = 0;\n els.forEach(function (el) {\n var innerEl = el.firstChild; // hopefully an element\n\n if (innerEl instanceof HTMLElement) {\n var innerWidth = innerEl.offsetWidth;\n\n if (innerWidth > maxInnerWidth) {\n maxInnerWidth = innerWidth;\n }\n }\n });\n maxInnerWidth++; // sometimes not accurate of width the text needs to stay on one line. insurance\n\n els.forEach(function (el) {\n el.style.width = maxInnerWidth + 'px';\n });\n return maxInnerWidth;\n }", "function matchCellWidths(els) {\n var maxInnerWidth = 0;\n els.forEach(function (el) {\n var innerEl = el.firstChild; // hopefully an element\n if (innerEl instanceof HTMLElement) {\n var innerWidth_1 = innerEl.offsetWidth;\n if (innerWidth_1 > maxInnerWidth) {\n maxInnerWidth = innerWidth_1;\n }\n }\n });\n maxInnerWidth++; // sometimes not accurate of width the text needs to stay on one line. insurance\n els.forEach(function (el) {\n el.style.width = maxInnerWidth + 'px';\n });\n return maxInnerWidth;\n }", "function matchCellWidths(els) {\n\tvar maxInnerWidth = 0;\n\n\tels.find('> *').each(function(i, innerEl) {\n\t\tvar innerWidth = $(innerEl).outerWidth();\n\t\tif (innerWidth > maxInnerWidth) {\n\t\t\tmaxInnerWidth = innerWidth;\n\t\t}\n\t});\n\n\tmaxInnerWidth++; // sometimes not accurate of width the text needs to stay on one line. insurance\n\n\tels.width(maxInnerWidth);\n\n\treturn maxInnerWidth;\n}", "function matchCellWidths(els) {\n\tvar maxInnerWidth = 0;\n\n\tels.find('> *').each(function(i, innerEl) {\n\t\tvar innerWidth = $(innerEl).outerWidth();\n\t\tif (innerWidth > maxInnerWidth) {\n\t\t\tmaxInnerWidth = innerWidth;\n\t\t}\n\t});\n\n\tmaxInnerWidth++; // sometimes not accurate of width the text needs to stay on one line. insurance\n\n\tels.width(maxInnerWidth);\n\n\treturn maxInnerWidth;\n}", "function matchCellWidths(els) {\n\tvar maxInnerWidth = 0;\n\n\tels.find('> *').each(function(i, innerEl) {\n\t\tvar innerWidth = $(innerEl).outerWidth();\n\t\tif (innerWidth > maxInnerWidth) {\n\t\t\tmaxInnerWidth = innerWidth;\n\t\t}\n\t});\n\n\tmaxInnerWidth++; // sometimes not accurate of width the text needs to stay on one line. insurance\n\n\tels.width(maxInnerWidth);\n\n\treturn maxInnerWidth;\n}", "function matchCellWidths(els) {\n\tvar maxInnerWidth = 0;\n\n\tels.find('> *').each(function(i, innerEl) {\n\t\tvar innerWidth = $(innerEl).outerWidth();\n\t\tif (innerWidth > maxInnerWidth) {\n\t\t\tmaxInnerWidth = innerWidth;\n\t\t}\n\t});\n\n\tmaxInnerWidth++; // sometimes not accurate of width the text needs to stay on one line. insurance\n\n\tels.width(maxInnerWidth);\n\n\treturn maxInnerWidth;\n}", "function matchCellWidths(els) {\n\tvar maxInnerWidth = 0;\n\n\tels.find('> *').each(function(i, innerEl) {\n\t\tvar innerWidth = $(innerEl).outerWidth();\n\t\tif (innerWidth > maxInnerWidth) {\n\t\t\tmaxInnerWidth = innerWidth;\n\t\t}\n\t});\n\n\tmaxInnerWidth++; // sometimes not accurate of width the text needs to stay on one line. insurance\n\n\tels.width(maxInnerWidth);\n\n\treturn maxInnerWidth;\n}", "function matchCellWidths(els) {\n\tvar maxInnerWidth = 0;\n\n\tels.find('> *').each(function(i, innerEl) {\n\t\tvar innerWidth = $(innerEl).outerWidth();\n\t\tif (innerWidth > maxInnerWidth) {\n\t\t\tmaxInnerWidth = innerWidth;\n\t\t}\n\t});\n\n\tmaxInnerWidth++; // sometimes not accurate of width the text needs to stay on one line. insurance\n\n\tels.width(maxInnerWidth);\n\n\treturn maxInnerWidth;\n}", "function matchCellWidths(els) {\n var maxInnerWidth = 0;\n els.find('> *').each(function (i, innerEl) {\n var innerWidth = $(innerEl).outerWidth();\n if (innerWidth > maxInnerWidth) {\n maxInnerWidth = innerWidth;\n }\n });\n maxInnerWidth++; // sometimes not accurate of width the text needs to stay on one line. insurance\n els.width(maxInnerWidth);\n return maxInnerWidth;\n}", "function matchCellWidths(els) {\n var maxInnerWidth = 0;\n els.find('> *').each(function (i, innerEl) {\n var innerWidth = $(innerEl).outerWidth();\n if (innerWidth > maxInnerWidth) {\n maxInnerWidth = innerWidth;\n }\n });\n maxInnerWidth++; // sometimes not accurate of width the text needs to stay on one line. insurance\n els.width(maxInnerWidth);\n return maxInnerWidth;\n}", "function matchCellWidths(els) {\n var maxInnerWidth = 0;\n els.find('> *').each(function (i, innerEl) {\n var innerWidth = $(innerEl).outerWidth();\n if (innerWidth > maxInnerWidth) {\n maxInnerWidth = innerWidth;\n }\n });\n maxInnerWidth++; // sometimes not accurate of width the text needs to stay on one line. insurance\n els.width(maxInnerWidth);\n return maxInnerWidth;\n}", "function matchCellWidths(els) {\n var maxInnerWidth = 0;\n els.find('> *').each(function (i, innerEl) {\n var innerWidth = $(innerEl).outerWidth();\n if (innerWidth > maxInnerWidth) {\n maxInnerWidth = innerWidth;\n }\n });\n maxInnerWidth++; // sometimes not accurate of width the text needs to stay on one line. insurance\n els.width(maxInnerWidth);\n return maxInnerWidth;\n}", "function matchCellWidths(els) {\n var maxInnerWidth = 0;\n\n els.find('> *').each(function (i, innerEl) {\n var innerWidth = $(innerEl).outerWidth();\n if (innerWidth > maxInnerWidth) {\n maxInnerWidth = innerWidth;\n }\n });\n\n maxInnerWidth++; // sometimes not accurate of width the text needs to stay on one line. insurance\n\n els.width(maxInnerWidth);\n\n return maxInnerWidth;\n }", "function matchCellWidths(els) {\n\t\tvar maxInnerWidth = 0;\n\n\t\tels.find('> *').each(function(i, innerEl) {\n\t\t\tvar innerWidth = $(innerEl).outerWidth();\n\t\t\tif (innerWidth > maxInnerWidth) {\n\t\t\t\tmaxInnerWidth = innerWidth;\n\t\t\t}\n\t\t});\n\n\t\tmaxInnerWidth++; // sometimes not accurate of width the text needs to stay on one line. insurance\n\n\t\tels.width(maxInnerWidth);\n\n\t\treturn maxInnerWidth;\n\t}", "function matchCellWidths(els) {\n\tvar maxInnerWidth = 0;\n\n\tels.find('> span').each(function(i, innerEl) {\n\t\tvar innerWidth = $(innerEl).outerWidth();\n\t\tif (innerWidth > maxInnerWidth) {\n\t\t\tmaxInnerWidth = innerWidth;\n\t\t}\n\t});\n\n\tmaxInnerWidth++; // sometimes not accurate of width the text needs to stay on one line. insurance\n\n\tels.width(maxInnerWidth);\n\n\treturn maxInnerWidth;\n}", "function matchCellWidths(els) {\n\tvar maxInnerWidth = 0;\n\n\tels.find('> span').each(function(i, innerEl) {\n\t\tvar innerWidth = $(innerEl).outerWidth();\n\t\tif (innerWidth > maxInnerWidth) {\n\t\t\tmaxInnerWidth = innerWidth;\n\t\t}\n\t});\n\n\tmaxInnerWidth++; // sometimes not accurate of width the text needs to stay on one line. insurance\n\n\tels.width(maxInnerWidth);\n\n\treturn maxInnerWidth;\n}", "function matchCellWidths(els){var maxInnerWidth=0;els.find('> *').each(function(i,innerEl){var innerWidth=$(innerEl).outerWidth();if(innerWidth>maxInnerWidth){maxInnerWidth=innerWidth;}});maxInnerWidth++;// sometimes not accurate of width the text needs to stay on one line. insurance\nels.width(maxInnerWidth);return maxInnerWidth;}", "resizeToFitContent() {\n const grid = this.grid,\n store = grid.store,\n count = store.count;\n\n if (count && !this.hidden) {\n const cellElement = grid.element.querySelector(`.b-grid-cell[data-column-id=${this.id}]`);\n\n // cellElement might not exist, e.g. when trial is expired\n if (cellElement) {\n const cellStyle = window.getComputedStyle(cellElement),\n cellPadding = parseInt(cellStyle['padding-left']),\n maxWidth = DomHelper.measureText(count, cellElement);\n\n this.width = maxWidth + 2 * cellPadding;\n }\n }\n }", "function computeSmallestCellWidth(cellEl) {\n var allWidthEl = cellEl.querySelector('.fc-scrollgrid-shrink-frame');\n var contentWidthEl = cellEl.querySelector('.fc-scrollgrid-shrink-cushion');\n if (!allWidthEl) {\n throw new Error('needs fc-scrollgrid-shrink-frame className'); // TODO: use const\n }\n if (!contentWidthEl) {\n throw new Error('needs fc-scrollgrid-shrink-cushion className');\n }\n return cellEl.getBoundingClientRect().width - allWidthEl.getBoundingClientRect().width + // the cell padding+border\n contentWidthEl.getBoundingClientRect().width;\n }", "fixCellWidths(rowElement, visibleColumns = null) {\n if (!visibleColumns) visibleColumns = this.columns.bottomColumns.filter(col => !col.hidden); // fix cell widths, no longer allowed in template because of CSP\n\n let cellElement = rowElement.firstElementChild,\n i = 0;\n\n while (cellElement) {\n const column = visibleColumns[i];\n\n if (column.minWidth) {\n DomHelper.setLength(cellElement, 'minWidth', column.minWidth);\n } // either flex or width, flex has precedence\n\n if (column.flex) {\n cellElement.style.flex = column.flex;\n cellElement.style.width = '';\n } else if (column.width) {\n // https://app.assembla.com/spaces/bryntum/tickets/8041\n // Although header and footer elements must be sized\n // using flex-basis to avoid the busting out problem,\n // grid cells MUST be sized using width since rows are absolutely\n // positioned and will not cause the busting out problem,\n // and rows will not stretch to shrinkwrap the cells\n // unless they are widthed with width.\n cellElement.style.flex = '';\n cellElement.style.width = DomHelper.setLength(column.width); // IE11 calculates flexbox container width based on min-width rather than actual width. When column\n // has width defined greater than minWidth, row may have incorrect width\n\n if (BrowserHelper.isIE11) {\n cellElement.style.minWidth = cellElement.style.width;\n }\n } else {\n cellElement.style.flex = cellElement.style.width = cellElement.style.minWidth = '';\n }\n\n cellElement = cellElement.nextElementSibling;\n i++;\n }\n }", "resizeToFitContent() {\n const {\n grid\n } = this,\n {\n store\n } = grid,\n {\n count\n } = store;\n\n if (count && !this.hidden) {\n const cellElement = grid.element.querySelector(`.b-grid-cell[data-column-id=${this.id}]`); // cellElement might not exist, e.g. when trial is expired\n\n if (cellElement) {\n const cellPadding = parseInt(DomHelper.getStyleValue(cellElement, 'padding-left')),\n maxWidth = DomHelper.measureText(count, cellElement);\n this.width = maxWidth + 2 * cellPadding;\n }\n }\n }", "fixCellWidths(rowElement, visibleColumns = null) {\n if (!visibleColumns) visibleColumns = this.columns.bottomColumns.filter((col) => !col.hidden);\n\n // fix cell widths, no longer allowed in template because of CSP\n let cellElement = rowElement.firstElementChild,\n i = 0;\n\n while (cellElement) {\n const column = visibleColumns[i];\n\n if (column.minWidth) {\n DomHelper.setLength(cellElement, 'minWidth', column.minWidth);\n }\n\n // either flex or width, flex has precedence\n if (column.flex) {\n cellElement.style.flex = column.flex;\n cellElement.style.width = '';\n } else if (column.width) {\n // https://app.assembla.com/spaces/bryntum/tickets/8041\n // Although header and footer elements must be sized\n // using flex-basis to avoid the busting out problem,\n // grid cells MUST be sized using width since rows are absolutely\n // positioned and will not cause the busting out problem,\n // and rows will not stretch to shrinkwrap the cells\n // unless they are widthed with width.\n cellElement.style.flex = '';\n cellElement.style.width = DomHelper.setLength(column.width);\n\n // IE11 calculates flexbox container width based on min-width rather than actual width. When column\n // has width defined greater than minWidth, row may have incorrect width\n if (BrowserHelper.isIE11) {\n cellElement.style.minWidth = cellElement.style.width;\n }\n } else {\n cellElement.style.flex = cellElement.style.width = cellElement.style.minWidth = '';\n }\n\n cellElement = cellElement.nextElementSibling;\n i++;\n }\n }", "normalizeWidths() {\n // Loop through each level for tree\n for (let i = 0; i <= this.treeDepth; i++) {\n // Retrieve all nodes in level\n const nodes = document.querySelectorAll(`.level-${i}`);\n const nodeList = Array.from(nodes);\n\n // Determine the maximum width for all nodes\n const maxWidth = nodeList.reduce((max, curr) => {\n return curr.clientWidth > max ? curr.clientWidth : max;\n }, 0);\n\n // Set each node to max width\n nodeList.forEach(node => {\n node.style.width = maxWidth;\n });\n }\n }", "function FixGridWidth()\n{\n\tlet q = document.querySelectorAll(\".grid\");\n\tq.forEach(e => {\n\t\te.style.width = `${e.clientHeight}px`;\n\t});\n}", "function undistributeHeight(els) {\n els.forEach(function (el) {\n el.style.height = '';\n });\n}", "fixCellWidths() {\n const me = this;\n let hasFlex = false,\n flexBasis; // single header \"cell\"\n\n me.columns.traverse(column => {\n const cellEl = me.getBarCellElement(column.id),\n domWidth = DomHelper.setLength(column.width),\n domMinWidth = DomHelper.setLength(column.minWidth);\n\n if (cellEl) {\n // We have to work round the IE11 bug that flex-basis affects the content-box\n // and any padding is added as extra.\n // TODO: Remove this when IE11 retires.\n if (BrowserHelper.isIE11) {\n flexBasis = `calc(${domWidth} - ${me.getLrPadding(cellEl)}px)`;\n } else {\n flexBasis = domWidth;\n }\n\n hasFlex = hasFlex || Boolean(column.flex); // Parent column without any specified width and flex should have flex calculated if any child has flex\n\n if (column.isParent && column.width == null && column.flex == null) {\n const flex = column.children.reduce((result, child) => result += !child.hidden && child.flex || 0, 0); // Do not want to store this flex value on the column since it is always calculated\n\n cellEl.style.flex = flex > 0 ? `${flex} 0 auto` : '';\n\n if (flex > 0) {\n // TODO: Figure out a better way of handling this, minWidth on the columns breaks the flexbox\n // calculation compared to cells, making them misalign\n column.traverse(col => col.data.minWidth = null);\n }\n } // Normal case, set flex, width etc.\n else {\n if (parseInt(column.minWidth) >= 0) {\n cellEl.style.minWidth = domMinWidth;\n } // Clear all the things we might have to set to correct cell widths\n\n cellEl.style.flex = cellEl.style.flexBasis = cellEl.style.width = '';\n\n if (column.flex) {\n // If column has children we need to give it\n // flex-shrink: 0, flex-basis: auto so that it always\n // shrinkwraps its children without shrinking\n if (!isNaN(parseInt(column.flex)) && column.children) {\n cellEl.style.flex = `${column.flex} 0 auto`;\n } else {\n cellEl.style.flex = column.flex;\n }\n } else if (parseInt(column.width) >= 0) {\n const parent = column.parent; // Only grid header bar has a notion of group headers\n // Column is a child of an unwidthed group. We have to use width\n // to stretch it.\n\n if (me.isHeader && !parent.isRoot && !parent.width) {\n cellEl.style.width = domWidth;\n } else {\n // https://app.assembla.com/spaces/bryntum/tickets/8041\n // Column header widths must be set using flex-basis.\n // Using width means that wide widths cause a flexed SubGrid\n // to bust the flex rules.\n // TODO: When IE11 retires, remove calc() hacks to overcome its flexbox bugs.\n // Note that grid in Grid#onColumnsResized and SubGrid#fixCellWidths,\n // cells MUST still be sized using width since rows\n // are absolutely positioned and will not cause the busting out\n // problem, and rows will not stretch to shrinkwrap the cells\n // unless they are widthed with width.\n cellEl.style.flexBasis = flexBasis;\n }\n }\n }\n\n if (column.height >= 0) {\n cellEl.style.height = DomHelper.setLength(column.height);\n }\n }\n });\n me.element.classList[hasFlex ? 'add' : 'remove']('b-has-flex');\n }", "reflow (el) {\n var last = []\n var cols = [...el.querySelectorAll('.js-col')]\n\n for (let i = 0, len = cols.length, col; i < len; i++) {\n col = cols[i]\n if (col.childElementCount <= 1) continue\n last.push(...Array.prototype.slice.call(col.childNodes, -1))\n col.removeChild(col.lastElementChild)\n }\n\n for (let i = 0, len = last.length; i < len; i++) {\n var shortest = cols.reduce((min, el) => {\n var height = el.offsetHeight\n return !min || height < min.height ? { el, height } : min\n }, null)\n shortest.el.appendChild(last[i])\n }\n }", "function undistributeHeight(els) {\n els.height('');\n}", "function undistributeHeight(els) {\n els.height('');\n}", "function undistributeHeight(els) {\n els.height('');\n}", "function undistributeHeight(els) {\n els.height('');\n}", "function setColWidths(el, maxCharsPerCol) {\n var maxCharsPerRow = 0;\n var tbody = $(el).find('tbody');\n var pixelsAvailable = tbody[0].clientWidth;\n var scrollbarWidth = tbody[0].offsetWidth - tbody[0].clientWidth;\n var scrollBarInnerWidth;\n var outerSpacing = $(el).find('.col-0').outerWidth() - $(el).find('.col-0').width();\n // Column resizing needs to be done manually when tbody has scroll bar.\n if (el.settings.tbodyHasScrollBar) {\n if (el.settings.responsive) {\n // Allow 14px space for responsive show + button.\n $(el).find('.footable-toggle-col').css('width', '14px');\n pixelsAvailable -= $(el).find('.footable-toggle-col').outerWidth();\n }\n if (el.settings.actions.length > 0) {\n // Allow 22px space for actions column.\n $(el).find('.col-actions').css('width', '22px');\n pixelsAvailable -= $(el).find('.col-actions').outerWidth();\n } else {\n $(el).find('.col-actions').css('width', 0);\n }\n // Space header if a scroll bar visible.\n if (tbody.find('tr').length > 0 && scrollbarWidth > 0) {\n scrollBarInnerWidth = scrollbarWidth - outerSpacing;\n $(el).find('.scroll-spacer').css('width', scrollBarInnerWidth + 'px');\n pixelsAvailable -= $(el).find('.scroll-spacer').outerWidth();\n } else {\n $(el).find('.scroll-spacer').css('width', 0);\n }\n $.each(el.settings.columns, function eachColumn(idx) {\n // Allow extra char per col for padding.\n maxCharsPerCol['col-' + idx] += 1;\n maxCharsPerRow += maxCharsPerCol['col-' + idx];\n });\n $.each(el.settings.columns, function eachColumn(idx) {\n $(el).find('.col-' + idx).css('width', (pixelsAvailable * (maxCharsPerCol['col-' + idx] / maxCharsPerRow) - outerSpacing) + 'px');\n });\n }\n }", "function undistributeHeight(els) {\n els.forEach(function (el) {\n el.style.height = '';\n });\n }", "function undistributeHeight(els) {\n els.forEach(function (el) {\n el.style.height = '';\n });\n }", "function undistributeHeight(els) {\n els.forEach(function (el) {\n el.style.height = '';\n });\n }", "function columnwidth(){\n\t//this should affect whole page, so first we need to find every .row element\n\tlet allMyRows = document.querySelectorAll('.row');\n\t\n\t//we want a base minimum width for every column, I don't want them smaller than 150px\n\tlet baseWidth = 150;\n\t\n\t//loop through all of the rows \n\tallMyRows.forEach(function(e){\n\t\t//we need to know how wide the width is for the parent row\n\t\tlet myWidth = e.offsetWidth;\n\t\t\n\t\t//find direct children columns and how many there are\n\t\tlet allMyChildren = e.querySelectorAll(':scope >.column');//only selects the direct children of element\n\n\t\tlet myLength = allMyChildren.length;\n\t\t\n\t\t//find all the factors for my Length, take a number then try to divide it equally by every number smaller then itself, each success is a factor and can be put into an array.\n\t\tlet myFactors = [];\n\t\tfor (let num = myLength ; num > 0; num--){\t\n\t\t\tif (myLength % num === 0){\n\t\t\t\tmyFactors.push(num);//this array will have all positive factors, and will result in 2 length for primes.\n\t\t\t}\n\t\t}\n\t\t\n\t\tfunction setMinWidt(myarray,myvalue){\n\t\t\tfor (let i=0; i<myarray.length; i++){\n\t\t\t\tmyarray[i].style.minWidth = myvalue;\n\t\t\t}\n\t\t}\n\t\t//determine width of columns based on factors, baseWidth, and myWidth\n\t\t//first check if all columns will fit in space, if so do nothing\n\t\tif(baseWidth*myLength < myWidth){\n\t\t\tlet v = 150 + 'px'; //reset min width if enlarging\n\t\t\tsetMinWidt(allMyChildren,v); \n\t\t\t\n\t\t\t//do some different math for prime number of columns, lets set it up so that it tries to evenly spread the groups of columns, like a row of 6 then 5, or 2 rows of 4 then a row of 3, ect.\n\t\t} else if (myWidth <= 320){\n\t\t\tsetMinWidt(allMyChildren,'100%');\n\t\t} else if (myFactors.length === 2 ){\n\t\t\t\t for (let i=2; i < myLength; i++){\n\t\t\t\t\t let val = Math.ceil(Math.round(myLength/i));\n\t\t\t\t\t if (val*baseWidth < myWidth && val !== 1){ //if equal to one, let it default to normal widths/distributions\n\t\t\t\t\t\t let v = 100/val + '%';\n\t\t\t\t\t\t setMinWidt(allMyChildren,v);\n\t\t\t\t\t\t break;\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t \n\t\t} else { // here we determine how much space we have and divide columns accordingly\n\t\t\tfor (let value of myFactors){\n\t\t\t\tif (value*baseWidth < myWidth && myWidth > 320){ //if smaller than 320 only allow single columns\n\t\t\t\t\tlet v = 100/value + '%';\t\n\t\t\t\t\tsetMinWidt(allMyChildren,v);\n\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\t\n\t});\n}//end of column width function", "fixWidths() {\n const me = this,\n { element, header, footer } = me;\n\n if (me.flex) {\n header.flex = me.flex;\n if (footer) {\n footer.flex = me.flex;\n }\n element.style.flex = me.flex;\n } else {\n // If width is calculated and no column is using flex, check if total width is less than width. If so,\n // recalculate width and bail out of further processing (since setting width will trigger again)\n if (\n me.hasCalculatedWidth &&\n !me.columns.some((col) => !col.hidden && col.flex) &&\n me.totalFixedWidth !== me.width\n ) {\n me.width = me.totalFixedWidth;\n // Setting width above clears the hasCalculatedWidth flag, but we want to keep it set to react correctly\n // next time\n me.hasCalculatedWidth = true;\n return;\n }\n\n let totalWidth = me.width;\n\n if (!totalWidth) {\n totalWidth = 0;\n\n // summarize column widths, needed as container width when not using flex widths and for correct\n // overflow check in Edge\n for (let col of me.columns) {\n if (!col.flex && !col.hidden) totalWidth += col.width;\n }\n }\n\n // rows are absolutely positioned, meaning that their width won't affect container width\n // hence we must set it, if not using flex\n element.style.width = `${totalWidth}px`;\n\n header.width = totalWidth;\n if (footer) {\n footer.width = totalWidth;\n }\n }\n\n me.syncScrollingPartners(false);\n }", "function fit() {\n // find the size of the box\n const {\n width: parentWidth,\n height: parentHeight,\n paddingTop,\n paddingBottom,\n paddingLeft,\n paddingRight,\n } = window.getComputedStyle(term.element.parentElement);\n const boxWidth = parseFloat(parentWidth) - parseFloat(paddingLeft) - parseFloat(paddingRight);\n const boxHeight = parseFloat(parentHeight) - parseFloat(paddingTop) - parseFloat(paddingBottom);\n \n // find the size of a character\n const subjectRow = term.rowContainer.firstElementChild;\n const origContent = subjectRow.innerHTML;\n subjectRow.style.display = 'inline';\n subjectRow.innerText = 'W';\n const charWidth = subjectRow.getBoundingClientRect().width;\n subjectRow.style.display = '';\n const charHeight = subjectRow.getBoundingClientRect().height;\n subjectRow.innerHTML = origContent;\n \n term.resize(Math.floor(boxWidth / charWidth),\n Math.floor(boxHeight / charHeight));\n}", "function undistributeHeight(els) {\n els.height('');\n }", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n var flexOffsets = []; // amount of vertical space it takes up\n var flexHeights = []; // actual css height\n var usedHeight = 0;\n undistributeHeight(els); // give all elements their natural height\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n els.forEach(function (el, i) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalHeight = el.getBoundingClientRect().height;\n var naturalOffset = naturalHeight + computeVMargins(el);\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push(naturalHeight);\n }\n else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n });\n // readjust the recommended height to only consider the height available to non-maxed-out rows.\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n }\n // assign heights to all expandable elements\n flexEls.forEach(function (el, i) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n if (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n el.style.height = newHeight + 'px';\n }\n });\n}", "function undistributeHeight(els) {\n els.forEach(function (el) {\n el.style.height = '';\n });\n }", "fixCellWidths() {\n const me = this;\n\n let hasFlex = false,\n flexBasis;\n\n // single header \"cell\"\n me.columns.traverse((column) => {\n const cellEl = me.getBarCellElement(column.id),\n domWidth = DomHelper.setLength(column.width),\n domMinWidth = DomHelper.setLength(column.minWidth);\n\n if (cellEl) {\n // We have to work round the IE11 bug that flex-basis affects the content-box\n // and any padding is added as extra.\n // TODO: Remove this when IE11 retires.\n if (BrowserHelper.isIE11) {\n flexBasis = `calc(${domWidth} - ${me.getLrPadding(cellEl)}px)`;\n } else {\n flexBasis = domWidth;\n }\n\n hasFlex = hasFlex || Boolean(column.flex);\n\n // Parent column without any specified width and flex should have flex calculated if any child has flex\n if (column.isParent && column.width == null && column.flex == null) {\n const flex = column.children.reduce((result, child) => (result += (!child.hidden && child.flex) || 0), 0);\n\n // Do not want to store this flex value on the column since it is always calculated\n cellEl.style.flex = flex > 0 ? `${flex} 0 auto` : '';\n\n if (flex > 0) {\n // TODO: Figure out a better way of handling this, minWidth on the columns breaks the flexbox\n // calculation compared to cells, making them misalign\n column.traverse((col) => (col.data.minWidth = null));\n }\n }\n // Normal case, set flex, width etc.\n else {\n if (parseInt(column.minWidth) >= 0) {\n cellEl.style.minWidth = domMinWidth;\n }\n\n // Clear all the things we might have to set to correct cell widths\n cellEl.style.flex = cellEl.style.flexBasis = cellEl.style.width = '';\n\n if (column.flex) {\n // If column has children we need to give it\n // flex-shrink: 0, flex-basis: auto so that it always\n // shrinkwraps its children without shrinking\n if (!isNaN(parseInt(column.flex)) && column.children) {\n cellEl.style.flex = `${column.flex} 0 auto`;\n } else {\n cellEl.style.flex = column.flex;\n }\n } else if (parseInt(column.width) >= 0) {\n const parent = column.parent;\n\n // Only grid header bar has a notion of group headers\n // Column is a child of an unwidthed group. We have to use width\n // to stretch it.\n if (me.isHeader && !parent.isRoot && !parent.width) {\n cellEl.style.width = domWidth;\n } else {\n // https://app.assembla.com/spaces/bryntum/tickets/8041\n // Column header widths must be set using flex-basis.\n // Using width means that wide widths cause a flexed SubGrid\n // to bust the flex rules.\n // TODO: When IE11 retires, remove calc() hacks to overcome its flexbox bugs.\n // Note that grid in Grid#onColumnsResized and SubGrid#fixCellWidths,\n // cells MUST still be sized using width since rows\n // are absolutely positioned and will not cause the busting out\n // problem, and rows will not stretch to shrinkwrap the cells\n // unless they are widthed with width.\n cellEl.style.flexBasis = flexBasis;\n }\n }\n }\n\n if (column.height >= 0) {\n cellEl.style.height = DomHelper.setLength(column.height);\n }\n }\n });\n\n me.element.classList[hasFlex ? 'add' : 'remove']('b-has-flex');\n }", "function undistributeHeight(els) {\n\t\tels.height('');\n\t}", "function undistributeHeight(els) {\n\tels.height('');\n}", "function undistributeHeight(els) {\n\tels.height('');\n}", "function undistributeHeight(els) {\n\tels.height('');\n}", "function undistributeHeight(els) {\n\tels.height('');\n}", "function undistributeHeight(els) {\n\tels.height('');\n}", "function undistributeHeight(els) {\n\tels.height('');\n}", "function undistributeHeight(els) {\n\tels.height('');\n}", "function undistributeHeight(els) {\n\tels.height('');\n}", "function _getFullFlexItemWidth(elem, availableCols) {\n var colspan = 1; // For direction === 'column', we want the width to be 100%. For 'row', we want it to be\n // the 100% divided by the number of columns.\n\n if (element.direction === 'column') {\n return '100%';\n } // If elem has a colspan property, then\n\n\n if (elem && 'colspan' in elem && elem.colspan) {\n colspan = Math.min(Math.floor(elem.colspan), availableCols);\n /* force integer colspan values,\n don't exceed availableCols */\n }\n\n return Math.floor(100000 / element.maxColumns) / 1000 * colspan + '%';\n } // for direction=='row' && labelEdge=='start', use labelWidth/max-columns for any relative units,", "function getWidthOfWidestElement() {\n // Get all body children.\n var list = document.body.children;\n // Convert pool of dom elements to array.\n var domElemArray = [].slice.call(list);\n\n // The width of the widest child.\n var widthOfWidestChild = 0;\n function compareChildWidth(child) {\n // Store original display value.\n var originalDisplayValue = child.style.display;\n // Set display to inline so the width \"fits\" the child's content.\n child.style.display = 'inline';\n\n if(child.offsetWidth > widthOfWidestChild) {\n // If this child is wider than the currently widest child, update the value.\n widthOfWidestChild = child.offsetWidth;\n }\n\n // Restore the original display value.\n child.style.display = originalDisplayValue;\n }\n\n // Call `compareItemWidth` on each child in `domElemArray`.\n domElemArray.forEach(compareChildWidth);\n // Return width of widest child.\n return widthOfWidestChild;\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\n var flexOffsets = []; // amount of vertical space it takes up\n\n var flexHeights = []; // actual css height\n\n var usedHeight = 0;\n undistributeHeight(els); // give all elements their natural height\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n\n els.forEach(function (el, i) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalHeight = el.getBoundingClientRect().height;\n var naturalOffset = naturalHeight + computeVMargins(el);\n\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push(naturalHeight);\n } else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n }); // readjust the recommended height to only consider the height available to non-maxed-out rows.\n\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n } // assign heights to all expandable elements\n\n\n flexEls.forEach(function (el, i) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n if (naturalOffset < minOffset) {\n // we check this again because redistribution might have changed things\n el.style.height = newHeight + 'px';\n }\n });\n } // Undoes distrubuteHeight, restoring all els to their natural height", "function giveWidths(elems, hierarchy, currLevel) {\n var relevantElems = [];\n\n // An element is relevant if they have the same level ID.\n for (var i = 0; i < elems.length; i++) {\n if (elems[i].classList.contains('proofTreeNest')) {\n relevantElems.push(elems[i]);\n }\n }\n\n // elemCount is used for giving each \"node\" in our tree a unique ID.\n var elemCount = 0;\n var width = $('#proofTreeContainer').width();\n\n // For every level, style the elements accordingly.\n for (var i = 0; i < relevantElems.length; i++) {\n var currChar = String.fromCharCode(97 + elemCount);\n elems[i].id = hierarchy + '-l' + currLevel + currChar;\n\n if (elems[i].id == 'root-l0a') {\n width = $('#proofTreeContainer').width();\n } else {\n width = (Math.floor($(elems[0]).parent('.proofTreeNest').width() - 25) /\n relevantElems.length);\n }\n\n // Give the checkbox this ID!\n $(elems[i]).children('.proofTreeLabel')\n .children('input[type=checkbox]')\n .attr('data-checkedoptional', 'submittedAnswer.' + elems[i].id);\n\n var elem = $('#' + elems[i].id);\n elem.outerWidth(width + 'px');\n elem.css('display', 'table-cell');\n elem.css('vertical-align', 'bottom');\n elem.css('padding-left', '3px');\n elem.css('padding-right', '3px');\n if (elems[i].classList.contains('proofTreeNest')) {\n elem = elem.children('.proofTreeNest:last-child');\n elem.css('margin', '0');\n elem.css('text-align', 'center');\n elem.outerWidth(width + 'px');\n elem.css('display', 'table-cell');\n elem.css('vertical-align', 'bottom');\n }\n\n elemCount++;\n\n if ($(elems[i]).children('.proofTreeNest').length > 0) {\n giveWidths($(elems[i]).children('.proofTreeNest'), elems[i].id, currLevel + 1);\n }\n }\n\n // Every time we resize, we need to reserialize.\n serializeTree();\n }", "function maxWidth (table, theWrap, modifier) {\n let width = 0\n\n // table might be of the form [leftColumn],\n // or {key: leftColumn}\n if (!Array.isArray(table)) {\n table = Object.keys(table).map(key => [table[key]])\n }\n\n table.forEach((v) => {\n width = Math.max(\n stringWidth(modifier ? `${modifier} ${v[0]}` : v[0]),\n width\n )\n })\n\n // if we've enabled 'wrap' we should limit\n // the max-width of the left-column.\n if (theWrap) width = Math.min(width, parseInt(theWrap * 0.5, 10))\n\n return width\n }", "function maxWidth (table, theWrap, modifier) {\n let width = 0\n\n // table might be of the form [leftColumn],\n // or {key: leftColumn}\n if (!Array.isArray(table)) {\n table = Object.keys(table).map(key => [table[key]])\n }\n\n table.forEach((v) => {\n width = Math.max(\n stringWidth(modifier ? `${modifier} ${v[0]}` : v[0]),\n width\n )\n })\n\n // if we've enabled 'wrap' we should limit\n // the max-width of the left-column.\n if (theWrap) width = Math.min(width, parseInt(theWrap * 0.5, 10))\n\n return width\n }", "function maxWidth (table, theWrap, modifier) {\n let width = 0\n\n // table might be of the form [leftColumn],\n // or {key: leftColumn}\n if (!Array.isArray(table)) {\n table = Object.keys(table).map(key => [table[key]])\n }\n\n table.forEach((v) => {\n width = Math.max(\n stringWidth(modifier ? `${modifier} ${v[0]}` : v[0]),\n width\n )\n })\n\n // if we've enabled 'wrap' we should limit\n // the max-width of the left-column.\n if (theWrap) width = Math.min(width, parseInt(theWrap * 0.5, 10))\n\n return width\n }", "function maxWidth (table, theWrap, modifier) {\n let width = 0\n\n // table might be of the form [leftColumn],\n // or {key: leftColumn}\n if (!Array.isArray(table)) {\n table = Object.keys(table).map(key => [table[key]])\n }\n\n table.forEach((v) => {\n width = Math.max(\n stringWidth(modifier ? `${modifier} ${v[0]}` : v[0]),\n width\n )\n })\n\n // if we've enabled 'wrap' we should limit\n // the max-width of the left-column.\n if (theWrap) width = Math.min(width, parseInt(theWrap * 0.5, 10))\n\n return width\n }", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\n var flexOffsets = []; // amount of vertical space it takes up\n\n var flexHeights = []; // actual css height\n\n var usedHeight = 0;\n undistributeHeight(els); // give all elements their natural height\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n\n els.forEach(function (el, i) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = dom_geom_1.computeHeightAndMargins(el);\n\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push(el.offsetHeight);\n } else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n }); // readjust the recommended height to only consider the height available to non-maxed-out rows.\n\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n } // assign heights to all expandable elements\n\n\n flexEls.forEach(function (el, i) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n if (naturalOffset < minOffset) {\n // we check this again because redistribution might have changed things\n el.style.height = newHeight + 'px';\n }\n });\n }", "function resizeTables()\r\n{\r\n\r\n var tableArr = reportico_jquery('.swRepPage');\r\n var tableDataRow = reportico_jquery('.swRepResultLine:first');\r\n var cellWidths = new Array();\r\n reportico_jquery(tableDataRow).each(function() {\r\n for(j = 0; j < reportico_jquery(this)[0].cells.length; j++){\r\n var cell = reportico_jquery(this)[0].cells[j];\r\n if(!cellWidths[j] || cellWidths[j] < cell.clientWidth) cellWidths[j] = cell.clientWidth;\r\n }\r\n });\r\n\r\n var tablect = 0;\r\n reportico_jquery(tableArr).each(function() {\r\n tablect++;\r\n if ( tablect == 1 )\r\n return;\r\n\r\n reportico_jquery(this).find(\".swRepResultLine:first\").each(function() {\r\n for(j = 0; j < reportico_jquery(this)[0].cells.length; j++){\r\n reportico_jquery(this)[0].cells[j].style.width = cellWidths[j]+'px';\r\n }\r\n });\r\n });\r\n}", "function colWidths(rows) {\n return rows[0].map((_, i) => {\n return rows.reduce((max, row) => {\n return Math.max(max, row[i].minWidth());\n }, 0);\n });\n}", "function ResizeAll(){\r\n\tListTable.style.tableLayout=\"fixed\";\r\n\tif(ListTable.rows(0)!=null)\r\n\t{\r\n\t\tfor (var i = 0; i <ListTable.rows(0).cells.length; i++)\r\n\t\t\tListTable.rows(0).cells(i).style.width=HeaderTable.rows(0).cells(i).style.width;\r\n } \r\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n var flexOffsets = []; // amount of vertical space it takes up\n var flexHeights = []; // actual css height\n var usedHeight = 0;\n undistributeHeight(els); // give all elements their natural height\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n els.forEach(function (el, i) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalHeight = el.getBoundingClientRect().height;\n var naturalOffset = naturalHeight + computeVMargins$1(el);\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push(naturalHeight);\n }\n else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n });\n // readjust the recommended height to only consider the height available to non-maxed-out rows.\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n }\n // assign heights to all expandable elements\n flexEls.forEach(function (el, i) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n if (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n el.style.height = newHeight + 'px';\n }\n });\n }", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n\n\t// *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n\t// and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n\n\tvar minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\tvar minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\tvar flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\tvar flexOffsets = []; // amount of vertical space it takes up\n\tvar flexHeights = []; // actual css height\n\tvar usedHeight = 0;\n\n\tundistributeHeight(els); // give all elements their natural height\n\n\t// find elements that are below the recommended height (expandable).\n\t// important to query for heights in a single first pass (to avoid reflow oscillation).\n\tels.each(function(i, el) {\n\t\tvar minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = $(el).outerHeight(true);\n\n\t\tif (naturalOffset < minOffset) {\n\t\t\tflexEls.push(el);\n\t\t\tflexOffsets.push(naturalOffset);\n\t\t\tflexHeights.push($(el).height());\n\t\t}\n\t\telse {\n\t\t\t// this element stretches past recommended height (non-expandable). mark the space as occupied.\n\t\t\tusedHeight += naturalOffset;\n\t\t}\n\t});\n\n\t// readjust the recommended height to only consider the height available to non-maxed-out rows.\n\tif (shouldRedistribute) {\n\t\tavailableHeight -= usedHeight;\n\t\tminOffset1 = Math.floor(availableHeight / flexEls.length);\n\t\tminOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n\t}\n\n\t// assign heights to all expandable elements\n\t$(flexEls).each(function(i, el) {\n\t\tvar minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = flexOffsets[i];\n\t\tvar naturalHeight = flexHeights[i];\n\t\tvar newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n\t\tif (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n\t\t\t$(el).height(newHeight);\n\t\t}\n\t});\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n\n\t// *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n\t// and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n\n\tvar minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\tvar minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\tvar flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\tvar flexOffsets = []; // amount of vertical space it takes up\n\tvar flexHeights = []; // actual css height\n\tvar usedHeight = 0;\n\n\tundistributeHeight(els); // give all elements their natural height\n\n\t// find elements that are below the recommended height (expandable).\n\t// important to query for heights in a single first pass (to avoid reflow oscillation).\n\tels.each(function(i, el) {\n\t\tvar minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = $(el).outerHeight(true);\n\n\t\tif (naturalOffset < minOffset) {\n\t\t\tflexEls.push(el);\n\t\t\tflexOffsets.push(naturalOffset);\n\t\t\tflexHeights.push($(el).height());\n\t\t}\n\t\telse {\n\t\t\t// this element stretches past recommended height (non-expandable). mark the space as occupied.\n\t\t\tusedHeight += naturalOffset;\n\t\t}\n\t});\n\n\t// readjust the recommended height to only consider the height available to non-maxed-out rows.\n\tif (shouldRedistribute) {\n\t\tavailableHeight -= usedHeight;\n\t\tminOffset1 = Math.floor(availableHeight / flexEls.length);\n\t\tminOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n\t}\n\n\t// assign heights to all expandable elements\n\t$(flexEls).each(function(i, el) {\n\t\tvar minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = flexOffsets[i];\n\t\tvar naturalHeight = flexHeights[i];\n\t\tvar newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n\t\tif (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n\t\t\t$(el).height(newHeight);\n\t\t}\n\t});\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n\n\t// *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n\t// and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n\n\tvar minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\tvar minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\tvar flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\tvar flexOffsets = []; // amount of vertical space it takes up\n\tvar flexHeights = []; // actual css height\n\tvar usedHeight = 0;\n\n\tundistributeHeight(els); // give all elements their natural height\n\n\t// find elements that are below the recommended height (expandable).\n\t// important to query for heights in a single first pass (to avoid reflow oscillation).\n\tels.each(function(i, el) {\n\t\tvar minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = $(el).outerHeight(true);\n\n\t\tif (naturalOffset < minOffset) {\n\t\t\tflexEls.push(el);\n\t\t\tflexOffsets.push(naturalOffset);\n\t\t\tflexHeights.push($(el).height());\n\t\t}\n\t\telse {\n\t\t\t// this element stretches past recommended height (non-expandable). mark the space as occupied.\n\t\t\tusedHeight += naturalOffset;\n\t\t}\n\t});\n\n\t// readjust the recommended height to only consider the height available to non-maxed-out rows.\n\tif (shouldRedistribute) {\n\t\tavailableHeight -= usedHeight;\n\t\tminOffset1 = Math.floor(availableHeight / flexEls.length);\n\t\tminOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n\t}\n\n\t// assign heights to all expandable elements\n\t$(flexEls).each(function(i, el) {\n\t\tvar minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = flexOffsets[i];\n\t\tvar naturalHeight = flexHeights[i];\n\t\tvar newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n\t\tif (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n\t\t\t$(el).height(newHeight);\n\t\t}\n\t});\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n\n\t// *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n\t// and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n\n\tvar minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\tvar minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\tvar flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\tvar flexOffsets = []; // amount of vertical space it takes up\n\tvar flexHeights = []; // actual css height\n\tvar usedHeight = 0;\n\n\tundistributeHeight(els); // give all elements their natural height\n\n\t// find elements that are below the recommended height (expandable).\n\t// important to query for heights in a single first pass (to avoid reflow oscillation).\n\tels.each(function(i, el) {\n\t\tvar minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = $(el).outerHeight(true);\n\n\t\tif (naturalOffset < minOffset) {\n\t\t\tflexEls.push(el);\n\t\t\tflexOffsets.push(naturalOffset);\n\t\t\tflexHeights.push($(el).height());\n\t\t}\n\t\telse {\n\t\t\t// this element stretches past recommended height (non-expandable). mark the space as occupied.\n\t\t\tusedHeight += naturalOffset;\n\t\t}\n\t});\n\n\t// readjust the recommended height to only consider the height available to non-maxed-out rows.\n\tif (shouldRedistribute) {\n\t\tavailableHeight -= usedHeight;\n\t\tminOffset1 = Math.floor(availableHeight / flexEls.length);\n\t\tminOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n\t}\n\n\t// assign heights to all expandable elements\n\t$(flexEls).each(function(i, el) {\n\t\tvar minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = flexOffsets[i];\n\t\tvar naturalHeight = flexHeights[i];\n\t\tvar newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n\t\tif (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n\t\t\t$(el).height(newHeight);\n\t\t}\n\t});\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n\n\t// *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n\t// and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n\n\tvar minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\tvar minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\tvar flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\tvar flexOffsets = []; // amount of vertical space it takes up\n\tvar flexHeights = []; // actual css height\n\tvar usedHeight = 0;\n\n\tundistributeHeight(els); // give all elements their natural height\n\n\t// find elements that are below the recommended height (expandable).\n\t// important to query for heights in a single first pass (to avoid reflow oscillation).\n\tels.each(function(i, el) {\n\t\tvar minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = $(el).outerHeight(true);\n\n\t\tif (naturalOffset < minOffset) {\n\t\t\tflexEls.push(el);\n\t\t\tflexOffsets.push(naturalOffset);\n\t\t\tflexHeights.push($(el).height());\n\t\t}\n\t\telse {\n\t\t\t// this element stretches past recommended height (non-expandable). mark the space as occupied.\n\t\t\tusedHeight += naturalOffset;\n\t\t}\n\t});\n\n\t// readjust the recommended height to only consider the height available to non-maxed-out rows.\n\tif (shouldRedistribute) {\n\t\tavailableHeight -= usedHeight;\n\t\tminOffset1 = Math.floor(availableHeight / flexEls.length);\n\t\tminOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n\t}\n\n\t// assign heights to all expandable elements\n\t$(flexEls).each(function(i, el) {\n\t\tvar minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = flexOffsets[i];\n\t\tvar naturalHeight = flexHeights[i];\n\t\tvar newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n\t\tif (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n\t\t\t$(el).height(newHeight);\n\t\t}\n\t});\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n\n\t// *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n\t// and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n\n\tvar minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\tvar minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\tvar flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\tvar flexOffsets = []; // amount of vertical space it takes up\n\tvar flexHeights = []; // actual css height\n\tvar usedHeight = 0;\n\n\tundistributeHeight(els); // give all elements their natural height\n\n\t// find elements that are below the recommended height (expandable).\n\t// important to query for heights in a single first pass (to avoid reflow oscillation).\n\tels.each(function(i, el) {\n\t\tvar minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = $(el).outerHeight(true);\n\n\t\tif (naturalOffset < minOffset) {\n\t\t\tflexEls.push(el);\n\t\t\tflexOffsets.push(naturalOffset);\n\t\t\tflexHeights.push($(el).height());\n\t\t}\n\t\telse {\n\t\t\t// this element stretches past recommended height (non-expandable). mark the space as occupied.\n\t\t\tusedHeight += naturalOffset;\n\t\t}\n\t});\n\n\t// readjust the recommended height to only consider the height available to non-maxed-out rows.\n\tif (shouldRedistribute) {\n\t\tavailableHeight -= usedHeight;\n\t\tminOffset1 = Math.floor(availableHeight / flexEls.length);\n\t\tminOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n\t}\n\n\t// assign heights to all expandable elements\n\t$(flexEls).each(function(i, el) {\n\t\tvar minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = flexOffsets[i];\n\t\tvar naturalHeight = flexHeights[i];\n\t\tvar newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n\t\tif (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n\t\t\t$(el).height(newHeight);\n\t\t}\n\t});\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n\n\t// *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n\t// and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n\n\tvar minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\tvar minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\tvar flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\tvar flexOffsets = []; // amount of vertical space it takes up\n\tvar flexHeights = []; // actual css height\n\tvar usedHeight = 0;\n\n\tundistributeHeight(els); // give all elements their natural height\n\n\t// find elements that are below the recommended height (expandable).\n\t// important to query for heights in a single first pass (to avoid reflow oscillation).\n\tels.each(function(i, el) {\n\t\tvar minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = $(el).outerHeight(true);\n\n\t\tif (naturalOffset < minOffset) {\n\t\t\tflexEls.push(el);\n\t\t\tflexOffsets.push(naturalOffset);\n\t\t\tflexHeights.push($(el).height());\n\t\t}\n\t\telse {\n\t\t\t// this element stretches past recommended height (non-expandable). mark the space as occupied.\n\t\t\tusedHeight += naturalOffset;\n\t\t}\n\t});\n\n\t// readjust the recommended height to only consider the height available to non-maxed-out rows.\n\tif (shouldRedistribute) {\n\t\tavailableHeight -= usedHeight;\n\t\tminOffset1 = Math.floor(availableHeight / flexEls.length);\n\t\tminOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n\t}\n\n\t// assign heights to all expandable elements\n\t$(flexEls).each(function(i, el) {\n\t\tvar minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = flexOffsets[i];\n\t\tvar naturalHeight = flexHeights[i];\n\t\tvar newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n\t\tif (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n\t\t\t$(el).height(newHeight);\n\t\t}\n\t});\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n\n\t// *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n\t// and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n\n\tvar minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\tvar minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\tvar flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\tvar flexOffsets = []; // amount of vertical space it takes up\n\tvar flexHeights = []; // actual css height\n\tvar usedHeight = 0;\n\n\tundistributeHeight(els); // give all elements their natural height\n\n\t// find elements that are below the recommended height (expandable).\n\t// important to query for heights in a single first pass (to avoid reflow oscillation).\n\tels.each(function(i, el) {\n\t\tvar minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = $(el).outerHeight(true);\n\n\t\tif (naturalOffset < minOffset) {\n\t\t\tflexEls.push(el);\n\t\t\tflexOffsets.push(naturalOffset);\n\t\t\tflexHeights.push($(el).height());\n\t\t}\n\t\telse {\n\t\t\t// this element stretches past recommended height (non-expandable). mark the space as occupied.\n\t\t\tusedHeight += naturalOffset;\n\t\t}\n\t});\n\n\t// readjust the recommended height to only consider the height available to non-maxed-out rows.\n\tif (shouldRedistribute) {\n\t\tavailableHeight -= usedHeight;\n\t\tminOffset1 = Math.floor(availableHeight / flexEls.length);\n\t\tminOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n\t}\n\n\t// assign heights to all expandable elements\n\t$(flexEls).each(function(i, el) {\n\t\tvar minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n\t\tvar naturalOffset = flexOffsets[i];\n\t\tvar naturalHeight = flexHeights[i];\n\t\tvar newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n\t\tif (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n\t\t\t$(el).height(newHeight);\n\t\t}\n\t});\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n var flexOffsets = []; // amount of vertical space it takes up\n var flexHeights = []; // actual css height\n var usedHeight = 0;\n undistributeHeight(els); // give all elements their natural height\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n els.forEach(function (el, i) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalHeight = el.getBoundingClientRect().height;\n var naturalOffset = naturalHeight + computeVMargins(el);\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push(naturalHeight);\n }\n else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n });\n // readjust the recommended height to only consider the height available to non-maxed-out rows.\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n }\n // assign heights to all expandable elements\n flexEls.forEach(function (el, i) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n if (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n el.style.height = newHeight + 'px';\n }\n });\n }", "fixWidths() {\n const me = this,\n {\n element,\n header,\n footer\n } = me;\n\n if (!me.collapsed) {\n if (me.flex) {\n header.flex = me.flex;\n\n if (footer) {\n footer.flex = me.flex;\n }\n\n element.style.flex = me.flex;\n } else {\n // If width is calculated and no column is using flex, check if total width is less than width. If so,\n // recalculate width and bail out of further processing (since setting width will trigger again)\n if (me.hasCalculatedWidth && !me.columns.some(col => !col.hidden && col.flex) && me.totalFixedWidth !== me.width) {\n me.width = me.totalFixedWidth; // Setting width above clears the hasCalculatedWidth flag, but we want to keep it set to react correctly\n // next time\n\n me.hasCalculatedWidth = true;\n return;\n }\n\n let totalWidth = me.width;\n\n if (!totalWidth) {\n totalWidth = 0; // summarize column widths, needed as container width when not using flex widths and for correct\n // overflow check in Edge\n\n for (const col of me.columns) {\n if (!col.flex && !col.hidden) totalWidth += col.width;\n }\n } // rows are absolutely positioned, meaning that their width won't affect container width\n // hence we must set it, if not using flex\n\n element.style.width = `${totalWidth}px`;\n header.width = totalWidth;\n\n if (footer) {\n footer.width = totalWidth;\n }\n }\n\n me.syncScrollingPartners(false);\n }\n }", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n var flexOffsets = []; // amount of vertical space it takes up\n var flexHeights = []; // actual css height\n var usedHeight = 0;\n undistributeHeight(els); // give all elements their natural height\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n els.each(function (i, el) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = $(el).outerHeight(true);\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push($(el).height());\n }\n else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n });\n // readjust the recommended height to only consider the height available to non-maxed-out rows.\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n }\n // assign heights to all expandable elements\n $(flexEls).each(function (i, el) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n if (naturalOffset < minOffset) {\n $(el).height(newHeight);\n }\n });\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n var flexOffsets = []; // amount of vertical space it takes up\n var flexHeights = []; // actual css height\n var usedHeight = 0;\n undistributeHeight(els); // give all elements their natural height\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n els.each(function (i, el) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = $(el).outerHeight(true);\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push($(el).height());\n }\n else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n });\n // readjust the recommended height to only consider the height available to non-maxed-out rows.\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n }\n // assign heights to all expandable elements\n $(flexEls).each(function (i, el) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n if (naturalOffset < minOffset) {\n $(el).height(newHeight);\n }\n });\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n var flexOffsets = []; // amount of vertical space it takes up\n var flexHeights = []; // actual css height\n var usedHeight = 0;\n undistributeHeight(els); // give all elements their natural height\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n els.each(function (i, el) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = $(el).outerHeight(true);\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push($(el).height());\n }\n else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n });\n // readjust the recommended height to only consider the height available to non-maxed-out rows.\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n }\n // assign heights to all expandable elements\n $(flexEls).each(function (i, el) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n if (naturalOffset < minOffset) {\n $(el).height(newHeight);\n }\n });\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n var flexOffsets = []; // amount of vertical space it takes up\n var flexHeights = []; // actual css height\n var usedHeight = 0;\n undistributeHeight(els); // give all elements their natural height\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n els.each(function (i, el) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = $(el).outerHeight(true);\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push($(el).height());\n }\n else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n });\n // readjust the recommended height to only consider the height available to non-maxed-out rows.\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n }\n // assign heights to all expandable elements\n $(flexEls).each(function (i, el) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n if (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n $(el).height(newHeight);\n }\n });\n}", "function forceFillColumnWidths(allColumns, expectedWidth, startIdx, allowBleed, defaultColWidth) {\n if (defaultColWidth === void 0) { defaultColWidth = 300; }\n // const hiddenColumns = allColumns.filter(c => c.hidden);\n // for (const column of hiddenColumns) {\n // if(!column.$$oldWidth) {\n // column.$$oldWidth = column.width;\n // }\n // column.width = 0;\n // }\n var hiddenColumns = [];\n allColumns.forEach(function (col) {\n col.hidden = false;\n var width = calcRealWidth(col);\n if (width !== null && width < 10) {\n hiddenColumns.push(col);\n col.hidden = true;\n if (!col.$$oldWidth) {\n col.$$oldWidth = col.width;\n }\n col.width = 0;\n }\n else if (!col.width && col.$$oldWidth) {\n col.width = col.$$oldWidth;\n }\n });\n allColumns = allColumns.filter(function (c) { return c.visible && !c.hidden; });\n var columnsToResize = allColumns.slice(startIdx + 1, allColumns.length).filter(function (c) { return c.canAutoResize !== false; });\n var averageColumnWidth = expectedWidth / columnsToResize.length;\n for (var _i = 0, columnsToResize_1 = columnsToResize; _i < columnsToResize_1.length; _i++) {\n var column = columnsToResize_1[_i];\n if (!column.$$oldWidth) {\n column.$$oldWidth = column.width;\n }\n column.width = averageColumnWidth;\n }\n var additionWidthPerColumn = 0;\n var exceedsWindow = false;\n var contentWidth = getContentWidth(allColumns, defaultColWidth);\n var remainingWidth = expectedWidth - contentWidth;\n var columnsProcessed = [];\n // This loop takes care of the\n do {\n additionWidthPerColumn = remainingWidth / columnsToResize.length;\n exceedsWindow = contentWidth >= expectedWidth;\n for (var _a = 0, columnsToResize_2 = columnsToResize; _a < columnsToResize_2.length; _a++) {\n var column = columnsToResize_2[_a];\n if (exceedsWindow && allowBleed) {\n column.width = column.$$oldWidth || column.width || defaultColWidth;\n }\n else {\n var newSize = (column.width || defaultColWidth) + additionWidthPerColumn;\n if (column.minWidth && newSize < column.minWidth) {\n column.width = column.minWidth;\n columnsProcessed.push(column);\n }\n else if (column.maxWidth && newSize > column.maxWidth) {\n column.width = column.maxWidth;\n columnsProcessed.push(column);\n }\n else {\n column.width = newSize;\n }\n }\n column.width = Math.max(0, column.width);\n }\n contentWidth = getContentWidth(allColumns);\n remainingWidth = expectedWidth - contentWidth;\n removeProcessedColumns(columnsToResize, columnsProcessed);\n } while (remainingWidth > 0 && columnsToResize.length !== 0);\n}", "function setToMaxWidth(el, max) {\n let style = window.getComputedStyle(el, null).getPropertyValue('font-size');\n let fontSize = parseFloat(style); \n\n // Ratio of optimal font size in px to width in px.\n // Only applies to currently set font details. Needs to be updated if style changes.\n const T_WIDTH = 864;\n const T_SIZE = 112;\n let ratio = T_SIZE / T_WIDTH;\n\n if(window.innerWidth > max) {\n el.style.fontSize = ratio * max + \"px\";\n }\n else { \n // Font = ratio * viewport width\n el.style.fontSize = ratio * window.innerWidth + \"px\";\n }\n}", "function minorAdjustmentsToElementsOnResize() {\n\n\t// do some IE stuff, unfortunately, check for IE7\n\tif(isIEorEDGE()) {\n\t\tjQuery('html').addClass('ie');\n\t\tjQuery('.image-group').each(function(){\n\t\t\tvar $this = jQuery(this),\n\t\t\t\tdivs = $this.find('> div'),\n\t\t\t\tdivs1 = $this.find('> div:first'),\n\t\t\t\tdivs_count = divs.length,\n\n\t\t\t\tparent_width = $this.width(),\n\t\t\t\tborder_width_left = divs1.css('borderLeftWidth'),\n\t\t\t\tborder_width_right = divs1.css('borderRightWidth'),\n\t\t\t\twidth_padding = parseInt(border_width_left) + parseInt(border_width_right),\n\n\t\t\t\twidth = (parent_width / divs_count) - width_padding,\n\t\t\t\twidth_percent = ( (width / parent_width) * 100 ) + '%';\n\t\t\t//console.log(divs_count);\n\t\t\t//console.log(parent_width);\n\t\t\t//console.log(width);\n\t\t\t//console.log(width_percent);\n\t\t\t//console.log(width_padding);\n\t\t\t// set width\n\t\t\tdivs.css('width', width_percent);\n\t\t\tdivs.css('float', 'left');\n\t\t});\n\t}\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n var flexOffsets = []; // amount of vertical space it takes up\n var flexHeights = []; // actual css height\n var usedHeight = 0;\n undistributeHeight(els); // give all elements their natural height\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n els.forEach(function (el, i) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = computeHeightAndMargins(el);\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push(el.offsetHeight);\n }\n else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n });\n // readjust the recommended height to only consider the height available to non-maxed-out rows.\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n }\n // assign heights to all expandable elements\n flexEls.forEach(function (el, i) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n if (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n el.style.height = newHeight + 'px';\n }\n });\n }", "function undistributeHeight(els){els.height('');}", "function colWidths(rows) {\n return rows[0].map(function(_, i) {\n return rows.reduce(function(max, row) {\n return Math.max(max, row[i].minWidth());\n }, 0);\n });\n}", "function colWidths(rows) {\n return rows[0].map(function(_, i) {\n return rows.reduce(function(max, row) {\n return Math.max(max, row[i].minWidth());\n }, 0);\n });\n}", "function colWidths(rows) {\n return rows[0].map(function(_, i) {\n return rows.reduce(function(max, row) {\n return Math.max(max, row[i].minWidth());\n }, 0);\n });\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n var flexOffsets = []; // amount of vertical space it takes up\n var flexHeights = []; // actual css height\n var usedHeight = 0;\n\n undistributeHeight(els); // give all elements their natural height\n\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n els.each(function (i, el) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = $(el).outerHeight(true);\n\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push($(el).height());\n }\n else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n });\n\n // readjust the recommended height to only consider the height available to non-maxed-out rows.\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n }\n\n // assign heights to all expandable elements\n $(flexEls).each(function (i, el) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n if (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n $(el).height(newHeight);\n }\n });\n }", "function resizeElementsByRows(boxes, options) {\n\t\tvar currentRow = $(), maxHeight, maxCalcHeight = 0, firstOffset = boxes.eq(0).offset().top;\n\t\tboxes.each(function(ind){\n\t\t\tvar curItem = $(this);\n\t\t\tif(curItem.offset().top === firstOffset) {\n\t\t\t\tcurrentRow = currentRow.add(this);\n\t\t\t} else {\n\t\t\t\tmaxHeight = getMaxHeight(currentRow);\n\t\t\t\tmaxCalcHeight = Math.max(maxCalcHeight, resizeElements(currentRow, maxHeight, options));\n\t\t\t\tcurrentRow = curItem;\n\t\t\t\tfirstOffset = curItem.offset().top;\n\t\t\t}\n\t\t});\n\t\tif(currentRow.length) {\n\t\t\tmaxHeight = getMaxHeight(currentRow);\n\t\t\tmaxCalcHeight = Math.max(maxCalcHeight, resizeElements(currentRow, maxHeight, options));\n\t\t}\n\t\tif(options.biggestHeight) {\n\t\t\tboxes.css(options.useMinHeight && supportMinHeight ? 'minHeight' : 'height', maxCalcHeight);\n\t\t}\n\t}", "function resizeElementsByRows(boxes, options) {\n\t\tvar currentRow = $(), maxHeight, maxCalcHeight = 0, firstOffset = boxes.eq(0).offset().top;\n\t\tboxes.each(function(ind){\n\t\t\tvar curItem = $(this);\n\t\t\tif(curItem.offset().top === firstOffset) {\n\t\t\t\tcurrentRow = currentRow.add(this);\n\t\t\t} else {\n\t\t\t\tmaxHeight = getMaxHeight(currentRow);\n\t\t\t\tmaxCalcHeight = Math.max(maxCalcHeight, resizeElements(currentRow, maxHeight, options));\n\t\t\t\tcurrentRow = curItem;\n\t\t\t\tfirstOffset = curItem.offset().top;\n\t\t\t}\n\t\t});\n\t\tif(currentRow.length) {\n\t\t\tmaxHeight = getMaxHeight(currentRow);\n\t\t\tmaxCalcHeight = Math.max(maxCalcHeight, resizeElements(currentRow, maxHeight, options));\n\t\t}\n\t\tif(options.biggestHeight) {\n\t\t\tboxes.css(options.useMinHeight && supportMinHeight ? 'minHeight' : 'height', maxCalcHeight);\n\t\t}\n\t}", "function resizeElementsByRows(boxes, options) {\n\t\tvar currentRow = $(), maxHeight, maxCalcHeight = 0, firstOffset = boxes.eq(0).offset().top;\n\t\tboxes.each(function(ind){\n\t\t\tvar curItem = $(this);\n\t\t\tif(curItem.offset().top === firstOffset) {\n\t\t\t\tcurrentRow = currentRow.add(this);\n\t\t\t} else {\n\t\t\t\tmaxHeight = getMaxHeight(currentRow);\n\t\t\t\tmaxCalcHeight = Math.max(maxCalcHeight, resizeElements(currentRow, maxHeight, options));\n\t\t\t\tcurrentRow = curItem;\n\t\t\t\tfirstOffset = curItem.offset().top;\n\t\t\t}\n\t\t});\n\t\tif(currentRow.length) {\n\t\t\tmaxHeight = getMaxHeight(currentRow);\n\t\t\tmaxCalcHeight = Math.max(maxCalcHeight, resizeElements(currentRow, maxHeight, options));\n\t\t}\n\t\tif(options.biggestHeight) {\n\t\t\tboxes.css(options.useMinHeight && supportMinHeight ? 'minHeight' : 'height', maxCalcHeight);\n\t\t}\n\t}", "function resizeElementsByRows(boxes, options) {\n\t\tvar currentRow = $(), maxHeight, maxCalcHeight = 0, firstOffset = boxes.eq(0).offset().top;\n\t\tboxes.each(function(ind){\n\t\t\tvar curItem = $(this);\n\t\t\tif(curItem.offset().top === firstOffset) {\n\t\t\t\tcurrentRow = currentRow.add(this);\n\t\t\t} else {\n\t\t\t\tmaxHeight = getMaxHeight(currentRow);\n\t\t\t\tmaxCalcHeight = Math.max(maxCalcHeight, resizeElements(currentRow, maxHeight, options));\n\t\t\t\tcurrentRow = curItem;\n\t\t\t\tfirstOffset = curItem.offset().top;\n\t\t\t}\n\t\t});\n\t\tif(currentRow.length) {\n\t\t\tmaxHeight = getMaxHeight(currentRow);\n\t\t\tmaxCalcHeight = Math.max(maxCalcHeight, resizeElements(currentRow, maxHeight, options));\n\t\t}\n\t\tif(options.biggestHeight) {\n\t\t\tboxes.css(options.useMinHeight && supportMinHeight ? 'minHeight' : 'height', maxCalcHeight);\n\t\t}\n\t}", "function distributeHeight(els,availableHeight,shouldRedistribute){// *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n// and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\nvar minOffset1=Math.floor(availableHeight/els.length);// for non-last element\nvar minOffset2=Math.floor(availableHeight-minOffset1*(els.length-1));// for last element *FLOORING NOTE*\nvar flexEls=[];// elements that are allowed to expand. array of DOM nodes\nvar flexOffsets=[];// amount of vertical space it takes up\nvar flexHeights=[];// actual css height\nvar usedHeight=0;undistributeHeight(els);// give all elements their natural height\n// find elements that are below the recommended height (expandable).\n// important to query for heights in a single first pass (to avoid reflow oscillation).\nels.each(function(i,el){var minOffset=i===els.length-1?minOffset2:minOffset1;var naturalOffset=$(el).outerHeight(true);if(naturalOffset<minOffset){flexEls.push(el);flexOffsets.push(naturalOffset);flexHeights.push($(el).height());}else{// this element stretches past recommended height (non-expandable). mark the space as occupied.\nusedHeight+=naturalOffset;}});// readjust the recommended height to only consider the height available to non-maxed-out rows.\nif(shouldRedistribute){availableHeight-=usedHeight;minOffset1=Math.floor(availableHeight/flexEls.length);minOffset2=Math.floor(availableHeight-minOffset1*(flexEls.length-1));// *FLOORING NOTE*\n}// assign heights to all expandable elements\n$(flexEls).each(function(i,el){var minOffset=i===flexEls.length-1?minOffset2:minOffset1;var naturalOffset=flexOffsets[i];var naturalHeight=flexHeights[i];var newHeight=minOffset-(naturalOffset-naturalHeight);// subtract the margin/padding\nif(naturalOffset<minOffset){// we check this again because redistribution might have changed things\n$(el).height(newHeight);}});}", "updateInnerWidthDependingOnChilds(){}", "function colWidths(rows) {\n////the underscore arg is not used\n//colWidths builds up an array with one element for every column index\n//only takes first row because every row will have the same number of columns (which is 3)\n return rows[0].map(function(_, i) {\n ////reduce rows \n return rows.reduce(function(max, row) {\n \t//by returning the higher number of min width of a row\n \treturn Math.max(max, row[i].minWidth());\n }, 0);\n });\n}", "_freezeColumnWidth() {\n this._forEachRowCell(this._containerHead, 0, (cell, columnIndex) => {\n const width = cell.width; // get current numeric width\n cell.width = width; // set width to style.width\n this._columns[columnIndex].width = cell.width; // fetch real width again and store it\n });\n }", "function forceFillColumnWidths(allColumns, expectedWidth, startIdx, allowBleed, defaultColWidth) {\n if (defaultColWidth === void 0) { defaultColWidth = 300; }\n var columnsToResize = allColumns\n .slice(startIdx + 1, allColumns.length)\n .filter(function (c) {\n return c.canAutoResize !== false;\n });\n for (var _i = 0, columnsToResize_1 = columnsToResize; _i < columnsToResize_1.length; _i++) {\n var column = columnsToResize_1[_i];\n if (!column.$$oldWidth) {\n column.$$oldWidth = column.width;\n }\n }\n var additionWidthPerColumn = 0;\n var exceedsWindow = false;\n var contentWidth = getContentWidth(allColumns, defaultColWidth);\n var remainingWidth = expectedWidth - contentWidth;\n var columnsProcessed = [];\n // This loop takes care of the\n do {\n additionWidthPerColumn = remainingWidth / columnsToResize.length;\n exceedsWindow = contentWidth >= expectedWidth;\n for (var _a = 0, columnsToResize_2 = columnsToResize; _a < columnsToResize_2.length; _a++) {\n var column = columnsToResize_2[_a];\n if (exceedsWindow && allowBleed) {\n column.width = column.$$oldWidth || column.width || defaultColWidth;\n }\n else {\n var newSize = (column.width || defaultColWidth) + additionWidthPerColumn;\n if (column.minWidth && newSize < column.minWidth) {\n column.width = column.minWidth;\n columnsProcessed.push(column);\n }\n else if (column.maxWidth && newSize > column.maxWidth) {\n column.width = column.maxWidth;\n columnsProcessed.push(column);\n }\n else {\n column.width = newSize;\n }\n }\n column.width = Math.max(0, column.width);\n }\n contentWidth = getContentWidth(allColumns);\n remainingWidth = expectedWidth - contentWidth;\n removeProcessedColumns(columnsToResize, columnsProcessed);\n } while (remainingWidth > 0 && columnsToResize.length !== 0);\n}", "function distributeHeight(els, availableHeight, shouldRedistribute) {\n\n\t\t// *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n\t\t// and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n\n\t\tvar minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n\t\tvar minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n\t\tvar flexEls = []; // elements that are allowed to expand. array of DOM nodes\n\t\tvar flexOffsets = []; // amount of vertical space it takes up\n\t\tvar flexHeights = []; // actual css height\n\t\tvar usedHeight = 0;\n\n\t\tundistributeHeight(els); // give all elements their natural height\n\n\t\t// find elements that are below the recommended height (expandable).\n\t\t// important to query for heights in a single first pass (to avoid reflow oscillation).\n\t\tels.each(function(i, el) {\n\t\t\tvar minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n\t\t\tvar naturalOffset = $(el).outerHeight(true);\n\n\t\t\tif (naturalOffset < minOffset) {\n\t\t\t\tflexEls.push(el);\n\t\t\t\tflexOffsets.push(naturalOffset);\n\t\t\t\tflexHeights.push($(el).height());\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// this element stretches past recommended height (non-expandable). mark the space as occupied.\n\t\t\t\tusedHeight += naturalOffset;\n\t\t\t}\n\t\t});\n\n\t\t// readjust the recommended height to only consider the height available to non-maxed-out rows.\n\t\tif (shouldRedistribute) {\n\t\t\tavailableHeight -= usedHeight;\n\t\t\tminOffset1 = Math.floor(availableHeight / flexEls.length);\n\t\t\tminOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n\t\t}\n\n\t\t// assign heights to all expandable elements\n\t\t$(flexEls).each(function(i, el) {\n\t\t\tvar minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n\t\t\tvar naturalOffset = flexOffsets[i];\n\t\t\tvar naturalHeight = flexHeights[i];\n\t\t\tvar newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n\n\t\t\tif (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n\t\t\t\t$(el).height(newHeight);\n\t\t\t}\n\t\t});\n\t}" ]
[ "0.7652596", "0.759597", "0.7585141", "0.75660205", "0.74210787", "0.74210787", "0.74210787", "0.74210787", "0.74210787", "0.74210787", "0.74115", "0.74115", "0.74115", "0.74115", "0.74111044", "0.7385479", "0.7257213", "0.7257213", "0.69547397", "0.5850203", "0.57952607", "0.5697006", "0.5687506", "0.56010455", "0.55276287", "0.54293925", "0.5424259", "0.5360173", "0.5351469", "0.5348472", "0.5348472", "0.5348472", "0.5348472", "0.5337898", "0.5325089", "0.5325089", "0.5325089", "0.53178513", "0.53101575", "0.53007907", "0.5293726", "0.5249041", "0.52464014", "0.5242428", "0.5228999", "0.5224981", "0.5224981", "0.5224981", "0.5224981", "0.5224981", "0.5224981", "0.5224981", "0.5224981", "0.52093077", "0.52054304", "0.5192463", "0.51908475", "0.5189694", "0.5189694", "0.5189694", "0.5189694", "0.5173641", "0.51717424", "0.51710975", "0.5169776", "0.51601785", "0.51590085", "0.51590085", "0.51590085", "0.51590085", "0.51590085", "0.51590085", "0.51590085", "0.51590085", "0.5154991", "0.51500815", "0.514397", "0.514397", "0.514397", "0.514397", "0.51433533", "0.5132613", "0.513035", "0.51263505", "0.5125763", "0.510665", "0.510665", "0.510665", "0.5064258", "0.50598603", "0.50598603", "0.50598603", "0.50598603", "0.5059162", "0.5057338", "0.5056966", "0.50371706", "0.5022177", "0.5020043" ]
0.7566943
4
Given one element that resides inside another, Subtracts the height of the inner element from the outer element.
function subtractInnerElHeight(outerEl, innerEl) { // effin' IE8/9/10/11 sometimes returns 0 for dimensions. this weird hack was the only thing that worked var reflowStyleProps = { position: 'relative', left: -1 // ensure reflow in case the el was already relative. negative is less likely to cause new scroll }; applyStyle(outerEl, reflowStyleProps); applyStyle(innerEl, reflowStyleProps); var diff = // grab the dimensions outerEl.getBoundingClientRect().height - innerEl.getBoundingClientRect().height; // undo hack var resetStyleProps = { position: '', left: '' }; applyStyle(outerEl, resetStyleProps); applyStyle(innerEl, resetStyleProps); return diff; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function subtractInnerElHeight(outerEl, innerEl) {\n\t\tvar both = outerEl.add(innerEl);\n\t\tvar diff;\n\n\t\t// effin' IE8/9/10/11 sometimes returns 0 for dimensions. this weird hack was the only thing that worked\n\t\tboth.css({\n\t\t\tposition: 'relative', // cause a reflow, which will force fresh dimension recalculation\n\t\t\tleft: -1 // ensure reflow in case the el was already relative. negative is less likely to cause new scroll\n\t\t});\n\t\tdiff = outerEl.outerHeight() - innerEl.outerHeight(); // grab the dimensions\n\t\tboth.css({ position: '', left: '' }); // undo hack\n\n\t\treturn diff;\n\t}", "function subtractInnerElHeight(outerEl, innerEl) {\n\tvar both = outerEl.add(innerEl);\n\tvar diff;\n\n\t// effin' IE8/9/10/11 sometimes returns 0 for dimensions. this weird hack was the only thing that worked\n\tboth.css({\n\t\tposition: 'relative', // cause a reflow, which will force fresh dimension recalculation\n\t\tleft: -1 // ensure reflow in case the el was already relative. negative is less likely to cause new scroll\n\t});\n\tdiff = outerEl.outerHeight() - innerEl.outerHeight(); // grab the dimensions\n\tboth.css({ position: '', left: '' }); // undo hack\n\n\treturn diff;\n}", "function subtractInnerElHeight(outerEl, innerEl) {\n\tvar both = outerEl.add(innerEl);\n\tvar diff;\n\n\t// effin' IE8/9/10/11 sometimes returns 0 for dimensions. this weird hack was the only thing that worked\n\tboth.css({\n\t\tposition: 'relative', // cause a reflow, which will force fresh dimension recalculation\n\t\tleft: -1 // ensure reflow in case the el was already relative. negative is less likely to cause new scroll\n\t});\n\tdiff = outerEl.outerHeight() - innerEl.outerHeight(); // grab the dimensions\n\tboth.css({ position: '', left: '' }); // undo hack\n\n\treturn diff;\n}", "function subtractInnerElHeight(outerEl, innerEl) {\n\tvar both = outerEl.add(innerEl);\n\tvar diff;\n\n\t// effin' IE8/9/10/11 sometimes returns 0 for dimensions. this weird hack was the only thing that worked\n\tboth.css({\n\t\tposition: 'relative', // cause a reflow, which will force fresh dimension recalculation\n\t\tleft: -1 // ensure reflow in case the el was already relative. negative is less likely to cause new scroll\n\t});\n\tdiff = outerEl.outerHeight() - innerEl.outerHeight(); // grab the dimensions\n\tboth.css({ position: '', left: '' }); // undo hack\n\n\treturn diff;\n}", "function subtractInnerElHeight(outerEl, innerEl) {\n\tvar both = outerEl.add(innerEl);\n\tvar diff;\n\n\t// effin' IE8/9/10/11 sometimes returns 0 for dimensions. this weird hack was the only thing that worked\n\tboth.css({\n\t\tposition: 'relative', // cause a reflow, which will force fresh dimension recalculation\n\t\tleft: -1 // ensure reflow in case the el was already relative. negative is less likely to cause new scroll\n\t});\n\tdiff = outerEl.outerHeight() - innerEl.outerHeight(); // grab the dimensions\n\tboth.css({ position: '', left: '' }); // undo hack\n\n\treturn diff;\n}", "function subtractInnerElHeight(outerEl, innerEl) {\n\tvar both = outerEl.add(innerEl);\n\tvar diff;\n\n\t// effin' IE8/9/10/11 sometimes returns 0 for dimensions. this weird hack was the only thing that worked\n\tboth.css({\n\t\tposition: 'relative', // cause a reflow, which will force fresh dimension recalculation\n\t\tleft: -1 // ensure reflow in case the el was already relative. negative is less likely to cause new scroll\n\t});\n\tdiff = outerEl.outerHeight() - innerEl.outerHeight(); // grab the dimensions\n\tboth.css({ position: '', left: '' }); // undo hack\n\n\treturn diff;\n}", "function subtractInnerElHeight(outerEl, innerEl) {\n\tvar both = outerEl.add(innerEl);\n\tvar diff;\n\n\t// effin' IE8/9/10/11 sometimes returns 0 for dimensions. this weird hack was the only thing that worked\n\tboth.css({\n\t\tposition: 'relative', // cause a reflow, which will force fresh dimension recalculation\n\t\tleft: -1 // ensure reflow in case the el was already relative. negative is less likely to cause new scroll\n\t});\n\tdiff = outerEl.outerHeight() - innerEl.outerHeight(); // grab the dimensions\n\tboth.css({ position: '', left: '' }); // undo hack\n\n\treturn diff;\n}", "function subtractInnerElHeight(outerEl, innerEl) {\n\tvar both = outerEl.add(innerEl);\n\tvar diff;\n\n\t// effin' IE8/9/10/11 sometimes returns 0 for dimensions. this weird hack was the only thing that worked\n\tboth.css({\n\t\tposition: 'relative', // cause a reflow, which will force fresh dimension recalculation\n\t\tleft: -1 // ensure reflow in case the el was already relative. negative is less likely to cause new scroll\n\t});\n\tdiff = outerEl.outerHeight() - innerEl.outerHeight(); // grab the dimensions\n\tboth.css({ position: '', left: '' }); // undo hack\n\n\treturn diff;\n}", "function subtractInnerElHeight(outerEl, innerEl) {\n var both = outerEl.add(innerEl);\n var diff;\n // effin' IE8/9/10/11 sometimes returns 0 for dimensions. this weird hack was the only thing that worked\n both.css({\n position: 'relative',\n left: -1 // ensure reflow in case the el was already relative. negative is less likely to cause new scroll\n });\n diff = outerEl.outerHeight() - innerEl.outerHeight(); // grab the dimensions\n both.css({ position: '', left: '' }); // undo hack\n return diff;\n}", "function subtractInnerElHeight(outerEl, innerEl) {\n var both = outerEl.add(innerEl);\n var diff;\n // effin' IE8/9/10/11 sometimes returns 0 for dimensions. this weird hack was the only thing that worked\n both.css({\n position: 'relative',\n left: -1 // ensure reflow in case the el was already relative. negative is less likely to cause new scroll\n });\n diff = outerEl.outerHeight() - innerEl.outerHeight(); // grab the dimensions\n both.css({ position: '', left: '' }); // undo hack\n return diff;\n}", "function subtractInnerElHeight(outerEl, innerEl) {\n var both = outerEl.add(innerEl);\n var diff;\n // effin' IE8/9/10/11 sometimes returns 0 for dimensions. this weird hack was the only thing that worked\n both.css({\n position: 'relative',\n left: -1 // ensure reflow in case the el was already relative. negative is less likely to cause new scroll\n });\n diff = outerEl.outerHeight() - innerEl.outerHeight(); // grab the dimensions\n both.css({ position: '', left: '' }); // undo hack\n return diff;\n}", "function subtractInnerElHeight(outerEl, innerEl) {\n var both = outerEl.add(innerEl);\n var diff;\n // effin' IE8/9/10/11 sometimes returns 0 for dimensions. this weird hack was the only thing that worked\n both.css({\n position: 'relative',\n left: -1 // ensure reflow in case the el was already relative. negative is less likely to cause new scroll\n });\n diff = outerEl.outerHeight() - innerEl.outerHeight(); // grab the dimensions\n both.css({ position: '', left: '' }); // undo hack\n return diff;\n}", "function subtractInnerElHeight(outerEl, innerEl) {\n // effin' IE8/9/10/11 sometimes returns 0 for dimensions. this weird hack was the only thing that worked\n var reflowStyleProps = {\n position: 'relative',\n left: -1 // ensure reflow in case the el was already relative. negative is less likely to cause new scroll\n };\n applyStyle$1(outerEl, reflowStyleProps);\n applyStyle$1(innerEl, reflowStyleProps);\n var diff = // grab the dimensions\n outerEl.getBoundingClientRect().height -\n innerEl.getBoundingClientRect().height;\n // undo hack\n var resetStyleProps = { position: '', left: '' };\n applyStyle$1(outerEl, resetStyleProps);\n applyStyle$1(innerEl, resetStyleProps);\n return diff;\n }", "function subtractInnerElHeight(outerEl, innerEl) {\n // effin' IE8/9/10/11 sometimes returns 0 for dimensions. this weird hack was the only thing that worked\n var reflowStyleProps = {\n position: 'relative',\n left: -1 // ensure reflow in case the el was already relative. negative is less likely to cause new scroll\n\n };\n applyStyle(outerEl, reflowStyleProps);\n applyStyle(innerEl, reflowStyleProps);\n var diff = // grab the dimensions\n outerEl.getBoundingClientRect().height - innerEl.getBoundingClientRect().height; // undo hack\n\n var resetStyleProps = {\n position: '',\n left: ''\n };\n applyStyle(outerEl, resetStyleProps);\n applyStyle(innerEl, resetStyleProps);\n return diff;\n }", "function subtractInnerElHeight(outerEl, innerEl) {\n // effin' IE8/9/10/11 sometimes returns 0 for dimensions. this weird hack was the only thing that worked\n var reflowStyleProps = {\n position: 'relative',\n left: -1 // ensure reflow in case the el was already relative. negative is less likely to cause new scroll\n };\n applyStyle(outerEl, reflowStyleProps);\n applyStyle(innerEl, reflowStyleProps);\n var diff = // grab the dimensions\n outerEl.getBoundingClientRect().height -\n innerEl.getBoundingClientRect().height;\n // undo hack\n var resetStyleProps = { position: '', left: '' };\n applyStyle(outerEl, resetStyleProps);\n applyStyle(innerEl, resetStyleProps);\n return diff;\n}", "function subtractInnerElHeight(outerEl, innerEl) {\n // effin' IE8/9/10/11 sometimes returns 0 for dimensions. this weird hack was the only thing that worked\n var reflowStyleProps = {\n position: 'relative',\n left: -1 // ensure reflow in case the el was already relative. negative is less likely to cause new scroll\n };\n applyStyle(outerEl, reflowStyleProps);\n applyStyle(innerEl, reflowStyleProps);\n var diff = outerEl.offsetHeight - innerEl.offsetHeight; // grab the dimensions\n // undo hack\n var resetStyleProps = { position: '', left: '' };\n applyStyle(outerEl, resetStyleProps);\n applyStyle(innerEl, resetStyleProps);\n return diff;\n }", "function subtractInnerElHeight(outerEl, innerEl) {\n // effin' IE8/9/10/11 sometimes returns 0 for dimensions. this weird hack was the only thing that worked\n var reflowStyleProps = {\n position: 'relative',\n left: -1 // ensure reflow in case the el was already relative. negative is less likely to cause new scroll\n\n };\n dom_manip_1.applyStyle(outerEl, reflowStyleProps);\n dom_manip_1.applyStyle(innerEl, reflowStyleProps);\n var diff = outerEl.offsetHeight - innerEl.offsetHeight; // grab the dimensions\n // undo hack\n\n var resetStyleProps = {\n position: '',\n left: ''\n };\n dom_manip_1.applyStyle(outerEl, resetStyleProps);\n dom_manip_1.applyStyle(innerEl, resetStyleProps);\n return diff;\n }", "function subtractInnerElHeight(outerEl,innerEl){var both=outerEl.add(innerEl);var diff;// effin' IE8/9/10/11 sometimes returns 0 for dimensions. this weird hack was the only thing that worked\nboth.css({position:'relative',left:-1// ensure reflow in case the el was already relative. negative is less likely to cause new scroll\n});diff=outerEl.outerHeight()-innerEl.outerHeight();// grab the dimensions\nboth.css({position:'',left:''});// undo hack\nreturn diff;}", "function oldOuterHeight(element){\r\n //return 100;\r\n return element.height();\r\n}", "function outerHeight(el) {\n var height = el.offsetHeight;\n var style = getComputedStyle(el);\n height += parseInt(style.marginTop) + parseInt(style.marginBottom);\n return height;\n }", "function innerHeight(el){\n var style = window.getComputedStyle(el, null);\n return el.clientHeight -\n parseInt(style.getPropertyValue('padding-top'), 10) -\n parseInt(style.getPropertyValue('padding-bottom'), 10);\n }", "updateInnerHeightDependingOnChilds(){}", "function Ba(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var a=e.widgets[t],n=a.node.parentNode;n&&(a.height=n.offsetHeight)}}", "function getEltClipHeight (elt) \n{\n return (getEltClipBottom(elt) - getEltClipTop(elt));\n}", "function innerHeight(el) {\n var style = window.getComputedStyle(el, null);\n // Hidden iframe in Firefox returns null, https://github.com/malte-wessel/react-textfit/pull/34\n if (!style) return el.clientHeight;\n return el.clientHeight - parseInt(style.getPropertyValue(\"padding-top\"), 10) - parseInt(style.getPropertyValue(\"padding-bottom\"), 10);\n}", "function sumInnerHeight(target) {\n var targetEl = document.querySelector(target),\n elInner = targetEl.children,\n height = 0;\n\n [].forEach.call(elInner, function (elem) {\n height += Math.max(elem.offsetHeight, parseInt(getComputedStyle(elem).lineHeight));\n });\n console.log(height);\n return height;\n}", "function calcHeight(element){\n if (element.type == elementTypes.instance) return (element.expanded) ? element.uiExpanded.height(p.nodeWidth - p.nodeDif) : element.ui.height(p.nodeWidth - p.nodeDif);\n else if (element.type == elementTypes.objProperty) return element.ui.height(p.nodeWidth-p.nodeDif) + 30;\n else if (element.type == elementTypes.paginator) return 35;\n else if (element.type == elementTypes.loader) return p.childrenLoaderSize;\n }", "getOuterHeight() {\n return this.getHeight();\n }", "getElHeight(el) {\n const h = el.offsetHeight\n const { marginTop, marginBottom } = getComputedStyle(el)\n\n return h + parseInt(marginTop, 10) + parseInt(marginBottom, 10)\n }", "function restHeight(params) {\n\tvar usedWidth = 0;\n\n\tvar outerElement = $(params.outerSelector)\n\n\t$.each(params.innerSelectorsArray, function(index, value) {\n\n\t\tusedWidth += (outerElement.find(value)).outerHeight()\n\t})\n\n\treturn (outerElement.height() - usedWidth)\n\n}", "function heightestChild(elem)\r\n{\r\n\tvar t=0;\r\n\tvar t_elem;\r\n\t$J(\"*\",elem).each(function () {\r\n\t if ( $J(this).outerHeight(true) > t ) {\r\n\t t_elem=$J(this);\r\n\t t=t_elem.outerHeight(true);\r\n\t }\r\n\t});\r\n\t// we care about the heighest\r\n\tif (elem.outerHeight(true) > t)\r\n\t{\r\n\t\tt = elem.outerHeight(true);\r\n\t}\r\n\r\n\t//return elem.outerHeight(true);\r\n\treturn t+3; // hotfix\r\n}", "function paint(element) {\n element.offsetHeight\n }", "function absolute_height_of(element) {\n var h = 0;\n h += $(element).height();\n h += parseInt($(element).css('border-top-width'), 10);\n h += parseInt($(element).css('border-bottom-width'), 10);\n h += parseInt($(element).css('padding-top'), 10);\n h += parseInt($(element).css('padding-bottom'), 10);\n h += parseInt($(element).css('margin-top'), 10);\n h += parseInt($(element).css('margin-bottom'), 10);\n return h;\n}", "function setHeightMinusElement(element, wrapper, title){\n $.each($(element), function(index, val) {\n var thisWrapper = $(this).closest(wrapper);\n var thisTitle = thisWrapper.find(title+':first');\n var thisWrapperHeight = thisWrapper.outerHeight();\n var thisTitleHeight = thisTitle.outerHeight();\n var heightForElement = getWindowHeight() - thisTitleHeight;\n $(this).height(heightForElement);\n });\n\n}", "function infsrc_local_hiddenHeight(element) {\r\r\n var height = 0;\r\r\n jQuery(element).children().each(function() {\r\r\n height = height + jQuery(this).outerHeight(false);\r\r\n });\r\r\n return height;\r\r\n}", "static calcHeight(elements, parent) {\n\t\tvar heights = [];\n\t\tfor (let i = 0; i < elements.length; i++) {\n\t\t\tvar elHeight = elements[i].offsetHeight;\n\t\t\theights\n\t\t\t\t.push(elHeight);\n\t\t}\n\t\t//- ### ### ### RETURN HIGHEST FROM ARRAY\n\t\t// Array.prototype.max = () => {\n\t\t// return Math.max.apply(null, this);\n\t\t// };\n\t\tlet max = Math.max.apply(null, heights);\n\t\tif (parent) {\n\t\t\tparent\n\t\t\t\t.style.height = max + 'px';\n\t\t}\n\t}", "function reSizeElementHeight(id_txt,offset) { document.getElementById(id_txt).style.height = inner_size()[1] - offset + \"px\"; }", "function getTotalHeight(element) {\n var margin = SizeUtils.getMarginTop(element) + SizeUtils.getMarginBottom(element);\n return element.offsetHeight + margin;\n} // Gets the left coordinate of the specified element relative to the specified parent.", "function height(/* Element */ el) {\n var computedStyle = _getComputedStyle(el);\n var height = el.clientHeight; // height with padding\n\n height -= parseFloat(computedStyle.paddingTop) + parseFloat(computedStyle.paddingBottom);\n\n return height;\n}", "function ye(e){e=de(e);for(var t=0,a=e.parent,n=0;n<a.lines.length;++n){var r=a.lines[n];if(r==e)break;t+=r.height}for(var f=a.parent;f;a=f,f=a.parent)for(var o=0;o<f.children.length;++o){var i=f.children[o];if(i==a)break;t+=i.height}return t}", "function getSizerHeight(elem) {\n let elems = elem.childNodes;\n let ht = 0;\n for (let i = 0; i < elems.length; ++i) {\n let htStr = window.getComputedStyle(elems[i], null).getPropertyValue(\"height\");\n let htStrTrunc = htStr.substr(0, htStr.length - 2);\n ht += parseFloat(htStrTrunc);\n }\n return ht;\n}", "function getHeight(element) {\n\t\treturn parseInt(element.css('height'));\n\t}", "function _revert_element(ui) {\n // make element assume previous size\n if (ui.originalSize) {\n ui.helper.height(ui.originalSize.height);\n }\n}", "function pluckHeight() {\n return $(this).outerHeight();\n}", "getHeight() {\n return this.$node.innerHeight();\n }", "function verticalMiddleGlobal(innerElement, outerElement){\n \n var elementToChange = outerElement;\n var innerElement = $(innerElement).getSize();\n var outerElement = $(outerElement).getSize();\n var deltaHeight = (innerElement.y - outerElement.y)/2;\n // alert(innerElement) \n $(elementToChange).setStyle('margin-top', deltaHeight); \n}", "function set_height(ele1, ele2) {\n ele1.css('height', '');\n ele2.css('height', '');\n if(ele1.height() > ele2.height()) {\n ele2.height(ele1.height());\n } else {\n ele1.height(ele2.height());\n }\n}", "function xHeight(e,h)\n{\n var css, pt=0, pb=0, bt=0, bb=0;\n if(!(e=xGetElementById(e))) return 0;\n if (xNum(h)) {\n if (h<0) h = 0;\n else h=Math.round(h);\n }\n else h=-1;\n css=xDef(e.style);\n if (e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') {\n h = xClientHeight();\n }\n else if(css && xDef(e.offsetHeight) && xStr(e.style.height)) {\n if(h>=0) {\n if (document.compatMode=='CSS1Compat') {\n pt=xGetComputedStyle(e,'padding-top',1);\n if (pt !== null) {\n pb=xGetComputedStyle(e,'padding-bottom',1);\n bt=xGetComputedStyle(e,'border-top-width',1);\n bb=xGetComputedStyle(e,'border-bottom-width',1);\n }\n // Should we try this as a last resort?\n // At this point getComputedStyle and currentStyle do not exist.\n else if(xDef(e.offsetHeight,e.style.height)){\n e.style.height=h+'px';\n pt=e.offsetHeight-h;\n }\n }\n h-=(pt+pb+bt+bb);\n if(isNaN(h)||h<0) return;\n else e.style.height=h+'px';\n }\n h=e.offsetHeight;\n }\n else if(css && xDef(e.style.pixelHeight)) {\n if(h>=0) e.style.pixelHeight=h;\n h=e.style.pixelHeight;\n }\n return h;\n}", "function getHeight( t, a ) {\n\n\tvar h = 0,\n\t\ti;\n\n\tt.children().each( function() {\n\n\t\ti = $( this ).outerHeight( true );\n\n\t\th = h + i;\n\n\t});\n\n\tt.attr( 'data-height', h );\n\n}", "function xHeight(e,h)\r\n{\r\n if(!(e=xGetElementById(e))) return 0;\r\n if (xNum(h)) {\r\n if (h<0) h = 0;\r\n else h=Math.round(h);\r\n }\r\n else h=-1;\r\n var css=xDef(e.style);\r\n if (e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') {\r\n h = xClientHeight();\r\n }\r\n else if(css && xDef(e.offsetHeight) && xStr(e.style.height)) {\r\n if(h>=0) {\r\n var pt=0,pb=0,bt=0,bb=0;\r\n if (document.compatMode=='CSS1Compat') {\r\n var gcs = xGetComputedStyle;\r\n pt=gcs(e,'padding-top',1);\r\n if (pt !== null) {\r\n pb=gcs(e,'padding-bottom',1);\r\n bt=gcs(e,'border-top-width',1);\r\n bb=gcs(e,'border-bottom-width',1);\r\n }\r\n // Should we try this as a last resort?\r\n // At this point getComputedStyle and currentStyle do not exist.\r\n else if(xDef(e.offsetHeight,e.style.height)){\r\n e.style.height=h+'px';\r\n pt=e.offsetHeight-h;\r\n }\r\n }\r\n h-=(pt+pb+bt+bb);\r\n if(isNaN(h)||h<0) return;\r\n else e.style.height=h+'px';\r\n }\r\n h=e.offsetHeight;\r\n }\r\n else if(css && xDef(e.style.pixelHeight)) {\r\n if(h>=0) e.style.pixelHeight=h;\r\n h=e.style.pixelHeight;\r\n }\r\n return h;\r\n}", "function xHeight(e,h)\r\n{\r\n if(!(e=xGetElementById(e))) return 0;\r\n if (xNum(h)) {\r\n if (h<0) h = 0;\r\n else h=Math.round(h);\r\n }\r\n else h=-1;\r\n var css=xDef(e.style);\r\n if (e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') {\r\n h = xClientHeight();\r\n }\r\n else if(css && xDef(e.offsetHeight) && xStr(e.style.height)) {\r\n if(h>=0) {\r\n var pt=0,pb=0,bt=0,bb=0;\r\n if (document.compatMode=='CSS1Compat') {\r\n var gcs = xGetComputedStyle;\r\n pt=gcs(e,'padding-top',1);\r\n if (pt !== null) {\r\n pb=gcs(e,'padding-bottom',1);\r\n bt=gcs(e,'border-top-width',1);\r\n bb=gcs(e,'border-bottom-width',1);\r\n }\r\n // Should we try this as a last resort?\r\n // At this point getComputedStyle and currentStyle do not exist.\r\n else if(xDef(e.offsetHeight,e.style.height)){\r\n e.style.height=h+'px';\r\n pt=e.offsetHeight-h;\r\n }\r\n }\r\n h-=(pt+pb+bt+bb);\r\n if(isNaN(h)||h<0) return;\r\n else e.style.height=h+'px';\r\n }\r\n h=e.offsetHeight;\r\n }\r\n else if(css && xDef(e.style.pixelHeight)) {\r\n if(h>=0) e.style.pixelHeight=h;\r\n h=e.style.pixelHeight;\r\n }\r\n return h;\r\n}", "function normalizeHeight () {\n var $boxes = $('.height-normalize');\n var tempHeight = 0;\n $boxes.each(function (index, element) {\n var $this = $(this);\n var height = $this.height();\n tempHeight = (height > tempHeight) ? height : tempHeight;\n });\n if (tempHeight > 0) {\n $boxes.height(tempHeight);\n }\n }", "function offsetHeigthOnStroke(elm) {\n elm.offsetHeight;\n}", "function getContentHeight(element) {\n var border = SizeUtils.getBorderTopWidth(element) + SizeUtils.getBorderBottomWidth(element);\n var padding = SizeUtils.getPaddingTop(element) + SizeUtils.getPaddingBottom(element);\n return element.offsetHeight - border - padding;\n} // Adapted from WinJS", "function getBoundingClientRect(element) {\n var el, parent, top;\n if (element.getBoundingClientRect != null) {\n return element.getBoundingClientRect();\n }\n top = 0;\n el = element;\n while (el) {\n top += el.offsetTop;\n el = el.offsetParent;\n }\n parent = element.parentElement;\n while (parent) {\n if (parent.scrollTop != null) {\n top -= parent.scrollTop;\n }\n parent = parent.parentElement;\n }\n return {\n top: top,\n bottom: top + element.offsetHeight\n };\n }", "get height() {\n return Math.max(this.leftSubtreeHeight, this.rightSubtreeHeight);\n }", "subtract(x, y) {\n if (arguments.length === 1 && x.hasAncestor && x.hasAncestor(HPoint)) {\n return new HPoint(this.x - x.x, this.y - x.y);\n }\n else if (arguments.length === 1 && x instanceof Array && x.length === 2) {\n return new HPoint(this.x - x[0], this.y - x[1]);\n }\n else if (arguments.length === 2) {\n return new HPoint(this.x - x, this.y - y);\n }\n else {\n throw new Error('HPoint#subtract: Invalid arguments.');\n }\n }", "function setHeight(elem1, elem2) {\r\n var height = elem2.height()\r\n elem1.css('height', height);\r\n}", "get height() {\n return this.bottom - this.top;\n }", "function elHeight(el){\r\n\t\t\tvar elImg = el.find('img');\r\n\t\t\tif(o.vertical){\r\n\t\t \treturn parseInt(el.css('margin-left')) + parseInt(el.css('margin-right')) + parseInt(elImg.width()) + parseInt(el.css('border-left-width')) + parseInt(el.css('border-right-width')) + parseInt(el.css('padding-right')) + parseInt(el.css('padding-left'));\r\n\t\t\t}\t\r\n\t\t\telse{\r\n\t\t\t\treturn parseInt(el.css('margin-top')) + parseInt(el.css('margin-bottom')) + parseInt(elImg.width()) + parseInt(el.css('border-top-height')) + parseInt(el.css('border-bottom-height')) + parseInt(el.css('padding-top')) + parseInt(el.css('padding-bottom'));\r\n\t\t\t}\r\n\t\t}", "function getElementHeightAboveTop(elem)\n\t\t\t\t{\n\t\t\t\t\tvar docViewTop = $(window).scrollTop();\n\t\t\t\t\tvar elemTop = $(elem).offset().top;\n\t\t\t\t\treturn (docViewTop - elemTop);\n\t\t\t\t}", "height() {\n return this.heightHelper(this.root, 0)\n }", "get Height() { return this.y2 - this.y1; }", "get Height() { return this.y2 - this.y1; }", "function innerDimensions (element) {\n var style = element.ownerDocument.defaultView.getComputedStyle(element);\n return {\n width: parseFloat(style.width) - parseFloat(style.paddingLeft) - parseFloat(style.paddingRight),\n height: parseFloat(style.height) - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom)\n };\n }", "function getCssHeight(childSelector) {\n return 100 * $(childSelector).height() / $(childSelector).offsetParent().height();\n}", "function calcH(divVal){\n var heyt = $(this).height()-365;\n $(divVal).height(heyt+\"px\");\n}", "static _getContentHeight(element) {\n if (!element) return 0;\n const styles = window.getComputedStyle(element);\n const margin = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);\n return Math.ceil(element.offsetHeight + margin);\n }", "function articleHeight() {\n return document.getElementById(\"article\").offsetHeight + 2 * parseFloat(getComputedStyle(document.getElementById(\"article\")).marginTop)\n}", "function animateParentHeight (elements, direction, totalDuration, stagger) {\n var totalHeightDelta = 0,\n parentNode;\n\n /* Sum the total height (including padding and margin) of all targeted elements. */\n $.each(elements.nodeType ? [ elements ] : elements, function(i, element) {\n if (stagger) {\n /* Increase the totalDuration by the successive delay amounts produced by the stagger option. */\n totalDuration += i * stagger;\n }\n\n parentNode = element.parentNode;\n\n $.each([ \"height\", \"paddingTop\", \"paddingBottom\", \"marginTop\", \"marginBottom\"], function(i, property) {\n totalHeightDelta += parseFloat(Velocity.CSS.getPropertyValue(element, property));\n });\n });\n\n /* Animate the parent element's height adjustment (with a varying duration multiplier for aesthetic benefits). */\n Velocity.animate(\n parentNode,\n { height: (direction === \"In\" ? \"+\" : \"-\") + \"=\" + totalHeightDelta },\n { queue: false, easing: \"ease-in-out\", duration: totalDuration * (direction === \"In\" ? 0.6 : 1) }\n );\n }", "function animateParentHeight (elements, direction, totalDuration, stagger) {\n var totalHeightDelta = 0,\n parentNode;\n\n /* Sum the total height (including padding and margin) of all targeted elements. */\n $.each(elements.nodeType ? [ elements ] : elements, function(i, element) {\n if (stagger) {\n /* Increase the totalDuration by the successive delay amounts produced by the stagger option. */\n totalDuration += i * stagger;\n }\n\n parentNode = element.parentNode;\n\n $.each([ \"height\", \"paddingTop\", \"paddingBottom\", \"marginTop\", \"marginBottom\"], function(i, property) {\n totalHeightDelta += parseFloat(Velocity.CSS.getPropertyValue(element, property));\n });\n });\n\n /* Animate the parent element's height adjustment (with a varying duration multiplier for aesthetic benefits). */\n Velocity.animate(\n parentNode,\n { height: (direction === \"In\" ? \"+\" : \"-\") + \"=\" + totalHeightDelta },\n { queue: false, easing: \"ease-in-out\", duration: totalDuration * (direction === \"In\" ? 0.6 : 1) }\n );\n }", "function animateParentHeight (elements, direction, totalDuration, stagger) {\n var totalHeightDelta = 0,\n parentNode;\n\n /* Sum the total height (including padding and margin) of all targeted elements. */\n $.each(elements.nodeType ? [ elements ] : elements, function(i, element) {\n if (stagger) {\n /* Increase the totalDuration by the successive delay amounts produced by the stagger option. */\n totalDuration += i * stagger;\n }\n\n parentNode = element.parentNode;\n\n $.each([ \"height\", \"paddingTop\", \"paddingBottom\", \"marginTop\", \"marginBottom\"], function(i, property) {\n totalHeightDelta += parseFloat(Velocity.CSS.getPropertyValue(element, property));\n });\n });\n\n /* Animate the parent element's height adjustment (with a varying duration multiplier for aesthetic benefits). */\n Velocity.animate(\n parentNode,\n { height: (direction === \"In\" ? \"+\" : \"-\") + \"=\" + totalHeightDelta },\n { queue: false, easing: \"ease-in-out\", duration: totalDuration * (direction === \"In\" ? 0.6 : 1) }\n );\n }", "function getEltHeight(elt) {\n if (is.nav4) {\n if (elt.document.height)\n return elt.document.height;\n else\n return elt.clip.bottom - elt.clip.top;\n }\n if (is.ie4up) {\n if (elt.style.pixelHeight)\n return elt.style.pixelHeight;\n else\n return elt.clientHeight;\n }\n if (is.gecko) {\n if (elt.style.height)\n return stringToNumber(elt.style.height);\n else\n return stringToNumber(elt.offsetHeight);\n }\n return -1;\n}", "height() {\n return this.heightVisitor(this.root)\n }", "function _get_offset_from_elements_bottom($element) {\n var element_height = $element.outerHeight(true),\n element_offset = $element.offset().top;\n\n return (element_height + element_offset);\n }", "function js_getBottom(obj_element)\n\t\t{\n\t\tif (obj_element.offsetHeight)\n\t\t\treturn obj_element.offsetHeight + js_getTop(obj_element);\n\t\telse\n\t\t\treturn 20 + js_getTop(obj_element);\n\t\t}", "function animateParentHeight (elements, direction, totalDuration, stagger) {\n var totalHeightDelta = 0,\n parentNode;\n\n /* Sum the total height (including padding and margin) of all targeted elements. */\n $.each(elements.nodeType ? [ elements ] : elements, function(i, element) {\n if (stagger) {\n /* Increase the totalDuration by the successive delay amounts produced by the stagger option. */\n totalDuration += i * stagger;\n }\n\n parentNode = element.parentNode;\n\n $.each([ \"height\", \"paddingTop\", \"paddingBottom\", \"marginTop\", \"marginBottom\"], function(i, property) {\n totalHeightDelta += parseFloat(Velocity.CSS.getPropertyValue(element, property));\n });\n });\n\n /* Animate the parent element's height adjustment (with a varying duration multiplier for aesthetic benefits). */\n Velocity.animate(\n parentNode,\n { height: (direction === \"In\" ? \"+\" : \"-\") + \"=\" + totalHeightDelta },\n { queue: false, easing: \"ease-in-out\", duration: totalDuration * (direction === \"In\" ? 0.6 : 1) }\n );\n }", "function swap(el1, el2) {\r\n \r\n let temp = el1.style.height;\r\n el1.style.height = el2.style.height;\r\n el2.style.height = temp;\r\n \r\n}", "function updateInnerWrapperHeight(){var maxHeight=autoHeight?getMaxSlideHeight(index,items):getMaxSlideHeight(cloneCount,slideCount);if(innerWrapper.style.height!==maxHeight){innerWrapper.style.height=maxHeight+'px';}}// get the distance from the top edge of the first slide to each slide", "function objH(o, h) {\r\n if (h != null) {\r\n if (h > -1 && ! ie && o.offsetHeight > -1 && objCss(o, 'height') != null) {\r\n // Gecko-based browsers will report o's offsetHeight as being smaller\r\n // than its rendering height because they do not include borders and\r\n // padding in offsetHeight. Add the difference between o's reported\r\n // offsetHeight and its current CSS height to the supplied height h.\r\n h += parseInt(objCss(o, 'height')) - o.offsetHeight;\r\n }\r\n\r\n o.style.height = h > -1 ? h : o.offsetHeight;\r\n }\r\n return o.offsetHeight;\r\n}", "updateElementsHeight() {\n const me = this;\n // prevent unnecessary style updates\n if (me.lastHeight !== me.height) {\n const elements = me._elementsArray;\n\n for (let i = 0; i < elements.length; i++) {\n elements[i].style.height = `${me.offsetHeight}px`;\n }\n me.lastHeight = me.height;\n }\n }", "get height(): number {\n return this._height(this.root);\n }", "height() {\n return this.root ? this.root.height() : 0;\n }", "function O(e,t){var a=t-e.height;if(a)for(var n=e;n;n=n.parent)n.height+=a}", "function measureHeight(element){\n // check to see if the object is displayed\n if (element.attr('display') != 'none') {\n // measure element height\n var intHeight = cssPixelsToInt(element.css('height'));\n // measure top and bottom margins\n intHeight += cssPixelsToInt(element.css('margin-top'));\n intHeight += cssPixelsToInt(element.css('margin-bottom'));\n return intHeight;\n } else {\n // element not displayed\n return 0;\n }\n }", "function equalizeHeight()\n{\n\tvar boxHeight = 0;\n\n\t$(\".eq-height\").removeAttr(\"style\");\n\n\t$(\".row\").each(function(){\n\n\t\t$(this).find(\".eq-height\").each(function(){\n\t\t\tvar currentBoxHeight = $(this).innerHeight();\n\t\t\tif(currentBoxHeight > boxHeight) boxHeight = currentBoxHeight;\n\t\t});\n\n\t\t$(this).find(\".eq-height\").css({\"height\":boxHeight-51+\"px\"});\n\t\t$(\".container\").css({\"height\":boxHeight+\"px\"});\n\n\t});\n}", "function getHeight(root) {}", "function addItemHeight(element) {\n\t\t//get key dimensions to calculate height\n\t\tlet dimensions = [\n\t\t\tparseInt(window.getComputedStyle(element, null).getPropertyValue('margin-top')),\n\t\t\tparseInt(window.getComputedStyle(element, null).getPropertyValue('margin-bottom')),\n\t\t\tparseInt(window.getComputedStyle(element, null).getPropertyValue('padding-top')),\n\t\t\tparseInt(window.getComputedStyle(element, null).getPropertyValue('padding-bottom')),\n\t\t\tparseInt(window.getComputedStyle(element, null).getPropertyValue('height'))\n\t\t];\n\t\titemHeight += arraySum(dimensions);\n\t}", "function getTreeHeight(){\r\n\t\tvar res = 0;\r\n\t\tvar addingHeight = 1;\r\n\t\tif(this.name == \"\")\r\n\t\t\taddingHeight = 0;\r\n\t\t\r\n\t\tif(this.expanded){\r\n\t\t\tfor(var i = 0; i < this.childCount; i++){\r\n\t\t\t\tvar tmp = this.child[i].getHeight();\r\n\t\t\t\tif(tmp > res)\r\n\t\t\t\t\tres = tmp\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res + addingHeight;\r\n\t\t\r\n\t}", "function Browser_GetOffsetHeight(html)\n{\n\t//get the value directly\n\tvar result = html.offsetHeight;\n\t//this an HTML or BODY?\n\tif (result == 0 && /^html$|^body$/i.test(html.tagName))\n\t{\n\t\t//get its iframe\n\t\thtml = Get_FrameElement(html);\n\t\t//try again\n\t\tresult = html.offsetHeight;\n\t}\n\t//invalid?\n\tif (result == 0 && Common_HTMLCanBeRemoved(html))\n\t{\n\t\t//remember original parent\n\t\tvar parent = false;\n\t\tvar sibling = false;\n\t\t//check parent\n\t\tif (Browser_IsValidParent(html))\n\t\t{\n\t\t\t//memorise next sibling\n\t\t\tsibling = html.nextSibling;\n\t\t\t//memorise parent\n\t\t\tparent = html.parentNode;\n\t\t\t//remove from parent\n\t\t\tparent.removeChild(html);\n\t\t}\n\t\t//now add to body\n\t\tdocument.body.appendChild(html);\n\t\t//get the value again\n\t\tresult = html.offsetHeight;\n\t\t//remove from body\n\t\tdocument.body.removeChild(html);\n\t\t//has original parent?\n\t\tif (parent)\n\t\t{\n\t\t\t//has sibling?\n\t\t\tif (sibling)\n\t\t\t{\n\t\t\t\t//add just before this one\n\t\t\t\tparent.insertBefore(html, sibling);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//add it back\n\t\t\t\tparent.appendChild(html);\n\t\t\t}\n\t\t}\n\t}\n\t//return it\n\treturn result;\n}", "function setSameElementHeight(e) {\n\tvar tallest = 0;\n\t$(e).each(function() {\n\t\t$(this).css('height','auto'); // reset height in case an empty div has been populated\n\t\tif ($(this).height() > tallest) {\n\t\t\ttallest = $(this).height();\n\t\t}\n\t});\n\t$(e).height(tallest);\n}", "function heightsizeeneuf($obj){\n \tvar height = $obj.parent().width() / 1.77;\n\n \t$obj.height(height);\n }", "function bf_SizeContainerToInnerImg(imgElement, add) {\r\n\t/* Erst muss das Bild vollstaendig geladen sein, sonst kann seine Breite nicht bestimmt werden - daher einen Event-Handler an das \r\n\t load-Ereignis binden. */\r\n\timgElement.load(function() {\r\n\t\t// Die Breite des Elternelements dauerhaft an die Breite des Bildes binden.\r\n\t\tbindElementWidth(imgElement.parent(), imgElement, add);\r\n\t});\r\n}", "function getAbsoluteHeight(element) {\n\n var height = 0;\n\n if (element) {\n var absoluteChildren = 0;\n\n toArray(element.childNodes).forEach(function (child) {\n\n if (typeof child.offsetTop === 'number' && child.style) {\n // Count # of abs children\n if (child.style.position === 'absolute') {\n absoluteChildren += 1;\n }\n\n height = Math.max(height, child.offsetTop + child.offsetHeight);\n }\n\n });\n\n // If there are no absolute children, use offsetHeight\n if (absoluteChildren === 0) {\n height = element.offsetHeight;\n }\n\n }\n\n return height;\n\n }", "function offsetTop(elem) {\n var offset = 0 ;\n var siblings = elem.previousElementSibling;\n\n while(siblings !== null) {\n offset += siblings.clientHeight;\n siblings = siblings.previousElementSibling;\n }\n return offset;\n }", "function getElemHeight(elem) {\n return Math.max(elem.scrollHeight, elem.offsetHeight, elem.clientHeight);\n }", "function undistributeHeight(els){els.height('');}", "function reflowSMHeight(){\n let $parent = $('.selectedManga .main-container')\n let heightTaken = $parent.children('.header-wrapper').height()\n \n $parent.find('.desc-wrapper, .cl-wrapper')\n .height($parent.height() - heightTaken)\n }", "updateHeight_() {\n const estScrollHeight = this.items.length > 0 ?\n this.items.length * this.domItemAverageHeight_() :\n 0;\n this.$.container.style.height = estScrollHeight + 'px';\n }", "function Browser_InnerHeight()\n{\n\t//use the body\n\treturn document.body.offsetHeight;\n}" ]
[ "0.79460895", "0.7903913", "0.7903913", "0.7903913", "0.7903913", "0.7903913", "0.7903913", "0.7903913", "0.78986686", "0.78986686", "0.78986686", "0.78986686", "0.776178", "0.7750443", "0.7718971", "0.7678886", "0.7668906", "0.75993633", "0.6871529", "0.6586655", "0.63690597", "0.63195074", "0.5986449", "0.59837556", "0.5877682", "0.5832881", "0.5828999", "0.5777787", "0.5759867", "0.57294226", "0.5725949", "0.57088155", "0.56470966", "0.5632072", "0.5597207", "0.5589061", "0.558145", "0.55631894", "0.55541396", "0.55157065", "0.5508987", "0.55008763", "0.54634404", "0.54561013", "0.54394335", "0.54347134", "0.542617", "0.538951", "0.5388914", "0.53803116", "0.53803116", "0.53468007", "0.53095675", "0.5300457", "0.5298845", "0.5298288", "0.5295332", "0.52901775", "0.5283002", "0.52723086", "0.527166", "0.5263413", "0.52468103", "0.52468103", "0.5225436", "0.5217778", "0.5194266", "0.5184643", "0.5178074", "0.5162309", "0.5162309", "0.5162309", "0.51573795", "0.5157302", "0.51558995", "0.51379937", "0.5135885", "0.5119305", "0.50933695", "0.50624925", "0.50606495", "0.50578135", "0.50562125", "0.5040419", "0.50215477", "0.50209993", "0.50187737", "0.5008097", "0.49959296", "0.49830177", "0.4965224", "0.49507508", "0.4939947", "0.49342924", "0.49303785", "0.4928356", "0.492522", "0.49180457", "0.4909022", "0.49071482" ]
0.77671176
12
Object Ordering by Field
function parseFieldSpecs(input) { var specs = []; var tokens = []; var i; var token; if (typeof input === 'string') { tokens = input.split(/\s*,\s*/); } else if (typeof input === 'function') { tokens = [input]; } else if (Array.isArray(input)) { tokens = input; } for (i = 0; i < tokens.length; i++) { token = tokens[i]; if (typeof token === 'string') { specs.push(token.charAt(0) === '-' ? { field: token.substring(1), order: -1 } : { field: token, order: 1 }); } else if (typeof token === 'function') { specs.push({ func: token }); } } return specs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "genSortAscendingByField(field) {\n return (a, b) => {\n const valA = a[field].toUpperCase()\n const valB = b[field].toUpperCase()\n let order = 0\n if (valA < valB) order = -1\n if (valA > valB) order = 1\n return order\n }\n }", "genSortDescendingByField(field) {\n return (a, b) => {\n const valA = a[field].toUpperCase()\n const valB = b[field].toUpperCase()\n let order = 0\n if (valA < valB) order = 1\n if (valA > valB) order = -1\n return order\n }\n }", "get sortingOrder() {}", "function sortBy(field, reverse, primer) {\r\n reverse = (reverse) ? -1 : 1;\r\n return function(a,b) {\r\n a = a[field];\r\n b = b[field];\r\n if (typeof(primer) != 'undefined'){\r\n a = primer(a);\r\n b = primer(b);\r\n }\r\n if (a<b) return reverse * -1;\r\n if (a>b) return reverse * 1;\r\n return 0;\r\n }\r\n}", "function sortData(field, direction) {\n if (!$scope.allData) {\n return;\n }\n $scope.allData.sort(function(a, b) {\n if (direction === 'asc') {\n return a[field] > b[field] ? 1 : -1;\n } else {\n return a[field] > b[field] ? -1 : 1;\n }\n })\n }", "function objectSort(a, b) {\r\n return a.age - b.age;\r\n}", "function sortObject(data, orderby, order) { \n return _.sortBy(data, function(item) {\n if(order == 'desc') {\n return (!isNaN(item[orderby])) ? -item.reviews : false;\n } else {\n return (!isNaN(item[orderby])) ? +item.reviews : false;\n }\n });\n }", "getOrderBy() {}", "order (field, dir, ...values) {\n field = this._sanitizeField(field);\n\n if (!(typeof dir === 'string')) {\n if (dir === undefined) {\n dir = 'ASC' // Default to asc\n } else if (dir !== null) {\n dir = dir ? 'ASC' : 'DESC'; // Convert truthy to asc\n }\n }\n\n this._orders.push({\n field: field,\n dir: dir,\n values: values || [],\n nullsLast: null,\n });\n }", "static DEFAULT_SORT_BY_FIELD(){ return \"description\"}", "sortFunctionAsc(field) {\n const compare = (a, b) => {\n var aField = a[field]\n var bField = b[field]\n if (typeof a[field] === 'string') {\n aField = a[field].toLowerCase()\n }\n if (typeof b[field] === 'string') {\n bField = b[field].toLowerCase()\n }\n\n if (aField < bField) { return -1 }\n if (aField > bField) { return 1 }\n return 0\n }\n return compare\n }", "asc(field) {\r\n\t\treturn this.push('asc', [...arguments]);\r\n\t}", "sortBy(field) {\n var sortedItems = this.props.itemsFromParent.sort( (a, b) => {\n if(field === \"price\") {\n if (a.item.price > b.item.price) {\n return 1;\n }\n if (a.item.price < b.item.price) {\n return -1;\n }\n return 0;\n }\n if(field === \"title\") {\n if (a.item.title > b.item.title) {\n return 1;\n }\n if (a.item.title < b.item.title) {\n return -1;\n }\n return 0;\n }\n if(field === \"location\") {\n if (a.dist > b.dist) {\n return 1;\n }\n if (a.dist < b.dist) {\n return -1;\n }\n return 0;\n }\n });\n this.updateData(sortedItems);\n }", "sort () {\r\n this._data.sort((a, b) => a.sortOrder !== b.sortOrder ? b.sortOrder - a.sortOrder : a.value.localeCompare(b.value))\r\n }", "sortData(field, order) {\n const arr = [...this.data];\n const columnToSort = this.headerConfig.find(item => item.id === field);\n const directions = {asc: 1, desc: -1};\n\n return arr.sort((a, b) => {\n\n const res = columnToSort.sortType === 'string' \n ? a[field].localeCompare(b[field], ['ru', 'en']) \n : (a[field] - b[field]);\n \n return directions[order] * res;\n\n });\n\n }", "orderBy(fieldPath) {\n this.sort = { fieldPath, desc: false };\n return this;\n }", "set sortingOrder(value) {}", "sortByField(field){\n const { sortColumns, sortBy, columnDefinitions } = this.props;\n const [{ column = null, direction = \"desc\" } = {}] = sortColumns || [];\n\n const trimmedColumn = HeadersRow.getTrimmedColumn(column);\n const isActive = column === field || (trimmedColumn && trimmedColumn === field);\n\n let initialSort = null;\n if (columnDefinitions) {\n const { allSortFields, allSortFieldsMap } = this.memoized.flattenColumnsDefinitionsSortFields(columnDefinitions);\n const { [field]: def } = allSortFieldsMap || {};\n if (def) {\n initialSort = def.initial_sort || HeadersRow.getSortDirectionBySchemaFieldType(def.type) || null;\n }\n }\n\n let sortDirection;\n if (!isActive && initialSort) {\n sortDirection = initialSort;\n } else {\n const beDescending = !isActive || (isActive && direction !== \"desc\");\n sortDirection = beDescending ? \"desc\" : \"asc\";\n }\n\n this.setState({ \"loadingField\": field, \"showingSortFieldsForColumn\": null }, function () {\n sortBy([{ column: field, direction: sortDirection }]);\n });\n }", "function sort_objects_by_attr(objs, attr) {\n sorted_objs = objs.sort(function(a, b) {\n if (a[attr] == b[attr]) { return 0; }\n if (a[attr] > b[attr]) { return 1; }\n else { return -1; }\n });\n return sorted_objs;\n}", "comparator() {\n return (doc1, doc2) => {\n // Add implicit sorting by name, using the last specified direction.\n let lastDirection =\n this._fieldOrders.length === 0\n ? directionOperators.ASC\n : this._fieldOrders[this._fieldOrders.length - 1].direction;\n let orderBys = this._fieldOrders.concat(\n new FieldOrder(FieldPath._DOCUMENT_ID, lastDirection)\n );\n\n for (let orderBy of orderBys) {\n let comp;\n if (FieldPath._DOCUMENT_ID.isEqual(orderBy.field)) {\n comp = doc1.ref._referencePath.compareTo(doc2.ref._referencePath);\n } else {\n const v1 = doc1.protoField(orderBy.field);\n const v2 = doc2.protoField(orderBy.field);\n if (!is.defined(v1) || !is.defined(v2)) {\n throw new Error(\n 'Trying to compare documents on fields that ' +\n \"don't exist. Please include the fields you are ordering on \" +\n 'in your select() call.'\n );\n }\n comp = order.compare(v1, v2);\n }\n\n if (comp !== 0) {\n const direction =\n orderBy.direction === directionOperators.ASC ? 1 : -1;\n return direction * comp;\n }\n }\n\n return 0;\n };\n }", "function sortByOrder(a, b)\n{\n return (a.order - b.order);\n}", "function sortRenderOrder() {\n \n var sortBy = function(field, reverse, primer){\n var key = primer ? function(x) {return primer(x[field])} : function(x) {return x[field]};\n reverse = [-1, 1][+!!reverse];\n return function (a, b) {\n\treturn a = key(a), b = key(b), reverse * ((a > b) - (b > a));\n } \n }\n \n gadgetRenderOrder.sort(sortBy(\"tabPos\", true, parseInt));\n gadgetRenderOrder.sort(sortBy(\"paneId\", true, parseInt));\n gadgetRenderOrder.sort(sortBy(\"parentColumnId\", true, parseInt));\n }", "applyOrderFromRequest(fields = [], functions = {}) {\r\n if (Request.has('sort') && Request.get('sort') !== '') {\r\n const orderBy = Request.get('sort').split(',');\r\n orderBy.forEach(field => {\r\n let direction = 'ASC';\r\n if (field.charAt(0) === '-') {\r\n direction = 'DESC';\r\n field = field.slice(1);\r\n }\r\n if (field.charAt(0) === '+') {\r\n field = field.slice(1);\r\n }\r\n if (fields.length === 0 || (fields.length > 0 && _.includes(fields, field))) {\r\n // custom functions to be given aligned with field name\r\n if (typeof functions[field] !== 'undefined') {\r\n functions[field](direction);\r\n } else {\r\n this.orderBy(field, direction);\r\n }\r\n }\r\n });\r\n }\r\n return this;\r\n }", "function makeSort(field, options) {\n\t\toptions = options || {};\n\n\n\t\t// helpers\n\t\tfunction reverse(arg) {\n\t\t\treturn -arg;\n\t\t}\n\t\tfunction compose(invoking, argF) {\n\t\t\treturn function() {\n\t\t\t\treturn invoking.call(this, argF.apply(this, arguments));\n\t\t\t};\n\t\t}\n\n\t\tvar sorter = function(modelA, modelB) {\n\t\t\tvar valueA = modelA.get(field),\n\t\t\t\tvalueB = modelB.get(field);\n\t\t\tif (!valueA || !valueB) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tif (isNaN(valueA)) {\n\t\t\t\tvalueA = valueA.toLowerCase();\n\t\t\t\tvalueB = valueB.toLowerCase();\n\t\t\t}\n\t\t\tif (options.toInt) {\n\t\t\t\tvalueA = parseInt(valueA, 10);\n\t\t\t\tvalueB = parseInt(valueB, 10);\n\t\t\t}\n\t\t\tif (valueA > valueB) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif (valueB > valueA) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\treturn 0;\n\t\t};\n\t\tif (options.reverse) {\n\t\t\tsorter = compose(reverse, sorter);\n\t\t}\n\t\t// reverse because we render by prepend not append\n\t\treturn compose(reverse, sorter);\n\t}", "function sortFieldsByIndex(userFields, index) {\n var indexFields = index.def.fields.map(__WEBPACK_IMPORTED_MODULE_2_pouchdb_selector_core__[\"d\" /* getKey */]);\n\n return userFields.slice().sort(function (a, b) {\n var aIdx = indexFields.indexOf(a);\n var bIdx = indexFields.indexOf(b);\n if (aIdx === -1) {\n aIdx = Number.MAX_VALUE;\n }\n if (bIdx === -1) {\n bIdx = Number.MAX_VALUE;\n }\n return Object(__WEBPACK_IMPORTED_MODULE_2_pouchdb_selector_core__[\"a\" /* compare */])(aIdx, bIdx);\n });\n}", "function byField(field) {\n return function (a, b) {\n return a[field] > b[field] ? 1 : -1;\n }\n}", "_dynamicSort(property) {\n let sortOrder = 1;\n\n if (property[0] === \"-\") {\n sortOrder = -1;\n property = property.substr(1);\n }\n return function (a,b) {\n let result = (a['attributes'][property] < b['attributes'][property]) ? -1 :\n (a['attributes'][property] > b['attributes'][property]) ? 1 : 0;\n return result * sortOrder;\n };\n }", "function sortDataWithFieldName(fieldName) {\n if (state.sortField !== fieldName) {\n state.sortField = fieldName;\n } else {\n state.sortReverse = !state.sortReverse;\n }\n\n setActiveSortClass(fieldName, state.sortReverse);\n\n state.data.sort(basicSort(state.sortField, state.sortReverse));\n}", "function sortListByOrder(a, b) {\n if (a.acf.order < b.acf.order) {\n return -1;\n } else {\n return 1;\n }\n}", "sort(key: string, descending: boolean) {\n // Sorting data in store using in the given field\n this.crudStore.setData(this.crudStore.getData().sort(\n (a, b) => this._eq(a[key], b[key], descending)\n ));\n }", "function resetAscending(field)\n {\n date_ascending = false;\n location_ascending = false;\n artifact_ascending = false;\n description_ascending = false;\n gps_ascending = false;\n if (field == 'date')\n {\n date_ascending = true;\n }\n if (field == 'location')\n {\n location_ascending = true;\n }\n if (field == 'artifact')\n {\n artifact_ascending = true;\n }\n if (field == 'description')\n {\n description_ascending = true;\n }\n if (field == 'gps')\n {\n gps_ascending = true;\n }\n }", "function orderObject(obj, index, cardinality){\r\n\tcardinality = cardinality || 'ASC';\r\n\tcallback = callback || function(){};\r\n\tvar ind = Array();\r\n\tvar elements = Object();\r\n\tvar result = Array();\r\n\t$.each( obj, function( key, element ) {\r\n\t\telements[element[index]] = key;\r\n\t\tind.push(element[index]);\r\n\t});\r\n\tind.sort();\r\n\tif (cardinality == 'ASC'){\r\n\t\t$.each( ind, function( key, element ) {\r\n\t\t\tresult.push(elements[element]);\r\n\t\t});\r\n\t\treturn result;\r\n\t}else if (cardinality == 'DESC'){\r\n\t\tind.reverse();\r\n\t\t$.each( ind, function( key, element ) {\r\n\t\t\tresult.push(elements[element]);\r\n\t\t});\r\n\t\treturn result;\r\n\t}\r\n}", "function sortPropFields(fields){\n var reqFields = [];\n var optFields = [];\n\n /** Compare by schema property 'lookup' meta-property, if available. */\n function sortSchemaLookupFunc(a,b){\n var aLookup = (a.props.schema && a.props.schema.lookup) || 750,\n bLookup = (b.props.schema && b.props.schema.lookup) || 750,\n res;\n\n if (typeof aLookup === 'number' && typeof bLookup === 'number') {\n //if (a.props.field === 'ch02_power_output' || b.props.field === 'ch02_power_output') console.log('X', aLookup - bLookup, a.props.field, b.props.field);\n res = aLookup - bLookup;\n }\n\n if (res !== 0) return res;\n else {\n return sortTitle(a,b);\n }\n }\n\n /** Compare by property title, alphabetically. */\n function sortTitle(a,b){\n if (typeof a.props.field === 'string' && typeof b.props.field === 'string'){\n if(a.props.field.toLowerCase() < b.props.field.toLowerCase()) return -1;\n if(a.props.field.toLowerCase() > b.props.field.toLowerCase()) return 1;\n }\n return 0;\n }\n\n _.forEach(fields, function(field){\n if (!field) return;\n if (field.props.required) {\n reqFields.push(field);\n } else {\n optFields.push(field);\n }\n });\n\n reqFields.sort(sortSchemaLookupFunc);\n optFields.sort(sortSchemaLookupFunc);\n\n return reqFields.concat(optFields);\n}", "function byOrder(a,b) {\n if (a.order < b.order) return -1;\n if (a.order > b.order) return 1;\n return 0;\n }", "function order(u) {\n u.sort(function(a,b){\n return a.name < b.name ? -1 : a.name > b.name ? 1 : 0 \n })\n return u\n}", "sort (sort = {}) {\n let obj = Helpers.is(sort, 'Object') ? sort : { default: sort };\n Object.keys(obj).forEach((key, idx) => {\n Array.prototype.sort.call(this, (a, b) => {\n let vals = (Helpers.is(a.value, 'Object') && Helpers.is(b.value, 'Object')) ? Helpers.dotNotation(key, [a.value, b.value]) : [a, b];\n return (vals[0] < vals[1]) ? -1 : ((vals[0] > vals[1]) ? 1 : 0);\n })[obj[key] === -1 ? 'reverse' : 'valueOf']().forEach((val, idx2) => {\n return this[idx2] = val;\n });\n });\n return this;\n }", "sortBy(field, reverse, primer) \n {\n const key = primer\n ? function(x) {\n return primer(x[field]);\n }\n : function(x) {\n return x[field];\n };\n\n return function(a, b) {\n a = key(a);\n b = key(b);\n return reverse * ((a > b) - (b > a));\n };\n }", "orderByID() {\n this.sort = { fieldPath: '_id', desc: false };\n return this;\n }", "function sortFieldList() {\n\tvar mylist = $('#editorFieldList');\n\tvar listitems = mylist.children('.formItem').get();\n\tlistitems.sort(function(a, b) {\n\t\tvar labelA = $(a).find('label').html().toLowerCase();\n\t\tvar labelB = $(b).find('label').html().toLowerCase();\n\t\treturn labelA.localeCompare(labelB);\n\t});\n\t$.each(listitems, function(idx, itm) {\n\t\tmylist.append(itm);\n\t});\n}", "function sortFieldsByIndex(userFields, index) {\n\t var indexFields = index.def.fields.map(getKey$1);\n\n\t return userFields.slice().sort(function (a, b) {\n\t var aIdx = indexFields.indexOf(a);\n\t var bIdx = indexFields.indexOf(b);\n\t if (aIdx === -1) {\n\t aIdx = Number.MAX_VALUE;\n\t }\n\t if (bIdx === -1) {\n\t bIdx = Number.MAX_VALUE;\n\t }\n\t return compare$2(aIdx, bIdx);\n\t });\n\t}", "sortFunctionDesc(field) {\n const compare = (a, b) => {\n var aField = a[field]\n var bField = b[field]\n if (typeof a[field] === 'string') {\n aField = a[field].toLowerCase()\n }\n if (typeof b[field] === 'string') {\n bField = b[field].toLowerCase()\n }\n if (aField < bField) { return 1 }\n if (aField > bField) { return -1 }\n return 0\n }\n return compare\n }", "function sortFieldsByIndex(userFields, index) {\n var indexFields = index.def.fields.map(getKey);\n\n return userFields.slice().sort(function (a, b) {\n var aIdx = indexFields.indexOf(a);\n var bIdx = indexFields.indexOf(b);\n if (aIdx === -1) {\n aIdx = Number.MAX_VALUE;\n }\n if (bIdx === -1) {\n bIdx = Number.MAX_VALUE;\n }\n return compare(aIdx, bIdx);\n });\n}", "function sortFieldsByIndex(userFields, index) {\n var indexFields = index.def.fields.map(getKey);\n\n return userFields.slice().sort(function (a, b) {\n var aIdx = indexFields.indexOf(a);\n var bIdx = indexFields.indexOf(b);\n if (aIdx === -1) {\n aIdx = Number.MAX_VALUE;\n }\n if (bIdx === -1) {\n bIdx = Number.MAX_VALUE;\n }\n return compare(aIdx, bIdx);\n });\n}", "sortPosts() {\n const orderBy = this.state.postsOrder;\n this.props.posts.sort((post1, post2) => {\n switch (orderBy) {\n case 'timestamp' : return post1.timestamp - post2.timestamp;\n case 'voteScore' : return post2.voteScore - post1.voteScore;\n case 'category' : return post1.category.localeCompare(post2.category);\n default : return post2.voteScore - post1.voteScore;\n }\n });\n }", "function ajax_sort(order, field, obj)\r\n{\r\n obj.order.value=order;\r\n obj.field.value=field;\r\n obj.pageNo.value=1;\r\n loadData();\r\n}", "function byField(fieldName){\n return (a, b) => a[fieldName] > b[fieldName] ? 1 : -1;\n }", "function byField(fieldName){\n return (a, b) => a[fieldName] > b[fieldName] ? 1 : -1;\n }", "get orderBy() {\n if (this._orderBy instanceof Function)\n return this._orderBy(this.entityMetadata.createPropertiesMap());\n return this._orderBy;\n }", "function sortArrayByObjectKey( options, array ) {\n \n let defaultSettings = {\n \n type: 'quick',\n order: 'ascend',\n objectKey: '',\n secondObjectKey: ''\n };\n \n let settings = Object.assign( defaultSettings, options );\n let objectKey = settings.objectKey;\n let secondObjectKey = settings.secondObjectKey;\n \n function sortAscend( item1, item2 ) {\n \n let a = item1[ objectKey ];\n let b = item2[ objectKey ];\n \n if ( a === null ) {\n \n a = '';\n }\n \n if ( b === null ) {\n \n b = '';\n }\n \n if ( a === b && settings.type === 'normal' ) { \n \n a = item1[ secondObjectKey ];\n b = item2[ secondObjectKey ];\n }\n\n \n if ( isNumber( a ) === true && isNumber( b ) === true )\n {\n return a - b;\n }\n \n return a.localeCompare( b );\n }\n \n function sortDescend( item1, item2 ) {\n \n return sortAscend( item2, item1 );\n }\n \n let sortFn = sortAscend;\n \n if ( settings.order === 'descend' ) {\n \n sortFn = sortDescend;\n }\n\n array.sort( sortFn );\n \n return array;\n }", "function sortByFunc() {\n switch (sortBy.field) {\n case 'name':\n case 'ticker':\n if (sortBy.desc === 0) {\n return (a, b) => a[sortBy.field].localeCompare(b[sortBy.field])\n }\n return (a, b) => b[sortBy.field].localeCompare(a[sortBy.field])\n case 'price':\n case 'changes':\n case 'marketCapitalization':\n default:\n if (sortBy.desc === 0) {\n return (a, b) => (a[sortBy.field] - b[sortBy.field])\n }\n return (a, b) => (b[sortBy.field] - a[sortBy.field])\n }\n }", "orderBy(...args) {\r\n let model;\r\n let field;\r\n let direction = 'ASC';\r\n if (args.length === 2) {\r\n [field, direction] = args;\r\n this.builder.orderBy(field, direction);\r\n }\r\n if (args.length === 3) {\r\n [model, field, direction] = args;\r\n this.builder.orderBy(model, field, direction);\r\n }\r\n if (args.length === 1) {\r\n [field] = args;\r\n this.builder.orderBy(field);\r\n }\r\n return this;\r\n }", "function resort(){\n if(scope.sorting && scope.sorting.obj){\n var sortKey = scope.sorting.obj.field;\n sorter(sortKey,scope.sorting.direction);\n }\n }", "function resort(){\n if(scope.sorting && scope.sorting.obj){\n var sortKey = scope.sorting.obj.field;\n sorter(sortKey,scope.sorting.direction);\n }\n }", "orderBy(orderBy, ascending = true) {\r\n const o = \"$orderby\";\r\n const query = this.query.has(o) ? this.query.get(o).split(\",\") : [];\r\n query.push(`${orderBy} ${ascending ? \"asc\" : \"desc\"}`);\r\n this.query.set(o, query.join(\",\"));\r\n return this;\r\n }", "orderBy(orderBy, ascending = true) {\r\n const o = \"$orderby\";\r\n const query = this.query.has(o) ? this.query.get(o).split(\",\") : [];\r\n query.push(`${orderBy} ${ascending ? \"asc\" : \"desc\"}`);\r\n this.query.set(o, query.join(\",\"));\r\n return this;\r\n }", "order(by) {\n if (typeof by === 'string') {\n by = {[by]: 'desc'};\n }\n return this.spawn().applyOrder(by);\n }", "function sortByName(object, className) {\n object.sort(function (a, b) {\n if (className == 'warehouse' || className == 'projecteq')\n return a.city.name > b.city.name;\n else return a.name > b.name;\n });\n return object;\n}", "dynamicSort(property) {\n var sortOrder = 1;\n //check for \"-\" operator and sort asc/desc depending on that\n if (property[0] === \"-\") {\n sortOrder = -1;\n property = property.substr(1);\n }\n return function (a, b) {\n var result =\n a[property] < b[property] ? -1 : a[property] > b[property] ? 1 : 0;\n return result * sortOrder;\n };\n }", "function sortObj(obj) {\n return _(obj).toPairs().sortBy(0).fromPairs().value()\n }", "function byField(fieldName){\n\treturn (a, b) => a[fieldName] > b[fieldName] ? 1 : -1;\n}", "function createFieldSorter(sort) {\n\n function getFieldValuesAsArray(doc) {\n return sort.map(function (sorting) {\n var fieldName = getKey(sorting);\n var parsedField = parseField(fieldName);\n var docFieldValue = getFieldFromDoc(doc, parsedField);\n return docFieldValue;\n });\n }\n\n return function (aRow, bRow) {\n var aFieldValues = getFieldValuesAsArray(aRow.doc);\n var bFieldValues = getFieldValuesAsArray(bRow.doc);\n var collation = collate(aFieldValues, bFieldValues);\n if (collation !== 0) {\n return collation;\n }\n // this is what mango seems to do\n return compare$1(aRow.doc._id, bRow.doc._id);\n };\n}", "function createFieldSorter(sort) {\n\n function getFieldValuesAsArray(doc) {\n return sort.map(function (sorting) {\n var fieldName = getKey(sorting);\n var parsedField = parseField(fieldName);\n var docFieldValue = getFieldFromDoc(doc, parsedField);\n return docFieldValue;\n });\n }\n\n return function (aRow, bRow) {\n var aFieldValues = getFieldValuesAsArray(aRow.doc);\n var bFieldValues = getFieldValuesAsArray(bRow.doc);\n var collation = collate(aFieldValues, bFieldValues);\n if (collation !== 0) {\n return collation;\n }\n // this is what mango seems to do\n return compare$1(aRow.doc._id, bRow.doc._id);\n };\n}", "function createFieldSorter(sort) {\n\n function getFieldValuesAsArray(doc) {\n return sort.map(function (sorting) {\n var fieldName = getKey(sorting);\n var parsedField = parseField(fieldName);\n var docFieldValue = getFieldFromDoc(doc, parsedField);\n return docFieldValue;\n });\n }\n\n return function (aRow, bRow) {\n var aFieldValues = getFieldValuesAsArray(aRow.doc);\n var bFieldValues = getFieldValuesAsArray(bRow.doc);\n var collation = collate(aFieldValues, bFieldValues);\n if (collation !== 0) {\n return collation;\n }\n // this is what mango seems to do\n return compare$1(aRow.doc._id, bRow.doc._id);\n };\n}", "sortBy(field, reverse, primer) {\n\t\tconst key = primer\n\t\t\t? function (x) {\n\t\t\t\treturn primer(x[field]);\n\t\t\t}\n\t\t\t: function (x) {\n\t\t\t\treturn x[field];\n\t\t\t};\n\t\n\t\treturn function (a, b) {\n\t\t\ta = key(a);\n\t\t\tb = key(b);\n\t\t\treturn reverse * ((a > b) - (b > a));\n\t\t};\n\t}", "function createFieldSorter(sort) {\n\n function getFieldValuesAsArray(doc) {\n return sort.map(function (sorting) {\n var fieldName = getKey(sorting);\n var parsedField = parseField(fieldName);\n var docFieldValue = getFieldFromDoc(doc, parsedField);\n return docFieldValue;\n });\n }\n\n return function (aRow, bRow) {\n var aFieldValues = getFieldValuesAsArray(aRow.doc);\n var bFieldValues = getFieldValuesAsArray(bRow.doc);\n var collation = collate(aFieldValues, bFieldValues);\n if (collation !== 0) {\n return collation;\n }\n // this is what mango seems to do\n return compare(aRow.doc._id, bRow.doc._id);\n };\n}", "function createFieldSorter(sort) {\n\n function getFieldValuesAsArray(doc) {\n return sort.map(function (sorting) {\n var fieldName = getKey(sorting);\n var parsedField = parseField(fieldName);\n var docFieldValue = getFieldFromDoc(doc, parsedField);\n return docFieldValue;\n });\n }\n\n return function (aRow, bRow) {\n var aFieldValues = getFieldValuesAsArray(aRow.doc);\n var bFieldValues = getFieldValuesAsArray(bRow.doc);\n var collation = collate(aFieldValues, bFieldValues);\n if (collation !== 0) {\n return collation;\n }\n // this is what mango seems to do\n return compare(aRow.doc._id, bRow.doc._id);\n };\n}", "function sortByDateAsc(a,b)\n{\n return new Date(a.createdAt) - new Date(b.createdAt)\n}", "_orderSort(l, r) {\n return l.order - r.order;\n }", "function sortObjKeys(obj) {\r\n var ordered = {};\r\n Object.keys(obj).sort().forEach(function(key) {\r\n ordered[key] = obj[key];\r\n });\r\n return ordered;\r\n \r\n}", "function sortJSON() {\n filteredObjects.sort(function(a, b) {\n var valueA, valueB;\n\n switch (sortParam) {\n // ascending by project name\n case 'asc':\n valueA = a.title.toLowerCase();\n valueB = b.title.toLowerCase();\n break;\n // newest by creation date (b and a is changed on purpose)\n case 'newest':\n valueA = new Date(b.updatedAt);\n valueB = new Date(a.updatedAt);\n break;\n }\n\n if (valueA < valueB) {\n return -1;\n } else if (valueA > valueB) {\n return 1;\n } else {\n return 0;\n }\n });\n\n //set the URL accordingly\n setURLParameter();\n}", "function sorte ( i ){\n return function(){\n if(scope.sorting.obj){\n //var index = _.findIndex(scope.viewer, scope.sorting.obj);\n }\n var key = scope.headers[i].field;\n if(scope.sorting.field === key){\n scope.sorting.direction = scope.sorting.direction * -1;\n }else{\n scope.sorting.field = key;\n scope.sorting.direction = 1;\n }\n sorter(key,scope.sorting.direction);\n scope.sorting.obj = scope.headers[i];\n scope.buildTable();\n\n };\n }", "function sorte ( i ){\n return function(){\n if(scope.sorting.obj){\n //var index = _.findIndex(scope.viewer, scope.sorting.obj);\n }\n var key = scope.headers[i].field;\n if(scope.sorting.field === key){\n scope.sorting.direction = scope.sorting.direction * -1;\n }else{\n scope.sorting.field = key;\n scope.sorting.direction = 1;\n }\n sorter(key,scope.sorting.direction);\n scope.sorting.obj = scope.headers[i];\n scope.buildTable();\n\n };\n }", "get order() {}", "get order() {}", "function applyOrder( toData ) {\n var sortField = '', sortDir = 0;\n if( args.options && args.options.sort ) {\n if( args.options.sort.max ) {\n sortField = 'max';\n sortDir = args.options.sort.max;\n }\n if( args.options.sort.min ) {\n sortField = 'min';\n sortDir = args.options.sort.min;\n }\n if( args.options.sort.unit ) {\n sortField = 'unit';\n sortDir = args.options.sort.unit;\n }\n if( args.options.sort.type ) {\n sortField = 'type';\n sortDir = args.options.sort.type;\n }\n }\n\n if( '' !== sortField ) {\n if( 1 === sortDir ) {\n toData.sort( orderDataAsc );\n } else {\n toData.sort( orderDataDesc );\n }\n }\n\n function orderDataAsc( a, b ) {\n if( a[sortField] < b[sortField] ) {\n return -1;\n }\n if( a[sortField] > b[sortField] ) {\n return 1;\n }\n return 0;\n }\n\n function orderDataDesc( a, b ) {\n if( a[sortField] > b[sortField] ) {\n return -1;\n }\n if( a[sortField] < b[sortField] ) {\n return 1;\n }\n return 0;\n }\n\n }", "function sortingObj(obj){\n for(let key in obj) obj[key].sort();\n return obj\n}", "function sortParams(orderDef, fieldRefOption) {\n return (isArray(orderDef) ? orderDef : [orderDef]).reduce(function (s, orderChannelDef) {\n s.field.push(vgField(orderChannelDef, fieldRefOption));\n s.order.push(orderChannelDef.sort || 'ascending');\n return s;\n }, { field: [], order: [] });\n }", "orderByIDDesc() {\n this.sort = { fieldPath: '_id', desc: true };\n return this;\n }", "function dynamicSort( property ) {\n var sortOrder = 1;\n if ( property[ 0 ] === \"-\" ) {\n sortOrder = -1;\n property = property.substr( 1 );\n }\n return function ( a, b ) {\n var result = ( a[ property ] < b[ property ] ) ? -1 : ( a[ property ] > b[ property ] ) ? 1 : 0;\n return result * sortOrder;\n };\n }", "function SortByProperty(a,b)\n\t{\n\t\treturn a[sortType] - b[sortType];\n\t}", "orderByDesc(fieldPath) {\n this.sort = { fieldPath, desc: true };\n return this;\n }", "function ordernar(field, reverse, primer) {\n\n const key = primer ?\n function (x) {\n return primer(x[field]);\n } :\n function (x) {\n return x[field];\n };\n\n reverse = !reverse ? 1 : -1;\n\n return function (a, b) {\n return a = key(a), b = key(b), reverse * ((a > b) - (b > a));\n };\n}", "function createFieldSorter(sort) {\n\n function getFieldValuesAsArray(doc) {\n return sort.map(function (sorting) {\n var fieldName = getKey(sorting);\n var parsedField = parseField(fieldName);\n var docFieldValue = getFieldFromDoc(doc, parsedField);\n return docFieldValue;\n });\n }\n\n return function (aRow, bRow) {\n var aFieldValues = getFieldValuesAsArray(aRow.doc);\n var bFieldValues = getFieldValuesAsArray(bRow.doc);\n var collation = Object(__WEBPACK_IMPORTED_MODULE_1_pouchdb_collate__[\"a\" /* collate */])(aFieldValues, bFieldValues);\n if (collation !== 0) {\n return collation;\n }\n // this is what mango seems to do\n return compare(aRow.doc._id, bRow.doc._id);\n };\n}", "function createFieldSorter(sort) {\n\n function getFieldValuesAsArray(doc) {\n return sort.map(function (sorting) {\n var fieldName = getKey(sorting);\n var parsedField = parseField(fieldName);\n var docFieldValue = getFieldFromDoc(doc, parsedField);\n return docFieldValue;\n });\n }\n\n return function (aRow, bRow) {\n var aFieldValues = getFieldValuesAsArray(aRow.doc);\n var bFieldValues = getFieldValuesAsArray(bRow.doc);\n var collation = collate(aFieldValues, bFieldValues);\n if (collation !== 0) {\n return collation;\n }\n // this is what mango seems to do\n return compare$1(aRow.doc._id, bRow.doc._id);\n };\n }", "function Cached_sortPlace(beanObj) {\n\tif (beanObj != null) {\n\t\t// Get Active-only beans\n\t\tbeanObj.addressList = Cached_getActiveList(beanObj.addressList);\n\t\tbeanObj.operatingHourList = Cached_getActiveList(beanObj.operatingHourList);\n\t\tbeanObj.labelList = Cached_getActiveList(beanObj.labelList);\n\t\tbeanObj.imageList = Cached_getActiveList(beanObj.imageList);\n\t\tbeanObj.documentList = Cached_getActiveList(beanObj.documentList);\n\t\tbeanObj.roleList = Cached_getActiveList(beanObj.roleList);\n\t\tbeanObj.settingsList = Cached_getActiveList(beanObj.settingsList);\n\t\tbeanObj.templateList = Cached_getActiveList(beanObj.templateList);\n\t\t$.each(beanObj.templateList, function(i, templateObj) {\n\t\t\ttemplateObj.propertiesList = Cached_getActiveList(templateObj.propertiesList);\n\t\t});\n\t\tbeanObj.propertiesList = Cached_getActiveList(beanObj.propertiesList);\n\t\tbeanObj.calendarList = Cached_getActiveList(beanObj.calendarList);\n\t\t$.each(beanObj.calendarList, function(i, calendarObj) {\n\t\t\tcalendarObj.eventList = Cached_getActiveList(calendarObj.eventList);\n\t\t});\n\t\tbeanObj.workflowList = Cached_getActiveList(beanObj.workflowList);\n\t\t$.each(beanObj.workflowList, function(i, workflowObj) {\n\t\t\tworkflowObj.eventList = Cached_getActiveList(workflowObj.eventList);\n\t\t});\n\n\t\t// Sorting\n\t\tbeanObj.addressList.sort(function(a, b) {\n\t\t\tif (a.type < b.type) return -1;\n\t\t\tif (a.type > b.type) return 1;\n\t\t\treturn 0;\n\t\t});\n\t\tbeanObj.operatingHourList.sort(function(a, b) {\n\t\t\treturn a.createdOn - b.createdOn;\n\t\t});\n\t\tbeanObj.labelList.sort(function(a, b) {\n\t\t\treturn a.position - b.position;\n\t\t});\n\t\tbeanObj.imageList.sort(function(a, b) {\n\t\t\tif (a.name < b.name) return -1;\n\t\t\tif (a.name > b.name) return 1;\n\t\t\treturn 0;\n\t\t});\n\t\tbeanObj.documentList.sort(function(a, b) {\n\t\t\tif (a.docName < b.docName) return -1;\n\t\t\tif (a.docName > b.docName) return 1;\n\t\t\treturn 0;\n\t\t});\n\t\tbeanObj.roleList.sort(function(a, b) {\n\t\t\tif (a.userId < b.userId) return -1;\n\t\t\tif (a.userId > b.userId) return 1;\n\t\t\treturn 0;\n\t\t});\n\t\tbeanObj.settingsList.sort(function(a, b) {\n\t\t\tif (a.moduleId < b.moduleId) return -1;\n\t\t\tif (a.moduleId > b.moduleId) return 1;\n\t\t\treturn 0;\n\t\t});\n\t\tbeanObj.templateList.sort(function(a, b) {\n\t\t\tif (a.moduleId < b.moduleId) return -1;\n\t\t\tif (a.moduleId > b.moduleId) return 1;\n\t\t\treturn 0;\n\t\t});\n\t\tbeanObj.propertiesList.sort(function(a, b) {\n\t\t\tif (a.propKey < b.propKey) return -1;\n\t\t\tif (a.propKey > b.propKey) return 1;\n\t\t\treturn 0;\n\t\t});\n\t\tbeanObj.calendarList.sort(function(a, b) {\n\t\t\tif (a.calendarName < b.calendarName) return -1;\n\t\t\tif (a.calendarName > b.calendarName) return 1;\n\t\t\treturn 0;\n\t\t});\n\t\tbeanObj.workflowList.sort(function(a, b) {\n\t\t\treturn a.createdOn - b.createdOn;\n\t\t});\n\t\t$.each(beanObj.workflowList, function(i, workflowObj) {\n\t\t\tworkflowObj.eventList.sort(function(a, b) {\n\t\t\t\treturn a.seqno - b.seqno;\n\t\t\t});\n\t\t});\n\t}\n} // .end of Cached_sortPlace", "sortedRankings ({ rankings, sortBy }) {\n const { field, order } = sortBy\n const sortComparator = (a, b) => {\n if (order === 'asc') {\n return a.stats[field] - b.stats[field]\n }\n return b.stats[field] - a.stats[field]\n }\n return rankings.sort(sortComparator)\n }", "function dynamicSort(property) {\n var sortOrder = 1;\n if(property[0] === \"-\") {\n sortOrder = -1;\n property = property.substr(1);\n }\n return function (a,b) {\n var result = (a[property] < b[property]) ? -1 : (a[property] > b[property]) ? 1 : 0;\n return result * sortOrder;\n }\n}", "onHandleSort(event) {\n const { fieldName: sortedBy, sortDirection } = event.detail;\n const cloneData = [...this.data];\n\n cloneData.sort(this.sortBy(sortedBy, sortDirection === 'asc' ? 1 : -1));\n this.data = cloneData;\n this.sortDirection = sortDirection;\n this.sortedBy = sortedBy;\n }", "function dynamicSort(property) {\n var sortOrder = 1;\n if (property[0] === \"-\") {\n sortOrder = -1;\n property = property.substr(1);\n }\n return function (a, b) {\n var result = (a[property] < b[property]) ? -1 : (a[property] > b[property]) ? 1 : 0;\n return result * sortOrder;\n }\n}", "function dynamicSort(property) {\r\n var sortOrder = 1;\r\n if (property[0] === \"-\") {\r\n sortOrder = -1;\r\n property = property.substr(1);\r\n }\r\n return function (a, b) {\r\n var result = (a[property] > b[property]) ? -1 : (a[property] < b[property]) ? 1 : 0;\r\n return result * sortOrder;\r\n }\r\n}", "sortedItems() {\n if (!this.sortField) return this.itemsToSort;\n return orderBy(this.itemsToSort, [this.sortField], [this.sortOrder]);\n }", "function dynamicSort(property) {\n var sortOrder = 1;\n if(property[0] === \"-\") {\n sortOrder = -1;\n property = property.substr(1);\n }\n return function (a,b) {\n var result = (a[property] < b[property]) ? -1 : (a[property] > b[property]) ? 1 : 0;\n return result * sortOrder;\n };\n}", "function _sortObject(jsonObj) {\n var keys = Object.keys(jsonObj);\n\t \t\n\t \tkeys.sort();\n\t \t\n\t \tvar sortedObject = Object();\n\t \t\n\t \tfor(i in keys) {\n\t \tkey = keys[i];\n\t\t sortedObject[key] = jsonObj[key];\n\t \t}\n\t \t\n\t \treturn sortedObject;\n }", "get overrideSorting() {}", "function createFieldSorter(sort) {\n\n\t function getFieldValuesAsArray(doc) {\n\t return sort.map(function (sorting) {\n\t var fieldName = getKey(sorting);\n\t var parsedField = parseField(fieldName);\n\t var docFieldValue = getFieldFromDoc(doc, parsedField);\n\t return docFieldValue;\n\t });\n\t }\n\n\t return function (aRow, bRow) {\n\t var aFieldValues = getFieldValuesAsArray(aRow.doc);\n\t var bFieldValues = getFieldValuesAsArray(bRow.doc);\n\t var collation = collate(aFieldValues, bFieldValues);\n\t if (collation !== 0) {\n\t return collation;\n\t }\n\t // this is what mango seems to do\n\t return compare$1(aRow.doc._id, bRow.doc._id);\n\t };\n\t}", "function orderNatural() {\n sortFunc = null;\n return groupObj;\n }", "function sortObjByKeys(object) {\n const orderedFolders = {};\n const orderedFiles = {};\n /// sort the files in objects\n if (object.hasOwnProperty(\"files\")) {\n Object.keys(object[\"files\"])\n .sort()\n .forEach(function (key) {\n orderedFiles[key] = object[\"files\"][key];\n });\n }\n if (object.hasOwnProperty(\"folders\")) {\n Object.keys(object[\"folders\"])\n .sort()\n .forEach(function (key) {\n orderedFolders[key] = object[\"folders\"][key];\n });\n }\n const orderedObject = {\n folders: orderedFolders,\n files: orderedFiles,\n type: \"\",\n };\n return orderedObject;\n}", "function sortBy(obj, iteratee, context) {\n var index = 0;\n iteratee = cb(iteratee, context);\n return pluck(map(obj, function(value, key, list) {\n return {\n value: value,\n index: index++,\n criteria: iteratee(value, key, list)\n };\n }).sort(function(left, right) {\n var a = left.criteria;\n var b = right.criteria;\n if (a !== b) {\n if (a > b || a === void 0) return 1;\n if (a < b || b === void 0) return -1;\n }\n return left.index - right.index;\n }), 'value');\n }", "function sortBy(obj, iteratee, context) {\n var index = 0;\n iteratee = cb(iteratee, context);\n return pluck(map(obj, function(value, key, list) {\n return {\n value: value,\n index: index++,\n criteria: iteratee(value, key, list)\n };\n }).sort(function(left, right) {\n var a = left.criteria;\n var b = right.criteria;\n if (a !== b) {\n if (a > b || a === void 0) return 1;\n if (a < b || b === void 0) return -1;\n }\n return left.index - right.index;\n }), 'value');\n }", "function sortBy(obj, iteratee, context) {\n var index = 0;\n iteratee = cb(iteratee, context);\n return pluck(map(obj, function(value, key, list) {\n return {\n value: value,\n index: index++,\n criteria: iteratee(value, key, list)\n };\n }).sort(function(left, right) {\n var a = left.criteria;\n var b = right.criteria;\n if (a !== b) {\n if (a > b || a === void 0) return 1;\n if (a < b || b === void 0) return -1;\n }\n return left.index - right.index;\n }), 'value');\n }", "function sortBy(obj, iteratee, context) {\n var index = 0;\n iteratee = cb(iteratee, context);\n return pluck(map(obj, function(value, key, list) {\n return {\n value: value,\n index: index++,\n criteria: iteratee(value, key, list)\n };\n }).sort(function(left, right) {\n var a = left.criteria;\n var b = right.criteria;\n if (a !== b) {\n if (a > b || a === void 0) return 1;\n if (a < b || b === void 0) return -1;\n }\n return left.index - right.index;\n }), 'value');\n }" ]
[ "0.7003094", "0.6617245", "0.65855557", "0.65081936", "0.64261514", "0.64052695", "0.63869286", "0.6359571", "0.6353804", "0.6353142", "0.63472986", "0.6337718", "0.63208765", "0.62880594", "0.6262062", "0.6237014", "0.6211151", "0.62089473", "0.6185", "0.61471325", "0.6132855", "0.6110787", "0.610267", "0.6101326", "0.61009854", "0.6094742", "0.6091156", "0.6039485", "0.6033349", "0.60247207", "0.60084337", "0.5965125", "0.59505755", "0.5905823", "0.58953166", "0.58927083", "0.5875211", "0.5869141", "0.58349806", "0.5834865", "0.58174944", "0.5817494", "0.5817494", "0.58094615", "0.57618046", "0.5760955", "0.5760955", "0.575945", "0.5748242", "0.5747389", "0.57464474", "0.5737195", "0.5737195", "0.57369906", "0.57369906", "0.57308453", "0.573071", "0.57274616", "0.57221043", "0.5718687", "0.5717243", "0.5717243", "0.5717243", "0.5700584", "0.57000077", "0.57000077", "0.56902725", "0.5689254", "0.56891745", "0.5687849", "0.5685022", "0.5685022", "0.56817204", "0.56817204", "0.5677847", "0.5676158", "0.5674941", "0.5672784", "0.5670746", "0.5669109", "0.56681144", "0.56672525", "0.566597", "0.5661462", "0.56607443", "0.56590223", "0.56447357", "0.56437", "0.5638518", "0.5637961", "0.5637546", "0.5634867", "0.5634592", "0.5633659", "0.5633652", "0.56326604", "0.56227005", "0.5622324", "0.5622324", "0.5622324", "0.5622324" ]
0.0
-1
Returns a function, that, as long as it continues to be invoked, will not be triggered. The function will be called after it stops being called for N milliseconds. If `immediate` is passed, trigger the function on the leading edge, instead of the trailing.
function debounce(func, wait) { var timeout; var args; var context; var timestamp; var result; var later = function () { var last = new Date().valueOf() - timestamp; if (last < wait) { timeout = setTimeout(later, wait - last); } else { timeout = null; result = func.apply(context, args); context = args = null; } }; return function () { context = this; args = arguments; timestamp = new Date().valueOf(); if (!timeout) { timeout = setTimeout(later, wait); } return result; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function debounce(func, wait, immediate) {\n var timeout;\n return function () {\n var args = arguments,\n callNow = immediate && !timeout,\n later = function () {\n timeout = null;\n if (!immediate) {\n func.apply(window, args);\n }\n };\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) {\n func.apply(window, args);\n }\n };\n }", "function debounce(myFunction, wait, immediate) {\n var timeout;\n\n return function() {\n var context = this,\n args = arguments,\n callNow = immediate && !timeout;\n\n var later = function() {\n timeout = null;\n if (!immediate) { myFunction.apply(context, args); }\n };\n\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) { myFunction.apply(context, args); }\n };\n }", "function debounce(fn, wait, immediate) {\n var timeout;\n\n wait || (wait = 100);\n\n return function () {\n var context = this, args = arguments;\n\n var later = function() {\n timeout = null;\n\n if ( !immediate ) {\n fn.apply(context, args);\n }\n };\n\n var callNow = immediate && !timeout;\n\n clearTimeout(timeout);\n\n timeout = setTimeout(later, wait);\n\n if ( callNow ) {\n fn.apply(context, args);\n }\n };\n }", "function debounce(func, wait, immediate) {\n var timeout;\n return function executedFunction() {\n var context = this;\n var args = arguments;\n\n var later = function later() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n}", "function debounce(func, wait, immediate) {\n\t\tvar timeout;\n\t\treturn function() {\n\t\t\tvar context = this, args = arguments;\n\t\t\tvar later = function() {\n\t\t\t\ttimeout = null;\n\t\t\t\tif (!immediate) func.apply(context, args);\n\t\t\t};\n\t\t\tvar callNow = immediate && !timeout;\n\t\t\tclearTimeout(timeout);\n\t\t\ttimeout = setTimeout(later, wait);\n\t\t\tif (callNow) func.apply(context, args);\n\t\t};\n\t}", "function debounce(func, wait, immediate) {\n\t\tvar timeout;\n\t\treturn function() {\n\t\t\tvar context = this, args = arguments;\n\t\t\tvar later = function() {\n\t\t\t\ttimeout = null;\n\t\t\t\tif (!immediate) func.apply(context, args);\n\t\t\t};\n\t\t\tvar callNow = immediate && !timeout;\n\t\t\tclearTimeout(timeout);\n\t\t\ttimeout = setTimeout(later, wait);\n\t\t\tif (callNow) func.apply(context, args);\n\t\t};\n\t}", "function debounce(func, wait, immediate) {\n var timeout;\n\n return function executedFunction() {\n var context = this;\n var args = arguments;\n\n var later = function () {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n var callNow = immediate && !timeout;\n\n clearTimeout(timeout);\n\n timeout = setTimeout(later, wait);\n\n if (callNow) func.apply(context, args);\n };\n}", "function debounce( func, wait, immediate ) {\n var timeout;\n\n return function() {\n var context = this,\n args = arguments;\n\n var later = function() {\n timeout = null;\n\n if ( ! immediate ) func.apply( context, args );\n };\n\n var callNow = immediate && ! timeout;\n\n clearTimeout( timeout );\n timeout = setTimeout( later, wait );\n\n if ( callNow ) func.apply( context, args );\n };\n }", "function _debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this, args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n }", "function debounce(func, wait, immediate){\n\tvar timeout;\n\treturn function(){\n\t\tvar self = this;\n\t\tvar args = araguments;\n\n\t\tvar callLater = function(){\n\t\t\ttimeout = null;\n\t\t\tif(!immediate) func.apply(self, args); // when immediate is passed in, don't call this func, because it has been trigged in 49\n\t\t}\n\n\t\tvar callNow = immediate && !timeout; // callNow means immeidate but don't have timeout.\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(callLater, wait);\n\n\t\tif(callNow) func.apply(self, args);\n\t}\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this,\n args = arguments;\n\n function later() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n }\n\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) {\n func.apply(context, args);\n }\n };\n }", "function debounce(func, wait, immediate) {\n let timeout;\n return function () {\n let context = this;\n let args = arguments;\n let callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(function () {\n timeout = null;\n if (!immediate) {\n func.apply(context, args);\n }\n }, wait);\n if (callNow) func.apply(context, args);\n }\n}", "function debounce(fun, delay, immediate) {\n // triggers on either leading edge or trailing edge\n var timeout;\n return function() {\n var context = this,\n args = arguments;\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(function() {\n // when immediate is true, we just reset the timeout to null so that\n // the debounced function can run again when delay ms has passed\n timeout = null;\n if(!immediate) fun.apply(context, args);\n }, delay);\n if(callNow) fun.apply(context, args);\n };\n }", "function debounce(func, wait, immediate) {\n var timeout;\n return function () {\n var context = this, args = arguments;\n var later = function () {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n }", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this, args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n }", "function debounce(func, wait, immediate) {\r\n var timeout;\r\n return function() {\r\n var context = this, args = arguments;\r\n var later = function() {\r\n timeout = null;\r\n if (!immediate) func.apply(context, args);\r\n };\r\n var callNow = immediate && !timeout;\r\n clearTimeout(timeout);\r\n timeout = setTimeout(later, wait);\r\n if (callNow) func.apply(context, args);\r\n };\r\n }", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this, args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n }", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this, args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n }", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this, args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n }", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this, args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n }", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this, args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n }", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this, args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n }", "function _debounce(func, wait, immediate) {\n var timeout;\n var result;\n\n return function() {\n var context = this;\n var args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) {\n result = func.apply(context, args);\n }\n };\n var callNow = immediate && !timeout;\n\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) {\n result = func.apply(context, args);\n }\n return result;\n };\n }", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this,\n args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n }", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this,\n args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n }", "function debounce(func, wait, immediate) {\r\n\t\tvar timeout;\r\n\t\treturn function() {\r\n\t\t\tvar context = this, args = arguments;\r\n\t\t\tvar later = function() {\r\n\t\t\t\ttimeout = null;\r\n\t\t\t\tif (!immediate) func.apply(context, args);\r\n\t\t\t};\r\n\t\t\tvar callNow = immediate && !timeout;\r\n\t\t\tclearTimeout(timeout);\r\n\t\t\ttimeout = setTimeout(later, wait);\r\n\t\t\tif (callNow) func.apply(context, args);\r\n\t};\r\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function () {\n var context = this, args = arguments;\n clearTimeout(timeout);\n timeout = setTimeout(function () {\n timeout = null;\n if (!immediate) func.apply(context, args);\n }, wait);\n if (immediate && !timeout) func.apply(context, args);\n };\n }", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this, args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n }", "function debounce(func, wait, immediate) {\n let timeout;\n\n const executedFunction = function() {\n let context = this;\n let args = arguments;\n\n let later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n let callNow = immediate && !timeout;\n\n clearTimeout(timeout);\n\n timeout = setTimeout(later, wait);\n\n if (callNow) func.apply(context, args);\n };\n\n executedFunction.clear = function() {\n clearTimeout(timeout);\n timeout = null;\n };\n\n return executedFunction;\n}", "function debounce(func, wait, immediate) {\n\tvar timeout;\n\treturn function() {\n\t\tvar context = this, args = arguments;\n\t\tvar later = function() {\n\t\t\ttimeout = null;\n\t\t\tif (!immediate) func.apply(context, args);\n\t\t};\n\t\tvar callNow = immediate && !timeout;\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(later, wait);\n\t\tif (callNow) func.apply(context, args);\n\t};\n}", "function debounce(func, wait, immediate) {\n\tvar timeout;\n\treturn function() {\n\t\tvar context = this, args = arguments;\n\t\tvar later = function() {\n\t\t\ttimeout = null;\n\t\t\tif (!immediate) func.apply(context, args);\n\t\t};\n\t\tvar callNow = immediate && !timeout;\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(later, wait);\n\t\tif (callNow) func.apply(context, args);\n\t};\n}", "function debounce(func, wait, immediate) {\n\tvar timeout;\n\treturn function() {\n\t\tvar context = this, args = arguments;\n\t\tvar later = function() {\n\t\t\ttimeout = null;\n\t\t\tif (!immediate) func.apply(context, args);\n\t\t};\n\t\tvar callNow = immediate && !timeout;\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(later, wait);\n\t\tif (callNow) func.apply(context, args);\n\t};\n}", "function debounce(func, wait, immediate) {\n\tvar timeout;\n\treturn function() {\n\t\tvar context = this, args = arguments;\n\t\tvar later = function() {\n\t\t\ttimeout = null;\n\t\t\tif (!immediate) func.apply(context, args);\n\t\t};\n\t\tvar callNow = immediate && !timeout;\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(later, wait);\n\t\tif (callNow) func.apply(context, args);\n\t};\n}", "function debounce(func, wait, immediate) {\n\tvar timeout;\n\treturn function() {\n\t\tvar context = this, args = arguments;\n\t\tvar later = function() {\n\t\t\ttimeout = null;\n\t\t\tif (!immediate) func.apply(context, args);\n\t\t};\n\t\tvar callNow = immediate && !timeout;\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(later, wait);\n\t\tif (callNow) func.apply(context, args);\n\t};\n}", "function debounce(func, wait, immediate) {\n\tvar timeout;\n\treturn function() {\n\t\tvar context = this, args = arguments;\n\t\tvar later = function() {\n\t\t\ttimeout = null;\n\t\t\tif (!immediate) func.apply(context, args);\n\t\t};\n\t\tvar callNow = immediate && !timeout;\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(later, wait);\n\t\tif (callNow) func.apply(context, args);\n\t};\n}", "function debounce(func, wait, immediate) {\n\tvar timeout;\n\treturn function() {\n\t\tvar context = this, args = arguments;\n\t\tvar later = function() {\n\t\t\ttimeout = null;\n\t\t\tif (!immediate) func.apply(context, args);\n\t\t};\n\t\tvar callNow = immediate && !timeout;\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(later, wait);\n\t\tif (callNow) func.apply(context, args);\n\t};\n}", "function debounce(func, wait, immediate) {\n\tvar timeout;\n\treturn function() {\n\t\tvar context = this, args = arguments;\n\t\tvar later = function() {\n\t\t\ttimeout = null;\n\t\t\tif (!immediate) func.apply(context, args);\n\t\t};\n\t\tvar callNow = immediate && !timeout;\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(later, wait);\n\t\tif (callNow) func.apply(context, args);\n\t};\n}", "function debounce(func, wait, immediate) {\n\tvar timeout;\n\treturn function() {\n\t\tvar context = this, args = arguments;\n\t\tvar later = function() {\n\t\t\ttimeout = null;\n\t\t\tif (!immediate) func.apply(context, args);\n\t\t};\n\t\tvar callNow = immediate && !timeout;\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(later, wait);\n\t\tif (callNow) func.apply(context, args);\n\t};\n}", "function debounce(func, wait, immediate) {\n\tvar timeout;\n\treturn function() {\n\t\tvar context = this, args = arguments;\n\t\tvar later = function() {\n\t\t\ttimeout = null;\n\t\t\tif (!immediate) func.apply(context, args);\n\t\t};\n\t\tvar callNow = immediate && !timeout;\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(later, wait);\n\t\tif (callNow) func.apply(context, args);\n\t};\n}", "function debounce(func, wait, immediate) {\n\tvar timeout;\n\treturn function() {\n\t\tvar context = this, args = arguments;\n\t\tvar later = function() {\n\t\t\ttimeout = null;\n\t\t\tif (!immediate) func.apply(context, args);\n\t\t};\n\t\tvar callNow = immediate && !timeout;\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(later, wait);\n\t\tif (callNow) func.apply(context, args);\n\t};\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function () {\n var context = this,\n args = arguments;\n var later = function () {\n timeout = null;\n if (!immediate) {\n func.apply(context, args);\n }\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) {\n func.apply(context, args);\n }\n };\n }", "function debounce(func, wait, immediate) {\n \tvar timeout;\n \treturn function() {\n \t\tvar context = this, args = arguments;\n \t\tvar later = function() {\n \t\t\ttimeout = null;\n \t\t\tif (!immediate) func.apply(context, args);\n \t\t};\n \t\tvar callNow = immediate && !timeout;\n \t\tclearTimeout(timeout);\n \t\ttimeout = setTimeout(later, wait);\n \t\tif (callNow) func.apply(context, args);\n \t};\n }", "function debounce(func, wait, immediate) {\n var timeout;\n return function () {\n var context = this, args = arguments;\n var later = function () {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n}", "function debounce(func, wait, immediate) {\r\n var timeout;\r\n return function () {\r\n var context = this, args = arguments;\r\n clearTimeout(timeout);\r\n timeout = setTimeout(function () {\r\n timeout = null;\r\n if (!immediate) func.apply(context, args);\r\n }, wait);\r\n if (immediate && !timeout) func.apply(context, args);\r\n };\r\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function () {\n var context = this,\n args = arguments;\n clearTimeout(timeout);\n timeout = setTimeout(function () {\n timeout = null;\n if (!immediate) func.apply(context, args);\n }, wait);\n if (immediate && !timeout) func.apply(context, args);\n };\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function () {\n var context = this,\n args = arguments;\n clearTimeout(timeout);\n timeout = setTimeout(function () {\n timeout = null;\n if (!immediate) func.apply(context, args);\n }, wait);\n if (immediate && !timeout) func.apply(context, args);\n };\n}", "function debounce(func, wait, immediate) {\n\tlet timeout;\n\treturn function() {\n\t\tconst context = this, args = arguments;\n\t\tconst later = function() {\n\t\t\ttimeout = null;\n\t\t\tif (!immediate) func.apply(context, args);\n\t\t};\n\t\tconst callNow = immediate && !timeout;\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(later, wait);\n\t\tif (callNow) func.apply(context, args);\n\t};\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function () {\n var context = this, args = arguments;\n clearTimeout(timeout);\n timeout = setTimeout(function () {\n timeout = null;\n if (!immediate) func.apply(context, args);\n }, wait);\n if (immediate && !timeout) func.apply(context, args);\n };\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function () {\n var context = this, args = arguments;\n clearTimeout(timeout);\n timeout = setTimeout(function () {\n timeout = null;\n if (!immediate) func.apply(context, args);\n }, wait);\n if (immediate && !timeout) func.apply(context, args);\n };\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function () {\n var context = this, args = arguments;\n clearTimeout(timeout);\n timeout = setTimeout(function () {\n timeout = null;\n if (!immediate) func.apply(context, args);\n }, wait);\n if (immediate && !timeout) func.apply(context, args);\n };\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this, args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this, args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this, args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this,\n args = arguments;\n clearTimeout(timeout);\n timeout = setTimeout(function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n }, wait);\n if (immediate && !timeout) func.apply(context, args);\n };\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this,\n args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function () {\n var context = this, args = arguments;\n var later = function () {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n}", "function debounce(func, wait = 5, immediate = true) {\n\tvar timeout;\n\treturn function() {\n\t\tvar context = this, args = arguments;\n\t\tvar later = function() {\n\t\t\ttimeout = null;\n\t\t\tif (!immediate) func.apply(context, args);\n\t\t};\n\t\tvar callNow = immediate && !timeout;\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(later, wait);\n\t\tif (callNow) func.apply(context, args);\n\t};\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function () {\n var context = this,\n args = arguments;\n\n var later = function later() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function () {\n var context = this,\n args = arguments;\n\n var later = function later() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n}", "function debounce(func, wait = 20, immediate = true) {\n var timeout;\n return function() {\n var context = this,\n args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n}", "function debounce(func, wait = 20, immediate = true) {\n var timeout;\n return function() {\n var context = this, args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n}", "function debounce(func, wait = 20, immediate = true) {\n var timeout;\n return function() {\n var context = this, args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this,\n args = arguments;\n clearTimeout(timeout);\n timeout = setTimeout(function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n }, wait);\n if (immediate && !timeout) func.apply(context, args);\n }\n}", "function debounce(func, wait = 10, immediate = true) {\n var timeout;\n return function() {\n var context = this,\n args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) {\n func.apply(context, args);\n }\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) {\n func.apply(context, args);\n }\n };\n }", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this, args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this, args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this, args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this, args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this, args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n}", "function debounce(func, wait, immediate) {\r\n \tvar timeout;\r\n \treturn function() {\r\n \t\tvar context = this, args = arguments;\r\n \t\tvar later = function() {\r\n \t\t\ttimeout = null;\r\n \t\t\tif (!immediate) func.apply(context, args);\r\n \t\t};\r\n \t\tvar callNow = immediate && !timeout;\r\n \t\tclearTimeout(timeout);\r\n \t\ttimeout = setTimeout(later, wait);\r\n \t\tif (callNow) func.apply(context, args);\r\n \t};\r\n }", "function debounce(func, wait, immediate) {\n\tvar timeout;\n\treturn function() {\n\t\tvar context = this, args = arguments;\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(function() {\n\t\t\ttimeout = null;\n\t\t\tif (!immediate) func.apply(context, args);\n\t\t}, wait);\n\t\tif (immediate && !timeout) func.apply(context, args);\n\t};\n}", "function debounce(func, wait, immediate) {\n\tvar timeout;\n\treturn function() {\n\t\tvar context = this, args = arguments;\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(function() {\n\t\t\ttimeout = null;\n\t\t\tif (!immediate) func.apply(context, args);\n\t\t}, wait);\n\t\tif (immediate && !timeout) func.apply(context, args);\n\t};\n}", "function debounce(func, wait, immediate) {\n\tvar timeout;\n\treturn function() {\n\t\tvar context = this, args = arguments;\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(function() {\n\t\t\ttimeout = null;\n\t\t\tif (!immediate) func.apply(context, args);\n\t\t}, wait);\n\t\tif (immediate && !timeout) func.apply(context, args);\n\t};\n}", "function debounce(func, wait, immediate) {\n\tvar timeout;\n\treturn function() {\n\t\tvar context = this, args = arguments;\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(function() {\n\t\t\ttimeout = null;\n\t\t\tif (!immediate) func.apply(context, args);\n\t\t}, wait);\n\t\tif (immediate && !timeout) func.apply(context, args);\n\t};\n}", "function debounce(func, wait, immediate) {\n\tvar timeout;\n\treturn function() {\n\t\tvar context = this, args = arguments;\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(function() {\n\t\t\ttimeout = null;\n\t\t\tif (!immediate) func.apply(context, args);\n\t\t}, wait);\n\t\tif (immediate && !timeout) func.apply(context, args);\n\t};\n}", "function debounce(func, wait, immediate) {\n\tvar timeout;\n\treturn function() {\n\t\tvar context = this, args = arguments;\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(function() {\n\t\t\ttimeout = null;\n\t\t\tif (!immediate) func.apply(context, args);\n\t\t}, wait);\n\t\tif (immediate && !timeout) func.apply(context, args);\n\t};\n}", "function debounce(func, wait, immediate) {\n\tvar timeout;\n\treturn function() {\n\t\tvar context = this, args = arguments;\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(function() {\n\t\t\ttimeout = null;\n\t\t\tif (!immediate) func.apply(context, args);\n\t\t}, wait);\n\t\tif (immediate && !timeout) func.apply(context, args);\n\t};\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this,\n args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this,\n args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this,\n args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this,\n args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this,\n args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this,\n args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this,\n args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) {\n func.apply(context, args);\n }\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) {\n func.apply(context, args);\n }\n };\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this,\n args = arguments;\n clearTimeout(timeout);\n timeout = setTimeout(function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n }, wait);\n if (immediate && !timeout) func.apply(context, args);\n };\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this,\n args = arguments;\n clearTimeout(timeout);\n timeout = setTimeout(function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n }, wait);\n if (immediate && !timeout) func.apply(context, args);\n };\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this,\n args = arguments;\n clearTimeout(timeout);\n timeout = setTimeout(function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n }, wait);\n if (immediate && !timeout) func.apply(context, args);\n };\n}", "function debounce(func, wait = 20, immediate = true) {\n var timeout;\n return function() {\n var context = this,\n args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n}", "function debounce(func, wait = 10, immediate = true) {\r\n let timeout;\r\n return function () {\r\n let context = this, args = arguments;\r\n let later = function () {\r\n timeout = null;\r\n if (!immediate) func.apply(context, args);\r\n };\r\n let callNow = immediate && !timeout;\r\n clearTimeout(timeout);\r\n timeout = setTimeout(later, wait);\r\n if (callNow) func.apply(context, args);\r\n };\r\n}", "function debounce(func, wait = 20, immediate = true) {\r\n var timeout;\r\n return function () {\r\n var context = this,\r\n args = arguments;\r\n var later = function () {\r\n timeout = null;\r\n if (!immediate) func.apply(context, args);\r\n };\r\n var callNow = immediate && !timeout;\r\n clearTimeout(timeout);\r\n timeout = setTimeout(later, wait);\r\n if (callNow) func.apply(context, args);\r\n };\r\n}", "function debounce(func, wait = 20, immediate = true) {\n\tvar timeout;\n\treturn function() {\n\t\tvar context = this, args = arguments;\n\t\tvar later = function() {\n\t\t\ttimeout = null;\n\t\t\tif (!immediate) func.apply(context, args);\n\t\t};\n\t\tvar callNow = immediate && !timeout;\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(later, wait);\n\t\tif (callNow) func.apply(context, args);\n\t};\n}", "function debounce(func, wait = 10, immediate = true) {\n\tvar timeout;\n\treturn function() {\n\t\tvar context = this, args = arguments;\n\t\tvar later = function() {\n\t\t\ttimeout = null;\n\t\t\tif (!immediate) func.apply(context, args);\n\t\t};\n\t\tvar callNow = immediate && !timeout;\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(later, wait);\n\t\tif (callNow) func.apply(context, args);\n\t};\n}", "function debounce(func, wait = 20, immediate = true) {\n let timeOut;\n return () => {\n let context = this,\n args = arguments;\n const later = () => {\n timeOut = null;\n if (!immediate) func.apply(context, args);\n };\n const callNow = immediate && !timeOut;\n clearTimeout(timeOut);\n timeOut = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n }", "function debounce(func, wait, immediate) {\n if (immediate === void 0) { immediate = false; }\n var timeout;\n var args;\n var context;\n var timestamp;\n var result;\n var later = function () {\n var last = +new Date() - timestamp;\n if (last < wait) {\n timeout = setTimeout(later, wait - last);\n }\n else {\n timeout = null;\n if (!immediate) {\n result = func.apply(context, args);\n context = args = null;\n }\n }\n };\n return function () {\n context = this;\n args = arguments;\n timestamp = +new Date();\n var callNow = immediate && !timeout;\n if (!timeout) {\n timeout = setTimeout(later, wait);\n }\n if (callNow) {\n result = func.apply(context, args);\n context = args = null;\n }\n return result;\n };\n}", "function debounce(func, wait, immediate) {\n if (immediate === void 0) { immediate = false; }\n var timeout;\n var args;\n var context;\n var timestamp;\n var result;\n var later = function () {\n var last = +new Date() - timestamp;\n if (last < wait) {\n timeout = setTimeout(later, wait - last);\n }\n else {\n timeout = null;\n if (!immediate) {\n result = func.apply(context, args);\n context = args = null;\n }\n }\n };\n return function () {\n context = this;\n args = arguments;\n timestamp = +new Date();\n var callNow = immediate && !timeout;\n if (!timeout) {\n timeout = setTimeout(later, wait);\n }\n if (callNow) {\n result = func.apply(context, args);\n context = args = null;\n }\n return result;\n };\n}", "function debounce(func, wait, immediate) {\n if (immediate === void 0) { immediate = false; }\n var timeout;\n var args;\n var context;\n var timestamp;\n var result;\n var later = function () {\n var last = +new Date() - timestamp;\n if (last < wait) {\n timeout = setTimeout(later, wait - last);\n }\n else {\n timeout = null;\n if (!immediate) {\n result = func.apply(context, args);\n context = args = null;\n }\n }\n };\n return function () {\n context = this;\n args = arguments;\n timestamp = +new Date();\n var callNow = immediate && !timeout;\n if (!timeout) {\n timeout = setTimeout(later, wait);\n }\n if (callNow) {\n result = func.apply(context, args);\n context = args = null;\n }\n return result;\n };\n}", "function debounce(func, wait, immediate) {\n if (immediate === void 0) { immediate = false; }\n var timeout;\n var args;\n var context;\n var timestamp;\n var result;\n var later = function () {\n var last = +new Date() - timestamp;\n if (last < wait) {\n timeout = setTimeout(later, wait - last);\n }\n else {\n timeout = null;\n if (!immediate) {\n result = func.apply(context, args);\n context = args = null;\n }\n }\n };\n return function () {\n context = this;\n args = arguments;\n timestamp = +new Date();\n var callNow = immediate && !timeout;\n if (!timeout) {\n timeout = setTimeout(later, wait);\n }\n if (callNow) {\n result = func.apply(context, args);\n context = args = null;\n }\n return result;\n };\n}", "function debounce(func, wait, immediate) {\n var timeout\n return function() {\n var context = this,\n args = arguments\n var later = function() {\n timeout = null\n if (!immediate) func.apply(context, args)\n }\n var callNow = immediate && !timeout\n clearTimeout(timeout)\n timeout = setTimeout(later, wait)\n if (callNow) func.apply(context, args)\n }\n}", "function debounce(func, wait, immediate) {\n var timeout;\n return function() {\n var context = this, args = arguments;\n clearTimeout(timeout);\n timeout = setTimeout(function() {\n\t timeout = null;\n\t if (!immediate) func.apply(context, args);\n }, wait);\n if (immediate && !timeout) func.apply(context, args);\n };\n} // debounce", "function debounce(func, wait, immediate) {\n let timer = null;\n\n return (...args) => {\n args = arguments;\n let context = this,\n later = () => {\n if (!immediate) {\n func.apply(context, args);\n }\n };\n\n clearTimeout(timer);\n timer = setTimeout(later, wait);\n\n let callNow = immediate && !timer;\n\n if (callNow) {\n func.apply(context, args);\n }\n };\n}", "function debounce(func, wait = 10, immediate = true) {\n\tvar timeout;\n\treturn function () {\n\t\tvar context = this,\n\t\t args = arguments;\n\t\tvar later = function () {\n\t\t\ttimeout = null;\n\t\t\tif (!immediate) func.apply(context, args);\n\t\t};\n\t\tvar callNow = immediate && !timeout;\n\t\tclearTimeout(timeout);\n\t\ttimeout = setTimeout(later, wait);\n\t\tif (callNow) func.apply(context, args);\n\t};\n}" ]
[ "0.6005919", "0.60009474", "0.5987767", "0.59641325", "0.5930723", "0.5930723", "0.5927139", "0.59211427", "0.5913452", "0.5913241", "0.5901756", "0.58908737", "0.5889581", "0.58882964", "0.5881058", "0.5878666", "0.5877016", "0.5877016", "0.5877016", "0.5877016", "0.5876547", "0.5876547", "0.58730185", "0.5871165", "0.5871165", "0.5863688", "0.5861191", "0.5858666", "0.5857629", "0.58559966", "0.58559966", "0.58559966", "0.58559966", "0.58559966", "0.58559966", "0.58559966", "0.58559966", "0.58559966", "0.58559966", "0.58559966", "0.5851979", "0.5846831", "0.58427924", "0.58410215", "0.5840267", "0.5840267", "0.58385545", "0.5837947", "0.5837947", "0.5837947", "0.58375335", "0.58375335", "0.58375335", "0.5834698", "0.583332", "0.5830712", "0.58303815", "0.5830293", "0.5830293", "0.5829776", "0.5829187", "0.5829187", "0.5826777", "0.5826693", "0.58220625", "0.58220625", "0.58220625", "0.58220625", "0.58220625", "0.58219934", "0.58216125", "0.58216125", "0.58216125", "0.58216125", "0.58216125", "0.58216125", "0.58216125", "0.58205545", "0.58205545", "0.58205545", "0.58205545", "0.58205545", "0.58205545", "0.581955", "0.5816281", "0.5816281", "0.5816281", "0.58136046", "0.58074796", "0.58063596", "0.5804366", "0.5804203", "0.5803175", "0.5802833", "0.5802833", "0.5802833", "0.5802833", "0.5798487", "0.5789915", "0.57894564", "0.5783972" ]
0.0
-1
Number and Boolean are only types that defaults or not computed for TODO: write more comments
function refineProps(rawProps, processors, defaults, leftoverProps) { if (defaults === void 0) { defaults = {}; } var refined = {}; for (var key in processors) { var processor = processors[key]; if (rawProps[key] !== undefined) { // found if (processor === Function) { refined[key] = typeof rawProps[key] === 'function' ? rawProps[key] : null; } else if (processor) { // a refining function? refined[key] = processor(rawProps[key]); } else { refined[key] = rawProps[key]; } } else if (defaults[key] !== undefined) { // there's an explicit default refined[key] = defaults[key]; } else { // must compute a default if (processor === String) { refined[key] = ''; // empty string is default for String } else if (!processor || processor === Number || processor === Boolean || processor === Function) { refined[key] = null; // assign null for other non-custom processor funcs } else { refined[key] = processor(null); // run the custom processor func } } } if (leftoverProps) { for (var key in rawProps) { if (processors[key] === undefined) { leftoverProps[key] = rawProps[key]; } } } return refined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function boolStrNum() {\n return {\n type: [Boolean, String, Number],\n default: false\n };\n}", "function boolStrNum() {\n return {\n type: [Boolean, String, Number],\n default: false\n };\n}", "function boolStrNum() {\n return {\n type: [Boolean, String, Number],\n default: false\n };\n}", "function boolStrNum() {\n return {\n type: [Boolean, String, Number],\n default: false\n };\n}", "function boolStrNum() {\n return {\n type: [Boolean, String, Number],\n default: false\n };\n}", "function isPrimitive(value){return typeof value==='string'||typeof value==='number'||typeof value==='boolean';}", "function isPrimitive(value){return typeof value==='string'||typeof value==='number'||typeof value==='boolean';}", "function flse() {\r\n return { generalType: \"bool\", type: FALSE, toString: function () { return \"false\"; } };\r\n}", "DataTypes() {\n // The number type represents both integer and floating point numbers.\n let n = 12;\n n = 12.34;\n console.log(1 / 0) // infinity -> also a number\n let a = 'a';\n console.log(a / 2); // not a number -> NaN\n\n // A BigInt is created by appending n to the end of an integer literal:\n let m = 10932857493752843756243876134758623198065987256876n;\n\n // strings:\n let s = 's';\n s = \"s\";\n s = `s`;\n\n // booleans:\n let b = 1 > 4;\n\n // In JavaScript, null is not a “reference to a non-existing object” or a “null pointer” like in some other languages.\n let n = null;\n\n // The meaning of undefined is “value is not assigned”.\n let x;\n console.log(x);\n\n // Objects and Symbols\n\n // The typeof operator returns the type of the argument. \n console.log(typeof undefined); // \"undefined\"\n console.log(typeof 0); // \"number\"\n console.log(typeof 10n); // \"bigint\"\n console.log(typeof true); // \"boolean\"\n console.log(typeof \"foo\"); // \"string\"\n console.log(typeof Symbol(\"id\")); // \"symbol\"\n console.log(typeof Math); // \"object\" (1)\n console.log(typeof null); // \"object\" (2)\n console.log(typeof alert); // \"function\" (3)\n }", "function dataTypes() {\n console.log(typeof true);\n console.log(typeof null);\n console.log(typeof undefined);\n console.log(typeof 5);\n console.log(typeof NaN);\n console.log(typeof 'Hello');\n\n}", "function Boolean() {}", "function tidyDATATYPES_DEFINITIONS() {\n var defaultVal = {\n formula: false,\n icon: \"fas fa-asterisk\",\n color: \"primary\",\n format: (num, maxN) => {\n let n = (parseFloat(num)||0)\n if(n>999 || (maxN && maxN>999)) n = Math.round(n)\n return n.toLocaleString()\n },\n userParser: parseInt,\n filterable: true,\n selectable: true\n }\n for(var k in DATATYPES_DEFINITIONS) DATATYPES_DEFINITIONS[k] = {suffixName: k.toLowerCase(), ...defaultVal, ...DATATYPES_DEFINITIONS[k]}\n \n }", "function defaultBooleanValue(v) { }", "function primitive (value) {\n\t var type = typeof value;\n\t return type === 'number' ||\n\t type === 'boolean' ||\n\t type === 'string' ||\n\t type === 'symbol'\n\t}", "function isPrimitive(value) {\n\t return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean';\n\t}", "function isPrimitive(value){return typeof value==='string'||typeof value==='number';}", "function ValidateTypeValue(type, value)\n{\n\tif (type == \"Bool\")\n\t{\n\t\tif (value != \"true\" && value != \"false\")\n\t\t{\n\t\t\treturn \"default value must be either 'True' or 'False' for Bool\";\n\t\t}\n\t}\n\telse if (type == \"Int\" || type == \"Float\")\n\t{\n\t\tif (isNaN(value))\n\t\t{\n\t\t\treturn \"default value must be digit(s) for Int or Float\";\n\t\t}\n\t}\n\telse\n\t{\n\t\t// everything is fine as a string or custom type\n\t\treturn null;\n\t}\n}", "isPrimitive(value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean'\n )\n }", "supportsBooleanValues() {\n return true;\n }", "static defineDefaults () {\n\n if (DEFAULTS_DEFINED) {\n return;\n }\n\n // Basic types\n this._defineTypeTest(\"string\", value => _.isString(value));\n this._defineTypeTest(\"number\", value => _.isNumber(value));\n this._defineTypeTest(\"boolean\", value => _.isBoolean(value));\n this._defineTypeTest(\"undefined\", value => value === undefined);\n this._defineTypeTest(\"null\", value => _.isNull(value));\n this._defineTypeTest(\"symbol\", value => _.isSymbol(value));\n this._defineTypeTest(\"function\", value => _.isFunction(value));\n this._defineTypeTest(\"Date\", value => value instanceof Date);\n this._defineTypeTest(\"array\", value => _.isArray(value));\n this._defineTypeTest(\"object\", value => _.isObject(value));\n this._defineTypeTest(\"promise\", value => TypeUtils.isPromise(value));\n this._defineTypeTest(\"Error\", value => value instanceof Error);\n this._defineTypeTest(\"TypeError\", value => value instanceof TypeError);\n this._defineTypeTest(\"URIError\", value => value instanceof URIError);\n this._defineTypeTest(\"SyntaxError\", value => value instanceof SyntaxError);\n this._defineTypeTest(\"ReferenceError\", value => value instanceof ReferenceError);\n this._defineTypeTest(\"RangeError\", value => value instanceof RangeError);\n this._defineTypeTest(\"EvalError\", value => value instanceof EvalError);\n\n // Aliases\n this._defineAliasType(\"String\", \"string\");\n this._defineAliasType(\"Number\", \"number\");\n this._defineAliasType(\"Boolean\", \"boolean\");\n this._defineAliasType(\"Symbol\", \"symbol\");\n this._defineAliasType(\"Function\", \"function\");\n this._defineAliasType(\"Object\", \"object\");\n this._defineAliasType(\"Array\", \"array\");\n this._defineAliasType(\"Promise\", \"promise\");\n\n DEFAULTS_DEFINED = true;\n }", "function tt(t) {\n return \"nullValue\" in t ? 0 /* NullValue */ : \"booleanValue\" in t ? 1 /* BooleanValue */ : \"integerValue\" in t || \"doubleValue\" in t ? 2 /* NumberValue */ : \"timestampValue\" in t ? 3 /* TimestampValue */ : \"stringValue\" in t ? 5 /* StringValue */ : \"bytesValue\" in t ? 6 /* BlobValue */ : \"referenceValue\" in t ? 7 /* RefValue */ : \"geoPointValue\" in t ? 8 /* GeoPointValue */ : \"arrayValue\" in t ? 9 /* ArrayValue */ : \"mapValue\" in t ? X(t) ? 4 /* ServerTimestampValue */ : 10 /* ObjectValue */ : Gn(\"Invalid value type: \" + JSON.stringify(t));\n}", "function isPrimitive(value) {\n return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean';\n }", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n }", "function isPrimitive(v) {\n return (v === null ||\n v === undefined ||\n typeof v === \"boolean\" ||\n typeof v === \"number\" ||\n typeof v === \"string\" ||\n typeof v === \"symbol\");\n }", "function isPrimitive (value) {\n\t return (\n\t typeof value === 'string' ||\n\t typeof value === 'number' ||\n\t // $flow-disable-line\n\t typeof value === 'symbol' ||\n\t typeof value === 'boolean'\n\t )\n\t}", "function isPrimitive(value) {\n return (typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean');\n }", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n }", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n }", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n }", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n }", "function css__ATTR_ques_(cssPrimitiveType) /* (cssPrimitiveType : cssPrimitiveType) -> bool */ {\n return (cssPrimitiveType === 23);\n}", "function Booleans(){\n return false;\n}", "function isPrimitive(value) {\n return typeof value === 'string' || typeof value === 'number' || // $flow-disable-line\n _typeof(value) === 'symbol' || typeof value === 'boolean';\n }", "function M(t) {\n return \"nullValue\" in t ? 0 /* NullValue */ : \"booleanValue\" in t ? 1 /* BooleanValue */ : \"integerValue\" in t || \"doubleValue\" in t ? 2 /* NumberValue */ : \"timestampValue\" in t ? 3 /* TimestampValue */ : \"stringValue\" in t ? 5 /* StringValue */ : \"bytesValue\" in t ? 6 /* BlobValue */ : \"referenceValue\" in t ? 7 /* RefValue */ : \"geoPointValue\" in t ? 8 /* GeoPointValue */ : \"arrayValue\" in t ? 9 /* ArrayValue */ : \"mapValue\" in t ? O(t) ? 4 /* ServerTimestampValue */ : 10 /* ObjectValue */ : _e(\"Invalid value type: \" + JSON.stringify(t));\n}", "constructor(o) {\n super(o);\n var self = this;\n if (typeof o['boolean'] !== 'undefined') {\n this.boolean = o['boolean'];\n }\n if (typeof o['number'] !== 'undefined') {\n this.number = o['number'];\n }\n if (typeof o['string'] !== 'undefined') {\n this.string = o['string'];\n }\n }", "function isPrimitive(value) {\n return typeof value === 'string' || typeof value === 'number' ||\n // $flow-disable-line\n (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'symbol' || typeof value === 'boolean';\n}", "function isPrimitive(value) {\n return typeof value === 'string' || typeof value === 'number' ||\n // $flow-disable-line\n (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'symbol' || typeof value === 'boolean';\n}", "validate(d, opt) {\n if(typeof d === 'undefined') return false;\n if(typeof d === 'boolean') return {\n value: d\n };\n if(typeof d === 'string') {\n if(d.toLowerCase() === 'true' || d === '1') {\n return {\n value: true\n }\n }\n if(d.toLowerCase() === 'false' || d === '0') {\n return {\n value: false\n };\n }\n }\n if(typeof d === 'number') {\n if(d === 1) {\n return {\n value: true\n }\n }\n if(d === 0) {\n return {\n value: false\n }\n }\n }\n return null;\n }", "function flse() {\r\n return { type: FALSE, toString: function () { return \"false\"; } };\r\n}", "function isPrimitive(value) {\n return (\n typeof value === \"string\" ||\n typeof value === \"number\" ||\n // $flow-disable-line\n typeof value === \"symbol\" ||\n typeof value === \"boolean\"\n );\n }", "function _mkf( p ){\n\tif( typeof(p)==\"boolean\" ) return p?1.0:0.0;\n\tif( typeof(p)==\"number\" ) return p;\n\treturn 0.0;\n}", "Number(options = {}) {\r\n return { ...options, kind: exports.NumberKind, type: 'number' };\r\n }", "function isPrimitive(value) {\r\n return (value === null ||\r\n typeof value === 'boolean' ||\r\n typeof value === 'number' ||\r\n typeof value === 'string');\r\n }", "function isPrimitive(value) {\r\n return (value === null ||\r\n typeof value === 'boolean' ||\r\n typeof value === 'number' ||\r\n typeof value === 'string');\r\n }", "function isPrimitive (value) {\r\n return (\r\n typeof value === 'string' ||\r\n typeof value === 'number' ||\r\n // $flow-disable-line\r\n typeof value === 'symbol' ||\r\n typeof value === 'boolean'\r\n )\r\n}", "function isPrimitive(value) {\n return typeof value === 'string' || typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' || typeof value === 'boolean';\n}", "function isPrimitive(value) {\n return typeof value === 'string' || typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' || typeof value === 'boolean';\n}", "function isPrimitive(value) {\n return typeof value === 'string' || typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' || typeof value === 'boolean';\n}", "function isPrimitive(value) {\n return typeof value === 'string' || typeof value === 'number' || // $flow-disable-line\n typeof value === 'symbol' || typeof value === 'boolean';\n}", "function isPrimitive(value) {\n return typeof value === 'string' || typeof value === 'number' || // $flow-disable-line\n typeof value === 'symbol' || typeof value === 'boolean';\n}", "function isPrimitive(val) {\n return isVoid(val) || isBoolean(val) || isString(val) || isNumber(val);\n }", "function isPrimitive(val) {\n return isVoid(val) || isBoolean(val) || isString(val) || isNumber(val);\n }", "function ft(t) {\n return !!t && \"integerValue\" in t;\n}", "isBoolean(val) {\n return typeof val === 'boolean';\n }", "function FalseSpecification() {}", "getDefaultValue(type) {\n switch (type) {\n case \"string\":\n return \"New Value\";\n case \"array\":\n return [];\n case \"boolean\":\n return false;\n case \"null\":\n return null;\n case \"number\":\n return 0;\n case \"object\":\n return {};\n default:\n // We don't have a datatype for some reason (perhaps additionalProperties was true)\n return \"New Value\";\n }\n }", "function defaultForType(type) {\n var def = {\n boolean: true,\n string: '',\n number: undefined,\n array: []\n };\n return def[type];\n } // given a flag, enforce a default type.", "function primitive (data) {\n var type;\n\n switch (data) {\n case null:\n case undefined:\n case false:\n case true:\n return true;\n }\n\n type = typeof data;\n return type === 'string' || type === 'number' || (haveSymbols && type === 'symbol');\n }", "function isPrimitive(val) {\n return isVoid(val) || isBoolean(val) || isString(val) || isNumber(val);\n }", "function isPrimitive(val) {\n return isVoid(val) || isBoolean(val) || isString(val) || isNumber(val);\n }", "supportsIntegerValues() {\n return true;\n }", "function isPrimitive(value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n }", "function isPrimitive(value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n }", "function booWho(bool) {\n let type = typeof bool\n console.log(type);\n if(type==\"boolean\"){\n return true;\n }\n else{\n return false;\n }\n }", "function isPrimitive(value) {\n return typeof value === 'string' || typeof value === 'number' || // $flow-disable-line\n _typeof(value) === 'symbol' || typeof value === 'boolean';\n}", "function isPrimitive(value) {\n return typeof value === 'string' || typeof value === 'number' || // $flow-disable-line\n _typeof(value) === 'symbol' || typeof value === 'boolean';\n}", "function isPrimitive(value) {\n return typeof value === 'string' || typeof value === 'number' || // $flow-disable-line\n _typeof(value) === 'symbol' || typeof value === 'boolean';\n}", "function isPrimitive(value) {\n\t\t return typeof value === 'string' || typeof value === 'number';\n\t\t}", "function isPrimitive(value) {\n return (value === null ||\n typeof value === 'boolean' ||\n typeof value === 'number' ||\n typeof value === 'string');\n }", "function parsePrimitive(info, name, value) {\n var result = value;\n if (info.number || info.positiveNumber) {\n if (!isNaN(result) && result !== '') {\n result = Number(result);\n }\n } else if (info.boolean || info.overloadedBoolean) {\n // Accept `boolean` and `string`.\n if (typeof result === 'string' && (result === '' || normalize(value) === normalize(name))) {\n result = true;\n }\n }\n return result;\n}", "updateDataType_() {\n /** @type {!Object} */\n this.dataType = {\n bits: ((parseInt(this.bitDepth, 10) - 1) | 7) + 1,\n float: this.bitDepth == '32f' || this.bitDepth == '64',\n signed: this.bitDepth != '8',\n be: this.container == 'RIFX'\n };\n if (['4', '8a', '8m'].indexOf(this.bitDepth) > -1 ) {\n this.dataType.bits = 8;\n this.dataType.signed = false;\n }\n }", "function tF() {\n \n // 0\n let z = 0;\n let zVal = z ? 'is truthy': 'is falsey';\n console.log(`0 ${zVal} because 0 is a false value`);\n // \"zero\";\n let zS = \"zero\";\n let zSVal = zS ? 'is truthy': 'is falsey';\n console.log(`\"zero\" ${zSVal} because it is a filled string`);\n // const zero = 20;\n const zero = 20;\n let zeroVal = zero ? 'is truthy': 'is falsey';\n console.log(`20 ${zeroVal} because it is a number despite the variable name being zero`);\n // null\n let n = null;\n let nVal = n ? 'is truthy': 'is falsey';\n console.log(`null ${nVal} because it is lacks any value at all`);\n // \"0\"\n let zStrNum = \"0\";\n let zStrNumVal = zStrNum ? 'is truthy': 'is falsey';\n console.log(`\"0\" ${zStrNumVal} because it is a string that contains a character`);\n // !\"\"\n let excl = !\"\";\n let exclVal = excl? 'is truthy': 'is falsey';\n console.log(`!\"\" ${exclVal} because the \"!\" reverts the false value of the empty string to be true`);\n // {}\n let brack = {};\n let brackVal = brack? 'is truthy': 'is falsey';\n console.log(`{} ${brackVal} because JavaScript recognizes it as truthy (honestly i dont understand why it is this way, it seems it should be falsey since no value is contained)`);\n // () => {console.log(\"hello TEKcamp!\");\n let fun = () => {console.log(\"hello TEKcamp!\")};\n let funVal = fun? 'is truthy': 'is falsey';\n console.log(`() => {console.log(\"hello TEKcamp!\")} ${funVal} because the function contains contains a return (console)`);\n // 125\n let onetwofive = 125;\n let otfVal = onetwofive? 'is truthy': 'is falsey';\n console.log(`125 ${otfVal} because it is a number and numbers other than 0 are truthy`);\n // undefined\n let und = undefined;\n let undVal = und? 'is truthy': 'is falsey';\n console.log(`undefined ${undVal} because it doesnt recognize a value being assigned`);\n // \"\"\n let empt = \"\";\n let emptVal = empt? 'is truthy': 'is falsey';\n console.log(`\"\" ${emptVal} because it it is an empty string`);\n }", "function canUseAsIs(valueType) {\n return valueType === \"string\" ||\n valueType === \"boolean\" ||\n valueType === \"number\" ||\n valueType === \"json\" ||\n valueType === \"math\" ||\n valueType === \"regexp\" ||\n valueType === \"error\";\n }", "function isPrimitiveType (obj) {\r\n return ( typeof obj === 'boolean' ||\r\n typeof obj === 'number' ||\r\n typeof obj === 'string' ||\r\n obj === null ||\r\n util.isDate(obj) ||\r\n util.isArray(obj));\r\n}", "function vt(t) {\n return !!t && \"integerValue\" in t;\n}", "function getType(val) {\r\n if (val === true || val === 'true' || val === false || val === 'false') return 'bool';\r\n if (parseFloat(val).toString() == val) return 'number';\r\n return typeof val;\r\n }", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}", "function isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}" ]
[ "0.6462342", "0.6462342", "0.6462342", "0.6462342", "0.6462342", "0.6126447", "0.6126447", "0.6086038", "0.5911671", "0.58751214", "0.58306396", "0.58240354", "0.58238184", "0.58221024", "0.5672407", "0.5655449", "0.5655416", "0.56443924", "0.5619155", "0.5568987", "0.55612147", "0.55582905", "0.5542633", "0.55333036", "0.5528399", "0.55244815", "0.5519407", "0.5519407", "0.5519407", "0.5519407", "0.5512576", "0.5503033", "0.5497438", "0.54910845", "0.5477996", "0.54587924", "0.54587924", "0.54568845", "0.545432", "0.5448431", "0.5446856", "0.5446688", "0.54428536", "0.54428536", "0.54413235", "0.54247487", "0.54247487", "0.54247487", "0.5420415", "0.5420415", "0.54046756", "0.54046756", "0.5401502", "0.5398574", "0.5394131", "0.5385028", "0.53849393", "0.5378748", "0.53680426", "0.53680426", "0.5359586", "0.5350175", "0.5350175", "0.5346882", "0.5335284", "0.5335284", "0.5335284", "0.53330445", "0.53264725", "0.53168434", "0.5302736", "0.5300503", "0.52987385", "0.52941483", "0.52891564", "0.52883595", "0.5288289", "0.5288289", "0.5288289", "0.5288289", "0.5288289", "0.5288289", "0.5288289", "0.5288289", "0.5288289", "0.5288289", "0.5288289", "0.5288289", "0.5288289", "0.5288289", "0.5288289", "0.5288289", "0.5288289", "0.5288289", "0.5288289", "0.5288289", "0.5288289", "0.5288289", "0.5288289", "0.5288289", "0.5288289" ]
0.0
-1
Date stuff that doesn't belong in datelib core given a timed range, computes an allday range that has the same exact duration, but whose start time is aligned with the start of the day.
function computeAlignedDayRange(timedRange) { var dayCnt = Math.floor(diffDays(timedRange.start, timedRange.end)) || 1; var start = startOfDay(timedRange.start); var end = addDays(start, dayCnt); return { start: start, end: end }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computeAlignedDayRange(timedRange) {\n var dayCnt = Math.floor(diffDays(timedRange.start, timedRange.end)) || 1;\n var start = startOfDay(timedRange.start);\n var end = addDays(start, dayCnt);\n return {\n start: start,\n end: end\n };\n } // given a timed range, computes an all-day range based on how for the end date bleeds into the next day", "function computeAlignedDayRange$1(timedRange) {\n var dayCnt = Math.floor(diffDays$1(timedRange.start, timedRange.end)) || 1;\n var start = startOfDay$1(timedRange.start);\n var end = addDays$1(start, dayCnt);\n return { start: start, end: end };\n }", "function computeAlignedDayRange(timedRange) {\n var dayCnt = Math.floor(diffDays(timedRange.start, timedRange.end)) || 1;\n var start = startOfDay(timedRange.start);\n var end = addDays(start, dayCnt);\n return { start: start, end: end };\n}", "function computeAlignedDayRange(timedRange) {\n var dayCnt = Math.floor(marker_1.diffDays(timedRange.start, timedRange.end)) || 1;\n var start = marker_1.startOfDay(timedRange.start);\n var end = marker_1.addDays(start, dayCnt);\n return {\n start: start,\n end: end\n };\n }", "function computeVisibleDayRange(timedRange, nextDayThreshold) {\n if (nextDayThreshold === void 0) { nextDayThreshold = createDuration(0); }\n var startDay = null;\n var endDay = null;\n if (timedRange.end) {\n endDay = startOfDay(timedRange.end);\n var endTimeMS = timedRange.end.valueOf() - endDay.valueOf(); // # of milliseconds into `endDay`\n // If the end time is actually inclusively part of the next day and is equal to or\n // beyond the next day threshold, adjust the end to be the exclusive end of `endDay`.\n // Otherwise, leaving it as inclusive will cause it to exclude `endDay`.\n if (endTimeMS && endTimeMS >= asRoughMs(nextDayThreshold)) {\n endDay = addDays(endDay, 1);\n }\n }\n if (timedRange.start) {\n startDay = startOfDay(timedRange.start); // the beginning of the day the range starts\n // If end is within `startDay` but not past nextDayThreshold, assign the default duration of one day.\n if (endDay && endDay <= startDay) {\n endDay = addDays(startDay, 1);\n }\n }\n return { start: startDay, end: endDay };\n}", "function computeVisibleDayRange(timedRange, nextDayThreshold) {\n if (nextDayThreshold === void 0) {\n nextDayThreshold = createDuration(0);\n }\n\n var startDay = null;\n var endDay = null;\n\n if (timedRange.end) {\n endDay = startOfDay(timedRange.end);\n var endTimeMS = timedRange.end.valueOf() - endDay.valueOf(); // # of milliseconds into `endDay`\n // If the end time is actually inclusively part of the next day and is equal to or\n // beyond the next day threshold, adjust the end to be the exclusive end of `endDay`.\n // Otherwise, leaving it as inclusive will cause it to exclude `endDay`.\n\n if (endTimeMS && endTimeMS >= asRoughMs(nextDayThreshold)) {\n endDay = addDays(endDay, 1);\n }\n }\n\n if (timedRange.start) {\n startDay = startOfDay(timedRange.start); // the beginning of the day the range starts\n // If end is within `startDay` but not past nextDayThreshold, assign the default duration of one day.\n\n if (endDay && endDay <= startDay) {\n endDay = addDays(startDay, 1);\n }\n }\n\n return {\n start: startDay,\n end: endDay\n };\n } // spans from one day into another?", "function computeVisibleDayRange(timedRange, nextDayThreshold) {\n if (nextDayThreshold === void 0) { nextDayThreshold = createDuration(0); }\n var startDay = null;\n var endDay = null;\n if (timedRange.end) {\n endDay = startOfDay(timedRange.end);\n var endTimeMS = timedRange.end.valueOf() - endDay.valueOf(); // # of milliseconds into `endDay`\n // If the end time is actually inclusively part of the next day and is equal to or\n // beyond the next day threshold, adjust the end to be the exclusive end of `endDay`.\n // Otherwise, leaving it as inclusive will cause it to exclude `endDay`.\n if (endTimeMS && endTimeMS >= asRoughMs(nextDayThreshold)) {\n endDay = addDays(endDay, 1);\n }\n }\n if (timedRange.start) {\n startDay = startOfDay(timedRange.start); // the beginning of the day the range starts\n // If end is within `startDay` but not past nextDayThreshold, assign the default duration of one day.\n if (endDay && endDay <= startDay) {\n endDay = addDays(startDay, 1);\n }\n }\n return { start: startDay, end: endDay };\n }", "function computeVisibleDayRange(timedRange, nextDayThreshold) {\n if (nextDayThreshold === void 0) { nextDayThreshold = createDuration(0); }\n var startDay = null;\n var endDay = null;\n if (timedRange.end) {\n endDay = startOfDay(timedRange.end);\n var endTimeMS = timedRange.end.valueOf() - endDay.valueOf(); // # of milliseconds into `endDay`\n // If the end time is actually inclusively part of the next day and is equal to or\n // beyond the next day threshold, adjust the end to be the exclusive end of `endDay`.\n // Otherwise, leaving it as inclusive will cause it to exclude `endDay`.\n if (endTimeMS && endTimeMS >= asRoughMs(nextDayThreshold)) {\n endDay = addDays(endDay, 1);\n }\n }\n if (timedRange.start) {\n startDay = startOfDay(timedRange.start); // the beginning of the day the range starts\n // If end is within `startDay` but not past nextDayThreshold, assign the default duration of one day.\n if (endDay && endDay <= startDay) {\n endDay = addDays(startDay, 1);\n }\n }\n return { start: startDay, end: endDay };\n }", "function computeVisibleDayRange(timedRange, nextDayThreshold) {\n if (nextDayThreshold === void 0) { nextDayThreshold = createDuration(0); }\n var startDay = null;\n var endDay = null;\n if (timedRange.end) {\n endDay = startOfDay(timedRange.end);\n var endTimeMS = timedRange.end.valueOf() - endDay.valueOf(); // # of milliseconds into `endDay`\n // If the end time is actually inclusively part of the next day and is equal to or\n // beyond the next day threshold, adjust the end to be the exclusive end of `endDay`.\n // Otherwise, leaving it as inclusive will cause it to exclude `endDay`.\n if (endTimeMS && endTimeMS >= asRoughMs(nextDayThreshold)) {\n endDay = addDays(endDay, 1);\n }\n }\n if (timedRange.start) {\n startDay = startOfDay(timedRange.start); // the beginning of the day the range starts\n // If end is within `startDay` but not past nextDayThreshold, assign the default duration of one day.\n if (endDay && endDay <= startDay) {\n endDay = addDays(startDay, 1);\n }\n }\n return { start: startDay, end: endDay };\n }", "function computeVisibleDayRange(timedRange, nextDayThreshold) {\n if (nextDayThreshold === void 0) { nextDayThreshold = createDuration(0); }\n var startDay = null;\n var endDay = null;\n if (timedRange.end) {\n endDay = startOfDay(timedRange.end);\n var endTimeMS = timedRange.end.valueOf() - endDay.valueOf(); // # of milliseconds into `endDay`\n // If the end time is actually inclusively part of the next day and is equal to or\n // beyond the next day threshold, adjust the end to be the exclusive end of `endDay`.\n // Otherwise, leaving it as inclusive will cause it to exclude `endDay`.\n if (endTimeMS && endTimeMS >= asRoughMs(nextDayThreshold)) {\n endDay = addDays(endDay, 1);\n }\n }\n if (timedRange.start) {\n startDay = startOfDay(timedRange.start); // the beginning of the day the range starts\n // If end is within `startDay` but not past nextDayThreshold, assign the default duration of one day.\n if (endDay && endDay <= startDay) {\n endDay = addDays(startDay, 1);\n }\n }\n return { start: startDay, end: endDay };\n }", "function computeVisibleDayRange$1(timedRange, nextDayThreshold) {\n if (nextDayThreshold === void 0) { nextDayThreshold = createDuration$1(0); }\n var startDay = null;\n var endDay = null;\n if (timedRange.end) {\n endDay = startOfDay$1(timedRange.end);\n var endTimeMS = timedRange.end.valueOf() - endDay.valueOf(); // # of milliseconds into `endDay`\n // If the end time is actually inclusively part of the next day and is equal to or\n // beyond the next day threshold, adjust the end to be the exclusive end of `endDay`.\n // Otherwise, leaving it as inclusive will cause it to exclude `endDay`.\n if (endTimeMS && endTimeMS >= asRoughMs$1(nextDayThreshold)) {\n endDay = addDays$1(endDay, 1);\n }\n }\n if (timedRange.start) {\n startDay = startOfDay$1(timedRange.start); // the beginning of the day the range starts\n // If end is within `startDay` but not past nextDayThreshold, assign the default duration of one day.\n if (endDay && endDay <= startDay) {\n endDay = addDays$1(startDay, 1);\n }\n }\n return { start: startDay, end: endDay };\n }", "function computeVisibleDayRange(timedRange, nextDayThreshold) {\n if (nextDayThreshold === void 0) {\n nextDayThreshold = duration_1.createDuration(0);\n }\n\n var startDay = null;\n var endDay = null;\n\n if (timedRange.end) {\n endDay = marker_1.startOfDay(timedRange.end);\n var endTimeMS = timedRange.end.valueOf() - endDay.valueOf(); // # of milliseconds into `endDay`\n // If the end time is actually inclusively part of the next day and is equal to or\n // beyond the next day threshold, adjust the end to be the exclusive end of `endDay`.\n // Otherwise, leaving it as inclusive will cause it to exclude `endDay`.\n\n if (endTimeMS && endTimeMS >= duration_1.asRoughMs(nextDayThreshold)) {\n endDay = marker_1.addDays(endDay, 1);\n }\n }\n\n if (timedRange.start) {\n startDay = marker_1.startOfDay(timedRange.start); // the beginning of the day the range starts\n // If end is within `startDay` but not past nextDayThreshold, assign the default duration of one day.\n\n if (endDay && endDay <= startDay) {\n endDay = marker_1.addDays(startDay, 1);\n }\n }\n\n return {\n start: startDay,\n end: endDay\n };\n }", "function normalizeEventRangeTimes(range) {\n\t\tif (range.allDay == null) {\n\t\t\trange.allDay = !(range.start.hasTime() || (range.end && range.end.hasTime()));\n\t\t}\n\n\t\tif (range.allDay) {\n\t\t\trange.start.stripTime();\n\t\t\tif (range.end) {\n\t\t\t\t// TODO: consider nextDayThreshold here? If so, will require a lot of testing and adjustment\n\t\t\t\trange.end.stripTime();\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif (!range.start.hasTime()) {\n\t\t\t\trange.start = t.rezoneDate(range.start); // will assign a 00:00 time\n\t\t\t}\n\t\t\tif (range.end && !range.end.hasTime()) {\n\t\t\t\trange.end = t.rezoneDate(range.end); // will assign a 00:00 time\n\t\t\t}\n\t\t}\n\t}", "function normalizeEventRangeTimes(range) {\n if (range.allDay == null) {\n range.allDay = !(range.start.hasTime() || (range.end && range.end.hasTime()));\n }\n\n if (range.allDay) {\n range.start.stripTime();\n if (range.end) {\n // TODO: consider nextDayThreshold here? If so, will require a lot of testing and adjustment\n range.end.stripTime();\n }\n }\n else {\n if (!range.start.hasTime()) {\n range.start = t.rezoneDate(range.start); // will assign a 00:00 time\n }\n if (range.end && !range.end.hasTime()) {\n range.end = t.rezoneDate(range.end); // will assign a 00:00 time\n }\n }\n }", "findShallowIntersectingRange(date1, date2) {\n const thisRange = date1.toRange();\n const otherRange = date2.toRange(); // Start with infinite start and end dates\n\n let start = null;\n let end = null; // This start date exists\n\n if (thisRange.start) {\n // Use this definite start date if other start date is infinite\n if (!otherRange.start) {\n start = thisRange.start;\n } else {\n // Otherwise, use the earliest start date\n start = thisRange.start < otherRange.start ? thisRange.start : otherRange.start;\n } // Other start date exists\n\n } else if (otherRange.start) {\n // Use other definite start date as this one is infinite\n start = otherRange.start;\n } // Assign end date to this one if it is valid\n\n\n if (thisRange.end && (!start || thisRange.end >= start)) {\n end = thisRange.end;\n } // Assign end date to other one if it is valid and before this one\n\n\n if (otherRange.end && (!start || otherRange.end >= start)) {\n if (!end || otherRange.end < end) end = otherRange.end;\n } // Return calculated range\n\n\n return {\n start,\n end\n };\n }", "findShallowIntersectingRange(date1, date2) {\n const thisRange = date1.toRange();\n const otherRange = date2.toRange(); // Start with infinite start and end dates\n\n let start = null;\n let end = null; // This start date exists\n\n if (thisRange.start) {\n // Use this definite start date if other start date is infinite\n if (!otherRange.start) {\n start = thisRange.start;\n } else {\n // Otherwise, use the earliest start date\n start = thisRange.start < otherRange.start ? thisRange.start : otherRange.start;\n } // Other start date exists\n\n } else if (otherRange.start) {\n // Use other definite start date as this one is infinite\n start = otherRange.start;\n } // Assign end date to this one if it is valid\n\n\n if (thisRange.end && (!start || thisRange.end >= start)) {\n end = thisRange.end;\n } // Assign end date to other one if it is valid and before this one\n\n\n if (otherRange.end && (!start || otherRange.end >= start)) {\n if (!end || otherRange.end < end) end = otherRange.end;\n } // Return calculated range\n\n\n return {\n start,\n end\n };\n }", "getTimeRange(){\n let start = this.props.startTime instanceof IntegerTime ? this.props.startTime: IntegerTime.fromArmyTime(this.props.startTime);\n let end = this.props.endTime instanceof IntegerTime ? this.props.endTime: IntegerTime.fromArmyTime(this.props.endTime);\n return new IntegerTimeInterval(start, end);\n }", "function makeRange() {\n var result = {}\n /*\n year: 2015,\n month: [3, 4],\n days: [[30, 31], [1,2,3,4,5,6]],\n */\n ;\n\n var startDate = new Date($scope.range.start);\n var endDate = new Date($scope.range.end);\n\n var yearNum = startDate.getFullYear();\n\n var startDay = startDate.getDate();\n var endDay = endDate.getDate();\n\n\n var startMonthNum = (startDate.getMonth() + 1);\n var endMonthNum = (endDate.getMonth() + 1);\n\n var daysInStartDate = new Date(yearNum, startMonthNum, 0).getDate();\n\n //define month array\n console.log(startMonthNum + ' - ' + endMonthNum);\n if(startMonthNum === endMonthNum) {\n month = [startMonthNum, null];\n } else {\n month = [startMonthNum, endMonthNum];\n }\n\n //define days array\n var days = [[],[]];\n\n if(month[1] === null) {\n for(var i = startDay; i <= endDay; i++) {\n days[0].push(i);\n }\n\n days[1] = null;\n } else {\n for(var i = startDay; i <= daysInStartDate; i++) {\n days[0].push(i);\n }\n\n for(var j = 1; j <= endDay; j++){\n days[1].push(j);\n }\n }\n\n result.year = yearNum;\n result.month = month;\n result.days = days;\n\n return result;\n }", "function expandEvent(abstractEvent, _rangeStart, _rangeEnd) {\n var events = [];\n var dowHash;\n var dow;\n var i;\n var date;\n var startTime, endTime;\n var start, end;\n var event;\n\n _rangeStart = _rangeStart || rangeStart;\n _rangeEnd = _rangeEnd || rangeEnd;\n\n if (abstractEvent) {\n if (abstractEvent._recurring) {\n\n // make a boolean hash as to whether the event occurs on each day-of-week\n if ((dow = abstractEvent.dow)) {\n dowHash = {};\n for (i = 0; i < dow.length; i++) {\n dowHash[dow[i]] = true;\n }\n }\n\n // iterate through every day in the current range\n date = _rangeStart.clone().stripTime(); // holds the date of the current day\n while (date.isBefore(_rangeEnd)) {\n\n if (!dowHash || dowHash[date.day()]) { // if everyday, or this particular day-of-week\n\n startTime = abstractEvent.start; // the stored start and end properties are times (Durations)\n endTime = abstractEvent.end; // \"\n start = date.clone();\n end = null;\n\n if (startTime) {\n start = start.time(startTime);\n }\n if (endTime) {\n end = date.clone().time(endTime);\n }\n\n event = $.extend({}, abstractEvent); // make a copy of the original\n assignDatesToEvent(\n start, end,\n !startTime && !endTime, // allDay?\n event\n );\n events.push(event);\n }\n\n date.add(1, 'days');\n }\n }\n else {\n events.push(abstractEvent); // return the original event. will be a one-item array\n }\n }\n\n return events;\n }", "function g(a,b,c,d){var e,f,g,j,k=a._allDay,l=a._start,m=a._end,n=!1;\n// if no new dates were passed in, compare against the event's existing dates\n// NOTE: throughout this function, the initial values of `newStart` and `newEnd` are\n// preserved. These values may be undefined.\n// detect new allDay\n// if value has changed, use it\n// normalize the new dates based on allDay\n// compute dateDelta\n// if allDay has changed, always throw away the end\n// new duration\n// subtract old duration\n// get events with this ID\nreturn c||d||(c=a.start,d=a.end),e=a.allDay!=k?a.allDay:!(c||d).hasTime(),e&&(c&&(c=c.clone().stripTime()),d&&(d=d.clone().stripTime())),c&&(f=e?o(c,l.clone().stripTime()):o(c,l)),e!=k?n=!0:d&&(g=o(d||i.getDefaultEventEnd(e,c||l),c||l).subtract(o(m||i.getDefaultEventEnd(k,l),l))),j=h(i.clientEvents(a._id),n,e,f,g,b),{dateDelta:f,durationDelta:g,undo:j}}", "function expandEvent(abstractEvent, _rangeStart, _rangeEnd) {\n\t\t\tvar events = [];\n\t\t\tvar dowHash;\n\t\t\tvar dow;\n\t\t\tvar i;\n\t\t\tvar date;\n\t\t\tvar startTime, endTime;\n\t\t\tvar start, end;\n\t\t\tvar event;\n\n\t\t\t_rangeStart = _rangeStart || rangeStart;\n\t\t\t_rangeEnd = _rangeEnd || rangeEnd;\n\n\t\t\tif (abstractEvent) {\n\t\t\t\tif (abstractEvent._recurring) {\n\n\t\t\t\t\t// make a boolean hash as to whether the event occurs on each day-of-week\n\t\t\t\t\tif ((dow = abstractEvent.dow)) {\n\t\t\t\t\t\tdowHash = {};\n\t\t\t\t\t\tfor (i = 0; i < dow.length; i++) {\n\t\t\t\t\t\t\tdowHash[dow[i]] = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// iterate through every day in the current range\n\t\t\t\t\tdate = _rangeStart.clone().stripTime(); // holds the date of the current day\n\t\t\t\t\twhile (date.isBefore(_rangeEnd)) {\n\n\t\t\t\t\t\tif (!dowHash || dowHash[date.day()]) { // if everyday, or this particular day-of-week\n\n\t\t\t\t\t\t\tstartTime = abstractEvent.start; // the stored start and end properties are times (Durations)\n\t\t\t\t\t\t\tendTime = abstractEvent.end; // \"\n\t\t\t\t\t\t\tstart = date.clone();\n\t\t\t\t\t\t\tend = null;\n\n\t\t\t\t\t\t\tif (startTime) {\n\t\t\t\t\t\t\t\tstart = start.time(startTime);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (endTime) {\n\t\t\t\t\t\t\t\tend = date.clone().time(endTime);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tevent = $.extend({}, abstractEvent); // make a copy of the original\n\t\t\t\t\t\t\tassignDatesToEvent(\n\t\t\t\t\t\t\t\tstart, end,\n\t\t\t\t\t\t\t\t!startTime && !endTime, // allDay?\n\t\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tevents.push(event);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdate.add(1, 'days');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tevents.push(abstractEvent); // return the original event. will be a one-item array\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn events;\n\t\t}", "function expandEvent(abstractEvent, _rangeStart, _rangeEnd) {\n\t\tvar events = [];\n\t\tvar dowHash;\n\t\tvar dow;\n\t\tvar i;\n\t\tvar date;\n\t\tvar startTime, endTime;\n\t\tvar start, end;\n\t\tvar event;\n\n\t\t_rangeStart = _rangeStart || rangeStart;\n\t\t_rangeEnd = _rangeEnd || rangeEnd;\n\n\t\tif (abstractEvent) {\n\t\t\tif (abstractEvent._recurring) {\n\n\t\t\t\t// make a boolean hash as to whether the event occurs on each day-of-week\n\t\t\t\tif ((dow = abstractEvent.dow)) {\n\t\t\t\t\tdowHash = {};\n\t\t\t\t\tfor (i = 0; i < dow.length; i++) {\n\t\t\t\t\t\tdowHash[dow[i]] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// iterate through every day in the current range\n\t\t\t\tdate = _rangeStart.clone().stripTime(); // holds the date of the current day\n\t\t\t\twhile (date.isBefore(_rangeEnd)) {\n\n\t\t\t\t\tif (!dowHash || dowHash[date.day()]) { // if everyday, or this particular day-of-week\n\n\t\t\t\t\t\tstartTime = abstractEvent.start; // the stored start and end properties are times (Durations)\n\t\t\t\t\t\tendTime = abstractEvent.end; // \"\n\t\t\t\t\t\tstart = date.clone();\n\t\t\t\t\t\tend = null;\n\n\t\t\t\t\t\tif (startTime) {\n\t\t\t\t\t\t\tstart = start.time(startTime);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (endTime) {\n\t\t\t\t\t\t\tend = date.clone().time(endTime);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tevent = $.extend({}, abstractEvent); // make a copy of the original\n\t\t\t\t\t\tassignDatesToEvent(\n\t\t\t\t\t\t\tstart, end,\n\t\t\t\t\t\t\t!startTime && !endTime, // allDay?\n\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t);\n\t\t\t\t\t\tevents.push(event);\n\t\t\t\t\t}\n\n\t\t\t\t\tdate.add(1, 'days');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tevents.push(abstractEvent); // return the original event. will be a one-item array\n\t\t\t}\n\t\t}\n\n\t\treturn events;\n\t}", "function expandEvent(abstractEvent, _rangeStart, _rangeEnd) {\n\t\tvar events = [];\n\t\tvar dowHash;\n\t\tvar dow;\n\t\tvar i;\n\t\tvar date;\n\t\tvar startTime, endTime;\n\t\tvar start, end;\n\t\tvar event;\n\n\t\t_rangeStart = _rangeStart || rangeStart;\n\t\t_rangeEnd = _rangeEnd || rangeEnd;\n\n\t\tif (abstractEvent) {\n\t\t\tif (abstractEvent._recurring) {\n\n\t\t\t\t// make a boolean hash as to whether the event occurs on each day-of-week\n\t\t\t\tif ((dow = abstractEvent.dow)) {\n\t\t\t\t\tdowHash = {};\n\t\t\t\t\tfor (i = 0; i < dow.length; i++) {\n\t\t\t\t\t\tdowHash[dow[i]] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// iterate through every day in the current range\n\t\t\t\tdate = _rangeStart.clone().stripTime(); // holds the date of the current day\n\t\t\t\twhile (date.isBefore(_rangeEnd)) {\n\n\t\t\t\t\tif (!dowHash || dowHash[date.day()]) { // if everyday, or this particular day-of-week\n\n\t\t\t\t\t\tstartTime = abstractEvent.start; // the stored start and end properties are times (Durations)\n\t\t\t\t\t\tendTime = abstractEvent.end; // \"\n\t\t\t\t\t\tstart = date.clone();\n\t\t\t\t\t\tend = null;\n\n\t\t\t\t\t\tif (startTime) {\n\t\t\t\t\t\t\tstart = start.time(startTime);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (endTime) {\n\t\t\t\t\t\t\tend = date.clone().time(endTime);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tevent = $.extend({}, abstractEvent); // make a copy of the original\n\t\t\t\t\t\tassignDatesToEvent(\n\t\t\t\t\t\t\tstart, end,\n\t\t\t\t\t\t\t!startTime && !endTime, // allDay?\n\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t);\n\t\t\t\t\t\tevents.push(event);\n\t\t\t\t\t}\n\n\t\t\t\t\tdate.add(1, 'days');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tevents.push(abstractEvent); // return the original event. will be a one-item array\n\t\t\t}\n\t\t}\n\n\t\treturn events;\n\t}", "function expandEvent(abstractEvent, _rangeStart, _rangeEnd) {\n\t\tvar events = [];\n\t\tvar dowHash;\n\t\tvar dow;\n\t\tvar i;\n\t\tvar date;\n\t\tvar startTime, endTime;\n\t\tvar start, end;\n\t\tvar event;\n\n\t\t_rangeStart = _rangeStart || rangeStart;\n\t\t_rangeEnd = _rangeEnd || rangeEnd;\n\n\t\tif (abstractEvent) {\n\t\t\tif (abstractEvent._recurring) {\n\n\t\t\t\t// make a boolean hash as to whether the event occurs on each day-of-week\n\t\t\t\tif ((dow = abstractEvent.dow)) {\n\t\t\t\t\tdowHash = {};\n\t\t\t\t\tfor (i = 0; i < dow.length; i++) {\n\t\t\t\t\t\tdowHash[dow[i]] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// iterate through every day in the current range\n\t\t\t\tdate = _rangeStart.clone().stripTime(); // holds the date of the current day\n\t\t\t\twhile (date.isBefore(_rangeEnd)) {\n\n\t\t\t\t\tif (!dowHash || dowHash[date.day()]) { // if everyday, or this particular day-of-week\n\n\t\t\t\t\t\tstartTime = abstractEvent.start; // the stored start and end properties are times (Durations)\n\t\t\t\t\t\tendTime = abstractEvent.end; // \"\n\t\t\t\t\t\tstart = date.clone();\n\t\t\t\t\t\tend = null;\n\n\t\t\t\t\t\tif (startTime) {\n\t\t\t\t\t\t\tstart = start.time(startTime);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (endTime) {\n\t\t\t\t\t\t\tend = date.clone().time(endTime);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tevent = $.extend({}, abstractEvent); // make a copy of the original\n\t\t\t\t\t\tassignDatesToEvent(\n\t\t\t\t\t\t\tstart, end,\n\t\t\t\t\t\t\t!startTime && !endTime, // allDay?\n\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t);\n\t\t\t\t\t\tevents.push(event);\n\t\t\t\t\t}\n\n\t\t\t\t\tdate.add(1, 'days');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tevents.push(abstractEvent); // return the original event. will be a one-item array\n\t\t\t}\n\t\t}\n\n\t\treturn events;\n\t}", "function expandEvent(abstractEvent, _rangeStart, _rangeEnd) {\n\t\tvar events = [];\n\t\tvar dowHash;\n\t\tvar dow;\n\t\tvar i;\n\t\tvar date;\n\t\tvar startTime, endTime;\n\t\tvar start, end;\n\t\tvar event;\n\n\t\t_rangeStart = _rangeStart || rangeStart;\n\t\t_rangeEnd = _rangeEnd || rangeEnd;\n\n\t\tif (abstractEvent) {\n\t\t\tif (abstractEvent._recurring) {\n\n\t\t\t\t// make a boolean hash as to whether the event occurs on each day-of-week\n\t\t\t\tif ((dow = abstractEvent.dow)) {\n\t\t\t\t\tdowHash = {};\n\t\t\t\t\tfor (i = 0; i < dow.length; i++) {\n\t\t\t\t\t\tdowHash[dow[i]] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// iterate through every day in the current range\n\t\t\t\tdate = _rangeStart.clone().stripTime(); // holds the date of the current day\n\t\t\t\twhile (date.isBefore(_rangeEnd)) {\n\n\t\t\t\t\tif (!dowHash || dowHash[date.day()]) { // if everyday, or this particular day-of-week\n\n\t\t\t\t\t\tstartTime = abstractEvent.start; // the stored start and end properties are times (Durations)\n\t\t\t\t\t\tendTime = abstractEvent.end; // \"\n\t\t\t\t\t\tstart = date.clone();\n\t\t\t\t\t\tend = null;\n\n\t\t\t\t\t\tif (startTime) {\n\t\t\t\t\t\t\tstart = start.time(startTime);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (endTime) {\n\t\t\t\t\t\t\tend = date.clone().time(endTime);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tevent = $.extend({}, abstractEvent); // make a copy of the original\n\t\t\t\t\t\tassignDatesToEvent(\n\t\t\t\t\t\t\tstart, end,\n\t\t\t\t\t\t\t!startTime && !endTime, // allDay?\n\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t);\n\t\t\t\t\t\tevents.push(event);\n\t\t\t\t\t}\n\n\t\t\t\t\tdate.add(1, 'days');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tevents.push(abstractEvent); // return the original event. will be a one-item array\n\t\t\t}\n\t\t}\n\n\t\treturn events;\n\t}", "function expandEvent(abstractEvent, _rangeStart, _rangeEnd) {\n\t\tvar events = [];\n\t\tvar dowHash;\n\t\tvar dow;\n\t\tvar i;\n\t\tvar date;\n\t\tvar startTime, endTime;\n\t\tvar start, end;\n\t\tvar event;\n\n\t\t_rangeStart = _rangeStart || rangeStart;\n\t\t_rangeEnd = _rangeEnd || rangeEnd;\n\n\t\tif (abstractEvent) {\n\t\t\tif (abstractEvent._recurring) {\n\n\t\t\t\t// make a boolean hash as to whether the event occurs on each day-of-week\n\t\t\t\tif ((dow = abstractEvent.dow)) {\n\t\t\t\t\tdowHash = {};\n\t\t\t\t\tfor (i = 0; i < dow.length; i++) {\n\t\t\t\t\t\tdowHash[dow[i]] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// iterate through every day in the current range\n\t\t\t\tdate = _rangeStart.clone().stripTime(); // holds the date of the current day\n\t\t\t\twhile (date.isBefore(_rangeEnd)) {\n\n\t\t\t\t\tif (!dowHash || dowHash[date.day()]) { // if everyday, or this particular day-of-week\n\n\t\t\t\t\t\tstartTime = abstractEvent.start; // the stored start and end properties are times (Durations)\n\t\t\t\t\t\tendTime = abstractEvent.end; // \"\n\t\t\t\t\t\tstart = date.clone();\n\t\t\t\t\t\tend = null;\n\n\t\t\t\t\t\tif (startTime) {\n\t\t\t\t\t\t\tstart = start.time(startTime);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (endTime) {\n\t\t\t\t\t\t\tend = date.clone().time(endTime);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tevent = $.extend({}, abstractEvent); // make a copy of the original\n\t\t\t\t\t\tassignDatesToEvent(\n\t\t\t\t\t\t\tstart, end,\n\t\t\t\t\t\t\t!startTime && !endTime, // allDay?\n\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t);\n\t\t\t\t\t\tevents.push(event);\n\t\t\t\t\t}\n\n\t\t\t\t\tdate.add(1, 'days');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tevents.push(abstractEvent); // return the original event. will be a one-item array\n\t\t\t}\n\t\t}\n\n\t\treturn events;\n\t}", "function expandEvent(abstractEvent, _rangeStart, _rangeEnd) {\n\t\tvar events = [];\n\t\tvar dowHash;\n\t\tvar dow;\n\t\tvar i;\n\t\tvar date;\n\t\tvar startTime, endTime;\n\t\tvar start, end;\n\t\tvar event;\n\n\t\t_rangeStart = _rangeStart || rangeStart;\n\t\t_rangeEnd = _rangeEnd || rangeEnd;\n\n\t\tif (abstractEvent) {\n\t\t\tif (abstractEvent._recurring) {\n\n\t\t\t\t// make a boolean hash as to whether the event occurs on each day-of-week\n\t\t\t\tif ((dow = abstractEvent.dow)) {\n\t\t\t\t\tdowHash = {};\n\t\t\t\t\tfor (i = 0; i < dow.length; i++) {\n\t\t\t\t\t\tdowHash[dow[i]] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// iterate through every day in the current range\n\t\t\t\tdate = _rangeStart.clone().stripTime(); // holds the date of the current day\n\t\t\t\twhile (date.isBefore(_rangeEnd)) {\n\n\t\t\t\t\tif (!dowHash || dowHash[date.day()]) { // if everyday, or this particular day-of-week\n\n\t\t\t\t\t\tstartTime = abstractEvent.start; // the stored start and end properties are times (Durations)\n\t\t\t\t\t\tendTime = abstractEvent.end; // \"\n\t\t\t\t\t\tstart = date.clone();\n\t\t\t\t\t\tend = null;\n\n\t\t\t\t\t\tif (startTime) {\n\t\t\t\t\t\t\tstart = start.time(startTime);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (endTime) {\n\t\t\t\t\t\t\tend = date.clone().time(endTime);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tevent = $.extend({}, abstractEvent); // make a copy of the original\n\t\t\t\t\t\tassignDatesToEvent(\n\t\t\t\t\t\t\tstart, end,\n\t\t\t\t\t\t\t!startTime && !endTime, // allDay?\n\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t);\n\t\t\t\t\t\tevents.push(event);\n\t\t\t\t\t}\n\n\t\t\t\t\tdate.add(1, 'days');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tevents.push(abstractEvent); // return the original event. will be a one-item array\n\t\t\t}\n\t\t}\n\n\t\treturn events;\n\t}", "floorDate(date, relativeToStart, resolutionUnit, incr) {\n relativeToStart = relativeToStart !== false;\n\n const me = this,\n relativeTo = relativeToStart ? DateHelper.clone(me.startDate) : null,\n increment = incr || me.resolutionIncrement,\n unit = resolutionUnit || (relativeToStart ? me.resolutionUnit : me.mainUnit),\n snap = (value, increment) => Math.floor(value / increment) * increment;\n\n if (relativeToStart) {\n const snappedDuration = snap(DateHelper.diff(relativeTo, date, unit), increment); // TODO: used to be small unit multipled with factor (minute = seconds, minutes * 60)\n\n return DateHelper.add(relativeTo, snappedDuration, unit);\n }\n\n let dt = DateHelper.clone(date);\n\n if (unit === 'week') {\n const day = dt.getDay() || 7,\n startDay = me.weekStartDay || 7;\n dt = DateHelper.add(DateHelper.startOf(dt, 'day'), day >= startDay ? startDay - day : -(7 - startDay + day), 'day'); // Watch out for Brazil DST craziness (see test 028_timeaxis_dst.t.js)\n\n if (dt.getDay() !== startDay && dt.getHours() === 23) {\n dt = DateHelper.add(dt, 1, 'hour');\n }\n } else {\n // removes \"smaller\" units from date (for example minutes; removes seconds and milliseconds)\n dt = DateHelper.startOf(dt, unit); // day and year are 1-based so need to make additional adjustments\n\n const modifier = ['day', 'year'].includes(unit) ? 1 : 0,\n useUnit = unit === 'day' ? 'date' : unit,\n snappedValue = snap(DateHelper.get(dt, useUnit) - modifier, increment) + modifier;\n dt = DateHelper.set(dt, useUnit, snappedValue);\n }\n\n return dt;\n }", "floorDate(date, relativeToStart, resolutionUnit, incr) {\n relativeToStart = relativeToStart !== false;\n\n const me = this,\n relativeTo = relativeToStart ? DateHelper.clone(me.startDate) : null,\n increment = incr || me.resolutionIncrement,\n unit = resolutionUnit || (relativeToStart ? me.resolutionUnit : me.mainUnit),\n snap = (value, increment) => Math.floor(value / increment) * increment;\n\n if (relativeToStart) {\n const snappedDuration = snap(DateHelper.diff(relativeTo, date, unit), increment);\n // TODO: used to be small unit multipled with factor (minute = seconds, minutes * 60)\n return DateHelper.add(relativeTo, snappedDuration, unit);\n }\n\n let dt = DateHelper.clone(date);\n\n if (unit === 'week') {\n let day = dt.getDay() || 7,\n startDay = me.weekStartDay || 7;\n\n dt = DateHelper.add(\n DateHelper.startOf(dt, 'day'),\n day >= startDay ? startDay - day : -(7 - startDay + day),\n 'day'\n );\n\n // Watch out for Brazil DST craziness (see test 028_timeaxis_dst.t.js)\n if (dt.getDay() !== startDay && dt.getHours() === 23) {\n dt = DateHelper.add(dt, 1, 'hour');\n }\n } else {\n // removes \"smaller\" units from date (for example minutes; removes seconds and milliseconds)\n dt = DateHelper.startOf(dt, unit);\n\n // day and year are 1-based so need to make additional adjustments\n let modifier = ['day', 'year'].includes(unit) ? 1 : 0,\n useUnit = unit === 'day' ? 'date' : unit,\n snappedValue = snap(DateHelper.get(dt, useUnit) - modifier, increment) + modifier;\n\n dt = DateHelper.set(dt, useUnit, snappedValue);\n }\n\n return dt;\n }", "function normalizeRange(range, tDateProfile, dateEnv) {\n if (!tDateProfile.isTimeScale) {\n range = Object(_fullcalendar_core__WEBPACK_IMPORTED_MODULE_0__[\"computeVisibleDayRange\"])(range);\n if (tDateProfile.largeUnit) {\n var dayRange = range; // preserve original result\n range = {\n start: dateEnv.startOf(range.start, tDateProfile.largeUnit),\n end: dateEnv.startOf(range.end, tDateProfile.largeUnit)\n };\n // if date is partially through the interval, or is in the same interval as the start,\n // make the exclusive end be the *next* interval\n if (range.end.valueOf() !== dayRange.end.valueOf() || range.end <= range.start) {\n range = {\n start: range.start,\n end: dateEnv.add(range.end, tDateProfile.slotDuration)\n };\n }\n }\n }\n return range;\n}", "function expandRecurringRanges(eventDef, duration, framingRange, dateEnv, recurringTypes) {\n var typeDef = recurringTypes[eventDef.recurringDef.typeId];\n var markers = typeDef.expand(eventDef.recurringDef.typeData, {\n start: dateEnv.subtract(framingRange.start, duration),\n end: framingRange.end\n }, dateEnv); // the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to\n\n if (eventDef.allDay) {\n markers = markers.map(startOfDay);\n }\n\n return markers;\n }", "function expandRecurringRanges(eventDef, framingRange, dateEnv) {\n var typeDef = recurringTypes[eventDef.recurringDef.typeId];\n var markers = typeDef.expand(eventDef.recurringDef.typeData, eventDef, framingRange, dateEnv); // the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to\n\n if (eventDef.allDay) {\n markers = markers.map(marker_1.startOfDay);\n }\n\n return markers;\n }", "function getDaysArray (start, end) {\n for(var dt=new Date(start); dt<=end; dt.setDate(dt.getDate()+1)){\n groundTruthCopy.push({date: new Date(dt), y: -999});\n }\n }", "function w(c,d,e,f,g){var h=x.getIsAmbigTimezone(),i=[];return a.each(c,function(a,c){var j=c._allDay,l=c._start,m=c._end,n=null!=e?e:j,o=l.clone(),p=!d&&m?m.clone():null;\n// NOTE: this function is responsible for transforming `newStart` and `newEnd`,\n// which were initialized to the OLD values first. `newEnd` may be null.\n// normlize newStart/newEnd to be consistent with newAllDay\nn?(o.stripTime(),p&&p.stripTime()):(o.hasTime()||(o=x.rezoneDate(o)),p&&!p.hasTime()&&(p=x.rezoneDate(p))),\n// ensure we have an end date if necessary\np||!b.forceEventDuration&&!+g||(p=x.getDefaultEventEnd(n,o)),\n// translate the dates\no.add(f),p&&p.add(f).add(g),\n// if the dates have changed, and we know it is impossible to recompute the\n// timezone offsets, strip the zone.\nh&&(+f||+g)&&(o.stripZone(),p&&p.stripZone()),c.allDay=n,c.start=o,c.end=p,k(c),i.push(function(){c.allDay=j,c.start=l,c.end=m,k(c)})}),function(){for(var a=0;a<i.length;a++)i[a]()}}// assumed to be a calendar", "function h(c,d,e,f,g,h){var j=i.getIsAmbigTimezone(),l=[];return a.each(c,function(a,c){var m=c.resources,n=c._allDay,o=c._start,p=c._end,q=null!=e?e:n,r=o.clone(),s=!d&&p?p.clone():null;\n// NOTE: this function is responsible for transforming `newStart` and `newEnd`,\n// which were initialized to the OLD values first. `newEnd` may be null.\n// normlize newStart/newEnd to be consistent with newAllDay\nq?(r.stripTime(),s&&s.stripTime()):(r.hasTime()||(r=i.rezoneDate(r)),s&&!s.hasTime()&&(s=i.rezoneDate(s))),\n// ensure we have an end date if necessary\ns||!b.forceEventDuration&&!+g||(s=i.getDefaultEventEnd(q,r)),\n// translate the dates\nr.add(f),s&&s.add(f).add(g),\n// if the dates have changed, and we know it is impossible to recompute the\n// timezone offsets, strip the zone.\nj&&(+f||+g)&&(r.stripZone(),s&&s.stripZone()),c.allDay=q,c.start=r,c.end=s,c.resources=h,k(c),l.push(function(){c.allDay=n,c.start=o,c.end=p,c.resources=m,k(c)})}),function(){for(var a=0;a<l.length;a++)l[a]()}}", "function mergeRangesBruteForce(meetings) {\n if (meetings.length <= 0) {\n return meetings;\n }\n\n // Step 1: calculate min startTime and max endTime\n var minStartTime = meetings[0].startTime;\n var maxEndTime = meetings[0].endTime;\n for (var i = 1; i < meetings.length; i++) {\n if (meetings[i].startTime < minStartTime) {\n minStartTime = meetings[i].startTime;\n }\n if (meetings[i].endTime > maxEndTime) {\n maxEndTime = meetings[i].endTime;\n }\n }\n\n // Step 2: allocate array representing the full day, then fill in which times are full\n var fullDay = [];\n for (var i = 0; i < meetings.length; i++) {\n for (var j = meetings[i].startTime; j <= meetings[i].endTime; j++) {\n fullDay[j - minStartTime] = true;\n }\n }\n \n // Step 3: perform actual \"merging\" by outputting new meeting blocks\n var outputMeetings = [];\n var startTime = minStartTime;\n var endTime = minStartTime;\n for (var i = minStartTime; i <= maxEndTime; i++) {\n if (!fullDay[i - minStartTime]) {\n if (startTime != endTime) {\n outputMeetings.push({startTime: startTime, endTime: endTime});\n }\n if (i + 1 > maxEndTime) {\n break;\n }\n startTime = i + 1;\n endTime = i + 1;\n i = i + 1;\n }\n endTime = i;\n }\n if (startTime != endTime) {\n outputMeetings.push({startTime: startTime, endTime: endTime});\n }\n return outputMeetings;\n}", "function expandRecurringRanges(eventDef, duration, framingRange, dateEnv, recurringTypes) {\n var typeDef = recurringTypes[eventDef.recurringDef.typeId];\n var markers = typeDef.expand(eventDef.recurringDef.typeData, {\n start: dateEnv.subtract(framingRange.start, duration),\n end: framingRange.end\n }, dateEnv);\n // the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to\n if (eventDef.allDay) {\n markers = markers.map(startOfDay);\n }\n return markers;\n}", "function expandRecurringRanges(eventDef, duration, framingRange, dateEnv, recurringTypes) {\n var typeDef = recurringTypes[eventDef.recurringDef.typeId];\n var markers = typeDef.expand(eventDef.recurringDef.typeData, {\n start: dateEnv.subtract(framingRange.start, duration),\n end: framingRange.end\n }, dateEnv);\n // the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to\n if (eventDef.allDay) {\n markers = markers.map(startOfDay);\n }\n return markers;\n }", "function expandRecurringRanges(eventDef, duration, framingRange, dateEnv, recurringTypes) {\n var typeDef = recurringTypes[eventDef.recurringDef.typeId];\n var markers = typeDef.expand(eventDef.recurringDef.typeData, {\n start: dateEnv.subtract(framingRange.start, duration),\n end: framingRange.end\n }, dateEnv);\n // the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to\n if (eventDef.allDay) {\n markers = markers.map(startOfDay);\n }\n return markers;\n }", "function expandRecurringRanges(eventDef, duration, framingRange, dateEnv, recurringTypes) {\n var typeDef = recurringTypes[eventDef.recurringDef.typeId];\n var markers = typeDef.expand(eventDef.recurringDef.typeData, {\n start: dateEnv.subtract(framingRange.start, duration),\n end: framingRange.end,\n }, dateEnv);\n // the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to\n if (eventDef.allDay) {\n markers = markers.map(startOfDay);\n }\n return markers;\n }", "buildRenderRange(currentRange, currentRangeUnit, isRangeAllDay) {\n let renderRange = super.buildRenderRange(currentRange, currentRangeUnit, isRangeAllDay);\n let { props } = this;\n return buildDayTableRenderRange({\n currentRange: renderRange,\n snapToWeek: /^(year|month)$/.test(currentRangeUnit),\n fixedWeekCount: props.fixedWeekCount,\n dateEnv: props.dateEnv,\n });\n }", "function dateRangeCalculator(){\n\n\t//start date\n\n\t//end date\n\n\t//Api call request that reloads page/section based off of time span requested OR trimming original data object/array based off of new specified date range \n\n\n}", "findRangeofDates(){ \n\t\tlet min=new Date(2030,1,1); \n\t\tlet max=new Date(1990,1,1);\n\t\tconst ar=this.props.data;\n\t\tfor(let i=0;i<ar.length;i++){\n\t\t\tif(ar[i].start<min)\n\t\t\t\tmin=ar[i].start;\n\t\t\tif(ar[i].end>max)\n\t\t\t\tmax=ar[i].end;\n\t\t}\n\t\tthis.min=min;\n\t\tthis.max=max;\n\t}", "function toIntervals(times) {\n var start_day = new Date();\n start_day.setTime(times[0]);\n resetDay(start_day);\n \n var next_day = new Date();\n next_day.setTime(times[0]);\n next_day.setDate(next_day.getDate() + 1);\n resetDay(next_day);\n \n var start_i = 0;\n var intervals = [];\n var TIME_GAP = 25*60*1000; // 25m in ms\n var MS_PER_1H = 60*60*1000;\n for (var i=1; i<=times.length; i++) {\n // Check if we need to close the current interval because there's a\n // gap >25m\n if (i == times.length || (times[i] - times[i-1]) > TIME_GAP) {\n // times[i] is the first time that's outside the interval starting\n // at timest[start_i]\n if ((times[i-1] - times[start_i]) > MS_PER_1H) {\n // The interval starting at times start_i has non-zero duration\n // (i.e. it consists of more times than just times[start_i])\n // Add it to the result.\n var start = times[start_i] - start_day.getTime(),\n end = times[i-1] - start_day.getTime();\n intervals.push(new I(start, end));\n }\n start_i = i; // Start a new interval at i\n }\n \n // Check if we need to close the current interval because it crosses\n // the end of a day\n // if (times[i].getTime > )\n }\n return intervals;\n}", "function expandRecurringRanges$1(eventDef, duration, framingRange, dateEnv, recurringTypes) {\n var typeDef = recurringTypes[eventDef.recurringDef.typeId];\n var markers = typeDef.expand(eventDef.recurringDef.typeData, {\n start: dateEnv.subtract(framingRange.start, duration),\n end: framingRange.end\n }, dateEnv);\n // the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to\n if (eventDef.allDay) {\n markers = markers.map(startOfDay$1);\n }\n return markers;\n }", "function expandRecurringRanges(eventDef, framingRange, dateEnv, recurringTypes) {\n var typeDef = recurringTypes[eventDef.recurringDef.typeId];\n var markers = typeDef.expand(eventDef.recurringDef.typeData, framingRange, dateEnv);\n // the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to\n if (eventDef.allDay) {\n markers = markers.map(startOfDay);\n }\n return markers;\n }", "function rangeToSegments(start, end) {\n\n\t\tvar rowCnt = t.getRowCnt();\n\t\tvar colCnt = t.getColCnt();\n\t\tvar segments = []; // array of segments to return\n\n\t\t// day offset for given date range\n\t\tvar rangeDayOffsetStart = dateToDayOffset(start);\n\t\tvar rangeDayOffsetEnd = dateToDayOffset(end); // an exclusive value\n\t\tvar endTimeMS = +end.time();\n\t\tif (endTimeMS && endTimeMS >= nextDayThreshold) {\n\t\t\trangeDayOffsetEnd++;\n\t\t}\n\t\trangeDayOffsetEnd = Math.max(rangeDayOffsetEnd, rangeDayOffsetStart + 1);\n\n\t\t// first and last cell offset for the given date range\n\t\t// \"last\" implies inclusivity\n\t\tvar rangeCellOffsetFirst = dayOffsetToCellOffset(rangeDayOffsetStart);\n\t\tvar rangeCellOffsetLast = dayOffsetToCellOffset(rangeDayOffsetEnd) - 1;\n\n\t\t// loop through all the rows in the view\n\t\tfor (var row=0; row<rowCnt; row++) {\n\n\t\t\t// first and last cell offset for the row\n\t\t\tvar rowCellOffsetFirst = row * colCnt;\n\t\t\tvar rowCellOffsetLast = rowCellOffsetFirst + colCnt - 1;\n\n\t\t\t// get the segment's cell offsets by constraining the range's cell offsets to the bounds of the row\n\t\t\tvar segmentCellOffsetFirst = Math.max(rangeCellOffsetFirst, rowCellOffsetFirst);\n\t\t\tvar segmentCellOffsetLast = Math.min(rangeCellOffsetLast, rowCellOffsetLast);\n\n\t\t\t// make sure segment's offsets are valid and in view\n\t\t\tif (segmentCellOffsetFirst <= segmentCellOffsetLast) {\n\n\t\t\t\t// translate to cells\n\t\t\t\tvar segmentCellFirst = cellOffsetToCell(segmentCellOffsetFirst);\n\t\t\t\tvar segmentCellLast = cellOffsetToCell(segmentCellOffsetLast);\n\n\t\t\t\t// view might be RTL, so order by leftmost column\n\t\t\t\tvar cols = [ segmentCellFirst.col, segmentCellLast.col ].sort();\n\n\t\t\t\t// Determine if segment's first/last cell is the beginning/end of the date range.\n\t\t\t\t// We need to compare \"day offset\" because \"cell offsets\" are often ambiguous and\n\t\t\t\t// can translate to multiple days, and an edge case reveals itself when we the\n\t\t\t\t// range's first cell is hidden (we don't want isStart to be true).\n\t\t\t\tvar isStart = cellOffsetToDayOffset(segmentCellOffsetFirst) == rangeDayOffsetStart;\n\t\t\t\tvar isEnd = cellOffsetToDayOffset(segmentCellOffsetLast) + 1 == rangeDayOffsetEnd; // +1 for comparing exclusively\n\n\t\t\t\tsegments.push({\n\t\t\t\t\trow: row,\n\t\t\t\t\tleftCol: cols[0],\n\t\t\t\t\trightCol: cols[1],\n\t\t\t\t\tisStart: isStart,\n\t\t\t\t\tisEnd: isEnd\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn segments;\n\t}", "function rangeToSegments(start, end) {\n\n\t\tvar rowCnt = t.getRowCnt();\n\t\tvar colCnt = t.getColCnt();\n\t\tvar segments = []; // array of segments to return\n\n\t\t// day offset for given date range\n\t\tvar rangeDayOffsetStart = dateToDayOffset(start);\n\t\tvar rangeDayOffsetEnd = dateToDayOffset(end); // an exclusive value\n\t\tvar endTimeMS = +end.time();\n\t\tif (endTimeMS && endTimeMS >= nextDayThreshold) {\n\t\t\trangeDayOffsetEnd++;\n\t\t}\n\t\trangeDayOffsetEnd = Math.max(rangeDayOffsetEnd, rangeDayOffsetStart + 1);\n\n\t\t// first and last cell offset for the given date range\n\t\t// \"last\" implies inclusivity\n\t\tvar rangeCellOffsetFirst = dayOffsetToCellOffset(rangeDayOffsetStart);\n\t\tvar rangeCellOffsetLast = dayOffsetToCellOffset(rangeDayOffsetEnd) - 1;\n\n\t\t// loop through all the rows in the view\n\t\tfor (var row=0; row<rowCnt; row++) {\n\n\t\t\t// first and last cell offset for the row\n\t\t\tvar rowCellOffsetFirst = row * colCnt;\n\t\t\tvar rowCellOffsetLast = rowCellOffsetFirst + colCnt - 1;\n\n\t\t\t// get the segment's cell offsets by constraining the range's cell offsets to the bounds of the row\n\t\t\tvar segmentCellOffsetFirst = Math.max(rangeCellOffsetFirst, rowCellOffsetFirst);\n\t\t\tvar segmentCellOffsetLast = Math.min(rangeCellOffsetLast, rowCellOffsetLast);\n\n\t\t\t// make sure segment's offsets are valid and in view\n\t\t\tif (segmentCellOffsetFirst <= segmentCellOffsetLast) {\n\n\t\t\t\t// translate to cells\n\t\t\t\tvar segmentCellFirst = cellOffsetToCell(segmentCellOffsetFirst);\n\t\t\t\tvar segmentCellLast = cellOffsetToCell(segmentCellOffsetLast);\n\n\t\t\t\t// view might be RTL, so order by leftmost column\n\t\t\t\tvar cols = [ segmentCellFirst.col, segmentCellLast.col ].sort();\n\n\t\t\t\t// Determine if segment's first/last cell is the beginning/end of the date range.\n\t\t\t\t// We need to compare \"day offset\" because \"cell offsets\" are often ambiguous and\n\t\t\t\t// can translate to multiple days, and an edge case reveals itself when we the\n\t\t\t\t// range's first cell is hidden (we don't want isStart to be true).\n\t\t\t\tvar isStart = cellOffsetToDayOffset(segmentCellOffsetFirst) == rangeDayOffsetStart;\n\t\t\t\tvar isEnd = cellOffsetToDayOffset(segmentCellOffsetLast) + 1 == rangeDayOffsetEnd; // +1 for comparing exclusively\n\n\t\t\t\tsegments.push({\n\t\t\t\t\trow: row,\n\t\t\t\t\tleftCol: cols[0],\n\t\t\t\t\trightCol: cols[1],\n\t\t\t\t\tisStart: isStart,\n\t\t\t\t\tisEnd: isEnd\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn segments;\n\t}", "function getTimeBoxesByInterval(start, end){\n console.log(\"getTimeBoxesByInteval called\");\n console.log(\"start:\", start, \"end:\", end);\n const allTimeBoxes = $('#life-calendar .time-box');\n console.assert(start.hour() === 0 && end.hour() === 0, \"Hours not 0:\", start, end);\n console.assert(allTimeBoxes.length > 0);\n const startMs = start.valueOf();\n const endMs = end.valueOf();\n const timeBoxesInInterval = [];\n let intervalStartEncountered = false;\n let intervalEndEncountered = false;\n let counter = 0;\n allTimeBoxes.each(function(){\n // Can't break out of loop so return immediately if there is no reason to continue iteration.\n if(intervalEndEncountered){\n return;\n }\n const tb = $(this);\n // TODO: momenttien muodostamiseen kuluu aikaa, jos niitä tehdään paljon\n const tbStartMs = lcHelpers.dataAttrToEpoch(tb, 'data-start');\n const tbEndMs = lcHelpers.dataAttrToEpoch(tb, 'data-end');\n const isInInterval = tbEndMs > startMs && tbStartMs < endMs;\n if(isInInterval){\n timeBoxesInInterval.push(tb);\n }\n counter += 1;\n if(!intervalStartEncountered){\n intervalStartEncountered = isInInterval;\n }else{\n if(!intervalEndEncountered){\n if(!isInInterval){\n intervalEndEncountered = true;\n return;\n }\n }\n }\n if(intervalEndEncountered){\n console.assert(false, \"Bug.\");\n }\n });\n console.log(\"getTimeBoxesByInterval: cycled thorugh\", counter, \"elements. Total elements:\", allTimeBoxes.length);\n return timeBoxesInInterval;\n}", "function computeActiveRange(dateProfile, isComponentAllDay) {\n var range = dateProfile.activeRange;\n\n if (isComponentAllDay) {\n return range;\n }\n\n return {\n start: addMs(range.start, dateProfile.minTime.milliseconds),\n end: addMs(range.end, dateProfile.maxTime.milliseconds - 864e5) // 864e5 = ms in a day\n\n };\n } // exports", "function getStartEndDate(startNumDays,startNumHours,endNumDays,endNumHours){\n\n hour = 60 * 60;\n day = hour * 24;\n\n startDuration = startNumDays * day + startNumHours * hour;\n endDuration = endNumDays * day + endNumHours * hour;\n\n var date = new Date();\n\n startTimeMilisec = new Date(date.getTime() - startDuration*1000);\n endTimeMilisec = new Date(date.getTime() - endDuration*1000);\n\n var startMonth = ('0' + (startTimeMilisec.getUTCMonth() + 1)).substr(-2);\n var startDate = ('0' + startTimeMilisec.getUTCDate()).substr(-2);\n var startHour = ('0' + startTimeMilisec.getUTCHours()).substr(-2);\n var startMin = ('0' + startTimeMilisec.getUTCMinutes()).substr(-2);\n\n var endMonth = ('0' + (endTimeMilisec.getUTCMonth() + 1)).substr(-2);\n var endDate = ('0' + endTimeMilisec.getUTCDate()).substr(-2);\n var endHour = ('0' + endTimeMilisec.getUTCHours()).substr(-2);\n var endMin = ('0' + endTimeMilisec.getUTCMinutes()).substr(-2); \n\n startTime = startTimeMilisec.getUTCFullYear() + \"-\"\n +startMonth + '-'\n +startDate + \"T\"\n +startHour + \":\"\n +startMin+\":00Z\";\n\n endTime = endTimeMilisec.getUTCFullYear()+\"-\"\n +endMonth + '-'\n +endDate + \"T\"\n +endHour + \":\"\n +endMin+\":00Z\";\n\n return [startTime,endTime,startDuration,endDuration];\n }", "function fillCurrent() {\n for (let i = startDay; i < endDate + startDay; i++) {\n dateArray.push(i - startDay + 1)\n }\n }", "function normalizeDates(startDate, endDate, { min, showMultiDayTimes }) {\n if (!showMultiDayTimes) {\n return [startDate, endDate]\n }\n\n const current = new Date(min) // today at midnight\n let c = new Date(current)\n let s = new Date(startDate)\n let e = new Date(endDate)\n\n // Use noon to compare dates to avoid DST issues.\n s.setHours(12, 0, 0, 0)\n e.setHours(12, 0, 0, 0)\n c.setHours(12, 0, 0, 0)\n\n // Current day is at the start, but it spans multiple days,\n // so we correct the end.\n if (+c === +s && c < e) {\n return [startDate, dates.endOf(startDate, 'day')]\n }\n\n // Current day is in between start and end dates,\n // so we make it span all day.\n if (c > s && c < e) {\n return [current, dates.endOf(current, 'day')]\n }\n\n // Current day is at the end of a multi day event,\n // so we make it start at midnight, and end normally.\n if (c > s && +c === +e) {\n return [current, endDate]\n }\n\n return [startDate, endDate]\n}", "function DateRange(start, end) {\n if (start === void 0) {\n start = null;\n }\n if (end === void 0) {\n end = null;\n }\n this.start = start;\n this.end = end;\n }", "function computeActiveRange(dateProfile, isComponentAllDay) {\n var range = dateProfile.activeRange;\n if (isComponentAllDay) {\n return range;\n }\n return {\n start: addMs(range.start, dateProfile.minTime.milliseconds),\n end: addMs(range.end, dateProfile.maxTime.milliseconds - 864e5) // 864e5 = ms in a day\n };\n}", "function computeActiveRange(dateProfile, isComponentAllDay) {\n var range = dateProfile.activeRange;\n if (isComponentAllDay) {\n return range;\n }\n return {\n start: addMs(range.start, dateProfile.minTime.milliseconds),\n end: addMs(range.end, dateProfile.maxTime.milliseconds - 864e5) // 864e5 = ms in a day\n };\n }", "function computeActiveRange(dateProfile, isComponentAllDay) {\n var range = dateProfile.activeRange;\n if (isComponentAllDay) {\n return range;\n }\n return {\n start: addMs(range.start, dateProfile.minTime.milliseconds),\n end: addMs(range.end, dateProfile.maxTime.milliseconds - 864e5) // 864e5 = ms in a day\n };\n }", "makePrecRange(dt, p, r) {\n var ret = {};\n ret.start = this.fromArray(dt);\n var dte = Array.prototype.slice.call(dt);\n dte[p] += (r || 1);\n ret.end = this.fromArray(dte);\n ret.end = moment.utc(ret.end).add(-1, 'day').toDate();\n return ret;\n }", "_unixRangeForDatespan(startDate, endDate) {\n return {\n start: moment(startDate).unix(),\n end: moment(endDate).add(1, 'day').subtract(1, 'second').unix(),\n };\n }", "function v(a,b,c){var d,e,f,g,h=a._allDay,i=a._start,j=a._end,k=!1;\n// if no new dates were passed in, compare against the event's existing dates\n// NOTE: throughout this function, the initial values of `newStart` and `newEnd` are\n// preserved. These values may be undefined.\n// detect new allDay\n// if value has changed, use it\n// normalize the new dates based on allDay\n// compute dateDelta\n// if allDay has changed, always throw away the end\n// new duration\n// subtract old duration\n// get events with this ID\nreturn b||c||(b=a.start,c=a.end),d=a.allDay!=h?a.allDay:!(b||c).hasTime(),d&&(b&&(b=b.clone().stripTime()),c&&(c=c.clone().stripTime())),b&&(e=d?o(b,i.clone().stripTime()):o(b,i)),d!=h?k=!0:c&&(f=o(c||x.getDefaultEventEnd(d,b||i),b||i).subtract(o(j||x.getDefaultEventEnd(h,i),i))),g=w(r(a._id),k,d,e,f),{dateDelta:e,durationDelta:f,undo:g}}", "function computeActiveRange(dateProfile, isComponentAllDay) {\n var range = dateProfile.activeRange;\n if (isComponentAllDay) {\n return range;\n }\n return {\n start: addMs$1(range.start, dateProfile.minTime.milliseconds),\n end: addMs$1(range.end, dateProfile.maxTime.milliseconds - 864e5) // 864e5 = ms in a day\n };\n }", "getAllInBetweenDates(sStartDate, sEndDate) {\n let aDates = [];\n //to avoid modifying the original date\n const oStartDate = new Date(sStartDate);\n const oEndDate = new Date(sEndDate);\n while (oStartDate <= oEndDate) {\n aDates = [...aDates, new Date(oStartDate)];\n oStartDate.setDate(oStartDate.getDate() + 1)\n }\n return aDates;\n }", "function computeActiveRange(dateProfile, isComponentAllDay) {\n var range = dateProfile.activeRange;\n if (isComponentAllDay) {\n return range;\n }\n return {\n start: addMs(range.start, dateProfile.slotMinTime.milliseconds),\n end: addMs(range.end, dateProfile.slotMaxTime.milliseconds - 864e5),\n };\n }", "function nextRangeStart(range, existingEvents)\n {\n for (var j = 0; j < existingEvents.length; j++)\n {\n if (range.overlaps(existingEvents[j]))\n {\n return moment(existingEvents[j].end);\n }\n }\n return null;\n }", "function datesArray(startDate, endDate) {\n var oneDay = 24 * 60 * 60 * 1000;\n var numOfDays = ((endDate - startDate) / oneDay) + 1; //inculing the start and the end days\n var arr = new Array();\n if (numOfDays <= 10) {\n var tmp = new Date(startDate);\n arr[0] = changeDateFormat(tmp);\n for (var i = 1; tmp.getTime() < endDate.getTime(); i++) { //insert all the days to the array\n tmp = new Date(tmp.getTime() + oneDay);\n arr[i] = changeDateFormat(tmp);\n }\n }\n else {\n var average = (endDate.getTime() - startDate.getTime()) / (oneDay * 10); //how many milisec we jump between the dates\n var tmp = new Date(startDate);\n arr[0] = changeDateFormat(tmp);\n for (var i = 1; tmp.getTime() < endDate.getTime(); i++) { //insert all the days to the array\n tmp = new Date((tmp.getTime() + average * oneDay));\n arr[i] = changeDateFormat(tmp);\n }\n }\n return arr;\n}", "splitEvents(){\n const { events } = this.props;\n const { days } = this.state;\n const sortedEvents = events.sort((firstEvent, secondEvent) => {\n const firstStartDate = moment(firstEvent.startDate);\n const secondStartDate = moment(secondEvent.startDate);\n\n if(firstStartDate.isBefore(secondStartDate)) {\n return -1;\n } else if (firstStartDate.isSame(secondStartDate)) {\n return 0;\n } else {\n return 1;\n }\n });\n\n // what if the dates are out of range?\n // i should be able to query the dates out of the BE\n // for now we can assume within range\n const result = [...Array(7)].map(el => new Array());\n sortedEvents.forEach((event) => {\n const startDate = moment(event.startDate);\n\n days.forEach((day, idx) => {\n if(startDate.isBetween(day.startMoment, day.endMoment)) {\n result[idx].push(event);\n }\n });\n });\n\n return result;\n }", "calculateOptimalDateRange(centerDate, panelSize, viewPreset, userProvidedSpan) {\n // this line allows us to always use the `calculateOptimalDateRange` method when calculating date range for zooming\n // (even in case when user has provided own interval)\n // other methods may override/hook into `calculateOptimalDateRange` to insert own processing\n // (infinite scrolling feature does)\n if (userProvidedSpan) return userProvidedSpan;\n const me = this,\n {\n timeAxis\n } = me,\n {\n bottomHeader\n } = viewPreset,\n tickWidth = me.isHorizontal ? viewPreset.tickWidth : viewPreset.tickHeight;\n\n if (me.zoomKeepsOriginalTimespan) {\n return {\n startDate: timeAxis.startDate,\n endDate: timeAxis.endDate\n };\n }\n\n const unit = bottomHeader.unit,\n difference = Math.ceil(panelSize / tickWidth * bottomHeader.increment * me.visibleZoomFactor / 2),\n startDate = DateHelper.add(centerDate, -difference, unit),\n endDate = DateHelper.add(centerDate, difference, unit);\n return {\n startDate: timeAxis.floorDate(startDate, false, unit, bottomHeader.increment),\n endDate: timeAxis.ceilDate(endDate, false, unit, bottomHeader.increment)\n };\n }", "function snapToDay(dates, times, day) {\n\t\tvar startDate = new Date(day),\n\t\t duration = (times.end.hours - times.start.hours) * 3600000 +\n\t\t (times.end.minutes - times.start.minutes) * 60000;\n\n\t\tif (startDate >= dates.end || (86400000 + +startDate) <= dates.start)\n\t\t\treturn null;\n\n\t\tif (startDate.getDay() != times.day)\n\t\t\treturn null;\n\n\t\tstartDate.setHours(times.start.hours, times.start.minutes, 0, 0);\n\n\t\treturn {\n\t\t\tstart: startDate,\n\t\t\tend: new Date(duration + +startDate),\n\t\t};\n\t}", "function normalizeEventRange(props) {\n\n normalizeEventRangeTimes(props);\n\n if (props.end && !props.end.isAfter(props.start)) {\n props.end = null;\n }\n\n if (!props.end) {\n if (options.forceEventDuration) {\n props.end = t.getDefaultEventEnd(props.allDay, props.start);\n }\n else {\n props.end = null;\n }\n }\n }", "function createDateArray(start,end){\n let\n dateArray = [],\n dt = new Date(start);\n\n while (moment(dt).dayOfYear() <= moment(end).dayOfYear()) {\n dateArray.push(new Date(dt));\n dt.setDate(dt.getDate() + 1);\n }\n return dateArray;\n}", "static getAllDayStartDate(dt) {\n if (dt && dt.isEvent) {\n dt = dt.get('startDate');\n }\n\n if (dt) {\n dt = DateHelper.clearTime(dt, true);\n }\n\n return dt;\n }", "function mergeRangesWithHash(meetings) {\n var startTimes = {};\n for (var i = 1; i < meetings.length; i++) {\n // extend max endTime seen for the startTime\n if (startTimes[meetings[i].startTime] === undefined || meetings[i].endTime > startTimes[meetings[i].startTime]) {\n startTimes[meetings[i].startTime] = meetings[i].endTime;\n }\n }\n // e.g. time\n // 1 -> 3, 2 -> 4 will lead to {1:3, 2:4}\n // 5 -> 6, 6 -> 8 will lead to {5:6, 6:8}\n // so this doesn't really buy us anything. I was hoping the hash table's easy lookup of startTime would help, but it doesn't allow us to easily see the ranges we have.\n}", "function normalizeEventRange(props) {\n\n\t\tnormalizeEventRangeTimes(props);\n\n\t\tif (props.end && !props.end.isAfter(props.start)) {\n\t\t\tprops.end = null;\n\t\t}\n\n\t\tif (!props.end) {\n\t\t\tif (options.forceEventDuration) {\n\t\t\t\tprops.end = t.getDefaultEventEnd(props.allDay, props.start);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tprops.end = null;\n\t\t\t}\n\t\t}\n\t}", "roundDate(date, relativeTo) {\n const me = this,\n dt = DateHelper.clone(date),\n increment = me.resolutionIncrement || 1;\n relativeTo = DateHelper.clone(relativeTo || me.startDate);\n\n switch (me.resolutionUnit) {\n case 'week':\n DateHelper.startOf(dt, 'day');\n let distanceToWeekStartDay = dt.getDay() - me.weekStartDay,\n toAdd;\n\n if (distanceToWeekStartDay < 0) {\n distanceToWeekStartDay = 7 + distanceToWeekStartDay;\n }\n\n if (Math.round(distanceToWeekStartDay / 7) === 1) {\n toAdd = 7 - distanceToWeekStartDay;\n } else {\n toAdd = -distanceToWeekStartDay;\n }\n\n return DateHelper.add(dt, toAdd, 'day');\n\n case 'month':\n const nbrMonths = DateHelper.diff(relativeTo, dt, 'month') + DateHelper.as('month', dt.getDay() / DateHelper.daysInMonth(dt)),\n //*/DH.as('month', DH.diff(relativeTo, dt)) + (dt.getDay() / DH.daysInMonth(dt)),\n snappedMonths = Math.round(nbrMonths / increment) * increment;\n return DateHelper.add(relativeTo, snappedMonths, 'month');\n\n case 'quarter':\n DateHelper.startOf(dt, 'month');\n return DateHelper.add(dt, 'month', 3 - dt.getMonth() % 3);\n\n default:\n const duration = DateHelper.as(me.resolutionUnit, DateHelper.diff(relativeTo, dt)),\n // Need to find the difference of timezone offsets between relativeTo and original dates. 0 if timezone offsets are the same.\n offset = DateHelper.as(me.resolutionUnit, relativeTo.getTimezoneOffset() - dt.getTimezoneOffset(), 'minute'),\n // Need to add the offset to the whole duration, so the divided value will take DST into account\n snappedDuration = Math.round((duration + offset) / increment) * increment; // TODO: used to add one res unit lower * factor, minutes = add seconds, minutes * 60\n // Now when the round is done, we need to subtract the offset, so the result also will take DST into account\n\n return DateHelper.add(relativeTo, snappedDuration - offset, me.resolutionUnit);\n }\n }", "function holDayCalc(startCheck, endCheck) {\n var ss = SpreadsheetApp.getActive(),\n s = ss.getActiveSheet();\n \n // Turn dates into an array.\n var startArray = startCheck.split('-');\n var endArray = endCheck.split('-');\n \n // The arrays are used to create new date objects.\n var startDate = new Date(startArray[0], startArray[1]-1, startArray[2], 0, 0, 0, 0),\n endDate = new Date(endArray[0], endArray[1]-1, endArray[2], 0, 0, 0, 0);\n \n // Use the dates to find the start and end sheet names.\n var sSheetName = getSheetDate(startDate),\n eSheetName = getSheetDate(endDate);\n \n // Get the start and end sheet to check on.\n var sStart = ss.getSheetByName(sSheetName);\n var sEnd = ss.getSheetByName(eSheetName);\n \n var startCal = getCalValues(sSheetName),\n endCal = getCalValues(eSheetName);\n \n // The range of the start and end calendar to be inputed into the formulas.\n var sCalA = 'A1:N' + startCal.length;\n var eCalA = 'A1:N' + endCal.length;\n \n \n var emList = createEmployeeList();\n \n var row = 57;\n if (s.getRange(52, 1).getValue()) row = 67;\n var col = 12;\n \n \n // Add the start and End of the pay period to the spreadsheet;\n s.getRange(row-2, col).setValue(startCheck).setNumberFormat(\"MMM d, yyyy\");\n s.getRange(row-2, col+2).setValue(endCheck).setNumberFormat(\"MMM d, yyyy\");\n \n //Get the A1 notation from start and end pay feilds.\n var sPayA = sEnd.getRange(row-2, col).getA1Notation(),\n ePayA = sEnd.getRange(row-2, col+2).getA1Notation();\n \n var formulas = new Array(emList.length);\n \n // Add formulas to the the array;\n for (var i=0, rowi = row; i<emList.length; i++, rowi++) {\n formulas[i] = [\"=calcPayFormula(K\" + rowi + \",\" + sPayA + \",\" + ePayA + \",'\" + sSheetName + \"'!\" + sCalA + \",'\" + eSheetName + \"'!\" + eCalA + \")\"];\n }\n // Add the formulas to check total hours worked to the calendar.\n s.getRange(row, col, emList.length, 1).setFormulas(formulas).setHorizontalAlignment('right');\n \n // Overight the formulas array to store the days worked.\n for (var i=0, rowi = row; i<emList.length; i++, rowi++) {\n formulas[i] = [\"=holDayChecker(K\" + rowi + \",\" + sPayA + \",\" + ePayA + \",'\" + sSheetName + \"'!\" + sCalA + \",'\" + eSheetName + \"'!\" + eCalA + \")\"];\n }\n // Add the formula for checking days worked.\n s.getRange(row, col+1, emList.length, 1).setFormulas(formulas).setHorizontalAlignment('right');\n \n // Overight the formulas array once again to store the very small average formula;\n for (var i=0, rowi = row; i<emList.length; i++, rowi++) {\n formulas[i] = [\"=customDivison(R[\" + 0 + \"]C[\" + -2 + \"],R[\" + 0 + \"]C[\" + -1 + \"])\"];\n }\n // Add the formula that finds average hours per day worked to the calendar.\n s.getRange(row, col+2, emList.length, 1).setFormulasR1C1(formulas).setHorizontalAlignment('right').setNumberFormat('0.00');\n}", "function getDateRangeArray(date, dateRangeType, firstDayOfWeek, workWeekDays, daysToSelectInDayView) {\n if (daysToSelectInDayView === void 0) { daysToSelectInDayView = 1; }\n var datesArray = [];\n var startDate;\n var endDate = null;\n if (!workWeekDays) {\n workWeekDays = [_dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DayOfWeek.Monday, _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DayOfWeek.Tuesday, _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DayOfWeek.Wednesday, _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DayOfWeek.Thursday, _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DayOfWeek.Friday];\n }\n daysToSelectInDayView = Math.max(daysToSelectInDayView, 1);\n switch (dateRangeType) {\n case _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DateRangeType.Day:\n startDate = getDatePart(date);\n endDate = addDays(startDate, daysToSelectInDayView);\n break;\n case _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DateRangeType.Week:\n case _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DateRangeType.WorkWeek:\n startDate = getStartDateOfWeek(getDatePart(date), firstDayOfWeek);\n endDate = addDays(startDate, _dateValues_timeConstants__WEBPACK_IMPORTED_MODULE_0__.TimeConstants.DaysInOneWeek);\n break;\n case _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DateRangeType.Month:\n startDate = new Date(date.getFullYear(), date.getMonth(), 1);\n endDate = addMonths(startDate, 1);\n break;\n default:\n throw new Error('Unexpected object: ' + dateRangeType);\n }\n // Populate the dates array with the dates in range\n var nextDate = startDate;\n do {\n if (dateRangeType !== _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DateRangeType.WorkWeek) {\n // push all days not in work week view\n datesArray.push(nextDate);\n }\n else if (workWeekDays.indexOf(nextDate.getDay()) !== -1) {\n datesArray.push(nextDate);\n }\n nextDate = addDays(nextDate, 1);\n } while (!compareDates(nextDate, endDate));\n return datesArray;\n}", "function assignDatesToEvent(start, end, allDay, event) {\n event.start = start;\n event.end = end;\n event.allDay = allDay;\n normalizeEventRange(event);\n backupEventDates(event);\n }", "setDateRange () {\n const dates = [];\n\n const startDate = this.state.from.clone();\n const endDate = this.state.to.clone();\n\n dates.push(startDate.clone());\n\n while (startDate.add(1, 'day').diff(endDate) < 0) {\n dates.push(startDate.clone());\n }\n\n this.setState({\n dates\n });\n }", "function k(a){a._allDay=a.allDay,a._start=a.start.clone(),a._end=a.end?a.end.clone():null}", "resetDateRange() {\n var beg, end;\n beg = Data.toDateStr(Data.begDay, Data.monthIdx);\n end = Data.advanceDate(beg, Data.numDays - 1);\n return this.res.dateRange(beg, end, this.resetRooms);\n }", "function newDates(low, high){\n /* let tempArray = [];\n for(var i=0; i<datesProvided.length; i++){\n if ((i>=low) && (i<=high)){\n tempArray.push(new Date(datesProvided[i]));\n }\n }\n\n //And one last value to account for range\n let tempDate = new Date(tempArray[tempArray.length-1])\n console.log(\"Temp Date:\")\n console.log(tempDate)\n let moreMinutes = tempDate.getMinutes();\n console.log(\"Minutes: \")\n console.log(moreMinutes)\n console.log(selectionInterval)\n console.log((moreMinutes+(+selectionInterval)))\n tempDate.setMinutes((moreMinutes+(+selectionInterval)))\n console.log(\"New Temp Date\")\n console.log(tempDate)\n tempArray.push(tempDate)\n\n return tempArray;*/\n let tempArray = [];\n for(var i=low; i<=high; i++){\n tempArray.push(new Date(datesProvided[i]));\n }\n\n //And one last value to account for range\n let tempDate = new Date(tempArray[tempArray.length-1])\n console.log(\"Temp Date:\")\n console.log(tempDate)\n let moreMinutes = tempDate.getMinutes();\n console.log(\"Minutes: \")\n console.log(moreMinutes)\n console.log(selectionInterval)\n console.log((moreMinutes+(+selectionInterval)))\n tempDate.setMinutes((moreMinutes+(+selectionInterval)))\n console.log(\"New Temp Date\")\n console.log(tempDate)\n tempArray.push(tempDate)\n\n return tempArray;\n}", "function removeOutsideDateRange(rangeStart, rangeEnd) {\n var startIndex = 0;\n var endIndex = allCalendarEvents.length - 1;\n\n for (var i = 0; i < allCalendarEvents.length - 1; i++) {\n // If an event ends after the rangeStart cutoff, it's included.\n var startCompare = compareDateTimes(allCalendarEvents[i].end, rangeStart);\n if (startCompare >= 0) {\n startIndex = i;\n break;\n }\n }\n\n for (var i = startIndex; i < allCalendarEvents.length - 1; i++) {\n // If an event starts before the rangeEnd cutoff, it's included.\n var endCompare = compareDateTimes(allCalendarEvents[i].start, rangeEnd);\n if (endCompare < 0) {\n endIndex = i;\n }\n }\n\n // I'm not sure if slice is safe to assign directly back to the array being sliced, so I'm using a temp.\n var temp = allCalendarEvents.slice(startIndex, endIndex + 1);\n allCalendarEvents = temp;\n}", "function assignDatesToEvent(start, end, allDay, event) {\n\t\tevent.start = start;\n\t\tevent.end = end;\n\t\tevent.allDay = allDay;\n\t\tnormalizeEventRange(event);\n\t\tbackupEventDates(event);\n\t}", "function findStartAndEndDate() {\n return [dayOfLastWeek(1), dayOfLastWeek(0)];\n}", "function setStartRange(date, days) {\r\n var msSpan = days*24*3600*1000;\r\n var startDate = new Date(date.getTime() - msSpan);\r\n //$(\"#date1\").val(startDate.toISOString().split('T')[0]);\r\n $(\"#date1\").val(momentLA_Date(startDate));\r\n}", "eventTimeQualifier(calobj,startmomentobj,endmomentobj) {\n\n var endDiffinDays, startDiffinDays;\n\n var startNoTime = startmomentobj.clone();\n var endNoTime = endmomentobj.clone();\n\n try {\n // no time is considered for this\n startNoTime.startOf('day');\n startDiffinDays = startNoTime.diff(calobj.todayDate,'days');\n\n endNoTime.startOf('day');\n endDiffinDays = endNoTime.diff(calobj.todayDate,'days');\n }\n // eslint-disable-next-line no-catch-shadow\n catch (e) {\n startDiffinDays = -1;\n endDiffinDays = -1;\n console.log(\"Diff error:\", e);\n }\n // console.log(\"Diff in days is:\" + startDiffinDays + \" and end:\" + endDiffinDays + \" with today:\" + todayDate.format());\n\n if ( startDiffinDays > 0 ) {\n return this.EVENTISFUTURE;\n } else if ( startDiffinDays < 0 && endDiffinDays < 0 ) {\n return this.EVENTISPAST;\n } else if ( startDiffinDays == 0 ) {\n if ( startmomentobj.hour() == 0 && startmomentobj.minute() < 5 && \n ( (endmomentobj.hour() == 23 && endmomentobj.minute() > 54 ) || endDiffinDays > 0 ) ) {\n return this.EVENTSPANSTODAY;\n } else {\n return this.EVENTSTARTSTODAY; // all same day events that start today actually\n }\n } else if ( startDiffinDays < 0 && endDiffinDays == 0 ) {\n return this.EVENTENDSTODAY;\n } else if ( startDiffinDays < 0 && endDiffinDays > 0 ) {\n return this.EVENTSPANSTODAY;\n }\n\n // have no clue\n return 0;\n }", "function main() {\n // OBTIAN AN ARRAY OF START AND END DATES\n var startDate = findStartAndEndDate()[0];\n var endDate = findStartAndEndDate()[1];\n // var start = formatDate(findStartAndEndDate()[0]);\n // var end = formatDate();\n\n var listOfDates = [];\n listOfDates.push(formatDate(startDate));\n\n var year = parseInt(startDate.split(\"-\")[0]);\n var month = parseInt(startDate.split(\"-\")[1]);\n var date = parseInt(startDate.split(\"-\")[2]);\n\n do {\n var nextDate = findNdaysAfter(year, month, date, 1);\n year = parseInt(nextDate.split(\"-\")[0]);\n month = parseInt(nextDate.split(\"-\")[1]);\n date = parseInt(nextDate.split(\"-\")[2]);\n listOfDates.push(formatDate(nextDate));\n } while (nextDate != endDate);\n //console.log(listOfDates);\n // return listOfDates;\n module.exports = listOfDates;\n}", "function newDates1(low, high){\n let tempArray = [];\n for(var i=low; i<=high; i++){\n tempArray.push(new Date(datesProvided[i]));\n }\n\n //And one last value to account for range\n let tempDate = new Date(tempArray[tempArray.length-1])\n // console.log(\"Temp Date:\")\n // console.log(tempDate)\n let moreMinutes = tempDate.getMinutes();\n // console.log(\"Minutes: \")\n // console.log(moreMinutes)\n // console.log(selectionInterval)\n // console.log((moreMinutes+(+selectionInterval)))\n tempDate.setMinutes((moreMinutes+(+selectionInterval)))\n // console.log(\"New Temp Date\")\n // console.log(tempDate)\n tempArray.push(tempDate)\n\n return tempArray;\n}", "function getDateArray(start, end) {\n\t\tvar arr = new Array();\n\n\t\twhile (start <= end) {\n\t\t\tarr.push(new Date(start));\n\t\t\tstart.setDate(start.getDate() + 1);\n\t\t}\n\t\t\n\t\treturn arr;\n\t}", "function assignDatesToEvent(start, end, allDay, event) {\n\t\tevent.start = start;\n\t\tevent.end = end;\n\t\tevent.allDay = allDay;\n\t\tnormalizeEventDates(event);\n\t\tbackupEventDates(event);\n\t}", "function assignDatesToEvent(start, end, allDay, event) {\n\t\tevent.start = start;\n\t\tevent.end = end;\n\t\tevent.allDay = allDay;\n\t\tnormalizeEventDates(event);\n\t\tbackupEventDates(event);\n\t}", "function assignDatesToEvent(start, end, allDay, event) {\n\t\tevent.start = start;\n\t\tevent.end = end;\n\t\tevent.allDay = allDay;\n\t\tnormalizeEventDates(event);\n\t\tbackupEventDates(event);\n\t}", "function assignDatesToEvent(start, end, allDay, event) {\n\t\tevent.start = start;\n\t\tevent.end = end;\n\t\tevent.allDay = allDay;\n\t\tnormalizeEventDates(event);\n\t\tbackupEventDates(event);\n\t}", "function assignDatesToEvent(start, end, allDay, event) {\n\t\tevent.start = start;\n\t\tevent.end = end;\n\t\tevent.allDay = allDay;\n\t\tnormalizeEventDates(event);\n\t\tbackupEventDates(event);\n\t}", "function assignDatesToEvent(start, end, allDay, event) {\n\t\t\tevent.start = start;\n\t\t\tevent.end = end;\n\t\t\tevent.allDay = allDay;\n\t\t\tnormalizeEventDates(event);\n\t\t\tbackupEventDates(event);\n\t\t}", "function createRepeatDatesFromForm() {\n //'every Interval periods for Occurencess\n var StartDate = document.getElementById(\"startDate\").value;\n var EndDate = document.getElementById(\"endDate\").value;\n // Init Date Arrays\n stDate.length = 0;\n enDate.length = 0;\n\n var Period = $('#repeatType', iPage).val(); // every x days\n var Interval = $('#repeatEveryType', iPage).val(); //every 5 x\n var Occurrences = $('#occurrenceSType', iPage).val(); //for x days\n var nOccur = Number(Occurrences);\n var nInter = Number(Interval);\n var diff = dateDiff(EndDate, StartDate);\n\n var mtglen = diff / 1000 / 60; //difference in minutes\n\n if (Period == \"Days\") {\n\n var tempD;\n var sum;\n for (x = 0; x < nOccur; x++) {\n tempD = addDays(StartDate, x * Interval);\n stDate.push(sbDateFormat(tempD));\n enDate.push(sbDateFormat(addMinutes(tempD, mtglen))); // n is minutes\n }\n }\n\n if (Period == \"Weeks\") {\n for (x = 0; x < nOccur; x++) {\n tempD = addDays(StartDate, x * Interval * 7);\n stDate.push(sbDateFormat(tempD));\n enDate.push(sbDateFormat(addMinutes(tempD, mtglen)));\n }\n }\n\n if (Period == \"MonthsOpt1\" || Period == \"MonthsOpt2\" || Period == \"MonthsOpt3\") {\n for (x = 0; x < nOccur; x++) {\n\n //if based on day number\n if (Period == \"MonthsOpt2\") {\n tempD = addMonths(StartDate, x * Interval, false);\n if (tempD != '') {\n stDate.push(sbDateFormat(tempD));\n enDate.push(sbDateFormat(addMinutes(tempD, mtglen)));\n }\n } else {\n if (Period == \"MonthsOpt1\") {\n // we find the day of the week\n tempD = get_sameWeekandDay(StartDate, addMonths(StartDate, x * Interval, true));\n if (tempD != '') {\n stDate.push(sbDateFormat(tempD));\n enDate.push(sbDateFormat(addMinutes(tempD, mtglen)));\n }\n } else {\n // from end of month MonthsOpt3\n tempD = get_sameWeekandDayRev(StartDate, addMonths(StartDate, x * Interval, true));\n if (tempD != '') {\n stDate.push(sbDateFormat(tempD));\n enDate.push(sbDateFormat(addMinutes(tempD, mtglen)));\n }\n }\n }\n }\n }\n}", "function getWeeksDates(start, end) {\n var sDate;\n var eDate;\n var dateArr = [];\n var daysHash = {};\n var daysArr = [];\n\n while (start <= end) {\n daysHash[getTimestamp(start, 'yyyymmdd')] = dateArr.length\n daysArr.push(getTimestamp(new Date(start.getTime())))\n if (start.getDay() == 1 || (dateArr.length == 0 && !sDate)) {\n sDate = new Date(start.getTime());\n }\n if ((sDate && start.getDay() == 0) || start.getTime() == end.getTime()) {\n eDate = new Date(start.getTime());\n }\n if (sDate && eDate) {\n dateArr.push([sDate, eDate]);\n sDate = undefined;\n eDate = undefined;\n }\n start.setDate(start.getDate() + 1);\n }\n\n daysHash[getTimestamp(end, 'yyyymmdd')] = dateArr.length\n var lastDate = new Date(dateArr[dateArr.length - 1][1])\n if (lastDate < end) {\n dateArr.push([new Date(lastDate.setDate(lastDate.getDate() + 1)), end]);\n }\n return { \"weeksDates\": dateArr, \"daysHash\": daysHash, \"daysArr\": daysArr }\n }" ]
[ "0.78592855", "0.73053396", "0.7223152", "0.6931339", "0.6145467", "0.6138421", "0.611688", "0.611688", "0.611688", "0.611688", "0.60401464", "0.6025646", "0.6015353", "0.5999061", "0.5834712", "0.5834712", "0.5824354", "0.5769818", "0.5768904", "0.57657516", "0.5733505", "0.57055074", "0.57055074", "0.57055074", "0.57055074", "0.57055074", "0.57055074", "0.56900454", "0.5683041", "0.56493753", "0.5643341", "0.5569102", "0.55593485", "0.55459225", "0.55068123", "0.550571", "0.54868186", "0.54818326", "0.54818326", "0.54727757", "0.544964", "0.54423535", "0.5437948", "0.54234236", "0.540182", "0.53907", "0.53778964", "0.53778964", "0.5376221", "0.53755456", "0.5355022", "0.52956873", "0.52876484", "0.5286637", "0.5277994", "0.52457213", "0.52457213", "0.5228328", "0.5220636", "0.5213995", "0.5199736", "0.5173825", "0.51530814", "0.51051277", "0.51012075", "0.50999963", "0.5099844", "0.5094108", "0.50940406", "0.5078417", "0.5055756", "0.505472", "0.50396234", "0.5024955", "0.5021907", "0.5021031", "0.5015189", "0.5009878", "0.5004683", "0.49824464", "0.49817547", "0.49753648", "0.49659345", "0.49627042", "0.4962668", "0.49581456", "0.49559632", "0.495099", "0.49295714", "0.49235183", "0.49235183", "0.49235183", "0.49235183", "0.49235183", "0.49235123", "0.49184495", "0.49184278" ]
0.71547514
6
given a timed range, computes an allday range based on how for the end date bleeds into the next day TODO: give nextDayThreshold a default arg
function computeVisibleDayRange(timedRange, nextDayThreshold) { if (nextDayThreshold === void 0) { nextDayThreshold = createDuration(0); } var startDay = null; var endDay = null; if (timedRange.end) { endDay = startOfDay(timedRange.end); var endTimeMS = timedRange.end.valueOf() - endDay.valueOf(); // # of milliseconds into `endDay` // If the end time is actually inclusively part of the next day and is equal to or // beyond the next day threshold, adjust the end to be the exclusive end of `endDay`. // Otherwise, leaving it as inclusive will cause it to exclude `endDay`. if (endTimeMS && endTimeMS >= asRoughMs(nextDayThreshold)) { endDay = addDays(endDay, 1); } } if (timedRange.start) { startDay = startOfDay(timedRange.start); // the beginning of the day the range starts // If end is within `startDay` but not past nextDayThreshold, assign the default duration of one day. if (endDay && endDay <= startDay) { endDay = addDays(startDay, 1); } } return { start: startDay, end: endDay }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computeAlignedDayRange(timedRange) {\n var dayCnt = Math.floor(diffDays(timedRange.start, timedRange.end)) || 1;\n var start = startOfDay(timedRange.start);\n var end = addDays(start, dayCnt);\n return {\n start: start,\n end: end\n };\n } // given a timed range, computes an all-day range based on how for the end date bleeds into the next day", "function computeVisibleDayRange(timedRange, nextDayThreshold) {\n if (nextDayThreshold === void 0) {\n nextDayThreshold = createDuration(0);\n }\n\n var startDay = null;\n var endDay = null;\n\n if (timedRange.end) {\n endDay = startOfDay(timedRange.end);\n var endTimeMS = timedRange.end.valueOf() - endDay.valueOf(); // # of milliseconds into `endDay`\n // If the end time is actually inclusively part of the next day and is equal to or\n // beyond the next day threshold, adjust the end to be the exclusive end of `endDay`.\n // Otherwise, leaving it as inclusive will cause it to exclude `endDay`.\n\n if (endTimeMS && endTimeMS >= asRoughMs(nextDayThreshold)) {\n endDay = addDays(endDay, 1);\n }\n }\n\n if (timedRange.start) {\n startDay = startOfDay(timedRange.start); // the beginning of the day the range starts\n // If end is within `startDay` but not past nextDayThreshold, assign the default duration of one day.\n\n if (endDay && endDay <= startDay) {\n endDay = addDays(startDay, 1);\n }\n }\n\n return {\n start: startDay,\n end: endDay\n };\n } // spans from one day into another?", "function computeVisibleDayRange(timedRange, nextDayThreshold) {\n if (nextDayThreshold === void 0) { nextDayThreshold = createDuration(0); }\n var startDay = null;\n var endDay = null;\n if (timedRange.end) {\n endDay = startOfDay(timedRange.end);\n var endTimeMS = timedRange.end.valueOf() - endDay.valueOf(); // # of milliseconds into `endDay`\n // If the end time is actually inclusively part of the next day and is equal to or\n // beyond the next day threshold, adjust the end to be the exclusive end of `endDay`.\n // Otherwise, leaving it as inclusive will cause it to exclude `endDay`.\n if (endTimeMS && endTimeMS >= asRoughMs(nextDayThreshold)) {\n endDay = addDays(endDay, 1);\n }\n }\n if (timedRange.start) {\n startDay = startOfDay(timedRange.start); // the beginning of the day the range starts\n // If end is within `startDay` but not past nextDayThreshold, assign the default duration of one day.\n if (endDay && endDay <= startDay) {\n endDay = addDays(startDay, 1);\n }\n }\n return { start: startDay, end: endDay };\n}", "function computeVisibleDayRange$1(timedRange, nextDayThreshold) {\n if (nextDayThreshold === void 0) { nextDayThreshold = createDuration$1(0); }\n var startDay = null;\n var endDay = null;\n if (timedRange.end) {\n endDay = startOfDay$1(timedRange.end);\n var endTimeMS = timedRange.end.valueOf() - endDay.valueOf(); // # of milliseconds into `endDay`\n // If the end time is actually inclusively part of the next day and is equal to or\n // beyond the next day threshold, adjust the end to be the exclusive end of `endDay`.\n // Otherwise, leaving it as inclusive will cause it to exclude `endDay`.\n if (endTimeMS && endTimeMS >= asRoughMs$1(nextDayThreshold)) {\n endDay = addDays$1(endDay, 1);\n }\n }\n if (timedRange.start) {\n startDay = startOfDay$1(timedRange.start); // the beginning of the day the range starts\n // If end is within `startDay` but not past nextDayThreshold, assign the default duration of one day.\n if (endDay && endDay <= startDay) {\n endDay = addDays$1(startDay, 1);\n }\n }\n return { start: startDay, end: endDay };\n }", "function computeVisibleDayRange(timedRange, nextDayThreshold) {\n if (nextDayThreshold === void 0) {\n nextDayThreshold = duration_1.createDuration(0);\n }\n\n var startDay = null;\n var endDay = null;\n\n if (timedRange.end) {\n endDay = marker_1.startOfDay(timedRange.end);\n var endTimeMS = timedRange.end.valueOf() - endDay.valueOf(); // # of milliseconds into `endDay`\n // If the end time is actually inclusively part of the next day and is equal to or\n // beyond the next day threshold, adjust the end to be the exclusive end of `endDay`.\n // Otherwise, leaving it as inclusive will cause it to exclude `endDay`.\n\n if (endTimeMS && endTimeMS >= duration_1.asRoughMs(nextDayThreshold)) {\n endDay = marker_1.addDays(endDay, 1);\n }\n }\n\n if (timedRange.start) {\n startDay = marker_1.startOfDay(timedRange.start); // the beginning of the day the range starts\n // If end is within `startDay` but not past nextDayThreshold, assign the default duration of one day.\n\n if (endDay && endDay <= startDay) {\n endDay = marker_1.addDays(startDay, 1);\n }\n }\n\n return {\n start: startDay,\n end: endDay\n };\n }", "function computeAlignedDayRange(timedRange) {\n var dayCnt = Math.floor(diffDays(timedRange.start, timedRange.end)) || 1;\n var start = startOfDay(timedRange.start);\n var end = addDays(start, dayCnt);\n return { start: start, end: end };\n}", "function computeAlignedDayRange(timedRange) {\n var dayCnt = Math.floor(diffDays(timedRange.start, timedRange.end)) || 1;\n var start = startOfDay(timedRange.start);\n var end = addDays(start, dayCnt);\n return { start: start, end: end };\n }", "function computeAlignedDayRange(timedRange) {\n var dayCnt = Math.floor(diffDays(timedRange.start, timedRange.end)) || 1;\n var start = startOfDay(timedRange.start);\n var end = addDays(start, dayCnt);\n return { start: start, end: end };\n }", "function computeAlignedDayRange(timedRange) {\n var dayCnt = Math.floor(diffDays(timedRange.start, timedRange.end)) || 1;\n var start = startOfDay(timedRange.start);\n var end = addDays(start, dayCnt);\n return { start: start, end: end };\n }", "function computeAlignedDayRange(timedRange) {\n var dayCnt = Math.floor(diffDays(timedRange.start, timedRange.end)) || 1;\n var start = startOfDay(timedRange.start);\n var end = addDays(start, dayCnt);\n return { start: start, end: end };\n }", "function computeAlignedDayRange$1(timedRange) {\n var dayCnt = Math.floor(diffDays$1(timedRange.start, timedRange.end)) || 1;\n var start = startOfDay$1(timedRange.start);\n var end = addDays$1(start, dayCnt);\n return { start: start, end: end };\n }", "function computeAlignedDayRange(timedRange) {\n var dayCnt = Math.floor(marker_1.diffDays(timedRange.start, timedRange.end)) || 1;\n var start = marker_1.startOfDay(timedRange.start);\n var end = marker_1.addDays(start, dayCnt);\n return {\n start: start,\n end: end\n };\n }", "function getWorkDates(boundDates, holidays) {\n const { minDate, maxDueDate} = boundDates;\n const workdays = [];\n const lastDate = maxDueDate;\n let withinBounds = true, nextDate = minDate; \n do {\n if (!isWeekendOrHoliday(nextDate, holidays))\n workdays.push(nextDate);\n nextDate = new Date(nextDate);\n nextDate.setDate(nextDate.getDate() + 1);\n withinBounds = nextDate < lastDate; \n } while (withinBounds);\n workdays.push(maxDueDate);\n return workdays;\n}", "function dateRangeCalculator(){\n\n\t//start date\n\n\t//end date\n\n\t//Api call request that reloads page/section based off of time span requested OR trimming original data object/array based off of new specified date range \n\n\n}", "function normalizeRange(range, tDateProfile, dateEnv) {\n if (!tDateProfile.isTimeScale) {\n range = Object(_fullcalendar_core__WEBPACK_IMPORTED_MODULE_0__[\"computeVisibleDayRange\"])(range);\n if (tDateProfile.largeUnit) {\n var dayRange = range; // preserve original result\n range = {\n start: dateEnv.startOf(range.start, tDateProfile.largeUnit),\n end: dateEnv.startOf(range.end, tDateProfile.largeUnit)\n };\n // if date is partially through the interval, or is in the same interval as the start,\n // make the exclusive end be the *next* interval\n if (range.end.valueOf() !== dayRange.end.valueOf() || range.end <= range.start) {\n range = {\n start: range.start,\n end: dateEnv.add(range.end, tDateProfile.slotDuration)\n };\n }\n }\n }\n return range;\n}", "function generateDayWiseTimeSeries(baseval, count, yrange) {\n var i = 0;\n var series = [];\n\n while (i < count) {\n var x = baseval;\n var y = Math.floor(Math.random() * (yrange.max - yrange.min + 1)) + yrange.min;\n series.push([x, y]);\n baseval += 86400000;\n i++;\n }\n\n return series;\n} //", "function normalizeEventRangeTimes(range) {\n\t\tif (range.allDay == null) {\n\t\t\trange.allDay = !(range.start.hasTime() || (range.end && range.end.hasTime()));\n\t\t}\n\n\t\tif (range.allDay) {\n\t\t\trange.start.stripTime();\n\t\t\tif (range.end) {\n\t\t\t\t// TODO: consider nextDayThreshold here? If so, will require a lot of testing and adjustment\n\t\t\t\trange.end.stripTime();\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif (!range.start.hasTime()) {\n\t\t\t\trange.start = t.rezoneDate(range.start); // will assign a 00:00 time\n\t\t\t}\n\t\t\tif (range.end && !range.end.hasTime()) {\n\t\t\t\trange.end = t.rezoneDate(range.end); // will assign a 00:00 time\n\t\t\t}\n\t\t}\n\t}", "function getDaysArray (start, end) {\n for(var dt=new Date(start); dt<=end; dt.setDate(dt.getDate()+1)){\n groundTruthCopy.push({date: new Date(dt), y: -999});\n }\n }", "function dt_add_rangedate_filter(begindate_id, enddate_id, dateCol) {\n $.fn.dataTableExt.afnFiltering.push(\n function( oSettings, aData, iDataIndex ) {\n\n var beginDate = Date_from_syspref($(\"#\"+begindate_id).val()).getTime();\n var endDate = Date_from_syspref($(\"#\"+enddate_id).val()).getTime();\n\n var data = Date_from_syspref(aData[dateCol]).getTime();\n\n if ( !parseInt(beginDate) && ! parseInt(endDate) ) {\n return true;\n }\n else if ( beginDate <= data && !parseInt(endDate) ) {\n return true;\n }\n else if ( data <= endDate && !parseInt(beginDate) ) {\n return true;\n }\n else if ( beginDate <= data && data <= endDate) {\n return true;\n }\n return false;\n }\n );\n}", "function generateDayWiseTimeSeries(baseval, count, yrange) {\r\n var i = 0;\r\n var series = [];\r\n\r\n while (i < count) {\r\n var x = baseval;\r\n var y = Math.floor(Math.random() * (yrange.max - yrange.min + 1)) + yrange.min;\r\n series.push([x, y]);\r\n baseval += 86400000;\r\n i++;\r\n }\r\n\r\n return series;\r\n } // missing or null values area chart", "function normalizeEventRangeTimes(range) {\n if (range.allDay == null) {\n range.allDay = !(range.start.hasTime() || (range.end && range.end.hasTime()));\n }\n\n if (range.allDay) {\n range.start.stripTime();\n if (range.end) {\n // TODO: consider nextDayThreshold here? If so, will require a lot of testing and adjustment\n range.end.stripTime();\n }\n }\n else {\n if (!range.start.hasTime()) {\n range.start = t.rezoneDate(range.start); // will assign a 00:00 time\n }\n if (range.end && !range.end.hasTime()) {\n range.end = t.rezoneDate(range.end); // will assign a 00:00 time\n }\n }\n }", "function generateDayWiseTimeSeries(baseval, count, yrange) {\n var i = 0;\n var series = [];\n while (i < count) {\n var x = baseval;\n var y = Math.floor(Math.random() * (yrange.max - yrange.min + 1)) + yrange.min;\n\n series.push([x, y]);\n baseval += 86400000;\n i++;\n }\n return series;\n}", "function generateDayWiseTimeSeries(baseval, count, yrange) {\n var i = 0;\n var series = [];\n while (i < count) {\n var x = baseval;\n var y = Math.floor(Math.random() * (yrange.max - yrange.min + 1)) + yrange.min;\n\n series.push([x, y]);\n baseval += 86400000;\n i++;\n }\n return series;\n}", "function makeRange() {\n var result = {}\n /*\n year: 2015,\n month: [3, 4],\n days: [[30, 31], [1,2,3,4,5,6]],\n */\n ;\n\n var startDate = new Date($scope.range.start);\n var endDate = new Date($scope.range.end);\n\n var yearNum = startDate.getFullYear();\n\n var startDay = startDate.getDate();\n var endDay = endDate.getDate();\n\n\n var startMonthNum = (startDate.getMonth() + 1);\n var endMonthNum = (endDate.getMonth() + 1);\n\n var daysInStartDate = new Date(yearNum, startMonthNum, 0).getDate();\n\n //define month array\n console.log(startMonthNum + ' - ' + endMonthNum);\n if(startMonthNum === endMonthNum) {\n month = [startMonthNum, null];\n } else {\n month = [startMonthNum, endMonthNum];\n }\n\n //define days array\n var days = [[],[]];\n\n if(month[1] === null) {\n for(var i = startDay; i <= endDay; i++) {\n days[0].push(i);\n }\n\n days[1] = null;\n } else {\n for(var i = startDay; i <= daysInStartDate; i++) {\n days[0].push(i);\n }\n\n for(var j = 1; j <= endDay; j++){\n days[1].push(j);\n }\n }\n\n result.year = yearNum;\n result.month = month;\n result.days = days;\n\n return result;\n }", "function expandEvent(abstractEvent, _rangeStart, _rangeEnd) {\n var events = [];\n var dowHash;\n var dow;\n var i;\n var date;\n var startTime, endTime;\n var start, end;\n var event;\n\n _rangeStart = _rangeStart || rangeStart;\n _rangeEnd = _rangeEnd || rangeEnd;\n\n if (abstractEvent) {\n if (abstractEvent._recurring) {\n\n // make a boolean hash as to whether the event occurs on each day-of-week\n if ((dow = abstractEvent.dow)) {\n dowHash = {};\n for (i = 0; i < dow.length; i++) {\n dowHash[dow[i]] = true;\n }\n }\n\n // iterate through every day in the current range\n date = _rangeStart.clone().stripTime(); // holds the date of the current day\n while (date.isBefore(_rangeEnd)) {\n\n if (!dowHash || dowHash[date.day()]) { // if everyday, or this particular day-of-week\n\n startTime = abstractEvent.start; // the stored start and end properties are times (Durations)\n endTime = abstractEvent.end; // \"\n start = date.clone();\n end = null;\n\n if (startTime) {\n start = start.time(startTime);\n }\n if (endTime) {\n end = date.clone().time(endTime);\n }\n\n event = $.extend({}, abstractEvent); // make a copy of the original\n assignDatesToEvent(\n start, end,\n !startTime && !endTime, // allDay?\n event\n );\n events.push(event);\n }\n\n date.add(1, 'days');\n }\n }\n else {\n events.push(abstractEvent); // return the original event. will be a one-item array\n }\n }\n\n return events;\n }", "function evaporator(evap_per_day, threshold){ \n var day = 0;\n var effectiveDeodrantLeft = 100;\n evap_per_day /= 100;\n \n while(effectiveDeodrantLeft > threshold){\n day ++;\n effectiveDeodrantLeft *= (1- evap_per_day);\n }\n return day;\n}", "buildRenderRange(currentRange, currentRangeUnit, isRangeAllDay) {\n let renderRange = super.buildRenderRange(currentRange, currentRangeUnit, isRangeAllDay);\n let { props } = this;\n return buildDayTableRenderRange({\n currentRange: renderRange,\n snapToWeek: /^(year|month)$/.test(currentRangeUnit),\n fixedWeekCount: props.fixedWeekCount,\n dateEnv: props.dateEnv,\n });\n }", "function findNextAvailability(initialSearchRange, existingEvents)\n {\n var new_range = initialSearchRange;\n var next;\n for (var i = 0; i < existingEvents.length; i++)\n {\n next = nextRangeStart(new_range, existingEvents);\n if (next)\n {\n new_range = moment.range(next, moment(next).add(initialSearchRange.valueOf(), 'ms'));\n }\n else\n {\n return new_range;\n }\n }\n return new_range;\n }", "function expandRecurringRanges(eventDef, framingRange, dateEnv) {\n var typeDef = recurringTypes[eventDef.recurringDef.typeId];\n var markers = typeDef.expand(eventDef.recurringDef.typeData, eventDef, framingRange, dateEnv); // the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to\n\n if (eventDef.allDay) {\n markers = markers.map(marker_1.startOfDay);\n }\n\n return markers;\n }", "function expandEvent(abstractEvent, _rangeStart, _rangeEnd) {\n\t\t\tvar events = [];\n\t\t\tvar dowHash;\n\t\t\tvar dow;\n\t\t\tvar i;\n\t\t\tvar date;\n\t\t\tvar startTime, endTime;\n\t\t\tvar start, end;\n\t\t\tvar event;\n\n\t\t\t_rangeStart = _rangeStart || rangeStart;\n\t\t\t_rangeEnd = _rangeEnd || rangeEnd;\n\n\t\t\tif (abstractEvent) {\n\t\t\t\tif (abstractEvent._recurring) {\n\n\t\t\t\t\t// make a boolean hash as to whether the event occurs on each day-of-week\n\t\t\t\t\tif ((dow = abstractEvent.dow)) {\n\t\t\t\t\t\tdowHash = {};\n\t\t\t\t\t\tfor (i = 0; i < dow.length; i++) {\n\t\t\t\t\t\t\tdowHash[dow[i]] = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// iterate through every day in the current range\n\t\t\t\t\tdate = _rangeStart.clone().stripTime(); // holds the date of the current day\n\t\t\t\t\twhile (date.isBefore(_rangeEnd)) {\n\n\t\t\t\t\t\tif (!dowHash || dowHash[date.day()]) { // if everyday, or this particular day-of-week\n\n\t\t\t\t\t\t\tstartTime = abstractEvent.start; // the stored start and end properties are times (Durations)\n\t\t\t\t\t\t\tendTime = abstractEvent.end; // \"\n\t\t\t\t\t\t\tstart = date.clone();\n\t\t\t\t\t\t\tend = null;\n\n\t\t\t\t\t\t\tif (startTime) {\n\t\t\t\t\t\t\t\tstart = start.time(startTime);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (endTime) {\n\t\t\t\t\t\t\t\tend = date.clone().time(endTime);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tevent = $.extend({}, abstractEvent); // make a copy of the original\n\t\t\t\t\t\t\tassignDatesToEvent(\n\t\t\t\t\t\t\t\tstart, end,\n\t\t\t\t\t\t\t\t!startTime && !endTime, // allDay?\n\t\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tevents.push(event);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdate.add(1, 'days');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tevents.push(abstractEvent); // return the original event. will be a one-item array\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn events;\n\t\t}", "function getDateCriteria(dateRange) {\n switch (dateRange) {\n case \"Daily\":\n return new Date(Date.now() - 24 * 60 * 60 * 1000);\n break;\n case \"Weekly\":\n return new Date(Date.now() - 7 * 24 * 60 * 60 * 1000);\n break;\n case \"Monthly\":\n return new Date(Date.now() - 4 * 7 * 24 * 60 * 60 * 1000);\n break;\n case \"Annual\":\n return new Date(Date.now() - 12 * 4 * 7 * 24 * 60 * 60 * 1000);\n break;\n }\n}", "function expandEvent(abstractEvent, _rangeStart, _rangeEnd) {\n\t\tvar events = [];\n\t\tvar dowHash;\n\t\tvar dow;\n\t\tvar i;\n\t\tvar date;\n\t\tvar startTime, endTime;\n\t\tvar start, end;\n\t\tvar event;\n\n\t\t_rangeStart = _rangeStart || rangeStart;\n\t\t_rangeEnd = _rangeEnd || rangeEnd;\n\n\t\tif (abstractEvent) {\n\t\t\tif (abstractEvent._recurring) {\n\n\t\t\t\t// make a boolean hash as to whether the event occurs on each day-of-week\n\t\t\t\tif ((dow = abstractEvent.dow)) {\n\t\t\t\t\tdowHash = {};\n\t\t\t\t\tfor (i = 0; i < dow.length; i++) {\n\t\t\t\t\t\tdowHash[dow[i]] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// iterate through every day in the current range\n\t\t\t\tdate = _rangeStart.clone().stripTime(); // holds the date of the current day\n\t\t\t\twhile (date.isBefore(_rangeEnd)) {\n\n\t\t\t\t\tif (!dowHash || dowHash[date.day()]) { // if everyday, or this particular day-of-week\n\n\t\t\t\t\t\tstartTime = abstractEvent.start; // the stored start and end properties are times (Durations)\n\t\t\t\t\t\tendTime = abstractEvent.end; // \"\n\t\t\t\t\t\tstart = date.clone();\n\t\t\t\t\t\tend = null;\n\n\t\t\t\t\t\tif (startTime) {\n\t\t\t\t\t\t\tstart = start.time(startTime);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (endTime) {\n\t\t\t\t\t\t\tend = date.clone().time(endTime);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tevent = $.extend({}, abstractEvent); // make a copy of the original\n\t\t\t\t\t\tassignDatesToEvent(\n\t\t\t\t\t\t\tstart, end,\n\t\t\t\t\t\t\t!startTime && !endTime, // allDay?\n\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t);\n\t\t\t\t\t\tevents.push(event);\n\t\t\t\t\t}\n\n\t\t\t\t\tdate.add(1, 'days');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tevents.push(abstractEvent); // return the original event. will be a one-item array\n\t\t\t}\n\t\t}\n\n\t\treturn events;\n\t}", "function expandEvent(abstractEvent, _rangeStart, _rangeEnd) {\n\t\tvar events = [];\n\t\tvar dowHash;\n\t\tvar dow;\n\t\tvar i;\n\t\tvar date;\n\t\tvar startTime, endTime;\n\t\tvar start, end;\n\t\tvar event;\n\n\t\t_rangeStart = _rangeStart || rangeStart;\n\t\t_rangeEnd = _rangeEnd || rangeEnd;\n\n\t\tif (abstractEvent) {\n\t\t\tif (abstractEvent._recurring) {\n\n\t\t\t\t// make a boolean hash as to whether the event occurs on each day-of-week\n\t\t\t\tif ((dow = abstractEvent.dow)) {\n\t\t\t\t\tdowHash = {};\n\t\t\t\t\tfor (i = 0; i < dow.length; i++) {\n\t\t\t\t\t\tdowHash[dow[i]] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// iterate through every day in the current range\n\t\t\t\tdate = _rangeStart.clone().stripTime(); // holds the date of the current day\n\t\t\t\twhile (date.isBefore(_rangeEnd)) {\n\n\t\t\t\t\tif (!dowHash || dowHash[date.day()]) { // if everyday, or this particular day-of-week\n\n\t\t\t\t\t\tstartTime = abstractEvent.start; // the stored start and end properties are times (Durations)\n\t\t\t\t\t\tendTime = abstractEvent.end; // \"\n\t\t\t\t\t\tstart = date.clone();\n\t\t\t\t\t\tend = null;\n\n\t\t\t\t\t\tif (startTime) {\n\t\t\t\t\t\t\tstart = start.time(startTime);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (endTime) {\n\t\t\t\t\t\t\tend = date.clone().time(endTime);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tevent = $.extend({}, abstractEvent); // make a copy of the original\n\t\t\t\t\t\tassignDatesToEvent(\n\t\t\t\t\t\t\tstart, end,\n\t\t\t\t\t\t\t!startTime && !endTime, // allDay?\n\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t);\n\t\t\t\t\t\tevents.push(event);\n\t\t\t\t\t}\n\n\t\t\t\t\tdate.add(1, 'days');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tevents.push(abstractEvent); // return the original event. will be a one-item array\n\t\t\t}\n\t\t}\n\n\t\treturn events;\n\t}", "function expandEvent(abstractEvent, _rangeStart, _rangeEnd) {\n\t\tvar events = [];\n\t\tvar dowHash;\n\t\tvar dow;\n\t\tvar i;\n\t\tvar date;\n\t\tvar startTime, endTime;\n\t\tvar start, end;\n\t\tvar event;\n\n\t\t_rangeStart = _rangeStart || rangeStart;\n\t\t_rangeEnd = _rangeEnd || rangeEnd;\n\n\t\tif (abstractEvent) {\n\t\t\tif (abstractEvent._recurring) {\n\n\t\t\t\t// make a boolean hash as to whether the event occurs on each day-of-week\n\t\t\t\tif ((dow = abstractEvent.dow)) {\n\t\t\t\t\tdowHash = {};\n\t\t\t\t\tfor (i = 0; i < dow.length; i++) {\n\t\t\t\t\t\tdowHash[dow[i]] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// iterate through every day in the current range\n\t\t\t\tdate = _rangeStart.clone().stripTime(); // holds the date of the current day\n\t\t\t\twhile (date.isBefore(_rangeEnd)) {\n\n\t\t\t\t\tif (!dowHash || dowHash[date.day()]) { // if everyday, or this particular day-of-week\n\n\t\t\t\t\t\tstartTime = abstractEvent.start; // the stored start and end properties are times (Durations)\n\t\t\t\t\t\tendTime = abstractEvent.end; // \"\n\t\t\t\t\t\tstart = date.clone();\n\t\t\t\t\t\tend = null;\n\n\t\t\t\t\t\tif (startTime) {\n\t\t\t\t\t\t\tstart = start.time(startTime);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (endTime) {\n\t\t\t\t\t\t\tend = date.clone().time(endTime);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tevent = $.extend({}, abstractEvent); // make a copy of the original\n\t\t\t\t\t\tassignDatesToEvent(\n\t\t\t\t\t\t\tstart, end,\n\t\t\t\t\t\t\t!startTime && !endTime, // allDay?\n\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t);\n\t\t\t\t\t\tevents.push(event);\n\t\t\t\t\t}\n\n\t\t\t\t\tdate.add(1, 'days');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tevents.push(abstractEvent); // return the original event. will be a one-item array\n\t\t\t}\n\t\t}\n\n\t\treturn events;\n\t}", "function expandEvent(abstractEvent, _rangeStart, _rangeEnd) {\n\t\tvar events = [];\n\t\tvar dowHash;\n\t\tvar dow;\n\t\tvar i;\n\t\tvar date;\n\t\tvar startTime, endTime;\n\t\tvar start, end;\n\t\tvar event;\n\n\t\t_rangeStart = _rangeStart || rangeStart;\n\t\t_rangeEnd = _rangeEnd || rangeEnd;\n\n\t\tif (abstractEvent) {\n\t\t\tif (abstractEvent._recurring) {\n\n\t\t\t\t// make a boolean hash as to whether the event occurs on each day-of-week\n\t\t\t\tif ((dow = abstractEvent.dow)) {\n\t\t\t\t\tdowHash = {};\n\t\t\t\t\tfor (i = 0; i < dow.length; i++) {\n\t\t\t\t\t\tdowHash[dow[i]] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// iterate through every day in the current range\n\t\t\t\tdate = _rangeStart.clone().stripTime(); // holds the date of the current day\n\t\t\t\twhile (date.isBefore(_rangeEnd)) {\n\n\t\t\t\t\tif (!dowHash || dowHash[date.day()]) { // if everyday, or this particular day-of-week\n\n\t\t\t\t\t\tstartTime = abstractEvent.start; // the stored start and end properties are times (Durations)\n\t\t\t\t\t\tendTime = abstractEvent.end; // \"\n\t\t\t\t\t\tstart = date.clone();\n\t\t\t\t\t\tend = null;\n\n\t\t\t\t\t\tif (startTime) {\n\t\t\t\t\t\t\tstart = start.time(startTime);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (endTime) {\n\t\t\t\t\t\t\tend = date.clone().time(endTime);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tevent = $.extend({}, abstractEvent); // make a copy of the original\n\t\t\t\t\t\tassignDatesToEvent(\n\t\t\t\t\t\t\tstart, end,\n\t\t\t\t\t\t\t!startTime && !endTime, // allDay?\n\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t);\n\t\t\t\t\t\tevents.push(event);\n\t\t\t\t\t}\n\n\t\t\t\t\tdate.add(1, 'days');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tevents.push(abstractEvent); // return the original event. will be a one-item array\n\t\t\t}\n\t\t}\n\n\t\treturn events;\n\t}", "function expandEvent(abstractEvent, _rangeStart, _rangeEnd) {\n\t\tvar events = [];\n\t\tvar dowHash;\n\t\tvar dow;\n\t\tvar i;\n\t\tvar date;\n\t\tvar startTime, endTime;\n\t\tvar start, end;\n\t\tvar event;\n\n\t\t_rangeStart = _rangeStart || rangeStart;\n\t\t_rangeEnd = _rangeEnd || rangeEnd;\n\n\t\tif (abstractEvent) {\n\t\t\tif (abstractEvent._recurring) {\n\n\t\t\t\t// make a boolean hash as to whether the event occurs on each day-of-week\n\t\t\t\tif ((dow = abstractEvent.dow)) {\n\t\t\t\t\tdowHash = {};\n\t\t\t\t\tfor (i = 0; i < dow.length; i++) {\n\t\t\t\t\t\tdowHash[dow[i]] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// iterate through every day in the current range\n\t\t\t\tdate = _rangeStart.clone().stripTime(); // holds the date of the current day\n\t\t\t\twhile (date.isBefore(_rangeEnd)) {\n\n\t\t\t\t\tif (!dowHash || dowHash[date.day()]) { // if everyday, or this particular day-of-week\n\n\t\t\t\t\t\tstartTime = abstractEvent.start; // the stored start and end properties are times (Durations)\n\t\t\t\t\t\tendTime = abstractEvent.end; // \"\n\t\t\t\t\t\tstart = date.clone();\n\t\t\t\t\t\tend = null;\n\n\t\t\t\t\t\tif (startTime) {\n\t\t\t\t\t\t\tstart = start.time(startTime);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (endTime) {\n\t\t\t\t\t\t\tend = date.clone().time(endTime);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tevent = $.extend({}, abstractEvent); // make a copy of the original\n\t\t\t\t\t\tassignDatesToEvent(\n\t\t\t\t\t\t\tstart, end,\n\t\t\t\t\t\t\t!startTime && !endTime, // allDay?\n\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t);\n\t\t\t\t\t\tevents.push(event);\n\t\t\t\t\t}\n\n\t\t\t\t\tdate.add(1, 'days');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tevents.push(abstractEvent); // return the original event. will be a one-item array\n\t\t\t}\n\t\t}\n\n\t\treturn events;\n\t}", "function expandEvent(abstractEvent, _rangeStart, _rangeEnd) {\n\t\tvar events = [];\n\t\tvar dowHash;\n\t\tvar dow;\n\t\tvar i;\n\t\tvar date;\n\t\tvar startTime, endTime;\n\t\tvar start, end;\n\t\tvar event;\n\n\t\t_rangeStart = _rangeStart || rangeStart;\n\t\t_rangeEnd = _rangeEnd || rangeEnd;\n\n\t\tif (abstractEvent) {\n\t\t\tif (abstractEvent._recurring) {\n\n\t\t\t\t// make a boolean hash as to whether the event occurs on each day-of-week\n\t\t\t\tif ((dow = abstractEvent.dow)) {\n\t\t\t\t\tdowHash = {};\n\t\t\t\t\tfor (i = 0; i < dow.length; i++) {\n\t\t\t\t\t\tdowHash[dow[i]] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// iterate through every day in the current range\n\t\t\t\tdate = _rangeStart.clone().stripTime(); // holds the date of the current day\n\t\t\t\twhile (date.isBefore(_rangeEnd)) {\n\n\t\t\t\t\tif (!dowHash || dowHash[date.day()]) { // if everyday, or this particular day-of-week\n\n\t\t\t\t\t\tstartTime = abstractEvent.start; // the stored start and end properties are times (Durations)\n\t\t\t\t\t\tendTime = abstractEvent.end; // \"\n\t\t\t\t\t\tstart = date.clone();\n\t\t\t\t\t\tend = null;\n\n\t\t\t\t\t\tif (startTime) {\n\t\t\t\t\t\t\tstart = start.time(startTime);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (endTime) {\n\t\t\t\t\t\t\tend = date.clone().time(endTime);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tevent = $.extend({}, abstractEvent); // make a copy of the original\n\t\t\t\t\t\tassignDatesToEvent(\n\t\t\t\t\t\t\tstart, end,\n\t\t\t\t\t\t\t!startTime && !endTime, // allDay?\n\t\t\t\t\t\t\tevent\n\t\t\t\t\t\t);\n\t\t\t\t\t\tevents.push(event);\n\t\t\t\t\t}\n\n\t\t\t\t\tdate.add(1, 'days');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tevents.push(abstractEvent); // return the original event. will be a one-item array\n\t\t\t}\n\t\t}\n\n\t\treturn events;\n\t}", "function newDates(low, high){\n /* let tempArray = [];\n for(var i=0; i<datesProvided.length; i++){\n if ((i>=low) && (i<=high)){\n tempArray.push(new Date(datesProvided[i]));\n }\n }\n\n //And one last value to account for range\n let tempDate = new Date(tempArray[tempArray.length-1])\n console.log(\"Temp Date:\")\n console.log(tempDate)\n let moreMinutes = tempDate.getMinutes();\n console.log(\"Minutes: \")\n console.log(moreMinutes)\n console.log(selectionInterval)\n console.log((moreMinutes+(+selectionInterval)))\n tempDate.setMinutes((moreMinutes+(+selectionInterval)))\n console.log(\"New Temp Date\")\n console.log(tempDate)\n tempArray.push(tempDate)\n\n return tempArray;*/\n let tempArray = [];\n for(var i=low; i<=high; i++){\n tempArray.push(new Date(datesProvided[i]));\n }\n\n //And one last value to account for range\n let tempDate = new Date(tempArray[tempArray.length-1])\n console.log(\"Temp Date:\")\n console.log(tempDate)\n let moreMinutes = tempDate.getMinutes();\n console.log(\"Minutes: \")\n console.log(moreMinutes)\n console.log(selectionInterval)\n console.log((moreMinutes+(+selectionInterval)))\n tempDate.setMinutes((moreMinutes+(+selectionInterval)))\n console.log(\"New Temp Date\")\n console.log(tempDate)\n tempArray.push(tempDate)\n\n return tempArray;\n}", "function initDateRange() {\n\tvar elements = $('[data-date-range-set]');\n\t\n\t// defining constants\n\tvar con = {'CURRENT_WEEK': 0,\n\t\t\t'CURRENT_MONTH' : 1,\n\t\t\t'DAYS_30': 2,\n\t\t\t'LAST_MONTH': 3\n\t\t};\n\t\n\tif (elements.length === 0) {\n\t\treturn;\n\t}\n\telements.click(function(e) {\n\t\tconf = $(this).attr('data-date-range-set');\n\t\tvar from = new Date();\n\t\tvar to = new Date();\n\t\tswitch(con[conf]) {\n\t\t\tcase con.CURRENT_WEEK:\n\t\t\t\tfrom.setDate(from.getDate() - from.getDay() + 1);\n\t\t\t\t$($(this).attr('data-date-range-input-from')).val(dateToString(from));\n\t\t\t\t$($(this).attr('data-date-range-input-to')).val(dateToString());\n\t\t\t\tbreak;\n\t\t\tcase con.CURRENT_MONTH:\n\t\t\t\tfrom.setDate(1);\n\t\t\t\t$($(this).attr('data-date-range-input-from')).val(dateToString(from));\n\t\t\t\t$($(this).attr('data-date-range-input-to')).val(dateToString());\n\t\t\t\tbreak;\n\t\t\tcase con.DAYS_30:\n\t\t\t\tfrom.setDate(from.getDate() - 30);\n\t\t\t\t$($(this).attr('data-date-range-input-from')).val(dateToString(from));\n\t\t\t\t$($(this).attr('data-date-range-input-to')).val(dateToString());\n\t\t\t\tbreak;\n\t\t\tcase con.LAST_MONTH:\n\t\t\t\tfrom.setMonth(from.getMonth() - 1);\n\t\t\t\tfrom.setDate(1);\n\t\t\t\t$($(this).attr('data-date-range-input-from')).val(dateToString(from));\n\t\t\t\t\n\t\t\t\tto.setDate(0);\n\t\t\t\t$($(this).attr('data-date-range-input-to')).val(dateToString(to));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t});\n}", "function evaporator(evap_per_day, threshold){ \n threshold = threshold / 100\n evap_per_day = evap_per_day / 100\n return Math.ceil(Math.log(threshold) / Math.log(1-evap_per_day))\n}", "getAllInBetweenDates(sStartDate, sEndDate) {\n let aDates = [];\n //to avoid modifying the original date\n const oStartDate = new Date(sStartDate);\n const oEndDate = new Date(sEndDate);\n while (oStartDate <= oEndDate) {\n aDates = [...aDates, new Date(oStartDate)];\n oStartDate.setDate(oStartDate.getDate() + 1)\n }\n return aDates;\n }", "findRangeofDates(){ \n\t\tlet min=new Date(2030,1,1); \n\t\tlet max=new Date(1990,1,1);\n\t\tconst ar=this.props.data;\n\t\tfor(let i=0;i<ar.length;i++){\n\t\t\tif(ar[i].start<min)\n\t\t\t\tmin=ar[i].start;\n\t\t\tif(ar[i].end>max)\n\t\t\t\tmax=ar[i].end;\n\t\t}\n\t\tthis.min=min;\n\t\tthis.max=max;\n\t}", "function computeActiveRange(dateProfile, isComponentAllDay) {\n var range = dateProfile.activeRange;\n\n if (isComponentAllDay) {\n return range;\n }\n\n return {\n start: addMs(range.start, dateProfile.minTime.milliseconds),\n end: addMs(range.end, dateProfile.maxTime.milliseconds - 864e5) // 864e5 = ms in a day\n\n };\n } // exports", "function setEndRange(date, days) {\r\n var msSpan = days*24*3600*1000;\r\n var endDate = new Date(date.getTime() + msSpan);\r\n //$(\"#date2\").val(endDate.toISOString().split('T')[0]);\r\n $(\"#date2\").val(momentLA_Date(endDate));\r\n}", "createDateRange_backup(startDate, endDate, cycle, cyclePeriod)\n {\n \n let out = [];\n let currentDate = moment(startDate);\n let stopDate = moment(endDate);\n\n let period = cycle == enums.timecard.frequency.semimonthly ? 15 : cyclePeriod;\n\n if(cycle == enums.timecard.frequency.daterange)\n {\n out.push( {\n startDate : moment(currentDate).clone().format('YYYY-MM-DD'),\n endDate : moment(endDate).clone().format('YYYY-MM-DD')\n })\n \n }\n else\n { \n while (currentDate <= stopDate) \n {\n // if (maxDate && moment(currentDate).isAfter(maxDate, 'day')) {\n // break;\n // }\n if(cycle == enums.timecard.frequency.monthly)\n {\n out.push( {\n startDate : moment(currentDate).format('YYYY-MM-DD'),\n endDate : moment(currentDate).endOf('month').format('YYYY-MM-DD')\n })\n \n currentDate = moment(currentDate).endOf('month').add(1, 'days');\n }\n else if(cycle == enums.timecard.frequency.semimonthly)\n { \n \n let dt = moment(new Date(currentDate.clone().format('YYYY')+'-'+(currentDate.clone().format('MM'))+'-'+15));\n \n if( currentDate < dt )\n {\n \n out.push({\n startDate : moment(currentDate).format('YYYY-MM-DD'),\n endDate : dt.format('YYYY-MM-DD')\n })\n currentDate = moment(dt.add(1, 'days').format('YYYY-MM-DD'))\n }\n else\n {\n out.push({\n startDate : moment(currentDate).format('YYYY-MM-DD'),\n endDate : dt.endOf('month').format('YYYY-MM-DD')\n })\n currentDate = moment(currentDate.endOf('month').add(1, 'days').format('YYYY-MM-DD'))\n }\n }\n else if(cycle == enums.timecard.frequency.specialcycle)\n {\n \n if( moment(currentDate).clone().format('MM') != moment(currentDate).clone().add(period, 'days').format('MM') )\n {\n out.push( {\n startDate : moment(currentDate).format('YYYY-MM-DD'),\n endDate : moment(currentDate).endOf('month').format('YYYY-MM-DD')\n })\n \n currentDate = moment(currentDate).endOf('month').add(1, 'days');\n }\n else\n {\n out.push( {\n startDate : moment(currentDate).format('YYYY-MM-DD'),\n endDate : moment(currentDate).clone().add(period, 'days').format('YYYY-MM-DD')\n })\n \n currentDate = moment(currentDate).add(period+1, 'days');\n }\n \n }\n else if(cycle == enums.timecard.frequency.biweekly) \n {\n out.push( {\n startDate : moment(currentDate).format('YYYY-MM-DD'),\n endDate : moment(currentDate).endOf('isoWeek').add(1, 'days').endOf('isoWeek').format('YYYY-MM-DD')\n })\n currentDate = moment(currentDate).endOf('isoWeek').add(1, 'days').endOf('isoWeek').add(1, 'days');\n }\n else if(cycle == enums.timecard.frequency.weekly) \n {\n if( moment(currentDate).clone().format('MM') != moment(currentDate).clone().endOf('isoWeek').add(1, 'days').format('MM') )\n {\n out.push( {\n startDate : moment(currentDate).format('YYYY-MM-DD'),\n endDate : moment(currentDate).endOf('month').format('YYYY-MM-DD')\n })\n \n currentDate = moment(currentDate).endOf('month').add(1, 'days');\n }\n else\n {\n out.push( {\n startDate : moment(currentDate).format('YYYY-MM-DD'),\n endDate : moment(currentDate).endOf('isoWeek').format('YYYY-MM-DD')\n })\n currentDate = moment(currentDate).endOf('isoWeek').add(1, 'days');\n }\n }\n else\n {\n out.push([])\n }\n }\n }\n\n\n return _.orderBy(out, ['startDate'],['desc']);\n \n }", "function setAgtTimePeriod(d){\n var minDate = parseDate(newMinDay);\n var maxDate = parseDate(newMaxDay);\n var agmtDat = d.Dat;\n if ((agmtDat >= minDate) && (agmtDat <= maxDate)){\n return d;\n }\n }", "findShallowIntersectingRange(date1, date2) {\n const thisRange = date1.toRange();\n const otherRange = date2.toRange(); // Start with infinite start and end dates\n\n let start = null;\n let end = null; // This start date exists\n\n if (thisRange.start) {\n // Use this definite start date if other start date is infinite\n if (!otherRange.start) {\n start = thisRange.start;\n } else {\n // Otherwise, use the earliest start date\n start = thisRange.start < otherRange.start ? thisRange.start : otherRange.start;\n } // Other start date exists\n\n } else if (otherRange.start) {\n // Use other definite start date as this one is infinite\n start = otherRange.start;\n } // Assign end date to this one if it is valid\n\n\n if (thisRange.end && (!start || thisRange.end >= start)) {\n end = thisRange.end;\n } // Assign end date to other one if it is valid and before this one\n\n\n if (otherRange.end && (!start || otherRange.end >= start)) {\n if (!end || otherRange.end < end) end = otherRange.end;\n } // Return calculated range\n\n\n return {\n start,\n end\n };\n }", "findShallowIntersectingRange(date1, date2) {\n const thisRange = date1.toRange();\n const otherRange = date2.toRange(); // Start with infinite start and end dates\n\n let start = null;\n let end = null; // This start date exists\n\n if (thisRange.start) {\n // Use this definite start date if other start date is infinite\n if (!otherRange.start) {\n start = thisRange.start;\n } else {\n // Otherwise, use the earliest start date\n start = thisRange.start < otherRange.start ? thisRange.start : otherRange.start;\n } // Other start date exists\n\n } else if (otherRange.start) {\n // Use other definite start date as this one is infinite\n start = otherRange.start;\n } // Assign end date to this one if it is valid\n\n\n if (thisRange.end && (!start || thisRange.end >= start)) {\n end = thisRange.end;\n } // Assign end date to other one if it is valid and before this one\n\n\n if (otherRange.end && (!start || otherRange.end >= start)) {\n if (!end || otherRange.end < end) end = otherRange.end;\n } // Return calculated range\n\n\n return {\n start,\n end\n };\n }", "function expandRecurringRanges(eventDef, framingRange, dateEnv, recurringTypes) {\n var typeDef = recurringTypes[eventDef.recurringDef.typeId];\n var markers = typeDef.expand(eventDef.recurringDef.typeData, framingRange, dateEnv);\n // the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to\n if (eventDef.allDay) {\n markers = markers.map(startOfDay);\n }\n return markers;\n }", "function nextRangeStart(range, existingEvents)\n {\n for (var j = 0; j < existingEvents.length; j++)\n {\n if (range.overlaps(existingEvents[j]))\n {\n return moment(existingEvents[j].end);\n }\n }\n return null;\n }", "function completeInterval(x, end) {\n var lastElement = x[x.length - 1];\n if (typeof lastElement[1] === 'undefined') {\n lastElement.push(moment(end).format('YYYY-MM-DD'));\n }\n if (lastElement[1] !== end) {\n var lastSet = [];\n lastSet.push(moment(lastElement[1]).add(1, 'day').format('YYYY-MM-DD'));\n lastSet.push(moment(end).format('YYYY-MM-DD'));\n x.push(lastSet);\n }\n}", "calculateOptimalDateRange(centerDate, panelSize, viewPreset, userProvidedSpan) {\n // this line allows us to always use the `calculateOptimalDateRange` method when calculating date range for zooming\n // (even in case when user has provided own interval)\n // other methods may override/hook into `calculateOptimalDateRange` to insert own processing\n // (infinite scrolling feature does)\n if (userProvidedSpan) return userProvidedSpan;\n const me = this,\n {\n timeAxis\n } = me,\n {\n bottomHeader\n } = viewPreset,\n tickWidth = me.isHorizontal ? viewPreset.tickWidth : viewPreset.tickHeight;\n\n if (me.zoomKeepsOriginalTimespan) {\n return {\n startDate: timeAxis.startDate,\n endDate: timeAxis.endDate\n };\n }\n\n const unit = bottomHeader.unit,\n difference = Math.ceil(panelSize / tickWidth * bottomHeader.increment * me.visibleZoomFactor / 2),\n startDate = DateHelper.add(centerDate, -difference, unit),\n endDate = DateHelper.add(centerDate, difference, unit);\n return {\n startDate: timeAxis.floorDate(startDate, false, unit, bottomHeader.increment),\n endDate: timeAxis.ceilDate(endDate, false, unit, bottomHeader.increment)\n };\n }", "function newDates1(low, high){\n let tempArray = [];\n for(var i=low; i<=high; i++){\n tempArray.push(new Date(datesProvided[i]));\n }\n\n //And one last value to account for range\n let tempDate = new Date(tempArray[tempArray.length-1])\n // console.log(\"Temp Date:\")\n // console.log(tempDate)\n let moreMinutes = tempDate.getMinutes();\n // console.log(\"Minutes: \")\n // console.log(moreMinutes)\n // console.log(selectionInterval)\n // console.log((moreMinutes+(+selectionInterval)))\n tempDate.setMinutes((moreMinutes+(+selectionInterval)))\n // console.log(\"New Temp Date\")\n // console.log(tempDate)\n tempArray.push(tempDate)\n\n return tempArray;\n}", "function computeActiveRange(dateProfile, isComponentAllDay) {\n var range = dateProfile.activeRange;\n if (isComponentAllDay) {\n return range;\n }\n return {\n start: addMs(range.start, dateProfile.minTime.milliseconds),\n end: addMs(range.end, dateProfile.maxTime.milliseconds - 864e5) // 864e5 = ms in a day\n };\n}", "function computeActiveRange(dateProfile, isComponentAllDay) {\n var range = dateProfile.activeRange;\n if (isComponentAllDay) {\n return range;\n }\n return {\n start: addMs(range.start, dateProfile.minTime.milliseconds),\n end: addMs(range.end, dateProfile.maxTime.milliseconds - 864e5) // 864e5 = ms in a day\n };\n }", "function computeActiveRange(dateProfile, isComponentAllDay) {\n var range = dateProfile.activeRange;\n if (isComponentAllDay) {\n return range;\n }\n return {\n start: addMs(range.start, dateProfile.minTime.milliseconds),\n end: addMs(range.end, dateProfile.maxTime.milliseconds - 864e5) // 864e5 = ms in a day\n };\n }", "_getDayWiseTimeSeries(baseval, count, yrange) {\n var i = 0;\n while (i < count) {\n var x = baseval;\n var y =\n Math.floor(Math.random() * (yrange.max - yrange.min + 1)) +\n yrange.min;\n \n this._precios.push({\n x,\n y,\n });\n this._lastDate = baseval;\n baseval += this._TICKINTERVAL;\n i++;\n }\n }", "getTimeRange(){\n let start = this.props.startTime instanceof IntegerTime ? this.props.startTime: IntegerTime.fromArmyTime(this.props.startTime);\n let end = this.props.endTime instanceof IntegerTime ? this.props.endTime: IntegerTime.fromArmyTime(this.props.endTime);\n return new IntegerTimeInterval(start, end);\n }", "function holDayCalc(startCheck, endCheck) {\n var ss = SpreadsheetApp.getActive(),\n s = ss.getActiveSheet();\n \n // Turn dates into an array.\n var startArray = startCheck.split('-');\n var endArray = endCheck.split('-');\n \n // The arrays are used to create new date objects.\n var startDate = new Date(startArray[0], startArray[1]-1, startArray[2], 0, 0, 0, 0),\n endDate = new Date(endArray[0], endArray[1]-1, endArray[2], 0, 0, 0, 0);\n \n // Use the dates to find the start and end sheet names.\n var sSheetName = getSheetDate(startDate),\n eSheetName = getSheetDate(endDate);\n \n // Get the start and end sheet to check on.\n var sStart = ss.getSheetByName(sSheetName);\n var sEnd = ss.getSheetByName(eSheetName);\n \n var startCal = getCalValues(sSheetName),\n endCal = getCalValues(eSheetName);\n \n // The range of the start and end calendar to be inputed into the formulas.\n var sCalA = 'A1:N' + startCal.length;\n var eCalA = 'A1:N' + endCal.length;\n \n \n var emList = createEmployeeList();\n \n var row = 57;\n if (s.getRange(52, 1).getValue()) row = 67;\n var col = 12;\n \n \n // Add the start and End of the pay period to the spreadsheet;\n s.getRange(row-2, col).setValue(startCheck).setNumberFormat(\"MMM d, yyyy\");\n s.getRange(row-2, col+2).setValue(endCheck).setNumberFormat(\"MMM d, yyyy\");\n \n //Get the A1 notation from start and end pay feilds.\n var sPayA = sEnd.getRange(row-2, col).getA1Notation(),\n ePayA = sEnd.getRange(row-2, col+2).getA1Notation();\n \n var formulas = new Array(emList.length);\n \n // Add formulas to the the array;\n for (var i=0, rowi = row; i<emList.length; i++, rowi++) {\n formulas[i] = [\"=calcPayFormula(K\" + rowi + \",\" + sPayA + \",\" + ePayA + \",'\" + sSheetName + \"'!\" + sCalA + \",'\" + eSheetName + \"'!\" + eCalA + \")\"];\n }\n // Add the formulas to check total hours worked to the calendar.\n s.getRange(row, col, emList.length, 1).setFormulas(formulas).setHorizontalAlignment('right');\n \n // Overight the formulas array to store the days worked.\n for (var i=0, rowi = row; i<emList.length; i++, rowi++) {\n formulas[i] = [\"=holDayChecker(K\" + rowi + \",\" + sPayA + \",\" + ePayA + \",'\" + sSheetName + \"'!\" + sCalA + \",'\" + eSheetName + \"'!\" + eCalA + \")\"];\n }\n // Add the formula for checking days worked.\n s.getRange(row, col+1, emList.length, 1).setFormulas(formulas).setHorizontalAlignment('right');\n \n // Overight the formulas array once again to store the very small average formula;\n for (var i=0, rowi = row; i<emList.length; i++, rowi++) {\n formulas[i] = [\"=customDivison(R[\" + 0 + \"]C[\" + -2 + \"],R[\" + 0 + \"]C[\" + -1 + \"])\"];\n }\n // Add the formula that finds average hours per day worked to the calendar.\n s.getRange(row, col+2, emList.length, 1).setFormulasR1C1(formulas).setHorizontalAlignment('right').setNumberFormat('0.00');\n}", "function expandRecurringRanges(eventDef, duration, framingRange, dateEnv, recurringTypes) {\n var typeDef = recurringTypes[eventDef.recurringDef.typeId];\n var markers = typeDef.expand(eventDef.recurringDef.typeData, {\n start: dateEnv.subtract(framingRange.start, duration),\n end: framingRange.end\n }, dateEnv); // the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to\n\n if (eventDef.allDay) {\n markers = markers.map(startOfDay);\n }\n\n return markers;\n }", "function removeOutsideDateRange(rangeStart, rangeEnd) {\n var startIndex = 0;\n var endIndex = allCalendarEvents.length - 1;\n\n for (var i = 0; i < allCalendarEvents.length - 1; i++) {\n // If an event ends after the rangeStart cutoff, it's included.\n var startCompare = compareDateTimes(allCalendarEvents[i].end, rangeStart);\n if (startCompare >= 0) {\n startIndex = i;\n break;\n }\n }\n\n for (var i = startIndex; i < allCalendarEvents.length - 1; i++) {\n // If an event starts before the rangeEnd cutoff, it's included.\n var endCompare = compareDateTimes(allCalendarEvents[i].start, rangeEnd);\n if (endCompare < 0) {\n endIndex = i;\n }\n }\n\n // I'm not sure if slice is safe to assign directly back to the array being sliced, so I'm using a temp.\n var temp = allCalendarEvents.slice(startIndex, endIndex + 1);\n allCalendarEvents = temp;\n}", "function computeActiveRange(dateProfile, isComponentAllDay) {\n var range = dateProfile.activeRange;\n if (isComponentAllDay) {\n return range;\n }\n return {\n start: addMs$1(range.start, dateProfile.minTime.milliseconds),\n end: addMs$1(range.end, dateProfile.maxTime.milliseconds - 864e5) // 864e5 = ms in a day\n };\n }", "function fillCurrent() {\n for (let i = startDay; i < endDate + startDay; i++) {\n dateArray.push(i - startDay + 1)\n }\n }", "function getTimeBoxesByInterval(start, end){\n console.log(\"getTimeBoxesByInteval called\");\n console.log(\"start:\", start, \"end:\", end);\n const allTimeBoxes = $('#life-calendar .time-box');\n console.assert(start.hour() === 0 && end.hour() === 0, \"Hours not 0:\", start, end);\n console.assert(allTimeBoxes.length > 0);\n const startMs = start.valueOf();\n const endMs = end.valueOf();\n const timeBoxesInInterval = [];\n let intervalStartEncountered = false;\n let intervalEndEncountered = false;\n let counter = 0;\n allTimeBoxes.each(function(){\n // Can't break out of loop so return immediately if there is no reason to continue iteration.\n if(intervalEndEncountered){\n return;\n }\n const tb = $(this);\n // TODO: momenttien muodostamiseen kuluu aikaa, jos niitä tehdään paljon\n const tbStartMs = lcHelpers.dataAttrToEpoch(tb, 'data-start');\n const tbEndMs = lcHelpers.dataAttrToEpoch(tb, 'data-end');\n const isInInterval = tbEndMs > startMs && tbStartMs < endMs;\n if(isInInterval){\n timeBoxesInInterval.push(tb);\n }\n counter += 1;\n if(!intervalStartEncountered){\n intervalStartEncountered = isInInterval;\n }else{\n if(!intervalEndEncountered){\n if(!isInInterval){\n intervalEndEncountered = true;\n return;\n }\n }\n }\n if(intervalEndEncountered){\n console.assert(false, \"Bug.\");\n }\n });\n console.log(\"getTimeBoxesByInterval: cycled thorugh\", counter, \"elements. Total elements:\", allTimeBoxes.length);\n return timeBoxesInInterval;\n}", "function main() {\n // OBTIAN AN ARRAY OF START AND END DATES\n var startDate = findStartAndEndDate()[0];\n var endDate = findStartAndEndDate()[1];\n // var start = formatDate(findStartAndEndDate()[0]);\n // var end = formatDate();\n\n var listOfDates = [];\n listOfDates.push(formatDate(startDate));\n\n var year = parseInt(startDate.split(\"-\")[0]);\n var month = parseInt(startDate.split(\"-\")[1]);\n var date = parseInt(startDate.split(\"-\")[2]);\n\n do {\n var nextDate = findNdaysAfter(year, month, date, 1);\n year = parseInt(nextDate.split(\"-\")[0]);\n month = parseInt(nextDate.split(\"-\")[1]);\n date = parseInt(nextDate.split(\"-\")[2]);\n listOfDates.push(formatDate(nextDate));\n } while (nextDate != endDate);\n //console.log(listOfDates);\n // return listOfDates;\n module.exports = listOfDates;\n}", "calculateDateRange(datePreset) {\n const today = this.today;\n switch (datePreset) {\n case 'Today':\n return [today, today];\n case 'So Far This Week': {\n const dayOfWeek = this.adjDayOfWeekToStartOnMonday(today);\n const start = this.dateAdapter.addCalendarDays(today, -(dayOfWeek));\n return [start, today];\n }\n case 'This Week': return this.calculateWeek(today);\n case 'Last Week': return this.calculateWeek(this.dateAdapter.addCalendarDays(today, -7));\n case 'Previous Week': return this.calculateWeek(this.dateAdapter.addCalendarDays(today, -14));\n case 'Rest of This Week': {\n const dayOfWeek = this.adjDayOfWeekToStartOnMonday(today);\n const end = this.dateAdapter.addCalendarDays(today, (6 - dayOfWeek));\n return [today, end];\n }\n case 'Next Week': {\n const dayOfWeek = this.adjDayOfWeekToStartOnMonday(today);\n const start = this.dateAdapter.addCalendarDays(today, (7 - dayOfWeek));\n return this.calculateWeek(start);\n }\n case 'This Month': return this.calculateMonth(today);\n case 'Last Month': {\n const thisDayLastMonth = this.dateAdapter.addCalendarMonths(today, -1);\n return this.calculateMonth(thisDayLastMonth);\n }\n case 'Next Month': {\n const thisDayLastMonth = this.dateAdapter.addCalendarMonths(today, 1);\n return this.calculateMonth(thisDayLastMonth);\n }\n }\n }", "getScaledTick(date, {\n respectExclusion,\n snapToNextIncluded,\n isEnd,\n min,\n max\n }) {\n const {\n timeAxis\n } = this,\n {\n include,\n unit,\n weekStartDay\n } = timeAxis;\n let tick = timeAxis.getTickFromDate(date);\n\n if (tick !== -1 && respectExclusion && include) {\n let tickChanged = false; // Stretch if we are using a larger unit than 'hour', except if it is 'day'. If so, it is already handled\n // by a cheaper reconfiguration of the ticks in `generateTicks`\n\n if (include.hour && DateHelper.compareUnits(unit, 'hour') > 0 && unit !== 'day') {\n const {\n from,\n to,\n lengthFactor,\n center\n } = include.hour,\n // Original hours\n originalHours = date.getHours(),\n // Crop to included hours\n croppedHours = Math.min(Math.max(originalHours, from), to); // If we are not asked to snap (when other part of span is not included) any cropped away hour\n // should be considered excluded\n\n if (!snapToNextIncluded && croppedHours !== originalHours) {\n return -1;\n }\n\n const // Should scale hour and smaller units (seconds will hardly affect visible result...)\n fractionalHours = croppedHours + date.getMinutes() / 60,\n // Number of hours from the center |xxxx|123c----|xxx|\n hoursFromCenter = center - fractionalHours,\n // Step from center to stretch event |x|112233c----|xxx|\n newHours = center - hoursFromCenter * lengthFactor; // Adding instead of setting to get a clone of the date, to not affect the original\n\n date = DateHelper.add(date, newHours - originalHours, 'h');\n tickChanged = true;\n }\n\n if (include.day && DateHelper.compareUnits(unit, 'day') > 0) {\n const {\n from,\n to,\n lengthFactor,\n center\n } = include.day; //region Crop\n\n let checkDay = date.getDay(); // End date is exclusive, check the day before if at 00:00\n\n if (isEnd && date.getHours() === 0 && date.getMinutes() === 0 && date.getSeconds() === 0 && date.getMilliseconds() === 0) {\n if (--checkDay < 0) {\n checkDay = 6;\n }\n }\n\n let addDays = 0;\n\n if (checkDay < from || checkDay >= to) {\n // If end date is in view but start date is excluded, snap to next included day\n if (snapToNextIncluded) {\n // Step back to \"to-1\" (not inclusive) for end date\n if (isEnd) {\n addDays = (to - checkDay - 8) % 7;\n } // Step forward to \"from\" for start date\n else {\n addDays = (from - checkDay + 7) % 7;\n }\n\n date = DateHelper.add(date, addDays, 'd');\n date = DateHelper.startOf(date, 'd', false); // Keep end after start and vice versa\n\n if (max && date.getTime() >= max || min && date.getTime() <= min) {\n return -1;\n }\n } else {\n // day excluded at not snapping to next\n return -1;\n }\n } //endregion\n\n const // Center to stretch around, for some reason pre-calculated cannot be used for sundays :)\n fixedCenter = date.getDay() === 0 ? 0 : center,\n // Should scale day and smaller units (minutes will hardly affect visible result...)\n fractionalDay = date.getDay() + date.getHours() / 24,\n //+ dateClone.getMinutes() / (24 * 1440),\n // Number of days from the calculated center\n daysFromCenter = fixedCenter - fractionalDay,\n // Step from center to stretch event\n newDay = fixedCenter - daysFromCenter * lengthFactor; // Adding instead of setting to get a clone of the date, to not affect the original\n\n date = DateHelper.add(date, newDay - fractionalDay + weekStartDay, 'd');\n tickChanged = true;\n } // Now the date might start somewhere else (fraction of ticks)\n\n if (tickChanged) {\n // When stretching date might end up outside of time axis, making it invalid to use. Clip it to time axis\n // to circumvent this\n date = DateHelper.constrain(date, timeAxis.startDate, timeAxis.endDate); // Get a new tick based on the \"scaled\" date\n\n tick = timeAxis.getTickFromDate(date);\n }\n }\n\n return tick;\n }", "function getDayFrom(endDay = 7) {\n if (endDay < 0 || endDay > 7) {\n console.error(\n `endDay of ${endDay} is not a valid number. Only numbers including 0 - 7 allowed. Defaulting to 7.`\n )\n endDay = 7\n }\n\n // Will be mutating this value to calculate end.\n const now = new Date()\n\n if (endDay < now.getDay()) {\n endDay = (endDay % 7) + 7\n }\n\n const end = new Date(\n new Date(now.setDate(now.getDate() + (endDay - now.getDay() + 1))).setHours(\n 0,\n 0,\n 0,\n 0\n )\n )\n\n console.log('end', end)\n\n return end\n}", "function holidays(a, b) {\n if (a > b)\n return;\n if ((a.getMonth() == 5 && a.getDate() == 25)) {\n holidays_all++;\n if (a > Today)\n holidays_left++;\n }\n a.setDate(a.getDate() + 1);\n holidays(a, b);\n}", "function mergeRangesBruteForce(meetings) {\n if (meetings.length <= 0) {\n return meetings;\n }\n\n // Step 1: calculate min startTime and max endTime\n var minStartTime = meetings[0].startTime;\n var maxEndTime = meetings[0].endTime;\n for (var i = 1; i < meetings.length; i++) {\n if (meetings[i].startTime < minStartTime) {\n minStartTime = meetings[i].startTime;\n }\n if (meetings[i].endTime > maxEndTime) {\n maxEndTime = meetings[i].endTime;\n }\n }\n\n // Step 2: allocate array representing the full day, then fill in which times are full\n var fullDay = [];\n for (var i = 0; i < meetings.length; i++) {\n for (var j = meetings[i].startTime; j <= meetings[i].endTime; j++) {\n fullDay[j - minStartTime] = true;\n }\n }\n \n // Step 3: perform actual \"merging\" by outputting new meeting blocks\n var outputMeetings = [];\n var startTime = minStartTime;\n var endTime = minStartTime;\n for (var i = minStartTime; i <= maxEndTime; i++) {\n if (!fullDay[i - minStartTime]) {\n if (startTime != endTime) {\n outputMeetings.push({startTime: startTime, endTime: endTime});\n }\n if (i + 1 > maxEndTime) {\n break;\n }\n startTime = i + 1;\n endTime = i + 1;\n i = i + 1;\n }\n endTime = i;\n }\n if (startTime != endTime) {\n outputMeetings.push({startTime: startTime, endTime: endTime});\n }\n return outputMeetings;\n}", "function getDateRangeArray(date, dateRangeType, firstDayOfWeek, workWeekDays, daysToSelectInDayView) {\n if (daysToSelectInDayView === void 0) { daysToSelectInDayView = 1; }\n var datesArray = [];\n var startDate;\n var endDate = null;\n if (!workWeekDays) {\n workWeekDays = [_dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DayOfWeek.Monday, _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DayOfWeek.Tuesday, _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DayOfWeek.Wednesday, _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DayOfWeek.Thursday, _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DayOfWeek.Friday];\n }\n daysToSelectInDayView = Math.max(daysToSelectInDayView, 1);\n switch (dateRangeType) {\n case _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DateRangeType.Day:\n startDate = getDatePart(date);\n endDate = addDays(startDate, daysToSelectInDayView);\n break;\n case _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DateRangeType.Week:\n case _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DateRangeType.WorkWeek:\n startDate = getStartDateOfWeek(getDatePart(date), firstDayOfWeek);\n endDate = addDays(startDate, _dateValues_timeConstants__WEBPACK_IMPORTED_MODULE_0__.TimeConstants.DaysInOneWeek);\n break;\n case _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DateRangeType.Month:\n startDate = new Date(date.getFullYear(), date.getMonth(), 1);\n endDate = addMonths(startDate, 1);\n break;\n default:\n throw new Error('Unexpected object: ' + dateRangeType);\n }\n // Populate the dates array with the dates in range\n var nextDate = startDate;\n do {\n if (dateRangeType !== _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DateRangeType.WorkWeek) {\n // push all days not in work week view\n datesArray.push(nextDate);\n }\n else if (workWeekDays.indexOf(nextDate.getDay()) !== -1) {\n datesArray.push(nextDate);\n }\n nextDate = addDays(nextDate, 1);\n } while (!compareDates(nextDate, endDate));\n return datesArray;\n}", "function nextStates() {\n var maxEnd = moment.min(moment(filter.end).add(globalTime, globalTimeRange), moment(Date.now()));\n filter.end = maxEnd.format('YYYY-MM-DD HH:mm:ss');\n filter.start = maxEnd.subtract(globalTime, globalTimeRange).format('YYYY-MM-DD HH:mm:ss');\n $('#daterangepicker').data('daterangepicker').setStartDate(moment(filter.start).format('l[, ]LTS'));\n $('#daterangepicker').data('daterangepicker').setEndDate(moment(filter.end).format('l[, ]LTS'));\n refreshData();\n }", "function attachDateRangeCalenderBubbles(startInputId, endInputId, referenceUTCDateTime, earliestTimeZonePrecedingUTC, earliestDateDeltaHours, farthestDateDeltaDays)\r\n{\r\n document[startInputId] = new Object();\r\n document[startInputId].referenceUTCDateTime = referenceUTCDateTime;\r\n document[startInputId].earliestTimeZonePrecedingUTC = earliestTimeZonePrecedingUTC;\r\n document[startInputId].earliestDateDeltaHours = earliestDateDeltaHours;\r\n document[startInputId].farthestDateDeltaDays = farthestDateDeltaDays;\r\n\r\n $(document).ready(function()\r\n {\r\n var startInput = $(\"#\" + startInputId);\r\n var endInput = $(\"#\" + endInputId);\r\n \r\n if (startInput != undefined && endInputId != undefined)\r\n {\r\n var defaultEarliestDate = truncateTime(addHours(document[startInputId].referenceUTCDateTime, document[startInputId].earliestDateDeltaHours + document[startInputId].earliestTimeZonePrecedingUTC));\r\n var defaultFarthestDate = truncateTime(addHours(addDays(document[startInputId].referenceUTCDateTime, document[startInputId].farthestDateDeltaDays), document[startInputId].earliestTimeZonePrecedingUTC));\r\n\r\n if (startInput.length > 0)\r\n {\r\n addCalendarBubble\r\n (\r\n startInput, undefined,\r\n function()\r\n {\r\n var currentDate = truncateTime(new Date());\r\n return currentDate;\r\n },\r\n function()\r\n {\r\n return defaultEarliestDate;\r\n },\r\n function()\r\n {\r\n return defaultFarthestDate;\r\n }\r\n );\r\n }\r\n if (endInput.length > 0)\r\n {\r\n addCalendarBubble\r\n (\r\n endInput, undefined,\r\n function()\r\n {\r\n var defaultDate = parseDate(formatCalendarInput(startInput.val()));\r\n if (defaultDate < defaultEarliestDate)\r\n {\r\n defaultDate = defaultEarliestDate;\r\n }\r\n else if (defaultDate > defaultFarthestDate)\r\n {\r\n defaultDate = defaultFarthestDate;\r\n }\r\n return defaultDate;\r\n },\r\n function()\r\n {\r\n var defaultDate = parseDate(formatCalendarInput(startInput.val()));\r\n if (defaultDate < defaultEarliestDate)\r\n {\r\n defaultDate = defaultEarliestDate;\r\n }\r\n else if (defaultDate > defaultFarthestDate)\r\n {\r\n defaultDate = defaultFarthestDate;\r\n }\r\n return defaultDate;\r\n },\r\n function()\r\n {\r\n return addHours(addDays(document[startInputId].referenceUTCDateTime, document[startInputId].farthestDateDeltaDays), document[startInputId].earliestTimeZonePrecedingUTC);\r\n }\r\n );\r\n }\r\n }\r\n });\r\n}", "function constrainRange(innerRange, outerRange) {\n\tinnerRange = cloneRange(innerRange);\n\n\tif (outerRange.start) {\n\t\t// needs to be inclusively before outerRange's end\n\t\tinnerRange.start = constrainDate(innerRange.start, outerRange);\n\t}\n\n\tif (outerRange.end) {\n\t\tinnerRange.end = minMoment(innerRange.end, outerRange.end);\n\t}\n\n\treturn innerRange;\n}", "function constrainRange(innerRange, outerRange) {\n\tinnerRange = cloneRange(innerRange);\n\n\tif (outerRange.start) {\n\t\t// needs to be inclusively before outerRange's end\n\t\tinnerRange.start = constrainDate(innerRange.start, outerRange);\n\t}\n\n\tif (outerRange.end) {\n\t\tinnerRange.end = minMoment(innerRange.end, outerRange.end);\n\t}\n\n\treturn innerRange;\n}", "function constrainRange(innerRange, outerRange) {\n\tinnerRange = cloneRange(innerRange);\n\n\tif (outerRange.start) {\n\t\t// needs to be inclusively before outerRange's end\n\t\tinnerRange.start = constrainDate(innerRange.start, outerRange);\n\t}\n\n\tif (outerRange.end) {\n\t\tinnerRange.end = minMoment(innerRange.end, outerRange.end);\n\t}\n\n\treturn innerRange;\n}", "function expandRecurringRanges(eventDef, duration, framingRange, dateEnv, recurringTypes) {\n var typeDef = recurringTypes[eventDef.recurringDef.typeId];\n var markers = typeDef.expand(eventDef.recurringDef.typeData, {\n start: dateEnv.subtract(framingRange.start, duration),\n end: framingRange.end\n }, dateEnv);\n // the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to\n if (eventDef.allDay) {\n markers = markers.map(startOfDay);\n }\n return markers;\n}", "function rangeToSegments(start, end) {\n\n\t\tvar rowCnt = t.getRowCnt();\n\t\tvar colCnt = t.getColCnt();\n\t\tvar segments = []; // array of segments to return\n\n\t\t// day offset for given date range\n\t\tvar rangeDayOffsetStart = dateToDayOffset(start);\n\t\tvar rangeDayOffsetEnd = dateToDayOffset(end); // an exclusive value\n\t\tvar endTimeMS = +end.time();\n\t\tif (endTimeMS && endTimeMS >= nextDayThreshold) {\n\t\t\trangeDayOffsetEnd++;\n\t\t}\n\t\trangeDayOffsetEnd = Math.max(rangeDayOffsetEnd, rangeDayOffsetStart + 1);\n\n\t\t// first and last cell offset for the given date range\n\t\t// \"last\" implies inclusivity\n\t\tvar rangeCellOffsetFirst = dayOffsetToCellOffset(rangeDayOffsetStart);\n\t\tvar rangeCellOffsetLast = dayOffsetToCellOffset(rangeDayOffsetEnd) - 1;\n\n\t\t// loop through all the rows in the view\n\t\tfor (var row=0; row<rowCnt; row++) {\n\n\t\t\t// first and last cell offset for the row\n\t\t\tvar rowCellOffsetFirst = row * colCnt;\n\t\t\tvar rowCellOffsetLast = rowCellOffsetFirst + colCnt - 1;\n\n\t\t\t// get the segment's cell offsets by constraining the range's cell offsets to the bounds of the row\n\t\t\tvar segmentCellOffsetFirst = Math.max(rangeCellOffsetFirst, rowCellOffsetFirst);\n\t\t\tvar segmentCellOffsetLast = Math.min(rangeCellOffsetLast, rowCellOffsetLast);\n\n\t\t\t// make sure segment's offsets are valid and in view\n\t\t\tif (segmentCellOffsetFirst <= segmentCellOffsetLast) {\n\n\t\t\t\t// translate to cells\n\t\t\t\tvar segmentCellFirst = cellOffsetToCell(segmentCellOffsetFirst);\n\t\t\t\tvar segmentCellLast = cellOffsetToCell(segmentCellOffsetLast);\n\n\t\t\t\t// view might be RTL, so order by leftmost column\n\t\t\t\tvar cols = [ segmentCellFirst.col, segmentCellLast.col ].sort();\n\n\t\t\t\t// Determine if segment's first/last cell is the beginning/end of the date range.\n\t\t\t\t// We need to compare \"day offset\" because \"cell offsets\" are often ambiguous and\n\t\t\t\t// can translate to multiple days, and an edge case reveals itself when we the\n\t\t\t\t// range's first cell is hidden (we don't want isStart to be true).\n\t\t\t\tvar isStart = cellOffsetToDayOffset(segmentCellOffsetFirst) == rangeDayOffsetStart;\n\t\t\t\tvar isEnd = cellOffsetToDayOffset(segmentCellOffsetLast) + 1 == rangeDayOffsetEnd; // +1 for comparing exclusively\n\n\t\t\t\tsegments.push({\n\t\t\t\t\trow: row,\n\t\t\t\t\tleftCol: cols[0],\n\t\t\t\t\trightCol: cols[1],\n\t\t\t\t\tisStart: isStart,\n\t\t\t\t\tisEnd: isEnd\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn segments;\n\t}", "function rangeToSegments(start, end) {\n\n\t\tvar rowCnt = t.getRowCnt();\n\t\tvar colCnt = t.getColCnt();\n\t\tvar segments = []; // array of segments to return\n\n\t\t// day offset for given date range\n\t\tvar rangeDayOffsetStart = dateToDayOffset(start);\n\t\tvar rangeDayOffsetEnd = dateToDayOffset(end); // an exclusive value\n\t\tvar endTimeMS = +end.time();\n\t\tif (endTimeMS && endTimeMS >= nextDayThreshold) {\n\t\t\trangeDayOffsetEnd++;\n\t\t}\n\t\trangeDayOffsetEnd = Math.max(rangeDayOffsetEnd, rangeDayOffsetStart + 1);\n\n\t\t// first and last cell offset for the given date range\n\t\t// \"last\" implies inclusivity\n\t\tvar rangeCellOffsetFirst = dayOffsetToCellOffset(rangeDayOffsetStart);\n\t\tvar rangeCellOffsetLast = dayOffsetToCellOffset(rangeDayOffsetEnd) - 1;\n\n\t\t// loop through all the rows in the view\n\t\tfor (var row=0; row<rowCnt; row++) {\n\n\t\t\t// first and last cell offset for the row\n\t\t\tvar rowCellOffsetFirst = row * colCnt;\n\t\t\tvar rowCellOffsetLast = rowCellOffsetFirst + colCnt - 1;\n\n\t\t\t// get the segment's cell offsets by constraining the range's cell offsets to the bounds of the row\n\t\t\tvar segmentCellOffsetFirst = Math.max(rangeCellOffsetFirst, rowCellOffsetFirst);\n\t\t\tvar segmentCellOffsetLast = Math.min(rangeCellOffsetLast, rowCellOffsetLast);\n\n\t\t\t// make sure segment's offsets are valid and in view\n\t\t\tif (segmentCellOffsetFirst <= segmentCellOffsetLast) {\n\n\t\t\t\t// translate to cells\n\t\t\t\tvar segmentCellFirst = cellOffsetToCell(segmentCellOffsetFirst);\n\t\t\t\tvar segmentCellLast = cellOffsetToCell(segmentCellOffsetLast);\n\n\t\t\t\t// view might be RTL, so order by leftmost column\n\t\t\t\tvar cols = [ segmentCellFirst.col, segmentCellLast.col ].sort();\n\n\t\t\t\t// Determine if segment's first/last cell is the beginning/end of the date range.\n\t\t\t\t// We need to compare \"day offset\" because \"cell offsets\" are often ambiguous and\n\t\t\t\t// can translate to multiple days, and an edge case reveals itself when we the\n\t\t\t\t// range's first cell is hidden (we don't want isStart to be true).\n\t\t\t\tvar isStart = cellOffsetToDayOffset(segmentCellOffsetFirst) == rangeDayOffsetStart;\n\t\t\t\tvar isEnd = cellOffsetToDayOffset(segmentCellOffsetLast) + 1 == rangeDayOffsetEnd; // +1 for comparing exclusively\n\n\t\t\t\tsegments.push({\n\t\t\t\t\trow: row,\n\t\t\t\t\tleftCol: cols[0],\n\t\t\t\t\trightCol: cols[1],\n\t\t\t\t\tisStart: isStart,\n\t\t\t\t\tisEnd: isEnd\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn segments;\n\t}", "function g(a,b,c,d){var e,f,g,j,k=a._allDay,l=a._start,m=a._end,n=!1;\n// if no new dates were passed in, compare against the event's existing dates\n// NOTE: throughout this function, the initial values of `newStart` and `newEnd` are\n// preserved. These values may be undefined.\n// detect new allDay\n// if value has changed, use it\n// normalize the new dates based on allDay\n// compute dateDelta\n// if allDay has changed, always throw away the end\n// new duration\n// subtract old duration\n// get events with this ID\nreturn c||d||(c=a.start,d=a.end),e=a.allDay!=k?a.allDay:!(c||d).hasTime(),e&&(c&&(c=c.clone().stripTime()),d&&(d=d.clone().stripTime())),c&&(f=e?o(c,l.clone().stripTime()):o(c,l)),e!=k?n=!0:d&&(g=o(d||i.getDefaultEventEnd(e,c||l),c||l).subtract(o(m||i.getDefaultEventEnd(k,l),l))),j=h(i.clientEvents(a._id),n,e,f,g,b),{dateDelta:f,durationDelta:g,undo:j}}", "function findStartAndEndDate() {\n return [dayOfLastWeek(1), dayOfLastWeek(0)];\n}", "function constrainDate(date, range) {\n\tdate = date.clone();\n\n\tif (range.start) {\n\t\tdate = maxMoment(date, range.start);\n\t}\n\n\tif (range.end && date >= range.end) {\n\t\tdate = range.end.clone().subtract(1);\n\t}\n\n\treturn date;\n}", "function constrainDate(date, range) {\n\tdate = date.clone();\n\n\tif (range.start) {\n\t\tdate = maxMoment(date, range.start);\n\t}\n\n\tif (range.end && date >= range.end) {\n\t\tdate = range.end.clone().subtract(1);\n\t}\n\n\treturn date;\n}", "function constrainDate(date, range) {\n\tdate = date.clone();\n\n\tif (range.start) {\n\t\tdate = maxMoment(date, range.start);\n\t}\n\n\tif (range.end && date >= range.end) {\n\t\tdate = range.end.clone().subtract(1);\n\t}\n\n\treturn date;\n}", "function isMultiDayRange(range) {\n var visibleRange = computeVisibleDayRange(range);\n return diffDays(visibleRange.start, visibleRange.end) > 1;\n}", "function expandRecurringRanges(eventDef, duration, framingRange, dateEnv, recurringTypes) {\n var typeDef = recurringTypes[eventDef.recurringDef.typeId];\n var markers = typeDef.expand(eventDef.recurringDef.typeData, {\n start: dateEnv.subtract(framingRange.start, duration),\n end: framingRange.end\n }, dateEnv);\n // the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to\n if (eventDef.allDay) {\n markers = markers.map(startOfDay);\n }\n return markers;\n }", "function expandRecurringRanges(eventDef, duration, framingRange, dateEnv, recurringTypes) {\n var typeDef = recurringTypes[eventDef.recurringDef.typeId];\n var markers = typeDef.expand(eventDef.recurringDef.typeData, {\n start: dateEnv.subtract(framingRange.start, duration),\n end: framingRange.end\n }, dateEnv);\n // the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to\n if (eventDef.allDay) {\n markers = markers.map(startOfDay);\n }\n return markers;\n }", "function getBusinessDateCount(startDate, endDate) {\n try {\n var elapsed, daysBeforeFirstSaturday, daysAfterLastSunday;\n var ifThen = function (a, b, c) {\n return a == b ? c : a;\n };\n\n elapsed = endDate - startDate;\n elapsed /= 86400000;\n\n daysBeforeFirstSunday = (7 - startDate.getDay()) % 7;\n daysAfterLastSunday = endDate.getDay();\n\n elapsed -= daysBeforeFirstSunday + daysAfterLastSunday;\n elapsed = (elapsed / 7) * 5;\n elapsed +=\n ifThen(daysBeforeFirstSunday - 1, -1, 0) +\n ifThen(daysAfterLastSunday, 6, 5);\n\n return Math.ceil(elapsed);\n } catch (e) {\n console.log(e);\n }\n}", "function expandRecurringRanges(eventDef, duration, framingRange, dateEnv, recurringTypes) {\n var typeDef = recurringTypes[eventDef.recurringDef.typeId];\n var markers = typeDef.expand(eventDef.recurringDef.typeData, {\n start: dateEnv.subtract(framingRange.start, duration),\n end: framingRange.end,\n }, dateEnv);\n // the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to\n if (eventDef.allDay) {\n markers = markers.map(startOfDay);\n }\n return markers;\n }", "function calculateDays(){\n\tvar LEAVES=[];\n\t\n\tvar START_DATE=$('#ABS_START_DATE').val();\n\tvar END_DATE=$('#ABS_END_DATE').val();\n\tvar start = new Date(START_DATE);\n\tvar end = new Date(END_DATE);\n\tvar newend = end.setDate(end.getDate()+1);\n\tend = new Date(newend);\n\twhile(start < end){\n\t //console.log(start.toISOString().substring(0,10)); \n\t var element_date=start.toISOString().substring(0,10);\n\t\tvar element_week=getWeekByDate(element_date);\n\t\tvar element_day=moment(element_date).format('dddd');\n\t\tvar element_year=moment(element_date).year();\n\t\tvar element={date:element_date,week:element_week,day:element_day,year:element_year,half:\"No\"};\n\t\tLEAVES.push(element);\n\t var newDate = start.setDate(start.getDate() + 1);\n\t start = new Date(newDate);\n\t}\n\tLEAVES[0].half=$(\"#ABS_HALF_FULL_START option:selected\").val();\n\tLEAVES[LEAVES.length-1].half=$(\"#ABS_HALF_FULL_END option:selected\").val();\n\tcalculateLeaves(LEAVES);\n\tfor(i=0;i<LEAVES.length;i++){\n\t\tconsole.log(LEAVES[i]);\n\t}\n\n}", "function y(a){var b=G.start.day();// normlize cellOffset to beginning-of-week\n// first date's day of week\n// # of days from full weeks\n// # of days from partial last week\nreturn a+=Q[b],7*Math.floor(a/N)+R[(a%N+N)%N]-b}", "function getDefaultEventEnd(allDay, marker, context) {\n var dateEnv = context.dateEnv, options = context.options;\n var end = marker;\n if (allDay) {\n end = startOfDay(end);\n end = dateEnv.add(end, options.defaultAllDayEventDuration);\n }\n else {\n end = dateEnv.add(end, options.defaultTimedEventDuration);\n }\n return end;\n }", "function DateChangedEnd() {\n var perStart = $(\"#dpfrom\").datepicker(\"getDate\");\n var perEnd = $(\"#dpto\").datepicker(\"getDate\");\n \n if (perStart > perEnd) {\n $('#dpfrom').datepicker('setDate', perEnd);\n }\n GetInvoicesForPeriod();\n}", "beforeEnd() {\n this.d = this.d.day('friday')\n return this\n }", "function extendDateToNextWorkingDay(end_date) {\n let endDate = moment(end_date, \"YYYY-MM-DD\");\n\n // if end date Friday, Saturday or Sunday, assume back next Monday\n if (endDate.day() === 5 || endDate.day() === 6 || endDate.day() === 0) {\n // if weekend, back next Monday\n endDate.day(1 + 7);\n } else {\n // if Monday-Thusday, assume back the next day\n endDate.add(1, \"day\");\n }\n\n return endDate;\n}", "function datesArray(startDate, endDate) {\n var oneDay = 24 * 60 * 60 * 1000;\n var numOfDays = ((endDate - startDate) / oneDay) + 1; //inculing the start and the end days\n var arr = new Array();\n if (numOfDays <= 10) {\n var tmp = new Date(startDate);\n arr[0] = changeDateFormat(tmp);\n for (var i = 1; tmp.getTime() < endDate.getTime(); i++) { //insert all the days to the array\n tmp = new Date(tmp.getTime() + oneDay);\n arr[i] = changeDateFormat(tmp);\n }\n }\n else {\n var average = (endDate.getTime() - startDate.getTime()) / (oneDay * 10); //how many milisec we jump between the dates\n var tmp = new Date(startDate);\n arr[0] = changeDateFormat(tmp);\n for (var i = 1; tmp.getTime() < endDate.getTime(); i++) { //insert all the days to the array\n tmp = new Date((tmp.getTime() + average * oneDay));\n arr[i] = changeDateFormat(tmp);\n }\n }\n return arr;\n}", "function extendDateRange(from_date,duration,callback) {\n\tconsole.log('extend date range',from_date,duration);\n\tif (!from_date) return;\n\tif (dateInRange(from_date)) return;\n\t$('#myThinker').dialog('open');\n\tvar requestObj = {\n\t\tfrom_date:from_date\n\t};\n\tif (duration) requestObj['duration'] = duration;\n\tvar service = '/getDashboardData';\n\t$.ajax({\n\t\turl:service,\n\t\ttype:'GET',\n\t\tdataType:'json',\n\t\tdata:requestObj,\n\t\n\t\tsuccess:function(d) {\n\t\t\tif (d.success && d.success>0)\n\t\t\t{\t\t\t\t\t\t\n\t\t\t\t$('#myThinker').dialog('close');\n\t\t\t\tmergeTrackerOptions(d['trackerData']);\n\t\t\t\tmergeDashboardData(d['responses']);\n\t\t\t\tif (callback) callback();\n\t\t\t}\n\t\t},\n\t\t\n\t\terror:function(err)\n\t\t{\n\t\t\tconsole.log('error',err);\n\t\t\tupdateMsg($('.validateTips'),'Error changing date range');\n\t\t\tsetTimeout(function() {$('#myThinker').dialog('close');},2000);\n\t\t}\n\t});\t\t\t\n}" ]
[ "0.74374276", "0.7254077", "0.7252402", "0.7189147", "0.70831287", "0.63452417", "0.63063514", "0.63063514", "0.63063514", "0.63063514", "0.6273759", "0.6051898", "0.5702109", "0.5639365", "0.561791", "0.5588953", "0.5581098", "0.55699825", "0.55687726", "0.5563964", "0.5544249", "0.55196095", "0.5504852", "0.54905754", "0.5483451", "0.5469053", "0.54578495", "0.54521745", "0.54433244", "0.54368716", "0.5415728", "0.5375067", "0.5375067", "0.5375067", "0.5375067", "0.5375067", "0.5375067", "0.5368183", "0.5324705", "0.5323059", "0.5314491", "0.5309581", "0.5292466", "0.5275536", "0.5265705", "0.52542186", "0.52388555", "0.52388555", "0.52351445", "0.52178305", "0.5215812", "0.51766443", "0.5176457", "0.5167605", "0.5166068", "0.5166068", "0.5156543", "0.51449883", "0.51385176", "0.512398", "0.5117764", "0.5116554", "0.51146233", "0.51084375", "0.5084335", "0.50757396", "0.5072841", "0.5059151", "0.5053267", "0.5041344", "0.50410664", "0.5031766", "0.50309515", "0.5005338", "0.5005338", "0.5005338", "0.50005996", "0.499734", "0.499734", "0.4995736", "0.4994849", "0.49944854", "0.49944854", "0.49944854", "0.498861", "0.4985398", "0.4985398", "0.49804828", "0.49711478", "0.49704194", "0.49680224", "0.49669248", "0.4962437", "0.4959186", "0.4951274", "0.49466226", "0.49414384" ]
0.72647214
4
spans from one day into another?
function isMultiDayRange(range) { var visibleRange = computeVisibleDayRange(range); return diffDays(visibleRange.start, visibleRange.end) > 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DaySpan(start, end) {\r\n this.start = start;\r\n this.end = end;\r\n }", "function moveFwd() {\r\n var d1 = new Date($(\"#date1\").val())\r\n var d2 = new Date($(\"#date2\").val())\r\n var span = (d2 - d1)/(24*3600*1000);\r\nconsole.log(\"move forward:\", span);\r\n $(\"#date1\").val($(\"#date2\").val());\r\n //$(\"#date2\").val(new Date(d2.getTime()+span).toISOString().split('T')[0]);\r\n setEndRange(d2, span);\r\n //timelineType();\r\n}", "function DaySpan(start, end) {\n this.start = start;\n this.end = end;\n }", "function moveBack() {\r\n var d1 = new Date($(\"#date1\").val())\r\n var d2 = new Date($(\"#date2\").val())\r\n var span = (d2 - d1)/(24*3600*1000);\r\nconsole.log(\"move back:\", span, d1);\r\n $(\"#date2\").val($(\"#date1\").val());\r\n setStartRange(d1, span);\r\n //timelineType();\r\n}", "function z(a){return G.start.clone().add(a,\"days\")}", "function B(a){return a.clone().stripTime().diff(G.start,\"days\")}", "function endDateOffset(a, b, m) {\n var start = new Date(a);\n var end = new Date(b);\n var diff = Math.floor((end - start) / (1000 * 3600 * 24));\n var offset = Math.floor(m * diff);\n return addDate(start, 0, 0, offset);\n }", "function dayDiff(day, from) {\n return (day - from + 7) % 7;\n}", "function daysBetween(a, b) {\n return msBetween(a, b) / timeDay;\n}", "function dayDiff(first, second) {\n return (second-first)/(1000*60*60*24);\n }", "function calc_days(a, b) {\r\n const utc1 = new Date(a);\r\n const utc2 = new Date(b);\r\n return Math.floor(utc2 - utc1) / (1000 * 60 * 60 * 24);\r\n}", "dateDiffInDays (a, b) {\n const [ua, ub] = [a, b].map(day => dayjs.utc(day))\n return Math.abs(ua.diff(ub, 'day'))\n }", "function dateRangeCalculator(){\n\n\t//start date\n\n\t//end date\n\n\t//Api call request that reloads page/section based off of time span requested OR trimming original data object/array based off of new specified date range \n\n\n}", "function getDateRange(firstDateTime, secondDateTime) {\n var d1 = new Date(firstDateTime.getTime());\n d1.setHours(12);\n d1.setDate(d1.getDate() + 1);\n\n var d2 = new Date(secondDateTime.getTime());\n d2.setHours(12);\n\n var milliSecondsInADay = 24 * 60 * 60 * 1000;\n return Math.round((d2.getTime() - d1.getTime()) / milliSecondsInADay);\n}", "_unixRangeForDatespan(startDate, endDate) {\n return {\n start: moment(startDate).unix(),\n end: moment(endDate).add(1, 'day').subtract(1, 'second').unix(),\n };\n }", "function initialDatesSet() {\n date1 = moment().startOf(\"day\");\n date2 = moment(date1).add(2, \"day\");\n difference = date2.diff(date1, \"days\");\n }", "function daysInBetween(date1, date2)\r\n{\r\n var millisecondsInDay = 86400000;\r\n return (Math.floor(date2 / millisecondsInDay) - Math.floor(date1 / millisecondsInDay));\r\n}", "function snapToDay(dates, times, day) {\n\t\tvar startDate = new Date(day),\n\t\t duration = (times.end.hours - times.start.hours) * 3600000 +\n\t\t (times.end.minutes - times.start.minutes) * 60000;\n\n\t\tif (startDate >= dates.end || (86400000 + +startDate) <= dates.start)\n\t\t\treturn null;\n\n\t\tif (startDate.getDay() != times.day)\n\t\t\treturn null;\n\n\t\tstartDate.setHours(times.start.hours, times.start.minutes, 0, 0);\n\n\t\treturn {\n\t\t\tstart: startDate,\n\t\t\tend: new Date(duration + +startDate),\n\t\t};\n\t}", "plus(nombreJours){\n return this.offset(nombreJours*24*3600)\n}", "function splitBusy(day,start,end){\n\n\t\t\t\t\tvar l = busyList.length;\n\n\t\t\t\t\tfor(var i = 0 ; i<l ; i++){\n\n\t\t\t\t\t\tif(busyList[i].start.day() == start.day()){\n\n\t\t\t\t\t\t\tvar toSplit = busyList[i];\n\n\t\t\t\t\t\t\tif(toSplit.start >= start && toSplit.end > end){\n\n\t\t\t\t\t\t\t\t//move begining to the end of end\n\n\t\t\t\t\t\t\t\ttoSplit.start.hour(end.hour());\n\n\t\t\t\t\t\t\t}else if(toSplit.end <= end && toSplit.start < start){\n\n\t\t\t\t\t\t\t\t//move the end to the begining of start\n\n\t\t\t\t\t\t\t\ttoSplit.end.hour(start.hour());\n\n\t\t\t\t\t\t\t}else if(toSplit.start < start && toSplit.end > end){\n\n\t\t\t\t\t\t\t\t//split in two\n\n\t\t\t\t\t\t\t\tbusyList.push({id:busyList.length,\n\n\t\t\t\t\t\t\t\t\ttitle:\"No disponible\",\n\n\t\t\t\t\t\t\t\t\tcolor:\"#000\",\n\n\t\t\t\t\t\t\t\t\tstart: new moment(end),\n\n\t\t\t\t\t\t\t\t\tend: new moment(toSplit.end),\n\n\t\t\t\t\t\t\t\t\teditable:false\n\n\t\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t\t\ttoSplit.end.hour(start.hour());\n\n\t\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t\tbusyList.splice(i,1);\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}", "moins(nombreJours){\n return this.offset(-1*nombreJours*24*3600)\n}", "function diffDay(a,b){return moment.duration({days:a.clone().stripTime().diff(b.clone().stripTime(),'days')});}", "function getTimeSpan(sDate, eDate){\n let startDate = new Date(sDate)\n let endDate = new Date(eDate)\n startDate.setHours(0,0,0,0)\n endDate.setHours(23,59,59,0)\n dates[0] = startDate\n dates[1] = endDate\n return dates\n}", "function difbetweenDates(st,ed)\n{\n const utc1=Date.UTC(st.getFullYear(),st.getMonth(),st.getDate());\n const utc2=Date.UTC(ed.getFullYear(),ed.getMonth(),ed.getDate());\n\n return Math.floor((utc2-utc1)/(1000*3600*24));\n}", "function computeAlignedDayRange(timedRange) {\n var dayCnt = Math.floor(marker_1.diffDays(timedRange.start, timedRange.end)) || 1;\n var start = marker_1.startOfDay(timedRange.start);\n var end = marker_1.addDays(start, dayCnt);\n return {\n start: start,\n end: end\n };\n }", "function dateToDayOffset(date) {\n\t\treturn date.clone().stripTime().diff(t.start, 'days');\n\t}", "function dateToDayOffset(date) {\n\t\treturn date.clone().stripTime().diff(t.start, 'days');\n\t}", "function daysDiff(newdate,olddate)\n{\n //if the outcome is Positive, It Means the new Date is greater than old date\n //eg , If th eoutput is >=1 it means date of appointment is in future\n \nvar olddt = new Date(olddate);\nvar newdt = new Date(newdate);\n\nreturn Math.floor((Date.UTC(newdt.getFullYear(), newdt.getMonth(), newdt.getDate()) - Date.UTC(olddt.getFullYear(), olddt.getMonth(), olddt.getDate()) ) /(1000 * 60 * 60 * 24));\n\n}", "function datediff(first, second) {\r\n return (second - first); // / (1000 * 60 * 60 * 24 * 365);\r\n }", "function timeSpan() {\r\n\tif (document.getElementById(\"now\").checked) {\r\n\t\tt1 = new Date().getTime();\r\n\t\ttd = $(\"#duration\").val();\r\n\t\tt0 = t1 - (td*1000);\r\n\t} else {\r\n\t\t// reDate = RegExp(/^\\d{2}\\/\\d{2}\\/\\d{4}$/); /// mm/dd/yyyy\r\n\t\ttry {\r\n\t\t\tdpStart = $( \"#datepickerSt\" ).datepicker(\"getDate\").getTime();\r\n\t\t\tdpEnd = $( \"#datepickerEnd\" ).datepicker(\"getDate\").getTime();\r\n\t\t\tt0 = dpStart - (TZoffset*60*1000);\r\n\t\t\tt1 = dpEnd - (TZoffset*60*1000);\r\n\t\t\ttd = (t1-t0)/1000;\r\n\t\t} catch(err) {\r\n\t\t\t// alert(\"unexpected date format (use: mm/dd/yyyy)\");\r\n\t\t\tchartError(\"Error: date input:\"+ error.message);\r\n\t\t\tconsole.log(dpStart, dpEnd);\r\n\t\t}\r\n\t}\r\n\t// console.log(t0, t1, td);\r\n}", "function g(a,b,c,d){var e,f,g,j,k=a._allDay,l=a._start,m=a._end,n=!1;\n// if no new dates were passed in, compare against the event's existing dates\n// NOTE: throughout this function, the initial values of `newStart` and `newEnd` are\n// preserved. These values may be undefined.\n// detect new allDay\n// if value has changed, use it\n// normalize the new dates based on allDay\n// compute dateDelta\n// if allDay has changed, always throw away the end\n// new duration\n// subtract old duration\n// get events with this ID\nreturn c||d||(c=a.start,d=a.end),e=a.allDay!=k?a.allDay:!(c||d).hasTime(),e&&(c&&(c=c.clone().stripTime()),d&&(d=d.clone().stripTime())),c&&(f=e?o(c,l.clone().stripTime()):o(c,l)),e!=k?n=!0:d&&(g=o(d||i.getDefaultEventEnd(e,c||l),c||l).subtract(o(m||i.getDefaultEventEnd(k,l),l))),j=h(i.clientEvents(a._id),n,e,f,g,b),{dateDelta:f,durationDelta:g,undo:j}}", "function diffDay(a, b) {\n\t\treturn moment.duration({\n\t\t\tdays: a.clone().stripTime().diff(b.clone().stripTime(), 'days')\n\t\t});\n\t}", "function diffdates(datepart, fromdate, todate) {\n datepart = datepart.toLowerCase();\n var diff = todate - fromdate;\n var divideBy = {\n w: 604800000,\n d: 86400000,\n h: 3600000,\n n: 60000,\n s: 1000\n };\n return Math.floor(diff / divideBy[datepart]);\n}", "function getDiffTwoEvents(eventOne, eventTwo) {\n return Math.floor(\n (eventTwo.dateStart.getTime() - eventOne.dateEnd.getTime()) / 1000 / 60\n );\n}", "function dateSpan(date) {\n var month = date.split(\"/\")[0];\n month = monthSpan[month - 1];\n var day = date.split(\"/\")[1];\n if (day.charAt(0) == \"0\") {\n day = day.charAt(1);\n }\n var year = date.split(\"/\")[2];\n\n //Spit it out!\n return month + \" \" + day + \", \" + year;\n}", "function stockSpanEffective(quotes) {\n let days = [0];\n let spans = [1];\n\n for (let i = 1; i < quotes.length; i++) {\n while (!(days.length === 0) && quotes[days[days.length-1]] <= quotes[i]) {\n days.pop();\n }\n if (days.length === 0) {\n spans[i] = i+1;\n } else {\n spans[i] = i-days[days.length-1];\n }\n days.push(i);\n }\n return spans;\n}", "function v(a,b,c){var d=a.clone();for(b=b||1;P[(d.day()+(c?b:0)+7)%7];)d.add(b,\"days\");return d}", "floorDate(date, relativeToStart, resolutionUnit, incr) {\n relativeToStart = relativeToStart !== false;\n\n const me = this,\n relativeTo = relativeToStart ? DateHelper.clone(me.startDate) : null,\n increment = incr || me.resolutionIncrement,\n unit = resolutionUnit || (relativeToStart ? me.resolutionUnit : me.mainUnit),\n snap = (value, increment) => Math.floor(value / increment) * increment;\n\n if (relativeToStart) {\n const snappedDuration = snap(DateHelper.diff(relativeTo, date, unit), increment); // TODO: used to be small unit multipled with factor (minute = seconds, minutes * 60)\n\n return DateHelper.add(relativeTo, snappedDuration, unit);\n }\n\n let dt = DateHelper.clone(date);\n\n if (unit === 'week') {\n const day = dt.getDay() || 7,\n startDay = me.weekStartDay || 7;\n dt = DateHelper.add(DateHelper.startOf(dt, 'day'), day >= startDay ? startDay - day : -(7 - startDay + day), 'day'); // Watch out for Brazil DST craziness (see test 028_timeaxis_dst.t.js)\n\n if (dt.getDay() !== startDay && dt.getHours() === 23) {\n dt = DateHelper.add(dt, 1, 'hour');\n }\n } else {\n // removes \"smaller\" units from date (for example minutes; removes seconds and milliseconds)\n dt = DateHelper.startOf(dt, unit); // day and year are 1-based so need to make additional adjustments\n\n const modifier = ['day', 'year'].includes(unit) ? 1 : 0,\n useUnit = unit === 'day' ? 'date' : unit,\n snappedValue = snap(DateHelper.get(dt, useUnit) - modifier, increment) + modifier;\n dt = DateHelper.set(dt, useUnit, snappedValue);\n }\n\n return dt;\n }", "function byDate(a, b) {\n return a.date - b.date;\n}", "function diffDay(a, b) {\n\treturn moment.duration({\n\t\tdays: a.clone().stripTime().diff(b.clone().stripTime(), 'days')\n\t});\n}", "function diffDay(a, b) {\n\treturn moment.duration({\n\t\tdays: a.clone().stripTime().diff(b.clone().stripTime(), 'days')\n\t});\n}", "function diffDay(a, b) {\n\treturn moment.duration({\n\t\tdays: a.clone().stripTime().diff(b.clone().stripTime(), 'days')\n\t});\n}", "function diffDay(a, b) {\n\treturn moment.duration({\n\t\tdays: a.clone().stripTime().diff(b.clone().stripTime(), 'days')\n\t});\n}", "function diffDay(a, b) {\n\treturn moment.duration({\n\t\tdays: a.clone().stripTime().diff(b.clone().stripTime(), 'days')\n\t});\n}", "function diffDay(a, b) {\n\treturn moment.duration({\n\t\tdays: a.clone().stripTime().diff(b.clone().stripTime(), 'days')\n\t});\n}", "function diffDay(a, b) {\n\treturn moment.duration({\n\t\tdays: a.clone().stripTime().diff(b.clone().stripTime(), 'days')\n\t});\n}", "function diffDay(a, b) {\n\treturn moment.duration({\n\t\tdays: a.clone().stripTime().diff(b.clone().stripTime(), 'days')\n\t});\n}", "floorDate(date, relativeToStart, resolutionUnit, incr) {\n relativeToStart = relativeToStart !== false;\n\n const me = this,\n relativeTo = relativeToStart ? DateHelper.clone(me.startDate) : null,\n increment = incr || me.resolutionIncrement,\n unit = resolutionUnit || (relativeToStart ? me.resolutionUnit : me.mainUnit),\n snap = (value, increment) => Math.floor(value / increment) * increment;\n\n if (relativeToStart) {\n const snappedDuration = snap(DateHelper.diff(relativeTo, date, unit), increment);\n // TODO: used to be small unit multipled with factor (minute = seconds, minutes * 60)\n return DateHelper.add(relativeTo, snappedDuration, unit);\n }\n\n let dt = DateHelper.clone(date);\n\n if (unit === 'week') {\n let day = dt.getDay() || 7,\n startDay = me.weekStartDay || 7;\n\n dt = DateHelper.add(\n DateHelper.startOf(dt, 'day'),\n day >= startDay ? startDay - day : -(7 - startDay + day),\n 'day'\n );\n\n // Watch out for Brazil DST craziness (see test 028_timeaxis_dst.t.js)\n if (dt.getDay() !== startDay && dt.getHours() === 23) {\n dt = DateHelper.add(dt, 1, 'hour');\n }\n } else {\n // removes \"smaller\" units from date (for example minutes; removes seconds and milliseconds)\n dt = DateHelper.startOf(dt, unit);\n\n // day and year are 1-based so need to make additional adjustments\n let modifier = ['day', 'year'].includes(unit) ? 1 : 0,\n useUnit = unit === 'day' ? 'date' : unit,\n snappedValue = snap(DateHelper.get(dt, useUnit) - modifier, increment) + modifier;\n\n dt = DateHelper.set(dt, useUnit, snappedValue);\n }\n\n return dt;\n }", "function computeAlignedDayRange(timedRange) {\n var dayCnt = Math.floor(diffDays(timedRange.start, timedRange.end)) || 1;\n var start = startOfDay(timedRange.start);\n var end = addDays(start, dayCnt);\n return {\n start: start,\n end: end\n };\n } // given a timed range, computes an all-day range based on how for the end date bleeds into the next day", "setStartEnd(moments) {\n let start = new Date(this.props.start)\n let end = new Date(this.props.end)\n\n start.setHours(moments[0].hours())\n start.setMinutes(moments[0].minutes())\n\n if (!this.state.openEnded) {\n if (end.getHours() !== moments[1].hours())\n end.setMinutes(moments[1].minutes())\n end.setHours(moments[1].hours())\n }\n\n // Dates have to be adjusted if workday ends after midnight\n if (start < this.props.start) this.adjustForNextDay(start, 1)\n if (end > this.props.end) this.adjustForNextDay(end, -1)\n if (start >= end) return\n let available = this.isAvailable(start, end)\n if (!available) return\n this.setState({start: start, end: end})\n return true\n }", "function computeAlignedDayRange(timedRange) {\n var dayCnt = Math.floor(diffDays(timedRange.start, timedRange.end)) || 1;\n var start = startOfDay(timedRange.start);\n var end = addDays(start, dayCnt);\n return { start: start, end: end };\n}", "function computeAlignedDayRange$1(timedRange) {\n var dayCnt = Math.floor(diffDays$1(timedRange.start, timedRange.end)) || 1;\n var start = startOfDay$1(timedRange.start);\n var end = addDays$1(start, dayCnt);\n return { start: start, end: end };\n }", "function fillCurrent() {\n for (let i = startDay; i < endDate + startDay; i++) {\n dateArray.push(i - startDay + 1)\n }\n }", "function date_diff_in_days(a, b) {\r\n // Discard the time and time-zone information.\r\n var utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());\r\n var utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate());\r\n\r\n return Math.floor((utc2 - utc1) / _MS_PER_DAY);\r\n}", "dateDiffInDays(a, b) {\n // Discard the time and time-zone information.\n const utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());\n const utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate());\n\n return Math.floor((utc2 - utc1) / _MS_PER_DAY);\n }", "splitEvents(){\n const { events } = this.props;\n const { days } = this.state;\n const sortedEvents = events.sort((firstEvent, secondEvent) => {\n const firstStartDate = moment(firstEvent.startDate);\n const secondStartDate = moment(secondEvent.startDate);\n\n if(firstStartDate.isBefore(secondStartDate)) {\n return -1;\n } else if (firstStartDate.isSame(secondStartDate)) {\n return 0;\n } else {\n return 1;\n }\n });\n\n // what if the dates are out of range?\n // i should be able to query the dates out of the BE\n // for now we can assume within range\n const result = [...Array(7)].map(el => new Array());\n sortedEvents.forEach((event) => {\n const startDate = moment(event.startDate);\n\n days.forEach((day, idx) => {\n if(startDate.isBetween(day.startMoment, day.endMoment)) {\n result[idx].push(event);\n }\n });\n });\n\n return result;\n }", "function holidays(a, b) {\n if (a > b)\n return;\n if ((a.getMonth() == 5 && a.getDate() == 25)) {\n holidays_all++;\n if (a > Today)\n holidays_left++;\n }\n a.setDate(a.getDate() + 1);\n holidays(a, b);\n}", "static between(first, last) {\n const f = first instanceof DateTime ? first._value : first, l = last instanceof DateTime ? last._value : last;\n return new TimeSpan(l.getTime() - f.getTime());\n }", "function diffDay(a, b) {\n return moment.duration({\n days: a.clone().stripTime().diff(b.clone().stripTime(), 'days')\n });\n }", "function setStartRange(date, days) {\r\n var msSpan = days*24*3600*1000;\r\n var startDate = new Date(date.getTime() - msSpan);\r\n //$(\"#date1\").val(startDate.toISOString().split('T')[0]);\r\n $(\"#date1\").val(momentLA_Date(startDate));\r\n}", "function computeAlignedDayRange(timedRange) {\n var dayCnt = Math.floor(diffDays(timedRange.start, timedRange.end)) || 1;\n var start = startOfDay(timedRange.start);\n var end = addDays(start, dayCnt);\n return { start: start, end: end };\n }", "function computeAlignedDayRange(timedRange) {\n var dayCnt = Math.floor(diffDays(timedRange.start, timedRange.end)) || 1;\n var start = startOfDay(timedRange.start);\n var end = addDays(start, dayCnt);\n return { start: start, end: end };\n }", "function computeAlignedDayRange(timedRange) {\n var dayCnt = Math.floor(diffDays(timedRange.start, timedRange.end)) || 1;\n var start = startOfDay(timedRange.start);\n var end = addDays(start, dayCnt);\n return { start: start, end: end };\n }", "function computeAlignedDayRange(timedRange) {\n var dayCnt = Math.floor(diffDays(timedRange.start, timedRange.end)) || 1;\n var start = startOfDay(timedRange.start);\n var end = addDays(start, dayCnt);\n return { start: start, end: end };\n }", "dateChange(){\n if (this.date.start.getTime() > this.date.end.getTime())\n this.date.end = this.date.start;\n }", "function diffDay(a, b) {\n return moment.duration({\n days: a.clone().stripTime().diff(b.clone().stripTime(), 'days')\n });\n}", "function diffDay(a, b) {\n return moment.duration({\n days: a.clone().stripTime().diff(b.clone().stripTime(), 'days')\n });\n}", "function diffDay(a, b) {\n return moment.duration({\n days: a.clone().stripTime().diff(b.clone().stripTime(), 'days')\n });\n}", "function diffDay(a, b) {\n return moment.duration({\n days: a.clone().stripTime().diff(b.clone().stripTime(), 'days')\n });\n}", "function diffDates(date1, date0) { // date1 - date0\n if (largeUnit) {\n return diffByUnit(date1, date0, largeUnit);\n }\n else if (newProps.allDay) {\n return diffDay(date1, date0);\n }\n else {\n return diffDayTime(date1, date0);\n }\n }", "function goodDates(){\n\n var myDate = \"5/23/2016\";\n\n console.log(myDate);\n\n var newDate = new Date(2015, 4, 23);\n var secondDate = new Date(myDate);\n\n console.log(newDate);\n\n console.log(secondDate);\n\n dateDiff = newDate - secondDate;\n\n dateDiff = Math.abs(dateDiff / 1000 / 60 / 60 / 24);\n\n console.log(dateDiff);\n\n\n //var dayOfWeek = newDate.getDay();\n\n //switch (dayOfWeek) {\n //\n // case 0:\n // dayOfWeek = \"Sunday\";\n // break;\n //\n // case 1: dayOfWeek = \"Monday\";\n // break;\n //\n // case 2: dayOfWeek = \"Tuesday\";\n // break;\n //\n // case 3: dayOfWeek = \"Wednesday\";\n // break;\n //\n // case 4: dayOfWeek = \"Thursday\";\n // break;\n //\n // case 5: dayOfWeek = \"Friday\";\n // break;\n //\n // case 6: dayOfWeek = \"Saturday\";\n // break;\n //}\n\n //console.log(dateOfWeek);\n\n\n}", "function moveOneDay(date) {date.setTime((date.getTime() + 24 * 60 * 60 * 1000)); }", "function v(a,b,c){var d,e,f,g,h=a._allDay,i=a._start,j=a._end,k=!1;\n// if no new dates were passed in, compare against the event's existing dates\n// NOTE: throughout this function, the initial values of `newStart` and `newEnd` are\n// preserved. These values may be undefined.\n// detect new allDay\n// if value has changed, use it\n// normalize the new dates based on allDay\n// compute dateDelta\n// if allDay has changed, always throw away the end\n// new duration\n// subtract old duration\n// get events with this ID\nreturn b||c||(b=a.start,c=a.end),d=a.allDay!=h?a.allDay:!(b||c).hasTime(),d&&(b&&(b=b.clone().stripTime()),c&&(c=c.clone().stripTime())),b&&(e=d?o(b,i.clone().stripTime()):o(b,i)),d!=h?k=!0:c&&(f=o(c||x.getDefaultEventEnd(d,b||i),b||i).subtract(o(j||x.getDefaultEventEnd(h,i),i))),g=w(r(a._id),k,d,e,f),{dateDelta:e,durationDelta:f,undo:g}}", "adjustStartDate(startDate, timeDiff) {\n return this.client.timeAxis.roundDate(new Date(startDate - 0 + timeDiff), this.client.snapRelativeToEventStartDate ? startDate : false);\n }", "adjustStartDate(startDate, timeDiff) {\n const scheduler = this.currentOverClient;\n return scheduler.timeAxis.roundDate(new Date(startDate - 0 + timeDiff), scheduler.snapRelativeToEventStartDate ? startDate : false);\n }", "adjustStartDate(startDate, timeDiff) {\n return this.client.timeAxis.roundDate(\n new Date(startDate - 0 + timeDiff),\n this.client.snapRelativeToEventStartDate ? startDate : false\n );\n }", "function getDayCompletion(){\n return (Date.now() / 1000 / 60 / 60 / 24) % 1;\n}", "function decrementDate() {\n dateOffset --;\n googleTimeMin = d.getUTCFullYear() + '-' + (d.getUTCMonth() +1 ) + \"-\" + (d.getUTCDate() + dateOffset) + 'T00:00:00.000Z';\n googleTimeMax = d.getUTCFullYear() + '-' + (d.getUTCMonth() +1 ) + \"-\" + (d.getUTCDate() + dateOffset) + 'T23:59:59.999Z';\n calendarDate();\n listUpcomingEvents();\n\n}", "adjustStartDate(startDate, timeDiff) {\n const scheduler = this.currentOverClient;\n\n return scheduler.timeAxis.roundDate(\n new Date(startDate - 0 + timeDiff),\n scheduler.snapRelativeToEventStartDate ? startDate : false\n );\n }", "function spanRanges(a, b) {\n\t var range = a.cloneRange();\n\t range.setEnd(b.endContainer, b.endOffset);\n\t return range;\n\t}", "function k(a){a._allDay=a.allDay,a._start=a.start.clone(),a._end=a.end?a.end.clone():null}", "function setEndRange(date, days) {\r\n var msSpan = days*24*3600*1000;\r\n var endDate = new Date(date.getTime() + msSpan);\r\n //$(\"#date2\").val(endDate.toISOString().split('T')[0]);\r\n $(\"#date2\").val(momentLA_Date(endDate));\r\n}", "function computeEventForDateSpan(dateSpan, dragMeta, calendar) {\n var defProps = __assign({}, dragMeta.leftoverProps);\n for (var _i = 0, _a = calendar.pluginSystem.hooks.externalDefTransforms; _i < _a.length; _i++) {\n var transform = _a[_i];\n __assign(defProps, transform(dateSpan, dragMeta));\n }\n var def = core.parseEventDef(defProps, dragMeta.sourceId, dateSpan.allDay, calendar.opt('forceEventDuration') || Boolean(dragMeta.duration), // hasEnd\n calendar);\n var start = dateSpan.range.start;\n // only rely on time info if drop zone is all-day,\n // otherwise, we already know the time\n if (dateSpan.allDay && dragMeta.startTime) {\n start = calendar.dateEnv.add(start, dragMeta.startTime);\n }\n var end = dragMeta.duration ?\n calendar.dateEnv.add(start, dragMeta.duration) :\n calendar.getDefaultEventEnd(dateSpan.allDay, start);\n var instance = core.createEventInstance(def.defId, { start: start, end: end });\n return { def: def, instance: instance };\n }", "function dayDiff(d1, d2)\n{\n var res= Math.trunc((d1-d2)/86400000);\n return res;\n}", "function CalculateDaysDiff(day1, day2){\n \n var localOutput = day2 - day1;\n\n console.log(\"running days: \" + localOutput);\n return localOutput;\n }", "beforeEnd() {\n this.d = this.d.day('friday')\n return this\n }", "function days_left(x, text){\n if (BD < date1){\n return Math.ceil((BD.valueOf() + 365 - date1.valueOf())/86400000)\n /*return BD + 365 - date1;*/\n }else{\n /*return BD - date1;*/\n return Math.ceil((BD.valueOf() - date1.valueOf())/86400000)\n };\n}", "function eventsOverlap(a, b) {\n\t\treturn a === b ||\n\t\t\t(a.starts_at >= b.starts_at && a.starts_at < (b.starts_at + b.duration)) ||\n\t\t\t(b.starts_at >= a.starts_at && b.starts_at < (a.starts_at + a.duration));\n\t}", "makeSpan(denominator, time) {\n return (\n <span>{time} {denominator}{time > 1 ? 's' : ''} ago </span>\n )\n }", "function dateDiffInDays(a, b) {\r\n // Discard the time and time-zone information.\r\n const utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());\r\n const utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate());\r\n \r\n return Math.floor((utc2 - utc1) / _MS_PER_DAY);\r\n }", "function dateDiffInDays(a, b) {\n\t\t // Discard the time and time-zone information.\n\t\t var utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());\n\t\t var utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate());\n\n\t\t return Math.floor((utc2 - utc1) / _MS_PER_DAY);\n\t\t}", "adjustForNextDay(date, adjustment) {\n date.setTime( date.getTime() + adjustment * 86400000 )\n }", "function findStartAndEndDate() {\n return [dayOfLastWeek(1), dayOfLastWeek(0)];\n}", "function spanRanges(a, b) {\n var range = a.cloneRange();\n range.setEnd(b.endContainer, b.endOffset);\n return range;\n}", "function computeEventForDateSpan(dateSpan, dragMeta, context) {\n var defProps = __assign({}, dragMeta.leftoverProps);\n for (var _i = 0, _a = context.pluginHooks.externalDefTransforms; _i < _a.length; _i++) {\n var transform = _a[_i];\n __assign(defProps, transform(dateSpan, dragMeta));\n }\n var _b = refineEventDef(defProps, context), refined = _b.refined, extra = _b.extra;\n var def = parseEventDef(refined, extra, dragMeta.sourceId, dateSpan.allDay, context.options.forceEventDuration || Boolean(dragMeta.duration), // hasEnd\n context);\n var start = dateSpan.range.start;\n // only rely on time info if drop zone is all-day,\n // otherwise, we already know the time\n if (dateSpan.allDay && dragMeta.startTime) {\n start = context.dateEnv.add(start, dragMeta.startTime);\n }\n var end = dragMeta.duration ?\n context.dateEnv.add(start, dragMeta.duration) :\n getDefaultEventEnd(dateSpan.allDay, start, context);\n var instance = createEventInstance(def.defId, { start: start, end: end });\n return { def: def, instance: instance };\n }", "function incrementDate() {\n dateOffset ++;\n googleTimeMin = d.getUTCFullYear() + '-' + (d.getUTCMonth() +1 ) + \"-\" + (d.getUTCDate() + dateOffset) + 'T00:00:00.000Z';\n googleTimeMax = d.getUTCFullYear() + '-' + (d.getUTCMonth() +1 ) + \"-\" + (d.getUTCDate() + dateOffset) + 'T23:59:59.999Z';\n calendarDate();\n listUpcomingEvents();\n\n}", "function dateDiffInDays(a, b) {\n\tvar utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());\n\tvar utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate());\n\n\treturn Math.floor((utc2 - utc1) / _MS_PER_DAY);\n}", "function weekends(a, b) {\n if (a > b)\n return;\n if (a.getDay() == 0 || a.getDay() == 6) {\n wknds_all++;\n if (a > Today)\n wknds_left++;\n }\n a.setDate(a.getDate() + 1);\n weekends(a, b);\n}", "function dateSpan(date) {\n\n function addPadding(stringNum) {\n return stringNum.length === 1 ? stringNum.padStart(2, '0') : stringNum;\n }\n\n var month_ = date.split('/')[0];\n let month = monthSpan[month_ - 1];\n var day = date.split('/')[1];\n if (day.charAt(0) == '0') {\n day = day.charAt(1);\n }\n var year = date.split('/')[2];\n\n //Spit it out!\n return [month + \" \" + day + \", \" + year, addPadding(day) + addPadding(month_) + year];\n}", "function diffDates(date1, date0) { // date1 - date0\n\t\t\t\tif (largeUnit) {\n\t\t\t\t\treturn diffByUnit(date1, date0, largeUnit);\n\t\t\t\t}\n\t\t\t\telse if (newProps.allDay) {\n\t\t\t\t\treturn diffDay(date1, date0);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn diffDayTime(date1, date0);\n\t\t\t\t}\n\t\t\t}", "findDates(id, d1, d2) {\n return db(\"users_sleep\")\n .where({ uid: id })\n .andWhereBetween(\"sleep_start\", [d1, d2])\n .limit(7);\n }" ]
[ "0.61173284", "0.6108083", "0.605244", "0.6019503", "0.5906417", "0.57993567", "0.5658041", "0.56109667", "0.5560023", "0.5557615", "0.5511641", "0.550994", "0.54231775", "0.53779316", "0.5321665", "0.5298226", "0.52858686", "0.52763397", "0.5263714", "0.52461654", "0.5220022", "0.5203195", "0.5193842", "0.5189014", "0.5185533", "0.5182394", "0.5182394", "0.51683736", "0.5167492", "0.5165846", "0.5157631", "0.51569563", "0.51568115", "0.5156457", "0.51520294", "0.514767", "0.5144258", "0.5129609", "0.5115385", "0.51114315", "0.51114315", "0.51114315", "0.51114315", "0.51114315", "0.51114315", "0.51114315", "0.51114315", "0.5107395", "0.5105938", "0.5103562", "0.5096231", "0.5094213", "0.5093538", "0.5090132", "0.50894165", "0.50871795", "0.50858265", "0.50797534", "0.5077893", "0.5071829", "0.5070645", "0.5070645", "0.5070645", "0.5070645", "0.50610334", "0.5054302", "0.5054302", "0.5054302", "0.5054302", "0.50411606", "0.5035248", "0.5032337", "0.5029092", "0.50273466", "0.5024484", "0.50229263", "0.5021647", "0.5007968", "0.5001376", "0.4998728", "0.49854085", "0.498173", "0.49813786", "0.49778682", "0.49663433", "0.4965047", "0.49530956", "0.4950373", "0.4943687", "0.49435562", "0.49434203", "0.49428606", "0.49394953", "0.4938021", "0.49357286", "0.49348456", "0.4927826", "0.4927471", "0.4926636", "0.49241418", "0.4920255" ]
0.0
-1
Event MUST have a recurringDef
function expandRecurringRanges(eventDef, duration, framingRange, dateEnv, recurringTypes) { var typeDef = recurringTypes[eventDef.recurringDef.typeId]; var markers = typeDef.expand(eventDef.recurringDef.typeData, { start: dateEnv.subtract(framingRange.start, duration), end: framingRange.end }, dateEnv); // the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to if (eventDef.allDay) { markers = markers.map(startOfDay); } return markers; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "detachFromRecurringEvent() {\n const me = this,\n // For access further down, breaking the link involves engine if trying to get the occurrenceDate later,\n // resulting in the wrong date\n {\n recurringTimeSpan,\n occurrenceDate,\n startDate\n } = me; // Break the link\n\n me.recurringTimeSpan = null; // The occurrenceDate is injected into the data when an occurrence is created.\n // the recurringTimeSpan's afterChange will remove any cache occurrence\n // for this date; see above\n\n recurringTimeSpan.addExceptionDate(occurrenceDate); // If we still have a recurrenceRule, we're being promoted to be a new recurring event.\n // The recurrence setter applies the rule immediately to occurrences, so this will\n // always be correct.\n\n if (me.recurrenceRule) {\n // The RecurrenceModel removes occurrences and exceptions after this date\n recurringTimeSpan.recurrence.endDate = DateHelper.add(startDate, -1, 'minute');\n }\n }", "function processOneEvent(ev, callback) {\n var event_resource = {\n start: { dateTime: moment(ev.start).format() },\n end: { dateTime: moment(ev.end).format() },\n description: ev.description || \"\",\n location: ev.location || \"\",\n summary: ev.summary,\n status: \"confirmed\"\n };\n if (ev.unparsed_rrules) {\n event_resource.recurrence = ev.unparsed_rrules;\n /* Recurring events require an explicit start and end timezone.\n Timezones are hard. Fortunately, we are in England and so don't care.\n Send her victorious. */\n event_resource.start.timeZone = TIMEZONE;\n event_resource.end.timeZone = TIMEZONE;\n }\n if (existing[ev.birminghamIOCalendarID]) {\n //console.log(\"Update event\", ev.birminghamIOCalendarID);\n gcal.events.patch({\n auth: jwt, \n calendarId: GOOGLE_CALENDAR_ID,\n eventId: ev.birminghamIOCalendarID,\n resource: event_resource\n }, function(err, resp) {\n if (err) {\n callback(null, {success: false, err: err, type: \"update\", event: ev});\n return;\n }\n callback(null, {success: true, type: \"update\", event: ev});\n });\n } else {\n var event_resource_clone = JSON.parse(JSON.stringify(event_resource));\n event_resource_clone.id = ev.birminghamIOCalendarID;\n gcal.events.insert({\n auth: jwt, \n calendarId: GOOGLE_CALENDAR_ID,\n resource: event_resource_clone\n }, function(err, resp) {\n if (err) {\n callback(null, {success: false, err: err, type: \"insert\", event: ev});\n return;\n }\n callback(null, {success: true, type: \"insert\", event: ev});\n });\n }\n }", "function isRecurring() {\n // right now all options are recurring\n return true;\n }", "function formRecurrenceRule_(event) {\n let recurRule;\n if (event.recurrence.rule === \"day\") {\n if (event.recurrence.end.toLowerCase() === \"endafter\") {\n recurRule = CalendarApp.newRecurrence().addDailyRule().interval(event.recurrence.repeatTimes).times(event.recurrence.endTimes);\n }\n else if (event.recurrence.end.toLowerCase() === \"endon\") {\n recurRule = CalendarApp.newRecurrence().addDailyRule().interval(event.recurrence.repeatTimes).until(new Date(event.recurrence.endDate.year, event.recurrence.endDate.month-1, event.recurrence.endDate.day));\n }\n else {\n recurRule = CalendarApp.newRecurrence().addDailyRule().interval(event.recurrence.repeatTimes);\n }\n }\n else if (event.recurrence.rule === \"week\") {\n let repeatOn = [];\n for (const week of event.recurrence.repeatOn) {\n if (week.toLowerCase() === \"mon\") { repeatOn.push(CalendarApp.Weekday.MONDAY); }\n else if (week.toLowerCase() === \"tues\") { repeatOn.push(CalendarApp.Weekday.TUESDAY); }\n else if (week.toLowerCase() === \"wed\") { repeatOn.push(CalendarApp.Weekday.WEDNESDAY); }\n else if (week.toLowerCase() === \"thurs\") { repeatOn.push(CalendarApp.Weekday.THURSDAY); }\n else if (week.toLowerCase() === \"fri\") { repeatOn.push(CalendarApp.Weekday.FRIDAY); }\n else if (week.toLowerCase() === \"sat\") { repeatOn.push(CalendarApp.Weekday.SATURDAY); }\n else { repeatOn.push(CalendarApp.Weekday.SUNDAY); }\n }\n if (event.recurrence.end.toLowerCase() === \"endafter\") {\n recurRule = CalendarApp.newRecurrence().addWeeklyRule().interval(event.recurrence.repeatTimes).onlyOnWeekdays(repeatOn).times(event.recurrence.endTimes);\n }\n else if (event.recurrence.end.toLowerCase() === \"endon\") {\n recurRule = CalendarApp.newRecurrence().addWeeklyRule().interval(event.recurrence.repeatTimes).onlyOnWeekdays(repeatOn).until(new Date(event.recurrence.endDate.year, event.recurrence.endDate.month-1, event.recurrence.endDate.day));\n }\n else {\n recurRule = CalendarApp.newRecurrence().addWeeklyRule().interval(event.recurrence.repeatTimes).onlyOnWeekdays(repeatOn);\n }\n }\n else if (event.recurrence.rule === \"month\") {\n if (event.recurrence.repeatMode.toLowerCase() === \"date\") {\n let dayOfMonth = event.startTime.getDate();\n if (event.recurrence.end.toLowerCase() === \"endafter\") {\n recurRule = CalendarApp.newRecurrence().addMonthlyRule().interval(event.recurrence.repeatTimes).onlyOnMonthDay(dayOfMonth).times(event.recurrence.endTimes);\n }\n else if (event.recurrence.end.toLowerCase() === \"endon\") {\n recurRule = CalendarApp.newRecurrence().addMonthlyRule().interval(event.recurrence.repeatTimes).onlyOnMonthDay(dayOfMonth).until(new Date(event.recurrence.endDate.year, event.recurrence.endDate.month-1, event.recurrence.endDate.day));\n }\n else {\n recurRule = CalendarApp.newRecurrence().addMonthlyRule().interval(event.recurrence.repeatTimes).onlyOnMonthDay(dayOfMonth);\n }\n }\n else {\n let dayOfWeek;\n switch (event.startTime.getDay()) {\n case 0: { dayOfWeek = CalendarApp.Weekday.SUNDAY; break; }\n case 1: { dayOfWeek = CalendarApp.Weekday.MONDAY; break; }\n case 2: { dayOfWeek = CalendarApp.Weekday.TUESDAY; break; }\n case 3: { dayOfWeek = CalendarApp.Weekday.WEDNESDAY; break; }\n case 4: { dayOfWeek = CalendarApp.Weekday.THURSDAY; break; }\n case 5: { dayOfWeek = CalendarApp.Weekday.FRIDAY; break; }\n case 5: { dayOfWeek = CalendarApp.Weekday.SATURDAY; break; }\n default:\n break;\n }\n let numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31];\n let dayOfMonth = event.startTime.getDate();\n let mod = dayOfMonth % 7 - 1;\n let good_days = numbers.slice(dayOfMonth - mod, dayOfMonth - mod + 7);\n if (event.recurrence.end.toLowerCase() === \"endafter\") {\n recurRule = CalendarApp.newRecurrence().addWeeklyRule().interval(event.recurrence.repeatTimes).onlyOnWeekday(dayOfWeek).onlyOnMonthDays(good_days).times(event.recurrence.endTimes);\n }\n else if (event.recurrence.end.toLowerCase() === \"endon\") {\n recurRule = CalendarApp.newRecurrence().addWeeklyRule().interval(event.recurrence.repeatTimes).onlyOnWeekday(dayOfWeek).onlyOnMonthDays(good_days).until(new Date(event.recurrence.endDate.year, event.recurrence.endDate.month-1, event.recurrence.endDate.day));\n }\n else {\n recurRule = CalendarApp.newRecurrence().addWeeklyRule().interval(event.recurrence.repeatTimes).onlyOnWeekday(dayOfWeek).onlyOnMonthDays(good_days);\n }\n } \n }\n else {\n if (event.recurrence.end.toLowerCase() === \"endafter\") {\n recurRule = CalendarApp.newRecurrence().addYearlyRule().interval(event.recurrence.repeatTimes).times(event.recurrence.endTimes);\n }\n else if (event.recurrence.end.toLowerCase() === \"endon\") {\n recurRule = CalendarApp.newRecurrence().addYearlyRule().interval(event.recurrence.repeatTimes).until(new Date(event.recurrence.endDate.year, event.recurrence.endDate.month-1, event.recurrence.endDate.day));\n }\n else {\n recurRule = CalendarApp.newRecurrence().addYearlyRule().interval(event.recurrence.repeatTimes);\n }\n }\n return recurRule;\n}", "function saveSuccess(cmd) {\n var recurOpts = cosmo.view.service.recurringEventOptions;\n var item = cmd.data\n var data = item.data;\n var saveType = cmd.saveType || null;\n console.log(\"saveSuccess saveType: \" + saveType);\n var delta = cmd.delta;\n var deferred = null;\n var newItemNote = cmd.newItemNote; // stamped Note\n var recurrenceRemoved = item.recurrenceRemoved();\n\n //if the event is recurring and all future or all events are changed, we need to\n //re expand the event\n if (item.data.hasRecurrence() && saveType != recurOpts.ONLY_THIS_EVENT) {\n //first remove the event and recurrences from the registry.\n var idsToRemove = [data.getUid()];\n var collectionIds = item.collectionIds.slice();\n if (saveType == recurOpts.ALL_FUTURE_EVENTS){\n idsToRemove.push(newItemNote.getUid());\n }\n\n cosmo.view.cal.removeRecurrenceGroupFromItsCollectionRegistries(\n collectionIds, idsToRemove);\n\n //now we have to expand out the item for the viewing range\n var expandDeferred1 = cosmo.app.pim.serv.expandRecurringItem(data.getMaster(),\n cosmo.view.cal.viewStart,cosmo.view.cal.viewEnd)\n var deferredArray = [expandDeferred1];\n if (saveType == recurOpts.ALL_FUTURE_EVENTS) {\n deferredArray.push(cosmo.app.pim.serv.expandRecurringItem(newItemNote,\n cosmo.view.cal.viewStart,cosmo.view.cal.viewEnd));\n }\n deferred = new dojo.DeferredList(deferredArray);\n\n var addExpandedOccurrences = function (results) {\n //check for errors!\n var error = cosmo.util.deferred.getFirstError(results);\n\n if (error){\n cosmo.app.showErr(_$(\"Service.Error.ProblemGettingItems\"), \"\", error);\n return;\n }\n\n var occurrences = results[0][1];\n if (results[1]){\n var otherOccurrences = results[1][1];\n occurrences = occurrences.concat(otherOccurrences);\n }\n //var newHash = cosmo.view.cal.createEventRegistry(occurrences);\n //newRegistry.append(newHash);\n\n cosmo.view.cal.placeRecurrenceGroupInItsCollectionRegistries(\n collectionIds, occurrences);\n\n removeAllEventsFromDisplay();\n self.view.itemRegistry =\n cosmo.view.cal.createItemRegistryFromCollections();\n //self.view.itemRegistry = newRegistry;\n self.view.itemRegistry.each(appendLozenge);\n };\n deferred.addCallback(addExpandedOccurrences);\n }\n // Non-recurring (normal single item, recurrence removal), \"only this item'\n else {\n // The id for the current collection -- used in creating new CalItems\n var currCollId = cosmo.app.pim.getSelectedCollectionId();\n // The item just had its recurrence removed.\n // The only item that should remain is the item that was the\n // first occurrence -- put that item on the canvas, if it's\n // actually in the current view-span\n if (recurrenceRemoved) {\n // Remove all the recurrence items from the list\n var newRegistry = self.view.filterOutRecurrenceGroup(\n self.view.itemRegistry.clone(), [item.data.getUid()]);\n // Wipe existing list of items off the canvas\n removeAllEventsFromDisplay();\n // Update the list\n self.view.itemRegistry = newRegistry;\n // Create a new item based on the updated version of\n // the edited ocurrence's master\n var note = item.data.getMaster();\n var newItem = new cosmo.view.cal.CalItem(note, item.collectionIds.slice());\n // If the first item in the removed recurrence series\n // is in the current view span, add it to the list\n if (!newItem.isOutOfViewRange()) {\n self.view.itemRegistry.setItem(newItem.id, newItem);\n cosmo.view.cal.placeItemInItsCollectionRegistries(newItem);\n }\n // Repaint the updated list\n self.view.itemRegistry.each(appendLozenge);\n updateEventsDisplay();\n return;\n }\n // Single item, \"only this item\" change for a recurrence\n else {\n // Saved event is in the current view slice\n var inRange = !item.isOutOfViewRange();\n // Lozenge is in the current week, update it\n if (inRange) {\n // Item being edited was off-canvas\n if (item.lozenge.isOrphaned()){\n var id = item.data.getItemUid();\n // Create a new CalItem from the stamped Note on the item\n // so we can give it a new on-canvas lozenge\n var newItem = new cosmo.view.cal.CalItem(item.data, item.collectionIds.slice());\n self.view.itemRegistry.setItem(newItem.id, newItem);\n cosmo.view.cal.placeItemInItsCollectionRegistries(newItem);\n // Repaint the updated list\n self.view.itemRegistry.each(appendLozenge);\n updateEventsDisplay();\n }\n else {\n item.lozenge.setInputDisabled(false);\n item.lozenge.updateDisplayMain();\n // 'Only this event' change to a recurrence\n // Unlock all the other items in the series\n // from their 'processing' state\n if (item.data.hasRecurrence()) {\n var f = function (i, e) {\n if (e.data.getUid() == item.data.getUid()) {\n e.lozenge.setInputDisabled(false);\n e.lozenge.updateDisplayMain();\n }\n }\n cosmo.view.cal.itemRegistry.each(f);\n }\n }\n }\n // Lozenge was in view, event was explicitly edited\n // to a date that moves the lozenge off-canvas\n else if (cmd.qualifier && cmd.qualifier.offCanvas) {\n removeEvent(item);\n }\n // User has navigated off the week displaying the currently\n // selected item -- the item is not in the itemRegistry,\n // it's being pulled from the selectedItemCache, so it does\n // not have a lozenge on the canvas to update -- the only\n // drawback here is that the user now gets no feedback that\n // the item has been successfully updated, because there's\n // no lozenge to see\n else if (item.lozenge.isOrphaned()) {\n // Do nothing\n }\n }\n }\n\n var updateEventsCallback = function () {\n console.log(\"updateEventsCallback\")\n // Don't re-render when requests are still processing\n if (!cosmo.view.service.processingQueue.length) {\n updateEventsDisplay();\n\n // Anything except editing an existing event requires\n // adding the selection to an item in the itemRegistry\n if (saveType) {\n var sel = null;\n switch (saveType) {\n case 'new':\n sel = item;\n sel.lozenge.setInputDisabled(false);\n break;\n case recurOpts.ALL_EVENTS:\n case recurOpts.ONLY_THIS_EVENT:\n sel = item.data.getItemUid();\n break;\n case recurOpts.ALL_FUTURE_EVENTS:\n sel = newItemNote.getNoteOccurrence(\n newItemNote.getEventStamp().getStartDate()).getItemUid();\n break;\n break;\n default:\n throw('Undefined saveType of \"' + saveType +\n '\" in command object passed to saveSuccess');\n break;\n\n }\n self.setSelectedCalItem(sel);\n sel = self.getSelectedItem();\n dojo.publish('cosmo:calSetSelected',\n [{saveType: saveType, data: sel}]);\n }\n }\n else {\n console.log(\"how many left in queue: \" + cosmo.view.service.processingQueue.length);\n }\n }\n\n if (deferred){\n deferred.addCallback(updateEventsCallback);\n }\n else {\n updateEventsCallback();\n }\n }", "detachFromRecurringEvent() {\n const\n me = this,\n // For access further down, breaking the link involves engine if trying to get the occurrenceDate later,\n // resulting in the wrong date\n { recurringTimeSpan, occurrenceDate, startDate } = me;\n\n // Break the link\n me.recurringTimeSpan = null;\n\n // The occurrenceDate is injected into the data when an occurrence is created.\n // the recurringTimeSpan's afterChange will remove any cache occurrence\n // for this date; see above\n recurringTimeSpan.addExceptionDate(occurrenceDate);\n\n // If we still have a recurrenceRule, we're being promoted to be a new recurring event.\n // The recurrence setter applies the rule immediately to occurrences, so this will\n // always be correct.\n if (me.recurrenceRule) {\n // The RecurrenceModel removes occurrences and exceptions after this date\n recurringTimeSpan.recurrence.endDate = DateHelper.add(startDate, -1, 'minute');\n }\n }", "function insertEvent(obj) {\n var event = {\n 'reminders': {\n 'useDefault': false,\n 'overrides': [\n {'method': 'email', 'minutes': 24 * 60},\n {'method': 'popup', 'minutes': 10}\n ]\n },\n 'recurrence': [\n 'RRULE:FREQ=DAILY;COUNT=1'\n ]\n };\n\n var startTime = obj.start;\n var endTime = obj.end;\n var date = obj.date.split('/');\n var gmtTimeZone = date.indexOf('GMT')+3;\n var start = {}; var end = {};\n var parseDate = function(time) {\n debugger;\n return date[2] + '-' + date[1] + '-' + date[0] + 'T' + time + ':00' + gmtTimeZone + ':00';\n };\n gmtTimeZone = date.substring(gmtTimeZone, gmtTimeZone + 3);\n start.dateTime = parseDate(startTime);\n end.dateTime = parseDate(endTime);\n\n event.summary = obj.get('name') + ' - ' + obj.get('therapistName');\n event.location = obj.location;\n event.start = {'dateTime': startTime, 'timeZone': 'Asia/Jerusalem'};\n event.end = {'dateTime': endTime, 'timeZone': 'Asia/Jerusalem'};\n\n\n console.log('inserting event!');\n\n // var event2 = {\n // 'summary': 'Hackathon',\n // 'location': 'Daniel Hotel, Herzelia',\n // 'description': 'Winning at least second place',\n // 'start': {\n // 'dateTime': '2017-05-10T09:00:00+02:00',\n // 'timeZone': 'Asia/Jerusalem'\n // },\n // 'end': {\n // 'dateTime': '2017-05-10T17:00:00+02:00',\n // 'timeZone': 'Asia/Jerusalem'\n // },\n // 'recurrence': [\n // 'RRULE:FREQ=DAILY;COUNT=1'\n // ],\n // 'attendees': [\n // {'email': 'danielle611@example.com'}\n // ],\n // 'reminders': {\n // 'useDefault': false,\n // 'overrides': [\n // {'method': 'email', 'minutes': 24 * 60},\n // {'method': 'popup', 'minutes': 10}\n // ]\n // }\n // };\n\n var request = gapi.client.calendar.events.insert({\n 'calendarId': 'pkgiq4dasdasdas2321312312.com',\n 'resource': event\n });\n\n request.execute(function(resp) {\n if (resp.error) {\n failureModal(resp.error);\n }\n else {\n window.sessionStorage.setItem('EventsInserted', true);\n successModal(resp)\n }\n });\n}", "function TargetRecurringCheckbox(data) {\n\t\t\tdata = data || {};\n\n\t\t\tmoment.locale('en'); // Moment.js\n\n\t\t\t// PK\n\t\t\tthis.id = data.id || null;\n\n\t\t\t// FK\n\t\t\tthis.update = data.update || null;\n\n\t\t\t// Properties\n\t\t\tthis.deadline_date = data.deadline_date || null;\n\t\t\tthis.deadline_time = data.deadline_time || null;\n\t\t\tthis.deadline_reminder = data.deadline_reminder || false;\n\t\t\tthis.repeat_deadline = data.repeat_deadline || null;\n\t\t\tthis.repeat_until_date = data.repeat_until_date || null;\n\t\t\tthis.repeat_until_time = data.repeat_until_time || null;\n\n\t\t\t// Properties omitted from JSON by Angular due to `$$` prefix.\n\t\t\tthis.$$deadline_date = this.$$convertDate(data.deadline_date);\n\t\t\tthis.$$deadline_time = this.$$convertTime(data.deadline_time);\n\t\t\tthis.$$repeat_until_date = this.$$convertDate(data.repeat_until_date);\n\t\t\tthis.$$repeat_until_time = this.$$convertTime(data.repeat_until_time);\n\n\t\t\t// Run on construction\n\t\t\tthis.$$addUpdate();\n\t\t}", "handleSubmit(e){\n e.preventDefault();\n let start = this.props.calendarForm.sDate;\n let end = this.props.calendarForm.eDate;\n if(end === \"\"){\n end = start;\n }\n if(this.formIsValidated()){\n let isRecurringEvent = this.props.calendarForm.showRecur;\n let repeatDays = this.props.calendarForm.repeatDays;\n if(+start > +end){\n this.props.setMessageTitle(\"ERROR\");\n this.props.setMessageBody('ERROR (Start Date later than End Date): Your ending date must be later than or the same as your starting date.');\n this.props.showMessage('CUSTOM');\n }\n if(isRecurringEvent){\n if(repeatDays.length > 0){\n if(+start === +end){ //If the user input a recurrence but set the same start and end date\n this.props.setMessageTitle(\"ERROR\");\n this.props.setMessageBody('ERROR (Single Day Recurrence): If you want a recurring date, you must have the start and end dates be different.');\n this.props.showMessage('CUSTOM');\n }\n else {\n this.addRecurringEvent(); //Add a recurring event\n }\n }\n else{\n this.props.setMessageTitle(\"ERROR\");\n this.props.setMessageBody(\"Error (No Repeat Days): In order to make a recurring event, you must check the boxes of the days you want the event to repeat on.\");\n this.props.showMessage('CUSTOM');\n //error need to check repeat days\n }\n }\n else{ //If single event\n let newEvent = new Event(this.props.courseId, (this.props.courseTitle + ' ' + getCurrentSemester()), getEventDT(start, this.props.calendarForm.sTime),\n getEventDT(end, this.props.calendarForm.eTime), this.props.calendarForm.description, this.props.calendarForm.room,\n (getCurrentSemester() + ' ' + this.props.courseId), this.props.calendarForm.hexColor, false, null);\n this.addNewEvent(newEvent); //Add a single event\n }\n }\n else{\n this.props.setMessageTitle(\"ERROR\");\n this.props.setMessageBody(\"ERROR (Incomplete form): You must complete the basic information of the form (Start Date, Start Time, End Time, Description) before submitting!\");\n this.props.showMessage(\"CUSTOM\");\n }\n }", "syncEventRecord(recurrence) {\n // get values relevant to the RecurrenceModel (from enabled fields only)\n const values = this.getValues(w => w.name in recurrence && !w.disabled);\n recurrence.set(values);\n }", "addRecurringEvent(){\n let start = this.props.calendarForm.sDate; //Get the start/end dates, days to repeat on, and included and excluded dates\n let end = this.props.calendarForm.eDate;\n let repeatDays = this.props.calendarForm.repeatDays;\n let includes = this.props.calendarForm.includeDates;\n if(includes.length === 0){includes = -1} //Important for checking on server, do not change unless in both places.\n let excludes = this.props.calendarForm.excludeDates;\n if(excludes.length === 0){excludes = -1} //Important for checking on server, do not change unless in both places.\n fetch(('/api/calendar/recur/' + repeatDays + '/' + start + '/' + end + '/' + includes + '/' + excludes), { //Query the server to generate the list of dates based on the desired recurrence\n credentials: 'same-origin' // or 'include'\n }).then(res => (res.status === 200 || res.status === 204 || res.status === 304) ? res.json() : []\n ).then((json) => {\n this.props.setCalRecurrence(json); //Update the state with the list of dates in the recurrence\n let recurrence = this.props.calendarForm.recurrence;\n var conflictingEvents = [];\n let currentEvents = this.props.calendarForm.events;\n var date = new Date(); //Generate a timestamp as a \"most-likely\" unique recurrence id\n var components = [\n date.getYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n date.getMilliseconds()\n ];\n var recurrenceId = components.join(\"\");\n for (let date of recurrence){ //For every date in the recurrence\n //Generate the start date of the recurrence\n let sDate = new Date(parseInt(date.substring(0, 4), 10), parseInt(date.substring(4, 6), 10)-1,\n parseInt(date.substring(6,8), 10), this.props.calendarForm.sDate.getHours(), this.props.calendarForm.sDate.getMinutes());\n //Generate the end date of the recurrence\n let eDate = new Date(parseInt(date.substring(0, 4), 10), parseInt(date.substring(4, 6), 10)-1,\n parseInt(date.substring(6,8), 10), this.props.calendarForm.eDate.getHours(), this.props.calendarForm.eDate.getMinutes());\n //Create the event with the appropriate data, assign to this unique recurrence with the generated recurrence id\n let newEvent = new Event(this.props.courseId, (this.props.courseTitle + ' ' + getCurrentSemester()), getEventDT(sDate, this.props.calendarForm.sTime),\n getEventDT(eDate, this.props.calendarForm.eTime), this.props.calendarForm.description, this.props.calendarForm.room,\n (getCurrentSemester() + ' ' + this.props.courseId), this.props.calendarForm.hexColor, true, recurrenceId);\n if(this.eventDoesConflict(newEvent)){\n conflictingEvents.push(newEvent);\n }\n else{\n currentEvents.push(newEvent); //Add the event to the list\n }\n }\n this.props.setCalEvents(currentEvents); //Add the array of dates (recurrence) to the calendar\n if(conflictingEvents.length > 0){\n const body = (\n <div>\n <div>\n <p>Warning! The following {conflictingEvents.length} events conflicted with other existing events and could not be added:</p>\n <ul>\n {conflictingEvents.map((event, i) => {\n var ev = (\"Name: \" + event.title + \", Date: \" + event.start);\n return (<li key={i}>{ev}</li>)})}\n </ul>\n <p>All other events in this recurrence have been added.</p>\n </div>\n </div>\n );\n this.props.setMessageTitle(\"WARNING\");\n this.props.setMessageBody(body);\n this.props.showMessage('CUSTOM');\n }\n this.onClose(); //Close the modal\n }).catch((err) => console.log(err));\n }", "function checkEventExists() \n{\n gapi.client.load('calendar', 'v3', function() {\n var request = gapi.client.calendar.events.get({\n 'calendarId': cal.id,\n 'eventId': cal.eventId\n });\n request.execute(function(event) {\n if (event.hasOwnProperty('error')) {\n cal.event = null;\n showEventLink(false);\n showCalendar(null);\n } else {\n cal.event = event;\n if (event.status == 'cancelled') {\n showEventLink(false);\n showCalendar(null);\n } else {\n cal.event = event;\n showEventLink(true);\n showCalendar(event.start.dateTime);\n showEvent();\n showFacilitator();\n }\n }\n });\n });\n}", "makeRecurrence(rule) {\n const event = this.eventRecord,\n eventCopy = event.copy();\n let recurrence = event.recurrence;\n\n if (!rule && recurrence) {\n recurrence = recurrence.copy();\n } else {\n recurrence = new event.recurrenceModel({\n rule\n });\n } // bind cloned recurrence to the cloned event\n\n recurrence.timeSpan = eventCopy; // update cloned event w/ start date from the UI field\n\n eventCopy.setStartDate(this.values.startDate);\n recurrence.suspendTimeSpanNotifying();\n return recurrence;\n }", "function createEvent(formData) {\n var calendar = CalendarApp.getCalendarById(calendarId);\n var startDate = getDate(formData[startDatePosition], formData[startTimePosition]);\n var endDate = getDate(formData[endDatePosition], formData[endTimePosition]);\n var numRepeats = 4; //limit to 4 to make sure hosts don't forget and to prevent infinite repetition\n \n //no repeat\n if (formData[repeatsPosition] == \"No\") {\n var event = calendar.createEvent(formData[namePosition], startDate, endDate);\n event.setDescription(description);\n event.setLocation(formData[locationPosition]);\n Logger.log(\"Created event on \" + startDate);\n \n //monthly repeat\n } else if (formData[repeatsPosition].indexOf(\"Monthly\") > 0) {\n var monthlyRecurrence = CalendarApp.newRecurrence().addMonthlyRule().times(numRepeats);\n var events = calendar.createEventSeries(formData[namePosition], startDate, endDate, monthlyRecurrence);\n events.setDescription(description);\n events.setLocation(formData[locationPosition]);\n Logger.log(\"Created \" + numRepeats + \" monthly repeating events starting on \" + startDate);\n \n //biweekly repeat\n } else if (formData[repeatsPosition].indexOf(\"Every other week\") > 0) {\n var biweeklyRecurrence = CalendarApp.newRecurrence().addWeeklyRule().times(numRepeats).addWeeklyExclusion().interval(2);\n var events = calendar.createEventSeries(formData[namePosition], startDate, endDate, biweeklyRecurrence);\n events.setDescription(description);\n events.setLocation(formData[locationPosition]);\n Logger.log(\"Created \" + numRepeats + \" biweekly repeating events starting on \" + startDate);\n \n //weekly repeat\n } else {\n var weeklyRecurrence = CalendarApp.newRecurrence().addWeeklyRule().times(numRepeats);\n var events = calendar.createEventSeries(formData[namePosition], startDate, endDate, weeklyRecurrence);\n events.setDescription(description);\n events.setLocation(formData[locationPosition]);\n Logger.log(\"Created \" + numRepeats + \" weekly repeating events starting on \" + startDate);\n }\n}", "function addEvent(events) {\n\n var startDateTime = new Date();\n var endDateTime = new Date() + 60; /* makes workout time always 1 hr */\n\n newEvent['start']['dateTime'] = startDateTime;\n newEvent['end']['dateTime'] = endDateTime;\n\n events.push(newEvent);\n\n // var end = new EventDateTime();\n //end.setDateTime(endDateTime);\n // newEvent.setEnd(end);\n\n/*\n var reminderOverrides = new EventReminder[] {\n new EventReminder().setMethod(\"email\").setMinutes(60 * 12),\n new EventReminder().setMethod(\"popup\").setMinutes(30),\n };*/\n\n /* var reminders = new Event.Reminders()\n reminders.setUseDefault(false)\n reminders.setOverrides(Arrays.asList(reminderOverrides));\n newEvent.setReminders(reminders); */\n\n console.log(\"end of add event\");\n\n}", "function expandRecurringRanges(eventDef, framingRange, dateEnv, recurringTypes) {\n var typeDef = recurringTypes[eventDef.recurringDef.typeId];\n var markers = typeDef.expand(eventDef.recurringDef.typeData, framingRange, dateEnv);\n // the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to\n if (eventDef.allDay) {\n markers = markers.map(startOfDay);\n }\n return markers;\n }", "function isRRuleActiveOnDate(rrule, date, startDate)\r\n{\r\n rrule = rrule.replace(/^RRULE:/, '');\r\n\r\n gCurrRRULE = rrule;\r\n\r\n var eventMap = new Array();\r\n repeatingParts = rrule.split(\";\");\r\n repeatingSplitParts = new Array();\r\n expiredEvent = 0;\r\n\r\n // If we aren't given a start date, use now\r\n if (startDate == null)\r\n {\r\n// log(\"Defaulting startDate\");\r\n startDate = new Date();\r\n }\r\n else\r\n {\r\n// log(\"param startDate: \" + startDate );\r\n }\r\n\r\n // Break up the RRULE into array elements indexed by tags (like \"FREQ\")\r\n for (var item in repeatingParts)\r\n {\r\n repeatingSplitParts[repeatingParts[item].split(\"=\")[0]] = (repeatingParts[item].split(\"=\")[1]);\r\n }\r\n\r\n /*\r\n for (var item in repeatingSplitParts)\r\n {\r\n log(\"repeatingSplitParts['\"+item+\"']: \" + repeatingSplitParts[item]);\r\n }\r\n */\r\n\r\n // log(\"+++++++++ isRRuleActiveOnDate: '\" + rrule + \"' on \" + date);\r\n\r\n if (repeatingSplitParts[\"UNIXSTART\"])\r\n {\r\n // This will override a startDate given as a parameter\r\n startDate = new Date(Number(repeatingSplitParts[\"UNIXSTART\"]));\r\n //log(\"startDate: \" + startDate + \" UNIXSTART: \" + repeatingSplitParts[\"UNIXSTART\"]);\r\n }\r\n\r\n var startTime = \"\";\r\n \r\n if ( startDate.getHours() <= 9 )\r\n startTime += \"0\";\r\n startTime += startDate.getHours();\r\n if ( startDate.getMinutes() <= 9 )\r\n startTime += \"0\";\r\n startTime += startDate.getMinutes();\r\n\r\n // Truncate startDate to lose the time and just keep the date\r\n// startDate = beginningOfToday(startDate);\r\n// startDate.setHours( 12 );\r\n\r\n startDate = new CalDate( startDate.getFullYear(), startDate.getMonth() + 1, startDate.getDate() );\r\n\r\n //log(\"+++++++++ isRRuleActiveOnDate: '\" + rrule + \"' on \" + String(date) + \" (startDate: \" + String( startDate ) + \")\");\r\n\r\n if (repeatingSplitParts[\"UNTIL\"])\r\n {\r\n endDate = parseUntilString(repeatingSplitParts[\"UNTIL\"]);\r\n\r\n var tempCalDate = new CalDate( endDate.getFullYear(), endDate.getMonth() + 1, endDate.getDate() );\r\n if (date > tempCalDate)\r\n {\r\n // log(\"********* Span of recurrence has passed (\" + date + \" > \" + endDate + \")\");\r\n return false;\r\n }\r\n }\r\n\r\n // this tree encodes the actual combinations that iCal generates\r\n // in the RRULEs. For example, while, in theory, one could have an\r\n // RRULE which specified a recurrence of 'yearly on the last Tuesday',\r\n // it isn't possible to specify that in iCal\r\n\r\n // Once this section is complete \"actualStartDate\" will be set appropriately\r\n // and the first event will be in the map\r\n\r\n if (repeatingSplitParts[\"FREQ\"] == \"WEEKLY\")\r\n {\r\n if (repeatingSplitParts[\"BYDAY\"])\r\n {\r\n var days = repeatingSplitParts[\"BYDAY\"].split(\",\");\r\n\r\n // If the first day of repetition isn't the same as the day\r\n // of the start day, the event has an additional repetition\r\n // on the start day.\r\n if (startDate.getDOW() != convertToJSDayCode(days[0]))\r\n {\r\n addToEventMap( repeatingSplitParts['UID'], startDate, startTime, eventMap );\r\n }\r\n\r\n // Move the start date to the first repeating day\r\n actualStartDate = findNextDay(startDate, days[0]);\r\n\r\n // Add events for all the specified days in the first week\r\n // that fall after the startdate\r\n for (var d in days)\r\n {\r\n var tmpDate = findNextDay(startDate, days[d]);\r\n\r\n if (tmpDate > startDate)\r\n {\r\n addToEventMap( repeatingSplitParts['UID'], tmpDate, startTime, eventMap );\r\n }\r\n }\r\n\r\n }\r\n else\r\n {\r\n actualStartDate = startDate;\r\n }\r\n\r\n addToEventMap( repeatingSplitParts['UID'], actualStartDate, startTime, eventMap );\r\n }\r\n else if (repeatingSplitParts[\"FREQ\"] == \"MONTHLY\")\r\n {\r\n if (repeatingSplitParts[\"BYDAY\"])\r\n {\r\n var interval = Number(repeatingSplitParts[\"INTERVAL\"]);\r\n\r\n if (interval == 0)\r\n {\r\n interval = 1;\r\n }\r\n\r\n // We make the date of repetition the 1st of the next\r\n // month with an instance and handle the \"BYDAY\" specification\r\n // when we loop through the iterations later\r\n actualStartDate = beginningOfMonth(addMonths(startDate, interval));\r\n\r\n var days = repeatingSplitParts[\"BYDAY\"].split(\",\");\r\n\r\n // Add events for all the specified days in the first month\r\n // that fall after the startdate\r\n for (var d in days)\r\n {\r\n var tmpDate = findNthDay(startDate, days[d]);\r\n\r\n if (tmpDate != null)\r\n {\r\n //log(\"tmpDate: setting eventMap[\" + tmpDate.getTextDate() + \"]\"); \r\n addToEventMap( repeatingSplitParts['UID'], tmpDate, startTime, eventMap );\r\n }\r\n }\r\n\r\n // If the first day of repetition isn't the same as the day\r\n // of the start day, the event has an additional repetition\r\n // on the start day.\r\n var targetDay = convertToJSDayCode(days[0].substr(-2, 2));\r\n if (startDate.getDOW() != targetDay)\r\n {\r\n //log(\"startDate: setting eventMap[\" + startDate.getTextDate() + \"]\");\r\n addToEventMap( repeatingSplitParts['UID'], startDate, startTime, eventMap );\r\n }\r\n }\r\n else if (repeatingSplitParts[\"BYMONTHDAY\"])\r\n {\r\n var days = repeatingSplitParts[\"BYMONTHDAY\"].split(\",\");\r\n\r\n // If the first day of repetition isn't the same as the day\r\n // of the start day, the event has an additional repetition\r\n // on the start day.\r\n if (startDate.getDOW() != convertToJSDayCode(days[0].substr(-2, 2)))\r\n {\r\n addToEventMap( repeatingSplitParts['UID'], startDate, startTime, eventMap );\r\n }\r\n\r\n // Add events for all the specified days in the first month\r\n // that fall after the startdate\r\n for (var d in days)\r\n {\r\n var tmpDate = makeDate(startDate.getYear(), startDate.getMonth(), days[d]);\r\n\r\n if (tmpDate > startDate)\r\n {\r\n addToEventMap( repeatingSplitParts['UID'], tmpDate, startTime, eventMap );\r\n }\r\n }\r\n\r\n // Move the start date to the first repeating day\r\n actualStartDate = startDate;\r\n }\r\n else\r\n {\r\n actualStartDate = startDate;\r\n }\r\n }\r\n else if (repeatingSplitParts[\"FREQ\"] == \"YEARLY\")\r\n {\r\n // Add any months that were asked for\r\n if (repeatingSplitParts[\"BYMONTH\"])\r\n {\r\n var months = repeatingSplitParts[\"BYMONTH\"].split(\",\");\r\n\r\n for (var m in months)\r\n {\r\n // Yearly events can also have a \"BYDAY\" component which indicates\r\n // which day of the month the repetition occurs on\r\n if (repeatingSplitParts[\"BYDAY\"])\r\n {\r\n var days = repeatingSplitParts[\"BYDAY\"].split(\",\");\r\n\r\n for (var d in days)\r\n {\r\n var newDate = findNthDay( makeDate( startDate.getYear(), months[m], 1 ), days[d] );\r\n\r\n log(\"startDate: \" + startDate.getTextDate() + \" -> newDate: \" + newDate.getTextDate() + \"; \" + days[d] + \" (\" + repeatingSplitParts[\"BYDAY\"] + \"; \" + d + \")\");\r\n if (newDate != null && newDate > startDate)\r\n {\r\n addToEventMap( repeatingSplitParts['UID'], newDate, startTime, eventMap );\r\n }\r\n }\r\n }\r\n else\r\n {\r\n var newDate = makeDate(startDate.getYear(), months[m], startDate.getDay());\r\n if (newDate > startDate)\r\n {\r\n addToEventMap( repeatingSplitParts['UID'], newDate, startTime, eventMap );\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (repeatingSplitParts[\"BYDAY\"])\r\n {\r\n actualStartDate = beginningOfMonth(startDate);\r\n }\r\n else\r\n {\r\n actualStartDate = startDate;\r\n }\r\n }\r\n else\r\n {\r\n actualStartDate = startDate;\r\n }\r\n\r\n nextDate = actualStartDate;\r\n \r\n tomorrow = date.clone();\r\n tomorrow.addDays( 1 );\r\n\r\n var count = 0;\r\n\r\n while (nextDate < tomorrow)\r\n {\r\n if ( repeatingSplitParts[\"COUNT\"] != null )\r\n {\r\n if ( count++ >= repeatingSplitParts[\"COUNT\"] )\r\n break;\r\n }\r\n \r\n //log(\"iterating: nextDate: \" + String( nextDate ));\r\n\r\n if (repeatingSplitParts[\"FREQ\"] == \"WEEKLY\")\r\n {\r\n //eventMap[nextDate.getTextDate()] = 1;\r\n addToEventMap( repeatingSplitParts['UID'], nextDate, startTime, eventMap );\r\n \r\n // Add any further days that were asked for\r\n if (repeatingSplitParts[\"BYDAY\"])\r\n {\r\n var days = repeatingSplitParts[\"BYDAY\"].split(\",\");\r\n\r\n for (var d = 1; d < days.length; d++)\r\n {\r\n var anotherDate = findNextDay(nextDate, days[d]);\r\n //log('WEEKLY: doing further days: ' + days[d] + ' (' + anotherDate.getTextDate() + ')' + ' (' + nextDate.getTextDate() + ')');\r\n addToEventMap( repeatingSplitParts['UID'], anotherDate, startTime, eventMap );\r\n }\r\n }\r\n }\r\n else if (repeatingSplitParts[\"FREQ\"] == \"MONTHLY\")\r\n {\r\n // Add any further days that were asked for\r\n if (repeatingSplitParts[\"BYDAY\"])\r\n {\r\n var days = repeatingSplitParts[\"BYDAY\"].split(\",\");\r\n\r\n for (var d in days)\r\n {\r\n //log('MONTHLY: doing further BYDAY days: ' + days[d]);\r\n var anotherDate = findNthDay(nextDate, days[d]);\r\n //log(\"anotherDate: setting eventMap[\" + tmpDate.getTextDate() + \"]\");\r\n \r\n if ( anotherDate != null )\r\n addToEventMap( repeatingSplitParts['UID'], anotherDate, startTime, eventMap );\r\n }\r\n }\r\n else if (repeatingSplitParts[\"BYMONTHDAY\"])\r\n {\r\n //eventMap[nextDate.getTextDate()] = 1;\r\n addToEventMap( repeatingSplitParts['UID'], nextDate, startTime, eventMap );\r\n \r\n var days = repeatingSplitParts[\"BYMONTHDAY\"].split(\",\");\r\n\r\n for (var d = 1; d < days.length; d++)\r\n {\r\n //log('MONTHLY: doing further BYMONTHDAY days: ' + days[d]);\r\n var anotherDate = makeDate(nextDate.getYear(), nextDate.getMonth(), days[d]);\r\n addToEventMap( repeatingSplitParts['UID'], anotherDate, startTime, eventMap );\r\n }\r\n }\r\n else\r\n {\r\n addToEventMap( repeatingSplitParts['UID'], nextDate, startTime, eventMap );\r\n }\r\n }\r\n else if (repeatingSplitParts[\"FREQ\"] == \"YEARLY\")\r\n {\r\n // Add any months that were asked for\r\n if (repeatingSplitParts[\"BYMONTH\"])\r\n {\r\n var months = repeatingSplitParts[\"BYMONTH\"].split(\",\");\r\n\r\n for (var m in months)\r\n {\r\n // Yearly events can also have a \"BYDAY\" component which indicates\r\n // which day of the month the repetition occurs on\r\n if (repeatingSplitParts[\"BYDAY\"])\r\n {\r\n var days = repeatingSplitParts[\"BYDAY\"].split(\",\");\r\n\r\n for (var d in days)\r\n {\r\n var newDate = findNthDay(makeDate(nextDate.getYear(), months[m], 1), days[d]);\r\n\r\n // log(\"nextDate: \" + nextDate.getTextDate() + \" -> newDate: \" + newDate.getTextDate() + \"; \" + days[d] + \" (\" + repeatingSplitParts[\"BYDAY\"] + \"; \" + d + \")\");\r\n if (newDate != null)\r\n {\r\n addToEventMap( repeatingSplitParts['UID'], newDate, startTime, eventMap );\r\n }\r\n }\r\n }\r\n else\r\n {\r\n var anotherDate = makeDate(nextDate.getYear(), months[m], nextDate.getDay());\r\n addToEventMap( repeatingSplitParts['UID'], anotherDate, startTime, eventMap );\r\n }\r\n }\r\n }\r\n else\r\n {\r\n addToEventMap( repeatingSplitParts['UID'], nextDate, startTime, eventMap );\r\n }\r\n }\r\n else\r\n {\r\n addToEventMap( repeatingSplitParts['UID'], nextDate, startTime, eventMap );\r\n }\r\n\r\n nextDate = addRruleInterval(nextDate, repeatingSplitParts[\"FREQ\"], repeatingSplitParts[\"INTERVAL\"]);\r\n }\r\n\r\n for (var e in eventMap)\r\n {\r\n// log(\"eventMap[\"+e+\"]: \" + eval(\"eventMap[\"+e+\"]\"));\r\n if (eventMap[date.getTextDate()] == 1)\r\n {\r\n // log(\"eventMap[\"+e+\"]: \" + eval(\"eventMap[\"+e+\"]\"));\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n}", "function checkSchedule(event) {\n let eventName = event.name\n // iterate through the activities\n for (let i = 0; i < activities.length; i++) {\n // skip clicked item\n if (activities[i].name != eventName) {\n //check dataset dayAndTime for conflict\n if (activities[i].dataset.dayAndTime === event.dataset.dayAndTime) {\n // prevent time conflicts\n activities[i].disabled = ! activities[i].disabled;\n }\n }\n }\n}", "function parseRecurring(eventInput, allDayDefault, dateEnv, leftovers) {\n for (var i = 0; i < recurringTypes.length; i++) {\n var parsed = recurringTypes[i].parse(eventInput, allDayDefault, leftovers, dateEnv);\n\n if (parsed) {\n return {\n allDay: parsed.allDay,\n duration: parsed.duration,\n typeData: parsed.typeData,\n typeId: i\n };\n }\n }\n\n return null;\n }", "function expandRecurringRanges(eventDef, framingRange, dateEnv) {\n var typeDef = recurringTypes[eventDef.recurringDef.typeId];\n var markers = typeDef.expand(eventDef.recurringDef.typeData, eventDef, framingRange, dateEnv); // the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to\n\n if (eventDef.allDay) {\n markers = markers.map(marker_1.startOfDay);\n }\n\n return markers;\n }", "onEventCreated(newEventRecord) {}", "function onSelectRecurringType(){\n var type = getSelectedRadioButton(\"type_option\");\n if (type == \"none\") {\n enabledDay(false);\n enabledWeek(false);\n enabledMonth(false);\n enabledYear(false);\n enableField([\"total\"],false);\n abRecurringPatternCtrl.showDateStartByType(false);\n abRecurringPatternCtrl.showDateEndByType(false);\n }\n if (type == \"once\") {\n enabledDay(false);\n enabledWeek(false);\n enabledMonth(false);\n enabledYear(false);\n enableField([\"total\"],false);\n abRecurringPatternCtrl.showDateStartByType(true);\n abRecurringPatternCtrl.showDateEndByType(false);\n }\n if (type == \"day\") {\n enabledDay(true);\n enabledWeek(false);\n enabledMonth(false);\n enabledYear(false);\n enableField([\"total\"],true);\n }\n if (type == \"week\") {\n enabledDay(false);\n enabledWeek(true);\n enabledMonth(false);\n enabledYear(false);\n enableField([\"total\"],true);\n }\n if (type == \"month\") {\n enabledDay(false);\n enabledWeek(false);\n enabledMonth(true);\n enabledYear(false);\n enableField([\"total\"],true);\n }\n if (type == \"year\") {\n enabledDay(false);\n enabledWeek(false);\n enabledMonth(false);\n enabledYear(true);\n enableField([\"total\"],true);\n }\n if (type != \"none\" && type != \"once\" ) {\n abRecurringPatternCtrl.showDateStartByType(true);\n abRecurringPatternCtrl.showDateEndByType(true);\n }\n \n //add note\n addNote();\n \n //display area by type\n displayAreaBytype(type);\n}", "syncEventRecord(recurrence) {\n // get values relevant to the RecurrenceModel (from enabled fields only)\n const values = this.getValues((w) => w.name in recurrence && !w.disabled);\n\n recurrence.set(values);\n }", "function parseEventDef(refined, extra, sourceId, allDay, hasEnd, context) {\n var def = {\n title: refined.title || '',\n groupId: refined.groupId || '',\n publicId: refined.id || '',\n url: refined.url || '',\n recurringDef: null,\n defId: guid(),\n sourceId: sourceId,\n allDay: allDay,\n hasEnd: hasEnd,\n ui: createEventUi(refined, context),\n extendedProps: __assign(__assign({}, (refined.extendedProps || {})), extra),\n };\n for (var _i = 0, _a = context.pluginHooks.eventDefMemberAdders; _i < _a.length; _i++) {\n var memberAdder = _a[_i];\n __assign(def, memberAdder(refined));\n }\n // help out EventApi from having user modify props\n Object.freeze(def.ui.classNames);\n Object.freeze(def.extendedProps);\n return def;\n }", "function violentDayEvent(id) {\n\n}", "function peacefulDayEvent(id) {\n\n}", "function expandRecurringRanges(eventDef, duration, framingRange, dateEnv, recurringTypes) {\n var typeDef = recurringTypes[eventDef.recurringDef.typeId];\n var markers = typeDef.expand(eventDef.recurringDef.typeData, {\n start: dateEnv.subtract(framingRange.start, duration),\n end: framingRange.end\n }, dateEnv);\n // the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to\n if (eventDef.allDay) {\n markers = markers.map(startOfDay);\n }\n return markers;\n}", "static isMarkOnCalendar(date, reminder)\n\t{\n\t\t/* \n\t\t\tdayDifference is how many days pass between date and reminder date.\n\t\t\tfrequency is the number of times repeating.\n\t\t*/\n\t\tlet dayDifference = date.getTime() - reminder.startTimeMilliseconds + 86400000 - 1;\n\t\tlet frequency = reminder.frequency;\n\t\tlet reminderDate = new Date(reminder.startTimeMilliseconds);\n\t\tlet monthDifference;\n\t\tlet week;\n\t\n\t\t/* date is before the reminder */\n\t\tif(dayDifference < 0) return false;\n\t\n\t\t/* Until a specific date */\n\t\tif(reminder.effectiveType == \"U\" && getDateString(date) > reminder.effectiveData) return false; \n\t\t\n\t\n\t\tdayDifference = Math.floor(dayDifference / 86400000);\n\t\t\n\t\t/* never repeat */\n\t\tif(reminder.repeatType == 'n') // \"Nerver\"\n\t\t{\n\t\t\tif(dayDifference == 0) return true;\n\t\t\telse return false;\n\t\t}\n\t\n\t\t/* evert ? days. ? means positive number */\n\t\tif(reminder.repeatType == 'd')\n\t\t{\n\t\t\tif(dayDifference % frequency == 0) \n\t\t\t{\n\t\t\t\tif(reminder.effectiveType == \"N\") // For a number of event \n\t\t\t\t{\n\t\t\t\t\tif(dayDifference / frequency < parseInt(reminder.effectiveData)) return true;\n\t\t\t\t}\n\t\t\t\telse return true;\n\t\t\t}\n\t\t\t\n\t\t\treturn false;\n\t\t}\n\t\n\t\t/* repeat ? year */\n\t\tif(reminder.repeatType == 'y')\n\t\t{\t\n\t\n\t\t\tif((date.getFullYear() - reminderDate.getFullYear()) % frequency == 0)\n\t\t\t{\n\t\t\t\t/* they must have same day and month */\n\t\t\t\tif(date.getMonth() == reminderDate.getMonth() && date.getDate() == reminderDate.getDate())\n\t\t\t\t{\n\t\t\t\t\tif(reminder.effectiveType == \"N\")\n\t\t\t\t\t{\n\t\t\t\t\t\tif((date.getFullYear() - reminderDate.getFullYear()) / frequency < parseInt(reminder.effectiveData)) return true;\n\t\t\t\t\t}\n\t\t\t\t\telse return true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\n\t\t/* evert ? month */\n\t\tif(reminder.repeatType == 'm')\n\t\t{\t\n\t\t\tmonthDifference = (date.getFullYear() - reminderDate.getFullYear()) * 12;\n\t\t\tmonthDifference += date.getMonth() - reminderDate.getMonth();\n\t\t\tif(monthDifference % frequency == 0)\n\t\t\t{\n\t\t\t\t/* same day */\n\t\t\t\tif(date.getDate() == reminderDate.getDate()) \n\t\t\t\t{\n\t\t\t\t\tif(reminder.effectiveType == \"N\")\n\t\t\t\t\t{\n\t\t\t\t\t\tif( monthDifference / frequency < parseInt(reminder.effectiveData)) return true;\n\t\t\t\t\t}\n\t\t\t\t\telse return true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\n\t\t/* every ? week (on Mon. Tue. and so on) */\n\t\tif(reminder.repeatType == 'w')\n\t\t{\n\t\t\tlet num_reminders = 0;\n\t\t\tlet total = parseInt(reminder.effectiveData);\n\t\t\t/*\n\t\t\tif((dayDifference % (7 * frequency) == 0)) return true;\n\t\t\t*/\n\t\t\t/* create week that stores interger */\n\t\t\tif(reminder.week == \"\") week = [0];\n\t\t\telse week = reminder.week.split(\",\").map(function(element){ return parseInt(element); });\n\t\t\t\n\t\t\tnum_reminders = Math.floor(dayDifference / (7 * frequency)) * week.length;\n\t\n\t\t\t//if(num_reminders > total) return false;\n\t\n\t\t\tfor(var i = 0; i < week.length; i++)\n\t\t\t{\n\t\t\t\tif(num_reminders >= total) return false;\n\t\t\t\tnum_reminders++;\n\t\t\t\tif(( dayDifference % (7 * frequency)) == (week[i] - week[0]) ) return true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}", "function defineEvent() {\n\tvar name = $(\"input[name='eventname']\").val().trim();\n\tvar nn = Number($(\"input[name='eventnn']\").val());\n\tvar en = Number($(\"input[name='eventen']\").val());\n\n\t// check it doesn't already exist\n\tvar e = {};\n\te.name = name;\n\te.nn = nn;\n\te.en = en;\n\taddEvent(e);\n}", "function expandRecurringRanges(eventDef, duration, framingRange, dateEnv, recurringTypes) {\n var typeDef = recurringTypes[eventDef.recurringDef.typeId];\n var markers = typeDef.expand(eventDef.recurringDef.typeData, {\n start: dateEnv.subtract(framingRange.start, duration),\n end: framingRange.end,\n }, dateEnv);\n // the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to\n if (eventDef.allDay) {\n markers = markers.map(startOfDay);\n }\n return markers;\n }", "function calanderToEvent_(calendarEvent) {\n let id = calendarEvent.getId();\n let title = calendarEvent.getTitle();\n let description = calendarEvent.getDescription();\n let startTime = calendarEvent.getStartTime();\n let endTime = calendarEvent.getEndTime();\n let event = {\n 'id': id,\n 'title': title,\n 'description': description,\n 'startTime': startTime,\n 'endTime': endTime,\n 'recurrence': \"null\"\n };\n if (calendarEvent.isRecurringEvent()) {\n let recurrence = calendarEvent.getTag('recurrence');\n event.recurrence = JSON.parse(recurrence);\n }\n return event;\n}", "function expandRecurringRanges$1(eventDef, duration, framingRange, dateEnv, recurringTypes) {\n var typeDef = recurringTypes[eventDef.recurringDef.typeId];\n var markers = typeDef.expand(eventDef.recurringDef.typeData, {\n start: dateEnv.subtract(framingRange.start, duration),\n end: framingRange.end\n }, dateEnv);\n // the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to\n if (eventDef.allDay) {\n markers = markers.map(startOfDay$1);\n }\n return markers;\n }", "onAddEvent() {\n let notification = null;\n if(this.state.notification) {\n notification = {\n notificationTitle: \"Reminder!\",\n notificationMessage: this.state.title,\n notificationDate: this.state.start\n }\n }\n this.props.addEvent(this.state.title, this.state.allDay, this.state.start, this.state.end, notification);\n this.props.showCalendar();\n }", "function setUpConference_() {\n if (ScriptProperties.getProperty('calId')) {\n Browser.msgBox('Your event is already set up. Look in Google Drive!');\n }\n var ss = SpreadsheetApp.getActive();\n var sheet = ss.getSheetByName('DemoSetup');\n var range = sheet.getDataRange();\n var values = range.getValues();\n setUpCalendar_(values, range);\n setUpForm_(ss, values);\n ScriptApp.newTrigger('onFormSubmit').forSpreadsheet(ss).onFormSubmit()\n .create();\n ss.removeMenu('Event Manager');\n}", "function expandRecurringRanges(eventDef, duration, framingRange, dateEnv, recurringTypes) {\n var typeDef = recurringTypes[eventDef.recurringDef.typeId];\n var markers = typeDef.expand(eventDef.recurringDef.typeData, {\n start: dateEnv.subtract(framingRange.start, duration),\n end: framingRange.end\n }, dateEnv); // the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to\n\n if (eventDef.allDay) {\n markers = markers.map(startOfDay);\n }\n\n return markers;\n }", "function checkCallendar(){\n\n\t\n gapi.client.load('calendar', 'v3', function() {\n\t \n\t var getGcalList = gapi.client.calendar.calendarList.list();\t\t \n\t \t \n\t getGcalList.execute(function(resp) {\n\n\t\t var nrOfCals=resp.items.length;\n\t\t var count=0;\n\t\t \n\t\t for (var key in resp.items) {\n\t\t\t//cal ID\n \t\t//console.log(resp.items[key].id);\n \t\t//Cal name\n\t\t\t//console.log(resp.items[key].summary);\n\t\t\t \n\t\t\tif(resp.items[key].summary==='TimeThis'){\n\t\t\t\n\t\t\t\tinitCal(resp.items[key].id)\n\t\t\t \n\t\t\t}else{\n\t\t\t\n\t\t\t\tif(count===nrOfCals-1){\n\t\t\t\t\tconsole.log('create call')\n\t\t\t\t\t\n\t\t\t\t\tvar createTimeThisCall = gapi.client.calendar.calendars.insert({\n\t\t\t\t\t\"resource\" :\n\t\t\t\t\t\t{\"backgroundColor\": \"#7795c6\",\n\t\t\t\t\t\t \"colorId\": \"18\",\n\t\t\t\t\t\t \"primary\": \"false\",\n\t\t\t\t\t\t\"summary\": \"TimeThis\",\n\t\t\t\t\t\t\"description\": \"TimeThis callendar\",\n\t\t\t\t\t\t\"timezone\" : \"\"+getTimeZone()+\"\"}\n\t\t\t\t\t});\n\t\t\n\t\t\t\t\t\n\t\t\t createTimeThisCall.execute(function(resp) {\n\t\t\t\t \t\t\n\t\t\t\t\t initCal(resp.id)\n\t\t\t\t \n\t\t\t\t });\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\tcount++ \n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t \n\t\t \n\t });\n \n});\n}", "function reportEventChange(event) {// event is change from eventID\t\n\t\trerenderEvents(event.id);\t\t\n\t\tvar currentObj = event;\n\t\tdate = currentObj.start;\n\t\tif (options.isDBUpdateonDrag && currentObj.isCurrent == false && options.defaultView=='month') {\n\t\t\tvar $scrollable = $(currentView.element).find(\"#scroll-slots\");\n\t\t\tvar parentContainerID = $scrollable.find(\"#dragable-\" + currentObj.id)\n\t\t\t\t\t.attr(\"id\");\n\t\t\tvar message = currentObj.msg;\n\t\t\tvar messageAndUIBinder = new MessageAndUIBinder(parentContainerID,\n\t\t\t\t\tmessage, AppConstants.XPaths.Appointment.MESSAGE_TYPE);\n\t\t\tif (messageAndUIBinder) {\n\t\t\t\tvar lookupHandler = appController.getComponent(\"DataLayer\").lookupHandler;\n\t\t\t\tmessageAndUIBinder.loadDataOntoForm(lookupHandler);\n\t\t\t\tmessageAndUIBinder.bindFieldEvents();\n\n\t\t\t\tvar fields = \"\";\n\t\t\t\tvar type = \"IVL_TS\";\n\t\t\t\tvar tagName = \"effectiveTime\";\n\t\t\t\tvar pathFields = fields.split(',');\n\t\t\t\tcurrentObj.start = CommonUtil.dateFormat(parseDate(currentObj.start),\n\t\t\t\t\t\t\"fullDateTime\");\n\t\t\t\tcurrentObj.end = CommonUtil.dateFormat(parseDate(currentObj.end),\n\t\t\t\t\t\t\"fullDateTime\");\n\t\t\t\tinstanceObject = [ currentObj.start, currentObj.end ];\n\t\t\t\tmessageAndUIBinder.writeValueToMessage(tagName, pathFields,\n\t\t\t\t\t\ttype, instanceObject);\n\t\t\t\tmessageAndUIBinder.bindFieldEvents();\n\t\t\t\t$(messageAndUIBinder.parentContainerID).trigger(\"change\");\n\t\t\t}\n\t\t\tcurrentObj.start = parseDate(currentObj.start);\n\t\t\tcurrentObj.end = parseDate(currentObj.end);\t\t\t\n\t\t\tonChangeSchedule(currentObj);\t\n\t\t}\n\t}", "function UpdateRecurringCheckbox(data) {\n\t\t\tdata = data || {};\n\n\t\t\tmoment.locale('en');\n\n\t\t\t// PK\n\t\t\tthis.id = data.id || null;\n\n\t\t\t// FK\n\t\t\tthis.target_id = data.target_id || null;\n\n\t\t\t// Properties\n\t\t\tthis.achieved_at = data.achieved_at || null;\n\n\t\t\t// Properties omitted from JSON by Angular due to `$$` prefix.\n\t\t\tthis.$$achieved_at = data.achieved_at ? true : null;\n\t\t}", "fmt_icalendar (calobj, evtjson) {\n \n var evtQualifier, lrule, momentNextEndDate, momentNextStartDate, nexteventStartdate;\n\n // need the evtjosn AND we need a summmary which describes the event otherwise skip it\n try {\n if ( !evtjson || !evtjson.summary) {\n console.log(\"Invalid event to format)\");\n return; \n }\n \n if ( evtjson.startDate && ( moment(evtjson.startDate,'YYYYMMDDTHHmmss').isValid() || moment(evtjson.startDate,'YYYYMMDD').isValid() ) ) {\n this.isalldayevent = ! ( moment(evtjson.startDate,'HHmmss').isValid() && evtjson.startDate.toString().length > 8) ;\n this.eventStart = moment.tz(evtjson.startDate,calobj.intimezone);\n } else {\n console.log(\"Invalid start date\");\n return; \n }\n \n // if ( this.isalldayevent ) console.log(\"$$$$$$ SET ALL DAY EVENT $$$$$$$$\");\n\n if ( evtjson.endDate && moment(evtjson.endDate,'YYYYMMDDTHHmmss').isValid() ) {\n this.eventEnd = moment.tz(evtjson.endDate,calobj.intimezone);\n } else {\n // no enddate. \n this.eventEnd = this.eventStart.clone();\n \n // eslint-disable-next-line no-warning-comments\n // TODO: if we have a duration, calculate it\n\n // otherwise Spec says if startdate is dateonly duration is 1 day otherwise 0 days\n if ( ! moment(evtjson.startDate,'YYYYMMDDTHHmmss').isValid() ) {\n this.eventEnd.add(1,'day');\n }\n }\n\n // calculate the length\n this.eventlength = this.eventEnd.diff(this.eventStart,'minutes');\n\n this.setcleansummary(calobj, evtjson.summary);\n \n // usedate = evtjson.startDate;\n // console.log(\"createevent start:\" + this.eventStart.format() + \", end:\" + this.eventEnd.format() + \", summary=\" + this.summary);\n\n // eslint-disable-next-line no-warning-comments\n // TODO: possible bug, can we have a recurring rule on a multi-day event that results in a new event that spans today\n // at the moment we filter to today or later on the rule generated dates so we might miss it\n if ( evtjson.rrule ) {\n nexteventStartdate = this.returnNextEventDateFromRule(calobj, evtjson.startDate,evtjson);\n lrule = evtjson.rrule;\n momentNextStartDate = moment.tz(nexteventStartdate,'YYYY-MM-DDTHHmmss',calobj.intimezone);\n momentNextEndDate = momentNextStartDate.add(this.eventlength,'minutes');\n evtQualifier = this.eventTimeQualifier(calobj, momentNextStartDate,momentNextEndDate);\n } else {\n // no recurring rule so check to see if it spans today\n evtQualifier = this.eventTimeQualifier(calobj, this.eventStart,this.eventEnd);\n lrule = \"\";\n if ( evtQualifier == this.EVENTSTARTSTODAY || evtQualifier == this.EVENTISPAST || evtQualifier == this.EVENTISFUTURE ) {\n momentNextStartDate = this.eventStart.clone();\n } else {\n // must span or end today so it started at midnight\n momentNextStartDate = calobj.todayDate; \n }\n momentNextEndDate = this.eventEnd;\n }\n\n // this.uidtouse = uuid.v4();\n // let sortkey = this.eventStart.format('HH:mm') + \":\" + this.summary + \":\" + uidtouse;\n // this.uid = uidtouse;\n // this.sortkey = sortkey;\n\n this.qualifier = evtQualifier;\n this.rrule = lrule;\n this.nextStart = momentNextStartDate;\n this.nextEnd = momentNextEndDate;\n\n this.isvalid = true;\n\n }\n catch(e) {\n console.log(\"error in event creation:\",e);\n }\n \n }", "createEvent(text) {\n const id = Date.now(); // TODO not great\n this.events.push({\n id,\n text,\n complete: false,\n });\n\n this.emit(\"change\");\n }", "function trigger_diary_entry_reminder() {\n if (!store.get('reminders')) return;\n create_diary_entry_window();\n setTimeout(trigger_diary_entry_reminder, 24 * 60 * 60 * 1000); //Run again in 24 hours.\n}", "function addReminder( id, reminder) {\n gapi.client.load('calendar', 'v3', function() { \n var request = gapi.client.calendar.events.patch({\n 'calendarId': 'primary',\n 'eventId': id,\n\t 'resource': reminder\n });\n request.execute(function(resp) {\n console.log(resp);\n\t if (resp.id){\n\t \t console.log(\"Reminder was successfully added to: \" + resp.summary);\n\t }\n\t else{\n\t \tconsole.log(\"Reminder fail. An error occurred with: \" + resp.summary)\n\t }\n \n });\n });\n }", "function constroiEventos(){}", "async function createNotification(name, endDate, timeOfNotification) {\n let noti = new Date(endDate.getTime())\n noti.setDate(endDate.getDate() - 1)\n\n noti.setHours(timeOfNotification)\n noti.setMinutes(0)\n noti.setSeconds(0)\n\n //makes sure the notification is in the future\n if (noti > new Date()) {\n console.log(\"noti for \" + noti)\n await Notifications.scheduleNotificationAsync({\n content: {\n title: `${name} is recurring soon!`,\n body: `Your ${name} subscription is about to recur`,\n data: { data: 'goes here' },\n },\n trigger: noti,\n })\n\n //TODO: Just for testing\n Notifications.cancelAllScheduledNotificationsAsync()\n }\n}", "removeOccurrences() {\n // This recurring event must also be removed from the occurrenceMap if it's there\n // So insert it as the first element. Can also be found from the store's global occurrence\n // Map using [...this.eventStore.globalOccurrences.keys()].filter(e => e.startsWith(`_generated:${this.id}`))\n [this, ...this.occurrences].forEach(occurrence => this.removeOccurrence(occurrence));\n }", "function insertEvent() {\n \tvar resource = {\n \"summary\":\"Test Event\",\n \"location\": \"Under there\",\n\t \"description\": \"Doing neat stuff\",\n \"start\": {\n \"dateTime\": \"2014-01-08T10:00:00-04:00\" //if not an all day event, \"date\" should be \"dateTime\" with a dateTime value formatted according to RFC 3339\n },\n \"end\": {\n \"dateTime\": \"2014-01-08T12:00:00-04:00\" //if not an all day event, \"date\" should be \"dateTime\" with a dateTime value formatted according to RFC 3339\n }\n };\n gapi.client.load('calendar', 'v3', function() { \n var request = gapi.client.calendar.events.insert({\n 'calendarId': 'primary',\n\t 'resource': resource\n });\n request.execute(function(resp) {\n console.log(resp);\n\t if (resp.id){\n\t \t alert(\"Event was successfully added to the calendar!\");\n\t }\n\t else{\n\t \talert(\"An error occurred. Please try again later.\")\n\t }\n \n });\n });\n }", "function NotificationEventFactory() {}", "async function reCalc(ev) {\n const nowTime = new Date().getTime();\n if (ev.repeatDays.length > 0) { // repeatDays is an array of days to skip\n // If it's got repeatDays set up, splice the next time, and if it runs out of times, return null\n while (nowTime > ev.eventDT && ev.repeatDays.length > 0) {\n const days = parseInt(ev.repeatDays.splice(0, 1)[0], 10);\n ev.eventDT = parseInt(ev.eventDT, 10) + parseInt(dayMS * days, 10);\n }\n if (nowTime > ev.eventDT) { // It ran out of days\n return null;\n }\n } else if (ev.repeat.repeatDay || ev.repeat.repeatHour || ev.repeat.repeatMin) { // 0d0h0m\n // Else it's using basic repeat\n while (nowTime >= ev.eventDT) {\n ev.eventDT =\n parseInt(ev.eventDT, 10) +\n (ev.repeat.repeatDay * dayMS) +\n (ev.repeat.repeatHour * hourMS) +\n (ev.repeat.repeatMin * minMS);\n }\n }\n return ev;\n }", "function createEvent() { \n \n var event = {\n 'summary': 'Google I/O 2015',\n 'location': '800 Howard St., San Francisco, CA 94103',\n 'description': 'A chance to hear more about Google\\'s developer products.',\n 'start': {\n 'dateTime': '2015-05-28T09:00:00-07:00',\n 'timeZone': 'America/Los_Angeles'\n },\n 'end': {\n 'dateTime': '2015-05-28T09:00:00-08:00',\n 'timeZone': 'America/Los_Angeles'\n }\n \n };\n\n var request = gapi.client.calendar.events.insert({\n 'calendarId': 'primary',\n 'resource': event\n });\n\n request.execute(function (event) {\n console.log('Event created.');\n });\n }", "scheduleRepeating(time, frequency, callback) {\n // create a dummy buffer to trigger the event\n const dummyBuffer = this.audioCtx.createBuffer(1, 1, 44100);\n const dummySource = this.audioCtx.createBufferSource();\n dummySource.buffer = dummyBuffer;\n dummySource.connect(this.audioCtx.destination);\n\n // grab the next event id value\n const newEvent = {\n id: ++this.eventId,\n count: 0,\n time,\n frequency,\n type: \"repeating\",\n callback,\n source: dummySource,\n };\n\n // assign callback\n dummySource.onended = () => {\n callback();\n // add the next occurence\n this.incrementRepeating(newEvent);\n };\n\n dummySource.start(\n // ensure the start time is positive\n Math.max(0, time - dummyBuffer.duration)\n );\n\n // initialize the event queue with the first event\n this.queue.push(newEvent);\n\n return newEvent.id;\n }", "_scheduleEvents() {\n let now = clock.now();\n // number of events to schedule variaes based on the day of the week\n let dow = now.getDay();\n let numberOfEvents = (dow === 0 || dow === 7) ? this.weekendFrequency : this.weekDayFrequency;\n for (let i = 0; i < numberOfEvents; i++) {\n this.events.push(now.getTime() + Math.random() * MILLISECONDS_IN_DAY);\n }\n // sort ascending so we can quickly figure out the next time to run\n // after running, we'll remove it from the queue\n this.events.sort((a, b) => a - b);\n }", "function searchVariation1() {\r\n\tvar filter = new Array();\r\n\t//Demonstrate syntax recognition for new array and push. \r\n\t//#7 Fields for event will be displayed.\r\n\tfilter.push(new nlobjSearchFilter('', null, 'is', 1));\r\n\tvar res = nlapiSearchRecord('calendarevent', null, filter);\r\n\tnlapiLogExecution('DEBUG', 'len = '+(res==null) ? 0 : res.length);\r\n}", "removeOccurrences() {\n // This recurring event must also be removed from the occurrenceMap if it's there\n // So insert it as the first element. Can also be found from the store's global occurrence\n // Map using [...this.eventStore.globalOccurrences.keys()].filter(e => e.startsWith(`_generated:${this.id}`))\n [this, ...this.occurrences].forEach(occurrence => this.removeOccurrence(occurrence));\n }", "function doCreateEvent() {\n\tvar anEvent = Alloy.createModel('Event');\n\tanEvent.set({\n\t\tname : 'Celebration',\n\t\tstart_time : new Date(),\n\t\tduration : 3600,\n\t\trecurring : 'monthly',\n\t\trecurring_count : 5\n\t});\n\n\tanEvent.save().then(function(_model) {\n\t\tconsole.log(\"anEvent.save \" + JSON.stringify(_model, null, 2));\n\n\t\tvar moment = require('alloy/moment');\n\t\tconsole.log(\"start time-relative: \" + _model.getFromNowStartTime());\n\t\tconsole.log(\"start time-formatted: \" + _model.getFormattedStartTime());\n\n\t\treturn doFetchEvents();\n\n\t}, function(_error) {\n\t\talert(_error.message);\n\t});\n}", "function forAScheduleId(){\r\n\treturn \"\";\r\n}", "function peacefulNightEvent(id) {\n\n}", "function isPending(fcEvent)\n{\n return fcEvent.extendedProps.status == 'pending';\n}", "static async _schedule() {\n\t\t// Register the task definition first\n\t\tconsole.log(\"SCHEDULE 1) Register Task Definition\");\n\t\tconst taskDefinition = await ECSManager.registerTaskDefinition();\n\t\tconst taskDefinitionArn = taskDefinition.taskDefinition.taskDefinitionArn;\n\n\t\t// Register a Cloudwatch event for this task definition as a cron job\n\t\tconsole.log(\"SCHEDULE 2) Register CloudWatch event\")\n\t\tconst targetSchedule = await CloudWatchManager.registerEvent(taskDefinitionArn);\n\t\treturn targetSchedule;\n\t}", "function EventoCalendar(presupuesto, consumido, total, correo, nombre_alerta, resultado_final) {\r\n \r\n var calendario = 'primary';\r\n var inicio = new Date();\r\n var cortesia = ('-' + resultado_final);\r\n var fin = new Date();\r\n fin.setDate(fin.getDate() - cortesia);\r\n \r\n var evento = {\r\n summary: nombre_alerta,\r\n description: 'El presupuesto ha llegado a ' + consumido + '€ de ' + presupuesto + '€ le queda ' + total + ' €',\r\n \r\n start: {\r\n dateTime: inicio.toISOString()\r\n },\r\n end: {\r\n dateTime: fin.toISOString()\r\n },\r\n attendees: [{email: correo}],\r\n colorId: 10 \r\n };\r\n \r\n evento = Calendar.Events.insert(evento, calendario);\r\n Logger.log('Alerta Creada en Calendario ID: ' + evento.getId());\r\n\r\n}", "function createEvent(event) {\n var options = {};\n options.data = {};\n var time = event.start.format('YYYY-MM-DD h:mm:ss a');\n options.data.startTime = time;\n //var time1=event.end.format('h:mm:ss a')\n var time1 = event.end.format('YYYY-MM-DD h:mm:ss a')\n options.data.endTime = time1;\n var time2 = event.start.format('YYYY-MM-DD h:mm:ss a');\n options.data.startDate = time2;\n var time3 = event.end.format('YYYY-MM-DD h:mm:ss a')\n options.data.endDate = time3;\n options.data.idBlock = event.parentBlock;\n options.data.inTransmission = false;\n options.data.type_id = event.idRef;\n options.data.type_publication = event.type;\n options.method = 'POST';\n options.url = Routing.generate('publication_create');\n options.errorcallback = function (error) {\n console.log(error);\n }\n options.successcallback = function (data) {\n if (event.publicationId != '')\n return true;\n else {\n var id = JSON.parse(data);\n event.publicationId = id;\n }\n };\n ajaxAccess(options);\n}", "function doCreateCalendar() {\n let cal_name = document.getElementById(\"calendar-name\").value;\n let cal_color = document.getElementById('calendar-color').color;\n\n gCalendar.name = cal_name;\n gCalendar.setProperty('color', cal_color);\n\n if (!document.getElementById(\"fire-alarms\").checked) {\n gCalendar.setProperty('suppressAlarms', true);\n }\n\n cal.getCalendarManager().registerCalendar(gCalendar);\n return true;\n}", "function massReminder(){\n var query = $( \"#reminderQuery\" ).val();\n if( $( \"input:radio[name=reminder]:checked\" ).val() == 'big')\n var reminder = bigReminder;\n else if( $( \"input:radio[name=reminder]:checked\" ).val() == 'little')\n var reminder = littleReminder;\n else\n var reminder = removeReminder;\n var total = 0;\n \n\tgapi.client.load('calendar', 'v3', function() { \n var queryRequest = gapi.client.calendar.events.list({\n\t \t 'calendarId': 'primary',\n 'q': query //set the query string variable\n });\n\tqueryRequest.execute(function(queryResp) {\n\t if (queryResp.items){\n\t\t for (var i = 0; i < queryResp.items.length; i++) {\n\t\t \t//set event variables and list matching events\n var id = queryResp.items[i].id;\n //double check returned values to be sure they contain query string in a\n //case sensitive way.\n if(queryResp.items[i].summary.toLowerCase().search(query.toLowerCase()) !== -1 )\n {\n addReminder( id, reminder );\n total += 1;\n }\n }\n \n $('#reminderResults').empty().append(\"Added <span><font color='#007dc5'>\"+$( \"input:radio[name=reminder]:checked\" ).val()+\"</font></span> reminder to <span><font color='#007dc5'>\" + total+\"</font></span> events matching <span><font color='#007dc5'>\" + query + \".</font></span>\");\n\t }\n\t else{\n\t\t\talert(\"No matching events!\");\n\t }\n });\n\t });\n}", "static setRepeat(reminder,repeatString)\n\t{\n\t\treminder.repeatText = repeatString;\n\t\treminder.week = \"\";\n\t\tlet frequency;\n\t\tlet isFirst = false;\n\t\tlet arr;\n\t\tif(repeatString == \"Never\") \n\t\t{\n\n\t\t\treminder.date = getDateString(new Date(reminder.startTimeMilliseconds));\n\t\t\tconsole.log(reminder.date);\n\t\t\treminder.repeatType = 'n';\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tarr = repeatString.split(\" \");\n\n\t\treminder.frequency = arr[1];\n\t\treminder.repeatType = arr[2][0];\n\n\t\tfor(var i = 4; i < arr.length; i++) \n\t\t{\n\t\t\tif(arr[i] == \"For\" || arr[i] == \"Until\") break;\n\t\t\tif(isFirst == false) \n\t\t\t{\n\t\t\t\tisFirst = true;\n\t\t\t\treminder.week += weekToNumber[arr[i]];\n\t\t\t}\n\t\t\telse reminder.week += \",\" + weekToNumber[arr[i]];\n\t\t}\n\t\tif(reminder.repeatType == 'w' && arr.length >= 4)\n\t\t{\t\n\n\t\t\tlet date = new Date(reminder.startTimeMilliseconds);\n\n\t\t\t/* offset of date */\n\t\t\treminder.startTimeMilliseconds += ( parseInt(reminder.week[0]) - date.getDay() ) * 1000 * 60 * 60 * 24;\n\t\t\treminder.endTimeMilliseconds += ( parseInt(reminder.week[0]) - date.getDay() ) * 1000 * 60 * 60 * 24;\n\t\t} \n\t\treminder.date = getDateString(new Date(reminder.startTimeMilliseconds))\n\t}", "function addEvent(name,onlyAdults,price,dateOfEvent) {\n\n//check if event organizer is open \nif(organizerEventsOpen) console.log(\"Event organizer is currently closed for events.\");\n\n//if its open, do the following\nelse{\n //if name isn't given, terminate operation\n if(name==undefined) {\n console.log(\"Invalid operation. (Name of the event is required)\"); \n return;}\n else {\n //set price to 0(free) if no price was given\n if (price==undefined) price=0;\n var newEvent = new Event(getId(),name,onlyAdults,price,[],dateOfEvent);\n pushEvent(newEvent); }\n }\n}", "function getSingleEvent() {\n return {\n type: \"FETCH_SINGLE_EVENT\"\n };\n}", "get recurrence() {\n return 'No Recurrence';\n }", "get recurrence() {\n return 'No Recurrence';\n }", "function updateCalendar(request){\n var event = calendar.createEvent(\n request.name,\n request.date,\n request.endTime\n )\n}", "function addRruleInterval(date, frequency, interval)\r\n{\r\n // log(\"addRruleInterval: date: \" + date + \"; frequency: \" + frequency + \"; interval: \" + interval);\r\n\r\n // The first thing we need to do is make sure that our 'date' corresponds\r\n // to the first instance of our repetion spec. If the RRULE specifies that\r\n // the event event repeats WEEKLY on TUesdays then we need to start on the\r\n // next TUesday (if we are already on TUesday we don't need to adjust, \r\n // either the event's first instance was on a TUesday or we've already\r\n // made the adjustment in an earlier call to this function).\r\n\r\n if (frequency == 'YEARLY')\r\n {\r\n return addYears(date, Number(interval));\r\n }\r\n else if (frequency == 'MONTHLY')\r\n {\r\n return addMonths(date, Number(interval));\r\n }\r\n else if (frequency == 'WEEKLY')\r\n {\r\n return addWeeks(date, Number(interval));\r\n }\r\n else if (frequency == 'DAILY')\r\n {\r\n return addDays(date, Number(interval));\r\n }\r\n else\r\n {\r\n// log(\"addRruleInterval: unexpected frequency '\" + frequency + \"'\");\r\n return addDays(date, 1); // benign value\r\n }\r\n}", "function Appointment(subject, location, startDate, endDate, reminderMinutes, notes, hasAlerted) {\n \n this.subject = subject; //subject: \"\", // e.g. math class\n this.location = location; //location: 0, // e.g. window.LocEnum.SCIENCE_CENTER\n this.startDate = startDate; //startDate: new Date(), // by default initializes with current date and time\n this.endDate = endDate; //endDate: new Date(),\n this.reminderMinutes = reminderMinutes; //reminderMinutes: 0, // int, minutes before event to alert; e.g. 15; put in a check for catching negative numbers?\n this.notes = notes; // e.g. 'Assignment due this period' or 'Test Today'\n \n this.isActive = false; // will be true for one cycle, and then be deactivated again - is a trigger \n this.hasAlerted = hasAlerted;\n this.hasReminded = false;\n \n this.update = function() {\n \n // for some reason had to add 'this' in front of everything - otherwise vars not initialized or something \n \n // debug \n // console.log(this.subject + \" is updating\"); \n \n this.isActive = false; // kill trigger\n \n // check to see if reminder has fired\n if (!this.hasReminded) {\n var reminderMillsecs = reminderMinutes * 60000; // convert minutes to milliseconds\n var currentTime = new Date().getTime(); \n \n var startTime = this.startDate.getTime(); \n \n if (currentTime >= (startTime - reminderMillsecs)) { // compare dates with milliseconds\n if (!this.hasReminded) {\n this.isActive = true; \n this.hasReminded = true; \n console.log(\"reminder for \"+this.subject); \n }\n }\n }\n \n // check to see if event has fired - could happen at same time as reminder\n if (!this.hasAlerted) { // not using else-if b/c reminderMinutes could be zero\n var currentTime = new Date().getTime(); \n \n if (currentTime >= this.startDate.getTime()) { // compare dates with milliseconds\n if (!this.hasAlerted) {\n this.isActive = true; \n this.hasAlerted = true; \n console.log(this.subject+\" happening now\"); \n }\n }\n }\n \n }\n\n}", "function dailyTrigger() {\n postEventsToDiscord({\n calendars: calendar_list,\n webhooks: discord_webhooks,\n title: \"My calendar shit\",\n public_url: \"URL to public calendar (or any URL when you click the title)\"\n });\n}", "function CalendarEvent(name,date,date1,schedule) {\n this.name = name;\n this.isShowing = true;\n this.schedule = schedule;\n this.year = date.getFullYear();\n this.month = date.getMonth();\n this.day = date.getDate();\n this.hour = date.getHours();\n this.minute = date.getMinutes();\n this.endYear = date1.getFullYear();\n this.endMonth = date1.getMonth();\n this.endDay = date1.getDate();\n this.endHour = date1.getHours();\n this.endMinute = date1.getMinutes();\n if (date == date1) {\n this.oneDay = true;\n } else {\n this.oneDay = false;\n }\n this.repeat = null;\n this.alert = null;\n this.travelTime = null;\n this.invitees = null;\n this.location = null;\n this.notes = null;\n this.url = null;\n this.attachmentFile = null;\n this.lists = null;\n this.weekDay = cal_days_labels[date.getDay()].toLowerCase();\n var timeStamp = new Date(this.year,this.month,this.day,this.hour,this.minute,0,1000);\n this.timeString = getTime(timeStamp);\n this.selectorID = '#'+this.day+'-'+this.month+'-'+this.year;\n this.selectorID2 = '#'+this.endDay+'-'+this.endMonth+'-'+this.endYear;\n this.repeatSelectorID = [];\n this.customRepeat = null;\n this.html = '';\n var calSchedule = getSchedule(this.schedule);\n calSchedule.calEvents.push(this);\n writeJSONData();\n }", "function convertCalEvent(calEvent) {\n convertedEvent = {\n 'id': calEvent.getId(),\n 'title': calEvent.getTitle(),\n 'description': calEvent.getDescription(),\n 'location': calEvent.getLocation(),\n 'recurring': calEvent.isRecurringEvent(),\n 'creators': calEvent.getOriginalCalendarId(), //getCreators(),\n 'status': calEvent.getMyStatus(),\n //'guests': calEvent.getGuestList().map(function(x) {return x.getEmail();}).filter(function(x) {return x.indexOf('resource.calendar.google.com')===-1;}).join(','),\n 'color': calEvent.getColor()\n };\n \n let guestsDetails = calEvent.getGuestList().map(function(x) {return x.getEmail();}).filter(function(x) {return x.indexOf('resource.calendar.google.com')===-1;});\n convertedEvent.guests = guestsDetails.length;\n convertedEvent.guestsDetails = guestsDetails.join(',');\n convertedEvent.type = getMeetingType(convertedEvent.creators, convertedEvent.guestsDetails);\n \n if(convertedEvent.creators.startsWith(\"geotabinc.com_\")) {convertedEvent.creators = calEvent.getCreators()}\n \n if (calEvent.isAllDayEvent()) {\n convertedEvent.starttime = calEvent.getAllDayStartDate();\n let endtime = calEvent.getAllDayEndDate();\n if (endtime - convertedEvent.starttime === 24 * 3600 * 1000) {\n convertedEvent.endtime = '';\n } else {\n convertedEvent.endtime = endtime;\n if (endtime.getHours() === 0 && endtime.getMinutes() == 0) {\n convertedEvent.endtime.setSeconds(endtime.getSeconds() - 1);\n }\n }\n } else {\n convertedEvent.starttime = calEvent.getStartTime();\n convertedEvent.endtime = calEvent.getEndTime();\n if(convertedEvent.status != 'NO') {\n convertedEvent.duration = calculateDurationHours(convertedEvent.starttime.getTime(), convertedEvent.endtime.getTime());\n }\n }\n return convertedEvent;\n}", "has(e) {\n return !!this.events[e];\n }", "forecastEvent () {\n // Eeeesh :/\n }", "function schedule(event) {\n let targetElementId = event.target.id;\n let targetElement = document.getElementById(targetElementId);\n let parentElement = targetElement.parentElement;\n let newElement = targetElement.cloneNode(true);\n newElement.classList.toggle('button-schedule-active');\n if (targetElement.innerHTML === 'schedule') {\n newElement.innerText = 'scheduled';\n } else {\n newElement.innerText = 'schedule';\n }\n newElement.addEventListener('click', schedule);\n parentElement.removeChild(targetElement);\n parentElement.appendChild(newElement);\n}", "function createEvent() {\n var calendarId = 'primary';\n var start = getRelativeDate(1, 12);\n var end = getRelativeDate(1, 13);\n var event = {\n summary: 'Lunch Meeting',\n location: 'The Deli',\n description: 'To discuss our plans for the presentation next week.',\n start: {\n dateTime: start.toISOString()\n },\n end: {\n dateTime: end.toISOString()\n },\n attendees: [\n {email: 'alice@example.com'},\n {email: 'bob@example.com'}\n ],\n // Red background. Use Calendar.Colors.get() for the full list.\n colorId: 11\n };\n event = Calendar.Events.insert(event, calendarId);\n Logger.log('Event ID: ' + event.id);\n}", "function checkForm(checkrecur) {\n\n var errMsg;\n errMsg = '';\n\n if ($('#calendarID_dummy', iPage).val() == \"\") {\n errMsg = errMsg + '<p><strong>Event Type:</strong> Please choose an event type.</p>';\n $('#calendarLI').removeClass('ui-btn-up-c').addClass('ui-body-e'); // shades the errors\n }\n\n if ($('#eventType_dummy', iPage).val() == \"\") {\n errMsg = errMsg + '<p><strong>Event Type:</strong> Please choose an event type.</p>';\n $('#eventTypeLI').removeClass('ui-btn-up-c').addClass('ui-body-e');\n }\n\n if ($('#name', iPage).val() == \"\") {\n errMsg = errMsg + '<p><strong>Name:</strong> Please enter the event name.</p>';\n $('#nameLI').removeClass('ui-btn-up-c').addClass('ui-body-e');\n }\n\n if (checkrecur == true) {\n if ($('#recurEvent', iPage).val() == 'on') {\n if ($('#repeatType_dummy', iPage).val() == \"\") {\n //errMsg = \"Repeat Interval not set\";\n errMsg = errMsg + '<p><strong>Interval:</strong> Please choose a repeat interval type.</p>';\n $('#repeatLI').removeClass('ui-btn-up-c').addClass('ui-body-e');\n }\n\n if ($('#repeatEveryType', iPage).val() == \"\") {\n //errMsg = errMsg + \" Repeat Every value not set\";\n errMsg = errMsg + '<p><strong>Repeat Every:</strong> Please choose an interval length.</p>';\n $('#repeatEveryLI').removeClass('ui-btn-up-c').addClass('ui-body-e');\n }\n\n if ($('#occurrenceSType', iPage).val() == \"\") {\n //errMsg = errMsg + \" Repeat Occurrences not set\";\n errMsg = errMsg + '<p><strong>Occurrences:</strong> Please choose how many intervals.</p>';\n $('#occurrencesLI').removeClass('ui-btn-up-c').addClass('ui-body-e');\n }\n if ($('#repeatType', iPage).val() == \"Days\") {\n if (parseInt($('#occurrenceSType', iPage).val()) > 31) {\n //errMsg = errMsg + \" Repeat Occurrences not set\";\n errMsg = errMsg + '<p><strong>Occurrences:</strong> You may not schedule more than 31 Day events at one time.</p>';\n $('#occurrencesLI').removeClass('ui-btn-up-c').addClass('ui-body-e');\n }\n }\n if ($('#repeatType', iPage).val() == \"Weeks\") {\n if (parseInt($('#occurrenceSType', iPage).val()) > 52) {\n //errMsg = errMsg + \" Repeat Occurrences not set\";\n errMsg = errMsg + '<p><strong>Occurrences:</strong> You may not schedule more than 52 Week events at one time.</p>';\n $('#occurrencesLI').removeClass('ui-btn-up-c').addClass('ui-body-e');\n }\n }\n if ($('#repeatType', iPage).val().indexOf(\"Month\") != -1) {\n if (parseInt($('#occurrenceSType', iPage).val()) > 12) {\n //errMsg = errMsg + \" Repeat Occurrences not set\";\n errMsg = errMsg + '<p><strong>Occurrences:</strong> You may not schedule more than 12 Month events at one time.</p>';\n $('#occurrencesLI').removeClass('ui-btn-up-c').addClass('ui-body-e');\n }\n }\n\n }\n\n if ($('#recurEvent', iPage).val() == 'on') {\n //\n if (errMsg == \"\") {\n createRepeatDatesFromForm();\n //if($('#endDate').val() > 1st form date #endDate\n if (dateDiff($('#endDate').val(), stDate[1]) > 0) {\n errMsg = '<p><strong>Overlapping Events:</strong> You may not schedule events that overlap</p>';\n }\n }\n }\n }\n\n if (errMsg != \"\") {\n $.mobile.loading('hide');\n\n showErrorPopup(errMsg);\n return false;\n }\n\n // Make sure that the recur interval is less than the event length\n // how. If the nrxt event date is efore the end date of thepage disallow\n\n if (checkrecur == true) {\n if ($('#recurEvent', iPage).val() == 'on') {\n\n //how about a confirm\n var tres = confirm('Are you sure you want ' + $('#occurrenceSType', iPage).val() + ' occurences of this event?? Press OK to continue and Cancel to quit');\n if (tres == false) {\n $.mobile.loading('hide');\n return false;\n }\n }\n }\n return true;\n}", "function checkConflict(eventTimeObj, currentEventObj) {\n var currentEventStart = currentEventObj.start\n var currentEventEnd = currentEventObj.end\n var eventStartTime = eventTimeObj.start\n var eventEndTime = eventTimeObj.end\n if (currentEventStart > eventStartTime) {\n if (currentEventStart > eventEndTime) {\n //schedule event normally\n return false\n }\n else {\n //find 10 free times\n return true\n }\n }\n if (currentEventStart < eventStartTime) {\n if (currentEventEnd < eventStartTime) {\n return false\n }\n else {\n return true\n }\n }\n}", "handleScheduleEvent(event) {\n const me = this,\n eventElement = DomHelper.up(event.target, me.eventSelector),\n cellElement = !eventElement && DomHelper.up(event.target, '.' + me.timeCellCls),\n eventName = eventNameMap[event.type] || StringHelper.capitalize(event.type);\n\n if (cellElement) {\n const clickedDate = me.getDateFromDomEvent(event, 'floor'),\n cellData = DomDataStore.get(cellElement),\n index = cellData.row.dataIndex,\n tickIndex = me.timeAxis.getTickFromDate(clickedDate),\n tick = me.timeAxis.getAt(Math.floor(tickIndex));\n\n if (tick) {\n me.trigger('schedule' + eventName, Object.assign({\n date: clickedDate,\n tickStartDate: tick.startDate,\n tickEndDate: tick.endDate,\n row: cellData.row,\n index,\n event\n }, me.getScheduleMouseEventParams(cellData, event)));\n }\n }\n }", "function setup() {\n ScriptApp.newTrigger(\"addAllowance\").timeBased().onWeekDay(ScriptApp.WeekDay.SATURDAY).create();\n ScriptApp.newTrigger(\"exportEvents\").timeBased().onWeekDay(ScriptApp.WeekDay.FRIDAY).create();\n ScriptApp.newTrigger(\"addEvent\").forSpreadsheet(eventsId).onFormSubmit().create();\n}", "addToEvents(events, folder, filterStartDate, filterEndDate) {\n const adapter = this;\n const event = folder.ApplicationData[0];\n if (!event.StartTime) {\n console.error(`Detected malformed event: ${JSON.stringify(Object.keys(event))}, dropping it on the floor`);\n return;\n }\n const startTime = moment(event.StartTime[0]);\n const endTime = moment(event.EndTime[0]);\n const exceptions = _.get(event, 'Exceptions[0]');\n const exceptionEvents = adapter.getExceptionEvents(event, exceptions, filterStartDate, filterEndDate);\n if (exceptionEvents.length) {\n events.push(...exceptionEvents);\n }\n const recurrenceObj = _.get(event, 'Recurrence[0]');\n if (recurrenceObj) {\n const recurrence = adapter.getRecurrence(startTime, filterEndDate, recurrenceObj);\n if (recurrence) {\n const UID = event.UID[0];\n for (const date = moment(filterStartDate); date.isSameOrBefore(filterEndDate); date.add(1, 'days')) {\n if (recurrence.matches(date)) {\n startTime.year(date.year());\n startTime.month(date.month());\n startTime.date(date.date());\n endTime.year(date.year());\n endTime.month(date.month());\n endTime.date(date.date());\n const instanceEvent = _.clone(event);\n // Set the iCalUId to the event id\n instanceEvent.iCalUId = UID;\n instanceEvent.UID = [UID + `-${date.year()}${date.month()}${date.date()}`];\n instanceEvent.StartTime = [startTime.utc().format().replace(/[-:]/g, '')];\n instanceEvent.EndTime = [endTime.utc().format().replace(/[-:]/g, '')];\n if (!adapter.isDeleted(exceptions, instanceEvent) && !adapter.eventExists(events, instanceEvent)) {\n events.push(instanceEvent);\n }\n }\n }\n }\n }\n else if (!adapter.isDeleted(exceptions, event) && !adapter.eventExists(events, event)) {\n events.push(event);\n }\n }", "deleteEvent() {\n const confirmation = confirm(this.props.intl.formatMessage(this.intlMessages.confirmDeleteEvent))\n const { selectedEvent, events } = this.state\n\n if (confirmation) {\n let allOtherEvents\n\n if (selectedEvent.isRecurringEvent) {\n allOtherEvents = events.filter((event) => \n event.id !== selectedEvent.id &&\n event.originalEventId !== selectedEvent.id &&\n event.id !== selectedEvent.originalEventId\n )\n } else {\n allOtherEvents = events.filter((event) => event.id !== selectedEvent.id)\n }\n\n this.setState({\n events: [...allOtherEvents],\n selectedEvent: {\n price: 0,\n isAvailable: true,\n isRecurringEvent: false\n },\n showSellerActionBtns: false\n })\n\n setTimeout(() => {\n this.renderRecurringEvents(this.state.calendarDate)\n })\n }\n }", "function replicate(event, duration, theDate, name) {\n var rEvent = event;\n var rCal = CalendarApp.getCalendarsByName(sCal)[0];\n var rTitle = name + ' - ' + rEvent.getTitle();\n var allDay = rEvent.isAllDayEvent();\n if (allDay === true) {\n // If it's all-day event, check whether it's more than one day\n if (duration > 1) {\n // If more than one day, requires a hacky creation method (see createMultiDayEvent)\n var start = rEvent.getAllDayStartDate();\n var end = start.addDays(duration);\n end = new Date(end - 1);\n var startGap = new Date(theDate) - new Date(start);\n \n // Don't create another multi-day event if the event started on a previous day\n if (startGap > 0) {\n } else {\n createMultiDayEvent(rCal, rTitle, start, end);\n }\n } else {\n var newEvent = rCal.createAllDayEvent(rTitle, rEvent.getAllDayStartDate());\n }\n } else {\n var newEvent = rCal.createEvent(rTitle, rEvent.getStartTime(), rEvent.getEndTime());\n }\n}", "function schedule(event) {\n // local constants\n const scheduleText = 'schedule';\n const scheduledText = 'scheduled';\n\n const targetElementId = event.target.id;\n const targetElement = document.getElementById(targetElementId);\n const parentElement = targetElement.parentElement;\n const newElement = targetElement.cloneNode(true);\n newElement.classList.toggle('button-schedule-active');\n if (targetElement.innerHTML === scheduleText) {\n newElement.innerText = scheduledText;\n } else {\n newElement.innerText = scheduleText;\n }\n newElement.addEventListener('click', schedule);\n parentElement.removeChild(targetElement);\n parentElement.appendChild(newElement);\n }", "renderEvent(data) {\n const me = this,\n eventIdProperty = me.view.scheduledEventName + 'Id',\n eventId = data[eventIdProperty],\n layoutCache = me.cache.getTimeSpan(eventId, data.resourceId),\n renderedEvents = me.cache.getRenderedEvents(data.resourceId),\n meta = data.event.instanceMeta(me.scheduler),\n // Event might be flagged to require a new element in onEventAdd, but if it is a drag proxy it should still\n // reuse an existing element (it will be correctly linked to the drag proxy element)\n wrapperElement = me.renderTimeSpan(\n data,\n layoutCache,\n renderedEvents[data.id],\n meta.requireElement && !meta.fromDragProxy\n );\n\n if (data.assignment) {\n wrapperElement.dataset.assignmentId = data.assignment.id;\n }\n\n // Add event/task id to wrappers dataset\n // Otherwise event element won't have event id property in it's dataset and scheduler\n // won't be able to resolve event by element reference (#8943)\n if (eventId) {\n wrapperElement.dataset[eventIdProperty] = eventId;\n }\n\n renderedEvents[data.id] = data;\n\n if (meta.requireElement) {\n delete meta.requireElement;\n delete meta.fromDragProxy;\n }\n\n // This event is documented on Scheduler\n me.scheduler.trigger('renderEvent', {\n eventRecord: data.event,\n resourceRecord: data.resource,\n assignmentRecord: data.assignment,\n element: wrapperElement,\n tplData: data\n });\n }", "function eventChecker() {\n if(isSubscribed)\n pubsubEvents();\n}", "handleReRunEvent() {\n console.log(' in handleReRunEvent method');\n }", "function hideRecurring() {\n if (document.getElementById('hide-recurring').checked) {\n $('.fc-content').each(function() {\n var recurringCount = $(this).find('.recurring').length;\n if (recurringCount && recurringCount == $(this).find('.fc-calendar-event').length) {\n $(this).addClass('fc-content-hidden');\n }\n $(this).find('.recurring-block').addClass('hidden-xs-up');\n });\n\n } else {\n $('.fc-content-hidden').removeClass('fc-content-hidden');\n $('.recurring-block').removeClass('hidden-xs-up');\n }\n}", "function checkExists(){\n var query = $( \"#query\" ).val();\n console.log(query);\n $('#content').empty();\n\tgapi.client.load('calendar', 'v3', function() { \n var request = gapi.client.calendar.events.list({\n\t \t 'calendarId': 'primary',\n 'q': query //set the query string variable\n });\n\trequest.execute(function(resp) {\n\t\tconsole.log(resp);\n\t if (resp.items){\n\t\t for (var i = 0; i < resp.items.length; i++) {\n\t\t \t//set event variables and list matching events\n console.log(resp.items[i].summary + \" \" +query);\n //double check returned values to be sure they contain query string in a\n //case sensitive way.\n if(resp.items[i].summary.toLowerCase().search(query.toLowerCase()) !== -1 )\n {\n var event = document.createElement('div');\n event.id = \"calEvent\";\n var id = document.createElement('ul');\n var ul = document.createElement('ul');\n id.appendChild(document.createTextNode(\"Id: \" + resp.items[i].id));\n //ul.appendChild(document.createTextNode(\"Reminders: \" + resp.items[i].reminders.overrides[].method));\n event.appendChild(document.createTextNode(resp.items[i].summary));\n event.appendChild(id);\n event.appendChild(ul);\n document.getElementById('content').appendChild(event);\n }\n }\n\t }\n\t else{\n\t\t\talert(\"No matching events!\");\n\t }\n });\n\t });\n}", "handleNewAbsenceCreated(message) {\n message ? this.init_calendar() : null\n }", "function vEvent() {\n this.id;\n this.calendarType = '';\n this.calendarIndex = 0;\n this.properties = new PropertyMap();\n this.regular;\n this.alarm = null;\n}", "function isEvent() {\n trigger = 1;\n if (label === eventLabel) {\n eventTrigger = true;\n return true;\n } else {\n eventTrigger = false;\n return false;\n }\n}", "fireEventWithRule() {\n\n var ruleDetails = {\n \"ruleLabel\" : this.ruleLabel,\n \"ruleName\" : this.ruleName,\n \"ruleDescription\" : this.ruleDescription,\n \"ruleActive\" : this.ruleActive,\n \"sharedObjectApiName\" : this.sharedObjectApiName,\n \"sharedObject\" : this.sharedObject,\n \"ruleType\" : this.ruleType,\n \"relatedObjectSelected\" : this.relatedObjectSelected,\n \"shareField\" : this.shareField,\n \"shareWith\" : this.shareWith,\n \"shareFieldType\" : this.shareFieldType,\n \"accessLevel\" : this.accessLevel,\n \"contactAccess\" : this.contactAccess,\n \"caseAccess\" : this.caseAccess,\n \"opportunityAccess\" : this.opportunityAccess,\n \"sharingReason\" : this.sharingReason\n }\n\n const evt = new CustomEvent('ruledetail', { detail: ruleDetails });\n this.dispatchEvent(evt);\n }", "triggerEvent(event) {\n\t\treturn _makeRequest('/events', {method: 'POST', body: {event}})\n\t\t\t.then(responseData => {\n\t\t\t\tif(responseData.success){\n\t\t\t\t\tconsole.log('Event Sent', event);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch(error => {\n\t\t\t\tconsole.error(error);\n\t\t\t});\n\t}", "function calendar_helper_setTitleAndBackground(cal_event){\n if (cal_event!=null){\n if (cal_event.is_valid)\n directions_api_addTravelTimeToTitle(cal_event);\n else\n calendar_helper_updateCalEventTitleAndBackground(cal_event, openingHoursToString(cal_event.available_destination_id, cal_event.start)); \n }\n}", "function violentNightEvent(id) {\n\n}", "function re_delete(singleInstance){\n\t//self.location = \"http://www.keepandshare.com/calendar/action.php?ac=111345&id=\" + re_prefs.repeatid + \"&del=y\" +\n\t//\t\t\t\t\t\t\t\t'&app='+document.getElementById('app').value + '&fd=' + re_prefs.firstDay + '&to=' + re_prefs.returnTo;\n\tre_setPanelVisibility('hide');\n\n\tif( re_editing == \"n\") // did user click on \"delete\" when creating a new repeating event?\n\t\treturn true;\t\n\n\tdocument.getElementById('h_repeatid').value = re_prefs.repeatid;\n\tdocument.getElementById('h_app').value = document.getElementById('app').value;\n\tdocument.getElementById('h_firstDay').value = re_prefs.firstDay;\n\tdocument.getElementById('h_returnTo').value = re_prefs.returnTo;\n\tdocument.getElementById('h_action').value = \"del\";\n\tif (singleInstance) {\n\t\tdocument.getElementById('h_occurrence_date').value = re_prefs.occurrence_date;\n\t}\n\t//return false;\n document.form1.what_button_was_pressed.value = \"Repeating\";\n document.form1.submit();\n\treturn true;\n}", "function reschedule(key) {\n var index, time, date, task = document.getElementById(\"ongoing\").children[key];\n \n for (var i = 0; i < pings.length; i += 1) {\n index = key + \" \" + pings[i];\n time = new Date(task.children[2].firstChild.value + \"T\" + task.children[3].firstChild.value + \"Z\").getTime() - (pings[i] - today.getTimezoneOffset()) * 60 * 1000;\n \n if (time > today.getTime()) {\n chrome.alarms.create(index, {when: time});\n } else {\n chrome.alarms.clear(index);\n }\n }\n}" ]
[ "0.6250065", "0.6193538", "0.61593086", "0.61259276", "0.5959278", "0.5946913", "0.5869192", "0.58194005", "0.5787982", "0.57395273", "0.5701669", "0.56963146", "0.5679349", "0.5674768", "0.56331956", "0.5631717", "0.5628544", "0.55883616", "0.5558141", "0.55292577", "0.55247706", "0.55056125", "0.5495444", "0.5494707", "0.5444763", "0.5443782", "0.5423147", "0.54066753", "0.5397657", "0.53867215", "0.538569", "0.53548723", "0.53537583", "0.5346354", "0.534624", "0.52855575", "0.52666724", "0.5236458", "0.5234146", "0.52310216", "0.5213902", "0.5174792", "0.5173689", "0.5162333", "0.51548976", "0.51448715", "0.5108193", "0.5102769", "0.51002413", "0.50914276", "0.5083656", "0.50826377", "0.50824726", "0.5081388", "0.5052788", "0.50515276", "0.5044003", "0.50339866", "0.50326157", "0.5029115", "0.502255", "0.5012111", "0.5011016", "0.5005511", "0.5000182", "0.50000143", "0.50000143", "0.49990985", "0.49957237", "0.4993867", "0.49938414", "0.49920863", "0.4991581", "0.4981974", "0.49616686", "0.49601683", "0.49570155", "0.49487868", "0.49483088", "0.4945545", "0.4935214", "0.49255896", "0.49236378", "0.49096686", "0.48830336", "0.48756555", "0.48742306", "0.4869629", "0.48695225", "0.4859644", "0.48563376", "0.4853341", "0.48398975", "0.48354253", "0.48345655", "0.48328048", "0.48251924", "0.48128214", "0.48071373" ]
0.53987664
29
Merges an array of objects into a single object. The second argument allows for an array of property names who's object values will be merged together.
function mergeProps(propObjs, complexProps) { var dest = {}; var i; var name; var complexObjs; var j; var val; var props; if (complexProps) { for (i = 0; i < complexProps.length; i++) { name = complexProps[i]; complexObjs = []; // collect the trailing object values, stopping when a non-object is discovered for (j = propObjs.length - 1; j >= 0; j--) { val = propObjs[j][name]; if (typeof val === 'object' && val) { // non-null object complexObjs.unshift(val); } else if (val !== undefined) { dest[name] = val; // if there were no objects, this value will be used break; } } // if the trailing values were objects, use the merged value if (complexObjs.length) { dest[name] = mergeProps(complexObjs); } } } // copy values into the destination, going from last to first for (i = propObjs.length - 1; i >= 0; i--) { props = propObjs[i]; for (name in props) { if (!(name in dest)) { // if already assigned by previous props or complex props, don't reassign dest[name] = props[name]; } } } return dest; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mergeObjects(args) {\n for (var i = 0; i < args.length; i++) {\n if (Object.prototype.toString.call(args[i]) !== '[object Object]') {\n throw new Error('Will only take objects as inputs');\n }\n }\n var result = {};\n for (var i = 0; i < args.length; i++) {\n for (var key in args[i]) {\n if (args[i].hasOwnProperty(key)) {\n result[key] = args[i][key];\n }\n }\n }\n return result;\n}", "function merge() {\n const result = {};\n\n for (const obj of arguments) {\n _.forOwn(obj, (value, key) => {\n if (typeof value !== 'undefined') {\n if (!result[key]) {\n result[key] = value;\n } else if (_.isPlainObject(value) && _.isPlainObject(result[key])) {\n result[key] = merge(result[key], value);\n } else if (Array.isArray(value) && Array.isArray(result[key])) {\n result[key] = value.concat(result[key]);\n } else {\n result[key] = value;\n }\n }\n });\n }\n\n return result;\n}", "function mergeObjects(/* objects */)\n{\n\tvar obj = {};\n\tfor (var i=0; arguments.length>i; i++)\n\t{\n\t\tvar o = arguments[i];\n\t\tif (o != null)\n\t\t{\n\t\t\tfor (var p in o)\n\t\t\t{\n\t\t\t\tobj[p] = o[p];\n\t\t\t}\n\t\t}\n\t}\n\treturn obj;\n}", "function merge(...objs) {\n let final = {};\n\n for (const obj of objs) {\n final = mergeRecursively(final, obj);\n }\n\n return final;\n}", "function merge (...params) {\n // check if all are objects\n let l = params.length\n for (l; l > 0; l--) {\n const item = params[l - 1]\n if (!isObject(item)) {\n console.error('trying to merge a non-object: ', item)\n return item\n }\n }\n return nanomerge(...params)\n // return deepAssign(...params)\n // return mergeOptions(...params)\n // settings for 'deepmerge'\n // const overwriteMerge = (destinationArray, sourceArray, options) => sourceArray\n // const options = {arrayMerge: overwriteMerge}\n // if (params.length > 2) {\n // return deepmerge.all([...params], options)\n // }\n // return deepmerge(...params, options)\n}", "function merge(obj1, obj2) { \n var returnObj = {};\n var args = [].slice.call(arguments, 0);\n var argLen = args.length;\n\n for(var i = 0; i < argLen; i++) {\n for (var key in args[i]) {\n returnObj[key] = args[i][key];\n }\n }\n\n return returnObj;\n\n}", "function merge() {\n\t\t/* Support cycles */\n\t\tvar seen = [];\n\t\tvar merged = [];\n\n\t\tfunction _merge() {\n\t\t\tvar objectsStart = 0;\n\t\t\tvar deep = false;\n\t\t\tif (typeof arguments[0] === \"boolean\") {\n\t\t\t\tdeep = arguments[0];\n\t\t\t\tobjectsStart++;\n\t\t\t}\n\t\t\tvar target = arguments[objectsStart];\n\t\t\tif (typeof target !== \"object\" && typeof target !== \"function\") {\n\t\t\t\tthrow exception(\"Target object argument to merge is not appropriate: \" + typeof target);\n\t\t\t}\n\t\t\tif (target === null) {\n\t\t\t\tthrow exception(\"Target object argument to merge is not appropriate: \" + target);\n\t\t\t}\n\t\t\tfor (var i = objectsStart + 1; i < arguments.length; i++) {\n\t\t\t\tvar source = arguments[i];\n\t\t\t\tif (source === undefined) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (typeof source !== \"object\" && typeof source !== \"function\") {\n\t\t\t\t\tthrow exception(\"Argument \" + (i+1) + \" to merge is not appropriate: \" + typeof source);\n\t\t\t\t}\n\n\t\t\t\tseen.push(source);\n\t\t\t\tmerged.push(target);\n\n\t\t\t\tfor (var name in source) {\n\t\t\t\t\t/* Do not merge any key \"$\" */\n\t\t\t\t\tif (name === \"$\") {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar value = source[name];\n\t\t\t\t\tif (value !== undefined) {\n\t\t\t\t\t\tif (deep && typeof value === \"object\" && value !== null) {\n\t\t\t\t\t\t\tvar found = arrayIndexOf(seen, value);\n\t\t\t\t\t\t\tif (found === -1) {\n\t\t\t\t\t\t\t\tvar deepTarget = target[name];\n\t\t\t\t\t\t\t\tif (deepTarget === undefined) {\n\t\t\t\t\t\t\t\t\tdeepTarget = isArray(value) ? [] : {};\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tvalue = _merge(true, deepTarget, value);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tvalue = merged[found];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttarget[name] = value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn target;\n\t\t}\n\n\t\treturn _merge.apply(this, arguments);\n\t}", "function merge( ) {\n var objects, merged, oI, object, key;\n\n //get an array of arguments\n objects = Array.prototype.slice.apply(arguments);\n\n //shift off the target object\n merged = objects.shift();\n\n //loop through the objects and merge each into the target\n for(oI = 0; oI < objects.length; oI += 1) {\n object = objects[oI];\n if(typeof object === 'undefined') { continue; }\n\n //validate\n if(typeof object !== 'object') { throw new Error('Cannot merge objects. All arguments must be objects.'); }\n\n for(key in object) {\n //the property must not be from a prototype\n if(!object.hasOwnProperty(key)) { continue; }\n\n //copy the property\n if(typeof object[key] === 'object' && typeof merged[key] === 'object') {\n merge(merged[key], object[key]);\n } else if(typeof object[key] === 'object') {\n merged[key] = clone(object[key]);\n } else if(typeof merged.push === 'function') {\n merged.push(object[key]);\n } else {\n merged[key] = object[key];\n }\n }\n }\n }", "function $merge(){\r\n var mix = {};\r\n for (var i = 0; i < arguments.length; i++) {\r\n for (var property in arguments[i]) {\r\n var ap = arguments[i][property];\r\n var mp = mix[property];\r\n if (mp && $type(ap) == 'object' && $type(mp) == 'object') \r\n mix[property] = $merge(mp, ap);\r\n else \r\n mix[property] = ap;\r\n }\r\n }\r\n return mix;\r\n }", "merge() {\n var args = Array.prototype.slice.call(arguments);\n var result = {};\n\n for (var arg of args) {\n if (!util.isObject(arg)) {\n continue;\n }\n\n for (var key of Object.keys(arg)) {\n // Merge objects, not arrays.\n if (util.isObject(result[key]) && !Array.isArray(result[key])) {\n if (util.isObject(arg[key]) && !Array.isArray(arg[key])) {\n result[key] = module.exports.merge(result[key], arg[key]);\n } else {\n result[key] = arg[key];\n }\n } else {\n result[key] = arg[key];\n }\n }\n }\n\n return result;\n }", "function bs_arrayMerge(obj1, obj2) {\n if (!bs_isObject(obj1) || !bs_isObject(obj2)) return false;\n for (var key in obj2) {obj1[key] = obj2[key];}\n return obj1;\n}", "function combine(obj1, obj2) {\n return {...obj1, ...obj2};\n}", "function merge(/* [deep=false], target, obj1, [objN] */) {\n var args = Array.prototype.slice.call(arguments),\n index = -1,\n deep = (args.length > 1) && (typeof args[0] === 'boolean') && args.shit(),\n target = args.length && args.shift() || {},\n argLength = args.length;\n\n if (deep) {\n while (++index < argLength) {\n for (var current, key, keys = isObject(args[index]) && Object.keys(args[index]) || [], i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n current = args[index][key];\n if (isObject(current)) {\n target[key] = merge(deep, {}, current);\n } else {\n target[key] = current;\n }\n }\n }\n } else {\n while (++index < argLength) {\n for (var current, key, keys = isObject(args[index]) && Object.keys(args[index]) || [], i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n current = args[index][key];\n target[key] = current;\n }\n }\n }\n\n\n return target;\n }", "function merge(target) {\n var source, length, i;\n var sources = Array.prototype.slice.call(arguments, 1);\n target = target || {};\n\n // Allow `n` params to be passed in to extend this object\n for (i = 0, length = sources.length; i < length; i++) {\n source = sources[i];\n for (var property in source) {\n if (source.hasOwnProperty(property)) {\n if (isPlainObject(source[property])) {\n target[property] = merge(target[property], source[property]);\n }\n else {\n target[property] = source[property];\n }\n }\n }\n }\n\n return target;\n }", "function merge() {\n var result = {};\n _.each(arguments, function(obj) {\n if (!obj)\n return;\n _.each(obj, function(val, key) {\n var oldValue = result[key];\n if (_.isObject(oldValue) && _.isObject(val)) {\n val = merge(oldValue, val);\n }\n result[key] = val;\n });\n });\n return result;\n}", "function mergeObject(obj1,obj2){\n return {\n ...obj1,...obj2\n }\n}", "function mergeObjects(obj1, obj2) {\n let newObj = { ...obj1, ...obj2 };\n return newObj;\n}", "function mergeObjects (params, addition) {\n for (var i in addition) if (i && addition.hasOwnProperty(i)) {\n params[i] = mergeParams(params[i], addition[i]);\n }\n return params;\n}", "function merge() {\n var obj, name, copy,\n target = arguments[0] || {},\n i = 1,\n length = arguments.length;\n\n for (; i < length; i++) {\n if ((obj = arguments[i]) != null) {\n for (name in obj) {\n copy = obj[name];\n\n if (target === copy) {\n continue;\n }\n else if (copy !== undefined) {\n target[name] = copy;\n }\n }\n }\n }\n\n return target;\n}", "function combineObjects({...obj1}, {...obj2}) {\n const newObj = {\n obj1,\n obj2\n }\n console.log(newObj);\n}", "function mergeObjects(obj1, obj2){\n var obj3 = {};\n for (var attrname in obj1) { obj3[attrname] = obj1[attrname]; }\n for (var attrname in obj2) { obj3[attrname] = obj2[attrname]; }\n return obj3;\n}", "function mergeObjects(a, b) {\n return Object.assign({}, a, b);\n}", "function objectMerge(obj1, obj2) {\r\n\tfor (var i in obj2) {\r\n\t\tobj1[i] = obj2[i];\r\n\t}\r\n\treturn obj1;\r\n}", "combine(...args) {\n return Object.assign({}, ...args);\n }", "function merge(item1, item2, item3) {\n var result = Object.create(null);\n var items = [item1, item2, item3];\n for (var i = 0; i < 3; i++) {\n var item = items[i];\n if (typeof item === 'object' && item) {\n for (var key in item) {\n result[key] = item[key];\n }\n }\n }\n return result;\n}", "function merge(){\n\t\tvar result = {};\n\t\tfor(var i=0; i<arguments.length; i++)\n\t\t\tfor(var key in arguments[i])\n\t\t\t\tif(arguments[i].hasOwnProperty(key))\n\t\t\t\t\tresult[key] = arguments[i][key];\n\t\treturn result;\n\t}", "function merge(obj1,obj2){\n var obj3 = {};\n for (var attrname in obj1) { obj3[attrname] = obj1[attrname]; }\n for (var attrname in obj2) { obj3[attrname] = obj2[attrname]; }\n return obj3;\n}", "function merge_objects(o1, o2)\n{\n\tvar ret = o1;\n\tvar keys2 = Object.keys(o2);\n\n\tkeys2.forEach(function (key) {\n\t\tif (_.isArray(o2[key]))\n\t\t{\n\t\t\tif (!ret[key])\n\t\t\t\tret[key] = o2[key];\n\t\t\telse if (_.isArray(ret[key]))\n\t\t\t\tret[key] = _.union(o2[key], ret[key]);\n\t\t\telse\n\t\t\t\tret[key] = _.union(o2[key], [ret[key]]);\n\t\t}\n\t\telse //override it\n\t\t{\n\t\t\tret[key] = o2[key];\n\t\t}\n\t});\n\n\treturn ret;\n}", "function extend( ) {\n var args, merged, aI, object, key;\n\n //grab the args\n args = Array.prototype.slice.call(arguments);\n\n //look for arrays\n merged = {};\n for(aI = 0; aI < args.length; aI += 1) {\n object = args[aI];\n if(typeof object === 'undefined') { continue; }\n\n //throw an error if an item is an invalid type\n if(typeof object !== 'object') { throw new Error('Cannot extend objects. All arguments must be objects.'); }\n\n //if we find an array then the merged object will be an array\n if(typeof object.push === 'function') {\n merged = [];\n break;\n }\n }\n\n //add the data to the merged object\n for(aI = 0; aI < args.length; aI += 1) {\n object = args[aI];\n\n if(typeof object !== 'object') { continue; }\n\n //loop through the object's properties\n for(key in object) {\n\n //the property must not be from a prototype\n if(!object.hasOwnProperty(key)) { continue; }\n\n //copy the property\n if(typeof object[key] === 'object' && typeof merged[key] === 'object') {\n merged[key] = extend(merged[key], object[key]);\n } else if(typeof object[key] === 'object') {\n merged[key] = clone(object[key]);\n } else if(typeof merged.push === 'function') {\n merged.push(object[key]);\n } else {\n merged[key] = object[key];\n }\n }\n }\n\n return merged;\n }", "combine(obj1, obj2)\n\t{\n\t\treturn _extend(_extend({}, obj1), obj2);\n\t}", "function mergeobj(obj1,obj2){\n var obj3 = {};\n for (attrname in obj1) {obj3[attrname] = obj1[attrname];}\n for (attrname in obj2) {obj3[attrname] = obj2[attrname];}\n return obj3;\n}", "function merge (obj) {\n for (var i = 1; i < arguments.length; i++) {\n var def = arguments[i]\n for (var n in def) {\n if (obj[n] === undefined) obj[n] = def[n]\n }\n }\n return obj\n }", "function merge (obj) {\n for (var i = 1; i < arguments.length; i++) {\n var def = arguments[i]\n for (var n in def) {\n if (obj[n] === undefined) obj[n] = def[n]\n }\n }\n return obj\n }", "function merge (obj) {\n for (var i = 1; i < arguments.length; i++) {\n var def = arguments[i]\n for (var n in def) {\n if (obj[n] === undefined) obj[n] = def[n]\n }\n }\n return obj\n }", "function merge (obj) {\n for (var i = 1; i < arguments.length; i++) {\n var def = arguments[i]\n for (var n in def) {\n if (obj[n] === undefined) obj[n] = def[n]\n }\n }\n return obj\n }", "function merge (obj) {\n for (var i = 1; i < arguments.length; i++) {\n var def = arguments[i]\n for (var n in def) {\n if (obj[n] === undefined) obj[n] = def[n]\n }\n }\n return obj\n }", "function merge (obj) {\n for (var i = 1; i < arguments.length; i++) {\n var def = arguments[i]\n for (var n in def) {\n if (obj[n] === undefined) obj[n] = def[n]\n }\n }\n return obj\n }", "function merge (obj) {\n for (var i = 1; i < arguments.length; i++) {\n var def = arguments[i]\n for (var n in def) {\n if (obj[n] === undefined) obj[n] = def[n]\n }\n }\n return obj\n }", "function merge (obj) {\n for (var i = 1; i < arguments.length; i++) {\n var def = arguments[i]\n for (var n in def) {\n if (obj[n] === undefined) obj[n] = def[n]\n }\n }\n return obj\n }", "function mergeArrays()\n{\n return Array.prototype.slice.call(arguments).reduce(function(p,arg){return p.concat(arg)},[]);\n}", "function merge(obj) {\n for (var i=1; i < arguments.length; i++) {\n var def = arguments[i]\n for (var n in def)\n if (obj[n] === undefined) obj[n] = def[n]\n }\n return obj\n }", "function merge(obj) {\n for (var i=1; i < arguments.length; i++) {\n var def = arguments[i]\n for (var n in def)\n if (obj[n] === undefined) obj[n] = def[n]\n }\n return obj\n }", "function merge(obj) {\n for (var i=1; i < arguments.length; i++) {\n var def = arguments[i]\n for (var n in def)\n if (obj[n] === undefined) obj[n] = def[n]\n }\n return obj\n }", "function merge(obj) {\n for (var i=1; i < arguments.length; i++) {\n var def = arguments[i]\n for (var n in def)\n if (obj[n] === undefined) obj[n] = def[n]\n }\n return obj\n }", "function merge(obj) {\n for (var i=1; i < arguments.length; i++) {\n var def = arguments[i]\n for (var n in def)\n if (obj[n] === undefined) obj[n] = def[n]\n }\n return obj\n }", "function merge(obj) {\n for (var i=1; i < arguments.length; i++) {\n var def = arguments[i]\n for (var n in def)\n if (obj[n] === undefined) obj[n] = def[n]\n }\n return obj\n }", "function merge(obj) {\n for (var i=1; i < arguments.length; i++) {\n var def = arguments[i]\n for (var n in def)\n if (obj[n] === undefined) obj[n] = def[n]\n }\n return obj\n }", "function merge(obj) {\n for (var i=1; i < arguments.length; i++) {\n var def = arguments[i]\n for (var n in def)\n if (obj[n] === undefined) obj[n] = def[n]\n }\n return obj\n }", "function merge(obj) {\n for (var i=1; i < arguments.length; i++) {\n var def = arguments[i]\n for (var n in def)\n if (obj[n] === undefined) obj[n] = def[n]\n }\n return obj\n }", "function merge(obj) {\n for (var i=1; i < arguments.length; i++) {\n var def = arguments[i]\n for (var n in def)\n if (obj[n] === undefined) obj[n] = def[n]\n }\n return obj\n }", "function merge(obj) {\n for (var i=1; i < arguments.length; i++) {\n var def = arguments[i]\n for (var n in def)\n if (obj[n] === undefined) obj[n] = def[n]\n }\n return obj\n }", "function merge(obj) {\n for (var i=1; i < arguments.length; i++) {\n var def = arguments[i]\n for (var n in def)\n if (obj[n] === undefined) obj[n] = def[n]\n }\n return obj\n }", "function merge(obj) {\n for (var i=1; i < arguments.length; i++) {\n var def = arguments[i]\n for (var n in def)\n if (obj[n] === undefined) obj[n] = def[n]\n }\n return obj\n }", "function merge(obj) {\n for (var i=1; i < arguments.length; i++) {\n var def = arguments[i]\n for (var n in def)\n if (obj[n] === undefined) obj[n] = def[n]\n }\n return obj\n }", "function merge(obj) {\n for (var i=1; i < arguments.length; i++) {\n var def = arguments[i]\n for (var n in def)\n if (obj[n] === undefined) obj[n] = def[n]\n }\n return obj\n }", "function merge(obj) {\n for (var i=1; i < arguments.length; i++) {\n var def = arguments[i]\n for (var n in def)\n if (obj[n] === undefined) obj[n] = def[n]\n }\n return obj\n }", "function merge(obj) {\n for (var i=1; i < arguments.length; i++) {\n var def = arguments[i]\n for (var n in def)\n if (obj[n] === undefined) obj[n] = def[n]\n }\n return obj\n }", "function _mergeProperties(target, source) {\n\tfor(var property in source) {\n\t\tif(source.hasOwnProperty(property)) {\n\t\t\tif(source[property] instanceof Array) {\n\t\t\t\ttarget[property] = source[property].concat(target[property] instanceof Array ? target[property] : []);\n\t\t\t} else if(\n\t\t\t\tsource[property] !== null &&\n\t\t\t\ttypeof source[property] === \"object\" &&\n\t\t\t\tsource[property].constructor === Object\n\t\t\t) {\n\t\t\t\ttarget[property] = _mergeProperties(target[property] || {}, source[property]);\n\t\t\t} else {\n\t\t\t\ttarget[property] = source[property];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn target;\n}", "function _mergeProperties(target, source) {\n\tfor(var property in source) {\n\t\tif(source.hasOwnProperty(property)) {\n\t\t\tif(source[property] instanceof Array) {\n\t\t\t\ttarget[property] = source[property].concat(target[property] instanceof Array ? target[property] : []);\n\t\t\t} else if(\n\t\t\t\tsource[property] !== null &&\n\t\t\t\ttypeof source[property] === \"object\" &&\n\t\t\t\tsource[property].constructor === Object\n\t\t\t) {\n\t\t\t\ttarget[property] = _mergeProperties(target[property] || {}, source[property]);\n\t\t\t} else {\n\t\t\t\ttarget[property] = source[property];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn target;\n}", "function _mergeProperties(target, source) {\n\tfor(var property in source) {\n\t\tif(source.hasOwnProperty(property)) {\n\t\t\tif(source[property] instanceof Array) {\n\t\t\t\ttarget[property] = source[property].concat(target[property] instanceof Array ? target[property] : []);\n\t\t\t} else if(\n\t\t\t\tsource[property] !== null &&\n\t\t\t\ttypeof source[property] === \"object\" &&\n\t\t\t\tsource[property].constructor === Object\n\t\t\t) {\n\t\t\t\ttarget[property] = _mergeProperties(target[property] || {}, source[property]);\n\t\t\t} else {\n\t\t\t\ttarget[property] = source[property];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn target;\n}", "function _mergeProperties(target, source) {\n\tfor(var property in source) {\n\t\tif(source.hasOwnProperty(property)) {\n\t\t\tif(source[property] instanceof Array) {\n\t\t\t\ttarget[property] = source[property].concat(target[property] instanceof Array ? target[property] : []);\n\t\t\t} else if(\n\t\t\t\tsource[property] !== null &&\n\t\t\t\ttypeof source[property] === \"object\" &&\n\t\t\t\tsource[property].constructor === Object\n\t\t\t) {\n\t\t\t\ttarget[property] = _mergeProperties(target[property] || {}, source[property]);\n\t\t\t} else {\n\t\t\t\ttarget[property] = source[property];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn target;\n}", "function _mergeProperties(target, source) {\n for (var property in source) {\n if (Object.prototype.hasOwnProperty.call(source, property)) {\n if (source[property] instanceof Array) {\n target[property] = source[property].concat(target[property] instanceof Array ? target[property] : []);\n } else if (\n source[property] !== null &&\n typeof source[property] === 'object' &&\n source[property].constructor === Object\n ) {\n target[property] = _mergeProperties(target[property] || {}, source[property]);\n } else {\n target[property] = source[property];\n }\n }\n }\n\n return target;\n}", "function _mergeProperties(target, source) {\n for (var property in source) {\n if (Object.prototype.hasOwnProperty.call(source, property)) {\n if (source[property] instanceof Array) {\n target[property] = source[property].concat(target[property] instanceof Array ? target[property] : []);\n } else if (\n source[property] !== null &&\n typeof source[property] === 'object' &&\n source[property].constructor === Object\n ) {\n target[property] = _mergeProperties(target[property] || {}, source[property]);\n } else {\n target[property] = source[property];\n }\n }\n }\n\n return target;\n}", "function merge(obj) {\r\n for (var i=1; i < arguments.length; i++) {\r\n var def = arguments[i]\r\n for (var n in def)\r\n if (obj[n] === undefined) obj[n] = def[n]\r\n }\r\n return obj\r\n }", "function merge(obj) {\r\n for (var i=1; i < arguments.length; i++) {\r\n var def = arguments[i]\r\n for (var n in def)\r\n if (obj[n] === undefined) obj[n] = def[n]\r\n }\r\n return obj\r\n }", "function _merge(first, second) {\n var target = {};\n\n [first, second].forEach(function (obj) {\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n target[prop] = obj[prop];\n }\n }\n return target;\n });\n\n return target;\n }", "function merge_objs(source,target) {\n\t\tfor (var k in source) { if (source.hasOwnProperty(k)) {\n\t\t\ttarget[k] = source[k]; // TODO: does this need to be recursive for our purposes?\n\t\t}}\n\t\treturn target;\n\t}", "function _mergeProperties(target, source) {\n\t\tfor(var property in source) {\n\t\t\tif(source.hasOwnProperty(property)) {\n\t\t\t\tif(source[property] instanceof Array) {\n\t\t\t\t\ttarget[property] = source[property].concat(target[property] instanceof Array ? target[property] : []);\n\t\t\t\t} else if(\n\t\t\t\t\tsource[property] !== null &&\n\t\t\t\t\ttypeof source[property] === \"object\" &&\n\t\t\t\t\tsource[property].constructor === Object\n\t\t\t\t) {\n\t\t\t\t\ttarget[property] = _mergeProperties(target[property] || {}, source[property]);\n\t\t\t\t} else {\n\t\t\t\t\ttarget[property] = source[property];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn target;\n\t}", "static merge() {\n let result = {};\n if (!arguments || !arguments.length) {\n return result;\n }\n\n for (let i = 0; i < arguments.length; i++) {\n let currentArg = arguments[i];\n if (!currentArg) {\n continue;\n }\n Object.keys(currentArg).forEach(key => {\n if (Utility.isObject(currentArg[key]) && result[key] && Utility.isObject(result[key])) {\n result[key] = Utility.merge(result[key], currentArg[key]);\n } else {\n result[key] = currentArg[key];\n }\n });\n }\n return result;\n }", "function addAll(arr) {\n let keys1 =[];\n let values2=[];\n //go into each element in the array split the object into an array keys\n for (let i = 0; i < arr.length; i++) {\n keys1.push(Object.keys(arr[i]))}; //push into the new keys array\n for (let i = 0; i < arr.length; i++) {\n values2.push(Object.values(arr[i]))}; //push into the new value array\n \n var keysMerged = [].concat.apply([], keys1); //this is to take an array of arrays and make it make into one array\n var valuesMerged = [].concat.apply([], values2);\n \n let result2 = {};\n keysMerged.forEach((key, i) => result2[key] = valuesMerged[i]);\n return result2; \n}", "function merge(mutated, ...args) {\n if (!args || !args.length) return mutated;\n\n //if skipUndefined is true then key with undefined values will be ignored\n let skipUndefined = true;\n // last argument may be boolean for determine behavior for undefined values\n if (typeof args[args.length - 1] !== 'object') {\n skipUndefined = args.pop();\n }\n\n args.forEach(obj => {\n Object.keys(obj).forEach(key => {\n let val = obj[key];\n if (val !== void 0 || !skipUndefined) {\n mutated[key] = val;\n }\n });\n });\n return mutated;\n }", "function merge (obj) {\n\t for (var i = 1; i < arguments.length; i++) {\n\t var def = arguments[i]\n\t for (var n in def) {\n\t if (obj[n] === undefined) obj[n] = def[n]\n\t }\n\t }\n\t return obj\n\t }", "function merge (obj) {\n\t for (var i = 1; i < arguments.length; i++) {\n\t var def = arguments[i]\n\t for (var n in def) {\n\t if (obj[n] === undefined) obj[n] = def[n]\n\t }\n\t }\n\t return obj\n\t }", "function _mergeProperties(target, source) {\n\t\t\tfor(var property in source) {\n\t\t\t\tif(source.hasOwnProperty(property)) {\n\t\t\t\t\tif(source[property] instanceof Array) {\n\t\t\t\t\t\ttarget[property] = source[property].concat(target[property] instanceof Array ? target[property] : []);\n\t\t\t\t\t} else if(\n\t\t\t\t\t\tsource[property] !== null &&\n\t\t\t\t\t\ttypeof source[property] === \"object\" &&\n\t\t\t\t\t\tsource[property].constructor === Object\n\t\t\t\t\t) {\n\t\t\t\t\t\ttarget[property] = _mergeProperties(target[property] || {}, source[property]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttarget[property] = source[property];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\treturn target;\n\t\t}", "function merge(obj) {\n for (var i=1; i < arguments.length; i++) {\n var def = arguments[i];\n for (var n in def) {\n if (obj[n] === undefined) obj[n] = def[n];\n }\n }\n return obj;\n }", "function merge(obj) {\n for (var i=1; i < arguments.length; i++) {\n var def = arguments[i];\n for (var n in def) {\n if (obj[n] === undefined) obj[n] = def[n];\n }\n }\n return obj;\n }", "function merge(obj1, obj2) {\n var out = {};\n for (var attr in obj1) {\n out[attr] = obj1[attr];\n }\n for (var attr in obj2) {\n out[attr] = obj2[attr];\n }\n return out;\n}", "function mix( /* obj1, obj2, ..., objN */ ) {\n var args = Array.prototype.slice.call(arguments);\n var result = {};\n\n args.forEach(function (arg) {\n Object.keys(arg || {}).forEach(function (key) {\n if (key === 'headers') {\n if (!result.headers) {\n result.headers = {};\n }\n Object.keys(arg[key]).forEach(function (hKey) {\n if (!(hKey in result.headers)) {\n result.headers[hKey] = arg[key][hKey];\n }\n });\n } else if (!(key in result)) {\n result[key] = arg[key];\n }\n });\n });\n\n return result;\n}", "function mergeProps(propObjs,complexProps){var dest={};var i;var name;var complexObjs;var j;var val;var props;if(complexProps){for(i=0;i<complexProps.length;i++){name=complexProps[i];complexObjs=[];// collect the trailing object values, stopping when a non-object is discovered\nfor(j=propObjs.length-1;j>=0;j--){val=propObjs[j][name];if(_typeof(val)==='object'){complexObjs.unshift(val);}else if(val!==undefined){dest[name]=val;// if there were no objects, this value will be used\nbreak;}}// if the trailing values were objects, use the merged value\nif(complexObjs.length){dest[name]=mergeProps(complexObjs);}}}// copy values into the destination, going from last to first\nfor(i=propObjs.length-1;i>=0;i--){props=propObjs[i];for(name in props){if(!(name in dest)){// if already assigned by previous props or complex props, don't reassign\ndest[name]=props[name];}}}return dest;}", "function mergeJSON () {\r\n\t\tvar ret = {};\r\n\t\tfor (var a=0,len=arguments.length;a<len;a++) for (var v in arguments[a]) ret[v] = arguments[a][v];\r\n \t\treturn ret;\r\n\t}", "function mergeJSON () {\r\n\t\tvar ret = {};\r\n\t\tfor (var a=0,len=arguments.length;a<len;a++) for (var v in arguments[a]) ret[v] = arguments[a][v];\r\n \t\treturn ret;\r\n\t}", "function merge_objects(object1, object2) {\n var returnVal = {};\n for (var attrname in object1) { \n returnVal[attrname] = object1[attrname]; \n }\n for (var attrname in object2) { \n returnVal[attrname] = object2[attrname]; \n }\n return returnVal;\n}", "function merge(obj) {\r\n for (var i=1; i < arguments.length; i++) {\r\n var def = arguments[i];\r\n for (var n in def) {\r\n if (obj[n] === undefined) obj[n] = def[n];\r\n }\r\n }\r\n return obj;\r\n }", "function merge( target, source ) {\r\n \r\n if ( typeof target !== 'object' ) {\r\n target = {};\r\n }\r\n \r\n for (var property in source) {\r\n \r\n if ( source.hasOwnProperty(property) ) {\r\n \r\n var sourceProperty = source[ property ];\r\n \r\n if ( typeof sourceProperty === 'object' ) {\r\n target[ property ] = merge( target[ property ], sourceProperty );\r\n continue;\r\n }\r\n \r\n target[ property ] = sourceProperty;\r\n \r\n }\r\n \r\n }\r\n \r\n for (var a = 2, l = arguments.length; a < l; a++) {\r\n merge(target, arguments[a]);\r\n }\r\n \r\n return target;\r\n \r\n }", "function mergeArarys(keys, value) {\n var obj = {};\n if (keys.length !== value.length) return 'inconsistent_length';\n\n keys.map(( key, index, keys ) => {\n if (obj.hasOwnProperty(key) ) {\n var array = Array.isArray(obj[key])? obj[key]: [obj[key]]\n array.push(value[index]);\n obj[key] = array\n } else {\n obj[key] = value[index]\n }\n })\n\n return obj\n}", "function mergeProps$1(propObjs, complexProps) {\n var dest = {};\n var i;\n var name;\n var complexObjs;\n var j;\n var val;\n var props;\n if (complexProps) {\n for (i = 0; i < complexProps.length; i++) {\n name = complexProps[i];\n complexObjs = [];\n // collect the trailing object values, stopping when a non-object is discovered\n for (j = propObjs.length - 1; j >= 0; j--) {\n val = propObjs[j][name];\n if (typeof val === 'object' && val) { // non-null object\n complexObjs.unshift(val);\n }\n else if (val !== undefined) {\n dest[name] = val; // if there were no objects, this value will be used\n break;\n }\n }\n // if the trailing values were objects, use the merged value\n if (complexObjs.length) {\n dest[name] = mergeProps$1(complexObjs);\n }\n }\n }\n // copy values into the destination, going from last to first\n for (i = propObjs.length - 1; i >= 0; i--) {\n props = propObjs[i];\n for (name in props) {\n if (!(name in dest)) { // if already assigned by previous props or complex props, don't reassign\n dest[name] = props[name];\n }\n }\n }\n return dest;\n }", "function mergeIntoNewObject(...sources) {\n let dest = {};\n for (let src of sources) {\n for (let prop of Object.getOwnPropertyNames(src)) {\n Object.defineProperty(dest, prop, Object.getOwnPropertyDescriptor(src, prop));\n }\n }\n return dest;\n}", "function merge(target, source) {\n\n if (typeof target !== 'object') {\n target = {};\n }\n\n for (var property in source) {\n if (source.hasOwnProperty(property)) {\n var sourceProperty = source[ property ];\n\n if (typeof sourceProperty === 'object') {\n target[ property ] = merge(target[ property ], sourceProperty);\n continue;\n }\n target[ property ] = sourceProperty;\n }\n }\n\n for (var a = 2, l = arguments.length; a < l; a++) {\n merge(target, arguments[a]);\n }\n return target;\n}", "function mergeProps(propObjs, complexProps) {\n var dest = {};\n var i;\n var name;\n var complexObjs;\n var j;\n var val;\n var props;\n\n if (complexProps) {\n for (i = 0; i < complexProps.length; i++) {\n name = complexProps[i];\n complexObjs = []; // collect the trailing object values, stopping when a non-object is discovered\n\n for (j = propObjs.length - 1; j >= 0; j--) {\n val = propObjs[j][name];\n\n if (typeof val === 'object' && val) {\n // non-null object\n complexObjs.unshift(val);\n } else if (val !== undefined) {\n dest[name] = val; // if there were no objects, this value will be used\n\n break;\n }\n } // if the trailing values were objects, use the merged value\n\n\n if (complexObjs.length) {\n dest[name] = mergeProps(complexObjs);\n }\n }\n } // copy values into the destination, going from last to first\n\n\n for (i = propObjs.length - 1; i >= 0; i--) {\n props = propObjs[i];\n\n for (name in props) {\n if (!(name in dest)) {\n // if already assigned by previous props or complex props, don't reassign\n dest[name] = props[name];\n }\n }\n }\n\n return dest;\n }", "function mergeOptions(obj1,obj2){var obj3={};var attrname;for(attrname in obj1){obj3[attrname]=obj1[attrname];}for(attrname in obj2){obj3[attrname]=obj2[attrname];}return obj3;}", "function merge(obj) {\n\t for (var i = 1; i < arguments.length; i++) {\n\t var def = arguments[i];\n\t for (var n in def) {\n\t if (obj[n] === undefined) obj[n] = def[n];\n\t }\n\t }\n\t return obj;\n\t }", "function merge(target) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n var arg = args_1[_a];\n _merge(target || {}, arg);\n }\n return target;\n}", "function merge(target) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n var arg = args_1[_a];\n _merge(target || {}, arg);\n }\n return target;\n}", "function merge(target) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n var arg = args_1[_a];\n _merge(target || {}, arg);\n }\n return target;\n}", "function mergeProps(propObjs, complexProps) {\n var dest = {};\n var i;\n var name;\n var complexObjs;\n var j;\n var val;\n var props;\n if (complexProps) {\n for (i = 0; i < complexProps.length; i++) {\n name = complexProps[i];\n complexObjs = [];\n // collect the trailing object values, stopping when a non-object is discovered\n for (j = propObjs.length - 1; j >= 0; j--) {\n val = propObjs[j][name];\n if (typeof val === 'object') {\n complexObjs.unshift(val);\n }\n else if (val !== undefined) {\n dest[name] = val; // if there were no objects, this value will be used\n break;\n }\n }\n // if the trailing values were objects, use the merged value\n if (complexObjs.length) {\n dest[name] = mergeProps(complexObjs);\n }\n }\n }\n // copy values into the destination, going from last to first\n for (i = propObjs.length - 1; i >= 0; i--) {\n props = propObjs[i];\n for (name in props) {\n if (!(name in dest)) {\n dest[name] = props[name];\n }\n }\n }\n return dest;\n}", "function mergeProps(propObjs, complexProps) {\n var dest = {};\n var i;\n var name;\n var complexObjs;\n var j;\n var val;\n var props;\n if (complexProps) {\n for (i = 0; i < complexProps.length; i++) {\n name = complexProps[i];\n complexObjs = [];\n // collect the trailing object values, stopping when a non-object is discovered\n for (j = propObjs.length - 1; j >= 0; j--) {\n val = propObjs[j][name];\n if (typeof val === 'object') {\n complexObjs.unshift(val);\n }\n else if (val !== undefined) {\n dest[name] = val; // if there were no objects, this value will be used\n break;\n }\n }\n // if the trailing values were objects, use the merged value\n if (complexObjs.length) {\n dest[name] = mergeProps(complexObjs);\n }\n }\n }\n // copy values into the destination, going from last to first\n for (i = propObjs.length - 1; i >= 0; i--) {\n props = propObjs[i];\n for (name in props) {\n if (!(name in dest)) {\n dest[name] = props[name];\n }\n }\n }\n return dest;\n}", "function mergeProps(propObjs, complexProps) {\n var dest = {};\n var i;\n var name;\n var complexObjs;\n var j;\n var val;\n var props;\n if (complexProps) {\n for (i = 0; i < complexProps.length; i++) {\n name = complexProps[i];\n complexObjs = [];\n // collect the trailing object values, stopping when a non-object is discovered\n for (j = propObjs.length - 1; j >= 0; j--) {\n val = propObjs[j][name];\n if (typeof val === 'object') {\n complexObjs.unshift(val);\n }\n else if (val !== undefined) {\n dest[name] = val; // if there were no objects, this value will be used\n break;\n }\n }\n // if the trailing values were objects, use the merged value\n if (complexObjs.length) {\n dest[name] = mergeProps(complexObjs);\n }\n }\n }\n // copy values into the destination, going from last to first\n for (i = propObjs.length - 1; i >= 0; i--) {\n props = propObjs[i];\n for (name in props) {\n if (!(name in dest)) {\n dest[name] = props[name];\n }\n }\n }\n return dest;\n}", "function arrayMerge(target,source,options){var destination=target.slice();source.forEach(function merge(e,i){if(typeof destination[i]==='undefined'){var cloneRequested=options.clone!==false;var shouldClone=cloneRequested&&options.isMergeableObject(e);destination[i]=shouldClone?deepmerge_1(Array.isArray(e)?[]:{},e,options):e;}else if(options.isMergeableObject(e)){destination[i]=deepmerge_1(target[i],e,options);}else if(target.indexOf(e)===-1){destination.push(e);}});return destination;}", "function merge(obj) {\n\t\tfor (var i = 1; i < arguments.length; i++) {\n\t\t\tvar def = arguments[i];\n\t\t\tfor (var n in def) {\n\t\t\t\tif (obj[n] === undefined) obj[n] = def[n];\n\t\t\t}\n\t\t}\n\t\treturn obj;\n\t}", "function mergeProps(propObjs, complexProps) {\n var dest = {};\n var i;\n var name;\n var complexObjs;\n var j;\n var val;\n var props;\n if (complexProps) {\n for (i = 0; i < complexProps.length; i++) {\n name = complexProps[i];\n complexObjs = [];\n // collect the trailing object values, stopping when a non-object is discovered\n for (j = propObjs.length - 1; j >= 0; j--) {\n val = propObjs[j][name];\n if (typeof val === 'object' && val) { // non-null object\n complexObjs.unshift(val);\n }\n else if (val !== undefined) {\n dest[name] = val; // if there were no objects, this value will be used\n break;\n }\n }\n // if the trailing values were objects, use the merged value\n if (complexObjs.length) {\n dest[name] = mergeProps(complexObjs);\n }\n }\n }\n // copy values into the destination, going from last to first\n for (i = propObjs.length - 1; i >= 0; i--) {\n props = propObjs[i];\n for (name in props) {\n if (!(name in dest)) { // if already assigned by previous props or complex props, don't reassign\n dest[name] = props[name];\n }\n }\n }\n return dest;\n}", "function merge() {\n return new Merge(slicer.call(arguments, 0))\n}" ]
[ "0.69373506", "0.6712163", "0.67021805", "0.6658761", "0.6516402", "0.6401773", "0.634528", "0.6338674", "0.6338553", "0.6322913", "0.62239677", "0.6167969", "0.6166625", "0.6122369", "0.61187977", "0.6116542", "0.61050516", "0.6099282", "0.60824347", "0.60762733", "0.6004798", "0.59986943", "0.5981044", "0.5976592", "0.5932247", "0.59270096", "0.59213465", "0.5915536", "0.59087867", "0.59027463", "0.5901861", "0.58688873", "0.58688873", "0.58688873", "0.58688873", "0.58688873", "0.58688873", "0.58688873", "0.58688873", "0.58586895", "0.58409524", "0.58409524", "0.58409524", "0.58409524", "0.58409524", "0.58409524", "0.58409524", "0.58409524", "0.58409524", "0.58409524", "0.58409524", "0.58409524", "0.58409524", "0.58409524", "0.58409524", "0.58409524", "0.58409524", "0.583059", "0.583059", "0.583059", "0.583059", "0.58264154", "0.58264154", "0.58117515", "0.58117515", "0.5793795", "0.5793392", "0.57880825", "0.5786268", "0.57758707", "0.5771549", "0.57617617", "0.57617617", "0.5752002", "0.5740995", "0.5740995", "0.5733402", "0.5726443", "0.5719691", "0.5719253", "0.5719253", "0.57177705", "0.5713727", "0.57087773", "0.5691179", "0.568763", "0.567892", "0.56695074", "0.56560063", "0.5653903", "0.5641971", "0.56321853", "0.56321853", "0.56321853", "0.56305397", "0.56305397", "0.56305397", "0.5627708", "0.56272465", "0.56242377", "0.5622039" ]
0.0
-1
retrieves events that have the same groupId as the instance specified by `instanceId` or they are the same as the instance. why might instanceId not be in the store? an event from another calendar?
function getRelevantEvents(eventStore, instanceId) { var instance = eventStore.instances[instanceId]; if (instance) { var def_1 = eventStore.defs[instance.defId]; // get events/instances with same group var newStore = filterEventStoreDefs(eventStore, function (lookDef) { return isEventDefsGrouped(def_1, lookDef); }); // add the original // TODO: wish we could use eventTupleToStore or something like it newStore.defs[def_1.defId] = def_1; newStore.instances[instance.instanceId] = instance; return newStore; } return createEmptyEventStore(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRelevantEvents(eventStore, instanceId) {\n var instance = eventStore.instances[instanceId];\n if (instance) {\n var def_1 = eventStore.defs[instance.defId];\n // get events/instances with same group\n var newStore = filterEventStoreDefs(eventStore, function (lookDef) {\n return isEventDefsGrouped(def_1, lookDef);\n });\n // add the original\n // TODO: wish we could use eventTupleToStore or something like it\n newStore.defs[def_1.defId] = def_1;\n newStore.instances[instance.instanceId] = instance;\n return newStore;\n }\n return createEmptyEventStore();\n}", "function getRelevantEvents$1(eventStore, instanceId) {\n var instance = eventStore.instances[instanceId];\n if (instance) {\n var def_1 = eventStore.defs[instance.defId];\n // get events/instances with same group\n var newStore = filterEventStoreDefs$1(eventStore, function (lookDef) {\n return isEventDefsGrouped$1(def_1, lookDef);\n });\n // add the original\n // TODO: wish we could use eventTupleToStore or something like it\n newStore.defs[def_1.defId] = def_1;\n newStore.instances[instance.instanceId] = instance;\n return newStore;\n }\n return createEmptyEventStore$1();\n }", "function getRelevantEvents(eventStore, instanceId) {\n var instance = eventStore.instances[instanceId];\n if (instance) {\n var def_1 = eventStore.defs[instance.defId];\n // get events/instances with same group\n var newStore = filterEventStoreDefs(eventStore, function (lookDef) { return isEventDefsGrouped(def_1, lookDef); });\n // add the original\n // TODO: wish we could use eventTupleToStore or something like it\n newStore.defs[def_1.defId] = def_1;\n newStore.instances[instance.instanceId] = instance;\n return newStore;\n }\n return createEmptyEventStore();\n }", "function getRelevantEvents(eventStore, instanceId) {\n var instance = eventStore.instances[instanceId];\n\n if (instance) {\n var def_1 = eventStore.defs[instance.defId]; // get events/instances with same group\n\n var newStore = filterEventStoreDefs(eventStore, function (lookDef) {\n return isEventDefsGrouped(def_1, lookDef);\n }); // add the original\n // TODO: wish we could use eventTupleToStore or something like it\n\n newStore.defs[def_1.defId] = def_1;\n newStore.instances[instance.instanceId] = instance;\n return newStore;\n }\n\n return createEmptyEventStore();\n }", "function getRelevantEvents(eventStore, instanceId) {\n var instance = eventStore.instances[instanceId];\n\n if (instance) {\n var def_1 = eventStore.defs[instance.defId]; // get events/instances with same group\n\n var newStore = filterEventStoreDefs(eventStore, function (lookDef) {\n return isEventDefsGrouped(def_1, lookDef);\n }); // add the original\n // TODO: wish we could use eventTupleToStore or something like it\n\n newStore.defs[def_1.defId] = def_1;\n newStore.instances[instance.instanceId] = instance;\n return newStore;\n }\n\n return createEmptyEventStore();\n }", "function getInstanceContext(instanceId) {\n return instanceMap[instanceId]; \n }", "function queryInstanceAccts(instanceId) {\n // DEFINE LOCAL VARIABLES\n // RETURN ASYNC WORK\n return new Promise(function (resolve, reject) {\n\n var instanceAccts = firebase.database().ref('inventory/accts').orderByChild('instance_id').equalTo(instanceId);\n\n instanceAccts.once(\"value\")\n .then(function(snapshot) {\n resolve(snapshot.val());\n })\n .catch(function(e) {\n reject(e);\n });\n });\n }", "function excludeInstances(eventStore, removals) {\n return {\n defs: eventStore.defs,\n instances: filterHash(eventStore.instances, function (instance) {\n return !removals[instance.instanceId];\n })\n };\n}", "function excludeInstances(eventStore, removals) {\n return {\n defs: eventStore.defs,\n instances: filterHash(eventStore.instances, function (instance) { return !removals[instance.instanceId]; }),\n };\n }", "function excludeInstances(eventStore, removals) {\n return {\n defs: eventStore.defs,\n instances: filterHash(eventStore.instances, function (instance) {\n return !removals[instance.instanceId];\n })\n };\n }", "function excludeInstances(eventStore, removals) {\n return {\n defs: eventStore.defs,\n instances: filterHash(eventStore.instances, function (instance) {\n return !removals[instance.instanceId];\n })\n };\n }", "function excludeInstances(eventStore, removals) {\n return {\n defs: eventStore.defs,\n instances: filterHash(eventStore.instances, function (instance) {\n return !removals[instance.instanceId];\n })\n };\n }", "function findAllGroupEvents(group_name) {\n var groupEventsRef = db.collection(\"group_events\");\n var eventList = [];\n var query = groupEventsRef\n .where(\"groupName\", \"==\", group_name)\n .get()\n .then(snapshot => {\n if (snapshot.empty) {\n console.log(\"No matching documents.\");\n return;\n }\n\n snapshot.forEach(doc => {\n // console.log(doc.id, '=>', doc.data());\n var event = findEvent(doc.data().eventName);\n console.log(event);\n eventList.push(event);\n });\n })\n .catch(err => {\n console.log(\"Error getting documents\", err);\n });\n return { groupName: group_name, elements: eventList };\n}", "function excludeInstances$1(eventStore, removals) {\n return {\n defs: eventStore.defs,\n instances: filterHash$1(eventStore.instances, function (instance) {\n return !removals[instance.instanceId];\n })\n };\n }", "function queryInstances(filter, id) {\n // DEFINE LOCAL VARIABLES\n console.log('querying Instances with ', filter, id);\n // RETURN ASYNC WORK\n return new Promise(function (resolve, reject) {\n\n var instances = firebase.database().ref('instances').orderByChild(filter).equalTo(id);\n\n instances.once(\"value\")\n .then(function(snapshot) {\n resolve(snapshot.val());\n })\n .catch(function(e) {\n reject(e);\n });\n });\n }", "function queryInstancesByDate(startDate, endDate) {\n // DEFINE LOCAL VARIABLES\n // RETURN ASYNC WORK\n return new Promise(function (resolve, reject) {\n\n var instances = firebase.database().ref('instances').orderByChild('opens').startAt(startDate).endAt(endDate);\n\n instances.once(\"value\")\n .then(function(snapshot) {\n resolve(snapshot.val());\n })\n .catch(function(e) {\n reject(e);\n });\n });\n }", "function getInstanceTasks(instanceId) {\n var instanceContext = getInstanceContext(instanceId);\n if (!instanceContext) return null;\n var model = ModelManager.getModel(instanceContext.modelName);\n if (!model) return null;\n var res = [];\n for (var id of instanceContext.enabledSet) {\n res.push(\n {\n 'instanceId': instanceId,\n 'activityId': id,\n 'modelName': instanceContext.modelName,\n 'activityName': model.activityMap[id].name,\n 'lane': model.activityMap[id].lane,\n }\n )\n }\n return res;\n }", "function getQuery() {\n if (eventID == null || eventID == \"\") {\n // Lets find the the current event\n return VotingEvent.find({ startTime: {$lt: new Date()}, endTime: {$gt: new Date()} }).then((events) => {\n return new Promise(function(resolve, reject) {\n if (events == null) {\n resolve(null);\n return;\n }\n resolve(events[0]);\n });\n });\n }else{\n // If we already have an event id we can just find that one\n return VotingEvent.findById(eventID);\n }\n }", "function grabEventData(eventId) {\n //Grab all event data from Dashboard Service\n var allEvents = EventDashboardFactory.getEventData();\n\n //Match with the given eventId\n for (var i = 0; i < allEvents.length; i++) {\n if (parseInt(eventId) === allEvents[i].id) {\n return allEvents[i];\n }\n }\n console.log('Could not get event data for event id: ', eventId);\n }", "addToEvents(events, folder, filterStartDate, filterEndDate) {\n const adapter = this;\n const event = folder.ApplicationData[0];\n if (!event.StartTime) {\n console.error(`Detected malformed event: ${JSON.stringify(Object.keys(event))}, dropping it on the floor`);\n return;\n }\n const startTime = moment(event.StartTime[0]);\n const endTime = moment(event.EndTime[0]);\n const exceptions = _.get(event, 'Exceptions[0]');\n const exceptionEvents = adapter.getExceptionEvents(event, exceptions, filterStartDate, filterEndDate);\n if (exceptionEvents.length) {\n events.push(...exceptionEvents);\n }\n const recurrenceObj = _.get(event, 'Recurrence[0]');\n if (recurrenceObj) {\n const recurrence = adapter.getRecurrence(startTime, filterEndDate, recurrenceObj);\n if (recurrence) {\n const UID = event.UID[0];\n for (const date = moment(filterStartDate); date.isSameOrBefore(filterEndDate); date.add(1, 'days')) {\n if (recurrence.matches(date)) {\n startTime.year(date.year());\n startTime.month(date.month());\n startTime.date(date.date());\n endTime.year(date.year());\n endTime.month(date.month());\n endTime.date(date.date());\n const instanceEvent = _.clone(event);\n // Set the iCalUId to the event id\n instanceEvent.iCalUId = UID;\n instanceEvent.UID = [UID + `-${date.year()}${date.month()}${date.date()}`];\n instanceEvent.StartTime = [startTime.utc().format().replace(/[-:]/g, '')];\n instanceEvent.EndTime = [endTime.utc().format().replace(/[-:]/g, '')];\n if (!adapter.isDeleted(exceptions, instanceEvent) && !adapter.eventExists(events, instanceEvent)) {\n events.push(instanceEvent);\n }\n }\n }\n }\n }\n else if (!adapter.isDeleted(exceptions, event) && !adapter.eventExists(events, event)) {\n events.push(event);\n }\n }", "async function filterEvents (AppInstance) {\n\n AppInstance.on('ReceivedNewRequestIdEvent', (id) => {\n console.log('Request event occurred with ID number:', id.toString()); // convert BigNumber to regular integer string\n });\n\n\n AppInstance.on('MoveUpdatedEvent', (fenString, nextMove, id) => {\n console.log(' Update event occurred with ID number:', id.toString(), ' Old String:', fenString, ' New String:', (nextMove));\n });\n}", "function getEventById(id) {\n for (var i = 0; i < this.item.eventsList.length; i++) {\n if (this.item.eventsList[i].id.toString() == id) {\n return this.item.eventsList[i];\n }\n }\n\n return null;\n }", "getInstance(instanceId, cb) {\n redis.getinst(instanceId, (err, result) => {\n if (typeof result === 'string') {\n const resultObj = JSON.parse(result)\n resultObj.status = PROCESSING\n cb(err, WorkflowInstance.fromPlain(resultObj))\n return\n }\n if (result === 0) {\n cb(new NotInCacheError(instanceId), undefined)\n return\n }\n cb(new BusyInstanceError(instanceId, result[1]), undefined)\n })\n }", "function onSelectedInstanceChanged(event)\n\t{\n\t\tvar selected = $(event.currentTarget);\n\n\t\tvar instanceId = selected.val();\n\n\t\t// nothing changed... so don't do anything...\n\t\tif (!instanceId || this.selectedInstanceId == instanceId) return;\n\n\t\tthis.setSelectedInstanceId(instanceId);\n\n\t\tif (this.showingManageView || this.showingFieldView) this.sidebar.breadcrumbsView.back();\n\t\telse this.renderGridView();\n\t}", "getEvent(id) {\r\n return apiClient.get(\"/events/\" + id);\r\n }", "function EWSRP_DayInstanceEquals(otherInstance)\n{\n return (this.Instance === otherInstance.Instance && this.DayOfWeek === otherInstance.DayOfWeek);\n}", "onInstanceRemoved(instanceName) {\n if (!this.isFiltered(instanceName)) {\n const { instances } = this.state;\n delete instances[instanceName];\n this.setState({ instances });\n }\n delete this.instances[instanceName];\n }", "get eventId() {\n return this._eventData.id;\n }", "get eventId() {\n return this._eventData.id;\n }", "function deleteEventInGroup(index) {\n var deletedId = model.events[index]._id;\n console.log(\"deleteeventid\");\n console.log(deletedId);\n EventService.deleteEventById($scope.currentGroup._id, deletedId)\n .then(function (allOtherEvents) {\n model.events = allOtherEvents;\n });\n }", "function findAppInSelectedModel(gid, aid,fromInstance) {\n\tvar self = this;\n\tvar _group = self.findGroupByPath(gid,fromInstance);\n\tvar _app = _.find(_group.apps, function(app) {\n\t\treturn app.id == aid;\n\t});\n\treturn _app;\n}", "fetchInstances(dayOfWeek, time) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tec2.describeInstances({\n\t\t\t\tFilters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tName: \"tag-key\",\n\t\t\t\t\t\tValues: [\n\t\t\t\t\t\t\t\"Trackbone\",\n\t\t\t\t\t\t\t\"trackbone\",\n\t\t\t\t\t\t\t\"TRACKBONE\"\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\tName: \"instance-state-code\",\n\t\t\t\t\t\tValues: [\"16\", \"80\"]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}, (err, data) => {\n\t\t\t\tif (err) {\n\t\t\t\t\treject(err);\n\t\t\t\t} else if (data.Reservations[0] && data.Reservations[0].Instances) {\n\t\t\t\t\tlet actionMap = {\n\t\t\t\t\t\tshouldStart: [],\n\t\t\t\t\t\tshouldStop: [],\n\t\t\t\t\t\tdayOfWeek: dayOfWeek,\n\t\t\t\t\t\ttime: time\n\t\t\t\t\t};\n\t\t\t\t\tdata.Reservations[0].Instances.map(instance => {\n\t\t\t\t\t\tlet instanceRunning = (instance.State.Code === 16);\n\t\t\t\t\t\tlet trackboneTagValue = instance.Tags.find(t => t.Key.toUpperCase() === \"TRACKBONE\").Value;\n\t\t\t\t\t\tif (Trackbone.verifyTrackboneTag(trackboneTagValue)) {\n\t\t\t\t\t\t\tlet instanceSchedule = new Schedule(trackboneTagValue);\n\t\t\t\t\t\t\tlet instanceShouldRun = instanceSchedule.instanceShouldRun(dayOfWeek, time);\n\t\t\t\t\t\t\tif (instanceRunning !== instanceShouldRun) {\n\t\t\t\t\t\t\t\tinstanceShouldRun ? actionMap.shouldStart.push(instance.InstanceId) : actionMap.shouldStop.push(instance.InstanceId);\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\tresolve(actionMap);\n\t\t\t\t} else {\n\t\t\t\t\treject(\"no instances active\");\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "function calendar_helper_getCalendarEvent(cal_event_id){\n for (var i in calendar_events){\n if (calendar_events[i].id == cal_event_id)\n return calendar_events[i];\n }\n alert(CALENDAR_EVENT_NOT_FOUND);\n return null;\n}", "instanceInstanceIdGet(incomingOptions, cb) {\n const Rollbar = require('./dist');\n\n let apiInstance = new Rollbar.OccurrenceApi(); // String | Use a project access token with 'read' scop // Number | The occurrence ID\n /*let xRollbarAccessToken = \"xRollbarAccessToken_example\";*/ /*let instanceId = 56;*/ apiInstance.instanceInstanceIdGet(\n incomingOptions.xRollbarAccessToken,\n incomingOptions.instanceId,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, data.result, response);\n }\n }\n );\n }", "static existingInstance(id) {\n return this.instances[id];\n }", "function getEventByGateId(id) {\n return events.find(item => item.record.gateId === id);\n}", "function calendar_helper_getCalendarEventFromDestinationId(destination_id){\n for (var i in calendar_events){\n var cal_event = calendar_events[i]\n if (cal_event.available_destination_id == destination_id){\n return cal_event;\n }\n }\n alert(CALENDAR_EVENT_NOT_FOUND );\n return null;\n}", "function checkExists(){\n var query = $( \"#query\" ).val();\n console.log(query);\n $('#content').empty();\n\tgapi.client.load('calendar', 'v3', function() { \n var request = gapi.client.calendar.events.list({\n\t \t 'calendarId': 'primary',\n 'q': query //set the query string variable\n });\n\trequest.execute(function(resp) {\n\t\tconsole.log(resp);\n\t if (resp.items){\n\t\t for (var i = 0; i < resp.items.length; i++) {\n\t\t \t//set event variables and list matching events\n console.log(resp.items[i].summary + \" \" +query);\n //double check returned values to be sure they contain query string in a\n //case sensitive way.\n if(resp.items[i].summary.toLowerCase().search(query.toLowerCase()) !== -1 )\n {\n var event = document.createElement('div');\n event.id = \"calEvent\";\n var id = document.createElement('ul');\n var ul = document.createElement('ul');\n id.appendChild(document.createTextNode(\"Id: \" + resp.items[i].id));\n //ul.appendChild(document.createTextNode(\"Reminders: \" + resp.items[i].reminders.overrides[].method));\n event.appendChild(document.createTextNode(resp.items[i].summary));\n event.appendChild(id);\n event.appendChild(ul);\n document.getElementById('content').appendChild(event);\n }\n }\n\t }\n\t else{\n\t\t\talert(\"No matching events!\");\n\t }\n });\n\t });\n}", "unsetSubscriber (name, instanceName) {\n\n var keys = Object.keys(this.events);\n var k = keys.indexOf(name);\n if(k != -1){\n\n var ks = this.events[name].indexOf(instanceName);\n\n if(ks != -1){\n\n var na = [];\n\n for(var i=0; i<this.events[name].length; i++){\n if(this.events[name][i] != instanceName){\n na.push(this.events[name][i]);\n }\n }\n\n this.events[name] = na;\n }\n }\n }", "getEvents() {\n let remoteAction = new RemoteAction(RemoteActions.GetEvents, {}, {}, result => {\n debug('getEvents->remoteAction result:', result);\n this.onEvents(result.events);\n });\n\n // Set the context for the current embed\n remoteAction.setContext({\n embedId: this.getId()\n });\n this.getDispatcher().sendAction(remoteAction, true);\n }", "findEvent(id) {\n for (let event of this.events) {\n if (event === id || event.schedule === id || event.data === id || event.id === id) {\n return event;\n }\n }\n return null;\n }", "function getThisEvents(res, mysql, context, id, complete) {\n var sql=\"SELECT ae.artworkID AS aid, ae.eventID AS eid, CONCAT(a.firstName, ' ', a.lastName) AS artistName, e.name, aw.url, aw.title, aw.medium, aw.material, aw.description, DATE_FORMAT(e.startDate, '%a %b %e %Y') AS startDate, DATE_FORMAT(e.endDate, '%a %b %e %Y') AS endDate, TIME_FORMAT(e.time, '%h %i %p') AS time, e.location, e.city, e.state, e.zipCode FROM Artworks_Events ae LEFT JOIN Events e on e.eventID = ae.eventID LEFT JOIN Artworks aw on aw.artworkID = ae.artworkID LEFT JOIN Artists a on a.artistID = aw.artistID WHERE aw.artworkID = ? ORDER BY date(startDate) ASC;\";\n var inserts = [id];\n mysql.pool.query(sql, inserts, function(error, results, fields) {\n if (error) {\n res.write(JSON.stringify(error));\n res.end();\n }\n context.thisEvents = results;\n if (context.thisEvents.length < 2) {\n context.noRemove = true;\n } else {\n context.noRemove = false;\n }\n console.log(context.thisEvents)\n console.log(context.noRemove)\n complete();\n });\n }", "function onInstanceOrderChanged(event)\n\t{\n\t\tvar self = this;\n\t\tvar instanceIds = [];\n\t\tvar url = this.data.page.url('sort_collection_instance', { pageVersionId: this.data.page.info.page_version_id, collectionId: this.data.collection.id});\n\t\tvar sorting = this.manage.filter('#dvs-collection-instances-sortable');\n\n\t\tsorting.children().each(function(index, instanceEl)\n\t\t{\n\t\t\tinstanceIds.push(instanceEl.dataset.instanceId);\n\t\t});\n\n\t\t$.ajax(url, {\n\t\t\tmethod: 'POST',\n\t\t\tdata: {'instances' : instanceIds },\n\t\t\tsuccess: function()\n\t\t\t{\n\t\t\t\tself.resortInstances(instanceIds);\n\t\t\t\tself.renderInstanceSelectorView();\n\t\t\t},\n\t\t\terror: function()\n\t\t\t{\n\t\t\t\talert('could not sort instance');\n\t\t\t\tconsole.warn('could not sort instance', arguments);\n\t\t\t\tself.renderManageView();\n\t\t\t}\n\t\t});\n\t}", "getEventoById(id) {\n return eventos.find(evento => evento.id === parseInt(id, 10));\n }", "function getLogEvents(groupName, streamName) {\n return cloudwatchlogs.getLogEvents({\n logGroupName: groupName,\n logStreamName: streamName,\n limit: 30,\n startFromHead: false\n }).promise()\n}", "function saveInstance(instanceContext) {\n instanceId = instanceContext.instanceId;\n if (!instanceId) throw '--- instanceId is undefined';\n if (!instanceMap[instanceId]) throw '--- undefined instance ---';\n instanceMap[instanceId] = instanceContext;\n }", "getPublicEvents(callback) {\n super.query(\n 'SELECT e.*, DATE_FORMAT(e.end, \"%Y-%m-%d %H:%i\") as end_format, DATE_FORMAT(e.start, \"%Y-%m-%d %H:%i\") as start_format, l.address, l.name as location_name, l.postcode, v.min_price, v.max_price FROM event e LEFT JOIN location l ON l.location_id = e.location_id LEFT JOIN (SELECT et.event_id, MIN(et.price) as min_price, MAX(et.price) as max_price FROM event_ticket et GROUP BY et.event_id) v ON v.event_id = e.event_id WHERE end > now() - INTERVAL 1 month AND e.is_public IS TRUE AND (TRUE IN(SELECT o.verified FROM organiser o WHERE o.organiser_id IN(SELECT eo.organiser_id FROM event_organiser eo WHERE eo.event_id = e.event_id)))',\n [],\n callback,\n );\n }", "events_for_source(sourceName, liveTimestamps) {\n\n let coveredEventsIds = new SortedArray([], true)\n if (this.sourceTimeEventTree.has(sourceName)) {\n this.sourceTimeEventTree.get(sourceName).forEach((value, key) => {\n if (liveTimestamps.includes(key.toString())) {\n value.forEach((eventId) => {\n coveredEventsIds.insert(eventId)\n })\n }\n })\n }\n\n info(\"Source : \", sourceName, \"covered\", coveredEventsIds.size(), \"events.\\nIDs : \\n\", coveredEventsIds)\n let tmp = coveredEventsIds.map((id) => {\n const event = this.eventsBroker.getEventById(id)\n return event;\n })\n let coveredEvents = tmp.filter((event) => event != undefined)\n info(\"Out of which\", coveredEvents.length, \"we were able to identify (=find by ID). \\nEvents :\\n\", coveredEvents)\n return coveredEvents\n }", "static getInstance(){\n if(instance === undefined){\n instance = new EventsSingleton();\n }\n return instance;\n }", "function getCal1Event(cal2Id) {\n var num = cal2Id.slice(-1) - 5;\n var id = \"_fc\" + num;\n return $cal1.fullCalendar('clientEvents', id)[0];\n }", "retrieveEvents() {\n if (this.updateInProgress) {\n return;\n }\n this.updateInProgress = true;\n this.resetWidget(true);\n // Set temporary method\n let label = CalendarUtility.label(_(\"No events found...\"), this.zoom, this.textcolor);\n this.window.add(label);\n var outputReceived = false;\n try {\n // Execute the command to retrieve the calendar events.\n let reader = new SpawnReader();\n reader.spawn(\"./\", this.getCalendarCommand(), (output) => {\n if (!outputReceived) {\n this.resetWidget();\n outputReceived = true;\n }\n let eventLine = output.toString();\n try {\n this.addEvent(eventLine);\n } catch (e) {\n global.logError(e);\n let label;\n if (eventLine.includes(\"https://accounts.google.com/o/oauth2/auth\")) {\n // Not authenticated\n label = CalendarUtility.label(_(\"Please configure gcalcli to continue\"), this.zoom, this.textcolor);\n } else {\n label = CalendarUtility.label(_(\"Unable to retrieve events...\"), this.zoom, this.textcolor);\n }\n this.window.add(label);\n }\n });\n } catch (e) {\n global.logError(e);\n } finally {\n this.updateInProgress = false;\n }\n }", "function EventGroup(parent) {\r\n this._id = EventGroup._uniqueId++;\r\n this._parent = parent;\r\n this._eventRecords = [];\r\n }", "function EventGroup(parent) {\r\n this._id = EventGroup._uniqueId++;\r\n this._parent = parent;\r\n this._eventRecords = [];\r\n }", "function hardDeleteByGUID(instanceGUID, callback) {\n _getEntityInstanceHead(instanceGUID, function (err, instanceHead) {\n if(err)return callback(err); //Already message instance\n\n if(instanceHead['DEL'] === 0)\n return callback([\n message.report('ENTITY', 'INSTANCE_NOT_MARKED_DELETE', 'E', instanceHead.INSTANCE_GUID, instanceHead.ENTITY_ID)]);\n\n let entityMeta = entityDB.getEntityMeta(instanceHead.ENTITY_ID);\n if(!entityMeta)\n return callback([message.report('ENTITY', 'ENTITY_META_NOT_EXIST', 'E', instanceHead.ENTITY_ID)]);\n\n let deleteSQLs = [];\n deleteSQLs.push(\"delete from \" + entityDB.pool.escapeId(entityMeta.ENTITY_ID)\n + \" where INSTANCE_GUID = \" + entityDB.pool.escape(instanceGUID));\n\n entityMeta.ROLES.forEach(function (role) {\n if (role.RELATIONS) {\n role.RELATIONS.forEach(function (relation){\n deleteSQLs.push(\"delete from \" + entityDB.pool.escapeId(relation.RELATION_ID)\n + \" where INSTANCE_GUID = \" + entityDB.pool.escape(instanceGUID));\n });\n }\n if (role.RELATIONSHIPS) {\n role.RELATIONSHIPS.forEach(function (relationship) {\n deleteSQLs.push(\"delete from \" + entityDB.pool.escapeId(relationship.RELATIONSHIP_ID)\n + \" where \" + entityDB.pool.escapeId(role.ROLE_ID + \"_INSTANCE_GUID\") + \" = \" + entityDB.pool.escape(instanceGUID));\n })\n }\n });\n\n deleteSQLs.push(\"delete from ENTITY_INSTANCES where INSTANCE_GUID = \" + entityDB.pool.escape(instanceGUID));\n\n entityDB.doUpdatesParallel(deleteSQLs, function (err) {\n if (err) {\n callback([message.report('ENTITY', 'GENERAL_ERROR', 'E', err)]);\n } else {\n callback(null);\n }\n });\n })\n}", "function updateEventInGroup(event) {\n console.log(event);\n EventService.updateEventForGroup($scope.currentGroup._id, event._id, event)\n .then(function (updateEvents) {\n console.log(updateEvents);\n model.events = updateEvents;\n });\n\n }", "function getAllEventsForUser(userId) {\n\n\t\t\treturn deferred.promiseValue(\n\t\t\t\tevents.filter(function (event) {\n\t\t\t\t\treturn event.userId === '' || event.userId === userId;\n\t\t\t\t}));\n\t\t}", "function EventGroup(parent) {\n this._id = EventGroup._uniqueId++;\n this._parent = parent;\n this._eventRecords = [];\n }", "function EventGroup(parent) {\n this._id = EventGroup._uniqueId++;\n this._parent = parent;\n this._eventRecords = [];\n }", "function EventGroup(parent) {\n this._id = EventGroup._uniqueId++;\n this._parent = parent;\n this._eventRecords = [];\n }", "function EventGroup(parent) {\n this._id = EventGroup._uniqueId++;\n this._parent = parent;\n this._eventRecords = [];\n }", "function EventGroup(parent) {\n this._id = EventGroup._uniqueId++;\n this._parent = parent;\n this._eventRecords = [];\n }", "function EventGroup(parent) {\n this._id = EventGroup._uniqueId++;\n this._parent = parent;\n this._eventRecords = [];\n }", "function EventGroup(parent) {\n this._id = EventGroup._uniqueId++;\n this._parent = parent;\n this._eventRecords = [];\n }", "removeOccurrences() {\n // This recurring event must also be removed from the occurrenceMap if it's there\n // So insert it as the first element. Can also be found from the store's global occurrence\n // Map using [...this.eventStore.globalOccurrences.keys()].filter(e => e.startsWith(`_generated:${this.id}`))\n [this, ...this.occurrences].forEach(occurrence => this.removeOccurrence(occurrence));\n }", "async function getStaleInstances() {\n const [instances] = await bigtable.getInstances();\n return instances\n .filter(i => i.id.match(PREFIX))\n .filter(i => {\n const timeCreated = i.metadata.labels.time_created;\n // Only delete stale resources.\n const oneHourAgo = new Date(Date.now() - 3600000);\n return !timeCreated || timeCreated <= oneHourAgo;\n });\n}", "async function DescribeInstanceAsgTags(asgNameKey, instanceID) {\n let response;\n var params = {\n Filters: [{\n Name: \"key\",\n Values: [\n asgNameKey\n ]\n },\n {\n Name: \"resource-id\",\n Values: [\n instanceID\n ]\n }\n ]\n };\n\n try {\n response = await EC2.describeTags(params).promise();\n }\n catch (error) {\n console.log(\"describe instance tags error: \", error);\n }\n\n return response;\n}", "async getEventHost() {\n let eventHost = await this.knex\n .from(\"users\")\n .innerJoin(\"event\", \"event.users_id\", \"users.id\")\n .select()\n .orderBy(\"event.id\", \"desc\")\n .where(\"eventDate\", \">=\", new Date());\n return eventHost;\n }", "function checkEventExists() \n{\n gapi.client.load('calendar', 'v3', function() {\n var request = gapi.client.calendar.events.get({\n 'calendarId': cal.id,\n 'eventId': cal.eventId\n });\n request.execute(function(event) {\n if (event.hasOwnProperty('error')) {\n cal.event = null;\n showEventLink(false);\n showCalendar(null);\n } else {\n cal.event = event;\n if (event.status == 'cancelled') {\n showEventLink(false);\n showCalendar(null);\n } else {\n cal.event = event;\n showEventLink(true);\n showCalendar(event.start.dateTime);\n showEvent();\n showFacilitator();\n }\n }\n });\n });\n}", "async getEvents() {\n try {\n return await eventModel.find({}, \"-qr -winners -importance\", {\n sort: { startDate: 1 },\n });\n } catch (err) {\n l.error(\"[GET EVENTS]\", err);\n throw err;\n }\n }", "function getAndLoadEvents(user_id) {\n stopEventStateCheck();\n $.get(\"/event/\" + user_id).done((data) => {\n events = {};\n document.querySelectorAll(\"#upcoming-events, #past-events\").forEach((board) => { board.innerHTML = \"\"; });\n data.events.forEach(event => {\n let upcomingDeck = document.getElementById(\"upcoming-events\");\n let pastDeck = document.getElementById(\"past-events\");\n events[event.id] = event;\n if (moment(event.end_datetime) > moment.now()) {\n if (moment(event.start_datetime) <= moment.now()) {\n createAndAddEvents(upcomingDeck, event, \"bg-now\");\n } else { createAndAddEvents(upcomingDeck, event, \"bg-future\"); }\n } else {\n createAndAddEvents(pastDeck, event, \"bg-past\");\n }\n });\n });\n startEventStateCheck();\n}", "function validateGroupEvent(event){assert(event.anonymousId||event.userId,'You must pass either an \"anonymousId\" or a \"userId\".');assert(event.groupId,'You must pass a \"groupId\".');}", "getEventDB(idEvent){\n this.events.getOne(idEvent).then(response => {\n this.event = response.data;\n this.filterEvents(this.event.category);\n });\n }", "function getRootInstance() {\n // f0. declared variable\n const win = getRootWindow();\n let result = instances;\n if (win) {\n // let firstCreateFlag = false;\n const event = new CustomEvent(\"SingletonRetrieveInstances\", {\"instances\": null});\n if (win === window) {\n // f1. if owner window is root, add event listancer\n // f1-1. create root instance mapping\n result = instances;\n // f1-2. add event listancer, that children could retrieve instance mapping\n win.addEventListener(event.type, ($event) => {\n $event.instances = instances;\n });\n } else {\n // f2. if owner window is not root, retrieve instance mapping from root by custom event.\n // f2-1. retrieve instance mapping object, if right window is children window.\n win.dispatchEvent(event);\n result = event.instances;\n }\n }\n return result;\n}", "static get instances() {\n return instances;\n }", "instanceInstanceIdDelete(incomingOptions, cb) {\n const Rollbar = require('./dist');\n\n let apiInstance = new Rollbar.OccurrenceApi(); // String | Use a project access token with 'read' scop // Number | The occurrence ID\n /*let xRollbarAccessToken = \"xRollbarAccessToken_example\";*/ /*let instanceId = 56;*/ apiInstance.instanceInstanceIdDelete(\n incomingOptions.xRollbarAccessToken,\n incomingOptions.instanceId,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, data.result, response);\n }\n }\n );\n }", "function getJbossInstanceOnMachine(jbossInstanceName, machineName)\n{\n\tvar os = getMachine(machineName);\n\t\n\tvar jbossEap6Type = getJBossEAP6Type();\n\t\n\tvar criteria = new ResourceCriteria();\n\tcriteria.addFilterName(jbossInstanceName);\n\tcriteria.addFilterResourceTypeId(jbossEap6Type.id);\n\tcriteria.addFilterParentResourceId(os.id)\n\tvar servers = ResourceManager.findResourcesByCriteria(criteria);\n\t\n\t// we have a new JBoss instance\n\tif (servers.size()==0) {\n\t\tprintln(\"No JBoss server \" + jbossInstanceName + \" found on machine \" + machineName);\n\t\treturn null;\n\t}\n\t// we have an existing JBoss instance\n\telse if (servers.size()==1) {\n\t\treturn servers.get(0);\n\t}\n\telse {\n\t\tthrow error(\"multiple ressources correspond to your criteria getJbossInstanceOnMachine(\"+ jbossInstanceName + \",\" + machineName +\")\");\n\t}\n}", "function loadEvents() {\n $.getJSON('/get_group_with_events', (res) => {\n var group = res.group;\n \n if (group) {\n var currentEvents = sortEvents(group.currentEvents);\n currentEvents.forEach(event => { \n $(\"#currentEvents\").append(displayEvent(event));\n });\n }\n })\n}", "getEvent(eventName) {\n return this.events.find((e) => e.title == eventName);\n }", "fetchEvent(id) {\n var self = this;\n this.db.ref('/events/' + id)\n // Only one value should be returned\n .once('value')\n .then(function(snapshot) {\n var eventFromDB = snapshot.val();\n\n console.log('SUCCESS in main.js - fetchEvent(): doc.data() ===', eventFromDB);\n\n // We update the currentEvent object with our fetched data\n self.updateEventFromDB(eventFromDB);\n })\n .catch(function(error) {\n console.log('ERROR in main.js - couldn\\'t fetch event.', error);\n // We couldn't retrieve the event (doesn't exist or wrong id)\n // so we \n self.appState = this.appStates.wigotCreation;\n })\n }", "function userGridEventFromId(eventId) {\n return {\n type: 'events-sts',\n uuid: eventId\n };\n}", "function findFunctionallyEquivalentEventID(e, startPos, timeline_num)\n{\n for (var t_num = 1; t_num < timeline_num; t_num++) {\n for (var i_old = startPos; i_old < data_timeline[t_num].length-1; i_old++) {\n var str_old = data_timeline[t_num][i_old];\n var e_old = jQuery.parseJSON(str_old);\n // using JSON.stringify() to compute .equals() for objects/arrays in fingerprint\n if (JSON.stringify(e_old[\"fingerprint\"]) === JSON.stringify(e[\"fingerprint\"])) {\n return All_Events_Hash[t_num][i_old];\n }\n }\n }\n return -1;\n}", "getTimespanRecord(context) {\n return context.eventRecord;\n }", "getTimespanRecord(context) {\n return context.eventRecord;\n }", "function getEvents(params, internalOpts) {\n // Opts for internal use: meaning that other services may use these options\n internalOpts = _.merge({\n disableLimit: false,\n includeAllFields: true\n }, internalOpts);\n\n var opts = serviceUtils.pickAndValidateListOpts(params, ALLOWED_SORT_KEYS);\n var whereObj = serviceUtils.pickAndValidateWheres(\n params, PUBLIC_TO_MODEL, ALLOWED_MULTI_SEARCH_KEYS\n );\n\n // Execute query\n var queryBuilder = knex\n .select(\n EVENTS_TABLE + '.*',\n knex.raw('json_agg(' + USER_EVENTS_TABLE + '.user_id) as participants')\n )\n .from(EVENTS_TABLE + ' as ' + EVENTS_TABLE)\n .leftJoin(\n USER_EVENTS_TABLE + ' as ' + USER_EVENTS_TABLE,\n EVENTS_TABLE + '.id',\n USER_EVENTS_TABLE + '.event_id'\n )\n .groupBy(EVENTS_TABLE + '.id', USER_EVENTS_TABLE + '.event_id');\n\n var countQueryOpts = { trx: internalOpts.trx };\n var countQuery = serviceUtils.countQuery(queryBuilder, countQueryOpts);\n\n if (!internalOpts.disableLimit) {\n queryBuilder = queryBuilder.limit(opts.limit);\n }\n\n // Add wheres, offsets and sorts to query passed in params\n serviceUtils.addWheresToQuery(queryBuilder, whereObj, PUBLIC_TO_MODEL);\n queryBuilder = queryBuilder.offset(opts.offset);\n serviceUtils.addSortsToQuery(queryBuilder, opts.sort, PUBLIC_TO_MODEL);\n\n return countQuery.then(function(res) {\n var totalCount = Number(res[0].count);\n\n return queryBuilder.then(function(rows) {\n var data = _.map(rows, function(row) {\n var publicEventObj = Event_.prototype.parse(row);\n return formatEventSafe(publicEventObj, internalOpts);\n });\n\n return {\n // totalCount passed to x-total-count response header\n totalCount: totalCount,\n data: data\n };\n });\n });\n}", "getPublicEvent(event_id: number, callback) {\n super.query(\n 'SELECT e.*,DATE_FORMAT(e.end, \"%Y-%m-%d %H:%i\") as end_format, DATE_FORMAT(e.start, \"%Y-%m-%d %H:%i\") as start_format, l.address, l.name as location_name, l.postcode FROM event e LEFT JOIN location l ON l.location_id = e.location_id WHERE e.is_public IS TRUE AND e.event_id = ?',\n [event_id],\n callback,\n );\n }", "checkAvabilityScheduleExceptId(id, date, start, end) {\n const schedule = mysql_1.default.raw(`SELECT * FROM schedule WHERE date = \"${date}\" AND \n ((\"${start}\" BETWEEN start_time AND end_time) OR\n (\"${end}\" BETWEEN start_time AND end_time)) AND id <> ${id};`);\n return schedule;\n }", "function rejectEvent(feedRequest) {\n\n console.log(\"rejectEvent\");\n\n eventPointer = feedRequest.get(\"event\");\n\n var GroupEvent = Parse.Object.extend(\"GroupEvent\");\n var eventQuery = new Parse.Query(GroupEvent);\n\n eventQuery.get(eventPointer.id).then(function(theEvent){\n\n return theEvent.destroy();\n\n });\n\n} //end rejectEvent", "function grabEvent(id){\n for(var i in eventList){\n if(eventList[i][\"id\"] === id){\n return eventList[i];\n };\n };\n}", "function getSingleEvent(id) {\n return knex('events')\n .select('*')\n .where({ id: parseInt(id) });\n}", "onToggleGroup({ groupRecord, collapse }) {\n let store = this.scheduler.store,\n // First record in next group\n recordIndex = store.indexOf(groupRecord) + (collapse ? 1 : groupRecord.groupChildren.length);\n\n // Handle this group\n if (collapse) {\n // Collapsing -> events in the group will be hidden, remove them from cache\n groupRecord.groupChildren.forEach((child) => {\n this.cache.clearRow(child.id);\n });\n }\n\n // TODO: this should not need to loop til the end, since only events in view are drawn. will be costly with large amount of resources\n // Loop starting at the next group\n for (; recordIndex < store.count; recordIndex++) {\n this.cache.clearRow(store.getAt(recordIndex).id);\n }\n }", "[REMOVE_EVENT_FROM_CALENDAR_MUTATION](state, idToRemove) {\n state.eventsInCalendar = state.eventsInCalendar.filter( (event)=> {\n return event.id !== idToRemove;\n });\n }", "async function getEV() {\n let ev = await EVApi.getEV(id);\n setVersions(ev);\n }", "function getGroup(id) {\n for(var i = 0; i < groups.length; i++){\n var group = groups[i];\n if(group.id == id){\n return group;\n }\n }\n}", "ejectFromGroup() {\n let windowName = this.getWindowNameForDocking();\n routerClientInstance_1.default.query(\"DockingService.leaveGroup\", {\n name: windowName\n }, () => { });\n }", "async getAllActiveEvents() {\n const events = Event.find({ active: true }, () => {});\n return events;\n }", "removeInstances() {\n let selections = this.$store.getters.getSelections(\n this.qs_url.replace(/^\\/|\\/$/g, \"\"),\n );\n\n for(let id in selections) {\n if(!selections[id]) continue;\n for(let item in this.data.instances) {\n let instance = this.data.instances[item];\n if(id == instance.getPkValue()){\n instance.delete().then(response => {\n this.removeInstances_callback(instance, response);\n }).catch(error => {\n let str = app.error_handler.errorToString(error);\n\n let srt_to_show = pop_up_msg.instance.error.remove.format(\n [instance.getViewFieldValue(), this.view.schema.name, str],\n );\n\n app.error_handler.showError(srt_to_show, str);\n\n debugger;\n });\n }\n }\n }\n }", "function getQueuedEvents(calendar_id, endTimeDate){\n\n var calendar = CalendarApp.getCalendarById(calendar_id)\n var now = new Date();\n\n var raw_events = calendar.getEvents(endTimeDate, now); //gets all events that OCCURED between startimedate and now\n\n var res = []\n\n for(var i = 0; i < raw_events.length; i++){\n var title = raw_events[i].getTitle()\n if( ~ title.indexOf('STOPPED')) continue;\n if( !(~ title.indexOf('QUEUED'))) continue;\n if(raw_events[i].getEndTime().getTime() >= endTimeDate.getTime()) res.push(raw_events[i])\n }\n\n return res\n\n}", "fetchEvents() {\n this.events = undefined;\n\n this.PuppetDB.parseAndQuery('events',\n this.$location.search().query,\n this.createEventQuery(),\n {\n offset: this.$scope.perPage * ((this.$location.search().page || 1) - 1),\n limit: this.$scope.perPage,\n order_by: angular.toJson([{ field: 'timestamp', order: 'desc' }]),\n },\n (data, total) => {\n this.$scope.numItems = total;\n this.events = data;\n }\n );\n }" ]
[ "0.70782846", "0.7045974", "0.6984887", "0.69343823", "0.6912373", "0.5262535", "0.52316386", "0.5119974", "0.5064087", "0.5043418", "0.5043418", "0.5043418", "0.4945412", "0.49238515", "0.47870988", "0.47679257", "0.4758424", "0.46505588", "0.4594084", "0.45679685", "0.45670614", "0.45580894", "0.45361745", "0.45194164", "0.45110852", "0.45019394", "0.4498791", "0.44769207", "0.44769207", "0.43990076", "0.43980467", "0.43701744", "0.43607014", "0.4348427", "0.43416226", "0.43168554", "0.43128854", "0.4288842", "0.42754292", "0.42638165", "0.42636198", "0.42524412", "0.4248998", "0.4240183", "0.42357856", "0.422742", "0.42249563", "0.4218059", "0.4214499", "0.42092985", "0.42076376", "0.42045432", "0.42045432", "0.4193602", "0.4189777", "0.41887152", "0.41825613", "0.41825613", "0.41825613", "0.41825613", "0.41825613", "0.41825613", "0.41825613", "0.4177928", "0.41718715", "0.4171432", "0.41620606", "0.4139001", "0.41375247", "0.41367495", "0.41315025", "0.41181752", "0.4111917", "0.41101754", "0.41096362", "0.41075185", "0.41032273", "0.40996808", "0.4097948", "0.4095905", "0.40819713", "0.40786543", "0.40786543", "0.4069063", "0.40536776", "0.4045648", "0.4044556", "0.40322357", "0.402507", "0.4022907", "0.40193674", "0.40178427", "0.40176526", "0.40166783", "0.40105793", "0.39998242", "0.39961803", "0.39954808" ]
0.7002734
4
SIDEEFFECT: will mutate ranges. Will return a new array result.
function invertRanges(ranges, constraintRange) { var invertedRanges = []; var start = constraintRange.start; // the end of the previous range. the start of the new range var i; var dateRange; // ranges need to be in order. required for our date-walking algorithm ranges.sort(compareRanges); for (i = 0; i < ranges.length; i++) { dateRange = ranges[i]; // add the span of time before the event (if there is any) if (dateRange.start > start) { // compare millisecond time (skip any ambig logic) invertedRanges.push({ start: start, end: dateRange.start }); } if (dateRange.end > start) { start = dateRange.end; } } // add the span of time after the last event (if there is any) if (start < constraintRange.end) { // compare millisecond time (skip any ambig logic) invertedRanges.push({ start: start, end: constraintRange.end }); } return invertedRanges; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rangeArr(start, end) {\n if (start === end) return [];\n\n return ([start].concat(rangeArr(start + 1, end)));\n\n}", "function addArray(ranges) {\n var origRanges = ranges;\n var newRanges = [];\n var overlap = false;\n for (var i = 0; i < origRanges.length; i += 1) {\n for (var j = i + 1; j < origRanges.length; j++) {\n if (origRanges[i].overlaps(origRanges[j], {adjacent:true})) {\n overlap = true;\n newRanges.push(addTwo(origRanges[i], origRanges[j]));\n origRanges.splice(j, 1);\n origRanges.splice(i, 1);\n if (i!=0) { i--; j-=2;}\n else {j--;}\n }\n }\n }\n if (overlap) {\n return addArray(newRanges.concat(origRanges));\n } else {\n return origRanges;\n }\n}", "subtract(range) {\n if (range.low <= this.low && range.high >= this.high) {\n return [];\n } else if (range.low > this.low && range.high < this.high) {\n return [\n new SubRange(this.low, range.low - 1),\n new SubRange(range.high + 1, this.high)\n ];\n } else if (range.low <= this.low) {\n return [new SubRange(range.high + 1, this.high)];\n } else {\n return [new SubRange(this.low, range.low - 1)];\n }\n }", "subtract(range) {\n if (range.low <= (this || _global).low && range.high >= (this || _global).high) {\n return [];\n } else if (range.low > (this || _global).low && range.high < (this || _global).high) {\n return [new SubRange((this || _global).low, range.low - 1), new SubRange(range.high + 1, (this || _global).high)];\n } else if (range.low <= (this || _global).low) {\n return [new SubRange(range.high + 1, (this || _global).high)];\n } else {\n return [new SubRange((this || _global).low, range.low - 1)];\n }\n }", "function rangeArray(start, end, step = start < end ? 1 : -1){ // step argument changes how many numbers to skip each iteration. defaults to 1 if no argument is given. (see next line)\n// in this updated version, step will default to -1 if start > end. this is to ensure descending ranges are iterated correctly. \n if(start < end){ //this if-else discerns between ascending (start < end) and descending (start > end) ranges\n for (let i = start; i <= end; i+=step) { // this for-loop is for ranges where start < end\n theArray.push(i); // add resulting number to theArray\n //console.log(...theArray); // this prints all values currently in theArray\n }}else\n if(start > end){\n for (let i = start; i >= end; i+=step) { // this for-loop is for ranges where start > end\n theArray.push(i); // add resulting number to theArray\n //console.log(...theArray); // this prints all values currently in theArray\n };\n };\n return theArray; \n}", "function ranges(array){\n const ranges = [];\n let rangeIndex = 0;\n ranges.push(new Range(array[0]));\n for(let i = 1; i < array.length; i++){\n const current = array[i];\n const currentRange = ranges[rangeIndex];\n const wasPushed = currentRange.tryPush(current);\n if(!wasPushed){\n rangeIndex++;\n ranges.push(new Range(current));\n }\n }\n return ranges;\n}", "function myRange(start, end) {\n let range = [];\n for (var i = start; i < end; i++) {\n range.push(i);\n }\n range.push(end);\n console.log(range);\n}", "function rangeArray(start, end) {\n var arr = []\n for (var i=start; i <= end; i++) {\n\tarr.push(i)\n }\n return arr\n}", "function getRange(array, start, end) {\n const ret = [];\n if (start <= array.length && start <= end) {\n for (let i = start - 1; i < end; i++) {\n ret.push(array[i]);\n }\n }\n return ret;\n}", "function range(start, end) {\n rangeArr = [];\n for(var i = start; i <= end; i++) {\n rangeArr.push(i);\n }\n return rangeArr;\n}", "function range(start, end) {\n if (start >= end) {\n return [];\n } else {\n return [start].concat(range(start + 1, end));\n }\n}", "function range(min,max)\n{\n var output = [];\n return rangeRec(min,max,output);\n}", "function filterRange(arr, min, max) {\n for (var i = 0; i < arr.length - 1; i++) {\n if (arr[i] < min || arr[i] > max) {\n for (var j = i + 1; j<arr.length; j++) {\n arr[j - 1] = arr[j]\n }\n arr.length--;\n i--;\n }\n }\n console.log(arr)\n}", "function range(start,end) {\n\n const resultArray=[];\n const arraySize = Math.abs(end - start) + 1;\n\n for (let i=0 ; i<arraySize ; i++) {\n\n if (start<end) {\n resultArray.push(start+i);\n } else {\n resultArray.push(start-i);\n }\n \n }\n console.log(resultArray);\n return resultArray;\n}", "function range(start, end, step=1) {\n // Your code here\n var array = [];\n var x = 0;\n \n if(step<0){\n for (var i = start; i >= end; i += step){\n array[x] = i;\n x++;\n }\n }else{\n for (var i = start; i <= end; i += step){\n array[x] = i;\n x++;\n }\n}\n \n return array;\n \n}", "toArray() {\n let array = []\n for (let tmp = this.min; tmp <= this.max; tmp = this._next(tmp))\n array.push(tmp);\n return array;\n }", "function create_array_range()\n{\n\tarr = [];\n\n\tfor (i=0; i<10; i++)\n\t{\n\t arr.push(Math.floor((Math.random() * 110) -10));\n\t}\n\tconsole.log(\"This is array 1 [\" + arr + \"]\");\n\treturn arr;\n}", "function range (startNumber, endNumber) {\n const range2 = [];\n if (startNumber < endNumber) {\n for (let i = startNumber; i <= endNumber; i++) {\n range2.push(i);\n }\n } else {\n for (let i = startNumber; i >= endNumber; i--) {\n range2.push(i);\n }\n }\n return range2;\n}", "function range(start, end) {\n if (start +1 >= end) {\n return [];\n }\n return (range(start, end-1).concat([end-1]));\n}", "function createArrayFromAtoB(start, end){\n var range = [];\n while (start <= end){\n range.push(start);\n start ++;\n }\n return range;\n}", "function range(start,end){\r\n\t\tvar foo = [];\r\n\t\tfor (i = start; i < end; i++) {\r\n\t\t\tfoo.push(i);\r\n\t\t}\r\n\t\treturn foo;\r\n\t}", "function range(start, end){\n let arr = [start];\n if(start >= end){return start};\n return arr.concat(range(start+1, end));\n }", "function range(start, end) {\n let nums = [];\n for (let i = start; i < end; i++) {\n nums.unshift(i);\n }\n return nums;\n }", "function range(start, end, step) {\n var array = [];\n\n if (start < end) {\n for (var i = start; i <= end; i += step) {\n array.push(i);\n }\n } else {\n for (var i = start; i >= end; i += step) {\n array.push(i);\n }\n }\n console.log(array);\n return array;\n}", "function getRange(m, mx){\r\n let arrRange= []\r\n for(let i = min; i<=max; i++){\r\n arrRange.push(i)\r\n }\r\nreturn arrRange\r\n }", "static _mergeRanges(ranges, newRange) {\n let inRange = false;\n for (let i = 0; i < ranges.length; i++) {\n const range = ranges[i];\n if (!inRange) {\n if (newRange[1] <= range[0]) {\n // Case 1: New range is before the search range\n ranges.splice(i, 0, newRange);\n return ranges;\n }\n if (newRange[1] <= range[1]) {\n // Case 2: New range is either wholly contained within the\n // search range or overlaps with the front of it\n range[0] = Math.min(newRange[0], range[0]);\n return ranges;\n }\n if (newRange[0] < range[1]) {\n // Case 3: New range either wholly contains the search range\n // or overlaps with the end of it\n range[0] = Math.min(newRange[0], range[0]);\n inRange = true;\n }\n // Case 4: New range starts after the search range\n continue;\n }\n else {\n if (newRange[1] <= range[0]) {\n // Case 5: New range extends from previous range but doesn't\n // reach the current one\n ranges[i - 1][1] = newRange[1];\n return ranges;\n }\n if (newRange[1] <= range[1]) {\n // Case 6: New range extends from prvious range into the\n // current range\n ranges[i - 1][1] = Math.max(newRange[1], range[1]);\n ranges.splice(i, 1);\n return ranges;\n }\n // Case 7: New range extends from previous range past the\n // end of the current range\n ranges.splice(i, 1);\n i--;\n }\n }\n if (inRange) {\n // Case 8: New range extends past the last existing range\n ranges[ranges.length - 1][1] = newRange[1];\n }\n else {\n // Case 9: New range starts after the last existing range\n ranges.push(newRange);\n }\n return ranges;\n }", "function range(start, end) {\n let r = [];\n for (let i = start; i < end; i++) {\n r.push(i);\n }\n return r;\n}", "function createRange(start, end) {\n const range = Array.from({ length: end - start + 1 }, function(item, index) {\n return index + start;\n });\n return range;\n}", "function range(start, end) {\r\n\tif (end === undefined) {\r\n\t\tend = start;\r\n\t\tstart = 0;\r\n\t}\r\n\tlet res = []; //newArray(end-start,0);\r\n\tstart = start | 0;\r\n\tfor (let i = start; i < end; i++) res.push(i);\r\n\treturn res;\r\n}", "range(_start, _end) {\n var result = []\n for (let i=_start; i<=_end; i++){\n result.push(i)\n }\n return result\n }", "function filterRange(arr, minValue, maxValue) {\n\tvar newArr = [];\n\n\tfor(var index = 0; index < arr.length; index++) {\n\t\tif(arr[index] >= minValue && arr[index] <= maxValue) {\n\t\t\tnewArr.push(arr[index]);\n\t\t}\n\t}\n\n\treturn newArr;\n}", "getRange(start, end) {\n return Array.from(\n {\n length: (parseInt(end, 10) + 1) - parseInt(start, 10)\n },\n (v, k) => k + parseInt(start, 10)\n );\n }", "function getActiveRange(length, array) {\n var range = [];\n for (var i=0; i < length; i++) {\n range.push(array[i]);\n }\n return range;\n }", "function genRange(start, end) {\n var range = [];\n while (start <= end) {\n range.push(start);\n start += 1;\n }\n return range;\n }", "function range(start, end) {\n\t if (end === undefined) {\n\t end = start;\n\t start = 0;\n\t }\n\t let res = []; //newArray(end-start,0);\n\t start = start | 0;\n\t for (let i = start; i < end; i++) res.push(i);\n\t return res;\n\t}", "function range(start, end) {\n var foo = [];\n for (var i = start; i <= end; i++) {\n foo.push(i);\n }\n return foo;\n}", "function range(start, end) {\n // YOUR CODE GOES BELOW HERE //\n // create an Array literal that we can push into\n let myArr = [];\n \n // make an iff statement that says if the start is less than the end\n if(start < end){\n // then we loop, starting at the start, and ending at the end, increment up\n for(let i = start; i <= end; i++){\n // push i at each iteration into our Array literal\n myArr.push(i);\n // finally return it. \n } return myArr;\n } else {\n // same down here we just flip the greater than or equal sign with end\n for (let i = start; i >= end; i--){\n myArr.push(i);\n } return myArr;\n }\n \n \n // YOUR CODE GOES ABOVE HERE //\n}", "function range(lo: number, hi: number): Array<number> {\n let a = new Array(hi - lo);\n a.fill(1);\n return a.map((e, i) => lo + i);\n}", "function range(start, end, step = 1) {\n // Your code here\n var array = [];\n\n if (step > 0) {\n for (var i = start; i <= end; i += step) array.push(i);\n } else {\n for (var i = start; i >= end; i += step) array.push(i);\n }\n return array;\n}", "function mapWithoutIndex(range){return{start:range.start,end:range.end};}", "function computeRange(samples) {\r\n // slice() is a hack for cloning\r\n var lowerBound = samples[0].slice();\r\n var upperBound = samples[0].slice();\r\n $.each(samples, function (index, value) {\r\n lowerBound = binaryMap(Math.min, lowerBound, value);\r\n upperBound = binaryMap(Math.max, upperBound, value);\r\n });\r\n var ranges = [];\r\n $.each(lowerBound, function (index, value) {\r\n ranges.push([value, upperBound[index]]);\r\n });\r\n return ranges;\r\n}", "calc_range() {\n let z = this.zoom / this.drug.z\n let zk = (1 / z - 1) / 2\n\n let range = this.y_range.slice()\n let delta = range[0] - range[1]\n range[0] = range[0] + delta * zk\n range[1] = range[1] - delta * zk\n\n return range\n }", "function range(start, end, inc=1) {\n var array = [];\n if(start <= end){\n for (var i=start; i<= end; i+= inc){\n array.push(i);\n }\n }\n else{\n for(var x = start; x>= end; x-=inc){\n array.push(x);\n }\n }\n return array;\n}", "function range (start,end, step = 1){\n var array =[];\n if(start < end){\n for(var i=start; i<=end; i = i + step){\n array.push(i);\n }\n return array;\n }\n else {\n for (var j = start; j>=end; j = j + step){\n array.push(j);\n }\n return array;\n }\n}", "static range(min, max){\n\n let l = [];\n for(let i=min; i < max; i++) l.push(i);\n return l;\n\n }", "function extendRange(range_arr, extend_coef) {\n var max = range_arr[1];\n var min = range_arr[0];\n max = max + Math.abs(max) * extend_coef;\n min = min - Math.abs(min) * extend_coef;\n var extended_arr = [min, max];\n return extended_arr;\n\n}", "addRange(high, low, mid) {\n this.range.push({\n 'high': high,\n 'low': low,\n 'mid': mid,\n })\n //return this.range\n }", "function range(start, end) {\n // YOUR CODE GOES BELOW HERE //\n //first i am going to make an array to hold the numbers .pushed into it for the range function\n var rangeArray = [];\n //here i am making a loop that will decide in which order the number will be returned \n \n if(start < end){\n for(var i = start; i <= end; i++){\n rangeArray.push(i);\n }\n }else{\n for(var i = start; i >= end; i--){\n rangeArray.push(i);\n }\n }\n // i am returning range array so that it will hold the new output data\n return (rangeArray); \n \n \n // YOUR CODE GOES ABOVE HERE //\n}", "function range(start, end, step) {\n \n\n if (start < end) {\n for (let i = start; i <= end; i += step) {\n array.push(i);\n }\n }\n else if (start > end) {\n for (let i = start; i >= end; i -= step) {\n array.push(i);\n }\n }\n return array;\n}", "function range(start,end)\n{\n let resultat=[];\n if (end >= start) {\n for (let i=start;i <= end;i++) {\n resultat.push(i);\n }\n return resultat;\n }\n if (start > end) {\n for (let i=start;i >= end;i--) {\n resultat.push(i);\n }\n return resultat;\n }\n}", "function range(start, end) {\n // YOUR CODE GOES BELOW HERE //\n // declaring and assigning the variable range to an empty array\n let range = [];\n \n // conditional statement that runs if start is less than end parameter\n if(start < end) {\n \n /** for loop that initialzies i as the starting number and will iterate\n * by 1 each time i is less than or equal to end */\n for(var i = start; i <= end; i++) {\n // using push method to push i to range array each time loop runs\n range.push(i);\n }\n // conditional else that runs if start is greater than end\n } else {\n /** for loop that initialzies i as the start number and will iterate\n * by 1 each time i is greater than or equal to end */\n for(var i = start; i >= end; i--) {\n // using push method to push i to range array each time loop runs\n range.push(i)\n }\n // returning range array\n } return range\n \n // YOUR CODE GOES ABOVE HERE //\n}", "function filterRange(arr,min,max){\n var i=0;\n while (i < arr.length){\n if (arr[i] > min && arr[i] < max){\n for (var j = i; j < arr.length-1; j++){\n arr[j] = arr[j+1];\n }\n i--;\n arr.length--;\n }\n i++;\n }\n return arr\n}", "function range(x, y, result = []) {\r\n let min = Math.min(x, y);\r\n let max = Math.max(x, y);\r\n if (min === max) {\r\n result.push(min);\r\n return result;\r\n }\r\n result.push(min);\r\n min++;\r\n return range(min, max, result);\r\n}", "function rangei(start,end){\n return Array(end - start + 1).fill().map((_, idx) => start + idx)\n\n // var list = [];\n // for (var i = lowEnd; i <= highEnd; i++) {\n // list.push(i);\n // return list\n}", "function range(start, stop) {\n let rangeArr = [];\n\n while (start <= stop) {\n rangeArr.push(start);\n start++;\n }\n return rangeArr;\n }", "function combineRanges(ranges){var ordered=ranges.map(mapWithIndex).sort(sortByRangeStart);for(var j=0,i=1;i<ordered.length;i++){var range=ordered[i];var current=ordered[j];if(range.start>current.end+1){// next range\nordered[++j]=range;}else if(range.end>current.end){// extend range\ncurrent.end=range.end;current.index=Math.min(current.index,range.index);}}// trim ordered array\nordered.length=j+1;// generate combined range\nvar combined=ordered.sort(sortByRangeIndex).map(mapWithoutIndex);// copy ranges type\ncombined.type=ranges.type;return combined;}", "function range(start, end) {\n\tvar arr = [];\n\tfor (let i = start; i <= end; i++) {\n\t\tarr.push(i);\n\t}\n\treturn arr;\n}", "function range() {\n\tvar beg = arguments[0];\n\tvar end = arguments[1];\n\tvar num = [];\n\tfor(var i = beg; i <= end; i++) {\n\t\tnum.push(i);\n\t}\n\treturn num;\n}", "function rangeRover(arr) { \n let min = Math.min(arr[0], arr[1]), max = Math.max(arr[0], arr[1]);\n //th\n // let emptyArr = [];\n // return (max - min +1) * (max + min)/2;\n let sum = max;\n for (var i = min; i < max; i++) {\n sum += i;\n }\n return sum;\n}", "range(min, max) {\n if (max < min) { return []; }\n let arr = [];\n\n for (let i = min; i <= max; i++) {\n arr.push(i);\n }\n\n return arr;\n }", "function range(start, end, step=1){\n\tlet ret_array = [];\n\tif(start-end>0){\n\t\tfor(let i=start; i>end-1; i+=step){\n\t\t\tret_array.push(i);\n\t\t}\n\t}\n\tfor(let i=start; i<end+1; i+=step){\n\t\tret_array.push(i);\n\t}\n\treturn ret_array;\n}", "static range(min, max){\n \n let l = [];\n for(let i=min; i < max; i++) l.push(i);\n return l;\n \n }", "function range(start, end) {\n var arr = [];\n for (var i = start; i <= end; i++) {\n arr.push(i);\n }\n return arr;\n}", "function range(lowEnd, highEnd){\n var arr = [],\n c = highEnd - lowEnd + 1;\n while ( c-- ) { arr[c] = highEnd-- ; }\n return arr;\n}", "function arrayFromRange(min, max) {\r\n let range = [];\r\n while (min <= max) {\r\n range.push(min);\r\n min++;\r\n }\r\n return range;\r\n}", "function mergeRange(ranges, newRangeStart, newRangeEnd) {\n let inRange = false;\n for (let i = 0; i < ranges.length; i++) {\n const range = ranges[i];\n if (!inRange) {\n if (newRangeEnd <= range[0]) {\n // Case 1: New range is before the search range\n ranges.splice(i, 0, [newRangeStart, newRangeEnd]);\n return ranges;\n }\n else if (newRangeEnd <= range[1]) {\n // Case 2: New range is either wholly contained within the\n // search range or overlaps with the front of it\n range[0] = Math.min(newRangeStart, range[0]);\n return ranges;\n }\n else if (newRangeStart < range[1]) {\n // Case 3: New range either wholly contains the search range\n // or overlaps with the end of it\n range[0] = Math.min(newRangeStart, range[0]);\n inRange = true;\n }\n else {\n // Case 4: New range starts after the search range\n continue;\n }\n }\n else {\n if (newRangeEnd <= range[0]) {\n // Case 5: New range extends from previous range but doesn't\n // reach the current one\n ranges[i - 1][1] = newRangeEnd;\n return ranges;\n }\n else if (newRangeEnd <= range[1]) {\n // Case 6: New range extends from prvious range into the\n // current range\n ranges[i - 1][1] = Math.max(newRangeEnd, range[1]);\n ranges.splice(i, 1);\n inRange = false;\n return ranges;\n }\n else {\n // Case 7: New range extends from previous range past the\n // end of the current range\n ranges.splice(i, 1);\n i--;\n }\n }\n }\n if (inRange) {\n // Case 8: New range extends past the last existing range\n ranges[ranges.length - 1][1] = newRangeEnd;\n }\n else {\n // Case 9: New range starts after the last existing range\n ranges.push([newRangeStart, newRangeEnd]);\n }\n return ranges;\n}", "function range(start, end = -1) {\n\n if (end == -1) {\n end = start;\n start = 0;\n }\n\n let range = [];\n\n for (let element = start; element <= end; element++) {\n range.push(element);\n }\n\n return range;\n}", "function range(start, end, step=1) {\n // Your code here\n var final_arr = [];\n if (step == 0) {\n return \"The range cannot have intervals of zero\";\n }\n else if (step < 0) {\n for (var i = start; i >= end; i += step) {\n final_arr.push(i);\n }\n }\n else {\n for (var i = start; i <= end; i += step) {\n final_arr.push(i);\n }\n } \n return final_arr;\n}", "function range(start, end) {\n return Array(end - start + 1).fill().map((_, idx) => start + idx)\n}", "function makeRange() {\n var result = {}\n /*\n year: 2015,\n month: [3, 4],\n days: [[30, 31], [1,2,3,4,5,6]],\n */\n ;\n\n var startDate = new Date($scope.range.start);\n var endDate = new Date($scope.range.end);\n\n var yearNum = startDate.getFullYear();\n\n var startDay = startDate.getDate();\n var endDay = endDate.getDate();\n\n\n var startMonthNum = (startDate.getMonth() + 1);\n var endMonthNum = (endDate.getMonth() + 1);\n\n var daysInStartDate = new Date(yearNum, startMonthNum, 0).getDate();\n\n //define month array\n console.log(startMonthNum + ' - ' + endMonthNum);\n if(startMonthNum === endMonthNum) {\n month = [startMonthNum, null];\n } else {\n month = [startMonthNum, endMonthNum];\n }\n\n //define days array\n var days = [[],[]];\n\n if(month[1] === null) {\n for(var i = startDay; i <= endDay; i++) {\n days[0].push(i);\n }\n\n days[1] = null;\n } else {\n for(var i = startDay; i <= daysInStartDate; i++) {\n days[0].push(i);\n }\n\n for(var j = 1; j <= endDay; j++){\n days[1].push(j);\n }\n }\n\n result.year = yearNum;\n result.month = month;\n result.days = days;\n\n return result;\n }", "function spread(arr, space=labelsSpace, start=-height, end=0) {\n start += space / 2\n end -= space / 2\n let result = []\n arr.forEach((pos, i) => {\n let min = start + i * space\n let max = end - (arr.length - (i + 1)) * space\n //limits.push([lower,higher])\n \n if (i != 0){\n let pillow = pos - result[i - 1] - space\n pos = pillow < 0 ? pos - (-pillow) : pos\n }\n\n if (pos < min)\n result.push(min)\n else if (pos > max)\n result.push(max)\n else\n result.push(pos)\n })\n return result\n }", "function range(first, last){\n var ans = [first];\n while(first != last){\n ans.push[first+1];\n first += 1;\n }\n return ans;\n}", "function clipRange(range, min, max) {\n return range\n .filter(segment => segment[1] >= min && segment[0] <= max)\n .map(segment => [Math.max(segment[0], min), Math.min(segment[1], max)]);\n}", "function rangeWithStep(start, end, inc) {\n step = inc || 1;\n rangeArray = [];\n if (step > 0) {\n for (i = start; i <= end; i += step) {\n rangeArray.push(i);\n }\n }\n else {\n for (i = start; i >= end; i += step) {\n rangeArray.push(i);\n }\n }\n return rangeArray;\n}", "function generateRange(min, max, step){\n //varible declaration named narray set empty\n let narray = [];\n //for loop let i assigned to min; i less or \n //equal to max; i plus equals step\n for(let i = min; i <= max; i += step){\n //narray push method with i as parameter\n narray.push(i)\n }\n //return narray;\n return narray;\n }", "range(start, end, step = 1) {\n let res = [];\n\n if(step > 0) {\n for(let i=start; i <= end; i+=step) {\n res.push(i);\n }\n } else {\n for(let i=start; i >= end; i+=step) {\n res.push(i);\n }\n }\n\n return res;\n }", "function range(start, end) {\n var array = [];\n for (i = start; i <= end; i++) {\n array.push(i);\n }\n console.log(array);\n}", "convertRange(oldMin, oldMax, newMin, newMax, oldValue) {\n return (((oldValue - oldMin) * (newMax - newMin)) / (oldMax - oldMin)) + newMin;\n }", "function getRange() {\n let numberArray = [];\n for (let index = 1; index <= 100; index++) {\n numberArray.push(index);\n }\n\n return numberArray;\n}", "function range(startNum, endNum)\t{ \n\tlet arr = [];\n\t for (let i = startNum +1; i < endNum; i++)\n\t arr.push(i)\n\t return arr;\n}", "function range(start, end) {\n let numArray = [];\n for (let i = start; i <= end; i++) {\n numArray.push(i);\n }\n return numArray;\n}", "function filterRangeInPlace(array, from, to) {\r\n for (var i = 0; i < array.length; i++) {\r\n if ((from > array[i]) || (array[i] > to)) {\r\n var index = array.indexOf(array[i]);\r\n array.splice(index, 1);\r\n }\r\n }\r\n return array;\r\n}", "function opgave7(start, end){\n var arrayen = [];\n while(start<end){\n arrayen.push(start);\n start++;\n }\n arrayen.push(start);\n return arrayen;\n \n}", "function createRange(end) {\n if (end === 0) {\n return [];\n }\n var results = [];\n var current = 1;\n var step = 0 <= end ? 1 : -1;\n\n results.push(current);\n\n while (current !== end) {\n current += step;\n results.push(current);\n }\n\n return results;\n}", "function rango(start, end, step=1) {\n let rangoFinal = [];\n if (start > end) {\n for (let x = start; x >= end ; x = (x - step)) {\n rangoFinal.push(x);\n }\n } else {\n for (let i = start; i <= end; i += step) {\n rangoFinal.push(i);\n }\n }\n return rangoFinal;\n }", "function range (from, to) {\n return Array.from(Array(to), (_, i) => from + i)\n}", "function range(start, end, step) {\n var array = [];\n step = typeof step !== 'undefined' ? step : 1;\n if (start < end) {\n for (i = start; i <= end; i += step) {\n array.push(i);\n }\n }\n if (start > end) {\n for (i = start; i >= end; i += step) {\n array.push(i);\n }\n }\n console.log(array);\n}", "function range(start, end){\n // your code here...\n let sequentialArr = []; // nice use of let, we won't be using it in bootcamp prep,\n // but you are free to use it in your code. However,\n // perhaps be consistent, you use `let` some places and `var` other places -AZ\n if (start > end) { // this condition is not needed -AZ\n return sequentialArr;\n }else {\n // missing indentation below\n for (var i = start; i <= end; i++) {\n sequentialArr.push(i) // missing semicolon -AZ\n }\n }\n return sequentialArr;\n}", "function range(start, end) {\n return Array.apply(null, Array(end-start)).map(function (_, i) {return i + start;})\n}", "function createIntervals(data) {\n var newArr = [];\n var start = Math.min(...data);\n var end = 0;\n var max = Math.max(...data);\n var i = start;\n while (i <= max) {\n //find end of interval\n while ( data.includes(i + 1) && i <= max) {\n i++;\n }\n end = i;\n newArr.push([start, end]);\n i++;\n //find new start\n while ( !data.includes(i) && i <= max ) {\n i++;\n }\n start = i;\n }\n return newArr;\n}", "function arrayRange(num1=0,num2=10){\n //inclusive\n var array=[];\n if(num1<num2)\n {\n for(var i=num1;i<=num2;i++)\n {\n array.push(i);\n }\n }\n return array;\n}", "function range(start, end)\n{\n if (arguments.length == 1) {\n var end = start;\n start = 0;\n }\n \n var r = [];\n if (start < end) {\n while (start != end)\n r.push(start++);\n }\n else {\n while (start != end)\n r.push(start--);\n }\n return r;\n}", "function range(start, end, step=1) {\n // Your code here\n var numRange = [];\n if(start <= end) {\n \n for(var i = start; i <= end; i+=step) {\n numRange.push(i);\n }\n }\n else {\n for(var j = start; j >= end; j+=step){\n numRange.push(j);\n }\n }\n return numRange;\n}", "function range(from) {\n return function(to) {\n var result = [];\n for (var n = from; n < to; n += 1) result.push (n);\n return result;\n };\n }", "function arrayFromLowtoHigh(low, high) {\nvar array = []\n for (let i = low; i <= high; i++) {\n array.push(i)\n }\n return array\n}", "function arrayFromRange(min, max) {\n // your code\n}", "function removeRange(ranges, range) {\n const newRange = ranges.filter(r => !_.isEqual(r, range));\n if (newRange.length === 0) {\n return [{\n from: null,\n to: null,\n }];\n }\n return newRange;\n }", "function Range() {}", "function range(start, end, step=1) {\n let values = [];\n\n if (end > start) {\n for(let i = start; i < end; i += step) {\n values.push(i);\n }\n } else {\n for(let i = start; i > end; i += step) {\n values.push(i);\n }\n }\n\n return values;\n }", "function applySlice(array, start, end) {\n\t// create a sliceOfArray variable\n\tlet sliceOfArray;\n\t// assign it to a portion of the array from before start, up to, but not including end\n\tsliceOfArray = array.slice(start, end);\n\t// return the sliceOfArray variable\n\treturn sliceOfArray;\n}", "function range(array){\n return [...array.keys()];\n}" ]
[ "0.72443277", "0.70423394", "0.69378763", "0.69124013", "0.67867565", "0.6784122", "0.6778448", "0.67751783", "0.6754953", "0.67325306", "0.6716926", "0.6714848", "0.67017925", "0.6695746", "0.66920924", "0.66432124", "0.66388494", "0.6626336", "0.6597729", "0.6596321", "0.6578775", "0.6550963", "0.654248", "0.65382254", "0.6525335", "0.6506166", "0.6505049", "0.6502757", "0.64999044", "0.6496177", "0.6494356", "0.6488092", "0.64862543", "0.6480561", "0.6473826", "0.64726263", "0.6472288", "0.64659387", "0.6454002", "0.6453897", "0.6451093", "0.6447352", "0.6434211", "0.6430451", "0.6429619", "0.6427541", "0.64130276", "0.6411016", "0.64103353", "0.64000136", "0.63980496", "0.63945466", "0.6385249", "0.63632846", "0.63571465", "0.63394225", "0.63349175", "0.63249856", "0.6323675", "0.6320846", "0.63197285", "0.63083756", "0.6306216", "0.6296074", "0.62878597", "0.62873346", "0.62796086", "0.62753403", "0.6262071", "0.62548006", "0.62382", "0.62259805", "0.6221629", "0.6210614", "0.62104446", "0.6209819", "0.6203809", "0.619814", "0.6192289", "0.61895996", "0.61888236", "0.6185155", "0.61783266", "0.61731046", "0.61500806", "0.6126986", "0.6121282", "0.6120949", "0.6116806", "0.6116458", "0.6115028", "0.61019677", "0.6100125", "0.6094462", "0.6084981", "0.6084442", "0.60723853", "0.6068128", "0.6066689", "0.6060815", "0.605178" ]
0.0
-1
If the given date is not within the given range, move it inside. (If it's past the end, make it one millisecond before the end).
function constrainMarkerToRange(date, range) { if (range.start != null && date < range.start) { return range.start; } if (range.end != null && date >= range.end) { return new Date(range.end.valueOf() - 1); } return date; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveFwd() {\r\n var d1 = new Date($(\"#date1\").val())\r\n var d2 = new Date($(\"#date2\").val())\r\n var span = (d2 - d1)/(24*3600*1000);\r\nconsole.log(\"move forward:\", span);\r\n $(\"#date1\").val($(\"#date2\").val());\r\n //$(\"#date2\").val(new Date(d2.getTime()+span).toISOString().split('T')[0]);\r\n setEndRange(d2, span);\r\n //timelineType();\r\n}", "function constrainMarkerToRange(date, range) {\n if (range.start != null && date < range.start) {\n return range.start;\n }\n\n if (range.end != null && date >= range.end) {\n return new Date(range.end.valueOf() - 1);\n }\n\n return date;\n }", "function constrainMarkerToRange(date, range) {\n if (range.start != null && date < range.start) {\n return range.start;\n }\n\n if (range.end != null && date >= range.end) {\n return new Date(range.end.valueOf() - 1);\n }\n\n return date;\n }", "function constrainMarkerToRange(date, range) {\n if (range.start != null && date < range.start) {\n return range.start;\n }\n if (range.end != null && date >= range.end) {\n return new Date(range.end.valueOf() - 1);\n }\n return date;\n}", "function constrainMarkerToRange$1(date, range) {\n if (range.start != null && date < range.start) {\n return range.start;\n }\n if (range.end != null && date >= range.end) {\n return new Date(range.end.valueOf() - 1);\n }\n return date;\n }", "function constrainDate(date, range) {\n\tdate = date.clone();\n\n\tif (range.start) {\n\t\tdate = maxMoment(date, range.start);\n\t}\n\n\tif (range.end && date >= range.end) {\n\t\tdate = range.end.clone().subtract(1);\n\t}\n\n\treturn date;\n}", "function constrainDate(date, range) {\n\tdate = date.clone();\n\n\tif (range.start) {\n\t\tdate = maxMoment(date, range.start);\n\t}\n\n\tif (range.end && date >= range.end) {\n\t\tdate = range.end.clone().subtract(1);\n\t}\n\n\treturn date;\n}", "function constrainDate(date, range) {\n\tdate = date.clone();\n\n\tif (range.start) {\n\t\tdate = maxMoment(date, range.start);\n\t}\n\n\tif (range.end && date >= range.end) {\n\t\tdate = range.end.clone().subtract(1);\n\t}\n\n\treturn date;\n}", "function moveBack() {\r\n var d1 = new Date($(\"#date1\").val())\r\n var d2 = new Date($(\"#date2\").val())\r\n var span = (d2 - d1)/(24*3600*1000);\r\nconsole.log(\"move back:\", span, d1);\r\n $(\"#date2\").val($(\"#date1\").val());\r\n setStartRange(d1, span);\r\n //timelineType();\r\n}", "function limitMoveLeft(task, limit){\n var dur = task.end_date - task.start_date;\n task.end_date = new Date(limit.end_date);\n task.start_date = new Date(+task.end_date - dur);\n}", "function move2Now() {\r\n var now = new Date();\r\n //var nowBuff = new Date(now.getTime() + (24*3600*1000));\r\n///Set to tomorrow so it includes all of today\r\n //$(\"#date2\").val(now.toISOString().split('T')[0]);\r\n $(\"#date2\").val(momentLA_Date(now));\r\n setStartRange(now, $(\"#qryRangeDD\").val()); \r\n $('#fwd').addClass('disabled');\r\n $('#fwdEnd').addClass('disabled');\r\n //timelineType();\r\n}", "function insertAt(events, newEventDate) {\n var minIndex = 0;\n var maxIndex = events.length-1;\n var currentIndex = parseInt((minIndex + maxIndex)/2);\n var currentElement = events[currentIndex];\n\n while (minIndex <= maxIndex) {\n var currentElementDate = new Date(currentElement.year, \n currentElement.month-1, \n currentElement.day-1);\n if (currentIndex === events.length-1) {\n if (currentElementDate.getTime() <= newEventDate.getTime()) {\n return events.length;\n }\n }\n if (currentIndex === 0) {\n if (currentElementDate.getTime() >= newEventDate.getTime()) {\n return 0;\n }\n }\n\n var nextElementDate = new Date(events[currentIndex+1].year, \n events[currentIndex+1].month-1, \n events[currentIndex+1].day-1);\n if(currentElementDate.getTime() >= newEventDate.getTime()) {\n maxIndex = currentIndex;\n currentIndex = parseInt((minIndex + maxIndex)/2)\n currentElement = events[currentIndex];\n } else if(nextElementDate.getTime() < newEventDate.getTime()) {\n minIndex = currentIndex+1;\n currentIndex = parseInt((minIndex + maxIndex)/2);\n currentElement = events[currentIndex]; \n } else {\n // Since the currentElements time is before the new event\n // and the next events time is after the new event\n // we want to insert the new event right in between\n return currentIndex+1;\n }\n }\n console.log(\"here3\");\n return currentIndex;\n}", "moveToCover(min, max) {\r\n let delta = DateTimeSequence.getDelta(min, max, this.unit);\r\n let count = Math.floor(delta / this.interval);\r\n this.min = DateTimeSequence.ADD_INTERVAL(this.min, count * this.interval, this.unit);\r\n this.sequence = [];\r\n this.sequence.push(this.min);\r\n this.max = this.min;\r\n while (this.max < max) {\r\n this.max = DateTimeSequence.ADD_INTERVAL(this.max, this.interval, this.unit);\r\n this.sequence.push(this.max);\r\n }\r\n }", "function move2Latest() {\r\nconsole.log('move2Latest:', sensorEndDate);\r\n //$(\"#date2\").val(new Date(sensorEndDate).toISOString().split('T')[0]); //DAY AFTER\r\n setEndRange(new Date(sensorEndDate), 0);\r\n setStartRange(new Date(sensorEndDate), $(\"#qryRangeDD\").val());\r\n $('#fwd').addClass('disabled');\r\n $('#fwdEnd').addClass('disabled');\r\n //timelineType();\r\n}", "function moveOneDay(date) {date.setTime((date.getTime() + 24 * 60 * 60 * 1000)); }", "dateChange(){\n if (this.date.start.getTime() > this.date.end.getTime())\n this.date.end = this.date.start;\n }", "function restrictPassedDate(){\n let date = new Date(),\n day = date.getDate(),\n month = date.getMonth()+1,\n year = date.getFullYear();\n if(day < 10){\n day = `0${day}`;\n }\n if(month < 10){\n month = `0${month}`;\n }\n dateStart.min = `${year}-${month}-${day}`;\n dateEnd.min = `${year}-${month}-${day}`;\n}", "function constrainRange(innerRange, outerRange) {\n\tinnerRange = cloneRange(innerRange);\n\n\tif (outerRange.start) {\n\t\t// needs to be inclusively before outerRange's end\n\t\tinnerRange.start = constrainDate(innerRange.start, outerRange);\n\t}\n\n\tif (outerRange.end) {\n\t\tinnerRange.end = minMoment(innerRange.end, outerRange.end);\n\t}\n\n\treturn innerRange;\n}", "function constrainRange(innerRange, outerRange) {\n\tinnerRange = cloneRange(innerRange);\n\n\tif (outerRange.start) {\n\t\t// needs to be inclusively before outerRange's end\n\t\tinnerRange.start = constrainDate(innerRange.start, outerRange);\n\t}\n\n\tif (outerRange.end) {\n\t\tinnerRange.end = minMoment(innerRange.end, outerRange.end);\n\t}\n\n\treturn innerRange;\n}", "function constrainRange(innerRange, outerRange) {\n\tinnerRange = cloneRange(innerRange);\n\n\tif (outerRange.start) {\n\t\t// needs to be inclusively before outerRange's end\n\t\tinnerRange.start = constrainDate(innerRange.start, outerRange);\n\t}\n\n\tif (outerRange.end) {\n\t\tinnerRange.end = minMoment(innerRange.end, outerRange.end);\n\t}\n\n\treturn innerRange;\n}", "add(date) {\n let { start, end } = this.selection;\n if (start == null) {\n start = date;\n }\n else if (end == null) {\n end = date;\n }\n else {\n start = date;\n end = null;\n }\n super.updateSelection(new DateRange(start, end), this);\n }", "add(date) {\n let { start, end } = this.selection;\n if (start == null) {\n start = date;\n }\n else if (end == null) {\n end = date;\n }\n else {\n start = date;\n end = null;\n }\n super.updateSelection(new DateRange(start, end), this);\n }", "function rikTest() {\n var endDateTrigger = new Date(2013, 7, 12, 10, 45);\n sheet.getRange(40, 1, 1, 1).setValue(endDateTrigger);\n}", "_setFromDate(date) {\n let dates = get(this, '_dates');\n let [, dateTo] = dates;\n let vals;\n\n if (dateTo && date.valueOf() > dateTo.valueOf()) {\n vals = Ember.A([date, null]);\n } else {\n vals = Ember.A([date, dateTo || null]);\n }\n\n set(this, '_dates', vals);\n }", "function move2Start() {\r\nconsole.log('move2Start:', sensorStartDate);\r\nif ($('#main_single').prop('checked')) {\r\n setStartRange(new Date(sensorStartDate), 0)\r\n setEndRange(new Date(sensorStartDate), $(\"#qryRangeDD\").val());\r\n} else {\r\n $(\"#date1\").val(\"2005-06-15\");\r\n setEndRange(new Date(\"06/15/2005\"), $(\"#qryRangeDD\").val());\r\n}\r\n $('#backStart').addClass('disabled'); \r\n $('#back').addClass('disabled');\r\n //timelineType();\r\n}", "floorDate(date, relativeToStart, resolutionUnit, incr) {\n relativeToStart = relativeToStart !== false;\n\n const me = this,\n relativeTo = relativeToStart ? DateHelper.clone(me.startDate) : null,\n increment = incr || me.resolutionIncrement,\n unit = resolutionUnit || (relativeToStart ? me.resolutionUnit : me.mainUnit),\n snap = (value, increment) => Math.floor(value / increment) * increment;\n\n if (relativeToStart) {\n const snappedDuration = snap(DateHelper.diff(relativeTo, date, unit), increment); // TODO: used to be small unit multipled with factor (minute = seconds, minutes * 60)\n\n return DateHelper.add(relativeTo, snappedDuration, unit);\n }\n\n let dt = DateHelper.clone(date);\n\n if (unit === 'week') {\n const day = dt.getDay() || 7,\n startDay = me.weekStartDay || 7;\n dt = DateHelper.add(DateHelper.startOf(dt, 'day'), day >= startDay ? startDay - day : -(7 - startDay + day), 'day'); // Watch out for Brazil DST craziness (see test 028_timeaxis_dst.t.js)\n\n if (dt.getDay() !== startDay && dt.getHours() === 23) {\n dt = DateHelper.add(dt, 1, 'hour');\n }\n } else {\n // removes \"smaller\" units from date (for example minutes; removes seconds and milliseconds)\n dt = DateHelper.startOf(dt, unit); // day and year are 1-based so need to make additional adjustments\n\n const modifier = ['day', 'year'].includes(unit) ? 1 : 0,\n useUnit = unit === 'day' ? 'date' : unit,\n snappedValue = snap(DateHelper.get(dt, useUnit) - modifier, increment) + modifier;\n dt = DateHelper.set(dt, useUnit, snappedValue);\n }\n\n return dt;\n }", "function dealWithOverflow(date, ndays, limit) {\n if (date + ndays > limit) {\n date = date + ndays - limit;\n } else {\n date += ndays;\n }\n return date;\n}", "function insertTimelineEntryBasedOnDatreOfEntry(entry, timelineEntries){\n\t\t\tfor (var i = 0; i < timelineEntries.length; i++) {\n\t\t\t\tif(entry.dateOfEntry > timelineEntries[i].dateOfEntry){\n\t\t\t\t\t// Insert above current position in timelineEntries\n\t\t\t\t\ttimelineEntries.splice(i, 0, entry);\n\t\t\t\t\treturn;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\t// Add to the end\n\t\t\ttimelineEntries.push(entry);\n\t\t}", "function dateRangeCalculator(){\n\n\t//start date\n\n\t//end date\n\n\t//Api call request that reloads page/section based off of time span requested OR trimming original data object/array based off of new specified date range \n\n\n}", "floorDate(date, relativeToStart, resolutionUnit, incr) {\n relativeToStart = relativeToStart !== false;\n\n const me = this,\n relativeTo = relativeToStart ? DateHelper.clone(me.startDate) : null,\n increment = incr || me.resolutionIncrement,\n unit = resolutionUnit || (relativeToStart ? me.resolutionUnit : me.mainUnit),\n snap = (value, increment) => Math.floor(value / increment) * increment;\n\n if (relativeToStart) {\n const snappedDuration = snap(DateHelper.diff(relativeTo, date, unit), increment);\n // TODO: used to be small unit multipled with factor (minute = seconds, minutes * 60)\n return DateHelper.add(relativeTo, snappedDuration, unit);\n }\n\n let dt = DateHelper.clone(date);\n\n if (unit === 'week') {\n let day = dt.getDay() || 7,\n startDay = me.weekStartDay || 7;\n\n dt = DateHelper.add(\n DateHelper.startOf(dt, 'day'),\n day >= startDay ? startDay - day : -(7 - startDay + day),\n 'day'\n );\n\n // Watch out for Brazil DST craziness (see test 028_timeaxis_dst.t.js)\n if (dt.getDay() !== startDay && dt.getHours() === 23) {\n dt = DateHelper.add(dt, 1, 'hour');\n }\n } else {\n // removes \"smaller\" units from date (for example minutes; removes seconds and milliseconds)\n dt = DateHelper.startOf(dt, unit);\n\n // day and year are 1-based so need to make additional adjustments\n let modifier = ['day', 'year'].includes(unit) ? 1 : 0,\n useUnit = unit === 'day' ? 'date' : unit,\n snappedValue = snap(DateHelper.get(dt, useUnit) - modifier, increment) + modifier;\n\n dt = DateHelper.set(dt, useUnit, snappedValue);\n }\n\n return dt;\n }", "add(date) {\r\n if (date < this.min) {\r\n this.min = date;\r\n }\r\n if (date > this.max) {\r\n this.max = date;\r\n }\r\n this.sequence.push(date);\r\n }", "function inRange(start, end, date) {\n if (start && date.isBefore(start)) {\n return false\n }\n if (end && date.isAfter(end)) {\n return false\n }\n return true\n}", "ensureRightPoint(data) {\n const now = Moment().unix();\n const newest = _.last(data, \"t\");\n if (now - newest.t > 2) {\n data.push(Object.assign({}, newest, {t: now}));\n }\n }", "ensureLeftPoint(data) {\n const earliest = this.earliestAcceptable();\n let starter = _.findLast(data, d => {return d.t <= earliest;});\n if (!starter) {\n starter = Object.assign({}, _.first(data));\n data.unshift(starter);\n }\n starter.t = earliest;\n }", "function removeOutsideDateRange(rangeStart, rangeEnd) {\n var startIndex = 0;\n var endIndex = allCalendarEvents.length - 1;\n\n for (var i = 0; i < allCalendarEvents.length - 1; i++) {\n // If an event ends after the rangeStart cutoff, it's included.\n var startCompare = compareDateTimes(allCalendarEvents[i].end, rangeStart);\n if (startCompare >= 0) {\n startIndex = i;\n break;\n }\n }\n\n for (var i = startIndex; i < allCalendarEvents.length - 1; i++) {\n // If an event starts before the rangeEnd cutoff, it's included.\n var endCompare = compareDateTimes(allCalendarEvents[i].start, rangeEnd);\n if (endCompare < 0) {\n endIndex = i;\n }\n }\n\n // I'm not sure if slice is safe to assign directly back to the array being sliced, so I'm using a temp.\n var temp = allCalendarEvents.slice(startIndex, endIndex + 1);\n allCalendarEvents = temp;\n}", "function getDateInRange(current, target, before, after) {\n\t\tif(before != null && target > before) {\n\t\t\treturn new Date(before.getTime());\n\t\t}\n\t\tif(after != null && target < after) {\n\t\t\treturn new Date(after.getTime());\n\t\t}\n\t\treturn target;\n\t}", "extendToCover(min, max) {\r\n let x = this.min;\r\n while (min < x) {\r\n x = DateTimeSequence.ADD_INTERVAL(x, -this.interval, this.unit);\r\n this.sequence.splice(0, 0, x);\r\n }\r\n this.min = x;\r\n x = this.max;\r\n while (x < max) {\r\n x = DateTimeSequence.ADD_INTERVAL(x, this.interval, this.unit);\r\n this.sequence.push(x);\r\n }\r\n this.max = x;\r\n }", "function isBeforeDate(start_date) {\n if (typeof start_date === 'string') {\n start_date = startOfDay(parseISO(start_date));\n }\n start_date = startOfDay(start_date);\n const result = isBefore(evenDate, start_date);\n return result;\n}", "function HighOrLowSeason(date) {\n\n var newDate = new Date(date);\n \n newDate.setFullYear(2000);\n //Checks if the new date is inside the highSeason.\n if (newDate > højsæsonStart && newDate < højsæsonSlut) {\n return true;\n }\n else {\n return false;\n }\n}", "clampDate(date, min, max) {\n if (min && this.compareDate(date, min) < 0) {\n return min;\n }\n if (max && this.compareDate(date, max) > 0) {\n return max;\n }\n return date;\n }", "clampDate(date, min, max) {\n if (min && this.compareDate(date, min) < 0) {\n return min;\n }\n if (max && this.compareDate(date, max) > 0) {\n return max;\n }\n return date;\n }", "clampDate(date, min, max) {\n if (min && this.compareDate(date, min) < 0) {\n return min;\n }\n if (max && this.compareDate(date, max) > 0) {\n return max;\n }\n return date;\n }", "function dataRangeError(start,end){\n let s=start.replace(\":\",\" \");\n let e=end.replace(\":\",\" \");\n \n s=Date.parse(s);\n e=Date.parse(e);\n if(e<s) // end date is before start date\n return true;\n return false;\n}", "function setEndRange(date, days) {\r\n var msSpan = days*24*3600*1000;\r\n var endDate = new Date(date.getTime() + msSpan);\r\n //$(\"#date2\").val(endDate.toISOString().split('T')[0]);\r\n $(\"#date2\").val(momentLA_Date(endDate));\r\n}", "set range(range) {\n this.topDate = range.topDate;\n this.bottomDate = range.bottomDate;\n this.refresh();\n }", "function moveIntoRange(val, min, max) {\n let diff = max - min;\n while (val < min) {\n val += diff;\n }\n while (val >= max) {\n val -= diff;\n }\n return val;\n}", "findShallowIntersectingRange(date1, date2) {\n const thisRange = date1.toRange();\n const otherRange = date2.toRange(); // Start with infinite start and end dates\n\n let start = null;\n let end = null; // This start date exists\n\n if (thisRange.start) {\n // Use this definite start date if other start date is infinite\n if (!otherRange.start) {\n start = thisRange.start;\n } else {\n // Otherwise, use the earliest start date\n start = thisRange.start < otherRange.start ? thisRange.start : otherRange.start;\n } // Other start date exists\n\n } else if (otherRange.start) {\n // Use other definite start date as this one is infinite\n start = otherRange.start;\n } // Assign end date to this one if it is valid\n\n\n if (thisRange.end && (!start || thisRange.end >= start)) {\n end = thisRange.end;\n } // Assign end date to other one if it is valid and before this one\n\n\n if (otherRange.end && (!start || otherRange.end >= start)) {\n if (!end || otherRange.end < end) end = otherRange.end;\n } // Return calculated range\n\n\n return {\n start,\n end\n };\n }", "findShallowIntersectingRange(date1, date2) {\n const thisRange = date1.toRange();\n const otherRange = date2.toRange(); // Start with infinite start and end dates\n\n let start = null;\n let end = null; // This start date exists\n\n if (thisRange.start) {\n // Use this definite start date if other start date is infinite\n if (!otherRange.start) {\n start = thisRange.start;\n } else {\n // Otherwise, use the earliest start date\n start = thisRange.start < otherRange.start ? thisRange.start : otherRange.start;\n } // Other start date exists\n\n } else if (otherRange.start) {\n // Use other definite start date as this one is infinite\n start = otherRange.start;\n } // Assign end date to this one if it is valid\n\n\n if (thisRange.end && (!start || thisRange.end >= start)) {\n end = thisRange.end;\n } // Assign end date to other one if it is valid and before this one\n\n\n if (otherRange.end && (!start || otherRange.end >= start)) {\n if (!end || otherRange.end < end) end = otherRange.end;\n } // Return calculated range\n\n\n return {\n start,\n end\n };\n }", "function newDates1(low, high){\n let tempArray = [];\n for(var i=low; i<=high; i++){\n tempArray.push(new Date(datesProvided[i]));\n }\n\n //And one last value to account for range\n let tempDate = new Date(tempArray[tempArray.length-1])\n // console.log(\"Temp Date:\")\n // console.log(tempDate)\n let moreMinutes = tempDate.getMinutes();\n // console.log(\"Minutes: \")\n // console.log(moreMinutes)\n // console.log(selectionInterval)\n // console.log((moreMinutes+(+selectionInterval)))\n tempDate.setMinutes((moreMinutes+(+selectionInterval)))\n // console.log(\"New Temp Date\")\n // console.log(tempDate)\n tempArray.push(tempDate)\n\n return tempArray;\n}", "function setStartTime(newStart) {\n if (newStart < 0 || newStart < (snipWin / 2)) {\n songStart = 0;\n songEnd = snipWin;\n } else {\n songStart = parseFloat(newStart) - (snipWin / 2);\n songEnd = Math.abs(songStart) + snipWin\n }\n}", "function wrapOrCopy ( dt ) {\n\t\t\tif ( dt < MIN ) return copy(MIN);\n\t\t\tif ( dt > MAX ) return copy(MAX);\n\t\t\treturn copy(dt);\n\t\t}", "function nextRangeStart(range, existingEvents)\n {\n for (var j = 0; j < existingEvents.length; j++)\n {\n if (range.overlaps(existingEvents[j]))\n {\n return moment(existingEvents[j].end);\n }\n }\n return null;\n }", "function mergeRange(ranges, newRangeStart, newRangeEnd) {\n let inRange = false;\n for (let i = 0; i < ranges.length; i++) {\n const range = ranges[i];\n if (!inRange) {\n if (newRangeEnd <= range[0]) {\n // Case 1: New range is before the search range\n ranges.splice(i, 0, [newRangeStart, newRangeEnd]);\n return ranges;\n }\n else if (newRangeEnd <= range[1]) {\n // Case 2: New range is either wholly contained within the\n // search range or overlaps with the front of it\n range[0] = Math.min(newRangeStart, range[0]);\n return ranges;\n }\n else if (newRangeStart < range[1]) {\n // Case 3: New range either wholly contains the search range\n // or overlaps with the end of it\n range[0] = Math.min(newRangeStart, range[0]);\n inRange = true;\n }\n else {\n // Case 4: New range starts after the search range\n continue;\n }\n }\n else {\n if (newRangeEnd <= range[0]) {\n // Case 5: New range extends from previous range but doesn't\n // reach the current one\n ranges[i - 1][1] = newRangeEnd;\n return ranges;\n }\n else if (newRangeEnd <= range[1]) {\n // Case 6: New range extends from prvious range into the\n // current range\n ranges[i - 1][1] = Math.max(newRangeEnd, range[1]);\n ranges.splice(i, 1);\n inRange = false;\n return ranges;\n }\n else {\n // Case 7: New range extends from previous range past the\n // end of the current range\n ranges.splice(i, 1);\n i--;\n }\n }\n }\n if (inRange) {\n // Case 8: New range extends past the last existing range\n ranges[ranges.length - 1][1] = newRangeEnd;\n }\n else {\n // Case 9: New range starts after the last existing range\n ranges.push([newRangeStart, newRangeEnd]);\n }\n return ranges;\n}", "function removeTimeSpacesAndAlign(chart_data){\n\n //alinha os eventos de acordo com data atual\n let alignStartTime = new Date();\n\n chart_data.forEach((student) =>{\n let currentTime = alignStartTime;\n student.data.forEach((item, index) =>{\n if (item !== undefined){\n if (item.type == TimelineChart.TYPE.POINT){ //apenas desloca o 'at' do evento\n item.at = currentTime;\n } else { //altera o 'to' e 'from'\n let eventIntervalSizeInMs = item.to.getTime() - item.from.getTime();\n \n item.from = currentTime;\n item.to = new Date(currentTime.getTime() + eventIntervalSizeInMs);\n } \n \n //atualiza currentTime, adicionando 0,5s de espaço entre os eventos\n currentTime = (item.type == TimelineChart.TYPE.POINT) ? new Date(item.at.getTime() + 500) : new Date(item.to.getTime() + 500); \n }\n }); \n }); \n}", "function moveTableRange(ss, tableName, configJson) {\n if (!validateNewRange(ss, configJson)) {\n return false\n }\n var newRangeNotation = configJson.range\n var newSheetName = configJson.sheet\n if (newRangeNotation && newSheetName) { //(null means \"leave alone\")\n // If we get to here then the range has already been validated\n var currMatchingRange = findTableRange(ss, tableName)\n if (null != currMatchingRange) {\n // Build a new range\n var currSheetWithRange = currMatchingRange.getRange().getSheet()\n if ((currSheetWithRange.getName() != newSheetName) ||\n (currMatchingRange.getRange().getA1Notation().toLowerCase() != newRangeNotation.toLowerCase()))\n {\n var newRange = ss.getSheetByName(newSheetName).getRange(newRangeNotation)\n // Move data and format to new range\n var resizedOldRange =\n resizeToTargetRange_(currMatchingRange.getRange(), newRange)\n resizedOldRange.moveTo(newRange)\n currMatchingRange.setRange(newRange)\n }\n }\n }\n return true\n }", "function normalizeEventRangeTimes(range) {\n\t\tif (range.allDay == null) {\n\t\t\trange.allDay = !(range.start.hasTime() || (range.end && range.end.hasTime()));\n\t\t}\n\n\t\tif (range.allDay) {\n\t\t\trange.start.stripTime();\n\t\t\tif (range.end) {\n\t\t\t\t// TODO: consider nextDayThreshold here? If so, will require a lot of testing and adjustment\n\t\t\t\trange.end.stripTime();\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif (!range.start.hasTime()) {\n\t\t\t\trange.start = t.rezoneDate(range.start); // will assign a 00:00 time\n\t\t\t}\n\t\t\tif (range.end && !range.end.hasTime()) {\n\t\t\t\trange.end = t.rezoneDate(range.end); // will assign a 00:00 time\n\t\t\t}\n\t\t}\n\t}", "validateStartToEndDay(startDay, endDay) {\n if (startDay > endDay)\n throw Error(\"startDay must come before endDay following normal calendar sequence.\");\n }", "function setStartRange(date, days) {\r\n var msSpan = days*24*3600*1000;\r\n var startDate = new Date(date.getTime() - msSpan);\r\n //$(\"#date1\").val(startDate.toISOString().split('T')[0]);\r\n $(\"#date1\").val(momentLA_Date(startDate));\r\n}", "function normalizeEventRangeTimes(range) {\n if (range.allDay == null) {\n range.allDay = !(range.start.hasTime() || (range.end && range.end.hasTime()));\n }\n\n if (range.allDay) {\n range.start.stripTime();\n if (range.end) {\n // TODO: consider nextDayThreshold here? If so, will require a lot of testing and adjustment\n range.end.stripTime();\n }\n }\n else {\n if (!range.start.hasTime()) {\n range.start = t.rezoneDate(range.start); // will assign a 00:00 time\n }\n if (range.end && !range.end.hasTime()) {\n range.end = t.rezoneDate(range.end); // will assign a 00:00 time\n }\n }\n }", "function approach_range(graph) {\n\tgraph.updateOptions({dateWindow: desired_range});\n}", "function newDates(low, high){\n /* let tempArray = [];\n for(var i=0; i<datesProvided.length; i++){\n if ((i>=low) && (i<=high)){\n tempArray.push(new Date(datesProvided[i]));\n }\n }\n\n //And one last value to account for range\n let tempDate = new Date(tempArray[tempArray.length-1])\n console.log(\"Temp Date:\")\n console.log(tempDate)\n let moreMinutes = tempDate.getMinutes();\n console.log(\"Minutes: \")\n console.log(moreMinutes)\n console.log(selectionInterval)\n console.log((moreMinutes+(+selectionInterval)))\n tempDate.setMinutes((moreMinutes+(+selectionInterval)))\n console.log(\"New Temp Date\")\n console.log(tempDate)\n tempArray.push(tempDate)\n\n return tempArray;*/\n let tempArray = [];\n for(var i=low; i<=high; i++){\n tempArray.push(new Date(datesProvided[i]));\n }\n\n //And one last value to account for range\n let tempDate = new Date(tempArray[tempArray.length-1])\n console.log(\"Temp Date:\")\n console.log(tempDate)\n let moreMinutes = tempDate.getMinutes();\n console.log(\"Minutes: \")\n console.log(moreMinutes)\n console.log(selectionInterval)\n console.log((moreMinutes+(+selectionInterval)))\n tempDate.setMinutes((moreMinutes+(+selectionInterval)))\n console.log(\"New Temp Date\")\n console.log(tempDate)\n tempArray.push(tempDate)\n\n return tempArray;\n}", "setNewDates(selectedDateFrom, selectedDateTo, isFinishedMoving) {\n let dateFrom = new Date((selectedDateFrom.getMonth() + 1) + \"/\" + selectedDateFrom.getDate() +\n \"/\" + selectedDateFrom.getFullYear() + \" \" + this.state.selectedDateFrom.getHours() + \":\" +\n this.state.selectedDateFrom.getMinutes());\n let dateTo = new Date((selectedDateTo.getMonth() + 1) + \"/\" + selectedDateTo.getDate() +\n \"/\" + selectedDateTo.getFullYear() + \" \" + this.state.selectedDateTo.getHours() + \":\" +\n this.state.selectedDateTo.getMinutes());\n\n if (isFinishedMoving) {\n if (dateFrom.getTime() > dateTo.getTime()) {\n const timing = dateFrom;\n dateFrom = dateTo;\n dateTo = timing;\n }\n }\n\n if (!(this.state.selectedDateFrom.getTime() === dateFrom.getTime() &&\n this.state.selectedDateTo.getTime() === dateTo.getTime())) {\n this.setState({\n selectedDateFrom: dateFrom,\n selectedDateTo: dateTo\n });\n\n this.onChange(dateFrom, dateTo);\n }\n }", "function setTimePointPlace(date){\r\n\t\t\r\n\t\tvar dateMinusStart = Date.parse(date)-Date.parse($(\".startDateInp\").val());\r\n\t\tvar endMinusStart = Date.parse($(\".endDateInp\").val())-Date.parse($(\".startDateInp\").val());\r\n\t\tvar timePointPlace = ((dateMinusStart*100)/endMinusStart);\r\n \r\n\t\treturn Math.round(timePointPlace);\r\n\t}", "function isBefore(beforeRange, afterRange) {\n return beforeRange[1] <= afterRange[0];\n}", "function handleDateSelection(date, instance) {\n console.log(\"before: \" + environment.addedMinDate);\n\n\t\tswitch(instance) {\n\t\t\tcase \"from\":\n\t\t\t\tenvironment.addedMinDate = date;\n\t\t\t break;\n\t\t\tcase \"to\":\n\t\t\t\tenvironment.addedMaxDate = date;\n\t\t\t break;\t\t\n\t\t}\n\n console.log(\"after: \" + environment.addedMinDate);\n }", "function normalizeEventRange(props) {\n\n normalizeEventRangeTimes(props);\n\n if (props.end && !props.end.isAfter(props.start)) {\n props.end = null;\n }\n\n if (!props.end) {\n if (options.forceEventDuration) {\n props.end = t.getDefaultEventEnd(props.allDay, props.start);\n }\n else {\n props.end = null;\n }\n }\n }", "function decrementDate() {\n dateOffset --;\n googleTimeMin = d.getUTCFullYear() + '-' + (d.getUTCMonth() +1 ) + \"-\" + (d.getUTCDate() + dateOffset) + 'T00:00:00.000Z';\n googleTimeMax = d.getUTCFullYear() + '-' + (d.getUTCMonth() +1 ) + \"-\" + (d.getUTCDate() + dateOffset) + 'T23:59:59.999Z';\n calendarDate();\n listUpcomingEvents();\n\n}", "function constrainDrop(start,end,indexOE = null){\n let allEvents = calendar.getEvents();\n let eventsToReplace = []; \n\n if(indexOE != null)\n allEvents.splice(indexOE,1)\n \n if(moment(start).isSame(moment(end),'day')){\n index = allEvents.findIndex(event => moment(event.start).isSame(moment(start),'day'))\n if(allEvents[index].classNames[0] == 'present')\n eventsToReplace.push(allEvents[index]);\n else\n eventsToReplace.push(true)\n }\n\n else{\n end = moment(end).subtract(1, \"days\")._d;\n let dates = createDateArray(start,end)\n allEvents.findIndex(function(event){\n if(dates.find(date => moment(date).isSame(moment(event.start),'day'))){\n if(event.classNames[0] == \"present\")\n eventsToReplace.push(event)\n else \n eventsToReplace.push(true)\n }\n })\n }\n return eventsToReplace;\n}", "function _moveStart() {\n\t\t\t\t// TODO does anything need to be included in this event?\n\t\t\t\t// TODO make cancelable\n\t\t\t\t$fire(this._timetable, \"moveStart\");\n\t\t\t}", "function normalizeEventRange(props) {\n\n\t\tnormalizeEventRangeTimes(props);\n\n\t\tif (props.end && !props.end.isAfter(props.start)) {\n\t\t\tprops.end = null;\n\t\t}\n\n\t\tif (!props.end) {\n\t\t\tif (options.forceEventDuration) {\n\t\t\t\tprops.end = t.getDefaultEventEnd(props.allDay, props.start);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tprops.end = null;\n\t\t\t}\n\t\t}\n\t}", "function completeInterval(x, end) {\n var lastElement = x[x.length - 1];\n if (typeof lastElement[1] === 'undefined') {\n lastElement.push(moment(end).format('YYYY-MM-DD'));\n }\n if (lastElement[1] !== end) {\n var lastSet = [];\n lastSet.push(moment(lastElement[1]).add(1, 'day').format('YYYY-MM-DD'));\n lastSet.push(moment(end).format('YYYY-MM-DD'));\n x.push(lastSet);\n }\n}", "function ensureVisibleEventRange(range) {\n\t\tvar allDay;\n\n\t\tif (!range.end) {\n\n\t\t\tallDay = range.allDay; // range might be more event-ish than we think\n\t\t\tif (allDay == null) {\n\t\t\t\tallDay = !range.start.hasTime();\n\t\t\t}\n\n\t\t\trange = $.extend({}, range); // make a copy, copying over other misc properties\n\t\t\trange.end = t.getDefaultEventEnd(allDay, range.start);\n\t\t}\n\t\treturn range;\n\t}", "setStartEnd(moments) {\n let start = new Date(this.props.start)\n let end = new Date(this.props.end)\n\n start.setHours(moments[0].hours())\n start.setMinutes(moments[0].minutes())\n\n if (!this.state.openEnded) {\n if (end.getHours() !== moments[1].hours())\n end.setMinutes(moments[1].minutes())\n end.setHours(moments[1].hours())\n }\n\n // Dates have to be adjusted if workday ends after midnight\n if (start < this.props.start) this.adjustForNextDay(start, 1)\n if (end > this.props.end) this.adjustForNextDay(end, -1)\n if (start >= end) return\n let available = this.isAvailable(start, end)\n if (!available) return\n this.setState({start: start, end: end})\n return true\n }", "function normalizeRange(range, tDateProfile, dateEnv) {\n if (!tDateProfile.isTimeScale) {\n range = Object(_fullcalendar_core__WEBPACK_IMPORTED_MODULE_0__[\"computeVisibleDayRange\"])(range);\n if (tDateProfile.largeUnit) {\n var dayRange = range; // preserve original result\n range = {\n start: dateEnv.startOf(range.start, tDateProfile.largeUnit),\n end: dateEnv.startOf(range.end, tDateProfile.largeUnit)\n };\n // if date is partially through the interval, or is in the same interval as the start,\n // make the exclusive end be the *next* interval\n if (range.end.valueOf() !== dayRange.end.valueOf() || range.end <= range.start) {\n range = {\n start: range.start,\n end: dateEnv.add(range.end, tDateProfile.slotDuration)\n };\n }\n }\n }\n return range;\n}", "function adjustDuration(callback) {\n var duration = (endTime - startTime)/60000; // get the duration in minutes\n if (duration > 30) {\n if (startTime.getMinutes() < 30) {\n endTime = new Date().setHours(startTime.getHours(), 30, 0);\n }\n else{\n endTime = new Date().setHours(startTime.getHours() + 1, 0, 0);\n }\n endTime = new Date(endTime);\n }\n callback();\n }", "function fixDate(date) {\r\n var base = new Date(0);\r\n var skew = base.getTime();\r\n if (skew > 0)\r\n date.setTime(date.getTime() - skew);\r\n}", "function fixDate(date) {\n var base = new Date(0);\n var skew = base.getTime();\n if (skew > 0)\n date.setTime(date.getTime() - skew);\n}", "function futureDate(){\n var d = new Date();\n d.setDate(d.getDate() + 33);\nconsole.log(d);\n}", "setRange(startX, endX) {\n // swap the range if needed\n if (startX > endX) {\n let xbuf = startX;\n startX = endX;\n endX = xbuf;\n }\n\n // correct the range\n startX = Math.max(startX, this.timeRange.startTime);\n endX = Math.min(endX, this.timeRange.endTime);\n\n // apply the new range\n if (startX !== endX) {\n let isZoomed = startX > this.timeRange.startTime || endX < this.timeRange.endTime;\n this._xAxisTag.min = startX;\n this._xAxisTag.max = endX;\n this._xAxisTag.alignToGrid = isZoomed;\n this._zoomMode = isZoomed;\n this._calcAllYRanges();\n this.draw();\n }\n }", "inRange (number, start, end){\r\n // if end is undefined, start = 0 and end = start, then check if in range\r\n if (typeof end === 'undefined'){\r\n end = start;\r\n start = 0;\r\n } else if ( start > end ){\r\n // swap the two values around\r\n let temp = start;\r\n start = end;\r\n end = temp;\r\n }\r\n if ((number > start) && (number < end)){\r\n return true;\r\n }\r\n else\r\n return false;\r\n }", "function extendDateRange(from_date,duration,callback) {\n\tconsole.log('extend date range',from_date,duration);\n\tif (!from_date) return;\n\tif (dateInRange(from_date)) return;\n\t$('#myThinker').dialog('open');\n\tvar requestObj = {\n\t\tfrom_date:from_date\n\t};\n\tif (duration) requestObj['duration'] = duration;\n\tvar service = '/getDashboardData';\n\t$.ajax({\n\t\turl:service,\n\t\ttype:'GET',\n\t\tdataType:'json',\n\t\tdata:requestObj,\n\t\n\t\tsuccess:function(d) {\n\t\t\tif (d.success && d.success>0)\n\t\t\t{\t\t\t\t\t\t\n\t\t\t\t$('#myThinker').dialog('close');\n\t\t\t\tmergeTrackerOptions(d['trackerData']);\n\t\t\t\tmergeDashboardData(d['responses']);\n\t\t\t\tif (callback) callback();\n\t\t\t}\n\t\t},\n\t\t\n\t\terror:function(err)\n\t\t{\n\t\t\tconsole.log('error',err);\n\t\t\tupdateMsg($('.validateTips'),'Error changing date range');\n\t\t\tsetTimeout(function() {$('#myThinker').dialog('close');},2000);\n\t\t}\n\t});\t\t\t\n}", "function sortByRangeStart(a, b) {\n return a.start - b.start;\n}", "function sortByRangeStart(a,b){return a.start-b.start;}", "function goTo(date) {\n try {\n // get curDate\n const [dd, mm, yyyy] = document.querySelector(\"h3.jsx-2989278273\").textContent.slice(11).split(\"/\");\n const curDate = `${yyyy}-${mm}-${dd}`;\n\n // the given `date` is `n` days before or after\n const n = (Date.parse(curDate) - Date.parse(date)) / 864e5;\n const nAbs = Math.abs(n);\n\n // get btn\n const btns = document.querySelectorAll('.jsx-2989278273.report-nav');\n const btn = n > 0 ? btns[0] : btns[1];\n\n console.log(`Start jumping to ${nAbs} day${nAbs > 1 ? \"s\" : \"\"} ${n > 0 ? \"before\" : \"after\"}...`);\n for (i = 1; i <= nAbs; i++) {\n btn.click();\n if (i % 30 == 0) console.log(`> already jumped ${i} days...`);\n }\n console.log(`Finished! Now on ${date}.`);\n } catch (err) {\n console.error(err);\n }\n}", "_insertScheduledEmail (scheduledEmail) {\n let i = 0; let found = false\n while (i < this.sortedScheduledEmails.length && !found) {\n if (scheduledEmail.getEmailDate() < this.sortedScheduledEmails[i].getEmailDate()) {\n found = true\n } else {\n i++\n }\n }\n\n this.sortedScheduledEmails.splice(i, 0, scheduledEmail)\n }", "validateStartDate(start_time){\n let start_time_date = new Date(start_time);\n let tempDate = new Date();\n tempDate.setDate(tempDate.getDate());\n let date_difference = tempDate.getTime() - start_time_date.getTime();\n let dayToMillis = 86400000;\n date_difference = date_difference / dayToMillis;\n if(date_difference >= 0 && date_difference < 7){\n return true;\n }\n return false;\n }", "function getFutureDate(date) {\n if (isValid(date) && _.isDate(date)) {\n date.setDate(date.getDate() + 1);\n return date;\n }\n }", "dateShallowIntersectsDate(date1, date2) {\n if (date1.isDate) {\n return date2.isDate ? date1.dateTime === date2.dateTime : this.dateShallowIncludesDate(date2, date1);\n }\n\n if (date2.isDate) {\n return this.dateShallowIncludesDate(date1, date2);\n } // Both ranges\n\n\n if (date1.start && date2.end && date1.start > date2.end) {\n return false;\n }\n\n if (date1.end && date2.start && date1.end < date2.start) {\n return false;\n }\n\n return true;\n }", "dateShallowIntersectsDate(date1, date2) {\n if (date1.isDate) {\n return date2.isDate ? date1.dateTime === date2.dateTime : this.dateShallowIncludesDate(date2, date1);\n }\n\n if (date2.isDate) {\n return this.dateShallowIncludesDate(date1, date2);\n } // Both ranges\n\n\n if (date1.start && date2.end && date1.start > date2.end) {\n return false;\n }\n\n if (date1.end && date2.start && date1.end < date2.start) {\n return false;\n }\n\n return true;\n }", "function wrap(v, start, end) {\n if(end <= start) throw new Error('invalid range');\n while(v < start) v += (end - start);\n while(v >= end) v -= (end - start);\n return v;\n}", "function ensureVisibleEventRange(range) {\n var allDay;\n\n if (!range.end) {\n\n allDay = range.allDay; // range might be more event-ish than we think\n if (allDay == null) {\n allDay = !range.start.hasTime();\n }\n\n range = $.extend({}, range); // make a copy, copying over other misc properties\n range.end = t.getDefaultEventEnd(allDay, range.start);\n }\n return range;\n }", "handleRangePick(range) {\n const filter = this.state.filter;\n let histories = this.histories;\n\n if (range.length !== 0) {\n histories = histories.filter(history =>\n (TimeUtil.parseDateStrToMoment(history.startDate) > range[0])\n &&\n (TimeUtil.parseDateStrToMoment(history.startDate) < range[1])\n );\n }\n\n filter.startDateRange = range;\n this.setState({ filter });\n this.setState({ histories });\n }", "function validateStartDate (date) {\n if (new Date(date) <= new Date()) {\n return false\n }\n}", "function fixDate(d, check) {\n // force d to be on check's YMD, for daylight savings purposes\n if (+d) { // prevent infinite looping on invalid dates\n while (d.getDate() != check.getDate()) {\n d.setTime(+d + (d < check ? 1 : -1) * HOUR_MS);\n }\n }\n}", "setDateRange () {\n const dates = [];\n\n const startDate = this.state.from.clone();\n const endDate = this.state.to.clone();\n\n dates.push(startDate.clone());\n\n while (startDate.add(1, 'day').diff(endDate) < 0) {\n dates.push(startDate.clone());\n }\n\n this.setState({\n dates\n });\n }", "function sortByRangeStart (a, b) {\n return a.start - b.start\n}", "function sortByRangeStart (a, b) {\n return a.start - b.start\n}" ]
[ "0.640521", "0.628524", "0.62778217", "0.62440205", "0.61757237", "0.6140865", "0.6140865", "0.6140865", "0.6007711", "0.59873414", "0.56692207", "0.5478504", "0.5436301", "0.5418885", "0.53912234", "0.53270054", "0.51932496", "0.5190712", "0.5190712", "0.5190712", "0.5105092", "0.5105092", "0.5099668", "0.50971466", "0.5090929", "0.5087555", "0.5075134", "0.5073635", "0.50672823", "0.50545835", "0.5039609", "0.49643004", "0.49374232", "0.4916783", "0.48906335", "0.489043", "0.48735526", "0.487354", "0.4868904", "0.4859207", "0.4859207", "0.4859207", "0.48301148", "0.47993532", "0.4786211", "0.47614902", "0.47506556", "0.47506556", "0.4747706", "0.47468665", "0.4746812", "0.47402108", "0.47332045", "0.47243944", "0.46803245", "0.4671687", "0.4660132", "0.46600348", "0.46565658", "0.4649393", "0.46297157", "0.46283886", "0.4612641", "0.46043137", "0.46039027", "0.45943934", "0.45917577", "0.45877346", "0.4584221", "0.4581802", "0.45802692", "0.4580214", "0.45759973", "0.45740345", "0.45663908", "0.455386", "0.45438707", "0.45417422", "0.45391002", "0.45202908", "0.45183742", "0.45135266", "0.45102867", "0.45050192", "0.4501423", "0.4498223", "0.44967392", "0.44948322", "0.44948322", "0.4492538", "0.4489415", "0.44739762", "0.44721588", "0.4470609", "0.44612956", "0.44578987", "0.44578987" ]
0.6266933
6
always executes the workerFunc, but if the result is equal to the previous result, return the previous result instead.
function memoizeOutput(workerFunc, equalityFunc) { var cachedRes = null; return function () { var newRes = workerFunc.apply(this, arguments); if (cachedRes === null || !(cachedRes === newRes || equalityFunc(cachedRes, newRes))) { cachedRes = newRes; } return cachedRes; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function memoizeOutput(workerFunc, equalityFunc) {\n var cachedRes = null;\n return function () {\n var newRes = workerFunc.apply(this, arguments);\n\n if (cachedRes === null || !(cachedRes === newRes || equalityFunc(cachedRes, newRes))) {\n cachedRes = newRes;\n }\n\n return cachedRes;\n };\n }", "function memoizeOutput(workerFunc, equalityFunc) {\n var cachedRes = null;\n return function () {\n var newRes = workerFunc.apply(this, arguments);\n\n if (cachedRes === null || !(cachedRes === newRes || equalityFunc(cachedRes, newRes))) {\n cachedRes = newRes;\n }\n\n return cachedRes;\n };\n }", "function memoizeOutput(workerFunc, equalityFunc) {\n var cachedRes = null;\n return function () {\n var newRes = workerFunc.apply(this, arguments);\n if (cachedRes === null || !(cachedRes === newRes || equalityFunc(cachedRes, newRes))) {\n cachedRes = newRes;\n }\n return cachedRes;\n };\n}", "function memoizeOutput$1(workerFunc, equalityFunc) {\n var cachedRes = null;\n return function () {\n var newRes = workerFunc.apply(this, arguments);\n if (cachedRes === null || !(cachedRes === newRes || equalityFunc(cachedRes, newRes))) {\n cachedRes = newRes;\n }\n return cachedRes;\n };\n }", "function memoizeOneFn(resultFn, isEqual) {\n isEqual = isEqual || simpleIsEqual;\n var lastThis;\n var lastArgs = [];\n var lastResult;\n var calledOnce = false;\n // breaking cache when context (this) or arguments change\n var result = function () {\n var newArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n newArgs[_i] = arguments[_i];\n }\n if (calledOnce && lastThis === this && isEqual(newArgs, lastArgs)) {\n return lastResult;\n }\n // Throwing during an assignment aborts the assignment: https://codepen.io/alexreardon/pen/RYKoaz\n // Doing the lastResult assignment first so that if it throws\n // nothing will be overwritten\n lastResult = resultFn.apply(this, newArgs);\n calledOnce = true;\n lastThis = this;\n lastArgs = newArgs;\n return lastResult;\n };\n return result;\n}", "compute() {\n const prev = parseFloat(this.previousOperand);\n const current = parseFloat(this.currentOperand);\n const operations = {\n '+': prev + current,\n '-': prev - current,\n '*': prev * current,\n '/': prev / current\n }\n \n if (this.isEqualPressedAgain) {\n this.previousResult = this.currentOperand;\n this.currentOperand = this.performSameCalculation();\n }\n\n if (isNaN(prev) || isNaN(current)) return;\n this.currentOperand = this.checkForErrors(current, prev, operations);\n this.previousOperation = this.operation;\n this.operation = undefined;\n this.previousOperand = '';\n }", "computeResult(result) {\n }", "if (/*ret DOES NOT contain any hint on the result (lock is cracked)*/) {\n break; //Break loop (since further attempts are not neccessary)\n }", "function memoize(func, valueEquals) {\n let lastArgs = null;\n let lastResult = null;\n return (args) => {\n if (lastArgs !== null && argsEquals(args, lastArgs, valueEquals)) {\n return lastResult;\n }\n lastArgs = args;\n lastResult = func(...args);\n return lastResult;\n }\n}", "function callOnce(func) {\n let ifCalled = false;\n let result;\n return function () {\n if (!ifCalled) {\n ifCalled = true;\n result = func(...arguments); //TODO: In what scope is result? Can we access it from(for example) line 39?\n }\n return result;\n }\n}", "function once(func) {\r\n \r\n // Create value variable to store result of callback\r\n let value;\r\n \r\n // Create boolean to prevent reassignment\r\n let switchOff = false;\r\n \r\n // Utilize callback\r\n function useCallback(val) {\r\n \r\n // If bool is false\r\n if(!switchOff) {\r\n \r\n // Set value (for first execution)\r\n\t value = func(val);\r\n \r\n /* Set bool to true, so that this \r\n if block can no longer be accessed */\r\n \t\tswitchOff = true; \r\n }\r\n \r\n // Return value returned from callback (first time)\r\n return value;\r\n \r\n }\r\n \r\n return useCallback;\r\n\r\n}", "function once(func) {\n let called = false;\n let value;\n return (x) => {\n if (!called) {\n called = true;\n value = func(x);\n return value;\n } else {\n return value;\n }\n };\n}", "function calculate() {\r\n if (operator) {\r\n if (!result) return; //To prevent errors when there's no operand\r\n nextVal = result;\r\n result = calculation();\r\n prevVal = result;\r\n } else if(result){\r\n prevVal = result;\r\n }\r\n displayResult();\r\n result = ''; //To empty the display for new operand\r\n}", "t1 () {\n return WorkerWrapper.run(function () { return 'Run without args and without arrow function' })\n .then(result => {\n resultEl.innerHTML = result\n return result\n })\n .catch(err => err)\n }", "function f(b) {\n currentSum += b;\n return f; // <-- does not call itself, returns itself\n}", "function once(fn){\n\tvar firstExecution = true;\n\tvar result;\n\treturn function(){\n\t\tif(firstExecution){\n\t\t\tresult = fn();\n\t\t\tfirstExecution = false;\n\t\t\treturn result;\n\t\t} else {\n\t\t\treturn result;\n\t\t}\n\t}\n}", "function calculate(func){\n if (tempValue.join() != \"\"){\n console.log(func)\n if(func != \"=\") {\n if(currentValue == 0 || currentValue == null){\n currentValue = parseInt(tempValue.join(''));\n currentFunc = func;\n tempValue = [];\n update('0');\n } else {\n currentValue = eval(currentValue.toString() + currentFunc + tempValue.join(''));\n tempValue = [];\n currentFunc = func;\n update(currentValue.toString());\n }\n } else {\n currentValue = eval(currentValue.toString() + currentFunc + tempValue.join(''));\n update(currentValue.toString());\n tempValue = currentValue.toString().split('');\n currentValue = 0;\n currentFunc = \"\";\n console.log(\"equals\");\n }\n }\n}", "function localPromiseFun(prevResult) {\n return new Promise((resolve, reject) => {\n console.log(prevResult);\n return setTimeout(() => {\n return resolve(prevResult + 1);\n }, 1000);\n });\n}", "function once(func) {\n\tvar executed = false;\n var passedNum = 0;\n return function(num) {\n\n if (!executed) {\n executed = true;\n passedNum = num;\n return func(num)\n }\n else\n {\n return func(passedNum);\n }\n\n };\n }", "function once(func) {\n let counter = 0;\n let result;\n return function(x) {\n if (counter == 0) {\n counter++;\n result = func(x);\n }\n return result;\n }\n}", "function calculateResults() {\n return;\n}", "function once(fn) {\n let hasRan = false\n return function (num) {\n if (!hasRan) {\n hasRan = true // notice here, this is a live link since inner function has closure variable hasRan \n const result = fn(num)\n console.log('hasRan: ', hasRan, 'result:', result)\n return result\n } else {\n console.log('hasRan is true, function already ran')\n }\n }\n}", "function calculateCurrentCallback() {\n \n // get inputs from the DOM\n \n var voltage = document.getElementById(\"voltage1\").value;\n var resistance = document.getElementById(\"resistance\").value;\n \n // sanitize inputs\n \n resistance = parseFloat(resistance);\n voltage = parseFloat(voltage);\n \n // verify inputs\n \n if (isNaN(resistance) === true || isNaN(voltage) === true) {\n alert(\"Invalid inputs detected\");\n return;\n }\n \n // use the worker function and get th output\n \n var current = calculateCurrent(resistance, voltage);\n \n //do something \"usefull\" -i.e., display the answer\n \n document.getElementById(\"outputArea\").innerHTML = \"current =\" + current;\n}", "function running(value, fn) {\n haproxy.running(function (err, running) {\n if (err) return done(err);\n\n expect(running).to.equal(value);\n another.running(function (err, running) {\n if (err) return done(err);\n\n expect(running).to.equal(value);\n fn();\n });\n });\n }", "function running(value, fn) {\n haproxy.running(function (err, running) {\n if (err) return done(err);\n\n expect(running).to.equal(value);\n another.running(function (err, running) {\n if (err) return done(err);\n\n expect(running).to.equal(value);\n fn();\n });\n });\n }", "compute(){\r\n let computation;\r\n const prev = parseFloat(this.previousOperand);\r\n const current = parseFloat(this.currentOperand);\r\n \r\n // if user clicks equals only\r\n // return cancels the function completely further\r\n if (isNaN(prev) || isNaN(current)) return;\r\n \r\n switch(this.operation){\r\n case'+':\r\n computation = prev + current;\r\n break;\r\n case '-':\r\n computation = prev - current;\r\n break;\r\n case '*':\r\n computation = prev * current;\r\n break;\r\n case '÷':\r\n computation = prev / current; \r\n break;\r\n default:\r\n return;\r\n }\r\n this.readyToReset = true;\r\n this.currentOperand = computation\r\n this.operation = undefined\r\n this.previousOperand = ''\r\n }", "t2 () {\n return WorkerWrapper.run(() => 'Run without args and with arrow function')\n .then(result => {\n resultEl.innerHTML = result\n return result\n })\n .catch(err => err)\n }", "get() {\n if (this.keepAlive && this.firstGet) {\n this.firstGet = false;\n autorun(() => this.get());\n }\n if (this.isComputing)\n fail(`Cycle detected in computation ${this.name}: ${this.derivation}`);\n if (globalState.inBatch === 0 && this.observers.size === 0) {\n if (shouldCompute(this)) {\n this.warnAboutUntrackedRead();\n startBatch(); // See perf test 'computed memoization'\n this.value = this.computeValue(false);\n endBatch();\n }\n }\n else {\n reportObserved(this);\n if (shouldCompute(this))\n if (this.trackAndCompute())\n propagateChangeConfirmed(this);\n }\n const result = this.value;\n if (isCaughtException(result))\n throw result.cause;\n return result;\n }", "function memoize(func, valueEquals) {\n\t var lastArgs = null;\n\t var lastResult = null;\n\t return function (args) {\n\t if (lastArgs !== null && argsEquals(args, lastArgs, valueEquals)) {\n\t return lastResult;\n\t }\n\t lastArgs = args;\n\t lastResult = func.apply(undefined, _toConsumableArray(args));\n\t return lastResult;\n\t };\n\t}", "function two() {\r\n console.log('work 2');\r\n return 54;\r\n}", "function compute() {\n if ((document.getElementById(\"current\").innerText != \"\") && (document.getElementById(\"previous\").innerText != \"\")) {\n calculate(previousValue, currentValue, operationSymbol);\n }\n}", "function forValue(func, value, iterations) {\n if (! iterations) iterations = 100;\n var counter = 0;\n\n return new Promise(function(resolve, reject) {\n function checkValue() {\n func()\n .then(function(result) {\n counter++;\n\n if (result === value) {\n return resolve(result);\n }\n\n if (counter > iterations) {\n reject(`forValue didn't find target value after ${iterations} iterations.`);\n }\n else {\n setTimeout(checkValue, 500);\n }\n })\n }\n\n checkValue();\n });\n }", "function doWorkWithLet(flag) {\n return x;\n }", "function computeAndTrack()/*:void*/ {\n // After this method is left, the value will not be dirty.\n this.valueDirty$nJmn = false;\n // Remember the old value.\n var oldValue/*:**/ = this.value$nJmn;\n // It is allowed (although unusual) for the function to cause invalidations.\n // Try a few times to reach a fix point.\n for (var i/*:uint*/ = 0; i < 100; i++) {\n // There is no current tracker. Create and activate a new tracker\n // for the upcoming computation.\n this.dependencyTracker$nJmn = new com.coremedia.ui.data.dependencies.DependencyTracker(AS3.bind(this,\"invalidated$nJmn\"));\n // Make sure to stop dependency tracking even in the case of an internal exception.\n try {\n this.value$nJmn = this.compute$nJmn();\n } finally {\n this.dependencyTracker$nJmn.stop();\n }\n\n // If the tracker has been invalidated, ...\n if (this.dependencyTracker$nJmn.isInvalidated()) {\n // .. forget about it, ...\n this.dependencyTracker$nJmn = null;\n } else {\n // ... but otherwise the value is final and we can determine whether it has changed.\n if (!com.coremedia.ui.util.ObjectUtils.equal(oldValue, this.value$nJmn)) {\n this.valueChanged$nJmn = true;\n }\n // The dependency tracker lives on and will report invalidations to its callback method.\n return;\n }\n // The previous evaluation resulted in an invalidation before the function returned.\n }\n // Give up.\n this.value$nJmn = UNREADABLE$static;\n if (oldValue !== UNREADABLE$static) {\n this.valueChanged$nJmn = true;\n }\n throw new AS3.Error(\"function value expression keeps invalidating itself: \" + this.fun$nJmn + \"(\" + this.args$nJmn + \")\");\n }", "function memoize(originalFunc) {\n const cache = {};\n return (...args) => {\n // Check cahce for previously calculated result\n if (cache[args]) {\n return cache[args];\n }\n // Apply the args array [n] to the originalFunc and cache the result for next call\n const result = originalFunc.apply(this, args);\n cache[args] = result;\n return result;\n\n }\n}", "function chooseOne(thisArg) {\n var state = { \"ran\": false };\n return function chooseOne(fn) {\n return function chooseOne() {\n if (state.ran === false) {\n state.ran = true;\n fn.apply(thisArg, arguments);\n }\n };\n };\n }", "function performer(cb) {\n return cb();\n}", "function doComputation(){\n let computation;\n const prev = parseFloat(previousOperand);\n const current = parseFloat(currentOperand);\n\n if(isNaN(prev) || isNaN(current)) return;\n switch(operation){\n case '+':\n computation=prev + current;\n break;\n case '-':\n computation=prev - current;\n break;\n case 'x':\n computation=prev * current;\n break;\n case '/':\n computation= prev / current;\n break;\n default :\n return;\n }\n\n currentOperand=computation;\n operation=undefined;\n previousOperand=''; \n}", "function finishWork() {\n working = false;\n\n var fn = queue.shift();\n if (fn) {\n fn();\n }\n}", "wait(func){\n\t\tif(!func || func.constructor != Function) return false;\n\t\tlet { concurrency } = this.options;\n\n\t\t// If we don't need to wait...\n\t\tif(!concurrency || concurrency == -1 || this.current < concurrency){\n\t\t\t// Increment the current counter and run the function.\n\t\t\tthis.current = this.current + 1;\n\t\t\treturn func();\n\t\t}\n\n\t\t// ..else add to the waiting list.\n\t\tthis.waiting.push(func);\n\t}", "function runFallback<ParamsType, ResultType>(fn: WorkerFunctionType<ParamsType, ResultType>, params: ParamsType): Promise<ResultType> {\n return new Promise((resolve, reject) => {\n let result;\n try {\n // If `fn` is not pure, then calling it here in the fallback will\n // allow it to have access to closure/global vars not available when\n // called via Worker. This means potentially inconsistent results.\n // Non-pure function behavior is undefined though so this should be fine.\n // A remedy for inconsistency (albeit a shitty one) would be to isolate\n // the function by stringifying it and evaling it.\n // $FlowFixMe property `@@iterator` of $Iterable not found...\n result = fn.apply(null, params);\n } catch(e) {\n reject(e);\n return;\n }\n\n if (result && result.then && typeof result.then === 'function') {\n result.then(val => {\n resolve(val);\n }, err => {\n reject(err);\n });\n } else {\n resolve(result);\n }\n });\n}", "function buyWorker() {\n if (resAmount >= workerBuyCost) {\n resAmount -= workerBuyCost;\n workerAmount += 1;\n workerBuyCost += (workerAmount * 2);\n }\n}", "function once(func) {\n let funcOut;\n return function (input) {\n if (funcOut) {\n return funcOut;\n } else {\n funcOut = func(input);\n return funcOut;\n }\n }\n}", "function memoize(func) {\n var ran = false, memo;\n return function () {\n if (ran) return memo;\n ran = true;\n memo = func.apply(this, arguments);\n func = null;\n return memo;\n };\n }", "function resultsCalculation(){\n console.log(`RESULTS CALCULATION AT: ${new Date().toLocaleString()}`); \n console.log(`Running: ${SELECT_PREV_CYCLE_VALUE}${parseInt(new Date().getHours())-1} limit 1;`);\n db.query(`${SELECT_PREV_CYCLE_VALUE}${parseInt(new Date().getHours())-1} limit 1;`)\n .then(prev_cycle => { // result from the SELECT_PREV_CYCLE_VALUE => getting the previous cycle_value\n prev_value = prev_cycle[0]['cycle_value'];\n // console.log(`Prev_value=${prev_value}`); \n console.log(`Retunring: ${SELECT_CURRENT_CYCLE_VALUE}${parseInt(new Date().getHours())} limit 1;`)\n return db.query(`${SELECT_CURRENT_CYCLE_VALUE}${parseInt(new Date().getHours())} limit 1;`) // and executing the next thing which its results will be used in the \"result\" in the next \"then\"\n })\n .then(curr_cycle => { // The results from the SELECT_CURRENT_CYCLE_VALUE => the current cycle_value\n curr_value = curr_cycle[0]['cycle_value'];\n console.log(`Curr_value=${curr_value}`);\n return { // Sending the results required for the next operation\n prev_value: prev_value,\n curr_value: curr_value\n }\n })\n .then(cycle_values => { // Checking who won: the 'up' or 'down' bet\n let {prev_value, curr_value} = cycle_values;\n // console.log(`${result['prev_value']} and ${result['curr_value']}`);\n // console.log(`${prev_value} and ${curr_value}`);\n\n if(curr_value > prev_value){\n // Mark all players with 'up' as winners\n console.log('UP WON');\n return 'Up' \n } else if(curr_value < prev_value) {\n // Mark all players with 'down' as winners\n console.log('DOWN WON');\n return 'Down' \n } else { // Meaning the values are equal\n // Mark all players in that cycle as Void => refund the points\n console.log('DRAW!!');\n return 'DRAW'\n }\n })\n .then(direction => { \n up_down = direction;\n // console.log(`dir1 = ${up_down}`);\n // console.log(`***************************`)\n // console.log(`${CALCULATE_LOOSING_AMOUNT}'${up_down}';`)\n db.query(`${CALCULATE_WIN_LOSE_AMOUNT}${parseInt(new Date().getHours())-1} and direction='${up_down}';`) //Calculating the winning mount\n .then(winnings => {\n winning_bets = winnings[0]['sum'];\n console.log(`Winnings amount is: ${winning_bets}`);\n return up_down\n })\n .then(up_down => {\n // console.log(`dir2 = ${up_down}`);\n db.query(`${CALCULATE_W_BETS_AMOUNT}${parseInt(new Date().getHours())-1} and direction='${up_down}';`) //Calculating the weighted bets amount\n .then(w_bets => {\n // console.log(`dir2.5 = ${up_down}`);\n weighted_bets = w_bets[0]['sum'];\n console.log(`Winnings weighted bets amount is: ${weighted_bets}`); \n return up_down\n })\n .then(up_down => {\n // console.log(`dir3 = ${up_down}`);\n db.query(`${CALCULATE_WIN_LOSE_AMOUNT}${parseInt(new Date().getHours())-1} and direction='${up_down === 'Down' ? 'Up':'Down'}';`) // Flipping logic to calculate the loosing amount\n .then(loosings => {\n loosing_bets = loosings[0]['sum'];\n // console.log(up_down)\n return up_down\n })\n .then(up_down => {\n // console.log(up_down)\n console.log(`***************************`);\n let payout = `update players_table set payout=(bet / ${winning_bets})*${BET_PORTION}*${loosing_bets}+ \n (w_bet / ${weighted_bets})*${BET_PORTION}*${loosing_bets}+bet, result=1 \n where direction='${up_down}' and bet_hour=${parseInt(new Date().getHours())-1}`;\n db.query(payout) // Calculating payout\n console.log(`loosings= ${loosing_bets} winnings = ${winning_bets} w_bets = ${weighted_bets}`)\n // return db.close()\n })\n });\n })\n // }, (err) => {\n // return db.close().then(() => {throw err;})\n })\n .catch((err) => {throw err});\n}", "work() {}", "function iterationDone(x) { return {value: x, done: true}; }", "function iterationDone(x) { return {value: x, done: true}; }", "function getOnceFunction(func){\n var executed = false;\n return function(){\n if(!executed){\n func();\n executed = true;\n }\n }\n}", "function value() {\n\t if (resetNeeded) reset(), resetNeeded = false;\n\t return reduceValue;\n\t }", "function f(x) {\n //returning result\n return x;\n}", "function value() {\n if (resetNeeded) reset(), resetNeeded = false;\n return reduceValue;\n }", "function callAndWrap(workerFunction, parameters, transferableObjects) {\n var resultOrPromise;\n try {\n resultOrPromise = workerFunction(parameters, transferableObjects);\n return resultOrPromise; // errors handled by Promise\n } catch (e) {\n return when.reject(e);\n }\n }", "gotResult() {\n return !!this._methodResult;\n }", "function prev() {\n setValue(()=>{\n return checkValue(value-1)\n })\n }", "function generateResult() {\n if (firstNumb && operator && !toBeCleaned && !secondNumb) {\n setNumbers(getDisplayValue());\n return operate(Number(firstNumb), Number(secondNumb), operator);\n } else {\n return false;\n };\n}", "_calculateCellValue(cellRef, skipCache) {\n const cell = this.sheet.getCell(cellRef);\n\n const formula = cell.get('formula');\n if ( formula ) {\n const cachedValue = this.cellValueCache.get(cellRef);\n if ( !skipCache && !!cachedValue ) {\n return cachedValue;\n }\n\n this.cellValueCache = this.cellValueCache.remove(cellRef);\n return this.evaluateFormula(formula, cellRef);\n }\n\n const staticValue = cell.get('staticValue');\n if ( staticValue !== null ) {\n return staticValue;\n }\n\n const remoteValue = cell.get('remoteValue');\n if ( remoteValue ) {\n // TODO: handle remote values\n }\n\n return this._getCellValue(cellRef);\n }", "step() {\n return (this.execute(this.fetch(), this.fetch()));\n }", "function memoize(fn) {\n const cache = {};\n return function(...args) {\n if(cache[args]) { // if result already exists\n return cache[args];\n }\n let result = fn.apply(this, args); // perform function\n cache[args] = result; // save result in cache\n return result; \n }\n}", "function complicatedCalculation(a, b, callback) {\n var res = a + b;\n console.log('Complicated calculation finished!');\n callback(res);\n }", "function A(x) {\n console.log(\"A\");\n\n const result = B(x);\n\n return result - 1;\n}", "equalHandler() {\n\n if(this.state.numbers[0] === \"\" || this.state.numbers[1] === \"\") {\n return ;\n }\n\n this.props.calculatorApi.calculate(\n this.state.numbers[0],\n this.state.numbers[1],\n this.state.operation,\n (result)=>{\n this.setResult(result) ;\n })\n\n }", "function oneAtATime(func) {\n let currentExecution;\n\n const reset = () => currentExecution = undefined;\n\n return (...args) => {\n if (currentExecution) {\n return currentExecution;\n } else {\n currentExecution = func.apply(null, args);\n currentExecution.then(reset, reset);\n return currentExecution;\n }\n };\n}", "function once(func) {\n return function(){\n var f = func;\n func = null; // Here we are nulling out the func after we set the func to f that way if we try to call the func again it's null so it will not work\n return f.apply(\n this,\n arguments\n );\n };\n}", "function fn() { return 3; }", "function calc (num1, num2, callback) {\n return callback(num1, num2);\n}", "function calculator(one, two, three) {\n let totalWeight = one + two + three;\n let average = Math.round(totalWeight / 3);\n return average;\n return totalWeight; //this doesn't get executed since there is another return prior getting executed first\n}", "async changeWorker() {\n const lastAddress = this.workerAddress;\n const result = await this.request('get-available-node', { address: this.address });\n const address = result.address;\n\n if(address == lastAddress) {\n return;\n }\n\n try {\n await fetch(`${this.getRequestProtocol()}://${address}/ping`, this.createDefaultRequestOptions({ \n method: 'GET',\n timeout: this.options.request.pingTimeout\n }));\n this.workerAddress = address;\n }\n catch(err) { \n this.logger.warn(err.stack);\n this.workerAddress = lastAddress;\n }\n }", "t3 () {\n return WorkerWrapper.run(function (arg1, arg2) { return `Run ${arg1} and ${arg2}` }, ['with args', 'without arrow function'])\n .then(result => {\n resultEl.innerHTML = result\n return result\n })\n .catch(err => err)\n }", "static deferredRun(...args) {\n var reactive, cb;\n if (args.length == 2) {\n reactive = args[0];\n cb = args[1];\n } else {\n reactive = this._internal[0];\n cb = args[0];\n }\n // Once executed the first time, call the callback\n var autorun = 0;\n var computation = Tessel.autorun(() => {\n var val = reactive.get();\n if (autorun > 0) {\n cb(val);\n } else {\n autorun++;\n }\n });\n return computation;\n }", "function calculateResult() {\n return function () {\n changeDivideMultiply();\n screenResult.innerHTML = eval(screenResult.innerHTML);\n };\n }", "async changeWorker() {\n const lastAddress = this.workerAddress;\n const result = await this.request('get-available-node', { address: this.availableAddress });\n const address = result.address;\n\n if(address == lastAddress) {\n return;\n }\n\n try {\n await fetch(`${this.getRequestProtocol()}://${address}/ping`, this.createDefaultRequestOptions({ \n method: 'GET',\n timeout: this.options.request.pingTimeout\n }));\n this.workerAddress = address;\n }\n catch(err) { \n this.logger.warn(err.stack);\n this.workerAddress = lastAddress;\n }\n }", "function calculate(num1, num2, cb) {\n return cb(num1, num2);\n}", "function memoize(func){\n\tvar results = {};\n\treturn function(){\n\t\tvar args = Array.prototype.slice.call(arguments);\n\t\tvar hash = args.reduce(function(hash, nextArg){\n\t\t\treturn hash+nextArg;\n\t\t}, '');\n\t\tif(results[hash] === undefined){\n\t\t\tvar result = func.apply(this, args);\n\t\t\tresults[hash] = result;\n\t\t}\n\t\tconsole.log(results);\n\t\treturn results[hash];\n\t}\n}", "function next() {\n setValue(()=>{\n return checkValue(value+1)\n })\n }", "function cdr (func) {\n return func(function cb (x, y) {\n return y;\n })\n}", "function calculate_full_hash(domain, username, pwd, pwd_strength) {\n var hw_key = domain + \"_\" + username;\n if (hw_key in hashing_workers) {\n\tconsole.log(\"APPU DEBUG: Cancelling previous active hash calculation worker for: \" + hw_key);\n\thashing_workers[hw_key].terminate();\n\tdelete hashing_workers[hw_key];\n }\n\n const { ChromeWorker } = require(\"chrome\");\n var hw = new ChromeWorker(data.url(\"hash.js\"));\n\n hashing_workers[hw_key] = hw;\n\n hw.onmessage = function(worker_key, my_domain, my_username, my_pwd, my_pwd_strength) {\n\treturn function(event) {\n\t var rc = event.data;\n\t var hk = my_username + ':' + my_domain;\n\n\t if (typeof rc == \"string\") {\n\t\tconsole.log(\"(\" + worker_key + \")Hashing worker: \" + rc);\n\t }\n\t else if (rc.status == \"success\") {\n\t\tconsole.log(\"(\" + worker_key + \")Hashing worker, count:\" + rc.count + \", passwd: \" \n\t\t\t + rc.hashed_pwd + \", time: \" + rc.time + \"s\");\n\t\tif (pii_vault.password_hashes[hk].pwd_full_hash != rc.hashed_pwd) {\n\t\t pii_vault.password_hashes[hk].pwd_full_hash = rc.hashed_pwd;\n\n\t\t //Now calculate the pwd_group\n\t\t var curr_pwd_group = get_pwd_group(my_domain, rc.hashed_pwd, [\n\t\t\t\t\t\t\t\t\t\t my_pwd_strength.entropy, \n\t\t\t\t\t\t\t\t\t\t my_pwd_strength.crack_time,\n\t\t\t\t\t\t\t\t\t\t my_pwd_strength.crack_time_display\n\t\t\t\t\t\t\t\t\t\t ]);\n\t\t \n\t\t if (curr_pwd_group != pii_vault.current_report.user_account_sites[domain].my_pwd_group) {\n\t\t\tpii_vault.current_report.user_account_sites[domain].my_pwd_group = curr_pwd_group;\n\t\t\tflush_selective_entries(\"current_report\", [\"user_account_sites\"]);\n\t\t }\n\t\t \n\t\t //Now verify that short hash is not colliding with other existing short hashes.\n\t\t //if so, then modify it by changing salt\n\t\t for (var hash_key in pii_vault.password_hashes) {\n\t\t\tif (hash_key != hk && \n\t\t\t (pii_vault.password_hashes[hk].pwd_short_hash == \n\t\t\t pii_vault.password_hashes[hash_key].pwd_short_hash) &&\n\t\t\t (pii_vault.password_hashes[hk].pwd_full_hash != \n\t\t\t pii_vault.password_hashes[hash_key].pwd_full_hash)) {\n\t\t\t //This means that there is a short_hash collision. In this case, just change it,\n\t\t\t //by changing salt\n\t\t\t var err_msg = \"Seems like short_hash collision for keys: \" + hk + \", \" + hash_key;\n\t\t\t console.log(\"APPU DEBUG: \" + err_msg);\n\t\t\t print_appu_error(\"Appu Error: \" + err_msg);\n\t\t\t rc = calculate_new_short_hash(my_pwd, pii_vault.password_hashes[hk].salt);\n\n\t\t\t pii_vault.password_hashes[hk].pwd_short_hash = rc.short_hash;\n\t\t\t pii_vault.password_hashes[hk].salt = rc.salt;\n\t\t\t}\n\t\t }\n\t\t //Done with everything? Now flush those damn hashed passwords to the disk\n\t\t vault_write(\"password_hashes\", pii_vault.password_hashes);\n\t\t send_user_account_site_row_to_reports(domain);\n\t\t}\n\t\t//Now delete the entry from web workers.\n\t\tdelete hashing_workers[worker_key];\n\t }\n\t else {\n\t\tconsole.log(\"(\" + worker_key + \")Hashing worker said : \" + rc.reason);\n\t }\n\t}\n } (hw_key, domain, username, pwd, pwd_strength);\n \n //First calculate the salt\n //This salt is only for the purpose of defeating rainbow attack\n //For each password, the salt value will always be the same as salt table is\n //precomputed and fixed\n var k = sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(pwd));\n var r = k.substring(k.length - 10, k.length);\n var rsv = parseInt(r, 16) % 1000;\n var rand_salt = pii_vault.salt_table[rsv];\n var salted_pwd = rand_salt + \":\" + pwd;\n\n console.log(\"APPU DEBUG: (calculate_full_hash) Added salt: \" + rand_salt + \" to domain: \" + domain);\n\n hw.postMessage({\n\t 'limit' : 1000000,\n\t\t'cmd' : 'hash',\n\t\t'pwd' : salted_pwd,\n\t\t});\n}", "function test0() {\n var workItem = {\n increment: 1,\n isDone: false\n };\n\n var func0 = function () {\n workItem = {\n increment: 2,\n isDone: true\n };\n };\n\n while (!workItem.isDone) {\n for (var i = 0; i < 3 && !workItem.isDone; i += workItem.increment) {\n func0(i);\n }\n }\n\n print(\"i = \" + i);\n}", "next() {\n if (this.current == \"one\") {\n this.current = \"two\";\n return { done: false, value: \"one\" };\n } else if (this.current == \"two\") {\n this.current = \"\";\n return { done: false, value: \"two\" };\n }\n return { done: true };\n }", "function calculateResistanceCallback() {\n \n // get inputs from the DOM\n \n var current = document.getElementById(\"current\").value;\n var voltage = document.getElementById(\"voltage\").value;\n \n // sanitize inputs\n \n current = parseFloat(current);\n voltage = parseFloat(voltage);\n \n // verify inputs\n \n if (isNaN(current) === true || isNaN(voltage) === true) {\n alert(\"Hommie don't do that!\");\n return;\n }\n \n // use the worker function and get th output\n \n var resistance = calculateResistance(current, voltage);\n \n //do something \"usefull\" -i.e., display the answer\n \n document.getElementById(\"outputArea\").innerHTML = \"resistance =\" + resistance; \n}", "function h$runSyncReturn(a, cont) {\n var t = new h$Thread();\n ;\n var aa = (h$c2(h$ap1_e,(h$ghcjszmprimZCGHCJSziPrimziInternalzisetCurrentThreadResultValue),(a)));\n h$runSyncAction(t, aa, cont);\n if(t.status === (16)) {\n if(t.resultIsException) {\n throw t.result;\n } else {\n return t.result;\n }\n } else if(t.status === (1)) {\n throw new h$WouldBlock();\n } else {\n throw new Error(\"h$runSyncReturn: Unexpected thread status: \" + t.status);\n }\n}", "function h$runSyncReturn(a, cont) {\n var t = new h$Thread();\n ;\n var aa = (h$c2(h$ap1_e,(h$ghcjszmprimZCGHCJSziPrimziInternalzisetCurrentThreadResultValue),(a)));\n h$runSyncAction(t, aa, cont);\n if(t.status === (16)) {\n if(t.resultIsException) {\n throw t.result;\n } else {\n return t.result;\n }\n } else if(t.status === (1)) {\n throw new h$WouldBlock();\n } else {\n throw new Error(\"h$runSyncReturn: Unexpected thread status: \" + t.status);\n }\n}", "function h$runSyncReturn(a, cont) {\n var t = new h$Thread();\n ;\n var aa = (h$c2(h$ap1_e,(h$ghcjszmprimZCGHCJSziPrimziInternalzisetCurrentThreadResultValue),(a)));\n h$runSyncAction(t, aa, cont);\n if(t.status === (16)) {\n if(t.resultIsException) {\n throw t.result;\n } else {\n return t.result;\n }\n } else if(t.status === (1)) {\n throw new h$WouldBlock();\n } else {\n throw new Error(\"h$runSyncReturn: Unexpected thread status: \" + t.status);\n }\n}", "function memoize(fn) {\n let cached = false;\n let result;\n return (...args) => {\n if (!cached) {\n result = fn(...args);\n cached = true;\n }\n return result;\n };\n}", "function memoize(fn){\n const cache={}\n return function(...args){\n if(cache[args]) return cache[args]\n \n const result = fn.apply(this,args)\n cache[args]=result\n \n return result\n }\n }", "function _latch(event) {\n var firstCall = true;\n var cache;\n return _filter(event, function (value) {\n var shouldEmit = firstCall || value !== cache;\n firstCall = false;\n cache = value;\n return shouldEmit;\n });\n}", "function _getPeerRandomNumberCallback() {\n\t\t\n\t\t// save result\n\t\t// if all peers have provided a number:\n\t\t// calculate result and define the winner\n\t\t// \n\t }", "run () {\n let oldVal = this.value\n let newVal = this.get(oldVal)\n if (newVal !== oldVal) {\n this.value = newVal\n if (this.dir) {\n this.cb.call(this.data, this.dir, newVal)\n } else {\n this.cb.call(this.data, newVal)\n }\n }\n }", "function async(multipliers, useResult)\r\n{\r\n setTimeout(step1, 500);\r\n\r\n\r\n function step1()\r\n {\r\n console.log('Step 1');\r\n var x = Math.random();\r\n setTimeout(step2.bind(null, 0, x), 500);\r\n }\r\n\r\n\r\n function step2(index, x)\r\n {\r\n if(index === multipliers.length)\r\n return useResult(x);\r\n\r\n console.log('Step 2, call #' + (index+1));\r\n x *= multipliers[index];\r\n setTimeout(step2.bind(null, index+1, x), 500);\r\n }\r\n}", "function workOnce(callback, howMany) {\n return function () {\n callback()\n }\n}", "function reverseOp(){\n var rop;\n rop = 1-calculateOp();\n return rop;\n }", "function chooseOperation(op){\n if(currentOperand === '') return; //if no number exists in currentOperand do nothing just return\n if(previousOperand !== ''){ // if some number \n doComputation();\n }\n operation=op;\n previousOperand=currentOperand;\n currentOperand='';\n}", "function result(number1, number2) {\n if (number1 === number2) {\n return (number1 + number2) * 3;\n } else {\n return number1 + number2;\n }\n}", "function globalWorker(param) {\n\n\tconst funcName = '[Sellerise: globalWorker]';\n\n\twork = true;\n\tamznRequestId = param.amznRequestId;\n\n\tscanOrderPages(param)\n\t.then(function(orders){\n\n\t\tif(orders.length == 0){\n\t\t\trequestProgressEvent('up-to-date');\n\t\t\trequestFinishEvent('scan-order-pages');\n\t\t\treturn true;\n\t\t}\n\t\tif(!work){ return false; }\n\t\treturn requestOrdersReview(param.host, orders);\n\t})\n\t.then(function(result){\n\t\t// console.log('work done')\n\t})\n\t.catch(function(err) {\n \t\t// console.log(funcName, err);\n });\n}", "t7 () {\n return WorkerWrapper.run((arg1) => `Run with ${arg1}`, undefined)\n .then(result => {\n resultEl.innerHTML = result\n return result\n })\n .catch(err => err)\n }", "worker(s){return this.gameObj('worker', s);}", "function once(fn){\n\n var progress = false;\n\n return function(callback){\n\n if(progress) return;\n\n progress = true;\n\n fn(function(){\n\n progress = false;\n\n if(callback) callback();\n })\n }\n}", "function one(){\n\n return 'ONE';\n\n // Nothing after 'return' gets executed\n console.log('THIS WILL NOT WORK!');\n\n}" ]
[ "0.67986786", "0.6793849", "0.6693426", "0.65086395", "0.60093176", "0.53951335", "0.536148", "0.5309094", "0.52749926", "0.5168996", "0.5131221", "0.5096157", "0.50795597", "0.5065873", "0.5060239", "0.5016241", "0.5007648", "0.50023794", "0.49737942", "0.49678874", "0.495235", "0.49347994", "0.49279508", "0.489672", "0.489672", "0.48690918", "0.48684567", "0.48609757", "0.4840089", "0.48369357", "0.48173526", "0.4783748", "0.47764587", "0.4775473", "0.4772179", "0.47685987", "0.47635144", "0.47614208", "0.47372058", "0.4728394", "0.4714377", "0.4714046", "0.47125316", "0.4702394", "0.46956268", "0.46911946", "0.46868223", "0.46868223", "0.4674367", "0.4673567", "0.4672224", "0.46571952", "0.46437013", "0.46367863", "0.46276605", "0.46255907", "0.46246082", "0.4605802", "0.46040994", "0.46039146", "0.4603848", "0.4602578", "0.46013442", "0.4596846", "0.45921034", "0.45899153", "0.4582688", "0.4580691", "0.4580445", "0.4578013", "0.45778644", "0.45719117", "0.4567492", "0.45669705", "0.4556467", "0.45520017", "0.45516714", "0.4547656", "0.4546998", "0.45448068", "0.45395038", "0.45395038", "0.45395038", "0.45354083", "0.45353734", "0.45308053", "0.45244655", "0.4524314", "0.45223507", "0.45097473", "0.45010963", "0.44967946", "0.4495658", "0.44943628", "0.44933337", "0.44906622", "0.4490355", "0.44817805" ]
0.67426485
4
Range Formatting Utils 0 = exactly the same 1 = different by time and bigger
function computeMarkerDiffSeverity(d0, d1, ca) { if (ca.getMarkerYear(d0) !== ca.getMarkerYear(d1)) { return 5; } if (ca.getMarkerMonth(d0) !== ca.getMarkerMonth(d1)) { return 4; } if (ca.getMarkerDay(d0) !== ca.getMarkerDay(d1)) { return 2; } if (timeAsMs(d0) !== timeAsMs(d1)) { return 1; } return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Format() {}", "function Format() {}", "function TStylingRange() {}", "function TStylingRange() {}", "function TStylingRange() { }", "_getRange() {\n const that = this;\n\n if (that.logarithmicScale) {\n that._range = that._drawMax - that._drawMin;\n return;\n }\n\n if (that.scaleType === 'floatingPoint') {\n that._range = (that._drawMax - that._drawMin).toString();\n }\n else {\n that._range = new JQX.Utilities.BigNumber(that._drawMax).subtract(that._drawMin).toString();\n }\n }", "function formatRange(date1,date2,formatStr,separator,isRTL){var localeData;date1=moment_ext_1[\"default\"].parseZone(date1);date2=moment_ext_1[\"default\"].parseZone(date2);localeData=date1.localeData();// Expand localized format strings, like \"LL\" -> \"MMMM D YYYY\".\n// BTW, this is not important for `formatDate` because it is impossible to put custom tokens\n// or non-zero areas in Moment's localized format strings.\nformatStr=localeData.longDateFormat(formatStr)||formatStr;return renderParsedFormat(getParsedFormatString(formatStr),date1,date2,separator||' - ',isRTL);}", "_formatAnnouncementTimeRange(ann) {\n const startDate = new Date(ann.startTime);\n const startStr = dateFormatter.format(startDate);\n if (ann.retired != true) {\n return startStr;\n }\n const endDate = new Date(ann.endTime);\n const endStr = dateFormatter.format(endDate);\n return `${startStr} - ${endStr}`;\n }", "function format(original) {\n return Math.round(original * 100) / 100;\n }", "doTestTimeFormat1(spec, test, norm) {\n var ut;\n try {\n ut = new URITemplate(spec);\n } catch (ex) {\n console.info(\"### unable to parse spec: \" + spec);\n return;\n }\n var nn = norm.split(\"/\");\n if (URITemplateTest.iso8601DurationPattern.exec(nn[1])!=null) {\n nn[1] = TimeUtil.isoTimeFromArray(TimeUtil.add(TimeUtil.isoTimeToArray(nn[0]), TimeUtil.parseISO8601Duration(nn[1])));\n }\n var res;\n try {\n res = ut.format(nn[0], nn[1], new Map());\n } catch (ex) {\n console.info(\"### \" + (ex.getMessage()));\n return;\n }\n var arrow = String.fromCharCode( 8594 );\n if (res==test) {\n console.info(sprintf(\"%s: \\t\\\"%s\\\"%s\\t\\\"%s\\\"\",spec, norm, arrow, res));\n } else {\n console.info(\"### ranges do not match: \" + spec + \" \" + norm + arrow + res + \", should be \" + test);\n }\n assertEquals(res, test);\n }", "function formatRange(range) {\n\t\t\tvar dateFormat = options.altFormat,\n\t\t\t formattedRange = {};\n\t\t\tformattedRange.start = $.datepicker.formatDate(dateFormat, range.start);\n\t\t\tformattedRange.end = $.datepicker.formatDate(dateFormat, range.end);\n\t\t\treturn JSON.stringify(formattedRange);\n\t\t}", "function get_format(comp, val, cap, min, max) {\n function fmt(index) {\n val = cap ? val % cap : val\n return desc[index].interpolate({num: val}) }\n\n var desc = _fmts[comp]\n if (!Object.isArray(desc)) desc = [desc, desc]\n\n val = ~~val\n if (null != min && val && val <= min) return fmt(0)\n if (null != max && val && val <= max) return fmt(1)\n return \"\"\n }", "function formatRange(range) {\n\t\t\tvar dateFormat = options.altFormat,\n\t\t\t\tformattedRange = {};\n\t\t\tformattedRange.start = $.datepicker.formatDate(dateFormat, range.start);\n\t\t\tformattedRange.end = $.datepicker.formatDate(dateFormat, range.end);\n\t\t\treturn JSON.stringify(formattedRange);\n\t\t}", "function twoDecimal(hoursRange){\n hoursRange.setNumberFormat(\"[h]:mm\");\n// hoursRange.setNumberFormat(\"0.00\");\n}", "validateColorRange(value) {\n const that = this.context;\n\n if (that._wordLengthNumber < 64) {\n return super.validateColorRange(value);\n }\n\n if (that.mode === 'numeric') {\n value = new JQX.Utilities.BigNumber(value);\n }\n else {\n value = JQX.Utilities.DateTime.validateDate(value);\n value = value.getTimeStamp();\n }\n\n const bigMin = new JQX.Utilities.BigNumber(that.min),\n bigMax = new JQX.Utilities.BigNumber(that.max);\n\n if (value.compare(bigMin) === -1) {\n value = bigMin;\n }\n\n if (value.compare(bigMax) === 1) {\n value = bigMax;\n }\n\n return value;\n }", "function t(l,h){var L=l.split(\"_\");return h%10==1&&h%100!=11?L[0]:h%10>=2&&h%10<=4&&(h%100<10||h%100>=20)?L[1]:L[2]}", "function formatRangeForReport(spreadsheetId, sheetId, type) {\n const ss = SpreadsheetApp.getSpreadsheetById(spreadsheetId);\n\n if (ss.getSheetByName(sheetId) == null) {\n ss.insertSheet(sheetId);\n };\n\n const sheet = ss.getSheetByName(sheetId);\n\n switch (type) {\n case \"Conv AdW\":\n sheet.getRange(1, 1, 1, 4).setValues([\n [\"Client : \", \"\", \"Dernière Vérif : \", \"\"]\n ]).setBackground(\"#ff9900\").setFontWeight(\"bold\");\n\n sheet.getRange(2, 1, 1, 7).setValues([\n [\"Date\", \"Clicks\", \"Impressions\", \"Conversions\", \"Dépenses\", \"CPC\", \"CPA\"]\n ]).setBackground(\"#6fa8dc\").setFontWeight(\"bold\");\n\n break;\n\n default:\n sheet.getRange(1, 1, 1, 4).setValues([\n [\"Client : \", \"\", \"Dernière Vérif : \", \"\"]\n ]).setBackground(\"#ff9900\").setFontWeight(\"bold\");\n\n sheet.getRange(2, 1, 1, 7).setValues([\n [\"Date\", \"Clicks\", \"Impressions\", \"Dépense\", \"Conversions\", \"CPC\", \"CPA\"]\n ]).setBackground(\"#6fa8dc\").setFontWeight(\"bold\");\n\n break;\n };\n}", "formatTime(time) {\n return (time >= 10) ? time : `0${time}`;\n }", "function formatRange(viewSize) {\n var tmpViewSize = viewSize / 1000,\n fprefix = formatPrefix(Math.max(1, tmpViewSize)),\n unit = fprefix.symbol + \"bp\",\n // bp, kbp, Mbp, Gbp\n prefix = Math.round(fprefix.scale(viewSize)).toLocaleString();\n return { prefix: prefix, unit: unit };\n}", "function parseRangeValue(value, min, max, display_label, decimals) {\n\tif (!value && value.length !== 2) {\n\t\treturn false;\n\t}\n\n\tvar returnVal = display_label;\n\tvar start_val = value[0] ? value[0] : min;\n\tvar end_val = value[1] ? value[1] : max;\n\n\tstart_val = !decimals ? Math.round(start_val) : start_val;\n\tend_val = !decimals ? Math.round(end_val) : end_val;\n\n\treturnVal = returnVal.replace(\"{start}\", \"<span class=\\\"alm-range-start\\\">\" + start_val + \"</span>\");\n\treturnVal = returnVal.replace(\"{end}\", \"<span class=\\\"alm-range-end\\\">\" + end_val + \"</span>\");\n\n\treturn returnVal;\n}", "getFormattedRange(rangeRef) {\n return this.sheet.mapRange(\n rangeRef,\n this.getFormattedCell.bind(this)\n );\n }", "function t(e,t){var i=e.split(\"_\");return t%10===1&&t%100!==11?i[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?i[1]:i[2]}", "function t(e,t){var i=e.split(\"_\");return t%10===1&&t%100!==11?i[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?i[1]:i[2]}", "function t(e,t){var i=e.split(\"_\");return t%10===1&&t%100!==11?i[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?i[1]:i[2]}", "function ConvertToRangesOfHours()\n{\n\tfor(var i= 0;i<43;i++)\n\t{\n\t\tvar string = String.format(colOfTime[i]+\"-\"+colOfTime[i+1]);\n\t\trangeOfTime.push(string);\n\t}\n}", "_createRangeText() {\n let loTxt = this._getRowText(this._rows[this._range.low ]);\n let hiTxt = this._getRowText(this._rows[this._range.high]);\n if (loTxt !== hiTxt) {\n return `${loTxt} <b>to</b> ${hiTxt}`;\n } else {\n return `${loTxt}`;\n }\n }", "function t(e, t, n) {\n var i = {ss: \"secunde\", mm: \"minute\", hh: \"ore\", dd: \"zile\", MM: \"luni\", yy: \"ani\"}, r = \" \";\n return (e % 100 >= 20 || e >= 100 && e % 100 === 0) && (r = \" de \"), e + r + i[n]\n }", "function computeTitleFormat(dateProfile) {\n var currentRangeUnit = dateProfile.currentRangeUnit;\n\n if (currentRangeUnit === 'year') {\n return {\n year: 'numeric'\n };\n } else if (currentRangeUnit === 'month') {\n return {\n year: 'numeric',\n month: 'long'\n }; // like \"September 2014\"\n } else {\n var days = marker_1.diffWholeDays(dateProfile.currentRange.start, dateProfile.currentRange.end);\n\n if (days !== null && days > 1) {\n // multi-day range. shorter, like \"Sep 9 - 10 2014\"\n return {\n year: 'numeric',\n month: 'short',\n day: 'numeric'\n };\n } else {\n // one day. longer, like \"September 9 2014\"\n return {\n year: 'numeric',\n month: 'long',\n day: 'numeric'\n };\n }\n }\n } // Plugin", "function t(a,r,_){var l={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"s\\u0103pt\\u0103m\\xE2ni\",MM:\"luni\",yy:\"ani\"},h=\" \";return(a%100>=20||a>=100&&a%100==0)&&(h=\" de \"),a+h+l[_]}", "function r(i,l,c){var f={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"s\\u0103pt\\u0103m\\xE2ni\",MM:\"luni\",yy:\"ani\"},p=\" \";return(i%100>=20||i>=100&&i%100==0)&&(p=\" de \"),i+p+f[c]}", "function r(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function r(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function r(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function r(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function r(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function r(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var r=e.split(\"_\");return t%10===1&&t%100!==11?r[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?r[1]:r[2]}", "function t(e,t){var r=e.split(\"_\");return t%10===1&&t%100!==11?r[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?r[1]:r[2]}", "function t(e,t){var r=e.split(\"_\");return t%10===1&&t%100!==11?r[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?r[1]:r[2]}", "function formatRange(date1, date2, formatStr, separator, isRTL) {\n\tvar localeData;\n\n\tdate1 = FC.moment.parseZone(date1);\n\tdate2 = FC.moment.parseZone(date2);\n\n\tlocaleData = date1.localeData();\n\n\t// Expand localized format strings, like \"LL\" -> \"MMMM D YYYY\".\n\t// BTW, this is not important for `formatDate` because it is impossible to put custom tokens\n\t// or non-zero areas in Moment's localized format strings.\n\tformatStr = localeData.longDateFormat(formatStr) || formatStr;\n\n\treturn renderParsedFormat(\n\t\tgetParsedFormatString(formatStr),\n\t\tdate1,\n\t\tdate2,\n\t\tseparator || ' - ',\n\t\tisRTL\n\t);\n}", "function formatRange(date1, date2, formatStr, separator, isRTL) {\n\tvar localeData;\n\n\tdate1 = FC.moment.parseZone(date1);\n\tdate2 = FC.moment.parseZone(date2);\n\n\tlocaleData = date1.localeData();\n\n\t// Expand localized format strings, like \"LL\" -> \"MMMM D YYYY\".\n\t// BTW, this is not important for `formatDate` because it is impossible to put custom tokens\n\t// or non-zero areas in Moment's localized format strings.\n\tformatStr = localeData.longDateFormat(formatStr) || formatStr;\n\n\treturn renderParsedFormat(\n\t\tgetParsedFormatString(formatStr),\n\t\tdate1,\n\t\tdate2,\n\t\tseparator || ' - ',\n\t\tisRTL\n\t);\n}", "function formatRange(date1, date2, formatStr, separator, isRTL) {\n\tvar localeData;\n\n\tdate1 = FC.moment.parseZone(date1);\n\tdate2 = FC.moment.parseZone(date2);\n\n\tlocaleData = date1.localeData();\n\n\t// Expand localized format strings, like \"LL\" -> \"MMMM D YYYY\".\n\t// BTW, this is not important for `formatDate` because it is impossible to put custom tokens\n\t// or non-zero areas in Moment's localized format strings.\n\tformatStr = localeData.longDateFormat(formatStr) || formatStr;\n\n\treturn renderParsedFormat(\n\t\tgetParsedFormatString(formatStr),\n\t\tdate1,\n\t\tdate2,\n\t\tseparator || ' - ',\n\t\tisRTL\n\t);\n}", "function formatRange(date1, date2, formatStr, separator, isRTL) {\n\tvar localeData;\n\n\tdate1 = FC.moment.parseZone(date1);\n\tdate2 = FC.moment.parseZone(date2);\n\n\tlocaleData = date1.localeData();\n\n\t// Expand localized format strings, like \"LL\" -> \"MMMM D YYYY\".\n\t// BTW, this is not important for `formatDate` because it is impossible to put custom tokens\n\t// or non-zero areas in Moment's localized format strings.\n\tformatStr = localeData.longDateFormat(formatStr) || formatStr;\n\n\treturn renderParsedFormat(\n\t\tgetParsedFormatString(formatStr),\n\t\tdate1,\n\t\tdate2,\n\t\tseparator || ' - ',\n\t\tisRTL\n\t);\n}", "function formatRange(date1, date2, formatStr, separator, isRTL) {\n\tvar localeData;\n\n\tdate1 = FC.moment.parseZone(date1);\n\tdate2 = FC.moment.parseZone(date2);\n\n\tlocaleData = date1.localeData();\n\n\t// Expand localized format strings, like \"LL\" -> \"MMMM D YYYY\".\n\t// BTW, this is not important for `formatDate` because it is impossible to put custom tokens\n\t// or non-zero areas in Moment's localized format strings.\n\tformatStr = localeData.longDateFormat(formatStr) || formatStr;\n\n\treturn renderParsedFormat(\n\t\tgetParsedFormatString(formatStr),\n\t\tdate1,\n\t\tdate2,\n\t\tseparator || ' - ',\n\t\tisRTL\n\t);\n}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}", "function t(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}" ]
[ "0.61203897", "0.61203897", "0.5941997", "0.5941997", "0.5932185", "0.5861491", "0.5830515", "0.57634425", "0.57445264", "0.57125396", "0.57027084", "0.56629807", "0.5640768", "0.56320024", "0.56173265", "0.56012374", "0.5556259", "0.5536444", "0.55142504", "0.54970175", "0.5490374", "0.54895985", "0.54895985", "0.54895985", "0.5489335", "0.54721534", "0.54463756", "0.5442275", "0.5429412", "0.5423625", "0.5410409", "0.5410409", "0.5410409", "0.5410409", "0.5410409", "0.5410409", "0.54094154", "0.54094154", "0.54094154", "0.53938", "0.53938", "0.53938", "0.53938", "0.53938", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147", "0.53922147" ]
0.0
-1
String Utils timeZoneOffset is in minutes
function buildIsoString(marker, timeZoneOffset, stripZeroTime) { if (stripZeroTime === void 0) { stripZeroTime = false; } var s = marker.toISOString(); s = s.replace('.000', ''); if (stripZeroTime) { s = s.replace('T00:00:00Z', ''); } if (s.length > 10) { // time part wasn't stripped, can add timezone info if (timeZoneOffset == null) { s = s.replace('Z', ''); } else if (timeZoneOffset !== 0) { s = s.replace('Z', formatTimeZoneOffset(timeZoneOffset, true)); } // otherwise, its UTC-0 and we want to keep the Z } return s; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 getTimeZoneOffsetMinutes()\n{\n var offset = new Date().getTimezoneOffset();\n return offset;\n}", "function parseTimezoneOffset(offset) {\n let [, sign, hours, minutes] = offset.match(/(\\+|-)(\\d\\d)(\\d\\d)/);\n minutes = (sign === '+' ? 1 : -1) * (Number(hours) * 60 + Number(minutes));\n return negateExceptForZero$1(minutes)\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 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 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 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 formatTimezoneOffset(minutes) {\n const sign = simpleSign(negateExceptForZero(minutes));\n minutes = Math.abs(minutes);\n const hours = Math.floor(minutes / 60);\n minutes -= hours * 60;\n let strHours = String(hours);\n let strMinutes = String(minutes);\n if (strHours.length < 2) strHours = '0' + strHours;\n if (strMinutes.length < 2) strMinutes = '0' + strMinutes;\n return (sign === -1 ? '-' : '+') + strHours + strMinutes\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}", "static formatTimezoneOffset(offsetHours) {\n const offset = offsetHours * 3600;\n const prefix = offset >= 0 ? '+' : '-';\n\n let formattedOffset = prefix;\n formattedOffset += ('0' + Math.floor(offset / 3600)).substr(-2);\n formattedOffset += ':' + ('0' + Math.floor((offset % 3600) / 60)).substr(-2);\n\n return formattedOffset;\n }", "function timeZoneGetter(width) {\n return function (date, locale, offset) {\n var zone = -1 * offset;\n var minusSign = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);\n var hours = zone > 0 ? Math.floor(zone / 60) : Math.ceil(zone / 60);\n switch (width) {\n case ZoneWidth.Short:\n return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n case ZoneWidth.ShortGMT:\n return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 1, minusSign);\n case ZoneWidth.Long:\n return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n case ZoneWidth.Extended:\n if (offset === 0) {\n return 'Z';\n }\n else {\n return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n }\n default:\n throw new Error(\"Unknown zone width \\\"\" + width + \"\\\"\");\n }\n };\n}", "function timeZoneGetter(width) {\n return function (date, locale, offset) {\n var zone = -1 * offset;\n var minusSign = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);\n var hours = zone > 0 ? Math.floor(zone / 60) : Math.ceil(zone / 60);\n switch (width) {\n case ZoneWidth.Short:\n return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n case ZoneWidth.ShortGMT:\n return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 1, minusSign);\n case ZoneWidth.Long:\n return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n case ZoneWidth.Extended:\n if (offset === 0) {\n return 'Z';\n }\n else {\n return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n }\n default:\n throw new Error(\"Unknown zone width \\\"\" + width + \"\\\"\");\n }\n };\n}", "function timeZoneGetter(width) {\n return function (date, locale, offset) {\n var zone = -1 * offset;\n var minusSign = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);\n var hours = zone > 0 ? Math.floor(zone / 60) : Math.ceil(zone / 60);\n switch (width) {\n case ZoneWidth.Short:\n return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n case ZoneWidth.ShortGMT:\n return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 1, minusSign);\n case ZoneWidth.Long:\n return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n case ZoneWidth.Extended:\n if (offset === 0) {\n return 'Z';\n }\n else {\n return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n }\n default:\n throw new Error(\"Unknown zone width \\\"\" + width + \"\\\"\");\n }\n };\n}", "function timeZoneGetter(width) {\n return function (date, locale, offset) {\n var zone = -1 * offset;\n var minusSign = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);\n var hours = zone > 0 ? Math.floor(zone / 60) : Math.ceil(zone / 60);\n switch (width) {\n case ZoneWidth.Short:\n return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n case ZoneWidth.ShortGMT:\n return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 1, minusSign);\n case ZoneWidth.Long:\n return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n case ZoneWidth.Extended:\n if (offset === 0) {\n return 'Z';\n }\n else {\n return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n }\n default:\n throw new Error(\"Unknown zone width \\\"\" + width + \"\\\"\");\n }\n };\n}", "function timeZoneGetter(width) {\n return function (date, locale, offset) {\n var zone = -1 * offset;\n var minusSign = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);\n var hours = zone > 0 ? Math.floor(zone / 60) : Math.ceil(zone / 60);\n\n switch (width) {\n case ZoneWidth.Short:\n return (zone >= 0 ? '+' : '') + padNumber(hours, 2, minusSign) + padNumber(Math.abs(zone % 60), 2, minusSign);\n\n case ZoneWidth.ShortGMT:\n return 'GMT' + (zone >= 0 ? '+' : '') + padNumber(hours, 1, minusSign);\n\n case ZoneWidth.Long:\n return 'GMT' + (zone >= 0 ? '+' : '') + padNumber(hours, 2, minusSign) + ':' + padNumber(Math.abs(zone % 60), 2, minusSign);\n\n case ZoneWidth.Extended:\n if (offset === 0) {\n return 'Z';\n } else {\n return (zone >= 0 ? '+' : '') + padNumber(hours, 2, minusSign) + ':' + padNumber(Math.abs(zone % 60), 2, minusSign);\n }\n\n default:\n throw new Error(\"Unknown zone width \\\"\".concat(width, \"\\\"\"));\n }\n };\n}", "function timeZoneGetter(width) {\n return function (date, locale, offset) {\n var zone = -1 * offset;\n var minusSign = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);\n var hours = zone > 0 ? Math.floor(zone / 60) : Math.ceil(zone / 60);\n\n switch (width) {\n case ZoneWidth.Short:\n return (zone >= 0 ? '+' : '') + padNumber(hours, 2, minusSign) + padNumber(Math.abs(zone % 60), 2, minusSign);\n\n case ZoneWidth.ShortGMT:\n return 'GMT' + (zone >= 0 ? '+' : '') + padNumber(hours, 1, minusSign);\n\n case ZoneWidth.Long:\n return 'GMT' + (zone >= 0 ? '+' : '') + padNumber(hours, 2, minusSign) + ':' + padNumber(Math.abs(zone % 60), 2, minusSign);\n\n case ZoneWidth.Extended:\n if (offset === 0) {\n return 'Z';\n } else {\n return (zone >= 0 ? '+' : '') + padNumber(hours, 2, minusSign) + ':' + padNumber(Math.abs(zone % 60), 2, minusSign);\n }\n\n default:\n throw new Error(\"Unknown zone width \\\"\".concat(width, \"\\\"\"));\n }\n };\n }", "function timeZoneGetter(width) {\n return function (date, locale, offset) {\n const zone = -1 * offset;\n const minusSign = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);\n const hours = zone > 0 ? Math.floor(zone / 60) : Math.ceil(zone / 60);\n\n switch (width) {\n case ZoneWidth.Short:\n return (zone >= 0 ? '+' : '') + padNumber(hours, 2, minusSign) + padNumber(Math.abs(zone % 60), 2, minusSign);\n\n case ZoneWidth.ShortGMT:\n return 'GMT' + (zone >= 0 ? '+' : '') + padNumber(hours, 1, minusSign);\n\n case ZoneWidth.Long:\n return 'GMT' + (zone >= 0 ? '+' : '') + padNumber(hours, 2, minusSign) + ':' + padNumber(Math.abs(zone % 60), 2, minusSign);\n\n case ZoneWidth.Extended:\n if (offset === 0) {\n return 'Z';\n } else {\n return (zone >= 0 ? '+' : '') + padNumber(hours, 2, minusSign) + ':' + padNumber(Math.abs(zone % 60), 2, minusSign);\n }\n\n default:\n throw new Error(`Unknown zone width \"${width}\"`);\n }\n };\n}", "function timeZoneGetter(width) {\n return function (date, locale, offset) {\n const zone = -1 * offset;\n const minusSign = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);\n const hours = zone > 0 ? Math.floor(zone / 60) : Math.ceil(zone / 60);\n switch (width) {\n case ZoneWidth.Short:\n return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n case ZoneWidth.ShortGMT:\n return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 1, minusSign);\n case ZoneWidth.Long:\n return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n case ZoneWidth.Extended:\n if (offset === 0) {\n return 'Z';\n }\n else {\n return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n }\n default:\n throw new Error(`Unknown zone width \"${width}\"`);\n }\n };\n}", "function timeZoneGetter(width) {\n return function (date, locale, offset) {\n const zone = -1 * offset;\n const minusSign = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);\n const hours = zone > 0 ? Math.floor(zone / 60) : Math.ceil(zone / 60);\n switch (width) {\n case ZoneWidth.Short:\n return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n case ZoneWidth.ShortGMT:\n return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 1, minusSign);\n case ZoneWidth.Long:\n return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n case ZoneWidth.Extended:\n if (offset === 0) {\n return 'Z';\n }\n else {\n return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n }\n default:\n throw new Error(`Unknown zone width \"${width}\"`);\n }\n };\n}", "function timeZoneGetter(width) {\n return function (date, locale, offset) {\n const zone = -1 * offset;\n const minusSign = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);\n const hours = zone > 0 ? Math.floor(zone / 60) : Math.ceil(zone / 60);\n switch (width) {\n case ZoneWidth.Short:\n return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n case ZoneWidth.ShortGMT:\n return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 1, minusSign);\n case ZoneWidth.Long:\n return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n case ZoneWidth.Extended:\n if (offset === 0) {\n return 'Z';\n }\n else {\n return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n }\n default:\n throw new Error(`Unknown zone width \"${width}\"`);\n }\n };\n}", "function timeZoneGetter(width) {\n return function (date, locale, offset) {\n const zone = -1 * offset;\n const minusSign = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);\n const hours = zone > 0 ? Math.floor(zone / 60) : Math.ceil(zone / 60);\n switch (width) {\n case ZoneWidth.Short:\n return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n case ZoneWidth.ShortGMT:\n return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 1, minusSign);\n case ZoneWidth.Long:\n return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n case ZoneWidth.Extended:\n if (offset === 0) {\n return 'Z';\n }\n else {\n return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n }\n default:\n throw new Error(`Unknown zone width \"${width}\"`);\n }\n };\n}", "function timeZoneGetter(width) {\n return function (date, locale, offset) {\n const zone = -1 * offset;\n const minusSign = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);\n const hours = zone > 0 ? Math.floor(zone / 60) : Math.ceil(zone / 60);\n switch (width) {\n case ZoneWidth.Short:\n return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n case ZoneWidth.ShortGMT:\n return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 1, minusSign);\n case ZoneWidth.Long:\n return 'GMT' + ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n case ZoneWidth.Extended:\n if (offset === 0) {\n return 'Z';\n }\n else {\n return ((zone >= 0) ? '+' : '') + padNumber(hours, 2, minusSign) + ':' +\n padNumber(Math.abs(zone % 60), 2, minusSign);\n }\n default:\n throw new Error(`Unknown zone width \"${width}\"`);\n }\n };\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 showLocalTime(offset) {\n const shortMonths = ['Jan', 'Feb', 'Mar', 'Apr',\n 'May', 'Jun', 'Jul', 'Aug',\n 'Sep', 'Oct', 'Nov', 'Dec'];\n const date = new Date(),\n hours = Math.abs(date.getUTCHours() + offset/3600) % 12 || 12,\n am = ((date.getUTCHours() + offset/3600) < 12) ? 'a.m.':'p.m.';\n\n return `${shortMonths[date.getUTCMonth()]} ${date.getUTCDate()},\n ${hours}:${addZero(date.getMinutes())} ${am}`;\n}", "function calculateTime(timezone) {\n let date = new Date();\n let localizedTime = date.toLocaleString(\"en-US\", {\n timeZone: `${timezone}`,\n hour: \"2-digit\",\n minute: \"2-digit\",\n });\n // console.log(localizedTime);\n return localizedTime;\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 correctedTime(time) {\n\tconst timezoneOffsetMinutes = new Date().getTimezoneOffset();\n\t//console.log('timezoneOffsetMinutes', timezoneOffsetMinutes);\n\treturn time-(timezoneOffsetMinutes*60)\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 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 timezone (tz) {\n if (isFinite(tz)) {\n return `INTERVAL '${tz} seconds'`;\n }\n return `'${tz}'`;\n}", "function DateAndTime_TimeZoneToChar(zone)\r\n{\r\n\tif (zone == null)\r\n\t{\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\tvar hours = Utilities_Div(zone, 3600);\r\n\tvar minutes = Utilities_Div(zone - (hours * 3600), 60);\r\n\r\n\tif (minutes == 0)\r\n\t{\r\n\t\t// NOTE: \"J\" is not used\r\n\t\tif (hours <= -10)\r\n\t\t{\r\n\t\t\treturn String.fromCharCode((\"A\").charCodeAt(0) - hours);\r\n\t\t}\r\n\t\telse if (hours < 0)\r\n\t\t{\r\n\t\t\treturn String.fromCharCode((\"A\").charCodeAt(0) - hours - 1);\r\n\t\t}\r\n\t\telse if (hours > 0)\r\n\t\t{\r\n\t\t\treturn String.fromCharCode((\"N\").charCodeAt(0) + hours - 1);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn \"Z\";\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\tif (minutes < 0)\r\n\t\t{\r\n\t\t\tminutes = -minutes;\r\n\t\t}\r\n\r\n\t\t// DRL FIXIT? Is it OK to use the extended format even for basic?\r\n\t\treturn hours + \":\" + sprintf(\"%02d\", minutes);\r\n\t}\r\n}", "function extractMinutesFromTime(str) {\n arr = str.split(':');\n return arr[1];\n }", "function get_time_zone_offset( ) {\n\tvar current_date = new Date( );\n\tvar gmt_offset = current_date.getTimezoneOffset( ) / 60;\n\treturn (gmt_offset);\n}", "function getTimeZoneOffsetHours()\n{\n var offset = new Date().getTimezoneOffset()/60;\n return offset;\n}", "function ConvertTimeX(offset) {\n var myDate = new Date(offset);\n var ts_tostring = myDate.toGMTString();\n //\t\tvar ts_tolocalstring = \" \"+myDate.toLocaleString()\n return ts_tostring;\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 calcTime(city, 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 return utc + 3600000*offset;\r\n\t//nd = new Date(utc + (3600000*offset));\r\n // return time as a string\r\n //return nd;\r\n}", "function getTimezoneOffset(d, tz) {\n var ls = Utilities.formatDate(d, tz, \"yyyy/MM/dd HH:mm:ss\");\n var a = ls.split(/[\\/\\s:]/);\n //Logger.log(\"getTimezoneOffset:\" + tz + ' = ls = ' + ls + ' / a = ' + a)\n a[1]--;\n var t1 = Date.UTC.apply(null, a);\n var t2 = new Date(d).setMilliseconds(0);\n return (t2 - t1) / 60 / 1000;\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 stringToMinutes(str) {\n const parts = str.split(' ');\n return +parts[0] * DURATION_MAP[parts[1]];\n}", "function stringToMinutes(str) {\n const parts = str.split(' ');\n return +parts[0] * DURATION_MAP[parts[1]];\n}", "makeMinutes(timeString) {\n let hm = timeString.split(\":\")\n if (hm.length < 2) {\n hm[1] = timeString.substr(-2)\n hm[0] = timeString.substr(0, timeString.length - 2)\n }\n var ret = parseInt(hm[0]) * 60 + parseInt(hm[1])\n return ret;\n }", "function adjustTime(time) {\n return time + 60 * (serverTimeZoneOffset + localTimeZoneOffset);\n}", "function calcUTCAirTime(d, timeStr, offset) {\n\n\t// Time is a string in HH:MM format\n\tvar hours = parseInt(timeStr.split(':')[0]);\n\tvar minutes = parseInt(timeStr.split(':')[1]);\n\td.setUTCHours(hours);\n\td.setUTCMinutes(minutes);\n\td = addTime(d, -offset, 'sec');\n\treturn d;\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(city, offset) {\n\n // create Date object for current location\n var d = new Date();\n\n // convert to msec\n // add local time zone offset\n // get UTC time in msec\n var utc = d.getTime() + (d.getTimezoneOffset() * 60000);\n\n // create new Date object for different city\n // using supplied offset\n var nd = new Date(utc + (3600000*offset));\n\n // return time as a string\n return \"The local time in \" + city + \" is \" + nd.toLocaleString();\n}", "function normalizeTimeOffset(timestamp) {\n if (timestamp && (timestamp[timestamp.length - 5] === '-' || timestamp[timestamp.length - 5] === '+')) {\n return timestamp.slice(0, timestamp.length - 2).concat(':', timestamp.slice(-2));\n }\n\n return timestamp;\n }", "function getTimeZoneCode(houtUTC) {\n\tlet rs = [];\n\tif (houtUTC >= 0 && houtUTC <= 11)\n\t\trs.push(-1 * ((houtUTC) % 12));//from 0 to 12\n\tif (houtUTC >= 10)\n\t\trs.push(((24 - houtUTC) % 24));//from 10 to 23\n\treturn rs;\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 C9(a) {\na = - a.getTimezoneOffset();\nreturn null !== a ? a : 0\n}", "function formatTimeZone(datetime) {\r\n return datetime.substring(0,10) + \" \" + datetime.substring(11,19);\r\n}", "function deviceprint_timezone () {\n\t\tvar gmtHours = (new Date().getTimezoneOffset()/60)*(-1);\n\t\treturn gmtHours;\n\t}", "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 convertTimeToMinutes (timeString) {\r\n let splitString = timeString.split(':')\r\n let hour = parseInt(splitString[0])\r\n let minutes = parseInt(splitString[1])\r\n return hour * HOUR_IN_MINUTES + minutes\r\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}", "moins(nombreJours){\n return this.offset(-1*nombreJours*24*3600)\n}", "findTimeZoneId(timezoneStr){\n let timezones = this.props.time_zones;\n let timezone = timezones.filter((element)=>{\n console.log('element', element);\n return element['time_zone'].includes(timezoneStr);\n \n });\n if(timezone.length > 0){\n let id = timezone[0]['id'];\n return id;\n \n }\n }", "function tzTokenizeDate(date, timeZone) {\n var dtf = getDateTimeFormat(timeZone);\n return dtf.formatToParts ? partsOffset(dtf, date) : hackyOffset(dtf, date)\n}", "function getSetOffset(input,keepLocalTime,keepMinutes){var offset=this._offset||0,localAdjust;if(!this.isValid()){return input!=null?this:NaN;}if(input!=null){if(typeof input==='string'){input=offsetFromString(matchShortOffset,input);if(input===null){return this;}}else if(Math.abs(input)<16&&!keepMinutes){input=input*60;}if(!this._isUTC&&keepLocalTime){localAdjust=getDateOffset(this);}this._offset=input;this._isUTC=true;if(localAdjust!=null){this.add(localAdjust,'m');}if(offset!==input){if(!keepLocalTime||this._changeInProgress){addSubtract(this,createDuration(input-offset,'m'),1,false);}else if(!this._changeInProgress){this._changeInProgress=true;hooks.updateOffset(this,true);this._changeInProgress=null;}}return this;}else{return this._isUTC?offset:getDateOffset(this);}}", "function getSetOffset(input,keepLocalTime,keepMinutes){var offset=this._offset||0,localAdjust;if(!this.isValid()){return input!=null?this:NaN;}if(input!=null){if(typeof input==='string'){input=offsetFromString(matchShortOffset,input);if(input===null){return this;}}else if(Math.abs(input)<16&&!keepMinutes){input=input*60;}if(!this._isUTC&&keepLocalTime){localAdjust=getDateOffset(this);}this._offset=input;this._isUTC=true;if(localAdjust!=null){this.add(localAdjust,'m');}if(offset!==input){if(!keepLocalTime||this._changeInProgress){addSubtract(this,createDuration(input-offset,'m'),1,false);}else if(!this._changeInProgress){this._changeInProgress=true;hooks.updateOffset(this,true);this._changeInProgress=null;}}return this;}else{return this._isUTC?offset:getDateOffset(this);}}", "function tzTokenizeDate(date, timeZone) {\n var dtf = getDateTimeFormat(timeZone);\n return dtf.formatToParts ? partsOffset(dtf, date) : hackyOffset(dtf, date);\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}", "function timeZoneCheck() {\n var timeZoneLog = document.querySelector(\".timezone\");\n var timeZone = response.timezone;\n console.log(timeZone);\n\n timeZoneLog.innerHTML += timeZone;\n }", "function getRelativeTime(room, offset) {\n var now = new Date();\n // if hour is 1 - 9, we assume user means PM\n if (room['when'].getHours() >= 1 && room['when'].getHours() <= 9) {\n var hour = room['when'].getHours() + 12;\n } else {\n var hour = room['when'].getHours();\n }\n return {\n 'm': room['when'].getMinutes(),\n 'h': hour,\n 'nm': now.getMinutes(),\n 'nh': now.getHours() + offset\n };\n}", "function signedOffset(offHourStr, offMinuteStr) {\n const offHour = parseInt(offHourStr, 10) || 0,\n offMin = parseInt(offMinuteStr, 10) || 0,\n offMinSigned = offHour < 0 ? -offMin : offMin;\n return offHour * 60 + offMinSigned;\n}", "getTranslate() {\n // 8:00 is translateY(43px)\n let res = 43;\n // start gives in the format of \"00:00\"\n let hr = (parseInt(this.state.eventInfo.time_start.substring(0, 2)) - 8) * 2;\n let min = parseInt(this.state.eventInfo.time_start.substring(3, 5)) / 30;\n // half an hour is an additional of 21px\n res += ((hr + min) * 21)\n return res;\n }", "function getTimes() {\n\t\t\tmoment.tz.add([\n\t\t\t\t'Eire|GMT IST|0 -10|01010101010101010101010|1BWp0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00',\n\t\t\t\t'Asia/Tokyo|JST|-90|0|',\n\t\t\t\t'Europe/Prague|LMT PMT CET CEST GMT|-V.I -V.I -10 -20 0|0123232323232323232423232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232|-4QbAV.I 1FDc0 XPaV.I 11d0 1iO0 11A0 1o00 11A0 Qrc0 6i00 WM0 1fA0 1cM0 1cM0 1cM0 1cM0 1qM0 11c0 mp0 xA0 mn0 17c0 1io0 17c0 1fc0 1ao0 1bNc0 1cM0 1fA0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00|13e5',\n\t\t\t\t'America/New_York|EST EDT|50 40|0101|1Lz50 1zb0 Op0',\n\t\t\t\t'America/Los_Angeles|LMT PST PDT PWT PPT|7Q.W 80 70 70 70|0121213412121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121|-3tFE0 1nEe0 1nX0 11B0 1nX0 SgN0 8x10 iy0 5Wp1 1VaX 3dA0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1a00 1fA0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|15e6'\n\t\t\t]);\n\t\t\tvar now = new Date();\n\t\t\t// Set the time manually for each of the clock types we're using\n\t\t\tvar times = [{\n\t\t\t\t\tjsclass: 'js-tokyo',\n\t\t\t\t\tjstime: moment.tz(now, \"Asia/Tokyo\"),\n\t\t\t\t\tjszone: \"Asia/Tokyo\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tjsclass: 'js-london',\n\t\t\t\t\tjstime: moment.tz(now, \"Eire\"),\n\t\t\t\t\tjszone: \"Eire\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tjsclass: 'js-new-york',\n\t\t\t\t\tjstime: moment.tz(now, \"America/New_York\"),\n\t\t\t\t\tjszone: \"America/New_York\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tjsclass: 'js-prague',\n\t\t\t\t\tjstime: moment.tz(now, \"Europe/Prague\"),\n\t\t\t\t\tjszone: \"Europe/Prague\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tjsclass: 'js-los-angeles',\n\t\t\t\t\tjstime: moment.tz(now, \"America/Los_Angeles\"),\n\t\t\t\t\tjszone: \"America/Los_Angeles\"\n\t\t\t\t}\n\t\t\t];\n\t\t\treturn times;\n\t\t}", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n const o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n const o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n const o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n const o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function parse_utc(value)\n{\n var value_int = parse_int(value);\n \n if ((value_int > 3600) || (value_int < -3600))\n {\n console.error(\"timezone out of range\");\n return NaN;\n } \n return value_int;\n}", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n} // convert an epoch timestamp into a calendar object with the given offset", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000;\n\n // Test whether the zone matches the offset for this ts\n const o2 = tz.offset(utcGuess);\n\n // If so, offset didn't change and we're done\n if (o === o2) {\n return [utcGuess, o];\n }\n\n // If not, change the ts by the difference in the offset\n utcGuess -= (o2 - o) * 60 * 1000;\n\n // If that gives us the local time we want, we're done\n const o3 = tz.offset(utcGuess);\n if (o2 === o3) {\n return [utcGuess, o2];\n }\n\n // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n}", "function CountingMinutes(str) { \n var times = str.split('-'); // [9:00am, 10:00am]\n var time1 = times[0].slice(0, times[0].length-2).split(':'); // [9, 00]\n var time2 = times[1].slice(0, times[1].length-2).split(':'); // [10, 00]\n var time1ap = times[0][times[0].length-2]; // a\n var time2ap = times[1][times[1].length-2]; // a\n var time1min = parseInt(time1[0]) * 60 + parseInt(time1[1]);\n var time2min = parseInt(time2[0]) * 60 + parseInt(time2[1]);\n if (time1ap == 'p' && time1[0] != '12'){\n time1min += 720;\n }\n if (time2ap == 'p' && time2[0] != '12'){\n time2min += 720;\n }\n if (time1ap == 'a' && time1[0] == '12'){\n time1min -= 720;\n }\n if (time2ap == 'a' && time2[0] == '12'){\n time2min -= 720;\n }\n if (time1min > time2min){\n return 1440 - (time1min - time2min);\n } else {\n return time2min - time1min;\n }\n}", "get timeZone() {\n\t\treturn this.nativeElement ? this.nativeElement.timeZone : undefined;\n\t}", "function getSetOffset(input,keepLocalTime,keepMinutes){var offset=this._offset || 0,localAdjust;if(!this.isValid()){return input != null?this:NaN;}if(input != null){if(typeof input === 'string'){input = offsetFromString(matchShortOffset,input);if(input === null){return this;}}else if(Math.abs(input) < 16 && !keepMinutes){input = input * 60;}if(!this._isUTC && keepLocalTime){localAdjust = getDateOffset(this);}this._offset = input;this._isUTC = true;if(localAdjust != null){this.add(localAdjust,'m');}if(offset !== input){if(!keepLocalTime || this._changeInProgress){addSubtract(this,createDuration(input - offset,'m'),1,false);}else if(!this._changeInProgress){this._changeInProgress = true;hooks.updateOffset(this,true);this._changeInProgress = null;}}return this;}else {return this._isUTC?offset:getDateOffset(this);}}", "function formatIsoTimeString(marker) {\n return padStart(marker.getUTCHours(), 2) + ':' +\n padStart(marker.getUTCMinutes(), 2) + ':' +\n padStart(marker.getUTCSeconds(), 2);\n }", "function fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts\n\n var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done\n\n if (o === o2) {\n return [utcGuess, o];\n } // If not, change the ts by the difference in the offset\n\n\n utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done\n\n var o3 = tz.offset(utcGuess);\n\n if (o2 === o3) {\n return [utcGuess, o2];\n } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n\n\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n } // convert an epoch timestamp into a calendar object with the given offset", "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}", "displayDate(sqlDateString) {\n //if we use .toString and cut off the timezone info, it will be off by however many hours GMT is\n //so we add the offset (which is in minutes) to the raw timestamp\n var dateObj = new Date(sqlDateString)\n //offset += 300; //have to add 300 more to offset on production\n //console.log(offset);\n //dateObj.setTime(dateObj.getTime() + (offset*60*1000));\n return dateObj.toString().split(' GMT')[0];\n }", "function formatTime(string) {\n return string.slice(0, 5);\n }", "function minutesSinceMidnight (text) {\r\n\tvar ArraySplit = text.split(':');\r\n\treturn (parseInt(ArraySplit[0] * 60) + parseInt(ArraySplit[1]));\r\n} //End Get minutes since midnight", "function getLocaleTimeString(dateObj){\n console.log('entered into getLocaleTimeString function');\n // var obj = new Date(Date.parse(dateObj)-(330*60*1000))\n\n return dateObj.toLocaleTimeString('en-US',{ hour: 'numeric', hour12: true, timeZone: timeZone });\n}", "function getTimes() {\n moment.tz.add([\n \"Europe/Moscow|MMT MMT MST MDST MSD MSK +05 EET EEST MSK|-2u.h -2v.j -3v.j -4v.j -40 -30 -50 -20 -30 -40|012132345464575454545454545454545458754545454545454545454545454545454545454595|-2ag2u.h 2pyW.W 1bA0 11X0 GN0 1Hb0 c4v.j ik0 3DA0 dz0 15A0 c10 2q10 iM10 23CL0 1db0 1cN0 1db0 1cN0 1db0 1dd0 1cO0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cN0 IM0 rX0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 8Hz0|16e6\",\n \"Europe/London|GMT BST BDST|0 -10 -20|0101010101010101010101010101010101010101010101010121212121210101210101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-2axa0 Rc0 1fA0 14M0 1fc0 1g00 1co0 1dc0 1co0 1oo0 1400 1dc0 19A0 1io0 1io0 WM0 1o00 14o0 1o00 17c0 1io0 17c0 1fA0 1a00 1lc0 17c0 1io0 17c0 1fA0 1a00 1io0 17c0 1io0 17c0 1fA0 1cM0 1io0 17c0 1fA0 1a00 1io0 17c0 1io0 17c0 1fA0 1a00 1io0 1qM0 Dc0 2Rz0 Dc0 1zc0 Oo0 1zc0 Rc0 1wo0 17c0 1iM0 FA0 xB0 1fA0 1a00 14o0 bb0 LA0 xB0 Rc0 1wo0 11A0 1o00 17c0 1fA0 1a00 1fA0 1cM0 1fA0 1a00 17c0 1fA0 1a00 1io0 17c0 1lc0 17c0 1fA0 1a00 1io0 17c0 1io0 17c0 1fA0 1a00 1a00 1qM0 WM0 1qM0 11A0 1o00 WM0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1tA0 IM0 90o0 U00 1tA0 U00 1tA0 U00 1tA0 U00 1tA0 WM0 1qM0 WM0 1qM0 WM0 1tA0 U00 1tA0 U00 1tA0 11z0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 14o0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|10e6\",\n \"Europe/Rome|CET CEST|-10 -20|0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-2arB0 Lz0 1cN0 1db0 1410 1on0 Wp0 1qL0 17d0 1cL0 M3B0 5M20 WM0 1fA0 1cM0 16M0 1iM0 16m0 1de0 1lc0 14m0 1lc0 WO0 1qM0 GTW0 On0 1C10 LA0 1C00 LA0 1EM0 LA0 1C00 LA0 1zc0 Oo0 1C00 Oo0 1C00 LA0 1zc0 Oo0 1C00 LA0 1C00 LA0 1zc0 Oo0 1C00 Oo0 1zc0 Oo0 1fC0 1a00 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|39e5\",\n \"America/Los_Angeles|PST PDT PWT PPT|80 70 70 70|010102301010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-261q0 1nX0 11B0 1nX0 SgN0 8x10 iy0 5Wp1 1VaX 3dA0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1a00 1fA0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1cN0 1cL0 1cN0 1cL0 s10 1Vz0 LB0 1BX0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 1cN0 1fz0 1a10 1fz0 1cN0 1cL0 1cN0 1cL0 1cN0 1cL0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|15e6\"\n ]);\n var now = new Date();\n // Set the time manually for each of the clock types we're using\n var times = [\n {\n jsclass: 'Moscow-time',\n jstime: moment.tz(now, \"Europe/Moscow\")\n },\n {\n jsclass: 'London-time',\n jstime: moment.tz(now, \"Europe/London\")\n },\n {\n jsclass: 'Rome-time',\n jstime: moment.tz(now, \"Europe/Rome\")\n },\n {\n jsclass: 'San-time',\n jstime: moment.tz(now, \"America/Los_Angeles\")\n }\n ];\n return times;\n}", "adjustMinutes(amt) {\n let newDecimal = this.decimal + amt;\n this.decimal = newDecimal;\n this.hour = Math.floor(newDecimal);\n let remainder = (newDecimal - Math.floor(newDecimal))*60;\n this.minute = remainder ? remainder : '00';\n }", "function hoursMinutes() {\r\n return nf(twelveHour(), 2) + ':' + nf(minute(), 2);\r\n}", "function worldClock(zone, region){\r\nvar dst = 0\r\nvar time = new Date()\r\nvar gmtMS = time.getTime() + (time.getTimezoneOffset() * 60000)\r\nvar gmtTime = new Date(gmtMS)\r\n\r\nvar hr = gmtTime.getHours() + zone\r\nvar min = gmtTime.getMinutes()\r\n\r\nif (hr >= 24){\r\nhr = hr-24\r\nday -= -1\r\n}\r\nif (hr < 0){\r\nhr -= -24\r\nday -= 1\r\n}\r\nif (hr < 10){\r\nhr = \" \" + hr\r\n}\r\nif (min < 10){\r\nmin = \"0\" + min\r\n}\r\n\r\n\r\n//america\r\nif (region == \"NAmerica\"){\r\n\tvar startDST = new Date()\r\n\tvar endDST = new Date()\r\n\tstartDST.setHours(2)\r\n\tendDST.setHours(1)\r\n\tvar currentTime = new Date()\r\n\tcurrentTime.setHours(hr)\r\n\tif(currentTime >= startDST && currentTime < endDST){\r\n\t\tdst = 1\r\n\t\t}\r\n}\r\n\r\n//europe\r\nif (region == \"Europe\"){\r\n\tvar startDST = new Date()\r\n\tvar endDST = new Date()\r\n\tstartDST.setHours(1)\r\n\tendDST.setHours(0)\r\n\tvar currentTime = new Date()\r\n\tcurrentTime.setHours(hr)\r\n\tif(currentTime >= startDST && currentTime < endDST){\r\n\t\tdst = 1\r\n\t\t}\r\n}\r\n\r\nif (dst == 1){\r\n\thr -= -1\r\n\tif (hr >= 24){\r\n\thr = hr-24\r\n\tday -= -1\r\n\t}\r\n\tif (hr < 10){\r\n\thr = \" \" + hr\r\n\t}\r\nreturn hr + \":\" + min + \" DST\"\r\n}\r\nelse{\r\nreturn hr + \":\" + min\r\n}\r\n}", "function CountingMinutesI(str) {\n\n // code goes here\n return str;\n\n}", "function timeConversion(s) {\n let hour = parseInt(s.slice(0, 2));\n let clock = s.slice(8, 10);\n if (clock === 'PM') {\n hour = (hour == 12) ? hour = 12 : hour += 12;\n //better way is\n // hour = (hour % 12) + 12;\n } else {\n hour = (hour == 12) ? hour = 0 : hour;\n }\n return hour.toString().padStart(2, 0) + s.slice(2,8)\n}", "function get24HrFormat(str) {\n let _t = str.split(/[^0-9]/g);\n _t[0] =+_t[0] + (str.indexOf(\"pm\")>-1 && +_t[0]!==12 ? 12: 0);\n return _t.join(\"\");\n }", "function getMinutes(time) {\n return time.split(\":\")[1];\n}", "get timezoneOffset() {\n if (Date._timezoneOffsetStd === undefined) this._calculateOffset();\n return Date._timezoneOffsetStd;\n }", "function turnHoursToMinutes() {}", "function turnHoursToMinutes() {}", "function turnHoursToMinutes() {}" ]
[ "0.6731454", "0.6536645", "0.6523671", "0.6376978", "0.62868947", "0.6234645", "0.61826414", "0.61399025", "0.60549206", "0.5985354", "0.59629494", "0.59629494", "0.59629494", "0.59629494", "0.5925084", "0.5924408", "0.590883", "0.59074557", "0.59074557", "0.59074557", "0.59074557", "0.59074557", "0.5876317", "0.57478935", "0.5719295", "0.5708191", "0.57040524", "0.5689781", "0.56657505", "0.56657505", "0.56657505", "0.5619719", "0.55851424", "0.55844027", "0.5580311", "0.55585074", "0.55407596", "0.551262", "0.54481274", "0.5429537", "0.54114413", "0.53987944", "0.53987944", "0.5389718", "0.53862435", "0.53743875", "0.53567934", "0.53567934", "0.53552926", "0.5351826", "0.5337551", "0.53322214", "0.5325247", "0.53193945", "0.526776", "0.52609277", "0.5260403", "0.5243408", "0.5240138", "0.52337694", "0.52290803", "0.51907045", "0.51907045", "0.5188218", "0.51756835", "0.5169836", "0.5169803", "0.51661396", "0.5156881", "0.5152929", "0.51509327", "0.51509327", "0.51452047", "0.5135847", "0.5135847", "0.5135847", "0.5135847", "0.5135847", "0.51350164", "0.5130499", "0.5129716", "0.512862", "0.5106178", "0.5101466", "0.5098835", "0.50905645", "0.5085369", "0.5084937", "0.50779194", "0.50673926", "0.50613827", "0.50586426", "0.5034128", "0.50064576", "0.5005777", "0.49964726", "0.49930084", "0.49923775", "0.4992073", "0.4992073", "0.4992073" ]
0.0
-1
Specifying nextDayThreshold signals that allday ranges should be sliced.
function sliceEventStore(eventStore, eventUiBases, framingRange, nextDayThreshold) { var inverseBgByGroupId = {}; var inverseBgByDefId = {}; var defByGroupId = {}; var bgRanges = []; var fgRanges = []; var eventUis = compileEventUis(eventStore.defs, eventUiBases); for (var defId in eventStore.defs) { var def = eventStore.defs[defId]; if (def.rendering === 'inverse-background') { if (def.groupId) { inverseBgByGroupId[def.groupId] = []; if (!defByGroupId[def.groupId]) { defByGroupId[def.groupId] = def; } } else { inverseBgByDefId[defId] = []; } } } for (var instanceId in eventStore.instances) { var instance = eventStore.instances[instanceId]; var def = eventStore.defs[instance.defId]; var ui = eventUis[def.defId]; var origRange = instance.range; var normalRange = (!def.allDay && nextDayThreshold) ? computeVisibleDayRange(origRange, nextDayThreshold) : origRange; var slicedRange = intersectRanges(normalRange, framingRange); if (slicedRange) { if (def.rendering === 'inverse-background') { if (def.groupId) { inverseBgByGroupId[def.groupId].push(slicedRange); } else { inverseBgByDefId[instance.defId].push(slicedRange); } } else { (def.rendering === 'background' ? bgRanges : fgRanges).push({ def: def, ui: ui, instance: instance, range: slicedRange, isStart: normalRange.start && normalRange.start.valueOf() === slicedRange.start.valueOf(), isEnd: normalRange.end && normalRange.end.valueOf() === slicedRange.end.valueOf() }); } } } for (var groupId in inverseBgByGroupId) { // BY GROUP var ranges = inverseBgByGroupId[groupId]; var invertedRanges = invertRanges(ranges, framingRange); for (var _i = 0, invertedRanges_1 = invertedRanges; _i < invertedRanges_1.length; _i++) { var invertedRange = invertedRanges_1[_i]; var def = defByGroupId[groupId]; var ui = eventUis[def.defId]; bgRanges.push({ def: def, ui: ui, instance: null, range: invertedRange, isStart: false, isEnd: false }); } } for (var defId in inverseBgByDefId) { var ranges = inverseBgByDefId[defId]; var invertedRanges = invertRanges(ranges, framingRange); for (var _a = 0, invertedRanges_2 = invertedRanges; _a < invertedRanges_2.length; _a++) { var invertedRange = invertedRanges_2[_a]; bgRanges.push({ def: eventStore.defs[defId], ui: eventUis[defId], instance: null, range: invertedRange, isStart: false, isEnd: false }); } } return { bg: bgRanges, fg: fgRanges }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computeVisibleDayRange(timedRange, nextDayThreshold) {\n if (nextDayThreshold === void 0) {\n nextDayThreshold = duration_1.createDuration(0);\n }\n\n var startDay = null;\n var endDay = null;\n\n if (timedRange.end) {\n endDay = marker_1.startOfDay(timedRange.end);\n var endTimeMS = timedRange.end.valueOf() - endDay.valueOf(); // # of milliseconds into `endDay`\n // If the end time is actually inclusively part of the next day and is equal to or\n // beyond the next day threshold, adjust the end to be the exclusive end of `endDay`.\n // Otherwise, leaving it as inclusive will cause it to exclude `endDay`.\n\n if (endTimeMS && endTimeMS >= duration_1.asRoughMs(nextDayThreshold)) {\n endDay = marker_1.addDays(endDay, 1);\n }\n }\n\n if (timedRange.start) {\n startDay = marker_1.startOfDay(timedRange.start); // the beginning of the day the range starts\n // If end is within `startDay` but not past nextDayThreshold, assign the default duration of one day.\n\n if (endDay && endDay <= startDay) {\n endDay = marker_1.addDays(startDay, 1);\n }\n }\n\n return {\n start: startDay,\n end: endDay\n };\n }", "function computeVisibleDayRange$1(timedRange, nextDayThreshold) {\n if (nextDayThreshold === void 0) { nextDayThreshold = createDuration$1(0); }\n var startDay = null;\n var endDay = null;\n if (timedRange.end) {\n endDay = startOfDay$1(timedRange.end);\n var endTimeMS = timedRange.end.valueOf() - endDay.valueOf(); // # of milliseconds into `endDay`\n // If the end time is actually inclusively part of the next day and is equal to or\n // beyond the next day threshold, adjust the end to be the exclusive end of `endDay`.\n // Otherwise, leaving it as inclusive will cause it to exclude `endDay`.\n if (endTimeMS && endTimeMS >= asRoughMs$1(nextDayThreshold)) {\n endDay = addDays$1(endDay, 1);\n }\n }\n if (timedRange.start) {\n startDay = startOfDay$1(timedRange.start); // the beginning of the day the range starts\n // If end is within `startDay` but not past nextDayThreshold, assign the default duration of one day.\n if (endDay && endDay <= startDay) {\n endDay = addDays$1(startDay, 1);\n }\n }\n return { start: startDay, end: endDay };\n }", "function computeVisibleDayRange(timedRange, nextDayThreshold) {\n if (nextDayThreshold === void 0) { nextDayThreshold = createDuration(0); }\n var startDay = null;\n var endDay = null;\n if (timedRange.end) {\n endDay = startOfDay(timedRange.end);\n var endTimeMS = timedRange.end.valueOf() - endDay.valueOf(); // # of milliseconds into `endDay`\n // If the end time is actually inclusively part of the next day and is equal to or\n // beyond the next day threshold, adjust the end to be the exclusive end of `endDay`.\n // Otherwise, leaving it as inclusive will cause it to exclude `endDay`.\n if (endTimeMS && endTimeMS >= asRoughMs(nextDayThreshold)) {\n endDay = addDays(endDay, 1);\n }\n }\n if (timedRange.start) {\n startDay = startOfDay(timedRange.start); // the beginning of the day the range starts\n // If end is within `startDay` but not past nextDayThreshold, assign the default duration of one day.\n if (endDay && endDay <= startDay) {\n endDay = addDays(startDay, 1);\n }\n }\n return { start: startDay, end: endDay };\n }", "function computeVisibleDayRange(timedRange, nextDayThreshold) {\n if (nextDayThreshold === void 0) { nextDayThreshold = createDuration(0); }\n var startDay = null;\n var endDay = null;\n if (timedRange.end) {\n endDay = startOfDay(timedRange.end);\n var endTimeMS = timedRange.end.valueOf() - endDay.valueOf(); // # of milliseconds into `endDay`\n // If the end time is actually inclusively part of the next day and is equal to or\n // beyond the next day threshold, adjust the end to be the exclusive end of `endDay`.\n // Otherwise, leaving it as inclusive will cause it to exclude `endDay`.\n if (endTimeMS && endTimeMS >= asRoughMs(nextDayThreshold)) {\n endDay = addDays(endDay, 1);\n }\n }\n if (timedRange.start) {\n startDay = startOfDay(timedRange.start); // the beginning of the day the range starts\n // If end is within `startDay` but not past nextDayThreshold, assign the default duration of one day.\n if (endDay && endDay <= startDay) {\n endDay = addDays(startDay, 1);\n }\n }\n return { start: startDay, end: endDay };\n }", "function computeVisibleDayRange(timedRange, nextDayThreshold) {\n if (nextDayThreshold === void 0) { nextDayThreshold = createDuration(0); }\n var startDay = null;\n var endDay = null;\n if (timedRange.end) {\n endDay = startOfDay(timedRange.end);\n var endTimeMS = timedRange.end.valueOf() - endDay.valueOf(); // # of milliseconds into `endDay`\n // If the end time is actually inclusively part of the next day and is equal to or\n // beyond the next day threshold, adjust the end to be the exclusive end of `endDay`.\n // Otherwise, leaving it as inclusive will cause it to exclude `endDay`.\n if (endTimeMS && endTimeMS >= asRoughMs(nextDayThreshold)) {\n endDay = addDays(endDay, 1);\n }\n }\n if (timedRange.start) {\n startDay = startOfDay(timedRange.start); // the beginning of the day the range starts\n // If end is within `startDay` but not past nextDayThreshold, assign the default duration of one day.\n if (endDay && endDay <= startDay) {\n endDay = addDays(startDay, 1);\n }\n }\n return { start: startDay, end: endDay };\n }", "function computeVisibleDayRange(timedRange, nextDayThreshold) {\n if (nextDayThreshold === void 0) { nextDayThreshold = createDuration(0); }\n var startDay = null;\n var endDay = null;\n if (timedRange.end) {\n endDay = startOfDay(timedRange.end);\n var endTimeMS = timedRange.end.valueOf() - endDay.valueOf(); // # of milliseconds into `endDay`\n // If the end time is actually inclusively part of the next day and is equal to or\n // beyond the next day threshold, adjust the end to be the exclusive end of `endDay`.\n // Otherwise, leaving it as inclusive will cause it to exclude `endDay`.\n if (endTimeMS && endTimeMS >= asRoughMs(nextDayThreshold)) {\n endDay = addDays(endDay, 1);\n }\n }\n if (timedRange.start) {\n startDay = startOfDay(timedRange.start); // the beginning of the day the range starts\n // If end is within `startDay` but not past nextDayThreshold, assign the default duration of one day.\n if (endDay && endDay <= startDay) {\n endDay = addDays(startDay, 1);\n }\n }\n return { start: startDay, end: endDay };\n }", "function computeVisibleDayRange(timedRange, nextDayThreshold) {\n if (nextDayThreshold === void 0) {\n nextDayThreshold = createDuration(0);\n }\n\n var startDay = null;\n var endDay = null;\n\n if (timedRange.end) {\n endDay = startOfDay(timedRange.end);\n var endTimeMS = timedRange.end.valueOf() - endDay.valueOf(); // # of milliseconds into `endDay`\n // If the end time is actually inclusively part of the next day and is equal to or\n // beyond the next day threshold, adjust the end to be the exclusive end of `endDay`.\n // Otherwise, leaving it as inclusive will cause it to exclude `endDay`.\n\n if (endTimeMS && endTimeMS >= asRoughMs(nextDayThreshold)) {\n endDay = addDays(endDay, 1);\n }\n }\n\n if (timedRange.start) {\n startDay = startOfDay(timedRange.start); // the beginning of the day the range starts\n // If end is within `startDay` but not past nextDayThreshold, assign the default duration of one day.\n\n if (endDay && endDay <= startDay) {\n endDay = addDays(startDay, 1);\n }\n }\n\n return {\n start: startDay,\n end: endDay\n };\n } // spans from one day into another?", "function computeVisibleDayRange(timedRange, nextDayThreshold) {\n if (nextDayThreshold === void 0) { nextDayThreshold = createDuration(0); }\n var startDay = null;\n var endDay = null;\n if (timedRange.end) {\n endDay = startOfDay(timedRange.end);\n var endTimeMS = timedRange.end.valueOf() - endDay.valueOf(); // # of milliseconds into `endDay`\n // If the end time is actually inclusively part of the next day and is equal to or\n // beyond the next day threshold, adjust the end to be the exclusive end of `endDay`.\n // Otherwise, leaving it as inclusive will cause it to exclude `endDay`.\n if (endTimeMS && endTimeMS >= asRoughMs(nextDayThreshold)) {\n endDay = addDays(endDay, 1);\n }\n }\n if (timedRange.start) {\n startDay = startOfDay(timedRange.start); // the beginning of the day the range starts\n // If end is within `startDay` but not past nextDayThreshold, assign the default duration of one day.\n if (endDay && endDay <= startDay) {\n endDay = addDays(startDay, 1);\n }\n }\n return { start: startDay, end: endDay };\n}", "function sliceEvents(props, allDay) {\n return sliceEventStore(props.eventStore, props.eventUiBases, props.dateProfile.activeRange, allDay ? props.nextDayThreshold : null).fg;\n }", "function sliceEventStore$1(eventStore, eventUiBases, framingRange, nextDayThreshold) {\n var inverseBgByGroupId = {};\n var inverseBgByDefId = {};\n var defByGroupId = {};\n var bgRanges = [];\n var fgRanges = [];\n var eventUis = compileEventUis$1(eventStore.defs, eventUiBases);\n for (var defId in eventStore.defs) {\n var def = eventStore.defs[defId];\n if (def.rendering === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId] = [];\n if (!defByGroupId[def.groupId]) {\n defByGroupId[def.groupId] = def;\n }\n }\n else {\n inverseBgByDefId[defId] = [];\n }\n }\n }\n for (var instanceId in eventStore.instances) {\n var instance = eventStore.instances[instanceId];\n var def = eventStore.defs[instance.defId];\n var ui = eventUis[def.defId];\n var origRange = instance.range;\n var normalRange = (!def.allDay && nextDayThreshold) ?\n computeVisibleDayRange$1(origRange, nextDayThreshold) :\n origRange;\n var slicedRange = intersectRanges$1(normalRange, framingRange);\n if (slicedRange) {\n if (def.rendering === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId].push(slicedRange);\n }\n else {\n inverseBgByDefId[instance.defId].push(slicedRange);\n }\n }\n else {\n (def.rendering === 'background' ? bgRanges : fgRanges).push({\n def: def,\n ui: ui,\n instance: instance,\n range: slicedRange,\n isStart: normalRange.start && normalRange.start.valueOf() === slicedRange.start.valueOf(),\n isEnd: normalRange.end && normalRange.end.valueOf() === slicedRange.end.valueOf()\n });\n }\n }\n }\n for (var groupId in inverseBgByGroupId) { // BY GROUP\n var ranges = inverseBgByGroupId[groupId];\n var invertedRanges = invertRanges$1(ranges, framingRange);\n for (var _i = 0, invertedRanges_1 = invertedRanges; _i < invertedRanges_1.length; _i++) {\n var invertedRange = invertedRanges_1[_i];\n var def = defByGroupId[groupId];\n var ui = eventUis[def.defId];\n bgRanges.push({\n def: def,\n ui: ui,\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false\n });\n }\n }\n for (var defId in inverseBgByDefId) {\n var ranges = inverseBgByDefId[defId];\n var invertedRanges = invertRanges$1(ranges, framingRange);\n for (var _a = 0, invertedRanges_2 = invertedRanges; _a < invertedRanges_2.length; _a++) {\n var invertedRange = invertedRanges_2[_a];\n bgRanges.push({\n def: eventStore.defs[defId],\n ui: eventUis[defId],\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false\n });\n }\n }\n return { bg: bgRanges, fg: fgRanges };\n }", "function sliceEventStore(eventStore, eventUiBases, framingRange, nextDayThreshold) {\n var inverseBgByGroupId = {};\n var inverseBgByDefId = {};\n var defByGroupId = {};\n var bgRanges = [];\n var fgRanges = [];\n var eventUis = compileEventUis(eventStore.defs, eventUiBases);\n\n for (var defId in eventStore.defs) {\n var def = eventStore.defs[defId];\n\n if (def.rendering === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId] = [];\n\n if (!defByGroupId[def.groupId]) {\n defByGroupId[def.groupId] = def;\n }\n } else {\n inverseBgByDefId[defId] = [];\n }\n }\n }\n\n for (var instanceId in eventStore.instances) {\n var instance = eventStore.instances[instanceId];\n var def = eventStore.defs[instance.defId];\n var ui = eventUis[def.defId];\n var origRange = instance.range;\n var normalRange = !def.allDay && nextDayThreshold ? misc_1.computeVisibleDayRange(origRange, nextDayThreshold) : origRange;\n var slicedRange = date_range_1.intersectRanges(normalRange, framingRange);\n\n if (slicedRange) {\n if (def.rendering === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId].push(slicedRange);\n } else {\n inverseBgByDefId[instance.defId].push(slicedRange);\n }\n } else {\n (def.rendering === 'background' ? bgRanges : fgRanges).push({\n def: def,\n ui: ui,\n instance: instance,\n range: slicedRange,\n isStart: normalRange.start && normalRange.start.valueOf() === slicedRange.start.valueOf(),\n isEnd: normalRange.end && normalRange.end.valueOf() === slicedRange.end.valueOf()\n });\n }\n }\n }\n\n for (var groupId in inverseBgByGroupId) {\n // BY GROUP\n var ranges = inverseBgByGroupId[groupId];\n var invertedRanges = date_range_1.invertRanges(ranges, framingRange);\n\n for (var _i = 0, invertedRanges_1 = invertedRanges; _i < invertedRanges_1.length; _i++) {\n var invertedRange = invertedRanges_1[_i];\n var def = defByGroupId[groupId];\n var ui = eventUis[def.defId];\n bgRanges.push({\n def: def,\n ui: ui,\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false\n });\n }\n }\n\n for (var defId in inverseBgByDefId) {\n var ranges = inverseBgByDefId[defId];\n var invertedRanges = date_range_1.invertRanges(ranges, framingRange);\n\n for (var _a = 0, invertedRanges_2 = invertedRanges; _a < invertedRanges_2.length; _a++) {\n var invertedRange = invertedRanges_2[_a];\n bgRanges.push({\n def: eventStore.defs[defId],\n ui: eventUis[defId],\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false\n });\n }\n }\n\n return {\n bg: bgRanges,\n fg: fgRanges\n };\n }", "function sliceEventStore(eventStore, eventUiBases, framingRange, nextDayThreshold) {\n var inverseBgByGroupId = {};\n var inverseBgByDefId = {};\n var defByGroupId = {};\n var bgRanges = [];\n var fgRanges = [];\n var eventUis = compileEventUis(eventStore.defs, eventUiBases);\n for (var defId in eventStore.defs) {\n var def = eventStore.defs[defId];\n var ui = eventUis[def.defId];\n if (ui.display === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId] = [];\n if (!defByGroupId[def.groupId]) {\n defByGroupId[def.groupId] = def;\n }\n }\n else {\n inverseBgByDefId[defId] = [];\n }\n }\n }\n for (var instanceId in eventStore.instances) {\n var instance = eventStore.instances[instanceId];\n var def = eventStore.defs[instance.defId];\n var ui = eventUis[def.defId];\n var origRange = instance.range;\n var normalRange = (!def.allDay && nextDayThreshold) ?\n computeVisibleDayRange(origRange, nextDayThreshold) :\n origRange;\n var slicedRange = intersectRanges(normalRange, framingRange);\n if (slicedRange) {\n if (ui.display === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId].push(slicedRange);\n }\n else {\n inverseBgByDefId[instance.defId].push(slicedRange);\n }\n }\n else if (ui.display !== 'none') {\n (ui.display === 'background' ? bgRanges : fgRanges).push({\n def: def,\n ui: ui,\n instance: instance,\n range: slicedRange,\n isStart: normalRange.start && normalRange.start.valueOf() === slicedRange.start.valueOf(),\n isEnd: normalRange.end && normalRange.end.valueOf() === slicedRange.end.valueOf(),\n });\n }\n }\n }\n for (var groupId in inverseBgByGroupId) { // BY GROUP\n var ranges = inverseBgByGroupId[groupId];\n var invertedRanges = invertRanges(ranges, framingRange);\n for (var _i = 0, invertedRanges_1 = invertedRanges; _i < invertedRanges_1.length; _i++) {\n var invertedRange = invertedRanges_1[_i];\n var def = defByGroupId[groupId];\n var ui = eventUis[def.defId];\n bgRanges.push({\n def: def,\n ui: ui,\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false,\n });\n }\n }\n for (var defId in inverseBgByDefId) {\n var ranges = inverseBgByDefId[defId];\n var invertedRanges = invertRanges(ranges, framingRange);\n for (var _a = 0, invertedRanges_2 = invertedRanges; _a < invertedRanges_2.length; _a++) {\n var invertedRange = invertedRanges_2[_a];\n bgRanges.push({\n def: eventStore.defs[defId],\n ui: eventUis[defId],\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false,\n });\n }\n }\n return { bg: bgRanges, fg: fgRanges };\n }", "function sliceEventStore(eventStore, eventUiBases, framingRange, nextDayThreshold) {\n var inverseBgByGroupId = {};\n var inverseBgByDefId = {};\n var defByGroupId = {};\n var bgRanges = [];\n var fgRanges = [];\n var eventUis = compileEventUis(eventStore.defs, eventUiBases);\n for (var defId in eventStore.defs) {\n var def = eventStore.defs[defId];\n if (def.rendering === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId] = [];\n if (!defByGroupId[def.groupId]) {\n defByGroupId[def.groupId] = def;\n }\n }\n else {\n inverseBgByDefId[defId] = [];\n }\n }\n }\n for (var instanceId in eventStore.instances) {\n var instance = eventStore.instances[instanceId];\n var def = eventStore.defs[instance.defId];\n var ui = eventUis[def.defId];\n var origRange = instance.range;\n var normalRange = (!def.allDay && nextDayThreshold) ?\n computeVisibleDayRange(origRange, nextDayThreshold) :\n origRange;\n var slicedRange = intersectRanges(normalRange, framingRange);\n if (slicedRange) {\n if (def.rendering === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId].push(slicedRange);\n }\n else {\n inverseBgByDefId[instance.defId].push(slicedRange);\n }\n }\n else {\n (def.rendering === 'background' ? bgRanges : fgRanges).push({\n def: def,\n ui: ui,\n instance: instance,\n range: slicedRange,\n isStart: normalRange.start && normalRange.start.valueOf() === slicedRange.start.valueOf(),\n isEnd: normalRange.end && normalRange.end.valueOf() === slicedRange.end.valueOf()\n });\n }\n }\n }\n for (var groupId in inverseBgByGroupId) { // BY GROUP\n var ranges = inverseBgByGroupId[groupId];\n var invertedRanges = invertRanges(ranges, framingRange);\n for (var _i = 0, invertedRanges_1 = invertedRanges; _i < invertedRanges_1.length; _i++) {\n var invertedRange = invertedRanges_1[_i];\n var def = defByGroupId[groupId];\n var ui = eventUis[def.defId];\n bgRanges.push({\n def: def,\n ui: ui,\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false\n });\n }\n }\n for (var defId in inverseBgByDefId) {\n var ranges = inverseBgByDefId[defId];\n var invertedRanges = invertRanges(ranges, framingRange);\n for (var _a = 0, invertedRanges_2 = invertedRanges; _a < invertedRanges_2.length; _a++) {\n var invertedRange = invertedRanges_2[_a];\n bgRanges.push({\n def: eventStore.defs[defId],\n ui: eventUis[defId],\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false\n });\n }\n }\n return { bg: bgRanges, fg: fgRanges };\n}", "function sliceEventStore(eventStore, eventUiBases, framingRange, nextDayThreshold) {\n var inverseBgByGroupId = {};\n var inverseBgByDefId = {};\n var defByGroupId = {};\n var bgRanges = [];\n var fgRanges = [];\n var eventUis = compileEventUis(eventStore.defs, eventUiBases);\n\n for (var defId in eventStore.defs) {\n var def = eventStore.defs[defId];\n\n if (def.rendering === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId] = [];\n\n if (!defByGroupId[def.groupId]) {\n defByGroupId[def.groupId] = def;\n }\n } else {\n inverseBgByDefId[defId] = [];\n }\n }\n }\n\n for (var instanceId in eventStore.instances) {\n var instance = eventStore.instances[instanceId];\n var def = eventStore.defs[instance.defId];\n var ui = eventUis[def.defId];\n var origRange = instance.range;\n var normalRange = !def.allDay && nextDayThreshold ? computeVisibleDayRange(origRange, nextDayThreshold) : origRange;\n var slicedRange = intersectRanges(normalRange, framingRange);\n\n if (slicedRange) {\n if (def.rendering === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId].push(slicedRange);\n } else {\n inverseBgByDefId[instance.defId].push(slicedRange);\n }\n } else {\n (def.rendering === 'background' ? bgRanges : fgRanges).push({\n def: def,\n ui: ui,\n instance: instance,\n range: slicedRange,\n isStart: normalRange.start && normalRange.start.valueOf() === slicedRange.start.valueOf(),\n isEnd: normalRange.end && normalRange.end.valueOf() === slicedRange.end.valueOf()\n });\n }\n }\n }\n\n for (var groupId in inverseBgByGroupId) {\n // BY GROUP\n var ranges = inverseBgByGroupId[groupId];\n var invertedRanges = invertRanges(ranges, framingRange);\n\n for (var _i = 0, invertedRanges_1 = invertedRanges; _i < invertedRanges_1.length; _i++) {\n var invertedRange = invertedRanges_1[_i];\n var def = defByGroupId[groupId];\n var ui = eventUis[def.defId];\n bgRanges.push({\n def: def,\n ui: ui,\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false\n });\n }\n }\n\n for (var defId in inverseBgByDefId) {\n var ranges = inverseBgByDefId[defId];\n var invertedRanges = invertRanges(ranges, framingRange);\n\n for (var _a = 0, invertedRanges_2 = invertedRanges; _a < invertedRanges_2.length; _a++) {\n var invertedRange = invertedRanges_2[_a];\n bgRanges.push({\n def: eventStore.defs[defId],\n ui: eventUis[defId],\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false\n });\n }\n }\n\n return {\n bg: bgRanges,\n fg: fgRanges\n };\n }", "function dt_add_rangedate_filter(begindate_id, enddate_id, dateCol) {\n $.fn.dataTableExt.afnFiltering.push(\n function( oSettings, aData, iDataIndex ) {\n\n var beginDate = Date_from_syspref($(\"#\"+begindate_id).val()).getTime();\n var endDate = Date_from_syspref($(\"#\"+enddate_id).val()).getTime();\n\n var data = Date_from_syspref(aData[dateCol]).getTime();\n\n if ( !parseInt(beginDate) && ! parseInt(endDate) ) {\n return true;\n }\n else if ( beginDate <= data && !parseInt(endDate) ) {\n return true;\n }\n else if ( data <= endDate && !parseInt(beginDate) ) {\n return true;\n }\n else if ( beginDate <= data && data <= endDate) {\n return true;\n }\n return false;\n }\n );\n}", "function evaporator(evap_per_day, threshold){ \n var day = 0;\n var effectiveDeodrantLeft = 100;\n evap_per_day /= 100;\n \n while(effectiveDeodrantLeft > threshold){\n day ++;\n effectiveDeodrantLeft *= (1- evap_per_day);\n }\n return day;\n}", "function resliceDaySegs(segs, dayDate, colIndex) {\n var dayStart = dayDate;\n var dayEnd = common.addDays(dayStart, 1);\n var dayRange = { start: dayStart, end: dayEnd };\n var newSegs = [];\n for (var _i = 0, segs_2 = segs; _i < segs_2.length; _i++) {\n var seg = segs_2[_i];\n var eventRange = seg.eventRange;\n var origRange = eventRange.range;\n var slicedRange = common.intersectRanges(origRange, dayRange);\n if (slicedRange) {\n newSegs.push(\n tslib.__assign(tslib.__assign({}, seg), {\n firstCol: colIndex,\n lastCol: colIndex,\n eventRange: {\n def: eventRange.def,\n ui: tslib.__assign(tslib.__assign({}, eventRange.ui), {\n durationEditable: false,\n }),\n instance: eventRange.instance,\n range: slicedRange,\n },\n isStart:\n seg.isStart &&\n slicedRange.start.valueOf() === origRange.start.valueOf(),\n isEnd:\n seg.isEnd && slicedRange.end.valueOf() === origRange.end.valueOf(),\n })\n );\n }\n }\n return newSegs;\n}", "function approach_range(graph) {\n\tgraph.updateOptions({dateWindow: desired_range});\n}", "function nextStates() {\n var maxEnd = moment.min(moment(filter.end).add(globalTime, globalTimeRange), moment(Date.now()));\n filter.end = maxEnd.format('YYYY-MM-DD HH:mm:ss');\n filter.start = maxEnd.subtract(globalTime, globalTimeRange).format('YYYY-MM-DD HH:mm:ss');\n $('#daterangepicker').data('daterangepicker').setStartDate(moment(filter.start).format('l[, ]LTS'));\n $('#daterangepicker').data('daterangepicker').setEndDate(moment(filter.end).format('l[, ]LTS'));\n refreshData();\n }", "function resliceDaySegs(segs, dayDate, colIndex) {\n var dayStart = dayDate;\n var dayEnd = addDays(dayStart, 1);\n var dayRange = { start: dayStart, end: dayEnd };\n var newSegs = [];\n for (var _i = 0, segs_2 = segs; _i < segs_2.length; _i++) {\n var seg = segs_2[_i];\n var eventRange = seg.eventRange;\n var origRange = eventRange.range;\n var slicedRange = intersectRanges(origRange, dayRange);\n if (slicedRange) {\n newSegs.push(__assign(__assign({}, seg), {\n firstCol: colIndex, lastCol: colIndex, eventRange: {\n def: eventRange.def,\n ui: __assign(__assign({}, eventRange.ui), { durationEditable: false }),\n instance: eventRange.instance,\n range: slicedRange,\n }, isStart: seg.isStart && slicedRange.start.valueOf() === origRange.start.valueOf(), isEnd: seg.isEnd && slicedRange.end.valueOf() === origRange.end.valueOf()\n }));\n }\n }\n return newSegs;\n }", "function applyRangeFilterAndGetData(days, graphData){\n var minValue = Number.MAX_VALUE;\n graphData = $.extend(true, {}, graphData || thisInstance.graphData);\n for(var index in graphData){\n if(Array.isArray(graphData[index])) {\n graphData[index] = (graphData[index] || []).slice(90 - parseInt(days));\n }\n\n // finds min value of the series\n for(var innerIndex in graphData[index]) {\n var value = graphData[index][innerIndex][1];\n minValue = (minValue < value) ? minValue : value;\n }\n }\n\n return {graphData: graphData, minValue: minValue};\n }", "function expandRecurringRanges(eventDef, framingRange, dateEnv) {\n var typeDef = recurringTypes[eventDef.recurringDef.typeId];\n var markers = typeDef.expand(eventDef.recurringDef.typeData, eventDef, framingRange, dateEnv); // the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to\n\n if (eventDef.allDay) {\n markers = markers.map(marker_1.startOfDay);\n }\n\n return markers;\n }", "buildRenderRange(currentRange, currentRangeUnit, isRangeAllDay) {\n let renderRange = super.buildRenderRange(currentRange, currentRangeUnit, isRangeAllDay);\n let { props } = this;\n return buildDayTableRenderRange({\n currentRange: renderRange,\n snapToWeek: /^(year|month)$/.test(currentRangeUnit),\n fixedWeekCount: props.fixedWeekCount,\n dateEnv: props.dateEnv,\n });\n }", "adjustForNextDay(date, adjustment) {\n date.setTime( date.getTime() + adjustment * 86400000 )\n }", "function computeAlignedDayRange(timedRange) {\n var dayCnt = Math.floor(diffDays(timedRange.start, timedRange.end)) || 1;\n var start = startOfDay(timedRange.start);\n var end = addDays(start, dayCnt);\n return {\n start: start,\n end: end\n };\n } // given a timed range, computes an all-day range based on how for the end date bleeds into the next day", "function setAgtTimePeriod(d){\n var minDate = parseDate(newMinDay);\n var maxDate = parseDate(newMaxDay);\n var agmtDat = d.Dat;\n if ((agmtDat >= minDate) && (agmtDat <= maxDate)){\n return d;\n }\n }", "function generateDayWiseTimeSeries(baseval, count, yrange) {\r\n var i = 0;\r\n var series = [];\r\n\r\n while (i < count) {\r\n var x = baseval;\r\n var y = Math.floor(Math.random() * (yrange.max - yrange.min + 1)) + yrange.min;\r\n series.push([x, y]);\r\n baseval += 86400000;\r\n i++;\r\n }\r\n\r\n return series;\r\n } // missing or null values area chart", "_getDayWiseTimeSeries(baseval, count, yrange) {\n var i = 0;\n while (i < count) {\n var x = baseval;\n var y =\n Math.floor(Math.random() * (yrange.max - yrange.min + 1)) +\n yrange.min;\n \n this._precios.push({\n x,\n y,\n });\n this._lastDate = baseval;\n baseval += this._TICKINTERVAL;\n i++;\n }\n }", "beforeEnd() {\n this.d = this.d.day('friday')\n return this\n }", "function applyDateRange() {\n const mindate = mindate_input.property('value');\n const maxdate = maxdate_input.property('value');\n\n context.features().dateRange = [mindate, maxdate];\n context.features().redraw();\n\n updateUrlParam();\n }", "extendToCover(min, max) {\r\n let x = this.min;\r\n while (min < x) {\r\n x = DateTimeSequence.ADD_INTERVAL(x, -this.interval, this.unit);\r\n this.sequence.splice(0, 0, x);\r\n }\r\n this.min = x;\r\n x = this.max;\r\n while (x < max) {\r\n x = DateTimeSequence.ADD_INTERVAL(x, this.interval, this.unit);\r\n this.sequence.push(x);\r\n }\r\n this.max = x;\r\n }", "function fillCurrent() {\n for (let i = startDay; i < endDate + startDay; i++) {\n dateArray.push(i - startDay + 1)\n }\n }", "function evaporator(evap_per_day, threshold){ \n threshold = threshold / 100\n evap_per_day = evap_per_day / 100\n return Math.ceil(Math.log(threshold) / Math.log(1-evap_per_day))\n}", "function getDateRangeArray(date, dateRangeType, firstDayOfWeek, workWeekDays, daysToSelectInDayView) {\n if (daysToSelectInDayView === void 0) { daysToSelectInDayView = 1; }\n var datesArray = [];\n var startDate;\n var endDate = null;\n if (!workWeekDays) {\n workWeekDays = [_dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DayOfWeek.Monday, _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DayOfWeek.Tuesday, _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DayOfWeek.Wednesday, _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DayOfWeek.Thursday, _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DayOfWeek.Friday];\n }\n daysToSelectInDayView = Math.max(daysToSelectInDayView, 1);\n switch (dateRangeType) {\n case _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DateRangeType.Day:\n startDate = getDatePart(date);\n endDate = addDays(startDate, daysToSelectInDayView);\n break;\n case _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DateRangeType.Week:\n case _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DateRangeType.WorkWeek:\n startDate = getStartDateOfWeek(getDatePart(date), firstDayOfWeek);\n endDate = addDays(startDate, _dateValues_timeConstants__WEBPACK_IMPORTED_MODULE_0__.TimeConstants.DaysInOneWeek);\n break;\n case _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DateRangeType.Month:\n startDate = new Date(date.getFullYear(), date.getMonth(), 1);\n endDate = addMonths(startDate, 1);\n break;\n default:\n throw new Error('Unexpected object: ' + dateRangeType);\n }\n // Populate the dates array with the dates in range\n var nextDate = startDate;\n do {\n if (dateRangeType !== _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DateRangeType.WorkWeek) {\n // push all days not in work week view\n datesArray.push(nextDate);\n }\n else if (workWeekDays.indexOf(nextDate.getDay()) !== -1) {\n datesArray.push(nextDate);\n }\n nextDate = addDays(nextDate, 1);\n } while (!compareDates(nextDate, endDate));\n return datesArray;\n}", "nextEnabled() {\n return !this.calendar.maxDate ||\n !this._isSameView(this.calendar.activeDate, this.calendar.maxDate);\n }", "nextEnabled() {\n return !this.calendar.maxDate ||\n !this._isSameView(this.calendar.activeDate, this.calendar.maxDate);\n }", "function expandRecurringRanges(eventDef, framingRange, dateEnv, recurringTypes) {\n var typeDef = recurringTypes[eventDef.recurringDef.typeId];\n var markers = typeDef.expand(eventDef.recurringDef.typeData, framingRange, dateEnv);\n // the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to\n if (eventDef.allDay) {\n markers = markers.map(startOfDay);\n }\n return markers;\n }", "function filterBy(SliderValue){\n var slider = document.getElementById(\"slider-start\").value; //get range slider valure from HTML\n var datephotos //Initalise date var\n var dateroutesto //Initalise dateroutes var\n var dateroutesfrom //Initalise dateroutes var\n var currentday //Initatlise current day var, containing the naming of every day\n\n //arrays of relevant valies compared to slider value. eg slider position 4 of datephotos = 2018-04-09 and position 4 of currentday = Maandag \n datephotos = [\"\", \"2018-04-06\", \"2018-04-07\", \"2018-04-08\", \"2018-04-09\", \"2018-04-10\", \"2018-04-11\", \"2018-04-12\", \"2018-04-13\", \"2018-04-14\", \"2018-04-15\", \"\" ];\n dateroutesfrom = [\"\", \"20180406\", \"20180407\", \"20180408\", \"20180409\", \"20180410\", \"20180411\", \"20180412\", \"20180413\", \"20180414\", \"20180415\", \"\" ];\n dateroutesto = [\"\", \"20180407\", \"20180408\", \"20180409\", \"20180410\", \"20180411\", \"20180412\", \"20180413\", \"20180414\", \"20180415\", \"20180416\", \"\" ];\n currentday = [\"Hele reis\", \"Aankomst Dag\", \"Zaterdag\", \"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\", \"Laaste dag\", \"Hele reis\"];\n FistPhoto = [\"\", \"\", \"250\", \"500\", \"750\", \"1000\", \"1150\", \"1400\", \"1500\", \"1800\", \"1950\", \"\"];\n\n //exectution of filter by date\n if (slider > 0 && slider < 11) { \n //Slider is used to filter map elleemnts \n map.setFilter('photos', [\"==\", \"CreateDate\", datephotos[slider]]);\n map.setFilter('routes', [\"<=\", \"startTime\", dateroutesto[slider]]);\n map.setFilter('routes-shadow', [\"<=\", \"startTime\", dateroutesto[slider]]);\n map.setFilter('routes-today', [\"all\", [\"<=\", \"startTime\", dateroutesto[slider]], [\">=\", \"startTime\", dateroutesfrom[slider]]]);\n } else { \n //Else slider is off\n map.setFilter('photos', null);\n map.setFilter('routes', null);\n map.setFilter('routes-shadow', null);\n map.setFilter('routes-today', [\"<=\", \"startTime\", 1]);\n }\n \n document.getElementById(\"daylable\").textContent = currentday[slider]; //set Day Lable to correct day \n //console.log(\"Filtering: \" + currentday[slider]); //Filtering confimration in console\n\n map.flyTo({\n center: [-4.337799, 56.907900],\n zoom: 6.5,\n bearing: 0,\n pitch: 0.5,\n });\n}", "winterSolsticeReachedHandler(minAngle) {\n this.prevDay = this.seasonsState.day;\n this.outOfRange = true;\n this.targetAngle = minAngle;\n let newDay;\n if (!this.winterPolarNight()) {\n newDay = WINTER_SOLSTICE;\n } else {\n newDay = this.angleToDay(0);\n // Set the first day which has angle equal to 0.\n newDay = this.summerOrFall(this.prevDay) ? newDay.inSummerOrFall : newDay.inWinterOrSpring;\n }\n this.setSeasonsState({day: newDay});\n }", "function generateDayWiseTimeSeries(baseval, count, yrange) {\n var i = 0;\n var series = [];\n\n while (i < count) {\n var x = baseval;\n var y = Math.floor(Math.random() * (yrange.max - yrange.min + 1)) + yrange.min;\n series.push([x, y]);\n baseval += 86400000;\n i++;\n }\n\n return series;\n} //", "function setDateRangeFor(quickFilter) {\n\n if (quickFilter.value === 'Custom dates') {\n quickFilter.dateRange = {};\n return;\n }\n\n var start = moment().utc().startOf('day');\n var end = moment().utc().endOf(\"day\"); //Now\n switch (quickFilter.value) {\n case \"Yesterday\":\n start = angular.copy(start).subtract(1, 'days'); // Start of day 7 days ago\n end = angular.copy(start).endOf(\"day\");\n break;\n case \"Last week\":\n start = angular.copy(start).subtract(7, 'days'); // Start of day 7 days ago\n break;\n case \"Going back a month\":\n start = angular.copy(start).subtract(1, 'months'); // Start of day 1 month ago\n break;\n }\n\n // start = start.utc().unix();\n // end = end.utc().unix();\n quickFilter.dateRange = {\n s: start,\n e: end\n };\n }", "function getDaysArray (start, end) {\n for(var dt=new Date(start); dt<=end; dt.setDate(dt.getDate()+1)){\n groundTruthCopy.push({date: new Date(dt), y: -999});\n }\n }", "splitEvents(){\n const { events } = this.props;\n const { days } = this.state;\n const sortedEvents = events.sort((firstEvent, secondEvent) => {\n const firstStartDate = moment(firstEvent.startDate);\n const secondStartDate = moment(secondEvent.startDate);\n\n if(firstStartDate.isBefore(secondStartDate)) {\n return -1;\n } else if (firstStartDate.isSame(secondStartDate)) {\n return 0;\n } else {\n return 1;\n }\n });\n\n // what if the dates are out of range?\n // i should be able to query the dates out of the BE\n // for now we can assume within range\n const result = [...Array(7)].map(el => new Array());\n sortedEvents.forEach((event) => {\n const startDate = moment(event.startDate);\n\n days.forEach((day, idx) => {\n if(startDate.isBetween(day.startMoment, day.endMoment)) {\n result[idx].push(event);\n }\n });\n });\n\n return result;\n }", "nextPickupDates (intsArr, isRecycling = false) {\n var arr = []\n var date = null\n var isHoliday = false\n _.each(intsArr, (int, index) => {\n date = Schedule.nextDayOfWeek(int)\n isHoliday = Schedule.isHoliday(date, isRecycling)\n arr.push({ date, isHoliday })\n\n while (isHoliday) {\n int = (index + 1 === intsArr.length) ? intsArr[0] : intsArr[index + 1] // jump to next day in intsArr\n date = Schedule.nextDayOfWeek(int, date)\n isHoliday = Schedule.isHoliday(date, isRecycling)\n arr.push({ date, isHoliday })\n }\n })\n return _.chain(arr).sortBy(x => x.date.valueOf()).uniq(x => x.date.valueOf(), true).value()\n }", "calculateDateRange(datePreset) {\n const today = this.today;\n switch (datePreset) {\n case 'Today':\n return [today, today];\n case 'So Far This Week': {\n const dayOfWeek = this.adjDayOfWeekToStartOnMonday(today);\n const start = this.dateAdapter.addCalendarDays(today, -(dayOfWeek));\n return [start, today];\n }\n case 'This Week': return this.calculateWeek(today);\n case 'Last Week': return this.calculateWeek(this.dateAdapter.addCalendarDays(today, -7));\n case 'Previous Week': return this.calculateWeek(this.dateAdapter.addCalendarDays(today, -14));\n case 'Rest of This Week': {\n const dayOfWeek = this.adjDayOfWeekToStartOnMonday(today);\n const end = this.dateAdapter.addCalendarDays(today, (6 - dayOfWeek));\n return [today, end];\n }\n case 'Next Week': {\n const dayOfWeek = this.adjDayOfWeekToStartOnMonday(today);\n const start = this.dateAdapter.addCalendarDays(today, (7 - dayOfWeek));\n return this.calculateWeek(start);\n }\n case 'This Month': return this.calculateMonth(today);\n case 'Last Month': {\n const thisDayLastMonth = this.dateAdapter.addCalendarMonths(today, -1);\n return this.calculateMonth(thisDayLastMonth);\n }\n case 'Next Month': {\n const thisDayLastMonth = this.dateAdapter.addCalendarMonths(today, 1);\n return this.calculateMonth(thisDayLastMonth);\n }\n }\n }", "function add_days_with_exact_four(data_array, number_of_people_on_each_day_shift) {\n var dates = find_days_with_exact_four_nones(data_array, number_of_people_on_each_day_shift);\n for (var i = 0; i < dates.length; i++) {\n for (var j = 0; j < data_array.length; j++) {\n if( data_array[j][dates[i]] == shift_type.none.index ) data_array[j][dates[i]] = shift_type.day.index;\n }\n }\n return data_array;\n}", "function changeDatePickerRange(days) {\n const millesec = getMillisecunds(days);\n const date = getDate(millesec);\n return date;\n }", "function newDates(low, high){\n /* let tempArray = [];\n for(var i=0; i<datesProvided.length; i++){\n if ((i>=low) && (i<=high)){\n tempArray.push(new Date(datesProvided[i]));\n }\n }\n\n //And one last value to account for range\n let tempDate = new Date(tempArray[tempArray.length-1])\n console.log(\"Temp Date:\")\n console.log(tempDate)\n let moreMinutes = tempDate.getMinutes();\n console.log(\"Minutes: \")\n console.log(moreMinutes)\n console.log(selectionInterval)\n console.log((moreMinutes+(+selectionInterval)))\n tempDate.setMinutes((moreMinutes+(+selectionInterval)))\n console.log(\"New Temp Date\")\n console.log(tempDate)\n tempArray.push(tempDate)\n\n return tempArray;*/\n let tempArray = [];\n for(var i=low; i<=high; i++){\n tempArray.push(new Date(datesProvided[i]));\n }\n\n //And one last value to account for range\n let tempDate = new Date(tempArray[tempArray.length-1])\n console.log(\"Temp Date:\")\n console.log(tempDate)\n let moreMinutes = tempDate.getMinutes();\n console.log(\"Minutes: \")\n console.log(moreMinutes)\n console.log(selectionInterval)\n console.log((moreMinutes+(+selectionInterval)))\n tempDate.setMinutes((moreMinutes+(+selectionInterval)))\n console.log(\"New Temp Date\")\n console.log(tempDate)\n tempArray.push(tempDate)\n\n return tempArray;\n}", "resetDays() {\n this.resetFilled();\n let days = this.days;\n let filled = this.filled;\n let current = filled.start;\n let daysBetween = filled.days(Op.UP);\n let total = Math.max(this.minimumSize, daysBetween);\n for (let i = 0; i < total; i++) {\n let day = days[i];\n if (!day || !day.sameDay(current)) {\n day = new CalendarDay(current.date);\n if (i < days.length) {\n days.splice(i, 1, day);\n }\n else {\n days.push(day);\n }\n }\n day.inCalendar = this.span.contains(day);\n current = current.next();\n }\n if (days.length > total) {\n days.splice(total, days.length - total);\n }\n return this;\n }", "function generateDayWiseTimeSeries(baseval, count, yrange) {\n var i = 0;\n var series = [];\n while (i < count) {\n var x = baseval;\n var y = Math.floor(Math.random() * (yrange.max - yrange.min + 1)) + yrange.min;\n\n series.push([x, y]);\n baseval += 86400000;\n i++;\n }\n return series;\n}", "function generateDayWiseTimeSeries(baseval, count, yrange) {\n var i = 0;\n var series = [];\n while (i < count) {\n var x = baseval;\n var y = Math.floor(Math.random() * (yrange.max - yrange.min + 1)) + yrange.min;\n\n series.push([x, y]);\n baseval += 86400000;\n i++;\n }\n return series;\n}", "addDefaultRange() {\n this.addRange(this.defaultMin, this.defaultMax, this.defaultDups);\n }", "function normalizeRange(range, tDateProfile, dateEnv) {\n if (!tDateProfile.isTimeScale) {\n range = Object(_fullcalendar_core__WEBPACK_IMPORTED_MODULE_0__[\"computeVisibleDayRange\"])(range);\n if (tDateProfile.largeUnit) {\n var dayRange = range; // preserve original result\n range = {\n start: dateEnv.startOf(range.start, tDateProfile.largeUnit),\n end: dateEnv.startOf(range.end, tDateProfile.largeUnit)\n };\n // if date is partially through the interval, or is in the same interval as the start,\n // make the exclusive end be the *next* interval\n if (range.end.valueOf() !== dayRange.end.valueOf() || range.end <= range.start) {\n range = {\n start: range.start,\n end: dateEnv.add(range.end, tDateProfile.slotDuration)\n };\n }\n }\n }\n return range;\n}", "function fillNext() {\n const nextMonth = moment(currentDate).add(1, 'month');\n const nextStartDay = nextMonth.startOf('month').day();\n for (let i = nextStartDay; i < 14; i++) {\n dateArray.push(i - nextStartDay + 1)\n }\n \n }", "findRangeofDates(){ \n\t\tlet min=new Date(2030,1,1); \n\t\tlet max=new Date(1990,1,1);\n\t\tconst ar=this.props.data;\n\t\tfor(let i=0;i<ar.length;i++){\n\t\t\tif(ar[i].start<min)\n\t\t\t\tmin=ar[i].start;\n\t\t\tif(ar[i].end>max)\n\t\t\t\tmax=ar[i].end;\n\t\t}\n\t\tthis.min=min;\n\t\tthis.max=max;\n\t}", "function customRangeCheck(d, constraints, selector) {\n\t\t\t\t\t\treturn (\"min\" in constraints ? (gdate.compare(d, constraints.min, selector) >= 0) : true)\n\t\t\t\t\t\t\t\t&& (\"max\" in constraints ? (gdate.compare(d, constraints.max, selector) <= 0) : true); // Boolean\n\t\t\t\t\t}", "function dateRangeCalculator(){\n\n\t//start date\n\n\t//end date\n\n\t//Api call request that reloads page/section based off of time span requested OR trimming original data object/array based off of new specified date range \n\n\n}", "function cutoffDataByDate(allDrinksArray) {\n\n\treturn allDrinksArray.slice(625);\n\n}", "_dayIsDisabled(day) {\n let { minDate, maxDate } = this;\n if (minDate && minDate.valueOf() > day.valueOf()) {\n return true;\n } else if (maxDate && maxDate.valueOf() < day.valueOf()) {\n return true;\n } else {\n return this._dayNotAvailable(day);\n }\n }", "function addMissingDaysFacebook() {\n facebookData.sort(sortFacebook);\n filterOldandNewEvents();\n\n let length = facebookData.length - 1;\n for(let i = 0; i < length; i++) {\n facebookData[i].start_time = new Date(facebookData[i].start_time);\n facebookData[i].start_time.setHours(1);\n let nextDay = new Date(facebookData[i].start_time);\n nextDay.setDate(facebookData[i].start_time.getDate() + 1);\n\n let nextDayObject = new Date(facebookData[i + 1].start_time);\n nextDayObject.setHours(1);\n if(facebookData[i].start_time.getTime() == nextDayObject.getTime()) {\n let amountPeople1 = facebookData[i].attending_count + facebookData[i].interested_count;\n let amountPeople2 = facebookData[i + 1].attending_count + facebookData[i + 1].interested_count;\n if(amountPeople1 > amountPeople2) {\n facebookData.splice(i, 1);\n } else {\n facebookData.splice(i + 1, 1);\n }\n length--; i--;\n } else if(nextDay.getTime() != nextDayObject.getTime()) {\n let tempObj = {start_time: nextDay, id: \"\", attending_count: 0, interested_count: 0, name: \"\"};\n facebookData.push(tempObj);\n facebookData.sort(sortFacebook);\n length++;\n }\n }\n addMissingDaysFirstEvent();\n}", "function newDates1(low, high){\n let tempArray = [];\n for(var i=low; i<=high; i++){\n tempArray.push(new Date(datesProvided[i]));\n }\n\n //And one last value to account for range\n let tempDate = new Date(tempArray[tempArray.length-1])\n // console.log(\"Temp Date:\")\n // console.log(tempDate)\n let moreMinutes = tempDate.getMinutes();\n // console.log(\"Minutes: \")\n // console.log(moreMinutes)\n // console.log(selectionInterval)\n // console.log((moreMinutes+(+selectionInterval)))\n tempDate.setMinutes((moreMinutes+(+selectionInterval)))\n // console.log(\"New Temp Date\")\n // console.log(tempDate)\n tempArray.push(tempDate)\n\n return tempArray;\n}", "function setUpCalendar(date) {\n \n var firstDayofMonth = new Date(date.getFullYear(),date.getMonth()),\n lastDayofMonth = new Date(date.getFullYear(),date.getMonth()+1)\n polishDays = [6,0,1,2,3,4,5];\n\n lastDayofMonth.setDate(lastDayofMonth.getDate()-1);\n\n for (let i = 1; i < 43; i++) {\n var newSpan = document.createElement(\"span\");\n\n if ((i- polishDays[firstDayofMonth.getDay()] > 0) && (lastDayofMonth.getDate()+1 > i - polishDays[firstDayofMonth.getDay()])){\n newSpan.appendChild(document.createTextNode(i - polishDays[firstDayofMonth.getDay()])); \n newSpan.classList.add(\"day-in-calendar\");\n } \n \n if (i - polishDays[firstDayofMonth.getDay()]=== date.getDate()) {\n newSpan.classList.add(\"picked\");\n } \n \n if(i - polishDays[firstDayofMonth.getDay()] < lastDayofMonth.getDate() +(7-lastDayofMonth.getDay()+1)) {\n if ((i- polishDays[firstDayofMonth.getDay()] > 0) && i%7 ===1 &&newSpan.textContent ==\"\") {\n break;\n }\n df.appendChild(newSpan); \n }\n \n }\n\n calendarDaysHolder.appendChild(df);\n addEventsToDays(\"click\",markAsPicked);\n}", "function computeActiveRange(dateProfile, isComponentAllDay) {\n var range = dateProfile.activeRange;\n\n if (isComponentAllDay) {\n return range;\n }\n\n return {\n start: addMs(range.start, dateProfile.minTime.milliseconds),\n end: addMs(range.end, dateProfile.maxTime.milliseconds - 864e5) // 864e5 = ms in a day\n\n };\n } // exports", "function filterByDay(val){\n return val.date == this;\n }", "function checkPatientsPerDay()\n{\n if(Patient.list[tableBody.rows[1].cells[0].innerHTML].lastPatientBool == true)\n {\n let today = weekdaysShort[todayNr];\n daysPassedArray[currentWeek][todayNr] = true;\n \n // Only show immediatly if de currentweek is also the week that is displayed in the agenda\n if(week == currentWeek)\n {\n document.querySelectorAll(\".\" + today).forEach(div =>{\n div.classList.add(\"greyedOutSlot\");\n });\n\n document.querySelectorAll(\".\" + today + \"Header\").forEach(div =>{\n div.classList.add(\"greyedOutHeader\");\n \n });\n }\n //go to the next day or if at the end of the week and the next week\n if(todayNr < 6)\n {\n todayNr += 1;\n }\n else\n {\n todayNr = 0;\n currentWeek += 1;\n }\n }\n}", "function nextRollover (d, val, constraint, period) {\n const cur = constraint.val(d)\n const max = constraint.extent(d)[1]\n\n return (val || max) <= cur || val > max ? new Date(period.end(d).getTime() + constants.SEC) : period.start(d)\n}", "function newDates(low, high){\n let tempArray = [];\n for(var i=0; i<datesProvided.length; i++){\n if ((i>=low) && (i<=high)){\n tempArray.push(datesProvided[i]);\n }\n }\n return tempArray;\n}", "setDates(){\n\t\tthis.dates=[];\n\t\tlet min=new Date(this.min);\n\t\twhile(min<=this.max){\n\t\t\tthis.dates.push(new Date(min));\n\t\t\tmin.setDate(min.getDate()+1);\n\t\t}\n\t\tthis.dates.push(new Date(min));\n\t}", "function expandRecurringRanges(eventDef, duration, framingRange, dateEnv, recurringTypes) {\n var typeDef = recurringTypes[eventDef.recurringDef.typeId];\n var markers = typeDef.expand(eventDef.recurringDef.typeData, {\n start: dateEnv.subtract(framingRange.start, duration),\n end: framingRange.end\n }, dateEnv); // the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to\n\n if (eventDef.allDay) {\n markers = markers.map(startOfDay);\n }\n\n return markers;\n }", "function nextDay (data_, nr_days) {\n// var nxt_day = new Date(data_);\n if (!nr_days) {\n nr_days = 1;\n }\n\n/* Este cálculo não estava a devolver sempre a data correta. REDIRECIONADA PARA addDays()\n * var tmp = new Date(nxt_day).getDate();\n console.log(\"data:\"+data_+\" nr_days:\"+nr_days+\" tmp:\"+tmp+\" set date:\" + nxt_day.setDate( tmp + nr_days));\n return formatDate(nxt_day.setDate( new Date(nxt_day).getDate() + nr_days), 'YYYY-MM-DD');\n*/\n return formatDate(addDays(data_,nr_days), 'YYYY-MM-DD');\n}", "calculateOptimalDateRange(centerDate, panelSize, viewPreset, userProvidedSpan) {\n // this line allows us to always use the `calculateOptimalDateRange` method when calculating date range for zooming\n // (even in case when user has provided own interval)\n // other methods may override/hook into `calculateOptimalDateRange` to insert own processing\n // (infinite scrolling feature does)\n if (userProvidedSpan) return userProvidedSpan;\n const me = this,\n {\n timeAxis\n } = me,\n {\n bottomHeader\n } = viewPreset,\n tickWidth = me.isHorizontal ? viewPreset.tickWidth : viewPreset.tickHeight;\n\n if (me.zoomKeepsOriginalTimespan) {\n return {\n startDate: timeAxis.startDate,\n endDate: timeAxis.endDate\n };\n }\n\n const unit = bottomHeader.unit,\n difference = Math.ceil(panelSize / tickWidth * bottomHeader.increment * me.visibleZoomFactor / 2),\n startDate = DateHelper.add(centerDate, -difference, unit),\n endDate = DateHelper.add(centerDate, difference, unit);\n return {\n startDate: timeAxis.floorDate(startDate, false, unit, bottomHeader.increment),\n endDate: timeAxis.ceilDate(endDate, false, unit, bottomHeader.increment)\n };\n }", "function findNextAvailability(initialSearchRange, existingEvents)\n {\n var new_range = initialSearchRange;\n var next;\n for (var i = 0; i < existingEvents.length; i++)\n {\n next = nextRangeStart(new_range, existingEvents);\n if (next)\n {\n new_range = moment.range(next, moment(next).add(initialSearchRange.valueOf(), 'ms'));\n }\n else\n {\n return new_range;\n }\n }\n return new_range;\n }", "function createDefaultRecap(dates){\n let events = []\n dates.forEach(date=>{\n nbrOfPresentAtThisDay = calendar.getEvents().filter(e=>moment(e.start).isSame(date,'day') && e.classNames[0] == 'present')\n if(![0,6].includes(date.getDay())){\n event = createEventRecap(date,nbrOfPresentAtThisDay.length);\n events.push(event)\n }\n })\n calendar.addEventSource(events);\n}", "function computeActiveRange(dateProfile, isComponentAllDay) {\n var range = dateProfile.activeRange;\n if (isComponentAllDay) {\n return range;\n }\n return {\n start: addMs(range.start, dateProfile.minTime.milliseconds),\n end: addMs(range.end, dateProfile.maxTime.milliseconds - 864e5) // 864e5 = ms in a day\n };\n }", "function computeActiveRange(dateProfile, isComponentAllDay) {\n var range = dateProfile.activeRange;\n if (isComponentAllDay) {\n return range;\n }\n return {\n start: addMs(range.start, dateProfile.minTime.milliseconds),\n end: addMs(range.end, dateProfile.maxTime.milliseconds - 864e5) // 864e5 = ms in a day\n };\n }", "function day(){\n step=4;\n timeSelector=\"day\";\n resetGraph();\n}", "function isMultiDayRange(range) {\n var visibleRange = computeVisibleDayRange(range);\n return marker_1.diffDays(visibleRange.start, visibleRange.end) > 1;\n }", "function DateChangedStart() {\n var perStart = $(\"#dpfrom\").datepicker(\"getDate\");\n var perEnd = $(\"#dpto\").datepicker(\"getDate\");\n \n if (perStart > perEnd) {\n $('#dpto').datepicker('setDate', perStart);\n }\n GetInvoicesForPeriod();\n}", "function filterBetween(array, min, max) {\n\n}", "_rangeValidation(initialDate) {\n const that = this;\n\n if (initialDate.compare(that.min) === -1) {\n return that.min.clone();\n }\n else if (initialDate.compare(that.max) === 1) {\n return that.max.clone();\n }\n else {\n return initialDate;\n }\n }", "function extendDateRange(from_date,duration,callback) {\n\tconsole.log('extend date range',from_date,duration);\n\tif (!from_date) return;\n\tif (dateInRange(from_date)) return;\n\t$('#myThinker').dialog('open');\n\tvar requestObj = {\n\t\tfrom_date:from_date\n\t};\n\tif (duration) requestObj['duration'] = duration;\n\tvar service = '/getDashboardData';\n\t$.ajax({\n\t\turl:service,\n\t\ttype:'GET',\n\t\tdataType:'json',\n\t\tdata:requestObj,\n\t\n\t\tsuccess:function(d) {\n\t\t\tif (d.success && d.success>0)\n\t\t\t{\t\t\t\t\t\t\n\t\t\t\t$('#myThinker').dialog('close');\n\t\t\t\tmergeTrackerOptions(d['trackerData']);\n\t\t\t\tmergeDashboardData(d['responses']);\n\t\t\t\tif (callback) callback();\n\t\t\t}\n\t\t},\n\t\t\n\t\terror:function(err)\n\t\t{\n\t\t\tconsole.log('error',err);\n\t\t\tupdateMsg($('.validateTips'),'Error changing date range');\n\t\t\tsetTimeout(function() {$('#myThinker').dialog('close');},2000);\n\t\t}\n\t});\t\t\t\n}", "limitDays(days) {\r\n if (days >= 0) {\r\n this.select.where = this.select.where || {};\r\n this.select.where.createdAt = this.select.where.createdAt || {};\r\n this.select.where.createdAt.$gte = new Date();\r\n if (days == 0) {\r\n this.select.where.createdAt.$gte.setUTCHours(0, 0, 0, 0);\r\n } else {\r\n this.select.where.createdAt.$gte.setUTCDate(this.select.where.createdAt.$gte.getUTCDate() - days);\r\n }\r\n }\r\n return this;\r\n }", "function normalizeEventRangeTimes(range) {\n\t\tif (range.allDay == null) {\n\t\t\trange.allDay = !(range.start.hasTime() || (range.end && range.end.hasTime()));\n\t\t}\n\n\t\tif (range.allDay) {\n\t\t\trange.start.stripTime();\n\t\t\tif (range.end) {\n\t\t\t\t// TODO: consider nextDayThreshold here? If so, will require a lot of testing and adjustment\n\t\t\t\trange.end.stripTime();\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif (!range.start.hasTime()) {\n\t\t\t\trange.start = t.rezoneDate(range.start); // will assign a 00:00 time\n\t\t\t}\n\t\t\tif (range.end && !range.end.hasTime()) {\n\t\t\t\trange.end = t.rezoneDate(range.end); // will assign a 00:00 time\n\t\t\t}\n\t\t}\n\t}", "function evaporator(content, evap_per_day, threshold) {\n let remaining = 100;\n let days = 0;\n while (remaining > threshold) {\n days += 1;\n remaining -= remaining*evap_per_day/100;\n }\n return days;\n}", "function constrainMarkerToRange(date, range) {\n if (range.start != null && date < range.start) {\n return range.start;\n }\n\n if (range.end != null && date >= range.end) {\n return new Date(range.end.valueOf() - 1);\n }\n\n return date;\n }", "function forecastArrayFunc() {\n forecastArray = [];\n for (i = 0; i < fiveDays.list.length; i++) {\n let noonForecast = fiveDays.list[i];\n if (noonForecast.dt_txt.includes(\"12:00:00\")) {\n forecastArray.push(noonForecast);\n };\n };\n if (forecastArray.length > 5) {\n forecastArray.shift();\n }\n }", "function normalizeEventRangeTimes(range) {\n if (range.allDay == null) {\n range.allDay = !(range.start.hasTime() || (range.end && range.end.hasTime()));\n }\n\n if (range.allDay) {\n range.start.stripTime();\n if (range.end) {\n // TODO: consider nextDayThreshold here? If so, will require a lot of testing and adjustment\n range.end.stripTime();\n }\n }\n else {\n if (!range.start.hasTime()) {\n range.start = t.rezoneDate(range.start); // will assign a 00:00 time\n }\n if (range.end && !range.end.hasTime()) {\n range.end = t.rezoneDate(range.end); // will assign a 00:00 time\n }\n }\n }", "function customRange(dates) {\n var difff = diffDays(vacationEnd, vacationStart);\n duration = difff;\n\n vacationStart.calendarsPicker('option', 'minDate', 1 || null);\n\n if ($(this).hasClass(\"vacationStart\")) {\n vacationEnd.datepick('enable');\n var startDate = vacationStart.datepick('getDate')[0];\n\n console.log($.datepick.formatDate($.datepick.determineDate(startDate.value)));\n startDate = startDate.value;\n\n console.log(Date.parse(startDate));\n\n vacationEnd.calendarsPicker('option', 'minDate', startDate);\n vacationEnd.val('');\n vacationDuration.val('');\n\n } else {\n //vacationStart.calendarsPicker('option', 'maxDate', dates[0] || null);\n vacationDuration.val(difff);\n\n verifyDuration(vacationDuration);\n }\n\n }", "function setFuncNextDate() {\n\n console.log(\"CALL: setFuncNextDate\");\n\n if($radioDays.is(':checked'))\n {\n selectLabelDate = function (date) { return date.toShortDate();};\n selectStepDate = function(date) { return date.nextDay();};\n }\n if($radioWeeks.is(':checked'))\n {\n selectLabelDate = function (date) { return date.toShortWeek();};\n selectStepDate = function(date) { return date.nextWeek();};\n }\n if($radioMonths.is(':checked'))\n {\n selectLabelDate = function (date) { return date.getMonthString() + \"-\" + date.getFullYear()};\n selectStepDate = function(date) { return date.nextMonth()};\n }\n }", "function nextRangeStart(range, existingEvents)\n {\n for (var j = 0; j < existingEvents.length; j++)\n {\n if (range.overlaps(existingEvents[j]))\n {\n return moment(existingEvents[j].end);\n }\n }\n return null;\n }", "function filterRange(newY, series) {\n var options = series.options,\n dragMin = options.dragMin,\n dragMax = options.dragMax;\n \n if (newY < dragMin) {\n newY = dragMin;\n } else if (newY > dragMax) {\n newY = dragMax;\n }\n return newY;\n }", "function isFullAge5(limit) {\n // start slice at 1 to ignore first limit param\n var args = Array.prototype.slice.call(arguments, 1);\n\n args.forEach(function(cur) {\n console.log((2018 - cur) >= limit);\n });\n}", "function computeActiveRange(dateProfile, isComponentAllDay) {\n var range = dateProfile.activeRange;\n if (isComponentAllDay) {\n return range;\n }\n return {\n start: addMs(range.start, dateProfile.slotMinTime.milliseconds),\n end: addMs(range.end, dateProfile.slotMaxTime.milliseconds - 864e5),\n };\n }", "function sliceDays(n) { // pass in the total amount of dates\n\t\tvar sliceArr = new Array();\n\t\tvar tweeks = n/7; // must be divisable by seven, TODO: add error checking\n\t\t\n\t\tfor (var i = 0; i < tweeks; i+=1) {\n\t\t\tbeginSlice = i * 7;\n\t\t\tendSlice = (i+1)*7;\n\n\t\t\tvar tempArr = dayArr.slice(beginSlice,endSlice);\n\t\t\tweekArr[i] = new CalendarWeek(i,tempArr);\n\t\t}\n\t}", "function rangeToSegments(start, end) {\n\n\t\tvar rowCnt = t.getRowCnt();\n\t\tvar colCnt = t.getColCnt();\n\t\tvar segments = []; // array of segments to return\n\n\t\t// day offset for given date range\n\t\tvar rangeDayOffsetStart = dateToDayOffset(start);\n\t\tvar rangeDayOffsetEnd = dateToDayOffset(end); // an exclusive value\n\t\tvar endTimeMS = +end.time();\n\t\tif (endTimeMS && endTimeMS >= nextDayThreshold) {\n\t\t\trangeDayOffsetEnd++;\n\t\t}\n\t\trangeDayOffsetEnd = Math.max(rangeDayOffsetEnd, rangeDayOffsetStart + 1);\n\n\t\t// first and last cell offset for the given date range\n\t\t// \"last\" implies inclusivity\n\t\tvar rangeCellOffsetFirst = dayOffsetToCellOffset(rangeDayOffsetStart);\n\t\tvar rangeCellOffsetLast = dayOffsetToCellOffset(rangeDayOffsetEnd) - 1;\n\n\t\t// loop through all the rows in the view\n\t\tfor (var row=0; row<rowCnt; row++) {\n\n\t\t\t// first and last cell offset for the row\n\t\t\tvar rowCellOffsetFirst = row * colCnt;\n\t\t\tvar rowCellOffsetLast = rowCellOffsetFirst + colCnt - 1;\n\n\t\t\t// get the segment's cell offsets by constraining the range's cell offsets to the bounds of the row\n\t\t\tvar segmentCellOffsetFirst = Math.max(rangeCellOffsetFirst, rowCellOffsetFirst);\n\t\t\tvar segmentCellOffsetLast = Math.min(rangeCellOffsetLast, rowCellOffsetLast);\n\n\t\t\t// make sure segment's offsets are valid and in view\n\t\t\tif (segmentCellOffsetFirst <= segmentCellOffsetLast) {\n\n\t\t\t\t// translate to cells\n\t\t\t\tvar segmentCellFirst = cellOffsetToCell(segmentCellOffsetFirst);\n\t\t\t\tvar segmentCellLast = cellOffsetToCell(segmentCellOffsetLast);\n\n\t\t\t\t// view might be RTL, so order by leftmost column\n\t\t\t\tvar cols = [ segmentCellFirst.col, segmentCellLast.col ].sort();\n\n\t\t\t\t// Determine if segment's first/last cell is the beginning/end of the date range.\n\t\t\t\t// We need to compare \"day offset\" because \"cell offsets\" are often ambiguous and\n\t\t\t\t// can translate to multiple days, and an edge case reveals itself when we the\n\t\t\t\t// range's first cell is hidden (we don't want isStart to be true).\n\t\t\t\tvar isStart = cellOffsetToDayOffset(segmentCellOffsetFirst) == rangeDayOffsetStart;\n\t\t\t\tvar isEnd = cellOffsetToDayOffset(segmentCellOffsetLast) + 1 == rangeDayOffsetEnd; // +1 for comparing exclusively\n\n\t\t\t\tsegments.push({\n\t\t\t\t\trow: row,\n\t\t\t\t\tleftCol: cols[0],\n\t\t\t\t\trightCol: cols[1],\n\t\t\t\t\tisStart: isStart,\n\t\t\t\t\tisEnd: isEnd\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn segments;\n\t}", "function rangeToSegments(start, end) {\n\n\t\tvar rowCnt = t.getRowCnt();\n\t\tvar colCnt = t.getColCnt();\n\t\tvar segments = []; // array of segments to return\n\n\t\t// day offset for given date range\n\t\tvar rangeDayOffsetStart = dateToDayOffset(start);\n\t\tvar rangeDayOffsetEnd = dateToDayOffset(end); // an exclusive value\n\t\tvar endTimeMS = +end.time();\n\t\tif (endTimeMS && endTimeMS >= nextDayThreshold) {\n\t\t\trangeDayOffsetEnd++;\n\t\t}\n\t\trangeDayOffsetEnd = Math.max(rangeDayOffsetEnd, rangeDayOffsetStart + 1);\n\n\t\t// first and last cell offset for the given date range\n\t\t// \"last\" implies inclusivity\n\t\tvar rangeCellOffsetFirst = dayOffsetToCellOffset(rangeDayOffsetStart);\n\t\tvar rangeCellOffsetLast = dayOffsetToCellOffset(rangeDayOffsetEnd) - 1;\n\n\t\t// loop through all the rows in the view\n\t\tfor (var row=0; row<rowCnt; row++) {\n\n\t\t\t// first and last cell offset for the row\n\t\t\tvar rowCellOffsetFirst = row * colCnt;\n\t\t\tvar rowCellOffsetLast = rowCellOffsetFirst + colCnt - 1;\n\n\t\t\t// get the segment's cell offsets by constraining the range's cell offsets to the bounds of the row\n\t\t\tvar segmentCellOffsetFirst = Math.max(rangeCellOffsetFirst, rowCellOffsetFirst);\n\t\t\tvar segmentCellOffsetLast = Math.min(rangeCellOffsetLast, rowCellOffsetLast);\n\n\t\t\t// make sure segment's offsets are valid and in view\n\t\t\tif (segmentCellOffsetFirst <= segmentCellOffsetLast) {\n\n\t\t\t\t// translate to cells\n\t\t\t\tvar segmentCellFirst = cellOffsetToCell(segmentCellOffsetFirst);\n\t\t\t\tvar segmentCellLast = cellOffsetToCell(segmentCellOffsetLast);\n\n\t\t\t\t// view might be RTL, so order by leftmost column\n\t\t\t\tvar cols = [ segmentCellFirst.col, segmentCellLast.col ].sort();\n\n\t\t\t\t// Determine if segment's first/last cell is the beginning/end of the date range.\n\t\t\t\t// We need to compare \"day offset\" because \"cell offsets\" are often ambiguous and\n\t\t\t\t// can translate to multiple days, and an edge case reveals itself when we the\n\t\t\t\t// range's first cell is hidden (we don't want isStart to be true).\n\t\t\t\tvar isStart = cellOffsetToDayOffset(segmentCellOffsetFirst) == rangeDayOffsetStart;\n\t\t\t\tvar isEnd = cellOffsetToDayOffset(segmentCellOffsetLast) + 1 == rangeDayOffsetEnd; // +1 for comparing exclusively\n\n\t\t\t\tsegments.push({\n\t\t\t\t\trow: row,\n\t\t\t\t\tleftCol: cols[0],\n\t\t\t\t\trightCol: cols[1],\n\t\t\t\t\tisStart: isStart,\n\t\t\t\t\tisEnd: isEnd\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn segments;\n\t}", "function computeActiveRange(dateProfile, isComponentAllDay) {\n var range = dateProfile.activeRange;\n if (isComponentAllDay) {\n return range;\n }\n return {\n start: addMs(range.start, dateProfile.minTime.milliseconds),\n end: addMs(range.end, dateProfile.maxTime.milliseconds - 864e5) // 864e5 = ms in a day\n };\n}", "function computeActiveRange(dateProfile, isComponentAllDay) {\n var range = dateProfile.activeRange;\n if (isComponentAllDay) {\n return range;\n }\n return {\n start: addMs$1(range.start, dateProfile.minTime.milliseconds),\n end: addMs$1(range.end, dateProfile.maxTime.milliseconds - 864e5) // 864e5 = ms in a day\n };\n }" ]
[ "0.64540946", "0.6373471", "0.63233954", "0.63233954", "0.63233954", "0.63233954", "0.62766325", "0.6178975", "0.57483554", "0.5294317", "0.52778053", "0.51630205", "0.5162787", "0.5073957", "0.5036462", "0.5030246", "0.5023267", "0.49965647", "0.4993016", "0.49821252", "0.49253035", "0.49195287", "0.48563826", "0.4853187", "0.48186132", "0.48080254", "0.48047993", "0.47669774", "0.47630936", "0.47556472", "0.47425425", "0.4736553", "0.4707714", "0.46886462", "0.46415988", "0.46415988", "0.4615797", "0.46121392", "0.46092302", "0.46077242", "0.46027395", "0.45874098", "0.45844844", "0.458347", "0.45782125", "0.45743772", "0.4565899", "0.45576805", "0.454965", "0.45442963", "0.4538773", "0.45374295", "0.4526628", "0.45152548", "0.4504575", "0.44902346", "0.4488993", "0.44877073", "0.44700554", "0.4447906", "0.4440065", "0.44384068", "0.4427526", "0.4424743", "0.4419869", "0.44096667", "0.4407365", "0.44054163", "0.43888766", "0.4380043", "0.43789676", "0.43755072", "0.43600613", "0.4358231", "0.4358231", "0.43471873", "0.43439737", "0.4342602", "0.4339848", "0.43390858", "0.4336329", "0.43354726", "0.43320635", "0.43251675", "0.43225953", "0.43202862", "0.4318832", "0.43169853", "0.4315067", "0.43133572", "0.4312338", "0.431098", "0.43083918", "0.43076986", "0.4303836", "0.4303836", "0.42967725", "0.42939776" ]
0.5165313
13
applies the mutation to ALL defs/instances within the event store
function applyMutationToEventStore(eventStore, eventConfigBase, mutation, calendar) { var eventConfigs = compileEventUis(eventStore.defs, eventConfigBase); var dest = createEmptyEventStore(); for (var defId in eventStore.defs) { var def = eventStore.defs[defId]; dest.defs[defId] = applyMutationToEventDef(def, eventConfigs[defId], mutation, calendar.pluginSystem.hooks.eventDefMutationAppliers, calendar); } for (var instanceId in eventStore.instances) { var instance = eventStore.instances[instanceId]; var def = dest.defs[instance.defId]; // important to grab the newly modified def dest.instances[instanceId] = applyMutationToEventInstance(instance, def, eventConfigs[instance.defId], mutation, calendar); } return dest; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function applyMutationToEventStore(eventStore, eventConfigBase, mutation, context) {\n var eventConfigs = compileEventUis(eventStore.defs, eventConfigBase);\n var dest = createEmptyEventStore();\n for (var defId in eventStore.defs) {\n var def = eventStore.defs[defId];\n dest.defs[defId] = applyMutationToEventDef(def, eventConfigs[defId], mutation, context);\n }\n for (var instanceId in eventStore.instances) {\n var instance = eventStore.instances[instanceId];\n var def = dest.defs[instance.defId]; // important to grab the newly modified def\n dest.instances[instanceId] = applyMutationToEventInstance(instance, def, eventConfigs[instance.defId], mutation, context);\n }\n return dest;\n }", "function applyMutationToEventStore(eventStore, eventConfigBase, mutation, calendar) {\n var eventConfigs = event_rendering_1.compileEventUis(eventStore.defs, eventConfigBase);\n var dest = event_store_1.createEmptyEventStore();\n\n for (var defId in eventStore.defs) {\n var def = eventStore.defs[defId];\n dest.defs[defId] = applyMutationToEventDef(def, eventConfigs[defId], mutation, calendar.pluginSystem.hooks.eventDefMutationAppliers, calendar);\n }\n\n for (var instanceId in eventStore.instances) {\n var instance = eventStore.instances[instanceId];\n var def = dest.defs[instance.defId]; // important to grab the newly modified def\n\n dest.instances[instanceId] = applyMutationToEventInstance(instance, def, eventConfigs[instance.defId], mutation, calendar);\n }\n\n return dest;\n }", "function applyMutationToEventStore(eventStore, eventConfigBase, mutation, calendar) {\n var eventConfigs = compileEventUis(eventStore.defs, eventConfigBase);\n var dest = createEmptyEventStore();\n for (var defId in eventStore.defs) {\n var def = eventStore.defs[defId];\n dest.defs[defId] = applyMutationToEventDef(def, eventConfigs[defId], mutation, calendar.pluginSystem.hooks.eventDefMutationAppliers, calendar);\n }\n for (var instanceId in eventStore.instances) {\n var instance = eventStore.instances[instanceId];\n var def = dest.defs[instance.defId]; // important to grab the newly modified def\n dest.instances[instanceId] = applyMutationToEventInstance(instance, def, eventConfigs[instance.defId], mutation, calendar);\n }\n return dest;\n}", "function applyMutationToEventStore$1(eventStore, eventConfigBase, mutation, calendar) {\n var eventConfigs = compileEventUis$1(eventStore.defs, eventConfigBase);\n var dest = createEmptyEventStore$1();\n for (var defId in eventStore.defs) {\n var def = eventStore.defs[defId];\n dest.defs[defId] = applyMutationToEventDef$1(def, eventConfigs[defId], mutation, calendar.pluginSystem.hooks.eventDefMutationAppliers, calendar);\n }\n for (var instanceId in eventStore.instances) {\n var instance = eventStore.instances[instanceId];\n var def = dest.defs[instance.defId]; // important to grab the newly modified def\n dest.instances[instanceId] = applyMutationToEventInstance$1(instance, def, eventConfigs[instance.defId], mutation, calendar);\n }\n return dest;\n }", "mapStoreEvents() {\n\t\tconst events = this.handleStoreEvents();\n\t\tfor (const eventType in events) {\n\t\t\t/* eslint-disable no-prototype-builtins */\n\t\t\tif (events.hasOwnProperty(eventType)) {\n\t\t\t\tthis.storage.on(eventType, events[eventType]);\n\t\t\t}\n\t\t}\n\t}", "fire() {\n this.handlers.forEach(handler => {\n //call handler with new state\n //since we pass in the state, this means we have access directly to an atom's data (aka state) in the handler\n //(including a call to render)\n handler(this.state);\n })\n }", "fire() {\n this.handlers.forEach(handler => {\n //call handler with new state\n //since we pass in the state, this means we have access directly to an atom's data (aka state) in the handler\n //(including a call to render)\n handler(this.state);\n })\n }", "afterChange(toSet, wasSet, silent, fromRelationUpdate, skipAccessors) {\n this.stores.forEach(store => {\n store.onModelChange(this, toSet, wasSet, silent, fromRelationUpdate);\n });\n }", "updateToAll() {}", "onModifyDef() {}", "_watch() {\n\t\tconst watchHandler = this._createAppDefinitions.bind(this);\n\t\tthis._componentFinder.watch();\n\t\tthis._componentFinder\n\t\t\t.on('add', watchHandler)\n\t\t\t.on('unlink', watchHandler)\n\t\t\t.on('changeTemplates', watchHandler);\n\n\t\tthis._storeFinder.watch();\n\t\tthis._storeFinder\n\t\t\t.on('add', watchHandler)\n\t\t\t.on('unlink', watchHandler);\n\t}", "changes(state,payload){\n state.commit(\"addSomeName\",payload.name);\n state.commit(\"changeCity\",payload.city);\n }", "function eventHandler(mutations) {\r\n var task, dom, domNo, domTaskIt;\r\n mutations.forEach(\r\n function(mutation){\r\n dom = mutation.target;\r\n domNo = domDataAccessor.call(dom, 'domNo');\r\n if (!domNo)\r\n return;\r\n domTaskIt = domTasks.get(domNo).getIterator();\r\n while (domTaskIt.hasMore()) {\r\n task = domTaskIt.nextValue();\r\n task.checkChange();\r\n }\r\n }\r\n );\r\n }", "apply() {\n this.onApply(this.operations);\n }", "apply() {\n this.onApply(this.operations);\n }", "async updateAllModuleSemantics() {\n await this.db.transaction('rw', this.db.files, this.db.classes, this.db.modules, this.db.functions, () => {\n this.db.files.where(\"type\").equals(\"file\").each((file) => {\n this.addModuleSemantics(file)\n })\n })\n }", "processEvent(obj,changes) {\n var id = new ID(Object.keys(obj)[0],Object.values(obj)[0]);\n this.log(\"processing changes on \"+id);\n if ( this.scene.has(id.toString())) {\n var object = this.scene.get(id.toString());\n Object.assign(object,changes);\n // TODO: route event to mesh/script\n // TODO: notify listeners\n object.notifyListeners(changes);\n } else {\n this.log(\"Unknown object \"+id);\n }\n }", "_createSieve() {\n return this._slouch.doc.createOrUpdate('_global_changes', {\n _id: '_design/' + this._spiegel._namespace + 'sieve',\n views: {\n sieve: {\n map: [\n 'function (doc) {',\n 'if (/:(.*)$/.test(doc._id) && !/:' + this._spiegel._dbName + '$/.test(doc._id)) {',\n 'emit(/:(.*)$/.exec(doc._id)[1]);',\n '}',\n '}'\n ].join(' ')\n }\n }\n })\n }", "acceptChanges() {\n const me = this; // Clear record change tracking\n\n me.added.forEach(r => r.clearChanges(false));\n me.modified.forEach(r => r.clearChanges(false)); // Clear store change tracking\n\n me.added.clear();\n me.modified.clear();\n me.removed.clear();\n }", "uploadChanges() {\n const rowsData = this.readAllEntitiesFromSheet_();\n this.createNewEntities_(\n rowsData.filter((data) => data.action === 'CREATE'));\n this.updateData_(rowsData.filter((data) => data.action === 'MODIFY'));\n this.deleteEntries_(rowsData.filter((data) => data.action === 'DELETE'));\n }", "_setAll(attr, value) {\n this._forEach(event => {\n event[attr] = value;\n });\n }", "function runUpdate(){\n people.forEach(function(element){\n element.update();\n });\n }", "function DOMUpdate(mutations) {\n for (let mutation of mutations) {\n for (let addedNode of mutation.addedNodes) {\n // console.log(addedNode.className)\n let classes = addedNode.className;\n if (classes !== undefined) {\n if (addedNode.className.includes('event ')) {\n if (themes['Classic'] == undefined) {\n console.log('getting themes')\n getThemes()\n loadCSSVariables()\n } else {\n loadCSSVariables();\n }\n return;\n }\n }\n }\n }\n}", "onEventCommit({ changes }) {\n [...changes.added, ...changes.modified].forEach((eventRecord) => this.repaintEvent(eventRecord));\n }", "update (selection) {\n _.values(this._instances).forEach(action => {\n action.evaluate(selection)\n })\n }", "function updateAll(delta)\n{\n univ.update(delta);\n}", "createStore() {\n return {\n update: (_ref) => {\n let { id, msg, fields } = _ref;\n\n if (msg === \"added\" || msg === \"changed\") {\n this.set(id, fields);\n }\n },\n };\n }", "_updateAllEntities() {\n for (let i = this._entities.length - 1; i >= 0; i--) {\n this._entities[i].update();\n }\n }", "function notifyMutationListeners() {\n Ember.run.once(Ember.View, 'notifyMutationListeners');\n}", "function propagate_changes() {\n\tfor (const waiter of to_update.values()) {\n\t\twaiter();\n\t}\n\tto_update = false;\n\tupdate_roots = new Set();\n}", "function updateAll() {\n facetList.forEach(function (facet) {\n facet.update();\n });\n updateResultsListing();\n }", "updateEntities(step) {\n this.entities.platforms.forEach(platform => platform.update(step));\n this.entities.mobs.forEach(mob => mob.update(step));\n this.entities.spikes.forEach(spikes => spikes.update(step));\n this.entities.collectibles.forEach(collectible => collectible.update(step));\n this.entities.infoSigns.forEach(infoSign => infoSign.update(step));\n this.entities.specialObjects.forEach(infoSign => infoSign.update(step));\n }", "function emitChange() {\n TweetStore.emit('change')\n}", "function updateAll() {\n refreshSliderDimensions();\n ngModelRender();\n }", "function updateAll() {\n refreshSliderDimensions();\n ngModelRender();\n }", "function updateAll() {\n refreshSliderDimensions();\n ngModelRender();\n }", "handleOnSync(doctypeUpdates) {\n const normalizedData = mapValues(doctypeUpdates, normalizeAll)\n if (this.client) {\n this.client.setData(normalizedData)\n }\n if (this.options.onSync) {\n this.options.onSync.call(this, normalizedData)\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.info('Pouch synced')\n }\n }", "async reset (eventId) {\n let events = await global.db.engine.find('events', { key: eventId })\n for (let event of events) {\n event.triggered = {}\n await global.db.engine.update('events', { _id: event._id.toString() }, event)\n }\n }", "apply() {\n this.update();\n }", "updateAll(state) {\n this.iteratePlugins(plugin => {\n plugin.update(state);\n });\n }", "setEvents(state, payload) {\n //console.log(payload);\n state.events = payload;\n }", "function getRelevantEvents$1(eventStore, instanceId) {\n var instance = eventStore.instances[instanceId];\n if (instance) {\n var def_1 = eventStore.defs[instance.defId];\n // get events/instances with same group\n var newStore = filterEventStoreDefs$1(eventStore, function (lookDef) {\n return isEventDefsGrouped$1(def_1, lookDef);\n });\n // add the original\n // TODO: wish we could use eventTupleToStore or something like it\n newStore.defs[def_1.defId] = def_1;\n newStore.instances[instance.instanceId] = instance;\n return newStore;\n }\n return createEmptyEventStore$1();\n }", "setMultiple(filterFn, field, value) {\n const me = this,\n records = [],\n changes = [];\n me.forEach(r => {\n if (filterFn(r)) {\n changes.push(r.set(field, value, true));\n records.push(r);\n }\n }); // TODO: should consolidate with update, make it take an array instead? to only have to listen for one event outside of store?\n\n me.trigger('updateMultiple', {\n records,\n all: me.records.length === records.length\n });\n me.trigger('change', {\n action: 'updatemultiple',\n records,\n all: me.records.length === records.length\n });\n if (me.reapplyFilterOnUpdate && me.isFiltered) me.filter();\n }", "function setForeignListeners(){\n for(var module in createdModules){\n createdModules[module].setForeignValueListeners();\n }\n}", "mutate() {}", "mutate() {}", "update(e){this._reflectingProperties!==void 0&&0<this._reflectingProperties.size&&(this._reflectingProperties.forEach((e,t)=>this._propertyToAttribute(t,this[t],e)),this._reflectingProperties=void 0)}", "setMultiple(filterFn, field, value) {\n const me = this,\n records = [],\n changes = [];\n\n me.forEach((r) => {\n if (filterFn(r)) {\n changes.push(r.set(field, value, true));\n records.push(r);\n }\n });\n\n // TODO: should consolidate with update, make it take an array instead? to only have to listen for one event outside of store?\n\n me.trigger('updateMultiple', { records, all: me.records.length === records.length });\n me.trigger('change', { action: 'updatemultiple', records, all: me.records.length === records.length });\n\n if (me.reapplyFilterOnUpdate && me.isFiltered) me.filter();\n }", "reTriggerChanges() {\n for (const attr in this.attributes) {\n this.trigger(`change:${attr}`, this, this.get(attr), {});\n }\n this.trigger(\"change\", this, {});\n }", "emitChanges() {\n this.app.emit(this.changeActionName, this);\n }", "_onMutate(mutations) {\n each(mutations, function(m) {\n if (m.target !== this.el) this._recomputeDebounced();\n }.bind(this));\n }", "function applyUpdatesFn(currentValue, updates) {\n for (var i = 0; i < updates.length; i++) {\n var updatedHist = updates[i].obj;\n var updatedHistId = updatedHist.id;\n var updatedHistIsActive = updatedHist.active;\n\n var currentHistWithSameId = _.find(currentValue, function equalIdsPredicate(hist) {\n return hist.id === updatedHistId;\n });\n if (currentHistWithSameId) {\n if (updatedHistIsActive) {\n currentValue.splice(currentValue.indexOf(currentHistWithSameId), 1, updatedHist);\n } else {\n currentValue.splice(currentValue.indexOf(currentHistWithSameId), 1);\n }\n } else {\n if (updatedHistIsActive) {\n currentValue.push(updatedHist);\n }\n }\n\n if (updatedHistIsActive) {\n // Register eager fields\n data.field(\"record/\" + updatedHistId + \"/startDate\").setStartValue(new Date()).setWatchable(true).register();\n data.field(\"record/\" + updatedHistId + \"/problemStatus\").setStartValue({}).setWatchable(true).register();\n data.field(\"record/\" + updatedHistId + \"/relationCode\").setStartValue({}).setWatchable(true).register();\n data.field(\"record/\" + updatedHistId + \"/description\").setWatchable(true).register();\n data.field(\"record/\" + updatedHistId + \"/endDate\").setWatchable(true).register();\n data.field(\"record/\" + updatedHistId + \"/problemType\").setStartValue({}).setWatchable(true).register();\n data.field(\"record/\" + updatedHistId + \"/problemValueSnomed\").setStartValue({}).setWatchable(true).register();\n data.field(\"record/\" + updatedHistId + \"/noProblemKnown\").setWatchable(true).register();\n } else {\n // Deregister all child fields\n data.deregisterAllFieldsWithPathStartsWith(\"record/\" + updatedHistId);\n }\n }\n // Pull newly registered fields\n data.pullNewlyRegisteredFields();\n return currentValue;\n }", "handleOnSync(doctypeUpdates) {\n const normalizedData = mapValues(doctypeUpdates, normalizeAll)\n if (this.client) {\n this.client.setData(normalizedData)\n }\n if (this.options.onSync) {\n this.options.onSync.call(this, normalizedData)\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.info('Pouch synced')\n }\n this.client.emit('pouchlink:sync:end')\n }", "function update() {\n updaters.forEach(function (f) { f(); });\n }", "setUpdates (fns) {\n this._updates = fns;\n }", "storeForEval(toBeEvaluated) {\n this.internalContext.assign(Const_1.UPDATE_ELEMS).value.push(toBeEvaluated);\n }", "async _listenToUpdates() {\n this._dbUpdatesIterator = this._changes({\n feed: 'continuous',\n heartbeat: true,\n since: this._lastSeq ? this._lastSeq : undefined\n\n // Note: we no longer use the sieve view as views on the _global_changes database appear to be\n // flaky when there is a significant amount of activity. Specifically, changes will never be\n // reported by the _changes feed and this will result in replicators and change-listeners\n // never being dirted. This becomes clear when running the stress tests with 1,000\n // replicators.\n //\n // TODO: remove the sieve view?\n //\n // filter: '_view',\n // view: this._spiegel._namespace + 'sieve/sieve'\n })\n\n this._listenToIteratorErrors(this._dbUpdatesIterator)\n\n await this._dbUpdatesIteratorEach()\n }", "loadEventListeners() {\n // Watch tokens transfer event below\n this.state.clearContract.SalaryPlaced({ fromBlock: 'latest', toBlock: 'latest' })\n .watch((err, emittedEvent) => {\n console.log(emittedEvent)\n console.log(emittedEvent.args.amount.toNumber())\n })\n\n this.state.clearContract.SalaryClaimed({ fromBlock: 'latest', toBlock: 'latest' })\n .watch((err, emittedEvent) => {\n console.log(emittedEvent)\n })\n }", "use (...handlers) { this.handlers = this.handlers.concat(handlers) }", "function documentMutationsStore(txn){return SimpleDb.getStore(txn,DbDocumentMutation.store);}", "update(object) {\n for (const prop in object){\n this.state[prop] = object[prop];\n }\n //change has been made to data so call handler\n this.fire();\n\n }", "update(object) {\n for (const prop in object){\n this.state[prop] = object[prop];\n }\n //change has been made to data so call handler\n this.fire();\n\n }", "mutate() {\n // Update relationships here\n // Optimising Organisations\n let newOrgs = [];\n for (let org of organisations) {\n const newOrg = this.optimise(org, Organisation, ORGANISATIONS);\n newOrgs.push(newOrg);\n }\n organisations = newOrgs;\n // Optimising Users\n let newUsers = [];\n for (let user of users) {\n const newUser = this.optimise(user, User, USERS);\n newUsers.push(newUser);\n // Add user to organisation using _id as a unique identifier\n let org = this.getOrganisation(newUser.organization_id);\n if (org) {\n org.addUser(newUser);\n newUser.organisation = org;\n }\n }\n users = newUsers;\n\n\n // Optimising Tickets\n let newTickets = [];\n for (let ticket of tickets) {\n const newTicket = this.optimise(ticket, Ticket, TICKETS);\n newTickets.push(newTicket);\n\n // Add ticket to submitter user\n let submitter = this.getUser(newTicket.submitter_id);\n if(submitter) {\n submitter.addTicket(newTicket, true);\n newTicket.submitter = submitter;\n }\n\n // Add ticket to assignee\n let assignee = this.getUser(newTicket.assignee_id);\n if (assignee) {\n assignee.addTicket(newTicket);\n newTicket.assignee = assignee;\n }\n\n // Add ticket to Organistaion\n let org = this.getOrganisation(newTicket.organization_id);\n if (org) {\n org.addTicket(newTicket);\n newTicket.organisation = org;\n }\n\n }\n tickets = newTickets;\n }", "function processWordListChangedListeners() {\n\n var handlers = Object.keys(wordListChangedListeners);\n for (var j = 0; j < handlers.length; j++)\n wordListChangedListeners[handlers[j]]();\n}", "update()\n {\n let entitiesCount = this.entities.length;\n\n for (let i = 0; i < entitiesCount; i++)\n {\n let entity = this.entities[i];\n\n entity.update();\n }\n }", "function updateAll() {\n refreshSliderDimensions();\n ngModelRender();\n redrawTicks();\n }", "update() {\n this.weapons.forEach(weapon => {\n weapon.update();\n });\n }", "function getRelevantEvents(eventStore, instanceId) {\n var instance = eventStore.instances[instanceId];\n\n if (instance) {\n var def_1 = eventStore.defs[instance.defId]; // get events/instances with same group\n\n var newStore = filterEventStoreDefs(eventStore, function (lookDef) {\n return isEventDefsGrouped(def_1, lookDef);\n }); // add the original\n // TODO: wish we could use eventTupleToStore or something like it\n\n newStore.defs[def_1.defId] = def_1;\n newStore.instances[instance.instanceId] = instance;\n return newStore;\n }\n\n return createEmptyEventStore();\n }", "async updateWorldItems() {\n const itemSpells = await this.updateFolderItems(\"itemSpells\");\n // scan the inventory for each item with spells and copy the imported data over\n this.result.inventory.forEach((item) => {\n if (item.flags.magicitems.spells) {\n for (let [i, spell] of Object.entries(item.flags.magicitems.spells)) {\n const itemSpell = itemSpells.find((item) => item.name === spell.name);\n if (itemSpell) {\n for (const [key, value] of Object.entries(itemSpell)) {\n item.flags.magicitems.spells[i][key] = value;\n }\n } else if (!game.user.can(\"ITEM_CREATE\")) {\n ui.notifications.warn(`Magic Item ${item.name} cannot be enriched because of lacking player permissions`);\n }\n }\n }\n });\n }", "function getRelevantEvents(eventStore, instanceId) {\n var instance = eventStore.instances[instanceId];\n if (instance) {\n var def_1 = eventStore.defs[instance.defId];\n // get events/instances with same group\n var newStore = filterEventStoreDefs(eventStore, function (lookDef) { return isEventDefsGrouped(def_1, lookDef); });\n // add the original\n // TODO: wish we could use eventTupleToStore or something like it\n newStore.defs[def_1.defId] = def_1;\n newStore.instances[instance.instanceId] = instance;\n return newStore;\n }\n return createEmptyEventStore();\n }", "async _apply (batch) {\n const b = this.bee.batch({ update: false })\n for (const node of batch) {\n const op = JSON.parse(node.value.toString())\n // TODO: Handle deletions\n if (op.type === 'put') await b.put(op.key, op.value)\n }\n await b.flush()\n }", "function updateAll() {\n validate();\n calculate();\n updateDose();\n DrawDose();\n}", "updateListeners() {\n\t\tthis.listeners.forEach(l => l());\n\t}", "function pushChanges() {\n _.chain(Agents.getChanges())\n .groupBy('obj.id')\n // Get only one of the objects\n .map(function (items) {\n // If there's only a single object, return it\n if (items.count === 1) {\n return items[0];\n }\n\n // Return either the deleted item or the first item.\n return _.some(items, { operation: 'R' })\n ? _.find(items, { operation: 'R' })\n : items[0];\n })\n .forEach(function (item) {\n // If the interaction was removed, disable it in the DB.\n // Otherwise find it and update or insert it\n var _agent = item.operation !== 'R'\n ? Agents.findOne({ id: item.obj.id })\n : _.assign({}, item.obj, { isDisabled: true });\n\n icwsDb.setAgent(_agent, true);\n })\n .value();\n\n // Clear the changes\n Agents.flushChanges();\n}", "function getRelevantEvents(eventStore, instanceId) {\n var instance = eventStore.instances[instanceId];\n if (instance) {\n var def_1 = eventStore.defs[instance.defId];\n // get events/instances with same group\n var newStore = filterEventStoreDefs(eventStore, function (lookDef) {\n return isEventDefsGrouped(def_1, lookDef);\n });\n // add the original\n // TODO: wish we could use eventTupleToStore or something like it\n newStore.defs[def_1.defId] = def_1;\n newStore.instances[instance.instanceId] = instance;\n return newStore;\n }\n return createEmptyEventStore();\n }", "function getRelevantEvents(eventStore, instanceId) {\n var instance = eventStore.instances[instanceId];\n if (instance) {\n var def_1 = eventStore.defs[instance.defId];\n // get events/instances with same group\n var newStore = filterEventStoreDefs(eventStore, function (lookDef) {\n return isEventDefsGrouped(def_1, lookDef);\n });\n // add the original\n // TODO: wish we could use eventTupleToStore or something like it\n newStore.defs[def_1.defId] = def_1;\n newStore.instances[instance.instanceId] = instance;\n return newStore;\n }\n return createEmptyEventStore();\n }", "function getRelevantEvents(eventStore, instanceId) {\n var instance = eventStore.instances[instanceId];\n if (instance) {\n var def_1 = eventStore.defs[instance.defId];\n // get events/instances with same group\n var newStore = filterEventStoreDefs(eventStore, function (lookDef) {\n return isEventDefsGrouped(def_1, lookDef);\n });\n // add the original\n // TODO: wish we could use eventTupleToStore or something like it\n newStore.defs[def_1.defId] = def_1;\n newStore.instances[instance.instanceId] = instance;\n return newStore;\n }\n return createEmptyEventStore();\n }", "$trigger (types, ...args) {\n xeach(types, (type) => {\n const events = $events.get(this)\n if (events) events.trigger(this, type, args)\n })\n }", "function set_events() {\n\n\tif ('undefined'==typeof(ns)) ns = $.initNamespaceStorage('tensor_ns'); // global\n\tif ('undefined'==typeof(storage)) storage = ns.localStorage; // global\n\t\n\tvar imported = ('undefined'!=typeof(storage.get('imported'))) ? storage.get('imported') : {};\n\t$('.num_imported').html( $.map(imported, function(n, i) { return i; }).length );\n\t\n\t$(\"body\").on( \"import_add_node\", function( event, uri, values ) {\n\t\t// All\n\t\tvar imported = storage.get('imported');\n\t\tif ('undefined'==typeof(imported)) imported = {};\n\t\timported[uri] = values;\n\t\tstorage.set('imported', imported);\t\t\n\t\t// Collection\n\t\tvar col_id = collections_ui.col_id;\n\t\tif (null!=col_id) {\n\t\t\tvar collections = storage.get('collections');\n\t\t\tif ('undefined'!=typeof(collections[col_id])) {\n\t\t\t\tcollections[col_id].items[uri] = values;\n\t\t\t\tstorage.set('collections', collections);\n\t\t\t};\t\t\n\t\t};\n\t\t// UI\n\t\tset_collections_numbers();\n\t});\t\n\t$(\"body\").on( \"import_remove_node\", function( event, uri ) {\n\t\tvar col_id = collections_ui.col_id;\n\t\tif (null==col_id) {\t\t\n\t\t\tvar imported = storage.get('imported');\n\t\t\tif ('undefined'==typeof(imported)) imported = {};\n\t\t\tif ('undefined'!=typeof(imported[uri])) delete imported[uri];\n\t\t\tstorage.set('imported', imported);\t\n\t\t\t// Remove from collection items\n\t\t\tvar collections = storage.get('collections');\n\t\t\tif ('undefined'==typeof(collections)) collections = [];\n\t\t\tfor (var j in collections) {\n\t\t\t\tif ('undefined'!=collections[j].items[uri]) {\n\t\t\t\t\tdelete collections[j].items[uri];\n\t\t\t\t}\n\t\t\t}\n\t\t\tstorage.set('collections', collections);\n\t\t} else {\n\t\t\tvar collections = storage.get('collections');\n\t\t\tdelete collections[col_id].items[uri];\n\t\t\tstorage.set('collections', collections);\n\t\t}\n\t\tset_collections_numbers();\n\t});\t\t\n\t\n\t$(\"body\").on( \"node_not_clickable\", function( event, uri, values, $el ) {\n\t\tvar $edit_metadata = $('#edit_metadata');\n\t\tvar $header = $edit_metadata.find('.modal-header');\n\t\tvar $body = $edit_metadata.find('.modal-body');\n\t\t$header.find('.thumb').css('background-image', '');\n\t\t$body.empty();\n\t\t$edit_metadata.modal('show');\n\t\tvalues = sort_predicates_by_prop(values);\n\t\tvar thumb = '';\n\t\tfor (var p in values) {\n\t\t\tvar $p = $('<div class=\"row\"><div class=\"col-xs-12 col-sm-2 p\"></div><div class=\"col-xs-12 col-sm-10 v\"></div></div>');\n\t\t\t$p.find('div:first').data('p',p).html( pnode(p) );\n\t\t\tfor (var j = 0; j < values[p].length; j++) {\n\t\t\t\t$p.find('div:last').append('<input type=\"text\" class=\"form-control\" value=\"'+escapeHtml(values[p][j].value)+'\" />');\n\t\t\t}\n\t\t\t$body.append($p);\n\t\t\tif ('http://simile.mit.edu/2003/10/ontologies/artstor#thumbnail' == p && 'undefined'!=typeof(values[p][0])) {\n\t\t\t\tthumb = values[p][0].value;\n\t\t\t}\n\t\t}\n\t\tif (thumb.length) {\n\t\t\t$header.find('.thumb').css('background-image', 'url('+thumb+')');\n\t\t}\n\t});\t\t\n\t\n\t$(\"body\").on( \"collection_add_node\", function( event, obj ) {\n\t\tvar collections = storage.get('collections');\n\t\tif ('undefined'==typeof(collections)) collections = [];\n\t\tobj.items = {};\n\t\tcollections.push(obj);\n\t\tstorage.set('collections', collections);\n\t\tswitch_to('collections');\n\t\tcollections_ui(collections.length-1);\n\t});\t\n\t$(\"body\").on( \"collection_edit_node\", function( event, col_id, obj ) {\n\t\tvar collections = storage.get('collections');\n\t\tif ('undefined'==typeof(collections[col_id])) return;\n\t\tcollections[col_id].title = obj.title;\n\t\tcollections[col_id].description = obj.description;\n\t\tcollections[col_id].color = obj.color;\n\t\tstorage.set('collections', collections);\n\t\tcollections_ui(col_id);\n\t});\t\t\n\t$(\"body\").on( \"collection_remove_node\", function( event, index ) {\n\t\tvar collections = storage.get('collections');\n\t\tif ('undefined'==typeof(collections)) collections = [];\n\t\tif ('undefined'!=typeof(collections[index])) collections.splice(index, 1);\n\t\tstorage.set('collections', collections);\n\t\tcollections_ui();\n\t\t$('#collections_form').find('.all').click();\n\t});\t\t\n\t\n}", "function getRelevantEvents(eventStore, instanceId) {\n var instance = eventStore.instances[instanceId];\n if (instance) {\n var def_1 = eventStore.defs[instance.defId];\n // get events/instances with same group\n var newStore = filterEventStoreDefs(eventStore, function (lookDef) {\n return isEventDefsGrouped(def_1, lookDef);\n });\n // add the original\n // TODO: wish we could use eventTupleToStore or something like it\n newStore.defs[def_1.defId] = def_1;\n newStore.instances[instance.instanceId] = instance;\n return newStore;\n }\n return createEmptyEventStore();\n}", "function getRelevantEvents(eventStore, instanceId) {\n var instance = eventStore.instances[instanceId];\n\n if (instance) {\n var def_1 = eventStore.defs[instance.defId]; // get events/instances with same group\n\n var newStore = filterEventStoreDefs(eventStore, function (lookDef) {\n return isEventDefsGrouped(def_1, lookDef);\n }); // add the original\n // TODO: wish we could use eventTupleToStore or something like it\n\n newStore.defs[def_1.defId] = def_1;\n newStore.instances[instance.instanceId] = instance;\n return newStore;\n }\n\n return createEmptyEventStore();\n }", "bindEventStoreListeners() {\n const me = this;\n\n me._eventStoreListenersDetacher && me._eventStoreListenersDetacher();\n\n // Maps to taskStore for Gantt\n me._eventStoreListenersDetacher = me.store.eventStore.on({\n change: me.onEventChange,\n thisObj: me\n });\n }", "handleMutation(index) {\n const plot = App.game.farming.plotList[index];\n plot.berry = this.mutatedBerry;\n plot.age = 0;\n plot.notifications = [];\n App.game.farming.unlockBerry(this.mutatedBerry);\n }", "bindCrudStoreListeners(store) {\n store.on({\n name: 'store',\n change: 'onCrudStoreChange',\n thisObj: this\n });\n }", "function applyEventDefMutation(eventDef, mutation, calendar) {\n var resourceMutation = mutation.resourceMutation;\n if (resourceMutation && computeResourceEditable(eventDef, calendar)) {\n var index = eventDef.resourceIds.indexOf(resourceMutation.matchResourceId);\n if (index !== -1) {\n var resourceIds = eventDef.resourceIds.slice(); // copy\n resourceIds.splice(index, 1); // remove\n if (resourceIds.indexOf(resourceMutation.setResourceId) === -1) { // not already in there\n resourceIds.push(resourceMutation.setResourceId); // add\n }\n eventDef.resourceIds = resourceIds;\n }\n }\n}", "flush () {\n const changes = this.model.flush()\n const computedsAboutToBecomeDirty = this.strictRender ? computedDependencyStore.getStrictUniqueEntities(changes) : computedDependencyStore.getUniqueEntities(changes)\n\n computedsAboutToBecomeDirty.forEach((computed) => {\n computed.flag()\n })\n this.emit('flush', changes)\n }", "onUpdate() {\n for (const computeCell of this.computeCells) {\n computeCell.onInputUpdate();\n }\n }", "function enableEventHooks() {\n \n // event hooks are on spaces, but are defined in services. When a space or service is edited, the hook database would need to be re-generated for the space\n // when we use a database, the space would be looked up per request. then we would know its hooks.\n \n // for now we fake it * but at least we are faking it off the real metadata\n \n // foreach space\n \n for (var spacenum = 0; spacenum < spacemetadata.spaces.length; spacenum++) {\n var space = spacemetadata.spaces[spacenum];\n \n console.log(\"Space: \" + space.name);\n if (space.hasOwnProperty(\"services\")) {\n var spaceservices = space.services;\n spacemap[space.uuid] = new Array();\n lastspacemap[space.uuid] = new Array();\n \n for(var sidx = 0; sidx < spaceservices.length; sidx++) {\n var serviceno = objectFindByKey(spacemetadata.services, \"uuid\", spaceservices[sidx]);\n if (serviceno > -1 ) {\n var servicemeta = spacemetadata.services[serviceno];\n console.log(\" service: \" + servicemeta.name);\n if (servicemeta.hasOwnProperty(\"webservice\")) {\n // it's a web service that has a request field - go get THAT\n var webno = objectFindByKey(spacemetadata.webservices, \"uuid\", servicemeta.webservice);\n if (webno > -1) {\n var webmeta = spacemetadata.webservices[webno];\n \n // TBD: make fast lookup for webhook by service?\n \n console.log(\" has a webservice: \" + webmeta);\n if (servicemeta.hasOwnProperty(\"enterhook\")) {\n if (!enterhooks.hasOwnProperty(space.uuid)) {\n enterhooks[space.uuid] = new Array();\n }\n var spacerec = {method: hooknames[servicemeta.enterhook], request: webmeta.request};\n enterhooks[space.uuid].push(spacerec );\n } else {\n servicehookmap[servicemeta.endpoint] = webmeta;\n }\n }\n }\n }\n }\n }\n // enterhooks[\"f06ecb2f-de00-4ea6-a533-c46b217f96a2\"] = new Array();\n // enterhooks[\"f06ecb2f-de00-4ea6-a533-c46b217f96a2\"].push({method: hooknames[\"speak\"], request: {}} );\n \n }\n console.log(enterhooks);\n}", "refresh() {\n this._setForm();\n\n let data = this._eventData;\n this._eventData = [];\n\n for (let item of data) {\n this.addElementListener(item.event, item.name, item.listener, item.options);\n }\n\n data = this._submitData;\n this._submitData = [];\n\n for (let item of data) {\n this.addSubmitListener(item.listener, item.options);\n }\n }", "updateAllVarCache() {\n const { delta: { varLastCalcIndex }, updateVariable } = this;\n updateVariable(varLastCalcIndex);\n }", "handleMutation(index) {\n const plot = App.game.farming.plotList[index];\n const currentStage = plot.stage();\n let newAge = 0;\n if (currentStage !== PlotStage.Seed) {\n newAge = App.game.farming.berryData[this.mutatedBerry].growthTime[currentStage - 1] + 1;\n }\n plot.berry = this.mutatedBerry;\n plot.age = newAge;\n plot.notifications = [];\n App.game.farming.unlockBerry(this.mutatedBerry);\n }", "cleanUpEvents() {\n for (let idx in this.eventsToClean) {\n this.eventsToClean[idx].removeCleanupListeners();\n }\n }", "_applyChanges(changes) {\n this._viewRepeater.applyChanges(changes, this._viewContainerRef, (record, adjustedPreviousIndex, currentIndex) => this._getEmbeddedViewArgs(record, currentIndex), (record) => record.item);\n // Update $implicit for any items that had an identity change.\n changes.forEachIdentityChange((record) => {\n const view = this._viewContainerRef.get(record.currentIndex);\n view.context.$implicit = record.item;\n });\n // Update the context variables on all items.\n const count = this._data.length;\n let i = this._viewContainerRef.length;\n while (i--) {\n const view = this._viewContainerRef.get(i);\n view.context.index = this._renderedRange.start + i;\n view.context.count = count;\n this._updateComputedContextProperties(view.context);\n }\n }", "emit() {\n\t\t\tlet currentListeners = listeners;\n\t\t\tfor (let i=0; i<currentListeners.length; i++) {\n\t\t\t\tcurrentListeners[i].apply(null, arguments);\n\t\t\t}\n\t\t}", "setStore(data) {\n //4 possible configurations for initalizing a store with data\n //1. Pass in objects with Atom\n //2. Pass in intialized atoms as an array with no type (we're responsible for inferring)\n //3. 1 but via CollectionStoreOf\n //4. 2 but via CollectionStoreOf\n if (data !== undefined && data !== null && data.length > 0) {\n //assume all data is the same type if no atom class is provided (meaning we can infer it directly, since just list of atoms) \n if (this._atomClass === undefined) {\n this.data = new Set(data);\n //use the first element from the provided list as a heuristic for the type of atomic data of the data source\n this._atomClass = data[0].type;\n } else {\n if (data[0] instanceof Atom) {\n this.data = new Set(data);\n } else {\n this.data = new Set(data.map(el => new this._atomClass(el)));\n }\n } \n } else {\n this.data = new Set();\n } \n //should emit an event for any handlers to act on\n this.fire();\n }", "setStore(data) {\n //4 possible configurations for initalizing a store with data\n //1. Pass in objects with Atom\n //2. Pass in intialized atoms as an array with no type (we're responsible for inferring)\n //3. 1 but via CollectionStoreOf\n //4. 2 but via CollectionStoreOf\n if (data !== undefined && data !== null && data.length > 0) {\n //assume all data is the same type if no atom class is provided (meaning we can infer it directly, since just list of atoms) \n if (this._atomClass === undefined) {\n this.data = new Set(data);\n //use the first element from the provided list as a heuristic for the type of atomic data of the data source\n this._atomClass = data[0].type;\n } else {\n if (data[0] instanceof Atom) {\n this.data = new Set(data);\n } else {\n this.data = new Set(data.map(el => new this._atomClass(el)));\n }\n } \n } else {\n this.data = new Set();\n } \n //should emit an event for any handlers to act on\n this.fire();\n }", "addEvent(title, allDay, start, end, notification) {\n const newEvent = {\n title: title,\n allDay: allDay,\n start: start,\n end: end,\n notification: notification\n };\n let events = [...this.props.events, newEvent];\n storeEvents(events);\n this.props.update();\n }", "onEventCommit({\n changes\n }) {\n let resourcesToRepaint = [...changes.added, ...changes.modified].map(eventRecord => this.eventStore.getResourcesForEvent(eventRecord)); // flatten\n\n resourcesToRepaint = Array.prototype.concat.apply([], resourcesToRepaint); // repaint relevant resource rows\n\n new Set(resourcesToRepaint).forEach(resourceRecord => this.repaintEventsForResource(resourceRecord));\n }" ]
[ "0.68634754", "0.6662366", "0.6651558", "0.66345483", "0.5874537", "0.5667056", "0.5667056", "0.55764717", "0.54928976", "0.5418426", "0.5389518", "0.5369385", "0.53522754", "0.5299219", "0.5299219", "0.52860737", "0.5282436", "0.52693194", "0.5253856", "0.5213634", "0.5211221", "0.51984", "0.5157041", "0.5155534", "0.5140775", "0.51365066", "0.50855535", "0.506654", "0.50389963", "0.50374925", "0.50271213", "0.5024031", "0.50168467", "0.50144273", "0.50144273", "0.50144273", "0.5008973", "0.50043947", "0.50021255", "0.49987695", "0.49974036", "0.49611142", "0.49602684", "0.49589577", "0.49565881", "0.49565881", "0.49549147", "0.49495333", "0.49489805", "0.49480057", "0.49214557", "0.49181172", "0.49173453", "0.49171105", "0.49097362", "0.48948893", "0.48926407", "0.48714155", "0.48687506", "0.48675394", "0.48630846", "0.48630846", "0.4858582", "0.48572", "0.4854667", "0.48498458", "0.48492506", "0.4847098", "0.48426837", "0.48426372", "0.48417312", "0.48372847", "0.48336262", "0.48327768", "0.4831028", "0.4831028", "0.4831028", "0.48295727", "0.48224786", "0.48140597", "0.48108077", "0.48089352", "0.48017365", "0.47885296", "0.47865894", "0.47857755", "0.47845846", "0.47844368", "0.47791564", "0.477651", "0.47735804", "0.47728825", "0.47728047", "0.4769898", "0.47685272", "0.47685272", "0.47682285", "0.47676453" ]
0.67085457
3
QUESTION: why not just return instances? do a general objectpropertyexclusion util
function excludeInstances(eventStore, removals) { return { defs: eventStore.defs, instances: filterHash(eventStore.instances, function (instance) { return !removals[instance.instanceId]; }) }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static restrict(o, p) {\n for(let prop in o) { // For all props in o\n if (!(prop in p)) delete o[prop]; // Delete if not in p\n }\n return o;\n }", "_applyInstanceProperties(){// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\n// tslint:disable-next-line:no-any\nthis._instanceProperties.forEach((v,p)=>this[p]=v);this._instanceProperties=undefined;}", "removeAllInstances() {// Implemented by sublasses\n }", "function excludeInstances(eventStore, removals) {\n return {\n defs: eventStore.defs,\n instances: filterHash(eventStore.instances, function (instance) { return !removals[instance.instanceId]; }),\n };\n }", "function excludeInstances(eventStore, removals) {\n return {\n defs: eventStore.defs,\n instances: filterHash(eventStore.instances, function (instance) {\n return !removals[instance.instanceId];\n })\n };\n}", "function getInternalProperties(obj) {\n if (hop.call(obj, '__getInternalProperties')) return obj.__getInternalProperties(secret);\n\n return objCreate(null);\n}", "function getInternalProperties(obj) {\n if (hop.call(obj, '__getInternalProperties')) return obj.__getInternalProperties(secret);\n\n return objCreate(null);\n}", "function getInternalProperties(obj) {\n if (hop.call(obj, '__getInternalProperties')) return obj.__getInternalProperties(secret);\n\n return objCreate(null);\n}", "function getInternalProperties(obj) {\n if (hop.call(obj, '__getInternalProperties')) return obj.__getInternalProperties(secret);\n\n return objCreate(null);\n}", "function getInternalProperties(obj) {\n if (hop.call(obj, '__getInternalProperties')) return obj.__getInternalProperties(secret);\n\n return objCreate(null);\n}", "function getInternalProperties(obj) {\n if (hop.call(obj, '__getInternalProperties')) return obj.__getInternalProperties(secret);\n\n return objCreate(null);\n}", "_applyInstanceProperties(){// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\n// tslint:disable-next-line:no-any\nthis._instanceProperties.forEach((v,p)=>this[p]=v);this._instanceProperties=void 0}", "function objectLike(pattern) {\n return _objectContaining(pattern, false);\n}", "_saveInstanceProperties(){// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\nthis.constructor._classProperties.forEach((e,t)=>{if(this.hasOwnProperty(t)){const e=this[t];delete this[t],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(t,e)}})}", "without(prop, ...val) {\n\t\tif (this.lastResult === false) return this; //do nothing\n\t\tif (!this.workingList || !this.workingList.length) {\n\t\t\tthis.lastResult = false;\n\t\t\treturn this;\n\t\t}\n\t\tif (val.length === 1 && Array.isArray(val[0])) val = val[0];\n\t\tlet props = prop.split('.');\n\t\tlet vals = new Set(val);\n\t\tlet list = this.workingList;\n\t\tthis.workingList = [];\n\t\touterLoop:\n\t\tfor (let item of list) {\n\t\t\tlet p = item;\n\t\t\tfor (let pp of props) {\n\t\t\t\tif (p[pp] === undefined) {\n\t\t\t\t\tthis.workingList.push(item);\n\t\t\t\t\tcontinue outerLoop;\n\t\t\t\t} \n\t\t\t\tp = p[pp];\n\t\t\t}\n\t\t\tif (vals.has(p)) continue outerLoop;\n\t\t\tthis.workingList.push(item);\n\t\t}\n\t\tthis.lastResult = (this.workingList.length > 0);\n\t\treturn this;\n\t}", "static get observedAttributes(){this.finalize();const e=[];// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\nreturn this._classProperties.forEach((t,n)=>{const r=this._attributeNameForProperty(n,t);void 0!==r&&(this._attributeToPropertyMap.set(r,n),e.push(r))}),e}", "function PropertyDetection() {}", "function excludeInstances$1(eventStore, removals) {\n return {\n defs: eventStore.defs,\n instances: filterHash$1(eventStore.instances, function (instance) {\n return !removals[instance.instanceId];\n })\n };\n }", "toObject() { throw new Error('virtual function called') }", "_saveInstanceProperties(){// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\nthis.constructor._classProperties.forEach((_v,p)=>{if(this.hasOwnProperty(p)){const value=this[p];delete this[p];if(!this._instanceProperties){this._instanceProperties=new Map();}this._instanceProperties.set(p,value);}});}", "_applyInstanceProperties(){// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\n// tslint:disable-next-line:no-any\nthis._instanceProperties.forEach((e,t)=>this[t]=e),this._instanceProperties=void 0}", "function makeSafeObject(dirty, properties) {\n\tlet safe = {};\n\tproperties.forEach((prop) => {\n\t\tlet parts = prop.split('.');\n\t\tlet source = dirty;\n\t\tlet target = safe;\n\t\tfor (let i=0; i < parts.length - 1; i++) {\n\t\t\tif (!source[parts[i]]) return; // Source doesn't have property\n\t\t\tif (!target[parts[i]]) target[parts[i]] = {};\n\t\t\tsource = source[parts[i]];\n\t\t\ttarget = target[parts[i]];\n\t\t}\n\t\tif (!source[parts[parts.length-1]]) return; // Source doesn't have property\n\t\ttarget[parts[parts.length-1]] = source[parts[parts.length-1]];\n\t});\n\treturn safe;\n}", "function createPropsRestProxy(props, excludedKeys) {\n const ret = {\n };\n for(const key in props)if (!excludedKeys.includes(key)) Object.defineProperty(ret, key, {\n enumerable: true,\n get: ()=>props[key]\n });\n return ret;\n}", "function obj() {\n return Object.create(null);\n}", "function getInternalProperties (obj) {\n if (hop.call(obj, '__getInternalProperties'))\n return obj.__getInternalProperties(secret);\n else\n return objCreate(null);\n}", "function omit(obj, prop1,prop2) {\r\n if (!obj) {\r\n return null;\r\n }\r\n var result = mixin({},obj);\r\n for(var i=1;i<arguments.length;i++) {\r\n var pn = arguments[i];\r\n if (pn in obj) {\r\n delete result[pn];\r\n }\r\n }\r\n return result;\r\n\r\n }", "function createPropsRestProxy(props, excludedKeys) {\n const ret = {};\n for (const key in props) {\n if (!excludedKeys.includes(key)) {\n Object.defineProperty(ret, key, {\n enumerable: true,\n get: () => props[key]\n });\n }\n }\n return ret;\n}", "function createPropsRestProxy(props, excludedKeys) {\n const ret = {};\n for (const key in props) {\n if (!excludedKeys.includes(key)) {\n Object.defineProperty(ret, key, {\n enumerable: true,\n get: () => props[key]\n });\n }\n }\n return ret;\n}", "function createPropsRestProxy(props, excludedKeys) {\n const ret = {};\n for (const key in props) {\n if (!excludedKeys.includes(key)) {\n Object.defineProperty(ret, key, {\n enumerable: true,\n get: () => props[key]\n });\n }\n }\n return ret;\n}", "_saveInstanceProperties(){// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\nthis.constructor._classProperties.forEach((_v,p)=>{if(this.hasOwnProperty(p)){const value=this[p];delete this[p];if(!this._instanceProperties){this._instanceProperties=new Map}this._instanceProperties.set(p,value)}})}", "skipProperties() {\n return [];\n }", "function manipulationBareObj( value ) {\n\treturn value;\n}", "function preventChanges(obj) {\n Object.freeze(obj);\n obj.noChanges = false;\n obj.signature = \"whatever\";\n return obj;\n }", "function collectNonEnumProps(obj, keys) {\n keys = emulatedSet(keys);\n var nonEnumIdx = nonEnumerableProps.length;\n var constructor = obj.constructor;\n var proto = isFunction$1(constructor) && constructor.prototype || ObjProto;\n\n // Constructor is a special case.\n var prop = 'constructor';\n if (has(obj, prop) && !keys.contains(prop)) keys.push(prop);\n\n while (nonEnumIdx--) {\n prop = nonEnumerableProps[nonEnumIdx];\n if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {\n keys.push(prop);\n }\n }\n }", "function collectNonEnumProps(obj, keys) {\n keys = emulatedSet(keys);\n var nonEnumIdx = nonEnumerableProps.length;\n var constructor = obj.constructor;\n var proto = isFunction$1(constructor) && constructor.prototype || ObjProto;\n\n // Constructor is a special case.\n var prop = 'constructor';\n if (has(obj, prop) && !keys.contains(prop)) keys.push(prop);\n\n while (nonEnumIdx--) {\n prop = nonEnumerableProps[nonEnumIdx];\n if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {\n keys.push(prop);\n }\n }\n }", "function collectNonEnumProps(obj, keys) {\n keys = emulatedSet(keys);\n var nonEnumIdx = nonEnumerableProps.length;\n var constructor = obj.constructor;\n var proto = isFunction$1(constructor) && constructor.prototype || ObjProto;\n\n // Constructor is a special case.\n var prop = 'constructor';\n if (has(obj, prop) && !keys.contains(prop)) keys.push(prop);\n\n while (nonEnumIdx--) {\n prop = nonEnumerableProps[nonEnumIdx];\n if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {\n keys.push(prop);\n }\n }\n }", "function collectNonEnumProps(obj, keys) {\n keys = emulatedSet(keys);\n var nonEnumIdx = nonEnumerableProps.length;\n var constructor = obj.constructor;\n var proto = isFunction$1(constructor) && constructor.prototype || ObjProto;\n\n // Constructor is a special case.\n var prop = 'constructor';\n if (has(obj, prop) && !keys.contains(prop)) keys.push(prop);\n\n while (nonEnumIdx--) {\n prop = nonEnumerableProps[nonEnumIdx];\n if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {\n keys.push(prop);\n }\n }\n }", "function collectNonEnumProps(obj, keys) {\n keys = emulatedSet(keys);\n var nonEnumIdx = nonEnumerableProps.length;\n var constructor = obj.constructor;\n var proto = isFunction$1(constructor) && constructor.prototype || ObjProto;\n\n // Constructor is a special case.\n var prop = 'constructor';\n if (has(obj, prop) && !keys.contains(prop)) keys.push(prop);\n\n while (nonEnumIdx--) {\n prop = nonEnumerableProps[nonEnumIdx];\n if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {\n keys.push(prop);\n }\n }\n }", "function collectNonEnumProps(obj, keys) {\n keys = emulatedSet(keys);\n var nonEnumIdx = nonEnumerableProps.length;\n var constructor = obj.constructor;\n var proto = isFunction$1(constructor) && constructor.prototype || ObjProto;\n\n // Constructor is a special case.\n var prop = 'constructor';\n if (has(obj, prop) && !keys.contains(prop)) keys.push(prop);\n\n while (nonEnumIdx--) {\n prop = nonEnumerableProps[nonEnumIdx];\n if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {\n keys.push(prop);\n }\n }\n }", "function collectNonEnumProps(obj, keys) {\n keys = emulatedSet(keys);\n var nonEnumIdx = nonEnumerableProps.length;\n var constructor = obj.constructor;\n var proto = isFunction$1(constructor) && constructor.prototype || ObjProto;\n\n // Constructor is a special case.\n var prop = 'constructor';\n if (has(obj, prop) && !keys.contains(prop)) keys.push(prop);\n\n while (nonEnumIdx--) {\n prop = nonEnumerableProps[nonEnumIdx];\n if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {\n keys.push(prop);\n }\n }\n }", "function collectNonEnumProps(obj, keys) {\n keys = emulatedSet(keys);\n var nonEnumIdx = nonEnumerableProps.length;\n var constructor = obj.constructor;\n var proto = isFunction$1(constructor) && constructor.prototype || ObjProto;\n\n // Constructor is a special case.\n var prop = 'constructor';\n if (has(obj, prop) && !keys.contains(prop)) keys.push(prop);\n\n while (nonEnumIdx--) {\n prop = nonEnumerableProps[nonEnumIdx];\n if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {\n keys.push(prop);\n }\n }\n }", "function collectNonEnumProps(obj, keys) {\n keys = emulatedSet(keys);\n var nonEnumIdx = nonEnumerableProps.length;\n var constructor = obj.constructor;\n var proto = isFunction$1(constructor) && constructor.prototype || ObjProto;\n\n // Constructor is a special case.\n var prop = 'constructor';\n if (has(obj, prop) && !keys.contains(prop)) keys.push(prop);\n\n while (nonEnumIdx--) {\n prop = nonEnumerableProps[nonEnumIdx];\n if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {\n keys.push(prop);\n }\n }\n }", "persistentProperties() {\n //console.log('persistentProperties');\n if (! this._persistentProperties) {\n var ownProperties = Object.keys(this);\n var prototypeProperties = Object.keys(this.constructor.prototype);\n var existingProperties = ownProperties.concat(prototypeProperties);\n //console.log('persistentProperties: new');\n this.constructor.persistentProperties();\n console.log(\"own\", ownProperties);\n console.log(\"prototype\", prototypeProperties);\n console.log(\"_persistent\", this._persistentProperties);\n for (const p of this._persistentProperties) {\n if (existingProperties.indexOf(p) < 0) {\n console.trace(`GraphObject.persistentProperties: property not found: '${p}'`, this);\n throw new Error(`GraphObject.persistentProperties: property not found: '${p}'`);\n }\n }\n }\n return (this._persistentProperties);\n }", "getAttrs(){\n let properties = new Set()\n let currentObj = this\n do {\n Object.getOwnPropertyNames(currentObj).map(item => properties.add(item))\n } while ((currentObj = Object.getPrototypeOf(currentObj)))\n return {attributes: [...properties.keys()].sort().filter(item => typeof this[item] !== 'function')};\n }", "clean() {\n let clone = {};\n Object.assign(clone, this);\n\n for (const i in clone) {\n if (typeof clone[i] === 'undefined') {\n delete clone[i];\n }\n }\n\n return clone;\n }", "function is_empthy_obj(obj) {\n for (var prop in obj)\n return false;\n return true;\n}", "function selectiveNotDeepExtend(propsToExclude, a, b) {\n var allowDeletion = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\n // TODO: add support for Arrays to deepExtend\n // NOTE: array properties have an else-below; apparently, there is a problem here.\n if (isArray$5(b)) {\n throw new TypeError(\"Arrays are not supported by deepExtend\");\n }\n\n for (var prop in b) {\n if (!Object.prototype.hasOwnProperty.call(b, prop)) {\n continue;\n } // Handle local properties only\n\n\n if (indexOf$3(propsToExclude).call(propsToExclude, prop) !== -1) {\n continue;\n } // In exclusion list, skip\n\n\n if (b[prop] && b[prop].constructor === Object) {\n if (a[prop] === undefined) {\n a[prop] = {};\n }\n\n if (a[prop].constructor === Object) {\n deepExtend(a[prop], b[prop]); // NOTE: allowDeletion not propagated!\n } else {\n copyOrDelete(a, b, prop, allowDeletion);\n }\n } else if (isArray$5(b[prop])) {\n a[prop] = [];\n\n for (var i = 0; i < b[prop].length; i++) {\n a[prop].push(b[prop][i]);\n }\n } else {\n copyOrDelete(a, b, prop, allowDeletion);\n }\n }\n\n return a;\n}", "static subtract(o, p) {\n for(let prop in p) { // For all props in p\n delete o[prop]; // Delete from o (deleting a\n // nonexistent prop is harmless)\n }\n return o;\n }", "function dummyObjects(name, age){\n this.name = name\n this.age = age\n}", "function selectiveNotDeepExtend(propsToExclude, a, b) {\n var allowDeletion = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\n // TODO: add support for Arrays to deepExtend\n // NOTE: array properties have an else-below; apparently, there is a problem here.\n if (isArray$3(b)) {\n throw new TypeError(\"Arrays are not supported by deepExtend\");\n }\n\n for (var prop in b) {\n if (!Object.prototype.hasOwnProperty.call(b, prop)) {\n continue;\n } // Handle local properties only\n\n\n if (indexOf$3(propsToExclude).call(propsToExclude, prop) !== -1) {\n continue;\n } // In exclusion list, skip\n\n\n if (b[prop] && b[prop].constructor === Object) {\n if (a[prop] === undefined) {\n a[prop] = {};\n }\n\n if (a[prop].constructor === Object) {\n deepExtend(a[prop], b[prop]); // NOTE: allowDeletion not propagated!\n } else {\n copyOrDelete(a, b, prop, allowDeletion);\n }\n } else if (isArray$3(b[prop])) {\n a[prop] = [];\n\n for (var i = 0; i < b[prop].length; i++) {\n a[prop].push(b[prop][i]);\n }\n } else {\n copyOrDelete(a, b, prop, allowDeletion);\n }\n }\n\n return a;\n}", "static get observedAttributes(){// note: piggy backing on this to ensure we're finalized.\nthis.finalize();const attributes=[];// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\nthis._classProperties.forEach((v,p)=>{const attr=this._attributeNameForProperty(p,v);if(attr!==undefined){this._attributeToPropertyMap.set(attr,p);attributes.push(attr);}});return attributes;}", "function makePropertyValidator(props) {\n return function (object) {\n var _hasProperty = function(o, prop, type) { return o != null && (prop in o) && typeof (o[prop]) === type; };\n return !props.some(function (prop) { return !_hasProperty(object, prop.name, prop.type); });\n };\n}", "get Ignore() {}", "static FindObjectsOfType() {}", "static FindObjectsOfType() {}", "static FindObjectsOfType() {}", "static FindObjectsOfType() {}", "static FindObjectsOfType() {}", "static FindObjectsOfType() {}", "getArrDataObjs(payload){ // payload = {storeName (req), stateName, props: {propname: val, ...}, orderBy: [], keepInactive}\n //getStoreObjs(payload){ // payload = {storeName (req), stateName, props: {propname: val, ...}, orderBy: [], keepInactive}\n var storeObjs, filteredStoreObjs = [], filterProps;\n\n if(payload.hasOwnProperty('props') && payload.props) filterProps = Object.keys(payload.props);\n if(payload.hasOwnProperty('id') && payload.id && this.warnDebug) console.warn('WARNING: getArrDataObjs:\\t\\tid sent in payload - ' + this.payloadToStr(paylod))\n\n storeObjs = this.getDataObj(payload);\n if(storeObjs && Array.isArray(storeObjs)){\n if(storeObjs.length > 0){\n // get array & filter\n filteredStoreObjs = storeObjs.filter(function(obj){\n var keepObj = true;\n\n // exclude if inctive by default, unless keepInactive is in payload\n if(!(payload.hasOwnProperty('keepInactive') && payload.keepInactive)){\n if(obj.hasOwnProperty('Active')){\n if(typeof(obj.Active) === \"object\" && !(obj.Active.val)) keepObj = false;\n else if(typeof(obj.Active) !== \"object\" && !(obj.Active)) keepObj = false;\n }\n else if(obj.hasOwnProperty('isActive')){\n if(typeof(obj.isActive) === \"object\" && !(obj.isActive.val)) keepObj = false;\n else if(typeof(obj.isActive) !== \"object\" && !(obj.isActive)) keepObj = false;\n }\n }\n if(keepObj && filterProps){\n // go through props until a property in object does not match\n var excl = filterProps.some(function(prop){\n if(obj.hasOwnProperty(prop)){\n if(typeof(obj[prop]) === \"object\" && obj[prop].val != payload.props[prop]) return true;\n else if(typeof(obj[prop]) !== \"object\" && obj[prop] != payload.props[prop]) return true;\n }\n else if (this.errDebug) console.error('ERROR: getArrDataObjs:\\t\\tarray obj missing prop - ' + prop);\n return false;\n });\n if(excl) keepObj = false;\n }\n return keepObj;\n });\n }\n else if (this.warnDebug) console.warn('WARNING: getArrDataObjs:\\t\\tobject array has no values - ' + this.payloadToStr(payload));\n }\n else if (this.errDebug) console.error('ERROR: getArrDataObjs:\\t\\tobject is not an arrary - ' + this.payloadToStr(payload));\n\n return filteredStoreObjs;\n }", "function getProperties() { return $.extend(true, {}, properties); }", "function w(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&\"function\"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}", "function accessorsarentconstructors() {\n try {\n new (Object.getOwnPropertyDescriptor({get a(){}}, 'a')).get;\n } catch(e) {\n return true;\n }\n}", "function rmprop(prop, obj) {\n delete obj[prop];\n return obj;\n}", "static get observedAttributes(){// note: piggy backing on this to ensure we're finalized.\nthis.finalize();const attributes=[];// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\nthis._classProperties.forEach((v,p)=>{const attr=this._attributeNameForProperty(p,v);if(attr!==void 0){this._attributeToPropertyMap.set(attr,p);attributes.push(attr)}});return attributes}", "flatClone(noodle, flatList = noodle.object.flatList(obj), newList = new Array(flatList.length)) { //Kinda stupid to check lists for each recursion?\n for (var i in flatList) {\n var obj = flatList[i];\n if (typeof obj == 'object') {\n //Go through obj to find its properties in flatList and clone them to newList\n for (var j in obj) {\n var ind = flatList.indexOf(obj[i]);//Find obj[i] in flatList\n if (ind != -1) {\n if (newList[i] == undefined) {//If this object hasn't been found before\n newList[i] = shallowClone(); //TODO\n }\n }\n }\n }\n return $.extend(null, obj);\n }\n }", "__saveInstanceProperties() {\n this.constructor.elementProperties.forEach((_v, p) => {\n if (this.hasOwnProperty(p)) {\n this.__instanceProperties.set(p, this[p]);\n delete this[p];\n }\n });\n }", "function filterObject(obj, filter) {\n // returns a key/value object of all of the k/v from the obj that are true for the filter\n var filtered = {};\n\n $.each(instance, function (k, v) {\n if (filter(k, v)) {\n filtered[k] = v;\n }\n });\n\n return filtered;\n }", "function ArrayUtils() {\n\n /**\n *\n * <pre>\n *\n * @unit ArrayUtils.list#1\n * -> array of objects\n * -> property containing a property\n * -> value of the property\n * <- array with the occurrences\n *\n * @unit ArrayUtils.list#2\n * -> an invalid array\n * -> property containing a property\n * -> value of the property\n * <- empty array\n *\n * @unit ArrayUtils.list#3\n * -> array of objects\n * -> property\n * -> value of the property\n * <- empty array\n *\n * @unit ArrayUtils.list#4\n * -> array of objects\n * -> property containing an invalid property\n * -> value of the property\n * <- empty array\n *\n * @unit ArrayUtils.list#5\n * -> array of objects containing numbers\n * -> valid property\n * -> value of the property\n * <- array with the occurrences\n *\n * @unit ArrayUtils.list#6\n * -> array of objects containing arrays\n * -> valid property\n * -> value of the property\n * <- array with the occurrences\n *\n * @unit ArrayUtils.list#7\n * -> array of objects containing objects\n * -> valid property\n * -> value of the property\n * <- array with the occurrences\n *\n * </pre>\n *\n * TODO - description\n *\n * @param {Array} array - the array to be searched(must be an array of objects)\n * @param {String} property - the property we are looking for\n * @param {Object} value - the value the property must have to be included in the\n * filter\n *\n * @return []\n */\n this.list = function (array, property, value) {\n\n var response = [];\n\n for (var idx in array) {\n var item = array[idx];\n\n if (!_.isObject(item)) {\n continue;\n }\n\n if (item[property] === value) {\n response.push(item);\n }\n }\n return response;\n };\n\n /**\n * <pre>\n * @unit ArrayUtils.find#1\n * -> array of objects without duplicated entries\n * -> property containing a valid property\n * -> value of the property\n * <- object ocurrence\n *\n * @unit ArrayUtils.find#2\n * -> array of objects with array\n * -> property containing a valid property\n * -> value of the property\n * <- object ocurrence\n *\n * @unit ArrayUtils.find#3\n * -> array of objects with numbers\n * -> property containing a valid property\n * -> value of the property\n * <- object ocurrence\n *\n * @unit ArrayUtils.find#4\n * -> array of objects with objects\n * -> property containing a valid property\n * -> value of the property\n * <- object ocurrence\n *\n * @unit ArrayUtils.find#5\n * -> an invalid array\n * -> property containing a valid property\n * -> value of the property\n * <- null\n *\n * @unit ArrayUtils.find#6\n * -> array of objects\n * -> property containing an invalid property\n * -> value of the property\n * <- null\n *\n * @unit ArrayUtils.find#7\n * -> array with duplicate entries\n * -> property containing a valid property\n * -> value of the property\n * <- throw error\n * </pre>\n */\n this.find = function (array, property, value) {\n\n var response = this.list(array, property, value);\n\n if (response.length === 1) {\n response = response[0];\n } else if (response.length === 0) {\n response = null;\n } else {\n throw 'find returned ' + response.length + ' results, a maximum of one expected';\n }\n\n return response;\n };\n\n /**\n * <pre>\n * @unit ArrayUtils.distinct#1\n * -> array of objects\n * -> property containing an array\n * <- array with the occurrences\n *\n * @unit ArrayUtils.distinct#2\n * -> array of objects\n * -> property containing an objects\n * <- array with the occurrences\n *\n * @unit ArrayUtils.distinct#3\n * -> array of objects\n * -> property containing a string\n * <- array with the occurrences\n *\n * @unit ArrayUtils.distinct#4\n * -> array of objects\n * -> property containing a number\n * <- array with the occurrences must be returned\n *\n * @unit ArrayUtils.distinct#5\n * -> array of objects\n * -> property which the value is an array\n * <- the array of the given property\n *\n * @unit ArrayUtils.distinct#6\n * -> array of objects\n * -> non existing property\n * <- array with a single undefined element\n *\n * TODO - not sure what it should be o.O\n * @unit ArrayUtils.distinct#7\n * -> invalid array\n * -> ?\n * <- empty array\n *\n * </pre>\n *\n * Return a deduplicated list of values for the given property\n *\n * @param array - the array to be searched\n * @param property - the property we are looking for\n *\n * @return []\n */\n this.distinct = function (array, property) {\n\n var response = [];\n\n for (var idx in array) {\n\n var item = array[idx];\n\n if (!_.isObject(item)) {\n continue;\n }\n\n if (response.indexOf(item[property]) === -1) {\n response.push(item[property]);\n }\n }\n return response;\n };\n\n /**\n * <pre>\n * @unit ArrayUtils.filter#1\n * -> array of objects\n * -> a filter with properties containing strings, numbers, arrays and objects)\n * <- an array with the matching elements\n *\n * @unit ArrayUtils.filter#2\n * -> array of objects\n * -> non matching filter\n * <- empty array\n *\n * @unit ArrayUtils.filter#4\n * -> invalid array\n * -> ?\n * <- empty array\n *\n * </pre>\n *\n * Return a list of values that match the given filter\n * TODO make it work properly on filters with properties containing arrays or objects\n *\n * @param array - the array to be searched\n * @param filter - An Object in which the keys are property names and\n * the values are the expected values\n *\n * @return []\n */\n this.filter = function (array, filter) {\n\n var response = array;\n\n for (var keyName in filter) {\n response = this.list(response, keyName, filter[keyName]);\n }\n\n return response;\n };\n\n /**\n * <pre>\n * @unit ArrayUtils.isIn#1\n * -> array of objects\n * -> existing property\n * -> list of strings\n * <- an array with the matching elements\n *\n * @unit ArrayUtils.isIn#2\n * -> array of objects\n * -> existing property\n * -> list of numbers\n * <- an array with the matching elements\n *\n * @unit ArrayUtils.isIn#3\n * -> array of objects\n * -> existing property\n * -> list of arrays\n * <- an array with the matching elements\n *\n * @unit ArrayUtils.isIn#4\n * -> array of objects\n * -> existing property\n * -> list of objects\n * <- an array with the matching elements\n *\n * @unit ArrayUtils.isIn#5\n * -> invalid array\n * -> ?\n * -> ?\n * <- empty array\n *\n * @unit ArrayUtils.isIn#6\n * -> array of objects\n * -> non existent property\n * -> ?\n * <- empty array\n *\n * @unit ArrayUtils.isIn#7\n * -> array of objects\n * -> existing property\n * -> string\n * <- empty array\n *\n * </pre>\n *\n *\n * TODO Succinctly describe this methods behavior\n *\n * @param array - the array to be searched\n * @param property - the property in which we will be searching\n * @param ids - the values we will be searching for in that property\n *\n * @return []\n */\n this.isIn = function (array, property, ids) {\n\n var response = [];\n\n for (var idx in array) {\n var item = array[idx];\n\n if (!_.isObject(item)) {\n continue;\n }\n\n if (ids.indexOf(item[property]) !== -1) {\n response.push(item);\n }\n }\n return response;\n };\n\n /**\n * <pre>\n * @unit ArrayUtils.innerJoin#1\n * -> array of objects\n * -> array of objects\n * -> property containing string\n * <- an array of joined objects\n *\n * @unit ArrayUtils.innerJoin#2\n * -> array of objects\n * -> array of objects\n * -> property containing number\n * <- an array of joined objects\n *\n * @unit ArrayUtils.innerJoin#3\n * -> array of objects\n * -> array of objects\n * -> property containing object\n * <- an array of joined objects\n *\n * @unit ArrayUtils.innerJoin#4\n * -> array of objects\n * -> array of objects\n * -> property containing array\n * <- an array of joined objects\n *\n * @unit ArrayUtils.innerJoin#5\n * -> array of objects\n * -> array of objects\n * -> property existing only in a1\n * <- an empty array\n *\n * @unit ArrayUtils.innerJoin#6\n * -> array of objects\n * -> array of objects\n * -> property existing only in a2\n * <- an empty array\n *\n * @unit ArrayUtils.innerJoin#7\n * -> array of objects\n * -> array of objects\n * -> non existent property\n * <- an empty array\n *\n * @unit ArrayUtils.innerJoin#8\n * -> invalid array\n * -> ?\n * -> ?\n * <- an empty array\n *\n * @unit ArrayUtils.innerJoin#9\n * -> array of objects\n * -> invalid array\n * -> ?\n * <- an empty array\n *\n * </pre>\n *\n *\n * TODO Joins two arrays on a matching property\n *\n * @param a1 - the first array of the join\n * @param a2 - the second array of the join\n * @param on - the property to join in\n *\n * @return []\n */\n this.innerJoin = function (a1, a2, on1, on2) {\n\n var a1f = [];\n var a2f = [];\n\n on2 = on2 ? on2 : on1;\n\n // TODO no need to initialize, but jshint keeps complaining :/\n var idx1 = 0, idx2 = 0;\n\n for (idx1 in a1) {\n if (_.isObject(a1[idx1]) && a1[idx1][on1] !== undefined) {\n a1f.push(a1[idx1]);\n }\n }\n\n for (idx2 in a2) {\n if (_.isObject(a2[idx2]) && a2[idx2][on2] !== undefined) {\n a2f.push(a2[idx2]);\n }\n }\n\n var response = [];\n\n for (idx1 in a1f) {\n var item1 = a1f[idx1];\n\n for (idx2 in a2f) {\n var item2 = a2f[idx2];\n\n if (item1[on1] === item2[on2]) {\n var obj = {};\n _.extend(obj, item1, item2);\n response.push(obj);\n }\n }\n }\n return response;\n };\n}", "function extendRemove(target, props) {\r\n\t$.extend(target, props);\r\n\tfor (var name in props)\r\n\t\tif (props[name] == null)\r\n\t\t\ttarget[name] = null;\r\n\treturn target;\r\n}", "function extendRemove(target, props) {\r\n\t$.extend(target, props);\r\n\tfor (var name in props) {\r\n\t\tif (props[name] == null) {\r\n\t\t\ttarget[name] = props[name];\r\n\t\t}\r\n\t}\r\n\treturn target;\r\n}", "getUnhoveredObjects(hovered) {\n return Array.from(this.watchedObjects).filter(watchedObject => {\n hovered.forEach(intersection => {\n if(intersection.object === watchedObject) {\n return false;\n }\n });\n return true;\n });\n }", "function stripProps(obj) {\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n if (\n // Strip leading $ marks, from angular\n prop.indexOf('$')===0 ||\n // Strip leading underscores, for convenience attributes\n prop.indexOf('_')===0 ||\n // Strip trailing underscores, for instance-prototype binding\n prop.indexOf('_')===prop.length-1) {\n delete(obj[prop]);\n }\n // Recursion: All the items in an array\n else if (Array.isArray(obj[prop])) {\n for (var i in obj[prop]) {\n stripProps(obj[prop][i]);\n }\n }\n // Recursion: All the properties of an object\n else if (typeof(obj[prop])==='object') {\n stripProps(obj[prop]);\n }\n }\n }\n }", "getNonMethodPatchers(initialDeleteStart) {\n let nonMethodPatchers = [];\n let deleteStart = initialDeleteStart;\n for (let patcher of this.body.statements) {\n if (!this.isClassMethod(patcher)) {\n nonMethodPatchers.push({\n patcher,\n deleteStart,\n });\n }\n deleteStart = patcher.outerEnd;\n }\n return nonMethodPatchers;\n }", "function obj() { return this; }", "function stripPrototypes(obj, seen = new WeakSet) {\n if (typeof obj !== 'object' || obj === null || seen.has(obj)) {\n return obj;\n }\n seen.add(obj);\n Object.setPrototypeOf(obj, null);\n for (const name of Reflect.ownKeys(obj)) {\n stripPrototypes(obj[name], seen);\n }\n return obj;\n}", "function Pagination_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Pagination_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }", "function as(){this.uuid=bt.generateUUID(),// cached objects followed by the active ones\nthis._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;// threshold\n// note: read by PropertyBinding.Composite\nvar e={};this._indicesByUUID=e;// for bookkeeping\nfor(var t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;this._paths=[],// inside: string\nthis._parsedPaths=[],// inside: { we don't care, here }\nthis._bindings=[],// inside: Array< PropertyBinding >\nthis._bindingsIndicesByPath={};// inside: indices in these arrays\nvar i=this;this.stats={objects:{get total(){return i._objects.length},get inUse(){return this.total-i.nCachedObjects_}},get bindingsPerObject(){return i._bindings.length}}}", "get named_instances() {\n return [...this._instances.values()].filter(instance => instance.name);\n }", "function t(e,t){if(!t.has(e))throw new TypeError(\"attempted to get private field on non-instance\");return t.get(e)}", "function Mv(){var t=this;ci()(this,{$source:{enumerable:!0,get:function(){return t.$olObject}},$map:{enumerable:!0,get:function(){return t.$services&&uu()(t.$services)}},$view:{enumerable:!0,get:function(){return t.$services&&t.$services.view}},$sourceContainer:{enumerable:!0,get:function(){return t.$services&&t.$services.sourceContainer}}})}", "function omit(obj) {\n\t var notInArray = function (array, item) { return !exports.inArray(array, item); };\n\t return pickOmitImpl.apply(null, [notInArray].concat(restArgs(arguments)));\n\t}", "function objectFilter(o) {\n return !isReenact || o.id < clientIDSpace;\n }", "get objects() {\n return this._objects\n }", "get instanciable()\n {\n if(this._cache_instanciable) return this._cache_instanciable;\n return this._cache_instanciable = $$(this,_instanceOf);\n }", "function canDefineNonEnumerableProperties() {\n var testObj = {};\n var testPropName = \"t\";\n\n try {\n Object.defineProperty(testObj, testPropName, {\n enumerable: false,\n value: testObj\n });\n\n for (var k in testObj) {\n if (k === testPropName) {\n return false;\n }\n }\n } catch (e) {\n return false;\n }\n\n return testObj[testPropName] === testObj;\n }", "function Object$prototype$filter(pred) {\n var result = {};\n forEachKey (this, function(k) {\n if (pred (this[k])) result[k] = this[k];\n });\n return result;\n }", "function instantize(obj, methodArray)\n{\n const undone = [];\n let f;\n for(let i = 0, len = methodArray.length; i < len; ++i) {\n const m = methodArray[i];\n f = obj[m];\n if(f) { // SIC single =\n obj[m] = f;\n }else{\n undone.push(m);\n }\n }\n return undone; // return list of unfound properties\n}", "function GetObject(values, featureLearned, valueLearned,\n featureFoil, valueFoil, avoidObjectsList) {\n let avoidObjects = new Array();\n for (let i=0; i<avoidObjectsList.length; i++) {\n avoidObjects.push.apply(avoidObjects, avoidObjectsList[i]);\n }\n\n let obj = {};\n for (let feature in values) {\n obj[feature] = values[feature][Math.floor(Math.random()*values[feature].length)];\n }\n\n obj[featureLearned] = valueLearned;\n obj[featureFoil] = valueFoil;\n\n /* Check to see if it matches anything we are supposed to avoid */\n let overlaps = false;\n for (let i=0; i<avoidObjects.length; i++) {\n if (JSON.stringify(avoidObjects[i].object)===JSON.stringify(obj)) {\n overlaps = true;\n break;\n }\n }\n\n /* If it does match an object we want to avoid, recurse to generate a new object: */\n return (overlaps)? GetObject(values, featureLearned, valueLearned,\n featureFoil, valueFoil, avoidObjectsList) : obj;\n}", "_applyInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n // tslint:disable-next-line:no-any\n this._instanceProperties.forEach((v, p) => this[p] = v);\n this._instanceProperties = undefined;\n }", "_applyInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n // tslint:disable-next-line:no-any\n this._instanceProperties.forEach((v, p) => this[p] = v);\n this._instanceProperties = undefined;\n }", "_applyInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n // tslint:disable-next-line:no-any\n this._instanceProperties.forEach((v, p) => this[p] = v);\n this._instanceProperties = undefined;\n }", "extractProps(node) {\n if (Element.isAncestor(node)) {\n var properties = _objectWithoutProperties(node, _excluded$3);\n\n return properties;\n } else {\n var properties = _objectWithoutProperties(node, _excluded2$2);\n\n return properties;\n }\n }", "function omitPrivate(doc, obj) {\n delete obj.__v;\n return obj;\n}", "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = null;\n\t\t}\n\t}\n\treturn target;\n}", "function extendRemove(target, props) {\n\t$.extend(target, props);\n\tfor (var name in props) {\n\t\tif (props[name] == null) {\n\t\t\ttarget[name] = null;\n\t\t}\n\t}\n\treturn target;\n}", "static cloneDeep(obj) {\r\n // list of fields we will skip during cloneDeep (nested objects, other internal)\r\n const skipFields = ['_isNested', 'el', 'grid', 'subGrid', 'engine'];\r\n // return JSON.parse(JSON.stringify(obj)); // doesn't work with date format ?\r\n const ret = Utils.clone(obj);\r\n for (const key in ret) {\r\n // NOTE: we don't support function/circular dependencies so skip those properties for now...\r\n if (ret.hasOwnProperty(key) && typeof (ret[key]) === 'object' && key.substring(0, 2) !== '__' && !skipFields.find(k => k === key)) {\r\n ret[key] = Utils.cloneDeep(obj[key]);\r\n }\r\n }\r\n return ret;\r\n }", "static getNewProperties() {\n return {};\n }" ]
[ "0.5747486", "0.551643", "0.5354217", "0.5278089", "0.5237096", "0.52242744", "0.52242744", "0.52242744", "0.52242744", "0.52242744", "0.52242744", "0.52241045", "0.5222678", "0.5214406", "0.5205124", "0.52047193", "0.52014977", "0.51878345", "0.51825273", "0.5167843", "0.5164321", "0.51591545", "0.5156648", "0.5149466", "0.5135734", "0.5109119", "0.5108672", "0.5108672", "0.5108672", "0.5067379", "0.506003", "0.50292444", "0.50286543", "0.50275445", "0.50275445", "0.50275445", "0.50275445", "0.50275445", "0.50275445", "0.50275445", "0.50275445", "0.50275445", "0.49963623", "0.49821976", "0.49791187", "0.49576256", "0.49545157", "0.49487177", "0.49480975", "0.49479747", "0.49349728", "0.4930518", "0.49253225", "0.49099717", "0.49099717", "0.49099717", "0.49099717", "0.49099717", "0.49099717", "0.4898757", "0.48890075", "0.48885837", "0.4881416", "0.48808703", "0.48765448", "0.48747382", "0.4852685", "0.4849458", "0.48489588", "0.48485965", "0.4848266", "0.48463994", "0.4843745", "0.48414305", "0.48379812", "0.48375857", "0.4837475", "0.48269343", "0.48243946", "0.48220176", "0.482173", "0.48206574", "0.48181084", "0.48105186", "0.4806106", "0.4799348", "0.47897914", "0.47884822", "0.47869816", "0.4786857", "0.4786857", "0.4786857", "0.47863334", "0.4781757", "0.47794837", "0.47794837", "0.4773712", "0.4770549" ]
0.5267797
6
highlevel segmentingaware tester functions
function isInteractionValid(interaction, calendar) { return isNewPropsValid({ eventDrag: interaction }, calendar); // HACK: the eventDrag props is used for ALL interactions }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inSegment(xP, yP) {\r\n }", "function SegmentBase() {\n}", "function handleSegment(segment) {\n if (segment[1].text == 'null') {\n return { intertype: 'value', ident: '0', type: 'i32' };\n } else if (segment[1].text == 'zeroinitializer') {\n Types.needAnalysis[segment[0].text] = 0;\n return { intertype: 'emptystruct', type: segment[0].text };\n } else if (segment[1].text in PARSABLE_LLVM_FUNCTIONS) {\n return parseLLVMFunctionCall(segment);\n } else if (segment[1].type && segment[1].type == '{') {\n Types.needAnalysis[segment[0].text] = 0;\n return { intertype: 'struct', type: segment[0].text, contents: handleSegments(segment[1].tokens) };\n } else if (segment[1].type && segment[1].type == '<') {\n Types.needAnalysis[segment[0].text] = 0;\n return { intertype: 'struct', type: segment[0].text, contents: handleSegments(segment[1].item.tokens[0].tokens) };\n } else if (segment[1].type && segment[1].type == '[') {\n Types.needAnalysis[segment[0].text] = 0;\n return { intertype: 'list', type: segment[0].text, contents: handleSegments(segment[1].item.tokens) };\n } else if (segment.length == 2) {\n Types.needAnalysis[segment[0].text] = 0;\n return { intertype: 'value', type: segment[0].text, ident: toNiceIdent(segment[1].text) };\n } else if (segment[1].text === 'c') {\n // string\n var text = segment[2].text;\n text = text.substr(1, text.length-2);\n return { intertype: 'string', text: text, type: 'i8*' };\n } else if (segment[1].text === 'blockaddress') {\n return parseBlockAddress(segment);\n } else {\n throw 'Invalid segment: ' + dump(segment);\n }\n }", "function subdivideSegments(eventQueue, subject, clipping, sbbox, cbbox, operation) {\n var sweepLine = new Tree(compareSegments);\n var sortedEvents = [];\n\n var rightbound = min(sbbox[2], cbbox[2]);\n\n var prev, next;\n\n while (eventQueue.length) {\n var event = eventQueue.pop();\n sortedEvents.push(event);\n\n // optimization by bboxes for intersection and difference goes here\n if ((operation === INTERSECTION && event.point[0] > rightbound) ||\n (operation === DIFFERENCE && event.point[0] > sbbox[2])) {\n break;\n }\n\n if (event.left) {\n sweepLine = sweepLine.insert(event);\n //_renderSweepLine(sweepLine, event.point, event);\n\n next = sweepLine.find(event);\n prev = sweepLine.find(event);\n event.iterator = sweepLine.find(event);\n\n if (prev.node !== sweepLine.begin) {\n prev.prev();\n } else {\n prev = sweepLine.begin;\n prev.prev();\n prev.next();\n }\n next.next();\n\n var prevEvent = (prev.key || null), prevprevEvent;\n computeFields(event, prevEvent, operation);\n if (next.node) {\n if (possibleIntersection(event, next.key, eventQueue) === 2) {\n computeFields(event, prevEvent, operation);\n computeFields(event, next.key, operation);\n }\n }\n\n if (prev.node) {\n if (possibleIntersection(prev.key, event, eventQueue) === 2) {\n var prevprev = sweepLine.find(prev.key);\n if (prevprev.node !== sweepLine.begin) {\n prevprev.prev();\n } else {\n prevprev = sweepLine.find(sweepLine.end);\n prevprev.next();\n }\n prevprevEvent = prevprev.key || null;\n computeFields(prevEvent, prevprevEvent, operation);\n computeFields(event, prevEvent, operation);\n }\n }\n } else {\n event = event.otherEvent;\n next = sweepLine.find(event);\n prev = sweepLine.find(event);\n\n // _renderSweepLine(sweepLine, event.otherEvent.point, event);\n\n if (!(prev && next)) continue;\n\n if (prev.node !== sweepLine.begin) {\n prev.prev();\n } else {\n prev = sweepLine.begin;\n prev.prev();\n prev.next();\n }\n next.next();\n sweepLine = sweepLine.remove(event);\n\n // _renderSweepLine(sweepLine, event.otherEvent.point, event);\n\n if (next.node && prev.node) {\n if (typeof prev.node.value !== 'undefined' && typeof next.node.value !== 'undefined') {\n possibleIntersection(prev.key, next.key, eventQueue);\n }\n }\n }\n }\n return sortedEvents;\n}", "function testIntersections(arcs) {\n var pointCount = arcs.getFilteredPointCount(),\n arcCount = arcs.size(),\n segCount = pointCount - arcCount,\n stripes = calcSegmentIntersectionStripeCount2(arcs),\n stripes2 = Math.ceil(stripes / 10),\n stripes3 = stripes * 10,\n stripes4 = calcSegmentIntersectionStripeCount(arcs);\n\n console.log(\"points:\", pointCount, \"arcs:\", arcCount, \"segs:\", segCount);\n [stripes2, stripes, stripes3, stripes4].forEach(function(n) {\n console.time(n + ' stripes');\n findSegmentIntersections(arcs, {stripes: n});\n console.timeEnd(n + ' stripes');\n });\n }", "function onSegment(point, a, b, epsilon) {\n if (epsilon === undefined) {\n epsilon = EPSILON;\n }\n var a_b = Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2));\n var p_a = Math.sqrt(Math.pow(point.x - a.x, 2) + Math.pow(point.y - a.y, 2));\n var p_b = Math.sqrt(Math.pow(point.x - b.x, 2) + Math.pow(point.y - b.y, 2));\n return (Math.abs(a_b - (p_a + p_b)) < epsilon);\n}", "function CheckIntSegSeg(a0, a1, b0, b1, p)\n{\n var a; // Line a\n var b; // Line b\n var A; // Cramer's Rule A\n var B; // Cramer's Rule B\n var X; // Cramer's Rule X\n var a_dot_b;\n var temp;\n\n vec2.subtract(a, a1, a0);\n vec2.subtract(b, b1, b0);\n\n a_dot_b = vec2.dot(a, b);\n\n A = mat2.fromValues(vec2.sqrLen(a), a_dot_b,\n -a_dot_b, vec2.sqrlen(b));\n B = vec2.fromValues(vec2.dot(b0 - a0, a),\n vec2.dot(b0 - a0, b));\n\n if (SolveCramer2(A, B, X))\n {\n if (X[0] >= 0 && X[0] <= 1 &&\n X[1] >= 0 && X[1] <= 1)\n {\n vec2.scale(temp, a, X[0]);\n p = vec2.add(a0, temp);\n return true;\n }\n else\n {\n p = undefined;\n return false\n }\n\n }\n else\n {\n throw(\"Division by zero in Cramer's Rule\");\n p = undefined;\n return false;\n }\n}", "computeControlSegments() {\n if (this.controlSteps.length) {\n this.controlSegments = [];\n let segment = { start : 0, end : 0, human : this.controlSteps[0] }\n for (let i = 0; i < this.controlSteps.length; ++i) {\n const humanStep = this.controlSteps[i];\n if (humanStep != segment.human) {\n this.controlSegments.push(segment);\n segment = { start : i, end : i, human : humanStep };\n } else {\n segment.end = i;\n }\n }\n this.controlSegments.push(segment);\n }\n }", "function onSegment( p, q, r ) {\n\n\treturn q.x <= Math.max( p.x, r.x ) && q.x >= Math.min( p.x, r.x ) && q.y <= Math.max( p.y, r.y ) && q.y >= Math.min( p.y, r.y );\n\n}", "function onSegment(p, q, r)\n{\n if (q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) &&\n q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y))\n return true;\n\n return false;\n}", "function matchSegment(seg1, seg2, r, result) {\n var a = seg1[0],\n b = seg1[1],\n c = seg2[0],\n d = seg2[1],\n len = result.length;\n\n var ap = closePoint(a, c, d, r),\n bp = closePoint(b, c, d, r);\n\n // a----b\n // c---ap---bp---d\n if (ap !== null && bp !== null) return true; // fully covered\n\n var cp = closePoint(c, a, b, r),\n dp = closePoint(d, a, b, r);\n\n if (cp !== null && cp === dp) return false; // degenerate case, no overlap\n\n if (cp !== null && dp !== null) {\n var cpp = segPoint(a, b, cp);\n var dpp = segPoint(a, b, dp);\n\n if (equals(cpp, dpp)) return false; // degenerate case\n\n // a---cp---dp---b\n // c----d\n if (cp < dp) {\n if (!equals(a, cpp)) result.push([a, cpp]);\n if (!equals(dpp, b)) result.push([dpp, b]);\n\n // a---dp---cp---b\n // d----c\n } else {\n if (!equals(a, dpp)) result.push([a, dpp]);\n if (!equals(cpp, b)) result.push([cpp, b]);\n }\n\n } else if (cp !== null) {\n var cpp = segPoint(a, b, cp);\n\n // a----cp---b\n // d---ap---c\n if (ap !== null && !equals(a, cpp)) result.push([cpp, b]);\n\n // a---cp---b\n // c----bp---d\n else if (bp !== null && !equals(cpp, b)) result.push([a, cpp]);\n\n } else if (dp !== null) {\n var dpp = segPoint(a, b, dp);\n\n // a---dp---b\n // d----bp---c\n if (bp !== null && !equals(dpp, b)) result.push([a, dpp]);\n\n // a----dp---b\n // c---ap---d\n else if (ap !== null && !equals(a, dpp)) result.push([dpp, b]);\n }\n\n return result.length !== len; // segment processed\n}", "function test_cluster_tagged_crosshair_op_vsphere65() {}", "resolveSegmentSegment(ax1, ay1, ax2, ay2, bx1, by1, bx2, by2) {\n const result = [];\n const isHorizontal1 = ax2 - ax1 > ay2 - ay1;\n const isHorizontal2 = bx2 - bx1 > by2 - by1;\n\n if (isHorizontal1 && isHorizontal2 &&\n by1 === ay1 &&\n ((ax1 <= bx2 && ax1 >= bx1) || (ax2 <= bx2 && ax2 >= bx1) || (bx1 <= ax2 && bx1 >= ax1) || (bx2 <= ax2 && bx2 >= ax1))) {\n\n if (bx1 < ax1) result.push(bx1, by1, ax1, by1);\n if (bx2 > ax2) result.push(ax2, by2, bx2, by2);\n\n } else if (!isHorizontal1 && isHorizontal2 &&\n by1 >= ay1 && by1 < ay2 &&\n ((ax1 <= bx2 && ax1 >= bx1) || (ax2 <= bx2 && ax2 >= bx1) || (bx1 <= ax2 && bx1 >= ax1) || (bx2 <= ax2 && bx2 >= ax1))) {\n\n if (bx1 < ax1) result.push(bx1, by1, ax1, by1);\n if (bx2 > ax2) result.push(ax2 + 1, by2, bx2, by2);\n\n } else if (!isHorizontal1 && !isHorizontal2 &&\n ax1 === bx2 &&\n ((by1 <= ay2 && by1 >= ay1) || (by2 <= ay2 && by2 >= ay1) || (ay1 <= by2 && ay1 >= by1) || (ay2 <= by2 && ay2 >= by1))) {\n\n if (by1 < ay1) result.push(bx1, by1, bx1, ay1);\n if (by2 > ay2) result.push(bx2, ay2, bx2, by2);\n\n } else if (isHorizontal1 && !isHorizontal2 &&\n bx1 >= ax1 && bx1 < ax2 &&\n ((ay2 <= by2 && ay2 >= by1) || (ay1 <= by2 && ay1 >= by1) || (by2 <= ay2 && by2 >= ay1) || (by1 <= ay2 && by1 >= ay1))) {\n\n if (by1 < ay1) result.push(bx1, by1, bx1, ay1);\n if (by2 > ay2) result.push(bx2, ay2 + 1, bx2, by2);\n\n } else { // segments do not intersect\n result.push(bx1, by1, bx2, by2);\n }\n\n return result;\n }", "function onSegment( p, q, r ) {\n\n\t\treturn q.x <= Math.max( p.x, r.x ) && q.x >= Math.min( p.x, r.x ) && q.y <= Math.max( p.y, r.y ) && q.y >= Math.min( p.y, r.y );\n\n\t}", "function testSegmentCollision(segment) {\n var i;\n var numcollisions = 0;\n for (i = 0; i < alledges.length; i += 1) { //Iterate through all edges and make sure it's not overlapping any of them.\n if (alledges[i].points !== undefined && alledges[i].points !== null) {\n if (isOverlappingEE(segment, alledges[i])) { //overlaps are automatically rejected\n if (segment.sourceObject !== alledges[i].sourceObject || segment.color !== alledges[i].color) { //if they share the same source, it's OK, but if their colors are different, it's not. NOTE: CANNOT BE SOURCE OR TARGET SHARED OR WEIRD STUFF HAPPENS\n numcollisions = Number.MAX_VALUE;\n break; //stop bothering with this multiple\n }\n } else if (isCollidingEE(segment, alledges[i], false, false)) {\n numcollisions += 1;\n }\n }\n }\n for (i = 0; i < allquestions.length; i += 1) { //Iterate through all nodes\n if (isCollidingNE(allquestions[i], segment)) {\n numcollisions = Number.MAX_VALUE;\n break; //stop bothering with this multiple\n }\n }\n return numcollisions;\n}", "function onSegment(p, q, r) {\n if (\n q[0] <= Math.max(p[0], r[0]) &&\n q[0] >= Math.min(p[0], r[0]) &&\n q[1] <= Math.max(p[1], r[1]) &&\n q[1] >= Math.min(p[1], r[1])\n ) {\n return true;\n }\n\n return false;\n}", "didSwitchToSegmentsLayout() {\n this.controllerState.viewMode = ViewMode.segments;\n this.didSwitchLayout();\n }", "function __WEBPACK_DEFAULT_EXPORT__(segments, compareIntersection, startInside, interpolate, stream) {\n var subject = [],\n clip = [],\n i,\n n;\n\n segments.forEach(function(segment) {\n if ((n = segment.length - 1) <= 0) return;\n var n, p0 = segment[0], p1 = segment[n], x;\n\n if ((0,_pointEqual_js__WEBPACK_IMPORTED_MODULE_0__.default)(p0, p1)) {\n if (!p0[2] && !p1[2]) {\n stream.lineStart();\n for (i = 0; i < n; ++i) stream.point((p0 = segment[i])[0], p0[1]);\n stream.lineEnd();\n return;\n }\n // handle degenerate cases by moving the point\n p1[0] += 2 * _math_js__WEBPACK_IMPORTED_MODULE_1__.epsilon;\n }\n\n subject.push(x = new Intersection(p0, segment, null, true));\n clip.push(x.o = new Intersection(p0, null, x, false));\n subject.push(x = new Intersection(p1, segment, null, false));\n clip.push(x.o = new Intersection(p1, null, x, true));\n });\n\n if (!subject.length) return;\n\n clip.sort(compareIntersection);\n link(subject);\n link(clip);\n\n for (i = 0, n = clip.length; i < n; ++i) {\n clip[i].e = startInside = !startInside;\n }\n\n var start = subject[0],\n points,\n point;\n\n while (1) {\n // Find first unvisited intersection.\n var current = start,\n isSubject = true;\n while (current.v) if ((current = current.n) === start) return;\n points = current.z;\n stream.lineStart();\n do {\n current.v = current.o.v = true;\n if (current.e) {\n if (isSubject) {\n for (i = 0, n = points.length; i < n; ++i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.n.x, 1, stream);\n }\n current = current.n;\n } else {\n if (isSubject) {\n points = current.p.z;\n for (i = points.length - 1; i >= 0; --i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.p.x, -1, stream);\n }\n current = current.p;\n }\n current = current.o;\n points = current.z;\n isSubject = !isSubject;\n } while (!current.v);\n stream.lineEnd();\n }\n}", "function __WEBPACK_DEFAULT_EXPORT__(segments, compareIntersection, startInside, interpolate, stream) {\n var subject = [],\n clip = [],\n i,\n n;\n\n segments.forEach(function(segment) {\n if ((n = segment.length - 1) <= 0) return;\n var n, p0 = segment[0], p1 = segment[n], x;\n\n if ((0,_pointEqual_js__WEBPACK_IMPORTED_MODULE_0__.default)(p0, p1)) {\n if (!p0[2] && !p1[2]) {\n stream.lineStart();\n for (i = 0; i < n; ++i) stream.point((p0 = segment[i])[0], p0[1]);\n stream.lineEnd();\n return;\n }\n // handle degenerate cases by moving the point\n p1[0] += 2 * _math_js__WEBPACK_IMPORTED_MODULE_1__.epsilon;\n }\n\n subject.push(x = new Intersection(p0, segment, null, true));\n clip.push(x.o = new Intersection(p0, null, x, false));\n subject.push(x = new Intersection(p1, segment, null, false));\n clip.push(x.o = new Intersection(p1, null, x, true));\n });\n\n if (!subject.length) return;\n\n clip.sort(compareIntersection);\n link(subject);\n link(clip);\n\n for (i = 0, n = clip.length; i < n; ++i) {\n clip[i].e = startInside = !startInside;\n }\n\n var start = subject[0],\n points,\n point;\n\n while (1) {\n // Find first unvisited intersection.\n var current = start,\n isSubject = true;\n while (current.v) if ((current = current.n) === start) return;\n points = current.z;\n stream.lineStart();\n do {\n current.v = current.o.v = true;\n if (current.e) {\n if (isSubject) {\n for (i = 0, n = points.length; i < n; ++i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.n.x, 1, stream);\n }\n current = current.n;\n } else {\n if (isSubject) {\n points = current.p.z;\n for (i = points.length - 1; i >= 0; --i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.p.x, -1, stream);\n }\n current = current.p;\n }\n current = current.o;\n points = current.z;\n isSubject = !isSubject;\n } while (!current.v);\n stream.lineEnd();\n }\n}", "function intersectSegmentToHalfPlane(seg, hp) {\n // Unpack arguments.\n var a = hp.a, b = hp.b, c = hp.c;\n var s0 = seg[0], x0 = s0.x, y0 = s0.y,\n s1 = seg[1], x1 = s1.x, y1 = s1.y;\n\n // Now the goal is to find the segment ((x0', y0'), (x1', y1'))\n // that is the intersection of\n // the segment seg = ((x0, y0), (x1, y1))\n // and the half-plane hp = {(x, y) | Ax + By + C >= 0}\n var c0 = a * x0 + b * y0 + c;\n var c1 = a * x1 + b * y1 + c;\n if (c0 < 0) {\n if (c1 < 0)\n return null; // Neither endpoint is in hp.\n // s1 is in hp but s1 isn't.\n return [proportion_point(x0, y0, c0, x1, y1, c1), s1];\n } else if (c1 < 0) {\n // s0 is in hp but s1 isn't.\n return [s0, proportion_point(x0, y0, c0, x1, y1, c1)];\n } else {\n // Both endpoints (and thus all points in the segment) lie in hp.\n return seg;\n }\n\n function proportion_point(x0, y0, c0, x1, y1, c1) {\n var d = c0 / (c0 - c1);\n return {\n x: x0 + d * (x1 - x0),\n y: y0 + d * (y1 - y0)\n };\n }\n }", "function segmentSizesValid(segments){\r\n var totsize=0;\r\n for(var j=0; j<segments.length; j++){\r\n totsize+=segments[j];\r\n }\r\n if(totsize>mainMemorySize){\r\n return false;\r\n }else{\r\n return true;\r\n }\r\n}", "function test_host_tagged_crosshair_op_vsphere65() {}", "function onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}", "function onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}", "function onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}", "function onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}", "function drawSegment(ctx, points, start, segLen, allLen, dir, smooth, smoothMonotone, connectNulls) {\n\t var prevX;\n\t var prevY;\n\t var cpx0;\n\t var cpy0;\n\t var cpx1;\n\t var cpy1;\n\t var idx = start;\n\t var k = 0;\n\t\n\t for (; k < segLen; k++) {\n\t var x = points[idx * 2];\n\t var y = points[idx * 2 + 1];\n\t\n\t if (idx >= allLen || idx < 0) {\n\t break;\n\t }\n\t\n\t if (isPointNull(x, y)) {\n\t if (connectNulls) {\n\t idx += dir;\n\t continue;\n\t }\n\t\n\t break;\n\t }\n\t\n\t if (idx === start) {\n\t ctx[dir > 0 ? 'moveTo' : 'lineTo'](x, y);\n\t cpx0 = x;\n\t cpy0 = y;\n\t } else {\n\t var dx = x - prevX;\n\t var dy = y - prevY; // Ignore tiny segment.\n\t\n\t if (dx * dx + dy * dy < 0.5) {\n\t idx += dir;\n\t continue;\n\t }\n\t\n\t if (smooth > 0) {\n\t var nextIdx = idx + dir;\n\t var nextX = points[nextIdx * 2];\n\t var nextY = points[nextIdx * 2 + 1];\n\t var tmpK = k + 1;\n\t\n\t if (connectNulls) {\n\t // Find next point not null\n\t while (isPointNull(nextX, nextY) && tmpK < segLen) {\n\t tmpK++;\n\t nextIdx += dir;\n\t nextX = points[nextIdx * 2];\n\t nextY = points[nextIdx * 2 + 1];\n\t }\n\t }\n\t\n\t var ratioNextSeg = 0.5;\n\t var vx = 0;\n\t var vy = 0;\n\t var nextCpx0 = void 0;\n\t var nextCpy0 = void 0; // Is last point\n\t\n\t if (tmpK >= segLen || isPointNull(nextX, nextY)) {\n\t cpx1 = x;\n\t cpy1 = y;\n\t } else {\n\t vx = nextX - prevX;\n\t vy = nextY - prevY;\n\t var dx0 = x - prevX;\n\t var dx1 = nextX - x;\n\t var dy0 = y - prevY;\n\t var dy1 = nextY - y;\n\t var lenPrevSeg = void 0;\n\t var lenNextSeg = void 0;\n\t\n\t if (smoothMonotone === 'x') {\n\t lenPrevSeg = Math.abs(dx0);\n\t lenNextSeg = Math.abs(dx1);\n\t cpx1 = x - lenPrevSeg * smooth;\n\t cpy1 = y;\n\t nextCpx0 = x + lenPrevSeg * smooth;\n\t nextCpy0 = y;\n\t } else if (smoothMonotone === 'y') {\n\t lenPrevSeg = Math.abs(dy0);\n\t lenNextSeg = Math.abs(dy1);\n\t cpx1 = x;\n\t cpy1 = y - lenPrevSeg * smooth;\n\t nextCpx0 = x;\n\t nextCpy0 = y + lenPrevSeg * smooth;\n\t } else {\n\t lenPrevSeg = Math.sqrt(dx0 * dx0 + dy0 * dy0);\n\t lenNextSeg = Math.sqrt(dx1 * dx1 + dy1 * dy1); // Use ratio of seg length\n\t\n\t ratioNextSeg = lenNextSeg / (lenNextSeg + lenPrevSeg);\n\t cpx1 = x - vx * smooth * (1 - ratioNextSeg);\n\t cpy1 = y - vy * smooth * (1 - ratioNextSeg); // cp0 of next segment\n\t\n\t nextCpx0 = x + vx * smooth * ratioNextSeg;\n\t nextCpy0 = y + vy * smooth * ratioNextSeg; // Smooth constraint between point and next point.\n\t // Avoid exceeding extreme after smoothing.\n\t\n\t nextCpx0 = mathMin$5(nextCpx0, mathMax$5(nextX, x));\n\t nextCpy0 = mathMin$5(nextCpy0, mathMax$5(nextY, y));\n\t nextCpx0 = mathMax$5(nextCpx0, mathMin$5(nextX, x));\n\t nextCpy0 = mathMax$5(nextCpy0, mathMin$5(nextY, y)); // Reclaculate cp1 based on the adjusted cp0 of next seg.\n\t\n\t vx = nextCpx0 - x;\n\t vy = nextCpy0 - y;\n\t cpx1 = x - vx * lenPrevSeg / lenNextSeg;\n\t cpy1 = y - vy * lenPrevSeg / lenNextSeg; // Smooth constraint between point and prev point.\n\t // Avoid exceeding extreme after smoothing.\n\t\n\t cpx1 = mathMin$5(cpx1, mathMax$5(prevX, x));\n\t cpy1 = mathMin$5(cpy1, mathMax$5(prevY, y));\n\t cpx1 = mathMax$5(cpx1, mathMin$5(prevX, x));\n\t cpy1 = mathMax$5(cpy1, mathMin$5(prevY, y)); // Adjust next cp0 again.\n\t\n\t vx = x - cpx1;\n\t vy = y - cpy1;\n\t nextCpx0 = x + vx * lenNextSeg / lenPrevSeg;\n\t nextCpy0 = y + vy * lenNextSeg / lenPrevSeg;\n\t }\n\t }\n\t\n\t ctx.bezierCurveTo(cpx0, cpy0, cpx1, cpy1, x, y);\n\t cpx0 = nextCpx0;\n\t cpy0 = nextCpy0;\n\t } else {\n\t ctx.lineTo(x, y);\n\t }\n\t }\n\t\n\t prevX = x;\n\t prevY = y;\n\t idx += dir;\n\t }\n\t\n\t return k;\n\t }", "clipSegment(start, end) {\n const quadrantStart = this.pointLocation(start)\n const quadrantEnd = this.pointLocation(end)\n\n if (quadrantStart === 0b0000 && quadrantEnd === 0b0000) {\n // The line is inside the boundaries\n return [start, end]\n }\n\n if (quadrantStart === quadrantEnd) {\n // We are in the same box, and we are out of bounds.\n return [this.nearestVertex(start), this.nearestVertex(end)]\n }\n\n if (quadrantStart & quadrantEnd) {\n // These points are all on one side of the box.\n return [this.nearestVertex(start), this.nearestVertex(end)]\n }\n\n if (quadrantStart === 0b000) {\n // We are exiting the box. Return the start, the intersection with the boundary, and the closest\n // boundary point to the exited point.\n let line = [start]\n line.push(this.boundPoint(start, end))\n line.push(this.nearestVertex(end))\n return line\n }\n\n if (quadrantEnd === 0b000) {\n // We are re-entering the box.\n return [this.boundPoint(end, start), end]\n }\n\n // We have reached a terrible place, where both points are oob, but it might intersect with the\n // work area. First, define the boundaries as lines.\n const sides = [\n // left\n [Victor(-this.sizeX, -this.sizeY), new Victor(-this.sizeX, this.sizeY)],\n // right\n [new Victor(this.sizeX, -this.sizeY), new Victor(this.sizeX, this.sizeY)],\n // bottom\n [new Victor(-this.sizeX, -this.sizeY), new Victor(this.sizeX, -this.sizeY)],\n // top\n [new Victor(-this.sizeX, this.sizeY), new Victor(this.sizeX, this.sizeY)],\n ]\n\n // Count up the number of boundary lines intersect with our line segment.\n let intersections = []\n for (let s=0; s<sides.length; s++) {\n const intPoint = this.intersection(start,\n end,\n sides[s][0],\n sides[s][1])\n if (intPoint) {\n intersections.push(new Victor(intPoint.x, intPoint.y))\n }\n }\n\n if (intersections.length !== 0) {\n if (intersections.length !== 2) {\n // We should never get here. How would we have something other than 2 or 0 intersections with\n // a box?\n console.log(intersections)\n throw Error(\"Software Geometry Error\")\n }\n\n // The intersections are tested in some normal order, but the line could be going through them\n // in any direction. This check will flip the intersections if they are reversed somehow.\n if (Victor.fromObject(intersections[0]).subtract(start).lengthSq() >\n Victor.fromObject(intersections[1]).subtract(start).lengthSq()) {\n let temp = intersections[0]\n intersections[0] = intersections[1]\n intersections[1] = temp\n }\n\n return [...intersections, this.nearestVertex(end)]\n }\n\n // Damn. We got here because we have a start and end that are failing different boundary checks,\n // and the line segment doesn't intersect the box. We have to crawl around the outside of the\n // box until we reach the other point.\n // Here, I'm going to split this line into two parts, and send each half line segment back\n // through the clipSegment algorithm. Eventually, that should result in only one of the other cases.\n const midpoint = Victor.fromObject(start).add(end).multiply(new Victor(0.5, 0.5))\n\n // recurse, and find smaller segments until we don't end up in this place again.\n return [...this.clipSegment(start, midpoint),\n ...this.clipSegment(midpoint, end)]\n }", "function _onSegment(A,B,p, tolerance){\n\t\tif(!tolerance){\n\t\t\ttolerance = TOL;\n\t\t}\n\t\t\t\t\n\t\t// vertical line\n\t\tif(_almostEqual(A.x, B.x, tolerance) && _almostEqual(p.x, A.x, tolerance)){\n\t\t\tif(!_almostEqual(p.y, B.y, tolerance) && !_almostEqual(p.y, A.y, tolerance) && p.y < Math.max(B.y, A.y, tolerance) && p.y > Math.min(B.y, A.y, tolerance)){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// horizontal line\n\t\tif(_almostEqual(A.y, B.y, tolerance) && _almostEqual(p.y, A.y, tolerance)){\n\t\t\tif(!_almostEqual(p.x, B.x, tolerance) && !_almostEqual(p.x, A.x, tolerance) && p.x < Math.max(B.x, A.x) && p.x > Math.min(B.x, A.x)){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\t//range check\n\t\tif((p.x < A.x && p.x < B.x) || (p.x > A.x && p.x > B.x) || (p.y < A.y && p.y < B.y) || (p.y > A.y && p.y > B.y)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t\n\t\t// exclude end points\n\t\tif((_almostEqual(p.x, A.x, tolerance) && _almostEqual(p.y, A.y, tolerance)) || (_almostEqual(p.x, B.x, tolerance) && _almostEqual(p.y, B.y, tolerance))){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tvar cross = (p.y - A.y) * (B.x - A.x) - (p.x - A.x) * (B.y - A.y);\n\t\t\n\t\tif(Math.abs(cross) > tolerance){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tvar dot = (p.x - A.x) * (B.x - A.x) + (p.y - A.y)*(B.y - A.y);\n\t\t\n\t\t\n\t\t\n\t\tif(dot < 0 || _almostEqual(dot, 0, tolerance)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tvar len2 = (B.x - A.x)*(B.x - A.x) + (B.y - A.y)*(B.y - A.y);\n\t\t\n\t\t\n\t\t\n\t\tif(dot > len2 || _almostEqual(dot, len2, tolerance)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "edgeCheck() {\n\n // check if the selected segment has hit a vertical wall (left or right walls)\n if (this.segments[this.select].x + (this.segments[this.select].width /2) >= width || this.segments[this.select].x - (this.segments[this.select].width /2) <= 0) {\n this.segments[this.select].deltaX *= -1;\n }\n // check if the selected segment has hit a horizontal wall (top or bottom walls)\n if (this.segments[this.select].y + (this.segments[this.select].width /2) >= height || this.segments[this.select].y - (this.segments[this.select].width /2) <= 0) {\n this.segments[this.select].deltaY *= -1;\n }\n }", "function onSegment(p, q, r) {\n if (\n q.x <= Math.max(p.x, r.x) &&\n q.x >= Math.min(p.x, r.x) &&\n q.y <= Math.max(p.y, r.y) &&\n q.y >= Math.min(p.y, r.y)\n )\n return true\n\n return false\n}", "function test_crosshair_op_vm_vsphere65() {}", "function test_crosshair_op_cluster_vsphere65() {}", "function __WEBPACK_DEFAULT_EXPORT__(segments, compareIntersection, startInside, interpolate, stream) {\n var subject = [],\n clip = [],\n i,\n n;\n\n segments.forEach(function(segment) {\n if ((n = segment.length - 1) <= 0) return;\n var n, p0 = segment[0], p1 = segment[n], x;\n\n // If the first and last points of a segment are coincident, then treat as a\n // closed ring. TODO if all rings are closed, then the winding order of the\n // exterior ring should be checked.\n if ((0,_pointEqual_js__WEBPACK_IMPORTED_MODULE_0__.default)(p0, p1)) {\n stream.lineStart();\n for (i = 0; i < n; ++i) stream.point((p0 = segment[i])[0], p0[1]);\n stream.lineEnd();\n return;\n }\n\n subject.push(x = new Intersection(p0, segment, null, true));\n clip.push(x.o = new Intersection(p0, null, x, false));\n subject.push(x = new Intersection(p1, segment, null, false));\n clip.push(x.o = new Intersection(p1, null, x, true));\n });\n\n if (!subject.length) return;\n\n clip.sort(compareIntersection);\n link(subject);\n link(clip);\n\n for (i = 0, n = clip.length; i < n; ++i) {\n clip[i].e = startInside = !startInside;\n }\n\n var start = subject[0],\n points,\n point;\n\n while (1) {\n // Find first unvisited intersection.\n var current = start,\n isSubject = true;\n while (current.v) if ((current = current.n) === start) return;\n points = current.z;\n stream.lineStart();\n do {\n current.v = current.o.v = true;\n if (current.e) {\n if (isSubject) {\n for (i = 0, n = points.length; i < n; ++i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.n.x, 1, stream);\n }\n current = current.n;\n } else {\n if (isSubject) {\n points = current.p.z;\n for (i = points.length - 1; i >= 0; --i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.p.x, -1, stream);\n }\n current = current.p;\n }\n current = current.o;\n points = current.z;\n isSubject = !isSubject;\n } while (!current.v);\n stream.lineEnd();\n }\n}", "function validateSegment(segment) {\n\n if (utilities.isNullOrEmpty(segment.label)) {\n console.error('segment label must not be null or empty');\n return false;\n }\n\n if (utilities.isNullOrEmpty(segment.net)) {\n console.error('segment \\\"' + segment.label + '\\\": net must not be null or empty');\n return false;\n }\n\n try {\n var block = new nmask(segment.net);\n } catch (ex) {\n console.error('segment \\\"' + segment.label + '\\\": net is not a CIDR:' + segment.net);\n return false;\n }\n\n if (utilities.isNullOrEmpty(segment.ovswitch)) {\n console.error('segment \\\"' + segment.label + '\\\": ovswitch must not be null or empty');\n return false;\n }\n\n if (segment.ovswitch.length > 16) {\n console.error('segment \\\"' + segment.label + '\\\": ovswitch (\\'' + segment.ovswitch + '\\' must not be longer than 16 characters');\n return false;\n }\n\n if (segment.hasOwnProperty('host')) {\n var status = true;\n segment.host.every(function (host) {\n if (!validateHost(segment, host)) {\n status = false;\n }\n return status;\n });\n\n if (!status) {\n return false;\n }\n }\n\n if (segment.hasOwnProperty('gateway')) {\n\n var status = true;\n segment.gateway.every(function (gateway) {\n if (!validateGateway(segment, gateway)) {\n status = false;\n }\n return status;\n });\n if (!status) {\n return false;\n }\n }\n\n return true;\n}", "function computeSegHorizontals(segs, eventOrderSpecs) {\n // IMPORTANT TO CLEAR OLD RESULTS :(\n for (var _i = 0, segs_2 = segs; _i < segs_2.length; _i++) {\n var seg = segs_2[_i];\n seg.level = null;\n seg.forwardCoord = null;\n seg.backwardCoord = null;\n seg.forwardPressure = null;\n }\n\n segs = Object(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__[\"sortEventSegs\"])(segs, eventOrderSpecs);\n var level0;\n var levels = buildSlotSegLevels(segs);\n computeForwardSlotSegs(levels);\n\n if (level0 = levels[0]) {\n for (var _a = 0, level0_1 = level0; _a < level0_1.length; _a++) {\n var seg = level0_1[_a];\n computeSlotSegPressures(seg);\n }\n\n for (var _b = 0, level0_2 = level0; _b < level0_2.length; _b++) {\n var seg = level0_2[_b];\n computeSegForwardBack(seg, 0, 0, eventOrderSpecs);\n }\n }\n\n return segs;\n } // Builds an array of segments \"levels\". The first level will be the leftmost tier of segments if the calendar is", "if(snakes[1].loc.dist(food.loc) === 0){\n food.pickLoc();\n snakes[1].addSegment();\n\n}", "function test_candu_graphs_vm_compare_cluster_vsphere65() {}", "function sectionFinder()\n{\n currentSection=allSections[0];\n minDist=90000000;\n for(pointer of allSections)\n {\n var sizeChecker=pointer.getBoundingClientRect();\n if( sizeChecker.top>-320 & sizeChecker.top<minDist)\n {\n currentSection=pointer;\n minDist=sizeChecker.top;\n }\n }\n return currentSection;\n \n}", "function test_cluster_graph_by_vm_tag_vsphere65() {}", "function segmentHit(ax, ay, bx, by, cx, cy, dx, dy) {\n return orient2D(ax, ay, bx, by, cx, cy) *\n orient2D(ax, ay, bx, by, dx, dy) <= 0 &&\n orient2D(cx, cy, dx, dy, ax, ay) *\n orient2D(cx, cy, dx, dy, bx, by) <= 0;\n }", "subdivide(){\n\tthis.divided = true;\n\tlet x = this.boundary.x;\n\tlet y = this.boundary.y;\n\tlet w = this.boundary.w;\n\tlet h = this.boundary.h;\n\n\tlet ne = new Rectangle(x+0.5*w, y-0.5*h, 0.5*w, 0.5*h);\n\tlet se = new Rectangle(x+0.5*w, y+0.5*h, 0.5*w, 0.5*h);\n\tlet sw = new Rectangle(x-0.5*w, y+0.5*h, 0.5*w, 0.5*h);\n\tlet nw = new Rectangle(x-0.5*w, y-0.5*h, 0.5*w, 0.5*h);\n\tthis.northeast = new QuadTree(ne, this.capacity);\n\tthis.southeast = new QuadTree(se, this.capacity);\n\tthis.southwest = new QuadTree(sw, this.capacity);\n\tthis.northwest = new QuadTree(nw, this.capacity);\n }", "function _default(segments, compareIntersection, startInside, interpolate, stream) {\n var subject = [],\n clip = [],\n i,\n n;\n segments.forEach(function (segment) {\n if ((n = segment.length - 1) <= 0) return;\n var n,\n p0 = segment[0],\n p1 = segment[n],\n x;\n\n if ((0, _pointEqual.default)(p0, p1)) {\n if (!p0[2] && !p1[2]) {\n stream.lineStart();\n\n for (i = 0; i < n; ++i) stream.point((p0 = segment[i])[0], p0[1]);\n\n stream.lineEnd();\n return;\n } // handle degenerate cases by moving the point\n\n\n p1[0] += 2 * _math.epsilon;\n }\n\n subject.push(x = new Intersection(p0, segment, null, true));\n clip.push(x.o = new Intersection(p0, null, x, false));\n subject.push(x = new Intersection(p1, segment, null, false));\n clip.push(x.o = new Intersection(p1, null, x, true));\n });\n if (!subject.length) return;\n clip.sort(compareIntersection);\n link(subject);\n link(clip);\n\n for (i = 0, n = clip.length; i < n; ++i) {\n clip[i].e = startInside = !startInside;\n }\n\n var start = subject[0],\n points,\n point;\n\n while (1) {\n // Find first unvisited intersection.\n var current = start,\n isSubject = true;\n\n while (current.v) if ((current = current.n) === start) return;\n\n points = current.z;\n stream.lineStart();\n\n do {\n current.v = current.o.v = true;\n\n if (current.e) {\n if (isSubject) {\n for (i = 0, n = points.length; i < n; ++i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.n.x, 1, stream);\n }\n\n current = current.n;\n } else {\n if (isSubject) {\n points = current.p.z;\n\n for (i = points.length - 1; i >= 0; --i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.p.x, -1, stream);\n }\n\n current = current.p;\n }\n\n current = current.o;\n points = current.z;\n isSubject = !isSubject;\n } while (!current.v);\n\n stream.lineEnd();\n }\n}", "function _segseg (out, p1, p2, p3, p4) {\n let x1 = p1[0]\n let y1 = p1[1]\n let x2 = p2[0]\n let y2 = p2[1]\n let x3 = p3[0]\n let y3 = p3[1]\n let x4 = p4[0]\n let y4 = p4[1]\n\n let a1, a2, b1, b2, c1, c2 // Coefficients of line eqns.\n let r1, r2, r3, r4 // 'Sign' values\n let denom, offset // Intermediate values\n let x, y // Intermediate return values\n\n // Compute a1, b1, c1, where line joining points 1 and 2\n // is \"a1 x + b1 y + c1 = 0\".\n a1 = y2 - y1\n b1 = x1 - x2\n c1 = x2 * y1 - x1 * y2\n\n // Compute r3 and r4.\n r3 = a1 * x3 + b1 * y3 + c1\n r4 = a1 * x4 + b1 * y4 + c1\n\n // Check signs of r3 and r4. If both point 3 and point 4 lie on\n // same side of line 1, the line segments do not intersect.\n if ( r3 !== 0 && r4 !== 0 && ((r3 >= 0 && r4 >= 0) || (r3 < 0 && r4 < 0)))\n return DONT_INTERSECT\n\n // Compute a2, b2, c2\n a2 = y4 - y3\n b2 = x3 - x4\n c2 = x4 * y3 - x3 * y4\n\n // Compute r1 and r2\n r1 = a2 * x1 + b2 * y1 + c2\n r2 = a2 * x2 + b2 * y2 + c2\n\n // Check signs of r1 and r2. If both point 1 and point 2 lie\n // on same side of second line segment, the line segments do\n // not intersect.\n if (r1 !== 0 && r2 !== 0 && ((r1 >= 0 && r2 >= 0) || (r1 < 0 && r2 < 0)))\n return DONT_INTERSECT\n\n // Line segments intersect: compute intersection point.\n denom = a1 * b2 - a2 * b1\n\n if (denom === 0)\n return COLINEAR\n\n offset = denom < 0 ? - denom / 2 : denom / 2\n\n x = b1 * c2 - b2 * c1\n y = a2 * c1 - a1 * c2\n\n out[0] = ( x < 0 ? x : x ) / denom\n out[1] = ( y < 0 ? y : y ) / denom\n \n return DO_INTERSECT\n}", "function findSegmentIndex(t, parameterSubdivision)\n{\n var x = t;\n var index = 0;\n var rawX = t;\n\n for(var i = 0; i < parameterSubdivision.length; i++)\n {\n if(x - parameterSubdivision[i] < 0)\n {\n index = i + 1;\n x = THREE.Math.clamp(x / parameterSubdivision[i], 0, 1);\n break;\n }\n else\n {\n x -= parameterSubdivision[i];\n rawX -= parameterSubdivision[i];\n }\n }\n\n return [index, x, rawX];\n}", "function nextSegment() {\n if (editor.splitData && editor.splitData.splits) {\n var playerPaused = getPlayerPaused();\n if (!playerPaused) {\n pauseVideo();\n }\n\n var currSplitItem = getCurrentSplitItem();\n var new_id = currSplitItem.id + 1;\n\n new_id = (new_id >= editor.splitData.splits.length) ? 0 : new_id;\n\n var idFound = true;\n if ((new_id < 0) || (new_id >= editor.splitData.splits.length)) {\n idFound = false;\n }\n /*\n\telse if (!editor.splitData.splits[new_id].enabled) {\n idFound = false;\n new_id = (new_id >= (editor.splitData.splits.length - 1)) ? 0 : new_id;\n\n for (var i = new_id + 1; i < editor.splitData.splits.length; ++i) {\n if (editor.splitData.splits[i].enabled) {\n new_id = i;\n idFound = true;\n break;\n }\n }\n }\n\t*/\n if (!idFound) {\n for (var i = 0; i < new_id; ++i) {\n // if (editor.splitData.splits[i].enabled) {\n new_id = i;\n idFound = true;\n break;\n // }\n }\n }\n\n if (idFound) {\n selectSegmentListElement(new_id, !playerPaused);\n }\n if (!playerPaused) {\n playVideo();\n }\n }\n}", "function test_crosshair_op_host_vsphere65() {}", "function onSegment (pi, pj, pk) {\n return Math.min(pi[0], pj[0]) <= pk[0] &&\n pk[0] <= Math.max(pi[0], pj[0]) &&\n Math.min(pi[1], pj[1]) <= pk[1] &&\n pk[1] <= Math.max(pi[1], pj[1]);\n}", "function analyzeSpiral() {\n \n //Trim the last few points from the spiral, to avoid artifacts related to slowing as the \n\t//task finishes or lifting their finger off the page too slowly.\n\t//Arbitrarily chose 5. \n\tfor (var i=0; i<5; i++) {\n\t userSpiral.pop(); \n\t}\n \n\tanalyzed = !analyzed;\n\tanalyzing= !analyzing; \n\t\n\tif (analyzed && analyzing) {\n\tvar print = \"\";\n\t//printConsole(error);\n\tprintConsole(['Chance spiral is abnormal = ',checkLearnedSpiral(spiralError(12,0,1))]);\n\tprintConsole(['Chance spiral is abnormal = ',checkLearnedSpiral(spiralError(12,0,1),1)]);\n\tif (drawBackgroundSpiral > 0) { printConsole(['AUC = ',calculate_auc()]); }\n\t}\n\t\n\tflag=true;\n}", "function segment(line, intersect1, intersect2) {\n this.line = line;\n this.intersect1 = intersect1;\n this.intersect2 = intersect2;\n }", "function test_candu_graphs_vm_compare_host_vsphere65() {}", "function Segment(seg, desired)\n{\n\tthis.name = seg;\n\tthis.desired = desired;\n this.digit_pos = 0;\n \n this.setDigitPos = function(digit_pos)\n {\n this.digit_pos = digit_pos;\n }\n}", "function pointInSegment( segm_start, segm_end, point ) {\n var\n segm = Point2f(segm_end).subtract(segm_start),\n start_point = Point2f(segm_start).subtract(point),\n end_point = Point2f(segm_end).subtract(point);\n return 1.0001*segm.dot(segm) >= start_point.dot(start_point) + end_point.dot(end_point);\n }", "function handleSegments(tokens) {\n // Handle a single segment (after comma separation)\n function handleSegment(segment) {\n if (segment[1].text == 'null') {\n return { intertype: 'value', ident: '0', type: 'i32' };\n } else if (segment[1].text == 'zeroinitializer') {\n Types.needAnalysis[segment[0].text] = 0;\n return { intertype: 'emptystruct', type: segment[0].text };\n } else if (segment[1].text in PARSABLE_LLVM_FUNCTIONS) {\n return parseLLVMFunctionCall(segment);\n } else if (segment[1].type && segment[1].type == '{') {\n Types.needAnalysis[segment[0].text] = 0;\n return { intertype: 'struct', type: segment[0].text, contents: handleSegments(segment[1].tokens) };\n } else if (segment[1].type && segment[1].type == '<') {\n Types.needAnalysis[segment[0].text] = 0;\n return { intertype: 'struct', type: segment[0].text, contents: handleSegments(segment[1].item.tokens[0].tokens) };\n } else if (segment[1].type && segment[1].type == '[') {\n Types.needAnalysis[segment[0].text] = 0;\n return { intertype: 'list', type: segment[0].text, contents: handleSegments(segment[1].item.tokens) };\n } else if (segment.length == 2) {\n Types.needAnalysis[segment[0].text] = 0;\n return { intertype: 'value', type: segment[0].text, ident: toNiceIdent(segment[1].text) };\n } else if (segment[1].text === 'c') {\n // string\n var text = segment[2].text;\n text = text.substr(1, text.length-2);\n return { intertype: 'string', text: text, type: 'i8*' };\n } else if (segment[1].text === 'blockaddress') {\n return parseBlockAddress(segment);\n } else {\n throw 'Invalid segment: ' + dump(segment);\n }\n };\n return splitTokenList(tokens).map(handleSegment);\n }", "onCodePathSegmentStart(segment) {\n const info = {\n uselessContinues: getUselessContinues([], segment.allPrevSegments),\n returned: false\n };\n\n // Stores the info.\n segmentInfoMap.set(segment, info);\n }", "function d(b,c,d){\n// where the DOM nodes will eventually end up\nvar f,g,j=T(),m=c?a(\"<div/>\"):j,n=e(b);\n// calculate the desired `left` and `width` properties on each segment object\n// build the HTML string. relies on `left` property\n// render the HTML. innerHTML is considerably faster than jQuery's .html()\n// retrieve the individual elements\n// if we were appending, and thus using a temporary container,\n// re-attach elements to the real container.\n// assigns each element to `segment.event`, after filtering them through user callbacks\n// Calculate the left and right padding+margin for each element.\n// We need this for setting each element's desired outer width, because of the W3C box model.\n// It's important we do this in a separate pass from acually setting the width on the DOM elements\n// because alternating reading/writing dimensions causes reflow for every iteration.\n// Set the width of each element\n// Grab each element's outerHeight (setVerticals uses this).\n// To get an accurate reading, it's important to have each element's width explicitly set already.\n// Set the top coordinate on each element (requires segment.outerHeight)\nreturn h(n),f=i(n),m[0].innerHTML=f,g=m.children(),c&&j.append(g),k(n,g),xa(n,function(a,b){a.hsides=t(b,!0)}),xa(n,function(a,b){b.width(Math.max(0,a.outerWidth-a.hsides))}),xa(n,function(a,b){a.outerHeight=b.outerHeight(!0)}),l(n,d),n}", "subdivide(){\n let x = this.boundary.x;\n let y = this.boundary.y;\n let w = this.boundary.w;\n let h = this.boundary.h;\n let nw = new Rectangle(x-w/2,y-h/2,w/2,h/2);\n this.northwest = new QuadtreeConcrete(nw,this.capacity, this.points, this.depth+1);\n let ne = new Rectangle(x+w/2,y-h/2,w/2,h/2);\n this.northeast = new QuadtreeConcrete(ne,this.capacity, this.points,this.depth+1);\n let sw = new Rectangle(x-w/2,y+h/2,w/2,h/2);\n this.southwest = new QuadtreeConcrete(sw, this.capacity, this.points,this.depth+1);\n let se = new Rectangle(x+w/2,y+h/2,w/2,h/2);\n this.southeast = new QuadtreeConcrete(se,this.capacity, this.points,this.depth+1);\n this.isDivided=true;\n this.deletePointsIfSplit();\n }", "async function main() {\n\n\n console.log(\"Server starts with: npx lws --stack lws-static lws-cors spatial_functions_server.js\")\n console.log(`Stanalone classification starts with:\n\n\n \n node --max-old-space-size=4096 spatial_functions_server.js computeSegmentVoxelSpace_geom table segmentID cellsize (meters)\n \n # check if two planes touch at oue on more voxel\n node --max-old-space-size=4096 spatial_functions_server.js computeS1IntersectsS2Voxels\n\n # check if s1 planes is above s2 completely at voxel\n node --max-old-space-size=4096 spatial_functions_server.js isS1AboveS2 \n\n node --max-old-space-size=4096 spatial_functions_server.js enumerateSizes \n\n node --max-old-space-size=4096 spatial_functions_server.js getConnectedSegments \n\n\n `);\n console.log(\"Running with parameters\");\n\n let arguments = process.argv\n let parameters = [];\n\n arguments.forEach(function (val, index, array) {\n // console.log(index + ': ' + val);\n\n parameters[val] = true;//debe guardar el store\n\n });\n let operation1 = arguments[2];\n let ids = arguments[3];\n let store = parameters['store'] ? true : false;;\n\n\n\n\n let config;\n\n if (operation1 == \"computeSegmentVoxelSpace_geom\") {\n console.log(\"***********************************************************\")\n console.log(\" \")\n config = { table: 'cgeo_180209_11m_22012020_5cm_fix_segmented', segmentID: 98810, columns: 'id_rand_4', cellsize: 0.20 };\n //computeTouchesVoxels('centrogeo_segmented_tmp', 1459346,1459668, 0.25);//true\n if (ids != null) config.segmentID = ids;\n let result = spatialFunctions.computeSegmentVoxelSpace_geom(config.table, config.segmentID, config.columns, config.cellsize);\n console.log(\"OUTPUT: \" + result + \" Voxels @ cell size \" + config.cellsize)\n\n }\n\n ///////////////////////////\n if (operation1 == \"computeS1IntersectsS2Voxels\") {\n console.log(\"***********************************************************\")\n console.log(\" \")\n console.log(\"OUTPUT: Number of Voxels @ cell size \")\n //config={table:'cgeo_180209_11m_22012020_5cm_fix_segmented', segmentID: 72397, cellsize: 0.25};\n //computeTouchesVoxels('centrogeo_segmented_tmp', 1459346,1459668, 0.25);//true\n config = { table: 'cgeo_180209_11m_22012020_5cm_fix_segmented', column: 'id_rand_4', segmentID_1: 30100, segmentID_2: 290696, cellsize: 0.40 };\n\n spatialFunctions.computeS1IntersectsS2Voxel(config.table, config.segmentID_1, config.segmentID_2, config.column, config.cellsize);\n }\n\n\n if (operation1 == \"isS1AboveS2\") {\n console.log(\"***********************************************************\")\n console.log(\" \")\n // console.log(\"OUTPUT: Number of Voxels @ cell size \")\n //config={table:'cgeo_180209_11m_22012020_5cm_fix_segmented', segmentID: 72397, cellsize: 0.25};\n //computeTouchesVoxels('centrogeo_segmented_tmp', 1459346,1459668, 0.25);//true\n // config = { table: 'cgeo_180209_11m_22012020_5cm_fix_segmented', column: 'id_rand_2', segmentID_1: 72397, segmentID_2: 72397, cellsize: 0.10 , offset: 1};\n // computeS1AboveS2Voxel(config.table, config.segmentID_1, config.segmentID_2, config.column, config.cellsize,config.offset);\n //should be false\n\n //config = { table: 'cgeo_180209_11m_22012020_5cm_fix_segmented', column: 'id_rand_4', segmentID_1: 23926, segmentID_2: 14310, cellsize: 0.10, offset: 1 };\n //spatialFunctions.computeS1AboveS2Voxel(config.table, config.segmentID_1, config.segmentID_2, config.column, config.cellsize, config.offset);\n\n\n\n //true1111\n config = { table: 'cgeo_180209_11m_22012020_5cm_fix_segmented', column: 'id_rand_4_merged', segmentID_1: 30100, segmentID_2: 290696, cellsize: 0.2, offset: 0 };\n let s1 = arguments[3];\n let s2 = arguments[4];\n\n if (s1) config.segmentID_1 = s1\n if (s2) config.segmentID_2 = s2\n spatialFunctions.computeS1AboveS2VoxelHalfspaceFlexible(config.table, config.segmentID_1, config.segmentID_2, config.column, config.cellsize, config.offset);\n\n }\n\n\n if (operation1 == \"isS1HigherS2\") {\n console.log(\"***********************************************************\")\n console.log(\" \")\n // console.log(\"OUTPUT: Number of Voxels @ cell size \")\n //config={table:'cgeo_180209_11m_22012020_5cm_fix_segmented', segmentID: 72397, cellsize: 0.25};\n //computeTouchesVoxels('centrogeo_segmented_tmp', 1459346,1459668, 0.25);//true\n // config = { table: 'cgeo_180209_11m_22012020_5cm_fix_segmented', column: 'id_rand_2', segmentID_1: 72397, segmentID_2: 72397, cellsize: 0.10 , offset: 1};\n // computeS1AboveS2Voxel(config.table, config.segmentID_1, config.segmentID_2, config.column, config.cellsize,config.offset);\n //should be false\n\n //config = { table: 'cgeo_180209_11m_22012020_5cm_fix_segmented', column: 'id_rand_4', segmentID_1: 23926, segmentID_2: 14310, cellsize: 0.10, offset: 1 };\n //spatialFunctions.computeS1AboveS2Voxel(config.table, config.segmentID_1, config.segmentID_2, config.column, config.cellsize, config.offset);\n\n\n //true1111\n config = { table: 'cgeo_180209_11m_22012020_5cm_fix_segmented', column: 'id_rand_4', segmentID_1: 98810, segmentID_2: 467002, cellsize: 1.0, offset: 0 };\n spatialFunctions.computeS1HigherThanS2Voxel(config.table, config.segmentID_1, config.segmentID_2, config.column, config.cellsize, config.offset);\n\n }\n\n\n if (operation1 == \"enumerateSizes\") {\n console.log(\"***********************************************************\")\n console.log(\" \")\n console.log(\"OUTPUT: Number of Voxels per segment for all db \")\n //config={table:'cgeo_180209_11m_22012020_5cm_fix_segmented', segmentID: 72397, cellsize: 0.25};\n //computeTouchesVoxels('centrogeo_segmented_tmp', 1459346,1459668, 0.25);//true\n // \n config = { table: 'cgeo_180209_11m_22012020_5cm_fix_segmented', column: 'id_rand_4', cellsize: 0.2 };\n spatialFunctions.enumarateSegmentSizes(config.table, config.column, config.cellsize);\n\n }\n\n if (operation1 == \"getConnectedSegments\") {\n console.log(\"***********************************************************\")\n console.log(\" The connectedness is based on the voxel interaction. To speed things up, spatial indices could be used on the DB based on BBOX. \")\n console.log(\"OUTPUT: The ID of the neighbouring segments for a given segment id \")\n\n // config = { table: 'cgeo_180209_11m_22012020_5cm_fix_segmented', column: 'id_rand_4', cellsize: 0.2 ,segmentID: 88321};\n\n // config = { table: 'cgeo_180209_11m_22012020_5cm_fix_segmented', column: 'id_rand_4', cellsize: 0.2 ,segmentID: 98810};\n config = { table: 'cgeo_180209_11m_22012020_5cm_fix_segmented', column: 'id_rand_4_merged', cellsize: 2, segmentID: 320875 };\n\n storeConfig = { table: 'cgeo_180209_11m_22012020_5cm_fix_grammar_table', column_id: 'segment_id', column_store: 'interactions' }\n // config = { table: 'cgeo_180209_11m_22012020_5cm_fix_segmented', column: 'id_rand_4', cellsize: 0.2 ,segmentID: 98810};\n if (ids != null) config.segmentID = ids;\n\n let results = await\n spatialFunctions.getConnectedSegments(config.table, config.segmentID, config.column, {}, config.cellsize);\n console.log(results)\n\n if (store != null) {\n console.log('Storing Results into grammar table')\n\n //custom SQL\n\n if (results.length > 0) {\n let origin = results[0].origin;\n console.log(results[0]);\n let storeNonTerminalsSQL = `insert into ${storeConfig.table} (symbol_type,symbol,json_info)`\n\n let neighborhood = []\n\n\n let neighbor = results[0]\n console.log(neighbor.connectedSegment)\n let values = '';\n if (origin < neighbor.connectedSegment) {\n values = origin + '_' + neighbor.connectedSegment;\n } else {\n values = neighbor.connectedSegment + '_' + origin;\n }\n storeNonTerminalsSQL = storeNonTerminalsSQL + ` VALUES( 'nt', '${values}', '${JSON.stringify(neighbor)}') `;\n\n for (let i = 1; i < results.length; i++) {\n //neighbor = \n console.log(results[i].connectedSegment)\n // neighborhood.push(neighbor.connectedSegment)\n let newvalues = '';\n if (origin < results[i].connectedSegment) {\n newvalues = origin + '_' + results[i].connectedSegment;\n } else {\n newvalues = results[i].connectedSegment + '_' + origin;\n }\n storeNonTerminalsSQL = storeNonTerminalsSQL + `,( 'nt', '${newvalues}' ,'${JSON.stringify(results[i])}')`;\n\n }\n storeNonTerminalsSQL = storeNonTerminalsSQL + ';';\n console.log(storeNonTerminalsSQL);\n\n\n //`update ${storeConfig.table} set ${storeConfig.column_store} = array[${neighborhood}] WHERE ${storeConfig.column_id} = ${origin} ; `;\n\n\n //console.log(storeSQL);\n //primero hay que guardar los datos del segmento esperado\n await db.any(storeNonTerminalsSQL, {});//esperamos los resultados de la consulta con await\n }\n }\n\n\n }\n\n if (operation1 == \"flip2horizontal\") {\n console.log(\"***********************************************************\");\n console.log(\" rotates points to the horizontal \");\n\n console.log(\"INPUT: segment_id & column name \");\n console.log(\"OUTPUT: The rotated points to horizontal plane, normal is computed form ransac \");\n\n config = {\n table: 'cgeo_180209_11m_22012020_5cm_fix_segmented',\n objectstable: 'cgeo_180209_11m_22012020_5cm_fix_segmented',\n column: 'id_rand_4', segmentID: 88321\n };\n flip2Horizontal(config.table, config.column, config.segmentID);\n\n }\n\n\n if (operation1 == 'checkUnderSegmentation') {\n console.log(\"***********************************************************\");\n console.log(\" checks for a given segment if after intersecting with other segments, is splitted \");\n\n config = { table: 'cgeo_180209_11m_22012020_5cm_fix_attributes', column: 'segment_id', segmentID: 0 };\n\n\n\n //maxing a cross product.\n\n // let segmentsId = `select ${config.column} from ${config.table} where 'status is null';`\n\n //HACIENDO EL CROSS PORODUTT\n\n // flip2Horizontal(config.table, config.column, config.segmentID);\n }\n\n if (operation1 == 'storeAllConnections') {\n\n //1 obtener todos los segmentos\n //2 buscar y almacenar los demas segmentos por medio de getConnectedSegments\n config = {\n attrbiutestable: 'cgeo_180209_11m_22012020_5cm_fix_attributes',\n attributescolumn: 'segment_id',\n // condition: ' WHERE status is null AND nvoxels_020 > 10 order by segment_id asc;',//la inicial\n condition: ' WHERE status is null AND npoints > 10 order by segment_id asc;',//para filtrar\n purpose: 'connect cell 0.5',\n\n pointstable: 'cgeo_180209_11m_22012020_5cm_fix_segmented',\n pointscolumn: 'id_rand_4',\n cellsize: 1.0\n };\n\n storeConfig = { table: 'cgeo_180209_11m_22012020_5cm_fix_grammar_table', column_id: 'segment_id', column_store: 'interactions' }\n\n\n\n let condition = config.condition;\n let segmentList = await spatialFunctions.getSegmentsID(config.attrbiutestable, config.attributescolumn, condition, config.cellsize);\n console.log('Processing ' + segmentList.length);\n for (let i = 0; i < segmentList.length; i++) {\n\n\n //////////////////////////\n\n let results = await spatialFunctions.getConnectedSegments(config.pointstable, segmentList[i], config.pointscolumn, [329939], config.cellsize);//conectedness\n //console.log(results)\n\n //console.log('Storing Results into grammar table')\n\n if (results.length > 0) {\n let origin = results[0].origin;//extract the json origin value\n\n let storeNonTerminalsSQL = `insert into ${storeConfig.table} (origin, symbol_type,symbol,json_info,purpose)`\n\n ////////// storing the first element\n //let connectedSegment = results[0].connectedSegment;\n //console.log(neighbor)\n let values = '';\n if (origin < results[0].connectedSegment) { values = origin + '_' + results[0].connectedSegment; }\n else { values = results[0].connectedSegment + '_' + origin; }\n storeNonTerminalsSQL = storeNonTerminalsSQL + ` VALUES( ${origin},'nt', '${values}' , '${JSON.stringify(results[0])}' ,'${config.purpose}')`;\n ///////////////// storing the rest if any\n for (let i = 1; i < results.length; i++) {\n //let neighbor = results[i]\n console.log(results[i].connectedSegment)\n values = '';\n if (origin < results[i].connectedSegment) { values = origin + '_' + results[i].connectedSegment; }\n else { values = results[i].connectedSegment + '_' + origin; }\n storeNonTerminalsSQL = storeNonTerminalsSQL + `,( ${origin}, 'nt', '${values}' , '${JSON.stringify(results[i])}' ,'${config.purpose}')`;\n\n }\n storeNonTerminalsSQL = storeNonTerminalsSQL + ';';\n console.log(storeNonTerminalsSQL);\n\n await db.any(storeNonTerminalsSQL, {});//esperamos los resultados de la consulta con await\n console.log('Done inserting ' + origin);\n\n\n ///////////////////////////\n }\n\n\n\n\n }\n\n }\n\n if (operation1 == 'checkSegmentPlanarity') {\n\n\n console.log('Check Segment Planarity')\n // funcionalidad para tomar un segmento de la base de datos y encontrar que tan plano es,\n //esto se hace verificando para un punto, tomar otros dos, y empezar a encontrar la diferencia de los restos del plano.\n\n config = {\n attributestable: 'cgeo_180209_11m_22012020_5cm_fix_attributes',\n attributescolumn: 'segment_id',\n\n pointstable: 'cgeo_180209_11m_22012020_5cm_fix_segmented',\n pointscolumn: 'id_rand_4',\n segmentId: 23679,\n radius: 0.2,\n tolerance: 0.05\n\n };\n\n\n if (ids != null) {\n config.segmentId = ids;//overriding the default segmentid\n }\n storeConfig = { table: 'cgeo_180209_11m_22012020_5cm_fix_grammar_table', column_id: 'segment_id', column_store: 'interactions' }\n\n spatialFunctions.checkSegmentPlanarity(config.pointstable, config.pointscolumn, config.segmentId, config.radius, config.tolerance);\n\n ///////////////////////////\n }\n\n\n if (operation1 == \"mergeSegments\") {\n console.log('EXAMPLE_: node spatial_functions_server.js mergeSegments 72,147,175 ')\n console.log(ids);\n config = {\n\n pointstable: 'cgeo_180209_11m_22012020_5cm_fix_segmented',\n segmentcolumn: 'id_rand_4',\n targetcolumn: 'id_rand_4_merged',\n segmentIds: 23679,\n // radius:0.2,\n // tolerance:0.05\n\n attributestable: 'cgeo_180209_11m_22012020_5cm_fix_attributes',\n attributescolumn: 'segment_id',\n };\n\n let idsArray = ids.split(',');//temporal\n\n\n spatialFunctions.mergeSegments(config.pointstable, idsArray, config.targetcolumn, config.segmentcolumn, config.attributestable, config.attributescolumn);\n\n\n }\n\n if (operation1 == \"queryCoordinate\") {\n console.log('EXAMPLE_: node spatial_functions_server.js queryCoordinate 476749.950,2133118.740,2495.329')\n\n config = {\n\n //476749.950 : 2133118.740 : 2495.329\n pointstable: 'cgeo_180209_11m_22012020_5cm_fix_segmented',\n segmentcolumn: 'id_rand_4',\n xColumn: 'x',\n yColumn: 'y',\n zColumn: 'z',\n decimals: 2\n\n };\n\n let coordsArray = ids.split(',');//temporal\n x = coordsArray[0];\n y = coordsArray[1];\n z = coordsArray[2];\n\n\n spatialFunctions.querySegmentByCoordinates(config.pointstable, config.segmentcolumn, config.xColumn, config.yColumn, config.zColumn, x, y, z, config.decmals, 0);\n\n\n }\n\n\n /** Has isues with the function, doesnt work for vertical planes as is given as function */\n if (operation1 == \"fitPlane\") {\n console.log(\"***********************************************************\")\n console.log(\" Testing th fittnes of a plane using LEast Squares NPM instead (no ransac)\")\n console.log(\"OUTPUT: The equation of the fitted plane\")\n\n\n config = { table: 'cgeo_180209_11m_22012020_5cm_fix_segmented', column: 'id_rand_4_merged', cellsize: 2, segmentID: 320875 };\n\n\n if (ids != null) config.segmentID = ids;\n\n let results = await spatialFunctions.getSegmentXYZ(config.table, config.column, config.segmentID, {},);\n //console.log(results);\n\n console.log(results.length);\n\n let origin = { x: results[0].x, y: results[0].y, z: results[0].z }\n\n /////////////\n //translating\n let movetozero = false;\n if (movetozero) {\n for (let i = 0; i < results.length; i++) {\n results[i].x = (results[i].x - origin.x);\n results[i].y = (results[i].y - origin.y);\n results[i].z = (results[i].z - origin.z);\n }\n }\n\n const bestfit = require('best-fitting-plane')\n\n let fit = bestfit.LSE(results);\n let length = math.sqrt(fit.A * fit.A + fit.B * fit.B + fit.C * fit.C)\n let fitnormal = { A: fit.A / length, B: fit.B / length, C: fit.C / length }\n console.log('RESULT: Normal Vector:');\n console.log(fitnormal);\n\n\n\n\n\n }\n\n if (operation1 == \"fitPlaneRansac\") {\n console.log(\"***********************************************************\")\n console.log(\" Testing th fittnes of a plane using RANSAC\")\n console.log(\"OUTPUT: The equation of the found plane\")\n\n\n //config = { table: 'cgeo_180209_11m_22012020_5cm_fix_segmented', column: 'id_rand_4_merged', maxDist: 0.3, maxIterations: 10000, segmentID: 320875 };\n config = { table: 'cgeo_180209_11m_22012020_5cm_fix_segmented', column: 'id_rand_4_merged', maxDist: 0.20, maxIterations: 5000, segmentID: 242133 };\n\n\n if (ids != null) config.segmentID = ids;\n\n //get all points in a segment\n let results = await spatialFunctions.getSegmentXYZ(config.table, config.column, config.segmentID, {},);\n //console.log(results);\n\n console.log(results.length);\n\n //debia tomar un aleatorio\n\n let porigin = parseInt(Math.random() * results.length);\n\n let origin = results[porigin]\n\n /////////////\n //translating\n let movetozero = true;\n if (movetozero) {\n for (let i = 0; i < results.length; i++) {\n //results[i][0] = (results[i][0] - origin[0]);\n //results[i][1] = (results[i][1]- origin[1]);\n //results[i][2] = (results[i][2] - origin[2]);\n\n\n results[i] = [\n (results[i][0] - origin[0]),\n (results[i][1] - origin[1]),\n (results[i][2] - origin[2])]\n }\n }\n\n let rplane = await spatialFunctions.findRansacPlane(results, config.maxDist, config.maxIterations);\n console.log('PLANE');\n console.log(rplane);\n console.log('NORMAL');\n console.log(mathf3d.getOrthogonalVector2Plane(rplane.p0, rplane.p1, rplane.p2));\n console.log('POSITION');\n console.log(origin);\n\n console.log(`drawPlane([${origin}] , [${rplane.p0}],[${rplane.p1}],[${rplane.p2}],10)`)\n console.log(rplane.histogram)\n //tendria que mostrar\n\n }\n\n\n if (operation1 == \"exportTable\") {\n\n //let offset= 10000;\n let limit = 100000;\n let table = 'cgeo_180209_11m_22012020_5cm_fix_segmented';\n let exportData = fs.createWriteStream(`${table}.export.txt`);\n\n let res = await db.any(`select count(*) size from ${table} where c2 < 4 and enabled = true ;`, {});//esperamos los resultados de la consulta con await\n let size = res[0].size;\n console.log('EXPORT TABLE. Records: ' + size)\n\n let header = 'x,y,z,nx,ny,nz,id_rand_4,id_rand_4_merged,c2'\n exportData.write(header + '\\n');\n for (let offset = 0; offset < size; offset = offset + 100000) {\n\n let query = `SELECT ${header} FROM cgeo_180209_11m_22012020_5cm_fix_segmented where c2 < 4 and enabled = true order by id_rand_4 LIMIT ${limit} OFFSET ${offset};`\n console.log(query)\n let result = await db.any(query, {});//esperamos los resultados de la consulta con await\n for (i = 0; i < result.length; i++) {\n exportData.write(`${result[i]['x']},${result[i]['y']},${result[i]['z']},${result[i]['nx']},${result[i]['ny']},${result[i]['nz']},${result[i]['id_rand_4']},${result[i]['id_rand_4_merged']},${result[i]['c2']}\\n`);\n }\n\n\n\n\n }\n\n\n }\n\n ///////////////\n\n\n if (operation1 == \"computeRANSACNormalsNStore\") {\n\n\n console.log(\"***********************************************************\")\n console.log(\"Computing RANSAC plane to specific segment and updating attribute data\")\n console.log(\"OUTPUT: updated normal plane\")\n\n\n //config = { table: 'cgeo_180209_11m_22012020_5cm_fix_segmented', column: 'id_rand_4_merged', maxDist: 0.3, maxIterations: 10000, segmentID: 320875 };\n config = {\n table: 'cgeo_180209_11m_22012020_5cm_fix_segmented',\n column: 'id_rand_4_merged',\n maxDist: 0.20,\n maxIterations: 5000,\n segmentID: 242133,\n\n objectsTable: 'cgeo_180209_11m_22012020_5cm_fix_attributes',\n objectTableStoreColumn: 'segment_id'\n };\n\n if (ids != null) config.segmentID = ids;\n\n\n\n //get all xyz points in a segment id, at a table, with a column name\n let results = await spatialFunctions.getSegmentXYZ(config.table, config.column, config.segmentID, {},);\n console.log('SEGMENT ID: ' + config.segmentID);\n console.log('SEGMENT SIZE: ' + results.length);//number of points\n\n //debia tomar un aleatorio\n\n let porigin = parseInt(Math.random() * results.length);//pick a point within the segment //double check\n let origin = results[porigin]\n\n /////////////\n //translating to zero around that point\n let movetozero = true;\n if (movetozero) {\n for (let i = 0; i < results.length; i++) {\n results[i] = [\n (results[i][0] - origin[0]),\n (results[i][1] - origin[1]),\n (results[i][2] - origin[2])]\n }\n }\n\n let rplane = await spatialFunctions.findRandsacPlane(results, config.maxDist, config.maxIterations);\n console.log('PLANE');\n console.log(rplane);\n\n console.log('NORMAL');\n let newNormal = mathf3d.getOrthogonalVector2Plane(rplane.p0, rplane.p1, rplane.p2);\n console.log(newNormal);//array\n\n\n console.log('POSITION');\n console.log(origin);\n\n //something for potree custom function\n //plane defined for a given coordinate and three vectors\n //origin is set on world coordinates, \n console.log(`drawPlane([${origin}] , [${rplane.p0}],[${rplane.p1}],[${rplane.p2}],10)`)\n console.log(rplane.histogram)\n //tendria que mostrar\n\n\n //storing segment normal in attrbiute table\n console.log('STORING NORMAL INFORMATION')\n let storestring = `update ${config.objectsTable} set nx= ${newNormal[0]}, ny= ${newNormal[1]}, nz= ${newNormal[2]} where ${config.objectTableStoreColumn}=${config.segmentID} `;\n await db.none(storestring);\n console.log('Done ')\n }\n\n if (operation1 == \"updateAllNormalsRANSACNStore\") {\n\n //takes all segments with more than 50 points and computes a normal and stores in the attribute table\n console.log(\"***********************************************************\")\n console.log(\"Computing RANSAC plane to specific segment and updating attribute data\")\n console.log(\"OUTPUT: updated normal plane\")\n\n\n //config = { table: 'cgeo_180209_11m_22012020_5cm_fix_segmented', column: 'id_rand_4_merged', maxDist: 0.3, maxIterations: 10000, segmentID: 320875 };\n config = {\n table: 'cgeo_180209_11m_22012020_5cm_fix_segmented',\n column: 'id_rand_4_merged',\n maxDist: 0.20,\n maxIterations: 5000,\n segmentID: 242133,\n\n objectsTable: 'cgeo_180209_11m_22012020_5cm_fix_attributes',\n objectTableStoreColumn: 'segment_id'\n };\n\n // if (ids != null) config.segmentID = ids;\n\n\n let allSegmentsID = `\n with list as(\n select distinct(${config.column}) ids, count(*) count from ${config.table} group by ${config.column} order by ids \n )\n \n select * from list where count > 50 order by ids;\n `;\n console.log(allSegmentsID)\n let ids = await db.any(allSegmentsID, {});\n\n for (let r = 0; r < ids.length; r++) {\n\n config.segmentID=ids[r]['ids'];\n console.log('----------->' + config.segmentID)\n //get all xyz points in a segment id, at a table, with a column name\n let results = await spatialFunctions.getSegmentXYZ(config.table, config.column, config.segmentID, {},);\n console.log('SEGMENT ID: ' + config.segmentID);\n console.log('SEGMENT SIZE: ' + results.length);//number of points\n\n //debia tomar un aleatorio\n\n let porigin = parseInt(Math.random() * results.length);//pick a point within the segment //double check\n let origin = results[porigin]\n\n /////////////\n //translating to zero around that point\n let movetozero = true;\n if (movetozero) {\n for (let i = 0; i < results.length; i++) {\n results[i] = [\n (results[i][0] - origin[0]),\n (results[i][1] - origin[1]),\n (results[i][2] - origin[2])]\n }\n }\n\n let rplane = await spatialFunctions.findRandsacPlane(results, config.maxDist, config.maxIterations);\n console.log('PLANE');\n console.log(rplane);\n\n console.log('NORMAL');\n let newNormal = mathf3d.getOrthogonalVector2Plane(rplane.p0, rplane.p1, rplane.p2);\n console.log(newNormal);//array\n\n\n console.log('POSITION');\n console.log(origin);\n\n //something for potree custom function\n console.log(`drawPlane([${origin}] , [${rplane.p0}],[${rplane.p1}],[${rplane.p2}],10)`)\n console.log(rplane.histogram)\n //tendria que mostrar\n\n\n //storing segment normal in attrbiute table\n console.log('STORING NORMAL INFORMATION')\n let storestring = `update ${config.objectsTable} set nx= ${newNormal[0]}, ny= ${newNormal[1]}, nz= ${newNormal[2]} where ${config.objectTableStoreColumn}=${config.segmentID} `;\n await db.none(storestring);\n console.log('Done ')\n }\n\n }\n\n if (operation1 == \"findIntersection\") {\n console.log(\"***********************************************************\")\n\n console.log(\"Finding intersection of ransac planes. A triangle is drawn from an origin point to a projected point on the other plane. A line accross the line is drawn\")\n console.log(\"OUTPUT: LINE AT INTERSECTION\")\n\n\n //config = { table: 'cgeo_180209_11m_22012020_5cm_fix_segmented', column: 'id_rand_4_merged', maxDist: 0.3, maxIterations: 10000, segmentID: 320875 };\n config = {\n table: 'cgeo_180209_11m_22012020_5cm_fix_segmented',\n column: 'id_rand_4_merged',\n maxDist: 0.05,\n maxIterations: 10000,\n segmentID1: 98810,\n// segmentID1: 145279,\n// segmentID1:417380,\n\n segmentID2: 430978,\n// segmentID2: 467002,\n // segmentID2: 216447,\n// segmentID2: 19864,\n\n\n objectsTable: 'cgeo_180209_11m_22012020_5cm_fix_attributes',\n objectTableStoreColumn: 'segment_id'\n };\n\n spatialFunctions.compute2PlaneIntersectionSegment(config.segmentID1,config.segmentID2,config.maxIterations,config.maxDist,config.table,config.column)\n\n }\n}", "function setGamerSeg () {\n permutive.segment(6912, function(result) {\n if (result) {\n console.log(`2) Response returned in permutve.segment -if is gamer segment: ${result}`)\n getGamerAd();\n } else {\n console.log(`segment doesnt return gamer - served default ad`)\n }\n});\n}", "function drawSegment(ctx, points, start, segLen, allLen, dir, smooth, smoothMonotone, connectNulls) {\n var prevX;\n var prevY;\n var cpx0;\n var cpy0;\n var cpx1;\n var cpy1;\n var idx = start;\n var k = 0;\n\n for (; k < segLen; k++) {\n var x = points[idx * 2];\n var y = points[idx * 2 + 1];\n\n if (idx >= allLen || idx < 0) {\n break;\n }\n\n if (isPointNull(x, y)) {\n if (connectNulls) {\n idx += dir;\n continue;\n }\n\n break;\n }\n\n if (idx === start) {\n ctx[dir > 0 ? 'moveTo' : 'lineTo'](x, y);\n cpx0 = x;\n cpy0 = y;\n } else {\n var dx = x - prevX;\n var dy = y - prevY; // Ignore tiny segment.\n\n if (dx * dx + dy * dy < 0.5) {\n idx += dir;\n continue;\n }\n\n if (smooth > 0) {\n var nextIdx = idx + dir;\n var nextX = points[nextIdx * 2];\n var nextY = points[nextIdx * 2 + 1]; // Ignore duplicate point\n\n while (nextX === x && nextY === y && k < segLen) {\n k++;\n nextIdx += dir;\n idx += dir;\n nextX = points[nextIdx * 2];\n nextY = points[nextIdx * 2 + 1];\n x = points[idx * 2];\n y = points[idx * 2 + 1];\n dx = x - prevX;\n dy = y - prevY;\n }\n\n var tmpK = k + 1;\n\n if (connectNulls) {\n // Find next point not null\n while (isPointNull(nextX, nextY) && tmpK < segLen) {\n tmpK++;\n nextIdx += dir;\n nextX = points[nextIdx * 2];\n nextY = points[nextIdx * 2 + 1];\n }\n }\n\n var ratioNextSeg = 0.5;\n var vx = 0;\n var vy = 0;\n var nextCpx0 = void 0;\n var nextCpy0 = void 0; // Is last point\n\n if (tmpK >= segLen || isPointNull(nextX, nextY)) {\n cpx1 = x;\n cpy1 = y;\n } else {\n vx = nextX - prevX;\n vy = nextY - prevY;\n var dx0 = x - prevX;\n var dx1 = nextX - x;\n var dy0 = y - prevY;\n var dy1 = nextY - y;\n var lenPrevSeg = void 0;\n var lenNextSeg = void 0;\n\n if (smoothMonotone === 'x') {\n lenPrevSeg = Math.abs(dx0);\n lenNextSeg = Math.abs(dx1);\n var dir_1 = vx > 0 ? 1 : -1;\n cpx1 = x - dir_1 * lenPrevSeg * smooth;\n cpy1 = y;\n nextCpx0 = x + dir_1 * lenNextSeg * smooth;\n nextCpy0 = y;\n } else if (smoothMonotone === 'y') {\n lenPrevSeg = Math.abs(dy0);\n lenNextSeg = Math.abs(dy1);\n var dir_2 = vy > 0 ? 1 : -1;\n cpx1 = x;\n cpy1 = y - dir_2 * lenPrevSeg * smooth;\n nextCpx0 = x;\n nextCpy0 = y + dir_2 * lenNextSeg * smooth;\n } else {\n lenPrevSeg = Math.sqrt(dx0 * dx0 + dy0 * dy0);\n lenNextSeg = Math.sqrt(dx1 * dx1 + dy1 * dy1); // Use ratio of seg length\n\n ratioNextSeg = lenNextSeg / (lenNextSeg + lenPrevSeg);\n cpx1 = x - vx * smooth * (1 - ratioNextSeg);\n cpy1 = y - vy * smooth * (1 - ratioNextSeg); // cp0 of next segment\n\n nextCpx0 = x + vx * smooth * ratioNextSeg;\n nextCpy0 = y + vy * smooth * ratioNextSeg; // Smooth constraint between point and next point.\n // Avoid exceeding extreme after smoothing.\n\n nextCpx0 = mathMin(nextCpx0, mathMax(nextX, x));\n nextCpy0 = mathMin(nextCpy0, mathMax(nextY, y));\n nextCpx0 = mathMax(nextCpx0, mathMin(nextX, x));\n nextCpy0 = mathMax(nextCpy0, mathMin(nextY, y)); // Reclaculate cp1 based on the adjusted cp0 of next seg.\n\n vx = nextCpx0 - x;\n vy = nextCpy0 - y;\n cpx1 = x - vx * lenPrevSeg / lenNextSeg;\n cpy1 = y - vy * lenPrevSeg / lenNextSeg; // Smooth constraint between point and prev point.\n // Avoid exceeding extreme after smoothing.\n\n cpx1 = mathMin(cpx1, mathMax(prevX, x));\n cpy1 = mathMin(cpy1, mathMax(prevY, y));\n cpx1 = mathMax(cpx1, mathMin(prevX, x));\n cpy1 = mathMax(cpy1, mathMin(prevY, y)); // Adjust next cp0 again.\n\n vx = x - cpx1;\n vy = y - cpy1;\n nextCpx0 = x + vx * lenNextSeg / lenPrevSeg;\n nextCpy0 = y + vy * lenNextSeg / lenPrevSeg;\n }\n }\n\n ctx.bezierCurveTo(cpx0, cpy0, cpx1, cpy1, x, y);\n cpx0 = nextCpx0;\n cpy0 = nextCpy0;\n } else {\n ctx.lineTo(x, y);\n }\n }\n\n prevX = x;\n prevY = y;\n idx += dir;\n }\n\n return k;\n}", "dispatchSegmentSegment(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, cpB, extendB0, pointB0, fractionB0, pointB1, fractionB1, extendB1, reversed) {\n if (this._worldToLocalAffine) {\n // non-perspective projection\n CurveCurveIntersectXY.setTransformedWorkPoints(this._worldToLocalAffine, pointA0, pointA1, pointB0, pointB1);\n this.computeSegmentSegment3D(cpA, extendA0, CurveCurveIntersectXY._workPointA0, fractionA0, CurveCurveIntersectXY._workPointA1, fractionA1, extendA1, cpB, extendB0, CurveCurveIntersectXY._workPointB0, fractionB0, CurveCurveIntersectXY._workPointB1, fractionB1, extendB1, reversed);\n }\n else if (this._worldToLocalPerspective) {\n this.computeSegmentSegment3DH(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, cpB, extendB0, pointB0, fractionB0, pointB1, fractionB1, extendB1, reversed);\n }\n else {\n this.computeSegmentSegment3D(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, cpB, extendB0, pointB0, fractionB0, pointB1, fractionB1, extendB1, reversed);\n }\n }", "function alertPrize(indicatedSegment)\n{\n // Do basic alert of the segment text. You would probably want to do something more interesting with this information.\n alert('Ai câștigat: ' + indicatedSegment.text);\n resetWheel();\n}", "function Segment(oa){\n\t\t// debug('\\n SEGMENT - START');\n\t\toa = oa || {};\n\t\tthis.objtype = 'segment';\n\n\t\tthis.p1x = numSan(oa.p1x) || 0;\n\t\tthis.p1y = numSan(oa.p1y) || 0;\n\n\t\tthis.p2x = numSan(oa.p2x) || this.p1x || 0;\n\t\tthis.p2y = numSan(oa.p2y) || this.p1y || 0;\n\n\t\tthis.p3x = numSan(oa.p3x) || 0;\n\t\tthis.p3y = numSan(oa.p3y) || 0;\n\n\t\tthis.p4x = numSan(oa.p4x) || 0;\n\t\tthis.p4y = numSan(oa.p4y) || 0;\n\n\t\tif(!oa.p3x) this.p3x = this.p4x;\n\t\tif(!oa.p3y) this.p3y = this.p4y;\n\n\t\tthis.line = this.isLine();\n\n\t\t// cache\n\t\toa.cache = oa.cache || {};\n\t\tthis.cache = {};\n\t\tthis.cache.length = oa.cache.length || false;\n\n\t\t// debug(' SEGMENT - END\\n');\n\t}", "function segments_union(segment_1, segment_2){\n var max_segment_1, min_segment_1, max_segment_2, min_segment_2, absolute_max, absolute_min;\n //Case 1: vertical segments\n var vertical = is_vertical_or_quasi_vertical(segment_1); //equivalently is_vertical_or_quasi_vertical(segment_2)\n if(vertical){\n\n if(parseFloat(segment_1[0][1]) >= parseFloat(segment_1[1][1])){\n max_segment_1 = segment_1[0]; min_segment_1 = segment_1[1];\n }\n else{\n max_segment_1 = segment_1[1]; min_segment_1 = segment_1[0];\n }\n if(parseFloat(segment_2[0][1]) >= parseFloat(segment_2[1][1])){\n max_segment_2 = segment_2[0]; min_segment_2 = segment_2[1];\n }\n else{\n max_segment_2 = segment_2[1]; min_segment_2 = segment_2[0];\n }\n\n if(parseFloat(max_segment_1[1]) >= parseFloat(max_segment_2[1])){\n absolute_max = max_segment_1;\n }\n else{\n absolute_max = max_segment_2;\n }\n if(parseFloat(min_segment_1[1]) < parseFloat(min_segment_2[1])){\n absolute_min = min_segment_1;\n }\n else{\n absolute_min = min_segment_2;\n }\n\n return [absolute_min, absolute_max];\n }\n\n //Case 2: non vertical segments\n if(parseFloat(segment_1[0][0]) >= parseFloat(segment_1[1][0])){\n max_segment_1 = segment_1[0]; min_segment_1 = segment_1[1];\n }\n else{\n max_segment_1 = segment_1[1]; min_segment_1 = segment_1[0];\n }\n if(parseFloat(segment_2[0][0]) >= parseFloat(segment_2[1][0])){\n max_segment_2 = segment_2[0]; min_segment_2 = segment_2[1];\n }\n else{\n max_segment_2 = segment_2[1]; min_segment_2 = segment_2[0];\n }\n\n if(parseFloat(max_segment_1[0]) >= parseFloat(max_segment_2[0])){\n absolute_max = max_segment_1;\n }\n else{\n absolute_max = max_segment_2;\n }\n if(parseFloat(min_segment_1[0]) < parseFloat(min_segment_2[0])){\n absolute_min = min_segment_1;\n }\n else{\n absolute_min = min_segment_2;\n }\n\n return [absolute_min, absolute_max];\n}", "function F(a,b){var c=G.getRowCnt(),d=G.getColCnt(),e=[],f=B(a),g=B(b),h=+b.time();h&&h>=M&&g++,g=Math.max(g,f+1);\n// loop through all the rows in the view\nfor(var i=C(f),j=C(g)-1,k=0;k<c;k++){\n// first and last cell offset for the row\nvar l=k*d,m=l+d-1,n=Math.max(i,l),o=Math.min(j,m);\n// make sure segment's offsets are valid and in view\nif(n<=o){\n// translate to cells\nvar p=D(n),q=D(o),r=[p.col,q.col].sort(),s=y(n)==f,t=y(o)+1==g;// +1 for comparing exclusively\ne.push({row:k,leftCol:r[0],rightCol:r[1],isStart:s,isEnd:t})}}return e}", "function formatIntersectingSegment(x, y, i, j, xx, yy) {\n if (xx[i] == x && yy[i] == y) {\n return [i, i];\n }\n if (xx[j] == x && yy[j] == y) {\n return [j, j];\n }\n return i < j ? [i, j] : [j, i];\n }", "function checkIfProximalSegmentGetsQuestion4v(){\n var mostProx=getMostProximalSegmentNumber();\n var showme='0';\n\n for (var i = 0; i < meSegmentVisualizedTableHelp.length; i++) {\n\n if (meSegmentVisualizedTableHelp[i][0]==mostProx) {\n\n showme = meSegmentVisualizedTableHelp[i][4];\n }\n }\n\n if (showme == '1') {\n return true;\n }\n\n return false;\n}", "function __collect_segs(regs) {\n regs.es = __collect_seg('es');\n regs.cs = __collect_seg('cs');\n regs.ss = __collect_seg('ss');\n regs.ds = __collect_seg('ds');\n // these values below will be wrong -- reading msrs will give us the\n // correct ones\n regs.fs = __collect_seg('fs');\n regs.gs = __collect_seg('gs');\n\n regs.tr = __collect_seg('tr');\n // our ghetto string parsing is wrong for tr, force it to true\n regs.tr.present = true;\n\n regs.ldtr = __collect_seg('ldtr');\n}", "function drawSegment(ctx, points, start, segLen, allLen, dir, smooth, smoothMonotone, connectNulls) {\n var prevX;\n var prevY;\n var cpx0;\n var cpy0;\n var cpx1;\n var cpy1;\n var idx = start;\n var k = 0;\n\n for (; k < segLen; k++) {\n var x = points[idx * 2];\n var y = points[idx * 2 + 1];\n\n if (idx >= allLen || idx < 0) {\n break;\n }\n\n if (isPointNull(x, y)) {\n if (connectNulls) {\n idx += dir;\n continue;\n }\n\n break;\n }\n\n if (idx === start) {\n ctx[dir > 0 ? 'moveTo' : 'lineTo'](x, y);\n cpx0 = x;\n cpy0 = y;\n } else {\n var dx = x - prevX;\n var dy = y - prevY; // Ignore tiny segment.\n\n if (dx * dx + dy * dy < 0.5) {\n idx += dir;\n continue;\n }\n\n if (smooth > 0) {\n var nextIdx = idx + dir;\n var nextX = points[nextIdx * 2];\n var nextY = points[nextIdx * 2 + 1];\n var tmpK = k + 1;\n\n if (connectNulls) {\n // Find next point not null\n while (isPointNull(nextX, nextY) && tmpK < segLen) {\n tmpK++;\n nextIdx += dir;\n nextX = points[nextIdx * 2];\n nextY = points[nextIdx * 2 + 1];\n }\n }\n\n var ratioNextSeg = 0.5;\n var vx = 0;\n var vy = 0;\n var nextCpx0 = void 0;\n var nextCpy0 = void 0; // Is last point\n\n if (tmpK >= segLen || isPointNull(nextX, nextY)) {\n cpx1 = x;\n cpy1 = y;\n } else {\n vx = nextX - prevX;\n vy = nextY - prevY;\n var dx0 = x - prevX;\n var dx1 = nextX - x;\n var dy0 = y - prevY;\n var dy1 = nextY - y;\n var lenPrevSeg = void 0;\n var lenNextSeg = void 0;\n\n if (smoothMonotone === 'x') {\n lenPrevSeg = Math.abs(dx0);\n lenNextSeg = Math.abs(dx1);\n cpx1 = x - lenPrevSeg * smooth;\n cpy1 = y;\n nextCpx0 = x + lenPrevSeg * smooth;\n nextCpy0 = y;\n } else if (smoothMonotone === 'y') {\n lenPrevSeg = Math.abs(dy0);\n lenNextSeg = Math.abs(dy1);\n cpx1 = x;\n cpy1 = y - lenPrevSeg * smooth;\n nextCpx0 = x;\n nextCpy0 = y + lenPrevSeg * smooth;\n } else {\n lenPrevSeg = Math.sqrt(dx0 * dx0 + dy0 * dy0);\n lenNextSeg = Math.sqrt(dx1 * dx1 + dy1 * dy1); // Use ratio of seg length\n\n ratioNextSeg = lenNextSeg / (lenNextSeg + lenPrevSeg);\n cpx1 = x - vx * smooth * (1 - ratioNextSeg);\n cpy1 = y - vy * smooth * (1 - ratioNextSeg); // cp0 of next segment\n\n nextCpx0 = x + vx * smooth * ratioNextSeg;\n nextCpy0 = y + vy * smooth * ratioNextSeg; // Smooth constraint between point and next point.\n // Avoid exceeding extreme after smoothing.\n\n nextCpx0 = mathMin(nextCpx0, mathMax(nextX, x));\n nextCpy0 = mathMin(nextCpy0, mathMax(nextY, y));\n nextCpx0 = mathMax(nextCpx0, mathMin(nextX, x));\n nextCpy0 = mathMax(nextCpy0, mathMin(nextY, y)); // Reclaculate cp1 based on the adjusted cp0 of next seg.\n\n vx = nextCpx0 - x;\n vy = nextCpy0 - y;\n cpx1 = x - vx * lenPrevSeg / lenNextSeg;\n cpy1 = y - vy * lenPrevSeg / lenNextSeg; // Smooth constraint between point and prev point.\n // Avoid exceeding extreme after smoothing.\n\n cpx1 = mathMin(cpx1, mathMax(prevX, x));\n cpy1 = mathMin(cpy1, mathMax(prevY, y));\n cpx1 = mathMax(cpx1, mathMin(prevX, x));\n cpy1 = mathMax(cpy1, mathMin(prevY, y)); // Adjust next cp0 again.\n\n vx = x - cpx1;\n vy = y - cpy1;\n nextCpx0 = x + vx * lenNextSeg / lenPrevSeg;\n nextCpy0 = y + vy * lenNextSeg / lenPrevSeg;\n }\n }\n\n ctx.bezierCurveTo(cpx0, cpy0, cpx1, cpy1, x, y);\n cpx0 = nextCpx0;\n cpy0 = nextCpy0;\n } else {\n ctx.lineTo(x, y);\n }\n }\n\n prevX = x;\n prevY = y;\n idx += dir;\n }\n\n return k;\n}", "function computeSlotSegCollisions(seg,otherSegs,results){if(results===void 0){results=[];}for(var i=0;i<otherSegs.length;i++){if(isSlotSegCollision(seg,otherSegs[i])){results.push(otherSegs[i]);}}return results;}// Do these segments occupy the same vertical space?", "function Eat() {\r\nif (segmentX[0] == food.x && segmentY[0] == food.y){\r\n addSegment();\r\n generateFood();\r\n\r\n}\r\n\r\n}", "static hasSegment(key) {\n return Object.keys(this.segments).includes(key);\n }", "function DummyPlane(){}", "findSegment(from, to) {\n return this.state.routes.features.find(segment => {\n const s = segment.properties.sToponym;\n const e = segment.properties.eToponym;\n return (s === from && e === to) || (e === from && s === to);\n });\n }", "function getLineSegmentsIntersection (out, p0, p1, p2, p3) {\n\n var s1_x, s1_y, s2_x, s2_y;\n s1_x = p1[0] - p0[0];\n s1_y = p1[1] - p0[1];\n s2_x = p3[0] - p2[0];\n s2_y = p3[1] - p2[1];\n\n var s, t;\n s = (-s1_y * (p0[0] - p2[0]) + s1_x * (p0[1] - p2[1])) / (-s2_x * s1_y + s1_x * s2_y);\n t = ( s2_x * (p0[1] - p2[1]) - s2_y * (p0[0] - p2[0])) / (-s2_x * s1_y + s1_x * s2_y);\n if (s >= 0 && s <= 1 && t >= 0 && t <= 1) { // Collision detected\n var intX = p0[0] + (t * s1_x);\n var intY = p0[1] + (t * s1_y);\n out[0] = intX;\n out[1] = intY;\n return t;\n }\n return -1; // No collision\n}", "function validateHost(segment, host) {\n\n if (utilities.isNullOrEmpty(host.label)) {\n console.error('host label must not be null or empty');\n return false;\n }\n\n if (!validateKeyMap(host.keymap)) {\n console.error('host \\\"' + host.label + '\\\": invalid key map ' + host.keymap);\n return false;\n }\n if (host.hasOwnProperty('ip')) {\n var status = true;\n var ipInOwnSegmentCidr = false;\n host.ip.every(function (ip) {\n if (!isValidIp(ip)) {\n console.error('host \\\"' + host.label + '\\\": ip is not valid');\n status = false;\n return status;\n }\n\n if (utilities.isIpInRange(ip, segment.net)) {\n // ip is in own segment's cidr range\n ipInOwnSegmentCidr = true;\n return status;\n } else {\n\n // check if ip is in any other segment's cidr range and host's pnode is in other segment's pnode array\n var found = false;\n if (json.hasOwnProperty('segment')) {\n json.segment.every(function (seg) {\n if (utilities.isIpInRange(ip, seg.net)) {\n if (!utilities.isNullOrEmpty(host.pnode)) {\n // host's pnode must be one of seg's pnodes\n if (seg.hasOwnProperty('pnode')) {\n seg.pnode.every(function (pn) {\n if (host.pnode === pn) {\n found = true;\n return false;\n }\n });\n }\n }\n if (found) {\n return false;\n }\n\n } else {\n return true;\n }\n });\n }\n if (!found) {\n console.error('host \\\"' + host.label + '\\\": ip \\\"' + ip + '\\\" is not in any segment\\'s cidr range or host\\'s pnode is not in segment\\'s pnodes');\n status = false;\n }\n return status;\n }\n });\n\n if (!status) {\n return false;\n }\n\n if (!ipInOwnSegmentCidr) {\n // at least one ip must be in own segment's cidr range\n console.error('host \\\"' + host.label + '\\\" has no ip which is in segment\\'s cidr range: ' + segment.net);\n return false;\n }\n }\n\n if (utilities.isNullOrEmpty(host.os)) {\n console.error('host \\\"' + host.label + '\\\": template must not be null or empty');\n return false;\n }\n\n if (!validatePnode(segment, host)) {\n return false;\n }\n\n return true;\n}", "function test_cluster_graph_by_host_tag_vsphere65() {}", "function traceSegment(options) {\n var segments = [];\n var segCollector = [];\n // inject interceptor\n Object(_interceptors_xhr__WEBPACK_IMPORTED_MODULE_1__[\"default\"])();\n Object(_interceptors_fetch__WEBPACK_IMPORTED_MODULE_5__[\"default\"])();\n window.addEventListener('xhrReadyStateChange', function (event) {\n var segment = {\n traceId: '',\n service: options.service + _services_constant__WEBPACK_IMPORTED_MODULE_4__[\"ServiceTag\"],\n spans: [],\n serviceInstance: options.serviceVersion,\n traceSegmentId: '',\n };\n var xhrState = event.detail.readyState;\n var config = event.detail.getRequestConfig;\n var url = {};\n if (config[1].startsWith('http://') || config[1].startsWith('https://') || config[1].startsWith('//')) {\n url = new URL(config[1]);\n }\n else {\n url = new URL(window.location.href);\n url.pathname = config[1];\n }\n if ([_services_constant__WEBPACK_IMPORTED_MODULE_4__[\"ReportTypes\"].ERROR, _services_constant__WEBPACK_IMPORTED_MODULE_4__[\"ReportTypes\"].PERF, _services_constant__WEBPACK_IMPORTED_MODULE_4__[\"ReportTypes\"].SEGMENTS].includes(url.pathname) &&\n !options.traceSDKInternal) {\n return;\n }\n // The values of xhrState are from https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/readyState\n if (xhrState === _services_constant__WEBPACK_IMPORTED_MODULE_4__[\"ReadyStatus\"].OPENED) {\n var traceId = Object(_services_uuid__WEBPACK_IMPORTED_MODULE_2__[\"default\"])();\n var traceSegmentId = Object(_services_uuid__WEBPACK_IMPORTED_MODULE_2__[\"default\"])();\n segCollector.push({\n event: event.detail,\n startTime: new Date().getTime(),\n traceId: traceId,\n traceSegmentId: traceSegmentId,\n });\n var traceIdStr = String(Object(js_base64__WEBPACK_IMPORTED_MODULE_0__[\"encode\"])(traceId));\n var segmentId = String(Object(js_base64__WEBPACK_IMPORTED_MODULE_0__[\"encode\"])(traceSegmentId));\n var service = String(Object(js_base64__WEBPACK_IMPORTED_MODULE_0__[\"encode\"])(segment.service));\n var instance = String(Object(js_base64__WEBPACK_IMPORTED_MODULE_0__[\"encode\"])(segment.serviceInstance));\n var endpoint = String(Object(js_base64__WEBPACK_IMPORTED_MODULE_0__[\"encode\"])(options.pagePath));\n var peer = String(Object(js_base64__WEBPACK_IMPORTED_MODULE_0__[\"encode\"])(url.host));\n var index = segment.spans.length;\n var values = 1 + \"-\" + traceIdStr + \"-\" + segmentId + \"-\" + index + \"-\" + service + \"-\" + instance + \"-\" + endpoint + \"-\" + peer;\n event.detail.setRequestHeader('sw8', values);\n }\n if (xhrState === _services_constant__WEBPACK_IMPORTED_MODULE_4__[\"ReadyStatus\"].DONE) {\n var endTime = new Date().getTime();\n for (var i = 0; i < segCollector.length; i++) {\n if (segCollector[i].event.readyState === _services_constant__WEBPACK_IMPORTED_MODULE_4__[\"ReadyStatus\"].DONE) {\n var url_1 = {};\n if (segCollector[i].event.status) {\n url_1 = new URL(segCollector[i].event.responseURL);\n }\n var exitSpan = {\n operationName: options.pagePath,\n startTime: segCollector[i].startTime,\n endTime: endTime,\n spanId: segment.spans.length,\n spanLayer: _services_constant__WEBPACK_IMPORTED_MODULE_4__[\"SpanLayer\"],\n spanType: _services_constant__WEBPACK_IMPORTED_MODULE_4__[\"SpanType\"],\n isError: event.detail.status === 0 || event.detail.status >= 400 ? true : false,\n parentSpanId: segment.spans.length - 1,\n componentId: _services_constant__WEBPACK_IMPORTED_MODULE_4__[\"ComponentId\"],\n peer: url_1.host,\n tags: options.detailMode\n ? [\n {\n key: 'http.method',\n value: config[0],\n },\n {\n key: 'url',\n value: segCollector[i].event.responseURL,\n },\n ]\n : undefined,\n };\n segment = __assign(__assign({}, segment), { traceId: segCollector[i].traceId, traceSegmentId: segCollector[i].traceSegmentId });\n segment.spans.push(exitSpan);\n segCollector.splice(i, 1);\n }\n }\n segments.push(segment);\n }\n });\n window.onbeforeunload = function (e) {\n if (!segments.length) {\n return;\n }\n new _services_report__WEBPACK_IMPORTED_MODULE_3__[\"default\"]('SEGMENTS', options.collector).sendByXhr(segments);\n };\n //report per 5min\n setInterval(function () {\n if (!segments.length) {\n return;\n }\n new _services_report__WEBPACK_IMPORTED_MODULE_3__[\"default\"]('SEGMENTS', options.collector).sendByXhr(segments);\n segments = [];\n }, 300000);\n }", "InLineOfSight (start, end) {\n\t\tperformance.mark('InLineOfSight()');\n\t\tlet epsilon = 0.5;//Number.Epsilon;\n\n\t\t// Not in LOS if any of the ends is outside the polygon\n\t\t//NOTE: I dont think it needed\n\t\t// performance.mark('checkInMainPoly()');\n\t\t// if( !this.polygons[0].pointInside(start) || !this.polygons[0].pointInside(end) ) {\n\t\t// \tperformance.measure('checkInMainPoly', 'checkInMainPoly()');\n\t\t// \tperformance.measure('InLineOfSight', 'InLineOfSight()');\n\t\t// \treturn false;\n\t\t// }\n\t\t// performance.measure('checkInMainPoly', 'checkInMainPoly()');\n\n\t\t// In LOS if it's the same start and end location\n\t\tperformance.mark('checkInTooClose()');\n\t\tif( this.Distance(start, end) < epsilon ) {\n\t\t\tperformance.measure('checkInTooClose', 'checkInTooClose()');\n\t\t\tperformance.measure('InLineOfSight', 'InLineOfSight()');\n\t\t\treturn true;\n\t\t}\n\t\tperformance.measure('checkInTooClose', 'checkInTooClose()');\n\t\n\t\t// Not in LOS if any edge is intersected by the start-end line segment\n\t\tperformance.mark('checkEdgesForCross()');\n\t\tfor( let polygon of this.polygons ) {\n\t\t\tfor( let i of Utils.range(polygon.vertices.length) ) {\n\t\t\t\tlet v1 = polygon.vertices[i];\n\t\t\t\tlet v2 = polygon.vertices[(i + 1) % polygon.vertices.length];\n\t\t\t\tif( this.LineSegmentsCross(start, end, v1, v2) ) {\n\t\t\t\t\tperformance.measure('checkEdgesForCross', 'checkEdgesForCross()');\n\t\t\t\t\tperformance.measure('InLineOfSight', 'InLineOfSight()');\n\t\t\t\t\t// For performance reason i make return here, without additional check on \"snapped endpoint\"\n\t\t\t\t\treturn false;\n\t\t\t\t\t//In some cases a 'snapped' endpoint is just a little over the line due to rounding errors. So a 0.5 margin is used to tackle those cases.\n\t\t\t\t\tif( polygon.distanceToSegment(start.x, start.y, v1.x, v1.y, v2.x, v2.y ) > epsilon && polygon.distanceToSegment(end.x, end.y, v1.x, v1.y, v2.x, v2.y ) > epsilon ) {\n\t\t\t\t\t\tperformance.measure('checkEdgesForCross', 'checkEdgesForCross()');\n\t\t\t\t\t\tperformance.measure('InLineOfSight', 'InLineOfSight()');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tperformance.measure('checkEdgesForCross', 'checkEdgesForCross()');\n\n\t\tperformance.mark('checkMiddlePointInside()');\n\t\t// Finally the middle point in the segment determines if in LOS or not\n\t\t//TODO: WHAT?\n\t\tlet middle = {x:(start.x + end.x) / 2, y:(start.y + end.y) / 2};//Vector.Add(start, end)/2;\n\t\tlet inside = this.polygons[0].pointInside(middle);// Check main poly\n\t\tfor( let i of Utils.range(this.polygons.length-1,1) ) {// Check others\n\t\t\tif( this.polygons[i].pointInside(middle, false) ) inside = false;\n\t\t}\n\t\tperformance.measure('checkMiddlePointInside', 'checkMiddlePointInside()');\n\t\tperformance.measure('InLineOfSight', 'InLineOfSight()');\n\t\treturn inside;\n\t}", "function PlanePos(){\n\n\nthis.getSegment=function getSegment (planeW, planeH, planeWs, planeHs,coordX, coordY) {\n//<-- cordinate diapazons\n\nthis.DiapX=planeW/2;\nthis.DiapY=planeH/2;\n//<-- \nif((coordX>=-1*this.DiapX && coordX<this.DiapX)&& (coordY>=-1*this.DiapY && coordY<this.DiapY)){\nthis.DiapX=this.DiapX+coordX;\nthis.DiapY=this.DiapY-+coordY;\n\n//<-- segment dimanesions\nthis.SegmentWidth=planeW/planeWs;\nthis.SegmentHeight=planeH/planeHs;\n//<--\nthis.SegX=Math.ceil(this.DiapX/this.SegmentWidth);\nthis.SegY=Math.ceil(this.DiapY/this.SegmentHeight);\n\n//return(this.SegX*planeWs-(planeHs-this.SegY));\nreturn (this.SegY*planeWs-(planeHs-this.SegX));\n}\nreturn(0);\n}//<--\n\nthis.getVertices=function getVertices(planeW, planeH, planeWs, planeHs,coordX, CoordY){\nthis.segment= this.getSegment (planeW, planeH, planeWs, planeHs,coordX, CoordY);\n//<-- first vertice number\nreturn(this.segment+(Math.ceil(this.segment/planeWs)-1)); \t\n\t\n}//<--\n\n\n\n\t\n\t\n\t\n\t\n\t\n}//<-- plane", "computeSegmentSegment3DH(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, cpB, extendB0, pointB0, fractionB0, pointB1, fractionB1, extendB1, reversed) {\n const hA0 = CurveCurveIntersectXY._workPointA0H;\n const hA1 = CurveCurveIntersectXY._workPointA1H;\n const hB0 = CurveCurveIntersectXY._workPointB0H;\n const hB1 = CurveCurveIntersectXY._workPointB1H;\n this._worldToLocalPerspective.multiplyPoint3d(pointA0, 1, hA0);\n this._worldToLocalPerspective.multiplyPoint3d(pointA1, 1, hA1);\n this._worldToLocalPerspective.multiplyPoint3d(pointB0, 1, hB0);\n this._worldToLocalPerspective.multiplyPoint3d(pointB1, 1, hB1);\n const fractionAB = Polynomials_1.SmallSystem.lineSegment3dHXYTransverseIntersectionUnbounded(hA0, hA1, hB0, hB1);\n if (fractionAB !== undefined) {\n const fractionA = fractionAB.x;\n const fractionB = fractionAB.y;\n if (this.acceptFraction(extendA0, fractionA, extendA1) && this.acceptFraction(extendB0, fractionB, extendB1)) {\n // final fraction acceptance uses original world points, with perspective-aware fractions\n this.recordPointWithLocalFractions(fractionA, cpA, fractionA0, fractionA1, fractionB, cpB, fractionB0, fractionB1, reversed);\n }\n }\n }", "function getLineSegmentsIntersection(out, p0, p1, p2, p3) {\n\n var s1_x, s1_y, s2_x, s2_y;\n s1_x = p1[0] - p0[0];\n s1_y = p1[1] - p0[1];\n s2_x = p3[0] - p2[0];\n s2_y = p3[1] - p2[1];\n\n var s, t;\n s = (-s1_y * (p0[0] - p2[0]) + s1_x * (p0[1] - p2[1])) / (-s2_x * s1_y + s1_x * s2_y);\n t = (s2_x * (p0[1] - p2[1]) - s2_y * (p0[0] - p2[0])) / (-s2_x * s1_y + s1_x * s2_y);\n if (s >= 0 && s <= 1 && t >= 0 && t <= 1) {\n // Collision detected\n var intX = p0[0] + t * s1_x;\n var intY = p0[1] + t * s1_y;\n out[0] = intX;\n out[1] = intY;\n return t;\n }\n return -1; // No collision\n }", "function bvh_subdivide(bvh, nodeidx, /* current parent node to consider splitting */start, end, /* primitive sub-range to be considered at this recursion step */vb, /* bounding volume of the primitives' bounds in the sub-range */cb, /* bounding box of primitive centroids in this range */transparent, /* does the node contain opaque or transparent objects */depth /* recursion depth */) {\n\t box_get_size(cbdiag, 0, cb, 0);\n\t var nodes = bvh.nodes;\n\t var frags_per_leaf = transparent ? bvh.frags_per_leaf_node_transparent : bvh.frags_per_leaf_node;\n\t var frags_per_inner = transparent ? bvh.frags_per_inner_node_transparent : bvh.frags_per_inner_node;\n\t var polys_per_node = bvh.max_polys_per_node;\n\t //Decide which axis to split on.\n\t var axis = 0;\n\t if (cbdiag[1] > cbdiag[0]) axis = 1;\n\t if (cbdiag[2] > cbdiag[axis]) axis = 2;\n\t //Whether the node gets split or not, it gets\n\t //the same overall bounding box.\n\t nodes.setBox0(nodeidx, vb);\n\t //Check the expected polygon count of the node. This figures out the maximum number of fragments\n\t // we can put at the node as determined by polys_per_node\n\t var poly_count = 0;\n\t var poly_cut_off = 0;\n\t var prim_count = end - start + 1;\n\t // If we have the number of triangles in each mesh, limit the number of primitives in an inner node.\n\t if (bvh.finfo.hasPolygonCounts && bvh.frags_per_inner_node) {\n\t // Walk through primitives, add up the counts until we reach polys_per_node (10000), or run through\n\t // frags_per_inner_node (usually 32).\n\t // We know that later on we'll limit the number to frags_per_inner_node, so also do it here.\n\t var shorten_end = prim_count <= bvh.frags_per_inner_node ? end : start + bvh.frags_per_inner_node - 1;\n\t for (var i = start; i <= shorten_end; i++) {\n\t poly_count += bvh.finfo.getPolygonCount(bvh.primitives[i]);\n\t poly_cut_off++;\n\t if (poly_count > polys_per_node) break;\n\t }\n\t }\n\t var isSmall = prim_count <= frags_per_leaf && poly_count < polys_per_node || prim_count === 1;\n\t //Decide whether to terminate recursion\n\t if (isSmall || depth > MAX_DEPTH || cbdiag[axis] < bvh.scene_epsilon) {\n\t nodes.setLeftChild(nodeidx, -1);\n\t nodes.setPrimStart(nodeidx, start);\n\t nodes.setPrimCount(nodeidx, end - start + 1);\n\t nodes.setFlags(nodeidx, 0, 0, transparent ? 1 : 0);\n\t return;\n\t }\n\t //Pick the largest (first) primitives to live in this node\n\t //NOTE: this assumes primitives are sorted by size.\n\t //NOTE: This step is an optional departure from the original, and we also do a check for it above\n\t // to compute poly_cut_off.\n\t if (frags_per_inner) {\n\t axis = bvh_fatten_inner_node(bvh, nodes, nodeidx, start, end, cb, cbdiag, poly_cut_off);\n\t start = start + nodes.getPrimCount(nodeidx);\n\t }\n\t var split_info = new bvh_split_info();\n\t //Do the binning of the remaining primitives to go into child nodes\n\t bvh_bin_axis(bvh, start, end, axis, cb, cbdiag, split_info);\n\t if (split_info.num_bins < 0) {\n\t //Split was too costly, so add all objects to the current node and bail\n\t nodes.setPrimCount(nodeidx, nodes.getPrimCount(nodeidx) + end - start + 1);\n\t return;\n\t }\n\t bvh_partition(bvh, start, end, axis, cb, cbdiag, split_info);\n\t var child_idx = nodes.nextNodes(2);\n\t /* set info about split into the node */\n\t var cleft = (split_info.vb_left[3 + axis] + split_info.vb_left[axis]) * 0.5;\n\t var cright = (split_info.vb_right[3 + axis] + split_info.vb_right[axis]) * 0.5;\n\t nodes.setFlags(nodeidx, axis, cleft < cright ? 0 : 1, transparent ? 1 : 0);\n\t nodes.setLeftChild(nodeidx, child_idx);\n\t /* validate split */\n\t /*\n\t if (true) {\n\t for (var i=start; i< start+num_left; i++)\n\t {\n\t //int binid = (int)(k1 * (info->prim_info[info->bvh->iprims[i]].centroid.v[axis] - cb->min.v[axis]));\n\t var cen = primitives[i] * POINT_STRIDE;\n\t if ( centroids[cen] < split_info.cb_left[0]\n\t || centroids[cen] > split_info.cb_left[3]\n\t || centroids[cen+1] < split_info.cb_left[1]\n\t || centroids[cen+1] > split_info.cb_left[4]\n\t || centroids[cen+2] < split_info.cb_left[2]\n\t || centroids[cen+2] > split_info.cb_left[5])\n\t {\n\t debug (\"wrong centroid box\");\n\t }\n\t }\n\t for (i=start+num_left; i<=end; i++)\n\t {\n\t //int binid = (int)(k1 * (info->prim_info[info->bvh->iprims[i]].centroid.v[axis] - cb->min.v[axis]));\n\t var cen = primitives[i] * POINT_STRIDE;\n\t if ( centroids[cen] < split_info.cb_right[0]\n\t || centroids[cen] > split_info.cb_right[3]\n\t || centroids[cen+1] < split_info.cb_right[1]\n\t || centroids[cen+1] > split_info.cb_right[4]\n\t || centroids[cen+2] < split_info.cb_right[2]\n\t || centroids[cen+2] > split_info.cb_right[5])\n\t {\n\t debug (\"wrong centroid box\");\n\t }\n\t }\n\t }\n\t */\n\t /* recurse */\n\t //bvh_subdivide(bvh, child_idx, start, start + split_info.num_left - 1, split_info.vb_left, split_info.cb_left, transparent, depth+1);\n\t //bvh_subdivide(bvh, child_idx + 1, start + split_info.num_left, end, split_info.vb_right, split_info.cb_right, transparent, depth+1);\n\t //Iterative stack-based recursion for easier profiling\n\t bvh.recursion_stack.push([bvh, child_idx + 1, start + split_info.num_left, end, split_info.vb_right, split_info.cb_right, transparent, depth + 1]);\n\t bvh.recursion_stack.push([bvh, child_idx, start, start + split_info.num_left - 1, split_info.vb_left, split_info.cb_left, transparent, depth + 1]);\n\t }", "function SetSegmentsInvolved(Segment,Lesion,me)\n{\n if (me.checked)\n {\n\tif (meSegmentsInvolved[Segment][Lesion]==0)\n\t{\n\t meSegmentsInvolved[Segment][Lesion]=1;\n\t}\n }\n else\n {\n\tif (meSegmentsInvolved[Segment][Lesion]==1)\n\t{\n\t meSegmentsInvolved[Segment][Lesion]=0;\n\t}\n }\n}", "function segment(x, y, a) {\n translate(x, y);\n rotate(a);\n line(0, 0, segLength, 0);\n}", "countSegmentsStatus(status) {\n var count = 0;\n for(var i = 0; i < this.numSegments; i++ ) {\n if(this.segmentGenerated[i] == status)\n count ++;\n }\n return count;\n }", "function GetClipSegments(clip_intervals, block_size, hop_size, x_length) {\n var clip_segments = [];\n var num_clip_segments = 0;\n\n var in_segment = false;\n var start_idx = 0;\n var stop_idx = start_idx + block_size - 1;\n var block_idx = 0;\n\n var segment_start_idx = -1;\n var segment_stop_idx = -1;\n while(stop_idx < x_length) {\n // We are in a segment.\n if(in_segment) {\n // We leave the segment. Store it and move on.\n if(!AreOverlapping(clip_intervals, start_idx, stop_idx)) {\n in_segment = false;\n segment_stop_idx = block_idx - 1;\n\n var new_segment = { start:segment_start_idx , stop:segment_stop_idx };\n clip_segments[num_clip_segments] = new_segment;\n num_clip_segments++;\n\n segment_start_idx = -1;\n segment_stop_idx = -1;\n }\n }\n // We are not in a segment.\n else {\n // We have entered a segment.\n if(AreOverlapping(clip_intervals, start_idx, stop_idx)) {\n in_segment = true;\n segment_start_idx = block_idx;\n }\n }\n\n block_idx++;\n start_idx = start_idx + hop_size;\n stop_idx = start_idx + block_size - 1;\n }\n\n // If we end while in a segment, we need to leave the segment and push the segment.\n if(in_segment) {\n in_segment = false;\n segment_stop_idx = block_idx - 1;\n\n var new_segment = { start:segment_start_idx , stop:segment_stop_idx };\n clip_segments[num_clip_segments] = new_segment;\n num_clip_segments++;\n\n segment_start_idx = -1;\n segment_stop_idx = -1;\n }\n\n return clip_segments;\n }", "find_lv_segments(patient_data, id) {\n let graph = this.g.set_graph();\n for (let i = 0; i < patient_data.length; i++) {\n let native = patient_data[i];\n\n /////////\n graph.forEachNode((native, attributes) => {\n let group_aha = attributes['vessel_group_aha'];\n let native_id = attributes['id'];\n\n if (native_id == id) {\n for (let j = 0; j < vessel_lv_territories_aha.length; j++) {\n let lv_t_group = vessel_lv_territories_aha[j];\n\n if (lv_t_group['vessel_group_aha'] == group_aha) {\n this.color_lv_segments(lv_t_group);\n }\n }\n }\n });\n } //for i\n /////////////////////\n }", "onSegment(p, q, r) {\n if (q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) &&\n q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y))\n return true;\n\n return false;\n }", "function segments(x, y, rx, ry, large, sweep, rotateX, ox, oy) {\n\t var key = join.call(arguments);\n\t if (segmentCache[key]) {\n\t return segmentCache[key];\n\t }\n\n\t var th = rotateX * (Math.PI/180);\n\t var sin_th = Math.sin(th);\n\t var cos_th = Math.cos(th);\n\t rx = Math.abs(rx);\n\t ry = Math.abs(ry);\n\t var px = cos_th * (ox - x) * 0.5 + sin_th * (oy - y) * 0.5;\n\t var py = cos_th * (oy - y) * 0.5 - sin_th * (ox - x) * 0.5;\n\t var pl = (px*px) / (rx*rx) + (py*py) / (ry*ry);\n\t if (pl > 1) {\n\t pl = Math.sqrt(pl);\n\t rx *= pl;\n\t ry *= pl;\n\t }\n\n\t var a00 = cos_th / rx;\n\t var a01 = sin_th / rx;\n\t var a10 = (-sin_th) / ry;\n\t var a11 = (cos_th) / ry;\n\t var x0 = a00 * ox + a01 * oy;\n\t var y0 = a10 * ox + a11 * oy;\n\t var x1 = a00 * x + a01 * y;\n\t var y1 = a10 * x + a11 * y;\n\n\t var d = (x1-x0) * (x1-x0) + (y1-y0) * (y1-y0);\n\t var sfactor_sq = 1 / d - 0.25;\n\t if (sfactor_sq < 0) sfactor_sq = 0;\n\t var sfactor = Math.sqrt(sfactor_sq);\n\t if (sweep == large) sfactor = -sfactor;\n\t var xc = 0.5 * (x0 + x1) - sfactor * (y1-y0);\n\t var yc = 0.5 * (y0 + y1) + sfactor * (x1-x0);\n\n\t var th0 = Math.atan2(y0-yc, x0-xc);\n\t var th1 = Math.atan2(y1-yc, x1-xc);\n\n\t var th_arc = th1-th0;\n\t if (th_arc < 0 && sweep === 1){\n\t th_arc += 2 * Math.PI;\n\t } else if (th_arc > 0 && sweep === 0) {\n\t th_arc -= 2 * Math.PI;\n\t }\n\n\t var segs = Math.ceil(Math.abs(th_arc / (Math.PI * 0.5 + 0.001)));\n\t var result = [];\n\t for (var i=0; i<segs; ++i) {\n\t var th2 = th0 + i * th_arc / segs;\n\t var th3 = th0 + (i+1) * th_arc / segs;\n\t result[i] = [xc, yc, th2, th3, rx, ry, sin_th, cos_th];\n\t }\n\n\t return (segmentCache[key] = result);\n\t}", "function segments(x, y, rx, ry, large, sweep, rotateX, ox, oy) {\n var key = join.call(arguments);\n if (segmentCache[key]) {\n return segmentCache[key];\n }\n\n var th = rotateX * (Math.PI/180);\n var sin_th = Math.sin(th);\n var cos_th = Math.cos(th);\n rx = Math.abs(rx);\n ry = Math.abs(ry);\n var px = cos_th * (ox - x) * 0.5 + sin_th * (oy - y) * 0.5;\n var py = cos_th * (oy - y) * 0.5 - sin_th * (ox - x) * 0.5;\n var pl = (px*px) / (rx*rx) + (py*py) / (ry*ry);\n if (pl > 1) {\n pl = Math.sqrt(pl);\n rx *= pl;\n ry *= pl;\n }\n\n var a00 = cos_th / rx;\n var a01 = sin_th / rx;\n var a10 = (-sin_th) / ry;\n var a11 = (cos_th) / ry;\n var x0 = a00 * ox + a01 * oy;\n var y0 = a10 * ox + a11 * oy;\n var x1 = a00 * x + a01 * y;\n var y1 = a10 * x + a11 * y;\n\n var d = (x1-x0) * (x1-x0) + (y1-y0) * (y1-y0);\n var sfactor_sq = 1 / d - 0.25;\n if (sfactor_sq < 0) sfactor_sq = 0;\n var sfactor = Math.sqrt(sfactor_sq);\n if (sweep == large) sfactor = -sfactor;\n var xc = 0.5 * (x0 + x1) - sfactor * (y1-y0);\n var yc = 0.5 * (y0 + y1) + sfactor * (x1-x0);\n\n var th0 = Math.atan2(y0-yc, x0-xc);\n var th1 = Math.atan2(y1-yc, x1-xc);\n\n var th_arc = th1-th0;\n if (th_arc < 0 && sweep === 1) {\n th_arc += 2 * Math.PI;\n } else if (th_arc > 0 && sweep === 0) {\n th_arc -= 2 * Math.PI;\n }\n\n var segs = Math.ceil(Math.abs(th_arc / (Math.PI * 0.5 + 0.001)));\n var result = [];\n for (var i=0; i<segs; ++i) {\n var th2 = th0 + i * th_arc / segs;\n var th3 = th0 + (i+1) * th_arc / segs;\n result[i] = [xc, yc, th2, th3, rx, ry, sin_th, cos_th];\n }\n\n return (segmentCache[key] = result);\n }", "function segments(x, y, rx, ry, large, sweep, rotateX, ox, oy) {\n var key = join.call(arguments);\n if (segmentCache[key]) {\n return segmentCache[key];\n }\n\n var th = rotateX * (Math.PI/180);\n var sin_th = Math.sin(th);\n var cos_th = Math.cos(th);\n rx = Math.abs(rx);\n ry = Math.abs(ry);\n var px = cos_th * (ox - x) * 0.5 + sin_th * (oy - y) * 0.5;\n var py = cos_th * (oy - y) * 0.5 - sin_th * (ox - x) * 0.5;\n var pl = (px*px) / (rx*rx) + (py*py) / (ry*ry);\n if (pl > 1) {\n pl = Math.sqrt(pl);\n rx *= pl;\n ry *= pl;\n }\n\n var a00 = cos_th / rx;\n var a01 = sin_th / rx;\n var a10 = (-sin_th) / ry;\n var a11 = (cos_th) / ry;\n var x0 = a00 * ox + a01 * oy;\n var y0 = a10 * ox + a11 * oy;\n var x1 = a00 * x + a01 * y;\n var y1 = a10 * x + a11 * y;\n\n var d = (x1-x0) * (x1-x0) + (y1-y0) * (y1-y0);\n var sfactor_sq = 1 / d - 0.25;\n if (sfactor_sq < 0) sfactor_sq = 0;\n var sfactor = Math.sqrt(sfactor_sq);\n if (sweep == large) sfactor = -sfactor;\n var xc = 0.5 * (x0 + x1) - sfactor * (y1-y0);\n var yc = 0.5 * (y0 + y1) + sfactor * (x1-x0);\n\n var th0 = Math.atan2(y0-yc, x0-xc);\n var th1 = Math.atan2(y1-yc, x1-xc);\n\n var th_arc = th1-th0;\n if (th_arc < 0 && sweep === 1){\n th_arc += 2 * Math.PI;\n } else if (th_arc > 0 && sweep === 0) {\n th_arc -= 2 * Math.PI;\n }\n\n var segs = Math.ceil(Math.abs(th_arc / (Math.PI * 0.5 + 0.001)));\n var result = [];\n for (var i=0; i<segs; ++i) {\n var th2 = th0 + i * th_arc / segs;\n var th3 = th0 + (i+1) * th_arc / segs;\n result[i] = [xc, yc, th2, th3, rx, ry, sin_th, cos_th];\n }\n\n return (segmentCache[key] = result);\n}", "function segments(x, y, rx, ry, large, sweep, rotateX, ox, oy) {\n var key = join.call(arguments);\n if (segmentCache[key]) {\n return segmentCache[key];\n }\n\n var th = rotateX * (Math.PI/180);\n var sin_th = Math.sin(th);\n var cos_th = Math.cos(th);\n rx = Math.abs(rx);\n ry = Math.abs(ry);\n var px = cos_th * (ox - x) * 0.5 + sin_th * (oy - y) * 0.5;\n var py = cos_th * (oy - y) * 0.5 - sin_th * (ox - x) * 0.5;\n var pl = (px*px) / (rx*rx) + (py*py) / (ry*ry);\n if (pl > 1) {\n pl = Math.sqrt(pl);\n rx *= pl;\n ry *= pl;\n }\n\n var a00 = cos_th / rx;\n var a01 = sin_th / rx;\n var a10 = (-sin_th) / ry;\n var a11 = (cos_th) / ry;\n var x0 = a00 * ox + a01 * oy;\n var y0 = a10 * ox + a11 * oy;\n var x1 = a00 * x + a01 * y;\n var y1 = a10 * x + a11 * y;\n\n var d = (x1-x0) * (x1-x0) + (y1-y0) * (y1-y0);\n var sfactor_sq = 1 / d - 0.25;\n if (sfactor_sq < 0) sfactor_sq = 0;\n var sfactor = Math.sqrt(sfactor_sq);\n if (sweep == large) sfactor = -sfactor;\n var xc = 0.5 * (x0 + x1) - sfactor * (y1-y0);\n var yc = 0.5 * (y0 + y1) + sfactor * (x1-x0);\n\n var th0 = Math.atan2(y0-yc, x0-xc);\n var th1 = Math.atan2(y1-yc, x1-xc);\n\n var th_arc = th1-th0;\n if (th_arc < 0 && sweep === 1){\n th_arc += 2 * Math.PI;\n } else if (th_arc > 0 && sweep === 0) {\n th_arc -= 2 * Math.PI;\n }\n\n var segs = Math.ceil(Math.abs(th_arc / (Math.PI * 0.5 + 0.001)));\n var result = [];\n for (var i=0; i<segs; ++i) {\n var th2 = th0 + i * th_arc / segs;\n var th3 = th0 + (i+1) * th_arc / segs;\n result[i] = [xc, yc, th2, th3, rx, ry, sin_th, cos_th];\n }\n\n return (segmentCache[key] = result);\n}", "function segments(x, y, rx, ry, large, sweep, rotateX, ox, oy) {\n var key = join.call(arguments);\n if (segmentCache[key]) {\n return segmentCache[key];\n }\n\n var th = rotateX * (Math.PI/180);\n var sin_th = Math.sin(th);\n var cos_th = Math.cos(th);\n rx = Math.abs(rx);\n ry = Math.abs(ry);\n var px = cos_th * (ox - x) * 0.5 + sin_th * (oy - y) * 0.5;\n var py = cos_th * (oy - y) * 0.5 - sin_th * (ox - x) * 0.5;\n var pl = (px*px) / (rx*rx) + (py*py) / (ry*ry);\n if (pl > 1) {\n pl = Math.sqrt(pl);\n rx *= pl;\n ry *= pl;\n }\n\n var a00 = cos_th / rx;\n var a01 = sin_th / rx;\n var a10 = (-sin_th) / ry;\n var a11 = (cos_th) / ry;\n var x0 = a00 * ox + a01 * oy;\n var y0 = a10 * ox + a11 * oy;\n var x1 = a00 * x + a01 * y;\n var y1 = a10 * x + a11 * y;\n\n var d = (x1-x0) * (x1-x0) + (y1-y0) * (y1-y0);\n var sfactor_sq = 1 / d - 0.25;\n if (sfactor_sq < 0) sfactor_sq = 0;\n var sfactor = Math.sqrt(sfactor_sq);\n if (sweep == large) sfactor = -sfactor;\n var xc = 0.5 * (x0 + x1) - sfactor * (y1-y0);\n var yc = 0.5 * (y0 + y1) + sfactor * (x1-x0);\n\n var th0 = Math.atan2(y0-yc, x0-xc);\n var th1 = Math.atan2(y1-yc, x1-xc);\n\n var th_arc = th1-th0;\n if (th_arc < 0 && sweep === 1){\n th_arc += 2 * Math.PI;\n } else if (th_arc > 0 && sweep === 0) {\n th_arc -= 2 * Math.PI;\n }\n\n var segs = Math.ceil(Math.abs(th_arc / (Math.PI * 0.5 + 0.001)));\n var result = [];\n for (var i=0; i<segs; ++i) {\n var th2 = th0 + i * th_arc / segs;\n var th3 = th0 + (i+1) * th_arc / segs;\n result[i] = [xc, yc, th2, th3, rx, ry, sin_th, cos_th];\n }\n\n return (segmentCache[key] = result);\n}", "function segments(x, y, rx, ry, large, sweep, rotateX, ox, oy) {\n var key = join.call(arguments);\n if (segmentCache[key]) {\n return segmentCache[key];\n }\n\n var th = rotateX * (Math.PI/180);\n var sin_th = Math.sin(th);\n var cos_th = Math.cos(th);\n rx = Math.abs(rx);\n ry = Math.abs(ry);\n var px = cos_th * (ox - x) * 0.5 + sin_th * (oy - y) * 0.5;\n var py = cos_th * (oy - y) * 0.5 - sin_th * (ox - x) * 0.5;\n var pl = (px*px) / (rx*rx) + (py*py) / (ry*ry);\n if (pl > 1) {\n pl = Math.sqrt(pl);\n rx *= pl;\n ry *= pl;\n }\n\n var a00 = cos_th / rx;\n var a01 = sin_th / rx;\n var a10 = (-sin_th) / ry;\n var a11 = (cos_th) / ry;\n var x0 = a00 * ox + a01 * oy;\n var y0 = a10 * ox + a11 * oy;\n var x1 = a00 * x + a01 * y;\n var y1 = a10 * x + a11 * y;\n\n var d = (x1-x0) * (x1-x0) + (y1-y0) * (y1-y0);\n var sfactor_sq = 1 / d - 0.25;\n if (sfactor_sq < 0) sfactor_sq = 0;\n var sfactor = Math.sqrt(sfactor_sq);\n if (sweep == large) sfactor = -sfactor;\n var xc = 0.5 * (x0 + x1) - sfactor * (y1-y0);\n var yc = 0.5 * (y0 + y1) + sfactor * (x1-x0);\n\n var th0 = Math.atan2(y0-yc, x0-xc);\n var th1 = Math.atan2(y1-yc, x1-xc);\n\n var th_arc = th1-th0;\n if (th_arc < 0 && sweep === 1){\n th_arc += 2 * Math.PI;\n } else if (th_arc > 0 && sweep === 0) {\n th_arc -= 2 * Math.PI;\n }\n\n var segs = Math.ceil(Math.abs(th_arc / (Math.PI * 0.5 + 0.001)));\n var result = [];\n for (var i=0; i<segs; ++i) {\n var th2 = th0 + i * th_arc / segs;\n var th3 = th0 + (i+1) * th_arc / segs;\n result[i] = [xc, yc, th2, th3, rx, ry, sin_th, cos_th];\n }\n\n return (segmentCache[key] = result);\n}", "executeMidpoint()\n {\n let vertices = this.vertices;\n let colors = this.colors;\n let indices = this.indices;\n let normals = this.normals;\n\n // Prapare point A and point B of the segment\n let a = [this.ax, this.initializeY(), this.depth];\n let b = [this.bx, this.initializeY(), this.depth];\n\n // Add the point A to the vertices (first to set in the list)\n vertices.push(a[0], a[1], a[2]);\n colors.push(1.0, 0.0, 0.0, 1.0);\n indices.push(this.indices.length);\n normals.push(0.0, 0.0, 0.0);\n\n // Execute midpoint algo. (recursive)\n this.recursiveCompute(a, b, this.displacement);\n\n // Add the point B to the vertices (last to set in the list)\n vertices.push(b[0], b[1], b[2]);\n colors.push(1.0, 0.0, 0.0, 1.0);\n indices.push(indices.length);\n normals.push(0.0, 0.0, 0.0);\n }", "function isProjectedPointOnSegment(c, a, b) {\n var ab = b.subtract(a);\n var ac = c.subtract(a);\n var t = ac.dot(ab) / ab.dot(ab);\n return t >= 0 && t <= 1;\n}", "function k(b,c){for(var d=0;d<b.length;d++){var e=b[d],f=e.event,g=c.eq(d),h=z(\"eventRender\",f,f,g);h===!1?\n// if `false`, remove the event from the DOM and don't assign it to `segment.event`\ng.remove():(h&&h!==!0&&(\n// the trigger returned a new element, but not `true` (which means keep the existing element)\n// re-assign the important CSS dimension properties that were already assigned in `buildHTMLForSegment`\nh=a(h).css({position:\"absolute\",left:e.left}),g.replaceWith(h),g=h),e.element=g)}}", "static subdivide()\n {\n if (Flag.G >= 33) return false;\n\n let newG = (Flag.G - 1) * 2 + 1\n let newL = Flag.L / 2;\n\n Flag.flags.forEach((f) => {\n f.subdivide(newG, newL)\n })\n\n Flag.G = newG\n Flag.L = newL\n\t\n\tif(!Flag.useSimple) Flag.resdex++;\n\t\n return true;\n }", "set_variant_segment(field, normal_segment) {\n\n let graph = this.g.set_graph();\n\n let a_variant = this.db_anatomy_data[field]\n if (a_variant == 'undefined' || a_variant == null) {\n let default_variant = normal_segment;\n let d_node = graph.getNodeAttributes(default_variant);\n return d_node;\n }\n\n if (this.db_lesion_data.length !== 0 &&\n this.db_lesion_data.length !== null\n ) {\n\n for (let i = 0; i < this.db_lesion_data.length; i++) {\n let d_i = this.db_lesion_data[i];\n let a_node = graph.getNodeAttributes(a_variant);\n return a_node;\n } //for lesion_data\n }\n }", "function addSegment(segment) {\n\t\t\t\n\t\t// create canvas element used to visualize the frames of \n\t\t// the given segment + its timecodes\n\t\tvar item = document.createElement('canvas');\n\t\titem.width = 1000;\n\t\titem.height = 200;\n\t\t\n\t\t// input field for description of a segment\n\t\tvar input = document.createElement('input');\n\t\tinput.type = 'text';\n\t\tinput.placeholder = 'description';\n\t\tinput.className = 'description';\n\t\tinput.value = segment.description;\n\t\tinput.id = '' + segment.id;\n\t\tinput.width = 500;\n\t\t\n\t\t// draw segment frames of the video\n\t\tvar context = item.getContext(\"2d\");\n\t\tcontext.drawImage(segment.startFrame.image, 10, 10, 150, 150);\n\t\tcontext.drawImage(segment.endFrame.image, 170, 10, 150, 150);\n\t\t\n\t\t// draw timecode as text\n\t\tcontext.font = \"20px Arial\";\n\t\tcontext.fillStyle = 'Black';\n\t\tcontext.fillText(segment.startFrame.asText() + ' - ' + segment.endFrame.asText(), 10, 190);\n\t\t\n\t\tvar div = document.createElement('div');\n\t\tdiv.className = 'element';\n\t\tdiv.setAttribute('data-start', segment.startFrame.second);\n\t\tdiv.setAttribute('data-end', segment.endFrame.second);\n\t\tdiv.id = 'div' + segment.id;\n\t\t\n\t\t// logic for button showing the up arrow\n\t\tvar up_arrow = document.createElement('button');\n\t\tup_arrow.type = 'button';\n\t\tup_arrow.innerHTML = '&uarr;'\n\t\tup_arrow.setAttribute('data-id', segment.id);\n\t\tvar index = segments.indexOf(segment);\n\t\tup_arrow.disabled = index == 0;\n\t\tup_arrow.addEventListener('click', \n\t\tfunction() {\n\t\t\tvar segment_id = this.getAttribute('data-id');\n\t\t\tvar se = getSegmentById(segment_id);\n\t\t\tvar index_se = segments.indexOf(se);\n\t\t\tif (index_se <= 0) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tswapSegments(index_se, index_se - 1);\n\t\t\trepaintSegments();\n\t\t},\n\t\tfalse);\n\t\t\n\t\t// logic for button showing the down arrow\n\t\tvar down_arrow = document.createElement('button');\n\t\tdown_arrow.type = 'button';\n\t\tdown_arrow.innerHTML = '&darr;'\n\t\tdown_arrow.setAttribute('data-id', segment.id);\n\t\tdown_arrow.disabled = index == segments.length - 1;\n\t\tdown_arrow.addEventListener('click', \n\t\tfunction() {\n\t\t\tvar segment_id = this.getAttribute('data-id');\n\t\t\tvar se = getSegmentById(segment_id);\n\t\t\tvar index_se = segments.indexOf(se);\n\t\t\tif (index_se >= segments.length - 1) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tswapSegments(index_se, index_se + 1);\n\t\t\trepaintSegments();\n\t\t},\n\t\tfalse);\n\t\t\n\t\t// logic for remove button -> removes a segment\n\t\tvar remove = document.createElement('button');\n\t\tremove.type = 'button';\n\t\tremove.innerHTML = '-';\n\t\tremove.setAttribute('data-id', segment.id);\n\t\tremove.style.color = 'red',\n\t\tremove.addEventListener('click', \n\t\tfunction() {\n\t\t\tvar segment_id = this.getAttribute('data-id');\n\t\t\tvar se = getSegmentById(segment_id);\n\t\t\tvar index_se = segments.indexOf(se);\n\t\t\t// Find and remove item from an array\n\t\t\tif(index_se >= 0 && index_se < segments.length) {\n\t\t\t\tsegments.splice(index_se, 1);\n\t\t\t\tavailable_ids.push(se.id);\n\t\t\t\tremoveSegment(se);\n\t\t\t\trepaintSegments();\n\t\t\t}\n\t\t},\n\t\tfalse);\n\t\t\n\t\tdiv.appendChild(item);\n\t\tdiv.appendChild(input);\n\t\tdiv.appendChild(up_arrow);\n\t\tdiv.appendChild(down_arrow);\n\t\tdiv.appendChild(remove);\n\t\t\n\t\t// add the new segment div to the list of div objects\n\t\tcontainer.appendChild(div);\n\t}" ]
[ "0.6690998", "0.5910908", "0.5853755", "0.56974405", "0.5675473", "0.5634244", "0.5618745", "0.558083", "0.55739903", "0.55590624", "0.5554786", "0.55431694", "0.54993105", "0.54791415", "0.5475969", "0.54666835", "0.5439648", "0.54382384", "0.54382384", "0.54143935", "0.5412808", "0.53959316", "0.53936464", "0.53936464", "0.53936464", "0.53936464", "0.5360921", "0.53477925", "0.53411704", "0.53344625", "0.53235275", "0.53165156", "0.5297992", "0.52857655", "0.5278992", "0.52758956", "0.527349", "0.5270045", "0.5261049", "0.52272487", "0.52126133", "0.5206076", "0.51828474", "0.5164368", "0.5153546", "0.51468694", "0.5143466", "0.509335", "0.50882185", "0.5081999", "0.50761324", "0.5066044", "0.50493956", "0.504185", "0.50381", "0.5030935", "0.5030902", "0.50198597", "0.501324", "0.49978763", "0.4995412", "0.49920544", "0.49877366", "0.49798498", "0.49798125", "0.4976521", "0.4972356", "0.49657843", "0.49620637", "0.49457264", "0.4929784", "0.491029", "0.49086028", "0.4906773", "0.49047711", "0.49036315", "0.49027064", "0.49018967", "0.49018928", "0.49005303", "0.48919606", "0.4890869", "0.48862818", "0.48747286", "0.48745772", "0.48701254", "0.48690283", "0.48678386", "0.4863153", "0.48621735", "0.48612", "0.4860788", "0.4860788", "0.4860788", "0.4860788", "0.4859921", "0.48587897", "0.4850835", "0.4849881", "0.48476267", "0.48457825" ]
0.0
-1
TODO: move to eventstore file?
function eventStoreToRanges(eventStore) { var instances = eventStore.instances; var ranges = []; for (var instanceId in instances) { ranges.push(instances[instanceId].range); } return ranges; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "dumpEvents(filename) {\n const config = this.getConfigFor(filename);\n const resolved = config.resolve();\n const source = resolved.transformFilename(filename);\n const engine = new Engine(resolved, Parser);\n return engine.dumpEvents(source);\n }", "async function saveEvent(eventObj) {\n console.log(\"Saving event in firestore\")\n const doc = await db.collection('users').doc(currentUser.uid).collection('events').add({\n eventTitle: eventObj.eventTitle,\n eventDescription: eventObj.eventDescription,\n startTime: eventObj.startTime,\n endTime: eventObj.endTime\n })\n \n // Saving the data locally in indexDb\n // localStorage.setItem(doc.id, JSON.stringify(eventObj))\n localDb.collection('events').doc(doc.id).set(eventObj)\n }", "onEventCreated(newEventRecord) {}", "function updateEvents() {\n var e = {};\n\t\n\tstore.forEach(function(id, event) {\n\t\te[event.date] = {\n\t\t\t'number': event.name,\n\t\t\t'url': event.url\n\t\t};\n\n\t});\n\t\n\treturn e;\n}", "get store() {\n return this.client.eventStore;\n }", "get store() {\n return this.client.eventStore;\n }", "function updateEvent(event){\n fs.readFile('data/data.json', 'utf8', function (err,data) {\n if (err) {\n return console.log(err);\n }\n events = JSON.parse(data).events;\n for (i = 0; i < events.length; i++) {\n if (events[i].id == event.id) {\n events[i] = event;\n parsedData.events = events;\n fs.writeFileSync('data/data.json', JSON.stringify(parsedData));\n }\n }\n });\n}", "function EventDict() {}", "pushEvent(eventdata) {\n var data = fs.readFileSync('./database/events.json', 'utf-8');\n data = JSON.parse(data);\n const newdata = {\n eventname: eventdata.eventname,\n eventtype: eventdata.eventtype,\n eventdate: eventdata.eventdate,\n eventtime: eventdata.eventtime,\n eventnote: eventdata.eventnote\n }\n console.log(eventdata);\n data[eventdata.email].push(newdata);\n\n fs.writeFileSync('./database/events.json', JSON.stringify(data, null, 4));\n }", "function saveEvents() {\n localStorage.setItem(\"EVENTS\", JSON.stringify(events));\n}", "mapStoreEvents() {\n\t\tconst events = this.handleStoreEvents();\n\t\tfor (const eventType in events) {\n\t\t\t/* eslint-disable no-prototype-builtins */\n\t\t\tif (events.hasOwnProperty(eventType)) {\n\t\t\t\tthis.storage.on(eventType, events[eventType]);\n\t\t\t}\n\t\t}\n\t}", "function getEvents(callback){\n\tfs.readFile('data/data.json', 'utf8', function (err, data) {\n \tif (err) {\n \treturn console.log(err);\n \t}\n \t\tparsedData = JSON.parse(data);\n\t\t callback(parsedData.events)\n\t});\n}", "function createEvent(name, location, description, email){\n fs.readFile('data/data.json', 'utf8', function (err, data) {\n \n if (err) {\n return console.log(err);\n }\n parsedData = JSON.parse(data);\n var id = parsedData.events[parsedData.events.length-1].id + 1\n var event = new Event(name, location, description, email, id, [\"User [User@Example.com]\"]);\n parsedData.events.push(event);\n fs.writeFileSync('data/data.json', JSON.stringify(parsedData));\n //callback(parsedData.events)\n });\n}", "static getEvents() {\n let events =\n localStorage.getItem(\"events\") === null\n ? []\n : JSON.parse(localStorage.getItem(\"events\"));\n\n return events;\n }", "function saveEvent(id, event) {\n let eventObj = {\n id: id,\n event: event\n };\n\n events.push(eventObj);\n localStorage.setItem(\"events\", JSON.stringify(events));\n}", "function EventReader() {}", "eventExtras(type) {\n return {\n 'type': type,\n 'timestamp': new Date().getTime()\n };\n }", "function formatEvents() {\n var events = [];\n for (i = 0; i < array[\"file\"].data.length; i++) {\n var event = {};\n var timestamp = formatDate(array[\"file\"].data[i].timestamp)\n event.action = array[\"file\"].data[i].itemAction;\n event.flags = {\"noCampaigns\": true, \"pageView\": true}\n event.source = { \"channel\": \"Web\", \"local\": \"enGB\", \"time\": timestamp.getTime(), \"top\":array[\"file\"].data[i].viewTime}\n\n // user identifiers\n if(array[\"file\"].data[i].userType == 'Known'){\n event.user = {\"id\": array[\"file\"].data[i].userId} \n event.user.attributes = {\"emailAddress\": array[\"file\"].data[i].emailAddress,\"sfmcContactKey\": array[\"file\"].data[i].sfmcContactKey}\n } else {\n event.user = {\"anonId\": array[\"file\"].data[i].userId}\n }\n\n // user identifiers\n if(array[\"file\"].data[i].attributes != ''){\n var attributes = $.parseJSON(array[\"file\"].data[i].attributes);\n $.each(Object.keys(attributes), function(index, value ) {\n event.user.attributes[value] = attributes[value];\n });\n }\n\n // include itemAction value where applicable\n if(event.action == 'Purchase' || event.action == 'Update Cart' || event.action == 'View Item'){\n event.itemAction = event.action;\n event.catalog = {};\n event.catalog[array[\"file\"].data[i].catalogType] = {\"_id\": array[\"file\"].data[i].catalogItemId}\n }\n\n // Add in Page options\n if(event.action == 'Page View' && array[\"file\"].data[i].page !=''){\n event.page = array[\"file\"].data[i].page;\n }\n\n // Add in Order node if required\n if(event.action == 'Purchase'){\n event.order = {}\n event.order[array[\"file\"].data[i].catalogType] = {\n \"orderId\": createID(),\n \"totalValue\": array[\"file\"].data[i].price,\n \"currency\": \"GBP\",\n \"lineItems\": [{\"quantity\": 1, \"_id\": array[\"file\"].data[i].catalogItemId, \"price\":array[\"file\"].data[i].price}]\n }\n }\n // Add in Cart node if required\n if(event.action == 'Update Cart'){\n event.cart = {\"singleLine\": {}};\n event.cart.singleLine[array[\"file\"].data[i].catalogType] = {\n \"quantity\": 1, \n \"_id\": array[\"file\"].data[i].catalogItemId,\n \"price\":array[\"file\"].data[i].price\n }\n }\n\n // push event to global array\n events.push(event);\n }\n array.events = events;\n console.log(array);\n}", "function constroiEventos(){}", "function storeEvents(savedEvents){\n window.localStorage.setItem(\"savedEventsArray\", JSON.stringify(eventsArray)); \n }", "fetchEvents(ctx) {\n let options = {\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-Master-Key\": ctx.state.apiKey,\n \"X-Bin-Versioning\": \"false\"\n }\n }\n ax.get(`${ctx.state.apiUrl}`, options).then(data => {\n ctx.commit('showEvents', data.data.record.events)\n })\n\n }", "getEvent(id) {\r\n return apiClient.get(\"/events/\" + id);\r\n }", "_updateJSON(filename) {\n return __awaiter(this, void 0, void 0, function* () {\n //dbnames have to be lowercase and start with letters\n let dbname = \"couch\" + filename.toLowerCase().split(\".\")[0];\n let githash = yield Git_1.default.getFileHash(path.join(this.localRepoPath, \"/data/\", filename), this.localRepoPath);\n let inCouch = yield this._isInCouch(dbname, this.EVENT_METADATA_ID);\n let outOfDate;\n if (inCouch) {\n outOfDate = yield this._isOutofDate(dbname, this.EVENT_METADATA_ID, githash);\n }\n if (!inCouch || outOfDate) {\n let data = yield readFile(path.join(this.localRepoPath, \"/data/\", filename), \"utf8\");\n let json = JSON.parse(data.replace(/&quot;/g, '\\\\\"'));\n json[\"githash\"] = githash;\n let eventProccesor = new EventParser_1.default(json);\n if (eventProccesor.error)\n throw new Error(\"Event for \" + dbname + \" had error parsing event\");\n if (!inCouch)\n yield this._insertEvent(dbname, eventProccesor.parsedEvent);\n if (outOfDate)\n yield this._updateEvent(dbname, eventProccesor.parsedEvent);\n }\n });\n }", "function getEventInfo(eventId) {\n var params = {\n Bucket: 'training-schedule',\n Key: 'ready/current-schedule.csv',\n Expression: 'select * from s3object s where \"Event ID\" = \\'' + eventId + '\\'',\n ExpressionType: \"SQL\", \n InputSerialization: { CSV: {} },\n OutputSerialization: { JSON: {} }\n };\n s3.selectObjectContent(params, function(err, data) {\n if (err) console.log(err, err.stack); // an error occurred\n else {\n console.log(data); // successful response\n var eventStream = data.Payload;\n\n eventStream.on('data', function(event) {\n // Check the top-level field to determine which event this is.\n if (event.Records) {\n // handle Records event\n console.log('this is the payload: ' + event.Records.Payload);\n }\n });\n \n } \n });\n}", "function getSingleEvent() {\n return {\n type: \"FETCH_SINGLE_EVENT\"\n };\n}", "async function findEventsFromStore(filesReadTokenSecret: string, \n isStreamIdPrefixBackwardCompatibilityActive: boolean, isTagsBackwardCompatibilityActive: boolean,\n context: MethodContext, params: GetEventsParams, result: Result, next: ApiCallback) {\n if (params.arrayOfStreamQueriesWithStoreId?.length === 0)  {\n result.events = [];\n return next();\n }\n\n // in> params.fromTime = 2 params.streams = [{any: '*' storeId: 'local'}, {any: 'access-gasgsg', storeId: 'audit'}, {any: 'action-events.get', storeId: 'audit'}]\n const paramsByStoreId: Map<string, GetEventsParams> = {};\n for (const streamQuery: StreamQueryWithStoreId of params.arrayOfStreamQueriesWithStoreId) {\n const storeId: string = streamQuery.storeId;\n if (storeId == null) {\n console.error('Missing storeId' + params.arrayOfStreamQueriesWithStoreId);\n throw(new Error(\"Missing storeId\" + params.arrayOfStreamQueriesWithStoreId));\n }\n if (paramsByStoreId[storeId] == null) {\n paramsByStoreId[storeId] = _.cloneDeep(params); // copy the parameters\n paramsByStoreId[storeId].streams = []; // empty the stream query\n }\n delete streamQuery.storeId; \n paramsByStoreId[storeId].streams.push(streamQuery);\n }\n // out> paramsByStoreId = { local: {fromTime: 2, streams: [{any: '*}]}, audit: {fromTime: 2, streams: [{any: 'access-gagsg'}, {any: 'action-events.get}]}\n\n\n /**\n * Will be called by \"mall\" for each source of event that need to be streames to result\n * @param {Store} store\n * @param {ReadableStream} eventsStream of \"Events\"\n */\n function addnewEventStreamFromSource (store, eventsStream: ReadableStream) {\n let stream: ReadableStream = eventsStream;\n if (isStreamIdPrefixBackwardCompatibilityActive && !context.disableBackwardCompatibility) {\n stream = eventsStream.pipe(new ChangeStreamIdPrefixStream());\n } \n if (isTagsBackwardCompatibilityActive) {\n stream = stream.pipe(new addTagsStream());\n }\n stream = stream.pipe(new SetSingleStreamIdStream());\n if (store.settings?.attachments?.setFileReadToken) {\n stream = stream.pipe(new SetFileReadTokenStream({ access: context.access, filesReadTokenSecret }));\n }\n result.addToConcatArrayStream('events', stream);\n }\n\n await mall.events.generateStreams(context.user.id, paramsByStoreId, addnewEventStreamFromSource);\n result.closeConcatArrayStream('events');\n\n return next();\n}", "function loadEvents() {\n let eventString = localStorage.getItem(\"EVENTS\");\n if (eventString !== null) {\n events = JSON.parse(eventString);\n for (let event of events) {\n // note - JSON.stringify converts all our\n // moment() objects to strings. We need to\n // turn those strings into moment objects again!\n event.start = moment.utc(event.start);\n event.end = moment.utc(event.end);\n }\n }\n}", "async store ({ request }) {\n console.log(request)\n const data = request.only([\n 'title',\n 'description'\n ])\n\n const images = request.file('image', {\n types: ['image'],\n size: '2mb'\n })\n\n await images.move(Helpers.tmpPath('uploads'), {\n name: `${Date.now()}-eventPicture.jpg`\n })\n \n if (!images.moved()) {\n return images.errors()\n }\n\n const image = await Image.create({ path: images.fileName })\n console.log(image.path)\n const event = await Event.create({ title: data.title, description: data.description, image_id: image.id })\n\n return event\n }", "function loadEvents() {\n //If there's nothing stored, set storedEvents to an empty string.\n if(!storedEvents){\n storedEvents = \"|||||||||\";\n localStorage.setItem(\"storedEvents\", storedEvents);\n return;\n }\n //Otherwise, split up the string of stored events into an array\n eventsArray = storedEvents.split(\"|\");\n\n //Loop through the array and \n\n}", "function getEventDetails(events){\n events.forEach(event => {\n // addEvent(event.title, event.date, event.time,event.id)\n });\n }", "function readEvents() {\n if ('localStorage' in window && window['localStorage'] !== null) {\n window.localStorage.getItem(\"events\");\n } else {\n alert('This browser does NOT support localStorage');\n }\n}", "function sendEvent() {\n initDatabase();\n\n //create event JSON\n var event = {\n username: document.getElementById(\"eventUsername\").value,\n firstname: document.getElementById(\"eventfirstname\").value,\n surname: document.getElementById(\"eventSurname\").value,\n eventName: document.getElementById(\"eventName\").value,\n startdate: document.getElementById(\"eventstartdate\").value,\n enddate: document.getElementById(\"eventenddate\").value,\n description: document.getElementById(\"eventDescription\").value,\n img: \"No Picture\",\n location: document.getElementById(\"eventLocation\").value,\n city: document.getElementById(\"eventCity\").value,\n postcode: document.getElementById(\"eventPostcode\").value\n };\n\n //add event JSON to indexedDB\n addEvent(event);\n}", "getEvents() {\n\t\treturn this.metadata.events || {};\n\t}", "function MemoryEventPersistence() {\n this.events = [];\n this.nextVersionToHandOut = 1;\n}", "RegisterEventSource() {\n\n }", "function loadEvents() {\n API.getDj(user.sub)\n .then((res) => {\n setEvents(res.data[0].events);\n })\n .catch((err) => console.log(err));\n }", "function loadMySavedEdaFieldsModel(){\n return DefineEventService.getEventDefinition();\n }", "get taskStore() {\n return this.project.eventStore;\n }", "static initEventSquareMaster (store) {\n if (TRHMasterData.masterData === null) return\n TRHMasterData.EventSquare = _(TRHMasterData.masterData.EventSquareMaster)\n .split('\\n')\n .map((line) => {\n let arr = line.split(',')\n let obj = {}\n obj['episodeId'] = _.toInteger(arr[0])*(-1)\n obj['fieldId'] = _.toInteger(arr[1])\n obj['layerNum'] = _.toInteger(arr[2])\n obj['squareId'] = _.toInteger(arr[3])\n obj['category'] = _.toInteger(arr[4])\n obj['itemType'] = _.toInteger(arr[5])\n obj['itemId'] = _.toInteger(arr[6])\n obj['itemNum'] = _.toInteger(arr[7])\n obj['bgmId'] = _.toInteger(arr[8])\n return obj\n })\n .groupBy('episodeId')\n .mapValues((val) => {\n return _(val)\n .groupBy('fieldId')\n .mapValues((v) => {\n return _(v)\n .groupBy('layerNum')\n .mapValues((vv) =>{\n return _(vv)\n .keyBy('squareId')\n .value()\n })\n .value()\n })\n .value()\n })\n .value()\n return localforage.setItem('EventSquareMaster', TRHMasterData.EventSquare)\n .then(() => {\n console.log(TRHMasterData.EventSquare)\n store.commit('loadData', {\n key: 'EventSquare',\n loaded: true\n })\n })\n .catch((err) => {\n console.log('err', err)\n store.commit('loadData', {\n key: 'EventSquare',\n loaded: false\n })\n })\n }", "function saveEvent(key, event) {\n var currentEvents = JSON.parse(localStorage.getItem(\"events\"));\n console.log(\"currentEvents:::\");\n console.log(currentEvents);\n currentEvents = $.extend(currentEvents, event);\n localStorage.setItem(key, JSON.stringify(currentEvents));\n}", "function archiveEvent(n) {\n//add ~ to events name\nEvents[n].name=\"~ \"+Events[n].name;\n//archive event\narchive.push(Events[n]);\n//remove it from the register of actual events\nEvents.splice(n,1);\nconsole.log(\"\\nEvent with id = \"+n+\" succesfully archived.\");\n}", "function storeEvents() {\n localStorage.setItem(\"allEvents\", JSON.stringify(allEvents));\n localStorage.setItem(\"today\", JSON.stringify(today));\n}", "function addEvent(db, event) {\n // add the actual event to the DB as an entity\n let eventEntity = {':db/id': -1};\n for (let prop of Object.keys(event)) {\n // add all properties of event (except effects and tags) to DB\n if (['effects', 'tags'].indexOf(prop) !== -1) continue;\n eventEntity[prop] = event[prop];\n }\n db = datascript.db_with(db, [eventEntity]);\n let eventID = newestEID(db);\n // process the event's effects\n for (let effect of event.effects || []){\n effect.cause = eventID;\n db = processEffect(db, effect);\n db = updateProperty(db, eventID, 'tag', effect.type); // automatically add an event tag for each effect\n }\n // add the event's tags to the DB\n for (let tag of event.tags || []) {\n db = updateProperty(db, eventID, 'tag', tag);\n }\n return db;\n}", "function storeEvents(eventsData) {\n var jsonString = JSON.stringify(eventsData)\n if ('localStorage' in window && window['localStorage'] !== null) {\n localStorage.setItem(\"events\", jsonString);\n } else {\n alert('This browser does NOT support localStorage');\n }\n}", "setEvents(state, payload) {\n //console.log(payload);\n state.events = payload;\n }", "function dEventDataTransform(event) {\n event.start = event.startTime;\n event.end = event.endTime;\n event.title = 'ID: ' + event.practiceSessionID;\n return event;\n}", "async registerEvents() {\n xtsMarketDataWS.onConnect((connectData) => {\n console.log(connectData, \"connectData\");\n });\n\n xtsMarketDataWS.onJoined((joinedData) => {\n console.log(joinedData, \"joinedData\");\n });\n\n xtsMarketDataWS.onMarketDepthEvent((marketDepthData) => {\n console.log(marketDepthData, \"marketDepthData\");\n });\n\n xtsMarketDataWS.onError((errorData) => {\n console.log(errorData, \"errorData\");\n });\n\n xtsMarketDataWS.onDisconnect((disconnectData) => {\n console.log(disconnectData, \"disconnectData\");\n });\n\n xtsMarketDataWS.onLogout((logoutData) => {\n console.log(logoutData, \"logoutData\");\n });\n }", "async store ({ request, response, auth }) {\n const data = request.only(['title', 'location', 'datetime'])\n\n const existingEvents = await Event.checkExistingEvents(\n auth.user,\n data.datetime\n )\n\n if (existingEvents) {\n return response.status(401).send({\n error: {\n message: \"It's not possible create two events in the same time\"\n }\n })\n }\n\n const event = await Event.create({ ...data, user_id: auth.user.id })\n\n return event\n }", "onStoreChange(event) {\n this.scheduler.onInternalEventStoreChange(event);\n }", "onStoreChange(event) {\n this.scheduler.onInternalEventStoreChange(event);\n }", "function massageEvent(data) {\n // data is an object mapping basefilename: full file path\n // we want to return\n //\n // {\n // start: <start time in ms since epoch>\n // duration: <event duration in s || null if the event is ongoing>,\n // updates: [\n // { when: <comment time in ms since epoch>, msg: <textual comment> },\n // { when: <comment time in ms since epoch>, msg: <textual comment> },\n // { when: <comment time in ms since epoch>, msg: <textual comment> },\n // { when: <comment time in ms since epoch>, msg: <textual comment> }\n // ]\n // }\n\n var o = {};\n \n var updates = [];\n\n // explicitly parse discovery document\n var update = readUpdate(data.discovery);\n o.start = update.when;\n updates.push(update);\n delete data.discovery;\n \n if (data.resolution) {\n update = readUpdate(data.resolution);\n if (update.when < o.start) throw \"event cannot be resolved before it starts\";\n o.duration = update.when - o.start;\n updates.push(update);\n delete data.resolution;\n }\n\n // read and parse all the remaining updates\n Object.keys(data).forEach(function(k) {\n var update = readUpdate(data[k]);\n if (update.when < o.start ||\n (o.duration && update.when > (o.duration + o.start))) {\n throw \"event updates must occur during an event, not before or after.\";\n }\n updates.push(update);\n });\n\n // sort updates and attach them\n o.updates = updates.sort(function(l,r) {\n return l.when < r.when;\n });\n\n return o;\n}", "async commit(events) {\n assert.array(events, 'events')\n const eventStreamWithoutSnapshots = await this.save(events)\n await this.publish(eventStreamWithoutSnapshots)\n return eventStreamWithoutSnapshots\n }", "createEvent(text) {\n const id = Date.now(); // TODO not great\n this.events.push({\n id,\n text,\n complete: false,\n });\n\n this.emit(\"change\");\n }", "function readEvents(callback) {\n fs.readFile('calendar.json', 'utf8', function(err, data){\n if(err) {\n callback(err, data);\n }\n var events = JSON.parse(data).events;\n callback(err, events);\n });\n}", "fileLoaded(event)\n {\n // event.result is the final object that was created after loading \n //console.log(event.result); \n }", "function getItems(createEvent) {\n eventdb.find({}, (err, eventArr) => {\n if (err) {\n console.log(err);\n return;\n }\n createEvent(eventArr);\n })\n }", "notificationEvents(state) {\n const url = 'http://localhost:3000/reservations/notification'\n const sse = new EventSource(url)\n /* To listen to the named event \"reservationAdded\" */\n sse.addEventListener(\"reservationAdded\", (e) => {\n state.notifications.push(JSON.parse(e.data))\n })\n sse.addEventListener(\"message\", (e) => {\n console.log('MESSAGE')\n console.log(e.data)\n })\n sse.addEventListener(\"rUpdate\", () => {\n this.dispatch('getReservations')\n })\n }", "function EventInfo() { }", "function EventInfo() { }", "_updateEvent(dbname, event) {\n return __awaiter(this, void 0, void 0, function* () {\n let documentsToUpdate = [this.EVENT_METADATA_ID, this.EVENT_ITEMS_ID, this.EVENT_PEOPLE_ID, this.EVENT_SESSIONS_ID];\n documentsToUpdate.forEach((documentName) => __awaiter(this, void 0, void 0, function* () {\n let couchVersion = yield this.couchdb.getDocument(dbname, documentName);\n let gitVersion = event[documentName];\n if (!deepEqual(couchVersion[documentName], gitVersion, { strict: true })) {\n let toUpdate = {};\n toUpdate[documentName] = event[documentName];\n toUpdate[\"_rev\"] = couchVersion.data[\"_rev\"];\n this.couchdb.createDocument(dbname, toUpdate, documentName)\n .catch((err) => {\n Log_1.default.error(\"Failed to update document: \" + documentName + \"for db: \" + dbname);\n Log_1.default.error(err);\n });\n }\n }));\n });\n }", "async function getEventData() {\n try {\n let token = localStorage.token;\n let resData = await Axios.get(`http://localhost:80/dashboard/event`, {\n headers: {\n Authorization: `Bearer ${token}`,\n },\n });\n // console.log(\"user: \", resData.data);\n setEventData(resData.data.user.events);\n } catch (err) {\n console.log(err);\n }\n }", "function EventEmitter(){}// Shortcuts to improve speed and size", "async save(events) {\n assert.array(events, 'events')\n\n const snapshotEvents = events.filter((e) => e.type === SNAPSHOT_EVENT_TYPE)\n\n assert.ok(\n !(snapshotEvents.length > 1),\n `cannot commit a stream with more than 1 ${SNAPSHOT_EVENT_TYPE} event`\n )\n assert.ok(\n !(snapshotEvents.length && !this.snapshotsSupported),\n `${SNAPSHOT_EVENT_TYPE} event type is not supported by the storage`\n )\n\n const snapshot = snapshotEvents[0]\n const eventStream = new EventStream(events.filter((e) => e !== snapshot))\n eventStream.forEach(this._validator)\n\n await this._storage.commitEvents(eventStream)\n\n if (snapshot) {\n await this._snapshotStorage.saveAggregateSnapshot(snapshot)\n }\n\n return eventStream\n }", "function getEventData(){\n\tvar mapInfo = JSON.parse(sessionStorage.getItem(\"mapInfo\"));\n\tconsole.log(\"mapInfo:\");\n\tconsole.log(mapInfo)\n\t// console.log(\"Maps eventData:\");\n\t// console.log(eventData);\n\tvar location = mapInfo.location;\n\tvar eventName = mapInfo.name;\n\n\treturn [location, eventName];\n}", "function saveCurrentEventsToDatabase(spotifyUsername,events) {\n var userRef = db.ref('spotifyUsers/'+spotifyUsername+'/currentEvents');\n\n userRef.remove().then(function(){\n\n for (var x in events){\n userRef.push(events[x]);\n }\n\n }).catch(function(err){\n console.log(\"Error in replacing currentEvents \" +err);\n })\n}", "async getAllEvents(eventTypes) {\n assert.optionalArray(eventTypes, 'eventTypes')\n const events = await this._storage.getEvents(eventTypes)\n return new EventStream(events)\n }", "function myEventsStore() {\n return {\n myEvents: [],\n addBookedEvent(event) {\n this.myEvents.push(event);\n },\n addBookedEvents(events) {\n this.myEvents = [...this.myEvents, ...events];\n },\n clearAllMyEvents() {\n this.myEvents = [];\n },\n removedEvent(eventId) {\n this.myEvents = this.myEvents.filter((event) => event.id !== eventId);\n },\n };\n}", "updateEvent() {\n var updates = {};\n\n updates['/events/' + this.currentEvent.id] = this.currentEvent;\n\n this.db.ref().update(updates);\n }", "async events() {\n return await this.call({func:\"get_events\", context:\"locals\"})\n }", "function readEventsFromLocalStorage(){\n\n\ttry{\n\t\t//show from localstorage\n\t\tvar storage=window.sessionStorage.getItem('event-storage')==null?'events':window.sessionStorage.getItem('event-storage')\n\n\t var json=window.localStorage.getItem(storage)\n\t var data=$.parseJSON(json)\n\t\tappendToEventList(data.result)\n\t\treturn data.result\n\t}catch(e){}\n\n}", "function getSavedEvents() {\n $.get(\"/api/userevents/:id\", data => {\n savedEvents = data.Events;\n if (!savedEvents || !savedEvents.length) {\n displaySavedEmpty(organization);\n } else {\n initializeSavedRows();\n }\n });\n }", "addEvent(data) {\n Event.create({\n blockId: K.total_blocks,\n data: stringify(data)\n })\n }", "ADD_EVENT(state, event) {\n state.events.push(event);\n }", "function parseEvents(events){ \n for(var i in events[\"events\"]){\n var event = {\n\t \"id\": events[\"events\"][i][\"id\"],\n\t \"name\": events[\"events\"][i][\"name\"][\"text\"],\n\t \"desc\": events[\"events\"][i][\"description\"][\"text\"],\n\t \"venue_id\": events[\"events\"][i][\"venue_id\"],\n\t \"is_free\": events[\"events\"][i][\"is_free\"],\n\t \"logo_url\": \"#\",\n\t \"date\": events[\"events\"][i][\"start\"][\"utc\"]\n };\n setLogoUrl(event, events[\"events\"][i]);\n\n eventList.push(event);\n };\n}", "getEventDetails(eventId){\n let evId = Number.parseInt(eventId);\n return new Promise((resolve,reject)=>{\n db.events.findOne({eventId : evId},(err,doc)=>{\n if(err){\n reject(err);\n return;\n }\n resolve(doc);\n });\n });\n }", "storageEventBackToObject(jsonObject){\n let eventObjects = []\n //Need to convert JSON OBJECT to a \n jsonObject.forEach(function(event){\n let eventObject = new Event(event._title, event._eventDate)\n \n console.log(eventObject)\n eventObjects.push(eventObject)\n })\n return eventObjects\n \n }", "async function add_to_event_store (redisClient, key, streamPayload ) {\n\n let orderPayload = {}\n \n orderPayload.user=streamPayload.user\n orderPayload.name=streamPayload.name\n orderPayload.address=streamPayload.address\n orderPayload.totalQty=streamPayload.totalQty\n orderPayload.totalPrice=streamPayload.totalPrice\n orderPayload.lineItems=streamPayload.lineItems\n orderPayload.orderId=streamPayload.orderId\n orderPayload.status=\"submitted\"\n var timeStamp = moment().unix()\n\n console.log('add_to_event_store()\\n')\n let searchKey = '@user: '+escape(streamPayload.user)+' @id: '+escape(streamPayload.orderId)\n console.log('..... searchKey : ' +searchKey)\n\n try{\n var rtn = await redisClient.send_commandAsync('FT.SEARCH',['event_store', searchKey , \n 'SORTBY', 'timeStamp', \n 'DESC', 'LIMIT', \n '0', '1'])\n if(rtn[0] == 0 ) { \n console.log(\"....... Inserting event store: \" + escape(orderPayload.orderId))\n\n var rtn = await redisClient.send_commandAsync('FT.ADD',['event_store', uuidv4() , \n '1.0','FIELDS', \n 'aggregateRoot', 'order', \n 'id', escape(orderPayload.orderId), \n 'user', escape(orderPayload.user), 'eventType', \n 'OrderCreatedEvent', 'timeStamp', \n timeStamp, 'data', \n JSON.stringify(orderPayload) ]);\n }\n }\n catch(error) {\n console.error(error);\n }\n console.log('\\n')\n}", "function storageHandler(event) {\r\n console.log(\"connected!\");\r\n if(event.newValue){\r\n var newValue = JSON.parse(event.newValue);\r\n if(newValue.hasOwnProperty(\"html5storage\"))\r\n console.log(newValue);\r\n }\r\n }", "function FsEventsHandler() {}", "onrecord() {}", "async getEvent(){\n try {\n const event = await get(`/events/byID/${this.eventID}`);\n this.updateEvent(event);\n } catch (e) {\n this.setState({\n error: e\n })\n }\n }", "function uploadEvent(eventTitle, eventDate, eventDescription){\n /**Uploads the data to the database \n Saved on the database under Announcement/title + date (Title and Date used to avoid data being overwritten)**/\n rrgDB.database().ref('Events/' + eventTitle + \" \" + eventDate).set({\n titleOfEvent: eventTitle,\n descOfEvent: eventDescription,\n dateOfEvent: eventDate\n });\n \n //Animates loading screens\n $(\".fa-spinner\").animate({\n opacity: 0\n }, 100);\n \n setTimeout(function(){\n $(\".fa-check-circle-o\").animate({\n opacity: 1\n }, 500);\n \n $(\"#btnReSubmitEvent\").css('display', 'block');\n $(\"#btnReSubmitEvent\").animate({\n opacity: 1\n }, 500);\n }, 500)\n }", "function syncEvents(){\n sync('events', { status: 'past,upcoming,cancelled' }, Events);\n}", "async eventStoreTime() {\n\n // eventTAT's sysKey\n const sysKey = this.ctx.params.sysKey;\n const eventTAT = this.ctx.request.body;\n eventTAT.sysKey = sysKey;\n\n if (!await this.service.eventTAT.eventLog(eventTAT, 1)) {\n this.response(403, 'log event store time failed');\n return;\n }\n\n this.response(203, 'log event store time successed');\n }", "async function getEvents(artist, zip) {\n const url = `https://app.ticketmaster.com/discovery/v2/events.json?keyword=${artist}&city=${zip}&apikey=3FhkqehgsJxNsLTInDmAyq0Oo7Vzj5j5`;\n const encode = encodeURI(url);\n const response = await fetch(encode);\n const data = await response.json();\n let eventData = {};\n if (!!data._embedded) {\n const event = data._embedded.events;\n if (!!event[0].dates.start.localTime) {\n const name = event[0].name;\n const venue = event[0]._embedded.venues[0].name;\n const date = event[0].dates.start.localDate;\n const time = event[0].dates.start.localTime;\n const image = event[0].images[0].url;\n const url = event[0].url;\n eventData = { name, venue, date, time, image, url };\n }\n }\n return eventData;\n}", "get eventId() {\n return this._eventData.id;\n }", "get eventId() {\n return this._eventData.id;\n }", "function Event(name) {\n // Public properties, assigned to the instance ('this')\n this.name = name;\n /*this.datetime = datetime;\n this.description = description;\n this.location = location;\n this.invited = invited;\n this.messages = messages;\n this.attendenceStatus = attendenceStatus;*/\n }", "constructor() {\n this._events = {};\n this._eventsCount = 0;\n }", "function getEvents(res, mysql, context, complete){\n mysql.pool.query(\"SELECT name, eventID FROM Events ORDER BY name ASC\", function(error, results, fields){\n if(error){\n res.write(JSON.stringify(error));\n res.end();\n }\n context.Events = results; \n complete();\n });\n }", "readEvents() {\n let self = this;\n let reference = firebase.database.ref(this.props.eventType).orderByChild('name');\n this.listeners.push(reference);\n let eventType = this.props.eventType;\n reference.on('value', function(snapshot) {\n let listEvents = [];\n let listURLS = [];\n let index = -1;\n snapshot.forEach(function(childSnapshot) {\n let event = childSnapshot.val();\n event[\"key\"] = childSnapshot.key;\n if (eventType === '/pending-events') {\n event[\"status\"] = \"Requester: \" + event[\"email\"];\n }\n listEvents.push(event);\n index = index + 1;\n self.getImage(self, index, listEvents, listURLS, snapshot.numChildren());\n });\n if (snapshot.numChildren() === 0) {\n self.group.notify(function() {\n self.setState({ events: [], originalEvents: [], urls: [], originalURLS: [] });\n if (self.state.isInitial) {\n self.setState({ hidden: \"hidden\", message: \"No Events Found\", open: true});\n }\n });\n }\n self.setState({ isInitial: false });\n });\n }", "function CallbackStore(){this._events={};}", "constructor() {\n super('BoxEvent',\n 'boxEvents',\n new SimpleSchema({\n deviceId: {type: Number},\n eventType: {type: String},\n eventStart: {type: Date},\n eventEnd: {type: Date},\n percent: {type: Number},\n reqId: {type: Number}\n }),\n 'mongodb://localhost:3002/opq'\n );\n\n this.publicationNames = {\n RECENT_BOX_EVENTS: 'recent_box_events',\n COMPLETE_RECENT_BOX_EVENTS: 'complete_recent_box_events',\n DAILY_BOX_EVENTS: 'daily_box_events',\n GET_BOX_EVENTS: 'get_box_events'\n };\n }", "export() {\n // const log = this.entities.map(m => m.export()).join(\"\\n---------------------------\\n\");\n // let date = new Date().toDateString().replace(/\\s/g, \"-\");\n // const filename = `fvtt-log-${date}.txt`;\n // saveDataToFile(log, \"text/plain\", filename);\n }", "function allEventsStore() {\n return {\n allEvents: [],\n\n addAnEvent(event) {\n this.addEvents.push(event);\n },\n addEvents(events) {\n this.allEvents = [...this.allEvents, ...events];\n },\n clearAllEvents() {\n this.allEvents = [];\n },\n };\n}", "function initMyEvents(username) {\n syncDatabaseIndexDB();\n retrieveEventbyUser(username)\n}", "function loadRecorderEvents() {\n SSE_source = new EventSource(\"/api/stream\");\n SSE_source.onmessage = function (event) {\n var obj = JSON.parse(event.data);\n console.trace(obj);\n\n if (!processedEvents.includes(obj.id)) {\n processedEvents.push(obj.id);\n var $recorderTable = $(\"#recorder-table\");\n var $row;\n\n switch (obj.cause) {\n case \"RECORDER_STATUS_UPDATE\":\n $row = $('#recorder-' + obj.recorder.Id);\n $row.children('.recorder-status').removeClass(function (index, className) {\n return (className.match(/(^|\\s)status-\\S+/g) || []).join(' ');\n });\n\n $row.children('.recorder-status').addClass(\"status-\" + obj.recorder.status.code);\n $row.children('.recorder-status').text(obj.recorder.status.string);\n $row.children('.recorder-name').text(obj.recorder.Name);\n $row.children('.recorder-version').text(obj.recorder.Version);\n $row.children('.recorder-last-seen').text(obj.recorder.lastSeen);\n break;\n\n case \"RECORDER_RECORD_UPDATE\":\n if ($recorderTable.has(\"#recorder-\" + obj.recorder.Id).length) {\n // Recorder already in Table, Skipping\n break;\n }\n\n var row = $recorderTable[0].insertRow(0);\n $row = $(row);\n\n $row.addClass(\"recorder\")\n .addClass(\"recorder-\" + obj.recorder.Id)\n .attr(\"id\", \"recorder-\" + obj.recorder.Id);\n\n $(row.insertCell(0))\n .addClass(\"recorder-status\")\n .addClass(\"status-\" + obj.recorder.status.code)\n .text(obj.recorder.status.string);\n\n $(row.insertCell(1))\n .addClass(\"recorder-name\")\n .text(obj.recorder.Name);\n\n $(row.insertCell(2))\n .addClass(\"recorder-version\")\n .text(obj.recorder.Verison);\n\n $(row.insertCell(3))\n .addClass(\"recorder-last-seen\")\n .text(obj.recorder.lastSeen);\n\n $(row.insertCell(4))\n .addClass(\"recorder-more-info-button\")\n .addClass(\"recorder-info\")\n .html(\"<i class=\\\"fas fa-info-circle\\\" aria-hidden=\\\"true\\\"\\n\" +\n \" onclick=\\\"showRecorderByID('\" + obj.recorder.Id + \"')\\\"></i>\");\n\n break;\n\n case \"RECORDER_ALARM_ACTIVATE\":\n // TODO\n break;\n\n case \"RECORDER_ALARM_CLEAR\":\n // TODO\n break;\n\n default:\n console.warn(\"Unrecognized Event Type!\");\n }\n\n console.debug(\"Processed SSE Event\");\n sorttable.makeSortable($recorderTable[0])\n } else {\n console.debug(\"Skipping Event - Already Processed\")\n }\n };\n\n SSE_source.onError = function () {\n loadRecorderEvents();\n };\n}", "static get STORAGE_KEY() {\n return 'photoWallCalendarState';\n }", "function recordEvent( event )\n {\n var slideData = getSlideData();\n slideData.events.push(event);\n needSave = true;\n buttonSave.style.color = \"#2a9ddf\";\n }", "async function saveEvent(contract, name, event, contract_type){\n\tif(contract_type==\"systemContract\"){\n\t\tif(event.event==\"Created\"){\n\t\t\tvar o = {\n\t\t\t\t'txhash':event.transactionHash,\n\t\t\t\t'blockNumber':event.blockNumber,\n\t\t\t\t'event':event.event,\n\t\t\t\t'address':event.address,\n\t\t\t\t'_depositContractAddress':event.returnValues._depositContractAddress, \n\t\t\t\t'_keepAddress':event.returnValues._keepAddress, \n\t\t\t\t'date': Utilities.toMysqlFormat(new Date(event.returnValues._timestamp * 1000)), \n\t\t\t};\n\t\t}else if(event.event==\"RegisteredPubkey\"){\n\t\t\tvar o = {\n\t\t\t\t'txhash':event.transactionHash,\n\t\t\t\t'blockNumber':event.blockNumber,\n\t\t\t\t'event':event.event,\n\t\t\t\t'address':event.address,\n\t\t\t\t'_depositContractAddress':event.returnValues._depositContractAddress, \n\t\t\t\t'_signingGroupPubkeyX':event.returnValues._signingGroupPubkeyX, \n\t\t\t\t'_signingGroupPubkeyY':event.returnValues._signingGroupPubkeyX,\n\t\t\t\t'date': Utilities.toMysqlFormat(new Date(event.returnValues._timestamp * 1000)), \n\t\t\t};\n\t\t}else if(event.event==\"Funded\"){\n\t\t\tvar o = {\n\t\t\t\t'txhash':event.transactionHash,\n\t\t\t\t'blockNumber':event.blockNumber,\n\t\t\t\t'event':event.event,\n\t\t\t\t'address':event.address,\n\t\t\t\t'_depositContractAddress':event.returnValues._depositContractAddress, \n\t\t\t\t'_txid':event.returnValues._txid, \n\t\t\t\t'date': Utilities.toMysqlFormat(new Date(event.returnValues._timestamp * 1000)), \n\t\t\t};\n\t\t}else if(event.event==\"RedemptionRequested\"){\n\t\t\tvar o = {\n\t\t\t\t'txhash':event.transactionHash,\n\t\t\t\t'blockNumber':event.blockNumber,\n\t\t\t\t'event':event.event,\n\t\t\t\t'address':event.address,\n\t\t\t\t'_depositContractAddress':event.returnValues._depositContractAddress, \n\t\t\t\t'_requester':event.returnValues._requester, \n\t\t\t\t'_digest':event.returnValues._digest, \n\t\t\t\t'_utxoValue':event.returnValues._utxoValue, \n\t\t\t\t'_redeemerOutputScript':event.returnValues._redeemerOutputScript, \n\t\t\t\t'_requestedFee':event.returnValues._requestedFee, \n\t\t\t\t'_outpoint':event.returnValues._outpoint \n\t\t\t};\n\t\t}else if(event.event==\"GotRedemptionSignature\"){\n\t\t\tvar o = {\n\t\t\t\t'txhash':event.transactionHash,\n\t\t\t\t'blockNumber':event.blockNumber,\n\t\t\t\t'event':event.event,\n\t\t\t\t'address':event.address,\n\t\t\t\t'_depositContractAddress':event.returnValues._depositContractAddress, \n\t\t\t\t'_digest':event.returnValues._digest, \n\t\t\t\t'_r':event.returnValues._r, \n\t\t\t\t'_s':event.returnValues._s \n\t\t\t};\n\t\t}else if(event.event==\"Redeemed\"){\n\t\t\tvar o = {\n\t\t\t\t'txhash':event.transactionHash,\n\t\t\t\t'blockNumber':event.blockNumber,\n\t\t\t\t'event':event.event,\n\t\t\t\t'address':event.address,\n\t\t\t\t'_depositContractAddress':event.returnValues._depositContractAddress, \n\t\t\t\t'_txid':event.returnValues._digest, \n\t\t\t\t'date': Utilities.toMysqlFormat(new Date(event.returnValues._timestamp * 1000)), \n\t\t\t};\n\t\t}else if(event.event==\"StartedLiquidation\"){\n\t\t\tvar o = {\n\t\t\t\t'txhash':event.transactionHash,\n\t\t\t\t'blockNumber':event.blockNumber,\n\t\t\t\t'event':event.event,\n\t\t\t\t'address':event.address,\n\t\t\t\t'_depositContractAddress':event.returnValues._depositContractAddress, \n\t\t\t\t'_wasFraud':event.returnValues.previousOwner, \n\t\t\t\t'date': Utilities.toMysqlFormat(new Date(event.returnValues._timestamp * 1000)), \n\t\t\t};\n\t\t}else if(event.event==\"Liquidated\"){\n\t\t\tvar o = {\n\t\t\t\t'txhash':event.transactionHash,\n\t\t\t\t'blockNumber':event.blockNumber,\n\t\t\t\t'event':event.event,\n\t\t\t\t'address':event.address,\n\t\t\t\t'_depositContractAddress':event.returnValues._depositContractAddress, \n\t\t\t\t'date': Utilities.toMysqlFormat(new Date(event.returnValues._timestamp * 1000)), \n\t\t\t};\n\t\t}else if(event.event==\"SetupFailed\"){\n\t\t\tvar o = {\n\t\t\t\t'txhash':event.transactionHash,\n\t\t\t\t'blockNumber':event.blockNumber,\n\t\t\t\t'event':event.event,\n\t\t\t\t'address':event.address,\n\t\t\t\t'_depositContractAddress':event.returnValues._depositContractAddress, \n\t\t\t\t'date': Utilities.toMysqlFormat(new Date(event.returnValues._timestamp * 1000)), \n\t\t\t};\n\t\t}else if(event.event==\"OwnershipTransferred\"){\n\t\t\tvar o = {\n\t\t\t\t'txhash':event.transactionHash,\n\t\t\t\t'blockNumber':event.blockNumber,\n\t\t\t\t'event':event.event,\n\t\t\t\t'address':event.address,\n\t\t\t\t'previousOwner':event.returnValues.previousOwner, \n\t\t\t\t'newOwner':event.returnValues.newOwner, \n\t\t\t\t//'date': Utilities.toMysqlFormat(new Date(event.returnValues._timestamp * 1000)), \n\t\t\t};\n\t\t}else if(event.event==\"LotSizesUpdateStarted\"){\n\t\t\tvar o = {\n\t\t\t\t'txhash':event.transactionHash,\n\t\t\t\t'blockNumber':event.blockNumber,\n\t\t\t\t'event':event.event,\n\t\t\t\t'address':event.address,\n\t\t\t\t'date': Utilities.toMysqlFormat(new Date(event.returnValues._timestamp * 1000)), \n\t\t\t};\n\t\t}else if(event.event==\"LotSizesUpdated\"){\n\t\t\tvar o = {\n\t\t\t\t'txhash':event.transactionHash,\n\t\t\t\t'blockNumber':event.blockNumber,\n\t\t\t\t'event':event.event,\n\t\t\t\t'address':event.address, \n\t\t\t};\n\t\t}else{\n\t\t\tconsole.l(event);\n\t\t}\n\t\t\n\n\t\tdb.connection.query('INSERT INTO systemContract SET ?', o, function(err, result) {\n\t\t\tif(err==null) {\n\t\t\t\tdb.connection.query(\"UPDATE `systemContract` set format_date = DATE_FORMAT(`date`, '%Y-%m-%d') WHERE `date` is not null AND format_date is NULL\", {}, function(err1, result1) {});\n\t\t\t}else{\n\t\t\t\tif(!err.toString().includes(\"Duplicate entry\")){\n\t\t\t\t\tconsole.l(event);\n\t\t\t\t\tconsole.l(err);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}else if(contract_type==\"TokenContract\"){\n\t\t\n\t\tvar path = __dirname+'/blocks_cache/'+event.blockNumber;\n\t\tvar block = null; \n\t\tvar transaction = null;\n\t\tvar datetime = null;\n\t\t\n\t\tif (fs.existsSync(path)){\n\t\t\ttry {\n\t\t\t\tblock = JSON.parse(fs.readFileSync(path,{ encoding: 'utf8' }));\n\t\t\t} catch (err) {\n\n\t\t\t}\t\n\t\t}else{\n\t\t\tconsole.l(path);\n\t\t\tblock = await web3.eth.getBlock(event.blockNumber);\n\t\t\tif(!!block && block.timestamp) fs.writeFile( path, JSON.stringify(block),function(){});\n\t\t}\n\t\t\n\n\t\tif(!!block) datetime = Utilities.toMysqlFormat(new Date(block.timestamp * 1000)); else datetime = block;\n\t\n\t\n\t\tvar o = {\n\t\t\t'txhash':event.transactionHash,\n\t\t\t'blockNumber':event.blockNumber,\n\t\t\t'event':event.event,\n\t\t\t'address':event.address,\n\t\t\t'from':event.returnValues.from,\n\t\t\t'to':event.returnValues.to,\n\t\t\t'date': datetime, \n\t\t\t'value': web3.utils.fromWei(event.returnValues.value)\n\t\t};\n\n\t\tdb.connection.query('INSERT INTO TokenContract SET ?', o, function(err, result) {\n\t\t\tif(err==null) {\n\t\t\t\tdb.connection.query(\"UPDATE `TokenContract` set format_date = DATE_FORMAT(`date`, '%Y-%m-%d') WHERE `date` is not null AND format_date is NULL\", {}, function(err1, result1) {});\n\t\t\t}else{\n\t\t\t\tif(!err.toString().includes(\"Duplicate entry\")){\n\t\t\t\t\tconsole.l(event);\n\t\t\t\t\tconsole.l(err);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}", "updateEvents() {\n return getMessageEvents(this.id).then((events) => {\n const formattedEvents = events.map((e) => formatEvent(e, this.messageType));\n return this.eventList(formattedEvents);\n });\n }" ]
[ "0.58003414", "0.5779717", "0.5774173", "0.5758617", "0.5735078", "0.5735078", "0.56935245", "0.5642374", "0.5590159", "0.5589357", "0.5584359", "0.5529023", "0.54938024", "0.5440014", "0.5428335", "0.54159683", "0.54126257", "0.5412193", "0.5401869", "0.54002666", "0.53973913", "0.53951985", "0.5391414", "0.5373512", "0.53692377", "0.5328182", "0.53192335", "0.53184295", "0.5313832", "0.53014183", "0.52971166", "0.5275525", "0.527106", "0.526829", "0.52604294", "0.5254527", "0.5235295", "0.52318704", "0.523056", "0.52044123", "0.5198873", "0.5197655", "0.51959", "0.5187713", "0.5181717", "0.51786387", "0.5176473", "0.5173675", "0.517071", "0.517071", "0.5152303", "0.51325077", "0.51294917", "0.51270837", "0.5112158", "0.511091", "0.510742", "0.51033664", "0.51033664", "0.5103265", "0.5096538", "0.50922835", "0.5089314", "0.50864375", "0.50759226", "0.5071589", "0.5069572", "0.5067619", "0.5060174", "0.50539505", "0.5051873", "0.50469434", "0.50444347", "0.5038654", "0.50282174", "0.5027921", "0.50275457", "0.50158036", "0.4994102", "0.49930897", "0.49834204", "0.49832934", "0.4973538", "0.49683353", "0.49634624", "0.4953403", "0.4953403", "0.49532083", "0.49506956", "0.49494633", "0.49492702", "0.49458385", "0.49447688", "0.49431023", "0.49412158", "0.494033", "0.49401453", "0.4938993", "0.49380526", "0.49198875", "0.49196956" ]
0.0
-1
TODO: move to geom file?
function anyRangesContainRange(outerRanges, innerRange) { for (var _i = 0, outerRanges_1 = outerRanges; _i < outerRanges_1.length; _i++) { var outerRange = outerRanges_1[_i]; if (rangeContainsRange(outerRange, innerRange)) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function AstroGeometry() {}", "function GeometryDataProcessor () {}", "function walkGeom(theGeometry) {\n var theGeomPart;\n var coordX;\n var coordY;\n var coordM;\n\n for (var a=0; a < theGeometry.features.length; a++) {\n theGeomPart= theGeometry.features[a].geometry.paths;\n\n for (var i = 0; i < theGeomPart.length; i++) {\n for (var j = 0; j < theGeomPart[i].length; j++) {\n coordX = theGeomPart[i][j][0];\n coordY = theGeomPart[i][j][1];\n coordM = roundToDecimalPlace(theGeomPart[i][j][2],3);\n console.log(\"X:\"+ roundToDecimalPlace(coordX,0),\"Y:\"+roundToDecimalPlace(coordY,0),\"M:\"+coordM);\n }\n }\n }\n}", "function GeometryParser() {}", "function geomFromOBJ(objcode) {\n\tlet lines = objcode.split(/\\r\\n|\\n/)\n let vertices = []\n let gvertices = []\n\tlet normals = []\n let gnormals = []\n\tlet texCoords = []\n\tlet gtexCoords = []\n\tlet memo = {}\n\tlet gindices = []\n\tlet indexcount=0;\n\tfor (let line of lines) {\n\t\tif (line.substring(0,2) == \"vn\") {\n\t\t\tlet match = line.match(/vn\\s+([0-9.e-]+)\\s+([0-9.e-]+)\\s+([0-9.e-]+)/)\n\t\t\tnormals.push([+match[1], +match[2], +match[3]])\n\t\t} else if (line.substring(0,2) == \"vt\") {\n let match = line.match(/vt\\s+([0-9.e-]+)\\s+([0-9.e-]+)/)\n texCoords.push([+match[1], +match[2]])\n\t\t} else if (line.substring(0,1) == \"v\") {\n let match = line.match(/v\\s+([0-9.e-]+)\\s+([0-9.e-]+)\\s+([0-9.e-]+)/)\n vertices.push([+match[1], +match[2], +match[3]])\n\t\t} else if (line.substring(0,1) == \"f\") {\n\t\t\tlet face = []\n\t\t\tlet match\n // this only works for v/vt/vn input\n\t\t\tlet regex = /([0-9]+)\\s*(\\/\\s*([0-9]*))?\\s*(\\/\\s*([0-9]*))?/g\n\t\t\twhile (match = regex.exec(line)) {\n let V = match[1]\n let T = match[3]\n let N = match[5]\n\t\t\t\tlet name = `${V}/${T}/${N}`\n\t\t\t\tlet id = memo[name]\n\t\t\t \tif (id == undefined) {\n\t\t\t\t\t// a new vertex/normal/texcoord combo, create a new entry for it\n\t\t\t\t\tid = indexcount;\n\t\t\t\t\tlet v = vertices[(+V)-1]\n gvertices.push(v[0], v[1], v[2])\n if (T && texCoords.length) {\n let vt = texCoords[(+T)-1]\n gtexCoords.push(vt[0], vt[1])\n }\n if (N && normals.length) {\n let vn = normals[(+N)-1]\n gnormals.push(vn[0], vn[1], vn[2])\n }\n\t\t\t\t\tmemo[name] = id;\n\t\t\t\t\tindexcount++;\n\t\t\t\t}\n\t\t\t\tif (face.length >= 3) {\n\t\t\t\t\t// triangle strip\n\t\t\t\t\t//face.push(face[face.length-1], face[face.length-2]);\n\t\t\t\t\t// triangle fan poly\n\t\t\t\t\tface.push(face[face.length-1], face[0]);\n\t\t\t\t}\n \t\t\t\tface.push(id);\n\t\t\t}\n\t\t\tfor (let id of face) {\n\t\t\t\tgindices.push(id);\n\t\t\t}\n\t\t} else {\n\t\t\t//console.log(\"ignored\", line)\n\t\t}\n\n }\n let geom = {\n vertices: new Float32Array(gvertices)\n }\n\tif (gnormals.length) geom.normals = new Float32Array(gnormals)\n\tif (gtexCoords.length) geom.texCoords = new Float32Array(gtexCoords)\n\tif (gindices.length) {\n geom.indices = new Uint32Array(gindices)\n }\n\treturn geom\n}", "function m(e, r) {\n var n = e.geometry,\n o = e.toJSON(),\n s = o;\n\n if (Object(_core_maybe_js__WEBPACK_IMPORTED_MODULE_0__[\"isSome\"])(n) && (s.geometry = JSON.stringify(n), s.geometryType = Object(_geometry_support_jsonUtils_js__WEBPACK_IMPORTED_MODULE_3__[\"getJsonType\"])(n), s.inSR = n.spatialReference.wkid || JSON.stringify(n.spatialReference)), o.groupByFieldsForStatistics && (s.groupByFieldsForStatistics = o.groupByFieldsForStatistics.join(\",\")), o.objectIds && (s.objectIds = o.objectIds.join(\",\")), o.orderByFields && (s.orderByFields = o.orderByFields.join(\",\")), !o.outFields || !o.returnDistinctValues && (null != r && r.returnCountOnly || null != r && r.returnExtentOnly || null != r && r.returnIdsOnly) ? delete s.outFields : -1 !== o.outFields.indexOf(\"*\") ? s.outFields = \"*\" : s.outFields = o.outFields.join(\",\"), o.outSR ? s.outSR = o.outSR.wkid || JSON.stringify(o.outSR) : n && (o.returnGeometry || o.returnCentroid) && (s.outSR = s.inSR), o.returnGeometry && delete o.returnGeometry, o.outStatistics && (s.outStatistics = JSON.stringify(o.outStatistics)), o.pixelSize && (s.pixelSize = JSON.stringify(o.pixelSize)), o.quantizationParameters && (s.quantizationParameters = JSON.stringify(o.quantizationParameters)), o.parameterValues && (s.parameterValues = JSON.stringify(o.parameterValues)), o.rangeValues && (s.rangeValues = JSON.stringify(o.rangeValues)), o.dynamicDataSource && (s.layer = JSON.stringify({\n source: o.dynamicDataSource\n }), delete o.dynamicDataSource), o.timeExtent) {\n var _t131 = o.timeExtent,\n _e134 = _t131.start,\n _r60 = _t131.end;\n null == _e134 && null == _r60 || (s.time = _e134 === _r60 ? _e134 : \"\".concat(null == _e134 ? \"null\" : _e134, \",\").concat(null == _r60 ? \"null\" : _r60)), delete o.timeExtent;\n }\n\n return s;\n }", "function d(r$1){return r$1.features.map((o=>{const t=k.fromJSON(r$1.spatialReference),s=n.fromJSON(o);return r(s.geometry)&&(s.geometry.spatialReference=t),s}))}", "shapeTerrain() {\r\n // MP2: Implement this function!\r\n }", "function render() {\n var points;\n var type;\n var ne = new google.maps.LatLng(shp.maxY, shp.maxX);\n var sw = new google.maps.LatLng(shp.minY, shp.minX);\n var bounds = new google.maps.LatLngBounds(sw, ne);\n map.fitBounds(bounds);\n for (var i = 0; i < shp.records.length; i++) {\n var shape = shp.records[i].shape;\n switch (shape.type) {\n case 1:\n var marker = new google.maps.Marker({\n position: new google.maps.LatLng(shape.content.y,shape.content.x),\n map: map\n });\n break;\n\n case 3:\n points = pathToMVCArray(shape.content.points);\n break;\n\n case 5:\n\n // split into rings\n var polygonPoints = new google.maps.MVCArray();\n var parts = shape.content.parts;\n if (parts.length === 1) {\n polygonPoints.push(pathToMVCArray(shape.content.points));\n } else {\n var j;\n for (j = 0; j < parts.length - 1; j++) {\n polygonPoints.push(pathToMVCArray(shape.content.points.subarray(\n 2 * parts[j], 2 * parts[j + 1])));\n if (2 * parts[j + 1] > shape.content.points.length) {\n throw new Error('part index beyond points array end');\n }\n }\n }\n // create a polygon.\n var polygon = new google.maps.Polygon({\n strokeWeight: .3,\n fillOpacity: .2,\n paths: polygonPoints,\n map: map\n });\n polygon.tractId = i;\n\n // Create InfoWindow at click point and put data in side panel.\n google.maps.event.addListener(polygon, 'click', function(e) {\n if (typeof infowindow != 'undefined') {\n infowindow.close();\n }\n var htmlContent = recordHtmlContent(dbf.records[this.tractId]);\n infowindow = new google.maps.InfoWindow({\n content: htmlContent,\n position: e.latLng,\n map: map\n });\n document.getElementById('side').innerHTML = htmlContent;\n });\n }\n }\n}", "function SVGShape() {}", "toSVG() {\n if (this.geometryObject &&\n (\n this.geometryObject.geometryIsVisible === false ||\n this.geometryObject.geometryIsHidden === true ||\n this.geometryObject.geometryIsConstaintDraw === true\n )\n ) {\n return '';\n }\n\n let path = this.getSVGPath();\n\n let attributes = {\n d: path,\n stroke: this.strokeColor,\n fill: '#000',\n 'fill-opacity': 0,\n 'stroke-width': this.strokeWidth,\n 'stroke-opacity': 1, // toujours à 1 ?\n };\n\n let path_tag = '<path';\n for (let [key, value] of Object.entries(attributes)) {\n path_tag += ' ' + key + '=\"' + value + '\"';\n }\n path_tag += '/>\\n';\n\n let pointToDraw = [];\n if (app.settings.areShapesPointed && this.name != 'silhouette') {\n if (this.isSegment())\n pointToDraw.push(this.segments[0].vertexes[0]);\n if (!this.isCircle())\n this.segments.forEach(\n (seg) => (pointToDraw.push(seg.vertexes[1])),\n );\n }\n\n this.segments.forEach((seg) => {\n //Points sur les segments\n seg.divisionPoints.forEach((pt) => {\n pointToDraw.push(pt);\n });\n });\n if (this.isCenterShown) pointToDraw.push(this.center);\n\n let point_tags = pointToDraw.filter(pt => {\n pt.visible &&\n pt.geometryIsVisible &&\n !pt.geometryIsHidden\n }).map(pt => pt.svg).join('\\n');\n\n let comment =\n '<!-- ' + this.name.replace('é', 'e').replace('è', 'e') + ' -->\\n';\n\n return comment + path_tag + point_tags + '\\n';\n }", "function r(n){return _geometryEngineBase_js__WEBPACK_IMPORTED_MODULE_0__[\"G\"].extendedSpatialReferenceInfo(n)}", "static newGeo() { return { vertices: [], normals: [], indices: [], texcoord: [] }; }", "geoLayout() {\n this.pieces.forEach((row, i) => row.forEach((piece, j) => {\n let x, y;\n if (i <= Math.floor(this.pieces.length / 2)) {\n x = i * -1 / 2 + j * 1;\n\n } else {\n x = -Math.floor(this.pieces.length / 2) / 2 + (i - Math.floor(this.pieces.length / 2)) / 2 + j * 1;\n\n }\n y = i * Math.sqrt(3) / 2;\n\n piece.geoPoint = new Point(x, y);\n }));\n }", "function O(){!f&&b.points&&(f=Atalasoft.Utils.__calcPathBounds(b.points));var e=b.points?f:b;return{x:e.x,y:e.y,width:e.width,height:e.height}}", "function addGraphics() {\n var pt = new Point(\n {\n \"x\": -122.65,\n \"y\": 45.53,\n \"spatialReference\":\n {\n \"wkid\": 4326\n }\n });\n addPoint(pt);\n }", "function geomToDistance(geom){\n let coords = geom.coordinates;\n let td = 0;\n let sd = 0;\n let c = 0;\n let f = 0;\n let xy = [];\n\n //reproject to EPSG:28355 so distance is in metres\n let epsg28355 = '+proj=utm +zone=55 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs';\n let p1 = proj4(epsg28355,[coords[0][0],coords[0][1]]);\n let p2 = 0;\n\n for (i = 0; i < coords.length-1; i++) {\n p2 = proj4(epsg28355,[coords[i+1][0],coords[i+1][1]]);\n\n // calculate distance traveled\n let deltax = p1[0] - p2[0];\n let deltay = p1[1] - p2[1];\n let distance = Math.sqrt(deltax*deltax + deltay*deltay);\n sd = sd + distance;\n td = td + distance;\n\n p1 = p2;\n\n // calculate climb/fall\n if (coords[i][2] < coords[i+1][2]){\n c = c + coords[i+1][2] - coords[i][2];\n } else {\n f = f + coords[i][2] - coords[i+1][2];\n }\n if (sd >= 100) {\n xy.push({\n x:td,\n y:coords[i][2]\n });\n sd = 0;\n }\n }\n\n return {chartdata:xy,climb:c,fall:f,totaldistance:td};\n}", "function getGeom(layer){\n\tvar str = 'POLYGON(('\n\tfor (p in layer.getLatLngs() ){\n\t\tstr += ( layer.getLatLngs()[p].lng + ' ' + layer.getLatLngs()[p].lat + ',')\n\t}\n\tstr += (layer.getLatLngs()[0].lng + ' ' + layer.getLatLngs()[0].lat )\n\treturn str + '))'\n}", "function getLoad(id,gRoot,x,y,z,strFill,intStrokeW){\n var g=getG(id,gRoot,x,y,z,false,50,50);\n getPath(null,g,0,0,1,strFill,strFill,5,'M 49.15625 0 C 48.554037 -0.0068816 47.945168 0.01703628 47.34375 0.03125 C 31.305932 0.41028119 15.679088 8.2337702 6.75 22.75 C -5.9862758 43.455665 -0.33340851 71.98026 20.8125 84.78125 C 39.425219 96.048738 64.937158 90.880114 76.25 71.8125 C 86.05041 55.294072 81.4293 32.727206 64.4375 22.90625 C 50.015261 14.570455 30.385901 18.705378 22.0625 33.625 C 15.187584 45.948227 18.803189 62.652089 31.65625 69.46875 C 41.875972 74.888811 55.675159 71.733292 60.96875 60.9375 C 64.944594 52.829128 62.317791 41.924733 53.5625 38.1875 C 50.571968 36.91098 47.069165 36.820859 44.03125 37.875 C 40.993334 38.92914 38.391969 41.157355 37.34375 44.53125 C 36.751083 46.438868 36.8763 48.77665 37.75 50.6875 C 38.623699 52.598349 40.326091 54.116356 42.71875 54.1875 A 0.50645732 0.50645732 0 0 0 42.75 53.1875 C 40.75682 53.12824 39.448108 51.913507 38.6875 50.25 C 37.926893 48.586493 37.771915 46.483135 38.28125 44.84375 C 39.228992 41.793253 41.55108 39.781542 44.34375 38.8125 C 47.136421 37.843458 50.409211 37.952414 53.15625 39.125 C 61.329583 42.61382 63.805522 52.86645 60.0625 60.5 C 55.03811 70.746773 41.875182 73.733539 32.125 68.5625 C 19.801374 62.026628 16.322877 45.98165 22.9375 34.125 C 30.972737 19.721908 49.979919 15.714016 63.9375 23.78125 C 80.421889 33.308933 84.931776 55.257383 75.40625 71.3125 C 64.390432 89.879482 39.462907 94.893869 21.3125 83.90625 C 0.66199494 71.405157 -4.8586319 43.525382 7.59375 23.28125 C 21.57812 0.54652836 52.413281 -5.4815863 74.75 8.4375 C 99.569463 23.903702 106.10599 57.696547 90.71875 82.125 C 90.095949 83.113743 89.465094 84.083658 88.78125 85.03125 A 0.50316382 0.50316382 0 1 0 89.59375 85.625 C 90.289873 84.660392 90.959727 83.662806 91.59375 82.65625 C 107.271 57.767395 100.58857 23.363964 75.28125 7.59375 C 67.266457 2.5993485 58.189438 0.10322399 49.15625 0 z');\n return g;\n}", "function geometry(groups) {\n var path = [],\n i = -1,\n n = groups.length,\n d;\n var px = Math.floor(scale_x(groups[1].key)) - Math.floor(scale_x(groups[0].key));\n var space = Math.max(2,px / 6);\n var gap = Math.max(2,px - 2*space);\n var x,y,y2;\n while (++i < n) {\n d = groups[i];\n x = Math.round(scale_x(d.key));\n y = Math.round(scale_y(d.value));\n path.push(\"M\", x+ space, \",\", height, \"V\", y, \"h\"+ gap +\"V\", height);\n }\n return path.join(\"\");\n }", "function gv(){var t=this;ci()(this,{$geometry:{enumerable:!0,get:function(){return t.$olObject}},$map:{enumerable:!0,get:function(){return t.$services&&uu()(t.$services)}},$view:{enumerable:!0,get:function(){return t.$services&&t.$services.view}},$geometryContainer:{enumerable:!0,get:function(){return t.$services&&t.$services.geometryContainer}}})}", "function LMplot(xml,imagename) {\n // Display image:\n $('body').append('<svg id=\"canvas\" width=\"2560\" height=\"1920\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"><image id=\"img\" xlink:href=\"' + imagename + '\" x=\"0\" y=\"0\" height=\"1920\" width=\"2560\" /></svg>');\n\n // Display polygons:\n var N = $(xml).children(\"annotation\").children(\"object\").length;\n for(var i = 0; i < N; i++) {\n var obj = $(xml).children(\"annotation\").children(\"object\").eq(i);\n if(!parseInt(obj.children(\"deleted\").text())) {\n // Get object name:\n var name = obj.children(\"name\").text();\n\n // Get points:\n var X = Array();\n var Y = Array();\n if (obj.children(\"polygon\") != null){\n for(var j = 0; j < obj.children(\"polygon\").children(\"pt\").length; j++) {\n X.push(parseInt(obj.children(\"polygon\").children(\"pt\").eq(j).children(\"x\").text()));\n Y.push(parseInt(obj.children(\"polygon\").children(\"pt\").eq(j).children(\"y\").text()));\n }\n }\n else {\n X.push(parseInt(obj.children(\"segm\").children(\"box\").children(\"xmin\").text()));\n X.push(parseInt(obj.children(\"segm\").children(\"box\").children(\"xmax\").text()));\n X.push(parseInt(obj.children(\"segm\").children(\"box\").children(\"xmax\").text()));\n X.push(parseInt(obj.children(\"segm\").children(\"box\").children(\"xmin\").text()));\n Y.push(parseInt(obj.children(\"segm\").children(\"box\").children(\"ymin\").text()));\n Y.push(parseInt(obj.children(\"segm\").children(\"box\").children(\"ymin\").text()));\n Y.push(parseInt(obj.children(\"segm\").children(\"box\").children(\"ymax\").text()));\n Y.push(parseInt(obj.children(\"segm\").children(\"box\").children(\"ymax\").text()));\n }\n // Draw polygon:\n var attr = 'fill=\"none\" stroke=\"' + HashObjectColor(name) + '\" stroke-width=\"4\"';\n var scale = 1;\n DrawPolygon('myCanvas_bg',X,Y,name,attr,scale);\n }\n }\n \n return 'canvas';\n }", "function Geometry (aesthetics) {\n this.aesthetics = aesthetics;\n this.defaultStatistic = 'identity'\n }", "function parseFile(evt){\n let files = evt.target.files; // FileList object\n if(files.length === 0){ //if no files\n return;\n }\n let f = files[0];\n\n let pointsArray = [];\n fileFaces = [];\n let reader = new FileReader();\n reader.onload = (function(theFile) {\n return function(e) {\n let contents = atob(e.target.result.split(\"base64,\")[1]);\n contents = contents.split(/\\n/); //split contents into lines\n if(contents[0].replace(/\\s+/, \"\") === \"\"){ //if first line is blank\n contents.shift(); //delete it\n }\n if(contents[0].replace(/\\s+/, \"\") !== \"ply\"){ //if first line does not contain \"ply\"\n console.log(\"No Ply: \" + contents[0]); //do nothing with the file\n return;\n }\n\n let i = 1;\n let numVerts = 0;\n let numFaces = 0;\n\n while(contents[i].indexOf(\"end_header\") === -1){ //while we haven't hit the end of the header\n if(contents[i].indexOf(\"element vertex\") !== -1){ //if this line indicates # vertices\n let idx = contents[i].indexOf(\"element vertex\");\n numVerts = parseInt(contents[i].substring(idx+14)); //parse # of vertices\n } else if(contents[i].indexOf(\"element face\") !== -1){ //if this line indicates # of faces\n let idx = contents[i].indexOf(\"element face\");\n numFaces = parseInt(contents[i].substring(idx+12)); //parse # of faces\n }\n i++;\n }\n i++; //increment to line just after end_header\n let left = vec4(Number.MAX_VALUE, 0.0, 0.0, 0.0);\n let right = vec4(Number.MIN_VALUE, 0.0, 0.0, 0.0);\n let top = vec4(0.0, Number.MIN_VALUE, 0.0, 0.0);\n let bottom = vec4(0.0, Number.MAX_VALUE, 0.0, 0.0);\n let minZ = vec4(0.0, 0.0, Number.MAX_VALUE, 0.0);\n let maxZ = vec4(0.0, 0.0, Number.MIN_VALUE, 0.0); //initialize extents to easily-overridden values\n\n let j = 0;\n for(j = 0; j < numVerts; j++){ //for each vertex\n while(contents[i].replace(/\\s+/, \"\") === \"\"){ //ignore empty lines\n i++;\n }\n let points = contents[i].split(/\\s+/); //split along spaces\n if(points[0].replace(/\\s+/, \"\") === \"\"){ //ignore empty first element\n points.shift();\n }\n let x = parseFloat(points[0]);\n let y = parseFloat(points[1]);\n let z = parseFloat(points[2]);\n let thisPoint = vec4(x, y, z, 1.0);\n\n if(x < left[0]){ //if x is further left\n left = thisPoint;\n }\n if(x > right[0]){ //if x is further right\n right = thisPoint;\n }\n if(y < bottom[1]){ //if y is lower\n bottom = thisPoint;\n }\n if(y > top[1]){ //if y is higher\n top = thisPoint;\n }\n if(z < minZ[2]){ //if Z is further\n minZ = thisPoint;\n }\n if(z > maxZ[2]){ //if Z is closer\n maxZ = thisPoint;\n }\n pointsArray.push(thisPoint);\n i++;\n }\n\n let divisor = Math.max(right[0]-left[0], top[1]-bottom[1], maxZ[2]-minZ[2]) / 2; //calculate largest dimension\n let shiftX = (-(right[0] - (right[0]-left[0])/2))/divisor; //X axis translation to center at origin\n let shiftY = (-(top[1] - (top[1]-bottom[1])/2))/divisor; //Y axis translation to center at origin\n let shiftZ = (-(maxZ[2] - (maxZ[2]-minZ[2])/2))/divisor; //Z axis translation to center at origin\n for(j = 0; j < numFaces; j++){ //for each face\n while(contents[i].replace(/\\s+/, \"\") === \"\"){ //ignore empty lines\n i++;\n }\n let verts = contents[i].split(/\\s+/);\n if(verts[0].replace(/\\s+/, \"\") === \"\"){ //if empty first element\n verts.shift();\n }\n let vertLen = parseInt(verts[0]); //parse # vertices\n verts.shift();\n\n for(let k = 0; k < vertLen; k++){ //for # of vertices\n let currVert = pointsArray[verts[k]];\n fileFaces.push(vec4(currVert[0]/divisor + shiftX, currVert[1]/divisor + shiftY, currVert[2]/divisor + shiftZ, 1.0));\n //shift vertex so whole object is centered on origin and [-1, 1], push to face\n }\n i++;\n }\n let rightBB = right[0]/divisor + shiftX;\n let topBB = top[1]/divisor + shiftY;\n let maxZBB = maxZ[2]/divisor + shiftZ;\n\n //back face\n fileBB = generateBB(rightBB, topBB, maxZBB);\n\n fileUploaded = true;\n if(shapeArray.length === 3){ //if another file is already loaded\n shapeArray.pop(); //get rid of it\n }\n shapeArray.push(fileFaces); //push this file to shape array\n fileFlatNormal = fNormals(shapeArray[2]); //calculate flat normals\n fileGNormal = gNormals(shapeArray[2]); //calculate gouraud normals\n generateLines(); //regenerate lines to account fo new bounding box\n };\n })(f);\n reader.readAsDataURL(f);\n}", "function compute_floor_geometry(){quad( 1, 0, 3, 2 );}", "async function f(u,i,f){const c=(i=a(i)).geometry?[i.geometry]:[],l$1=f$2(u);return l$1.path+=\"/identify\",v$2(c).then((e=>{const t=l(i,{geometry:e&&e[0]}),u=s({...l$1.query,f:\"json\",...t}),a=i$3(u,f);return U(l$1.path,a).then(m).then((r=>p(r,i.sublayers)))}))}", "function l$1(e,t,r,s){s[r]=[t.length,t.length+e.length],e.forEach((e=>{t.push(e.geometry);}));}", "static mk_geo( g ){\n\t\t\tlet geo = new THREE.BufferGeometry();\n\t\t\tgeo.setAttribute( \"position\", new THREE.BufferAttribute( g.vertices.data, g.vertices.comp_len ) );\n\n\t\t\t//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\t\t\tif( g.indices )\n\t\t\t\tgeo.setIndex( new THREE.BufferAttribute( g.indices.data, 1 ) );\n\n\t\t\tif( g.normal )\n\t\t\t\tgeo.setAttribute( \"normal\", new THREE.BufferAttribute( g.normal.data, g.normal.comp_len ) );\n\n\t\t\tif( g.uv )\n\t\t\t\tgeo.setAttribute( \"uv\", new THREE.BufferAttribute( g.uv.data, g.uv.comp_len ) );\n\n\t\t\t//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\t\t\tgeo.name = g.name;\n\t\t\treturn geo;\n\t\t}", "function transformGeometry(geom) {\n return eltArray.map((r) => r.transformGeometry(geom));\n }", "function getAllSVGInfo (dirName, outputName, paddingValue = null, minify = false, curvePoints = 50) {\n // object that will hold all the relevant data\n let data = {}\n let promiseArray = []\n // reads directory and get all file names\n let filenames = fs.readdirSync(`input/${dirName}`)\n filenames.forEach(filename => {\n // Expects the character to be the file name without extension\n let character = filename.replace('.svg', '')\n // read file and get content\n let fileContent = fs.readFileSync(`./input/${dirName}/${filename}`, 'utf-8')\n // push svgson parsing to the promise array\n promiseArray.push(svgson.parse(fileContent))\n })\n Promise.all(promiseArray).then(svgs => {\n // include index in for each to associate with respective character\n svgs.forEach((svg, i) => {\n let charInfo = {}\n charInfo.layers = {}\n // add padding if passed in the parameters\n if (paddingValue) {\n let vB = svg.attributes.viewBox.split(' ')\n vB[0] = parseInt(vB[0]) - paddingValue\n vB[1] = parseInt(vB[1]) - paddingValue\n vB[2] = parseInt(vB[2]) + (paddingValue * 2)\n vB[3] = parseInt(vB[3]) + (paddingValue * 2)\n charInfo.viewBox = vB.join(' ')\n } else {\n charInfo.viewBox = svg.attributes.viewBox\n }\n svg.children[0].children.forEach(layer => {\n // creates a new node for each layer\n charInfo.layers[layer.attributes.id] = []\n layer.children.forEach(path => {\n let pathInfo = {}\n // round d to two decimals if minify is true\n if (minify) {\n pathInfo.d = pathManipulator(path.attributes.d).round(2).toString()\n } else {\n pathInfo.d = path.attributes.d\n }\n // get id from all paths\n pathInfo.id = path.attributes.id\n // only get start and end points, strokeWidth and total length from interactiveStrokes layer\n if (layer.attributes.id === 'interactiveStrokes') {\n let properties = pathProps.svgPathProperties(pathInfo.d)\n // gets parts from properties\n let lineParts = properties.getParts()\n pathInfo.strokeWidth = path.attributes['stroke-width']\n pathInfo.totalLength = properties.getTotalLength()\n pathInfo.startPoint = lineParts[0].start\n // gets curves to make comparison to drawing\n pathInfo.curve = getCurve(canvas.path(pathInfo.d), curvePoints)\n pathInfo.endPoint = lineParts[lineParts.length - 1].end\n }\n // splice the stroke information to be in the correct stroke order - according to svg id parameters\n charInfo.layers[layer.attributes.id].splice(parseInt(pathInfo.id.replace(/[^0-9]/g,'')) - 1, 0, pathInfo)\n })\n })\n // character will be the file name without extension\n let character = filenames[i].replace('.svg', '')\n data[character] = charInfo\n })\n // save smaller hard-to-read JSON for use and an easy-to-read one\n let readableOutput = JSON.stringify(data, null, 2)\n let output = JSON.stringify(data)\n fs.writeFileSync(`output/${outputName}.json`, output)\n console.log(`Saved ${outputName}.json!`)\n fs.writeFileSync(`output/readable${outputName}.json`, readableOutput)\n console.log(`Saved readable${outputName}.json!`)\n }).catch(err => console.log(err))\n}", "function tn(r){return 0===_kernel_js__WEBPACK_IMPORTED_MODULE_0__.version.indexOf(\"4.\")?_geometry_Polygon_js__WEBPACK_IMPORTED_MODULE_9__.default.fromExtent(r):new _geometry_Polygon_js__WEBPACK_IMPORTED_MODULE_9__.default({spatialReference:r.spatialReference,rings:[[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]]]})}", "function createGraphics(response) {\n // raw GeoJSON data\n var geoJson = response.data;\n // Create an array of Graphics from each GeoJSON feature\n return arrayUtils.map(geoJson.features, function (feature, i) {\n return {\n geometry: new Point({\n x: feature.geometry.coordinates[0],\n y: feature.geometry.coordinates[1]\n }),\n // select only the attributes you care about\n attributes: {\n ObjectID: i,\n title: feature.properties.title,\n type: feature.properties.type,\n place: feature.properties.place,\n depth: feature.geometry.coordinates[2] + \" km\",\n time: feature.properties.time,\n mag: feature.properties.mag,\n mmi: feature.properties.mmi,\n felt: feature.properties.felt,\n sig: feature.properties.sig,\n url: feature.properties.url\n }\n };\n });\n }", "function transformToGeoJson(WKT, fGroup, map) {\n\t\t\tvar wkt = new Wkt.Wkt();\n\t\t\t// Read wkt\n\t\t\ttry { // Catch any malformed WKT strings\n wkt.read(WKT);\n } catch (e1) {\n try {\n wkt.read(WKT.replace('\\n', '').replace('\\r', '').replace('\\t', ''));\n } catch (e2) {\n if (e2.name === 'WKTError') {\n console.log('Could not understand the WKT string. Check that you have parentheses balanced, and try removing tabs and newline characters.');\n return;\n }\n }\n }\n\t\t\t// Convert to object\n\t\t\tvar obj = wkt.toObject({\n icon: new L.Icon({\n iconUrl: 'red_dot.png',\n iconSize: [16, 16],\n iconAnchor: [8, 8],\n shadowUrl: 'dot_shadow.png',\n shadowSize: [16, 16],\n shadowAnchor: [8, 8]\n }),\n editable: true,\n color: '#AA0000',\n weight: 3,\n opacity: 1.0,\n editable: true,\n fillColor: '#AA0000',\n fillOpacity: 0.2\n });\n\t\t\t\n\t\t\t// Draw geometries\n if (Wkt.isArray(obj)) { // Distinguish multigeometries (Arrays) from objects\n for (i in obj) {\n if (obj.hasOwnProperty(i) && !Wkt.isArray(obj[i])) {\n\t\t\t\t\t\tobj[i].addTo(map);\n\t\t\t\t\t\tfGroup.addLayer(obj[i]);\n }\n }\n } else {\n\t\t\t\tobj.addTo(map);\n\t\t\t\tfGroup.addLayer(obj);\n }\n\t\t\treturn obj;\n\t\t}", "function geoFormat(array) {\r\n var data = [];\r\n array.map(function (d, i) {\r\n var feature = {\r\n \"type\" : \"Feature\",\r\n \"geometry\" : {\r\n \"type\" : \"Point\", \r\n \"coordinates\": [d.lon, d.lat]\r\n },\r\n \"properties\" : {\r\n \"id\" : d.id,\r\n \"time\" : d.time,\r\n \"depth\" : d.depth,\r\n \"mag\" : d.mag,\r\n \"place\" : d.place\r\n }\r\n } \r\n data.push(feature);\r\n });\r\n return data;\r\n }", "function u(t){return{renderer:{type:\"simple\",symbol:\"esriGeometryPoint\"===t||\"esriGeometryMultipoint\"===t?_symbols_support_defaultsJSON_js__WEBPACK_IMPORTED_MODULE_3__.defaultPointSymbolJSON:\"esriGeometryPolyline\"===t?_symbols_support_defaultsJSON_js__WEBPACK_IMPORTED_MODULE_3__.defaultPolylineSymbolJSON:_symbols_support_defaultsJSON_js__WEBPACK_IMPORTED_MODULE_3__.defaultPolygonSymbolJSON}}}", "function u(t){return{renderer:{type:\"simple\",symbol:\"esriGeometryPoint\"===t||\"esriGeometryMultipoint\"===t?_symbols_support_defaultsJSON_js__WEBPACK_IMPORTED_MODULE_3__.defaultPointSymbolJSON:\"esriGeometryPolyline\"===t?_symbols_support_defaultsJSON_js__WEBPACK_IMPORTED_MODULE_3__.defaultPolylineSymbolJSON:_symbols_support_defaultsJSON_js__WEBPACK_IMPORTED_MODULE_3__.defaultPolygonSymbolJSON}}}", "function USARigo(error, json, vt, ma, nh, ri, ct) {\n const texture =\n textures.lines()\n .size(3)\n .strokeWidth(2);\n const texture1 =\n textures.lines()\n .size(4)\n .stroke(\"gray\")\n .strokeWidth(1);\n svg.call(texture);\n\n var myData = topojson.feature(json, {\n type: \"GeometryCollection\",\n geometries: json.objects.collection.geometries.filter(function(d) {\n return parseInt(d.properties.state_fips) == selected;\n })\n });\n\n var projection = d3.geoAlbersUsa()\n .fitExtent([\n [20, 20],\n [width, height]\n ], myData);\n\n var path = d3.geoPath()\n .projection(projection);\n /* =============================================== End Texture and Projection Section ============================================================= */\n\n /* =============================================== Start Merge and Texture Section ================================================================ */\n\n\n g.append(\"path\")\n .datum(topojson.merge(json, json.objects.collection.geometries.filter(function(d) {\n var temp = parseInt(d.properties.fips);\n if (d.properties.state_fips == selected || vt1 == selected || ma1 == selected || nh1 == selected || ri1 == selected || ct1 == selected) {\n if (overlapped.includes(temp)) {\n return true;\n } else {\n return false;\n }\n }\n })))\n .attr(\"d\", path)\n .attr(\"fill\", texture.url());\n /* =============================================== End Merge and Texture Section ================================================================== */\n\n /* ======================================================== Start New England Section ==============================================================*/\n\n // Vermont State\n if (selected == vt1) {\n for (keys in rigos) {\n g.append(\"path\")\n .datum(topojson.merge(vt, vt.objects.vt.geometries.filter(function(d) {\n if (vt1 == selected) {\n return rigos[keys].includes(parseInt(d.id));\n }\n })))\n .attr(\"d\", path)\n .attr(\"stroke\", \"black\")\n .style(\"fill\", function(d) { return color(population.get(keys)) })\n .attr(\"fill-opacity\", 0.7)\n .attr(\"stroke-width\", \"1.5\")\n .attr(\"stroke-linejoin\", \"round\")\n .attr(\"stroke-linecap\", \"round\")\n .attr(\"id\", function(d) {\n return keys;\n });\n }\n g.append(\"g\")\n .attr(\"id\", \"state\")\n .selectAll(\"path\")\n .data(topojson.feature(vt, vt.objects.vt).features)\n .enter().append(\"path\")\n .attr(\"d\", path)\n .attr(\"id\", function(d) { return d.id; })\n .attr(\"stroke\", \"black\")\n .attr(\"stroke-width\", \"0.5\")\n .attr(\"fill-opacity\", 0.000009)\n .attr(\"fill\", \"white\")\n .on(\"click\", clicked)\n .on('mouseover', hover)\n .on('mouseout', nohover)\n .style(\"cursor\", \"pointer\");\n }\n // Massachusetts State\n else if (selected == ma1) {\n\n console.log(rigos[keys]);\n\n for (keys in rigos) {\n g.append(\"path\")\n .datum(topojson.merge(ma, ma.objects.ma.geometries.filter(function(d) {\n if (ma1 == selected) {\n return rigos[keys].includes(parseInt(d.id));\n }\n })))\n .attr(\"d\", path)\n .attr(\"stroke\", \"black\")\n .style(\"fill\", function(d) { return color(population.get(keys)) })\n .attr(\"fill-opacity\", 0.7)\n .attr(\"stroke-width\", \"1.5\")\n .attr(\"stroke-linejoin\", \"round\")\n .attr(\"stroke-linecap\", \"round\")\n .attr(\"id\", function(d) {\n return keys;\n });\n }\n g.append(\"g\")\n .attr(\"id\", \"state\")\n .selectAll(\"path\")\n .data(topojson.feature(ma, ma.objects.ma).features)\n .enter().append(\"path\")\n .attr(\"d\", path)\n .attr(\"id\", function(d) { return d.id; })\n .attr(\"stroke\", \"black\")\n .attr(\"stroke-width\", \"0.5\")\n .attr(\"fill-opacity\", 0.000009)\n .attr(\"fill\", \"white\")\n .on(\"click\", clicked)\n .on('mouseover', hover)\n .on('mouseout', nohover)\n .style(\"cursor\", \"pointer\");\n }\n // New Hampshire State\n else if (selected == nh1) {\n for (keys in rigos) {\n g.append(\"path\")\n .datum(topojson.merge(nh, nh.objects.nh.geometries.filter(function(d) {\n if (nh1 == selected) {\n return rigos[keys].includes(parseInt(d.id));\n }\n })))\n .attr(\"d\", path)\n .attr(\"stroke\", \"black\")\n .style(\"fill\", function(d) { return color(population.get(keys)) })\n .attr(\"fill-opacity\", 0.7)\n .attr(\"stroke-width\", \"1.5\")\n .attr(\"stroke-linejoin\", \"round\")\n .attr(\"stroke-linecap\", \"round\")\n .attr(\"id\", function(d) {\n return keys;\n });\n }\n g.append(\"g\")\n .attr(\"id\", \"state\")\n .selectAll(\"path\")\n .data(topojson.feature(nh, nh.objects.nh).features)\n .enter().append(\"path\")\n .attr(\"d\", path)\n .attr(\"id\", function(d) { return d.id; })\n .attr(\"stroke\", \"black\")\n .attr(\"stroke-width\", \"0.5\")\n .attr(\"fill-opacity\", 0.000009)\n .attr(\"fill\", \"white\")\n .on(\"click\", clicked)\n .on('mouseover', hover)\n .on('mouseout', nohover)\n .style(\"cursor\", \"pointer\");\n\n }\n // Rhode Island State\n else if (selected == ri1) {\n for (keys in rigos) {\n g.append(\"path\")\n .datum(topojson.merge(ri, ri.objects.ri.geometries.filter(function(d) {\n if (ri1 == selected) {\n return rigos[keys].includes(parseInt(d.id));\n }\n })))\n .attr(\"d\", path)\n .attr(\"stroke\", \"black\")\n .style(\"fill\", function(d) { return color(population.get(keys)) })\n .attr(\"fill-opacity\", 0.7)\n .attr(\"stroke-width\", \"1.5\")\n .attr(\"stroke-linejoin\", \"round\")\n .attr(\"stroke-linecap\", \"round\")\n .attr(\"id\", function(d) {\n return keys;\n });\n }\n g.append(\"g\")\n .attr(\"id\", \"state\")\n .selectAll(\"path\")\n .data(topojson.feature(ri, ri.objects.ri).features)\n .enter().append(\"path\")\n .attr(\"d\", path)\n .attr(\"id\", function(d) { return d.id; })\n .attr(\"stroke\", \"black\")\n .attr(\"stroke-width\", \"0.5\")\n .attr(\"fill-opacity\", 0.000009)\n .attr(\"fill\", \"white\")\n .on(\"click\", clicked)\n .on('mouseover', hover)\n .on('mouseout', nohover)\n .style(\"cursor\", \"pointer\");\n }\n // Connecticut State\n else if (selected == ct1) {\n for (keys in rigos) {\n g.append(\"path\")\n .datum(topojson.merge(ct, ct.objects.ct.geometries.filter(function(d) {\n if (ct1 == selected) {\n return rigos[keys].includes(parseInt(d.id));\n }\n })))\n .attr(\"d\", path)\n .attr(\"stroke\", \"black\")\n .style(\"fill\", function(d) { return color(population.get(keys)) })\n .attr(\"fill-opacity\", 0.7)\n .attr(\"stroke-width\", \"1.5\")\n .attr(\"stroke-linejoin\", \"round\")\n .attr(\"stroke-linecap\", \"round\")\n .attr(\"id\", function(d) {\n return keys;\n });\n }\n\n g.append(\"g\")\n .selectAll(\"path\")\n .data(topojson.feature(ct, ct.objects.ct).features)\n .enter().append(\"path\")\n .attr(\"d\", path)\n .attr(\"id\", function(d) { return d.id; })\n .attr(\"stroke\", \"black\")\n .attr(\"stroke-width\", \"0.5\")\n .attr(\"fill-opacity\", 0.000009)\n .attr(\"fill\", \"white\")\n .on(\"click\", clicked)\n .on('mouseover', hover)\n .on('mouseout', nohover)\n .style(\"cursor\", \"pointer\");\n }\n /* ======================================================== End New England Section ======================================================== */\n /* ====================================================== Final Layer =====================================================================*/\n else {\n var beyond = [];\n g.append(\"g\")\n .selectAll(\"path\")\n .data(topojson.feature(json, json.objects.collection).features.filter(function(d) { return d.properties.state_fips == selected; }))\n .enter()\n .append(\"path\")\n .attr(\"d\", path)\n .attr(\"id\", function(d) {\n beyond.push(parseInt(d.properties.fips));\n return d.properties.fips;\n })\n .attr(\"stroke\", \"black\")\n .attr(\"stroke-width\", \"0.3\")\n .style(\"fill\", function(d) {\n var id = parseInt(d.properties.fips);\n id = \"\" + id;\n return color(population.get(countyRIGOAffiliationName[id][0]));\n })\n .attr(\"fill-opacity\", 0.7)\n\n .on(\"click\", clicked)\n .on('mouseover', hover)\n .on('mouseout', nohover)\n .style(\"cursor\", \"pointer\");\n\n for (keys in rigos) {\n g.append(\"path\")\n .datum(topojson.merge(json, json.objects.collection.geometries.filter(function(d) {\n if (d.properties.state_fips == selected) {\n return rigos[keys].includes(parseInt(d.properties.fips));\n }\n })))\n .attr(\"d\", path)\n .attr(\"stroke\", \"black\")\n .style(\"fill\", \"none\")\n .attr(\"fill-opacity\", 0.7)\n .attr(\"stroke-width\", \"2\");\n\n }\n\n //console.log(beyond);\n var myRigo = [];\n\n for (i = 0; i < beyond.length; i++) {\n\n if (!myRigo.includes(countyRIGOAffiliationName[beyond[i]][0])) {\n myRigo.push(countyRIGOAffiliationName[beyond[i]][0]);\n if (countyRIGOAffiliationName[beyond[i]][1] != 0) {\n myRigo.push(countyRIGOAffiliationName[beyond[i]][1]);\n }\n }\n }\n\n // console.log(countyRIGOAffiliationName);\n\n var redraw = [];\n for (key in countyRIGOAffiliationName) {\n if (myRigo.includes(countyRIGOAffiliationName[key][0]) || myRigo.includes(countyRIGOAffiliationName[key][1])) {\n if (!beyond.includes(countyRIGOAffiliationName[key][4])) {\n redraw.push(countyRIGOAffiliationName[key][4]);\n }\n }\n }\n\n\n\n\n\n g.append(\"g\")\n .selectAll(\"path\")\n .data(topojson.feature(json, json.objects.collection).features.filter(function(d) { return redraw.includes(parseInt(d.properties.fips)); }))\n .enter()\n .append(\"path\")\n .attr(\"d\", path)\n .style(\"fill\", function(d) {\n var id = parseInt(d.properties.fips);\n id = \"\" + id;\n return color(population.get(countyRIGOAffiliationName[id][1]));\n })\n .attr(\"id\", function(d) {\n return d.properties.fips;\n })\n .attr(\"stroke\", \"black\")\n .attr(\"fill-opacity\", 0.7)\n .attr(\"stroke-width\", \"0.5\")\n .on(\"click\", clicked)\n .on('mouseover', hover)\n .on('mouseout', nohover)\n .style(\"cursor\", \"pointer\");\n\n g.append(\"g\")\n .selectAll(\"path\")\n .data(topojson.feature(json, json.objects.collection).features.filter(function(d) { return redraw.includes(parseInt(d.properties.fips)); }))\n .enter()\n .append(\"path\")\n .attr(\"d\", path)\n .style(\"fill\", function(d) {\n var id = parseInt(d.properties.fips);\n id = \"\" + id;\n return color(population.get(countyRIGOAffiliationName[id][0]));\n })\n .attr(\"id\", function(d) {\n return d.properties.fips;\n })\n .attr(\"stroke\", \"black\")\n .attr(\"fill-opacity\", 0.7)\n .attr(\"stroke-width\", \"0.5\")\n .on(\"click\", clicked)\n .on('mouseover', hover)\n .on('mouseout', nohover)\n .style(\"cursor\", \"pointer\");\n }\n /* ====================================================== Hover Section ====================================================== */\n\n var states_names = {\n \"AL\": \"Alabama\",\n \"AK\": \"Alaska\",\n \"AS\": \"American Samoa\",\n \"AZ\": \"Arizona\",\n \"AR\": \"Arkansas\",\n \"CA\": \"California\",\n \"CO\": \"Colorado\",\n \"CT\": \"Connecticut\",\n \"DE\": \"Delaware\",\n \"DC\": \"District Of Columbia\",\n \"FM\": \"Federated States Of Micronesia\",\n \"FL\": \"Florida\",\n \"GA\": \"Georgia\",\n \"GU\": \"Guam\",\n \"HI\": \"Hawaii\",\n \"ID\": \"Idaho\",\n \"IL\": \"Illinois\",\n \"IN\": \"Indiana\",\n \"IA\": \"Iowa\",\n \"KS\": \"Kansas\",\n \"KY\": \"Kentucky\",\n \"LA\": \"Louisiana\",\n \"ME\": \"Maine\",\n \"MH\": \"Marshall Islands\",\n \"MD\": \"Maryland\",\n \"MA\": \"Massachusetts\",\n \"MI\": \"Michigan\",\n \"MN\": \"Minnesota\",\n \"MS\": \"Mississippi\",\n \"MO\": \"Missouri\",\n \"MT\": \"Montana\",\n \"NE\": \"Nebraska\",\n \"NV\": \"Nevada\",\n \"NH\": \"New Hampshire\",\n \"NJ\": \"New Jersey\",\n \"NM\": \"New Mexico\",\n \"NY\": \"New York\",\n \"NC\": \"North Carolina\",\n \"ND\": \"North Dakota\",\n \"MP\": \"Northern Mariana Islands\",\n \"OH\": \"Ohio\",\n \"OK\": \"Oklahoma\",\n \"OR\": \"Oregon\",\n \"PW\": \"Palau\",\n \"PA\": \"Pennsylvania\",\n \"PR\": \"Puerto Rico\",\n \"RI\": \"Rhode Island\",\n \"SC\": \"South Carolina\",\n \"SD\": \"South Dakota\",\n \"TN\": \"Tennessee\",\n \"TX\": \"Texas\",\n \"UT\": \"Utah\",\n \"VT\": \"Vermont\",\n \"VI\": \"Virgin Islands\",\n \"VA\": \"Virginia\",\n \"WA\": \"Washington\",\n \"WV\": \"West Virginia\",\n \"WI\": \"Wisconsin\",\n \"WY\": \"Wyoming\"\n };\n\n console.log(countyRIGOAffiliationName);\n\n function clicked() {\n\n var id = parseInt(d3.select(this).attr('id'));\n id = \"\" + id;\n console.log(countyRIGOAffiliationName);\n console.log(id);\n d3.select(\"#StateName\").html(states_names[countyRIGOAffiliationName[id][5]]);\n d3.select(\"#CountyName\").html(countyRIGOAffiliationName[id][2]);\n d3.select(\"#RIGOAffiliation1\").html(rigosname.get(countyRIGOAffiliationName[id][0]));\n if (countyRIGOAffiliationName[id][1] != \"0\") {\n d3.select(\"#RIGOAffiliation2\").html(rigosname.get(countyRIGOAffiliationName[id][1]));\n } else {\n d3.select(\"#RIGOAffiliation2\").html(\"NA\");\n }\n }\n\n function hover() {\n d3.select(this).attr(\"stroke\", \"red\");\n }\n\n function nohover() {\n d3.select(this).attr(\"stroke\", \"black\");\n }\n\n\n }", "getGeometryData (geomData) {\n let result = {};\n\n let meshData = geomData.mesh[0];\n let meshSource = meshData.source;\n let vertices = meshData.vertices[0];\n\n if (!meshData.triangles) {\n throw new Error('Only triangles mesh supported');\n }\n\n let triangles = meshData.triangles[0];\n let stride = triangles.input.length;\n\n if (meshData.vertices.length > 1) {\n throw new Error('Multiple mesh.vertices not supported');\n }\n\n let sources = {};\n\n function appendInputSource (input, defaultOffset = 0) {\n for (let i = 0; i < input.length; i++) {\n let inputData = input[i].$;\n let semantic = inputData.semantic;\n\n let offset = inputData.offset;\n if (offset === undefined) {\n offset = defaultOffset;\n }\n\n if (semantic === 'VERTEX') {\n appendInputSource(vertices.input, offset);\n continue;\n };\n\n let source = inputData.source.slice(1); // skip leading #\n if (inputData.set !== undefined) {\n semantic += inputData.set;\n }\n\n sources[semantic] = {\n source: source,\n offset: parseInt(offset)\n };\n }\n }\n\n appendInputSource(triangles.input);\n\n for (let semantic in sources) {\n let source = sources[semantic];\n let arrayID = source.source;\n let offset = source.offset;\n\n result[semantic] = {\n data: this.getGeometryArray(arrayID, meshSource),\n offset: offset\n }\n }\n\n let indices = triangles.p[0].split(\" \");\n for (let i = 0; i < indices.length; i++) {\n indices[i] = parseInt(indices[i]);\n }\n\n result.indices = indices;\n result.stride = stride;\n result.triangleCount = parseInt(triangles.$.count);\n result.renderMode = MODE_TRIANGLES;\n\n return result;\n }", "function extentToGeoJson(x, y) {\n mapImplementation.ExtentToGeoJson(x, y);\n }", "function R(t,e){const o=new w$1({x:t[0],y:t[1],spatialReference:e});return t.length>2&&(o.z=t[2]),o}", "import(callback) {\n let hasVertex = false\n let props = {\n comments: [],\n originalAspectRatio: 1.0,\n fileName: this.fileName\n }\n\n let lines = this.text.split('\\n')\n let thetaRhos = []\n\n for (let ii = 0; ii < lines.length; ii++) {\n var line = lines[ii].trim()\n\n if (line.length === 0) {\n // blank lines\n continue\n }\n\n if (line.indexOf(\"#\") === 0 && !hasVertex) {\n props.comments.push(lines[ii])\n }\n\n if (line.indexOf(\"#\") !== 0) {\n hasVertex = true\n\n // This is a point, let's try to read it.\n var pointStrings = line.split(/\\s+/)\n if (pointStrings.length !== 2) {\n continue\n }\n\n thetaRhos.push([parseFloat(pointStrings[0]), parseFloat(pointStrings[1])])\n }\n }\n\n props.vertices = this.convertToXY(thetaRhos)\n callback(this, props)\n }", "function separateFromMMGIS() {}", "function separateFromMMGIS() {}", "function lineify(inputGeom) {\n var outputLines = {\n \"type\": \"GeometryCollection\",\n \"geometries\": []\n }\n switch (inputGeom.type) {\n case \"GeometryCollection\":\n //for (var i in inputGeom.geometries) {\n\t\t\tfor (var i=0; i<inputGeom.geometries.length; i++) {\n var geomLines = lineify(inputGeom.geometries[i]);\n if (geomLines) {\n\t\t\t\t\tfor (var j=0; j<geomLines.geometries.length; j++) {\n outputLines.geometries.push(geomLines.geometries[j]);\n }\n } else {\n outputLines = false;\n }\n }\n break;\n case \"Feature\":\n var geomLines = lineify(inputGeom.geometry);\n if (geomLines) {\n\t\t\t\tfor (var j=0; j<geomLines.geometries.length; j++) {\n outputLines.geometries.push(geomLines.geometries[j]);\n }\n } else {\n outputLines = false;\n }\n break;\n case \"FeatureCollection\":\n\t\t\tfor (var i=0; i<inputGeom.features.length; i++) {\n var geomLines = lineify(inputGeom.features[i].geometry);\n if (geomLines) {\n //for (var j in geomLines.geometries) {\n\t\t\t\t\tfor (var j=0; j<geomLines.geometries.length; j++) {\n outputLines.geometries.push(geomLines.geometries[j]);\n }\n } else {\n outputLines = false;\n }\n }\n break;\n case \"LineString\":\n outputLines.geometries.push(inputGeom);\n break;\n case \"MultiLineString\":\n case \"Polygon\":\n for (var i=0; i<inputGeom.coordinates.length; i++) {\n outputLines.geometries.push({\n \"type\": \"LineString\",\n \"coordinates\": inputGeom.coordinates[i]\n });\n }\n break;\n case \"MultiPolygon\":\n\t\t\tfor (var i=0; i<inputGeom.coordinates.length; i++) {\n\t\t\t\tfor (var j=0; j<inputGeom.coordinates[i].length; j++) {\n outputLines.geometries.push({\n \"type\": \"LineString\",\n \"coordinates\": inputGeom.coordinates[i][j]\n });\n }\n }\n break;\n default:\n outputLines = false;\n }\n return outputLines;\n}", "function jx(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "synchModel2Geometry() {\n // position update \n this.sheetGeometry.attributes.position.array = new Float32Array(this.model.x_list)\n this.sheetGeometry.attributes.position.needsUpdate = true;\n // color update\n this.sheetGeometry.attributes.color.array = new Float32Array(this.model.x_list.slice(0))\n this.sheetGeometry.attributes.color.needsUpdate = true;\n }", "function ow(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function getPoints() {}", "function csvToGeoJSON(){ //csv = reader.result\r\n\t\t\tvar lines=csv.split(/[\\r\\n]+/); // split for windows and mac csv (newline or carriage return)\r\n\t\t\tdelete window.csv; // reader.result from drag&drop not needed anymore\r\n\t\t\tvar headers=lines[0].split(\",\"); //not needed?\r\n\t\t\tvar matchID = document.getElementById(\"coordIDSelect\").value;\r\n\t\t\tvar xColumn = document.getElementById(\"xSelect\").value;\r\n\t\t\tvar yColumn = document.getElementById(\"ySelect\").value;\r\n\r\n\t\t\t// get the positions of the seleted columns in the header\r\n\t\t\tvar positionMatchID = headers.indexOf(matchID);\r\n\t\t\tvar positionX = headers.indexOf(xColumn);\r\n\t\t\tvar positionY = headers.indexOf(yColumn);\r\n\r\n\t\t\tvar obj_array = []\r\n\t\t\tfor(var i=1;i<lines.length-1;i++){\r\n\t\t\t\tvar json_obj = {\"type\": \"Feature\"};\r\n\t\t\t\tvar currentline=lines[i].split(\",\");\r\n\t\t\t\t//for(var j=0;j<headers.length;j++){\r\n\t\t\t\t\tjson_obj[\"geometry\"] = {\r\n\t\t\t\t\t\t\t\"type\" : \"Point\",\r\n\t\t\t\t\t\t\t\"coordinates\" : [parseFloat(currentline[positionX]), parseFloat(currentline[positionY])]\r\n\t\t\t\t\t};\r\n\t\t\t\t\tjson_obj[\"properties\"] = {};\r\n\t\t\t\t\tjson_obj[\"properties\"][matchID] = currentline[positionMatchID]; // get the name of zaehlstellen variable\r\n\t\t\t\t\tobj_array.push(json_obj);\r\n\t\t\t};\r\n\r\n\t\tvar complete_geojson = {\"type\":\"FeatureCollection\",\r\n\t\t\t\t\t\t\t\t\"features\": obj_array // all objects of the csv\r\n\t\t\t\t\t\t\t\t}\r\n\t//\talert(complete_geojson);\r\n\t\treturn complete_geojson; //return geoJSON\r\n\t}", "function link( geoms ) {\r\n\r\n const g = new THREE.BufferGeometry( );\r\n \r\n g.faceCounts = [];\r\n g.positionCounts = [];\r\n let faceCount = 0;\r\n let positionCount = 0;\r\n \r\n for ( let i = 0; i < geoms.length; i ++ ) {\r\n \r\n g.faceCounts[ i ] = geoms[ i ].index.array.length / 3;\r\n faceCount += g.faceCounts[ i ];\r\n \r\n g.positionCounts[ i ] = geoms[ i ].attributes.position.count;\r\n positionCount += g.positionCounts[ i ];\r\n \r\n }\r\n \r\n const indices = new Uint32Array( faceCount * 3 );\r\n const positions = new Float32Array( positionCount * 3 );\r\n const normals = new Float32Array( positionCount * 3 );\r\n const uvs = new Float32Array( positionCount * 2 );\r\n \r\n g.setIndex( new THREE.BufferAttribute( indices, 1 ) );\t\r\n g.setAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) );\r\n g.setAttribute( 'normal', new THREE.BufferAttribute( normals, 3 ) );\r\n g.setAttribute( 'uv', new THREE.BufferAttribute( uvs, 2 ) );\r\n \r\n let indOffs = 0;\r\n let indVal = 0;\r\n let posOffs = 0;\r\n let uvsOffs = 0;\r\n \r\n for ( let i = 0; i < geoms.length; i ++ ) {\r\n \r\n for ( let j = 0; j <= geoms[ i ].index.array.length; j ++ ) {\r\n \r\n indices[ j + indOffs ] = indVal + geoms[ i ].index.array[ j ] ;\r\n \r\n }\r\n \r\n for ( let j = 0; j < geoms[ i ].attributes.position.count * 3; j ++ ) {\r\n \r\n positions[ j + posOffs ] = geoms[ i ].attributes.position.array[ j ];\r\n\r\n }\r\n \r\n for ( let j = 0; j < geoms[ i ].attributes.normal.count * 3; j ++ ) {\r\n \r\n normals[ j + posOffs ] = geoms[ i ].attributes.normal.array[ j ];\r\n\r\n }\r\n \r\n for ( let j = 0; j < geoms[ i ].attributes.uv.count * 2; j ++ ) {\r\n \r\n uvs[ j + uvsOffs ] = geoms[ i ].attributes.uv.array[ j ];\r\n \r\n }\r\n \r\n g.addGroup( indOffs, g.faceCounts[ i ] * 3, i ); // multi material groups\r\n \r\n indOffs += g.faceCounts[ i ] * 3;\r\n indVal += g.positionCounts[ i ];\r\n posOffs += g.positionCounts[ i ] * 3;\r\n uvsOffs += g.positionCounts[ i ] * 2;\r\n \r\n }\r\n \r\n for ( let i = 0; i < geoms.length; i ++ ) {\r\n \r\n geoms[ i ].dispose( ); // Only if the individual geometries are not required.\r\n \r\n }\r\n \r\n return g;\r\n\r\n}", "_plotChina() {\n\n let bbox = this.svg.node().getBoundingClientRect();\n\n let offset = [\n bbox.width / 2,\n bbox.height / 2,\n ];\n\n this.projection = d3.geo.mercator()\n .center(d3.geo.centroid(chinaJSON))\n .scale(bbox.width * 0.8)\n .translate(offset);\n\n let path = d3.geo.path()\n .projection(this.projection);\n\n this.svg\n .append('path')\n .datum(chinaJSON)\n .attr('d', path);\n\n this.svg\n .append('path')\n .datum(taiwanJSON)\n .style('opacity', 0.5)\n .attr('d', path);\n\n }", "function createCoords(svgid,parameters) {\r\n\tthis.svgid = svgid;\r\n\tthis.id = svgid+'_coords';\r\n\tthis.svg = document.getElementById(svgid);\r\n\tthis.fontSize = parseFloat(getComputedStyle(this.svg).fontSize);\r\n\tlet rem = this.fontSize;\r\n\tlet re = new RegExp(\"rem\");\r\n\t\r\n\t\t// MARGINS\r\n\tlet margin = new Array();\r\n\tlet marginTop,marginRight,marginBottom,marginLeft;\t\r\n\tif( parameters['margin'] != undefined ) { margin = parameters['margin']; }\t\r\n\tmarginTop = re.test(margin[0]) ? parseFloat(margin[0])*rem : parseFloat(margin[0]);\r\n\tmarginRight = re.test(margin[1]) ? parseFloat(margin[1])*rem : parseFloat(margin[1]);\r\n\tmarginBottom = re.test(margin[2]) ? parseFloat(margin[2])*rem : parseFloat(margin[2]);\r\n\tmarginLeft = re.test(margin[3]) ? parseFloat(margin[3])*rem : parseFloat(margin[3]);\r\n\tmargin = [marginTop,marginRight,marginBottom,marginLeft];\r\n\tthis.margin = margin;\r\n\tthis.marginTop = marginTop; this.marginRight = marginRight; this.marginBottom = marginBottom; this.marginLeft = marginLeft;\r\n\t\r\n\t\t// svg area [min-u,max-v,width,height] of the plotBox\t\t\r\n\tthis.plotBox = [marginLeft,marginTop,this.svg.clientWidth-(marginRight+marginLeft),this.svg.clientHeight-(marginTop+marginBottom)];\r\n\t\t// svg coordinate Range\r\n\tthis.uMin = this.plotBox[0];\r\n\tthis.uMax = this.plotBox[0]+this.plotBox[2];\r\n\tthis.vMin = this.plotBox[1];\r\n\tthis.vMax = this.plotBox[1]+this.plotBox[3];\t\r\n \r\n\tthis.defineCoords(parameters);\r\n\t\r\n\t // define two special groups for this coordinate system\r\n var g1 = document.createElementNS('http://www.w3.org/2000/svg', 'g');\r\n var g2 = document.createElementNS('http://www.w3.org/2000/svg', 'g');\r\n\t\r\n /* this.g1.id = this.id+'_g1'; this.g2.id = this.id+'_g2'; */\r\n this.svg.g1 = g1; // default for plots\r\n this.svg.g2 = g2; // default for axes\r\n this.svg.appendChild(g2);\r\n this.svg.appendChild(g1);\r\n\t\r\n\tif( parameters['clip'] == true ) { this.plotObject('clip',{'x1':this.xMin,'x2':this.xMax,'y1':this.yMin,'y2':this.yMax}); }\r\n} // END function createCoords()", "function gp_get_coord(x, y, layer, part) {\n for (obj of gp) {\n if (obj.x == x && obj.y == y && layer == obj.l && part == obj.p) {\n let ret = { type: obj.t }\n if (obj.hasOwnProperty(\"g\")) ret.group = obj.g\n return ret\n }\n }\n return { type: -1 } //-1 = no object\n}", "function S(e){return e instanceof _geometry_Geometry_js__WEBPACK_IMPORTED_MODULE_5__.default}", "function jsonToSvg(parentEl, projectionKey, json) {\n var width = 500;\n var height = 400;\n\n var bbox = findBoundingBox(json);\n var projection = createProjection(projectionKey, bbox, [ width, height ]);\n\n var path = d3.geo.path().projection(projection);\n var graticule = d3.geo.graticule()\n .extent([[ -180, 0 ], [ 180, 90 ]]) // otherwise Conic SVG breaks rsvg\n .step([ 5, 5 ]);\n\n var svg = d3.select(parentEl).append('svg')\n .attr('viewBox', '0 0 ' + width + ' ' + height);\n\n svg.append('path')\n .datum(graticule)\n .attr('class', 'graticule')\n .attr('d', path);\n\n for (var key in json.objects) {\n svg.append('path', '.graticule')\n .datum(topojson.feature(json, json.objects[key]))\n .attr('class', 'province')\n .attr('d', path);\n }\n\n var sw = projection.invert([ 40, height - 40]);\n sw = [\n Math.ceil(sw[0] / GraticuleWidth) * GraticuleWidth,\n Math.ceil(sw[1] / GraticuleWidth) * GraticuleWidth\n ];\n addPointAndTextToSvg(svg, sw, projection, lngLatToText, 6, 'point sw');\n\n var ne = projection.invert([ width - 40, 40 ]);\n ne = [\n Math.floor(ne[0] / GraticuleWidth) * GraticuleWidth,\n Math.floor(ne[1] / GraticuleWidth) * GraticuleWidth\n ];\n if (ne[0] != sw[0] || ne[1] != sw[1]) {\n addPointAndTextToSvg(svg, ne, projection, lngLatToText, -6, 'point ne');\n }\n\n return svg;\n}", "function deserialize() {\n var element = document.getElementById('text');\n var type = document.getElementById(\"formatType\").value;\n var features = formats['in'][type].read(element.value);\n var bounds;\n if(features) {\n if(features.constructor != Array) {\n features = [features];\n }\n for(var i=0; i<features.length; ++i) {\n if (!bounds) {\n bounds = features[i].geometry.getBounds();\n } else {\n bounds.extend(features[i].geometry.getBounds());\n }\n\n }\n vectors.addFeatures(features);\n map.zoomToExtent(bounds);\n var plural = (features.length > 1) ? 's' : '';\n element.value = features.length + ' feature' + plural + ' aggiunte'\n } else {\n element.value = 'Nessun input ' + type;\n }\n}", "function PD(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function extent() { }", "function parseGeometry(FBXTree, relationships, geoNode, deformers) {\n switch (geoNode.attrType) {\n case 'Mesh':\n return parseMeshGeometry(FBXTree, relationships, geoNode, deformers);\n //break;\n case 'NurbsCurve':\n return parseNurbsGeometry(geoNode);\n }\n}", "function processGeometry( g ) {\n\n\t\t\tvar info = geometryInfo.get( g );\n\n\t\t\tif ( ! info ) {\n\n\t\t\t\t// convert the geometry to bufferGeometry if it isn't already\n\t\t\t\tvar bufferGeometry = g;\n\t\t\t\tif ( bufferGeometry instanceof Geometry ) {\n\n\t\t\t\t\tbufferGeometry = ( new BufferGeometry() ).fromGeometry( bufferGeometry );\n\n\t\t\t\t}\n\n\t\t\t\tvar meshid = \"Mesh\" + (libraryGeometries.length + 1);\n\n\t\t\t\tvar indexCount =\n\t\t\t\t\tbufferGeometry.index ?\n\t\t\t\t\t\tbufferGeometry.index.count * bufferGeometry.index.itemSize :\n\t\t\t\t\t\tbufferGeometry.attributes.position.count;\n\n\t\t\t\tvar groups =\n\t\t\t\t\tbufferGeometry.groups != null && bufferGeometry.groups.length !== 0 ?\n\t\t\t\t\t\tbufferGeometry.groups :\n\t\t\t\t\t\t[ { start: 0, count: indexCount, materialIndex: 0 } ];\n\n\t\t\t\tvar gnode = \"<geometry id=\\\"\" + meshid + \"\\\" name=\\\"\" + (g.name) + \"\\\"><mesh>\";\n\n\t\t\t\t// define the geometry node and the vertices for the geometry\n\t\t\t\tvar posName = meshid + \"-position\";\n\t\t\t\tvar vertName = meshid + \"-vertices\";\n\t\t\t\tgnode += getAttribute( bufferGeometry.attributes.position, posName, [ 'X', 'Y', 'Z' ], 'float' );\n\t\t\t\tgnode += \"<vertices id=\\\"\" + vertName + \"\\\"><input semantic=\\\"POSITION\\\" source=\\\"#\" + posName + \"\\\" /></vertices>\";\n\n\t\t\t\t// NOTE: We're not optimizing the attribute arrays here, so they're all the same length and\n\t\t\t\t// can therefore share the same triangle indices. However, MeshLab seems to have trouble opening\n\t\t\t\t// models with attributes that share an offset.\n\t\t\t\t// MeshLab Bug#424: https://sourceforge.net/p/meshlab/bugs/424/\n\n\t\t\t\t// serialize normals\n\t\t\t\tvar triangleInputs = \"<input semantic=\\\"VERTEX\\\" source=\\\"#\" + vertName + \"\\\" offset=\\\"0\\\" />\";\n\t\t\t\tif ( 'normal' in bufferGeometry.attributes ) {\n\n\t\t\t\t\tvar normName = meshid + \"-normal\";\n\t\t\t\t\tgnode += getAttribute( bufferGeometry.attributes.normal, normName, [ 'X', 'Y', 'Z' ], 'float' );\n\t\t\t\t\ttriangleInputs += \"<input semantic=\\\"NORMAL\\\" source=\\\"#\" + normName + \"\\\" offset=\\\"0\\\" />\";\n\n\t\t\t\t}\n\n\t\t\t\t// serialize uvs\n\t\t\t\tif ( 'uv' in bufferGeometry.attributes ) {\n\n\t\t\t\t\tvar uvName = meshid + \"-texcoord\";\n\t\t\t\t\tgnode += getAttribute( bufferGeometry.attributes.uv, uvName, [ 'S', 'T' ], 'float' );\n\t\t\t\t\ttriangleInputs += \"<input semantic=\\\"TEXCOORD\\\" source=\\\"#\" + uvName + \"\\\" offset=\\\"0\\\" set=\\\"0\\\" />\";\n\n\t\t\t\t}\n\n\t\t\t\t// serialize colors\n\t\t\t\tif ( 'color' in bufferGeometry.attributes ) {\n\n\t\t\t\t\tvar colName = meshid + \"-color\";\n\t\t\t\t\tgnode += getAttribute( bufferGeometry.attributes.color, colName, [ 'X', 'Y', 'Z' ], 'uint8' );\n\t\t\t\t\ttriangleInputs += \"<input semantic=\\\"COLOR\\\" source=\\\"#\" + colName + \"\\\" offset=\\\"0\\\" />\";\n\n\t\t\t\t}\n\n\t\t\t\tvar indexArray = null;\n\t\t\t\tif ( bufferGeometry.index ) {\n\n\t\t\t\t\tindexArray = attrBufferToArray( bufferGeometry.index );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tindexArray = new Array( indexCount );\n\t\t\t\t\tfor ( var i = 0, l = indexArray.length; i < l; i ++ ) { indexArray[ i ] = i; }\n\n\t\t\t\t}\n\n\t\t\t\tfor ( var i = 0, l = groups.length; i < l; i ++ ) {\n\n\t\t\t\t\tvar group = groups[ i ];\n\t\t\t\t\tvar subarr = subArray( indexArray, group.start, group.count );\n\t\t\t\t\tvar polycount = subarr.length / 3;\n\t\t\t\t\tgnode += \"<triangles material=\\\"MESH_MATERIAL_\" + (group.materialIndex) + \"\\\" count=\\\"\" + polycount + \"\\\">\";\n\t\t\t\t\tgnode += triangleInputs;\n\n\t\t\t\t\tgnode += \"<p>\" + (subarr.join( ' ' )) + \"</p>\";\n\t\t\t\t\tgnode += '</triangles>';\n\n\t\t\t\t}\n\n\t\t\t\tgnode += \"</mesh></geometry>\";\n\n\t\t\t\tlibraryGeometries.push( gnode );\n\n\t\t\t\tinfo = { meshid: meshid, bufferGeometry: bufferGeometry };\n\t\t\t\tgeometryInfo.set( g, info );\n\n\t\t\t}\n\n\t\t\treturn info;\n\n\t\t}", "boundaryToSVG() {\n var points = this.getOrientedEdges();\n var svgString = \"M\";\n for (var i = 0; i < points.length; i++) {\n var point = points[i];\n svgString += point.x.toString() + \" \" + point.y.toString() + \" \";\n }\n svgString += points[0].x.toString() + \" \" + points[0].y.toString() + \" \";\n this.svg = svgString;\n return svgString;\n }", "function separateFromMMGIS() {\n\n }", "async function eonitem (__eo = {}) {\n let [\r\n d3Geo,\r\n ] = await Promise.all([\r\n __eo('xs').b('d3-geo'),\r\n ])\r\n\r\n let noop = function () {}\r\n\r\n var clockwise = function (ring) {\r\n let n\r\n if ((n = ring.length) < 4) return false\r\n let i = 0,\r\n area = ring[n - 1][1] * ring[0][0] - ring[n - 1][0] * ring[0][1]\r\n while (++i < n) area += ring[i - 1][1] * ring[i][0] - ring[i - 1][0] * ring[i][1]\r\n return area <= 0\r\n }\r\n\r\n var contains = function (ring, point) {\r\n var x = point[0],\r\n y = point[1],\r\n contains = false\r\n for (let i = 0, n = ring.length, j = n - 1; i < n; j = i++) {\r\n var pi = ring[i], xi = pi[0], yi = pi[1],\r\n pj = ring[j], xj = pj[0], yj = pj[1]\r\n if (((yi > y) ^ (yj > y)) && (x < (xj - xi) * (y - yi) / (yj - yi) + xi)) contains = !contains\r\n }\r\n return contains\r\n }\r\n\r\n var project = function (object, projection) { // index\n var stream = projection.stream, project\r\n if (!stream) throw new Error('invalid projection', projection)\r\n switch (object && object.type) {\r\n case 'Feature': project = projectFeature; break\r\n case 'FeatureCollection': project = projectFeatureCollection; break\r\n default: project = projectGeometry; break\r\n }\r\n return project(object, stream)\r\n }\r\n\r\n function projectFeatureCollection (o, stream) {\r\n return {\r\n type: 'FeatureCollection',\r\n features: o.features.map(function (f) {\r\n return projectFeature(f, stream)\r\n }),\r\n }\r\n }\r\n\r\n function projectFeature (o, stream) {\r\n let geometry = projectGeometry(o.geometry, stream)\r\n let ret = {\r\n type: 'Feature',\r\n // id: o.id,\r\n properties: o.properties,\r\n geometry: geometry,\r\n }\r\n return ret\r\n }\r\n\r\n function projectGeometryCollection (o, stream) {\r\n return {\r\n type: 'GeometryCollection',\r\n geometries: o.geometries.map(function (o) {\r\n return projectGeometry(o, stream)\r\n }),\r\n }\r\n }\r\n\r\n function projectGeometry (o, stream) {\r\n if (!o) return null\r\n if (o.type === 'GeometryCollection') return projectGeometryCollection(o, stream)\r\n var sink\r\n switch (o.type) {\r\n case 'Point': sink = sinkPoint; break\r\n case 'MultiPoint': sink = sinkPoint; break\r\n case 'LineString': sink = sinkLine; break\r\n case 'MultiLineString': sink = sinkLine; break\r\n case 'Polygon': sink = sinkPolygon; break\r\n case 'MultiPolygon': sink = sinkPolygon; break\r\n case 'Sphere': sink = sinkPolygon; break\r\n default: return null\r\n }\r\n\r\n let streamSink = stream(sink)\r\n\r\n d3Geo.geoStream(o, streamSink)\r\n // return sink.result()\r\n\r\n let ret = sink.result()\r\n return ret\r\n }\r\n\r\n var points = []\r\n var lines = []\r\n\r\n var sinkPoint = {\r\n point: function (x, y, z) {\r\n let point = (z === undefined) ? [x, y] : [x, y, z]\r\n points.push(point) // ____ z ____\r\n },\r\n result: function () {\r\n var result = !points.length ? null\r\n : points.length < 2 ? {type: 'Point', coordinates: points[0]}\r\n : {type: 'MultiPoint', coordinates: points}\r\n points = []\r\n\r\n return result\r\n },\r\n }\r\n\r\n var sinkLine = {\r\n lineStart: noop,\r\n point: function (x, y, z) {\r\n let point = (z === undefined) ? [x, y] : [x, y, z]\r\n points.push(point) // ____ z ____\r\n },\r\n lineEnd: function () {\r\n if (points.length) lines.push(points), points = []\r\n },\r\n result: function () {\n var result = !lines.length ? null\r\n : lines.length < 2 ? {type: 'LineString', coordinates: lines[0]}\r\n : {type: 'MultiLineString', coordinates: lines}\r\n lines = []\r\n\r\n return result\r\n },\r\n }\r\n\r\n var sinkPolygon = {\r\n polygonStart: noop,\r\n lineStart: noop,\r\n point: function (x, y, z) {\r\n points.push([x, y, z]) // z\r\n },\r\n lineEnd: function () {\r\n var n = points.length\r\n if (n) {\r\n do points.push(points[0].slice()); while (++n < 4)\r\n lines.push(points), points = []\r\n }\r\n },\r\n polygonEnd: noop,\r\n result: function () {\r\n if (!lines.length) return null\r\n var polygons = [],\r\n holes = []\r\n\r\n // https://github.com/d3/d3/issues/1558\r\n lines.forEach(function (ring) {\r\n if (clockwise(ring)) polygons.push([ring])\r\n else holes.push(ring)\r\n })\r\n\r\n holes.forEach(function (hole) {\r\n var point = hole[0]\r\n polygons.some(function (polygon) {\r\n if (contains(polygon[0], point)) {\r\n polygon.push(hole)\r\n return true\r\n }\r\n }) || polygons.push([hole])\r\n })\r\n\r\n lines = []\r\n\r\n return !polygons.length ? null\r\n : polygons.length > 1 ? {type: 'MultiPolygon', coordinates: polygons}\r\n : {type: 'Polygon', coordinates: polygons[0]}\r\n },\r\n }\r\n\r\n // ............................. enty\r\n let enty = project\r\n enty.project = project\r\n return enty\n }", "function addGeoObject() {\n\n // Show the loader at the beginning of this function\n $(\"#container\").addClass(\"grayscaleAndLighten\");\n TweenLite.to($('#overlay'), .5, {autoAlpha: .75, delay: 0});\n TweenLite.to($('#loader_gif'), 0, {autoAlpha: 1, delay: 0});\n \n // calculate the max and min of all the property values\n var gas_eff_min_max = d3.extent(data.features, function(feature){\n return feature.properties.gas_rank;\n });\n\n var elec_eff_min_max = d3.extent(data.features, function(feature){\n return feature.properties.elect_rank;\n });\n // convert to mesh and calculate values\n _.each(data.features, function (geoFeature) {\n var feature = geo.path(geoFeature);\n var centroid = geo.path.centroid(geoFeature);\n\n // we only need to convert it to a three.js path\n mesh = transformSVGPathExposed(feature);\n // the two different scales that we use, extrude determines\n // the height and color is obviously color. You can choose\n // from the max_min that we calculated above, ensure this\n // matches with below where you call these functions.\n\n var color_scale = d3.scale.quantile()\n //var color_scale = d3.scale.ordinal()\n .domain(gas_eff_min_max)\n //.range([ 'red', 'blue', 'purple']);\n .range(colorbrewer.RdYlGn[9]);\n\n var extrude_scale = d3.scale.linear()\n .domain(elec_eff_min_max)\n .range([10, 75]);\n\n // create material color based on gas efficiency Ensure the\n // property matches with the scale above, we'll add automatic\n // matching functionality later\n\n if (geoFeature.properties.gas_efficiency === 0){\n var hexMathColor = parseInt(\"0xAAAAAA\");\n }\t\n else{\n var mathColor = color_scale(geoFeature.properties.gas_rank);\n var hexMathColor = parseInt(mathColor.replace(\"#\", \"0x\"));\n } \n\n material = new THREE.MeshLambertMaterial({\n color: hexMathColor\n });\n\n // create extrude based on electricity efficiency\n var extrude = extrude_scale(geoFeature.properties.elect_rank);\n\n // Add the attributes to the mesh for the height of the polygon\n var shape3d = mesh.extrude({\n amount: Math.round(extrude * extrudeMultiplier),\n bevelEnabled: false\n });\n\n // create a mesh based on material and extruded shape\n var hoodMesh = new THREE.Mesh(shape3d, material);\n // rotate and position the elements nicely in the center\n hoodMesh.rotation.x = Math.PI / 2;\n hoodMesh.translateY(extrude / 2);\n\n // zero all y positions of extruded objects\n hoodMesh.position.y = extrude * extrudeMultiplier;\n hoodMesh.properties = geoFeature.properties;\n hoodMesh.properties.shape = geoFeature.geometry.coordinates[0]\n hoodMesh.castShadow = true;\n hoodMesh.receiveShadow = false;\n hoodMesh.properties.centroid = centroid;\n\n var obj = {}\n obj.shape3d = shape3d;\n obj.material = material;\n obj.extrude = extrude * extrudeMultiplier;\n obj.mesh = hoodMesh;\n obj.props = hoodMesh.properties;\n neighborhoods.push(obj);\n \n // add to scene\n scene.add(hoodMesh);\n });\n\n // Remove the loader gif at the end of this function\n TweenLite.to($('#overlay'), .5, {autoAlpha: 0});\n TweenLite.to($('#loader_gif'), .5, {autoAlpha: 0});\n TweenLite.delayedCall(.5, colorizeMap);\n}", "function dp(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Hg(a){var b;C&&(b=a.Mf());var c=A(\"xml\");a=Vc(a,!0);for(var d=0,e;e=a[d];d++){var g=Ig(e);e=e.ma();g.setAttribute(\"x\",C?b-e.x:e.x);g.setAttribute(\"y\",e.y);c.appendChild(g)}return c}", "async function e(r,a,e){const n=r$1(r),i={...e},p=R.from(a),{data:u}=await y$1(n,p,p.sourceSpatialReference,i);return u}", "function convertFeature(feature, geom_type) {\n var newFeature = {type: \"Feature\"};\n var pts = (geom_type === 'Point') ? gml2coord(feature.pos)[0] : gml2coord(feature.posList);\n newFeature.geometry = { \"type\": geom_type, \"coordinates\": pts };\n return newFeature;\n}", "function ConvertirGeometriaAJson(CadenaGeometria) {\n var ArregloPuntosGeometrias = [];\n if (CadenaGeometria.indexOf('GEOMETRYCOLLECTION') != -1) {\n CadenaGeometria = CadenaGeometria.replace(\"GEOMETRYCOLLECTION (\", '');\n CadenaGeometria = CadenaGeometria.split(')))').join('))');\n var poligonos = CadenaGeometria.split('),');\n\n CadenaGeometria = '';\n for (var i = 0; i < poligonos.length; i++) {\n var CadenaResultado = poligonos[i] + \")\";\n if (poligonos[i].indexOf(\"MULTIPOLYGON\") != -1) {\n CadenaResultado = CadenaResultado.replace(\" MULTIPOLYGON ((\", 'MULTIPOLYGON ((');\n CadenaResultado = CadenaResultado.replace(\"MULTIPOLYGON ((\", '');\n CadenaResultado = CadenaResultado.split(\", \").join(',');\n CadenaResultado = CadenaResultado.split(\"), \").join(\"@\");\n CadenaResultado = CadenaResultado.split(\"(\").join('');\n CadenaResultado = CadenaResultado.split(\")\").join('');\n CadenaResultado = CadenaResultado.split(' ').join('');\n if (i < (poligonos.length - 1)) {\n CadenaGeometria += CadenaResultado + \"@\";\n }\n else {\n CadenaGeometria += CadenaResultado;\n }\n }\n else if (poligonos[i].indexOf(\"POLYGON\") != -1) {\n CadenaResultado = CadenaResultado.replace(' POLYGON', 'POLYGON');\n CadenaResultado = CadenaResultado.replace(\"POLYGON (\", '');\n CadenaResultado = CadenaResultado.split(\", \").join(',');\n CadenaResultado = CadenaResultado.split(\"(\").join('');\n CadenaResultado = CadenaResultado.split(\")\").join('');\n if (i < (poligonos.length - 1)) {\n CadenaGeometria += CadenaResultado + \"@\";\n }\n else {\n CadenaGeometria += CadenaResultado;\n }\n }\n }\n }\n else if (CadenaGeometria.indexOf('MULTIPOLYGON') != -1) {\n CadenaGeometria = CadenaGeometria.replace(\" MULTIPOLYGON ((\", 'MULTIPOLYGON ((');\n CadenaGeometria = CadenaGeometria.replace(\"MULTIPOLYGON ((\", '');\n CadenaGeometria = CadenaGeometria.split(\", \").join(',');\n CadenaGeometria = CadenaGeometria.split(\"), \").join(\"@\");\n CadenaGeometria = CadenaGeometria.split(\"(\").join('');\n CadenaGeometria = CadenaGeometria.split(\")\").join('');\n CadenaGeometria = CadenaGeometria.split(' ').join('');\n }\n else if (CadenaGeometria.indexOf('POLYGON') != -1) {\n CadenaGeometria = CadenaGeometria.replace(' POLYGON', 'POLYGON');\n CadenaGeometria = CadenaGeometria.replace(\"POLYGON (\", '');\n CadenaGeometria = CadenaGeometria.split(\", \").join(',');\n CadenaGeometria = CadenaGeometria.split(\"(\").join('');\n CadenaGeometria = CadenaGeometria.split(\")\").join('');\n }\n else if (CadenaGeometria.indexOf('POINT') != -1) {\n\n CadenaGeometria = CadenaGeometria.split(\"POINT (\").join('');\n CadenaGeometria = CadenaGeometria.split(\")\").join('');\n }\n else if (CadenaGeometria.indexOf('LINESTRING') != -1) {\n CadenaGeometria = CadenaGeometria.split(\"LINESTRING (\").join('');\n CadenaGeometria = CadenaGeometria.split(\", \").join(',');\n CadenaGeometria = CadenaGeometria.split(\")\").join('');\n }\n var Geometrias = CadenaGeometria.split('@');\n for (var i = 0; i < Geometrias.length; i++) {\n var arregloPuntos = [];\n var puntos = Geometrias[i].split(',');\n for (var j = 0; j < puntos.length; j++) {\n var cadenaPunto = puntos[j].split(' ');\n arregloPuntos.push({ x: cadenaPunto[0], y: cadenaPunto[1] });\n }\n ArregloPuntosGeometrias.push(arregloPuntos);\n }\n\n return ArregloPuntosGeometrias;\n\n}", "addFeature(pid, json) {\n let self = this;\n let options = Object.assign({\n \"map\": \"default\",\n \"layer\": \"default\",\n \"values\": {}\n }, json);\n let map = self.maps[options.map].object;\n let layer = self.maps[options.map].layers[options.layer];\n let view = map.getView();\n let source = layer.getSource();\n console.log(layer);\n let projection = \"EPSG:\" + options.geometry.match(/SRID=(.*?);/)[1];\n let wkt = options.geometry.replace(/SRID=(.*?);/, '');\n let format = new ol_format_WKT__WEBPACK_IMPORTED_MODULE_10__[\"default\"]();\n let feature = format.readFeature(wkt);\n options.values.geometry = feature.getGeometry().transform(projection, view.getProjection().getCode());\n source.addFeature(new ol__WEBPACK_IMPORTED_MODULE_1__[\"Feature\"](options.values));\n self.finished(pid, self.queue.DEFINE.FIN_OK);\n }", "function cs_geocentric_from_wgs84( defn, p ) {\n\n if( defn.datum_type == PJD_3PARAM )\n {\n //if( x[io] == HUGE_VAL )\n // continue;\n p.x -= defn.datum_params[0];\n p.y -= defn.datum_params[1];\n p.z -= defn.datum_params[2];\n\n }\n else // if( defn.datum_type == PJD_7PARAM )\n {\n var Dx_BF =defn.datum_params[0];\n var Dy_BF =defn.datum_params[1];\n var Dz_BF =defn.datum_params[2];\n var Rx_BF =defn.datum_params[3];\n var Ry_BF =defn.datum_params[4];\n var Rz_BF =defn.datum_params[5];\n var M_BF =defn.datum_params[6];\n var x_tmp = (p.x - Dx_BF) / M_BF;\n var y_tmp = (p.y - Dy_BF) / M_BF;\n var z_tmp = (p.z - Dz_BF) / M_BF;\n //if( x[io] == HUGE_VAL )\n // continue;\n\n p.x = x_tmp + Rz_BF*y_tmp - Ry_BF*z_tmp;\n p.y = -Rz_BF*x_tmp + y_tmp + Rx_BF*z_tmp;\n p.z = Ry_BF*x_tmp - Rx_BF*y_tmp + z_tmp;\n }\n}", "function calculate_coordinates () {\n\t }", "function serialize(feature) {\n var str = formats['out'][outformaType].write(feature);\n\t\t\tExt.getCmp('outputgeom').setValue(str);\n }", "function wkt_make_geogcs(P) {\n var geogcs = {\n NAME: wkt_get_geogcs_name(P),\n DATUM: wkt_make_datum(P),\n PRIMEM: ['Greenwich', 0], // TODO: don't assume greenwich\n UNIT: ['degree', 0.017453292519943295] // TODO: support other units\n };\n return geogcs;\n}", "toString() {\n const { _coords } = this\n let result = '[Polygon'\n const numPoints = this.numVertices\n\n if (numPoints > 0) result += '\\n'\n\n for (let i = 0; i < numPoints; ++i) {\n result +=\n ' [Vertex ' +\n i +\n ': ' +\n 'x=' +\n _coords[i * 2].toFixed(1) +\n ', ' +\n 'y=' +\n _coords[i * 2 + 1].toFixed(1) +\n ']' +\n (i === numPoints - 1 ? '\\n' : ',\\n')\n }\n\n return result + ']'\n }", "prim_lat_dec(s, h, k) {\n\t\t\tif(s) {\n\t\t\t\tlet s_lat = s;\n\t\t\t\tlet s_lng = h.prim_long_dec;\n\t\t\t\tlet p_geom_iri = `${P_GEOM_URI}/point/gnisf.${h.feature_id}`;\n\t\t\t\tlet s_point_wkt = `POINT(${s_lng} ${s_lat})`;\n\t\t\t\tds_geoms.write(`${p_geom_iri}\\tSRID=4326;${s_point_wkt}\\n`);\n\n\t\t\t\t// add wkt literal to geometry node\n\t\t\t\tk.write({\n\t\t\t\t\ttype: 'c3',\n\t\t\t\t\tvalue: {\n\t\t\t\t\t\t[`>${p_geom_iri}`]: {\n\t\t\t\t\t\t\t'geosparql:asWKT': [`^geosparql:wktLiteral\"<http://www.opengis.net/def/crs/OGC/1.3/CRS84>${s_point_wkt}`],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t});\n\n\t\t\t\t// geometry uri\n\t\t\t\treturn {\n\t\t\t\t\t'ago:geometry': [`>${p_geom_iri}`],\n\t\t\t\t};\n\t\t\t}\n\t\t}", "async function i(e,i,f){const m=\"string\"==typeof e?U(e):e,p=i[0].spatialReference,a=d$1(i[0]),u={...f,query:{...m.query,f:\"json\",sr:p.wkid?p.wkid:JSON.stringify(p),geometries:JSON.stringify(s(i))}};return n((await U$1(m.path+\"/simplify\",u)).data,a,p)}", "function getGeoserverMiniatura(denuncia, width){\n\n\tconsole.log(denuncia);\n\t\n\ttipo = denuncia.geometria.type;\n\tcoords = denuncia.geometria.coordinates;\n\t//alert(coords + ' ' + tipo);\n\tvar extension = [];\n\tvar tabla = '';\n\tif(tipo == 'Point'){\n\t\textension = new ol.geom.Point(coords).getExtent();\n\t\ttabla = 'denuncias_puntos';\n\t}\n\tif(tipo == 'LineString'){\n\t\textension = new ol.geom.LineString(coords).getExtent();\n\t\ttabla = 'denuncias_lineas';\n\t}\n\tif(tipo == 'Polygon'){\n\t\textension = new ol.geom.Polygon(coords).getExtent();\n\t\ttabla = 'denuncias_poligonos';\n\t}\n\t//alert(extension);\n\textension[0] = extension[0] - 0.001; //Xmin\n\textension[1] = extension[1] - 0.001; //Ymin\n\textension[2] = extension[2] + 0.001; //Xmax\n\textension[3] = extension[3] + 0.001; //Ymax\n\t\t\n\tvar dif = Math.abs(extension[2] - extension[0]) / Math.abs(extension[3] - extension[1]) ;\n\tvar height = Math.round(width / dif);\n\t//alert(ip);\n\treturn ip + \"/geoserver/jahr/wms?service=WMS&version=1.1.0&request=GetMap\" +\n\t\t\"&layers=jahr:OI.OrthoimageCoverage,jahr:\" + tabla + \"&styles=&bbox=\" + \n\t\textension + \"&width=\" + width + \"&height=\" + height + \n\t\t\"&srs=EPSG:4258&format=image/png&cql_filter=1=1;gid='\" + denuncia.gid + \"'\";\n\n}", "function updateFormats() {\n\t\tvar inOptions = {\n\t\t\t'internalProjection': map.baseLayer.projection,\n 'externalProjection': new OpenLayers.Projection(OpenLayers.Util.getElement(\"inproj\").value)\n }; \n var outOptions = {\n 'internalProjection': map.baseLayer.projection,\n 'externalProjection': new OpenLayers.Projection(OpenLayers.Util.getElement(\"outproj\").value)\n };\n var gmlOptions = {\n \tfeatureType: \"feature\",\n featureNS: \"\"\n };\n var gmlOptionsIn = OpenLayers.Util.extend(\n OpenLayers.Util.extend({}, gmlOptions),\n inOptions\n );\n var gmlOptionsOut = OpenLayers.Util.extend(\n OpenLayers.Util.extend({}, gmlOptions),\n outOptions\n );\n var kmlOptionsIn = OpenLayers.Util.extend(\n {extractStyles: true}, inOptions)\n \tformats = {\n \t 'in': {\n \t WKT: new OpenLayers.Format.WKT(inOptions),\n \t GeoJSON: new OpenLayers.Format.GeoJSON(inOptions),\n \t GeoRSS: new OpenLayers.Format.GeoRSS(inOptions),\n \t GML2: new OpenLayers.Format.GML.v2(gmlOptionsIn),\n \t GML3: new OpenLayers.Format.GML.v3(gmlOptionsIn),\n \t KML: new OpenLayers.Format.KML(kmlOptionsIn)\n \t\t}, \n \t\t'out': {\n \t WKT: new OpenLayers.Format.WKT(outOptions),\n \t GeoJSON: new OpenLayers.Format.GeoJSON(outOptions),\n \t GeoRSS: new OpenLayers.Format.GeoRSS(outOptions),\n \t GML2: new OpenLayers.Format.GML.v2(gmlOptionsOut),\n \t GML3: new OpenLayers.Format.GML.v3(gmlOptionsOut),\n \t KML: new OpenLayers.Format.KML(outOptions)\n \t} \n };\n}", "getPoints(options: Object, widthIn: number, heightIn: number) {\n const {\n side,\n } = options;\n let leftPoints;\n let rightPoints;\n let width;\n let height;\n if (side === 'left' || side === 'right') {\n [leftPoints, rightPoints, width, height] = this.getLeftPoints(\n options, widthIn, heightIn,\n );\n } else {\n [leftPoints, rightPoints, width, height] = this.getLeftPoints(\n options, heightIn, widthIn,\n );\n }\n\n // The points of the glyph are for side 'left' by default\n // Transform the glyph to the correct side and have it's lower left corner\n // at (0, 0) and be\n let t;\n if (side === 'right') {\n t = new Transform().scale(-1, 1).translate(width, 0);\n } else if (side === 'top') {\n t = new Transform()\n .translate(0, -height / 2)\n .rotate(-Math.PI / 2)\n .translate(height / 2, width);\n } else if (side === 'bottom') {\n t = new Transform()\n .translate(0, -height / 2)\n .rotate(Math.PI / 2)\n .translate(height / 2, 0);\n } else {\n t = new Transform();\n }\n const newPointsLeft = leftPoints.map(p => p.transformBy(t.m()));\n const newPointsRight = rightPoints.map(p => p.transformBy(t.m()));\n const points = [];\n newPointsLeft.forEach((r1p, index) => {\n const r2p = newPointsRight[index];\n points.push(r1p);\n points.push(r2p);\n });\n if (side === 'top' || side === 'bottom') {\n return [points, height, width, 'STRIP'];\n }\n return [points, width, height, 'STRIP'];\n }", "toGeoJSON () {\n return this.area\n }", "_createMap(filePath) {\n let mapObjectTag = document.createElement('object');\n mapObjectTag.setAttribute('data', filePath);\n mapObjectTag.setAttribute('type', 'image/svg+xml');\n return mapObjectTag;\n }", "function hA(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "updateD3(props) {\n const {chinaTopoJson,width,height}=props\n \n this.projection = d3.geoMercator()\n .scale(1)\n .translate([0, 0]);\n\n this.areas = chinaTopoJson.features;\n this.border = chinaTopoJson.features;\n this.path = d3.geoPath().projection(this.projection);\n\n //确定边界,左上与右下 坐标\n let b = this.path.bounds(chinaTopoJson);\n //选出高和宽之中占比大的那个。\n this.s = .95 / Math.max((b[1][0] - b[0][0]) / width, (b[1][1] - b[0][1]) / height);\n this.t = [(width - this.s * (b[1][0] + b[0][0])) / 2, (height - this.s * (b[1][1] + b[0][1])) / 2*1];\n\n this.projection = d3.geoMercator()\n .scale(this.s)\n .translate(this.t);\n this.geoPath = d3.geoPath()\n .projection(this.projection);\n \n }", "function makecncsvgexport()\n{\n var c,d,x,y,x0,y0,pts,txt=\"\";\n getdefaults();\n var sfx=cutterwidth/(xmax-xmin);\n var sfy=cutterheight/(ymax-ymin);\n switch(originpos)\n {\n case 0: originx=0; originy=0; break; // Bottom left\n case 1: originx=0; originy=cutterheight; break; // Top left\n case 2: originx=cutterwidth; originy=0; break; // Bottom right\n case 3: originx=cutterwidth; originy=cutterheight; break; // Top right\n case 4: originx=cutterwidth/2; originy=cutterheight/2; break; // Middle\n }\n txt+='<?xml version=\"1.0\" encoding=\"utf-8\"?>\\r\\n';\n txt+='<svg id=\"gcodercncsvg\" width=\"'+cutterwidth+'px\" height=\"'+cutterheight+'px\" style=\"background-color:#FFFFFF\" version=\"1.1\" ';\n txt+='xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns=\"http://www.w3.org/2000/svg\" ';\n txt+=makedefaultsparams()+' ';\n txt+='>\\r\\n';\n for(c=0;c<commands.length;c++)\n {\n if(commands[c][0]==='L')\n {\n pts=commands[c][1];\n pts=scaletoolpath(pts,sfx,sfy,cutterheight);\n pts=simplifytoolpath(pts,arcdist);\n txt+=' <path id=\"'+commands[c][12]+'\" d=\"M ';\n for(d=0;d<pts.length;d++)\n {\n x=pts[d][0]-originx;\n y=(cutterheight-pts[d][1])-originy;\n if(d===0)\n {\n x0=x;\n y0=y;\n }\n if(d===pts.length-1 && commands[c][11]===1) txt+=\"Z\";\n else txt+=x.toFixed(3)+\",\"+y.toFixed(3)+\" \";\n }\n txt+='\" opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"1\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-dasharray=\"none\" fill-opacity=\"0\" ';\n txt+=makepathparams(c)+' ';\n txt+='/>\\r\\n';\n }\n }\n txt+='</svg>\\r\\n';\n return txt;\n}", "addStrokeTag(ev){\n console.log(ev)\n var id = guid();\n var firstPoint = [ev['x'], ev['y']];\n var data = {\n 'id': id,\n 'width': 100,\n 'height': 100,\n 'placeHolder': [\n {'id':'left', 'data': {}, 'lines':[]}\n ],\n 'tagSnapped': [],\n 'position': [firstPoint[0],firstPoint[1]]\n \n }\n this.props.addTag(data)\n }", "async function o(o,i,n,m){const p$1=\"string\"==typeof o?U(o):o,a=i[0].spatialReference,u={...m,query:{...p$1.query,f:\"json\",sr:JSON.stringify(a),target:JSON.stringify({geometryType:d$1(i[0]),geometries:i}),cutter:JSON.stringify(n)}},c=await U$1(p$1.path+\"/cut\",u),{cutIndexes:f,geometries:g=[]}=c.data;return {cutIndexes:f,geometries:g.map((e=>{const t=p(e);return t.spatialReference=a,t}))}}", "function loadGeometry(animalPath, num) {\n\n var path = './jsModels/' + animalPath + '.js';\n console.log(path);\n var loader = new THREE.JSONLoader();\n THREE.Loader.Handlers.add( /\\.dds$/i, new THREE.DDSLoader() );\n\n loader.load(path, function(g) {\n g.name = animalPath;\n animalGeo[num] = g;\n loadedGeo(num);\n }, onProgress, onError);\n}", "serialize() {\n var svg = document.getElementsByTagName(\"svg\")\n var editor = atom.workspace.getActiveTextEditor()\n if(editor && (svg.length == 0)){\n this.createGraph(editor);\n }\n }", "updateGeometryNameFromAttributes_() {\n if (this.attributes) {\n for (const attribute of this.attributes) {\n if (attribute.type === ngeoFormatAttributeType.GEOMETRY) {\n this.geometryName_ = attribute.name;\n break;\n }\n }\n }\n }", "function i(t){return{renderer:{type:\"simple\",symbol:\"esriGeometryPoint\"===t||\"esriGeometryMultipoint\"===t?_symbols_support_defaultsJSON_js__WEBPACK_IMPORTED_MODULE_2__[\"defaultPointSymbolJSON\"]:\"esriGeometryPolyline\"===t?_symbols_support_defaultsJSON_js__WEBPACK_IMPORTED_MODULE_2__[\"defaultPolylineSymbolJSON\"]:_symbols_support_defaultsJSON_js__WEBPACK_IMPORTED_MODULE_2__[\"defaultPolygonSymbolJSON\"]}}}", "function getGeoJson() {\n return {\n \"type\": \"FeatureCollection\",\n \"features\": [\n {\n \"type\": \"Feature\",\n \"properties\": {},\n \"geometry\": {\n \"type\": \"LineString\",\n \"coordinates\": [\n [\n 13.25441561846926,\n 38.162839676288336\n ],\n [\n 13.269521819641135,\n 38.150961340209484\n ],\n [\n 13.250982390930197,\n 38.150961340209484\n ],\n ]\n }\n },\n {\n \"type\": \"Feature\",\n \"properties\": {},\n \"geometry\": {\n \"type\": \"Polygon\",\n \"coordinates\": [\n [\n [\n 13.250982390930197,\n 38.150961340209484\n ],\n [\n 13.269521819641135,\n 38.150961340209484\n ],\n [\n 13.25441561846926,\n 38.162839676288336\n ],\n [\n 13.24342929034426,\n 38.150691355539586\n ]\n ]\n ]\n }\n },\n {\n \"type\": \"Feature\",\n \"properties\": {},\n \"geometry\": {\n \"type\": \"Polygon\",\n \"coordinates\": [\n [\n [\n 13.277074920227072,\n 38.18335224460118\n\n ],\n [\n 13.30660067706301,\n 38.18389197106355\n\n ],\n [\n 13.278104888488791,\n 38.165808957979515\n\n ]\n ]\n ]\n }\n },\n {\n \"type\": \"Feature\",\n \"properties\": {},\n \"geometry\": {\n \"type\": \"Polygon\",\n \"coordinates\": [\n [\n [\n 13.309476005126974,\n 38.13233005362,\n ],\n [\n\n 13.337628470947287,\n 38.135030534863766\n ],\n [\n 13.31805907397463,\n 38.11153300139878\n ]\n ]\n ]\n }\n }\n ]\n }\n}", "function convertPathToImgCoordinates(point) {\n // convert to screen coordinates\n var screenCoords = paper.view.projectToView(point);\n // convert to viewport coordinates\n var viewportCoords = viewer.viewport.pointFromPixel(new OpenSeadragon.Point(screenCoords.x, screenCoords.y));\n // convert to image coordinates\n var imgCoords = viewer.viewport.viewportToImageCoordinates(viewportCoords);\n return imgCoords;\n}", "function onSVGLoaded( data ){\n var rectID= \"#\"+(ctrl.room.number).toLowerCase();\n var rect = data.select(rectID);\n rect.attr(\"fill\", \"#42A5F5\");\n s.append( data );\n }", "function convertBigQuery() {\n\tvar bqstring = document.getElementById(\"bigquery\").textContent;\n\t// get rid of the unimportant BigQuery syntax parts\n\tbqstring = bqstring.replace('POLYGON','').replace('((','').replace('))','');\n\tvar points = bqstring.split(',');\n\tvar coords = [];\n\tfor (var i=0; i < points.length; i++) {\n\t\tvar pair = points[i];\n\t\t// trim any trailing whitespace\n\t\tpair = pair.trim();\n\t\t// separate lon and lat via regexp\n\t\t// split on one (or more) space characters\n\t\tpair = pair.split(/\\s+/);\n\t\tconsole.log()\n\t\tvar lon = parseFloat(pair[0]);\n\t\tvar lat = parseFloat(pair[1]);\n\t\tconsole.log(lon, lat)\n\t\tcoords.push([lon,lat]);\n\t}\n\tvar geojson = {\n\t\t\"type\": \"FeatureCollection\",\n\t\t\"features\": [\n\t\t {\n\t\t\t\t\"type\": \"Feature\",\n\t\t\t\t\"properties\": {},\n\t\t\t\t\"geometry\": {\n\t\t\t\t\t\"type\": \"Polygon\",\n\t\t\t\t\t\"coordinates\": [ coords ]\n\t\t\t\t}\n\t\t }\n\t\t]\n\t};\n\tgeoJsonToOutput(geojson);\n}", "calculateBounds() {\n var minX = Infinity;\n var maxX = -Infinity;\n var minY = Infinity;\n var maxY = -Infinity;\n if (this.graphicsData.length) {\n var shape = null;\n var x = 0;\n var y = 0;\n var w = 0;\n var h = 0;\n for (var i = 0; i < this.graphicsData.length; i++) {\n var data = this.graphicsData[i];\n var type = data.type;\n var lineWidth = data.lineStyle ? data.lineStyle.width : 0;\n shape = data.shape;\n if (type === ShapeSettings_1.ShapeSettings.SHAPES.RECT || type === ShapeSettings_1.ShapeSettings.SHAPES.RREC) {\n x = shape.x - (lineWidth / 2);\n y = shape.y - (lineWidth / 2);\n w = shape.width + lineWidth;\n h = shape.height + lineWidth;\n minX = x < minX ? x : minX;\n maxX = x + w > maxX ? x + w : maxX;\n minY = y < minY ? y : minY;\n maxY = y + h > maxY ? y + h : maxY;\n }\n else if (type === ShapeSettings_1.ShapeSettings.SHAPES.CIRC) {\n x = shape.x;\n y = shape.y;\n w = shape.radius + (lineWidth / 2);\n h = shape.radius + (lineWidth / 2);\n minX = x - w < minX ? x - w : minX;\n maxX = x + w > maxX ? x + w : maxX;\n minY = y - h < minY ? y - h : minY;\n maxY = y + h > maxY ? y + h : maxY;\n }\n else if (type === ShapeSettings_1.ShapeSettings.SHAPES.ELIP) {\n x = shape.x;\n y = shape.y;\n w = shape.width + (lineWidth / 2);\n h = shape.height + (lineWidth / 2);\n minX = x - w < minX ? x - w : minX;\n maxX = x + w > maxX ? x + w : maxX;\n minY = y - h < minY ? y - h : minY;\n maxY = y + h > maxY ? y + h : maxY;\n }\n else {\n // POLY\n var points = shape.points;\n var x2 = 0;\n var y2 = 0;\n var dx = 0;\n var dy = 0;\n var rw = 0;\n var rh = 0;\n var cx = 0;\n var cy = 0;\n for (var j = 0; j + 2 < points.length; j += 2) {\n x = points[j];\n y = points[j + 1];\n x2 = points[j + 2];\n y2 = points[j + 3];\n dx = Math.abs(x2 - x);\n dy = Math.abs(y2 - y);\n h = lineWidth;\n w = Math.sqrt((dx * dx) + (dy * dy));\n if (w < 1e-9) {\n continue;\n }\n rw = ((h / w * dy) + dx) / 2;\n rh = ((h / w * dx) + dy) / 2;\n cx = (x2 + x) / 2;\n cy = (y2 + y) / 2;\n minX = cx - rw < minX ? cx - rw : minX;\n maxX = cx + rw > maxX ? cx + rw : maxX;\n minY = cy - rh < minY ? cy - rh : minY;\n maxY = cy + rh > maxY ? cy + rh : maxY;\n }\n }\n }\n }\n else {\n minX = 0;\n maxX = 0;\n minY = 0;\n maxY = 0;\n }\n var padding = this.boundsPadding;\n this._bounds.minX = minX - padding;\n this._bounds.maxX = maxX + padding;\n this._bounds.minY = minY - padding;\n this._bounds.maxY = maxY + padding;\n }", "function loadGeomitriesOfObject() {\n var json = document.getElementById(\"white\").innerHTML;\n var geojson = JSON.parse(json);\n geojson = JSON.parse(\"\"+geojson+\"\");\n var bild = geojson.features[0].features[0].properties.img;\n var iname = geojson.features[0].features[0].properties.name;\n var layer = L.geoJSON(geojson.features[0]).addTo(map);\n var marker = L.geoJSON(geojson.features[1]).addTo(map).bindPopup(\"<h5>\"+iname+\"<h5><img src=\"+bild+\" width='200'><br>\").openPopup();\n map.fitBounds(layer.getBounds());\n}", "render() {\n const {width,height}=this.props\n if (!this.props.chinaTopoJson) {\n return null;\n }else{\n // Translate topojson data into geojson data for drawing\n // Prepare a mesh for states and a list of features for counties\n const china = this.props.chinaTopoJson,\n counties = china.features\n\n // Loop through counties and draw <County> components\n // Add a single <path> for state borders\n return (\n <g transform={`translate(${this.props.x}, ${this.props.y})`} id=\"background-container\">\n {counties.map((feature) => (\n <County geoPath={this.geoPath}\n feature={feature}\n key={feature.properties.name} \n {...{width,height}}\n />\n ))}\n\n \n </g>\n );\n }\n }", "function getSVGInfo() {\n var fileNode = document.getElementById('file');\n if (!fileNode) {\n return null;\n }\n \n var url;\n if (hasAnnotation()) {\n url = fileNode.childNodes[0].childNodes[0].childNodes[0].href;\n } else {\n url = fileNode.childNodes[0].href;\n }\n var imgNode = fileNode.getElementsByTagName('img')[0];\n var width = imgNode.getAttribute('width');\n var height = imgNode.getAttribute('height');\n\n return { url: url, fileNode: fileNode, imgNode: imgNode, \n width: width, height: height };\n}", "function Kg(a){var b;q&&(b=workarea.If());var c=D(\"xml\");a=Ka(a,!0);for(var d=0,e;e=a[d];d++){var h=Lg(e);e=e.ga();h.setAttribute(\"x\",q?b-e.x:e.x);h.setAttribute(\"y\",e.y);c.appendChild(h)}return c}", "createGraphic(geometry, symbol) {\n\n var graphic = new this.Graphic({geometry: geometry, symbol: symbol});\n return graphic;\n }" ]
[ "0.65883136", "0.65807104", "0.603482", "0.5982536", "0.592685", "0.58256423", "0.56433755", "0.56311667", "0.56293595", "0.56250817", "0.56193644", "0.5586216", "0.55813193", "0.5534764", "0.5502348", "0.54765415", "0.54731673", "0.5468276", "0.5456262", "0.5444078", "0.5425371", "0.54248005", "0.54151493", "0.54083514", "0.5391494", "0.53860563", "0.5356178", "0.5340611", "0.5330865", "0.5318575", "0.5314676", "0.5314032", "0.53085816", "0.53043056", "0.52986807", "0.52986807", "0.5298065", "0.52906084", "0.528913", "0.5288265", "0.5287737", "0.5284172", "0.5284172", "0.52680534", "0.52607626", "0.52531195", "0.52326125", "0.521108", "0.52087826", "0.5202031", "0.51972693", "0.5194543", "0.519209", "0.5189573", "0.5187768", "0.5186633", "0.51849955", "0.5180888", "0.51698786", "0.51688534", "0.51585746", "0.51582307", "0.51579183", "0.51554894", "0.51504683", "0.51412964", "0.5132742", "0.5130271", "0.5117565", "0.5116462", "0.51057607", "0.5103773", "0.5099729", "0.509705", "0.50955534", "0.5087687", "0.50864786", "0.5085797", "0.5084794", "0.50831616", "0.50770944", "0.5071479", "0.50704056", "0.50658214", "0.5057523", "0.505506", "0.50530994", "0.50496745", "0.50473183", "0.5043992", "0.5041632", "0.5041503", "0.5034484", "0.503133", "0.5030885", "0.50291646", "0.5026219", "0.5024913", "0.50195646", "0.50150037", "0.5014253" ]
0.0
-1