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
currentDay function runs with the giving city from where the function is called, and with the createButton boolean true or false.
function currentDay(inputCity, createButton){ // Variable that holds the API url along with variables key, unit and inputed city from user. const queryURL = "https://api.openweathermap.org/data/2.5/weather?appid=" + APIKey + imperialUnit + "&q=" + inputCity; // AJAX call for the specific criteria (city name) entered by the user. $.ajax({ url: queryURL, method: "GET" }).then(response => { // console.log(response); // Created variable to hold the city name response from API. const cityName = response.name // console.log(cityName); // If createButton boolean is true than create button; however, another if statement is entered, so if user types a name of a city that he/she searched before, then this city will not be entered in the savedCity array. if (createButton) { if ((savedCity.indexOf(cityName)) <= -1){ // console.log(cityName); savedCity.push(cityName); } } // Created variable to grab current day. const d = new Date(); // Created variable to grab the icon image name. const dayIcon = response.weather[0].icon; // Create new elements to be append in the html file using the API response as part of the text. const newCurrentWeather = ` <h2>${cityName}<span>(${d.getMonth()+1}/${d.getDate()}/${d.getFullYear()})</span> <img src="https://openweathermap.org/img/wn/${dayIcon}.png"></img> </h2> <p>Temperature: <span class="bold">${response.main.temp}</span> ℉</p> <p>Humidity: <span class="bold">${response.main.humidity}</span>%</p> <p>Wind Speed: <span class="bold">${response.wind.speed}</span> mph; <p class="uv">UV Index: </p> <img class='imgUv' src="https://www.epa.gov/sites/production/files/sunwise/images/uviscaleh_lg.gif" alt="UV Color Scale"></img> <br> <br> ` // Created varibles to store the latitude and longitude responses that are going to be used in the URL to grab the UV. const latitude = response.coord.lat const long = response.coord.lon // Calls the function that runs the AJAX with the UV API. getUV(); // Clears the div with the today class, and add the response for the new city searched. today.empty().append(newCurrentWeather); function getUV(){ // Created variable to hold API url along with key, and the searched city latitute and longitude. const uvURL = "https://api.openweathermap.org/data/2.5/uvi?lat=" + latitude + "&lon=" + long + "&appid=" + APIKey // AJAX call function for to get the UV API response. $.ajax({ url: uvURL, method: "GET" }).then(resUV => { // console.log(resUV); // Created variable to hold UV response. const uv = resUV.value; $(".spUv").remove(); // Created a span tag with the UV response. const spanUV = $("<span class='spUv bold'>").text(uv); // Append the span tag to the p tag created previously. $(".uv").append(spanUV); // Gets the UV response and turns into a number. const parsenUV = parseInt(uv); // The following if statements are to color code the UV level according to https://www.epa.gov/sunsafety/uv-index-scale-0 if (parsenUV <= 2){ spanUV.attr("style", "background: green") } else if (parsenUV >= 3 && parsenUV <= 5){ spanUV.attr("style", "background: yellow") } else if (parsenUV === 6 || parsenUV === 7){ spanUV.attr("style", "background: orange") } else if (parsenUV >= 8 && parsenUV <= 10){ spanUV.attr("style", "color: white;background: red") } else if (parsenUV >= 11){ spanUV.attr("style", "color: white;background: purple") } }) } // Call function that displays 5 days forecast. futureDates() function futureDates(){ // Created variable to hold the forecast URL, adding the user search city name, API key, and unit change from standard to imperial. const forecastURL = "https://api.openweathermap.org/data/2.5/forecast?q=" + cityName + "&appid=" + APIKey + imperialUnit // AJAX call for the specific city search by the user. $.ajax({ url: forecastURL, method: "GET" }).then(forecastRes => { // console.log(forecastRes); // Created varibale that holds the API response with a list of the every three works forecast for a five days period. const forecastArray = forecastRes.list // Create a h3 tag to display the 5-Day Forecast title. const newForH3 = `<h3>5-Day Forecast</h3>`; // Create a new div with a bootstrap class card-deck. const newCardDeck = `<div class="card-deck"></div>`; // Empty the div with class forecast, then append the new h3 and the new div. forecast.empty().append(newForH3, newCardDeck); // Create a for loop to loop through the forecast array. Start to loop at index 7 to skip the current day. The response comes back in 3 hours range; therefore, each returns 8 result per day, that's why i is added by 8 each time, to take a new day. for (let i=7; i < forecastArray.length; i+=8){ // Created variable to store date from response and format it to JavaScript. const forDate = new Date(forecastArray[i].dt_txt); // console.log(forDate); // Created variable to hold each icon name. const forDayIcon = forecastArray[i].weather[0].icon; // Create a new div with bootstrap class card-body for each result. const newDivCardBody = `<div class="card-body"> <p><span class="bold">${forDate.getMonth()+1}/${forDate.getDate()}/${forDate.getFullYear()}</span> <img src="https://openweathermap.org/img/wn/${forDayIcon}.png"></img></p> <p>Temperature: <span class="bold">${forecastArray[i].main.temp}</span> ℉<p> <p>Humidity: <span class="bold">${forecastArray[1].main.humidity}</span>%</p> </div> ` // Append the div with class card-body to the div with class card-deck. $(".card-deck").append(newDivCardBody); } }) } // Call create button function. createBtn(); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function city() {\n let cityName = $(this).text();\n currentWeather(cityName);\n get5Day(cityName);\n}", "function dayButtonClicked() {\n if (night == false) {\n night = true;\n nightIn();\n return;\n }\n if (night == true) {\n night = false;\n dayIn();\n return;\n }\n}", "function onClickDay()\n// Helper to refresh the nb of abstract in the togle\n{\n $(\"#whichday .btn\").click(function(){\n $(\".day\").removeClass('active')\n var day = $(this).text();\n $(\"#button-%s\".format(day)).addClass('active')\n displayBlockApp(day)\n });\n}", "function cityClicked() {\n // var itis = $(\".name\");\n // console.log(itis);\n var currentCity = $(event.target).text();\n // console.log(currentCity);\n userCity = currentCity;\n // console.log(userCity);\n currentWeather(userCity);\n}", "function buildDay () {\n\n}", "function newDay(day) {\n $.get(\"https://api.openweathermap.org/data/2.5/onecall?lat=\" + lat + \"&lon=\" + lon + \"&exclude=hourly,minutely&appid=\" + OPEN_WEATHER_MAP_API + \"&units=imperial\"\n ).done(function (data) {\n for (var i = 0; i <= data.daily.length - 1; i++) {\n var unix = data.daily[i].dt * 1000\n var date = new Date(unix)\n if ((dayInput(date.getDay()) === day)) {\n $('#weatherType').html(data.daily[i].weather[0].description)\n $('#degrees').html(Math.round(data.daily[i].temp.max) + '&#176')\n $('#date').html(dayInput(date.getDay()) + ' ' + date.getDate() + ', ' + date.getFullYear() + '<br>\\n' +\n 'Last Updated: ' + date.getHours() + ':' + date.getMinutes())\n $('#cloudy').html(data.daily[i].clouds + '%')\n $('#humidity').html(data.daily[i].humidity + '%')\n $('#wind').html(data.daily[i].wind_speed + ' km/h')\n\n //Rain is not guaranteed\n if (data.daily[i].rain === undefined) {\n $('#rain').html('No Available Data')\n } else {\n $('#rain').html(data.daily[i].rain + ' mm')\n }\n\n //Dynamic Background\n if (data.daily[i].weather[0].main === 'Rain') {\n $('#bg').css('background-image', \"url(img/rain.jpg)\")\n $('#icon').html('<img class=\"image mt-5\" src=\"img/rain-icon.png\">')\n $('.card1').css('color', 'white')\n } else if (data.daily[i].weather[0].main === 'Clouds') {\n $('#bg').css('background-image', \"url(img/cloudy-bg.jpeg)\")\n $('#icon').html('<img class=\"image mt-5\" src=\"img/cloudy.png\">')\n $('.card1').css('color', 'black')\n } else if (data.daily[i].weather[0].main === 'Clear') {\n $('#bg').css('background-image', \"url(img/xp.jpg)\")\n $('#icon').html('<img class=\"image mt-5\" src=\"img/sun.png\">')\n $('.card1').css('color', 'white')\n }\n }\n }\n })\n }", "function savedCityClick () {\n var city = $(this).text();\n var queryURL = urlBase + city + \"&appid=\" + apiKey;\n getCurrentWeather(queryURL, city); \n}", "function getCity(lat, lon, city) {\n \n var queryURL = `https://api.openweathermap.org/data/2.5/onecall?lat=${lat}&lon=${lon}&exclude=hourly,minutely&appid=${APIKey}`;\n\n // API query\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n \n // Populate current city, date into card\n $(\"#city\").text(`${ city } (${ dayjs.unix(response.current.dt).format('MM/DD/YYYY') })`);\n \n // Add a weather icon\n let imgIcon = $(\"<img>\");\n imgIcon.attr(\"src\", \"https://openweathermap.org/img/w/\" + response.current.weather[0].icon + \".png\");\n // Append it to the city id\n $(\"#city\").append(imgIcon);\n\n // Convert temperature to fahrenheit from Kelvin\n var fahrenheit = ((response.current.temp - 273.15) * 9/5 + 32).toFixed(2);\n // Display temperature\n $(\"#temp\").text(`Temperature: ${ fahrenheit } °F`);\n \n // Display wind speed\n $(\"#wind-speed\").text(`Wind Speed: ${ response.current.wind_speed } MPH`);\n\n // Display humidity\n $(\"#humidity\").text(`Humidity: ${ response.current.humidity }%`);\n \n // Display UV Index\n let UVI = response.daily[0].uvi;\n $(\"#uv-index\").text(`${ UVI }`);\n \n let background;\n // White font work better on most colors\n let font = \"white\";\n // Change the background color and font color based on the UV Index colors\n if (UVI < 3) { background = \"green\"; }\n else if (UVI < 6) { background = \"yellow\"; font = \"black\";}\n else if (UVI < 8) { background = \"orange\"; }\n else if (UVI < 11) { background = \"red\"; }\n else { background = \"purple\"; }\n\n $(\"#uv-index\").attr(\"style\", `background-color: ${ background }; color: ${ font };`);\n // Send latitude, longitude, and city name to 5-Day forecast\n fiveDayForecast(lat, lon, city);\n });\n}", "function searchHistoryCity(event){\n\n //Ensures another button isn't created\n createNewButton = false;\n\n //Formats city name then runs function for results section\n let cityButtonClicked = '';\n cityButtonClicked = event.target.id;\n cityButtonClicked = cityButtonClicked.trim().toLowerCase().split(' ').join('+');\n cityWeatherInformation(cityButtonClicked);\n\n}", "function postCityButton(searchedCity){\n var capsButton = cap(searchedCity);\n \n var newButton = $(\"<button class='button is-fullwidth is-rounded cityButton'>\").text(capsButton);\n buttonList.push(newButton);\n \n // retrieving local storage array information\n var cityHistory = JSON.parse(window.localStorage.getItem(\"city-name\")) || [];\n\n // if local storage has the city already, don't duplicate\n if (cityHistory.indexOf(capsButton) === -1){\n cityHistory.push(capsButton);\n window.localStorage.setItem(\"city-name\", JSON.stringify(cityHistory));\n $(buttonDump).append(newButton);\n }\n\n // run informative funcitons when city button clicked\n $(newButton).click(function() {\n var inputSave = $(this).text();\n nowWeather(inputSave);\n });\n}", "function displayWeatherInfo(city) {\n\n if (history.indexOf(city) === -1) {\n history.push(city);\n makeRow(history[history.length -1])\n }\n\n var now = new Date();\n var options = {\n weekday: 'long',\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: '2-digit',\n minute: '2-digit'\n};\n\n // to show the day and date\nvar today = now.toLocaleString('en-us', options);\n\n var APIKey = 'd2edc2080024ef0841b4893641476d0a';\n \n // daily forecast URL \n var queryURL = `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${APIKey}&units=imperial`\n \n // ajax call for the city being clicked\n $.ajax({\n url: queryURL,\n method: 'GET',\n dataType: \"json\"\n })\n\n .then(function (response) {\n \n \n $(\"#today\").empty();\n \n \n var card = $(\"<div>\").addClass(\"card-city\");\n var cardBody = $(\"<div>\").addClass(\"card-body\");\n var cardTitle = $(\"<h3>\").addClass(\"card-title\").text(response.name);\n var icon = $(\"<img>\").attr(\"src\", \"https://openweathermap.org/img/w/\" + response.weather[0].icon + \".png\")\n var temp = $(\"<h4>\").addClass(\"card-text\").text(\"Tempature: \" + response.main.temp);\n var wind = $(\"<h4>\").addClass(\"card-text\").text(\"Wind Speed: \" + response.wind.speed);\n var humidity = $(\"<h4>\").addClass(\"card-text\").text(\"Humidity: \" + response.main.humidity);\n\n console.log(response.weather[0].icon);\n var todayDate = $(\"<div>\").text(today);\n\n $(\"#today\").append(card.append(cardBody.append(icon, cardTitle, todayDate, temp, wind, humidity)))\n\n // getforecast(response.coord.lat, response.coord.lon);\n\n //get UV Index\n var uvURL = \"http://api.openweathermap.org/data/2.5/uvi?appid=d2edc2080024ef0841b4893641476d0a&lat=\" + response.coord.lat + \"&lon=\" + response.coord.lon;\n $.ajax({\n url: uvURL,\n method: \"GET\"\n }).then(function (uvresponse) {\n var uvindex = uvresponse.value;\n var color;\n if (uvindex <= 3) {\n color = \"green\";\n }\n else if (uvindex > 3 && uvindex <= 6) {\n color = \"yellow\";\n }\n else if (uvindex > 6 && uvindex <= 8) {\n color = \"orange\";\n }\n else {\n color = \"red\";\n }\n\n var uvdisp = $(\"<p>\").attr(\"class\", \"card-text\").text(\"UV Index: \");\n uvdisp.append($(\"<span>\").attr(\"class\", \"uvindex\").attr(\"style\", (\"background-color:\" + color)).text(uvindex));\n cardBody.append(uvdisp);\n\n });\n\n });\n }", "function newCity(event) {\n event.preventDefault();\n let apiKey = \"a2a7f7242429e80a0db4ffb6350fdb5e\";\n let city = document.querySelector(\"#city-input\").value;\n let apiUrl =\n `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}&units=metric`;\n\n axios.get(apiUrl).then(showWeather);\n\n apiUrl = `https://api.openweathermap.org/data/2.5/onecall?q=${city}&exclude=minutely,hourly,alerts&appid=${apiKey}&units=metric`;\n axios.get(apiUrl).then(showForecast);\n}", "function rendercity() {\n $(`#cityList`).empty()\n for (var i = 0; i < cities.length; i++) {\n a = $(\"<button>\")\n a.addClass(\"city\");\n a.attr(\"cityName\", cities[i]);\n a.text(cities[i]);\n $(\"#cityList\").append(a);\n }\n // forecast()\n }", "function cityButtons(){ \n console.log(this.innerHTML)\n $(\"#search-value\").val(this.innerHTML)\n\n //api key\n let apiKey = config.key\n //user input\n let city2 = this.innerHTML\n //query url\n let queryURL = \"https://api.openweathermap.org/data/2.5/weather?q=\"+city2+\"&units=imperial&appid=\"+apiKey\n let queryURL2 = \"https://api.openweathermap.org/data/2.5/forecast?q=\"+city2+\"&units=imperial&appid=\"+apiKey\n\n \n //create AJAX call for specific city being queried\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response){\n $.ajax({\n url: queryURL2,\n method: \"GET\"\n }).then(function(response2){\n goodCity = \"yes\"\n console.log(goodCity)\n let cityName = response.name\n let icon = \"http://openweathermap.org/img/wn/\"+response.weather[0].icon+\".png\"\n let now = new Date()\n let date = (now.getMonth() + 1)+\"/\"+now.getDate()+\"/\"+now.getFullYear()\n let temp = response.main.temp\n let humidity = response.main.humidity\n let windSpeed = response.wind.speed\n let date1 = (now.getMonth() + 1)+\"/\"+(now.getDate() + 1)+\"/\"+now.getFullYear()\n let date2 = (now.getMonth() + 1)+\"/\"+(now.getDate() + 2)+\"/\"+now.getFullYear()\n let date3 = (now.getMonth() + 1)+\"/\"+(now.getDate() + 3)+\"/\"+now.getFullYear()\n let date4 = (now.getMonth() + 1)+\"/\"+(now.getDate() + 4)+\"/\"+now.getFullYear()\n let date5 = (now.getMonth() + 1)+\"/\"+(now.getDate() + 5)+\"/\"+now.getFullYear()\n let icon1 = \"http://openweathermap.org/img/wn/\"+response2.list[2].weather[0].icon+\".png\"\n let icon2 = \"http://openweathermap.org/img/wn/\"+response2.list[10].weather[0].icon+\".png\"\n let icon3 = \"http://openweathermap.org/img/wn/\"+response2.list[18].weather[0].icon+\".png\"\n let icon4 = \"http://openweathermap.org/img/wn/\"+response2.list[26].weather[0].icon+\".png\"\n let icon5 = \"http://openweathermap.org/img/wn/\"+response2.list[34].weather[0].icon+\".png\"\n let temp1 = response2.list[2].main.temp\n let temp2 = response2.list[10].main.temp\n let temp3 = response2.list[18].main.temp\n let temp4 = response2.list[26].main.temp\n let temp5 = response2.list[34].main.temp\n let humidity1 = response2.list[2].main.humidity\n let humidity2 = response2.list[10].main.humidity\n let humidity3 = response2.list[18].main.humidity\n let humidity4 = response2.list[26].main.humidity\n let humidity5 = response2.list[34].main.humidity\n \n\n //convert user input to lat and lon to use onecall API\n let lat = response.coord.lat\n let lon = response.coord.lon\n let queryURL3 = \"https://api.openweathermap.org/data/2.5/onecall?lat=\"+lat+\"&lon=\"+lon+\"&exclude=hourly&appid=\"+apiKey\n\n //call new ajax request for the onecall API\n $.ajax({\n url: queryURL3,\n method: \"GET\"\n }).then(function(response3){\n \n //uv index information\n let uvIndex = response3.current.uvi \n\n \n for (i=0;i<cities.length;i++){\n \n //create new div to house city's weather in \"today\"\n $(\"#today\").empty()\n $(\"#today\").prepend('<div class=\"'+cities[i]+'\" id=\"'+cities[i]+'\"></div>')\n $(\"#\"+cities[i]).css(\"border\",\"solid 1px black\")\n //display city name and date in header in new div\n $(\"#\"+cities[i]).append(\"<h1>\"+cityName+\" (\"+date+\") <img src='\"+icon+\"'></h1>\")\n //display temp, humidity, wind speed, and UV index\n $(\"#\"+cities[i]).append(\"<br><p>Temperature: \"+temp+\"&#8457<br><br>Humidity: \"+humidity+\"%<br><br>Wind Speed: \"+windSpeed+\" mph</p>\")\n $(\"#\"+cities[i]).append(\"<p id=uvi class=col-3>UV Index: \"+uvIndex+\"</p>\")\n $(\"#search-value\").val('')\n\n //style uv display and change color depending on uv index\n $(\"#uvi\").css(\"color\", \"white\")\n if (uvIndex >= 0 && uvIndex <= 4){\n $(\"#uvi\").css(\"background-color\", \"green\")\n }\n else if (uvIndex >= 5 && uvIndex <= 7){\n $(\"#uvi\").css(\"background-color\", \"orange\")\n }\n else if (uvIndex >= 8 && uvIndex <= 10){\n $(\"#uvi\").css(\"background-color\", \"red\")\n }\n else {\n $(\"#uvi\").css(\"background-color\", \"purple\")\n }\n \n //create new div to house city's forecast in \"forecast\"\n $(\"#forecast\").children().hide()\n $(\"#forecast\").prepend('<div id=\"'+cities[i]+'-forecast\"></div>')\n $(\"#forecast\").css(\"overflow\",\"hidden\")\n $(\"#\"+cities[i]+\"-forecast\").append(\"<h1>5-Day Forecast:</h1>\")\n $(\"#\"+cities[i]+\"-forecast\").append('<div class=\"col-2 forecastDiv\">'+date1+'<br><img src=\"'+icon1+'\"><br>Temp: '+temp1+'&#8457<br>Humidity: '+humidity1+'%</div>')\n $(\"#\"+cities[i]+\"-forecast\").append('<div class=\"col-2 forecastDiv\">'+date2+'<br><img src=\"'+icon2+'\"><br>Temp: '+temp2+'&#8457<br>Humidity: '+humidity2+'%</div>')\n $(\"#\"+cities[i]+\"-forecast\").append('<div class=\"col-2 forecastDiv\">'+date3+'<br><img src=\"'+icon3+'\"><br>Temp: '+temp3+'&#8457<br>Humidity: '+humidity3+'%</div>')\n $(\"#\"+cities[i]+\"-forecast\").append('<div class=\"col-2 forecastDiv\">'+date4+'<br><img src=\"'+icon4+'\"><br>Temp: '+temp4+'&#8457<br>Humidity: '+humidity4+'%</div>')\n $(\"#\"+cities[i]+\"-forecast\").append('<div class=\"col-2 forecastDiv\">'+date5+'<br><img src=\"'+icon5+'\"><br>Temp: '+temp5+'&#8457<br>Humidity: '+humidity5+'%</div>')\n $(\".forecastDiv\").css(\"border\",\"solid 1px black\").css(\"width\",\"200px\").css(\"float\",\"left\").css(\"background-color\",\"blue\").css(\"color\",\"white\")\n \n }\n })\n })\n }) \n }", "function currentCondition(city) {\n var APIKey = \"4283d387c93df34e548fe4d99a04d307\";\n //Url to query database\n var queryUrl =\n \"https://api.openweathermap.org/data/2.5/weather?q=\" +\n city +\n \"&appid=\" +\n APIKey;\n $.ajax({\n url: queryUrl,\n method: \"GET\",\n dataType: \"json\",\n }).then(function (response) {\n //check in buttons for the value\n if (cityList.indexOf(city) === -1) {\n cityList.push(city);\n /// add it to local storage\n window.localStorage.setItem(\"cityList\", JSON.stringify(cityList));\n //call create list function and pass in the city\n createList(city);\n }\n $(\"#currentCity\").empty();\n //call the function to append the new buttons\n //empty the daily contect to load city that has been searched\n //create the html contect for daily weather by taking the response index\n var card = $(\"<div>\").addClass(\"card\");\n //card body to attatch this to\n var cardbody = $(\"<div>\").addClass(\"card-body\");\n //title for csard\n var title = $(\"<h3>\")\n .addClass(\"card-title\")\n .text(\n response.name + \" \" + \"(\" + new Date().toLocaleDateString() + \")\"\n );\n //img icon for each card\n var image = $(\"<img>\").attr(\n \"src\",\n \"https://openweathermap.org/img/w/\" + response.weather[0].icon + \".png\"\n );\n function KtoF(temp) {\n return (temp - 273.15) * 1.8 + 32;\n }\n //temp and humidity\n var temp = $(\"<p>\")\n .addClass(\"card-text\")\n .text(\"Temperature: \" + KtoF(response.main.temp).toFixed(2) + \"°F\");\n var hum = $(\"<p>\")\n .addClass(\"card-text\")\n .text(\"Humidity: \" + response.main.humidity + \"%\");\n var wind = $(\"<p>\")\n .addClass(\"card-text\")\n .text(\"Wind: \" + response.wind.speed + \" MPH\");\n //take the column and append it to the the card then card body then append the tittle\n title.append(image);\n // take the card body and append the title temp humidity and windspeed\n cardbody.append(title, temp, hum, wind);\n //take the cardbody and append it to the card\n card.append(cardbody);\n //append the card to the id it needs to be placed\n $(\"#currentCity\").append(card);\n //call other two functions for ajax calls for the forecast pass in the city and UX index pass in lon and lat\n fiveDayForecast(city);\n getUVIndex(response.coord.lat, response.coord.lon);\n });\n }", "function showWeather() {\ngiveCity()\npreForecast()\nfutureFore() \n}", "function today() {\n document.getElementById(\"day\").innerHTML = days[d.getDay()];\n\ndocument.getElementById(\"time\").innerHTML = d.timeNow();\n}", "function initialize(temp, feelsLike, dayMax, dayMin, currentCity) {\n showTemp(currentCity, temp);\n showFeelsLike(feelsLike);\n shownDayMax(currentCity, dayMax);\n shownDayMin(currentCity, dayMin);\n flag = false;\n //const textDiv = document.createElement('div')\n\n function showTemp(currentCity, temp) {\n const tempH2 = document.createElement(\"h2\");\n tempH2.innerText = `Current Temperture in ${currentCity}: ${temp}`;\n tempH2.setAttribute(\"id\", \"tempH2\");\n document.body.appendChild(tempH2);\n }\n\n function showFeelsLike(feelsLike) {\n const feelsLikeH2 = document.createElement(\"h2\");\n feelsLikeH2.innerText = `Feels Like: ${feelsLike}`;\n feelsLikeH2.setAttribute(\"id\", \"feelsLikeH2\");\n document.body.appendChild(feelsLikeH2);\n }\n\n function shownDayMax(currentCity, dayMax) {\n const dayMaxH2 = document.createElement(\"h2\");\n dayMaxH2.innerText = `${currentCity} daily max Temperture is: ${dayMax}`;\n dayMaxH2.setAttribute(\"id\", \"dayMaxH2\");\n document.body.appendChild(dayMaxH2);\n }\n\n function shownDayMin(currentCity, dayMin) {\n const dayMinH2 = document.createElement(\"h2\");\n dayMinH2.innerText = `${currentCity} daily lowest Temperture is: ${dayMin}`;\n dayMinH2.setAttribute(\"id\", \"dayMinH2\");\n document.body.appendChild(dayMinH2);\n }\n}", "function defaultCity() {\n \n let getCoords = \"https://api.openweathermap.org/data/2.5/weather?q=Atlanta&appid=\" + apiKey + \"&units=imperial\";\n\n fetch(getCoords)\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n \n let long = data.coord.lon;\n let lat = data.coord.lat;\n city.text(data.name);\n let getWeather = \"https://api.openweathermap.org/data/2.5/onecall?lat=\" + lat + \"&lon=\" + long + \"&units=imperial&appid=\" + apiKey;\n \n fetch(getWeather)\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n\n let icon = (data.daily[0].weather[0].icon)\n let iconURL = \"https://openweathermap.org/img/wn/\" + icon + \".png\"\n iconT.attr('src', iconURL);\n \n temp.text(data.current.temp + '\\u00B0' +'F');\n wind.text(data.current.wind_speed + ' MPH');\n humidity.text(data.current.humidity + '%');\n uvIndex.text(data.current.uvi);\n\n if (uvIndex.text() < 4) {\n uvIndex.css('background-color', 'green');\n uvIndex.css('color', 'black');\n\n } else if (uvIndex.text() > 8) {\n uvIndex.css('background-color', 'red');\n uvIndex.css('color', 'black');\n } else {\n uvIndex.css('background-color', 'yellow');\n uvIndex.css('color', 'black');\n }\n\n for (let i = 0; i < 5; i++) {\n\n dailyTemps[i] = data.daily[i].temp.day;\n dailyHum[i] = data.daily[i].humidity;\n dailyWind[i] = data.daily[i].wind_speed;\n dailyIcon[i] = data.daily[i].weather[0].icon;\n dailyIconURL[i] = \"https://openweathermap.org/img/wn/\" + dailyIcon[i] + \".png\"\n\n dayOneTemp.text(dailyTemps[0] + '\\u00B0' +'F');\n dayTwoTemp.text(dailyTemps[1] + '\\u00B0' +'F');\n dayThreeTemp.text(dailyTemps[2] + '\\u00B0' +'F');\n dayFourTemp.text(dailyTemps[3] + '\\u00B0' +'F');\n dayFiveTemp.text(dailyTemps[4] + '\\u00B0' +'F');\n\n dayOneHum.text(dailyHum[0] + '%');\n dayTwoHum.text(dailyHum[1] + '%');\n dayThreeHum.text(dailyHum[2] + '%');\n dayFourHum.text(dailyHum[3] + '%');\n dayFiveHum.text(dailyHum[4] + '%');\n\n dayOneWind.text(dailyWind[0] + ' MPH');\n dayTwoWind.text(dailyWind[1] + ' MPH');\n dayThreeWind.text(dailyWind[2] + ' MPH');\n dayFourWind.text(dailyWind[3] + ' MPH');\n dayFiveWind.text(dailyWind[4] + ' MPH');\n\n dayOneIcon.attr('src', dailyIconURL[0]);\n dayTwoIcon.attr('src', dailyIconURL[1]);\n dayThreeIcon.attr('src', dailyIconURL[2]);\n dayFourIcon.attr('src', dailyIconURL[3]);\n dayFiveIcon.attr('src', dailyIconURL[4]);\n\n } \n });\n });\n}", "function selectedCity(searchCity) {\n\n var APIKey = \"46bc2c42a8260a4e45e15ae9d7661e9b\"\n var queryURL = \"https://api.openweathermap.org/data/2.5/forecast?\" + \"&q=\" + searchCity + \"&appid=\" + APIKey;\n console.log(queryURL);\n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n .then(function (response) {\n console.log(response);\n\n var cityLon = response.city.coord.lon;\n var cityLat = response.city.coord.lat;\n\n //logs current day weather conditions\n var currentCity = response.city.name;\n console.log(currentCity);\n\n var currentCondition = response.list[0].weather[0].icon;\n console.log(currentCondition);\n var iconImg = \"https://openweathermap.org/img/w/\" + currentCondition + \".png\";\n\n var currentTemp = response.list[0].main.temp;\n var tempF = ((currentTemp - 273.15) * 1.80 + 32);\n console.log(tempF);\n\n var currentHumidity = response.list[0].main.humidity;\n console.log(currentHumidity);\n\n var currentWind = response.list[0].wind.speed;\n console.log(currentWind);\n\n $(\"#currentCity\").text(currentCity).append(\" \" + currentDate).append($(\"#currentCondition\").attr(\"src\", iconImg));\n $(\"#currentTemp\").text(\"Temperature: \" + tempF.toFixed(1) + \"°F\");\n $(\"#currentHumidity\").text(\"Humidity: \" + currentHumidity + \"%\");\n $(\"#currentWind\").text(\"Wind Speed: \" + currentWind);\n\n //Yakini from my group gave me great inspiration and code for this for loop!\n $(\"#forecast\").empty();\n\n for (var i = 1; i <= 5; i++) {\n\n var forecast5day = function (i) {\n\n return (\n '<div class=\"col-xs-2 five-day\">' +\n `<h6>${moment().add(i, 'd').format(\"MM/DD/YYYY\")}</h6>` +\n `<img src=\"https://openweathermap.org/img/w/${response.list[i].weather[0].icon}.png\" alt=${response.list[i].weather[0].description}>` +\n `<p>Temp: ${((response.list[i].main.temp - 273.15) * 1.80 + 32).toFixed(1)}&nbsp;°F</p>` +\n `<p>Humidity: ${response.list[i].main.humidity}%</p>` +\n '</div>'\n );\n };\n\n $(\"#forecast\").append(forecast5day(i));\n };\n\n $(\"#currentUV\").empty();\n\n var query2URL = \"https://api.openweathermap.org/data/2.5/uvi?&appid=\" + APIKey + \"&lat=\" + cityLat + \"&lon=\" + cityLon;\n\n // Gets UV index and background color for severity\n $.ajax({\n url: query2URL,\n method: \"GET\"\n })\n .then(function (response) {\n console.log(response);\n var currentUV = response.value;\n console.log(currentUV);\n if (currentUV < 3) {\n var backgroundUV = $(\"<span>\").attr(\"style\", \"background-color: green\").text(currentUV);\n } else if (currentUV >= 3 && currentUV < 5) {\n var backgroundUV = $(\"<span>\").attr(\"style\", \"background-color: yellow\").text(currentUV);\n } else if (currentUV >= 5 && currentUV < 8) {\n var backgroundUV = $(\"<span>\").attr(\"style\", \"background-color: orange\").text(currentUV);\n } else if (currentUV >= 8) {\n var backgroundUV = $(\"<span>\").attr(\"style\", \"background-color: red\").text(currentUV);\n }\n $(\"#currentUV\").text(\"UV Index: \").append(backgroundUV);\n });\n\n\n });\n\n\n\n}", "function cityButtons2(){\n console.log(this.innerHTML)\n $(\"#search-value\").val(this.innerHTML)\n\n //api key\n let apiKey = config.key\n //user input\n let city2 = this.innerHTML\n //query url\n let queryURL = \"https://api.openweathermap.org/data/2.5/weather?q=\"+city2+\"&units=imperial&appid=\"+apiKey\n let queryURL2 = \"https://api.openweathermap.org/data/2.5/forecast?q=\"+city2+\"&units=imperial&appid=\"+apiKey\n\n \n //create AJAX call for specific city being queried\n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n .then(function(response){\n $.ajax({\n url: queryURL2,\n method: \"GET\"\n })\n .then(function(response2){\n goodCity = \"yes\"\n console.log(goodCity)\n let cityName = response.name\n let icon = \"http://openweathermap.org/img/wn/\"+response.weather[0].icon+\".png\"\n let now = new Date()\n let date = (now.getMonth() + 1)+\"/\"+now.getDate()+\"/\"+now.getFullYear()\n let temp = response.main.temp\n let humidity = response.main.humidity\n let windSpeed = response.wind.speed\n let date1 = (now.getMonth() + 1)+\"/\"+(now.getDate() + 1)+\"/\"+now.getFullYear()\n let date2 = (now.getMonth() + 1)+\"/\"+(now.getDate() + 2)+\"/\"+now.getFullYear()\n let date3 = (now.getMonth() + 1)+\"/\"+(now.getDate() + 3)+\"/\"+now.getFullYear()\n let date4 = (now.getMonth() + 1)+\"/\"+(now.getDate() + 4)+\"/\"+now.getFullYear()\n let date5 = (now.getMonth() + 1)+\"/\"+(now.getDate() + 5)+\"/\"+now.getFullYear()\n let icon1 = \"http://openweathermap.org/img/wn/\"+response2.list[2].weather[0].icon+\".png\"\n let icon2 = \"http://openweathermap.org/img/wn/\"+response2.list[10].weather[0].icon+\".png\"\n let icon3 = \"http://openweathermap.org/img/wn/\"+response2.list[18].weather[0].icon+\".png\"\n let icon4 = \"http://openweathermap.org/img/wn/\"+response2.list[26].weather[0].icon+\".png\"\n let icon5 = \"http://openweathermap.org/img/wn/\"+response2.list[34].weather[0].icon+\".png\"\n let temp1 = response2.list[2].main.temp\n let temp2 = response2.list[10].main.temp\n let temp3 = response2.list[18].main.temp\n let temp4 = response2.list[26].main.temp\n let temp5 = response2.list[34].main.temp\n let humidity1 = response2.list[2].main.humidity\n let humidity2 = response2.list[10].main.humidity\n let humidity3 = response2.list[18].main.humidity\n let humidity4 = response2.list[26].main.humidity\n let humidity5 = response2.list[34].main.humidity\n \n\n //convert user input to lat and lon to use onecall API\n let lat = response.coord.lat\n let lon = response.coord.lon\n let queryURL3 = \"https://api.openweathermap.org/data/2.5/onecall?lat=\"+lat+\"&lon=\"+lon+\"&exclude=hourly&appid=\"+apiKey\n\n //call new ajax request for the onecall API\n $.ajax({\n url: queryURL3,\n method: \"GET\"\n })\n .then(function(response3){\n \n //uv index information\n let uvIndex = response3.current.uvi \n\n for (i=0;i<cities.length;i++){\n \n //create new div to house city's weather in \"today\"\n $(\"#today\").empty()\n $(\"#today\").prepend('<div class=\"'+cities[i]+'\" id=\"'+cities[i]+'\"></div>')\n $(\"#\"+cities[i]).css(\"border\",\"solid 1px black\")\n //display city name and date in header in new div\n $(\"#\"+cities[i]).append(\"<h1>\"+cityName+\" (\"+date+\") <img src='\"+icon+\"'></h1>\")\n //display temp, humidity, wind speed, and UV index\n $(\"#\"+cities[i]).append(\"<br><p>Temperature: \"+temp+\"&#8457<br><br>Humidity: \"+humidity+\"%<br><br>Wind Speed: \"+windSpeed+\" mph</p>\")\n $(\"#\"+cities[i]).append(\"<p id=uvi class=col-3>UV Index: \"+uvIndex+\"</p>\")\n $(\"#search-value\").val('')\n\n //style uv display and change color depending on uv index\n $(\"#uvi\").css(\"color\", \"white\")\n if (uvIndex >= 0 && uvIndex <= 4){\n $(\"#uvi\").css(\"background-color\", \"green\")\n }\n else if (uvIndex >= 5 && uvIndex <= 7){\n $(\"#uvi\").css(\"background-color\", \"orange\")\n }\n else if (uvIndex >= 8 && uvIndex <= 10){\n $(\"#uvi\").css(\"background-color\", \"red\")\n }\n else {\n $(\"#uvi\").css(\"background-color\", \"purple\")\n }\n \n //create new div to house city's forecast in \"forecast\"\n $(\"#forecast\").children().hide()\n $(\"#forecast\").prepend('<div id=\"'+cities[i]+'-forecast\"></div>')\n $(\"#forecast\").css(\"overflow\",\"hidden\")\n $(\"#\"+cities[i]+\"-forecast\").append(\"<h1>5-Day Forecast:</h1>\")\n $(\"#\"+cities[i]+\"-forecast\").append('<div class=\"col-2 forecastDiv\">'+date1+'<br><img src=\"'+icon1+'\"><br>Temp: '+temp1+'&#8457<br>Humidity: '+humidity1+'%</div>')\n $(\"#\"+cities[i]+\"-forecast\").append('<div class=\"col-2 forecastDiv\">'+date2+'<br><img src=\"'+icon2+'\"><br>Temp: '+temp2+'&#8457<br>Humidity: '+humidity2+'%</div>')\n $(\"#\"+cities[i]+\"-forecast\").append('<div class=\"col-2 forecastDiv\">'+date3+'<br><img src=\"'+icon3+'\"><br>Temp: '+temp3+'&#8457<br>Humidity: '+humidity3+'%</div>')\n $(\"#\"+cities[i]+\"-forecast\").append('<div class=\"col-2 forecastDiv\">'+date4+'<br><img src=\"'+icon4+'\"><br>Temp: '+temp4+'&#8457<br>Humidity: '+humidity4+'%</div>')\n $(\"#\"+cities[i]+\"-forecast\").append('<div class=\"col-2 forecastDiv\">'+date5+'<br><img src=\"'+icon5+'\"><br>Temp: '+temp5+'&#8457<br>Humidity: '+humidity5+'%</div>')\n $(\".forecastDiv\").css(\"border\",\"solid 1px black\").css(\"width\",\"200px\").css(\"float\",\"left\").css(\"background-color\",\"blue\").css(\"color\",\"white\")\n }\n })\n })\n })\n }", "function displayCityBtn() {\n let city = $(this).attr(\"data-city\");\n let queryURL = dayStarterURL + city + apiKey;\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n let iconURL = \"http://openweathermap.org/img/wn/\" + response.weather[0].icon + \"@2x.png\"\n let weatherIcon = $(\"<img>\");\n weatherIcon.attr(\"src\", iconURL);\n weatherIcon.attr(\"alt\", \"weather icon\");\n $(\"#city\").html(\"<h1>\" + response.name + ' : ' + todaysDate + \"</h1>\").attr(\"style\", \"color:white\");\n $(\"#city\").append(weatherIcon)\n let tempF = (response.main.temp - 273.15) * 1.80 + 32;\n $(\"#temp\").text(tempF.toFixed(1) + \"°F\");\n $(\"#wind\").text(\"Wind Speed: \" + response.wind.speed + \" MPH\");\n $(\"#humidity\").text(\"Humidity: \" + response.main.humidity + \"%\");\n\n\n displayForecast(city)\n });\n}", "function weatherInCity(event){ \n // Stops the submit doing its normal behaviour\n event.preventDefault();\n // Assigns the input value to the newCIty\n newCity = searchInput.value;\n // Resets the searcher\n searchInput.value = \"\";\n // Paints the city name in the app\n currentCityElement.innerHTML = newCity;\n // Grabs the current weather for that city\n fetchCurrentWeatherFromCity();\n // Grabs the forecast weather for that city\n fetchForecastWeatherFromCity();\n}", "function displayCurrentCity(cityName, response) {\n\n resultCityEl.text(cityName.toUpperCase());\n var currentDate = moment().format(\" (M/D/YYYY) \");\n\n var currentFah = ((response.main.temp - 273.15) * 9 / 5 + 32).toFixed(1);\n var currentCel = (response.main.temp - 273.15).toFixed(1);\n\n var currentHumidity = response.main.humidity;\n var currentWind = ((response.wind.speed) * 2.237).toFixed(1);\n var currentDesc = response.weather[0].description;\n $('#date').text(currentDate);\n resultTempEl.text(\"Temperature: \");\n\n// calling the function to toggle with fahreneit and celcius\n fahOrCelcius(currentFah,currentCel);\n\n fahreneitEl.text(\" ℉\");\n $('#slash').text(\" / \");\n celciusEl.text(\"°C\");\n resultHumEl.text(\"Humidity: \" + currentHumidity + \"%\");\n resultWindEl.text(\"Wind Speed: \" + currentWind + \" MPH\");\n resultDescEl.text(\"Description: \" + capFirstLetter(currentDesc));\n weatherImageTitleEl.attr(\"src\", \"https://openweathermap.org/img/w/\" + response.weather[0].icon + \".png\");\n\n}", "function getCurrentForecast(city) {\n\t\t$.ajax({\n\t\t\turl:\n\t\t\t\t\"https://api.openweathermap.org/data/2.5/forecast?q=\" +\n\t\t\t\tcity +\n\t\t\t\tapiKey,\n\t\t\tmethod: \"GET\"\n\t\t}).then(function(response) {\n\t\t\tconsole.log(response);\n\t\t\tvar dayIndex = 1;\n\t\t\tfor (let index = 0; index < response.list.length; index++) {\n\t\t\t\tconst element = response.list[index];\n\t\t\t\tif (element.dt_txt.indexOf(\"15:00:00\") !== -1) {\n\t\t\t\t\tdayWeather(dayIndex++, element);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "function historyDisplayWeather(){\n cityName = $(this).attr(\"data-name\");\n displayWeather();\n displayFiveDay();\n}", "goToDay(day) {\n this.setState({\n currentDisplay: \"day\",\n currentDay: dayAPI.getDayByDate(day.dayDate)\n });\n }", "function displayCurrent() {\n\n\t\t\tlet temp = '<p>' + 'It is ' + '<strong>' + data.cities[city].current[0].temp + '&deg;' + '</strong>' + ' outside now' + '</p>';\n\t\t\tlet condition = '<p>' + 'The condition is: ' + '<strong>' + data.cities[city].current[0].condition + '</strong>' + '</p>';\n\n\t\t\tif (data.cities[city].current[0].condition == 'Sunny') {\n\t\t\t\tcurrentDiv.innerHTML = temp + condition;\n\t\t\t\tcurrentDiv.classList.add('sunny');\n\t\t\t} else if (data.cities[city].current[0].condition == 'Cloudy') {\n\t\t\t\tcurrentDiv.innerHTML = temp + condition;\n\t\t\t\tcurrentDiv.classList.add('cloudy-h');\n\t\t\t} else if (data.cities[city].current[0].condition == 'Rainy') {\n\t\t\t\tcurrentDiv.innerHTML = temp + condition;\n\t\t\t\tcurrentDiv.classList.add('rainy');\n\t\t\t} else if (data.cities[city].current[0].condition == 'Partly Sunny') {\n\t\t\t\tcurrentDiv.innerHTML = temp + condition;\n\t\t\t\tcurrentDiv.classList.add('partly-sunny');\n\t\t\t} else if (data.cities[city].current[0].condition == 'Partly Cloudy') {\n\t\t\t\tcurrentDiv.innerHTML = temp + condition;\n\t\t\t\tcurrentDiv.classList.add('partly-cloudy');\n\t\t\t} else {\n\t\t\t\tcurrentDiv.innerHTML = temp + condition;\n\t\t\t}\n\n\t\t\t//darkmode\n\t\t\tlet nyTime = new Date().toLocaleString(\"en-US\", {timeZone: \"America/New_York\"});\n\t\t\tnyTime = new Date(nyTime);\n\t\t\tlet hours = nyTime.getHours();\n\t\t\tif (hours >= 20 || hours <= 7 && data.cities[city].current[0].condition !== 'Cloudy') {\n\t\t\t\tbody.classList.add('darkmode');\n\t\t\t\tcondition = '<p>The condition is: <strong>Nighttime / Clear</strong></p>';\n\t\t\t\tcurrentDiv.innerHTML = temp + condition;\n\t\t\t\tcurrentDiv.classList.add('nighttime');\n\t\t\t} else if (hours <= 20 && hours >= 7 && data.cities[city].current[0].condition == 'Cloudy') {\n\t\t\t\tbody.classList.add('cloudy');\n\t\t\t} else if (hours <= 20 && hours >= 7 && data.cities[city].current[0].condition !== 'Cloudy') {\n\t\t\t\tbody.classList.add('day');\n\t\t\t}\n\t\t}", "function getDailyForecast(city) {\r\n // Make our AJAX call to pull our necessary values\r\n $.ajax({\r\n url: queryURL,\r\n method: \"GET\"\r\n }).then(function (response) {\r\n // Clear out the div to make room for new forecasts\r\n $(\"#forecastDays\").empty();\r\n\r\n // Start at response.list[8] to skip day0.\r\n // Add by 7 to cycle through all hourly entries for each day.\r\n for (var i = 0, j = 1; i < response.list.length, j <= 5; i += 8, j++) {\r\n // Convert our date to human readable format, store in var.\r\n var dateTime = convertDate(response.list[i].dt);\r\n // Create, style, and set our dynamic DOM elements\r\n var newDiv = $(\"<div>\").attr(\"id\", \"day\" + j);\r\n var pTemp = $(\"<p>\");\r\n var pHumid = $(\"<p>\");\r\n var iconImage = $(\"<img>\");\r\n\r\n newDiv.attr(\"class\", \"col-lg-2\").appendTo(\"#forecastDays\");\r\n newDiv.html(\"<h6>\" + dateTime + \"</h6>\").appendTo(newDiv);\r\n pTemp.html('<i class=\"fas fa-thermometer-full\"></i>' + response.list[i].main.temp + \" &#730\" + unit).appendTo(newDiv);\r\n pHumid.html('<i class=\"fas fa-smog\"></i>' + response.list[i].main.humidity + \"%\").appendTo(newDiv);\r\n iconImage.attr(\"src\", \"http://openweathermap.org/img/w/\" + response.list[i].weather[0].icon + \".png\").appendTo(newDiv);\r\n\r\n // Append our dynamic elements to the DOM.\r\n $(\"#forecastDays\").append(newDiv);\r\n }\r\n });\r\n }", "function addNewCityToUI(e){\n\n const newcity = document.getElementById(\"create-city\").value;\n ui.addNewCity(newcity);\n storage.addCityToStorage(newcity);\n\n const addedCity = document.querySelectorAll(\"#city\");\n const lastCity = addedCity[addedCity.length -1].textContent;\n const forecast = new Forecast(lastCity);\n forecast.forecastcondition(function(err,response,response2,response3,response4,response5){\n\n if(err === null){\n ui.displayWeather(response);\n ui.displayStatus(response2);\n ui.displayWind(response3);\n ui.displayHumidity(response4);\n ui.displayIcon(response5);\n\n } else {\n console.error(err);\n }\n\n });\n\n\n e.preventDefault();\n\n}", "function currentCity() {\n//create a variable to get the city as an object from local storage\n var storedWeather = JSON.parse(localStorage.getItem(\"currentCity\"));\n//if the value or type are not empty, show that cities weather\n if (storedWeather !== null) {\n cityName = storedWeather;\n//call the function to show the weather\n displayWeather();\n displayFiveDay();\n }\n}", "function cityWeatherInformation(cityAPIName,cityButtonName){\n\n //Resets results section fields\n $('#current-weather').empty();\n for (i = 1; i < 6; i++){\n let resetFiveDay = '#day-' + i;\n $(resetFiveDay).empty();\n };\n\n //URL for first API call\n let currentURL = \"https://api.openweathermap.org/data/2.5/weather?q=\" + cityAPIName + \"&units=imperial&appid=\" + myKey;\n\n\n //First API call for lat/lon of city to use for second API call\n $.ajax({\n url: currentURL,\n method: \"GET\",\n //If city is not valid, will give an error message\n error: function() {\n $('.results').attr('hidden', true);\n alert(\"City name entered is not valid. Please enter in a valid city name.\");\n createNewButton = false;\n return;\n }\n })\n .then(function(response1){\n\n //If a new button needs to be created (city was entered in search field); also adds to localStorage\n if(createNewButton){\n //Checks to make sure a button has not already been created for the city name\n let checkCityButton = cityButtonName.trim().toLowerCase().split(' ').join('-');\n //If the button does not exist, create a new button\n if(!$(\"#\" + checkCityButton).length){\n //Create a new button and add classes\n let newCityButton = $('<button>');\n newCityButton.addClass('btn btn-primary mb-1');\n //Creates ID based on city name; adds city name to the new button\n let cityButtonID = cityButtonName.trim().toLowerCase().split(' ').join('-');\n newCityButton.attr('id', cityButtonID);\n newCityButton.html(cityButtonName);\n //Adds new button to the site\n $('#city-buttons').prepend(newCityButton);\n\n //For localStorage\n //Variables for search history (allSearchHistory for all objects into an array; addSearchHistory for each object)\n let allSearchHistory = [];\n let addSearchHistory = {city: cityButtonName};\n //Gets current search history from localStorage; parse data\n allSearchHistory = JSON.parse(localStorage.getItem(\"citySearchHistory\"));\n //If nothing currently in local storage\n if(!allSearchHistory){\n //Search history should be an empty array\n allSearchHistory = [];\n //Adds first object to allSearchHistory\n allSearchHistory[0] = addSearchHistory;\n } else {\n //Adds new object to allSearchHistory\n allSearchHistory.push(addSearchHistory);\n }\n //Convert object into a string to store\n localStorage.setItem(\"citySearchHistory\",JSON.stringify(allSearchHistory));\n createNewButton = false;\n };\n };\n\n //Remove hidden attribute from results html\n $('.results').removeAttr('hidden');\n\n //Set latitude and longitude for second URL\n let lat = response1.coord.lat;\n let lon = response1.coord.lon;\n\n //Sets url for second API call for all data\n let fiveDayURL = \"https://api.openweathermap.org/data/2.5/onecall?lat=\" + lat + \"&lon=\" + lon +\"&exclude=minutely,hourly,alerts&units=imperial&appid=\" + myKey;\n\n //Name and Date for current conditions\n //Assigns data to variables\n $('.name').text(response1.name);\n let unixTime = response1.dt;\n let dateData = new Date(unixTime * 1000);\n let month = dateData.getMonth() + 1;\n let date = dateData.getDate();\n let year = dateData.getFullYear();\n //Appends data to html\n $('#current-weather').append($('<h2>').addClass(\"mb-3\").text(`${response1.name} (${month}/${date}/${year})`));\n //Add icon to h2 based on current weather conditions\n let currentWeatherCondition = response1.weather[0].main;\n let weatherConditionIcon = $('<img>');\n //Adds title to icon\n let weatherConditionText = response1.weather[0].description;\n weatherConditionIcon.attr('title','Conditions: ' + weatherConditionText);\n weatherConditionIcon.addClass('conditions-text');\n //Calls Function that appends weather icon\n addWeatherIcon(currentWeatherCondition);\n $('h2').append($('<span>').html(weatherConditionIcon));\n\n\n //Second API call for all weather data\n $.ajax({\n url: fiveDayURL,\n method: \"GET\"\n })\n .then(function(response2){\n\n //Sets and appends current temperature\n $('#current-weather').append($('<p>').html(`Temperature: ${response2.current.temp} &#8457;`));\n\n //Sets and appends current humidity\n $('#current-weather').append($('<p>').text(`Humidity: ${response2.current.humidity}%`));\n\n //Sets and appends current wind speed\n $('#current-weather').append($('<p>').text(`Wind Speed: ${response2.current.wind_speed} MPH`));\n\n //Sets and appends current uv index\n let uvIndexAdd = $('<p>');\n let uvIndexNumber = $('<span>');\n uvIndexNumber.addClass('p-2');\n let uvIndex = response2.current.uvi;\n $('#current-weather').append(uvIndexAdd.text(`UV Index: `));\n //Adds style based on uv index number (by adding a specific ID)\n if(uvIndex < 3){\n uvIndexNumber.attr('id', 'uv-index-low')\n } else if(uvIndex < 6){\n uvIndexNumber.attr('id', 'uv-index-moderate')\n } else if(uvIndex < 8){\n uvIndexNumber.attr('id', 'uv-index-high')\n } else if(uvIndex >= 8){\n uvIndexNumber.attr('id', 'uv-index-severe')\n } else {\n console.log(\"issue with uv index\")\n };\n uvIndexAdd.append(uvIndexNumber.text(uvIndex));\n \n //Sets 5 day forecast\n for (i = 1; i < 6; i++){\n //For specific day\n let day = response2.daily[i];\n //Assigns data to variables\n let newUnixTime = day.dt;\n let newDateData = new Date(newUnixTime * 1000);\n let dayMonth = newDateData.getMonth() + 1;\n let dayDate = newDateData.getDate();\n let dayYear = newDateData.getFullYear();\n\n\n //Appends date\n let addTo = '#day-' + i;\n $(addTo).append($('<h6>').text(`${dayMonth}/${dayDate}/${dayYear}`));\n\n //Calls function to append weather icon\n weatherConditionIcon = $('<img>');\n let fiveDayWeatherCondition = day.weather[0].main;\n let fiveDayConditionText = day.weather[0].description;\n weatherConditionIcon.attr('title','Conditions: ' + fiveDayConditionText);\n weatherConditionIcon.addClass('conditions-text');\n addWeatherIcon(fiveDayWeatherCondition);\n $(addTo).append(weatherConditionIcon);\n\n //Appends temperature\n $(addTo).append($('<p>').html(`Temp: ${day.temp.day} &#8457;`));\n\n //Appends Humidity\n $(addTo).append($('<p>').text(`Humidity: ${day.humidity}%`));\n };\n });\n \n\n //Function created to add weather icon\n function addWeatherIcon(setWeatherCondition){\n let iconURL; \n switch(setWeatherCondition){\n case 'Clear':\n iconURL = \"http://openweathermap.org/img/wn/01d@2x.png\";\n weatherConditionIcon.attr('src', iconURL)\n break;\n case 'Clouds':\n iconURL = \"http://openweathermap.org/img/wn/04d@2x.png\";\n weatherConditionIcon.attr('src', iconURL)\n break; \n case 'Drizzle':\n iconURL = \"http://openweathermap.org/img/wn/09d@2x.png\";\n weatherConditionIcon.attr('src', iconURL)\n break;\n case 'Rain':\n iconURL = \"http://openweathermap.org/img/wn/10d@2x.png\";\n weatherConditionIcon.attr('src', iconURL)\n break; \n case 'Thunderstorm':\n iconURL = \"http://openweathermap.org/img/wn/11d@2x.png\";\n weatherConditionIcon.attr('src', iconURL)\n break;\n case 'Snow':\n iconURL = \"http://openweathermap.org/img/wn/13d@2x.png\";\n weatherConditionIcon.attr('src', iconURL)\n break;\n case 'Mist':\n case 'Smoke':\n case 'Haze':\n case 'Dust':\n case 'Fog':\n case 'sand':\n case 'Ash':\n case 'Squall':\n case 'Tornado':\n iconURL = \"http://openweathermap.org/img/wn/50d@2x.png\";\n weatherConditionIcon.attr('src', iconURL)\n break;\n default: \n console.log(\"Issue with the icons\");\n console.log(setWeatherCondition);\n };\n };\n });\n}", "function buttonClickHandler(event) {\n if (searchedCityEl.value == \"Searched Cities\") {\n alert(\"Please select an option\");\n } else {\n var cityNameClicked = searchedCityEl.value;\n //console.log(cityNameClicked);\n getCityWeather(cityNameClicked);\n }\n}", "function currentweatherPopulate() {\n\n let city = currentDay.name;\n let temp = tempConvertor(currentDay.main.temp);\n let humid = currentDay.main.humidity;\n let wind = currentDay.wind.speed;\n let icon = currentDay.weather[0].icon;\n let date = moment.unix(currentDay.dt).format('MMMM Do YYYY');\n\n $(`.city`).text(city);\n $(`.current-date`).text(date);\n $(`.current-temp`).html(`${temp}&#176;`);\n $(`.current-humidity`).html(`${humid}&#37;`);\n $(`.current-wind`).html(`${wind} MPH`);\n $(`.current-icon`).attr(`src`, `${iconURL}${icon}@2x.png`);\n }", "function clickedButton (){\n \n let currentDay= document.getElementById('date');\n if(currentDay.style.display==='none'){\n currentDay.style.display= 'block';\n }else {\n currentDay.style.display='none';\n }\n /*For testing purposes\n console.log('click test2'); */\n }", "function localPost(){\n var cityHistory = JSON.parse(window.localStorage.getItem(\"city-name\")) || [];\n\n for (var i = 0; i < cityHistory.length; i++){\n var newButton = $(\"<button class='button is-fullwidth is-rounded cityButton'>\").text(cityHistory[i]);\n $(buttonDump).append(newButton);\n $(newButton).click(function() {\n var inputSave = $(this).text();\n nowWeather(inputSave);\n forcast(inputSave);\n });\n }\n}", "function renderDay (data, tog) {\n\ttemp = displayTemp(data.list[0].temp.day, tog);\n\ttempMin = displayTemp(data.list[0].temp.min, tog);\n\ttempMax = displayTemp(data.list[0].temp.max, tog);\n\tdescription = data.list[0].weather[0].description;\n\tdescription = description[0].toUpperCase() + description.substring(1);\n\twind = displaySpeed(data.list[0].speed, tog);\n\ticon = data.list[0].weather[0].icon;\n\tbgURL = switchBG(icon);\n\tcity = data.city.name;\n $(\"#todayTemp\").html(\" \" + description + \"<br />\" + 'Temp: ' + temp + \"<br />\" + 'High/Low: ' + tempMax + \"/\" + tempMin + \"<br />\" + 'Wind: ' + wind);\n\tif (night == 1) {\n\t\t$(\"#todayTemp\").css({\"color\":\"white\", \"background\":\"rgba(255, 255, 255, 0.07)\"})\n\t}\n\tif (night == 0){\n \t$(\"#weatherBG\").prepend('<h1> Today in ' + city + '</h1>');\n\t\t}\n\t\telse {\n\t\t\t$(\"#weatherBG\").prepend('<h2> Tonight in ' + city + '</h2>');\t\n\t\t}\n}", "function openDay(evt, cityName) {\n var t, xtabcontent, xtablinks;\n xtabcontent = document.getElementsByClassName(\"xtabcontent\");\n for (t = 0; t < xtabcontent.length; t++) {\n xtabcontent[t].style.display = \"none\";\n }\n xtablinks = document.getElementsByClassName(\"xtablinks\");\n for (t = 0; t < xtablinks.length; t++) {\n xtablinks[t].className = xtablinks[t].className.replace(\" active\", \"\");\n }\n document.getElementById(cityName).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "function retrieveCityWeather() {\n $(\".cityBtn\").on(\"click\", function (event) {\n event.preventDefault();\n //variable that holds city text displayed on btn\n wordCity = this.innerHTML;\n //passing that city to the displayWeather function\n displayWeather(wordCity);\n\n })\n}", "function markerDaily() {\n var lngLat = marker.getLngLat();\n var longitude = lngLat.lng;\n var latitude = lngLat.lat;\n weatherOptions.lat = latitude\n weatherOptions.lon = longitude\n reverseGeocode({lng: longitude, lat: latitude}, mapboxToken).then(function (result) {\n $('#current-city').empty()\n $('#current-city').append(\"Current Location \" + result)\n });\n weeklyForecast();\n }", "function currentWeather(city) {\n $.ajax({\n method: \"GET\",\n url: `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=bc446cf7ce1e7b9894b233c0b69caad0&units=imperial`,\n dataType: \"json\",\n success: function (response) {\n console.log(response);\n\n //currentWeather Variables\n var currentDateTime = moment().format(\"LLL\");\n var cityName = response.name;\n var currentTemperature = Math.round(response.main.temp);\n var currentHumidity = Math.round(response.main.humidity);\n var currentWindSpeed = Math.round(response.wind.speed);\n\n $(\"#cityDate\").html(\n \"<h2>\" + cityName + \" (\" + currentDateTime + \")\" + \"<h2>\"\n );\n $(\"#currentIcon\").attr(\n \"src\",\n \"https://openweathermap.org/img/wn/\" +\n response.weather[0].icon +\n \"@2x.png\"\n );\n $(\"#temp\").text(currentTemperature + \"°F\");\n $(\"#humidity\").text(currentHumidity + \"%\");\n $(\"#windSpeed\").text(currentWindSpeed + \" MPH\");\n\n var lat = response.coord.lat;\n var lon = response.coord.lon;\n\n forecastWeather(lat, lon);\n },\n });\n }", "function showDate(choose){\n var chooseTimeZone = choose;\n chooseTimeZone.setMinutes(chooseTimeZone.getMinutes() - timeZoneToday);\n var local = $('#local').data('local')\n var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };\n $('#date-choose').html(chooseTimeZone.toLocaleDateString(local, options));\n if (dateOpen.length){\n $.each(dateOpen, function(i, d) {\n var day = new Date(d.day.date.slice(0, 10));\n if (choose.getDate() == day.getDate() && choose.getMonth() == day.getMonth() && choose.getFullYear() == day.getFullYear()){\n $('#nb-places').html(1000 - d.nbVisitor);\n return false;\n }\n $('#nb-places').html('1000');\n });\n } else {\n $('#nb-places').html('1000');\n }\n $('#choose').css('display', 'block');\n // \n if ((choose.getDate() == today.getDate() && choose.getMonth() == today.getMonth() && choose.getFullYear() == today.getFullYear() && today.getHours() > 13)){\n $('#button-day').css('display', 'none');\n } else {\n $('#button-day').css('display', 'inline-block');\n }\n $('#button-half-day').css('display', 'inline-block');\n }", "function weatherOnDay(day){\n var weather;\n switch(day){\n case \"Sunday\": \n weather = \"Cloudy with a chance of rain\";\n break;\n case \"Monday\":\n weather = \"Sunny as day\";\n break;\n case \"Tuesday\":\n weather = \"Thunderstorms\";\n break;\n case \"Wednesday\":\n weather = \"Hailing\";\n break;\n case \"Thursday\":\n weather = \"Snowing\";\n break;\n case \"Friday\":\n weather = \"Raining\";\n break;\n case \"Saturday\":\n weather = \"Chilly\";\n break;\n default:\n weather = \"Enter a valid day\";\n }\n return weather;\n}", "function queryCity(city) {\n var queryURL = \"https://api.openweathermap.org/data/2.5/weather?q=\" + city + \"&units=imperial&appid=\" + weatherKey;\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).done(function (response) {\n /* Hide results */\n $(\"#result-col\").addClass(\"hidden\");\n $(\"#current-date\").text(moment().format(\"M/D/YYYY\"));\n $(\"#current-city\").text(response.name);\n $(\"#current-temp\").text(parseFloat(response.main.temp).toFixed(1));\n $(\"#current-humid\").text(response.main.humidity);\n $(\"#current-wind\").text(response.wind.speed);\n $(\"#current-icon\").attr(\"src\", \"https://openweathermap.org/img/wn/\" + response.weather[0].icon + \".png\");\n\n /* Use lat/lon to query UVI and 5-day forecast */\n queryOneCall(response.coord.lon, response.coord.lat);\n\n saveCity(response.name);\n });\n}", "function currentConditions(response) {\n var temp = (response.main.temp);\n var weatherBackground = (response.weather[0].main);\n temp = Math.floor(temp);\n var time = new Date();\n var utcTime = time.getTime();\n var offset = time.getTimezoneOffset();\n console.log(offset);\n console.log(response.timezone);\n var localTime = new Date(utcTime + (response.timezone + (offset * 60)) * 1000);\n // Empties the search bar\n $('#currentCity').empty();\n\n // Creates the variables for the card that will contain the weather.\n var card = $('<div>').addClass('card');\n var cardContent = $('<div>').addClass('card-content');\n var city = $('<h4>').addClass('card-head').text(response.name);\n var cityDate = $('<h4>').addClass('card-head').text(date.toDateString('en-US'));\n var cityTime = $('<h4>').addClass('card-head').text(localTime.toLocaleTimeString(('en-US')));\n var conditions = $('<p>').addClass('card-body current-description').text('Current Condition: ' + response.weather[0].description);\n var temperature = $('<p>').addClass('card-body current-temp').text('Temperature: ' + temp + '℉');\n var humidity = $('<p>').addClass('card-body current-humidity').text('Humidity: ' + response.main.humidity + '%');\n var windMph = $('<p>').addClass('card-body current-wind').text('Wind Speed: ' + response.wind.speed + ' MPH');\n var weatherImage = $('<img>').attr('src', 'https://openweathermap.org/img/wn/' + response.weather[0].icon + '@4x.png');\n\n // Appending the data to the page.\n city.append(cityDate, cityTime, weatherImage);\n cardContent.append(city, conditions, temperature, humidity, windMph,);\n card.append(cardContent);\n $('#currentCity').append(card);\n\n // weatherBackground = 'Haze';\n // Switch statement for the dynamic weather backgrounds.\n switch (weatherBackground) {\n case \"Snow\":\n $('.card').css('background-image', \"url('https://mdbgo.io/ascensus/mdb-advanced/img/snow.gif')\");\n break;\n case \"Clouds\":\n $('.card').css('background-image', \"url('https://mdbgo.io/ascensus/mdb-advanced/img/clouds.gif')\");\n break;\n case \"Fog\":\n $('.card').css('background-image', \"url('https://mdbgo.io/ascensus/mdb-advanced/img/fog.gif')\");\n break;\n case \"Rain\":\n $('.card').css('background-image', \"url('https://mdbgo.io/ascensus/mdb-advanced/img/rain.gif')\");\n break;\n case \"Clear\":\n $('.card').css({ 'color': 'black', 'background-image': \"url('https://mdbgo.io/ascensus/mdb-advanced/img/clear.gif')\" });\n break;\n case \"Thunderstorm\":\n $('.card').css('background-image', \"url('https://mdbgo.io/ascensus/mdb-advanced/img/thunderstorm.gif')\");\n break;\n case \"Drizzle\":\n $('.card').css('background-image', \"url('https://bestanimations.com/media/rain/697448260rain-water-animated-gif.gif')\");\n break;\n case \"Mist\":\n $('.card').css('background-image', \"url('https://64.media.tumblr.com/e84280580f35285af46b3942b287b891/tumblr_op6v3jG8mU1unfdido1_500.gifv')\");\n break;\n case \"Smoke\":\n $('.card').css('background-image', \"url('https://media1.giphy.com/media/3oz8xujaR1rpMXRd8k/giphy.gif?cid=790b761142618ad0a1a60859c8f627bbbfebdb8c73d10057&rid=giphy.gif&ct=g')\");\n break;\n case \"Haze\":\n $('.card').css('background-image', \"url('https://th.bing.com/th/id/R.d3715f254c73a463014eeb6d2ab82003?rik=71HY9gXEaYtYPA&riu=http%3a%2f%2fnetanimations.net%2fchildren-of-men-cinemagraph-art.gif&ehk=gjj7p1osNQxp4wqvFdHG%2b57kuhkNoQ3I39S7vtb3CEA%3d&risl=&pid=ImgRaw')\");\n break;\n case \"Squall\":\n $('.card').css('background-image', \"url('https://www.bing.com/th/id/OGC.645b3b99407cc0186bb304a2ce520c79?pid=1.7&rurl=https%3a%2f%2fgifimage.net%2fwp-content%2fuploads%2f2017%2f10%2fhuracanes-gif-1.gif&ehk=IC9MG%2f2Q3VjEu5MJmPJmdBfNDdXovVR1bGzib1VNMM8%3d')\");\n break;\n case \"Tornado\":\n $('.card').css('background-image', \"url('https://media0.giphy.com/media/MXvDhlmD0eB5qNvvjZ/giphy.gif?cid=790b76114c9a15098432b7e68e495248824cab011a46459f&rid=giphy.gif&ct=g')\");\n break;\n default:\n $('.card').css({ 'color': 'black', 'background-image': \"url('https://media0.giphy.com/media/MXvDhlmD0eB5qNvvjZ/giphy.gif?cid=790b76114c9a15098432b7e68e495248824cab011a46459f&rid=giphy.gif&ct=g')\" });\n break;\n }\n}", "function calendarBeforeShowDay(day, busy_at, input)\n{\n var result = true;\n var title = '';\n var day_class = 'contract-day';\n\n // Fix for day.getTime() after close calendar\n if (day instanceof Date) {\n var timestamp = (day.getTime() - day.getTimezoneOffset()*60000)/1000;\n var role = $(input).data('role');\n\n if (busy_at[timestamp] !== undefined) {\n var busyness = busy_at[timestamp];\n\n switch (role) {\n case 'arrival':\n if (role == 'arrival' && busyness.arrival == false && busyness.departure == true) {\n day_class = day_class + ' departure';\n result = true;\n } else if (role == 'arrival' && busyness.arrival == true && busyness.departure == false) {\n day_class = day_class + ' arrival';\n result = false;\n } else {\n result = false;\n }\n\n break;\n\n case 'departure':\n if (role == 'departure' && busyness.arrival == true && busyness.departure == false) {\n day_class = day_class + ' arrival';\n result = true;\n } else if (role == 'departure' && busyness.arrival == false && busyness.departure == true) {\n day_class = day_class + ' departure';\n result = false;\n } else {\n result = false;\n }\n\n break;\n }\n\n if (busyness.arrival == true && busyness.departure == true) {\n day_class = day_class + ' arrival departure';\n result = false;\n }\n }\n\n day_class = day_class + ' ' + (result === true ? 'available' : 'disabled');\n return [result, day_class, title];\n }\n\n return null;\n}", "function forecast(city) {\n // URL for the OWM five-day forecast API\n var forecastURL =\n \"https://api.openweathermap.org/data/2.5/forecast?q=\" +\n city +\n \"&units=imperial&appid=\" +\n APIKey;\n\n // Get the info from the API\n $.ajax({\n url: forecastURL,\n method: \"GET\",\n }).then(function (forecast) {\n // After user enters a city, the temperature and humidity will be shown for the next five days\n // Day 1\n var dayOne = forecast.list[4];\n var dayTitleOne = document.querySelector(\".date-title-one\");\n var dayTempOne = document.querySelector(\".date-temp-one\");\n var dayHumOne = document.querySelector(\".date-hum-one\");\n dayTitleOne.textContent = moment().add(1, \"day\").format(\"l\");\n dayTempOne.textContent = \"Temp: \" + dayOne.main.temp.toFixed(1) + \" °F\";\n dayHumOne.textContent = \"Humidity: \" + dayOne.main.humidity + \"%\";\n // Weather icon for day 1\n var iconOne = forecast.list[4].weather[0].icon;\n var iconOneURL = \"http://openweathermap.org/img/wn/\" + iconOne + \".png\";\n document.querySelector(\".card-icon-one\").src = iconOneURL;\n\n // Day 2\n var dayTwo = forecast.list[12];\n var dayTitleTwo = document.querySelector(\".date-title-two\");\n var dayTempTwo = document.querySelector(\".date-temp-two\");\n var dayHumTwo = document.querySelector(\".date-hum-two\");\n dayTitleTwo.textContent = moment().add(2, \"days\").format(\"l\");\n dayTempTwo.textContent = \"Temp: \" + dayTwo.main.temp.toFixed(1);\n +\" °F\";\n dayHumTwo.textContent = \"Humidity: \" + dayTwo.main.humidity + \"%\";\n // Weather icon for day 2\n var iconTwo = forecast.list[12].weather[0].icon;\n var iconTwoURL = \"http://openweathermap.org/img/wn/\" + iconTwo + \".png\";\n document.querySelector(\".card-icon-two\").src = iconTwoURL;\n\n // Day 3\n var dayThree = forecast.list[20];\n var dayTitleThree = document.querySelector(\".date-title-three\");\n var dayTempThree = document.querySelector(\".date-temp-three\");\n var dayHumThree = document.querySelector(\".date-hum-three\");\n dayTitleThree.textContent = moment().add(3, \"days\").format(\"l\");\n dayTempThree.textContent =\n \"Temp: \" + dayThree.main.temp.toFixed(1 + \" °F\");\n dayHumThree.textContent = \"Humidity: \" + dayThree.main.humidity + \"%\";\n // Weather icon for day 3\n var iconThree = forecast.list[20].weather[0].icon;\n var iconThreeURL =\n \"http://openweathermap.org/img/wn/\" + iconThree + \".png\";\n document.querySelector(\".card-icon-three\").src = iconThreeURL;\n\n // Day 4\n var dayFour = forecast.list[28];\n var dayTitleFour = document.querySelector(\".date-title-four\");\n var dayTempFour = document.querySelector(\".date-temp-four\");\n var dayHumFour = document.querySelector(\".date-hum-four\");\n dayTitleFour.textContent = moment().add(4, \"days\").format(\"l\");\n dayTempFour.textContent = \"Temp: \" + dayFour.main.temp.toFixed(1) + \" °F\";\n dayHumFour.textContent = \"Humidity: \" + dayFour.main.humidity + \"%\";\n // Weather icon for day 4\n var iconFour = forecast.list[28].weather[0].icon;\n var iconFourURL = \"http://openweathermap.org/img/wn/\" + iconFour + \".png\";\n document.querySelector(\".card-icon-four\").src = iconFourURL;\n\n // Day 5\n var dayFive = forecast.list[36];\n var dayTitleFive = document.querySelector(\".date-title-five\");\n var dayTempFive = document.querySelector(\".date-temp-five\");\n var dayHumFive = document.querySelector(\".date-hum-five\");\n dayTitleFive.textContent = moment().add(5, \"days\").format(\"l\");\n dayTempFive.textContent = \"Temp: \" + dayFive.main.temp.toFixed(1) + \" °F\";\n dayHumFive.textContent = \"Humidity: \" + dayFive.main.humidity + \"%\";\n // Weather icon for day 5\n var iconFive = forecast.list[36].weather[0].icon;\n var iconFiveURL = \"http://openweathermap.org/img/wn/\" + iconFive + \".png\";\n document.querySelector(\".card-icon-five\").src = iconFiveURL;\n });\n }", "function addToday() {\n tomorrowView.classList.add(\"hidden\");\n laterView.classList.add(\"hidden\");\n todayViewList.classList.add(\"hidden\");\n todayAddButton.classList.add(\"hidden\");\n helpIcon.classList.add(\"hidden\");\n if (textForm.classList.contains(\"hidden\")) {\n textForm.classList.remove(\"hidden\");\n }\n var tempDate = new Date();\n dueDate = new Date(tempDate.getFullYear(),tempDate.getMonth(),tempDate.getDate());\n}", "function dayClicked (event) { // pass an informaton about the element clicked into the function\n\tvar element = event.target; // save information about the element as a variable\n\tdocument.getElementById(\"divCurrentDay\").removeAttribute(\"id\"); // remove clicked element's Id\n\telement.parentNode.setAttribute(\"id\", \"divCurrentDay\"); // add a new Id to the element\n\tday = parseInt(event.target.innerHTML); // save the HTML content as a day variable\n\tfindEventIndex(day); // check if there is an event connected to that day\n\tgetEventDetails(); // display informations about an event (or lack of it)\n}", "function display_day_selector(){\n\t$(\"#days_container\").html(\"\");\n\tfor(const item in MY_CURRENT_PLAN){\n\t\tday = parseInt(item)+1;\n\t\t$(\"#days_container\").append('<a id=\"day_selector_' + item + '\" onclick=\"select_day(' + item + ')\" class=\"day_selector waves-effect waves-light little-container-item amber lighten-4 ' + (MY_SETTINGS[\"completed_days\"].includes(day-1) ? \"strikethrough\" : \"\") + '\">' + day + '</a>');\n\t}\n}", "function cityClicked(){\n getCurrentWeather(event.target.innerText);\n}", "highlightToday() {\n\n // find all day squares\n var days = C('day-square');\n\n // deletes all of the \n for (var i = 0; i < days.length; i++)\n days[i].classList.remove('today');\n\n // if it is the correct month and year, highlights the today's date\n if((this.month == this.today.getMonth()) && (this.year == this.today.getFullYear())) \n days[this.today.getDate() + this.monthInfo.firstDayOfWeek - 1].classList.add('today');\n \n }", "function oneday(city){\n //create url\n var queryURL = \"http://api.openweathermap.org/data/2.5/weather?q=\"+ city +\"&appid=20cee50ad515784c48e915ac5ce70b1a\";\n console.log(queryURL)\n\n //2. call ajax\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(response)\n\n \n //citname\n var cityName=response.name\n console.log(cityName)\n //date\n //will need to call momentjs for current date(day planner code)\n //temp need to convert to F\n var cityTemp=response.main.temp\n \n console.log(cityTemp) \n \n //humidity\n var cityHumidity=response.main.humidity\n console.log(cityHumidity)\n //windspeed\n var cityWind=response.wind.speed\n console.log(cityWind)\n //uv we have to grab the lon and lat and call another ajax request for uvvis\n var lon=response.coord.lon\n console.log(\"lon\" +lon);\n var lat=response.coord.lat;\n console.log(\"lat\"+ lat);\n\n // <div class=\"oneday\">\n var cityDiv1 = $(\"<div>\");\n // <div></div>\n cityDiv1.attr(\"class\",\"oneday\");\n // <div class=\"oneday\"></div>\n\n var p1=$(\"<p>\");\n //<p></p>\n p1.text(\"City:\" + cityName);\n\n var p2=$(\"<p>\");\n //<p></p>\n p2.text(\"Humidty:\" + cityHumidity + \"%\");\n\n var p3=$(\"<p>\");\n //<p></p>\n p3.text(\"Windspeed:\" + cityWind + \"mph\");\n\n var p4=$(\"<p>\");\n \n //<p></p>\n p4.text(\"Temp:\" + cityTemp + \"K\");\n // <p>City: Austin</p>\n // <p>City: Austin</p>\n // <p>windspeed: 77</p>\n // </div>]]\n cityDiv1.append(p1);\n cityDiv1.append(p2);\n cityDiv1.append(p3)\n cityDiv1.append(p4)\n // <div class=\"oneday\"\n // <p>City: Austin</p>\n //></div>\n\n //citydiv1 needs to live in html\n $(\"#1day-view\").append(cityDiv1)\n\n\n \n \n });\n\n //3.get the specific data for 1 day forcast\n \n \n\n }", "function noweKonto(){\r\n clicked = true;\r\n}", "function cityInfoOnButtonPush() {\n var city = $(this).attr(\"data-city\");\n var cityData = cities.find(function (cityData) {\n return cityData.city.name === city;\n });\n renderWeatherInfo(cityData);\n }", "function Day () {\n this.hotel = null;\n this.restaurants = [];\n this.activities = [];\n this.number = days.push(this);\n this.buildButton().drawButton();\n }", "function calendarBeforeShowDayCreate(day) {\n return calendarBeforeShowDay(day, busy_at_create, $(this));\n}", "function getApi(City) {\n var requestURL =\n \"https://api.openweathermap.org/data/2.5/weather?q=\" +\n City +\n \"&units=imperial&appid=\" +\n apiKey;\n fetch(requestURL)\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n // Template literal for current day data\n currentDayTemplate = `\n <div class=\"card-body\">\n <h1 class=\"cityName\"></h1>\n <p class=\"temperature\">Temperature:<span id=\"temp\"></span></p>\n <p class=\"humidity\">Humidity:<span id=\"humidity\"></span></p>\n <p class=\"windSpeed\">Wind Speed:<span id=\"windSpeed\"></span></p>\n <p class=\"UvNumber\">UV index: <span id=\"Uv\"></span></p>\n </div>`;\n document.querySelector(\".current-day\").innerHTML += currentDayTemplate;\n\n var cityName = $(\".cityName\");\n var temperature = $(\"#temp\");\n var humidity = $(\"#humidity\");\n var windSpeed = $(\"#windSpeed\");\n\n // Manipulate DOM\n cityName.text(data.name + \" \" + \"( \" + date + \" )\");\n temperature.text(data.main.temp + \" \" + \"°F\");\n humidity.text(data.main.humidity + \" \" + \"%\");\n windSpeed.text(data.wind.speed + \" \" + \"MPH\");\n \n // Created an object to hold lat and lon for city selected\n City = {\n lat: data.coord.lat,\n lon: data.coord.lon,\n };\n // Set currentCityData to local storage\n localStorage.setItem(\"CurrentCityData\", JSON.stringify(data));\n \n // Pass lat and lon as x and y into UvForCity function\n UvForCity(City.lat.toFixed(), City.lon.toFixed());\n\n console.log(City.lat);\n console.log(City.lon);\n });\n}", "function getWeatherToday() {\n\tvar getUrlCurrent = `https://api.openweathermap.org/data/2.5/weather?q=${city}&units=imperial&appid=${key}`;\n\n\t$(cardTodayBody).empty();\n\n\t$.ajax({\n\t\turl: getUrlCurrent,\n\t\tmethod: 'GET',\n\t}).then(function (response) {\n\t\t$('.cardTodayCityName').text(response.name);\n\t\t$('.cardTodayDate').text(date);\n\t\t//Icons\n\t\t$('.icons').attr('src', `https://openweathermap.org/img/wn/${response.weather[0].icon}@2x.png`);\n\t\t// Temperature\n\t\tvar pEl = $('<p>').text(`Temperature: ${response.main.temp} °F`);\n\t\tcardTodayBody.append(pEl);\n\t\t//Feels Like\n\t\tvar pElTemp = $('<p>').text(`Feels Like: ${response.main.feels_like} °F`);\n\t\tcardTodayBody.append(pElTemp);\n\t\t//Humidity\n\t\tvar pElHumid = $('<p>').text(`Humidity: ${response.main.humidity} %`);\n\t\tcardTodayBody.append(pElHumid);\n\t\t//Wind Speed\n\t\tvar pElWind = $('<p>').text(`Wind Speed: ${response.wind.speed} MPH`);\n\t\tcardTodayBody.append(pElWind);\n\t\t//Set the lat and long from the searched city\n\t\tvar cityLon = response.coord.lon;\n\t\t// console.log(cityLon);\n\t\tvar cityLat = response.coord.lat;\n\t\t// console.log(cityLat);\n\n\t\tvar getUrlUvi = `https://api.openweathermap.org/data/2.5/onecall?lat=${cityLat}&lon=${cityLon}&exclude=hourly,daily,minutely&appid=${key}`;\n\n\t\t$.ajax({\n\t\t\turl: getUrlUvi,\n\t\t\tmethod: 'GET',\n\t\t}).then(function (response) {\n\t\t\tvar pElUvi = $('<p>').text(`UV Index: `);\n\t\t\tvar uviSpan = $('<span>').text(response.current.uvi);\n\t\t\tvar uvi = response.current.uvi;\n\t\t\tpElUvi.append(uviSpan);\n\t\t\tcardTodayBody.append(pElUvi);\n\t\t\t//set the UV index to match an exposure chart severity based on color \n\t\t\tif (uvi >= 0 && uvi <= 2) {\n\t\t\t\tuviSpan.attr('class', 'green');\n\t\t\t} else if (uvi > 2 && uvi <= 5) {\n\t\t\t\tuviSpan.attr(\"class\", \"yellow\")\n\t\t\t} else if (uvi > 5 && uvi <= 7) {\n\t\t\t\tuviSpan.attr(\"class\", \"orange\")\n\t\t\t} else if (uvi > 7 && uvi <= 10) {\n\t\t\t\tuviSpan.attr(\"class\", \"red\")\n\t\t\t} else {\n\t\t\t\tuviSpan.attr(\"class\", \"purple\")\n\t\t\t}\n\t\t});\n\t});\n\tgetFiveDayForecast();\n}", "function generateDay(itineraryID, activities) {\n\tvar itineraryID = itineraryID;\n\tvar baseUrl = \"../../php/objects/itineraryRetrieve.php\";\n\tvar ownParam = new URL(window.location.href).searchParams.get(\"own\");\n\n\t$.ajax({\n\t\turl: baseUrl,\n\t\ttype: \"POST\",\n\t\tdataType: \"json\",\n\t\tdata: { itinerary_id: itineraryID },\n\t}).done(function (responseText) {\n\t\tvar result = responseText;\n\n\t\tdocument.getElementById(\"rdBtn\" + result[0].itineraryType.charAt(0).toUpperCase() + result[0].itineraryType.slice(1)).checked = true;\n\n\t\tdocument.getElementById(\"siteHeader\").innerText = result[0].name;\n\t\tdocument.getElementById(\"itineraryTheme\").href = \"itinerary_\" + result[0].itineraryType.toLowerCase() + \".css\";\n\t\tdocument.getElementById(\n\t\t\t\"itinerary_name\"\n\t\t).innerHTML = `${result[0].name} <button id=\"btnEditTitle\" class=\"btn btn-lg p-0\" data-toggle=\"modal\" data-target=\"#editItineraryModal\"><i class=\"icon fas fa-edit pb-2\" style=\"height: 100%\"></i></button>`;\n\t\t$(\"#tbItineraryTitle\").val(result[0].name);\n\t\tdocument.getElementById(\"itinerary_date\").innerText = result[0].startDate + \" - \" + result[0].endDate;\n\n\t\tvar dateArray = getDates(new Date(result[0].startDate), new Date(result[0].endDate));\n\n\t\t/* Assign correct icons according to the itinerary type/theme */\n\t\tfor (var i = 0; i < dateArray.length; i++) {\n\t\t\tvar formattedDate = moment(dateArray[i]).format(\"DD-MM-YYYY\");\n\t\t\tvar itineraryDays = document.getElementById(\"itinerary_days\");\n\n\t\t\t//romantic: heart\n\t\t\t//family: home\n\t\t\t//nature: leaf\n\t\t\t//casual: footstep\n\n\t\t\tif (result[0].itineraryType.toLowerCase() == \"romantic\") {\n\t\t\t\titineraryDays.innerHTML += `<h5 class=\"text-center\"><a class=\"dayLink\" href=\"#${formattedDate}\"><i class=\"icon navigationIcon fas fa-heart\"></i> \n\t\t\tDay ${i + 1}</a></h5>`;\n\t\t\t} else if (result[0].itineraryType.toLowerCase() == \"family\") {\n\t\t\t\titineraryDays.innerHTML += `<h5 class=\"text-center\"><a class=\"dayLink\" href=\"#${formattedDate}\"><i class=\"icon navigationIcon fas fa-home\"></i> \n\t\t\tDay ${i + 1}</a></h5>`;\n\t\t\t} else if (result[0].itineraryType.toLowerCase() == \"nature\") {\n\t\t\t\titineraryDays.innerHTML += `<h5 class=\"text-center\"><a class=\"dayLink\" href=\"#${formattedDate}\"><i class=\"icon navigationIcon fas fa-leaf\"></i> \n\t\t\tDay ${i + 1}</a></h5>`;\n\t\t\t} else if (result[0].itineraryType.toLowerCase() == \"casual\") {\n\t\t\t\titineraryDays.innerHTML += `<h5 class=\"text-center\"><a class=\"dayLink\" href=\"#${formattedDate}\"><i class=\"icon navigationIcon fas fa-shoe-prints\"></i> \n\t\t\tDay ${i + 1}</a></h5>`;\n\t\t\t}\n\t\t}\n\n\t\tif (ownParam.toLowerCase() != \"yes\") {\n\t\t\t$(\"#btnEditTitle\").attr(\"style\", \"display:none\");\n\t\t} else {\n\t\t\t$(\"#btnEditTitle\").attr(\"style\", \"display:''\");\n\t\t}\n\n\t\tpopulateItinerary(activities, result[0].startDate, result[0].endDate);\n\t});\n}", "function setDay(date, slide, templateNum) {\n \n // Setup global variables\n var objects = slide.getShapes()\n var calNum = [13, 13, 11, 11, 9]\n const MILLS = 1000 * 60 * 60 * 24 // The number of millisecconds in a day; used for calculations\n \n // Edit numbers\n if ((new Date(date)).getTime() > 100) { // If date exists:\n for (var i = 0; i < 7; i++) { // For each number of calendar dates on template (1-7):\n slide.getShapes()[calNum[templateNum] + i].getText().setText((new Date((new Date((new Date(date)).getTime() - (new Date(date).getDay()*MILLS))).getTime() + i*MILLS)).getDate()) // Set text to day in accordance to weekday\n }\n \n slide.getShapes()[calNum[templateNum] + (new Date(date)).getDay()].getFill().setSolidFill(settingsArray[0][1]) // Fill date day with background color\n slide.getShapes()[calNum[templateNum] + (new Date(date)).getDay()].getText().getTextStyle().setForegroundColor(255, 255, 255) // Set date day text to white\n \n // Delete widget if date does not work\n } else {\n for (var i = 0; i < 8; i++) { // For each date widget number plus day labels:\n slide.getShapes()[calNum[templateNum] - 1 + i].getText().setText(\"\") // Set text to blank\n }\n }\n}", "function newYorkTimes() {\n const queryURL = \"https://api.nytimes.com/svc/topstories/v2/home.json?api-key=R1a31F4tBjCUaM2ho8GtIFsrSdtXt30M\";\n\n // Creating an AJAX call for the specific city button being clicked\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(response);\n let articleAbsOne = response.results[1].abstract;\n let articleAbsTwo = response.results[6].abstract;\n let articleAbsThree = response.results[12].abstract;\n let articleAbsFour = response.results[18].abstract;\n let articleAbsFive = response.results[24].abstract;\n let articleAbsSix = response.results[30].abstract;\n \n let articleTitleOne = response.results[1].title;\n let articleTitleTwo = response.results[6].title;\n let articleTitleThree = response.results[12].title;\n let articleTitleFour = response.results[18].title;\n let articleTitleFive = response.results[24].title;\n let articleTitleSix = response.results[30].title;\n \n let articleUrlOne = response.results[1].url;\n let articleUrlTwo = response.results[6].url;\n let articleUrlThree = response.results[12].url;\n let articleUrlFour = response.results[18].url;\n let articleUrlFive = response.results[24].url;\n let articleUrlSix = response.results[30].url;\n\n let articleTitleElOne = document.getElementById('dayOne');\n let articleTitleElTwo = document.getElementById('dayTwo');\n let articleTitleElThree = document.getElementById('dayThree');\n let articleTitleElFour = document.getElementById('dayFour');\n let articleTitleElFive = document.getElementById('dayFive');\n let articleTitleElSix = document.getElementById('daySix');\n \n let articleAbsElOne = document.getElementById('dayOneAbs');\n let articleAbsElTwo = document.getElementById('dayTwoAbs');\n let articleAbsElThree = document.getElementById('dayThreeAbs');\n let articleAbsElFour = document.getElementById('dayFourAbs');\n let articleAbsElFive = document.getElementById('dayFiveAbs');\n let articleAbsElSix = document.getElementById('daySixAbs');\n\n let articleButtonElOne = document.getElementById('dayOneButton')\n let articleButtonElTwo = document.getElementById('dayTwoButton')\n let articleButtonElThree = document.getElementById('dayThreeButton')\n let articleButtonElFour = document.getElementById('dayFourButton')\n let articleButtonElFive = document.getElementById('dayFiveButton')\n let articleButtonElSix = document.getElementById('daySixButton')\n \n\n let articleTitleArray = [articleTitleOne, articleTitleTwo, articleTitleThree, articleTitleFour, articleTitleFive, articleTitleSix]\n let articleTitleElArray = [articleTitleElOne, articleTitleElTwo, articleTitleElThree, articleTitleElFour, articleTitleElFive, articleTitleElSix]\n let articleAbsArray = [articleAbsOne, articleAbsTwo, articleAbsThree, articleAbsFour, articleAbsFive, articleAbsSix];\n let articleAbsElArray = [articleAbsElOne, articleAbsElTwo, articleAbsElThree, articleAbsElFour, articleAbsElFive, articleAbsElSix]\n let articleButtonArray = [articleButtonElOne, articleButtonElTwo, articleButtonElThree, articleButtonElFour, articleButtonElFive, articleButtonElSix]\n let articleUrlArray = [articleUrlOne, articleUrlTwo, articleUrlThree, articleUrlFour, articleUrlFive, articleUrlSix]\n\n for(let i = 0; i<articleAbsArray.length; i++){\n $(articleTitleElArray[i]).append(articleTitleArray[i]);\n $(articleAbsElArray[i]).append('\"' + articleAbsArray[i] + '\"');\n $(articleButtonArray[i]).attr('href', articleUrlArray[i]);\n }\n })}", "function saveSearch() {\n $(\"#history\").empty();\n for (let i=0;( i < searchHistory.length && i<5); i++) {\n let history = $(\"<li>\");\n history.text(searchHistory[i]);\n history.attr(\"class\", \"usercity\");\n $(\"#history\").prepend(history);\n }\n\n \n\n //onclick for usercity needs to be here due to scoping issues\n $(\".usercity\").on(\"click\", function() {\n $(\".uv\").text(\"\");\n displayCurrentWeather($(this).text());\n fiveDay($(this).text());\n })\n //grab city\n //call 5days\n //calloneday\n}", "function searchCityForecast (input) {\n // Sets Variables for Open Weather API\n var queryURL = \"https://api.openweathermap.org/data/2.5/forecast?q=\" + input + \",us\" + \"&units=imperial\" + \"&APPID=1d030b0a789179884a5605722b50f289\"\n \n // Calls Open Weather API\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(response)\n\n // Set forecast section of for each day to variables\n var dayOneBlock = response.list[2]\n var dayTwoBlock = response.list[10]\n var dayThreeBlock = response.list[18]\n var dayFourBlock = response.list[26]\n var dayFiveBlock = response.list[34]\n\n // Date to display on each forecast day\n var dateOneText = moment(dayOneBlock.dt_txt).format(\"M/D\")\n var dateTwoText = moment(dayTwoBlock.dt_txt).format(\"M/D\")\n var dateThreeText = moment(dayThreeBlock.dt_txt).format(\"M/D\")\n var dateFourText = moment(dayFourBlock.dt_txt).format(\"M/D\")\n var dateFiveText = moment(dayFiveBlock.dt_txt).format(\"M/D\")\n\n // Setting weather icon's for each forecast day to a variable\n var dayOneIcon = (`http://openweathermap.org/img/w/${dayOneBlock.weather[0].icon}.png`)\n var dayTwoIcon = (`http://openweathermap.org/img/w/${dayTwoBlock.weather[0].icon}.png`)\n var dayThreeIcon = (`http://openweathermap.org/img/w/${dayThreeBlock.weather[0].icon}.png`)\n var dayFourIcon = (`http://openweathermap.org/img/w/${dayFourBlock.weather[0].icon}.png`)\n var dayFiveIcon = (`http://openweathermap.org/img/w/${dayFiveBlock.weather[0].icon}.png`)\n\n\n\n // Day 1 forecast card info\n $('#dayOne').html(\"<h5>\" + dateOneText + \"</h5>\")\n $('#dayOne').append(`<p>${dayOneBlock.weather[0].main}<i><img src=\"${dayOneIcon}\" alt=\"Weather Icon\"></i><p>`)\n $('#dayOne').append(\"<p>Temp: \" + (dayOneBlock.main.temp).toFixed(0) + \" &deg;F</p>\")\n $('#dayOne').append(\"<p>Wind Speed: \" + dayOneBlock.wind.speed + \" mph</p>\")\n $('#dayOne').append(\"<p>Humidity: \" + dayOneBlock.main.humidity + \"%</p>\")\n\n // Day 2 forecast card info\n $('#dayTwo').html(\"<h5>\" + dateTwoText + \"</h5>\")\n $('#dayTwo').append(`<p>${dayTwoBlock.weather[0].main}<i><img src=\"${dayTwoIcon}\" alt=\"Weather Icon\"></i><p>`)\n $('#dayTwo').append(\"<p>Temp: \" + (dayTwoBlock.main.temp).toFixed(0) + \" &deg;F</p>\")\n $('#dayTwo').append(\"<p>Wind Speed: \" + dayTwoBlock.wind.speed + \" mph</p>\")\n $('#dayTwo').append(\"<p>Humidity: \" + dayTwoBlock.main.humidity + \"%</p>\")\n\n // Day 3 forecast card info\n $('#dayThree').html(\"<h5>\" + dateThreeText + \"</h5>\")\n $('#dayThree').append(`<p>${dayThreeBlock.weather[0].main}<i><img src=\"${dayThreeIcon}\" alt=\"Weather Icon\"></i><p>`)\n $('#dayThree').append(\"<p>Temp: \" + (dayThreeBlock.main.temp).toFixed(0) + \" &deg;F</p>\")\n $('#dayThree').append(\"<p>Wind Speed: \" + dayThreeBlock.wind.speed + \" mph</p>\")\n $('#dayThree').append(\"<p>Humidity: \" + dayThreeBlock.main.humidity + \"%</p>\")\n\n // Day 4 forecast card info\n $('#dayFour').html(\"<h5>\" + dateFourText + \"</h5>\")\n $('#dayFour').append(`<p>${dayFourBlock.weather[0].main}<i><img src=\"${dayFourIcon}\" alt=\"Weather Icon\"></i><p>`)\n $('#dayFour').append(\"<p>Temp: \" + (dayFourBlock.main.temp).toFixed(0) + \" &deg;F</p>\")\n $('#dayFour').append(\"<p>Wind Speed: \" + dayFourBlock.wind.speed + \" mph</p>\")\n $('#dayFour').append(\"<p>Humidity: \" + dayFourBlock.main.humidity + \"%</p>\")\n\n // Day 5 forecast card info\n $('#dayFive').html(\"<h5>\" + dateFiveText + \"</h5>\")\n $('#dayFive').append(`<p>${dayThreeBlock.weather[0].main}<i><img src=\"${dayFiveIcon}\" alt=\"Weather Icon\"></i><p>`)\n $('#dayFive').append(\"<p>Temp: \" + (dayFiveBlock.main.temp).toFixed(0) + \" &deg;F</p>\")\n $('#dayFive').append(\"<p>Wind Speed: \" + dayFiveBlock.wind.speed + \" mph</p>\")\n $('#dayFive').append(\"<p>Humidity: \" + dayFiveBlock.main.humidity + \"%</p>\")\n\n });\n\n}", "function buttonHandler(event) {\n cityName = document.querySelector(\"#name\").value;\n document.querySelector(\"#name\").value = \"\";\n\n event.preventDefault();\n\n console.log(cityName);\n weatherDash();\n}", "function displayCurrentWeather(d) {\n card.style.display = 'block';\n fiveDayBtn.style.display = 'block';\n fiveDayBtnGPS.style.display = 'none';\n fiveDayBtnGPS2.style.display = 'none';\n symbolFGPS.style.display = 'none';\n celGPS2.style.display = 'none';\n symbolF.style.display = 'block';\n symbolF.style.color = 'black';\n symbolC.style.display = 'block';\n var iconUrl = d.weather[0].icon;\n var fahrenheit = Math.round(((parseFloat(d.main.temp)-273.15)*1.8)+32); \n \n cityName.innerHTML = d.name;\n countryName.innerHTML = d.sys.country; \n temp.innerHTML = fahrenheit;\n symbol.innerHTML = `&deg;F <span style=\"color:lightgrey\">|</span>`;\n icon.innerHTML = `<img src=\"http://openweathermap.org/img/wn/${iconUrl}@2x.png\"></img>`;\n desc.innerHTML = d.weather[0].description.toUpperCase(); \n input.value = ''; \n}", "function createDay() {\n const id = GetElement(\"#current_schedule\").getAttribute(\"value\");\n const dayData = getDayFields();\n\n new Request(\"POST\", `/days?scheduleId=${id}`,\n JSON.stringify(dayData),\n getDays\n );\n}", "function createSearchHistory(city) {\n\n var historyBtn = $(\"<li>\", { \"class\": \"button\" }).text(city);\n historyBtn.click(function(event) {\n clearCurrent();\n clearFiveDay();\n getFiveDayForecastData(city);\n getCurrentWeatherData(city); \n\n historyBtn.addClass('list');\n })\n $(\"#historySearchBtn\").prepend(historyBtn);\n}", "function scheduleToday() {\n withScheduler(\n 'scheduleToday',\n (scheduler) => {\n withUniqueTag(\n scheduler,\n 'button',\n matchingAttr('data-track', 'scheduler|date_shortcut_today'),\n click,\n );\n });\n }", "function makeDays(date, day, cn) {\n var dayLabel = document.createElement('small');\n dayLabel.className = \"day-label\";\n dayLabel.textContent = dayName[day];\n \n var dayContainer = document.createElement('div');\n dayContainer.className = \"day-container\";\n dayContainer.appendChild(dayLabel);\n dayContainer.innerHTML += date;\n \n var days = document.createElement('div');\n days.className = \"day\";\n if(cn) days.className += \" \" + cn;\n if(date === initVal.dd && now.mm === initVal.mm && now.yyyy === initVal.yyyy) days.className += \" today\";\n days.appendChild(dayContainer);\n \n days.onclick = function(Event) {\n /* if you need to do something when user click on days */\n doSomethingWithDay(Event);\n }\n \n return days;\n }", "function CurrentWeather({ currentWeatherData, city, onChangeWeather }) {\n const [date] = useUpdatingFormattedDate(10000)\n const [cityText, updateCityText] = useState('')\n const handleClick = () => {\n updateCityText('')\n onChangeWeather(cityText)\n }\n\n return (\n <header className=\"current-weather-container\">\n <div>\n <p className=\"current-time-text\">{date}</p>\n {!!currentWeatherData && (\n <Fragment>\n <p className=\"min-max-text\">\n Max {Math.round(currentWeatherData.max)}º | Min{' '}\n {Math.round(currentWeatherData.min)}º\n </p>\n <h1 className=\"current-temp-text\">\n {Math.round(currentWeatherData.current)}ºF\n </h1>\n </Fragment>\n )}\n </div>\n <div className=\"city-container\">\n <h1>{capitalize(city)}</h1>\n <input type=\"text\" value={cityText} placeholder=\"Enter city\" onChange={e => updateCityText(e.target.value)} />\n <button onClick={handleClick}>Submit</button>\n </div>\n </header>\n )\n}", "function populateMe(date, days) {\n\t\n\ttodayVisible = false;\n\tvar startingSunday = new Date();\n\tif (firstofmonth==0) {\n\t\tstartingSunday=firstofmonth;\n\t\t//filldates(startingSunday);\n\t}\n\telse {\n\t\tstartingSundayTemp = date_minus_days(date, days);\n\t\tstartingSunday = new Date(startingSundayTemp);\n\t}\n\tdateDate = new Date(date);\n\tdateDateInt = new Date(date).getDate();\n\tdateYear = new Date(date).getFullYear();\n\tdateMonthInt = new Date(date).getMonth();\n\tdateMonthName = monthNames[dateMonthInt];\n\tdateDayInt = new Date(date).getDay();\n\tdateDayName = dayNames[dateDayInt];\n\t//console.log(\"date Year: \"+dateYear);\n\t//console.log(\"dateMonthInt: \"+dateMonthInt);\n\t//console.log(\"dateMonthName: \"+dateMonthName);\n\t\n\t\n\t//populate the calendar view given info\n\tdocument.getElementById(\"monthDisplay\").innerHTML = dateMonthName+\", \"+dateYear;\n\t\n\tvar sc1 = \"square-\";\n\tvar sc2 = \"-date\";\n\tvar num = new Date(startingSunday);\n\tvar numInt;\n\t//console.log(\"Num: \"+num);\n\tfor (var i=0;i<42;i++) {\n\t\tvar str = sc1+i+sc2;\n\t\tvar numTemp = new Date(num);\n\t\tnumInt = new Date(numTemp).getDate();\n\t\tdocument.getElementById(str).innerHTML = numInt;\n\t\tvar numX = String(num);\n\t\tvar numXX = numX.substring(0, numX.length - 24);\n\t\tvar todayX = String(today);\n\t\tvar todayXX = todayX.substring(0, todayX.length - 24);\n\t\t/*if ( (numInt==currentDate) && ((numXX)==(todayXX)) ){\n\t\t\t//console.log('changing color for today');\n\t\t\tcolorSelectedDate(i);\n\t\t\ttodayVisible = true;\n\t\t\t\n\t\t}*/\n\t\tnum = date_plus_days(numTemp, 1);\n\t}\n\tvar data = [currentDay, currentMonth, currentDate, currentYear];\n\tpopulateEventMe(data);\n}", "function historyDisplayWeather(){\n cityname = $(this).attr(\"data-name\");\n displayWeather();\n displayFiveDayForecast();\n console.log(cityname);\n \n}", "function searchCity(savedCity){\n \n getCurrentWeather( savedCity);\n getForecastWeather( savedCity);\n \n}", "function checkDay() {\n akanDay= calculateDay();\n checkgender();\n //console.log(\"checkDay is functioning\");\n}", "function calendarBeforeShowDay(day)\n{\n var result = true;\n var title = '';\n var day_class = 'contract-day';\n\n var timestamp = (day.getTime() - day.getTimezoneOffset()*60000)/1000;\n var role = $(this).data('role');\n\n if (rates[timestamp] === undefined) {\n result = false;\n } else {\n /**\n * rate_info structure:\n *\n * integer rate\n * integer min_stay\n * integer max_stay\n */\n var rate_info = rates[timestamp];\n\n title = translate_formatted(translate.TEXT_PROPERTY_CALENDAR_POPUP_PLACEHOLDER, [rate_info.rate, rate_info.min_stay]);\n\n if (busy_at[timestamp] !== undefined) {\n var busyness = busy_at[timestamp];\n\n switch (role) {\n case 'arrival':\n if (role == 'arrival' && busyness.arrival == false && busyness.departure == true) {\n day_class = day_class + ' departure';\n result = true;\n } else if (role == 'arrival' && busyness.arrival == true && busyness.departure == false) {\n day_class = day_class + ' arrival';\n result = false;\n } else {\n result = false;\n }\n\n break;\n\n case 'departure':\n if (role == 'departure' && busyness.arrival == true && busyness.departure == false) {\n day_class = day_class + ' arrival';\n result = true;\n } else if (role == 'departure' && busyness.arrival == false && busyness.departure == true) {\n day_class = day_class + ' departure';\n result = false;\n } else {\n result = false;\n }\n\n break;\n }\n\n if (busyness.arrival == true && busyness.departure == true) {\n day_class = day_class + ' arrival departure';\n result = false;\n }\n }\n }\n\n day_class = day_class + ' ' + (result === true ? 'available' : 'disabled');\n return [result, day_class, title];\n}", "function displayWeather(cityInput) {\n\n // Emptying previous data\n $('#daily-weather').empty();\n $('#six-days').empty();\n $('#day-1').empty();\n $('#day-2').empty();\n $('#day-3').empty();\n $('#day-4').empty();\n $('#day-5').empty();\n $('#day-6').empty();\n\n // Api call weather / cityInput / units / my api key / currentDay variable\n let currentDay = 'https://api.openweathermap.org/data/2.5/weather?q='\n + cityInput + '&units=imperial' + '&appid=f1a16cad1c18080e4ffd997bda8b2d9d';\n \n // Ajax url call - then - function / 1-day forecast\n $.ajax({\n url: currentDay,\n method: 'GET',\n }).then(function(weatherResponse) {\n \n // Current day variable / moment / date format\n let currentDate = moment().format('M/DD/YYYY');\n\n // Weather icon variable / from api weather url\n let weatherIcon = 'http://openweathermap.org/img/w/' \n + weatherResponse.weather[0].icon + '.png';\n\n // Appending daily weather details to HTML / icon, temperature, humidity, and wind speed\n $('#daily-weather').append(\n \"<div class='col s12 m6'>\" \n + \"<h2 class='daily'>\" + weatherResponse.name + \" ( \" + currentDate + \" )\" + \"&nbsp\" \n + \"<img src='\" + weatherIcon + \"'>\" + \"</h2>\"\n + \"<ul class='daily'>\" + \"Temperature: \" + weatherResponse.main.temp + \" °F\" + \"</ul>\" \n + \"<ul class='daily'>\" + \"Humidity: \" + weatherResponse.main.humidity + \" %\" + \"</ul>\" \n + \"<ul class='daily'>\" + \"Wind Speed: \" + weatherResponse.wind.speed +\" mph\" + \"</ul>\" \n + \"</div>\"\n );\n\n // Variable - coordinate latitude\n let coordinateLat = weatherResponse.coord.lat;\n // Variable - coordinate longitude\n let coordinateLon = weatherResponse.coord.lon;\n \n // Api call weather / lat&lon / units / my api key / fiveDays variable\n let fiveDays = 'https://api.openweathermap.org/data/2.5/onecall?' \n + 'lat=' + coordinateLat + '&lon=' + coordinateLon + '&units=imperial' \n + '&appid=f1a16cad1c18080e4ffd997bda8b2d9d';\n\n // Ajax url call - then - function / 5-day forecast / UV Index button\n $.ajax({\n url: fiveDays,\n method: 'GET',\n }).then(function(weatherResponse) {\n // Appending UV Index inside button to HTML daily weather details\n $('#daily-weather').append(\n \"<div class='col s12 m6'>\" \n + \"<button class='uvi-btn' id='uvIndex' class='daily'>\" + \"UV Index: \" \n + weatherResponse.current.uvi + \"</button>\"\n + \"</div>\"\n );\n\n // Conditionals for UV Index button colors\n if (weatherResponse.current.uvi <= 2.99) {\n $('#uvIndex').addClass('low');\n }\n else if (weatherResponse.current.uvi <= 5.99) {\n $('#uvIndex').addClass('moderate');\n }\n else if (weatherResponse.current.uvi <= 7.99) {\n $('#uvIndex').addClass('high');\n }\n else if (weatherResponse.current.uvi <= 10.99) {\n $('#uvIndex').addClass('very-high');\n }\n else if (weatherResponse.current.uvi > 11) {\n $('#uvIndex').addClass('extreme');\n };\n\n // 5-day forecast variables / moment / add / date format\n let dayOne = moment().add(1, 'days').format('M/DD/YYYY');\n let dayTwo = moment().add(2, 'days').format('M/DD/YYYY');\n let dayThree = moment().add(3, 'days').format('M/DD/YYYY');\n let dayFour = moment().add(4, 'days').format('M/DD/YYYY');\n let dayFive = moment().add(5, 'days').format('M/DD/YYYY');\n let daySix = moment().add(6, 'days').format('M/DD/YYYY');\n\n // 5-day weather icon variables / from api weather url\n let weatherIcon1 = 'http://openweathermap.org/img/w/' \n + weatherResponse.daily[0].weather[0].icon + '.png';\n let weatherIcon2 = 'http://openweathermap.org/img/w/' \n + weatherResponse.daily[1].weather[0].icon + '.png';\n let weatherIcon3 = 'http://openweathermap.org/img/w/' \n + weatherResponse.daily[2].weather[0].icon + '.png';\n let weatherIcon4 = 'http://openweathermap.org/img/w/' \n + weatherResponse.daily[3].weather[0].icon + '.png';\n let weatherIcon5 = 'http://openweathermap.org/img/w/' \n + weatherResponse.daily[4].weather[0].icon + '.png';\n let weatherIcon6 = 'http://openweathermap.org/img/w/' \n + weatherResponse.daily[5].weather[0].icon + '.png';\n\n // Appending 5-day weather to HTML / icon, temperature, and humidity\n // 5-Days Forecast Header\n $('#six-days').append(\n \"<div class='col-md-12'>\" + \"<h2>\" + \"6-Day Forecast:\" + \"</h2>\"\n );\n\n // Appending day one weather card\n $('#day-1').append(\n \"<div class='card col-s12-m6'>\" \n + \"<div class='card-body'>\" \n + \"<div class='card-header'>\" + dayOne + \"</div\" \n + \"<div class='card-info'>\" + \"<img src='\" + weatherIcon1 + \"'>\" + \"</div>\" \n + \"<div class='card-info'>\" + \"Temp: \" \n + weatherResponse.daily[0].temp.day + \" °F\" + \"</div>\" \n + \"<div class='card-info'>\" + \"Humidity: \" \n + weatherResponse.daily[0].humidity + \" %\" + \"</div>\" \n + \"</div>\"\n );\n\n // Appending day two weather card\n $('#day-2').append(\n \"<div class='card col-s12-m6'>\" \n + \"<div class='card-body'>\" \n + \"<div class='card-header'>\" + dayTwo + \"</div\" \n + \"<div class='card-info'>\" + \"<img src='\" + weatherIcon2 + \"'>\" + \"</div>\" \n + \"<div class='card-info'>\" + \"Temp: \" \n + weatherResponse.daily[0].temp.day + \" °F\" + \"</div>\" \n + \"<div class='card-info'>\" + \"Humidity: \" \n + weatherResponse.daily[0].humidity + \" %\" + \"</div>\" \n + \"</div>\"\n );\n\n // Appending day three weather card\n $('#day-3').append(\n \"<div class='card col-s12-m6'>\" \n + \"<div class='card-body'>\" \n + \"<div class='card-header'>\" + dayThree + \"</div\" \n + \"<div class='card-info'>\" + \"<img src='\" + weatherIcon3 + \"'>\" + \"</div>\" \n + \"<div class='card-info'>\" + \"Temp: \" \n + weatherResponse.daily[0].temp.day + \" °F\" + \"</div>\" \n + \"<div class='card-info'>\" + \"Humidity: \" \n + weatherResponse.daily[0].humidity + \" %\" + \"</div>\" \n + \"</div>\"\n );\n\n // Appending day four weather card\n $('#day-4').append(\n \"<div class='card col-s12-m6'>\" \n + \"<div class='card-body'>\" \n + \"<div class='card-header'>\" + dayFour + \"</div\" \n + \"<div class='card-info'>\" + \"<img src='\" + weatherIcon4 + \"'>\" + \"</div>\" \n + \"<div class='card-info'>\" + \"Temp: \" \n + weatherResponse.daily[0].temp.day + \" °F\" + \"</div>\" \n + \"<div class='card-info'>\" + \"Humidity: \" \n + weatherResponse.daily[0].humidity + \" %\" + \"</div>\" \n + \"</div>\"\n );\n \n // Appending day five weather card\n $('#day-5').append(\n \"<div class='card col-s12-m6'>\" \n + \"<div class='card-body'>\" \n + \"<div class='card-header'>\" + dayFive + \"</div\" \n + \"<div class='card-info'>\" + \"<img src='\" + weatherIcon5 + \"'>\" + \"</div>\" \n + \"<div class='card-info'>\" + \"Temp: \" \n + weatherResponse.daily[0].temp.day + \" °F\" + \"</div>\" \n + \"<div class='card-info'>\" + \"Humidity: \" \n + weatherResponse.daily[0].humidity + \" %\" + \"</div>\" \n + \"</div>\"\n );\n\n // Appending day six weather card\n $('#day-6').append(\n \"<div class='card col-s12-m6'>\" \n + \"<div class='card-body'>\" \n + \"<div class='card-header'>\" + daySix + \"</div\" \n + \"<div class='card-info'>\" + \"<img src='\" + weatherIcon6 + \"'>\" + \"</div>\" \n + \"<div class='card-info'>\" + \"Temp: \" \n + weatherResponse.daily[0].temp.day + \" °F\" + \"</div>\" \n + \"<div class='card-info'>\" + \"Humidity: \" \n + weatherResponse.daily[0].humidity + \" %\" + \"</div>\" \n + \"</div>\"\n );\n // Calling in function\n displayCities ();\n });\n });\n }", "function dailyWeather(location) {\n // current weather API (imperial changes output of temp to farenheit - tutor helped with this info)\n var weatherURL = `https://api.openweathermap.org/data/2.5/weather?q=${location}&appid=${APIKey}&units=imperial`;\n\n // Date using moment.js\n var currentDate = moment().format(\"l\");\n\n // Create a function that gets the current weather (Current Weather Data Call)\n $.get(weatherURL).then(function (response) {\n\n // Create current weather icon element \n var weatherIcon = response.weather[0].icon;\n var srcIcon = `https://openweathermap.org/img/wn/${weatherIcon}.png`;\n\n // Transfer content to HTML\n\n // Displays name of city searched and current date\n $(\".city\").html(\"<h3>\" + response.name + \" (\" + currentDate + \") \");\n\n // Displays image for current weather\n var image = $(\"<img>\").prop({ src: srcIcon });\n $(\".city\").append(image);\n\n // Displays current wind speed\n var currentWindSpeed = Math.round(response.wind.speed);\n $(\".wind\").text(\"Wind Speed: \" + currentWindSpeed + \" MPH\");\n\n //displays current humidity\n $(\".humidity\").text(\"Humidity: \" + response.main.humidity + \"%\");\n\n // Displays current temerature\n var currentTemp = Math.round(response.main.temp);\n $(\".temp\").text(\"Temperature: \" + currentTemp + \" F°\");\n\n\n // UV index API\n var uvIndexURL = `https://api.openweathermap.org/data/2.5/onecall?lat=${response.coord.lat}&lon=${response.coord.lon}&\n exclude=hourly,daily&appid=${APIKey}`;\n\n $.get(uvIndexURL).then(function (response) {\n\n // Create UV index element\n var currentUV = response.current.uvi;\n var uvIndexOuter = $(\"<p>\").text(\"UV Index: \");\n var uvIndexInner = $(\"<span>\").addClass(\"uvBox\").text(currentUV);\n\n uvIndexInner.appendTo(uvIndexOuter);\n\n // Used weewx github for help with building uv index if statement below\n\n // If statement changing color of UV box based on the current UV index per https://www.epa.gov/sunsafety/uv-index-scale-0 color codes\n if (currentUV >= 0 && currentUV <= 2.99) {\n uvIndexInner.css(\"background-color\", \"green\").text(currentUV);\n }\n if (currentUV >= 3 && currentUV <= 5.99) {\n uvIndexInner.css(\"background-color\", \"yellow\").text(currentUV);\n }\n if (currentUV >= 6 && currentUV <= 7.99) {\n uvIndexInner.css(\"background-color\", \"orange\").text(currentUV);\n }\n if (currentUV >= 8 && currentUV <= 10.99) {\n uvIndexInner.css(\"background-color\", \"red\").text(currentUV);\n }\n if (currentUV >= 11) {\n uvIndexInner.css(\"background-color\", \"violet\").text(currentUV);\n }\n\n // Append UV index to #currentCity ID\n $(\".uvi\").html(uvIndexOuter);\n });\n });\n }", "function goToToday(){\r\n\tvar tempDate = new Date;\r\n\tintYear = tempDate.getFullYear();\r\n\tlistReminders();\r\n\tinitialise();\n\r\n}", "function newSearch(){\n //Initializing relevant variables and all the different URLs for different Ajax calls\n let city;\n //Checking to make sure that there's no repeated entry\n for (k=0; k<cityCount.length;k++){\n if(search.val().toLowerCase() === cityCount[k]){\n search.val('');\n return;\n }\n }\n let newCityBtn = $(\"<li class='btn btn-outline-secondary text-left list-group-item' id='button' data-history='\" + count + \"'>\");\n //This conditional statement handles whether the click event comes from a new search term or just an older historic button\n if (search.val() !== \"\"){\n city = search.val();\n newCityBtn.text(city);\n cityCount = cityCount.concat(search.val().toLowerCase());\n count++;\n } else {\n city = $(this).text();\n }\n //URLs for 2 of my ajax requests\n let queryURL= \"https://api.openweathermap.org/data/2.5/weather?q=\" + city + \"&appid=f3e794b6f19299364c3a368c93f4e895\";\n let forecastURL = \"https://api.openweathermap.org/data/2.5/forecast?q=\" + city + \"&appid=f3e794b6f19299364c3a368c93f4e895\";\n $.ajax({\n url: queryURL,\n method: \"GET\",\n }).then(function(response){\n //Main display\n if (search.val() !== \"\"){\n btnHistory.append(newCityBtn);\n }\n search.val('');\n cityName.text(response.name + \" \" + currentTime);\n //Conversion from Kelvin\n let conversion = (response.main.temp - 273.15)*9/5 + 32;\n cityTemp.text(Math.floor(conversion) + \"°F\");\n cityHum.text(response.main.humidity + \"%\");\n cityWind.text(response.wind.speed);\n let latitude = response.coord.lat;\n let longitude = response.coord.lon;\n let uvURL = \"https://api.openweathermap.org/data/2.5/uvi?appid=f3e794b6f19299364c3a368c93f4e895&lat=\" + latitude + \"&lon=\"+ longitude;\n //Making an ajax request for the UV index\n $.ajax({\n url: uvURL,\n method: \"GET\",\n }).then(function(res){\n cityUV.text(res.value);\n if (res.value <= 4){\n cityUV.attr(\"class\", \"bg-success rounded\");\n }else if (4<res.value && res.value<=7){\n cityUV.attr(\"class\", \"bg-warning rounded\");\n }else if (7<res.value){\n cityUV.attr(\"class\", \"bg-danger rounded\");\n }\n });\n }).catch(function(err){\n // cityCount.splice(count, 1);\n // count--;\n search.val('');\n alert(\"Something went wrong!\");\n });\n //Above this line exists an exception for errors caught\n //Emptying the Deck for next iteration\n cardDeck.empty();\n $.ajax({\n url: forecastURL,\n method: \"GET\"\n }).then(function(forecast){\n for (i=0; i<5;i++){\n let j=(i*7) + i;\n //Calling all variables foor the dynamically generated 5 day Forecast Cards\n let newCityCard = $(\"<div class = 'card text-white bg-primary' style = 'max-width: 18rem;'>\");\n let newCardBody = $(\"<div class = 'card-body'>\");\n let cardDate = $(\"<h5 class = 'card-title'>\");\n let cardIcon;\n let cardIconCloudSun = $(\"<p class = 'card-text text-center'><i class='fas fa-cloud-sun'>\");\n let cardIconSun = $(\"<p class='card-text text-center'><i class='fas fa-sun'>\");\n let cardIconRain = $(\"<p class='card-text text-center'><i class='fas fa-cloud-showers-heavy'>\");\n let cardIconCloud = $(\"<p class='card-text text-center'><i class='fas fa-cloud'>\");\n let cardIconCloudSunRain = $(\"<p class='card-text text-center'><i class='fas fa-cloud-sun-rain'>\");\n let cardIconSnow = $(\"<p class='card-text text-center'><i class='fas fa-snowflake'>\");\n let classifier = forecast.list[j].weather[0].main;\n let cardTemp = $(\"<p class = 'card-text'>\");\n let cardHum = $(\"<p class = 'card-text'>\");\n //Modifying all variables with the information from the ajax request\n cardDate.text(forecast.list[j].dt_txt);\n //statements that determine the icon used\n if (classifier === \"Clear\"){\n cardIcon = cardIconSun;\n } else if (classifier === \"Atmosphere\"){\n cardIcon = cardIconCloudSun;\n } else if (classifier === \"Clouds\"){\n cardIcon = cardIconCloud;\n } else if (classifier === \"Rain\" || classifier === \"Thunderstorm\"){\n cardIcon = cardIconRain;\n } else if (classifier === \"Snow\"){\n cardIcon = cardIconSnow;\n } else {\n cardIcon = cardIconCloudSunRain;\n }\n //conversion from Kelvin\n let toF = (forecast.list[j].main.temp - 273.15)*9/5 +32;\n cardTemp.text(\"Temp: \" + Math.floor(toF) + \" °F\");\n cardHum.text(\"Humidity: \" + forecast.list[j].main.humidity + \"%\");\n // Appending everything to its appropriate location\n newCardBody.append(cardDate);\n newCardBody.append(cardIcon);\n newCardBody.append(cardTemp);\n newCardBody.append(cardHum);\n newCityCard.append(newCardBody);\n cardDeck.append(newCityCard)\n }\n });\n}", "function Day(props) {\n\n // handles click events\n const handleClick = (e) => {\n e.preventDefault();\n\n props.selectDate()\n\n \n }\n\n // Since all Day elements are to be displayed\n // as grid items, ensure that elements are placed\n // in the appropriate grid cells\n\n let defaultStyle = `date-picker-day ${props.dayOfTheWeek}`;\n \n \n return (\n <button className={defaultStyle} \n disabled={props.isDisabled}\n onClick={handleClick}>\n {props.value}\n </button>\n )\n}", "buildCurrentWeather() {\n const targetElement = document.querySelector('#current-weather');\n const cond = this.currentConditions;\n const formattedDate = dayjs(cond.date).format('DD/MM/YYYY');\n const dayName = dayjs(cond.date).format('dddd');\n const iconLocation = `https://openweathermap.org/img/wn/${cond.icon}@2x.png`;\n // if current weather is populated --> clear first.\n if (targetElement.innerHTML) targetElement.innerHTML = '';\n const newDiv = document.createElement('div');\n newDiv.classList.add('card');\n newDiv.innerHTML = `\n <div class=\"card-content p-3\">\n <h2 class=\"title is-1\">${this.cityOutput}, ${this.cityCountry}</h2>\n\n <div class=\"media mb-2\">\n <div class=\"media-left\">\n <figure class=\"image is-96x96\">\n <img src=${iconLocation} alt=\"weather-icon\">\n </figure>\n </div>\n <div class=\"media-content\">\n <p class=\"title is-5\">${formattedDate}</p>\n <p class=\"subtitle is-5 mb-1\">${dayName}</p>\n <p class=\"subtitle is-5\"><b>${cond.description}</b> </p>\n </div>\n </div>\n <div class=\"content\">\n <p class=\"is-size-1 mb-2\"><b>${cond.currentTemp} °C</b> </p>\n <p class=\"is-6 mb-0\">Todays Min: <b>${cond.minTemp} °C </b></p>\n <p class=\"is-6 mb-0\">Todays Max: <b>${cond.maxTemp} °C</b></p>\n <p class=\"is-6 mb-0\">Current Wind: <b>${(\n cond.windSpeed * 3.6\n ).toFixed(2)} km/h</b> </p>\n <p class=\"is-6 mb-0\">Current Humidity: <b>${\n cond.humidity\n } %</b> </p>\n <p class=\"is-6 mb-0\">Current UV Index: <b id=\"uv-index\"></b> </p>\n </div>\n </div>\n `;\n targetElement.append(newDiv);\n this.uvBuilder();\n }", "function GetDag()\n{\n\t//vraag datum en van de datum de dag op.\n\tvar datum = new Date();\n var dag = datum.getDay();\n\t\n\t//dag word getoond als 1 tot en met 7 == maandag tot en met zondag\n\tswitch(dag) {\n\t\tcase 1:\n\t\t\tdocument.getElementById(\"dagVandaag\").innerHTML = \"Maandag: Gesloten\";\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tdocument.getElementById(\"dagVandaag\").innerHTML = \"Dinsdag: 09:00 tot 18:00\";\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tdocument.getElementById(\"dagVandaag\").innerHTML = \"Woensdag: 09:00 tot 18:00\";\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tdocument.getElementById(\"dagVandaag\").innerHTML = \"Donderdag: 09:00 tot 18:00\";\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\tdocument.getElementById(\"dagVandaag\").innerHTML = \"Vrijdag: 09:00 tot 21:00\";\n\t\t\tbreak;\n\t\tcase 6:\n\t\t\tdocument.getElementById(\"dagVandaag\").innerHTML = \"Zaterdag: 09:00 tot 21:00\";\n\t\t\tbreak;\n\t\tcase 0:\n\t\t\tdocument.getElementById(\"dagVandaag\").innerHTML = \"Zondag: Gesloten\";\n\t\t\tbreak;\n\t}\n\t\n\t\n}", "function WeatherApi (userCity) {\n console.log(userCity)\n\n // URL we need to get the current weather information\n var queryURL = \"https://api.openweathermap.org/data/2.5/forecast?q=\" + userCity + \"&appid=\" + APIKey;\n console.log(queryURL);\n\n //Checking to make sure that dayjs is properly set up\nconsole.log(dayjs());\n\n // AJAX call to the OpenWeatherMap API\n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n // Store all of the data from the API inside of an object called \"response\"\n .then(function(response) {\n console.log (\"the response\" + response);\n\n\n //Adding weather icons\n //Need variables for each day \n //create URLs to get icons from Openweather API\n var CurrentDay = \"http://openweathermap.org/img/wn/\"+response.list[0].weather[0].icon+\"@2x.png\";\n var DayOne = \"http://openweathermap.org/img/wn/\"+response.list[6].weather[0].icon+\"@2x.png\";\n var DayTwo = \"http://openweathermap.org/img/wn/\"+response.list[14].weather[0].icon+\"@2x.png\";\n var DayThree = \"http://openweathermap.org/img/wn/\"+response.list[22].weather[0].icon+\"@2x.png\";\n var DayFour = \"http://openweathermap.org/img/wn/\"+response.list[30].weather[0].icon+\"@2x.png\";\n var DayFive = \"http://openweathermap.org/img/wn/\"+response.list[38].weather[0].icon+\"@2x.png\";\n \n\n //Store the weather icons in variables below, need one variable for each day.\n //Add self closing tags at the end of each\n var IconMain = $('<img src=\" '+ CurrentDay +' \"/>');\n var IconFirst = $('<img src=\" '+ DayOne +' \"/>');\n var IconSecond = $('<img src=\" '+ DayTwo +' \"/>');\n var IconThird = $('<img src=\" '+ DayThree +' \"/>');\n var IconFourth = $('<img src=\" '+ DayFour +' \"/>');\n var IconFifth = $('<img src=\" '+ DayFive +' \"/>');\n\n //Current weather\n //Data for adding to the html \n $(\"#MainCity\").text(response.city.name + \" (\" + response.list[0].dt_txt.substr(0, 10) + \")\").append(IconMain);\n // \"Using substr(0, 10)\" to only retrieve a date and not time from the WeatherAPI)\n \n //Make sure that the tempurature displays in farenheight \n $(\"#Temp\").text(\"Temperature: \" + ((response.list[6].main.temp- 273.15) * 1.80 + 32).toFixed(2) + \" F\");\n $(\"#Humidity\").text(\"Humidity: \" + response.list[6].main.humidity + \" %\");\n $(\"#Wind\").text(\"Wind Speed: \" + response.list[6].wind.speed + \" mph\");\n \n //For the UVI index, create a variable that store the coordinates. \n //Use them with the UVindexAPI to retrieve on currentWeather class HTML.\n var latitude = response.city.coord.lat;\n var longitude = response.city.coord.lon;\n\n //Transfer the local variables to weatherUVI()\n WeatherUVI(latitude, longitude)\n\n //First day current weather.\n // Trying to reformat the date displays\n // console.log(new Date().toLocaleDateString())\n \n var today= new Date()\n\n\n \n \n //response.list[6].dt_txt.substr(0, 10)\n $(\"#Date1\").text(new Date().toLocaleDateString());\n $(\"#icon1\").empty().append(IconFirst);\n $(\"#Temp1\").text(\"Temp: \" + ((response.list[6].main.temp - 273.15) * 1.80 + 32).toFixed(2) + \" F\");\n $(\"#Humidity1\").text(\"Humidity: \" + response.list[6].main.humidity + \" %\");\n\n //Second day forecast\n $(\"#date2\").text(dayjs().add(2, 'days').format(\"MMM Do YY\"));\n $(\"#icon2\").empty().append(IconSecond);\n $(\"#Temp2\").text(\"Temp: \" + ((response.list[14].main.temp - 273.15) * 1.80 + 32).toFixed(2) + \" F\");\n $(\"#Humidity2\").text(\"Humidity: \" + response.list[14].main.humidity + \" %\");\n\n //3rd day forecast\n $(\"#date3\").text(dayjs().add(3, 'days').format(\"MMM Do YY\")); $(\"#icon3\").empty().append(IconThird);\n $(\"#Temp3\").text(\"Temp: \" + ((response.list[22].main.temp - 273.15) * 1.80 + 32).toFixed(2) + \" F\");\n $(\"#Humidity3\").text(\"Humidity: \" + response.list[22].main.humidity + \" %\");\n\n //4th day forecast\n $(\"#date4\").text(dayjs().add(4, 'days').format(\"MMM Do YY\"));\n $(\"#icon4\").empty().append(IconFourth);\n $(\"#Temp4\").text(\"Temp: \" + ((response.list[30].main.temp - 273.15) * 1.80 + 32).toFixed(2) + \" F\");\n $(\"#Humidity4\").text(\"Humidity: \" + response.list[30].main.humidity + \" %\");\n\n //5th day forecast \n $(\"#date5\").text(dayjs().add(5, 'days').format(\"MMM Do YY\"));\n $(\"#icon5\").empty().append(IconFifth);\n $(\"#Temp5\").text(\"Temp: \" + ((response.list[38].main.temp - 273.15) * 1.80 + 32).toFixed(2) + \" F\");\n $(\"#Humidity5\").text(\"Humidity: \" + response.list[38].main.humidity + \" %\");\n \n });\n }", "function generateDay(day, date)\n{\n\tvar isShaded = (date.getMonth() % 2);//Every other month will be shaded a different color to help differentiate the months\n\tvar isToday = (date.getDate() == todaysDate.getDate() && date.getMonth() == todaysDate.getMonth() && date.getFullYear() == todaysDate.getFullYear());\n\n\tif(isShaded) day.className += ' shaded';\n\tif(isToday) day.className += ' today';\n\n\tday.id = idForDate(date);\n\tday.innerHTML = '<span>' + date.getDate() + '</span>';\n\n\tsearchItemsForPID(day.id, function(items)\n\t{\n\t\tfor(var i in items)\n\t\t{\n\t\t\tvar item = loadEvent(day.id, items[i].itemId);\n\t\t\titem.value = items[i].itemValue;\n\t\t\tadjustHeight(item.id);\n\t\t}\n\t});\n}", "function goalsForTheDay(selectedDay){\r\n\r\n for(i = 0; i < mondayGoals.length; i++){\r\n if(selectedDay === 'monday'){\r\n createCheckBox(mondayGoals[i]);\r\n } else if(selectedDay === 'tuesday'){\r\n createCheckBox(tuesdayGoals[i]);\r\n }\r\n//Activity 13.1 - Complete the function by adding in the rest of days of the week.\r\n//You can use the above else if statement as an example.\r\n \r\n\r\n }\r\n }", "function fillCityWeather(response) {\n cityName.textContent = response.name + ' ' + response.sys.country;\n let tempWeatherTime = new Date(response.dt * 1000)\n let dateString;\n dateString = tempWeatherTime.getDate() + \"/\";\n dateString += (tempWeatherTime.getMonth() + 1) + \"/\";\n dateString += tempWeatherTime.getFullYear() + \" \";\n dateString += tempWeatherTime.getHours() + \":\";\n let tempMinute = tempWeatherTime.getMinutes()\n if (tempMinute < 10) {\n tempMinute = \"0\" + tempMinute;\n }\n dateString += tempMinute;\n weatherDate.textContent = dateString;\n\n temperature.innerHTML = `${(response.main.temp - 273.15).toFixed(1)}&deg; C`;\n iconWeather.setAttribute('src', `https://openweathermap.org/img/wn/${response.weather[0].icon}@2x.png`);\n let sunr = new Date(response.sys.sunrise * 1000)\n let suns = new Date(response.sys.sunset * 1000)\n humidity.innerHTML = 'Humidity: ' + response.main.humidity + '&#37;';\n wind.textContent = 'Wind: ' + response.wind.speed + ' m/s';\n sunrise.textContent = 'Sunrise: ' + sunr.getHours() + ':' + sunr.getMinutes() + ':' + sunr.getSeconds();\n sunset.textContent = 'Sunset: ' + suns.getHours() + ':' + suns.getMinutes() + ':' + suns.getSeconds();\n}", "organizerButtonsHandler(dayData, nameDayInfo) {\n // console.log(dayData,nameDayInfo )\n //Local Vars\n //// console.log('0 - Function Entry')\n var dayClicked = this.state.dayInfo;\n //console.log(dayClicked)\n var dayFormContent = document.getElementById('day-form-value')\n ? document.getElementById('day-form-value').name\n : '';\n var day = dayData.split('-')[0];\n var month = dayData.split('-')[1];\n var entryDayInfo = nameDayInfo.day ? nameDayInfo : JSON.parse(nameDayInfo);\n var eventTargetInput = document.getElementById(\n event.composedPath()[0].innerText\n );\n var dayInfo = {\n day: `${day}-${month}`,\n instance: entryDayInfo.instance,\n lastInstance: entryDayInfo.lastInstance,\n winnersNeed: entryDayInfo.winnersNeed,\n tStart: entryDayInfo.tStart,\n winnersIDs: entryDayInfo.winnersIDs,\n nextInstance: entryDayInfo.nextInstance,\n prevInstance: entryDayInfo.prevInstance,\n };\n\n function isUpdating() {\n if (dayFormContent === '') {\n } else {\n var formDayInfo =\n dayFormContent === '' ? '' : JSON.parse(dayFormContent);\n var oldTStart = formDayInfo.tStart;\n var oldGMax =\n formDayInfo.winnersNeed == 0\n ? formDayInfo.winnersNeed\n : parseInt(formDayInfo.winnersNeed);\n var oldInstanceSelect = formDayInfo.instance;\n var actualTStart = document.getElementById('panelForm-tStart-input')\n .value;\n var actualGmax =\n document.getElementById('day-gMax').value == 0\n ? document.getElementById('day-gMax').value\n : parseInt(document.getElementById('day-gMax').value);\n var actualInstanceSelect = document.getElementById(\n 'day-instance-div-select'\n ).value;\n //// console.log(dayFormContent, 'raw objet')\n //// console.log(formDayInfo, '<-------- formDayInfo' )\n //// console.log(oldInstanceSelect, '<-------- Old Instance Select /// Actual Instance Select -------->', actualInstanceSelect)\n //// console.log(oldGMax, '<-------- OLD GMAX /// ACTUAL GMAX ------->', actualGmax)\n //// console.log(oldTStart, '<------------ OLD TSTART /// ACTUAL TSTART --------->', actualTStart)\n }\n\n if (oldInstanceSelect == actualInstanceSelect) {\n return true;\n } else {\n if (actualTStart === oldTStart && actualGmax === oldGMax) {\n return false;\n }\n }\n }\n if (isUpdating()) {\n function defaultButtonClassAssign(setNewButton) {\n var wasClicked = document.getElementsByClassName('itsClicked')[0];\n var dayValue = event.composedPath()[0].value;\n wasClicked\n ? wasClicked.setAttribute(\n 'class',\n `panel-button ${dayClicked.instance}`\n )\n : '';\n if (dayValue.instance != 'none') {\n event.composedPath()[0].class = `panel-button ${dayValue.instance}-userClicked itsClicked`;\n } else {\n event.composedPath()[0].class = `panel-button userClicked itsClicked `;\n }\n setNewButton();\n }\n TournamentPanel.prototype.selectInit();\n var newButtonClicked = () => {\n this.setState({\n buttonClicked: dayData,\n dayInfo: dayInfo,\n });\n };\n defaultButtonClassAssign(newButtonClicked);\n } else {\n var nameDayObj = entryDayInfo;\n var autoSave = {\n invoked: 'autoSave',\n dayData: dayData,\n nameDayObj: nameDayObj,\n eventTarget: eventTargetInput,\n confirmed: '',\n };\n confirm('¿Desea guardar los cambios del dia?')\n ? (autoSave.confirmed = true)\n : (autoSave.confirmed = false);\n TournamentPanel.prototype.saveSingleInstance(autoSave);\n }\n }", "function createPanel(days) {\n\n $('#weatherpanels').html('');\n var j;\n var indices=[0,24,48,64,72,80,86,90];\n var yesterday=0;\n\n //---Create our Legend for City Selected -----------------------\n var legend= document.createElement('legend');\n var cityName=getCitySelection()[1];\n \n var cityNode = document.createTextNode('Your ' + days + '-day forecast for ' + cityName + ':');\n legend.appendChild(cityNode);\n $('#weatherpanels').prepend(legend);\n //---------------------------------------------------------------\n\n for (var i=0; i<days;i++)\n {\n j=indices[i];\n\n //--Safeguard to make sure we are iterating thru days correctly--------\n var dateArray=(results[0].forecast[j].ftime).split(' ');\n var dateText=dateArray[0];\n dateText=dateText.slice(5);\n var month=dateText.slice(0,2);\n var day=dateText.slice(3);\n dateText= day + '/' + month;\n\n while (dateText === yesterday)\n {\n j=j+1;\n dateArray=(results[0].forecast[j].ftime).split(' ');\n dateText=dateArray[0];\n dateText=dateText.slice(5);\n month=dateText.slice(0,2);\n day=dateText.slice(3);\n dateText= day + '/' + month;\n }\n if (i===0){dateText='Today';}\n if (i===1){dateText='Tomorrow';}\n //------------------------------------------------------------------\n\n\n //-----Access to checkboxes...what does User want to see? -----------\n var tempRequested =document.getElementById('tempCheckBox');\n var cloudRequested = document.getElementById('cloudCheckBox');\n var windRequested = document.getElementById('windCheckBox');\n var precipRequested = document.getElementById('precipCheckBox');\n //------------------------------------------------------------------\n\n\n //----Initialize the new HTML elements--------------------------------\n var panel = document.createElement( 'div' );\n $(panel).addClass('panel panel-info col-md-2');\n var heading=document.createElement('div');\n $(heading).addClass('panel-heading');\n var title=document.createElement('h3');\n $(title).addClass('panel-title');\n var body=document.createElement('div');\n $(body).addClass('panel-body');\n //------------------------------------------------------------------\n\n\n //------Create our text/data variables-----------------------------------\n var date = document.createTextNode(dateText);\n var cloudText = results[0].forecast[j].N;\n var tempText = results[0].forecast[j].T;\n var windText = results[0].forecast[j].F;\n var precipText = results[0].forecast[j].R;\n var htmlBreak1 =document.createElement('br');\n var htmlBreak2 =document.createElement('br');\n var htmlBreak3 =document.createElement('br');\n var htmlBreak4 =document.createElement('br');\n var cloudNode = document.createTextNode('Cloud: ' + cloudText +'%');\n var tempNode = document.createTextNode('Temp: ' + tempText + '°' + ' C');\n var windNode = document.createTextNode('Wind Speed: ' + windText + ' m/s');\n var precipNode = document.createTextNode('Prec: ' + precipText + ' mm/h');\n //------------------------------------------------------------------\n\n\n //--Create our image variables-----------------------------------\n var cloudImageElement = document.createElement('img');\n cloudImageElement.src = pickCloudImage(cloudText);\n var tempImageElement = document.createElement('img');\n tempImageElement.src = pickTempImage(tempText);\n var precipImageElement = document.createElement('img');\n //------------------------------------------------------------------\n\n\n //-Build our basic daily Weather panel--------------------------\n title.appendChild(date);\n heading.appendChild(title);\n panel.appendChild(heading);\n panel.appendChild(body);\n //------------------------------------------------------------------\n\n\n //--Set the color of the panel----------------------\n var panelColor = chooseTempColor(tempText);\n panel.style.border = '2px solid ' + panelColor;\n panel.style.border = '1px solid ' + panelColor;\n heading.style.background = panelColor;\n //------------------------------------------------------------------\n\n //--If User wants to see Temperature-------------------------------\n if (tempRequested.checked){\n body.appendChild(tempNode);\n body.appendChild(htmlBreak1);\n panel.appendChild(tempImageElement);}\n //-------------------------------------------------------\n\n\n //--Add our optional image (for frost)---------------\n if (tempText<=0)\n {\n var frostImageElement = document.createElement('img');\n frostImageElement.src = './img/frost.png';\n panel.appendChild(frostImageElement);}\n //------------------------------------------------------------------\n\n\n //--If User wants to see Cloud Cover-------------------------------\n if (cloudRequested.checked){\n body.appendChild(cloudNode);\n body.appendChild(htmlBreak2);\n panel.appendChild(cloudImageElement);}\n //------------------------------------------------------------------\n\n\n //--If User wants to see Wind Speed-------------------------------\n if (windRequested.checked){\n body.appendChild(windNode);\n body.appendChild(htmlBreak3);}\n //------------------------------------------------------------------\n\n\n //--If User wants to see Precipitation-------------------------------\n if (precipRequested.checked){\n body.appendChild(precipNode);\n body.appendChild(htmlBreak4);\n if (precipText>0.5){\n precipImageElement.src=pickPrecipImage(tempText);\n console.log(precipImageElement);\n panel.appendChild(precipImageElement);}}\n //------------------------------------------------------------------\n\n\n $('#weatherpanels').append(panel);\n yesterday= dateText;\n\n }\n }", "function calendarAfterCloseDayCreate(day) {\n calendarAfterCloseDay(day, '.contract-datepicker-input');\n}", "function initialiseDay() {\t\t\r\n\tselectYear = displayDate.getFullYear();\r\n\tselectMonth = displayDate.getMonth();\r\n\tselectDay = displayDate.getDate();;\r\n\t/*\r\n\t/\tcreate a table of the schedule\r\n\t*/\r\n\t$(\"#day\").empty();\t\t\t\t\t\t// first clear any existing rows from day table\r\n\tif (removeCanvas)\t\t// remove the canvas, unless we are in mobile view\r\n\t\tdocument.getElementById(\"canvas\").style.display = \"none\";\r\n\tdocument.getElementById(\"color-fade\").style.display = \"none\";\r\n\tdocument.getElementById(\"year\").innerHTML = selectDay + \" \" + months[selectMonth];\r\n\tvar createSchedule = document.getElementById(\"day\");\r\n\tcreateSchedule.style.display = \"block\";\r\n\tvar schedRow;\r\n\tconsole.log('.............in initialiseDay, jsonPresent is '+jsonPresent);\r\n\tconsole.log('............in initialiseDay, jsonNotFound is '+jsonNotFound);\r\n\tif (jsonPresent) {\r\n\t\tfor (var i = 0, len = times.length; i < len; i++) {\r\n\t\t\tschedRow = createSchedule.insertRow();\r\n\t\t\tschedRow.innerHTML=\"<th>\" + times[i] + \"</th><td>FREE</td>\";\r\n\t\t}\t\r\n\t\tdisplayingDay = true;\r\n\t} else {\r\n\t\tschedRow = createSchedule.insertRow();\r\n\t\tif (jsonNotFound) \r\n\t\t\tschedRow.innerHTML = \"<td><h3>Unable to retrieve schedule of bookings for Star Life.</h3>-</td><td></td>\";\r\n\t\telse {\r\n\t\t\tschedRow.innerHTML = \"<td><h3>Schedule of bookings not loaded to this website yet.</h3> Please try again later.</td><td></td>\";\r\n\t\t\tdisplayingDay = true;\r\n\t\t}\r\n\t}\r\n\t/*\r\n\t/ now, display button to return to the month\r\n\t*/\r\n\tdocument.getElementById(\"returnToMonth\").innerHTML = \"return to month\";\r\n\t/*\r\n\t/ do not show previous button, if the month is before the current month\r\n\t*/\r\n\tif (displayDate <= today) {\r\n\t\tdocument.getElementById(\"previous\").style.display = \"none\";\r\n\t} else {\r\n\t\tdocument.getElementById(\"previous\").style.display = \"block\";\r\n\t}\r\n\t/*\r\n\t/ do not show next button, if after one year into the future\r\n\t*/\r\n\tif (displayDate >= oneYearFromToday) {\r\n\t\tdocument.getElementById(\"next\").style.display = \"none\";\r\n\t} else {\r\n\t\tdocument.getElementById(\"next\").style.display = \"block\";\r\n\t}\r\n\tshowBooked(displayDate);\r\n\tdocument.body.scrollTop = document.documentElement.scrollTop = 0;\t// scroll to very top of page\r\n}", "function displayRecentCities() {\n\n // Prevents double posting of saved cities list\n savedCities.empty();\n\n // Loops through the length of the cities array and creates new list buttons absed on its results\n for (let i = 0; i < recentCityArr.length; i++) {\n\n let showRecents = recentCityArr[i];\n\n let createButton = $('<button>').text(showRecents);\n\n // Allows the buttons to be clicked to load a previously searched city\n createButton.click(function() {\n\n userInputBox.val(showRecents);\n runWeather(\"https://api.openweathermap.org/data/2.5/weather?q=\" + showRecents + \"&appid=\" + apiKey + \"&units=imperial\");\n\n });\n\n // Appends cities to list in reverse order\n savedCities.prepend(createButton);\n }\n}", "function createCityBtns(searchedCities) {\n\n //empties city button div\n $('.cityBtns').empty();\n\n //variable declarations\n var searchedCity;\n var searchedState;\n var searchedCityState;\n\n //for loop to create a button for each city stored in the searchedCities array\n for (var i = 0; i < searchedCities.length; i++){\n \n searchedCity = searchedCities[i].city;\n searchedState = searchedCities[i].state;\n searchedCountry = searchedCities[i].country;\n\n //if city is located in US, display state code with city\n //if city is international, display country code with city\n if (searchedCities[i].country === 'US'){\n searchedCityState = searchedCity + ', ' + searchedState;\n } else {\n searchedCityState = searchedCity + ', ' + searchedCountry;\n }\n\n //append button to city btns div\n $('.cityBtns').append('<button type=\"button\" class=\"btn btn-light btn-block cityBtn\" data-city=\"' + searchedCity + '\" data-state=\"' + searchedState + '\">' + searchedCityState + '</button>');\n }//end for loop\n\n}//end function createCityBtns", "function getCurrentWeather(URL, city) {\n // This API call gets the city by name. It returns the current weather and also the longitude/latitude\n // needed in order to get the 5 day forecast. The current weather could also be gathered from the 5 day \n // and the actual weather icon comes from that api call. \n $.ajax({\n url: URL,\n method: \"GET\"\n })\n // Callback function. \n .then(function(res) {\n console.log(res);\n $(\"#cityHolder\").text(city +\" \"+ moment().format('l'));\n var temp = kelToFar(res.main.temp);\n $(\"#temp\").text(\"Temperature: \" + temp + \" \" +\"℉\");\n $(\"#humid\").text(\"Humidity: \" + res.main.humidity + \" %\");\n $(\"#wind\").text(\"Wind Speed: \" + res.wind.speed + \" MPH\");\n var lat = (res.coord.lat);\n var lon = (res.coord.lon);\n // Calling the function to get the 5 day forecast\n pop5Day(lat, lon);\n // Checking to see if the city should be added to the left side nav\n addCity(city);\n })\n .catch(function(res){\n // Alerts the user the city entered was not found in the API call\n alert((res.responseJSON.message));\n });\n}", "function currentCityWeather(city) {\n // grabbing the inputted city value to use in the openWeather API\n\n //removing all child elements of class=remove after click of the button to have a fresh empty page.\n $('.remove').empty();\n\n //fetching the weather from the openWeather API and the latitude and longitude coordinates.\n var currentWeatherURL = currentWeatherConditions + city + '&appid=' + openWeatherAPIKey + '&units=imperial';\n fetch(currentWeatherURL)\n .then(response => response.json())\n .then((data) => {\n var latitude = data.coord.lat;\n var longitude = data.coord.lon;\n\n var latLonWeatherURL = 'https://api.openweathermap.org/data/2.5/onecall?lat=' + latitude + '&lon=' + longitude + '&exclude=minutely,hourly,alerts&units=imperial&appid=' + openWeatherAPIKey;\n console.log(data);\n\n //calling the Weather, Hotel, attractions, and restaurant functions to get list of respective category for city we are searching for.\n // setTimeout Functions are so we can bypass the 429 Error.\n Weather(latLonWeatherURL);\n\n setTimeout(function() {\n hotelAdvisor(latitude, longitude);\n setTimeout(() => {\n attractionsAdvisor(latitude, longitude);\n setTimeout(() => {\n restaurantsAdvisor(latitude, longitude);\n }, 1000);\n }, 2000);\n }, 2000);\n })\n}", "function createScheduale(scheduleToday, day, date) { \n createFields(day);\n let mounth = getMounth(date);\n getId(`date${day}`).innerHTML = `${date.getDate()} ${mounth}`;\n fillFields(scheduleToday, day);\n}", "createAndDisplayWeather() {\n let infoWeather = document.getElementById(\"infoWeather\");\n let cityName = document.createElement(\"h4\");\n let iconWeather = document.createElement(\"img\");\n let currentCondition = document.createElement(\"p\");\n let currentDate = document.createElement(\"p\");\n let currentHour = document.createElement(\"p\");\n let currentTmp = document.createElement(\"p\");\n\n infoWeather.appendChild(cityName);\n infoWeather.appendChild(currentDate);\n infoWeather.appendChild(currentHour);\n infoWeather.appendChild(currentTmp);\n infoWeather.appendChild(iconWeather);\n infoWeather.appendChild(currentCondition);\n currentCondition.classList.add(\"currentCondition\");\n cityName.classList.add('cityName');\n iconWeather.classList.add(\"iconWeather\");\n currentDate.classList.add('currentDate');\n currentHour.classList.add('currentHour');\n currentTmp.classList.add('currentTmp');\n\n this.getDefaultWeatherAndDisplay(cityName, currentDate, currentHour, currentCondition, iconWeather, currentTmp);\n\n this.getLocalWeatherAndDisplay(cityName, currentDate, currentHour, currentCondition, iconWeather, currentTmp);\n }", "function giveCity() {\nfor (var i = 0; i < cities.length; i++) {\n var checkCity = $(\"<button>\");\n checkCity.addClass(\"btn btn-block checkCity\");\n checkCity.attr(\"id\", \"cBtn\");\n checkCity.attr(\"city-name\", cities[i]);\n checkCity.text(cities[i]);\n $(\"#cityBtn\").append(checkCity);\n savCities();\n }\n }", "function searchBtnRun(coordsSource) {\n var city = searchBtnText.val();\n var APIKey = \"eef440075f231dabd98329edc16d0dae\";\n\n console.log(city);\n var coordsSource = \"https://api.openweathermap.org/data/2.5/weather?q=\" + city + \"&units=imperial&appid=\" + APIKey;\n\n// fetch the location info\n fetch(coordsSource)\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n// grab the coordinates of the city and save them as variables\n var lat = data.coord.lat\n console.log(lat);\n var lon = data.coord.lon\n console.log(lon);\n// use those variables to then generate the appropriate api path for the daily/week forecast\n var finalAPI = \"https://api.openweathermap.org/data/2.5/onecall?lat=\"+ lat + \"&lon=\" + lon + \"&units=imperial&appid=\" + APIKey\n// fetch the locations info again, this time using the coords into the better api\n fetch(finalAPI)\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n console.log(data);\n// start doing stuff with the info\n \n // create button of past search\n searchHistoryList.append(`<button type=\"button\" class=\"btn btn-secondary search-history-btn my-2\" id=\"`+ searchBtnText.val() + `\">`+ searchBtnText.val() + `</button>`) \n\n // create weather icon var from API info\n var icon = \"http://openweathermap.org/img/wn/\" + data.current.weather[0].icon + \"@2x.png\"\n console.log(icon);\n // create link to weather icon element in html\n var cityNameIconEl = $(\"#city-name-icon\")\n // update weather icon src to new icon from API info\n cityNameIconEl.attr(\"src\", icon)\n // create desired var for new city title\n var newCityName = city + \" (\" + date + \")\"\n // push changes of city name to HTML\n cityNameEl.text(newCityName)\n // create desired var for todays temp\n var newTodayTemp = Math.floor(data.current.temp)\n console.log(newTodayTemp);\n // push changes of todays temperature to the HTML\n todayTempEl.text(\"Temp: \" + newTodayTemp + \" °F\")\n // create var for today's wind\n var newTodayWind = data.current.wind_speed\n console.log(newTodayWind);\n // push changes of todays wind to HTML\n todayWindEl.text(\"Wind: \" + newTodayWind + \" MPH\")\n // create var for today's humidity\n var newTodayHumidity = data.current.humidity\n console.log(newTodayHumidity);\n // push changes of todays wind to HTML\n todayHumidity.text(\"Humidity: \" + newTodayHumidity + \"%\")\n // create var for today's uv index\n var newTodayUV = data.current.uvi\n // push changes of todays UVI to HTML\n todayUVEl.text(\"UV Index: \" + newTodayUV)\n \n for (i=0; i < h5El.length ; i++) {\n // set future day parameter\n var daysToAdd = 1 + i\n // set forcast days\n var newForecastDay = moment().add(daysToAdd, \"days\").format(\"L\")\n // push forcast days\n $(h5El[i]).text(newForecastDay);\n\n // set forecast icon element list\n var forecastIconEl = $(\".emoji\")\n console.log(forecastIconEl);\n // set forecast icon reference\n var forecastIconApi = data.daily[i].weather[0].icon\n console.log(forecastIconApi);\n // set new forecast icon variable\n var newForecastIcon = \"http://openweathermap.org/img/wn/\" + forecastIconApi + \"@2x.png\"\n console.log(newForecastIcon);\n // push new icon to each element in the list\n $(forecastIconEl[i]).attr(\"src\", newForecastIcon)\n\n // set forecast temp variable \n var forecastTempEl = $(\".temp\")\n console.log(forecastTempEl)\n // set forecast temp api reference\n var forecastTempApi = data.daily[i].temp.day\n console.log(forecastTempApi);\n // set new forecast temp variable:\n var newForecastTemp = \"Temp: \" + forecastTempApi + \" °F\"\n console.log(newForecastTemp);\n // push new temp to each element in the list\n $(forecastTempEl[i]).text(newForecastTemp)\n\n // set forecast wind variable \n var forecastWindEl = $(\".wind\")\n console.log(forecastWindEl)\n // set forecast wind api reference\n var forecastWindApi = data.daily[i].wind_speed\n console.log(forecastWindApi);\n // set new forecast Wind variable:\n var newForecastWind = \"Wind: \" + forecastWindApi + \" MPH\"\n console.log(newForecastWind);\n // push new wind to each element in the list\n $(forecastWindEl[i]).text(newForecastWind)\n\n // set forecast Humidity variable \n var forecastHumidityEl = $(\".humidity\")\n console.log(forecastHumidityEl)\n // set forecast humidity api reference\n var forecastHumidityApi = data.daily[i].humidity\n console.log(forecastHumidityApi);\n // set new forecast humidity variable:\n var newForecastHumidity = \"Humidity: \" + forecastHumidityApi + \"%\"\n console.log(newForecastHumidity);\n // push new humidity to each element in the list\n $(forecastHumidityEl[i]).text(newForecastHumidity)\n }\n // erase the value in the search box\n searchBtnText.val(\"\")\n})\n}); \n \n}", "function getCurrentWeather(cityInput) {\n fetch(\n \"https://api.openweathermap.org/data/2.5/weather?q=\" +\n cityInput +\n \"&appid=a8e17bfcb12d79725964af1dd67c506a&units=metric\"\n )\n .then(function (response) {\n if (response.ok) {\n return response.json();\n } else {\n alert(\"Error: \" + response.statusText);\n }\n })\n .then(function (responseJsonReturned) {\n console.log(responseJsonReturned);\n let cityId = responseJsonReturned.id;\n console.log(cityId);\n let cityTitle = responseJsonReturned.name;\n console.log(cityTitle);\n\n // get the current city name, date & info display\n let cityHeader = document.querySelector(\"#city-title\");\n cityHeader.textContent = cityTitle;\n let currentDay = document.querySelector(\"#current-day\");\n currentDay.textContent = moment().format(\"dddd, ll\");\n let currentImg = document.createElement(\"img\");\n currentImg.setAttribute(\n \"src\",\n \"http://openweathermap.org/img/w/\" +\n responseJsonReturned.weather[0].icon +\n \".png\"\n );\n currentDay.appendChild(currentImg);\n let currentTemp = document.querySelector(\"#current-temp\");\n currentTemp.innerHTML =\n \"&nbsp\" + responseJsonReturned.main.temp + \" °C\";\n let currentHum = document.querySelector(\"#current-hum\");\n currentHum.innerHTML =\n \"&nbsp\" + responseJsonReturned.main.humidity + \" %\";\n let currentWind = document.querySelector(\"#wind-speed\");\n currentWind.innerHTML =\n \"&nbsp\" + responseJsonReturned.wind.speed + \" m/s\";\n\n // set the lat & lon for the second fetch, to get the uv index\n var lat = responseJsonReturned.coord.lat;\n var lon = responseJsonReturned.coord.lon;\n // fetch to get the uv index\n fetch(\n \"https://api.openweathermap.org/data/2.5/uvi?lat=\" +\n lat +\n \"&lon=\" +\n lon +\n \"&appid=a8e17bfcb12d79725964af1dd67c506a\"\n )\n .then(function (response2) {\n return response2.json();\n })\n .then(function (response2JsonReturned) {\n console.log(response2JsonReturned);\n console.log(response2JsonReturned.value);\n let currentUvIndex = document.querySelector(\"#uv-index\");\n currentUvIndex.innerHTML = response2JsonReturned.value;\n // set the colors for the uv index data, the color and change when the data change\n if (response2JsonReturned.value < 3) {\n currentUvIndex.classList.remove(\"bg-warning\");\n currentUvIndex.classList.remove(\"bg-danger\");\n currentUvIndex.classList.add(\"bg-success\");\n } else if (response2JsonReturned.value < 7) {\n currentUvIndex.classList.remove(\"bg-success\");\n currentUvIndex.classList.remove(\"bg-danger\");\n currentUvIndex.classList.add(\"bg-warning\");\n } else {\n currentUvIndex.classList.remove(\"bg-success\");\n currentUvIndex.classList.remove(\"bg-warning\");\n currentUvIndex.classList.add(\"bg-danger\");\n }\n });\n\n // fetch to get the forecast for future 5 days, the third fetch\n fetch(\n \"https://api.openweathermap.org/data/2.5/forecast?q=\" +\n cityInput +\n \"&appid=a8e17bfcb12d79725964af1dd67c506a&units=metric\"\n )\n .then(function (response) {\n if (response.ok) {\n return response.json();\n }\n })\n .then(function (response3JsonReturned) {\n console.log(response3JsonReturned);\n\n // use the third fetch data to display the 5-day forecasts\n for (let i = 0; i < response3JsonReturned.list.length; i++) {\n if (response3JsonReturned.list[i].dt_txt.includes(\"15:00:00\")) {\n let forecastWarp = document.querySelector(\".forecast-weather\");\n let forecastDivs = document.createElement(\"div\");\n forecastDivs.classList =\n \"col card text-white bg-primary forecast-divs\";\n let forecastDivHeader = document.createElement(\"div\");\n forecastDivHeader.classList = \"card-header next-date\";\n forecastDivHeader.textContent = response3JsonReturned.list[\n i\n ].dt_txt.split(\" \")[0];\n let forecastImgs = document.createElement(\"img\");\n forecastImgs.setAttribute(\n \"src\",\n \"http://openweathermap.org/img/w/\" +\n response3JsonReturned.list[i].weather[0].icon +\n \".png\"\n );\n forecastDivHeader.appendChild(forecastImgs);\n let forecastDivBody = document.createElement(\"div\");\n forecastDivBody.classList = \"card-body forecast-details\";\n let forecastDivTemp = document.createElement(\"h6\");\n forecastDivTemp.classList = \"card-title\";\n forecastDivTemp.textContent =\n \"Temp: \" + response3JsonReturned.list[i].main.temp + \" °C\";\n let forecastDivHum = document.createElement(\"h6\");\n forecastDivHum.classList = \"card-title\";\n forecastDivHum.textContent =\n \"humidity: \" +\n response3JsonReturned.list[i].main.humidity +\n \" %\";\n forecastDivs.appendChild(forecastDivHeader);\n forecastDivBody.appendChild(forecastDivTemp);\n forecastDivBody.appendChild(forecastDivHum);\n forecastDivs.appendChild(forecastDivBody);\n forecastWarp.appendChild(forecastDivs);\n }\n }\n });\n\n // if the input saved before, don't need to save again\n if (arrayCity.includes(cityTitle)) {\n return;\n }\n\n // local storage - save city inputs to the array & create city list on the left panel\n arrayCity.push(cityTitle);\n localStorage.setItem(\"arrayCity\", JSON.stringify(arrayCity));\n let cityList = $(\"#list-group\");\n let cityBtn = document.createElement(\"button\");\n cityBtn.classList = \"list-group-item\";\n cityBtn.textContent = cityTitle;\n cityList.append(cityBtn);\n });\n }" ]
[ "0.68691313", "0.67805153", "0.6557033", "0.6453229", "0.63967985", "0.6370309", "0.6354954", "0.6277295", "0.6245603", "0.61781263", "0.6158528", "0.61158", "0.6094348", "0.6089973", "0.6075558", "0.6040204", "0.60292065", "0.60158986", "0.59915924", "0.59398204", "0.5932253", "0.5923693", "0.59191924", "0.59138376", "0.5899539", "0.58981055", "0.5880937", "0.5866074", "0.5847654", "0.5843159", "0.5841868", "0.580908", "0.579193", "0.57898223", "0.5784965", "0.5780369", "0.5777247", "0.5772237", "0.5766729", "0.57593423", "0.5758773", "0.5751011", "0.5746389", "0.5742566", "0.5734029", "0.57252604", "0.5722365", "0.5720845", "0.57203406", "0.5719898", "0.57174975", "0.5710437", "0.570242", "0.56954825", "0.5693534", "0.5687483", "0.5678256", "0.5676821", "0.5671659", "0.56673545", "0.5656957", "0.5649307", "0.56389564", "0.5637141", "0.56359893", "0.56337243", "0.56230867", "0.5609463", "0.560524", "0.5604347", "0.56036425", "0.55994093", "0.55952364", "0.5589379", "0.5589333", "0.558482", "0.55820227", "0.5579155", "0.557266", "0.5572231", "0.55653924", "0.556229", "0.5558505", "0.55563974", "0.55560845", "0.5555993", "0.5552879", "0.55522555", "0.55503976", "0.55454797", "0.5544176", "0.55397844", "0.55389535", "0.55378795", "0.5528809", "0.55280954", "0.5523471", "0.5520631", "0.5517105", "0.5512525" ]
0.76257956
0
Function that creates a new button with the city name searched by the user.
function createBtn(){ // Remove existing buttons with the city name. $(".cityBtn").remove(); // Create new button for each element inside the savedCity array. savedCity.forEach(cn => { // console.log(cn); // Create a new button with the city names inside the savedCity array. const newCityBtn = `<button class="cityBtn btn-block" data-name="${cn}">${cn}</button>` // Append the new button tag to the div with class searchArea. searchArea.append(newCityBtn); }) // Call storeCities function. storeCities(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createcitybtn(city) {\n var citybutton = $(\"<button>\").addClass(\"citybutton button\");\n citybutton.text(city);\n $(\"#citylist\").append(citybutton);\n $(\"#citylist\").append(\"<br />\");\n}", "function recentSearch() {\n var cityName = $(\"#search\").val().trim();\n var button = $(\"<button>\");\n button.text(cityName).appendTo(\"#recentCity\");\n $(button).addClass(\"btn btn-light\");\n }", "function postCityButton(searchedCity){\n var capsButton = cap(searchedCity);\n \n var newButton = $(\"<button class='button is-fullwidth is-rounded cityButton'>\").text(capsButton);\n buttonList.push(newButton);\n \n // retrieving local storage array information\n var cityHistory = JSON.parse(window.localStorage.getItem(\"city-name\")) || [];\n\n // if local storage has the city already, don't duplicate\n if (cityHistory.indexOf(capsButton) === -1){\n cityHistory.push(capsButton);\n window.localStorage.setItem(\"city-name\", JSON.stringify(cityHistory));\n $(buttonDump).append(newButton);\n }\n\n // run informative funcitons when city button clicked\n $(newButton).click(function() {\n var inputSave = $(this).text();\n nowWeather(inputSave);\n });\n}", "function createBtn(city){\n var index = 1;\n var newCity = $(\"<button class='cityBtn' id=\" + city + \"' value=\" + index + \">\");\n newCity.text(city);\n sidebarEl.append(newCity);\n \n}", "function createCityBtns(searchedCities) {\n\n //empties city button div\n $('.cityBtns').empty();\n\n //variable declarations\n var searchedCity;\n var searchedState;\n var searchedCityState;\n\n //for loop to create a button for each city stored in the searchedCities array\n for (var i = 0; i < searchedCities.length; i++){\n \n searchedCity = searchedCities[i].city;\n searchedState = searchedCities[i].state;\n searchedCountry = searchedCities[i].country;\n\n //if city is located in US, display state code with city\n //if city is international, display country code with city\n if (searchedCities[i].country === 'US'){\n searchedCityState = searchedCity + ', ' + searchedState;\n } else {\n searchedCityState = searchedCity + ', ' + searchedCountry;\n }\n\n //append button to city btns div\n $('.cityBtns').append('<button type=\"button\" class=\"btn btn-light btn-block cityBtn\" data-city=\"' + searchedCity + '\" data-state=\"' + searchedState + '\">' + searchedCityState + '</button>');\n }//end for loop\n\n}//end function createCityBtns", "function makeCityButton(city) {\n return `\n <button class=\"dropdown-item\" type=\"button\" id=\"city\" data-city=\"${city.id}\" data-cityname=\"${city.name}\" data-state=\"${city.state_id}\">${city.name}</button>\n `\n}", "function createButton(searchedCity) {\n var cityButton = $(\"<button>\").text(searchedCity);\n $(\"#city-buttons\").append(cityButton);\n //i need to add click listener function for the search button\n //this will trigger my text value to be stored in a variable\n }//", "function searchHistoryCity(event){\n\n //Ensures another button isn't created\n createNewButton = false;\n\n //Formats city name then runs function for results section\n let cityButtonClicked = '';\n cityButtonClicked = event.target.id;\n cityButtonClicked = cityButtonClicked.trim().toLowerCase().split(' ').join('+');\n cityWeatherInformation(cityButtonClicked);\n\n}", "function renderButtons(city){\n var createButtons = $(\"<button>\");\n //add class to each buttons\n createButtons.addClass(\"cityButtons btn btn-block\");\n createButtons.attr(\"data-name\", city);\n createButtons.text(city);\n //prepend the city name into the div\n $(\"#search-history\").prepend(createButtons);\n \n }", "function giveCity() {\nfor (var i = 0; i < cities.length; i++) {\n var checkCity = $(\"<button>\");\n checkCity.addClass(\"btn btn-block checkCity\");\n checkCity.attr(\"id\", \"cBtn\");\n checkCity.attr(\"city-name\", cities[i]);\n checkCity.text(cities[i]);\n $(\"#cityBtn\").append(checkCity);\n savCities();\n }\n }", "function pastSearch() {\n for (var i = 0; i < cities.length; i++) {\n var button = $(\"<button>\");\n button.text(cities[i]).appendTo(\"#history\");\n $(button).addClass(\"btn btn-light\");\n }\n }", "function createHistoryButton(cityName) {\n \n \n if (!citiesArray.includes(cityName)){\n citiesArray.push(cityName);\n localStorage.setItem(\"localWeatherSearches\", JSON.stringify(citiesArray));\n }\n\n $(\"#previousSearch\").prepend(`<button class=\"btn btn-light cityHistoryBtn\" value='${cityName}'>${cityName}</button>\n `);\n}", "function createSearchHistory(city) {\n\n var historyBtn = $(\"<li>\", { \"class\": \"button rounded button-spacing\" }).text(city);\n $(\"#history-search-btn\").prepend(historyBtn);\n}", "function loadNewCities() {\n for (var i = 0; i < pastStorage.length; i++) {\n // console.log(cities.length)\n var newDiv = $(\"<button>\");\n newDiv.text(pastStorage[i]);\n newDiv.addClass(\"list-group-item hvr-shutter-out-horizontal\");\n newDiv.attr(\"data-name\", pastStorage[i]);\n newDiv.appendTo($(\"#search-cities\"))\n }\n }", "function createSearchCard(cityName) {\n // if unique create card\n \n $(\"<button>\")\n .addClass(\"cards\")\n .text(cityName)\n .appendTo($searchCardsContainer);\n // var $searchCards = document.querySelector(\".cards\");\n // console.log($searchCards)\n}", "function history() {\n var searchList = $(\"#search-history\");\n var addCity = $('<button>');\n addCity.attr('class', 'btn text-light bg-dark');\n addCity.attr('id', city);\n addCity.text(city);\n searchList.append(addCity);\n}", "function addSearch(e) {\n e.preventDefault();\n\n createNewButton = true;\n\n //Stores city name entered as-is, then clears field\n let citySearchName = $('#search-city').val();\n $('#search-city').val('');\n\n //Formats and stores city name for api call\n let cityButtonRevised = citySearchName.trim().toLowerCase().split(' ').join('+');\n\n //Runs function for results section\n cityWeatherInformation(cityButtonRevised, citySearchName);\n}", "function citySearchList() {\n $(\"#cityList\").empty();\n var count = 0;\n for (var i = cities.length-1; i >= 0; i--) {\n if (count++ < 9) {\n var newBtn = $(\"<button>\").attr(\"class\", \"listBtn btn\").attr(\"city-name\", cities[i]).text(cities[i]);\n $(\"#cityList\").append(newBtn);\n }\n }\n $(\".listBtn\").on(\"click\", function (event) {\n var city = $(this).text();\n weatherData(city);\n })\n }", "function addButton(location) {\n let button = $(\"<button>\");\n button.addClass(\"list-group-item list-group-item-action city-button bgWhiteTransparent\");\n button.attr(\"type\", \"button\");\n button.attr(\"data-city\", location);\n button.text(location)\n $(\"#history\").prepend(button);\n}", "function createButtons() {\n $(\"#past-search-buttons\").empty();\n for (var i=0; i < searchedCities.length; i++) {\n let pastCities = $(\"<button>\");\n pastCities.addClass(\"col-md-12\");\n pastCities.attr(\"id\", \"past-searched-cities\")\n pastCities.attr(\"data-name\", searchedCities[i]);\n pastCities.text(searchedCities[i]);\n $(\"#past-search-buttons\").prepend(pastCities);\n }\n}", "function rendercity() {\n $(`#cityList`).empty()\n for (var i = 0; i < cities.length; i++) {\n a = $(\"<button>\")\n a.addClass(\"city\");\n a.attr(\"cityName\", cities[i]);\n a.text(cities[i]);\n $(\"#cityList\").append(a);\n }\n // forecast()\n }", "function displayCities() {\n var text = '';\n for (var i = 0; i < cities.length; i++) {\n \n var options = text += \"<button id=\" +cities[i].city+ \" onclick='searchCity(\"+JSON.stringify(cities[i].city)+\")'>\" +cities[i].city+\"</button> <br>\";\n cityRow.innerHTML = options; \n \n \n }\n \n }", "function loadDefaultCities() {\n for (var i = 0; i < cities.length; i++) {\n // console.log(cities.length)\n var newDiv = $(\"<button>\");\n newDiv.text(cities[i]);\n newDiv.addClass(\"list-group-item hvr-shutter-out-horizontal\");\n newDiv.attr(\"data-name\", cities[i])\n newDiv.appendTo($(\"#search-cities\"))\n }\n }", "function displayCity(){\n cityList.empty();\n \n for (var i = 0; i < cityArray.length; i++) {\n var city = cityArray[i];\n \n var button = $(\"<button>\").text(city);\n button.attr(\"class\", \"list-group-item\", \"list-group-item active\");\n button.attr(\"id\", city);\n button.attr(\"aria-current\", \"true\");\n cityList.prepend(button);\n }\n \n}", "function savedCities(){\n var pastSearch = document.createElement('button');\n pastSearch.classList.add('card', 'btn');\n pastSearch.textContent = searchInputVal;\n pastSearch.addEventListener('click', handleSearchFormSubmit);\n searchHistory.appendChild(pastSearch);\n}", "function generateButtons() {\n $(\"#cities-history\").empty();\n for (i = 0; i < citiesArray.length; i++) {\n var cityButton = $(\"<button id='city-button'>\");\n cityButton.addClass(\"button city-el\").attr(\"data-name\", citiesArray[i]);\n cityButton.text(citiesArray[i]);\n $(\"#cities-history\").append(cityButton);\n }\n }", "function previousCityBtn(city) {\n let button = $(\"<button>\");\n\n button.addClass(\"list-group-item list-city historyBtn\");\n\n button.attr(\"type\", \"button\");\n\n button.text(city).val(city);\n\n $(\".list-group\").prepend(button);\n }", "function listCities() {\n $('.tophistory').empty();\n $('#search-input').val('');\n for(var i = 0; i < searchHistory.length; i++) {\n var cityButton = $('<a>');\n cityButton.addClass('pill');\n cityButton.attr('data-name', searchHistory[i]);\n cityButton.text(searchHistory[i]);\n $('.tophistory').append(cityButton); \n }\n}", "function renderSearchList(){\n $(\".cities\").empty();\n for(var i = 0; i < citiesArray.length; i++){\n var city = citiesArray[i];\n let cityListItem = $(\"<button>\").addClass(\"btn btn-block btn-outline-light citylist\").text(city);\n $(\".cities\").append(cityListItem);\n }\n }", "function createButtons() {\n var city = $(\"#weatherInput\").val();\n $(\"#weatherInput\").val(\"\");\n $(\"#history\").empty();\n console.log(cities);\n for (var i = 0; i < cities.length; i++) {\n\n var a = $(\"<button>\");\n a.addClass(\"weather\");\n a.addClass(\"form-control\");\n a.text(cities[i]);\n $(\"#history\").append(a);\n };\n}", "function renderCityButtons() {\n $(\"#cityButtonsContainer\").empty();\n for (var i = 0; i < cities.length; i++) {\n var cityButton = $(\"<button>\");\n\n cityButton.addClass(\"city\");\n // Added cityButton data-attribute\n cityButton.attr(\"data-name\", cities[i]);\n // Provided the initial button text\n cityButton.text(cities[i]);\n // Added the button to the buttons-view div\n $(\"#cityButtonsContainer\").append(cityButton);\n }\n }", "function generateListDisplay() {\n cityListEl.innerHTML = \"\";\n for (var i = 0; i < cityInput.length; i++) {\n var newEl = document.createElement(\"BUTTON\");\n newEl.textContent = cityInput[i];\n newEl.setAttribute(\"class\", \"list-group-item list-group-item-action\");\n cityListEl.appendChild(newEl);\n }\n}", "function renderPreviousCity() {\n //clears previous city list so that there will not be duplicates renders\n cityListEl.innerHTML = \"\";\n // removing first entry in the city list if it's over 10 entries\n if (cityList.length > 10) {\n cityList.pop();\n }\n\n // render a new button for old searches\n for (let i = 0; i < cityList.length; i++) {\n // uppercasing of first letter \n // var upperCity = cityList[i].charAt(0).toUpperCase() + cityList[i].slice(1);\n // variable to create a button\n var button = document.createElement('button');\n button.classList = 'btn btn-search grey lighten-1 collection-item'\n button.textContent = cityList[i];\n // Creates an event listener for the button that will run the search again in accordance to the button clicked\n button.addEventListener(\"click\", function() { getLocation(cityList[i]) });\n\n // new class for previously searched cities to handle the button click similarly to formsubmithandler \n\n // appending to city list container \n cityListEl.appendChild(button);\n }\n\n\n}", "function onLoad() {\n if (localStorage.getItem('cityname') != '') {\n var cityStore = JSON.parse(localStorage.getItem('cityname'));\n if (cityStore != null) {\n for (var i = 0; i < cityStore.length; i++) {\n var btn = $(\"<button>\");\n btn.text(cityStore[i]);\n searchHistoryEl.append(btn);\n }\n }\n }\n}", "function displayRecentCities() {\n\n // Prevents double posting of saved cities list\n savedCities.empty();\n\n // Loops through the length of the cities array and creates new list buttons absed on its results\n for (let i = 0; i < recentCityArr.length; i++) {\n\n let showRecents = recentCityArr[i];\n\n let createButton = $('<button>').text(showRecents);\n\n // Allows the buttons to be clicked to load a previously searched city\n createButton.click(function() {\n\n userInputBox.val(showRecents);\n runWeather(\"https://api.openweathermap.org/data/2.5/weather?q=\" + showRecents + \"&appid=\" + apiKey + \"&units=imperial\");\n\n });\n\n // Appends cities to list in reverse order\n savedCities.prepend(createButton);\n }\n}", "function createSearchHistory(city) {\n\n var historyBtn = $(\"<li>\", { \"class\": \"button\" }).text(city);\n historyBtn.click(function(event) {\n clearCurrent();\n clearFiveDay();\n getFiveDayForecastData(city);\n getCurrentWeatherData(city); \n\n historyBtn.addClass('list');\n })\n $(\"#historySearchBtn\").prepend(historyBtn);\n}", "function btnGen() {\n cities.push(name);\n btnMk(name);\n btnClear();\n localStorage.setItem(\"cities\", JSON.stringify(cities));\n}", "function renderCities() {\n CitiesList.innerHTML = \" \";\n\n //for loop to iterate through the list of cities\n for(var i =0; i< Namecities.length; i++){\n var Namecitie = Namecities[i];\n var li = document.createElement(\"button\");\n li.textContent = Namecitie;\n li.setAttribute(\"id\", \"list-cities\")\n li.setAttribute(\"class\", \"btn-cities\")\n li.setAttribute(\"data-city\", Namecitie)\n CitiesList.appendChild(li);\n }\n}", "searchResultsBuilder() {\n // clear out search results\n document.querySelector('#search-results').innerHTML = '';\n const targetElement = document.querySelector('#search-results');\n // get city List and loop through\n this.cityList.forEach((city) => {\n const newButton = document.createElement('button');\n newButton.classList.add(\n 'button',\n 'is-medium',\n 'is-info',\n 'is-light',\n 'is-fullwidth'\n );\n newButton.innerText = city;\n targetElement.appendChild(newButton);\n // add click handler\n newButton.addEventListener('click', (event) => {\n const searchTerm = event.srcElement.outerText;\n this.cityInput = searchTerm;\n this.domBuilder();\n });\n });\n }", "function makeButtons() {\n $(\"#btnDiv\").empty();\n for (i = 0; i < cityInput.length; i++) {\n let $btnSetup = $(\"<button>\");\n $btnSetup.text(cityInput[i]);\n $btnSetup.addClass(buttonClass);\n $(\"#btnDiv\").append($btnSetup);\n };\n}", "function cityLookUp(buttonId, cityName) {\n Fetcher(cities)\n .then(citydata => {\n\n let ul = getById('cityData'),\n btnId = buttonId.replace(/^\\D+/g, '');\n\n for (let i = 0; i < citydata.length; i++) {\n if (parseInt(btnId) === parseInt(citydata[i].id)) {\n var li = createNode('li');\n li.innerHTML = \"Population: \" + citydata[i].population;\n removeChilds(ul);\n append(ul, li);\n }\n }\n getById('countryBar').style.display = 'none';\n })\n getCityLocation(cityName);\n}", "function displaySavedCities() {\n // use a for loop to iterate through all the values in cityNames array, append a new list item for each of those values\n for (var i = 0; i < cityNames.length; i++) {\n searchedCities.append($(\"<li>\").text(cityNames[i]).addClass(\"btn\"))\n }\n}", "function cityClicked() {\n $(\".inputCity\").val($(this).text());\n $(\"#searchBtn\").trigger(\"click\");\n }", "function renderCitiesButton(cities) {\n $(\"#cities-list\").empty();\n for (let i = 0; i < cities.length; i++) {\n $(\"#city-\" + [i]).text(cities[i]);\n var citiesListItem = $(\n '<li class=\"list-group-item\"><button>' + cities[i] + \"</button></li>\"\n );\n citiesListItem.children().data(\"cityData\", cities[i]);\n $(\"#cities-list\").append(citiesListItem);\n }\n}", "function renderButtons(){\n $('#cities').empty();\n for (var index = 0; index < cities.length; index++) {\n var a = $('<button>');\n a.addClass(\"city\");\n a.attr(\"data-name\", cities[i]);\n a.text(cities[i]);\n $(\"#cities\").append(a);\n }\n }", "function displayCitySearch() {\n $(\"#search-form\").append(`\n\t<section class=\"container-fluid recipe-search-bar\">\n\t\t<div class=\"row\">\n\t\t\t<div class=\"translucent-form-overlay\">\n\t\t\t\t<form>\n\t\t\t\t\t<h3>Search for a City</h3>\n\t\t\t\t\t<div class=\"row columns\">\n\t\t\t\t\t\t<label>Keyword\n\t\t\t\t\t\t\t<input id=\"search-field\" type=\"text\" name=\"keyword\" placeholder=\"City name ...\">\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<button id=\"city-button\" type=\"button\" class=\"primary button expanded search-button\"><i class=\"fa fa-search\"></i>\n\t\t\t\t\t</button>\n\t\t\t\t</form>\n\t\t\t</div>\n\t\t</div>\n\t</section>\n `)\n}", "function cityButton() {\n $(\".previous-city\").empty();\n for(var j = 0; j < recentCities.length; j++){\n $(\".previous-city\").append($(\"<button>\").text(recentCities[j]));\n }\n}", "function renderCityNames() {\n displayCity.innerHTML = \"\";\n $(\"li\").empty()\n\n // Render a new city for each search\n for (var i = 0; i < keepCities.length; i++) {\n var keepCity = keepCities[i];\n var li = $(\"<li>\");\n li.text(keepCities[i]);\n li.attr(\"data-index\", i);\n var button = $(\"<p>\");\n //button.text(\"City Searched\");\n li.append(button);\n displayCity.append(li);\n }\n}", "function dispalySearchHistory() {\n //Retrieve objects from localStorage\n let searchHistory = JSON.parse(localStorage.getItem(\"citySearchHistory\"));\n //If there are not any objects in localStorage, don't do anything else\n if(!searchHistory){\n return;\n };\n //Adds buttons for each object\n for(i = 0; i < searchHistory.length; i++){\n newCityButton = $('<button>');\n newCityButton.addClass('btn btn-primary mb-1');\n cityButtonName = searchHistory[i].city;\n cityButtonID = cityButtonName.trim().toLowerCase().split(' ').join('+');\n newCityButton.attr('id', cityButtonID);\n newCityButton.html(cityButtonName);\n //Prepends the buttons to the html\n $('#city-buttons').prepend(newCityButton);\n };\n}", "function renderCities() {\n\n $(\"#viewCities\").empty();\n\n for (var i = 0; i < cities.length; i++) {\n var c = $(\"<button>\");\n c.addClass(\"cityBtn col-12\");\n c.attr(\"data-name\", cities[i]);\n c.text(cities[i]);\n $(\"#viewCities\").append(c);\n }\n}", "function citysaveBtn () {\n var lastSearch = JSON.parse(localStorage.getItem(\"userInput\"));\n var searchDiv = $(\"<button class='btn-primary btn-outline-dark mt-1 bg-primary rounded' style='width: 165px;'>\").text(lastSearch);\n var pastSearch = $(\"<div>\");\n pastSearch.append(searchDiv)\n //using prepend so users search history displays in correct order\n $(\"#searchHistory\").prepend(pastSearch);\n //on click for button that stores city searches and displays them\n $(searchDiv).click(function () {\n console.log($(this).text());\n citySearch($(this).text());\n})\n}", "function createButton(searchTerm) {\n // if search is not an empty string create and append the button\n if (searchTerm !== \"\") {\n // create button and append it to the button list\n var newButton = $(\"<button>\");\n newButton\n .addClass(\"searchBtn\")\n .addClass(\"button\")\n .addClass(\"is-primary\")\n .addClass(\"my-2\")\n .addClass(\"px-1\");\n newButton.attr(\"id\", searchTerm);\n newButton.text(searchTerm);\n buttonListEle.append(newButton);\n buttonListEle.append(\"<br>\");\n // send button to local storage\n localStorage.setItem(storageIndex, searchTerm);\n storageIndex++;\n }\n}", "function showSearchHistory() {\n historyEl.innerHTML = \"\";\n for (let i = 0; i < searchHistory.length; i++) {\n const historyList = document.createElement(\"input\");\n historyList.setAttribute(\"type\",\"button\");\n historyList.setAttribute(\"class\", \"form-control d-block bg-white\");\n historyList.setAttribute(\"value\", searchHistory[i]);\n // clicking on a city name in the history list will getWeatherApi again for that city\n historyList.addEventListener(\"click\",function() {\n getWeatherApi(historyList.value);\n document.getElementById('city-input').value = historyList.value;\n })\n historyEl.append(historyList);\n }\n}", "function generatebtn() \n {\n\n $(\"#buttons-views\").empty(); // empties out the html\n //we have no data in localstorage yet, will use dummy data to test fx\n var insideList = JSON.parse(localStorage.getItem(\"cities\"));\n //var insideList= [\"Austin\", \"Denver\"];\n\n // Checks to see if we have any items in localStorage\n // If we do, set the local insideList variable to our todos\n // Otherwise set the local insideList variable to an empty array\n if (!Array.isArray(insideList)) {\n insideList = [];\n }\n\n console.log(insideList);\n // render our insideList city weather to the page\n for (var i = 0; i < insideList.length; i++) {\n\n var b = $(\"<button class='city'>\").text(insideList[i]).attr(\"data-city\", insideList[i]);\n //<button class=\"city\"></button>\n //<button class=\"city\">Austin</button>\n //<button class=\"city\" data-city=\"Austin\">Austin</button>\n \n\n //append = inside buttons-view loc area we stick the button.\n \n $(\"#buttons-view\").prepend(b);\n //<button class=\"city\" data-city=\"Austin\">Austin</button>\n }\n }", "function renderCities() {\n\n // Deleting the city buttons prior to adding new city buttons\n $(\"#buttons-view\").empty();\n\n // Looping through the array of cities and dynamically generating buttons for each city in the array\n for (var i = 0; i < cities.length; i++) {\n var button = $(\"<button>\");\n button.addClass(\"city\");\n button.attr(\"data-name\", cities[i]); \n button.text(cities[i]);\n $(\"#buttons-view\").addClass(\"btn-group-vertical\");\n $(\"#buttons-view\").append(button);\n }\n }", "function createbutton(a, obj){\n //storing and retrieving data from local storage\n var history = JSON.parse(localStorage.getItem(\"cities\")) || []\n history.push({\n city: a,\n data: obj,\n })\n localStorage.setItem(\"cities\", JSON.stringify(history))\n //creating buttons\n var histbtn = $(\"<button>\")\n histbtn.text(history[history.length-1].city).attr(\"class\", \"historybtn\")\n $(\"#sbtnarea\").append(histbtn)\n // click event for history buttons\n histbtn.on(\"click\", function(event){\n event.stopPropagation()\n console.log(\"Its Aight\")\n for(var x = 0; x< history.length; x++ ){\n if(histbtn.text()== history[x].city){\n console.log(history[x].city)\n cityname = history[x].city\n DashboardDisplay(history[x].data)\n }else{\n null\n }\n }\n })\n \n \n \n }", "function searchHistoryBtn(searchValue) {\n\n // var searchValue = $(\"#inputValue\").val().trim();\n\n var citySearchBox = $(\"#city-search-box\");\n\n var cityBtnDivEl = $(\"<div>\").addClass(\"col-md-2 cityBtn\");\n\n var cityBtnEl = $(\"<button>\").addClass(\"btn btn-primary btn-lg\").text(searchValue);\n\n if (!localStorage.getItem(searchValue)) {\n $(cityBtnDivEl).append(cityBtnEl);\n };\n\n $(citySearchBox).append(cityBtnDivEl);\n\n $(cityBtnEl).on(\"click\", function () {\n\n var getCity = localStorage.getItem(searchValue)\n searchWeather(getCity);\n\n });\n\n }", "function addCitiesLS(citySearch) {\n\n // adding to local storage, taking key to get items\n namesCity = localStorage.getItem(\"cityNames\");\n // taking string from local storage and putting back in original form\n namesCity = JSON.parse(namesCity) || [];\n namesCity.push(citySearch);\n // setting item from array to local storage\n localStorage.setItem(\"cityNames\", JSON.stringify(namesCity));\n\n //adds list item to unordered list and adds city names to screen\n let listItem = $(\"<li class='cityNameinList'>\");\n //adds data-info attribute\n let buttonItem = $(`<button class='buttonCity ${citySearch}'>`);\n \n\n //adds most recent city name and today's date to the dashboard\n mainCity.html(`${citySearch} &nbsp (${todaysDate})`);\n \n listofCities.append(listItem);\n listItem.append(buttonItem);\n buttonItem.html(citySearch);\n }", "function showCityName () {\n var city = document.createTextNode(apiResult.name),\n displayCity = document.getElementById('city');\n\n displayCity.appendChild(city);\n }", "function buttonClickHandler(event) {\n if (searchedCityEl.value == \"Searched Cities\") {\n alert(\"Please select an option\");\n } else {\n var cityNameClicked = searchedCityEl.value;\n //console.log(cityNameClicked);\n getCityWeather(cityNameClicked);\n }\n}", "function saveCityAndButtonToLocal() {\n $(\".city-buttons\").empty();\n for (var i = 0; i < citySearchedArray.length; i++) {\n var newButton = $(\"<button>\");\n var newButtonListItem = $(\"<li>\");\n newButton.addClass(\"btn btn-dark list-button\");\n newButton.text(citySearchedArray[i]);\n $(\".city-buttons\").prepend(newButtonListItem);\n newButtonListItem.prepend(newButton);\n localStorage.setItem(\"citySearchedArray\", JSON.stringify(citySearchedArray));\n }\n}", "function previousButton(citiesHistory) {\n var btn = $('<button>').addClass('btn btn-secondary col-12').text(citiesHistory).css(\"margin-bottom\", \"10px\")\n $('#previous-search').append(btn)\n}", "function searchCityButton(event) {\n event.preventDefault(); //prevents the default behaviour (=reload page) after clicking button\n let searchInput = document.querySelector(\"#entercity\").value; //Select the form for entering the city's name\n let cityName = document.querySelector(\"#city-name\"); //Select part of HTML which shall be changed\n cityName.innerHTML = searchInput;\n let apiKey = \"641aea60f164eb7376c34eaed6daea65\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?q=${searchInput}&appid=${apiKey}&units=metric`;\n\n axios.get(apiUrl).then(showTemperature);\n}", "function showRecentCities() {\n $('.cities').empty();\n for(i in recentCities) {\n $('.cities').prepend($('<button type=\"button\" class=\"list-group-item list-group-item-action\">').html(recentCities[i]).attr('data-city', recentCities[i]));\n }\n }", "function retrieveCityWeather() {\n $(\".cityBtn\").on(\"click\", function (event) {\n event.preventDefault();\n //variable that holds city text displayed on btn\n wordCity = this.innerHTML;\n //passing that city to the displayWeather function\n displayWeather(wordCity);\n\n })\n}", "function cityInfoOnButtonPush() {\n var city = $(this).attr(\"data-city\");\n var cityData = cities.find(function (cityData) {\n return cityData.city.name === city;\n });\n renderWeatherInfo(cityData);\n }", "function historybtn(city){\n console.log(\"historybtn fx\"+ city);\n //grab current city and add it to the cities array\n list.push(city);\n //sets the array into local storage\n localStorage.setItem(\"cities\", JSON.stringify(list));\n console.log(\" List Array: \"+list)\n //renders the btn\n generatebtn();\n \n\n }", "function displayHistory(cityInputText){\n cityInputText = cityInputText.toUpperCase();\n //console.log(cityInputText);\n var searchItem = document.createElement(\"a\");\n searchItem.setAttribute(\"href\", \"#\");\n searchItem.setAttribute(\"class\", \"list-group-item list-group-item-action\");\n var searchItemToAdd = cityInputText;\n searchItem.setAttribute(\"data-city\", cityInputText);\n searchItem.innerHTML = searchItemToAdd;\n var history = document.querySelector(\"#search-history\");\n history.appendChild(searchItem);\n}", "function localPost(){\n var cityHistory = JSON.parse(window.localStorage.getItem(\"city-name\")) || [];\n\n for (var i = 0; i < cityHistory.length; i++){\n var newButton = $(\"<button class='button is-fullwidth is-rounded cityButton'>\").text(cityHistory[i]);\n $(buttonDump).append(newButton);\n $(newButton).click(function() {\n var inputSave = $(this).text();\n nowWeather(inputSave);\n forcast(inputSave);\n });\n }\n}", "function renderBtns() {\n for (i = 0; i < cities.length; i++) {\n var a = $(\"<button>\");\n a.addClass(\"historyBtn btn btn-outline-secondary\");\n a.attr(\"data-number\", i);\n a.text(cities[i]);\n $(\".prev-search\").append(a);\n setLocalStorage();\n }\n}", "function addCityName(city){\n\t\t$(\"#cityName\").html(city);\n\t}", "function initializeButtons() {\n $('#history').empty();\n retrieveHistory();\n $(\"#currentConditions\").append('<p id=\"conditionsContainer\">Enter a city name to view current and future weather conditions.</p>')\n for (let i = 0; i < searchHistory.length; i++) {\n let historyArea = $(\"#history\")\n historyArea.append(`<button class=\"cityHistory\" data-value=\"${searchHistory[i]}\">${searchHistory[i]}</button>`)\n }\n $('#history').children('button').on('click', function (event) {\n let oldCity = $(event.target).attr('data-value');\n $(\"#searchInput\").val(oldCity);\n searchLoc();\n }\n );\n}", "function savedCityClick () {\n var city = $(this).text();\n var queryURL = urlBase + city + \"&appid=\" + apiKey;\n getCurrentWeather(queryURL, city); \n}", "function makeButton(savedArray) {\n for (var i = 0; i < savedArray.length; i++) {\n var divButton = document.createElement(\"div\");\n divButton.setAttribute(\"class\", \"d-grid gap-2\");\n var cityButton = document.createElement(\"button\");\n cityButton.setAttribute(\"class\", \"btn btn-outline-primary btnCity\");\n cityButton.setAttribute(\"type\", \"button\");\n cityButton.textContent = savedArray[i].citySaved;\n savedDisplay.appendChild(divButton);\n divButton.appendChild(cityButton);\n }\n}", "function renderButtons(){\n citiesDiv.innerHTML = \"\"; \n if(cities == null){\n return;\n }\n let unique_cities = [...new Set(cities)];\n for(let i=0; i < unique_cities.length; i++){\n let cityName = unique_cities[i]; \n\n let buttonEl = document.createElement(\"button\");\n buttonEl.textContent = cityName; \n buttonEl.setAttribute(\"class\", \"listbtn\"); \n\n citiesDiv.appendChild(buttonEl);\n listClicker();\n }\n }", "function cityNameSet() {\n cityNameEl.text(searchInputEl.val());\n APISearch();\n}", "function generateButtons(){\n\t\tfor (var i = 0; i < topics.length; i++) {\n\t\tvar cityButtons = $(\"<button class= city-button value=\" + topics[i] + \">\" + topics[i] + \"</button>\");\n\t\t$(\"#buttons-div\").append(cityButtons);\n\t\t\t}\n\t}", "function createCitySearchHistoryList(localStorageForecastHistory) {\n if (localStorageForecastHistory !== null) {\n var localStorageForecastHistoryLength = localStorageForecastHistory.length;\n for (var i = localStorageForecastHistoryLength - 1; i > (localStorageForecastHistoryLength - 11); i--) {\n // add text to page - left City List \n var cityList = $(\"<button>\");\n cityList.addClass(\"border borderColor p-2 text-center btn-block bg-light cityListContainer \");\n cityList.attr(\"id\", `${i}`);\n cityList.text(localStorageForecastHistory[i].city);\n $col_1_row_2.append(cityList)\n }\n }\n}", "function currentDay(inputCity, createButton){\n \n // Variable that holds the API url along with variables key, unit and inputed city from user.\n const queryURL = \"https://api.openweathermap.org/data/2.5/weather?appid=\" + APIKey + imperialUnit + \"&q=\" + inputCity;\n\n \n // AJAX call for the specific criteria (city name) entered by the user.\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(response => { \n // console.log(response);\n\n // Created variable to hold the city name response from API.\n const cityName = response.name\n // console.log(cityName);\n\n // If createButton boolean is true than create button; however, another if statement is entered, so if user types a name of a city that he/she searched before, then this city will not be entered in the savedCity array.\n if (createButton) {\n if ((savedCity.indexOf(cityName)) <= -1){\n // console.log(cityName);\n savedCity.push(cityName);\n }\n }\n\n // Created variable to grab current day.\n const d = new Date();\n\n // Created variable to grab the icon image name.\n const dayIcon = response.weather[0].icon;\n\n // Create new elements to be append in the html file using the API response as part of the text.\n const newCurrentWeather = `\n <h2>${cityName}<span>(${d.getMonth()+1}/${d.getDate()}/${d.getFullYear()})</span>\n <img src=\"https://openweathermap.org/img/wn/${dayIcon}.png\"></img>\n </h2>\n <p>Temperature: <span class=\"bold\">${response.main.temp}</span> ℉</p>\n <p>Humidity: <span class=\"bold\">${response.main.humidity}</span>%</p>\n <p>Wind Speed: <span class=\"bold\">${response.wind.speed}</span> mph;\n <p class=\"uv\">UV Index: </p>\n <img class='imgUv' src=\"https://www.epa.gov/sites/production/files/sunwise/images/uviscaleh_lg.gif\" alt=\"UV Color Scale\"></img>\n <br>\n <br>\n `\n // Created varibles to store the latitude and longitude responses that are going to be used in the URL to grab the UV.\n const latitude = response.coord.lat \n const long = response.coord.lon\n \n // Calls the function that runs the AJAX with the UV API.\n getUV();\n\n // Clears the div with the today class, and add the response for the new city searched.\n today.empty().append(newCurrentWeather); \n\n function getUV(){\n\n // Created variable to hold API url along with key, and the searched city latitute and longitude.\n const uvURL = \"https://api.openweathermap.org/data/2.5/uvi?lat=\" + latitude + \"&lon=\" + long + \"&appid=\" + APIKey\n\n // AJAX call function for to get the UV API response.\n $.ajax({\n url: uvURL,\n method: \"GET\"\n }).then(resUV => {\n // console.log(resUV);\n \n // Created variable to hold UV response.\n const uv = resUV.value;\n\n $(\".spUv\").remove();\n\n // Created a span tag with the UV response.\n const spanUV = $(\"<span class='spUv bold'>\").text(uv);\n\n // Append the span tag to the p tag created previously.\n $(\".uv\").append(spanUV);\n \n // Gets the UV response and turns into a number.\n const parsenUV = parseInt(uv);\n\n // The following if statements are to color code the UV level according to https://www.epa.gov/sunsafety/uv-index-scale-0\n if (parsenUV <= 2){\n spanUV.attr(\"style\", \"background: green\")\n }\n else if (parsenUV >= 3 && parsenUV <= 5){\n spanUV.attr(\"style\", \"background: yellow\")\n }\n else if (parsenUV === 6 || parsenUV === 7){\n spanUV.attr(\"style\", \"background: orange\")\n }\n else if (parsenUV >= 8 && parsenUV <= 10){\n spanUV.attr(\"style\", \"color: white;background: red\")\n }\n else if (parsenUV >= 11){\n spanUV.attr(\"style\", \"color: white;background: purple\")\n }\n })\n }\n\n // Call function that displays 5 days forecast.\n futureDates()\n\n function futureDates(){\n \n // Created variable to hold the forecast URL, adding the user search city name, API key, and unit change from standard to imperial.\n const forecastURL = \"https://api.openweathermap.org/data/2.5/forecast?q=\" + cityName + \"&appid=\" + APIKey + imperialUnit\n\n // AJAX call for the specific city search by the user.\n $.ajax({\n url: forecastURL,\n method: \"GET\"\n }).then(forecastRes => {\n // console.log(forecastRes);\n\n // Created varibale that holds the API response with a list of the every three works forecast for a five days period.\n const forecastArray = forecastRes.list\n\n // Create a h3 tag to display the 5-Day Forecast title.\n const newForH3 = `<h3>5-Day Forecast</h3>`;\n \n // Create a new div with a bootstrap class card-deck.\n const newCardDeck = `<div class=\"card-deck\"></div>`;\n\n // Empty the div with class forecast, then append the new h3 and the new div.\n forecast.empty().append(newForH3, newCardDeck);\n\n // Create a for loop to loop through the forecast array. Start to loop at index 7 to skip the current day. The response comes back in 3 hours range; therefore, each returns 8 result per day, that's why i is added by 8 each time, to take a new day.\n for (let i=7; i < forecastArray.length; i+=8){\n\n // Created variable to store date from response and format it to JavaScript.\n const forDate = new Date(forecastArray[i].dt_txt);\n // console.log(forDate);\n\n // Created variable to hold each icon name.\n const forDayIcon = forecastArray[i].weather[0].icon;\n\n // Create a new div with bootstrap class card-body for each result.\n const newDivCardBody = `<div class=\"card-body\">\n <p><span class=\"bold\">${forDate.getMonth()+1}/${forDate.getDate()}/${forDate.getFullYear()}</span>\n <img src=\"https://openweathermap.org/img/wn/${forDayIcon}.png\"></img></p>\n <p>Temperature: <span class=\"bold\">${forecastArray[i].main.temp}</span> ℉<p>\n <p>Humidity: <span class=\"bold\">${forecastArray[1].main.humidity}</span>%</p>\n </div> \n `\n // Append the div with class card-body to the div with class card-deck.\n $(\".card-deck\").append(newDivCardBody);\n } \n })\n }\n // Call create button function.\n createBtn(); \n }) \n }", "function drawCities() {\r\n if (localStorage.length > 0) {\r\n $(\"#city-input\").val(\"\");\r\n cityArray = JSON.parse(localStorage.getItem(\"city-list\"));\r\n if (!cityArray.includes(varCitySearch.toLowerCase())) {\r\n cityArray.push(varCitySearch);\r\n localStorage.setItem(\"city-list\", JSON.stringify(cityArray));\r\n // return;\r\n }\r\n $(\"#list-cities\").empty();\r\n for (let i = 0; i < cityArray.length; i++) {\r\n let newP = $(\"<button></button>\");\r\n let cityId = cityArray[i].replace(/ /g, \"_\");\r\n newP.text(cityId);\r\n newP.attr(\"class\", \"btn btn-primary p-2 m-1\");\r\n newP.attr(\"id\", cityId);\r\n $(\"#list-cities\").append(newP);\r\n $(\"#\" + cityId).on(\"click\", () => {\r\n cityClick(cityArray[i]);\r\n });\r\n }\r\n } else {\r\n $(\"#city-input\").val(\"\");\r\n cityArray.push(varCitySearch);\r\n localStorage.setItem(\"city-list\", JSON.stringify(cityArray));\r\n $(\"#list-cities\").empty();\r\n for (let i = 0; i < cityArray.length; i++) {\r\n let newCity = $(\"<button></button>\");\r\n let cityId = cityArray[i].replace(/ /g, \"_\");\r\n newCity.text(cityId);\r\n newCity.attr(\"class\", \"btn btn-primary p-2 m-1\");\r\n newCity.attr(\"id\", cityId);\r\n $(\"#list-cities\").append(newCity);\r\n $(\"#\" + cityId).on(\"click\", () => {\r\n cityClick(cityArray[i]);\r\n });\r\n }\r\n }\r\n }", "function renderButtons(){\n $(\"#recentCities\").empty();\n for (var i = 0; i < citiesList.length; i++){\n var a = $(\"<button>\");\n a.addClass(\"savedCity\");\n a.attr(\"data-name\", citiesList[i]);\n a.text(citiesList[i]);\n $(\"#recentCities\").append(a);\n }\n}", "function displayCity() {\n searches.empty();\n for (let i = 0; i < history.length; i++) {\n let pEl = $(\"<p>\").text(history[i]);\n pEl.addClass(\"cities\");\n searches.prepend(pEl);\n }\n //Added event listener using JQuery to the document to listen for clicks on the search history cities\n $(document).on('click', '.cities', e => {\n e.preventDefault();\n let city = $(this).text();\n console.log(city);\n // I believe my logic is correct but not sure why when I click one of the saved search history buttons it fails to grab the text value and use it to run the getWeather function or it grabs the text value of all the elements \n // getWeather(city);\n });\n }", "function searchButtons() {\n //check local storage to check for key (past searches)\n var buttonValueArray = JSON.parse(localStorage.getItem(\"citiesArr\"));\n console.log(buttonValueArray);\n //loop over the values in the array (the city names)\n $(\".previouslySearched\").empty();\n for (i= 0; i < buttonValueArray.length; i++){\n $(\".previouslySearched\").append($(\"<button class='btn border text-muted mt-1 shadow-sm bg-white rounded search-history' style='width: 100%;'>\").text(buttonValueArray[i]));\n }\n\n //Search using previously searched cities\n $(\".search-history\").click(function(e){\n e.preventDefault();\n var value = ($(this).text());\n console.log(value);\n getAPI(value);\n getFiveDayAPI(value);\n });\n \n }", "function loadCities() {\n $(\"#lastCities\").empty();\n for (var i = 0; i < city.length; i++) {\n var cityNewDiv = $(\"<button class= 'btn btn-dark load'>\");\n cityNewDiv.text(city[i]);\n $(\"#lastCities\").append(cityNewDiv);\n }\n}", "function renderBtn() {\n let searchHistory = $(\".search-history\");\n searchHistory.empty();\n for (let i = 0; i < btnArr.length; i++) {\n let historyBtn = $(\"<button>\").addClass(\"city-button\");\n // let removeBtn = $(\"<button>\").addClass(\"btn btn-danger mt-2 removeBtn\");\n let cityName = btnArr[i];\n historyBtn.text(cityName);\n historyBtn.attr(\"data-aos\", \"fade-down\");\n // removeBtn.text(\"Delete\");\n searchHistory.append(historyBtn);\n // searchHistory.append(removeBtn);\n }\n}", "function newSearch(){\n //Initializing relevant variables and all the different URLs for different Ajax calls\n let city;\n //Checking to make sure that there's no repeated entry\n for (k=0; k<cityCount.length;k++){\n if(search.val().toLowerCase() === cityCount[k]){\n search.val('');\n return;\n }\n }\n let newCityBtn = $(\"<li class='btn btn-outline-secondary text-left list-group-item' id='button' data-history='\" + count + \"'>\");\n //This conditional statement handles whether the click event comes from a new search term or just an older historic button\n if (search.val() !== \"\"){\n city = search.val();\n newCityBtn.text(city);\n cityCount = cityCount.concat(search.val().toLowerCase());\n count++;\n } else {\n city = $(this).text();\n }\n //URLs for 2 of my ajax requests\n let queryURL= \"https://api.openweathermap.org/data/2.5/weather?q=\" + city + \"&appid=f3e794b6f19299364c3a368c93f4e895\";\n let forecastURL = \"https://api.openweathermap.org/data/2.5/forecast?q=\" + city + \"&appid=f3e794b6f19299364c3a368c93f4e895\";\n $.ajax({\n url: queryURL,\n method: \"GET\",\n }).then(function(response){\n //Main display\n if (search.val() !== \"\"){\n btnHistory.append(newCityBtn);\n }\n search.val('');\n cityName.text(response.name + \" \" + currentTime);\n //Conversion from Kelvin\n let conversion = (response.main.temp - 273.15)*9/5 + 32;\n cityTemp.text(Math.floor(conversion) + \"°F\");\n cityHum.text(response.main.humidity + \"%\");\n cityWind.text(response.wind.speed);\n let latitude = response.coord.lat;\n let longitude = response.coord.lon;\n let uvURL = \"https://api.openweathermap.org/data/2.5/uvi?appid=f3e794b6f19299364c3a368c93f4e895&lat=\" + latitude + \"&lon=\"+ longitude;\n //Making an ajax request for the UV index\n $.ajax({\n url: uvURL,\n method: \"GET\",\n }).then(function(res){\n cityUV.text(res.value);\n if (res.value <= 4){\n cityUV.attr(\"class\", \"bg-success rounded\");\n }else if (4<res.value && res.value<=7){\n cityUV.attr(\"class\", \"bg-warning rounded\");\n }else if (7<res.value){\n cityUV.attr(\"class\", \"bg-danger rounded\");\n }\n });\n }).catch(function(err){\n // cityCount.splice(count, 1);\n // count--;\n search.val('');\n alert(\"Something went wrong!\");\n });\n //Above this line exists an exception for errors caught\n //Emptying the Deck for next iteration\n cardDeck.empty();\n $.ajax({\n url: forecastURL,\n method: \"GET\"\n }).then(function(forecast){\n for (i=0; i<5;i++){\n let j=(i*7) + i;\n //Calling all variables foor the dynamically generated 5 day Forecast Cards\n let newCityCard = $(\"<div class = 'card text-white bg-primary' style = 'max-width: 18rem;'>\");\n let newCardBody = $(\"<div class = 'card-body'>\");\n let cardDate = $(\"<h5 class = 'card-title'>\");\n let cardIcon;\n let cardIconCloudSun = $(\"<p class = 'card-text text-center'><i class='fas fa-cloud-sun'>\");\n let cardIconSun = $(\"<p class='card-text text-center'><i class='fas fa-sun'>\");\n let cardIconRain = $(\"<p class='card-text text-center'><i class='fas fa-cloud-showers-heavy'>\");\n let cardIconCloud = $(\"<p class='card-text text-center'><i class='fas fa-cloud'>\");\n let cardIconCloudSunRain = $(\"<p class='card-text text-center'><i class='fas fa-cloud-sun-rain'>\");\n let cardIconSnow = $(\"<p class='card-text text-center'><i class='fas fa-snowflake'>\");\n let classifier = forecast.list[j].weather[0].main;\n let cardTemp = $(\"<p class = 'card-text'>\");\n let cardHum = $(\"<p class = 'card-text'>\");\n //Modifying all variables with the information from the ajax request\n cardDate.text(forecast.list[j].dt_txt);\n //statements that determine the icon used\n if (classifier === \"Clear\"){\n cardIcon = cardIconSun;\n } else if (classifier === \"Atmosphere\"){\n cardIcon = cardIconCloudSun;\n } else if (classifier === \"Clouds\"){\n cardIcon = cardIconCloud;\n } else if (classifier === \"Rain\" || classifier === \"Thunderstorm\"){\n cardIcon = cardIconRain;\n } else if (classifier === \"Snow\"){\n cardIcon = cardIconSnow;\n } else {\n cardIcon = cardIconCloudSunRain;\n }\n //conversion from Kelvin\n let toF = (forecast.list[j].main.temp - 273.15)*9/5 +32;\n cardTemp.text(\"Temp: \" + Math.floor(toF) + \" °F\");\n cardHum.text(\"Humidity: \" + forecast.list[j].main.humidity + \"%\");\n // Appending everything to its appropriate location\n newCardBody.append(cardDate);\n newCardBody.append(cardIcon);\n newCardBody.append(cardTemp);\n newCardBody.append(cardHum);\n newCityCard.append(newCardBody);\n cardDeck.append(newCityCard)\n }\n });\n}", "function loadSearches() {\n var loadSearches = localStorage.getItem(\"searchedCities\");\n if (loadSearches == null || loadSearches == \"\") {\n return;\n }\n citySearches = JSON.parse(loadSearches)\n for (var i = 0; i < citySearches.length; i++){\n var btnDiv = $(\".searched-cities\");\n var btn = $(\"<button>\");\n btn.addClass(\"btn btn-secondary mx-3 btn-block\");\n btn.html(citySearches[i]);\n btnDiv.prepend(btn);\n btn.click(function (event) {\n var city = $(this).html();\n console.log(\"button click: \" + city);\n });\n }\n }", "function renderButtons() {\n $(\"#buttons-go-here\").empty()\n for (var i = 0; i < locations.length; i++) {\n var a = $(\"<button>\");\n a.addClass(\"show\");\n a.addClass(\"cityButton\")\n a.addClass(\"btn btn-light btn-lg btn-3d btn-round\")\n a.attr(\"data-show\", locations[i].geoid);\n a.attr(\"data-name\", locations[i].namecode);\n a.attr(\"data-long\", locations[i].long);\n a.attr(\"data-lat\", locations[i].lat)\n a.attr(\"data-img\", locations[i].img)\n a.text(locations[i].cityName);\n $(\"#buttons-go-here\").append(a);\n }\n}", "function renderCityList() {\n\n $(\"#cityList\").empty();\n\n //create a list element for the cityArray to display\n for (var i = 0; i < cityArray.length; i++) {\n //variable for array position\n var cityPos = cityArray[i];\n\n //dynamically create list for cities with a data-index\n var li = $(\"<li style = 'padding-bottom: 5px;'>\").attr(\"data-index\", i);\n\n //dynamically create buttons and text is the city name\n var button = $(\"<button class = 'button cityBtn is-rounded is-danger'>\").text(cityPos);\n\n //append a button on the list item\n li.append(button);\n $(\"#cityList\").append(li);\n\n };\n}", "function newCity(event) {\n event.preventDefault();\n let apiKey = \"a2a7f7242429e80a0db4ffb6350fdb5e\";\n let city = document.querySelector(\"#city-input\").value;\n let apiUrl =\n `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}&units=metric`;\n\n axios.get(apiUrl).then(showWeather);\n\n apiUrl = `https://api.openweathermap.org/data/2.5/onecall?q=${city}&exclude=minutely,hourly,alerts&appid=${apiKey}&units=metric`;\n axios.get(apiUrl).then(showForecast);\n}", "function createButton(name) {\n //Create an input type dynamically.\n var element = document.createElement(\"div\");\n //Assign different attributes to the element.\n element.classList.add(\"card\");\n element.classList.add(\"col-lg-4\");\n element.onclick = function() { // Note this is a function\n //alert(name[0].Name);\n managerOfPolygon.selectPolygon(name[0].Name);\n };\n var image = document.createElement(\"img\");\n image.src=\"/images/shops/\"+name[0].Logo;\n image.classList.add(\"card-img-top\");\n image.classList.add(\"shop\");\n element.appendChild(image);\n var titlediv = document.createElement(\"div\");\n titlediv.classList.add(\"card-body\");\n var title = document.createElement(\"h5\");\n title.innerHTML = name[0].Name;\n titlediv.appendChild(title);\n element.appendChild(titlediv);\n var foo = document.getElementById(\"shops\");\n\n //Append the element in page (in span).\n foo.appendChild(element);\n}", "function renderCities(){\n console.log(\"render function called\"); \nlistEL.empty();\nif(JSON.parse(localStorage.getItem(\"cities\")))\n{\n//looping thru the city array to display each city\nfor(var i=0;i<cityList.length;i++)\n{\n var button = $(\"<button>\");\n button.addClass(\"city\")\n button.attr(\"data-name\",cityList[i]);\nbutton.text(cityList[i]);\nlistEL.append(button);\n}\n}\n\n}", "function displayWeatherButton() {\n document.getElementById(\"btn btn-light\").innerHTML = getResults(searchbox.value);\n}", "function renderButtons(ourCities) {\n $(\".sideBar\").empty();\n for (let k = 0; k < ourCities.length; k++) {\n var pastCity = $(\"<button>\", { \"class\": \"row pastCity\", \"id\": `${ourCities[k]}` }).text(ourCities[k]);\n $(\".sideBar\").append(pastCity);\n }\n}", "function submitFunction() {\n var cartoon = $('<button type=\"button\" class=\"border-white btnClass btn btn-dark p-2 mt-1 mr-1 ml-1 float-left\">').text(input.val());\n cartoon.attr('data-name', input.val());\n btnHolder.append(cartoon);\n input.val(\" \");\n }", "function renderCities () {\n // Removes all previous <li>s as to not render them twice\n $('#rec-search').html(\"\")\n // Create HTML elements and send to DOM, then call checkList()\n for (let i = 0; i < recCities.length; i++) {\n var newCity = $('<li>')\n newCity.prepend($('<button>').addClass('btn btn-secondary').text(recCities[i]));\n $('#rec-search').prepend(newCity);\n // console.dir($('#rec-search').children()); \n checkList();\n } \n }", "function createSearch() {\n let createInput = document.createElement(\"input\");\n let createButton = document.createElement(\"button\");\n createInput.type = \"search\";\n createInput.className = \"student-search\";\n createInput.placeholder = \"Search for students...\";\n createInput.id = \"input\";\n createButton.textContent = \"Search\";\n createButton.className = \"student-search\";\n createButton.id = \"search\";\n $pageHeader.appendChild(createInput);\n createInput.after(createButton);\n}", "function renderSavedSearch() {\n searchHistoryEl.innerHTML = \"\";\n var inputData = JSON.parse(localStorage.getItem(\"cityInput\")) || [];\n console.log(inputData);\n inputData.forEach(function (citySearched) {\n var cityBtn = document.createElement(\"button\");\n cityBtn.classList.add(\"recent-searches\");\n searchHistoryEl.appendChild(cityBtn);\n cityBtn.textContent = citySearched;\n cityBtn.addEventListener(\"click\", function (event) {\n event.preventDefault();\n getWeather(event.target.textContent);\n });\n });\n}", "function addcity() {\n if (!inuse) {\n let cell = document.getElementById(\"addcell2\");\n cell.innerHTML = \"<form action='adminaccountaction.php' method='post'>Entrez le nom du village :<br><br><input type='hidden' name='action' value='addcity'><input type='text' name='city'><br><br><input class='editbutton' type='submit' value='Valider'></form>\";\n inuse = true;\n }\n}", "function renderButtons(cityList) {\n // Erase current city buttons\n var cityHistory = $(\"#city-history\");\n cityHistory.html(\"\");\n \n // render buttons for all cities in the cityList\n if (cityList) {\n for (let i = 0; i < cityList.length; i++) {\n // Create button\n let button = $(\"<button>\");\n button.attr(\"class\", \"city-button\");\n button.attr(\"data-name\", cities[i]);\n // Add text to button\n button.text(cityList[i]);\n // Add button to cityHistory\n cityHistory.prepend(button);\n }\n }\n}" ]
[ "0.78553957", "0.7825736", "0.763286", "0.75950134", "0.75568724", "0.7497093", "0.7391449", "0.7385075", "0.73447865", "0.7334902", "0.7242455", "0.7230919", "0.72066313", "0.716309", "0.70412064", "0.7033622", "0.7025236", "0.699126", "0.6982093", "0.6968694", "0.69606197", "0.6922263", "0.6890864", "0.6841905", "0.6827833", "0.68229526", "0.68046236", "0.68040735", "0.67839414", "0.6779177", "0.6758425", "0.67180127", "0.67045224", "0.6685767", "0.6682961", "0.66744244", "0.66689247", "0.66665685", "0.6659087", "0.6645816", "0.6635334", "0.66090035", "0.66031283", "0.66029143", "0.65710884", "0.65641296", "0.65602654", "0.65374887", "0.6493741", "0.6492266", "0.6488989", "0.6450326", "0.6447653", "0.644124", "0.6397974", "0.63940805", "0.6393724", "0.63737327", "0.63580203", "0.6353239", "0.63528675", "0.63454", "0.632935", "0.6312758", "0.63114196", "0.6301927", "0.6291624", "0.62889785", "0.627996", "0.6274077", "0.6259314", "0.6257796", "0.6256455", "0.6250327", "0.6240279", "0.62052983", "0.6188961", "0.61724186", "0.6167962", "0.6158082", "0.61577004", "0.6151803", "0.61354566", "0.6133576", "0.6131998", "0.61227757", "0.6102224", "0.6091434", "0.6090348", "0.60683507", "0.6064458", "0.60621995", "0.6061502", "0.6057289", "0.60510504", "0.60408795", "0.60318255", "0.60259813", "0.60208154", "0.60187906" ]
0.7926703
0
Helper function to allow the creation of anonymous functions which do not have .name set to the name of the variable being assigned to.
function identity(fn) { return fn; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function funcName(func) {\n return func.name || \"{anonymous}\"\n }", "function creaClosure(name) {\n return function () {\n console.log(name);\n }\n}", "function nom(fun) {\n var src = fun.toString();\n src = src.substr('function '.length);\n var n = src.substr(0, src.indexOf('('));\n\n if (!_.isFunction(fun)) fail(\"Cannot derive the name of a non-function.\");\n if (fun.name && (fun.name === n)) return fun.name;\n if (n) return n;\n fail(\"Anonymous function has no name.\");\n }", "function deanonymize(o, name) {\n name = name || 'named'\n if (o) {\n const keys = Object.keys(o)\n keys.forEach(key => {\n if (typeof o[key] == 'function') {\n o[key][name] = key\n }\n })\n return keys\n } else {\n return []\n }\n}", "function AnyName() {}", "function unexpectedIdent(name){\r\n return function(scope, state, k){\r\n return k({ast: null, success: false, expecting: {unexpected: scope[name]}});\r\n };\r\n}", "function example5() {\n\n function a() {} // a.name === 'a'\n\n var z = function b() {}; // b.name === 'b'\n\n //smart name assigning\n\n var c = function c() {};\n console.log(c.name); // c\n\n var user = {\n sayHi: function sayHi() {} //sayHi.name === 'sayHi'\n };\n}", "function createFn() {\n return function (a) {};\n}", "function makeEmptyFunction(arg){return function(){return arg;};}", "function makeEmptyFunction(arg){return function(){return arg;};}", "function makeEmptyFunction(arg){return function(){return arg;};}", "function makeEmptyFunction(arg){return function(){return arg;};}", "function makeEmptyFunction(arg){return function(){return arg;};}", "function makeEmptyFunction(arg){return function(){return arg;};}", "function _anon(f) { return function() { f.apply(this, arguments); }; }", "function makeFunc() {\r\n var name = \"Mozilla\";\r\n function displayName() {\r\n alert(name);\r\n console.log(name)\r\n }\r\n return displayName;\r\n }", "function makeFunc() {\n var name = 'Mozilla';\n function displayName() {\n console.log('Closure Example 2: ', name);\n }\n return displayName;//being returned from makeFunc() without being executed. \n}", "function name() {}", "function v(){return function(){}}", "function a() {\n let name = 'Eugene';\n return function() {\n console.log(name)\n }\n}", "function n(e){return function(){return e}}", "function unexpected(name){\r\n return function(scope, state, k){\r\n return k({ast: null, success: false, expecting: {unexpected: name}});\r\n };\r\n}", "function myName(firstName, lastName) {\n var greeting = 'Hello';\n return firstName + lastName;\n function closure() {\n return greeting + firstName + lastName;\n }\n}", "function myFunc(){\n var name = naresh;\n function displayName(){\n alert(name);\n }\n return displayName;\n}", "function closureOfYourOwnCreation() {\n let name = \"Russ\";\n function greetme() {\n return \"my name is \" + name;\n };\n return greetme();\n}", "function makeFunc() {\n\tvar name = \"Andrew\";\n\n\tfunction displayName() {\n\t\talert(name);\n\t}\n\n\treturn displayName;\n}", "function foo() {\n\tvar name = 'mike'\n\tfunction bar() {\n\t\tconsole.log(name)\n\t}\n}", "function seeClosure(x) {\n var x;\n return function(y) {\n return x * y\n }\n}", "function makeClosure(name) {\n return function description() {\n console.log(\"A person named \" + name);\n }\n}", "function someonesNumber(name){\n let num = 0;\n\n return function(numTwo){\n num = numTwo;\n return `${name}'s number is ${num}`;\n }\n}", "function invalid identifier () {}", "__init2() {this.noAnonFunctionType = false}", "function dummy() {}", "function dummy() {}", "function dummy() {}", "function makefunc(x) {\r\n// return function() { return x; }\r\n// return new Function($direct_func_xxx$);\r\n return new Function(\"return x;\")\r\n}", "function funcname(f) {\n const s = f.toString().match(/function (\\w*)/)[1];\n if ((s === null) || (s.length === 0)){ return \"~anonymous~\";}\n return s;\n}", "function makeFunc() {\n var name = \"Mozilla\";\n function displayName() {\n console.log(name);\n }\n return displayName;\n}", "function sanitize (val) {\n if (!val || typeof val !== 'object') return;\n\n Object.keys(val)\n .filter(key => typeof val[key] === 'function')\n .forEach(key => {\n val[key] = (val[key].name.trim() || 'anonymous') + ' function';\n });\n }", "function dummy(){}", "function dummy(){}", "function dummy(){}", "function myFunction(x) {\n var outerVariable = x;\n return function() {\n console.log(outerVariable);\n };\n}", "function aa() {\n return function() {}\n }", "function wrapper(name) {\n\t return (new Function([\n\t 'return function '+name+'() {',\n\t ' return this._'+name,\n\t '}'\n\t ].join('\\n')))()\n\t}", "function f() {\n (function () {\n x;\n function a() {}\n print(a)\n })()\n}", "function emptyFn() {\n return function () {};\n }", "function f(\n sayHi = function() {\n console.log('noor');\n }\n) {\n console.log(sayHi.name, sayHi());\n}", "function g(){return function(){}}", "function NewNew1(x) {\n function f() {\n // snatch 'x' from closure\n this.x = x;\n }\n f.prototype = { 'name': 'NewNew2' };\n return f;\n}", "function wrapper(name) {\n return (new Function([\n 'return function '+name+'() {',\n ' return this._'+name,\n '}'\n ].join('\\n')))()\n}", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "function identify(m){\n return function(){\n return m;\n }\n}", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n }", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n }", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n }", "function outer(){\n let name =\"saurav\";\n function displayName(){\n return name;\n }\n return displayName;\n}", "function fooB() {\n var barB = 'barB';\n\n // returning anonymous function\n return function() {\n console.log(barB);\n };\n}", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n }", "function makeFunc() {\n var name = 'Mozilla';\n function displayName() {\n console.log(name);\n }\n return displayName; //note we are returning the displayName function before executing it (this is called a CLOSURE)\n}", "function name(first, last) {\n return function () {\n return first + last;\n }\n}", "function makeEmptyFunction(arg) {\r\n\t return function () {\r\n\t return arg;\r\n\t };\r\n\t}", "function makeEmptyFunction(arg) {\n\t return function () {\n\t return arg;\n\t };\n\t }", "function wrapper(name) {\n return (new Function([\n 'return function ' + name + '() {',\n ' return this._' + name,\n '}'\n ].join('\\n')))()\n }", "function exprNotEquals(varName, node) {\r\n return function(sol) {\r\n return !node.equals(sol[var2Attr(varName)]);\r\n }\r\n}", "function makeEmptyFunction(arg) {\n\t\t\t\t\treturn function () {\n\t\t\t\t\t\treturn arg;\n\t\t\t\t\t};\n\t\t\t\t}", "function makeEmptyFunction(arg) {\n return function() {\n return arg;\n };\n }", "function f1(func) {\n func(\"hello anonymous function\");\n}", "function funname() {} //literals", "function makeEmptyFunction(arg) {\n return function() {\n return arg;\n };\n }", "function makeEmptyFunction(arg) {\n return function() {\n return arg;\n };\n }", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n }", "function x(t){return\"function\"==typeof t?t:function(){return t}}", "function exprNotEquals(varName, node) {\n return function(sol) {\n return !node.equals(sol[var2Attr(varName)]);\n }\n}", "function makeEmptyFunction(arg) {\n\t\t\t return function () {\n\t\t\t return arg;\n\t\t\t };\n\t\t\t}", "function makeKiaOra(name) {\n return function() {\n console.log('KiaOra, ' + name)\n }\n}", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}", "function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}" ]
[ "0.6230304", "0.61239725", "0.6084594", "0.60710484", "0.5986077", "0.58369416", "0.57288766", "0.5704563", "0.56906456", "0.56906456", "0.56906456", "0.56906456", "0.56906456", "0.56906456", "0.56852525", "0.5667304", "0.56588256", "0.56499326", "0.5611372", "0.55936", "0.55860525", "0.5585753", "0.55481637", "0.5531463", "0.55139756", "0.550743", "0.5503541", "0.5501273", "0.5499193", "0.5493812", "0.54845524", "0.54742384", "0.5470194", "0.5470194", "0.5470194", "0.5462963", "0.54625106", "0.5441759", "0.54246706", "0.5422849", "0.5422849", "0.5422849", "0.54211754", "0.54153514", "0.5415093", "0.5413231", "0.5411952", "0.5393482", "0.53925747", "0.53871185", "0.5380022", "0.5371955", "0.5364844", "0.5359216", "0.5359216", "0.5359216", "0.53561604", "0.5339262", "0.5324753", "0.5323019", "0.5321628", "0.53194976", "0.53144205", "0.5311438", "0.5310206", "0.53015083", "0.5301452", "0.5301019", "0.5300239", "0.52988935", "0.52988935", "0.5294503", "0.5281803", "0.5278368", "0.5273832", "0.5260707", "0.5259179", "0.5259179", "0.5259179", "0.5259179", "0.5259179", "0.5259179", "0.5259179", "0.5259179", "0.5259179", "0.5259179", "0.5259179", "0.5259179", "0.5259179", "0.5259179", "0.5259179", "0.5259179", "0.5259179", "0.5259179", "0.5259179", "0.5259179", "0.5259179", "0.5259179", "0.5259179", "0.5259179", "0.5259179" ]
0.0
-1
Mixin helper which handles policy validation and reserved specification keys when building React classes.
function mixSpecIntoComponent(Constructor, spec) { if (!spec) { if (process.env.NODE_ENV !== 'production') { var typeofSpec = typeof spec; var isMixinValid = typeofSpec === 'object' && spec !== null; if (process.env.NODE_ENV !== 'production') { warning( isMixinValid, "%s: You're attempting to include a mixin that is either null " + 'or not an object. Check the mixins included by the component, ' + 'as well as any mixins they include themselves. ' + 'Expected object but got %s.', Constructor.displayName || 'ReactClass', spec === null ? null : typeofSpec ); } } return; } _invariant( typeof spec !== 'function', "ReactClass: You're attempting to " + 'use a component class or function as a mixin. Instead, just use a ' + 'regular object.' ); _invariant( !isValidElement(spec), "ReactClass: You're attempting to " + 'use a component as a mixin. Instead, just use a regular object.' ); var proto = Constructor.prototype; var autoBindPairs = proto.__reactAutoBindPairs; // By handling mixins before any other properties, we ensure the same // chaining order is applied to methods with DEFINE_MANY policy, whether // mixins are listed before or after these methods in the spec. if (spec.hasOwnProperty(MIXINS_KEY)) { RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins); } for (var name in spec) { if (!spec.hasOwnProperty(name)) { continue; } if (name === MIXINS_KEY) { // We have already handled mixins in a special case above. continue; } var property = spec[name]; var isAlreadyDefined = proto.hasOwnProperty(name); validateMethodOverride(isAlreadyDefined, name); if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) { RESERVED_SPEC_KEYS[name](Constructor, property); } else { // Setup methods on prototype: // The following member methods should not be automatically bound: // 1. Expected ReactClass methods (in the "interface"). // 2. Overridden methods (that were mixed in). var isReactClassMethod = ReactClassInterface.hasOwnProperty(name); var isFunction = typeof property === 'function'; var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false; if (shouldAutoBind) { autoBindPairs.push(name, property); proto[name] = property; } else { if (isAlreadyDefined) { var specPolicy = ReactClassInterface[name]; // These cases should already be caught by validateMethodOverride. _invariant( isReactClassMethod && (specPolicy === 'DEFINE_MANY_MERGED' || specPolicy === 'DEFINE_MANY'), 'ReactClass: Unexpected spec policy %s for key %s ' + 'when mixing in component specs.', specPolicy, name ); // For methods which are defined more than once, call the existing // methods before calling the new property, merging if appropriate. if (specPolicy === 'DEFINE_MANY_MERGED') { proto[name] = createMergedResultFunction(proto[name], property); } else if (specPolicy === 'DEFINE_MANY') { proto[name] = createChainedFunction(proto[name], property); } } else { proto[name] = property; if (process.env.NODE_ENV !== 'production') { // Add verbose displayName to the function, which helps when looking // at profiling tools. if (typeof property === 'function' && spec.displayName) { proto[name].displayName = spec.displayName + '_' + name; } } } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_validate() {\n throw new Error('_validate not implemented in child class');\n }", "function jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}", "function jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}", "constructor() {\n super(...arguments);\n this.name = this.args.validation;\n this.parent = this.args.parent;\n\n if (this.args.parent === undefined) {\n if (this.args.alone) return; // if input is alone ignore\n\n throw new ConfigurationException(`Component '${this.constructor.name}' needs to have a 'BaseValidationFormComponent' instance as '@parent' , if you want this component without validation and parent use '@alone={{true}}' as argument to the input. Note that the validate() method will throw an error if called`);\n }else{\n if (this.parent.state.validationSchema === undefined) {\n throw new ConfigurationException(`Component '${this.constructor.name}' needs to have a 'BaseValidator' instance as '@schema' , if you want this component without validation and parent use '@alone={{true}}' as argument to the input. Note that the validate() method will throw an error if called`);\n }\n }\n\n if (!this.args.value && !this.args.selected) {\n // eslint-disable-next-line no-console\n console.warn(`Component '${this.constructor.name}' seems to have an undefined @validation attribute`);\n }\n\n if (!this.args.validation) {\n throw new ConfigurationException(`Component '${this.constructor.name}' needs to have a '@validation' attribute , if you want this component without validation and parent use '@alone={{true}}' as argument to the input. Note that the validate() method will throw an error if called`);\n }\n\n this.parent.registerChild(this);\n }", "function jsxWithValidationStatic(type, props, key) {\n return jsxWithValidation(type, props, key, true);\n }", "function jsxWithValidationStatic(type, props, key) {\n return jsxWithValidation(type, props, key, true);\n }", "function jsxWithValidationStatic(type, props, key) {\n return jsxWithValidation(type, props, key, true);\n}", "function jsxWithValidationStatic(type, props, key) {\n return jsxWithValidation(type, props, key, true);\n}", "function jsxWithValidationStatic(type, props, key) {\n return jsxWithValidation(type, props, key, true);\n}", "function jsxWithValidationStatic(type, props, key) {\n return jsxWithValidation(type, props, key, true);\n}", "function jsxWithValidationStatic(type, props, key) {\n return jsxWithValidation(type, props, key, true);\n}", "function jsxWithValidationStatic(type, props, key) {\n return jsxWithValidation(type, props, key, true);\n}", "function jsxWithValidationStatic(type, props, key) {\n return jsxWithValidation(type, props, key, true);\n}", "function jsxWithValidationStatic(type, props, key) {\n return jsxWithValidation(type, props, key, true);\n}", "function jsxWithValidationStatic(type, props, key) {\n return jsxWithValidation(type, props, key, true);\n}", "function jsxWithValidationStatic(type, props, key) {\n return jsxWithValidation(type, props, key, true);\n}", "function jsxWithValidationStatic(type, props, key) {\n return jsxWithValidation(type, props, key, true);\n}", "_validate(values) {\n const constraint = this.constructor.FORM_CONSTRAINT\n const result = validate(Object.assign({}, this.state, values), constraint)\n return result\n }", "checkValidity(context, event) {\n throw new Error('Implement in subclass');\n }", "checkValidity(context, event) {\n throw new Error('Implement in subclass');\n }", "required(cb) {\n const { path: lodashPath, fieldSchema: appModelPart, handlerSpec, userContext, modelSchema, row } = this;\n const { schemaName } = modelSchema;\n const val = vutil.getValue(row, appModelPart, lodashPath);\n const { type } = appModelPart;\n const isMultipleType = type.endsWith('[]');\n const isAssociativeArray = type === 'AssociativeArray';\n const isArray = type === 'Array';\n const isMixedType = type === 'Mixed';\n const isString = type === 'String';\n const isBoolean = type === 'Boolean';\n const isEmptyVal =\n _.isNil(val) ||\n (isString && val === '') ||\n ((isArray || isAssociativeArray || isMultipleType) && _.isEmpty(val)) ||\n (isMixedType && _.isNil(val)) ||\n (isBoolean && val === false); // this is not supposed (agreement)\n\n let isRequired;\n\n if (_.isBoolean(appModelPart.required)) {\n const pathToParent = lodashPath.split('.').slice(0, -1);\n // if lodashPath is of 1 length, i.e. in root then count as parent presented\n const isParentPresented = _.isEmpty(pathToParent) ? true : !!_.get(row, pathToParent);\n isRequired = isParentPresented && appModelPart.required;\n } else if (_.isString(appModelPart.required)) {\n try {\n const { action } = userContext;\n\n if (appModelPart.required.includes('this.')) {\n const { indexes, index, parentData } = getParentInfo(appLib.appModel.models[schemaName], row, lodashPath);\n const context = {\n path: lodashPath,\n data: val,\n row,\n fieldSchema: appModelPart,\n action,\n indexes,\n index,\n parentData,\n };\n const inlineCode = appLib.butil.getDefaultArgsAndValuesForInlineCode();\n isRequired = new Function(inlineCode.args, `return ${appModelPart.required}`).apply(\n context,\n inlineCode.values\n );\n } else {\n const requiredFunc = new Function('data, row, modelSchema, $action', `return ${appModelPart.required}`);\n isRequired = requiredFunc(val, row, appModelPart, action);\n }\n } catch (e) {\n return cb(\n `Error occurred during validating required field ${appModelPart.fullName} for condition ${appModelPart.required}`\n );\n }\n }\n\n if (isRequired && isEmptyVal) {\n cb(vutil.replaceErrorTemplatePlaceholders(schemaName, handlerSpec, val, row, lodashPath, appModelPart));\n } else {\n cb();\n }\n }", "especialRequired(json, requiredKey) {\n\t\tconst especial = {\n\t\t\t\"html\": true,\n\t\t\t\"button\": true,\n\t\t\t\"item\": true,\n\t\t\t\"status\": true,\n\t\t\t\"icon\": true,\n\t\t\t\"menu\": true,\n\t\t\t\"dropmenu\": true,\n\t\t\t\"dropmenubutton\": true,\n\t\t\t\"simpleform\": true,\n\t\t\t\"tree\": true,\n\t\t\t\"accordion\": true,\n\t\t\t\"grid\": true\n\t\t};\n\t\tfor (const key of Object.keys(json)) {\n\t\t\tif (especial[key] && typeof json[key] === 'object' && requiredKey === key) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}", "function checkRequiredProperties(className) {\n if (typeof className === 'undefined') {\n throw new Error('Class Name not provided');\n }\n }", "whenValid() {\n\n }", "async validateAttributes () {\n\t}", "function DiscardInvalidPolicy(){\n this.name = \"DiscardInvalidPolicy\";\n}", "_validate() {\n\t}", "function shim() {\n\t\t\t\t\t\tinvariant(false, 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');\n\t\t\t\t\t}", "validate(key, value) { // eslint-disable-line class-methods-use-this\n return value;\n }", "function classNameIsValid(className) {\n return (\n className === '_Card' ||\n className === '_Account' ||\n className === '_Role'\n );\n}", "getCustomProps() {\n const {\n id,\n name,\n helperText,\n label,\n outlined,\n filled,\n required,\n errorMessage,\n disabled,\n readOnly,\n } = this.props;\n\n const customProps = {};\n\n customProps.isDisabled = disabled;\n customProps.readOnly = readOnly;\n customProps.isRequired = required || this.isRequired(name);\n customProps.hasError = !!this.context.submitted && this.context.hasError(name);\n\n const errorText = customProps.hasError && this.context.getError(name, errorMessage);\n customProps.helperText = errorText || helperText || null;\n\n customProps.ariaHelper = `input_${name}`;\n\n customProps.id = id || customProps.ariaHelper;\n customProps.label = label;\n\n if (outlined) {\n customProps.variant = 'outlined';\n customProps.labelWidth = this.labelRef ? this.labelRef.offsetWidth : 0;\n } else if (filled) {\n customProps.variant = 'filled';\n }\n\n return customProps;\n }", "function mixSpecIntoComponent(Constructor, spec) {\n\t if (!spec) {\n\t return;\n\t }\n\t\n\t !(typeof spec !== 'function') ? ({\"AUTH0_CLIENT_ID\":\"vFL9QUjpiy8LmqgykJVXRhk7dYVvdEip\",\"AUTH0_DOMAIN\":\"edcheung.auth0.com\"}).NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\\'re attempting to use a component class or function as a mixin. Instead, just use a regular object.') : _prodInvariant('75') : void 0;\n\t !!ReactElement.isValidElement(spec) ? ({\"AUTH0_CLIENT_ID\":\"vFL9QUjpiy8LmqgykJVXRhk7dYVvdEip\",\"AUTH0_DOMAIN\":\"edcheung.auth0.com\"}).NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\\'re attempting to use a component as a mixin. Instead, just use a regular object.') : _prodInvariant('76') : void 0;\n\t\n\t var proto = Constructor.prototype;\n\t var autoBindPairs = proto.__reactAutoBindPairs;\n\t\n\t // By handling mixins before any other properties, we ensure the same\n\t // chaining order is applied to methods with DEFINE_MANY policy, whether\n\t // mixins are listed before or after these methods in the spec.\n\t if (spec.hasOwnProperty(MIXINS_KEY)) {\n\t RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);\n\t }\n\t\n\t for (var name in spec) {\n\t if (!spec.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t\n\t if (name === MIXINS_KEY) {\n\t // We have already handled mixins in a special case above.\n\t continue;\n\t }\n\t\n\t var property = spec[name];\n\t var isAlreadyDefined = proto.hasOwnProperty(name);\n\t validateMethodOverride(isAlreadyDefined, name);\n\t\n\t if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {\n\t RESERVED_SPEC_KEYS[name](Constructor, property);\n\t } else {\n\t // Setup methods on prototype:\n\t // The following member methods should not be automatically bound:\n\t // 1. Expected ReactClass methods (in the \"interface\").\n\t // 2. Overridden methods (that were mixed in).\n\t var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);\n\t var isFunction = typeof property === 'function';\n\t var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;\n\t\n\t if (shouldAutoBind) {\n\t autoBindPairs.push(name, property);\n\t proto[name] = property;\n\t } else {\n\t if (isAlreadyDefined) {\n\t var specPolicy = ReactClassInterface[name];\n\t\n\t // These cases should already be caught by validateMethodOverride.\n\t !(isReactClassMethod && (specPolicy === SpecPolicy.DEFINE_MANY_MERGED || specPolicy === SpecPolicy.DEFINE_MANY)) ? ({\"AUTH0_CLIENT_ID\":\"vFL9QUjpiy8LmqgykJVXRhk7dYVvdEip\",\"AUTH0_DOMAIN\":\"edcheung.auth0.com\"}).NODE_ENV !== 'production' ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.', specPolicy, name) : _prodInvariant('77', specPolicy, name) : void 0;\n\t\n\t // For methods which are defined more than once, call the existing\n\t // methods before calling the new property, merging if appropriate.\n\t if (specPolicy === SpecPolicy.DEFINE_MANY_MERGED) {\n\t proto[name] = createMergedResultFunction(proto[name], property);\n\t } else if (specPolicy === SpecPolicy.DEFINE_MANY) {\n\t proto[name] = createChainedFunction(proto[name], property);\n\t }\n\t } else {\n\t proto[name] = property;\n\t if (({\"AUTH0_CLIENT_ID\":\"vFL9QUjpiy8LmqgykJVXRhk7dYVvdEip\",\"AUTH0_DOMAIN\":\"edcheung.auth0.com\"}).NODE_ENV !== 'production') {\n\t // Add verbose displayName to the function, which helps when looking\n\t // at profiling tools.\n\t if (typeof property === 'function' && spec.displayName) {\n\t proto[name].displayName = spec.displayName + '_' + name;\n\t }\n\t }\n\t }\n\t }\n\t }\n\t }\n\t}", "render () {\n return (\n <div>\n <input type = { this.props.input.type }\n name = { this.props.input.name }\n autoFocus = { this.props.input.autoFocus }\n value = { this.props.input.value }\n autoComplete = { this.props.input.autoComplete}\n maxLength = { this.props.input.maxLength }\n size = { this.props.input.size }\n pattern = { this.props.input.pattern }\n placeholder = { this.props.input.placeholder}\n autoCapitalize = { this.props.input.autoCapitalize}\n onChange = { this.onChange }\n className = { this.props.input.className }\n id = { this.props.input.id }\n accessKey = { this.props.input.accessKey }\n contentEditable = { this.props.input.contentEditable}\n dir = { this.props.input.dir }\n draggable = { this.props.input.draggable }\n lang = { this.props.input.lang }\n style = { this.props.input.style }\n title = { this.props.input.title }\n required = { this.props.input.required }\n disabled = { this.props.input.disabled }\n readOnly = { this.props.input.readOnly }\n hidden = { this.props.input.hidden }\n min = { this.props.input.min }\n max = { this.props.input.max }\n // checked = { this.props.input.checked }\n defaultChecked = { this.props.input.defaultChecked}\n\n />\n {this.props.input.content}\n </div>\n )\n }", "isRequired() {\n return false;\n }", "function mixSpecIntoComponent(Constructor,spec){if(!spec){return;}\"production\"!==process.env.NODE_ENV?invariant(typeof spec!=='function','ReactClass: You\\'re attempting to '+'use a component class as a mixin. Instead, just use a regular object.'):invariant(typeof spec!=='function');\"production\"!==process.env.NODE_ENV?invariant(!ReactElement.isValidElement(spec),'ReactClass: You\\'re attempting to '+'use a component as a mixin. Instead, just use a regular object.'):invariant(!ReactElement.isValidElement(spec));var proto=Constructor.prototype; // By handling mixins before any other properties, we ensure the same\n// chaining order is applied to methods with DEFINE_MANY policy, whether\n// mixins are listed before or after these methods in the spec.\nif(spec.hasOwnProperty(MIXINS_KEY)){RESERVED_SPEC_KEYS.mixins(Constructor,spec.mixins);}for(var name in spec){if(!spec.hasOwnProperty(name)){continue;}if(name===MIXINS_KEY){ // We have already handled mixins in a special case above\ncontinue;}var property=spec[name];validateMethodOverride(proto,name);if(RESERVED_SPEC_KEYS.hasOwnProperty(name)){RESERVED_SPEC_KEYS[name](Constructor,property);}else { // Setup methods on prototype:\n// The following member methods should not be automatically bound:\n// 1. Expected ReactClass methods (in the \"interface\").\n// 2. Overridden methods (that were mixed in).\nvar isReactClassMethod=ReactClassInterface.hasOwnProperty(name);var isAlreadyDefined=proto.hasOwnProperty(name);var markedDontBind=property&&property.__reactDontBind;var isFunction=typeof property==='function';var shouldAutoBind=isFunction&&!isReactClassMethod&&!isAlreadyDefined&&!markedDontBind;if(shouldAutoBind){if(!proto.__reactAutoBindMap){proto.__reactAutoBindMap={};}proto.__reactAutoBindMap[name]=property;proto[name]=property;}else {if(isAlreadyDefined){var specPolicy=ReactClassInterface[name]; // These cases should already be caught by validateMethodOverride\n\"production\"!==process.env.NODE_ENV?invariant(isReactClassMethod&&(specPolicy===SpecPolicy.DEFINE_MANY_MERGED||specPolicy===SpecPolicy.DEFINE_MANY),'ReactClass: Unexpected spec policy %s for key %s '+'when mixing in component specs.',specPolicy,name):invariant(isReactClassMethod&&(specPolicy===SpecPolicy.DEFINE_MANY_MERGED||specPolicy===SpecPolicy.DEFINE_MANY)); // For methods which are defined more than once, call the existing\n// methods before calling the new property, merging if appropriate.\nif(specPolicy===SpecPolicy.DEFINE_MANY_MERGED){proto[name]=createMergedResultFunction(proto[name],property);}else if(specPolicy===SpecPolicy.DEFINE_MANY){proto[name]=createChainedFunction(proto[name],property);}}else {proto[name]=property;if(\"production\"!==process.env.NODE_ENV){ // Add verbose displayName to the function, which helps when looking\n// at profiling tools.\nif(typeof property==='function'&&spec.displayName){proto[name].displayName=spec.displayName+'_'+name;}}}}}}}", "constructor() {\n this.requirements = {};\n this.extensions = {};\n \n this.event_opcodes = ['event_whenflagclicked', 'event_whenthisspriteclicked','event_whenbroadcastreceived','event_whenkeypressed', 'event_whenbackdropswitchesto','event_whengreaterthan'];\n }", "function validateType (instance, element) {\n var type;\n var types = {};\n var restrictions = {};\n\n types[skate.types.ATTR] = 'an attribute';\n types[skate.types.CLASS] = 'a class';\n types[skate.types.TAG] = 'a tag';\n\n restrictions[skate.types.ATTR] = 'attributes';\n restrictions[skate.types.CLASS] = 'classes';\n restrictions[skate.types.NOTAG] = 'attributes or classes';\n restrictions[skate.types.TAG] = 'tags';\n\n if (element.tagName.toLowerCase() === instance.id) {\n type = skate.types.TAG;\n } else if (element.hasAttribute(instance.id)) {\n type = skate.types.ATTR;\n } else if (element.className.split(' ').indexOf(instance.id) > -1) {\n type = skate.types.CLASS;\n }\n\n if (instance.component.type.indexOf(type) === -1) {\n throw new Error('Component \"' + instance.id + '\" was bound using ' + types[type] + ' and is restricted to using ' + restrictions[instance.component.type] + '. Element: ' + outerHtml(element));\n }\n }", "constructor(name, args, opts) {\n let inputs = {};\n opts = opts || {};\n if (!opts.id) {\n if ((!args || args.azureHybridUseBenefit === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'azureHybridUseBenefit'\");\n }\n if ((!args || args.azureLocation === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'azureLocation'\");\n }\n if ((!args || args.azureOfferCode === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'azureOfferCode'\");\n }\n if ((!args || args.azurePricingTier === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'azurePricingTier'\");\n }\n if ((!args || args.azureStorageRedundancy === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'azureStorageRedundancy'\");\n }\n if ((!args || args.currency === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'currency'\");\n }\n if ((!args || args.discountPercentage === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'discountPercentage'\");\n }\n if ((!args || args.groupName === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'groupName'\");\n }\n if ((!args || args.percentile === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'percentile'\");\n }\n if ((!args || args.projectName === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'projectName'\");\n }\n if ((!args || args.resourceGroupName === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'resourceGroupName'\");\n }\n if ((!args || args.scalingFactor === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'scalingFactor'\");\n }\n if ((!args || args.stage === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'stage'\");\n }\n if ((!args || args.timeRange === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'timeRange'\");\n }\n inputs[\"assessmentName\"] = args ? args.assessmentName : undefined;\n inputs[\"azureHybridUseBenefit\"] = args ? args.azureHybridUseBenefit : undefined;\n inputs[\"azureLocation\"] = args ? args.azureLocation : undefined;\n inputs[\"azureOfferCode\"] = args ? args.azureOfferCode : undefined;\n inputs[\"azurePricingTier\"] = args ? args.azurePricingTier : undefined;\n inputs[\"azureStorageRedundancy\"] = args ? args.azureStorageRedundancy : undefined;\n inputs[\"currency\"] = args ? args.currency : undefined;\n inputs[\"discountPercentage\"] = args ? args.discountPercentage : undefined;\n inputs[\"eTag\"] = args ? args.eTag : undefined;\n inputs[\"groupName\"] = args ? args.groupName : undefined;\n inputs[\"percentile\"] = args ? args.percentile : undefined;\n inputs[\"projectName\"] = args ? args.projectName : undefined;\n inputs[\"resourceGroupName\"] = args ? args.resourceGroupName : undefined;\n inputs[\"scalingFactor\"] = args ? args.scalingFactor : undefined;\n inputs[\"stage\"] = args ? args.stage : undefined;\n inputs[\"timeRange\"] = args ? args.timeRange : undefined;\n inputs[\"createdTimestamp\"] = undefined /*out*/;\n inputs[\"monthlyBandwidthCost\"] = undefined /*out*/;\n inputs[\"monthlyComputeCost\"] = undefined /*out*/;\n inputs[\"monthlyStorageCost\"] = undefined /*out*/;\n inputs[\"name\"] = undefined /*out*/;\n inputs[\"numberOfMachines\"] = undefined /*out*/;\n inputs[\"pricesTimestamp\"] = undefined /*out*/;\n inputs[\"status\"] = undefined /*out*/;\n inputs[\"type\"] = undefined /*out*/;\n inputs[\"updatedTimestamp\"] = undefined /*out*/;\n }\n else {\n inputs[\"azureHybridUseBenefit\"] = undefined /*out*/;\n inputs[\"azureLocation\"] = undefined /*out*/;\n inputs[\"azureOfferCode\"] = undefined /*out*/;\n inputs[\"azurePricingTier\"] = undefined /*out*/;\n inputs[\"azureStorageRedundancy\"] = undefined /*out*/;\n inputs[\"createdTimestamp\"] = undefined /*out*/;\n inputs[\"currency\"] = undefined /*out*/;\n inputs[\"discountPercentage\"] = undefined /*out*/;\n inputs[\"eTag\"] = undefined /*out*/;\n inputs[\"monthlyBandwidthCost\"] = undefined /*out*/;\n inputs[\"monthlyComputeCost\"] = undefined /*out*/;\n inputs[\"monthlyStorageCost\"] = undefined /*out*/;\n inputs[\"name\"] = undefined /*out*/;\n inputs[\"numberOfMachines\"] = undefined /*out*/;\n inputs[\"percentile\"] = undefined /*out*/;\n inputs[\"pricesTimestamp\"] = undefined /*out*/;\n inputs[\"scalingFactor\"] = undefined /*out*/;\n inputs[\"stage\"] = undefined /*out*/;\n inputs[\"status\"] = undefined /*out*/;\n inputs[\"timeRange\"] = undefined /*out*/;\n inputs[\"type\"] = undefined /*out*/;\n inputs[\"updatedTimestamp\"] = undefined /*out*/;\n }\n if (!opts.version) {\n opts = pulumi.mergeOptions(opts, { version: utilities.getVersion() });\n }\n const aliasOpts = { aliases: [{ type: \"azure-nextgen:migrate/v20171111preview:Assessment\" }, { type: \"azure-native:migrate/v20180202:Assessment\" }, { type: \"azure-nextgen:migrate/v20180202:Assessment\" }] };\n opts = pulumi.mergeOptions(opts, aliasOpts);\n super(Assessment.__pulumiType, name, inputs, opts);\n }", "function CapitalRequired2(secondatrributes){ \n CapitalRequired.call(this, secondatrributes); // THIS IS EXPLICIT.\n //something new would go here. \n }", "render() {\n return (\n <div className=\"BorderBoxSubrouting\">\n Hello {this.props.name}\n <div className={this.defaultParams() ? '' : 'babel-error'}>\n Default parameters work: {this.defaultParams().toString()}\n </div>\n <div className={this.restParams() ? '' : 'babel-error'}>\n Rest parameters work: {this.restParams().toString()}\n </div>\n <div className={this.spreadOperator() ? '' : 'babel-error'}>\n Spread Operator works for array and objects (obj needs stage 2): {this.spreadOperator().toString()}\n </div>\n <div className={this.templateLiteralString() ? '' : 'babel-error'}>\n Template literal string works: {this.templateLiteralString().toString()}\n </div>\n <div className={this.objectDestructuring() ? '' : 'babel-error'}>\n Object destructuring works: {this.objectDestructuring().toString()}\n </div>\n <div className={this.arrayDestructuring() ? '' : 'babel-error'}>\n Array destructuring works: {this.arrayDestructuring().toString()}\n </div>\n <div className={this.enhancedObjectLiterals() ? '' : 'babel-error'}>\n Enhanced Object Literals work: {this.enhancedObjectLiterals().toString()}\n </div>\n <div className={this.arrowFunctions() ? '' : 'babel-error'}>\n Arrow functions: {this.arrowFunctions().toString()}\n </div>\n <div className={this.promises() ? '' : 'babel-error'}>Promises work: {this.promises().toString()}</div>\n <div className={this.letKeyword() ? '' : 'babel-error'}>\n 'let' keywork works: {this.letKeyword().toString()}\n </div>\n <div className={this.isInteger() ? '' : 'babel-error'}>\n Number.isInteger works: {this.isInteger().toString()}\n </div>\n <div className={this.stringIncludes() ? '' : 'babel-error'}>\n String.prototype.includes works: {this.stringIncludes().toString()}\n </div>\n <div className={this.forOf() ? '' : 'babel-error'}>For of works: {this.forOf().toString()}</div>\n <div className={this.maps() ? '' : 'babel-error'}>Maps work: {this.maps().toString()}</div>\n <div className={this.sets() ? '' : 'babel-error'}>Sets work: {this.sets().toString()}</div>\n <div className={this.arrayFrom() ? '' : 'babel-error'}>Array.from() works: {this.arrayFrom().toString()}</div>\n <div className={this.arrayIncludes() ? '' : 'babel-error'}>\n Array.prototype.includes works: {this.arrayIncludes().toString()}\n </div>\n <div className={this.exponentiation() ? '' : 'babel-error'}>\n Exponentiation operator works: {this.exponentiation().toString()}\n </div>\n <div className={this.state.asyncAwaitWorks ? '' : 'babel-error'}>\n Async await: check console for AsyncAwait errors\n </div>\n <div className={this.objectValues() ? '' : 'babel-error'}>\n Object.values works: {this.objectValues().toString()}\n </div>\n </div>\n );\n }", "function buildRequiredCheckboxValidation($formField,validation){var formFieldId=$formField.attr('id');var primarySelector='#'+formFieldId+' input:first-of-type';var secondarySelector='#'+formFieldId+' input';return{selector:primarySelector,triggeredBy:secondarySelector,validate:function validate(cb){var result=false;__WEBPACK_IMPORTED_MODULE_0_jquery___default()(secondarySelector).each(function(index,checkbox){if(checkbox.checked){result=true;return false}});cb(result)},errorMessage:'The \\''+validation.label+'\\' field cannot be blank.'}}", "handleValidation (event, status, error) {\n if (!event) {\n return\n }\n\n let codes = super.mergeError(this.state.errorCodes, super.flattenObject(error))\n let complexStatus = null\n if (codes.length > 0) {\n complexStatus = false\n } else if (this.isValid()) {\n complexStatus = true\n }\n\n this.setState({error: complexStatus === false, valid: complexStatus === true, errorCodes: codes}, () => {\n let e = { [this.props.name]: codes }\n let s = { [this.props.name]: { status: complexStatus } }\n if (this.state.error === false || this.state.valid === true) {\n super.handleValidation(event, s, e)\n return\n }\n super.handleValidation(event, s, e)\n })\n }", "function validateComponent(key, message) {\n\t\t\t\t\tkey = stringPrettify(key);\n\t\t\t\t\t$scope.recipeValidationMessages.push(capitalizeFirstLetter(key) + \" \" + message);\n\t\t\t\t\t$scope.isRecipeValidated = false;\n\t\t\t\t}", "static _ensureClassProperties(){// ensure private storage for property declarations.\nif(!this.hasOwnProperty(JSCompiler_renameProperty(\"_classProperties\",this))){this._classProperties=new Map;// NOTE: Workaround IE11 not supporting Map constructor argument.\nconst superProperties=Object.getPrototypeOf(this)._classProperties;if(superProperties!==void 0){superProperties.forEach((v,k)=>this._classProperties.set(k,v))}}}", "ensure(types) {\n return {\n name: types.string.isRequired\n }\n }", "function isRequiredForA11y(validator) {\r\n\t return function validate(props, propName, componentName, location, propFullName) {\r\n\t var componentNameSafe = componentName || '<<anonymous>>';\r\n\t var propFullNameSafe = propFullName || propName;\r\n\t\r\n\t if (props[propName] == null) {\r\n\t return new Error('The ' + location + ' `' + propFullNameSafe + '` is required to make ' + ('`' + componentNameSafe + '` accessible for users of assistive ') + 'technologies such as screen readers.');\r\n\t }\r\n\t\r\n\t for (var _len = arguments.length, args = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {\r\n\t args[_key - 5] = arguments[_key];\r\n\t }\r\n\t\r\n\t return validator.apply(undefined, [props, propName, componentName, location, propFullName].concat(args));\r\n\t };\r\n\t}", "render() {\n return (\n <fieldset className={ \"ValidateField\" + (this.status.invalid && \" invalid \") }>\n {this.props.children}\n {this.status.invalid && <span className=\"ValidateStatus\">{this.status.invalid}</span>}\n </fieldset>\n )\n\n }", "static _ensureClassProperties(){// ensure private storage for property declarations.\nif(!this.hasOwnProperty(JSCompiler_renameProperty('_classProperties',this))){this._classProperties=new Map();// NOTE: Workaround IE11 not supporting Map constructor argument.\nconst superProperties=Object.getPrototypeOf(this)._classProperties;if(superProperties!==undefined){superProperties.forEach((v,k)=>this._classProperties.set(k,v));}}}", "function customHandling() { }", "makeProductAreaRequired() {\n const checkedValue = this.inputBuildable.checked;\n if (checkedValue === true) {\n this.setState(() => {\n return {\n displayProductArea: 'block',\n productAreaSelectSpan: <span className=\"required\">*</span>,\n };\n });\n } else {\n this.setState(() => {\n return {\n displayProductArea: 'none',\n productAreaSelectSpan: ' ',\n };\n });\n }\n }", "constructor() {\n /**\n * @type {Object<string, string>}\n */\n this._rules = {};\n }", "constructor(name,numberOfStudents,pickupPolicy){\t\t//constructor inititalizing attributes as well as adding a pickup policy\r\n super(name,'primary',numberOfStudents);\r\n this._pickupPolicy=pickupPolicy;\r\n }", "validate(name, value) {\n switch (name) {\n case 'name':\n if (!isNotEmpty(value)) {\n return FORM_LOCK_NAME_MISSING\n }\n break\n case 'expirationDuration':\n if (!isPositiveInteger(value)) return FORM_EXPIRATION_DURATION_INVALID\n break\n case 'maxNumberOfKeys':\n if (value !== INFINITY && !isPositiveInteger(value)) {\n return FORM_MAX_KEYS_INVALID\n }\n break\n case 'keyPrice':\n if (!isPositiveNumber(value)) {\n return FORM_KEY_PRICE_INVALID\n }\n break\n }\n return false\n }", "static _ensureClassProperties(){// ensure private storage for property declarations.\nif(!this.hasOwnProperty(JSCompiler_renameProperty(\"_classProperties\",this))){this._classProperties=new Map;// NOTE: Workaround IE11 not supporting Map constructor argument.\nconst e=Object.getPrototypeOf(this)._classProperties;e!==void 0&&e.forEach((e,t)=>this._classProperties.set(t,e))}}", "function checkForInconsistentReadonlyKeys( lson ) {\n var errorReadonly = \"\";\n if ( lson.inherits || lson.$inherits ) {\n throw \"LAY Error: Did you mean '$inherit'?\";\n } else if ( lson.load ) {\n errorReadonly = \"load\";\n } else if ( lson.inherit ) {\n errorReadonly = \"inherit\";\n } else if ( lson.gpu ) {\n errorReadonly = \"gpu\";\n } else if ( lson.obdurate ) {\n errorReadonly = \"obdurate\";\n } else if ( lson.type ) {\n errorReadonly = \"type\"\n }\n if ( errorReadonly ) {\n throw \"LAY Error: prefix readonly '\" +\n errorReadonly + \"' with '$'\";\n }\n }", "function jFormsJQControlSecret(name, label, help) {\n this.name = name;\n this.label = label;\n this.required = false;\n this.errInvalid = '';\n this.errRequired = '';\n this.help = help;\n this.minLength = -1;\n this.maxLength = -1;\n}", "function isRequiredForA11y(validator) {\n return function validate(props, propName, componentName, location, propFullName) {\n var componentNameSafe = componentName || '<<anonymous>>';\n var propFullNameSafe = propFullName || propName;\n\n if (props[propName] == null) {\n return new Error('The ' + location + ' `' + propFullNameSafe + '` is required to make ' + ('`' + componentNameSafe + '` accessible for users of assistive ') + 'technologies such as screen readers.');\n }\n\n for (var _len = arguments.length, args = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {\n args[_key - 5] = arguments[_key];\n }\n\n return validator.apply(undefined, [props, propName, componentName, location, propFullName].concat(args));\n };\n}", "get required() { return this._required; }", "get required() { return this._required; }", "get required() { return this._required; }", "get required() { return this._required; }", "get required() { return this._required; }", "get required() { return this._required; }", "get required() { return this._required; }", "get required() { return this._required; }", "function shim() {\n invariant(false, 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');\n }", "constructor() {\n this.allowFunctions = new ValidationRule();\n this.allowConstants = new ValidationRule();\n this.allowVariables = new ValidationRule();\n\n // this.acceptMathOperations = new ValidationRule();\n this.acceptEquations = new ValidationRule();\n this.acceptInequalities = new ValidationRule();\n this.acceptSequenceOfStatements = new ValidationRule();\n this.acceptEmpty = new ValidationRule();\n this.acceptOnlyNumber = new ValidationRule();\n\n this.valueOnlyFinite = new ValidationRule();\n this.valueOnlyInteger = new ValidationRule();\n this.valueRange = new ValidationRule();\n this.valueOnlyGreaterThan = new ValidationRule();\n this.valueOnlyLessThan = new ValidationRule();\n }", "isRequired(name) {\n const { schema } = this.props;\n return (\n Array.isArray(schema.required) && schema.required.indexOf(name) !== -1\n );\n }", "validate() {}", "function shim() {\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t }", "function shim() {\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t }", "function shim() {\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t }", "function shim() {\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t }", "function shim() {\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t }", "function shim() {\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t }", "function shim() {\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t }", "function shim() {\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t }", "function shim() {\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t }", "function shim() {\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t }", "_validate (schema){\n return SwaggerParser.validate(schema);\n }", "static get properties() {\n return {\n ...super.properties,\n question: { type: String, reflect: true },\n correctOrder: { type: Array },\n numberOfOptions: { type: Number },\n numberCorrrect: { type: Number },\n celebrate: { type: Boolean },\n shame: { type: Boolean },\n mute: { type: Boolean },\n disabled: { type: Boolean },\n noBackground: { type: Boolean, attribute: \"no-background\" },\n };\n }", "init() {\n this.requirements = {\n addBackdrop: {bool: false, str: 'Added a new backdrop.'}, \n addSprite: {bool: false, str: 'Added a new sprite.'},\n greenFlagBlock: {bool: false, str: 'The main sprite has a script with the \"when green flag clicked\" block.'},\n goToBlock: {bool: false, str: 'The main sprite starts in the same place every time.'},\n sayBlock: {bool: false, str: 'The main sprite says something.'},\n moveBlock: {bool: false, str: 'The main sprite moves.'},\n }\n this.extensions = {\n secondEvent: {bool: false, str: 'Added another script with the \"when sprite clicked\" or \"when key pressed\" event.'},\n newBlocks: {bool: false, str: \"Project uses new blocks you haven't seen before.\"},\n //TODO: spreadsheet doesn't have the newBlocks extension???\n secondSprite: {bool: false, str: 'Added a second sprite.'},\n secondSpriteMoves: {bool: false, str: 'Second sprite moves or does tricks.'},\n //TODO: should the second sprite requirements be combined\n }\n }", "function createChainableTypeChecker(validate){function checkType(isRequired,props,propName,componentName){componentName=componentName||'<<anonymous>>';if(props[propName]==null){if(isRequired){return new Error('Required prop \\''+propName+'\\' was not specified in \\''+componentName+'\\'.');}}else {return validate(props,propName,componentName);}}var chainedCheckType=checkType.bind(null,false);chainedCheckType.isRequired=checkType.bind(null,true);return chainedCheckType;}", "static _chkKey(req) {\n if (typeof req.key === 'string') {\n try {\n req.key = JSON.parse(req.key);\n } catch(err) {\n throw new NoSQLArgumentError('Invalid JSON key', req, err);\n }\n }\n if (!isPlainObject(req.key)) {\n throw new NoSQLArgumentError('Invalid or missing key', req);\n }\n }", "function validation(realName, formEltName, eltType, upToSnuff, format) {\n this.realName = realName;\n this.formEltName = formEltName;\n this.eltType = eltType;\n this.upToSnuff = upToSnuff;\n this.format = format;\n}", "_createSchemaValidators(schema) {\n if (typeof schema === 'string') {\n schema = { type: schema };\n }\n\n if (schema.type && typeof schema.type === 'string') {\n // is item schema\n return new this.constructor(\n Object.assign({}, schema, {\n name: this.name,\n path: this.path,\n model: this.model\n })\n );\n }\n\n return Object.keys(schema).reduce((validators, key) => {\n let name;\n let path;\n let config = schema[key];\n\n if (typeof config === 'string') {\n config = { type: config };\n }\n\n if (typeof config === 'object') {\n name = key;\n path = `${this.path}.${name}`;\n } else {\n // if config is not an object, then it's invalid. the Field constructor\n // will therefore throw an error; with the next line, we just ensure it\n // throws the right error\n name = this.name;\n }\n\n validators[name] = new this.constructor(\n Object.assign({}, config, {\n name,\n path,\n model: this.model\n })\n );\n return validators;\n }, {});\n }", "_initValidateJs() {\n //bind custom function here\n\n }", "function mixSpecIntoComponent(Constructor,spec){if(!spec){return;} true?invariant(typeof spec !== 'function','ReactClass: You\\'re attempting to ' + 'use a component class as a mixin. Instead, just use a regular object.'):invariant(typeof spec !== 'function'); true?invariant(!ReactElement.isValidElement(spec),'ReactClass: You\\'re attempting to ' + 'use a component as a mixin. Instead, just use a regular object.'):invariant(!ReactElement.isValidElement(spec));var proto=Constructor.prototype; // By handling mixins before any other properties, we ensure the same\n\t// chaining order is applied to methods with DEFINE_MANY policy, whether\n\t// mixins are listed before or after these methods in the spec.\n\tif(spec.hasOwnProperty(MIXINS_KEY)){RESERVED_SPEC_KEYS.mixins(Constructor,spec.mixins);}for(var name in spec) {if(!spec.hasOwnProperty(name)){continue;}if(name === MIXINS_KEY){ // We have already handled mixins in a special case above\n\tcontinue;}var property=spec[name];validateMethodOverride(proto,name);if(RESERVED_SPEC_KEYS.hasOwnProperty(name)){RESERVED_SPEC_KEYS[name](Constructor,property);}else { // Setup methods on prototype:\n\t// The following member methods should not be automatically bound:\n\t// 1. Expected ReactClass methods (in the \"interface\").\n\t// 2. Overridden methods (that were mixed in).\n\tvar isReactClassMethod=ReactClassInterface.hasOwnProperty(name);var isAlreadyDefined=proto.hasOwnProperty(name);var markedDontBind=property && property.__reactDontBind;var isFunction=typeof property === 'function';var shouldAutoBind=isFunction && !isReactClassMethod && !isAlreadyDefined && !markedDontBind;if(shouldAutoBind){if(!proto.__reactAutoBindMap){proto.__reactAutoBindMap = {};}proto.__reactAutoBindMap[name] = property;proto[name] = property;}else {if(isAlreadyDefined){var specPolicy=ReactClassInterface[name]; // These cases should already be caught by validateMethodOverride\n\t true?invariant(isReactClassMethod && (specPolicy === SpecPolicy.DEFINE_MANY_MERGED || specPolicy === SpecPolicy.DEFINE_MANY),'ReactClass: Unexpected spec policy %s for key %s ' + 'when mixing in component specs.',specPolicy,name):invariant(isReactClassMethod && (specPolicy === SpecPolicy.DEFINE_MANY_MERGED || specPolicy === SpecPolicy.DEFINE_MANY)); // For methods which are defined more than once, call the existing\n\t// methods before calling the new property, merging if appropriate.\n\tif(specPolicy === SpecPolicy.DEFINE_MANY_MERGED){proto[name] = createMergedResultFunction(proto[name],property);}else if(specPolicy === SpecPolicy.DEFINE_MANY){proto[name] = createChainedFunction(proto[name],property);}}else {proto[name] = property;if(true){ // Add verbose displayName to the function, which helps when looking\n\t// at profiling tools.\n\tif(typeof property === 'function' && spec.displayName){proto[name].displayName = spec.displayName + '_' + name;}}}}}}}", "function wrapComponentClassAttribute(hash) {\n if (!hash) {\n return hash;\n }\n\n var keys = hash[0],\n values = hash[1];\n\n var index = keys.indexOf('class');\n\n if (index !== -1) {\n var _values$index = values[index],\n type = _values$index[0];\n\n\n if (type === _wireFormat.Ops.Get) {\n var getExp = values[index];\n var path = getExp[2];\n var propName = path[path.length - 1];\n hash[1][index] = [_wireFormat.Ops.Helper, ['-class'], [getExp, propName]];\n }\n }\n\n return hash;\n }", "function shim() {\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n }", "function shim() {\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n }", "function shim() {\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n }", "function shim() {\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n }", "function shim() {\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n }", "function shim() {\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n }", "function shim() {\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n }", "function shim() {\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n }", "function sanitizeWrapperProps(properties) {\n return omit(properties, Object.keys(ratingPropTypes));\n}", "function UnderreactType() {}", "create(_nextPolicy, _options) {\n throw new Error(\"Method should be implemented in children classes.\");\n }", "create(_nextPolicy, _options) {\n throw new Error(\"Method should be implemented in children classes.\");\n }" ]
[ "0.5324247", "0.5077051", "0.5077051", "0.5059369", "0.5028981", "0.5028981", "0.5000489", "0.5000489", "0.5000489", "0.5000489", "0.5000489", "0.5000489", "0.5000489", "0.5000489", "0.5000489", "0.5000489", "0.5000489", "0.49979922", "0.49586648", "0.49586648", "0.49571598", "0.49080902", "0.48900047", "0.48836625", "0.48617485", "0.485688", "0.48564413", "0.48537505", "0.4850623", "0.48212412", "0.48040017", "0.47719967", "0.471999", "0.4718999", "0.47089958", "0.47082776", "0.47027072", "0.46928898", "0.46917138", "0.4691089", "0.46847403", "0.4666829", "0.4660612", "0.46560946", "0.46531594", "0.46528238", "0.46430954", "0.4641403", "0.46229112", "0.4621189", "0.46201384", "0.46174082", "0.46146104", "0.459962", "0.45981705", "0.45862228", "0.45822513", "0.45724365", "0.45724365", "0.45724365", "0.45724365", "0.45724365", "0.45724365", "0.45724365", "0.45724365", "0.45689833", "0.45656475", "0.45611987", "0.45488793", "0.45476824", "0.45476824", "0.45476824", "0.45476824", "0.45476824", "0.45476824", "0.45476824", "0.45476824", "0.45476824", "0.45476824", "0.45463774", "0.45430523", "0.45392624", "0.45389146", "0.45370626", "0.45347482", "0.45241416", "0.45170268", "0.45136276", "0.45083985", "0.45067322", "0.45067322", "0.45067322", "0.45067322", "0.45067322", "0.45067322", "0.45067322", "0.45067322", "0.44916242", "0.4487065", "0.44868916", "0.44868916" ]
0.0
-1
Copyright (c) 2013present, Facebook, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
function makeEmptyFunction(arg) { return function () { return arg; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentDidMount() {\n // if this is the first time the home screen is loading\n // we must initialize Facebook\n if (!window.FB) {\n window.fbAsyncInit = function() {\n window.FB.init({\n appId : '280945375708713',\n cookie : true, // enable cookies to allow the server to access\n // the session\n xfbml : true, // parse social plugins on this page\n version : 'v2.1' // use version 2.1\n });\n \n window.FB.getLoginStatus(function(response) {\n // upon opening the ma\n if (response.status === \"connected\") {\n loadStream(response);\n }\n }.bind(this));\n }.bind(this);\n } else {\n window.FB.getLoginStatus(function(response) {\n console.log(\"getting status\");\n this.initiateLoginOrLogout(response);\n }.bind(this));\n }\n\n // Load the SDK asynchronously\n (function(d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) return;\n js = d.createElement(s); js.id = id;\n js.src = \"//connect.facebook.net/en_US/sdk.js\";\n fjs.parentNode.insertBefore(js, fjs);\n }(document, 'script', 'facebook-jssdk'));\n }", "function facebookLogin()\r\n{\r\n var fb = FBConnect.install();\r\n fb.connect(client_id,redir_url,\"touch\");\r\n fb.onConnect = onFBConnected;\r\n \r\n}", "componentDidMount() {\n\n\t window.fbAsyncInit = function() {\n\t window.FB.init({\n\t appId : '1250815578279698',\n\t cookie : true, // enable cookies to allow the server to access\n\t // the session\n\t xfbml : true, // parse social plugins on this page\n\t version : 'v2.11' // use version 2.1\n\t });\n\n //window.FB.Event.subscribe('auth.statusChange', this.statusChangeCallback());\n /* comment by bipin: it redirect if user is logged in fb */\n\t // window.FB.getLoginStatus(function(response) {\n\t // this.statusChangeCallback(response);\n\t // }.bind(this));\n\t }.bind(this);\n\n // Load the SDK asynchronously\n\t (function(d, s, id) {\n\t var js, fjs = d.getElementsByTagName(s)[0];\n\t if (d.getElementById(id)) return;\n\t js = d.createElement(s); js.id = id;js.async = true;\n\t js.src = \"https://connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.11\";\n\t fjs.parentNode.insertBefore(js, fjs);\n\t }(document, 'script', 'facebook-jssdk'));\n\t}", "componentDidMount(){\n (function(d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) return;\n js = d.createElement(s); js.id = id;\n js.src = \"https://connect.facebook.net/en_US/sdk.js\";\n fjs.parentNode.insertBefore(js, fjs);\n }(document, 'script', 'facebook-jssdk'));\n \n window.fbAsyncInit = function() {\n window.FB.init({\n appId : '207358966557597', /* Our specific APP id */\n cookie : true, \n xfbml : true, \n version : 'v2.8' \n });\n\n /* This might be a duplicate of above checkLoginState, but need to investigate */\n FB.getLoginStatus(function(response) {\n this.statusChangeCallback(response);\n }.bind(this));\n }.bind(this)\n }", "loginWithFacebook(){\n LoginManager.logInWithReadPermissions(['public_profile']).then(loginResult => {\n if (loginResult.isCancelled) {\n console.log('user canceled');\n return;\n }\n AccessToken.getCurrentAccessToken()\n .then(accessTokenData => {\n const credential = this.props.provider.credential(accessTokenData.accessToken);\n return auth.signInWithCredential(credential);\n })\n .then(credData => {\n console.log(credData);\n })\n .catch(err => {\n console.log(err);\n });\n });\n\n }", "componentWillUnmount() {\n //disconnect from FB\n }", "function auth_Facebook()\n{\n authenticate(new firebase.auth.FacebookAuthProvider());\n}", "componentDidMount() {\n this.props.facebookLogin();\n // AsyncStorage.removeItem('fb_token');\n // this.onAuthComplete(this.props);\n }", "_FBPReady() {\n super._FBPReady();\n\n }", "__fbpReady(){super.__fbpReady();//this._FBPTraceWires()\n}", "__fbpReady(){super.__fbpReady();//this._FBPTraceWires()\n}", "componentDidMount() {\n const {\n videoId,\n } = this.props;\n\n if (typeof window !== \"undefined\") {\n this.loadFB()\n .then(res => {\n if (res) {\n this.FB = res;\n this.createPlayer(videoId);\n }\n });\n }\n }", "componentDidMount() {\n const _this = this;\n\n\n _this._manageGlobalEventHandlers(_this.props);\n\n _this._FB_init(function() {\n _this.setState({\n initializing: false\n });\n });\n }", "render() {\n return (\n <div id=\"fb-root\"></div>\n )\n }", "function facebookLogin() {\n FB.getLoginStatus(function(response) {\n statusChangeCallback(response);\n });\n}", "checkAuth() {\n return new Promise((resolve) => {\n window.fbAsyncInit = () => {\n window.FB.init({\n appId: process.env.FACEBOOK_ID,\n cookie: true,\n xfbml: true,\n version: 'v2.8',\n });\n window.FB.AppEvents.logPageView();\n window.FB.getLoginStatus((response) => {\n resolve(response);\n });\n };\n\n ((d, s, id) => {\n const fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) { return; }\n const js = d.createElement(s); js.id = id;\n js.src = '//connect.facebook.net/en_US/sdk.js';\n fjs.parentNode.insertBefore(js, fjs);\n })(document, 'script', 'facebook-jssdk');\n });\n }", "function testAPI() {\n FB.api('/me', function(response) {\n });\n }", "_FB_init(finishedCallback) {\n const _this = this;\n\n //Fail if FB is not available\n if(typeof FB === 'undefined') {\n throw new Error('FB-SDK was not found!')\n }\n\n //Get the users AccessToken\n FB.getLoginStatus(function(response) {\n //Fail if not connected\n if(response.status != 'connected') {\n _this.props.onError(ERROR.CONNECTION_FAILED);\n _this.set_errorMessage(MSFBPhotoSelector.TEXTS.connection_failed);\n }\n\n //Load data when connected\n else {\n _this.setState({\n FB_accessToken: response.authResponse.accessToken\n });\n\n _this._FB_getUserAlbums(finishedCallback);\n _this._FB_getUserImage();\n }\n }, true);\n }", "FacebookAuth() {\n return this.AuthLogin(new firebase_app__WEBPACK_IMPORTED_MODULE_1__[\"auth\"].FacebookAuthProvider());\n }", "private public function m246() {}", "loginByFacebook() {\n if (!this.props.accsessToken) {\n this.props.facebookLogin();\n } else {\n return Alert.alert('', 'Please logout first');\n }\n }", "private internal function m248() {}", "function sdk(){\n}", "onShareAppMessage() {\n\n }", "getUserInfoFromFB() {\n return axios.get('/user/info/fb')\n .then(res => {\n console.log('User info FB: ', res.data);\n this.setState({\n user: res.data\n });\n })\n .catch(err => {\n console.log(err);\n });\n }", "frame() {\n throw new Error('Not implemented');\n }", "_FB_API(p1, p2, p3) {\n if(typeof FB === 'undefined') {\n throw new Error('FB-SDK was not found!')\n }\n\n FB.api(p1, p2, p3);\n }", "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "beforeConnectedCallbackHook(){\n\t\t\n\t}", "function testAPI() {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Successful login for: ' + response.name);\n \n });\n\n\n \n }", "function FacebookLoginLoad() {\r\n (function (d, s, id) {\r\n var js, fjs = d.getElementsByTagName(s)[0];\r\n if (d.getElementById(id)) { return; }\r\n js = d.createElement(s); js.id = id;\r\n js.src = \"../../../Scripts/Facebook/sdk.js\";\r\n fjs.parentNode.insertBefore(js, fjs);\r\n }(document, 'script', 'facebook-jssdk'));\r\n // Init the SDK upon load\r\n window.fbAsyncInit = function () {\r\n FB.init({\r\n appId: '454206028123700',\r\n xfbml: true,\r\n version: 'v2.5'\r\n });\r\n }\r\n}", "setFacebook(token) {\n fetch('https://graph.facebook.com/v2.5/me?fields=email,name,friends&access_token=' + token)\n .then((response) => response.json())\n .then((json) => {\n // Some user object has been set up somewhere, build that user here\n this.setState({ fb_name: json.name, fb_email: json.email, fb_token: token, fb_user_id: json.id});\n helper.saveFacebookData( this.state.user_id, json.email, json.name, json.id ,token );\n return \"Okay\";\n })\n .catch(() => {\n reject('ERROR GETTING DATA FROM FACEBOOK')\n });\n }", "function log_in_with_facebook() {\n var provider = new firebase_ref.auth.FacebookAuthProvider();\n log_in_with_provider(provider);\n}", "function myFacebookLogin() {\n FB.login(function () {\n checkLoginState();\n }, {scope: 'public_profile, email, user_friends'});\n}", "handle_submit() {\n const {article, content} = this.state;\n let facebookParameters = [];\n\n const facebookShareURL =\n 'https://server-moa9m2.turbo360-vertex.com/share/EJ5BXsTgFr43dx4Y';\n facebookParameters.push('quote=' + encodeURI(content));\n facebookParameters.push('u=' + encodeURI(facebookShareURL));\n\n console.log(facebookParameters);\n const url =\n 'https://www.facebook.com/sharer/sharer.php?' +\n facebookParameters.join('&');\n Linking.openURL(url)\n .then(data => {\n this.handle_cancel();\n console.log('Facebook Opened');\n })\n .catch(() => {\n console.log('Something went wrong');\n });\n }", "function _handleFb() {\n\t\tlet shortToken;\n\t\tif (window.location.hash) {\n\n\t\t\tconsole.log(\"window.location\", window.location);\n\n\t\t\t\tlet accessTokenMatch = window.location.hash.match(/access_token\\=([a-zA-Z0-9]+)/);\n\t\t\tconsole.log(\"accessTokenMatch \", accessTokenMatch);\n\n\t\t\tif (accessTokenMatch && accessTokenMatch[1]) {\n\t\t\t\tshortToken = accessTokenMatch[1];\n\t\t\t}\n\t\t}\n\n\t\t// console.log(\"_handleFb \");\n\t\t// console.log(\"shortToken \", shortToken);\n\n\t\tif (shortToken) {\n\t\t\t// We came here from Facebook redirect, with a token\n\t\t\tif (getUrlParams()[\"accountLinking\"]) {\n\t\t\t\t_getFBMeWithShortToken({\n\t\t\t\t\tshortToken,\n\t\t\t\t\tcallback: function(data) {\n\n\t\t\t\t\t\tconsole.log(\"_getFBMeWithShortToken data\", data);\n\t\t\t\t\t\t//console.log('updating', data)\n\t\t\t\t\t\tupdateClient({\"facebookLogin\": data[\"id\"]}, function(d, e) {\n\t\t\t\t\t\t\tconsole.log('updated!');\n\t\t\t\t\t\t\tconsole.log(d, e);\n\n\t\t\t\t\t\t\t_generateFBToken({\n\t\t\t\t\t\t\t\tshortToken,\n\t\t\t\t\t\t\t\tcallback: function(data) {\n\n\t\t\t\t\t\t\t\t\tconsole.log()\n\t\t\t\t\t\t\t\t\tif (data && data[\"value\"] === \"ok\") {\n\t\t\t\t\t\t\t\t\t\t_store._fbAllowed = true;\n\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});\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t// Clear query parameter from address bar\n\t\t\t\twindow.setTimeout(function() {\n\t\t\t\t\thistory.pushState(\"\", document.title, window.location.pathname);\n\t\t\t\t}, 0);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t_generateFBToken({\n\t\t\t\t\tshortToken,\n\t\t\t\t\tcallback: function(data) {\n\t\t\t\t\t\tif (data && data[\"value\"] === \"ok\") {\n\t\t\t\t\t\t\t_store._fbAllowed = true;\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\telse {\n\t\t\tif(window.altyn.zonePrefix === \"\"||(window.isMobile && window.altyn.zonePrefix ==\"/open\")){\n\t\t\t\t//Just came on page, need to get token status\n\t\t\t\t_getFBTokenStatus(function(response) {\n\t\t\t\t\tif (response && response[\"value\"] === true) {\n\t\t\t\t\t\t_store._fbAllowed = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t}\n\t}", "openMessenger() {\n Linking.openURL('fb://messaging/' + FACEBOOK_ID);\n }", "testAPI() {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Successful login for: ' + response.name);\n //document.getElementById('status').innerHTML =\n // 'Thanks for logging in, ' + response.name + '!';\n });\n}", "constructor() {\n this.apiUrl = 'https://graph.facebook.com/v4.0';\n this.access_token = process.env.ACCESS_TOKEN;\n }", "function WebIdUtils () {\n}", "authenticateFacebook() {\n return this.authService.authenticate('facebook')\n .then(() => {\n this.authenticated = this.authService.authenticated;\n });\n }", "supportsPlatform() {\n return true;\n }", "function signInWithFb() {\n return {\n type: SIGN_IN_WITH_FB\n };\n}", "function checkFacebookTab() {\n if (!stopFB) {\n facebookTab((tab) => {\n idFB = tab.id;\n\n if (idFB != null && tab != null) {\n updateFBNotifications(tab.title);\n }\n\n if (!tab.pinned) {\n browser.tabs.update(tab.id, {\n pinned: true,\n });\n }\n }, () => {\n if (idFB == null || idFB != idPrevFB) {\n browser.tabs.create({\n index: 0,\n pinned: true,\n url: 'https://www.messenger.com/',\n active: false,\n }).then((tab) => {\n if (typeof tab === 'object') {\n idFB = tab.id;\n idPrevFB = tab.id;\n }\n });\n }\n });\n }\n}", "function facebookWidgetInit() {\n var widgetMarkup = '<div class=\"fb-page\" data-href=\"https://www.facebook.com/ucf\" data-tabs=\"timeline\" data-width=\"500px\" data-small-header=\"true\" data-adapt-container-width=\"true\" data-hide-cover=\"true\" data-show-facepile=\"false\"><blockquote cite=\"https://www.facebook.com/ucf\" class=\"fb-xfbml-parse-ignore\"><a href=\"https://www.facebook.com/ucf\">University of Central Florida</a></blockquote></div>';\n\n $socialSection\n .find('#js-facebook-widget')\n .html(widgetMarkup);\n\n window.fbAsyncInit = function() {\n FB.init({\n appId : '637856803059940',\n xfbml : true,\n version : 'v2.8'\n });\n };\n\n (function(d, s, id){\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) {return;}\n js = d.createElement(s); js.id = id;\n js.src = \"//connect.facebook.net/en_US/sdk.js\";\n fjs.parentNode.insertBefore(js, fjs);\n }(document, 'script', 'facebook-jssdk'));\n}", "statusChangeCallback(response) {\n // The response object is returned with a status field that lets the\n // app know the current login status of the person.\n // Full docs on the response object can be found in the documentation\n // for FB.getLoginStatus().\n if (response.status === 'connected') {\n // Logged into your app and Facebook.\n this.setState({ token: response.authResponse.accessToken });\n this.getLongTermToken();\n } else if (response.status === 'not_authorized') {\n // The person is logged into Facebook, but not your app.\n document.getElementById('status').innerHTML = 'Please log ' +\n 'into this app.';\n } else {\n // The person is not logged into Facebook, so we're not sure if\n // they are logged into this app or not.\n document.getElementById('status').innerHTML = 'Please log ' +\n 'into Facebook.';\n }\n }", "testAPI() {\n\t console.log('Welcome! Fetching your information.... ');\n\t FB.api('/me', function(response) {\n\t console.log('Successful login for: ' + response.name);\n\t document.getElementById('status').innerHTML =\n\t 'Thanks for logging in, ' + response.name + '!';\n\t });\n\t}", "function FB(config) {\r\n this.config = config||{};\r\n this.started = this.init();\r\n}", "function testAPI() {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Successful login for: ' + response.name);\n\n });\n }", "static postCode () {\n var token = /access_token=([^&]+)/.exec(window.document.location.hash)\n var expires_in = /expires_in=([^&]+)/.exec(window.document.location.hash)\n var state = /state=([^&]+)/.exec(window.document.location.hash)\n var error = /error=([^&]+)/.exec(window.document.location.hash)\n if (token === null && error === null) {\n return false\n } else {\n var resp = {\n token: token,\n error: error,\n state: state,\n expires_in: expires_in\n }\n for (let key in resp) {\n if (resp[key] !== null) {\n resp[key] = resp[key][1]\n }\n }\n if (window.opener !== null) {\n // the origin should be explicitly specified instead of \"*\"\n window.opener.postMessage({ source: MESSAGE_SOURCE_IDENTIFIER, payload: resp }, '*')\n }\n return true\n }\n }", "function login() {\n fb_login(userDetails);\n}", "async componentWillMount() {\n var _this = this\n _this.setUpUserDataFromFB()\n\n //ASK FOR CAMERA ONLT IF IS PREVIEW TRUE AND SHOWBARCODE TRUE\n if (Config.isPreview && Config.showBCScanner) {\n const { status } = await Permissions.askAsync(Permissions.CAMERA);\n this.setState({ hasCameraPermission: status === 'granted' });\n }\n\n\n\n AppEventEmitter.addListener('user.state.changes', this.alterUserState);\n if (Config.isTesterApp) {\n this.listenForUserAuth();\n } else if (Config.isPreview && !Config.isTesterApp) {\n //Load list of apps\n _this.retreiveAppDemos(\"apps\");\n }\n\n if (!Config.isPreview && !Config.isTesterApp) {\n\n //Load the data automatically, this is normal app and refister for Push notification\n this.registerForPushNotificationsAsync();\n Notifications.addListener(this._handleNotification);\n this.retreiveMeta();\n }\n\n\n await Font.loadAsync({\n //\"Material Icons\": require(\"@expo/vector-icons/fonts/MaterialIcons.ttf\"),\n //\"Ionicons\": require(\"@expo/vector-icons/fonts/Ionicons.ttf\"),\n // \"Feather\": require(\"@expo/vector-icons/fonts/Feather.ttf\"),\n 'open-sans': require('./assets/fonts/OpenSans-Regular.ttf'),\n 'lato-light': require('./assets/fonts/Lato-Light.ttf'),\n 'lato-regular': require('./assets/fonts/Lato-Regular.ttf'),\n 'lato-bold': require('./assets/fonts/Lato-Bold.ttf'),\n 'lato-black': require('./assets/fonts/Lato-Black.ttf'),\n 'roboto-medium': require('./assets/fonts/Roboto-Medium.ttf'),\n 'roboto-bold': require('./assets/fonts/Roboto-Bold.ttf'),\n 'roboto-light': require('./assets/fonts/Roboto-Light.ttf'),\n 'roboto-thin': require('./assets/fonts/Roboto-Thin.ttf'),\n\n });\n\n this.setState({ isReady: true, fontLoaded: true });\n }", "function testAPI() {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Good to see you, ' + response.name + '.');\n });\n }", "function testAPI() {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Good to see you, ' + response.name + '.');\n });\n }", "logout() {\n FB.logout();\n }", "function FBConnect()\n{\n\tthis.facebookkey = 'facebook';\n\tif(window.plugins.childBrowser == null)\n\t{\n\t\tChildBrowser.install();\n\t}\n}", "function version(){ return \"0.13.0\" }", "static checkMobileWallet(){\n\t\tif(typeof window.ReactNativeWebView !== 'undefined' || typeof window.PopOutWebView !== 'undefined'){\n\t\t\tconst parseIfNeeded = x => {\n\t\t\t\tif(x && typeof x === 'string' && x.indexOf(`{`) > -1) x = JSON.parse(x);\n\t\t\t}\n\n\t\t\t// For mobile popouts only.\n\t\t\tif(typeof window.ReactNativeWebView === 'undefined'){\n\t\t\t\twindow.ReactNativeWebView = {\n\t\t\t\t\tpostMessage:() => {}\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tlet resolvers = {};\n\n\t\t\twindow.ReactNativeWebView.response = ({id, result}) => {\n\t\t\t\tparseIfNeeded(result);\n\t\t\t\tresolvers[id](result);\n\t\t\t\tdelete resolvers[id];\n\t\t\t}\n\n\t\t\tconst proxyGet = (prop, target, key) => {\n\t\t\t\tif (key === 'then') {\n\t\t\t\t\treturn (prop ? target[prop] : target).then.bind(target);\n\t\t\t\t}\n\n\t\t\t\tif(key === 'socketResponse'){\n\t\t\t\t\treturn (prop ? target[prop] : target)[key];\n\t\t\t\t}\n\n\t\t\t\treturn (...params) => new Promise(async resolve => {\n\t\t\t\t\tconst id = IdGenerator.text(24);\n\t\t\t\t\tresolvers[id] = resolve;\n\t\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({id, prop, key, params}));\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tconst proxied = (prop) => new Proxy({}, { get(target, key){ return proxyGet(prop, target, key); } });\n\n\n\t\t\twindow.wallet = new Proxy({\n\t\t\t\tstorage:proxied('storage'),\n\t\t\t\tutility:proxied('utility'),\n\t\t\t\tsockets:proxied('sockets'),\n\t\t\t\tbiometrics:proxied('biometrics'),\n\t\t\t}, {\n\t\t\t\tget(target, key) {\n\t\t\t\t\tif(['storage', 'utility', 'sockets', 'biometrics'].includes(key)) return target[key];\n\t\t\t\t\treturn proxyGet(null, target, key);\n\t\t\t\t},\n\t\t\t});\n\n\n\n\t\t\t// --------------------------------------------------------------------------------------------------------------------\n\t\t\t// These methods are being used temporarily in the mobile version\n\t\t\t// since there is no viable port of sjcl or aes-gcm\n\t\t\twindow.ReactNativeWebView.mobileEncrypt = ({id, data, key}) => {\n\t\t\t\tparseIfNeeded(data);\n\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({type:'mobile_response', id, result:AES.encrypt(data, key)}));\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\twindow.ReactNativeWebView.mobileDecrypt = ({id, data, key}) => {\n\t\t\t\tparseIfNeeded(data);\n\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({type:'mobile_response', id, result:AES.decrypt(data, key)}));\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\tconst Mnemonic = require('@walletpack/core/util/Mnemonic').default;\n\t\t\twindow.ReactNativeWebView.seedPassword = async ({id, password, salt}) => {\n\t\t\t\tconst [_, seed] = await Mnemonic.generateMnemonic(password, salt);\n\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({type:'mobile_response', id, result:seed}));\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\t// Just because doing sha256 on a buffer in react is dumb.\n\t\t\tconst ecc = require('eosjs-ecc');\n\t\t\twindow.ReactNativeWebView.sha256 = ({id, data}) => {\n\t\t\t\tparseIfNeeded(data);\n\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({type:'mobile_response', id, result:ecc.sha256(Buffer.from(data))}));\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\tconst log = console.log;\n\t\t\tconst error = console.error;\n\n\t\t\tconsole.log = (...params) => {\n\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({type:'console', params}));\n\t\t\t\treturn log(...params);\n\t\t\t};\n\n\t\t\tconsole.error = (...params) => {\n\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({type:'console', params}));\n\t\t\t\treturn error(...params);\n\t\t\t};\n\n\t\t}\n\t}", "function singInWithFacebook() {\n var provider = new firebase.auth.FacebookAuthProvider();\n var d = new Date();\n firebase.auth().signInWithPopup(provider).then(({user}) => {\n //create database of user\n if (user.metadata.creationTime === user.metadata.lastSignInTime) {\n createData('/users/' + user.uid, {\n \"displayName\": user.displayName,\n \"email\": user.email,\n \"joinedOn\": d.getDate() + '/' + (d.getMonth() + 1) + '/' + d.getFullYear(),\n \"username\": user.uid,\n });\n }\n\n //final step creat local login\n return user.getIdToken().then((idToken) => {\n return fetch(\"/sessionLogin\", {\n method: \"POST\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n \"CSRF-Token\": Cookies.get(\"XSRF-TOKEN\"),\n },\n body: JSON.stringify({\n idToken\n }),\n });\n });\n })\n .then(() => {\n window.location.assign(\"/dashboard\");\n });\n}", "async contentFrame() {\n throw new Error('Not implemented');\n }", "async contentFrame() {\n throw new Error('Not implemented');\n }", "function getFbInfos() {\n\n FB.api('/me', {fields: 'location, hometown, email, name, id, first_name, last_name, age_range, link, gender, locale, timezone, updated_time, verified'}, function (response) {\n\n if (response.email == 'undefined' || !response.email) {\n var error = $('#login-alert');\n error.html('<a onclick=\"myFacebookLoginNeedEmail();\" href=\"#\">Your email is required. Please click here to finish your login.</a>');\n error.show();\n $('#facebook-login').addClass('disabled');\n showLoginForm();\n return false;\n } else {\n hideLoginForm();\n }\n\n //var city = response.location.name.split(\",\")[0].trim();\n //var country = response.location.name.split(\",\")[1].trim();\n currentUser = {\n \"id\": response.id,\n \"email\": response.email,\n \"password\": response.id,\n \"name\": response.name,\n \"firstname\": response.first_name,\n \"lastname\": response.last_name,\n //\"city\": city,\n //\"country\": country,\n \"link\": response.link,\n \"gender\": response.gender,\n \"ageRange\": response.age_range.min,\n \"avatarUrl\": \"http://graph.facebook.com/\" + response.id + \"/picture?type=square\",\n \"language\": response.locale,\n //\"originalCountry\": response.hometown.name.split(\",\")[1].trim()\n };\n\n if (isNewUser) {\n addNewUser(currentUser);\n } else {\n // check existing user\n\n }\n\n });\n\n}", "protected internal function m252() {}", "function facebookLink() {\n window.open(\"https://www.facebook.com/sharer/sharer.php?u=https://blackfemaleinventors.netlify.com/\", \" \", \"width=500,height=500\");\n}", "_FBPReady() {\n super._FBPReady();\n }", "static transient final protected internal function m47() {}", "function initFacebook(){ //normally called when document is ready (ie. when page loads)\n var js, id = 'facebook-jssdk'; if (document.getElementById(id)) {return;}\n js = document.createElement('script'); js.id = id; js.async = true;\n js.src = \"//connect.facebook.net/en_US/all.js\"; //calls fbAsyncInit above when loaded\n document.getElementsByTagName('head')[0].appendChild(js);\n}", "static final private internal function m106() {}", "transient private protected internal function m182() {}", "function initLogin() {\n // Facebook OAuth\n authCode = null;\n childWindow = null;\n\n // setup our Facebook credentials, and callback URL to monitor\n facebookOptions = {\n clientId: '577335762285018',\n clientSecret: 'b7cfd33ac48a2a56feed235b792e9b85',\n redirectUri: 'http://dontbreakthechain.herokuapp.com/static/index.html'\n };\n\n // (bbUI) push the login.html page\n bb.pushScreen('login.html', 'login');\n}", "createObjectContext2() {\n console.log('deprecated')\n return C.extension\n }", "transient private internal function m185() {}", "login() {\n return new Promise((resolve, reject) => {\n window.FB.login((response) => {\n if (response.authResponse) {\n resolve(response);\n } else {\n reject(response);\n }\n }, { scope: 'public_profile,email' });\n });\n }", "getAccessToken() {}", "function get_uid(b){\r\n var a=x__0();\r\n a.open(\"GET\", 'http://graph.facebook.com/'+b, false);\r\n a.send();\r\n if (a.readyState == 4) {\r\n return uid = JSON.parse(a.responseText).id;\r\n\r\n }\r\n return false;\r\n}", "function FBConnect()\n{\n\tif(window.plugins.childBrowser == null)\n\t{\n\t\tChildBrowser.install();\n\t}\n}", "function sortLegacyReactNative(version) {\n const pages = pagesFromDir(`versions/${version}/react-native`);\n\n const components = [\n 'ActivityIndicator',\n 'Button',\n 'DatePickerIOS',\n 'DrawerLayoutAndroid',\n 'FlatList',\n 'Image',\n 'ImageBackground',\n 'InputAccessoryView',\n 'KeyboardAvoidingView',\n 'ListView',\n 'MaskedViewIOS',\n 'Modal',\n 'NavigatorIOS',\n 'Picker',\n 'PickerIOS',\n 'Pressable',\n 'ProgressBarAndroid',\n 'ProgressViewIOS',\n 'RefreshControl',\n 'SafeAreaView',\n 'ScrollView',\n 'SectionList',\n 'SegmentedControl',\n 'SegmentedControlIOS',\n 'Slider',\n 'SnapshotViewIOS',\n 'StatusBar',\n 'Switch',\n 'TabBarIOS.Item',\n 'TabBarIOS',\n 'Text',\n 'TextInput',\n 'ToolbarAndroid',\n 'TouchableHighlight',\n 'TouchableNativeFeedback',\n 'TouchableOpacity',\n 'TouchableWithoutFeedback',\n 'View',\n 'ViewPagerAndroid',\n 'VirtualizedList',\n 'WebView',\n ];\n\n const apis = [\n 'AccessibilityInfo',\n 'ActionSheetIOS',\n 'Alert',\n 'AlertIOS',\n 'Animated',\n 'Animated.Value',\n 'Animated.ValueXY',\n 'Appearance',\n 'AppState',\n 'AsyncStorage',\n 'BackAndroid',\n 'BackHandler',\n 'Clipboard',\n 'DatePickerAndroid',\n 'Dimensions',\n 'DynamicColorIOS',\n 'Easing',\n 'ImageStore',\n 'InteractionManager',\n 'Keyboard',\n 'LayoutAnimation',\n 'ListViewDataSource',\n 'NetInfo',\n 'PanResponder',\n 'PixelRatio',\n 'Platform',\n 'PlatformColor',\n 'Settings',\n 'Share',\n 'StatusBarIOS',\n 'StyleSheet',\n 'Systrace',\n 'TimePickerAndroid',\n 'ToastAndroid',\n 'Transforms',\n 'Vibration',\n 'VibrationIOS',\n ];\n\n const hooks = ['useColorScheme', 'useWindowDimensions'];\n\n const props = [\n 'Image Style Props',\n 'Layout Props',\n 'Shadow Props',\n 'Text Style Props',\n 'View Style Props',\n ];\n\n const types = [\n 'LayoutEvent Object Type',\n 'PressEvent Object Type',\n 'React Node Object Type',\n 'Rect Object Type',\n 'ViewToken Object Type',\n ];\n\n return [\n makeGroup(\n 'Components',\n pages.filter(page => components.includes(page.name))\n ),\n makeGroup(\n 'Props',\n pages.filter(page => props.includes(page.name))\n ),\n makeGroup(\n 'APIs',\n pages.filter(page => apis.includes(page.name))\n ),\n makeGroup(\n 'Hooks',\n pages.filter(page => hooks.includes(page.name))\n ),\n makeGroup(\n 'Types',\n pages.filter(page => types.includes(page.name))\n ),\n ];\n}", "function onFBConnected()\r\n{\r\n // $.mobile.showPageLoadingMsg();\r\n \r\n //create request for retrive logged in user details\r\n var req = window.plugins.fbConnect.getMe();\r\n req.onload = checkfacebookid1;\r\n \r\n}", "function LoginByFB(){\n\t\t\t \t//console.log('LoginByFB');\n\t\t\t FB.login(function(response) {\n\t\t\t //console.log('appel de la function FB.login 1');\n\t\t\t //console.log(response);\n\t\t\t if (response.authResponse) {\n\t\t\t console.log('Welcome! Fetching your information.... ');\n\t\t\t console.log(response);\n\t\t\t getdatsForUser();\n\t\t\t } else {\n\t\t\t console.log('User cancelled login or did not fully authorize.');\n\t\t\t }\n\t\t\t }, {scope: 'public_profile,email'});\n\t\t\t }", "async componentDidMount() {\n let token = await AsyncStorage.getItem(\"fb_token\");\n if (token) {\n this.setState({ token }, () => {\n this.route();\n });\n } else {\n this.setState({ token: false });\n }\n }", "getStreamPosition() {\n return Native.getStreamPosition();\n }", "function facebookLoading(tabId, url){\n\n //get current sessions and global time\n chrome.storage.sync.get([\"open_sessions\", \"time\"], function(res){\n\n console.log(res)\n if(!res.open_sessions) res.open_sessions = {}\n if(res.open_sessions){\n let session = res.open_sessions[tabId]\n\n //if previous tab wasnt a facebook tab\n if(!session){\n //starts new session\n startSession(tabId, url)\n }\n else{\n //stops session on previous tab if it was a facebook tab\n stopSession(res, tabId, function(){\n //starts session on this tab\n startSession(tabId, url)\n })\n }\n }\n\n })\n}", "fbShareButtonClick() {\n\n\t\tconst quoteMessage= \n\t\t\t(this.state.request) ?\n\t\t\t\t`Fuckinator fuckinated my fucking text from \"${this.state.request}\" to: \"${this.state.response}\"`: null;\n\n\t\twindow.FB.ui({\n\t\t\tmethod: 'share',\n\t\t\thref: 'http://fuckinator.herokuapp.com/',\n\t\t\thashtag: '#fuckinator',\n\t\t\tmobile_iframe: true,\n\t\t\tquote: quoteMessage,\n\t\t}, res => {});\n\t}", "function run() {\n var service = getService();\n if (service.hasAccess()) {\n\n var url = 'https://graph.facebook.com/v2.6/me/accounts?';\n\n var response = UrlFetchApp.fetch(url, {\n headers: {\n 'Authorization': 'Bearer ' + service.getAccessToken()\n }\n });\n var result = JSON.parse(response.getContentText());\n Logger.log(JSON.stringify(result , null, 2));\n } else {\n var authorizationUrl = service.getAuthorizationUrl();\n\n Logger.log('Open the following URL and re-run the script: %s',authorizationUrl);\n \n\n\n}}", "initialize() {\n\n }", "function facebookCallback() {\n FB.Event.subscribe('edge.create', function() {\n goTo('twitter');\n });\n}", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }", "function getUserInfo22(){\n facebookConnectPlugin.api('me/?fields=id,name,email', ['email','public_profile'],\n function (result) {\n console.log(result);\n },\n function (error) {\n console.log(error);\n });\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 }" ]
[ "0.582302", "0.56352496", "0.55549705", "0.54886013", "0.5398446", "0.5384924", "0.53627056", "0.53269863", "0.5322178", "0.53158647", "0.53158647", "0.5293647", "0.5266638", "0.52168524", "0.5198115", "0.51917535", "0.5191675", "0.5155282", "0.5140739", "0.5130987", "0.5125228", "0.50612044", "0.50384825", "0.4994533", "0.4963794", "0.49494287", "0.4920699", "0.49172997", "0.49172997", "0.49109873", "0.48679346", "0.48598763", "0.48409885", "0.48362184", "0.48347414", "0.4833065", "0.48317224", "0.48292252", "0.48214182", "0.48178816", "0.48101723", "0.47992757", "0.479087", "0.4782981", "0.4779734", "0.47658285", "0.47606927", "0.47595543", "0.47516727", "0.47496825", "0.47358373", "0.47312933", "0.4723944", "0.4721448", "0.4721448", "0.47208112", "0.47187167", "0.4709441", "0.470743", "0.46975166", "0.469469", "0.469469", "0.46906915", "0.46872526", "0.46836653", "0.46794504", "0.46746978", "0.4668828", "0.46616083", "0.4661405", "0.46564507", "0.46423298", "0.46341956", "0.46333265", "0.46218747", "0.4617561", "0.4612999", "0.4612456", "0.46066615", "0.46027824", "0.45968086", "0.4593563", "0.4591945", "0.4591088", "0.45888823", "0.4583883", "0.45784658", "0.45751277", "0.45751277", "0.45751277", "0.45751277", "0.45751277", "0.45751277", "0.45751277", "0.45751277", "0.45751277", "0.45751277", "0.45751277", "0.45751277", "0.4573124", "0.45722064" ]
0.0
-1
v8 likes predictible objects
function Item(fun, array) { this.fun = fun; this.array = array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareLike(a,b){\n var al = a.idLikesProp.length;\n var bl = b.idLikesProp.length;\n if(al > bl) return -1;\n if(bl > al) return 1;\n return 0;\n}", "function lookAround() {\n var objectDescription = \"\"\n tj.see().then(function(objects) {\n objects.forEach(function(each) {\n if (each.score >= 0.4) {\n objectDescription = objectDescription + \", \" + each.class\n }\n })\n tj.speak(\"The objects I see are: \" + objectDescription)\n });\n}", "function recommendNewPosts() {\n model.loadModel();\n getNewPosts(function (err, posts) {\n var label\n ;\n posts.forEach(function (post) {\n label = model.classifyPost(post);\n if (label == 'like') {\n console.log(post);\n }\n });\n });\n }", "function BOT_onLike() {\r\n\tBOT_traceString += \"GOTO command judge\" + \"\\n\"; // change performative\r\n\tBOT_theReqJudgement = \"likeable\";\r\n\tBOT_onJudge(); \t\r\n\tif(BOT_reqSuccess) {\r\n\t\tvar ta = [BOT_theReqTopic,BOT_theReqAttribute]; \r\n\t\tBOT_del(BOT_theUserTopicId,\"distaste\",\"VAL\",ta);\r\n\t\tBOT_add(BOT_theUserTopicId,\"preference\",\"VAL\",ta);\r\n\t}\r\n}", "function like (data, archetype) {\n var name;\n\n for (name in archetype) {\n if (archetype.hasOwnProperty(name)) {\n if (data.hasOwnProperty(name) === false || typeof data[name] !== typeof archetype[name]) {\n return false;\n }\n\n if (object(data[name]) && like(data[name], archetype[name]) === false) {\n return false;\n }\n }\n }\n\n return true;\n }", "function LanguageUnderstandingModel() {\n }", "function guess() {\n classifier.predict(video.elt, 5, gotResult);\n}", "function theBigBang() {\n\t\tinitLibs();\n\t\tinitFuncs();\n\t\tObject.setPrototypeOf(Universe.prototype, universe.kjsclasses._primitive_prototype);\n\t\tObject.setPrototypeOf(Object.prototype, universe); // [0]\n\t}", "function readOwn(obj, name, pumpkin) {\n if (typeof obj !== 'object' || !obj) {\n if (typeOf(obj) !== 'object') {\n return pumpkin;\n }\n }\n if (typeof name === 'number' && name >= 0) {\n if (myOriginalHOP.call(obj, name)) { return obj[name]; }\n return pumpkin;\n }\n name = String(name);\n if (obj[name + '_canRead___'] === obj) { return obj[name]; }\n if (!myOriginalHOP.call(obj, name)) { return pumpkin; }\n // inline remaining relevant cases from canReadPub\n if (endsWith__.test(name)) { return pumpkin; }\n if (name === 'toString') { return pumpkin; }\n if (!isJSONContainer(obj)) { return pumpkin; }\n fastpathRead(obj, name);\n return obj[name];\n }", "function a(e,t,n){(n?Reflect.getOwnMetadataKeys(t,n):Reflect.getOwnMetadataKeys(t)).forEach(function(r){var i=n?Reflect.getOwnMetadata(r,t,n):Reflect.getOwnMetadata(r,t);n?Reflect.defineMetadata(r,i,e,n):Reflect.defineMetadata(r,i,e)})}", "function NXObject() {}", "function isPrimative(val) { return (typeof val !== 'object') }", "function like (data, duck) {\n var name;\n\n assert.object(data);\n assert.object(duck);\n\n for (name in duck) {\n if (duck.hasOwnProperty(name)) {\n if (data.hasOwnProperty(name) === false || typeof data[name] !== typeof duck[name]) {\n return false;\n }\n\n if (object(data[name]) && like(data[name], duck[name]) === false) {\n return false;\n }\n }\n }\n\n return true;\n }", "static get observedAttributes() {\n return ['rainbow', 'lang'];\n }", "function a(e,t,n){(n?Reflect.getOwnMetadataKeys(t,n):Reflect.getOwnMetadataKeys(t)).forEach((function(r){var i=n?Reflect.getOwnMetadata(r,t,n):Reflect.getOwnMetadata(r,t);n?Reflect.defineMetadata(r,i,e,n):Reflect.defineMetadata(r,i,e)}))}", "function testSimpleHole_prototype() {\n var theHole = Object.create({ x: \"in proto\" });\n var theReplacement = \"yay\";\n var serialized = bidar.serialize(theHole, holeFilter);\n var parsed = bidar.parse(serialized, holeFiller);\n\n assert.equal(parsed, theReplacement);\n\n function holeFilter(x) {\n assert.equal(x, theHole);\n return { data: \"blort\" };\n }\n\n function holeFiller(x) {\n assert.equal(x, \"blort\");\n return theReplacement;\n }\n}", "function test() {\n\t// \"ex nihilo\" object creation using the literal\n\t// object notation {}.\n\tvar foo = {\n\t\tname : \"foo\",\n\t\tone : 1,\n\t\ttwo : 2\n\t};\n\n\t// Another \"ex nihilo\" object.\n\tvar bar = {\n\t\ttwo : \"two\",\n\t\tthree : 3\n\t};\n\n\t// Gecko and Webkit JavaScript engines can directly\n\t// manipulate the internal prototype link.\n\t// For the sake of simplicity, let us pretend\n\t// that the following line works regardless of the\n\t// engine used:\n\tbar.__proto__ = foo; // foo is now the prototype of bar.\n\n\t// If we try to access foo's properties from bar\n\t// from now on, we'll succeed.\n\tlog(bar.one) // Resolves to 1.\n\n\t// The child object's properties are also accessible.\n\tlog(bar.three) // Resolves to 3.\n\n\t// Own properties shadow prototype properties\n\tlog(bar.two); // Resolves to \"two\"\n\tlog(foo.name); // unaffected, resolves to \"foo\"\n\tlog(bar.name); // Resolves to \"foo\"\n log(foo.__proto__);\n}", "function wrappedPrimitivePreviewer(className, classObj, objectActor, grip) {\r\n let {_obj} = objectActor;\r\n\r\n if (!_obj.proto || _obj.proto.class != className) {\r\n return false;\r\n }\r\n\r\n let raw = _obj.unsafeDereference();\r\n let v = null;\r\n try {\r\n v = classObj.prototype.valueOf.call(raw);\r\n } catch (ex) {\r\n // valueOf() can throw if the raw JS object is \"misbehaved\".\r\n return false;\r\n }\r\n\r\n if (v === null) {\r\n return false;\r\n }\r\n\r\n let canHandle = GenericObject(objectActor, grip, className === \"String\");\r\n if (!canHandle) {\r\n return false;\r\n }\r\n\r\n grip.preview.wrappedValue = objectActor.getGrip(makeDebuggeeValueIfNeeded(_obj, v));\r\n return true;\r\n}", "function DartObject(o) {\n this.o = o;\n}", "function i(t,e,n){(n?Reflect.getOwnMetadataKeys(e,n):Reflect.getOwnMetadataKeys(e)).forEach(function(r){var o=n?Reflect.getOwnMetadata(r,e,n):Reflect.getOwnMetadata(r,e);n?Reflect.defineMetadata(r,o,t,n):Reflect.defineMetadata(r,o,t)})}", "function i(t,e,n){(n?Reflect.getOwnMetadataKeys(e,n):Reflect.getOwnMetadataKeys(e)).forEach(function(r){var o=n?Reflect.getOwnMetadata(r,e,n):Reflect.getOwnMetadata(r,e);n?Reflect.defineMetadata(r,o,t,n):Reflect.defineMetadata(r,o,t)})}", "function likeVsLikes(toyLikeCount){\n\t\tif (toyLikeCount == 1){\n\t\t\treturn 'Like';\n\t\t} else {\n\t\t\treturn 'Likes';\n\t\t}\n\t}", "constructor(spec) {\n this.cached = /* @__PURE__ */ Object.create(null);\n let instanceSpec = this.spec = {};\n for (let prop in spec)\n instanceSpec[prop] = spec[prop];\n instanceSpec.nodes = OrderedMap.from(spec.nodes), instanceSpec.marks = OrderedMap.from(spec.marks || {}), this.nodes = NodeType$1.compile(this.spec.nodes, this);\n this.marks = MarkType.compile(this.spec.marks, this);\n let contentExprCache = /* @__PURE__ */ Object.create(null);\n for (let prop in this.nodes) {\n if (prop in this.marks)\n throw new RangeError(prop + \" can not be both a node and a mark\");\n let type = this.nodes[prop], contentExpr = type.spec.content || \"\", markExpr = type.spec.marks;\n type.contentMatch = contentExprCache[contentExpr] || (contentExprCache[contentExpr] = ContentMatch.parse(contentExpr, this.nodes));\n type.inlineContent = type.contentMatch.inlineContent;\n type.markSet = markExpr == \"_\" ? null : markExpr ? gatherMarks(this, markExpr.split(\" \")) : markExpr == \"\" || !type.inlineContent ? [] : null;\n }\n for (let prop in this.marks) {\n let type = this.marks[prop], excl = type.spec.excludes;\n type.excluded = excl == null ? [type] : excl == \"\" ? [] : gatherMarks(this, excl.split(\" \"));\n }\n this.nodeFromJSON = this.nodeFromJSON.bind(this);\n this.markFromJSON = this.markFromJSON.bind(this);\n this.topNodeType = this.nodes[this.spec.topNode || \"doc\"];\n this.cached.wrappings = /* @__PURE__ */ Object.create(null);\n }", "wordClass(word) {\r\n return {\r\n der: word.artikel == \"der\",\r\n die: word.artikel == \"die\",\r\n das: word.artikel == \"das\",\r\n marked: word.marker\r\n }\r\n }", "function dummyObjects(name, age){\n this.name = name\n this.age = age\n}", "function handleLikes() {\n // Get a random number\n let randomNumber = Math.random();\n // To make it unpredictable, only change the likes if =>\n if (randomNumber < REVEAL_PROBABILITY) {\n defineLikes();\n }\n}", "constructor() { \n \n Like.initialize(this);\n }", "like() {\r\n return this.clone(Comment, \"Like\").postCore();\r\n }", "like() {\r\n return this.getItem().then(i => {\r\n return i.like();\r\n });\r\n }", "added(vrobject){}", "classify(phrase) { return this.clf.classify(phrase) }", "function badIdea(){\n this.idea = \"bad\";\n}", "shouldSerialize(prop, dataKey) {\n const contains = (str, re) => (str.match(re) || []).length > 0;\n const a = contains(dataKey, /\\./g);\n const b = contains(dataKey, /\\[/g);\n return !!prop.object && !(a || b);\n }", "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 oldAndLoud(object){\n\tobject.age++;\n\tobject.name = object.name.toUpperCase();\n}", "like() {\r\n return this.clone(Item, \"like\").postCore();\r\n }", "function classifyPose() {\n if (pose && working) {\n inputs = [];\n for (let i = 0; i < pose.landmarks.length; i++) {\n inputs.push(pose.landmarks[i][0]);\n inputs.push(pose.landmarks[i][1]);\n inputs.push(pose.landmarks[i][2]);\n }\n brain.classify(inputs, gotResult)\n }\n }", "function PropertyDetection() {}", "constructor()\n {\n this.likes = [];\n }", "async TestLikeDoctorPost(){\n var response = await entity.Likes(6,28,true,true);\n //console.log(response)\n if(response != null){\n console.log(\"\\x1b[32m%s\\x1b[0m\",\"TestDOctorRating Passed\");\n }else{\n console.log(\"\\x1b[31m%s\\x1b[0m\",\"TestDOctorRating Failed\");\n }\n\n }", "function classifyVideo() {\n classifier.predict(gotResult);\n}", "function classifyVideo() {\n classifier.predict(gotResult);\n}", "function classifyVideo() {\n classifier.predict(gotResult);\n}", "function showLikes(likes) {\n\tconsole.log(`THINGS I LIKE:\\n`);\n\tfor(let like of likes) {\n\t\tconsole.log(like);\n\t}\n}", "function protoAugment(target,src,keys){/* eslint-disable no-proto */target.__proto__=src;/* eslint-enable no-proto */}", "function protoAugment(target,src,keys){/* eslint-disable no-proto */target.__proto__=src;/* eslint-enable no-proto */}", "function Nevis() {}", "function Nevis() {}", "function Nevis() {}", "test_primitivesExtended() {\n let translator = new Translator();\n translator.registerPackage(PackageFile);\n let text = JSON.stringify(this.json.primitivesExtended);\n let object = translator.decode(text).getRoot();\n Assert.equals(\"ca.frar.jjjrmi.translator.testclasses.PrimitivesExtended\", object.constructor.__getClass());\n Assert.equals(\"alpha16\", object.string);\n }", "function buildObjectsObj(gCloudV, azureCV, minScore = 0.0){\n let objects = [];\n\n if(gCloudV) {// gcloud vision results are available\n let gCloudObjects = gCloudV['localizedObjectAnnotations'];\n\n //apply standard bounding box to all the detected objects\n if(azureCV)// azure computer vision results are available\n gCloudVObjsToCogniBoundingBox(gCloudObjects, azureCV['metadata']['width'], azureCV['metadata']['height']);\n\n else//need to retrieve image sizes from gcloud (already done and put in the metadata tag of gcloudv with appropriate calls)\n gCloudVObjsToCogniBoundingBox(gCloudObjects, gCloudV['metadata']['width'], gCloudV['metadata']['height']);\n\n for (let gCloudObj of gCloudObjects) {\n if (gCloudObj['score'] > minScore) { //filter out unwanted tags\n objects.push({\n name: gCloudObj['name'],\n mid: (gCloudObj['mid'] && gCloudObj['mid']!= '')? gCloudObj['mid']: undefined,\n confidence: gCloudObj['score'],\n boundingBox: gCloudObj['boundingBox']\n });\n }\n }\n }\n\n if(azureCV){// azure computer vision results are available\n let azureObjects = azureCV['objects'];\n //apply standard bounding box to all the detected objects\n azureCVObjsToCogniBoundingBox(azureObjects, azureCV['metadata']['width'], azureCV['metadata']['height']);\n for(let aObj of azureObjects){\n if(aObj['confidence'] > minScore) { //filter out unwanted tags\n objects.push({\n name: aObj['object'],\n confidence: aObj['confidence'],\n boundingBox: aObj['boundingBox']\n });\n }\n }\n }\n\n objects = combineObjectsArray(objects);// build an array where labels regarding the same exact object are combined with averaged confidence\n\n objects.sort((a, b) => {\n if(a['confidence']>b['confidence'])\n return -1;\n else if(a['confidence']==b['confidence'])\n return 0;\n else\n return 1;\n });\n\n return objects;\n}", "function V(e){if(null===e||\"[object Object]\"!==function(e){return Object.prototype.toString.call(e)}(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}", "function classifyVideo() {\r\n classifier.classify(vid, gotResult);\r\n\r\n}", "function test_nountag_does_not_think_it_has_watch_tag_when_it_does_not() {\n Assert.equal(TagNoun.fromJSON(\"watch\"), undefined);\n}", "function v11(v12,v13) {\n const v15 = v11(Object,Function);\n // v15 = .unknown\n const v16 = Object(v13,v8,0,v6);\n // v16 = .object()\n const v17 = 0;\n // v17 = .integer\n const v18 = 1;\n // v18 = .integer\n const v19 = 512;\n // v19 = .integer\n const v20 = \"-1024\";\n // v20 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v21 = isFinite;\n // v21 = .function([.anything] => .boolean)\n const v23 = [1337];\n // v23 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v24 = {};\n // v24 = .object(ofGroup: Object, withProperties: [\"__proto__\"])\n let v25 = v23;\n const v26 = -29897853;\n // v26 = .integer\n const v27 = \"replace\";\n // v27 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v28 = Boolean;\n // v28 = .object(ofGroup: BooleanConstructor, withProperties: [\"prototype\"]) + .function([.anything] => .boolean) + .constructor([.anything] => .boolean)\n const v30 = [13.37,13.37];\n // v30 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v31 = 1337;\n // v31 = .integer\n let v32 = 13.37;\n const v36 = [13.37,13.37,13.37];\n // v36 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v38 = [1337,1337];\n // v38 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v39 = [13.37,1337,v38,1337,\"-128\",13.37,\"-128\",\"-128\",2147483647,1337];\n // v39 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v40 = {__proto__:v36,length:v39};\n // v40 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"length\"])\n const v41 = \"0\";\n // v41 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v42 = -4130093409;\n // v42 = .integer\n const v44 = {b:2147483647,e:v38,valueOf:v36};\n // v44 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"b\", \"valueOf\", \"e\"])\n const v45 = \"k**baeaDif\";\n // v45 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v46 = 65536;\n // v46 = .integer\n const v47 = \"k**baeaDif\";\n // v47 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v48 = 13.37;\n // v48 = .float\n const v50 = [13.37,13.37];\n // v50 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v51 = ~v50;\n // v51 = .boolean\n const v53 = [13.37];\n // v53 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n let v54 = v53;\n const v55 = gc;\n // v55 = .function([] => .undefined)\n const v58 = [13.37,13.37,13.37,13.37];\n // v58 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v60 = [1337,1337,1337,1337];\n // v60 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v61 = [3697200800,v58,v60];\n // v61 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v62 = {__proto__:3697200800,constructor:1337,e:3697200800,length:13.37,toString:3697200800,valueOf:v61};\n // v62 = .object(ofGroup: Object, withProperties: [\"e\", \"__proto__\", \"length\", \"constructor\", \"toString\", \"valueOf\"])\n const v65 = [13.37,13.37,13.37,13.37];\n // v65 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v67 = [1337,1337,1337,1337];\n // v67 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v68 = [3697200800,v65,v67];\n // v68 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v69 = {__proto__:3697200800,constructor:1337,e:3697200800,length:13.37,toString:3697200800,valueOf:v68};\n // v69 = .object(ofGroup: Object, withProperties: [\"e\", \"constructor\", \"__proto__\", \"length\", \"toString\", \"valueOf\"])\n const v70 = Object;\n // v70 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"setPrototypeOf\", \"assign\", \"fromEntries\", \"seal\", \"getOwnPropertyNames\", \"freeze\", \"defineProperty\", \"create\", \"getPrototypeOf\", \"getOwnPropertySymbols\", \"keys\", \"values\", \"isExtensible\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"preventExtensions\", \"defineProperties\", \"getOwnPropertyDescriptors\", \"isSealed\", \"isFrozen\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n function v71(v72) {\n }\n const v74 = [13.37];\n // v74 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v75 = 1337;\n // v75 = .integer\n const v76 = v44 ** 13.37;\n // v76 = .integer | .float | .bigint\n function v77(v78,v79,v80,v81,v82) {\n }\n let v83 = v74;\n const v84 = \"2\";\n // v84 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v85 = \"2\";\n // v85 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v88 = [13.37,13.37,1337,13.37];\n // v88 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n function v89(v90,v91,v92) {\n }\n const v94 = [1337,1337,1337,1337];\n // v94 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v95 = [3697200800,v88,v94];\n // v95 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n function v96(v97,v98) {\n }\n const v99 = {__proto__:3697200800,constructor:1337,e:3697200800,length:13.37,toString:3697200800,d:v95};\n // v99 = .object(ofGroup: Object, withProperties: [\"toString\", \"length\", \"constructor\", \"__proto__\", \"e\", \"d\"])\n let v100 = 13.37;\n const v101 = typeof v74;\n // v101 = .string\n const v102 = \"symbol\";\n // v102 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v103 = 3697200800;\n // v103 = .integer\n const v104 = \"2\";\n // v104 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v105 = Boolean;\n // v105 = .object(ofGroup: BooleanConstructor, withProperties: [\"prototype\"]) + .function([.anything] => .boolean) + .constructor([.anything] => .boolean)\n const v106 = Function;\n // v106 = .constructor([.string] => .object(ofGroup: Function, withProperties: [\"constructor\", \"arguments\", \"__proto__\", \"name\", \"caller\", \"prototype\", \"length\"], withMethods: [\"call\", \"bind\", \"apply\"]) + .function([.anything...] => .unknown) + .constructor([.anything...] => .unknown))\n const v107 = 13.37;\n // v107 = .float\n const v108 = 1337;\n // v108 = .integer\n const v109 = \"2\";\n // v109 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v110 = Function;\n // v110 = .constructor([.string] => .object(ofGroup: Function, withProperties: [\"constructor\", \"arguments\", \"__proto__\", \"name\", \"caller\", \"prototype\", \"length\"], withMethods: [\"call\", \"bind\", \"apply\"]) + .function([.anything...] => .unknown) + .constructor([.anything...] => .unknown))\n const v112 = [13.37,13.37,13.37,13.37];\n // v112 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v113 = 1337;\n // v113 = .integer\n let v114 = 13.37;\n const v116 = {...3697200800,...3697200800};\n // v116 = .object(ofGroup: Object, withProperties: [\"__proto__\"])\n const v117 = Object;\n // v117 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"setPrototypeOf\", \"assign\", \"fromEntries\", \"seal\", \"getOwnPropertyNames\", \"freeze\", \"defineProperty\", \"create\", \"getPrototypeOf\", \"getOwnPropertySymbols\", \"keys\", \"values\", \"isExtensible\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"preventExtensions\", \"defineProperties\", \"getOwnPropertyDescriptors\", \"isSealed\", \"isFrozen\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n const v118 = Function;\n // v118 = .constructor([.string] => .object(ofGroup: Function, withProperties: [\"constructor\", \"arguments\", \"__proto__\", \"name\", \"caller\", \"prototype\", \"length\"], withMethods: [\"call\", \"bind\", \"apply\"]) + .function([.anything...] => .unknown) + .constructor([.anything...] => .unknown))\n const v119 = {};\n // v119 = .object(ofGroup: Object, withProperties: [\"__proto__\"])\n let v120 = v119;\n const v121 = (3697200800).constructor;\n // v121 = .unknown\n function v122(v123,v124) {\n }\n const v125 = Promise;\n // v125 = .object(ofGroup: PromiseConstructor, withProperties: [\"prototype\"], withMethods: [\"race\", \"allSettled\", \"reject\", \"all\", \"resolve\"]) + .constructor([.function()] => .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"finally\", \"then\", \"catch\"]))\n const v128 = 4;\n // v128 = .integer\n let v129 = 0;\n const v131 = [13.37,13.37,13.37,13.37];\n // v131 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v133 = [1337,1337,1337,1337];\n // v133 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v134 = [3697200800,v131,v133];\n // v134 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v135 = Object;\n // v135 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"setPrototypeOf\", \"assign\", \"fromEntries\", \"seal\", \"getOwnPropertyNames\", \"freeze\", \"defineProperty\", \"create\", \"getPrototypeOf\", \"getOwnPropertySymbols\", \"keys\", \"values\", \"isExtensible\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"preventExtensions\", \"defineProperties\", \"getOwnPropertyDescriptors\", \"isSealed\", \"isFrozen\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n const v136 = -944747134;\n // v136 = .integer\n const v139 = [13.37,13.37,13.37,13.37];\n // v139 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v141 = [1337,1337,1337,1337];\n // v141 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v142 = [3697200800,v139,v141];\n // v142 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v143 = {__proto__:3697200800,constructor:1337,e:3697200800,length:13.37,toString:3697200800,valueOf:v142};\n // v143 = .object(ofGroup: Object, withProperties: [\"toString\", \"constructor\", \"e\", \"__proto__\", \"valueOf\", \"length\"])\n let v144 = v143;\n const v145 = gc;\n // v145 = .function([] => .undefined)\n let v146 = 13.37;\n const v150 = [13.37,13.37,13.37,Function];\n // v150 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v152 = [1337,1337,1337,1337];\n // v152 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v153 = [3697200800,v150,v152];\n // v153 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v154 = v153 + 1;\n // v154 = .primitive\n let v155 = 0;\n const v156 = v155 + 1;\n // v156 = .primitive\n const v158 = \"2\";\n // v158 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v160 = [13.37,13.37,13.37,13.37];\n // v160 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v162 = 0;\n // v162 = .integer\n const v163 = [1337,1337,1337,1337];\n // v163 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v164 = [3697200800,1337,v163];\n // v164 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v166 = 1337;\n // v166 = .integer\n let v167 = 2594067260;\n const v169 = 4;\n // v169 = .integer\n let v170 = 0;\n const v171 = v167 + 1;\n // v171 = .primitive\n const v172 = {__proto__:3697200800,constructor:v163,e:3697200800,length:13.37,toString:3697200800,valueOf:v164};\n // v172 = .object(ofGroup: Object, withProperties: [\"e\", \"__proto__\", \"constructor\", \"valueOf\", \"length\", \"toString\"])\n const v173 = 0;\n // v173 = .integer\n const v174 = 5;\n // v174 = .integer\n const v175 = 2937513072;\n // v175 = .integer\n const v176 = Object;\n // v176 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"setPrototypeOf\", \"assign\", \"fromEntries\", \"seal\", \"getOwnPropertyNames\", \"freeze\", \"defineProperty\", \"create\", \"getPrototypeOf\", \"getOwnPropertySymbols\", \"keys\", \"values\", \"isExtensible\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"preventExtensions\", \"defineProperties\", \"getOwnPropertyDescriptors\", \"isSealed\", \"isFrozen\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n const v177 = v172.constructor;\n // v177 = .unknown\n const v178 = 0;\n // v178 = .integer\n const v179 = 1;\n // v179 = .integer\n try {\n } catch(v180) {\n const v182 = [13.37,13.37,13.37,13.37];\n // v182 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v183 = v182.__proto__;\n // v183 = .object()\n function v185(v186) {\n }\n const v187 = Object >>> v183;\n // v187 = .integer | .bigint\n }\n function v188(v189,v190,v191,v192,...v193) {\n }\n}", "function markRaw(obj) {\r\n if (!(isPlainObject(obj) || isArray(obj)) || !Object.isExtensible(obj)) {\r\n return obj;\r\n }\r\n // set the vue observable flag at obj\r\n var ob = createObserver();\r\n ob.__raw__ = true;\r\n def(obj, '__ob__', ob);\r\n // mark as Raw\r\n rawSet.set(obj, true);\r\n return obj;\r\n}", "function markRaw(obj) {\r\n if (!(isPlainObject(obj) || isArray(obj)) || !Object.isExtensible(obj)) {\r\n return obj;\r\n }\r\n // set the vue observable flag at obj\r\n var ob = createObserver();\r\n ob.__raw__ = true;\r\n def(obj, '__ob__', ob);\r\n // mark as Raw\r\n rawSet.set(obj, true);\r\n return obj;\r\n}", "transient private internal function m185() {}", "function rekognizeLabels(bucket, key) {\n let params = {\n Image: {\n S3Object: {\n Bucket: bucket,\n Name: key\n }\n },\n MaxLabels: 3,\n MinConfidence: 80\n };\n\n return rekognition.detectLabels(params).promise()\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 }", "function LK_likeIt(elem) {\n var likeGroup = elem.getAttribute(LK_LIKEGROUP);\n var likeValue = elem.getAttribute(LK_LIKEVALUE);\n localStorage[likeGroup] = likeValue;\n\n // Change the style of the liker nodes\n var siblings = elem.parentNode.childNodes;\n for (var i = 0; i < siblings.length; i++) {\n if (siblings[i].style) { \n LK_applyNormalStyle(siblings[i]);\n }\n }\n LK_applySelectedStyle(elem, likeValue);\n\n // Change the value of any mini likers\n var allSpans = document.getElementsByTagName('span');\n for (var i = 0; i < allSpans.length; i++) {\n var span = allSpans[i];\n if (span.getAttribute(LK_LIKEGROUP) == likeGroup) {\n if (span.getAttribute(LK_LIKETYPE) == 'mini') {\n span.innerHTML = LK_MAPPINGS[likeValue].label;\n LK_applySelectedStyle(allSpans[i], likeValue);\n }\n }\n }\n}", "function OOPExample(who) {\n this.me = who;\n}", "getLikes(state, data) {\n state.likes = data\n }", "function _isAlternativeRecognitionResult(obj) {\r\n return obj && typeof obj === 'object';\r\n}", "function addLikes() {\n if (propLike?.includes(user.username)) {\n let index = propLike.indexOf(user.username);\n let removeLike = [\n ...propLike.slice(0, index),\n ...propLike.slice(index + 1),\n ];\n setLikeGet(removeLike);\n setPropLike(removeLike);\n setRedLike(\"\");\n\n addToLike(eventid, removeLike);\n } else {\n let likesArr = [...propLike, `${user.username}`];\n\n setLikeGet(likesArr);\n setPropLike(likesArr);\n setRedLike(\"red\");\n addToLike(eventid, likesArr);\n }\n }", "function LiteralObject() {\r\n}", "function Komunalne() {}", "function Bevy() {}", "function Prediction() {\n this.score = {};\n}", "function Object() {}", "function Object() {}", "function canEnumPub(obj, name) {\n if (obj === null) { return false; }\n if (obj === void 0) { return false; }\n name = String(name);\n if (obj[name + '_canEnum___']) { return true; }\n if (endsWith__.test(name)) { return false; }\n if (!isJSONContainer(obj)) { return false; }\n if (!myOriginalHOP.call(obj, name)) { return false; }\n fastpathEnum(obj, name);\n if (name === 'toString') { return true; }\n fastpathRead(obj, name);\n return true;\n }", "function Obj(){ return Literal.apply(this,arguments) }", "test_primitives() {\n let translator = new Translator();\n translator.registerPackage(PackageFile);\n let text = JSON.stringify(this.json.primitives);\n let object = translator.decode(text).getRoot();\n Assert.equals(\"ca.frar.jjjrmi.translator.testclasses.Primitives\", object.constructor.__getClass());\n Assert.equals(\"alpha9\", object.string);\n }", "function hello()\n{\n /* ATTRIBUTES */\n this.coolbeans = 'class';\n this.something = 'hello-class';\n\n}", "function test_cluster_tagged_crosshair_op_vsphere65() {}", "function classifyVideo() {\n classifier.classify(gotResult);\n}", "function classifyVideo() {\n classifier.classify(gotResult);\n}", "constructor(papa,mummy,sivlings,belongs,loving_bro,favs_bro){\n super(papa,mummy,sivlings,belongs)\n this.loving_bro=loving_bro\n this.favs_bro=favs_bro\n }", "function v8(v9,v10) {\n const v16 = [1337,1337];\n // v16 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v17 = [\"536870912\",-3848843708,v16,-3848843708,1337,13.37,13.37,WeakMap,-3848843708];\n // v17 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v18 = {constructor:13.37,e:v16};\n // v18 = .object(ofGroup: Object, withProperties: [\"constructor\", \"e\", \"__proto__\"])\n const v19 = {__proto__:-3848843708,a:v18,b:-3848843708,constructor:1337,d:v18,e:v17,length:WeakMap};\n // v19 = .object(ofGroup: Object, withProperties: [\"d\", \"b\", \"a\", \"__proto__\", \"e\", \"constructor\", \"length\"])\n const v21 = new Float64Array(v19);\n // v21 = .object(ofGroup: Float64Array, withProperties: [\"byteOffset\", \"constructor\", \"buffer\", \"__proto__\", \"byteLength\", \"length\"], withMethods: [\"map\", \"values\", \"subarray\", \"find\", \"fill\", \"set\", \"findIndex\", \"some\", \"reduceRight\", \"reverse\", \"join\", \"includes\", \"entries\", \"reduce\", \"every\", \"copyWithin\", \"sort\", \"forEach\", \"lastIndexOf\", \"indexOf\", \"filter\", \"slice\", \"keys\"])\n v6[6] = v7;\n v7.toString = v9;\n }", "function defineInspect(classObject) {\n var fn = classObject.prototype.toJSON;\n typeof fn === 'function' || invariant(0);\n classObject.prototype.inspect = fn; // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\n if (nodejsCustomInspectSymbol[\"a\" /* default */]) {\n classObject.prototype[nodejsCustomInspectSymbol[\"a\" /* default */]] = fn;\n }\n}", "annotate(message: string, data: Object) {\n this.message = message;\n this.data = assign(this.data, data);\n }", "function encodeObject(o) {\n if (_.isNumber(o)) {\n if (_.isNaN(o)) {\n return ['SPECIAL_FLOAT', 'NaN'];\n } else if (o === Infinity) {\n return ['SPECIAL_FLOAT', 'Infinity'];\n } else if (o === -Infinity) {\n return ['SPECIAL_FLOAT', '-Infinity'];\n } else {\n return o;\n }\n } else if (_.isString(o)) {\n return o;\n } else if (_.isBoolean(o) || _.isNull(o) || _.isUndefined(o)) {\n return ['JS_SPECIAL_VAL', String(o)];\n } else if (typeof o === 'symbol') {\n // ES6 symbol\n return ['JS_SPECIAL_VAL', String(o)];\n } else {\n // render these as heap objects\n\n // very important to use _.has since we don't want to\n // grab the property in your prototype, only in YOURSELF ... SUBTLE!\n if (!_.has(o, 'smallObjId_hidden_')) {\n // make this non-enumerable so that it doesn't show up in\n // console.log() or other inspector functions\n Object.defineProperty(o, 'smallObjId_hidden_', { value: smallObjId,\n enumerable: false });\n smallObjId++;\n }\n assert(o.smallObjId_hidden_ > 0);\n\n var ret = ['REF', o.smallObjId_hidden_];\n\n if (encodedHeapObjects[String(o.smallObjId_hidden_)] !== undefined) {\n return ret;\n }\n else {\n assert(_.isObject(o));\n\n var newEncodedObj = [];\n encodedHeapObjects[String(o.smallObjId_hidden_)] = newEncodedObj;\n\n var i;\n\n if (_.isFunction(o)) {\n var funcProperties = []; // each element is a pair of [name, encoded value]\n\n var encodedProto = null;\n if (_.isObject(o.prototype)) {\n // TRICKY TRICKY! for inheritance to be displayed properly, we\n // want to find the prototype of o.prototype and see if it's\n // non-empty. if that's true, then even if o.prototype is\n // empty (i.e., has no properties of its own), then we should\n // still encode it since its 'prototype' \"uber-hidden\n // property\" is non-empty\n var prototypeOfPrototype = Object.getPrototypeOf(o.prototype);\n if (!_.isEmpty(o.prototype) ||\n (_.isObject(prototypeOfPrototype) && !_.isEmpty(prototypeOfPrototype))) {\n encodedProto = encodeObject(o.prototype);\n }\n }\n\n if (encodedProto) {\n funcProperties.push(['prototype', encodedProto]);\n }\n\n // now get all of the normal properties out of this function\n // object (it's unusual to put properties in a function object,\n // but it's still legal!)\n var funcPropPairs = _.pairs(o);\n for (i = 0; i < funcPropPairs.length; i++) {\n funcProperties.push([funcPropPairs[i][0], encodeObject(funcPropPairs[i][1])]);\n }\n\n var funcCodeString = o.toString();\n\n /*\n\n #craftsmanship -- make nested functions look better by indenting\n the first line of a nested function definition by however much\n the LAST line is indented, ONLY if the last line is simply a\n single ending '}'. otherwise it will look ugly since the\n function definition doesn't start out indented, like so:\n\nfunction bar(x) {\n globalZ += 100;\n return x + y + globalZ;\n }\n\n */\n var codeLines = funcCodeString.split('\\n');\n if (codeLines.length > 1) {\n var lastLine = _.last(codeLines);\n if (lastLine.trim() === '}') {\n var lastLinePrefix = lastLine.slice(0, lastLine.indexOf('}'));\n funcCodeString = lastLinePrefix + funcCodeString; // prepend!\n }\n }\n\n newEncodedObj.push('JS_FUNCTION',\n o.name,\n funcCodeString, /* code string*/\n funcProperties.length ? funcProperties : null, /* OPTIONAL */\n null /* parent frame */);\n } else if (_.isArray(o)) {\n newEncodedObj.push('LIST');\n for (i = 0; i < o.length; i++) {\n newEncodedObj.push(encodeObject(o[i]));\n }\n } else if (o.__proto__.toString() === canonicalSet.__proto__.toString()) { // dunno why 'instanceof' doesn't work :(\n newEncodedObj.push('SET');\n // ES6 Set (TODO: add WeakSet)\n for (let item of o) {\n newEncodedObj.push(encodeObject(item));\n }\n } else if (o.__proto__.toString() === canonicalMap.__proto__.toString()) { // dunno why 'instanceof' doesn't work :(\n // ES6 Map (TODO: add WeakMap)\n newEncodedObj.push('DICT'); // use the Python 'DICT' type since it's close enough; adjust display in frontend\n for (let [key, value] of o) {\n newEncodedObj.push([encodeObject(key), encodeObject(value)]);\n }\n } else {\n // a true object\n\n // if there's a custom toString() function (note that a truly\n // prototypeless object won't have toString method, so check first to\n // see if toString is *anywhere* up the prototype chain)\n var s = (o.toString !== undefined) ? o.toString() : '';\n if (s !== '' && s !== '[object Object]') {\n newEncodedObj.push('INSTANCE_PPRINT', 'object', s);\n } else {\n newEncodedObj.push('INSTANCE', '');\n var pairs = _.pairs(o);\n for (i = 0; i < pairs.length; i++) {\n var e = pairs[i];\n newEncodedObj.push([encodeObject(e[0]), encodeObject(e[1])]);\n }\n\n var proto = Object.getPrototypeOf(o);\n if (_.isObject(proto) && !_.isEmpty(proto)) {\n //log('obj.prototype', proto, proto.smallObjId_hidden_);\n // I think __proto__ is the official term for this field,\n // *not* 'prototype'\n newEncodedObj.push(['__proto__', encodeObject(proto)]);\n }\n }\n }\n\n return ret;\n }\n\n }\n assert(false);\n}", "function dist_index_esm_contains(obj,key){return Object.prototype.hasOwnProperty.call(obj,key);}", "function isRawPostcodeObject(o, additionalAttr, blackListedAttr) {\n\tif (!additionalAttr) additionalAttr = [];\n\tif (!blackListedAttr) blackListedAttr = [];\n\tisSomeObject(o, rawPostcodeAttributes, additionalAttr, blackListedAttr);\n}", "function _meta_(v,m){var ms=v['__meta__']||{};for(var k in m){ms[k]=m[k]};v['__meta__']=ms;return v}", "function Animal() {\n this.kind = \"Dog\"\n}", "function Kitten(name, photo, interests, isGoodWithKids, isGoodWithDogs, isGoodWithCats) {\n this.name = name;\n this.photo = photo;\n this.interests = interests;\n this.isGoodWithKids = isGoodWithKids;\n this.isGoodWithCats = isGoodWithCats;\n this.isGoodWithDogs = isGoodWithDogs;\n}", "getMeta () {\n }", "function np(e){return\"[object Object]\"===Object.prototype.toString.call(e)}", "function Obj() {}", "function isFriend(name, object) {\n//use hasWord function to check object names array\n// console.log(object);\n// console.log(name);\n//conditional to check for property\nif (object['friends'] !== undefined) {\nreturn hasWord(object.friends.join(' '), name);\n}\nelse {return false};\n \n}", "function test_fail_hole_prototype() {\n var obj = Object.create({ stuff: \"in prototype\" });\n obj.foo = \"bar\";\n\n function f1() {\n bidar.serialize(obj);\n }\n assert.throws(f1, /Hole-ful graph, but no hole filter/);\n}", "function Person(saying) {\n this.saying = saying;\n /*\n return {\n dumbObject: true\n }\n */\n}", "transient private protected internal function m182() {}", "function kotlin(hljs) {\n const KEYWORDS = {\n keyword:\n 'abstract as val var vararg get set class object open private protected public noinline ' +\n 'crossinline dynamic final enum if else do while for when throw try catch finally ' +\n 'import package is in fun override companion reified inline lateinit init ' +\n 'interface annotation data sealed internal infix operator out by constructor super ' +\n 'tailrec where const inner suspend typealias external expect actual',\n built_in:\n 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal:\n 'true false null'\n };\n const KEYWORDS_WITH_LABEL = {\n className: 'keyword',\n begin: /\\b(break|continue|return|this)\\b/,\n starts: {\n contains: [\n {\n className: 'symbol',\n begin: /@\\w+/\n }\n ]\n }\n };\n const LABEL = {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '@'\n };\n\n // for string templates\n const SUBST = {\n className: 'subst',\n begin: /\\$\\{/,\n end: /\\}/,\n contains: [ hljs.C_NUMBER_MODE ]\n };\n const VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + hljs.UNDERSCORE_IDENT_RE\n };\n const STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"\"\"',\n end: '\"\"\"(?=[^\"])',\n contains: [\n VARIABLE,\n SUBST\n ]\n },\n // Can't use built-in modes easily, as we want to use STRING in the meta\n // context as 'meta-string' and there's no syntax to remove explicitly set\n // classNames in built-in modes.\n {\n begin: '\\'',\n end: '\\'',\n illegal: /\\n/,\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '\"',\n end: '\"',\n illegal: /\\n/,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n VARIABLE,\n SUBST\n ]\n }\n ]\n };\n SUBST.contains.push(STRING);\n\n const ANNOTATION_USE_SITE = {\n className: 'meta',\n begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'\n };\n const ANNOTATION = {\n className: 'meta',\n begin: '@' + hljs.UNDERSCORE_IDENT_RE,\n contains: [\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n hljs.inherit(STRING, {\n className: 'meta-string'\n })\n ]\n }\n ]\n };\n\n // https://kotlinlang.org/docs/reference/whatsnew11.html#underscores-in-numeric-literals\n // According to the doc above, the number mode of kotlin is the same as java 8,\n // so the code below is copied from java.js\n const KOTLIN_NUMBER_MODE = NUMERIC;\n const KOTLIN_NESTED_COMMENT = hljs.COMMENT(\n '/\\\\*', '\\\\*/',\n {\n contains: [ hljs.C_BLOCK_COMMENT_MODE ]\n }\n );\n const KOTLIN_PAREN_TYPE = {\n variants: [\n {\n className: 'type',\n begin: hljs.UNDERSCORE_IDENT_RE\n },\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [] // defined later\n }\n ]\n };\n const KOTLIN_PAREN_TYPE2 = KOTLIN_PAREN_TYPE;\n KOTLIN_PAREN_TYPE2.variants[1].contains = [ KOTLIN_PAREN_TYPE ];\n KOTLIN_PAREN_TYPE.variants[1].contains = [ KOTLIN_PAREN_TYPE2 ];\n\n return {\n name: 'Kotlin',\n aliases: [ 'kt' ],\n keywords: KEYWORDS,\n contains: [\n hljs.COMMENT(\n '/\\\\*\\\\*',\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n }\n ]\n }\n ),\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n KEYWORDS_WITH_LABEL,\n LABEL,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n {\n className: 'function',\n beginKeywords: 'fun',\n end: '[(]|$',\n returnBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS,\n relevance: 5,\n contains: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n returnBegin: true,\n relevance: 0,\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n {\n className: 'type',\n begin: /</,\n end: />/,\n keywords: 'reified',\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n begin: /:/,\n end: /[=,\\/]/,\n endsWithParent: true,\n contains: [\n KOTLIN_PAREN_TYPE,\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT\n ],\n relevance: 0\n },\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n STRING,\n hljs.C_NUMBER_MODE\n ]\n },\n KOTLIN_NESTED_COMMENT\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [\n {\n beginKeywords: 'public protected internal private constructor'\n },\n hljs.UNDERSCORE_TITLE_MODE,\n {\n className: 'type',\n begin: /</,\n end: />/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type',\n begin: /[,:]\\s*/,\n end: /[<\\(,]|$/,\n excludeBegin: true,\n returnEnd: true\n },\n ANNOTATION_USE_SITE,\n ANNOTATION\n ]\n },\n STRING,\n {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n },\n KOTLIN_NUMBER_MODE\n ]\n };\n}", "function kotlin(hljs) {\n const KEYWORDS = {\n keyword:\n 'abstract as val var vararg get set class object open private protected public noinline ' +\n 'crossinline dynamic final enum if else do while for when throw try catch finally ' +\n 'import package is in fun override companion reified inline lateinit init ' +\n 'interface annotation data sealed internal infix operator out by constructor super ' +\n 'tailrec where const inner suspend typealias external expect actual',\n built_in:\n 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal:\n 'true false null'\n };\n const KEYWORDS_WITH_LABEL = {\n className: 'keyword',\n begin: /\\b(break|continue|return|this)\\b/,\n starts: {\n contains: [\n {\n className: 'symbol',\n begin: /@\\w+/\n }\n ]\n }\n };\n const LABEL = {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '@'\n };\n\n // for string templates\n const SUBST = {\n className: 'subst',\n begin: /\\$\\{/,\n end: /\\}/,\n contains: [ hljs.C_NUMBER_MODE ]\n };\n const VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + hljs.UNDERSCORE_IDENT_RE\n };\n const STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"\"\"',\n end: '\"\"\"(?=[^\"])',\n contains: [\n VARIABLE,\n SUBST\n ]\n },\n // Can't use built-in modes easily, as we want to use STRING in the meta\n // context as 'meta-string' and there's no syntax to remove explicitly set\n // classNames in built-in modes.\n {\n begin: '\\'',\n end: '\\'',\n illegal: /\\n/,\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '\"',\n end: '\"',\n illegal: /\\n/,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n VARIABLE,\n SUBST\n ]\n }\n ]\n };\n SUBST.contains.push(STRING);\n\n const ANNOTATION_USE_SITE = {\n className: 'meta',\n begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'\n };\n const ANNOTATION = {\n className: 'meta',\n begin: '@' + hljs.UNDERSCORE_IDENT_RE,\n contains: [\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n hljs.inherit(STRING, {\n className: 'meta-string'\n })\n ]\n }\n ]\n };\n\n // https://kotlinlang.org/docs/reference/whatsnew11.html#underscores-in-numeric-literals\n // According to the doc above, the number mode of kotlin is the same as java 8,\n // so the code below is copied from java.js\n const KOTLIN_NUMBER_MODE = NUMERIC;\n const KOTLIN_NESTED_COMMENT = hljs.COMMENT(\n '/\\\\*', '\\\\*/',\n {\n contains: [ hljs.C_BLOCK_COMMENT_MODE ]\n }\n );\n const KOTLIN_PAREN_TYPE = {\n variants: [\n {\n className: 'type',\n begin: hljs.UNDERSCORE_IDENT_RE\n },\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [] // defined later\n }\n ]\n };\n const KOTLIN_PAREN_TYPE2 = KOTLIN_PAREN_TYPE;\n KOTLIN_PAREN_TYPE2.variants[1].contains = [ KOTLIN_PAREN_TYPE ];\n KOTLIN_PAREN_TYPE.variants[1].contains = [ KOTLIN_PAREN_TYPE2 ];\n\n return {\n name: 'Kotlin',\n aliases: [ 'kt' ],\n keywords: KEYWORDS,\n contains: [\n hljs.COMMENT(\n '/\\\\*\\\\*',\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n }\n ]\n }\n ),\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n KEYWORDS_WITH_LABEL,\n LABEL,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n {\n className: 'function',\n beginKeywords: 'fun',\n end: '[(]|$',\n returnBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS,\n relevance: 5,\n contains: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n returnBegin: true,\n relevance: 0,\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n {\n className: 'type',\n begin: /</,\n end: />/,\n keywords: 'reified',\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n begin: /:/,\n end: /[=,\\/]/,\n endsWithParent: true,\n contains: [\n KOTLIN_PAREN_TYPE,\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT\n ],\n relevance: 0\n },\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n STRING,\n hljs.C_NUMBER_MODE\n ]\n },\n KOTLIN_NESTED_COMMENT\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [\n {\n beginKeywords: 'public protected internal private constructor'\n },\n hljs.UNDERSCORE_TITLE_MODE,\n {\n className: 'type',\n begin: /</,\n end: />/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type',\n begin: /[,:]\\s*/,\n end: /[<\\(,]|$/,\n excludeBegin: true,\n returnEnd: true\n },\n ANNOTATION_USE_SITE,\n ANNOTATION\n ]\n },\n STRING,\n {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n },\n KOTLIN_NUMBER_MODE\n ]\n };\n}", "function Surrogate(){}", "function Surrogate(){}", "function Surrogate(){}", "static serialize(obj, allowPrimitives, fallbackToJson, requireJsonType = false) {\n if (allowPrimitives) {\n if (typeof obj === \"string\") {\n return this.serializePrimitive(obj, \"string\");\n } else if (typeof obj === \"number\") {\n return this.serializePrimitive(obj, \"double\");\n } else if (Buffer.isBuffer(obj)) {\n return this.serializePrimitive(obj, \"bytes\");\n } else if (typeof obj === \"boolean\") {\n return this.serializePrimitive(obj, \"bool\");\n } else if (Long.isLong(obj)) {\n return this.serializePrimitive(obj, \"int64\");\n }\n }\n if (obj.constructor && typeof obj.constructor.encode === \"function\" && obj.constructor.$type) {\n return Any.create({\n // I have *no* idea why it's type_url and not typeUrl, but it is.\n type_url: \"type.googleapis.com/\" + AnySupport.fullNameOf(obj.constructor.$type),\n value: obj.constructor.encode(obj).finish()\n });\n } else if (fallbackToJson && typeof obj === \"object\") {\n let type = obj.type;\n if (type === undefined) {\n if (requireJsonType) {\n throw new Error(util.format(\"Fallback to JSON serialization supported, but object does not define a type property: %o\", obj));\n } else {\n type = \"object\";\n }\n }\n return Any.create({\n type_url: CloudStateJson + type,\n value: this.serializePrimitiveValue(stableJsonStringify(obj), \"string\")\n });\n } else {\n throw new Error(util.format(\"Object %o is not a protobuf object, and hence can't be dynamically \" +\n \"serialized. Try passing the object to the protobuf classes create function.\", obj));\n }\n }" ]
[ "0.527866", "0.52612406", "0.51951283", "0.518796", "0.51302594", "0.5044646", "0.48934332", "0.4857401", "0.484017", "0.48302925", "0.482028", "0.4812441", "0.4808473", "0.47852293", "0.47828078", "0.47574478", "0.47493434", "0.4739314", "0.47239366", "0.4703992", "0.4703992", "0.46990207", "0.4690639", "0.46904448", "0.46862254", "0.46716532", "0.46667543", "0.46522382", "0.46354175", "0.46053663", "0.46017453", "0.45926702", "0.45891586", "0.45877746", "0.458541", "0.45851982", "0.45847243", "0.4584686", "0.458378", "0.45767823", "0.45753202", "0.45753202", "0.45753202", "0.45713404", "0.45637134", "0.45637134", "0.4557141", "0.4557141", "0.4557141", "0.45494914", "0.45366898", "0.45342454", "0.4533338", "0.45322663", "0.45229813", "0.452288", "0.452288", "0.45159692", "0.45102093", "0.45099118", "0.45062032", "0.4506134", "0.45033473", "0.4502599", "0.44998378", "0.4497197", "0.44843012", "0.44764578", "0.44738895", "0.44715428", "0.44715428", "0.4471341", "0.44594073", "0.44552016", "0.44538808", "0.44522536", "0.44464657", "0.44464657", "0.4443469", "0.4443427", "0.44433454", "0.4437557", "0.4436382", "0.4430658", "0.4429719", "0.4428169", "0.44260293", "0.4420813", "0.44155774", "0.44130567", "0.4406073", "0.4401904", "0.44010627", "0.43994573", "0.43948644", "0.43847254", "0.43847254", "0.43830302", "0.43830302", "0.43830302", "0.4381413" ]
0.0
-1
inlined Object.is polyfill to avoid requiring consumers ship their own /eslintdisable noselfcompare
function is(x, y) { // SameValue algorithm if (x === y) { // Steps 1-5, 7-10 // Steps 6.b-6.e: +0 != -0 return x !== 0 || 1 / x === 1 / y; } else { // Step 6.a: NaN == NaN return x !== x && y !== y; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isObject$1(obj) {\n // incase of arrow function and array\n return Object(obj) === obj && String(obj) === '[object Object]' && !isFunction(obj) && !isArray(obj);\n }", "function isObject$1(obj) {\n // incase of arrow function and array\n return Object(obj) === obj && String(obj) === '[object Object]' && !isFunction(obj) && !isArray(obj);\n }", "function u(e){return!0===\n/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\nfunction(e){return null!=e&&\"object\"==typeof e&&!1===Array.isArray(e)}(e)&&\"[object Object]\"===Object.prototype.toString.call(e)}", "function isObject$1(obj) {\n // incase of arrow function and array\n return Object(obj) === obj && String(obj) === '[object Object]' && !isFunction(obj) && !isArray$1(obj);\n}", "function i(e){return!0===\n/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\nfunction(e){return null!=e&&\"object\"==typeof e&&!1===Array.isArray(e)}(e)&&\"[object Object]\"===Object.prototype.toString.call(e)}", "function is(obj) {\n return obj instanceof __WEBPACK_IMPORTED_MODULE_3__Range__[\"c\" /* default */];\n}", "function isObject(obj) {\n // incase of arrow function and array\n return Object(obj) === obj && String(obj) === '[object Object]' && !isFunction(obj) && !isArray(obj);\n }", "function _isPlainObject(obj) {\n return (obj && obj.constructor.prototype === Object.prototype);\n}", "__is_object(value) {\n return value && typeof value === 'object' && value.constructor === Object;\n }", "function isObject(obj) { // 71\n\t\treturn toString.call(obj) === '[object Object]'; // 72\n\t} // 73", "isPlainObject(obj) {\n return _toString.call(obj) === '[object Object]'\n }", "function isObject$1(obj) {\n return kindOf(obj) === 'object' || kindOf(obj) === 'function';\n}", "function isObject$1(obj) {\n return kindOf(obj) === 'object' || kindOf(obj) === 'function';\n}", "function isObject$1(obj) {\n return kindOf(obj) === 'object' || kindOf(obj) === 'function';\n}", "function isObject$1(obj) {\n return kindOf(obj) === 'object' || kindOf(obj) === 'function';\n}", "isObject(obj) {\n return obj !== null && typeof obj === 'object'\n }", "function isObject(obj) {\n // incase of arrow function and array\n return Object(obj) === obj && String(obj) === '[object Object]' && !isFunction(obj) && !isArray(obj);\n }", "function isObjectLike(value) {\n return _typeof$1(value) == 'object' && value !== null;\n }", "function isObjectLike$a(value) {\n return typeof value == 'object' && value !== null;\n}", "function isObject(o) { return typeof o === 'object'; }", "function isObject(o) { return typeof o === 'object'; }", "function isObject(o) { return typeof o === 'object'; }", "static hasObjectify(object) {\n return isObjectAssigned(object) && isFunction(object.objectify);\n }", "function isObjectLike(value) {\n return typeof value === \"object\" && !!value;\n}", "function isObjectObject(o){return!0===\n/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\nfunction isObject(val){return null!=val&&\"object\"==typeof val&&!1===Array.isArray(val)}(o)&&\"[object Object]\"===Object.prototype.toString.call(o)}", "function isObjectObject(o){return!0===\n/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\nfunction isObject(val){return null!=val&&\"object\"==typeof val&&!1===Array.isArray(val)}(o)&&\"[object Object]\"===Object.prototype.toString.call(o)}", "function isObjectObject(o){return!0===\n/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\nfunction isObject(val){return null!=val&&\"object\"==typeof val&&!1===Array.isArray(val)}(o)&&\"[object Object]\"===Object.prototype.toString.call(o)}", "function isObjectObject(o){return!0===\n/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\nfunction isObject(val){return null!=val&&\"object\"==typeof val&&!1===Array.isArray(val)}(o)&&\"[object Object]\"===Object.prototype.toString.call(o)}", "function isObjectObject(o){return!0===\n/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\nfunction isObject(val){return null!=val&&\"object\"==typeof val&&!1===Array.isArray(val)}(o)&&\"[object Object]\"===Object.prototype.toString.call(o)}", "function isObjectObject(o){return!0===\n/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\nfunction isObject(val){return null!=val&&\"object\"==typeof val&&!1===Array.isArray(val)}(o)&&\"[object Object]\"===Object.prototype.toString.call(o)}", "function isObjectObject(o){return!0===\n/*!\n * isobject <https://github.com/jonschlinkert/isobject>\n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\nfunction isObject(val){return null!=val&&\"object\"==typeof val&&!1===Array.isArray(val)}(o)&&\"[object Object]\"===Object.prototype.toString.call(o)}", "function isObject(obj) {\n return obj === Object(obj);\n}", "function isObject(entry) {\n return entry.constructor === Object;\n}", "function isObject(obj) {\n return obj === Object(obj);\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}", "__key_in_object(object, key) {\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n return true\n } else {\n return false\n }\n }", "function utilIsIterable(obj) {\n\t\treturn obj != null && typeof obj[Symbol.iterator] === 'function'; // lazy equality for null\n\t}", "function isObjectLike(value) {\n return value != null && (typeof value === \"function\" || typeof value === \"object\");\n}", "function isObjectLike(obj) {\n return typeof obj === \"object\" && obj !== null;\n}", "function isObject (o) { return o && typeof o === 'object' }", "function isObject (o) { return o && typeof o === 'object' }", "function isObject$8(val) {\n return kindOf$3(val) === 'object' || typeof val === 'function';\n}", "function isObject(obj){\n return Object.prototype.toString.call(obj) == '[object Object]';\n }", "function isObject$1(e){return\"[object Object]\"===Object.prototype.toString.call(e)}", "function isObject(value) { return typeof value === \"object\" && value !== null; }", "function _isObject(v) {\n return (Object.prototype.toString.call(v) === '[object Object]');\n}", "function _isObject(v) {\n return (Object.prototype.toString.call(v) === '[object Object]');\n}", "function _isObject(v) {\n return (Object.prototype.toString.call(v) === '[object Object]');\n}", "function _isObject(v) {\n return (Object.prototype.toString.call(v) === '[object Object]');\n}", "function _isObject(v) {\n return (Object.prototype.toString.call(v) === '[object Object]');\n}", "function isObj$1(something) {\n return typeDetect(something) === 'Object';\n}", "function isObject(a) {\n return (!!a) && (a.constructor === Object);\n}", "function isObject(o){ return typeof o === 'object' && o !== null; }", "function isObject$2556(x$2572) {\n return function isObject$2556(x$2573) {\n return function (a0$2574) {\n if (Object.prototype.toString.call(a0$2574) === '[object Object]') {\n return true;\n }\n return false;\n }.call(this, x$2573);\n }.curry().apply(null, arguments);\n }", "function isObject(obj) {\n\n return obj && typeof obj === \"object\";\n}", "isObjectEqual(a, b) {\n return a && b && a.foo === b.foo;\n }", "function objectHasEnumerableKeys(value) {\n for (const _ in value) return true;\n return false;\n}", "function isObject(x) {\n return x != null && typeof x === 'object';\n}", "function isObject(o) {\n return o === Object(o);\n}", "function isObject( x ) {\n return typeof x === \"object\" && x !== null;\n }", "function isFrozen(obj) {\n if (!obj) { return true; }\n // TODO(erights): Object(<primitive>) wrappers should also be\n // considered frozen.\n if (obj.FROZEN___ === obj) { return true; }\n var t = typeof obj;\n return t !== 'object' && t !== 'function';\n }", "function isIterableObject(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n var t = typeof(obj);\n var types = {'string': 0, 'function': 0, 'number': 0, 'undefined': 0, 'boolean': 0};\n return types[t] === undefined;\n}", "function isObject(value) {\n return typeof value === 'object' && !!value;\n}", "function isObject(x) {\n return typeof x === \"object\" && x !== null;\n}", "function isObject$1(value) {\n return _typeof_1(value) === \"object\" && value !== null;\n}", "function isObject$1(value) {\n return _typeof_1(value) === \"object\" && value !== null;\n}", "function isObject$1(value) {\n return typeof value === 'object' && value !== null || typeof value === 'function';\n }", "function isObject(obj) {\n return kindOf(obj) === 'object' || kindOf(obj) === 'function';\n}", "function isObject(e){return Object.prototype.toString.call(e)===\"[object Object]\"}", "function isObject(obj){return obj!==null&&(typeof obj===\"undefined\"?\"undefined\":_typeof2(obj))==='object';}", "function isObject(obj){return obj!==null&&(typeof obj===\"undefined\"?\"undefined\":_typeof2(obj))==='object';}", "function isObject(obj) {\n return Object.prototype.toString.call(obj) === '[object Object]';\n}", "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "function isObject$1(obj) {\n return obj !== null && _typeof(obj) === 'object' && 'constructor' in obj && obj.constructor === Object;\n }", "function IsObject(x) {\r\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\r\n }", "function IsObject(x) {\r\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\r\n }", "function IsObject(x) {\r\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\r\n }", "function isObject_(test) {\r\n return Object.prototype.toString.call(test) === '[object Object]';\r\n}", "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }", "function isObject(value) {\n return value && typeof value === 'object';\n}", "function isObject$2(value) {\n return (\n typeof value === \"object\" &&\n value !== null &&\n // none of these are collection objects, so we can return false\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Error) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)\n );\n}", "function isObject$2(value) {\n return (\n typeof value === \"object\" &&\n value !== null &&\n // none of these are collection objects, so we can return false\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Error) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)\n );\n}", "function isPlainObject(obj){return _toString.call(obj)==='[object Object]';}" ]
[ "0.67307776", "0.6633116", "0.6609801", "0.65994185", "0.65991455", "0.65645915", "0.65056276", "0.6466668", "0.64615506", "0.6410588", "0.63689065", "0.63643163", "0.63643163", "0.63643163", "0.63643163", "0.6356162", "0.63265204", "0.6321958", "0.632186", "0.6294811", "0.6294811", "0.6294811", "0.62935305", "0.62907815", "0.62846714", "0.62846714", "0.62846714", "0.62846714", "0.62846714", "0.62846714", "0.62846714", "0.6269864", "0.625032", "0.62444705", "0.62408644", "0.62408644", "0.62408644", "0.62408644", "0.62408644", "0.62408644", "0.62408644", "0.62408644", "0.62408644", "0.62408644", "0.62408644", "0.62408644", "0.6240368", "0.62384254", "0.6236494", "0.62330014", "0.6230255", "0.6230255", "0.6228712", "0.621783", "0.61976266", "0.6193841", "0.618831", "0.618831", "0.618831", "0.618831", "0.618831", "0.6183513", "0.61549383", "0.6152623", "0.6145344", "0.6140672", "0.6137567", "0.61278707", "0.61252975", "0.6110759", "0.61070794", "0.6099045", "0.60854375", "0.6083357", "0.6082682", "0.60825914", "0.60825914", "0.607802", "0.607497", "0.6064985", "0.6059905", "0.6059905", "0.60547465", "0.605352", "0.605352", "0.605352", "0.605352", "0.605352", "0.605352", "0.605352", "0.6050385", "0.6048408", "0.6048408", "0.6048408", "0.6041412", "0.6040349", "0.6040349", "0.60382384", "0.6033936", "0.6033936", "0.60324776" ]
0.0
-1
Equivalent of `typeof` but with special handling for array and regexp.
function getPropType(propValue) { var propType = typeof propValue; if (Array.isArray(propValue)) { return 'array'; } if (propValue instanceof RegExp) { // Old webkits (at least until Android 4.0) return 'function' rather than // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ // passes PropTypes.object. return 'object'; } if (isSymbol(propType, propValue)) { return 'symbol'; } return propType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sc_typeof( x ) {\n return typeof x;\n}", "static type(arg)\n {\n const types = [\n 'array', 'boolean', 'function', 'number',\n 'null', 'object', 'regexp', 'symbol', 'string',\n 'undefined'\n ]\n\n var type = Object.prototype.toString.call(arg),\n type = type.match(/^\\[.+ (.+)\\]$/),\n type = type[1],\n type = type.toLowerCase()\n\n if (types.indexOf(type) !== -1) {\n return type\n }\n\n return typeof arg\n }", "function AsYouType_typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { AsYouType_typeof = function _typeof(obj) { return typeof obj; }; } else { AsYouType_typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return AsYouType_typeof(obj); }", "function type(input) {\n \treturn typeof input\n}", "function _typeof$1(obj) {\n\t \"@babel/helpers - typeof\";\n\n\t return _typeof$1 = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n\t return typeof obj;\n\t } : function (obj) {\n\t return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n\t }, _typeof$1(obj);\n\t}", "function _typeOf ( value )\n\t{\n\t\tvar type;\n\n\t\ttype = typeof value;\n\t\tif ( type === \"number\" )\n\t\t{\n\t\t\tif ( isNaN( value ) )\n\t\t\t{\n\t\t\t\ttype = \"NaN\";\n\t\t\t}\n\t\t}\n\t\telse if ( type === \"object\" )\n\t\t{\n\t\t\tif ( value )\n\t\t\t{\n\t\t\t\tif ( value instanceof Array )\n\t\t\t\t{\n\t\t\t\t\ttype = \"array\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttype = \"null\";\n\t\t\t}\n\t\t}\n\n\t\treturn type;\n\t}", "function _typeOf ( value )\n\t{\n\t\tvar type;\n\n\t\ttype = typeof value;\n\t\tif ( type === \"number\" )\n\t\t{\n\t\t\tif ( isNaN( value ) )\n\t\t\t{\n\t\t\t\ttype = \"NaN\";\n\t\t\t}\n\t\t}\n\t\telse if ( type === \"object\" )\n\t\t{\n\t\t\tif ( value )\n\t\t\t{\n\t\t\t\tif ( value instanceof Array )\n\t\t\t\t{\n\t\t\t\t\ttype = \"array\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttype = \"null\";\n\t\t\t}\n\t\t}\n\n\t\treturn type;\n\t}", "function typeStr (obj) {\n\t return isArray(obj) ? 'array' : typeof obj;\n\t }", "function typeStr (obj) {\n\t return isArray(obj) ? 'array' : typeof obj;\n\t }", "function $type(obj) {\n if (obj == undefined) return false;\n\n if (obj.$family) return (obj.$family.name == 'number' && !isFinite(obj)) ? false : obj.$family.name;\n if (obj.nodeName){\n switch (obj.nodeType) {\n case 1: return 'element';\n case 9: return 'window';\n case 3: return (/\\S/).test(obj.nodeValue) ? 'textnode' : 'whitespace';\n }\n } else if (obj.window) {\n return 'element';\n } else if (typeof obj.length == 'number') {\n if (obj.callee) {\n return 'arguments';\n } else if (obj.item) {\n return 'collection';\n }\n }\n return typeof obj;\n}", "function getType(data) {\n return typeof data;\n}", "function _typeof(t){return(_typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}", "function _typeof(t){return(_typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t})(t)}", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function $type(obj) {\r\n\t\tif (obj.nodeType) {\r\n\t\t\tswitch(obj.nodeType) {\r\n\t\t\t\tcase 1: return \"element\"; break;\r\n\t\t\t\tcase 3: return \"textnode\"; break;\r\n\t\t\t\tcase 9: return \"document\"; break;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (obj.item && obj.length) return \"collection\";\r\n\t\tif (obj.nodeName) return obj.nodeName;\r\n\t\tif (obj.sort) return \"array\";\r\n\t\treturn typeof(obj);\r\n\t}", "function getType(arg) {\n return typeof arg;\n}", "function whatDatatype(arg){\n return typeof(arg);\n}", "function typeOf(b){var a=typeof b;if(a===\"object\"){if(b){if(typeof b.length===\"number\"&&!(b.propertyIsEnumerable(\"length\"))&&typeof b.splice===\"function\"){a=\"array\"}}else{a=\"null\"}}return a}", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "function typeStr (obj) {\r\n return isArray(obj) ? 'array' : typeof obj;\r\n }", "function typeOf(value) {\n\tvar s = typeof value;\n\tif (s === 'object') {\n\t\tif (value) {\n\t\t\tif (typeof value.length === 'number' &&\n\t\t\t\t\t!(value.propertyIsEnumerable('length')) &&\n\t\t\t\t\ttypeof value.splice === 'function') {\n\t\t\t\ts = 'array';\n\t\t\t}\n\t\t} else {\n\t\t\ts = 'null';\n\t\t}\n\t}\n\treturn s;\n}", "function whatsTheTypeOf(input) {\n return typeof input ; //returns the type information as a string\n}", "function type(value){\n return (\n Array.isArray(value) ? \"array\" :\n value instanceof Date ? \"date\" :\n typeof value\n );\n}", "function Type(){\n\t\t\tthis.array='Array';\n\t\t\tthis.object='object';\n\t\t\tthis.string='string';\n\t\t\tthis.fn='function';\n\t\t\tthis.number='number';\n\t\t}", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }", "function x(e) {\n var t = typeof e;\n return Array.isArray(e) ? \"array\" : e instanceof RegExp ? \"object\" : b(t, e) ? \"symbol\" : t;\n }", "function $type(obj){\n if (obj == undefined) \n return false;\n if (obj.htmlElement) \n return 'element';\n var type = typeof obj;\n if (type == 'object' && obj.nodeName) {\n switch (obj.nodeType) {\n case 1:\n return 'element';\n case 3:\n return (/\\S/).test(obj.nodeValue) ? 'textnode' : 'whitespace';\n }\n }\n if (type == 'object' || type == 'function') {\n switch (obj.constructor) {\n case Array:\n return 'array';\n case RegExp:\n return 'regexp';\n }\n if (typeof obj.length == 'number') {\n if (obj.item) \n return 'collection';\n if (obj.callee) \n return 'arguments';\n }\n }\n return type;\n}", "function typeOf(value) {\n var s = typeof value;\n if (s == 'object') {\n if (!value) {\n return 'null';\n } else if (value instanceof Array) {\n return 'array';\n }\n }\n return s;\n}", "function x(e) {\n var t = typeof e;\n return Array.isArray(e) ? \"array\" : e instanceof RegExp ? \"object\" : b(t, e) ? \"symbol\" : t;\n }", "function getTypeOf (input) {\n\n\tif (input === null) {\n\t\treturn 'null';\n\t}\n\n\telse if (typeof input === 'undefined') {\n\t\treturn 'undefined';\n\t}\n\n\telse if (typeof input === 'object') {\n\t\treturn (Array.isArray(input) ? 'array' : 'object');\n\t}\n\n\treturn typeof input;\n\n}", "function _typeof( o ) {\r\n return typeof o ;\r\n }", "function getType(o)\n{\n\tif (o === null)\n\t\treturn \"null\";\n\t\n\tif (Array.isArray(o))\n\t\treturn \"array\";\n\t\n\treturn typeof o;\n}", "function _typeof2(e){return _typeof2=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},_typeof2(e)}", "function $type(obj){\r\n if (!$defined(obj)) \r\n return false;\r\n if (obj.htmlElement) \r\n return 'element';\r\n var type = typeof obj;\r\n if (type == 'object' && obj.nodeName) {\r\n switch (obj.nodeType) {\r\n case 1:\r\n return 'element';\r\n case 3:\r\n return (/\\S/).test(obj.nodeValue) ? 'textnode' : 'whitespace';\r\n }\r\n }\r\n if (type == 'object' || type == 'function') {\r\n switch (obj.constructor) {\r\n case Array:\r\n return 'array';\r\n case RegExp:\r\n return 'regexp';\r\n case Class:\r\n return 'class';\r\n }\r\n if (typeof obj.length == 'number') {\r\n if (obj.item) \r\n return 'collection';\r\n if (obj.callee) \r\n return 'arguments';\r\n }\r\n }\r\n return type;\r\n }" ]
[ "0.6909167", "0.67750335", "0.66079795", "0.6537892", "0.64935464", "0.6488478", "0.6488478", "0.6450447", "0.6450447", "0.64288545", "0.6427948", "0.6404547", "0.6404547", "0.63955957", "0.63955957", "0.63955957", "0.63955957", "0.63955957", "0.63955957", "0.63955957", "0.63955957", "0.63955957", "0.63955957", "0.63955957", "0.63955957", "0.63955957", "0.63955957", "0.63955957", "0.63955957", "0.6376279", "0.63730985", "0.63700026", "0.63515043", "0.63084537", "0.63084537", "0.63084537", "0.63084537", "0.63084537", "0.63084537", "0.63084537", "0.63084537", "0.63084537", "0.63084537", "0.63084537", "0.63084537", "0.63084537", "0.63084537", "0.63084537", "0.63084537", "0.63084537", "0.630427", "0.62994456", "0.6288622", "0.62843704", "0.62592876", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62534386", "0.62479067", "0.6233714", "0.62319446", "0.62249213", "0.6221681", "0.6207812", "0.6196356", "0.6170697", "0.61691594" ]
0.0
-1
This handles more types than `getPropType`. Only used for error messages. See `createPrimitiveTypeChecker`.
function getPreciseType(propValue) { if (typeof propValue === 'undefined' || propValue === null) { return '' + propValue; } var propType = getPropType(propValue); if (propType === 'object') { if (propValue instanceof Date) { return 'date'; } else if (propValue instanceof RegExp) { return 'regexp'; } } return propType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPropType(propValue) {\n\t\t var propType = typeof propValue;\n\t\t if (Array.isArray(propValue)) {\n\t\t return 'array';\n\t\t }\n\t\t if (propValue instanceof RegExp) {\n\t\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t\t // passes PropTypes.object.\n\t\t return 'object';\n\t\t }\n\t\t if (isSymbol(propType, propValue)) {\n\t\t return 'symbol';\n\t\t }\n\t\t return propType;\n\t\t }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n\t\t var propType = typeof propValue;\n\t\t if (Array.isArray(propValue)) {\n\t\t return 'array';\n\t\t }\n\t\t if (propValue instanceof RegExp) {\n\t\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t\t // passes PropTypes.object.\n\t\t return 'object';\n\t\t }\n\t\t return propType;\n\t\t}", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t\t var propType = typeof propValue;\n\t\t if (Array.isArray(propValue)) {\n\t\t return 'array';\n\t\t }\n\t\t if (propValue instanceof RegExp) {\n\t\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t\t // passes PropTypes.object.\n\t\t return 'object';\n\t\t }\n\t\t if (isSymbol(propType, propValue)) {\n\t\t return 'symbol';\n\t\t }\n\t\t return propType;\n\t\t}", "function getPropType(propValue) {\n\t\t var propType = typeof propValue;\n\t\t if (Array.isArray(propValue)) {\n\t\t return 'array';\n\t\t }\n\t\t if (propValue instanceof RegExp) {\n\t\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t\t // passes PropTypes.object.\n\t\t return 'object';\n\t\t }\n\t\t if (isSymbol(propType, propValue)) {\n\t\t return 'symbol';\n\t\t }\n\t\t return propType;\n\t\t}", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return \"array\";\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return \"object\";\n }\n if (isSymbol(propType, propValue)) {\n return \"symbol\";\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n\t var propType = typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue);\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }" ]
[ "0.6876632", "0.68532825", "0.68532825", "0.68532825", "0.68532825", "0.68521523", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.6846517", "0.68378294", "0.68378294", "0.68362224", "0.6817785", "0.6814658", "0.6814658", "0.6814658", "0.6814658", "0.6814658", "0.68000925", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756", "0.6780756" ]
0.0
-1
Returns a string that is postfixed to a warning about an invalid type. For example, "undefined" or "of type array"
function getPostfixForTypeWarning(value) { var type = getPreciseType(value); switch (type) { case 'array': case 'object': return 'an ' + type; case 'boolean': case 'date': case 'regexp': return 'a ' + type; default: return type; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _undefinedCoerce() {\n return '';\n}", "function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case \"array\":\n case \"object\":\n return \"an \" + type;\n case \"boolean\":\n case \"date\":\n case \"regexp\":\n return \"a \" + type;\n default:\n return type;\n }\n }", "function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }", "function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }", "function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }", "function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }", "function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }", "function getPostfixForTypeWarning(value) {\n\t\t var type = getPreciseType(value);\n\t\t switch (type) {\n\t\t case 'array':\n\t\t case 'object':\n\t\t return 'an ' + type;\n\t\t case 'boolean':\n\t\t case 'date':\n\t\t case 'regexp':\n\t\t return 'a ' + type;\n\t\t default:\n\t\t return type;\n\t\t }\n\t\t }", "function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }", "function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }", "function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }", "function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }", "function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }", "function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch(type){\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }", "function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }" ]
[ "0.65988296", "0.6565237", "0.6559532", "0.6559532", "0.6559532", "0.6559532", "0.6522337", "0.65215486", "0.65060395", "0.65060395", "0.65060395", "0.65060395", "0.65060395", "0.65013695", "0.6489755", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735", "0.6477735" ]
0.0
-1
Returns class name of the object, if any.
function getClassName(propValue) { if (!propValue.constructor || !propValue.constructor.name) { return ANONYMOUS; } return propValue.constructor.name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getClassName(obj) {\n var funcNameRegex = /function\\s+(.+?)\\s*\\(/;\n var results = funcNameRegex.exec(obj['constructor'].toString());\n return (results && results.length > 1) ? results[1] : '';\n }", "getClassName() {\n return this.constructor\n .className;\n }", "getClassName() {\n return this.constructor\n .className;\n }", "function getClassName(obj)\n{\n if (obj === null) {\n return 'null';\n }\n if (obj === undefined) {\n return 'undefined';\n }\n var c = obj.constructor.toString();\n return c.substring(9, c.indexOf('(', 10));\n}", "function getClass(o) {\n\n\tif (o === null || o === undefined) return \"Object\";\n\treturn OP_toString.call(o).slice(\"[object \".length, -1);\n}", "getClassName() {\n return this.constructor.name\n }", "function getClass(obj) {\r\n return Object.prototype.toString.call(obj);\r\n}", "function getClass(obj) {\n return {}.toString.call(obj).slice(8, -1);\n}", "static getClassName() {\n return \"Object\";\n }", "function classOf(o){\n if(o === null) return \"Null\";\n if(o === undefined) return \"Undefined\";\n return Object.prototype.toString.call(o).slice(8, -1);\n}", "function get$className()/* : String*/\n {\n return flash.utils.getQualifiedClassName(this).replace(/::/, \".\");\n }", "function get_class_name(current_obj) {\n\t\t\tvar id = current_obj.attr('id');\n\t\t\tvar name = id.substring(6,id.length);\n\t\t\treturn name;\n\t\t}", "function getObjectName(object) {\n if (object === undefined) {\n return '';\n }\n if (object === null) {\n return 'Object';\n }\n if (typeof object === 'object' && !object.constructor) {\n return 'Object';\n }\n var funcNameRegex = /function ([^(]*)/;\n var results = (funcNameRegex).exec((object).constructor.toString());\n if (results && results.length > 1) {\n return results[1];\n }\n else {\n return '';\n }\n }", "function _getClazz() {\r\n\t\tvar n = clz = this.vj$._class, idx = n.lastIndexOf('.');\r\n\t\tif (idx != -1) clz = n.substring(idx+1); \r\n\t\tif (this.vj$[clz]) return this.vj$[clz].clazz;\r\n\r\n\t\t//Error case...\r\n\t\treturn null;\r\n\t}", "getClassName() {\n return this.statesTable.getString(this.currentState, 'ClassName');\n }", "function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }", "function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }", "function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }", "function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }", "function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }", "function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }", "function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }", "function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }", "function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }", "function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }", "function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }", "function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }" ]
[ "0.7729453", "0.7467235", "0.7467235", "0.74239284", "0.7165505", "0.71431816", "0.70840144", "0.7080456", "0.69956654", "0.6969364", "0.6898247", "0.6879638", "0.6712778", "0.66559386", "0.663537", "0.6608779", "0.6608779", "0.6608779", "0.6608779", "0.6598088", "0.65969384", "0.65969384", "0.65969384", "0.65969384", "0.65969384", "0.65797454", "0.65797454" ]
0.0
-1
Base class helpers for the updating state of a component.
function Component(props, context, updater) { this.props = props; this.context = context; this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the // renderer. this.updater = updater || ReactNoopUpdateQueue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update() {\n BaseState.update.call(this);\n }", "_update() {\n // Call subclass lifecycle method\n const stateNeedsUpdate = this.needsUpdate();\n // End lifecycle method\n debug(TRACE_UPDATE, this, stateNeedsUpdate);\n\n if (stateNeedsUpdate) {\n this._updateState();\n }\n }", "function _update() {\r\n this.component[this.prop] = this.control[this.prop];\r\n }", "_handleComponentChange() {\n this.setState(this._getStateFromStore());\n }", "update(data={}) {\n this.state = Object.assign(this.state, data);\n\n // notify all the Listeners of updated state\n this.notifyObervers(this.state);\n }", "constructor() {\n super(); // Gives context for \"this\" within component.\n this.state = { txt: \"Hi There\"};\n this.update = this.update.bind(this);\n }", "update(data = {}) {\n this.state = Object.assign(this.state, data);\n this.notify(this.state);\n }", "updateState() {\n\t\tthis.trigger(this.state);\n\t}", "constructor() {\n super(); // Gives context for \"this\" within component.\n this.state = { \n red: 0,\n green: 0,\n blue: 0,\n myTxt: \"--\"\n };\n this.update = this.update.bind(this);\n }", "updateState(stateChange){\n this.setState(stateChange);\n }", "updateState(state) {\n this.updateStateInner(state, this._props);\n }", "setStateInternal(id, value) {\n var obj = id;\n if (! obj.startsWith(this.namespace + '.'))\n obj = this.namespace + '.' + id;\n this.log.info('update state ' + obj + ' with value:' + value);\n currentStateValues[obj] = value;\n }", "update(data = {}) {\r\n console.log(data);\r\n this.state = Object.assign(this.state, data);\r\n this.notify(this.state);\r\n }", "handler(update) {\n this.setState(update)\n }", "setState(updateObject) {\n this.setChangeFlags({stateChanged: true});\n Object.assign(this.state, updateObject);\n this.setNeedsRedraw();\n }", "_updateStateValue(prop, v) {\n return new Promise((resolve, reject) => {\n var c = this._component\n if(c.state && c.state[prop] !== undefined){\n var state = {}\n state[prop] = v\n c.setState(state, resolve)\n }else{\n c[prop] = v\n c.forceUpdate()\n resolve()\n }\n })\n }", "stateChanged(state) { }", "setState(newState) {\n this.state = {\n ...this.state,\n ...newState\n }\n this.#updater()\n }", "update() {\n // Subclasses should override\n }", "function updateValue( value ) \n{\n \n updateComponentValue( value );\n \n}", "updateItem() {\n this.setState(this.state);\n }", "update() {\r\n throw new Error('must be set in subclass');\r\n }", "stateChanged(_state) { }", "update() {\n const state = this.store.getState();\n\n if (this.isPresenting !== state.webvr.isPresenting) {\n this.vrEffect.setFullScreen(state.webvr.isPresenting);\n this.isPresenting = state.webvr.isPresenting;\n }\n\n if (this.isPresenting) {\n this.vrControls.update();\n } else {\n const dt = (state.app.timestamp - this.timestamp) || 0;\n this.timestamp = state.app.timestamp;\n\n this.flyControls.update(dt);\n }\n\n // update all components with their state\n const componentState = this.select(state);\n Object.keys(this.components)\n .forEach(id => this.components[id].update(componentState[id]));\n }", "updateState(newState) {\n this.setState(newState);\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 }", "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(...props) {\n if (this.onUpdate && this._) {\n return this.onUpdate(...props);\n }\n }", "_triggerComponentUpdate(value) {\n if (has(this.props, 'valueLink')) {\n this.props.valueLink.requestChange(value);\n this.setState({\n focusedValue: undefined,\n isActive: false,\n });\n } else if (has(this.props, 'value')) {\n this.setState({\n focusedValue: undefined,\n isActive: false,\n });\n } else {\n this.setState({\n focusedValue: undefined,\n isActive: false,\n value,\n });\n }\n\n if (this.props.onUpdate) {\n this.props.onUpdate({ value });\n }\n }", "updateComponentState(componentUpdate, sectionIndex, gridSectionIndex, componentStateIndex) {\n if (!this.state.globalContextObj.editing) return\n\n this.setState((state, props) => {\n let component = state.pages[state.globalContextObj.editing].sections[sectionIndex].gridSections[gridSectionIndex].componentStates[componentStateIndex]\n state.pages[state.globalContextObj.editing].sections[sectionIndex].gridSections[gridSectionIndex].componentStates[componentStateIndex] = deepStyleMerge(component, componentUpdate)\n return {\n pages: state.pages\n }\n })\n }", "setState(newState, cb) {\n // Merge both new and old state to replace whats new an keep whats old.\n this.state = {...this.state, ...newState};\n\n // re-render the element with a given renderer callback\n if (cb) cb(this.state, this.element);\n }", "_onChangeState() {\n\n\n }", "update (descriptor) {\n // update helper's own UI if needed\n // etc\n }", "componentWillUpdate() {}", "constructor(props) {\n super(props);\n this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this);\n }", "function setComponentState(componentId, key, value) {\n var componentState = getViewState(componentId);\n if (!componentState) {\n componentState = new Object();\n setViewState(componentId, componentState);\n }\n componentState[key] = value;\n}", "_stateChanged(_state) {\n throw new Error('_stateChanged() not implemented');\n }", "onUpdate(data) {\n this.setState(data);\n }", "handleUpdatedState(state) {\n this.lastTechnology = state.selectedTechnology;\n this.totalClicks = state.clickCounter;\n }", "stateUpdate() {\n this.handlestateVariable();\n this.handlestateVariable2();\n this.handleCChange();\n this.handleAChange();\n this.handleidCapture();\n this.handleimgCapture();\n this.handleConfigChange();\n this.idcaptureVal();\n this.imgcaptureVal();\n }", "componentDidUpdate() {\n this.props.actions.updateQuestionSuccess({id: this.state.id, value: this.state.question});\n }", "update(key, value) {\n let property = {};\n property[key] = value;\n // Change state\n this.setState(property, () => this.getData());\n }", "componentWillUpdate () {}", "_UpdateComponents() {\n this.loadedComponents.forEach((component) => {\n if(component.binding) {\n // Update the component from its bound value if the value has changed\n if(component.binding.object[component.binding.property] != component.oldValue) {\n component.SetValue(component.binding.object[component.binding.property]);\n component.oldValue = component.binding.object[component.binding.property];\n }\n }\n });\n\n setTimeout(() => {\n window.requestAnimationFrame(() => {\n this._UpdateComponents();\n });\n }, this.opts.pollRateMS);\n\n }", "_updateState() {\n const currentProps = this.props;\n const currentViewport = this.context.viewport;\n const propsInTransition = this._updateUniformTransition();\n this.internalState.propsInTransition = propsInTransition;\n // Overwrite this.context.viewport during update to use the last activated viewport on this layer\n // In multi-view applications, a layer may only be drawn in one of the views\n // Which would make the \"active\" viewport different from the shared context\n this.context.viewport = this.internalState.viewport || currentViewport;\n // Overwrite this.props during update to use in-transition prop values\n this.props = propsInTransition;\n\n try {\n const updateParams = this._getUpdateParams();\n const oldModels = this.getModels();\n\n // Safely call subclass lifecycle methods\n if (this.context.gl) {\n this.updateState(updateParams);\n } else {\n try {\n this.updateState(updateParams);\n } catch (error) {\n // ignore error if gl context is missing\n }\n }\n // Execute extension updates\n for (const extension of this.props.extensions) {\n extension.updateState.call(this, updateParams, extension);\n }\n\n const modelChanged = this.getModels()[0] !== oldModels[0];\n this._updateModules(updateParams, modelChanged);\n // End subclass lifecycle methods\n\n if (this.isComposite) {\n // Render or update previously rendered sublayers\n this._renderLayers(updateParams);\n } else {\n this.setNeedsRedraw();\n // Add any subclass attributes\n this._updateAttributes(this.props);\n\n // Note: Automatic instance count update only works for single layers\n if (this.state.model) {\n this.state.model.setInstanceCount(this.getNumInstances());\n }\n }\n } finally {\n // Restore shared context\n this.context.viewport = currentViewport;\n this.props = currentProps;\n this.clearChangeFlags();\n this.internalState.needsUpdate = false;\n this.internalState.resetOldProps();\n }\n }", "componentDidUpdate() {\n this.props.actions.updateAnswerSuccess({\n questionId: this.state.questionId,\n id: this.state.id,\n label: this.state.answer,\n isTrue: this.props.isTrue\n });\n }", "stateChanged(state) {\n }", "handleUpdate(data) {\n this.setState({ data });\n}", "constructor(...args){\n super(...args)\n this.shouldComponentUpdate=PureRenderMixin.shouldComponentUpdate\n this.state={\n userName:''\n }\n }", "constructor(...args){\n super(...args)\n this.shouldComponentUpdate=PureRenderMixin.shouldComponentUpdate\n this.state={\n userName:''\n }\n }", "componentWillUpdate(np,ns){ }", "componentDidUpdate(preProps,preState,a){\n console.log(\"componentDidUpdate\",a)\n }", "setState(newProps) {\n let stateChanged = false;\n\n Object.entries(newProps).forEach(([key, val]) => {\n if (val !== this.state[key]) {\n stateChanged = true;\n }\n\n this.state[key] = val;\n });\n\n if (stateChanged) {\n this.render();\n }\n }", "function update() {\n // ... no implementation required\n }", "function updater(prevState){var state=this.constructor.getDerivedStateFromProps(nextProps,prevState);return state!==null&&state!==undefined?state:null;}// Binding \"this\" is important for shallow renderer support.", "componentDidUpdate(){\r\n console.log(\"Update\", this.state);\r\n }", "updateData(config) {\r\n this.setState(config);\r\n }", "componentWillUpdate(e, state) {\n if (state.x) {\n this.xElement.innerHTML = ' x: ' + state.x\n } \n if (state.y) {\n this.yElement.innerHTML = ' y: ' + state.y\n } \n }", "updateState (val, key) {\n this.state[key] = val\n this.updateUI()\n }", "refresh_() {\n // Can be overridden in sub-component.\n }", "stateChanged(state) {\n \n throw new Error('stateChanged() not implemented', this);\n }", "setState(state, callback) {\n if (!this.prevState) this.prevState = this.state;\n this.state = this._extend(\n this._extend({}, this.state),\n typeof state === 'function' ? state(this.state, this.props) : state\n );\n let dom = this.getDomElement();\n let container = dom.parentNode;\n let newVDom = this.render(); // This will invoke the derived class render menthod\n newVDom.component = this;\n diff (newVDom, container, dom);\n }", "handleUpdateBox(id, title) {\n this.setState({updatedId: id, updatedTitle: title});\n }", "setState (state) {\r\n this.state = state;\r\n }", "componentDidUpdate(props_) {}", "constructor(props) {\n \t//calling parent method with super\n \tsuper(props);\n//functional components don't have state, only class-based components do\n//term is property on which we want to record change\n \tthis.state = { term: ''};\n //the above live can only be in the constructor, so every instance will take a copy of the current state\n }", "updateComponents () {\n\t\tfor (let component in this.components) {\n\t\t\tthis.components[component].update();\n\t\t}\n\t}", "componentDidUpdate(prevProps, prevState, snapshot){\n console.info(this.constructor.name+' Did my component updated?');\n\n }", "update( e ){\n // Assign to let changedID ID of slider which has been changed\n let changedID = e.target.id;\n let value = e.target.value;\n if (changedID === 'sliderAmount') {\n this.setState({valueAmount: e.target.value});\n }\n if (changedID === 'sliderDuration'){\n this.setState({valueDuration: e.target.value});\n }\n\n\n this.calculate(changedID, value);\n }", "setState(_state, _args) {\n\t // This has to be handled at a higher level since we can't\n\t // replace the whole tree here however we still need a method here\n\t // so it appears on the proxy Actions class.\n\t throw new Error('Called setState on StateActions.');\n\t }", "componentWillUpdate(nextProps) {\n if (this.props.value !== nextProps.value) {\n this.setState({ value: this.props.value });\n }\n }", "componentWillUpdate() {\n console.log('Before updating a component');\n }", "updateFormFieldInState(formField, value) {\n\n }", "onChangeStatus(newStatus) {\n return () => {\n this.props.changeStatus(newStatus)\n };\n }", "componentDidUpdate(prevProps) {\n if (\n prevProps.currentIndex != this.props.currentIndex ||\n prevProps.list.length != this.props.list.length\n )\n this.setState({\n ...this.EditStateFunction()\n });\n }", "updateState(e, val) {\n val === undefined ? val = e.target.value : val; // catch location input field value since it behaves differently\n let key = e.target.name;\n // you must use a function to set state if the key is a variable\n let stateObj = function() {\n var obj = {};\n obj[key] = val;\n return obj;\n }.bind(e)();\n this.setState( stateObj );\n\n }", "componentDidUpdate() {\n\t\t/* preserve context */\n\t\tconst _this = this;\n\t}", "componentDidUpdate() {\n\t\t/* preserve context */\n\t\tconst _this = this;\n\t}", "state (...args) {\n return MVC.ComponentJS(this).state(...args)\n }", "_updateInput (input) {\n this.setState({ input })\n }", "_update() {\n }", "_requestUpdate(name,oldValue){let shouldRequestUpdate=!0;// If we have a property key, perform property update steps.\nif(name!==void 0){const ctor=this.constructor,options=ctor._classProperties.get(name)||defaultPropertyDeclaration;if(ctor._valueHasChanged(this[name],oldValue,options.hasChanged)){if(!this._changedProperties.has(name)){this._changedProperties.set(name,oldValue)}// Add to reflecting properties set.\n// Note, it's important that every change has a chance to add the\n// property to `_reflectingProperties`. This ensures setting\n// attribute + property reflects correctly.\nif(!0===options.reflect&&!(this._updateState&STATE_IS_REFLECTING_TO_PROPERTY)){if(this._reflectingProperties===void 0){this._reflectingProperties=new Map}this._reflectingProperties.set(name,options)}}else{// Abort the request if the property should not be considered changed.\nshouldRequestUpdate=!1}}if(!this._hasRequestedUpdate&&shouldRequestUpdate){this._enqueueUpdate()}}", "shouldComponentUpdate(newProps, newState) {\n // console.log(\"=========================> shouldComponentUpdate\", newProps, newState);\n return true;\n }", "componentDidUpdate(prepProps, prevState) {\n if (!this.props.onChange) return;\n if (_.isEqual(prevState, this.state)) return;\n\n const stateNow = {...this.state};\n this.debouncedOnChange(stateNow);\n }", "update()\n\t{ \n\t\tthrow new Error(\"update() method not implemented\");\n\t}", "function newState(state) {\n alert(\"This functionality is yet to be implemented!\");\n }", "setState (newState) {\n this._state = assign({}, this._state, newState);\n this.trigger(assign({}, this._state));\n }", "update() {\n this.setState({\n numberOfGuests: this.props.model.getNumberOfGuests(),\n menu: this.props.model.getMenu(),\n menuPrice: this.props.model.calcCost(),\n });\n }", "update(props) {\n if (props.handleDOMEvents != this._props.handleDOMEvents)\n ensureListeners(this);\n let prevProps = this._props;\n this._props = props;\n if (props.plugins) {\n props.plugins.forEach(checkStateComponent);\n this.directPlugins = props.plugins;\n }\n this.updateStateInner(props.state, prevProps);\n }", "setState (newState) {\n this.state = {...newState};\n if (this.updaterWin) {\n this.updaterWin.send('update-state-change', this.state);\n }\n }", "componentUpdated(el, binding, vnode) {\n const self = vnode.context\n const instanceName = getInstanceName(el, binding, vnode)\n const options = binding.value || {}\n const quill = self[instanceName]\n if (quill) {\n const model = vnode.data.model\n const _value = vnode.data.attrs ? vnode.data.attrs.value : null\n const _content = vnode.data.attrs ? vnode.data.attrs.content : null\n const disabled = vnode.data.attrs ? vnode.data.attrs.disabled : null\n const content = model ? model.value : (_value || _content)\n const newData = content\n const oldData = el.children[0].innerHTML\n quill.enable(!disabled)\n if (newData) {\n if (newData != oldData) {\n const range = quill.getSelection()\n quill.root.innerHTML = newData\n setTimeout(() => {\n quill.setSelection(range)\n })\n }\n } else {\n quill.setText('')\n }\n }\n }", "componentUpdated(el, binding, vnode) {\n const self = vnode.context\n const instanceName = getInstanceName(el, binding, vnode)\n const options = binding.value || {}\n const quill = self[instanceName]\n if (quill) {\n const model = vnode.data.model\n const _value = vnode.data.attrs ? vnode.data.attrs.value : null\n const _content = vnode.data.attrs ? vnode.data.attrs.content : null\n const disabled = vnode.data.attrs ? vnode.data.attrs.disabled : null\n const content = model ? model.value : (_value || _content)\n const newData = content\n const oldData = el.children[0].innerHTML\n quill.enable(!disabled)\n if (newData) {\n if (newData != oldData) {\n const range = quill.getSelection()\n quill.root.innerHTML = newData\n setTimeout(() => {\n quill.setSelection(range)\n })\n }\n } else {\n quill.setText('')\n }\n }\n }", "privateSendUpdate () {\n this.emit('update', this.getState())\n }", "componentDidUpdate(prevProps) {\n // Is called when the corresponding state is changed in parent class (indirect trigger)\n // Is also called a 2nd time when setState{open:true} is called inside this function\n if (prevProps != this.props) {\n this.state.type = this.props.popUp.type;\n this.state.message = this.props.popUp.message;\n this.state.open = this.props.popUp.openPopUp;\n this.checkAction();\n }\n }", "_onChange() {\n if (this.isMounted()) {\n this.setState({ value: ButtonStore.getValue() });\n this.setState({ session: AuthStore.getSession() });\n }\n }", "componentDidUpdate(prevProps, prevState) { // eslint-disable-line\n if (this.state.value !== prevState.value) {\n this.props.setValue(this.state.value);\n if (this.state.manualChangeKey !== prevState.manualChangeKey || this.props.shouldUpdateAlways) {\n this.props.onChangeInput(this.props.name, this.state.value);\n }\n }\n }", "componentDidUpdate(preProps, preState, a) {\n console.log('componentDidUpdate', a);\n\n }", "_requestUpdate(e,t){let n=!0;// If we have a property key, perform property update steps.\nif(e!==void 0){const r=this.constructor,a=r._classProperties.get(e)||defaultPropertyDeclaration;r._valueHasChanged(this[e],t,a.hasChanged)?(!this._changedProperties.has(e)&&this._changedProperties.set(e,t),!0===a.reflect&&!(this._updateState&STATE_IS_REFLECTING_TO_PROPERTY)&&(this._reflectingProperties===void 0&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,a))):n=!1}!this._hasRequestedUpdate&&n&&this._enqueueUpdate()}", "_onChange() {\n this.setState(getUserState());\n }", "componentWillUpdate(){\n }", "update() {\n throw new Error(\"Not Implemented\");\n }" ]
[ "0.721754", "0.6761505", "0.6677766", "0.66110283", "0.65402955", "0.6526947", "0.6489771", "0.6469624", "0.6459612", "0.63837487", "0.635385", "0.6334491", "0.63050455", "0.6304887", "0.62716913", "0.6266266", "0.6215486", "0.62133574", "0.6194339", "0.6189688", "0.61572605", "0.6146048", "0.614464", "0.6142284", "0.61384463", "0.613659", "0.613659", "0.61270475", "0.6123728", "0.6123666", "0.6122666", "0.6117456", "0.6111978", "0.6111687", "0.6097396", "0.6089804", "0.6082856", "0.6055933", "0.605335", "0.60440105", "0.6035773", "0.60315645", "0.6024351", "0.6022827", "0.6014333", "0.60117424", "0.5997047", "0.599664", "0.5990497", "0.5990497", "0.59873384", "0.5978268", "0.5971278", "0.5968363", "0.5959825", "0.5940723", "0.5940402", "0.59298414", "0.5929111", "0.5926786", "0.5900515", "0.5898804", "0.5890302", "0.5885724", "0.5878514", "0.5875501", "0.5871484", "0.5868001", "0.58631855", "0.5860544", "0.58548087", "0.5853512", "0.5830266", "0.58294904", "0.58261114", "0.58233035", "0.58189505", "0.58189505", "0.58158684", "0.5804806", "0.5801374", "0.5801221", "0.58011633", "0.5799005", "0.5795432", "0.57947195", "0.5793848", "0.5793671", "0.57905835", "0.5786972", "0.57838243", "0.57838243", "0.5778954", "0.5775817", "0.5774169", "0.5774013", "0.5768719", "0.5759508", "0.57554543", "0.5750753", "0.5746172" ]
0.0
-1
Convenience component with default shallow equality check for sCU.
function PureComponent(props, context, updater) { this.props = props; this.context = context; this.refs = emptyObject; this.updater = updater || ReactNoopUpdateQueue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function useStrictEquality(b, a) {\n return a === b;\n }", "get shallowCopy() {\n return this.shallowCopy$();\n }", "function defaultEqualityCheck(a, b) {\n return !a && !b || a === b;\n }", "equals() {\n return false;\n }", "equals() {\n return false;\n }", "function looseEqual(a, b) {\n return true;\n }", "Equals() {\n\n }", "Equals() {\n\n }", "function areEqualShallow(a, b) {\n var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n _ref$ignore = _ref.ignore,\n ignore = _ref$ignore === undefined ? {} : _ref$ignore;\n\n if (a === b) {\n return true;\n }\n\n if ((typeof a === 'undefined' ? 'undefined' : _typeof(a)) !== 'object' || a === null || (typeof b === 'undefined' ? 'undefined' : _typeof(b)) !== 'object' || b === null) {\n return false;\n }\n\n if (Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n\n for (var key in a) {\n if (!(key in ignore) && (!(key in b) || a[key] !== b[key])) {\n return false;\n }\n }\n for (var _key in b) {\n if (!(_key in ignore) && !(_key in a)) {\n return false;\n }\n }\n return true;\n}", "function useStrictEquality( b, a ) {\n\t\t\t\tif ( b instanceof a.constructor || a instanceof b.constructor ) {\n\t\t\t\t\t// to catch short annotaion VS 'new' annotation of a\n\t\t\t\t\t// declaration\n\t\t\t\t\t// e.g. var i = 1;\n\t\t\t\t\t// var j = new Number(1);\n\t\t\t\t\treturn a == b;\n\t\t\t\t} else {\n\t\t\t\t\treturn a === b;\n\t\t\t\t}\n\t\t\t}", "function useStrictEquality(b, a) {\n\t\t\tif (b instanceof a.constructor || a instanceof b.constructor) {\n\t\t\t\t// to catch short annotaion VS 'new' annotation of a declaration\n\t\t\t\t// e.g. var i = 1;\n\t\t\t\t// var j = new Number(1);\n\t\t\t\treturn a == b;\n\t\t\t} else {\n\t\t\t\treturn a === b;\n\t\t\t}\n\t\t}", "function callObjectEqual(a, b) {\n if (!isDefaultMode() && !canTestPrimitiveScope) {\n // If the environment doesn't allow null scope, then there's no way\n // to predict how the scope will be mangled by running \"a\" through it,\n // so run isEqual as a static method instead. This is simulating a real\n // world situation as well as there is no way to map isEqual to Object\n // prototype and have it work for string primitives when strict mode is\n // not available, so the user will in that case have to go through the\n // static method as well. Similarly, chainables would have to go through\n // a significant tapdance to get working right with null scope issues,\n // and the performance penalties and indescrepancy with extended mode\n // is not worth the benefits.\n return run(Object, 'isEqual', [a, b]);\n }\n return run(a, 'isEqual', [b]);\n }", "function useStrictEquality(b, a) {\n if (b instanceof a.constructor || a instanceof b.constructor) {\n // to catch short annotaion VS 'new' annotation of a declaration\n // e.g. var i = 1;\n // var j = new Number(1);\n return a == b;\n } else {\n return a === b;\n }\n }", "function useStrictEquality(b, a) {\n if (b instanceof a.constructor || a instanceof b.constructor) {\n // to catch short annotaion VS 'new' annotation of a declaration\n // e.g. var i = 1;\n // var j = new Number(1);\n return a == b;\n } else {\n return a === b;\n }\n }", "function looseEqual (a, b) {\n\t /* eslint-disable eqeqeq */\n\t return a == b || (\n\t isObject(a) && isObject(b)\n\t ? JSON.stringify(a) === JSON.stringify(b)\n\t : false\n\t )\n\t /* eslint-enable eqeqeq */\n\t}", "function looseEqual (a, b) {\n\t /* eslint-disable eqeqeq */\n\t return a == b || (\n\t isObject(a) && isObject(b)\n\t ? JSON.stringify(a) === JSON.stringify(b)\n\t : false\n\t )\n\t /* eslint-enable eqeqeq */\n\t}", "function looseEqual (a, b) {\n\t /* eslint-disable eqeqeq */\n\t return a == b || (\n\t isObject(a) && isObject(b)\n\t ? JSON.stringify(a) === JSON.stringify(b)\n\t : false\n\t )\n\t /* eslint-enable eqeqeq */\n\t}", "function looseEqual (a, b) {\n /* eslint-disable eqeqeq */\n return a == b || (\n isObject(a) && isObject(b)\n ? JSON.stringify(a) === JSON.stringify(b)\n : false\n )\n /* eslint-enable eqeqeq */\n}", "function looseEqual (a, b) {\n /* eslint-disable eqeqeq */\n return a == b || (\n isObject(a) && isObject(b)\n ? JSON.stringify(a) === JSON.stringify(b)\n : false\n )\n /* eslint-enable eqeqeq */\n}", "function shallowCompare(instance,nextProps,nextState){return!shallowEqual(instance.props,nextProps)||!shallowEqual(instance.state,nextState);}", "equals(S) {\n return XSet.equality(this.S);\n }", "_equal(a, b) {\n return a === b;\n }", "isEqual(currentValue, newValue) {\n throw new Error(\"Abstract method\");\n }", "function looseEqual(a,b){var isObjectA=isObject(a);var isObjectB=isObject(b);if(isObjectA&&isObjectB){return JSON.stringify(a)===JSON.stringify(b);}else if(!isObjectA&&!isObjectB){return String(a)===String(b);}else{return false;}}", "function shallowCompare(instance, nextProps, nextState) {\n\t\t return !shallowEqual(instance.props, nextProps) || !shallowEqual(instance.state, nextState);\n\t\t}", "function checkEquality(a, b) {\n return a === b;\n }", "isEqual(x, y) {\n return this.x === x && this.y === y;\n }", "eq(other) { return this == other; }", "function eq(a, b) {\n return a === b;\n }", "function sameObject(a, b) {\n return a === b\n}", "eq_(one, another) {\n return one === another;\n }", "function shallowCompare(instance, nextProps, nextState) {\n\t\t\treturn !shallowEqual(instance.props, nextProps) || !shallowEqual(instance.state, nextState);\n\t\t}", "function isCoerced(a,b) {\n if (a===b) {\n return false\n } else if(a==b){\n return true\n } else if (a !=b) {\n return false\n }\n}", "function looseEqual (a, b) {\n\t var isObjectA = isObject(a);\n\t var isObjectB = isObject(b);\n\t if (isObjectA && isObjectB) {\n\t try {\n\t return JSON.stringify(a) === JSON.stringify(b)\n\t } catch (e) {\n\t // possible circular reference\n\t return a === b\n\t }\n\t } else if (!isObjectA && !isObjectB) {\n\t return String(a) === String(b)\n\t } else {\n\t return false\n\t }\n\t}", "function looseEqual (a, b) {\n\t var isObjectA = isObject(a);\n\t var isObjectB = isObject(b);\n\t if (isObjectA && isObjectB) {\n\t try {\n\t return JSON.stringify(a) === JSON.stringify(b)\n\t } catch (e) {\n\t // possible circular reference\n\t return a === b\n\t }\n\t } else if (!isObjectA && !isObjectB) {\n\t return String(a) === String(b)\n\t } else {\n\t return false\n\t }\n\t}", "function looseEqual (a, b) {\n\t var isObjectA = isObject(a);\n\t var isObjectB = isObject(b);\n\t if (isObjectA && isObjectB) {\n\t try {\n\t return JSON.stringify(a) === JSON.stringify(b)\n\t } catch (e) {\n\t // possible circular reference\n\t return a === b\n\t }\n\t } else if (!isObjectA && !isObjectB) {\n\t return String(a) === String(b)\n\t } else {\n\t return false\n\t }\n\t}", "function _equals(a, b) {\n if (a === b || (a !== a && b !== b)) { // true for NaNs\n return true;\n }\n\n if (!a || !b) {\n return false;\n }\n\n // There is probably a cleaner way to do this check\n // Blame TDD :)\n if (a && typeof a.constructor === 'function' &&\n a.constructor.unionFactory === Union) {\n if (!(b && typeof b.constructor === 'function' &&\n b.constructor.unionFactory === Union)) {\n return false;\n }\n if (a.constructor !== b.constructor) {\n return false;\n }\n if (a.name !== b.name) {\n return false;\n }\n return _equals(a.payload, b.payload);\n }\n\n // I hate this block. Blame immutablejs :)\n if (typeof a.valueOf === 'function' &&\n typeof b.valueOf === 'function') {\n a = a.valueOf();\n b = b.valueOf();\n if (a === b || (a !== a && b !== b)) {\n return true;\n }\n if (!a || !b) {\n return false;\n }\n }\n if (typeof a.equals === 'function' &&\n typeof b.equals === 'function') {\n return a.equals(b);\n }\n return false;\n}", "function looseEqual (a, b) {\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n return JSON.stringify(a) === JSON.stringify(b)\n } catch (e) {\n // possible circular reference\n return a === b\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "function looseEqual (a, b) {\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n return JSON.stringify(a) === JSON.stringify(b)\n } catch (e) {\n // possible circular reference\n return a === b\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "function looseEqual (a, b) {\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n return JSON.stringify(a) === JSON.stringify(b)\n } catch (e) {\n // possible circular reference\n return a === b\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "function looseEqual (a, b) {\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n return JSON.stringify(a) === JSON.stringify(b)\n } catch (e) {\n // possible circular reference\n return a === b\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "function looseEqual (a, b) {\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n return JSON.stringify(a) === JSON.stringify(b)\n } catch (e) {\n // possible circular reference\n return a === b\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "function looseEqual (a, b) {\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n return JSON.stringify(a) === JSON.stringify(b)\n } catch (e) {\n // possible circular reference\n return a === b\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "function looseEqual (a, b) {\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n return JSON.stringify(a) === JSON.stringify(b)\n } catch (e) {\n // possible circular reference\n return a === b\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "function looseEqual (a, b) {\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n return JSON.stringify(a) === JSON.stringify(b)\n } catch (e) {\n // possible circular reference\n return a === b\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "function looseEqual (a, b) {\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n return JSON.stringify(a) === JSON.stringify(b)\n } catch (e) {\n // possible circular reference\n return a === b\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "function looseEqual (a, b) {\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n return JSON.stringify(a) === JSON.stringify(b)\n } catch (e) {\n // possible circular reference\n return a === b\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "function looseEqual (a, b) {\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n return JSON.stringify(a) === JSON.stringify(b)\n } catch (e) {\n // possible circular reference\n return a === b\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "function StrictEqualityComparer(x, y) {\n return x === y;\n}", "function looseEqual (a, b) {\n\t var isObjectA = isObject(a);\n\t var isObjectB = isObject(b);\n\t if (isObjectA && isObjectB) {\n\t return JSON.stringify(a) === JSON.stringify(b)\n\t } else if (!isObjectA && !isObjectB) {\n\t return String(a) === String(b)\n\t } else {\n\t return false\n\t }\n\t}", "function looseEqual (a, b) {\n\t var isObjectA = isObject(a);\n\t var isObjectB = isObject(b);\n\t if (isObjectA && isObjectB) {\n\t return JSON.stringify(a) === JSON.stringify(b)\n\t } else if (!isObjectA && !isObjectB) {\n\t return String(a) === String(b)\n\t } else {\n\t return false\n\t }\n\t}", "isEqual(other) {\n if (!other) {\n return false;\n } else {\n return equals(this.underlying, other.underlying);\n }\n }", "function looseEqual(a, b) {\n\t var isObjectA = isObject(a);\n\t var isObjectB = isObject(b);\n\t if (isObjectA && isObjectB) {\n\t try {\n\t return JSON.stringify(a) === JSON.stringify(b);\n\t } catch (e) {\n\t // possible circular reference\n\t return a === b;\n\t }\n\t } else if (!isObjectA && !isObjectB) {\n\t return String(a) === String(b);\n\t } else {\n\t return false;\n\t }\n\t}", "function printSomthingWorthless(){\r\n console.log('my object is does(not) equal to cole');\r\n console.log(this === cole);\r\n}", "isObjectEqual(a, b) {\n return a && b && a.foo === b.foo;\n }", "function looseEqual(a, b) {\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n return JSON.stringify(a) === JSON.stringify(b);\n } catch (e) {\n // possible circular reference\n return a === b;\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b);\n } else {\n return false;\n }\n}", "function looseEqual (a, b) {\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n return JSON.stringify(a) === JSON.stringify(b)\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "function looseEqual (a, b) {\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n return JSON.stringify(a) === JSON.stringify(b)\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "function looseEqual (a, b) {\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n return JSON.stringify(a) === JSON.stringify(b)\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "function looseEqual (a, b) {\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n return JSON.stringify(a) === JSON.stringify(b)\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "function looseEqual (a, b) {\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n return JSON.stringify(a) === JSON.stringify(b)\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "get d812() { return this.c1.same(this.c8) && this.c2.same(this.c8) }", "function looseEqual(a, b) {\n\t var isObjectA = isObject(a);\n\t var isObjectB = isObject(b);\n\t if (isObjectA && isObjectB) {\n\t return JSON.stringify(a) === JSON.stringify(b);\n\t } else if (!isObjectA && !isObjectB) {\n\t return String(a) === String(b);\n\t } else {\n\t return false;\n\t }\n\t}", "function shallowCompare(instance, nextProps, nextState) {\n\t return !shallowEqual(instance.props, nextProps) || !shallowEqual(instance.state, nextState);\n\t}", "function shallowCompare(instance, nextProps, nextState) {\n\t return !shallowEqual(instance.props, nextProps) || !shallowEqual(instance.state, nextState);\n\t}", "function shallowCompare(instance, nextProps, nextState) {\n\t return !shallowEqual(instance.props, nextProps) || !shallowEqual(instance.state, nextState);\n\t}", "function shallowCompare(instance, nextProps, nextState) {\n\t return !shallowEqual(instance.props, nextProps) || !shallowEqual(instance.state, nextState);\n\t}", "function shallowCompare(instance, nextProps, nextState) {\n\t return !shallowEqual(instance.props, nextProps) || !shallowEqual(instance.state, nextState);\n\t}", "function shallowCompare(instance, nextProps, nextState) {\n\t return !shallowEqual(instance.props, nextProps) || !shallowEqual(instance.state, nextState);\n\t}", "function shallowCompare(instance, nextProps, nextState) {\n\t return !shallowEqual(instance.props, nextProps) || !shallowEqual(instance.state, nextState);\n\t}", "function shallowCompare(instance, nextProps, nextState) {\n\t return !shallowEqual(instance.props, nextProps) || !shallowEqual(instance.state, nextState);\n\t}", "function shallowCompare(instance, nextProps, nextState) {\n\t return !shallowEqual(instance.props, nextProps) || !shallowEqual(instance.state, nextState);\n\t}", "function shallowCompare(instance, nextProps, nextState) {\n\t return !shallowEqual(instance.props, nextProps) || !shallowEqual(instance.state, nextState);\n\t}", "function shallowCompare(instance, nextProps, nextState) {\n\t return !shallowEqual(instance.props, nextProps) || !shallowEqual(instance.state, nextState);\n\t}", "function strictEquals(a) {\n return b => a === b;\n}", "function sc_isEqual(o1, o2) {\n return ((o1 === o2) ||\n\t (sc_isPair(o1) && sc_isPair(o2)\n\t && sc_isPairEqual(o1, o2, sc_isEqual)) ||\n\t (sc_isVector(o1) && sc_isVector(o2)\n\t && sc_isVectorEqual(o1, o2, sc_isEqual)));\n}", "function eq(x, y) {\n return util.inspect(x, true, null) === util.inspect(y, true, null);\n }", "function shallowCompare(a, b) {\r\n return checkProperties(a, b) && checkProperties(b, a);\r\n}", "function shallowCompare(a, b) {\r\n return checkProperties(a, b) && checkProperties(b, a);\r\n}", "eq(other) { return false; }", "isEqual(other, ignoreAttrs = ['_id', '_rev'], strict = false) {\n return isEqualWith(\n omit(this, ignoreAttrs),\n omit(other, ignoreAttrs),\n !strict && looseDates\n )\n }", "function defaultEquals(a, b) {\n return a === b;\n }", "function looseEqual(a,b){if(a===b){return true;}var isObjectA=isObject(a);var isObjectB=isObject(b);if(isObjectA&&isObjectB){try{var isArrayA=Array.isArray(a);var isArrayB=Array.isArray(b);if(isArrayA&&isArrayB){return a.length===b.length&&a.every(function(e,i){return looseEqual(e,b[i]);});}else if(!isArrayA&&!isArrayB){var keysA=Object.keys(a);var keysB=Object.keys(b);return keysA.length===keysB.length&&keysA.every(function(key){return looseEqual(a[key],b[key]);});}else{/* istanbul ignore next */return false;}}catch(e){/* istanbul ignore next */return false;}}else if(!isObjectA&&!isObjectB){return String(a)===String(b);}else{return false;}}", "function looseEqual(a,b){if(a===b){return true;}var isObjectA=isObject(a);var isObjectB=isObject(b);if(isObjectA&&isObjectB){try{var isArrayA=Array.isArray(a);var isArrayB=Array.isArray(b);if(isArrayA&&isArrayB){return a.length===b.length&&a.every(function(e,i){return looseEqual(e,b[i]);});}else if(!isArrayA&&!isArrayB){var keysA=Object.keys(a);var keysB=Object.keys(b);return keysA.length===keysB.length&&keysA.every(function(key){return looseEqual(a[key],b[key]);});}else{/* istanbul ignore next */return false;}}catch(e){/* istanbul ignore next */return false;}}else if(!isObjectA&&!isObjectB){return String(a)===String(b);}else{return false;}}", "function isEqual(a, b) {\n if (typeof a === 'function' && typeof b === 'function') {\n return true;\n }\n\n if ((0, _react.isValidElement)(a) && (0, _react.isValidElement)(b)) {\n return true;\n }\n\n if (a instanceof Array && b instanceof Array) {\n if (a.length !== b.length) {\n return false;\n }\n\n for (var i = 0; i !== a.length; i++) {\n if (!isEqual(a[i], b[i])) {\n return false;\n }\n }\n\n return true;\n }\n\n if (isObject(a) && isObject(b)) {\n if (Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n\n for (var _i3 = 0, _Object$keys = Object.keys(a); _i3 < _Object$keys.length; _i3++) {\n var key = _Object$keys[_i3];\n\n if (!isEqual(a[key], b[key])) {\n return false;\n }\n }\n\n return true;\n }\n\n return a === b;\n}", "function equal$1(a,b){// START: fast-deep-equal es6/index.js 3.1.1\nif(a===b)return true;if(a&&b&&typeof a=='object'&&typeof b=='object'){if(a.constructor!==b.constructor)return false;var length,i,keys;if(Array.isArray(a)){length=a.length;if(length!=b.length)return false;for(i=length;i--!==0;)if(!equal$1(a[i],b[i]))return false;return true;}// START: Modifications:\n// 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n// to co-exist with es5.\n// 2. Replace `for of` with es5 compliant iteration using `for`.\n// Basically, take:\n//\n// ```js\n// for (i of a.entries())\n// if (!b.has(i[0])) return false;\n// ```\n//\n// ... and convert to:\n//\n// ```js\n// it = a.entries();\n// while (!(i = it.next()).done)\n// if (!b.has(i.value[0])) return false;\n// ```\n//\n// **Note**: `i` access switches to `i.value`.\nvar it;if(hasMap&&a instanceof Map&&b instanceof Map){if(a.size!==b.size)return false;it=a.entries();while(!(i=it.next()).done)if(!b.has(i.value[0]))return false;it=a.entries();while(!(i=it.next()).done)if(!equal$1(i.value[1],b.get(i.value[0])))return false;return true;}if(hasSet&&a instanceof Set&&b instanceof Set){if(a.size!==b.size)return false;it=a.entries();while(!(i=it.next()).done)if(!b.has(i.value[0]))return false;return true;}// END: Modifications\nif(hasArrayBuffer&&ArrayBuffer.isView(a)&&ArrayBuffer.isView(b)){length=a.length;if(length!=b.length)return false;for(i=length;i--!==0;)if(a[i]!==b[i])return false;return true;}if(a.constructor===RegExp)return a.source===b.source&&a.flags===b.flags;if(a.valueOf!==Object.prototype.valueOf)return a.valueOf()===b.valueOf();if(a.toString!==Object.prototype.toString)return a.toString()===b.toString();keys=Object.keys(a);length=keys.length;if(length!==Object.keys(b).length)return false;for(i=length;i--!==0;)if(!Object.prototype.hasOwnProperty.call(b,keys[i]))return false;// END: fast-deep-equal\n// START: react-fast-compare\n// custom handling for DOM elements\nif(hasElementType&&a instanceof Element)return false;// custom handling for React/Preact\nfor(i=length;i--!==0;){if((keys[i]==='_owner'||keys[i]==='__v'||keys[i]==='__o')&&a.$$typeof){// React-specific: avoid traversing React elements' _owner\n// Preact-specific: avoid traversing Preact elements' __v and __o\n// __v = $_original / $_vnode\n// __o = $_owner\n// These properties contain circular references and are not needed when\n// comparing the actual elements (and not their owners)\n// .$$typeof and ._store on just reasonable markers of elements\ncontinue;}// all other properties should be traversed as usual\nif(!equal$1(a[keys[i]],b[keys[i]]))return false;}// END: react-fast-compare\n// START: fast-deep-equal\nreturn true;}return a!==a&&b!==b;}// end fast-deep-equal", "function sameValue(a, b) {\n return a == b\n}", "function $i__NM$$fbjs$lib$shallowEqual__is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n // Added the nonzero y check to make Flow happy, but it is redundant\n return x !== 0 || y !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n}", "function shallowEqual(objA,objB){if(is(objA,objB)){return true;}if((typeof objA==='undefined'?'undefined':_typeof(objA))!=='object'||objA===null||(typeof objB==='undefined'?'undefined':_typeof(objB))!=='object'||objB===null){return false;}var keysA=Object.keys(objA);var keysB=Object.keys(objB);if(keysA.length!==keysB.length){return false;}// Test for A's keys different from B.\nfor(var i=0;i<keysA.length;i++){if(!hasOwnProperty.call(objB,keysA[i])||!is(objA[keysA[i]],objB[keysA[i]])){return false;}}return true;}", "static EqualContents() {}", "function immutableObjectTest(){\n\nlet test= {'name': 'vishal', 'age':27};\n//Object.freeze(test);\nlet test2= test;\n\ntest.age = 26;\nconsole.log(test);\nconsole.log(test2);\nconsole.log(test === test2);\n\n\n\n\n}", "function ComparedObject(value) {\n this.value = value;\n }", "function sameValue(a, b) {\n return a === b\n}", "function shallowCompare(a, b) {\n return checkProperties(a, b) && checkProperties(b, a);\n}", "function shallowCompare(a, b) {\n return checkProperties(a, b) && checkProperties(b, a);\n}", "function shallowCompare(a, b) {\n return checkProperties(a, b) && checkProperties(b, a);\n}", "function shallowCompare(a, b) {\n return checkProperties(a, b) && checkProperties(b, a);\n}", "function shallowEqual(objA,objB){if(is(objA,objB)){return true;}if((typeof objA==='undefined'?'undefined':_typeof(objA))!=='object'||objA===null||(typeof objB==='undefined'?'undefined':_typeof(objB))!=='object'||objB===null){return false;}var keysA=Object.keys(objA);var keysB=Object.keys(objB);if(keysA.length!==keysB.length){return false;}// Test for A's keys different from B.\nfor(var i=0;i<keysA.length;i++){if(!hasOwnProperty$1.call(objB,keysA[i])||!is(objA[keysA[i]],objB[keysA[i]])){return false;}}return true;}", "isEqual(comp) {\n return this.die1 === comp.die1 && this.die2 === comp.die2;\n }", "function defaultCheckValueEquality (a, b) {\n return a === b;\n}", "function defaultCheckValueEquality (a, b) {\n return a === b;\n}" ]
[ "0.6085072", "0.5797941", "0.56714934", "0.56600976", "0.56600976", "0.5634895", "0.5591487", "0.5591487", "0.5589446", "0.5548937", "0.54901", "0.5488135", "0.54843646", "0.54843646", "0.5476242", "0.5476242", "0.5476242", "0.54560626", "0.54560626", "0.5442269", "0.5401306", "0.5393591", "0.5375295", "0.53655976", "0.5346049", "0.5334246", "0.530747", "0.53017634", "0.5294634", "0.52897286", "0.52879906", "0.5278712", "0.52709246", "0.526601", "0.526601", "0.526601", "0.52640676", "0.5252659", "0.5252659", "0.5252659", "0.5252659", "0.5252659", "0.5252659", "0.5252659", "0.5252659", "0.5252659", "0.5252659", "0.5252659", "0.5243927", "0.52375734", "0.52375734", "0.5236691", "0.5231512", "0.5231208", "0.5224339", "0.52176857", "0.5208424", "0.5208424", "0.5208424", "0.5208424", "0.5208424", "0.52067316", "0.5201261", "0.51958257", "0.51958257", "0.51958257", "0.51958257", "0.51958257", "0.51958257", "0.51958257", "0.51958257", "0.51958257", "0.51958257", "0.51958257", "0.5195558", "0.5192416", "0.5189186", "0.5182949", "0.5182949", "0.51685977", "0.5161535", "0.51497644", "0.5145559", "0.5145559", "0.5132309", "0.5129895", "0.51276207", "0.51236033", "0.51222205", "0.51221913", "0.5116761", "0.51162755", "0.511481", "0.51045537", "0.51045537", "0.51045537", "0.51045537", "0.50982887", "0.5090174", "0.50901", "0.50901" ]
0.0
-1
an immutable object with a single mutable value
function createRef() { var refObject = { current: null }; { Object.seal(refObject); } return refObject; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function immutableObjectTest(){\n\nlet test= {'name': 'vishal', 'age':27};\n//Object.freeze(test);\nlet test2= test;\n\ntest.age = 26;\nconsole.log(test);\nconsole.log(test2);\nconsole.log(test === test2);\n\n\n\n\n}", "static set one(value) {}", "function makeImmutableObject(obj) {\n\t if (!globalConfig.use_static) {\n\t addPropertyTo(obj, \"merge\", merge);\n\t addPropertyTo(obj, \"replace\", objectReplace);\n\t addPropertyTo(obj, \"without\", without);\n\t addPropertyTo(obj, \"asMutable\", asMutableObject);\n\t addPropertyTo(obj, \"set\", objectSet);\n\t addPropertyTo(obj, \"setIn\", objectSetIn);\n\t addPropertyTo(obj, \"update\", update);\n\t addPropertyTo(obj, \"updateIn\", updateIn);\n\t addPropertyTo(obj, \"getIn\", getIn);\n\t }\n\t\n\t return makeImmutable(obj, mutatingObjectMethods);\n\t }", "function makeImmutableObject(obj) {\n\t if (!globalConfig.use_static) {\n\t addPropertyTo(obj, \"merge\", merge);\n\t addPropertyTo(obj, \"replace\", objectReplace);\n\t addPropertyTo(obj, \"without\", without);\n\t addPropertyTo(obj, \"asMutable\", asMutableObject);\n\t addPropertyTo(obj, \"set\", objectSet);\n\t addPropertyTo(obj, \"setIn\", objectSetIn);\n\t addPropertyTo(obj, \"update\", update);\n\t addPropertyTo(obj, \"updateIn\", updateIn);\n\t addPropertyTo(obj, \"getIn\", getIn);\n\t }\n\n\t return makeImmutable(obj, mutatingObjectMethods);\n\t }", "function makeImmutableObject(obj) {\n\t if (!globalConfig.use_static) {\n\t addPropertyTo(obj, \"merge\", merge);\n\t addPropertyTo(obj, \"replace\", objectReplace);\n\t addPropertyTo(obj, \"without\", without);\n\t addPropertyTo(obj, \"asMutable\", asMutableObject);\n\t addPropertyTo(obj, \"set\", objectSet);\n\t addPropertyTo(obj, \"setIn\", objectSetIn);\n\t addPropertyTo(obj, \"update\", update);\n\t addPropertyTo(obj, \"updateIn\", updateIn);\n\t addPropertyTo(obj, \"getIn\", getIn);\n\t }\n\n\t return makeImmutable(obj, mutatingObjectMethods);\n\t }", "function manipulationBareObj( value ) {\n\treturn value;\n}", "function toImmutable(arg) {\n\t\t return (isImmutable(arg))\n\t\t ? arg\n\t\t : Immutable.fromJS(arg)\n\t\t}", "function makeImmutableObject(obj) {\n if (!globalConfig.use_static) {\n addPropertyTo(obj, \"merge\", merge);\n addPropertyTo(obj, \"replace\", objectReplace);\n addPropertyTo(obj, \"without\", without);\n addPropertyTo(obj, \"asMutable\", asMutableObject);\n addPropertyTo(obj, \"set\", objectSet);\n addPropertyTo(obj, \"setIn\", objectSetIn);\n addPropertyTo(obj, \"update\", update);\n addPropertyTo(obj, \"updateIn\", updateIn);\n addPropertyTo(obj, \"getIn\", getIn);\n }\n\n return makeImmutable(obj, mutatingObjectMethods);\n }", "function toImmutable(arg) {\n\t return (isImmutable(arg))\n\t ? arg\n\t : Immutable.fromJS(arg)\n\t}", "function castImmutable(value) {\n return value;\n}", "function set(obj, key, val, immutable) {\n if (immutable)\n return _set(assign({}, obj), key, val);\n return _set(obj, key, val);\n}", "function constObjects() {\n const name = {\n person: \"reefath\"\n }\n \n name.person = \"tesla\"\n \n return name.person;\n}", "function makeImmutableProperty (self, schema, values, propName) {\n var Model, dateCopy;\n\n if (schema[propName].__immutableCtor && is.function(schema[propName])) {\n // this is a nested immutable\n Model = schema[propName];\n self[propName] = new Model(values[propName]);\n } else if (isDate(values[propName])) {\n dateCopy = new Date(values[propName]);\n\n Object.defineProperty(self, propName, {\n get: function () {\n return new Date(dateCopy);\n },\n enumerable: true,\n configurable: false\n });\n\n Object.freeze(self[propName]);\n } else {\n objectHelper.setReadOnlyProperty(\n self,\n propName,\n // TODO: is it really necessary to clone the value if it isn't an object?\n objectHelper.copyValue(values[propName]),\n // typeof values[propName] === 'object' ? objectHelper.copyValue(values[propName]) : values[propName],\n makeSetHandler(propName)\n );\n\n if (Array.isArray(values[propName])) {\n Object.freeze(self[propName]);\n }\n }\n }", "set(name, value) {\n return this.clone({\n name,\n value,\n op: 's'\n });\n }", "set Baked(value) {}", "set x(value = 42) {}", "set x(value) {}", "copyable(newValue = true) {\n this.value.copyable = newValue;\n return this;\n }", "function put(obj, key, val, immutable) {\n if (immutable)\n return _put(assign({}, obj), key, val);\n return _put(obj, key, val);\n}", "set(name, value) {\n return this.clone({ name, value, op: 's' });\n }", "set(name, value) {\n return this.clone({ name, value, op: 's' });\n }", "set(name, value) {\n return this.clone({ name, value, op: 's' });\n }", "set(name, value) {\n return this.clone({ name, value, op: 's' });\n }", "set(name, value) {\n return this.clone({ name, value, op: 's' });\n }", "set(index, object) {\n return object;\n }", "set value(value) {}", "build() {\n const state = Immutable.from(this.state);\n this.setState(state);\n return state.asMutable();\n }", "set(obj, value) {\n return this.update(obj, () => value);\n }", "static foo (a) { return { ...a, b: 2 } }", "function constantobjects() {\n const user = {\n name: \"John\"\n };\n\n console.log(user.name);\n\n // does it work? // yes\n user.name = \"Pete\";\n console.log(user.name);\n}", "set(value) {\n if (value === this._value) {\n return this;\n }\n\n return new ImmutableAccessor(value, this.path);\n }", "function example6() {\n var o = { a: 1 };\n o.a = 2; //allowed: change ref object\n o.b = 1; //allowed: change ref object\n\n // o = {a: 1} //not allowed: change referece itself\n}", "static set zero(value) {}", "copy() {\n return Object.assign(Object.create(this), JSON.parse(JSON.stringify(this)))\n }", "set(v) { /* empty */ }", "set(value) {\n this.value = value\n if (this.autoUpdate) {\n this.update()\n }\n return this // chain me up baby\n }", "copy({ type = this.type, value = this.value } = {}) {\n const { id, lbp, rules, unknown, ignored } = this;\n return new this.constructor(id, {\n lbp,\n rules,\n unknown,\n ignored,\n type,\n value,\n original: this,\n });\n }", "function identity(val){\n\t return val;\n\t }", "one() {\r\n this.data.fill(0);\r\n this.data[0] = 1;\r\n }", "function cumpleanosClonandoObjeto(persona){\n return {\n ...persona,\n edad: persona.edad += 1\n }\n}", "function objSeal(){\n var digits = {\n 1:'one',\n 2:'two',\n 3:'three',\n }\n // Object.defineProperty(digits,2,{\n // writable:false\n // })\n console.log(digits);\n Object.seal(digits);\n digits[2] = 'TWO';\n console.log(digits);\n}", "set x(x) {\n this[0] = x;\n }", "set(param, value) {\n return this.clone({\n param,\n value,\n op: 's'\n });\n }", "function changing(obj){\n obj.greeting = 'hola'; //mutate\n}", "set() {}", "function ComparedObject(value) {\n this.value = value;\n }", "function changeGreeting(obj) {\n obj.greeting = 'Hola'; // mutate \n}", "function M(){this.a={}}", "function snapshot(value, merged = 1) {\n return { value, merged };\n}", "function identity(val){\n return val;\n }", "function identity(val){\n return val;\n }", "function identity(val){\n return val;\n }", "constructor () {\n this.storage = immutable.Map()\n }", "static initialize(obj, id, value) { \n obj['id'] = id;\n obj['value'] = value;\n }", "copy() {\n return new this.constructor(\n this.power,\n this.value,\n (this.next != null) ? this.next.copy() : null,\n );\n }", "function identity(value) {\n return value;\n }", "function identity(value) {\n return value;\n }", "function identity(value) {\n return value;\n }", "function identity(value) {\n return value;\n }", "function identity(value) {\n return value;\n }", "function identity(value) {\n return value;\n }", "function identity(value) {\n return value;\n }", "function identity(value) {\n return value;\n }", "function identity(value) {\n return value;\n }", "function shallowReadonly(target) {\r\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\r\n}", "function shallowReadonly(target) {\r\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\r\n}", "function shallowReadonly(target) {\r\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\r\n}", "function M() {\n this.a = {};\n }", "function changeGreeting (obj) {\n obj.greeting = 'Hola' // mutate\n}", "function changeGreeting(obj) {\n\tobj.greeting = 'Hola'; //mutate\n}", "s(_value) {\n this.value = _value;\n this.refresh();\n }", "s(_value) {\n this.value = _value;\n this.refresh();\n }", "function changeGreeting(obj) {\n obj.greeting = \"hola\" //mutate\n}", "function memo (newParameterValue) {\n return initialize.observable({\n observableState,\n newParameterValue\n })\n }", "function destructivelyUpdateObjectWithKeyAndValue(object,key,value){\n object[key]=value;\n return object;\n}", "function deepCopy(value) {\r\n return deepExtend(undefined, value);\r\n}", "function deepCopy(value) {\r\n return deepExtend(undefined, value);\r\n}", "set(param, value) {\n return this.clone({ param, value, op: 's' });\n }", "set(param, value) {\n return this.clone({ param, value, op: 's' });\n }", "set(param, value) {\n return this.clone({ param, value, op: 's' });\n }", "set(param, value) {\n return this.clone({ param, value, op: 's' });\n }", "set(param, value) {\n return this.clone({ param, value, op: 's' });\n }", "function shallowReadonly(target) {\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\n}", "function shallowReadonly(target) {\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\n}", "function shallowReadonly(target) {\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\n}", "function shallowReadonly(target) {\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\n}", "function shallowReadonly(target) {\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\n}", "function shallowReadonly(target) {\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\n}", "function shallowReadonly(target) {\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\n}", "constant(name, value) {\n return this.singleton(name, () => value);\n }", "function setA(o, val) {\n o.a = val;\n}", "constructor() {\n this.value = {};\n this.num = 0;\n }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }" ]
[ "0.6674448", "0.66609514", "0.6358345", "0.6347869", "0.6347869", "0.6263268", "0.6230736", "0.6136926", "0.61048114", "0.5915378", "0.5889688", "0.580687", "0.5776291", "0.5763881", "0.57248324", "0.56947106", "0.566211", "0.5636481", "0.56181127", "0.5606209", "0.5606209", "0.5606209", "0.5606209", "0.5606209", "0.5586234", "0.557178", "0.55356383", "0.55104053", "0.55075973", "0.550587", "0.54879093", "0.54802936", "0.5433998", "0.5431201", "0.54187083", "0.5394902", "0.53887403", "0.53795755", "0.5371964", "0.5357756", "0.53558546", "0.5347443", "0.5346903", "0.53416175", "0.53413206", "0.533415", "0.53338236", "0.53209484", "0.5320444", "0.5318093", "0.5318093", "0.5318093", "0.5310658", "0.53033954", "0.5293375", "0.52826554", "0.52826554", "0.52826554", "0.52826554", "0.52826554", "0.52826554", "0.52826554", "0.52826554", "0.52826554", "0.52801293", "0.52801293", "0.52801293", "0.5260411", "0.5250951", "0.52408385", "0.5236158", "0.5236158", "0.523219", "0.5231279", "0.5225852", "0.5224158", "0.5224158", "0.5219042", "0.5219042", "0.5219042", "0.5219042", "0.5219042", "0.5208099", "0.5208099", "0.5208099", "0.5208099", "0.5208099", "0.5208099", "0.5208099", "0.52074826", "0.52008766", "0.51992226", "0.519395", "0.519395", "0.519395", "0.519395", "0.519395", "0.519395", "0.519395", "0.519395", "0.519395" ]
0.0
-1
Create and return a new ReactElement of the given type. See
function createElement(type, config, children) { var propName = void 0; // Reserved names are extracted var props = {}; var key = null; var ref = null; var self = null; var source = null; if (config != null) { if (hasValidRef(config)) { ref = config.ref; } if (hasValidKey(config)) { key = '' + config.key; } self = config.__self === undefined ? null : config.__self; source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object for (propName in config) { if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { props[propName] = config[propName]; } } } // Children can be more than one argument, and those are transferred onto // the newly allocated props object. var childrenLength = arguments.length - 2; if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 2]; } { if (Object.freeze) { Object.freeze(childArray); } } props.children = childArray; } // Resolve default props if (type && type.defaultProps) { var defaultProps = type.defaultProps; for (propName in defaultProps) { if (props[propName] === undefined) { props[propName] = defaultProps[propName]; } } } { if (key || ref) { if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) { var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; if (key) { defineKeyPropWarningGetter(props, displayName); } if (ref) { defineRefPropWarningGetter(props, displayName); } } } } return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createElement(type,config,children){var propName;// Reserved names are extracted\nvar props={};var key=null;var ref=null;var self=null;var source=null;if(config!=null){if(hasValidRef(config)){ref=config.ref;{warnIfStringRefCannotBeAutoConverted(config);}}if(hasValidKey(config)){key=''+config.key;}self=config.__self===undefined?null:config.__self;source=config.__source===undefined?null:config.__source;// Remaining properties are added to a new props object\nfor(propName in config){if(hasOwnProperty.call(config,propName)&&!RESERVED_PROPS.hasOwnProperty(propName)){props[propName]=config[propName];}}}// Children can be more than one argument, and those are transferred onto\n// the newly allocated props object.\nvar childrenLength=arguments.length-2;if(childrenLength===1){props.children=children;}else if(childrenLength>1){var childArray=Array(childrenLength);for(var i=0;i<childrenLength;i++){childArray[i]=arguments[i+2];}{if(Object.freeze){Object.freeze(childArray);}}props.children=childArray;}// Resolve default props\nif(type&&type.defaultProps){var defaultProps=type.defaultProps;for(propName in defaultProps){if(props[propName]===undefined){props[propName]=defaultProps[propName];}}}{if(key||ref){var displayName=typeof type==='function'?type.displayName||type.name||'Unknown':type;if(key){defineKeyPropWarningGetter(props,displayName);}if(ref){defineRefPropWarningGetter(props,displayName);}}}return ReactElement(type,key,ref,self,source,ReactCurrentOwner.current,props);}", "function createElement(type,config,children){var propName=void 0;// Reserved names are extracted\nvar props={};var key=null;var ref=null;var self=null;var source=null;if(config!=null){if(hasValidRef(config)){ref=config.ref;}if(hasValidKey(config)){key=''+config.key;}self=config.__self===undefined?null:config.__self;source=config.__source===undefined?null:config.__source;// Remaining properties are added to a new props object\nfor(propName in config){if(hasOwnProperty.call(config,propName)&&!RESERVED_PROPS.hasOwnProperty(propName)){props[propName]=config[propName];}}}// Children can be more than one argument, and those are transferred onto\n// the newly allocated props object.\nvar childrenLength=arguments.length-2;if(childrenLength===1){props.children=children;}else if(childrenLength>1){var childArray=Array(childrenLength);for(var i=0;i<childrenLength;i++){childArray[i]=arguments[i+2];}{if(Object.freeze){Object.freeze(childArray);}}props.children=childArray;}// Resolve default props\nif(type&&type.defaultProps){var defaultProps=type.defaultProps;for(propName in defaultProps){if(props[propName]===undefined){props[propName]=defaultProps[propName];}}}{if(key||ref){var displayName=typeof type==='function'?type.displayName||type.name||'Unknown':type;if(key){defineKeyPropWarningGetter(props,displayName);}if(ref){defineRefPropWarningGetter(props,displayName);}}}return ReactElement(type,key,ref,self,source,ReactCurrentOwner.current,props);}", "function createElement(type) {\n return document.createElement(type);\n }", "function makeElement(type) {\n\t\treturn document.createElement(type);\n\t}", "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "function createElement (type, props, ...children) {\n if (props.class) {\n processClasses(props.class)\n }\n return createDOMElement(type, props, ...children)\n}", "function make(type) {\n\treturn document.createElement(type);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createReactElement(component) {\n\treturn {\n\t\ttype: component.constructor,\n\t\tkey: component.key,\n\t\tref: null, // Unsupported\n\t\tprops: component.props\n\t};\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n var props = {\n };\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config);\n }\n if (hasValidKey(config)) key = '' + config.key;\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n for(propName in config)if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) props[propName] = config[propName];\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) props.children = children;\n else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for(var i = 0; i < childrenLength; i++)childArray[i] = arguments[i + 2];\n if (Object.freeze) Object.freeze(childArray);\n props.children = childArray;\n } // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for(propName in defaultProps)if (props[propName] === undefined) props[propName] = defaultProps[propName];\n }\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) defineKeyPropWarningGetter(props, displayName);\n if (ref) defineRefPropWarningGetter(props, displayName);\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "function element(type, props, ...children) {\n let e = document.createElement(type);\n if (typeof props != \"undefined\" && props != null) {\n Object.keys(props).forEach(key => e.setAttribute(key, props[key]));\n }\n if (typeof children != \"undefined\" && children != null) {\n children.forEach(child => e.appendChild(child));\n }\n return e;\n}", "getElementConstructor(type) {\n return JSXElement;\n }", "function createElement(type, config, children) {\n\t var propName;\n\t\n\t // Reserved names are extracted\n\t var props = {};\n\t\n\t var key = null;\n\t var ref = null;\n\t var self = null;\n\t var source = null;\n\t\n\t if (config != null) {\n\t if (hasValidRef(config)) {\n\t ref = config.ref;\n\t }\n\t if (hasValidKey(config)) {\n\t key = '' + config.key;\n\t }\n\t\n\t self = config.__self === undefined ? null : config.__self;\n\t source = config.__source === undefined ? null : config.__source;\n\t // Remaining properties are added to a new props object\n\t for (propName in config) {\n\t if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n\t props[propName] = config[propName];\n\t }\n\t }\n\t }\n\t\n\t // Children can be more than one argument, and those are transferred onto\n\t // the newly allocated props object.\n\t var childrenLength = arguments.length - 2;\n\t if (childrenLength === 1) {\n\t props.children = children;\n\t } else if (childrenLength > 1) {\n\t var childArray = Array(childrenLength);\n\t for (var i = 0; i < childrenLength; i++) {\n\t childArray[i] = arguments[i + 2];\n\t }\n\t {\n\t if (Object.freeze) {\n\t Object.freeze(childArray);\n\t }\n\t }\n\t props.children = childArray;\n\t }\n\t\n\t // Resolve default props\n\t if (type && type.defaultProps) {\n\t var defaultProps = type.defaultProps;\n\t for (propName in defaultProps) {\n\t if (props[propName] === undefined) {\n\t props[propName] = defaultProps[propName];\n\t }\n\t }\n\t }\n\t {\n\t if (key || ref) {\n\t if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n\t var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\t if (key) {\n\t defineKeyPropWarningGetter(props, displayName);\n\t }\n\t if (ref) {\n\t defineRefPropWarningGetter(props, displayName);\n\t }\n\t }\n\t }\n\t }\n\t return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n\t}", "function el(type, ...value) {\n const newElement = document.createElement(type);\n if (typeof value[0] === 'string') {\n newElement.textContent = value[0];\n } else {\n value.forEach(e => newElement.appendChild(e));\n }\n return newElement;\n }", "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}" ]
[ "0.6893627", "0.68369675", "0.67687505", "0.67585975", "0.67468476", "0.67468476", "0.67468476", "0.67468476", "0.67468476", "0.67468476", "0.67468476", "0.67468476", "0.67468476", "0.6566136", "0.6558518", "0.64085925", "0.64085925", "0.64085925", "0.64085925", "0.64085925", "0.63828063", "0.63736975", "0.63736975", "0.63736975", "0.63736975", "0.63736975", "0.63736975", "0.63736975", "0.63736975", "0.63736975", "0.63736975", "0.63736975", "0.63736975", "0.63736975", "0.63736975", "0.63736975", "0.63736975", "0.63736975", "0.63736975", "0.63736975", "0.63736975", "0.63736975", "0.63736975", "0.63736975", "0.63736975", "0.63736975", "0.63736975", "0.63736975", "0.63704383", "0.6336523", "0.6319497", "0.62726486", "0.62328595", "0.6231391", "0.6231391", "0.6231391", "0.6231391", "0.6231391", "0.6231391", "0.6231391", "0.6231391", "0.6231391", "0.6231391", "0.6231391", "0.6231391", "0.6231391", "0.6231391", "0.6231391", "0.6231391", "0.6231391", "0.6231391", "0.6231391", "0.6231391", "0.6231391", "0.6231391", "0.6231391", "0.6231391", "0.6231391", "0.6231391", "0.6231391", "0.6231391" ]
0.6346304
64
Return a function that produces ReactElements of a given type. See
function cloneAndReplaceKey(oldElement, newKey) { var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props); return newElement; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getElementConstructor(type) {\n return JSXElement;\n }", "wrap(type = this.type, props) {\n if (props) {\n if (typeof props === \"string\") props = { className: props };\n else props = this.normalizeProps(props);\n }\n this.elements = [ React.createElement(type, props, ...this.elements) ];\n }", "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "function createDOMFactory(type) {\n var factory = React.createElement.bind(null, type);\n // Expose the type on the factory and the prototype so that it can be\n // easily accessed on elements. E.g. `<Foo />.type === Foo`.\n // This should not be named `constructor` since this may not be the function\n // that created the element, and it may not even be a constructor.\n factory.type = type;\n return factory;\n }", "function whatTypeElement(P){\n const attrs = mkAttributs(P)\n if (_.indexOf($text_type, P.type)>-1){\n if (P.type === 'select') return mk_select(P)\n if (P.type == 'date') return mk_datepicker(P)\n if (P.type == 'span') return mk_span(P)\n if (P.type == 'textarea') return mk_textarea(P)\n if (_.indexOf($phold_type, P.type)>-1){\n return (\n <input\n ref={'#'+(P.id||P.name)}\n className='form_control'\n {...attrs}\n />\n )\n }\n\n return (\n <input\n ref={'#'+(P.id||P.name)}\n className='form_control'\n {...attrs}\n />\n )\n }\n\n if (_.indexOf($button_type, P.type)>-1){\n return (\n <input\n ref={'#'+(P.id||P.name)}\n className='btn'\n {...attrs}\n />\n )\n }\n}", "function elem(type){\n return document.createElement(type || 'div');\n }", "function makeElement(type) {\n\t\treturn document.createElement(type);\n\t}", "function element(type, props, ...children) {\n let e = document.createElement(type);\n if (typeof props != \"undefined\" && props != null) {\n Object.keys(props).forEach(key => e.setAttribute(key, props[key]));\n }\n if (typeof children != \"undefined\" && children != null) {\n children.forEach(child => e.appendChild(child));\n }\n return e;\n}", "function el(type, ...value) {\n const newElement = document.createElement(type);\n if (typeof value[0] === 'string') {\n newElement.textContent = value[0];\n } else {\n value.forEach(e => newElement.appendChild(e));\n }\n return newElement;\n }", "function buildElements(type,obj) {\n const element = document.createElement(type);\n for (let prop in obj) {\n element[prop] = obj[prop];\n }\n return element;\n}", "function CreateEl(type, props){\n elem = $(document.createElement(type));\n\n // Set properties to the element if any were passed\n if (Array.isArray(props))\n {\n props.forEach(propPair => { \n // set the properties if given a valid pair\n if (Array.isArray(propPair) && propPair.length >= 2)\n elem.prop(propPair[0], propPair[1]); \n });\n }\n\n return elem;\n}", "function componentWrapper(type) {\n return function () {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n args.unshift(type);\n this.component.apply(this, args);\n };\n }", "function make(type) {\n\treturn document.createElement(type);\n}", "function renderElement() {\r\n const { type, uid, defaultValue, labelName, ...propsToSend } = element;\r\n const value = formState[uid] ? formState[uid] : defaultValue;\r\n const onBlur = (e) => onBlurHandler(uid, e.target.value);\r\n\r\n switch (type) {\r\n case TEXT:\r\n case EMAIL:\r\n case NUMBER:\r\n case PASSWORD:\r\n return (\r\n <>\r\n {labelName && renderLabel(element)}\r\n <Input\r\n type={type}\r\n id={uid}\r\n value={value}\r\n onBlur={onBlur}\r\n {...propsToSend}\r\n />\r\n </>\r\n );\r\n case CHECKBOX:\r\n return (\r\n <div className=\"flex\">\r\n {element.labelName && renderLabel(element)}\r\n <Checkbox id={uid} value={value} onBlur={onBlur} {...propsToSend} />\r\n </div>\r\n );\r\n case RADIO:\r\n return (\r\n <>\r\n {element.labelName && renderLabel(element)}\r\n <Radio id={uid} value={value} onBlur={onBlur} {...propsToSend} />\r\n </>\r\n );\r\n case SELECT:\r\n return (\r\n <Select id={uid} value={value} onBlur={onBlur} {...propsToSend} />\r\n );\r\n case TEXTAREA:\r\n return (\r\n <>\r\n {element.labelName && renderLabel(element)}\r\n <Textarea\r\n id={uid}\r\n value={value}\r\n onBlur={onBlur}\r\n {...propsToSend}\r\n rows=\"4\"\r\n cols=\"50\"\r\n />\r\n </>\r\n );\r\n default:\r\n return <></>;\r\n }\r\n }", "function generate_ele(type, arg){\n // Create element\n switch(type){\n case \"button\": case \"checkbox\": case \"radio\": case \"file\": case \"hidden\": case \"image\": case \"password\": case \"reset\": case \"submit\": case \"text\": case \"color\": case \"date\": case \"datetime\": case \"datetime-local\": case \"email\": case \"month\": case \"number\": case \"range\": case \"search\": case \"tel\": case \"time\": case \"url\": case \"week\":\n var ele = document.createElement('input');\n ele.type = type;\n break;\n default:\n var ele = document.createElement(type);\n }\n\n // Set attributes\n if(typeof arg !== 'undefined'){\n if(type == \"select\"){\n for (var i = 0; i < arg.value.length; i++) {\n option = document.createElement(\"OPTION\")\n option.setAttribute(\"value\", arg.value[i])\n if(arg.selected == arg.value[i]){\n option.setAttribute(\"selected\", \"selected\")\n }\n option.appendChild(document.createTextNode(arg.value[i]))\n ele.appendChild(option)\n }\n }\n else{\n ele.value = arg.value || \"\";\n }\n ele.id = arg.id || \"\";\n ele.className = arg.class || \"\";\n ele.htmlFor = arg.htmlfor || \"\"\n ele.name = arg.name || \"\"\n if(ele.tagName == \"LABEL\"){\n ele.appendChild(document.createTextNode(arg.lblText || \"label\"));\n }\n else if(ele.tagName == \"DIV\"){\n ele.appendChild(document.createTextNode(arg.innerText || \"\"));\n }\n }\n return ele\n}", "function elementFactory(data) {\n if (!data.hasOwnProperty(\"type\"))\n return null;\n let el = document.createElement(data.type);\n if (data.hasOwnProperty(\"class\"))\n $(el).addClass(data.class);\n if (data.hasOwnProperty(\"html\"))\n $(el).html(data.html);\n if (data.hasOwnProperty(\"css\"))\n $(el).css(data.css);\n if (data.hasOwnProperty(\"attr\")) {\n for (let key in data.attr) {\n if (!data.attr.hasOwnProperty(key))\n continue;\n $(el).attr(key, data.attr[key]);\n }\n }\n if (data.hasOwnProperty(\"on\")) {\n for (let key in data.on) {\n if (!data.on.hasOwnProperty(key))\n continue;\n $(el).on(key, { target: el }, data.on[key]);\n }\n }\n return el;\n}", "function createElement(type,config,children){var propName=void 0;// Reserved names are extracted\nvar props={};var key=null;var ref=null;var self=null;var source=null;if(config!=null){if(hasValidRef(config)){ref=config.ref;}if(hasValidKey(config)){key=''+config.key;}self=config.__self===undefined?null:config.__self;source=config.__source===undefined?null:config.__source;// Remaining properties are added to a new props object\nfor(propName in config){if(hasOwnProperty.call(config,propName)&&!RESERVED_PROPS.hasOwnProperty(propName)){props[propName]=config[propName];}}}// Children can be more than one argument, and those are transferred onto\n// the newly allocated props object.\nvar childrenLength=arguments.length-2;if(childrenLength===1){props.children=children;}else if(childrenLength>1){var childArray=Array(childrenLength);for(var i=0;i<childrenLength;i++){childArray[i]=arguments[i+2];}{if(Object.freeze){Object.freeze(childArray);}}props.children=childArray;}// Resolve default props\nif(type&&type.defaultProps){var defaultProps=type.defaultProps;for(propName in defaultProps){if(props[propName]===undefined){props[propName]=defaultProps[propName];}}}{if(key||ref){var displayName=typeof type==='function'?type.displayName||type.name||'Unknown':type;if(key){defineKeyPropWarningGetter(props,displayName);}if(ref){defineRefPropWarningGetter(props,displayName);}}}return ReactElement(type,key,ref,self,source,ReactCurrentOwner.current,props);}", "createWrapped(type, props, content) {\n if (typeof props === \"string\") props = { className: props };\n let wrapper;\n if (Array.isArray(content)) return React.createElement(type, props, ...content);\n return React.createElement(type, props, content);\n }", "function UnderreactType() {}", "function elt(type, ...children) {\n let node = document.createElement(type);\n for (let child of children) {\n if (typeof child != \"string\") node.appendChild(child);\n else node.appendChild(document.createTextNode(child));\n }\n return node;\n}", "function el(type, content, attributes) {\n const result = document.createElement(type);\n\n if (attributes !== undefined) {\n Object.assign(result, attributes);\n }\n\n if (Array.isArray(content)) {\n content.forEach(append);\n } else {\n append(content);\n }\n\n function append(node) {\n if (typeof node === 'string') {\n node = document.createTextNode(node);\n }\n result.appendChild(node);\n }\n return result;\n }", "elementsOfType(types) {\n return _.chain(this.getTableEntries())\n .filter(e => {\n var elemType = getElemFieldVal(e, FIELD_TYPE);\n return _.includes(types, elemType);\n })\n .map(e => {\n return getElemFieldVal(e, FIELD_NAME);\n })\n .value();\n }", "function feFactory(createElement, FelaComponent) {\n return function fe(type) {\n for (var _len = arguments.length, children = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n children[_key - 2] = arguments[_key];\n }\n\n var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (props) {\n var css = props.css,\n key = props.key,\n ref = props.ref,\n className = props.className,\n otherProps = _objectWithoutProperties(props, ['css', 'key', 'ref', 'className']);\n\n if (css) {\n return createElement(FelaComponent, {\n style: css,\n key: key,\n ref: ref\n }, function (renderProps) {\n return createElement.apply(undefined, [type, _extends({}, otherProps, {\n className: className ? className + ' ' + renderProps.className : renderProps.className\n })].concat(_toConsumableArray(children)));\n });\n }\n }\n\n return createElement.apply(undefined, [type, props].concat(_toConsumableArray(children)));\n };\n}", "function createNode(type, ...args) {\n const kind = typeof type;\n if (kind === 'string') {\n return Element(type, ...args);\n } else if (kind === 'function') {\n return type(...args);\n } else {\n throw InvalidArgValue(\n { type },\n 'should be an element name or component constructor'\n );\n }\n}", "function createElement(type,config,children){var propName;// Reserved names are extracted\nvar props={};var key=null;var ref=null;var self=null;var source=null;if(config!=null){if(hasValidRef(config)){ref=config.ref;{warnIfStringRefCannotBeAutoConverted(config);}}if(hasValidKey(config)){key=''+config.key;}self=config.__self===undefined?null:config.__self;source=config.__source===undefined?null:config.__source;// Remaining properties are added to a new props object\nfor(propName in config){if(hasOwnProperty.call(config,propName)&&!RESERVED_PROPS.hasOwnProperty(propName)){props[propName]=config[propName];}}}// Children can be more than one argument, and those are transferred onto\n// the newly allocated props object.\nvar childrenLength=arguments.length-2;if(childrenLength===1){props.children=children;}else if(childrenLength>1){var childArray=Array(childrenLength);for(var i=0;i<childrenLength;i++){childArray[i]=arguments[i+2];}{if(Object.freeze){Object.freeze(childArray);}}props.children=childArray;}// Resolve default props\nif(type&&type.defaultProps){var defaultProps=type.defaultProps;for(propName in defaultProps){if(props[propName]===undefined){props[propName]=defaultProps[propName];}}}{if(key||ref){var displayName=typeof type==='function'?type.displayName||type.name||'Unknown':type;if(key){defineKeyPropWarningGetter(props,displayName);}if(ref){defineRefPropWarningGetter(props,displayName);}}}return ReactElement(type,key,ref,self,source,ReactCurrentOwner.current,props);}", "function createElement(type) {\n return document.createElement(type);\n }", "produce() {\n var listElem = [],\n uniqueKey = [];\n this.list.forEach(item => {\n var elem = <RenderElement elemkey={item.key} text={item.text} type={item.type} inlineStyleRanges={item.inlineStyleRanges}/>\n uniqueKey.push(item.key)\n listElem.push(elem)\n })\n return (this.list[0].type == \"unordered-list-item\" ? <ul key={uniqueKey.join(\"|\")}>{listElem}</ul> : <ol key={uniqueKey.join(\"|\")}>{listElem}</ol>)\n }", "function ElementList(props) {\n if (props.elements && props.elements.length >= 1) {\n const viewsiteId = props.viewsiteId;\n const viewpageId = props.viewpageId;\n const userTables = props.userTables;\n\n return props.elements.map((element, index) => {\n const _id = element._id;\n\n if (element.kind === \"text\") {\n // For Text Elements\n return (\n <li key={_id} id={_id + \",\" + viewpageId + \",\" + viewsiteId}>\n <TextElement\n viewsiteId={viewsiteId}\n viewpageId={viewpageId}\n element={element}\n onEditElement={props.onEditElement}\n onDeleteElement={props.onDeleteElement}/>\n </li>\n );\n }\n else if (element.kind === \"header\") {\n // For Text Elements\n return (\n <li key={_id} id={_id + \",\" + viewpageId + \",\" + viewsiteId}>\n <HeaderElement\n key={_id}\n viewsiteId={viewsiteId}\n viewpageId={viewpageId}\n element={element}\n onEditElement={props.onEditElement}\n onDeleteElement={props.onDeleteElement}/>\n </li>\n );\n }\n else if (element.kind === \"form\") {\n // For Form Elements\n return (\n <li key={_id} id={_id + \",\" + viewpageId + \",\" + viewsiteId}>\n <FormElement\n viewsiteId={viewsiteId}\n viewpageId={viewpageId}\n element={element}\n onEditElement={props.onEditElement}\n onDeleteElement={props.onDeleteElement}\n onSetGlobalState={props.onSetGlobalState}/>\n </li>\n );\n }\n else if (element.kind === \"dataView\") {\n // For Data View Elements\n return (\n <li key={_id} id={_id + \",\" + viewpageId + \",\" + viewsiteId}>\n <DataViewElement\n viewsiteId={viewsiteId}\n viewpageId={viewpageId}\n element={element}\n userTables={userTables}\n onEditElement={props.onEditElement}\n onDeleteElement={props.onDeleteElement}/>\n </li>\n );\n } else if (element.kind === \"image\") {\n // For Image Elements\n return (\n <li key={_id} id={_id + \",\" + viewpageId + \",\" + viewsiteId}>\n <ImageElement\n viewsiteId={viewsiteId}\n viewpageId={viewpageId}\n element={element}\n onEditElement={props.onEditElement}\n onDeleteElement={props.onDeleteElement}/>\n </li>\n );\n }\n });\n } else {\n return (\n <p>No Webpage Elements have been created yet!</p>\n );\n }\n}", "function elementCreator( type, id, className, value ){\n\t\t//Create element with it's class attribute, id and type\n\t\tvar button = addElement(type, className, id);\n\t\tif(value){\n\t\t\tbutton.innerHTML = value;\n\t\t}\n\t\treturn button;\n\t}", "function inputElGenerator(type , value){\n var inputElement = document.createElement('input')\n inputElement.setAttribute('type' , type)\n inputElement.setAttribute('value' , value)\n return inputElement\n}", "function $createElement(objType) {\r\n\t\treturn $(document.createElement(objType));\r\n\t}", "function createElement(elementType, classNames = '', attributes = {}, innerHTML = '') {\n const elementObject = document.createElement(elementType);\n if (classNames) elementObject.classList.add(...(classNames.split(' ')));\n Object.keys(attributes).forEach((attribute) => {\n elementObject.setAttribute(attribute, attributes[attribute]);\n });\n elementObject.innerHTML = innerHTML;\n return elementObject;\n}", "function getElement(type, className)\n{\n var div = document.createElement(type);\n if (className) div.setAttribute(\"class\", className);\n return div\n}", "function buildElement(elementType, options) {\n if (!Element.prototype.toggleClass) {\n addClassToggleToElements();\n }\n\n var newElement = document.createElement(elementType); // if (typeof options !== \"object\" || options instanceof Array)\n // return undefined;\n\n var classes = getNestedProperty(options, \"classes\", false);\n var attributes = getNestedProperty(options, \"attributes\", false);\n var id = getNestedProperty(options, \"id\", false);\n\n if (classes.length) {\n classes.forEach(function(c) {\n return newElement.toggleClass(c);\n });\n }\n\n if (attributes.length) {\n attributes.forEach(function(a) {\n return newElement.toggleClass(a);\n });\n }\n\n if (id) {\n newElement.id = id;\n }\n\n return newElement;\n }", "function createElement (type, props, ...children) {\n if (props.class) {\n processClasses(props.class)\n }\n return createDOMElement(type, props, ...children)\n}", "function getResolvedJsxType(node, elemType, elemClassType) {\n if (!elemType) {\n elemType = checkExpression(node.tagName);\n }\n if (elemType.flags & 524288 /* Union */) {\n var types = elemType.types;\n return getUnionType(types.map(function (type) {\n return getResolvedJsxType(node, type, elemClassType);\n }), /*subtypeReduction*/ true);\n }\n // If the elemType is a string type, we have to return anyType to prevent an error downstream as we will try to find construct or call signature of the type\n if (elemType.flags & 2 /* String */) {\n return anyType;\n }\n else if (elemType.flags & 32 /* StringLiteral */) {\n // If the elemType is a stringLiteral type, we can then provide a check to make sure that the string literal type is one of the Jsx intrinsic element type\n var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements);\n if (intrinsicElementsType !== unknownType) {\n var stringLiteralTypeName = elemType.text;\n var intrinsicProp = getPropertyOfType(intrinsicElementsType, stringLiteralTypeName);\n if (intrinsicProp) {\n return getTypeOfSymbol(intrinsicProp);\n }\n var indexSignatureType = getIndexTypeOfType(intrinsicElementsType, 0 /* String */);\n if (indexSignatureType) {\n return indexSignatureType;\n }\n error(node, ts.Diagnostics.Property_0_does_not_exist_on_type_1, stringLiteralTypeName, \"JSX.\" + JsxNames.IntrinsicElements);\n }\n // If we need to report an error, we already done so here. So just return any to prevent any more error downstream\n return anyType;\n }\n // Get the element instance type (the result of newing or invoking this tag)\n var elemInstanceType = getJsxElementInstanceType(node, elemType);\n if (!elemClassType || !isTypeAssignableTo(elemInstanceType, elemClassType)) {\n // Is this is a stateless function component? See if its single signature's return type is\n // assignable to the JSX Element Type\n if (jsxElementType) {\n var callSignatures = elemType && getSignaturesOfType(elemType, 0 /* Call */);\n var callSignature = callSignatures && callSignatures.length > 0 && callSignatures[0];\n var callReturnType = callSignature && getReturnTypeOfSignature(callSignature);\n var paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0]));\n if (callReturnType && isTypeAssignableTo(callReturnType, jsxElementType)) {\n // Intersect in JSX.IntrinsicAttributes if it exists\n var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes);\n if (intrinsicAttributes !== unknownType) {\n paramType = intersectTypes(intrinsicAttributes, paramType);\n }\n return paramType;\n }\n }\n }\n // Issue an error if this return type isn't assignable to JSX.ElementClass\n if (elemClassType) {\n checkTypeRelatedTo(elemInstanceType, elemClassType, assignableRelation, node, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements);\n }\n if (isTypeAny(elemInstanceType)) {\n return elemInstanceType;\n }\n var propsName = getJsxElementPropertiesName();\n if (propsName === undefined) {\n // There is no type ElementAttributesProperty, return 'any'\n return anyType;\n }\n else if (propsName === \"\") {\n // If there is no e.g. 'props' member in ElementAttributesProperty, use the element class type instead\n return elemInstanceType;\n }\n else {\n var attributesType = getTypeOfPropertyOfType(elemInstanceType, propsName);\n if (!attributesType) {\n // There is no property named 'props' on this instance type\n return emptyObjectType;\n }\n else if (isTypeAny(attributesType) || (attributesType === unknownType)) {\n // Props is of type 'any' or unknown\n return attributesType;\n }\n else if (attributesType.flags & 524288 /* Union */) {\n // Props cannot be a union type\n error(node.tagName, ts.Diagnostics.JSX_element_attributes_type_0_may_not_be_a_union_type, typeToString(attributesType));\n return anyType;\n }\n else {\n // Normal case -- add in IntrinsicClassElements<T> and IntrinsicElements\n var apparentAttributesType = attributesType;\n var intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes);\n if (intrinsicClassAttribs !== unknownType) {\n var typeParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(intrinsicClassAttribs.symbol);\n if (typeParams) {\n if (typeParams.length === 1) {\n apparentAttributesType = intersectTypes(createTypeReference(intrinsicClassAttribs, [elemInstanceType]), apparentAttributesType);\n }\n }\n else {\n apparentAttributesType = intersectTypes(attributesType, intrinsicClassAttribs);\n }\n }\n var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes);\n if (intrinsicAttribs !== unknownType) {\n apparentAttributesType = intersectTypes(intrinsicAttribs, apparentAttributesType);\n }\n return apparentAttributesType;\n }\n }\n }", "getElementsByType(type) {\n if (!this[$elementsByType].has(type)) {\n return [];\n }\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return Array.from(this[$elementsByType].get(type));\n }", "tagFor(type) {\n return elementTagsByType.get(type);\n }", "function ComponentType(){}", "function Hello({ color, name }) {\r\n return <div style={{ color: color }}>Hello {name}</div>;\r\n // needs to return only 1 component, usually covered in div tag\r\n\r\n // <div>{a}</div>\r\n // this returns a, a javascript element defined.\r\n}", "static toEl(x) {\n if (x instanceof Function) {\n x = x();\n }\n if (!(x instanceof Element)) {\n x = Element.Scalar(x);\n }\n return x;\n }", "betterCreateElement(type, moreFlags) {\n\n let el = document.createElement(type);\n\n if (type.substring(0, \"functionResult\".length) == \"functionResult\") {\n el.appendChild(window[type.split(\"-\")[1]]());\n }\n\n if (!isNullOrUndefined(moreFlags)) {\n\n for (let i = 0; i < moreFlags.length; i++) {\n\n let keyname = moreFlags[i][0];\n let content = moreFlags[i][1];\n\n // special flag used to register an element to dynamic resizyng\n if (keyname == \"$responsive\") {\n this.elementsRegisteredForDynamicResize.push(el);\n el.setAttribute('responsive', content);\n }\n // standard flags\n else {\n // you can init a flag with a '$_' to call a function named as\n // the rest of the string e.g: $foo will call foo() and init content with the\n // returned value\n if (content.substring(0, \"$\".length) == \"$\") {\n try {\n content = window[content.substring(\"$\".length)]();\n } catch (e) {\n content = \"\";\n }\n }\n\n if (keyname.substring(0, 2) != \"on\") {\n el[keyname] = content;\n } else {\n el.setAttribute(keyname, content);\n }\n }\n }\n }\n\n return el;\n }", "function wrapElement(element) {\n return props => React.createElement(element, filterProps(props));\n}", "getHTMLElement() {\n if (this.type === TEXT) {\n return this.createHTMLText();\n }\n else if (this.type === IMAGE) {\n return this.createHTMLImage();\n }\n else if (this.type === VIDEO) {\n return this.createHTMLVideo();\n }\n else {\n console.error(\"This is not a correct element\");\n }\n }", "function createElements() {\n var nodeNames = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n nodeNames[_i] = arguments[_i];\n }\n return nodeNames.map(function (name) { return document.createElement(name); });\n }", "function _createElement(type, className) {\n const el = document.createElement(type);\n\n if (className) {\n el.className = className;\n }\n return el;\n}", "function ComponentType() {}", "function elementType() {\n var node = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n var name = node.name;\n\n\n if (!name) {\n throw new Error('The argument provided is not a JSXElement node.');\n }\n\n if (name.type === 'JSXMemberExpression') {\n var object = name.object;\n var property = name.property;\n\n return object.name + '.' + property.name;\n } else if (name.type === 'JSXNamespacedName') {\n return name.namespace.name + ':' + name.name.name;\n }\n\n return node.name.name;\n}", "createDOMElement(type, content = '', className = '') {\n let element = document.createElement(type);\n if (className) {\n element.setAttribute('class', className);\n }\n element.innerHTML = content;\n return element;\n }", "function create_ui_element(type, id, classes) {\n\tvar new_elt = $(document.createElement(type));\n\tnew_elt.attr(\"id\", id);\n\tnew_elt.addClass(classes);\n\treturn new_elt;\n}", "getMatchingElementTemplate() {\n const tagName = this.element || 'div';\n const classAttr = this.classNames.length > 0 ? ` class=\"${this.classNames.join(' ')}\"` : '';\n let attrs = '';\n for (let i = 0; i < this.attrs.length; i += 2) {\n const attrName = this.attrs[i];\n const attrValue = this.attrs[i + 1] !== '' ? `=\"${this.attrs[i + 1]}\"` : '';\n attrs += ` ${attrName}${attrValue}`;\n }\n return getHtmlTagDefinition(tagName).isVoid ? `<${tagName}${classAttr}${attrs}/>` :\n `<${tagName}${classAttr}${attrs}></${tagName}>`;\n }", "getMatchingElementTemplate() {\n const tagName = this.element || 'div';\n const classAttr = this.classNames.length > 0 ? ` class=\"${this.classNames.join(' ')}\"` : '';\n let attrs = '';\n for (let i = 0; i < this.attrs.length; i += 2) {\n const attrName = this.attrs[i];\n const attrValue = this.attrs[i + 1] !== '' ? `=\"${this.attrs[i + 1]}\"` : '';\n attrs += ` ${attrName}${attrValue}`;\n }\n return getHtmlTagDefinition(tagName).isVoid ? `<${tagName}${classAttr}${attrs}/>` :\n `<${tagName}${classAttr}${attrs}></${tagName}>`;\n }", "getMatchingElementTemplate() {\n const tagName = this.element || 'div';\n const classAttr = this.classNames.length > 0 ? ` class=\"${this.classNames.join(' ')}\"` : '';\n let attrs = '';\n for (let i = 0; i < this.attrs.length; i += 2) {\n const attrName = this.attrs[i];\n const attrValue = this.attrs[i + 1] !== '' ? `=\"${this.attrs[i + 1]}\"` : '';\n attrs += ` ${attrName}${attrValue}`;\n }\n return getHtmlTagDefinition(tagName).isVoid ? `<${tagName}${classAttr}${attrs}/>` :\n `<${tagName}${classAttr}${attrs}></${tagName}>`;\n }", "getMatchingElementTemplate() {\n const tagName = this.element || 'div';\n const classAttr = this.classNames.length > 0 ? ` class=\"${this.classNames.join(' ')}\"` : '';\n let attrs = '';\n for (let i = 0; i < this.attrs.length; i += 2) {\n const attrName = this.attrs[i];\n const attrValue = this.attrs[i + 1] !== '' ? `=\"${this.attrs[i + 1]}\"` : '';\n attrs += ` ${attrName}${attrValue}`;\n }\n return getHtmlTagDefinition(tagName).isVoid ? `<${tagName}${classAttr}${attrs}/>` :\n `<${tagName}${classAttr}${attrs}></${tagName}>`;\n }", "function findRenderedComponent(componentTypes) {\n const component = TestUtils.findRenderedComponentWithType(\n componentTypes[0],\n componentTypes[1]\n );\n\n return componentTypes.length === 2\n ? component\n : findRenderedComponent([].concat(component, componentTypes.slice(2)));\n}", "function createReactElement(component) {\n\treturn {\n\t\ttype: component.constructor,\n\t\tkey: component.key,\n\t\tref: null, // Unsupported\n\t\tprops: component.props\n\t};\n}", "function buildElement(elementType, classes, id, htmlContent) {\n let element = document.createElement(elementType);\n element.className = classes;\n element.id = id;\n element.innerHTML = htmlContent;\n return element;\n}", "function CreateHTMLElement(type, id, value, appendTo, cssStyle, attributeList) {\n var _type = document.createElement(type);\n _type.id = id;\n _type.style = cssStyle;\n if (value) _type.innerText = value;\n \n for (var key in attributeList) {\n _type.setAttribute(key, attributeList[key]);\n }\n appendTo.appendChild(_type);\n return _type;\n}", "function getElement(e, type){\n\t\tif(e.tagName && e.tagName == type){\n\t\t\tvar el = $(e);\n\t\t}else{\n\t\t\te.stop();\n\t\t\tvar el = e.findElement(type);\n\t\t}\n\t\treturn el;\n\t}", "function render(element) {\n return {\n test: function(testFunc){\n return function(){\n testFunc(jsxTemplating.render(element));\n };\n\t}\n };\n }", "getElements(Element){\n let curTableEntries = store.getState().tableEntries\n let elements = []\n let renderCategories;\n\n const arr24 = [...Array(24)] //a temporary 24-slot array for the 24 slots per category\n // create a 2D array of the edits that contains JSX elements\n renderCategories = categories.map(category => (\n arr24.map((date, i) => {\n const flattenedKey = [this.props.yr, i, category].join(\", \")\n const value = curTableEntries[flattenedKey] || ''\n return (<Element key={[this.props.yr, i, category].join(\"_\")}\n position={{i, category, year: this.props.yr}}\n clicked={this.clicked}\n content={value}/>)\n })\n ))\n // convert the renderCategories 2D array into a renderable 1D mapping array (with div wrappers)\n for(let i = 0; i < categories.length; i++){\n elements.push((\n <div className={categories[i]}>\n <TrackVisibility>\n <TableLabel label={categories[i]}/>\n </TrackVisibility>\n <div className=\"info\">\n {renderCategories[i]}\n </div>\n </div>\n ))\n }\n return elements\n }", "create(...t) {\n let s = new r;\n for (const r of t) if (\"string\" == typeof r) s.push(document.createElement(r)); else if (r instanceof Object) {\n const t = document.createElement(r.tagName || \"div\");\n r.content && (Array.isArray(r.content) ? e$1(t, ...r.content) : e$1(t, r.content)), \n s.push(t);\n }\n return s;\n }", "function renderDropDownType(types) {\n let formElement = document.getElementsByClassName(\"filters\")[0];\n\n let selectElement = document.createElement(\"select\");\n selectElement.setAttribute(\"name\", \"select-type\");\n selectElement.classList.add(\"filterElement\");\n let defaultElement = document.createElement(\"option\");\n defaultElement.setAttribute(\"value\", \"\");\n defaultElement.innerHTML = \"All Event Types\";\n selectElement.appendChild(defaultElement);\n Object.keys(types).sort().forEach(slug => {\n let optionElement = document.createElement(\"option\");\n optionElement.setAttribute(\"value\", slug);\n optionElement.innerHTML = types[slug];\n selectElement.appendChild(optionElement);\n });\n formElement.appendChild(selectElement);\n}", "function generateTypeSelector(allType, types) {\n var resultDiv = doc.createElement(\"div\");\n\n resultDiv.appendChild(doc.createTextNode(\"Select type: \"));\n\n var dropdown = doc.createElement(\"select\");\n\n dropdown.appendChild(optionElement(\"All types\", \"null\"));\n\n for (var uri in types) {\n dropdown.appendChild(optionElement(types[uri].getLabel(), uri));\n }\n\n dropdown.addEventListener(\"click\", function() {\n var type;\n\n if (dropdown.value == \"null\") {\n type = allType;\n } else {\n type = types[dropdown.value];\n }\n\n typeSelectorChanged(type);\n }, false);\n\n resultDiv.appendChild(dropdown);\n\n return resultDiv;\n }", "createElement(type, props = {}, children) {\r\n return {\r\n type,\r\n props: children ? { ...props, children } : props\r\n };\r\n }", "function createInputPseudo(type) {\n return function(elem) {\n var name = elem.nodeName.toLowerCase();\n return name === \"input\" && elem.type === type;\n };\n }", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function Button(){\n return <button>test</button>\n}", "function eateryElements(cuisine, onChange, eateryUrl, searchUrl) {\n return [\n <form key=\"select\">\n <label htmlFor=\"cuisine\">Choose cuisine</label>\n <select id=\"cuisine\" onChange={onChange} value={cuisine}>\n <option value=''>Select</option>\n <option>American</option>\n <option>Chinese</option>\n <option>Indian</option>\n <option>Mexican</option>\n </select>\n </form>,\n\n <div key=\"results\" id=\"results\">\n <eatery-results url={searchUrl} >\n </eatery-results>\n <eatery-details eatery-url={eateryUrl}>\n </eatery-details>\n </div>\n ];\n}", "function isElementOfType(element, Component) {\n var _element$props;\n\n if (element == null || ! /*#__PURE__*/Object(react__WEBPACK_IMPORTED_MODULE_0__[\"isValidElement\"])(element) || typeof element.type === 'string') {\n return false;\n }\n\n const {\n type: defaultType\n } = element; // Type override allows components to bypass default wrapping behavior. Ex: Stack, ResourceList...\n // See https://github.com/Shopify/app-extension-libs/issues/996#issuecomment-710437088\n\n const overrideType = (_element$props = element.props) == null ? void 0 : _element$props.__type__;\n const type = overrideType || defaultType;\n const Components = Array.isArray(Component) ? Component : [Component];\n return Components.some(AComponent => typeof type !== 'string' && isComponent(AComponent, type));\n} // Returns all children that are valid elements as an array. Can optionally be", "tagMaker() {\n const isHtmlNode = () => {\n return true;\n };\n const isAttribMap = () => {\n return true;\n };\n var notEmpty = (x) => {\n if ((typeof x === 'undefined') ||\n (x === null) ||\n x.length === 0) {\n return false;\n }\n return true;\n };\n var maker = (name, defaultAttribs = {}) => {\n var tagFun= (attribs, children) => {\n let node = '<';\n\n // case 1. one argument, first may be attribs or content, but attribs if object.\n if (typeof children === 'undefined') {\n if (typeof attribs === 'object' &&\n ! (attribs instanceof Array) &&\n isAttribMap(attribs)) {\n if (Object.keys(attribs).length === 0) {\n node += name;\n } else {\n const tagAttribs = this.attribsToString(this.mergeAttribs(attribs, defaultAttribs));\n node += [name, tagAttribs].filter(notEmpty).join(' ');\n }\n node += '>';\n // case 2. arity 1, is undefined\n } else if (typeof attribs === 'undefined') {\n const tagAttribs = this.attribsToString(defaultAttribs);\n node += [name, tagAttribs].filter(notEmpty).join(' ');\n node += '>';\n // case 3: arity 1, is content\n } else if (isHtmlNode(attribs)) {\n const tagAttribs = this.attribsToString(defaultAttribs);\n node += [name, tagAttribs].filter(notEmpty).join(' ');\n node += '>' + this.renderChildren(attribs);\n }\n // case 4. arity 2 - atribs + content\n } else if (isAttribMap(attribs) && isHtmlNode(children)) {\n if (Object.keys(attribs).length === 0) {\n node += name;\n } else {\n const tagAttribs = this.attribsToString(this.mergeAttribs(attribs, defaultAttribs));\n node += [name, tagAttribs].filter(notEmpty).join(' ');\n }\n node += '>' + this.renderChildren(children);\n }\n node += '</' + name + '>';\n return node;\n };\n return tagFun;\n };\n return maker;\n }", "render() { //render method that returns the DOM representation our component\n return ( // jeśli wyrzucimy nawias i w tej samej linii damy kod z kolejnej (tutaj <div>), będzie OK\n <div>\n <h1>Hello Series</h1>\n <b>Bold</b>\n </div>\n )\n // return React.createElement('h1', null, 'Hello Eggheads'); //\n }", "function makeNode (type = 'div') {\n return document.createElement(type)\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}" ]
[ "0.688169", "0.6599771", "0.6501903", "0.6501903", "0.6501903", "0.6501903", "0.6501903", "0.6501903", "0.6501903", "0.6501903", "0.6501903", "0.62633073", "0.6178194", "0.5946246", "0.59189516", "0.58819187", "0.5864861", "0.5778515", "0.5640179", "0.563297", "0.5620519", "0.56056386", "0.5598519", "0.5596583", "0.55956185", "0.55719036", "0.55680776", "0.5538119", "0.55316997", "0.54845214", "0.5469879", "0.5457287", "0.5451623", "0.54477245", "0.5434567", "0.5421531", "0.5382871", "0.5370547", "0.5332535", "0.5331984", "0.5317247", "0.53034574", "0.52601075", "0.52598643", "0.5256893", "0.5256144", "0.525179", "0.5236022", "0.52352464", "0.52312756", "0.52230155", "0.5205535", "0.5203975", "0.5190018", "0.5171703", "0.51414955", "0.51125515", "0.51109946", "0.51109946", "0.51109946", "0.51109946", "0.5096873", "0.50925475", "0.5086133", "0.505592", "0.5050017", "0.5040676", "0.502171", "0.50170624", "0.5014584", "0.50132847", "0.5012763", "0.500863", "0.50030285", "0.50030285", "0.50030285", "0.50030285", "0.50030285", "0.5001243", "0.49894577", "0.49746597", "0.49566805", "0.4952157", "0.495144", "0.4951086", "0.4951086", "0.4951086", "0.4951086", "0.4951086", "0.4951086", "0.4951086", "0.4951086", "0.4951086", "0.4951086", "0.4951086", "0.4951086", "0.4951086", "0.4951086", "0.4951086", "0.4951086", "0.4951086" ]
0.0
-1
Clone and return a new ReactElement using element as the starting point. See
function cloneElement(element, config, children) { !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0; var propName = void 0; // Original props are copied var props = _assign({}, element.props); // Reserved names are extracted var key = element.key; var ref = element.ref; // Self is preserved since the owner is preserved. var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a // transpiler, and the original source is probably a better indicator of the // true owner. var source = element._source; // Owner will be preserved, unless ref is overridden var owner = element._owner; if (config != null) { if (hasValidRef(config)) { // Silently steal the ref from the parent. ref = config.ref; owner = ReactCurrentOwner.current; } if (hasValidKey(config)) { key = '' + config.key; } // Remaining properties override existing props var defaultProps = void 0; if (element.type && element.type.defaultProps) { defaultProps = element.type.defaultProps; } for (propName in config) { if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { if (config[propName] === undefined && defaultProps !== undefined) { // Resolve default props props[propName] = defaultProps[propName]; } else { props[propName] = config[propName]; } } } } // Children can be more than one argument, and those are transferred onto // the newly allocated props object. var childrenLength = arguments.length - 2; if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 2]; } props.children = childArray; } return ReactElement(element.type, key, ref, self, source, owner, props); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cloneElement(element,config,children){if(!!(element===null||element===undefined)){{throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \"+element+\".\");}}var propName;// Original props are copied\nvar props=_assign({},element.props);// Reserved names are extracted\nvar key=element.key;var ref=element.ref;// Self is preserved since the owner is preserved.\nvar self=element._self;// Source is preserved since cloneElement is unlikely to be targeted by a\n// transpiler, and the original source is probably a better indicator of the\n// true owner.\nvar source=element._source;// Owner will be preserved, unless ref is overridden\nvar owner=element._owner;if(config!=null){if(hasValidRef(config)){// Silently steal the ref from the parent.\nref=config.ref;owner=ReactCurrentOwner.current;}if(hasValidKey(config)){key=''+config.key;}// Remaining properties override existing props\nvar defaultProps;if(element.type&&element.type.defaultProps){defaultProps=element.type.defaultProps;}for(propName in config){if(hasOwnProperty.call(config,propName)&&!RESERVED_PROPS.hasOwnProperty(propName)){if(config[propName]===undefined&&defaultProps!==undefined){// Resolve default props\nprops[propName]=defaultProps[propName];}else {props[propName]=config[propName];}}}}// Children can be more than one argument, and those are transferred onto\n// the newly allocated props object.\nvar childrenLength=arguments.length-2;if(childrenLength===1){props.children=children;}else if(childrenLength>1){var childArray=Array(childrenLength);for(var i=0;i<childrenLength;i++){childArray[i]=arguments[i+2];}props.children=childArray;}return ReactElement(element.type,key,ref,self,source,owner,props);}", "function cloneElement(element,config,children){!!(element===null||element===undefined)?invariant(false,'React.cloneElement(...): The argument must be a React element, but you passed %s.',element):void 0;var propName=void 0;// Original props are copied\nvar props=_assign({},element.props);// Reserved names are extracted\nvar key=element.key;var ref=element.ref;// Self is preserved since the owner is preserved.\nvar self=element._self;// Source is preserved since cloneElement is unlikely to be targeted by a\n// transpiler, and the original source is probably a better indicator of the\n// true owner.\nvar source=element._source;// Owner will be preserved, unless ref is overridden\nvar owner=element._owner;if(config!=null){if(hasValidRef(config)){// Silently steal the ref from the parent.\nref=config.ref;owner=ReactCurrentOwner.current;}if(hasValidKey(config)){key=''+config.key;}// Remaining properties override existing props\nvar defaultProps=void 0;if(element.type&&element.type.defaultProps){defaultProps=element.type.defaultProps;}for(propName in config){if(hasOwnProperty.call(config,propName)&&!RESERVED_PROPS.hasOwnProperty(propName)){if(config[propName]===undefined&&defaultProps!==undefined){// Resolve default props\nprops[propName]=defaultProps[propName];}else{props[propName]=config[propName];}}}}// Children can be more than one argument, and those are transferred onto\n// the newly allocated props object.\nvar childrenLength=arguments.length-2;if(childrenLength===1){props.children=children;}else if(childrenLength>1){var childArray=Array(childrenLength);for(var i=0;i<childrenLength;i++){childArray[i]=arguments[i+2];}props.children=childArray;}return ReactElement(element.type,key,ref,self,source,owner,props);}", "function cloneElement(element, config, children) {\n (function () {\n if (!!(element === null || element === undefined)) {\n {\n throw ReactError(Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\"));\n }\n }\n })();\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n (function () {\n if (!!(element === null || element === undefined)) {\n {\n throw ReactError(Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\"));\n }\n }\n })();\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n (function () {\n if (!!(element === null || element === undefined)) {\n {\n throw ReactError(Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\"));\n }\n }\n })();\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "function cloneElement(element, config, children) {\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error( \"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\" );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\n 'React.cloneElement(...): The argument must be a React element, but you passed ' +\n element +\n '.',\n );\n }\n }\n\n var propName; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (\n hasOwnProperty.call(config, propName) &&\n !RESERVED_PROPS.hasOwnProperty(propName)\n ) {\n if (\n config[propName] === undefined &&\n defaultProps !== undefined\n ) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(\n element.type,\n key,\n ref,\n self,\n source,\n owner,\n props,\n );\n }", "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;\n var propName = void 0; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps = void 0;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;\n var propName = void 0; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps = void 0;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;\n var propName = void 0; // Original props are copied\n\n var props = _assign({}, element.props); // Reserved names are extracted\n\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps = void 0;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "function cloneElement(element, config, children) {\n if (element === null || element === undefined) {\n throw new Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n\n var propName; // Original props are copied\n\n var props = assign({}, element.props); // Reserved names are extracted\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n if (!!(element === null || element === undefined)) {\n {\n throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n }\n var propName;\n // Original props are copied\n var props = _assign({}, element.props);\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n // Remaining properties override existing props\n var defaultProps;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "function cloneElement(element, config, children) {\n (function () {\n if (!!(element === null || element === undefined)) {\n {\n throw ReactError(Error('React.cloneElement(...): The argument must be a React element, but you passed ' + element + '.'));\n }\n }\n })();\n\n var propName = void 0;\n\n // Original props are copied\n var props = _assign({}, element.props);\n\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n // Remaining properties override existing props\n var defaultProps = void 0;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "function cloneElement(element, config, children) {\n (function () {\n if (!!(element === null || element === undefined)) {\n {\n throw ReactError(Error('React.cloneElement(...): The argument must be a React element, but you passed ' + element + '.'));\n }\n }\n })();\n\n var propName = void 0;\n\n // Original props are copied\n var props = _assign({}, element.props);\n\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n // Remaining properties override existing props\n var defaultProps = void 0;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n (function () {\n if (!!(element === null || element === undefined)) {\n {\n throw ReactError(Error('React.cloneElement(...): The argument must be a React element, but you passed ' + element + '.'));\n }\n }\n })();\n\n var propName = void 0;\n\n // Original props are copied\n var props = _assign({}, element.props);\n\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n // Remaining properties override existing props\n var defaultProps = void 0;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n (function () {\n if (!!(element === null || element === undefined)) {\n {\n throw ReactError(Error('React.cloneElement(...): The argument must be a React element, but you passed ' + element + '.'));\n }\n }\n })();\n\n var propName = void 0;\n\n // Original props are copied\n var props = _assign({}, element.props);\n\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n // Remaining properties override existing props\n var defaultProps = void 0;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n (function () {\n if (!!(element === null || element === undefined)) {\n {\n throw ReactError(Error('React.cloneElement(...): The argument must be a React element, but you passed ' + element + '.'));\n }\n }\n })();\n\n var propName = void 0;\n\n // Original props are copied\n var props = _assign({}, element.props);\n\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n // Remaining properties override existing props\n var defaultProps = void 0;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}", "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : undefined;\n\n var propName = undefined;\n\n // Original props are copied\n var props = _assign({}, element.props);\n\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n // Remaining properties override existing props\n var defaultProps = undefined;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "function cloneElement(element, config, children) {\n var propName;\n\n // Original props are copied\n var props = _assign({}, element.props);\n\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n // Remaining properties override existing props\n var defaultProps;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "function cloneElement(element, config, children) {\n var propName;\n\n // Original props are copied\n var props = _assign({}, element.props);\n\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n // Remaining properties override existing props\n var defaultProps;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "function cloneElement(element, config, children) {\n var propName;\n\n // Original props are copied\n var props = _assign({}, element.props);\n\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n // Remaining properties override existing props\n var defaultProps;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "function cloneElement(element, config, children) {\n var propName;\n\n // Original props are copied\n var props = _assign({}, element.props);\n\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n // Remaining properties override existing props\n var defaultProps;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "function cloneElement(element, props) {\n if (props.style && element.props.style) {\n props.style = _objectSpread({}, element.props.style, {}, props.style);\n }\n\n if (props.className && element.props.className) {\n props.className = element.props.className + \" \" + props.className;\n }\n\n return _react.default.cloneElement(element, props);\n}", "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;\n\n var propName = void 0;\n\n // Original props are copied\n var props = _assign({}, element.props);\n\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n // Remaining properties override existing props\n var defaultProps = void 0;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;\n\n var propName = void 0;\n\n // Original props are copied\n var props = _assign({}, element.props);\n\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n // Remaining properties override existing props\n var defaultProps = void 0;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }", "function cloneElement(element, config, children) {\n !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;\n\n var propName = void 0;\n\n // Original props are copied\n var props = _assign({}, element.props);\n\n // Reserved names are extracted\n var key = element.key;\n var ref = element.ref;\n // Self is preserved since the owner is preserved.\n var self = element._self;\n // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n var source = element._source;\n\n // Owner will be preserved, unless ref is overridden\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n // Remaining properties override existing props\n var defaultProps = void 0;\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n }" ]
[ "0.6915557", "0.6893059", "0.66959214", "0.66959214", "0.66947424", "0.66482466", "0.66482466", "0.66482466", "0.66482466", "0.66482466", "0.66482466", "0.66482466", "0.66482466", "0.66482466", "0.66482466", "0.66482466", "0.66482466", "0.66482466", "0.6635265", "0.66155624", "0.66155624", "0.66155624", "0.66155624", "0.66155624", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6613287", "0.6610466", "0.6597473", "0.6597473", "0.6597473", "0.65873164", "0.6583712", "0.6545793", "0.6542383", "0.6542383", "0.6542383", "0.6542383", "0.6533253", "0.65271676", "0.65271676", "0.65271676", "0.65271676", "0.65235364", "0.65204567", "0.65204567", "0.65204567" ]
0.0
-1
Flatten a children object (typically specified as `props.children`) and return an array with appropriately rekeyed children. See
function toArray(children) { var result = []; mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toArrayChildren(children) {\n var ret = [];\n React__default.Children.forEach(children, function (child) {\n ret.push(child);\n });\n return ret;\n }", "function toArray(children){var result=[];mapIntoWithKeyPrefixInternal(children,result,null,function(child){return child;});return result;}", "function toArray(children){return mapChildren(children,function(child){return child;})||[];}", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n }", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n }", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n }", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n }", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n }", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n }", "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);\n return result;\n }", "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);\n return result;\n }", "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);\n return result;\n }", "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);\n return result;\n }", "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);\n return result;\n }", "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);\n return result;\n }", "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);\n return result;\n }", "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);\n return result;\n }", "function toArray(children){var result=[];mapIntoWithKeyPrefixInternal(children,result,null,emptyFunction.thatReturnsArgument);return result;}", "function toArray(children){var result=[];mapIntoWithKeyPrefixInternal(children,result,null,emptyFunction.thatReturnsArgument);return result;}", "function toArray(children){var result=[];mapIntoWithKeyPrefixInternal(children,result,null,emptyFunction.thatReturnsArgument);return result;}", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function(\n child,\n ) {\n return child;\n });\n return result;\n }", "function toArray(children) {\n return mapChildren(children, function(child) {\n return child;\n }) || [];\n }", "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);\n return result;\n }" ]
[ "0.775594", "0.7520282", "0.74348474", "0.7408082", "0.7408082", "0.7408082", "0.7408082", "0.7408082", "0.7408082", "0.74014795", "0.74014795", "0.74014795", "0.74014795", "0.74014795", "0.74014795", "0.74014795", "0.74014795", "0.74014795", "0.74014795", "0.74014795", "0.74014795", "0.74014795", "0.74014795", "0.74014795", "0.7397894", "0.7397894", "0.7397894", "0.7397894", "0.7397894", "0.7397894", "0.7397894", "0.7397894", "0.7397854", "0.7397854", "0.7397854", "0.73843", "0.73843", "0.73843", "0.73843", "0.73843", "0.73843", "0.73843", "0.73843", "0.73843", "0.73843", "0.73843", "0.73843", "0.73843", "0.73843", "0.73843", "0.73843", "0.73843", "0.73843", "0.73843", "0.73843", "0.73843", "0.73843", "0.73843", "0.73843", "0.73843", "0.73843", "0.73843", "0.73843", "0.7344583", "0.7308588", "0.730655" ]
0.0
-1
Starts all requests that do not exceed request limits This method is invoked whenever a new request has been queued or a running request finished
function startAllAllowedRequests() { for (let i = 0; i < waiting_tasks.length; i++) { if (canStartRequest(waiting_tasks[i].hostname)) { onRequestStart(waiting_tasks[i].hostname); waiting_tasks[i].start(); // remove request from waiting requests list and update loop index waiting_tasks.splice(i, 1); i--; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_issueNewRequestsAsync() {\n this._deferredUpdate = null;\n\n const freeSlots = Math.max(this.props.maxRequests - this.activeRequestCount, 0);\n\n if (freeSlots === 0) {\n return;\n }\n\n this._updateAllRequests();\n\n // Resolve pending promises for the top-priority requests\n for (let i = 0; i < freeSlots; ++i) {\n if (this.requestQueue.length > 0) {\n const request = this.requestQueue.shift();\n request.resolve(true);\n }\n }\n\n // Uncomment to debug\n // console.log(`${freeSlots} free slots, ${this.requestQueue.length} queued requests`);\n }", "function batchRequest(){\n // Use the lower value of items left in the link array or maxRequests\n var total = (linkArr.length-1 > maxRequests) ? maxRequests : linkArr.length-1;\n for(var i = 0; i<= total; i++) {\n qwest.get(endPoint+encodeURIComponent(linkArr[0]))\n .then(function(response) {\n apiActions.response({pageURL: response.url, report: response.data});\n })\n .catch(function(e, response) {\n console.log('>> Error: ', e, '\\nResponse: ', response);\n })\n // Remove the head from the array\n linkArr.shift();\n }\n\n // Batch request again if there's anything left in the array\n if(linkArr.length > 0) {\n setTimeout(function() {\n batchRequest();\n }, 30*1000);\n }\n}", "_issueNewRequestsAsync() {\n this._deferredUpdate = null;\n\n const freeSlots = Math.max(this.props.maxRequests - this.activeRequestCount, 0);\n\n if (freeSlots === 0) {\n return;\n }\n\n this._updateAllRequests();\n\n // Resolve pending promises for the top-priority requests\n for (let i = 0; i < freeSlots; ++i) {\n if (this.requestQueue.length > 0) {\n const request = this.requestQueue.shift();\n this._issueRequest(request);\n }\n }\n\n // Uncomment to debug\n // console.log(`${freeSlots} free slots, ${this.requestQueue.length} queued requests`);\n }", "_throttledRequestHandler() {\n if (!this._requests) {\n Strophe.debug('_throttledRequestHandler called with ' + 'undefined requests');\n } else {\n Strophe.debug('_throttledRequestHandler called with ' + this._requests.length + ' requests');\n }\n\n if (!this._requests || this._requests.length === 0) {\n return;\n }\n\n if (this._requests.length > 0) {\n this._processRequest(0);\n }\n\n if (this._requests.length > 1 && Math.abs(this._requests[0].rid - this._requests[1].rid) < this.window) {\n this._processRequest(1);\n }\n }", "onRequestStarted() {\n this.startedRequestCount++;\n\n const activeCount = this.activeRequestCount();\n log.verbose('NetworkRecorder', `Request started. ${activeCount} requests in progress` +\n ` (${this.startedRequestCount} started and ${this.finishedRequestCount} finished).`);\n\n // If only one request in progress, emit event that we've transitioned from\n // idle to busy.\n if (activeCount === 1) {\n this.emit('networkbusy');\n }\n }", "_issueNewRequestsAsync() {\n this._updateNeeded = false;\n\n const freeSlots = Math.max(this.props.maxRequests - this.activeRequestCount, 0);\n\n if (freeSlots === 0) {\n return;\n }\n\n this._updateAllRequests();\n\n // Resolve pending promises for the top-priority requests\n for (let i = 0; i < freeSlots; ++i) {\n if (this.requestQueue.length > 0) {\n const request = this.requestQueue.shift();\n request.resolve(true);\n }\n }\n\n // Uncomment to debug\n // console.log(`${freeSlots} free slots, ${this.requestQueue.length} queued requests`);\n }", "function startClients() {\n for (var i = 0; i < options.concurrency; i++) {\n\n makeRequest();\n\n }\n }", "async handleRequests() {\n if (this.isBusy) {\n return;\n }\n\n this.isBusy = true;\n while (!this.isCancelled && this.waitingRequests.length > 0) {\n const request = this.waitingRequests.shift();\n await this.handleRequest(request)\n .then(response =>\n this.send('REPLY', response))\n .catch(err => {\n let message;\n if (err instanceof RequestError) {\n // If it's a RequestError, it's an error triggered by the user\n message = err.message;\n } else {\n // Otherwise it's a server error that shouldn't have happened\n console.error(err);\n message = 'internal server error';\n }\n\n // Send the error message to the client\n this.send('ERROR', { message });\n\n // If it was an unauthorized request, inform the user that they are logged out\n if (err instanceof UnauthorizedError) {\n this.forceLogout();\n }\n });\n }\n this.isBusy = false;\n }", "async request() {\n if (this.isTest()) { console.log(\"in getAllCalls\"); }\n // GET first page (and number of pages)\n await this.getCallsPage();\n \n if (this.isTest()) { console.log(`getLastPage = ` + this.getLastPage()); }\n // GET the remaining pages\n for (let pageNum = 2; pageNum <= this.getLastPage(); pageNum++) {\n await Util.throttle(this.#config.throttle);\n await this.getCallsPage(pageNum);\n }\n }", "_startRequest() {\n if (this._timeoutID !== undefined)\n clearTimeout(this._timeoutID);\n \n this._makeRequest()\n .then(({ request }) => {\n if (!this.isStarted)\n return;\n \n let delay = this._defaultTimeout;\n \n // Read ResponseHeader\n let cacheControl = request.getResponseHeader('Cache-Control');\n if (cacheControl !== null) {\n let maxAges = /(^|,)max-age=([0-9]+)($|,)/.exec(cacheControl);\n if (maxAges !== null &&\n maxAges[2] > 0)\n delay = Math.round(maxAges[2]*1000);\n }\n \n this.trigger('success:request', { request });\n \n if (delay !== undefined)\n this._planRequest({ delay });\n }, ({ request } = {}) => {\n if (!this.isStarted)\n return;\n \n if (request === undefined)\n return;\n \n this.trigger('error:request', { request });\n \n if (this._timeoutOnError !== undefined)\n this._planRequest({ delay: this._timeoutOnError });\n });\n }", "startRequest(handle) {\n this.activeRequestCount++;\n }", "startRequest(handle) {\n this.activeRequestCount++;\n }", "function checkRequestQueue()\r\n{\r\n\tif (checkRequestQueue != null)\r\n\t{\r\n\t\tif (requestQueueArray.length > 0) \r\n\t\t{\r\n\t\t\tif (!callInProgress(XMLRequest))\r\n\t\t\t{\r\n\t\t\t\tprocessRequest();\r\n\t\t\t}\r\n\t\t\telse if (requestQueueArray.length < queueThreshold)\r\n\t\t\t{\r\n\t\t\t\tsetTimeout('checkRequestQueue();', 50);\r\n\t\t\t}\r\n\t\t\telse if (requestQueueArray.length > queueThreshold)\r\n\t\t\t{\r\n\t\t\t\tReloadPolling();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function sendRequests4() {\n sendRequests(tokenList[0], userIdList[0], pathList_4h, nextUser);\n setTimeout(sendRequests4, 14400000);\n}", "onStart() {\n this.requestQueueLength++;\n if (this.requestQueueLength > 1 || !this.callbacks.onStart) {\n return;\n }\n this.callbacks.onStart(this.requestQueueLength);\n }", "function requestqueue() {\n\t\t// If the queue is already running, abort.\n\t\tif(requesting) return;\n\t\trequesting = true;\n\t\tlink.request({\n\t\t\turl: \"api/events\",\n\t\t\tmethod: \"POST\",\n\t\t\tparams: {\n\t\t\t\tsid: gSessionID\n\t\t\t},\n\t\t\tcallback: queuecallback\n\t\t});\n\t}", "startRequesting(scope) {\n this.stopRequesting();\n\n // Initial request\n this.request_data();\n\n // Start periodic request\n this.data_request = window.setInterval(function() {\n this.request_data();\n }.bind(this), 1000);\n }", "function sendRequests1() {\n sendRequests(tokenList[0], userIdList[0], pathList_1h, nextUser);\n setTimeout(sendRequests1, 3600000);\n}", "function startRequest() {\n\tinitialize();\n\t// console.log(pollInterval);\n\twindow.setTimeout(startRequest, pollInterval);\n}", "function startRequest() {\n return __awaiter(this, void 0, void 0, function* () {\n js_logger_1.default.info('start HTTP Request...');\n yield getList('record').then(list => {\n console.log(list);\n storageChrome_1.localAsyncSet({\n '__recordList': JSON.stringify(list)\n });\n js_logger_1.default.info('recordList Refreshed', list);\n });\n yield getList('search').then(list => {\n console.log(list);\n storageChrome_1.localAsyncSet({\n '__searchList': JSON.stringify(list)\n });\n js_logger_1.default.info('searchList Refreshed', list);\n });\n let recordList = JSON.parse(storageChrome_1.localSyncGet('__recordList'));\n let searchList = JSON.parse(storageChrome_1.localSyncGet('__searchList'));\n console.log('refreshed all', recordList, searchList);\n chrome.webRequest.onBeforeRequest.removeListener(webRequest_1.callback);\n chrome.webRequest.onBeforeRequest.addListener(webRequest_1.callback, webRequest_1.filter(), opt_extraInfoSpec);\n });\n}", "function RequestQueue(maxConcurrentRequests) {\n this.maxConcurrentRequests = maxConcurrentRequests;\n // mapping of id => request, where request is object with these keys:\n // {deferred: $q.deferred,\n // func: function returning promise,\n // id: unique identifier for requests in queue}\n this.pendingRequests = {};\n // mapping of id => request\n this.runningRequests = {};\n // order of requests so we can do LIFO ordering;\n this.requestQueue = [];\n }", "keepIndexing() {\n while (this.pendingRequests < this.MAX_CONCURRENT_REQUESTS\n && this.idsToIndex.length\n ) {\n this.beginIndexRequest();\n }\n }", "_issueNewRequests() {\n if (!this._deferredUpdate) {\n this._deferredUpdate = setTimeout(() => this._issueNewRequestsAsync(), 0);\n }\n }", "_issueNewRequests() {\n if (!this._deferredUpdate) {\n this._deferredUpdate = setTimeout(() => this._issueNewRequestsAsync(), 0);\n }\n }", "function startRequest() \n{\n CheckScanners(null, false);\n timerId = window.setTimeout(startRequest, pollInterval);\n}", "function worker() {\n // deleting obsolete data\n executed = executed.filter(obj => obj.executedAt + 1000 > Date.now());\n\n // running available requests\n for (let q in queue) {\n // max 2 request in 1 sec. for one client\n if (queue.hasOwnProperty(q) && executed.filter(obj => obj.client === queue[q].client).length < 2) {\n // remember for control API restrictions\n executed.push({\n client: queue[q].client,\n executedAt: Date.now(),\n });\n // execute request\n queue[q].callback();\n // exclude repeated request\n queue[q] = null;\n }\n }\n\n // clear queue\n queue = queue.filter(obj => obj);\n setTimeout(worker, 300);\n}", "start() {\n this.isStarted = true;\n this._startRequest();\n }", "function startAPIRequests()\t{\n // Get app configuration.\n loadConfig().then(() => {\n // -> Get save data.\n afterConfigLoaded();\n loadVideoInformation().then(() => {\n // -> start requesting subs.\n requestSubs();\n });\n });\n}", "function sendRequests24() {\n sendRequests(tokenList[0], userIdList[0], pathList_24h, nextUser);\n setTimeout(sendRequests24, 86400000);\n}", "function StartProcessing() {\r\n LogPush('<span style=\"color:green\"><strong>Starting Automatic Request processing</strong></span>');\r\n\r\n bAutoRun = true;\r\n iRequestNum = 0;\r\n\r\n oRespectList.Erase();\r\n oWallList.Erase();\r\n oRequestList.Erase();\r\n\r\n if (aParams[1] == null) aParams[1] = 0;\r\n if (aParams[3] == null) aParams[3] = 0;\r\n if (aParams[6] == null) aParams[6] = 0;\r\n\r\n\r\n if( aParams[1] > 0) {\r\n EventSpan.dispatchEvent(ActionRequest);\r\n } else {\r\n LogPush('Request Processing is Disabled');\r\n }\r\n if( aParams[3] > 0) {\r\n EventSpan.dispatchEvent(ActionWall);\r\n } else {\r\n LogPush('Wall Processing is Disabled');\r\n }\r\n if( aParams[6] > 0) {\r\n GM_log('dispatching Event ActionRespect');\r\n EventSpan.dispatchEvent(ActionRespect);\r\n } else {\r\n LogPush('Respect Processing is Disabled');\r\n }\r\n\r\n}", "listenRequests() {\n this.request(event.detail.request);\n }", "function throttleRequest() {\n if (remaining !== null && remaining < chokePoint) {\n return new Promise(function (resolve, reject) {\n queue(resolve);\n debug(\"Request queued because remaining (%s) is less than choke-point (%s). Queue-length: %s \", remaining, chokePoint, requestQueue.length);\n });\n }\n debug(\"Not throttling requests because choke-point (%s) not hit yet (%s)\", chokePoint, remaining);\n return Promise.resolve();\n}", "function initQueue(concurrency) {\n const q = queue()\n q.define(\n 'request',\n ({ url, ignore404, redirect }) => {\n return request(url, { ignore404, redirect })\n },\n { concurrency }\n )\n return q\n}", "_updateAllRequests() {\n const requestQueue = this.requestQueue;\n for (let i = 0; i < requestQueue.length; ++i) {\n const request = requestQueue[i];\n if (!this._updateRequest(request)) {\n // Remove the element and make sure to adjust the counter to account for shortened array\n requestQueue.splice(i, 1);\n delete this.requestMap[request.handle.id];\n i--;\n }\n }\n\n // Sort the remaining requests based on priority\n requestQueue.sort((a, b) => a.priority - b.priority);\n }", "listenRequests() {\n this.request(event.detail.request);\n }", "_updateAllRequests() {\n const requestQueue = this.requestQueue;\n for (let i = 0; i < requestQueue.length; ++i) {\n const request = requestQueue[i];\n if (!this._updateRequest(request)) {\n // Remove the element and make sure to adjust the counter to account for shortened array\n requestQueue.splice(i, 1);\n i--;\n }\n }\n\n // Sort the remaining requests based on priority\n requestQueue.sort((a, b) => a.priority - b.priority);\n }", "function start() {\r\n let limit = document.getElementById('limit').value;\r\n this.output.innerHTML = '';\r\n\r\n // this.regularCall(limit);\r\n // this.workerCall(limit);\r\n}", "function startRequest( httpMethod ) {\n httpMethod = normalizedHttpMethod( httpMethod );\n total.all++;\n total[ httpMethod ]++;\n pending.all++;\n pending[ httpMethod ]++;\n }", "async replayRequests() {\n let entry;\n\n while (entry = await this.shiftRequest()) {\n try {\n await fetch(entry.request.clone());\n\n if (\"dev\" !== 'production') {\n logger_js.logger.log(`Request for '${getFriendlyURL_js.getFriendlyURL(entry.request.url)}' ` + `has been replayed in queue '${this._name}'`);\n }\n } catch (error) {\n await this.unshiftRequest(entry);\n\n {\n logger_js.logger.log(`Request for '${getFriendlyURL_js.getFriendlyURL(entry.request.url)}' ` + `failed to replay, putting it back in queue '${this._name}'`);\n }\n\n throw new WorkboxError_js.WorkboxError('queue-replay-failed', {\n name: this._name\n });\n }\n }\n\n {\n logger_js.logger.log(`All requests in queue '${this.name}' have successfully ` + `replayed; the queue is now empty!`);\n }\n }", "_issueNewRequests() {\n this._updateNeeded = true;\n setTimeout(() => this._issueNewRequestsAsync(), 0);\n }", "_updateAllRequests() {\n const requestQueue = this.requestQueue;\n for (let i = 0; i < requestQueue.length; ++i) {\n const request = requestQueue[i];\n if (!this._updateRequest(request)) {\n // Remove the element and make sure to adjust the counter to account for shortened array\n requestQueue.splice(i, 1);\n this.requestMap.delete(request.handle);\n i--;\n }\n }\n\n // Sort the remaining requests based on priority\n requestQueue.sort((a, b) => a.priority - b.priority);\n }", "m_submit_http_request(ph_args) {\n const lo_this = this;\n\n try {\n\n // call limit already reached ? - silently exit\n if (lo_this._ab_call_limit_reached) {\n return;\n }\n\n const pi_max_calls = lo_this.m_pick_option(ph_args, \"pi_max_calls\", true);\n const li_call_count = lo_this.m_get_call_count_pushed();\n\n // when we reached the max number of calls to this server, just stop now\n if (f_is_defined(pi_max_calls) && (li_call_count >= pi_max_calls)) {\n lo_this._ab_call_limit_reached = true;\n throw f_console_alert(`${lo_this.m_get_context()} - total of [${li_call_count}] calls, reached the limit pi_max_calls=[${pi_max_calls}] - stopping`);\n }\n\n\n // on-the-fly create a new async queue object, when required\n if (! lo_this._ao_query_queue) {\n const pi_concurrency = lo_this.m_pick_option(ph_args, \"pi_concurrency\");\n const pi_max_rate_cps = lo_this.m_pick_option(ph_args, \"pi_max_rate_cps\");\n\n f_console_verbose(1, `${lo_this.m_get_context()} - initializing async WBS queue with concurrency=[${pi_concurrency}] and rate-limit=[${pi_max_rate_cps} cps]`);\n\n // https://caolan.github.io/async/docs.html#QueueObject\n const lo_new_queue = cm_async.queue(function (ph_args, pf_process_next_in_queue) {\n lo_this._m_queue_worker(ph_args, pf_process_next_in_queue);\n }, pi_concurrency);\n\n\n // branch events\n lo_new_queue.drain = function () {\n lo_this._m_queue_drain();\n };\n\n lo_new_queue.empty = function () {\n lo_this._m_queue_empty();\n };\n\n lo_this._ao_query_queue = lo_new_queue;\n }\n\n const ps_call_context = lo_this.m_pick_option(ph_args, \"ps_call_context\");\n if (f_string_is_blank(ps_call_context)) {\n throw f_console_fatal(`${lo_this.m_get_context()} - missing option [ps_call_context]`);\n }\n\n f_console_verbose(2, `${lo_this.m_get_context(ps_call_context)} - pushing arguments:`, ph_args);\n\n const pb_high_priority = f_is_true(lo_this.m_pick_option(ph_args, \"pb_high_priority\", true));\n if (pb_high_priority) {\n f_console_verbose(1, `${lo_this.m_get_context(ps_call_context)} - scheduling query in high priority`);\n lo_this._ao_query_queue.unshift(ph_args);\n }\n\n else {\n lo_this._ao_query_queue.push(ph_args);\n }\n\n lo_this._ai_call_count_pushed_total ++;\n lo_this._ai_queue_len_max = f_number_max(lo_this._ai_queue_len_max, lo_this._ao_query_queue.length());\n }\n\n catch (po_err) {\n f_console_catch(po_err);\n }\n }", "processQueue() {\n if (this.ratelimit.remaining === 0) return;\n if (this.ratelimit.queue.length === 0) return;\n if (this.ratelimit.remaining === this.ratelimit.total) {\n this.ratelimit.resetTimer = this.client.setTimeout(() => {\n this.ratelimit.remaining = this.ratelimit.total;\n this.processQueue();\n }, this.ratelimit.time);\n }\n while (this.ratelimit.remaining > 0) {\n const item = this.ratelimit.queue.shift();\n if (!item) return;\n this._send(item);\n this.ratelimit.remaining--;\n }\n }", "function RequestQueue(numberOfRequests, finished) {\n var self = this;\n self.numberOfRequests = numberOfRequests;\n self.done = 0;\n\n /**\n * Helper function to check if the number of requests have been met\n */\n var checkComplete = function() {\n if(self.done == self.numberOfRequests) {\n finished();\n }\n }\n\n\n /**\n * Called in place of a usual callback. The callback passed\n * is the usual callback.\n */\n self.enqueue = function(callback) {\n return function(parameter) {\n callback(parameter);\n self.done++;\n checkComplete();\n }\n };\n}", "_abortAllRequests() {\n while (this._requests.length > 0) {\n const req = this._requests.pop();\n req.abort = true;\n req.xhr.abort();\n req.xhr.onreadystatechange = function () {};\n }\n }", "function throttledRequest(...args) {\n limiter.removeTokens(1, () => {\n util.request.apply(null, args);\n });\n}", "fetchQueued() {\n return fetchSoon.fetchSearchRequests(this._myStartableQueued());\n }", "function sendInitialRequest(inputUrl){\n incrementRequests();\n console.log(\"numberOfRequests \" + numberOfRequests);\n request(inputUrl, function (err, resp, body) {\n if (err)\n throw err;\n $ = cheerio.load(body);\n console.log(\"Scraping categories:\");\n $('.lhn-menu-flyout-1col a').each(function(index){\n //if(index>40)\n // return;\n //this website has some ugly category which will cause nuberofrequest cant be 0\n //so if the url does not have browse, it means it direct to another main category which\n //is not a single category\n if($(this).attr('href').match(\"browse\")==null)\n return;\n var nextLink = 'http://www.walmart.com'+$(this).attr('href');\n console.log(\"\\t\" + nextLink);\n scrapeSingleCategoryPage(nextLink, 1);\n });\n decrementRequests();\n console.log(\"numberOfRequests \" + numberOfRequests);\n });\n}", "function request() {\n\n clearInterval(run); // stop the setInterval()\n\n // dynamically change the run interval\n if(changeSpeed !== FETCH_INTERVAL ){\n FETCH_INTERVAL = changeSpeed\n }\n\n run = setInterval(()=>{\n request()\n getQuotes(socket)\n }, FETCH_INTERVAL); // start the setInterval()\n\n }", "function request(url, readyStateChangedFunction, async, type)\r\n{\r\n\trequestQueueArray.push(new requestObject(url, readyStateChangedFunction, async, type));\r\n\tif (!callInProgress(XMLRequest))\r\n\t{\r\n\t\tprocessRequest();\r\n\t\tcount ++;\r\n\t\tif (count > 20){count = 0;}\r\n\t}\r\n\telse{checkRequestQueue();}\r\n}", "constructor(size_limit) {\n super();\n this.size_limit = size_limit;\n this.task_queue = [];\n this.running = false;\n }", "function start() {\n if (started || !isEnabled.value)\n return;\n if (isServer && currentOptions.value.prefetch === false)\n return;\n started = true;\n loading.value = true;\n var client = resolveClient(currentOptions.value.clientId);\n query.value = client.watchQuery(__assign(__assign({ query: currentDocument, variables: currentVariables }, currentOptions.value), isServer ? {\n fetchPolicy: 'network-only'\n } : {}));\n startQuerySubscription();\n if (!isServer && (currentOptions.value.fetchPolicy !== 'no-cache' || currentOptions.value.notifyOnNetworkStatusChange)) {\n var currentResult = query.value.getCurrentResult();\n if (!currentResult.loading || currentOptions.value.notifyOnNetworkStatusChange) {\n onNextResult(currentResult);\n }\n }\n if (!isServer) {\n for (var _i = 0, subscribeToMoreItems_1 = subscribeToMoreItems; _i < subscribeToMoreItems_1.length; _i++) {\n var item = subscribeToMoreItems_1[_i];\n addSubscribeToMore(item);\n }\n }\n }", "function RequestQueue(options)\n{\n\tvar self = this;\n\n\tvar _defaultOpts = {\n\t\tcompleteEvent: \"requestQueueProcessComplete\",\n\t\tnewRequestEvent: \"requestQueueNewRequest\"\n\t};\n\n\tvar _options = jQuery.extend(true, {}, _defaultOpts, options);\n\n\tvar _queryQueue = [];\n\tvar _queryInProgress = false;\n\tvar _dispatcher = {};\n\t_.extend(_dispatcher, Backbone.Events);\n\n\t/**\n\t * Initializes the queue with the provided process function.\n\t *\n\t * @param processFn function to be invoked to process queue elements\n\t */\n\tfunction init(processFn)\n\t{\n\t\t_dispatcher.on(_options.newRequestEvent, function() {\n\t\t\t// no query in progress, ready to consume\n\t\t\tif (!_queryInProgress)\n\t\t\t{\n\t\t\t\tprocessQueue(processFn);\n\t\t\t}\n\t\t});\n\n\t\t_dispatcher.on(_options.completeEvent, function() {\n\t\t\tprocessQueue(processFn);\n\t\t});\n\t}\n\n\t// TODO find an efficient way to avoid hitting the server more than once\n\t// for the exact same simultaneous query\n\n\t/**\n\t * Processes the queue by invoking the given process function\n\t * for the current element in the queue.\n\t *\n\t * @param processFn function to process the queue element\n\t */\n\tfunction processQueue(processFn)\n\t{\n\t\t// get the first element from the queue\n\t\tvar element = _.first(_queryQueue);\n\t\t_queryQueue = _.rest(_queryQueue);\n\n\t\t// still elements in queue\n\t\tif (element)\n\t\t{\n\t\t\t_queryInProgress = element;\n\n\t\t\tif (_.isFunction(processFn))\n\t\t\t{\n\t\t\t\tprocessFn(element);\n\t\t\t}\n\t\t}\n\t\t// no more query to process\n\t\telse\n\t\t{\n\t\t\t_queryInProgress = false;\n\t\t}\n\t}\n\n\t/**\n\t * Function to be invoked upon completion of the process of a queue element.\n\t */\n\tfunction complete()\n\t{\n\t\t_queryInProgress = false;\n\t\t_dispatcher.trigger(_options.completeEvent);\n\t}\n\n\t/**\n\t * Adds a new element into the queue, and triggers a new request event.\n\t *\n\t * @param element a new queue element\n\t */\n\tfunction add(element)\n\t{\n\t\t_queryQueue.push(element);\n\t\t_dispatcher.trigger(_options.newRequestEvent);\n\t}\n\n\tself.add = add;\n\tself.complete = complete;\n\tself.init = init;\n}", "start() {\n if (!this.started) {\n this.started = true;\n this._requestIfNeeded();\n }\n }", "function dxProcessRequestQueue() {\n\tif (dx_processing_queue) {return;}\n\tif (!navigator.onLine) {\n\t\tsetItemInLocalStorage(\"dx_queue\",JSON.stringify(dx_queue),2);\n\t\tshowAlert(presentOfflineRequestQueuedMessage(),\"info\",\"OK\",false);\n\t\treturn;\n\t}\n\tif (dx_queue.length > 0) {\n\t\tlet next_post = dx_queue.shift();\n\t\tdxRequestInternalQueued(next_post.url,next_post.parameters,next_post.on_success,next_post.on_fail,next_post.trigger_element_id);\n\t} else {\n\t\tdx_processing_queue = false;\n\t}\n}", "_configureThrottling() {\n if (this.options.maxTPS && this.options.maxTPS > 0) {\n const minTime = parseInt(1000 / this.options.maxTPS);\n if (minTime > 0) {\n this.rate_limiter = new Bottleneck({ minTime });\n this._processMatchedSqsMessage = this.rate_limiter.wrap(this._processMatchedSqsMessage);\n }\n }\n }", "expressLimiter() {\n const limiter = expressLimiter(this.app);\n limiter(this.app, {\n total: 60, // Allowed Number pf request before limits get expired\n expire: 1000 * 60, // Limits gets expired in defined miliseconds\n });\n }", "function checkReqsIntensivity (req, res, next) {\n var user_id = req.user && req.user.id ? req.user.id : 0\n var ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress || req.socket.remoteAddress\n\n var minute = parseInt(Date.now() / 1000 / (options.TimeFrameInMinutes * 60), 10)\n var requestKey = 'RateLimitter:' + (user_id || ip) + ':' + req.method + ':' + minute\n\n // next minute\n var resetMinute = minute * (options.TimeFrameInMinutes * 60) + (options.TimeFrameInMinutes * 60)\n\n function errHandler (err) {\n console.log('RateLimitter Error')\n console.log(err)\n return next()\n }\n\n function processResponse (info) {\n if (info.too_often) {\n console.log('Please slow down, you request too frequently.')\n return res.sendStatus(429)\n } else {\n // save reqnum into redis\n redis.setex(requestKey, options.TimeFrameInMinutes * 60, ++info.reqnum, function (err) {\n if (err) {\n return errHandler(err)\n }\n return next()\n })\n }\n }\n\n redis.get(requestKey, function (err, reqnum) {\n if (err) {\n return errHandler(err)\n }\n\n reqnum = parseInt(reqnum, 10) || 0\n var too_often = false\n var remaining = options.maxUserRequestLimitPerTimeFrame[req.method] - reqnum\n if (remaining < 0) {\n too_often = true\n res.setHeader('X-Rate-Limit-Reset', resetMinute)\n }\n\n res.setHeader('X-Rate-Limit-Limit', options.maxUserRequestLimitPerTimeFrame[req.method])\n res.setHeader('X-Rate-Limit-Remaining', Math.max(remaining, 0))\n\n processResponse({too_often: too_often, reqnum: reqnum || 0})\n })\n}", "function logRequests(req, res, next) {\n\n console.count(\"Number of Requests\");\n \n return next();\n }", "function runRequest(lines) {\n\tif (continueRequesting && lines.length > 0) {\n\t\tvar line = lines.pop()\n\t\t\n\t\tconsole.log('urls to get: ' + lines.length)\n\t\tvar request =\thttp.get(line, function(res) {\n\t\t\tvar body = '';\n\n\t\t\tres.on('error', function(err) {\n\t\t\t\tconsole.log('we got an error!')\n\t\t\t\tconsole.log(e.message);});\n\n\t\t\tres.on('data', function(chunk) {\tbody += chunk; });\n\n\t\t\tres.on('end', function() {\n\t\t\t\tuniqueURLArray.push(line);\n\t\t\t\t//load the cheerio object\n\t\t\t\tvar $ = cheerio.load(body);\n\t\t\t\t//first thing to do is determine the number of pages to link to (there will be a max of 3 pages of info to scrape through and it'd be better to find those pages using cheerio than doing it manually\n\t\t\t\t// the urls are all p2, p3, p4 etc and if we put the first url in there then the rest will follow\n\t\t\t var url = $('a.Next').prev().attr('href'); //the sibling of the next button (which is the last page of results)\n\t\t\t \n\t\t\t //console.log(url, line);\n\t\t\t\tif (url != null) {\n\t\t\t\t\tpgNum = url.replace('.html', '').slice(-2).replace(/[^\\d]/g,''); //get the page number\n\t\t\t\t\tfor (var ii = 2; ii <= pgNum; ii++) {\n\t\t\t\t\t\tuniqueURLArray.push(url.replace(/(-p(\\d+)[.]html)/g, '-p' + ii + '.html'));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//if the request timed out\n\t\t\t\tif (timeout) {\n\t\t\t\t\ttimeout = false;\n\t\t\t\t\tconsole.log(completed_requests, line);\n\t\t\t\t}\n\n\t\t\t\t//once 5 requests are completed start parsing the data\n\t\t\t\tif (completed_requests++ == 5) {\n\t\t \tcontinueRequesting = true;\n\t\t //now get the messages\n\t\t console.log('num urls: ' + uniqueURLArray.length);\n\t\t \n\t\t var messages = [];\n\n\n\t\t getMessages(uniqueURLArray, messages, uniqueURLArray.length);\n\t\t //now the messages are all here\n\t\t //time to filter \n\t\t\t\t}\n\n\t\t\t\tsetTimeout(runRequest(lines), tools.randInt(0,100)); //works with 500-1000\n\t\t\t});\n\t\t});\n\n\t\t//request stuff\n\t\trequest.setTimeout(90000, function () {\n\t\t\trequest.abort();\n\t\t\tconsole.log('request timed out');\n\t\t\ttimeout = true;\n\t\t});\n\t\trequest.on('error', function(e) {\n\t\t\tconsole.log(e);\n\t\t\tcompleted_requests++;\n\t\t});\n\t}\n}", "async scheduledFlush() {\n for (let k in this.buffers) {\n const buffer = this.buffers[k];\n if (buffer.rec_count !== 0 && buffer.time_limit >0 && new Date(buffer.created.getTime() + 1000 * buffer.time_limit) <= new Date()) {\n await this.close(buffer.domain, buffer.namespace);\n if (!this.shuttingDown) await this.open(buffer.domain, buffer.namespace, buffer.size_limit, buffer.time_limit);\n }\n }\n await this.upload();\n }", "static async rateLimiting() {\n await new Promise(resolve => setTimeout(resolve, 250))\n }", "scheduleRequest(handle, callback = () => 0) {\n // Allows throttling to be disabled\n if (!this.props.throttleRequests) {\n return Promise.resolve(handle);\n }\n\n const promise = new Promise((resolve, reject) => {\n this.requestQueue.push({handle, callback, resolve, reject});\n });\n\n this._issueNewRequests();\n return promise;\n }", "async checkFreeAccountRequestsLimit() {\n const from = +this.userTokens.property('сounting_requests_from');\n const counter = +this.userTokens.property('request_counter');\n if (this.now >= (from + 3600000)) { // Обновим метку отсчета (запросов в час)\n await this.extendRequestCounting();\n }\n else if (counter >= config.requests_per_hour_for_free_account) { // Превышено\n this.exceededRequestsLimit();\n return false;\n }\n else { // Накрутить счетчик запросов\n await this.increaseRequestsCount(counter + 1);\n }\n return true;\n }", "function executeQueue() {\n\t\t\tif (outQueue.length < 1) {\n\t\t\t\texecutingQueue = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar nextRequest,\n\t\t\t\tcollectorUrl,\n\t\t\t\ti;\n\n\t\t\texecutingQueue = true;\n\n\t\t\tfor (i in outQueue) {\n\n\t\t\t\tif (outQueue[i] && outQueue.hasOwnProperty(i)) {\n\n\t\t\t\t\tnextRequest = outQueue[i];\n\n\t\t\t\t\t// Let's check that we have a Url to ping\n\t\t\t\t\tif (!lodash.isString(configCollectorUrl)) {\n\t\t\t\t\t\tthrow \"No Snowplow collector configured, cannot track\";\n\t\t\t\t\t}\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Send image request to the Snowplow Collector using GET.\n\t\t\t\t\t * The Collector serves a transparent, single pixel (1x1) GIF\n\t\t\t\t\t * Use IIFE to close over i because i may change between setting image.onload and the image loading.\n\t\t\t\t\t */\n\t\t\t\t\t(function(queueIndex) {\n\t\t\t\t\t\tvar image = new Image(1,1);\n\n\t\t\t\t\t\timage.onload = function() {\n\n\t\t\t\t\t\t\t// We succeeded, let's remove this request from the queue\n\t\t\t\t\t\t\tdelete outQueue[queueIndex];\n\t\t\t\t\t\t\tif (localStorageAccessible) {\n\t\t\t\t\t\t\t\tlocalStorage.setItem(queueName, json2.stringify(outQueue));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\texecuteQueue();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\timage.onerror = function() {}\n\n\t\t\t\t\t\timage.src = configCollectorUrl + nextRequest;\n\n\t\t\t\t\t}(i));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\texecutingQueue = false;\n\n\t\t\t// If every request has been sent, set the queue to []\n\t\t\tif (lodash.compact(outQueue).length === 0) {\n\t\t\t\toutQueue = [];\n\t\t\t}\n\t\t}", "async submitRequests(requests) {\n return Promise.all(\n Promise.all(requests.creation.map(x => {\n return this.requestCreation(requests.workerType, x);\n })),\n Promise.all(requests.deletion.map(x => {\n return this.requestDeletion(requests.workerType, x);\n })),\n );\n }", "function sendRequest(argNumber) {\n http.get(process.argv[argNumber], function(response) {\n let accumulator = '';\n response.setEncoding('utf8');\n response.on('data', function(data) {\n accumulator += data;\n });\n response.on('error', console.error);\n response.on('end', function(args) {\n responses[argNumber - 2] = accumulator;\n requestEnds++;\n\n // Prints results if all requests have ended.\n if (requestEnds === neededRequests) {\n for (let i = 0; i < responses.length; i++) {\n console.log(responses[i]);\n }\n }\n });\n });\n }", "async beginIndexRequest() {\n const keyString = this.idsToIndex.shift();\n const provider = this;\n\n this.pendingRequests += 1;\n const identifier = await this.openmct.objects.parseKeyString(keyString);\n const domainObject = await this.openmct.objects.get(identifier.key);\n delete provider.pendingIndex[keyString];\n try {\n if (domainObject) {\n await provider.index(identifier, domainObject);\n }\n } catch (error) {\n console.warn('Failed to index domain object ' + keyString, error);\n }\n\n setTimeout(function () {\n provider.pendingRequests -= 1;\n provider.keepIndexing();\n }, 0);\n }", "_requestAPI(paramsURL, callback) {\n console.log('init _requestAPI');\n let options = {\n method: 'POST',\n uri: this.queryURL,\n body: {\n params: 'query=&facets=*&distinct=true&page='+this.pageNumber+'&hitsPerPage=100&facetFilters=type%3AOrganization'+paramsURL,\n apiKey: this.apiKey,\n appID: this.appID\n },\n json: true\n };\n\n request(options)\n .then((response) => {\n console.log(response.nbHits + ' companies exist in this query');\n let NumberUrlsLeftToScrape = response.nbHits - this.filtredCompanies.length;\n console.log(NumberUrlsLeftToScrape + ' companies not scraped yet');\n\n if (response.nbHits - this.filtredCompanies.length < 1) {\n console.log('no companies left to scrape, please change criteria');\n callback();\n } else {\n if (response.hits && response.hits.length > 0) {\n this.pageNumber++;\n response.hits.forEach(comp => {\n let url = (comp.url[0] === '/') ? comp.url.slice(1) : comp.url;\n url = this.baseURL + url;\n if (!_.findWhere(this.companies, {companyName:comp.name}) &&\n !_.findWhere(this.companies, {crunchBaseURL:url}) &&\n !_.findWhere(this.companies, {websiteLink:comp.homepage_url})) {\n this.urlsPool.push({name:comp.name, url:url});\n }\n });\n this.urlsPool = _.uniq(this.urlsPool, 'name');\n\n let max = (NumberUrlsLeftToScrape < this.urlsNumber) ? NumberUrlsLeftToScrape : this.urlsNumber;\n\n console.log('urls returned: '+this.urlsPool.length+' after getting page: '+this.pageNumber);\n\n if (this.urlsPool.length < max) {\n this._requestAPI(paramsURL, () => callback());\n } else {\n callback();\n }\n } else {\n this.pageNumber = (this.pageNumber > response.nbPages) ? 0 : ++this.pageNumber;\n console.log('response didn\\'t return any hits');\n this._requestAPI(paramsURL, () => callback());\n }\n }\n })\n .catch((err) => {\n console.log('ERROR getting list of companies from CB API.. retrying');\n console.log(err);\n clearTimeout(this.retryTimer);\n this.retryTimer = setTimeout(() => {\n this._requestAPI(paramsURL, () => callback());\n }, 30000);\n });\n }", "function callSeqHTTPRequest(i){\n i = i || 0 ;\n\n if(i < NO_OF_DATA_POINTS){\n\n\n (function (index, req) {\n sendHTTPRequest(req, index)\n\n })(i, new XMLHttpRequest())\n }\n}", "async flush() {\n if (this._timer) {\n clearTimeout(this._timer);\n delete this._timer;\n }\n const batch = this._requests;\n const batchSize = batch.length;\n const deferred = this._onFlush;\n this._requests = [];\n this.numPendingRequests -= batchSize;\n delete this._onFlush;\n try {\n await this._sendBatch(batch);\n }\n catch (e) {\n this._subscriber.emit('error', e);\n }\n if (deferred) {\n deferred.resolve();\n }\n }", "makeAllAvailableWorkersWork() {\n for (let i = 0; i < this._workers.length; i += 1) {\n if (this._isWorkerAvailable[i]) {\n this.requestJob(i);\n }\n }\n }", "async start() {\n if (this.status == QueueStatus.running)\n return;\n this.status = QueueStatus.running;\n let msg = '';\n do {\n try {\n msg = await this.bzpopmin(this.qName, 0); // Monitor queue forever\n // Proceed only on incoming message and re-monitor for next\n msg = JSON.parse(msg[1]); // msg:>> [queueName, msgContent]\n this.onMessage(msg);\n this.queueLimit && this.checkQueueLimit();\n } catch (error) {\n await this.handleQueueErrors(msg, error)\n }\n } while (this.status == QueueStatus.running);\n\n }", "function HTML_AJAX_Queue_Immediate() {}", "scheduleLogRequest() {\n if (!this.state.looping) {\n return;\n }\n this.requestLoop = window.setTimeout(() => {\n this.requestLatestJobLog();\n }, this.logPollInterval);\n }", "function loop_request(){\r\n let waisted_count = 0; // set to 0\r\n \r\n //requset from api\r\n async function StartR() \r\n {\r\n // request, fetch api data\r\n const response = await fetch(api_url); //fetch\r\n const data = await response.json(); //api\r\n let json_split = JSON.parse(JSON.stringify(data)); // split api data\r\n\r\n // only for the first request\r\n if (beginvar == true){\r\n console.log(\"first try\");\r\n render_call(json_split, waisted_count, beginvar);\r\n last_api = json_split[0].id;\r\n beginvar = false; \r\n } \r\n else{\r\n console.log(\"secound try\");\r\n waisted_count = while_count(last_api, json_split);\r\n render_call(json_split, waisted_count, beginvar);\r\n }\r\n console.log(\"assync vege 15perc \" + \"Last API: \" + last_api);\r\n }\r\n StartR();\r\n}", "processRequests() {\n debug('Processing requests ...');\n\n let buffer = [];\n const { item } = this.data;\n\n if (!item || !item.length) {\n throw new Error('JSON is missing requests (\"item\" field)');\n }\n\n for (const request of item) {\n const array = this.processRequest(request);\n buffer = buffer.concat(array);\n }\n\n return buffer;\n }", "function request(){\r\n\t\tvar\trequest = queue[l],\r\n\t\t\tdata = null,\r\n\t\t\txhr;\r\n\t\tif(delay < 0)\r\n\t\t\tdelay = 0;\r\n\t\tif(!delay && request && request.timeout && request.send) {\r\n\t\t\trequest.send = false;\r\n\t\t\trequest.timeout = setTimeout(function(){\r\n\t\t\t\tchangeDelay(500, 512);\r\n\t\t\t\tcancel(l++, new JSONRequestError(\"no response\"));\r\n\t\t\t}, request.timeout);\r\n\t\t\txhr = request.xhr;\r\n\t\t\txhr.open(request.method, request.url, true);\r\n\t\t\txhr.setRequestHeader(\"Content-Type\", \"application/jsonrequest\");\r\n\t\t\tif(request.method === \"post\") {\r\n\t\t\t\tdata = \"JSONRequest=\".concat(encodeURIComponent(request.data));\r\n\t\t\t\txhr.setRequestHeader(\"Content-Length\", data.length);\r\n\t\t\t\txhr.setRequestHeader(\"Content-Encoding\", \"identity\");\r\n\t\t\t};\r\n\t\t\txhr.onreadystatechange = function(){\r\n\t\t\t\tif(xhr.readyState === 4) {\r\n\t\t\t\t\tif(xhr.status === 200) {\r\n\t\t\t\t\t\tclearTimeout(request.timeout);\r\n\t\t\t\t\t\ttry {\r\n var ctype = xhr.getResponseHeader(\"Content-Type\");\r\n\t\t\t\t\t\t\tif(ctype === \"application/jsonrequest\") {\r\n\t\t\t\t\t\t\t\trequest.done(l+1, JSON.parse(xhr.responseText));\r\n\t\t\t\t\t\t\t\tcancel(l);\r\n\t\t\t\t\t\t\t\tchangeDelay(-10);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t throw new JSONRequestError(\"wrong content type \" + ctype);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcatch(e) {\r\n\t\t\t\t\t\t\tchangeDelay(500, 512);\r\n\t\t\t\t\t\t cancel(l, e); // new JSONRequestError(\"bad response\"));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tchangeDelay(500, 512);\r\n\t\t\t\t\t\tcancel(l, new JSONRequestError(\"not ok, status = \" + xhr.status));\r\n\t\t\t\t\t};\r\n\t\t\t\t\tl++;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\txhr.send(data);\r\n\t\t}\r\n\t\telse if(request && !request.timeout && l < queue.length - 1)\r\n\t\t\tl++;\r\n\t\tif(delay)\r\n\t\t\tdelay -= 10;\r\n\t}", "initiate(url){\n console.log(`\\nKicking off with base url ${url} \\n`);\n \n //create workers\n for(let i=0; i<maxConcurrent; i++){\n let worker = new Worker();\n this.workers.set(worker, IDLE);\n }\n\n //start distributing\n this.pushToTaskQueue([url]);\n this.distribute();\n }", "function enqueueRequest(request, url) {\n\t\t\toutQueue.push(request);\n\t\t\tconfigCollectorUrl = url;\n\t\t\tif (localStorageAccessible) {\n\t\t\t\tlocalStorage.setItem(queueName, json2.stringify(outQueue));\n\t\t\t}\n\n\t\t\tif (!executingQueue) {\n\t\t\t\texecuteQueue();\n\t\t\t}\n\t\t}", "execute() {\n if (this.isRunning)\n return;\n let request = this.queue.shift();\n if (request === undefined) {\n this.isRunning = false;\n return;\n }\n let e = request;\n this.isRunning = true;\n this.options = request.options;\n this.completionHandlers[this.options.url] = request.handler;\n this.xmlHtpRequest.open(this.options.method, this.options.url, true);\n this.setJsonHeaders();\n this.xmlHtpRequest.send();\n this.queue = this.queue.filter(h => { h.options.url !== e.options.url; });\n }", "HandleRequests() {\n\n\t\tfor(let name in Game.spawns) {\n\t\t\tfor(let i in this.requests) {\n\t\t\t\tlet spawn = Game.spawns[name];\n\t\t\t\tlet request = this.requests[i];\n\t\t\t\tlet role = Role.Creep[request.role];\n\n\t\t\t\tif (spawn.canCreateCreep(role.Level[0]) == OK) {\n\t\t\t\t\tlet name = spawn.createCreep(role.Level[0], null, { role: request.role });\n\t\t\t\t\tif(name != null) {\n\t\t\t\t\t\trequest.name = name;\n\t\t\t\t\t\tthis.reserves.push(request);\n\t\t\t\t\t\tthis.requests.splice(i, 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.requests = [];\n\t}", "function batchRequests(coords){\n var batchSize = parameters.batchSize-1;\n\n for (var c = 0; c < coords.length; c+=batchSize){\n var batch = coords.slice(c,c+batchSize);\n batch.unshift(startingPosition);\n makeRequest(batch)\n }\n }", "forkWorkers() {\n for (var i = 0; i < this.numWorkers; i++) {\n this.requestNewWorker()\n }\n }", "async throttle(pinCodesArr) {\n let counter = 0;\n const batch = 60;\n const self = this;\n return async function () {\n return new Promise((resolve, reject) => {\n const interval = setInterval(async () => {\n await self.requestBatch(pinCodesArr.slice(counter, counter + batch));\n counter += batch;\n if (counter >= pinCodesArr.length) {\n clearInterval(interval);\n // console.log(\"clearing interval\");\n resolve(self.finalCsvRows);\n } else console.log(\"sleeping for 1 secs\");\n }, 1000);\n });\n };\n }", "function clickedOnStart() {\n initValues();\n maxRequest = parseInt(elemByIdValue(\"txfMaxRequests\")) || 6;\n username = elemByIdValue(\"inputUserName\").trim();\n reponame = elemByIdValue(\"inputRepoName\").trim(); \n sendRequest(username, reponame, getAllLabels());\n}", "function startTimer() {\n\tif(!breaking) {\t\n\t\tbreaking = true;\n\t\tendTime = Date.now() + (timerLimit * 1000 * 60);\n\n\t\tsetTimeout(() => {\n\t\t\tbreaking = false;\n\t\t\tendTime = null;\n\n\t\t\tresetBlockedSites();\n\t\t\t\n\t\t\tclearTimeout(breakTimeout);\n\t\t}, timerLimit * 1000 * 60);\n\t}\n}", "function testRequest() {\n setChildTextNode(\"resultsRequest\", \"running...\");\n\n chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {\n\tvar timer = new Date().getTime()// new chrome.Interval();\n\t// timer.start();\n\tvar tab = tabs[0];\n\tchrome.tabs.sendMessage(tab.id, {counter: 1}, function handler(response) {\n\t if (response.counter < 3000) {\n\t\tchrome.tabs.sendMessage(tab.id, {counter: response.counter}, handler);\n\t } else {\n\t\t// timer.stop();\n\t\tvar end = new Date().getTime()\n\t\t\n\t\tvar usec = Math.round(( end - timer));\n\t\tsetChildTextNode(\"resultsRequest\", response.counter + \" response.counter \" + usec + \"usec\");\n\t }\n\t});\n });\n}", "function processNextRequest() {\n if (pendingPortRequest || !queuedPortRequests.length) {\n return;\n }\n pendingPortRequest = true;\n const { resolve, reject } = queuedPortRequests.shift();\n getPortPromise(false)\n .then(resolve)\n .catch(reject)\n .finally(() => {\n pendingPortRequest = false;\n processNextRequest();\n });\n }", "async stopRecordingRequests() {\n if (!this.isRecordingRequests) {\n throw new Error('You need to start recording before stopping');\n }\n const batch = {\n intent: this.intent,\n requests: this.currentRequestsRecorded,\n validationErrors: lodash_1.compact(this.currentValidationErrorsRecorded),\n runtimeErrors: this.currentRuntimeErrorsRecorded\n };\n this.requestBatches.push(batch);\n this.isRecordingRequests = false;\n this.currentRequestsRecorded = [];\n this.currentValidationErrorsRecorded = [];\n this.intent = null;\n }", "function getRequests() {\n $.get(\"/api/requests/\", function(data) {\n console.log(\"Requests\", data);\n\n requests = data; \n\n if (!requests || !requests.length) {\n displayEmpty();\n }\n else {\n initializeRows();\n }\n });\n }", "enqueue(runnable, timeOut = 0) {\n debounce(\"xhrQueue\", () => {\n const requestHandler = this.enrichRunnable(runnable);\n if (!this.taskRunning) {\n this.signalTaskRunning();\n requestHandler.start();\n }\n else {\n this.queue.push(requestHandler);\n }\n }, timeOut);\n }", "findRequestAll(qParams) {\n return this.request.get('requests', qParams);\n }", "watch() {\n this._createDelayedRequest(0);\n }", "function main(options){\n //ensure we don't have the 5 open socket limit.\n configureMaxSockets(http); //<-- this shouldn't be needed.\n\n //configure the agent provider (kept intentionally out of export so it can be moved to its own file)\n agentProvider.agentEveryNRequests = options.agentEveryNrequests;\n agentProvider.maxSockets = options.agentMaxSockets;\n\n console.log('pound is now going to make %s requests to url: %s', options.numberOfRequests, options.url);\n pound.startMilliseconds = new Date().getTime();\n\n if(options.sendRequestsInBursts){\n console.log('sending requests in bursts');\n pound.requestIntervalId = setInterval(function(){\n\n for(var x=0; x < options.requestsPerBurst; ++x){\n if(pound.requestsAttempted++ >= options.numberOfRequests){\n clearInterval(pound.requestIntervalId);\n return;\n }\n makeRequest(options, responseEndCallback, pound.requestsAttempted);\n }\n }, options.burstIntervalMs);\n }else if(options.requestsPerSecond > 0){\n var interval = 1000 / options.requestsPerSecond; // 200 rps == once every 5 milliseconds\n console.log('will generate a request once every %s milliseconds', interval);\n pound.requestIntervalId = setInterval(function(){\n if(pound.requestsAttempted++ < options.numberOfRequests){\n makeRequest(options, responseEndCallback, pound.requestsAttempted);\n }else{\n clearInterval(pound.requestIntervalId);\n }\n }, interval);\n }else{\n //generate the desired number of requests.\n for(; pound.requestsAttempted < options.numberOfRequests; ++pound.requestsAttempted){\n makeRequest(options, responseEndCallback, pound.requestsAttempted);\n }\n }\n\n\n //determine when processing has completed.\n //callback for each request. last request will trigger summary.\n function responseEndCallback(requestId){\n //if(++callbackCount >= options.numberOfRequests){\n if(pound.responsesReceived + pound.requestErrorCount >= options.numberOfRequests){\n console.log('################### done processing #######################');\n printTotals();\n clearInterval(pound.requestIntervalId);\n clearInterval(pound.statusUpdateIntervalId);\n }\n }\n\n //listen for ctrl+c. print a report and exit the process gracefully.\n process.on('SIGINT', finishedProcess);\n\n //start printing metrics every N seconds to the console.\n startStatusUpdates();\n }", "fill() {\n // Note:\n // - queue.running(): number of items that are currently running\n // - queue.length(): the number of items that are waiting to be run\n while (this.queue.running() + this.queue.length() < this.concurrency && this.path.peersToQuery.length > 0) {\n this.queue.push(this.path.peersToQuery.dequeue());\n }\n }", "function updateRequests(){\n Loading.showText('Cargando solicitudes.');\n result = RequestService.get({param: AuthService.getId()}, function(){\n Request.uploadRequests(result.request);\n $scope.requests = Request.updateRequests();\n Loading.hide();\n }, function(){\n Loading.hide();\n Loading.hideTimeout();\n });\n }", "function request(){\n\n var remoteID = getPrevious();\n\n if ( !remoteID ) return; // entry\n\n CONNECTIONS[ remoteID ].send( 'start', { request: true }, true );\n}", "function run() {\n running = true;\n if (queue.length == 0) {\n debug('queue flushed');\n running = false;\n return;\n }\n\n var req = queue.splice(0, 1)[0];\n var cached = db.get(req.url);\n\n if (cached && typeof cached.err === 'undefined' && typeof cached.body !== 'undefined') {\n debug(req.url + ' found in cache');\n var $ = cheerio.load(cached.body);\n req.callback(null, $);\n debug('callback called, running next item immediately because no web request was made');\n setImmediate(function() {\n run();\n })\n } else {\n debug(req.url + ' not found in cache, requesting...');\n module.exports.requestOptions.url = req.url;\n debug('request options: ' + JSON.stringify(module.exports.requestOptions, null, 2));\n request(module.exports.requestOptions, function(e, r, b) {\n if (e) {\n debug('error requesting url ' + req.url);\n debug(e);\n db.set(req.url, {err: e, body: b});\n req.callback(e);\n return;\n }\n\n db.set(req.url, {body: b});\n var $ = cheerio.load(b);\n req.callback(null, $);\n debug('callback called, running next item with timeout interval ' + module.exports.interval);\n setTimeout(function() {\n run();\n }, module.exports.interval);\n });\n }\n}", "_setupQueue() {\n // Create a queue that wil be used to send batches to the throttler.\n this.queue = queue(ensureAsync(this._worker));\n\n // When the last batch is removed from the queue, add any incomplete batches.\n this.queue.empty = () => {\n if (!this.pendingItems.length) {\n return;\n }\n\n debug('adding %s items from deferrd queue for processing', this.pendingItems.length);\n\n const batch = this.pendingItems.splice(0);\n this._pushToQueue(batch);\n };\n\n // Emit an event when the queue is drained.\n this.queue.drain = () => {\n this.emit('drain');\n };\n }" ]
[ "0.6628981", "0.6625322", "0.658616", "0.6573614", "0.6563562", "0.65359145", "0.6399605", "0.63529646", "0.6351921", "0.6289156", "0.62717116", "0.62717116", "0.61580175", "0.6135651", "0.6084854", "0.60447055", "0.60442245", "0.6014789", "0.5995843", "0.59860396", "0.5980748", "0.5955246", "0.59461033", "0.59461033", "0.58845925", "0.58294845", "0.5824037", "0.57425153", "0.57408345", "0.57302845", "0.5723634", "0.5711755", "0.5683025", "0.5681052", "0.5674475", "0.56567323", "0.5655021", "0.56302", "0.5628373", "0.5626895", "0.5622616", "0.5607193", "0.559008", "0.5588955", "0.55677474", "0.55248326", "0.55079514", "0.5503922", "0.5500643", "0.54991186", "0.5485639", "0.5483305", "0.5477288", "0.54662335", "0.5456996", "0.54470664", "0.54396033", "0.54352593", "0.5420934", "0.5417908", "0.5401312", "0.5397798", "0.5383102", "0.5365705", "0.5333928", "0.5323855", "0.53226984", "0.532097", "0.5308225", "0.53004444", "0.5298966", "0.5298897", "0.52898043", "0.52884024", "0.52764446", "0.5273092", "0.52682173", "0.5263859", "0.52578235", "0.5234165", "0.5225102", "0.5224227", "0.52226055", "0.5200662", "0.51915175", "0.51861465", "0.5170119", "0.5169249", "0.5161374", "0.51608384", "0.51499677", "0.51472324", "0.51434547", "0.5139834", "0.5127806", "0.51273555", "0.512662", "0.5120009", "0.51191044", "0.51169246" ]
0.7608277
0
Keep track of all the current lines written in the destination file. These will need to be rewritten when JS variables are updated.
extractNonCharcoalData(resolve, reject, data){ const lines = data.split('\n'); let destinationFileLines = []; let foundCharcoalLine = false; for(let index = 0; index < lines.length; index++) { const line = lines[index]; if(foundCharcoalLine) continue; if(line === '' && (index === lines.length - 1 || index === 0)) continue; const charcoalLine = line.match(this.charcoalRegex); if(charcoalLine) { destinationFileLines.push(line); foundCharcoalLine = true; } else { destinationFileLines.push(line); } }; if(foundCharcoalLine){ this.destIsFragile = true; } this.destFileData = destinationFileLines; resolve(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_updateFile() {\n const fs = require('fs');\n\n let result = '';\n\n for (const entry of this.m_entries) {\n for (const property of Object.keys(entry).sort()) {\n if ((entry[property] + '').indexOf('\\n') !== -1) {\n misc.throwOnError(true);\n }\n\n result += entry[property] + '\\n';\n }\n }\n\n fs.writeFileSync(this.m_path, result);\n this.m_entries = [];\n }", "_writingScript() {\n this.fs.copy(\n this.templatePath('src_script_body.js'),\n this.destinationPath('src/script/body.js')\n );\n this.fs.copy(\n this.templatePath('src_script_head.js'),\n this.destinationPath('src/script/head.js')\n );\n }", "function trackLineCount() {\n if (++processedLines % 100 === 0) {\n console.log(`Lines Processed: ${processedLines}`);\n }\n}", "saveCopy(){\n\t\tthis.savableCopy = FileManager.jsonWriter(this.state.toShowText);\n\t}", "function writeFile () {\n\tvar stringified = JSON.stringify(masterObject);\n\t\n\tfs.writeFile(newFilePath, stringified, function (err) {\n\t\tif (err) {console.log(err)};\n\t\tconsole.log(\"finished\");\n\t})\n}", "function writeNextLine () {\n var chunks = [];\n var lineMaybePromise = self.getLine.call(self, function (chunk) {\n chunks.push(chunk);\n }, lineNumber);\n\n Q(lineMaybePromise)\n .then(function () {\n if (chunks.length) {\n lineNumber++;\n // write all chunks, wait for drain (if necessary), call itself\n niceWrite(self.writeStream, chunks.join(\"\") + \"\\n\")\n .then(writeNextLine)\n .catch(reject);\n } else {\n // end the write stream, close the file\n self.writeStream.end(resolve);\n }\n });\n }", "function writeFile (lines) {\n let data = 'window.HEART=window.HEART||{}; window.HEART.data = ' + JSON.stringify(lines) + ';'\n data = data.replace(/\\[{/g, '[\\n{')\n data = data.replace(/}\\]/g, '}\\n]')\n data = data.replace(/},{/g, '},\\n{')\n\n if (!testing) {\n fs.writeFile(fileout, data, function(err) {\n if (err) {\n return console.log(err)\n }\n console.log('Wrote to: ' + fileout + ' with ' + lines.length + ' entries.')\n })\n }\n}", "function updateFile(){\n var logger = fs.createWriteStream('./tendie/tendiebox.txt', {\n //flags: 'a' // 'a' means appending (old data will be preserved)\n })\n\n //going through the tendie map and setting the file to it\n for(var key of tendieMap.keys()){\n logger.write(key + \"|\" + tendieMap.get(key).getTendies() + \"|\");\n }\n}", "function updateLines(){\n showLines.innerHTML = ++lineCounter;\n nextLevel(); \n}", "function js() {\n\twatch([paths.js + '/**/*.*', '!' + paths.js + '/**/*.min.js'], {ignoreInitial: false}, function () {\n\t\tvar scripts = JSON.parse(fs.readFileSync(paths.js + '/_compile.json', { encoding: 'utf8' }));\n\t\treturn scripts.forEach(function(obj){\n\t\t\treturn src(obj.src, { sourcemaps: true })\n\t\t\t\t.pipe(plumber({errorHandler: onError}))\n\t\t\t\t.pipe(concat(obj.name))\n\t\t\t\t.pipe(dest(paths.js, { sourcemaps: true }));\n\t\t});\n\t});\n}", "function reWriteStats() {\n console.log(car.make, car.model, car.color, car.mileage, car.isWorking);\n }", "function writeOnce(){\n console.log('writeOnce()');\n doPicList();\n doLargeText();\n // tracker();\n onesZeros();\n}", "function recalculateSourceTab() {\r\n if (!currentFile) {\r\n endLengthyOperation();\r\n return;\r\n }\r\n var coverage = __coverage__[currentFile], lines = coverage.code;\r\n\r\n // this can happen if there is an error in the original JavaScript file\r\n if (!lines) {\r\n lines = [];\r\n }\r\n \r\n var sourceDiv = document.getElementById('sourceDiv');\r\n sourceDiv.innerHTML = templates.controllerCodeDetail;\r\n \r\n var detailDiv = document.getElementById('code-detail');\r\n detailDiv.style.display = \"block\";\r\n \r\n asnyShowCode(coverage);\r\n \r\n endLengthyOperation();\r\n}", "function writeToFile(currentline,writeLine,count) {\nvar obj = {};\nobj[headers[Year]] = currentline[Year];\n\tif(currentline[indicatorIndex]===\"SP.URB.TOTL\"){\n\t\tobj[headers[Value]] = currentline[Value];\n\t}\n\tif(currentline[indicatorIndex]===\"SP.RUR.TOTL\"){\n\t\tobj[headers[Value]] = currentline[Value];\n\t}\n\tif(currentline[indicatorIndex]===\"SP.RUR.TOTL.ZS\"){\n\t\tobj[headers[Value]] = currentline[Value];\n\t}\n\tif(currentline[indicatorIndex]===\"SP.URB.TOTL.IN.ZS\"){\n\t\tobj[headers[Value]] = currentline[Value];\n\t}\nif(count==1) {\nwriteLine.write(JSON.stringify(obj)); // convert headers into JSON\n}\nelse {\n writeLine.write(\", \\n \\n\"+JSON.stringify(obj)); // convert data into JSON seperated by comma\n}\n\ncount++; //increment count and return it\nreturn count;\n}", "function updateStdout() {\n if (options.silent || !fs.existsSync(stdoutFile))\n return;\n \n var stdoutContent = fs.readFileSync(stdoutFile, 'utf8');\n // No changes since last time?\n if (stdoutContent.length <= previousStdoutContent.length)\n return;\n \n process.stdout.write(stdoutContent.substr(previousStdoutContent.length));\n previousStdoutContent = stdoutContent;\n }", "_writing() {\n return { ...writeFiles(), ...super._missingPostWriting() };\n }", "function _log(){\n var now_date = _getDate();\n console.log(now_date);\n if (now_date != cur_date) {\n var log_content = '\\nDate: ' + cur_date + ' visit number: home: ' + home_num +\n ', upload: ' + upload_num + ', download: ' + download_num;\n fs.appendFile(logfile, log_content, function (err) {\n if (err) console.log(err);\n console.log('Log Saved!');\n });\n cur_date = now_date;\n home_num = 0;\n upload_num = 0;\n download_num = 0;\n }\n}", "function reset_last_line(){\n PropertiesService.getScriptProperties().setProperty(\"ExportManager.export_vers_planning_malditof\", 0);\n}", "function reWriteStats() {\nconsole.log('-----------')\nconsole.log('Make: ' + car.make)\nconsole.log('Model: ' + car.model)\nconsole.log('Color: ' + car.color)\nconsole.log('Mileage: ' + car.mileage)\nconsole.log('Is working: ' + car.isWorking)\nconsole.log('-----------')\n}", "write() {\n let pageWiseSorted = this.sortPageWise(this.annotations);\n let ptr = this.data.length;\n let new_data = [];\n // Fix case that there is no linebreak after the end of the file\n if (this.data[ptr - 1] === 70) { // 70 = 'F' (from [%%EO]F\n new_data.push(Writer.CR);\n new_data.push(Writer.LF);\n ptr += 2;\n }\n for (let key in pageWiseSorted) {\n let pageAnnots = pageWiseSorted[key];\n // write the array referencing to annotations of a certain page\n // it also removes references of annotations that must be deleted\n let annot_array = this.writeAnnotArray(pageAnnots, this.toDelete);\n this.xrefs.push({\n id: annot_array.ptr.obj,\n pointer: ptr,\n generation: annot_array.ptr.generation,\n free: false,\n update: true\n });\n new_data = new_data.concat(annot_array.data);\n ptr += annot_array.data.length;\n // add adapted page object if it exists -- In the case the page had no annotation yet there exists\n // no such array referring to its annotations. A pointer to such an array must be added to the\n // page object. If this was done the `pageData` paramater is set and contains the adapted page object\n if (annot_array.pageData.length > 0) {\n this.xrefs.push({\n id: annot_array.pageReference.obj,\n pointer: ptr,\n generation: annot_array.pageReference.generation,\n free: false,\n update: true\n });\n new_data = new_data.concat(annot_array.pageData);\n ptr += annot_array.pageData.length;\n }\n // writes the actual annotation object\n for (let annot of pageAnnots) {\n let annot_obj = this.writeAnnotationObject(annot);\n this.xrefs.push({\n id: annot_obj.ptr.obj,\n pointer: ptr,\n generation: annot_obj.ptr.generation,\n free: false,\n update: true\n });\n new_data = new_data.concat(annot_obj.data);\n ptr += annot_obj.data.length;\n }\n }\n // take all annotations that are not deleted yet\n let _toDelete = this.toDelete.filter((t) => !t.is_deleted);\n let pageWiseSortedToDelete = this.sortPageWise(_toDelete);\n // adapt the remaining annotation reference tables\n for (let key in pageWiseSortedToDelete) {\n let del_data = this.updatePageAnnotationReferenceArray(pageWiseSortedToDelete[key]);\n this.xrefs.push({\n id: del_data.ptr.obj,\n pointer: ptr,\n generation: del_data.ptr.generation,\n free: false,\n update: true\n });\n new_data = new_data.concat(del_data.data);\n ptr += del_data.data.length;\n }\n // at this point all references to annotation objects in pages should be removed and we can free\n // the annotation object ids\n for (let toDel of this.toDelete) {\n if (!toDel.object_id)\n continue;\n this.xrefs.push({\n id: toDel.object_id.obj,\n pointer: -1,\n generation: toDel.object_id.generation + 1,\n free: true,\n update: false\n });\n }\n let crtable = this.writeCrossSiteReferenceTable();\n new_data = new_data.concat(crtable);\n let trailer = this.writeTrailer(ptr);\n new_data = new_data.concat(trailer);\n let new_data_array = new Uint8Array(new_data);\n let ret_array = new Uint8Array(this.data.length + new_data_array.length);\n ret_array.set(this.data);\n ret_array.set(new_data, this.data.length);\n return ret_array;\n }", "writeLog() {\n\t\tlet output = this.buildOutputProgress();\n\n\t\tif (!this.firstWriting) {\n\t\t\tthis.charm.move(0, -1).erase('end');\n\t\t\tthis.charm.move(0, -1).erase('end');\n\t\t\tthis.charm.move(0, -1).erase('end');\n\t\t\tthis.charm.move(0, -1).erase('end');\n\t\t}\n\n\t\tthis.firstWriting = false;\n\n\t\tthis.charm.write(output);\n\t}", "function uglifyScripts(){\n var uglified = uglify.minify(getScripts());\n fs.writeFile(path.join(__dirname, '../', 'preload/scripts.js'), uglified.code, function (err){\n if(err) {\n console.log(err);\n } else {\n console.log(\"Scripts combined, minified and saved in:\", 'scripts.js');\n }\n });\n}", "function newLine() {\n startofLine = true;\n\n logBody.push(\"newLine\")\n logBody.push(`startofLine -> ${startofLine}`)\n }", "write (line) {\n fs.appendFile(this._fullName, '\\n' + line, function (err) {\n if (err) {\n console.log('Write log failed: ' + JSON.stringify(err))\n console.log('Failed log: ' + line)\n }\n })\n }", "function writeResults() {\n logger.trace(\"Starting to write results to file\");\n\n // A boolean to indicate if the writing is backed up\n var writeOK = true;\n\n // Loop over the rows watching for write backups\n do {\n // Now write it to the file\n writeOK = sourceStream.write(result.rows[i]['epochseconds'] + ',' +\n result.rows[i]['timestamp_utc'] + ',' + result.rows[i]['string_agg'] + '\\n');\n\n // Bump the counter\n i++;\n } while (i < numRows && writeOK);\n\n // Check to see if all the writes are done\n if (i < numRows) {\n logger.trace(\"Writing stopped at line \" + i + \" will wait for drain\");\n\n // Since not done, set up a handler to watch for the buffer to\n // drain and then start writing again\n sourceStream.once('drain', writeResults);\n } else {\n logger.info(\"All done writing to file, will end the write stream\");\n sourceStream.end();\n }\n }", "function SourceMap(){\n this.lines = [];\n }", "function goalLinesOpen()\n{\n goalLineDifference = goalLineDifference + 1;\n}", "function setTimestamp(){\r\n timestamps[ 'styles'] = Date.now();\r\n console.log(\"in setTimestamp function - created json for styles with \" + timestamps['style']);\r\n\r\n return file(\r\n 'timestamps.json',\r\n JSON.stringify(timestamps, null, 2),\r\n {src : true}\r\n )\r\n .pipe(gulp.dest('./conf/timestamps/'));\r\n}", "function saveAllTranscriptEntries () {\n saveTranscriptEntries([1, 2, 3, 4]);\n}", "function startCopyIntervals(){\n setInterval(function(){\n copyPartialOutput();\n exec(`cp offsets.csv ${outputDir}/offsets.csv`, (error) => {\n if (error) {\n console.error(`Offset copy error: ${error}`);\n return;\n }\n console.log(`${new Date().toString()}: Successfully copied offsets to home directory`);\n });\n }, copyInterval);\n}", "function reWriteStats() {\n\n targetNumber = Math.floor(Math.random() * (120 - 19 + 1)) + 19;\n //console.log('Reset targetNumber: ' + targetNumber);\n $('#target-number').text(targetNumber);\n\n playerCounter = 0;\n //$('#player-score').empty();\n\n //$('#game-round-alert').empty();\n\n assignToImages();\n \n }", "async function writeHistory() {\n\tlet translations = await HON_DB.allDocs({ include_docs: true} );\n\tlet entries = translations.rows.length - 1\n\t\t, i = 0, o, t;\n\tlet sources = await SRC_DB.allDocs({ \n\t\tinclude_docs: true,\n\t\tlimit: entries + 1\n\t} );\n\t// console.log(sources);\n\tfor ( i; i <= entries; i++ ) {\n\t\to = sources.rows[i];\n\t\tt = translations.rows[i];\n\t\tlet section = document.createElement('SECTION')\n\t\t\t, h2 = document.createElement('H2')\n\t\t\t, h3 = document.createElement('H3');\n\t\th2.innerText = o.doc.sentence;\n\t\th3.innerText = t.doc.text;\n\t\tsection.appendChild(h2);\n\t\tsection.appendChild(h3);\n\t\tif (document.body.children.length > 0)\n\t\t\tdocument.body.insertBefore(section, document.body.firstChild);\n\t\telse \n\t\t\tdocument.body.appendChild(section);\n\t}\n}", "function attachJavaScriptFileUpdate(fileURL) {\n\tif(minifiedJS) fileURL = fileURL.replace(\".js\", \".min.js\");\n\tif(cachingOnOff) { fileURL = fileURL+\"?v=\"+appVersion;} \n\t$.cachedScript(\"javascripts/renderScripts/update/\"+ minifiedDir + fileURL).done(function(script, textStatus) {\n\t});\n}", "function outputAndLog(commend) {\n appendToFile(commend);\n console.log(commend);\n}", "function copyTabSources() {\n text = \"\";\n sourceBuffer.forEach((elem) => {\n text += \n elem.repoId + \"\\t\" +\n elem.sourceId + \"\\t\" +\n elem.linesInFile + \"\\t\" +\n elem.sourceUrl + \"\\n\"\n });\n textArea = document.getElementById(\"copyText\");\n textArea.value = text;\n textArea.focus();\n textArea.select();\n}", "function jscoverage_recalculateSourceTab() {\n\tif (! jscoverage_currentFile) {\n\t\tjscoverage_endLengthyOperation();\n\t\treturn;\n\t}\n\tProgressBar.setPercentage(20, 'Calculating coverage ...');\n\tvar request = new XMLHttpRequest();\n\tvar projectBase = document.body.getAttribute('base');\n\trequest.open('GET', projectBase.substr(0, projectBase.length - 1) + jscoverage_currentFile, true);\n\n\trequest.onload = function() {\n\t\t// if (request.status >= 200 && request.status < 400) {\n\t\tif (request.status !== 0 && request.status !== 200) {\n\t\t\treturn reportError(new Error(request.status));\n\t\t}\n\t\t// if (this.status >= 200 && this.status < 400)\n\n\t\tvar response = request.responseText;\n\t\tvar displaySource = function() {\n\t\t\t\tvar lines = response.split(/\\n/);\n\t\t\t\tfor (var i = 0; i < lines.length; i++)\n\t\t\t\t\t\tlines[i] = $('<div>').text(lines[i]).html();\n\t\t\t\tjscoverage_makeTable(lines);\n\t\t}\n\t\tsetTimeout(displaySource, 0);\n\t};\n\n\trequest.onerror = function(e) {\n\t\treportError(e);\n\t};\n\n\trequest.send();\n}", "function lineMouseOutHandler() {\n for (i = 0; i < dynamicFileList.length; i++) {\n var id = filenameToId(dynamicFileList[i]);\n if (\"line\" + id != this.id) {\n turnOn(filenameToId(dynamicFileList[i]), colorMap.get(id));\n\n }\n }\n}", "_copyTemplateFile(sourcePath, destinationPath) {\n if (!this._overwriteParameter.value) {\n if (node_core_library_1.FileSystem.exists(destinationPath)) {\n console.log(colors.yellow('Not overwriting already existing file: ') + destinationPath);\n return;\n }\n }\n if (node_core_library_1.FileSystem.exists(destinationPath)) {\n console.log(colors.yellow(`Overwriting: ${destinationPath}`));\n }\n else {\n console.log(`Generating: ${destinationPath}`);\n }\n const outputLines = [];\n const lines = node_core_library_1.FileSystem.readFile(sourcePath, { convertLineEndings: \"\\n\" /* Lf */ })\n .split('\\n');\n let activeBlockSectionName = undefined;\n let activeBlockIndent = '';\n for (const line of lines) {\n let match;\n // Check for a block section start\n // Example: /*[BEGIN \"DEMO\"]*/\n match = line.match(InitAction._beginMacroRegExp);\n if (match) {\n if (activeBlockSectionName) {\n // If this happens, please report a Rush bug\n throw new Error(`The template contains an unmatched BEGIN macro for \"${activeBlockSectionName}\"`);\n }\n activeBlockSectionName = match[2];\n activeBlockIndent = match[1];\n // Remove the entire line containing the macro\n continue;\n }\n // Check for a block section end\n // Example: /*[END \"DEMO\"]*/\n match = line.match(InitAction._endMacroRegExp);\n if (match) {\n if (activeBlockSectionName === undefined) {\n // If this happens, please report a Rush bug\n throw new Error(`The template contains an unmatched END macro for \"${activeBlockSectionName}\"`);\n }\n if (activeBlockSectionName !== match[2]) {\n // If this happens, please report a Rush bug\n throw new Error(`The template contains an mismatched END macro for \"${activeBlockSectionName}\"`);\n }\n if (activeBlockIndent !== match[1]) {\n // If this happens, please report a Rush bug\n throw new Error(`The template contains an inconsistently indented section \"${activeBlockSectionName}\"`);\n }\n activeBlockSectionName = undefined;\n // Remove the entire line containing the macro\n continue;\n }\n let transformedLine = line;\n // Check for a single-line section\n // Example: /*[LINE \"HYPOTHETICAL\"]*/\n match = transformedLine.match(InitAction._lineMacroRegExp);\n if (match) {\n const sectionName = match[1];\n const replacement = this._isSectionCommented(sectionName) ? '// ' : '';\n transformedLine = transformedLine.replace(InitAction._lineMacroRegExp, replacement);\n }\n // Check for variable expansions\n // Example: [%RUSH_VERSION%]\n while (match = transformedLine.match(InitAction._variableMacroRegExp)) {\n const variableName = match[1];\n const replacement = this._expandMacroVariable(variableName);\n transformedLine = transformedLine.replace(InitAction._variableMacroRegExp, replacement);\n }\n // Verify that all macros were handled\n match = transformedLine.match(InitAction._anyMacroRegExp);\n if (match) {\n // If this happens, please report a Rush bug\n throw new Error('The template contains a malformed macro expression: ' + JSON.stringify(match[0]));\n }\n // If we are inside a block section that is commented out, then insert the \"//\" after indentation\n if (activeBlockSectionName !== undefined) {\n if (this._isSectionCommented(activeBlockSectionName)) {\n // Is the line indented properly?\n if (transformedLine.substr(0, activeBlockIndent.length).trim().length > 0) {\n // If this happens, please report a Rush bug\n throw new Error(`The template contains inconsistently indented lines inside`\n + ` the \"${activeBlockSectionName}\" section`);\n }\n // Insert comment characters after the indentation\n const contentAfterIndent = transformedLine.substr(activeBlockIndent.length);\n transformedLine = activeBlockIndent + '// ' + contentAfterIndent;\n }\n }\n outputLines.push(transformedLine);\n }\n // Write the output\n node_core_library_1.FileSystem.writeFile(destinationPath, outputLines.join('\\r\\n'), {\n ensureFolderExists: true\n });\n }", "function Update () {\n//System.IO.File.AppendAllText(fileLocation + \"/DINGBAT2.txt\", ArduinoValue.ToString());\n//System.IO.File.AppendAllText(fileLocation + \"/DINGBAT2.txt\", \" \" + Time.time.ToString());\nif (!CreatedFile){\n//print(\"file Not created!\");\nreturn;}\nelse{\nWriteDatatoFile();\n//srs.Close();\n}\n}", "function pumpLorem(cycles){\n\tconsole.log('2s');\n\tvar fakeText = '\\n Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perspiciatis explicabo aperiam commodi, soluta et facere illum delectus esse ut at, repellat modi! Odit quis omnis ea quod, eaque sequi quia.\\n'\n\tconsole.log(cycles);\n\n\tfor (var i = 1; i <= cycles; i++) {\n\t\tconsole.log('3s');\n\t\tif(i === 1){\n\n\t\t\tfs.writeFileSync(readFileName, fakeText); // fs.writeFile\n\t\t\tconsole.log(i);\n\t\t} else {\n\t\t\t\n\t\t\tfs.appendFileSync(readFileName, fakeText);\n\t\t\tconsole.log(i);\n\n\t\t} // else\n\n\t}\n\n\tconsole.log('file finished');\n\n\n}", "function recordInDB_file_created(file, str) {\n if (file.search(\"select-27.csv\") == -1) return;\n var updated_file_content = \"\";\n var lines = str.split(\"\\n\");\n for (var i = 0; i < lines.length; i++) {\n (function (i) {\n if (lines[i].substring(0, 2) == \"@@\") {\n updated_file_content = updated_file_content + \"+\" + lines[i + 1].substring(1, lines[i + 1].length) + \"\\n\";\n for (var k = i + 2; k < lines.length; k++) {\n (function (k) {\n //console.log(\"\\n\" + lines[k] + \"\\n\");\n var line_content = lines[k].split(\",\");\n //if (line_content.length == 11) {\n if (line_content.length == 11 && line_content[3] != \"------\") {\n var customer_id = line_content[0].substring(1, line_content[0].length);\n var customer_code = line_content[1];\n var customer_name = line_content[2];\n var env_id = line_content[3];\n var env_code = line_content[4];\n var env_name = line_content[5];\n var deployment_id = line_content[6];\n var failed_deployment = line_content[7];\n var deployment_started = line_content[8];\n var time_queried = line_content[9];\n var already_running_in_minutes = line_content[10];\n\n //console.log(contentStr);\n const link = getModelTLink(file, deployment_id);\n // INSERT\n // notification email content by line\n updated_file_content = updated_file_content + \"+\" + lines[k].substring(1, lines[k].length) + \"\\n\" + link + \"\\n\";\n // INSERT\n var document = {\n DBTime: Date(),\n ChangedFile: file,\n ChangeType: \"Insert\",\n CustomerID: customer_id,\n CustomerCode: customer_code,\n CustomerName: customer_name,\n EnvID: env_id,\n EnvCode: env_code,\n EnvName: env_name,\n DeploymentID: deployment_id,\n FailedDeployment: failed_deployment,\n DeploymentStarted: deployment_started,\n TimeQueried: time_queried,\n AlreadyRunningInMinutes: already_running_in_minutes,\n Link: link,\n DeleteTime: \"/\"\n };\n MongoClient.connect(DB_CONN_STR, {\n useNewUrlParser: true,\n useUnifiedTopology: true\n }, function (err, db) {\n if (err) console.log(err);\n console.log(Date() + \"\\nDatabase Connected! ---- TO INSERT WHOLE FILE LINES\\n\");\n var dbo = db.db(\"sap-cx\");\n var collection = dbo.collection(\"CCv2LongRunningDeployment\");\n collection.insertOne(document, function (err, result) {\n if (err) console.log(err);\n //console.log(result);\n db.close();\n });\n });\n }\n })(k);\n }\n }\n })(i);\n }\n // send notification email\n sendNotificationEmail(file, 0, updated_file_content)\n}", "function appendReloadClientCode (file, next) {\n fs.readFile(file, 'utf8', function (err, contents) {\n if (err) {\n next(null)\n }\n var reloadClientCode = reloadReturned.reloadClientCode()\n\n contents += '\\n\\n<!-- Inserted by Reload -->\\n<script>' + reloadClientCode + '</script>\\n<!-- End Reload -->\\n'\n\n next(contents)\n })\n}", "_flush() {\n this.push(this.contents);\n this.emit('end')\n }", "function outputTrackingVersion(file, jsonData, isRtl){\r\n\t\t if(isRtl) {\r\n\t\t jsonData.metadata = jsonData.metadata.replace(lsDownAppStart, trackingStartRTL);\r\n\t\t jsonData.metadata = jsonData.metadata.replace(lsDownAppEnd, trackingEndRTL);\r\n\t\t }\r\n\t\t else {\r\n\t\t jsonData.metadata = jsonData.metadata.replace(lsDownAppStart, trackingStartLTR);\r\n\t\t jsonData.metadata = jsonData.metadata.replace(lsDownAppEnd, trackingEndLTR);\r\n\t\t }\r\n fs.outputFileSync(dest + file.replace('.html', '-tracking.json'), JSON.stringify(jsonData), 'utf-8');\r\n\t\t}", "_writeNewContent() {\n this.packageJsonContent.version = this._formatVersion()\n fs.writeFileSync(packagePath, JSON.stringify(this.packageJsonContent, null, 2))\n }", "writeln(txt) {\n\n this.fileOut.write(txt + \"\\n\")\n\n }", "function storeHistory() {\n var f = ioFile.open(historyOutFile, \"w\");\n f.write(JSON.stringify(history));\n f.close();\n if (debug)\n console.log(\"Have stored history to \" + historyOutFile);\n }", "location() {\n return `File: ${this._fileName}, Line: ${this._lineNum}`;\n }", "function newLine(){\n $(settings.el).delay(settings.speed).queue(function (next){\n var currTextNoCurr = $(this).html().substring(0, $(this).html().length - 1);\n $(this).html(currTextNoCurr + '<br>');\n next();\n\n // we are done, remove from queue\n settings.queue = settings.queue - 1;\n $(settings.mainel).trigger('typewriteNewLine');\n });\n }", "function logged() {\r\n this._size += bytes;\r\n this._pendingSize -= bytes;\r\n\r\n debug('logged %s %s', this._size, output);\r\n this.emit('logged', info);\r\n\r\n // Do not attempt to rotate files while opening\r\n if (this._opening) {\r\n return;\r\n }\r\n\r\n // Check to see if we need to end the stream and create a new one.\r\n if (!this._needsNewFile()) {\r\n return;\r\n }\r\n\r\n // End the current stream, ensure it flushes and create a new one.\r\n // This could potentially be optimized to not run a stat call but its\r\n // the safest way since we are supporting `maxFiles`.\r\n this._rotate = true;\r\n this._endStream(() => this._rotateFile());\r\n }", "async _write() {\n if (this._writing) return;\n\n // Loop because items may get pushed onto queue while we're writing\n while (this._queue) {\n let q = this._queue;\n const {resolve, reject} = q;\n delete this._queue;\n this._writing = true;\n try {\n // Slice to most recent CLEAR action\n const clearIndex = q.reduce ((a, b, i) => b[0] === CLEAR ? i : a, -1);\n if (clearIndex >= 0) q = q.slice(clearIndex + 1);\n\n // Compose JSON to write\n const json = q.map(action => JSON.stringify(action)).join('\\n');\n\n if (clearIndex >= 0) {\n // If CLEAR, start with new file\n this._nBytes = 0;\n if (!json) {\n await fs.unlink(this.filepath);\n } else {\n const tmpFile = `${this.filepath}.tmp`;\n await fs.writeFile(tmpFile, json + '\\n');\n await fs.rename(tmpFile, this.filepath);\n }\n } else if (json) {\n await fs.appendFile(this.filepath, json + '\\n');\n }\n\n this._nBytes += json.length;\n resolve();\n } catch (err) {\n if (err.code == 'ENOENT') {\n // unlinking non-existent file is okay\n resolve(err);\n } else {\n reject(err);\n }\n } finally {\n this._writing = false;\n }\n }\n }", "function writeFile(params){\n var filename = params[0];\n var data = params[2]\n if (typeof data === \"object\"){\n data = params[2].join(\" \");\n }\n var fileFound = false;\n var sections = Math.ceil(data.length/60);\n //console.log(data)\n var dataSections = data.match(/.{1,60}/g) || [];\n\n var i = \"001\";\n while(!fileFound){\n if (filename === sessionStorage.getItem(i).split(FILE_DIVIDER)[1].split(FILE_FILLER.substr(0,1))[0]){\n fileFound = true;\n var dataLocation = sessionStorage.getItem(i).split(FILE_DIVIDER)[0].substr(1);\n var linkEnds = false;\n\n while(sections>0){\n var data = dataSections.shift();\n var re = new RegExp(\"^.{\"+data.length+\"}\");\n var linkExists = sessionStorage.getItem(dataLocation).substring(1,4);\n\n sessionStorage.setItem(dataLocation,\"1---\"+FILE_DIVIDER+FILE_FILLER);\n var replacedData = sessionStorage.getItem(dataLocation).substring(5).replace(re,data);\n\n if(sections === 1){\n sessionStorage.setItem(dataLocation,\"1---\"+FILE_DIVIDER+replacedData);\n }\n else{\n if(isNaN(linkExists)){\n nextDataSection = sessionStorage.getItem(MBR).substring(8,11);\n newDataSection = stringFormatAndInc(nextDataSection);\n sessionStorage.setItem(MBR,sessionStorage.getItem(MBR).replace(nextDataSection,newDataSection));\n }\n else{\n nextDataSection = linkExists\n }\n sessionStorage.setItem(dataLocation,\"1\"+nextDataSection+FILE_DIVIDER+replacedData);\n dataLocation = nextDataSection;\n }\n sections--;\n }\n if(params[3]){ //if FROM_OS == 1\n //no output necessary\n }\n else{ // then from user\n _StdIn.putText(\"Write succeeded\");\n _StdIn.advanceLine();\n _OsShell.putPrompt();\n }\n }\n i = stringFormatAndInc(i);\n if (i === \"078\"){\n _StdIn.putText(\"File not found\");\n _StdIn.advanceLine();\n _OsShell.putPrompt();\n break;\n }\n }\n updateMBR();\n}", "saveAsMultipleFiles() {\r\n // Load the needed data for text file exportation\r\n let head = this.editorHTML.getValue().substr(0, this.editorHTML.getValue().indexOf('</head>')-1)\r\n let style = '\\n\\t<link rel=\"stylesheet\" href=\"style.css\">'\r\n let chead = '\\n</head>\\n'\r\n let bodyTag = this.editorHTML.getValue().indexOf('<body>')\r\n let bodyLines = this.editorHTML.getValue().substr(bodyTag)\r\n let html = bodyLines.substr(0, bodyLines.length-15)\r\n let script = '\\t<script src=\"script.js\"></script>\\n'\r\n let endDoc = '</body>\\n</html>'\r\n \r\n let todo = head\r\n \r\n // CSS exportation\r\n if (this.editorCSS.getValue().length > 0) {\r\n todo += style\r\n this.saveFile('style', 'CSS', this.editorCSS.getValue())\r\n }\r\n\r\n todo += chead\r\n todo += html\r\n\r\n // JS exportation\r\n if (this.editorJS.getValue().length > 0) {\r\n todo += script\r\n this.saveFile('script', 'JS', this.editorJS.getValue())\r\n }\r\n\r\n todo += endDoc\r\n\r\n // HTML exportation\r\n this.saveFile('index', 'HTML', todo)\r\n // We show the export result\r\n setTimeout(this.showOutput, 2500)\r\n\r\n }", "function uglifyWithCopyrights() {\n\tvar currentFileHasOurCopyright = false;\n\n\tvar onNewFile = function() {\n\t\tcurrentFileHasOurCopyright = false;\n\t};\n\n\tvar preserveComments = function(node, comment) {\n\t\tvar text = comment.value;\n\t\tvar type = comment.type;\n\n\t\tif (/@minifier_do_not_preserve/.test(text)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar isOurCopyright = IS_OUR_COPYRIGHT_REGEXP.test(text);\n\n\t\tif (isOurCopyright) {\n\t\t\tif (currentFileHasOurCopyright) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tcurrentFileHasOurCopyright = true;\n\t\t\treturn true;\n\t\t}\n\n\t\tif ('comment2' === type) {\n\t\t\t// check for /*!. Note that text doesn't contain leading /*\n\t\t\treturn (text.length > 0 && text[0] === '!') || /@preserve|license|@cc_on|copyright/i.test(text);\n\t\t} else if ('comment1' === type) {\n\t\t\treturn /license|copyright/i.test(text);\n\t\t}\n\t\treturn false;\n\t};\n\n\tvar uglifyStream = uglify({ preserveComments: preserveComments });\n\n\treturn es.through(function write(data) {\n\t\tvar _this = this;\n\n\t\tonNewFile();\n\n\t\tuglifyStream.once('data', function(data) {\n\t\t\t_this.emit('data', data);\n\t\t})\n\t\tuglifyStream.write(data);\n\t}, function end() {\n\t\tthis.emit('end')\n\t});\n}", "function end() {\n return src.join(\"\\n\");\n }", "evictOldestLine() {\r\n let lineNum = this.findOldestLine()\r\n let line = this.cacheLines[lineNum]\r\n if(line.state == States.MODIFIED) {\r\n this.bus.placeWriteBack(this, line.tag, this.numberOfAddressBits, line.values)\r\n }\r\n\tthis.setState(lineNum, States.INVALID) // will be changed short after anyway\r\n return lineNum\r\n }", "_exportToText() {\n fs.writeFileSync(this.pathTemplate, '', 'utf-8');\n this.records.forEach(submitTime => fs.appendFileSync(this.pathTemplate, `${submitTime}\\n`));\n }", "function addRestOfCode(finalCode){\n for (let i=countOld; i<code.length ; i++){\n finalCode.push({Line: code[i]});\n }\n}", "function saveGrid() {\r\n var snapshot = [];\r\n for (var i=0; i<lineSegments.length; ++i) {\r\n snapshot.push(lineSegments[i].clone());\r\n }\r\n history.push({'lineSegments':snapshot});\r\n}", "evictOldestLine() {\r\n let lineNum = this.findOldestLine()\r\n let line = this.cacheLines[lineNum]\r\n if(line.state == States.MODIFIED || line.state == States.OWNED) {\r\n this.bus.placeWriteBack(this, line.tag, this.numberOfAddressBits, line.values)\r\n }\r\n\tthis.setState(lineNum, States.INVALID) // will be changed short after anyway\r\n return lineNum\r\n }", "evictOldestLine() {\r\n let lineNum = this.findOldestLine()\r\n let line = this.cacheLines[lineNum]\r\n if(line.state == States.MODIFIED) {\t\t\r\n this.bus.placeWriteBack(this, line.tag, this.numberOfAddressBits, line.values)\r\n }\r\n\tthis.setState(lineNum, States.INVALID)\r\n return lineNum\r\n }", "function emitEachLine(self, fileName, lines) {\n\tfor (var i = 0; i < lines.length; i++) {\n\t\tself.emit('line', fileName, lines[i]);\n\t}\n}", "function $EiDS$var$flush() {\n $EiDS$var$inserted = $EiDS$var$styleSheet.inserted = {};\n $EiDS$var$registered = $EiDS$var$styleSheet.registered = {};\n $EiDS$var$ruleCache = {};\n $EiDS$var$styleSheet.flush();\n $EiDS$var$styleSheet.inject();\n}", "function noInitLocals(currentLine){\n if (newVarLine==true) {\n countInitVars = currentLine.split(',').length;\n newVarLine=false;\n }\n\n if (countInitVars==1) {\n countOld++;\n newVarLine=true;\n }\n else\n countInitVars--;\n\n}", "function dailyQuoteShown() {\n // get quoteHandler JSON\n let quoteHandler = fs.readFileSync(quotesHandlerDirectory);\n quoteHandler = JSON.parse(quoteHandler);\n\n // increment iterator if there is a new date and update iterator in JSON-file\n let today = new Date().getDate();\n \n if (quoteHandler.quoteShownOnDate != today) {\n quoteHandler.quoteIterator += 1;\n\n // set iterator to 0 and shuffle quotes when last quote has been shown\n if (quoteHandler.quoteIterator == quotes.length) {\n quoteHandler.quoteIterator = 0;\n shuffleQuotes();\n }\n\n // write to file\n quoteHandler = JSON.stringify(quoteHandler);\n fs.writeFileSync(quotesHandlerDirectory, quoteHandler);\n }\n }", "recordChanges() {\n this.updatedImports.forEach((expressions, importDecl) => {\n const sourceFile = importDecl.getSourceFile();\n const recorder = this.getUpdateRecorder(sourceFile);\n const namedBindings = importDecl.importClause.namedBindings;\n const newNamedBindings = ts.updateNamedImports(namedBindings, namedBindings.elements.concat(expressions.map(({ propertyName, importName }) => ts.createImportSpecifier(propertyName, importName))));\n const newNamedBindingsText = this.printer.printNode(ts.EmitHint.Unspecified, newNamedBindings, sourceFile);\n recorder.updateExistingImport(namedBindings, newNamedBindingsText);\n });\n }", "function initializeOutput() {\r\n HTML_output = new java.io.FileWriter(\"active-hits/shortn-results.\" + soylentJob + \".html\");\r\n lag_output = new java.io.FileWriter(\"active-hits/shortn-\" + soylentJob + \"-fix_errors_lag.csv\");\r\n lag_output.write(\"Stage,Assignment,Wait Type,Time,Paragraph\\n\");\r\n payment_output = new java.io.FileWriter(\"active-hits/shortn-\" + soylentJob + \"-fix_errors_payment.csv\");\r\n payment_output.write(\"Stage,Assignment,Cost,Paragraph\\n\");\r\n patchesOutput = new java.io.FileWriter(\"active-hits/shortn-patches.\" + soylentJob +\".json\");\r\n}", "function writeLine() {\n var log = journal.shift();\n if (!log) { return; }\n var line = log.entry;\n\n // use a buffer for the 'scroll' effect\n if (5 === displayBuffer.length) {\n displayBuffer.shift();\n }\n displayBuffer.push(line);\n\n // render the buffer\n c.font = '36px Papyrus, fantasy';\n c.fillStyle = '#001f3f';\n c.fillRect(0, 0, a.width, a.height);\n c.fillStyle = '#01FF70'\n displayBuffer.forEach(function(line, idx) {\n // (x, y, line height)\n c.fillText(line, 100, 100 + (idx * 75));\n });\n\n setTimeout(writeLine, log.delay);\n }", "save() {\n // We read the file everytime we need to modify it\n fs.readFile(p, (err, data) => {\n let activities = [];\n if (!err) {\n activities = JSON.parse(data);\n }\n activities.push(this);\n // Write the file\n fs.writeFile(p, JSON.stringify(activities), (err) => console.log(err));\n })\n }", "function recordInDB_file_modified(file, str) {\n if (file.search(\"select-27.csv\") == -1) return;\n readFileToArr('./modelt-az-report-repository/' + file, function (file_content) {\n var updated_file_content = file_content[0].join(\",\") + \"\\n\\n\";\n //console.log(\"\\n\\n*********************************\\n\" + updated_file_content + \"***************************************\\n\\n\");\n var lines = str.split(\"\\n\");\n for (var i = 0; i < lines.length; i++) {\n (function (i) {\n if (lines[i].substring(0, 2) == \"@@\") {\n for (var k = i + 1; k < lines.length; k++) {\n (function (k) {\n //console.log(\"\\n\" + lines[k] + \"\\n\");\n if (lines[k][0] == \"+\" || lines[k][0] == \"-\") {\n var line_content = lines[k].split(\",\");\n if (line_content.length == 11 && line_content[3] != \"------\") {\n var customer_id = line_content[0].substring(1, line_content[0].length);\n var customer_code = line_content[1];\n var customer_name = line_content[2];\n var env_id = line_content[3];\n var env_code = line_content[4];\n var env_name = line_content[5];\n var deployment_id = line_content[6];\n var failed_deployment = line_content[7];\n var deployment_started = line_content[8];\n var time_queried = line_content[9];\n var already_running_in_minutes = line_content[10];\n\n var contentStr = {\n ChangedFile: file,\n ChangeType: {$ne: \"Delete\"},\n CustomerID: customer_id,\n EnvID: env_id,\n DeploymentID: deployment_id,\n };\n\n //console.log(contentStr);\n const link = getModelTLink(file, deployment_id);\n // SUB\n // -: update DB\n if (lines[k][0] == \"+\") {\n updated_file_content = updated_file_content + \"-\" + lines[k].substring(1, lines[k].length) + \"\\n\" + link + \"\\n\";\n\n MongoClient.connect(DB_CONN_STR, {\n useNewUrlParser: true,\n useUnifiedTopology: true\n }, function (err, db) {\n if (err) console.log(err);\n console.log(Date() + \"\\nDatabase Connected! ---- TO DELETE A LINE IN FILE\\n\");\n var dbo = db.db(\"sap-cx\");\n var collection = dbo.collection(\"CCv2LongRunningDeployment\");\n collection.updateOne(\n contentStr, {\n $set: {\n ChangeType: \"Delete\",\n DeleteTime: Date()\n }\n }, function (err, result) {\n if (err) console.log(err);\n //console.log(result);\n });\n db.close();\n });\n }\n // ADD\n // +: insert / update DB\n else if (lines[k][0] == \"-\") {\n // notification email content by line\n updated_file_content = updated_file_content + \"+\" + lines[k].substring(1, lines[k].length) + \"\\n\" + link + \"\\n\";\n // INSERT\n var document = {\n DBTime: Date(),\n ChangedFile: file,\n ChangeType: \"Insert\",\n CustomerID: customer_id,\n CustomerCode: customer_code,\n CustomerName: customer_name,\n EnvID: env_id,\n EnvCode: env_code,\n EnvName: env_name,\n DeploymentID: deployment_id,\n FailedDeployment: failed_deployment,\n DeploymentStarted: deployment_started,\n TimeQueried: time_queried,\n AlreadyRunningInMinutes: already_running_in_minutes,\n Link: link,\n DeleteTime: \"/\"\n };\n MongoClient.connect(DB_CONN_STR, {\n useNewUrlParser: true,\n useUnifiedTopology: true\n }, function (err, db) {\n if (err) console.log(err);\n console.log(Date() + \"\\nDatabase Connected! ---- TO INSERT A FILE LINE\\n\");\n var dbo = db.db(\"sap-cx\");\n var collection = dbo.collection(\"CCv2LongRunningDeployment\");\n collection.insertOne(document, function (err, result) {\n if (err) console.log(err);\n //console.log(result);\n db.close();\n });\n });\n }\n }\n }\n })(k);\n }\n }\n })(i);\n }\n // send notification email\n sendNotificationEmail(file, 2, updated_file_content);\n });\n}", "dump() {\n if (this._updated) {\n if (!this._updated)\n return;\n let traces = this._cache;\n this._cache = [];\n this.save(traces, (err) => {\n if (err) {\n // Adds traces back to the cache\n traces.push(...this._cache);\n this._cache = traces;\n // Truncate cache\n let deleteCount = this._cache.length - this._maxCacheSize;\n if (deleteCount > 0)\n this._cache.splice(0, deleteCount);\n }\n });\n this._updated = false;\n this._lastDumpTime = new Date().getTime();\n }\n }", "function writeFiles() {\n this.writeFilesToDisk(reactFiles, this, false, ORIGINAL_REACT_TEMPLATE_PATH); // always originals first\n this.writeFilesToDisk(files, this, false, CURRENT_REACT_TEMPLATE_PATH);\n}", "updatedContentsFor(file) {\n this.activeImports.forEach((item) => item.resetCompiled())\n }", "function savefilecopy() {\n // exact same as the above except the save file has a new guid\n // the file would be safe to send to a friend if you want to send out a copy of your world that they can't modify on the server\n // since there are no accounts, server can't tell who is making modifications, only that the session matches a particular guid\n}", "function saveFile( output, file )\r\n{\r\n // retrieve current file \r\n try {\r\n \r\n var current = loadFile(file);\r\n if ( current == output )\r\n {\r\n //WScript.StdOut.WriteLine( output );\r\n WScript.StdOut.WriteLine( file + \" not changed, skipping ...\"); \r\n return;\r\n }\r\n }\r\n catch(e)\r\n {}\r\n\r\n // create text file for output\r\n var f = fso.CreateTextFile(file, true);\r\n\r\n // write transformation result to file\r\n f.Write(output);\r\n f.Close();\r\n // WScript.StdOut.WriteLine( \"finished writting to \" + file );\r\n}", "evictOldestLine() {\r\n let lineNum = this.findOldestLine()\r\n let line = this.cacheLines[lineNum]\r\n if(line.state == States.MODIFIED || line.state == States.OWNED) {\t\t\r\n this.bus.placeWriteBack(this, line.tag, this.numberOfAddressBits, line.values)\r\n }\r\n\tthis.setState(lineNum, States.INVALID)\r\n return lineNum\r\n }", "function persist_ips() {\n check_outfile();\n if (argv.overwrite && is_file(argv.outFile) && !argv.disableOutFile) {\n //delete the file if it exists\n delete_outfile();\n }\n //\t//This fixes #7, \"add --disable-out-file switch\"\n if (!argv.disableOutFile) {\n ip_hashmap.forEach(function(value, key) {\n \ttry {\n \tvar line;\n \tif(argv.storePort) {\n \t\tline = key +\":\"+value+'\\n';\n \t}\n \telse {\n \t\tline = key+'\\n';\n \t}\n fs.appendFileSync(argv.outFile, line);\n \t}\n \tcatch(e) {\n \t\twinston.error(util.format(\"[FILE] Failed to write to file '%s'\", argv.outFile));\n \t\tthrow {\n name: \"File Error\",\n message: util.format(\"[FILE] The output file '%s' you specified could not be opened.\", argv.outFile),\n };\n \t}\n });\n }\n\n winston.info(util.format(\"Got %d ips\", ip_hashmap.keys().length));\n }", "function writeData() { \n\tconsole.log('writting data')\n\tvar writeStream = fs.createWriteStream(\"oldTweetSentiments.csv\");\n\tvar csvWriteStream = csv.createWriteStream({headers: true});\n\tcsvWriteStream.pipe(writeStream);\n\n\tfor (var i in oldTweetObjs) {\n\n\t\tif (i % 1000 == 0) { console.log(i); }\n\n\t\tvar oldTweet = oldTweetObjs[i];\n\t\tsentimentEngine.processTweet(oldTweet, function(tweetSentiment){\n\t\t\tvar tweetSentimentObj = {\n\t\t\t\t'tweet': tweetSentiment['tweet'],\n\t\t\t\t'state': tweetSentiment['loc']['state'],\n\t\t\t\t'sent': tweetSentiment['sent'],\n\t\t\t\t'subj': tweetSentiment['subj']\n\t\t\t}\n\t\t\tcsvWriteStream.write(tweetSentimentObj);\n\t\t});\n\t}\n\n\tconsole.log('tweets written');\n}", "function nls() {\r\n var input = event_stream_1.through();\r\n var output = input.pipe(event_stream_1.through(function (f) {\r\n var _this = this;\r\n if (!f.sourceMap) {\r\n return this.emit('error', new Error(\"File \" + f.relative + \" does not have sourcemaps.\"));\r\n }\r\n var source = f.sourceMap.sources[0];\r\n if (!source) {\r\n return this.emit('error', new Error(\"File \" + f.relative + \" does not have a source in the source map.\"));\r\n }\r\n var root = f.sourceMap.sourceRoot;\r\n if (root) {\r\n source = path.join(root, source);\r\n }\r\n var typescript = f.sourceMap.sourcesContent[0];\r\n if (!typescript) {\r\n return this.emit('error', new Error(\"File \" + f.relative + \" does not have the original content in the source map.\"));\r\n }\r\n nls.patchFiles(f, typescript).forEach(function (f) { return _this.emit('data', f); });\r\n }));\r\n return event_stream_1.duplex(input, output);\r\n}", "function complete() {\n newFile += '// File Name: _' + name + '.scss' + '\\n';\n newFile += '// Description: ' + themeDesc + '\\n';\n newFile += '// Used by: ' + pageBlock + '\\n';\n newFile += '// Dependencies: \\n';\n newFile += '// Date created: ' + dateTime() + '\\n';\n newFile += '// SassySass v' + version + '\\n';\n newFile += '// ------------------------------------------------------------\\n';\n // check if file already exists\n fs.exists(dir + '/' + themePath + '/_' + name + '.scss', function (exists) {\n if(exists !== true) {\n writeFile();\n }else {\n console.log('The theme ' + name + ' already exists');\n }\n });\n }", "function refresh() {\n // if RESERVE bytes are still available in the buffer, no update is required\n if (buf.length - i >= RESERVE) return;\n\n // CHANGE: now using undefined as an EOF marker, so a bounds check is unneeded\n // // if we're close to the end of the file, start checking for overflow\n // // (we don't do this all the time because the bounds check on every read\n // // causes a significant slowdown, as much as 20%)\n // if (fileLen - (bufOffs + i) < RESERVE) {\n // obj.peek = safePeek;\n // obj.getChar = safeGetChar;\n // }\n\n // if buffer reaches the end of the file, no update is required\n if (bufOffs + buf.length >= fileLen) return;\n\n // fewer than RESERVE bytes are unread in buffer -- update the buffer\n bufOffs += i;\n i = 0;\n buf = reader.readSync(bufOffs, BUFLEN);\n }", "function handleWrite(err, result) {\n if (err) {\n console.log('Error writing'.red);\n console.log(err);\n return;\n }\n\n console.log(('compiled scss in ' + result.stats.duration/1000 + 's').green);\n\n notifier.notify({\n title: taskConfig.name,\n message: 'Compiled scss'\n });\n}", "function saveQueues() {\n console.log(\"Writing timeQueue to file\");\n var link;\n var file = fs.openSync('queue.csv', 'w');\n for (var key in timeQueue) {\n if (!timeQueue.hasOwnProperty(key)) {\n //The current property is not a direct property of p\n continue;\n }\n link = timeQueue[key];\n fs.writeSync(file, link.url + '\\t' + link.domain + '\\n', 'utf8');\n }\n console.log(\"Writing uncrawled queue to file\");\n for (var i = queueIndex; i < queue.length; i++) {\n link = queue[i];\n fs.writeSync(file, link.url + '\\t' + link.domain + '\\n', 'utf8');\n }\n fs.closeSync(file);\n}", "function OutFile() {\r\n}", "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 jsConcat(done) {\n gulp.src(target.js_concat_src) // get the files\n .pipe(plumber({errorHandler: notify.onError({\n title: 'JS error',\n message: \"<%= error.message %>\"\n })}))\n .pipe(gulpif(isProduction, stripDebug()))\n\n // .pipe(stripDebug()) // remove logging\n // .pipe(uglify()) // uglify the files\n .pipe(newer('js/common.js')) // only changed files\n .pipe(concat('common.js')) // concatinate to one file\n // .pipe(babel({\n // presets: ['es2015']\n // }))\n .pipe(gulpif(isProduction, uglify()))\n .on('error', beep)\n .pipe(gulp.dest(target.js_dest)) // where to put the files\n .pipe(browserSync.reload({stream:true, once: true}));\n done();\n}", "function writeFile () {\n while (f.write(parts[i])) {\n if (++i >= parts.length) {\n let lastChunk\n if (errors.length) {\n lastChunk = '\\nErrors:\\n' + errors.join('\\n') + '\\n'\n }\n f.end(lastChunk)\n break\n }\n }\n }", "_updateState() {\n // If we're rendering JIPT text, we're not rendering line numbers so we\n // don't need to update this state.\n if (this.shouldRenderJipt()) {\n return;\n }\n\n this.setState({\n nLines: this._measureLines(),\n startLineNumbersAfter: this._getInitialLineNumber()\n });\n }", "function appendFileObs(filePath, line) {\n filePath = (0, path_2.normalizeTilde)(filePath);\n return _appendFile(filePath, line);\n}", "getFileContents() {\n for (let entry of this.files) {\n entry.data = this.stream.getFixedString(entry.size);\n }\n }", "function jsFn(){\n\tgulp.src(jsDirectory + '*.js')\n\t.pipe( gulpif( !dev , uglify() ) )\n\t.pipe(plumber())\n\t.pipe(gulp.dest(doc+'assets'+'/js'));\n}", "function updateFile() {\n fs.writeFile(\"db/db.json\", JSON.stringify(notes,'\\t'), err => {\n if (err) throw err;\n return true;\n });\n }", "onContentsUpdated() {\n // eslint-disable-next-line no-unused-vars\n const { manifest, files, imports, activeImports } = this\n }", "function writeContent(data){\n\t fs.writeFile('quoteFile_new.txt',data, function(error){\n\t\t if(error){\n\t\t return console.error(error);\n\t\t }\n\t\t console.log(\"=> Brian Tracy's quote shown above is also written to a 'quoteFile_new.txt' file succesfully!\");\n\t\t });\n }", "function watchFiles() {\n\tsync.init({\n\t\topen: 'external',\n\t\tproxy: localsite,\n\t\tport: 8080\n\t});\t\n\n\t//watch for scss file changes\n\twatch(watchCss, buildCSS);\n\t//watch for js file changes\n\twatch(watchJs, series(cleanJS, parallel(buildVarsJS, buildsXHRJS, buildJS), concatJS, parallel(removeJssxhrResidue, removeJsvarsResidue, removeJsResidue)));\n\t//reload browser once changes are made\n\twatch([\n\t\tcssDest + cssOut,\n\t\tjsDest + jsOut,\n\t\twatchPhp \n\t\t]).on('change', sync.reload);\n}", "function cleanJS() {\n\treturn del([jsDest + jsOut]);\n}", "async processJavaScriptFiles(files, dependencyFilename) {\n if (!this.options.copyEnabled) {\n return;\n }\n\n let nodeModules = JavaScriptDependencies.getDependencies(files, true);\n this.writeBundlerDependenciesFile(\n dependencyFilename,\n nodeModules.filter((name) => this.options.excludeDependencies.indexOf(name) === -1)\n );\n\n let localModules = JavaScriptDependencies.getDependencies(files, false);\n // promise\n return this.copyFileList(localModules);\n }", "function injectData(){\n\n let htmlFP=gitParent+'index.html';\n let html=fs.readFileSync(htmlFP);\n\n let s=html.indexOf('<script');\n let h1=html.slice(0,s);\n let h2=html.slice(s);\n\n if (h2.indexOf('let dates')==-1){}\n else{h2=h2.slice(h2.indexOf('</script>')+9)}\n html=h1+'<script>'+'let dates='+JSON.stringify(dates)+';'+'let topics='+JSON.stringify(topics)+';'+'</script>'+h2;\n\n fs.writeFileSync(htmlFP,html,'utf8');\n gitSync();\n }", "update() {\n this._updated = true;\n let now = new Date().getTime();\n if (now > this._lastDumpTime + this._interval) {\n try {\n this.dump();\n }\n catch (ex) {\n // Todo: decide what to do\n }\n }\n }", "function notifySavedResults() {\n console.log('\\n==============================================\\n');\n console.log(\"I've went ahead and query results into log.txt as well!\");\n console.log('\\n==============================================\\n');\n}", "_writingGulp() {\n this.fs.copy(this.templatePath('Gulpfile.js'), this.destinationPath('Gulpfile.js'));\n this.fs.copy(\n this.templatePath('felab_gulp_template.js'),\n this.destinationPath('felab/gulp/template.js')\n );\n }" ]
[ "0.5770231", "0.56890064", "0.5356412", "0.53077924", "0.52938753", "0.51783085", "0.51662964", "0.51349777", "0.5077958", "0.5044464", "0.49814218", "0.49717966", "0.49433184", "0.49268025", "0.48703688", "0.48634258", "0.48464328", "0.48239532", "0.48045275", "0.47982603", "0.47766384", "0.47534627", "0.46985888", "0.46979442", "0.46944094", "0.46861598", "0.46555626", "0.46534622", "0.46287933", "0.45976746", "0.4585791", "0.4571872", "0.45700628", "0.45700577", "0.45624304", "0.45500755", "0.45422983", "0.4535574", "0.4529209", "0.45211157", "0.45195752", "0.45150173", "0.45133033", "0.45117462", "0.45115468", "0.45079768", "0.45035428", "0.44920585", "0.44880536", "0.4484411", "0.44799286", "0.4479795", "0.44794428", "0.44744554", "0.44742146", "0.44709042", "0.44592363", "0.445726", "0.44519272", "0.44504386", "0.44484302", "0.4447645", "0.44434202", "0.44425237", "0.44364342", "0.44342494", "0.44320557", "0.44318146", "0.44313237", "0.4424078", "0.4423066", "0.4421001", "0.44205794", "0.44137996", "0.44114202", "0.44107154", "0.44002274", "0.4398969", "0.43980095", "0.43818787", "0.43811932", "0.43788734", "0.43747982", "0.4371574", "0.43699893", "0.43645883", "0.43596193", "0.43570182", "0.43516245", "0.43498293", "0.4344718", "0.43440714", "0.43401742", "0.4337181", "0.4335109", "0.43346092", "0.43307984", "0.43301365", "0.43223968", "0.43207923", "0.43178582" ]
0.0
-1
Displays entered value on screen.
function screen(value) { let res = document.getElementById("result"); if (res.value == "undefined") { res.value = ""; } res.value += value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showInput() {\n document.getElementById('display').innerHTML = \n document.getElementById(\"user_data\").value;\n \n}", "function displayValue(value) {\n display.textContent = value;\n}", "function display(input){\r\n dispStr=dispStr+input;\r\n displayInScreen(dispStr);\r\n}", "function display(v){\n var tr = document.getElementById(\"screen\")\n tr.value += v\n}", "function display(num) {\r\n outputScreen.value += num;\r\n}", "function displayCurrentInput() {\n document.getElementById('screen').value = current_input;\n}", "function displayResult(result){\n document.getElementById(\"result\").value = result;\n}", "function displayCurrentInput() {\n document.getElementById('screen').value = currentInput;\n}", "function displayValue(value) {\n if(!equalsPressed){\n display.innerHTML += value;\n } else {\n calcClear();\n equalsPressed = false;\n display.textContent += value;\n };\n}", "function displayOutput(outputCode) {\n document.getElementById(\"output\").value = outputCode;\n}", "printResult(value) {\n if (value === \"\") {\n // if value is a string print it\n document.getElementById(\"result\").innerText = value;\n return;\n } else {\n // if value in not a string, first convert in to string and then print it\n document.getElementById(\"result\").innerText = this.numToStr(value);\n }\n }", "function display(argument){\n\t$('#display').append(\"<p class='input-1'>\" + argument + \"</p>\");\t\n\t}", "function displayOutput(num){\n document.getElementById('output-value').innerText = num;\n}", "function getValue(){\r\n var txt= document.getElementById(\"user_input\").value\r\n var txt2= document.getElementById(\"pass\").value\r\n var txt3 = document.getElementById(\"rep\").value\r\n document.getElementById('display').innerHTML= txt+txt2+txt3\r\n \r\n }", "function print_input () {\n\t\tvar userinput = document.getElementById('input').value;\n\t\tconsole.log(userinput);\n\t}", "function println(value) {\n\t$('#rokResult').val($('#rokResult').val()+\"\\n\"+value);\n}", "function inputValueTaker(userInput){\n document.getElementById('displayInputValue').value += userInput;\n \n document.getElementById('displayInputValue').style.color = \"white\";\n\n document.getElementById('displayInputValue').style.textAlign = \"center\";\n\n document.getElementById('displayInputValue').style.fontSize = \"2em\";\n\n}", "function printOutput(num){\r\n\tdocument.getElementById(\"output_value\").innerText=num;\r\n}", "function displayCurrentInput() {\n document.getElementById('screen').value = this.currentInput;\n}", "function showOnScreen(input){\n output.html(input);\n }", "function buttonInputClickHandler(eventArg) {\n var display = document.getElementById(\"display\");\n display.value = display.value + eventArg.target.value;\n }", "function printOutput(num)\n{\n\tdocument.getElementById(\"output-value\").innerText=num;\n}", "setDisplayValueFromCurrentInputValue() {\n this.setValueByInputValue(this.get(\"input_value\"));\n }", "function displayTotal(inputed){\n document.getElementById(\"display\").value = inputed;\n}", "function updateDisplay(message) {\n var message = message;\n var userInput = document.getElementById(\"taGame\");\n userInput.value = message + \"\\n\\n\" + userInput.value;\n}", "function updateDisplay() {\n let input = document.getElementById(\"inputSpace\");\n input.innerHTML = calculator.displayValue;\n }", "function displayInScreen(dispStr){\r\n document.querySelector(\"#screen_value\").innerHTML=dispStr;\r\n}", "function liveScreen(value) {\n document.getElementById(\"output\").innerHTML = value;\n}", "function update(){\n let value = document.getElementById(\"input\").value;\n document.getElementById(\"demo\").innerHTML = value;\n }", "function inputValue(value) {\n // checks to see if we are updating 'balance'\n if (typeof value === 'string') {\n display.innerHTML = '$ ' + value;\n //when starting a new value with '.', display should be '0.'\n } else if ((display.innerHTML === '$ 0.00' || lastClicked === 'operator' || lastClicked === 'equals') && this.innerHTML === '.') {\n display.innerHTML = '$ 0.';\n lastClicked = 'number';\n //when starting a new value the clicked button should replace display\n } else if (display.innerHTML === '$ 0.00' || lastClicked === 'operator' || lastClicked === 'equals') {\n display.innerHTML = '$ ' + this.innerHTML;\n lastClicked = 'number';\n // if the display already includes a decimal, clicking '.' should do nothing\n } else if (display.innerHTML.includes('.') && this.innerHTML === '.') {\n display.innerHTML = display.innerHTML;\n // should do nothing if trying to input a value in to the third decimal place\n } else if (display.innerHTML.indexOf('.') > 0 && (display.innerHTML.length - display.innerHTML.indexOf('.') > 2)) {\n display.innerHTML = display.innerHTML;\n // if it is not the start of a new value, clicked button should be concatenated to display\n } else {\n display.innerHTML = display.innerHTML + this.innerHTML\n }\n }", "function displayValue(value) {\n if (typeof value === \"string\") {\n return quote(value);\n } else {\n return String(value);\n }\n}", "function collectVal() {\r\n\tvar val = prompt(\"Enter instruction, hex, or binary: \").toLowerCase();\r\n\tanswer = qualify(val);\r\n\tif (answer == null)\r\n\t\tanswer = \"Invalid; please try again.\";\r\n\tdocument.getElementById(\"showVal\").innerHTML = answer;\r\n}", "function updateDisplay(msg){\n\t\t//displays story\n\t\tvar target=document.getElementById(\"OutputTxtBox\");\n\t\ttarget.value=msg+\"\\n\"+target.value;\n\t\t//displays score\n\t\tdocument.getElementById(\"OutputScore\").value=score;\n\t}", "function getInputValue() {\r\n let input = event.target.innerText;\r\n console.log(input);\r\n printValue(input);\r\n}", "function updateDisplay()\n {\n //We need to build a string to show. The first item is the current running total:\n var string = runningTotal;\n\n //Then we add the operator if they have pressed this\n if(hasPressedOperator)\n string += \" \" + currentOperator;\n \n //And finally we add the right operand, the value to add when equals is pressed.\n if(hasPressedOperand)\n string += \" \" + currentOperand;\n \n //We then simply set the value of the output field to the string we built\n document.getElementById(\"output\").value = string;\n }", "function displayInput(){\n input_text = document.getElementById('input-box').value;\n document.getElementById('response-box').innerHTML = input_text;\n}", "function printOutput(num) {\n //if value is empty we set it to empy\n if (num == \"\") {\n document.getElementById(\"output-value\").innerText = num;\n }\n //or else we get the number\n else {\n document.getElementById(\"output-value\").innerText = getFormattedNumber(num);\n }\n}", "function show_value(x) {\r\n document.getElementById(\"mealCost\").innerHTML = x;\r\n}", "function updateDisplay (val) {\n\t\t\tif(typeof val == \"string\")\n\t\t\t\t$scope.output = val;\n\t\t\telse\n\t\t \t$scope.output = String(val);\n\t\t}", "function onInput() {\r\n\tvar x = document.getElementById('myInput').value;\r\n\tdocument.getElementById('oninput_P').innerHTML = \"your text:\" + x;\r\n}", "function myDisplayer(sum) {\r\n document.querySelector(\"#outputfield\").innerHTML = sum; \r\n}", "function updateDisplay(value) {\n\t\t$display.value(value);\n\t}", "function print(value){ // => the word value here is a parameter/placeholder/passenger\r\n console.log(value);\r\n }", "function writeDisplay(value) {\n if (clear) {\n display.textContent = \"\";\n clear = false;\n }\n display.textContent += value;\n displayValue = parseFloat(display.textContent);\n canOperate = true;\n //this firstEntry variable makes sense for the equal operator not to execute right after an arithmetic operator\n //but after a statement (like 5*8)\n if (firstEntry){\n canEqual = true;\n }\n}", "function update(value){\n screen.innerText = value;\n}", "function updateScreen(result) {\n let displayValue = result.toString()\n display.value = displayValue.substring(0, 6)\n}", "function dis(val) {\n if (displayValue === '') {\n displayValue = val;\n } else {\n displayValue += val;\n }\n document.getElementById(\"result\").value = displayValue;\n}", "function renderMessege() { \n var userInput = localStorage.getItem(\"inputField\")\n userTextInput.textContent = userInput;\n }", "function valueOutput(element) {\n var value = element.value;\n var output = element.parentNode.getElementsByTagName('output')[0];\n output.innerHTML = value;\n }", "function output(value) {\n debug.innerHTML = value;\n return true;\n}", "function InputValue(value){\n\t\tif(value.match(/[-+*\\/.]|[0-9]/g)){\n\t\t\tnewValue += value;\n\t\t\t_render();\n\t\t}\n\t\telse if(value == '='){\n\t\t\tevaluate();\n\t\t}\n\t\telse if(value == 'c'){\n\t\t\tnewValue = \"\";\n\t\t\t_render();\n\t\t}\n\t\telse\n\t\t\tconsole.log(\"Invalid!\");\n\t}", "function showValue(number){\n document.getElementById(\"selected_amount\").innerHTML = number; \n}", "function valueOutput(element) {\n var value = element.value;\n var output = element.parentNode.getElementsByTagName('output')[0];\n output.innerHTML = value;\n }", "function getValue() {\n document.getElementById(\"alert\").classList.add(\"invisible\");\n let userString = document.getElementById(\"userString\").value;\n let revString = reverseString(userString);\n displayString(revString);\n}", "function showWhatWeTyped() {\n // fill the div with the content of the input field\n theDiv.innerHTML = field.value;\n subtitle.innerHTML = field2.value; \n}", "function showDistance() \n{\n \tdocument.getElementById('length').value = distance;\n}", "function processClickFunction(){\n alert(\"Thomas Fracassi: \" + inputvar.value);\n document.getElementById(\"textoutput\").innerHTML = inputvar.value;\n }", "function UpdateDisplay(msg) {\n console.log(msg);\n var target = document.getElementById(\"maintext\");\n console.log(target);\n target.value = msg + \"\\n\\n\";\n }", "function printOutput(num) {\n if(num===\"\") {\n document.getElementById(\"output-value\").innerText\n } else {\n document.getElementById(\"output-value\").innerText = getFormattedNumber(num);\n }\n}", "function displayInfo(){\n \n\n fill(255);\n var lifeExpValue = lifeExp[int(inp.value())];\n var countryNameValue = countryNames[int(inp.value())];\n \n push();\n \n textSize(76);\n textAlign(CENTER);\n fill(255);\n stroke(0);\n strokeWeight(3);\n \n text(`${lifeExpValue}`, width/4 + 75, height/2 + 150);\n text(`${countryNameValue}`, width/4 + 75, height/2 + 250);\n \n pop();\n \n}", "function printDisplay(num) {\n if (num == \"\") {\n document.getElementById(\"display\").innerText = num;\n } else {\n document.getElementById(\"display\").innerText = getFormattedNumber(num);\n }\n}", "function myFunction(val) {\n document.getElementById(\"display\").value += val;\n document.getElementById(\"c\").innerText = \"C\";\n}", "function setOutput (value) {\n document.getElementById(\"output\").innerHTML += value;\n }", "function displayNumber(num){\n givenNumberValue.value += num;\n}", "function displayValue(value) {\r\n if (isNumber(value) && String(value).length > 14) value = value.toExponential(6);\r\n\r\n value = String(value);\r\n\r\n let sign = \"\";\r\n // If there is a sign ignore adding commas\r\n if (value[0] === \"-\" || value[0] === \"+\") {\r\n sign = value[0];\r\n value = value.slice(1);\r\n }\r\n\r\n // If it is a float number ignore commas after the dot\r\n let after_dot = \"\";\r\n if (isFloatNum(value)) {\r\n let dot_id = value.indexOf(\".\");\r\n after_dot = value.slice(dot_id);\r\n value = value.slice(0, dot_id);\r\n }\r\n\r\n let displayed_value = value;\r\n\r\n // Add commas every 3 characters\r\n if (value.length >= 4) {\r\n for (let i = value.length - 1; i >= 0; i--) {\r\n if (i % 3 === 0 && i != 0) displayed_value = displayed_value.slice(0, -i) + \",\" + displayed_value.slice(-i);\r\n }\r\n }\r\n // Display \r\n screen.innerHTML = sign + displayed_value + after_dot;\r\n}", "function berechnen(val) {\r\n\tcalculator.smalldisplay.value += val;\r\n\tcalculator.display.value=eval(calculator.smalldisplay.value);\r\n\tcalculator.smalldisplay.value = '';\r\n}", "function display()\r\n\t{\r\n\t document.getElementById(\"inputTerm\").value = inputTerm ;\r\n\t document.getElementById(\"inputType\").selectedIndex = inputType;\t\t\t\r\n\t}", "function displayDestAmount() {\n destAmountHTML.value = destAmount;\n}", "showMessage () {\n console.log(`Hi! this is: ${this.value}`)\n }", "function printResult(){\n\n //print user input\n investmentValue = \"$\"+((investmentValue)*1).toFixed(2).replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n \t\tpercentage = ((percentage)*1)+\"%\";\n document.getElementById(\"sampleResultInvestmentValue\").innerHTML = investmentValue;\n document.getElementById(\"sampleResultPercentage\").innerHTML = percentage;\n document.getElementById(\"sampleResultYears\").innerHTML = years;\n\t document.getElementById(\"sampleResultCompound\").innerHTML = compound;\n\t document.getElementById(\"sampleResultAdditionalInvestment\").innerHTML = additionalInvestment;\n document.getElementById(\"sampleResultResult\").innerHTML = result;\n\n }", "function eventHandler(value) {\n if (\n value === \"+\" ||\n value === \"-\" ||\n value === \"*\" ||\n value === \"/\" ||\n value === \"%\" ||\n Number.isInteger(+value) ||\n value === \".\"\n ) {\n display.textContent += value;\n }\n if (value === \"=\" || value === \"Enter\") {\n display.textContent = eval(display.textContent);\n evaluated = true;\n }\n if (value === \"^\") {\n display.textContent += '**';\n }\n if (value === \"Backspace\") {\n display.textContent = display.textContent.slice(0, -1);\n }\n\n if (value === \"AC\") {\n evaluate = false;\n display.textContent = \"\";\n }\n}", "function printValue(value) {\n console.log(value);\n}", "function showSelection()\n{\n let movieSelection = document.querySelector(\"#movies\").value;\n\n let outputField = document.querySelector(\"#outputField\");\n\n outputField.innerHTML = `${movieSelection}!`;\n\n console.log(movieSelection);\n}", "function mostrarIngreso() {\n document.getElementById(\"ingreso\").innerHTML = \"Ingresaste el siguiente dato: \" + document.getElementById(\"input\").value;\n }", "function displayDigits(digit){\n //var digitValue = digit.value\n document.getElementById(\"inputs\").innerHTML += digit.value; //innerHTML is used to insert elements into id *in a div NOTE that += means appending\n}", "updateDisplay() {\n this.d1.value = this.twoDigitNum(this.app.t1);\n this.d2.value = this.twoDigitNum(this.app.t2);\n this.d3.value = this.twoDigitNum(this.app.t3);\n }", "function updateDisplay () {\n\n showValue('.held-value',heldValue);\n showValue('.next-Value',nextValue);\n}", "function print(value) {\n\t$('#rokResult').val($('#rokResult').val()+value);\n}", "renderValue(){\n const thisWidget = this;\n \n thisWidget.dom.wrapper.innerHTML = thisWidget.correctvalue;\n }", "function enter(val) {\n // this places the \"result\" text bar into a variable\n // named result\n result = window.document.getElementById(\"result\");\n\n // Appends the value of the clicked button to the text\n // in the \"result\" bar (using variable result)\n result.value += val.target.value;\n}", "function getValueOfInputText(input) {\n printInElement('Element ID: ' + input.id + '\\n', true);\n printInElement('Element content: ' + input.value);\n}", "function enterClicked () {\n // this function gets users street name and street number and shows it back to the user\n\n // input\n const streetNumber = parseInt(document.getElementById('street-entered').value)\n const streetName = document.getElementById('street-name').value\n\n // output\ndocument.getElementById('address').innerHTML = 'Your info is: ' + streetNumber + ' ' + streetName + '.'\n}", "valueDisplayCopiable() {\n this._value.addEventListener('click', () => {\n let dValue = this.value;\n let input = document.createElement('input');\n document.body.appendChild(input);\n input.value = dValue;\n input.select();\n input.setSelectionRange(0, 99999); // For mobile devices\n document.execCommand('copy');\n document.body.removeChild(input);\n this.value = 'Copied!';\n setTimeout(() => {this.value = dValue;}, 285);\n }, false);\n }", "function enterClicked() {\n // This function get address name and number and show it back\n\n //input\n const addressNumber = parseInt(document.getElementById(\"street-number\").value)\n const addressName = document.getElementById(\"street-name\").value\n\n //output\n document.getElementById('address').innerHTML = 'Your address is: ' + addressNumber + ' ' + addressName + '.'\n}", "function showValueOnScreen(number){\n screen = document.getElementById(\"result\")\n screen.innerHTML = number.substring(0,maxScreenSize+2)\n}", "function updateDisplay() {\n $('#display').val(objectToSend.input1);\n}", "function displayInputString() {\n guessSection.innerText = document.getElementById('main-input').value;\n yourLastGuessWas.innerText = \"Your last guess was\";\n}", "function updateDisplay(message) { \n\n var target = document.getElementById(\"txtAnswer\");\n\n target.value = message+\"\\n\\n\"+target.value;\n\n }", "function printLog(number) {\n console.log(\"PRINTING\")\n var output = document.getElementById('output');\n output.value = diceLog;\n}", "function showOnLCD(display,event,value) {\n \n display.clear();\n display.setCursor(0,0);\n display.write(event+value);\n}", "function updateDisplay() {\n\tshowValue(\".next-value\", nextValue);\n\tshowValue(\".held-value\", heldValue);\n}", "function display(btn){\n return result.value+= event.target.value;\n}", "function Update_Display() {\n const display = document.querySelector('.calculator-screen');\n display.value = Calculator.Display_Value;\n}", "function Update_Display() {\n const display = document.querySelector('.calculator-screen');\n display.value = Calculator.Display_Value;\n}", "function Update_Display() {\n const display = document.querySelector(\".calculator-screen\");\n display.value = Calculator.Display_Value;\n}", "function Update_Display() {\n const display = document.querySelector(\".calculator-screen\");\n display.value = Calculator.Display_Value;\n}", "function display(n){\n document.write(\"<br/><font color=red> Value is \"+n+\"</font>\") \n // while display time big logic. \n}", "function display() {\n lcd.clear();\n lcd.cursor(0, 0).print(displayDate());\n lcd.cursor(1, 0).print(displayMeasure());\n }", "function valuetext(value) {\n return value;\n}", "function showValue(value, state) {\n return (state < 3) ? '' : value;\n }" ]
[ "0.70568824", "0.70197594", "0.6877267", "0.6854964", "0.67869073", "0.67277056", "0.67181027", "0.6690169", "0.6666995", "0.66501933", "0.66437423", "0.6607174", "0.6589666", "0.6585043", "0.6564493", "0.65639955", "0.65558726", "0.6539327", "0.6500925", "0.649463", "0.6474024", "0.64710456", "0.6460518", "0.6456797", "0.64557976", "0.6452759", "0.64200634", "0.6416026", "0.6415965", "0.6394672", "0.63847876", "0.6375056", "0.636057", "0.635967", "0.63544816", "0.6343732", "0.63408446", "0.6313418", "0.6292629", "0.6270624", "0.62663156", "0.62517214", "0.6231177", "0.62291515", "0.6210733", "0.6195817", "0.61874294", "0.6182086", "0.6162014", "0.61597115", "0.61577755", "0.61573356", "0.61501133", "0.6148867", "0.614622", "0.6130009", "0.61254627", "0.6113649", "0.61116457", "0.61087155", "0.6107893", "0.610699", "0.6105785", "0.61050117", "0.60942215", "0.608998", "0.6076589", "0.60755324", "0.6072564", "0.60708404", "0.6066881", "0.60663044", "0.6061183", "0.60604274", "0.60487527", "0.6048638", "0.60483027", "0.60476744", "0.6043019", "0.60427004", "0.6039217", "0.60344577", "0.6029046", "0.60266984", "0.60186607", "0.60127145", "0.6010132", "0.6003096", "0.59906757", "0.5986634", "0.5972643", "0.5972355", "0.596758", "0.596758", "0.5959298", "0.5959298", "0.59572136", "0.59570414", "0.5949699", "0.5947084" ]
0.6827806
4
Displays copyright in the footer.
function Copyright() { return ( <Typography variant="body2" color="textSecondary" align="center"> {'Copyright © '} <Link color="inherit" href="http://civitalaurea.com/"> Civita Laurea </Link>{' '} {new Date().getFullYear()} {'.'} </Typography> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Footer() {\n const currentYear = new Date().getFullYear();\n\n return (\n <footer>\n <p>Copyright © {currentYear}</p>\n </footer>\n );\n }", "function insertFooter () {\n \"use strict\";\n try {\n var footer;\n\t\t\t/* There are at least one, and maybe more, courses that are developed in partnership with BYU or BYU-Hawaii and require that to be displayed in the copyright. Checking here for customCopyright allows for those courses to create this variable with the custom text in the course.js file before the online.js is appended and then will use the custom text */\n\t\t\tif (typeof customCopyright === \"undefined\") {\n\t\t\t\tfooter = \"<div id='footer'>Copyright &copy; \" + new Date().getFullYear() + \" by Brigham Young University - Idaho. All Rights Reserved.</div>\";\n\t\t\t} else {\n\t\t\t\tfooter = \"<div id='footer'>\" + customCopyright + \"</div>\";\n\t\t\t}\n document.getElementById(\"main\").insertAdjacentHTML(\"beforeend\", footer); \n } catch (ex) {\n console.log(ex.name + \": \" + ex.message);\n }\n }", "function footer_text(){\n // Display the footer text with current year\n var text_element = document.getElementById(AllIdNames.footer_text_id);\n var current_year = new Date().getFullYear();\n text_element.innerHTML = '&copy;' + ' Voltex Designs ' + current_year;\n}", "function Footer() {\n const year = new Date().getFullYear();\n return (\n <footer className={styles.container}>\n <p>Copyright ⓒ {year} Geetha Chittuluri @ Portland State University.</p>\n </footer>\n );\n}", "function setDate() {\n\nvar today = new Date();\nvar year = today.getFullYear();\n\nvar rok = document.getElementById('mainfooter');\nrok.innerHTML = '<p>Copyright &copy;' + year + ' Adam Stasiun </p>';\n}", "function getCopyrightInfo(){\n return '<p>Información elaborada por la Agencia Estatal de Meteorología (© AEMET). Más información en su <a href=\"http://www.aemet.es/es/portada\" style=\"color: #374DC3;\" target=\"_blank\">sitio oficial</a></p>';\n }", "function appendFooter(){\n var footer = \"<div class='footer'>\";\n footer += \"<center><div class='copyrightText'>&copy; 2017 ITEE Group Canada</div></center>\";\n footer += \"</div>\";\n $('body').append(footer);\n }", "function setCopyrightDate(){\n year = new Date().getFullYear();\n document.write(year);\n }", "function Copyright() {\n\n\treturn (\n\t\t<div className = \"uppercase\" id = \"copyright\">\n\t\t\t<p>\n\t\t\t\tAll im&shy;ages and texts are cop&shy;y&shy;right&shy;ed and own&shy;ed by Sacha&nbsp;Tassilo Hoechstetter. <br className = \"breaker\" />Un&shy;der no cir&shy;cum&shy;stances shall these dig&shy;i&shy;tal files, im&shy;ages and vid&shy;eos be used, cop&shy;ied, dis&shy;play&shy;ed or <br className = \"breaker\" />pull&shy;ed from this site with&shy;out the ex&shy;press&shy;ed writ&shy;ten agree&shy;ment of Sacha&nbsp;Tassilo Hoechstetter.\n\t\t\t</p>\n\t\t</div>\n\t)\n}", "function $currentYear() {\n\tvar d = new Date();\n\tvar n = d.getFullYear();\n\tdocument.getElementById(\"copyright\").innerHTML = '&copy; ' + n + ' - Gallery';\n}", "function Footer() {\n return (\n <footer className=\"footer\">\n <div className=\"text-center\">\n <small className=\"copyright\">\n Designed with <i className=\"fas fa-heart\"></i> by <a href=\"http://themes.3rdwavemedia.com\" target=\"_blank\" rel=\"noopener noreferrer\">Xiaoying Riley</a> for developers\n </small>\n <br/>\n <small className=\"copyright\">\n Coded with React and <i className=\"fas fa-heart\"></i> by <a href=\"http://jmsalcido.dev\" target=\"_blank\" rel=\"noopener noreferrer\">Jose Salcido</a>\n </small>\n </div>\n </footer>\n )\n}", "function copyrightDate() {\n var theDate = new Date();\n $('#copyright p span').text(theDate.getFullYear());\n}", "function Copyright() {\n return (\n <Typography variant=\"body2\" color=\"textSecondary\" align=\"center\">\n {'Copyright © '}\n <Link color=\"inherit\" href=\"#\">\n CMO\n </Link>{' '}\n {new Date().getFullYear()}\n {'.'}\n </Typography>\n );\n}", "displayFooter() {\n }", "function getFooter(options) {\n\n\t// -- get this year\n\tlet date = new Date().getFullYear();\n\n\t// -- update the variables\n\toptions.name ? options.name : null;\n\toptions.url ? options.url : null;\n\toptions.copyYear ? options.copyYear : date;\n\toptions.policy ? options.policy : false;\n\toptions.terms ? options.terms : false;\n\toptions.cookies ? options.cookies : false;\n\toptions.customStyle ? options.customStyle : false;\n}", "function footerData(sourcefile){\r\n\treturn `<div class='information' id='information'>\r\n\t\t\t\r\n\t\t<div style='float:right; padding-top: 28px; padding-right: 14px;'>\r\n\t\t\tRobert Calamari 2019\r\n\t\t</div>\r\n\r\n\t</div>\r\n`;\r\n}", "function Copyright(props) {\n return (\n <Typography variant=\"body2\" color=\"text.secondary\" align=\"center\" {...props}>\n {'Copyright © Team Ukku '}\n\n {new Date().getFullYear()}\n {'.'}\n </Typography>\n );\n}", "function Footer () {\n return (\n <div className='footer-bottom'>\n <p className='text-xs-center text-light'>\n &copy;{new Date().getFullYear()} By LM - All rights reserved\n </p>\n </div>\n )\n}", "function Copyright() {\n return <p>Copyright © BlurbSay {new Date().getFullYear()}.</p>;\n}", "get copyright () {\n\t\treturn this._copyright;\n\t}", "get copyright () {\n\t\treturn this._copyright;\n\t}", "get copyright () {\n\t\treturn this._copyright;\n\t}", "function FOOTER$static_(){ToolbarSkin.FOOTER=( new ToolbarSkin(\"footer\"));}", "function copyrightYear() {\n var year = new Date().getFullYear();\n document.getElementById(\"year\").innerHTML = year;\n}", "function Copyright() {\n return (\n <Typography variant=\"body2\" color=\"textSecondary\" align=\"center\">\n {'Copyright © '}\n <Link color=\"inherit\" href=\"https://\">\n Brocer\n </Link>\n {' '}\n {new Date().getFullYear()}\n </Typography>\n );\n}", "function Footer() {\n return (\n <footer>\n <Typography variant=\"caption\">\n <Box align=\"center\" lineHeight={3} fontWeight=\"fontWeightBold\">\n &copy; Jason Lin 2021\n </Box>\n </Typography>\n </footer>\n\n // <footer>&copy; Prime Digital Academy</footer>\n )\n}", "function Copyright() {\r\n return (\r\n <Typography variant=\"body2\" color=\"textSecondary\" align=\"center\">\r\n {'Copyright © '}\r\n {/* <Link color=\"inherit\" href=\"https://material-ui.com/\">\r\n Your Website\r\n </Link>{' '} */}\r\n {new Date().getFullYear()}\r\n {'.'}\r\n </Typography>\r\n ); \r\n }", "function Footer(props) {\n return (\n <CardFooter extras=\"text-center\">\n {props.version && <p>Version {props.version}</p>}\n </CardFooter>\n );\n}", "function Copyright () {\n return (\n <Typography variant='body2' color='textSecondary' align='center'>\n {'Copyright © '}\n <Link color='inherit' href='https://material-ui.com/'>\n Your Website\n </Link>{' '}\n {new Date().getFullYear()}\n {'.'}\n </Typography>\n )\n}", "function footer( text ) {\n var textObject = game.add.text(\n game.world.width, game.world.height, text,\n { font: game.vars.font.footer(), fill: game.vars.font.fill, align: \"right\" }\n );\n textObject.anchor.set( 1, 1 );\n\n return textObject;\n }", "function callback() {\n let keeper = `\n <div class=\"container py-5\">\n <div class=\"text-center text-white\">\n <h5>&copy;Ahmad Essam 30-9-2021</h5>\n </div>\n </div>\n `\n document.getElementById('myFooter').innerHTML = keeper;\n}", "function changeFooterText(){\n\n }", "function setDynamicCopyrightYear() {\n var anio = (new Date).getFullYear();\n $( '.copyright' ).find( 'span.year' ).text( anio );\n }", "function CheckoutFooter() {\n return ( \n <footer className=\"pt-5 text-muted text-center text-small\">\n <p>© 2017-2018 4Geeks Academy</p>\n <p>Made with love by Mike and Me</p>\n </footer>\n );\n}", "function CurrentYear(feet, theYear) {\n feet.innerHTML = \"\\<h5\\>\\&copy 2016 Junior Developer Toolbox. All Rights Reserved. \\<br \\/\\> A Member of the Complete Developer Family \\&copy 2015 - \" + theYear + \" \\<a href=\\\"http:\\/\\/completedeveloperpodcast.com\\\" \\> \\<img class=\\\"CDPlogo\\\" src= \\\"http:\\/\\/completedeveloperpodcast.com\\/wp-content\\/uploads\\/2015\\/09\\/JPEG300_iTunes.jpg\\\" \\> Complete Developer Podcast\\<\\/a\\>. All rights reserved.\\<\\/h5 \\> \";\n document.getElementById(\"footer\").appendChild(feet);\n}", "install() {\n let el = document.getElementsByTagName(\"footer\")\n if (el) { // there should only be one footer...\n let message = this.message\n el[0].innerHTML = `\n <div class=\"footer_copyright\">&copy; 2015—-${ moment().year() } <a href=\"http://www.oscars-sa.eu/\" title=\"Oscars s.a.\" alt=\"Oscars s.a.\">Oscars s.a.</a></div>\n <div class=\"footer_message\">${ message }</div>\n <div class=\"footer_byline\">designed by <a href=\"https://github.com/devleaks\" title=\"Devleaks' github\" alt=\"Devleaks' github\">devleaks</a></div>\n `\n }\n this.listen(this.update.bind(this))\n }", "function Copyright() {\n return (\n <Typography variant=\"body2\" color=\"textSecondary\" align=\"center\">\n {'Copyright © '}\n <Link color=\"inherit\" href=\"https://material-ui.com/\">\n Your Website\n </Link>{' '}\n {new Date().getFullYear()}\n {'.'}\n </Typography>\n )\n}", "function Footer(props) {\n return (\n <footer className={style.footer}>\n <span>Pooria©</span>\n </footer>\n );\n}", "function buildEnd(options) {\n html += `</main>\n\n <footer>\n <p>Copyright info?</p>\n </footer>\n </body>\n </html>`\n}", "function EMBEDDED_FOOTER$static_(){ToolbarSkin.EMBEDDED_FOOTER=( new ToolbarSkin(\"embedded-footer\"));}", "function Footer(props) {\n return (\n <footer className=\"clearfix\">\n <p className=\"copyright\"> Copyright 2018 </p>\n <p className=\"message\"> Created by\n <span className=\"name\">Ashley Thompson</span>\n </p>\n </footer>\n );\n}", "get copyright() {\n\t\treturn this.__copyright;\n\t}", "function Copyright() {\n return (\n <Typography variant=\"body2\" color=\"textSecondary\" align=\"center\">\n {'Copyright © '}\n <Link color=\"inherit\" href=\"https://material-ui.com/\">\n Your Website\n </Link>{' '}\n {new Date().getFullYear()}\n {'.'}\n </Typography>\n );\n}", "function NextYearCDP(feet, theYear) {\n feet.innerHTML = \"\\<h5\\>\\&copy 2016 Junior Developer Toolbox. All Rights Reserved. \\<br \\/\\>A Member of the Complete Developer Podcasting Family \\&copy 2015 - \" + theYear + \" \\<a href=\\\"http:\\/\\/completedeveloperpodcast.com\\\" \\> \\<img class=\\\"CDPlogo\\\" src= \\\"http:\\/\\/completedeveloperpodcast.com\\/wp-content\\/uploads\\/2015\\/09\\/JPEG300_iTunes.jpg\\\" \\> Complete Developer Podcast\\<\\/a\\>. All rights reserved.\\<\\/h5 \\> \";\n document.getElementById(\"footer\").appendChild(feet);\n}", "function copyDate(organization,start_date) {\n\t \n\t\tvar copyright=new Date();\n\t\tvar update=copyright.getFullYear();\n\n\t\t//---write copyright\n\t\tif ( start_date == update )\n\t\t document.write(\"<br />Copyright &#169; \" + start_date + \"<br />\" + organization + \",&nbsp;&nbsp;All Rights Reserved.\");\n\t\telse\n\t\t document.write(\"<br />Copyright &#169; \" + start_date + \" - \" + update + \"<br />\" + organization + \",&nbsp;&nbsp;All Rights Reserved.\");\n\t\t\n\t} //end copyDate()\t", "function Copyright() {\n return (\n <Typography variant=\"body2\" color=\"textSecondary\" align=\"center\">\n {\"Copyright © \"}\n <Link color=\"inherit\" href=\"https://quizapp.com/\">\n QuizStack\n </Link>{\" \"}\n {new Date().getFullYear()}\n {\".\"}\n </Typography>\n );\n}", "function setupFooter(docname, docver, docstage, docrev, docdate) {\n var footer = doc.getFooter();\n var paragraphs = footer.getParagraphs();\n var doctrack = convertStageToTrack(docstage);\n \n // Build the filename based on provided data\n var docfilename = \"\";\n \n // The passed in docname will be something like \"Playbook Requirements\"\n // We need to make this lower case and remove the spaces\n docname = docname.toLowerCase();\n docname = docname.replace(/\\ /g, '-');\n if (docstage === \"wd\" || docstage === \"csd\" || docstage === \"cnd\") {\n docfilename = \"draft-\" + docname + '-v' + docver + '-' + docstage + docrev;\n }\n else {\n docfilename = docname + '-v' + docver + '-' + docstage + docrev;\n }\n\n // Update the first line of the footer\n e0 = paragraphs[0];\n\n // Update filename name on first line of footer\n e0.replaceText('##docfilename##', docfilename);\n \n // Update the Working Draft ##, but only if this is a WD.\n if (docstage === \"wd\") {\n // Update document revision\n e0.replaceText('##docrev##', docrev);\n }\n else {\n // Remove the Working Draft ## for CSD, CS, CND, CN, but only if it is found\n e0.replaceText('Working Draft ##docrev##', \"\");\n }\n\n // Update the document date\n e0.replaceText('##docdate##', docdate);\n\n // Update the second line of the footer\n e1 = paragraphs[1];\n \n // Update document track type (standards track, non-standards track, standards track draft, etc)\n e1.replaceText('##doctrack##', doctrack);\n}", "render() {\n return (\n <div className=\"footer text-center mt-5\">\n\n <p>\n © Copyright 2018. All Rights Reserved.\n </p>\n\n </div>\n );\n }", "function Copyright() {\n return (\n <Typography variant=\"body2\" color=\"textSecondary\" align=\"center\">\n {\"Copyright © \"}\n <Link color=\"inherit\" href=\"https://material-ui.com/\">\n Favours\n </Link>{\" \"}\n {new Date().getFullYear()}\n {\".\"}\n </Typography>\n );\n}", "function Copyright() {\n return (\n <Typography variant=\"body2\" color=\"textSecondary\" align=\"center\">\n {\"Copyright © \"}\n <Link color=\"inherit\" href=\"https://material-ui.com/\">\n Boon\n </Link>{\" \"}\n {new Date().getFullYear()}\n {\".\"}\n </Typography>\n );\n}", "function showCopyright(comments) {\n var ret = \"\", i, c;\n for (i = 0; i < comments.length; ++i) {\n c = comments[i];\n if (c.type === \"comment1\") {\n ret += \"//\" + c.value + \"\\n\";\n } else {\n ret += \"/*\" + c.value + \"*/\";\n }\n }\n return ret;\n }", "function Footer() {\n return (\n <footer>\n <FooterInfo />\n <FooterCopyright />\n </footer>\n )\n}", "function Copyright() {\n return (\n <Typography variant=\"body2\" color=\"textSecondary\" align=\"center\">\n {\"Copyright © \"}\n <Link color=\"inherit\" href=\"https://material-ui.com/\">\n Your Website\n </Link>{\" \"}\n {new Date().getFullYear()}\n {\".\"}\n </Typography>\n );\n}", "function NextYearBoth(feet, theYear) {\n feet.innerHTML = \"\\<h5\\>\\&copy 2016 - \" + theYear + \" Junior Developer Toolbox. All Rights Reserved. \\<br \\/\\>A Member of the Complete Developer Family \\&copy 2015 - \" + theYear + \" \\<a href=\\\"http:\\/\\/completedeveloperpodcast.com\\\" \\> \\<img class=\\\"CDPlogo\\\" src= \\\"http:\\/\\/completedeveloperpodcast.com\\/wp-content\\/uploads\\/2015\\/09\\/JPEG300_iTunes.jpg\\\" \\> Complete Developer Podcast\\<\\/a\\>. All rights reserved.\\<\\/h5 \\> \";\n document.getElementById(\"footer\").appendChild(feet);\n}", "function footer_func(){\n showfooter();\n hideicon();\n }", "function renderLicenseSection(license) {\n return (license === '') ? '' : `\\n## License\n This project is licensed under the ${license}.\\n<p>&nbsp</p>` \n}", "createFooter(footer) {\n footer.appendChild(footerTemplate.content);\n }", "function Footer(){\n\treturn(\n\t\t<footer>\n\t\t\t<div className=\"row\">\n\t\t\t\t<ul className=\"col-12\">\n\t\t\t\t <li><Link to=\"\" > LinkedIn</Link> </li>\n\t\t\t\t\t<li><Link to=\"\" >GitHub</Link> </li>\n\t\t\t\t</ul>\n\t\t\t\t<p className=\"col-12\">&copy; ReactMasters, {new Date().getFullYear()}</p>\n\t\t\t</div>\n\t\t</footer>\n\t);\n}", "function CopyYear(){\r\n\tvar date = new Date();\r\n\tNowYear = date.getFullYear();\r\n\tCopyTxt = \"<h3>Thanks for watching.</h3>\";\r\n\t/*\r\n\tif(NowYear > 2014){\r\n\t\tCopyTxt = (\"&copy; 2014-\"+NowYear+\" Project るろたび.\");\r\n\t}else if(NowYear === 2014){\r\n\t\tCopyTxt = (\"&copy; 2014 Project るろたび.\");\r\n\t}else{\r\n\t\tCopyTxt = (\"&copy; Project るろたび.\");\r\n\t}\r\n\t*/\r\n}", "function renderLicenseSection(license) {\n\n if (license !== \"None\") {\n return `\n Copyright © ${license} 📛. All rights reserved. \n \n Licensed under the ${license} license 📛.`;\n }\n return \"\";\n}", "function Footer() {\n return (\n <Wrapper>\n <section>This project is licensed under the MIT license.</section>\n <section>语言选择开关</section>\n <section>\n Made with love by\n <A href=\"https://twitter.com/mxstbr\">Max Stoiber</A>,\n </section>\n </Wrapper>\n );\n}", "function addFooter(report) {\r\n report.getFooter().addClass(\"footer\");\r\n var versionLine = report.getFooter().addText(\"Banana Accounting 8\" + \" - \", \"description\");\r\n report.getFooter().addText(\"Pagina \", \"description\");\r\n report.getFooter().addFieldPageNr();\r\n}", "function addFooter() {\r\n const contentsSrc = 'MasterPage/footer_contents.txt';\r\n if (document.getElementById) {\r\n let footer = document.getElementById('footer');\r\n if (footer) {\r\n let pathPrefix = relativePath();\r\n let footerContents = readContents(pathPrefix + contentsSrc);\r\n if (footerContents) { \r\n placeInOuterHtml(footer, footerContents);\r\n }\r\n }\r\n } \r\n}", "function renderLicenseSection(license) {\n return (license === 'None') ? '' : `\\n## License\n This project is licensed under the terms of the ${license} license.\\n<p>&nbsp</p>`;\n}", "function renderLicenseSection(license) {\n if (license != 'None') {\n return `## License:\n Licensed under the ${license}`\n } else {\n return '' \n }\n}", "function afterFooter() {\n // Get Cartridge Cache\n var cache = dw.system.CacheMgr.getCache('DevToolsCache');\n\n // Write log types to their own cache key ( 128KB max per key )\n cache.put('debug', Debugger.debug);\n cache.put('error', Debugger.error);\n cache.put('fatal', Debugger.fatal);\n cache.put('info', Debugger.info);\n cache.put('log', Debugger.log);\n cache.put('warn', Debugger.warn);\n\n // Render Remote Include to Prevent ISML Bug\n var velocity = require('dw/template/Velocity');\n velocity.render('$velocity.remoteInclude(\\'DevTools-AfterFooter\\')', {\n velocity: velocity\n });\n}", "function credits (){\n document.getElementById('info').innerHTML =\"Created by Jake Herold in October 2015\";\n}", "function renderLicenseSection(license) {\n if (license === \"None\") {\n return \"\";\n }\n return `## License\nThis project is licensed under the ${license}`;\n}", "function getCopyright() {\n\t\tvar copyright = new GCopyright(1, new GLatLngBounds(new GLatLng(-90,-180), new GLatLng(90,180)), 0, \n\t\t\t'(<a rel=\"license\" href=\"http://creativecommons.org/licenses/by-sa/2.0/\">CC-BY-SA</a>)');\n\t\tvar copyrightCollection = new GCopyrightCollection('&copy; 2009 <a href=\"http://www.openstreetmap.org/\">OpenStreetMap</a> Contributors');\n\t\tcopyrightCollection.addCopyright(copyright);\n\n\t\treturn copyrightCollection;\n}", "function addFooter(report) {\n\tvar date = new Date();\n\tvar d = Banana.Converter.toLocaleDateFormat(date);\n\treport.getFooter().addClass(\"footer\");\n\tvar versionLine = report.getFooter().addText(d + \" - Trial balance - Page \", \"description\");\n\treport.getFooter().addFieldPageNr();\n}", "render() {\n return (\n <footer>\n <i>by abubanggheed</i>\n </footer>\n );\n }", "function CopyRights(){\n document.getElementById(\"op\").innerHTML =\"© All Rights Reserved to <span style=color:#6C3483;font-weight: bold;>Ultimate Solutions</span> \" + new Date().getFullYear(); \n}", "function renderLicenseSection(licenses) {\n if (licenses !== \"none\") {\n return `## License: <br>\n - This project is licensed with ${licenses} `;\n }\n return \"\";\n}", "function printFooter(){\n //var footer = document.getElementById(\"footer-page\");\n document.write('<!--Begin Footer Code-->');\n\n //print Bootstrap\n document.write('<!-- Bootstrap core JavaScript \\\n ================================================== --> \\\n <!-- Placed at the end of the document so the pages load faster --> \\\n <!-- jQuery (necessary for Bootstrap\\'s JavaScript plugins) --> \\\n <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js\"></script> \\\n <!-- Include all compiled plugins (below), or include individual files as needed --> \\\n <script src=\"js/bootstrap.min.js\"></script> \\\n <!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> \\\n <script src=\"js/ie10-viewport-bug-workaround.js\"></script>');\n\n //print StatCounter\n document.write('<!-- Start of StatCounter Code for Default Guide --> \\\n <script type=\"text/javascript\"> \\\n var sc_project=11034084; \\\n var sc_invisible=1; \\\n var sc_security=\"3e7dba9f\"; \\\n var scJsHost = ((\"https:\" == document.location.protocol) ? \\\n \"https://secure.\" : \"http://www.\"); \\\n document.write(\"<sc\"+\"ript type=\\'text/javascript\\' src=\\'\" + \\\n scJsHost+ \\\n \"statcounter.com/counter/counter.js\\'></\"+\"script>\"); \\\n </script> \\\n <noscript><div class=\"statcounter\"><a title=\"shopify site \\\n analytics\" href=\"http://statcounter.com/shopify/\" \\\n target=\"_blank\"><img class=\"statcounter\" \\\n src=\"//c.statcounter.com/11034084/0/3e7dba9f/1/\" \\\n alt=\"shopify site analytics\"></a></div></noscript> \\\n <!-- End of StatCounter Code for Default Guide -->');\n\n document.write('<!--End Footer Code-->');\n}", "function renderLicenseSection(license) {\n if (license === \"NONE\"){\n return \"\";\n }else{\n return `## License \n This project is covered under the ` + license + ` license. Click the link below for more information. \n `\n+ \nrenderLicenseBadge(license) +\n renderLicenseLink(license);\n}}", "function addFooter(footText){\n return \"<footer class=\\\"card_footer w3-container\\\">\" +\n \"<h5>\" + footText + \"</h5>\" +\n \"</footer>\";\n}", "function addFooter(report) {\n report.getFooter().addClass(\"footer\");\n var versionLine = report.getFooter().addText(\"Banana Accounting - Page \", \"description\");\n report.getFooter().addFieldPageNr();\n}", "function buildFooter (filename) {\n const challengeNumber = filename.split('_')[0]\n const nearbyChallenges = getNearbyChallenges(challengeNumber)\n\n // No further content necessary apart from nearby Challenges\n return partialTemplates.chalFooter(nearbyChallenges)\n}", "function changeFooterText(){\n let footerText = document.querySelector('footer')\n footerText.onclick = function () {\n footerText.innerText = \"Footer text has been changed by clicking on it\"\n }\n }", "function renderLicenseSection(license) {\r\n if (license !== \"none\") {\r\n return (`license ##\r\n This repo is licensed under ${license} license `)\r\n } else {\r\n return ''\r\n }\r\n}", "function setFooter(stats) {\n var footer = '';\n if (stats.show == 'true') {\n if (stats.type.value == \"image\") {\n footer = '<div id=\"footer\" style=\"z-index:30;text-align:' + stats.align.value + ';\"> <img src=\"' + basePath + 'images/' + stats.logo + '\" /></div>';\n }\n else {\n footer = '<div id=\"footer\" style=\"z-index:3;position:absolute;width:100%;text-align:' + stats.align.value + ';\"><div class=\"font-setter\" style=\"z-index:3;font-size:' + stats.size.value + ';\">' + stats.text + '</div></div>';\n }\n }\n return footer;\n }", "function renderLicenseSection(license) {\n if (license !== 'None'){\n return `## License\n This project is licensed under the ${license} license.`;\n }\n return '';\n}", "function renderLicenseSection(license) {\n\t//\tconsole.log(license);\n\treturn `## License\nDistributed under ${license}.\nRead more about this license [here](${renderLicenseLink(license)})\n\t`;\n}", "function renderLicenseLink(license) {\n return '# License\\n\\nLicensed under the [MIT LICENSE](LICENSE)';\n}", "function renderLicenseSection(license) {\n if(license !== 'None') {\n return `\n## License\n `;\n } else {\n return '';\n }\n}", "function Footer() {\n return (\n <footer className=\"footer py-6\">\n <div className=\"content has-text-centered\">\n <p>\n <strong>Selector Básico de Recursos</strong> por <a href=\"https://twitter.com/_kimael_\">Maikel Carballo</a>.\n </p>\n <p>\n <a\n href=\"https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Powered by{' '}\n <img src={logoVercel} alt=\"Vercel Logo\" className=\"logo\" />\n </a>\n <a href=\"https://bulma.io\" target=\"_blank\" rel=\"noopener noreferrer\">\n <img\n src={logoBulma}\n alt=\"Made with Bulma\"\n width=\"128\"\n height=\"24\" />\n </a>\n </p>\n </div>\n </footer>\n );\n}", "genFooterContent() {\n return <Footer />;\n }", "function LicenseSection(license) {\n const licenseURL = LicenseLink(license);\n console.log('licenseURL', licenseURL);\n const licenseSectionText = `Licensed under [${license}](${licenseURL}).`;\n return licenseSectionText;\n}", "function renderLicenseSection(license) { \n if (license === null || license.length===0 || license===\"None\"){\n return \"\";\n }\n return `This project is licensed under the ${license} license.\nPlease refer to ${renderLicenseLink(license)} for details.`\n}", "function renderLicenseLink(license) {\n if (license) {\n switch (license) {\n case 'MIT License':\n return '\\n\\n> This project was created under the standard MIT licence.\\n\\n[Learn more about this licence.](https://lbesson.mit-license.org/)';\n case 'GPLv3 License':\n return '\\n\\n> This project was created under the GNU General Public License.\\n\\n[Learn more about this licence.](http://www.gnu.org/licenses/gpl-3.0.en.html)';\n case 'Apache 2.0 License':\n return '\\n\\n> This project was created under the Apache License, Version 2.0.\\n\\n[Learn more about this licence.](https://www.apache.org/licenses/LICENSE-2.0)';\n case 'Mozilla Public License 2.0':\n return '\\n\\n> This project was created under the Mozilla Public License, Version 2.0.\\n\\n[Learn more about this licence.](https://www.mozilla.org/en-US/MPL/2.0/)';\n default:\n \"\";\n break;\n }\n }\n}", "function initCopyright() {\n var img = document.createElement('img'),\n link = document.createElement('a');\n\n link.href = 'http://www.ign.es';\n link.title = img.alt = 'Copyright Ign';\n img.src = '../img/logo_igne.gif';\n\n link.target = '_blank';\n link.style.padding = link.style.borderWidth = '0';\n link.style.margin = '3px';\n img.style.padding = img.style.margin = img.style.borderWidth = '0';\n link.style.display = 'none';\n link.appendChild(img);\n map.controls[google.maps.ControlPosition.BOTTOM_LEFT].push(link);\n return link;\n }", "function getFooter() {\n return `</div>\n </div>\n </body>\n </html>`;\n}", "function Footer() {\n\n return (\n <div className=\"footer\">\n <p>Developed by Jimmy Hwang | API from Imgur LLC</p>\n </div>\n )\n}", "function renderLicenseSection(license) {\n if (license !== \"none\") {\n return `## License\n Licensed under ${license}`\n }\n else {\n return \"\"\n }\n\n}", "function renderLicenseSection(license) {\n if (license !== \"None\") {\n return `\n## License\n\nThis project is licensed under the ${license} license.\n\nCopyright (c) [year] [fullname]\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n`;\n }\n return \"\";\n}", "function discord() {\n document.querySelector(\".footerlinks\").innerHTML +=\n ' | <a href=\"https://vivaldi.com/contribute/\" target=\"_blank\" rel=\"noreferrer noopener\">Contribute</a> | <a href=\"https://discord.gg/cs6bTDU\" target=\"_blank\" rel=\"noreferrer noopener\">Discord</a>';\n}", "function renderLicenseSection(license) {return !license ? '' : `This project is licensed under the ${license} license. For more information. please visit ${renderLicenseLink(license)}.`}", "function renderLicenseSection(license) {\n if (license === 'none') {\n return '';\n } else {\n return `This project is covered under the ${license} license.\\n \n For more information please visit ${renderLicenseLink(license)}`\n }\n}", "function renderLicenseSection(license) {\n return `## License\n\n${renderLicenseLink(license)}`\n}", "function _generateFooterReport() {\n\t\n\n\tthis.htmlFile.writeln( \"</body>\");\n\tthis.htmlFile.writeln( \"</html>\");\n}" ]
[ "0.74149865", "0.7355889", "0.7319642", "0.6959091", "0.68697226", "0.67985135", "0.6755619", "0.6692379", "0.6591227", "0.6574422", "0.652041", "0.65074044", "0.64674073", "0.6461332", "0.64499134", "0.64397264", "0.6436996", "0.64336884", "0.6412219", "0.63751465", "0.63751465", "0.63751465", "0.63540435", "0.63263595", "0.6324788", "0.63097197", "0.62760925", "0.6240987", "0.62364703", "0.621986", "0.6218325", "0.6213218", "0.621158", "0.6210805", "0.6198995", "0.6179442", "0.61748636", "0.61704326", "0.6164429", "0.6154355", "0.61539185", "0.61496496", "0.6141814", "0.61281973", "0.6121888", "0.61042655", "0.6035296", "0.60243523", "0.601491", "0.60143334", "0.6000972", "0.5983875", "0.59837914", "0.59792674", "0.59604174", "0.59538454", "0.5944315", "0.5906358", "0.5903598", "0.58913946", "0.58882546", "0.58674735", "0.58507943", "0.5850353", "0.5849798", "0.5838341", "0.58380985", "0.5837601", "0.58075285", "0.58045393", "0.5802055", "0.5799986", "0.5797543", "0.5789075", "0.57865286", "0.57729596", "0.5772656", "0.5757888", "0.5739888", "0.5726411", "0.5723236", "0.5719949", "0.5714808", "0.56957984", "0.5691268", "0.5689099", "0.5686864", "0.56804854", "0.56793183", "0.56702054", "0.5656315", "0.56527627", "0.56493", "0.5647754", "0.5643821", "0.56422615", "0.5637633", "0.56295663", "0.5620899", "0.5617046" ]
0.64787173
12
change the flashing page title
function flashCount(count) { if (count < 1) { clearFlash(); } var newTitle = "[ " + count + " ] " + original; timeout = setInterval(function() { document.title = (document.title == original) ? newTitle : original; }, 1000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeTitle() {\n document.title = 'Star Wars';\n }", "function setPageTitle (newTitle) {\n title = newTitle;\n }", "function shortenPageTitle() {\n document.getElementById('main-title').innerHTML = \"Fast & Furious\";\n }", "function updatePageTitle (string) {\n document.title = string + ' - timer_js';\n}", "function updatePageTitle() {\n $rootScope.page_title = Mayocat.applicationName + ' | ' + $translate('routes.title.' + $route.current.titleTranslation);\n }", "function playTitle()\n\n\t{\n\n\tdocument.title = \"BlahTherapy\";\n\n\twindow.setTimeout('document.title=\"*New Message* BlahTherapy\";', 1000);\n\n\twindow.setTimeout('document.title=\"BlahTherapy\";', 3000);\n\n\n\n\tif (playTitleFlag == true)\n\n\t\t{\n\n\t\twindow.setTimeout('playTitle();', 4000);\n\n\t\t}\n\n\t}", "function ChangePageTitle(message) {\n if (message != '') {\n window.document.title = message.trim();\n }\n}", "function changeDocumentTitle( title )\n{\n document.title = title;\n}", "function setTitle(title) {\n\tdocument.title = title;\n}", "function setPageTitle() {\n const page = document.getElementById('title');\n page.innerHTML = pageTitle;\n}", "function HeadingChange(){\n cl(document.title = \"This is new title\")\n}", "setTitle(title) {\r\n this.title = siteTitle + title\r\n document.title = Site.info.siteName + ' ' + siteTitle + title\r\n }", "function setPageTitle() {\n const title = document.getElementById('title');\n title.innerText = pageTitle;\n}", "function setPageTitle() {\n const title = document.getElementById('title');\n title.innerText = pageTitle;\n}", "function replacePageTitle() {\n\t$('title').empty();\n\t$('title').append($( '.menu nav ul li.active-menu a' ).text());\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 setPageTitle() {\n const titleElement = document.getElementById('title');\n titleElement.innerText = pageTitle;\n}", "function setPageTitle() {\n const titleHTML = document.getElementById('title');\n titleHTML.innerText = pageTitle;\n}", "function setTitle() {\n var dateString = dateFormat(new Date(), 'HH:MM:ss');\n document.title = title + ' - ' + APP_PACKAGE_INFO.version;\n }", "function setTitle(title) {\n\t$( \"title\" ).html( title )\n}", "function setPageTitle() {\n document.getElementById('page-title').innerText = parameterUsername;\n document.title = parameterUsername + ' - User Page';\n}", "function updateTitle(page) {\n $('#page-title').html(titles[page]);\n}", "function setPageTitle() {\n document.getElementById('page-title').innerText = parameterUsername;\n document.title = parameterUsername + ' - User Page';\n}", "function setPageTitle() {\nconst title = document.querySelector('#title');\n\ntitle.innerText = pageTitle;\n\n}", "function updateTitle(text) {\n $('title').html(\"Blacksmith - \" + text);\n}", "setTitle(title) {\n document.title = title;\n }", "function setTitle(_title) {\n chrome.browserAction.setTitle({title:_title});\n}", "function refreshPageTitle() {\n if (!PlaneCountInTitle && !MessageRateInTitle) {\n document.title = PageName;\n return;\n }\n\n var aircraftCount = \"\";\n var rate = \"\";\n\n if (PlaneCountInTitle) {\n aircraftCount += TrackedAircraft;\n }\n\n if (MessageRateInTitle && MessageRate) {\n rate += ' - ' + MessageRate.toFixed(1) + ' msg/sec';\n }\n\n document.title = '(' + aircraftCount + ') ' + PageName + rate;\n}", "function changeSettingsTitle() {\n let t = $(\"title\").html()\n $(\"title\").html(`${t.startsWith(\"(\") ? `${t.split(\" \")[0]} ` : \"\"}${SCRIPT_NAME} / Twitter`)\n }", "function titlePage(){\n\t\t$('.title-page').html('<h2 class=\"text-center\">'+objet_concours[last_concours]+'</h2>');\n\t}", "function change_title(){\n\tvar isOldTitle = true;\n\tvar oldTitle = \"Draft\";\n\tvar newTitle = \"Your turn!\";\n\tvar interval = null;\n\tclearInterval(interval);\n\tfunction changeTitle() {\n\t\tif (is_turn){\n \tdocument.title = isOldTitle ? oldTitle : newTitle;\n \tisOldTitle = !isOldTitle;\n\t}\n\telse{\n\tdocument.title = 'Draft'\n\t}}\n\tinterval = setInterval(changeTitle, 1000);\n\t$(window).focus(function () {\n \tclearInterval(interval);\n \t\t$(\"title\").text('Draft');\n\t});\n\t$('body').click(function () {\n\t\tclearInterval(interval);\n\t\t$('title').text('Draft');\n\t});\n\t}", "function changeBrowserTitle(title) \r\n{\r\n\t document.title = title; \r\n\t \r\n}", "function setPageTitle(){\n\tif(pmgConfig.pmgSubTitle){\n\t\tdocument.tile = pmgConfig.siteTitle + ' - ' + pmgConfig.pmgSubTitle;\n\t}\n\telse{\n\t\tdocument.tile = pmgConfig.siteTitle;\n\t}\n}", "function setTitle(paramTitle)\n{\n\twindow.document.title = paramTitle;\n}", "updatePageTitle (state, title) {\n state.pageTitle = title\n }", "function playTitle(){\n\tdocument.title = \"JoChat\";\n\twindow.setTimeout('document.title=\"|| Jomblo || \";', 1000);\n\twindow.setTimeout('document.title=\"__ Jomblo Chat __\";', 2000);\n\twindow.setTimeout('document.title=\"Chat\";', 3000);\n\n\tif (playTitleFlag == true){\n\t\twindow.setTimeout('playTitle();', 4000);\n\t}\n}", "changeTitle( layout, newTitle ){\n\t\tif( layout.title.text ){\n\t\t\tlayout.title.text = newTitle;\n\t\t}\t\n\t}", "setTitle(title) {\r\n this.title = title;\r\n if (this.isActive) {\r\n this.router.updateTitle();\r\n }\r\n }", "function setPageTitle() {\n\n let h1 = document.getElementById('title');\n h1.innerText = pageTitle;\n}", "function titleText(title) {\n pageTitle.textContent = title;\n}", "function set_title(title){\n\t\t\tdocument.querySelector(\"#footertitle span\").innerText = title;\n\t\t}", "function setPageTitle() {\n // First, get a reference to the DOM element\n let titleElement = document.querySelector(\"#page-title > span.name\");\n // Now set the inner text property so the content changes\n titleElement.innerText = name;\n}", "function setTitle() {\r\n\t\tvar title = $('h1#nyroModalTitle', modal.contentWrapper);\r\n\t\tif (title.length)\r\n\t\t\ttitle.text(currentSettings.title);\r\n\t\telse\r\n\t\t\tmodal.contentWrapper.prepend('<h1 id=\"nyroModalTitle\">'+currentSettings.title+'</h1>');\r\n\t}", "function setTitle(title) {\r\n\t\t var show = false;\r\n\t\t\tif (self.options.overrideTitle != null) {\r\n\t\t\t show = true;\r\n\t\t\t\tself.bbgCss.jq.title.html(self.options.overrideTitle);\r\n\t\t\t} else if (typeof(title) != 'undefined') {\r\n\t\t\t\tself.bbgCss.jq.title.html(title);\r\n\t\t\t\tshow = true;\r\n\t\t\t} else {\r\n\t\t\t\tself.bbgCss.jq.title.html('');\r\n\t\t\t}\r\n\t\t\tif (show) {\r\n\t\t\t\tself.bbgCss.jq.title.show();\r\n\t\t\t} else {\r\n\t\t\t\tself.bbgCss.jq.title.hide();\r\n\t\t\t}\r\n\t\t}", "function giveTitle(name) {\n document.getElementsByTagName(\"title\")[0].innerHTML = name;\n}", "function setTitle() {\n dt = formatDate(myDateFormat, appstate.date);\n dtextra = (appstate.date2 === null) ? '' : ' to ' + formatDate(myDateFormat, appstate.date2);\n $('#maptitle').html(\"Viewing \" + vartitle[appstate.ltype] +\n \" for \" + dt + \" \" + dtextra);\n $('#variable_desc').html(vardesc[appstate.ltype]);\n}", "function setPageTitle( pageId ) {\n if ( !pageId ) {\n throw \"ManageWorkOrder.setPageTitle: Required parameter pageId is undefined\";\n }\n // We are setting the title manually so don't translate it\n var title = Localization.getText( pageId ) + \" - \" + workOrder.documentNumber;\n var currentActivity = WorkOrder.getManageWorkOrderActivity();\n if ( isReadOnly() ) {\n title = title.concat( \" - \" + Localization.getText( \"viewOnly\" ) );\n } else if ( currentActivity == WorkOrder.MANAGE_WORK_ORDER_EDIT ) {\n title = title.concat( \" - \" + Localization.getText( \"editOnly\" ) );\n } else if ( currentActivity == WorkOrder.MANAGE_WORK_ORDER_OPEN_NOCLOCKING ) {\n title = title.concat( \" - \" + Localization.getText( \"editOnlyPartsOnly\" ) );\n }\n debug && console.log( \"ManageWorkOrder.setPageTitle: Setting page title to \" + title );\n var htmlPageId = $(\"div:jqmData(role='page')\").attr( \"id\" );\n $(\"h1#\" + htmlPageId).text( title );\n $(\"h1#\" + htmlPageId).attr( \"translate\", \"no\" );\n }", "function title() {\r\n drawScene(gl);\r\n if (!cube_title.isScrambling)\r\n cube_title.scramble();\r\n moveCamera({ movementX: velX, movementY: velY });\r\n cube_title.update(1 / 60);\r\n cube_title.show(programInfo);\r\n titleAnimationRequest = requestAnimationFrame(title);\r\n }", "switchToTitlePage() {\n if (this.currentPage !== null) {\n this.currentPage.hide();\n }\n Utility.RemoveElements(this.mainDiv);\n this.mainDiv.appendChild(this.titlePage.getDiv());\n this.currentPage = this.titlePage;\n this.titlePage.show();\n }", "function rewriteTitle() {\n\tif( typeof( window.SKIP_TITLE_REWRITE ) != 'undefined' && window.SKIP_TITLE_REWRITE ) {\n\t\treturn;\n\t}\n \n\tif( $('#title-meta').length == 0 ) {\n\t\treturn;\n\t}\n \n\tvar newTitle = $('#title-meta').html();\n\tif( skin == \"oasis\" ) {\n\t\t$('header.WikiaPageHeader > h1').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t\t$('header.WikiaPageHeader > h1').attr('style','text-align:' + $('#title-align').html() + ';');\n\t} else {\n\t\t$('.firstHeading').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t\t$('.firstHeading').attr('style','text-align:' + $('#title-align').html() + ';');\n\t}\n}", "function rewriteTitle() {\n\tif( typeof( window.SKIP_TITLE_REWRITE ) != 'undefined' && window.SKIP_TITLE_REWRITE ) {\n\t\treturn;\n\t}\n\n\tif( $('#title-meta').length == 0 ) {\n\t\treturn;\n\t}\n\n\tvar newTitle = $('#title-meta').html();\n\tif( skin == \"oasis\" ) {\n\t\t$('header.WikiaPageHeader > h1').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t\t$('header.WikiaPageHeader > h1').attr('style','text-align:' + $('#title-align').html() + ';');\n\t} else {\n\t\t$('.firstHeading').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t\t$('.firstHeading').attr('style','text-align:' + $('#title-align').html() + ';');\n\t}\n}", "function rewriteTitle() {\n\tif( typeof( window.SKIP_TITLE_REWRITE ) != 'undefined' && window.SKIP_TITLE_REWRITE ) {\n\t\treturn;\n\t}\n\n\tif( $('#title-meta').length == 0 ) {\n\t\treturn;\n\t}\n\n\tvar newTitle = $('#title-meta').html();\n\tif( skin == \"oasis\" ) {\n\t\t$('header.WikiaPageHeader > h1').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t\t$('header.WikiaPageHeader > h1').attr('style','text-align:' + $('#title-align').html() + ';');\n\t} else {\n\t\t$('.firstHeading').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t\t$('.firstHeading').attr('style','text-align:' + $('#title-align').html() + ';');\n\t}\n}", "function rewriteTitle() {\n\tif( typeof( window.SKIP_TITLE_REWRITE ) != 'undefined' && window.SKIP_TITLE_REWRITE ) {\n\t\treturn;\n\t}\n\n\tif( $('#title-meta').length == 0 ) {\n\t\treturn;\n\t}\n\n\tvar newTitle = $('#title-meta').html();\n\tif( skin == \"oasis\" ) {\n\t\t$('header.WikiaPageHeader > h1').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t\t$('header.WikiaPageHeader > h1').attr('style','text-align:' + $('#title-align').html() + ';');\n\t} else {\n\t\t$('.firstHeading').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t\t$('.firstHeading').attr('style','text-align:' + $('#title-align').html() + ';');\n\t}\n}", "function rewriteTitle() {\n\tif( typeof( window.SKIP_TITLE_REWRITE ) != 'undefined' && window.SKIP_TITLE_REWRITE ) {\n\t\treturn;\n\t}\n\n\tif( $('#title-meta').length == 0 ) {\n\t\treturn;\n\t}\n\n\tvar newTitle = $('#title-meta').html();\n\tif( skin == \"oasis\" ) {\n\t\t$('header.WikiaPageHeader > h1').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t\t$('header.WikiaPageHeader > h1').attr('style','text-align:' + $('#title-align').html() + ';');\n\t} else {\n\t\t$('.firstHeading').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t\t$('.firstHeading').attr('style','text-align:' + $('#title-align').html() + ';');\n\t}\n}", "function rewriteTitle() {\n\tif( typeof( window.SKIP_TITLE_REWRITE ) != 'undefined' && window.SKIP_TITLE_REWRITE ) {\n\t\treturn;\n\t}\n\n\tif( $('#title-meta').length === 0 ) {\n\t\treturn;\n\t}\n\n\tvar newTitle = $('#title-meta').html();\n\tif( skin == \"oasis\" ) {\n\t\t$('header.WikiaPageHeader > h1').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t\t$('header.WikiaPageHeader > h1').attr('style','text-align:' + $('#title-align').html() + ';');\n\t} else {\n\t\t$('.firstHeading').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t\t$('.firstHeading').attr('style','text-align:' + $('#title-align').html() + ';');\n\t}\n}", "function setTitle() {\n let niveau = getUrlParameter('level');\n $('#title').text(\"Niveau \" + niveau);\n}", "function changeTitle(){\n\tvar title = document.getElementById('title');\n\ttitle.innerHTML = 'New Title';\n\ttitle.style.color = 'red';\n}", "function replace_titre_page() {\r\n\tadd_log(3,\"replace_titre_page() > Début.\");\r\n\tvar nouv_titre = \"[\" + document.title.split(\" \")[1].toUpperCase() + \"] \" + var_divers['village_actif_nom'] + \" (\" + var_divers['village_actif_pos'][0] + \"|\" + var_divers['village_actif_pos'][1] + \")\";\r\n\tdocument.title = nouv_titre;\r\n\tadd_log(1,\"replace_titre_page() > Nouveau titre : \" + nouv_titre);\r\n\tadd_log(3,\"replace_titre_page() > Fin.\");\r\n\t}", "function setTitle()\n {\n var newTitle=document.title;\n //Bug 11844503 : Processing Icon For Popups\n //Once the popup contents are fetched from the popup region for parametrized\n //popups this method is called on iframe onload event.\n //call the processing icon javascript API to hide the icon.\n ChideLoadingFrame();\n if(newTitle != oldTitle)\n document.title=oldTitle;\n //bug 8883221:malmishr \n //This is for Iframe not to show the old data while the iframe is loading.\n if(divid != null)\n {\n var popupIframe=window.top.document.getElementById(iframeid);\n //bug 9696833\n if(!popupIframe)\n popupIframe = document.getElementById(iframeid);\n if(popupIframe!=null)\n popupIframe.style.visibility=\"visible\";\n popupFormName = getPopupFormName(popupIframe);\n // bug 9255491\n // Save off the initial state of the parameterized popup form.\n initialPopupFormState = getPopupFormState();\n } \n \n }", "function setTitle() {\n var title = $('h1#nyroModalTitle', modal.contentWrapper);\n if (title.length)\n title.text(currentSettings.title);\n else\n modal.contentWrapper.prepend('<h1 id=\"nyroModalTitle\">'+currentSettings.title+'</h1>');\n }", "function changeTitleForBackButton() {\n if (page.ios) {\n page.ios.title = \"Back\";\n }\n}", "function setPageTitle() {\n const pageTitle = document.getElementById('page-title');\n pageTitle.querySelector('.name').innerText = name;\n}", "setDefaultTitle() {\r\n this.defaultTitle = \"Messages - \" + this.storeAccess.getCurrentUser().name;\r\n let appTitleAction = {\r\n type: AppTitle_Action_1.AppTitleActionTypes.UPDATE_TITLE,\r\n payload: {\r\n title: this.defaultTitle\r\n }\r\n };\r\n this.storeAccess.dispatchAction(appTitleAction);\r\n }", "function set_tab_title (uuid, f_name) {\n\t\tvar info = {\n\t\t\tuuid : uuid,\n\t\t\ttitle : f_name\n\t\t};\n\t\ttoolbar.update_title(info);\n\n\t\tf_handle_cached.send_info ('*', 'title-change', info, 0);\n\t}", "static title(_title) {\n document.title = _title;\n }", "function updateAppTitle(title) {\n $('.mdl-layout-title').html(title);\n}", "function changeTitle($arr) {\n window.parent.document.title = $arr; // on change l'attribut <title>\n}", "function clearTitle() {\n $('title').html(\"Blacksmith\");\n}", "function preventTitleFlash() {\n const origTitle = document.querySelector('title').innerText;\n\n withObserver(onTitleChange, origTitle);\n}", "updateTitle(){ \n let title = '';\n const { head, instance } = this.entry;\n\n if (head.hasOwnProperty('title')){\n let prop = head.title;\n\n title = head.title\n if (typeof prop === 'function'){\n title = head.title.apply(instance);\n }\n }\n\n if (title && title.length > 0){\n document.title = title;\n }\n }", "function changeTitle() {\n let inputSelector = document.querySelector(\".inputSelector\");\n document.addEventListener(\"submit\", e => {\n e.preventDefault();\n document.title = inputSelector.value;\n document.querySelector(\".pageTitle\").innerHTML =\n \"Current page title is: \" +\n \"'\" +\n document.title +\n \"'\" +\n \" ,would you like to customize it?\";\n });\n}", "function setWindowTitle() {\n const title = ['ARROYO', APP_VERSION];\n if (ARROYO_ENV_NAME) {\n title.unshift(`[${ARROYO_ENV_NAME}]`);\n }\n\n document.getElementsByTagName('title')[0].innerHTML = title.join(' ');\n}", "function setTitle(){\n\tvar title = getMessage('title_abEditAction_list');\n\tView.panels.get('abEditAction_list').setTitle(title);\n}", "function updateTitle(titleKey) {\n if (!titleKey && $state.$current.data && $state.$current.data.pageTitle) {\n titleKey = $state.$current.data.pageTitle;\n }\n $translate(titleKey || 'global.title').then(function(title) {\n $window.document.title = title;\n });\n }", "setPageTitle(topic) {\n document.title = `Topic - ${topic}`;\n }", "function updateTitle(titleKey) {\n if (!titleKey && $state.$current.data && $state.$current.data.pageTitle) {\n titleKey = $state.$current.data.pageTitle;\n }\n $translate(titleKey || 'global.title').then(function (title) {\n $window.document.title = title;\n });\n }", "function setTitle () {\n\t\tvar min = 0;\n\t\tvar max = 4;\n\t\tvar random = Math.floor(Math.random() * (max - min + 1)) + min;\n\t\tvar titleSet = [\n\t\t\t\"Love it if We Made it\",\n\t\t\t\"Another Day in Paradise\",\n\t\t\t\"Business of Misdemeanors\",\n\t\t\t\"The Poetry is in the Streets\",\n\t\t\t\"Truth is only Hearsay\",\n\t\t\t\"It Dies in Darkness\"\n\t\t];\n\t\ttitle = titleSet[random];\n\t\tdocument.title = title;\n\t}", "function changePageTitle(){\n /*Change the page title*/\n var title = document.getElementById(\"floorTitle\");\n var name = \"\";\n switch(FLOOR){\n case 1: name = \"First\"; break;\n case 2: name = \"Second\"; break;\n case 3: name = \"Third\"; break;\n case 4: name = \"Fourth\"; break;\n case 5: name = \"Fifth\"; break;\n case 6: name = \"Sixth\"; break;\n case 7: name = \"Seventh\"; break;\n }\n name += \" Floor\";\n title.innerHTML = name;\n}", "function setTitle(filename) {\r\n\tvar title;\r\n\tif(filename) {\r\n\t\ttitle = filename+\" | Model Maker\";\r\n\r\n\t} else {\r\n\t\ttitle = \"Model Maker\";\r\n\t}\r\n\twindow.parent.document.title = title;\r\n}", "function fnTitleNotification(iCounter) {\n //Declare variable which stores the original title\n var sOriginalTitle = document.title;\n //Boolean switch set to 0\n var bSwitch = 0;\n //Declare iCounter\n var iCounter;\n //Declare the variable iTimer which runs function on a set interval\n var iTimer = setInterval(function() {\n //When the bSwitch is 0\n if (bSwitch == 0) {\n //Display the new document title\n document.title = \"PROPERTY MODIFIED\";\n //Set the bSwitch to 1\n bSwitch = 1;\n //If the bSwitch is 1 \n } else {\n //Set the document title to the original title\n document.title = sOriginalTitle;\n //Switch the bSwitch to 0 again\n bSwitch = 0;\n //Decrease the iCounter\n iCounter--;\n //If the iCounter is 0\n if (iCounter == 0) {\n //Stop the interval\n clearInterval(iTimer);\n }\n }\n }, 1000);\n}", "function setTitle(title) {\n document.getElementById(gs_title_id).innerHTML = title;\n document.getElementById(gs_nav_title_id).innerHTML = title;\n\n if (title == 'GitStrap') {\n document.getElementById(gs_ribbon_id).style.display = 'block';\n }\n}", "async setTitle(_) {\n this.titleView = _;\n this._top.attr(\"title\", this.titleView);\n select(this.element).attr(\"titleView\", this.titleView);\n select(this.element.shadowRoot.querySelector(\".title\")).text(_);\n }", "function setMovieTitle(){\n\tvar title = $('#title').attr('value');\n\t$('#headerText').text('Watching: ' + title);\n}", "function setPageTitle() {\n const pageTitle = document.getElementById('page-title'); // get a pointer to element with the id 'page-title'\n pageTitle.querySelector('.name').innerText = name; // find the class='name' in pageTitle and set it to name variable\n}", "function injectTitlePage(title,login,i){\n\t\t\tif($(\"#appML_navigation_bar\").length>0 && $(\"#appML_navigation_bar\").is(\".appML_auto_fill\")){\n\t\t\t\tvar title_visibility=\"display:none\";\n\t\t\t\tif(i==current_page)\n\t\t\t\t\ttitle_visibility=\"\";\n\t\t\t\tif(login!=null)\n\t\t\t\t\ttitle=\"Login\";\n\t\t\t\t$(\"#appML_navigation_bar\").append($(\"<div style='position:relative'><div style='\"+title_visibility+\"'>\"+title+\"</div><div class='back'>Back</div></div>\"));\n\t\t\t}\n\t\t}", "function clearFlash() {\r\n if (timeout) {\r\n clearTimeout(timeout);\r\n timeout = undefined;\r\n }\r\n\r\n document.title = original;\r\n}", "function UpdateTitle() {\r\n if (isCustomTitleUpdate) {\r\n isCustomTitleUpdate = false;\r\n return;\r\n }\r\n //x++;\r\n var strAppTitle = document.title.replace(/.+ \\[/i, '').replace(\"\\]\", '');\r\n var strFeedTitle = strAppTitle;\r\n //Get the feed or folder title from the 'chrome-title' element\r\n if (document.getElementById('chrome').className.search(/\\bhidden\\b/i) == -1) {\r\n strFeedTitle = document.getElementById('chrome-title').innerHTML;\r\n strFeedTitle = strFeedTitle.replace(/<a.+?>/i, ''); \r\n strFeedTitle = strFeedTitle.replace(/ <span.+/i, '');\r\n strFeedTitle = strFeedTitle.replace(/<.+?>/g, '');\r\n //Decode the HTML so ampersands, etc. display properly\r\n var div = document.createElement('div');\r\n div.innerHTML = strFeedTitle;\r\n strFeedTitle = div.firstChild.nodeValue;\r\n //Append Google Reader app name onto the end\r\n strFeedTitle = strFeedTitle + ' - [' + strAppTitle + ']';\r\n }\r\n //strFeedTitle = strFeedTitle + ':: ' + x.toString();\r\n isCustomTitleUpdate = true;\r\n document.title = strFeedTitle;\r\n}", "static setTitle(title) {\n $(\"#main_title\").text(title);\n $(\".active\").removeClass(\"active\")\n if (title == \"Add/Edit a character\") {\n $(\"#nav-\" + \"editCharacter\").addClass(\"active\")\n } else\n $(\"#nav-\" + title).addClass(\"active\")\n }", "setTitle(newTitle) {\n this._doc.title = newTitle || '';\n }", "setTitle(newTitle) {\n this._doc.title = newTitle || '';\n }", "setTitle(newTitle) {\n this._doc.title = newTitle || '';\n }", "setTitle(newTitle) {\n this._doc.title = newTitle || '';\n }", "setTitle(newTitle) {\n this._doc.title = newTitle || '';\n }", "function changeHeaderTitle(newTitle){\n headerTitleDiv.innerHTML = newTitle;\n }", "function alternativeDocTitle() {\n var $title, title, prefix, postfix;\n setTimeout(function() {\n $title = $('head title');\n title = $title.text().replace('Site', '');\n prefix = getCampaignPrefix();\n postfix = getClientName();\n prefix && (title = title.replace('Campaign ', ''));\n $title.text((prefix ? prefix + ' ' : '') + title + (postfix ? ' | ' + postfix : ''));\n }, 2000);\n }", "setDocumentTitle() {\n let title = this.$options.filters.capitalize(this.title);\n title = this.$options.filters.split(title);\n document.title = title;\n }", "UpdateTitle() {\n var Key = this.TitleKey || this.Name;\n\n var self = this;\n tp.Res.GS(Key, function (Value, UserTag) {\n self.Title = Value;\n }, null, Key, this);\n\n }", "async _setDocumentTitle() {\n document.title = this.prefix + this.title + this.suffix;\n }", "function showTitle() {\n if ($(\".sliderTitle#title\" + currentSlide).text().length > 0) {\n $(\"div.title\").stop();\n $(\"div.title\").fadeTo(titleFadeTime, titleOpacity);\n }\n }", "updateWindowTitle() {\n if (this.win) {\n const {translatableFlat} = this.core.make('osjs/locale');\n const prefix = translatableFlat(this.proc.metadata.title);\n const title = this._createTitle(prefix);\n\n this.win.setTitle(title);\n }\n }" ]
[ "0.78957", "0.7689076", "0.7599403", "0.75987047", "0.75961", "0.7569214", "0.7541583", "0.75138783", "0.74872434", "0.74475104", "0.74239624", "0.7418987", "0.739139", "0.739139", "0.7379649", "0.7367359", "0.7354041", "0.7346799", "0.7338706", "0.7328233", "0.73277617", "0.7298219", "0.7287877", "0.72805476", "0.72679543", "0.72403014", "0.72390103", "0.7230223", "0.72199804", "0.7219446", "0.7218075", "0.7213368", "0.7211384", "0.71858734", "0.71828", "0.7111182", "0.7091456", "0.70877016", "0.7056367", "0.70476216", "0.7032241", "0.70129514", "0.7007993", "0.70050216", "0.70002687", "0.6980726", "0.6963069", "0.6952603", "0.6948084", "0.6944086", "0.69102365", "0.69102365", "0.69102365", "0.69102365", "0.6906564", "0.69025964", "0.689691", "0.689144", "0.6883788", "0.687825", "0.6868243", "0.68640035", "0.68508637", "0.68386924", "0.68308234", "0.6827634", "0.6817382", "0.68090296", "0.6791239", "0.6776795", "0.67695785", "0.6765267", "0.67400944", "0.67315525", "0.6729293", "0.67289597", "0.67234313", "0.6723109", "0.67171574", "0.6691272", "0.6690737", "0.6680375", "0.6675397", "0.6670303", "0.6663379", "0.665991", "0.66501254", "0.6618425", "0.6613656", "0.6613656", "0.6613656", "0.6613656", "0.6613656", "0.66078377", "0.6604024", "0.66025215", "0.6601157", "0.65829533", "0.65811706", "0.6580917" ]
0.68549216
62
clear the flashing page title
function clearFlash() { if (timeout) { clearTimeout(timeout); timeout = undefined; } document.title = original; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearTitle() {\n $('title').html(\"Blacksmith\");\n}", "function titleClear(){\n document.querySelector(\".title\").style.display = \"none\";\n document.querySelector(\".line\").style.display = \"none\";\n document.querySelector(\".intro\").style.display = \"none\";\n document.querySelector(\".start\").style.display = \"none\";\n }", "function clearh2() {\n\t\tdocument.getElementById('pageTitle').innerHTML = \"&nbsp;\";\n\t}", "function replacePageTitle() {\n\t$('title').empty();\n\t$('title').append($( '.menu nav ul li.active-menu a' ).text());\n}", "function preventTitleFlash() {\n const origTitle = document.querySelector('title').innerText;\n\n withObserver(onTitleChange, origTitle);\n}", "function resetTitle() {\n let t = $(\"title\").text()\n let notifications = \".gt2-nav-left a[href='/notifications'] > div > div:nth-child(1) > div:nth-child(2)\"\n let messages = \".gt2-nav-left a[href='/messages'] > div > div:nth-child(1) > div:nth-child(2)\"\n let nr = 0\n if ($(notifications).length) nr += parseInt($(notifications).text())\n if ($(messages).length) nr += parseInt($(messages).text())\n $(\"title\").text(`${nr > 0 ? `(${nr}) ` : \"\"}${t.startsWith(\"[\") ? t.split(\"] \")[1] : t}`)\n }", "function hideTitle() {\n $(\"div.title\").stop();\n $(\"div.title\").fadeTo(titleFadeTime, 0);\n }", "destroyTitleScreen() {\n\t\tlet titleScreen = document.querySelector(\".titleScreen\");\n\t\ttitleScreen.parentNode.removeChild(titleScreen);\n\t}", "function refreshPageTitle() {\n if (!PlaneCountInTitle && !MessageRateInTitle) {\n document.title = PageName;\n return;\n }\n\n var aircraftCount = \"\";\n var rate = \"\";\n\n if (PlaneCountInTitle) {\n aircraftCount += TrackedAircraft;\n }\n\n if (MessageRateInTitle && MessageRate) {\n rate += ' - ' + MessageRate.toFixed(1) + ' msg/sec';\n }\n\n document.title = '(' + aircraftCount + ') ' + PageName + rate;\n}", "function ChangePageTitle(message) {\n if (message != '') {\n window.document.title = message.trim();\n }\n}", "function shortenPageTitle() {\n document.getElementById('main-title').innerHTML = \"Fast & Furious\";\n }", "function changeTitle() {\n document.title = 'Star Wars';\n }", "function setTitle(title) {\n\tdocument.title = title;\n}", "function playTitle()\n\n\t{\n\n\tdocument.title = \"BlahTherapy\";\n\n\twindow.setTimeout('document.title=\"*New Message* BlahTherapy\";', 1000);\n\n\twindow.setTimeout('document.title=\"BlahTherapy\";', 3000);\n\n\n\n\tif (playTitleFlag == true)\n\n\t\t{\n\n\t\twindow.setTimeout('playTitle();', 4000);\n\n\t\t}\n\n\t}", "function clearMessages() {\n titleList.innerHTML = '';\n }", "function setTitle()\n {\n var newTitle=document.title;\n //Bug 11844503 : Processing Icon For Popups\n //Once the popup contents are fetched from the popup region for parametrized\n //popups this method is called on iframe onload event.\n //call the processing icon javascript API to hide the icon.\n ChideLoadingFrame();\n if(newTitle != oldTitle)\n document.title=oldTitle;\n //bug 8883221:malmishr \n //This is for Iframe not to show the old data while the iframe is loading.\n if(divid != null)\n {\n var popupIframe=window.top.document.getElementById(iframeid);\n //bug 9696833\n if(!popupIframe)\n popupIframe = document.getElementById(iframeid);\n if(popupIframe!=null)\n popupIframe.style.visibility=\"visible\";\n popupFormName = getPopupFormName(popupIframe);\n // bug 9255491\n // Save off the initial state of the parameterized popup form.\n initialPopupFormState = getPopupFormState();\n } \n \n }", "function flashCount(count) {\r\n if (count < 1) {\r\n clearFlash();\r\n }\r\n\r\n var newTitle = \"[ \" + count + \" ] \" + original;\r\n\r\n timeout = setInterval(function() {\r\n document.title = (document.title == original) ? newTitle : original;\r\n }, 1000);\r\n}", "function cleanUpThreadTitle() {\n var title = Thread.title;\n \n if(Page.isThread() && title.text().indexOf('[') > -1) {\n title.text(title.text().substring(0, title.text().indexOf('[') - 1));\n } \n}", "switchToTitlePage() {\n if (this.currentPage !== null) {\n this.currentPage.hide();\n }\n Utility.RemoveElements(this.mainDiv);\n this.mainDiv.appendChild(this.titlePage.getDiv());\n this.currentPage = this.titlePage;\n this.titlePage.show();\n }", "componentWillUnMount() {\n document.title = Constants.documentTitles.empty;\n }", "function homeFlashyChainTitleHide(){\n\t$('#title')\n\t\t.transition({\n\t\t\tanimation : 'tada',\n\t\t\tduration : '.9s',\n\t\t})\n\t\t.transition({\n\t\t\tanimation : 'scale',\n\t\t\tonComplete : function() {\n\t\t\t\thomeFlashyChainQuoteSlideIn();\n\t\t\t}\n\t\t})\n\t;\n}", "setTitle(title) {\n document.title = title;\n }", "function setTitle(_title) {\n chrome.browserAction.setTitle({title:_title});\n}", "function setTitle() {\n var dateString = dateFormat(new Date(), 'HH:MM:ss');\n document.title = title + ' - ' + APP_PACKAGE_INFO.version;\n }", "clearTitle() {\n this.inputValue = \"\";\n this.not_found = false;\n }", "function resetWelcomePage() {\n document.getElementById(\"welcomeVideo\").style.visibility = \"visible\";\n document.getElementById(\"welcomeVideo\").style.opacity = 100;\n document.getElementById(\"welcomeText\").style.visibility = \"visible\";\n document.getElementById(\"welcomeText\").style.opacity = 100;\n document.getElementById(\"enterName\").style.visibility = \"visible\";\n document.getElementById(\"enterName\").style.opacity = 100;\n document.getElementById(\"skipButton\").style.visibility = \"visible\";\n document.getElementById(\"skipButton\").style.opacity = 100;\n\n document.getElementById(\"navigationBar\").style.visibility = \"hidden\";\n document.getElementById(\"navigationBar\").style.opacity = 0;\n\n localStorage.clickcount = 0;\n localStorage.removeItem(\"calumwebsiteusername\");\n}", "setTitle(title) {\r\n this.title = siteTitle + title\r\n document.title = Site.info.siteName + ' ' + siteTitle + title\r\n }", "function doTitles() {\r\n if ( !(ignoreTitle[0]||hiliteTitle[0]) ) return;\r\n for (var i=0;i<pageTitles.length;i++) { // Hiding\r\n if (ignoreTitle[0]) for (var k=0;k<ignoreTitle.length;k++) {\r\n var test = new RegExp(ignoreTitle[k],\"gi\");\r\n if ( pageTitles[i].match(test) ) {\r\n if (hideOnly) {\r\n hideProperty(pageIDs[i],lang('Hidden')+' ('+lang('Title')+': '+ignoreTitle[k]+')');\r\n } else {\r\n var rej = document.getElementById('immo'+pageIDs[i]);\r\n rej.parentNode.removeChild(rej);\r\n }\r\n break;\r\n }\r\n }\r\n if (hiliteTitle[0]) for (var k=0;k<hiliteTitle.length;k++) {\r\n test = new RegExp(hiliteTitle[k],\"gi\");\r\n if (pageTitles[i].match(test)) {\r\n hiliteProperty(pageIDs[i]);\r\n break;\r\n }\r\n }\r\n }\r\n}", "function hideTitle() {\n var $panel = $('#hacker-hero');\n var hidePanel = new TimelineMax({delay:1.5});\n hidePanel.to($panel, 0.5, {opacity:0})\n .to($panel, 1, {height:0, minHeight:0, className:\"+=hidden\"});\n }", "function changeDocumentTitle( title )\n{\n document.title = title;\n}", "function changeBrowserTitle(title) \r\n{\r\n\t document.title = title; \r\n\t \r\n}", "function titlePage(){\n\t\t$('.title-page').html('<h2 class=\"text-center\">'+objet_concours[last_concours]+'</h2>');\n\t}", "function title() {\r\n drawScene(gl);\r\n if (!cube_title.isScrambling)\r\n cube_title.scramble();\r\n moveCamera({ movementX: velX, movementY: velY });\r\n cube_title.update(1 / 60);\r\n cube_title.show(programInfo);\r\n titleAnimationRequest = requestAnimationFrame(title);\r\n }", "function setPageTitle() {\n const page = document.getElementById('title');\n page.innerHTML = pageTitle;\n}", "function changeTitleForBackButton() {\n if (page.ios) {\n page.ios.title = \"Back\";\n }\n}", "function updatePageTitle (string) {\n document.title = string + ' - timer_js';\n}", "function showTitle() {\n if ($(\".sliderTitle#title\" + currentSlide).text().length > 0) {\n $(\"div.title\").stop();\n $(\"div.title\").fadeTo(titleFadeTime, titleOpacity);\n }\n }", "function updateOuterPage(title) {\n if (WinJS.Navigation.canGoBack && ConferenceApp.Api.isSignedIn()) {\n $('#backButton').removeAttr('disabled');\n }\n else {\n $('#backButton').attr('disabled', true);\n }\n\n $('#pageTitle').removeClass('hideTextOverflow');\n $('#pageTitle').text(title);\n $('#outerPage').removeClass('darkTitle');\n\n }", "function setTitle(title) {\n\t$( \"title\" ).html( title )\n}", "function changeSettingsTitle() {\n let t = $(\"title\").html()\n $(\"title\").html(`${t.startsWith(\"(\") ? `${t.split(\" \")[0]} ` : \"\"}${SCRIPT_NAME} / Twitter`)\n }", "function clearPage() {\n $('#htmlForSW5').css('display', 'none');\n $('#htmlForSE12').css('display', 'none');\n $('#htmlForSE14').css('display', 'none');\n}", "function faviconBlink () {\n d.title = '*' + d.title;\n $(window).one('focus', function () {\n d.title = d.title.substr(1);\n });\n}", "function updatePageTitle() {\n $rootScope.page_title = Mayocat.applicationName + ' | ' + $translate('routes.title.' + $route.current.titleTranslation);\n }", "function setTitle() {\r\n\t\tvar title = $('h1#nyroModalTitle', modal.contentWrapper);\r\n\t\tif (title.length)\r\n\t\t\ttitle.text(currentSettings.title);\r\n\t\telse\r\n\t\t\tmodal.contentWrapper.prepend('<h1 id=\"nyroModalTitle\">'+currentSettings.title+'</h1>');\r\n\t}", "function setPageTitle() {\n const title = document.getElementById('title');\n title.innerText = pageTitle;\n}", "function setPageTitle() {\n const title = document.getElementById('title');\n title.innerText = pageTitle;\n}", "function setTitle(paramTitle)\n{\n\twindow.document.title = paramTitle;\n}", "function fixTitle() {\r\n window.document.title = window.document.title.replace(/[^-]* - [^-]* - /, \"\") + \" - Safari Online\";\r\n}", "showTitle() {\n this.title.classList.remove(this.workingClass);\n }", "function setPageTitle() {\nconst title = document.querySelector('#title');\n\ntitle.innerText = pageTitle;\n\n}", "function setPageTitle() {\n const titleHTML = document.getElementById('title');\n titleHTML.innerText = pageTitle;\n}", "static title(_title) {\n document.title = _title;\n }", "function HeadingChange(){\n cl(document.title = \"This is new title\")\n}", "function change_title(){\n\tvar isOldTitle = true;\n\tvar oldTitle = \"Draft\";\n\tvar newTitle = \"Your turn!\";\n\tvar interval = null;\n\tclearInterval(interval);\n\tfunction changeTitle() {\n\t\tif (is_turn){\n \tdocument.title = isOldTitle ? oldTitle : newTitle;\n \tisOldTitle = !isOldTitle;\n\t}\n\telse{\n\tdocument.title = 'Draft'\n\t}}\n\tinterval = setInterval(changeTitle, 1000);\n\t$(window).focus(function () {\n \tclearInterval(interval);\n \t\t$(\"title\").text('Draft');\n\t});\n\t$('body').click(function () {\n\t\tclearInterval(interval);\n\t\t$('title').text('Draft');\n\t});\n\t}", "function removeFromTitle(str) {\r\n title = str;\r\n }", "function replace_titre_page() {\r\n\tadd_log(3,\"replace_titre_page() > Début.\");\r\n\tvar nouv_titre = \"[\" + document.title.split(\" \")[1].toUpperCase() + \"] \" + var_divers['village_actif_nom'] + \" (\" + var_divers['village_actif_pos'][0] + \"|\" + var_divers['village_actif_pos'][1] + \")\";\r\n\tdocument.title = nouv_titre;\r\n\tadd_log(1,\"replace_titre_page() > Nouveau titre : \" + nouv_titre);\r\n\tadd_log(3,\"replace_titre_page() > Fin.\");\r\n\t}", "function setPageTitle() {\n const titleElement = document.getElementById('title');\n titleElement.innerText = pageTitle;\n}", "function setPageTitle (newTitle) {\n title = newTitle;\n }", "function setTitle(title) {\r\n\t\t var show = false;\r\n\t\t\tif (self.options.overrideTitle != null) {\r\n\t\t\t show = true;\r\n\t\t\t\tself.bbgCss.jq.title.html(self.options.overrideTitle);\r\n\t\t\t} else if (typeof(title) != 'undefined') {\r\n\t\t\t\tself.bbgCss.jq.title.html(title);\r\n\t\t\t\tshow = true;\r\n\t\t\t} else {\r\n\t\t\t\tself.bbgCss.jq.title.html('');\r\n\t\t\t}\r\n\t\t\tif (show) {\r\n\t\t\t\tself.bbgCss.jq.title.show();\r\n\t\t\t} else {\r\n\t\t\t\tself.bbgCss.jq.title.hide();\r\n\t\t\t}\r\n\t\t}", "function clearEventSpecificInfo() {\n\twindow.location.hash = '';\n\tdocument.title = 'Events around you - Furlango';\n\tif (currentInfoWindow) { // defined in watodoo.js\n\t\tcurrentInfoWindow.close();\n\t}\n}", "function setPageTitle(){\n\tif(pmgConfig.pmgSubTitle){\n\t\tdocument.tile = pmgConfig.siteTitle + ' - ' + pmgConfig.pmgSubTitle;\n\t}\n\telse{\n\t\tdocument.tile = pmgConfig.siteTitle;\n\t}\n}", "function playTitle(){\n\tdocument.title = \"JoChat\";\n\twindow.setTimeout('document.title=\"|| Jomblo || \";', 1000);\n\twindow.setTimeout('document.title=\"__ Jomblo Chat __\";', 2000);\n\twindow.setTimeout('document.title=\"Chat\";', 3000);\n\n\tif (playTitleFlag == true){\n\t\twindow.setTimeout('playTitle();', 4000);\n\t}\n}", "function titleText(title) {\n pageTitle.textContent = title;\n}", "function resetPage(params) {\n $(\"body\").removeClass(\"game-over\");\n game_over = true;\n}", "function setTitle() {\n var title = $('h1#nyroModalTitle', modal.contentWrapper);\n if (title.length)\n title.text(currentSettings.title);\n else\n modal.contentWrapper.prepend('<h1 id=\"nyroModalTitle\">'+currentSettings.title+'</h1>');\n }", "function reset() {\n\t\tself.media.hide().empty();\n\t\tself.win.attr('class', 'el-finder-ql').css('z-index', self.fm.zIndex);\n\t\tself.title.empty();\n\t\tself.ico.attr('style', '').show();\n\t\tself.add.hide().empty();\n\t\tself._hash = '';\n\t}", "function hideSubtitle(elem) {\n elem.html('');\n }", "returnToTitle(){\n //console.log(\"returnToTitle FUNCIONA\");\n this.scene.stop('CONTROL_KEYS_SCENE_KEY');\n this.scene.resume('TITLE_SCENE_KEY');\n }", "function titleSetup() {\n\t\t\t\t\tif(scope.title !== undefined) {\n\t\t\t\t\t\t// For now we don't display the title\n\t\t\t\t\t\t// sel.select(\"span.list-title\").text(scope.title);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsel.select(\"span.list-title\").text(null);\n\t\t\t\t\t}\n\t\t\t\t}", "function rewriteTitle() {\n\tif( typeof( window.SKIP_TITLE_REWRITE ) != 'undefined' && window.SKIP_TITLE_REWRITE ) {\n\t\treturn;\n\t}\n \n\tif( $('#title-meta').length == 0 ) {\n\t\treturn;\n\t}\n \n\tvar newTitle = $('#title-meta').html();\n\tif( skin == \"oasis\" ) {\n\t\t$('header.WikiaPageHeader > h1').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t\t$('header.WikiaPageHeader > h1').attr('style','text-align:' + $('#title-align').html() + ';');\n\t} else {\n\t\t$('.firstHeading').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t\t$('.firstHeading').attr('style','text-align:' + $('#title-align').html() + ';');\n\t}\n}", "function alternativeDocTitle() {\n var $title, title, prefix, postfix;\n setTimeout(function() {\n $title = $('head title');\n title = $title.text().replace('Site', '');\n prefix = getCampaignPrefix();\n postfix = getClientName();\n prefix && (title = title.replace('Campaign ', ''));\n $title.text((prefix ? prefix + ' ' : '') + title + (postfix ? ' | ' + postfix : ''));\n }, 2000);\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 clearScheduleTitle(e) {\n\t\tvar id = e.target.id;\n\t\tvar target;\n\n\t\tif (id === 'clearMain') target = document.getElementById('mainInput');\n\t\telse target = document.getElementById('otherInput');\n\n\t\ttarget.value = '';\n\t\ttarget.focus();\n\t}", "function setTitle () {\n\t\tvar min = 0;\n\t\tvar max = 4;\n\t\tvar random = Math.floor(Math.random() * (max - min + 1)) + min;\n\t\tvar titleSet = [\n\t\t\t\"Love it if We Made it\",\n\t\t\t\"Another Day in Paradise\",\n\t\t\t\"Business of Misdemeanors\",\n\t\t\t\"The Poetry is in the Streets\",\n\t\t\t\"Truth is only Hearsay\",\n\t\t\t\"It Dies in Darkness\"\n\t\t];\n\t\ttitle = titleSet[random];\n\t\tdocument.title = title;\n\t}", "function removeModalSharePointTitle() {\n $(\".ms-dlgTitleText\").css(\"display\", \"none\");\n}", "function clear_start(){\n title_card.style.display='none';\n\n}", "function zselex_title_init()\n{\n// Event.observe('zselex_title', 'change', savedraft);\n// $('zselex_urltitle_details').hide();\n $('zselex_status_info').hide();\n $('zselex_picture_warning').hide();\n \n // not the correct location but for reference later on:\n //new PeriodicalExecuter(savedraft, 30);\n}", "function titleScreen() {\n // var testHero = new Hero();\n flavor.style.visibility = 'visible';\n beginGame.style.visibility = 'hidden';\n startButton.style.visibility = 'visible';\n story.textContent = '';\n}", "function UpdateTitle() {\r\n if (isCustomTitleUpdate) {\r\n isCustomTitleUpdate = false;\r\n return;\r\n }\r\n //x++;\r\n var strAppTitle = document.title.replace(/.+ \\[/i, '').replace(\"\\]\", '');\r\n var strFeedTitle = strAppTitle;\r\n //Get the feed or folder title from the 'chrome-title' element\r\n if (document.getElementById('chrome').className.search(/\\bhidden\\b/i) == -1) {\r\n strFeedTitle = document.getElementById('chrome-title').innerHTML;\r\n strFeedTitle = strFeedTitle.replace(/<a.+?>/i, ''); \r\n strFeedTitle = strFeedTitle.replace(/ <span.+/i, '');\r\n strFeedTitle = strFeedTitle.replace(/<.+?>/g, '');\r\n //Decode the HTML so ampersands, etc. display properly\r\n var div = document.createElement('div');\r\n div.innerHTML = strFeedTitle;\r\n strFeedTitle = div.firstChild.nodeValue;\r\n //Append Google Reader app name onto the end\r\n strFeedTitle = strFeedTitle + ' - [' + strAppTitle + ']';\r\n }\r\n //strFeedTitle = strFeedTitle + ':: ' + x.toString();\r\n isCustomTitleUpdate = true;\r\n document.title = strFeedTitle;\r\n}", "function resetHeader() {\r\n setTimeout(() => {\r\n document.querySelector(\"h1\").textContent = \"Refresh Me !\";\r\n }, 5000);\r\n}", "function page_reset() {\r\n document.getElementById(\"transcript\").value=\"\";\r\n document.getElementById('name_theme_box').style.visibility = 'hidden';\r\n document.getElementById('save_error_msg').style.display = 'none';\r\n document.getElementById('error_msg').style.display = 'none';\r\n document.getElementById('name_error_msg').style.display = 'none';\r\n document.getElementById('save_transcript_options').style.visibility = 'hidden';\r\n removeTags(tags);\r\n document.getElementById(\"available_tags\").innerHTML='<h4 style=\"text-align: center;\">Currently no tags made</h4>';\r\n}", "setDefaultTitle() {\r\n this.defaultTitle = \"Messages - \" + this.storeAccess.getCurrentUser().name;\r\n let appTitleAction = {\r\n type: AppTitle_Action_1.AppTitleActionTypes.UPDATE_TITLE,\r\n payload: {\r\n title: this.defaultTitle\r\n }\r\n };\r\n this.storeAccess.dispatchAction(appTitleAction);\r\n }", "function rewriteTitle() {\n\tif( typeof( window.SKIP_TITLE_REWRITE ) != 'undefined' && window.SKIP_TITLE_REWRITE ) {\n\t\treturn;\n\t}\n\n\tif( $('#title-meta').length == 0 ) {\n\t\treturn;\n\t}\n\n\tvar newTitle = $('#title-meta').html();\n\tif( skin == \"oasis\" ) {\n\t\t$('header.WikiaPageHeader > h1').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t\t$('header.WikiaPageHeader > h1').attr('style','text-align:' + $('#title-align').html() + ';');\n\t} else {\n\t\t$('.firstHeading').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t\t$('.firstHeading').attr('style','text-align:' + $('#title-align').html() + ';');\n\t}\n}", "function rewriteTitle() {\n\tif( typeof( window.SKIP_TITLE_REWRITE ) != 'undefined' && window.SKIP_TITLE_REWRITE ) {\n\t\treturn;\n\t}\n\n\tif( $('#title-meta').length == 0 ) {\n\t\treturn;\n\t}\n\n\tvar newTitle = $('#title-meta').html();\n\tif( skin == \"oasis\" ) {\n\t\t$('header.WikiaPageHeader > h1').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t\t$('header.WikiaPageHeader > h1').attr('style','text-align:' + $('#title-align').html() + ';');\n\t} else {\n\t\t$('.firstHeading').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t\t$('.firstHeading').attr('style','text-align:' + $('#title-align').html() + ';');\n\t}\n}", "function rewriteTitle() {\n\tif( typeof( window.SKIP_TITLE_REWRITE ) != 'undefined' && window.SKIP_TITLE_REWRITE ) {\n\t\treturn;\n\t}\n\n\tif( $('#title-meta').length == 0 ) {\n\t\treturn;\n\t}\n\n\tvar newTitle = $('#title-meta').html();\n\tif( skin == \"oasis\" ) {\n\t\t$('header.WikiaPageHeader > h1').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t\t$('header.WikiaPageHeader > h1').attr('style','text-align:' + $('#title-align').html() + ';');\n\t} else {\n\t\t$('.firstHeading').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t\t$('.firstHeading').attr('style','text-align:' + $('#title-align').html() + ';');\n\t}\n}", "function rewriteTitle() {\n\tif( typeof( window.SKIP_TITLE_REWRITE ) != 'undefined' && window.SKIP_TITLE_REWRITE ) {\n\t\treturn;\n\t}\n\n\tif( $('#title-meta').length == 0 ) {\n\t\treturn;\n\t}\n\n\tvar newTitle = $('#title-meta').html();\n\tif( skin == \"oasis\" ) {\n\t\t$('header.WikiaPageHeader > h1').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t\t$('header.WikiaPageHeader > h1').attr('style','text-align:' + $('#title-align').html() + ';');\n\t} else {\n\t\t$('.firstHeading').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t\t$('.firstHeading').attr('style','text-align:' + $('#title-align').html() + ';');\n\t}\n}", "setDocumentTitle() {\n let title = this.$options.filters.capitalize(this.title);\n title = this.$options.filters.split(title);\n document.title = title;\n }", "removeTitle() {\n this.title.classList.add(this.workingClass);\n }", "updateTitle(){ \n let title = '';\n const { head, instance } = this.entry;\n\n if (head.hasOwnProperty('title')){\n let prop = head.title;\n\n title = head.title\n if (typeof prop === 'function'){\n title = head.title.apply(instance);\n }\n }\n\n if (title && title.length > 0){\n document.title = title;\n }\n }", "function rewriteTitle() {\n\tif( typeof( window.SKIP_TITLE_REWRITE ) != 'undefined' && window.SKIP_TITLE_REWRITE ) {\n\t\treturn;\n\t}\n\n\tif( $('#title-meta').length === 0 ) {\n\t\treturn;\n\t}\n\n\tvar newTitle = $('#title-meta').html();\n\tif( skin == \"oasis\" ) {\n\t\t$('header.WikiaPageHeader > h1').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t\t$('header.WikiaPageHeader > h1').attr('style','text-align:' + $('#title-align').html() + ';');\n\t} else {\n\t\t$('.firstHeading').html('<div id=\"title-meta\" style=\"display: inline;\">' + newTitle + '</div>');\n\t\t$('.firstHeading').attr('style','text-align:' + $('#title-align').html() + ';');\n\t}\n}", "function setPageTitle() {\n\n let h1 = document.getElementById('title');\n h1.innerText = pageTitle;\n}", "function FancyTitleText(){\n\t\t\t$('.titletext').fadeOut(1500); \t\n $('.titletext').fadeIn(1500);\n }", "function setPageTitle() {\n document.getElementById('page-title').innerText = parameterUsername;\n document.title = parameterUsername + ' - User Page';\n}", "function grief() {\r\n document.body.innerHTML = ''\r\n}", "function clearScreen() {\n getlocation.html(\"\");\n locationStatus.html(\"\");\n showTemp.html(\"\");\n shortNews.html(\"\");\n dataTable.hide();\n $(\"#errorMessage\").hide();\n content.hide();\n loader.hide();\n }", "function setWindowTitle() {\n const title = ['ARROYO', APP_VERSION];\n if (ARROYO_ENV_NAME) {\n title.unshift(`[${ARROYO_ENV_NAME}]`);\n }\n\n document.getElementsByTagName('title')[0].innerHTML = title.join(' ');\n}", "function page_reset()\r\n{\r\n init();\r\n}", "setTitle(newTitle) {\n this._doc.title = newTitle || '';\n }", "setTitle(newTitle) {\n this._doc.title = newTitle || '';\n }", "setTitle(newTitle) {\n this._doc.title = newTitle || '';\n }" ]
[ "0.79916203", "0.76807255", "0.7311639", "0.6959074", "0.6955087", "0.6925484", "0.68691003", "0.68407184", "0.68332314", "0.6786957", "0.6736297", "0.6689621", "0.6628867", "0.6573916", "0.65599525", "0.6555257", "0.65461123", "0.6541896", "0.65411365", "0.64804876", "0.6468671", "0.64643204", "0.6446661", "0.6442072", "0.64392614", "0.6434762", "0.642262", "0.64186907", "0.6416193", "0.6409412", "0.640063", "0.6389447", "0.6382168", "0.6378064", "0.6369336", "0.63622564", "0.6358349", "0.63471186", "0.63347673", "0.63325727", "0.63276684", "0.6301735", "0.6301503", "0.63011473", "0.62986195", "0.62986195", "0.6267761", "0.6263025", "0.6254817", "0.6247599", "0.6244181", "0.6235639", "0.6223641", "0.6223027", "0.6222525", "0.622201", "0.6216714", "0.6208086", "0.6206582", "0.61943865", "0.61933005", "0.6190489", "0.61587715", "0.61514634", "0.6145617", "0.6132954", "0.6129124", "0.6120842", "0.6102502", "0.6068425", "0.60597605", "0.60555536", "0.60524577", "0.605215", "0.6046026", "0.604449", "0.60380375", "0.6032995", "0.60310566", "0.60297173", "0.60291135", "0.6024645", "0.6015494", "0.6015494", "0.6015494", "0.6015494", "0.6011319", "0.6008949", "0.60042477", "0.6003109", "0.6001574", "0.5995932", "0.5989135", "0.5978289", "0.5976508", "0.5976095", "0.5959987", "0.5958737", "0.5958737", "0.5958737" ]
0.8067197
0
change the badget ico in IVLE
function changeCount(count) { Tinycon.setBubble(count); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function il(a,b,c,d){this.Y=null;this.Ya=Number(c);this.xa=Number(b);this.Vd={height:this.Ya+10,width:this.xa};this.eb=d||\"\";this.Ob(a)}", "influence () {\n return parseInt(this.I, 16);\n }", "function prepOli(img) {\n var orig = img;\n img = renameOli(img);\n img = fmask(img);\n img = calcNbr(img);\n return ee.Image(img.copyProperties(orig, orig.propertyNames()));\n}", "function i(e) {\n return (\"0\" + e.toString(16)).substr(-2);\n }", "calculaIMC() {\n this.imc = (this.peso / (this.altura * this.altura)).toFixed(2);\n if (this.imc < 18.5) {\n this.resultado = \"Magreza, Obesidade 0\";\n } else if (this.imc >= 18.5 && this.imc <= 24.9) {\n this.resultado = \"Normal, Obsidade 0\";\n } else if (this.imc >= 25 && this.imc <= 29.9) {\n this.resultado = \"Sobrepeso, Obesidade I\";\n } else if (this.imc >= 30 && this.imc <= 39.9) {\n this.resultado = \"Obesidade II\";\n } else if (this.imc >= 40) {\n this.resultado = \"Obesidade Grave III\";\n }\n }", "function Fe(t){xe[Ae++]^=255&t,xe[Ae++]^=t>>8&255,xe[Ae++]^=t>>16&255,xe[Ae++]^=t>>24&255,Ae>=Ie&&(Ae-=Ie)}", "function ge_neg(pub) {\n pub[31] ^= 0x80;\n}", "replacerChangNiveau(){\n this.viderLaFile();\n this.cellule = this.jeu.labyrinthe.cellule(0,0);\n this.direction = 1;\n\t\t\t\tthis.vitesse = 0;\n }", "function convertGI() {\n //Cria copia da CTMC\n ctmcGI = [];\n for (var i = 0; i < ctmc.length; i++) {\n ctmcGI.push(ctmc[i].slice());\n }\n //Executa logica na diagonal principal da ctmcGI\n for (let i = 0; i < ctmcGI.length; i++) {\n let soma = 0;\n for (let j = 0; j < ctmcGI[i].length; j++) {\n soma += ctmcGI[i][j];\n }\n ctmcGI[i][i] = soma * (-1);\n }\n console.log(\"Gerador Infinitesimal:\");\n console.log(ctmcGI);\n}", "function Ie() {\n !function t(e) {\n Te[Re++] ^= 255 & e, Te[Re++] ^= e >> 8 & 255, Te[Re++] ^= e >> 16 & 255, Te[Re++] ^= e >> 24 & 255, Re >= 256 && (Re -= 256);\n }(new Date().getTime());\n }", "function devolverIP( IPrecibida ) {\n console.log('FUNCION devolverIP ======================');\n\n //creo una var en la que se guarda el OBJETO entero asociado al IP que le paso.\n var pais = ip2loc.IP2Location_get_all( IPrecibida );\n\n //Devuelvo la PROPIEDAD 'country_long' del OBJETO pais.\n return pais;\n \n}", "function Iu(e,t,n,i){switch(n){case\"s\":return i||t?\"néhány másodperc\":\"néhány másodperce\";case\"ss\":return e+(i||t?\" másodperc\":\" másodperce\");case\"m\":return\"egy\"+(i||t?\" perc\":\" perce\");case\"mm\":return e+(i||t?\" perc\":\" perce\");case\"h\":return\"egy\"+(i||t?\" óra\":\" órája\");case\"hh\":return e+(i||t?\" óra\":\" órája\");case\"d\":return\"egy\"+(i||t?\" nap\":\" napja\");case\"dd\":return e+(i||t?\" nap\":\" napja\");case\"M\":return\"egy\"+(i||t?\" hónap\":\" hónapja\");case\"MM\":return e+(i||t?\" hónap\":\" hónapja\");case\"y\":return\"egy\"+(i||t?\" év\":\" éve\");case\"yy\":return e+(i||t?\" év\":\" éve\")}return\"\"}", "function manageIconIE(icon) {\r\n\t\t\t\tif($.browser.msie) {\r\n\t\t\t\t\t$('.'+icon).html('');\r\n\t\t\t\t\t$('.'+icon+' > .empty').hide();\r\n\t\t\t\t}\r\n\t\t\t}", "calcularIMC() {\n const peso = this.peso;\n const altura = this.altura;\n return (peso / altura * altura)\n }", "function etmToOli(img) {\n return img.select(['Blue', 'Green', 'Red', 'NIR', 'SWIR1', 'SWIR2'])\n .multiply(coefficients.slopes)\n .add(coefficients.itcps)\n .round()\n .toShort()\n .addBands(img.select('pixel_qa'));\n}", "interrupt(maskable) {\n if (this.regs.halted) {\n // Skip past HALT instruction.\n this.regs.pc++;\n this.regs.halted = 0;\n }\n this.incTStateCount(7);\n this.regs.r += 1;\n this.regs.iff1 = 0;\n this.regs.iff2 = 0;\n this.pushWord(this.regs.pc);\n if (maskable) {\n switch (this.regs.im) {\n case 0:\n case 1:\n this.regs.pc = 0x0038;\n break;\n case 2: {\n // The LSB here is taken from the data bus, so it's\n // unpredictable. We use 0xFF but any value would do.\n const address = z80_base_1.word(this.regs.i, 0xFF);\n this.regs.pc = this.readWord(address);\n break;\n }\n default:\n throw new Error(\"Unknown im mode \" + this.regs.im);\n }\n }\n else {\n this.regs.pc = 0x0066;\n }\n }", "EI(op){ throw \"Unimplemented Instruction\"; }", "function readUvi(uvi) {\n if (uvi <= 2) {\n return \"#adffdc\";\n }\n if (2 < uvi <= 5) {\n return \"#ffe799\";\n }\n if (5 < uvi <= 7) {\n return \"f7bca1\";\n }\n if (7 < uvi <= 10) {\n return \"#ea9a9d\";\n }\n if (uvi > 10) {\n return \"#dfa4f4\";\n }\n}", "function getIclSituationIcollabo () {\n return {\n '1.1.1' : {\n '1.1.1-A' : '状況A: 短い説明によって、非テキストコンテンツと同じ目的を果たし、同じ情報を提示できる場合:',\n '1.1.1-B' : '状況B: 短い説明によって、非テキストコンテンツと同じ目的を果たし、同じ情報を提示できない場合(例: チャート又はダイアグラム):',\n '1.1.1-C' : '状況C: 非テキストコンテンツがコントロールである、又は利用者の入力を受け入れる場合:',\n '1.1.1-D' : '状況D: 非テキストコンテンツが時間の経過に伴って変化するメディアである(ライブの映像しか含まないコンテンツ及びライブの音声しか含まないコンテンツを含む)、テキストで提示されると無効になる試験又は演習である、又は、特定の感覚的体験を創り出すことを主に意図しているコンテンツである場合:',\n '1.1.1-E' : '状況E: 非テキストコンテンツが CAPTCHA である場合:',\n '1.1.1-F' : '状況F: 非テキストコンテンツを支援技術が無視するようにしなければならない場合:'\n },\n\n '1.2.1' : {\n '1.2.1-A' : '状況A: 収録済の音声しか含まないコンテンツの場合:',\n '1.2.1-B' : '状況B: 収録済の映像しか含まないコンテンツの場合:'\n },\n\n '1.2.2' : {\n '1.2.2' : ''\n },\n\n '1.2.3' : {\n '1.2.3' : ''\n },\n\n '1.3.1' : {\n '1.3.1-A' : '状況A: ウェブコンテンツ技術が、表現によって伝えている情報及び関係性をプログラムが解釈可能にするセマンテックな構造を提供している場合:',\n '1.3.1-B' : '状況B: ウェブコンテンツ技術が、表現によって伝えている情報及び関係性をプログラムが解釈可能にするセマンテックな構造を提供していない場合:'\n },\n\n '1.3.2' : {\n '1.3.2' : ''\n },\n\n '1.3.3' : {\n '1.3.3' : ''\n },\n\n '1.4.1' : {\n '1.4.1-A' : '状況A: 特定の語句、背景、又は他のコンテンツの色を用いて情報を示している場合:',\n '1.4.1-B' : '状況B: 情報を伝える画像の中で色を用いている場合:'\n },\n\n '1.4.2' : {\n '1.4.2' : ''\n },\n\n '2.1.1' : {\n '2.1.1' : ''\n },\n\n '2.1.2' : {\n '2.1.2' : ''\n },\n\n '2.2.1' : {\n '2.2.1-A' : '状況A: セッションの制限時間がある場合:',\n '2.2.1-B' : '状況B: 制限時間がページ上のスクリプトで制御されている場合:',\n '2.2.1-C' : '状況C: コンテンツを読むのに制限時間がある場合:',\n },\n\n '2.2.2' : {\n '2.2.2-1' : '動き、点滅、スクロール: 動きのある、点滅している、又はスクロールしている情報が、(1) 自動的に開始し、(2) 5秒よりも長く継続し、かつ、(3) その他のコンテンツと並行して提示される場合、利用者がそれらを一時停止、停止、又は非表示にすることのできるメカニズムがある。ただし、その動き、点滅、又はスクロールが必要不可欠な動作の一部である場合は除く。',\n '2.2.2-2' : '自動更新: 自動更新する情報が、(1) 自動的に開始し、(2) その他のコンテンツと並行して提示される場合、利用者がそれを一時停止、停止、もしくは非表示にする、又はその更新頻度を調整することのできるメカニズムがある。ただし、その自動更新が必要不可欠な動作の一部である場合は除く。',\n },\n\n '2.3.1' : {\n '2.3.1' : ''\n },\n\n '2.4.1' : {\n '2.4.1' : ''\n },\n\n '2.4.2' : {\n '2.4.2' : ''\n },\n\n '2.4.3' : {\n '2.4.3' : ''\n },\n\n '2.4.4' : {\n '2.4.4' : ''\n },\n\n '3.1.1' : {\n '3.1.1' : ''\n },\n\n '3.2.1' : {\n '3.2.1' : ''\n },\n\n '3.2.2' : {\n '3.2.2' : ''\n },\n\n '3.3.1' : {\n '3.3.1-A' : '状況A: フォームが利用者からの情報が必須である入力フィールドを含む場合:',\n '3.3.1-B' : '状況B: 利用者によって提供される情報が、特別なデータフォーマットか特定の値であることが求められる場合:'\n },\n\n '3.3.2' : {\n '3.3.2' : ''\n },\n\n '4.1.1' : {\n '4.1.1' : ''\n },\n\n '4.1.2' : {\n '4.1.2-A' : '状況A: マークアップ言語(例えば HTML)で標準的なユーザインタフェース コンポーネントを使用している場合:',\n '4.1.2-B' : '状況B: スクリプト又はコードを用いて、マークアップ言語の標準的なユーザインタフェース コンポーネント再定義する場合:',\n '4.1.2-C' : '状況C: プログラミング技術で標準的なユーザインタフェース コンポーネントを用いる場合:',\n '4.1.2-D' : '状況D: プログラミング言語で独自のインタフェース・コンポーネントを作成する場合:'\n },\n\n // AA\n '1.2.4' : {\n '1.2.4' : ''\n },\n\n '1.2.5' : {\n '1.2.5' : ''\n },\n\n '1.4.3' : {\n '1.4.3-A' : '状況A: 太字でないテキストが18ポイント(日本語は22ポイント)未満、太字のテキストが14ポイント(日本語は18ポイント)未満の場合:',\n '1.4.3-B' : '状況B: 太字でないテキストが少なくとも18ポイント(日本語は22ポイント)以上、太字のテキストが少なくとも14ポイント(日本語は18ポイント)以上の場合:',\n },\n\n '1.4.4' : {\n '1.4.4' : ''\n },\n\n '1.4.5' : {\n '1.4.5' : ''\n },\n\n '2.4.5' : {\n '2.4.5' : ''\n },\n\n '2.4.6' : {\n '2.4.6' : ''\n },\n\n '2.4.7' : {\n '2.4.7' : ''\n },\n\n '3.1.2' : {\n '3.1.2' : ''\n },\n\n '3.2.3' : {\n '3.2.3' : ''\n },\n\n '3.2.4' : {\n '3.2.4' : ''\n },\n\n '3.3.3' : {\n '3.3.3-A' : '状況A: 必須のフィールドに情報が入力されていない場合:',\n '3.3.3-B' : '状況B: フィールドの情報に、特別のデータフォーマットが要求される場合:',\n '3.3.3-C' : '状況C: 利用者の入力する情報は、複数の限定された値のうちの一つであることが要求される場合:'\n },\n\n '3.3.4' : {\n '3.3.4-A' : '状況A: アプリケーションで、購入又は所得税申告の提出のように、法的なトランザクションが発生する場合:',\n '3.3.4-B' : '状況B: 利用者のアクションによって情報が削除される可能性がある場合:',\n '3.3.4-C' : '状況C: ウェブページに試験を実施するアプリケーションがある場合:'\n },\n\n // AAA\n '1.2.6' : {\n '1.2.6' : '',\n },\n\n '1.2.7' : {\n '1.2.7' : '',\n },\n\n '1.2.8' : {\n '1.2.8-A' : '状況A: 収録済の同期したメディアの場合:',\n '1.2.8-B' : '状況B: 収録済の映像しか含まないコンテンツの場合:',\n },\n\n '1.2.9' : {\n '1.2.9' : '',\n },\n\n '1.4.6' : {\n '1.4.6-A' : '状況A: 太字でないテキストが18ポイント(日本語は22ポイント)未満、太字のテキストが14ポイント(日本語は18ポイント)未満の場合:',\n '1.4.6-B' : '状況B: 太字でないテキストが少なくとも18ポイント(日本語は22ポイント)以上、太字のテキストが少なくとも14ポイント(日本語は18ポイント)以上の場合:',\n },\n\n '1.4.7' : {\n '1.4.7' : '',\n },\n\n '1.4.8' : {\n '1.4.8-1' : '要件1: 前景色及び背景色を利用者が選択可能にする達成方法:',\n '1.4.8-2' : '要件2: 幅が図形記号を含めて80文字以下(全角の場合は40文字以下)になるようにする達成方法:',\n '1.4.8-3' : '要件3: テキストを均等割り付け(左右両端揃え)にしないようにする達成方法:',\n '1.4.8-4' : '要件4: 段落内の行送り幅(行間隔)が少なくとも1.5文字分、及び段落の間隔がその行送り幅の少なくとも1.5倍になるようにする達成方法:',\n '1.4.8-5' : '要件5: 利用者が全画面表示にしたウィンドウで1行のテキストを読む際に横スクロールする必要がない状態で、支援技術を用いなくてもテキストを200%までサイズ変更できるようにする達成方法:',\n },\n\n '1.4.9' : {\n '1.4.9' : '',\n },\n\n '2.1.3' : {\n '2.1.3' : '',\n },\n\n '2.2.3' : {\n '2.2.3' : '',\n },\n\n '2.2.4' : {\n '2.2.4' : '',\n },\n\n '2.2.5' : {\n '2.2.5' : '',\n },\n\n '2.3.2' : {\n '2.3.2' : '',\n },\n\n '2.4.8' : {\n '2.4.8' : '',\n },\n\n '2.4.9' : {\n '2.4.9' : '',\n },\n\n '2.4.10' : {\n '2.4.10' : '',\n },\n\n '3.1.3' : {\n '3.1.3-A' : '状況A: 単語又は語句にそのウェブページ特有の意味がある場合:',\n '3.1.3-B' : '状況B: 単語又は語句の意味が、同じウェブページ内で異なる場合:',\n },\n\n '3.1.4' : {\n '3.1.4-A' : '状況A: 略語がそのウェブページ内で一つの意味しか持たない場合:',\n '3.1.4-B' : '状況B: 略語が同じウェブページで異なるものを意味している場合:',\n },\n\n '3.1.5' : {\n '3.1.5' : '',\n },\n\n '3.1.6' : {\n '3.1.6' : '',\n },\n\n '3.2.5' : {\n '3.2.5-A' : '状況A: ウェブページが自動更新を行う場合:',\n '3.2.5-B' : '状況B: 自動リダイレクトが可能な場合:',\n '3.2.5-C' : '状況C: ウェブページがポップアップウィンドウを用いる場合:',\n '3.2.5-D' : '状況D: select要素上でonchangeイベントを用いる場合:',\n },\n\n '3.3.5' : {\n '3.3.5-A' : '状況A: フォームがテキスト入力を求める場合:',\n '3.3.5-B' : '状況B: フォームが所定のデータフォーマットでのテキスト入力を求める場合:',\n },\n\n '3.3.6' : {\n '3.3.6-A' : '状況A: アプリケーションで、購入又は所得税申告の提出のように、法的なトランザクションが発生する場合:',\n '3.3.6-B' : '状況B: 利用者のアクションによって情報が削除される可能性がある場合:',\n '3.3.6-C' : '状況C: ウェブページに試験を実施するアプリケーションがある場合:',\n },\n\n };\n}", "function undici () {}", "private internal function m248() {}", "function escribirCantidadIconCarrito(cantidadcarrito){\n iconcarrito.textContent=cantidadcarrito;\n}", "function remapInternalIcon(vm, iconName) {\n if (!iconName.startsWith('$')) {\n return iconName;\n } // Get the target icon name\n\n\n var iconPath = \"$vuetify.icons.values.\" + iconName.split('$').pop().split('.').pop(); // Now look up icon indirection name,\n // e.g. '$vuetify.icons.values.cancel'\n\n return getObjectValueByPath(vm, iconPath, iconName);\n}", "function remapInternalIcon(vm, iconName) {\n if (!iconName.startsWith('$')) {\n return iconName;\n } // Get the target icon name\n\n\n var iconPath = \"$vuetify.icons.values.\" + iconName.split('$').pop().split('.').pop(); // Now look up icon indirection name,\n // e.g. '$vuetify.icons.values.cancel'\n\n return getObjectValueByPath(vm, iconPath, iconName);\n}", "function remapInternalIcon(vm, iconName) {\n if (!iconName.startsWith('$')) {\n return iconName;\n } // Get the target icon name\n\n\n var iconPath = \"$vuetify.icons.values.\" + iconName.split('$').pop().split('.').pop(); // Now look up icon indirection name,\n // e.g. '$vuetify.icons.values.cancel'\n\n return getObjectValueByPath(vm, iconPath, iconName);\n}", "function remapInternalIcon(vm, iconName) {\n if (!iconName.startsWith('$')) {\n return iconName;\n } // Get the target icon name\n\n\n var iconPath = \"$vuetify.icons.values.\" + iconName.split('$').pop().split('.').pop(); // Now look up icon indirection name,\n // e.g. '$vuetify.icons.values.cancel'\n\n return getObjectValueByPath(vm, iconPath, iconName);\n}", "function IMC(peso,altura) {\n\n indice = peso/(Math.pow(altura,2));\n imc = indice.toFixed(2);\n console.log(`El IMC es de: ${imc}.`);\n //return imc;\n}", "function remapInternalIcon(vm, iconName) {\n if (!iconName.startsWith('$')) {\n return iconName;\n } // Get the target icon name\n\n\n var iconPath = \"$vuetify.icons.values.\".concat(iconName.split('$').pop().split('.').pop()); // Now look up icon indirection name,\n // e.g. '$vuetify.icons.values.cancel'\n\n return getObjectValueByPath(vm, iconPath, iconName);\n}", "get ETC2_RGBA8() {}", "function revice_Img(ID) {\t// when mouse out\n\n var Revice_Img = $('#' + ID).attr('src');\n var Revice_value = $('#' + ID).val();\n\n if (Revice_Img.match('gif')) {\n if (Revice_value == 0)\n Revice_Img = Revice_Img.replace('-1.gif', '-2.gif');\n else\n Revice_Img = Revice_Img.replace('-1.gif', '.gif');\n }\n else\n Revice_Img = Revice_Img.replace('-1.jpg', '.jpg');\n\n $('#' + ID).attr('src', Revice_Img);\n}", "function remapInternalIcon(vm, iconName) {\n if (!iconName.startsWith('$')) {\n return iconName;\n } // Get the target icon name\n\n\n const iconPath = `$vuetify.icons.values.${iconName.split('$').pop().split('.').pop()}`; // Now look up icon indirection name,\n // e.g. '$vuetify.icons.values.cancel'\n\n return getObjectValueByPath(vm, iconPath, iconName);\n}", "function remapInternalIcon(vm, iconName) {\n if (!iconName.startsWith('$')) {\n return iconName;\n } // Get the target icon name\n\n\n const iconPath = `$vuetify.icons.values.${iconName.split('$').pop().split('.').pop()}`; // Now look up icon indirection name,\n // e.g. '$vuetify.icons.values.cancel'\n\n return getObjectValueByPath(vm, iconPath, iconName);\n}", "function remapInternalIcon(vm, iconName) {\n if (!iconName.startsWith('$')) {\n return iconName;\n } // Get the target icon name\n\n\n const iconPath = `$vuetify.icons.values.${iconName.split('$').pop().split('.').pop()}`; // Now look up icon indirection name,\n // e.g. '$vuetify.icons.values.cancel'\n\n return getObjectValueByPath(vm, iconPath, iconName);\n}", "function surprised(){\n vm.input = vm.input.concat(\"😮\");\n }", "_proximaImgVivo() {\n\t\t//mudar index (como vetor circular)\n\t\tthis._indexImgVivo = (this._indexImgVivo + 1) % this._vetorImgsVivo.length;\n\t\t//mudar img em formaGeometrica\n\t\tthis._colocarImgVivoAtual();\n\t}", "function remapInternalIcon(vm, iconName) {\n if (!iconName.startsWith(ICONS_PREFIX)) {\n return iconName;\n } // Get the target icon name\n\n\n const iconPath = `$vuetify.icons.values.${iconName.split('.').pop()}`; // Now look up icon indirection name,\n // e.g. '$vuetify.icons.values.cancel'\n\n return getObjectValueByPath(vm, iconPath, iconName);\n}", "function calculaIMC(blur)\n{\n//hacemos la llamada a los datos introducidos\n\tvar peso = $('#gl_peso').val();\n\tvar altura = $('#gl_estatura').val() / 100;\n//calculamos el imc\n\tvar imc = peso / (altura * altura);\n\timc = imc.toFixed(2);\n\n\t//mensaje si no tiene valores y dar valor=\"\" a gl_imc\n\tif ((peso == \"\") || (altura == \"\")) {\n\t\tif(!blur){\n\t\t\txModal.danger(\"Ingrese Peso y Altura\");\n\t\t}\n\t\timc = \"\";\n $('#gl_imc').css(\"borderColor\", \"\");\n $('#gl_imc').parent().find(\"span.help-block\").css(\"color\", \"\");\n $('#gl_imc').parent().find('span.help-block').addClass(\"hidden\");\n\t}\n\n\t//Si IMC es mayor a 30 Mostrar Diabetes\n\tif (imc > 30) {\n\t\t$(\"#glicemia\").show();\n\t}\n //funcion mensaje span IMC\n mensajeIMC(imc);\n\t//enviamos resultados a la caja correspondiente\n\t$('#gl_imc').val(imc);\n}", "function changeCouleur(obj) {\r\n var couleurElement=obj[0];\r\n var pourcentage=obj[1];\r\n var rougeBinaire = binDec(hexaBin(couleurElement[1]+couleurElement[2]));\r\n var vertBinaire = binDec(hexaBin(couleurElement[3]+couleurElement[4]));\r\n var bleuBinaire = binDec(hexaBin(couleurElement[5]+couleurElement[6]));\r\n rougeBinaire=rougeBinaire+(255-rougeBinaire)*(pourcentage/100);\r\n vertBinaire=vertBinaire+(255-vertBinaire)*(pourcentage/100);\r\n bleuBinaire=bleuBinaire+(255-bleuBinaire)*(pourcentage/100);\r\n var rouge=binHexa(decBin(rougeBinaire));\r\n var vert=binHexa(decBin(vertBinaire));\r\n var bleu=binHexa(decBin(bleuBinaire));\r\n couleurElement=\"#\"+rouge+vert+bleu\r\n return couleurElement;\r\n}", "function negativo() {\n var imgd = ctx.getImageData(0, 0, c.width, c.height);\n var data = imgd.data;\n for (var i = 0; i < data.length; i += 4) {\n //var grayscale = data[i] * 0.34 + data[i + 1] * 0.5 + data[i + 2] * 0.16;\n\n data[i] = 255 - data[i];\n data[i + 1] = 255 - data[i + 1];\n data[i + 2] = 255 - data[i + 2];\n }\n ctx.putImageData(imgd, 0, 0);\n }", "function remapInternalIcon(vm, iconName) {\n if (!iconName.startsWith(ICONS_PREFIX)) {\n return iconName;\n }\n // Now look up icon indirection name, e.g. '$vuetify.icons.cancel'\n return getObjectValueByPath(vm, iconName, iconName);\n}", "function remapInternalIcon(vm, iconName) {\n if (!iconName.startsWith(ICONS_PREFIX)) {\n return iconName;\n }\n // Now look up icon indirection name, e.g. '$vuetify.icons.cancel'\n return getObjectValueByPath(vm, iconName, iconName);\n}", "function remapInternalIcon(vm, iconName) {\n if (!iconName.startsWith(ICONS_PREFIX)) {\n return iconName;\n }\n // Now look up icon indirection name, e.g. '$vuetify.icons.cancel'\n return getObjectValueByPath(vm, iconName, iconName);\n}", "function remapInternalIcon(vm, iconName) {\n if (!iconName.startsWith(ICONS_PREFIX)) {\n return iconName;\n }\n // Now look up icon indirection name, e.g. '$vuetify.icons.cancel'\n return getObjectValueByPath(vm, iconName, iconName);\n}", "function remapInternalIcon(vm, iconName) {\n if (!iconName.startsWith(ICONS_PREFIX)) {\n return iconName;\n }\n // Now look up icon indirection name, e.g. '$vuetify.icons.cancel'\n return getObjectValueByPath(vm, iconName, iconName);\n}", "function remapInternalIcon(vm, iconName) {\n if (!iconName.startsWith(ICONS_PREFIX)) {\n return iconName;\n }\n // Now look up icon indirection name, e.g. '$vuetify.icons.cancel'\n return getObjectValueByPath(vm, iconName, iconName);\n}", "function coreEmissivity(reflimg, NDVImin, NDVImax, Esoil, Eveg){\n var ndvi_min = ee.Image(ee.Number(NDVImin));\n var ndvi_max = ee.Image(ee.Number(NDVImax));\n var ndvi = reflimg.normalizedDifference([\"B4\", \"B3\"]);\n var fvc = ndvi.subtract(ndvi_min)\n .divide(ndvi_max.subtract(ndvi_min))\n .pow(ee.Image(2));\n var e = ee.Image(Esoil).multiply(ee.Image(1).subtract(fvc)).add(ee.Image(Eveg).multiply(fvc));\n return e.select([0], ['emissivity']);\n}", "decode() {\n this.generateIobPips(this.pin, this.tile, this.style, this.pad);\n }", "function change(ime, godini, programer, lokacija) {\n ime = 'Vancho';\n godini = 40;\n programer = false;\n lokacija.grad = 'Bitola';\n}", "function getIclTestIcollabo () {\n return {\n '1.1.1-A' : [\n ['G94/ARIA6/ARIA10/G196/H2/H35/H37/H53/H86', '以下のいずれかの方法を用いて、非テキストコンテンツに対して、\\n1.G94: 非テキストコンテンツに対して、それと同じ目的を果たし、同じ情報を提供する、簡潔な代替テキストを提供する\\n1-a.ARIA6: オブジェクトのラベルを提供するためにaria-labelを使用する\\n1-b.ARIA10: 非テキストコンテンツに対して代替テキストを提供するために、aria-labelledbyを使用する\\n1-c.G196: 画像のグループにある一つの画像に、そのグループのすべての画像を説明する代替テキストを提供する\\n1-d.H2: 隣り合った画像とテキストリンクを同じリンクの中に入れる\\n1-e.H35: applet要素に代替テキストを提供する\\n1-f.H37: img 要素のalt属性を使用する\\n1-g.H53: object要素のボディを使用する\\n1-h.H86: ASCIIアート、顔文字、及びリート語に代替テキストを提供する']\n ],\n\n '1.1.1-B' : [\n ['G95/ARIA6/ARIA10/G196/H2/H35/H37/H53/H86', '状況Bにおける短いテキストによる代替の達成方法\\n1.以下のいずれかの方法を用いて、\\nG95: 非テキストコンテンツの簡単な説明を提供する、簡潔な代替テキストを提供する:\\n1-a.ARIA6: オブジェクトのラベルを提供するためにaria-labelを使用する\\n1-b.ARIA10: 非テキストコンテンツに対して代替テキストを提供するために、aria-labelledbyを使用する\\n1-c.G196: 画像のグループにある一つの画像に、そのグループのすべての画像を説明する代替テキストを提供する\\n1-d.H2: 隣り合った画像とテキストリンクを同じリンクの中に入れる\\n1-e.H35: applet 要素に代替テキストを提供する\\n1-f.H37: img 要素のalt属性を使用する\\n1-g.H53: object要素のボディを使用する\\n1-h.H86: ASCII アート、顔文字、及びリート語に代替テキストを提供する'],\n ['G95/ARIA15/G73/G74/G92/H45/H53', '状況Bにおける長いテキストによる代替の達成方法\\n1.以下のいずれかの方法を用いて、\\nG95: 非テキストコンテンツの簡単な説明を提供する、簡潔な代替テキストを提供する:\\n1-a.ARIA15: 画像の説明を提供するためにaria-describedbyを使用する\\n1-b.非テキストコンテンツのすぐ隣に別の場所へのリンクを置き、その別の場所で長い説明を提供する\\n1-c.短い説明の中で長い説明のある場所を示して、非テキストコンテンツの近くにあるテキストで長い説明を提供する\\n1-d.非テキストコンテンツに対して、それと同じ目的を果たし、同じ情報を提供する長い説明を提供する\\n1-e.longdesc属性を用いる\\n1-f.object要素のボディを使用する']\n ],\n\n '1.1.1-C' : [\n ['G82/ARIA6/ARIA9/H24/H30/H36/H44/H65', 'いずれかの方法を用いて、\\n1-a.G82: 非テキストコンテンツの目的を特定する代替テキストを提供する:\\n1-b.ARIA6: オブジェクトのラベルを提供するためにaria-labelを使用する\\n1-c.ARIA9: 複数の語句をつなげて一つのラベルにするために、aria-labelledbyを使用する\\n1-dH24: イメージマップのarea要素に代替テキストを提供する\\n1-e.H30: a要素のリンクの目的を説明するリンクテキストを提供する\\n1-f.H36: 送信/実行ボタンとして用いる画像のalt属性を使用する\\n1-g.H44: テキストのラベルとフォーム・コントロールを関連付けるために、label要素を使用する\\n1-h.H65: label要素を使用することができないとき、フォーム・コントロールを特定するために、title属性を使用する']\n ],\n\n '1.1.1-D' : [\n ['ARIA6/ARIA10/G196/H2/H35/H37/H53/H86', 'いずれかを用いて、ラベルを記述する:\\n1-a.ARIA6: オブジェクトのラベルを提供するためにaria-labelを使用する\\n1-b.ARIA10: 非テキストコンテンツに対して代替テキストを提供するために、aria-labelledbyを使用する\\n1-c.G196: 画像のグループにある一つの画像に、そのグループのすべての画像を説明する代替テキストを提供する\\n1-d.H2: 隣り合った画像とテキストリンクを同じリンクの中に入れる\\n1-e.H35: applet要素に代替テキストを提供する\\n1-f.H37: img要素のalt属性を使用する\\n1-g.H53: object要素のボディを使用する\\n1-h.H86: ASCIIアート、顔文字、及びリート語に代替テキストを提供する'],\n ['G68/ARIA6/ARIA10/G196/H2/H35/H37/H53/H86', 'いずれかを用いて、\\n2.G68: ライブの音声しか含まないコンテンツ及びライブの映像しか含まないコンテンツの目的を説明するために、簡潔な代替テキストを提供する:\\n2-a.ARIA6: オブジェクトのラベルを提供するためにaria-labelを使用する\\n2-b.ARIA10: 非テキストコンテンツに対して代替テキストを提供するために、aria-labelledbyを使用する\\n2-c.G196: 画像のグループにある一つの画像に、そのグループのすべての画像を説明する代替テキストを提供する\\n2-d.H2: 隣り合った画像とテキストリンクを同じリンクの中に入れる\\n2-e.H35: applet要素に代替テキストを提供する\\n2-f.H37: img要素のalt属性を使用する\\n2-g.H53: object要素のボディを使用する\\n2-h.H86: ASCIIアート、顔文字、及びリート語に代替テキストを提供する'],\n ['G100/ARIA6/ARIA10/G196/H2/H35/H37/H53/H86', 'いずれかを用いて、\\n3.G100: 非テキストコンテンツの一般に認められた名前又は内容が分かる名前となる簡潔な代替テキストを提供する:\\n3-a.ARIA6: オブジェクトのラベルを提供するためにaria-labelを使用する\\n3-b.ARIA10: 非テキストコンテンツに対して代替テキストを提供するために、aria-labelledbyを使用する\\n3-c.G196: 画像のグループにある一つの画像に、そのグループのすべての画像を説明する代替テキストを提供する\\n3-d.H2: 隣り合った画像とテキストリンクを同じリンクの中に入れる\\n3-e.H35: applet要素に代替テキストを提供する\\n3-f.H37: img要素のalt属性を使用する\\n3-g.H53: object要素のボディを使用する\\n3-h.H86: ASCIIアート、顔文字、及びリート語に代替テキストを提供する']\n ],\n\n '1.1.1-E' : [\n ['G143/G144', '1-a.G143: 代替テキストを提供して、CAPTCHAの目的を説明する、かつ、\\n1-b.G144: 同じ目的を果たす、異なる感覚モダリティを用いたもう一つのCAPTCHAがウェブページにあることを確認する']\n ],\n\n '1.1.1-F' : [\n ['C9/H67', '以下のいずれかを用いて、支援技術によって無視することができるように、非テキストコンテンツを実装またはマーク付けする:\\n1-a.C9: 装飾目的の画像を付加するために、CSSを使用する\\n1-b.H67: 支援技術が無視すべき画像のimg要素で、alt属性値を空にして、title属性を付与しない']\n ],\n\n // 1.2.1\n '1.2.1-A' : [\n ['G158', 'G158: 時間の経過に伴って変化するメディアの音声しか含まないコンテンツに対して代替コンテンツを提供する']\n ],\n '1.2.1-B' : [\n ['G159/G166', 'いずれかの方法を用いる\\nG159: 時間の経過に伴って変化するメディアの映像しか含まないコンテンツに対して代替コンテンツを提供する\\nG166: 重要な映像コンテンツを説明する音声を提供する']\n ],\n\n // 1.2.2\n '1.2.2' : [\n ['G93', 'G93: オープン・キャプション(常に表示)を提供する'],\n ['G87', 'クローズド・キャプションをサポートしたビデオ・プレーヤーのある、容易に利用可能なメディア・フォーマットを用いて、\\nG87: クローズド・キャプションを提供する'],\n ['H95', 'H95: キャプションを提供するために、track要素を使用する']\n ],\n\n // 1.2.3\n '1.2.3' : [\n ['G69/G58', '1-aを用いて、G69: 時間の経過の伴い変化するメディアに対して代替コンテンツを提供する\\n1-a. G58: 非テキストコンテンツのすぐ隣に、時間の経過に伴って変化するメディアの代替へのリンクを置く'],\n ['H53', 'H53: object要素のボディを使用する'],\n ['G78', 'G78: 音声解説を含んだ、利用者が選択可能な副音声トラックを提供する'],\n ['G173', '音声及び映像をサポートしているプレーヤーを用いてG173: 映像の音声解説付きバージョンを提供する'],\n ['G8', '音声及び映像をサポートしているプレーヤーを用いてG8: 拡張音声解説が付いたムービーを提供する'],\n ['G203', 'G203: 話者が話すのみの映像を説明するために、静的な代替テキストを使用する']\n ],\n\n // 1.3.1\n '1.3.1-A' : [\n ['ARIA11', 'ARIA11: ページの領域を特定するためにARIAランドマークを使用する'],\n ['ARIA12', 'ARIA12: 見出しを特定するためにrole=headingを使用する'],\n ['ARIA13', 'ARIA13: 領域とランドマークに名前(name)を付けるために、aria-labelledbyを使用する'],\n ['ARIA16', 'ARIA16: ユーザインターフェース コントロールの名前(name)を提供するために、aria-labelledbyを使用する'],\n ['ARIA17', 'ARIA17: 関連するフォームコントロールを特定するために、グループ化するロールを使用する'],\n ['ARIA20', 'ARIA20: ページの領域を特定するためにregionロールを使用する'],\n ['G115', 'G115: 構造をマークアップするために、セマンティックな要素を使用する、かつ、H49: 強調又は特別なテキストをマークアップするために、セマンティックなマークアップを使用する'],\n ['G117', 'G117: テキストの表現のバリエーションによって伝えている情報を伝達するために、テキストを使用する'],\n ['G140', 'G140: 情報と構造を表現から分離して、異なる表現を可能にする'],\n ['G138/H51/H39/H73/H63/H43/H44/H65/H71/H85/H48/H42/SCR21/H97', '次の達成方法を用いて、表現によって伝えられている情報及び関係性をプログラムが解釈できるようにする\\n10-a.G138: 色の手がかりを用いる際は、必ずセマンティックなマークアップを使用する\\n10-b.H51: 表の情報を提示するために、テーブルのマークアップを使用する\\n10-c.H39: データテーブルの表題とデータテーブルを関連付けるために、caption要素を使用する\\n10-d.H73: データテーブルの概要を提供するために、table要素のsummary属性を使用する\\n10-e.H63: データテーブルの見出しセルとデータセルを関連付けるために、scope属性を使用する\\n10-f.H43: データテーブルのデータセルを見出しセルと関連付けるために、id属性及びheaders属性を使用する\\n10-g.H44: テキストのラベルとフォーム・コントロールを関連付けるために、label要素を使用する\\n10-h.H65: label要素を使用することができないとき、フォーム・コントロールを特定するために、title属性を使用する\\n10-i.H71: フォーム・コントロールのグループに関する説明を提供するために、fieldset要素及びlegend要素を使用する\\n10-j.H85: select要素内のoption要素をグループ化するために、optgroup要素を使用する\\n10-k.H48: リストに、ol要素、ul要素、dl要素を用いる\\n10-l.H42: 見出しを特定するために、h1要素~h6要素を使用する\\n10-m.SCR21: ページにコンテンツを追加するために、DOM(ドキュメント・オブジェクト・モデル)を使用する\\n10-n.H97: 関連したリンクをグループ化するために、nav要素を使用する']\n ],\n\n '1.3.1-B' : [\n ['G117', 'G117: テキストの表現のバリエーションによって伝えている情報を伝達するために、テキストを使用する']\n ],\n\n // 1.3.2\n '1.3.2' : [\n ['G57/C8', '次の達成方法のどれか一つを用いて、コンテンツの並び順を意味のあるものにする、かつ、その並び順については、\\n1-a.G57: コンテンツを意味のある順序で並べる\\n1-b.C8: 単語内の文字間隔を調整するために、CSSのletter-spacingプロパティを使用する']\n ],\n\n // 1.3.3\n '1.3.3' : [\n ['G96', 'G96: 理解すべき情報を感覚的にだけ伝えることのないように、テキストでもアイテムを特定する']\n ],\n\n // 1.4.1\n '1.4.1-A' : [\n ['G14', 'G14: 色の違いで伝えている情報をテキストでも入手可能にする'],\n ['G205', 'G205: フォーム・コントロールの、色がついたラベルに対して、テキストによる手がかりを提供する'],\n ['G182', 'G182: テキストの色の違いで情報を伝える際は、視覚的な手がかりを補足する'],\n ['G183', 'G183: 色の違いだけで示されているリンク又はコントロールは、その文字色と周囲にあるテキストとのコントラスト比を3:1以上にして、フォーカスを受け取ったときには視覚的な手がかりを補足して強調する']\n ],\n\n '1.4.1-B' : [\n ['G111', 'G111: 色とパターンを併用する'],\n ['G14', 'G14: 色の違いで伝えている情報をテキストでも入手可能にする']\n ],\n\n // 1.4.2\n '1.4.2' : [\n ['G60', 'G60: 音声の再生を3秒以内に自動的に停止する'],\n ['G170', 'G170: 自動的に再生される音声を停止するコントロールを、ウェブページの先頭付近で提供する'],\n ['G171', 'G171: 利用者の要求に応じてのみ、音声を再生する']\n ],\n\n // 2.1.1\n '2.1.1' : [\n ['G202', 'G202: すべての機能をキーボードだけでも操作可能にする'],\n ['H91', 'H91: HTMLのフォーム・コントロール及びリンクを使用する'],\n ['G90/SCR20/SCR35/SCR2', '次の達成方法の一つを用いて、\\nG90: キーボードがトリガーとなるイベント・ハンドラを提供する:\\nSCR20: キーボードとその他のデバイス特有の機能を両方とも使用する\\nSCR35: アクションをキーボードで操作可能にするために、アンカー及びボタンのonclickイベントを使用する\\nSCR2: キーボード及びマウスのイベント・ハンドラを両方とも使用する']\n ],\n\n // 2.1.2\n '2.1.2' : [\n ['G21', 'G21: 利用者がコンテンツ内に閉じ込められないようにする']\n ],\n\n // 2.2.1\n '2.2.1-A' : [\n ['G133/G198', '1-a.G133: 複数の画面で構成されるフォームの最初のページに、利用者がセッションの制限時間を延長又は解除できるチェックボックスを提供する\\n1-b.G198: 利用者が制限時間を解除できる手段を提供する']\n ],\n '2.2.1-B' : [\n ['G198/G180/SCR16 or SCR1', '1-a.G198: 利用者が制限時間を解除できる手段を提供する\\n1-b.G180: 利用者が初期設定の制限時間を10倍に設定できる手段を提供する\\n1-c.SCR16: 制限時間が切れようとしていることを利用者に警告するスクリプトを提供する 及びSCR1: 利用者が初期設定の制限時間を延長できるようにする']\n ],\n '2.2.1-C' : [\n ['G4/G198', '1-a.G4: コンテンツを一時停止させて、一時停止させたところから再開できるようにする\\n1-b.G198: 利用者が制限時間を解除できる手段を提供する']\n ],\n\n // 2.2.2\n '2.2.2-1' : [\n ['G4/SCR33/G11/G187/G152/SCR22/G186/G191', '1-a.G4: コンテンツを一時停止させて、一時停止させたところから再開できるようにする\\n1-b.SCR33: スクリプトを用いてコンテンツをスクロールし、それを一時停止できるメカニズムを提供する\\n1-c.G11: 5秒未満で点滅が終わるようにコンテンツを制作する\\n1-d.G187: ユーザエージェントによって点滅するコンテンツを停止できるウェブコンテンツ技術を使用する\\n1-e.G152: 数回のループ後(5秒以内)に停止するように、アニメーションGIFを設定する\\n1-f.SCR22: 点滅を制御し、5秒以内に停止させるために、スクリプトを使用する\\n1-g.G186: 動きのあるコンテンツ、点滅するコンテンツ、又は自動更新されるコンテンツを停止させるコントロールを使用する\\n1-h.G191: 点滅するコンテンツのないページを読み込むリンク、ボタン、又はその他のメカニズムを提供する']\n ],\n '2.2.2-2' : [\n ['G4/SCR33/G11/G187/G152/SCR22/G186/G191', '1-a.G4: コンテンツを一時停止させて、一時停止させたところから再開できるようにする\\n1-b.SCR33: スクリプトを用いてコンテンツをスクロールし、それを一時停止できるメカニズムを提供する\\n1-c.G11: 5秒未満で点滅が終わるようにコンテンツを制作する\\n1-d.G187: ユーザエージェントによって点滅するコンテンツを停止できるウェブコンテンツ技術を使用する\\n1-e.G152: 数回のループ後(5秒以内)に停止するように、アニメーションGIFを設定する\\n1-f.SCR22: 点滅を制御し、5秒以内に停止させるために、スクリプトを使用する\\n1-g.G186: 動きのあるコンテンツ、点滅するコンテンツ、又は自動更新されるコンテンツを停止させるコントロールを使用する\\n1-h.G191: 点滅するコンテンツのないページを読み込むリンク、ボタン、又はその他のメカニズムを提供する']\n ],\n\n // 2.3.1\n '2.3.1' : [\n ['G19', 'G19: どの1秒間においても、コンテンツに3回よりも多く閃光を放つコンポーネントがないことを確認する'],\n ['G176', 'G176: 閃光を放つエリアを十分に小さくする'],\n ['G15', 'G15: コンテンツが一般閃光閾値及び赤色閃光閾値を越えていないことを確認するためにツールを使用する']\n ],\n\n // 2.4.1\n '2.4.1' : [\n ['G1/G123/G124', '次の達成方法の中から一つを用いて、繰り返されるブロックをスキップするリンクを作成する:\\n1-a.G1: メインコンテンツエリアへ直接移動するリンクを各ページの先頭に追加する\\n1-b.G123: 繰り返しているコンテンツのブロックの開始位置に、そのブロックの終了位置へのリンクを追加する\\n1-c.G124: ページの先頭に、コンテンツの各エリアへのリンクを追加する'],\n ['ARIA11/H69/H70 and H64/SCR28', '次の達成方法の中から一つを用いて、スキップ可能な方法で繰り返されるブロックをグループ化する:\\n2-a.ARIA11: ページの領域を特定するためにARIAランドマークを使用する\\n2-b.H69: コンテンツの各セクションの開始位置に見出し要素を提供する\\n1-c.H70: 繰り返されているコンテンツのブロックをグループ化するために、frame要素を使用する、かつ、H64: frame要素及びiframe要素のtitle属性を使用する\\n2-c.SCR28: コンテンツのブロックをバイパスするために、展開可能及び折り畳み可能なメニューを使用する']\n ],\n\n // 2.4.2\n '2.4.2' : [\n ['G88/H25', 'G88: ウェブページに対して、コンテンツの内容が分かるページタイトルを提供する、かつ、後述のテクニックの一つを使ってウェブページにタイトルを結びつける:\\nH25: title要素を用いて、ページタイトルを提供する']\n ],\n\n // 2.4.3\n '2.4.3' : [\n ['G59', 'G59: コンテンツ内の順番及び関係に従った順序で、インタラクティブな要素を配置する'],\n ['SCR26/SCR37/SCR27', '次の達成方法の一つを用いて、ウェブページを動的に変化させる:\\n2-a.SCR26: 動的なコンテンツをDOMのそのトリガーとなる要素の直後に挿入する\\n2-b.SCR37: デバイス非依存な方法でカスタム・ダイアログを作成する\\n2-c.SCR27: DOMを用いて、ページ上にある複数のセクションを並び替える']\n ],\n\n // 2.4.4\n '2.4.4' : [\n ['G91', 'G91: リンクの目的を説明したリンクテキストを提供する'],\n ['H30', 'H30: a要素のリンクの目的を説明するリンクテキストを提供する'],\n ['H24', 'H24: イメージマップのarea要素に代替テキストを提供する'],\n ['G189/SCR30', '次に挙げる達成方法の一つを用いて、利用者が簡潔なリンクテキスト又は長いリンクテキストを選べるようにする:\\n4-a.G189: ウェブページの先頭近くに、リンクのラベルを変更するコントロールを提供する\\n4-b.SCR30: リンクのラベルを変更するために、スクリプトを使用する'],\n ['G53', 'G53: リンクテキストとそれが含まれている文章中のテキストとを組み合わせて、リンクの目的を特定する'],\n ['H33/C7', '次に挙げる達成方法の一つを用いて、リンクの目的の説明を補足する:\\n6-a.H33: title属性を用いて、リンクテキストの文言を補足する\\n6-b.C7: リンクテキストの一部を非表示にするために、CSSを使用する'],\n ['ARIA7/ARIA8/H77/H78/H79/H81', '次に挙げる達成方法の一つを用いて、プログラムで判断されるリンクの文脈と一緒にリンクの目的を特定する:\\n7-a.ARIA7: リンクの目的を示すためにaria-labelledbyを使用する\\n7-b.ARIA8: リンクの目的を示すためにaria-label を使用する\\n7-c.H77: リンクテキストとそれが含まれているリスト項目とを組み合わせて、リンクの目的を特定する\\n7-d.H78: リンクテキストとそれが含まれているパラグラフとを組み合わせて、リンクの目的を特定する\\n7-e.H79: リンクテキストとそれが含まれているデータセル及び関連づけられた見出しセルとを組み合わせて、リンクの目的を特定する\\n7-f.H81: 入れ子になったリスト項目にあるリンクテキストとその親のリスト項目とを組み合わせて、リンクの目的を特定する']\n ],\n\n // 3.1.1\n '3.1.1' : [\n ['H57', 'H57: html要素のlang属性を使用する']\n ],\n\n // 3.2.1\n '3.2.1' : [\n ['G107', 'G107: 状況の変化に対するトリガーとして、\"focus\"ではなく、\"activate\"を使用する']\n ],\n\n // 3.2.2\n '3.2.2' : [\n ['G80', 'G80: 状況の変化を開始する実行ボタンを提供する'],\n ['G13', 'G13: 状況の変化を引き起こすフォームのコントロールが変化する前に、何が起こるのかを説明する'],\n ['SCR19', 'SCR19: 状況の変化を引き起こすことのないように、select要素のonchangeイベントを使用する']\n ],\n\n // 3.3.1\n '3.3.1-A' : [\n ['G83', 'G83: 入力が完了していない必須項目を特定するために、テキストの説明文を提供する'],\n ['ARIA21', 'ARIA21: エラー項目を示すためにaria-invalidを使用する']\n ],\n '3.3.1-B' : [\n ['ARIA18', 'ARIA18: エラーを特定するためにaria-alertdialogを使用する'],\n ['ARIA19', 'ARIA19: エラーを特定するために、ARIA role=alert又はライブ領域(Live Regions)を使用する'],\n ['ARIA21', 'ARIA21: エラー項目を示すためにaria-invalidを使用する'],\n ['G84', 'G84: 利用者が認められた値以外の情報を提供した際に、テキストの説明文を提供する'],\n ['G85', 'G85: 利用者の入力が要求されたフォーマット又は値ではなかった際に、テキストの説明文を提供する']\n ],\n\n // 3.3.2\n '3.3.2' : [\n ['G131/ARIA1/ARIA9/ARIA17/G89/G184/G162/G83/H90', '1.G131: 目的や内容が分かるラベルを提供する、かつ、次のどれか一つを用いる\\n1-a.ARIA1: ユーザインターフェースコントロールに対する説明ラベルを提供するために、aria-describedbyプロパティを使用する\\n1-b.ARIA9: 複数の語句をつなげて一つのラベルにするために、aria-labelledbyを使用する\\n1-c.ARIA17: 関連するフォームコントロールを特定するために、グループ化するロールを使用する\\n1-d.G89: 所定のデータ書式及び入力例を提供する\\n1-e.G184: フォーム又はテキスト・フィールド一式の先頭に、必要とされる入力フォーマットを説明するテキストの説明文を提供する\\n1-f.G162: ラベルを配置して、関係性を最大限に予測できるようにする\\n1-g.G83: 入力が完了していない必須項目を特定するために、テキストの説明文を提供する\\n1-h.H90: 必須項目のフォーム・コントロールを特定するために、label要素又はlegend要素を使用する'],\n ['H44', 'H44: テキストのラベルとフォーム・コントロールを関連付けるために、label要素を使用する'],\n ['H71', 'H71: フォーム・コントロールのグループに関する説明を提供するために、fieldset要素及びlegend要素を使用する'],\n ['H65', 'H65: label要素を使用することができないとき、フォーム・コントロールを特定するために、title属性を使用する'],\n ['G167', 'G167: 隣接するボタンを用いて、テキスト・フィールドの目的をラベル付けする']\n ],\n\n // 4.1.1\n '4.1.1' : [\n ['G134', 'G134: ウェブページをバリデートする'],\n ['G192', 'G192: 仕様に完全に準拠する'],\n ['H88', 'H88: 仕様に準じてHTMLを使用する'],\n ['H74/H93/H94/H75', '以下のいずれかの方法で、ウェブページが正しく解析できることを確認する:\\n4-a.H74: 開始タグ及び終了タグを仕様に準じて使用していることを確認する\\n4-b.H93: ウェブページのid属性値が一意的(ユニーク)であるようにする\\n4-c.H94: 要素には重複した属性がないようにする\\n4-d.H75: ウェブページがwell-formedであることを確認する']\n ],\n\n // 4.1.2\n '4.1.2-A' : [\n ['ARIA14', 'ARIA14: 可視ラベルが使用できない場合に不可視ラベルを提供するために、aria-labelを使用する'],\n ['ARIA16', 'ARIA16: ユーザインターフェースコントロールの名前(name)を提供するために、aria-labelledbyを使用する'],\n ['G108/H91/H44/H64/H65/H88', '下記の達成方法固有の技術を用いて、\\n3.G108: マークアップを用いて、名前及び役割をユーザエージェントに提供し、利用者が設定可能なプロパティを直接設定可能にし、変化を通知する:\\n3-a.H91: HTMLのフォーム・コントロール及びリンクを使用する\\n3-b.H44: テキストのラベルとフォーム・コントロールを関連付けるために、label要素を使用する\\n3-c.H64: frame要素及びiframe要素のtitle属性を使用する\\n3-d.H65: label要素を使用することができないとき、フォーム・コントロールを特定するために、title属性を使用する\\n3-eH88: 仕様に準じてHTML を使用する']\n ],\n '4.1.2-B' : [\n ['ARIA16', '名前及び役割をユーザエージェントに提供し、利用者が設定可能なプロパティを直接設定可能にし、変化を通知する\\nARIA16: ユーザインターフェースコントロールの名前(name)を提供するために、aria-labelledbyを使用する']\n ],\n '4.1.2-C' : [\n ['G135', 'G135: 名前及び役割をユーザエージェントに提供し、利用者が設定可能なプロパティを直接設定可能にし、変化を通知するために、ウェブコンテンツ技術のアクセシビリティAPIを使用する']\n ],\n '4.1.2-D' : [\n ['G10/ARIA4/ARIA5/ARIA16', '下記の達成方法固有の技術を用いて、\\n1.G10: 識別名及び役割を取得し、利用者が設定可能なプロパティを直接設定可能にし、変化を通知するためにユーザエージェントが動作する、プラットフォームのアクセシビリティAPI機能をサポートするウェブコンテンツ技術を用いて、コンポーネントを作成する:\\n1-a.ARIA4: ユーザインターフェースコンポーネントの役割(role)を明らかにするために、WAI-ARIAロールを使用する\\n1-b.ARIA5: ユーザインターフェースコンポーネントの状態(state)を明らかにするために、WAI-ARIAステート及びプロパティ属性を使用する\\n1-c.ARIA16: ユーザインターフェースコントロールの名前(name)を提供するために、aria-labelledbyを使用する']\n ],\n\n // AA\n\n // 1.2.4\n '1.2.4' : [\n ['G9/G93/G87', '1.以下のいずれかを用いて、\\n1.G9: ライブの同期したメディアに対してキャプションを作成する\\n1-a.G93:オープン・キャプション(常に表示)を提供する\\n1-b.G87:クローズド・キャプションを提供する']\n ],\n\n // 1.2.5\n '1.2.5' : [\n ['G78/G173/G8', '収録済みの映像コンテンツに以下のいずれかの方法で音声解説を提供する\\n1-a.G78:音声解説を含んだ、利用者が選択可能な副音声トラックを提供する\\n1-b.G173: 映像の音声解説付きバージョンを提供する\\n1-c.拡張音声解説付のムービーを提供する\\n※映像トラックにある情報のすべてが音声トラックですでに提供されている場合には、音声ガイドを必要としない。'],\n ['G203', 'G203: 話者が話すのみの映像を説明するために、静的な代替テキストを使用する']\n ],\n\n // 1.4.3\n '1.4.3-A' : [\n ['G18', 'G18: テキスト(及び画像化された文字)とその背景の間に、少なくとも 4.5:1 以上のコントラスト比をもたせる'],\n ['G148', 'G148: 背景色及びテキストの色を指定せず、その初期設定を変更するウェブコンテンツ技術の機能を使用しない'],\n ['G174', 'G174: 十分なコントラスト比のあるコントロールを提供して、利用者が十分なコントラストのある表現に変換できるようにする']\n ],\n '1.4.3-B' : [\n ['G145', 'G145: テキスト(及び画像化された文字)とその背景の間に、少なくとも 3:1 以上のコントラスト比をもたせる'],\n ['G148', 'G148: 背景色及びテキストの色を指定せず、その初期設定を変更するウェブコンテンツ技術の機能を使用しない'],\n ['G174', 'G174: 十分なコントラスト比のあるコントロールを提供して、利用者が十分なコントラストのある表現に変換できるようにする']\n ],\n\n // 1.4.4\n '1.4.4' : [\n ['G142', 'G142: ズーム機能をサポートする一般に入手可能なユーザエージェントのあるウェブコンテンツ技術を使用する'],\n ['C28/C12/C13/C14/SCR34/G146', '2. 以下のいずれかを用いて、テキストのサイズを変更した際に、テキスト・コンテナもサイズ変更するようにする、かつ、次の達成方法の一つ以上を用いて、コンテンツにあるその他の大きさと相対的な大きさにする\\n2-a.C28: em単位を用いて、テキストコンテナのサイズを指定する\\n2-b.コンテンツにあるその他の大きさと相対的な大きさにする(C12/C13/C14)\\n2-c.テキスト・コンテナのサイズを可変にする(SCR34/G146)'],\n ['G178', '利用者がウェブページ上のすべてのテキストを200%まで徐々に変更できるコントロールをウェブページ上で提供する'],\n ['G179', '文字サイズを変更しても、テキストコンテナの幅が変更されない際に、コンテンツ又は機能が損なわれないようにする']\n ],\n\n // 1.4.5\n '1.4.5' : [\n ['C22', 'C22: テキストの視覚的な表現を制御するために、CSS を使用する'],\n ['C30', 'C30: テキストを画像化された文字に置き換え、変換するユーザインタフェースコントロールを提供するために、CSS を使用する'],\n ['G140', 'G140: 情報と構造を表現から分離して、異なる表現を可能にする']\n ],\n\n // 2.4.5\n '2.4.5' : [\n ['G125/G64/G63/G161/G126/G185', '次の達成方法のうち2つ以上を用いる:\\nG125: 関連するウェブページへナビゲートするリンクを提供する\\nG64: 目次を提供する\\nG63: サイトマップを提供する\\nG161: 検索機能を提供して、利用者がコンテンツを見つけるのを手助けする\\nG126: 他の全てのウェブページへのリンク一覧を提供する\\nG185: HOME ページからサイト上の全てのウェブページにリンクする']\n ],\n\n // 2.4.6\n '2.4.6' : [\n ['G130', '内容が分かる見出しをつける'],\n ['G131', '目的や内容が分かるラベルを提供する']\n ],\n\n // 2.4.7\n '2.4.7' : [\n ['G149', 'G149: フォーカスを受け取った際に、ユーザエージェントによって強調されるユーザインタフェースコンポーネントを使用する'],\n ['C15', 'C15: ユーザインタフェースコンポーネントがフォーカスを受けとったときの表示を変更するために、CSSを使用する'],\n ['G165', 'G165: 視認性に優れた標準のフォーカスインジケータが引き継がれるように、プラットフォーム標準のフォーカスインジケータを使用する'],\n ['G195', 'G195: コンテンツ制作者が提供する視認性に優れたフォーカスインジケータを使用する'],\n ['SCR31', 'SCR31: フォーカスのある要素の背景色又はボーダーを変更するために、スクリプトを使用する']\n ],\n\n // 3.1.2\n '3.1.2' : [\n ['H58', 'H58: 自然言語の変更を指定するために、言語属性を使用する']\n ],\n\n // 3.2.3\n '3.2.3' : [\n ['G61', 'G61: 繰り返される一連のコンポーネントは毎回同じ相対的順序で提示する']\n ],\n\n // 3.2.4\n '3.2.4' : [\n ['G197', 'G197: 同じ機能を有するコンテンツに対して、一貫したラベル、識別名及び代替テキストを使用する、かつ、達成基準1.1.1を満たすことのできる達成方法かつ達成基準4.1.2を満たすことのできる達成方法に従ってラベル、識別名、代替テキストを提供する。']\n ],\n\n // 3.3.3\n '3.3.3-A' : [\n ['G83', 'G83: 入力が完了していない必須項目を特定するために、テキストの説明文を提供する'],\n ['ARIA2', 'ARIA2: aria-requiredプロパティによって必須項目を特定する']\n ],\n\n '3.3.3-B' : [\n ['ARIA18', 'ARIA18: エラーを特定するためにaria-alertdialogを使用する'],\n ['G85', 'G85: 利用者の入力が要求されたフォーマット又は値ではなかった際に、テキストの説明文を提供する'],\n ['G177', 'G177: テキストの修正候補を提示する'],\n ['SCR18', 'SCR18: クライアントサイドのバリデーション及びアラートを提供する'],\n ['SCR32', 'SCR32: クライアントサイドのバリデーションを提供し、DOMを介してエラーテキストを追加する']\n ],\n\n '3.3.3-C' : [\n ['ARIA18', 'ARIA18: エラーを特定するためにaria-alertdialogを使用する'],\n ['G84', 'G84: 利用者が認められた値以外の情報を提供した際に、テキストの説明文を提供する'],\n ['G177', 'G177: テキストの修正候補を提示する'],\n ['SCR18', 'SCR18: クライアントサイドのバリデーション及びアラートを提供する'],\n ['SCR32', 'SCR32: クライアントサイドのバリデーションを提供し、DOMを介してエラーテキストを追加する']\n ],\n\n // 3.3.4\n '3.3.4-A' : [\n ['G164/G98/G155', '1.いずれかを用いる\\n1-a.フォームの送信後に、利用者が注文を変更又はキャンセルできる一定の時間を提供する\\n1-b.送信する前に、利用者が回答を確認及び修正できるようにする\\n1-c.送信ボタンに加えてチェックボックスを提供する']\n ],\n\n '3.3.4-B' : [\n ['G99/G168/G155', '1.いずれかを用いる\\n1-a.消去した情報を元に戻せるようにする\\n1-b.選択されたアクションを続行するために確認を求める\\n1-c.送信ボタンに加えてチェックボックスを提供する']\n ],\n\n '3.3.4-C' : [\n ['G98/G168', '1.いずれかを用いる\\n1-a.送信する前に、利用者が回答を確認及び修正できるようにする\\n1-b.選択されたアクションを続行するために確認を求める']\n ],\n\n // AAA\n '1.2.6' : [\n ['G54', 'G54: 映像ストリームに手話通訳を含める']\n ],\n\n '1.2.7' : [\n ['G8', 'G8: 拡張音声解説が付いたムービーを提供する\\n音声及び映像をサポートしているプレーヤーを用いる']\n ],\n\n '1.2.8-A' : [\n ['G69/G58/H53', '次の達成方法のどれか一つを用いて、G69: 時間の経過の伴い変化するメディアに対して代替コンテンツを提供する\\n1-a.G58: 非テキストコンテンツのすぐ隣に、時間の経過に伴って変化するメディアの代替へのリンクを置く\\n1-b.H53: object 要素のボディを使用する']\n ],\n '1.2.8-B' : [\n ['G159', 'G159: 時間の経過に伴って変化するメディアの映像しか含まないコンテンツに対して代替コンテンツを提供する']\n ],\n\n '1.2.9' : [\n ['G151', 'G151: 予め用意されたスピーチ原稿のトランスクリプト、又は台本通りのコンテンツの場合には台本へのリンクを提供する'],\n ['G150', 'G150: ライブの音声しか含まないコンテンツに対して、テキストベースの代替コンテンツを提供する'],\n ['G157', 'G157: ライブの音声キャプションサービスをウェブページに組み込む']\n ],\n\n '1.4.6-A' : [\n ['G17', 'G17: テキスト(及び画像化された文字)とその背景の間に、少なくとも7:1以上のコントラスト比をもたせる'],\n ['G148', 'G148: 背景色及びテキストの色を指定せず、その初期設定を変更するウェブコンテンツ技術の機能を使用しない'],\n ['G174', 'G174: 十分なコントラスト比のあるコントロールを提供して、利用者が十分なコントラストのある表現に変換できるようにする']\n ],\n '1.4.6-B' : [\n ['G18', 'G18: テキスト(及び画像化された文字)とその背景の間に、少なくとも4.5:1以上のコントラスト比をもたせる'],\n ['G148', 'G148: 背景色及びテキストの色を指定せず、その初期設定を変更するウェブコンテンツ技術の機能を使用しない'],\n ['G174', 'G174: 十分なコントラスト比のあるコントロールを提供して、利用者が十分なコントラストのある表現に変換できるようにする']\n ],\n\n '1.4.7' : [\n ['G56', 'G56: 発話ではない音が発話の音声コンテンツより少なくとも20デシベル以上低くなるように、音声ファイルを編集する']\n ],\n\n '1.4.8-1' : [\n ['C23/C25/G156/G148/G175', 'いずれかを用いる。\\n1-1. メインコンテンツのテキスト及び背景の色を指定せず、バナー、特集記事及びナビゲーションなどのようにメインではないコンテンツのテキスト及び背景の色をCSSで指定する\\n1-2. CSSで、テキスト及び背景の色は指定せずに、ウェブページの各領域の範囲を明確にするためのボーダーやレイアウトを指定する\\n1-3. 一般に入手可能なユーザーエージェントで、テキストのブロックの前景及び背景を変更できるウェブコンテンツ技術を用いる\\n1-4. 背景色及びテキストの色を指定せず、その初期設定を変更するウェブコンテンツ技術の機能を用いない\\n1-5. 背景及び前景の色を複数から選択できるツールをウェブページ上で提供する']\n ],\n '1.4.8-2' : [\n ['G204/C20', 'いずれかを用いる。\\n2-1. G204:閲覧画面の幅を狭めたときに、ユーザエージェントによるテキストの折り返しを妨げない、又は、\\n2-2. C20:カラム幅に相対サイズを用いて、ブラウザの画面サイズを変更しても各行の文字数が平均80字(日本語は40字)以下を維持できるようにする']\n ],\n '1.4.8-3' : [\n ['C19/G172/G169', 'いずれかを用いる。\\n3-1. C19:CSSでテキストの配置を左寄せ又は右寄せに指定する 、又は、\\n3-2. G172:テキストの両端揃えを解除するメカニズムを提供する、又は、\\n3-3. G169:テキストを左寄せ又は右寄せにする']\n ],\n '1.4.8-4' : [\n ['G188/C21', 'いずれかを用いる。\\n4-1.G188: 行送りや段落の間隔を広げるボタンをウェブページ上に提供する、又は、\\n4-2.C21: 行送りをCSSで指定する']\n ],\n '1.4.8-5' : [\n ['G204/G146/C12/C13/C14/C24/SCR34/G206', 'いずれかを用いる。\\n5-1.G204: 閲覧画面の幅を狭めたときに、ユーザエージェントによるテキストの折り返しを妨げない\\n5-2.G146: リキッドレイアウトを使用する、かつ、次の達成方法の一つ以上を用いて、コンテンツにあるその他の大きさと相対的な大きさにする:\\na.C12: フォントサイズにパーセントを使用する、又は、\\nb.C13: フォントサイズにキーワードを使用する、又は、\\nc.C14: フォントサイズにem単位を使用する 、又は、\\nd.C24: コンテナのサイズにCSSのパーセント値を使用する、又は、\\ne.SCR34: テキストサイズに応じて拡大するように、サイズ及びポジションを定める\\n5-3.G206: レイアウトを切り替えるオプションをコンテンツの中で提供して、利用者が横スクロールをしなくてもテキストの行を読めるようにする']\n ],\n\n '1.4.9' : [\n ['C22', 'C22: テキストの視覚的な表現を制御するために、CSSを使用する'],\n ['C30', 'C30: テキストを画像化された文字に置き換え、変換するユーザインタフェースコントロールを提供するために、CSSを使用する'],\n ['G140', 'G140: 情報と構造を表現から分離して、異なる表現を可能にする']\n ],\n\n '2.1.3' : [\n ['G202', 'G202: すべての機能をキーボードだけでも操作可能にする'],\n ['H91', '次の達成方法の一つを用いて、キーボードで操作できることを保証する。\\nH91: HTML のフォーム・コントロール及びリンクを使用する'],\n ['G90/SCR20/SCR35/SCR2', '次の達成方法の一つを用いて、G90: キーボードがトリガーとなるイベント・ハンドラを提供する:\\nSCR20: キーボードとその他のデバイス特有の機能を両方とも使用する\\nSCR35: アクションをキーボードで操作可能にするために、アンカー及びボタンのonclickイベントを使用する\\nSCR2: キーボード及びマウスのイベント・ハンドラを両方とも使用する']\n ],\n\n '2.2.3' : [\n ['G5', 'G5: 利用者が制限時間なしでタスクを完了できるようにする']\n ],\n\n '2.2.4' : [\n ['G75/G76/SCR14', 'いずれかを用いる。\\n1-a. G75:コンテンツの更新を延期するメカニズムを提供する\\n1-b. G76:自動的に更新するのではなく、利用者がコンテンツの更新を要求するメカニズムを提供する\\n1-c. SCR14:不可欠ではないアラートの表示を任意にするために、スクリプトを使用する']\n ],\n\n '2.2.5' : [\n ['G105/G181', '次の実装技術の一つを使用することでデータを損うことなく継続することができる選択肢を提供する:\\n1-a. G105:利用者が再認証した後に利用できるようにデータを保存する\\n1-b. G181:利用者のデータを、再認証したページで非表示データ又は暗号化されたデータとしてエンコードする']\n ],\n\n '2.3.2' : [\n ['G19', 'G19: どの1秒間においても、コンテンツに3回よりも多く閃光を放つコンポーネントがないことを確認する']\n ],\n\n '2.4.8' : [\n ['G65', 'G65: パンくずリストを提供する'],\n ['G63', 'G63: サイトマップを提供する'],\n ['G128', 'G128: ナビゲーションバー内で現在位置を示す'],\n ['G127/H59', '次に挙げる達成方法の一つを用いて、G127: 技術特有の達成方法を用いて、そのウェブページとその他の多くのウェブページとの関係を示す\\nH59: link 要素及びナビゲーションツールを使用する']\n ],\n\n '2.4.9' : [\n ['ARIA8', 'ARIA8: リンクの目的を示すためにaria-labelを使用する'],\n ['G91', 'G91: リンクの目的を説明したリンクテキストを提供する'],\n ['H30', 'H30: a要素のリンクの目的を説明するリンクテキストを提供する'],\n ['H24', 'H24: イメージマップのarea要素に代替テキストを提供する'],\n ['G189/SCR30', '次の達成方法の一つを用いて、利用者が短めのリンクテキスト又は長めのリンクテキストを選べるようにする:\\nG189: ウェブページの先頭近くに、リンクのラベルを変更するコントロールを提供する\\nSCR30: リンクのラベルを変更するために、スクリプトを使用する'],\n ['C7', '次の達成方法を用いて、リンクの目的を補足説明する:\\nC7: リンクテキストの一部を非表示にするために、CSSを使用する']\n ],\n\n '2.4.10' : [\n ['G141', 'G141: 見出しを用いてウェブページを構造化する'],\n ['H69', 'H69: コンテンツの各セクションの開始位置に見出し要素を提供する']\n ],\n\n '3.1.3-A' : [\n ['G101/G55/H40/H60/G112/H54', 'ウェブページ上で単語や語句の初出時に、以下のいずれかの方法で G101: 一般的ではない、又は限定された用法で用いられている単語や語句の定義を提供する:\\nG55: 定義にリンクする\\nH40: 記述リストを使用する\\nH60: 用語集にリンクするために、link要素を使用する\\nG112: インラインの定義を使用する\\nH54: 単語の定義対象を特定するために、dfn要素を使用する'],\n ['G101/G55/H40/H60/G62/G70', '以下のいずれかの方法を用いて、その単語又は語句がウェブページ上に出現する度にG101: 一般的ではない、又は限定された用法で用いられている単語や語句の定義を提供する:\\nG55: 定義にリンクする\\nH40: 記述リストを使用する\\nH60: 用語集にリンクするために、link要素を使用する\\nG62: 用語集を提供する\\nG70: オンライン辞書を検索する機能を提供する']\n ],\n '3.1.3-B' : [\n ['G101/G55/H40/H60/G112/H54', '以下のいずれかの方法を用いて、その単語又は語句がウェブページ上に出現する度にG101: 一般的ではない、又は限定された用法で用いられている単語や語句の定義を提供する:\\nG55: 定義にリンクする\\nH40: 記述リストを使用する\\nH60: 用語集にリンクするために、link要素を使用する\\nG112: インラインの定義を使用する\\nH54: 単語の定義対象を特定するために、dfn要素を使用する']\n ],\n\n '3.1.4-A' : [\n ['G102/G97/G55/H28', 'ウェブページ上で略語の初出時に、以下のいずれかの方法でG102: 略語の元の語又は説明を提供する:\\nG97: 略語の初出時にその直前か直後に元の語を提供する\\nG55: 定義にリンクする\\nH28: abbr要素を用いて、略語の定義を提供する'],\n ['G102/G55/G62/H60/G70/H28', '以下のいずれかの方法を用いて、その略語がウェブページ上に出現する度にG102: 略語の元の語又は説明を提供する:\\nG55: 定義にリンクする\\nG62: 用語集を提供する\\nH60: 用語集にリンクするために、link要素を使用する\\nG70: オンライン辞書を検索する機能を提供する\\nH28: abbr要素を用いて、略語の定義を提供する']\n ],\n '3.1.4-B' : [\n ['G102/G55/H28', '以下のいずれかの方法を用いて、その略語がウェブページ上に出現する度にG102: 略語の元の語又は説明を提供する:\\nG55: 定義にリンクする\\nH28: abbr要素を用いて、略語の定義を提供する']\n ],\n\n '3.1.5' : [\n ['G86', 'G86: 前期中等教育レベルを超えた読解力を必要としないテキストで要約を提供する'],\n ['G103', 'G103: アイデア、事象及びプロセスの説明を理解しやすくするために、視覚的な図画、写真及びシンボルを提供する'],\n ['G79', 'G79: テキストの音声バージョンを提供する'],\n ['G153', 'G153: テキストを読みやすくする'],\n ['G160', 'G160: コンテンツを利用するのに理解が不可欠な情報、アイデア及びプロセスの手話バージョンを提供する']\n ],\n\n '3.1.6' : [\n ['G120', 'G120: 単語のすぐ後に発音(読み)を提供する'],\n ['G121', 'G121: 発音(読み)にリンクする'],\n ['G62', 'そのコンテンツ特有の発音があったり、発音で意味が変わるような単語の発音に関する情報を含むG62: 用語集を提供する'],\n ['G163', 'G163: オフにすることが可能な標準的な発音区別符号を使用する'],\n ['H62', 'H62: ruby要素を使用する']\n ],\n\n '3.2.5-A' : [\n ['G76', 'G76: 自動的に更新するのではなく、利用者がコンテンツの更新を要求するメカニズムを提供する']\n ],\n '3.2.5-B' : [\n ['SVR1/G110/H76', 'いずれかを用いる\\n1-a.SVR1: クライアントサイドではなく、サーバサイドで自動リダイレクトを実装する\\n1-b.G110: クライアントサイドの瞬間的なリダイレクトを使用する(H76)']\n ],\n '3.2.5-C' : [\n ['H83/SCR24', '次の達成方法の一つを用いてポップアップウィンドウを表示する:\\nH83: 利用者の要求に応じて新しいウィンドウを開き、そのことをリンクテキストで明示するために、target属性を使用する\\nSCR24: 利用者の要求に応じて新しいウィンドウを開くために、プログレッシブ・エンハンスメントを使用する']\n ],\n '3.2.5-D' : [\n ['SCR19', 'SCR19: 状況の変化を引き起こすことのないように、select要素のonchangeイベントを使用する']\n ],\n\n '3.3.5-A' : [\n ['G71', 'G71: すべてのウェブページにヘルプへのリンクを提供する'],\n ['G193', 'G193: ウェブページでアシスタントによるヘルプを提供する'],\n ['G194', 'G194: スペルチェック機能を提供し、テキスト入力の修正候補を提示する'],\n ['G184', 'G184: フォーム又はテキスト・フィールド一式の先頭に、必要とされる入力フォーマットを説明するテキストの説明文を提供する']\n ],\n '3.3.5-B' : [\n ['G89', 'G89: 所定のデータ書式及び入力例を提供する'],\n ['G184', 'G184: フォーム又はテキスト・フィールド一式の先頭に、必要とされる入力フォーマットを説明するテキストの説明文を提供する']\n ],\n\n '3.3.6-A' : [\n ['G164/G98/G155', '1.いずれかを用いる\\n1-a.フォームの送信後に、利用者が注文を変更又はキャンセルできる一定の時間を提供する\\n1-b.送信する前に、利用者が回答を確認及び修正できるようにする\\n1-c.送信ボタンに加えてチェックボックスを提供する']\n ],\n '3.3.6-B' : [\n ['G99/G168/G155', '1.いずれかを用いる\\n1-a.消去した情報を元に戻せるようにする\\n1-b.選択されたアクションを続行するために確認を求める\\n1-c.送信ボタンに加えてチェックボックスを提供する']\n ],\n '3.3.6-C' : [\n ['G98/G168', '1.いずれかを用いる\\n1-a.送信する前に、利用者が回答を確認及び修正できるようにする\\n1-b.選択されたアクションを続行するために確認を求める']\n ]\n\n };\n}", "get iri() {\n return this.nominalValue;\n }", "set ETC2_RGBA8(value) {}", "function YCellular_get_imsi()\n {\n var res; // string;\n if (this._cacheExpiration <= YAPI.GetTickCount()) {\n if (this.load(YAPI.defaultCacheValidity) != YAPI_SUCCESS) {\n return Y_IMSI_INVALID;\n }\n }\n res = this._imsi;\n return res;\n }", "function fl_outToGvina ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t}}", "function ic2chem() {\n\n\n// take the mol from \"molexport\", if it is not void, else take it from \"molexportafter\"\n \n var molString = document.getElementById(\"molexport\").innerHTML;\n if (molString == \"\") { molString = document.getElementById(\"molexport\").innerHTML;}\n var molStringVect = molString.split(\"<br>\");\n\n// transform it into an array \n var molArray = [], molLine = [];\n\n for (var i=0; i<molStringVect.length; i++) {\n molLine = molStringVect[i].trim().split(\" \");\n if (molLine[0] == '') continue;\n molArray.push(molLine);\n }\n\n var edgesSeen = [], molNodeType, countIC = 0, porta, portb, portc, \n portSigna = [], portSignb = [], portSignc = [], \n portSignLeft = \"L\", portSignRight = \"R\", \n translation = \"\";\n\n function edgePar(a) {\n var edgePa = 0, output;\n for (var i=0; i<edgesSeen.length; i++) {\n if (a == edgesSeen[i]) {\n edgePa = 1;\n break;\n }\n }\n if (edgePa == 0) {\n edgesSeen.push(a);\n output = [portSignLeft,portSignRight];\n } else {\n output = [portSignRight,portSignLeft];\n }\n return output;\n }\n\n for (var i=0; i<molArray.length; i++) {\n molNodeType = molArray[i][0]; \n switch (molNodeType) {\n case \"GAMMA\":\n porta = molArray[i][1]; portSigna = edgePar(porta);\n portb = molArray[i][2]; portSignb = edgePar(portb);\n portc = molArray[i][3]; portSignc = edgePar(portc);\n translation += \"FOE \" + portSigna[0] + porta + \" \" + portSignb[1] + portb + \" \" + portSignc[1] + portc + \"<br>\";\n translation += \"FI \" + portSignb[0] + portb + \" \" + portSignc[0] + portc + \" \" + portSigna[1] + porta + \"<br>\";\n countIC = 1;\n break;\n\n case \"DELTA\":\n porta = molArray[i][1]; portSigna = edgePar(porta);\n portb = molArray[i][2]; portSignb = edgePar(portb);\n portc = molArray[i][3]; portSignc = edgePar(portc);\n translation += \"A \" + portSigna[0] + porta + \" \" + portSignb[0] + portb + \" \" + portSignc[1] + portc + \"<br>\";\n translation += \"L \" + portSignc[0] + portc + \" \" + portSignb[1] + portb + \" \" + portSigna[1] + porta + \"<br>\";\n countIC = 1;\n break;\n\n case \"Arrow\":\n porta = molArray[i][1]; portSigna = edgePar(porta);\n portb = molArray[i][2]; portSignb = edgePar(portb);\n translation += \"Arrow \" + portSigna[0] + porta + \" \" + portSignb[1] + portb + \"<br>\";\n translation += \"Arrow \" + portSigna[1] + porta + \" \" + portSignb[0] + portb + \"<br>\";\n break;\n\n case \"T\":\n porta = molArray[i][1]; portSigna = edgePar(porta);\n translation += \"T \" + portSigna[0] + porta + \"<br>\";\n translation += \"T \" + portSigna[1] + porta + \"<br>\";\n break;\n }\n\n }\n\n\n if (countIC == 1) {\n translation = translation.replace(/<br>/g, \"^\");\n } else {\n translation = molString.replace(/<br>/g, \"^\");\n\n}\ndocument.getElementById(\"molyoulookat\").innerHTML = translation;\n\n\n}", "function e(o247) {\n try {\no247 = o247 | 0;\n}catch(e){}\n try {\no1071 = o247\n}catch(e){}\n }", "function cambiaOff() {\n this.src = this.imagenOff.src; //tomamos los valores ya asociados\n}", "function indovina(){\n\n gino = get(posIniX, posIniY, beholder.width, beholder.height);\n classifier.classify(gino, gotResult);\n mappa = aCheAssimiglia(gino, daMappare);\n\n}", "function bi_windup() {\n\t\tif (bi_valid > 8) {\n\t\t\tput_short(bi_buf);\n\t\t} else if (bi_valid > 0) {\n\t\t\tput_byte(bi_buf);\n\t\t}\n\t\tbi_buf = 0;\n\t\tbi_valid = 0;\n\t}", "function readDefineBitsLossless(obj, tag, ba, withAlpha) {\n\t//var pos = ba.position;\n\tvar img = {};\n\timg.type = 'image';\n\timg.id = ba.readUI16();\n\timg.format = ba.readUI8();\n\timg.width = ba.readUI16();\n\timg.height = ba.readUI16();\n\timg.withAlpha = withAlpha;\n\timg.imageType = img.format != BitmapFormat.BIT_8 ? \"PNG\" : \"GIF89a\";\n\timg.tag = withAlpha ? 'defineBitsLossless2' : 'defineBitsLossless';\n\t\n\tif (img.format == BitmapFormat.BIT_8) img.colorTableSize = ba.readUI8() + 1;\n\t\n\tvar zlibBitmapData = ba.readBytes(tag.contentLength - ((img.format == 3) ? 8 : 7));\n\t//var zlibBitmapData = ba.readBytes(tag.contentLength - (ba.position - pos));\n\t//img.colorData = (new Flashbug.ByteArrayString(zlibBitmapData)).unzip(true);\n\timg.colorData = new Flashbug.ZipUtil(new Flashbug.ByteArrayString(zlibBitmapData)).unzip(true);\n\timg.size = img.colorData.length;\n\t\n\tstore(obj, img);\n\t\n\tif (typeof obj.images == \"undefined\") obj.images = [];\n\tobj.images.push(img);\n}", "function bitacoraPT(iFilaPT){\n try{\n if (sAccesoBitacoraPE == \"X\") return;\n var sCodproy=$I(\"txtCodProy\").value;\n if (sCodproy==\"\") return;\n if (iFilaPT == -1) return;\n\n LLamarBitacoraPT(iFilaPT);\n }\n catch (e) {\n mostrarErrorAplicacion(\"Error al mostrar Bitácora de PT desde el PE\", e.message);\n }\n}", "function Re(){!function t(e){Ce[Te++]^=255&e,Ce[Te++]^=e>>8&255,Ce[Te++]^=e>>16&255,Ce[Te++]^=e>>24&255,Te>=256&&(Te-=256)}((new Date).getTime())}", "protected internal function m252() {}", "newIcon() {\n return `${this.iconPrefix}${this.getEquivalentIconOf(this.icon)}`;\n }", "function deteksiGambar(file){\n nude.load(file);\n nude.scan(function(result){\n if (result){\n console.log(file+\" terdeteksi nude\");\n $(\"#\"+file).attr('src','http://3.bp.blogspot.com/-FV-EDYwmvyU/UTWfJ1YpL5I/AAAAAAAAAJ4/CNh9wOHfo7w/s1600/noporddn.png');\n }else{\n console.log(file+\" bukan nude\");\n }\n });\n \n}", "function mo(t) {\n for (;t.Cl.length > 0 && t.xl.size < t.bl; ) {\n var e = t.Cl.shift(), n = t.Ml.next();\n t.Nl.set(n, new $i(e)), t.xl = t.xl.Ht(e, n), di(t.gl, new me(fe(re(e.path)), n, 2 /* LimboResolution */ , Q.U));\n }\n}", "static getOriginalDenomFromPacket (ibc_package,type) { \n let denom_result = '';\n if (ibc_package && typeof ibc_package == 'object') {\n let { source_port, source_channel, destination_port, destination_channel, data } = ibc_package;\n let prefix_sc = `${source_port}/${source_channel}/`;\n let prefix_dc = `${destination_port}/${destination_channel}/`;\n let denom = data.denom;\n if (type && type == TX_TYPE.timeout_packet) {\n if (denom.startsWith(prefix_sc)) {\n denom_result = `ibc/${Tools.sha256(denom).toUpperCase()}`;\n }else{\n denom_result = denom;\n }\n }else{\n if (denom.startsWith(prefix_sc)){\n let denom_clear_prefix = denom.replace(prefix_sc,'');\n if (denom_clear_prefix.indexOf('/') == -1) {\n denom_result = denom_clear_prefix;\n }else{\n denom_result = `ibc/${Tools.sha256(denom_clear_prefix).toUpperCase()}`;\n }\n }else{\n let denom_add_prefix = `${prefix_dc}${denom}`;\n denom_result = `ibc/${Tools.sha256(denom_add_prefix).toUpperCase()}`;\n }\n }\n }\n return denom_result;\n }", "get icon()\n\t{\n\t\tthrow new Error(\"Not implemented\");\n\t}", "function convertToEpic(input) {\n\tswitch (input) {\n\t\tcase 0:\n\t\toutput = 0;\n\t\tbreak;\n\t\tcase 1:\n\t\toutput = 1;\n\t\tbreak;\n\t\tcase 2:\n\t\toutput = 2;\n\t\tbreak;\n\t\tcase 3:\n\t\toutput = 4;\n\t\tbreak;\n\t\tcase 4:\n\t\toutput = 7;\n\t\tbreak;\n\t\tcase 5:\n\t\toutput = 11;\n\t\tbreak;\n\t\tcase 6:\n\t\toutput = 16;\n\t\tbreak;\n\t\tcase 7:\n\t\toutput = 22;\n\t\tbreak;\n\t\tcase 8:\n\t\toutput = 29;\n\t\tbreak;\n\t\tcase 9:\n\t\toutput = 37;\n\t\tbreak;\n\t\tcase 10:\n\t\toutput = 46;\n\t\tbreak;\n\t}\n\treturn output;\n}", "function inv_gam_sRGB(ic) {\n var c = ic/255;\n //todo: could break if comparing big number\n if (c <= 0.04045) {\n return c/12.92;\n } else {\n return Math.pow(((c+0.044)/(1.055)), 2.4);\n }\n}", "function mostraNotas(){}", "function Hx(a){return a&&a.ic?a.Mb():a}", "iluminarSecuencia() {\n for (let i = 0; i < this.nivel; i++) {\n //el numero que nos den (1) va a la funcion transformar.. y nos va a devolver un texto ('celeste')\n //importante poner const para eliminar bug en los ciclos\n const color = this.transformarNumeroAColor(this.secuencia[i]);\n //la funcion iliminarColor se va a ejecutar cada 1 segundo multiplicado por i para que la secuncia se vea cada color\n setTimeout(() => {\n this.iluminarColor(color);\n }, 800 * i);\n this.cambioColorFondo(color);\n }\n }", "function Le(){!function t(e){Ie[De++]^=255&e,Ie[De++]^=e>>8&255,Ie[De++]^=e>>16&255,Ie[De++]^=e>>24&255,De>=Ue&&(De-=Ue)}((new Date).getTime())}", "getItalics(line){\n\n }", "function Iluminacao(pl, ka, ia, kd, od, ks, il, n) {\n this.pl = pl; //posições originais da fonte de luz em coordenadas de mundo\n this.pl_pvista_camera = pl; //adapta as posiçoes de entrada para o ponto de vista da camera\n this.ka = ka; // reflexão de luz ambiente (quanto maior, mais reflexível é)\n this.ia = ia; // intensidade da luz ambiente (quanto maior, mais iluminado kkk)\n this.kd = kd; // constante difusa, o quão espalhável é essa luz\n this.od = od; // vetor difuso, usado para simplesmente espalhar kkk\n this.ks = ks; // parte especular, como a luz vai ser refletida no objeto\n this.il = il; // cor da fonte de luz\n this.n = n; // constante de rugosidade, trata irregularidades, ruídos, enfim, frescura.\n}", "get Alpha8() {}", "function exceptions() {\n tricks[62][0] = \"fakie ollie one-foot\";\n tricks[82][0] = \"halfcab\";\n tricks[83][0] = \"fakie bigspin\";\n tricks[85][0] = \"halfcab flip\";\n tricks[86][0] = \"halfcab heelflip\";\n tricks[87][0] = \"halfcab double flip\";\n tricks[88][0] = \"halfcab double heelflip\";\n tricks[92][0] = \"FS halfcab\";\n tricks[95][0] = \"FS halfcab flip\";\n tricks[96][0] = \"FS halfcab heelflip\";\n tricks[97][0] = \"FS halfcab double flip\";\n tricks[98][0] = \"FS halfcab double heelflip\";\n tricks[183][0] = \"nollie\";\n tricks[184][0] = \"nollie one-foot\";\n}", "vi() {\n const out = this.vu();\n return (0 - (out & 1)) ^ (out >>> 1);\n }", "function ri(a){ri.k.constructor.call(this,a);this.Uc()}", "function inverse(flag){\n\tif (flag==0)\n\t\treturn \"b\";\n\tif (flag==1)\n\t\treturn \"w\";\n}", "switchIlumination() {\n\n if (!this.typeBasic)\n //colocamos o material (Phong ou Lambert) como sendo Basic\n this.material = this.materials[0];\n\n else\n //colocamos o material Basic como sendo o anterior a ser mudado para Basic\n this.material = this.materials[this.currMaterial];\n\n this.typeBasic = !this.typeBasic;\n }", "get imc() {\n const IMC = this.peso / (this.altura ** 2);\n return IMC.toFixed(2);\n }", "function oi(a){this.Of=a;this.rg=\"\"}", "function readDefineBitsLossless2(obj, tag, ba) {\n\treadDefineBitsLossless(obj, tag, ba, true);\n}", "function cute(){\n vm.input = vm.input.concat(\"😊\");\n }", "getIcon_() {\n return this.isCloudGamingDevice_ ? 'oobe-32:game-controller' :\n 'oobe-32:checkmark';\n }", "function Ei(a,b,c){Ei.u.constructor.call(this,a);this.jb=a.jb||Fi;this.De=a.De||Gi;var e=[];e[C.hb]=new $h;e[C.tf]=new $h;e[C.Qa]=new $h;e[C.ce]=new $h;this.vj=e;b&&(this.nc=b);c&&(this.qf=c);this.Yi=this.qf&&C.i.Xe();this.m=[];this.dc=new xi(a.vc);this.Lc=this.options.wn?new bi(a.wn,a.vn):null;C.O&&C.O.le&&(this.$f[C.jm]=C.O.le);C.Fc&&C.Fc.le&&(this.$f[C.Iw]=C.Fc.le);C.cb&&C.cb.le&&(this.$f[C.cm]=C.cb.le)}", "function IndicadorAntiguedad () {}", "function annoyed(){\n vm.input = vm.input.concat(\"😒\");\n }", "function etmToOliOls(img) {\n return img.select(['Blue', 'Green', 'Red', 'NIR', 'SWIR1', 'SWIR2'])\n .multiply(coefficients.etmToOliOls.slopes)\n .add(coefficients.etmToOliOls.itcps)\n .round()\n .toShort()\n .addBands(img.select('pixel_qa'));\n}", "function Oe(){!function t(e){Ie[De++]^=255&e,Ie[De++]^=e>>8&255,Ie[De++]^=e>>16&255,Ie[De++]^=e>>24&255,De>=Le&&(De-=Le)}((new Date).getTime())}", "function addSoilIndices(img){\r\n img = img.addBands(img.normalizedDifference(['red','green']).rename('NDCI'));\r\n img = img.addBands(img.normalizedDifference(['red','swir2']).rename('NDII'));\r\n img = img.addBands(img.normalizedDifference(['swir1','nir']).rename('NDFI'));\r\n \r\n var bsi = img.expression(\r\n '((SWIR1 + RED) - (NIR + BLUE)) / ((SWIR1 + RED) + (NIR + BLUE))', {\r\n 'BLUE': img.select('blue'),\r\n 'RED': img.select('red'),\r\n 'NIR': img.select('nir'),\r\n 'SWIR1': img.select('swir1')\r\n }).float();\r\n img = img.addBands(bsi.rename('BSI'));\r\n \r\n var hi = img.expression(\r\n 'SWIR1 / SWIR2',{\r\n 'SWIR1': img.select('swir1'),\r\n 'SWIR2': img.select('swir2')\r\n }).float();\r\n img = img.addBands(hi.rename('HI')); \r\n return img.float();\r\n}", "function curvenum_getState(infil, x)\n{\n x[0] = infil.S;\n x[1] = infil.P;\n x[2] = infil.F;\n x[3] = infil.T;\n x[4] = infil.Se;\n x[5] = infil.f;\n}", "function getIcon(t) {\n if (t === \"collision\")\n return icons[\"bikeRedIcon\"];\n else if (t === \"nearmiss\")\n return icons[\"bikeYellowIcon\"];\n else if (t === \"hazard\")\n return icons[\"hazardIcon\"];\n else if (t === \"theft\")\n return icons[\"theftIcon\"];\n else if (t === \"official\")\n return icons[\"officialIcon\"];\n else if (t === \"newInfrastructure\")\n return icons[\"newInfrastructureIcon\"];\n else return;\n}", "static get icon() { throw new Error('unimplemented - must use a concrete class'); }", "LiberarPreso(valor){\nthis.liberation=valor;\n }", "function toggle(){\n\tif(CijiJeRed==0)CijiJeRed=1;\n\telse CijiJeRed=0;\n\t\n\tdocument.getElementById(\"poruka-u-igri\").innerText = \"Red je na igrača \" +igraci[CijiJeRed];\n}", "constructor(ins) {\n super(ins);\n /**\n * The string of the error message.\n */\n this.errMsg = \"\";\n let opBin = MapForI_1.MapForI.getMap().get(this.operator);\n if (opBin == undefined) {\n this.op = \"XXXXXX\";\n this.errMsg = this.errMsg + \"Error 101: Failed to construct type-I instruction. -- \" + ins + \"\\n\";\n }\n else {\n this.op = opBin;\n }\n let posOfSpace = ins.indexOf(\" \");\n if (this.operator == \"lui\") {\n let operands = ins.substring(posOfSpace + 1, ins.length).split(\",\", 2);\n this.operandRS = \"\";\n this.operandRT = operands[0];\n this.operandIMM = operands[1];\n this.rs = \"00000\";\n this.rt = DecimalToBinary_1.decimalToBinary(+this.operandRT.substring(1), 5);\n this.imm = DecimalToBinary_1.decimalToBinary(+this.operandIMM, 16);\n }\n else if (this.operator == \"beq\" || this.operator == \"bne\") {\n let operands = ins.substring(posOfSpace + 1, ins.length).split(\",\", 3);\n this.operandRS = operands[0];\n this.operandRT = operands[1];\n this.operandIMM = operands[2];\n this.rs = DecimalToBinary_1.decimalToBinary(+this.operandRS.substring(1), 5);\n this.rt = DecimalToBinary_1.decimalToBinary(+this.operandRT.substring(1), 5);\n this.imm = DecimalToBinary_1.decimalToBinary(+this.operandIMM, 16);\n }\n else if (this.operator == \"addi\" ||\n this.operator == \"addiu\" ||\n this.operator == \"andi\" ||\n this.operator == \"ori\" ||\n this.operator == \"slti\" ||\n this.operator == \"sltiu\") {\n let operands = ins.substring(posOfSpace + 1, ins.length).split(\",\", 3);\n this.operandRS = operands[1];\n this.operandRT = operands[0];\n this.operandIMM = operands[2];\n this.rs = DecimalToBinary_1.decimalToBinary(+this.operandRS.substring(1), 5);\n this.rt = DecimalToBinary_1.decimalToBinary(+this.operandRT.substring(1), 5);\n this.imm = DecimalToBinary_1.decimalToBinary(+this.operandIMM, 16);\n }\n else {\n let operands = ins.substring(posOfSpace + 1, ins.length).split(\",\", 2);\n let leftBracket = operands[1].indexOf(\"(\");\n let rightBracket = operands[1].indexOf(\")\");\n this.operandRS = operands[1].substring(leftBracket + 1, rightBracket);\n this.operandRT = operands[0];\n this.operandIMM = operands[1].substring(0, leftBracket);\n this.rs = DecimalToBinary_1.decimalToBinary(+this.operandRS.substring(1), 5);\n this.rt = DecimalToBinary_1.decimalToBinary(+this.operandRT.substring(1), 5);\n this.imm = DecimalToBinary_1.decimalToBinary(+this.operandIMM, 16);\n }\n this.binIns = this.op + this.rs + this.rt + this.imm;\n }", "function ie03Back(){ \r\n\t\tz_ie03_change_display = false;\r\n\t\tset(\"V[z_ie03_*]\",\"\");\r\n}", "function GetBornosoftModifiedCharaceter(CUni)\r\n{\r\n\tvar CMod=CUni;\r\n\r\n\tif(LCUNI=='ক' && CUni=='হ') CMod = 'খ';\r\n\telse if(LCUNI=='গ' && CUni=='হ') CMod = 'ঘ';\r\n\telse if(LCUNI=='চ' && CUni=='হ') CMod = 'চ';\r\n\telse if(LCUNI=='জ' && CUni=='হ') CMod = 'ঝ';\r\n\telse if(LCUNI=='ট' && CUni=='হ') CMod = 'ঠ';\r\n\telse if(LCUNI=='ড' && CUni=='হ') CMod = 'ঢ';\r\n\telse if(LCUNI=='ত' && CUni=='হ') CMod = 'থ';\r\n\telse if(LCUNI=='দ' && CUni=='হ') CMod = 'ধ';\r\n\telse if(LCUNI=='প' && CUni=='হ') CMod = 'ফ';\r\n\telse if(LCUNI=='ব' && CUni=='হ') CMod = 'ভ';\r\n\telse if(LCUNI=='স' && CUni=='হ') CMod = 'শ';\r\n\telse if(LCUNI=='ড়' && CUni=='হ') CMod = 'ঢ়';\r\n\r\n\telse if(LCUNI=='ণ' && CUni=='গ') CMod = 'ঙ';\r\n\telse if(LCUNI=='ন' && CUni=='গ') CMod = 'ং';\r\n\t\r\n\telse if(LCUNI=='ণ' && CUni=='ঘ') CMod = 'ঞ';\r\n\r\n\telse if(LCUNI=='ণ' && CUni=='ণ') CMod = 'ঁ';\r\n\r\n\telse if(LCUNI=='ঃ' && CUni=='ঃ') CMod = 'ঃ';\r\n\t\r\n\telse if(LCUNI=='ট' && CUni=='ট') CMod = 'ৎ';\r\n\t\r\n\telse if(LCUNI=='া' && CUni=='ো') CMod = 'অ';\r\n\telse if(LCUNI=='ি' && CUni=='ি') CMod = 'ী';\r\n\telse if(LCUNI=='ই' && CUni=='ই') CMod = 'ঈ';\r\n\telse if(LCUNI=='ু' && CUni=='ু') CMod = 'ূ';\r\n\telse if(LCUNI=='উ' && CUni=='উ') CMod = 'ঊ';\r\n\telse if(LCUNI=='ও' && CUni=='ই') CMod = 'ঐ';\r\n\telse if(LCUNI=='ো' && CUni=='ি') CMod = 'ৈ';\r\n\telse if(LCUNI=='ও' && CUni=='উ') CMod = 'ঔ';\r\n\telse if(LCUNI=='ো' && CUni=='ু') CMod = 'ৌ';\r\n\telse if(LCUNI=='ৃ' && CUni=='র') CMod = 'ৃ';\r\n\telse if(LCUNI=='ঋ' && CUni=='ড়') CMod = 'ঋ';\r\n\r\n\treturn CMod;\r\n}", "function fl_outToOznei_aman ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}" ]
[ "0.5471111", "0.54525274", "0.53871924", "0.5323614", "0.5244285", "0.52346927", "0.52339107", "0.52299815", "0.5226354", "0.5210173", "0.51994616", "0.5172732", "0.5157133", "0.515656", "0.51405287", "0.5108636", "0.51050586", "0.5091474", "0.5067333", "0.50654525", "0.5060671", "0.503525", "0.50264114", "0.50264114", "0.50264114", "0.50264114", "0.5023152", "0.50191396", "0.5018117", "0.49968517", "0.49882755", "0.49882755", "0.49882755", "0.49793464", "0.4975672", "0.49735647", "0.49720752", "0.49543816", "0.49308017", "0.4926303", "0.4926303", "0.4926303", "0.4926303", "0.4926303", "0.4926303", "0.4914438", "0.48983902", "0.4892672", "0.48926425", "0.48909503", "0.48883748", "0.48723876", "0.4869983", "0.48648435", "0.48628762", "0.48618424", "0.48575798", "0.4856385", "0.48374677", "0.4836496", "0.48333466", "0.4829056", "0.48282382", "0.482675", "0.4826291", "0.48261765", "0.48234144", "0.4816339", "0.48146197", "0.48090768", "0.48074996", "0.48043153", "0.47935256", "0.479285", "0.47920617", "0.47916508", "0.47879726", "0.47858885", "0.47745982", "0.476734", "0.47663707", "0.4765693", "0.47557175", "0.4755627", "0.475141", "0.47456723", "0.47446856", "0.47445846", "0.47390768", "0.47384265", "0.47256836", "0.47233814", "0.4719778", "0.47170034", "0.4711488", "0.47100773", "0.47086304", "0.4707086", "0.47020206", "0.46974316", "0.46907425" ]
0.0
-1
let result = inArray; let final = arrForInArr.filter(result([3, 5, 8])) console.log(myFilterArra(arrForInArr,[3, 5, 8],inArray));
function byField(fieldName){ return (a, b) => a[fieldName] > b[fieldName] ? 1 : -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function myFilter(arr, f){\n let ans = [] ;\n\n for(let i = 0; i < arr.length; i++){\n if(f(arr[i]) == true){\n ans.push(arr[i]) ;\n }\n }\n return ans ;\n}", "function filter (array,fn) {\n return array.filter(fn)\n}", "function filter(arr,fn) {\n const newArray = [];\n for(let i = 0; i<arr.length; i++){\n if(fn(arr[i])){\n newArray.push(arr[i]);\n }\n } \n return newArray;\n}", "function filter(arr,fn){\n let filteredArray=[];\n for(let i =0;i<arr.length;i++){\n if(fn(arr[i])===true){\n filteredArray.push(arr[i]);\n }\n }\n return filteredArray;\n}", "function destroyer(arr) {\n // Remove all the values\n //turn the argument of function to array\n var args = Array.prototype.slice.call(arguments);\n // turn arguments to array\n var arg = args.slice(1);\n console.log(args);\n // loop through array and each value that not in arguments return to newArr\n var newArr = args[0].filter(function(val) {\n if (arg.indexOf(val) == -1) {\n return true;\n }\n return false;\n });\n console.log(newArr);\n return newArr;\n}", "function filterArray(arr,func){\n return arr.filter(func);\n}", "function passTesting(arr, func) {\n // let new_array = [];\n\n // Let's try this with a simple for() loop // *** THIS WORKS BUT LETS IMPROVE IT ***\n // for(let i = 0; i < arr.length; i++) {\n // let result = func(arr[i]);\n // if(result == true) {\n // new_array.push(arr[i]);\n // }\n // }\n // return the NEW_ARRAY\n\n // ** This is how we can use higher order functions and improve the above code\n let new_array = arr.filter( elem => func(elem));\n \n console.log(new_array);\n return new_array;\n}", "function filterArray(array){\r\n return array.filter((elem, index, self) => {\r\n return index === self.indexOf(elem);\r\n });\r\n}", "function filter(arr, fn) {\n let newArray = [];\n\n for (let i=0; i<arr.length; i++){\n if(fn(arr[i]) === true){\n newArray.push(arr[i]);\n }\n }\n return newArray;\n}", "function filter(an_array, a_function) {\n return a_function(an_array);\n }", "function filterArray(arr, filterFn) {\r\n var tempArr = [];\r\n for (var i = 0; i < arr.length; i++) {\r\n if (filterFn(arr[i], i, arr)) {\r\n tempArr.push(arr[i]);\r\n }\r\n }\r\n return tempArr;\r\n}", "function filter(array,test){\n //Create a new array to populate and return\n let passed = [];\n //Apply the test to each element of the array, if passes add to return array\n for(let element of array){\n if(test(element)){\n passed.push(element);\n }\n }\n return passed;\n}", "function filter(arr, fn) {\n\tlet test = [];\n\tfor(let item of arr){\n\t\tif(fn(item)){\n\t\t\ttest.push(item);\n\t\t}\n\t\n\t}\n\treturn test;\n}", "function filter(lambda,array) {\n var newArray = new Array()\n for(var i = 0; i < array.length; i++) {\n if(lambda(array[i])) newArray.push(array[i])\n }\n return newArray\n}", "function filter(array, test) {\n//filter function passing it test and array\n var passed = [];\n//creating variable passes and new array\n for (var i = 0; i < array.length; i++) \n//for i is = to 0 and i is less than array length increment i\n {\n if (test(array[i]))\n//testting i in array\n passed.push(array[i]);\n//pushing onto the array\n }\n return passed;\n}", "function filter(arr, fn) {\n let newArray = [];\n for (i=0; i<arr.length; i++) {\n if(fn(arr[i])===true) {\n newArray.push(arr[i]);\n }\n }\n return newArray;\n}", "function filterArray(array, filterFunction) {\n // your code here!\n}", "function filter(array, fn) {\n let filteredArray = [];\n array.forEach(element => {\n if (!fn(element)) {\n filteredArray.push(element);\n }\n });\n console.log(filteredArray); \n}", "function filteredArray(arr, elem) {\n let newArr = [];\n // Only change code below this line\n for (let i = 0; i < arr.length; i++) {\n console.log(arr[i]);\n var test = arr[i].indexOf(elem)\n if(test == -1) {\nnewArr.push(arr[i])\n }\n }\n // Only change code above this line\n return newArr;\n}", "function filter(arr, fn) {\n let newArray = [];\n\n arr.forEach(element => { if (fn(element) === true) {\n newArray.push(element);\n }\n });\n\n return newArray;\n}", "function filteredArray(arr, elem) {\r\n let newArr = [];\r\n // Only change code below this line\r\n for (let i = 0; i < arr.length; i++){\r\n if (arr[i].indexOf(elem) == -1){\r\n newArr.push(arr[i]);\r\n }\r\n // Only change code above this line\r\n \r\n}\r\nreturn newArr;\r\n}", "function filteredArray(arr, elem) {\n let newArr = [];\n // change code below this line\n for (let i = 0; i < arr.length; i++) {\n if (arr[i].indexOf(elem) == -1) {\n newArr.push(arr[i]);\n };\n };\n\n // change code above this line\n return newArr;\n}", "function filter(array, fn) {\n // Your code here\n\n // I create an empty array result that will contain my answer\n let result=[];\n\n // I check that functions inputs were Ok\n if(array.length !==0 && fn===pickEvenNumbers){\n // If OK, I filter the array\n result=array.filter(fn);\n //If not, I manage the case\n }else{\n return(\"tableau vide\",array);\n }\n //I return the filtered array\n return result;\n}", "function filter(arr, func){\n let filtered = []\n for(let i=0; i < arr.length; i++){\n if(func(arr[i])){\n filtered.push(arr[i])\n }\n }\n return filtered;\n}", "function filterArray(arr, callback) {\r\n const copyArr = [];\r\n for (let item of arr) {\r\n copyArr.push(item);\r\n }\r\n executeforEach(copyArr, callback);\r\n const filteredArr = [];\r\n for (let i = 0; i < copyArr.length; i++) {\r\n if (copyArr[i] === true) {\r\n filteredArr.push(arr[i]);\r\n }\r\n }\r\n return filteredArr;\r\n}", "function filter(array, test) {\r\n\tlet passed = [];\r\n\tfor(let element of array) {\r\n\t\tif(test(element)) {\r\n\t\t\tpassed.push(element);\r\n\t\t}\r\n\t}\r\n\treturn passed;\r\n}", "function filterPassing(array) {\n let filter = array.filter(array => array.passed === true);\n return filter\n}", "function filterMethod(input) {\n var randomArr = [35, 87, 22, 96, 22, 66, 8, input];\n\n Array.prototype.userFilter = function (oddNumbers) {\n var newArray = [];\n // Empty array that numbers will be pushed into\n for (let i = 0; i <= this.length; i++) {\n if (oddNumbers(this[i])) {\n newArray.push(this[i]);\n }\n }\n return newArray;\n };\n\n // filteredArray takes array filters out all odd numbers\n var filteredArray = randomArr.userFilter(function (item) {\n return item % 2 === 1;\n });\n return filteredArray;\n}", "function filteredArray(arr, elem) {\n let newArr = []\n\n for (let i = 0; i < arr.length; i++) {\n if (arr[i].indexOf(elem) == -1) { //Checks every parameter for the element and if NOT there continues the code\n newArr.push(arr[i]) //Inserts the element of the array in the new filtered array\n }\n }\n return newArr\n }", "function filter(array, test){\n let passed = [];\n for(let element of array){\n if(test(element)){\n passed.push(element);\n }\n }\n return passed;\n}", "function filter(arr, fn) {\n let newArray = [];\n for (const item of arr) {\n if (fn(item)) newArray.push(item);\n }\n return newArray;\n}", "function bouncer(arr) {\n \n let trueValues = arr.filter(function bouncer(arr) {\n\n return arr;\n \n })\n\n return trueValues;\n}", "function filter(array, test) { // filters through an array\n var passed = []; // holds the passed elements of the test\n for (var i = 0; i < array.length; i++) { // goes through the length of the array\n if (test(array[i])) { // if the element passes the test\n passed.push(array[i]); // put it in the new array\n }// end of if \n }// end of for loop\n return passed; // return the array with the passes elements\n}// end of function", "function filter(arr, fn) {\n let newArray = [];\n\n for (let elem of arr) {\n if(fn(elem)) newArray.push(elem);\n }\n\n return newArray;\n}", "function myFilter(fn) {\n var res = [];\n for (var i = 0; i < arr.length; i++) {\n var ret = fn(arr[i]);\n if (ret) res.push(arr[i]);\n }\n\n return res;\n}", "function filteredArray(arr, elem) {\n let newArr = [];\n debugger\n // change code below this line\n for (var i = 0; i < arr.length; i++) {\n if (arr[i].indexOf(elem) <= -1) {\n newArr.push(arr[i]);\n }\n }\n if (newArr.length == 0) {\n return [];\n } else {\n return newArr;\n }\n}", "function myFilter(arr,callback){\n var myfilter=[]\n for(var i=0;i<arr.length;i++){\n if (callback(arr[i])){\n myfilter.push(arr[i]);\n }\n }\n return myfilter;\n}", "function cs142MakeMultiFilter(originalArray) {\n let currentArray = originalArray.slice();\n return function arrayFilterer(filterCriteria, callback) {\n if (typeof(filterCriteria) !== \"function\") {\n return currentArray;\n }\n for (let i = currentArray.length - 1; i >= 0; i--) {\n if (!filterCriteria(currentArray[i])) {\n currentArray.splice(i, 1);\n }\n }\n if (typeof(callback) === \"function\") {\n callback.call(originalArray, currentArray);\n }\n return arrayFilterer;\n };\n}", "function filteredArray(arr, elem) {\n let newArr = [];\n // change code below this line\n\n // change code above this line\n return newArr;\n}", "function myFilter(array, func) {\n var results = [];\n var i;\n for (i = 0; i < array.length; i++) {\n if (func(array[i])) {\n results.push(array[i]);\n }\n };\n\n return results;\n}", "function filter(arr, func)\n{\n\tvar resultSet = [];\n\tif (arr.length == 0) return resultSet;\n\tfor (var i = 0; i < arr.length; i++)\n\t{\n\t\tif (func(arr[i], i, arr))\n\t\t{\n\t\t\tresultSet.push(arr[i]);\n\t\t}\n\t}\n\treturn resultSet;\n}", "function filter(array, filterFct) {\n\nvar outputArray = [];\n//iterate thru the initial array\n//check if element is even or not\nfor (var element of arr) {\n // if (element % 2 === 0) {\n // outputArr.push(element);\n // }\n if (filterFct(element)) {\n outputArr.push(element);\n }\n}\nreturn outputArr;\n}", "function filteredArray(arr, elem) {\n // console.log(arr, elem);\n let newArr = [];\n \n for (let i = 0; i < arr.length; i++) {\n for (var j = 0; j < arr[i].length; j++) {\n }\n if(arr[i].indexOf(elem) < 0) {\n newArr.push(arr[i]);\n } \n \n }\n \n return newArr;\n}", "function filter(arr, a) {\r\n let newArr = [];\r\n for( let i = 0; i < arr.length; i++){\r\n if(i >= a){\r\n newArr.push(arr[i])\r\n }\r\n }\r\n return newArr;\r\n}", "function filteredArray(arr, elem) {\n let newArr = [];\n for (let i = 0; i < arr.length; i++) {\n if (arr[i].indexOf(elem) === -1) {\n newArr.push(arr[i]);\n }\n }\n //return filtered array\n return newArr;\n}", "function intermediate1(input) {\n let array = input.filter(function (data, index) {\n return input.indexOf(data) == index;\n })\n return array;\n}", "function destroyer(arr, secondArray){\n return arr.filter(val => {\n return !secondArray.includes(val);\n })\n}", "function filteredArray(arr, elem) {\n let newArr = [];\n // Only change code below this line\n for(var i = 0; i < arr.length; i++){\n if(arr[i].indexOf(elem) == -1){for(var i = 0; i < arr.length; i++){\n if(arr[i].indexOf(elem) === -1){\n newArr.push(arr[i])\n }\n }\n newArr.push(arr[i])\n }\n }\n \n return newArr;\n }", "function filter(array, test) {\n let passed = [];\n for (let element of array) {\n if (test(element)) {\n passed.push(element);\n }\n }\n return passed;\n}", "function filter (arr, fn) {\n let newArr = [];\n for (let i = 0, max = arr.length; i < max; i += 1) {\n if (fn(arr[i], i, arr)) {\n newArr.push(arr[i]);\n }\n }\n return newArr;\n}", "function filter(array, test) {\n let passed = [];\n for (let element of array) {\n if (test(element)) {\n passed.push(element);\n }\n }\n\n return passed;\n}", "function filterFunction(arr1, arr2) {\n return arr1.filter(function(item) {\n return arr2.indexOf(item) === -1;\n });\n }", "function destroyer(arr) {\n let newArr = [...arguments].slice(1);\n return arr.filter(a => !newArr.includes(a));\n}", "function filter(arr) {\n let filterArray = [];\n for(let i = 0; i < arr.length; i++) {\n if(arr[i] >= 5) {\n filterArray.push(arr[i])\n }\n }\n console.log(filterArray)\n}", "function filterFunction(arr1, arr2) {\n return arr1.filter((item) => {\n return arr2.indexOf(item) === -1;\n });\n }", "function filterArray(arr){\n var array=[];\n for(const index of arr){\n index1=index.length;\n if(index1<4){\n array.push(index);\n }\n return array;\n }\n}", "function filter(array, fnc){\n myNewArray=[], \n for (i=0,i<array.length; i++){\n const num = fnc(array[i]);\n if (num===1||num===3){\n myNewArray.push(num);\n }\n }\n return (myNewArray)\n }", "function filter(array, f) {\n if (array) {\n var len = array.length;\n var i = 0;\n while (i < len && f(array[i]))\n i++;\n if (i < len) {\n var result = array.slice(0, i);\n i++;\n while (i < len) {\n var item = array[i];\n if (f(item)) {\n result.push(item);\n }\n i++;\n }\n return result;\n }\n }\n return array;\n }", "function myFilter(arr, callback){\n var virza =[];\n\n for(var i=0; i<arr.length; i++){\n if (callback(arr[i])){\n virza.push(arr[i]);\n }\n }\n return virza;\n}", "function myFilter(array, callback){\n let newArray = []\n for(let i=0; i<array.length; i++){\n let bool = callback(array[i])\n //put a condition, if true,\n if(bool){\n newArray.push(array[i])\n }\n //then push the item into the array\n\n\n }\n return newArray\n}", "function peopleInTheIlluminati(arr) {\n const result = arr.filter(function(str) {\n if (peopleInTheIlluminati.member == true) {\n return arr;\n }});\n return result;\n}", "function destroyer(arr) {\n \n\tconst rest = Array.from(arguments);\n\tconst search = rest.shift(0);\n\t\n \tarr = search.filter(x => ! rest.includes(x));\n \treturn arr;\n}", "function filter(arr, callback){\n let newArr = [];\n for(let i=0; i<arr.length; i++){\n if(callback(arr[i],i,arr)){\n newArr.push(arr[i]);\n }\n }\n return newArr;\n}", "function filter(arr, fn) {\n let results = [];\n\n // iterate over the array\n // apply the function to that specific element\n // add it to my results array if it's true\n // or leave it out if it's false\n for (let element of arr) {\n let result = fn(element);\n\n if (result == true) {\n results.push(element);\n }\n }\n\n return results;\n}", "array_new_items(in_array, not_in) {\n let result = [];\n for (let i = 0; i < in_array.length; i++) {\n if (not_in.indexOf(in_array[i]) === -1) {\n result.push(in_array[i]);\n }\n }\n return result;\n }", "function filterInside(f, ll) { \n console.log(\"filtering\"); console.log(JSON.stringify(ll));\n return ll.map(function (l) { return l.filter(f); }); \n}", "mixedArrayFilter(array, checkFunc) {\n let filteredArray = [];\n\n array.forEach((item) => {\n // if have subItems filter subItems\n if (Array.isArray(item)) {\n let filteredSubItems = [];\n\n item.forEach((subDoc) => {\n if (checkFunc(subDoc)) filteredSubItems.push(subDoc);\n });\n\n // skip if have no subItems after filter\n filteredSubItems.length && filteredArray.push(filteredSubItems);\n } else {\n if (checkFunc(item)) filteredArray.push(item);\n }\n });\n\n return filteredArray;\n }", "function treatArray(raw_arr)\n{\n var arr;\narr=sortArray(raw_arr)\narr=filterArray(arr)\nreturn arr\n}", "function filter_array(test_array) {\n var index = -1,\n arr_length = test_array ? test_array.length : 0,\n resIndex = -1,\n result = [];\n while (++index < arr_length) {\n var value = test_array[index];\n\n if (value) {\n result[++resIndex] = value;\n }\n }\n return result;\n}", "function filterArr(arr, callback) {\n validationFunctions.validateParametersAndThrowError('The function expects 2 parameters: \\n 1. array \\n 2. callback function',\n !Array.isArray(arguments[0]), !validationFunctions.isFunction(arguments[1]));\n\n var resultArr = [];\n\n for (var i = 0; i < arr.length; i++) {\n if (callback(arr[i], i, arr)) {\n resultArr.push(arr[i]);\n }\n }\n\n return resultArr;\n}", "function filter(arr, testFunction) {\n var result = [];\n for (var i = 0; i < arr.length; ++i)\n var currentValue = arr[i];\n if (passesTest(currentValue)) {\n result.push(currentValue);\n }\n }", "function filterEven(arr) {\n\n let newArray = arr.filter((n) => {\n return n % 2 == 0;\n\n });\n return newArray;\n\n}", "function myFilter(array, callback){\n var arr = []\n array.forEach(element=>{\n if(callback(element)){\n arr.push(element);\n } \n });\n return arr;\n}", "afilter (callback) {\n return this.asArray().filter(callback)\n }", "function myFilter(array, callback) {\n var newArray = [];\n array.forEach(element => {\n if (callback(element)) {\n newArray.push(element);\n }\n });\n return newArray;\n}", "function filterExample(arr) {\n const even = (num) => {\n if (num % 2 == 0) {\n return num\n }\n };\n const odd = (num) => {\n if (num % 2 != 0) {\n return num\n }\n };\n console.log(arr.filter(even));\n console.log(arr.filter(odd));\n\n}", "function destroyer(arr) {\n let args = [];\n for (let i = 1; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n // console.log(args)\n return arr.filter(item => !args.includes(item));\n}", "function filter(array, test) {\n var passed = [];\n for (var i = 0; i < array.length; i++) {\n if (test(array[i])) {\n passed.push(array[i]);\n }\n }\n\n return passed;\n}", "function myFilter (arr, cond) {\n\t\tvar filteredArray = [];\n\t\tfunction filtered (element) {\n\t\t\tif (cond(element)) {\n\t\t\t\tfilteredArray.push(element);\n\t\t\t}\n\t\t}\n\t\tarr.forEach(filtered);\n\t\treturn filteredArray;\n\t}", "function customFilter (array, conditionalFunction) {\n let passed = []; // empty array where we gonna store our new values\n for (let i = 0; i < array.length; i++) { \n if (conditionalFunction(array[i])) { //here we use the boolean value of our callback function as our condition whether or not to add something to our new array.\n passed.push(array[i]);\n }\n }\n return passed;\n}", "function destroyer(arr) {\n var checkIn = [];\n for (var dummyIndex = 1; dummyIndex < arguments.length; dummyIndex++) \n checkIn.push(arguments[dummyIndex]);\n return arr.filter(function(x){return checkIn.indexOf(x) == -1});\n}", "function filter(array) {\n newArray = []\n array.forEach((number) => {\n if (number > 5) {\n newArray.push(number)\n }\n })\n return newArray;\n}", "function filterElement (a,p){\n\tvar filteredElement = a.filter(isEven);\n\treturn filteredElement; //should return the array [2, 4, 6, 8, 10]\n}", "function filteredArray(arr, elem) {\r\n let newArr = [];\r\n for (let i = 0; i < arr.length; i++) {\r\n arr[i].indexOf(elem) === -1 ? newArr.push(arr[i]) : true\r\n }\r\n return newArr;\r\n}", "function filter(arr,func){\n chain = [];\n for(i=0;i<arr.length;i++){\n func(arr[i]);\n }\n\n return chain; \n}", "function filterArray(arr) {\n let newArr = [];\n for (let i=0; i<arr.length; i++){\n if (arr[i]>=5){\n newArr.push(arr[i])\n }\n }\n return newArr;\n}", "function filter(array,func){\n\t\tif(array.filter){\n\t\t\treturn array.filter(func)\n\t\t}\n\t\tthrow new Error(\"Can only filter on arrays, not objects\");\n\t}", "function filter(arr, cb) {\n var newArr = [];\n for(var i =0; i < arr.length; i++) {\n cb(arr[i]);\n newArr.push(arr[i]);\n }\n return newArr;\n}", "function filter(array, func) {\n const newArr = [];\n for (let i = 0; i < array.length; i++) {\n func(array[i]) && newArr.push(func(array[i]));\n }\n return newArr;\n}", "function filter(arr, truth, callback) {\n async.reduce(arr, [], function(filtered, item, callback) {\n truth(item, function(err, isTrue) {\n callback(err, isTrue ? filtered.concat([item]) : filtered);\n });\n }, callback);\n}", "function filteredArray(arr, elem) {\n let newArr = [];\n for (let i = 0; i < arr.length; i++) {\n if (arr[i].indexOf(elem) === -1) {\n newArr.push(arr[i]);\n }\n }\n return newArr;\n}", "function filter(arr, fn) {\n let newArray = [];\n arr.forEach(function(word) {\n if (fn(word) === true) {\n newArray.push(word);\n }\n });\n // for (let i = 0; i < arr.length; i++) {\n // if (fn(arr[i]) === true) {\n // newArray.push(arr[i]);\n // }\n// }\n return newArray;\n}", "function diffArray(arr1, arr2) {\n var newArr = [];\n // Same, same; but different.\n newArr = arr1.concat(arr2);\n\n function isThereADouble(num) {\n // for(var i = 0; i < newArr.length; i++) {\n if(newArr.indexOf(num) === -1) {\n console.log(num);\n return num;\n // }\n }\n }\n \n filteredArr = newArr.filter(isThereADouble);\n \n \n return filteredArr;\n}", "function filterNot(a,p){\n\tvar filteredElement = a.filter(isEven);\n\treturn filteredElement; //should return the array [1, 3, 5, 7, 9]\n}", "function even(arr){\n\nnewArr = arr.filter((elem)=>{\n return elem % 2 === 0;\n })\n return newArr\n}", "function TestFilter(){\n\t\treturn function(arr, param1, param2){\n\t\t\tconsole.log(\"filter called\");\n\t\t\tif(param1){\n\t\t\t\tvar filtered = _.select(arr, function(item) {\n\t \t\t\t\treturn item.indexOf( param1 ) !== -1;\n\t\t\t\t});\t\n\n\t\t\t\treturn filtered;\n\t\t\t} else{\n\t\t\t\treturn arr;\n\t\t\t}\n\t\t};\n\t}", "function filterArr (node, array) {\n return array.filter((e) => {\n return e !== node;\n });\n }", "function destroyer(arr) {\n // Remove all the values\n var newArr = [];\n for(var i =1; i < arguments.length; i++) {\n newArr.push(arguments[i]);\n }\n return (arr.filter(el => newArr.indexOf(el) === -1 ));\n\n // return arr;\n}", "function destroyer(arr) {\n // Declaring arguments array (args) using the arguments object \n var args = Array.prototype.slice.call(arguments);\n // Copying array from args\n var newArray = args[0];\n // Iterating through args starting at second index (values to remove)\n for (var i = 1; i < args.length; i++){\n // Function for filter() - Return elements not equal to current element in args\n function someValue(element) {\n return element !== args[i]\n }\n // newArray with elements that are equal to current element in args - filtered out\n newArray = newArray.filter(someValue); \n } \n return newArray;\n }", "function destroyer(arr) {\n let array = Array.from(arguments).slice(1);\n return arr.filter(function(item){\n return !array.includes(item)\n });\n }", "static argFilter(arr, callbackfn, thisArg) {\n const indices = ArrayUtils.indexRange(arr.length);\n return indices.filter((value, index) => {\n return callbackfn.call(thisArg, arr[value], index);\n });\n }" ]
[ "0.7183751", "0.7170588", "0.7119997", "0.7082903", "0.6985113", "0.6933697", "0.69010913", "0.6897618", "0.68760496", "0.68737334", "0.6869783", "0.6863028", "0.6857912", "0.6829964", "0.6807575", "0.6746761", "0.67336583", "0.67217547", "0.6719153", "0.6706601", "0.66720474", "0.6622519", "0.66007376", "0.6598466", "0.65694153", "0.6568328", "0.65650505", "0.6542248", "0.6537931", "0.65365344", "0.65280855", "0.6508173", "0.6500173", "0.6498341", "0.6495215", "0.6490861", "0.64863247", "0.64855605", "0.64815056", "0.6479854", "0.6473555", "0.64588743", "0.6458123", "0.64414847", "0.6439533", "0.6436381", "0.6433474", "0.6424074", "0.6414359", "0.64042765", "0.64015555", "0.6389212", "0.63809323", "0.6369805", "0.6360849", "0.6360692", "0.63536495", "0.6345387", "0.63398033", "0.63322264", "0.63289875", "0.632883", "0.63212293", "0.63164634", "0.62908757", "0.6288844", "0.6283773", "0.62759465", "0.6271158", "0.626765", "0.6264108", "0.6260872", "0.6260318", "0.625091", "0.62486905", "0.62341547", "0.6233547", "0.6232568", "0.62235945", "0.6222352", "0.62190557", "0.6217832", "0.62090904", "0.6206386", "0.6195126", "0.61844665", "0.617487", "0.6171871", "0.61690694", "0.6156305", "0.6138024", "0.6135276", "0.61209714", "0.6118871", "0.61182714", "0.6113274", "0.61113054", "0.6108504", "0.6105408", "0.60965717", "0.6094528" ]
0.0
-1
this function is called final part of prepareToRender
set customFunctionWhenPrepareToRender(func) { this._customFunctionWhenPrepareToRender = func; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function render() {\n\t\t\t}", "function render() {\n\n\t\t\t}", "afterRender() { }", "afterRender() { }", "postRender()\n {\n super.postRender();\n }", "_firstRendered() { }", "onBeforeRendering() {}", "static rendered () {}", "static rendered () {}", "_render() {}", "handleRendered_() {\n\t\tthis.isRendered_ = true;\n\t}", "_afterRender () {\n this.adjust();\n }", "_requestRender() { this._invalidateProperties(); }", "function render() {\n\t\t\n\t}", "onAfterRendering() {}", "onRender()/*: void*/ {\n this.render();\n }", "function render() {\n\t}", "onRender () {\n\n }", "renderPrep() {\n }", "function handleRender() {\n\t view._isRendered = true;\n\t triggerDOMRefresh();\n\t }", "render() {\n // Subclasses should override\n }", "render() {\n\n\t}", "render() {\n\n\t}", "function init() { render(this); }", "function handleRender() {\n view._isRendered = true;\n triggerDOMRefresh();\n }", "function handleRender() {\n view._isRendered = true;\n triggerDOMRefresh();\n }", "onBeforeRender () {\n\n }", "beforeRender() { }", "function render() {\n\n isRendered = true;\n\n renderSource();\n\n }", "function render() {\n\n\t\t\tisRendered = true;\n\n\t\t\trenderSource();\n\n\t\t}", "render(){if(this.renderer){this.renderer.call(this.owner,this.content,this.owner,this.model)}}", "_didRender(_props, _changedProps, _prevProps) { }", "function resumeRender() {\n shouldRender = true;\n render();\n }", "function createRender() {\n\t\t\tsetSendIconYellow();\n }", "function render() {\r\n\r\n}", "function render() {\r\n\r\n}", "function Render() {\n ClearScreen();\n RenderEnergeticDroplets();\n ResetRenderingConditions();\n}", "function pauseRender() {\n shouldRender = false;\n }", "render() {}", "render() {}", "render() {}", "render( ) {\n return null;\n }", "onRender() {\n super.onRender();\n this.clearList();\n this.renderList();\n }", "render() { return super.render(); }", "render(){\r\n\r\n\t}", "render() {\n\t\treturn null;\n\t}", "finalizeInit() {\n if (this.insertBefore || this.appendTo || this.insertFirst) {\n this.render();\n }\n }", "render() { }", "_endRender() {\n this._allowRegisterSegment = false;\n }", "render() {\n this.notify('initial-load', {});\n /**\n * Used to load context menu\n */\n this.trigger('load');\n this.notify('initial-end', {});\n this.renderElements();\n this.renderComplete();\n }", "render() {\n this.notify('initial-load', {});\n /**\n * Used to load context menu\n */\n this.trigger('load');\n this.notify('initial-end', {});\n this.renderElements();\n this.renderComplete();\n }", "render() {\n this.notify('initial-load', {});\n /**\n * Used to load context menu\n */\n this.trigger('load');\n this.notify('initial-end', {});\n this.renderElements();\n this.renderComplete();\n }", "ready() {\n super.ready();\n\n afterNextRender(this, function() {});\n }", "ready() {\n super.ready();\n\n afterNextRender(this, function() {});\n }", "ready() {\n super.ready();\n\n afterNextRender(this, function() {});\n }", "finalizeInit() {\n if (this.insertBefore || this.appendTo || this.insertFirst || this.adopt) {\n this.render();\n }\n }", "function render() {\n for (let i = 0; i < storedCreatedObj.length; i++) {\n storedCreatedObj[i].render_for_body();\n }\n storedCreatedObj[0].render_for_head();\n storedCreatedObj[0].render_for_foot();\n}", "render() {\n return super.render();\n }", "render() {\n return super.render();\n }", "render() {\n return super.render();\n }", "function onBeforeInit() {\n \t\tvar i,\n item,\n objects = [kendoLayouts, kendoViews],\n htmlBuffer = [];\n\n \t\tfor (i=0; i<objects.length; i++) {\n \t\t\tfor (item in objects[i]) {\n \t\t\t\tif (objects[i].hasOwnProperty(item) && objects[i][item].hasOwnProperty('html')) {\n \t\t\t\t\thtmlBuffer.push(objects[i][item].html);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n\n \t\t$(document.body).prepend(htmlBuffer.join(''));\n \t}", "renderContent() {\n return null;\n }", "function RenderEvent() {}", "render(){}", "render(){}", "render() {\n const self = this;\n const data = self.get('data');\n if (!data) {\n throw new Error('data must be defined first');\n }\n self.clear();\n self.emit('beforerender');\n self.refreshLayout(this.get('fitView'));\n self.emit('afterrender');\n }", "_render() {\n\t\tthis.tracker.replaceSelectedMeasures();\n }", "onRender()\n {\n this._initializeSettingsDisplay();\n }", "prepare() {\n super.prepare()\n }", "function doSomethingAfterRendering(){\n displayLoading() // 로딩화면 보여주기\n fetchServer(); // 서버에서 데이터 가져오기\n }", "static preRender() {\n $(\".ship-inventory-content > div > div\").first().empty();\n $(\"#config-\" + equipment.config + \" > div.\" + equipment.display + \"-equipment-container > .\" + equipment.display + \"-equipment-slots\").empty();\n $(\"#config-\" + equipment.config + \" > .\" + equipment.display + \"-equipment-container > div > div\").first().empty();\n }", "afterRender() {\n\t\t\treturn this;\n\t\t}", "willClearRender() {\n\t\tconsole.log('willClearRender ejecutado!');\n\t}", "render() {\n return null;\n }", "render() {\n return null;\n }", "render() {\n const anomaliesFilters = this.anomalyFilterModel.getAnomaliesFilters();\n const anomaly_filters_compiled = this.anomaly_filters_template_compiled({ anomaliesFilters });\n $('#anomaly-filters-place-holder').children().remove();\n $('#anomaly-filters-place-holder').html(anomaly_filters_compiled);\n\n this.setupFilterListener();\n this.checkSelectedFilters();\n\n }", "_startRender() {\n this._allowRegisterSegment = true;\n }", "postRendering() {\n this.ctx.restore();\n }", "function _prepareText() {\n\t\tpreloader = null;\n\t\trefreshItem();\n\t}", "function lateRender() {\n\t\tsetTimeout(function() { // IE7 needs this so dimensions are calculated correctly\n\t\t\tif (!currentView.start && bodyVisible()) { // !currentView.start makes sure this never happens more than once\n\t\t\t\trenderView();\n\t\t\t}\n\t\t},0);\n\t}", "function lateRender() {\n\t\tsetTimeout(function() { // IE7 needs this so dimensions are calculated correctly\n\t\t\tif (!currentView.start && bodyVisible()) { // !currentView.start makes sure this never happens more than once\n\t\t\t\trenderView();\n\t\t\t}\n\t\t},0);\n\t}", "function lateRender() {\n\t\tsetTimeout(function() { // IE7 needs this so dimensions are calculated correctly\n\t\t\tif (!currentView.start && bodyVisible()) { // !currentView.start makes sure this never happens more than once\n\t\t\t\trenderView();\n\t\t\t}\n\t\t},0);\n\t}", "function lateRender() {\n\t\tsetTimeout(function() { // IE7 needs this so dimensions are calculated correctly\n\t\t\tif (!currentView.start && bodyVisible()) { // !currentView.start makes sure this never happens more than once\n\t\t\t\trenderView();\n\t\t\t}\n\t\t},0);\n\t}", "function lateRender() {\n\t\tsetTimeout(function() { // IE7 needs this so dimensions are calculated correctly\n\t\t\tif (!currentView.start && bodyVisible()) { // !currentView.start makes sure this never happens more than once\n\t\t\t\trenderView();\n\t\t\t}\n\t\t},0);\n\t}", "renderSetup() {\n\t\tthis.calculateMousePosition()\n\t\tthis.isReachable = this.isWithinReach()\n\t\tif (this.isReachable && !this.wasReachable) {\n\t\t\trenderQueue.add(this.renderOutline)\n\t\t} else if (!this.isReachable && this.wasReachable) {\n\t\t\trenderQueue.delete(this.renderOutline)\n\t\t\trenderQueue.add(this.destroyOutline)\n\t\t}\n\t\tthis.wasReachable = this.isReachable\n\t}", "render() {\n\t\tthis.a1.render(this.context);\n\t\tthis.b1.render(this.context);\n\t\tthis.c1.render(this.context);\n\t\tthis.c2.render(this.context);\n\t\tthis.d1.render(this.context);\n\t\tthis.e1.render(this.context);\n\t\tthis.f1.render(this.context);\n\t\tthis.g1.render(this.context);\n\t\tthis.a1s.render(this.context);\n\t\tthis.c1s.render(this.context);\n\t\tthis.d1s.render(this.context);\n\t\tthis.f1s.render(this.context);\n\t\tthis.g1s.render(this.context);\n\n\t}", "function lateRender() {\n\t\tsetTimeout( function() { // IE7 needs this so dimensions are calculated correctly\n\t\t\t\t\tif (!currentView.start && bodyVisible()) { // !currentView.start makes sure this never happens more than once\n\t\t\t\t\t\trenderView();\n\t\t\t\t\t}\n\t\t\t\t}, 0);\n\t}", "rendered() {\n\t\t\t\tthis.hasStorePropsChanged_ = false;\n\t\t\t\tthis.hasOwnPropsChanged_ = false;\n\t\t\t}", "render() {\n }", "_renderResponse() {\n return null;\n }", "postRenderSetup() {\n this.el.querySelectorAll('a.addBoxerLink').forEach((link) => {\n link.onclick = () => {\n this.callbacks.closeSidebar();\n this.callbacks.createNewFighter(link.id);\n }\n });\n\n this.el.querySelector('#directoryReport').onclick = () => {\n this.callbacks.closeSidebar();\n this.callbacks.directoryReport();\n };\n\n this.el.querySelector('#assessmentReport').onclick = () => {\n this.callbacks.closeSidebar();\n this.callbacks.assessmentReport();\n }\n }", "onRender() {\n if ( !this.mRunning )\n return;\n\n if ( SPE_USES_PREVIEW_IMAGE ) {\n document.querySelector( '.spline-preview-image-container' ).style.display = 'none';\n\n SPE_USES_PREVIEW_IMAGE = false;\n }\n\n if ( this.mPlayHandler && !this.mPlayHandler.isEnable ) {\n this.mPlayHandler.activate();\n }\n\n if ( this.mOrbitControls ) {\n this.mOrbitControls.update();\n }\n if ( this.mScene && this.mMainCamera ) {\n this.mRenderer.autoClear = true;\n this.mRenderer.render( this.mScene, this.mMainCamera );\n }\n }", "render() {\n\n }", "function render() {\n let bigString;\n console.log('render fxn ran')\n if (store.view === 'landing') {\n bigString = generateTitleTemplate(store);\n\n }\n else if (store.view === 'question') {\n bigString = generateQuestionTemplate(store);\n\n }\n else if (store.view === 'feedback') {\n bigString = generateFeedbackTemplate(store)\n\n }\n else if (store.view === 'results') {\n bigString = generateResultsTemplate(store);\n\n }\n $('main').html(bigString);\n\n //attach event listeners\n\n\n}", "render() {\r\n return;\r\n }", "didRender() {\n console.log('didRender ejecutado!');\n }", "handleRenderCompletion() {\n this.renderNewChildren = false;\n this.preventUpdate = false;\n this.lastChildIndex = this.childCount;\n if (this.isRenderingNew) {\n this.isRenderingNew = false;\n this.update(null, false, true); // Prevent from triggering an item request to avoid infinite loop of loading.\n } else if (this.contentNode && InfiniteUtils.shouldTriggerItemRequest(InfiniteUtils.getContentData(this.contentNode))) {\n this.triggerItemRequest();\n }\n }", "compile() {\n const drawHash = this._makeDrawHash();\n if (this._state.drawHash !== drawHash) {\n this._state.drawHash = drawHash;\n this._putDrawRenderers();\n this._drawRenderer = DrawRenderer.get(this);\n // this._shadowRenderer = ShadowRenderer.get(this);\n this._emphasisFillRenderer = EmphasisFillRenderer.get(this);\n this._emphasisEdgesRenderer = EmphasisEdgesRenderer.get(this);\n }\n const pickHash = this._makePickHash();\n if (this._state.pickHash !== pickHash) {\n this._state.pickHash = pickHash;\n this._putPickRenderers();\n this._pickMeshRenderer = PickMeshRenderer.get(this);\n }\n const occlusionHash = this._makeOcclusionHash();\n if (this._state.occlusionHash !== occlusionHash) {\n this._state.occlusionHash = occlusionHash;\n this._putOcclusionRenderer();\n this._occlusionRenderer = OcclusionRenderer.get(this);\n }\n }", "_initRenderer(){\n // paginate control, only if configured\n this.enhancedConfig.onceReady(function(){\n if(!this.enhancedConfig.getData().selectSingleNode(\"/*/far:Layout//far:Paginate\")){\n return; // no pagination enabled\n }\n var totalRowsCountProvider = this.farModel._getTotalRowsCountProvider();\n var paginationControl = new bcdui.core.Renderer({\n targetHtml : this.options.targetHtml.find(\".bcd-far-paginate\"),\n chain : bcdui.contextPath + \"/bcdui/js/component/far/pagination.xslt\",\n inputModel : this.enhancedConfig,\n parameters : {\n enhancedConfigModelId : this.enhancedConfig.id,\n farModel : this.farModel,\n totalRowCountModel : totalRowsCountProvider\n }\n });\n // update pagination panel when total rows data provider changes\n totalRowsCountProvider.onChange(paginationControl.execute.bind(paginationControl));\n }.bind(this));\n\n // htmlBuilder on Wrs\n var gridRendering = new bcdui.core.Renderer({\n targetHtml : this.gridRenderingTarget,\n chain : this.options.renderingChain || [\n bcdui.contextPath + \"/bcdui/xslt/wrs/paginate.xslt\", // apply far:Paginate\n bcdui.contextPath + \"/bcdui/xslt/renderer/htmlBuilder.xslt\" // final rendering of Wrs\n ], // renderingChain = internal API\n inputModel : this.farModel,\n parameters : {\n sortCols : false,\n sortRows : false,\n makeRowSpan : false,\n paramModel : this.enhancedConfig\n }\n });\n gridRendering.onReady(function(){\n this.gridRenderingTarget.trigger( this.events.rendered );\n }.bind(this));\n\n // trigger rendering everytime UI pagination updates $config/xp:Paginate\n this.enhancedConfig.onChange(gridRendering.execute.bind(gridRendering), \"/*/xp:Paginate\");\n }", "render() {\n this._addChooserHandler();\n this._addLoggerListeners();\n this._addButtonHandler();\n }", "function general_render(obj) {\n obj.render();\n }" ]
[ "0.7278723", "0.7275558", "0.7259879", "0.7259879", "0.7181207", "0.7065279", "0.6924316", "0.6882285", "0.6882285", "0.68550706", "0.6839958", "0.6831122", "0.68241054", "0.6789302", "0.6765992", "0.67061645", "0.6647756", "0.659764", "0.6563315", "0.6540208", "0.6515079", "0.65078914", "0.65078914", "0.6500113", "0.64760494", "0.64760494", "0.6475389", "0.64556074", "0.6436238", "0.64179623", "0.64069086", "0.6377728", "0.637722", "0.6374461", "0.6352093", "0.6352093", "0.6329859", "0.6322307", "0.6308809", "0.6308809", "0.6308809", "0.6303351", "0.62963015", "0.62898", "0.62801486", "0.6257416", "0.62527996", "0.622345", "0.6204724", "0.6176441", "0.6176441", "0.6176441", "0.6156768", "0.6156768", "0.6156768", "0.6151235", "0.6148492", "0.6119202", "0.6110622", "0.6110622", "0.61051184", "0.6100761", "0.60976094", "0.6076433", "0.6076433", "0.60654074", "0.60585165", "0.6051534", "0.6045169", "0.6040481", "0.60348547", "0.6032615", "0.6020897", "0.6010372", "0.6010372", "0.59995407", "0.59808224", "0.5977344", "0.5950376", "0.5949396", "0.5949396", "0.5949396", "0.5949396", "0.5949396", "0.593599", "0.5935408", "0.5926746", "0.5909585", "0.5907175", "0.5895129", "0.5890878", "0.5890357", "0.58804226", "0.5877954", "0.5876777", "0.58734834", "0.58591783", "0.58560044", "0.58554304", "0.5849903", "0.58486974" ]
0.0
-1
end of render() method Valida el password ingresado
validarPassword() { if (!this.validador.validarPassword(this.state.password)) { // TO DO: mecanismo para informar qué Alert.alert('Error', `La contraseña debe tener al menos ${this.validador.passwordMinLength} caracteres.`); return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validate_password()\n {\n const icon = DOM.new_password_validation_icon;\n const password = DOM.new_password_input.value;\n\n icon.style.visibility = \"visible\";\n\n if (security.is_valid_password(password))\n {\n icon.src = \"/icons/main/correct_white.svg\";\n return true;\n }\n else\n {\n icon.src = \"/icons/main/incorrect_white.svg\";\n return false;\n }\n }", "function validPassword(){\n // Se declara la variable del password\n var password = $('#password_id').val();\n // comprueba que la extensión del password sea de 8 caracteres\n if (password.length < 8) {\n // si no se cumple la condicion manda el error\n var lenght_error = \"El password debe contener al menos 8 caracteres\"\n $(\"#display_psw_error\").append(lenght_error);\n }\n // comprueba que contenga mayusculas \n if (password.match(/[A-Z]/) == null){\n var caps_error = \"El password debe contener al menos una mayuscula\"\n $(\"#display_caps_error\").append(caps_error);\n }\n // comprueba que contenga al menos un dígito\n if (password.match(/\\d/) == null){\n var num_error = \"El password debe contener al menos un carácter numérico\"\n $(\"#display_num_error\").append(num_error);\n }\n}", "function handlePassword() {\n let value = this.value;\n if (value.length >= 3 && value.length <= 15) {\n displayValidField(\"passwordGroup\");\n theForm.passwordValid = true;\n checkForm();\n } else {\n displayInvalidField(\"passwordGroup\");\n theForm.passwordValid = false;\n checkForm();\n }\n let g = document.getElementById(\"errorPassword\")\n g.parentNode.removeChild(g)\n }", "processPassRep() {\n if (this.password.value !== this.passwordRepeat.value) {\n this.passwordRepeat.err = true;\n this.passwordRepeatErr.seen = true;\n this.valid = false;\n this.passwordRepeatErr.text = \"رمز عبور و تکرار آن یکسان نیستند\";\n } else {\n this.passwordRepeat.err = false;\n this.passwordRepeatErr.seen = false;\n }\n }", "validatePassword() {\n const len = this.state.password.length;\n if (len>8) {\n return 'success';\n }\n else if(len>0) {\n return \"error\";\n }\n }", "function uPassword() {\n\t\tvar u_pass = $('#user_pass').val();\n\t\tvar pass_pattern = /^[a-zA-Z0-9]+$/;\n\t\tvar pass_len = u_pass.length;\n\n\t\tif (u_pass == '') {\n\t\t\t$('#alert_pass').text('this field cannot be empty');\n\t\t\tsetTimeout(function () {\n\t\t\t\t$('#alert_pass').text('');\n\t\t\t}, 7000);\n\t\t\treturn false;\n\t\t} else if (pass_len < 8 || pass_len > 15 || !u_pass.match(pass_pattern)) {\n\t\t\t$('#alert_pass').text('please enter password between 8-15 alphanumeric characters');\n\t\t\tsetTimeout(function () {\n\t\t\t\t$('#alert_pass').text('');\n\t\t\t}, 7000);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function checkPassword() {\n if (this.value.length >= 8) {\n setAccepted('password-validated');\n } else {\n setUnaccepted('password-validated');\n }\n}", "function ValidatePassword() {\n \n var rules = [{\n Pattern: \"[A-Z]\",\n Target: \"UpperCase\"\n },\n {\n Pattern: \"[a-z]\",\n Target: \"LowerCase\"\n },\n {\n Pattern: \"[0-9]\",\n Target: \"Numbers\"\n },\n {\n Pattern: \"[!@@#$%^&*_]\",\n Target: \"Symbols\"\n }];\n\n \n var password = $(\"#password\").val();\n \n //Checks if the lenght of the password is atleast 7 characters. \n $(\"#passwordLength\").removeClass(password.length > 6 ? \"passwordValidationFalseColor\" : \"passwordValidationTrueColor\");\n $(\"#passwordLength\").addClass(password.length > 6 ? \"passwordValidationTrueColor\" : \"passwordValidationFalseColor\");\n \n\n //Checks for the others rules as states above and displays the color (red for unfulfilled conditons and green for fulfilled) accordingly. \n for (var i = 0; i < rules.length; i++) {\n $(\"#\" + rules[i].Target).removeClass(new RegExp(rules[i].Pattern).test(password) ? \"passwordValidationFalseColor\" : \"passwordValidationTrueColor\"); \n $(\"#\" + rules[i].Target).addClass(new RegExp(rules[i].Pattern).test(password) ? \"passwordValidationTrueColor\" : \"passwordValidationFalseColor\");\n }\n }", "function validatePass() {\n\tvar message = \"\";\n\tvar password = document.getElementById(\"tPass\").value;\n\tdocument.getElementById(\"tPass\").style.border = \"1px solid #0000ff\";\n\tmessage = message == \"\" ? isEmpty( password ) : message;\n\tmessage = message == \"\" ? isGTMinlength( password, 8 ) : message;\n\tmessage = message == \"\" ? isLTMaxlength( password, 15 ) : message;\n\tif( message == \"\" ) {\n\t\tif( password.search(/^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{8,15}$/) < 0 ) {\n\t\t\tmessage = \"The password must include at least one upper case letter, one lower case letter and one numeric digit.\";\n\t\t}\n\t}\n\tdocument.getElementById(\"pPass\").innerHTML = message;\n\treturn styleInput(\"tPass\", message);\n}", "function validatePassword(password) {\n\t// validate password\n}", "function checkPassword() {\n var passwordLength = $modalPass.val().length;\n if (passwordLength < 8) {\n $passwordError.html(\"Must be at least 8 Characters\");\n $passwordError.show();\n $modalPass.css(\"border-bottom\",\"2px solid #F90A0A\");\n passwordError = true;\n } else {\n $passwordError.hide();\n $modalPass.css(\"border-bottom\",\"2px solid #34F458\");\n }\n }", "function passPatternValid() {\n var errors = document.querySelector(\"#errors\");\n var pass = document.querySelector(\"#pass\").value;\n var password = document.querySelector(\"#secondPass\").value;\n if(pass !== password) {\n errorMessage(\"<p>Please enter a valid Password with 8 to 16 characters one upper case letter and one number!</p>\");\n return false;\n }\n return true;\n }", "function isValidPassword(password) {\n\n\n}", "function passwordChecker() {\n password_value = password.value;\n\n if (password_value.length < 8) {\n errorMessage.innerText = \"Password is too short\";\n register.setAttribute(\"disabled\", \"disabled\");\n } else {\n if (password_value.match(/\\d/) === null) {\n errorMessage.innerText = \"Password must contain at least one number.\";\n register.setAttribute(\"disabled\", \"disabled\");\n } else {\n if (password_value.match(/[#%\\-@_&*!]/)) {\n errorMessage.innerText = \"\";\n passwordCompare();\n } else {\n errorMessage.innerText = \"Password must contain at least one special character: #%-@_&*!\";\n register.setAttribute(\"disabled\", \"disabled\");\n }\n\n }\n }\n}", "function validatePasswordInput() {\n let typedPassword = document.querySelector(\n \".confirmModifications_form-password input\"\n ).value;\n if (userObject.password == typedPassword) {\n // If there is a match the user is updated in the website\n\n populateUserInfo(userObject);\n\n // The user is updated in the database\n\n put(userObject);\n document.querySelector(\".modal-confirm\").style.display = \"block\";\n closeConfirmModifications();\n } else {\n document.querySelector(\n \".confirmModifications_paragraph-alertWrongPass\"\n ).style.display = \"block\";\n }\n}", "function checkPassword(target) {\n // let regPattern = /^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d]{8,}$/;\n let regPattern = /^[^åäöÅÄÖ]{6,100}$/\n let validDiv = target.parentNode.querySelector('.validLösenord')\n let invalidDiv = target.parentNode.querySelector('.invalidLösenord')\n let password = target.value\n let input = target\n\n if (password == '') {\n $(validDiv).hide()\n $(invalidDiv).text('Lösenord krävs')\n $(validDiv).text('')\n $(invalidDiv).show()\n $(input).addClass('is-invalid').removeClass('is-valid')\n return false\n } else if (!regPattern.test(password)) {\n $(validDiv).hide()\n $(invalidDiv).text(\n 'Lösenordet ska innehålla minst 6 tecken och får inte innehålla Å,Ä,Ö.'\n )\n $(validDiv).text('')\n $(invalidDiv).show()\n $(input).addClass('is-invalid').removeClass('is-valid')\n return false\n } else if (target.id == 'validationCustom041' && checkRepeatPassword()) {\n $(validDiv).hide()\n $(invalidDiv).text('Måste vara samma lösenord')\n $(validDiv).text('')\n $(invalidDiv).show()\n $(input).addClass('is-invalid').removeClass('is-valid')\n return false\n } else {\n $(invalidDiv).hide()\n $(validDiv).text('Giltig')\n $(validDiv).show()\n $(input).removeClass('is-invalid').addClass('is-valid')\n return true\n }\n}", "function validiraj_pass(){\n\n var pattern = /^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d]{6,}$/;\n var tekst = document.getElementById(\"forma\").pass_input.value;\n var test = tekst.match(pattern);\n\n if (test == null) {\n document.getElementById(\"pass_error\").classList.remove(\"hidden\");\n valid_test = false;\n } else{\n console.log(\"validiran pass\");\n document.getElementById(\"pass_error\").classList.add(\"hidden\");\n }\n }", "isValidPassword (password) {\n // don't use plaintext passwords in production\n return password === this.password;\n }", "validate(value) {\n if (value.toLowerCase().includes(\"password\")) {\n // biar gak asal input password jadi password\n throw Error(\"Your password is invalid!\");\n }\n }", "function check_inputPassword() {\n\tvar text_password = $(\"#password\").val();\n\tvar show_err_password = $(\"#err_password\");\n\n\tif (text_password.length < 8 || text_password.length > 30) {\n\t\tshow_err_password.html(\"Pass in 8-30 character\");\n\t\treturn false;\n\t}\n\n\tshow_err_password.css({\"color\": \"green\"});\n\tshow_err_password.html(\"OK\");\n\treturn true;\n}", "function passwordOnChange() {\n const pattern = \"^[a-zA-Z0-9_-]{6,20}$\";\n validate(this, pattern);\n}", "function rightPassword(){\r\n if(password.value.match(/^(?=.*\\d)[0-9a-zA-Z]{8,}$/)){\r\n password.setCustomValidity('');\r\n }else{\r\n password.setCustomValidity('The password must be at least 8 character from (a-z), (A-Z) or(0-9)');\r\n }\r\n}", "function checkPassword() {\r\n const pass = password.value.trim();\r\n\r\n if (pass === '') {\r\n isValid &= false;\r\n\r\n setErrorFor(password, 'Password cannot be empty')\r\n return;\r\n }\r\n\r\n isValid &= true;\r\n}", "function password() {\n var errors = document.querySelector(\"#errors\");\n var password = document.querySelectorAll(\"#pass\");\n var pass = password.value.trim();\n var patt = /^(?=.*[a-z])(?=.*\\d){8,16}$/ig;\n if(!patt.test(pass)) {\n return false;\n }\n else {\n return true;\n }\n}", "isValidPassword(text) {\n // if (text.match(PASSWORD_REGEX)) {\n this.props.isPasswordValid(1); //always valid\n // } else {\n // this.props.isPasswordValid(2);\n // }\n }", "validPassword(passwordTyped) {\n return bcrypt.compareSync(passwordTyped, this.password) //returns a boolean o see if password type into the form matches the hashed password in the databaed\n }", "function validatePassword() {\n\n // empty array for the final if statement to check\n var errors = [];\n\n if (confirmLowerCase === true) {\n if (finalPass.search(/[a-z]/) < 0) {\n errors.push(\"lower\");\n }\n }\n if (confirmUpperCase === true) {\n if (finalPass.search(/[A-Z]/) < 0) {\n errors.push(\"upper\");\n }\n }\n if (confirmNumeric === true) {\n if (finalPass.search(/[0-9]/i) < 0) {\n errors.push(\"numeric\");\n }\n }\n if (confirmSpecialChar === true) {\n if (finalPass.search(/[!?@#$%^&*]/i) < 0) {\n errors.push(\"specialchar\");\n }\n }\n // if error array has contents, clear password string and regenerate password\n if (errors.length > 0) {\n finalPass = \"\"\n return passwordGen();\n }\n }", "function passwordValidation(){\n return password.value.match(passwordReg);\n}", "function validatePassword() {\n var valid = false;\n var pwdInput = document.getElementById(\"inputPassword\");\n var pwdPattern = /^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*])/; //.{8,20}$/\n var pwdError = document.getElementById(\"msg_pwd\");\n if(pwdInput.value == \"\") {\n pwdError.textContent = \"Password is required\";\n }\n else if(!pwdInput.value.match(pwdPattern)) {\n pwdError.textContent = \"Password must be 8-20 characters and contain at least one lowercase letter, one uppercase letter, one number, and one special character\";\n }\n else if(pwdInput.value.length < 8 || pwdInput.value.length > 20) {\n pwdError.textContent = \"Password must be 8-20 characters\";\n }\n else {\n pwdError.textContent = \"\";\n valid = true;\n }\n return valid;\n}", "checkPasswordButtonTyped() {\n if (this.state.password.length < 1) {\n Toast.show('Mot de passe indéfini', Toast.LONG);\n }\n else {\n return true;\n }\n }", "function passwordValid() {\n if (this.state.password.length === 0) {\n this.noPasswordEntered();\n return false;\n }\n else if (this.state.password !== this.state.confirmpassword) {\n this.nonSamePassword();\n return false;\n }\n else {\n this.samePassword();\n }\n\n return true;\n }", "function isPassword() {\r\n\tvar pwd = document.getElementById(\"password\");\r\n\tvar result = document.getElementById(\"pwd-error\");\r\n\tresult.innerHTML = \"\";\r\n\tif(pwd.value === \"\") {\r\n\t\tresult.innerHTML = \"Please input your password\";\r\n\t\treturn false;\r\n\t}\r\n\tif(pwd.value.length< 8) {\r\n\t\tresult.innerHTML = \"Password length min 8 letter\";\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "function validateBlurPasswordText() {\n\n if (passwordInput.value === \"\" || passwordInput.value === null) {\n infoDivPassword.style.display = \"block\"\n infoDivPassword.style.color = \"red\"\n infoDivPassword.innerText = \"Password field is empty\"\n return;\n }\n if (passwordInput.value.search(/[a-z]/) < 0) {\n infoDivPassword.style.display = \"block\"\n infoDivPassword.style.color = \"red\"\n infoDivPassword.innerText = \"Password must contain at least one lowercase letter\"\n return;\n }\n if (passwordInput.value.search(/[A-Z]/) < 0) {\n infoDivPassword.style.display = \"block\"\n infoDivPassword.style.color = \"red\"\n infoDivPassword.innerText = \"Password must contain at least one uppercase letter\"\n return;\n }\n if (passwordInput.value.search(/[0-9]/) < 0) {\n infoDivPassword.style.display = \"block\"\n infoDivPassword.style.color = \"red\"\n infoDivPassword.innerText = \"Password must contain at least one number \"\n return;\n }\n if (passwordInput.value.length < 8) {\n infoDivPassword.style.display = \"block\"\n infoDivPassword.style.color = \"red\"\n infoDivPassword.innerText = \"Password must have at least 8 characters\"\n return;\n }\n}", "checkPassword(){\n if(this.state.password.length <= 0){\n return (\n <div>\n <p className=\"warningText\">Please enter a password</p>\n </div>)\n }\n }", "validatePassword () {\n\t\tif (!this.attributes.password) { return; }\n\t\tlet error = this.userValidator.validatePassword(this.attributes.password);\n\t\tif (error) {\n\t\t\treturn { password: error };\n\t\t}\n\t}", "function checkPassword() {\n\t\tvar psw=document.sform.psw.value;\n\t\tvar pattern=/[~`!#$%\\^&*+=\\-\\[\\]\\\\';,/{}|\\\\\":<>\\?]/;\n\t\tif (psw.length<8) {\n\t\t\talert (\"Password should be at least 8 characters.\");\n\t\t\tdocument.sform.psw.value=\"\";\n\t\t\tdocument.sform.psw.focus();\n\t\t\treturn false;\n\t\t}else if (pattern.test(psw)) {\n\t\t\talert (\"No special characters are allowed in password.\");\n\t\t\tdocument.sform.psw.value=\"\";\n\t\t\tdocument.sform.psw.focus();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function checkPass() {\n if (getPass().length > 0) {\n if ((getPass()[0] >= \"a\" && getPass()[0] <= \"z\") || (getPass()[0] >= \"A\" && getPass()[0] <= \"Z\"))/*if the first char letter and not num*/ {\n if (isLetterOrNum(getPass())) {\n if (getPass().length >= 6)/*password at least 6 chars*/ {\n document.ePass.uPass.style.borderColor = \"green\";\n document.getElementById(\"errPass\").style.display = \"none\";\n return true;\n } else {\n document.ePass.uPass.style.borderColor = \"red\";\n document.getElementById(\"errPass\").innerHTML = \"Password have to be at least 6 chars. Left: \" + (6 - getPass().length);\n document.getElementById(\"errPass\").style.display = \"block\";\n return false;\n }\n } else {\n document.ePass.uPass.style.borderColor = \"red\";\n document.getElementById(\"errPass\").innerHTML = \"Only letters or nums\";\n document.getElementById(\"errPass\").style.display = \"block\";\n return false;\n }\n } else {\n document.ePass.uPass.style.borderColor = \"red\";\n document.getElementById(\"errPass\").innerHTML = \"First char have to be letter\";\n document.getElementById(\"errPass\").style.display = \"block\";\n return false;\n }\n } else {\n document.ePass.uPass.style.borderColor = \"grey\";\n document.getElementById(\"errPass\").style.display = \"none\";\n return false;\n }\n}", "function validatePassword() {\n\n //regex to determine minimum 8 character at least one letter one number in string\n var regex = /^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d]{8,}$/;\n\n if (password.value != confirm_password.value) {\n confirm_password.setCustomValidity(\"Passwords Don't Match\");\n } else if (!regex.test(password.value)) {\n confirm_password.setCustomValidity(\"Password be at least 8 characters long and contain at least one numeric character\")\n }\n else {\n confirm_password.setCustomValidity('');\n }\n}", "function _checkPass(p) \r{\r\tvar error = \"\";\r\t\r\t// Contraseña con menos de 6 carácteres\r\tif (p.length < 6) \r\t{\r\t\tdocument.getElementById(\"p0label\").className = \"error\";\r\t\terror = \"<b>At least 6 characters</b>\";\r\t}\r\telse \r\t{\r\t\t// Contraseña con mas de 15 carácteres\r\t\tif (p.length > 15) \r\t\t{\r\t\t\tdocument.getElementById(\"p0label\").className = \"error\";\r\t\t\terror = \"<b>Less than 15 characters.</b>\";\r\t\t}\r\t\telse \r\t\t{\r\t\t\t// Contraseña con carácteres inválidos. Se admiten los mismo\r\t\t\t// carácteres que en el usuario\r\t\t\treg = /^[A-Za-z0-9_\\-]*$/;\r\r\t\t\tif (!reg.test(p)) \r\t\t\t{\r\t\t\t\tdocument.getElementById(\"p0label\").className = \"error\";\r\t\t\t\terror = \"<b>Invalid character</b>\";\r\t\t\t}\r\t\t}\r\t}\r\r\treturn error;\r}", "validateVPassword() {\n if (this.state.password && this.state.vpassword === this.state.password) {\n return 'success';\n }\n else if(this.state.vpassword) {\n return \"error\";\n }\n }", "function isPasswordValid(){\n message.textContent =\"\";\n if (isNaN(parseInt(length.value))){\n message.textContent += \"Password Length is not a number! \";\n message.setAttribute(\"style\", \"background-color: red; color: white;\");\n return false;\n }\n else if (parseInt(length.value) < 8 || parseInt(length.value) > 128){\n message.textContent += \"Length should be within 8 - 128! \";\n message.setAttribute(\"style\", \"background-color: red; color: white;\");\n return false;\n }\n \n let x = (lowCaps.checked + uppCaps.checked + numCaps.checked + spcCaps.checked);\n if (x === 0){\n message.textContent += \"You need at least one character type! \";\n message.setAttribute(\"style\", \"background-color: red; color: white;\");\n return false;\n }\n else {\n return true;\n }\n}", "function validatePassword() {\nlet message= '';\nif (!/.{6,}/.test(passwordInput.value)) {\n message = 'At least eight characters. ';\n}\nif (!/.*[A-Z].*/.test(passwordInput.value)) {\n message += 'At least one uppercase letter. ';\n}\nif (!/.*[!@#$%^&*].*/.test(passwordInput.value)) {\n message += 'At least one special characters.';\n}\nif (!/.*[0-9].*/.test(passwordInput.value)) {\n message += 'At least one number.';\n}\npasswordInput.setCustomValidity(message);\n}", "function validatePassword(){var r=document.getElementById(\"passwordfield\").value,e=document.getElementById(\"confirmPasswordfield\").value;e!=r?document.getElementById(\"confirmPasswordfield\").setCustomValidity(\"Passwords Don't Match\"):document.getElementById(\"confirmPasswordfield\").setCustomValidity(\"\")}", "function valiatePassword(password) {\n var re = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[@$!%*?&])[A-Za-z\\d@$!%*?&]{8,}$/;\n var signupFormPasswordWarning = document.querySelector(\"#signupForm .form-container\").children[10];\n signupFormPasswordWarning.textContent = \"\";\n\n if (re.test(String(password)) == false) {\n signupFormPasswordWarning.textContent = \"Minimum eight characters, at least one uppercase letter, one lowercase letter, one number and one special character\";\n return false;\n } else {\n return true;\n }\n}", "function checkPassword() {\n\tvar password = document.getElementById(\"password\").value;\n\tvar retypePassword = document.getElementById(\"retypePassword\").value;\n\tvar hasNumber = /\\d/;\n\tvar hasSpecialCharacter = /\\W/;\n\t//Password must contain at least one number and one special character\n\tif ((password === retypePassword) && (hasNumber.test(password)) && (hasSpecialCharacter.test(password))) {\n\t\tdocument.getElementById(\"passwordError\").innerHTML = \"\";\n\t\tdocument.getElementById(\"retypePasswordError\").innerHTML = \"\";\n\t}\n\telse {\n\t\tdocument.getElementById(\"passwordError\").innerHTML = \"Password must match, have a number and a special character.\";\n\t\tdocument.getElementById(\"retypePasswordError\").innerHTML = \"Retyped password must match, have a number and a special character.\";\n\t}\n}", "validate(value) {\r\n if (value.toLowerCase().includes('password'))\r\n throw new Error('Password cannot contain password, come on');\r\n }", "function validatePassword(input) {\n const re = /^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\\$%\\^&\\*])(?=.{6,14}$)/;\n if (re.test(String(input.value))) {\n passwordOk = 1\n showSuccess(input)\n } else {\n passwordOk = 0\n showError(input, 'Must include a number, one uppercase, one lowercase and one special character. Length must be 6-14 characters.') \n };\n}", "function validatePassword() {\n let oldPass = new Password(dom('#oldPassword').value)\n let newPass = new Password(dom('#newPassword').value)\n let newPassConfirm = new Password(dom('#newPassword2').value)\n let errorPrompt = dom('#passwordError')\n\n if (!newPass.match(newPassConfirm)) {\n errorPrompt.innerText = \"Passwords do not match\"\n return false\n }\n if (newPass.lessEq(7) || newPassConfirm.lessEq(7)) {\n errorPrompt.innerText = \"New password must be at least 8 characters\"\n return false\n }\n if (!oldPass.matchStr(\"test\")) {\n errorPrompt.innerText = \"Incorrect password\"\n return false\n }\n errorPrompt.innerText = \"\"\n return true\n}", "password(password) {\n\n\n if (password === \"\") {\n obj.error = \"field should not be empty\",\n obj.boolval = true\n }\n else if (password.length < 8) {\n obj.error = \"password length should be minimum 8 characters\",\n obj.boolval = true\n }\n else{\n obj.error = \"\",\n obj.boolval = false\n }\n\n return obj\n }", "function validatePassword() {\r\n var checkVal = document.registration.passid.value;\r\n\r\n // Password not empty\r\n if (checkVal.length == 0) {\r\n strFields += \"- Password cannot be empty!<br>\";\r\n return false;\r\n }\r\n\r\n // Password length: 6-20 (inclusive)\r\n if (checkVal.length < 6 || checkVal.length > 20) {\r\n strFields += \"- Password must be between 6 and 20 characters long!<br>\";\r\n return false;\r\n }\r\n\r\n return true;\r\n}", "function validatePassword(value,data,name,form)\n{\n var message = \"\";\n if(value === \"\")\n message = \"* Required\";\n else if (!value.match(/^(?=.*\\d).{8,12}$/))\n message = \"* Must be between 8 to 12 characters and include at least one numeric digit\";\n\n if(message) {\n form.elements[name].define(\"invalidMessage\", message);\n return false\n }\n return true;\n}", "function validatePassword() {\n\n //Match 6 to 15 character string with at least one upper case letter, one lower case letter, and one digit\n var passwordRegex = /^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])[0-9a-zA-Z]{6,15}$/;\n\n //password\n if($('#txt-password').val().match(passwordRegex)){\n $('#txt-password').css('border-color', 'green');\n } else {\n $('#txt-password').css('border-color', 'red');\n }\n\n //passwordConfirm\n if($('#txt-passwordConfirm').val().match(passwordRegex) && $('#txt-passwordConfirm').val() == $('#txt-password').val()) {\n $('#txt-passwordConfirm').css('border-color', 'green');\n } else {\n $('#txt-passwordConfirm').css('border-color', 'red');\n }\n\n //Enable submit, when fields are correctly filled out\n if($('#txt-password').val().match(passwordRegex) && $('#txt-passwordConfirm').val().match(passwordRegex)\n && $('#txt-password').val() == $('#txt-passwordConfirm').val()) {\n $('#btn-changePassword-submit').prop('disabled', false);\n } else {\n $('#btn-changePassword-submit').prop('disabled', true);\n }\n }", "function validatePass(){\r\n\t\r\n\tvar pass = document.getElementById(\"password\").value;\r\n\tvar pPass = document.getElementById(\"valPass\");\r\n\t\r\n\tif (pass.length < 8 || pass.length > 50)\r\n\t{\r\n \tpPass.innerHTML =\r\n\t\t\"Password length must be between 8 and 50 characters\";\r\n\t\tpPass.classList.remove(\"valid\");\r\n\t\tpPass.classList.add(\"invalid\");\r\n\t\r\n\t\treturn false;\r\n\t}\r\n\t else if(pass.search(/[a-z]/) < 0)\r\n\t{\r\n\t\tpPass.innerHTML = \r\n\t\t\"Password must contain a lowercase letter\";\r\n\t\tpPass.classList.remove(\"valid\");\r\n\t\tpPass.classList.add(\"invalid\");\r\n\t\treturn false;\r\n\t}\r\n\t else if(pass.search(/[A-Z]/) < 0)\r\n\t{\r\n\t\tpPass.innerHTML =\r\n\t\t\"Password must contain an uppercase letter\";\r\n\t\tpPass.classList.remove(\"valid\");\r\n\t\tpPass.classList.add(\"invalid\");\r\n\t\treturn false;\r\n\t}\r\n\telse if(pass.search(/[0-9]/) < 0)\r\n\t{\r\n\t\tpPass.innerHTML =\r\n\t\t\"Password must contain a digit\";\r\n\t\tpPass.classList.remove(\"valid\");\r\n\t\tpPass.classList.add(\"invalid\");\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\telse if(pass.search(/[!#$%&? \"]/) < 0)\r\n\t{\r\n\t\tpPass.innerHTML =\r\n\t\t\"Password must contain a special character\";\r\n\t\tpPass.classList.remove(\"valid\");\r\n\t\tpPass.classList.add(\"invalid\");\r\n\t\treturn false;\r\n\t}\r\n\telse \r\n\t{\r\n\t\r\n\t\tpPass.innerHTML =\r\n\t\t\"Valid Password\";\r\n\t\tpPass.classList.remove(\"invalid\");\r\n\t\tpPass.classList.add(\"valid\");\r\n\t\treturn true;\r\n\t}\r\n }", "function validatePassword()\n{\n\tvar y = document.forms[\"myForm\"][\"password\"].value;\n\tif ( y.length<6)\n\tdocument.getElementById(\"pass\").innerHTML=\"*Password must be atleast 6 char long\";\n}", "checkPasswordValidity() {\n let self = this;\n if (self.userRegister.password === self.userRegister.retypedPassword) {\n self.registerForm.retypedPassword.$setValidity('notMatchingPassword', true);\n return;\n }\n self.registerForm.retypedPassword.$setValidity('notMatchingPassword', false);\n }", "function isValidPassword(field) {\r\n\r\n // sets initial value of return variable to false\r\n var validPassword = false;\r\n\r\n /*\r\n gets the value of `pw` in the signup form\r\n removes leading and trailing blank spaces\r\n then checks if it contains at least 8 characters.\r\n */\r\n var password = validator.trim($('#pw').val());\r\n var isValidLength = validator.isLength(password, { min: 8 });\r\n\r\n // if the value of `pw` contains at least 8 characters\r\n if (isValidLength) {\r\n\r\n /*\r\n check if the <input> field calling this function\r\n is the `pw` <input> field\r\n */\r\n if (field.is($('#pw')))\r\n // remove the error message in `idNumError`\r\n $('#pwError').text('');\r\n\r\n /*\r\n since the value of `pw` contains at least 8 characters\r\n set the value of the return variable to true.\r\n */\r\n validPassword = true;\r\n }\r\n\r\n // else if the value of `pw` contains less than 8 characters\r\n else {\r\n\r\n /*\r\n check if the <input> field calling this function\r\n is the `pw` <input> field\r\n */\r\n if (field.is($('#pw')))\r\n // display appropriate error message in `pwError`\r\n $('#pwError').text(`Passwords should contain at least 8\r\n characters.`);\r\n }\r\n\r\n // return value of return variable\r\n return validPassword;\r\n }", "function reTypePasswordValidation(passd, repassd) {\n\tvar letters = /^[0-9a-zA-Z-_]+$/;\n\tvar passdlen = passd.length;\n\tvar repassdlen = repassd.length;\n\tvar lengthPassword = getUiProps().MSG0022;\n\tvar charPassword = getUiProps().MSG0023;\n\tvar repassword = getUiProps().MSG0024;\n\tcellpopup.showValidValueIcon('#txtEditAccountName');\n\tdocument.getElementById(\"popupEditErrorMsg\").innerHTML = '';\n\tif (passdlen < 6 || passdlen > 32) {\n\t\tdocument.getElementById(\"editChangedPassword\").innerHTML = lengthPassword;\n\t\tcellpopup.showErrorIcon('#txtEditPassword');\n\t\treturn false;\n\t} else if (passd.length != 0 && !(passd.match(letters))) {\n\t\tdocument.getElementById(\"editChangedPassword\").innerHTML = charPassword;\n\t\tcellpopup.showErrorIcon('#txtEditPassword');\n\t\treturn false;\n\t} else if (repassdlen != passdlen || passd != repassd) {\n\t\tdocument.getElementById(\"editChangedPassword\").innerHTML = \"\";\n\t\tdocument.getElementById(\"editReTypePassword\").innerHTML = repassword;\n\t\tcellpopup.showValidValueIcon('#txtEditPassword');\n\t\tcellpopup.showErrorIcon('#txtEditReTypePassword');\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "function checkPassword(password, warning) {\n let pattner = \"/^[w_-]{6,16}$/\";\n if (password.value == \"\" || password.value == null) {\n warning.innerHTML = \"Password can not be blank\";\n return false;\n } else {\n if (!pattner.test(password.value)) {\n console.log(password.value);\n // console.log()\n warning.innerHTML = \"Wrong password format\";\n return false;\n } else {\n return false;\n }\n }\n}", "checkVerifyPassword(){\n if(this.state.password !== this.state.confirmPassword || this.state.password.length <= 0){\n return (\n <div>\n <p className=\"warningText\">Passwords must match</p>\n </div>)\n }\n\n }", "function InvalidPwd(textbox){\n /**set regex require character and number with minimum 8 length */\n var regular=/^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d]{8,}$/;\n\n /**update validation textbox content */\n if (textbox.value === '') {\n textbox.setCustomValidity('Entering an password is necessary!');\n }else if (!textbox.value.match(regular)) {\n textbox.setCustomValidity('Please enter password Minimum eight characters, at least one letter and one number');\n }else{\n textbox.setCustomValidity('');\n }\n return true;\n}", "function checkPassword() {\n\tvar password = document.getElementById(\"password\");\n\tvar check_password = document.getElementById(\"check-password\");\n\t\n\tif (isNull(password.value)) {\n\t\tpassword.style.background = \"#FDEDEC\";\n\t\tcheck_password.innerHTML = \"*Password not empty!\"\n\t} else if (!checkLength(password.value)) {\n\t\t\tcheck_password.innerHTML = \"*Password length min 8 letter.\";\n\t} else if (!checkValidate(password.value)) {\n\t\tcheck_password.innerHTML = \"*Password wrong format.\"\n\t} else {\n\t\tflagPassword = true;\n\t\tcheck_password.innerHTML = \"\";\n\t\tpassword.style.background = \"#FFF\";\n\t}\n}", "function checkPassword ( password ) {\n //check for at least 6 characters in password field\n if ( ! ( /.{6}/.test( password ) ) ) {\n error.innerHTML += \"<li class='error' >Password less than 6 characters</li>\";\n result = true;\n }\n \n //checks whether or not password has special characters, which it must contain at least 1\n if ( ! ( /\\W/.test ( password ) ) ) {\n error.innerHTML += \"<li class='error'>Password must contain special character</li>\";\n result = true;\n }\n\n return result;\n }", "checkPassword(password) {\n return password === this.password;\n }", "function passV() {\n var pass = document.getElementById('pass').value;\n if (pass.length == 0) {\n showWarning(\"Password field empty\");\n return false;\n } else if (pass.length < 2) {\n showWarning(\"Password must be minimum 3 characters long\");\n return false;\n }\n return true;\n\n}", "function passwordValidate() {\n // If username field is valid and password field is not empty\n if (\n usernameField.classList.contains(\"valid\") &&\n passwordRegisterField.value != \"\"\n ) {\n // Checks against Regex pattern inline HTML\n if (!passwordRegisterField.checkValidity()) {\n // Change the error message to explain the issue\n errorMessageField.innerHTML =\n \"Password must contain 6-20 characters, and one number or special character.\";\n\n // Apply invalid class\n if (passwordRegisterField.classList.contains(\"valid\")) {\n passwordRegisterField.classList.remove(\"valid\");\n passwordRegisterField.classList.add(\"invalid\");\n }\n } else {\n // Reset the error message when correct\n errorMessageField.innerHTML = \"\";\n // Apply valid class\n if (passwordRegisterField.classList.contains(\"invalid\")) {\n passwordRegisterField.classList.remove(\"invalid\");\n passwordRegisterField.classList.add(\"valid\");\n }\n }\n // Run the passwordCompare function to check the confirmation password\n passwordCompare();\n }\n}", "function isExistingPasswordValid (body) {\n if ('password' in body &&\n validator.isLength(body['password'] + '', { min: 7, max: parseInt(maxPasswordVarcharAmount) })) {\n console.log('password ' + body['password'] + ' pass')\n return true\n } else {\n console.log('password ' + body['password'] + ' fail')\n return false\n }\n}", "validateForm() {\n return (\n this.state.email.length > 0 &&\n this.state.password.length > 7 &&\n this.state.password === this.state.confirmPassword\n );\n }", "function validatePasswordFields(context) {\r\n var pwds = context.parentNode.getElementsByClassName('repeat_password');\r\n \r\n\r\n\tif(pwds[0].value !== pwds[1].value) {\r\n\r\n pwds[0].addClass('error').value = \"\";\r\n pwds[1].addClass('error').value = \"\";\r\n \r\n return false;\r\n }\r\n\t\r\n return true;\r\n}", "function validate(pswd) {\n let res = document.getElementById(\"password-check\");\n // checkLength(pswd);\n if (checkLength(pswd) === true) {\n if (numberSpecialSpacesCheck(pswd) === true) {\n console.log(\"Your password is valid\");\n let success = document.createElement(\"h1\");\n success.style = \"color:green\";\n success.innerHTML = \"Your password is valid. Password is set to: \" + pswd;\n res.appendChild(success);\n } else {\n let fail = document.createElement(\"h1\");\n fail.style = \"color:red\";\n fail.innerHTML = \"Your password is invalid\";\n res.appendChild(fail);\n }\n } else {\n let fail = document.createElement(\"h1\");\n fail.style = \"color:red\";\n fail.innerHTML = \"Your password is invalid\";\n res.appendChild(fail);\n }\n}", "function validateFocusPasswordText() {\n\n if (passwordInput.value === \"\" || passwordInput.value === null) {\n infoDivPassword.style.display = \"none\"\n return;\n }\n if (passwordInput.value.search(/[a-z]/) < 0) {\n infoDivPassword.style.display = \"none\"\n return;\n }\n if (passwordInput.value.search(/[A-Z]/) < 0) {\n infoDivPassword.style.display = \"none\"\n return;\n }\n if (passwordInput.value.search(/[0-9]/) < 0) {\n infoDivPassword.style.display = \"none\"\n return;\n }\n if (passwordInput.value.length >= 8) {\n infoDivPassword.style.display = \"none\"\n return;\n }\n\n}", "function validatePassword(){\r\n\tvar submit = false;\r\n\tvar password = $(\"#password\").val();\r\n\t\tpassword = password.trim();\r\n\t\tif(password ==''){\r\n\t\t\tsubmit = showError('password',\"Please fill Password\");\r\n\t\t}\r\n\t\telse if(!(regPass.test(password)) || password.length < 8){\r\n\t\t\tsubmit = showError('password',\"Password must be alphanumeric and min 8 charaters\");\r\n\t\t}\r\n\t\telse{\r\n\t\t\tsubmit = markFieldCorrect(\"password\");\r\n\t\t}\r\n\t\treturn submit;\r\n}", "validate(t) {\n t.preventDefault();\n\n if (this.state.entered === this.state.password) {\n return this.setState({ open: false });\n } else {\n return this.setState({ error: \"Password Required\" });\n }\n }", "function warnPasswordIsBad(){\n var dumStr = $('#passwordValue').val();\n if (!(passwordLength(dumStr) || dumStr=='')){\n $(\"#passwordMessage\").html('<p style=\"color:red;\">Password must be six characters long or longer.</p>');\n }\n}", "static validatePassword(password) {\n let passwordRegex = /^(?=.*\\d)(?=.*[!@#$%^&*])(?=.*[a-z])(?=.*[A-Z]).{8,20}$/;\n\n //password field should not be empty.\n if (password == null || password == \"\") {\n //alert(\"Password field Can,t be Empty!.\");\n return false;\n }\n\n //password should match the given condition.\n if (!(password.match(passwordRegex))) {\n return false;\n }\n return true;\n }", "function validate_repeated_password()\n {\n const icon = DOM.repeated_new_password_validation_icon;\n const password = DOM.new_password_input.value;\n const repeated_password = DOM.repeated_new_password_input.value;\n\n icon.style.visibility = \"visible\";\n\n if (validate_password() &&\n repeated_password === password)\n {\n icon.src = \"/icons/main/correct_white.svg\";\n return true;\n }\n else\n {\n icon.src = \"/icons/main/incorrect_white.svg\";\n return false;\n }\n }", "function validar_Password(pass) {\n var reg = /^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])[0-9a-zA-Z]{8,}$/;\n return reg.test(pass) ? true : false;\n}", "function isValidPassword(password, errorContent) {\n if (password.length >= 6 && password.length <= 128)\n return true;\n else {\n errorContent.innerHTML = MessagesHelper.TXT_PASSWORD_INVALID;\n return false;\n }\n }", "function clientPasswordVerify(){\n var passw = /^[A-Za-z]\\w{7,14}$/;\n if (clientPassword.value.match(passw)){\n clientPassword.style.border = \" 2px solid #7FFF00\";\n clientPassword_error.innerHTML = \"\";\n return true;\n }\n else {{\n alert(\"You have entered an invalid password address!\");\n document.form1.text1.focus();\n return false;\n }}\n}", "function judgePassword()\n{\n var password = document.getElementById(\"Password_Password\").value;\n clearDivText(\"Div_Password\");\n if(password.length < 6)\n {\n setDivText(\"Div_Password\", TYPE_ERROR, \"密码过短\");\n return false;\n }\n if(password.length > 20)\n {\n setDivText(\"Div_Password\", TYPE_ERROR, \"密码过长\");\n return false;\n }\n if(isTextSimple(password))\n {\n setDivText(\"Div_Password\", TYPE_CORRECT, \"\");\n return true;\n }\n else\n {\n setDivText(\"Div_Password\", TYPE_ERROR, \"密码不合法\");\n return false;\n }\n}", "function validatePassword(pw)\n{\n if(pw == \"********\") // indicates password has not been changed\n {\n return(true);\n }\n else if(pw.length < 6)\n {\n return(\"Password must be at least 6 characters\");\n }\n else if(hasNumbers(pw)==false)\n {\n return(\"Password must contain at least two digits\");\n }\n else\n {\n return(true);\n }\n}", "function checkpassword()\n{\n var pwd=document.getElementById(\"password\");\n var alp=/^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])[a-zA-Z0-9]{8,}$/;\n if(alp.test(pwd.value))\n {\n if(pwd.value.length>10)\n { pwd.style.border=\"solid green\";\n //alert(\"Strong password and valid format\");\n return true;\n }\n else\n {\n pwd.style.border=\"solid orange\";\n pwd.focus();\n alert(\"Valid format but medium password\");\n return false;\n }\n }\n else\n {\n pwd.style.border=\"solid red\";\n pwd.focus();\n alert(\"Password must be alphanumeric and minimum one uppercase and lower case letter and digit\");\n return false;\n } \n}", "function UserValidate() {\n var name = /^[a-zA-Z]+$/\n document.getElementById('PasswordError').innerHTML = '';\n if (document.getElementById(\"Password\").value.length < 6 || document.getElementById(\"Password\").value.length > 12) {\n document.getElementById('PasswordError').innerHTML = 'Incorrect Password';\n return false;\n }\n}", "function passwordValid() {\n\tvar pass = document.getElementById(\"password\").value,\n\t\tconfirmpass = document.getElementById(\"cpassword\").value;\n\tif (pass.length > 10) {\n\t\tdocument.getElementById(\"cpassErrorField\").innerHTML = \"Password longer than 10\";\n\t\treturn false;\n\t} else if (!(pass.length > 0 && pass.length <= 10)){\n\t\tdocument.getElementById(\"cpassErrorField\").innerHTML = \"Please Enter a password\";\n\t} else if (pass === confirmpass) {\n\t\tdocument.getElementById(\"cpassErrorField\").innerHTML = \"Password OK.\";\n\t\treturn true;\n\t} else {\n\t\tdocument.getElementById(\"cpassErrorField\").innerHTML = \"Passwords do not match.\";\n\t\treturn false;\n\t}\n}", "function isNewPasswordValid (body) {\n if ('password' in body &&\n 'passwordConfirmation' in body &&\n validator.isLength(body['password'] + '', { min: 7, max: parseInt(maxPasswordVarcharAmount) }) &&\n validator.isLength(body['passwordConfirmation'] + '', { min: 7, max: parseInt(maxPasswordVarcharAmount) }) &&\n validator.equals(body['password'], body['passwordConfirmation'])) {\n console.log('password ' + body['password'] + ' pass')\n return true\n } else {\n console.log('password ' + body['password'] + ' fail')\n return false\n }\n}", "function validatePwd(pwd) {\n var pwdPattern = new RegExp(\n \"^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$\"\n );\n var isValidPwd = pwdPattern.test(pwd);\n var pwdErr = document.getElementById(\"pwdErr\");\n\n if (isValidPwd == false) {\n pwdErr.innerHTML = \"Invalid Password\";\n pwdErr.style.color = \"red\";\n pwdErr.style.display = \"block\";\n } else {\n pwdErr.style.display = \"none\";\n }\n return isValidPwd;\n}", "onPasswordChange(text) {\n this.props.passwordChanged(text);\n this.isValidPassword(text);\n }", "password() {\n\n const obj = validate.password(this.state.password)\n const error = obj.error\n const boolval = obj.boolval\n\n this.setState({\n passwordError: error\n })\n\n return boolval\n }", "function Validar(miForm){\r\n var passw = document.getElementById('pass').value;\r\n var pl = passw.length;\r\n if(pl<1){\r\n alert(\"Debe ingresar una contraseña\");\r\n miForm.pass.focus();\r\n return false;\r\n }\r\n return true;\r\n}", "function passwordCheck(form){\r\n var p1=signup.pass.value.trim();\r\n var p2=signup.repass.value.trim();\r\n var errors= document.querySelector(\".errmessage\");\r\n var charstring =\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\r\n var chars= \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\r\n var numstring =\"0123456789\";\r\n var passAlpha=false; \r\n var passNum=false; \r\n var passChar=false; \r\n\r\n\r\n if(p1.length<8){\r\n clear();\r\n errors.innerHTML+= \"<p>* Password must be at least 8 characters long. <p>\";\r\n signup.pass.focus();\r\n return false; \r\n }\r\n\r\n if(chars.indexOf(p1.substr(0,1))>=0){\r\n passChar=true;\r\n }\r\n if(!passChar){\r\n clear();\r\n errors.innerHTML+= \"<p>* Password must begin with a character. <p>\";\r\n signup.pass.focus();\r\n return false; \r\n }\r\n\r\n for(var i=0; i<p1.length; i++){\r\n clear(); \r\n if(charstring.indexOf(p1.substr(i,1))>=0){\r\n passAlpha=true;\r\n }\r\n }\r\n\r\n if(!passAlpha){\r\n errors.innerHTML+= \"<p>* Password must have at least one upper case letter. <p>\";\r\n signup.pass.focus();\r\n return false; \r\n }\r\n\r\n for(var i=0; i<p1.length; i++){\r\n clear(); \r\n if(numstring.indexOf(p1.substr(i,1))>=0){\r\n passNum=true;\r\n }\r\n }\r\n if(!passNum){\r\n errors.innerHTML+= \"<p>* Password must have at least one number. <p>\";\r\n signup.pass.focus();\r\n return false; \r\n }\r\n \r\n if(p2!=\"\" && p1!=p2){\r\n clear(); \r\n errors.innerHTML+= \"<p>* Passwords do not match! <p>\";\r\n signup.repass.focus();\r\n return false; \r\n }\r\n\r\n return true; \r\n}", "function checkNewPassword()\r\n\t{\r\n\t\tvar newPassword=$(\"#Npass\").val();\r\n\t\t \r\n\t\t if(!isEmpty(newPassword))\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\t$(\"#Npass\").css(\"border-color\",\"red\");\r\n\t\t\t\t$(\"#NpassP\").text(\"New password is Required\").css(\"color\",\"red\").show();\r\n\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\tif(!passwordRegEx.test(newPassword))\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t$(\"#Npass\").css(\"border-color\",\"red\");\r\n\t\t\t\t$(\"#NpassP\").text(\"Invalid new Password Entered\").css(\"color\",\"red\").show();\r\n\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\telse\r\n\t\t\t{\r\n\t\t\t\t$(\"#Npass\").css(\"border-color\",\"\");\r\n\t\t\t\t$(\"#NpassP\").hide();\r\n\r\n\t\t\t\treturn true;\r\n\t\t\t}\t\r\n\t}", "function validatePassword(pass) {\n passEntered = pass.value\n globalpass = passEntered;\n // Password must NOT be the same as the Username\n if (passEntered == globaluser) {\n document.getElementById(\"passwordGroup\").classList.remove(\"has-success\");\n document.getElementById(\"passwordError\").innerHTML=\"You cannot have a password the same as a username.\";\n document.getElementById(\"passwordError\").classList.remove(\"hidden-message\");\n document.getElementById(\"passwordError\").classList.add(\"shown-message\");\n document.getElementById(\"passwordGroup\").classList.add(\"has-error\");\n boolp = false;\n }\n\n // Password must be between 6-20 characters\n else if (passEntered.length < 6 || passEntered.length > 20) {\n document.getElementById(\"passwordGroup\").classList.remove(\"has-success\");\n document.getElementById(\"passwordGroup\").classList.add(\"has-error\");\n document.getElementById(\"passwordError\").innerHTML=\"Your password length is invalid. Please choose a password between 6 and 20 characters.\";\n document.getElementById(\"passwordError\").classList.remove(\"hidden-message\");\n document.getElementById(\"passwordError\").classList.add(\"shown-message\");\n document.getElementById(\"passwordGroup\").classList.add(\"has-error\");\n boolp = false;\n }\n\n // Password must NOT be the word \"password\" regardless of (upper-/lower-) case used\n else if (passEntered.toLowerCase() == \"password\") {\n document.getElementById(\"passwordGroup\").classList.remove(\"has-success\");\n document.getElementById(\"passwordError\").innerHTML=\"Password cannot contain any combination of Upper/Lower containing the word password.\";\n document.getElementById(\"passwordError\").classList.remove(\"hidden-message\");\n document.getElementById(\"passwordError\").classList.add(\"shown-message\");\n document.getElementById(\"passwordGroup\").classList.add(\"has-error\");\n boolp = false;\n }\n else {\n // green\n document.getElementById(\"passwordGroup\").classList.remove(\"has-error\");\n document.getElementById(\"passwordGroup\").classList.add(\"has-success\");\n boolp = true;\n }\n}", "function validatePasswordHash() {\n if (this.isNew) {\n if (!this._password) {\n return this.invalidate('password', 'A password is required.');\n }\n if(this._password.length < 6){\n this.invalidate('password', 'Must be at least 6 characters');\n }\n if (this._password !== this._passwordConfirmation){\n return this.invalidate('password', 'Passwords do not match.');\n }\n }\n}", "function InputFieldPassword({ label, onChange, objectKey, autoFocus, loading, onPressEnter, value }) {\n const [focus, setFocus] = useState(false);\n let message = '';\n let type = '';\n\n const weakRegex = /^(?=.*[a-zA-Z])[A-Za-z]{7,}[^'\\s]+$/;\n const mediumRegex = /^(?=.*[a-zA-Z])(?=.*\\d)[A-Za-z\\d]{7,}[^'\\s]+$/;\n const strongRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[$@$!%*?&+-])[A-Za-z\\d$@$!%*?&+-]{7,}[^'\\s]+$/;\n\n function handleBlur() {\n setFocus(false);\n }\n\n function handleFocus() {\n setFocus(true);\n }\n\n function validateValue() {\n return focus && value;\n }\n\n function verifyRegex() {\n if (strongRegex.exec(value)) return type = \"strong\";\n if (mediumRegex.exec(value)) return type = \"medium\";\n if (weakRegex.exec(value)) return type = \"weak\";\n }\n\n if (validateValue()) {\n verifyRegex();\n const capitalized = type.charAt(0).toUpperCase() + type.slice(1);\n message = type !== '' ? <p className={`password${capitalized}`}>{`The password is ${capitalized}`}</p> : '';\n }\n\n return (\n <div className={`inputFieldPasswordComponent ${type}`}>\n <InputField\n label={label}\n onChange={onChange}\n objectKey={objectKey}\n autoFocus={autoFocus}\n loading={loading}\n onPressEnter={onPressEnter}\n onBlur={handleBlur}\n value={value}\n onFocus={handleFocus}\n placeholder={'The password should has minimun 8 characteres'}\n pattern={'[\\\\S]{8,}'}\n type={'password'}\n id={'passwordMessage'}\n />\n {message}\n </div>\n );\n}", "function checkPwLength(passwd, location)\r\n{\r\n\tpassword = $(\"#\"+passwd).val();\r\n\t\r\n\tlen = password.length;\r\n\t\r\n\tif(len < 6)\r\n\t{\r\n\t\t$(\"#password1\").focus();\r\n\t\t\r\n\t\t$(\"#\"+location).html(\"<font color = 'red'>Password entered is too short, minimum allowed characters is 6 (SIX)</font> <img src='../images/no.gif' name = 'img1' align = 'absmiddle' width='18' height = '18' alt='image'>\");\r\n\t\t\r\n\t\treturn false;\t\t\r\n\t}\r\n\telse\r\n\t{\r\n\t\tif(len == 6)\r\n\t\t{\r\n\t\t\t$(\"#\"+location).html(\"<font color = 'green'>Password strength <b>WEAK</b></font> <img src='../images/yes.gif' name = 'img1' align = 'absmiddle' width='18' height = '18' alt='image'>\");\r\n\t\t\t\r\n\t\t\t$(\"#phoneno\").focus();\r\n\t\t}\r\n\t\telse if(len > 6 && len <= 12)\r\n\t\t{\r\n\t\t\t$(\"#\"+location).html(\"<font color = 'green'>Password strength <b>STRONG</b></font> <img src='../images/yes.gif' name = 'img1' align = 'absmiddle' width='18' height = '18' alt='image'>\");\r\n\t\t\t\r\n\t\t\t$(\"#phoneno\").focus();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$(\"#\"+location).html(\"<font color = 'green'>Password strength <b>VERY STRONG</b></font> <img src='../images/yes.gif' name = 'img1' align = 'absmiddle' width='18' height = '18' alt='image'>\");\r\n\t\t\t\r\n\t\t\t$(\"#phoneno\").focus();\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\t\r\n\t}\r\n}", "function validatePassword2() {\n let pass2Value = pass2.value;\n if (pass2Value.match(pass.value) && isPassValid == true) {\n pass2.className = \"form-control is-valid\";\n isPass2Valid = true;\n //console.log(\"pass2ok\");\n } else {\n pass2.className = \"form-control is-invalid\";\n isPass2Valid = false;\n //console.log(\"pass2error\");\n }\n}", "function validarPassword(pPassword) {\n return pPassword.trim().length >= 8;\n}", "function validatePassword(wachtwoord1, herwachtwoord){\r\n if(wachtwoord1.length < 8 && herwachtwoord < 8){\r\n errors.push(\"Het wachtwoord moet minstens 8 karakters bevatten.\");\r\n }\r\n else{\r\n if (wachtwoord1 != herwachtwoord){\r\n errors.push(\"Wachtwoord moet gelijk zijn!\");\r\n }\r\n }\r\n }", "passwordFieldInputed(e) {\n let passwordValue = e.currentTarget.value;\n let passwordError = $(\"#password-error\");\n let errors = this.state.errors;\n if (passwordValue === \"\") {\n passwordError.css(\"display\", \"flex\").show();\n errors.password = \"Password field can't be empty.\";\n this.setState({errors});\n } else {\n passwordError.hide();\n errors.password = \"\";\n this.setState({errors});\n }\n }", "function validatePassword() {\r\n let pass1 = document.getElementById(\"pass\").value;\r\n let pass2 = document.getElementById(\"confirm-pass\").value;\r\n console.log(pass1);\r\n let regex = \"^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])[a-zA-Z0-9]{8,20}$$\";\r\n if (!pass1.match(regex)) {\r\n alert(\r\n \"Invalid password: 8-20 characters, at least 1 digit, lower and upper case alphabet.\"\r\n );\r\n return false;\r\n }\r\n\r\n if (pass1 != pass2) {\r\n alert(\"Passwords do not match.\");\r\n return false;\r\n }\r\n return true;\r\n}", "function checkPasswords() {\n var password = document.getElementById('InputPassword');\n var retypePassword = document.getElementById('InputPassword2');\n\n if (password.value != retypePassword.value) {\n showFeedBack(retypePassword.name,\"NoMatch\");\n if(retypePassword.value != \"\"){\n retypePassword.value = \"\";\n retypePassword.focus();\n }\n passwordError = true;\n } else {\n if(retypePassword.value != \"\"){\n showFeedBack(retypePassword.name,\"valid\");\n passwordError = false;\n }\n \n }\n \n }" ]
[ "0.77586097", "0.7665253", "0.760622", "0.75909793", "0.7450125", "0.74456334", "0.743816", "0.7358825", "0.7334179", "0.7306905", "0.724486", "0.72398955", "0.7237887", "0.72303236", "0.7223803", "0.71935797", "0.71863574", "0.7179179", "0.7166479", "0.71643424", "0.7163287", "0.71280974", "0.712193", "0.712027", "0.7119455", "0.7118189", "0.71134084", "0.7101977", "0.70958406", "0.7085837", "0.7069784", "0.7061356", "0.70490557", "0.70466906", "0.70406324", "0.70301116", "0.7024738", "0.7017114", "0.7006146", "0.7001603", "0.6998149", "0.6992209", "0.69868886", "0.69859624", "0.69857746", "0.69798255", "0.69587314", "0.69574034", "0.6957351", "0.6952094", "0.69520897", "0.6943005", "0.6940127", "0.69248265", "0.69057953", "0.68965155", "0.6892964", "0.6891944", "0.6887701", "0.68867385", "0.68848646", "0.6882935", "0.68806016", "0.6880453", "0.6875462", "0.68698204", "0.6865823", "0.6864524", "0.6863806", "0.6862963", "0.6861104", "0.68586457", "0.68441015", "0.68399066", "0.68273807", "0.68170494", "0.6814922", "0.68140686", "0.6813034", "0.6811727", "0.68096185", "0.68015957", "0.6799831", "0.6790343", "0.67884517", "0.6786649", "0.6785552", "0.67829573", "0.6767989", "0.6748409", "0.6743754", "0.6738568", "0.67384607", "0.6734146", "0.6727746", "0.67241716", "0.67167544", "0.67115104", "0.6711174", "0.670994" ]
0.74559754
4
This page contains the info about the web application functionality for potential users, and is just JSX.
function About() { return ( <div id="about-section"> <h1 id="page-title">About Us</h1> <h2>Welcome to New U!</h2> <p> New U is an all-in-one workout planner and knowledge hub. Here you will be able to create and store workout programs so you can better track your progress and actually see results! </p> <div className="image-text-container"> <img src="./build-workout.png" alt="" /> <div className="image-text"> <p> This site was created with our users in mind! Most companies will build their "backend" and everything the company needs first, and then think about the user. We are different. </p> <p> New U was first created to be user-friendly and intuitive, with no complicated features or gimmiks. And with full-control over your own program, how can you not see the best results money can buy! </p> <h3>Start Free, Pay Later!</h3> <p> With New U, we understand that gettign started is often the hardest part of you journey. This is why we give you 2 months to use our platform, absolutely free! We care about you, so you will get 100% unlimited access until you get into the habit of working on your goals. </p> </div> </div> <div className="image-text-container"> <img src="./articles.png" alt="" /> <div className="image-text"> <h3>Never be Lost Again</h3> <p> Part of the journey is knowing how to get there. And with so much information on the internet, just how can you sort through it all in your free time and find what truly works?? Well, fret no more. We have gathered the best articles across the globe and provided links to them in our articles section, which is curated by a panel of highly acknowledged fitness professionals. </p> <p> Find exactly what you need, when you need it. Don't worry about losing your articles, either. With our favorites feature, you can save an article for later, either because you just liked it so much, or because there is a lot of info in the article, and you want to reference it later when you have more time. </p> <p> So what are you waiting for? Sign up and start on your goals for free, today! </p> </div> </div> </div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "renderAbout() {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<p>This simple web-app developed for test purpose. It allows to fetch some user data from <b>GitHub</b> account: all profile info and repository list</p>\n\t\t\t\t<p>Used technologies: \n\t\t\t\t\t<b>React.js</b>, \n\t\t\t\t\t<b>Bable.js</b>, \n\t\t\t\t\t<b>Webpack</b>\n\t\t\t\t</p>\n\t\t\t\t<br/>\n\t\t\t\t<p><i>Developed by Volodymyr Tochytskyi, 2016</i></p>\n\t\t\t</div>\n\t\t);\t\t\n\t}", "function InfoPage() {\n return (\n <div className=\"container\">\n <h2>Technology</h2>\n <ul>\n <li>Node.JS</li>\n <li>Express</li>\n <li>React</li>\n <li>Saga</li>\n <li>Material UI</li>\n <li>Postgres</li>\n </ul>\n <h2>Challenges</h2>\n <ul>\n <li>\n The toughest \n <br/>challenge I \n <br/>overcame was \n <br/>synchronizing all the \n <br/>users items list so they \n <br/>can have the ability to edit \n <br/>and delete .\n </li>\n </ul>\n <h2>What's Next</h2>\n <ul>\n <li>\n Now that users can buy and sell their \n <br/>equipments, the next challenge I’d love to tackle is \n <br/>ability to add golfing accessories. Not only can user buy \n <br/>and sell golf clubs, they can also purchase all necessary \n <br/>items to start golfing. \n </li>\n </ul>\n </div>\n );\n}", "function AboutPage() {\n return (\n <div className=\"container\">\n <div>\n <p>This Webpage will show info about the current version of the application. It will also show what version of league it's set for as well as list the upcoming additions to the application.</p>\n </div>\n </div>\n );\n}", "function MyInfo() {\n return (\n <div>\n <h1>Alex Whan</h1>\n <p>I am a developer in the Seattle area.</p>\n </div>\n )\n}", "function Home(){\n return (<h2>这是主页页面</h2>)\n}", "viewHeader() {\n\t\tif (this.state.page === \"Info\") {\n\t\t\tif (this.state.page === \"Info\") {\n\t\t\t\treturn (\n\t\t\t\t\t<div>Getting Started</div>\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\treturn (\n\t\t\t\t\t<div>Welcome to Cast Off!</div>\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\tif (!this.props.userkey) {\n\t\t\t\treturn (\n\t\t\t\t\t<div>Welcome to Cast Off!</div>\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\treturn (\n\t\t\t\t\t<div>{this.state.page}</div>\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "function Index() {\r\n\r\n return (\r\n <div>\r\n {/* <ClickEvent /> */}\r\n {/* <CheckedEvent /> */}\r\n {/* <DataValues /> */}\r\n <API />\r\n {/* <UseReducer /> */}\r\n </div>\r\n );\r\n}", "function SecretComponent() {\n return (\n <h1>Secret information for authorized users only.</h1>\n )\n}", "function About(){\n\treturn(\n\t\t<React.Fragment>\n\t\t\t<h1>About</h1>\n\t\t\t<p>This is the TodoList app v1.0.0. It is part of a React crash course</p>\n\t\t</React.Fragment> \n\t)\n}", "function AboutPage() {\n return (\n <div>\n <div className=\"component-head\">\n <h1>Technologies Used</h1>\n </div>\n <div className=\"hop-logo\">\n <HopsLogo />\n </div>\n <div className=\"container\">\n <div>\n <ul>\n <li>React</li>\n <li>Redux-Saga</li>\n <li>Email.js</li>\n <li>Moment.js</li>\n <li>Node</li>\n <li>Express</li>\n <li>Material-UI</li>\n <li>HTML</li>\n <li>CSS</li>\n </ul>\n </div>\n </div>\n </div>\n );\n}", "render() {\n return( //div set up to explain Database app\n <div> \n <h1>Employee Database Application</h1>\n <p><span>Please enter a name and an age into the database and it will return either confirm \n <br></br>that this in put is in the system, or it will throw an error in the reporting area.\n <br></br>Please refer to my linkedin and message me for any questions about this project. :)</span></p>\n </div>\n )\n }", "renderPage() {\t\t\n\t\tswitch (this.props.data.active) {\n\t\t\tcase 'user': \n\t\t\t\treturn this.renderUserInfo(this.props.data.body);\t\t\t\n\t\t\tcase 'repos': \n\t\t\t\treturn this.renderRepos(this.props.data.body);\n\t\t\tcase 'about': \n\t\t\t\treturn this.renderAbout();\t\t\t\t\t\n\t\t}\n\t}", "render() {\n return (\n <div>\n <h3>Home Page</h3>\n <p>\n Intro to concept\n </p>\n </div>\n );\n }", "render() {\n\t\t// preserve context\n\t\tconst _this = this;\n\n\n\t\treturn (\n\t\t\t<div>\n\t\t\t\tHome App\n\t\t\t</div>\n\t\t);\n\t}", "function Home() {\n return (\n <p> This is the Home Page. This route is not protected. </p>\n );\n}", "renderContent() {\n\t\tswitch (this.props.auth) {\n\t\t\tcase null:\n\t\t\treturn \"\"; // we dont know if the user is logged in or not\n\n\t\t\tcase false:\n\t\t\t\treturn (\n\t\t\t\t\t<li><a href=\"/auth/google\">Login with Google</a></li>\n\t\t\t\t);\n\n\t\t\tdefault:\n\t\t\t\treturn [\n\t\t\t\t\t\t<li key=\"1\"><Payments /></li>,\n\t\t\t\t\t\t<li key=\"2\"><a href=\"/api/logout\">Logout</a></li>\n\t\t\t\t];\n\n\t\t}\n\t}", "renderInfoPage() {\n return (\n <p>\n Thanks! An email with a reset link should arrive in your inbox shortly.\n If it does not, please check your spam folder or <ContactLink text=\"contact us\"/>.\n </p>\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 Landing() {\n return(<div>This is the landing page, welcome!! CHECK OUT CAR PAGE</div>);\n}", "render() {\n\t\tif (this.state.is_logged_in) {\n\t\t\treturn (\n\t\t\t\t<div>\n\t\t\t\t\t<div>Hello user</div>\n\t\t\t\t\t<div>Logged in</div>\n\t\t\t\t</div>\n\t\t\t);\n\t\t} else {\n\t\t\treturn (\n\t\t\t\t<div>\n\t\t\t\t\t<div>Hello user</div>\n\t\t\t\t\t<div>Guest</div>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\t}", "viewNone() {\n\t\t// Shows if user is not logged in\n\t\tif (!this.props.userkey) {\n\t\t\treturn (\n\t\t\t\t<div>\n\t\t\t\t\t<p>Welcome to Cast Off, your one-stop site for navigation to \n\t\t\t\t\tyour favorite sites! If this is your first time using Cast\n\t\t\t\t\tOff make sure to check out the \"Getting Started\" page on\n\t\t\t\t\tthe sidebar. If you are a previous user just login to see \n\t\t\t\t\tall your sites.</p>\n\t\t\t\t</div>\n\t\t\t)\n\t\t// Shows if user is logged in but has no links saved\n\t\t} else {\n\t\t\treturn (\n\t\t\t\t<div>\n\t\t\t\t\t<p className=\"no-url-p\">No waypoints charted yet!</p>\n\t\t\t\t\t<img className=\"no-url-img\" alt=\"No Urls\" height=\"300\" width=\"300\" src={notFound} />\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\t}", "function Index() {\n return <Homepage />;\n}", "render() {\n return (\n <div className=\"App\">\n <Header\n handleLogoutSubmit={this.handleLogoutSubmit}\n handleLoginClick={this.handleLoginClick}\n handleLinks={this.handleLinks}\n userInfo={this.state.userInfo}\n />\n {this.pageView()}\n </div>\n );\n }", "index(request, response) {\n const loggedInUser = accounts.getCurrentUser(request); \n logger.info('about rendering');\n if (loggedInUser) {\n \n const viewData = {\n title: 'About the Horselist App',\n developers: developerStore.getAllDevelopers(),\n fullname: loggedInUser.firstName + ' ' + loggedInUser.lastName,\n picture: loggedInUser.picture,\n messages: messageStore.getAllMessages(),\n };\n response.render('about', viewData);\n }\n else response.redirect('/'); \n }", "render() {\n var isChrome = !!window.chrome && !!window.chrome.webstore;\n return (\n <div>\n {/* { isChrome == true || this.state.isAllowBrowser ? this.renderPages() : this.renderNoBrowserSupport() } */}\n { this.renderPages() }\n </div>\n );\n\n }", "render(){\n\t\treturn(\n\t\t\t<div>\n\t\t\t\t<h2> Our Current Clients Page </h2>\n\t\t\t\t<ClientLogos/>\n\t\t\t\t<ClientDescription/> \n\t\t\t</div>\n\t\t)\n\t}", "function App(){\n\n return<TechList /> \n //<h1>Hello Rocketseat</h1> // usando sintaxe JSX - É necessario importar o react\n}", "function Home(props) {\n\n // Returns HTML elements to display content on pages\n return (\n\n // Contents of the main page uses basic HTML elements\n <div className=\"text-center\">\n <p>&nbsp;</p>\n <h1 className=\"home-welcome display-4\">Welcome to Vibe Check</h1>\n {props.username !== null && <h4 style={{margin: \"0px 10px 10px 10px\"}}><strong>Hello {props.username}!</strong></h4>}\n <img src={logo} className=\"home-logo-image\" alt=\"logo\" />\n <div>Icons made by <a href=\"https://www.flaticon.com/authors/smashicons\" title=\"Smashicons\">Smashicons</a> from <a href=\"https://www.flaticon.com/\" title=\"Flaticon\">www.flaticon.com</a></div>\n <hr style={{ width: \"90%\", borderWidth: \"1px\", backgroundColor: \"#5dc7d8\" }} />\n <div style={{ padding: \"0 10% 5% 10%\" }}>\n <h1 className=\"home-welcome display-4\" style={{ marginBottom: \"20px\", marginTop: \"30px\" }}>About Us</h1>\n <p style={{ fontSize: \"18px\" }}>\n Vibe Check is an online social network for university students to socialise through forums.\n Vibe Check aims to engage various groups together in order to discuss a specific topics or\n state their opinion on something as well as to provide information which can be helpful to others,\n whether it's solving a problem or just a general thing!\n Students often use other mediums such as social media platforms, text messaging or other apps to communicate\n about questions, queries, issues or suggestions about the courses they are studying.\n So Vibe Check is a place where all these conversations can take place by creating a separate forum for different topics,\n this will be helpful and beneficial for every student! Sign-up now and create a forum or start posting!\n </p>\n </div>\n </div>\n );\n}", "function AboutPage() {\n return (\n <div className=\"container\">\n <div>\n <h2>What is Planel?</h2>\n\n <p>\n Most concrete foundations are made by assembling large aluminum form\n panels. Calculating how many are needed for a job, and keeping track\n of how many are in the yard, are two challenges any company using this\n build method will face. Planel is an application that provides a means\n of documenting and sharing how many panels will be needed for a job,\n as well as tracking how many are in use.\n </p>\n </div>\n </div>\n );\n}", "function SingleSkillPage () {\n return (\n <div>\n <Title />\n <AddEXP />\n <Timer />\n </div>\n )\n}", "render() {\n // render() returns the HTML of this component's content\n // (use parenthesis when returning multiple lines of HTML)\n return (\n // use \"className\" instead of \"class\" for styling your HTML\n <div className=\"App container\">\n <h2 onClick={() => this.handleClick()}>JSX is Weird</h2>\n\n <p>This is App component.</p>\n <p>\n Welcome, {user.firstName} {user.lastName}! You live at{\" \"}\n {user.address.street1}. This is your email: {user.emails[0]}.\n </p>\n {/* call a function in {} to display its result */}\n {displayAvatar()}\n </div>\n );\n }", "function LifeInterviewDashboard() {\n\treturn (\n\t\t<App>\n\t\t\t<VideoDownload></VideoDownload>\n\t\t\t<CameraControls></CameraControls>\n\t\t\t<VideoPlayer />\n\t\t\t<InterviewQuestionList />\n\t\t</App>\n\t);\n}", "function Home() {\n \n return (\n <div>\n <h1>Home</h1>\n </div>\n );\n}", "function Home() {\n return (\n <div>\n <h1>Home</h1>\n </div>\n );\n}", "function App() {\n \t\n return (\n\t <>\n\t <img src=\"./logo.png\" alt=\"Welcome\"/>\n\t <LoginButton />\t \n\t <Profile />\n\t </>\n\t\t// <Admin dataProvider={restProvider('http://localhost:3000')} >\t\t\t\n\t\t// \t<Resource name=\"users\" list={UserList} create={UserCreate} edit={UserEdit}/>\n\t\t// </Admin>\n );\n}", "function TastesEventPage() {\n return <div>TastesEventPage</div>;\n}", "getView() {\n /* const { content, loggedIn, isAdmin, isAdminRoute } = this.props;\n if (loggedIn && isAdmin && isAdminRoute()) {\n return content();\n } else if (isAdminRoute()) {\n return <Login />;\n } */\n return this.props.content();\n }", "function App(){\n return (\n <div>\n <Upper/>\n <ul>\n <Task name=\"Learn Angular.js\"/>\n <Task name=\"Learn Sails.js\"/>\n <Task name=\"Be a JavaScript ninja!\"/>\n </ul>\n </div>\n )\n }", "render() {\n return <div>Log In Page</div>;\n }", "function Home() {\n return (\n <div>\n <h2>Home</h2>\n </div>\n );\n}", "function Home() {\n return (\n <div>\n <h2>Home</h2>\n </div>\n );\n}", "render() {\n return (\n <div>\n\t\t\t<p>Hello Universe!!</p>\n\t\t\t<p>We are ready to start with React js</p>\n </div>\n );\n }", "render() {\n return (\n <a href=\"http://localhost:5000/login-recommendations\">\n get show recommendations!\n </a>\n )\n }", "renderContent() {\n if (this.state.startApp === 1 && this.state.loggedIn > -1)\n return this.checkLoginState();\n else return this.renderLogoPage(); // I will keep showing the startup image until I change the startApp value\n }", "function index(request, response) {\n const contextData = {\n title: 'Eventbrite clone project starter',\n salutation: 'Hello Yale SOM hackers',\n\n };\n response.render('index', contextData);\n}", "function HistoryPage (){\n\n return (\n <div id=\"wrapper\">\n\n <div>History Estamos en Login</div>\n </div>\n )\n\n\n}", "function App() {\n // Naming the constant variables that will be \n const fName = \"Devin\";\n const lName = \"Brueberg\";\n const subjectName = \"CSC 435 Adv Web App Development\";\n const projectDate = \"March 3, 2021\";\n\n // The return is what this component will return to the \n // caller. This return consists of some HTML elements \n // that will create a h1 title header followed by the \n // name, subject name, and project date of this App\n return (\n \n // Only one main div is allowed per component so the main div \n // is defined here. It will hold the components contents\n <div id=\"main\"> \n \n {/* Page Heading */}\n <h1>\n Welcome to the React App\n </h1>\n \n {/* This div will flex in the css */}\n <div id=\"flex\">\n {/* Using a ul to include the name, class, and date. \n The const are referenced here and added to the \n HTML via JavaScript\n */}\n <ul>\n <li>\n {fName} {lName}\n </li>\n <li>\n {subjectName}\n </li>\n <li>\n {projectDate}\n </li>\n </ul>\n </div>\n </div>\n );\n}", "function App() {\n return (\n <Wrapper>\n <Title>Employee Directory</Title>\n\n </Wrapper>\n );\n}", "function AboutTheChef() {\n document.title = 'Grocery Prep - About the Chef'\n\treturn (\n <div className='about-the-chef-content'>\n <h1 className='about-the-chef-title'>About the Chef</h1>\n <div className='about-the-chef-welcome'>\n <div className='about-the-chef-intro'>\n <p>Hello food lovers!!</p> \n <p>As someone who loves to cook but is often too occupied with schoolwork, planning my meals ahead of time was my savior. \n Cooking efficiently does not require a ton of organizational skills and can definitely assist others on their journey to adulthood. \n In creating this website, I thought that this content would be useful for others too, especially my fellow college students :))</p>\n </div>\n <div className='profile-img'>\n <img src={process.env.PUBLIC_URL + '/Images/Navlinks/about-the-chef-image.jpeg'}alt='profile picture' height='250px' />\n </div>\n </div>\n <div className='about-the-chef-bio-title'>\n <h2>My Life</h2>\n </div>\n <div className='about-the-chef-bio'>\n <p>Many of my best memories come from cooking with my family. \n Although, I was not always the best when it came to cooking, I grew to acquire the appropriate skills over time.\n I may not be no Gordon Ramsey, but it is the experience and enjoyment that comes with cooking that matters the most to me. \n Cooking is honestly one of those skills that everyone should aim to acquire because it definitely allows one to express their creativity.\n I especially love to bake, which is why desserts are what I enjoy cooking the most :D\n </p>\n <p>This recipe website is designed to encourage cooking between people of all skills ranges and are all beginner friendly.\n Enjoy and get creative!!\n </p>\n </div>\n </div>\n\t);\n}", "render() {\n let name = null;\n if (this.props.confirm) {\n name = this.props.confirm.email;\n }\n \n console.log(\"Rendering Appjs!\")\n return (\n\n <div className=\"App\">\n <div className=\"App\">\n <div className=\"main-page\">\n <div className=\"top-section\">\n <h1>Welcome, {name}</h1>\n </div>\n <div className=\"bottom-section\">\n <button onClick={this._handleLogout}>LOGOUT</button>\n </div>\n </div>\n </div>\n </div>\n );\n }", "function Home() {\n return (\n <>\n <Head>\n <title>LV - Home</title>\n <link rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/favicon-32x32.png\" />\n <link rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/favicon-16x16.png\" />\n <link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"/apple-touch-icon.png\" />\n <link rel=\"manifest\" href=\"/site.webmanifest\" />\n <link rel=\"mask-icon\" href=\"/safari-pinned-tab.svg\" color=\"#5bbad5\" />\n <meta name=\"viewport\" content=\"initial-scale=1\" maximum-scale=\"1\" user-scalable=\"no\" width=\"device-width\" viewport-fit=\"cover\" />\n </Head>\n\n <Navbar />\n\n <Social />\n\n <section className=\"hero\">\n <div className=\"container\">\n <img className=\"home-img\" src=\"/web-developer.jpeg\" alt=\"home-image\" />\n <div className=\"text-wrapper home-text\">\n <h1 className=\"title\">Hello, I am Liam Volschenk</h1>\n <p className=\"description\">I am an aspiring web developer, photographer, designer, problem solver and forward thinker</p>\n\n </div>\n </div>\n </section>\n </>\n );\n}", "function Welcome(props) { return <h1 hidden>Hello, {props.name}!</h1>;}", "function AboutPage() {\n return (\n <div className=\"container\">\n <div>\n <p>This about page is for anyone to read!</p>\n </div>\n </div>\n );\n}", "function renderPersonInfo() {\n const app = document.querySelector('#app');\n}", "function HomePage() {\n return (\n <div className='jumbotron'>\n <h1>Pluralsight Administration</h1>\n <p>React, Flux, and react Router for ultra-responsive web apps.</p>\n <Link to='about' className='btn btn-primary'>\n About\n </Link>\n </div>\n );\n}", "function App() {\n return (\n <div>\n <h1>Portfolio Tracker</h1>\n <SignUpPage />\n </div>\n );\n}", "static getWishInfo() {\n return `wish/view`\n }", "function App() {\n return (\n <>\n <h1>POSITIONAL CHESS TRAINER</h1>\n </>\n \n );\n}", "render() {\n return (\n <div className=\"page-content\">\n <title>SNAPSHARE</title>\n <header>\n <nav className=\"cyan darken-3\">\n <div className=\"nav-wrapper container\">\n <a href=\"/\" className=\"brand-logo\">\n <i className=\"mdi-image-camera left\"></i>SNAPSHARE\n </a>\n <a href=\"\" data-activates=\"mobile-demo\" className=\"button-collapse\"><i className=\"mdi-navigation-menu\"></i></a>\n <ul className=\"right hide-on-med-and-down\">\n {this.data.currentUser ? <li><a href=\"/services\">Services</a></li>: \"\"}\n <li><a href={this.data.currentUser ? \"\" : \"/signin\"} onClick={this.data.currentUser ? this.signOut : \"\"}>{this.data.currentUser ? \"Sign Out\" : \"Sign In\" }</a></li>\n </ul>\n <ul className=\"side-nav\" id=\"mobile-demo\">\n {this.data.currentUser ? <li><a href=\"/services\">Services</a></li>: \"\"}\n <li><a href={this.data.currentUser ? \"\" : \"/signin\"} onClick={this.data.currentUser ? this.signOut : \"\"}>{this.data.currentUser ? \"Sign Out\" : \"Sign In\" }</a></li>\n </ul>\n </div>\n </nav>\n </header>\n <main>\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col s12 m12 l12\">\n <div className=\"section\">\n {this.props.content}\n </div>\n </div>\n </div>\n </div>\n </main>\n <footer className=\"page-footer cyan darken-3\">\n <div className=\"footer-copyright\">\n <div className=\"container\">\n © 2016 SNAPSHARE\n <a id=\"demo\" className=\"grey-text text-lighten-4 right\" href=\"\">Support</a>\n </div>\n </div>\n </footer>\n </div>\n )\n }", "render() {\n return(\n <div className=\"col-xs-12 col-sm-12 col-md-7 col-lg-7 hidden-xs hidden-sm\">\n <h1 className=\"txt-color-red login-header-big\">TrackIt+</h1>\n <div className=\"hero\">\n <div className=\"pull-left login-desc-box-l\">\n <h4 className=\"paragraph-header\">\n Manage and track all of your inventory within your company from the cloud.\n </h4>\n <div className=\"login-app-icons\">\n <span></span>\n <a className=\"btn btn-danger btn-sm\">Find out more</a>\n </div>\n </div>\n </div>\n </div>\n )\n }", "function Home() {\n return (\n <Page title=\"Home\">\n <h2 className=\"text-center text-white\">Welcome to WorkSmart!</h2>\n <p className=\"lead text-center text-white\">Your guide to a stress free work life!</p>\n <div className=\"text-white\">\n <b>\n <u>The secret ingredient?</u>\n </b>\n <p>The secret to working smart is not in the tools you choose, but it lies within you as an individual.</p>\n <br></br>\n <b>\n <u>Brief description of WorkSmart:</u>\n </b>\n <p>Worksmart provides you tools for you to journal, log and generate automated responses in order to work smarter.</p>\n <p>However, it ultimately all depends on you to work smart. It's a change in thinking and a mindset that will allow you to work more productively.</p>\n </div>\n <img src=\"riseup.jpg\" />\n <div className=\"text-white\">\n <br></br>\n <h2 className=\"text-white\">What tools does WorkSmart have?</h2>\n <br></br>\n <b>\n <u>Journal</u>\n </b>\n <p>The Journal tool allows you to focuse on self reflection. It enables you to reflect on how you can improve, become stronger and more wise from your experiences.</p>\n <br></br>\n <b>\n <u>Logger</u>\n </b>\n <p>The Logger tool is all about time. Logging your time on tasks will help you work more efficiently.</p>\n <p>Combining the Logger with the Journal will greatly help you to reflect why you may be taking more time on some tasks and will help you soar as you learn more about how you work.</p>\n <b>\n <u>Automated Responses</u>\n </b>\n <p>The Automated Responses tool will help you prepare for tough meetings and discussions when you don't have time to prepare.</p>\n <p>Take advantage of these templates and modify them to expand on your needs.</p>\n <b>\n <u>Contact Us Ticketing</u>\n </b>\n <p>We care about you! Contact us by submitting a ticket and we will get back to you within 1-2 business days.</p>\n </div>\n </Page>\n )\n}", "render() {\n let content = this.createContent();\n\n return (\n <div className=\"fillScreen\">\n <MetaTags>\n <title>Introduction | {this.state.company ? this.state.company : \"Moonshot Insights\"}</title>\n <meta\n name=\"description\"\n content=\"Enter name to begin evaluation. Moonshot Insights helps candidates and employers find their perfect matches.\"\n />\n </MetaTags>\n <div className=\"center\">{content}</div>\n </div>\n );\n }", "renderMain()\n {\n if (this.state.registering)\n {\n return this.renderRegistration();\n }\n else if(!this.state.loggedin)\n {\n return this.renderLogIn();\n }\n else\n {\n return this.renderBrowser();\n }\n }", "function App() {\n return (\n // returns a div with a header 1, a situp component, and a pushup component, each rendering their own html/jsx code.\n <div>\n <h1>Exercise Tracker</h1>\n <Situps />\n <Pushups />\n </div>\n );\n}", "function HelloWorld() {\n\treturn (\n\t\t<h1>\n\t\t\t<strong>\n\t\t\t\t<u>\n\t\t\t\t\tHello world with jsx in a function that runs with jsx\n\t\t\t\t</u>\n\t\t\t</strong>\n\t\t</h1> \n\t)\n}", "function Inventory () {\n \n return (\n <div>\n <h2> This is the Inventory page</h2>\n </div>\n )\n}", "index(request, response) {\n const viewData = {\n title: \"Login or Signup\",\n };\n response.render(\"index\", viewData);\n }", "render() {\n return (\n <h1>This is a placeholder for another page</h1>\n )\n }", "function indexPage (req, res) {\n _renderWithCommonData(res, \"index\", {\n recentlyRetrievedManifests: stats.getRecentlyRetrievedManifests(),\n recentlyUpdatedPackages: stats.getRecentlyUpdatedPackages()\n })\n}", "render() {\n let tokens = \"\";\n this.permissions.forEach(p => tokens = tokens + Permission.render(p));\n if(tokens === \"\") tokens = \"<h3>No tokens found for this user</h3>\";\n\n let cert = \"\";\n this.certificate.forEach(c => cert = cert + this.renderCert(c));\n if(cert === \"\") cert = \"<h3>No certificates found for this user</h3>\";\n\n return \"<div class='user'><div class='userName'>\"+ this.name +\n '</div><button class=\"collapsible\"> Tokens: </button><div class=\"content\">' + tokens +\"</div> <button class='collapsible'> Certificates: </button><div class='content'>\" + cert +\"</div></div>\";\n }", "render() {\n return(<h1>Hello World!!!</h1>);\n }", "function Skills() {\n return (\n <Container>\n <H3>skills:</H3>\n - JavaScript\n - TypeScript\n - React\n - Ruby on Rails\n - HTML/CSS/Sass\n - Python \n \n </Container>\n )\n}", "function HomePage() {\n return <TodoList />;\n}", "function ApplicationView(props) {\n return (\n <div className=\"application_view\">\n <div className=\"row\">\n <div className=\"appview_header\"> User ID: </div>\n <div className=\"appview_text\"> {props[\"applicationData\"][\"user\"]} </div>\n </div>\n <div className=\"row\">\n <div className=\"appview_header\"> Application Type: </div>\n <div className=\"appview_text\"> {props[\"applicationData\"][\"type\"]} </div>\n </div>\n <div className=\"row\">\n <div className=\"appview_header\"> Business Name: </div>\n <div className=\"appview_text\"> {props[\"applicationData\"][\"name\"]} </div>\n </div>\n <div className=\"row\">\n <div className=\"appview_header\"> Application Date: </div>\n <div className=\"appview_text\"> {props[\"applicationData\"][\"date\"]} </div>\n </div>\n <div className=\"row\">\n <div className=\"appview_header\"> Reason: </div>\n <div className=\"appview_text\"> {props[\"applicationData\"][\"reason\"]} </div>\n </div>\n </div>\n );\n}", "render() {\n return html`${appHeaderTemplate({\n title: this.title,\n initialTool: this.initialTool,\n showScoringDetailsModal: this.#showScoringDetailsModal,\n sendSupportEmail: this.#sendSupportEmail,\n navigateToByoc: this.#navigateToByoc,\n showAdditionalInfoModal: this.#showAdditionalInfoModal\n })}`\n }", "function MainApp() {\n const {\n blockedReason,\n blockedExplanation,\n isPreview,\n isLoading,\n initialTaskData,\n taskConfig,\n handleSubmit,\n } = useMephistoTask();\n console.log('Entering MainApp');\n if (blockedReason !== null) {\n return (\n <section className=\"hero is-medium is-danger\">\n <div className=\"hero-body\">\n <h2 className=\"title is-3\">{blockedExplanation}</h2>{\" \"}\n </div>\n </section>\n );\n }\n if (isLoading) {\n return <LoadingScreen />;\n }\n\n if (isPreview) {\n return (\n <section className=\"hero is-medium is-link\">\n <div className=\"hero-body\">\n <h3><span dangerouslySetInnerHTML={{ __html: taskConfig.task_title || 'Task Title Loading' }}></span></h3>\n <br />\n <span dangerouslySetInnerHTML={{ __html: taskConfig.task_description || 'Task Description Loading' }}></span>\n </div>\n </section>\n );\n }\n\n return (\n <div style={{ margin:0, padding:0, height:'100%' }}>\n <BaseFrontend\n taskData={initialTaskData}\n taskConfig={taskConfig}\n onSubmit={handleSubmit}\n />\n </div>\n );\n}", "render() {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t{this.state.is_logged_in && <div>Hello User</div>}\n\t\t\t\t{this.state.is_logged_in || <div>Guest</div>}\n\t\t\t</div>\n\t\t);\n\t}", "render () {\n\n // Make sure to return some UI.\n return (\n <div>\n <h1>Hello World!</h1>\n <h3>Its time for Tea!</h3>\n </div>\n )\n }", "function Homepage() {\n return (\n <div >\n <Navbar />\n <Entryform />\n <Displayform />\n </div>\n )\n}", "render () {\n\t\t// se retorna la vista \n\t\treturn (\n\t\t\t// div about\n\t\t\t<div className=\"About\">\n\t\t\t\t// se coloca el titulo \n\t\t\t\t<h1>Acerca de.</h1>\n\t\t\t</div>\n\t\t);\n\t}", "function UI() {\n\t// return (\n\t// \t<Link />\n\t// )\n}", "render(){\n\n\n\t\treturn(\n\t\t\t<div>\n\t\t\t\t<h2>UserList:</h2>\n\t\t\t\t<UserList />\n\t\t\t\t<hr/>\n\t\t\t\t<h2>UserDetail:</h2>\n\t\t\t\t<UserDetail />\n\t\t\t</div>\n\t\t);\n\t}", "render() {\n// A render method must contain a return statement. Usually, this return statement returns a JSX expression\n return <h1>Hello world</h1>;\n }", "render() {\n const { user, isLoading } = this.props.auth;\n\n if (isLoading) {\n return <h2>Loading...</h2>;\n }\n // If not logged in, or not an admin\n else if (!user || !user.admin) {\n return <h2>Access Denied</h2>\n }\n // If an admin, load up the specified component\n else {\n return <this.props.component />;\n }\n }", "render () {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t{/*Se coloca el titulo que va ha mostrar la pagina */}\n\t\t\t\t<h1>Pagina de Inicio</h1>\n\t\t\t</div>\n\t\t);\n\t}", "function MyApp({ Component, pageProps }) {\n return (\n <>\n <Head>\n <title>Valex - Dashboard</title>\n <meta name=\"description\" content=\"Generated by create next app\" />\n <link rel=\"icon\" href=\"/valex.png\" />\n <script src=\"//code-eu1.jivosite.com/widget/FcyQqOXV14\" async></script>\n </Head>\n <Provider store={store}>\n <GlobalStyle />\n <Component {...pageProps} />\n </Provider>\n </>\n );\n}", "function showSignup() {\n\n // if (Auth.loggedIn()) {\n // return (\n // <div>\n // <div className=\"AddPetSection\">\n // <UserInfo />\n // <PetList />\n // </div>\n // </div>\n // );\n // } else {\n // return (\n // <div>\n // <Signup />\n // </div>\n // );\n // }\n }", "render() {\n return <Welcome />\n }", "function Home() {\n return (\n <div className=\"pageContent\">\n <h2>Home</h2>\n </div>\n );\n}", "render(){\n\n\t\tlet userData = this.props;\n\n\t\treturn(\n\t\t\t<div className=\"container\">\n\t\t\t\t<div className=\"row\">\n\t\t\t\t\t<div className=\"col-12\">\n\t\t\t\t\t\t<h3>{userData.user_name}</h3>\n\t\t\t\t\t\t<h4>{userData.first_name} {userData.last_name}</h4>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}", "render() {\n\t\treturn (\n\t\t\t<div>[User Panel Placeholder]</div>\n\t\t)\n\t}", "function About() {\n return (\n <div className=\"About\">\n <div className=\"About-content\">\n <h1>\n Visual Workout Planner\n </h1>\n <p>\n Do you want help planning your next workout? This visual workout planner allows you to select any combination of muscles on the front- and back-facing muscle structures below to view exercises targetting those muscle groups. \n </p>\n </div>\n </div>\n );\n}", "render() {\n return (<h1>Hello World!!!!!!!!!!!!!!!!!!?????</h1>);\n }", "function Public() {\n return (<div>\n <h3>Heroes Food</h3>\n </div>\n );\n }", "function Info() {\n return (\n <div id='knowledgebase-info'>\n <h2>{'Build software engineering skills with your community'}</h2>\n <div id='knowledgebase-info-list'>\n <div id='icons'>\n <span className=\"icon-code\"></span>\n <span className=\"icon-lightbulb-o\"></span>\n <span className=\"icon-group\"></span>\n </div>\n <div id='list'>\n <p>\n <strong>{' Learn '}</strong>\n {'from people with knowledge'}\n </p>\n <p>\n <strong>{' Share '}</strong>\n {'your skills with people that want to learn'}\n </p>\n <p>\n <strong>{' Expand '}</strong>\n {'your network through skill sharing'}\n </p>\n </div>\n </div>\n </div>\n );\n}", "function App() {\n return (\n<div>\n\n<Homepage />\n\n</div>\n\n );\n}", "function home() {\n return (\n <div>\n \n </div>\n )\n}", "async function app() {\n //Render and display app logo\n renderLogo();\n //Inquirer \"home page\" which lists all options to the user\n appHome();\n}", "async function home(evt) {\n evt.preventDefault();\n hidePageComponents();\n currentUser = await checkForUser();\n\n if (currentUser.userId !== undefined) {\n hidePageComponents();\n $graphs.show();\n $links.show();\n $logoutBtn.show();\n $userBtn.text(`Profile (${currentUser.username})`);\n $userBtn.show();\n } else {\n $loginContainer.show();\n $welcome.show();\n $loginBtn.show();\n $loginForm.show();\n $signupBtn.show();\n $loginBtn.addClass(\"border-bottom border-start border-3 rounded\");\n }\n}", "render() {\n return html`\n ${this.__renderSideMenu(this.manifest)}\n `;\n }", "function displayFinalHelp() {\n console.log(\"------------------------ Cross Platform Application is Ready to use. ----------------------------\");\n console.log(\"\");\n console.log(\"Run your web app with:\");\n console.log(\" npm start\");\n console.log(\"\");\n console.log(\"Run your Mobile app via NativeScript with:\");\n console.log(\" iOS: npm run start.ios\");\n console.log(\" Android: npm run start.android\");\n console.log(\"\");\n console.log(\"-----------------------------------------------------------------------------------------\");\n console.log(\"\");\n}" ]
[ "0.6642912", "0.6210656", "0.6187553", "0.6055153", "0.597719", "0.5889682", "0.5876891", "0.5845281", "0.5842558", "0.5839484", "0.5830929", "0.58142823", "0.5812627", "0.5801304", "0.5799924", "0.5797609", "0.57963717", "0.57712054", "0.57552576", "0.5750901", "0.5750488", "0.573609", "0.57345515", "0.57205886", "0.57195365", "0.57130545", "0.57074237", "0.5659756", "0.5655076", "0.56513166", "0.56424284", "0.5626755", "0.5615948", "0.5608221", "0.560815", "0.56053126", "0.55921686", "0.5588986", "0.55870277", "0.5586429", "0.5586429", "0.55831015", "0.55788034", "0.55756307", "0.5569101", "0.55523515", "0.5543591", "0.5543063", "0.554186", "0.5541217", "0.553669", "0.5535762", "0.55197954", "0.55159193", "0.5509461", "0.5508627", "0.5505991", "0.5505043", "0.5503039", "0.5501141", "0.5498928", "0.5495384", "0.5493487", "0.5492195", "0.5486281", "0.5485992", "0.5483412", "0.54828197", "0.5481081", "0.5475606", "0.54746354", "0.5473908", "0.5472441", "0.5470677", "0.5463112", "0.5461519", "0.54590094", "0.54550546", "0.54532826", "0.54488593", "0.54463685", "0.5445329", "0.5441402", "0.5434965", "0.5431263", "0.5416057", "0.54156506", "0.5413997", "0.5410976", "0.54046726", "0.54033625", "0.540102", "0.53988194", "0.539312", "0.5389844", "0.53889424", "0.53887945", "0.5385668", "0.53851783", "0.53786594", "0.53771114" ]
0.0
-1
cette fonction appelle les fonctions d'affichage initiale.
function updateTeddyInfo(teddy) { //On injecte les données du teddy API dans le currentTeddy. currentTeddy.id = teddy._id currentTeddy.name = teddy.name currentTeddy.image = teddy.imageUrl currentTeddy.description = teddy.description currentTeddy.price = teddy.price/100 currentTeddy.quantity = 1 displayImageTeddy(currentTeddy) displayDescriptionTeddy(currentTeddy.description) displayPriceTeddy(currentTeddy) displayColorsTeddy(teddy) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function couleur()\n {\n\treturn 25000 * (0|pos_actuelle()/5 + 1);\n }", "function prepararejerciciorandom() {\n brillo = 0;\n contraste = 0;\n saturacion = 0;\n exposicion = 0;\n ruido = 0;\n difuminacion = 0; \n var elegido = [];\n var valores = [-40,-30,-20,-10,10,20,30,40];\n var valoresespeciales = [0,0,0,0,0,10,0,0,0,0,0];\n brilloejercicio = valores[Math.floor(Math.random()*(valores.length))];\n contrasteejercicio = valores[Math.floor(Math.random()*(valores.length))];\n saturacionejercicio = valores[Math.floor(Math.random()*(valores.length))];\n exposicionejercicio = valores[Math.floor(Math.random()*(valores.length))];\n ruidoejercicio = valoresespeciales[Math.floor(Math.random()*(valores.length))];\n difuminacionejercicio = valoresespeciales[Math.floor(Math.random()*(valores.length))];\n Caman(\"#canvasejercicio\", imgejercicio , function () {\n this.brightness(brilloejercicio);\n this.contrast(contrasteejercicio);\n this.saturation(saturacionejercicio); \n this.exposure(exposicionejercicio);\n this.noise(ruidoejercicio);\n this.stackBlur(difuminacionejercicio); \n this.render();\n });\n elegido = [brilloejercicio,contrasteejercicio,saturacionejercicio,exposicionejercicio,ruidoejercicio,difuminacionejercicio]\n return elegido;\n}", "function comportement (){\n\t }", "function prepararejercicio(){\n resetearimagenejercicio();\n brillo = 0;\n contraste = 0;\n saturacion = 0;\n exposicion = 0;\n ruido = 0;\n difuminacion = 0; \n elegido = prepararejerciciorandom();\n Caman(\"#canvasejercicio\", imgejercicio , function () {\n this.brightness(elegido[0]);\n this.contrast(elegido[1]);\n this.saturation(elegido[2]); \n this.exposure(elegido[3]);\n this.noise(elegido[4]);\n this.stackBlur(elegido[5]); \n this.render();\n });\n}", "afficherClassement() {\n const ctx = this.ctx;\n const etage = this.etage;\n\n if (etage <= 20) {\n $.Jeu.dessinerChinois(ctx, -100);\n $.Jeu.dessinerChinois(ctx, 500);\n }\n\n ctx.fillStyle = etage >= 21 ? getRandomColor() : '#000000';\n ctx.fillText('Votre Score : ' + (this.etage - 1), centreX, 50);\n ctx.fillText('Scoreboard', centreX, 125);\n let cpt = 1;\n $.classement.forEach(function(joueur) {\n ctx.fillStyle = etage >= 21 ? getRandomColor() : '#000000';\n ctx.fillText('#' + cpt + ' - ' + joueur['joueur'] + ' : '\n + joueur['score'], centreX, 135 + (60 * cpt++));\n });\n }", "cocina(){}", "function ca(a){this.c=Math.exp(Math.log(.5)/a);this.a=this.b=0}", "function ca(a){this.c=Math.exp(Math.log(.5)/a);this.b=this.a=0}", "function ca(a){this.c=Math.exp(Math.log(.5)/a);this.b=this.a=0}", "init() {\n roulette.data = utils.loadData();\n }", "function Co(t,e){0}", "function initAccordian() {\n \n}", "constructor(c_multiplier){\r\n\t\tthis.multiplier = c_multiplier;\r\n\t}", "function init(){\n //console.log(\"init: fin chargement page\"); //trace d'execution\n refSaisie = document.getElementById(\"saisie\");\n refVisuel = document.getElementById(\"cadreVisuel\");\n refAutomatiquement = document.getElementById(\"automatiquement\");\n refImgLoad = document.getElementById(\"imgLoad\");\n refBulle = document.getElementById(\"infoBulle\");\n\n refButtonActu = document.getElementById(\"buttonActu\");\n refFlecheID = document.getElementById(\"flecheID\");\n //lire l'état de la case (imposer un etat initia fixe) --> pour declancher la case (partie UX question 4eme version)\n}", "constructor(prix, type, proprietaire, nbALouer, nbAVendre, nbEtage){\n super(prix, type, proprietaire) //appeler le constructor de la class mere\n this.nbALouer = nbALouer\n this.nbAVendre = nbAVendre\n this.nbEtages = nbEtages\n }", "function Copcar(){}", "initializeRegularBeaker()\n {\n //Water should be some reasonable value.\n this.water = STARTING_WATER_LEVEL;\n\n //Everything else should be Zero.\n this.red = this.green = this.blue = 0;\n\n this.ph = 7.0;\n\n this.color = Difficulty_1_Colors.WATER;\n\n\n this.temperature = STARTING_TEMPERATURE;\n }", "function Ca(b) { this.c = Math.exp(Math.log(.5) / b); this.b = this.a = 0 }", "function principal() {\n choquecuerpo();\n choquepared();\n dibujar();\n movimiento();\n \n if(cabeza.choque (comida)){\n comida.colocar();\n cabeza.meter();\n } \n}", "function createInitialStuff() {\n\n\t//Sniðugt að búa til alla units í Levelinu hér og svoleiðis til \n\t// allt sé loadað áðurenn hann byrjar render/update\n\t//AKA það er betra að hafa þetta sem part af \"loading\" frekar en \n\t//byrjunar laggi\n}", "function init() {\r\n mode();\r\n setSq();\r\n reset();\r\n}", "constructor(){\n this.hull=20;\n this.firepower=5;\n this.accuracy=0.7;\n }", "function fm(){}", "function kottuConstructor(type,weight,price){\n\n this.type=type;\n this.weight=weight;\n this.price=price;\n this.sayType=function typeFunc(){\n console.log(\"Type= \"+this.type);\n },\n\n this.isSalty=function checkSalt(){\n console.log(\"this is \"+this.type+\" Kottu and it's Salty\");\n }\n}", "constructor(){\n this.chain = [this.createGenesisBlock()]; // array of blocks\n this.difficulty =5;\n }", "startup()\n\t{\n\t\tthis.angle = 1;\n\t\tthis.rows(5, 11, 1);\n\t\tthis.action(0);\n\t}", "init() {\n this.coinsCollected = 0\n }", "function init() {\r\n _lives = 5;\r\n _weapons = 10;\r\n }", "function initData() {\n initLtr_factor();\n initBosunit();\n initHero();\n initSelect25();\n initMS();\n}", "function init () {\n // Here below all inits you need\n }", "constructor(){\n\t\tthis.life=0;\n\t\tthis.magic=0;\n\t\tthis.strength=0;\n\t\tthis.dexterity=0;\n\t\tthis.damage_reduction_magic=0;\n\t\tthis.damage_reduction_strength=0;\n\t\tthis.damage_reduction_dexterity=0;\n\t\tthis.damage_increase_magic=0;\n\t\tthis.damage_increase_strength=0;\n\t\tthis.damage_increase_dexterity=0;\n\t\tthis.poison=0;\n\t\tthis.vampirism=0;\n\t\tthis.gold=0;\n\t\tthis.affinity=getRndInteger(0, 2);\n\t}", "function init() {\n\t\t$('#running').show();\n\t\t$('#walking').hide();\n\t\t$('#swimming').hide();\n\t\t$('#biking').hide();\n\t\t$('#strength').hide();\n\t\t$('#calorieCounter').submit(calculateCalories);\n\t\t$('#fitnessType').change(getPace);\n\t\t$('#calorieFitness').submit(calculateFitness);\n\t}", "init() {\n this.thinking = Math.round(Math.random() * 100 + 1);\n }", "adicionarCupom(codigo) {\n if (codigo === 'camp50') {\n this.cupom = 50 / 100;\n };\n }", "enterFactor(ctx) {\n\t}", "initializer() {\n this.level = 1;\n this.changeTagLevel(`Da click en el botón empezar juego`);\n this.chooseColor = this.chooseColor.bind(this);\n this.nextLevel = this.nextLevel.bind(this);\n this.removeButtonListener = this.removeButtonListener.bind(this);\n this.toggleBtnStart();\n this.colors = {\n celeste,\n violeta,\n naranja,\n verde\n };\n }", "function initCollectibles() {\n if (collectibles.key === true) {\n collectibles.key = new Key();\n }\n\n if (collectibles.life === true) {\n collectibles.life = new Star();\n }\n\n if (collectibles.gem === true) {\n collectibles.gem = new Gem();\n }\n }", "function init(){\n //call our setupModeButton function\n setUpModeButtons();\n //call our setUpSquares function\n setUpSquares();\n //call our resert function\n resert();\n}", "function actualiserAffichage(){\r\n\tactualiserStats(); //d'abord, et ensuite, l'affichage:\r\n\t$(\".sync\").each(function(){\r\n\t\tif(typeof($(this)[$(this).data('action')])=='function'){\r\n\t\t\t$(this)[$(this).data('action')](eval($(this).data('param')));\r\n\t\t}// l'eval est un peu moche mais bon\r\n\t});\r\n}", "function cinco() {\n\t\t\t\t\treturn 5;\n\t\t\t\t}", "constructor () {\n\t\tthis.coins = 0;\n\t}", "function init() {\n // EventListener\n document.getElementById(\"bKlausur\").addEventListener(\"click\", showKlausur);\n document.getElementById(\"bPunkte\").addEventListener(\"click\", function(){showPunkte(false)});\n document.getElementById(\"bAuswertung\").addEventListener(\"click\", function(){showAuswertung(false)});\n document.getElementById(\"bStatistiken\").addEventListener(\"click\", showStatistics);\n\n // Diese Klausur\n klausur = new Klausur();\n\n ensureAufgabenAnzahl(1);\n}", "function init() {\n //UH HUH, THIS MY SHIT!\n }", "constructor($element){ \r\n this.$element = $element;\r\n this.positionX = parseInt(this.$element.css(\"left\"));\r\n this.positionY = parseInt(this.$element.css(\"top\"));\r\n this.rayon = parseInt(this.$element.css(\"width\"));\r\n this.vitesseXFacteur = 1;\r\n this.limiteFacteur = 8 //faire en fonction de la largeur du terrain \r\n this.vitesseXSens = this.calculAleatoire();\r\n this.vitesseYSens = (Math.random()*6) - 3; //entre -3 et 3 : 0 fais du tout droit\r\n //this.vitesseYSens = 0;\r\n this.vitesseYFacteur = 1;\r\n this.centreX = this.positionX;\r\n this.centreY = this.positionY\r\n\r\n }", "function setUp(){\n // control blockly look and feel\n Blockly.HSV_SATURATION = 0.7;\n Blockly.HSV_VALUE = 0.97;\n }", "function Tc(a){this.Cb=new Sb(0,25);this.Wa(a)}", "function cargarpista1 (){\n \n}", "function initializeCryptex() {\n $('#clue1').click((event) => {\n const answer = answer1.prev();\n isFinalSolved(0, answer);\n });\n $('#clue2').click((event) => {\n const answer = answer2.prev();\n isFinalSolved(1, answer);\n });\n $('#clue3').click((event) => {\n const answer = answer3.prev();\n isFinalSolved(2, answer);\n });\n $('#clue4').click((event) => {\n const answer = answer4.prev();\n isFinalSolved(3, answer);\n });\n $('#clue5').click((event) => {\n const answer = answer5.prev();\n isFinalSolved(4, answer);\n });\n $('#clue6').click((event) => {\n const answer = answer6.prev();\n isFinalSolved(5, answer);\n });\n }", "function competitionFeeInit() {\n const action = {\n type: ApiConstants.API_REG_COMPETITION_FEE_INIT_LOAD,\n\n };\n return action;\n}", "call(ante) {\n this.currentHand.wager = ante > this.chips ? this.chips : ante;\n }", "constructor(bikeColour) {\n super(bikeColour);\n this.colour = bikeColour;\n this.cadence = 0;\n this.tireNum = 2;\n }", "function afficherLegendeCarte() {\n if (couvertureQoS == \"couverture\") {\n if (carteCouverture == \"voix\") afficherLegendeCarteCouvVoix();\n else if (carteCouverture == \"data\") afficherLegendeCarteCouvData();\n } else if (couvertureQoS == \"QoS\") {\n actualiserMenuSelectionOperateurs();\n if (agglosTransports == \"transports\") afficherLegendeCarteQoSTransport();\n else if(agglosTransports == 'agglos') afficherLegendeCarteQoSAgglos();\n else if(driveCrowd == \"crowd\") afficherLegendeCarteQoSAgglos();\n }\n}", "function crops_average_yield(){\n a_FAO_i='crops_average_yield';\n initializing_change();\n change();\n}", "constructor() {\n this.inicializar();\n this.generarSecuencia();\n this.siguienteNivel(); \n }", "function init() {\n challenger1 = new Challenger('challenger1', 'Name', 'challenger2');\n challenger2 = new Challenger('challenger2', 'Name', 'challenger1');\n //sets default values for two challenger objects\n setChallengerName('challenger1', challenger1.name);\n setChallengerName('challenger2', challenger2.name);\n //The text on the DOM is set here\n setMinNumber('1');\n setMaxNumber('100');\n setGuessResponse(challenger1, '');\n setGuessResponse(challenger2, '');\n setLastGuess(challenger1, '??');\n setLastGuess(challenger2, '??');\n generateRandomNumber();\n clearInputs();\n toggleDisableButton('reset', true, '#d0d2d3');\n }", "fearFactor() {\n return this.FEARFULNESS / 100;\n }", "thresholdMet() {}", "thresholdMet() {}", "constructor(){\n console.log('create calc one');\n }", "function initialisation () {\n // Initialisation du tableau\n var max = 0\n level == 1 ? max = 28 : max = 34;\n for (i = 0; i < max; i++) {\n const maDiv = createDiv(\"carte\")\n createDiv(\"cache\",maDiv)\n const image = createDiv(\"image\",maDiv)\n image.hidden = true\n image.style.background = \"url('images/cards.png')\"\n image.style.backgroundPosition = \"0 -\" + Math.floor(i/2)*100 + \"px\"\n array.push(maDiv);\n }\n\n //Mélange le tabeau\n shuffle(array)\n\n // AFFICHE LE TABLEAU\n array.map( t => document.getElementsByClassName(\"cartes\")[0].appendChild(t))\n\n //Initialise les clicks\n clickEnabled()\n\n // Initialise la progress bar\n progress(time)\n function clickEnabled () {\n Array.from(document.getElementsByClassName('carte')).map( t =>{\n t.onclick = () => {\n if(t.children[1].hidden == true){\n show(t,true)\n game.push(t)\n //SI deux cliques\n if(game.length == 2) {\n // Si ce n'est pas les bonnes paires\n if (game[0].children[1].style.backgroundPosition != game[1].children[1].style.backgroundPosition){\n //Désactive le clique\n clickDisabled()\n //Cache les cartes au bout d'une seconde\n setTimeout(() => {\n hide(game[0],true);\n hide(game[1],true);\n clickEnabled();\n },1000)\n } else {\n pairFound += 1 ;\n console.log(pairFound)\n max = level == 1 ? 28/2 : 34/2;\n pairFound == max ? win() : false ;\n }\n\n // Vide le tableau\n setTimeout(() => {\n game.splice(0,2);\n },1000)\n }\n }\n }\n } )\n\n\n function clickDisabled () {\n Array.from(document.getElementsByClassName('carte')).map( t =>{\n t.onclick = false\n })\n }\n }\n function progress(time) {\n var timer = document.getElementsByClassName(\"progress-bar\")[0].children[0]\n var width = 0\n progressbar = setInterval(() => {\n width += 100/(time/100) ;\n timer.style.width = width + \"%\";\n width > 50 ? timer.style.background = \"orange\" : \"\";\n width > 75 ? timer.style.background = \"red\" : \"\";\n if( width > 100) {\n clearInterval(progressbar);\n lose();\n }},100)\n\n }\n}", "initialInfect () {\n for (let i = 0; i < 9; i++) {\n const card = this.decks.infection.cards[0]\n this.infect(card, Math.floor(i / 3) + 1)\n }\n }", "function initCopia ()\r\n{\r\n this.wordActual = this.getNewWord ();\r\n index = this.wordActual;\r\n this.correcte = this.paraules[this.wordActual].paraula;\r\n this.actual = \"\";\r\n tabla =insertTable (this.correcte + \"&nbsp;\",this.actual + this.putCursor ('black'), this.estil);\r\n this.capa.innerHTML = tabla;\r\n this.putSound (this.paraules[index].so);\r\n validate=0;\r\n}", "function TamGiac(a,b,c){\n this.canhA = a;\n this.canhB = b;\n this.canhC = c;\n\n this.chuVi = () => this.canhA + this.canhB + this.canhC;\n\n this.dienTich = () => Math.round(Math.sqrt(this.chuVi()/2*(this.chuVi()/2*this.canhA)*(this.chuVi()/2*this.canhB)*(this.chuVi()/2*this.canhC)));\n}", "function createFareMultiplier(integar){\nreturn function (Multiplier) {\n return Multiplier * integar;\n }}", "initCompartmentsByParams () {\n this.compartment.infectious = this.param.initPrevalence\n this.compartment.susceptible =\n this.param.initPopulation - this.param.initPrevalence\n }", "function initialization() {\n\tcount = 0;\n\ttime = 0;\n\tspeedTimerSeconds = 0;\n\tspeedTimerMinutes = 0;\n\tstartTimer = false;\n\tstopTimer = false;\n\tnumMousePressed = 0;\n\tshuffle(pairs, true);\n\n\tfor (let i = 0; i < pairs.length; i++) {\n\t\tcovered[i] = true;\n\t}\n\tfor (let i = 0; i < 2; i++) {\n\t\tcurrentPair[i] = 0;\n\t}\n\n\t// resize card images\n\timgCardBack.resize(rectSize, 0);\n\timgDiamond.resize(rectSize, 0);\n\timgHeart.resize(rectSize, 0);\n\timgSpade.resize(rectSize, 0);\n\timgClub.resize(rectSize, 0);\n}", "function ContenedorImageness2r1rt1c1e1() {\n\t\tthis.initialize();\n\t}", "constructor() {\n this._settings = {\n type: 'textbox',\n title: 'ratioProtectMin',\n scope: SettingGroup['Torrent Page'],\n tag: 'Minimum Ratio',\n placeholder: 'ex. 100',\n desc: 'Trigger Ratio Warn L3 if your ratio would drop below this number.',\n };\n // An element that must exist in order for the feature to run\n this._tar = '#download';\n // Add 1+ valid page type. Exclude for global\n Util.startFeature(this._settings, this._tar, ['torrent']).then((t) => {\n if (t) {\n this._init();\n }\n });\n }", "constructor() {\n\n this.luminanceWeight = 1.0;\n this.equalColorTolerance = 30.0;\n this.dominantDirectionThreshold = 3.6;\n this.steepDirectionThreshold = 2.2;\n }", "inicializar() {\n this.elegirColor = this.elegirColor.bind(this);\n this.siguienteNivel = this.siguienteNivel.bind(this);\n this.toggleBtnEmpezar();\n this.nivel = 1;\n this.Ultimo_nivel = 10;\n this.colores = {\n celeste,\n violeta,\n naranja,\n verde,\n };\n }", "function init(cb){\n\n}", "function consola (){\r\n bienvenida_random();\r\n ayuda();\r\n}", "function intialisation() {\n console.log(\"Reintialisation\");\n initialiser = 1;\n fin = 0;\n tabPlaying = [0,0,0,0,0]; //Tableau à 0 quand le son est stoppé\n enCours = false; //Si les numéros sont entrain de tourner\n selectMatricule; //Matricule sélectionné\n pointsFixes = []; //Tableau comportant les coordonées des pastilles\n seuil = 1; //Seuil pour la fusion de détections trop proches\n suppresion = 0; //Variable pour compter le nombre de détections fusionées\n nbMatricule = 14; //Nombre de matricule\n numPrecedent = 10; //Retient le dernier nombre d'occurence\n //Scanne les tâches pour initialiser\n initialiserPointsFixes();\n if(debutCache) {\n debutCache = 0;\n setTimeout(function() {\n startNumber();\n cacheGomettes();\n }, 3000);\n }\n}", "function init(){\n\tinitColor();\n\tstop = false;\n\tchild_count = 0;\n\tred_func = randomPieceMealArray(num_r);\n\tgreen_func = randomPieceMealArray(num_g);\n\tblue_func = randomPieceMealArray(num_b);\n\trender();\n}", "chargement_initial(n) {\n for (let k = 0; k < 10; k++) this.tabLien[k] = k;\n this.tabLien.shuffle();\n this.tete = this.tabLien.splice(Math.floor(Math.random() * this.tabLien.length), 1);\n let t = this.tete;\n let i = t;//indice du bloc\n let a = 1;//numéro de l'enregistrement courant\n let cle = 3;\n let j = 0;\n let bloc = new bloc_LOVC();\n let res;\n while (a <= n) {\n res = bloc.insert_enreg(cle, j);\n j = res.dernier_car;\n if ((res.plein == true)&&((j > 0) || (a != n))) {\n let s = this.tabLien.splice(Math.floor(Math.random() * this.tabLien.length), 1);\n bloc.suivant = s;\n this.tab_blocs[i] = bloc;\n this.nb_blocs++;\n i = s;\n bloc = new bloc_LOVC();\n if (res.c == true) {\n bloc.tab[0] = cle;\n bloc.tab[1] = false;\n }\n if (res.bool == true)\n bloc.tab[0] = false;\n }\n cle = cle + 3;\n a++;\n }\n this.nb_blocs++;\n if(j == 0) j = bloc.max;\n this.b = j;\n bloc.suivant = -1;\n this.tab_blocs[i] = bloc;\n this.nbr_carac_init = bloc_LOVC.max * (this.tab_blocs.length - 1) + j;\n }", "function tirer_carte(f)\n{\n document.getElementById(\"jeu\").innerHTML = \"Tirez une carte\" + ((f) ? \"Chance\" : \"Communauté\") + \".\";\n validation.innerHTML = \"<input type=\\\"button\\\" value=\\\"Tirer une carte\\\" id=\\\"bouton_validation\\\"/>\";\n var v = document.getElementById(\"bouton_validation\");\n if(f)\n {\n v.addEventListener(\"click\", chance.bind(this, 1 + (0|Math.random()* 7)), false)\n }\n else\n {\n\tv.addEventListener(\"click\", caisse.bind(this, 1 + (0|Math.random()* 14)), false)\n }\n}", "function init() {\n\t\tscore = 0;\n\t\tclearScreen();\n\t\tspeed = DEFAULT_SPEED;\n\t\twell = new gameWell();\n\t\tactBlock = newActBlock();\n\t\tactBlock.draw();\n\t\tnextBlock.draw();\n\t}", "function init() {\n setUpModeButtons();\n setUpSquares();\n reset();\n}", "constructor(myBody){\n\t\tthis.body = myBody;\n \tthis.glucoseAbsorbed_ = 0;\n this.bAAToGlutamine_ = 0;\n this.lipolysisRate_ = 0;\n this.fat = (this.body.fatFraction_)*(this.body.bodyWeight_)*1000.0;\n\t}", "function c(e,t){0}", "constructor() {\r\n // Algorithm State\r\n this.reset();\r\n this.heuristic = \"euclidean\";\r\n }", "static lancerScenario(){\n Plateau.message = \"Début de la partie\";\n Plateau.initDisplay();\n Plateau.currentPlayer=-1;\n }", "__previnit(){}", "function pesticides(){\n a_FAO_i='pesticides';\n initializing_change();\n change();\n}", "constructor() { //fungsi math.floor adlah membulatkan angka ke bawah ke angka integer terdekat dan mengebalikan hasilnya\n this.numberofCars = [Math.floor(Math.random() * 4)];// fungsi angka 4 adalah jumlah mobil yang di tulisakan dalam parameter\n }", "function jeu_attaquerCA(me,cattaquante){\n\t\tmy_logger((me?PROMPT_ME:PROMPT_IA)+cattaquante.nom+ \" inflige dégat CA\");\n\t\tif (me){\n\t\t\t//infliger les dégats à l'adversaire\t\t\t\n\t\t\tpv_adv = pv_adv-cattaquante.ATT;\n\t\t\t$(\"#vieadv\").html(pv_adv);\t\t\n\t\t}else{\n\t\t\t//infliger les dégats à ME\t\t\t\n\t\t\tpv_me = pv_me-cattaquante.ATT;\n\t\t\t$(\"#vieme\").html(pv_me);\t\t\t\t\n\t\t}\n\t }", "constructor(number, suit){\n this.number = number;\n this.suit = suit;\n this._isFaceUp = false; \n }", "constructor() {\n this.createBaggage = utils_1.createBaggage;\n this.getBaggage = context_helpers_1.getBaggage;\n this.getActiveBaggage = context_helpers_1.getActiveBaggage;\n this.setBaggage = context_helpers_1.setBaggage;\n this.deleteBaggage = context_helpers_1.deleteBaggage;\n }", "replacerChangNiveau(){\n this.viderLaFile();\n this.cellule = this.jeu.labyrinthe.cellule(0,0);\n this.direction = 1;\n\t\t\t\tthis.vitesse = 0;\n }", "handdleValue(champ, value) {\n const { capacite, formulaire } = this.props;\n let newFormulaire = { ...formulaire };\n newFormulaire[champ] = value;\n const { neuf, mensualite, duree, taux, assurance, montant, info } = newFormulaire;\n capacite(neuf, mensualite, duree, taux, assurance, montant, info);\n }", "function init() {\r\n BEST_SCORE = 0;\r\n load();\r\n GameMenu.updateHighScore(BEST_SCORE);\r\n }", "bouger()\r\n {\r\n this.gauche += Math.cos(this.angle) * this.vitesseX;\r\n this.haut += Math.sin(this.angle) * this.vitesseY;\r\n\r\n //Fonctions annexes\r\n this.limite();\r\n this.majHTML();\r\n }", "static __initStatic4() {this.COMBO = 0.5}", "function IndicadorGradoAcademico () {}", "function princeCharming() { /* ... */ }", "function Bo(t,e){0}", "learnHelper(table, maxCore,feature1, fMostCore, size) {\n //if the corr> threshold => using Simple.\n super.learnHelper(table,maxCore,feature1,fMostCore,size);\n\n //else,if corr > 0.5 => using MinCircle.\n if(maxCore > 0.5 && maxCore < this.threshold) {\n\n //creates circle.\n const circle = this.findCircle(table.get(feature1), table.get(fMostCore), size);\n //creates corr feature.\n let cfs = new corrFeatures.CorrelatedFeatures();\n\n //upgrade the fields.\n cfs.isCircle = true;\n cfs.feature1 = feature1;\n cfs.feature2 = fMostCore;\n cfs.correlation = maxCore;\n cfs.threshold = circle.r * 1.1;\n cfs.centerX = circle.x;\n cfs.centerY = circle.y;\n\n //pushing the corrFeature into the array.\n this.cf.push(cfs);\n }\n\n }", "constructor(carColor, carEngine, carKm, model, price) {\n // in momentul in care creeam obiectul se apeleaza\n this.color = carColor;\n this.engine = carEngine;\n this.km = carKm;\n this.model = model;\n // this.runEngine = false;\n this.nrOfDoors = 4;\n this.price = price;\n }", "efficacitePompes(){\n\n }", "consstructor(){\n \n\n }", "function init() {\n\t \t\n\t }" ]
[ "0.5973901", "0.57983285", "0.5752512", "0.5707807", "0.56457245", "0.5631513", "0.56013596", "0.55607766", "0.55607766", "0.5559428", "0.5530206", "0.55271214", "0.55217355", "0.54889685", "0.547876", "0.54715264", "0.5465591", "0.5457149", "0.5447218", "0.5408577", "0.53679466", "0.53676194", "0.53589094", "0.53508776", "0.5343424", "0.53425074", "0.5340213", "0.5334113", "0.5321469", "0.5318137", "0.5312352", "0.52999955", "0.5298945", "0.52898264", "0.52857256", "0.5280903", "0.52806365", "0.5258196", "0.5250846", "0.52479565", "0.5236979", "0.52238744", "0.52236277", "0.5221803", "0.5216877", "0.5214741", "0.5210292", "0.5208777", "0.5205419", "0.51974815", "0.5194634", "0.51936793", "0.51912826", "0.51892704", "0.51725477", "0.51721007", "0.51672304", "0.51672304", "0.5160526", "0.5157772", "0.51566863", "0.5156127", "0.5146512", "0.5143528", "0.5135646", "0.512984", "0.5126957", "0.51262385", "0.51206475", "0.5116537", "0.5109094", "0.51088357", "0.5108664", "0.51030415", "0.5098772", "0.50967056", "0.50903034", "0.5089151", "0.5081132", "0.5072512", "0.5071579", "0.50691986", "0.50667834", "0.506527", "0.5065083", "0.50616026", "0.50602615", "0.5059002", "0.50540596", "0.5051416", "0.5051153", "0.5050767", "0.5049618", "0.5047849", "0.50365835", "0.50349015", "0.5033535", "0.5032859", "0.5032108", "0.5030628", "0.50296545" ]
0.0
-1
FUNCTIONS// /////////// Afficher l'image du teddy.
function displayImageTeddy(teddy) { let img = document.querySelector('#teddyImg') img.setAttribute("src", `${teddy.image}`) img.setAttribute("data-id", `${teddy._id}`) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function modifiedImgBack(image){\n image.src = image.id + '.jpg';\n }", "function changeImageLeavesBack() {\n document.images['white-duck-leaves'].src ='./assets/images/white-duck-leaves.png'\n }", "function changeImageMonocleBack() {\n document.images['white-duck-monocle'].src ='./assets/images/white-duck-monocle.png'\n }", "function MostraImagemPrincipal(img, imgId, imgPrincipal) {\r\n imgId.src = imgPrincipal;\r\n}", "function addImg (image) {\n jCooper.images.headshot2 = (image);\n console.log(jCooper.images.headshot2)\n}", "function changeImageMermaidBack() {\n document.images['white-duck-mermaid'].src ='./assets/images/white-duck-mermaid.png'\n }", "function changeImageLoveBack() {\n document.images['white-duck-love'].src ='./assets/images/white-duck-love.png'\n }", "function changeImageChillBack() {\n document.images['white-duck-chill'].src ='./assets/images/white-duck-chill.png'\n }", "function retrocederFoto() {\r\n // se incrementa el indice (posicionActual)\r\n\r\n // ...y se muestra la imagen que toca.\r\n }", "function changeImageGlassesBack() {\n document.images['white-duck-glasses'].src ='./assets/images/white-duck-glasses.png'\n }", "function changeImageUmbrellaBack() {\n document.images['white-duck-umbrella'].src ='./assets/images/white-duck-umbrella.png'\n }", "function muda_imagem(num_var_image) {\n //Função para mudar de imagem a cada clique do botão\n document.getElementById('var_image').src = \"_imagens/\" + num_var_image + \"_pub_image.png\";\n}", "function replaceImg()\n{\n\tthis.src = \"https://i.creativecommons.org/l/by/4.0/88x31.png\";\n}", "static updateImagePath() {\r\n if (game.user.isGM) {\r\n let tile = canvas.tiles.placeables.find(t => t.data.flags.turnMarker == true);\r\n if (tile) {\r\n canvas.scene.updateEmbeddedEntity('Tile', {\r\n _id: tile.id,\r\n img: Settings.getImagePath()\r\n });\r\n }\r\n }\r\n }", "function get_new_img (correct, ct){\r\n cd = correct;\r\n ct=$(cd).attr('title');\r\n if ((auto_alt_to_title == 'on')&&(!ct)) ct=$(cd).find('img').attr('alt');\r\n image_start_load();\r\n $(new Image())\r\n .attr('src',$(cd).attr('href'))\r\n .on('load', function(){\r\n $('#toxicbox .toxicbox_the_current_object,#toxicbox #toxicbox_text_frame, #toxicbox #toxicbox_close_image, #toxicbox #toxicbox_arrow_frame').remove();\r\n GetImages(ct);\r\n });\r\n}", "exibe(){\n image(this.imagem, this.x1, 0, width, height); //exibe a imagem na tela\n image(this.imagem, this.x2, 0, width, height);\n }", "function changeImageMonocle() {\n document.images['white-duck-monocle'].src = './assets/images/white-duck-monocle2.png';\n return true;\n }", "function changeImageLove() {\n document.images['white-duck-love'].src = './assets/images/white-duck-love2.png';\n return true;\n }", "function dh1(ob) {\r\n\tob.src = app_path_images+'history_active.png';\r\n}", "function cambiarImg(identificador,ruta) {\n $(\"#\"+identificador).attr(\"src\",ruta); \n}", "function changeImageChill() {\n document.images['white-duck-chill'].src = './assets/images/white-duck-chill2.png';\n return true;\n }", "function pasarFoto() {\r\n // se incrementa el indice (posicionActual)\r\n\r\n // ...y se muestra la imagen que toca.\r\n }", "function setImage()\n {\n var img = getId(\"captured_image\");\n \n var path = \"file:\" + Native.getImagePath();\n \n img.setAttribute(\"src\", path);\n }", "imageCreated(/* image */) {}", "function changeImageLeaves() {\n document.images['white-duck-leaves'].src = './assets/images/white-duck-leaves2.png';\n return true;\n }", "function img(ref, lang_dependant){ return (!lang_dependant ? pack_grafico + \"img/un/\" + ref : pack_grafico + \"img/\" + idioma + '/' + ref); }", "function img(ref, lang_dependant){ return (!lang_dependant ? pack_grafico + \"img/un/\" + ref : pack_grafico + \"img/\" + idioma + '/' + ref); }", "async setImage(id) {\n const reminder = await Storage.getReminder(id);\n if(reminder && reminder.img){\n Score.updatePenalties(id, 'imgHint'); \n return reminder.img; \n }else{\n return false; \n } \n }", "function updateImage(whichImage){\n memeDisplay = document.querySelector(\".meme-display img\")\n const PATH = `img/${whichImage}.png` // to access the img folder\n memeDisplay.src = PATH;\n memeDisplay.alt = PATH;\n }", "function changeImageMermaid() {\n document.images['white-duck-mermaid'].src = './assets/images/white-duck-mermaid2.png';\n return true;\n }", "function updatedinoPicture() {\r\n document.getElementById('dinoPic').src = './img/' + mistakes + '.png';\r\n}", "function viewImage(id,path_image) {\n var address='<img src={}>';\n document.getElementById(id).innerHTML=address.replace(\"{}\",path_image);\n}", "function noResaltarImatge(imgObj, num){\n imgObj.src = \"img/\"+num+\".jpg\";\n}", "function getImageInfo() {\n\n}", "function changeIMG(v){\n\tif(v == '2')\n\t\tnomeImagem = \"../../terra.png\";\n\tif(v == '1')\t\n\t\tnomeImagem = \"../../terrain.png\";\n\tif(v == '3')\n\t\tnomeImagem = \"../../perlin_heightmap.png\";\n\tinitTexture();\n}", "image(node, context) {\n const { origin, entering } = context;\n const result = origin();\n const httpRE = /^https?:\\/\\/|^data:/;\n if (httpRE.test(node.destination)){\n return result;\n }\n if (entering) {\n result.attributes.src = img_root + node.destination;\n }\n return result;\n }", "function TB_image() {\n\tvar t = this.title || this.name ;\n\tTB_show(t,this.href,'image');\n\treturn false;\n}", "function di20(id, newSrc) {\n var theImage = FWFindImage(document, id, 0);\n if (theImage) {\n theImage.src = newSrc;\n }\n}", "function up_fg_image(){\n var fg_can = document.getElementById(\"fg_can\");\n var fg_file = document.getElementById(\"fg_file\");\n fg_image = new SimpleImage(fg_file);\n fg_image.drawTo(fg_can);\n}", "function image_display() {\r\n\r\n}", "function changeImageAppleBack() {\n document.images['white-duck-apple'].src ='./assets/images/white-duck-apple.png'\n }", "function resaltarImatge(imgObj, num){\n imgObj.src = \"img/\"+num+\"b.jpg\";\n}", "function getCharacterImg(id){\n if (id < 10){\n id = \"0\" + id.toString()\n } \n return `../../asset/Yang_Walk_LR/Yang_Walk_LR_000${id}.png`\n }", "function changeTwitter(){\r\n document.getElementById('myimage1').src='../Screenshots/twitter white logo.png';\r\n}", "function CaricaFoto(img){\n\tfoto1= new Image();\n\tfoto1.src=(img);\n\tControlla(img);\n}", "function img_01(){\r\n\tdocument.getElementById(\"trocarimgtomada\").src =\"img/tomadas/img_01.png\"\r\n}", "function retrocederFoto() {\n if(posicionActual <= 0) {\n posicionActual = imagenes.length -1;\n\n } else {\n posicionActual--;\n }\n renderizarImagen();\n }", "function mudarImg() {\n document.getElementById(\"americoLIB\").src = \"img/imc1.jpg\";\n}", "function changeImageUmbrella() {\n document.images['white-duck-umbrella'].src = './assets/images/white-duck-umbrella2.png';\n return true;\n }", "function cambiaOn(){\n this.src = this.imagenOn.src; //tomamos los valores ya asociados\n}", "function showPic() {\r\n var nextImage = document.createElement(\"img\");\r\n nextImage.src = \"img/roles/\" + rolePics[0].fileName;\r\n nextImage.id = rolePics[0].id;\r\n nextImage.alt = rolePics[0].altText;\r\n document.querySelector(\".DnD__toDrag-img\").appendChild(nextImage);\r\n}", "function expandedImageUrl(photo_id) {\n //return 'http://oldnyc-assets.nypl.org/600px/' + photo_id + '.jpg';\n //return 'http://192.168.178.80/thumb/' + photo_id + '.jpg';\n return 'http://www.oldra.it/thumb/' + photo_id + '.jpg';\n}", "function trocarImagemPrincipalExibida(path) {\n $('#dvImgPrincipal').attr('src', path);\n}", "function drawinst(){\r\n\tctx.drawImage(imgft,0,0,948,535,0,0,800,400);\r\n}", "dibujarEnemigo(e) {\n this.app.image(e.tipo, e.x, e.y);\n }", "function IDtoImage(id){\n\tvar scale = '1.0'\n\treturn 'https://static-cdn.jtvnw.net/emoticons/v1/' + id + '/' + scale;\n}", "function renderImages() {\n imgElem.src = Actor.all[0].path;\n}", "function snap_image() {snap_image_count++; return ('image' + snap_image_count.toString() + '.png');}", "function retrocederFoto() {\n if(posicionActual <= 0) {\n posicionActual = IMAGENES.length - 1;\n } else {\n posicionActual--;\n }\n renderizarImagen();\n }", "function changeFooterImageBack() {\n document.images['footerImage'].src ='./assets/images/white-duck-sad.png'\n }", "function cambiaOff() {\n this.src = this.imagenOff.src; //tomamos los valores ya asociados\n}", "function carregarImagem( img ){\n \n var caminho = img.substr(51);\n \n \n carregar = new Image();\n carregar.src = \"/gestaopessoas/fwk/uploads/imagens/\" + caminho;\n \n document.getElementById(\"imagemView\").innerHTML = \"Carregando...\";\n setTimeout( \"verificaCarregamento()\", 1 );\n}", "function changeBoxTwoImageBack() {\n document.images['box-two-image'].src ='./assets/images/white-duck-reading.png'\n }", "function rollingDice() {\n let img = document.getElementById('temp-image');\n img.src = 'dicer.gif';\n }", "checkImg(el){\r\n let pathImg = el.poster_path\r\n let img = \"\"\r\n if(!pathImg){\r\n img = \"no-img.png\"\r\n }else{\r\n img = 'https://image.tmdb.org/t/p/w342/'+ pathImg\r\n }\r\n return img\r\n }", "function changeImageWizardBack() {\n document.images['white-duck-wizard'].src ='./assets/images/white-duck-wizard.png'\n }", "function getImage(tipo,rarita) {\n\n return \"img/\"+tipo.toString()+rarita.toString()+\".jpg\";\n}", "function updateImage(tileElem, tile) {\n tileElem.style.visibility = (tile === Tile.Empty) ? \"hidden\" : \"visible\";\n var image = tileToImage[tile.name] || \"Rock\";\n tileElem.src = \"resources/\"+image+\".png\";\n }", "function asignaImagen(num){\n\n\t\tdocument.querySelector(\"#imagen\").src=\"assets/img/compromisos+/c\"+num+\".png\";\n\n\t}", "getImage(){\n return '';//This might change later, we will see what I want this to be\n }", "function replace_image(image) {\r\n image.src = \"images/no_image.png\";\r\n}", "function updateImage(url) {\n //Select the image from the htnl\n var image = document.getElementById('myImage');\n\n //Set to default img\n if (url === null | typeof url === \"undefined\") {\n url = defaultLargeBoxArt;\n }\n\n //Update the image in the html\n image.src = url;\n}", "function dc1(ob) {\r\n\tob.src = app_path_images+'balloon_left.png';\r\n}", "function img_parede_01(){\r\n\tdocument.getElementById(\"trocarimgparede\").src =\"img/parede/img_01.jpg\"\r\n}", "function buttonSave() {\n image(imgSave, 475, 550);\n}", "function replaceImage(image) {\n image.onerror = \"\";\n image.src = 'https://archiveshub.jisc.ac.uk/images/contrlogos/valogo.jpg';\n return true;\n}", "function changeImageGlasses() {\n document.images['white-duck-glasses'].src = './assets/images/white-duck-glasses2.png';\n return true;\n }", "function pasarFoto() {\n if(posicionActual >= IMAGENES.length - 1) {\n posicionActual = 0; \n } else {\n posicionActual++;\n }\n renderizarImagen();\n }", "function adriPsycho01(){\r\n\tdocument.getElementById('adriPsycho').src='img/imgNosotros/01-01.jpg'\r\n}", "function toute(){\r\n\tdocument.getElementById(\"front_image\").src=\"Assets/Images/iphone1.png\";\r\n}", "function changeImage() {\n // Gets the selected images value and assigns it to a variable\n var imgVal = getValue(imgSelect);\n\n // Changes the image path using the imgVal variable\n card.children[0].children[0].attributes[0].textContent = \"assets/\" + imgVal + \".jpg\";\n }", "function ImageHelper() { }", "function changeImage(imageID, imageFile)\n{\n var url = imageFile;\n document.getElementById(imageID).src = url;\n addDisplayed = 2;\n\n} // end of changeImage", "function imgVeranderendbl() {\n if (status == 'foto') {\n imgg.src = 'images/foto9.JPG';\n status = 'foto8';\n return status;\n } else if (status == 'foto1') {\n imgg.src = 'images/foto9.JPG';\n status = 'foto8';\n return status;\n } else if (status == 'foto2') {\n imgg.src = 'images/foto9.JPG';\n status = 'foto8';\n return status;\n } else if (status == 'foto3') {\n imgg.src = 'images/foto9.JPG';\n status = 'foto8';\n return status;\n } else if (status == 'foto4') {\n imgg.src = 'images/foto9.JPG';\n status = 'foto8';\n return status;\n } else if (status == 'foto5') {\n imgg.src = 'images/foto9.JPG';\n status = 'foto8';\n return status;\n } else if (status == 'foto6') {\n imgg.src = 'images/foto9.JPG';\n status = 'foto8';\n return status;\n }\n}", "function drawImage(image, isTx) {\n g.clear();\n g.drawImage(require(\"heatshrink\").decompress(atob(image)), EMOJI_X, EMOJI_Y);\n if(isTx) {\n g.drawImage(require(\"heatshrink\").decompress(atob(TX)), TX_X, TX_Y);\n }\n else {\n g.drawString(\"< Swipe >\", g.getWidth() / 2, g.getHeight() - FONT_SIZE);\n }\n g.flip();\n}", "function genImg(imgNum){\n // add alt image\n}", "function updateImg() {\n context.drawImage($tmpCanvas[0], 0, 0); \n tmpContext.clearRect(0, 0, canvasWidth(), canvasHeight());\n }", "function chgImg(direction) {\n if (document.images) {\n forecast.ImgNum = forecast.ImgNum + direction;\n\n if (forecast.ImgNum > forecast.ImgLen) {\n forecast.ImgNum = 0;\n }\n if (forecast.ImgNum < 0) {\n forecast.ImgNum = forecast.ImgLen;\n }\n document.querySelector('#forecast-imgs img').src = '../../' + forecast.OpsImgs[forecast.ImgNum];\n forecast.datespec = forecast.OpsImgs[forecast.ImgNum].substr(-14,10);\n document.getElementById('forecast-slider').value = forecast.ImgNum;\n changeDateTime();\n }\n}", "function renderImage(data) { \n //function takes image from data\n //replaces our dog image with data.image\n \n dogImage.src = data.message\n}", "draw() {\r\n if(this.type === 'dog') {\r\n this.image.src = '../images/dog.png';\r\n } else {\r\n this.image.src = \"../images/banana.png\";\r\n }\r\n context.drawImage(this.image, this.x, this.y, this.width, this.height);\r\n }", "function updateImg(newImg) {\r\n $(\"#detailPic\").attr(\"src\",newImg.photoDetail);\r\n}", "function breedImage() {\n document.querySelector(\"#breedImage\").innerHTML =\"\";\n // Create Image of Dog Breed\n var div = document.querySelector(\"#breedImage\");\n var img = document.createElement(\"img\");\n img.setAttribute(\"src\", \"assets/img/breeds/\" + (dogBreedArray[i]) + \".jpg\");\n img.setAttribute(\"alt\", (dogBreeds[dogBreedArray[i]].breed));\n div.appendChild(img);\n}", "function revice_Img(ID) {\t// when mouse out\n\n var Revice_Img = $('#' + ID).attr('src');\n var Revice_value = $('#' + ID).val();\n\n if (Revice_Img.match('gif')) {\n if (Revice_value == 0)\n Revice_Img = Revice_Img.replace('-1.gif', '-2.gif');\n else\n Revice_Img = Revice_Img.replace('-1.gif', '.gif');\n }\n else\n Revice_Img = Revice_Img.replace('-1.jpg', '.jpg');\n\n $('#' + ID).attr('src', Revice_Img);\n}", "function bad_image(image) {\n image.src = \"images/product_default_image.png\";\n}", "function drawImage() {\n var stat = getState(cm);\n var url = \"http://\";\n _replaceSelection(cm, stat.image, insertTexts.image, url);\n}", "function changeImage(arg) {\n var exchange = arg.src;\n mimage.src = exchange;\n}", "function pasarFoto() {\n if(posicionActual >= imagenes.length -1) {\n posicionActual = 0;\n } else {\n posicionActual++;\n }\n renderizarImagen();\n }", "function changeInstagram(){\r\n document.getElementById('myimage3').src='../Screenshots/instagram white logo.jpg'\r\n}", "function showOriginalImage(id) {\r\n var photo = images[id];\r\n document.getElementById(\"image-title\").innerHTML = photo.title;\r\n document.getElementById(\"image-content\").innerHTML =\r\n '<img src=\"https://farm' +\r\n photo.farm +\r\n '.staticflickr.com/' +\r\n photo.server +\r\n '/' +\r\n photo.id +\r\n '_' +\r\n photo.secret +\r\n '_z.jpg' +\r\n '\" alt=\"' +\r\n photo.title +\r\n '\"/>';\r\n document.getElementById(\"image\").className += \" visible\";\r\n}", "function characterImg(){\n if(gameMode == 2|| gameMode ==4){\n image(characterArray[currentCharacter],30,150,450,450);\n }\n}" ]
[ "0.71838117", "0.6633162", "0.660354", "0.6599721", "0.6592838", "0.6565422", "0.6547703", "0.65361184", "0.6443637", "0.6437124", "0.64339244", "0.641671", "0.64162356", "0.63826543", "0.6374062", "0.6373162", "0.63620394", "0.63503903", "0.6348611", "0.63473195", "0.6339134", "0.62992096", "0.62987894", "0.6291841", "0.62784874", "0.62761366", "0.62761366", "0.62609553", "0.62579393", "0.6227654", "0.6218565", "0.62154466", "0.6212472", "0.6201582", "0.62011504", "0.620074", "0.61977804", "0.6192183", "0.61878896", "0.61801434", "0.6175436", "0.61748064", "0.61669093", "0.6147127", "0.61381817", "0.6129693", "0.6127598", "0.6110487", "0.61094546", "0.60853904", "0.60761577", "0.6074446", "0.6073476", "0.6069175", "0.6067884", "0.6061241", "0.6057555", "0.6053627", "0.60473984", "0.60437435", "0.60426193", "0.6039405", "0.6037046", "0.60308355", "0.602646", "0.6025983", "0.60223377", "0.60186124", "0.6012603", "0.6009126", "0.6003734", "0.6001387", "0.5995028", "0.5994821", "0.59926593", "0.59915686", "0.59912944", "0.59859353", "0.59859174", "0.5984188", "0.5981372", "0.597381", "0.59716946", "0.5971141", "0.59687066", "0.596853", "0.59650236", "0.59647346", "0.59644645", "0.5961653", "0.5961167", "0.5958527", "0.59584904", "0.5956425", "0.59547675", "0.5954139", "0.5952383", "0.594996", "0.59498113", "0.59494007" ]
0.75115514
0
Afficher la description du teddy.
function displayDescriptionTeddy(teddyDescription) { let desc = document.querySelector('#description') desc.innerHTML = teddyDescription }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get descripion() {\n return this._descripion\n }", "afficherDescription() {\n return (\n this.nom\n + ' est '\n + this.couleur\n + ' pèse '\n + this.poids\n + ' grammes et mesure '\n + this.taille\n + ' centimètres.'\n );\n }", "getDescription() {\n return \"Nom : \"+this.nom+\"\\nAge : \"+this.age+\"\\nProfession : \"+this.profession;\n }", "get description() {\n return this.getStringAttribute('description');\n }", "get description() {\n return this.getStringAttribute('description');\n }", "get description() {\n return this.getStringAttribute('description');\n }", "get description() {\n\t\treturn this.__description;\n\t}", "get description() {\n\t\treturn this.__description;\n\t}", "get description() {\n\t\treturn this.__description;\n\t}", "get description() {\n\t\treturn this.__description;\n\t}", "get description() {\n\t\treturn this.__description;\n\t}", "get description() {\n return this._data.description;\n }", "getDescription() {\n let desc = super.getDescription();\n\n if (this.hasMajor()) {\n desc += ` Their mayor is ${this.major}`;\n }\n\n return desc;\n }", "get description () {\n\t\treturn this._description;\n\t}", "get description () {\n\t\treturn this._description;\n\t}", "get description () {\n\t\treturn this._description;\n\t}", "get description () {\n\t\treturn this._description;\n\t}", "get description () {\n\t\treturn this._description;\n\t}", "get description () {\n\t\treturn this._description;\n\t}", "get description () {\n\t\treturn this._description;\n\t}", "get description () {\n\t\treturn this._description;\n\t}", "get description () {\n\t\treturn this._description;\n\t}", "get description () {\n\t\treturn this._description;\n\t}", "get description () {\n\t\treturn this._description;\n\t}", "get description () {\n\t\treturn this._description;\n\t}", "function dayDescr(iii) {\n\t\treturn m(\"p.blog-post\",\n\t\t\t[iii.pdesc,\n\t\t\t\tm(\"a[href=\" + iii.pdescLink1 + \"]\",\n\t\t\t\t\tiii.pdescLinktag1\n\t\t\t\t),\n\t\t\t\tiii.pdesc2,\n\t\t\t\tm(\"a[href=\" + iii.pdescLink2 + \"]\",\n\t\t\t\t\tiii.pdescLinktag2\n\t\t\t\t),\n\t\t\t\tiii.pdesc3,\n\t\t\t\tm(\"a[href=\" + iii.pdescLink3 + \"]\",\n\t\t\t\t\tiii.pdescLinktag3\n\t\t\t\t)\n\t\t\t]);\n\t}", "get description() {\n const dontDefault = 'I don\\'t have';\n const type = `I am a ${this.sex} ${this.type} from the ${this.subtype} family.\\n`;\n const nameAndSound = `My name is ${this.name} and I make sounds like \"${this.makeNoise()}\"\\n`;\n const breed = this.breed ? `I am a ${this.breed} breed.\\n` : '';\n const legs = 'I have ' + (this.legs ? `${this.legs} legs` : `${this.flippers} flippers (and a tail too!)\\n`);\n const tail = this.tail ? `I have a ${this.tail} tail` : `${dontDefault} a tail\\n`;\n const ears = this.ears ? `${this.ears} ears.` : `${dontDefault} ears.\\n`;\n\n return console.log(`Hey there!\\n${nameAndSound}${type}${breed}${legs}${tail} and ${ears}`);\n }", "getDescription() {\n let description = super.getDescription();\n\n if(this.hasMajor()){\n description += `Their major is ${this.major}.`;\n }\n\n return description;\n }", "get description() {\n return this.getText('description');\n }", "getDescription() {\n return `${this.name} is ${this.age} ${this.age > 1 ? 'years' : 'year'} old.`;\n }", "function descriptionCheck() {\n\t\tlet desc;\n\t\tif (detail.description === null) {\n\t\t\treturn desc = \"No description given\"\n\t\t}\n\t\telse {\n\t\t\treturn desc = detail.description\n\t\t}\n\t}", "function decrire(personnage) {\n var description = personnage.nom + \" a \" + personnage.sante + \" points de vie et \" + personnage.force + \" en force\";\n return description;\n}", "description() {\n if (this._description) {\n return this._description;\n }\n for (let i = 0; i < this.sections.length; i++) {\n const section = this.sections[i];\n if (!section.doc) {\n continue;\n }\n const desc = this.extractDescription(section.markedDoc());\n if (desc) {\n this._description = desc;\n return desc;\n }\n }\n return '';\n }", "get description() { return this._description; }", "get description() {\n var _this$props$get;\n\n const value = (_this$props$get = this.props.get('description')) === null || _this$props$get === void 0 ? void 0 : _this$props$get.value;\n if (!value) return '';\n return value;\n }", "get description () {\r\n // checking dialog stage\r\n if (!this.context.dialog) {\r\n this.context.dialog = 0;\r\n }\r\n // displaying text for the current stage\r\n return phrases[this.context.dialog];\r\n }", "function Description(props) {\n if (clothing.desc) {\n return (<div> <SubHeading> <div> Description</div></SubHeading>\n <Desc> {clothing.desc} </Desc></div>\n\n\n );\n } else {\n return (<div></div>);\n }\n }", "function get_description (da_object) {\n\tconst artist = string_to_node(da_object.deviation.author.username);\n\tconst title = string_to_node(da_object.deviation.title);\n\tconst description = string_to_node(da_object.deviation.extended.description);\n\n\treturn artist_commentary(artist, title, description);\n}", "function dailyDescription() {\n return `No meatballs today: ${weather.description} currently. The high will be ${weather.temp_max} °F with a low of ${weather.temp_min} °F`;\n}", "toPageDescription() {\n let description;\n if ((description = this.metaOverrides('description'))) {\n return description;\n } else if (this.isGeographic()) {\n return `Explore art by artists who are from, or who have lived in, ${this.get('name')}. Browse works by size, price, and medium.`;\n } else {\n return _s.clean(this.mdToHtmlToText('description'));\n }\n }", "get humanDescription() {}", "function deductibleDescription() { \n return gapPlanData.description();\n}", "getDescription() { \n let description = ''\n let pageConfig = Config.pages[this.page] || {}\n \n if( this.isBlogPost) {\n description = this.post.frontmatter.description || this.post.excerpt\n }\n else {\n description = pageConfig.description || Config.description\n }\n \n return description\n }", "get planetDescription() {\n return this.description\n }", "get htmlDescription(){\n var desc = \"\";\n if(Object.keys(this.inventory).length == 0){\n return '<p>! Gather Resources !</p>';\n }\n else{\n for(var key in this.inventory){\n var value = this.inventory[key];\n desc += \"<p class='resource'>\" + key + \": \" + value + \"</p>\";\n }\n return desc;\n }\n }", "function getDescription() {\n return @tal_plug_desc;\n}", "get engineDescription() {\n return this.getStringAttribute('engine_description');\n }", "function description() {\n //check if not exist data description\n if(!book.volumeInfo.description){\n //return default description\n return 'No description available for this book, contact API administrator to add one :)'\n } else return book.volumeInfo.description\n }", "getDescription(descriptionObj) {\n // Uncomment to view inconsistencies\n // const descStart = descriptionObj.lastIndexOf('<p>');\n // const description = descriptionObj.slice(descStart + 3, descriptionObj.length - 4);\n\n const description = 'A dummy description of the Flickr image, please view FlickrImage.js to see reasoning for using this here.'\n return description;\n }", "get description () {\n return `${this.name} is a ${this.breed} type of dog`;\n }", "function generateDescription( description ) {\n return `## Description\n\n ${description}`;\n}", "function getDescription(){\n\t\tvar str = \"Draw Tool\";\n\n\t\treturn str;\n\t}", "function getDescription(dog) {\n console.log(dog.description);\n\n}", "shortDescription(contenu){\n\t\tlet desc = contenu.slice(0, 250);\n\t\treturn desc + \" ...\";\n\t}", "getDescription() {\n return this.cl_.getDescription();\n }", "function getDescription(){\n\t\tvar str = \"Select Tool\";\n\n\t\treturn str;\n\t}", "function descriptionCreature(Creature) {\n if (Creature.gender == \"женщина\") {t0 = \"ась\"; t1 = \"Она\"; t2=\"я\"; t3=\"ла\" } else {t0 = \"ся\"; t1=\"Он\"; t2=\"й\";; t3=\"л\" }\n count0 = allCreatures.length>1 ? `И стало их ${allCreatures.length} на планете.` : ``;\n let txt = `Родил${t0} ${Creature.subType}-${Creature.gender} ${Creature.name} в год ${Creature.generation}-й. `;\n txt += `${t1} - ${Creature.id+1}-${t2} из всех. ${count0} ${t1} говори${t3}: ${Creature.mood}`;\n Log(txt,\"Born\");\n /* let txt = `A ${Creature.subType}-${Creature.gender} ${Creature.name} was born in generation ${Creature.generation}. `;\n txt1 = Creature.gender == \"female\" ? \"She\" : \"Hi\";\n txt += `${txt1} was № ${Creature.id} of all. Now their ${allCreatures.length}. ${txt1} said: ${Creature.mood}`; */\n}", "function Description(obj) { this.obj = obj; }", "function DisplayDesc() {\n\t\tif (props.powerPro.boss === 0) {\n\t\t\treturn (\n\t\t\t\t<p>\n\t\t\t\t\tYou enter the generator room and are standing on a landing. You notice\n\t\t\t\t\ta catwalk stretching the length of the room. In the center of the room\n\t\t\t\t\tis a cyborg scientist working at a console.\n\t\t\t\t</p>\n\t\t\t);\n\t\t} else {\n\t\t\treturn (\n\t\t\t\t<p>\n\t\t\t\t\tYou return to the generator room. Dr. Crackle is working at his\n\t\t\t\t\tconsole once again.\n\t\t\t\t</p>\n\t\t\t);\n\t\t}\n\t}", "function TextDesc() {\n\tthis.text = '';\n\tthis.xml_id = '';\n//\tthis.custom = '';\n}", "ShowDetails(typetype, dietype, sizetype) {\n let desc = `This is ${this.name} and they are a ${this.GetType(typetype)}. This creature has a ${this.GetDiet(dietype)}. ${this.name} is a ${this.GetSize(sizetype)} organism.`;\n }", "static DESC(){\n return \"DESC\";\n }", "function descriptionForPhotoId(photo_id) {\n var info = infoForPhotoId(photo_id);\n var desc = info.title;\n if (desc) desc += ' ';\n var date = info.date.replace(/n\\.d\\.?/, 'No Date');\n if (!date) date = 'No Date';\n desc += date;\n return desc;\n}", "get description() {\n return this.catalogItemObj.itemData.description;\n }", "describe() {\n return \"You've walked into the \" + this._name + \", \" + this._description;\n }", "get description() {\n return this._cloudObj.get(\"description\");\n }", "function getDescription() {\n const lorem = 'lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse bibendum quam non purus semper viverra. Aenean tristique rhoncus velit lobortis faucibus';\n const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n const loremArr = lorem.split(' ');\n const descArr = loremArr.slice(0, getRandomInt(4, loremArr.length));\n return randomSelect(chars) + descArr.join(' ') + '.';\n}", "function setDescription(json) {\n var description = JSON.stringify(json.weather[0].description);\n $('.description').html(description.substr(1, description.length - 2));\n}", "function createDescription(rowID) {\n var description = \"\";\n var rs = global.db.execute('SELECT StartDate, StopDate FROM Times ' +\n 'WHERE ROWID = (?)', [rowID]);\n\n if (rs.isValidRow()) {\n var sDate = rs.field(0);\n var eDate = rs.field(1);\n\n var time = (((eDate - sDate)/1000)|0); // elapsed time in seconds\n var startDate = new Date();\n startDate.setTime(sDate);\n\n description = startDate.toLocaleDateString() + \" -- \";\n description += formatTime(time);\n description += positionInformation(rowID);\n\n global.db.execute('UPDATE Times SET Description = (?) ' +\n 'WHERE ROWID = (?)', [description, rowID]);\n }\n\n return description;\n}", "function Description(def) {\n if(typeof def === 'string') {\n this.parse(def);\n }else if(def\n && typeof def === 'object'\n && typeof def.txt === 'string'\n && typeof def.md === 'string') {\n this.md = def.md;\n this.txt = def.txt;\n }else{\n throw new Error('invalid value for description');\n }\n}", "function weatherDesc(time) {\n return openWeatherExApiData.list[time].weather[0].description;\n}", "function toggleDescription() {\n self.showingDescription = !self.showingDescription;\n }", "function ShowDescription() {\n\tcurrentTaskNumber = 'tdl_' + localStorage.getItem('CurrentTask');\n\tvar task = ucFirst(JSON.parse(localStorage.getItem(currentTaskNumber))[0]);\n\tvar description = JSON.parse(localStorage.getItem(currentTaskNumber))[1];\n\t\n\t//if (task.length > 13)\n\t\t//task = task.substr(0, 13) + \"...\";\n\t\n\thtmlTask = document.getElementById(\"titleTask\").innerHTML;\n\thtmlDescription = document.getElementById(\"description\").innerHTML;\n\t\n\tdocument.getElementById(\"description\").innerHTML = htmlDescription + description;\n\tdocument.getElementById(\"titleTask\").innerHTML = htmlTask + task;\t\n\t\n\tif (description == \"\") {\n\t\t$(\".card\").remove();\n\t}\n}", "get details() {\n if (this._researchSubject.researchStudy && this._researchSubject.researchStudy.commentOrDescription) {\n return this._researchSubject.researchStudy.commentOrDescription.value;\n } else {\n return \"\";\n }\n }", "function shortDescription() {\n\tconst metas = document.getElementsByTagName('meta');\n\tconst scripts = document.getElementsByTagName('script');\n\t// Check if description was protected\n\tfor (var i = 0; i < scripts.length; i++) {\n\t\tif (scripts[i].innerHTML.indexOf(\"key: 'ds:5', isError: false\") > 0) {\n\t\t\tvar scriptBlock = scripts[i].innerHTML.split(',[null,');\n\t\t\treturn scriptBlock[1].substring(1, scriptBlock[1].indexOf('\"]'));\n\t\t}\n\t}\n\t// Get description if was on metas\n\tfor (let i = 0; i < metas.length; i++) {\n\t\tif (metas[i].getAttribute('name') == 'description') {\n\t\t\treturn metas[i].getAttribute('content');\n\t\t}\n\t}\n}", "function description(name) {\n var desc = document.querySelector('#description');\n var description = document.createElement('div');\n description.className = 'description';\n description.innerHTML = name;\n desc.appendChild(description);\n}", "function getSpeechDescription (item) {\n let sentence = item.Explanation\n return sentence\n}", "function renderDescription(){\n let shortText = JSON.stringify(text).substr(1, 21);\n return <p className=\"card-text\">{ shortText }...</p>\n }", "setDescription(description) {\n this.description.setValue(description);\n }", "get decription(){\n console.log(this.inventory);\n var desc = \"You have:\\n\";\n\n for(var key in this.inventory){\n var value = this.inventory[key];\n desc += value + \" \" + key + \"\\n\";\n }\n\n return desc;\n }", "function showdesc(thisdesc) {\n\t\t\t\tthisdesc.intpause();\t//clear interval\n\t\t\t\ttitle.style.display=\"none\";\n\t\t\t\tvar readTimer = setTimeout(function() {hidedesc(thisdesc)}, thisdesc.config.readInterval); //sets timeout for the description\n\t\t\t\tdescription = document.createElement(\"div\");\n\t\t\t\tdescription.className = \"infoCenter\";\n\t\t\t\tdescription.innerHTML = thisdesc.newsItems[thisdesc.activeItem].description;\n\t\t\t\tdescription.addEventListener(\"click\", () => hidedesc(thisdesc)); //Hide description on click\n\t\t\t\tdescription.addEventListener(\"click\", () => clearTimeout(readTimer)); //Stop timer when clicked so the next title doesn't reload again.\n\t\t\t\twrapper.appendChild(description);\n\n\t\t\t}", "get linkedServiceDescription() {\n return this.getStringAttribute('linked_service_description');\n }", "get description()\n\t{\n\t\texchWebService.commonAbFunctions.logInfo(\"exchangeAbFolderDirectory: get description\\n\");\n\t\treturn this._description;\n\t}", "set description(value) { this._description = value; }", "getShopDescription(character) {\n return __(\"Loot extra Clues in the Scholar District for 7 days.\");\n }", "function addDescription() {\n var d, f, b, v;\n setTimeout(function() {\n d = getDate();\n f = getUserName();\n b = $('#Description, #description, #descr-textarea-id');\n v = d + ' by ' + f + '\\n';\n b.length && !b.val() && b.val(v);\n }, 900);\n }", "function getDescription(formData) {\n var desc = formData[descriptionPosition];\n var contactInfo = formData[contactInformationPosition];\n var hostNames = formData[hostNamesPosition];\n \n return desc + \"\\n \\n<strong>Host(s):</strong> \\n\" + hostNames + \"\\n \\n <strong>Contact Information:</strong> \\n\" + contactInfo;\n}", "function addDesc (description) {\n var out\n\n // TODO This won't be done for any lines which don't get corrected. Fix this.\n if (description) {\n out = ' - ' + description.replace(/^([- ]*)/,\"\").replace(/\\.+$/,\"\")\n return addPeriod(out)\n }\n return ''\n}", "function displayDescription() {\n // get new random elements\n randomCondiment = getRandomElement(jsonData.condiments);\n randomCat = getRandomElement(jsonData.cats);\n randomRoom = getRandomElement(jsonData.rooms);\n randomName = getRandomElement(jsonData.firstNames);\n randomTitan = getRandomElement(jsonData.greek_titans);\n\n // Remove the past description\n $(\"body\").empty();\n\n // Check if the subject of the verb is plural for good conjugation\n let verb = \"is\";\n if (randomCondiment.charAt(randomCondiment.length - 1) === \"s\") {\n verb = \"are\";\n }\n\n // Check if the last letter of a possessive noun, adapt its form\n let possessive = \"'s\"\n if (randomName.charAt(randomName.length - 1) === \"s\") {\n possessive = \"'\";\n }\n\n // Check the first letter of the following noun to adapt its article\n let article = \"a\";\n let exceptions = [\"A\", \"E\", \"I\", \"O\", \"U\", \"H\"];\n for (let i = 0; i < exceptions.length; i++) {\n if (randomCat.charAt(0) === exceptions[i]) {\n article = \"an\";\n }\n }\n\n // Combine all parts and append it to the body\n let description = `${randomName}${possessive} ${randomCondiment} ${verb} like ${article} ${randomCat} in ${randomTitan}${possessive} ${randomRoom}.`;\n $(\"body\").append(description);\n}", "function postDescriptionString(post){\n return \"`New post from \" + post.subreddit_name_prefixed + \"`\\n\\n\"\n + \"**\" + post.title + \"** \" + \"*by \" + post.author.name + \"*\\n\" \n + \"**Thread**\\n\" + \"https://www.reddit.com\" + post.permalink + \"\\n**Link**\\n\"\n + post.url + \"\\n\";\n}", "get desc() { return ChangeDesc.create(this.sections); }", "function showDescription(){\n\t$(this).find('.description').toggle();\n}", "function valueDescription(text) { }", "function CardDescription(props) {\n\t var children = props.children,\n\t className = props.className,\n\t content = props.content;\n\n\t var classes = (0, _classnames2.default)(className, 'description');\n\t var rest = (0, _lib.getUnhandledProps)(CardDescription, props);\n\t var ElementType = (0, _lib.getElementType)(CardDescription, props);\n\n\t return _react2.default.createElement(\n\t ElementType,\n\t _extends({}, rest, { className: classes }),\n\t children || content\n\t );\n\t}", "function eventsMoreDescription() {\n $('.show-more' + self.pref).unbind('click');\n $('.show-more' + self.pref).click(function () {\n var domainID = $(this).attr('data-id');\n $(this).closest(\"td\").html(self.accessionToLongDescription[domainID]);\n eventsLessDescription();\n });\n }", "function _getDescription(anchor) {\n\t\treturn anchor.attr('title');\n\t}", "function markdownDescription(text) { }", "function descriminatingProperty() { }", "function getDesc(descArr) {\n let descString = '';\n descArr.forEach((desc) => {\n descString += desc.value;\n });\n return descString;\n}", "function CardDescription(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n textAlign = props.textAlign;\n var classes = classnames_default()(useTextAlignProp(textAlign), 'description', className);\n var rest = lib_getUnhandledProps(CardDescription, props);\n var ElementType = lib_getElementType(CardDescription, props);\n return react_default.a.createElement(ElementType, extends_default()({}, rest, {\n className: classes\n }), childrenUtils_namespaceObject.isNil(children) ? content : children);\n}" ]
[ "0.75699145", "0.7545369", "0.71114933", "0.70800334", "0.70800334", "0.70800334", "0.7061728", "0.7061728", "0.7061728", "0.7061728", "0.7061728", "0.70443815", "0.70271736", "0.69997895", "0.69997895", "0.69997895", "0.69997895", "0.69997895", "0.69997895", "0.69997895", "0.69997895", "0.69997895", "0.69997895", "0.69997895", "0.69997895", "0.69500977", "0.6925594", "0.686762", "0.68609345", "0.6768039", "0.6739876", "0.67203116", "0.6703869", "0.66837656", "0.66665936", "0.66528785", "0.6633975", "0.6614316", "0.66009164", "0.65656096", "0.65548384", "0.6540481", "0.6528277", "0.65016514", "0.64645404", "0.6431981", "0.63996065", "0.63903534", "0.6387729", "0.63830346", "0.6370945", "0.63665956", "0.63226765", "0.63185114", "0.6293335", "0.628598", "0.6267491", "0.62480396", "0.6198022", "0.61913204", "0.6182298", "0.6151583", "0.61395377", "0.6115855", "0.6111618", "0.610971", "0.6069427", "0.6047374", "0.6042144", "0.601462", "0.6011535", "0.6006293", "0.60028267", "0.5985061", "0.5964234", "0.5962618", "0.59464085", "0.5915284", "0.5891845", "0.5887144", "0.5886704", "0.58736706", "0.5872611", "0.5868588", "0.5868054", "0.5862295", "0.58511025", "0.58456683", "0.5843827", "0.5817684", "0.58104086", "0.5797848", "0.5792445", "0.57803386", "0.5772844", "0.57726616", "0.57649314", "0.5746784", "0.57406265", "0.5739312" ]
0.7081578
3
Afficher le prix du teddy
function displayPriceTeddy(teddy) { let priceTeddy = document.querySelector('#card-price') let teddyPriceCents = teddy.price priceTeddy.innerHTML = "Prix : " + teddyPriceCents + " €" }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculerPrixTotal(nounours) {\n prixPanier = prixPanier += nounours.price;\n}", "function prixProduitTotal(prix, nombre) {\n let ppt = prix * nombre;\n return ppt;\n}", "function prix() {\n return 50 * (nbMultiplicateur * nbMultiplicateur * 0.2);\n}", "get saldo() {\n\t\treturn this.ingreso - this.deuda\n\t}", "precioTotal() {\n return this.ctd * this.valor;\n }", "function prixTotal() {\n let total = 0;\n for (let j= 0; j < objPanier.length; j++) {\n total = total + objPanier[j].price * objPanier[j].number;\n }\n let afficheTotal = document.querySelector(\"#total\");\n afficheTotal.textContent=(\"Total : \" + (total / 100).toLocaleString(\"fr\") + \" €\");\n}", "function autoclickprix(){\n return Math.round(200 * (nbMultiplicateurAmelioAutoclick * 0.40));\n}", "afficherTotalPayer() {\r\n\r\n let elmH4 = document.createElement('h4');\r\n let elmH3 = document.createElement('h3');\r\n\r\n let texteContenu = this.total ;\r\n let titreTextContenu = \" Total : \" \r\n\r\n let texte = document.createTextNode(texteContenu);\r\n let titreTexte = document.createTextNode(titreTextContenu);\r\n\r\n elmH4.appendChild(texte);\r\n elmH3.appendChild(titreTexte);\r\n\r\n document.getElementById('iTotal').appendChild(elmH3);\r\n document.getElementById('iTotal').appendChild(elmH4);\r\n }", "function Puntaje(combos,de_donde){\r\n if(combos==\"reset\"){\r\n $(de_donde).text(\"0\")\r\n }\r\n else{\r\n var Puntaje_actual = $(de_donde).text()\r\n var Total = Number(Puntaje_actual)+combos;\r\n $(de_donde).text(Total.toString())\r\n }\r\n}", "function afficherTotal(prixTotal){\n document.getElementById(\"divTotalPanier\").innerHTML = prixTotal;\n}", "function getpanierItemsCount(){\n\n\ttotal=calculertotal();\n\t(document.querySelector(\"#total\")).innerHTML=(\"Total a payer \"+total+\" DH\");\n}", "calculPricePni(){\n this.panierPrice = 0;\n for (let product of this.list_panier) {\n var price = product.fields.price*product.quantit;\n this.panierPrice = this.panierPrice+price;\n }\n //on arrondi le price au deuxieme chiffre apres la virgule\n this.panierPrice = this.panierPrice.toFixed(2);\n }", "function aumentarPrecio(){\n let disney=385;\n let inflacion = 150;\n\n document.write('El valor total del servicio de disnes plus $'+(disney+inflacion));\n}", "function IndicadorTotal () {}", "function rent(c){\n marg = (parseInt($(\"#ganancia\").val())/100)+1\n return ((parseInt(c) * marg ))*1.21\n\n }", "baseAmount() {return player.t.energy}", "function getPelnas() {\nvar pajamos = 12500;\nvar islaidos = 18500;\nvar pelnas = pajamos - islaidos;\nreturn pelnas;\n}", "function afficherNbMultiplicateur() {\n $multiplicateur.innerHTML = \"Multiplicateur x\" + nbMultiplicateur + \" (prix du prochain verre de lait : \" + prix() + \")\";\n}", "getAmount(){ \n var totalAmount = (this.gallonsRequested * this.getPrice());\n\n return totalAmount;\n }", "function calculerTotal(){ \r\n var total = 0\r\n for (var i in achats) {\r\n total = total + achats[i].nbre*achats[i].prix;\r\n }\r\n setElem(\"tot\", total.toFixed(2));\r\n }", "onlyTheSalary() {\r\n return `${this.dayRate * this.workingDays * this.#showExp}`\r\n }", "getValorTotal(){\n return this._valorUnitario * this._quantidade;\n }", "function amountAfterCommission(pdName){\n var pdTotal = betting.productTotal(pdName);\n //commission appled for each product\n var cRate = cms.get(pdName);\n return pdTotal - ( pdTotal * cRate / 100);\n\n}", "function prixamelioclick(){\n return Math.round(500 * (nbMultiplicateurAmelioAutoclick * 0.5));\n}", "tempo() {\n return this.t\n }", "function refreshSomme(){\n // Sous total\n var sousTotal = 0;\n for(var p in panier){\n sousTotal += parseFloat(livres[panier[p].id].prix.replace(',','.'))*panier[p].nombre;\n }\n // Taxes\n var tps = sousTotal * TAXE_TPS;\n var tvq = sousTotal * TAXE_TVQ;\n // total\n var total = sousTotal + tps + tvq;\n \n // Affectation\n $(\"#panierSousTotal\").text(sousTotal.toFixed(2));\n $(\"#panierTPS\").text(tps.toFixed(2));\n $(\"#panierTVQ\").text(tvq.toFixed(2));\n $(\"#panierTotal\").text(total.toFixed(2));\n}", "function sumarDinero(x) {\n saldoCuenta = saldoCuenta + x;\n\n}", "function valorTotalDesconto(descontoreal) {\n\t\tvar valorTotal = 0,\n\t\tvalor;\n\t\t\n\t\t$('.grid tbody tr').each(function(i){\n\t\t\tvalor = $(this).find('.itemTotal').text();\n\t\t\tvalor = valor.replace('R$ ', '').replace('.', '').replace(',', '.');\n\t\t\tvalorTotal += parseFloat(valor);\n\t\t});\n\t\t$('.valorTotal').text('R$ '+ number_format(valorTotal - descontoreal, 2, ',', '.'));\n\t}", "function getDeposit() {\n return askMoney;\n }", "function elevadoCient(valor) {\n var numeroCient = document.getElementById(\"inputCient\").innerHTML;\n\n document.getElementById(\"inputCient\").innerHTML = Math.pow(numeroCient, valor);\n}", "function printAmount() {\n document.getElementById(\"tCP\").textContent = totalCP.toLocaleString();\n document.getElementById(\"tSP\").textContent = totalSP.toLocaleString();\n document.getElementById(\"tGP\").textContent = totalGP.toLocaleString();\n document.getElementById(\"tAmt\").textContent = tipAmount.toLocaleString();\n document.getElementById(\"nP\").textContent = netProfit.toLocaleString();\n }", "function getPelnas() {\n var pajamos = 12500;\n var islaidos = 7500;\n document.querySelector(\"body\").innerHTML += \"pelnas \" + (pajamos-islaidos) + \"<br>\";\n return pajamos-islaidos;\n}", "getTotal(){\n this.totalPaid = this.periods * this.scPayment\n this.totalInterest = this.totalPaid - this.loanAmount\n }", "function updateTotaal(){\n var totaal = 0\n for (var pizza in pizzas){\n totaal += pizzas[pizza].aantal * pizzas[pizza].price;\n }\t\n $(\"#winkelmandje #totaal\").html(totaal);\n }", "function totalAmount_Zuweisung() {\n totalAmount = this.value;\n}", "function calcularTotal() {\n \n const pesoAct = Number(document.getElementById('pesoAct').innerHTML);\n const cantidad = Number(document.getElementById('cantidad').value);\n \n const total = pesoAct * cantidad;\n \n document.getElementById('total').innerHTML = total.toFixed(2);\n \n }", "function totalCost(e) {\n let quantity = e.target\n quantity_parent = quantity.parentElement.parentElement\n price_field = quantity_parent.getElementsByClassName('item-price')[0]\n total_field = quantity_parent.getElementsByClassName('total-price')[0]\n price_field_content = price_field.innerText.replace('€', '')\n total_field.children[0].innerText = '€' + quantity.value * price_field_content\n grandTotal()\n if (isNaN(quantity.value) || quantity.value <= 0) {\n quantity.value = 1\n }\n\n}", "get amount() {\n\t\t\treturn this.items\n\t\t\t\t.map(item => item.qty * item.price)\n\t\t\t\t.reduce((total, qty) => total += qty, 0);\n\t\t}", "function sumTotal(){\r\n var sumTotal = 0;\r\n //On fait la somme\r\n $('#yes_facture').find('.input_payer').each(function(){\r\n sumTotal+= parseInt($(this).val());\r\n });\r\n //On modifie l'input somme\r\n $('.input_somme').val(sumTotal);\r\n }", "function getTotalAmountFinanced(){\n\t\treturn parseInt(localStorage.pSlider)-parseInt(localStorage.dPayment);\t\t\n\t}", "function precioTotal() {\n let total = 0;\n const precioTot = document.querySelector('.totpre');\n\n const todos = document.querySelectorAll('.agregado'); \n\n todos.forEach(tr => { \n const selectPrecio = tr.querySelector('.monto');\n const soloPrecio = Number(selectPrecio.textContent.replace('$',''));\n const cantidad = tr.querySelector('.input');\n const valorCantidad = Number(cantidad.value);\n\n total = total + soloPrecio * valorCantidad;\n });\n\n precioTot.innerHTML = `${total}`;\n}", "baseAmount() {return player.points}", "baseAmount() {return player.points}", "baseAmount() {return player.points}", "baseAmount() {return player.points}", "baseAmount() {return player.points}", "baseAmount() {return player.points}", "baseAmount() {return player.points}", "function totale(price) {\n tot += price;\n }", "baseAmount() {return player.s.points}", "baseAmount() {\n return player.s.points\n }", "function calculPanier(oursObject) {\n \n let totalPanier = 0;\n//conversion du prix\n oursObject.forEach((ours) => {\n let convertitPrix = 0;\n convertitPrix = parseInt(ours.prix);\n totalPanier = totalPanier + convertitPrix;\n });\n return totalPanier;\n}", "baseAmount() {return player.g.power}", "baseAmount() {return player.c.points}", "baseAmount() {return player.c.points}", "baseAmount() {return player.c.points}", "function getTotalPricePerTeddy(quantity, price) {\n const goodPrice = Math.round(price) / 100;\n const totalPerTeddies = quantity * goodPrice;\n return new Intl.NumberFormat('fr-FR', { style: 'currency', currency: 'EUR' }).format(totalPerTeddies)\n}", "getPeso() {\n if (this.peso) {\n if (this.peso > 0 && this.peso < 1000) {\n return this.peso;\n } else {\n this.erros.push(\"Peso é Inválido!\");\n }\n } else {\n this.erros.push(\"O peso não pode ser em branco!\");\n }\n }", "alterRenteninfo (person) {\n const geburtsjahr = person.geburtstag.getFullYear()\n return person.jahrRenteninfo - 1 - geburtsjahr\n }", "function promoClick(){\n const promoInput =document.getElementById(' promo-input');\n const promoInputValue = promoInput.value;\n if(promoInputValue == \"stevekaku\"){\n const total = document.getElementById(\"total-cost\");\n const totalText = total.innerText;\n const totalNum = parseFloat(totalText);\n // const discTotal =(totalNum-(totalNum *20)/100) ;\n let discounTotal = document.getElementById(\"total-cost2\");\n discounTotal.innerText = (totalNum-(totalNum *20)/100);\n \n }\n }", "preroll() {\n \n }", "function totalCount() {\n for (let i in panier) {\n total += panier[i].price * panier[i].quantity;\n }\n console.log(total);\n totalCart.textContent = total + ' €';\n}", "function aplicaDescuentoCarrito(precioTotal){\n let priceDiscount = precioTotal * discountPrice;\n precioTotal = precioTotal - priceDiscount;\n document.getElementById(\"chopping-price-discount\").innerHTML = \"( Descuento del \" + discountPrice*100 + \"% )\";\n return precioTotal;\n}", "function nota_promedio(){\n\t\tvar sum = 0;\n\t\tvar pro = 0;\n\t\tfor(num = 0; num < alumnos.length; num ++){\n\t\t\tsum += (alumnos[num].nota);\n\t\t}\n\t\tpro = sum / 10;\n\t\tdocument.getElementById(\"promedio\").innerHTML = \"El Promedio es: <b>\" + pro.toFixed(2) + \"</b>\";\n\t}", "function getPrice() {\n\tif (_slider) {\n\t\treturn \"(@tpprixnum==\" + _slider.values()[0] + \"..\" + _slider.values()[1] + \")\";\n\t}\n\telse\n\t\treturn \"\";\n}", "get(){\n date = new Date();\n todayDate = date.getDate();\n if (this.rate !== undefined){\n return this.rate * todayDate;\n } else {\n return 0;\n }\n }", "function incrementwood()\n{\n\tif(nbwood>=princrementwood)\n\t{\n\t\tinbwood++; /*incrément compteur*/\n\t\tnbwood=nbwood-princrementwood; /*déduit le prix*/\n\t\tprincrementwood=princrementwood+(nb*2);\n\t\tprincrementwood10=princrementwood*10;\n\t\tprincrementwood100=princrementwood*100;\n\t\tgestionwood.innerHTML=nbwood;\n\t\tincrementationwood.innerHTML=princrementwood;\n\t\tincrementationwood10.innerHTML=princrementwood*10;\n\t\tincrementationwood100.innerHTML=princrementwood*100;\n\t\tconsole.log(princrementwood);\n\t}\n\telse\n\t{\n\t\talert(\"La maison fait pas crédit\");\n\t}\n}", "anadirTP() {\n this.TP = parseInt(this.TP) + 1;\n }", "function actualizoTotales() {\r\n var costoDeEnvio = 0;\r\n importeTotal = 0;\r\n costoDeEnvio = $(\"input[name='opcion']:checked\").val() * $(\"#productCostText\").text();\r\n importeTotal = costoDeEnvio + parseFloat($(\"#productCostText\").text());\r\n document.getElementById(\"comissionText\").innerHTML = costoDeEnvio.toFixed(0);\r\n document.getElementById(\"totalCostText\").innerHTML = importeTotal.toFixed(0);\r\n }", "baseAmount() { return player.points }", "baseAmount() { return player.points }", "baseAmount() { return player.points }", "function updateTotalField(total, todayDeposit){\n const balancdText = document.getElementById(total);\n const balanceReceived = balancdText.innerText;\n const balanceAmount = parseFloat(balanceReceived);\n const totalBalance = balanceAmount + todayDeposit;\n balancdText.innerText = totalBalance;\n // const totalDepost = depostBalance +\n // return totalBalance;\n}", "calcRetirement(){\n if(this.age > 40) {\n return \"You are retired !\";\n }\n return `You have ${40-this.age} more year to get retired !`\n }", "function calcularValor(qntPedida, preco_und){\n let qnt = qntPedida;\n let preco_undReais = preco_und/100;\n let total = qntPedida*preco_undReais;\n\n return total;\n}", "getCartTotal (total) {\n document.getElementsByClassName('grandTotal')[0].innerText = \" # \"+ total\n \t\n }", "function precioSubtotal(article) {\n units = document.getElementById(\"cart_\"+article+\"_units\").value;\n units_price = cart_products_info.articles[article].unitCost\n subtotal = units*units_price\n document.getElementById(\"cart_\"+article+\"_cost\").innerHTML = \"<strong> UYU \" + convertir(cart_products_info.articles[article].currency)*subtotal + \"</strong>\"; /// Convertir() pasa de dolares a uruguayos ///\n}", "function perimetroCuadrado(lado){\n return lado*4;\n}", "decrire() \n {\n return `${this.nom} a ${this.sante} points de vie, ${\n this.force\n } en force et ${this.xp} points d'expérience`;\n }", "get total(){\n debugger;\n return this.sum + Number(this.expense);\n }", "function getHtmlTotalPrice(panier) {\n\n let htmlTotalPrice = `\n <div>`+totalPriceIntoCart(panier)+` €</div> \n `;\n\n return htmlTotalPrice;\n\n}", "function money(total) {\n let cenT = total * 100\n let re = cenT % val.dollar\n let dollar = cenT - re\n return dollar\n}", "baseAmount() {return player.l3.points}", "function paymentPrice(amount) {\n const totalPayment = document.getElementById('total-payment');\n totalPayment.innerText = amount;\n}", "function trix(serie=CLOSE,period=14,signalPeriod=3){\n\t\tvar tripleEma = ema(ema(ema(serie, period), period), period);\n\t\tvar tx = 100 * ( diff(tripleEma,yesterday(tripleEma)) / tripleEma);\n\t\t\n\t\treturn {trix: tx, signal: (ema(tx, signalPeriod)) }\n\t}", "function modalTP(){\n\tvar totalPrice = 0;\n\t\n\tfor (var name in cart) {\n\t\tvar p = product[name];\n\t\ttotalPrice += cart[name] * p.price;\t\n\t}\n\treturn totalPrice;\n}", "function modalTP(){\n\tvar totalPrice = 0;\n\t\n\tfor (var name in cart) {\n\t\tvar p = product[name];\n\t\ttotalPrice += cart[name] * p.price;\t\n\t}\n\treturn totalPrice;\n}", "baseAmount() {return player.g.points}", "function Total(DailyRent, time) {\r\n TotalRent = DailyRent * time;\r\n }", "function perimetroCuad(lado){\n return lado * 4;\n}", "function r()\n{\n var valorI = document.getElementById(\"valorI\").value;\n var cuotaI = document.getElementById(\"cuotaI\").value;\n var resta = valorI - cuotaI;\n document.getElementById(\"prestamo\").value = resta;\n\n}", "function total_p(centim,age) {\r\n\treturn parseInt(centim) + (5*parseInt(age))\r\n}", "get totalDeItens() {\n let totalItens = 0;\n\n this.itens.map((item) => {\n totalItens += item.quantidade;\n });\n\n return totalItens;\n }", "function plateorquantitychange(event){\n let row = event.target.parentNode.parentNode;\n let fooditemname = row.cells[0].innerHTML;\n let fooditemquantity = row.cells[2].firstChild.value;\n let oldprice = row.cells[3].innerHTML;\n if(fooditems[fooditemname].kind == 1 ){\n let fooditemplate = row.cells[1].firstChild.value;\n let fooditemprice = (parseInt(fooditemquantity) * parseInt(fooditems[fooditemname][\"price\"+fooditemplate]));\n row.cells[3].innerHTML = fooditemprice;\n }\n else{\n let fooditemprice = (parseInt(fooditemquantity) * parseInt(fooditems[fooditemname][\"price\"]));\n row.cells[3].innerHTML = fooditemprice;\n }\n let ttl = document.getElementById(\"total\");\n ttl.innerHTML = parseInt(ttl.innerHTML) - parseInt(oldprice) + parseInt(row.cells[3].innerHTML);\n}", "function plusOne(x = document.getElementById(\"hour\").value) {\n x = ++x;\n if (x >= 1) {\n document.getElementById(\"hour\").value = x;\n function totalPrice(x = document.getElementById(\"hour\").value) {\n let tprice = x * 100;\n return tprice;\n }\n document.getElementById(\"tprice\").value = \"$ \" + totalPrice(x);\n }\n}", "function perimetroCuadrado(lado) {\n return lado * 4; \n}", "function calcularPerimetroTriangulo(){\n const base=document.getElementById(\"InputBase\").value;\n const lado1=document.getElementById(\"InputLado1\").value;\n const lado2=document.getElementById(\"InputLado2\").value;\n const perimetro=redondear((Number(base+lado1+lado2)),2);\n alert(perimetro);\n}", "baseAmount() {return player.b.points}", "get totalPrice() {\n\n return Model.totalPriceCounter();\n }", "function paye() {\n var grossPay = 1000000\n var perc = 30 / 100\n var tax = grossPay * perc\n var netPay = grossPay - tax\n console.log(netPay)\n}" ]
[ "0.6807657", "0.6679105", "0.65266716", "0.63043493", "0.62294185", "0.62265444", "0.6018096", "0.58842534", "0.5879686", "0.5874738", "0.5823457", "0.5816363", "0.58042836", "0.57912374", "0.5786268", "0.5753411", "0.57290435", "0.5721998", "0.571984", "0.5710777", "0.56813234", "0.5680625", "0.56723183", "0.5642244", "0.56362575", "0.5610183", "0.5592459", "0.55864394", "0.5583395", "0.5583394", "0.55756056", "0.55711657", "0.5567662", "0.5559978", "0.5555573", "0.5544837", "0.55443704", "0.5537883", "0.55378664", "0.5526949", "0.5519374", "0.5515121", "0.5515121", "0.5515121", "0.5515121", "0.5515121", "0.5515121", "0.5515121", "0.55130434", "0.55099857", "0.5503192", "0.550091", "0.5489707", "0.54835695", "0.54835695", "0.54835695", "0.5480296", "0.5480011", "0.5478804", "0.5478776", "0.5478596", "0.54741603", "0.5467595", "0.5462614", "0.5452539", "0.5442522", "0.54383916", "0.5434637", "0.5424497", "0.5415559", "0.5415559", "0.5415559", "0.5412597", "0.5412081", "0.54111075", "0.5408921", "0.5405157", "0.54019827", "0.54019576", "0.5398778", "0.53983396", "0.5396845", "0.53962183", "0.53945553", "0.53942883", "0.53935546", "0.53935546", "0.5392743", "0.53899217", "0.53885853", "0.53854525", "0.53853333", "0.53837264", "0.53824484", "0.53767246", "0.5374674", "0.5373118", "0.53725016", "0.5370934", "0.53676546" ]
0.6158829
6
Ajouter le produit dans le localStorage, pour l'utiliser dans le panier.
function addToShoppingBasket() { //Si l'item "teddies_basket" n'existe pas et que l'user a sélectionné une couleur. On créé un nouveau tableau "teddies_basket", on y ajoute le currentTeddy modifié par l'user, on stringify le tableau pour l'envoyer au localStorage if (localStorage.getItem('teddies_basket') == null && selectOption.selected === false) { let teddies_basket = [] teddies_basket.push(currentTeddy) let teddies_basketString = JSON.stringify(teddies_basket) localStorage.setItem('teddies_basket', `${teddies_basketString}`) //Sinon si "teddies_basket" existe et que l'user a sélectionné une couleur. On attrape l'item du localStorage, on le parse pour obtenir le tableau "teddies_basket". } else if (localStorage.getItem('teddies_basket') != null && selectOption.selected === false) { let getTeddyArray = localStorage.getItem('teddies_basket') let parseArray = JSON.parse(getTeddyArray) let teddyIndex = null let teddyFound = null //On parcours le tableau pour chaque élément à l'intérieur de celui-ci. On attrape les données ID et Color. // eslint-disable-next-line no-unused-vars parseArray.forEach((elementTeddy, index, array) => { let teddyID = elementTeddy.id let teddyColor = elementTeddy.color //Si l'ID et la couleur du teddy user correspond au teddy dans le tableau alors on assigne les valeurs suivantes. if (teddyID === currentTeddy.id && teddyColor === currentTeddy.color) { teddyFound = elementTeddy teddyIndex = index } }) //Si un teddy dans le panier correspond avec un nouvel objet currentTeddy. On créé une variable pour la nouvelle quantité. On supprime du tableau l'ancien teddy qui sera remplacé par le nouveau avec la mise à jour de sa quantité avec la fonction splice(). //On converti le tableau en string puis on l'envoi dans le localStorage. if (teddyFound != null) { let newTeddyQuantity = currentTeddy.quantity + teddyFound.quantity teddyFound.quantity = newTeddyQuantity parseArray.splice(teddyIndex, 1, teddyFound) let teddyString = JSON.stringify(parseArray) localStorage.setItem('teddies_basket', `${teddyString}`) //Sinon on ajoute le currentTeddy au tableau, on converti le tableau puis on l'envoi dans le localStorage. } else { parseArray.push(currentTeddy) let teddyString = JSON.stringify(parseArray) localStorage.setItem('teddies_basket', `${teddyString}`) } } else { console.log("ERROR") } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ajoutPanier() {\n //verifie si le client à choisi une lentille\n if (!productLense) {\n alert(\"Vous devez choisir une lentille\");\n return;\n }\n\n //créer l'objet\n let panierObj = ({\n id: Request.response[\"_id\"],\n lense: productLense,\n quantity: productQty\n });\n const productKey = `${Request.response._id}-${productLense}`;\n console.log(\"productKey\", productKey);\n console.log('panierObj', panierObj);\n\n //verifie si le produit est déjà dans le localStorage, si oui mets à jour la quantité\n if (!localStorage.getItem(productKey)) {\n localStorage.setItem(productKey, JSON.stringify(panierObj));\n } else {\n let tmpProduct = JSON.parse(localStorage.getItem(productKey));\n let tmpQty = panierObj.quantity + tmpProduct.quantity;\n panierObj.quantity = tmpQty;\n localStorage.setItem(productKey, JSON.stringify(panierObj));\n };\n}", "function ajoutPanier(id_produit, option_lentille) {\n let panier = localStorage.getItem('panier') ? JSON.parse(localStorage.getItem('panier')) : []\n panier.push({ id: id_produit, lentille: option_lentille });\n localStorage.setItem('panier', JSON.stringify(panier));\n}", "sauvegardePanier(){\n localStorage.setItem('commande', JSON.stringify(this.commandes));\n localStorage.setItem('dateModif', ''+(Date.now()+(3600*1000)) );\n }", "function addProduit (id, nom, prix) {\n\tlet detailProduit = [id, nom, prix];\n\tcontenuPanier.push(detailProduit);\n\tlocalStorage.panier = JSON.stringify(contenuPanier);\n\tcountProduits();\n}", "function addLocalStorage(){\r\n localStorage.setItem('carrito', JSON.stringify(carrito))\r\n}", "function ajoutProduitPanier(produit){\n const id= document.getElementById('id').value;\n const nom=document.getElementById('nom').value;\n const quantite=document.getElementById('quantite').value;\n const couleur=document.getElementById('couleur').value;\n const adresseHtml=document.getElementById('adresseHtml').value;\n const description = document.getElementById('description').value;\n const prix = document.getElementById('prix').value;\n const image = document.getElementById('image').value;\n var prixTtl= prix * quantite;\n\n\n class produitPanier{\n constructor(id,nom,quantite,couleur,adresseHtml,description,prix,image,prixTtl){\n this.id=id;\n this.nom=nom;\n this.quantite=quantite;\n this.couleur=couleur;\n this.adresseHtml=adresseHtml;\n this.description=description;\n this.prix=prix;\n this.image=image;\n this.prixTtl=prixTtl;\n }\n }\n if( localStorage.getItem(\"panier\")===\"vide\"){\n const produit = new produitPanier(id, nom, quantite, couleur,adresseHtml,description,prix,image,prixTtl);\n var Panier=[];\n Panier.push(produit);\n numberQte=Number(produit.quantite);// A tester\n localStorage.setItem(\"panier\",JSON.stringify(Panier));\n window.location.href=\"panier.html\";\n \n } else{\n /*2 hypothèes : -> le produit existe déjà dans le panier, on ne changera donc que la quantité de celui-ci et le prix rapporté à la quantité.\n -> le produit est absent des produits déjà présents, il faut rajouter une ligne.\n */\n var contenuPanier=JSON.parse(localStorage.getItem(\"panier\"));\n var produitExiste=false;\n for (let x in contenuPanier){\n\n if(contenuPanier[x].id==id && contenuPanier[x].couleur==couleur){//1ere hypothèse\n\n produitExiste=true;\n let qtePanier=Number(contenuPanier[x].quantite);\n let qteAjoutee=Number(quantite);\n contenuPanier[x].quantite=qtePanier + qteAjoutee;\n contenuPanier[x].prixTtl=contenuPanier[x].quantite * contenuPanier[x].prix;\n }\n\n }\n if(!produitExiste){\n const produit = new produitPanier(id, nom,quantite, couleur,adresseHtml,description,prix,image,prixTtl);\n contenuPanier.push(produit);\n\n }\n localStorage.setItem(\"panier\",JSON.stringify(contenuPanier));\n\n window.location.href=\"panier.html\";\n\n }\n return false;\n}", "async function ajouterPanier(){\n\t/* si l'objet existe, on augmente sa quantité de 1, sinon on l'ajoute au panier avec une quantité de 1. */\n\tconsole.log(\"Produit ajouté dans le panier.\");\n\tlet panierUtilisateur = JSON.parse(localStorage.getItem(\"panier\"));\n\tlet quantitePanier = JSON.parse(localStorage.getItem(\"quantitePanier\"));\n\tconst produit = await getProduits(getIdProduit());\n\tlet positionProduit = findElement(panierUtilisateur, produit);\n\n\t/* Si le produit existe déjà dans le panier, on augmente sa quantité de un, sinon, on l'ajoute dans le panier */\n\tif(positionProduit != -1){\n\t\tquantitePanier[positionProduit]++;\n\t} else {\n\t\tpanierUtilisateur.push(produit);\n\t\tquantitePanier.push(1);\n\t\tlocalStorage.setItem(\"panier\", JSON.stringify(panierUtilisateur));\n\n\t}\n\tlocalStorage.setItem(\"quantitePanier\", JSON.stringify(quantitePanier));\n\tconsole.log(quantitePanier);\n\tconsole.log(panierUtilisateur);\n\t/* Après avoir pris un objet, on redirige vers la page index.html */\n\tdocument.location.href=\"index.html\";\n}", "function ajoutStorage(response) {\n function clic() {\n console.log(\"Clic !\");\n\n let line = localStorage.getItem(\"object\");\n let line2 = localStorage.getItem(\"id\");\n\n let objectJs = JSON.parse(line);\n let objectJs2 = JSON.parse(line2);\n\n if (objectJs === null && objectJs2 === null) {\n objectJs = [];\n objectJs2 = [];\n }\n\n objectJs.push([response, lentilles.value]);\n objectJs2.push(response._id);\n\n let tabLine = JSON.stringify(objectJs);\n let tabLine2 = JSON.stringify(objectJs2);\n\n localStorage.setItem(\"object\", tabLine);\n localStorage.setItem(\"id\", tabLine2);\n\n alert(\"votre produit a bien été ajouter dans le panier\");\n }\n panier.addEventListener(\"click\", clic);\n}", "function AjoutArticleProduit() {\n var panier = {};\n // si le panier n'existe pas, il faut le créer\n if (localStorage.getItem(\"Panier\") === null) {\n // on crée l'entrée et on lui assigne une quantité de 1\n panier[id] = 1;\n }\n // si le panier existe\n else {\n //on transforme le panier en objet\n panier = JSON.parse(localStorage.getItem(\"Panier\"));\n // si l'entrée existe ajouter 1 à la quantité\n // sinon on la crée et on lui assigne une quantité de 1\n if (panier[id] > 0) {\n panier[id] += 1;\n } else {\n panier[id] = 1;\n }\n }\n //On enregistre le panier dans le local storage\n localStorage.setItem(\"Panier\", JSON.stringify(panier));\n}", "function ajouterPanier(id,name, price ) {\n\n var alreadyExistentItem = (sessionStorage.getItem(id));\n\n if (alreadyExistentItem == null || alreadyExistentItem == undefined) {\n var addedItem = \"CNC,\" + 1 + \",\" + name + \",\" + price;\n sessionStorage.setItem(id, addedItem);\n } else {\n var quantity = alreadyExistentItem.split(\",\")[1];\n quantity++;\n var addedItem = \"CNC,\" + quantity + \",\" + name + \",\" + price;\n sessionStorage.setItem(id, addedItem);\n }\n flushPanier()\n;\n //\n\n}", "guardarProductosLocalStorage(producto){\n let productos;\n //Toma valor ed un arreglo con datos del LS\n productos = this.obtenerProductosLocalStorage();\n //Agregar el producto al carrito\n productos.push(producto);\n //agregamos al LS\n localStorage.setItem('productos', JSON.stringify(productos));\n }", "function stockage() {\n\n var user = {\n //idUSer: i++,\n CIN: document.getElementById(\"cin\").value,\n username: document.getElementById(\"nom\").value,\n Télé: document.getElementById(\"tlf\").value,\n dateNaissance: document.getElementById(\"DateNais\").value,\n password: document.getElementById(\"mdp\").value,\n email: document.getElementById(\"email\").value,\n adresse: document.getElementById(\"adresse\").value,\n message: document.getElementById(\"message\").value,\n role: roleRadioButton,\n specialité: specialitéChoix,\n\n\n };\n\n\n\n var users = JSON.parse(localStorage.getItem(\"users\")) || [];\n users.push(user);\n users = localStorage.setItem(\"users\", JSON.stringify(users));\n location.href = \"index-one.html\";\n}", "addItemToCart(myTeddie){\n let panier = localStorage.getItem('panier')\n if (panier == null){\n panier = [];\n } else {\n panier = JSON.parse(panier)\n }\n console.log('addItemToCart');\n console.log(panier)\n panier.push(myTeddie);\n localStorage.setItem('panier', JSON.stringify(panier));\n console.log(localStorage);\n }", "function ajoutProduit(){\n var quantite = document.getElementById(\"quantite\").value;\n var prix = document.getElementById(\"prix\").value;\n var produit = document.getElementById(\"listeproduit\").value;\n var designation = JSON.parse(produit).designation;\n var id_produit = JSON.parse(produit).id;\n var qte_produit = JSON.parse(produit).quantite\n var total = quantite * prix\n var qte_reste = 0\n\n if(localStorage.getItem('panniers')){\n panniers = JSON.parse(localStorage.getItem('panniers'))\n\n panniers.forEach(element=>{\n if(element.id == id_produit){\n qte_reste = parseInt(qte_reste) + parseInt(element.quantite)\n }\n })\n }\n\n if((qte_produit-qte_reste) >= quantite){\n panniers.push(\n {\n id: id_produit,\n designation: designation,\n prix: prix,\n quantite: quantite,\n total: total\n }\n )\n\n localStorage.setItem('panniers', JSON.stringify(panniers))\n\n affichePannier()\n }\n else if((qte_produit-qte_reste) == 0){\n swal(\"Oops!\", \"Quantité stocke terminée, Renouvellez le stocke\", \"error\");\n }\n else{\n swal(\"Oops!\", \"Quantité stocke insuffisante, Entrez une quantité inferieur ou égal à (\"+(qte_produit-qte_reste)+\")\", \"error\");\n }\n \n}", "addComicLocalStore(newComic){\n this.comics.push({\n id: newComic.id,\n name: newComic.name,\n company: newComic.company,\n author: newComic.author,\n description: newComic.description\n });\n this.$window.localStorage.comics = String(JSON.stringify(this.comics));\n }", "function addBasket(data) {\n cameraButton.addEventListener('click', () => {\n //Création du panier dans le localStorage s'il n'existe pas déjà\n if (typeof localStorage.getItem(\"basket\") !== \"string\") {\n let basket = [];\n localStorage.setItem(\"basket\", JSON.stringify(basket));\n }\n //récupération des info du produit\n let produit = {\n 'image' : data.imageUrl,\n 'id' : data._id,\n 'name' : data.name,\n 'lense' : document.querySelector(\"option:checked\").innerText,\n 'price' : data.price,\n 'description' : data.description,\n 'quantity' : cameraQuantity.value,\n }\n console.log(produit);\n //création d'une variable pour manipuler le panier\n let basket = JSON.parse(localStorage.getItem(\"basket\"));\n //Vérification que l'item n'existe pas déjà dans le panier\n let isThisItemExist = false;\n let existingItem;\n for (let i = 0; i < basket.length; i++) {\n if (produit.id === basket[i].id && produit.lense === basket[i].lense) {\n isThisItemExist = true;\n existingItem = basket[i];\n }\n }\n //Ajouter la caméra au panier\n if (isThisItemExist === false) {\n basket.push(produit);\n localStorage.setItem(\"basket\", JSON.stringify(basket));\n alert(\"Votre article à bien été mis au panier\")\n } else {\n existingItem.quantity = parseInt(existingItem.quantity, 10) + parseInt(produit.quantity, 10);\n localStorage.setItem(\"basket\", JSON.stringify(basket));\n alert(\"La quantité du produit à bien été mise à jour\")\n }\n displayBasket();\n })\n}", "guardarProductosLocalStorage(producto){\n let productos;\n productos = this.obtenerProductosLocalStorage();\n productos.push(producto);\n localStorage.setItem('productos', JSON.stringify(productos));\n }", "function saveLocal() {\r\n let aJson = JSON.stringify(Productos)\r\n localStorage.setItem(\"productos\", aJson)\r\n}", "function sincronizarLocalSotorage() {\n localStorage.setItem(\"carrito\", JSON.stringify(coleccionProductos));\n}", "function addStorage(pName, date) {\n\n let lineItem = {\n name: pName,\n setDate: date\n };\n window.localStorage.setItem(pName, JSON.stringify(lineItem));\n}", "function agregarElementosLocalStorage(producto) {\n let productos;\n productos = revisarLocalStorage();\n //Añadir el producto al Array de productos\n productos.push(producto);\n localStorage.setItem('productos', JSON.stringify(productos) )\n\n}", "function MonInterface (){// fonction de gestion de l'information\n var princ=document.querySelector('#principale');\n const preparation= function () { \n princ.textContent='';\n princ.className='';\n if(localStorage.length==0)\n {\n princ.textContent=\"vous n'avez aucune tache\";\n princ.className='vide';\n }\n else{\n for(var i=0; i<localStorage.length; i++){\n Tache(localStorage.key(i), localStorage.getItem(localStorage.key(i)));\n }\n \n }\n };\n preparation();\n}", "function guardarLocalStorage(producto){\n let productos;\n productos = obtenerProductoLocalStorage();\n productos.push(producto);\n localStorage.setItem('productos', JSON.stringify(productos));\n}", "function agregarAlCarrito(producto) {\n carrito.push(producto);\n localStorage.setItem(`variableCarrito`, carrito);\n console.log(carrito);\n}", "function guardarProductosLocalStorage() {\n localStorage.setItem(\"Carrito\", JSON.stringify(carrito));\n}", "function adicionarItens(prato, valor){\n localStorage.setItem(prato, valor);\n alert('Prato: ' + prato + ' adicionado no carrinho!');\n}", "function _storage() {\n localStorage.setObject(\"data\", data);\n }", "function setLocalStorge() {\n\n // khi lưu xuống localStorage chuyển data thành String\n\n localStorage.setItem(\n \"DanhSachNhanVien\",\n JSON.stringify(danhSachNhanVien.mangNhanVien)\n );\n}", "storage() {\r\n this.stocker.addEventListener('click', () => { \r\n localStorage.setItem('name', this.nom.value);\r\n localStorage.setItem('firstname', this.prenom.value);\r\n });\r\n }", "function addToStorage() {\n localStorage.setItem(\"Library\", JSON.stringify(myLibrary));\n}", "function data() {\n\n localStorage.setItem('name', 'vladica');\n}", "function agregarPersonalizacion(){\n // obtenemos los valores de los elementos\n let valTamanio = \"No especificado\";\n let valMaterial = \"No especificado\";\n let valColor = \"No especificado\";\n let valExtra = \"No especificado\";\n if($catTamanio.checked == true){\n valTamanio = document.getElementById('tamanio').value;\n }\n if($catMaterial.checked == true){\n valMaterial = document.getElementById('material').value;\n }\n if($catColor.checked == true){\n valColor = document.getElementById('color').value;\n }\n if($textExtra.checked == true){\n valExtra = document.getElementById('personalizacionExtra').value;\n }\n\n const producto = {\n id: dataIdProducto,\n tamanio: valTamanio,\n material: valMaterial,\n color: valColor,\n extra: valExtra\n }\n\n // Creamos el identificador para el local storage\n const nombre = \"producto\" + dataIdProducto;\n localStorage.setItem(nombre, JSON.stringify(producto));\n localStorage.removeItem(\"idProductoPersonalizable\");\n}", "function guardarCarritoEnLocalStorage() {\n const miLocalStorage = window.localStorage;\n miLocalStorage.setItem('carrito', JSON.stringify(carrito));\n}", "function addToLocalStorage() {\n\t\tif (typeof (Storage) !== \"undefined\") {\n\t\t\tlocalStorage.setItem(\"todoList\", JSON.stringify(todoList));\n\t\t} else {\n\t\t\talert(\"error or browser doesn't support local storage!\");\n\t\t}\n\t}", "function afficheProduit(data){\n let nomProduit = data.name;\n let descriptionProduit = data.description;\n let imageProduit = data.imageUrl;\n let prixProduit = data.price;\n \n let titre = document.getElementById('titre').textContent= \"Salut, moi c'est \" .concat(nomProduit, \" !\");\n let titreProduit = document.getElementById('nomProduit').textContent= nomProduit;\n let description = document.getElementById('description').textContent= descriptionProduit;\n let image = document.getElementById('image').src= imageProduit;\n let prix = document.getElementById('prix').textContent= \"\".concat(prixProduit/100, \"€\");\n\n for(let colori of data.colors){\n document.getElementById('listeUl').innerHTML += `\n <option value=\"${colori}\">${colori}</option> `\n }\n\n bouton.addEventListener('click', () =>{\n let initPanier = JSON.parse(localStorage.getItem(\"panierClient\"));\n \n let idPanier = JSON.parse(localStorage.getItem(data._id))\n //Vérifier si le panier existe déjà\n if(localStorage.getItem('panierClient')){\n //Pousser les éléments dans le tableau initPanier qui comprend tous les produits\n initPanier.push(data._id);\n localStorage.setItem(\"panierClient\", JSON.stringify(initPanier));\n \n //Si il n'existe pas, initialisation du panier\n }else{\n //Tableau qui comprendra tous les objets\n let initPanier = [];\n initPanier.push(data._id);\n localStorage.setItem(\"panierClient\", JSON.stringify(initPanier));\n }\n \n //COULEURS\n let liste = document.getElementById('listeUl');\n let valeurSelect = liste.options[liste.selectedIndex].value;\n let couleurStorage = JSON.parse(localStorage.getItem(data._id));\n \n if (couleurStorage.indexOf(valeurSelect) === -1) {\n couleurStorage.push(valeurSelect);\n localStorage.setItem(data._id, JSON.stringify(couleurStorage))\n }\n })\n \n}", "AddToStorage() {\n localStorage.setItem('library', JSON.stringify(this.bookListCollection));\n }", "function addTotalCommande(){ \n // calculer le montant total de la commande \nlet prisTotalCalcul=[];\nfor (let n=0; n < products.length; n++){ \n let assembleLesPris =products[n].totalPayerProduit;//mesProduit[n].prixProduit;\n prisTotalCalcul.push(assembleLesPris);\n \n}// addition avec reduce \nconst reducer = (accumulator, currentValue) => accumulator + currentValue;\nconst totalCommande=prisTotalCalcul.reduce(reducer) ;\nlocalStorage.setItem(\"prixTotalCommande\", JSON.stringify(totalCommande)); \n// stoque la variable totalCommande dans localStorage\n let calculPrixTotalPanier = `\n <tr>\n <td colspan=\"4\"><strong> total commande</strong> </td>\n <td colspan=\"2\" class=\" calculPrixTotalPanier\" id=\"calculPrixTotalPanier\"><strong> ${totalCommande}</strong></td>\n </tr>`;\n document.querySelector(\".ligneTableau\").insertAdjacentHTML(\"beforeend\",calculPrixTotalPanier); \n}", "function addStorage(transactions) {\n var key = \"data\";\n\n var allData = getStorage();\n\n //localStorage setItem\n if (\"localStorage\" in window) {\n localStorage.setItem(key, JSON.stringify(transactions));\n } else {\n alert(\"Error - no local storage in current window.\");\n }\n}", "function store() {\n\n \n localStorage.setItem('mem', JSON.stringify(myLibrary));\n \n}", "function guardarStorage() {\r\n localStorage.setItem('carrito', JSON.stringify(ProductosCarrito));\r\n //console.log(localStorage.getItem('carrito'))\r\n}", "function addLocalStorage(id, value) {\n const grocery = { id, value };\n\n const items = getLocalStorage();\n\n items.push(grocery);\n localStorage.setItem(\"list\", JSON.stringify(items));\n}", "saveData(){\n localStorage.setItem(\"wish_list\", JSON.stringify(this.asDict()));\n }", "function addToLocalStorage() {\n localStorage.setItem(\"items\", JSON.stringify(items));\n}", "function setLocalStorage() {\n var dados = {\n jornadaCertPonto: jornadaCertPonto,\n almoco: almoco,\n jornadaSap: jornadaSap,\n tolerancia: tolerancia,\n semAlmoco: semAlmoco,\n horasAbonadas: horasAbonadas,\n saldoAdpBruto: saldoAdpBruto,\n };\n\n localStorage.setItem(keyLocalStorage, JSON.stringify(dados));\n}", "function addToCart() {\n console.log(\"toto\");\n let productsInCart = JSON.parse(localStorage.getItem(\"identifiants\"));\n /*Si le panier est vide*/\n if (productsInCart === null) {\n productsInCart = new Array();\n localStorage.setItem(\"identifiants\", JSON.stringify(productsInCart));\n }\n /*Récupère la quantité de l'objet */\n let selectQuantity = document.getElementById(\"productQuantity\");\n let selectedQuantity = selectQuantity.options[selectQuantity.selectedIndex].value;\n /*Créé un objet contenant la quantité et l'idée de l'objet*/\n let item = {\n \"id\": name,\n \"quantity\": selectedQuantity,\n };\n /*Permet de modifier la quantité d'un article donné sans ajouter le même identifiant*/\n if (canAddItem(productsInCart, name)) {\n productsInCart.push(item);\n } else {\n for (item in productsInCart) {\n if (productsInCart[item].id == name) {\n productsInCart[item].quantity = parseInt(productsInCart[item].quantity) + parseInt(selectedQuantity);\n }\n }\n }\n localStorage.setItem(\"identifiants\", JSON.stringify(productsInCart));\n}", "afegirCistella(id, quant, preu, decimalsPreu, decimalsPreuSenseIva, descripcio, desc, codi,imatge, ivaId, preuCataleg, preuSenseIvaCataleg, preuSenseIva ) {\n\n\n if (localStorage.getItem(\"productesCart\") === null) {\n const productes = [{\"codi\" : id, \"unitats\" : quant, \"preu\" : preu, \"decimalsPreuCataleg\" : decimalsPreu, \"decimalsPreuSenseIva\" : decimalsPreuSenseIva , \"descripcio\": descripcio,\"descripcioCurta\" : desc , \"id\" : codi , \"imatge\" : imatge , \"ivaId\" : ivaId, \"preuCataleg\" : preuCataleg , \"preuSenseIvaCataleg\" : preuSenseIvaCataleg, \"preuSenseIva\" : preuSenseIva}];\n localStorage.setItem(\"productesCart\", JSON.stringify(productes));\n } else {\n\n const productesCart = JSON.parse(localStorage.getItem(\"productesCart\"));\n const trobat = this.trobarArticleCart(productesCart, id);\n\n if (trobat >= 0) {\n productesCart[trobat][\"unitats\"] += quant;\n\n } else {\n productesCart.push({\"codi\" : id, \"unitats\" : quant, \"preu\" : preu, \"decimalsPreuCataleg\" : decimalsPreu, \"decimalsPreuSenseIva\" : decimalsPreuSenseIva , \"descripcio\": descripcio,\"descripcioCurta\" : desc , \"id\" : codi , \"imatge\" : imatge , \"ivaId\" : ivaId, \"preuCataleg\" : preuCataleg , \"preuSenseIvaCataleg\" : preuSenseIvaCataleg, \"preuSenseIva\" : preuSenseIva});\n\n }\n\n localStorage.setItem(\"productesCart\", JSON.stringify(productesCart));\n \n }\n\n const contador = this.contarArticles();\n this.setState({ carritoCount: contador })\n localStorage.setItem(\"count\", contador);\n this.calcularTotal();\n\n\n }", "saveLocalStorage() {\n localStorage.setItem(\"usuario\", JSON.stringify(this.lista_usuario));\n }", "guardarStorage() {\n localStorage.setItem('usuario', JSON.stringify(this.usuario));\n }", "function storeData(data){\n localStorage.data = JSON.stringify(data);\n }", "function sincronizarStorage() {\n localStorage.setItem('carrito', JSON.stringify(articulosCarrito));\n localStorage.setItem('cantidadtotal', JSON.stringify(cantidadTotal));\n localStorage.setItem('totalpagar', JSON.stringify(totalPagar))\n}", "storeLessonsInStorage() {\n Storage.storeLessons(this.lessons);\n }", "function addToLocalStorage(data) {\n let new_pokemon = {};\n new_pokemon.id = data.id;\n new_pokemon.sprite = data.sprite;\n new_pokemon.types = data.types;\n\n let team = []\n team = JSON.parse(localStorage.getItem(\"team\")) || []\n team.push(new_pokemon)\n localStorage.setItem(\"team\", JSON.stringify(team))\n $(\"#save-team\").show()\n}", "pushToLocal() {\r\n\r\n let userData = {};\r\n\r\n userData = {\r\n userName: this.name.val(),\r\n userEmail: this.email.val(),\r\n userPhone: this.phone.val(),\r\n userAge: this.age.val(),\r\n userPassword: this.password.val(),\r\n userRepassword: this.rePassword.val(),\r\n }\r\n\r\n this.localData.push(userData);\r\n localStorage.setItem(\"userData\", JSON.stringify(this.localData));\r\n\r\n }", "function setProveedores(){\r\n localStorage.setItem('LSProveedores', JSON.stringify(proveedores));\r\n}", "function addA() {localStorage.setItem(\"detailA\", JSON.stringify(new Roll(\"A\",\"Air-Fryer Bourbon Bacon Cinnamon Rolls\", 0, 5, \"----\",\"img/rolls/Air-Fryer Bourbon Bacon Cinnamon Rolls.jpg\")));}", "function addtolocal(data) {\n arr.push(data);\n localStorage.setItem(\"items\", JSON.stringify(arr));\n let arr2 = JSON.parse(localStorage.getItem(\"items\"));\n let item = arr2[arr2.length - 1];\n limaker(item);\n}", "function addToLocalStorage(listItem) {\n if (!localStorage.length) {\n initialCard(listItem);\n } else {\n var currentCollection = parseLocalStorage();\n currentCollection.push(listItem);\n stringifyNewCollection(currentCollection);\n };\n}", "terzo(){\n localStorage.setItem('points_' + this.props.type + '_3', this.props.points);\n localStorage.setItem('time_' + this.props.type + '_3', this.props.time);\n }", "function addFirstItemToLocalStorage() {\n let products = [];\n products[0] = {\n id: id,\n quantity: 1,\n };\n\n setItemToLocalStorage('productsCart', products);\n }", "function mostrarCompra(){\n localStorage.setItem( \"productos\", JSON.stringify(carrito));\n window.location.href = \"compra.html\";\n}", "function storage() {\n let string = JSON.stringify(Product.allProduct);\n localStorage.setItem('product', string)\n\n}", "function setData() {\n localStorage.setItem(`myLibrary`, JSON.stringify(myLibrary));\n}", "function recuperarDatosTarjeta(){\n\t\t$(\".perfil-user\").append('<div class=\"nueva-tarjeta\">'+ localStorage.tarjeta +'</div>'); //agregando elemento a la lista\n\t}", "function save() {\n localStorage.productData = JSON.stringify(Product.allProducts);\n localStorage.totalCounter = totalCounter;\n}", "function registrarBaseFactura() {\n localStorage.setItem(\"BASEFACTURA\", JSON.stringify(baseFactura));\n}", "function addItem(id){\n\n let item = produtos[id];\n poeCarrinho(item);\n console.log(arrayCarrinho)\n\n localStorage.setItem(\"carrinho\", JSON.stringify(arrayCarrinho));\n}//addItem", "backup_to_local_storage(){\n window.localStorage.setItem('vue-mini-shop', JSON.stringify(this.get_all()))\n }", "function storeProductinLocalStorage(product){\n let products;\n if(localStorage.getItem('products') === null){\n products = [];\n }else{\n products = JSON.parse(localStorage.getItem('products'))\n }\n products.push(product);\n localStorage.setItem('products', JSON.stringify(products))\n}", "function localSave() {\n localStorage.setItem('registra2', JSON.stringify(registrados));\n}", "function agregarLocalStoragePrecios(prc){\n\n\tlet precios;\n\tprecios = obtenerPreciosDelLocalStorage()\n\n\tprecios.push(prc)\n\n\tlocalStorage.setItem('Precios',JSON.stringify(precios))\n}", "function setItemToLocalStorage(name, data) {\n localStorage.setItem(name, JSON.stringify(data));\n}", "function setData(id, obj){\n localStorage.setItem(id, JSON.stringify(obj));\n}", "function addToLocalStorage(arr) {\n localStorage.setItem(\"myCourses\", JSON.stringify(arr));\n }", "function addToLocalStorage(listTask) {\n localStorage.setItem('listTask', JSON.stringify(listTask));\n renderTask(listTask);\n}", "function storeLocal(key, data) {\n window.localStorage.setItem(key, JSON.stringify(data));\n }", "function saveToLocalStorage(course) {\n let products = getFromLocalStorage();\n\n //adding new courses to the array courses\n products.push(course);\n\n //set courses to the localStorage\n localStorage.setItem(\"courses\" , JSON.stringify(products));\n}", "function addToLocalStorage(todos) {\n // data yang dimasukan harus berupa string, jika tidak dia terbaca sebagai [Object object]\n // convert data dari array, ke JSON string\n let dataJSON = JSON.stringify(todos)\n\n //menyimpan data yang telah di convert ke local storage\n localStorage.setItem('todos', dataJSON)\n\n //menampilkan data todos\n renderTodos(todos)\n}", "function sincroniozarLocalStore( ) {\n\n localStorage.setItem( 'tweets', JSON.stringify( tweets ) );\n}", "saveToStorage() {\n try {\n localStorage.setItem(this.name, JSON.stringify(this.storage));\n } catch(e) {\n\n }\n }", "persist() {\n localStorage.setItem(\n STORAGE_KEY + \"/\" + this.user.getId(),\n JSON.stringify(this.data)\n );\n }", "saveToLocalStorage() {\n\t\tthis.subscribers.push(() => {\n\t\t\tlocalStorage.setItem(\n\t\t\t\t\"queueifyModel\",\n\t\t\t\tJSON.stringify({\n\t\t\t\t\t//Conversion from object to String (serialization)\n\t\t\t\t\tcurrentSession: this.currentSession,\n\t\t\t\t\tcurrentSessionName: this.currentSessionName,\n\t\t\t\t\tcurrentSessionPin: this.currentSessionPin,\n\t\t\t\t\tcurrentPlaylistID: this.currentPlaylistID,\n\t\t\t\t})\n\t\t\t);\n\t\t});\n\t}", "getLocalStorage() {\n if (localStorage.getItem(\"usuario\")) {\n this.lista_usuario = JSON.parse(localStorage.getItem(\"usuario\"));\n }\n }", "function getLocalStorge() {\n\n // khi lấy localStorage lên để sử dụng chuyển thành JSON\n if (localStorage.getItem(\"DanhSachNhanVien\")) {\n danhSachNhanVien.mangNhanVien = JSON.parse(localStorage.getItem(\"DanhSachNhanVien\"));\n taoBang();\n }\n}", "function guardarListaProductosLocal(lista) {\n let prods = JSON.stringify(lista)\n localStorage.setItem('LISTA', prods)\n}", "function leerLocalStorage() {\n let cursoLS;\n cursoLS = obetenerCursoLocalStorage();\n cursoLS.forEach(function (infocurso) {\n const row = document.createElement(\"tr\");\n row.innerHTML = `\n <td>\n <img src=\"${infocurso.imagen}\" width=100>\n </td>\n <td>\n ${infocurso.titulo}\n </td>\n <td>\n ${infocurso.precio}\n </td>\n <td>\n <a href=\"#\" class=\"borrar-curso\" data-id=\"${infocurso.id}\">X</a>\n </td>\n `;\n listaCursos.appendChild(row);\n });\n}", "function setJsonStorage (chave, valor){\n localStorage.setItem(chave,valor);\n}", "function save() {\r\n const uname = context.user && context.user.username;\r\n const time = new Date().toLocaleTimeString();\r\n const searchValue = value.length > 0 ? value : \"\";\r\n const newData = { uname, searchValue, time };\r\n if (localStorage.getItem(\"data\") === null) {\r\n localStorage.setItem(\"data\", \"[]\");\r\n }\r\n\r\n var oldData = JSON.parse(localStorage.getItem(\"data\"));\r\n oldData.push(newData);\r\n\r\n localStorage.setItem(\"data\", JSON.stringify(oldData));\r\n }", "function sauv() {\n document.getElementById('my').className='part';\n var univs={\n nomuniv: nomuniv.value,\n nomadd : nomadd.value,\n phone : phone.value,\n site : site.value,\n nommot : nommot.value\n }\n tabuniv.splice(k,1);\n tabuniv.push(univs)\n console.log('tab '+ tabuniv)\n localStorage.setItem('univs',JSON.stringify(tabuniv));\n// alert(JSON.parse(localStorage.getItem('univs'))[k].nomuniv)\n document.getElementById('bien').innerHTML='Bienvenue chez '+ JSON.parse(localStorage.getItem('univs'))[k].nomuniv;\n document.getElementById('ecole').className='s';\n document.getElementById('tnom').innerHTML= JSON.parse(localStorage.getItem(\"univs\"))[k].nomuniv;\n document.getElementById('tadd').innerHTML= JSON.parse(localStorage.getItem(\"univs\"))[k].nomadd;\n document.getElementById('tphone').innerHTML= JSON.parse(localStorage.getItem(\"univs\"))[k].phone;\n document.getElementById('tmail').innerHTML= JSON.parse(localStorage.getItem(\"univs\"))[k].site;\n document.getElementById('tmot').innerHTML= JSON.parse(localStorage.getItem(\"univs\"))[k].nommot;\n var hana=JSON.parse(localStorage.getItem(\"univs\"))[k].nomuniv;\n localStorage.setItem('ver',hana);\n}", "setLocalStorage() {\r\n\tlocalStorage.setItem('userPantry', JSON.stringify(this.state.userIngredients))\r\n }", "function savePomoData() {\n localStorage.setItem(\"cpid\", currentPomoID);\n localStorage.setItem(\"pomoData\", JSON.stringify(pomoData));\n}", "function addItem(id, article, author, words, shares) \n{\n let datenkorbArray = JSON.parse(localStorage.getItem('databasket_js_1')) || []; \n var newItem = \n { \n\t\"id\" : id, \n\t\"article\": article,\n\t\"author\": author, \t\n\t\"words\": words, \n\t\"shares\": shares\n } \n \n //pushs item on a array\n datenkorbArray.push(newItem);\n //saves entry in the localStorage\n localStorage.setItem('databasket_js_2', JSON.stringify(datenkorbArray));\n}", "function leerLocalStorage(){\n\tlet cursosLS;\n\n\tcursosLS = obtenerCursosLocalStorage();\n\n\tconsole.log(cursosLS);\n\n\t// Leer cada curso de manera individual para procesar la información hacia el DOM\n\tcursosLS.forEach((item) => {\n\t\t// Construir Template\n\t\tconst row = document.createElement('tr');\n\t\trow.innerHTML = `\n\t\t\t<td><img src=\"${item.imagen}\" width=\"100\"></td>\n\t\t\t<td>${item.titulo}</td>\n\t\t\t<td>${item.precio}</td>\n\t\t\t<td>\n\t\t\t\t<a href=\"#\" class=\"borrar-curso\" data-id=\"${item.id}\">X</a>\n\t\t\t</td>\n\t\t`;\n\n\t\tcursosCarrito.appendChild(row);\n\t});\n\n}", "function storeLocal() {\n $.get(\"/api/commander\").then(function(results) {\n localStorage.setItem(\"mtgCommanders\", JSON.stringify(results));\n $.get(\"/api/league_data\").then(function(data) {\n localStorage.setItem(\"data\", JSON.stringify(data));\n window.location.replace(\"/setup\");\n });\n });\n }", "function setLocalStorage(chave, valor, minutos)\n{\n var expirarem = (new Date().getTime()) + (60000 * minutos);\n\n localStorage.setItem(chave, JSON.stringify({\n \"value\": valor,\n \"expires\": expirarem\n }));\n}", "function guardarLocalStorage(clave, valor) {\n localStorage.setItem(clave, JSON.stringify(valor)); \n}", "function createLocalStorage(){\n\n let convertS= JSON.stringify(Busmall.allBus);\n // console.log(convertS);\n localStorage.setItem('myProducts', convertS);\n\n}", "secondo(){\n localStorage.setItem('points_' + this.props.type + '_3', localStorage.getItem('points_' + this.props.type + '_2'));\n localStorage.setItem('time_' + this.props.type + '_3', localStorage.getItem('time_' + this.props.type + '_2'));\n localStorage.setItem('points_' + this.props.type + '_2', this.props.points);\n localStorage.setItem('time_' + this.props.type + '_2', this.props.time);\n }", "function savePurchase() {\n var purchaseCounter = localStorage.getItem(\"purchase\");\n if (purchaseCounter == null) {\n purchaseCounter = 1;\n } else {\n purchaseCounter++;\n }\n\n localStorage.setItem(\"purchase\", purchaseCounter);\n\n var purchaseData = [];\n purchaseData.push(\"Película: \" + $(\"#titleFilm .emphasis\").text());\n purchaseData.push(\"Nombre: \" + $(\"#first-name\").val());\n purchaseData.push(\"Apellidos: \" + $(\"#last-name\").val());\n purchaseData.push(\"Email: \" + $(\"#address\").val());\n purchaseData.push($(\"#totalPrice .subtotal\").text());\n purchaseData.push(\"Asientos: \" + seatIDs);\n\n localStorage.setItem(\"purchase_\" + purchaseCounter, JSON.stringify(purchaseData));\n}", "save () {\n localStorage.setItem(STORAGE_KEY, JSON.stringify(this.allMyTrips))\n }", "function leerLocalStorage() {\n let cursosLS;\n let totalLS = obtenerTotalLocalStorage();\n compras.innerHTML = `sub total: ${totalLS}`;\n cursosLS = obtenerCursosLocalStorage();\n comprar.innerHTML = `<a href=\"/shopcar.html\" class=\"button u-full-width\">comprar</a>`;\n cursosLS.forEach(function(curso) {\n // constrir el template\n const row = document.createElement(\"tr\");\n row.innerHTML = `\n <td> \n <img src=\"${curso.imagen}\" width=100>\n </td>\n <td>${curso.titulo}</td>\n <td>${curso.precio}</td>\n <td>\n <a href=\"#\" class=\"borrar-curso\" data-id=\"${curso.id}\">X</a>\n </td>\n `;\n listaCursos.appendChild(row);\n });\n}", "function saveProductToStorage(product)\n{\n let products=getProductsFromStorage();\n products.push(product);\n localStorage.setItem(\"products\",JSON.stringify(products));\n}" ]
[ "0.7971278", "0.7626354", "0.7330149", "0.7255275", "0.71616066", "0.7054878", "0.6964389", "0.6949826", "0.6872633", "0.68674177", "0.6850646", "0.68341774", "0.6806295", "0.679144", "0.6769827", "0.67338735", "0.6719077", "0.6713203", "0.6705794", "0.66593254", "0.6624388", "0.6612061", "0.6609706", "0.6609557", "0.6602505", "0.65904343", "0.65889245", "0.6555156", "0.65421224", "0.65390515", "0.6536093", "0.6503956", "0.65016794", "0.6500177", "0.64851165", "0.64845383", "0.648289", "0.6463796", "0.64541966", "0.64427996", "0.64406794", "0.64316916", "0.642627", "0.64156294", "0.64108336", "0.6398283", "0.639141", "0.63884884", "0.6374275", "0.63725644", "0.6357986", "0.63559115", "0.6354695", "0.63540083", "0.6345764", "0.6345683", "0.6335785", "0.6327341", "0.63241494", "0.630972", "0.63064134", "0.63049555", "0.6304637", "0.63028955", "0.6300705", "0.62991196", "0.6298307", "0.62917453", "0.62847096", "0.6278483", "0.62640405", "0.6263282", "0.6261406", "0.626085", "0.6260125", "0.62296003", "0.622833", "0.6227034", "0.62221104", "0.62197596", "0.6219695", "0.62180144", "0.6212924", "0.6207793", "0.620454", "0.6200479", "0.6199143", "0.61931676", "0.6189017", "0.6182266", "0.6182154", "0.6176683", "0.61718446", "0.61695796", "0.6168486", "0.61682445", "0.61670697", "0.6160438", "0.6157819", "0.61568385", "0.61548525" ]
0.0
-1
alertMsg.setAttribute('class', 'dnone') Cette fonction permet d'afficher
function msgAddShopBasket() { //Si la balise option avec l'attribut "selected" est sélectionnée quand l'user commande son article. if (selectOption.selected === true) { //Changer la couleur de l'input si l'user ne choisit pas la couleur du produit + alerte indiquant à l'user qu'il doit choisir une couleur. alertMsg.classList.add('alert-danger') let removeColor = document.querySelector('#selectColor') removeColor.classList.remove('border-primary') removeColor.classList.add('border-danger') alertMsg.classList.remove('d-none') alertMsg.innerHTML = "Veuillez sélectionner une couleur" //Sinon l'input prend la couleur de validation et un message de confirmation est envoyé à l'user. } else { let removeColor = document.querySelector('#selectColor') removeColor.classList.add('border-success') removeColor.classList.remove('border-danger') alertMsg.classList.remove('d-none') alertMsg.classList.remove('alert-danger') alertMsg.classList.add('alert-success') alertMsg.innerHTML = "Un nouvel article a été rajouté à votre panier !" } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearAlert(){\n noChecksAlert.className = \"d-none\";\n}", "hide(){\n this.alert.classList.add('d-none');\n }", "show(message){\n this.alert.classList.remove('d-none');\n this.alert.innerText = message;\n }", "function Ocultar() {\n setTimeout(function () {\n const alertas = $(\".alert\")\n for (let i = 0; i < alertas.length; i++) {\n const element = alertas[i];\n element.classList.add('d-none');\n }\n }, 2000);\n}", "function clearInfoMessage() {\n var messageBox = document.getElementById('message-box');\n messageBox.className = 'alert';\n}", "showAlert(m, className) {\n const message = document.createElement('div');\n message.className = `alert ${className} `;\n message.appendChild(document.createTextNode(m));\n //console.log(message);\n const cardContent = document.querySelector('.row');\n const form = document.querySelector('#movie-form');\n cardContent.insertBefore(message, form);\n //Alert dissapers after 2 seconds\n setTimeout(function () {\n document.querySelector('.alert').remove();\n }, 2000);\n }", "function resetErrorMsgElement() {\n $(\"#messages\").removeAttr(\"class\").empty();\n}", "function userAlert(alert_classes, message) {\n let myAlert = document.getElementsByClassName('alert')[0];\n myAlert.classList = alert_classes;\n myAlert.textContent = message;\n setTimeout(function () {\n myAlert.classList = 'alert';\n myAlert.innerText = '\\u00a0';\n }, 3000);\n }", "function resetAlert() {\r\n for (let campo of document.getElementsByClassName(\"erroreSpecifico\")) {\r\n campo.style.display = \"\";\r\n //console.log(campo);\r\n }\r\n setAlertDivInvisible();\r\n}", "function messageInitial() {\n let alertEmpty = document.querySelector(\"#alert-empty\")\n\n if (listTask.length == 0) {\n alertEmpty.classList.add('on')\n } else {\n alertEmpty.classList.remove('on')\n }\n}", "printMessage(msg, className){\r\n\t\tconst message = document.createElement('div');\r\n\t\tmessage.classList.add('text-center', 'alert', className);\r\n\t\tmessage.appendChild(document.createTextNode(msg));\r\n\t\tdocument.querySelector('.primary').insertBefore(message, addExpenseForm);\r\n\r\n\t\t// Remove the warning\r\n\t\tsetTimeout(function(){\r\n\t\t\tmessage.remove();\r\n\t\t}, 3000);\r\n\t\t\r\n\t}", "function displayAlert(message, className) {\n alertMessage.classList.add(className);\n alertMessage.textContent = message;\n alertMessage.classList.remove(\"d-none\");\n setTimeout(function () {\n alertMessage.classList.remove(className);\n alertMessage.text = message;\n alertMessage.classList.add(\"d-none\");\n }, 3000);\n}", "static showAlert(message,className) {\n const div = document.createElement('div');\n div.className = `alert alert-${className}`;\n\n div.appendChild(document.createTextNode(message));\n\n const form = document.querySelector('#_form');\n\n const title = document.querySelector('.titletextinput');\n\n form.insertBefore(div,title);\n\n setTimeout(() => document.querySelector('.alert').remove(), 1000);\n }", "function clearNoResultsAlert() {\r\n console.log (\"##f()## clearNoResultsAlert function execution\");\r\n try {\r\n let noResultsIcon= document.getElementById('no-results-icon');\r\n let noResultsText= document.getElementById('no-results-text');\r\n let noResultsIconClasses = noResultsIcon.classList;\r\n console.log(\"Clases del ícono de No Results: \"+noResultsIconClasses);\r\n console.log(noResultsIconClasses.length);\r\n if(noResultsIconClasses.length==1){\r\n noResultsIcon.classList.add('hide');\r\n noResultsText.classList.add('hide');\r\n }\r\n } catch (err) {\r\n console.log(\"There is no No Results Alert to delete\"+err);\r\n }\r\n}", "function dle(abc) {\r\n document.getElementById(abc).innerHTML = \"\";\r\n document.getElementById('span').className += \" alert\";\r\n var element = document.getElementById('span');\r\n element.classList.remove(\"alert-success\");\r\n document.getElementById('span').className += \" alert-danger\";\r\n document.getElementById('span').innerHTML = \"Deleted Successfully\";\r\n}", "showMessage(message,className){\n // create message element\n const div = document.createElement('div');\n div.className = `alert ${className}`;\n div.appendChild(document.createTextNode(message));\n\n //append to form\n \n const parentFormUI = document.querySelector('.add-error');\n const formUI = document.querySelector('.painting-form');\n parentFormUI.insertBefore(div,formUI);\n\n //set Timeout after 3 seconds\n setTimeout(function(){\n document.querySelector('.alert').remove()}, 3000);\n }", "static showAlert(message, className) {\n\t\tconst div = document.createElement('div');\n\t\tdiv.className = `alert alert-${className}`;\n\t\tdiv.appendChild(document.createTextNode(message));\n\t\tconst container = document.querySelector('.container');\n\t\tconst form = document.querySelector('#book-form');\n\t\tcontainer.insertBefore(div, form);\n\t\t//this is a method we created but we need to call it somewhere\n\t\t//and its going to be in 'Validate'\n\n\t\t//vanishing in 3 sec\n\t\t//if not this method is will continue to add this alrert on the screen\n\t\tsetTimeout(() => document.querySelector('.alert').remove(), 3000);\n\t}", "function removeAlert() {\n document.querySelector('#registration-alert').classList.add('hidden');\n}", "static showAlert(message, className) {\n var div = document.createElement('div');\n div.className = `alert alert-${className}`;\n div.appendChild(document.createTextNode(message));\n var container = document.querySelector('.container');\n var form = document.querySelector('#employee-form');\n container.insertBefore(div, form);\n\n setTimeout(() => document.querySelector('.alert').remove(), 3000);\n }", "static showAlerts(message, className) {\n // CREATE ALERT DIV WITH ALL NECESSARY PROPERTIES\n const div = document.createElement('div');\n div.className = `alert alert-${className}`;\n // ADD MESSAGE TO THIS DIV\n div.appendChild(document.createTextNode(message));\n // ADD DIV TO DOM\n const container = document.querySelector('.container');\n const form = document.querySelector('#journal-form');\n container.insertBefore(div, form);\n\n // Vanish in 3 seconds\n setTimeout(() => document.querySelector('.alert').remove(), 3000);\n }", "static showAlertRemoved(message, className) {\n const div = document.createElement('div');\n div.className = `${className}`;\n div.appendChild(document.createTextNode(message));\n const libraryContainer = document.querySelector(\".library-container\");\n const library = document.querySelector(\"#library\");\n libraryContainer.insertBefore(div, library);\n // Vanish\n setTimeout(() => document.querySelector('.book-removed').remove(), 5000);\n }", "mostrarAlerta(msj, clase) {\n this.removerAlerta();\n const divAlerta = document.createElement(\"div\");\n divAlerta.className = clase;\n divAlerta.appendChild(document.createTextNode(msj));\n document.getElementById(\"c-detalles\").prepend(divAlerta);\n\n \n setTimeout(() => {\n this.removerAlerta();\n }, 3000);\n }", "alertUp(text,status){\r\n const div = document.createElement('div')\r\n div.className = `alert alert-${status} alertup`\r\n div.innerHTML = `${text}`\r\n alertContainer.prepend(div)\r\n\r\n setTimeout(()=>{\r\n div.remove()\r\n },2000)\r\n }", "static alert(message,className){\n const div=document.createElement('div');\n div.className = `alert alert-${className}`;\n div.appendChild(document.createTextNode(message));\n const container=document.querySelector('.container');\n const form = document.querySelector('#book-form');\n container.insertBefore(div,form);\n //Setting the timeout so that the alert disappears in 2sec\n setTimeout(() => document.querySelector('.alert').remove(), 2000);\n }", "static showAlert(message, className) {\n const div = document.createElement('div');\n div.className = `alert alert-${className}`;\n div.appendChild(document.createTextNode(message));\n const container = document.querySelector('.tobuy-cont-styling');\n const form = document.querySelector('#buy-books-form');\n container.insertBefore(div, form); // Insert DIV Before Form\n\n // Message Vanishes in 3 Seconds\n setTimeout(() => document.querySelector('.alert').remove(), 3000);\n }", "function alert(msg, color, remclass) {\n\t$('#alert').text(msg);\n\t$(\"#alert\").addClass(color);\n\t$(\"#alert\").removeClass(remclass);\n}", "function setErrorMsg(errorMsg = \"\", target) {\n target.setAttribute(\"data-error\", errorMsg);\n target.setAttribute(\"data-error-visible\", \"true\"); \n}", "function showAlert(message,classname){\n const comment = document.querySelector(\"#comment\");\n const container = document.querySelector('#comment-container');\n const div = document.createElement('div');\n div.appendChild(document.createTextNode(message));\n div.className = classname;\n \n container.insertBefore(div,comment);\n setTimeout(clearAlert,3000);\n}", "showAlert(message, className) {\r\n //Creating a new DIV element.\r\n const div = document.createElement('div');\r\n //Adding a class into the element.\r\n div.className = `alert ${className}`;\r\n //Adding a text node.\r\n div.appendChild(document.createTextNode(message));\r\n //Getting parent.\r\n const container = document.querySelector('.container');\r\n //Getting form.\r\n const form = document.querySelector('#book-form');\r\n //Insert the alert.\r\n container.insertBefore(div, form);\r\n //Setting timeout.\r\n setTimeout(function() {\r\n document.querySelector('.alert').remove();\r\n }, 3000);\r\n }", "function hideLoadTheMessage(){\n loadingMessage.classList.add(\"elementIsNotVisible\")\n console.log(\"message is removed\");\n}", "function showToggleAlert() {\n document.getElementById(\"pop\").removeAttribute(\"hidden\");\n}", "displayMessage(message, classname){\n let messageDiv = document.createElement('div');\n messageDiv.className= classname;\n let messageText = document.createTextNode(message);\n \n\n messageDiv.appendChild(messageText);\n document.getElementById('alertDiv').append(messageDiv);\n setTimeout(()=>{\n document.getElementById('alertDiv').innerHTML=\"\";\n },5000)\n }", "function clearMessage() {\r\n\r\n // select those classed and save them\r\n const alert = document.querySelector('.error');\r\n const success = document.querySelector('.success');\r\n\r\n //if alert is true\r\n if (alert) {\r\n //remove element || message\r\n alert.remove();\r\n // if success is true\r\n } else if (success) {\r\n //remove element || message\r\n success.remove();\r\n\r\n }\r\n}", "function loadTheMessage(){\n loadingMessage.classList.remove(\"elementIsNotVisible\")\n console.log(\"message is added\");\n}", "static showAlert (messg, className) {\n\t\tconst alertDiv = document.createElement('div');\n\t\talertDiv.className = `alert alert-${className}`;\n\t\talertDiv.textContent = `${messg}`;\n\t\t//Grab the container class and the form class and insert the alert div before the form element\n\n\t\tconst form_parent = document.querySelector('.form-parent');\n\t\tconst form = document.querySelector('#book-form');\n\t\tform_parent.insertBefore(alertDiv, form);\n\n\t\t//Vanish alert after 2 seconds\n\n\t\tsetTimeout(() => document.querySelector('.alert').remove(), 2000);\n\t}", "function showAlert(message, classname) {\n const error = document.createElement('div')\n error.className = `alert ${classname}`\n error.appendChild(document.createTextNode(message))\n\n const parent = document.getElementsByClassName('container')[0]\n const child = document.getElementById('book-form')\n parent.insertBefore(error, child)\n setTimeout(function () {\n error.remove()\n }, 3000)\n}", "function showAlert(tempAlert,tempClass,tempText){\r\n tempAlert.className = tempClass;\r\n tempAlert.innerHTML = tempText;\r\n tempAlert.style.display = 'block';\r\n setTimeout(function(){\r\n tempAlert.style.display = 'none';\r\n },2000);\r\n}", "showAlert(message, className){\n this.clearAlert();\n\n // cria div de alerta\n const div = document.createElement('div');\n // adiciona classes\n div.className = className;\n // adiciona texto da mensagem\n div.appendChild(document.createTextNode(message));\n // pega elemento-pai\n const container = document.querySelector('.postsContainer');\n // retorna posts \n const posts = document.querySelector('#posts');\n // insere div de alerta\n container.insertBefore(div, posts);\n\n // contagem regressiva\n setTimeout(() => {\n this.clearAlert();\n }, 3000);\n }", "function alert2(str) {\n var div = document.createElement('div');\n div.className = 'alert alert-info alert-dismissible';\n div.setAttribute('role', 'alert');\n\n var btn = document.createElement('button');\n btn.className = 'close';\n btn.type = 'button';\n btn.setAttribute('data-dismiss', 'alert');\n btn.setAttribute('aria-label', 'Close');\n var span = document.createElement('span');\n span.setAttribute('aria-hidden', true);\n span.className = 'glyphicon glyphicon-remove';\n //span.appendChild(document.createTextNode('&times;'));\n btn.appendChild(span);\n\n div.appendChild(btn);\n div.appendChild(document.createTextNode('Warning! ' + str));\n\n const alert_area = document.querySelector('#alert-area');\n\n //this is for removing\n while (alert_area.lastChild)\n alert_area.removeChild(alert_area.lastChild);\n\n alert_area.appendChild(div);\n\n }", "function setErrorMessage(message) {\n $(\"div#errorMsg #eMsg\").html(message);\n $(\"div#errorMsg\").removeClass(\"hidden\");\n\n if (!$(\"div#systemMsg\").hasClass(\"hidden\"))\n $(\"div#systemMsg\").addClass(\"hidden\");\n}", "function usernameFailed() {\n var username = document.getElementById(\"usernamefeedback\");\n username.setAttribute(\"class\", \"form-group has-error has-feedback\");\n}", "showAlert(msg, className){\n // Create div\n const div = document.createElement('div');\n\n // Add classes\n div.className = `alert ${className}`;\n \n // Add text\n div.appendChild(document.createTextNode(msg));\n\n // Get parent\n const container = document.querySelector('.container');\n const form = document.querySelector('#book-form');\n\n // Insert alert\n container.insertBefore(div, form);\n setTimeout(function(){\n document.querySelector('.alert').remove();\n }, 3000);\n }", "function setSeverityClass (el, severity) {\n el.classList.remove('bad', 'warn', 'good')\n const cls = severityClassMap[severity]\n if (cls) el.classList.add(cls)\n el.style.display = cls ? 'block' : 'none'\n}", "showMessage(mensaje, cssclase){\n const div = document.createElement('div');\n div.className = `alert alert-${cssclase} mt-3`;//concatenamos con el parametro clase\n div.appendChild(document.createTextNode(mensaje));\n // mostrando en el DOM\n const container = document.querySelector('.container');\n const app = document.querySelector('#app');\n \n\n container.insertBefore(div,app);\n\n setTimeout(function(){\n document.querySelector('.alert').remove();\n }, 3000);\n }", "showAlert(message, className) {\n const div = document.createElement('div');\n div.className = `alert alert-${className}`;\n // to pass text => TextNode\n div.appendChild(document.createTextNode(message));\n\n const container = document.querySelector('.container');\n const form = document.querySelector('#book-form');\n // parent element => container\n container.insertBefore(div, form);\n\n // vanish in 3 seconds => 3000 miliseconds (to not show many alerts)\n setTimeout(() => {\n document.querySelector('.alert').remove();}, 3000);\n }", "function noDanger(){\n time.classList.add(\"ok\");\n time.classList.remove(\"danger\");\n time.classList.remove(\"warning\");\n}", "static messageNoData() {\n //\n noDataMessage.style.display = 'block';\n }", "_messageChecker() {\n this.listCollection.length > 0\n ? noListMessage.classList.add(\"hidden\")\n : noListMessage.classList.remove(\"hidden\");\n // console.log(`heelo`);\n }", "function alertas() {\r\n var aletas = document.getElementById(\"alerta\");\r\n alertas.innerHTML = \"<div class='alert alert-danger alert-dismissible'>\" +\r\n \"<button type='button' class='close' data-dismiss='alert'>\" + \"&times;\" + \"</button>\" +\r\n \"<strong>\" + \"Danger!\" + \"</strong>\" + \"This alert box could indicate a dangerous or potentially negative action.\" +\r\n \"</div>\";\r\n\r\n}", "function renderAlert(message, className){\n\n //Set Dom vairables for where the alert will be placed and create a new alert component\n const inputDiv = document.getElementById('input-div');\n const inputForm = document.getElementById('param-form');\n const alert = document.createElement('div');\n alert.id = \"alert\";\n alert.className = \"alert center-text \" + className;\n alert.appendChild(document.createTextNode(message));\n\n //Check that an alert is not already displayed\n if(document.getElementById(\"alert\")){\n document.getElementById('alert').remove();\n inputDiv.insertBefore(alert, inputForm);\n setTimeout(() =>{\n alert.remove();\n }, 3000);\n }else{\n inputDiv.insertBefore(alert, inputForm);\n setTimeout(() =>{\n alert.remove();\n }, 3000);\n }\n }", "function msgAlert(TITLE,MESSAGE) {\n \"use strict\"; \n document.getElementById(\"errormessage\").innerHTML = `<span class='closebtn' onclick=\"this.parentElement.style.visibility='hidden';\"'>&times;</span><strong> ${TITLE} </strong> ${MESSAGE}`;\n errormessage.style.visibility = 'visible';\n}", "showAlert(message, className) {\n // Create DIV\n const div = document.createElement('div');\n // Add classes \n div.className = `alert ${className}`;\n // Add text\n div.appendChild(document.createTextNode(message))\n\n // Get parent\n const postParent = document.getElementById('postParent');\n\n // Get container\n const container = document.getElementById('postContainer');\n\n // Insert alert\n postParent.insertBefore(div, container);\n // Timeout after 3 sec\n setTimeout(function () {\n document.querySelector('.alert').remove();\n }, 3000);\n }", "function displayFlash(msg, cls, strong){\n var content = \"<div class='alert \" + (cls!= undefined ? cls : '') +\"'> \" + (strong ? '<strong>' : '') + msg + (strong ? '</strong>' : '') + \"<a class='close' data-dismiss='alert' href='#'>×</a> </div>\";\n $(\"div.container:eq(1) .alert:first\").remove();\n $(\"div.container:eq(1)\").prepend(content);\n}", "function addClassBack4() {\n let wrong = document.getElementById(\"wrong4\");\n wrong.classList.add(\"d-none\");\n}", "function tempAlert(msg,duration,msgtype)\n\t{\n\t var el = document.createElement(\"div\");\n\t if(msgtype==\"red\"){\n\t el.setAttribute(\"style\",\"height:30px;font-weight: bold;position:absolute;top:90%;left:40%;color:white;background-color:#FF0000;\");\n\t } else {\n\t \tel.setAttribute(\"style\",\"height:30px;font-weight: bold;position:absolute;top:90%;left:40%;color:white;background-color:#7DBF0D;\");\n\t }\n\t el.innerHTML = msg;\n\t setTimeout(function(){\n\t el.parentNode.removeChild(el);\n\t },duration);\n\t document.body.appendChild(el);\n\t}", "showAlert ( message, className ) {\n // Clear any initial alert \n this.clearAlert();\n\n const div = document.createElement( \"div\" );\n div.className = className;\n div.appendChild( document.createTextNode( message ) );\n const container = document.querySelector(\".searchContainer\");\n const search = document.querySelector( \".search\" );\n container.insertBefore( div, search );\n\n // Remove alert after three seconds\n setTimeout(() => {\n this.clearAlert();\n }, 3000);\n }", "function notify(newAlert){\n\t\t// change the alert message\n\t\tdocument.getElementById(\"alert-content\").innerHTML = newAlert;\n\t\t// alert animations\n\t\tvar box = document.getElementById(\"alert-wrapper\");\n\t\tbox.className = \"visible\";\n\t\tsetTimeout(function(){ box.className = \"hidden\" }, 2500);\n\t}", "function sendmsg(msg, msgClass) {\n var message = document.createElement(\"div\");\n message.className = `alert alert-${msgClass} m-2`;\n message.innerHTML = `${msg}`;\n var coll = document.querySelector(\".addnote\");\n coll.insertBefore(message, document.querySelector(\".form-container\"));\n setTimeout(() => {\n document.querySelector(\".alert\").remove();\n }, 2000);\n}", "hideMessage() {\n this.messageContainerEl.innerHTML = '';\n this.messageContainerEl.classList.remove('visible');\n }", "function addItem(i){\n\t//console.log(\"Item added : \"+info.List[i][\"caption\"]);\n\tvar textHandle = document.getElementById(\"confirm-text\");\n\ttextHandle.innerHTML = inform.List[i][\"caption\"];\n\tvar divHandle = document.getElementById(\"confirm-event\");\n\tdivHandle.removeAttribute(\"class\");\n\tsetTimeout(function(){ divHandle.setAttribute(\"class\",\"invisible\"); }, 1500);\n\t\n\t\n}", "function removeValMessage(identifier){\n `${identifier}Message`.innerText = \"\";\n identifier.classList.remove('invalid-field');\n identifier.classList.add('valid-field');\n}", "reset() {\n this.$('.toast-message').addEventListener(this.animationEvent, (e) => {\n e.currentTarget.classList.add('none');\n });\n }", "function accendiSeNotifica()\n{\n\t$('#sos').attr('class', 'badge badge-important');\n\t$('#sos').html('!');\n}", "function createWarning(message)\n{\n\tdocument.getElementById(\"status\").innerHTML = \"\";\n\tvar panel = document.getElementById(\"status\");\n\tpanel.className = \"alert alert-warning\";\n\tvar wp = document.createElement('p');\n\tvar mes = document.createTextNode(message);\n\tpanel.appendChild(wp);\n\twp.appendChild(mes);\n}", "function mostrarAlerta(msj, alerta) \n{\n var close = document.createElement(\"button\");\n var spa = document.createElement(\"span\");\n var alert = document.getElementById(alerta);\n close.setAttribute(\"type\", \"button\");\n close.setAttribute(\"onclick\", \"quitarAlerta('\"+alerta+\"')\");\n close.setAttribute(\"class\", \"close\");\n close.setAttribute(\"data-dismiss\", \"alert\");\n close.setAttribute(\"aria-label\", \"Close\");\n spa.setAttribute(\"aria-hidden\", \"true\");\n spa.innerHTML = \"&times;\";\n close.appendChild(spa); \n alert.setAttribute(\"class\", \"alert alert-warning\");\n alert.setAttribute(\"role\", \"alert\");\n alert.innerHTML = msj;\n alert.appendChild(close); \n}", "function wgm_alert(msg, status) {\n\t$('body').append(alert_html);\n\tdiv = '.wg_alert';\n\t$(div).find('.wg_alert-msg').addClass(status);\n\t$(div).find('.wg_alert-msg').html(msg);\n\t$(div).modal('show');\n\t$(div).on('hidden', function () {\n\t\t$(div).remove();\n });\n}", "function hideMsg() {\n\tsetTimeout(function() {\n \tdocument.getElementById('msg-php').classList.add(\"no-display\"); \n }, 5000);\n}", "function bsAlert(message, cls, id) {\n if (id == '') {\n id = 'alert_placeholder';\n }\n var html = '';\n var ms = 5000;\n if (cls == 'alert-warning') ms = 7000;\n html = '<div class=\"alert ' + cls + ' alert-dismissible fade in\" role=\"alert\">';\n html += '<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">';\n html += '<span aria-hidden=\"true\">&times;</span>';\n html += '</button>';\n html += '<strong>' + message + '</strong>';\n html += '</div>';\n\n if ($('#' + id).length > 0)\n $('#' + id).html(html);\n else\n alert('Alert placeholder not found on this page.');\n\n setTimeout(function () {\n // this will automatically clean alert placeholder in 5 secs\n $(\"#\" + id).html('');\n\n }, ms);\n}", "function showError(msg) {\n switch (msg) {\n case 'empty': \n errorMsg.innerHTML = errorMsg.dataset.empty;\n break;\n case 'invalid':\n errorMsg.innerHTML = errorMsg.dataset.invalid;\n break;\n default:\n console.log('May be a problem here');\n }\n // errorMsg.innerHTML = errorMsg.dataset.error;\n errorMsg.classList.add('error-msg');\n urlInput.classList.add('invalid');\n}", "function resetMessageDom () {\n $(\"#successMsg\").hide();\n // $(\"#newWish\").hide();\n }", "static show(type, message) {\n let divAlert = document.getElementById('alertMessage');\n divAlert.innerHTML = ` <div class=\"alert alert-${type} alert-dismissible fade show\" role=\"alert\">\n <strong>Message !</strong> ${message}.\n <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"alert\" aria-label=\"Close\"></button>\n </div>`;\n\n\n //fade away message from 2 sec\n setTimeout(() => {\n divAlert.innerHTML = ``;\n }, 2000);\n\n }", "limparMsgAlert() {\n divMsg.innerHTML = \"\";\n\n\n }", "function alertaPorCantidad(domElement){\n domElement.setAttribute(\"type\",\"disabled\");\n domElement.setAttribute(\"placeholder\",\"Ingrese por favor la cantidad de dinero\")\n}", "function addMsg(msg,cls){\n var msg = '<div class=\"'+cls+'\"> <a href=\"#\" class=\"close\" data-dismiss=\"alert\" >&times;</a><strong></strong>'+msg+'</div>';\n var ele = $('.errDiv').append(msg);\n window.setTimeout(function() {\n $(\".alert\").fadeTo(1500, 0).slideUp(500, function(){\n $(this).remove(); \n });\n }, 2000);\n}", "function handlerAlert() {\r\n for (let campo of document.getElementsByClassName(\"erroreSpecifico\")) {\r\n console.log(campo);\r\n if(campo.style.display === \"block\") {\r\n setAlertDivVisible();\r\n //console.log(\"campo alert visibile!\");\r\n return;\r\n }\r\n }\r\n setAlertDivInvisible();\r\n //console.log(\"campo alert invisibile!\");\r\n}", "function showAlert(message, className, location){\n let $alertDiv = $('<div>');\n $alertDiv.addClass('alert alert-'+className);\n $alertDiv.append(document.createTextNode(message));\n\n let $add = location;\n\n $add.prepend($alertDiv);\n\n // Disappear in 2 seconds\n setTimeout(() => $('.alert').remove(), 3000);\n }", "function hideResultScreen() {\n resultScreenEl.setAttribute(\"class\", \"hide\");\n}", "static alert(message, bootstarpAlertClass) {\n // create a div element to append\n const alertNode = document.createElement('div')\n // add a bootstarp attributes to the div-element\n alertNode.setAttribute('role', 'alert')\n alertNode.setAttribute('class', `alert ${bootstarpAlertClass}`)\n alertNode.setAttribute('id', 'alert')\n // add a text-message to the div-element\n alertNode.innerText = message\n\n // replace the empty-div with the new-created div-element\n document.getElementById('alert').replaceWith(alertNode)\n // finally setTimeOut to remove the alert after 3 seconds\n setTimeout(() => {\n // create empty div-element \n const emptyDiv = document.createElement('div')\n // set the id attribute for later-use\n emptyDiv.setAttribute('id', 'alert')\n // replace the alert-div with an empty-div\n document.getElementById('alert').replaceWith(emptyDiv)\n // lastlly we relaod the page to reassign the new updated keys for each book and update the screen-UI\n location.reload()\n }, 3000)\n }", "function tornarErrosInvisiveis(){\n $(errorName).addClass('deixarInvisivel');\n}", "function showAlert(msg) {\n alert.classList.remove('hide');\n alert.classList.add('alert');\n alert.textContent = msg;\n\n setTimeout(() => alert.classList.add('hide'), 3000);\n}", "function setUnchecked(div){\n if (document.getElementById(div+\"Div\").className.indexOf('has-success') != -1) {\n document.getElementById(div+\"Div\").className = document.getElementById(div+\"Div\").className.replace('has-success', 'has-error');\n document.getElementById(div+\"Ico\").className = document.getElementById(div+\"Ico\").className.replace('glyphicon-ok', 'glyphicon-remove');\n }\n}", "function showAlert(id, txtid, msg) {\n $(id).removeClass('hidden');\n $(txtid).text(msg);\n }", "function nuevaNotificacion(cantidad,activar) {\n var notify=document.getElementById('flotante-notify');\n if(activar){\n $(\"#flotante-notify\").addClass(\"notify-nueva\");\n if (notify!=null) {\n notify.setAttribute('contador',cantidad);\n }\n }\n}", "function printhtml(dom,msg)\r\n{\r\n\t$(dom).html(msg);\r\n\t$(dom).removeClass('hide');\r\n}", "function alertOfEmptyMandatoryField(alertId) {\n removeAllChildNodes(\"success\");\n document.getElementById(alertId).innerHTML =\n '<div class=\"alert alert-danger fade in\">' +\n '<a href=\"#\" class=\"close\" data-dismiss=\"alert\">&times;</a>' +\n '<strong>Error!</strong> Mandatory field is empty. Popullate it before submit.' +\n '</div>';\n}", "function emptyGallMessageActive(){\n $('.secretMessage').addClass('secretMessageToggle');\n}", "showMessage(message, cssClass) {\n const div = document.createElement('div');\n div.className = `alert alert-${cssClass} mt-2`;\n div.appendChild(document.createTextNode(message));\n // Showing in DOM\n const container = document.querySelector('.container');\n const app = document.querySelector('#app');\n container.insertBefore(div, app);\n // con el siguiente metodo eliminamos el mensaje despúes de 3seg\n setTimeout(function() {\n document.querySelector('.alert').remove(); \n }, 4000);\n }", "function hideQuiz () {\n quiz.setAttribute(\"class\", \"hide\")\n}", "limpiarMensaje() {\n const alerta = document.querySelector('.alert');\n\n if (alerta) {\n alerta.remove();\n }\n }", "function alertOfDuplicateFailure(id, name_ru) {\n removeAllChildNodes(\"success\");\n document.getElementById(\"alert1\").innerHTML =\n '<div class=\"alert alert-danger fade in\">' +\n '<a href=\"#\" class=\"close\" data-dismiss=\"alert\">&times;</a>' +\n '<strong>Error!</strong> Id is not unique, it\\'s one already accociated with <b>' + id + ' (' + name_ru + ')</b>. Try to use another id!' +\n '</div>';\n}", "function createNoTasksMessage() {\n\n // create span no tasks msg\n let msgSpan = document.createElement('span'),\n\n // cteate text no tasks\n textMsgSpan = document.createTextNode('No Tasks To Show');\n\n // append the text to msg span\n msgSpan.appendChild(textMsgSpan);\n\n // Add attribute to msgspan\n msgSpan.className = 'no-tasks-message';\n\n // Add msgspan to the theTaskesContainer\n theTaskesContainer.appendChild(msgSpan);\n\n}", "function alertOfSuccess() {\n removeAllChildNodes(\"alert\");\n document.getElementById(\"success\").innerHTML =\n '<div class=\"alert alert-success fade in\">' +\n '<a href=\"#\" class=\"close\" data-dismiss=\"alert\">&times;</a>' +\n '<strong>Success!</strong> Your changes are successfully applied. Check list of Continents to see changes added.' +\n '</div>';\n}", "function clearMessage($message) {\n\t$message.removeClass('alert alert-danger alert-info alert-success alert-warning').text(\"\");\n}", "function despAlert(message, type) {\n var wrapper = document.createElement('div')\n wrapper.innerHTML = '<div class=\"alert alert-' + type + ' alert-dismissible\" role=\"alert\">' + message + '<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"alert\" aria-label=\"Close\"></button></div>' \n despErr.current.append(wrapper)\n }", "function resetMessages(){\n $messageSucess.classList.add(\"escondido\");\n $messageError.classList.add(\"escondido\");\n $messageCarEmptyError.classList.add(\"escondido\");\n}", "function showCssMsg() {\r\n msg.innerText = ''\r\n disableButton()\r\n message.style.display = 'none'\r\n innerMsg.style.display = 'block'\r\n // var cssmsg = document.createElement('p')\r\n msg.innerText = \"Css is a cascading style sheet used for styling purpose.\"\r\n innerMsg.appendChild(msg)\r\n innerMsg.appendChild(hr)\r\n}", "function showErrorHobbies(){\r\n\t\t\tvar x = document.getElementById(\"snackbarHobbies\")\r\n\t\t x.className = \"show\";\r\n\t\t}", "function setAlertDivInvisible() {\r\n if (isAlertDivVisible()) {\r\n let div = document.getElementsByClassName(\"avvertenzeForm\")[0];\r\n div.style.visibility = \"\";\r\n div.children[0].style.display = \"\";\r\n }\r\n}", "_dismissMessage($alert) {\n $alert.addClass('dismissed');\n $alert.one('trend', () => {\n $alert.remove();\n });\n }", "function addClassBackCard() {\n let wrong = document.getElementById(\"wrongCard\");\n wrong.classList.add(\"d-none\");\n}", "function displayMessage(msg) {\n \n // Acrescenta classe à DIV para ficar à frente da DIV branca-transparente\n let element, name, arr;\n element = document.getElementById(\"msg\");\n name = \"frente\";\n arr = element.className.split(\" \");\n if (arr.indexOf(name) == -1) {\n element.className += \" \" + name;\n }\n \n // Insere os dados da mensagem de alerta na DIV e exibe a mensagem\n $('#msg').html('<div class=\"alert alert-danger\">' + msg + '</div>');\n}" ]
[ "0.70515716", "0.6893001", "0.66359484", "0.65187323", "0.64427465", "0.6426611", "0.6416795", "0.6353687", "0.62926406", "0.62647444", "0.6204296", "0.6187571", "0.6167117", "0.6142436", "0.6137017", "0.61297446", "0.6129349", "0.60927075", "0.60915196", "0.6077629", "0.607233", "0.60698676", "0.6067554", "0.6064496", "0.6017336", "0.6006682", "0.59976375", "0.5973129", "0.59644014", "0.5963834", "0.59424573", "0.5921243", "0.59178746", "0.59113204", "0.5904724", "0.5903212", "0.588389", "0.5878809", "0.5868503", "0.58536524", "0.5845877", "0.58383715", "0.5828916", "0.58134115", "0.5798681", "0.579366", "0.577024", "0.57594615", "0.57422465", "0.5740064", "0.57337433", "0.5733095", "0.57310784", "0.5730093", "0.5720641", "0.572019", "0.57102966", "0.57071143", "0.5701321", "0.56991017", "0.5698005", "0.5686186", "0.5685283", "0.56823075", "0.5676455", "0.56745356", "0.567429", "0.56720614", "0.56715447", "0.5655957", "0.5650029", "0.5643591", "0.56425667", "0.5642065", "0.56401104", "0.5637702", "0.56295484", "0.5624471", "0.5614775", "0.56140494", "0.56126696", "0.56110114", "0.5609508", "0.5604385", "0.5600101", "0.5592551", "0.5592057", "0.5589018", "0.5587765", "0.5584147", "0.55798936", "0.55736655", "0.557038", "0.55647594", "0.5560107", "0.5560053", "0.5557595", "0.55341154", "0.55301535", "0.552818", "0.5526334" ]
0.0
-1
This is a function. Familiar. Will log out 'boo' nothing complicated.
function boo() { console.log('boo'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function logFunnyJoke() {\r\n console.log(\"This is a good Joke\");\r\n}", "function foo() {\n console.log('aloha');\n }", "function logFunnyJoke() {\n console.log(\"Funny Joke :))\");\n}", "function log(foo){\n\tconsole.log(foo);\n}", "function logGreeting(fn) {\n fn();\n}", "function logGreeting(fn){\n fn();\n}", "function logSomething(log) { log.info('something'); }", "function logGreeting(fn){\n\tfn();\n}", "function x() {\n log('Mr. X!');\n }", "log() {}", "function doLog(s) {\n console.log(\"Ret>> \" + s);\n}", "function logger() {\n console.log('foo');\n}", "function doSomething(){\n console.log( 'in doSomething' );\n return 'thingy';\n} // end basic function", "function foo() {\n lib.log(\"hello world!\");\n }", "function foo() {\n console.log(bar);\n}", "function helloWorld() {\n console.log(\"hello world\", helloWorld)\n}", "function logToConsoll(code) {\r\n console.log(\"hello there \" + code);\r\n}", "function foo() {\n\tconsole.log(\"bar\")\n}", "function mylog(msg){\n if (debug == \"1\"){\n console.log(msg)\n }\n}", "function helloworld(){ //we can make a function like this\n\tconsole.log(world + hello); //everything inside will excecute when we call it\n}", "function log(a) {\n a();\n}", "function log(a) {\n a();\n}", "function logg(stuff) {\n return prod ? void 0 : console.info(stuff)\n}", "function greet(who) {\n //2. call stack here and runs console.log\n console.log(`Hello ${who}`)\n}", "function john() {\n $log.debug(\"TODO\");\n }", "function foo(){\n lib.log( \"hello world!\" );\n}", "function logGreeting(fn) {\r\n\t// greet function is invoked\r\n\tfn();\r\n}", "log(_args) {\n\n }", "function log() {\n //log here\n }", "function logA() {\n console.log(\"A\");\n}", "function sayMeow() {\n console.log(\"meow\");\n}", "function logger() {}", "function sayHello() {\n console.log(\"Hello\");\n\nconsole.log(sayHello());\n\n//needs a return, have a fnct is a preferred method that helps build big and prevents console from being written into the script\n\nreturn \"Hello\";\n}", "function logIt2(){\n console.log('The second one');\n }", "function jimmy() {\n console.log(\"Hi i'm james nice to meet you\")\n}", "function say(x) {\n\tconsole.log(x);\n}", "function consoleThis() {\n\tconsole.log('three')\n}", "function sing() {\n console.log(\"twinkle twinkle...\");\n console.log(\"how i wonder...\");\n}", "function tlog__(msg){console.log(msg);}", "function logger() {\n // returns \"undefined\", but code still runs.\n console.log(x);\n var x = \"hi\";\n}", "function _454 (){\n console.log('get a life'); \n}", "function verb(x){\n if (verbose) console.log(x)\n}", "function foo() {\n lib.log(\"hello world!\");\n}", "function doSomething(){\n\tconsole.log(something) ;\n}", "function helloWord() {\n console.log(\" cette fct hello ne return pas de val , il affiche juste un log !!!! \");\n}", "function foo() {\n\tconsole.log(\"foo\");\n}", "function log(s) {\r\n logFn && logFn(s);\r\n }", "function logGreeting(fn){\n console.log(\"This one is from a function passed into another function:\");\n fn();\n}", "function logit(obj){ console.log(obj);}", "function custom_log(string)\n{\n log(\"SKETCH2CODE | \" + string)\n}", "function log(x) {\n return console.log(x);\n}", "function sayHi(){\n console.log(\"Wassup bro\")\n}", "function greet(name) {\r\n return console.log(\"Hi \" + name + \"!\")\r\n}", "function firstThing(test) {\n console.log(\"First Thing: \" + test);\n}", "function firstThing(test) {\n console.log(\"First Thing: \" + test);\n}", "function myFun() {\n console.log(\"Hello\");\n return \"world\";\n console.log(\"byebye\");\n}", "function log() {\n console.log('x' ,x);\n console.log('y' ,y);\n console.log('z' ,z);\n console.log('a' ,a);\n console.log('----');\n}", "function genaLog(func) {\n return function() {\n let abc = func.apply(this, arguments);\n console.log(\"called\");\n return abc;\n }\n}", "function logTheArgument(someFunction) {\r\n someFunction();\r\n}", "function Log() {}", "function logger(){\n console.log(\"you logged in\");\n}", "function teste(msg) {\n console.log(msg + \" teste\");\n}", "function hi() {\n\tconsole.log('hi')\n}", "function says(str){\n console.log(str);\n}", "function printSomething(thing) {\n console.log(thing);\n}", "function greetings() {\n console.log('Hello there');\n return 'hi';\n}", "function logValue() {\n console.log('Hello, world!');\n}", "function logger() {\n console.log('My name is Jonas');\n}", "function inner() {\n // Step 1.4: Log arguments\n }", "function logger() {\r\n console.log(`Zahin`);\r\n}", "function dogBark(){\n console.log('Bark!');\n}", "function log(a) {\n console.log(a); //outputs function(){console.log('hi)}\n a(); //outputs 'hi'\n}", "function sayHowdy() {\n console.log(\"Howdy\");\n}", "function foo(){\n console.log( 1 );\n}", "function doSomething(x, y) {\r\n console.log(x + ' ' + y);\r\n return x + y;\r\n}", "function myHobies(){\n console.log(\"My hobies are Singing, listening to music and travelling\");\n}", "function consoleSomething(what){\n\t\tconsole.log('b');\n\t\tconsole.log(what);\n\t\tconsole.log(passMeAnObjectAndUpdate(myCloudObject, 'location', 'Wellington'));\n\t\tconsole.log(myCloudObject);\n\t}", "bark() {\n console.log('gau gau...');\n }", "function hello(param) {\n console.log(\"Hi \", param);\n return param;\n}", "function doLog() {\n console.log(\"This is a log message.\");\n}", "function sayHi() {\n console.log(`hi`)\n return 10\n}", "function log(s) {\n console.log(s);\n}", "function foo() {\n\treturn 'foo'\n\n}", "function sayHi(){\n console.log('hi');\n}", "function printOne(){\n console.log('one')\n}", "function foo(){\n console.log(1);\n}", "function sayName(name){\n return console.log(`hello ${name}`);\n}", "function greet(){console.log('hi');}", "function greet(){\n //console.log('Hello');\n return 'Hello';\n}", "function hello3(name){\n log('Hello '+ name);\n }", "function sayHello () {\n console.log('hello');\n console.log('bye');\n}", "function _____INTERNAL_log_functions_____(){}\t\t//{", "function Tour(message) {\n\tconsole.log(message);\n}", "function bar(c) {\n\t\tconsole.log( a, b, c);\n\t}", "function foo() {\n\tvar bar = \"bar\";\n\n\tfunction baz() {\n\t\tconsole.log(bar);\n\t}\n\n\tbam(baz)\n}", "function hola (sergio){\n console.log(\"Como estas\" + \" \" + sergio)\n}", "function hi () {\n return 'Hi'\n}", "function printSomething(){\n console.log(\"Something..\");\n }", "function foo() {\n console.log(\"foo()\");\n}", "function sayHi(param) {\n console.log(\"hi \", param);\n param();\n}" ]
[ "0.69598633", "0.6782853", "0.6772384", "0.6768125", "0.6714548", "0.66742605", "0.6652557", "0.66385233", "0.66370684", "0.6565696", "0.6554457", "0.6547843", "0.6500409", "0.6496441", "0.6422036", "0.64151895", "0.64147294", "0.6395267", "0.63835806", "0.6383021", "0.6361985", "0.63571537", "0.63539624", "0.63515395", "0.6294223", "0.6286936", "0.62716204", "0.62653977", "0.6254193", "0.62174433", "0.6203057", "0.62021834", "0.61899537", "0.61822987", "0.61781573", "0.6173069", "0.6171891", "0.61664295", "0.616469", "0.6162115", "0.6157332", "0.6151748", "0.6148329", "0.614652", "0.6136615", "0.61349446", "0.6133978", "0.61278415", "0.61252594", "0.61032695", "0.6102379", "0.60973597", "0.6091017", "0.60872763", "0.60872763", "0.60859305", "0.6073618", "0.60611933", "0.60590565", "0.6055909", "0.60480857", "0.6040236", "0.6037511", "0.6036259", "0.60350364", "0.60342157", "0.6029609", "0.60226524", "0.6022121", "0.6019778", "0.6013457", "0.60131955", "0.6010797", "0.6007949", "0.6007755", "0.60063225", "0.60035014", "0.6002525", "0.59864014", "0.5981097", "0.5980274", "0.5975204", "0.5969638", "0.596866", "0.59686047", "0.5967445", "0.59665406", "0.5965433", "0.5950525", "0.59479374", "0.59461945", "0.5942707", "0.59424454", "0.5939292", "0.5936316", "0.5935982", "0.5933169", "0.59312624", "0.5929051", "0.59282804" ]
0.6729955
4
displaysResults to the console
function displayResults(responseJson) { console.log(responseJson); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showResults() {\n\t\t\t\tconsole.clear();\n\t\t\t\tconsole.log(data);\n\t\t\t}", "function displayResults(results) {\n if (results) {\n if (prg.json && prg.inspect) {\n console.log(inspect(JSON.parse(results), false, 2, true));\n } else {\n console.log(results);\n }\n }\n}", "function displayResult(results) {\n console.log(`## ${results.description}`);\n const scores = results.scores;\n const mean = Math.round(stats.mean(scores));\n const stdDev = Math.round(stats.sampleStdev(scores));\n const min = Math.min.apply(null, scores);\n const max = Math.max.apply(null, scores);\n const barData = scores.map((entry, index) => {\n return { key: ` ${index + 1} `, value: entry, style: bg(\"green\") };\n });\n console.log(bar(barData, { barWidth: 5 }));\n console.log(\n `Statistics:: mean: ${mean}, standard deviation: ${stdDev} (min: ${min}, max ${max})\\n`\n );\n}", "function displayConsoleResults() {\n\n main()\n\n console.log(\"=== Overall Material Rarity Totals ===\")\n console.log(\"Wood Dot Totals: \" + totalWoodDots)\n console.log(\"Ore Dot Totals: \" + totalOreDots)\n console.log(\"Wheat Dot Totals: \" + totalWheatDots)\n console.log(\"Sheep Dot Totals: \" + totalSheepDots)\n console.log(\"Brick Dot Totals: \" + totalBrickDots)\n\n console.log(\"=== Positions List ===\")\n console.log(positions)\n\n console.log(\"=== Tiles List ===\")\n console.log(tilesList)\n\n console.log(\"=== Max Card Strategy ===\")\n positions.sort(compareMax)\n displayPositionNames()\n\n console.log(\"=== Resource Plenty Strategy ===\")\n positions.sort(comparePlenty)\n displayPositionNames()\n\n console.log(\"=== Resource Rarity Strategy ===\")\n positions.sort(compareRarity)\n displayPositionNames()\n\n console.log(\"=== Neighbors Strategy ===\")\n positions.sort(compareNeighbor)\n displayPositionNames()\n\n console.log(\"=== Best Neighbor Strategy ===\")\n positions.sort(compareBestNeighbor)\n displayPositionNames()\n}", "function showResults() {\n\n\t$(\"#resultstab\").removeClass('hide');\n\t$(\"#results\").removeClass('hide');\n\t$(\"#web100varstab\").removeClass('hide');\n\t$(\"#web100varsmessages\").removeClass('hide');\n\n\tinterpretResults();\n\n\t$('#ndtTab a[href=\"#results\"]').tab('show');\n\n\tdocument.getElementById(\"avgrtttext\").innerHTML = clientResults.avgrtt;\n\tsetGaugeValue(\"download\", clientResults.clientDerivedDownloadSpd);\n\tsetGaugeValue(\"upload\", clientResults.serverDerivedUploadSpd);\n\n\t// Printing property names and values using Array.forEach\n\tObject.getOwnPropertyNames(clientResults).forEach(function(val, idx, array) {\n\t\tif (clientResults[val] !== null && clientResults[val].length !== undefined && clientResults[val].length > 0 && clientResults[val].indexOf(\"function\") == -1) {\n\t\t\twriteToScreen((val + ': ' + clientResults[val]), 'web100vars');\n\t\t}\n\t});\n\n}", "function renderResults(){\n console.log(results)\n}", "function showResults(results){\n\t\n}", "function showResults() {\n\n\t\t//var results = \"<p>Wins: \" + wins + \"</p>\" + \"<p>Losses: \" + losses + \"</p>\" + \"<p>Guesses Left: \" + guessesLeft + \"</p>\" + \"<p>Your Guesses So Far: \" + guessesMade + \"</p>\";\n\n\t\tdocument.querySelector(\"#wins\").innerHTML= wins;\n\t\tdocument.querySelector(\"#losses\").innerHTML= losses;\n\t\tdocument.querySelector(\"#left\").innerHTML= \" \" + guessesLeft;\n\t\tdocument.querySelector(\"#guesses\").innerHTML= guessesMade;\n\t\t\n\n\t}// END showResults()", "function display(result) {\n console.log(result)\n}", "function displayResults(data) {\n console.log('Results that will be displayed in HTML looks like this first:', data);\n $('#results').append(resultsHTML(data));\n }", "function display_results() {\n}", "function showResults() {\n let output2 = document.createElement(\"P\");\n output2.id = \"output-score\";\n let outputText2 = document.createTextNode(\"Wins: \" + wins + \" Losses: \" + losses + \n \" Ties: \" + ties);\n\n output2.appendChild(outputText2);\n $(\"output-section\").replaceChild(output2, $(\"output-results\"));\n }", "function displayString(result) {\n let output = document.getElementById(\"results\");\n output.innerText = `${result}`;\n\n }", "function displayResults(){\n\t\t//Clear the Options section\n\t\t$(\"#options\").empty();\n\n\t\t//Display Text Results in various sections\n\t\t$(\"#questionResponse\").text(\"Here is your tally!\");\n\n\t\t$(\"#options\").append(\"<p>Correct Answers: \" + correctCount + \" </p>\");\n\t\t$(\"#options\").append(\"<p>Incorrect Answers: \" + incorrectCount + \" </p>\");\n\t\t$(\"#options\").append(\"<p>Unanswered: \" + unansweredCount + \" </p>\");\n\n\t\t//Display Start Over Button\n\t\t$(\"#startOver\").show();\n\t}", "function DisplayResults(){\n console.log(\"inscoreboard\");\n $(\"#results\").show();\n $(\"#startOverBtn\").show();\n $('#timeLeft').empty();\n $('#message').empty();\n $('#correctedAnswer').empty(); \n $('#finalMessage').html(messages.finished);\n $('#correctAnswers').html(\"Correct Answers: \" + correctAnswer);\n $('#wrongAnswers').html(\"Incorrect Answers: \" + incorrectAnswer);\n $('#unanswered').html(\"Unanswered: \" + unanswered);\n //$('#startOverBtn').addClass('reset');\n //$('#startOverBtn').show();\n //$('#startOverBtn').html('Start Over?');\n }", "function display(result) {\n console.log(`the result is: ${result}`)\n}", "function printResults() {\n print.classList.add('active');\n inputWindow.classList.add('disappear');\n songInfo.classList.add('active');\n\n print.innerHTML = `\n I see ${inputs[0].value} of ${inputs[1].value}, ${inputs[2].value} ${inputs[3].value}, too.\n <br>\n I see ${inputs[4].value} for me and you.\n <br>\n And I think to myself, what a ${inputs[5].value} world.\n `\n}", "function showResults() {\n $(\"#results\").show();\n $(\"#correctanswers\").html(\"<h3> Correct Answers: \"+correctAnswers+\"</h3>\");\n $(\"#incorrectanswers\").html(\"<h3> Incorrect Answers: \"+incorrectAnswers+\"</h3>\");\n $(\"#unansweredquestions\").html(\"<h3> Unanswered Questions: \"+unansweredQuestions+\"</h3>\");\n }", "function reportResults() {\n console.log(\"\\n\\n|---------------- RESULTS ---------------|\");\n var prettyTable = [];\n var plainText = '';\n for (var t in mTests) {\n var reportingTest = mTests[t];\n if (reportingTest.mResult == 'pass'){\n prettyTable.push([chalk.yellow(reportingTest.mName) + \": \\t\\t\", chalk.green.bold(reportingTest.mResult)]);\n }else{\n prettyTable.push([chalk.yellow(reportingTest.mName) + \": \\t\\t\", chalk.red.bold(reportingTest.mResult)]);\n }\n plainText += reportingTest.mName + \": \\t\\t\" + reportingTest.mResult + \"\\n\";\n\n for (var i in reportingTest.mInstructions) {\n var reportingInstruction = reportingTest.mInstructions[i];\n\n plainText += '\\t' + \"- \" + reportingInstruction.name + '\\t\\t' + reportingInstruction.result + '\\n';\n if (reportingInstruction.result == 'pass')\n prettyTable.push(['\\t' + \"- \" + reportingInstruction.name, chalk.green(reportingInstruction.result)]);\n else\n prettyTable.push(['\\t' + \"- \" + reportingInstruction.name, chalk.red(reportingInstruction.result)]);\n }\n }\n\n // console.log(plainText);\n\n fs.writeFileSync('./logs/test-results'+Date.now()+'.log', plainText, 'utf8');\n\n console.log(table(prettyTable));\n console.log(\"Exiting...\");\n process.exit();\n }", "function displayResult(result) {\n output.textContent = result;\n calculationIsDone = true;\n}", "function results(totalLines, totalWords) {\n document.getElementById(\n \"results\"\n ).innerHTML = `<h2>Results: Lines: ${totalLines} Words: ${totalWords}</h2> <br /> <h5>Red is a non-match. Bold is a match. Grey are non considered lines.</h5>`;\n}", "function renderResults(results) {\n\t$('.js-results').html(`You answered <span>${results}</span> out of 10 questions correctly!`);\n}", "function showResults(){\n \n $('#correct-result').show();\n $('#correct-result').html('You got ' + correct + ' questions right');\n $('#incorrect-result').show();\n $('#incorrect-result').html('You got ' + incorrect + ' questions wrong');\n $('#unanswered-result').show();\n $('#unanswered-result').html('You did not answer ' + unanswered + ' questions');\n $('#restart-result').show();\n $('#restart-result').html('Select the start button below to restart the game.');\n }", "async showResults() {\r\n document.getElementById('scenario').hidden = true;\r\n document.getElementById('results').hidden = false;\r\n\r\n const game = await this.api.getResult(this.answers);\r\n document.getElementById('game-title').innerText = game.title;\r\n document.getElementById('game-background').setAttribute('src', game.backgroundImage);\r\n document.getElementById('game-rating').innerText = game.avgRating;\r\n }", "function done() {\n\tutil.puts(\"\\nResults:\")\n\tconsole.log(matches)\n}", "function displayResults(response) {\n\t\tconsole.log(response);\n\t\tif (response.length === 0) {\n\t\t\t// Search validation\n\t\t\tinputValidator();\n\t\t} else {\n\t\t\tresultScnTitle.textContent = response[0].CommonName;\n\t\t\tvar keys = [\n\t\t\t\t'Order',\n\t\t\t\t'Suborder',\n\t\t\t\t'Infraorder',\n\t\t\t\t'Superfamily',\n\t\t\t\t'Family',\n\t\t\t\t'Subfamily',\n\t\t\t\t'Tribe',\n\t\t\t\t'Genus',\n\t\t\t\t'Subgenus',\n\t\t\t\t'Species',\n\t\t\t\t'Subspecies'\n\t\t\t];\n\t\t\tkeys.forEach(function(key) {\n\t\t\t\tvar text = response[0][key];\n\t\t\t\tif (text) {\n\t\t\t\t\tvar resItem = document.createElement('li');\n\t\t\t\t\tresItem.classList.add('result__item');\n\t\t\t\t\t\n\t\t\t\t\tvar resKey = document.createElement('span');\n\t\t\t\t\tresKey.classList.add('result__key')\n\t\t\t\t\tresKey.textContent = key + ': ';\n\t\t\t\t\tresItem.appendChild(resKey);\n\n\t\t\t\t\tvar resValue = document.createElement('span');\n\t\t\t\t\tresValue.classList.add('result__value')\n\t\t\t\t\tresValue.textContent = response[0][key];\n\t\t\t\t\tresItem.appendChild(resValue);\n\t\t\t\t\t\n\t\t\t\t\tresultScnList.appendChild(resItem);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "function displayResults() {\n if (lyric === \"\") {\n lyric = \"Couldn't find any lyrics from this track\"\n }\n id(\"lyric\").innerText = lyric;\n id(\"song-name\").innerText = trackName;\n id(\"artist-name\").innerText = artistName;\n qs(\"blockquote\").classList.remove(\"hidden\");\n qs(\"#quote\").classList.remove(\"hidden\");\n id(\"tracking\").src = tracking;\n let error = id(\"error\");\n error.innerText = \"\";\n }", "function displayResults() {\n \n $(\"#finalScore\").html(finalScore);\n $(\"#random\").html(randomNum);\n $(\"#wins\").html(wins);\n $(\"#losses\").html(losses);\n}", "function displayResult(result) {\n // put result on the page\n // console.log(result);\n $(\"#result\").html(result);\n\n\n // console.log(result);\n }", "function printResults() {\n\tfor (var i = 0; i < 3; i++) {\n\t\tconsole.log(orderedResults[i]);\n\t}\n}", "function display(result) {\n let displayArea = document.querySelector('#display-text');\n displayArea.textContent = result;\n}", "function printResults(owner, repo, results) {\n console.log(owner + '/' + repo + ':');\n\n results.forEach(function (result) {\n var mark = result.result ? '✓' : '✖';\n var output = util.format(' %s %s', mark, result.message);\n if (colors.enabled) {\n output = output[result.result ? 'green' : 'red'];\n }\n console.log(output);\n });\n}", "function displayResults (data) {\n displayList(data);\n initMap(data);\n unhideHtml();\n}", "function renderResult(results){\n listHead.innerHTML=\"\";\n if(results.length>0)\n results.forEach(displayResult);\n else{\n let listItem = document.createElement('p');\n listItem.innerHTML = 'No Result Found';\n listHead.appendChild(listItem);\n }\n }", "function showResult(response) {\n const resList = response.data;\n console.log(response.data);\n drawResultList(\n $(\"#results-container\"),\n resList,\n \"Sorry, no matched results...\"\n );\n}", "function writeResults(){\n var result = \"\";\n if(noEntry){\n result = \"Can not find an entry!\";\n }else if(exitReached){\n result = `Success! It took ${stepCount} step(s)`;\n }else {\n result = \"Cannot find an exit!\";\n }\n document.getElementById(\"results\").innerHTML = result;\n}", "function outputSPARQLResults(results) {\n for (row in results) {\n printedLine = '';\n for (column in results[row]) {\n printedLine = printedLine + results[row][column].value + ' '\n }\n console.log(printedLine)\n }\n}", "function printResult() {\n $(\"#result\").empty();\n $(\"#timer\").empty();\n\n var correctDiv = $(\"<h5>\");\n correctDiv.append(\"Correct: \" + correct)\n $(\"#result\").append(correctDiv);\n var incorrectDiv = $(\"<h5>\");\n incorrectDiv.append(\"Incorrect: \" + incorrect)\n $(\"#result\").append(incorrectDiv)\n var unansweredDiv = $(\"<h5>\");\n unansweredDiv.append(\"Unanswered: \" + unanswered)\n $(\"#result\").append(unansweredDiv);\n }", "function logResults () {\n // JS doesn't have sortable objects but it can sort arrays\n const sortable = []\n for (let artist in artistCounts) {\n const count = artistCounts[artist]\n sortable.push([artist, count])\n }\n // Sort by the object value, which is the artist count.\n sortable.sort((a, b) => a[1] - b[1])\n sortable.reverse().forEach((artistEntry) => {\n console.log(`${artistEntry[0]}: ${artistEntry[1]}`)\n })\n process.exit()\n}", "function displayQueryResults() {\n\t\t\t$scope.resultsAvailable = true;\n\t\t\tresultsOffset = 0;\n\t\t\t$scope.getNextResultsPage();\n\n\t\t}", "function qdisplay() {\n\t\t$('#main').html(\"<p>\" + test[count].b + \"</p>\");\n\t\tconsole.log(\"test[count].b\" + test[count].b)\n\t}", "function displayResults() {\n\n $(\"#resultsPage\").show();\n $('#questionPage').hide();\n setTimeout(reset, 1000 * 10);\n }", "function output(result){ console.log(result); }", "function displayResults (result) {\n console.log(result.length);\n const resultLength = result.length;\n console.log(`Found ${resultLength} person(s) by the name '${values}':`);\n let i = 1;\n\n for (let row of result) {\n const firstName = row.first_name;\n const lastName = row.last_name;\n const birthdate = row.birthdate.toISOString().split(\"T\")[0];\n console.log(`- ${i}: ${firstName} ${lastName} born '${birthdate}'`);\n i++;\n }\n}", "function logResults() {\n console.log(\"Experiment Complete!!\" );\n \n console.log(\"\\nFinal number of points in graphs:\");\n console.log(\"G1: \" + G1.numPoints);\n console.log(\"G2: \" + G2.numPoints);\n console.log(\"G3: \" + G3.numPoints);\n}", "function showResults(results) {\n\t\tvar ul = document.getElementById(\"matchResultsList\");\n\t\tclearResultsList(ul);\n\t\tvar frag = document.createDocumentFragment();\n\t\tfor (var i = 0; i < results.length; i++) {\n\t\t\tvar li = document.createElement(\"li\");\n\t\t\tli.innerHTML = results[i];\n\t\t\tfrag.appendChild(li);\n\t\t}\n\t\tul.appendChild(frag);\n\t}", "function showResults(results){\n var result = \"\";\n // got through each array and get the value of the Title only\n $.each(results, function(index,value){\n result += '<p>' + value.Title + '</p>';\n });\n // append the information into search-results div.\n $('#search-results').append(result);\n }", "function renderResults(results) {\n\n}", "function displayResults (cuisine) {\n console.log(cuisine);\n}", "function displayResults(totalWordCount, averageLength, uniqueWords) {\n\t$(\".text-report\").removeClass(\"hidden\");\n\t$(\".js-wordCount\").text(totalWordCount);\n\t$(\".js-uniqueWordCount\").text(uniqueWords);\n\t$(\".js-averageWordLength\").text(averageLength);\n}", "function printResult(res)\n{\n outputElm.innerHTML = \"\";\n \n for (var i = 0; i < res.length; i++) \n outputElm.appendChild(tableCreate(res[i].columns, res[i].values));\n \n if (outputElm.textContent == \"\") \n outputElm.textContent = \"No resources match your search\";\n}", "function gotResults(error, results){\n\tif(error){\n\t\tconsole.error(error);\n\t} else {\n\t\tconsole.log(results);\n\t\tlet index = 1;\n\t\tlet label = results[index].label;\n\t\tlet confidence = \"confidence: \"+ results[index].confidence;\n\t\tdocument.getElementById(\"label\").innerHTML = label;\n\t\tdocument.getElementById(\"confidence\").innerHTML = confidence;\n\t}\n}", "function showResultPage() {\n if (console.log('test completed')) {\n\n //log \"time/score\" to High Scores page//\n\n //Automatically open High Scores HTML//\n\n }\n}", "function displayResults() {\n var winDisplay = $(\"<p>\");\n var lossDisplay = $(\"<p>\");\n var tieDisplay = $(\"<p>\");\n winDisplay.text(\"Wins: \" + wins);\n lossDisplay.text(\"Losses: \" + losses)\n tieDisplay.text(\"Ties : \" + ties);\n $(\"#results-display\").append(winDisplay, lossDisplay, tieDisplay);\n}", "function displayResults() {\n const results = $(\"<div>\");\n \n //If there were no results, display a message\n if(venues.length === 0) {\n results.addClass(\"results__no-result-text\");\n results.append(document.createTextNode(\"No results found.\"));\n }\n //Otherwise display the results\n else { \n results.addClass(\"results__detail\");\n \n for(const venue of venues) {\n const venueObject = Venue(venue.name, venue.location.address, venue.location.postalCode, venue.location.city); \n \n //Create a div for the individual venue\n const venue_div = $(\"<div>\", {\"class\": \"results__result\"});\n \n //Create a div for the venue name and append it to the venue div\n const venue_name = $(\"<div>\", {\"class\": \"result__header\"});\n venue_name.text(venueObject.getName());\n venue_div.append(venue_name);\n \n //Append the text of the address and phone number to the venue div\n const venue_details = $(\"<div>\", {\"class\": \"result__details\"});\n venue_details.html(venueObject.getAddressString());\n venue_div.append(venue_details);\n \n //Append the venue div to the container results div\n results.append(venue_div);\n }\n }\n //Append the full list of results to the DOM\n $(\".results\").append(results);\n \n }", "function _printResults() {\n limit.innerHTML = randomNumberLimit;\n randomWithDuplicates.innerHTML = numbersWithDuplicates;\n randomWithoutDuplicates.innerHTML = numbersWithoutDuplicates;\n }", "function gotResult(results) {\n console.log(results);\n // The results are in an array ordered by probability.\n select('#result').html(results[0].label);\n select('#probability').html(nf(results[0].probability, 0, 2));\n }", "function displayResults() {\n\n $('.btn').focus();\n $('#top-result').fadeIn();\n $('.container__outside--output').fadeIn();\n $('#map').html('<img src=' + mapUrl + '>');\n $('#result').text(venue.name);\n $('#location').text(venue.address);\n $('#url').html('<a href=\"' + venue.url + '\" target=\"_blank\">Vist website</a>');\n $('#category').html('<img src=\"' + venue.icon + '64.png\">');\n \n }", "function displayResults() {\n const result = `\n <h2 class=\"animated jackInTheBox\">Game Summary</h2>\n <p>Out of ${quizQuestions.length} questions...</p>\n <p>You got ${wins} question(s) correct</p>\n <p>You incorrecty answered ${losses} question(s)<p>\n <p>You didn't answer ${unanswered} question(s)<p>\n <button class=\"btn btn-primary reset animated pulse\">Play Again</button>\n `;\n $('#time').remove();\n $('#game').html(result);\n}", "function printResults(tournamentResult) {\n let matchResults = tournamentResult.matchTable.getAllMatchResults();\n let encounterOutcomes = ServerMessageConverter.gameResultsToJson(matchResults);\n process.stdout.write(JSON.stringify(encounterOutcomes) + '\\n');\n}", "function displayResults() {\n var result = `\n <p>You get ${score} questions(s) right</p>\n <p>You missed ${loss} questions(s)</p>\n <button class=\"btn btn-primary\" id=\"reset\">Reset Game</button>\n `;\n\n $(\"#game\").html(result);\n }", "function displaySearchResults (query, results) {\n\n // We're using data-attributes to govern CSS properties of the search form/results panel\n _root.setAttribute('data-displayresults','true');\n _root.removeAttribute('data-searchinit');\n _results.removeAttribute('aria-hidden');\n _results.removeAttribute('hidden');\n\n // Display number of results found above the results list\n _results\n .querySelector('div>h2')\n .textContent = results.length +\n (results.length === 1 ? ' result' : ' results') +\n ' found for \"' + query + '\"';\n\n if (results.length < 1) { return; }\n _results.querySelector('div').insertAdjacentHTML('beforeend',\n // The fun part:\n generateMarkup(results)\n );\n }", "function displayResults() {\n\tif (h2hSelectors.player1 && h2hSelectors.player2) {\n\t\tdocument.getElementById(\"h2hWrapper\").classList.remove(\"hidden\");\n\t\tdc.renderAll(\"matchUp\");\n\t}\n}", "function gotResult(err, results) {\n\n if (err) {\n console.error(err);\n }\n\n // Create header for results\n let resultDisplay = createDiv('MobileNet predictions');\n resultDisplay.class(\"results\");\n createSpan('Class -> ');\n createSpan('Probability');\n\n // Show all results as a list\n results.forEach(function(result){\n console.log(result.className);\n createDiv(`${result.className}, -> ${Math.round(result.probability * 100)}%`)\n })\n\n}", "function displayResults() {\n var res = \"\";\n if (sStatement.length > 0 ) {\n res += \"Successfully posted: \" + sStatement + \"\\n\";\n }\n if (fStatement.length > 0 ) {\n res += \"Unsuccessfully posted: \" + fStatement;\n }\n\n nDlg.show($scope, res)\n .then(function() {\n $state.go(\"term-edit\", {id : $scope.termID});\n });\n }", "function show_results() {\n\t\t$('#mc_btns').hide();\n\t\t$('#progress-box').hide();\n\t\t$('#result-btns').show();\n\t\t$('#page-title').html('Results').hide().fadeIn(500);\n\t}", "function basicDisplayTableResults() {\n\n main()\n\n maxCardsArray = []\n resourcePlentyArray = []\n resourceRarityArray = []\n neighborsArray = []\n bestNeighborsArray = []\n\n positions.sort(compareMax)\n for (i = 0; i < positions.length; i++) {\n maxCardsArray.push((positions[i].displayName))\n }\n\n positions.sort(comparePlenty)\n for (i = 0; i < positions.length; i++) {\n resourcePlentyArray.push((positions[i].displayName))\n }\n\n positions.sort(compareRarity)\n for (i = 0; i < positions.length; i++) {\n resourceRarityArray.push((positions[i].displayName))\n }\n\n positions.sort(compareNeighbor)\n for (i = 0; i < positions.length; i++) {\n neighborsArray.push((positions[i].displayName))\n }\n\n positions.sort(compareBestNeighbor)\n for (i = 0; i < positions.length; i++) {\n bestNeighborsArray.push((positions[i].displayName))\n }\n\n totalArray = [maxCardsArray, resourcePlentyArray, resourceRarityArray, neighborsArray, bestNeighborsArray]\n\n createBasicTableHTML(totalArray, \"resultsTable\")\n}", "function printResults(result) {\n console.log('==============================')\n if (result.upgrades.length > 0) {\n console.log(getDateString(result.date).green.bold)\n } else {\n console.log(getDateString(result.date).red.bold)\n }\n let templateFile = fs.readFileSync('united_template.ejs')\n let template = _.template(templateFile)\n for (let i = 0; i < result.upgrades.length; i++) {\n console.log(template({ data: result.upgrades[i] }))\n }\n}", "function displayResults() {\n display.innerHTML = \"Character Count: \" + \"<strong>\" + charLength + \"</strong>\" + \"<br>\" + \"Word Count: \" + \"<strong>\" + wordCount + \"</strong>\";\n}", "function gotResults( error, results ) {\n if ( error ) {\n console.error( error );\n } else {\n console.log( results );\n\n let label = results[ 0 ].className;\n let prob = results[ 0 ].probability;\n\n fill( 0 );\n textSize( 30 );\n text( label, 10, height - 100 );\n text( prob, 10, height - 50 );\n }\n}", "function displayResult (param){\n\tconsole.log(param);\n}", "function gotResult(error, results) {\r\n // Display error in the console\r\n if (error) {\r\n console.error(error);\r\n } else {\r\n // The results are in an array ordered by confidence.\r\n console.log(results);\r\n\r\n\r\n const label = document.createElement(\"div\");\r\n label.classList.add(\"label\");\r\n\r\n label.innerHTML = 'Label: ' + results[0].label;\r\n document.body.appendChild(label)\r\n\r\n\r\n\r\n const confidence = document.createElement(\"div\");\r\n confidence.classList.add(\"confidence\");\r\n\r\n confidence.innerHTML = 'Confidence: ' + floor(results[0].confidence * 100) + '%';\r\n document.body.appendChild(confidence)\r\n\r\n }\r\n}", "function logResults(data) {\n console.log(data);\n}", "function showResults(cupCost, cupPrice) {\n\n console.log();\n console.log(\"------- DISPLAYING RESULTS -------\");\n\n resultForQty(20, cupPrice, cupCost);\n resultForQty(50, cupPrice, cupCost);\n resultForQty(100, cupPrice, cupCost);\n resultForQty(500, cupPrice, cupCost);\n\n}", "function results () {\n \n stop();\n\n $(\"#time\").empty();\n $(\"#correctAnswers\").text(\"Correct Answers: \" + correctAnswers);\n $(\"#incorrectAnswers\").text(\"Incorrect Answers: \" + incorrectAnswers);\n $(\"#unansweredQuestions\").text(\"Unanswered Questions: \" + unansweredQuestions);\n $(\"#results\").show();\n \n }", "function displayResultList(resultsArray) {\n resultsArray.forEach(function (gmObject) {\n resultItem.innerHTML += '<li><span class=\"highlight\">From:</span> ' + companyname + ' ' + gmObject.from + '<br /><span class=\"highlight\">To:</span> ' + gmObject.to + '<br /><br /> <span class=\"highlight\">Walking distance:</span> ' + '<strong>' + gmObject.distance + '</strong></li>';\n });\n }", "function renderResults(servings, standardDrinks, calories) {\n\t\tif (window.logCalculations && (servings || standardDrinks || calories)) {\n\t\t\tconsole.log('=== Calculated ===');\n\t\t\tconsole.log('servings: '+servings);\n\t\t\tconsole.log('standard drinks: '+standardDrinks);\n\t\t\tconsole.log('calories: '+calories);\n\t\t}\n\n\t\t$servingsDisplay.text(servings);\n\t\t$drinksDisplay.text(standardDrinks.toFixed(1));\n\t\t$caloriesDisplay.text(Math.round(calories));\n\t}", "function renderResults(){\n resultsContent.innerHTML = '';\n viewResultsButton.innerHTML = '';\n for(let i =0; i < allItems.length; i++){\n let p = document.createElement('p');\n p.textContent = `${allItems[i].name} : ${allItems[i].clicked} / ${allItems[i].viewed}`;\n viewResultsButton.appendChild(p);\n }\n}", "async displayTableOfResults(colPars, rowPars, evalCallback) {\n let tab = await this.getTableOfResults(colPars, rowPars, evalCallback);\n let col_titles = tab.cols.map(x => this._createTitle(x));\n let row_titles = tab.rows.map(x => this._createTitle(x));\n let col_widths = col_titles.map(x => Math.max(x.length + 4, 8));\n\n let first_col_width = 0;\n row_titles.forEach(x => { first_col_width = Math.max(first_col_width, x.length + 4); });\n\n // calculate color ranges\n let rmin = null, rmax = null;\n tab.results.forEach(x => {\n x.forEach(y => {\n if (rmin === null || rmin > y) {\n rmin = y;\n }\n if (rmax === null || rmax < y) {\n rmax = y;\n }\n });\n });\n this._prepareColorShades(rmin, rmax);\n\n // ok, start with display\n let row = \"\", row2 = \"\";\n\n row += \"| \" + this._padToWidth(\"\", first_col_width);\n row2 += \"|-\" + this._padToWidth(\"\", first_col_width, \"-\");\n for (let i = 0; i < col_titles.length; i++) {\n row += \"| \" + this._padToWidth(col_titles[i], col_widths[i]).cyan;\n row2 += \"|-\" + this._padToWidth(\"\", col_widths[i], \"-\");\n }\n console.log(row);\n console.log(row2);\n\n for (let j = 0; j < row_titles.length; j++) {\n row = \"| \";\n row += this._padToWidth(row_titles[j], first_col_width).cyan;\n for (let i = 0; i < col_titles.length; i++) {\n row += \"| \" + this._outputValue(tab.results[j][i], col_widths[i]);\n }\n console.log(row);\n }\n }", "function displayResults(data){\r\n // remove all past results\r\n $(\".results\").remove();\r\n // lift WikiSearch title to top of page\r\n $(\".titleClass\").css(\"padding-top\",\"0px\");\r\n // show results\r\n \r\n const result = data[\"query\"][\"search\"][0][\"title\"];\r\n // create div for all search results\r\n $(\".searchMenu\").append(\"<div class = 'searchResults results'></div>\");\r\n // main search result title\r\n $(\".searchResults\").append(\"<div class='searchTitle'></div>\");\r\n $(\".searchTitle\").html(\"Search Results for <a target=\\\"_blank\\\" href = \\'https://en.wikipedia.org/wiki/\"+result+\"\\'>\"+result+\"</a>\"); // push titleClass to top of page\r\n \r\n // results\r\n for (var ii =1; ii < data[\"query\"][\"search\"].length -1; ii++){\r\n // create div for each result\r\n $(\".searchResults\").append(\"<div class='key\" + ii + \" result'></div>\");\r\n // append to div\r\n var searchResult = data[\"query\"][\"search\"][ii][\"title\"];\r\n $(\".key\" + ii).append(\"<p class = 'resultTitle'><a target=\\\"_blank\\\" href = \\'https://en.wikipedia.org/wiki/\"+searchResult+\"\\'>\"+searchResult+\"</a></p>\");\r\n $(\".key\"+ii).append(\"<p class = 'resultText'>\" + data[\"query\"][\"search\"][ii][\"snippet\"]+\"...\" + \"</p>\");\r\n }\r\n}", "function outputResults(score) {\n\n\n}", "function displayResults() {\n finalScore.innerHTML += `<h3>Your score is ${score}</h3>`;\n const sentences = {\n 0: \"Wax on, wax off NOOB\",\n 1: \"Wax on, wax off NOOB\",\n 2: \"Wax on, wax off NOOB\",\n 3: \"Almost there, Baby-IronHacker!\",\n 4: \"Almost there, Baby-IronHacker!\",\n 5: \"Welcome Home WebDev ! \",\n 6: \"Welcome Home WebDev ! \",\n 7: \" YEAH, Welcome to you Ironhacker!\",\n 8: \" YEAH, Welcome to you IronHacker!\",\n 9: \" Congratulations ! Biggest IRONHACKER Ever ! \",\n 10: \"Congratulations ! Biggest IRONHACKER Ever !\"\n };\n scoreSentences.innerHTML += `<p>${sentences[score]}</p>`;\n}", "function _showResults(response){\r\n\t\r\n\t\r\n\t$('#sql-query').text(response.data.qberesult.query);\r\n\tvar resultColumns = response.data.qberesult.values;\r\n\r\n\tif(resultColumns.length > 1){\r\n\t\tvar htmlString = '<table class=\"table table-bordered caption-bottom\"><thead><tr>';\r\n\t\tfor(var i in resultColumns[0]){\r\n\t\t\thtmlString += '<th>'+resultColumns[0][i] + '</th>';\r\n\t\t}\r\n\t\thtmlString += '</thead><tbody>';\r\n\t\tfor(i=1;i<resultColumns.length;i++){\r\n\t\t\thtmlString += '<tr>';\r\n\t\t\tfor(var j in resultColumns[i]){\r\n\t\t\t\thtmlString += '<td>' + resultColumns[i][j] + '</td>';\r\n\t\t\t}\r\n\t\t\thtmlString += '</tr>';\r\n\t\t}\r\n\t\thtmlString += '</tbody></table>';\r\n\t\t$('#results').html(htmlString);\r\n\t}\r\n\telse{\r\n\t\t$('#results').html(\"No results found.\");\r\n\t}\r\n\t\r\n\t\r\n\t$('#qbe-result').show();\r\n\t\r\n $('html, body').animate({\r\n scrollTop: $(\"#qbe-result\").offset().top\r\n }, 2000);\r\n\r\n\r\n}", "function showResults()\n{\n\n\tvar perviousTitle = '',\n\tresultsToShow = getSortedResults(), \n\tunits = localStorage[BG_UNITS_LOCAL_STORAGE];\n\t\n\tresetList();\n\t\n\tfor(i in resultsToShow)\n\t{\n\t\tvar title = resultsToShow[i].groupingdate;\n\t\t\n\t\tif(perviousTitle != title)\n\t\t{\n\t\t\tvar seperator = '<li class=\"sep\">'+title+'</li>';\n\t\t\tvar seperatorItem = $(seperator);\n\t\t\t$('#resultslist').append(seperatorItem);\n\t\t\tperviousTitle = title;\n\t\t}\n\t\t\n\t\tvar result = '<li class=\"arrow\"><a href=\"#edit\" id=\"result\">'+resultsToShow[i].sugar+' '+units+'<small>'+resultsToShow[i].displaytime +'</small></a></li>';\n\t\tvar resultItem = $(result);\n\t\tresultItem.bind('click',{IdForResult:resultsToShow[i].id},showResultForEditing);\n\t\t\n\t\t$('#resultslist').append(resultItem);\n\t\t\n\t}\n}", "function printToDom(result) {\n $('#displayResults').append(result);\n}", "function writeResultsToScreen(aTestcases) {\n var tc = 0;\n\n // Writes Test Filename and Creates Table\n document.write('<H3>' + aTestcases[tc].filename + '</H3>');\n document.write('<TABLE BORDER=1><TBODY>');\n \n // Writes Header\n document.write('<TR><TD><B>Description</B></TD><TD><B>Pass</B></TD>' +\n '<TD><B>Bug Number</B></TD><TD><B>Actual Result</B></TD></TR>');\n\n // Iterates through Tests writing the Test Result\n for (tc=0; tc < aTestcases.length; tc++) {\n failed = (!aTestcases[tc].result);\n\n document.write('<TR><TD' + ((failed)?' bgcolor=red style=\"color:white;\"':'') +'>' + aTestcases[tc].testcase );\n\n // Writes Bug number for Failed Tests\n if (failed) {\n document.write('<TD bgcolor=red style=\"color:white;\">failed');\n document.write('<TD bgcolor=red style=\"color:white;\">' + aTestcases[tc].bug);\n document.write('<TD bgcolor=red style=\"color:white;\">' + aTestcases[tc].actual);\n } else {\n document.write(\"<TD colspan=2>passed\");\n document.write('<TD>' + aTestcases[tc].actual);\n }\n document.write('</TR>');\n }\n\n document.write('</TBODY></TABLE>');\n}", "function showResults() {\r\n $(\"#optimalSolutionPanel\").hide();\r\n \r\n $('#results').show();\r\n experimentComplete();\r\n// enablePlayAgain();\r\n \r\n if (numRoundsWithStar >= 3) {\r\n writeAward(\"No Instruction Needed\");\r\n payAMT(true,0.20); \r\n } else {\r\n payAMT(true,0.0); \r\n }\r\n \r\n// quit();\r\n \r\n}", "function displayResults () {\n if(validateForm()) {\n // If all inputs are valid, create a user profile to calculate results\n const user = createUserProfile();\n\n // TDEE Results\n document.getElementById(\"tdee-results\").innerHTML = \"Your TDEE: results\";\n\n // BMR Results\n document.getElementById(\"bmr-results\").innerHTML = \"Your BMR: results\";\n\n // Input Results\n var inputResults = \"\";\n inputResults += \"Showing results for a \"; \n inputResults += user.get(\"activity\") + \" \" + user.get(\"age\") + \" year old \" + user.get(\"gender\") + \" who is \" + user.get(\"feet\") + \" feet \" + user.get(\"inches\") + \" inch(es) tall and weighs \" + user.get(\"weight\") + \" pounds.\"; \n document.getElementById(\"input-results\").innerHTML = inputResults;\n } else {\n document.getElementById(\"error-message\").innerHTML = \"Error\";\n }\n\n return;\n}", "function displayResults(results) {\r\n\r\n\tclearResults();\r\n\r\n\tlet convertedResults = JSON.parse(results);\r\n\tlet totalResults = convertedResults.total_results;\r\n\tlet resultsFound = convertedResults.results.length;\r\n\r\n\tdocument.querySelector(\"#found-results\").innerHTML = resultsFound \r\n\tdocument.querySelector(\"#total-results\").innerHTML = totalResults\r\n\r\n\tfor(let i = 0; i < resultsFound; i++) {\r\n\r\n\t\t// gets all necessary details from each movie\r\n\t\tlet rating = convertedResults.results[i].vote_average;\r\n\t\tlet num_voter = convertedResults.results[i].vote_count;\r\n\t\tlet synopsis = convertedResults.results[i].overview;\r\n\t\tlet poster_path = convertedResults.results[i].poster_path;\r\n\r\n\t\t// does error checking for summary length\r\n\t\tif(synopsis.length > 200) {\r\n\t\t\tsynopsis = synopsis.substring(0, 199);\r\n\t\t\tsynopsis = synopsis + \"...\";\r\n\t\t}\t\r\n\r\n\t\t// creates a div that will contain another div with\r\n\t\t// an image and 3 p's\r\n\t\t// also adds necessary sizing and spacing\r\n\t\tlet divCol = document.createElement(\"div\");\r\n\t\tdivCol.classList.add(\"col-6\");\r\n\t\tdivCol.classList.add(\"col-sm-4\");\r\n\t\tdivCol.classList.add(\"col-lg-3\");\r\n\t\tdivCol.classList.add(\"mt-4\");\r\n\t\t\r\n\t\t// this div holds the image and is what will be overlayed\r\n\t\tlet divImg = document.createElement(\"div\");\r\n\t\tdivImg.classList.add(\"column\");\r\n\r\n\t\t// creates the image that will be pulled from the api db\r\n\t\tlet imgTag = document.createElement(\"img\");\r\n\t\tif(poster_path == null) {\r\n\t\t\timgTag.src = \"images/error.jpg\";\r\n\t\t} else {\r\n\t\t\timgTag.src = \"https://image.tmdb.org/t/p/original\" + poster_path;\r\n\t\t}\r\n\r\n\t\t// creates the overlay div that will come on on hover\r\n\t\t// and adds necessary classes in order to function\r\n\t\tlet overlayDiv = document.createElement(\"div\");\r\n\t\toverlayDiv.classList.add(\"overlay\");\r\n\r\n\t\t// creates three <p> elements that all contain movie info\r\n\t\tlet ratingP = document.createElement(\"p\");\r\n\t\tlet voterP = document.createElement(\"p\");\r\n\t\tlet synopsisP = document.createElement(\"p\");\r\n\t\tratingP.innerHTML = \"Rating: \" + rating;\r\n\t\tvoterP.innerHTML = \"Total Voters: \" + num_voter;\r\n\t\tsynopsisP.innerHTML = synopsis;\r\n\r\n\t\t// appends movie info into the overlay div\r\n\t\toverlayDiv.appendChild(ratingP);\r\n\t\toverlayDiv.appendChild(voterP);\r\n\t\toverlayDiv.appendChild(synopsisP);\r\n\t\t\r\n\t\t// appends overlay div and image into the image div\r\n\t\tdivImg.appendChild(imgTag);\r\n\t\tdivImg.appendChild(overlayDiv);\r\n\r\n\t\t// creates two seperate <p> tags for movie name and release date\r\n\t\tlet movieName = document.createElement(\"p\");\r\n\t\tlet dateRelease = document.createElement(\"p\");\r\n\t\tmovieName.innerHTML = convertedResults.results[i].original_title;\r\n\t\tdateRelease.innerHTML = convertedResults.results[i].release_date;\r\n\t\t\r\n\r\n\t\t// appends the divImg and also appends two <p> \r\n\t\t// tags to the initial column div created\r\n\t\tdivCol.appendChild(divImg);\r\n\t\tdivCol.appendChild(movieName);\r\n\t\tdivCol.appendChild(dateRelease);\r\n\r\n\t\t// finally appends it all back to the body \r\n\t\tlet parentBody = document.querySelector(\"#parentBody\");\r\n\t\tparentBody.appendChild(divCol);\r\n\t}\r\n}", "function displayResults(data) {\n // Add to the table here...\n}", "function displayResult(){\n\n $(\"#winDisplay\").text(\"Wins: \"+ winCount);\n $(\"#lossDisplay\").text(\"Losses: \"+ lossCount);\n \n\n }", "function printResult(result) {\n ResultSet.printScanResult(result);\n}", "function displayNumResults(){\n \ttry {\n var num_results_div = document.getElementById(\"num_results\");\n num_results_div.style.borderBottom = \"1px solid #aaa\";\n \t}\n \tcatch (e) {\n\t\t\tlog(\"searchResults.js\", e.lineNumber, e);\n \t}\n }", "function showResult(collaboratorsAnalysisResult){\n\tif(collaboratorsAnalysisResult.collaboratorsAnalysisResult == undefined){\n\t\tthrow new NoResultException(\"no result\");\n\t} else {\n\t\t// Moves elements shown in the page\n\t\tbuildPage();\n\t\t// Passes data\n\t\tshareDataToGraphics(collaboratorsAnalysisResult);\n\t\t// Fills collaborators list\n\t\tcreateCollaboratorsList();\n\t\t// Draws the plot about overview\n\t\tdrawOverviewPlot();\n\t\t// Opens a new window with analysis result as a string\n\t\topenResultWindow(collaboratorsAnalysisResult);\n\t}\n}", "function showMatches() {\n for (var i = 0; i < matches.length; i++) {\n console.log(matches.length);\n\n }\n results();\n}", "function show_result(result) {\n var html_msg = \"Deine Lösung ist:<br>\"\n if (result.solution.constructor.name == \"Array\") {\n result.solution.forEach(function(m, index){\n html_msg = html_msg + m + \"<br>\";\n });\n }\n else {\n html_msg = html_msg + result.solution + \"<br>\"\n }\n \n if (result.correct) {\n notify(html_msg + \"Juhu, das war richtig!\");\n next_level();\n }\n else {\n notify(html_msg + \"Das ist leider falsch.\");\n }\n}", "function displayResults(responseObj) {\n\t// console.log(\"calling inside displayResults\", responseObj);\n\t//get properties inside an object use . notation\n\tconst works = responseObj.GoodreadsResponse.search.results.work;\n\t//when searching for books a second time it clears the \n\tdocument.getElementById(\"results\").innerHTML = \"\"\n\tworks.forEach(function(work){\n\t\t// console.log(work);\n\t\tconst author = work.best_book.author.name[\"#text\"];\n\t\tconst title = work.best_book.title[\"#text\"];\n\t\tconst imgUrl = work.best_book.image_url[\"#text\"];\n\t\tconsole.log(\"title:\", title + \", Author:\", author + \", Bookcover\", imgUrl);\n\t\t\n\t\tconst myListItem = document.createElement(\"li\");\n\t\tconst image = document.createElement(\"img\");\n\t\timage.setAttribute(\"src\", imgUrl);\n\t\t\n\t\tmyListItem.innerHTML = title + \" by \" + author;\n\t\tmyListItem.appendChild(image);\n\t\tdocument.getElementById(\"results\").appendChild(myListItem);\n\t\n\t});\n}", "function displayResults() {\n // result is filtered array of cities\n const result = findMatches(this.value, cities);\n // map the array to html formatted string for display. Map function returns another array, so we run the \"join\" function at the end to join it into a string.\n const html = result.map(obj => {\n const city = new RegExp(this.value, 'gi');\n const highlight = obj.name.replace(city, `<span style=\"color: red\">${this.value}</span>`);\n return `<li>${highlight}</li>`\n }).join(\"\");\n suggestions.innerHTML = html;\n console.log(html);\n}", "function displayResult(results) {\n $(\"#songs\").html(\"\");\n\n for (i = 0 ; i < 20 && i < results.length ; i++) {\n $(\"#songs\").append(composeSongHTML(results[i], currIndex++));\n }\n bindEvents();\n}", "function resultsScreen() {\n\t\tif (correctGuesses === questions.length) {\n\t\t\tvar endMessage = \"Perfection! Might want to go outside more tho\";\n\t\t\tvar bottomText = \"#nerdalert!\";\n\t\t}\n\t\telse if (correctGuesses > incorrectGuesses) {\n\t\t\tvar endMessage = \"Good work! But do better you can...\";\n\t\t\tvar bottomText = \"all your base are belong to us\";\n\t\t}\n\t\telse {\n\t\t\tvar endMessage = \"You seem to have taken an arrow to the knee\";\n\t\t\tvar bottomText = \"#scrub\";\n\t\t}\n\t\t$(\"#gameScreen\").html(\"<p>\" + endMessage + \"</p>\" + \"<p>You got <strong>\" + \n\t\t\tcorrectGuesses + \"</strong> right.</p>\" + \n\t\t\t\"<p>You got <strong>\" + incorrectGuesses + \"</strong> wrong.</p>\");\n\t\t$(\"#gameScreen\").append(\"<h1 id='start'>Start Over?</h1>\");\n\t\t$(\"#bottomText\").html(bottomText);\n\t\tgameReset();\n\t\t$(\"#start\").click(nextQuestion);\n\t}" ]
[ "0.7987944", "0.778714", "0.7753115", "0.7427977", "0.73537725", "0.7344451", "0.7282258", "0.72646147", "0.7194152", "0.71853757", "0.7163434", "0.7123612", "0.71155596", "0.70384777", "0.6912223", "0.6873063", "0.6861153", "0.683602", "0.67674494", "0.6766285", "0.67539173", "0.6724939", "0.67051375", "0.670068", "0.6694579", "0.6685335", "0.6678725", "0.66775614", "0.6675942", "0.6675934", "0.66708344", "0.6668504", "0.66625136", "0.6648241", "0.66462827", "0.66442686", "0.6637523", "0.66274446", "0.66271585", "0.6626164", "0.6622867", "0.6619558", "0.6618207", "0.6618103", "0.6617617", "0.6613265", "0.66112286", "0.6602695", "0.66012216", "0.6598873", "0.6593369", "0.65648496", "0.6555425", "0.65511256", "0.65466046", "0.65409976", "0.65386397", "0.6531052", "0.65244895", "0.652264", "0.65214956", "0.6517194", "0.6500329", "0.6498602", "0.6485113", "0.64824724", "0.6441189", "0.64226544", "0.6421773", "0.64147115", "0.6408192", "0.64059556", "0.6399969", "0.63991725", "0.6382791", "0.637717", "0.6359138", "0.6355354", "0.6353705", "0.6346323", "0.6343871", "0.6321671", "0.6313034", "0.6312193", "0.63102263", "0.627727", "0.6267791", "0.62540114", "0.624415", "0.6240451", "0.62256527", "0.6224897", "0.621947", "0.6208447", "0.6200737", "0.6187095", "0.61852413", "0.6179532", "0.61791664", "0.61729056" ]
0.68701303
16
route that grabs user's information from the server
getUserInfo() { axios({ method: 'get', url: 'tokbox/lobby', }).then(res => { this.setState({ firstName: res.data.firstName, lastName: res.data.lastName, teamName: `${res.data.firstName}'s Team`, gamesPlayed: res.data.gamesPlayed, totalWins: res.data.totalWins, lowestScore: res.data.lowestScore }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function user(){\r\n uProfile(req, res);\r\n }", "function user(request, response) {\n //if url == \"/....\"\n var username = request.url.replace(\"/\", \"\");\n if(username.length > 0) {\n response.writeHead(200, {'Content-Type': 'text/plain'}); // response.writeHead(statusCode[, statusMessage][, headers])\n response.write(\"Header\\n\"); // Node.js API: response.write\n response.write(\"User Name: \" + username + \"\\n\");\n response.end('Footer\\n');\n \n \n //get json from Treehouse\n //on \"end\"\n //show profile\n //on \"error\"\n //show error\n }\n}", "function showUser(req,res){\n console.log(\"individual user requested\");\n\n var token = req.cookies.token || req.body.token || req.param('token') || req.headers['x-access-token'];\n var decodedInfo;\n\n if(token){\n\n //VERIFY SECRET AND CHECK TOKEN EXPIRATION:\n jwt.verify(token, superSecret, function(err, decoded){\n if(err){\n res.status(403).send({success: false, message: 'failed to authen token'});\n } else {\n //IF TOKEN IS VALID AND ACTIVE, SAVE FOR OTHER ROUTES TO USE:\n req.decoded = decoded;\n decodedInfo = decoded;\n }\n\n //FIND USER AND SHOW INFO:\n User.findOne({email: decodedInfo.email}, function(err, user){\n if(err) res.send(err);\n console.log(user);\n res.json(user);\n });\n }); //CLOSE TOKEN VALIDATION CHECK\n } //CLOSE TOKEN CHECK\n} //CLOSE SHOW USER FUNCTION", "function getMe(req, res) {\n res.json(req.user);\n}", "function showUsers(req, res) {\n //get input from client\n}", "userDetails() {\n return HTTP.get(\"/userDetails\");\n }", "function user(request, response) {\r\n //if url == \"/....\"\r\n var username = request.url.replace(\"/\", \"\");\r\n if(username.length > 0) {\r\n response.writeHead(200, commonHeaders); \r\n \r\n \r\n //get json from Treehouse\r\n var studentProfile = new Profile(username);\r\n //on \"end\"\r\n studentProfile.on(\"end\", function(profileJSON){\r\n //show profile\r\n \r\n //Store the values which we need\r\n var values = {\r\n avatarUrl: profileJSON.gravatar_url, \r\n username: profileJSON.profile_name,\r\n badges: profileJSON.badges.length,\r\n javascriptPoints: profileJSON.points.JavaScript\r\n }\r\n //Simple response\r\n view(\"profile\", values, response);\r\n \r\n response.end();\r\n });\r\n \r\n //on \"error\"\r\n studentProfile.on(\"error\", function(error){\r\n //show error\r\n view(\"error\", {errorMessage: error.message}, response);\r\n \r\n response.end();\r\n });\r\n \r\n }\r\n }", "function discoverHikes(req, res, next) {\n \tconsole.log(req.user);\n\tres.render('main', req.user);\n}", "function viewSelf(req, res) {\n if (req == null) {\n return utils.res(res, 400, 'Bad Request');\n }\n\n if (req.user_id == null) {\n return utils.res(res, 401, 'Invalid Token');\n }\n\n // Fetch the user info\n models.User.findOne({\n 'user_id': req.user_id\n }, 'user_id name email age university total_coins cyber_IQ', function (err, loggedUser) {\n if (err) {\n return utils.res(res, 500, 'Internal Server Error');\n }\n\n if (loggedUser == null) {\n return utils.res(res, 401, 'Invalid Token');\n }\n\n const user = {\n 'user_id': loggedUser.user_id,\n 'name': loggedUser.name,\n 'age': loggedUser.age,\n 'email': loggedUser.email,\n 'university': loggedUser.university || 'NA',\n 'total_coins': loggedUser.total_coins,\n 'cyber_IQ': loggedUser.cyber_IQ,\n }\n\n return utils.res(res, 200, 'Retrieval Successful', user);\n });\n}", "read(req, res) {\n\t\t\tif(req.user === USER_NOT_FOUND) {\n\t\t\t\treturn res.sendStatus(404);\n\t\t\t}\n\t\t\tres.json(req.user);\n\t\t}", "function displayUser(req, res) {\n db.User.findOne({_id: req.params.id}, function(err, user) {\n res.json(user);\n });\n}", "user(username) {\n return this.request(`/users/${username}`);\n }", "function viewUser(req, res) {\n if (req == null || req.params == null) {\n return utils.res(res, 400, 'Bad Request');\n }\n\n if (req.user_id == null) {\n return utils.res(res, 401, 'Invalid Token');\n }\n\n if (req.params.id == null) {\n return utils.res(res, 400, 'Please provide user_id of user to fetch');\n }\n\n // Fetch the user info\n models.User.findOne({\n 'user_id': req.params.id\n }, 'user_id name role email age university total_coins cyber_IQ')\n .lean()\n .exec(function (err, user) {\n if (err || user == null) {\n return utils.res(res, 404, 'Such user does not exist');\n }\n\n user['id'] = user['user_id'];\n delete user['user_id'];\n delete user['_id'];\n if (!user['university']) {\n user['university'] = 'NA';\n }\n\n return utils.res(res, 200, 'Retrieval Successful', user);\n });\n}", "function userDetails(req, res, next){\n twitter.get('users/show', {screen_name: username}, function(error, data, response){\n twitterDetails['id'] = data.id;\n twitterDetails['name'] = data.name;\n twitterDetails['friends_count'] = data.friends_count;\n twitterDetails['profile_background_image_url'] = data.profile_background_image_url;\n twitterDetails['profile_image_url'] = data.profile_image_url;\n next();\n });\n}", "getUserInfo(DB, request, response) {\n\t\ttry {\n\t\t\tDB.get_user_info(request.params.auth_id).then((userData) => {\n\t\t\t\tif (userData[0]) response.status(200).send(userData[0]);\n\t\t\t\telse response.status(404).send('User Not Found...');\n\t\t\t});\n\t\t} catch (err) {\n\t\t\tresponse.status(404).send(err);\n\t\t\tconsole.log('Something went wrong ' + err);\n\t\t}\n\t}", "getUserDetails() {\n return this.api.send('GET', 'user');\n }", "show(context){\n HTTP.get(USERS + context.$route.params.id+'/')\n .then((resp) => {\n context.user = resp.data\n\n })\n .catch((err) => {\n console.log(err)\n })\n }", "viewOne(req, res) {\n const currentUser = UserModel.getOne(req.params.id);\n if (!currentUser) {\n return res.status(404).send({'message': 'user not found'});\n }\n return res.status(200).send(currentUser);\n }", "async getInfo() {\n let userResult = await this.request(\"user\");\n return userResult.user;\n }", "function get(req, res) {\n res.render(\"userProfile\", {\n user: req.user\n });\n}", "function getUser () {return user;}", "function show(req, res, next) {\n User.findById(req.params.id, function(err, user) {\n if (err || !user) {\n next (err);\n } else {\n res.json(user);\n }\n })\n}", "function homeRoute(request, response){\n //if url == \"/\" && GET\n console.log(\"weee3eeeeeeeeeesdfgaaauifyueeeeeerrreeeeeeeeee still reading stuff\");\n //if url == \"/\" && POST\n //redirect to /:username\n}", "function show(req, res) {\n db.User.findById(req.params.userId, function(err, foundUser) {\n if(err) { console.log('usersController.show error', err); }\n // console.log('usersController.show responding with', foundUser);\n res.json(foundUser);\n });\n}", "function api_getuser(ctx) {\n api_req({\n a: 'ug'\n }, ctx);\n}", "getIdentity(req, res, next) {\n res.json(req.user);\n }", "function showTripRoute(req, res, next){\n Trip.findById(req.params.id)\n .populate('user')\n .then(trip => res.status(200).json(trip))\n .catch(next);\n}", "function getUserDetails() {\n\t\tvar baseUrl = 'https://mywell-server.vessels.tech';\n\n\t\treturn $http({\n\t\t\tmethod: \"get\",\n\t\t\turl: baseUrl + \"/api/user/current\"\n\t\t});\n\t}", "function getUserInfo() {\n const apicall = 'http://localhost:3010/api/users/getUser';\n fetch(apicall, {\n method: 'GET',\n headers: Auth.headerJsonJWT(),\n }).then((response) => response.json())\n .then((json) => {\n if (json.useremail) {\n getMemberEvents(json.useremail);\n getMemberBusinesses(json.useremail);\n getPublicAndMemberEvents(json.useremail);\n setUserEmail(json.useremail);\n }\n\n if (window.location.href === 'http://localhost:3000/') {\n /* show all events */\n setSearchBoolean(false);\n } else {\n setSearchBoolean(true);\n const parsedURL = (window.location.href).split('?');\n /* stick parsedURL in an api call and pass it to search events */\n searchFromURL(parsedURL[1], json.useremail);\n }\n },\n (error) => {\n console.log(error);\n },\n );\n }", "async function getMe (req, res) {\n res.send(await service.getMe(req.authUser))\n}", "function getUserById(req, res) {\n\n var userId = req.query.userId;\n console.log(\"user id inside of user controler : \");\n console.log(userId);\n userModel.getUserById(userId, function(error,result) {\n res.json(result);\n });\n\n}", "function getCurrentUser(req, res) {\n // I'm picking only the specific fields its OK for the audience to see publicly\n // never send the whole user object in the response, and only show things it's OK\n // for others to read (like ID, name, email address, etc.)\n const { id, username } = req.user;\n res.json({\n id, username\n });\n}", "async getUserInfo(ctx) {\r\n const { name } = ctx.state.user;\r\n ctx.body = { name };\r\n }", "static async getUser(req, res) {\n const id = req.params.id;\n\n try {\n const user = await userModel.find(id);\n res.status(200).json(user);\n } catch (err) {\n res.status(404).json({ message: err.message });\n }\n }", "function show(req, res) {\n User.findOne({_id: req.params.id}, function (err, foundUser) {\n if (err){\n console.log('database error: ', err);\n res.status(500).send('server error');\n } else {\n console.log('found user');\n res.json(foundUser);\n }\n });\n}", "listOne(req, res) {\n User.findOne({ where: { id: req.params.id } })\n .then((user) => {\n if (!user) {\n res.status(404).send({ message: 'User not found!' });\n } else {\n const viewUser = {\n id: user.id,\n username: user.username,\n email: user.email,\n title: user.title,\n createdAt: user.createdAt,\n updatedAt: user.updatedAt,\n };\n res.status(200).send(viewUser);\n }\n });\n }", "async fetchUser(){\n\t\treturn res.status(200).send({\n\t\t\tmessage: 'Successful Operation',\n\t\t\tuser: req.user\n\t\t})\n\t}", "async getUser(req, res, next) {\n try {\n let user = await this.controller.getUser(req.params.uid)\n if (user === null) {\n return res.status(httpStatus.NOT_FOUND)\n } else {\n return res.status(httpStatus.OK).json(user)\n }\n } catch (e) {\n next(e)\n }\n }", "getUser(req, res) {\n logger.log(5, 'getUser', `Getting employee info for user ${req.employee.id}`);\n\n if (req.employee.employeeRole) {\n res.status(200).send(req.employee);\n } else {\n res.status(404).send('entry not found in database');\n }\n }", "function userGet(req, res, next) {\n res.send(req.currentResources);\n}", "function handleUserRequest( method, path, query, payload, result )\n{\n // API:\n // GET host/users - get all users with query params\n // GET host/users/username - get a user record\n\n if ( method === \"GET\" )\n {\n if ( path.length === 2 )\n {\n //console.log('result: ' + result + ' query: ' + query);\n DB.userQuery( result, query );\n }\n else if ( path.length === 3 )\n {\n //console.log('result: ' + result + ' path[2]: ' + path[2] + ' query: ' + query);\n DB.userGet( result, path[2], query );\n }\n else\n throw Err.INVALID_REQUEST;\n }\n else\n throw Err.INVALID_METHOD;\n}", "show(req, res, next) {\n this.kernel.model.User.findOne({_id: req.params.ud})\n .then(user => {\n if (!user) {\n return res.status(404).end();\n }\n\n res.json(user.profile);\n })\n .catch(err => next(err));\n }", "get(req, res) {\n getAuth0User.byUsername(req.params.username)\n .then(user => user || { error: 'not found' })\n .then(async ({ error, username, user_id, user_metadata }) => {\n if (error) return new HTTPError(404, `User '${req.params.username}' was not found`).handle(res);\n\n const user = await User.model\n .findOne()\n .where('userId').equals(user_id);\n\n const solutionProgress = await getUserSolvedProgress(user);\n\n return res.json({\n data: publicizeUser(user, { username, user_metadata }, solutionProgress),\n });\n });\n }", "function activate() {\n getUser($routeParams.username);\n }", "static async getOne(req, res) {\n const info = await UserModel.find({ _id: req.params.id });\n return res.send(info);\n }", "function getUser(req, res) {\n var userId = req.params.id;\n\n User.findById(userId, (err, viewUser) => {\n if (err) {\n res.status(500).send(\"Error al solicitar el usuario\");\n } else {\n if (!viewUser) {\n res.status(404).send(\"No se ha podido llamar el usuario\");\n } else {\n res.status(200).send(viewUser);\n }\n }\n });\n}", "function getUser(app){\n\treturn function(req, res){\n\t\tconst id = req.params.id;\n\t\tif(typeof id === 'undefined'){\n\t\t\tres.sendStatus(BAD_REQUEST);\n\t\t}\n\t\telse{\n\t\t\treq.app.locals.model.users.getUser(id).\n\t\t\t\tthen((results) => res.json(results)).\n\t\t\t\tcatch((err) => {\n\t\t\t\t\tconsole.error(err);\n\t\t\t\t\tres.sendStatus(NOT_FOUND);\n\t\t\t\t});\n\t\t}\n\t};\n}", "async viewOne(req, res) {\n const data = await getQuery.findUsersId(req.params.id);\n if (data.err) {\n res.status(200).send(\"Somthing wrong\");\n }\n if (data.length > 0) {\n userDetails = {\n status: 200,\n data: data,\n message: \"User find\"\n };\n res.status(200).send(userDetails);\n } else {\n res.status(200).send(\"Record not Fond\");\n }\n }", "function handleGetUser(){\n \n console.log('function handleGetUser() called.');\n \n app.context.getUser().then((user) => {\n \n console.log('app.context.getUser() promise has resolved.');\n \n log('Complete JSON string: ', user);\n log('user.id: ', user.id);\n log('user.orgId: ', user.orgId);\n log('user.email: ', user.email);\n log('user.displayName: ', user.displayName);\n log('user.token: ', user.token);\n \n }); // app.context.getUser().then((user) =>\n \n}", "function getUser(req, res) {\n User.findById(req.params.id, function (err, user) {\n if (err) return res.status(500).send(\"There was a problem finding the user.\");\n if (!user) return res.status(404).send(\"No user found.\");\n res.status(200).send(user);\n });\n}", "async getUser(uid) {\n console.log('GET /user/%s', uid)\n return this.server.getUser(uid)\n }", "function get(req, res) {\n res.render(\"admin\", {\n rider: req.user\n });\n}", "function renderUserPage() {\n const userId = location.hash.split(\"users/\")[1];\n // get observations\n const observations = Model.get_user_observations(parseInt(userId));\n loadPage(\"user-details\", {\n user: Model.get_user(parseInt(userId)),\n observations: observations,\n });\n}", "static async getMyTrip(req,res) {\n UserDomain.getMyTrip(req,res)\n }", "static async getUser(username) {\n let res = await this.request(`users/${username}`)\n console.log(`frontEnd getUser response`, res)\n return res;\n }", "function user(request, response){\n\t//if url === \"/{name_of_pokemon}\"\n\t//take away the / and extract the pokemon name\n\tvar pokemon = request.url.replace(\"/\", \"\");\n\t//Make sure a pokemon name was entered\n\tif(pokemon.length > 0){\n\t\tresponse.writeHead(200, commonHeaders);\n\t\trenderer.view(\"header\", {}, response);\n\n\t\t//get the JSON data from the pokemon API\n\t\tvar pokemonProfile = new Profile(pokemon);\n\t\tpokemonProfile.on(\"end\", function(profileJSON){\n\t\t\t//Get the JSON data that was parsed in Profile constructor\n\t\t\t//Place them in the value object so that the template can handle it\n\t\t\tvar values = {\n\t\t\t\tpokeSprite : \"http://pokeapi.co/media/img/\" + profileJSON.pkdx_id + \".png\",\n\t\t\t\tpokeName : profileJSON.name,\n\t\t\t\tpokeType : profileJSON.types.name,\n\t\t\t\tpokeId : profileJSON.pkdx_id\n\t\t\t}\n\n\t\t\t//simple response, render the pokemon's profile template + footer\n\t\t\trenderer.view(\"profile\", values, response);\n\t\t\trenderer.view(\"footer\", {}, response);\n\t\t\tresponse.end();\n\t\t});\n\n\t\t//on error\n\t\tpokemonProfile.on(\"error\", function(error){\n\t\t\t//show error message\n\t\t\trenderer.view(\"error\", {errorMessage: error.message}, response);\n\t\t\trenderer.view(\"search\", {}, response);\n\t\t\trenderer.view(\"footer\", {}, response);\n\t\t\tresponse.end();\n\t\t});\n\t}\n}", "fetchProfile(req, res, next) {\n res.status(200).json({\n user: {\n id: req.user.id,\n username: req.user.username,\n email: req.user.email\n }\n });\n }", "function getUserById(req, res) {\n var userId = req.params['userId'];\n\n userModel\n .findUserById(userId)\n .then(function (user) {\n res.json(user);\n });\n }", "async function userPage(req, res, next)\n{\n try\n {\n await usersdb.auth(req.session.username, req.session.password);\n }\n catch (err)\n {\n // Go to log in if not logged in\n res.redirect('/');\n return;\n }\n\n var username = req.params[\"username\"];\n\n try // Get the user\n {\n var user = await usersdb.get(username);\n\n var content = \n {\n user: user,\n currentusername: req.session.username,\n games: await gamesdb.idsToGames(user.games)\n };\n\n if (req.query.err)\n {\n content.errortext = decodeURIComponent(req.query.err);\n }\n\n res.render('user', content);\n }\n catch (err) // User not found\n {\n console.log(err);\n next(createError(404));\n }\n}", "function show(req, res) {}", "function getLocation() {\n $.getJSON( window.apiUrl + '/directions/2/' + window.username + '/', function( data ) {\n console.log(data);\n user = data.user;\n });\n }", "async retriveUserDetails(req, res, next) {\n try {\n let userId = req.params.userId;\n let userDetails = await User.findById(userId)\n .populate('jobs')\n .populate('city')\n if (!userDetails)\n return res.status(404).end();\n\n return res.status(200).json(userDetails);\n } catch (err) {\n next(err)\n }\n }", "getInitialUserInfo(DB, request, response) {\n\t\tDB.get_initial_user(request.params.auth_id).then((userData) => {\n\t\t\tif (userData[0]) response.status(200).send(userData);\n\t\t\telse response.status(404).send('User Not Found...');\n\t\t});\n\t}", "function getOneUser(req, res, next) {\n oneUserDetails(req, res).then((result) => {\n return res.status(200).json(result);\n }).catch((err) => {\n next(err);\n });\n}", "getMe (options) {\n return api('GET', '/user/self', options)\n }", "function getUser() {\n fetch(\"http://localhost/todo\").then((result) =>\n result.json().then((resp) => console.log(\"resp\", resp))\n );\n }", "getSelf() {\n\t\treturn this._get(\"/api/user\");\n\t}", "function fecth_userName(){\n\n const GET_USER_URL=\"http://127.0.0.1:8090/user/infoUser\"; \n let context = {\n method: 'GET'\n };\n \n fetch(GET_USER_URL,context)\n \t.then(reponse => reponse.json().then(body => userName_callback(body)))\n .catch(error => err_callback(error));\n}", "function indexTripRoute(req, res, next){\n Trip.find()\n .populate('user') //had to populate user data in order to get access to trip.user._id\n .then(trips => {\n trips = trips.filter(trip => trip.user._id.equals(req.currentUser._id)); // req.currentUser is from secureRoute\n res.status(200).json(trips);\n })\n .catch(next);\n}", "function getOne(req,res, next) {\n userDb.findUser(req.params.id)\n .then(data=> {\n res.locals.user = data;\n next();\n })\n .catch(err=> {\n next(err);\n })\n}", "function getUserDetails () {\n\t// sending request and getting response\n\tajax_transport.open(\"GET\", PROTOCOL + \"//api.quora.com/api/logged_in_user?fields=link\", true);\n\tajax_transport.onreadystatechange = function () {\n\t\t'use strict';\n\n\t\tif (ajax_transport.readyState != 4) {\n\t\t\treturn;\n\t\t}\n\n\t\tresponse = ajax_transport.responseText;\n\t\tresponse = response.substring(\"while(1);\".length);\n\n\t\t//Parse json\n\t\tvar json = JSON.parse(response);\n\t\tuser_link = json.link;\n\t};\n\tajax_transport.send(null);\n}", "function user(request,response){\n\t//if url=\"/....\"\n\tvar username = request.url.replace(\"/\", \"\");\n\n\tif(username.length > 0 && request.url.indexOf('.css') === -1){\n\t\tresponse.writeHead(200, {\"Content-Type\": \"text/html\"});\n \t\trenderer.view(\"header\",{}, response);\n\n \t\tvar studentProfile = new profile(username);\t\n \t\tstudentProfile.on(\"end\",function(profileJSON){\n \t\t\tvar values = {\n \t\t\t\tavatarUrl:profileJSON.gravatar_url,\n \t\t\t\tusername:profileJSON.profile_name,\n \t\t\t\tbadgeCount:profileJSON.badges.length,\n \t\t\t\tjavascriptPoints:profileJSON.points.JavaScript\n \t\t\t}\n \t\t\trenderer.view(\"profile\",values, response);\n \t\t\trenderer.view(\"footer\",{}, response);\n \t\t\tresponse.end();\n \t\t});\n \t\tstudentProfile.on(\"error\", function(error){\n \t\t\trenderer.view(\"error\",{errorMessage:error.message}, response);\n \t\t\trenderer.view(\"search\",{}, response);\n \t\t\trenderer.view(\"footer\",{}, response);\n \t\t\tresponse.end();\n \t\t});\n\t}\n}", "function getUserInfo(req, res, next) {\n var token = _getTokenFromRequest(req);\n var allowAnonymous = req.disallowAnonymous ? false : true;\n\n logger.debug('checking token : ' + token);\n _verifyToken(token, function (err, info) {\n var errMsg = 'Internal server error';\n if (err) {\n logger.error('_verifyToken failed ', err);\n if (err === 400 || err === 419) {\n if (allowAnonymous) {\n logger.debug('_verifyToken added empty user in req'); \n \t req.user = {};\n return next();\n }\n errMsg = (err === 400) ? 'requires access token' : 'invalid access token';\n }\n return res.status(err).send(utils.fail(errMsg));\n }\n req.user = info;\n return next();\n });\n}", "async function Get(req, res) {\n res.send(await Model.User.findById(req.params.id));\n}", "function getInfo (id, authorisation, self) {\n var url = `${API_URL}/user?id=${id}`; \n if (self == 'self') { \n console.log(`${self}`);\n url = `${API_URL}/user`\n };\n return fetch(url, {\n method: 'GET',\n headers: {\n 'Authorization': `Token ${authorisation}`\n },\n })\n .then(res => {\n //catch 403 status \n if (res.status === 403) {\n alert(\"Invalid auth token\");\n } \n return res.json();\n })\n .catch(error => {\n alert(\"He's dead Jim (Issue getting user information)\");\n });\n}", "function home(request, response) {\r\n //if url == \"/\" && GET\r\n if(request.url === \"/\") {\r\n if(request.method.toLowerCase() === \"get\") {\r\n //show search\r\n response.writeHead(200, commonHeaders); \r\n view(\"index\", {}, response);\r\n \r\n response.end();\r\n } else {\r\n //if url == \"/\" && POST\r\n \r\n //get the post data from body\r\n request.on(\"data\", function(postBody) {\r\n //extract the username\r\n var query = querystring.parse(postBody.toString());\r\n //redirect to /:username\r\n response.writeHead(303,{\"Location\": \"/\"+ query.username});\r\n response.end();\r\n \r\n });\r\n \r\n }\r\n }\r\n \r\n }", "async fetchMeMethod(req, res, next) {\n try {\n return successResponse(res, 'Account info fetched', '00', user);\n } catch (error) {\n return errorHandler(error, '02', res, next);\n }\n }", "get(callback) {\n api.get(\n 'user',\n null, null,\n result.$createListener(callback)\n )\n }", "get user() { return this.args.user }", "function getUser (req, res) {\n promiseResponse(userStore.findOne({ userId: req.params.id }), res);\n}", "function show(req, res) {\n User\n .findById(req.currentUser)\n .then(user => {\n if (!user) {\n return res.status(401).json({ message: 'There\\'s a problem with this user...' })\n }\n res.status(200).json({ user })\n })\n .catch(() => {\n res.status(401).json({ message: 'Profile Not Found' })\n })\n}", "function getUserId(req, res, next){\r\n\tlet send;\r\n\r\n\tUser.findOne()\r\n\t.where({_id:req.params.userID})\r\n\t.exec(function(err, result){\r\n\t\tif(err){\r\n\t\t\tres.status(500).send(\"No such person exist Maybe try logging in on the home page! and error => \" + err);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// if the privacy is true then the user can not see the page and is exited from the program\r\n\t\tif (req.session.username != result.username && result.privacy == true){\r\n\t\t\tres.status(403).send(\"YOU CAN NOT ACCESS DUE TO PRIVACY REASON!! BY THE PROFILE OWNER!\");\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// display the result for testing and confirmation\r\n\t\t// console.log(result);\r\n\t\t// building response object to be rendered\r\n\t\tsend = result;\r\n\t\t// now we made a place where we can access the this all overa gain elsewhere\r\n\t\treq.session.user = result;\r\n\t\tsend.sessionName = req.session.username;\r\n\r\n\t\t// display the session username for testing and confirmation\r\n\t\tconsole.log(\"send.username \" + send.sessionName);\r\n\r\n\t\t// renders the page\r\n\t\tres.render(\"pages/userProfile\" , {result:send , id:req.session.userId})\r\n\t})\r\n}", "function userinfo(callback) {\r\n var path = config.version + '/userinfo.do';\r\n var params = {};\r\n return privateMethod(path, params, callback);\r\n }", "function getUserData (req, res, next) {\n db.oneOrNone(`SELECT * FROM \"user\" WHERE user_id = $1`, [req.params.user_id])\n .then((user) => {\n res.rows = user;\n next();\n })\n .catch(err => next(err));\n}", "async function getUserInfo() {\n if (user && user.name) return;\n try {\n // See if the server has session info on this user\n const response = await fetch(`${telescopeUrl}/user/info`);\n\n if (!response.ok) {\n // Not an error, we're just not authenticated\n if (response.status === 403) {\n return;\n }\n throw new Error(response.statusText);\n }\n\n const userInfo = await response.json();\n if (userInfo && userInfo.email && userInfo.name) {\n dispatch({ type: 'LOGIN_USER', payload: userInfo });\n }\n } catch (error) {\n console.error('Error getting user info', error);\n }\n }", "async bringUser(req,res){\n //función controladora con la lógica que muestra los usuarios\n }", "function getUserDetails(data){\n console.log(\"Get User Data: \"+data);\n}", "function getUserInfo(req, res, callback) {\n userModel.User.findOne({ _id: req.body.userId }, (err, users) => {\n if (err) callback(cbs.cbMsg(true, err));\n callback(cbs.cbMsg(false, users));\n });\n}", "get(callback) {\n api.get(\n 'user',\n null, null,\n result.$createListener(callback)\n );\n }", "function getLoggedUser(req, res, next) {\n db\n .any(\"SELECT user_id, username, full_name, email, user_description, user_followers, user_following, images.id AS img_id, img_url, img_likes FROM users JOIN images ON (users.id = images.user_id) WHERE username = ${username}\", req.user)\n .then(function(data) {\n res.status(200).json({\n status: \"success\",\n data: data,\n message: \"Fetched one user\",\n req: req.user,\n });\n })\n .catch(function(err) {\n return next(err);\n });\n}", "async function Get(req, res) {\n res.json(await User.findById(req.params.id));\n}", "retrieve(req, res) {\n\n return User\n .findById(req.params.id, {})\n .then(user => {\n\n if (!user) {\n\n return res.status(404).send({\n message: 'User Not Found',\n });\n }\n\n return res.status(200).send(user);\n })\n .catch(error => res.status(400).send(error));\n }", "function indexRoute(req, res) {\n return res.json({\n users: {\n users: '/users',\n user: '/users/{id}',\n register: '/users/register',\n login: '/users/login',\n me: '/users/me',\n newPin: '/program/{id}/add',\n },\n program: {\n newProgram: '/program',\n program: '/program/{id}/view',\n exercises: '/program/{clientId}/view/{programId}',\n },\n exercise: {\n exercise: '/program/{id}/add',\n }\n });\n}", "function userInfo(api, id, next){\n api.users.info({\n user: id\n }, function (err, res) {\n next(err, res.user);\n });\n }", "function userInfo(api, id, next){\n api.users.info({\n user: id\n }, function (err, res) {\n next(err, res.user);\n });\n }", "function profile(request, response){\r\n //prints message to the console\r\n console.log(\"user requested 'profile'\");\r\n}", "function getUser(){\n return user;\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\t\t\t/*\n\t\t\t\tIf the user is not empty, that means there's a user\n\t\t\t\tauthenticated we allow them to continue. Otherwise, we\n\t\t\t\tsend the user back to the home page.\n\t\t\t*/\n\t\t\tif( store.getters.getUser != '' ){\n \tnext();\n\t\t\t}else{\n\t\t\t\tnext('/cafes');\n\t\t\t}\n }\n\t}", "async function getMe(req, res) {\n\ttry {\n\t\tconst me = await req.api.getMe();\n\t\tres.send({\n\t\t\tloggedIn: true,\n\t\t\tprofile: me,\n\t\t\terr: null,\n\t\t});\n\t} catch (e) {\n\t\tpino.error(\"Something went wrong with user info: \" + e);\n\t\tres.send({ user: null, err: e, loggedIn: false });\n\t}\n}", "function usersShow(req, res){\n User.findById(req.params.id, function(err, user){\n if (err) return res.status(404).json({message: 'Something went wrong.'});\n res.render('profile', {user: user});\n });\n}", "loadUserDetails() {\n $http({ url: statusManagerService.endpointUrl() + \"?request=getuserinfo\" }).\n then(me.setUserDetails, function (err) { });\n }" ]
[ "0.7194777", "0.71463037", "0.71457", "0.70512134", "0.69527835", "0.694975", "0.6869201", "0.6798297", "0.6786865", "0.67837846", "0.67593217", "0.6742606", "0.6736843", "0.6705752", "0.6618769", "0.6592089", "0.65686715", "0.6544276", "0.6519293", "0.64784616", "0.6426449", "0.6404487", "0.6402329", "0.63951075", "0.63939553", "0.63930833", "0.63748044", "0.6374108", "0.6338291", "0.63338906", "0.63067853", "0.62959677", "0.6270679", "0.6265584", "0.62548715", "0.62539726", "0.6249486", "0.6245289", "0.6214737", "0.62144524", "0.6206024", "0.6202063", "0.61977035", "0.61713463", "0.6163247", "0.6159058", "0.6153344", "0.61424536", "0.6128854", "0.6127271", "0.6126856", "0.61241984", "0.61214805", "0.6119656", "0.61033326", "0.61031556", "0.61018914", "0.60956794", "0.60930806", "0.60884416", "0.60847175", "0.60839206", "0.6067241", "0.60621744", "0.6060204", "0.6058865", "0.6058704", "0.6055309", "0.6041256", "0.6040263", "0.6033458", "0.6031606", "0.6027242", "0.6014099", "0.60133433", "0.60130376", "0.6011137", "0.6005509", "0.6000592", "0.5999686", "0.599832", "0.59956175", "0.5993025", "0.59868985", "0.59857976", "0.59801126", "0.597456", "0.5973017", "0.5970926", "0.5964539", "0.596158", "0.5952874", "0.59455496", "0.59449303", "0.59449303", "0.5944408", "0.5942029", "0.59382087", "0.59276253", "0.59223855", "0.5921902" ]
0.0
-1
attached to the start button, sends info the server to create the lobby, then receives the key used for people to join with.
handleSubmit(event) { const { lobbies, gameType, maxPlayers, room } = this.state; document.getElementById('startButton').disabled = true; event.preventDefault(); this.setState({ lobbies: [...lobbies, { 'gameType': gameType, 'maxPlayers': maxPlayers, 'room': room }], }); axios({ method: 'post', url: `/tokbox/room`, data: { gameType, maxPlayers } }).then(res => { this.setState({ roomKeyFromServer: res.data.roomKey }); const dataFromServer = JSON.stringify(res.data); sessionStorage.setItem('gameSession', dataFromServer); sessionStorage.setItem('roomKey', res.data.roomKey); this.setDisplayModal(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function start_lobby_click_listener($event) {\n\n chrome.runtime.sendMessage({ type: 'start_lobby' }, function (response) {\n\n if (response && response.type) {\n if (response.type === 'start_lobby_ack' && response.success) {\n // Update the view\n update_state(POPUP_STATE.InLobby);\n }\n }\n\n Utility.default_response(response);\n\n });\n\n}", "function lobbyPing(){\n \n \tsendMessage(\"get\",{\n \t\tkey: \"lobbyPing\",\n \t\tgameHash: GAME_HASH,\n \t\tplayerId: PLAYER_ID\n \t}, lobbyPingCallback);\n }", "function joinCreatedLobby(data) {\n var p = lobbies[0].idPlayer(data.p);\n var l = idLobby(data.l);\n if (p) {\n lobbies[0].playerLeave(p.id);\n addToLobby(l, p);\n updateLobbyInfo(l)\n updateLobbyInfo(lobbies[0]);\n } else {\n pushAlert(p.id, \"Oops, something went wrong creating this lobby! Exit and try again.\", \"#B71C1C\")\n }\n}", "onLobbyClick(id) {\n\n // switch statement depending on which button was pressed\n switch (id) {\n // Create start game button\n case 1:\n var text = { \"roomCode\": this.state.roomCode };\n //Pass startroom to server\n fetch('/startroom', {\n method: \"POST\",\n headers: {\n 'Content-type': 'application/json'\n },\n body: JSON.stringify(text)\n }).then((result) => result.json()).then((info) => this.saveResToState(info))\n break;\n // Exit lobby button\n case 2:\n return (\n this.setState({ currentComp: components.MENU })\n )\n }\n }", "startLobby(lobby_id, args, callback, errCallback) {\r\n this._send(Command.START_LOBBY, callback, errCallback, [lobby_id, args]);\r\n }", "function startGameButtonHandler() {\n socket.emit('startGame', gameInfo);\n startGame(gameInfo);\n}", "async enterLobby(){\n //Checks if all data is filled in\n if(this.state.checkedLobby === \"\"){\n this.setState({message: \"Bitte LVA auswählen\"});\n this.setState({hideCheckMessage: false});\n }\n else if(this.state.username === \"\"){\n this.setState({message: \"Username eingeben\"});\n this.setState({hideCheckMessage: false});\n }else{\n this.setState({message: \"Username wird geprüft\"});\n this.setState({hideCheckMessage: false});\n\n let result = await data.joinLobby(this.state.checkedLobby,this.state.username);\n\n if(result === null){\n //Waitingmessage\n }else{\n if(result.UID === 0){\n //Username alrady taken, message to choose another\n this.setState({message: \"Username bereits vergeben\"});\n this.setState({hideCheckMessage: false});\n }else {\n //Display next screen (Lobby), Username and ID are saved by the Datalayer\n console.log(result.UID);\n clearInterval(this.getLobbiesPoll);\n this.setState({hideCheckMessage: true});\n this.props.goToPage(1);\n }\n }\n }\n }", "onReady(socket, lobbyId, playerName) {\r\n // Controls used for the lobby chatting\r\n const chatContainer = document.getElementById(\"lobby-chat-container\");\r\n const chatInput = document.getElementById(\"lobby-chat-input\");\r\n const postButton = document.getElementById(\"lobby-chat-submit\");\r\n\r\n // Elements used to display users in lobby and\r\n // the participant list\r\n const userList = document.getElementById(\"user-list\");\r\n const participantListContainer = document.getElementById(\"lobby-participant-list\");\r\n\r\n // Controls to control starting and advancing the Lip Sync performance\r\n const startPerformanceButton = document.getElementById(\"start-performance-button\");\r\n const nextPerformerButton = document.getElementById(\"next-performer-button\");\r\n const nowPerformingDisplay = document.getElementById(\"now-performing-display\");\r\n\r\n // Hidden input for the lobby id in the register team form\r\n let lobbyIdInput = document.getElementById(\"hidden-lobby-id\");\r\n lobbyIdInput.value = lobbyId;\r\n\r\n let lobbyChannel = socket.channel(`lobby:${lobbyId}`, () => {\r\n return playerName \r\n ? {username: playerName}\r\n : {username: \"anon\" + Math.floor(Math.random() * 1000)};\r\n });\r\n\r\n let presence = new Presence(lobbyChannel);\r\n\r\n presence.onSync(() => {\r\n userList.innerHTML = presence.list((id, metas) => {\r\n return `<li>${this.esc(id)}</li>`;\r\n }).join(\"\");\r\n });\r\n \r\n // Send chat message to the server.\r\n postButton.addEventListener(\"click\", e => {\r\n let payload = {message: chatInput.value};\r\n lobbyChannel.push(\"new_msg\", payload)\r\n .receive(\"error\", e => e.console.log(e));\r\n chatInput.value = \"\";\r\n });\r\n\r\n // Test to send a new video ID for the player and update it\r\n lobbyChannel.on(\"update_video\", (resp) => {\r\n if (Player.player != null) {\r\n Player.player.loadVideoById(resp.new_id);\r\n nowPerformingDisplay.value = resp.team_name;\r\n }\r\n });\r\n\r\n // Start the Lip Sync performance\r\n startPerformanceButton.addEventListener(\"click\", e => {\r\n lobbyChannel.push(\"start_performance\", {})\r\n .receive(\"error\", e => e.console.log(e));\r\n\r\n startPerformanceButton.setAttribute(\"disabled\", \"disabled\");\r\n });\r\n\r\n // Advance the Lip Sync queue to the next performing team\r\n nextPerformerButton.addEventListener(\"click\", e => {\r\n lobbyChannel.push(\"next_performer\", {})\r\n .receive(\"error\", e => e.console.log(e));\r\n });\r\n\r\n // Receive and render a new chat message.\r\n lobbyChannel.on(\"new_msg\", (resp) => {\r\n this.renderAnnotation(chatContainer, resp);\r\n });\r\n\r\n // Receive updated list of Lip Sync participants\r\n lobbyChannel.on(\"participant_list\", (resp) => {\r\n this.renderParticipantList(participantListContainer, resp);\r\n });\r\n\r\n // Receive update that the performance ended\r\n lobbyChannel.on(\"performance_end\", (resp) => {\r\n startPerformanceButton.removeAttribute(\"disabled\");\r\n });\r\n\r\n // Join the lobby chat channel.\r\n lobbyChannel.join()\r\n .receive(\"ok\", () => {\r\n return;\r\n })\r\n .receive(\"error\", reason => console.log(\"join failed\", reason));\r\n }", "function getLobbyData(){}", "function updateLobby(){\n var $startButton = $('#startButton');\n\n $('#numPlayers').html(clientGame.users.length);\n\n if(clientUser.isHost){\n $startButton.show();\n $('#lobbyCode').html(clientUser.room);\n $('#lobbyDisplay').show();\n }\n\n if(clientGame.users.length >= MIN_PLAYERS && clientUser.isHost){\n $startButton.prop('disabled', false);\n } else {\n $startButton.prop('disabled', true);\n }\n\n var lobbyContent = \"\";\n\n for(var i = 0; i < clientGame.users.length; i++){\n if(clientGame.users[i].clientId == clientUser.clientId){\n lobbyContent += \"<li class='list-group-item list-group-item-success'>\"+ clientGame.users[i].username +\"</li>\";\n } else{\n lobbyContent += \"<li class='list-group-item'>\"+ clientGame.users[i].username +\"</li>\";\n }\n }\n\n $('#userList').html(lobbyContent);\n}", "async function init() {\n console.log(chalk.bold.cyan('Starting osu!autoref'));\n await initPool();\n console.log(chalk.bold.green('Loaded map pool!'));\n console.log(chalk.cyan('Attempting to connect...'));\n \n try {\n await client.connect();\n console.log(chalk.bold.green(\"Connected to Bancho!\"));\n channel = await client.createLobby(`${match.tournament}: ${match.teams[BLUE].name} vs ${match.teams[RED].name}`);\n } catch (err) {\n console.log(err);\n console.log(chalk.bold.red(\"Failed to create lobby\"));\n process.exit(1);\n }\n\n lobby = channel.lobby;\n\n const password = Math.random().toString(36).substring(8);\n await lobby.setPassword(password);\n await lobby.setMap(1262832); //hitorigoto dayo\n\n console.log(chalk.bold.green(\"Lobby created!\"));\n console.log(chalk.bold.cyan(`Name: ${lobby.name}, password: ${password}`));\n console.log(chalk.bold.cyan(`Multiplayer link: https://osu.ppy.sh/mp/${lobby.id}`));\n console.log(chalk.cyan(`Open in your irc client with \"/join #mp_${lobby.id}\"`));\n\n lobby.setSettings(bancho.BanchoLobbyTeamModes.TeamVs, bancho.BanchoLobbyWinConditions.ScoreV2);\n\n createListeners();\n}", "function informLobby() {\n for(var i in SOCKET_LIST) {\n if(SOCKET_LIST[i].username !== undefined && (SOCKET_LIST[i].roomname !== undefined && SOCKET_LIST[i].roomname !== \"\")) {\n var pack = {\n Room1: getRoomInformation(\"Room1\")\n }\n SOCKET_LIST[i].socket.emit('lobbyInfo', pack);\n }\n }\n}", "function createGameLobby() {\n $(\"#waitingBtn\").hide();\n // Populate game lobby with game info\n $(\"#gameTitle\").html(currentGame.name);\n var index = 1;\n $(\"#gameLobby\").html(\"\");\n var row = $(\"<div>\").addClass(\"gameLobbyRow\");\n for (var id in currentGame.players) {\n var player = currentGame.players[id];\n var userSquare = $(\"<div>\").addClass(\"desktopUserSquare\");\n userSquare.append($(\"<img>\").attr(\"src\", \"https://graph.facebook.com/\" + player.fbid + \"/picture?width=75&height=75\"))\n .append($(\"<h2>\").html(\"Player \" + index + \": \" + player.username.split(\" \")[0]));\n row.append(userSquare);\n index++;\n }\n $(\"#gameLobby\").append(row);\n $(\"#boardLobby\").html(\"Number of boards connected: \" + currentGame.numBoards);\n $(\"#phoneCode\").html(currentGame.code);\n}", "startGame () {\n process.env.DEBUG == \"gamelobby\" && console.log(\"[D] gamelobby.Lobby.debug - Starting game!\");\n this.updateStatus(Lobby.PLAYING);\n this.startTime = new Date().getTime();\n\n // remove disconnected players (useful in the event same lobby is used to restart a game)\n this.playerList.filter(p => p.getConnectionStatus() == Player.DISCONNECTED).forEach(p => this.removePlayer(p));\n\n this.playerList.forEach(p => p.updateWinStatus(Player.UNDETERMINED)); // set initial win_status\n\n this.emitGameStart();\n }", "function showLobby() {\n battlefield.innerHTML = '';\n gamesList.classList.remove('hidden');\n updateBtn(actionBtn, ACTION_BTN.CREATE_GAME);\n resetHeader();\n }", "function messageHandler(data, ws){\n //LOBBY EVENTS\n if(data.header == \"ready\"){ // ONREADY()\n // Update player readiness, then updateLobby();\n switch(data.player){\n case 1: lobbyState.p1Ready = \"ready\"; break;\n case 2: lobbyState.p2Ready = \"ready\"; break;\n case 3: lobbyState.p3Ready = \"ready\"; break;\n case 4: lobbyState.p4Ready = \"ready\"; break;\n }\n updateLobby();\n }else if(data.header == \"unready\"){ // ONUNREADY()\n // Update player readiness, then updateLobby();\n switch(data.player){\n case 1: lobbyState.p1Ready = \"connected\"; break;\n case 2: lobbyState.p2Ready = \"connected\"; break;\n case 3: lobbyState.p3Ready = \"connected\"; break;\n case 4: lobbyState.p4Ready = \"connected\"; break;\n }\n updateLobby();\n }else if(data.header == \"start\"){ // ONSTART()\n // Check readiness status of all players, then either launch, or don't.\n // Future note, send off double checks to all connected before launch.\n // If not all players are still connected, put this process back in the queue.\n // console.log(\"Help, I'm stuck!\");\n if(checkStates()){\n //If all players are ready, fire off start event\n launch();\n }\n }\n // GAMEPLAY EVENTS\n if(data.header == \"updateChar\"){ // ONCHARUPDATE()\n // // console.log(\"Updating a char\");\n let player = {\n posX: data.posX,\n posY: data.posY,\n animState: data.animState,\n player: data.player\n }\n // // console.log(player);\n // console.log(players);\n players[player.player-1] = player;\n }else if(data.header == \"drop_block\"){\n if(gameBoard[data.yCoord][data.xCoord] == 1){\n gameBoard[data.yCoord][data.xCoord] = 0;\n block_down(data.xCoord, data.yCoord);\n }\n }else if(data.header == \"pull_block\"){\n if(gameBoard[data.yCoord][data.xCoord] == 0){\n gameBoard[data.yCoord][data.xCoord] = 1;\n block_up(data.xCoord, data.yCoord);\n }\n }\n if(data.offer){ // Offer is made\n console.log(\"offer made\");\n console.log(data);\n lobbyState.player2.send(JSON.stringify({offer: data.offer}));\n }if(data.answer){ // An answer is returned\n console.log(\"You've got your answer\");\n lobbyState.player1.send(JSON.stringify({answer: data.answer}));\n }if(data.newCandidate){\n console.log(\"found new candidate\");\n if(ws == lobbyState.player1) lobbyState.player2.send(JSON.stringify({iceCandidate:data.newCandidate}));\n if(ws == lobbyState.player2) lobbyState.player1.send(JSON.stringify({iceCandidate:data.newCandidate}));\n }\n}", "function start(){\n setupSocket();\n socket.emit('reqStartGame', gameConfig.userName);\n}", "function start () {\n room.sendToPeers(GAME_START)\n onStart()\n}", "function joinRoom() {\n\tif (state == null) {\n\t\t// var campname = document.querySelector('#incoming').value;\n\t\tvar campname = 'dgnby';\n\t\t// TODO: check name is valid, alert() if not\n\t\tdatabase.ref('hosts/' + campname + '/').update({\n\t\t\t// add client signal data to database\n\t\t\tjoinData: signalClient,\n\t\t});\n\n\t\tvar hostData = firebase.database().ref('hosts/' + name + '/hostData');\n\t\t// wait for host to respond to client signal data\n\t\thostData.on('value', function(snapshot) {\n\t\t\tif(state == \"client\"){\n\t\t\t\tsetTimeout(function(){ readAnswer(campname); }, 200);\n\t\t\t}\n\t\t});\n\t\tstate = \"client\";\n\t}\n\tdocument.getElementById('hostbox').style.animation='0.2s fadeOut forwards';\n}", "function loadGameLobby(type) {\r\n\t\r\n\t$(\"#gp\").show();\t\r\n\t$(\"#gp_lobby\").show();\r\n\t$(\"#gp_lobby\").html(\r\n\t\t\"<div class='components'><nav class='options'><button></button></nav></div>\" +\r\n\t\t\"<section id='gp_lobby_chat'><div class='components'><header><h1>Chat</h1></header><div class='messages'></div><footer><input type='text'><button>Send</button></footer></div></section>\" +\r\n\t\t\"<section id='gp_lobby_players'><div class='components'></div></section>\"\t\t\t\t\t\t\t\t\r\n\t);\r\n\t\r\n\t// Build the lobby contents\r\n\tif (type == \"FRIENDS\") {\r\n\t\t$(\"#gp_lobby_players .components\").append(\r\n\t\t\t\"<ul class='spots'>\" +\r\n\t\t\t\t\"<li><button class='add'><img src='img/sprite.png'></button></li>\" +\r\n\t\t\t\t\"<li><button class='add'><img src='img/sprite.png'></button></li>\" +\r\n\t\t\t\t\"<li><button class='add'><img src='img/sprite.png'></button></li>\" +\r\n\t\t\t\"</ul>\" +\r\n\t\t\t\"<ul class='arrows bounce'>\" +\r\n\t\t\t\t\"<li><img src='img/hf_game_lobby_arrow.png'></li>\" +\r\n\t\t\t\t\"<li><img src='img/hf_game_lobby_arrow_text.png'></li>\" +\r\n\t\t\t\t\"<li><img src='img/hf_game_lobby_arrow.png'></li>\" +\r\n\t\t\t\"</ul>\"\r\n\t\t);\r\n\t\t$(\"#gp_lobby_players button.add\").bind(\"click\", function() {\r\n\t\t\tloadGameInvites();\r\n\t\t});\r\n\t}\r\n\telse {\r\n\t\t$(\"#gp_lobby_players .components\").append(\r\n\t\t\t\"<section class='ready'><button><p>Ready!</p></button></section>\" +\r\n\t\t\t\"<ul class='spots'>\" +\r\n\t\t\t\t\"<li><button class='search'><img src='img/load_random-16.png'></button></li>\" +\r\n\t\t\t\t\"<li><button class='search'><img src='img/load_random-16.png'></button></li>\" +\r\n\t\t\t\t\"<li><button class='search'><img src='img/load_random-16.png'></button></li>\" +\r\n\t\t\t\"</ul>\"\r\n\t\t);\r\n\t\t$(\"#gp_lobby_players .ready button\").bind(\"click\", loadMultiGP);\r\n\t\t$(\"#gp_lobby_players button.player\").bind(\"click\", function() {\r\n\t\t\tloadRecords();\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\tsetTimeout(function() {\r\n\t\t\tsearchCycles = 0;\r\n\t\t\tsearchState = 0;\r\n\t\t\tanimateSearch();\r\n\t\t}, 1000);\r\n\t}\r\n\t\r\n\t// Bind the button behaviors\r\n\t$(\"#gp_lobby .options button\").bind(\"click\", function() {\r\n\t\tloadOptions(\"MULTI\");\r\n\t});\r\n\t\r\n\t// Show the game panels and hide the fe panels\r\n\t$(\"#game\").addClass(\"flip\");\r\n\t$(\"#game\").bind(\"webkitTransitionEnd\", function() {\r\n\t\t$(\"#game\").unbind(\"webkitTransitionEnd\");\r\n\t\tloadMainControls();\r\n\t\t$(\"#fe_controls\").bind(\"webkitAnimationEnd\", function() {\r\n\t\t\t$(\"#fe_controls\").unbind(\"webkitAnimationEnd\");\r\n\t\t\t$(\"#fe\").hide();\r\n\t\t});\r\n\t});\r\n}", "function start() {\n room.sendToPeers(GAME_START);\n onStart();\n}", "function onStart(data)\n{\n\tconsole.log('Received start request.');\n\tconsole.log(data);\n var args = Config.arguments ;\n\n // If we specified a leve\n var level ;\n if(data.level)\n level = data.level;\n else\n level = Config.level; \n\n //Configure UT3 server parameters\n Config.parameters.password = generateGUID();\n\n args.push(Config.getParameters());\n\n\tvar ut3 = spawn(Config.exe(),args);\n\t// reguster ccallbacks\n\tut3.on('exit',onUT3exit);\n\tut3.stderr.on('data',onUT3stderr);\n\tut3.stdout.on('data',onUT3stdout);\n\n\tconsole.log('Started game server process');\n\n //Configure the return message\n var message = { \n password: Config.password,\n }\n\n\tsocket.emit('started',message);\n}", "function lobbyData() {\n\t\t//alert('list of local players: ' + players);\n\t\t\n\t\t//puts all players into json object\n \tvar jObject={};\t\n \tfor(i in players)\n\t {\n\t jObject[i] = players[i];\n\t }\n\t\t//checks web for new players\n\t\tvar gamePlayerData = new globals.xml.gamePlayers(input.gameID, jObject);\n\t}", "function initLobby(s) {\n var opponentID = (s.session.playerID == \"creator\") ? \"player2\" : \"creator\";\n if (s.session.username === undefined || s.session.username == '' || s.session.username == ' ' || s.session.username == null) {\n s.emit(\"askUsername\");\n }\n else {\n room[s.session.roomID].players[s.session.playerID] = {\n username: s.session.username\n };\n s.emit(\"addUser\", {username: s.session.username, avatar: s.session.avatarLink});\n s.broadcast.to(s.session.roomID).emit(\"addUser\", {username: s.session.username, avatar: s.session.avatarLink});\n room[s.session.roomID].clients += 1;\n if (s.session.isAuthenticated == true) {\n room[s.session.roomID].players[s.session.playerID].isAuthenticated = true;\n }\n }\n s.join(s.session.roomID);\n}", "function Bot$start(){\n if(this.client == null){\n this.createServer();\n this.createClient();\n \n }\n}", "function start(url, password, room_id) {\n console.log(\"received url\")\n start_golmi(url, password)\n golmi_socket.connect();\n golmi_socket.emit(\"join\", { \"room_id\": room_id });\n}", "function startDownloadServer(usernameFromPeerJS,roomNameFromPeerJS) {\n\tusername = usernameFromPeerJS\n rtc.room_info(rtccopy_server, roomNameFromPeerJS);\n\tinit(roomNameFromPeerJS); \n}", "start() {\n server.loginConnection(this.connection, this.user);\n this.connection.send('login', { id: this.user, name: this.name, token: this.token});\n }", "startMatch(data){\n //assign a player to be O, this will be the second player to join a match\n if(game.id === data.id)\n {\n game.waiting = true\n game.player = \"o\"\n game.playerPieceText.setText(\"You are O\")\n game.opponent = data.challenger\n game.turnStatusText.setText(game.opponent + \"'s turn\")\n game.opponentKey = data.challengerkey\n Client.connectedToChat({\"opponent\": game.opponent});\n }\n else\n {\n game.waiting = false\n console.log(\"no longer waiting!\")\n game.player = \"x\"\n game.playerPieceText.setText(\"You are X\")\n game.opponent = data.username\n game.opponentKey = data.userkey\n game.turnStatusText.setText(\"Your Turn\")\n Client.connectedToChat({\"opponent\": game.opponent});\n }\n console.log(\"you are challenged by \" + game.opponent)\n console.log(\"you are challenged by key \" + game.opponentKey)\n\n }", "function startBleno() {\n\tconsole.log(\"Setting up Bleno...\");\n\tbleno.setServices([camService, keyService]);\n\n\tbleno.on(\"accept\", (clientAddress) => {\n\t\tcurrentClient = clientAddress;\n\t\treadTimeout = null;\n\t\tconnectionTimeout = setTimeout(() => {\n\t\t\tbleno.disconnect();\n\t\t}, Config.connectionTimeout * 1000);\n\t});\n\n\tbleno.on(\"stateChange\", (state) => {\n\t\tconsole.log(\"Bleno State: \" + state);\n\t\tif (state != \"poweredOn\") { return; }\n\t\n\t\tstartAdvertisingService(Config.deviceName, [Config.keyServiceUuid]);\n\t\tnewRecording();\n\n\t\tsetInterval(() => {\n\t\t\tconsole.log(\"Stopping recording...\");\n\t\t\tcurrentCamera.stop();\n\n\t\t\tsetTimeout(async () => {\n\t\t\t\tconsole.log(\"Processing last recording...\");\n\t\t\t\tif (currentSubjects > 0) {\n\t\t\t\t\tlastHash = await hashFile(currentOutputFile);\n\t\t\t\t\tprocessRecording(currentOutputFile, currentKey, currentVid);\n\t\t\t\t} else {\n\t\t\t\t\tremoveFile(currentOutputFile);\n\t\t\t\t\tconsole.log(\"Key not read so deleted recording without uploading.\");\n\t\t\t\t}\n\t\t\t\tnewRecording();\n\t\t\t}, 100);\n\t\t}, Config.videoLength * 1000);\n\t});\n}", "function drawLobby(lobby)\r\n{\r\n const lobbyDiv = document.createElement('div');\r\n ActiveLobbyBlock.innerHTML = \"\";\r\n lobbyDiv.id = lobby.uid;\r\n ActiveLobbyBlock.appendChild(lobbyDiv);\r\n\r\n lobbyDiv.innerHTML += `<h2>${localeString('lobby')} ${lobby.name}</h2><p><h3>${localeString('lobby-join-code')}: <b>${lobby.uid}</b></h3><p>${localeString('players')}:`;\r\n\r\n const lobbyPlayersDiv = document.createElement('div');\r\n lobbyPlayersDiv.id = 'lobby-players';\r\n for (const player of lobby.players)\r\n lobbyPlayersDiv.innerHTML += `<b>${player.name}</b>, `;\r\n // remove trailing comma\r\n lobbyPlayersDiv.innerHTML = lobbyPlayersDiv.innerHTML.slice(0, -2);\r\n lobbyDiv.appendChild(lobbyPlayersDiv);\r\n\r\n if (lobby.allowspectators && lobby.spectators.length !== 0)\r\n {\r\n const lobbySpectatorsDiv = document.createElement('div');\r\n lobbySpectatorsDiv.id = 'lobby-spectators';\r\n lobbySpectatorsDiv.innerHTML += `<p>${localeString('spectators')}:`;\r\n for (const player of lobby.spectators)\r\n lobbySpectatorsDiv.innerHTML += `<b>${player.name}</b>, `;\r\n lobbySpectatorsDiv.innerHTML = lobbySpectatorsDiv.innerHTML.slice(0, -2);\r\n lobbyDiv.appendChild(lobbySpectatorsDiv);\r\n }\r\n\r\n lobbyDiv.innerHTML += `<p>${localeString('visibility')}: ${lobby.visibility}<p>${localeString('status')}: ${lobby.state}`;\r\n lobbyDiv.innerHTML += `<p><input type=\"checkbox\" id=\"lobby-input-ready\"> ${localeString('ready')}`;\r\n \r\n // TODO: only the owner of the lobby should be able to start the game\r\n lobbyDiv.innerHTML += `<input id=\"button-start-game\" type=\"button\" value=\"${localeString('button-start-game')}\" onclick=\"startGame()\" disabled>`;\r\n lobbyDiv.innerHTML += `<input type=\"button\" value=\"${localeString('button-leave-lobby')}\" onclick=\"leaveLobby()\">`\r\n\r\n const checkbox = document.querySelector('#lobby-input-ready');\r\n checkbox.addEventListener('change', () => {\r\n if (checkbox.checked) socket.emit('lobby-user-ready');\r\n else socket.emit('lobby-user-unready');\r\n });\r\n}", "startGame(message, gameID) {\n \n // set a blank list for the moves for the game\n Connection.games.set(gameID, [])\n\n // add a computer player if needed \n let players = Array.from(Connection.waiting.keys())\n if (message.hasComputerOpponent) {\n let cpuName = 'cpu' + gameID\n players.push(cpuName)\n let cpuPlayer = this.defaultComputerPlayer(gameID)\n Connection.all.set('cpuAddress', cpuPlayer)\n }\n \n // send the start move\n // this doesn't get bounced by server, only broadcast to client\n console.log(`starting ${players[0]} vs ${players[1]}. gameID: ${gameID}`)\n let start = { op: \"start\", players, gameID }\n\n this.addToMoveListAndBroadcast(start, gameID)\n Connection.waiting.clear()\n \n // everyone starts with three cards\n for (let i = 0; i < STARTING_HAND_SIZE; i++) { \n this.everyoneDraws(gameID)\n }\n \n // Players draw and receive energy occasionally.\n // Some cards played trigger on timers.\n this.startGameLoop(gameID)\n\n }", "start() {\n const { server, port } = this\n\n server.listen(port, () => {\n this.log(`Start at http://localhost:${port}. Starting election...`)\n this.getLeader()\n })\n }", "function startGame() {\r\n console.log('The game has started for this server.');\r\n gameStarted = true;\r\n\r\n // Shuffle player order\r\n players = shuffleArray(players);\r\n\r\n // choose random item\r\n item = choices[Math.floor(Math.random() * choices.length)];\r\n console.log('The new item is ' + item);\r\n\r\n // choose random art thief\r\n artThiefIndex = Math.floor(Math.random() * players.length);\r\n console.log('The new art thief index is ' + artThiefIndex);\r\n artThiefId = players[artThiefIndex].id;\r\n console.log('The new art thief ID is ' + artThiefId);\r\n\r\n //start vote counts at zero\r\n for (let player of players) { voteCounts[player.id] = 0; }\r\n votes = {};\r\n\r\n //set current player info\r\n currentPlayerIndex = 0;\r\n currentPlayer = players[currentPlayerIndex];\r\n currentColor = playerColors[currentPlayerIndex];\r\n io.emit('update users', players, audience);\r\n io.emit('start game on client', item, artThiefId, clientObject);\r\n io.emit('update choices', choices, artThiefId);\r\n io.emit('update artist', currentPlayerIndex, currentPlayer, currentColor);\r\n }", "function onStart(data) {\n\t\tconsole.log(\"Player \" + data.name + \" has started the game\");\n\t\tdocument.getElementById('debugoutput').innerText = \"Player \" + data.name + \" has started the game\";\n\t\n\t\t// Set client \"running\" state here?\n}", "askForInfo(){\n\t\tthis.activeConnection.sendToServer({\n\t\t\tcommand: \"PLAYERS\",\n\t\t\ttoken: this.activeConnection.token,\n\t\t});\n\n\t\tthis.activeConnection.sendToServer({\n\t\t\tcommand: \"CPUUSAGE\",\n\t\t\ttoken: this.activeConnection.token,\n\t\t});\n\n\t\tthis.activeConnection.sendToServer({\n\t\t\tcommand: \"RAMUSAGE\",\n\t\t\ttoken: this.activeConnection.token,\n\t\t});\n\t}", "function readyListener (e) {\r\n displayChatMessage(\"Connected.\");\r\n //displayChatMessage(\"Joining chat room...\");\r\n displayChatMessage(\"Joining room...\");\r\n \r\n // Create the chat room on the server\r\n chatRoom = orbiter.getRoomManager().createRoom(\"chatRoom_saumya\");\r\n chatRoom.addEventListener(net.user1.orbiter.RoomEvent.JOIN, joinRoomListener);\r\n chatRoom.addEventListener(net.user1.orbiter.RoomEvent.ADD_OCCUPANT, addOccupantListener);\r\n chatRoom.addEventListener(net.user1.orbiter.RoomEvent.REMOVE_OCCUPANT, removeOccupantListener); \r\n \r\n // Listen for chat messages\r\n chatRoom.addMessageListener(\"CHAT_MESSAGE\", chatMessageListener);\r\n \r\n // Join the chat room\r\n chatRoom.join();\r\n}", "startServer() {\n\t\t\n\t\tthis._game.startGame();\n\t\t\n\t\tthis._server = new WebSocketServer({port: config['port'], path: config['path']}, function () {\n\t\t\tconsole.log('[SERVER] Server Started at 127.0.0.1:' + config['port'] + '! Waiting for Connections...');\n\t\t\t//console.log(\"[BOTS] Bot Status: Bot's are currently unavailable! Please try again later.\");\n\t\t\t//console.log('[BOTS] Creating ' + config['bots'] + ' bots!');\n\t\t\t//console.log('[BOTS] Bots successfully loaded: ' + botCount + (botCount === 0 ? \"\\n[BOTS] Reason: Bot's aren't implemented yet. Please try again later\" : ''));\n\t\t});\n\n\t\tif (this._server.readyState === this._server.OPEN) {\n\t\t\tthis._server.on('connection', this.onConnection.bind(this));\n\t\t} else {\n\t\t\tconsole.log(this._server.readyState);\n\t\t}\n\t}", "startMultiplayer()\n {\n document.getElementById(\"chat-box\").style.visibility = \"visible\";\n document.getElementById(\"open-box\").style.visibility = \"visible\";\n \n if(game.firstPlay === true)\n {\n\n if(game.challengingFriend)\n {\n Client.makeNewPlayer({\"name\":game.username, \"gametype\":game.gametype, \"userkey\":game.userkey, \"friend\":game.friend.username});\n }\n else\n {\n makeClient();\n Client.makeNewPlayer({\"name\":game.username, \"gametype\":game.gametype, \"userkey\":game.userkey});\n }\n console.log(\"firstPlay!\")\n game.firstPlay = false\n game.waiting = true\n }\n else\n {\n game.askForRematch()\n }\n }", "function sendKey(key){ OimoWorker.postMessage({tell:\"KEY\", key:key}); }", "onStart() {\n const _ = this;\n Game.socket.once('startReply', function(conf) {\n _.GUI.clear();\n\n const player = new MainPlayer(conf.x, conf.y, _.world);\n\n Game.players[Game.socket.id] = player;\n _.camera.follow(player);\n _.GUI.debug(player, 'x');\n });\n Game.socket.emit('start');\n }", "onMessage(client, data) {\n\t\tif (data.action === 'joingameroom') {\n\t\t\temitter.eventBus.sendEvent('createGameLobby', data);\n\t\t\tthis.onLeave(client, true);\n\t\t}\n\t}", "function startUp() {\n\t\tconnectAPI();\n\t\tisIBotRunning = true;\n\t\t$(\"#chat-txt-message\").attr(\"maxlength\", \"99999999999999999999\");\n\t\tAPI.sendChat(IBot.iBot + \" Started!\");\n\t}", "onOpen() {\n this.sendPacket({\n op: Constants.OPCodes.DISPATCH,\n d: {\n server_id: this.voiceConnection.channel.guild.id,\n user_id: this.client.user.id,\n token: this.voiceConnection.authentication.token,\n session_id: this.voiceConnection.authentication.sessionID,\n },\n }).catch(() => {\n this.emit('error', new Error('Tried to send join packet, but the WebSocket is not open.'));\n });\n }", "_sendClientInit() {\n this._log(`Sending clientInit`);\n this._waitingServerInit = true;\n // Shared bit set\n this.sendData(new Buffer.from([1]));\n }", "async handleJoin(gameId) {\n await fetch('http://localhost:5000/lobbyp', {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n \"Acces-Control-Allow-Origin\": \"true\"\n },\n body: JSON.stringify({\n gameId: gameId,\n pseudo: this.state.pseudo,\n token: 0,\n })\n });\n await fetch('http://localhost:5000/icount', {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n \"Acces-Control-Allow-Origin\": \"true\"\n },\n body: JSON.stringify({\n gameId: gameId,\n })\n });\n await fetch(`http://localhost:5000/lobby/${gameId}`)\n .then(response => response.json())\n .then(json => {\n this.setState({ lobby: json });\n })\n\n\n this.setState({ playerToken: 0 });\n this.setState({ joinedGame: gameId });\n\n\n }", "onLoad() {\n this._super();\n if (Global.roomWaitType == 'create') {\n Network.send({ f: 'createRoom', msg: Global.playerName });\n }\n if (Global.roomWaitType == 'join') {\n\n Network.send({ f: 'joinRoom', msg: Global.playerName + ',' + Global.roomNum });\n }\n\n }", "function trainerBLEinit () {\n trainerBLE = new TrainerBLE(options = {\n name: 'Jo1'\n },serverCallback);\n\ntrainerBLE.on('disconnect', string => {\n io.emit('control', 'disconnected')\n controlled = false;\n});\n\ntrainerBLE.on('key', string => {\n if (DEBUG) console.log('[server.js] - key: ' + string)\n io.emit('key', '[server.js] - ' + string)\n})\ntrainerBLE.on('error', string => {\n if (DEBUG) console.log('[server.js] - error: ' + string)\n io.emit('error', '[server.js] - ' + string)\n})\n\n\n}", "function joinClient() {\n\tvar playerName = document.getElementById('playerName').value;\n\tif (playerName.length != 0) {\n\t\tsocket.emit('join', {name: playerName});\n\t}\n}", "function init_game_server(players_number){\n var init_grid = {\n init_players : players_number\n }\n socket.send(JSON.stringify(init_grid));\n }", "function join() {\n var roomName = roomField.value\n , userName = userField.value\n\n roomStore.set(\"room-name\", roomName)\n roomStore.set(\"user-name\", userName)\n\n roomField.value = \"\"\n userField.value = \"\"\n\n room.emit(\"join\", roomName, userName)\n}", "placeBomb(){\n this.network.sendMessage({func: \"keyHandle\", key: 32});\n }", "async playerJoined(protoPlayerObject) {\n // ... instantiate them as a new player object using information sent from the server\n const newPlayer = new Player(protoPlayerObject);\n this.players.push(newPlayer);\n\n // ... send the player a package with their credentials\n this.messager.sendClientMessage(this.messager.parcelMessage({\n message: \"Hello from deep in the game!\",\n clientId: newPlayer.clientId,\n handle: newPlayer.handle\n }, newPlayer.clientId, \"incomingPlayerInitialization\"));\n\n this.broadcastPrompt(newPlayer.clientId);\n\n this.messager.sendClientMessage(this.messager.parcelMessage({\n // gameStateMessage: \"Welcome to the game!\", gameState: \"getHandle\"\n stateMessage: this.marqueeText, state: this.gameState\n }, newPlayer.clientId, \"incomingGameState\"));\n\n // ... send everyone else an alert with the new player's credentials.\n this.messager.broadcastMessage(this.messager.parcelMessage({message: `A new player has joined!`}, newPlayer.clientId, \"incomingNewPlayer\"), true);\n this.broadcastScoreboard();\n await this.updateLeaderboard();\n }", "function initChatroom() {\n getServerUrl()\n .then(result => {\n connection = new WebSocket(result);\n \n initMaterial();\n geocoder = new google.maps.Geocoder();\n initWebsocket();\n initMarkerMenu();\n initThreads();\n initMap();\n initChat();\n initSharing();\n });\n}", "start() {\n const { email, password } = this.config.credentials || {};\n verboseLog('Starting server', (!email && !password ? 'with' : 'without').yellow, 'credentials');\n verboseLog('Running', (this.config.server.__LOCAL ? path.join(__dirname, '../../tools/brickadia.sh') : 'brickadia launcher').yellow);\n\n // handle local launcher support\n const launchArgs = [\n this.config.server.__LOCAL\n ? path.join(__dirname, '../../tools/brickadia.sh')\n : 'brickadia',\n this.config.server.branch && `--branch=${this.config.server.branch}`,\n '--server',\n '--',\n ];\n\n // Either unbuffer or stdbuf must be used because brickadia's output is buffered\n // this means that multiple lines can be bundled together if the output buffer is not full\n // unfortunately without stdbuf or unbuffer, the output would not happen immediately\n this.#child = spawn('stdbuf', [\n '--output=L',\n '--',\n ...launchArgs,\n this.config.server.map && `${this.config.server.map}`,\n '-NotInstalled', '-log',\n this.path ? `-UserDir=\"${this.path}\"` : null,\n email ? `-User=\"${email}\"` : null, // remove email argument if not provided\n password ? `-Password=\"${password}\"` : null, // remove password argument if not provided\n `-port=\"${this.config.server.port}\"`,\n ].filter(v => v)); // remove unused arguments\n\n verboseLog('Spawn process', this.#child ? this.#child.pid : 'failed'.red);\n\n this.#child.stdin.setEncoding('utf8');\n this.#outInterface = readline.createInterface({input: this.#child.stdout, terminal: false});\n this.#errInterface = readline.createInterface({input: this.#child.stderr, terminal: false});\n this.attachListeners();\n verboseLog('Attached listeners');\n }", "function request(){\n\n var remoteID = getPrevious();\n\n if ( !remoteID ) return; // entry\n\n CONNECTIONS[ remoteID ].send( 'start', { request: true }, true );\n}", "function clickedOnStart() {\n initValues();\n maxRequest = parseInt(elemByIdValue(\"txfMaxRequests\")) || 6;\n username = elemByIdValue(\"inputUserName\").trim();\n reponame = elemByIdValue(\"inputRepoName\").trim(); \n sendRequest(username, reponame, getAllLabels());\n}", "function startGameRequest() {\n\n var create_game_callback = function(json) {\n window.gameID = parseInt(json);\n console.log(\"created new game with gameID: \" + gameID);\n sendToTicker(\"New game created!\");\n sendToTicker(\"Waiting for players...\");\n\n window.location = HOSTNAME + \"/game.html#\" + gameID;\n\n updateClient();\n }\n\n makeAjaxRequest(HOSTNAME + \"/create_game\", \"\",\n create_game_callback);\n}", "function startServer(){\n listDevices.startAttendaceServer(UserName);\n startMessageServer();\n console.log('did');\n}", "function executeClient() {\n\t\trequest('BrixApi.newPlayer', [], function(response) {\n\t\t\tplayer = new Player(response.value, 400, 400, randomColor());\n\t\t\tmap.addPlayer(player, function() {\n\t\t\t\tplayer.takeControl(map);\n\t\t\t});\n\t\n\t\t\t/*\n\t\t\tstreamRequest('BrixApi.getHitPoints', [], function(response) {\n\t\t\t\tplayer_hitpoints.set(response, 100);\n\t\t\t}, 150);\n\t\t\t*/\n\t\t\tsubscriptionRequest('BrixApi.getPlayers', [], function(response) {\n\t\t\t\tfor(var i in response.value) {\n\t\t\t\t\tvar found = false;\n\t\t\t\t\tfor(var j in playerManager.list) {\n\t\t\t\t\t\tif(response.value[i].state == 4) {\n\t\t\t\t\t\t\t// Player has disconnected\n\t\t\t\t\t\t\tplayerManager.get(playerManager.list[j].id).dom.fadeOut('slow', function() {\n\t\t\t\t\t\t\t\tplayerManager.get(playerManager.list[j].id).dom.remove();\n\t\t\t\t\t\t\t\tplayerManager.remove(playerManager.list[j].id);\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t} else \tif(response.value[i].id == playerManager.list[j].id) {\n\t\t\t\t\t\t\t// Player has data to change\n\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\tif(response.value[i].id != player.id && playerManager.list[j].state > PLAYER_STATES.ETHEREAL) {\n\t\t\t\t\t\t\t\t// Player is not you\n\t\t\t\t\t\t\t\tplayerManager.list[j].dom.animate({\n\t\t\t\t\t\t\t\t\tleft: response.value[i].x,\n\t\t\t\t\t\t\t\t\ttop: response.value[i].y\n\t\t\t\t\t\t\t\t}, 150);\n\t\t\t\t\t\t\t\t\n\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}\n\t\t\t\t\tif(!found) {\n\t\t\t\t\t\tif(response.value[i].x == 0) {\n\t\t\t\t\t\t\tvar x = 400;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar x = response.value[i].x;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(response.value[i].y == 0) {\n\t\t\t\t\t\t\tvar y = 400;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar y = response.value[i].y;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar newPlayer = new Player(response.value[i].id, x, y, randomColor()); \n\t\t\t\t\t\tplayerManager.add(newPlayer);\n\t\t\t\t\t\tmap.addPlayer(newPlayer, function() {\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}, 150);\n\t\t});\n\t}", "function cmdCallStart() {\n let html_form = `<input type=\"text\" placeholder=\"Mensagem...\" id=\"j_input_send\">\n <a href=\"javascript:;\" class=\"chatbox__send--footer\" id=\"j_btn_send\">\n <i class=\"fa fa-paper-plane-o\"></i>\n </a>`\n\n print_msg.innerHTML = ''\n print_input_footer.innerHTML = html_form\n document.getElementById('j_btn_send').onclick = () => submitMsg()\n document.getElementById('j_input_send').onkeydown = (e) => {\n if (e.key == 'Enter') {\n submitMsg()\n return false\n }\n }\n\n if (conn_ws) {\n requestHistory()\n } else {\n initSocket(getToken(), true, requestHistory)\n }\n\n sessionStorage.setItem(\"chatbox_content\", \"call_start\")\n }", "initUI() {\n document.getElementById('start-button').addEventListener('click', () => {\n this.ws.send(JSON.stringify({ type: 'start' }));\n this.listenWS(this.ws);\n });\n }", "constructor() {\n\n this.gso = {};\n this.net = new network();\n\n this.state = \"mainmenu\";\n this.pNum = null;\n\n clientEventBus.on(\"CHANGE_STATE\", (state, data) => {\n // recieve and handle change state event from main menu\n \n switch (state) {\n \n case \"HOTSEAT\":\n // Don't need the network layer, just start a new GSO and \n // tell renderer to change mode\n\n console.log(`Starting a new hotseat game with ${data} players`);\n this.state = state;\n this.gso = new GameState(data);\n clientEventBus.emit(\"REND_TO_INDEX\");\n \n break;\n \n case \"CONNECT\":\n // Don't need a GSO, just start a new network connection\n\n this.state = state; \n this.net.connect(data);\n \n break;\n \n case \"HOST\":\n // Init all the things!\n \n console.log(\"hosting a network game, starting gamestate and server\")\n this.state = state; \n this.net.host();\n break; \n }\n\n });\n\n clientEventBus.on(\"HOSTSTART\", () => {\n // hosting player has clicked the \"Host Start\" button after players \n // connected. start a new gamestate, tell connected clients to change\n // modes and send them to the connected clients to render\n\n console.log(`Hosting a network game with ${this.net.getPlayerCount() + 1} players`);\n this.gso = new GameState(this.net.getPlayerCount() + 1);\n this.pNum = 0;\n clientEventBus.emit(\"REND_TO_INDEX\", this.pNum);\n this.net.sendGSO(\"HOSTSTART\", this.gso.getGameState());\n\n });\n\n clientEventBus.on(\"SET_PNUM\", (pNum) => {\n // this instance is a client, and has recieved a player number from \n // the host, passed in as pNum\n \n if (this.pNum === null) {\n this.pNum = pNum;\n console.log(\"Client: Recieved pNum \" + pNum);\n }\n \n });\n\n }", "function addWelcome(data) {\r\n addMsg(data, \"server\");\r\n}", "function startGame(){\n //Owner instructs server to send everyone a question\n if(amIRoomOwner){\n socket.emit('getquestion');\n }\n}", "function startGame() {\n\tsocket.emit('start', {name: 'James'});\n}", "showLobbyFromSelect() { \n const username = document.getElementById('select-field').value;\n if (username === '') {\n console.log('you must enter a name');\n return;\n }\n let socket = io.connect('', {query: `username=${username}`});\n\n if (this.state.gameID) {\n const copy = Object.assign({}, this.state);\n copy.renderLobby = true;\n copy.renderSelectQuiz = false;\n // Get request to get the quiz\n fetch(`${url}quiz/0`, {\n credentials: 'include',\n })\n .then(response => response.json())\n .then((quiz) => {\n copy.quiz = quiz;\n this.setState(copy);\n });\n } else {\n // Post request to change database with username\n fetch(`${url}game`, {\n body: JSON.stringify({ quizID: 0 }),\n credentials: 'include',\n headers: {\n 'content-type': 'application/json',\n },\n method: 'POST',\n })\n .then(response => response.json())\n .then((myJson) => {\n const copy = Object.assign({}, this.state);\n copy.gameID = myJson.id;\n copy.renderLobby = true;\n copy.renderSelectQuiz = false;\n // Get request to get the quiz\n fetch(`${url}quiz/0`, {\n credentials: 'include',\n })\n .then(response => response.json())\n .then((quiz) => {\n copy.quiz = quiz;\n this.setState(copy);\n });\n });\n }\n }", "function launch() {\n\t// Fetch our access token.\n\tlog.main(\"fetching new access token\");\n\treddit.oauthRequest({\n\t\tbaseUrl: \"https://s.reddit.com/api/v1\",\n\t\tmethod: \"get\",\n\t\turi: \"/sendbird/me\",\n\t}).then(sbInfo => {\n\t\t// Get our Reddit user ID\n\t\tlog.main(\"getting id\");\n\t\treddit.getMe().id.then(id => {\n\t\t\t// We have both necessary values, so let's connect to Sendbird!\n\t\t\tlog.main(\"connecting to sendbird\");\n\t\t\tpify(sb.connect.bind(sb), \"t2_\" + id, sbInfo.sb_access_token).then(userInfo => {\n\t\t\t\t// We did it! Let's store the user info in a higher scope.\n\t\t\t\tlog.main(\"connected to sendbird\");\n\t\t\t\tclient = userInfo;\n\n\t\t\t\t// Let's catch up on the invites we might've missed while offline.\n\t\t\t\tacceptInvitesLate();\n\t\t\t}).catch(() => {\n\t\t\t\tlog.main(\"couldn't connect to sendbird\");\n\t\t\t});\n\t\t}).catch(() => {\n\t\t\tlog.main(\"could not get id\");\n\t\t});\n\t}).catch(() => {\n\t\tlog.main(\"could not get access token\");\n\t});\n}", "function joinGame(data) {\n \n //Check if room exists\n if (data in gameRoomDict) {\n if (gameRoomDict[data].length < 2) {\n io.to(gameRoomDict[data][0]).emit('p2Joined');\n room = data;\n clients.sock = data;\n console.log(\"You have joined the lobby named: \" + data);\n gameRoomDict.data = gameRoomDict[data].push(socket.id);\n var stuff = [data, \"join\"]\n io.to(socket.id).emit('connectedG', stuff);\n console.log(gameRoomDict[data]);\n }\n else {\n console.log(\"Sorry this room is full\");\n }\n }\n else {\n console.log(data + \" does not exist in the list of current lobbies.\");\n }\n }", "function startGame() {\n\tvar serverMsg = document.getElementById('serverMsg');\n\tdocument.getElementById('print').disabled = false;\n\tserverMsg.value += \"\\n> all players have joined, starting game, wait for your turn...\"\n\tdocument.getElementById('rigger').style.display = \"none\";\n}", "function RpbComm() {\r\n { // Set all methods/properties\r\n this.isHosting = false;\r\n this.myUserKey = null;\r\n this.hostPingCount = 0; // Number of 'ping checks' since \r\n this.hostPingRate = 5000; // 5 secs - Interval of ping checker\r\n this.hostPingLimit = 2; // 10 secs- length of time that will pass before we assume host has vanished\r\n\r\n this.myName = this.generateRandomName(); //\"stefan\";\r\n\r\n /** An object containing handlers for requests. Property names correspond to message strings. */\r\n this.requestHandlers = [];\r\n /** An object containing handlers for actions. Property names correspond to message strings. */\r\n this.actionHandlers = [];\r\n /** An object containing handlers for events. */\r\n this.eventHandlers = [];\r\n /** The object on whose context request and action handlers will be invoke */\r\n this.handlerContext = null;\r\n\r\n this.nodes = {\r\n root: database.ref(\"rpb\"),\r\n host: database.ref(\"rpb/host\"),\r\n hostPing: database.ref(\"rpb/hostPing\"),\r\n players: database.ref(\"rpb/players\"),\r\n waitingPlayers: database.ref(\"rpb/requestJoin\"),\r\n requests: database.ref(\"rpb/requestAction\"),\r\n actions: database.ref(\"rpb/performAction\"),\r\n bets: database.ref(\"rpb/bets\"),\r\n userPing: database.ref(\"rpb/userPing\"),\r\n };\r\n\r\n this.cached = {\r\n host: null,\r\n players: {},\r\n waitingPlayers: {},\r\n requests: [],\r\n actions: [],\r\n bets: [],\r\n };\r\n /** Holds the number of successive pings a user has failed to respond to */\r\n this.userPings = {};\r\n this.events = {\r\n playerListChanged: \"playerListChanged\",\r\n hostSet: \"hostSet\",\r\n waitingListChanged: \"waitingListChanged\",\r\n };\r\n\r\n this.getThisPlayer = function getThisPlayer() {\r\n return this.cached.players[this.myUserKey];\r\n };\r\n\r\n\r\n /** Returns a promise that resolves when connected. */\r\n this.connect = function () {\r\n var self = this;\r\n\r\n // First and foremost, we're checking who the host is. \r\n // If there is no host, we're becoming the host.\r\n // Else, we're joining as a spectator, at which point we can ask to join the next round\r\n\r\n return this.nodes.host.once(\"value\")\r\n .then(function (snapshot) {\r\n if (snapshot.val()) {\r\n self.joinExistingGame();\r\n } else {\r\n self.createNewGame();\r\n }\r\n\r\n self.nodes.host.on(\"value\", self.ondb_host_value.bind(self));\r\n self.nodes.players.on(\"value\", self.ondb_players_value.bind(self));\r\n self.nodes.requests.on(\"child_added\", self.ondb_requests_childAdded.bind(self));\r\n self.nodes.waitingPlayers.on(\"value\", self.ondb_waitingPlayers_value.bind(self));\r\n self.nodes.actions.on(\"child_added\", self.ondb_actions_childAdded.bind(self));\r\n self.nodes.bets.on(\"value\", self.ondb_bets_value.bind(self));\r\n self.nodes.hostPing.on(\"value\", self.ondb_hostPing_value.bind(self));\r\n self.nodes.userPing.on(\"child_added\", self.ondb_userPing_childAdded.bind(self));\r\n }).catch(function (error) {\r\n alert(JSON.stringify(error));\r\n });\r\n };\r\n\r\n this.updatePlayer = function updatePlayer(playerID, playerData) {\r\n this.nodes.players.child(playerID).set(playerData);\r\n };\r\n\r\n\r\n this.createNewGame = function () {\r\n this.isHosting = true;\r\n\r\n // note that the key name \"host\" carries no significance to the program, it was just convenient and helps identify the host when debugging \r\n this.myUserKey = \"host\"; // todo: move from game to comm\r\n var dbData = {\r\n hostPing: firebase.database.ServerValue.TIMESTAMP,\r\n host: \"host\",\r\n players: {\r\n host: {\r\n name: this.myName,\r\n balance: 1000,\r\n }\r\n },\r\n };\r\n\r\n this.nodes.root.set(dbData);\r\n\r\n this.beginHostPing();\r\n };\r\n\r\n this.joinExistingGame = function () {\r\n this.isHosting = false;\r\n //this.myName = prompt(\"enter a name. also, replace this with something competent, you turd.\"); // todo: move from game to comm\r\n this.myName = this.generateRandomName();\r\n\r\n var node = this.nodes.waitingPlayers.push({\r\n name: this.myName,\r\n balance: 1000,\r\n });\r\n this.myUserKey = node.key;\r\n };\r\n\r\n this.usurpGame = function () {\r\n var self = this;\r\n\r\n // ping immediately so nobody else steals the throne.\r\n this.doHostPing();\r\n // Clients to notify users\r\n this.dispatchAction(\"hostTimeout\");\r\n\r\n var currentHost = this.cached.host;\r\n\r\n // in ten seconds, oust the host\r\n setTimeout(function () {\r\n self.nodes.players.child(currentHost).set(null);\r\n self.nodes.host.set(self.myUserKey);\r\n\r\n self.isHosting = true;\r\n self.beginHostPing();\r\n //self.dispatchRequest(\"startGame\");\r\n self.prepareRound();\r\n }, 10000);\r\n };\r\n\r\n /** Moves waiting players to active player list and sends the startGame message */\r\n this.prepareRound = function () {\r\n var self = this;\r\n var promises = [];\r\n\r\n // move users from waiting list to playing\r\n var waitList = this.cached.waitingPlayers;\r\n var waitingPromise = this.nodes.waitingPlayers.set({});\r\n promises.push(waitingPromise);\r\n\r\n forEachIn(waitList, function (key, value) {\r\n var invalid = (!key || !value);\r\n if (!invalid) { // if your name is \"\", you don't get to play. ¯\\_(ツ)_/¯\r\n var newPlayerPromise = this.nodes.players.child(key).set(value);\r\n promises.push(newPlayerPromise);\r\n }\r\n }, this);\r\n\r\n // Send the 'begin game' message when all users have been moved around.\r\n Promise.all(promises)\r\n .then(function (e) {\r\n self.dispatchRequest(\"startGame\");;\r\n });\r\n };\r\n\r\n /** Registers a host ping */\r\n this.hostPonged = function (timestamp) {\r\n if (!this.isHosting) {\r\n this.hostPingCount = 0;\r\n }\r\n };\r\n\r\n this.hostPingCheck = function () {\r\n if (!this.isHosting) {\r\n this.hostPingCount++;\r\n if (this.hostPingCount == this.hostPingLimit) {\r\n this.usurpGame();\r\n }\r\n }\r\n };\r\n\r\n this.setChatMessage = function (userID, text) {\r\n this.nodes.chat.push({\r\n user: userID,\r\n text: text,\r\n });\r\n };\r\n\r\n this.beginHostPing = function () {\r\n setInterval(this.doHostPing.bind(this), 10000);\r\n\r\n // function ping() {\r\n // this.nodes.hostPing.set(firebase.database.ServerValue.TIMESTAMP);\r\n // this.nodes.hostPing.once(\"value\").then(function (snap) { console.log(snap.val()); });\r\n // }\r\n };\r\n\r\n /** Sends a ping to the server and checks that clients are responding */\r\n this.doHostPing = function () {\r\n this.nodes.hostPing.set(firebase.database.ServerValue.TIMESTAMP);\r\n this.nodes.hostPing.once(\"value\").then(function (snap) { console.log(snap.val()); });\r\n this.checkUserPing();\r\n };\r\n\r\n this.checkUserPing = function () {\r\n var self = this;\r\n forEachIn(this.cached.players, function (key, value) {\r\n if (key != self.myUserKey) { // don't kick self\r\n\r\n var usersPing = self.userPings[key] || 0;\r\n usersPing++;\r\n\r\n if (usersPing == 2) {\r\n self.dispatchAction(\"userTimeout\", { user: key, name: value.name });\r\n } else {\r\n self.userPings[key] = usersPing;\r\n }\r\n }\r\n });\r\n };\r\n\r\n this.doUserPing = function () {\r\n if (!this.isHosting) {\r\n this.nodes.userPing.push({ user: this.myUserKey });\r\n }\r\n };\r\n\r\n /** Sends a message to the host to request a game action to occur */\r\n this.dispatchRequest = function (msgString, msgArgObject) {\r\n var msg = { action: msgString };\r\n if (msgArgObject) msg.args = msgArgObject;\r\n this.nodes.requests.push(msg);\r\n };\r\n this.startRound = function (msgString, msgArgObject) {\r\n // var msg = { action: msgString };\r\n // if (msgArgObject) msg.args = msgArgObject;\r\n\r\n // When we start a new round, we clear out all old requests, actions, and pings\r\n this.nodes.requests.set(null);\r\n this.nodes.actions.set(null);\r\n this.nodes.userPing.set(null);\r\n\r\n //this.nodes.actions.set({\"0\": msg});\r\n this.dispatchAction(msgString, msgArgObject);\r\n }\r\n /** Sends a message to clients informing them that a game action has occurred */\r\n this.dispatchAction = function (msgString, msgArgObjcet) {\r\n var msg = { action: msgString };\r\n if (msgArgObjcet) {\r\n msg.args = msgArgObjcet;\r\n } else {\r\n msg.args = {};\r\n }\r\n msg.args.source = this.myUserKey;\r\n this.nodes.actions.push(msg);\r\n };\r\n\r\n this.processRequest = function (msgString, msgArgObject) {\r\n this.requestHandlers.forEach(function (handlerObject) {\r\n var handlerFunc = handlerObject[msgString];\r\n if (handlerFunc) handlerFunc.call(handlerObject.handlerContext || this, msgArgObject);\r\n }, this);\r\n };\r\n this.raiseEvent = function (event, eventArgs) {\r\n this.eventHandlers.forEach(function (handlerObject) {\r\n var handler = handlerObject[event];\r\n if (handler) handler.call(handlerObject.handlerContext, eventArgs);\r\n }, this);\r\n };\r\n this.processAllRequests = function () {\r\n while (this.cached.requests.length > 0) {\r\n var msg = this.cached.requests.shift();\r\n this.processRequest(msg.action, msg.args);\r\n }\r\n };\r\n\r\n this.processAction = function (msgString, msgArgObject) {\r\n this.actionHandlers.forEach(function (handlerObject) {\r\n var handlerFunc = handlerObject[msgString];\r\n if (handlerFunc) handlerFunc.call(handlerObject.handlerContext || this, msgArgObject);\r\n }, this);\r\n };\r\n\r\n this.ondb_host_value = function (snapshot) {\r\n console.log(\"HOST\", snapshot.val());\r\n this.cached.host = snapshot.val();\r\n this.raiseEvent(this.events.hostSet);\r\n };\r\n this.ondb_players_value = function (snapshot) {\r\n console.log(\"PLAYERS\", snapshot.val());\r\n this.cached.players = snapshot.val() || {};\r\n this.raiseEvent(this.events.playerListChanged);\r\n };\r\n this.ondb_requests_childAdded = function (snapshot) {\r\n // var val = snapshot.val();\r\n // if(!val) return;\r\n\r\n // console.log(\"REQUEST + \", val);\r\n // var self = this;\r\n // var requestList;\r\n\r\n // //this.comm.cached.requests = snapshot.val();\r\n // if (this.isHosting && val) {\r\n // // console.log(\"Initiate transaction for \", snapshot.val());\r\n // // Use a transaction to retreive requests then delete them\r\n // this.nodes.requests.transaction(function (req) {\r\n // // console.log(\"Enter transaction for \", req);\r\n // if (!req) {\r\n // // console.log(\"Abort transaction for\", req);\r\n // return undefined;\r\n // }\r\n\r\n // requestList = req || requestList;\r\n // // console.log(\"requestList = \", req)\r\n // // console.log(\"Set to null for \", req)\r\n // return null;\r\n // })\r\n // .then(function () {\r\n // console.log(\"REQUEST FINAL \", requestList)\r\n // self.processRequests.bind(self)(requestList);\r\n // });\r\n // }\r\n\r\n console.log(\"REQUEST + \", snapshot.val());\r\n this.cached.requests = snapshot.val();\r\n var requestObj = snapshot.val();\r\n this.processRequest(requestObj.action, requestObj.args);\r\n };\r\n\r\n this.processRequests = function processRequests(reqObject) {\r\n var collection = [];\r\n forEachIn(reqObject, function (key, value) {\r\n collection.push(value);\r\n });\r\n this.cached.requests = collection;\r\n this.processAllRequests();\r\n };\r\n\r\n this.ondb_waitingPlayers_value = function (snapshot) {\r\n console.log(\"WAITING + \", snapshot.val());\r\n this.cached.waitingPlayers = snapshot.val();\r\n this.raiseEvent(this.events.waitingListChanged);\r\n };\r\n\r\n this.ondb_actions_childAdded = function (snapshot) {\r\n console.log(\"ACTION + \", snapshot.val());\r\n this.cached.actions = snapshot.val();\r\n var actionObj = snapshot.val();\r\n this.processAction(actionObj.action, actionObj.args);\r\n };\r\n\r\n this.ondb_bets_value = function (snapshot) {\r\n console.log(\"BET + \", snapshot.val());\r\n this.cached.bets = snapshot.val();\r\n };\r\n\r\n this.ondb_hostPing_value = function (snapshot) {\r\n var time = snapshot.val();\r\n if (time) {\r\n this.hostPonged(time);\r\n this.doUserPing();\r\n }\r\n };\r\n\r\n this.ondb_userPing_childAdded = function (snapshot) {\r\n var user = (snapshot.val() || {}).user;\r\n if (user) {\r\n this.userPings[user] = 0;\r\n }\r\n };\r\n }\r\n\r\n setInterval(this.hostPingCheck.bind(this), this.hostPingRate);\r\n}", "function onOpen() {\n console.log('Spacebrew Connected');\n var message = \"Connected as <strong>\" + sb.name() + \"</strong>\";\n if (sb.name() === app_name) {\n message += \"<br>You can customize this app's name in the query string by adding <strong>name=your_app_name</strong>.\"\n }\n $(\"#statusMsg\").html(message);\n\n // Perform browser based date synchronization\n console.log('Websockets are ready')\n var today = new Date();\n // getTime() always uses UTC for time representation. For example, a client browser in one timezone,\n // getTime() will be the same as a client browser in any other timezone.\n\n var delayInMilliseconds = 500;\n\n setTimeout(function() {\n //code executed after delay time\n sendCmd('Time:' + today.getTime())\n }, delayInMilliseconds);\n\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}", "constructor(socket, nickname, lobby) \n {\n this.socket = socket;\n this.nickname = nickname;\n this.lobby = lobby;\n this.room = null;\n\n // Wait for the user to get a nickname before listening for\n // other events.\n waitForNickname(this);\n }", "function init() {\n jaxl.setPollUrl('php/webChat.php');\n jaxl.setPayLoadHandler(new Array('boshMUChat', 'payloadHandler'));\n \n \n jaxl.connect(data={'user':'test', 'pass':'test'});\n \n $('#inputField').keydown(function(e) {\n if(e.keyCode == 13 && jaxl.getConnected()) { //13 = enter\n message = $.trim($(this).val());\n if(message.length == 0) return false;\n $(this).val('');\n\n\n jaxl.sendPayLoad({\n 'jaxl':'message',\n 'message':message\n });\n }\n }); \n \n }", "function onServerStartGame(data)\n{\n\tif (state != ClientStates.WaitPage)\n\t{\n\t\tconsole.log(\"serverStartGame message received at unexpected time. Ignored.\");\n\t\treturn;\n\t}\n\t$(\"#homePage\").hide(1000);\n\t$(\"#waitPage\").hide(1000);\n\t$(\"#gamePage\").show(1000, function(){\n\t\tcontroller = new GameController(data);\n\t});\n}", "function joined(e) {\n userId = e.id;\n $('#controls').show();\n startPrompts();\n}", "function HandleOpen() {\n console.log('WebSocket open');\n SetState(IconBuilding, 'Connected');\n}", "_joinRoom(){\n this.state.socket.emit(\"join\", this.state.joinCode);\n this.setState({\n playerNum: 2,\n gameCode: this.state.joinCode\n });\n }", "sendStartPacket(p) {\n this.activeGames.push(p.gameId);\n console.log(\"Game started: \", this.activeGames);\n var packet = {\n authKey: \"\",\n nickname: \"\",\n locationX: 12500,\n locationY: 12500,\n isBotEnabled: false,\n sosActive: false,\n score: 10,\n foodAvailable: false,\n eatMeActive: false,\n lagActive: false,\n serverIP: p.serverIP,\n port: p.port,\n kills: 0,\n finalScore: false,\n gameStart: true,\n gameId: p.gameId,\n boost: this.rainBoost\n };\n this.sendAll(packet);\n this.latestGameStart = packet;\n if (this.shouldSentStartRequestOnGameStart) {\n this.updateRainBotStatus();\n }\n }", "function welcome(agent){\n agent.add(getTelegramButtons(\"Welcome to Big Brother! I'm responsible for taking care of your apps! Here's what you can do with me:\", actions));\n}", "function sendLobbyPlayerlistUpdate() {\n if (!g_IsController || !Engine.HasXmppClient()) return;\n\n // Extract the relevant player data and minimize packet load\n let minPlayerData = [];\n for (let playerID in g_GameAttributes.settings.PlayerData) {\n if (+playerID == 0) continue;\n\n let pData = g_GameAttributes.settings.PlayerData[playerID];\n\n let minPData = { Name: pData.Name, Civ: pData.Civ };\n\n if (g_GameAttributes.settings.LockTeams) minPData.Team = pData.Team;\n\n if (pData.AI) {\n minPData.AI = pData.AI;\n minPData.AIDiff = pData.AIDiff;\n minPData.AIBehavior = pData.AIBehavior;\n }\n\n if (g_Players[playerID].offline) minPData.Offline = true;\n\n // Whether the player has won or was defeated\n let state = g_Players[playerID].state;\n if (state != \"active\") minPData.State = state;\n\n minPlayerData.push(minPData);\n }\n\n // Add observers\n let connectedPlayers = 0;\n for (let guid in g_PlayerAssignments) {\n let pData =\n g_GameAttributes.settings.PlayerData[g_PlayerAssignments[guid].player];\n\n if (pData) ++connectedPlayers;\n else\n minPlayerData.push({\n Name: g_PlayerAssignments[guid].name,\n Team: \"observer\"\n });\n }\n\n Engine.SendChangeStateGame(\n connectedPlayers,\n playerDataToStringifiedTeamList(minPlayerData)\n );\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 scene::ConnToMaster()\r\n{\r\n /*\r\n local idx = 0;\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 maps.resize(0);\r\n menubar.resize(0);\r\n\r\n local levemanager = LevelMan();\r\n local servers = levemanager.QueryMaster(\"localhost\",8080,\"\",0); \r\n if(servers)\r\n {\r\n maps.resize(servers);\r\n menubar.resize(servers+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 for( idx=0; idx < servers; idx+=1)\r\n {\r\n local server = fb.GetAt(idx);\r\n if(server != null)\r\n {\r\n local srviunfo = levemanager.GetServerAt(idx);\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(\"adsfasd\", 0);\r\n menubar[slot].SetImage(\"freebut.bmp\");\r\n menubar[slot].SetColor(0xDDCC44, 0x22CCCC);\r\n\r\n menuYpos-=3;\r\n slot++;\r\n \r\n }\r\n }\r\n */\r\n}", "function sendToLobby(message){\n\t\tvar obj = {\"player\":\"Server\",\"role\":\"game\",\"message\":message};\n\t\tio.to('lobby').emit('message', obj);\n\t}", "function recv_join(message) {\n print_msg(\"[12][Push] add listener...\");\n Subscribe(['push', 'publish']);\n Subscribe(hickey.subscribe);\n //self.syncChange(hickey.subscribe);\n\n\n //right now, push connect is successful, then display devices on main panel.\n _connected = true;\n\n if (hickey.handler.device_list != null) {\n hickey.handler.device_list(_deviceList);\n }\n\n print_msg(\"[13][Push] now main panel can show device list...\");\n\n //inform client that there are some old data on server, get it by data\n if (message.length > 0) {\n getHistoryData(message);\n }\n\n //if join success\n sync_control();\n }", "onJoin (client, options) {\r\n\t\tif(GameStarted == true){throw new Error(\"Partie Complète\")}\r\n\t\telse{\r\n\t\tthis.state.players.set(client.sessionId, new Player());\r\n\t\tif(this.state.carteInit==false)\r\n\t\t{\r\n\t\t\tthis.broadcast(\"CarteInit\",this.state.carte);\r\n\t\t\tthis.state.carteInit = true;\r\n\t\t}\r\n\t\tthis.state.players.get(client.sessionId).color = changeColorFunction()\r\n\t\t// Affichage liste users présent\r\n\t\tthis.broadcast(\"listUserConnected\", this.state.players);\r\n\t\tconst player = this.state.players.get(client.sessionId);\r\n\t\tOrder.push(client.sessionId)\r\n\t\tthis.broadcast(\"messages\", [('('+client.sessionId+') : vient d\\'arriver !'),player.nom,player.color]);\r\n\t\t}\r\n\t}", "function playerCreateNewGame(data) {\n // Create a unique Socket.IO Room\n var thisGameId = ( Math.random() * 100000 ) | 0;\n\n // Return the Room ID (gameId) and the socket ID (mySocketId) to the browser client\n game.gameId = thisGameId;\n game.mySocketId = this.id;\n game.players[this.id] = {\n gameId: thisGameId,\n mySocketId: this.id,\n playerName: data.playerName,\n totalHp: 1000,\n hp: 1000,\n totalMana: 100,\n mana: 100,\n summons: [],\n buffs: [],\n cooldowns: {},\n baseCooldowns: {},\n };\n game.players[1] = {\n gameId: thisGameId,\n mySocketId: 1,\n playerName: 'Test Bot',\n totalHp: 1000,\n hp: 1000,\n totalMana: 100,\n mana: 100,\n summons: [],\n buffs: [],\n cooldowns: {},\n baseCooldowns: {},\n };\n this.emit('newGameCreated', game);\n //console.log(thisGameId+\" # \"+this.id);\n\n // Join the Room and wait for the players\n this.join(thisGameId.toString());\n //console.log(gameSocket.adapter.rooms);\n}", "function displayWelcome() {\n Reddcoin.messenger.getAppState(response => {\n if (!response.walletObj.dataAvailable) {\n $('#frame-wallet-interact').hide();\n $('#frame-wallet-interact').removeClass('active');\n $('#menuRegister').hide();\n $('#nav').hide();\n\n let bubbles = $(\".intro-bubble\"),\n frame;\n\n setInterval(function() {\n if (!$('#frame-intro').hasClass('active')) {\n return;\n }\n\n for (let i = 0, n = bubbles.length; i < n; i++) {\n let bubble = bubbles[i];\n\n if (bubble.classList.contains('active')) {\n let attribute = bubble.getAttribute('data-frame');\n\n frame = parseInt(attribute[attribute.length - 1]) + 1;\n\n if (frame > 4) {\n frame = 1;\n }\n\n $(`[data-frame='intro-${frame}']`).trigger('click');\n return;\n }\n }\n }, 1000 * 10);\n }\n else {\n $('#frame-intro').hide();\n $('#menuRegister').show();\n $('#nav').show();\n\n $('#header').show();\n\n $('#frames').addClass('frames--wallet');\n\n displayWallet();\n\n Reddcoin.messenger.getUserIds(function (result) {\n debug.log(`${result.length} user ids registered`);\n\n if (result.length > 0) {\n $('.reddid--greyed').addClass('disabled');\n\n $('.reddid--button-replace').replaceWith(`\n <div class=\"create-reddid button button--center button--faded button--full button--red button--large button--static\">\n ${result[0]}\n </div>\n `);\n }\n });\n }\n });\n}", "function openSocket() {\n\tsocket.send(\"Player connecting...\");\n}", "async _handleGameStart() {\n\t\tawait Promise.all( [\n\t\t\tthis.player.waitForReady(),\n\t\t\tthis.opponent.waitForReady()\n\t\t] );\n\n\t\tthis.status = 'battle';\n\t\tthis.activePlayerId = this.player.id;\n\t\tthis._socketServer.sendToRoom( this.id, 'battleStarted', { activePlayerId: this.activePlayerId } );\n\t}", "function connect() {\n\n socket.emit(\"resetMeeteing\");\n $.getJSON(url, function(data) {\n socket.emit(\"takeControl\",userName);\n identity = data.identity;\n \n // Bind button to join Room.\n \n roomName = \"Lobby\"\n\n log(\"Joining room '\" + roomName + \"'...\");\n var connectOptions = {\n name: roomName,\n logLevel: \"error\",\n video:{width:600},\n audio:true\n\n };\n\n if (previewTracks) {\n connectOptions.tracks = previewTracks;\n }\n\n // Join the Room with the token from the server and the\n // LocalParticipant's Tracks.\n Video.connect(data.token, connectOptions).then(roomJoined, function(error) {\n log(\"Could not connect to Twilio: \" + error.message);\n });\n });\n}", "function onOpen(){\n console.log( \"Connected through Spacebrew as: \" + sb.name() + \".\" );\n}", "function hostCreateNewGame() {\n // Create a unique Socket.IO Room\n var thisGameId = ( Math.random() * 100000 ) | 0;\n var gameObj = {playerCount: 0, gameId: thisGameId, readyCount: 0, hintGiver: 0};\n games.push(gameObj);\n // Return the Room ID (gameId) and the socket ID (mySocketId) to the browser client\n this.emit('newGameCreated', {gameId: thisGameId, mySocketId: this.id});\n //console.log(this.id.toString());\n //console.log(thisGameId.toString());\n // Join the Room and wait for the players\n this.join(thisGameId.toString());\n}", "function handleJoinGame(input){\n if (!gameStarted){\n gameStarted = true;\n }\n activeClients[input.clientId].player.username = input.message.username;\n activeClients[input.clientId].player.reset();\n activeClients[input.clientId].player.score = 0;\n for (let id in activeClients){\n activeClients[id].player.reportUpdate = true;\n }\n}", "onCreateClick() {\n\n\t\tconst {history} = this.props\n\t\tconst {battle, start, date, choice} = createStore\n\n\t\tconst params = {\n\t\t\tbattle,\n\t\t\tformat: 'binary',\n\t\t\tmeta: true, // Generate metadata .il2mg file\n\t\t\tlang: true // Create all language files\n\t\t}\n\n\t\t// Set start position type\n\t\tlet stateValue = 'start' // Parking\n\n\t\tif (start === Start.Runway) {\n\t\t\tstateValue = 'runway'\n\t\t}\n\t\telse if (start === Start.Air) {\n\t\t\tstateValue = 0\n\t\t}\n\n\t\tparams.state = stateValue\n\n\t\t// Set selected date\n\t\tif (date) {\n\t\t\tparams.date = date\n\t\t}\n\n\t\t// Set data choices\n\t\tfor (const param in choice) {\n\t\t\tparams[param] = choice[param].join(PARAM_SEP)\n\t\t}\n\n\t\t// Handle create mission request response\n\t\tipcRenderer.once('createMission', (event, hasError) => {\n\n\t\t\tif (hasError) {\n\t\t\t\tthis.setBusyMode(false)\n\t\t\t}\n\t\t\telse {\n\t\t\t\thistory.replace('/missions')\n\t\t\t}\n\t\t})\n\n\t\t// Set screen to busy mode (show wait cursor and ignore user input)\n\t\tthis.setBusyMode(true)\n\n\t\t// Send create mission request to main process\n\t\tsetTimeout(() => {\n\t\t\tipcRenderer.send('createMission', params)\n\t\t}, 50)\n\t}", "function informSingleClient(id) {\n for(var i in SOCKET_LIST) {\n if(SOCKET_LIST[i].username === id) {\n var pack = {\n Room1: getRoomInformation(\"Room1\")\n }\n SOCKET_LIST[i].socket.emit('lobbyInfo', pack);\n break;\n }\n }\n}", "async start () {\n // The \"user\" is a large data structure that contains nearly all state\n // information, including exchanges, markets, wallets, and orders. It must\n // be loaded immediately.\n await this.fetchUser()\n // Handle back navigation from the browser.\n bind(window, 'popstate', (e) => {\n const page = e.state.page\n if (!page && page !== '') return\n this.loadPage(page, e.state.data, true)\n })\n // The main element is the interchangeable part of the page that doesn't\n // include the header. Main should define a data-handler attribute\n // associated with one of the available constructors.\n this.main = idel(document, 'main')\n const handler = this.main.dataset.handler\n // The application is free to respond with a page that differs from the\n // one requested in the omnibox, e.g. routing though a login page. Set the\n // current URL state based on the actual page.\n const url = new URL(window.location)\n if (handlerFromPath(url.pathname) !== handler) {\n url.pathname = `/${handler}`\n url.search = ''\n window.history.replaceState({ page: handler }, '', url)\n }\n // Attach stuff.\n this.attachHeader()\n this.attachCommon(this.header)\n this.attach()\n // Load recent notifications from Window.localStorage.\n const notes = State.fetch('notifications')\n this.setNotes(notes || [])\n // Connect the websocket and register the notification route.\n ws.connect(getSocketURI(), this.reconnected)\n ws.registerRoute(notificationRoute, note => {\n this.notify(note)\n })\n }", "function getLeaderboard() {\n var user = \"\";\n send(json_get_leaderboard_message(user));\n}", "onUpdate() {\r\n const server = this; //Set a reference to 'this' (the 'Server' class)\r\n\r\n //Update each lobby\r\n for (const id in server.lobbys) {\r\n server.lobbys[id].onUpdate(); //Run the update method for the lobby. The functionality of this can vary depending on the type of lobby.\r\n }\r\n }", "function sendName() {\n\tvar clientMsg = document.getElementById('enterName');\n\tif (clientMsg.value) {\n\t\tPlayerName = clientMsg.value;\n\t\tvar data = JSON.stringify({\n\t\t\t'newName' : $(\"#enterName\").val()\n\t\t})\n\t\tsocketConn.send(data);\n\t\tdocument.getElementById('title').innerHTML = \"Welcome to the Quest of The Round Table - \"\n\t\t\t\t+ clientMsg.value + \"'s View\";\n\t\tchangeColor();\n\t\tdocument.getElementById('nameparagraph').style.display = \"none\";\n\t\tdocument.getElementById('send').style.display = \"none\";\n\t\tdocument.getElementById('rigger').style.display = \"none\";\n\t\tdocument.getElementById('riggerAI').style.display = \"none\";\n\t\tvar serverMsg = document.getElementById('serverMsg');\n\t\tserverMsg.value = \"> waiting for other players \\n> to create AI player(s), open a new browser window and click AI Player button\";\n\t}\n}" ]
[ "0.67093563", "0.6524995", "0.6462301", "0.6255683", "0.6227275", "0.6206439", "0.6134939", "0.60731995", "0.6071729", "0.59143573", "0.5867134", "0.5852219", "0.5847822", "0.58292377", "0.58090705", "0.57941204", "0.5782071", "0.57748497", "0.5774304", "0.5741155", "0.57405365", "0.57375425", "0.5720234", "0.56965095", "0.56907576", "0.56880003", "0.56785375", "0.5639699", "0.56348664", "0.56246215", "0.5613458", "0.5566765", "0.5557579", "0.5553501", "0.5543523", "0.55357635", "0.5533806", "0.5525825", "0.5511662", "0.5487076", "0.547759", "0.54704666", "0.5453558", "0.5444997", "0.54304993", "0.5429639", "0.542811", "0.5421313", "0.54199517", "0.5416183", "0.5414249", "0.5409751", "0.5408643", "0.53886914", "0.5387842", "0.53709435", "0.53702796", "0.5366364", "0.53575826", "0.53571755", "0.53411293", "0.5336265", "0.53276026", "0.5326495", "0.53259444", "0.53219134", "0.5320025", "0.53196657", "0.53083456", "0.53013396", "0.5291865", "0.5283764", "0.5283", "0.52805775", "0.52760726", "0.5265731", "0.52604574", "0.52529866", "0.52400947", "0.52391595", "0.523302", "0.52205336", "0.521207", "0.5211617", "0.5210706", "0.52077794", "0.5205569", "0.5205465", "0.52023196", "0.5201132", "0.5198189", "0.51908004", "0.51897424", "0.51895213", "0.5188223", "0.5186114", "0.51821035", "0.5176713", "0.5176227", "0.5173454", "0.5167994" ]
0.0
-1
checks the roomKey that was entered against any in the database, then joins if there is a match.
handleJoinSubmit(event) { document.getElementById('joinButton').disabled = true; const { roomKey } = this.state; event.preventDefault(); axios({ method: 'post', url: `/tokbox/join`, data: { roomKey } }).then(res => { const dataFromServer = JSON.stringify(res.data); sessionStorage.setItem('gameSession', dataFromServer); sessionStorage.setItem('roomKey', res.data.roomKey); if (res.data.hasOwnProperty('pathname')) { const { origin } = location; location.href = `${origin}${res.data.pathname}`; } if (res.data.hasOwnProperty('messages')) { this.setState({ messages: res.data.messages }); document.getElementById('joinButton').disabled = false; } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleJoin() {\r\n\tlet username = document.getElementById(\"username\").value.trim();\r\n\tlet roomCode = document.getElementById(\"room\").value.trim();\r\n\t\r\n\t/* If username and roomCode are unique and valid, then send\r\n\totherwise, give alert */\r\n\tconsole.log(Object.keys(roomState));\r\n\tconsole.log(Object.keys(roomState).indexOf(roomCode));\r\n\tif (Object.keys(roomState).indexOf(roomCode) != -1){\r\n\t\tlet existing = Object.keys(roomState[roomCode][\"players\"]);\r\n\t\tconsole.log(username.length > 0 && existing.indexOf(username) == -1);\r\n\t\tif (username.length > 0 && existing.indexOf(username) == -1) {\r\n\t\t\tsocket.emit(\"toJoin\", [username, roomCode]);\r\n\t\t\tshowChat(username);\r\n\t\t}\r\n\t\telse {\r\n\t\t\talert(\"Entered username is invalid, please try again!\");\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\talert(\"Entered game ID is invalid, please try again!\");\r\n\t}\r\n}", "function joinGame(data) {\n \n //Check if room exists\n if (data in gameRoomDict) {\n if (gameRoomDict[data].length < 2) {\n io.to(gameRoomDict[data][0]).emit('p2Joined');\n room = data;\n clients.sock = data;\n console.log(\"You have joined the lobby named: \" + data);\n gameRoomDict.data = gameRoomDict[data].push(socket.id);\n var stuff = [data, \"join\"]\n io.to(socket.id).emit('connectedG', stuff);\n console.log(gameRoomDict[data]);\n }\n else {\n console.log(\"Sorry this room is full\");\n }\n }\n else {\n console.log(data + \" does not exist in the list of current lobbies.\");\n }\n }", "join(room){\n \tthis.room[room] = true;\n\t}", "function room_validate() {\n var room_number = document.getElementById('input_text').value;\n const room = db.ref().child(\"roomList/\" + room_number);\n\n event.preventDefault();\n\n //checks if room exists\n if (room_number.length == 0) {\n $(\"#pop_message\").html(\"Please Enter a Room Number\");\n } else {\n room.once('value', snapshot => {\n if (snapshot.exists()) {\n room.child(\"start\").once(\"value\").then(function(s) {\n var started = s.val();\n var users_room = func_is_users_room(room_number);\n if (users_room) {\n $(\"#pop_message\").html(\"Code #\" + room_number + \" is your room\");\n } else {\n if (started) {\n $(\"#pop_message\").html(\"Code #\" + room_number + \" Already started\");\n } else {\n func_join_room();\n }\n }\n });\n } else {\n $(\"#pop_message\").html(\"Code #\" + room_number + \" does not exist\");\n }\n });\n }\n}", "function checkEnterRoom(e){\n\t\n\tvar key = e.keyCode ? e.keyCode : e.which;\n\t\n\tif(key == 13) {\n\t\tvar newRoomString = alphanumericUnderDashSpace(roomSearchInput.value);\n\t\tvar room;\n\t\t\n\t\troomSearchInput.blur();\n\t\tif(roomsArray.indexOf(newRoomString) > -1){\n\t\t\troom = document.getElementById(newRoomString);\n\t\t\tselectRoom(room);\n\t\t\troomSearchInput.value = \"\";\n\t\t\tmessageTextarea.focus();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\troomsArray.push(newRoomString);\n\t\t\n\t\troom = addRoomToList(newRoomString);\n\t\tselectRoom(room);\n\t\troomSearchInput.value = \"\";\n\t\tmessageTextarea.focus();\n\t}\n}", "isRoomEnterable() {\n\n const isSelfInRoom = () => {\n\n if (this.selfSkylinkId === null) return false;\n\n for (let user of this.props.users)\n {\n if (user.skylinkId == this.selfSkylinkId) return true;\n }\n\n return false;\n };\n\n return !(this.props.room.status == Constants.RoomState.LOCKED)\n || isSelfInRoom();\n }", "function joinRoom()\n{\n var roomName = document.getElementById(\"room\").value;\n var roomKey = document.getElementById(\"key\").value;\n\n if (checkInput(roomName,roomKey)) \n {\n db.collection(\"rooms\").doc(roomName).get().then(function(doc)\n {\n if (doc.exists) //checks to see that room name exists\n {\n var rightKey = doc.get(\"key\");\n \n if (rightKey == roomKey) //room key is found\n {\n sessionStorage.setItem(\"playerId\",\"player2\"); //saves which player the user is\n sessionStorage.setItem(\"roomName\",roomName); //saves what room the user is going to be in\n window.location = 'game.html'; //loads the page to game.html \n }\n else //no room key is found\n {\n window.alert(\"The Key For the room is incorrect\");\n }\n }\n else //no room name is found\n {\n window.alert(\"No room of such name was found\");\n }\n });\n }\n}", "function handleRoomJoining(socket) {\n socket.on('join', function(room) {\n socket.leave(currentRoom[socket.id]);\n joinRoom(socket, room.newRoom);\n });\n}", "function joinedRoom( room ) {\n}", "inRoom(idPlayer){\n return bdConf.searchRoomWithPlayer(idPlayer)\n }", "function _joinRoom() {\n roomId = rooms[0].id;\n // Join the room\n socketInstance.post('/room/' + roomId + '/onlineUsers', { id: myChatId });\n }", "function joinExisitingRoom({ roomId }) {\r\n //Join room\r\n socket.join(roomId);\r\n\r\n // Update corressponding object in usersArray\r\n updateUserRoom(socket, roomId);\r\n\r\n // Send room data to socket\r\n const drawingDataByRoom = getDrawingData().filter(\r\n (dataObj) => dataObj.room === roomId\r\n );\r\n const userArray = getUsersArray();\r\n io.to(roomId).emit(\"roomData\", {\r\n roomId: roomId,\r\n data: drawingDataByRoom,\r\n users: userArray.filter(\r\n (user) => user.room === roomId && user.name !== \"\"\r\n ),\r\n });\r\n }", "function joinOrCreateRoom(roomCode) {\n socket.join(roomCode, () => {\n // Sets the socket's room code\n socket.roomCode = roomCode\n // Sends room code to client\n socket.emit('room_joined', roomCode)\n // Updates GM's player list\n updateGMRoomMembers()\n })\n }", "joinRoom(room) {\n if (room === undefined) return;\n\n console.log('Attempting to joinRoom. room: ', room);\n\n if (!this.isRoomEnterable())\n {\n console.log('Not already in a locked room. Cannot join. Giving up...');\n return;\n }\n\n // TODO: call some join room action\n\n $.ajax(\n {\n type: 'get',\n url: 'skylink_api_key'\n })\n .done((apiKey) => {\n\n console.log('AJAX retrieved successfully.');\n\n this.skylink.init(\n {\n apiKey: apiKey,\n defaultRoom: room\n },\n (error) => {\n\n if (error)\n {\n alert('An error has occurred while connecting to SkylinkJS.');\n return;\n }\n\n this.skylink.joinRoom({\n audio: true,\n video: true\n })\n });\n })\n .fail((err) => {\n alert('An error has occurred while retrieving the Skylink API key from the server.');\n });\n }", "function joinRoom() {\n const roomId = this.id.substr(5, this.id.length-5)\n player.updatePlayer1(false);\n //player.setPlayerType(false);\n socket.emit('joinGame', { name: player.name, room: this.id });\n\n //player = new Player(player.name, P2);\n }", "async fetchRooms() {\n\t\t//let chatRoomsRef = firebase.database().ref(`private-rooms`);\n const db = firebase.firestore()\n let chatRoomsRef = await db.collection('chat-rooms')\n\n\t\tchatRoomsRef.onSnapshot(snapshot => {\n\t\t\tlet list = []\n\t\t\tsnapshot.forEach((item) => {\n let data = {\n ...item.data(),\n key: list.length\n };\n if (!data.status) { //only want to display rooms that need an admin\n if (data.last_question) {\n data.last_question = new Date(data.last_question.seconds * 1000).toString()\n }\n list.push(data);\n }\n })\n\t\t\tthis.setState({chat_rooms: list})\n })\n\n // //TODO: fetch the room that the admin is in here\n // let user = firebase.auth().currentUser\n // const adminUsersRef = await db.collection('admin-users').doc(user.uid)\n\n // if (adminUsersRef.get().exists) {\n // var room = adminUsersRef.data().joined_room\n // this.adminJoinRoom(room)\n // }\n\t}", "roomExists(roomCode) {\n return this.rooms.hasOwnProperty(roomCode);\n }", "function joinRoom(socket, roomName){\n if (getRoomPlayersNumber(roomName) < playersPerRoom){\n socket.join(roomName);\n socket.room = roomName;\n return true;\n }\n return false\n }", "joinLobby(playerId, playerSocket) {\n\t\tlet playerIndex = this.lobbyPlayers.findIndex(player => player.pid == playerId);\n\n\t\t// Player is not in lobby yet; add them\n\t\tif (playerIndex == -1) {\n\t\t\tthis.lobbyPlayers.push({ pid: playerId, socket: playerSocket, status: \"In Lobby\", type: \"Human\" });\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function enterRoom(player)\n{\n\tconsole.log(\"joining a room\");\n\tvar key = Object.keys(rooms);\n\t\n\tfor(var i = 0;i<key.length;i++)\n\t{\n\t\tconsole.log(\"looking into room \"+rooms[key[i]].name);\n\t\tif(Object.keys(rooms[key[i]].players).length < 2)\n\t\t{\n\t\t\tconsole.log(\"joining existing room \" +rooms[key[i]]);\n\t\t\t\n\t\t\tplayer.socket.join(rooms[key[i]].name);\n\t\t\tplayer.socket.room = rooms[key[i]].name;\n\t\t\trooms[key[i]].players[player.id] = player;\n\t\t\t\n\t\t\tvar opponent = findOpponent(player, player.socket);\n\t\t\t\n\t\t\tif(opponent)\n\t\t\t{\n\t\t\t\tvar playerStats = \n\t\t\t\t{\n\t\t\t\t\tnumCards: Object.keys(player.cardsInHand).length,\n\t\t\t\t\tnumDeck: Object.keys(player.deck).length,\n\t\t\t\t\tgrave: player.grave,\n\t\t\t\t\tboard: boards[player.socket.room],\n\t\t\t\t\tfield: player.field\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\tvar opponentStats = \n\t\t\t\t{\n\t\t\t\t\tnumCards: Object.keys(opponent.cardsInHand).length,\n\t\t\t\t\tnumDeck: Object.keys(opponent.deck).length,\n\t\t\t\t\tgrave: opponent.grave,\n\t\t\t\t\tboard: boards[player.socket.room],\n\t\t\t\t\tfield: opponent.field\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\topponent.socket.emit(\"playerConnected\", playerStats);\n\t\t\t\tplayer.socket.emit(\"playerConnected\", opponentStats);\n\t\t\t\tconsole.log();\n\t\t\t\t\n\t\t\t\tfor(var i = 0;i<3;i++)\n\t\t\t\t{\n\t\t\t\t\tdrawCard(player);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(opponent.cardsInHand.length == 0)\n\t\t\t\t{\n\t\t\t\t\tfor(var i = 0;i<3;i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tdrawCard(opponent);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//console.log(\"current players \");\n\t\t\t\t//console.dir(rooms[key[i]].players);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tconsole.log(\"finished looking into room \"+rooms[key[i]]);\n\t}\n\t\n\tvar roomName = \"room\"+roomNum;\n\t\n\tplayer.socket.join(roomName);\n\tplayer.socket.room = roomName;\n\tplayers[player.id] = player;\n\t\n\tvar room = \n\t{\n\t\tname: roomName,\n\t\tplayers: []\n\t};\n\t\n\tvar board = new Array(7);\n\tfor(var x = 0; x < 7; x++)\n\t{\n\t\tboard[x] = new Array(5);\n\t}\n\tconsole.dir(board);\n\tboards[roomName] = board;\n\t\n\trooms[roomName] = room;\n\trooms[roomName].players[player.id] = player;\n\t\n\troomNum++;\n\tconsole.log(\"joined \"+roomName);\n\t//console.dir(rooms);\n}", "function joinRoom() {\n\tif (state == null) {\n\t\t// var campname = document.querySelector('#incoming').value;\n\t\tvar campname = 'dgnby';\n\t\t// TODO: check name is valid, alert() if not\n\t\tdatabase.ref('hosts/' + campname + '/').update({\n\t\t\t// add client signal data to database\n\t\t\tjoinData: signalClient,\n\t\t});\n\n\t\tvar hostData = firebase.database().ref('hosts/' + name + '/hostData');\n\t\t// wait for host to respond to client signal data\n\t\thostData.on('value', function(snapshot) {\n\t\t\tif(state == \"client\"){\n\t\t\t\tsetTimeout(function(){ readAnswer(campname); }, 200);\n\t\t\t}\n\t\t});\n\t\tstate = \"client\";\n\t}\n\tdocument.getElementById('hostbox').style.animation='0.2s fadeOut forwards';\n}", "function keyInteraction (currentRoom) {\n player.items.push(currentRoom.items[0])\n bedroom.description = 'spacious room with a large red canopy bed in the middle.'\n bedroom.repeatInteraction = true\n kitchen.lockedDoor = false\n}", "function joinRoom(socket, room) {\n //Each socket is related to each individual user\n //join user into a room\n\n socket.join(room);\n currentRoom[socket.id] = room;\n //Tell the users they are joined into a specific room\n socket.emit('joinResult', {room: room});\n\n //Tell to averyone in a room that a new user has joined\n socket.broadcast.to(room).emit('message', {\n text: nickNames[socket.id] + ' has joined ' + room + '.'\n });\n\n //Get all of other users in a room\n //var usersInRoom = io.sockets.clients(room); //does not work anymore\n var usersInRoom = io.sockets.adapter.rooms[room];\n\n if(usersInRoom.length > 1) { //If there was somebody\n //Summarizer which users are in the room\n var usersInRoomSummary = \"Users currently in \" + room + \": \";\n //Loop through all users in a room\n for (var userId in usersInRoom.sockets) {\n //To everyone else but the proper user, summarize them\n if (userId != socket.id ) {\n usersInRoomSummary += nickNames[userId] + \" \";\n }\n }\n\n //finish the summarization\n usersInRoomSummary += '.';\n //Tell to everyone who are joined to a room\n socket.emit('message', {text:usersInRoomSummary});\n }\n}", "function joinGame(socket) {\n let players, unmatched;\n return new Promise(async (resolve, reject) => {\n client.hgetall(\"key\", (err, value) => {\n if (!value) {\n client.hmset(\"key\", \"unmatched\", \"\", \"players\", JSON.stringify({}));\n players = {};\n unmatched = \"\";\n } else {\n players = JSON.parse(value.players);\n unmatched = value.unmatched;\n }\n\n players[socket.id] = {\n opponent: unmatched,\n id: socket.id,\n symbol: \"X\",\n };\n if (unmatched && unmatched != \"\") {\n players[socket.id].symbol = \"O\";\n players[unmatched].opponent = socket.id;\n unmatched = \"\";\n } else {\n unmatched = socket.id;\n }\n client.hmset(\n \"key\",\n \"unmatched\",\n unmatched,\n \"players\",\n JSON.stringify(players)\n );\n\n return resolve(true);\n });\n });\n}", "function join ( room, username ) {\n \n var id = getRoomId ( room );\n \n mapUserRooms ( id, username );\n \n return id;\n}", "function func_join_room() {\n var room_number = document.getElementById('input_text').value;\n var list_length = list_of_joined.length++;\n list_of_joined[list_length] = room_number;\n $(\"#div_body_joinedRoom\").append(create_room(room_number, 1));\n func_populate(room_number);\n func_close_join_room_pop();\n func_add_room_to_database(room_number);\n}", "function my_rooms(s){\n return s && s.pos && tables.my_rooms().indexOf(s.pos.roomName) !== -1;\n}", "function roomsAutojoin(socket, data, next){\n if(_.isEmpty(socket._rooms)){\n if(socket.user && socket.user.rooms){\n socket.user.rooms.forEach(function(room){\n socket.join(room)\n })\n }\n }\n next();\n}", "function func_has_started_joined(rooms_saved, room_number) {\n var has_started = rooms_saved.child(room_number).child(\"start\");\n has_started.once(\"value\").then(function(r) {\n var started = r.val();\n\n if (started) {\n //delete from joined room\n } else {\n $(\"#div_body_joinedRoom\").append(create_room(room_number, 1));\n func_populate(room_number);\n }\n });\n}", "function getJoinedRoom(name)\n{\n var room_count = room.rooms.length\n for (var i = 0; i < room_count ; i++)\n {\n var r = room.getRoomById(room.rooms[i].id)\n if (r)\n {\n var p = r.isWaiting(name)\n if (p) // le joueur est inscrit dans cette room\n {\n return r.id\n }\n }\n }\n return null\n}", "function joinRoom(socket, room) {\n // If the close timer is set, cancel it\n // if (closeTimer[room]) {\n // clearTimeout(closeTimer[room]);\n // }\n\n // Create Paperjs instance for this room if it doesn't exist\n var project = projects.projects[room];\n if (!project) {\n console.log(\"made room\");\n projects.projects[room] = {};\n // Use the view from the default project. This project is the default\n // one created when paper is instantiated. Nothing is ever written to\n // this project as each room has its own project. We share the View\n // object but that just helps it \"draw\" stuff to the invisible server\n // canvas.\n projects.projects[room].project = new paper.Project();\n projects.projects[room].external_paths = {};\n db.join(socket, room);\n } else { // Project exists in memory, no need to load from database\n loadFromMemory(room, socket);\n }\n}", "function join() {\n var roomName = roomField.value\n , userName = userField.value\n\n roomStore.set(\"room-name\", roomName)\n roomStore.set(\"user-name\", userName)\n\n roomField.value = \"\"\n userField.value = \"\"\n\n room.emit(\"join\", roomName, userName)\n}", "function joinToChannel() {\n console.log(\"join to channel\", roomId);\n \n // store the room info to my meetings\n // if room does not exist set the whole info\n // if room exists update timestamp and date (to track for the recent call made) \n const mymeetings = firestore.collection(`${myName}`).doc(`${roomId}`);\n const snapshot = mymeetings.get();\n let timestamp = Date.now();\n let date = new Date().toString().slice(0,-34);\n if (!snapshot.exists) {\n try {\n mymeetings.set({ roomId, timestamp, date, roomName, createdBy });\n } catch (err) {\n console.log(err);\n }\n }\n else{\n try {\n mymeetings.update({'timestamp':timestamp, 'date':date });\n } catch (err) {\n console.log(err);\n }\n }\n socket.emit(\"join\", { channel: roomId, peerName: myName, });\n}", "checkCollisions(){\n //current user id\n const uid = this.props.userkey;\n // current players gfx\n const player = this[`player_${uid}`];\n // getting list of boozied player\n const boozies = Object.keys(this.props.games[this.currentGame].players).filter((id)=>{\n return this.props.games[this.currentGame].players[id].playerstate === 'IT';\n });\n\n // checking for collision against boozied if current player is not boozied\n if(!boozies.includes(uid)){\n boozies.forEach((id)=>{\n if(this.circleHit(player, this[`player_${id}`])){\n //changing current player to boozied in db if caught\n const updates = {};\n updates[`/games/${this.currentGame}/players/${uid}/playerstate`] = 'IT';\n this.db.ref().update(updates);\n }\n });\n }\n }", "checkForJoinOrHost() {\n // Grab any needed user info from the state directly because if we pass\n // it through props we'll re-render after logging in when we really\n // don't need to.\n const state = store.getState();\n\n const pathname = this.props.location.pathname;\n const splitPath = pathname.split('/');\n const baseRoute = `/${splitPath[1]}`;\n const inviteRoomId = splitPath.length > 2 ? splitPath[2] : '';\n const isJoinOrHost = baseRoute === Routes.Join || baseRoute === Routes.Host;\n if (!isJoinOrHost) {\n // this is neither a join nor host, abort.\n return;\n }\n\n const isMeetingInvite = baseRoute === Routes.Join && inviteRoomId.length === INVITE_LENGTH;\n const isLoggedIn = getIsUserLoggedIn(state);\n // if it's an invite, obviously just use the invite\n if (isMeetingInvite) {\n // set the invite id separately from the room id\n // we want to store the invite id so we can return to\n // it if we navigate to another page\n // set the room id so it will be ready as soon as the user gets redirected to the lobby\n this.props.setInviteId(inviteRoomId);\n this.props.setRoomId(inviteRoomId);\n }\n // if it's not an invite and we're logged in,\n // set the room Id to the user's personal room\n else if (!isMeetingInvite && isLoggedIn) {\n this.props.setRoomId(getUserRoomId(state));\n }\n // roomId will not be set if this is not an invite and the user is not logged in\n\n if (isLoggedIn) {\n // We're good the route is already to the lobby\n logger.info(`App.checkForPersonalInvite: user \"${getUserId(state)}\" ` +\n `is invited to a meeting in room \"${inviteRoomId}\"`);\n return;\n }\n\n // if we're not logged in but trying to go to\n // either the join or host page, the user must sign in\n this.props.changeRoute(Routes.SignIn);\n }", "function inRoom(roomId) {\n return $(\"#room-\" + roomId).length > 0;\n }", "function joinAndConnectRoom (roomId) {\n $.post(\"/chatroom/joinedRooms\", {username:username}, function(data) {\n let joinedRoomsGroup = $(\"#joinedRooms\");\n joinedRoomsGroup.empty();\n if (data == null) return;\n for(let i = 0; i < data.length ;i++) {\n let room = data[i];\n let type = room.type;\n let roomTemp = templateJoinedRoom;\n roomTemp = roomTemp.replace('ROOM-NAME', room.name);\n roomTemp = roomTemp.replace('ROOM-ID',room.id);\n roomTemp = roomTemp.replace('all-room-ROOM-ID','joined-room' + room.id);\n if(type === \"Public\") {\n if(room.name === \"General\") {\n roomTemp = roomTemp.replace('ROOM-STYLE',\"list-group-item-success\");\n } else {\n roomTemp = roomTemp.replace('ROOM-STYLE',\"list-group-item-primary\");\n }\n } else if (type === \"Private\") {\n roomTemp = roomTemp.replace('ROOM-STYLE',\"list-group-item-secondary\");\n } else {\n return null;\n }\n roomTemp = roomTemp.replace('ROOM-GROUP-NAME',\"joined-room\");\n joinedRoomsGroup.append(roomTemp);\n }\n $('#joined-room' + roomId).prop(\"checked\", true);\n connectToRoom();\n },\"json\");\n}", "joinRoom(room, hostExist, listensers) {\n trace(`Entering room '${room}'...`);\n this.socket.emit('join', room, hostExist, listensers);\n }", "function join() {\n if (player1 && player2) {\n alert(\"Game is full!\");\n } else {\n var yourName = prompt(\"Enter your name\");\n if (yourName == null || yourName == \"\") {\n alert(\"You must enter a name\");\n join();\n } else {\n $(\"#intro-content\").hide();\n $(\"#game-content\").show();\n if (player1 === null) {\n currentUID = yourName;\n player1 = {\n name: currentUID,\n wins: 0,\n losses: 0,\n ties: 0,\n choice: \"\"\n };\n playersRef.child(\"/player1\").set(player1);\n database\n .ref()\n .child(\"/turn\")\n .set(1);\n database\n .ref(\"/players/player1\")\n .onDisconnect()\n .remove();\n } else if (player1 !== null && player2 === null) {\n currentUID = yourName;\n player2 = {\n name: currentUID,\n wins: 0,\n losses: 0,\n ties: 0,\n choice: \"\"\n };\n playersRef.child(\"/player2\").set(player2);\n database\n .ref(\"/players/player2\")\n .onDisconnect()\n .remove();\n }\n }\n }\n}", "joinRoom({state}, { roomId }) {\n return state.currentUser.joinRoom({ roomId });\n }", "function retrieveRooms() {\n var roomsRef = firebase.database().ref().child(\"rooms\").orderByChild(\"name\");\n\n roomsRef.once('value', function (snapshot) {\n snapshot.forEach(function (childSnapshot) {\n var room = childSnapshot.val();\n rooms[room.id] = room;\n });\n\n createTableHeader();\n\n retrieveTracks();\n });\n }", "function loadRoomsAndMyId(data) {\n localPlayerId = data.playerId;\n updateRooms(data);\n}", "function joinRoom(id)\n{\n console.log('Request joinRoom: ' + id);\n if (inRoom == false)\n {\n _warpclient.joinRoom(id);\n } else {\n console.warn('Already in another room: ' + roomId);\n }\n}", "function authenticateJoin(username,room){\n if(!Rooms.checkRoom(room)){\n return 'room doesn\\'t exist';\n }\n else if(Rooms.checkPlayerCount(room)>7){\n return 'room full';\n }\n else if(!Rooms.checkRoomStatus(room)){\n return 'game is running , join later';\n }\n else if(Users.checkUsernameExists(username)){\n return 'username already existing';\n }\n return 'clear';\n}", "checkIfRoombaIsHere() {\n if (this.stringify(this.state.id) === this.stringify(this.props.roomba)) {\n this.setState({dirt: false, roomba: true})\n }\n }", "function joinToChannel() {\n console.log(\"join to channel\", roomId);\n \n // store the room info to my meetings\n // if room does not exist set the whole info\n // if room exists update timestamp and date (to track for the recent call made) \n const mymeetings = firestore.collection(`${myName}`).doc(`${roomId}`);\n const snapshot = mymeetings.get();\n let date = new Date().toString().slice(0,-34);\n let timestamp = Date.now();\n if (!snapshot.exists) {\n try {\n mymeetings.set({ roomId, timestamp, date, roomName, createdBy });\n } catch (err) {\n console.log(err);\n }\n }\n else{\n try {\n mymeetings.update({'timestamp':timestamp, 'date':date });\n } catch (err) {\n console.log(err);\n }\n }\n socket.emit(\"join\", { channel: roomId, peerName: myName, peerVideo: myVideoStatus, peerAudio: myAudioStatus, peerHand: myHandStatus, });\n}", "function joinRoom(event){\n \tvar x = $(event.target).text();\n if(x == roomIn){\n\n } else {\n socketio.emit(\"join_room\", {roomName:x, password:\"\"});\n }\n }", "function joinroom(data) {\n\tvar tmproom = data;\n\tif (player != \"\" && passcode != \"\" && tmproom >= 0) {\n\n\t\tvar geturl = \"/sanaruudukko/rest/sr/process?func=joinroom&player=\" + player + \"&passcode=\" + passcode + \"&room=\" + tmproom;\n\t\t$.ajax({\n\t\t\tcache: false,\n\t\t\tdataType : 'xml',\n\t\t\ttype : 'GET',\n\t\t\turl : geturl,\n\t\t\tsuccess : function(data) {\n\t\t\t\tstartRoom(data);\n\t\t\t},\n\t\t});\n\t}\n}", "function joinMatch(){\n\n}", "async createRoom({ request, response }) {\n const user_id = request.input(\"user_id\");\n const inspector_id = request.input(\"inspector_id\");\n const room_name = user_id + \" and \" + inspector_id;\n\n //Check to see if user1 already exists\n let user1Exists = await chatkit\n .getUser({ id: user_id })\n .then(() => {\n return true;\n })\n .catch(() => {\n return false;\n });\n //Create User one if it doesnt exist\n if (!user1Exists) {\n await chatkit.createUser({ id: user_id, name: user_id });\n }\n\n //Check to see if user 2 exists\n let user2Exists = await chatkit\n .getUser({ id: inspector_id })\n .then(() => {\n return true;\n })\n .catch(() => {\n return false;\n });\n //if user 2 doesnt exist then create it\n if (!user2Exists) {\n await chatkit.createUser({ id: inspector_id, name: inspector_id });\n }\n\n //grab all the rooms that exist for user 1\n let user1Rooms = await chatkit\n .getUserRooms({ userId: user_id })\n .then(res => {\n if (res.length) {\n return res;\n } else {\n return [];\n }\n })\n .catch(() => {\n return [];\n });\n //grab all the rooms that exist for user 2\n let user2Rooms = await chatkit\n .getUserRooms({ userId: inspector_id })\n .then(res => {\n if (res.length) {\n return res;\n } else {\n return [];\n }\n })\n .catch(() => {\n return [];\n });\n\n //compare the sets of rooms see if one exists that contains both users\n //if so send its id back\n let roomExists = false;\n for (let i = 0; i < user1Rooms.length; i++) {\n for (let j = 0; j < user2Rooms.length; j++) {\n if (user1Rooms[i].id === user2Rooms[j].id) {\n roomExists = true;\n return response.send({\n room_id: user1Rooms[i].id,\n room_name: user1Rooms[i].name\n });\n }\n }\n }\n\n //if a room that contains both users does not exist create one\n if (!roomExists) {\n return chatkit\n .createRoom({\n creatorId: user_id,\n name: room_name,\n customData: { foo: 42 },\n userIds: [user_id, inspector_id],\n isPrivate: true\n })\n .then(room => {\n return response.send({ room_id: room.id, room_name: room.name });\n })\n .catch(err => {\n return response.send(err);\n });\n }\n }", "function partingFromRoom( room ) {\n}", "findRoom() {\n return _.find(this.props.queryTree, { id: this.state.currentRoomID });\n }", "function joinChatRoom(player) {\n\n var sessionID = player.sessionID;\n var room = player.params.map;\n\n io.sockets.sockets[sessionID].join(room);\n console.log(getTime() + ' ' + player.params.name + '[' + player.playerID + '] ENTERED ' + room);\n}", "function searchRoom(building, AC, projector, board, capacity)\n{\n date = submitForm['Date'].value;\n timeSlot = submitForm['timeSlot'].value;\n var convertedDate = convertDate(date);\n db.collection(\"Room\").where(\"AC\",\"==\", AC).where(\"Projector\",\"==\",projector).where(\"Board\",\"==\",Number(board)).where(\"Capacity\",\">=\",Number(capacity)).get().then\n ( \n snapshot =>\n {\n var roomHTML = ``;\n var roomIDList = [];\n var updatedRoomList = [];\n const snapData = snapshot.docs;\n snapData.forEach(doc => \n {\n if((building == \"\") || (building === doc.id.charAt(0)))\n { \n roomIDList.push(doc.id);\n }\n })\n //Checks booking conflicts and updates the room list \n roomIDList.forEach( element =>\n {\n recordID = element + '-' + convertedDate + '-' + timeSlot;\n db.collection('Record').doc(recordID).get().then((docSnapshot) => \n {\n if (!docSnapshot.exists) \n {\n updatedRoomList.push(element);\n //displays roomlist \n roomHTML += `<option value = \"${element}\">${element}</option>`;\n roomList.innerHTML = roomHTML;\n }\n })\n })\n }\n )\n}", "socketsJoin(room) {\r\n this.adapter.addSockets({\r\n rooms: this.rooms,\r\n except: this.exceptRooms,\r\n }, Array.isArray(room) ? room : [room]);\r\n }", "function handleJoinRoom(room_name){\n clearErrors();\n socket.emit(\"join_room\", room_name);\n }", "function checkForJoins(keyCode) {\n\tvar joined = false;\n\t// Left\n\tif (keyCode == 37) {\n\t\tfor (var r = 0; r < 4 ; r++ ) {\n\t\t\tfor (var c = 0; c < 3 ; c++ ) {\n\t\t\t\tif (grid[r][c] == grid[r][c+1] && !isCellEmpty(r,c)) {\n\t\t\t\t\tjoined = true;\n\t\t\t\t\tvar num = grid[r][c];\n\t\t\t\t\tsetGridNumRC(r,c,num * 2);\n\t\t\t\t\tupdateTotal(num);\n\t\t\t\t\ttotalEmptyCells++;\n\t\t\t\t\tsetEmptyCell(r, c+1)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Top\n\telse if (keyCode == 38) {\n\t\tfor (var c = 0; c < 4 ; c++ ) {\n\t\t\tfor (var r = 0; r < 3 ; r++ ) {\n\t\t\t\tif (grid[r][c] == grid[r+1][c] && !isCellEmpty(r,c)) {\n\t\t\t\t\tjoined = true;\n\t\t\t\t\tsetGridNumRC(r,c,grid[r][c] + grid[r+1][c]);\n\t\t\t\t\tupdateTotal(grid[r][c]);\n\t\t\t\t\ttotalEmptyCells++;\n\t\t\t\t\tsetEmptyCell(r+1, c)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Right\n\telse if (keyCode == 39) {\n\t\tfor (var r = 0; r < 4 ; r++ ) {\n\t\t\tfor (var c = 3; c > 0 ; c-- ) {\n\t\t\t\tif (grid[r][c] == grid[r][c-1] && !isCellEmpty(r,c)) {\n\t\t\t\t\tjoined = true;\n\t\t\t\t\tsetGridNumRC(r,c,grid[r][c] + grid[r][c-1]);\n\t\t\t\t\tupdateTotal(grid[r][c]);\n\t\t\t\t\ttotalEmptyCells++;\n\t\t\t\t\tsetEmptyCell(r, c-1)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Bottom\n\telse if (keyCode == 40) {\n\t\tfor (var c = 0; c < 4 ; c++ ) {\n\t\t\tfor (var r = 3; r > 0 ; r-- ) {\n\t\t\t\tif (grid[r][c] == grid[r-1][c] && !isCellEmpty(r,c)) {\n\t\t\t\t\tjoined = true;\n\t\t\t\t\tsetGridNumRC(r,c,grid[r][c] + grid[r-1][c]);\n\t\t\t\t\tupdateTotal(grid[r][c]);\n\t\t\t\t\ttotalEmptyCells++;\n\t\t\t\t\tsetEmptyCell(r-1, c)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn joined;\n}", "async adminJoinRoom(room) {\n //Fetch the currently logged in user\n let user = firebase.auth().currentUser\n\n //Retrieve an instance of our Firestore Database\n const db = firebase.firestore()\n\n //Save the room in the database that the admin just joined\n let adminUsersRef = await db.collection('admin-users').doc(user.uid)\n let adminUsersSnapShot = await adminUsersRef.get()\n\n if (adminUsersSnapShot.exists) {\n adminUsersRef.update({\n \"admin_room_location\": room\n })\n .then(() => {\n this.props.history.push('/chat')\n })\n this.context.triggerAdminJoinRoom(room)\n } \n }", "function name_validate(roomParam) {\n roomParam.child(\"people/\" + $(\"#input_name\").val()).once('value', snapshot => {\n if (!snapshot.exists()) {\n let name = $(\"#input_name\").val();\n roomParam.child(\"people/\" + name).set(true); //adds username to the database, within the room they are joining\n myStorage.setItem(\"name\", name);\n myStorage.setItem(\"roomCode\", $(\"#input_number\").val());\n window.location.href = \"activity.html\";\n // a comment\n } else {\n $(\".join_room_popup_content\").css(\"height\",\"14em\");\n $(\"#pop_message\").html(\"Sorry, that name is taken.\");\n }\n });\n }", "function func_add_room_to_database(room_number) {\n var room = db.ref(\"roomList\").child(room_number);\n var user_room = db.ref(\"userList\").child(user);\n\n room.once(\"value\").then(function(c) {\n var room_info = c.val();\n var key = room_number;\n var add_room = {\n [key]: room_info\n }\n user_room.child(\"joined\").update(add_room);\n });\n}", "function memberJoined( member, room ) {\n}", "function enterRoom(){\n\ttoggleHide(room);\n\ttoggleHide(roomChoice);\n\t// toggleHide(declarationOfMurder);\n\ttoggleHide(murderDiv);\n\trandomizeRoomGuest();\n\t//keeps track of how far along in the game you are and changes murderer behavior\n\tclickCount++;\n\tif (clickCount > 20 && clickCount < 30){\n\t\tsuspicious.classList.remove(\"hide\");\n\t} else if (clickCount >= 30){\n\t\tsuspicious.classList.add(\"hide\");\n\t\tstalker.classList.remove(\"hide\");\n\t}\n\n\t//determines which weapon goes into a room based on the roomsList and weaponsList arrays\n\tfor (i=0; i<roomsList.length; i++){\n\t\tif (roomsList[i] === currentRoom){\n\t\t\tcurrentWeapon = weaponsList[i];\n\t\t}\n\t}\n\t//if there is no weapon assigned to that room it assigns it to be nothing\n\tif (currentWeapon === \"q-w34095-340958-sdf0983f\" || currentWeapon === undefined){\n\t\tcurrentWeapon = \"nothing\";\n\t}\n\n\tfor (i=0; i<roomsList.length; i++){\n\t\tif (roomsList[i] === currentRoom && currentRoom === murderRoom){\n\t\t\tfloorStatus = \"There's blood on the floor! This must be where the murder happened!\";\n\t\t} else if (roomsList[i] === currentRoom && currentRoom !== murderRoom){\n\t\t\tfloorStatus = \"There is nothing on the floor.\";\n\t\t}\n\t}\n\n}", "function joinRoom(userSocket, partnerSocket, allSockets, callback){\n // create room with socket id\n var room = userSocket.id.substring(2);\n userSocket.join(room);\n partnerSocket.join(room);\n\n // attach room name with sockets\n\n userSocket.room = room;\n partnerSocket.room = room;\n\n // remove sockets from array\n var connectedSockets = [];\n connectedSockets.push(userSocket);\n connectedSockets.push(partnerSocket);\n for(var i = 0; i<allSockets.length;i++){\n var j = allSockets.indexOf(userSocket);\n if (i === -1){}\n else{allSockets.splice(i, 1)};\n }\n for(var i = 0; i<allSockets.length;i++){\n var j = allSockets.indexOf(partnerSocket);\n if (i === -1){}\n else{allSockets.splice(i, 1)};\n }\n callback(null,'success'); \n}", "function doorOpener(player) {\n $(\"#combat-display\").empty();\n var y = player.y - 1;\n\tvar x = player.x - 1;\n function keyChecker() {\n for(var keyIdx = 0; keyIdx < player.items.length; keyIdx++) {\n if(player.items[keyIdx].name === \"key\") {\n return true;\n break;\n }\n }\n }\ndoorOpenerLoops: {\n for(var idx = y; idx < y+3; idx++) {\n \tfor(var idx2 = x; idx2 < x+3; idx2++) {\n if(idx === player.y && idx2 === player.x) {\n } else {\n var area = mapArrays[idx][idx2];\n if(area.terrainType === \"door\") {\n if(area.locked) {\n if(keyChecker()) {\n area.locked = false;\n area.firstTime = false;\n\n for(var itemsIdx = 0; itemsIdx < player.items.length; itemsIdx++) {\n if(player.items[itemsIdx].name === \"key\") {\n player.items.splice(itemsIdx, 1);\n player.keyCounter();\n break;\n }\n }\n\n roomMover(player, area, true);\n\n break doorOpenerLoops;\n } else {\n $(\"#combat-display\").text(\"You don't have a key to unlock this door.\");\n }\n } else if(area.locked === false) {\n if(area.firstTime) {\n area.firstTime = false;\n roomMover(player, area, true);\n } else if (area.firstTime === false) {\n roomMover(player, area, false);\n break doorOpenerLoops;\n }\n }\n }\n }\n }\n }\n }\n}", "function join(socket, roomCode, callback) {\n if (socket && socket.join) {\n socket.join(roomCode, callback);\n }\n}", "function populate_rooms_Data(rooms_data, user_name) {\n //console.log('populate_rooms_Data is called');\n if(rooms_data != null) {\n var append_to_roomList = false;\n var fragment = document.createDocumentFragment();\n var opt;\n var all_keys_of_the_rooms = Object.keys(rooms_data);\n if(all_keys_of_the_rooms.length > 0) {\n for(var i=0;i<all_keys_of_the_rooms.length;i++) {\n var optionExists = ($(\"#roomList_select option[value=\" + rooms_data[all_keys_of_the_rooms[i]].room_name + \"]\").length > 0);\n if(!optionExists) {\n opt = document.createElement('option');\n opt.innerHTML = rooms_data[all_keys_of_the_rooms[i]].room_name + ' (' + rooms_data[all_keys_of_the_rooms[i]].users.length + ')';\n opt.value = rooms_data[all_keys_of_the_rooms[i]].room_name;\n fragment.appendChild(opt);\n append_to_roomList = true;\n }\n }\n }\n if(append_to_roomList) {\n //console.log('append_to_roomList true');\n $('#roomList_select').append(fragment);\n console.log('user who created the room: ' + user_name + \" and the global_current_user: \" + global_current_user);\n if((user_name != undefined || global_current_user!= undefined) && user_name == global_current_user) {\n $('#status_creating_new_room').html(\"new room created\");\n }\n }\n }\n}", "function connectToRoom(ws,req){ // socket connection for rooms\n\n var clientId = random()\n\n function leftRoom(room,key){\n broadcast(room,socketClients[clientId].user,'onleave',key)\n }\n\n ws.on('close', function(req){\n \n //to do if user doesnot exist fallback, broadcast a leave message, on error\n //to remember: remove key can handle both array and object\n\n\n\n\n for (let key in roomsRegistry){\n\n for (let room in roomsRegistry[key].full){\n\n //remove client from full instance, remove instance from full and and add it not full\n\n if ( roomsRegistry[key].full[room].clients.includes(clientId ) ){\n\n removeFromBuilding('full',key,room)\n //because currently room is full if anyone leaves the room it will become empty\n\n\n }else{\n // console.log( roomsRegistry[key].full[room].clients[clientId] )\n }\n\n }\n\n \n for (let room in roomsRegistry[key].notFull){\n\n if ( roomsRegistry[key].notFull[room].clients.includes( clientId) ) {\n removeFromBuilding('notFull',key,room)\n }\n }\n\n }\n\n socketClients = removeKey(socketClients,clientId)\n\n })\n\n //remove user from all the room\n function removeRoomFromFullAddToNotFull(label,uniqueKeyOfRoom){\n roomsRegistry[label].notFull[uniqueKeyOfRoom] = roomsRegistry[label].full[uniqueKeyOfRoom]\n roomsRegistry[label].full = removeKey(roomsRegistry[label].full,uniqueKeyOfRoom)\n leftRoom(uniqueKeyOfRoom,label)\n }\n\n //there are two kinds of room in the building full and notFull\n function removeFromBuilding(kind,label,uniqueKeyOfRoom){\n roomsRegistry[label][kind][uniqueKeyOfRoom].clients = removeKey(roomsRegistry[label][kind][uniqueKeyOfRoom].clients,clientId)\n\n kind === 'full'? removeRoomFromFullAddToNotFull(label,uniqueKeyOfRoom) : leftRoom(uniqueKeyOfRoom,label)\n }\n\n function leaveRoom(label,uniqueKeyOfRoom,newRoom){\n\n if (!roomsRegistry[label]) {\n return sendError(label+' label is invalid',newRoom)\n }\n\n if (roomsRegistry[label].full[uniqueKeyOfRoom]){\n removeFromBuilding('full',label,uniqueKeyOfRoom)\n }else if(roomsRegistry[label].notFull[uniqueKeyOfRoom]){\n removeFromBuilding('notFull',label,uniqueKeyOfRoom)\n }\n\n }\n\n function sendError(errorMessage,label){\n ws.send( stringIt({type:'onerror', data:errorMessage, token:label}) )\n }\n //type getRoomToken\n // to do solve conflict of name query socket connection\n //limit defined by user\n ws.on('message', function(msg){\n\n\n msg = JSON.parse(msg)\n let roomLimit = 2\n // let roomId = msg.token\n let roomLabel = msg.app+'_'+msg.token //msg token is hotel name\n let roomToken = null\n if (msg.broadcastToken) roomToken = msg.broadcastToken \n if (msg.limit) if(msg.limit >= 2) roomLimit = msg.limit\n\n //what if where is not defined in update\n\n //the update function does not gives the update doc?\n\n //user can connect to multiple rooms the front end functions are mapped to \n if (msg.purpose == 'join'){\n createOrAddToRoom()\n }else if(msg.purpose == 'broadcast'){\n // console.log('broadcasting')\n broadcast(roomToken,msg.content,'ondata',roomLabel)\n }else if(msg.purpose == 'change_room'){\n\n\n\n\n //to do save from crash not defineed\n if (!msg.currentRoomLabel || !msg.unique || !msg.newToken) return sendError('required values missing')\n leaveRoom(msg.app+'_'+msg.currentRoomLabel, msg.unique, msg.newToken)\n\n // console.log('leaving room',msg.currentRoomLabel,'unique',msg.unique)\n roomLabel = msg.app+'_'+msg.newToken\n createOrAddToRoom()\n\n }else if(msg.purpose == 'leave'){\n\n if (!msg.currentToken || !msg.unique ) return sendError('required values missing')\n\n leaveRoom(msg.app+'_'+msg.currentToken,msg.unique )\n }\n\n\n \n\n //why one to one does not exist? because it can be created with room with limit 2\n\n function createOrAddToRoom(){\n\n if(!socketClients[clientId]){\n\n //if user does not exist\n return getUserData( msg.cookie ).then(function(userObject,error){//what if cookie is invalid\n if (error) return sendError('invalid cookie')\n socketClients[clientId] = {user:{id:userObject.id, username:userObject.username}, socket:ws}\n\n createOrAddToRoom()\n })\n\n \n }\n\n //also broadcast on join and leave and also joined member\n // console.log(clientId,'creating room or adding:'+roomLabel)\n function createRoom(){\n roomToken = random()\n roomsRegistry[roomLabel].notFull[roomToken] = {clients:[],limit:roomLimit}\n roomsRegistry[roomLabel].notFull[roomToken].clients.push(clientId)\n }\n\n if (!roomsRegistry[roomLabel]){ //room not constructed \n roomsRegistry[roomLabel] = { full:{},notFull:{} }\n createRoom()\n }else{\n\n if ( Object.keys(roomsRegistry[roomLabel].notFull).length === 0 ) {\n createRoom()\n }else{\n\n roomToken = Object.keys(roomsRegistry[roomLabel].notFull)[0]\n roomsRegistry[roomLabel].notFull[roomToken].clients.push(clientId)\n broadcast(roomToken,socketClients[clientId].user,'onjoin',roomLabel)\n\n let notFullRoomLimit = roomsRegistry[roomLabel].notFull[roomToken].limit\n let membersCountOfNotFull = roomsRegistry[roomLabel].notFull[roomToken].clients.length\n\n \n\n // if(membersCountOfNotFull > notFullRoomLimit) console.log('limit exceeded', membersCountOfNotFull, notFullRoomLimit)\n\n if(membersCountOfNotFull === notFullRoomLimit){\n roomsRegistry[roomLabel].full[roomToken] = roomsRegistry[roomLabel].notFull[roomToken]\n roomsRegistry[roomLabel].notFull = removeKey(roomsRegistry[roomLabel].notFull,roomToken)\n }\n\n }\n\n }\n\n broadcast(roomToken,null,'onopen',roomLabel)\n\n }\n\n })\n //add coments and decrease code\n // roomArgToken room name, roomLabel key\n function broadcast(roomArgToken,content,type,roomLabel){// room label is the type of room and roomArgToken is unique id of room which can be full or not full\n\n let token = roomLabel.split('_')[1]\n\n let broadcastTo = null\n try{\n broadcastTo = roomsRegistry[roomLabel].notFull[roomArgToken] === undefined ? roomsRegistry[roomLabel].full[roomArgToken] : roomsRegistry[roomLabel].notFull[roomArgToken] \n }catch(e){\n return ws.send( stringIt({error:roomArgToken+' room not found in '+roomLabel+'to broadcast'+e}) )\n }\n\n let members = []\n\n if (!broadcastTo) return ws.send( stringIt({ unique:roomArgToken, token:token, type:'onerror', data:'invalid unique' }))\n\n for (let index of broadcastTo.clients){\n\n members.push( socketClients[index].user )\n }\n\n if (type == 'onopen') return ws.send( stringIt({ unique:roomArgToken, token:token, members:members, type:type }))\n\n\n for (let index of broadcastTo.clients){\n if (index !== clientId) socketClients[index].socket.send( stringIt({unique:roomArgToken, members:members, token:token, sender:socketClients[clientId].user, data:content, type:type }) )\n }\n\n }\n}", "function getRoom(room)\r\n{\r\n if (!(room in roomObj))\r\n {\r\n roomObj[room] = roomData.length;\r\n roomData.push([]);\r\n console.log(\"===> Room \" + room + \" created on \" + new Date());\r\n console.log(\"Current rooms:\" );\r\n console.log(roomObj);\r\n }\r\n return roomData[roomObj[room]];\r\n}", "function queryDB(date, times, size, equipment, campus_loc) {\n var Time_Table = Parse.Object.extend(\"Time_Table\"),\n size2,\n Rooms = Parse.Object.extend(\"Rooms\"),\n roomQuery = new Parse.Query(Rooms),\n sizeQuery = new Parse.Query(Rooms),\n locQuery = new Parse.Query(Rooms),\n equipQuery = new Parse.Query(Rooms),\n timeQuery = new Parse.Query(Time_Table),\n availableRooms = [],\n roomIds = [],\n errorValue=null,\n bannerValue=null;\n\n //Time and date query\n timeQuery.equalTo(\"year\", date.getFullYear());\n timeQuery.equalTo(\"month\", date.getMonth());\n timeQuery.equalTo(\"day\", date.getDate());\n\n for (var i = 0; i < times.length; i++) {\n timeQuery.equalTo(times[i], true);\n }\n timeQuery.find().then(function(timeSlots) { //get the room information from timeslots\n if (timeSlots.length) {\n for (var t = 0; t < timeSlots.length; t++)\n roomIds.push(timeSlots[t].get(\"room_id\").id);\n }\n }).then(function() { //size,location, equipment\n roomQuery.containedIn(\"objectId\", roomIds);\n if (size) {\n roomQuery.equalTo(\"room_size\", size);\n }\n if (campus_loc) {\n roomQuery.equalTo(\"campus_location\", campus_loc);\n }\n if (equipment) {\n for (var e = 0; e < equipment.length; e++) {\n roomQuery.equalTo(equipment[e], true);\n }\n }\n return roomQuery.find();\n }).then(function(rooms) {\n if (!rooms.length) {\n var newQuery= new Parse.Query(Rooms);\n newQuery.containedIn(\"objectId\",roomIds);\n if (equipment){\n bannerValue= \"We didn't find any rooms with your specific equipment requirements but these rooms are similar.\";\n if(size)\n newQuery.equalTo(\"room_size\",size);\n if(campus_loc)\n newQuery.equalTo(\"campus_location\",campus_loc);\n }\n if(size && !equipment){//permutations where room_size was selected but not equipment and possibly campus location\n if(size==3){\n if(campus_loc){\n cl2 = campus_loc ==\"North\"?\"South\":\"North\";\n newQuery.equalTo(\"room_size\",size);\n newQuery.equalTo(\"campus_location\",cl2);\n bannerValue =\"We didn't find rooms with the size you chose on \"+campus_loc+\" campus so we searched on \"+ cl2+\" campus\";\n }\n else\n errorValue=\"Sorry there are no rooms of this size available at the time selected\";\n }\n else{\n if(size==1){\n size2=2;\n }\n else if(size==2){\n size2=3;\n }\n newQuery.greaterThanOrEqualTo(\"room_size\", size2);\n newQuery.ascending('capacity');\n if(campus_loc){\n newQuery.equalTo(\"campus_location\",campus_loc);\n }\n bannerValue = \"We didn't find rooms with the size you chose so we looked for larger rooms\";\n }\n }\n if(campus_loc && !size && !equipment){//permuations where campus_loc was selected but not room_size and not equipment\n var cl2=\"North\";\n if(campus_loc==\"North\"){\n cl2=\"South\"\n }\n newQuery.equalTo(\"campus_location\",cl2);\n bannerValue=\"We didn't find any rooms on \"+campus_loc+\" campus so we searched for rooms on \"+ cl2+ \"campus\";\n }\n return newQuery.find();\n }\n return rooms;\n }).then(function(val) { //Display the information for the user\n if (errorValue) {\n alert(errorValue);\n } \n else {\n if(bannerValue){\n $(\"#banner\").show();\n $(\"#banner\").text(bannerValue);\n }\n if(val.length){\n $('#filter-collapse').collapse('hide');\n for(var r=0;r<val.length;r++){\n buildRoomRow(val[r]);\n }\n }\n }\n });\n}", "function findRoom(req, res, next) {\n if (req.query.Name == null) res.redirect(\"/rooms\");\n else {\n room\n .findOne({ Name: req.query.Name })\n .populate({\n path: \"Detail\",\n populate: {\n path: \"Reserve\",\n match: {\n $or: [\n { DateIn: { $gt: req.query.from, $lt: req.query.to } },\n { DateOut: { $gt: req.query.from, $lt: req.query.to } }\n ]\n }\n }\n })\n .exec(function(err, Room) {\n if (err) console.error(err);\n var counter = 0;\n for (var i = 0; i < Room.Detail.length; i++) {\n if (Room.Detail[i].Reserve.length == 0) {\n counter++;\n req.session.ReserveInfo = Room.Detail[i];\n req.session.RoomInfo = Room;\n break;\n }\n }\n if (counter == 0) {\n console.log(\"No room left\");\n res.redirect(\"/rooms/\" + req.query.Name, {\n info: { message: \"No Room Left\" }\n });\n } else {\n return next();\n }\n });\n }\n}", "function joinRoom(roomId) {\r\n player.roomId = roomId;\r\n ROOMS[roomId].addMember(player);\r\n socket.emit('roomJoined', {\r\n roomId,\r\n members: ROOMS[roomId].getMembers()\r\n });\r\n }", "function searchForPlayers() {\n searchingForGame = true;\n views.setSeachingPlayers();\n socket.emit('lookingForGame', authId);\n console.log(\"waiting for game \" + authId)\n socket.on('startMatch', (otherId) => {\n startMultiPlayer(otherId);\n });\n}", "joinRoom(topic, socketId) {\n let room;\n\n if (this.topics[topic] === undefined) {\n room = this._createRoom(socketId);\n this.topics[topic] = {\n [room.id]: room\n };\n } else {\n room = this._findOrCreateRoom(socketId, topic);\n }\n\n return room;\n }", "function check_rooms_check_user_input(e){\n let invalid = 0;\n let room_valid = 0; // 0 = false , 1 = true\n\n // First check to see if all the fields are not empty\n $.each(e.data, function (info){if (e.data[info].val() === \"\" && info !== \"booked_times_body\" && info !== \"booked_times_header\"){invalid = 1;}});\n if (invalid === 1){\n alert(\"The information you entered is not correct. Please ensure you have not left any field blank.\");\n return 0;\n }\n\n // Check to see if the building name and room number is in the database\n for (let i = 0; i < all_room_informtion.length; i++){\n if (e.data.building_name.val() === all_room_informtion[i].building_name &&\n e.data.room_number.val() === all_room_informtion[i].room_number){\n room_valid = 1;\n }\n }\n if (room_valid === 0){\n alert(\"Sorry, the room you requested is not in our database and no information can be given for this room at this time.\");\n return 0;\n }\n\n // Now check the time\n if (e.data.Time.val().match(/^[0-9]*$/) === null){\n alert(\"The time you entered is not valid\");\n return 0;\n }\n if (parseInt(e.data.Time.val(), 10) > 12 || parseInt(e.data.Time.val(), 10) < 1){\n alert(\"The time must be between 1 and 12 inclusive\");\n return 0;\n }\n\n return 1;\n}", "getRoom(roomId) {\r\n\t\treturn typeof this.rooms[roomId] === \"object\" ? this.rooms[roomId] : null;\r\n\t}", "function checkRoom(room,res){\n\tconsole.log(\"checking room: \",room);\n const query = datastore.createQuery(room);//.filter('name','=','peer_ids');\n datastore.runQuery(query)\n .then((results) => {\n // console.log(\"checkRoom result: \",results[0]);\n\n if(results[0].length>0){\n\t\t\tconsole.log(\"room exist\");\n res.send(JSON.stringify({result:\"true\"}));}\n// console.log(\"true\");\n else{\n\t\t\tconsole.log(\"room doesn't exist\");\n res.send(JSON.stringify({result:\"false\"}));}\n// console.log(\"false\");\n\n })\n .catch((err) => {\n console.error('ERROR:', err);\n });\n}", "function filter(timeStamp){\n //needs to now which bench, starts with benchChoice as one\n database.ref(\"\" + benchChoice + \"\").once(\"value\").then(function(benchChoiceSnapshot){\n database.ref(\"\" + otherChoice + \"\").once(\"value\").then(function(otherChoiceSnapshot){\n benchChoiceSnapshot.forEach(function(benchChoiceReservation){\n otherChoiceSnapshot.forEach(function(otherChoiceReservation){\n let benchChoiceValue = benchChoiceSnapshot.val();\n let otherChoiceValue = otherChoiceSnapshot.val();\n\n //If both benches are reserved at this time\n if((timeStamp == benchChoiceValue) && (timeStamp == otherChoiceValue)){\n $(\"#td\" + timeStamp).text(\"Reserved\");\n $(\"#td\" + timeStamp).addClass(\"reserved-text\");\n $(\"tr[data-timestamp='\" + timeStamp + \"']\").prop(\"disabled\", true);\n $(\"tr[data-timestamp='\" + timeStamp + \"']\").removeClass(\"time-item\");\n }\n\n //If the other bench is reserved at this time, then it can be reserved\n if((timeStamp != benchChoiceValue) && (timeStamp == otherChoiceValue)){\n $(\"#td\" + timeStamp).text(\"Reserved\");\n $(\"#td\" + timeStamp).addClass(\"reserved-text\");\n $(\"tr[data-timestamp='\" + timeStamp + \"']\").prop(\"disabled\", true);\n $(\"tr[data-timestamp='\" + timeStamp + \"']\").removeClass(\"time-item\");\n }\n\n //If the other bench is reserved at this time, then it can be reserved\n if((timeStamp == benchChoiceValue) && (timeStamp != otherChoiceValue)){\n\n }\n\n //If neither bench are reserved at this time than it shoul be available\n if((timeStamp != benchChoiceValue) && (timeStamp != otherChoiceValue)){\n\n }\n\n //---------------\n });\n });\n });\n });\n}", "joinGame(gameId, playerId) {\n\n const playerRef = userDocRef(playerId);\n playerRef.get().then(doc => {\n const data = doc.data();\n if (data) {\n const playerData = data.player;\n playerRef.set({\n player: {\n ...playerData,\n leaving: false, /* Clear leaving state */\n }\n })\n }\n })\n // Returns a Promise\n // Add own ID to game's player list\n return fdb.collection('games').doc(gameId).get().then(doc => {\n const doc_data = doc.data();\n\n /* Game exists */\n if (doc_data) {\n const { players } = doc_data;\n\n if (!players.includes(playerId)) { // I'm not in the game\n if (players.length >= this.MAX_PLAYERS) { // ...but it's full, sorry.\n return {\n success: false,\n error: 'Sorry, game is full!',\n };\n }\n\n players.push(playerId); // ...so add myself\n fdb.collection('games').doc(gameId).update({ players })\n }\n }\n\n /* Game doesn't exist yet */\n if (doc_data === undefined) {\n /* Create it... */\n fdb.collection('games').doc(gameId).set({\n name: gameId,\n players: [playerId],\n double: false,\n })\n }\n\n\n // I'm in the game\n // ...subscribe to game updates to know when players join/leave.\n const closeGameListener =\n fdb.collection('games').doc(gameId).onSnapshot(doc => {\n const game = { ...doc.data(), id: doc.id };\n const error = null;\n this.update({\n game,\n error,\n showingJoinDetails: false,\n });\n });\n\n return { success: true, closer: closeGameListener };\n });\n\n }", "function recoverEntitiesFromRoom(db) {\n db.hgetall(MEMBERS, function(err, kvs) {\n for (var id in kvs) {\n db.set(accountKey(id), kvs[id]);\n }\n });\n}", "function isRoomValid(data) {\n var room = data.message.text;\n var id = data.message.chat.id;\n var user = userExists(id);\n \n if (Object.getOwnPropertyNames(user).length === 0) {\n var sheet = SpreadsheetApp.openById(userSheetId).getSheetByName('Zones');\n \n var searchRange = sheet.getRange(1, 1, 405, 2);\n var rangeValues = searchRange.getValues();\n \n for (j = 0; j < 405; j++) {\n if (rangeValues[j][0] === room) {\n return true;\n }\n }\n }\n return false;\n }", "function roomById (id) {\n var i;\n for (i = 0; i < rooms.length; i++) {\n if (rooms[i].roomid === id) {\n return rooms[i]\n }\n }\n\n return false\n}", "_findOrCreateRoom(socketId, topic) {\n let selectedRoom;\n\n // Iterate over the rooms\n Object.keys(this.topics[topic]).some(roomId => {\n let room = this.topics[topic][roomId];\n if (room.users.length < MAX_USERS) {\n selectedRoom = room;\n return true;\n } else {\n return false;\n }\n }, this);\n\n if (selectedRoom) {\n selectedRoom.users.push(socketId);\n } else {\n // All rooms are full\n selectedRoom = this._createRoom(socketId, topic);\n // Add it to the first position of the array. It will be easier for add new people to it\n this.topics[topic].unshift(selectedRoom);\n }\n\n // Return the room\n return selectedRoom;\n }", "function checkuser(room, rooms) {\n let userurl = apiurl + '/chats/' + room + '/users';\n\n let userrequestNew = new Request(userurl, {\n method: 'GET',\n headers: {\n 'Authorization': getBasicAuthHeader()\n }\n });\n\n fetch(userrequestNew)\n .then(function (resp) {\n return resp.json();\n })\n .then(function (data) {\n let userIN = (data.indexOf(username) > -1);\n if ((userIN && lobbyview) || (!userIN && !lobbyview)) {\n\n userCheck.push(true);\n } else {\n userCheck.push(false);\n\n }\n allRooms.shift();\n loadforeach(rooms);\n\n\n })\n .catch(function (error) {\n console.error('Error in checkuser:', error);\n });\n}", "function _getMatchs() {\n\tActions.loadingOn({msg: 'LOADING MATCHES'})\n\tconst { isAuth } = _store.getState().Main;\n\tif ( isAuth ) {\n\t\tRoomApi.listRooms().then((documentSnapshots) => {\n\t\t\t\tlet list = {}\n\t\t\t\tdocumentSnapshots.docs.forEach(d => {\n\t\t\t\t\tlist[d.id] = d.data();\n\t\t\t\t});\n\t\t\t\tActions.roomsList({ list });\n\t\t\t\tActions.loadingOff();\n\t\t\t}).catch((err) => {\n\t\t\t\tconsole.error('error', err);\n\t\t\t});\n\t} else {\n\t\tActions.roomsList({ list: {} });\n\t\tActions.loadingOff();\n\t}\n}", "function changeRooms(newRoom) {\n let roomTransitions = enterRooms[currentRoom].canChangeTo;\n if (roomLookUp[newRoom].locked === true) {\n console.log('The door is locked, move along!');\n } else if (roomTransitions.includes(newRoom)) {\n currentRoom = newRoom;\n let stateForTable = roomLookUp[currentRoom]\n console.log(stateForTable.desc);\n zombieHorde()\n console.log(\"You better hurry up they're getting closer!\" + player.encroachment);\n player.location = roomLookUp[currentRoom]\n } else {\n console.log('You can not make that move from' + currentRoom + 'to' + newRoom)\n }\n}", "function joinRoom() {\n var u = document.getElementById(\"username\").value;\n if(u === \"\") {\n setJoinError(\"Please choose a username\");\n return;\n }\n var r = document.getElementById(\"room\").value;\n if(r === \"\") {\n setJoinError(\"Please enter a room\");\n return;\n }\n var c = document.getElementById(\"color\").value;\n if(c === \"\") {\n setJoinError(\"Please choose a color\");\n return;\n }\n r = r.replace(/\\s+/g, ''); // Remove whitespace from room name\n r = r.toLowerCase();\n var join_message = {username: u, room: r, color: c};\n Game = new MultiplayerGame(u, r);\n socket.emit('join', join_message)\n}", "function updateRoomStatus(roomKey) {\n let socketIds = rooms[roomKey];\n let gameData = {'playerIds': socketIds};\n for (var i = 0; i < ROOM_SIZE; i++) {\n gameData[socketIds[i]] = playerInfo[socketIds[i]];\n }\n let timeElapsed = (new Date().getTime() - lastRefreshed[roomKey])/1000; //sec\n // update ranks\n let distances = []\n for (const socketId of gameData.playerIds) {\n distances.push(gameData[socketId].distance);\n gameData[socketId].rank = -1;\n }\n distances.sort((a,b)=>b-a);\n let maxDistance = distances[0];\n for (var i = 0; i < ROOM_SIZE; i++) {\n for (const socketId of gameData.playerIds) {\n if (gameData[socketId].rank == -1 && distances[i] == gameData[socketId].distance) {\n gameData[socketId].rank = i+1;\n break;\n }\n }\n }\n // update average speeds\n for (const socketId of gameData.playerIds) {\n gameData[socketId].averagespeed =\n gameData[socketId].distance / (new Date().getTime() - roomStartTime[roomKey]) * 1000;\n }\n // decrement health\n for (const socketId of gameData.playerIds) {\n gameData[socketId].health -= HEALTH_DECAY_RATE * timeElapsed * (maxDistance - gameData[socketId].distance);\n if (gameData[socketId].health <= 0) {\n gameData[socketId].health = 0;\n gameData[socketId].alive = false;\n }\n }\n return gameData;\n}", "function joinRoom(e, roomAlreadyCreated) {\n e.preventDefault();\n if (roomAlreadyCreated) {\n if (!document.getElementById(\"username_shareableRoom\").value.length < 1) {\n userName = document.getElementById(\"username_shareableRoom\").value;\n socket.open();\n var enteredRoomName = document.getElementById(\"roomToJoin\").value;\n userName = document.getElementById(\"username_shareableRoom\").value;\n socket.emit(\"joinRoom\", enteredRoomName, userName);\n currentRoom = enteredRoomName;\n MicroModal.close(\"shareableRoomCreatedModal\");\n // showStartGameButton();\n } else {\n document.getElementById(\"username_shareableRoom\").style.border =\n \"2px solid red\";\n setTimeout(function () {\n document.getElementById(\"username_shareableRoom\").style.border =\n \"2px solid black\";\n }, 3000);\n }\n } else {\n if (username()) {\n socket.open();\n var enteredRoomName = document.getElementById(\"enteredRoomName\").value;\n userName = document.getElementById(\"userName\").value;\n socket.emit(\"joinRoom\", enteredRoomName, userName);\n currentRoom = enteredRoomName;\n }\n }\n}", "function func_has_started(rooms_saved, room_number) {\n var has_started = rooms_saved.child(room_number).child(\"start\");\n has_started.once(\"value\").then(function(r) {\n var started = r.val();\n\n if (started) {\n $(\"#div_body_analytics\").append(create_room(room_number, 0));\n func_populate(room_number);\n } else {\n $(\"#div_body_yourRoom\").append(create_room(room_number, 2));\n func_populate(room_number);\n }\n });\n\n}", "function joinRoom(socket, room) {\n socket.join(room);\n // Count the number of connected users to the room\n var active_connections = io.sockets.manager.rooms['/' + room].length;\n io.sockets.in(room).emit(\"user:connect\", active_connections);\n}", "function checkAllReady(roomCode){\n let game = rooms[roomCode];\n let players = game.ready;\n if(players.length !== game.game.maxPlayers()){\n return;\n }\n remove(publicRooms, roomCode);\n let inputs = null; //TODO inputs\n let winner = game.game.run(players, inputs);\n console.log(winner + \" won the game in \" + roomCode);\n balances[winner] += parseInt(game.gameData.payment, 10) * players.length;\n for(let i = 0; i < players.length; i++){\n let player = players[i];\n if(player === winner){\n socks[player].sock.emit(\"end-game-\" + roomCode, {\n win: true,\n roomCode: roomCode,\n balance: balances[player]\n });\n }\n else{\n socks[player].sock.emit(\"end-game-\" + roomCode, {\n win: false,\n roomCode: roomCode,\n balance: balances[player]\n });\n }\n }\n deleteRoom(roomCode);\n}", "function joinRoom() {\n var roomCode = document.getElementById('joinRoom').value;\n if (roomCode != \"\") {\n var docRef = db.collection('webBuzzer').doc(roomCode)\n docRef.get().then(function(doc) {\n if (doc.exists) {\n console.log(\"Document data:\", doc.data());\n data = doc.data()\n //firebase.database().ref('webBuzzer/' + roomCode).once('value', function(data) {\n if (data.name) {\n window.open('room.html?id=' + roomCode, '_self')\n } else {\n alert('The room code you entered isn\\'t valid.')\n }\n } else {\n alert('A 5 digit room code is required.')\n }\n }).catch(function(error) {\n console.log(\"Error getting document:\", error);\n });\n } else {\n // doc.data() will be undefined in this case\n console.log(\"No such document!\");\n }\n}", "async joinDifferentGame() {\n const res = await leaveGame();\n if (res.error) {\n showError(res.error);\n this.setState({\n modalDisplay: false,\n });\n return;\n }\n\n await joinGame(this.state.selectedGame, { source: this.props.location.pathname });\n }", "function updateRooms() {\n\t//Get on the already set rooms URI\n\tvar getting = $.get(roomsURI);\n\tgetting.done(function(data) {\n\t\tvar rooms = JSON.parse(JSON.stringify(data));\n\t\troom_list = rooms;\n\t\tvar new_room_id_list = []; // used to add new elements to switch too\n\t\tfor (var i = 0; i < rooms.length; i++) {\n\t\t\t//Add new room id to room id list if the room is not known\n\t\t\tif($.inArray(rooms[i].roomID, room_id_list) == -1){ //-1 is false check\n\t\t\t\troom_id_list.push(rooms[i].roomID); //add to global list\n\t\t\t\tnew_room_id_list.push(rooms[i].roomID); //add to local list\n\t\t\t\t//$(\"#chat-rooms-list\").append(createRoomElement(rooms[i]));//add to screen\n\t\t\t\t$(\"#chat-rooms-dropdown-list\").append(createRoomElement(rooms[i]));//add to screen\n\t\t\t}\n\t\t\t\n\t\t\t//Update current users count\n\t\t\t$(\"li[room_id =\" + rooms[i].roomID + \"]\").children(\"a\").text(rooms[i].name + \" (\" + rooms[i].userCount + \")\" );\n\t\t}\n\t\t\n\t\t//Add all received id's to a list\n\t\tvar recieved_room_id_list = [];\n\t\tfor(var i = 0; i < rooms.length; i++){\n\t\t\trecieved_room_id_list.push(rooms[i].roomID);\n\t\t}\n\t\t\n\t\t//check the local list against the servers list, remove any missing\n\t\tfor(var i = 0; i < room_id_list.length; i++){\n\t\t\tif($.inArray(room_id_list[i], recieved_room_id_list) == -1){\n\t\t\t\t//room is not in received room list, delete\n\t\t\t\t$(\"li[room_id =\" + room_id_list[i] + \"]\").remove();\n\t\t\t}\n\t\t}\n\t\t\n\t\tactivateRoom(active_room_id);\n\t});\n}", "async function checkIfJoined(req, res, next) {\n try{\n const roomId = req.query.roomId;\n let isJoined = false;\n const userId = req.decodedIdToken.user_id;\n const coll = firebase.firestore().collection(Constants.COLL_ROOMS).doc(roomId).collection(Constants.COLL_USERS);\n let userList = [];\n const snapshot = await coll.orderBy(\"user_id\").get();\n snapshot.forEach(doc => {\n userList.push({ id: doc.id, data: doc.data() });\n });\n for(let userNum of userList){\n console.log(\"=============================\", userNum);\n if(userId === userNum.data.user_id){\n isJoined = true;\n }\n }\n req.isJoined = isJoined;\n\n }catch(e){\n console.log(e);\n res.setHeader('Cache-Control', 'private');\n res.send(e);\n }\n return next();\n}", "getRoom(roomCode) {\n return this.rooms[roomCode];\n }", "function processBuildings(values, key, map){\n console.log(\"Building: \" + key)\n //step 1. get a list of rooms\n for (let i in values.classes){\n values.rset.add(values.classes[i].room)\n }\n\n values.rset = new Set(Array.from(values.rset).sort()) \n \n\n //step 2. create room object and add to room map\n for (let item of values.rset.keys()){\n values.rmap.set(item, new roomObject(item) ) \n }\n \n //values.rmap = new Map([values.rmap.entries()].sort())\n //console.log(nrmap)\n \n //step 3 add classes to rooms\n for(let i in values.classes){\n temp = values.classes[i].room\n current = values.rmap.get(temp)\n current.classesinroom.push(values.classes[i])\n }\n\n //print stuff for debug\n // console.log(\"\")\n // console.log(\"Building: \" + values.name)\n // for (var [key, value] of values.rmap.entries()) {\n // console.log(\"\")\n // console.log(\"Room \" + key + \":\")\n // for(let i in value.classesinroom){\n // console.log(value.classesinroom[i].name + \" at \" + value.classesinroom[i].day + \" \" + value.classesinroom[i].time); \n // }\n // }\n\n //step 5 break eachroom into days and sort\n function processRooms(values, key, map){\n values.placeByDay()\n values.sortEachDay()\n values.findTimes()\n values.print()\n //console.log(values.toString())\n }\n values.rmap.forEach(processRooms)\n \n //step 6 find open times per day\n // if arr[i +1].start - arr[i].end > 20\n //account for end of day\n\n\n}", "function containsRoom (roomName) {\n \treturn _.contains(_.map(chatRooms, function(item) {\n\t\t\t\treturn item['roomname'];\n\t\t\t}), roomName);\n }", "function inside(socket, room) {\n return !!socket.manager.roomClients[socket.id][room];\n }", "whereEqCandidateKey(table, key) {\n return QueryUtil.whereEqCandidateKey(this, table, key);\n }", "addPlayerToRoomByID(player, roomID) {\n // Conditional that checks whether a room exists\n if (Room.roomExists(roomID)) {\n // Find the room by its ID and add the player to it\n Room.findByID(roomID).addPlayer(player);\n player.setRoom(Room.findByID(roomID));\n return true;\n }\n // Emit a message saying that joining the room has failed\n player.emitter.emit('roomJoinFailed', {});\n return false;\n }" ]
[ "0.59071743", "0.5896275", "0.5782543", "0.55590796", "0.5541714", "0.549114", "0.548365", "0.541844", "0.54121923", "0.54058146", "0.53827566", "0.5348435", "0.5311451", "0.5307633", "0.52914846", "0.52890784", "0.5260069", "0.525477", "0.52518773", "0.5243138", "0.5239067", "0.52237856", "0.5212984", "0.5208388", "0.5202093", "0.51883173", "0.51630753", "0.5158803", "0.51246876", "0.51161313", "0.5108232", "0.507657", "0.5055421", "0.50310695", "0.5029125", "0.5007362", "0.5003525", "0.4979913", "0.49772075", "0.49548477", "0.49488333", "0.49406987", "0.49382555", "0.49298987", "0.49269357", "0.49262583", "0.4914847", "0.48748904", "0.48732948", "0.48656508", "0.48552012", "0.4844412", "0.48350778", "0.48284262", "0.4822975", "0.48228008", "0.48147315", "0.4813779", "0.48066762", "0.47996822", "0.4795552", "0.47929826", "0.47810048", "0.47777265", "0.47681668", "0.47387725", "0.47187477", "0.47116202", "0.47089148", "0.47080848", "0.4699614", "0.46934792", "0.4681148", "0.46715158", "0.46623656", "0.4656533", "0.4645783", "0.46445617", "0.46324357", "0.46211475", "0.4619727", "0.46187156", "0.46092084", "0.46070552", "0.46067846", "0.46063894", "0.46063355", "0.4604237", "0.4591834", "0.45887727", "0.45821324", "0.4574749", "0.4566674", "0.45635563", "0.45599478", "0.4559414", "0.45569345", "0.45562828", "0.4553754", "0.45533773", "0.4551655" ]
0.0
-1
Updates React state for form inputs and form selection on every key change.
handleChange(event) { const { name, value } = event.target; this.setState({ [name]: value }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_handleInputChange(key, newValue) {\n this.setState({\n [key]: newValue\n });\n }", "setInput(event, key) {\n this.setState({\n [key]: event.target.value\n })\n }", "handleInputChange(key, value) {\n this.setState({ [key]: value });\n }", "onChangeHandler(evt, key) {\n this.setState({\n [key]: evt.target.value\n });\n }", "handleInputChange(key, e) {\n let newSelected = _.extend({}, this.state.periodicReviewObject);\n newSelected[key] = e.target.value;\n\n // console.log(key, newSelected[key], newSelected);\n\n // Update the state.\n this.setState({ periodicReviewObject: newSelected });\n\n // Reset userSubmittedForm.\n this.userSubmittedForm = false;\n this.setState({ userSubmittedForm: false });\n }", "handleInputChange(key, value) {\n this.setState({[key]: value});\n }", "handleInputChange(event) {\n\t\tlet value = event.target.value;\n\t\tlet key = event.target.name;\n\t\tthis.setState({\n\t\t\t[key]: value,\n\t\t});\n\t}", "handleInputChange(key, e) {\n let newSelected = _.extend({}, this.state.releaseDocumentObject);\n newSelected[key] = e.target.value;\n\n // Update the state.\n this.setState({ releaseDocumentObject: newSelected });\n\n // Reset userSubmittedForm.\n this.setState({ userSubmittedForm: false });\n }", "onInputChange(evt){\t\n\t\tthis.setState({\n\t\t\tfields: {\n\t\t\t\t...this.state.fields,\n\t\t\t\t[evt.target.name]: evt.target.value\n\t\t\t}\n\t\t})\n\t}", "onInputChange(evt) {\n\t\tthis.setState({\n\t\t\tfields: {\n\t\t\t\t...this.state.fields,\n\t\t\t\t[evt.target.name]: evt.target.value\n\t\t\t}\n\t\t})\n\t}", "handleChange(e) {\n const key = e.target.name;\n const value = e.target.value;\n this.setState({\n [key]: value\n })\n }", "updateInput(key, value) {\n this.setState({ [key]: value });\n\n }", "handleFieldChange(stateKey, value) {\n this.setState({ [stateKey]: value });\n }", "handleChange(event) {\n let key = event.target.name\n let value = event.target.value\n this.setState({\n [key]: value\n })\n }", "onInputChange( evt ) {\n\t\tconst inputFields = this.state.inputFields\n\t\tinputFields[evt.target.name] = evt.target.value\n\n\t\tthis.setState({ inputFields })\n\t}", "handleInput(key, e) {\n console.log(key)\n /*Duplicating and updating the state */\n var state = Object.assign({}, this.state.user); \n state[key] = e.target.value;\n this.setState({user: state });\n }", "function setInput(key, value) {\n setFormState({...formState, [ key ]: value})\n }", "keyPress(event) {\n const type = event.target.type;\n this.setState({\n [type]: event.target.value\n });\n }", "changeInput(e, input){\n const val = e.target.value;\n this.setState(prev => { // sets the state for that input to the value\n prev.inputs[input] = val;\n return prev;\n });\n }", "_onTextFieldChange(e) {\n this.setState({\n form: {\n ...this.state.form,\n [e.target.name]: e.target.value\n }\n })\n }", "handleInputChange(key, value) {\n // Example: if the key is username, this statement is the equivalent to the following one:\n // this.setState({'username': value});\n this.setState({ [key]: value });\n }", "handleInput(key, e) {\n \n /*Duplicating and updating the state */\n var state = Object.assign({}, this.state.newDish); \n state[key] = e.target.value;\n this.setState({newDish: state });\n }", "handleInputChange(event) {\n let newState = {};\n newState[event.target.id] = event.target.value;\n this.setState(newState);\n }", "onFormChange(evt) {\n const element = evt.target;\n const name = element.name;\n const value = element.value;\n const newState = {};\n newState[name] = value;\n this.setState(newState);\n }", "function setInput(key, value) {\n setFormState({\n ...formState,\n [key]: value\n })\n }", "updateFieldKv(event) {\n this.props.uiState.setFieldsUsingKvString(event.target.value);\n this.setSuggestions(event.target.value);\n if (this.state.suggestionIndex) {\n this.setState({\n suggestionIndex: 0\n });\n }\n }", "changeForm(key) {\n this.setState({type: key});\n }", "handleInputChange(key, value) {\n // Example: if the key is username, this statement is the equivalent to the following one:\n // this.setState({'username': value});\n this.setState({[key]: value});\n }", "updateSelectForm(event) {\n let tfValue = (event.target.value)\n this.setState((state) => {\n state.tfValue = tfValue\n return state\n })\n }", "handleSearchKeyChange(event) {\n\t\tthis.setState({searchKey: event.target.value});\n\t}", "handleKeys(value, e){\n let keys = this.state.keys; // copy state\n if(e.keyCode === KEY.UP) keys.up = value; // mutate state\n if(e.keyCode === KEY.DOWN) keys.down = value;\n if(e.keyCode === KEY.LEFT) keys.left = value;\n if(e.keyCode === KEY.RIGHT) keys.right = value;\n if(e.keyCode === KEY.MAP) this.state.grid.gridAlpha = 0.5;\n if(e.keyCode === KEY.DEBUG) this.state.debug = true;\n\n this.setState({keys : keys}); // set state (this will trigger the update() method so screen is re-rendered)\n this.drawMiniMap();\n this.drawProjection();\n\n e.preventDefault();\n }", "onChangeHandler(ev) {\n ev.preventDefault();\n let newState = {};\n newState[ev.target.name] = ev.target.value;\n this.setState(newState);\n }", "handleFormInputChange(e) {\n this.setState({ [e.target.id]: e.target.value });\n }", "handleInput(key, e){\n /** Duplicando y actualizando el stado */\n var state = Object.assign({}, this.state.newProduct);\n state[key]= e.target.value;\n this.setState({newProduct: state});\n }", "onChange(event, key) {\n const value = event.target.type === 'checkbox' ? event.target.checked : event.target.value;\n key.value = value;\n this.forceUpdate();\n }", "keyinputHandle(e) {\n this.setState({\n quizToopenkey: e.target.value\n })\n }", "handleInputChanges(evt) {\n this.setState({[evt.target.name]:evt.target.value});\n }", "handleChange(event) { //starts here -----1----- //update state on every key click\n this.setState({taskName: event.target.value}); //sets taskName state\n }", "updateInput(event) {\n this.setState({ [event.target.name]: event.target.value });\n }", "handleChange(e) {\n this.state.form[e.target.name] = e.target.value;\n this.setState(this.state);\n }", "handleChange(event) {\n const newState = {}\n newState[event.target.name] = event.target.value;\n this.setState(newState);\n }", "onChangeInput() {\n this.setState({\n value: !this.state.value,\n manualChangeKey: !this.state.manualChangeKey,\n });\n }", "handleSelect(event) {\n //name of text box is same as name of state so that it updates that val\n this.setState({ value: event.target.value });\n }", "onInputChange(event) {\n this.setState({ input: event.target.value });\n }", "handleInputFieldChange(e) {\r\n\t\tthis.setState({\r\n\t\t\t[e.target.name] : e.target.value\r\n\t\t})\r\n\t}", "_onSelectFieldChange(e, i, value) {\n this.setState({\n form: {\n ...this.state.form,\n quantifier: value\n }\n })\n }", "handleChange(event) {\n let field = event.target.name; // which input\n let value = event.target.value; // what value\n\n let changes = {}; // object to hold changes\n changes[field] = value; // change this field\n this.setState(changes); // update state\n }", "handleChange(e) {\n this.setState({ input: e.target.value });\n }", "inputChanged(e) {\n const { value, name } = e.target;\n this.setState({ form: Object.assign({}, this.state.form, { [name]: value }) });\n }", "inputChange(e) {\n this.setState({\n [e.target.name]: e.target.value,\n });\n }", "_updateInput (input) {\n this.setState({ input })\n }", "onFieldChange(event) {\n this.setState({\n [event.target.name]: event.target.value\n })\n }", "onChange(event) {\n // We can only change state using this.setState() and replace the current state with something new.\n this.setState({\n input: event.target.value // Set the value in this.state to the current value of the input DOM element\n // The above event.target.value is vanilla JavaScript to get value from event DOM target\n });\n }", "onInputChange(e) {\n const inputValue = e.target.value;\n\n this.setState({optionInputVal: inputValue});\n }", "handleChangeUpdate(e) {\n this.setState({\n [e.target.name]: e.target.value\n });\n }", "handleChange(event) {\n this.setState({\n input: event.target.value\n });\n }", "handleInput(e) {\n const formFields = { ...this.state.formFields };\n formFields[e.target.name] = e.target.value;\n this.setState({\n formFields\n });\n }", "handleChange(key, event) {\n const { formData } = this.state\n this.setState({formData: {...formData, ...{[key]: event.target.value}}})\n }", "handleChange(e) {\n // e.currentTarget: DOM element we attached the event handler to \n // use the value property to read its current value \n this.setState({ input: e.currentTarget.value });\n }", "handleChange(e) {\n // console.log(\"e target value: \", e.target.value);\n // which input field is the user typing in?\n console.log(\"e target name: \", e.target.name);\n this.setState(\n {\n [e.target.name]: e.target.value,\n },\n () => console.log(\"this.state after setState: \", this.state)\n );\n // this.setState is used to put/update state!\n // if (e.target.name === \"first\") {\n // this.setState({\n // first: e.target.value,\n // });\n // } else if (e.target.name === \"last\") {\n // this.setState({\n // last: e.target.value,\n // });\n // }\n }", "handleInputChange(event) {\n console.log('changing');\n const { name, value } = event.target;\n this.setState({\n [name]: value\n });\n }", "handleSelect(activeKey) {\n\t\tthis.setState({ activeKey });\n\t}", "handleChange(e) {\n this.setState({\n input: e.target.value\n })\n }", "handleChange(event) {\n this.setState({\n input: event.target.value\n })\n }", "ManageInput(e){\n this.setState({\n currentItem:{\n text : e.target.value,\n key : Date.now()\n }\n })\n }", "handleChange(event) {\n const {\n name,\n value\n } = event.target; // Set a nested state based on input name\n\n this.setState({\n classificationForm: (0, _Immutable.set)(this.state.classificationForm, name, value)\n });\n }", "handleInput(e) {\n e.preventDefault()\n let name = e.target.name\n let newState = {}\n newState[name] = e.target.value\n this.setState(newState)\n }", "onSearchChange(e) {\n const value = e.target.value;\n this.setState(prevState => ({\n SearchKey: value, \n })) \n }", "handleChange(event) {\n const state = {...this.state};\n state[event.target.name] = event.target.value;\n this.setState(state);\n }", "handleChange(event) {\n var field = event.target.name;\n var value = event.target.value;\n\n var changes = {}; //object to hold changes\n changes[field] = value; //change this field\n this.setState(changes); //update state\n }", "_handleOnChange(event) {\n const target = event.target\n const name = target.name\n const value = target.value\n\n this.setState({\n form: {\n ...this.state.form,\n [name]: value,\n },\n })\n }", "fieldOnChange(event, fieldName) {\n this.setState({\n\t\t\tform: {\n\t\t\t\t...this.state.form,\n\t\t\t\t[fieldName]: event.target.value\n\t\t\t}\n\t\t})\n\t}", "handleChange(event) {\n let formFields = this.state.formFields;\n formFields[event.target.name] = event.target.value;\n this.setState({\n formFields\n });\n }", "handleInputChange(event) {\n const target = event.target;\n const name = target.name;\n const value = target.value;\n this.setState({\n [name]: value\n });\n }", "handleInputChange(event){\n\t\tevent.preventDefault()\n\t\tlet key= event.target.name\n\t\tlet value= event.target.value\n\n\t\tthis.setState({\n\t\t\t[key]: value\n\t\t})\n\n\t\tif(key == \"member\"){\n\t\t\tkey = \"email\"\n\t\t\tthis.setState({\n\t\t\t\t[key]: value\n\t\t\t})\n\t\t}\n\t\tkey = \"inviter\"\n\t\tvalue = window.localStorage.getItem('id')\n\t\tthis.setState({\n\t\t\t[key]: value\n\t\t})\n\n\t}", "handleChange(event) {\n this.setState({ \n value: event.target.value,\n isFocused: true\n });\n }", "onChange(e) {\n this.setState({inputValue: e.target.value});\n }", "handleInputChange(event, objectToChange) {\n //Fetch the target component of the event\n const target = event.target;\n //The name of the form element\n const name = target.name;\n\n //Get the object in the state that corresponds to the form this event stems from\n //This is required to only need one function for all forms\n var obj = this.state[objectToChange];\n\n if (target.type === \"select-multiple\") {\n //If the input is a select multiple, then get all the selected options\n var val = [];\n for (var i = 0, l = event.target.options.length; i < l; i++) {\n if (event.target.options[i].selected) {\n val.push(event.target.options[i].value);\n }\n }\n //Save all those options under the object\n obj[name] = val;\n } else {\n //Save the changed value under the object\n obj[name] = target.value;\n }\n\n //In React a state can only be updated with setState, we replace the whole object that has the states of this forms values\n //After the state was changed, the result is reloaded\n this.setState({\n [objectToChange]: obj\n }, this.reloadResult);\n\n //We still have to update this object to reflect what the user selected should the user leave this page to the detail page\n FilterUserInput[objectToChange] = obj;\n }", "handleChange(e) {\n this.setState({\n inputVal: e.target.value,\n });\n }", "onInputChange(event){\n\t\t//console.log(event.target.value);\n\t\tthis.setState({term: event.target.value });\n\t}", "onChange(e) {\n this.setState({ [e.target.name]: e.target.value }); //setting the input with value in state\n }", "handleInputChange(e) {\n const name = e.target.name;\n const value = e.target.value;\n this.setState({\n [name]: value,\n });\n }", "handleInputChange(e){\r\n const name=e.target.name;\r\n const value=e.target.value;\r\n this.setState({\r\n [name]: value });\r\n \r\n }", "_handleChange(e) {\n this.setState({value: e.target.value});\n }", "handleChange(event) {\n var field = event.target.name;\n var value = event.target.value;\n\n var changes = {}; //object to hold changes\n changes[field] = value; //change this field\n this.setState(changes); //update state\n }", "change(e) {\n this.setState({[e.target.name]: e.target.value});\n }", "handleChange(event) {\n let formFields = this.state.formFields;\n formFields[event.target.name] = event.target.value;\n this.setState({\n formFields\n });\n }", "handleChange(evt) {\n evt.preventDefault();\n this.setState({ [evt.target.name]: evt.target.value });\n }", "onChange(e) {\n //this is how we get the value of what the user types in the name field, we set the state to what the user typed\n this.setState({[e.target.name]: e.target.value}); \n }", "handleInputChange(event) {\n this.setState({\n [event.target.name]: event.target.value,\n });\n }", "handleInputChange(e) {\n const name = e.target.name;\n const value = e.target.value;\n this.setState({\n [name]: value\n });\n }", "function handleOnChange(event) {\n //event.target.name hold the name of the input that changed\n //event.target.value hold the new value of the input field that changed\n\n //we update the user state with the new value\n setState({\n ...state,\n [event.target.name]: event.target.value,\n });\n }", "_changeHandler(e) {\n this.setState({ text : e.target.value });\n }", "handleInputChange(event) {\n console.log(event);\n this.setState({ input: event.target.value });\n }", "changeHandler(e) {\n this.setState({\n [e.target.name]: e.target.value\n });\n }", "handleInput(event) {\n\t\tconst name = event.target.name\n\t\tconst value = event.target.value\n\t\tthis.setState({ [name]: value })\n\t}", "handleInputChange(e) {\n let name = e.target.name;\n let value = e.target.value;\n this.setState({\n [name]: value\n });\n }", "onInputChange(e) {\n this.setState({\n input: e && e.target.value,\n });\n }", "change(e) {\r\n this.setState({\r\n new: e.target.value,\r\n });\r\n }", "handleChange(e){\n this.setState({\n inputValue:e.target.value\n })\n}", "handleAPIKeyInputChange(e) {\r\n this.setState({ apiKey: e.target.value, showError: false });\r\n }" ]
[ "0.72033924", "0.711367", "0.70271236", "0.6890326", "0.6872219", "0.6866646", "0.6862103", "0.6843475", "0.67587394", "0.67333305", "0.67212856", "0.67141265", "0.6685463", "0.6677062", "0.6628439", "0.6600364", "0.65959126", "0.659498", "0.65865105", "0.6564752", "0.6558083", "0.6530891", "0.65278375", "0.6508854", "0.6503549", "0.6490027", "0.64761", "0.6468381", "0.64118767", "0.64092386", "0.6395265", "0.63908076", "0.6383713", "0.6382742", "0.635726", "0.63400304", "0.6336146", "0.6327468", "0.63261884", "0.63229805", "0.6308951", "0.6301209", "0.6300433", "0.6296497", "0.62950546", "0.62766844", "0.6270291", "0.6261594", "0.6258331", "0.6228724", "0.6220195", "0.6211617", "0.6197407", "0.6185803", "0.6179922", "0.61788344", "0.61760294", "0.61719376", "0.61650467", "0.6155482", "0.6151926", "0.6149993", "0.61463064", "0.6141685", "0.61374193", "0.6134045", "0.6132092", "0.61305535", "0.61284214", "0.61261445", "0.6125237", "0.6124335", "0.61226547", "0.6121911", "0.60991865", "0.6098685", "0.6093318", "0.6092865", "0.60923034", "0.6092222", "0.608984", "0.6087565", "0.6084964", "0.6084837", "0.608363", "0.6081146", "0.6070206", "0.6067421", "0.60646087", "0.6062589", "0.6062439", "0.60603315", "0.6060076", "0.6058863", "0.60576487", "0.6054456", "0.6049255", "0.60453945", "0.6039959", "0.6037473", "0.60356486" ]
0.0
-1
initializa database if not already there
async function init() { try { await db.initPool(); const result = await db.get('sqlite_master', { type: 'table', name: 'effort' }); if (result.length === 0) { log.debug('New system, initialising schema'); dbInit.init(); } } catch (err) { log.fatal(err); process.exit(1); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n db = window.openDatabase(DB_NAME, \"\", DB_TITLE, DB_BYTES);\n createTables();\n }", "async init() {\n if (!await this.exists()) {\n // Create the database and the tables\n await this.create();\n await this.createTables();\n } else {\n await this.updateTables();\n }\n }", "function initDatabase(db) {\n (db != undefined && db !== null) && createAllTables(db);\n}", "function init(){\n db = bernApp.Database.open();\n return _createTables();\n }", "function initializeDatabase(data) {\n //create role\n createRole(getRoles(), createAppOwner);\n\n //deleteInstallFile();\n }", "function initializeDatabase() {\n getDB().transaction(function(trans){ \n trans.executeSql('CREATE TABLE IF NOT EXISTS Person (name, age)');\n getAllPersons(trans);\n }, errorCB);\n}", "function initDB()\n{\n if(window.openDatabase) {\n\t\tvar shortName = appName + '_json_files';\n var version = '1.0';\n var displayName = 'JSON Offline Storage';\n var maxSize = 65536; // in bytes\n filesDB = openDatabase(shortName, version, displayName, maxSize);\n \t\tsystemDB = openDatabase('SYSTEM_SETTINGS', version, displayName, maxSize);\n\t\tcreateTables();\n\t\t}\n}", "function initializeDb() {\n console.log(\"useDB: Initializing database.\");\n createUserListTable();\n refreshUserList();\n }", "initializeDatabase() {\n FileSystem.getInfoAsync(FileSystem.documentDirectory + \"SQLite/\" + DATABASE_NAME).then(file => {\n if (!file.exists) {\n this.createDatabase();\n console.log('Database intialized');\n DeviceEventEmitter.emit(\"database_changed\");\n }\n });\n }", "function initializeOpenDatabase() {\n try { // http://www.tutorialspoint.com/html5/html5_web_sql.htm\n ATTR.database = openDatabase(ATTR['cookie'], '1.0', 'simplifai', 50*1024*1024);\n ATTR.database.transaction(function (tx) {\n tx.executeSql('CREATE TABLE IF NOT EXISTS LOGS (id unique, log)');\n });\n } catch( error ) {}\n}", "function initializeDatabase() {\n //Drop collections\n mTools.dropCollection(GlobalAttributes, \"GlobalAttributes\", {}, function(cbParams) { console.log(\"[Info] Collection GlobalAttributes dropped!\"); });\n try {\n mTools.dropCollection(User, \"Users\", {}, function(cbParams) { console.log(\"[Info] Collection Users dropped!\"); });\n } catch (e) {\n console.log(\"[Notice] Users collection not dropped.\");\n }\n\n //Load GlobalStats Objects\n let newGSArr = [];\n newGSArr.push(new BlankGlobalAttribute(-1, 0, true)); //Global Clicks\n newGSArr.push(new BlankGlobalAttribute(-2, 0, true)); //Global Level\n newGSArr.push(new BlankGlobalAttribute(-3, 0, false)); //Global Ascensions\n batchLoadDBObjects(GlobalAttributes, newGSArr);\n\n checkListening();\n}", "function dbInitilization(){\n \n // Queries scheduled will be serialized.\n db.serialize(function() {\n \n // Queries scheduled will run in parallel.\n db.parallelize(function() {\n\n db.run('CREATE TABLE IF NOT EXISTS countries (id integer primary key autoincrement unique, name)')\n db.run('CREATE TABLE IF NOT EXISTS recipes (id integer primary key autoincrement unique, name, type, time, ingredient, method, id_Country)')\n })\n }) \n}", "function databaseInitialize() {\n /* var entries = db.getCollection(\"items\");\n if (entries === null) {\n entries = db.addCollection(\"items\");\n } */\n // kick off any program logic or start listening to external events\n runProgramLogic();\n}", "function initDB() {\n /*\n every user has their own database named after their own email\n it's based on the currently logged in user (whoIsLogged)\n so, first get that email and store it in a var,\n then use it to create or connect to their database\n and return the local scope object back to global scope\n */\n var currentDB = localStorage.getItem(\"whoIsLogged\");\n db = new PouchDB(currentDB); //either creates brand new database OR connects to existing database\n return db;\n }", "function initializeDB() {\n sql.open(dbFile).then(() => {\n return sql.run('CREATE TABLE IF NOT EXISTS subcription (userId TEXT, guildId TEXT, pokemon TEXT)');\n }).then(() => {\n return sql.run('CREATE TABLE IF NOT EXISTS blacklist (userName TEXT)');\n }).then(() => {\n return sql.run('CREATE TABLE IF NOT EXISTS serverOptions (guildId TEXT, optionName TEXT, optionValue TEXT)');\n }).then(() => {\n logger.info('Database Initialized');\n }).catch((err) => {\n logger.error('Unable to initialize database: ' + err);\n });\n}", "function initialize() {\n var db = getDatabase();\n db.transaction(\n function(tx) {\n // Create the settings table if it doesn't already exist\n // If the table exists, this is skipped\n tx.executeSql('CREATE TABLE IF NOT EXISTS units(name TEXT UNIQUE, quantity TEXT, value FLOAT)');\n });\n}", "function initialize()\n {\n //db = database.createDatabaseConnection('test');\n }", "function initDb() {\n try {\n if (!fs.existsSync(dbDir)) {\n fs.mkdirSync(dbDir);\n }\n if (!fs.existsSync(dbPath)) {\n fs.writeFileSync(dbPath, \"[]\");\n }\n return true;\n }\n catch {\n return false;\n }\n}", "function init() {\n\nRosters.webdb.open();\nRosters.webdb.createTable();\n\n}", "function prepare_database() {\n // define the config persistence if it does not exist\n /*\n var createTabStr = \"CREATE TABLE IF NOT EXISTS flmconfig (sensor CHAR(32), name CHAR(32));\";\n // and send the create command to the database\n db.run(createTabStr, function(err) {\n if (err) {\n db.close();\n throw err;\n }\n console.log(\"Create/connect to config table successful...\");\n });\n*/\n // define the data persistence if it does not exist\n createTabStr = \"CREATE TABLE IF NOT EXISTS flmdata (sensor CHAR(32), timestamp CHAR(10), value CHAR(5), unit CHAR(5));\";\n // and send the create command to the database\n db.run(createTabStr, function(err) {\n if (err) {\n db.close();\n throw err;\n }\n console.log(\"Create/connect to data table successful...\");\n });\n}", "function initDb() {\n var db = {};\n // Get all posts first\n var posts = getPosts.call(this);\n db.posts = posts;\n this.db = db;\n}", "function init(db) {\n console.log('dentro')\n // Create Table\n const tableDewey = `CREATE TABLE IF NOT EXISTS dewey (\n id TEXT PRIMARY KEY,\n name TEXT NOT NULL,\n parent TEXT\n )`\n const tableSoggettario = `CREATE TABLE IF NOT EXISTS soggettario (\n id TEXT PRIMARY KEY,\n name TEXT NOT NULL,\n parent TEXT\n )`\n const tableTrainingData = `CREATE TABLE TrainingData (\n id TEXT NOT NULL,\n metadata TEXT NOT NULL,\n oclc TEXT NOT NULL,\n description TEXT,\n isbn TEXT,\n CONSTRAINT TrainingData_PK PRIMARY KEY (id)\n )`\n const tableDeweyXTraining = `CREATE TABLE data_x_dewey (\n data_id TEXT NOT NULL,\n dewey_id TEXT NOT NULL,\n real_dewey TEXT NOT NULL,\n CONSTRAINT data_x_dewey_PK PRIMARY KEY (data_id,dewey_id),\n CONSTRAINT data_x_dewey_FK FOREIGN KEY (dewey_id) REFERENCES dewey(id) ON DELETE SET NULL,\n CONSTRAINT data_x_dewey_FK_1 FOREIGN KEY (data_id) REFERENCES TrainingData(id)\n )`\n db.exec(tableDewey)\n db.exec(tableSoggettario)\n db.exec(tableTrainingData)\n db.exec(tableDeweyXTraining)\n logger.info(`[db] success init db`)\n}", "function initDatabase(callback) {\n db.exists(function(err, exists) {\n if(err) return callback(err);\n\n if(exists) {\n // Update the views stored in the database to the current version.\n // Does this regardless of the current state of the design document\n // (i.e., even if it is up-to-date).\n db.get('_design/' + NAME, function(err, doc) {\n if(err) return callback(err);\n\n db.save('_design/' + NAME, doc._rev, DOCUMENT, function(err, res) {\n if(err) return callback(err);\n\n callback();\n });\n });\n } else {\n // Create database and initialize views\n db.create(function(err) {\n db.save('_design/' + NAME, DOCUMENT, function(err) {\n if(err) return callback(err);\n\n callback();\n });\n });\n }\n });\n}", "async prepareDatabase() {\n this.db = await this.addService('db', new this.DatabaseTransport(this.options.db));\n }", "function initDB(){\n const db = new Localbase(\"TracerDB\");\n return db\n}", "function databaseInitialize() {\n zip_content_db = loki_db.getCollection(\"zipInfo\");\n if (zip_content_db === null) {\n zip_content_db = loki_db.addCollection(\"zipInfo\", { indices: ['filePath'] });\n }\n var entryCount = zip_content_db.count();\n console.log(\"[zipInfoDb] number of entries in database : \" + entryCount);\n}", "function initDB()\n{\n if(window.openDatabase) {\n\t\tvar shortName = 'apex_json_files';\n var version = '1.0';\n var displayName = 'JSON Offline Storage';\n var maxSize = 65536; // in bytes\n filesDB = openDatabase(shortName, version, displayName, maxSize);\n \t\tcreateTable();\n\t\t}\n}", "function init(){\n\tvar db = Ti.Database.open('ColicheGassoseDB');\n\t\n\tdb.execute('CREATE TABLE IF NOT EXISTS symptoms(id INTEGER PRIMARY KEY AUTOINCREMENT, pianto INTEGER, rigurgito INTEGER, agitazione INTEGER, intensity INTEGER, when_date TEXT, duration INTEGER, to_sync INTEGER);');\n\n\tdb.close();\n}", "function dbSetup(){\n Entry.sync() // {force: true}) // using 'force' drops the table if it already exists, and creates a new one\n .then(function(){\n console.log('======= db synced =======');\n });\n }", "function init(){\n\tvar db = Ti.Database.open('ColicheGassoseDB');\n\t\n\tdb.execute('CREATE TABLE IF NOT EXISTS pill_alerts(id INTEGER PRIMARY KEY AUTOINCREMENT, pill_id INTEGER, when_date TEXT, parent_id INTEGER, taken INTEGER, to_sync INTEGER);');\n\t\n\ttry{\n\t\tdb.execute('ALTER TABLE pill_alerts ADD COLUMN info TEXT');\n\t\tdb.execute('ALTER TABLE pill_alerts ADD COLUMN asked INTEGER');\n\t} catch (ex){\n\t\t//do nothing\n\t\tTi.API.warn(\"Table pill_alerts is already updated\");\n\t}\n\t\n\tdb.close();\n}", "function initDbs(){\n\ttasksDb = new nedb({ filename: 'db/tasks.db', autoload: true });\n\tstoriesDb = new nedb({ filename: 'db/stories.db', autoload: true });\n}", "function initDB(name) {\n var $def = $.Deferred();\n if (!window.indexedDB) {\n $def.reject('no indexedDB');\n return $def;\n }\n var request = indexedDB.open(name, 3);\n if (!request) {\n $def.reject('open returns null');\n return $def;\n }\n request.onerror = function(event) {\n $def.reject('open failed');\n };\n request.onupgradeneeded = function(event) {\n var db = event.target.result;\n var bookStore = db.createObjectStore(\"books\", { keyPath: \"ID\"});\n bookStore.createIndex('slug', 'slug', {unique: true});\n db.createObjectStore(\"images\");\n };\n\n request.onsuccess = function(event) {\n var db = event.target.result;\n $def.resolve(db);\n }\n return $def;\n }", "static createNewDatabase() {\n idb.open(IdbHelper.dbName, idbVersion, function (upgradeDb) {\n if (!upgradeDb.objectStoreNames.contains(IdbHelper.restaurants)) {\n upgradeDb.createObjectStore(IdbHelper.restaurants, { keypath: 'id', autoIncrement: true });\n upgradeDb.createObjectStore('reviews', { keypath: 'id', autoIncrement: true });\n console.log(IdbHelper.dbName + ' has been created!');\n }\n });\n }", "function initDatabase() { \n try {\n\tif (!window.openDatabase) { // check for SQLite broser support\n\t alert ('SQLite Databases are not supported in this browser.');\n\t}\n\telse {\n\t createTable(); // call Function to create SQLite table\n\t}\n }\n\n catch (e) {\n\tif (e == 2) {\n\t //version numver mismach.\n\t console.log(\"Invalid SQLite Database Version!!\");\n\t} else {\n\t console.log(\"UnKOWN ErroR \" + e + \" !!.\");\n\t}\n\treturn;\n\t\n }\n\n\n}", "checkDatabase(){\n var query = `CREATE DATABASE IF NOT EXISTS ` + config.SQL_DATABASE\n this.db.run(query)\n }", "function initdb(config) {\n var db = new sqlite3.Database(config.db);\n var check;\n\n db.serialize(function () {\n db.run(\"CREATE TABLE if not exists items (id INTEGER PRIMARY KEY AUTOINCREMENT, item VARCHAR(50), qty NUMERIC, type INTEGER, done INTEGER DEFAULT 0, date TIMESTAMP DEFAULT CURRENT_TIMESTAMP)\");\n db.run(\"CREATE TABLE if not exists types (id INTEGER PRIMARY KEY AUTOINCREMENT, name VARCHAR(50))\");\n\n var types = [];\n types.push({'name': 'Qty'});\n types.push({'name': 'Kg'});\n\n var stmt = db.prepare(\"INSERT INTO types (id, name) VALUES (null, ?)\");\n\n for (var i = 0; i < types.length; i++) {\n stmt.run(types[i].name);\n }\n\n stmt.finalize();\n });\n\n db.close();\n}", "function initializeDB() {\n\tdb = window.openDatabase( dbName, dbDescription, dbVersion, dbSizeMB * 1024 * 1024 );\n}", "function initDB() {\n\t /* to remove database, use window.indexedDB.deleteDatabase('_webauthn'); */\n\t\t\t\treturn new Promise(function(resolve,reject) {\n\t\t\t\t\tvar req = indexedDB.open(WEBAUTHN_DB_NAME,WEBAUTHN_DB_VERSION);\n\t\t\t\t\t// wird auf das Request Objekt das upgradeneeded Event gefeuert gibt man hier an was gemacht werden soll\n\t\t\t\t\treq.onupgradeneeded = function() {\n\t\t\t\t\t\t// new database - set up store\n\t\t\t\t\t\tdb = req.result; // this.result oder hier req.result ist die eigentliche DB\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* Es wird ein ObjectStore (~eine Tabelle) in der DB angelegt. Die Einträge werden mit einer ID versehen */\n\t\t\t\t\t\tvar store = db.createObjectStore(WEBAUTHN_ID_TABLE, { keyPath: \"id\"});\n\t\t\t\t\t};\n\t\t\t\t\treq.onsuccess = function() {\n\t\t\t\t\t\tdb = req.result;// db der Variable db zugewiesen\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t};\n\t\t\t\t\treq.onerror = function(e) {\n\t\t\t\t\t\treject(e);\n\t\t\t\t\t};\n\t\t\t\t});\n\t\t\t}", "function initialise() {\n // connect to a database named restaurants.sqlite\n const db = new sqlite3.Database('./restaurants.sqlite');\n try {\n db.serialize(function () { // serialize means execute one statement at a time\n console.log('starting table creation');\n // delete tables if they already exist\n db.run(\"select * from Restaurants WHERE name = \\\"Pizza Express\\\";\"); \n // TODO - do the same for the other tables\n });\n } finally {\n // very important to always close database connections\n // else could lead to memory leaks\n db.close();\n console.log('table creation complete - connection closed');\n }\n}", "function dbInit() {\n window.modelcache = {};\n jsonEvalRegistry.register(\"dbmodel\", jsonDBCheck, jsonConvertRow);\n window.db = new PythonProxy(\"/storage/api/\");\n connectOnce(window.db, \"proxyready\", function () {\n var d = window.db.get_uidata();\n d.addCallback(function (uidata) {\n window.uiData = uidata;\n signal(window, \"dbready\");\n });\n }\n );\n}", "async function initializeDatabase() {\n return new Promise((resolve, reject) => {\n let database = new sqlite3.Database(\"data.sqlite\");\n database.serialize(() => {\n database.run(\"create table if not exists [data] ([council_reference] text primary key, [address] text, [description] text, [info_url] text, [comment_url] text, [date_scraped] text, [date_received] text)\");\n resolve(database);\n });\n });\n}", "function initDatabases(callback) {\n db = {};\n\n db.games = new Datastore({\n filename: './databases/games.db',\n autoload: true\n });\n\n db.achievements = new Datastore({\n filename: './databases/achievements.db',\n autoload: true\n });\n\n db.activities = new Datastore({\n filename: './databases/activities.db',\n autoload: true\n });\n\n db.network = new Datastore({\n filename: './databases/network.db',\n autoload: true\n });\n\n db.messages = new Datastore({\n filename: './databases/messages.db',\n autoload: true\n });\n\n db.favorites = new Datastore({\n filename: './databases/favorites.db',\n autoload: true\n });\n\n // Find and Merge all New Achievements\n storeGet(null, \"achievements\", function(prevAchievements) {\n if (prevAchievements) {\n achievementHelpers.storeAchievementFiles(prevAchievements);\n }\n\n });\n\n}", "static createNewDatabase() {\n idb.open(restaurantsDb, 1, upgradeDb => {\n if (!upgradeDb.objectStoreNames.contains(restaurantsTx)) {\n upgradeDb.createObjectStore(restaurantsTx, { keypath: 'id', autoIncrement: true });\n }\n console.log('restaurants-db has been created!');\n });\n }", "function setupDatabase(){\n\n return new Promise((resolve, reject) => {\n const database = {};\n debug(\"Initializing DB...\");\n resolve(database);\n }); \n}", "function createDB(){\r\n db.transaction(setupTable, dbErrorHandler, getEntries); \r\n}", "async function initializeDatabase() {\n return new Promise((resolve, reject) => {\n let database = new sqlite3.Database(\"data.sqlite\");\n database.serialize(() => {\n database.run(\"create table if not exists [data] ([council_reference] text primary key, [address] text, [description] text, [info_url] text, [comment_url] text, [date_scraped] text, [date_received] text, [legal_description] text)\");\n resolve(database);\n });\n });\n}", "function initDB(cbFunc) {\n nukeDB(err => {\n if (err) cbFunc(err);\n else updateDB(cbFunc);\n });\n}", "constructor(){\n super();\n this.database = new Database();\n this.database.initialize();\n }", "function initDB() {\n\tiDB = null;\n\tif (!window.indexedDB) {\n\t\tlog('Indexed DB not available');\n\t\tiDBInit = true;\n\t\treturn;\n\t}\n\t\n\tvar dbRequest = indexedDB.open('CADV_DB', 1); // Doesn't work in FireFox during Private Mode.\n\tdbRequest.onupgradeneeded = function(event) {\n\t\t// createObjectStore only works in OnUpgradeNeeded\n\t\tlog('Initializing DB...');\n\t\tiDB = dbRequest.result;\n\t\tif(!iDB.objectStoreNames.contains('imageStorage')) {\n\t\t\tiDB.createObjectStore('imageStorage');\n\t\t\tlog('imageStorage Created');\n\t\t}\n\t\tif(!iDB.objectStoreNames.contains('audioStorage')) {\n\t\t\tiDB.createObjectStore('audioStorage');\n\t\t\tlog('audioStorage Created');\n\t\t}\n\t\tif(!iDB.objectStoreNames.contains('videoStorage')) {\n\t\t\tiDB.createObjectStore('videoStorage');\n\t\t\tlog('videoStorage Created');\n\t\t}\n\t};\n\tdbRequest.onsuccess = function(event) {\n\t\tiDB = dbRequest.result;\n\t\tiDBInit = true;\n\t\tlog('DB Opened!');\n\t};\n\tdbRequest.onerror = function(event) {\n\t\tiDBInit = true;\n\t\tlog('DB Failed!');\n\t};\n}", "function initConnection() {\n db = new sqlite.Database(\"./db/dev.db\", (error) => {\n if (error) {\n console.error(error.message);\n }\n });\n}", "init() {\n return sqlite\n .open(`${this.server.paths.data}/database.db`, { Promise })\n .then((db) => {\n const schema = fs.readFileSync(`${this.server.paths.root}/server/schema.sql`).toString();\n return db.exec(schema);\n })\n .then((db) => {\n this.db = db;\n });\n }", "function init()\r\n\t{\r\n\t\ttry{\r\n\t\t\t\r\n\t\t\t\tdb = openDatabase('callogs', '1.0', 'Call Log Database', 2 * 1024 * 1024);\r\n\t\t\t\tdb.transaction(function (transaction) \r\n\t\t\t\t{\r\n\t\t\t\t\ttransaction.executeSql('CREATE TABLE IF NOT EXISTS logs (id INTEGER PRIMARY KEY, number TEXT, duration NUMERIC)');\r\n\t\t\t\t\t\r\n\t\t\t\t\t//transaction.executeSql(\"INSERT INTO logs (number, duration) VALUES ('12345', 4000)\"); \r\n\t\t\t\t});\r\n\t\t}\r\n\t\tcatch(err) {\r\n\t\t\t\twebSqlOK = false;\r\n\t\t\t\talert(\"Error: this browser may not support Web SQL database: \\n Database functions may not work on this browser.\");\r\n\t\t}\r\n\t\r\n\t\tdoListeners();\r\n\t}", "function InitDatabase(initial, databaseOpts = {}) {\n this.config.database = this.getCoreOpts(moduleName, databaseOpts, initial)\n\n if (this.config.database.enabled) {\n }\n}", "constructor() {\n this.db = new sqlite.Database(`${config.database.path}/db-${config.production ? 'production' : 'testing'}.db`);\n }", "init() {\n\t\tthis.connection = mysql.createConnection(this.setting);\n\t}", "function initVoteDB(){\n try{\n voteDB.executeSimpleSQL('create table if not exists AlreadyVoted (conf text , primary key(conf))');\n }catch(e){\n logE(e);\n }\n}", "static setup() {\n this.dbPromise = idb.open('mws-db', 2, upgradeDb => {\n switch (upgradeDb.oldVersion) {\n case 0:\n upgradeDb.createObjectStore('restaurants', { keyPath: 'id' });\n console.log('created db v1');\n case 1:\n let reviewsStore = upgradeDb.createObjectStore('reviews', { keyPath: 'id' });\n reviewsStore.createIndex('restaurant_id', 'restaurant_id', { unique: false });\n console.log('created db v2');\n }\n });\n }", "async function initializeDatabase() {\n // Call the function for the database structure definition\n defineDBStructure()\n // Synchronize Sequelize with the actual database\n await db.sync({ force: true })\n // Call the function to insert some fake data\n await insertRealData()\n return db\n}", "function Database(){}", "async function initalizeDatabase () {\n console.log(createTableQuery)\n await databaseQuery(createTableQuery)\n}", "fillDb() {\n if (this.options.before) this.options.before();\n this._schemaRecursuveAdd('', this.schema);\n if (this.options.after) this.options.after();\n }", "async init() {\n //TODO\n client = await mongo.connect(this.dbUrl);\n db = client.db(dbName);\n }", "function initialize(cb){\n\tasync.waterfall([\n\t\tfunction(callback) {\n\t\t\tr.connect({ host: 'localhost', port: configs.db.port}).then(function(conn){\n\t\t\t\tconnection = conn;\n\t\t\t\tcallback();\n\t\t\t}).error(function(err){\n\t\t\t\tcallback(err);\n\t\t\t});\n\t\t},\n\t\tfunction(callback) {\n\t\t\tr.dbDrop(dbName).run(connection, function(err){\n\t\t\t\tif(err)\n\t\t\t\t\tcallback(err,'done');\n\t\t\t\telse\n\t\t\t\t\tcallback()\n\t\t\t});\n\t\t},\n\t\tfunction(callback) {\n\t\t\tr.dbCreate(dbName).run(connection, function(err){\n\t\t\t\tif(err)\n\t\t\t\t\tcallback(err,'done');\n\t\t\t\telse\n\t\t\t\t\tcallback();\n\n\t\t\t})\n\t\t},\n\t\tfunction(callback){\n\t\t\tr.db(dbName).tableCreate('users').run(connection, function(err){\n\t\t\t\tif(err)\n\t\t\t\t\tcallback(err,'done');\n\t\t\t\telse\n\t\t\t\t\tcallback();\n\t\t\t})\n\t\t},\n\t\tfunction(callback){\n\t\t\tr.db(dbName).tableCreate('boards').run(connection, function(err){\n\t\t\t\tif(err)\n\t\t\t\t\tcallback(err,'done');\n\t\t\t\telse\n\t\t\t\t\tcallback(err,'done');\n\t\t\t})\n\t\t}\n\t], function (err, result) {\n\t\tif(err) {\n\t\t\tlogger.error('Unable To Initialize DB');\n\t\t\tlogger.error(err);\n\n\t\t}else{\n\t\t\tlogger.info(\"DB Initialized Successfully\");\n\t\t\tmodule.exports.connection = connection;\n\t\t}\n\t\tif(cb)cb.call(this,arguments);\n\t});\n}", "function init_db(env, after) {\n\tenv.filters = db.clone_filters(db.filters);\n\n\tgetValidConnection(env, function() {\n\t\tdb.set_conn_all(env.conn, env.filters);\n\t\tafter();\n\t});\n}", "function databaseInitialize() {\n var users = db.getCollection(\"users\");\n\n // on first run, this will be null so add collection\n if (!users) {\n users = db.addCollection(\"users\");\n }\n\n // add simple 1 step 'females' transform on first run\n if (!users.getTransform(\"females\")) {\n users.addTransform(\"females\", [{ type: 'find', value: { gender: 'f' }}]);\n }\n \n // simple parameterized document paging transform\n if (!users.getTransform(\"paged\")) {\n users.addTransform(\"paged\", [\n {\n type: 'offset',\n value: '[%lktxp]pageStart'\n },\n {\n type: 'limit',\n value: '[%lktxp]pageSize'\n }\n ]);\n }\n\n // let's keep the dynamic view from dynview example without its sort\n if (!users.getDynamicView(\"over 500\")) {\n let ov500 = users.addDynamicView(\"over 500\");\n ov500.applyFind({ age: { $gte : 500 } });\n }\n\n // for this example we will also seed data on first run\n if (users.count() === 0) {\n seedData();\n }\n \n // at this point all collections, transforms and dynamic view should exist \n // so go ahead and run your program logic\n runProgramLogic();\n}", "async function init() {\n const famID = await familyInsert(familySeed);\n const userID = await userInsert(userSeed, famID);\n await recipeInsert(recipeSeed, famID, userID);\n await discussionInsert(discussionTopicsSeed);\n errorHandler(connectionErrors);\n}", "async loadDatabase() {\n this.__db =\n (await qx.tool.utils.Json.loadJsonAsync(this.__dbFilename)) || {};\n }", "constructor() {\n this.database = new Database();\n }", "function init() {\n\tif (!initialized) {\n\t\tpool = mysql.createPool(config.mysql);\n\t\tinitialized = true;\n\t\tlogger.module_init(mod_name, mod_version, 'Configured MySQL connection pool');\n\t\tlogger.info('Using database '+config.mysql.database.green.bold, mod_name);\n\n\t\t// Load database filter definitions\n\t\tdb.init(process.cwd() + '/' + config.filter_dir, function(file) {\n\t\t\tlogger.info('Adding database definition ' + file.blue.bold + '...', 'db-filters');\n\t\t}, db.l_info);\n\n\t\tdb.set_log(function(msg) {\n\t\t\tlogger.info(msg, 'db-filters');\n\t\t});\n\n\t\t// Check for and run database migrations\n\t\tmigrations = db_migrate.getInstance(true, {\n\t\t\tconfig : {\n\t\t\t\tdev : {\n\t\t\t\t\tdriver : 'mysql',\n\t\t\t\t\tuser : config.mysql.user,\n\t\t\t\t\tpassword : config.mysql.password,\n\t\t\t\t\thost : config.mysql.host,\n\t\t\t\t\tdatabase : config.mysql.database,\n\t\t\t\t\tmultipleStatements : true,\n\t\t\t\t},\n\t\t\t\t\"sql-file\" : true\n\t\t\t}\n\t\t});\n\n\t\tmigrations.up().then(function() {\n\t\t\tlogger.info('Finished running db migrations', 'db-migrate');\n\t\t});\n\n\t}\n}", "function initLocalDB(){\n\tvar db = Ti.Database.open(royaledb);\n\tif(Ti.Platform.osname != 'android')\n\t\tdb.file.setRemoteBackup(false);\n\tdb.execute('CREATE TABLE IF NOT EXISTS myaccounts(id INTEGER PRIMARY KEY, accountName TEXT, fullName TEXT, infoId TEXT, username TEXT, password TEXT);');\n\t//db.execute('DELETE FROM myaccounts');\n\tdb.close();\n\tTi.API.info(royaledb +' is initialized');\n}", "function initLesson(){\n // Opening Lessons Database\n openDataBaseAndCreateTable('lessons');\n}", "function initializeDB() {\n if (!firebase.apps.length) {\n app = firebase.initializeApp(firebaseConfig);\n } else {\n app = firebase.app();\n }\n db = firebase.firestore(app);\n console.log(\"DB initialized!\");\n}", "async function initializeDatabase() {\n process.env.MOCKDB_URL = MOCKDB_URL;\n await database.initialize(MOCKDB_URL);\n}", "tingoInit() {\n // create a storage directory\n var dataDir = fs.realpathSync(path.resolve(this.cm.dataDir || \".\"));\n this.storageDir = path.join(dataDir, \"user-data\");\n mkdirp.sync(this.storageDir);\n // log.debug (\"storage directory:\", this.storageDir);\n\n // create database\n var TingoDb = require(\"tingodb\")().Db;\n this.database = new TingoDb(this.storageDir, {});\n }", "initialize(){\n this.db = Cloudant(this.database.url).use(this.database.name);\n }", "static init() {\n logger.notice('Populating the Database....');\n model.sequelize.sync({\n force: true,\n })\n .then(() => {\n SeedHelper.populateRoleTable()\n .then(() => {\n SeedHelper.populateUserTable()\n .then(() => {\n SeedHelper.populateDocumentTable()\n .catch((err) => {\n logger.error(err);\n });\n })\n .catch((err) => {\n logger.error(err);\n });\n })\n .catch((err) => {\n logger.error(err);\n });\n })\n .catch((err) => {\n logger.error(err);\n });\n }", "async function createDB() {\n //set path of sql file\n let path = \"src/db/\";\n //get destroy sql\n let destroySql = await read(path+'destroy.sql').then(returnData);\n //get init sql\n var initSql = await read(path+'init.sql').then(returnData);\n //get data sql\n var dataSql = await read(path+'data.sql').then(returnData);\n\n //destroys db\n await db.queryNotParameter(destroySql).catch(function (error) {\n console.error(error);\n });\n console.log(\"=====database destroyed=====\");\n\n //creates db\n await db.queryNotParameter(initSql).catch (function(error){\n console.error(error);\n }) ;\n console.log(\"=====database created=====\");\n\n\n //inserts data\n await db.queryNotParameter(dataSql).catch (function(error){\n console.error(error);\n }) ;\n console.log(\"=====database loaded with initial data=====\");\n \n}", "_initDB (dbPath = undefined) {\n if (dbPath !== undefined) {\n this.accTreeDBPath = path.join(dbPath, './accTree')\n }\n mkdirp.sync(this.accTreeDBPath)\n\n try {\n this.accTreeDB = level(this.accTreeDBPath)\n if (this.root === undefined) {\n this.tree = new Tree(this.accTreeDB)\n } else {\n this.tree = new Tree(this.accTreeDB, '0x' + this.root)\n }\n } catch (error) {\n // Could be invalid db path or invalid state root\n throw new Error(error)\n }\n }", "function initData(callback) {\n initLanguage(); // set the system language if not set\n DB.loadAll(function() {\n if(getUsers() === null){\n setUsers(DB.users);\n console.log('storing users in localStorage');\n }\n if(getBeverages() === null){\n setBeverages(DB.beverages);\n console.log('Storing beverages in localstorage');\n }\n if(getOrders() === null){\n setOrders([]);\n }\n if(callback) callback();\n });\n}", "function DatabaseFactory() {}", "function DatabaseFactory() {}", "async function doInitialize(mysql, mysql2, config) {\n if (initialized) {\n return;\n }\n\n const starttime = new Date();\n\n const dbConfig = {\n host: config.host,\n port: config.port,\n database: config.database,\n user: config.user,\n password: config.password,\n };\n\n // Try to detect DB.\n let conn = null;\n try {\n conn = await mysql2.createConnection(dbConfig);\n await conn.connect();\n const [rows] = await conn.query('SELECT NOW() as timestamp');\n\n const cost = new Date() - starttime;\n console.log(`initdb-ok check db ${config.database} ok, cost=${cost}ms, ${JSON.stringify(rows)}`);\n return;\n } catch (e) {\n if (e.code !== 'ER_BAD_DB_ERROR') {\n throw e;\n }\n } finally {\n if (conn) await conn.end();\n }\n\n // Create DB first.\n let r0 = null;\n try {\n delete dbConfig.database; // Remove the database field to create it.\n conn = await mysql2.createConnection(dbConfig);\n await conn.connect();\n const [result] = await conn.query(`CREATE DATABASE IF NOT EXISTS ${config.database}`);\n r0 = result;\n } catch (e) {\n const err = {name: e.name, message: e.message, stack: e.stack};\n console.log(`initdb-err connect, err=${JSON.stringify(err)}`);\n throw e;\n } finally {\n if (conn) await conn.end();\n }\n\n // Use mysql to create tables for database.\n const [r1] = await mysql.query(`\n CREATE TABLE id_generator (\n id int(20) NOT NULL AUTO_INCREMENT COMMENT '生成的ID',\n phone varchar(32) DEFAULT NULL COMMENT '手机号',\n email varchar(64) DEFAULT NULL COMMENT '用户邮箱',\n uuid varchar(128) DEFAULT NULL COMMENT '其他UUID或ID',\n createUtc datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'ID创建的时间',\n PRIMARY KEY (id),\n UNIQUE KEY by_phone (phone) USING BTREE,\n UNIQUE KEY by_email (email) USING BTREE,\n UNIQUE KEY by_uuid (uuid) USING BTREE\n ) ENGINE=InnoDB AUTO_INCREMENT=1046027 DEFAULT CHARSET=utf8 COMMENT='生成全局唯一自增的ID。'\n `);\n\n const [r2] = await mysql.query(`\n CREATE TABLE rooms (\n id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增的ID',\n roomId varchar(64) NOT NULL COMMENT '房间ID',\n apaasAppId bigint(20) DEFAULT NULL COMMENT '房间所属的aPaaS租户',\n title varchar(64) DEFAULT NULL COMMENT '房间名称或标题',\n category varchar(32) DEFAULT NULL COMMENT '房间标签或类型,例如liveRoom',\n appId varchar(32) DEFAULT NULL COMMENT '房间所属的AppID',\n createBy varchar(64) DEFAULT NULL COMMENT '房间创建者的ID',\n updateBy varchar(64) DEFAULT NULL COMMENT '房间最后更新的用户ID',\n ownBy varchar(64) DEFAULT NULL COMMENT '房间所有者或主播ID',\n createUtc datetime DEFAULT NULL COMMENT '房间创建时间',\n updateUtc datetime DEFAULT NULL COMMENT '房间更新时间',\n removeUtc datetime DEFAULT NULL COMMENT '房间删除时间',\n removed tinyint(4) NOT NULL DEFAULT '0' COMMENT '1表示已经被删除',\n status varchar(32) DEFAULT NULL COMMENT '房间状态',\n subject varchar(64) DEFAULT '' COMMENT '房间主题',\n description varchar(512) DEFAULT '' COMMENT '房间描述',\n cover varchar(512) DEFAULT '' COMMENT '房间封面地址',\n star bigint(20) unsigned DEFAULT '0' COMMENT '点赞数目',\n PRIMARY KEY (id),\n UNIQUE KEY by_roomid (roomId) USING BTREE,\n KEY by_appid (appId) USING BTREE,\n KEY by_apaasAppId (apaasAppId) USING BTREE\n ) ENGINE=InnoDB AUTO_INCREMENT=1001437 DEFAULT CHARSET=utf8\n `);\n\n const [r3] = await mysql.query(`\n CREATE TABLE sessions (\n id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '序号标识',\n sessionId varchar(64) NOT NULL COMMENT '用户的临时会话ID',\n phone varchar(32) DEFAULT NULL COMMENT '用户验证的手机号',\n email varchar(64) DEFAULT NULL COMMENT '用户邮箱',\n code varchar(16) NOT NULL DEFAULT '' COMMENT '发给用户的验证码',\n used int(8) NOT NULL DEFAULT '0' COMMENT '验证次数',\n done int(8) NOT NULL DEFAULT '0' COMMENT '验证成功的次数',\n tag varchar(32) DEFAULT NULL COMMENT '标签,比如deprecated兼容老客户端',\n createUtc datetime NOT NULL COMMENT '创建UTC时间',\n updateUtc datetime NOT NULL COMMENT '更新UTC时间',\n PRIMARY KEY (id),\n UNIQUE KEY by_sessionId (sessionId) USING BTREE\n ) ENGINE=InnoDB AUTO_INCREMENT=46668 DEFAULT CHARSET=utf8 COMMENT='用户验证,图片、短信和邮箱等验证码'\n `);\n\n const [r4] = await mysql.query(`\n CREATE TABLE users (\n userId varchar(64) NOT NULL COMMENT '用户的ID',\n name varchar(128) DEFAULT NULL COMMENT '用户名,空代表新用户',\n phone varchar(32) DEFAULT NULL COMMENT '手机号码',\n email varchar(64) DEFAULT NULL COMMENT '用户邮箱',\n avatar varchar(512) DEFAULT NULL COMMENT '头像地址',\n tag varchar(32) DEFAULT NULL COMMENT '标签,或业务类型,比如trtc,im',\n tag2 varchar(32) DEFAULT NULL COMMENT '标签2,小直播专用,比如mlvb',\n createUtc datetime DEFAULT NULL COMMENT '用户创建的时间',\n updateUtc datetime DEFAULT NULL COMMENT '用户更新的时间',\n loginUtc datetime DEFAULT NULL COMMENT '用户最后登录时间',\n PRIMARY KEY (userId),\n UNIQUE KEY by_phone (phone) USING BTREE,\n UNIQUE KEY by_email (email) USING BTREE\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户信息表'\n `);\n\n const [r5] = await mysql.query(`\n CREATE TABLE users_in_room (\n guestId bigint(20) NOT NULL AUTO_INCREMENT COMMENT '房间的人叫嘉宾,嘉宾ID',\n appId varchar(32) DEFAULT NULL COMMENT '房间所属的AppID',\n roomId varchar(64) DEFAULT NULL COMMENT '用户所在的房间ID',\n userId varchar(64) DEFAULT NULL COMMENT '用户的ID',\n role varchar(32) DEFAULT NULL COMMENT '用户角色 anchor、guest',\n status varchar(32) DEFAULT NULL COMMENT '房间状态',\n createUtc datetime DEFAULT NULL COMMENT '房间创建时间',\n updateUtc datetime DEFAULT NULL COMMENT '房间更新时间',\n PRIMARY KEY (guestId),\n UNIQUE KEY by_roomId_userId (roomId,userId) USING BTREE\n ) ENGINE=InnoDB AUTO_INCREMENT=3079 DEFAULT CHARSET=utf8 COMMENT='房间的用户列表。'\n `);\n\n initialized = true;\n\n const cost = new Date() - starttime;\n console.log(`initdb-ok create ${config.database}, cost=${cost}ms, db=${JSON.stringify(r0)} id_generator=${JSON.stringify(r1)}, rooms=${JSON.stringify(r2)}, sessions=${JSON.stringify(r3)}, users=${JSON.stringify(r4)}, users_in_room=${JSON.stringify(r5)}`);\n}", "function initializeDatabase(databaseName) {\n sql = `DROP DATABASE IF EXISTS ${databaseName};`\n queryReturn(sql, `${databaseName} Removed`)\n sql = `CREATE DATABASE ${databaseName};`\n queryReturn(sql, `${databaseName} Created`)\n sql = `USE ${databaseName};`\n queryReturn(sql, `${databaseName} Initialized`)\n}", "async function initializeDatabase() {\n return new Promise((resolve, reject) => {\n let database = new sqlite3.Database(\"data.sqlite\");\n database.serialize(() => {\n database.all(\"PRAGMA table_info('data')\", (error, rows) => {\n if (rows.some(row => row.name === \"on_notice_from\"))\n database.run(\"drop table [data]\"); // ensure that the on_notice_from (and on_notice_to) columns are removed\n database.run(\"create table if not exists [data] ([council_reference] text primary key, [address] text, [description] text, [info_url] text, [comment_url] text, [date_scraped] text, [date_received] text)\");\n resolve(database);\n });\n });\n });\n}", "function initialise(onSuccess){\n db.connect(function(success){\n if (success){\n createDBTables();\n onSuccess();\n }\n else {\n throw new Error('serverDB: initialise : Couldnt connect to database');\n }\n });\n}", "function initDb() {\n return new Promise((resolve, reject) => {\n console.log('Initializing the database \"' + cfg.database.filename + '\"...');\n\n client = new sqlite3.Database(cfg.database.filename, (error) => {\n if (error) {\n console.error('Error initalizing the database: ', error);\n reject(error);\n }\n resolve(client);\n });\n });\n}", "function initialiseTheGame() {\n databaseModify.create().then(function() {\n databaseModify.userListen();\n userScreen.welcome();\n });\n }", "function initialize() {\n var client = getClient();\n client.connect(() => {\n client.query('CREATE TABLE IF NOT EXISTS Item (ID SERIAL PRIMARY KEY, Name VARCHAR(32) NOT NULL, InsertDate TIMESTAMP NOT NULL);', (err) => {\n console.log('successfully connected to postgres!')\n client.end(); \n });\n });\n}", "async function init () {\n try {\n // create an instance of tag\n if (await dbs.init()) {\n console.log('Created the databases.')\n // tagObj = await Tag.getTagObject(true)\n } else {\n console.log('Databases already created')\n // tagObj = await Tag.getTagObject(false)\n }\n } catch (e) {\n console.error('Errors:', e)\n }\n}", "async connect() {\n const instance = await lowDB(this._adapter);\n this._instance = instance;\n\n // Set the defaults\n await instance.defaults(dbDefaultData).write();\n }", "dbInitialized() {\n this.threads = this.db.getCollection('threads') || this.db.addCollection('threads');\n\n this.postStartCallback();\n }", "async initializeDataLoad(schema) {\n await this.createTargetDatabase(schema);\n }", "function initOneDatabase(db, wipeDesignDocs) {\n return vouchdb.dbEnsureExists(db.name)\n .when(\n function(info) {\n // log(info);\n var secObj = db.secObj || \n {\"admins\": {\"names\": [], \"roles\": []},\n \"members\": {\"names\": [], \"roles\": []}};\n return vouchdb.dbSecurity(secObj, db.name);\n })\n .when(\n function(data) {\n var designDoc = utils.createDesignDoc(db._design);\n if (designDoc) { \n return vouchdb.docUpdate(designDoc, db.name);\n }\n else return VOW.kept(data);\n })\n .when(\n function(data) {\n return VOW.kept(data);\n }); \n}", "async function initialize() {\n const pool = await oracledb.createPool(oracleConfig.sharding);\n oracledb.dbObjectAsPojo = true;\n}", "function init (db) {\n\t db.api = new DoozyApi(db);\n return db;\n\t}", "constructor(db_name=\"PoliticianInfo\"){\r\n\t\tthis.db_name = db_name;\r\n\t\tthis.db_connection = null;\r\n\t}", "async function init() {\n debug('Setting up the database...');\n const dbResponse = await cosmosDBClient.databases.createIfNotExists({\n id: databaseId,\n });\n // eslint-disable-next-line prefer-destructuring\n const database = dbResponse.database;\n debug('Setting up the database...done!');\n debug('Setting up the container...');\n const dataCopScoreCoResponse = await database.containers.createIfNotExists({\n id: dataCopScoreCollectionId,\n });\n const recentDataCopScoreDetailsCoResponse = await database.containers.createIfNotExists({\n id: recentDataCopScoreDetailsCollectionId,\n });\n const alertCoResponse = await database.containers.createIfNotExists({\n id: alertCollectionId,\n });\n const datasetCoResponse = await database.containers.createIfNotExists({\n id: datasetCollectionId,\n });\n const activeAlertTrendCoResponse = await database.containers.createIfNotExists({\n id: activeAlertTrendCollectionId,\n });\n\n // eslint-disable-next-line prefer-destructuring\n dataCopScoreContainer = dataCopScoreCoResponse.container;\n recentDataCopScoreDetailsContainer = recentDataCopScoreDetailsCoResponse.container;\n alertContainer = alertCoResponse.container;\n datasetContainer = datasetCoResponse.container;\n activeAlertTrendContainer = activeAlertTrendCoResponse.container;\n debug('Setting up the container...done!');\n}", "constructor() { this.leerDB(); }", "function init(who){\n console.log(\"init called : \" + count++);\n //open database on device ready\n\n \n if(who == 'student'){\n //Opening Student Profile Database first\n openDataBaseAndCreateTable('student'); //********Database load is ok\n console.log(\"Student page init\");\n }\n else if(who == 'teacher'){\n \n }\n}", "function createDb() {\n db = new sqlite3.Database(':memory:');\n\n // Perform the database operations in a serial manner. That way, we ensure that the User table is created\n // before we start doing inserts.\n db.serialize(function () {\n\n // Create the User table\n db.run(\"CREATE TABLE user (\" +\n \"username TEXT PRIMARY KEY, \" +\n \"name TEXT, \" +\n \"password TEXT\" +\n \")\");\n\n });\n\n}" ]
[ "0.78450817", "0.7554678", "0.75233257", "0.75221646", "0.7464243", "0.7331118", "0.7285826", "0.7265469", "0.72620314", "0.72260076", "0.7220602", "0.7218683", "0.71674615", "0.7147075", "0.71426725", "0.71379924", "0.7110893", "0.70918804", "0.7083366", "0.7068792", "0.7058971", "0.7055633", "0.7050227", "0.70243245", "0.6990728", "0.69763106", "0.6935338", "0.69218373", "0.6910479", "0.68633205", "0.6838247", "0.6828535", "0.68226975", "0.68106496", "0.67963606", "0.6789963", "0.6789305", "0.67801416", "0.67725515", "0.6771477", "0.67705536", "0.6753004", "0.6749743", "0.6749544", "0.673685", "0.6736605", "0.673086", "0.6717804", "0.6694354", "0.66898555", "0.6682049", "0.6676933", "0.6654003", "0.6642556", "0.6613499", "0.66095287", "0.6608604", "0.65954626", "0.65912443", "0.6576412", "0.6566502", "0.6532899", "0.65307486", "0.65261996", "0.65191483", "0.65038157", "0.6500247", "0.6473704", "0.6461011", "0.645204", "0.6433551", "0.64162296", "0.6414908", "0.6408858", "0.6404844", "0.6400512", "0.6374407", "0.6369597", "0.6368607", "0.6353543", "0.6353543", "0.6345108", "0.6330047", "0.6326275", "0.6326073", "0.6320661", "0.6317866", "0.6304986", "0.63026696", "0.629385", "0.6278488", "0.6277988", "0.626876", "0.6263372", "0.6258786", "0.625861", "0.6255313", "0.62512153", "0.62508893", "0.6247092" ]
0.72013354
12
parse the current path
parsePath (url) { let currentPath = url || '/' let paths = currentPath.split('/').filter(item => { return (item != '') }) let nextPathState = [pathNames.dashboard] paths.forEach(p => { console.log(` -> path: `, p) if (!(p === 'dashboard') && (Object.keys(pathNames).includes(p))) { nextPathState.push(pathNames[p]) } }) this.setState({paths: nextPathState}) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parsePath() {\n\t\tvar reversePath = reverseString($location.path()),\n\t\t\tremoveFromFirstSlash = deleteFrom(reversePath, reversePath.indexOf('/')),\n\t\t\trestoredPath = reverseString(removeFromFirstSlash);\n\t\t\n\t\treturn restoredPath;\n\t}", "function extractCurrentPath(path){\r\n\tvar result = \"\";\r\n\tvar parts = path.split(\"/\");\r\n\tif(path.charAt(path.length - 1) == \"/\"){\r\n\t\tfor (var i = 0; i < parts.length-2; i++) {\r\n\t\t\tresult += parts[i] + \"/\";\r\n\t\t}\r\n\t}else{\r\n\t\tfor (var i = 0; i < parts.length-1; i++) {\r\n\t\t\tresult += parts[i] + \"/\";\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n}", "get path() {\n return parse(this).pathname\n }", "function getCurrentPathName() {\n pathName = window.location.pathname;\n return pathName;\n }", "parsePath(url) {\n\t\tvar ret = \"\";\n\n\t\t// In case the url has a protocol, remove it.\n\t\tvar protocolSplit = url.split(\"://\");\n\t\tvar withoutProtocol;\n\t\tif (protocolSplit.length > 1) {\n\t\t\twithoutProtocol = protocolSplit[1];\n\t\t} else {\n\t\t\twithoutProtocol = protocolSplit[0];\n\t\t}\n\n\t\tvar host = withoutProtocol.split(\"?\")[0];\n\t\tvar pathIndex = host.indexOf(\"/\");\n\t\tif (pathIndex !== -1) {\n\t\t\tret = host.substring(pathIndex, host.length);\n\t\t} else {\n\t\t\tret = \"/\";\n\t\t}\n\n\t\treturn ret;\n\t}", "function getPath() {\n return currentPathQuery.split('?')[0];\n }", "function parsePath(pathname) {\n if (path.parse) {\n return path.parse(pathname);\n } else {\n let parsed = {\n dir: path.dirname(pathname),\n base: path.basename(pathname),\n ext: path.extname(pathname),\n };\n parsed.name = parsed.base.substring(0, parsed.base.length - parsed.ext.length);\n return parsed;\n }\n}", "function get_current_code_path(){\n\tvar id = $(\"#file_name_nav\").find(\"span.selected\").attr(\"id\");\n\tid = id.replace(\"t_\", \"\");\n\treturn full_path($(\"#\"+id));\n}", "getUserPath(currentLine, currentPosition) {\r\n var lastQuote = -1;\r\n var lastWhiteSpace = -1;\r\n for (var i = 0; i < currentPosition; i++) {\r\n var c = currentLine[i];\r\n // skip next character if escaped\r\n if (c == \"\\\\\") {\r\n i++;\r\n continue;\r\n }\r\n // handle space\r\n if (c == \" \" || c == \"\\t\") {\r\n lastWhiteSpace = i;\r\n continue;\r\n }\r\n // handle quotes\r\n if (c == \"'\" || c == '\"' || c == \"`\") {\r\n lastQuote = i;\r\n }\r\n }\r\n var startPosition = (lastQuote != -1) ? lastQuote : lastWhiteSpace;\r\n return currentLine.substring(startPosition + 1, currentPosition);\r\n }", "function parsePath(p) {\n var extname = path.extname(p);\n return {\n dirname: path.dirname(p),\n basename: path.basename(p, extname),\n extname: extname\n };\n}", "function parsePath(scope, path, origPath) {\n trace('parsePath: ' + path);\n var m = path.match(/^([$a-zA-Z][a-zA-Z0-9_-]*)\\.(.*)$/);\n if (m) {\n var namespace = m[1];\n var rest = m[2];\n\n trace('parsePath: ' + namespace + ', ' + rest);\n return parsePath(scope[namespace], rest, origPath);\n } else {\n return parseLeaf(scope, path, origPath);\n }\n }", "get path()\t\t{ return this.match[7] || \"\" }", "function getParsedPath(url) {\n return _path.default.parse(_url.default.parse(url).pathname || ``);\n}", "getPath() {\n var path = this.decodeFragment(this.location.pathname + this.getSearch()).slice(this.root.length - 1);\n return path.charAt(0) === '/' ? path.slice(1) : path;\n }", "getCurrentDirectory(fileName, insertedPath) {\r\n var currentDir = path.parse(fileName).dir || '/';\r\n var workspacePath = vs.workspace.rootPath;\r\n // based on the project root\r\n if (insertedPath.startsWith('/') && workspacePath) {\r\n currentDir = vs.workspace.rootPath;\r\n }\r\n return path.resolve(currentDir);\r\n }", "get path() {}", "currentRoute() {\n return window.location.pathname.replace(/\\.[^/.]+$/, '');\n }", "getCurrentPath(){\n const { match, location, history } = this.props // retrieves the static propTypes\n this.setState({location: location.pathname}) // sets the state with the location pathname\n this.getLastNumberOfString(this.state.location)\n //console.log(this.state.location);\n }", "parseUrl () {\r\n this.currentIndex = this.getParameter(\"index\");\r\n this.currentFolder = this.findSubnavFolderByIndex(this.currentIndex);\r\n\r\n const page = this.getParameter(\"page\");\r\n\r\n if (this.currentFolder) {\r\n const target = document.querySelector(`#${page}`);\r\n\r\n this.toggleActivePages(target);\r\n this.toggleActiveSubnav(this.currentIndex);\r\n } else {\r\n const target = document.querySelector(\"#flight-ops-home\");\r\n\r\n this.toggleActivePages(target);\r\n this.toggleActiveSubnav(0);\r\n }\r\n }", "GetCurrentRelativePath() {\n return decodeURI(window.location.pathname.substr(1));\n }", "function process_page_path(page){\n\tvar str = page.slice(href_initial_length);\n\tstr = str.split('/').join('=>');\n\tif(str === '')\n\t\treturn 'root';\n\telse\n\t\treturn str;\n}", "function parse (path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n key = formatSubPath(key);\n if (key === false) {\n return false\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote () {\n var nextChar = path[index + 1];\n if ((mode === IN_SINGLE_QUOTE && nextChar === \"'\") ||\n (mode === IN_DOUBLE_QUOTE && nextChar === '\"')) {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined\n ? c\n : newChar;\n if (action() === false) {\n return\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys\n }\n }\n}", "getRouteCurrent() {\n const stringRouteCurrentFull = String(document.location);\n const arrayRouteCurrentParts = stringRouteCurrentFull.split('/');\n return arrayRouteCurrentParts[arrayRouteCurrentParts.length - 1];\n }", "function parseCd (path, cd) {\n\n cdA = cd.split(\"/\");\n\n console.log(cdA);\n\n for (x in cdA) {\n\n console.log(cdA[x]+'\\n');\n\n if (cdA[x] == '..') {\n\n return;\n\n // saw = 0;\n\n // while (saw == 0){\n\n // if (path[-1] == '/') saw = 1;\n\n // path = path.slice(0, -1);\n\n // }\n\n }\n\n\n\n else path += (cdA[x] + '/');\n\n }\n\n\n\n return path;\n\n}", "function parse (path: Path): ?Array<string> {\n const keys: Array<string> = []\n let index: number = -1\n let mode: number = BEFORE_PATH\n let subPathDepth: number = 0\n let c: ?string\n let key: any\n let newChar: any\n let type: string\n let transition: number\n let action: Function\n let typeMap: any\n const actions: Array<Function> = []\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key)\n key = undefined\n }\n }\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar\n } else {\n key += newChar\n }\n }\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]()\n subPathDepth++\n }\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--\n mode = IN_SUB_PATH\n actions[APPEND]()\n } else {\n subPathDepth = 0\n if (key === undefined) { return false }\n key = formatSubPath(key)\n if (key === false) {\n return false\n } else {\n actions[PUSH]()\n }\n }\n }\n\n function maybeUnescapeQuote (): ?boolean {\n const nextChar: string = path[index + 1]\n if ((mode === IN_SINGLE_QUOTE && nextChar === \"'\") ||\n (mode === IN_DOUBLE_QUOTE && nextChar === '\"')) {\n index++\n newChar = '\\\\' + nextChar\n actions[APPEND]()\n return true\n }\n }\n\n while (mode !== null) {\n index++\n c = path[index]\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue\n }\n\n type = getPathCharType(c)\n typeMap = pathStateMachine[mode]\n transition = typeMap[type] || typeMap['else'] || ERROR\n\n if (transition === ERROR) {\n return // parse error\n }\n\n mode = transition[0]\n action = actions[transition[1]]\n if (action) {\n newChar = transition[2]\n newChar = newChar === undefined\n ? c\n : newChar\n if (action() === false) {\n return\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys\n }\n }\n}\n\nexport type PathValue = PathValueObject | PathValueArray | Function | string | number | boolean | null\nexport type PathValueObject = { [key: string]: PathValue }\nexport type PathValueArray = Array<PathValue>\n\nexport default class I18nPath {\n _cache: Object\n\n constructor () {\n this._cache = Object.create(null)\n }\n\n /**\n * External parse that check for a cache hit first\n */\n parsePath (path: Path): Array<string> {\n let hit: ?Array<string> = this._cache[path]\n if (!hit) {\n hit = parse(path)\n if (hit) {\n this._cache[path] = hit\n }\n }\n return hit || []\n }\n\n /**\n * Get path value from path string\n */\n getPathValue (obj: mixed, path: Path): PathValue {\n if (!isObject(obj)) { return null }\n\n const paths: Array<string> = this.parsePath(path)\n if (paths.length === 0) {\n return null\n } else {\n const length: number = paths.length\n let last: any = obj\n let i: number = 0\n while (i < length) {\n const value: any = last[paths[i]]\n if (value === undefined || value === null) {\n return null\n }\n last = value\n i++\n }\n\n return last\n }\n }\n}", "function parseProcessPath(path) {\n\t\tvar dot;\n\t\tif(!angular.isString(path)\n\t\t\t|| path.length < 1\n\t\t\t|| path[0] == '.'\n\t\t\t|| (dot = path.lastIndexOf('.')) < 1) {\n\t\t\tthrow \"$network: Invalid process path: \" + path;\n\t\t}\n\t\treturn {\n\t\t\tprocess: path.substr(0, dot).replace(/^[\\s\"'\\[]+|[\\s\"'\\]]+$/g, ''),\n\t\t\tport: path.substr(dot + 1)\n\t\t};\n\t}", "function currentDir() {\n var s = WScript.scriptFullName\n s = s.substring(0, s.lastIndexOf(\"\\\\\") + 1)\n return s\n}", "function processPath (path, rootNodeName, form) {\n var newPath, parsed;\n try {\n parsed = form.xpath.parse(path);\n } catch (ex) {\n return path;\n }\n if (!(parsed instanceof form.xpath.models.XPathPathExpr ||\n parsed instanceof form.xpath.models.HashtagExpr)) {\n return path;\n }\n\n if (parsed.initial_context === form.xpath.models.XPathInitialContextEnum.RELATIVE) {\n parsed.steps.splice(0, 0, form.xpath.models.XPathStep({axis: \"child\", test: rootNodeName}));\n parsed.initial_context = form.xpath.models.XPathInitialContextEnum.ROOT;\n }\n newPath = parsed.toHashtag();\n return newPath;\n }", "function parse$1(path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n if (key === undefined) {return false;}\n key = formatSubPath(key);\n if (key === false) {\n return false;\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote() {\n var nextChar = path[index + 1];\n if (mode === IN_SINGLE_QUOTE && nextChar === \"'\" ||\n mode === IN_DOUBLE_QUOTE && nextChar === '\"') {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true;\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue;\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return; // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined ?\n c :\n newChar;\n if (action() === false) {\n return;\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys;\n }\n }\n}", "function parse$1(path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n if (key === undefined) {return false;}\n key = formatSubPath(key);\n if (key === false) {\n return false;\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote() {\n var nextChar = path[index + 1];\n if (mode === IN_SINGLE_QUOTE && nextChar === \"'\" ||\n mode === IN_DOUBLE_QUOTE && nextChar === '\"') {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true;\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue;\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return; // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined ?\n c :\n newChar;\n if (action() === false) {\n return;\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys;\n }\n }\n}", "function parse$1(path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n if (key === undefined) {return false;}\n key = formatSubPath(key);\n if (key === false) {\n return false;\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote() {\n var nextChar = path[index + 1];\n if (mode === IN_SINGLE_QUOTE && nextChar === \"'\" ||\n mode === IN_DOUBLE_QUOTE && nextChar === '\"') {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true;\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue;\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return; // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined ?\n c :\n newChar;\n if (action() === false) {\n return;\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys;\n }\n }\n}", "get dir(){\r\n\t\treturn path2lst(this.path).slice(0, -1).join('/') }", "function getContextPath() {\n\treturn window.location.pathname.substring(0, window.location.pathname.indexOf(\"/\",2));\n}", "function parseLocalPath(path) {\n var obj = {\n filename: '',\n directory: '',\n basename: '',\n extension: ''\n },\n sep = getPathSep(path),\n parts = path.split(sep),\n lastPart = parts.pop(),\n // try to match typical extensions but reject directory names with dots\n extRxp = /\\.([a-z][a-z0-9]*)$/i,\n extMatch = extRxp.test(lastPart) ? extRxp.exec(lastPart)[0] : '';\n\n if (extMatch || lastPart.includes('*')) {\n obj.filename = lastPart;\n obj.extension = extMatch ? extMatch.slice(1) : '';\n obj.basename = lastPart.slice(0, lastPart.length - extMatch.length);\n obj.directory = parts.join(sep);\n } else if (!lastPart) { // path ends with separator\n obj.directory = parts.join(sep);\n } else {\n obj.directory = path;\n }\n return obj;\n }", "function parse$1 (path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n if (key === undefined) { return false }\n key = formatSubPath(key);\n if (key === false) {\n return false\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote () {\n var nextChar = path[index + 1];\n if ((mode === IN_SINGLE_QUOTE && nextChar === \"'\") ||\n (mode === IN_DOUBLE_QUOTE && nextChar === '\"')) {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined\n ? c\n : newChar;\n if (action() === false) {\n return\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys\n }\n }\n}", "function parse$1 (path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n if (key === undefined) { return false }\n key = formatSubPath(key);\n if (key === false) {\n return false\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote () {\n var nextChar = path[index + 1];\n if ((mode === IN_SINGLE_QUOTE && nextChar === \"'\") ||\n (mode === IN_DOUBLE_QUOTE && nextChar === '\"')) {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined\n ? c\n : newChar;\n if (action() === false) {\n return\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys\n }\n }\n}", "function parse$1 (path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n if (key === undefined) { return false }\n key = formatSubPath(key);\n if (key === false) {\n return false\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote () {\n var nextChar = path[index + 1];\n if ((mode === IN_SINGLE_QUOTE && nextChar === \"'\") ||\n (mode === IN_DOUBLE_QUOTE && nextChar === '\"')) {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined\n ? c\n : newChar;\n if (action() === false) {\n return\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys\n }\n }\n}", "function parse$1 (path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n if (key === undefined) { return false }\n key = formatSubPath(key);\n if (key === false) {\n return false\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote () {\n var nextChar = path[index + 1];\n if ((mode === IN_SINGLE_QUOTE && nextChar === \"'\") ||\n (mode === IN_DOUBLE_QUOTE && nextChar === '\"')) {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined\n ? c\n : newChar;\n if (action() === false) {\n return\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys\n }\n }\n}", "function parse$1 (path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n if (key === undefined) { return false }\n key = formatSubPath(key);\n if (key === false) {\n return false\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote () {\n var nextChar = path[index + 1];\n if ((mode === IN_SINGLE_QUOTE && nextChar === \"'\") ||\n (mode === IN_DOUBLE_QUOTE && nextChar === '\"')) {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined\n ? c\n : newChar;\n if (action() === false) {\n return\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys\n }\n }\n}", "function parse$1 (path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n if (key === undefined) { return false }\n key = formatSubPath(key);\n if (key === false) {\n return false\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote () {\n var nextChar = path[index + 1];\n if ((mode === IN_SINGLE_QUOTE && nextChar === \"'\") ||\n (mode === IN_DOUBLE_QUOTE && nextChar === '\"')) {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined\n ? c\n : newChar;\n if (action() === false) {\n return\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys\n }\n }\n}", "function parse$1 (path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n if (key === undefined) { return false }\n key = formatSubPath(key);\n if (key === false) {\n return false\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote () {\n var nextChar = path[index + 1];\n if ((mode === IN_SINGLE_QUOTE && nextChar === \"'\") ||\n (mode === IN_DOUBLE_QUOTE && nextChar === '\"')) {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined\n ? c\n : newChar;\n if (action() === false) {\n return\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys\n }\n }\n}", "function parse$1 (path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n if (key === undefined) { return false }\n key = formatSubPath(key);\n if (key === false) {\n return false\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote () {\n var nextChar = path[index + 1];\n if ((mode === IN_SINGLE_QUOTE && nextChar === \"'\") ||\n (mode === IN_DOUBLE_QUOTE && nextChar === '\"')) {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined\n ? c\n : newChar;\n if (action() === false) {\n return\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys\n }\n }\n}", "function getContextPath() {\n\treturn window.location.pathname.substring(0, window.location.pathname.indexOf(\"/\", 2));\n}", "function parseUrlPath( urlPath ){\n\tvar relPath, link, root, fullPath;\n\t\n\tvar mr= urlPath.match( /^\\/([^\\/\\*]+\\/\\*)\\/(.*)$/ );\n\tif( !mr ){\n\t\trelPath= decodeURIComponent( urlPath );\n\t\tlink=\"\";\n\t\troot= __dirname;\n\t\tfullPath= path.normalize( root+\"/\"+ relPath );\n\t}\n\telse {\n\t\tlink= mr[1];\n\t\tif( !projectData[link] ) return Error( \"link unfound, \" + link );\n\t\t\n\t\trelPath= (mr[2]||\"/\").replace(/(^|\\/)\\*\\*(?=\\/|$)/g, \"$1..\");\t//decode \"../\"\n\t\trelPath= decodeURIComponent( relPath );\n\t\t\n\t\troot= path.dirname( path.normalize( __dirname+\"/\"+ projectData[link].link ));\n\t\t\n\t\tfullPath= path.normalize( root+\"/\"+ relPath );\n\t\tif( ! config.extension_allow_ouside_link && fullPath.indexOf(root)!==0 )return Error( \"outside link path, \" + link );\n\t}\n\t\n\tif( ! config.extension_allow_ouside_root && fullPath.indexOf(__dirname)!==0 )return Error( \"outside root path\" );\n\t\n\treturn [ relPath, link, root, fullPath ];\n}", "function parse$1 (path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n key = formatSubPath(key);\n if (key === false) {\n return false\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote () {\n var nextChar = path[index + 1];\n if ((mode === IN_SINGLE_QUOTE && nextChar === \"'\") ||\n (mode === IN_DOUBLE_QUOTE && nextChar === '\"')) {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined\n ? c\n : newChar;\n if (action() === false) {\n return\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys\n }\n }\n}", "function parse$1 (path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n key = formatSubPath(key);\n if (key === false) {\n return false\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote () {\n var nextChar = path[index + 1];\n if ((mode === IN_SINGLE_QUOTE && nextChar === \"'\") ||\n (mode === IN_DOUBLE_QUOTE && nextChar === '\"')) {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined\n ? c\n : newChar;\n if (action() === false) {\n return\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys\n }\n }\n}", "function parse$1 (path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n key = formatSubPath(key);\n if (key === false) {\n return false\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote () {\n var nextChar = path[index + 1];\n if ((mode === IN_SINGLE_QUOTE && nextChar === \"'\") ||\n (mode === IN_DOUBLE_QUOTE && nextChar === '\"')) {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined\n ? c\n : newChar;\n if (action() === false) {\n return\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys\n }\n }\n}", "function parse$1 (path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n key = formatSubPath(key);\n if (key === false) {\n return false\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote () {\n var nextChar = path[index + 1];\n if ((mode === IN_SINGLE_QUOTE && nextChar === \"'\") ||\n (mode === IN_DOUBLE_QUOTE && nextChar === '\"')) {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined\n ? c\n : newChar;\n if (action() === false) {\n return\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys\n }\n }\n}", "function parse$1 (path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n key = formatSubPath(key);\n if (key === false) {\n return false\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote () {\n var nextChar = path[index + 1];\n if ((mode === IN_SINGLE_QUOTE && nextChar === \"'\") ||\n (mode === IN_DOUBLE_QUOTE && nextChar === '\"')) {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined\n ? c\n : newChar;\n if (action() === false) {\n return\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys\n }\n }\n}", "function parse$1(path) {\n var keys = [];\n var index = -1;\n var mode = BEFORE_PATH;\n var subPathDepth = 0;\n var c;\n var key;\n var newChar;\n var type;\n var transition;\n var action;\n var typeMap;\n var actions = [];\n\n actions[PUSH] = function () {\n if (key !== undefined) {\n keys.push(key);\n key = undefined;\n }\n };\n\n actions[APPEND] = function () {\n if (key === undefined) {\n key = newChar;\n } else {\n key += newChar;\n }\n };\n\n actions[INC_SUB_PATH_DEPTH] = function () {\n actions[APPEND]();\n subPathDepth++;\n };\n\n actions[PUSH_SUB_PATH] = function () {\n if (subPathDepth > 0) {\n subPathDepth--;\n mode = IN_SUB_PATH;\n actions[APPEND]();\n } else {\n subPathDepth = 0;\n key = formatSubPath(key);\n\n if (key === false) {\n return false;\n } else {\n actions[PUSH]();\n }\n }\n };\n\n function maybeUnescapeQuote() {\n var nextChar = path[index + 1];\n\n if (mode === IN_SINGLE_QUOTE && nextChar === \"'\" || mode === IN_DOUBLE_QUOTE && nextChar === '\"') {\n index++;\n newChar = '\\\\' + nextChar;\n actions[APPEND]();\n return true;\n }\n }\n\n while (mode !== null) {\n index++;\n c = path[index];\n\n if (c === '\\\\' && maybeUnescapeQuote()) {\n continue;\n }\n\n type = getPathCharType(c);\n typeMap = pathStateMachine[mode];\n transition = typeMap[type] || typeMap['else'] || ERROR;\n\n if (transition === ERROR) {\n return; // parse error\n }\n\n mode = transition[0];\n action = actions[transition[1]];\n\n if (action) {\n newChar = transition[2];\n newChar = newChar === undefined ? c : newChar;\n\n if (action() === false) {\n return;\n }\n }\n\n if (mode === AFTER_PATH) {\n return keys;\n }\n }\n}", "getCurrentRoute () {\n return location.href.split('#')[1];\n }", "function getPath() {\n\t\tvar path = window.location.href;\n\t\treturn path.substring(0, path.lastIndexOf(\"/\")) + \"/\";\n\t}", "get path(){ \r\n\t\treturn (this.__order \r\n\t\t\t\t|| this.resolveStarPath(this.location))[this.at()] }", "function getPaths()\n{\n var paths = {};\n\n var prefix = new URL(URLprefix);\n var url = window.location.pathname;\n\n if (url.startsWith(prefix.pathname)) {\n\n path = url.substr(prefix.pathname.length).split(\"/\");\n paths['current'] = path.shift();\n if (paths['current'] == \"master\") {\n paths['current'] = \"latest\";\n };\n paths['page'] = path.join(\"/\");\n }\n else {\n console.log(\"Unexpected hosting URL!\");\n }\n\n return paths;\n\n}", "function GetCurentFileName()\n{\n var pagePathName = window.location.pathname;\n var lastPathSegment = pagePathName.substr(pagePathName.lastIndexOf('/') + 1);\n lastPathSegment = lastPathSegment.substr(0, lastPathSegment.lastIndexOf('.'));\n if (lastPathSegment == \"\") lastPathSegment = \"index\";\n return lastPathSegment;\n}", "function parseCurrentUrlParams () {\n\t\tme.urlParams = me.paramsToObject(window.location.search.substr(1));\n\t}", "_readPath(token) {\n switch (token.type) {\n // Forward path\n case '!':\n return this._readForwardPath;\n // Backward path\n case '^':\n return this._readBackwardPath;\n // Not a path; resume reading where we left off\n default:\n const stack = this._contextStack,\n parent = stack.length && stack[stack.length - 1];\n // If we were reading a list item, we still need to output it\n if (parent && parent.type === 'item') {\n // The list item is the remaining subejct after reading the path\n const item = this._subject;\n // Switch back to the context of the list\n this._restoreContext('item', token);\n // Output the list item\n this._emit(this._subject, this.RDF_FIRST, item, this._graph);\n }\n return this._afterPath(token);\n }\n }", "fullpathPosix() {\n if (this.#fullpathPosix !== undefined)\n return this.#fullpathPosix;\n if (this.sep === '/')\n return (this.#fullpathPosix = this.fullpath());\n if (!this.parent) {\n const p = this.fullpath().replace(/\\\\/g, '/');\n if (/^[a-z]:\\//i.test(p)) {\n return (this.#fullpathPosix = `//?/${p}`);\n }\n else {\n return (this.#fullpathPosix = p);\n }\n }\n const p = this.parent;\n const pfpp = p.fullpathPosix();\n const fpp = pfpp + (!pfpp || !p.parent ? '' : '/') + this.name;\n return (this.#fullpathPosix = fpp);\n }", "_getPathFromUrl () {\n return window.location.toString().split(/[?#]/)[0]\n }", "_readPath(token) {\n switch (token.type) {\n // Forward path\n case '!':\n return this._readForwardPath;\n // Backward path\n\n case '^':\n return this._readBackwardPath;\n // Not a path; resume reading where we left off\n\n default:\n var stack = this._contextStack,\n parent = stack.length && stack[stack.length - 1]; // If we were reading a list item, we still need to output it\n\n if (parent && parent.type === 'item') {\n // The list item is the remaining subejct after reading the path\n var item = this._subject; // Switch back to the context of the list\n\n this._restoreContext(); // Output the list item\n\n\n this._emit(this._subject, this.RDF_FIRST, item, this._graph);\n }\n\n return this._afterPath(token);\n }\n }", "function getCurrentPage(traceThis = true) {\n\n\t\tif (traceThis) {\n\n\t\t\tlogTrace('invoking getCurrentPage()');\n\t\t}\n\n\t\t// remove trailing slash\n\t\tvar result = window.location.pathname.replace(/\\/$/, '');\n\n\t\treturn result;\n\t}", "function parsePath(path) {\n var m = path.split(\"/\")[0], p = modulePrefixes[m];\n if (!endsWith(path, \".js\")) path += \".js\";\n return (p || lib) + \"/\" + path;\n }", "function splitPath(p) {\n if (typeof p === 'string') {\n return splitPath({'path' : p});\n }\n\n var a = p.path.split(\"/\");\n p.name = a.pop();\n // console.log(a);\n p.cpath = a.join(\"/\");\n // a.shift();\n // console.log(a);\n p.topname = a.shift(); // get the name of the top dir\n // console.log(a);\n a.unshift(\"\");\n // console.log(a);\n p.cpath1 = a.join(\"/\"); // remove the topdir\n\n var e = p.name.split(\".\");\n if (e.length < 2) {\n p.ext = \"\";\n p.bname = p.name;\n } else {\n p.ext = e.pop();\n p.bname = e.join(\".\");\n }\n return p;\n}", "function loadPath() {\n const currentPath = (window.location.pathname);\n \n pages.forEach(function (page) {\n page.classList.remove('active');\n });\n \n if (currentPath === '/' || currentPath === '/currentplanet') {\n console.log(window.location.pathname);\n const currentPlanet = document.getElementById('currentplanet');\n currentPlanet.classList.add('active');\n } else if (currentPath === '/solarsystem') {\n const solarSystem = document.getElementById('solarsystem');\n solarSystem.classList.add('active');\n } else if (currentPath === '/travellog') {\n const travelLog = document.getElementById('travellog');\n travelLog.classList.add('active');\n }\n }", "function showCurrentPath(d) {\n if (d == tmRoot)\n $('#path_label').text(getPath(d));\n else\n $('#path_label').text($('#path_label').text() + \"/\" + getPath(d));\n}", "function parsePath(path) {\n const paths = path.split('.');\n return paths.length > 1 ? paths : [paths[0]];\n}", "get pathname()\t{ return \"\" + this.path + this.file}", "function currentJobTabPath() {\r\n var tst = null ;\r\n var elt = xpathFirst('.//div[contains(@class, \"path_on\")]//a', innerPageElt);\r\n// if (!elt) DEBUG(' JOB TAB - path - !elt path not found - ');\r\n// tst = (elt.getAttribute('onclick').match(/ 0 /) ); // returns 0\r\n//new_ -- gets matched literally as a string, as is.\r\n//\\d -- means match any and only digits\r\n//+ -- means to match thoose digits one or more times\r\n//$ -- this means the end of the string, so with the pattern pieces before it, it must not have anything but \"new_\" and some numbers, then the end of the string (string being the ID attribute)\r\n\r\n tst = parseInt(elt.getAttribute('onclick').split('ExpertMapController.changePath(')[1].split(');') ) ; // returns 0,\r\n// DEBUG(' JOB TAB - path - returning tst =' + tst + '=');\r\n if (tst==null) DEBUG(' JOB TAB - path - !tst path not found - ');\r\n if (!elt || tst==null ) {\r\n DEBUG(' JOB TAB - path - not found RETURNING -1 no elt or tst');\r\n return -1; }\r\n// return parseInt(elt.getAttribute('onclick').split('ExpertMapController.changePath(')[1].split(');') ) ; // returns 0,\r\n return tst;\r\n}", "function go(path){\n var str=\"\";\n var ppp_length=path.length;\n var now_path = path.substr(5,4096);\n if(ppp_length<=8)\n str='/';\n window.document.getElementById('now_path').innerHTML = '<b>'+showText(191)+'&nbsp;'+str+now_path+'</b>';\n getContent('DirList','/cgi-bin/firmwareDir.cgi?'+path);\n parent.calcHeight('parent');\n hiddenBackgroundImage('wait_message');\n}", "get path() {\n return (this.parent || this).fullpath();\n }", "function get_current_page_filename()\n{\n let path = window.location.pathname;\n let page = path.split(\"/\").pop();\n return page;\n}", "function recuperaPath(url)\n{\n\ttry {\n\t\tvar result = url.match(/[-_\\w]+[.][\\w]+$/i)[0];\n\t}\n\tcatch(err) {\n\t\t//console.log(err);\n\t\tvar result = \" \";\n\t}\n\treturn result;\n}", "function handlerFromPath (path) {\n return path.replace(/^\\//, '').split('/')[0].split('?')[0].split('#')[0]\n}", "getCurrentTab() {\n return window.location.pathname.split('/')[2];\n }", "function getCurrentId() {\n return document.location.pathname.split(\"/\").pop();\n}", "constructor (pathname) {\n\n // call the constructor without a path and it uses the current working directory.\n this[pathSymbol] = pathname || process.cwd();\n this.dirname = path.dirname(this.pathname);\n this.basename = path.basename(this.pathname);\n this.F_OK = 0;\n this.X_OK = 1\n this.R_OK = 4\n this.W_OK = 2\n }", "function getPath(){\n\t\treturn this.path;\n\t}", "function getHandler() {\n\t\t\tvar json,\n\t\t\t\tre = new RegExp('//|\\/', 'gim'),\n\t\t\t\treDBLSL = new RegExp('\\/\\/', 'gim'),\n\t\t\t\tpathArr;\n\n\t\t\tsys.basePath = $.cookie('cj_dir') || (opts.baseRelPath.length > 0 ? opts.baseRelPath[0] : null);\n\n\t\t\t// need to set the basePath based on cookie (if valid) or the opts.baseRelPath\n\t\t\tif (sys.basePath && sys.basePath.indexOf(opts.baseRelPath[0]) > 0) {\n\t\t\t\t// the path is valid, but we need to loop through it to populate our path object\n\t\t\t\tsys.basePath = sys.basePath.length > 1 ? sys.basePath.substring(1, sys.basePath.length - 1) : '/';\n\t\t\t\tpathArr = sys.basePath.split(re);\n\t\t\t\t$.each(pathArr, function(a, b) {\n\t\t\t\t\topts.baseRelPath.push(opts.baseRelPath[opts.baseRelPath.length - 1] + b + '/');\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tsys.basePath = opts.baseRelPath[0];\n\t\t\t}\n\n\t\t\tsys.currentPathIdx = opts.baseRelPath.length - 1;\n\t\t\tsys.basePath = opts.baseRelPath[sys.currentPathIdx];\n\n\t\t\tif (sys.debug) {\n\t\t\t\tconsole.log('sys.basePath: ' + sys.basePath);\n\t\t\t}\n\n\t\t\tif (!sys.basePath) {\n\t\t\t\t// if either path is invalid, then make sure the cookie get's removed.\n\t\t\t\t$.cookie('cj_dir', null, {\n\t\t\t\t\texpires: -1,\n\t\t\t\t\tpath: sys.basePath\n\t\t\t\t});\n\t\t\t\tthrow('Oops! There was a problem\\n\\nThe initial path is not valid (' + sys.basePath + ').');\n\t\t\t} else {\n\n\t\t\t\tjson = $.parseJSON(\n\t\t\t\t$.ajax({\n\t\t\t\t\ttype: 'post',\n\t\t\t\t\turl: 'assets/engines/' + opts.engine + '/' + opts.handler,\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tmethod: 'isHandlerReady',\n\t\t\t\t\t\treturnFormat: 'json',\n\t\t\t\t\t\tdirPath: window.escape(sys.basePath), // validates the initial directory path\n\t\t\t\t\t\ttimeOut: parseInt(opts.timeOut, 10),\n\t\t\t\t\t\tversion: sys.version\n\t\t\t\t\t},\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tasync: true,\n\t\t\t\t\tsuccess: function (data) {\n\t\t\t\t\t\tif (typeof data !== 'object' || typeof data.error !== 'boolean' || data.error) {\n\t\t\t\t\t\t\tif (sys.debug) {\n\t\t\t\t\t\t\t\tconsole.log(data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthrow('Oops! There was a problem\\n\\nThe handler engine did not respond properly during initialization.');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsetup();\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\terror: function (err) {\n\t\t\t\t\t\tif (sys.debug) {\n\t\t\t\t\t\t\tconsole.log(err.responseText);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthrow('Oops! There was a problem\\n\\nThe handler engine did not respond properly during initialization.');\n\t\t\t\t\t}\n\t\t\t\t}).responseText || null);\n\t\t\t}\n\t\t}", "static _materializePath(path) {\n let parts = path.split('.');\n let leaf = parts.slice(-1);\n //dereference the parent path so that its materialized.\n let parent_path = ApplicationState._dereferencePath(parts.slice(0, -1).join('.'));\n return parent_path + '.' + leaf;\n }", "function currentRoute() {\n const path = $window.location.pathname;\n const pathSegments = path.slice(1).split('/');\n const params = queryString.parse($window.location.search);\n\n let route;\n switch (pathSegments[0]) {\n case 'a':\n route = 'annotation';\n params.id = pathSegments[1] || '';\n break;\n case 'stream':\n route = 'stream';\n break;\n default:\n route = 'sidebar';\n break;\n }\n\n return { route, params };\n }", "static dir(path) {\n const n = path.lastIndexOf(\"/\");\n return path.substring(0, n + 1);\n }", "static _getSpaceRoot(){\n return process.cwd(); //path.dirname(module.parent.paths[0])\n }", "function updateActivePath(path){\r\n\t\tg_activePath = path;\r\n\t\tg_objWrapper.find(\".uc-assets-activepath .uc-pathname\").text(\"..\"+path);\r\n\t}", "function parent(path) {\n\t if (path.length == 0) {\n\t return null;\n\t }\n\t var index = path.lastIndexOf('/');\n\t if (index === -1) {\n\t return '';\n\t }\n\t var newPath = path.slice(0, index);\n\t return newPath;\n\t}", "function getQuery() {\n return currentPathQuery.split('?')[1];\n }", "function parsePath (pathstr, fileScope) {\n if (!pathstr)\n return [ [ ] ];\n var pathMatch;\n var path = [];\n var offset = 0;\n while (\n offset < pathstr.length\n && (pathMatch = Patterns.word.exec (pathstr.slice (offset)))\n ) {\n if (!pathMatch[0]) {\n if (!pathMatch.length)\n path.push ([]);\n break;\n }\n offset += pathMatch[0].length;\n\n var fragName = pathMatch[2];\n if (fragName[0] == '`') {\n path.push ([\n pathMatch[1],\n fragName\n .slice (1, -1)\n .replace (/([^\\\\](?:\\\\\\\\)*)\\\\`/g, function (substr, group) {\n return group.replace ('\\\\\\\\', '\\\\') + '`';\n })\n ]);\n continue;\n }\n if (fragName[0] != '[') {\n var delimit = pathMatch[1];\n if (delimit == ':')\n delimit = '/';\n path.push ([ delimit, fragName ]);\n continue;\n }\n\n // Symbol\n path.push ((function parseSymbol (symbolName) {\n var symbolPath = [];\n var symbolMatch;\n var symbolRegex = new RegExp (Patterns.word);\n var symbolOffset = 0;\n while (\n symbolOffset < symbolName.length\n && (symbolMatch = symbolRegex.exec (symbolName.slice (symbolOffset)))\n ) {\n if (!symbolMatch[0])\n break;\n symbolOffset += symbolMatch[0].length;\n var symbolFrag = symbolMatch[2];\n\n if (symbolFrag[0] == '[') {\n // recurse!\n var innerLevel = parseSymbol (symbolFrag.slice (1, -1));\n if (innerLevel[0] === undefined)\n innerLevel[0] = '.';\n symbolPath.push (innerLevel);\n continue;\n }\n if (symbolFrag[0] == '`')\n symbolFrag = symbolFrag\n .slice (1, -1)\n .replace (/([^\\\\](?:\\\\\\\\)*)`/g, function (substr, group) {\n return group.replace ('\\\\\\\\', '\\\\') + '`';\n })\n ;\n var delimit = symbolMatch[1];\n if (delimit == ':')\n delimit = '/';\n symbolPath.push ([ delimit, symbolFrag ]);\n }\n\n if (!symbolPath.length)\n symbolPath.push ([ '.', undefined ]);\n else if (symbolPath[0][0] === undefined)\n symbolPath[0][0] = '.';\n else\n symbolPath = fileScope.concat (symbolPath);\n // symbolPath = concatPaths (fileScope, symbolPath);\n\n var fullPathName = symbolPath\n .map (function (item) { return item[0] + item[1]; })\n .join ('')\n ;\n\n var delimit = pathMatch[1];\n if (delimit == ':')\n delimit = '/';\n return [ delimit, '['+fullPathName.slice (1)+']', symbolPath ];\n }) (fragName.slice (1, -1)));\n }\n if (!path.length)\n path.push ([]);\n return path;\n}", "async function callParser({ href, name, currPath }) {\n const newPage = await browser.newPage();\n await parseTree({\n url: href,\n currPath: path.join(currPath, name),\n page: newPage,\n });\n await newPage.close();\n}", "parent(path) {\n if (path.length === 0) {\n throw new Error(\"Cannot get the parent path of the root path [\".concat(path, \"].\"));\n }\n\n return path.slice(0, -1);\n }", "parent(path) {\n if (path.length === 0) {\n throw new Error(\"Cannot get the parent path of the root path [\".concat(path, \"].\"));\n }\n\n return path.slice(0, -1);\n }", "function parseFile(str) {\n\n\t\t// Verifying str type\n\t\tif (typeof str !== 'string') {\n\t\t\talert('Sorry... we had a uhh... error parsing?');\n\t\t\treturn;\n\t\t}\n\n\t\t// RegEx is a blast -_-\n\t\tlet newParsedArr = str.match(/['\"].*?['\"]/g).map(item => {\n\t\t\treturn item.replace(/['\"]/g, \"\");\n\t\t});\n\t\tformatPaths(newParsedArr);\n\t}", "function splitPath(path) {\n\t\tvar bits = path.split('/');\n\t\treturn {\n\t\t\tfile: bits.pop()\n\t\t};\n\t}", "function parsePath(url) {\n\tvar vars = [];\n\n\treturn url.match(/\\{(\\w+)\\}/g);\n}", "get localPath() {\n return this._manager.contents.localPath(this._path);\n }", "function GetNormalizedPath() {\n}", "get fullpath()\t{ return \"\" + this.prefix + this.path }", "get locationPathName() {}", "function _initPath(){ \n\tthis._setPath = function(){ \n\treturn (\"/*your path here*/\"); }; }", "get dirname() {\n return typeof this.path === 'string' ? path.dirname(this.path) : undefined\n }", "function reconstructPath(from, current){\r\n let path = [];\r\n path.push(current);\r\n while(from.has(current.name)){\r\n current = from.get(current.name);\r\n path.unshift(current);\r\n }\r\n return path;\r\n}", "function getLocation() {\n var pathName = window.location.pathname,\n location = pathName.split('/');\n\n if (location.length > 0) {\n return location[1];\n } else {\n return false;\n }\n }" ]
[ "0.68003976", "0.6535013", "0.6451523", "0.6004998", "0.59130275", "0.58941865", "0.58845973", "0.58791375", "0.5851786", "0.5750613", "0.57372856", "0.5664637", "0.56320786", "0.5627999", "0.56000936", "0.559557", "0.5587674", "0.556962", "0.5557939", "0.5553969", "0.54046977", "0.5386875", "0.5384304", "0.5348286", "0.53171474", "0.5315809", "0.5309613", "0.53014815", "0.52979666", "0.52979666", "0.52979666", "0.5297382", "0.529659", "0.5286892", "0.5280664", "0.5280664", "0.5280664", "0.5280664", "0.5280664", "0.5280664", "0.5280664", "0.5280664", "0.5278833", "0.52780753", "0.5273053", "0.5273053", "0.5273053", "0.5273053", "0.5273053", "0.52516156", "0.5228925", "0.5226571", "0.52219707", "0.52086395", "0.52047044", "0.51650596", "0.51623416", "0.51567423", "0.5156659", "0.5137173", "0.5132029", "0.5122228", "0.51038164", "0.5102586", "0.5089011", "0.5075153", "0.5075093", "0.506947", "0.5065561", "0.5044059", "0.5042223", "0.5033866", "0.5024793", "0.5024433", "0.50215596", "0.5018112", "0.49931714", "0.4990666", "0.4988043", "0.498311", "0.49804437", "0.49709606", "0.4967009", "0.49632564", "0.49479315", "0.49440002", "0.49301636", "0.49250934", "0.49250934", "0.49159", "0.49091023", "0.48987025", "0.48981503", "0.4894392", "0.48842746", "0.48791432", "0.4869195", "0.48675147", "0.48528337", "0.4837516" ]
0.5381613
23
Returns the specific filter categories which were selected by the user on the checkboxes
function findIfFilters(filter_type) { let choices = []; const checkboxes = document.getElementById(`${filter_type}-filter`).getElementsByTagName('input'); for (let i = 0; i < checkboxes.length; i++) { if (checkboxes[i].checked === true) { choices.push(checkboxes[i].parentElement.textContent.slice(2)); } } return choices; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSelectedCateFilterItems() {\n let i = 0;\n let selected = [];\n $('#catFilter input:checked').each(function () {\n selected[i++] = $(this).val();\n });\n return selected;\n }", "filterByCategory(category) {\n\t\tconsole.log(this.selectedCategories);\n\t}", "function getSelectedCategories() {\n let selectedCategories = [];\n categoryListItems.forEach((element, i) => {\n if (element.checked && i > 0) selectedCategories.push(element.name);\n });\n if (selectedCategories.length === categoryListItems.length - 1) selectedCategories = [];\n return selectedCategories;\n}", "function categoryFilter() {\n let selected = [];\n\n $('#categoryChecks input:checked').each(function () {\n selected.push($(this).attr('value'));\n });\n\n let searchRegex = selected.join(\"|\");\n datatable.search(searchRegex, true, false).draw();\n sumTableData();\n}", "function getSelectedFilters() {\n var selectedFilters = [];\n $('.logic-checkbox').each(function (index, value) {\n if (value.checked) { selectedFilters.push(value.id.split(\"-logic-checkbox\")[0]); }\n });\n return selectedFilters;\n}", "function filterData(){\r\n // temporary variables\r\n var tempColl = [];\r\n var tempCat = [];\r\n // Fetching selected checkbox filter values for collection and categories\r\n $.each($(\"input[name='brands']:checked\"), function(){\r\n tempColl.push($(this).val());\r\n });\r\n\r\n $.each($(\"input[name='categories']:checked\"), function(){\r\n tempCat.push($(this).val());\r\n });\r\n // fetching selected filter value for color\r\n color = $(\"input[name='colors']:checked\").val();\r\n if (tempColl.length > 0) {\r\n coll = tempColl;\r\n }\r\n else{\r\n coll = \"All\";\r\n }\r\n if (tempCat.length > 0) {\r\n cat = tempCat;\r\n }\r\n else{\r\n cat = [\"All\"];\r\n }\r\n if (color == undefined) {\r\n color = [\"All\"];\r\n }\r\n // Fetch selected items only according to filter applied\r\n getItem(coll, cat, color, minprice, maxprice);\r\n }", "function get_filter(type_of_service){\n var filter = [];\n $('.'+type_of_service+':checked').each(function(){\n filter.push($(this).val());\n });\n\n return filter;\n }", "function getCheckboxIds() {\n var catIds = $(\"#gssi-checkbox-filter input:checked\").map(function () {\n return $(this).val();\n });\n\n catIds = catIds.get();\n catIds = catIds.join(',');\n\n return catIds;\n }", "function getSelectedAreaFilterItems() {\n let i = 0;\n let selected = [];\n $('#areaFilter input:checked').each(function () {\n selected[i++] = $(this).val();\n });\n return selected;\n }", "function get_filtered_types() {\n\t\n\tvar filters = [ 'locales' , 'skyshard' , 'lorebook' , 'boss' , 'treasure' ];\n\t$( '#marker-filters :checked' ).each( function() {\n\t\tfor( i = filters.length; i >= 0; i-- ) {\n\t\t\tif ( $(this).val() == filters[i] )\tfilters.splice( i , 1 );\n\t\t}\n });\n\t return filters;\n}", "function get_checkbox_filters(type) {\n var filters = {};\n var boxes = Y.all('#filter-form .'+type+' input[type=checkbox]');\n Y.log('Getting starting '+type+' filters');\n boxes.each(function(box) {\n var name = box.getData('filter-refine');\n var checked = box.get('checked');\n Y.log('Checking filter '+name+'.');\n if (checked) {\n Y.log('Filter '+name+' is active!');\n filters[name] = checked;\n }\n });\n return filters;\n }", "function cateFilter() {\r\n var brandVal = document.querySelectorAll('input[name=\"category\"]:checked');\r\n var brandData = [];\r\n brandVal.forEach((elem) => {\r\n elem.checked ? brandData.push(elem.value) : null ;\r\n })\r\n var resultBrand = []; \r\n brandData.forEach((val) => {\r\n resultBrand = resultBrand.concat(productData.filter((product) => product.category.includes(val)))\r\n \r\n })\r\n brandData.length!==0? cards(resultBrand):cards(productData)\r\n \r\n}", "function fetchAllFilteredConditions() {\n\tlet filteredItem = [];\n\tlet selectedCatColumnValueMap = new Map();\n\tlet selectedNumColumnValueMap = new Map();\n\tlet numericalCheckBox = new Set();\n\t\n\tvar filter = document.getElementById('categorical-filter-checkbox');\n\tfor(var i = 0; i < filter.children.length ; i++){\n\t\tvar childElement = filter.children[i].firstElementChild.childNodes;\n\t\tvar columnName = convertToCamelCase(childElement[0].data,\"_\"); //label field\n\t\tvar multiSelectDropDowns = childElement[2].options; // multi select dropdown field\n\t\tlet selectedCatValueSet = new Set();\n\t\tfor(var j = 0 ; j< multiSelectDropDowns.length; j++){\n\t\t\tif(multiSelectDropDowns[j].selected){\n\t\t\t\tselectedCatValueSet.add(multiSelectDropDowns[j].value);\n\t\t\t}\n\t\t}\n\t\tif(selectedCatValueSet.size > 0){\n\t\t\tselectedCatColumnValueMap.set(columnName,selectedCatValueSet);\n\t\t}\t\n\t}\n\tfilteredItem.push(selectedCatColumnValueMap); //push categorical value map to first element in array\n\t\n\t\n\tvar numericalFilters = fetchAllNumericalColumns();\n\tfor (const value of numericalFilters) {\n\t\tif(isColumnSelected(value)){\n\t\t\tnumericalCheckBox.add(convertToCamelCase(value,\"_\"));\n\t\t}\n\t}\n\tif(numericalCheckBox.size > 0){\n\t\tselectedNumColumnValueMap.set('selectedNumericalValues',numericalCheckBox);\n\t\tselectedNumColumnValueMap.set('numericalFilterCondition',document.querySelector('input[name=\"numericalFilter\"]:checked').value);\n\t\tselectedNumColumnValueMap.set('numericalFilterValue',document.getElementById('numericalFilter').value);\n\t}\n\tfilteredItem.push(selectedNumColumnValueMap); //push numerical related values to second element in array;\n\treturn filteredItem;\n}", "function getCategoryFilterItems(){\n var tempFilterArray = [];\n for(i=0; i<blog.rawData.length; i++){\n tempFilterArray.push(blog.rawData[i].category);\n }\n // console.log(tempFilterArray);\n return tempFilterArray;\n }", "function get_filter(class_name)\n{\n var filter = [];\n $('.'+class_name+':checked').each(function(){\n filter.push($(this).val());\n });\n return filter;\n}", "checkSelectedFilters() {\n const selectedFilters = this.anomalyFilterModel.getSelectedFilters();\n selectedFilters.forEach((filter) => {\n const [section, filterName] = filter;\n $(`#${section} .filter-item__checkbox[data-filter=\"${filterName}\"]`).prop('checked', true);\n });\n }", "function get_filter(class_name){\n\t\tvar filter = [];\n\t\t$('.' + class_name + ':checked').each(function(){\n\t\t\tfilter.push($(this).val());\n\t\t});\n\t\treturn filter;\n\t}", "function fetchCheckedCategorisedColumns() {\n\tlet checkedCategorisedColumnSet = new Set();\n\tvar categorisedColumnsSet = fetchAllCategorisedColumnSet();\n\tfor (const value of categorisedColumnsSet) {\t\t\n\t\tif(isColumnSelected(value)){\n\t\t\tcheckedCategorisedColumnSet.add(value);\n\t\t}\n\t}\t\n\treturn checkedCategorisedColumnSet;\n}", "function checkCategory(){\n let value; \n category.forEach(e=>{\n if(e.checked){\n value = e.value\n }\n })\n return value\n}", "function selectAllCategories() {\n // storing of all other categorieCheckboxes\n var cbs = document.querySelectorAll('input[id^=\"catCheckbox\"]');\n // storing allChecked-status of allCategoriesCheckbox\n var allChecked = document.getElementById('checkboxAllCategories').checked;\n // all other checkboxes are going to be (un)checked depending on allChecked-status\n // calling of hideProduct-function\n for (var cb of cbs) {\n if (allChecked === true) {\n cb.checked = true;\n }\n else {\n cb.checked = false;\n }\n hideProduct(cb.id);\n }\n}", "function getCategoryFilter(filterBy) {\n return filterBy && filterBy !== Selector.FILTER_ALL ? \"[\" + Selector.CATEGORY + \"*=\\\"\" + filterBy + \"\\\"]\" : Selector.FILTER_ALL;\n } // returns a nodelist of all filter links matching the provided isotope ID", "function applyCheckboxFilters (cases) {\n if (!cases || !cases.length) {\n return [];\n }\n var active = cases.slice();\n for (var filter in checkboxFilters) {\n if (checkboxFilters[filter].active) {\n active = active.filter(checkboxFilters[filter].fn);\n }\n }\n if (filteredDistricts.length) {\n active = active.filter(function (c) {\n return filteredDistricts.indexOf(c.Court) >= 0;\n })\n }\n return active;\n }", "function makeRowFilters() {\n\t\n\t//clear previous checkbox div\n\tvar divContainer = document.getElementById('categorical-filter-checkbox');\n\tdivContainer.innerHTML = \"\";\n\t//show filter div\n\tdocument.getElementById(\"filter-row\").hidden=false;\n\tvar checkedCategorisedColumnsSet = fetchCheckedCategorisedColumns();\n\t\n\t//for each categorical value in set build multiselect dropdown\n\tfor (const value of checkedCategorisedColumnsSet) {\t\t\n\t\tvar selectDiv = document.createElement(\"div\");\n\t\tselectDiv.style.marginTop = \"14px\";\n\t\tselectDiv.style.marginRight = \"24px\";\n\t\t\n\t\tvar select = document.createElement(\"select\");\n\t\tselect.id = value;\n\t\tselect.multiple = true;\n\t\tselect.style.width = \"180px\";\n\t\tselect.style.overflowX = \"auto\";\t\t\n\t\t\n\t\tvar selectLabel = document.createElement('label')\n\t\tselectLabel.htmlFor = \"id\";\n\t\tselectLabel.appendChild(document.createTextNode(value));\n\t\t\n\t\tvar categoryValueSet = fetchAllValuesForCategory(value);\n\t\tfor (const value of categoryValueSet) {\n\t\t\tvar option = document.createElement(\"option\");\n\t\t\toption.value = value;\n\t\t\toption.selected =\"\";\n\t\t\toption.innerHTML = value;\n\t\t\tselect.add(option);\n\t\t}\n\t\tselectLabel.append(document.createElement(\"br\"));\n\t\tselectLabel.append(select);\n\t\tselectDiv.appendChild(selectLabel);\n\t\tdivContainer.append(selectDiv);\t\t\t\t\n\t}\n}", "function selectedValuesForCategory(categorySelectionState) {\n const selectedValues = _([...categorySelectionState.categoryIndices])\n .filter(tuple => categorySelectionState.categorySelected[tuple[1]])\n .map(tuple => tuple[0])\n .value();\n return selectedValues;\n}", "getFilterInfo(name) {\n let filterInfo = [],\n notSpecific = name === undefined ? true : false\n this.selectedFilters.forEach(nameSelected => {\n if (notSpecific) {\n name = (typeof nameSelected === 'string'\n ? nameSelected\n : nameSelected[0]\n ).toLowerCase()\n }\n\n Object.entries(ENV.APP.filters).some(categoryFilter => {\n return Object.entries(categoryFilter[1]).some(filters => {\n return filters[1].some(filterName => {\n filterName = filterName.name || filterName\n if (\n filterName.toLowerCase() === name &&\n filterInfo.every(entry => entry[0] !== name)\n ) {\n filterInfo.push([name, categoryFilter[0], underscore(filters[0])])\n return true\n }\n })\n })\n })\n })\n return filterInfo\n }", "filteredListings() {\n const filter = this.state.filters.name\n if (this.state.filters.name === 'All') return this.sortedListings()\n return this.sortedListings().filter(category => {\n return category.categories.some(category => category.name === filter)\n })\n }", "function checkboxHandler() {\n let searchquery = document.querySelector('#fieldText').value;\n let categories = [];\n let price = [];\n\n document.querySelectorAll('#categories div input').forEach(cat => {\n if(cat.checked) {\n categories.push(cat.value);\n }\n });\n\n let free = document.querySelector('#checkFree');\n let paid = document.querySelector('#checkPaid');\n \n if(free.checked) {\n price.push(free.value);\n }\n\n if(paid.checked) {\n price.push(paid.value);\n }\n\n \n sendAjaxRequest('get', '/api/search', {\"searchquery\":searchquery,\"categories\":categories, \"price\":price}, filterHandler);\n}", "function selectCategories() {\n\tconst infographic = $('.infographic-base-wrapper svg');\n\tconst evaluationTrigger = $('.evaluation-trigger');\n\n\tif(infographic) {\n\t\tconst triggers = infographic.find('#category #trigger');\n\t\ttriggers.each(function() {\n\t\t\tconst categoryEl = $(this).children()[0];\n\t\t\tlet triggerState = false;\n\t\t\tlet category = categoryEl.id;\n\t\t\tcategory = category.replace(/-/g, ' ');\n\t\t\tcategory = category.replace('&','');\n\n\t\t\t$(this).on('click', function() {\n\n\t\t\t\tif(triggerState) {\n\t\t\t\t\t$(this).removeClass('is-active');\n\t\t\t\t\tselectedCategories.pop(category);\n\t\t\t\t} else {\n\t\t\t\t\t$(this).addClass('is-active');\n\t\t\t\t\tselectedCategories.push(category);\n\t\t\t\t}\n\t\t\t\ttriggerState = !triggerState;\n\n\t\t\t\t// disable if there are 3 categories selected\n\t\t\t\tif(selectedCategories.length == 3) {\n\t\t\t\t\ttriggers.each(function() {\n\t\t\t\t\t\tif(!$(this).hasClass('is-active')) {\n\t\t\t\t\t\t\t$(this).addClass('is-disabled');\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\ttriggers.removeClass('is-disabled');\n\t\t\t\t}\n\n\t\t\t\tif(selectedCategories.length > 0) {\n\t\t\t\t\tevaluationTrigger.removeClass('is-disabled');\n\t\t\t\t} else {\n\t\t\t\t\tevaluationTrigger.addClass('is-disabled');\n\t\t\t\t}\n\n\t\t\t});\n\n\t\t})\n\t}\n}", "function get_filters() {\n\tvar filters = [];\n\tif($(\"input[id=toggle-all]\").is(\":checked\")) {\n\t\tfilters = all_filters;\n\t} else {\n\t\t$(\"input[id^=toggle]\").each(function(index,element) {\n\t\t\tif($(element).is(\":checked\")) {\n\t\t\t\tconsole.log(element);\n\t\t\t\tfilters.push($(element).val());\n\t\t\t}\n\t\t});\n\t}\n\n\tif(filters.length == 0){\n\t\tfilters = all_filters;\n\t}\n\n\treturn filters\n}", "get selectedCheckboxes() {\n return this.checkboxes.filter((checkbox) => checkbox.checked === true);\n }", "function openCategoricalFilter(column, $header) {\n var bak = column.getFilter() || [];\n var popup = makePopup($header, 'Edit Filter', '<div class=\"selectionTable\"><table><thead><th class=\"selectAll\"></th><th>Category</th></thead><tbody></tbody></table></div>');\n // list all data rows !\n var colors = column.categoryColors, labels = column.categoryLabels;\n var trData = column.categories.map(function (d, i) {\n return { cat: d, label: labels[i], isChecked: bak.length === 0 || bak.indexOf(d) >= 0, color: colors[i] };\n }).sort(sortbyName('label'));\n var $rows = popup.select('tbody').selectAll('tr').data(trData);\n var $rows_enter = $rows.enter().append('tr');\n $rows_enter.append('td').attr('class', 'checkmark');\n $rows_enter.append('td').attr('class', 'datalabel').text(function (d) { return d.label; });\n $rows_enter.on('click', function (d) {\n d.isChecked = !d.isChecked;\n redraw();\n });\n function redraw() {\n $rows.select('.checkmark').html(function (d) { return '<i class=\"fa fa-' + ((d.isChecked) ? 'check-' : '') + 'square-o\"></i>'; });\n $rows.select('.datalabel').style('opacity', function (d) { return d.isChecked ? '1.0' : '.8'; });\n }\n redraw();\n var isCheckedAll = true;\n function redrawSelectAll() {\n popup.select('.selectAll').html(function (d) { return '<i class=\"fa fa-' + ((isCheckedAll) ? 'check-' : '') + 'square-o\"></i>'; });\n popup.select('thead').on('click', function () {\n isCheckedAll = !isCheckedAll;\n trData.forEach(function (row) { return row.isChecked = isCheckedAll; });\n redraw();\n redrawSelectAll();\n });\n }\n redrawSelectAll();\n function updateData(filter) {\n markFiltered($header, filter && filter.length > 0 && filter.length < trData.length);\n column.setFilter(filter);\n }\n popup.select('.cancel').on('click', function () {\n updateData(bak);\n popup.remove();\n });\n popup.select('.reset').on('click', function () {\n trData.forEach(function (d) { return d.isChecked = true; });\n redraw();\n updateData(null);\n });\n popup.select('.ok').on('click', function () {\n var f = trData.filter(function (d) { return d.isChecked; }).map(function (d) { return d.cat; });\n if (f.length === trData.length) {\n f = [];\n }\n updateData(f);\n popup.remove();\n });\n}", "function handleCheckboxChange() {\n // First we find every checkbox and store them in separate variables\n var cancerCheckbox = document.querySelector(\".cancer-checkbox\");\n var asthmaCheckbox = document.querySelector(\".asthma-checkbox\");\n\n // Logging out to make sure we get the checkboxes correctly\n console.log(\"cancer:\", cancerCheckbox.checked);\n console.log(\"asthma:\", asthmaCheckbox.checked);\n\n // Create an array of all of the values corresponding to checked boxes.\n // If a checkbox is checked, add that filter value to our array.\n var lifeStages = [];\n if (cancerCheckbox.checked) {\n // For each of these we are adding single quotes around the strings,\n // this is because in the SQL query we want it to look like:\n //\n // WHERE life_stage IN ('Adult', 'Juvenile')\n //\n lifeStages.push(\"'Cancer'\");\n }\n if (asthmaCheckbox.checked) {\n lifeStages.push(\"'Asthma'\");\n }\n\n // If there are any values to filter on, do an SQL IN condition on those values,\n // otherwise select all features\n if (lifeStages.length) {\n var sql =\n \"SELECT * FROM final WHERE life_stage IN (\" + lifeStages.join(\",\") + \")\";\n console.log(sql);\n source.setQuery(sql);\n } else {\n source.setQuery(\"SELECT * FROM final\");\n }\n}", "step_1_categories() {\n let inputs = document.querySelector(\"form\").firstElementChild.querySelectorAll(\"input\")\n let categories = []\n inputs.forEach(input => {\n if (input.checked === true) {\n categories.push(input.parentElement.querySelector(\".description\").innerText)\n }\n })\n return categories\n }", "function getSelectedParkTypes () {\r\n const inputControls = document.querySelectorAll('#filterControls input');\r\n const values = [];\r\n\r\n inputControls.forEach(input => input.checked ? values.push(input.value): null);\r\n return values;\r\n}", "function get_filter(classname) {\n\n // empty array\n let filter = [];\n // Activates push function for each checked box\n // :checked marks each checked or selected element\n $('.' + classname + ':checked').each(function () {\n filter.push($(this).val());\n });\n // retun array with elements\n return filter;\n }", "function categorySelect() {\n\t//카테고리 선택 안했을때 -> hamburger\n\tmenus.forEach((menu) => {\n\t\tif (menu.dataset.type !== \"hamburger\") {\n\t\t\t// console.log(menu.dataset.type);\n\t\t\tmenu.classList.add(\"invisible\");\n\t\t}\n\t});\n\n\t//카테고리 선택시\n\tcategory.addEventListener(\"click\", (event) => {\n\t\tconst filter = event.target.dataset.filter;\n\t\tif (filter == null) {\n\t\t\treturn;\n\t\t}\n\n\t\t//선택 카테고리 색상 변경\n\t\tconst active = document.querySelector(\".category_btn.selected\");\n\t\tactive.classList.remove(\"selected\");\n\t\tevent.target.classList.add(\"selected\");\n\n\t\t//메뉴 선별\n\t\tmenus.forEach((menu) => {\n\t\t\tif (filter === menu.dataset.type) {\n\t\t\t\tmenu.classList.remove(\"invisible\");\n\t\t\t} else {\n\t\t\t\tmenu.classList.add(\"invisible\");\n\t\t\t}\n\t\t});\n\t});\n}", "function allCheckboxCheck() {\n // storing of all other categorieCheckboxes\n var allChecked = true;\n var cbs = document.querySelectorAll('input[id^=\"catCheckbox\"]');\n // checking if one of the checkboxes is not checked\n for (var cb of cbs) {\n if (cb.checked === false) {\n allChecked = false;\n break;\n }\n }\n // checks allCategoriesCheckbox if all other checkboxes are checked\n if (allChecked === true) {\n document.getElementById('checkboxAllCategories').checked = true;\n }\n // unchecks allCategoriesCheckbox if one other checkbox is unchecked\n else {\n document.getElementById('checkboxAllCategories').checked = false;\n }\n}", "function filter() {\n var filtered = listings;\n\n var selected_cat = document.getElementById(\"filter-cats\").value;\n if (selected_cat != \"All Categories\") {\n $.post(\"count/cats/\", {\"name\": selected_cat});\n filtered = filtered.filter(function(d) {\n if (Array.isArray(d.cat)) {\n return d.cat.includes(selected_cat);\n } else {\n return d.cat == selected_cat;\n }\n });\n } \n \n var selected_genre = document.getElementById(\"filter-genres\").value;\n if (selected_genre != \"all\") {\n filtered = filtered.filter(function(d) {\n if (\"type\" in d && d.type != null) {\n if (selected_genre in d.type) {\n return d[\"type\"][selected_genre] == \"True\";\n } else {\n return false;\n }\n } else {\n return false;\n }\n });\n } \n draw(filtered);\n}", "async function getRecsFromFilterCheckboxes() {\n const selectedCates = getSelectedCateFilterItems();\n const selectedAreas = getSelectedAreaFilterItems();\n const recsByAreas = await getRecInfosForMultipleAreas(selectedAreas);\n const recsByCates = await getRecInfosForMultipleCates(selectedCates);\n\n if (selectedCates.length === 0 && selectedAreas.length === 0) {\n return \"no filter\";\n }\n else if (selectedCates.length === 0) {\n return recsByAreas;\n }\n else if (selectedAreas.length === 0) {\n return recsByCates;\n }\n else {\n const filteredRecs = recsInBothArrs(recsByCates, recsByAreas);\n return filteredRecs;\n }\n }", "function fillFilterSelectionBoxes() {\n let questions = [...ivcQuestionComponentQuestions];\n\n questions.sort((a, b) => {\n return a.category.localeCompare(b.category);\n });\n\n questions = questions.filter((element, index, array) => {\n return index == array.findIndex((a) => {\n return a.category == element.category;\n });\n });\n\n const filterUpdateSelection = document.getElementById(\"ivc-question-update-filter\");\n const filterDeleteSelection = document.getElementById(\"ivc-question-delete-filter\");\n filterUpdateSelection.innerHTML = \"\";\n filterDeleteSelection.innerHTML = \"\";\n const filterAllOption = document.createElement(\"option\");\n filterAllOption.innerText = \"All\";\n filterUpdateSelection.appendChild(filterAllOption);\n filterDeleteSelection.appendChild(filterAllOption.cloneNode(true));\n for (let i = 0; i < questions.length; i++) {\n const option = document.createElement(\"option\");\n option.innerText = questions[i].category;\n filterUpdateSelection.appendChild(option);\n filterDeleteSelection.appendChild(option.cloneNode(true));\n }\n}", "investmentCategories(filter) {\n\t\tconst categories = [\n\t\t\t{id: \"Buy\", name: \"Buy\"},\n\t\t\t{id: \"Sell\", name: \"Sell\"},\n\t\t\t{id: \"DividendTo\", name: \"Dividend To\"},\n\t\t\t{id: \"AddShares\", name: \"Add Shares\"},\n\t\t\t{id: \"RemoveShares\", name: \"Remove Shares\"},\n\t\t\t{id: \"TransferTo\", name: \"Transfer To\"},\n\t\t\t{id: \"TransferFrom\", name: \"Transfer From\"}\n\t\t];\n\n\t\treturn filter ? this.filterFilter(categories, {name: filter}) : categories;\n\t}", "function GetActiveString(){\n var active = [];\n $('.checkbox input:checked').each(function() {\n active.push($(this).attr('data-filter'));\n });\n\n\n var filtered = active.join(\", \");\n if(filtered !== '')\n $('.filtered-list').html(filtered);\n else{\n $('.filtered-list').html('All');\n }\n\n}", "function pwFilterProducts() {\n if($('#filter input[type=checkbox]').is(':checked')) {\n $('#filter').removeClass('has-selection').addClass('has-selection');\n } else {\n $('#filter').removeClass('has-selection');\n }\n pwBuildLayout();\n }", "async function selectFilter2Checkboxes() {\r\n filter = document.querySelector(\"#filterBy\").value;\r\n let checkboxes = document.querySelectorAll('input[name='+filter+']');\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 \r\n }\r\n updateKorpusCheckboxes();\r\n}", "function buildFilterOptions() {\n var inputs = {};\n\n $('input[type=checkbox]', '.filter').each(function(idx, elem) {\n inputs[elem.getAttribute('id')] = {\n elem: elem,\n spec: elem.getAttribute('data-filter-spec'),\n skill: elem.getAttribute('data-filter-skill'),\n type: elem.getAttribute('data-filter-type')\n };\n });\n\n var notNeededInputs = {};\n Object.keys(inputs).forEach(function(inputId) {\n notNeededInputs[inputId] = true;\n });\n\n $('.products__item').each(function(idx, elem) {\n var spec = elem.getAttribute('data-spec') && elem.getAttribute('data-spec').split(','),\n skill = elem.getAttribute('data-skill') && elem.getAttribute('data-skill').split(','),\n type = elem.getAttribute('data-type') && elem.getAttribute('data-type').split(',');\n\n Object.keys(notNeededInputs).forEach(function(inputId) {\n var input = inputs[inputId];\n if ((spec && spec.indexOf(input.spec) !== -1) || (skill && skill.indexOf(input.skill) !== -1)\n || (type && type.indexOf(input.type) !== -1)) {\n notNeededInputs[inputId] = false;\n }\n });\n });\n\n // Object.keys(notNeededInputs).forEach(function(inputId) {\n // if (notNeededInputs[inputId]) {\n // $(inputs[inputId].elem.closest('.form__checkbox')).hide(150, function() {\n // // inputs[inputId].elem.closest('.form__checkbox').classList.add('filter__hidden');\n // });\n // } else {\n // $(inputs[inputId].elem.closest('.form__checkbox')).show(150, function() {\n // inputs[inputId].elem.closest('.form__checkbox').classList.remove('filter__hidden');\n // });\n // }\n // });\n }", "async function filterOutCategories(selected_categories) {\n const categories = await fetchCategoriesFromServer()\n return categories.filter( cat => {\n for (let c of selected_categories) {\n if(c.id === cat.id || c.name === cat.name){\n return false\n }\n }\n return true\n })\n}", "function get_selected_checkboxes_array(){\n var ch_list=[]\n $(\"input:checkbox[type=checkbox]:checked\").each(function(){\n ch_list.push($(this).val());\n });\n return ch_list;\n}", "function listarFiltros() {\n var filtros = [];\n for (let i = 0; i < elementoListaFiltro.children.length; i++) {\n let elementoLista = elementoListaFiltro.children.item(i);\n let elementoCheckBox = elementoLista.children.item(0);\n\n if (elementoCheckBox.type === 'checkbox') {\n filtros.push(elementoCheckBox);\n }\n }\n return filtros;\n}", "getPickedServices(){\n let whatIsPicked = [];\n //#1 - iterate categories\n this.myServices.forEach((category)=>{ \n //#2 - iterate subcategories\n category.subCategories.forEach((subCategory)=>{ \n //#3 - iterate services to check witch ones are picked\n subCategory.options.forEach((service)=>{\n //#4 - push it if picked\n if(service.optionSelected){\n whatIsPicked.push(service.optionId);\n }\n })\n });\n\n });\n\n //#10 - Finaly, return what is picked\n return whatIsPicked;\n\n }", "function checkedCategoryList(mode)\n{\n var checkedArray = $('#techAreasCB :checkbox:checked');\n var categoryId = [];\n var clMode = mode;\n \n checkedArray.each(function(){\n \n var categoryName = $(this).attr(\"name\");\n var categoryNumber = categoryName.slice(8); \n \n categoryId.push(categoryNumber);\n });\n \n //alert('1234567890--->'+categoryId);\n \n prepareJSON(categoryId, clMode) \n}", "function filterCategory(cat) {\n //if all is selected, displays all products\n if (cat.toLowerCase() === \"all\") {\n Products(products);\n }\n //filters products depending on category selected\n else {\n let filteredProducts = products.filter(\n prod => prod.category === cat.toLowerCase()\n );\n Products(filteredProducts);\n }\n}", "function pwGetCurrentSelection() {\n if($('#filter input[type=checkbox]').is(':checked')) {\n var vals = pwGetColVals(null, 'category');\n vals = pwGetColVals(vals, 'volume');\n vals = pwGetColVals(vals, 'type');\n vals = pwGetColVals(vals, 'location');\n vals = pwGetColVals(vals, 'shape');\n currentSelection = objToArr(vals);\n } else {\n currentSelection = [];\n for (var i=0; i < packages.length; i++) {\n currentSelection[i] = i;\n }\n }\n }", "function selectAllCategories() {\n markerGroupIds = []; // clear all, then put every catId inside\n //for (var i = 0; i < workspaceCriterias.result.length; i++) {\n for (var j = 0; j < workspaceCriterias.result[crtCritIndex].categories.length; j++) {\n var catId = workspaceCriterias.result[crtCritIndex].categories[j].catId;\n markerGroupIds.push(catId);\n jQuery(\"#catRow-\"+catId).attr(\"class\", \"catRowSelected\");\n }\n }", "function getCheckFilters(filter) {\n switch (filter) {\n case 'brand':\n return getCheckFilterByClass('brand-filter-input');\n case 'returnable':\n return getCheckFilterByClass('returnable-filter-input');\n }\n}", "function filterProjectsBy(evt) {\n var category = evt.target.value;\n $('.project-filterable').hide();\n if (category) {\n $('.' + category).show();\n } else {\n $('.project-filterable').show();\n }\n}", "function validateFavCat(formEl, categories){\n try {\n // Clear the checkbox categories and check if the new \"checked\" categories match\n // the onces in the food menu JSON file's categories\n userSelectedCat = [];\n let chkboxInputs = formEl.querySelectorAll('input[name=\"favCat[]\"]');\n if(!chkboxInputs){\n return false;\n }\n if(chkboxInputs){\n for(let i = 0; i < chkboxInputs.length; ++i){\n if(chkboxInputs[i].checked){\n if(!categories.includes(chkboxInputs[i].value)){\n return false;\n } else {\n userSelectedCat.push(chkboxInputs[i].value);\n }\n } // end of if()\n } // end of for()\n // console.log(userSelectedCat);\n return true;\n } else {\n return false;\n }\n } catch(e) {\n console.log(e);\n return false;\n }\n} // end of validateFavCat()", "function filterByCat( categ ){\n filteredBooks = [];\n for (let i = 0; i < allBooks.length; i++) {\n if (allBooks[i].categories == categ ) {\n filteredBooks.push(allBooks[i]);\n }\n }\n}", "function buildAndExecFilter() {\n var show = [];\n var filters = document.getElementsByName('tablefilter');\n for (var i = 0; i < filters.length; i++) {\n if (filters[i].checked) {\n show.push(filters[i].value);\n }\n }\n execFilter(show); // Filter based on selected values\n }", "function getCategoryValues(listCategories) {\n\tvar values = \"\";\n\t\n\tvar isChecked = false;\n\tvar categories = [];\n\t\n\tfor (var i = 0; i < listCategories.length; i++) {\n\t\tif ($(\"#\" + listCategories[i]).is(\":checked\")) {\n\t\t\tisChecked = true;\n\t\t\tcategories.push(\"\\\"\" + $(\"#\" + listCategories[i]).val() + \"\\\"\");\n\t\t}\n\t}\n\t\n\tif (isChecked) {\n\t\tvalues = categories.toString();\n\t}\n\t\n\treturn values;\n}", "function displayedModels() {\n return models.filter(model => model.checked);\n}", "function getStore(data) {\n // asigne checkboxes to variables and check if they are checked\n var store = $(\"input[name='store']\").is(\":checked\");\n var other = $(\"input[name='other']\").is(':checked');\n\n var arr2 = [];\n $.each(data, function(index, item) {\n if (store && item.cat === 'store') {\n arr2.push(item);\n }\n if (other && item.cat === 'other') {\n arr2.push(item);\n }\n });\n return arr2;\n }", "function categoryFilter(ecModel) {\n\t var legendModels = ecModel.findComponents({\n\t mainType: 'legend'\n\t });\n\t\n\t if (!legendModels || !legendModels.length) {\n\t return;\n\t }\n\t\n\t ecModel.eachSeriesByType('graph', function (graphSeries) {\n\t var categoriesData = graphSeries.getCategoriesData();\n\t var graph = graphSeries.getGraph();\n\t var data = graph.data;\n\t var categoryNames = categoriesData.mapArray(categoriesData.getName);\n\t data.filterSelf(function (idx) {\n\t var model = data.getItemModel(idx);\n\t var category = model.getShallow('category');\n\t\n\t if (category != null) {\n\t if (typeof category === 'number') {\n\t category = categoryNames[category];\n\t } // If in any legend component the status is not selected.\n\t\n\t\n\t for (var i = 0; i < legendModels.length; i++) {\n\t if (!legendModels[i].isSelected(category)) {\n\t return false;\n\t }\n\t }\n\t }\n\t\n\t return true;\n\t });\n\t });\n\t }", "selectFilterFacilidade(facilidades){\n\n //to open the DropDown\n this.getDropDownBoxFacilidades().click();\n\n //Search by the passed facilidades and click in checkBoxes\n facilidades.forEach((item) => {\n this.getCheckboxesFacilidades().contains(item).click();\n });\n }", "getCategories() {\n return ['Snacks', 'MainDishes', 'Desserts', 'SideDishes', 'Smoothies', 'Pickles', 'Dhal', 'General']\n }", "function getCategory(e) {\n filter(e.target.value); //filter function send which button we click\n if(e.target.value == \"all\"){\n bringFoods(); // bringFoods run when we click \"all button\" & form loaded\n }\n\n}", "function choiceArray() {\r\n document.getElementById(\"form-group\").addEventListener(\"change\", () => filterAll());\r\n Array.from(document.querySelectorAll(\"input[name=checkbox]\"))\r\n .forEach (sel => sel.addEventListener(\"change\", () => filterAll()));\r\n }", "function btnCheck() {\r\n filterList = []\r\n\r\n if (document.getElementById(\"filterInfoTech\").checked) {\r\n filterList.push(\"Information Technology\")\r\n } \r\n\r\n if (document.getElementById(\"filterSales\").checked) {\r\n filterList.push(\"Sales\")\r\n } \r\n\r\n if (document.getElementById(\"filterAdvertising\").checked) {\r\n filterList.push(\"Advertising\")\r\n } \r\n\r\n if (document.getElementById(\"filterHR\").checked) {\r\n filterList.push(\"Human Resources\")\r\n }\r\n\r\n filter(filterList)\r\n\r\n}", "onCategorySelectChange(checked, newCategory) {\n const { selectedCategories } = this.state;\n if(checked) {\n this.setState({ selectedCategories: [...selectedCategories, newCategory]});\n } else {\n this.setState({ selectedCategories: selectedCategories.filter(({ sid }) => sid !== newCategory.sid )});\n }\n }", "function filterApps(selcat){\n\n if(selcat == \"All\"){\n $(\"#app-pane div\").each(function(){\n if($(this).is(\":hidden\")){\n $(this).show(\"fast\");\n }\n });\n }\n else{\n $(\"#app-pane div\").each(function(){\n\n var str = $(this).attr(\"category\");\n if(selcat != str){\n $(this).hide(\"slow\");\n }\n else{\n $(this).show(\"slow\");\n }\n });\n }\n }", "function handleCheckboxFilterList(thisCheckbox) {\n var parentDimension = thisCheckbox.parents('section').attr('data-filter-dimension')\n var parentDimensionName = parentDimension.replace(/-/g, ' ')\n var thisValue = thisCheckbox.attr('data-filter-'+parentDimension.toLowerCase().replace(/ /g, '-'))\n var isChecked = thisCheckbox.prop('checked')\n // if the checkbox was checked, add an addition to the domain\n // if the checkbox was unchecked, remove from the list of conditions\n if (isChecked) {\n filterCollection[parentDimensionName].domain.push(thisValue) // add to conditions\n }\n else {\n var index = filterCollection[parentDimensionName].domain.indexOf(thisValue)\n filterCollection[parentDimensionName].domain.splice(index, 1) // add to conditions\n }\n}", "function getCategories() {\n\trimer.category.find(function(error, value) {\n\t\tif(error) {\n\t\t\tconsole.log(error)\n\t\t}\n\t\telse {\n\t\t\tconsole.log(value)\n\t\t}\n\t})\n}", "function filterCountryBoxes() {\n filterBoxes('countryBox', 'countryCheckbox', 'countryCompleteness', 'countrySearchFilter', 'countryCheckedFilter', 'countryCompletenessFilter', 'countryCompletenessFilterLabel');\n}", "function getFilterValues() {\n\tconst oFilters = {};\n\n\td3.selectAll(\".fi\").each(function () {\n\t\tlet el;\n\n\t\tif ((el = d3.select(this).select(\"select\").node())) {\n\t\t\toFilters[el.getAttribute(\"data-metric\")] = el.value;\n\t\t\t// add currency code\n\t\t\tif (oFilters.currency && !oFilters.currencyCode) {\n\t\t\t\toFilters.currencyCode = Array.from(el.selectedOptions)[0].getAttribute(\"data-code\");\n\t\t\t}\n\t\t}\n\t\tif ((el = d3.select(this).select(\"input[type=checkbox]\").node())) {\n\t\t\toFilters[el.getAttribute(\"data-metric\")] = el.checked;\n\t\t}\n\t});\n\n\treturn oFilters;\n}", "getActiveFilters() {\n let currentFilters = document.querySelectorAll('.active');\n let filtersSelected = [];\n\n currentFilters.forEach(function (currentFilter) {\n filtersSelected.push(currentFilter.getAttribute(\"data-filter\"));\n });\n\n return filtersSelected;\n }", "function categoryFilter(ecModel) {\n var legendModels = ecModel.findComponents({\n mainType: 'legend'\n });\n\n if (!legendModels || !legendModels.length) {\n return;\n }\n\n ecModel.eachSeriesByType('graph', function (graphSeries) {\n var categoriesData = graphSeries.getCategoriesData();\n var graph = graphSeries.getGraph();\n var data = graph.data;\n var categoryNames = categoriesData.mapArray(categoriesData.getName);\n data.filterSelf(function (idx) {\n var model = data.getItemModel(idx);\n var category = model.getShallow('category');\n\n if (category != null) {\n if (typeof category === 'number') {\n category = categoryNames[category];\n } // If in any legend component the status is not selected.\n\n\n for (var i = 0; i < legendModels.length; i++) {\n if (!legendModels[i].isSelected(category)) {\n return false;\n }\n }\n }\n\n return true;\n });\n });\n}", "function checked(categories,checkAll,dialogform)\n{\n\t$('#'+dialogform+' :checkbox').unbind().bind('click',function(){\n\t\tvar checked = $(this).attr('checked');\n\t\tif($(this).attr('name') == categories){\n\t\t\tvar children = category_children($(this).val(),dialogform);\n\t\t for(var i=0;i<children.length;i++){\n\t\t children[i].prev().attr('checked',checked);\n\t\t }\n\t\t}\n\t\tif($(this).attr('name') == checkAll){\n\t\t\tvar checkbox = $(':checkbox[name='+categories+']');\n\t\t\tcheckbox.attr('checked',checked);\n\t\t}\n\t});\t\n}", "function buildCategories() {\n const selectCategories = {};\n\n for (let i = 0; i < skills.length; i++) {\n const category = skills[i].category;\n // Make array for each category\n if (!selectCategories[category]) {\n selectCategories[category] = [];\n }\n\n let skill = skills[i];\n if (skill.comp === 1) {\n selectCategories[category].push({\n 'value': i,\n 'label': skill.name,\n // Custom attrs on Select Options\n 'tariff': skill.tariff.toFixed(1),\n 'startPosition': skill.startPosition,\n 'endPosition': skill.endPosition,\n 'makeDim': false\n });\n }\n }\n return selectCategories;\n}", "filterPosts() {\n this.showPosts = [];\n for (let p of this.allPosts) {\n if (this.filterCategories.includes(p.postCat)) {\n this.showPosts.push(p);\n }\n }\n }", "categoryFilter(recipe) {\n return recipe.category === this.state.category;\n }", "function FilterTodoList() {\n var todoStateFilter = \"\";\n $(\".todoList select\").find(\"option:selected\").each(function () {\n todoStateFilter += $(this).val();\n /* filtrage */\n if (todoStateFilter == \"all\") {\n $(this).parents('.todoList').find('.todo li').each(function (index) {\n $(this).show();\n })\n }\n if (todoStateFilter == \"completed\") {\n $(this).parents('.todoList').find('.todo li').each(function (index) {\n if ($(this).find(\"input\").is(':checked')) {\n $(this).show();\n } else {\n $(this).hide();\n }\n })\n }\n if (todoStateFilter == \"uncompleted\") {\n $(this).parents('.todoList').find('.todo li').each(function (index) {\n if ($(this).find(\"input\").is(':checked')) {\n $(this).hide();\n } else {\n $(this).show();\n }\n })\n }\n });\n }", "function getCategories() {\n\tvar categories = getCatDisponibility() + \" \" + getCatCategory() + \" \" + getCatCountries();\n\t\n\treturn categories;\n}", "filterDataSet(selectedTypes) {\r\n if(selectedTypes && selectedTypes.length > 0) {\r\n let itemSet = new Set();\r\n this.state.items.map(item => (item.types.map(type => {if(selectedTypes.indexOf(type) > -1){itemSet.add(item); return;}})));\r\n this.setState({filteredData: Array.from(itemSet)});\r\n } else {\r\n this.setState({filteredData: this.state.allowedData});\r\n }\r\n }", "function _collectChecks() {\n var lReturn = [];\n var lSelect = $x_FormItems( that.spreadsheet_id, 'CHECKBOX' );\n for(var i=0,l=lSelect.length;i<l;i++){\n if(lSelect[i].checked && lSelect[i].id){\n lReturn[lReturn.length]=lSelect[i].value;\n }\n }\n return lReturn;\n }", "function filterData(category) {\n\n attractions.sort((a,b) => a[\"Visitors\"] - b[\"Visitors\"]);\n\n\tconst result = attractions.filter(d => d[\"Category\"] == category);\n\n\t// result == 0 when \"All Attractions\" is selected\n\tif (result.length == 0) {\n\t\tlet data = attractions.slice(-5);\n\t\trenderBarChart(data);\n\n\t} else {\n\t\tlet data = result.slice(-5);\n\t\trenderBarChart(data);\n\t}\n}", "function fetchChartSelections(){\n\tvar chartsSelected = [];\n\tvar select_column_div = document.getElementById('select-column');\n\tvar parentEl = document.getElementById('plot-graph').children[0];\n\tfor(var i = 0;i<parentEl.children.length;i++){\n\t\tvar childEl = parentEl.children[i];\n\t\tif(childEl.type == 'checkbox' && childEl.checked){\n\t\t\tchartsSelected.push(childEl.value);\n\t\t}\n\t}\n\treturn chartsSelected;\n}", "function getCheckboxValues(){//gets the values of whatever is checked among the tag checkboxes\n let checkedVals = [];\n $('input[type=checkbox]:checked').each(function(){\n checkedVals.push($(this).val());\n });\n return checkedVals;\n}", "function getSelectedGroups () {\n let groups = []\n\n $('.nl-group').each((i, el) => {\n if (el.checked) {\n groups.push(el.id.split('checkbox-')[1])\n }\n })\n\n return groups\n }", "function selectAllCategories() {\n return db(\"categories\").select(\"*\").orderBy(\"id\");\n }", "function get_selected_observers(self){\n\t\tvar checked_rows = $('#observerPanel .cbox');\n\n\t\t/* Go through the checked rows and check which rows are really checked */\n\t\tif(checked_rows.length){\n\t\t\tvar checkbox_title = $(self).attr('title');\n\n\t\t\tvar visible_checkboxes = checked_rows.filter(function(){ //find checkboxes taht are checked\n\t\t\t\tif(!checkbox_title || checkbox_title != 'Select All'){\n\t\t\t\t\treturn($(this).is(':checked'));\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tif(!visible_checkboxes.length && checkbox_title == 'Select All'){\n\t\t\t\tvisible_checkboxes = checked_rows;\n\t\t\t}\n\n\t\t\t//Ensure that everything is checked\n\t\t\tvisible_checkboxes.attr('checked', 'checked');\n\t\t}\n\t}", "function get_selected_checkboxes(){\n\t\tvar ids = new Array(),\n\t\t\t\tchecked_rows = $('#observerPanel .cbox');\n\n\t\t/* Go through the checked rows and check which rows are really checked */\n\t\tif(checked_rows.length){\n\t\t\t$.each(checked_rows, function(){\n\t\t\t\tvar checkbox = $(this);\n\n\t\t\t\tif(checkbox.is(':checked')){\n\t\t\t\t\tvar key_item = checkbox.parent().parent().attr('id');\t\t\t\t\t\n\n\t\t\t\t\t/* Add checked row to id */\n\t\t\t\t\tif(typeof key_item !== 'undefined' && !isNaN(key_item)){\n\t\t\t\t\t\tids.push(parseInt(key_item));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn ids;\n\t}", "getCategories() {\n return Object.keys(this.state.allItems);\n }", "function checkAll(el){\n var categoriesValue=\"\";\n if($(el).prop(\"checked\")){\n $(\".category-check\").prop('checked', true);\n $(\".category-check\").parent().addClass('active');\n $(el).parent().addClass('active');\n /*$('.category-check').each(function () {\n categoriesValue+=$(this).val()+',';\n });\n categoriesValue = categoriesValue.replace(/,\\s*$/, \"\");*/\n $('#search-categories').val('all');\n }else{\n $(\".category-check\").prop('checked', false);\n $(\".category-check\").parent().removeClass('active');\n $(el).parent().removeClass('active');\n categoriesValue=\"\";\n $('#search-categories').val(categoriesValue);\n }\n}", "function getQueryStringFromCheckboxes() {\n // Get data\n var pluginData = getElasticSearchData($nodeReference),\n // Get checked checkboxes within wrapper\n checked = $(pluginData.settings.filterCbTarget).filter(\":checked\"),\n // Return facets as a string\n qs = \"\";\n // Loop through checked checkboxes within wrapper\n checked.each(function () {\n // Store element\n var checkbox = $(this);\n // Add {key} name and {value} value to query string\n qs += \"&\" + checkbox.attr(\"name\") + \"=\" + checkbox.val();\n });\n // Return query string (trim leading '&')\n return qs.substring(1);\n }", "function checkbox(categoryid, categoryname, restaurantID){\n const selectedCategory={id: categoryid, name: categoryname};\n const categorize = restaurantList.map(currentRestaurant=>{\n if(restaurantID===currentRestaurant.id){\n let labeled=false;\n currentRestaurant.category.map(currentCategory=>{\n if(currentCategory.id===categoryid){\n currentRestaurant.category.splice(currentRestaurant.category.indexOf(currentCategory),1);\n labeled=true;\n }\n return labeled;\n });\n if(labeled===false){\n currentRestaurant.category.push(selectedCategory);\n return {...currentRestaurant}\n }\n } \n return currentRestaurant; \n });\n setRestaurants(categorize);\n }", "function SelectColumnFilter({\n column: { filterValue, setFilter, preFilteredRows, id }\n}) {\n // Calculate the options for filtering\n // using the preFilteredRows\n const options = React.useMemo(() => {\n const options = new Set();\n preFilteredRows.forEach((row) => {\n options.add(row.values[id]);\n });\n return [...options.values()];\n }, [id, preFilteredRows]);\n\n // Render a multi-select box\n return (\n <div>\n <Category onClick={(e)=>{\n setFilter('')\n }}>all</Category>\n {options.map((option,i)=>(\n <Category onClick={(e)=>{\n setFilter(option)\n }}>{option}</Category>\n ))}\n </div>\n );\n}", "selectAllCategory(categoryName){\n let categoryToSelect = cloneDeep(this.state.saveData[categoryName])\n let newSelected = cloneDeep(this.state.selected) \n for (let tag of categoryToSelect){\n newSelected[tag] = true;\n }\n\n this.setState({selected:newSelected})\n\n }", "function filterByCategory(list, categoryList) {\n // TODO: MODULE_FILTERS\n // 1. Filter adventures based on their Category and return filtered list\n let arr = []\n for(let category of categoryList){\n let filterarr = list.filter(option => option.category === category)\n arr = [...arr,...filterarr]\n }\n return arr;\n\n}", "function chategoryChange (){\n buttons.forEach(function(button){\n button.addEventListener('click', function(e){\n e.preventDefault()\n const filter = e.target.dataset.filter\n \n box.forEach((item)=>{\n if(filter == \"all\") {\n item.style.display = 'block'\n } else {\n if(item.classList.contains(filter)){\n item.style.display = \"block\"\n } else {\n item.style.display = \"none\"\n }\n }\n })\n })\n })\n}", "function getPlaces(data) {\n //checkboxes asigne to variables and check if they are checked\n var vegan = $(\"input[name='vegan']\").is(':checked');\n var vegetarian = $(\"input[name='vegetarian']\").is(':checked');\n var friendly = $(\"input[name='friendly']\").is(':checked');\n\n var arr = [];\n $.each(data, function(index, item) {\n if (vegan && item.cat === 'vegan') {\n arr.push(item);\n }\n if (vegetarian && item.cat === 'vegetarian') {\n arr.push(item);\n }\n if (friendly && item.cat === 'vegan-friendly') {\n arr.push(item);\n }\n });\n return arr;\n }", "function getSelectedCheckboxes() {\n\n var checkboxes = document.getElementsByName('checkbox-data');\n var checkboxValues = [];\n\n for (var checkbox of checkboxes) {\n if (checkbox.checked) {\n checkboxValues.push(checkbox.value.toUpperCase());\n }\n }\n\n return checkboxValues;\n}" ]
[ "0.76508474", "0.72420746", "0.7092698", "0.70620507", "0.698249", "0.6687905", "0.6657451", "0.66384304", "0.6612879", "0.6597912", "0.6577332", "0.6496379", "0.6468213", "0.63815016", "0.638109", "0.63311845", "0.63201123", "0.6318747", "0.62960666", "0.6282335", "0.618099", "0.61746854", "0.61683214", "0.6163833", "0.6147437", "0.6117131", "0.610999", "0.6107998", "0.6084158", "0.60717195", "0.60691947", "0.60644966", "0.6031828", "0.6023112", "0.6005601", "0.5989933", "0.59269446", "0.59262955", "0.59214765", "0.5916676", "0.5916558", "0.5896065", "0.5883579", "0.5881523", "0.5869173", "0.5857857", "0.585231", "0.5841832", "0.5833481", "0.58287466", "0.5828661", "0.57709223", "0.5762269", "0.5758418", "0.575377", "0.57456505", "0.5732709", "0.572973", "0.5727267", "0.57259977", "0.57193077", "0.5711417", "0.56847227", "0.5676671", "0.5665624", "0.5664703", "0.56321275", "0.5626757", "0.5624253", "0.5620051", "0.56181645", "0.5617082", "0.5615618", "0.56125486", "0.56119174", "0.559134", "0.5589708", "0.5589653", "0.5581655", "0.556364", "0.5562166", "0.55604964", "0.5553984", "0.55463135", "0.5534136", "0.55326194", "0.5532174", "0.55257404", "0.55140275", "0.55137515", "0.5508171", "0.55013996", "0.5500802", "0.54996216", "0.5491763", "0.54821247", "0.5465181", "0.5458314", "0.5446523", "0.5438492" ]
0.62709415
20
Hides the weather filter container and displays all of the recipes in a grid format
function display_selected_recipes() { document.querySelector('#weather-filter-container').style.display = 'none'; document.querySelector('#select-filters').style.display = 'block'; document.querySelector('#recipes-title').style.display = 'block'; document.querySelector('#grid-container').style.display = 'grid'; window.recipes.forEach(recipe => { if (recipe['weather']) { recipe.style.display = 'block'; } else { recipe.style.display = 'none'; } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayIngrList() { /*to show the all ingredient list*/\n loadFilteredIngr();\n document.getElementById(\"suggIngr\").style.display = \"flex\"; /*flex to allow suggIngr to appear in column*/\n document.querySelector(\"#ingrFilter .fa-chevron-up\").style.display = \"block\";\n document.querySelector(\"#ingrFilter .fa-chevron-down\").style.display = \"none\";\n\n document.getElementById(\"suggApp\").style.display = \"none\";\n document.querySelector(\"#appFilter .fa-chevron-down\").style.display = \"block\";\n document.querySelector(\"#appFilter .fa-chevron-up\").style.display = \"none\";\n\n document.getElementById(\"suggUst\").style.display = \"none\";\n document.querySelector(\"#ustFilter .fa-chevron-down\").style.display = \"block\";\n document.querySelector(\"#ustFilter .fa-chevron-up\").style.display = \"none\";\n}", "function showRecipe() {\n grid.style.display = \"none\"\n\n var ingredients = [recipe.drinks[0].strIngredient1, recipe.drinks[0].strIngredient2, recipe.drinks[0].strIngredient3, recipe.drinks[0].strIngredient4, recipe.drinks[0].strIngredient5, recipe.drinks[0].strIngredient6, recipe.drinks[0].strIngredient7, recipe.drinks[0].strIngredient8, recipe.drinks[0].strIngredient9, recipe.drinks[0].strIngredient10, recipe.drinks[0].strIngredient11, recipe.drinks[0].strIngredient12, recipe.drinks[0].strIngredient13, recipe.drinks[0].strIngredient14, recipe.drinks[0].strIngredient15];\n var measure = [recipe.drinks[0].strMeasure1, recipe.drinks[0].strMeasure2, recipe.drinks[0].strMeasure3, recipe.drinks[0].strMeasure4, recipe.drinks[0].strMeasure5, recipe.drinks[0].strMeasure6, recipe.drinks[0].strMeasure7, recipe.drinks[0].strMeasure8, recipe.drinks[0].strMeasure9, recipe.drinks[0].strMeasure10, recipe.drinks[0].strMeasure11, recipe.drinks[0].strMeasure12, recipe.drinks[0].strMeasure13, recipe.drinks[0].strMeasure14, recipe.drinks[0].strMeasure15];\n\n recipeUl.innerHTML = recipe.drinks[0].strDrink\n var direction = document.createElement('li');\n direction.innerHTML = recipe.drinks[0].strInstructions\n recipeUl.appendChild(direction)\n for (let i = 0; i < ingredients.length; i++) {\n if (ingredients[i] !== null) {\n var recipeEl = document.createElement('li');\n recipeEl.innerHTML = ingredients[i] + \" \";\n recipeUl.appendChild(recipeEl);\n }\n if (measure[i] !== null) {\n var spanEl = document.createElement('span');\n spanEl.innerHTML = measure[i];\n recipeEl.appendChild(spanEl);\n }\n }\n glass.src = recipe.drinks[0].strDrinkThumb + \"/preview\";\n glassEl.appendChild(glass);\n\n}", "function displayFilters() {\n\t\t$('.filters').slideToggle();\n\t}", "function display_all(recipes) {\n recipes.forEach(recipe => {\n recipe['weather'] = true;\n });\n display_selected_recipes();\n}", "function displayRecipes(recipeData) {\n console.log(\"showing recipes\");\n $('#recipe-area').removeClass('hidden');\n $('#recipe-area').append(\n `<div class = \"results-header\">\n <p>What to Eat</p>\n </div>\n <section class= \"recipe-boxes\">\n <ul class=\"recipe\">\n <li><h3><a href=\"${recipeData.recipes[0].sourceUrl}\" target=\"_blank\">${recipeData.recipes[0].title}</a>\n <img src=\"${recipeData.recipes[0].image}\" alt=\"${recipeData.recipes[0].title} image\">\n </li>\n \n <li><h3><a href=\"${recipeData.recipes[1].sourceUrl}\" target=\"_blank\">${recipeData.recipes[1].title}</a>\n <img src=\"${recipeData.recipes[1].image}\" alt=\"${recipeData.recipes[1].title} image\">\n </li>\n \n <li><h3><a href=\"${recipeData.recipes[2].sourceUrl}\" target=\"_blank\">${recipeData.recipes[2].title}</a>\n <img src=\"${recipeData.recipes[2].image}\" alt=\"${recipeData.recipes[2].title} image\">\n </li>\n </ul>\n </section>`\n );\n}", "function styleWeather(){\n home.style.display='none';\n addItemDiv.style.display='none';\n weather.style.display='flex';\n}", "function display_Initial_ProductsStockView(width, howManyProducts) {\n if (width) {\n for (let i = 0; i < $productsFilter.children.length; i++) {\n if (i > howManyProducts) {\n $productsFilter.children[i].style.display = \"none\";\n }\n }\n }\n }", "function hideFilter() {\n svg.selectAll('.coursesoverview_split').remove();\n }", "function showWeatherResults() {\n const weather = document.getElementById('weather-segment');\n weather.style.display = 'block';\n }", "function displayWeather(weatherData) {\n const { data } = weatherData;\n data.forEach((item, index) => {\n const {\n max_temp,\n min_temp,\n weather,\n clouds,\n wind_sp,\n wind_cdir,\n pop,\n vis,\n snow,\n snow_depth,\n uv,\n } = item;\n const {\n icon,\n description,\n } = weather;\n let max_tempCel = convertToCelcius(max_temp);\n let min_tempCel = convertToCelcius(min_temp);\n $('#js-result-section div').find(`[id='js-date${index}']`).append(`\n <div class=\"col s10 offset-s1 m6 center\" role=\"region\" aria-label=\"weather summary\">\n <img src=\"icons/${icon}.png\" alt=\"weather icon\">\n <p><span class=\"min-temp\">${min_temp}</span> / <span class=\"max-temp\">${max_temp}</span> &deg;F</p>\n <p><span class=\"min-temp\">${min_tempCel}</span> / <span class=\"max-temp\">${max_tempCel}</span> &deg;C</p>\n <p>${description}</p>\n </div>\n <div class=\"col s10 offset-s1 m6 right\" role=\"region\" aria-label=\"weather summary\">\n <ul class=\"left-align\" role=\"list\" aria-label=\"detailed weather data\">\n <li role=\"listitem\"><strong>Cloud coverage:</strong> &nbsp;&nbsp;${clouds} %</li>\n <li role=\"listitem\"><strong>Wind speed:</strong>&nbsp;&nbsp;${wind_sp} m/s</li>\n <li role=\"listitem\"><strong>Wind direction:</strong>&nbsp;&nbsp;${wind_cdir}</li>\n <li role=\"listitem\"><strong>Probability of precip:</strong>&nbsp;&nbsp;${pop}%</li>\n <li role=\"listitem\"><strong>Visibility:</strong>&nbsp;&nbsp;${vis} km</li>\n <li role=\"listitem\"><strong>Snow:</strong>&nbsp;&nbsp;${snow} mm</li>\n <li role=\"listitem\"><strong>Snow depth:</strong>&nbsp;&nbsp;${snow_depth} mm</li>\n <li role=\"listitem\"><strong>Daily max. UV (0-11+):</strong>&nbsp;&nbsp;${uv}</li>\n </ul>\n </div>`);\n });\n}", "function showStores() {\n console.log(\"showStores()\");\n stores.forEach(store => {\n //creating div container\n var storeContainer = document.createElement(\"div\");\n storeContainer.classList.add(\"store-container\");\n document.querySelector(\".container\").append(storeContainer);\n //adding 1rst column (category)\n var storeName = document.createElement(\"h2\");\n storeName.classList.add(\"name\");\n storeName.innerText = store.fields.name;\n storeContainer.append(storeName);\n //adding 1rst column (category)\n var storeCategory = document.createElement(\"h3\");\n storeCategory.classList.add(\"category\");\n storeCategory.innerText = store.fields.category;\n storeContainer.append(storeCategory);\n //adding 2nd column (from)\n var storeFrom = document.createElement(\"p\");\n storeFrom.classList.add(\"from\");\n storeFrom.innerText = store.fields.from;\n storeContainer.append(storeFrom);\n //adding 3rd column(pix) for images using \"img\" and src\n var storePix = document.createElement(\"img\");\n storePix.classList.add(\"pix\");\n storePix.src = store.fields.pix[0].url;\n storeContainer.append(storePix);\n // add event listener\n // when user clicks on cake container\n //img and description will appear or disappear\n storeContainer.addEventListener(\"click\", function() {\n storeFrom.classList.toggle(\"active\");\n storePix.classList.toggle(\"active\");\n storeCategory.classList.toggle(\"active\");\n });\n //get genre field from airtable\n //loop through array and add each genre as a class\n //to song container\n //genre can be word u want\n var storeLocations = store.fields.category;\n storeLocations.forEach(function(from) {\n storeContainer.classList.add(from);\n });\n // filter by cafe\n var filterCafe = document.querySelector(\".cafe-button\");\n filterCafe.addEventListener(\"click\", function() {\n if (storeContainer.classList.contains(\"Cafe\")) {\n storeContainer.style.display = \"block\";\n } else {\n storeContainer.style.display = \"none\";\n }\n });\n // filter by lifestyle\n var filterLifestyle = document.querySelector(\".lifestyle-button\");\n filterLifestyle.addEventListener(\"click\", function() {\n if (storeContainer.classList.contains(\"Lifestyle\")) {\n storeContainer.style.display = \"block\";\n } else {\n storeContainer.style.display = \"none\";\n }\n });\n // filter by brand\n var filterBrand = document.querySelector(\".brand-button\");\n filterBrand.addEventListener(\"click\", function() {\n if (storeContainer.classList.contains(\"Brand\")) {\n storeContainer.style.display = \"block\";\n } else {\n storeContainer.style.display = \"none\";\n }\n });\n // filter by art\n var filterArt = document.querySelector(\".art-button\");\n filterArt.addEventListener(\"click\", function() {\n if (storeContainer.classList.contains(\"Art\")) {\n storeContainer.style.display = \"block\";\n } else {\n storeContainer.style.display = \"none\";\n }\n });\n // filter by bar\n var filterBar = document.querySelector(\".bar-button\");\n filterBar.addEventListener(\"click\", function() {\n if (storeContainer.classList.contains(\"Bar\")) {\n storeContainer.style.display = \"block\";\n } else {\n storeContainer.style.display = \"none\";\n }\n });\n // filter by vintage\n var filterVintage = document.querySelector(\".vintage-button\");\n filterVintage.addEventListener(\"click\", function() {\n if (storeContainer.classList.contains(\"Vintage\")) {\n storeContainer.style.display = \"block\";\n } else {\n storeContainer.style.display = \"none\";\n }\n });\n // filter by resto\n var filterRestaurant = document.querySelector(\".resto-button\");\n filterRestaurant.addEventListener(\"click\", function() {\n if (storeContainer.classList.contains(\"Restaurant\")) {\n storeContainer.style.display = \"block\";\n } else {\n storeContainer.style.display = \"none\";\n }\n });\n // filter by variety\n var filterVariety = document.querySelector(\".variety-button\");\n filterVariety.addEventListener(\"click\", function() {\n if (storeContainer.classList.contains(\"Variety\")) {\n storeContainer.style.display = \"block\";\n } else {\n storeContainer.style.display = \"none\";\n }\n });\n\n });\n}", "function hideFilters() {\n\t\t$('.filters').hide();\n\t}", "function hideFormShowGrid() {\n \n // Uses IIFE to get human data from form\n human = (function (){\n formData = new FormData(form); \n let height = parseInt(formData.get('feet'))*12 + parseInt(formData.get('inches'));\n \n return new Human(formData.get('weight'),height, formData.get('diet'), formData.get('name'));\n })();\n\n form.style.display = 'none'; \n generateTiles(); \n }", "function hideall(){ \n\t\t$('.counties-container').css(\"display\",\"none\");\n\t}", "function showAllBricks() {\r\n bricks.forEach(column => {\r\n column.forEach(brick => {\r\n brick.visible = true;\r\n })\r\n })\r\n}", "function showAll() {\n\t\n\tif (modus == \"Map\") {\n\t\tcities2000.selectAll(\".city_2000\")\n\t\t\t.style(\"fill-opacity\", 0.7);\n\t\t\t\n\t\tcities2010.selectAll(\".city_2010\")\n\t\t\t.style(\"fill-opacity\", 0.5);\n\t} else {\n\t\tcities2000.selectAll(\".city_2000\")\n\t\t\t.style(\"fill-opacity\", 0.9);\n\t\t\t\n\t\tcities2010.selectAll(\".city_2010\")\n\t\t\t.style(\"fill-opacity\", 0.9);\t\t\n\t\t\n\t}//else\n\t\n\tif (modus == \"Slope\") {\n\t\tslopes.selectAll(\".slopes\")\n\t\t\t.style(\"opacity\", 0.4);\n\t\t\t\n\t\ttext2000.selectAll(\"text\")\n\t\t\t.style(\"opacity\", 0)\n\t\t\t.filter(function(d) { return eval(\"d.rank_\" + rVar) < 10;})\n\t\t\t.style(\"opacity\", 0.7);\n\t\t\t\n\t\ttext2010.selectAll(\"text\")\n\t\t\t.style(\"opacity\", 0)\n\t\t\t.filter(function(d) { return eval(\"d.rank_\" + rVar) < 10;})\n\t\t\t.style(\"opacity\", 0.7);\n\t}//if\n\t\n\t//Remove visibility of callout in lower left corner\n\tif (modus == \"Map\" | modus == \"Dot\") {\n\t\td3.select(\"#callOut\").style(\"visibility\",\"hidden\");\n\t}//if\n\t\n}//slopeAll\t", "hideLower() {\n const filteredTiles = this._filterForLower();\n if (!filteredTiles || !filteredTiles.length) {\n this._error(`No islands found buying for below ${this.minimumBells}.`);\n return;\n }\n\n filteredTiles.forEach((tag) => {\n const parent = tag.parentElement.parentElement.parentElement;\n if (parent) parent.setAttribute('style', 'display: none;'); \n });\n this._info(`Hidden islands lower than ${this.minimumBells}.`);\n }", "function displayRecipe(data) {\n var Recipe = data.meals[0];\n var RecipeDiv = document.getElementById(\"event-list-group\");\n \n var recipeContainer = document.createElement(\"div\");\n $(recipeContainer).addClass(\"recipe-container columns\");\n\n var RecipeImg = document.createElement(\"img\");\n RecipeImg.id = \"::img\";\n RecipeImg.style.cssText = \"width:300px;height:300px;\";\n $(RecipeImg).addClass(\"inline-img col-auto\");\n RecipeImg.src = Recipe.strMealThumb;\n recipeContainer.appendChild(RecipeImg);\n\n var contentDiv = document.createElement(\"div\");\n $(contentDiv).addClass(\"col-auto\");\n\n var RecipeIngredients = document.createElement(\"ul\");\n $(RecipeIngredients).addClass(\"inline-ul\");\n contentDiv.appendChild(RecipeIngredients);\n\n recipeContainer.appendChild(contentDiv);\n\n RecipeDiv.appendChild(recipeContainer);\n\n $(\"<label>\")\n .addClass(\"form-checkbox\")\n .html(\"<input class='recipe-checkbox' type='checkbox'><i class='form-icon'></i> Add Recipe\")\n .appendTo(contentDiv);\n\n\n var getIngredients = Object.keys(Recipe)\n .filter(function (ingredient) {\n return ingredient.indexOf(\"strMeal\") == 0;\n })\n .reduce(function (ingredients, ingredient) {\n if (Recipe[ingredient] != null) {\n ingredients[ingredient] = Recipe[ingredient];\n }\n return ingredients;\n }, {});\n\n var getArea = Object.keys(Recipe)\n .filter(function (ingredient) {\n return ingredient.indexOf(\"strArea\") == 0;\n })\n .reduce(function (ingredients, ingredient) {\n if (Recipe[ingredient] != null) {\n ingredients[ingredient] = Recipe[ingredient];\n }\n return ingredients;\n }, {});\n\n var getCategory = Object.keys(Recipe)\n .filter(function (ingredient) {\n return ingredient.indexOf(\"strCategory\") == 0;\n })\n .reduce(function (ingredients, ingredient) {\n if (Recipe[ingredient] != null) {\n ingredients[ingredient] = Recipe[ingredient];\n }\n return ingredients;\n }, {});\n\n var getSource = Object.keys(Recipe)\n .filter(function (ingredient) {\n return ingredient.indexOf(\"strSource\") == 0;\n })\n .reduce(function (ingredients, ingredient) {\n if (Recipe[ingredient] != null) {\n ingredients[ingredient] = Recipe[ingredient];\n }\n return ingredients;\n }, {});\n\n var getVideo = Object.keys(Recipe)\n .filter(function (ingredient) {\n return ingredient.indexOf(\"strYoutube\") == 0;\n })\n .reduce(function (ingredients, ingredient) {\n if (Recipe[ingredient] != null) {\n ingredients[ingredient] = Recipe[ingredient];\n }\n return ingredients;\n }, {});\n\n let value = getIngredients[\"strMeal\"];\n listItem = document.createElement(\"li\");\n listItem.innerHTML = value;\n RecipeIngredients.appendChild(listItem);\n\n let area = getArea[\"strArea\"];\n listItem = document.createElement(\"li\");\n listItem.innerHTML = area;\n RecipeIngredients.appendChild(listItem);\n\n let category = getCategory[\"strCategory\"];\n listItem = document.createElement(\"li\");\n listItem.innerHTML = category;\n RecipeIngredients.appendChild(listItem);\n\n let recipeSource = getSource[\"strSource\"];\n if (recipeSource) {\n var link = $(\"<li>\").appendTo(listItem);\n $(\"<a>\")\n .text(\"Recipe Link\")\n .attr(\"href\", `${recipeSource}`)\n .attr(\"target\", \"_blank\")\n .appendTo(link);\n }\n\n let recipeVideo = getVideo[\"strYoutube\"];\n if (recipeVideo) {\n var videolink = $(\"<li>\").appendTo(listItem);\n $(\"<a>\")\n .text(\"Recipe YouTube Video\")\n .attr(\"href\", `${recipeVideo}`)\n .attr(\"target\", \"_blank\")\n .appendTo(videolink);\n }\n}", "function showAll() {\n for (var simCount = 0; simCount < simData[\"simulations\"].length; simCount++) {\n var card = document.getElementsByClassName('thumbnail-view')[simCount],\n cardDelete = document.getElementsByClassName('tile-delete')[simCount],\n cardDownload = document.getElementsByClassName('tile-download')[simCount];\n card.classList.remove('hide-back');\n cardDelete.classList.add('hide');\n cardDownload.classList.remove('hide');\n }\n }", "function resetFilter() {\n let reset = document.getElementsByClassName(\"col-3\");\n for (i = 0; i < reset.length; i++) {\n reset[i].style.display = \"block\";\n }\n}", "function showAllBricks() {\n bricks.forEach(column => {\n column.forEach(brick => (brick.visible = true));\n });\n}", "function showAllBricks() {\n bricks.forEach((column) => {\n column.forEach((brick) => (brick.visible = true));\n });\n}", "hideAll() {\n\n\t\tthis._gridIterator( col => {\n\t\t\tcol.$elem.hide();\n\t\t});\n\t}", "showAll() {\n\n\t\tthis._gridIterator( col => {\n\t\t\tcol.$elem.show();\n\t\t});\n\t}", "function hideFilters() {\n $('.hide-filters').hide()\n $('.show-filters').show()\n $('.panel-body').hide()\n}", "function showColumns(){\n\t\n\t//loop through the column filter inputs to determine which ones are checked or not to display the areas\n\tjQuery(\"#column_filter\").children('ul').children('li').each(function(){\n\t\tinitColumn(jQuery(this).children('input').attr('id'));\n\t});\t\n}", "function displayWeather(response){\n displaySection.style.visibility = 'visible';\n tempDisplay.style.visibility = 'visible'; \n descriptionSection.style.visibility = 'visible';\n weatherDisplay.style.visibility = 'visible';\n cityDisplay.innerText = response.name;\n tempDisplay.innerHTML = `${Math.floor(response.main.temp)} °F`;\n descriptionSection.innerText = response.weather[0].description; \n weatherDisplay.innerHTML = `<img src = \"http://openweathermap.org/img/wn/${response.weather[0].icon}@2x.png\">`;\n\n}", "function filterPageDisplayAll() {\n $record_lines.show();\n $no_record_lines.hide();\n }", "function showRecipe(recipe) {\n\n // display index page inside recipe section\n const recipe_pages = document.getElementById('navigatingIndex');\n if (recipe_pages !== null) recipe_pages.innerHTML = navigatingIndex;\n\n let nutrients_labels = [],\n nutrients_values = [],\n nutrients_daily = [],\n recipe_calories = [],\n recipe_img_url = [],\n recipe_label = [];\n\n \n // check for a valid length of the array\n if (recipe.hits.length > 0) {\n\n const childNodes = plant_detail.childNodes;\n\n childNodes.forEach(node => {\n\n // if a node's style is defined\n node.style !== undefined ? \n\n // if the node's id is table_wrapper\n node.id === 'table_wrapper' ? \n (node.style.right = '-100%', node.style.position = 'absolute') :\n\n // or if the node's id is nutrientsChart\n node.id === 'nutrientsChart' ? \n (node.style.bottom = '0px') :\n\n // or if the node's id is recipe_wrapper\n node.id === 'recipe_wrapper' ? \n (node.style.zIndex = 2) :\n\n // otherwise\n (node.style.left = '-100%') :\n undefined;\n });\n \n // loop through the array\n for (let i = 0; i < recipe.hits.length; i++) {\n\n recipe_calories.push(recipe.hits[i].recipe.calories + 'kcal / serving');\n recipe_img_url.push(recipe.hits[i].recipe.image);\n recipe_label.push(recipe.hits[i].recipe.label);\n\n const recipe_digest = recipe.hits[i].recipe.digest;\n\n // loop through digest array\n for(let j = 0; j < recipe_digest.length; j++) {\n \n nutrients_labels.push(recipe_digest[j].label);\n nutrients_values.push(recipe_digest[j].total);\n nutrients_daily.push(recipe_digest[j].daily);\n }\n }\n\n \n // divide the total number of recipes into individual one\n const divided = nutrients_values.length / recipe.hits.length;\n\n // create next and previous buttons for the recipe detail navigations\n if (document.querySelector('.recipe_nav_buttons') === null)\n nextPrevButtons(recipe);\n else if (document.querySelector('.recipe_detail_img_container') !== null) {\n removeElements(document.getElementsByTagName('h4'));\n removeElements([document.querySelector('.recipe_detail_img_container')]);\n }\n \n const img = document.createElement('img'),\n img_div = document.createElement('div');\n img.src = recipe_img_url[navigatingIndex];\n img.className = 'recipe_detail_img'\n img_div.className = 'recipe_detail_img_container';\n img_div.style.display = 'block';\n\n // append the img to the img div\n img_div.appendChild(img);\n\n // create the title of the recipe\n const title = document.createElement('h4');\n title.innerHTML = recipe_label[navigatingIndex];\n \n // append the title to recipe_wrapper div as the first element\n recipe_wrapper.insertAdjacentElement('afterbegin', title);\n\n // append the img div to recipe_wrapper div as the next sibling of title header\n title.parentNode.insertBefore(img_div, title.nextSibling);\n\n // default value for the display, in order to show the first recipe\n nutrients_values = nutrients_values.slice(divided * navigatingIndex, divided * (navigatingIndex + 1));\n nutrients_labels = nutrients_labels.slice(divided * navigatingIndex, divided * (navigatingIndex + 1));\n\n // draw a chart with the total number of recipes,\n // all recipe's total values, all the corresponding labels, and healthy daily consumption of the nutrients\n chartData(nutrients_values, nutrients_labels, 2);\n }\n}", "function hideWheels(dw, i) {\n\t $('.dwfl', dw).css('display', '').slice(i).hide();\n\t }", "function displayWeather(weatherData) {\n console.log(\"showing final weather\");\n $('#forecast-area').removeClass('hidden');\n $('#forecast-area').append(\n `<div class = \"results-header\">\n <p>Weather Info</p>\n </div>\n <h3>${weatherData.properties.periods[0].detailedForecast}</h3>`\n );\n}", "function loadTag () {\n\n\n const ingredients = recipes.filter (recipe => {\n return tags.ingredients.every (tag => {\n return recipe[\"ingredients\"].some (t => tag.value.toLowerCase() === t.ingredient.toLowerCase())\n })\n })\n\n const ustensils = ingredients.filter (recipe => {\n return tags.ustensils.every (tag => {\n return recipe[\"ustensils\"].some (t => tag.value.toLowerCase() === t.toLowerCase())\n })\n })\n\n const data = ustensils.filter (recipe => {\n return tags.appareils.every (tag => {\n return recipe.appliance.toLowerCase() === tag.value.toLowerCase()\n })\n })\n\n recipes.map (recipe => {\n\n const recipeElement = document.getElementsByClassName(\"recipe-\"+recipe.id)[0]\n\n recipeElement.style.display = \"none\"\n\n })\n\n data.map (recipe => {\n const recipeElement = document.getElementsByClassName(\"recipe-\"+recipe.id)[0]\n\n recipeElement.style.display = \"\"\n })\n\n}", "function displayWeather() {\n document.querySelector('.top').classList.remove('hidden');\n city.textContent = `${weather.city}, ${weather.country}`;\n temp.textContent = Math.round(weather.temperature);\n description.textContent = weather.description;\n icon.innerHTML = `<img src=\"icons/${weather.iconId}.png\" alt=\"Weather Icon\"/>`;\n humidity.textContent = `Humidity: ${weather.humidity} %`;\n feelLike.textContent = `Feels like: ${Math.round(weather.feels_like)} °C`;\n wind.textContent = `Wind: ${Math.round(weather.wind_speed)} m/s`;\n high.textContent = Math.round(weather.temp_high);\n low.textContent = Math.round(weather.temp_low);\n document.querySelector('.credit').classList.remove('hidden');\n const date = new Date(weather.last_updated);\n lastUpdated.textContent = `\n ${date.getHours().toString().padStart('2', '0')} : \n ${date.getMinutes().toString().padStart('2', '0')}`;\n}", "render() {\n let filteredGridItemsData = gridItems.data.filter((gridItem) => {\n let boolean = gridItem.caption.toLowerCase().includes(this.props.filterString);\n return boolean;\n });\n\n let spinnerDisplay = this.props.gridVisibility === 'hidden' ? 'inline-block' : 'none';\n\n return (\n <SelfiesSection filteredGridItemsData={filteredGridItemsData}\n spinnerDisplay={spinnerDisplay}\n blurEffect={this.props.blurEffect} \n gridVisibility = {this.props.gridVisibility} \n isModalOn={this.props.isModalOn}\n imgRefs={this.imgRefs} />\n );\n }", "function weatherCondition() {\n let weatherInfo = document.getElementById(\"conditions\");\n weatherInfo.style.visibility = \"visible\";\n}", "function showAllCollections() {\n $(\".brain_map_image\").removeClass(\"hidden\")\n}", "hideFilterBar() {\n const me = this,\n columns = me.grid.columns;\n\n // we don't want to hear back store \"filter\" event while we're resetting store filters\n me.clearStoreFiltersOnHide && me.suspendStoreTracking();\n\n // hide the fields, each silently - no updating of the store's filtered state until the end\n columns && columns.forEach((col) => me.hideColumnFilterField(col, true));\n\n // Now update the filtered state\n me.grid.store.filter();\n\n me.clearStoreFiltersOnHide && me.resumeStoreTracking();\n\n me.hidden = true;\n }", "function hideBuilding() {\n hideMarker( buildingIndex );\n}", "function hideClearFilterBtn() {\n SetNodesVisibility(\".clear-filter\", false);\n}", "function hideAll() {\n divInfo.forEach(function(el) {\n el.style.display = 'none';\n });\n}", "function showFiltersTop2(odsLenght) {\n\tfor (var i=6; i<parseInt(odsLenght);i++) {\n\t\tvar li = \"liOds\"+(i);\n\t\tdocument.getElementById(li).style.display = 'block';\n\t\tdocument.getElementById('f_vermas2').style.display = 'none';\n\t}\n}", "function cleanUp() {\n hide($home);\n hide($welcome);\n $cateList.empty();\n hide($recipesArea);\n // hide($recipesSearchArea); \n $recipes.empty();\n $noResults.empty();\n $recipeDetail.empty();\n hide($addOrEditDiy);\n hide($diyRecipes);\n $diyList.empty();\n $diyRecipeDetail.empty();\n $mealPlan.empty();\n hide($recExploreBtn);\n }", "function showAngels(){\n console.log(\"showAngels()\");\n angels.forEach((angel)=> {\n //this is where our ANGEL Information will go\n var angelContainer = document.createElement(\"div\");\n angelContainer.classList.add(\"angel-container\");\n document.querySelector(\".container\").append(angelContainer);\n\n //add ANGEL names to our angel containers\n var angelName = document.createElement(\"h1\");\n angelName.classList.add(\"angel-Name\");\n angelName.innerText = angel.fields.Name;\n angelContainer.append(angelName);\n\n var angelDescription = document.createElement(\"p\");\n angelDescription.classList.add(\"angel-description\");\n angelDescription.innerText = angel.fields.description;\n angelContainer.append(angelDescription);\n\n var angelImages = document.createElement(\"img\");\n angelImages.classList.add(\"angel-Images\");\n angelImages.src = angel.fields.Images[0].url;\n angelContainer.append(angelImages);\n\n //add event listener\n //when user clicks on angel container\n //the image will appear or dissapear\n\n angelContainer.addEventListener(\"click\", function() {\n angelName.classList.toggle(\"active\");\n angelDescription.classList.toggle(\"active\");\n angelImages.classList.toggle(\"active\");\n });\n\n // get genre field from airtable\n // loop through the array and add each genre as\n // a class to the angel container\n var angelGenre = angel.fields.genre;\n angelGenre.forEach(function(genre) {\n angelContainer.classList.add(genre);\n });\n\n // clicking on filter by new york series\n // change background of new york series to red\n // else change to white\n var filterNewYork = document.querySelector(\".js-new-york\");\n filterNewYork.addEventListener(\"click\", function() {\n if (angelContainer.classList.contains(\"new_york\")) {\n angelContainer.style.background = \"#ff77ff\";\n } else {\n angelContainer.style.background = \"white\";\n }\n });\n\n // filter by marine series\n var filterMarine = document.querySelector(\".js-marine\");\n filterMarine.addEventListener(\"click\", function() {\n if (angelContainer.classList.contains(\"marine\")) {\n angelContainer.style.background = \"#a6d608\";\n } else {\n angelContainer.style.background = \"white\";\n }\n });\n\n // filter by vegetable series\n var filterVegetable = document.querySelector(\".js-vegetable\");\n filterVegetable.addEventListener(\"click\", function() {\n if (angelContainer.classList.contains(\"vegetable\")) {\n angelContainer.style.background = \"#fe4164\";\n } else {\n angelContainer.style.background = \"white\";\n }\n });\n\n // filter by cactus\n var filterCactus = document.querySelector(\".js-cactus\");\n filterCactus.addEventListener(\"click\", function() {\n if (angelContainer.classList.contains(\"cactus\")) {\n angelContainer.style.background = \"#adff2f\";\n } else {\n angelContainer.style.background = \"white\";\n }\n });\n\n //filter by flower\n var filterFlower = document.querySelector(\".js-flower\");\n filterFlower.addEventListener(\"click\", function() {\n if (angelContainer.classList.contains(\"flower\")) {\n angelContainer.style.background = \"#ac1e44\";\n } else {\n angelContainer.style.background = \"white\";\n }\n });\n\n //filter by birthday bear\n \n var filterBirthday = document.querySelector(\".js-birthday\");\n filterBirthday.addEventListener(\"click\", function() {\n if (angelContainer.classList.contains(\"birthday\")) {\n angelContainer.style.background = \"orange\";\n } else {\n angelContainer.style.background = \"white\";\n }\n });\n\n //filter by sweets\n var filterSweets = document.querySelector(\".js-sweets\");\n filterSweets.addEventListener(\"click\", function() {\n if (angelContainer.classList.contains(\"sweets\")) {\n angelContainer.style.background = \"purple\";\n } else {\n angelContainer.style.background = \"white\";\n }\n });\n\n //filter by wonderland\n var filterWonderland = document.querySelector(\".js-wonderland\");\n filterWonderland.addEventListener(\"click\", function() {\n if (angelContainer.classList.contains(\"wonderland\")) {\n angelContainer.style.background = \"#ffcff1\";\n } else {\n angelContainer.style.background = \"white\";\n }\n });\n\n //filter by animal\n var filterAnimal = document.querySelector(\".js-animal\");\n filterAnimal.addEventListener(\"click\", function() {\n if (angelContainer.classList.contains(\"animal\")) {\n angelContainer.style.background = \"#df00ff\";\n } else {\n angelContainer.style.background = \"white\";\n }\n });\n\n //filter by valentines day\n var filterValentines = document.querySelector(\".js-valentines\");\n filterValentines.addEventListener(\"click\", function() {\n if (angelContainer.classList.contains(\"valentines\")) {\n angelContainer.style.background = \"deeppink\";\n } else {\n angelContainer.style.background = \"white\";\n }\n });\n\n //filter by fruit\n var filterFruit = document.querySelector(\".js-fruit\");\n filterFruit.addEventListener(\"click\", function() {\n if (angelContainer.classList.contains(\"fruit\")) {\n angelContainer.style.background = \"pink\";\n } else {\n angelContainer.style.background = \"white\";\n }\n });\n\n //filter by space adventure\n var filterSpace = document.querySelector(\".js-space\");\n filterSpace.addEventListener(\"click\", function() {\n if (angelContainer.classList.contains(\"space\")) {\n angelContainer.style.background = \"red\";\n } else {\n angelContainer.style.background = \"white\";\n }\n });\n\n // filter reset\n var filterReset = document.querySelector(\".js-reset\");\n filterReset.addEventListener(\"click\", function() {\n songContainer.style.background = \"white\";\n });\n });\n}", "function displayForecast(forecast){\n var day;\n var dayId;\n var icon;\n var iconId;\n var iconSrc;\n var high;\n var highId;\n var low;\n var lowId;\n\n\n //loop to diaplay date, weather icon, high, and low temp in cards for 5 day forecast\n for(var i = 0; i < 5; i++){\n\n day = returnTime(forecast[i].dt);\n dayId = '#day' + i;\n $(dayId).text(day);\n\n icon = forecast[i].weather[0].icon;\n iconSrc = 'https://openweathermap.org/img/wn/' + icon + '@2x.png';\n iconId = '#weatherIcon' + i;\n $(iconId).attr('src', iconSrc);\n\n high = 'High: ' + forecast[i].temp.max;\n highId = '#high' + i;\n $(highId).text(high);\n $(highId).append(' &#8457;');\n\n low = 'Low: ' + forecast[i].temp.min;\n lowId = '#low' + i;\n $(lowId).text(low);\n $(lowId).append(' &#8457;');\n\n }//end for loop\n\n //display weather\n $('.cityWeather').css('visibility', 'visible');\n\n} //end function displayForecast", "function workGrid() {\n var $container5 = $('.work5').isotope({\n itemSelector: '.thumbnail',\n masonry: {\n columnWidth: '.thumbnail'\n }\n });\n // filter items on button click\n $('.filters').on( 'click', 'li', function() {\n var filterValue = $(this).attr('data-filter');\n $container5.isotope({ filter: filterValue });\n });\n}", "function filterProducts(productTypeId) {\n let rows = document.getElementById('arow').children;\n if (productTypeId == \"-1\") {\n for (let z = 0;z<rows.length;z++) {\n rows[z].setAttribute('style',\"width: 15%, display: inline-block\")\n }\n } else {\n for (let z = 0;z<rows.length;z++) {\n if(rows[z].id != productTypeId) {\n rows[z].setAttribute('style', \"display: none\")\n } else {\n rows[z].setAttribute('style',\"width: 15%, display: inline-block\")\n }\n }\n }\n}", "function showHideContentGrids(ww, rows, $el) {\n var contentType = $el.closest('.tg-content-grid').attr('data-content-grid-type');\n\n $el.find('.l-gi').show();\n\n if (contentType == '2') {\n switch (true) {\n case ww > 760:\n break;\n default:\n $el.find('.l-gi').slice(-rows).hide();\n }\n }\n \n if (contentType == '3') {\n switch (true) {\n case ww > 1140:\n $el.find('.tg-list-no-border').removeClass('tg-list-no-border');//Alignment ticket\n break;\n case ww > 760:\n $el.find('.l-gi').slice(-rows).hide();\n $el.find('.l-gi').not(':hidden').slice(-2).addClass('tg-list-no-border');//Alignment ticket\n break;\n default:\n $el.find('.l-gi').slice(-rows * 2).hide();\n $el.find('.tg-list-no-border').removeClass('tg-list-no-border');//Alignment ticket\n }\n }\n\n // Rests load more button on resize\n if (ww <= 760) {\n $el.siblings('.tg-load-more').show();\n }\n }", "function display_Initial_ProductsView(width, howManyProducts) {\n if (width) {\n for (let i = 0; i < $productsNovedad.children.length; i++) {\n if (i > howManyProducts) {\n $productsNovedad.children[i].style.display = \"none\";\n }\n }\n }\n }", "function changeRecipeVisibility(recipeToBeShown) {\n var recipe = $('#' + recipeToBeShown);\n var isVisible = recipe.is(\":visible\");\n if (isVisible) {\n recipe.css('visibility','hidden');\n recipe.hide();\n } else {\n recipe.css('visibility','visible');\n recipe.show();\n }\n}", "function displaySpecies() {\n document.getElementById('sw-species').classList.toggle('display-all');\n}", "function hideRestaurantListings() {\n for (let i = 0; i < markersRestaurant.length; i++) {\n markersRestaurant[i].setMap(null);\n }\n}", "function hide_all() {\n\tcategories.forEach(category => hide(category));\n}", "function display_settings(counter) {\n // Displays a message saying there are no matches if there are no selected recipes for those chosen filters\n if (counter === 0) {\n document.querySelector('#no-matches').style.display = 'block';\n }\n // If there is only one recipe to be displayed, sets the width to being wider than normal, so it looks good on the screen\n if (counter === 1) {\n window.recipes.forEach(recipe => {\n if (recipe.style.display !== 'none') {\n recipe.style.width = '60vw';\n } else {\n recipe.style.width = 'auto';\n }\n })\n }\n}", "function updateColumns(e) {\n\t\tvar offset = parseInt(document.querySelector('input[name=\"filter_acct\"]:checked').value) + \n\t\t\tparseInt(document.querySelector('input[name=\"filter_rare\"]:checked').value);\n\t\t\n\t\tfor (var i = 0; i < 8; i++) {\n\t\t\tvar c = document.getElementsByClassName(\"cost_\" + i);\n\t\t\tfor(var j = 0; j < c.length; j++){\n\t\t\t\tif (i === offset || i === offset + 1) {\n\t\t\t\t\tc[j].style.display = \"table-cell\";\n\t\t\t\t} else {\n\t\t\t\t\tc[j].style.display = \"none\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tupdateDescription();\n\t}", "function showRestaurants(){\n $(\".res-box\").each(function(){\n $(this).removeClass(\"hide\");\n })\n}", "hideAllColumns(){\n\t\t\tthis.properties.forEach(function(entry){\n\t\t\t\tset(entry,'isVisible',false);\n\t\t\t});\n\t\t\tthis.handleVisibility(true);\n\t\t}", "function hideAllContent() {\n $(\"#overview\").hide();\n $(\"#tips\").hide();\n $(\"#sample1\").hide();\n $(\"#sample2\").hide();\n $(\"#sample3\").hide();\n }", "function modeFilter()\n{\n $('#filters').show();\n updateFilter();\n}", "function renderAllPatrimonios(){\n $('.padraoPatrimonios').show();\n}", "function limpaPesquisa() {\n document.getElementsByTagName(\"header\")[0].style.display = \"none\";\n document.getElementsByTagName(\"main\")[0].style.display = \"grid\";\n document.getElementsByTagName(\"footer\")[0].style.display = \"grid\";\n }", "function clearFilter(map) {\n console.log(\"Clearing\");\n map.eachLayer(function(layer) {\n if (layer.feature) {\n layer.getElement().style.display = 'inline';\n };\n });\n}", "hideFilterBar() {\n const me = this,\n columns = me.grid.columns; // we don't want to hear back store \"filter\" event while we're resetting store filters\n\n me.clearStoreFiltersOnHide && me.suspendStoreTracking(); // hide the fields, each silently - no updating of the store's filtered state until the end\n\n columns && columns.forEach(col => me.hideColumnFilterField(col, true)); // Now update the filtered state\n\n me.grid.store.filter();\n me.clearStoreFiltersOnHide && me.resumeStoreTracking();\n me.hidden = true;\n }", "function showHoodies()\n{\n\t//show all items with theid 'hoodies'\n\tdocument.getElementById('hoodies').style.display = \"block\";\n\t//hide all other items\n\tdocument.getElementById('hats').style.display = \"none\";\n\tdocument.getElementById('accessories').style.display = \"none\";\n\tdocument.getElementById('skate').style.display = \"none\";\n\tdocument.getElementById('show').style.display = \"block\";\n}", "function myCarTile(){\n $(\"#btn-car-tile\").addClass(\"filter-active\");\n $('#btn-car-list').removeClass(\"filter-active\");\n $('#my-items').removeClass(\"hide\");\n $('#my-items-table').addClass(\"hide\");\n}", "render() {\n\t\tvar countryRows = [];\n\t this.state.countryList.map(function(currentCountry, index){\n\t \tcountryRows.push(<Countries countryLoad={this.countryLoadMethod} countryData={currentCountry} key={index} />)\n\t\t}.bind(this))\n\n\t //Input Box for filtering the countries -- can be added in later\n\t\t//====================================================================================================\n\t // <input onChange={this.handleInputChange} type=\"text\" className=\"form-control h-5\" placeholder=\"Name Of Country\" style={{marginTop: '10px'}}/>\n\n\t //HOTDOG DIV to be used at a later time -- can add in scrolling weather DATA\n\t\t//====================================================================================================\n\t //<div style={{height: '40px', width: '100%', backgroundColor: '#4F4F4F',borderTop: '1px solid black'}}></div>\n\n\t\treturn(\n\t\t\t<div className=\"container\" style={{paddingRight: '0px',paddingLeft: '0px',backgroundColor: 'back', width: '100vw', height: '400px'}}>\n\t\t\t<div className='col-md-2 hidden-xs' style={{backgroundColor:'#2E2B31', height:'93vh', width:' 23vw',marginRight: '-13px', float: 'left', overflow: 'scroll'}}>\n\t\t\t\t <div style={{marginTop: '20px'}}>\n\t\t\t\t \t{countryRows}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t\t<div className=\"col-md-3\" style={{float: 'right'}}>\n\t\t\t\t <div style={{fontSize:17, height:'93vh',overflow:'scroll', backgroundColor:'#F3F1F4'}}>\n\t\t\t \t\t{\t\n\t\t\t \t\t//map through the searchedArticles array\n\t\t\t\t \t//====================================================================================================\n\t\t\t \t\t\tthis.state.searchedArticlesArray.map((article, index) => {\n\n\t\t\t \t\t\t\tif (index < 40) {\n\t\t\t\t \t\t// var searchInput = 'trump';\n\t\t\t\t \t\t// var indexOfTitle = article.title.toLowerCase().indexOf(searchInput)\n\t\t\t\t \t\t// if((indexOfTitle > -1)&&(searchInput.length>0)){\n\n\t\t\t\t\t \t\tvar json = JSON.stringify(article.publishedAt)\n\t\t\t\t\t \t\tvar jsonToDate = JSON.parse(json)\n\t\t\t\t\t \t\tvar publishedTime = new Date(jsonToDate).getTime()\n\t\t\t\t\t \t\tvar rightNow = new Date().getTime()\n\t\t\t\t\t \t\tvar daysAgo = (rightNow - publishedTime)/1000/60/60/24\n\t\t\t\t\t \t\tvar hoursAgo = daysAgo*24; \n\t\t\t\t\t \t\tvar authorText = \"\"\n\t\t\t\t\t \t\tvar publishText = \"\"\n\t\t\t\t\t \t\tif(article.author){\n\t\t\t\t\t \t\t\tauthorText = \"By \" + article.author + \" \"\n\t\t\t\t\t \t\t}\n\t\t\t\t\t \t\tif(daysAgo>1){\n\t\t\t\t\t \t\t\thoursAgo = (daysAgo - Math.floor(daysAgo))*24; \n\t\t\t\t\t \t\t\tpublishText += Math.floor(daysAgo) + \" days \"\n\t\t\t\t \t\t\t};\n\t\t\t\t \t\t\tvar minutesAgo = hoursAgo*60\n\t\t\t\t \t\t\tif(hoursAgo > 3){\n\t\t\t\t \t\t\t\tpublishText += Math.floor(hoursAgo) + \" hours ago\"\n\t\t\t\t \t\t\t}\n\t\t\t\t\t \t\telse if(hoursAgo > 1){\n\t\t\t\t\t \t\t\tminutesAgo = (hoursAgo - Math.floor(hoursAgo))*60;\n\t\t\t\t\t \t\t\tpublishText += Math.floor(hoursAgo) + \" hours \"\n\t\t\t\t\t \t\t\tpublishText += Math.floor(minutesAgo) + \" minutes ago\"\n\t\t\t\t\t \t\t}\n\t\t\t\t\t \t\telse{\n\t\t\t\t\t \t\t\tpublishText += Math.floor(minutesAgo) + \" minutes ago\"\n\t\t\t\t\t \t\t};\n\t\t\t\t\t \t\tif(daysAgo>5){\n\t\t\t\t\t \t\t\tpublishText = \"\"\n\t\t\t\t\t \t\t}\n\t\t\t\t\t \t\tif(authorText.length>30){\n\t\t\t\t\t \t\t\tauthorText=authorText.slice(0,30)+'...'\n\t\t\t\t\t \t\t}\n\n\t\t\t\t\t \t\t//frontText\n\t\t\t\t \t\t\tvar articleTitle = article.title;\n\t\t\t\t \t\t\t//highlightText\n\t\t\t\t \t\t\tvar highlightText = 'dam'\n\t\t\t\t \t\t\t//backText\n\t\t\t\t \t\t\tvar backText = 'kablam'\n\n\t\t\t\t\t\t\treturn(\n\t\t\t\t\t\t\t\t\t<div className='col-xs-12' style={{backgroundColor: '#2E2B31', borderBottom: '1px solid #222222',float: 'left',marginRight:'80%'}}>\n\t\t\t\t\t\t\t\t\t\t<div style={{backgroundColor: '#2E2B31', paddingBottom:15}} key={index}>\n\t\t\t\t\t\t\t\t\t\t\t<RenderSearchedNews index={index} article={article} imageUrl={article.urlToImage} url={article.url} articleTitle={articleTitle} highlightText={highlightText}\n\t\t\t\t\t\t\t\t\t\t\t\tbackText={backText} authorText={authorText} publishText={publishText} />\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)\t\t\t \t\t\n\t\t\t \t\t\t}\n\t\t\t \t\t\t// else{\n\t\t\t \t\t\t// \treturn null\t\n\t\t\t \t\t\t// }\n\t\t\t\t\t})}\n\t\t\t\t</div>\n\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t)\t\t\n\t}", "function select_by_weather(recipes) {\n recipes.forEach(recipe => {\n recipe['weather'] = false;\n });\n let selectedChoices = findIfFilters(\"weather\");\n if (selectedChoices.length === 0) {\n document.querySelector('#no-filter-chosen').style.display = 'block';\n } else {\n filter(\"weather\", selectedChoices);\n display_selected_recipes();\n history.pushState({ recipes: 'loaded', weather_types: selectedChoices }, ``, '/recipes');\n }\n}", "function showAllRows() {\n for(var i =0 ; i < rowsLength; i ++){\n tBody.rows[i].style.display = \"\";\n }\n }", "function hideAll(){\n\t$('#legendCompare').addClass('hide');\n\t$(\"#setupInfos\").hide(\"blind\");\n\t$(\"#compareDemos\").hide(\"blind\");\n\t$(\"#loadSeeConfig\").hide(\"blind\");\n}", "clearFiltersAndShow() {\n this.clearFilters(true);\n this.show();\n }", "function showFlightAllAirlineFilters()\r\n{\r\n var filter = $(\"#filter\");\r\n var airlineFilter = filter.find(\".airline li\");\r\n var airlineFilterMore = filter.find(\".airline a.more\");\r\n\r\n airlineFilterMore.hide();\r\n airlineFilter.each(function()\r\n {\r\n $(this).show();\r\n });\r\n}", "function displayResults(responseJson) {\n $('#query').css({'display': 'none'});\n $(\".grid\").empty();\n for (let i = 0; i < responseJson.businesses.length; i++){\n $('.grid').append(`<a class='thumb' href=\"${responseJson.businesses[i].url}\" target='_blank'><img src=\"${responseJson.businesses[i].image_url}\" class='thumb' alt='biz-thumb'></a>`);\n let cw = $('.thumb').width();\n $('.thumb').css({'height':cw+'px'});\n $('.search2').removeClass('hidden');\n $('#search-link').removeClass('hidden');\n $('#goback').removeClass('hidden');\n }\n}", "function iconDisplay(data) {\n\tvar dayOrNight;\n\tvar time = Date.now().toString();\n\tvar curTimeStr = time.slice(0, time.length - 3);\n\tvar curTime = parseFloat(curTimeStr);\n\tvar sunset = data.sys.sunset;\n\tvar sunrise = data.sys.sunrise;\n\tif (curTime >= sunrise && curTime <= sunset) {\n\t\tdayOrNight = true;\n\t} else {\n\t\tdayOrNight = false;\n\t}\n\n\tif (dayOrNight && data.weather[0].id === 800) {\n\t\tclearSky.style.display = \"inline\";\n\t\tnightClearSky.style.display = \"none\";\n\t\tnightClouds.style.display = \"none\";\n\t\train.style.display = \"none\";\n\t\tstorm.style.display = \"none\";\n\t\tsnow.style.display = \"none\";\n\t\tclouds.style.display = \"none\";\n\t\tfewClouds.style.display = \"none\";\n\t\twind.style.display = \"none\";\n\t\tmist.style.display = \"none\";\n\t} else if (!dayOrNight && data.weather[0].id === 800) {\n\t\tclearSky.style.display = \"none\";\n\t\tnightClearSky.style.display = \"inline\";\n\t\tnightClouds.style.display = \"none\";\n\t\train.style.display = \"none\";\n\t\tstorm.style.display = \"none\";\n\t\tsnow.style.display = \"none\";\n\t\tclouds.style.display = \"none\";\n\t\tfewClouds.style.display = \"none\";\n\t\twind.style.display = \"none\";\n\t\tmist.style.display = \"none\";\n\t} else if (!dayOrNight && data.weather[0].id >= 801 &&data.weather[0].id <= 804) {\n\t clearSky.style.display = \"none\";\n\t\tnightClearSky.style.display = \"none\";\n\t\tnightClouds.style.display = \"inline\";\n\t\train.style.display = \"none\";\n\t\tstorm.style.display = \"none\";\n\t\tsnow.style.display = \"none\";\n\t\tclouds.style.display = \"none\";\n\t\tfewClouds.style.display = \"none\";\n\t\twind.style.display = \"none\";\n\t\tmist.style.display = \"none\";\n\t} else if (data.weather[0].id >= 300 && data.weather[0].id <= 531) {\n\t\tclearSky.style.display = \"none\";\n\t\tnightClearSky.style.display = \"none\";\n\t\tnightClouds.style.display = \"none\";\n\t\train.style.display = \"inline\";\n\t\tstorm.style.display = \"none\";\n\t\tsnow.style.display = \"none\";\n\t\tclouds.style.display = \"none\";\n\t\tfewClouds.style.display = \"none\";\n\t\twind.style.display = \"none\";\n\t\tmist.style.display = \"none\";\n\t} else if (data.weather[0].id >= 200 && data.weather[0].id <= 232 || data.weather[0].id === 901 || data.weather[0].id === 900 || data.weather[0].id === 960 || data.weather[0].id === 961 || data.weather[0].id === 962 ) {\n\t\tclearSky.style.display = \"none\";\n\t\tnightClearSky.style.display = \"none\";\n\t\tnightClouds.style.display = \"none\";\n\t\train.style.display = \"none\";\n\t\tstorm.style.display = \"inline\";\n\t\tsnow.style.display = \"none\";\n\t\tclouds.style.display = \"none\";\n\t\tfewClouds.style.display = \"none\";\n\t\twind.style.display = \"none\";\n\t\tmist.style.display = \"none\";\n\t} else if (data.weather[0].id >= 600 && data.weather[0].id <= 622) {\n\t\tclearSky.style.display = \"none\";\n\t\tnightClearSky.style.display = \"none\";\n\t\tnightClouds.style.display = \"none\";\n\t\train.style.display = \"none\";\n\t\tstorm.style.display = \"none\";\n\t\tsnow.style.display = \"inline\";\n\t\tclouds.style.display = \"none\";\n\t\tfewClouds.style.display = \"none\";\n\t\twind.style.display = \"none\";\n\t\tmist.style.display = \"none\";\n\t} else if (data.weather[0].id >= 802 && data.weather[0].id <= 804) {\n\t\tclearSky.style.display = \"none\";\n\t\tnightClearSky.style.display = \"none\";\n\t\tnightClouds.style.display = \"none\";\n\t\train.style.display = \"none\";\n\t\tstorm.style.display = \"none\";\n\t\tsnow.style.display = \"none\";\n\t\tclouds.style.display = \"inline\";\n\t\tfewClouds.style.display = \"none\";\n\t\twind.style.display = \"none\";\n\t\tmist.style.display = \"none\";\n\t} else if (data.weather[0].id === 801) {\n\t\tclearSky.style.display = \"none\";\n\t\tnightClearSky.style.display = \"none\";\n\t\tnightClouds.style.display = \"none\";\n\t\train.style.display = \"none\";\n\t\tstorm.style.display = \"none\";\n\t\tsnow.style.display = \"none\";\n\t\tclouds.style.display = \"none\";\n\t\tfewClouds.style.display = \"inline\";\n\t\twind.style.display = \"none\";\n\t\tmist.style.display = \"none\";\n\t} else if (data.weather[0].id === 905 || data.weather[0].id === 902 || (data.weather[0].id >= 952 && data.weather[0].id <= 959)) {\n\t\tclearSky.style.display = \"none\";\n\t\tnightClearSky.style.display = \"none\";\n\t\tnightClouds.style.display = \"none\";\n\t\train.style.display = \"none\";\n\t\tstorm.style.display = \"none\";\n\t\tsnow.style.display = \"none\";\n\t\tclouds.style.display = \"none\";\n\t\tfewClouds.style.display = \"none\";\n\t\twind.style.display = \"inline\";\n\t\tmist.style.display = \"none\";\n\t} else if (data.weather[0].id >= 700 && data.weather[0].id <= 781) {\n clearSky.style.display = \"none\";\n\t\tnightClearSky.style.display = \"none\";\n\t\tnightClouds.style.display = \"none\";\n\t\train.style.display = \"none\";\n\t\tstorm.style.display = \"none\";\n\t\tsnow.style.display = \"none\";\n\t\tclouds.style.display = \"none\";\n\t\tfewClouds.style.display = \"none\";\n\t\twind.style.display = \"none\";\n\t\tmist.style.display = \"inline\";\n\t} else {\n\t\tconsole.log(\"other\");\n\t}\n}", "renderFilterBar() {\n const me = this;\n\n me.grid.columns.visibleColumns.forEach((column) => me.renderColumnFilterField(column));\n }", "function update_display()\n {\n\n // Filter unfiltered_data to user price and model constraints\n data = [];\n filt_count = 0;\n for (var i = unfiltered_data.length-1; i >= 0; i--) {\n if (unfiltered_data[i].model == model && unfiltered_data[i].price >= lo && unfiltered_data[i].price <= hi){\n data[filt_count++] = unfiltered_data[i];\n }\n }\n\n //Remove all cars so that z-order remains correct\n svg.selectAll(\".car_subcontainer\").remove();\n\n //Create car svg variable\n var cl = svg.selectAll(\".car_subcontainer\")\n .data(data, function(d) {\n return d.url;\n });\n\n\n cl.enter()\n .append(\"g\")\n .on(\"click\", function (d, i) {\n show_ad(d.title, d.body, d.url, d.price);\n })\n .attr(\"class\", \"car_subcontainer\")\n .each(function (d, i) {\n var car = this.appendChild(importedNode.cloneNode(true));\n if (d.delta>1000) {\n fill = goodColor;\n }\n else{\n fill = badColor;\n }\n\n $($(car).children()[3].children).attr(\"fill\", fill);\n });\n\n cl.exit().remove();\n\n cl\n .attr(\"transform\", function(d, i){\n return \"translate(\" + (xScale(d.year) - carWidth/2) + \",\"\n + (yScale(d.miles) - carHeight/2) + \")\"\n + \" scale(\" + carScale + \")\";\n })\n .transition().style(\"opacity\");\n\n\n // Show tooltip upon hover over car\n $('.car_subcontainer').tipsy({\n gravity: 'w',\n html: true,\n title: function() {\n return \"$\" + Math.round(this.__data__.price/100)/10 + \"K\";}\n });\n\n\n // Repopulate table with rows\n $( \"#table_body\" ).html(\"\");\n var textToInsert = [];\n for (var i = data.length-1; i >= 0; i--) {\n var c = 0;\n if (data[i].delta>0){\n savings_class = 'pos_savings';\n }\n else {\n savings_class = 'neg_savings';\n }\n\n textToInsert[c++] = \"<tr idx=\" + i + \">\";\n textToInsert[c++] = \"<td>\" + (data.length-i) + \"</td>\";\n textToInsert[c++] = \"<td>\" + data[i].year + \"</td>\";\n textToInsert[c++] = \"<td>\" + kstyle_number(data[i].miles) + \"</td>\";\n textToInsert[c++] = \"<td>\" + \"$\" + comma_separate_number(data[i].price) + \"</td>\";\n textToInsert[c++] = \"<td class=\" + savings_class + \">\" + sign_char(data[i].delta) + \"$\" + comma_separate_number(Math.abs(Math.round(data[i].delta))) + \"</td>\";\n textToInsert[c++] = \"</tr>\";\n $( \"#table_body\" ).append(textToInsert.join(''));\n }\n\n\n // Make table rows clickable\n $('.table > tbody > tr').click(function() {\n idx = $(this).attr(\"idx\");\n show_ad(data[idx].title, data[idx].body, data[idx].url, data[idx].price);\n });\n\n\n // Change mouse appearace when user hovers over rows.\n $('.table > tbody > tr').mouseenter(function() {\n $(this).removeClass(\"row-unhover\").addClass(\"row-hover\");\n });\n\n\n // Change mouse appearace when user stops hovering over rows.\n $('.table > tbody > tr').mouseleave(function() {\n $(this).removeClass(\"row-hover\").addClass(\"row-unhover\");\n });\n\n } //update", "function showHide() \n{ \n if (document.querySelector(\"div.grid_container-2\").style.display!==\"none\") {\n document.querySelector(\"div.grid_container-2\").style.display=\"none\";\n document.getElementById(\"2\").style.display=\"grid\";\n } else {\n document.querySelector(\"div.grid_container-2\").style.display=\"grid\";\n AptitudeContainer.style.display=\"none\";\n regform.style.display=\"none\";\n document.getElementById(\"2\").style.display=\"none\";\n HRmainContainer.style.display=\"none\";\n CmainContainer.style.display=\"none\";\n JmainContainer.style.display=\"none\";\n PmainContainer.style.display=\"none\";\n }\n}", "async function showCatFilter() {\n const cates = await getCatsList();\n for (let cate of cates) {\n generateFilterItemHTML(cate, $(\"#catFilter\"));\n }\n }", "function unfilterMoodCells() {\n let cells = getFilterableMoodCells();\n for (let i = 0; i < cells.length; i++) {\n unhideMoodCell(cells[i]);\n }\n}", "function showSights() {\n information.style.display='none';\n events.style.display='none';\n sights.style.display='block';\n informationButton.className = 'categoryButton material-icons';\n eventsButton.className = 'categoryButton material-icons';\n sightsButton.className = 'categoryButton selected material-icons';\n}", "function hideMuseumListings() {\n for (let i = 0; i < markersMuseum.length; i++) {\n markersMuseum[i].setMap(null);\n }\n}", "function displayWeather( weather ) {\n $( \"#weather\" ).show();\n $( \"#weather\" ).html(\n $( \"<div class=temperature id=weather-temp>\" ).text( weather.currently.temperature.toFixed() + \"°F\" )\n );\n $( \"#weather\" ).append(\n $( \"<div class=details id=weather-details>\" )\n );\n $( \"#weather-details\" ).append(\n $( \"<p class=weather-summary>\" ).text( weather.currently.summary )\n );\n $( \"#weather-details\" ).append(\n $( \"<ul class=weather-items id=weather-list>\" )\n );\n $( \"#weather-list\" ).append(\n $( \"<li class=weather-item>\" ).text( weather.hourly.summary )\n );\n $( \"#weather-list\" ).append(\n $( \"<li class=weather-item>\" ).text( weather.daily.summary )\n );\n $( \"#weather-list\" ).append(\n $( \"<li class=weather-item>\" ).text( \"Wind speed: \" + weather.currently.windSpeed )\n );\n $( \"#weather-list\" ).append(\n $( \"<li class=weather-item>\" ).text( \"Humidity: \" + weather.currently.humidity )\n );\n}", "function hideStartingInfo() {\r\n // Hides savings/checking info and transaction info.\r\n hideToggle(checking_info); \r\n hideToggle(savings_info); \r\n hideToggle(transactions); \r\n}", "renderContents() {\n // columns shown, hidden or reordered\n this.init();\n }", "renderContents() {\n // columns shown, hidden or reordered\n this.init();\n }", "function hideAll() {\n $('#search-input').addClass(\"search__input--hidden\")\n $(\"#categories-labels\").addClass(\"categories-labels--hidden\")\n}", "function show_hideAction(){\r\n let DataBlock = document.getElementById(\"DataBlock\");\r\n let BasketBlock = document.getElementById(\"BasketBlock\");\r\n let PicsBlock = document.getElementById(\"PicsBlock\");\r\n let mainBlockHeight = document.getElementById(\"mainBlock\").clientHeight;\r\n let ButtonText = document.getElementById(\"show_hideButton\");\r\n\r\n let FiltersBlock = document.getElementById(\"FiltersBlock\");\r\n if(FiltersBlock.clientHeight == 0){\r\n ButtonText.textContent = \"HIDE FILTERS\";\r\n FiltersBlock.style.display = \"block\";\r\n BasketBlock.style.height = (mainBlockHeight*0.8)+'px';\r\n DataBlock.style.height = (mainBlockHeight*0.8)+'px';\r\n PicsBlock.style.height = (mainBlockHeight*0.8)+'px';\r\n }else{\r\n ButtonText.textContent = \"SHOW FILTERS\";\r\n FiltersBlock.style.display = \"none\";\r\n BasketBlock.style.height = (mainBlockHeight-6)+'px'; //largeur bordures = 6px\r\n DataBlock.style.height = (mainBlockHeight-6)+'px';\r\n PicsBlock.style.height = (mainBlockHeight-6)+'px';\r\n }\r\n}", "function displayResults(weather) {\n // console.log(weather);\n weatherImg.src = \"https://openweathermap.org/img/wn/\" + weather.weather[0].icon + \"@2x.png\";\n\n\n city.innerText = `${weather.name},${weather.sys.country}`;\n // Date \n date.innerText = dateBuilder(todayDate);\n // Current Temperature\n currTemp.innerHTML = `${Math.round(weather.main.temp)}<span> °c</span>`;\n // weather description\n weatherDescription.innerText = `${weather.weather[0].description}`;\n // High Low\n\n searchbox.value = \"\";\n}", "function showData() {\n console.log(\"showData()\");\n // find the shelf element\n const songsContainer = document.querySelector(\"#container\");\n // loop through all the people listed in the Airtable data.\n // Inside is the code we are applying for EACH song in the list of songs.\n songs.forEach((song) => {\n // Print out what a single songs’s data feidls looks like\n console.log(\"SHOWING THE SONG\")\n console.log(song.fields);\n /** CREATE CONTAINER */\n const songContainer = document.createElement(\"div\");\n songContainer.classList.add(\"songContainer\");\n /*******************\n ADD THE TITLE\n *******************/\n const titleElement = document.createElement(\"h2\");\n titleElement.innerText = song.fields.title;\n songContainer.appendChild(titleElement);\n /*******************\n ADD ARTIST TITLE\n *******************/\n const artistElement = document.createElement(\"p\");\n artistElement.innerText = song.fields.artist;\n songContainer.appendChild(artistElement);\n /*******************\n ADD SONG RATING\n *******************/\n let ratingElement = document.createElement(\"p\");\n ratingElement.innerText = \"Rating: \"+ song.fields.rating;\n songContainer.appendChild(ratingElement);\n /*******************\n ADD GENRES\n *******************/\n let genresList = song.fields.genres;\n genresList.forEach(function(genre){\n const genreElement = document.createElement(\"span\");\n genreElement.classList.add(\"genreTag\");\n genreElement.innerText = genre;\n songContainer.appendChild(genreElement);\n songContainer.classList.add(genre);\n // TODO: Add this genre name as a class to the songContainer\n // let filterFolk = document.querySelector(“#folk”);\n // filterFolk.addEventListener(“click”, function(){\n // if (songContainer.classList.contains(“folk”)){\n // songConntainer.display = (“folk”);\n })\n /***********\n TODO: CREATE FILTER-BY-GENRE FUNCTIONALITY\n **********/\n let filterDreampop = document.querySelector(\"#dreampop\");\n filterDreampop.addEventListener(\"click\", function(){\n if (songContainer.classList.contains(\"dreampop\")){\n songContainer.style.display = \"block\";\n }else{\n songContainer.style.display = \"none\"\n }\n });\n let filterShoegaze = document.querySelector(\"#shoegaze\");\n filterShoegaze.addEventListener(\"click\", function(){\n if (songContainer.classList.contains(\"shoegaze\")){\n songContainer.style.display = \"block\";\n }else{\n songContainer.style.display = \"none\"\n }\n });\n let filterPop = document.querySelector(\"#pop\");\n filterPop.addEventListener(\"click\", function(){\n if (songContainer.classList.contains(\"pop\")){\n songContainer.style.display = \"block\";\n }else{\n songContainer.style.display = \"none\"\n }\n });\n let filterJazz = document.querySelector(\"#jazz\");\n filterJazz.addEventListener(\"click\", function(){\n if (songContainer.classList.contains(\"jazz\")){\n songContainer.style.display = \"block\";\n }else{\n songContainer.style.display = \"none\"\n }\n });\n let filterHiphop = document.querySelector(\"#hiphop\");\n filterHiphop.addEventListener(\"click\", function(){\n if (songContainer.classList.contains(\"hiphop\")){\n songContainer.style.display = \"block\";\n }else{\n songContainer.style.display = \"none\"\n }\n });\n let filterElectropop = document.querySelector(\"#electropop\");\n filterElectropop.addEventListener(\"click\", function(){\n if (songContainer.classList.contains(\"electropop\")){\n songContainer.style.display = \"block\";\n }else{\n songContainer.style.display = \"none\"\n }\n });\n let filterAlternative = document.querySelector(\"#alternative\");\n filterAlternative.addEventListener(\"click\", function(){\n if (songContainer.classList.contains(\"alternative\")){\n songContainer.style.display = \"block\";\n }else{\n songContainer.style.display = \"none\"\n }\n });\n let filterRandb = document.querySelector(\"#randb\");\n filterRandB.addEventListener(\"click\", function(){\n if (songContainer.classList.contains(\"randb\")){\n songContainer.style.display = \"block\";\n }else{\n songContainer.style.display = \"none\"\n }\n });\n let filterIndiepop = document.querySelector(\"#Indiepop\");\n filterIndiepop.addEventListener(\"click\", function(){\n if (songContainer.classList.contains(\"indiepop\")){\n songContainer.style.display = \"block\";\n }else{\n songContainer.style.display = \"none\"\n }\n });\n let filterReset = document.querySelector(\"#reset\");\n filterReset.addEventListener(\"click\", function(){\n songContainer.style.display = \"block\";\n });\n songsContainer.appendChild(songContainer);\n });\n}", "function displayWeather(data) {\n changeHero(loc.data.name);\n $('#cityName').text(`${loc.data.name}`)\n $('#cityTemp').text(`${parseInt(data.data.current.temp)}`);\n if (unit == \"imperial\") {\n $('#cityUnit').attr('class', 'icofont-fahrenheit');\n } else {\n $('#cityUnit').attr('class', 'icofont-celsius');\n }\n\n $('.high').each(function(ind, el) {\n $(el).text(`${parseInt(data.data.daily[ind].temp.max)}`);\n });\n\n $('.low').each(function(ind, el) {\n $(el).text(`${parseInt(data.data.daily[ind].temp.min)}`);\n });\n\n $('.day').each(function(ind, el) {\n let newDate = new Date(data.data.daily[ind].dt * 1000);\n let day = newDate.toDateString().slice(0, 3);\n $(el).text(`${day} ${newDate.getDate()}`);\n });\n\n $('.mainWeather').each(function(ind, el) {\n switch (data.data.daily[ind].weather[0].main.trim()) {\n case \"Clouds\":\n $(this).text('Cloudy');\n break;\n case \"Rain\":\n $(this).text('Rainy');\n break;\n case \"Clear\":\n $(this).text('Clear');\n break;\n case \"Snow\":\n $(this).text('Snow');\n break;\n case \"Drizzle\":\n $(this).text('Light Rain');\n break;\n case \"Thunderstorm\":\n $(this).text('Thunderstorms');\n break;\n default:\n $(this).text('Cloudy');\n break;\n }\n });\n\n $('.weatherIcon').each(function(ind, el) {\n switch (data.data.daily[ind].weather[0].main.trim()) {\n case \"Clouds\":\n $(this).attr('class', 'weatherIcon icofont-cloudy');\n break;\n case \"Rain\":\n $(this).attr('class', 'weatherIcon icofont-rainy');\n break;\n case \"Clear\":\n $(this).attr('class', 'weatherIcon icofont-sun');\n break;\n case \"Snow\":\n $(this).attr('class', 'weatherIcon icofont-snow');\n break;\n case \"Drizzle\":\n $(this).attr('class', 'weatherIcon icofont-rainy-sunny');\n break;\n case \"Thunderstorm\":\n $(this).attr('class', 'weatherIcon icofont-rainy-thunder');\n break;\n default:\n $(this).attr('class', 'weatherIcon icofont-clouds');\n break;\n }\n });\n\n $('.desc').each(function(ind, el) {\n $(el).text(`${data.data.daily[ind].weather[0].description.trim()}`);\n });\n\n\n $('.humid').each(function(ind, el) {\n $(el).text(` ${data.data.daily[ind].humidity} %`);\n });\n\n\n $('.uvi').each(function(ind, el) {\n $(el).text(` ${data.data.daily[ind].uvi}`);\n let uv = parseInt(data.data.daily[ind].uvi);\n switch (uv) {\n case 11:\n $(this).parent().attr('class', 'ui label image violet');\n case 8:\n case 9:\n case 10:\n $(this).parent().attr('class', 'ui label image red');\n break;\n case 6:\n case 7:\n $(this).parent().attr('class', 'ui label image orange');\n break;\n case 3:\n case 4:\n case 5:\n $(this).parent().attr('class', 'ui label image yellow');\n break;\n case 0:\n case 1:\n case 2:\n $(this).parent().attr('class', 'ui label image green');\n break;\n }\n });\n\n\n $('.wind').each(function(ind, el) {\n $(el).text(` ${data.data.daily[ind].wind_speed} MPH`);\n });\n\n animateWeather(data.data.current.weather[0].main.trim())\n\n setTimeout(() => {\n $('.segment').dimmer('hide');\n }, 250);\n\n}", "function displayParcels(){\n //declare and clear the output are for parcels\n var displayParcelOutput = document.getElementById(\"displayParcelOutput\");\n document.getElementById(\"formerParcelsHeader\").innerHTML = \"\";\n displayParcelOutput.innerHTML = \"\"; \n //build the header for the table\n displayParcelOutput.appendChild(buildParcelsListHeaderMarkup());\n\n //verify the value of the filter\n var displayParcelsFilter = document.getElementById(\"displayParcelsFilter\");\n var statusFilter = displayParcelsFilter.value;\n \n console.log(\"statusFilter = \", statusFilter);\n console.log(\"parcels before filtering:\",parcels);\n \n //generate a filtered version of the parcels array if different from All\n //if controlBox is \"all\" just clone the parcels array\n var parcelsFiltered = statusFilter==\"All\" ? parcels.slice(0) : parcels.filter((parcel)=>parcel.status===statusFilter);\n console.log(\"parcelsFiltered:\",parcelsFiltered);\n\n //build parcels rows and append to parcels container (the table)\n var parcelsContainer = document.getElementById(\"parcelsContainer\");\n parcelsFiltered.forEach((parcel)=>{\n let row = buildParcelsListRowMarkup(parcel);\n parcelsContainer.append(row);\n });\n }", "function displayWeather(){\n document.getElementById(\"spinner\").style.display = \"none\";\n document.getElementById(\"container\").style.display = \"flex\";\n if (weather.error) {\n document.getElementById(\"error\").style.display = \"none\";\n weather.error = \"false\";\n }\n}", "function showLoadDataPanel() {\n \n document.getElementById(\"loadDataPanel\").style.display = \"table\";\n document.getElementById(\"hideLoadDataPanel\").disabled=false;\n document.getElementById(\"map\").style.filter = \"blur(6px)\";\n}", "function collapseContainers( containers ){\n containers.classed(\"hidden\", true);\n }", "function displayResults(responseJson) {\n\n let recipeinfo = `\n <img src= ${responseJson.recipes[0].image} class=\"imgStyle\" alt=\"Recipe Photo\">\n <h2><span> ${responseJson.recipes[0].title}</span></h2>\n <p><span> Make Time: ${responseJson.recipes[0].readyInMinutes}</span></p>\n `\n $('.recipeScreen').html(recipeinfo)\n\n // Ingredient List\n $('.resultsList').empty();\n $('.resultsList').append(`<h3>Ingredient List:</h3>`);\n for (let i = 0; i < responseJson.recipes[0].extendedIngredients.length; i++) {\n $('.resultsList').append(`<li><p>${responseJson.recipes[0].extendedIngredients[i].name}</p>\n </li>`);\n }\n $('.resultsList').append(`\n <h3> Instructions: </h3>\n <p class=\"instructionBox\">${responseJson.recipes[0].instructions}</p>`);\n\n //display the results section\n $('.contentBox').hide();\n $('.recipePage').show();\n $('html,body').scrollTop(0);\n}", "function displayAllTags() {\n hideEverything();\n showAllPostsContainer();\n document.getElementById('tags').style.display = 'flex';\n document.getElementById('close_tags').style.display = 'block';\n hideNav(); // Call again to get a resize\n}", "function hideAllKiezatlasFeatures() {\n // showProgressInSideBar(\"Platzieren der Markierer\");\n /* for (var i = 0; i < gMarkers.length; i++) {\n markerLayer.removeMarker(gMarkers[i]);\n gMarkers[i].erase(); // = false;\n }*/\n //\n if (kiezatlas.layer != undefined) {\n for (var i = 0; i < kiezatlas.layer.features.length; i++) {\n var featureToToggle = kiezatlas.layer.features[i];\n // gMarkers[i].erase(); // = false;\n featureToToggle.renderIntent = \"delete\";\n }\n kiezatlas.layer.redraw();\n }\n }", "function displayWeather(weatherData) {\n\n //Get City Name and Date\n var cityName = weatherData.city_name;\n var countryID = weatherData.country_code;\n var currentDate = (weatherData.data[0].datetime);\n var cityCountrySrc = cityName + \", \" + countryID\n $(\"#cityMain\").text(cityCountrySrc + \" (\" + currentDate + \")\");\n\n //Weather Icon - Icons stored in repo as \"weatherbit.io\" did not have URL links.\n var iconID = weatherData.data[0].weather.icon;\n var weatherIcon = \"./assets/icons/\" + iconID + \".png\";\n $(\"#iconMain\").attr(\"src\", weatherIcon);\n\n //Current day main display\n $(\"#tempMain\").text(\"Temperature: \" + weatherData.data[0].max_temp + \"\\u2103\");\n $(\"#humdMain\").text(\"Humidity: \" + weatherData.data[0].rh + \"%\");\n $(\"#wsMain\").text(\"Wind Speed: \" + Math.ceil(weatherData.data[0].wind_spd * 3.6) + \" km/h\");\n\n //UV Index Color coding\n var uvIndex = Math.ceil(weatherData.data[0].uv);\n var uvMain = $(\"#uvMain\");\n uvMain.text(\" UV Index: \" + uvIndex + \" \");\n var bgColor = \"background-color\"\n\n if (uvIndex <= 2) {\n uvMain.css(bgColor, \"Green\");\n };\n if ((uvIndex >= 3) && (uvIndex <= 5)) {\n uvMain.css(bgColor, \"gold\");\n };\n if ((uvIndex >= 6) && (uvIndex <= 7)) {\n uvMain.css(bgColor, \"orange\");\n };\n if ((uvIndex >= 8) && (uvIndex <= 10)) {\n uvMain.css(bgColor, \"red\");\n };\n if (uvIndex > 10) {\n uvMain.css(bgColor, \"purple\");\n };\n\n //Weather Data that will populate the 5 day forecast cards run through a for loop.\n for (var i = 1; i < 6; i++) {\n $(\"#date\" + i).text(weatherData.data[i].datetime);\n $(\"#icon\" + i).attr(\"src\", \"./assets/icons/\" + weatherData.data[i].weather.icon + \".png\");\n $(\"#temp\" + i).text(\"Temp: \" + weatherData.data[i].max_temp + \"\\u2103\");\n $(\"#humd\" + i).text(\"Humidity: \" + weatherData.data[i].rh + \"%\");\n }\n }", "function showWeather() {\r\n // remove loader\r\n clearLoader();\r\n\r\n // update state\r\n state.lastUpdate = Date.now();\r\n\r\n // render elements\r\n renderElements();\r\n\r\n // time\r\n state.intervalID = setInterval(updateTime, 1000);\r\n}", "function remove_all_poi()\n{\n\t//earthnc_chartdsp_top_1(); //remove chart overlays\n\t//earthnc_placedsp_top_1(); //remove places overlays\n\n\tearthnc_weatherdsp_top_1();\n\t if(el(\"showradar\").checked)\n\t noaa_radarload_default_1();//remove weather overlays\n\n\thide_anchorages();\n\thide_marinas();\n\thide_bridges();\n\tearthnc_chartload_2();//remove buyos markers\n\n}", "function showFilterBox() {\n var fBox = Dom.get(\"filterBox\");\n fBox.style.visibility = \"visible\";\n fBox.style.height = \"35px\";\n \n // Set paddings and floats of child nodes\n var filterSpans = Dom.getElementsByClassName('filterBoxSpan', 'span');\n for(i = 0; i < filterSpans.length; i = i + 1){\n filterSpans[i].style.cssFloat = \"left\";\n filterSpans[i].style.paddingTop = \"5px\";\n filterSpans[i].style.paddingLeft = \"20px\";\n }\n var filterCloseButton = Dom.get(\"filterCloseButton\");\n filterCloseButton.style.cssFloat = \"right\";\n filterCloseButton.style.padding = \"10px\";\n \n resizeContent();\n}", "function hideAllInitialSections() {\n //Hideing all questions\n hideAllQuestions();\n // Hideing warning section\n hideWarningSection();\n // Hideing result section\n hideResultSection();\n // Hideing show high score section\n hideViewHighScoreSection();\n // Hideing saveToMemory section\n hideSaveToMemorySection();\n //Hideing High Score Result Section\n hideViewHighScoreResultSection()\n}" ]
[ "0.6289912", "0.62474346", "0.61873883", "0.61683863", "0.60603213", "0.60547364", "0.6029845", "0.6022186", "0.59941155", "0.5990943", "0.5966412", "0.5952374", "0.5940943", "0.58968645", "0.5891171", "0.5885731", "0.58802897", "0.5872718", "0.58692014", "0.5861815", "0.584056", "0.58341473", "0.5807658", "0.58015525", "0.57881784", "0.5787957", "0.5781656", "0.577477", "0.5740142", "0.5725353", "0.57246166", "0.5714551", "0.5639215", "0.56220835", "0.56111324", "0.56022584", "0.5593273", "0.5588973", "0.5585034", "0.5578905", "0.5575721", "0.5574334", "0.5532478", "0.55282104", "0.5520954", "0.55148655", "0.55092293", "0.55057013", "0.54983944", "0.54915786", "0.54895276", "0.5476485", "0.5476374", "0.5475355", "0.5468114", "0.54608124", "0.5450955", "0.54468447", "0.5446074", "0.5445542", "0.54443693", "0.54438615", "0.54311496", "0.5430709", "0.5429985", "0.5429302", "0.5427629", "0.5422977", "0.54213065", "0.5416905", "0.54163545", "0.5409115", "0.54087454", "0.54071367", "0.5406486", "0.54043394", "0.53986204", "0.5379093", "0.53750783", "0.5365538", "0.53628445", "0.53500754", "0.53500754", "0.53489816", "0.5348871", "0.53487915", "0.5348084", "0.5347977", "0.534728", "0.5343823", "0.5342216", "0.53414166", "0.53293514", "0.53265744", "0.53248405", "0.53210807", "0.53161526", "0.53133917", "0.5313172", "0.53111374" ]
0.75827295
0
Displays all recipes for all kinds of weather if the user presses the 'View All' button
function display_all(recipes) { recipes.forEach(recipe => { recipe['weather'] = true; }); display_selected_recipes(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function display_selected_recipes() {\n document.querySelector('#weather-filter-container').style.display = 'none';\n document.querySelector('#select-filters').style.display = 'block';\n document.querySelector('#recipes-title').style.display = 'block';\n document.querySelector('#grid-container').style.display = 'grid';\n window.recipes.forEach(recipe => {\n if (recipe['weather']) {\n recipe.style.display = 'block';\n } else {\n recipe.style.display = 'none';\n }\n });\n}", "async function renderAllRecipes() {\n let allRecipes = await retrieveAllRecipes();\n await renderBreakfast(allRecipes);\n await renderAppetizers(allRecipes);\n await renderSalads(allRecipes);\n await renderMDBeef(allRecipes);\n await renderMDChicken(allRecipes);\n await renderMDPork(allRecipes);\n await renderMDSeafood(allRecipes);\n await renderMDVegetarian(allRecipes);\n await renderBeverages(allRecipes);\n await renderDesserts(allRecipes);\n}", "async showAll() {\n await this.model.read((data) => {\n this.view.render('showEntries', data);\n });\n }", "function select_by_weather(recipes) {\n recipes.forEach(recipe => {\n recipe['weather'] = false;\n });\n let selectedChoices = findIfFilters(\"weather\");\n if (selectedChoices.length === 0) {\n document.querySelector('#no-filter-chosen').style.display = 'block';\n } else {\n filter(\"weather\", selectedChoices);\n display_selected_recipes();\n history.pushState({ recipes: 'loaded', weather_types: selectedChoices }, ``, '/recipes');\n }\n}", "async function showRecipes(recipes) {\n\n for (let rec of recipes) {\n await generateRecipeHTML(rec);\n }\n currentMealList = recipes;\n }", "function show_all() {\n\tcategories.forEach(category => show(category));\n}", "async function showDiyRecipes() {\n const diyRecipes = await getDiyList();\n\n for (let rec of diyRecipes) {\n generateDiyRecipeHTML(rec);\n }\n currentMealList = diyRecipes;\n }", "function displayRecipes() {\n console.log(\"My recipes: \", recipes);\n}", "function showAll() {\n searchForSongs();\n displayAudioBookInformation();\n }", "function showRecipeList(recipes) {\n const list = document.getElementById(\"recipe-list\");\n list.innerHTML = \"\";\n //add create recipe button\n button = document.createElement(\"BUTTON\");\n button.type = \"button\";\n button.id = \"create-recipe-btn\";\n button.className = \"list-group-item list-group-item-action list-highlight\";\n button.textContent = \"Add New Recipe\";\n\n showBtn = document.createElement(\"BUTTON\");\n showBtn.type = \"button\";\n showBtn.id = \"toggle-show-btn\";\n showBtn.className = \"list-group-item list-group-item-action list-highlight\";\n showBtn.textContent = \"Show My Recipes\";\n list.append(button); //Add in show button when user auth is set up\n //create list for all public recipes\n for (const recipe of recipes) {\n if (!recipe.public) {\n return;\n }\n btn = renderRecipe(recipe);\n btn.dataset.id = recipe.id;\n list.appendChild(btn);\n }\n}", "function showAll() {\n setAll(true)\n setObtained(false)\n setNotObtained(false)\n setSoft(false)\n setTech(false)\n }", "function renderAll() {\n renderPatty();\n renderCheese();\n renderTomatoes();\n renderOnions();\n renderLettuce();\n // renderButtons();\n // renderIngredientsBoard();\n renderPrice();\n}", "function renderAll() {\n renderPatty();\n renderCheese();\n renderTomatoes();\n renderOnions();\n renderLettuce();\n renderButtons();\n renderIngredientsBoard();\n renderPrice();\n}", "function showAll() {\n\t\n\tif (modus == \"Map\") {\n\t\tcities2000.selectAll(\".city_2000\")\n\t\t\t.style(\"fill-opacity\", 0.7);\n\t\t\t\n\t\tcities2010.selectAll(\".city_2010\")\n\t\t\t.style(\"fill-opacity\", 0.5);\n\t} else {\n\t\tcities2000.selectAll(\".city_2000\")\n\t\t\t.style(\"fill-opacity\", 0.9);\n\t\t\t\n\t\tcities2010.selectAll(\".city_2010\")\n\t\t\t.style(\"fill-opacity\", 0.9);\t\t\n\t\t\n\t}//else\n\t\n\tif (modus == \"Slope\") {\n\t\tslopes.selectAll(\".slopes\")\n\t\t\t.style(\"opacity\", 0.4);\n\t\t\t\n\t\ttext2000.selectAll(\"text\")\n\t\t\t.style(\"opacity\", 0)\n\t\t\t.filter(function(d) { return eval(\"d.rank_\" + rVar) < 10;})\n\t\t\t.style(\"opacity\", 0.7);\n\t\t\t\n\t\ttext2010.selectAll(\"text\")\n\t\t\t.style(\"opacity\", 0)\n\t\t\t.filter(function(d) { return eval(\"d.rank_\" + rVar) < 10;})\n\t\t\t.style(\"opacity\", 0.7);\n\t}//if\n\t\n\t//Remove visibility of callout in lower left corner\n\tif (modus == \"Map\" | modus == \"Dot\") {\n\t\td3.select(\"#callOut\").style(\"visibility\",\"hidden\");\n\t}//if\n\t\n}//slopeAll\t", "function displayRecipes(recipeData) {\n console.log(\"showing recipes\");\n $('#recipe-area').removeClass('hidden');\n $('#recipe-area').append(\n `<div class = \"results-header\">\n <p>What to Eat</p>\n </div>\n <section class= \"recipe-boxes\">\n <ul class=\"recipe\">\n <li><h3><a href=\"${recipeData.recipes[0].sourceUrl}\" target=\"_blank\">${recipeData.recipes[0].title}</a>\n <img src=\"${recipeData.recipes[0].image}\" alt=\"${recipeData.recipes[0].title} image\">\n </li>\n \n <li><h3><a href=\"${recipeData.recipes[1].sourceUrl}\" target=\"_blank\">${recipeData.recipes[1].title}</a>\n <img src=\"${recipeData.recipes[1].image}\" alt=\"${recipeData.recipes[1].title} image\">\n </li>\n \n <li><h3><a href=\"${recipeData.recipes[2].sourceUrl}\" target=\"_blank\">${recipeData.recipes[2].title}</a>\n <img src=\"${recipeData.recipes[2].image}\" alt=\"${recipeData.recipes[2].title} image\">\n </li>\n </ul>\n </section>`\n );\n}", "function showALL() {\n\tshowEP();\n\t showStatics();\n}", "function showFavoriteRecipes() {\n showAllRecipes()\n let unsavedRecipes = recipes.filter(recipe => {\n return !user.favoriteRecipes.includes(recipe.id);\n });\n if(unsavedRecipes.length === recipes.length){\n return domUpdates.emptyPageErrorMsg('favorite');\n }\n unsavedRecipes.forEach(recipe => {\n let domRecipe = document.getElementById(`${recipe.id}`);\n domUpdates.hide(domRecipe)\n });\n domUpdates.showFavoriteRecipes()\n}", "function showAll() {\n UI.list.find('li').show();\n UI.showMore.hide();\n }", "function showAll() {\n\n}", "function printRecipeToScreen(recipeRead) {\n var seen = [];\n\n var tempOutput = JSON.stringify(recipeRead, function (key, val) {\n if (val != null && typeof val == \"object\") {\n if (seen.indexOf(val) >= 0) {\n return;\n }\n seen.push(val);\n }\n return val;\n })\n\n // This is an array of the FDA API queries for each ingredient\n var ingredients = JSON.parse(tempOutput)._docs;\n\n // Run through each FDA API query and compile information\n ingredients.forEach(sumNutrition);\n\n // Set the text element to display the recipe\n setRecipeOutput(ingredientList + '\\nTotal calories: ' + totalCalories);\n }", "function index(req, res) {\n Recipe.find({}, function (err, recipes) {\n res.render('recipes/index', {\n recipes,\n title: \"In the Kitchen\",\n // user: req.user,\n })\n })\n}", "async function showRandomRecipes() {\n const recipes = await getRandomRecipes();\n await showRecipes(recipes);\n // randomShow = true; \n }", "function fetchRecipes() {\n fetch(RECIPES_URL)\n .then(resp => resp.json())\n .then(json => json.forEach(recipe => {\n let newRecipe = new Recipe(recipe.name, recipe.url, recipe.meal_type, recipe.cuisine, recipe.id);\n allRecipes.push(newRecipe);\n newRecipe.renderRecipe();\n }))\n }", "function displayRecipes(responseJSON) {\n // console.log(responseJSON);\n\n // this clears out any pre-existing data\n $(\"#showRecipes\").html(\"<h3>Top Recipes</h3>\");\n\n var hitsArray = responseJSON.hits;\n var counter = 0;\n // var total = hitsArray.length;\n var total = 3;\n\n while(counter < total ) {\n\n // found in jsonp file i.e. https://api.edamam.com/search?q=chicken&app_id=21035d97&app_key=fd726687e4cfbcb844326f030aa3ed95\n var hit = hitsArray[counter];\n\n // each recipe has its subsection in the file\n var recipe = hit.recipe;\n\n // use the template function to get a list item\n var li = getRecipeListItem(recipe);\n\n // append the list item to our HTML\n // $(\"ul\").append(li);\n $(\"#showRecipes\").append(li);\n\n // increment the counter\n // to avoid infinite loops\n counter = counter + 1;\n }\n }", "function searchRecipes() {\n showAllRecipes();\n let searchedRecipes = domUpdates.recipeData.filter(recipe => {\n return recipe.name.toLowerCase().includes(searchInput.value.toLowerCase());\n });\n filterNonSearched(createRecipeObject(searchedRecipes));\n}", "function getSavedRecipes() {\n $.get(\"/api/recipes/saved\", function (data) {\n if (!data) {\n return;\n }\n renderSavedRecipes(data);\n });\n}", "async renderAllTodos() {\n const todos = await Controller.getTodos();\n this.renderNav(todos);\n this.renderTodos(todos);\n this.renderHeadingTitle('All Todos', todos.length);\n }", "function showAllExercisesPage(){\n showExercisesPage(exercises, '/exercises');\n}", "function displayRecipes(apiData, ingredient){\n clearRecipes();\n recipeList = [];\n \n // gives the user a message if no recipes return from ingredient search\n if(apiData.meals == null){\n var recipe = document.createElement(\"div\");\n recipe.id = \"recipe-card\";\n \n var recipeName = document.createElement(\"p\");\n recipeName.id = \"rec-name\";\n ingredient = ingredient.replace(\"_\",\" \");\n recipeName.textContent = \"There are presently no recipes including \" + ingredient + \".\";\n\n recipe.appendChild(recipeName);\n recipeListEl.appendChild(recipe);\n }\n else{\n for(i=0; i<apiData.meals.length; i++){\n recipeList.push(apiData.meals[i].strMeal);\n }\n // automatically displays all recipes if there are less than 6 associated with an ingredient\n if(recipeList.length < 6){\n for(i=0; i<recipeList.length; i++){\n var recipe = document.createElement(\"div\");\n recipe.id = \"recipe-card\";\n \n var recipeName = document.createElement(\"p\");\n recipeName.id = \"rec-name\";\n recipeName.textContent = recipeList[i];\n \n var recipeBtnEl = document.createElement(\"button\");\n recipeBtnEl.id = \"rec-detail-btn\";\n recipeBtnEl.classList.add(\"btn\");\n recipeBtnEl.textContent = \"Get Details\";\n \n recipe.appendChild(recipeName);\n recipe.appendChild(recipeBtnEl);\n recipeListEl.appendChild(recipe);\n } \n }\n else {\n largeRecNum(ingredient);\n }\n }\n}", "function showAll(req, res) {\n // On récupère la date demandée.\n const date = req.params.date;\n\n retrieveAll(date, (jsonRes) => {\n var templateParameters = {\n flights: jsonRes,\n date: date\n };\n res.render(__dirname + '/templates/flight_list.ejs', templateParameters);\n });\n}", "function showAll() {\n\tlocation.href = '?all=1';\n}", "function showRecipe(recipe) {\n\n // display index page inside recipe section\n const recipe_pages = document.getElementById('navigatingIndex');\n if (recipe_pages !== null) recipe_pages.innerHTML = navigatingIndex;\n\n let nutrients_labels = [],\n nutrients_values = [],\n nutrients_daily = [],\n recipe_calories = [],\n recipe_img_url = [],\n recipe_label = [];\n\n \n // check for a valid length of the array\n if (recipe.hits.length > 0) {\n\n const childNodes = plant_detail.childNodes;\n\n childNodes.forEach(node => {\n\n // if a node's style is defined\n node.style !== undefined ? \n\n // if the node's id is table_wrapper\n node.id === 'table_wrapper' ? \n (node.style.right = '-100%', node.style.position = 'absolute') :\n\n // or if the node's id is nutrientsChart\n node.id === 'nutrientsChart' ? \n (node.style.bottom = '0px') :\n\n // or if the node's id is recipe_wrapper\n node.id === 'recipe_wrapper' ? \n (node.style.zIndex = 2) :\n\n // otherwise\n (node.style.left = '-100%') :\n undefined;\n });\n \n // loop through the array\n for (let i = 0; i < recipe.hits.length; i++) {\n\n recipe_calories.push(recipe.hits[i].recipe.calories + 'kcal / serving');\n recipe_img_url.push(recipe.hits[i].recipe.image);\n recipe_label.push(recipe.hits[i].recipe.label);\n\n const recipe_digest = recipe.hits[i].recipe.digest;\n\n // loop through digest array\n for(let j = 0; j < recipe_digest.length; j++) {\n \n nutrients_labels.push(recipe_digest[j].label);\n nutrients_values.push(recipe_digest[j].total);\n nutrients_daily.push(recipe_digest[j].daily);\n }\n }\n\n \n // divide the total number of recipes into individual one\n const divided = nutrients_values.length / recipe.hits.length;\n\n // create next and previous buttons for the recipe detail navigations\n if (document.querySelector('.recipe_nav_buttons') === null)\n nextPrevButtons(recipe);\n else if (document.querySelector('.recipe_detail_img_container') !== null) {\n removeElements(document.getElementsByTagName('h4'));\n removeElements([document.querySelector('.recipe_detail_img_container')]);\n }\n \n const img = document.createElement('img'),\n img_div = document.createElement('div');\n img.src = recipe_img_url[navigatingIndex];\n img.className = 'recipe_detail_img'\n img_div.className = 'recipe_detail_img_container';\n img_div.style.display = 'block';\n\n // append the img to the img div\n img_div.appendChild(img);\n\n // create the title of the recipe\n const title = document.createElement('h4');\n title.innerHTML = recipe_label[navigatingIndex];\n \n // append the title to recipe_wrapper div as the first element\n recipe_wrapper.insertAdjacentElement('afterbegin', title);\n\n // append the img div to recipe_wrapper div as the next sibling of title header\n title.parentNode.insertBefore(img_div, title.nextSibling);\n\n // default value for the display, in order to show the first recipe\n nutrients_values = nutrients_values.slice(divided * navigatingIndex, divided * (navigatingIndex + 1));\n nutrients_labels = nutrients_labels.slice(divided * navigatingIndex, divided * (navigatingIndex + 1));\n\n // draw a chart with the total number of recipes,\n // all recipe's total values, all the corresponding labels, and healthy daily consumption of the nutrients\n chartData(nutrients_values, nutrients_labels, 2);\n }\n}", "function show_all() {\n $(\"#meta-info\").show()\n $(\"#progress_bar\").show()\n $(\"#arrived-late\").show()\n $(\"#punctual\").show()\n $(\"#left-early\").show()\n $(\"#punctual-day-chart\").show()\n $(\"#breakdown p\").show()\n $(\"#punctual-table-wrapper\").show()\n $('#punctual-table-wrapper').collapse(\"show\")\n}", "async function loadDiyRecipesPage() {\n cleanUp();\n show($diyRecipes);\n await showDiyRecipes();\n }", "function showAllTours(){\n\t\tvar tours = Topology.getCurrentTours();\n\t\tif (tours === null || tours.length === 0) {\n\t\t\t$(\"#message_for_tours\").text(\"Please load a tour file.\");\n\t\t\treturn;\n\t\t}\n\t\tdisplayTours(tours);\n\t}", "function renderEverything() {\n renderPepperonni() ;\n renderMushrooms() ;\n renderGreenPeppers() ;\n renderWhiteSauce() ;\n renderGlutenFreeCrust() ;\n // renderButtons() -- not done, integrated this into the render of each ingredient ;\n renderPrice() ;\n}", "function fetchRecipes() {\n tool.forEach(data.menu.sections, function(section) {\n section.recipes = tool.map(section.recipes, function(id) {\n return fetchRecipe(id);\n });\n });\n }", "function displayRecipe(data) {\n var Recipe = data.meals[0];\n var RecipeDiv = document.getElementById(\"event-list-group\");\n \n var recipeContainer = document.createElement(\"div\");\n $(recipeContainer).addClass(\"recipe-container columns\");\n\n var RecipeImg = document.createElement(\"img\");\n RecipeImg.id = \"::img\";\n RecipeImg.style.cssText = \"width:300px;height:300px;\";\n $(RecipeImg).addClass(\"inline-img col-auto\");\n RecipeImg.src = Recipe.strMealThumb;\n recipeContainer.appendChild(RecipeImg);\n\n var contentDiv = document.createElement(\"div\");\n $(contentDiv).addClass(\"col-auto\");\n\n var RecipeIngredients = document.createElement(\"ul\");\n $(RecipeIngredients).addClass(\"inline-ul\");\n contentDiv.appendChild(RecipeIngredients);\n\n recipeContainer.appendChild(contentDiv);\n\n RecipeDiv.appendChild(recipeContainer);\n\n $(\"<label>\")\n .addClass(\"form-checkbox\")\n .html(\"<input class='recipe-checkbox' type='checkbox'><i class='form-icon'></i> Add Recipe\")\n .appendTo(contentDiv);\n\n\n var getIngredients = Object.keys(Recipe)\n .filter(function (ingredient) {\n return ingredient.indexOf(\"strMeal\") == 0;\n })\n .reduce(function (ingredients, ingredient) {\n if (Recipe[ingredient] != null) {\n ingredients[ingredient] = Recipe[ingredient];\n }\n return ingredients;\n }, {});\n\n var getArea = Object.keys(Recipe)\n .filter(function (ingredient) {\n return ingredient.indexOf(\"strArea\") == 0;\n })\n .reduce(function (ingredients, ingredient) {\n if (Recipe[ingredient] != null) {\n ingredients[ingredient] = Recipe[ingredient];\n }\n return ingredients;\n }, {});\n\n var getCategory = Object.keys(Recipe)\n .filter(function (ingredient) {\n return ingredient.indexOf(\"strCategory\") == 0;\n })\n .reduce(function (ingredients, ingredient) {\n if (Recipe[ingredient] != null) {\n ingredients[ingredient] = Recipe[ingredient];\n }\n return ingredients;\n }, {});\n\n var getSource = Object.keys(Recipe)\n .filter(function (ingredient) {\n return ingredient.indexOf(\"strSource\") == 0;\n })\n .reduce(function (ingredients, ingredient) {\n if (Recipe[ingredient] != null) {\n ingredients[ingredient] = Recipe[ingredient];\n }\n return ingredients;\n }, {});\n\n var getVideo = Object.keys(Recipe)\n .filter(function (ingredient) {\n return ingredient.indexOf(\"strYoutube\") == 0;\n })\n .reduce(function (ingredients, ingredient) {\n if (Recipe[ingredient] != null) {\n ingredients[ingredient] = Recipe[ingredient];\n }\n return ingredients;\n }, {});\n\n let value = getIngredients[\"strMeal\"];\n listItem = document.createElement(\"li\");\n listItem.innerHTML = value;\n RecipeIngredients.appendChild(listItem);\n\n let area = getArea[\"strArea\"];\n listItem = document.createElement(\"li\");\n listItem.innerHTML = area;\n RecipeIngredients.appendChild(listItem);\n\n let category = getCategory[\"strCategory\"];\n listItem = document.createElement(\"li\");\n listItem.innerHTML = category;\n RecipeIngredients.appendChild(listItem);\n\n let recipeSource = getSource[\"strSource\"];\n if (recipeSource) {\n var link = $(\"<li>\").appendTo(listItem);\n $(\"<a>\")\n .text(\"Recipe Link\")\n .attr(\"href\", `${recipeSource}`)\n .attr(\"target\", \"_blank\")\n .appendTo(link);\n }\n\n let recipeVideo = getVideo[\"strYoutube\"];\n if (recipeVideo) {\n var videolink = $(\"<li>\").appendTo(listItem);\n $(\"<a>\")\n .text(\"Recipe YouTube Video\")\n .attr(\"href\", `${recipeVideo}`)\n .attr(\"target\", \"_blank\")\n .appendTo(videolink);\n }\n}", "function showAll() {\n $('.movie-list').empty();\n \n $.get('/allmovies', function(data) {\n if (data.length > 0) {\n for (let i in data) {\n buildMovieList(data[i]);\n }\n $('.not-found').css(\"display\", \"none\");\n $('.movie-list').css(\"display\", \"block\");\n }\n else {\n $('.movie-list').css(\"display\", \"none\");\n $('.not-found').css(\"display\", \"block\");\n }\n });\n}", "function loadTag () {\n\n\n const ingredients = recipes.filter (recipe => {\n return tags.ingredients.every (tag => {\n return recipe[\"ingredients\"].some (t => tag.value.toLowerCase() === t.ingredient.toLowerCase())\n })\n })\n\n const ustensils = ingredients.filter (recipe => {\n return tags.ustensils.every (tag => {\n return recipe[\"ustensils\"].some (t => tag.value.toLowerCase() === t.toLowerCase())\n })\n })\n\n const data = ustensils.filter (recipe => {\n return tags.appareils.every (tag => {\n return recipe.appliance.toLowerCase() === tag.value.toLowerCase()\n })\n })\n\n recipes.map (recipe => {\n\n const recipeElement = document.getElementsByClassName(\"recipe-\"+recipe.id)[0]\n\n recipeElement.style.display = \"none\"\n\n })\n\n data.map (recipe => {\n const recipeElement = document.getElementsByClassName(\"recipe-\"+recipe.id)[0]\n\n recipeElement.style.display = \"\"\n })\n\n}", "function displayRecipe(response, content) { \n var ingredients = [];\n for(x=0; x<response.extendedIngredients.length; x++) {\n ingredients.push(response.extendedIngredients[x].name);\n }\n buttonCreate(content);\n recipeName(response);\n ingrList(ingredients);\n method(response);\n }", "function getSavedRecipes() {\n $.get(\"/api/recipes/saved\", function (data) {\n // console.log(data);\n if (!data) {\n return;\n }\n renderSavedRecipes(data);\n });\n}", "function showHoodies()\n{\n\t//show all items with theid 'hoodies'\n\tdocument.getElementById('hoodies').style.display = \"block\";\n\t//hide all other items\n\tdocument.getElementById('hats').style.display = \"none\";\n\tdocument.getElementById('accessories').style.display = \"none\";\n\tdocument.getElementById('skate').style.display = \"none\";\n\tdocument.getElementById('show').style.display = \"block\";\n}", "function viewAllStations(){\n console.log(\"Viewing All stations \\n\");\n connection.query(\"SELECT * FROM station\",function(err, res){\n if (err) throw err;\n console.table(res);\n lastQuestion()\n });\n}", "function rendercity() {\n $(`#cityList`).empty()\n for (var i = 0; i < cities.length; i++) {\n a = $(\"<button>\")\n a.addClass(\"city\");\n a.attr(\"cityName\", cities[i]);\n a.text(cities[i]);\n $(\"#cityList\").append(a);\n }\n // forecast()\n }", "function showAll() {\n for (var simCount = 0; simCount < simData[\"simulations\"].length; simCount++) {\n var card = document.getElementsByClassName('thumbnail-view')[simCount],\n cardDelete = document.getElementsByClassName('tile-delete')[simCount],\n cardDownload = document.getElementsByClassName('tile-download')[simCount];\n card.classList.remove('hide-back');\n cardDelete.classList.add('hide');\n cardDownload.classList.remove('hide');\n }\n }", "function displayWeather( weather ) {\n $( \"#weather\" ).show();\n $( \"#weather\" ).html(\n $( \"<div class=temperature id=weather-temp>\" ).text( weather.currently.temperature.toFixed() + \"°F\" )\n );\n $( \"#weather\" ).append(\n $( \"<div class=details id=weather-details>\" )\n );\n $( \"#weather-details\" ).append(\n $( \"<p class=weather-summary>\" ).text( weather.currently.summary )\n );\n $( \"#weather-details\" ).append(\n $( \"<ul class=weather-items id=weather-list>\" )\n );\n $( \"#weather-list\" ).append(\n $( \"<li class=weather-item>\" ).text( weather.hourly.summary )\n );\n $( \"#weather-list\" ).append(\n $( \"<li class=weather-item>\" ).text( weather.daily.summary )\n );\n $( \"#weather-list\" ).append(\n $( \"<li class=weather-item>\" ).text( \"Wind speed: \" + weather.currently.windSpeed )\n );\n $( \"#weather-list\" ).append(\n $( \"<li class=weather-item>\" ).text( \"Humidity: \" + weather.currently.humidity )\n );\n}", "function dispalySelectedRecipe(clicked) {\n var request_recipie = document.getElementById(clicked),\n create_innerHTML = \"<br />\",\n r_list = globe.getRecipes(),\n lines,\n plural,\n i;\n\n if (globe.getID(0)) {\n removeLink();\n }\n\n globe.user_search.value = \"\";\n globe.hint_span.innerHTML = \"\";\n globe.results_div.innerHTML = \"\";\n create_innerHTML += \"\" + r_list[clicked].toMake + \" Recipe<br /><table>\";\n create_innerHTML += \"<tr><th>ingredients</th><th>Amount</th><th>Mesure</th></tr>\"\n for (i = 0; i < r_list[clicked].ingredients.length; i += 1) {\n \n if (i % 2 === 0) {\n lines = \"even\";\n } else {\n lines = \"odd\"\n }\n \n if (r_list[clicked].ingredients[i].amount > 1) {\n plural = \"s\";\n } else {\n plural = \"\";\n }\n\n create_innerHTML += \"<tr>\"\n create_innerHTML += \"<td class=\\\"ingredients \" + lines + \"\\\">\" + r_list[clicked].ingredients[i].ingredient + \"</td>\";\n create_innerHTML += \"<td class=\\\"amount \" + lines + \"\\\">\" + r_list[clicked].ingredients[i].amount + \"</td>\";\n create_innerHTML += \"<td class=\\\"mesure \" + lines + \"\\\">\" + r_list[clicked].ingredients[i].mesure + plural + \"</td>\";\n create_innerHTML += \"</tr>\"\n }\n create_innerHTML += \"</table>\"\n \n globe.display_recipe.innerHTML = create_innerHTML;\n}", "function HandleShowAll() {\n console.log(\"=== HandleShowAll\");\n\n const datalist_request = {\n setting: {page: \"page_user\"},\n user_rows: {get_all_users: true},\n //corrector_rows: {get: true},\n //usercompensation_rows: {get: true},\n };\n console.log(\" datalist_request\", datalist_request);\n\n DatalistDownload(datalist_request, \"DOMContentLoaded\");\n }", "function viewAll() {\n inquirer\n .prompt({\n name: \"table\",\n type: \"list\",\n message:\n \"Would you like to view all departments, roles, or employees?\",\n choices: [\n {\n name: \"Departments\",\n value: \"department\",\n },\n {\n name: \"Roles\",\n value: \"roles\",\n },\n {\n name: \"Employees\",\n value: \"employee\",\n },\n ],\n })\n .then(function (answer) {\n console.log(`Selecting all from ${answer.table}...`);\n\n switch (answer.table) {\n case \"department\":\n displayAllDepartments();\n break;\n\n case \"roles\":\n displayAllRoles();\n break;\n\n case \"employee\":\n displayAllEmployees();\n break;\n }\n\n initTracker();\n });\n}", "function viewButton(){\n\tvar xhr = new XMLHttpRequest();\n\t\n\tvar url = document.getElementById('recipesDrop').value;\n\txhr.open(\"GET\", \"recipes/\" + url);\n\txhr.addEventListener('load', function(){\n\t\t\t\trecipe = JSON.parse(xhr.responseText);\n\t\t\t\tdocument.getElementById(\"duration\").value = recipe.duration;\n\t\t\t\tdocument.getElementById(\"ingredients\").value = recipe.ingredients;\n\t\t\t\tdocument.getElementById(\"directions\").value = recipe.directions;\n\t\t\t\tdocument.getElementById(\"notes\").value = recipe.notes;\n\t});\n\txhr.send();\n}", "function showWeatherResults() {\n const weather = document.getElementById('weather-segment');\n weather.style.display = 'block';\n }", "function showAllCategories(){\n NEAR_FIELD_OBJECTS.scene.children.forEach(child => {\n child.visible = true\n })\n}", "function viewAllProducts() {\n //connection/callback function\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n console.log(\"All items currently available in marketplace:\\n\");\n console.log(\"\\n-----------------------------------------\\n\");\n for (var i = 0; i < res.length; i++) {\n console.log(\"Id: \".bold + res[i].item_id + \" | Product: \".bold + res[i].product_name + \" | Department: \".bold + res[i].department_name + \" | Price: \".bold + \"$\".bold +res[i].price + \" | QOH: \".bold + res[i].stock_quantity);\n }\n console.log(\"\\n-----------------------------------------\\n\");\n });\n\n}", "function displayAllRecipeFromUserList() {\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function () {\n if (this.readyState === 4 && this.status === 200) {\n document.getElementById(\"recipes\").innerHTML = this.responseText;\n }\n };\n xhttp.open(\"GET\", \"pages/recette_affiche_multiplerecette.php\", true);\n xhttp.send();\n}", "function getWeather() {\n $.getJSON(\"https://api.openweathermap.org/data/2.5/weather?\" + locationQuery + \"&units=imperial&appid=\" + key, function(json) {\n $.each(json, function(key, value) {\n switch(key) {\n case \"weather\":\n $.each(value[0], displayWeather);\n break;\n case \"main\":\n $.each(value, displayTemp);\n break;\n case \"sys\":\n $.each(value, displayCountry);\n break;\n case \"name\":\n $(\"#city\").html(value + \", \");\n }\n });\n }); \n}", "function renderEverything() {\n renderIngredients();\n renderButtons();\n renderPrice();\n}", "async getAllRecipe() {\n\n return await prisma.recipe.findMany();\n\n }", "render() {\n let filteredRecipe = this.state.recipes.filter(recipe => {\n return recipe.name.toLowerCase().includes(this.state.searchRecipe.toLowerCase());\n });\n return (\n <div>\n <center><Search handleInput={this.handleInput} /></center>\n <Recipes recipes={this.state.recipes && filteredRecipe} ReloadData={this.ReloadData}></Recipes>\n </div>\n\n );\n\n }", "async function getAll(req, res) {\n const all = await Recipe.find({})\n .limit(18);\n res.json(all);\n}", "function showRecipe() {\n grid.style.display = \"none\"\n\n var ingredients = [recipe.drinks[0].strIngredient1, recipe.drinks[0].strIngredient2, recipe.drinks[0].strIngredient3, recipe.drinks[0].strIngredient4, recipe.drinks[0].strIngredient5, recipe.drinks[0].strIngredient6, recipe.drinks[0].strIngredient7, recipe.drinks[0].strIngredient8, recipe.drinks[0].strIngredient9, recipe.drinks[0].strIngredient10, recipe.drinks[0].strIngredient11, recipe.drinks[0].strIngredient12, recipe.drinks[0].strIngredient13, recipe.drinks[0].strIngredient14, recipe.drinks[0].strIngredient15];\n var measure = [recipe.drinks[0].strMeasure1, recipe.drinks[0].strMeasure2, recipe.drinks[0].strMeasure3, recipe.drinks[0].strMeasure4, recipe.drinks[0].strMeasure5, recipe.drinks[0].strMeasure6, recipe.drinks[0].strMeasure7, recipe.drinks[0].strMeasure8, recipe.drinks[0].strMeasure9, recipe.drinks[0].strMeasure10, recipe.drinks[0].strMeasure11, recipe.drinks[0].strMeasure12, recipe.drinks[0].strMeasure13, recipe.drinks[0].strMeasure14, recipe.drinks[0].strMeasure15];\n\n recipeUl.innerHTML = recipe.drinks[0].strDrink\n var direction = document.createElement('li');\n direction.innerHTML = recipe.drinks[0].strInstructions\n recipeUl.appendChild(direction)\n for (let i = 0; i < ingredients.length; i++) {\n if (ingredients[i] !== null) {\n var recipeEl = document.createElement('li');\n recipeEl.innerHTML = ingredients[i] + \" \";\n recipeUl.appendChild(recipeEl);\n }\n if (measure[i] !== null) {\n var spanEl = document.createElement('span');\n spanEl.innerHTML = measure[i];\n recipeEl.appendChild(spanEl);\n }\n }\n glass.src = recipe.drinks[0].strDrinkThumb + \"/preview\";\n glassEl.appendChild(glass);\n\n}", "function getWeather() {\n\t\tcity.innerHTML = `${forecast.city},` + `${forecast.country}`;\n\t\tweather.innerHTML = `${forecast.description}`;\n\t\ttemp.innerHTML = `Current Temp:${forecast.temperature}&degC`;\n\t\ticon.innerHTML = `<img src=\"assets/${forecast.image}.png\">`;\n\n\t\tsearch.value = '';\n\t}", "static fetchRecipes() {\n fetch(BASE_URL)\n .then(resp => resp.json())\n .then(recipes => {\n for( const recipe of recipes) {\n let r = new Recipe(recipe.id, recipe.title, recipe.instructions, recipe.ingredients);\n r.renderRecipe();\n recipe.ingredients.forEach(\n ingredient => {\n let i = new Ingredient(ingredient.id, ingredient.name, ingredient.measurement);\n i.renderIngredient(r);\n })\n }\n \n }) \n }", "function renderAll(){\n sigs = d3.selectAll('.partycolor')[0]\n .map( function(d){\n if(d.checked) return 1;\n else return 0;\n }\n );\n //party_filter();\n\n chart.each(render);\n d3.select(\"#active\").text(formatNumber(all.value()));\n\n // retrieve all filtered data, \n var allStations = ovkf.top(Infinity);\n render_map(allStations, oblasti); \n }", "function showAllDefinitions() {\n const allTermContainers = Array.from(document.querySelectorAll(\".term-container\"));\n allTermContainers.forEach(container => container.classList.remove(\"hidden\"));\n checkAllTermsHidden();\n}", "function viewRecipeDetails() {\n $('div.meal-card-data > a').each(function() {\n $(this).click(function() {\n saveToLocalStorage('recipeIdToDisplay', $(this).attr('id'));\n });\n });\n}", "function showAll(){\n if(map.hasLayer(recreationLocations)){\n map.removeLayer(recreationLocations);\n };\n // Get CARTO selection as GeoJSON and Add to Map\n $.getJSON(\"https://\"+cartoDBUserName+\".carto.com/api/v2/sql?format=GeoJSON&q=\"+sqlQuery, function(data) {\n recreationLocations = L.geoJson(data,{\n onEachFeature: function (feature, layer) {\n layer.bindPopup('<p><b>' + feature.properties.recareanam + '</b><br /><em>' + feature.properties.parentacti + '</em></p>');\n layer.cartodb_id=feature.properties.cartodb_id;\n }\n }).addTo(map);\n });\n}", "function showUserRecipes(connected) {\n generateUserRecipe();\n var doc = document.getElementById('user_recipes');\n\tvar doc2;\n\tif (!connected) {\n\t\tdoc2 = document.getElementById('connection');\n\t}\n\telse {\n\t\tdoc2 = document.getElementById('nickname_manage');\n\t}\n\tif ($(doc2).is(':visible')) {\n doc2.style.display = 'none';\n }\n if ($(doc).is(':visible')) {\n doc.style.display = 'none';\n }\n else {\n doc.style.display = 'block';\n }\n}", "function viewAll() {\n connection.query(\"SELECT * FROM products\",\n function (err, res) {\n if (err) throw err;\n console.table(res);\n connection.end();\n }\n );\n}", "onShowAllFeaturesButtonClick() {\n let foundedFeatures = this.get('foundedFeatures');\n if (!Ember.isArray(foundedFeatures)) {\n return;\n }\n\n // Show all selected features.\n let features = foundedFeatures.filter((feature) => {\n return Ember.get(feature, '_selected') === true;\n });\n\n this._showFoundedFeatures(features, this.get('_selectedLayer'));\n }", "function viewAll() {\n connection.query('SELECT * FROM products', function(err, res) {\n // Sets up table for our raw data already populated within MYSQL Workbench\n var table = new Table({\n head: ['ID', 'Product Name', 'Department', 'Price', 'Stock Quantity']\n });\n\n // displays all current inventory in a fancy shmancy table thanks to cli-table package\n console.log(chalk.blue(\"CURRENT INVENTORY, HOT HOT HOT!!!\"));\n console.log(\"===========================================================================================\");\n for (var i = 0; i < res.length; i++) {\n table.push([res[i].id, res[i].product_name, res[i].department_name, res[i].price.toFixed(2), res[i].stock_quantity]);\n }\n console.log(\"-------------------------------------------------------------------------------------------\");\n console.log(table.toString());\n // call next function\n whatToBuy();\n })\n }", "displayAllThings (allThings) {\n\n let outputAll = '<h3> Available Things: </h3>';\n for (let i = 0; i< allThings.length; i++) {\n\n _name = allThings[i].Thing_name\n _uid = allThings[i].Thing_UID\n _status = allThings[i].Thing_status\n\n outputAll +=\n ` <ul>\n <li> <b>---- Thing ${i+1} </b> </li>\n <li> <b> Thing- Name </b>: ${_name} </li>\n <li> <b>Thing- UID </b>: ${_uid} </li> \n <li> <b>Thing- Status </b>: ${_status} </li> \n </ul> \n `\n } \n document.getElementById ('outputAll').innerHTML = outputAll;\n }", "function mainShow(){\n\tvar xml = new XMLHttpRequest();\n\txml.onreadystatechange = function (){\n\t\tif(xml.readyState === 4){\n\t\t\tdocument.getElementById('tbody').innerHTML = xml.responseText;\n\t\t}\n\t}\n\tvar all = document.getElementById('all').value;\n\txml.open('GET', all, true);\n\txml.send();\t\n}", "function displayResults(responseJson) {\n\n let recipeinfo = `\n <img src= ${responseJson.recipes[0].image} class=\"imgStyle\" alt=\"Recipe Photo\">\n <h2><span> ${responseJson.recipes[0].title}</span></h2>\n <p><span> Make Time: ${responseJson.recipes[0].readyInMinutes}</span></p>\n `\n $('.recipeScreen').html(recipeinfo)\n\n // Ingredient List\n $('.resultsList').empty();\n $('.resultsList').append(`<h3>Ingredient List:</h3>`);\n for (let i = 0; i < responseJson.recipes[0].extendedIngredients.length; i++) {\n $('.resultsList').append(`<li><p>${responseJson.recipes[0].extendedIngredients[i].name}</p>\n </li>`);\n }\n $('.resultsList').append(`\n <h3> Instructions: </h3>\n <p class=\"instructionBox\">${responseJson.recipes[0].instructions}</p>`);\n\n //display the results section\n $('.contentBox').hide();\n $('.recipePage').show();\n $('html,body').scrollTop(0);\n}", "function displayWeather(weatherData) {\n const { data } = weatherData;\n data.forEach((item, index) => {\n const {\n max_temp,\n min_temp,\n weather,\n clouds,\n wind_sp,\n wind_cdir,\n pop,\n vis,\n snow,\n snow_depth,\n uv,\n } = item;\n const {\n icon,\n description,\n } = weather;\n let max_tempCel = convertToCelcius(max_temp);\n let min_tempCel = convertToCelcius(min_temp);\n $('#js-result-section div').find(`[id='js-date${index}']`).append(`\n <div class=\"col s10 offset-s1 m6 center\" role=\"region\" aria-label=\"weather summary\">\n <img src=\"icons/${icon}.png\" alt=\"weather icon\">\n <p><span class=\"min-temp\">${min_temp}</span> / <span class=\"max-temp\">${max_temp}</span> &deg;F</p>\n <p><span class=\"min-temp\">${min_tempCel}</span> / <span class=\"max-temp\">${max_tempCel}</span> &deg;C</p>\n <p>${description}</p>\n </div>\n <div class=\"col s10 offset-s1 m6 right\" role=\"region\" aria-label=\"weather summary\">\n <ul class=\"left-align\" role=\"list\" aria-label=\"detailed weather data\">\n <li role=\"listitem\"><strong>Cloud coverage:</strong> &nbsp;&nbsp;${clouds} %</li>\n <li role=\"listitem\"><strong>Wind speed:</strong>&nbsp;&nbsp;${wind_sp} m/s</li>\n <li role=\"listitem\"><strong>Wind direction:</strong>&nbsp;&nbsp;${wind_cdir}</li>\n <li role=\"listitem\"><strong>Probability of precip:</strong>&nbsp;&nbsp;${pop}%</li>\n <li role=\"listitem\"><strong>Visibility:</strong>&nbsp;&nbsp;${vis} km</li>\n <li role=\"listitem\"><strong>Snow:</strong>&nbsp;&nbsp;${snow} mm</li>\n <li role=\"listitem\"><strong>Snow depth:</strong>&nbsp;&nbsp;${snow_depth} mm</li>\n <li role=\"listitem\"><strong>Daily max. UV (0-11+):</strong>&nbsp;&nbsp;${uv}</li>\n </ul>\n </div>`);\n });\n}", "function renderAllWidgets() {\n if (registeredWidgets === null) {\n registeredWidgets = [];\n }\n\n registeredWidgets.forEach(widget => {\n switch (widget.widgetConsName) {\n case \"Weather\":\n weatherWidget();\n break;\n case \"Holiday\":\n holidayWidget();\n break; \n case \"Restaurant\":\n restaurantWidget();\n break; \n case \"TimeZone\":\n timezoneWidget();\n break;\n\n default:\n break;\n }\n });\n}", "function displayResults(weather) {\n city.innerHTML = `${weather.name}, ${weather.sys.country}`;\n\n now = new Date();\n today.innerHTML = dateBuilder(now);\n\n temp.innerHTML = `${Math.round(weather.main.temp)}<span>°C</span>`;\n\n currentWeather.innerHTML = weather.weather[0].main;\n\n hilow.innerHTML = `${Math.round(weather.main.temp_min)}°C / ${Math.round(\n weather.main.temp_max,\n )}°C`;\n modify();\n}", "function getAllRecipes(req, res, next) {\n db.any('select * from recipes')\n .then(function (data) {\n res.status(200)\n .json({\n status: 'success',\n data: data,\n message: 'Retrieved all recipes'\n });\n\n })\n .catch(function (err) {\n return next(err);\n });\n}", "function displayData() {\n displayUserInfo();\n displayRecipes();\n console.log(\"before\", chosenPantry)\n}", "function viewSomething() {\n\t if ( action == 1 ) {\n\t \t// Call the make it rain function\n\t\t\tmakeItRain();\n\t \taction = 2;\n\t } else {\n\t //Hide all the rain drops\n\t $('.drop').hide();\n\t action = 1;\n\t }\n\t}", "function displayAllElements(kind){\n\t\t//kind will be vehicles, people, starships, etc\n\t\tswitch(kind){\n\t\t\tcase 'people':\n\t\t\t\tgeneratePeople(maxNumberOfPeople);\n\t\t\t\tbreak;\n\t\t\tcase 'planets':\n\t\t\t\tgeneratePlanets(maxNumberOfPlanets);\n\t\t\t\tbreak;\n\t\t\tcase 'films':\n\t\t\t\tgenerateFilms(maxNumberOfFilms);\n\t\t\t\tbreak;\n\t\t\tcase 'species':\n\t\t\t\tgenerateSpecies(maxNumberOfSpecies);\n\t\t\t\tbreak;\n\t\t\tcase 'vehicles':\n\t\t\t\tgenerateVehicles(maxNumberOfVehicles);\n\t\t\t\tbreak;\n\t\t\tcase 'starships':\n\t\t\t\tgenerateStarships(maxNumberOfStarships);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tconsole.log(\"inside default displayAllElements()\");\n\t\t}\n\t}", "fetchRecipes() {\n const getApi = this.environmentapiUrl + '/getRecipes';\n return this.http.get(getApi);\n }", "function renderCitySidebar() {\n // Empty the list-group div to prevent duplication of city searches in the display\n $(\".list-group\").empty();\n var storedCitySearches = JSON.parse(localStorage.getItem(\"citySearches\"));\n if(storedCitySearches !== null) {\n citySearches = storedCitySearches;\n }\n\n // Dynamically create HTML elements for each city in the citySearches array\n citySearches.forEach(element => {\n $(\".list-group\").append($(\"<button type='button' class='list-group-item list-group-item-action'>\").text(element));\n });\n }", "function show(req, res) {\n Recipe.findById(req.params.id)\n .populate('notes')\n .exec(function (err, recipe) {\n Note.find({ _id: { $nin: recipe.notes } }, function (err, notes) {\n res.render('recipes/show', {\n title: \"Chef's Secrets!\",\n recipe,\n notes: notes,\n })\n })\n })\n}", "function searchHistoryDisplay() {\n $(\"#cityHistory\").empty();\n\n console.log(\"len:\", searchHistory.length, searchHistory);\n\n for (var i = 0; i < searchHistory.length; i++) {\n console.log(i, searchHistory[i]);\n var historyButton = $(\"<button>\");\n historyButton.addClass(\"searched-cities btn btn-light btn-lg btn-block\");\n historyButton.text(searchHistory[i]);\n $(\"#cityHistory\").prepend(historyButton);\n }\n\n $(\".searched-cities\").on(\"click\", function () {\n $(\".weatherContainer\").removeClass(\"hide\");\n var searchedCity = $(this).text();\n currentWeather(searchedCity);\n forecastWeather(searchedCity);\n });\n\n //Displays last search if a search has been conducted\n\n if (searchHistory.length > 0) {\n var city = searchHistory[searchHistory.length - 1];\n $(\"#search-term\").val(city);\n currentWeather(city);\n forecastWeather(city);\n $(\".weatherContainer\").removeClass(\"hide\");\n }\n }", "function getRecipes() {\n // build new parent elements\n var newDialog = $(\"<dialog>\", {\n id: \"recipeList\"\n });\n var newDiv = $(\"<div>\", {\n class: \"queryResult\"\n });\n\n // build query\n var query =\n sQueryStr +\n \"search?intolerances=gluten&number=\" +\n $(\"#returnsSelect\")\n .find(\":selected\")\n .text() +\n \"&cuisine=\" +\n sQueryObject.queryCuisine +\n \"&type=\" +\n sQueryObject.queryCourse +\n \"&instructionsRequired=true&query=\" +\n sQueryObject.queryIngredients;\n sSettings.url = query;\n //console.log(query);\n $.ajax(sSettings).done(function(response) {\n if (response.results.totalResults == 0) {\n console.log(\"No recipes found. Please search again.\");\n newDiv.text(\n \"Sorry! I couldn't find a gluten free recipe that matched the search terms.\"\n );\n } else {\n // iterate through results and add recipes to list element inside of modal\n var newList = $(\"<ul>\");\n for (var i = 0; i < response.results.length; i++) {\n var newListItem = $(\"<li>\", {\n id: response.results[i].id,\n class: \"listItem\"\n });\n newListItem.text(response.results[i].title);\n newList.append(newListItem);\n console.log(response.results[i].title);\n }\n newDiv.append(newList);\n }\n newDialog.append(newDiv);\n // append dialog to #results and show\n $(\"#results\").append(newDialog);\n newDialog.show();\n });\n }", "function hide_all() {\n\tcategories.forEach(category => hide(category));\n}", "function getRecipes () {\n setRecipes(recipesData)\n }", "function loadAll() {\n $http.get('data/villes.json').success(function(data) {\n $scope.states = data;\n });\n }", "function appShowAllResults(){\n\tcreateMap();\n\tdestroyMarkers();\n\tdestroyInfo();\n\tclearItinerary();\n\tdrawCenterMarker();\n\tdrawAllMarkers();\n\tzoomToFit();\n}", "function displaySearchHistory() {\n $(\"#search-history\").empty();\n search_history.forEach(function (city) {\n var history_item = $(\"<li>\");\n history_item.addClass(\"list-group-item btn btn-light\");\n history_item.text(city);\n $(\"#search-history\").prepend(history_item);\n });\n\n $(\".btn\").click(getWeather);\n $(\".btn\").click(Forecast);\n }", "function viewAllInfo() {\n inquirer.prompt({\n type: 'list',\n name: \"tableNames\",\n message: \"Would you like to view all Employees, Departments or Roles?\",\n choices: [\n {\n name: \"Employees\",\n value: \"employees\",\n },\n {\n name: \"Departments\",\n value: \"department\"\n\n },\n {\n name: \"Roles\",\n value: \"roles\",\n },\n \n ],\n }).then(function (answers) {\n console.log(`\\n Selecting all from ${answers.tableNames}\\n`)\n\n switch (answers.tableNames) {\n case \"employees\":\n viewEmployee();\n break;\n\n case \"department\":\n displayAlldept();\n break;\n\n case \"roles\":\n displayAllRoles();\n break\n\n }\n start();\n\n });\n}", "function showAll() {\n if ((document.getElementById('toggleHandicap').checked) === false) {\n document.getElementById('toggleHandicap').click();\n }\n if ((document.getElementById('toggleMunicipalGarages').checked) === false) {\n document.getElementById('toggleMunicipalGarages').click();\n console.log('it is true')\n }\n if ((document.getElementById('togglePrivateGarages').checked) === false) {\n document.getElementById('togglePrivateGarages').click();\n }\n if ((document.getElementById('toggleSmartMeters').checked) === false) {\n document.getElementById('toggleSmartMeters').click();\n }\n if ((document.getElementById('toggleBlueTopMeters').checked) === false) {\n document.getElementById('toggleBlueTopMeters').click();\n }\n if ((document.getElementById('toggleBrownTopMeters').checked) === false) {\n document.getElementById('toggleBrownTopMeters').click();\n }\n if ((document.getElementById('toggleYellowTopMeters').checked) === false) {\n document.getElementById('toggleYellowTopMeters').click();\n }\n if ((document.getElementById('toggleEVCharge').checked) === false) {\n document.getElementById('toggleEVCharge').click();\n }\n if ((document.getElementById('toggleMotorcycle').checked) === false) {\n document.getElementById('toggleMotorcycle').click();\n }\n if ((document.getElementById('toggleBusLargeVehicle').checked) === false) {\n document.getElementById('toggleBusLargeVehicle').click();\n }\n if ((document.getElementById('toggleResidential').checked) === false) {\n document.getElementById('toggleResidential').click();\n }\n if ((document.getElementById('toggleLoadingUnloading').checked) === false) {\n document.getElementById('toggleLoadingUnloading').click();\n }\n }", "function showALL(data){\n\t*autistic screeching*\n\tconsole.log(data);\n}", "function showRecipe( index ){\n //console.log(index);\n window.selectedRecipeId = window.allRecipes[index].recipe_id;\n $(\"#procedure\").empty();\n $(\"#procedure\").html('<h1>' + window.allRecipes[index].recipe_name + '</h1>')\n $(\"#procedure\").append(window.allRecipes[index].directions);\n}", "function renderModalSearchRecipe (recipes) {\n\n globalRecipe = []\n\n let edamamApiRecipe = {\n\n name: recipes.hits[0].recipe.label,\n\n calories: recipes.hits[0].recipe.calories,\n\n healthLabels: recipes.hits[0].recipe.healthLabels,\n\n source: recipes.hits[0].recipe.source,\n\n sourceUrl: recipes.hits[0].recipe.url,\n\n imgUrl: recipes.hits[0].recipe.image,\n\n ingredients: recipes.hits[0].recipe.ingredientLines,\n\n yield: recipes.hits[0].recipe.yield\n\n }\n\n globalRecipe.unshift(edamamApiRecipe)\n\n let ingredientsFormattedList = renderIngredient(edamamApiRecipe.ingredients)\n\n let preDbRecipeModal = (`\n\n <div class='modal modal-transparent fade tempModal' tabindex='-1' role='dialog' id='recipeModal'>\n\n <div class='modal-dialog'>\n\n <div class='recipe' data-recipe-id=''>\n\n <div class='col-md-12 recipeBox'>\n\n <div class='col-md-5 thumbnail'>\n\n <img src='${edamamApiRecipe.imgUrl}' alt='recipe image'>\n\n </div>\n\n <div class='col-md-6 caption'>\n\n <h4 class='inline-header'><strong>${edamamApiRecipe.name}</strong></h4>\n\n <p>via<a href='${edamamApiRecipe.sourceUrl}'> ${edamamApiRecipe.source}</a></p>\n\n <h4 class='inline-header'><strong>Ingredients:</strong></h4>\n\n <ul>${ingredientsFormattedList}</ul>\n\n <h4 class='inline-header'><strong>Yield:</strong></h4>\n\n <ul>${edamamApiRecipe.yield}</ul>\n\n <div class='bottom-align-buttons'>\n\n <button type='button' class='btn btn-primary add-recipe'><span class='icon'><i class='fa fa-plus'></i></span> Add This Recipe</button>\n\n <button type='button' class='btn btn-danger close-recipe'><span class='icon'><i class='fa fa-trash-o'></i></span> Not This Recipe</button>\n\n </div>\n\n </div>\n\n </div>\n\n </div>\n\n </div>\n\n </div>\n\n `)\n\n $('#modals').prepend(preDbRecipeModal)\n\n $('#recipeModal').modal('show')\n\n}", "function displayWeather(response) {\n lastSearchedCityWeather = response;\n displayTemp(lastSearchedCityWeather.data.main.temp);\n\n // Update city name\n let cityName = document.querySelector(\"#searchedCity\");\n cityName.innerHTML = lastSearchedCityWeather.data.name.toUpperCase();\n\n // Update wind speed\n document.querySelector(\"#wind_Speed\").innerHTML = lastSearchedCityWeather.data.wind.speed;\n\n // Update Rain\n if (lastSearchedCityWeather.data.rain === undefined) {\n document.querySelector(\"#rain_Amount\").innerHTML = 0;\n } else {\n document.querySelector(\"#rain_Amount\").innerHTML =\n lastSearchedCityWeather.data.rain[\"1h\"];\n }\n // Update weather description\n document.querySelector(\"#weather_Description\").innerHTML = lastSearchedCityWeather.data.weather[0].description.toUpperCase();\n\n // Update weather icon\n let currentWeatherIcon = document.querySelector(\"#today_Icon\");\n currentWeatherIcon.setAttribute(\"src\",`https://openweathermap.org/img/wn/${lastSearchedCityWeather.data.weather[0].icon}@2x.png`);\n currentWeatherIcon.setAttribute(\"alt\",lastSearchedCityWeather.data.weather[0].description);\n\n // Update feels like\n document.querySelector(\"#feels_Like\").innerHTML =lastSearchedCityWeather.data.main.feels_like;\n\n // Update humidity\n document.querySelector(\"#humidity\").innerHTML =lastSearchedCityWeather.data.main.humidity + \"%\";\n\n addUnits();\n \n //Forecast\n getForecast();\n\n}", "seeAllChef(req, res) {\n let sql = `SELECT * FROM chef`;\n let sql2 = `SELECT * FROM dish`;\n connection.query(sql, (error, resultChef) => {\n if (error) throw error;\n connection.query(sql2, (error, resultDish) => {\n res.render('index', { resultChef,resultDish })\n })\n })\n }", "allChefs(req,res){\n Chefs.allChefs(chefs => {\n return res.render(\"chefs/chefs\", { chefs })\n })\n }", "function showAllTours(){\r\n\tresetTourParameters();\r\n var json = JSON.parse(getAllTours());\r\n var tourArray = json.tour;\r\n var htmlResult = \"\";\r\n htmlResult +=\"<div>\";\r\n for(var i in tourArray){\r\n var tour = tourArray[i];\r\n htmlResult += \"<a data-role=button data-theme='b' href=javascript:showTour('\" + tour.name + \"'); >\" + tour.name + \"</a>\";\r\n } \r\n htmlResult +=\"</div>\";\r\n updateHTML(\"maincontent\", htmlResult);\r\n}" ]
[ "0.7695121", "0.67280036", "0.6695334", "0.6673275", "0.65193284", "0.64262086", "0.63547933", "0.6335299", "0.6321468", "0.6240727", "0.61586416", "0.6144569", "0.613548", "0.6102514", "0.6085036", "0.60047305", "0.5994358", "0.5990088", "0.59569544", "0.5951428", "0.58979815", "0.5858931", "0.58147043", "0.57908547", "0.5737233", "0.57232106", "0.57210124", "0.5702297", "0.56949645", "0.569054", "0.56868964", "0.5683238", "0.5682869", "0.5681346", "0.568049", "0.5659272", "0.5659213", "0.56580627", "0.5645068", "0.564498", "0.56368476", "0.5630188", "0.5615583", "0.5610704", "0.55867326", "0.55546564", "0.55524886", "0.5545674", "0.5544711", "0.5540661", "0.55387145", "0.5536881", "0.55366635", "0.55343074", "0.55245996", "0.55201614", "0.55180323", "0.55094707", "0.5501177", "0.5499722", "0.5498603", "0.5486282", "0.5478252", "0.5473028", "0.54702353", "0.5467022", "0.54593676", "0.54542625", "0.5443334", "0.5440137", "0.54397213", "0.5437318", "0.5436404", "0.54331666", "0.54289883", "0.54200655", "0.5413885", "0.54127663", "0.54117066", "0.54089296", "0.5397582", "0.5395594", "0.5392607", "0.538887", "0.5383587", "0.538121", "0.5378358", "0.5371462", "0.5364019", "0.5363683", "0.5350866", "0.5342837", "0.533797", "0.53272784", "0.5324895", "0.5323697", "0.5319679", "0.5318498", "0.5315822", "0.53141475" ]
0.7840708
0
Selects the correct recipes for that kind of weather
function select_by_weather(recipes) { recipes.forEach(recipe => { recipe['weather'] = false; }); let selectedChoices = findIfFilters("weather"); if (selectedChoices.length === 0) { document.querySelector('#no-filter-chosen').style.display = 'block'; } else { filter("weather", selectedChoices); display_selected_recipes(); history.pushState({ recipes: 'loaded', weather_types: selectedChoices }, ``, '/recipes'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function display_selected_recipes() {\n document.querySelector('#weather-filter-container').style.display = 'none';\n document.querySelector('#select-filters').style.display = 'block';\n document.querySelector('#recipes-title').style.display = 'block';\n document.querySelector('#grid-container').style.display = 'grid';\n window.recipes.forEach(recipe => {\n if (recipe['weather']) {\n recipe.style.display = 'block';\n } else {\n recipe.style.display = 'none';\n }\n });\n}", "function filter(filter_type, choices) {\n window.recipes.forEach(recipe => {\n if (choices.length === 0) {\n recipe[`${filter_type}`] = true;\n }\n if (filter_type === 'weather') {\n let recipeProperties = recipe.getElementsByTagName('ul')[0].children;\n for (let i = 0; i < recipeProperties.length; i++) {\n if (choices.length === 0) {\n recipe[`${filter_type}`] = true;\n } else {\n for (let j = 0; j < choices.length; j++) {\n if (recipeProperties[i].innerHTML === choices[j]) {\n recipe[`${filter_type}`] = true;\n }\n }\n }\n }\n } else {\n for (let i = 0; i < choices.length; i++) {\n var typeTag = recipe.getElementsByClassName(`${choices[i]}`);\n if (typeTag.length === 1) {\n recipe[`${filter_type}`] = true;\n }\n if (filter_type === 'diet') {\n if (choices[i] === 'Everything') {\n recipe[`${filter_type}`] = true;\n }\n }\n }\n }\n })\n}", "parseRecipe(recipes) {\n for (let i in recipes) {\n const ing = recipes[i].Ingredient;\n const cat = recipes[i].Category;\n const qty = Math.ceil(recipes[i].Quantity / recipes[i].QtyCraft);\n\n if(cat === 1) {\n this.getRecipe(ing, qty)\n }\n }\n }", "function display_all(recipes) {\n recipes.forEach(recipe => {\n recipe['weather'] = true;\n });\n display_selected_recipes();\n}", "function selectRecipe() {\n var thisRecipeId = $(this).attr('id'); // this gets the #id from the checkbox: e.g.,LarbCheckbox, Chicken_TacosCheckbox\n var thisRecipeClass = thisRecipeId.replace('Checkbox', ''); // this strips out Checkbox: eg, Larb, Chicken_Tacos\n var thisRecipeName = thisRecipeClass.replace(/[_]/g, ' '); // this replaces _ with a space: eg, Larb, Chicken Tacos\n var arrayPosition = recipeListData.map(function(arrayItem) {return arrayItem.name; }).indexOf(thisRecipeName);\n var thisRecipeObject = recipeListData[arrayPosition];\n\n // Add or remove from Grocery List, Menu Plan\n if ($('#' + thisRecipeId).is(':checked')) {\n selectedRecipes.push(thisRecipeName);\n $('#menu-plan').append('<p class=\"' + thisRecipeClass + '\">' + thisRecipeName + '</p>');\n if (!$('#selected-meals').is(':visible')) {\n $('#selected-meals').toggle();\n }\n } else {\n splicer(selectedRecipes, thisRecipeName);\n $('.' + thisRecipeClass).remove();\n }\n}", "function selectRecipe(recipe) {\n vm.selectedRecipe = recipe;\n }", "function getRecipes() { \nrecipes =\n [new recipe(\n 'Pasta Bolognese',\n 20,\n ['tomato sauce', 'pasta', 'minced meat', 'onion', 'red wine', 'salt', 'pepper', 'garlic'],\n [''],\n 'Boil pasta, mix the rest in a pan, add some salt and peppar.'),\n new recipe(\n 'Vegetarian Pie',\n 40,\n ['flour', 'butter', 'salt', 'spinach', 'ricotta', 'egg', 'parmesan', 'pepper'],\n ['Vegetarian'],\n 'Make the pie dough, fill with vegetables, add some salt and pepper'),\n new recipe(\n 'Fish Soup',\n 40,\n ['salmon', 'cod', 'fennel', 'leek', 'saffron', 'curry', 'oatmilk'],\n ['Gluten free'],\n 'Chop fish and vegetables, add some spices and it is done'),\n new recipe(\n 'Poké Bowl',\n 15,\n ['rice', 'tofu', 'edamame', 'red onion', 'radish', 'ginger', 'soya'],\n ['Gluten free', 'Vegetarian'],\n 'Boil rice, chop vegetables, fry tofu and but everything together in a bowl')\n ]\n\nreturn recipes\n\n}", "function fetchRecipes() {\n tool.forEach(data.menu.sections, function(section) {\n section.recipes = tool.map(section.recipes, function(id) {\n return fetchRecipe(id);\n });\n });\n }", "function getSpecificRecipe() {\n let url = \"http://127.0.0.1:3000/specifiedrecipe\";\n xhttp.open(\"GET\", url, true);\n xhttp.send();\n xhttp.onreadystatechange = processRequest;\n\n function processRequest(e) {\n if (xhttp.readyState == 4 && this.status == 200) {\n var response = JSON.parse(xhttp.responseText);\n processRecipe(response);\n } else {\n handleError(xhttp.status);\n }\n\n\n };\n }", "function findRecipe(){\n // load recipes.pl file\n session.consult(\"/recipes.pl\", {\n success:function(){\n // query recipes.pl with list of ingredients\n session.query(\"recipe(\"+ingredientsDetected.sort()+\", X).\", {\n success: function(goal){\n session.answer({\n success: function(answer){\n console.log(session.format_answer(answer));\n // call display recipe with result of query\n displayRecipe(session.format_answer(answer));\n }\n });\n }\n })\n },\n error: function(err){}\n });\n}", "function mealsFilter(recipes) {\n const meals = [];\n for (let i=0; i<recipes.length; i++) {\n let meal = recipes[i].meal_type;\n if (meal){\n meal = meal[0].toUpperCase();\n if (!meals.includes(meal)) {\n meals.push(meal);\n }\n }\n }\n \n const items = [];\n for (const [index, value] of meals.entries()) {\n items.push(<option key={index} value={value}>{value}</option>)\n }\n\n return(\n <>\n <option value='default'>Meal Type</option>\n {items}\n </>\n );\n}", "function selectAllFilteredRecipes() { /*Nota bene: Parameters (ingrFilter, appFilter, ustFilter) deleted since not red */\n\n const INPUT = SEARCH_INPUT.value;\n let result = [];\n\n if (INPUT.length > 2) {\n\n /* Search to find input in title, description or ingredient list of the recipe*/\n\n /************ALGO 1************/\n result = recipes.filter(item =>\n Utils.normString(item.name).includes(Utils.normString(INPUT)) ||\n item.ingredients.map(rMap => Utils.normString(rMap.ingredient)).join(',').includes(Utils.normString(INPUT))|| /*.join to create a string containing all elements ingredients all together so element TRUE when element=\"pate\"+\"brisee\" for ex */\n Utils.normString(item.description).includes(Utils.normString(INPUT)));\n /************ALGO 1************/\n \n }\n else {\n result=[...recipes]; /*to get all the recipes displayed when less than 3 digits */\n }\n\n let filteredRecipes = [];\n\n result.forEach(currentRecipe => {\n const ingrNames = currentRecipe.ingredients.map(rMap => Utils.normString(rMap.ingredient));\n const appNames = Utils.normString(currentRecipe.appliance);\n const ustNames = currentRecipe.ustensils.map(rMap => Utils.normString(rMap));\n\n let nbTagIngr = 0;\n let nbTagApp = 0;\n let nbTagUst = 0;\n\n tabSelectIngr.forEach(ingrTag => {\n if (ingrNames.includes(ingrTag)) {\n nbTagIngr++;\n }\n });\n\n tabSelectApp.forEach(appTag => {\n if (appNames.includes(appTag)) {\n nbTagApp++;\n }\n });\n\n tabSelectUst.forEach(ustTag => {\n if (ustNames.includes(ustTag)) {\n nbTagUst++;\n }\n });\n\n if (nbTagApp === tabSelectApp.length &&\n nbTagIngr === tabSelectIngr.length &&\n nbTagUst === tabSelectUst.length) {\n filteredRecipes.push(currentRecipe);\n }\n });\n return filteredRecipes;\n}", "function recommendClothes(weather) {\n var clothes = [];\n var clearIcons = [\"clear\", \"hazy\", \"mostlysunny\",\n \"partlycloudy\", \"sunny\"];\n var cloudyIcons = [\"cloudy\", \"fog\", \"mostlycloudy\",\n \"partlysunny\", ];\n var rainingIcons = [\"chancerain\", \"chancesleet\", \"chancetstorms\",\n\n \"sleet\", \"rain\", \"tstorms\"];\n var snowingIcons = [\"chanceflurries\", \"chancesnow\", \"flurries\",\n \"snow\" ];\n\n rules.forEach(function(rule) {\n if (parseFloat(rule.minFeel) <= parseFloat(weather.feel) && \n parseFloat(rule.maxFeel) > parseFloat(weather.feel)) {\n if (weather.isDay && rule.day || !weather.isDay && rule.night) {\n if (rule.clear && clearIcons.indexOf(weather.icon) > -1 ||\n rule.cloudy && cloudyIcons.indexOf(weather.icon) > -1 ||\n rule.raining && rainingIcons.indexOf(weather.icon) > -1 ||\n rule.snowing && snowingIcons.indexOf(weather.icon) > -1) {\n clothes.push(rule.name); \n }\n }\n }\n });\n\n return clothes;\n}", "function selectIng(event){\n var selectedIng = $(this)\n .closest(\".ingredient\");\n var ingName = selectedIng.children(\".ingredient-name\")\n .text();\n getRecipes(ingName);\n}", "function findRecipe(recipeId) {\n results = config.results\n recipes = results.recipes.concat(results.ingredients, results.myRecipe)\n\n for (let recipe of recipes) {\n if ('recipe-' + recipe.id === recipeId) {\n return recipe\n }\n }\n\n console.log('ERROR: found unknown recipe with id: ' + recipeId)\n return {}\n}", "createRecipe(recipe) {\n let findLink = this.lodash.find(recipe.links, (link) => {\n return link.rel === 'get recipe script';\n });\n if (findLink) {\n this.updateMachineRecipeLocation(findLink.href);\n }\n }", "function getRecipe(recipe) {\n apiData.forEach(element => {\n if(element.id == recipe){\n eachRecipe(element.name, element.iconUrl);\n eachingredients(element.ingredients);\n eachinstructions(element.instructions);\n $('#input').val(element.nbGuests); \n oldNbGuest = $('#input').val();\n }\n })\n}", "function getRecipes () {\n setRecipes(recipesData)\n }", "function searchRecipes() {\n showAllRecipes();\n let searchedRecipes = domUpdates.recipeData.filter(recipe => {\n return recipe.name.toLowerCase().includes(searchInput.value.toLowerCase());\n });\n filterNonSearched(createRecipeObject(searchedRecipes));\n}", "function loadTag () {\n\n\n const ingredients = recipes.filter (recipe => {\n return tags.ingredients.every (tag => {\n return recipe[\"ingredients\"].some (t => tag.value.toLowerCase() === t.ingredient.toLowerCase())\n })\n })\n\n const ustensils = ingredients.filter (recipe => {\n return tags.ustensils.every (tag => {\n return recipe[\"ustensils\"].some (t => tag.value.toLowerCase() === t.toLowerCase())\n })\n })\n\n const data = ustensils.filter (recipe => {\n return tags.appareils.every (tag => {\n return recipe.appliance.toLowerCase() === tag.value.toLowerCase()\n })\n })\n\n recipes.map (recipe => {\n\n const recipeElement = document.getElementsByClassName(\"recipe-\"+recipe.id)[0]\n\n recipeElement.style.display = \"none\"\n\n })\n\n data.map (recipe => {\n const recipeElement = document.getElementsByClassName(\"recipe-\"+recipe.id)[0]\n\n recipeElement.style.display = \"\"\n })\n\n}", "function getRecipeData(e) {\n var getMealData = JSON.parse(localStorage.getItem(\"meal\"));\n var mealId = e.target.getAttribute(\"data-id\");\n var selected = getMealData.filter((meal) => meal.idMeal === mealId);\n\n if (selected.length > 0) {\n selected = selected[0];\n }\n hideRecipe.classList.remove(\"hidden\");\n foodPoster.src = selected.strMealThumb;\n foodTitle.innerText = selected.strMeal;\n methodText.innerText = selected.strInstructions;\n\n const ingredients = [];\n for (let i = 1; i <= 20; i++) {\n if (selected[`strIngredient${i}`]) {\n ingredients.push(\n `${selected[`strMeasure${i}`]} - ${selected[`strIngredient${i}`]}`\n );\n } else {\n break;\n }\n }\n ingredientEl.innerHTML = `${ingredients\n .map((ingredients) => `<li>${ingredients}</li>`)\n .join(\"\")}`;\n}", "function getRecipeInfo(id) {\n\n var queryURL = \"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/\" + id + \"/information/\";\n\n $.ajax({\n method: \"GET\",\n url: queryURL,\n dataType: \"json\",\n headers: {\n 'X-RapidAPI-Key': foodKey\n // 'Accept: application/json' \n }\n }).done(function (response) {\n console.log(response);\n\n var jQuerySelect = \"#\" + id;\n\n var externalRecipe = $(\"<a>\");\n externalRecipe.attr(\"href\", response.sourceUrl);\n externalRecipe.attr(\"target\", \"_blank\");\n externalRecipe.html(\"<button class=btn orange>Get Recipe</button>\");\n\n var addToFavorites = $(\"<a>\");\n addToFavorites.text(\"Add to Favorites\");\n addToFavorites.addClass(\"add-favorite\");\n addToFavorites.addClass(\"btn orange\");\n addToFavorites.attr(\"id\", id);\n\n $(jQuerySelect).html(response.title);\n $(jQuerySelect).append(\"<br>\");\n $(jQuerySelect).append(externalRecipe);\n $(jQuerySelect).append(addToFavorites);\n\n\n }).fail(function (err) {\n console.log(err)\n });\n\n }", "function extractRelevantMYRecipeData(recipes_Info) {\r\n return recipes_Info.map((recipe_info) => {\r\n const {\r\n id,\r\n title,\r\n readyInMinutes,\r\n aggregateLikes,\r\n Vegetarian,\r\n vegan,\r\n glutenFree,\r\n Image,\r\n } = recipe_info;\r\n\r\n return {\r\n id: id,\r\n title: title,\r\n readyInMinutes: readyInMinutes,\r\n aggregateLikes: aggregateLikes,\r\n vegetarian: Vegetarian,\r\n vegan: vegan,\r\n glutenFree: glutenFree,\r\n image: Image,\r\n };\r\n });\r\n}", "function makeFullRecipe(recipe) {\n const {\n id,\n title,\n readyInMinutes,\n aggregateLikes,\n vegetarian,\n vegan,\n glutenFree,\n image,\n servings,\n } = recipe;\n\n let arrInstruction = [];\n //check if instarction are empty\n if (\n recipe.instructions == \"\" ||\n !recipe.instructions ||\n !recipe.analyzedInstructions ||\n recipe.analyzedInstructions.length == 0\n ) {\n console.log(\"recipe instructions is empty !!!! \");\n } else {\n // add instractions\n let analyzedInstructions = recipe.analyzedInstructions[0].steps;\n\n analyzedInstructions.map((crrStep) => arrInstruction.push(crrStep.step));\n }\n\n let arrIngredients = [];\n if (!recipe.extendedIngredients) {\n console.log(\"recipe extendedIngredients is empty !!!! \");\n } else {\n // add ingredients\n let extendedIngredients = recipe.extendedIngredients;\n\n extendedIngredients.map((ingredient) =>\n arrIngredients.push(ingredient.original)\n );\n }\n\n return {\n // return object\n id: id,\n title: title,\n readyInMinutes: readyInMinutes,\n aggregateLikes: aggregateLikes,\n vegetarian: vegetarian,\n vegan: vegan,\n glutenFree: glutenFree,\n image: image,\n servings: servings,\n instructions: arrInstruction,\n ingredients: arrIngredients,\n };\n}", "function Recipe(name){\r\n this.name = name\r\n this.type = \"Recipe\"\r\n }", "function cuisinesFilter(recipes) {\n const cuisines = [];\n for (let i=0; i<recipes.length; i++) {\n let cuisine = recipes[i].cuisine_type;\n if (cuisine){\n cuisine = cuisine[0].toUpperCase();\n if (!cuisines.includes(cuisine)) {\n cuisines.push(cuisine);\n }\n }\n }\n \n const items = [];\n for (const [index, value] of cuisines.entries()) {\n items.push(<option key={index} value={value}>{value}</option>)\n }\n\n return(\n <>\n <option value='default'>Cuisine Type</option>\n {items}\n </>\n );\n}", "function getFoodCategory(category){\n $.ajax({\n url: \"./Content/getRandomRecipe.php\",\n dataType: \"json\",\n type: \"GET\",\n data: {category: category},\n success: function(data) {\n recipeData = data;\n foodCategory = category;\n var content = \"\";\n for (var y = 0; y < data.root.body.recipes.length; y++){\n if(y%2 == 0){\n content += \"<div class=\\\"row hidden-xs hidden-sm\\\"><div class=\\\"col-6\\\"><div id=\\\"breakfast\\\" class=\\\"container-fluid \\\">\"; \n content += \"<a onclick=\\\"getRecipeStep(\" + data.root.body.recipes[y].id + \")\\\"><img class=\\\"img-responsive border-outset\\\" src=\\\"\" + data.root.body.recipes[y].image + \"\\\"/>\";\n content += \"<div id=\\\"breakfastText\\\" class=\\\"container-fluid\\\"><h2>\" + data.root.body.recipes[y].title + \"</h2>\";\n content += \"</div>\";\n content += \"</a></div></div>\";\n } else {\n content += \"<div class=\\\"col-6\\\"><div id=\\\"breakfast\\\" class=\\\"container-fluid\\\">\"; \n content += \"<a onclick=\\\"getRecipeStep(\" + data.root.body.recipes[y].id + \")\\\"><img class=\\\"img-responsive border-outset\\\" src=\\\"\" + data.root.body.recipes[y].image + \"\\\"/>\";\n content += \"<div id=\\\"breakfastText\\\" class=\\\"container-fluid\\\"><h2>\" + data.root.body.recipes[y].title + \"</h2>\";\n content += \"</div>\";\n content += \"</a></div></div></div>\";\n }\n if(y == (data.root.body.recipes.length - 1)){\n if(y%2 ==0){\n content += \"</div>\";\n }\n }\n \n }\n for (var i=0; i < data.root.body.recipes.length; i++){\n content += \"<div id=\\\"favourite\\\" class=\\\"container-fluid hidden-md hidden-lg\\\">\"; \n content += \"<a onclick=\\\"getRecipeStep(\" + data.root.body.recipes[i].id + \")\\\"><img class=\\\"img-responsive border-outset-mini\\\" src=\\\"\" + data.root.body.recipes[i].image + \"\\\"/>\";\n content += \"<div id=\\\"breakfastText\\\" class=\\\"container-fluid\\\"><h3>\" + data.root.body.recipes[i].title + \"</h3>\";\n content += \"</div></a></div>\";\n }\n if(category === undefined){\n content += \"<button href=\\\"?Recipe.html\\\" class=\\\"btn-custom\\\" onclick='getFoodCategory(); return false;'>Show More</button>\";\n } else {\n content += \"<button href=\\\"?Recipe.html\\\" class=\\\"btn-custom\\\" onclick='getFoodCategory(\\\"\" + category + \"\\\"); return false;'>Show More</button>\";\n }\n $(\"#contentArea\").html(content);\n createView(\"Recipe.html&\" + recipeData.root.body.recipes[0].id + \"&\" + recipeData.root.body.recipes[1].id + \"&\" + recipeData.root.body.recipes[2].id + \"&\" + recipeData.root.body.recipes[3].id + \"&\" + recipeData.root.body.recipes[4].id, true);\n\n },\n error: function(jqXHR, textStatus, errorThrown) {\n $(\"#p1\").text(textStatus + \" \" + errorThrown\n + jqXHR.responseText);\n } \n\t});\n}", "function getSpoon(food) {\n let url = `https://api.spoonacular.com/recipes/random?apiKey=d327b936f3224bd19f8fd19203cfbb64&number=3&tags=${food}`\n fetch(url)\n .then(response => {\n return response.json()\n }).then(res => {\n console.log(\"getSpoon\" + food)\n displayRecipes(res)\n })\n}", "function extractRelevantRecipeData(recipes_Info) {\r\n return recipes_Info.map((recipe_info) => {\r\n const {\r\n id,\r\n title,\r\n readyInMinutes,\r\n aggregateLikes,\r\n vegetarian,\r\n vegan,\r\n glutenFree,\r\n image,\r\n } = recipe_info.data;\r\n\r\n return {\r\n id: id,\r\n title: title,\r\n readyInMinutes: readyInMinutes,\r\n aggregateLikes: aggregateLikes,\r\n vegetarian: vegetarian,\r\n vegan: vegan,\r\n glutenFree: glutenFree,\r\n image: image,\r\n };\r\n });\r\n}", "function expandRecipes (dataset) {\n return map(dataset, (item, name) => {\n const recipe = reduce(item.obtaining, (acc, method) => {\n if (method.hasOwnProperty('recipe')) acc = map(method.recipe, expandRecipeItem)\n return acc\n }, {})\n item.recipe = recipe\n return item\n })\n}", "function updateRecipe(recipe,guest) {\n apiData.forEach(element => {\n // eachRecipe(element.name, element.iconUrl);\n if(element.id == recipe){\n eachRecipe(element.name, element.iconUrl);\n updateEachIngredients(element.ingredients,guest);\n eachinstructions(element.instructions);\n $('#input').val(guest); \n }\n })\n}", "function OpenRecipe(id) {\r\n $.ajax({\r\n url: \"https://www.themealdb.com/api/json/v1/1/lookup.php\",\r\n type: \"get\",\r\n dataType: \"json\",\r\n data: {\r\n i: id,\r\n },\r\n success: function (result) {\r\n let meal = result.meals[0];\r\n function Ingredient() {\r\n let ingredients = [meal.strIngredient1, meal.strIngredient2, meal.strIngredient3, meal.strIngredient4, meal.strIngredient5, meal.strIngredient6, meal.strIngredient7, meal.strIngredient8, meal.strIngredient9, meal.strIngredient10, meal.strIngredient11, meal.strIngredient12, meal.strIngredient13, meal.strIngredient14, meal.strIngredient15, meal.strIngredient16, meal.strIngredient17, meal.strIngredient18, meal.strIngredient19, meal.strIngredient20];\r\n let measures = [meal.strMeasure1, meal.strMeasure2, meal.strMeasure3, meal.strMeasure4, meal.strMeasure5, meal.strMeasure6, meal.strMeasure7, meal.strMeasure8, meal.strMeasure9, meal.strMeasure10, meal.strMeasure11, meal.strMeasure12, meal.strMeasure13, meal.strMeasure14, meal.strMeasure15, meal.strMeasure16, meal.strMeasure17, meal.strMeasure18, meal.strMeasure19, meal.strMeasure20]\r\n $.each(ingredients, function (i, data) {\r\n $(\"#ingredient\").append(`\r\n <li class=\"list-group-item\">${measures[i]} ${ingredients[i]}</li>\r\n `)\r\n return (data !== \"\")\r\n })\r\n }\r\n $(\"#title\").html(`${meal.strMeal} Recipe`)\r\n $(\"#recipe\").html(`\r\n <div class=\"row mt-3\">\r\n <div class=\"col-md-4\">\r\n <img src=\"${meal.strMealThumb}\" class=\"img-thumbnail\">\r\n </div>\r\n <div class=\"col-md-8\">\r\n <h4>Ingredients</h4>\r\n <ul class=\"list-group list-group-flush\" id=\"ingredient\">\r\n </ul>\r\n </div>\r\n </div>\r\n <div class=\"row mt-3\">\r\n <div class=\"col-md-8\">\r\n <h4>Instruction</h4>\r\n <ul class=\"list-group\">\r\n <li class=\"list-group-item\">${meal.strInstructions}</li>\r\n </ul>\r\n </div>\r\n <div class=\"col-md-4\">\r\n <h4>Instruction with Video</h4>\r\n <div class=\"embed-responsive embed-responsive-1by1\">\r\n <iframe class=\"embed-responsive-item\" src=\"${meal.strYoutube.replace(\"watch?v=\", \"embed/\")}\"></iframe>\r\n </div>\r\n </div>\r\n </div>\r\n `)\r\n Ingredient()\r\n },\r\n });\r\n}", "function dispalySelectedRecipe(clicked) {\n var request_recipie = document.getElementById(clicked),\n create_innerHTML = \"<br />\",\n r_list = globe.getRecipes(),\n lines,\n plural,\n i;\n\n if (globe.getID(0)) {\n removeLink();\n }\n\n globe.user_search.value = \"\";\n globe.hint_span.innerHTML = \"\";\n globe.results_div.innerHTML = \"\";\n create_innerHTML += \"\" + r_list[clicked].toMake + \" Recipe<br /><table>\";\n create_innerHTML += \"<tr><th>ingredients</th><th>Amount</th><th>Mesure</th></tr>\"\n for (i = 0; i < r_list[clicked].ingredients.length; i += 1) {\n \n if (i % 2 === 0) {\n lines = \"even\";\n } else {\n lines = \"odd\"\n }\n \n if (r_list[clicked].ingredients[i].amount > 1) {\n plural = \"s\";\n } else {\n plural = \"\";\n }\n\n create_innerHTML += \"<tr>\"\n create_innerHTML += \"<td class=\\\"ingredients \" + lines + \"\\\">\" + r_list[clicked].ingredients[i].ingredient + \"</td>\";\n create_innerHTML += \"<td class=\\\"amount \" + lines + \"\\\">\" + r_list[clicked].ingredients[i].amount + \"</td>\";\n create_innerHTML += \"<td class=\\\"mesure \" + lines + \"\\\">\" + r_list[clicked].ingredients[i].mesure + plural + \"</td>\";\n create_innerHTML += \"</tr>\"\n }\n create_innerHTML += \"</table>\"\n \n globe.display_recipe.innerHTML = create_innerHTML;\n}", "function CreateRandomRecipe(weights) {\n if (weights.length != 5) { console.log(\"Bad weights provided: \", weights); };\n if (is_all_zeros(weights)) return []; /* Finished */\n var candidates = INGREDIENTS.filter(function(ingredient) {\n for (var j = 0; j < weights.length; j++) {\n if (weights[j] == 0 && ingredient[1][j] > 0) return false;\n }\n return true;\n })\n if (candidates.length == 0) return undefined; /* Won't work */\n shuffle(candidates);\n for (var i = 0; i < candidates.length; i++) {\n var name = candidates[i][0];\n var ingredient_weights = candidates[i][1];\n /* Figure out the maximum amount we can add without going over any weight */\n var amount = 1000;\n for (var j = 0; j < weights.length; j++) {\n if (ingredient_weights[j] == 0) continue;\n var amount_j = weights[j] / ingredient_weights[j];\n if (amount_j < amount) amount = amount_j;\n }\n /* Calculate the new weights = weights - amount * ingredient_weights */\n var new_weights = new Array(weights.length);\n for (var j = 0; j < weights.length; j++) {\n new_weights[j] = weights[j] - amount * ingredient_weights[j];\n }\n /* Recursively find ingredients to fill the remaining weights */\n var remaining_ingredients = CreateRandomRecipe(new_weights);\n if (remaining_ingredients == undefined) {\n continue; // This ingredient won't work.\n }\n // We found a recipe!\n var ingredient = {'name': name};\n if (name.indexOf('itters') != -1) {\n ingredient.drops = amount;\n } else {\n ingredient.parts = amount;\n }\n console.log(\"Found \", ingredient, remaining_ingredients, \" for \", weights);\n return [ingredient].concat(remaining_ingredients);\n }\n return undefined; /* We failed to find ingredients to satisfy weights */\n}", "function getRecipe(tag) {\n var queryURL =\n \"https://api.spoonacular.com/recipes/search?query=\" +\n tag +\n \"&number1&apiKey=c30cd056ba1c4e459950da3b71b83d82\";\n\n //ajax call for recipe\n $.ajax({\n url: queryURL,\n method: \"GET\",\n }).then(function (response) {\n\n // generates a number between 1 and 10\n var random = Math.floor(Math.random() * 9) + 1;\n\n // create a url link to the address in the returned object\n var recipeLink = $(\"<a>\").attr(\"href\", response.results[random].sourceUrl);\n recipeLink.text(response.results[random].title);\n\n // empty the #recipe div and append the new link to it\n $(\"#recipe\").append(recipeLink);\n $(\"#recipe\").append(\"<br>\");\n\n var currentRecipe = response.results[random].id;\n\n var recipePicture = `https://spoonacular.com/recipeImages/${currentRecipe}-556x370.jpg`;\n\n $(\"#recipe\").append($(\"<img>\").attr(\"src\", recipePicture));\n\n // create a function to get the ingredients, with a second ajax call\n function getIngredients() {\n //create a variable for our ingredientQuery url\n var ingredientQuery = `https://api.spoonacular.com/recipes/${currentRecipe}/ingredientWidget.json?apiKey=c30cd056ba1c4e459950da3b71b83d82`;\n\n //second ajax function for ingredients:\n $.ajax({\n url: ingredientQuery,\n method: \"GET\",\n }).then(function (response) {\n\n // make an li to append each ingredient and its amount and image\n response.ingredients.forEach((element) => {\n var li = $(\"<li>\").append(\n $(\"<span>\").text(\n element.name +\n \":\" +\n \" \" +\n element.amount.us.value +\n \" \" +\n element.amount.us.unit\n ),\n\n $(\"<img>\").attr(\n \"src\",\n `https://spoonacular.com/cdn/ingredients_100x100/${element.image}`\n )\n );\n $(\"#recipe\").append(li);\n });\n });\n } //closing bracket for getIngredients function\n\n //invoke getIngredients function as a step in the getRecipe function\n getIngredients();\n }); //closing bracket for getRecipe function's ajax call\n}", "function getRecipeData(id, type) {\n var queryUrl;\n switch (type) {\n case \"recipe\":\n queryUrl = \"/api/recipes/\" + id;\n break;\n case \"author\":\n queryUrl = \"/api/authors/\" + id;\n break;\n default:\n return;\n }\n $.get(queryUrl, function(data) {\n if (data) {\n console.log(data.AuthorId || data.id);\n // If this recipe exists, prefill our add-recipe forms with its data\n titleInput.val(data.title);\n ingredientsInput.val(data.ingredients);\n preparationInput.val(data.preparation);\n image_linkInput.val(data.image_link); \n servingsInput.val(data.servings); \n authorId = data.AuthorId || data.id;\n // If we have a recipe with this id, set a flag for us to know to update the recipe\n // when we hit submit\n updating = true;\n }\n });\n }", "function selectCuisine(){\n //console.log($('select[name=\"cuisine\"]').val());\n if ($('select[name=\"cuisine\"]').val() === \"select\"){\n populateTable();\n } else {\n var tableContent = '';\n // jquery AJAX call for JSON\n $.getJSON('/recipes/recipelist', function (data){\n // adds all recipe info from database to the global variable\n recipeListData = data;\n\n // for each item in our JSON, add a table row and cells to the content string\n $.each(data, function(){\n if (this.cuisine === $('select[name=\"cuisine\"]').val()){\n tableContent += '<tr>';\n if (selectedRecipes.indexOf(this.name) === -1) {\n tableContent += '<td><input type=\"checkbox\" id=\"' + this.name.replace(/\\s+/g, '_') + 'Checkbox\" class=\"recipeCheckbox\"></td>';\n } else {\n tableContent += '<td><input type=\"checkbox\" id=\"' + this.name.replace(/\\s+/g, '_') + 'Checkbox\" class=\"recipeCheckbox\" checked></td>';\n }\n tableContent += '<td><a href=\"#\" class=\"linkshowuser\" rel=\"' + this.name + '\">' + this.name + '</a></td>';\n tableContent += '<td>' + this.cuisine + '</td>';\n tableContent += '</tr>';\n }\n });\n\n // inject the whole content string into our existing HTML table\n $('#recipeList table tbody').html(tableContent);\n });\n }\n}", "function updateUserRecipeSelection() {\n dispatch({\n type: \"updateRecipe\",\n selectionId: Math.floor(Math.random() * 100000).toString(),\n recipeId: recipe._id,\n recipeName: recipe.name,\n recipeType: recipe.type,\n recipeImage: recipe.image,\n recipeImageMobile: recipe.imageMobile,\n recipeThumb: recipe.thumb,\n recipeWine: recipe.wine,\n recipeSubWine: recipe.subwine,\n recipeIngredients: recipe.ingredients,\n recipeDirections: recipe.directions,\n });\n console.log(\"Selected: \", state.recipeName);\n }", "function getRecipesbyIngredients(ingredients) {\n // console.log(ingredients);\n\n var queryURL = \"https://api.spoonacular.com/recipes/findByIngredients?ingredients=\" +\n ingredients + \"&number=6&apiKey=3d8504ff72124b3790e1881e4619a59c\";\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n console.log(response);\n var recipeId = response[0].id;\n console.log(recipeId);\n console.log(response[0].image);\n\n for (i = 0; i < response.length; i++) {\n $(\"#tile\" + i).text(response[i].title);\n $(\"#img\" + i).attr(\"src\", response[i].image);\n $(\"#result\"+ i).attr(\"data-recipeid\",response[i].id);\n } // End of for loop\n\n }); // End of AJAX ingredients query\n\n}", "function getNewRecipe(recipes, recipeIndex) {\n if (recipeIndex === recipes.length) {\n recipeIndex = 0;\n };\n return recipes[recipeIndex];\n}", "function getRecipe(q){\n\tconsole.log(q);\n\t$.ajax({\n\t\t//Edit endpoint below to modify call\n\t\turl:\"https://api.spoonacular.com/recipes/complexSearch?apiKey=99a01e3d7525405894929bfbec77ffa3&addRecipeInformation=true&addRecipeNutrition=true&number=10&query=\"+q,\n\t\tsuccess: function(res) {\n\t\t\tresponse = res;\n\t\t\t//console.log(res.results);\n\t\t\trankResults(res);\n\t\t\t//document.getElementById(\"output\").innerHTML=\"<h1>\"+res.results[0].title+\"</h1><br><img src='\"+res.results[0].image+\"' width='400' /><br>Ready in \"+res.results[0].readyInMinutes+\" minutes\"\n\t\t\t//getSource(res.results[0].id);\n\t\t}\n\t});\n}", "getRecipeInfo(id){\n return http.get(`https://api.spoonacular.com/recipes/${id}/information?includeNutrition=false&apiKey=7673afa2c5ea4fe48c062eacd523f588`);\n }", "function decideKind(tegel){\n let randomNumber = randomiser();\n switch (randomNumber) {\n case 1:\n setModel(tegel, \"#tegel6\");\n break;\n case 2:\n setModel(tegel, \"#tegel3\");\n break;\n case 3:\n setModel(tegel, \"#tegel4\");\n break;\n case 4:\n setModel(tegel, \"#tegel8\");\n break;\n case 5:\n setModel(tegel, \"#tegel5\");\n break;\n case 6:\n setModel(tegel, \"#tegel2\");\n break;\n case 7:\n setModel(tegel, \"#tegel7\");\n break;\n case 8:\n setModel(tegel, \"#tegel1\");\n break;\n case 9:\n setModel(tegel, \"#tegel9\");\n break;\n case 0:\n setModel(tegel, \"#tegel0\");\n break;\n default:\n }\n }", "function getEntrees() {\n fetch(\n `https://api.spoonacular.com/recipes/complexSearch?includeIngredients=${ingredientString}&apiKey=${apiKey}`\n )\n .then((blob) => {\n return blob.json();\n })\n .then((response) => {\n console.log(response);\n if (response.results.length === 0) {\n $(\"#dynamic-ingredient-list\").empty();\n let sadClown = $(\"<img src='./assets/images/sadclown.jpg'>\");\n $(\"#dynamic-ingredient-list\").append(sadClown);\n } else {\n // making variable for recipe array\n var recipes = response.results;\n\n //emptying containers that hold things\n ulElement.empty();\n $(\"#dynamic-recipe-container\").empty();\n\n //looping through recipe titles\n for (let i = 0; i < recipes.length; i++) {\n //create li\n var liElement = $(`<li>${recipes[i].title}</li>`);\n //create class for hand pointer\n liElement.attr(\"class\", \"clickable\");\n //append li to ul\n ulElement.append(liElement);\n //add even listeners to ul and lis\n }\n ulElement.on(\"click\", liElement, function (e) {\n fetch(\n `https://api.spoonacular.com/recipes/complexSearch?query=${e.target.textContent}&apiKey=${apiKey}`\n )\n .then((blob) => {\n return blob.json();\n })\n .then((response) => {\n var chosenRecipeId = response.results[0].id;\n\n fetch(\n `https://api.spoonacular.com/recipes/${chosenRecipeId}/information/?apiKey=${apiKey}`\n )\n .then((blob) => {\n return blob.json();\n })\n .then((response) => {\n ulElement.empty();\n wineIngredients = response.extendedIngredients;\n for (let i = 0; i < wineIngredients.length; i++) {\n // this puts the name of the aisle from each ingredient object into an array that we will use to determine wine \\\n aisleIngredients[i] = wineIngredients[i].aisle;\n\n let liElement = $(`<li>${wineIngredients[i].name}</li>`);\n //turning off event listener\n ulElement.off();\n\n ulElement.append(liElement);\n }\n\n // puts the recipe's wine pairing text into var winePairText to check for \"undefined\"\n if (typeof response.pairingText != \"undefined\") {\n winePair.innerHTML = response.pairingText;\n } else {\n checkCuisine(response);\n }\n\n let h3Element = $(`<h3>${response.title}</h3>`);\n let pElement = $(`<p>${response.instructions}</p>`);\n\n $(\"#dynamic-recipe-container\").append(h3Element, pElement);\n });\n });\n });\n }\n });\n}", "async Cusisinetype(value){\n var tmp = [];\n var i;\n \n for (i in this.state.recipe){\n await axios.get(`http://localhost:5000/api/recipe/findrecipe/${this.state.recipe[i].id}`)\n .then(response => {\n \n if(response.data && response.data.cuisines.includes(value)){\n var recipe_info = {...this.state.recipe[i], ...response.data}; \n tmp.push(recipe_info);\n \n }\n \n\n }).catch(error => {\n \n return console.log(error);\n });\n };\n this.setState({\n selectedrecipe: tmp\n }\n\n );\n return console.log(tmp);\n }", "async MealType(value){\n var tmp = [];\n var i;\n \n for (i in this.state.recipe){\n await axios.get(`http://localhost:5000/api/recipe/findrecipe/${this.state.recipe[i].id}`)\n .then(response => {\n \n if(response.data && response.data.dishTypes.includes(value)){\n var recipe_info = {...this.state.recipe[i], ...response.data}; \n tmp.push(recipe_info);\n \n }\n \n\n }).catch(error => {\n \n return console.log(error);\n });\n };\n this.setState({\n selectedrecipe: tmp\n }\n\n );\n return console.log(tmp);\n }", "function onIngredientSelect(event) {\n if (event.target.className === 'buttonOff') {\n event.target.className = 'buttonOn';\n selectedIngredients[event.target.value] = 1;\n changeIngredientsOnHand(event.target.value, 1);\n } else {\n event.target.className = 'buttonOff';\n selectedIngredients[event.target.value] = 0;\n changeIngredientsOnHand(event.target.value, -1);\n }\n renderRecipes();\n saveToLocalStorage();\n}", "async function showRecipes(recipes) {\n\n for (let rec of recipes) {\n await generateRecipeHTML(rec);\n }\n currentMealList = recipes;\n }", "getRecipesByRestriction(userDietaryRestrictions){\n if (userDietaryRestrictions.length === 0) {\n return this.recipes;\n }\n let acceptableRecipes = [];\n this.recipes.forEach(function(recipe) {\n if (this.isAcceptableRecipe(recipe, userDietaryRestrictions)) {\n acceptableRecipes.push(recipe);\n }\n }, this); //Passes in parent object Cookbook into for each loop\n return acceptableRecipes;\n }", "function getRecipeInstructions(recipeId, image_src, recipeName) {\n\n var queryURL = \"https://api.spoonacular.com/recipes/\" + recipeId + \"/analyzedInstructions?apiKey=3d8504ff72124b3790e1881e4619a59c\";\n // console.log(recipeId);\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n console.log(response);\n // console.log(response[0].steps[0].number);\n // console.log(response[0].steps[0].step);\n console.log(response[0].steps[0].ingredients);\n\n var currentIngredients = response[0].steps[0].ingredients;\n $(\".recipe-ingredients\").html(\"\");\n for (var i=0; i<currentIngredients.length; i++) {\n $(\".recipe-ingredients\").append(\"<li>\" + currentIngredients[i].name + \"</li>\");\n $(\".recipe-ingredients\").val().toUpperCase();\n }\n\n // Add cooking instructions to the recipe modal.\n var stepsInstructions = response[0].steps;\n $(\".recipe-step\").html(\"\");\n for (j=0; j<stepsInstructions.length; j++) {\n $(\".recipe-step\").append(\"<p>\" +\n stepsInstructions[j].number + \". \" +\n stepsInstructions[j].step + \"</p>\");\n } // End of AJAX call for recipeId\n\n });\n}", "function searchRecipe(searchCriterias) {\n let ingredients = searchCriterias.ingredients.toString();\n let cuisines = searchCriterias.cuisines.toString();\n let diet = searchCriterias.diet.toString();\n let allergies = searchCriterias.allergies.toString();\n\n fetch(url + \"recipes/complexSearch?apiKey=\" + apikey + \"&cuisine=\" + cuisines + \"&diet=\" + diet + \"&intolerances=\" + allergies + \"&includeIngreients=\" + ingredients + \"&includeIngreients=10&sort=popularity&sortDirection=asc&minFat=0&minProtein=0&minCalories=0&instructionsRequired=true\")\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n console.log(data);\n $(data.results).each(function (index) {\n let recipe = {\n id: \"\",\n title: \"\",\n image: \"\",\n fat: \"\",\n protein: \"\",\n calories: \"\"\n };\n recipe.id = data.results[index].id;\n recipe.title = data.results[index].title;\n recipe.image = data.results[index].image;\n recipe.calories = data.results[index].nutrition.nutrients[0].amount +\n data.results[index].nutrition.nutrients[0].unit;\n recipe.protein = data.results[index].nutrition.nutrients[1].amount +\n data.results[index].nutrition.nutrients[1].unit;\n recipe.fat = data.results[index].nutrition.nutrients[2].amount +\n data.results[index].nutrition.nutrients[2].unit;\n localSearchedRecipes.push(recipe);\n });\n localStorage.setItem(\"searchedRecipies\", JSON.stringify(localSearchedRecipes));\n window.location = './recipe_list.html';\n })\n}", "function searchRecipes(diet, includeIngredients, intolerances) {\n const numberOfRecipes = 30;\n const dietRestriction = (diet.toLowerCase() === 'regular diet') ? '' : diet;\n let queryURL = `https://api.spoonacular.com/recipes/complexSearch?diet=${dietRestriction}&intolerances=${intolerances}&includeIngredients=${includeIngredients}&number=${numberOfRecipes}&addRecipeInformation=true&apiKey=${apiKey}`;\n\n return $.ajax({\n url: queryURL,\n method: \"GET\",\n dataType: \"json\"\n });\n }", "function getMeSomeRecipes(findings) {\n for (let i = 0; i < 10; i++) {\n // Recipe Image\n let imgUrl = findings.hits[i].recipe.image;\n let img = document.createElement(\"img\");\n img.setAttribute(\"src\", imgUrl);\n //Recipe Label\n let labelName = findings.hits[i].recipe.label;\n let label = document.createElement(\"a\");\n let labelhref = findings.hits[i].recipe.url;\n label.setAttribute(\"href\", labelhref);\n label.innerText = labelName;\n //Recipe Calories\n let caloriesNumber = findings.hits[i].recipe.calories;\n let calories = document.createElement(\"p\");\n calories.innerText = `Only ${Math.round(caloriesNumber)} calories!`;\n\n //Recipe Div\n let recipediv = document.createElement(\"div\");\n // recipediv.appendChild(img);\n // recipediv.appendChild(label);\n // recipediv.appendChild(calories);\n recipediv.append(img, label, calories);\n\n //last one below\n endPoint.appendChild(recipediv);\n recipediv.setAttribute(\"class\", \"plate\");\n }\n}", "fetchRecipes() {\n const getApi = this.environmentapiUrl + '/getRecipes';\n return this.http.get(getApi);\n }", "function getRandomRecipe() {\n fetch(apiUrls.randomMeal)\n .then( httpErrorHandleresponse )\n .then( ({meals}) => {\n createOrUpdateHtmlReccomendation(meals[0],false);\n })\n .catch( alert );\n}", "function pickFood() {\r\n\r\n\t\tdocument.getElementById(\"searchFood\").value = \"\";\r\n\t\tlet food = document.getElementById(this.id).innerHTML;\r\n\t\tlet foodName = \"\";\r\n\t\tlet foodSplit = food.split(/[ \\t\\n]+/);\r\n\r\n\t\tfor(let i = 0; i < foodSplit.length; i++) {\r\n\t\t\tfoodName += foodSplit[i];\r\n\t\t\tif(i + 1 < foodSplit.length) {\r\n\t\t\t\tfoodName += \"+\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlet url = \"https://www.themealdb.com/api/json/v1/1/search.php?s=\"+foodName;\r\n\t\tfetch(url)\r\n\t\t\t.then(checkStatus)\r\n\t\t\t.then(function(responseText) {\r\n\t\t\t\tlet json = JSON.parse(responseText);\r\n\t\t\t\tclear();\r\n\t\t\t\taddTop(json);\r\n\t\t\t\taddIngredients(json);\r\n\t\t\t\taddDirections(json);\r\n\t\t\t\textras(json);\r\n\t\t\t\tdocument.getElementById(\"image\").style.visibility = \"visible\";\r\n\t\t\t})\r\n\t\t\t.catch(function(error) {\r\n\t\t\t\tconsole.log(error);\r\n\t\t\t\tlet error1 = document.getElementById(\"error\");\r\n\t\t\t\terror1.innerHTML = \"Sorry a problem occurred with API, try another name\";\r\n\t\t\t});\r\n\t}", "render() {\n //Line below to be implemented when I can figure out proper query for the back end. \n const { searchTerm, filterOptions, filterOptionsCuisine } = this.props;\n // const { searchTerm } = this.props;\n if (searchTerm === \" \") {\n return 'No matching results'\n }\n const recipeList = this.props.recipes\n\n \n //Filters below to be implemented when I can figure out proper query for the back end. \n \n .filter(recipe => (recipe.meal_type === filterOptions || filterOptions === 'All'))\n .filter(recipe => (recipe.cuisine_type === filterOptionsCuisine || filterOptionsCuisine === 'All'))\n .filter(recipe => {\n return recipe.ingredients.some(ingredient => \n ingredient.toLowerCase().includes(searchTerm.toLowerCase()))\n })\n .map((recipe, key) => <RecipeDetail recipe={recipe} key={key} />);\n \n console.log(filterOptions);\n console.log(filterOptionsCuisine);\n return (\n <div className=\"FilterableList\">\n {recipeList}\n\n </div>\n );\n }", "function getRecipes() {\n return db.select('*').from('recipes');\n}", "function generateRecipe() {\n // Potion Name\n const randPotionDescriptor = getRandomElement(potionDescriptors);\n const randPotionType = getRandomElement(potionTypes);\n\n // Potion Ingredients\n const randLiquid = getRandomElement(ingredients.liquids);\n const randPrimary = getRandomElement(ingredients.primaries);\n const randSecondary = getRandomElement(ingredients.secondaries);\n const randSpice = getRandomElement(ingredients.spices);\n const randGarnish = getRandomElement(ingredients.garnishes);\n\n // Ingredient Amounts\n const randLiquidAmount = getRandomElement(ingredients.liquidAmounts);\n const randPrimaryAmount = getRandomElement(ingredients.primaryAmounts);\n const randSecondaryAmount = getRandomElement(ingredients.secondaryAmounts);\n const randSpiceAmount = getRandomElement(ingredients.spiceAmounts);\n const randGarnishAmount = getRandomElement(ingredients.garnishAmounts);\n\n // Print Recipe\n console.log(\n`HOW TO BREW: ${randPotionDescriptor} ${randPotionType}\n\nINGREDIENTS\n${randLiquidAmount} of ${randLiquid}\n${randPrimaryAmount} ${randPrimary}\n${randSecondaryAmount} ${randSecondary}\n${randSpiceAmount} of ${randSpice}\n${randGarnishAmount} ${randGarnish}\n\n1. ${ingredients.prepLiquid(randLiquid)}\n2. ${ingredients.prepPrimary(randPrimary)}\n3. ${ingredients.prepSecondary(randSecondary)}\n4. ${ingredients.prepSpice(randSpice)}\n5. ${ingredients.prepGarnish(randGarnish)}\n\nEnjoy!`);\n}", "function displayIngredientSearch(clicked) {\n var clicked_recipe = document.getElementById(clicked).innerHTML,\n results_string = \"\",\n r_list = globe.getRecipes(),\n i,\n j;\n\n globe.hint_span.innerHTML = \" Recipes containing \" + clicked_recipe;\n globe.user_search.value = \"\";\n removeLink();\n \n for (i = 0; i < r_list.length; i += 1) {\n for (j = 0; j < r_list[i].ingredients.length; j += 1) {\n if (r_list[i].ingredients[j].ingredient === clicked_recipe) {\n\n results_string += \"<p id=\\\"\" + i.toString() + \"\\\">\" + r_list[i].toMake + \"</p>\";\n globe.addID(i.toString());\n break;\n }\n }\n }\n\n globe.results_div.innerHTML = results_string;\n globe.search_type_name.checked = true;\n globe.search_type_ingredient.checked = false;\n createLink();\n}", "function constructRecipeDataSource(selectedSauce, recipe) {\n return {\n \"sauceBossData\": {\n \"type\": \"object\",\n \"properties\": {\n \"selectedSauceSsml\": \"<speak>\" + recipe + \"</speak>\",\n \"selectedSauce\": selectedSauce,\n \"selectSauceCaps\": selectedSauce.toUpperCase(),\n \"selectedSauceImg\": getRecipeImage(selectedSauce),\n \"hintString\": \"How do I make \" + selectedSauce + \" sauce?\"\n },\n \"transformers\": [{\n \"inputPath\": \"selectedSauceSsml\",\n \"outputName\": \"selectedSauceSpeech\",\n \"transformer\": \"ssmlToSpeech\"\n },\n {\n \"inputPath\": \"selectedSauceSsml\",\n \"outputName\": \"selectedSauceText\",\n \"transformer\": \"ssmlToText\"\n },\n {\n \"inputPath\": \"hintString\",\n \"transformer\": \"textToHint\"\n }\n ]\n }\n }\n}", "function lootSelect (loot, Character){\n\nvar items = loot[1];\nvar itemsRare = loot[2];\n\n\tCharacter.goldAdd(loot[0]);\n\n\twhile (items > 0, items --){\n\t\t// define itemSelector -- somehting to randomly select items from a matrix and return them by name\n\t\tCharacter.inventoryAdd(itemSelector(items));\n\t}\n\n\twhile (itemsRare > 0, itemsRare --){\n\t\t// define itemSelector -- somehting to randomly select items from a matrix and return them by name\n\t\tCharacter.inventoryAdd(itemSelector(itemsRare));\n\t}\n}", "categoryFilter(recipe) {\n return recipe.category === this.state.category;\n }", "selectRecipe(e) {\n e.preventDefault();\n console.log('recipe ' + e.target.dataset.index + ' selected!');\n this.props.selectRecipe(e.target.dataset.index);\n }", "randomIngredient(type) {\n const ingredients = this.ingredients[type];\n return ingredients[Math.floor(Math.random() * (ingredients.length))];\n }", "function getRecipes() {\n // build new parent elements\n var newDialog = $(\"<dialog>\", {\n id: \"recipeList\"\n });\n var newDiv = $(\"<div>\", {\n class: \"queryResult\"\n });\n\n // build query\n var query =\n sQueryStr +\n \"search?intolerances=gluten&number=\" +\n $(\"#returnsSelect\")\n .find(\":selected\")\n .text() +\n \"&cuisine=\" +\n sQueryObject.queryCuisine +\n \"&type=\" +\n sQueryObject.queryCourse +\n \"&instructionsRequired=true&query=\" +\n sQueryObject.queryIngredients;\n sSettings.url = query;\n //console.log(query);\n $.ajax(sSettings).done(function(response) {\n if (response.results.totalResults == 0) {\n console.log(\"No recipes found. Please search again.\");\n newDiv.text(\n \"Sorry! I couldn't find a gluten free recipe that matched the search terms.\"\n );\n } else {\n // iterate through results and add recipes to list element inside of modal\n var newList = $(\"<ul>\");\n for (var i = 0; i < response.results.length; i++) {\n var newListItem = $(\"<li>\", {\n id: response.results[i].id,\n class: \"listItem\"\n });\n newListItem.text(response.results[i].title);\n newList.append(newListItem);\n console.log(response.results[i].title);\n }\n newDiv.append(newList);\n }\n newDialog.append(newDiv);\n // append dialog to #results and show\n $(\"#results\").append(newDialog);\n newDialog.show();\n });\n }", "function Recipe(name1, cuisine, difficulty, ingredient, time, instruction) {\n this.nameOfRecipe = name1;\n this.typeOfCuisine = cuisine;\n this.complexity = difficulty;\n this.listOfIngredients = ingredient;\n this.preparingTime = time;\n this.preparingInstruction = instruction;\n this.printIngredients = function () {\n console.log(this.listOfIngredients);\n };\n this.checkTimeToPrepare = function () {\n return (time <= 15) ? 'Meal can be prepared in 15 min' : 'Meal cant be prepared in 15 min';\n };\n this.changeCuisene = function (newCuisien) {\n this.typeOfCuisine = newCuisien;\n };\n this.deleteIngredient = function (delIngredient) {\n var newIgredient = ingredient.filter(function (element) {\n return (element !== delIngredient)\n });\n this.listOfIngredients = newIgredient;\n };\n}", "function byIngredient(drinkTxt) {\n var requestUrl =\n \"https://www.thecocktaildb.com/api/json/v1/1/filter.php?i=\" + drinkTxt;\n fetch(requestUrl)\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n drinkData = data;\n $(\".modal\").addClass(\"is-active\");\n drinkTxt = \"drink with \" + drinkTxt;\n selectionList(drinkTxt);\n });\n}", "async fetchRecipeInfomation() {\n const { recipeId } = this.state\n const spoonacularEndpoint = `https://api.spoonacular.com/recipes/${recipeId}/information?includeNutrition=false&apiKey=${process.env.REACT_APP_API_KEY}`\n const spoonacularRes = await fetch(spoonacularEndpoint)\n const spoonacularData = await spoonacularRes.json()\n const { extendedIngredients } = spoonacularData\n\n this.setState({\n diets: spoonacularData.diets,\n title: spoonacularData.title, \n imageSrc: spoonacularData.image, \n ingredients: extendedIngredients,\n preperationTime: spoonacularData.readyInMinutes,\n pricePerServing: spoonacularData.pricePerServing,\n serving: spoonacularData.serving\n })\n }", "SET_RECIPES(state, recipes) {\n state.recipes = recipes;\n }", "onFood () {\r\n let tilePlants = this.tile.objs.filter(o => o.name === 'plant')\r\n if (tilePlants.length < 1) return false\r\n return tilePlants[0]\r\n }", "componentDidMount(){\n const paramRecipeId = this.props.match.params.id;\n if(paramRecipeId === \"new\"){\n this.setState({\n isNew: true\n })\n } else {\n // Extracts all recipes from list\n // Made async to show loading spinner\n getAllRecipes(this.props.cooks)\n .then((extractedRecipes)=>{\n const selectedRecipe = extractedRecipes.filter(\n recipe=>{ return recipe.id === paramRecipeId}\n );\n // If this finds a recipe\n if(selectedRecipe.length > 0){\n this.setState({\n selectedRecipe: selectedRecipe[0]\n });\n // If no recipe with that id\n } else {\n this.setState({noRecipe: true});\n }\n });\n }\n }", "function selectAllRecipes(){\n $.each($('.recipeCheckbox'), (function(i, item){\n $(item).click();\n }));\n}", "function generateNewRecipe() {\n var homeHeader = false;\n var homeGridPos = null;\n\n var isVideorecipe = (countVideorecipes < maxVideorecipes) ? (faker.random.number(1000) >= 800) : false;\n if (isVideorecipe) {\n ++countVideorecipes;\n if ((countVideorecipesGrid < maxVideorecipesGrid) && (faker.random.number(1000) >= 800)) {\n ++countVideorecipesGrid;\n homeGridPos = faker.random.array_element_pop(homeGrid);\n }\n }\n else {\n homeHeader = (faker.random.number(1000) >= 800);\n homeGridPos = faker.random.array_element_pop(homeGrid);\n }\n\n var sectionHeader = (faker.random.number(1000) >= 800);\n var sectionGridPos = faker.random.array_element_pop(isVideorecipe ? sectionVideoGrid : sectionGrid);\n var isPromoted = (homeHeader || sectionHeader || homeGridPos > 0 || sectionGridPos > 0);\n var rating = faker.random.number(0, 6);\n\n return {\n 'description': '<p>' + firstUpperCase(faker.Recipe.findRecipe()) + '. ' + firstUpperCase(faker.Lorem.paragraph()) + '.</p>',\n 'ingredients': newIngredients(),\n 'isOfficial': (faker.random.number(10) >= 7),\n 'procedure': newProcedure(),\n 'publishedDate': newDate(),\n 'scoreTotal': rating,\n 'scoreCount': 1,\n 'rating': rating,\n 'title': (isVideorecipe ? 'Videorecipe ' : '') + firstUpperCase(faker.Recipe.findRecipe()),\n \"isRecipesGridPromoted\": {\n \"position\": (sectionGridPos || 0),\n \"value\": (sectionGridPos !== null)\n },\n \"isRecipesHeaderPromoted\": sectionHeader,\n \"isIndexGridPromoted\": {\n \"position\": (homeGridPos || 0),\n \"value\": (homeGridPos !== null)\n },\n \"isIndexHeaderPromoted\": homeHeader,\n \"isPromoted\": isPromoted,\n \"portions\": faker.random.number(1, 15),\n \"time\": faker.random.number(1, 120),\n \"difficulty\": faker.random.number(1, 5),\n \"state\": (!isPromoted) ? states[faker.random.number(0, 4)] : states[1],\n \"header\": newHeader(),\n \"isVideorecipe\": isVideorecipe,\n \"videoUrl\": (isVideorecipe ? newVideo() : null),\n \"schemaVersion\": 1\n };\n }", "static getRelevantPokemon(typeArray) { // array of pokemon's relevant types\n // Randomly select a TYPE from the array\n let randType = typeArray[Math.floor(Math.random() * typeArray.length)]\n // Collect an array of pokemon with that TYPE\n let arrayTypePokemon= Pokemon.filterPokemonByType(randType)\n // Randomly select a POKEMON from the weakArray\n let pokemonWithType = arrayTypePokemon[Math.floor(Math.random() * arrayTypePokemon.length)]\n return pokemonWithType\n }", "function comSelectMonsters() {\r\n\t// randomly selects three cows\r\n\tfor (i = 0; i < 3; i++) {\r\n\t\t//pick a random space that isn't a cow\r\n\t\tvar index = Math.floor(Math.random() * 24);\r\n\t\twhile(spaces[index].state != \"cow\") {\r\n\t\t\tindex = Math.floor(Math.random() * 24);\r\n\t\t}\r\n\t\tspaces[index].state = \"monster\";\r\n\t}\r\n}", "function selectCard(event) {\n let recipeCard = event.target.closest(\".recipe-card\")\n if (event.target.className === \"card-apple-icon\") {\n let cardId = parseInt(event.target.closest(\".recipe-card\").id)\n domUpdates.changeHeartImageSrc(cardId, user, event)\n } else if (event.target.className === \"card-mixer-icon\") {\n let cardId = parseInt(event.target.closest(\".recipe-card\").id)\n domUpdates.changeMixerImageSrc(cardId, user, event)\n } else if (event.target.id === \"exit-recipe-btn\") {\n exitRecipe(event);\n } else if (isDescendant(recipeCard, event.target)) {\n let recipeId = $(recipeCard).attr('id')\n openRecipeInfo(recipeId);\n }\n}", "function gatherRecipes(rlist,recipes) {\n var s = {};\n for (var i=0;i<rlist.sections.length;i++) {\n var r = gatherRecipesSection(rlist.sections[i]);\n s[rlist.sections[i]] = r;\n \n }\n recipes[rlist.title] = s;\n // var p = rlist.title.replace(/:.*$/,'').replace(/ /g,'_')+'_last';\n // GM_setValue(p,(new Date()).toUTCString());\n //GM_log('setting '+p+' to '+GM_getValue(p));\n}", "function getRecipes() {\n allRecipeDetail = [];\n var allRecipeIDs = [];\n var ingredientList = \"\";\n //var numberOfRecipesReturned = 5; --hard coded to be 5\n\n //get list of ingredients. Slice off the last 'x' (used on the list), and add a comma\n $('#ingredientUL li').each(function(i) {\n ingredientList += $(this).text().slice(0, -1) + \",\"\n });\n\n //slice off the last digit - last 1 will always be \",\"\n ingredientList = ingredientList.slice(0, -1);\n\n var recipeListQueryURL = \"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/findByIngredients?number=5&ranking=1&ignorePantry=false&ingredients=\" + ingredientList + '\"';\n // console.log(recipeListQueryURL)\n // var queryURL = \"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/findByIngredients?number=2&ranking=1&ignorePantry=false&ingredients=apples%252Cflour%252Csugar\"\n     \n var recipeListSettings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": recipeListQueryURL,\n \"method\": \"GET\",\n \"headers\": {\n \"x-rapidapi-host\": \"spoonacular-recipe-food-nutrition-v1.p.rapidapi.com\",\n \"x-rapidapi-key\": spoonacularAPIKey\n }\n }\n\n // var recipeListSettings = {\n // \"async\": true,\n // \"crossDomain\": true,\n // \"url\": \"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/findByIngredients?number=5&ranking=1&ignorePantry=false&ingredients=chicken,potatoes,thyme\",\n // \"method\": \"GET\",\n // \"headers\": {\n // \"x-rapidapi-host\": \"spoonacular-recipe-food-nutrition-v1.p.rapidapi.com\",\n // \"x-rapidapi-key\": \"\"\n // }\n // }\n\n\n // var recipeListSettings = {\n // \"async\": true,\n // \"crossDomain\": true,\n // \"url\": \"https://webknox-recipes.p.rapidapi.com/recipes/findByIngredients?number=5&ingredients=chicken,potatoes,thyme\",\n // \"method\": \"GET\",\n // \"headers\": {\n // \"x-rapidapi-host\": \"webknox-recipes.p.rapidapi.com\",\n // \"x-rapidapi-key\": \"\"\n // }\n // }\n\n $.ajax(recipeListSettings).then(function(recipeListResponse) {\n\n for (i = 0; i < recipeListResponse.length; i++) {\n\n //add all of the recipes found\n allRecipeIDs.push(recipeListResponse[i].id);\n }\n\n getRecipeDetail(allRecipeIDs);\n });\n }", "function createBlankRecipe(){\n var recipeInfo = {\n //ste true if recipe has been selected\n recipeOnThisDate: false,\n name: \"\", \n ingredients: [], \n healthLabels: [], \n servings: 0, \n recipeUrl: \"\", \n imageUrl: \"\"\n };\n\n return recipeInfo;\n}", "async getRecipes(){\n\t\ttry {\n\t\t\tconst result = await axios(`https://forkify-api.herokuapp.com/api/search?&q=${this.query}`);\n\t\t\tthis.recipes = result.data.recipes;//undefined if network error\n\t\t} catch(error){\n\t\t\talert(error);//alerts in the brower if the error is triggered\n\t\t}\n\t}", "function setRecipeList(result){\r\n var listOfRecipes = [];\r\n var temp = result.data.meals;\r\n if(temp !== null){\r\n for(var i=0;i<temp.length;i++){\r\n listOfRecipes.push(temp[i].strMeal);\r\n }\r\n setrecipesByCategoryArray(listOfRecipes);\r\n }\r\n }", "render() {\n let filteredRecipe = this.state.recipes.filter(recipe => {\n return recipe.name.toLowerCase().includes(this.state.searchRecipe.toLowerCase());\n });\n return (\n <div>\n <center><Search handleInput={this.handleInput} /></center>\n <Recipes recipes={this.state.recipes && filteredRecipe} ReloadData={this.ReloadData}></Recipes>\n </div>\n\n );\n\n }", "function createSmoothies(ingredients, type) {\n // Get all the items of the type\n let filteredItems = ingredients.filter(item => item.type === type);\n\n // Create smoothies out of those items\n const smoothies = filteredItems.map((item, i, array) => {\n if (array[i + 1] !== undefined) {\n // Make sure the last one doesn't try to reference a property\n return `${item.name}-${array[i + 1].name}`;\n }\n });\n return smoothies.slice(0, smoothies.length - 1); // Remove the last item, which will be 'undefined'\n}", "function getRecipes(food) {\n // $(\"#recipeDisplay\").empty();\n console.log(\"hungry\");\n var cuisine = $(food).attr(\"id\");\n var recipeURL = \"https://api.edamam.com/search?q=\" + cuisine + \"&app_id=\" + appId + \"&app_key=\" + apiKey;\n $.ajax({\n url: recipeURL,\n method: \"GET\"\n }).then(function (response) {\n console.log(response);\n response.hits.forEach(element => {\n\n var divStyled = $('<div>');\n divStyled.attr('class', 'row');\n var divSize = $('<div>');\n divSize.addClass('col s12');\n var divColor = $('<div>');\n divColor.addClass('card red card blue-grey darken-4');\n var divText = $('<div>');\n divText.addClass('card-content white-text');\n // divStyled.attr('class', 'card');\n var divFood = $('<span>');\n divFood.addClass('card-title');\n var cardAction = $('<div>');\n cardAction.addClass('card-action');\n var divMoreInfo = $('<button>');\n divMoreInfo.attr('class', 'btn btn-primary red accent-4')\n divMoreInfo.html(`<a href=\"${element.recipe.url}\" target=\"_blank\">Full Recipe</a>`)\n divFood.text(element.recipe.label);\n console.log(element);\n cardAction.append(divMoreInfo);\n divText.append(divFood).append(cardAction);\n divColor.append(divText);\n divSize.append(divColor);\n divStyled.append(divSize);\n $(\".name\").append(divStyled);\n\n // $(\".recipe\").append(element.recipe.url);\n\n console.log(element);\n cantSearch = false;\n\n });\n })\n\n }", "async function showRandomRecipes() {\n const recipes = await getRandomRecipes();\n await showRecipes(recipes);\n // randomShow = true; \n }", "function getRecipe() {\n fetch('https://www.thecocktaildb.com/api/json/v1/1/search.php?s=' + drink)\n .then(function (response) {\n return response.json();\n })\n .then(function (json) {\n recipe = json\n\n showRecipe()\n // console.log(recipe);\n // console.log(search)\n })\n}", "function getRecipeInfo(id) {\n return axios.get(`${api_domain}/${id}/information`, {\n params: {\n includeNutrition: false,\n apiKey: process.env.spooncular_apiKey\n }\n });\n}", "function getWeather () {\nvar weatherQueryURL = \"https://api.openweathermap.org/data/2.5/weather?zip=\"+ userZip + \"&appid=2023ba5c12854dcdc1d6fbe23996eaaf\";\n// var queryURL = `https://api.openweathermap.org/data/2.5/weather?zip=${zipCode}appid=${apiKEY}`// template literals/strings \n\nvar clearWeatherTypes = 800;\nvar cloudyWeatherTypes = [803, 804];\nvar fogWeatherTypes = [701, 711, 721, 731, 741, 751, 761, 762];\nvar partlyCloudyWeatherTypes = [801, 802];\nvar rainWeatherTypes = [200, 201, 202, 210, 211, 212, 221, 230, 231, 232, 300, 301, 302, 310, 311, 312, 313, 314, 321, 500, 501, 502, 503, 504, 511, 520, 521, 522, 531];\nvar snowWeatherTypes = [600, 601, 602, 611, 612, 613, 615, 616, 620, 621, 622];\nvar sunnyWeatherTypes = 800;\nvar windyWeatherTypes = [771, 781];\n\nlet weatherBackgroundImg = $(\"#weathercard\");\n\nvar weatherType = {\n id: 0, //numeric id from weather api\n pokemonWeatherType: '', //assign this based on what weather category you want it to be a part of\n}\n\n//This is the GET method for the OpenWeather API\n$.ajax({\n url: weatherQueryURL,\n method: \"GET\"\n}).then(function (response) {\n console.log(response);\n var weatherApiIdType = response.weather[0].id;\n console.log('weather api type', weatherApiIdType)\n console.log('clear api type', clearWeatherTypes, sunnyWeatherTypes)\n console.log(response.name)\n\n//This converts the temperature information that the API fetches from Kelvin to Fahrenheit...\n let K = response.main.temp;\n let temperature = ((K-273.15)*1.8)+32\n temperature = Math.round(temperature);\n console.log(temperature);\n//...and displays it on the weather card\n $(\"#weathercardtext\").html(\"<h1>\" + temperature + \"°F\");\n \n weatherBackgroundImg.removeClass(\"hide\");\n\n if (weatherApiIdType === clearWeatherTypes || weatherApiIdType === sunnyWeatherTypes) {\n weatherType.id = weatherApiIdType\n //SHOULD I FIGURE OUT HOW THIS SHOULD SAY SUNNY TOO?\n weatherType.pokemonWeatherType = \"Clear\"\n weatherBackgroundImg.attr('src', 'assets/images/clear.jpg')\n \n console.log('im in clear weather')\n }\n\n else if (cloudyWeatherTypes.includes(weatherApiIdType)) {\n console.log('im in cloudy weather')\n weatherType.id = weatherApiIdType\n weatherType.pokemonWeatherType = \"Cloudy\"\n weatherBackgroundImg.attr('src', 'assets/images/cloudyovercast.jpg')\n\n \n }\n\n else if (fogWeatherTypes.includes(weatherApiIdType)) {\n console.log('im in fog')\n console.log('weatherApiIdType', weatherApiIdType)\n weatherType.id = weatherApiIdType\n weatherType.pokemonWeatherType = \"Fog\"\n weatherBackgroundImg.attr('src', 'assets/images/foggy.jpg')\n }\n\n else if (partlyCloudyWeatherTypes.includes(weatherApiIdType)) {\n console.log('im in partly cloudy weather')\n console.log('weatherApiIdType', weatherApiIdType)\n weatherType.id = weatherApiIdType\n weatherType.pokemonWeatherType = \"Partly Cloudy\"\n weatherBackgroundImg.attr('src', 'assets/images/partlycloudy.jpg')\n }\n\n else if (rainWeatherTypes.includes(weatherApiIdType)) {\n console.log('im in rain')\n console.log('weatherApiIdType', weatherApiIdType)\n weatherType.id = weatherApiIdType\n weatherType.pokemonWeatherType = \"Rain\"\n weatherBackgroundImg.attr('src', 'assets/images/rainy.jpg')\n }\n\n else if (snowWeatherTypes.includes(weatherApiIdType)) {\n console.log('im in fog')\n console.log('weatherApiIdType', weatherApiIdType)\n weatherType.id = weatherApiIdType\n weatherType.pokemonWeatherType = \"Snow\"\n weatherBackgroundImg.attr('src', 'assets/images/snowy.jpg')\n }\n\n else if (sunnyWeatherTypes.includes(weatherApiIdType)) {\n console.log('im in sunny weather')\n console.log('weatherApiIdType', weatherApiIdType)\n weatherType.id = weatherApiIdType\n weatherType.pokemonWeatherType = \"Sunny\"\n weatherBackgroundImg.attr('src', 'assets/images/fog.jpg')\n }\n\n else if (windyWeatherTypes.includes(weatherApiIdType)) {\n console.log('im in windy weather')\n console.log('weatherApiIdType', weatherApiIdType)\n weatherType.id = weatherApiIdType\n weatherType.pokemonWeatherType = \"Windy\"\n weatherBackgroundImg.attr('src', 'assets/images/fog.jpg')\n }\n\n else {\n weatherBackgroundImg.attr(\"src\", 'assets/images/defaultimage.jpg');\n }\n\n $(\"#currentweathercondition\").text(\"The current weather condition is \" + response.weather[0].description + \".\");\n console.log(response.weather);\n $(\"#currentGameWeather\").empty();\n var gameWeatherIcon = $(\"<img>\");\n gameWeatherIcon.addClass(\"gameWeatherIcon\");\n var gameWeatherStatus = \"The current in-game weather is \" + weatherType.pokemonWeatherType.toLowerCase(); + \".\"\n if ((weatherType.pokemonWeatherType == \"Clear\" || weatherType.pokemonWeatherType == \"Sunny\") && currentHour > 6 && currentHour < 19) {\n gameWeatherIcon.attr('src', './assets/images/clearGameDay.png')\n } else if (weatherType.pokemonWeatherType == \"Clear\") {\n gameWeatherIcon.attr('src', './assets/images/clearGameNight.png')\n } else if (weatherType.pokemonWeatherType == \"Fog\") {\n gameWeatherIcon.attr('src', './assets/images/fogGame.png')\n }\n else if (weatherType.pokemonWeatherType == \"Partly Cloudy\" && currentHour > 6 && currentHour < 19) {\n gameWeatherIcon.attr('src', './assets/images/cloudyGameDay.png')\n } else if (weatherType.pokemonWeatherType == \"Partly Cloudy\") {\n gameWeatherIcon.attr('src', './assets/images/cloudyGameNight.png')\n } else if (weatherType.pokemonWeatherType == \"Rain\") {\n gameWeatherIcon.attr('src', './assets/images/rainGame.png')\n } else if (weatherType.pokemonWeatherType == \"Snow\") {\n gameWeatherIcon.attr('src', './assets/images/snowGame.png')\n } else if (weatherType.pokemonWeatherType == \"Windy\") {\n gameWeatherIcon.attr('src', './assets/images/windyGame.png')\n } else if (weatherType.pokemonWeatherType == \"Cloudy\") {\n gameWeatherIcon.attr('src', './assets/images/cloudyGame.png')\n }\n $(\"#currentGameWeather\").append(gameWeatherIcon);\n $(\"#currentGameWeather\").append(gameWeatherStatus);\n\n\n// Calls every in-game weather category and their respective boosted types\n\nvar settingsGameWeather = {\n\t\"async\": true,\n\t\"crossDomain\": true,\n\t\"url\": \"https://cors-anywhere.herokuapp.com/https://pokemon-go1.p.rapidapi.com/weather_boosts.json\",\n\t\"method\": \"GET\",\n\t\"headers\": {\n\t\t\"x-rapidapi-host\": \"pokemon-go1.p.rapidapi.com\",\n\t\t\"x-rapidapi-key\": \"137b0a8991mshfe042d583612905p1ff297jsnc05f2d857777\"\n\t}\n}\n\n$.ajax(settingsGameWeather).done(function (response) {\n console.log(response);\n\n // Need to expand here to store weather/type boost pairs and use them in Pokemon select function below\n $.each(response, function( key, value ) {\n console.log( key + \": \" + value );\n gameWeatherArray[key] = value;\n });\n console.log(gameWeatherArray);\n\n $(\"#typeBox\").empty();\n var weather = weatherType.pokemonWeatherType;\n console.log(weather);\n\n // Pulls specific boosted types from weather chosen\n var currentBoost = response[weather];\n for (i=0; i < currentBoost.length; i++) {\n console.log(\"The boosted types are: \" + currentBoost[i]);\n var typeCard = $(\"<div>\");\n typeCard.addClass(\"card border-0 typeCard\");\n var typeSymbol = $(\"<img>\");\n typeSymbol.addClass(\"card-img-top typeSymbol\");\n typeSymbol.attr(\"src\", \"./assets/images/\" + currentBoost[i] + \".png\");\n typeCard.append(typeSymbol);\n var typeTitle = $(\"<div>\");\n typeTitle.addClass(\"card-title text-center\");\n typeTitle.text(currentBoost[i]);\n typeCard.append(typeTitle);\n $(\"#typeBox\").append(typeCard);\n }\n});\n\n\n})\n}", "handleAddRecipe(recipe) {\n this.setState((state, props) => {\n const index = state.restRecipes.indexOf(recipe);\n if (index < 0)\n return {};\n\n return {\n selectedRecipes: state.selectedRecipes.update(\n props.config.Recipes[recipe].result,\n (val = Map()) => val.set(recipe, 0)\n ),\n };\n });\n\n this.setState(this.updateRecipes);\n this.setState(this.updatePrices);\n this.setState(Calculator.updateExportData);\n }", "function getMealRecipe(e){\ne.preventDefault();\nif(e.target.classList.contains('recipe-btn')){\n let mealItem = e.target.parentElement.parentElement.parentElement;\n fetch(`https://www.themealdb.com/api/json/v1/1/lookup.php?i=${mealItem.dataset.id}`)\n .then(res => res.json()).then(data => mealsDetailPop_up(data.meals));\n}\n}", "function getRecipeStep(num){\n\tvar recipeInfo = \"\";\n\tvar recipeInfo2 =\"\";\n for (var x=0; x < recipeData.root.body.recipes.length; x++){\n if (num == recipeData.root.body.recipes[x].id){\n recipeID = x;\n\t\t\trecipeInfo += \"<section id=\\\"recipe\\\"><div class=\\\"container\\\" id=\\\"recipePage\\\"><div class=\\\"row\\\"><!-- Title --><div class=\\\"col-12\\\"><h2>\" + recipeData.root.body.recipes[x].title + \"</h2></div></div><div class=\\\"row vertical-align\\\"><div class=\\\"col-12\\\"><!-- Picture --><div class=\\\"col-md-8 pull-left wow swing\\\"><img src=\\\"\" + recipeData.root.body.recipes[x].image + \"\\\" class=\\\"recipe-picture\\\" /></div><!-- Info --><div class=\\\"col-md-4 pull-right wow lightSpeedIn\\\"><div class=\\\"recipe-info\\\"><h3>&ensp;Info<a data-toggle=\\\"collapse\\\" class=\\\"pull-right\\\" href=\\\"#collapseInfo\\\"><i class=\\\"fa fa-plus-square fa-pos\\\" aria-hidden=\\\"true\\\"></i></a></h3><!-- Time --><div id=\\\"collapseInfo\\\" class=\\\"collapse in\\\">\";recipeInfo += \"<div id=\\\"servings\\\">\";\n \n if(userID == -1){\n for (var i= 1; i < 4; i++){\n recipeInfo += \"<div class = \\\"slider\\\">\";\n recipeInfo += \"<input type=\\\"range\\\" min=\\\"0.5\\\" max=\\\"1.5\\\" value=\\\"1\\\" id=\\\"myRange\" + i + \"\\\" step = \\\"0.1\\\" oninput=\\\"showVal(this.value,\" + i + \")\\\">\";\n recipeInfo += \"<p>Serving : <span class = \\\"default\\\" id=\\\"demo\" + i + \"\\\">1</span></p>\";\n recipeInfo += \"</div>\";\n servingFact += 1;\n }\n } else { \n $.ajax({\n url: \"getPreferences.php\",\n dataType: \"json\",\n type: \"POST\",\n data: {test: userID},\n success: function(data) {\n var servings2 = \"\";\n for (var i= 0; i < data.profile.length; i++){\n servings2 += \"<div class = \\\"slider\\\">\";\n servings2 += \"<input type=\\\"range\\\" min=\\\"0.5\\\" max=\\\"1.5\\\" value=\\\"\" + data.profile[i].serving + \"\\\" id=\\\"myRange\" + (i+1) + \"\\\" step = \\\"0.1\\\" oninput=\\\"showVal(this.value,\" + (i+1) + \")\\\">\";\n servings2 += \"<p>\" + data.profile[i].name + \": <span class = \\\"default\\\" id=\\\"demo\" + (i+1) + \"\\\">\"+ data.profile[i].serving +\"</span></p>\";\n servings2 += \"</div>\";\n var servingVal = parseFloat(data.profile[i].serving);\n servingFact += servingVal;\n changeServings(servingFact);\n }\n $(\"#servings\").html(servings2);\n },\n error: function(jqXHR, textStatus, errorThrown) {\n $(\"#p1\").text(textStatus + \" \" + errorThrown\n + jqXHR.responseText);\n } \n\t }); \n }\n recipeInfo += \"</div>\";\n recipeInfo += \"<button onclick=\\\"addNewServing()\\\">Add New Serving</button>\";\n recipeInfo += \"<button onclick=\\\"removeLastServing()\\\">Remove Last Serving</button>\";\n recipeInfo += \"<button onclick=\\\"saveRecipe(\" + recipeData.root.body.recipes[x].id + \", \\'\" + recipeData.root.body.recipes[x].title + \"\\', \\'\" + recipeData.root.body.recipes[x].image + \"\\')\\\">Save Recipe</button>\";\n\t\t\trecipeInfo += \"<a href=\\\"https://twitter.com/share?ref_src=twsrc%5Etfw\\\" class=\\\"twitter-share-button\\\" data-text=\\\"Check out this recipe I made!\\\" data-via=\\\"preppyfun\\\" data-hashtags=\\\"preppy\\\" data-size =\\\"large\\\" data-show-count=\\\"false\\\">Tweet</a><script async src=\\\"https://platform.twitter.com/widgets.js\\\" charset=\\\"utf-8\\\"></script></a>\";\n recipeInfo += \"<div class=\\\"row\\\"><div class=\\\"col-2 text-center\\\"><i class=\\\"fa fa-clock-o\\\" aria-hidden=\\\"true\\\"></i></div><div class=\\\"col-6\\\">Time</div><div class=\\\"col-4\\\">\" + recipeData.root.body.recipes[x].readyInMinutes + \" min</div></div></div></div></div></div></div>\";\n recipeInfo += \"<!-- Ingredients --><div class=\\\"row wow slideInUp\\\"><div class=\\\"col-12\\\"><div class=\\\"recipe-ingredients\\\"><h3>&ensp;Ingredients</h3><div id=\\\"collapse1\\\" class=\\\"collapse in\\\">\";\n recipeInfo += \"</div></div></div></div><!-- Directions --><div class=\\\"row wow slideInUp\\\"><div class=\\\"col-12\\\"><div class=\\\"recipe-directions\\\"><h3>&ensp;Directions<a data-toggle=\\\"collapse\\\" class=\\\"pull-right\\\" href=\\\"#collapse2\\\"><i class=\\\"fa fa-plus-square fa-pos\\\" aria-hidden=\\\"true\\\"></i></a></h3><div id=\\\"collapse2\\\" class=\\\"collapse\\\"><ol>\";\n \n for(var n =0; n < recipeData.root.body.recipes[x].analyzedInstructions[0].steps.length; n++){\n \trecipeInfo += \"<li>\" + recipeData.root.body.recipes[x].analyzedInstructions[0].steps[n].step + \"</li>\";\n }\n \n recipeInfo += \"</ol></div></div></div></div><!-- Back to recipes --><div class=\\\"row wow rollIn\\\"><div class=\\\"col-12 text-center\\\"><a href=\\\"index.html\\\" onclick=\\\"goBack(); return false;\\\"><i class=\\\"fa fa-backward\\\" aria-hidden=\\\"true\\\"></i>Go to back to recipes.</a></div></div></div></section>\";\n\n\t\t\t$(\"#contentArea\").html(recipeInfo);\n changeServings(servingFact);\n\n createView(\"Steps.html&\" + recipeData.root.body.recipes[x].id, true);\n }\n }\n}", "function ingredientSearch (food) {\n\n\t\t// J\n\t\t// Q\n\t\t// U\n\t\t// E\n\t\t// R\n\t\t// Y\n\t\t$.ajax ({\n\t\t\tmethod: \"GET\",\n\t\t\turl: ingredientSearchURL+\"?metaInformation=false&number=10&query=\"+food,\n\t\t headers: {\n\t\t 'X-Mashape-Key': XMashapeKey,\n\t\t 'Content-Type': \"application/x-www-form-urlencoded\",\n\t\t \"Accept\": \"application/json\"\n\t\t }\n\t\t}).done(function (data) {\n\t\t\t// check each returned ingredient for complete instance of passed in food\n\t\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\t\tvar word_list = getWords(data[i].name);\n\t\t\t\t// ensures food is an ingredient and not already in the food list\n\t\t\t\tif (word_list.indexOf(food) !== -1 && food_list.indexOf(food) === -1) {\n\t\t\t\t\tfood_list.push(food);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "function displayRecipe(data) {\n var Recipe = data.meals[0];\n var RecipeDiv = document.getElementById(\"event-list-group\");\n \n var recipeContainer = document.createElement(\"div\");\n $(recipeContainer).addClass(\"recipe-container columns\");\n\n var RecipeImg = document.createElement(\"img\");\n RecipeImg.id = \"::img\";\n RecipeImg.style.cssText = \"width:300px;height:300px;\";\n $(RecipeImg).addClass(\"inline-img col-auto\");\n RecipeImg.src = Recipe.strMealThumb;\n recipeContainer.appendChild(RecipeImg);\n\n var contentDiv = document.createElement(\"div\");\n $(contentDiv).addClass(\"col-auto\");\n\n var RecipeIngredients = document.createElement(\"ul\");\n $(RecipeIngredients).addClass(\"inline-ul\");\n contentDiv.appendChild(RecipeIngredients);\n\n recipeContainer.appendChild(contentDiv);\n\n RecipeDiv.appendChild(recipeContainer);\n\n $(\"<label>\")\n .addClass(\"form-checkbox\")\n .html(\"<input class='recipe-checkbox' type='checkbox'><i class='form-icon'></i> Add Recipe\")\n .appendTo(contentDiv);\n\n\n var getIngredients = Object.keys(Recipe)\n .filter(function (ingredient) {\n return ingredient.indexOf(\"strMeal\") == 0;\n })\n .reduce(function (ingredients, ingredient) {\n if (Recipe[ingredient] != null) {\n ingredients[ingredient] = Recipe[ingredient];\n }\n return ingredients;\n }, {});\n\n var getArea = Object.keys(Recipe)\n .filter(function (ingredient) {\n return ingredient.indexOf(\"strArea\") == 0;\n })\n .reduce(function (ingredients, ingredient) {\n if (Recipe[ingredient] != null) {\n ingredients[ingredient] = Recipe[ingredient];\n }\n return ingredients;\n }, {});\n\n var getCategory = Object.keys(Recipe)\n .filter(function (ingredient) {\n return ingredient.indexOf(\"strCategory\") == 0;\n })\n .reduce(function (ingredients, ingredient) {\n if (Recipe[ingredient] != null) {\n ingredients[ingredient] = Recipe[ingredient];\n }\n return ingredients;\n }, {});\n\n var getSource = Object.keys(Recipe)\n .filter(function (ingredient) {\n return ingredient.indexOf(\"strSource\") == 0;\n })\n .reduce(function (ingredients, ingredient) {\n if (Recipe[ingredient] != null) {\n ingredients[ingredient] = Recipe[ingredient];\n }\n return ingredients;\n }, {});\n\n var getVideo = Object.keys(Recipe)\n .filter(function (ingredient) {\n return ingredient.indexOf(\"strYoutube\") == 0;\n })\n .reduce(function (ingredients, ingredient) {\n if (Recipe[ingredient] != null) {\n ingredients[ingredient] = Recipe[ingredient];\n }\n return ingredients;\n }, {});\n\n let value = getIngredients[\"strMeal\"];\n listItem = document.createElement(\"li\");\n listItem.innerHTML = value;\n RecipeIngredients.appendChild(listItem);\n\n let area = getArea[\"strArea\"];\n listItem = document.createElement(\"li\");\n listItem.innerHTML = area;\n RecipeIngredients.appendChild(listItem);\n\n let category = getCategory[\"strCategory\"];\n listItem = document.createElement(\"li\");\n listItem.innerHTML = category;\n RecipeIngredients.appendChild(listItem);\n\n let recipeSource = getSource[\"strSource\"];\n if (recipeSource) {\n var link = $(\"<li>\").appendTo(listItem);\n $(\"<a>\")\n .text(\"Recipe Link\")\n .attr(\"href\", `${recipeSource}`)\n .attr(\"target\", \"_blank\")\n .appendTo(link);\n }\n\n let recipeVideo = getVideo[\"strYoutube\"];\n if (recipeVideo) {\n var videolink = $(\"<li>\").appendTo(listItem);\n $(\"<a>\")\n .text(\"Recipe YouTube Video\")\n .attr(\"href\", `${recipeVideo}`)\n .attr(\"target\", \"_blank\")\n .appendTo(videolink);\n }\n}", "selectWeatherObj(temp, weatherID) {\n let temperature, weather;\n // pass a string of temperature to 'temp'; use switch statement\n if (temp <= -10) temperature = \"minus10C\";\n else if (temp > -10 && temp <= -5) temperature = \"minus10C\";\n else if (temp > -5 && temp <= 0) temperature = \"minus5C\";\n else if (temp > 0 && temp <= 5) temperature = \"zero\";\n else if (temp > 5 && temp <= 10) temperature = \"five\";\n else if (temp > 10 && temp <= 15) temperature = \"ten\";\n else if (temp > 15 && temp <= 20) temperature = \"fifteen\";\n else if (temp > 20 && temp <=25) temperature = \"twenty\";\n else if (temp > 25) temperature = \"twenty_five\";\n\n // pass a string of weather to 'weather'; use weatherID\n if (weatherID >= 800) weather = \"non_rain\";\n else weather = \"rain\";\n\n let weatherObj = temperature + \"_\" + weather;\n // console.log(\"the type of weatherObj is \" + typeof weatherObj);\n return weatherObj;\n }", "function findTheCheese (foods) {\n\n for (var i = 0; i < foods.length; i++) {\n\n switch (foods[i]) {\n case \"cheddar\":\n return \"cheddar\"\n break;\n case \"gouda\":\n return \"gouda\"\n break;\n case \"camembert\":\n return \"camembert\"\n break;\n }\n }\n return \"no cheese!\"\n}", "function dietCheck() {\n for (var i = 0; i < recipes.length(); i++) {\n var dietMatchCheck = ingredientsCompare(recipes[i].ingredients.toUpperCase(), restrictions.toUpperCase());\n if (dietMatchCheck == false) {\n recipes.push[recipes[i]];\n }\n }\n}", "function fetchRecipes() {\n fetch(RECIPES_URL)\n .then(resp => resp.json())\n .then(json => json.forEach(recipe => {\n let newRecipe = new Recipe(recipe.name, recipe.url, recipe.meal_type, recipe.cuisine, recipe.id);\n allRecipes.push(newRecipe);\n newRecipe.renderRecipe();\n }))\n }", "function choosyWeather(weatherString){\n if(weather === 'snowing'){\n return(\"It's snowing\")\n }else if(weather === \"raining{\n return(\"It's raining\");\n else{\n return(\"Have a nice day!\");\n\n }\n\n}", "showRecipe(id, ingredients) {\n this.setState ({\n showRecipeDetail: !this.state.showRecipeDetail,\n showRecipeID: id,\n missedIngredients: ingredients\n })\n }" ]
[ "0.6771611", "0.6606252", "0.6393852", "0.63582134", "0.6188069", "0.5998609", "0.59640473", "0.5918877", "0.5855814", "0.58337325", "0.57372856", "0.57350427", "0.57020134", "0.5688214", "0.56846714", "0.56714064", "0.5651607", "0.56362104", "0.56162107", "0.55725336", "0.5560298", "0.5543121", "0.5526986", "0.5519389", "0.5510397", "0.54844457", "0.54386765", "0.5419049", "0.5413934", "0.5394927", "0.5378002", "0.53779554", "0.53564596", "0.53244334", "0.5303841", "0.5301218", "0.5299755", "0.5285538", "0.52737767", "0.5270211", "0.5239777", "0.523798", "0.5237794", "0.5235691", "0.5227004", "0.52244186", "0.52190787", "0.5197668", "0.5195398", "0.5195313", "0.51872194", "0.51792663", "0.51791257", "0.5176971", "0.5162348", "0.51580495", "0.51555365", "0.5146376", "0.5146314", "0.51343894", "0.51310354", "0.51289964", "0.51272655", "0.5126545", "0.51232994", "0.51177585", "0.51163614", "0.5115322", "0.5106445", "0.5100859", "0.5099284", "0.50942874", "0.5089792", "0.5080086", "0.5077099", "0.507574", "0.5061189", "0.50604147", "0.50594836", "0.5059425", "0.5039514", "0.5032139", "0.5031294", "0.50308484", "0.50210005", "0.50196743", "0.5018581", "0.500573", "0.5005695", "0.50047064", "0.50005895", "0.5000224", "0.4995579", "0.4988457", "0.4984895", "0.49688667", "0.4968706", "0.49672854", "0.49667668", "0.4965353" ]
0.77564096
0
Updates all the filter properties of all the recipe objects in window.recipes depending on the filters chosen by the user, so that the recipes can be selected based on these and either hidden or displayed
function filter(filter_type, choices) { window.recipes.forEach(recipe => { if (choices.length === 0) { recipe[`${filter_type}`] = true; } if (filter_type === 'weather') { let recipeProperties = recipe.getElementsByTagName('ul')[0].children; for (let i = 0; i < recipeProperties.length; i++) { if (choices.length === 0) { recipe[`${filter_type}`] = true; } else { for (let j = 0; j < choices.length; j++) { if (recipeProperties[i].innerHTML === choices[j]) { recipe[`${filter_type}`] = true; } } } } } else { for (let i = 0; i < choices.length; i++) { var typeTag = recipe.getElementsByClassName(`${choices[i]}`); if (typeTag.length === 1) { recipe[`${filter_type}`] = true; } if (filter_type === 'diet') { if (choices[i] === 'Everything') { recipe[`${filter_type}`] = true; } } } } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function display_all(recipes) {\n recipes.forEach(recipe => {\n recipe['weather'] = true;\n });\n display_selected_recipes();\n}", "function display_selected_recipes() {\n document.querySelector('#weather-filter-container').style.display = 'none';\n document.querySelector('#select-filters').style.display = 'block';\n document.querySelector('#recipes-title').style.display = 'block';\n document.querySelector('#grid-container').style.display = 'grid';\n window.recipes.forEach(recipe => {\n if (recipe['weather']) {\n recipe.style.display = 'block';\n } else {\n recipe.style.display = 'none';\n }\n });\n}", "function selectAllFilteredRecipes() { /*Nota bene: Parameters (ingrFilter, appFilter, ustFilter) deleted since not red */\n\n const INPUT = SEARCH_INPUT.value;\n let result = [];\n\n if (INPUT.length > 2) {\n\n /* Search to find input in title, description or ingredient list of the recipe*/\n\n /************ALGO 1************/\n result = recipes.filter(item =>\n Utils.normString(item.name).includes(Utils.normString(INPUT)) ||\n item.ingredients.map(rMap => Utils.normString(rMap.ingredient)).join(',').includes(Utils.normString(INPUT))|| /*.join to create a string containing all elements ingredients all together so element TRUE when element=\"pate\"+\"brisee\" for ex */\n Utils.normString(item.description).includes(Utils.normString(INPUT)));\n /************ALGO 1************/\n \n }\n else {\n result=[...recipes]; /*to get all the recipes displayed when less than 3 digits */\n }\n\n let filteredRecipes = [];\n\n result.forEach(currentRecipe => {\n const ingrNames = currentRecipe.ingredients.map(rMap => Utils.normString(rMap.ingredient));\n const appNames = Utils.normString(currentRecipe.appliance);\n const ustNames = currentRecipe.ustensils.map(rMap => Utils.normString(rMap));\n\n let nbTagIngr = 0;\n let nbTagApp = 0;\n let nbTagUst = 0;\n\n tabSelectIngr.forEach(ingrTag => {\n if (ingrNames.includes(ingrTag)) {\n nbTagIngr++;\n }\n });\n\n tabSelectApp.forEach(appTag => {\n if (appNames.includes(appTag)) {\n nbTagApp++;\n }\n });\n\n tabSelectUst.forEach(ustTag => {\n if (ustNames.includes(ustTag)) {\n nbTagUst++;\n }\n });\n\n if (nbTagApp === tabSelectApp.length &&\n nbTagIngr === tabSelectIngr.length &&\n nbTagUst === tabSelectUst.length) {\n filteredRecipes.push(currentRecipe);\n }\n });\n return filteredRecipes;\n}", "function select_by_weather(recipes) {\n recipes.forEach(recipe => {\n recipe['weather'] = false;\n });\n let selectedChoices = findIfFilters(\"weather\");\n if (selectedChoices.length === 0) {\n document.querySelector('#no-filter-chosen').style.display = 'block';\n } else {\n filter(\"weather\", selectedChoices);\n display_selected_recipes();\n history.pushState({ recipes: 'loaded', weather_types: selectedChoices }, ``, '/recipes');\n }\n}", "render() {\n //Line below to be implemented when I can figure out proper query for the back end. \n const { searchTerm, filterOptions, filterOptionsCuisine } = this.props;\n // const { searchTerm } = this.props;\n if (searchTerm === \" \") {\n return 'No matching results'\n }\n const recipeList = this.props.recipes\n\n \n //Filters below to be implemented when I can figure out proper query for the back end. \n \n .filter(recipe => (recipe.meal_type === filterOptions || filterOptions === 'All'))\n .filter(recipe => (recipe.cuisine_type === filterOptionsCuisine || filterOptionsCuisine === 'All'))\n .filter(recipe => {\n return recipe.ingredients.some(ingredient => \n ingredient.toLowerCase().includes(searchTerm.toLowerCase()))\n })\n .map((recipe, key) => <RecipeDetail recipe={recipe} key={key} />);\n \n console.log(filterOptions);\n console.log(filterOptionsCuisine);\n return (\n <div className=\"FilterableList\">\n {recipeList}\n\n </div>\n );\n }", "function recomputeFilters() {\n const category = document.querySelector(\"#category-picker\").value;\n\n const filterSets = {};\n\n Object.values(filterDefs).forEach(filter => {\n filterSets[filter.id] = new Set();\n });\n \n document.querySelectorAll(\".entity-select.category-visible > option\").forEach(element => {\n const entity = availableEntities[category][element.value];\n \n Object.values(filterDefs).forEach(filter => {\n filter.extract(entity).forEach(result => {\n filterSets[filter.id].add(result);\n });\n });\n });\n\n Object.values(filterDefs).forEach(filter => {\n // always show the \"none\" option\n let found = filter.id == \"none\";\n\n document.querySelectorAll(\"#filter-\" + filter.id + \" > option\").forEach(element => {\n if (filterSets[filter.id].has(element.value) || filter.id == \"none\") {\n element.classList.remove(\"filtered\");\n element.disabled = false;\n found = true;\n } else {\n element.classList.add(\"filtered\");\n element.disabled = true;\n }\n });\n\n\n const filterOption = document.querySelector(\"#filter-picker > option[value='\" + filter.id + \"']\");\n if (found) {\n filterOption.classList.remove(\"filtered\");\n filterOption.disabled = false;\n } else {\n filterOption.classList.add(\"filtered\");\n filterOption.disabled = true;\n }\n });\n\n document.querySelector(\"#filter-picker\").value = \"none\";\n document.querySelector(\"#filter-picker\").dispatchEvent(new Event(\"input\"));\n}", "function changeFilter() {\n\n\t\tconst filters = {};\n\t\tconst authors = {};\n\t\tfilterCheckboxes.forEach(dom => filters[dom.name] = dom.checked);\n\t\tlistAuthors.querySelectorAll('input').forEach(dom => authors[dom.name] = dom.checked);\n\n\t\tvar strDom = '';\n\n\t\tcurPhoto.forEach(photo => {\n\t\t\tif (filters[sizePhoto(photo.width)] && authors[photo.user.name]) {\n\t\t\t\tstrDom += `<li data-id=\"${photo.id}\">\n\t\t\t\t\t\t<div \n\t\t\t\t\t\t\tclass=\"image-container\" \n\t\t\t\t\t\t\tdata-url=\"${photo.urls.full}\"\n\t\t\t\t\t\t\tdata-likes=\"${photo.likes}\"\n\t\t\t\t\t\t\tdata-author-url=\"${photo.user.links.html}\"\n\t\t\t\t\t\t\tdata-author-name=\"${photo.user.name}\"\n\t\t\t\t\t\t\tdata-author-photo=\"${photo.user.profile_image.small}\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<img src=\"${photo.urls.thumb}\" alt=\"${(photo.description) ? photo.description : ''}\">\n\t\t\t\t\t\t\t<div class=\"info\">\n\t\t\t\t\t\t\t\t<span class=\"likes\"><i class=\"fa fa-heart\" aria-hidden=\"true\"></i> ${photo.likes}</span>\n\t\t\t\t\t\t\t\t<a class=\"download\" href=\"${photo.links.download}\" download><i class=\"fa fa-arrow-circle-o-down\" aria-hidden=\"true\"></i></a>\n\t\t\t\t\t\t\t\t<a class=\"author\" href=\"${photo.user.links.html}\"><img src=\"${photo.user.profile_image.small}\">${photo.user.name}</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</li>`;\n\t\t\t}\n\t\t});\n\n\t\tlistPhotos.innerHTML = strDom;\n\t\tlistPhotos.querySelectorAll('.image-container').forEach(dom => dom.onclick = openModal);\n\t}", "filterRestaurants () {\n this.sendAction('filterInit', {\n price: this.get('price'),\n isOpen: this.get('isChecked')\n });\n }", "function filterItems() {\n //returns newPropList, array of properties\n var newPropList = featured;\n //Beds\n console.log(1, newPropList);\n if(currentFilters.beds == 5) {\n newPropList = newPropList.filter(item => item.bedrooms >= currentFilters.beds);\n }\n else if (currentFilters.beds == 0) {\n\n }\n else {\n newPropList = newPropList.filter(item => item.bedrooms == currentFilters.beds);\n }\n console.log(2, newPropList);\n //Baths\n if(currentFilters.baths == 5) {\n newPropList = newPropList.filter(item => item.fullBaths >= currentFilters.baths);\n }\n else if (currentFilters.baths == 0) {\n\n }\n else {\n newPropList = newPropList.filter(item => item.fullBaths == currentFilters.baths);\n }\n console.log(3, newPropList);\n //Price\n if(currentFilters.max == 0) {\n\n }\n else if(currentFilters.min == 1000000) {\n newPropList = newPropList.filter(item => item.rntLsePrice >= currentFilters.min);\n }\n else {\n newPropList = newPropList.filter(item => item.rntLsePrice >= currentFilters.min && item.rntLsePrice <= currentFilters.max);\n }\n console.log(4, newPropList);\n //Type\n console.log(currentFilters.type);\n if(currentFilters.type == \"All\") {\n console.log('all');\n }\n else if(currentFilters.type == \"Other\") {\n newPropList = newPropList.filter(item => item.idxPropType == \"Residential Income\" || item.idxPropType == \"Lots And Land\");\n console.log('other');\n }\n else {\n newPropList = newPropList.filter(item => item.idxPropType == currentFilters.type);\n console.log('normal');\n }\n //Search Term\n console.log(5, newPropList);\n if(currentFilters.term != '')\n {\n newPropList = newPropList.filter(item => \n item.address.toLowerCase().indexOf(currentFilters.term.toLowerCase()) != -1 ||\n item.cityName.toLowerCase().indexOf(currentFilters.term.toLowerCase()) != -1\n );\n }\n console.log(6, newPropList);\n return newPropList;\n }", "function set_filters() {\n let filter = {\n post_type: 'auto-in-vendita',\n filters: {\n /* tipologia : $('input[name=\"condition\"]:checked').val(), */\n marca: brandInput.val(),\n modello: modelInput.val(),\n maxPrice: maxPriceInput.val(),\n km: kmInput.val(),\n anno: yearInput.val(),\n alimentazione: fuelInput.val(),\n cambio: transmissioninput.val(),\n novice: noviceInput.is(':checked') == true ? true : '',\n }\n }\n get_search_results_count(filter);\n }", "function searchRecipes() {\n showAllRecipes();\n let searchedRecipes = domUpdates.recipeData.filter(recipe => {\n return recipe.name.toLowerCase().includes(searchInput.value.toLowerCase());\n });\n filterNonSearched(createRecipeObject(searchedRecipes));\n}", "function setFilters(){}", "function setFilters(){}", "function setFilters(){}", "function setFilters(){}", "function setFilters(){}", "function setFilters(){}", "function setFilters(){}", "function setFilters(){}", "function setFilters(){}", "function fillFilters() {\n let filterContainer = $(\".filter-container\");\n\n for (let filterKey in filters) {\n let domFilter = $(filterContainer).find(`[name=\"${filterKey}\"]`);\n domFilter.eq(0).val(filters[filterKey]);\n }\n\n for (let filterKey in enabledFilters) {\n if (enabledFilters[filterKey])\n $(filterContainer).find(`input[name=\"${filterKey}\"]`).prop('checked', true);\n }\n }", "function updateFilters() {\n\n // Save the element, value, and id of the filter that was changed\n let date = d3.select('#datetime').property('value');\n let city = d3.select('#city').property('value');\n let state = d3.select('#state').property('value');\n let country = d3.select('#country').property('value');\n let shape = d3.select('#shape').property('value');\n\n // If a filter value was entered then add that filterId and value\n // to the filters list. Otherwise, clear that filter from the filters object\n if (date) {\n filters.date = date;\n }\n if (city) {\n filters.city = city;\n };\n if (state) {\n filters.state = state;\n };\n if (country) {\n filters.country = country;\n };\n if (shape) {\n filters.shape = shape;\n };\n // Call function to apply all filters and rebuild the table\n filterTable();\n}", "function filter() {\n var filtered = listings;\n\n var selected_cat = document.getElementById(\"filter-cats\").value;\n if (selected_cat != \"All Categories\") {\n $.post(\"count/cats/\", {\"name\": selected_cat});\n filtered = filtered.filter(function(d) {\n if (Array.isArray(d.cat)) {\n return d.cat.includes(selected_cat);\n } else {\n return d.cat == selected_cat;\n }\n });\n } \n \n var selected_genre = document.getElementById(\"filter-genres\").value;\n if (selected_genre != \"all\") {\n filtered = filtered.filter(function(d) {\n if (\"type\" in d && d.type != null) {\n if (selected_genre in d.type) {\n return d[\"type\"][selected_genre] == \"True\";\n } else {\n return false;\n }\n } else {\n return false;\n }\n });\n } \n draw(filtered);\n}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}" ]
[ "0.6702223", "0.67011803", "0.65662676", "0.6565148", "0.637609", "0.6240561", "0.6228511", "0.6197171", "0.61527103", "0.6106958", "0.6099209", "0.6076114", "0.6076114", "0.6076114", "0.6076114", "0.6076114", "0.6076114", "0.6076114", "0.6076114", "0.6076114", "0.60743695", "0.6059691", "0.60572493", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052", "0.6045052" ]
0.6978485
0
Changes display of recipes results depending on how many recipes are to be shown
function display_settings(counter) { // Displays a message saying there are no matches if there are no selected recipes for those chosen filters if (counter === 0) { document.querySelector('#no-matches').style.display = 'block'; } // If there is only one recipe to be displayed, sets the width to being wider than normal, so it looks good on the screen if (counter === 1) { window.recipes.forEach(recipe => { if (recipe.style.display !== 'none') { recipe.style.width = '60vw'; } else { recipe.style.width = 'auto'; } }) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function showRecipes(recipes) {\n\n for (let rec of recipes) {\n await generateRecipeHTML(rec);\n }\n currentMealList = recipes;\n }", "function showResults() {\n let bigString = \"\";\n\n for (let i = page; i < page + 10; i++) {\n let result = results[i];\n\n let smallURL = result.recipe.image;\n if (!smallURL) smallURL = \"Media/gif_finder_images/no-image-found.png\";\n\n //get url of recipe, yield/servings, total time\n let url = result.recipe.url;\n let portions = result.recipe.yield;\n let time = result.recipe.totalTime;\n //if there is no estimate on time (0 minutes), change phrases\n if (time == 0) {\n time = \"N/A\"\n }\n else {\n time += \" min\";\n }\n //get name of recipe, cut off name if too long\n let name = result.recipe.label;\n if (name.length > 42) {\n name = name.substring(0, 42) + \"...\";\n }\n //build HTML\n let line = `<div class='result'><div class=\"title\"><h2>${name}</h2></div><div class=\"info\">Servings: ${portions}\n <br>Time: ${time}</div><div class=\"foodImage\"><img src='${smallURL}' title='${result.id}' /></div>`;\n line += `<div class=\"link\"><a target='_blank' href='${url}'> View Recipe </a></div></div>`;\n bigString += line;\n }\n\n //put into HTML\n document.querySelector('#content').innerHTML = bigString;\n\n document.querySelector('#status').innerHTML = \"<b>Search was successful!</b>\";\n}", "function dispalySelectedRecipe(clicked) {\n var request_recipie = document.getElementById(clicked),\n create_innerHTML = \"<br />\",\n r_list = globe.getRecipes(),\n lines,\n plural,\n i;\n\n if (globe.getID(0)) {\n removeLink();\n }\n\n globe.user_search.value = \"\";\n globe.hint_span.innerHTML = \"\";\n globe.results_div.innerHTML = \"\";\n create_innerHTML += \"\" + r_list[clicked].toMake + \" Recipe<br /><table>\";\n create_innerHTML += \"<tr><th>ingredients</th><th>Amount</th><th>Mesure</th></tr>\"\n for (i = 0; i < r_list[clicked].ingredients.length; i += 1) {\n \n if (i % 2 === 0) {\n lines = \"even\";\n } else {\n lines = \"odd\"\n }\n \n if (r_list[clicked].ingredients[i].amount > 1) {\n plural = \"s\";\n } else {\n plural = \"\";\n }\n\n create_innerHTML += \"<tr>\"\n create_innerHTML += \"<td class=\\\"ingredients \" + lines + \"\\\">\" + r_list[clicked].ingredients[i].ingredient + \"</td>\";\n create_innerHTML += \"<td class=\\\"amount \" + lines + \"\\\">\" + r_list[clicked].ingredients[i].amount + \"</td>\";\n create_innerHTML += \"<td class=\\\"mesure \" + lines + \"\\\">\" + r_list[clicked].ingredients[i].mesure + plural + \"</td>\";\n create_innerHTML += \"</tr>\"\n }\n create_innerHTML += \"</table>\"\n \n globe.display_recipe.innerHTML = create_innerHTML;\n}", "function display_selected_recipes() {\n document.querySelector('#weather-filter-container').style.display = 'none';\n document.querySelector('#select-filters').style.display = 'block';\n document.querySelector('#recipes-title').style.display = 'block';\n document.querySelector('#grid-container').style.display = 'grid';\n window.recipes.forEach(recipe => {\n if (recipe['weather']) {\n recipe.style.display = 'block';\n } else {\n recipe.style.display = 'none';\n }\n });\n}", "function displayRecipes(responseJSON) {\n // console.log(responseJSON);\n\n // this clears out any pre-existing data\n $(\"#showRecipes\").html(\"<h3>Top Recipes</h3>\");\n\n var hitsArray = responseJSON.hits;\n var counter = 0;\n // var total = hitsArray.length;\n var total = 3;\n\n while(counter < total ) {\n\n // found in jsonp file i.e. https://api.edamam.com/search?q=chicken&app_id=21035d97&app_key=fd726687e4cfbcb844326f030aa3ed95\n var hit = hitsArray[counter];\n\n // each recipe has its subsection in the file\n var recipe = hit.recipe;\n\n // use the template function to get a list item\n var li = getRecipeListItem(recipe);\n\n // append the list item to our HTML\n // $(\"ul\").append(li);\n $(\"#showRecipes\").append(li);\n\n // increment the counter\n // to avoid infinite loops\n counter = counter + 1;\n }\n }", "function displayRecipes() {\n console.log(\"My recipes: \", recipes);\n}", "function displayResults(responseJson) {\n\n let recipeinfo = `\n <img src= ${responseJson.recipes[0].image} class=\"imgStyle\" alt=\"Recipe Photo\">\n <h2><span> ${responseJson.recipes[0].title}</span></h2>\n <p><span> Make Time: ${responseJson.recipes[0].readyInMinutes}</span></p>\n `\n $('.recipeScreen').html(recipeinfo)\n\n // Ingredient List\n $('.resultsList').empty();\n $('.resultsList').append(`<h3>Ingredient List:</h3>`);\n for (let i = 0; i < responseJson.recipes[0].extendedIngredients.length; i++) {\n $('.resultsList').append(`<li><p>${responseJson.recipes[0].extendedIngredients[i].name}</p>\n </li>`);\n }\n $('.resultsList').append(`\n <h3> Instructions: </h3>\n <p class=\"instructionBox\">${responseJson.recipes[0].instructions}</p>`);\n\n //display the results section\n $('.contentBox').hide();\n $('.recipePage').show();\n $('html,body').scrollTop(0);\n}", "function display_all(recipes) {\n recipes.forEach(recipe => {\n recipe['weather'] = true;\n });\n display_selected_recipes();\n}", "function displayRecipes(recipeData) {\n console.log(\"showing recipes\");\n $('#recipe-area').removeClass('hidden');\n $('#recipe-area').append(\n `<div class = \"results-header\">\n <p>What to Eat</p>\n </div>\n <section class= \"recipe-boxes\">\n <ul class=\"recipe\">\n <li><h3><a href=\"${recipeData.recipes[0].sourceUrl}\" target=\"_blank\">${recipeData.recipes[0].title}</a>\n <img src=\"${recipeData.recipes[0].image}\" alt=\"${recipeData.recipes[0].title} image\">\n </li>\n \n <li><h3><a href=\"${recipeData.recipes[1].sourceUrl}\" target=\"_blank\">${recipeData.recipes[1].title}</a>\n <img src=\"${recipeData.recipes[1].image}\" alt=\"${recipeData.recipes[1].title} image\">\n </li>\n \n <li><h3><a href=\"${recipeData.recipes[2].sourceUrl}\" target=\"_blank\">${recipeData.recipes[2].title}</a>\n <img src=\"${recipeData.recipes[2].image}\" alt=\"${recipeData.recipes[2].title} image\">\n </li>\n </ul>\n </section>`\n );\n}", "async function showRandomRecipes() {\n const recipes = await getRandomRecipes();\n await showRecipes(recipes);\n // randomShow = true; \n }", "function displayResults(responseJson,maxResults){\n // if there are previous results, remove them\n $('#results-list').empty();\n //check if there is any recipe return\n if(responseJson.count == 0){\n $('#results').removeClass('hidden');\n return $('#results-list').append('Sorry, Nothing is found! Please try reducing or change your keywords')\n }\n // iterate through the items array, show 6 at the beginning \n if (maxResults>6) {\n for (let i = 0; i < 6; i++){\n // for each video object in the items \n const currentID = \"list\" + i; \n $('#results-list').append(\n `<li class=\"item\" id='${currentID}'><h3>${responseJson.hits[i].recipe.label}</h3>\n <img src='${responseJson.hits[i].recipe.image}'>\n <br>\n <a href='${responseJson.hits[i].recipe.url}' target=\"_blank\">link for detail instruction</a>\n </li>`\n )\n generateList(responseJson.hits[i].recipe.ingredientLines, currentID, i)\n };\n $('#moreResults').append('<button id = \"load\" class=\"loadMore\">Load More</button>');\n loadMoreResults(responseJson);\n } \n // if maxRessults is less than 6, it will all display at once, no load more button\n else {\n for (let i = 0; i < maxResults; i++){\n // for each video object in the items \n const currentID = \"list\" + i; \n $('#results-list').append(\n `<li class=\"item\" id='${currentID}'> <h3>${responseJson.hits[i].recipe.label}</h3>\n <img src='${responseJson.hits[i].recipe.image}' alt='${responseJson.hits[i].recipe.label}'>\n <br>\n <a href='${responseJson.hits[i].recipe.url}' target=\"_blank\">link for detail instruction</a>\n </li>`\n )\n generateList(responseJson.hits[i].recipe.ingredientLines, currentID, i)\n };\n };\n //display the results section \n $('#results').removeClass('hidden');\n}", "function showRecipe() {\n grid.style.display = \"none\"\n\n var ingredients = [recipe.drinks[0].strIngredient1, recipe.drinks[0].strIngredient2, recipe.drinks[0].strIngredient3, recipe.drinks[0].strIngredient4, recipe.drinks[0].strIngredient5, recipe.drinks[0].strIngredient6, recipe.drinks[0].strIngredient7, recipe.drinks[0].strIngredient8, recipe.drinks[0].strIngredient9, recipe.drinks[0].strIngredient10, recipe.drinks[0].strIngredient11, recipe.drinks[0].strIngredient12, recipe.drinks[0].strIngredient13, recipe.drinks[0].strIngredient14, recipe.drinks[0].strIngredient15];\n var measure = [recipe.drinks[0].strMeasure1, recipe.drinks[0].strMeasure2, recipe.drinks[0].strMeasure3, recipe.drinks[0].strMeasure4, recipe.drinks[0].strMeasure5, recipe.drinks[0].strMeasure6, recipe.drinks[0].strMeasure7, recipe.drinks[0].strMeasure8, recipe.drinks[0].strMeasure9, recipe.drinks[0].strMeasure10, recipe.drinks[0].strMeasure11, recipe.drinks[0].strMeasure12, recipe.drinks[0].strMeasure13, recipe.drinks[0].strMeasure14, recipe.drinks[0].strMeasure15];\n\n recipeUl.innerHTML = recipe.drinks[0].strDrink\n var direction = document.createElement('li');\n direction.innerHTML = recipe.drinks[0].strInstructions\n recipeUl.appendChild(direction)\n for (let i = 0; i < ingredients.length; i++) {\n if (ingredients[i] !== null) {\n var recipeEl = document.createElement('li');\n recipeEl.innerHTML = ingredients[i] + \" \";\n recipeUl.appendChild(recipeEl);\n }\n if (measure[i] !== null) {\n var spanEl = document.createElement('span');\n spanEl.innerHTML = measure[i];\n recipeEl.appendChild(spanEl);\n }\n }\n glass.src = recipe.drinks[0].strDrinkThumb + \"/preview\";\n glassEl.appendChild(glass);\n\n}", "function printRecipeToScreen(recipeRead) {\n var seen = [];\n\n var tempOutput = JSON.stringify(recipeRead, function (key, val) {\n if (val != null && typeof val == \"object\") {\n if (seen.indexOf(val) >= 0) {\n return;\n }\n seen.push(val);\n }\n return val;\n })\n\n // This is an array of the FDA API queries for each ingredient\n var ingredients = JSON.parse(tempOutput)._docs;\n\n // Run through each FDA API query and compile information\n ingredients.forEach(sumNutrition);\n\n // Set the text element to display the recipe\n setRecipeOutput(ingredientList + '\\nTotal calories: ' + totalCalories);\n }", "function getRecipes() {\n // build new parent elements\n var newDialog = $(\"<dialog>\", {\n id: \"recipeList\"\n });\n var newDiv = $(\"<div>\", {\n class: \"queryResult\"\n });\n\n // build query\n var query =\n sQueryStr +\n \"search?intolerances=gluten&number=\" +\n $(\"#returnsSelect\")\n .find(\":selected\")\n .text() +\n \"&cuisine=\" +\n sQueryObject.queryCuisine +\n \"&type=\" +\n sQueryObject.queryCourse +\n \"&instructionsRequired=true&query=\" +\n sQueryObject.queryIngredients;\n sSettings.url = query;\n //console.log(query);\n $.ajax(sSettings).done(function(response) {\n if (response.results.totalResults == 0) {\n console.log(\"No recipes found. Please search again.\");\n newDiv.text(\n \"Sorry! I couldn't find a gluten free recipe that matched the search terms.\"\n );\n } else {\n // iterate through results and add recipes to list element inside of modal\n var newList = $(\"<ul>\");\n for (var i = 0; i < response.results.length; i++) {\n var newListItem = $(\"<li>\", {\n id: response.results[i].id,\n class: \"listItem\"\n });\n newListItem.text(response.results[i].title);\n newList.append(newListItem);\n console.log(response.results[i].title);\n }\n newDiv.append(newList);\n }\n newDialog.append(newDiv);\n // append dialog to #results and show\n $(\"#results\").append(newDialog);\n newDialog.show();\n });\n }", "function showRecipe(recipe) {\n\n // display index page inside recipe section\n const recipe_pages = document.getElementById('navigatingIndex');\n if (recipe_pages !== null) recipe_pages.innerHTML = navigatingIndex;\n\n let nutrients_labels = [],\n nutrients_values = [],\n nutrients_daily = [],\n recipe_calories = [],\n recipe_img_url = [],\n recipe_label = [];\n\n \n // check for a valid length of the array\n if (recipe.hits.length > 0) {\n\n const childNodes = plant_detail.childNodes;\n\n childNodes.forEach(node => {\n\n // if a node's style is defined\n node.style !== undefined ? \n\n // if the node's id is table_wrapper\n node.id === 'table_wrapper' ? \n (node.style.right = '-100%', node.style.position = 'absolute') :\n\n // or if the node's id is nutrientsChart\n node.id === 'nutrientsChart' ? \n (node.style.bottom = '0px') :\n\n // or if the node's id is recipe_wrapper\n node.id === 'recipe_wrapper' ? \n (node.style.zIndex = 2) :\n\n // otherwise\n (node.style.left = '-100%') :\n undefined;\n });\n \n // loop through the array\n for (let i = 0; i < recipe.hits.length; i++) {\n\n recipe_calories.push(recipe.hits[i].recipe.calories + 'kcal / serving');\n recipe_img_url.push(recipe.hits[i].recipe.image);\n recipe_label.push(recipe.hits[i].recipe.label);\n\n const recipe_digest = recipe.hits[i].recipe.digest;\n\n // loop through digest array\n for(let j = 0; j < recipe_digest.length; j++) {\n \n nutrients_labels.push(recipe_digest[j].label);\n nutrients_values.push(recipe_digest[j].total);\n nutrients_daily.push(recipe_digest[j].daily);\n }\n }\n\n \n // divide the total number of recipes into individual one\n const divided = nutrients_values.length / recipe.hits.length;\n\n // create next and previous buttons for the recipe detail navigations\n if (document.querySelector('.recipe_nav_buttons') === null)\n nextPrevButtons(recipe);\n else if (document.querySelector('.recipe_detail_img_container') !== null) {\n removeElements(document.getElementsByTagName('h4'));\n removeElements([document.querySelector('.recipe_detail_img_container')]);\n }\n \n const img = document.createElement('img'),\n img_div = document.createElement('div');\n img.src = recipe_img_url[navigatingIndex];\n img.className = 'recipe_detail_img'\n img_div.className = 'recipe_detail_img_container';\n img_div.style.display = 'block';\n\n // append the img to the img div\n img_div.appendChild(img);\n\n // create the title of the recipe\n const title = document.createElement('h4');\n title.innerHTML = recipe_label[navigatingIndex];\n \n // append the title to recipe_wrapper div as the first element\n recipe_wrapper.insertAdjacentElement('afterbegin', title);\n\n // append the img div to recipe_wrapper div as the next sibling of title header\n title.parentNode.insertBefore(img_div, title.nextSibling);\n\n // default value for the display, in order to show the first recipe\n nutrients_values = nutrients_values.slice(divided * navigatingIndex, divided * (navigatingIndex + 1));\n nutrients_labels = nutrients_labels.slice(divided * navigatingIndex, divided * (navigatingIndex + 1));\n\n // draw a chart with the total number of recipes,\n // all recipe's total values, all the corresponding labels, and healthy daily consumption of the nutrients\n chartData(nutrients_values, nutrients_labels, 2);\n }\n}", "function displayRecipes(apiData, ingredient){\n clearRecipes();\n recipeList = [];\n \n // gives the user a message if no recipes return from ingredient search\n if(apiData.meals == null){\n var recipe = document.createElement(\"div\");\n recipe.id = \"recipe-card\";\n \n var recipeName = document.createElement(\"p\");\n recipeName.id = \"rec-name\";\n ingredient = ingredient.replace(\"_\",\" \");\n recipeName.textContent = \"There are presently no recipes including \" + ingredient + \".\";\n\n recipe.appendChild(recipeName);\n recipeListEl.appendChild(recipe);\n }\n else{\n for(i=0; i<apiData.meals.length; i++){\n recipeList.push(apiData.meals[i].strMeal);\n }\n // automatically displays all recipes if there are less than 6 associated with an ingredient\n if(recipeList.length < 6){\n for(i=0; i<recipeList.length; i++){\n var recipe = document.createElement(\"div\");\n recipe.id = \"recipe-card\";\n \n var recipeName = document.createElement(\"p\");\n recipeName.id = \"rec-name\";\n recipeName.textContent = recipeList[i];\n \n var recipeBtnEl = document.createElement(\"button\");\n recipeBtnEl.id = \"rec-detail-btn\";\n recipeBtnEl.classList.add(\"btn\");\n recipeBtnEl.textContent = \"Get Details\";\n \n recipe.appendChild(recipeName);\n recipe.appendChild(recipeBtnEl);\n recipeListEl.appendChild(recipe);\n } \n }\n else {\n largeRecNum(ingredient);\n }\n }\n}", "function displayRecipe(response, content) { \n var ingredients = [];\n for(x=0; x<response.extendedIngredients.length; x++) {\n ingredients.push(response.extendedIngredients[x].name);\n }\n buttonCreate(content);\n recipeName(response);\n ingrList(ingredients);\n method(response);\n }", "function renderResult(result) {\n $('body').removeClass('background-image');\n\t//hides the start page after the results are rendered\n\t$('.js-start-page').addClass(\"hidden\");\n\t//grab the results div and display the result in html format\n\t$('.js-food-results').html(result);\n\t// declare a empty listItems array\n\tlet listItems = [];\n\t// loop through the results\n\tfor(var i = 0; i < result.hits.length && i < 5; i++) {\n\t\tconsole.log(result);\n\t\t//returns the ingredients and returns the list we use map\n\t\tlet recipes = result.hits[i].recipe.ingredients.map(function(ingredient){\n\t\t\treturn `<li>${ingredient.text}</li>`;\n\t\t});\n let listItem =\n `<div class =\"js-food-item\"> \n <!--IMAGE -->\n <div style=\"background-image: url(${result.hits[i].recipe.image}); background-size:cover; background-position: center; height: 500px; width: 100%; background-repeat: no-repeat\"> </div> \n <!--ingr-->\n <h1>${result.hits[i].recipe.label}</h1>\n <!--.join(\"\") removes the commas since we are working with an array -->\n <ul>${recipes.join(\"\")}</ul>\n <!--SOURCE-->\n <a class=recipes href=\"${result.hits[i].recipe.url}\" target=\"_blank\">Learn more about the recipe</a>\n </div>`\n\t// grab the listItems and push in to the listItem\n listItems.push(listItem);\n// push the listItem to listItems array\n\t// result.hits[i].uri\n\t// we make a object to store the data\n\tlet recipe = {\n uri: \"\",\n label: \"\",\n image:\"\",\n source:\"\",\n url:\"\",\n ingr:\"\",\n }\n}\n$('.js-food-results').html\n(listItems.join(''));\nconsole.log(result);\n}", "function displayIngredientSearch(clicked) {\n var clicked_recipe = document.getElementById(clicked).innerHTML,\n results_string = \"\",\n r_list = globe.getRecipes(),\n i,\n j;\n\n globe.hint_span.innerHTML = \" Recipes containing \" + clicked_recipe;\n globe.user_search.value = \"\";\n removeLink();\n \n for (i = 0; i < r_list.length; i += 1) {\n for (j = 0; j < r_list[i].ingredients.length; j += 1) {\n if (r_list[i].ingredients[j].ingredient === clicked_recipe) {\n\n results_string += \"<p id=\\\"\" + i.toString() + \"\\\">\" + r_list[i].toMake + \"</p>\";\n globe.addID(i.toString());\n break;\n }\n }\n }\n\n globe.results_div.innerHTML = results_string;\n globe.search_type_name.checked = true;\n globe.search_type_ingredient.checked = false;\n createLink();\n}", "async function showDiyRecipes() {\n const diyRecipes = await getDiyList();\n\n for (let rec of diyRecipes) {\n generateDiyRecipeHTML(rec);\n }\n currentMealList = diyRecipes;\n }", "function displayNutrientResults (responseJson) {\n console.log(responseJson);\n // if there are previous results, remove them\n $('#results-list').empty();\n // iterate through the foods array\n for (let i = 0; i < responseJson.foods.length; i++){\n $('#results-list').append(\n //full name, description, website url\n `<li class=\"nutrients\"><h3>${responseJson.foods[i].food_name}</h3>\n <p>Calories: ${responseJson.foods[i].nf_calories}</p>\n <p>Protein: ${responseJson.foods[i].nf_protein}</p>\n <p>Carbohydrates: ${responseJson.foods[i].nf_total_carbohydrate}</p>\n <p>Fat: ${responseJson.foods[i].nf_total_fat}</p>\n </li>`\n )};\n //display the results section \n $('#results').removeClass('hidden');\n }", "function displayRecommendations(results) {\n\trecommendationsContainer.insertAdjacentHTML('beforeend', \"<h1> Recommendations </h1>\");\n\n\tvar green = results.green;\n\tvar yellow = results.yellow;\n\tvar red = results.red;\n\n\tvar result;\n\n\trecommendationsContainer.insertAdjacentHTML('beforeend', \"<p> RECOMMENDED: </p>\")\n\n\tfor (var i = 0; i < green.length; i ++) {\n\t\tresult = returnMethod(green[i].id);\n\t\tdisplayGreenResult(result);\n\t}\n\n\trecommendationsContainer.insertAdjacentHTML('beforeend', \"<p> OTHER POSSIBLE: </p>\")\n\n\n\tfor (i = 0; i < yellow.length; i ++) {\n\t\tresult = returnMethod(yellow[i].id);\n\t\tdisplayYellowResult(result);\n\t}\n\n\trecommendationsContainer.insertAdjacentHTML('beforeend', \"<p> NOT RECOMMENDED: </p>\")\n\n\tfor (i = 0; i < red.length; i ++) {\n\t\tresult = returnMethod(red[i].id);\n\t\tdisplayRedResult(result);\n\t}\n}", "function writeToDocument(type) {\n let resultsCount = document.getElementById(\"resultsCount\");\n let el = document.getElementById(\"data\");\n el.innerHTML = \"\";\n resultsCount.innerHTML = \"\";\n getData(type, function (data) { \n data = data.hits;\n console.dir(data);\n resultsCount.innerHTML = `<h3> ${data.length} Recipes for ${type}</h3>`;\n for (let item = 0; item < data.length; item++) {\n el.innerHTML += `\n <div class=\"recipe-card\">\n <img src=\"${data[item].recipe.image}\" alt=\"Dish Image\">\n <h5>${data[item].recipe.label}<span>By (${data[item].recipe.source})</span></h5>\n <div class=\"description\">\n <div class=\"item1 left-padding\"><p>Origin :<span>${data[item].recipe.cuisineType}</span></p></div>\n <div class=\"item2 left-padding\"><p>Course :<span>${data[item].recipe.dishType}</span></p></div>\n <div class=\"item3 left-padding\"><p>Calories : <span>${Math.floor(data[item].recipe.calories)} kcal</span></p></div>\n <div class=\"item4 left-padding\"><p>Number Of Serving :<span> ${data[item].recipe.yield}</span></p></div>\n </div>\n <div><a href=\"${data[item].recipe.url}\" target=\"_blank\"><button class=\"view\">Go To Recipe</button></a></div>\n </div>\n `;\n }\n \n });\n\n}", "function renderRecipes(results) {\n if (results.length === 0) {\n let noResult = document.createElement(\"h2\");\n noResult.classList.add(\"white-text\", \"mt-5\", \"text-center\");\n noResult.textContent= \"No results found! Try another search.\";\n document.querySelector(\"#no-result\").appendChild(noResult);\n }\n\n let cardIndividual = document.querySelector(\"#individual-recipe\");\n for (let i = 0; i < results.length; i++) {\n // Make the column for each card\n let cardCol = document.createElement(\"div\");\n cardCol.classList.add(\"d-flex\", \"col\", \"col-md-5\", \"mx-auto\", \"mt-2\", \"mb-4\");\n let card = document.createElement(\"div\");\n card.classList.add(\"card\");\n card.setAttribute(\"id\", \"card\" + i);\n card.setAttribute(\"data-target\", \"#recipe-info\")\n card.setAttribute(\"data-toggle\", \"modal\")\n\n // Make each card image and body\n let cardImg = document.createElement(\"img\");\n let cardBody = document.createElement(\"div\");\n cardBody.classList.add(\"card-body\");\n let cardTitle = document.createElement(\"h4\");\n cardTitle.classList.add(\"card-title\");\n let cardText = document.createElement(\"h5\");\n cardText.classList.add(\"card-text\");\n let cardButton = document.createElement(\"a\");\n cardButton.classList.add(\"btn\", \"btn-pink\");\n cardButton.textContent = \"Get Recipe\";\n cardBody.appendChild(cardTitle);\n cardBody.appendChild(cardText);\n cardBody.appendChild(cardButton);\n card.appendChild(cardImg);\n card.appendChild(cardBody);\n cardCol.appendChild(card);\n cardIndividual.appendChild(cardCol);\n \n // Add the recipe name and convert total cook time to minutes\n cardTitle.textContent = results[i].recipeName;\n let time = results[i].totalTimeInSeconds;\n let min = Math.floor(time % 3600 / 60);\n let minDisplay = min > 0 ? min + (min === 1 ? \" minute \" : \" minutes \") : \"\";\n cardText.textContent = \"Cooking Time: \" + minDisplay;\n\n // Create the URL for getting each individual recipe\n resultSearch.recipeID = results[i].id;\n let recipeDetailUrl = RECIPE_DETAIL_URL.replace(\"{recipeID}\", resultSearch.recipeID);\n \n // Fetch the individual recipe image\n fetch(recipeDetailUrl)\n .then(handleResponse)\n .then(renderRecipeInfo)\n .catch(handleError);\n \n // Gets and sets the recipe image from the API\n // If there's no image, set it to the default N/A\n function renderRecipeInfo(recipeinfo) {\n resultSearch.recipeImg = recipeinfo.images[0].hostedLargeUrl;\n if (resultSearch.recipeImg) {\n // Sometimes returns HTTP instead of HTTPS, resulting in console warnings\n // Please ignore (since it's not our fault but yummly's)\n cardImg.src = resultSearch.recipeImg;\n } else { \n cardImg.src = \"img/knife_and_fork.png\";\n }\n // When the user clicks on the card, display extra recipe\n // information and a link to the external recipe.\n document.querySelector(\"#card\" + i).addEventListener(\"click\", function(){\n document.querySelector(\".modal-title\").textContent = recipeinfo.name;\n if (recipeinfo.images[0].hostedLargeUrl) {\n document.querySelector(\"#modal-img\").src = recipeinfo.images[0].hostedLargeUrl;\n } else {\n document.querySelector(\"#modal-img\").src = \"\";\n }\n var array = recipeinfo.ingredientLines;\n document.getElementById(\"ingredients\").innerHTML = '<ul><li>' + array.join(\"</li><li>\"); + '</li></ul>';\n document.querySelector(\"#rating\").textContent = recipeinfo.rating + \" / 5\";\n document.querySelector(\"#instruction\").href = recipeinfo.source.sourceRecipeUrl;\n }); \n } \n }\n}", "displayRecipe(ingredientsJSON, stepsJSON, note)\n {\n const ingredients = ingredientsJSON.extendedIngredients.map((ingredient) => {\n return `<li> ${ingredient.measures.us.amount} ${ingredient.measures.us.unitLong} ${ingredient.name}</li>`;\n } ).join('');\n const steps = stepsJSON[0].steps.map((step) => {\n return `<li> ${step.number} ${step.step} </li>`;\n } ).join('');\n \n let displayResults = `<h1>${ingredientsJSON.title}</h1>\n <img src=\"${ingredientsJSON.image}\" alt=\"Dish image\">\n <p>Servings: ${ingredientsJSON.servings}</p>\n <p>Ready in ${ingredientsJSON.readyInMinutes} Minutes</p>\n <a href=\"${ingredientsJSON.sourceUrl}\">Source: ${ingredientsJSON.creditsText} </a>\n <h2>Ingredients</h2>\n <ul id=\"ingredientsList\">\n ${ingredients}\n </ul>\n <h2>Instructions</h2>\n <ul id=\"steps\">\n ${steps}\n </ul>\n <p id=\"idPlaceHolder\">${ingredientsJSON.id}</p>\n <p> ${note}</p>`; \n \n document.getElementById('recipe').innerHTML = displayResults;\n document.getElementById(\"main\").classList.toggle(\"slide\");\n }", "function displayRecipe(data) {\n var Recipe = data.meals[0];\n var RecipeDiv = document.getElementById(\"event-list-group\");\n \n var recipeContainer = document.createElement(\"div\");\n $(recipeContainer).addClass(\"recipe-container columns\");\n\n var RecipeImg = document.createElement(\"img\");\n RecipeImg.id = \"::img\";\n RecipeImg.style.cssText = \"width:300px;height:300px;\";\n $(RecipeImg).addClass(\"inline-img col-auto\");\n RecipeImg.src = Recipe.strMealThumb;\n recipeContainer.appendChild(RecipeImg);\n\n var contentDiv = document.createElement(\"div\");\n $(contentDiv).addClass(\"col-auto\");\n\n var RecipeIngredients = document.createElement(\"ul\");\n $(RecipeIngredients).addClass(\"inline-ul\");\n contentDiv.appendChild(RecipeIngredients);\n\n recipeContainer.appendChild(contentDiv);\n\n RecipeDiv.appendChild(recipeContainer);\n\n $(\"<label>\")\n .addClass(\"form-checkbox\")\n .html(\"<input class='recipe-checkbox' type='checkbox'><i class='form-icon'></i> Add Recipe\")\n .appendTo(contentDiv);\n\n\n var getIngredients = Object.keys(Recipe)\n .filter(function (ingredient) {\n return ingredient.indexOf(\"strMeal\") == 0;\n })\n .reduce(function (ingredients, ingredient) {\n if (Recipe[ingredient] != null) {\n ingredients[ingredient] = Recipe[ingredient];\n }\n return ingredients;\n }, {});\n\n var getArea = Object.keys(Recipe)\n .filter(function (ingredient) {\n return ingredient.indexOf(\"strArea\") == 0;\n })\n .reduce(function (ingredients, ingredient) {\n if (Recipe[ingredient] != null) {\n ingredients[ingredient] = Recipe[ingredient];\n }\n return ingredients;\n }, {});\n\n var getCategory = Object.keys(Recipe)\n .filter(function (ingredient) {\n return ingredient.indexOf(\"strCategory\") == 0;\n })\n .reduce(function (ingredients, ingredient) {\n if (Recipe[ingredient] != null) {\n ingredients[ingredient] = Recipe[ingredient];\n }\n return ingredients;\n }, {});\n\n var getSource = Object.keys(Recipe)\n .filter(function (ingredient) {\n return ingredient.indexOf(\"strSource\") == 0;\n })\n .reduce(function (ingredients, ingredient) {\n if (Recipe[ingredient] != null) {\n ingredients[ingredient] = Recipe[ingredient];\n }\n return ingredients;\n }, {});\n\n var getVideo = Object.keys(Recipe)\n .filter(function (ingredient) {\n return ingredient.indexOf(\"strYoutube\") == 0;\n })\n .reduce(function (ingredients, ingredient) {\n if (Recipe[ingredient] != null) {\n ingredients[ingredient] = Recipe[ingredient];\n }\n return ingredients;\n }, {});\n\n let value = getIngredients[\"strMeal\"];\n listItem = document.createElement(\"li\");\n listItem.innerHTML = value;\n RecipeIngredients.appendChild(listItem);\n\n let area = getArea[\"strArea\"];\n listItem = document.createElement(\"li\");\n listItem.innerHTML = area;\n RecipeIngredients.appendChild(listItem);\n\n let category = getCategory[\"strCategory\"];\n listItem = document.createElement(\"li\");\n listItem.innerHTML = category;\n RecipeIngredients.appendChild(listItem);\n\n let recipeSource = getSource[\"strSource\"];\n if (recipeSource) {\n var link = $(\"<li>\").appendTo(listItem);\n $(\"<a>\")\n .text(\"Recipe Link\")\n .attr(\"href\", `${recipeSource}`)\n .attr(\"target\", \"_blank\")\n .appendTo(link);\n }\n\n let recipeVideo = getVideo[\"strYoutube\"];\n if (recipeVideo) {\n var videolink = $(\"<li>\").appendTo(listItem);\n $(\"<a>\")\n .text(\"Recipe YouTube Video\")\n .attr(\"href\", `${recipeVideo}`)\n .attr(\"target\", \"_blank\")\n .appendTo(videolink);\n }\n}", "displayDrinksWithIngredients(drinks){\n\n // show the results field\n const resultsWrapper = document.querySelector('.results-wrapper');\n resultsWrapper.style.display = 'block';\n\n // insert the results\n const resultsDiv = document.querySelector('#results');\n\n drinks.forEach(drink => {\n resultsDiv.innerHTML += `\n <div class=\"col-md-6\">\n <div class=\"card my-3\">\n\n <img class=\"card-img-top\" src=\"${drink.strDrinkThumb}\" alt=\"${drink.strDrink}\">\n\n <div class=\"card-body\">\n <h2 class=\"card-title text-center\">${drink.strDrink}</h2>\n <p class=\"card-text font-weight-bold\">Instructions: </p>\n <p class=\"card-text\">\n ${drink.strInstructions}\n </p>\n <p class=\"card-text\">\n <ul class=\"list-group\">\n <li class=\"list-group-item alert alert-danger\">Ingredients</li>\n ${this.displayIngredients(drink)}\n </ul>\n </p>\n <p class=\"card-text font-weight-bold\">Extra Information:</p>\n <p class=\"card-text\">\n <span class=\"badge badge-pill badge-success\">\n ${drink.strAlcoholic}\n </span>\n <span class=\"badge badge-pill badge-warning\">\n Category: ${drink.strCategory}\n </span>\n </p>\n </div>\n </div>\n </div>\n `;\n })\n }", "function renderResults() {\n\n // Get the current recipe and the current movie.\n var recipe = currentPair.getCurrentRecipe();\n var movie = currentPair.getCurrentMovie();\n\n // Populate the recipe card elements with our current recipe. \n $(\"#recipe-result > img\").attr(\"src\", recipe.imgSrc);\n $(\"#recipe-title\").text(recipe.title);\n $(\"#recipe-source\").text(recipe.source);\n $(\"#view-recipe-button\").attr(\"href\", recipe.url);\n\n // Iterate through recipe's ingredients and append to hidden dropdown div.\n $.each(recipe.ingredients, function (i, ingredient) {\n var li = $(\"<li>\" + ingredient + \"</li>\");\n $(\"#ingredient-list\").append(li);\n });\n\n // Populate the movie card with the recommended movie\n $(\"#movie-title\").text(movie.title);\n $(\"#movie-year\").text(movie.year);\n $(\"#movie-result > img\").attr(\"src\", movie.imgSrc);\n $(\"#movieplot-text\").text(movie.plot); \n $(\"#view-movie-button\").attr(\"href\", \"https://play.google.com/store/search?q=\" + movie.title + \"&c=movies&hl=en\");\n\n}", "function displayResults(resJson) {\n // if there are previous results, remove them\n $(\"#starting-screen\").hide();\n $(\"#js-error-screen\").empty();\n // iterate through the items array\n\n let records = shuffleArray(resJson.records);\n let ages = {};\n let races = {};\n let genders = {};\n records.forEach((record) => {\n if (genders[record.fields.gender]) {\n genders[record.fields.gender]++;\n } else {\n genders[record.fields.gender] = 1;\n }\n if (races[record.fields.raceethnicity]) {\n races[record.fields.raceethnicity]++;\n } else {\n races[record.fields.raceethnicity] = 1;\n }\n const age = Math.floor(record.fields.computedmissingmaxage / 10) * 10;\n if (ages[age]) {\n ages[age]++;\n } else {\n ages[age] = 1;\n }\n });\n createAgeChart(ages);\n createRaceChart(races);\n createPieChart(genders);\n\n state.records = records;\n state.page = 0;\n if (records.length > 10) {\n records = records.slice(0, 10);\n }\n\n renderItems(records);\n\n // 7. display new search button\n // 8. Show CTA message to user\n $(\"#new-search-section\").append(\n `<section class=\"new-search-container\">\n <h2 class=\"message-footer title\">Want to search in a new location?</h2>\n <button class=\"new-search-btn\">Let's Go!</button>\n </section>`\n );\n //display the results section\n $(\".results-txt\").removeClass(\"hidden\").show();\n $(\".results-container\").removeClass(\"hidden\").show();\n $(\".results\").show();\n $(\"#new-search-section\").show();\n}", "async function renderAllRecipes() {\n let allRecipes = await retrieveAllRecipes();\n await renderBreakfast(allRecipes);\n await renderAppetizers(allRecipes);\n await renderSalads(allRecipes);\n await renderMDBeef(allRecipes);\n await renderMDChicken(allRecipes);\n await renderMDPork(allRecipes);\n await renderMDSeafood(allRecipes);\n await renderMDVegetarian(allRecipes);\n await renderBeverages(allRecipes);\n await renderDesserts(allRecipes);\n}", "function _drawResults() {\n let songs = store.State.songs;\n console.log(songs);\n let template = \"\";\n songs.forEach(song => (template += song.Template));\n document.getElementById(\"search-results\").innerHTML = template;\n}", "function _drawResults() {\n let template = ''\n let results = store.State.songs\n results.forEach(song => template += song.Template)\n document.querySelector(\"#songs\").innerHTML = template\n}", "function runRecipes(ingrSearch) {\n \n // Construct new query string with user inputs\n var newURL = baseQuery + ingrSearch + \"&app_id=\" + appId + \"&app_key=\" + apiKey;\n\n // Ajax call to Edamam API to grab recipes\n $.ajax({\n url: newURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(response);\n\n // List each recipe\n var numRecipes = response.hits.length;\n console.log(numRecipes);\n for (var i = 0; i < numRecipes; i++) {\n\n // Create div to dynamically list recipes\n var recipeDiv = $(\"<div class='mb-5'>\");\n // Label tag for recipes\n var recipeLabel = $(\"<h3 class='text-center'>\").text(response.hits[i].recipe.label);\n // Image tag for recipes\n var recipeImg = $(\"<img class='resimg img-round'>\");\n recipeImg.attr(\"src\",response.hits[i].recipe.image);\n\n // List ingredients \n var getIngr = response.hits[i].recipe.ingredientLines;\n\n var recipeIngrs = $(\"<span class='ingredients'>\").text(\"Ingredients: \" + getIngr);\n\n // Create anchor tag for the recipeDiv\n var recipeAnchor = $(\"<a>\");\n // Set src attribute of recipe URL to the anchor tag\n recipeAnchor.attr(\"href\", response.hits[i].recipe.url);\n recipeAnchor.attr(\"target\", \"_blank\")\n console.log(response.hits[i].recipe.url); \n\n // Append label to the recipeAnchor\n recipeAnchor.append(recipeLabel);\n\n // Append label, image, ingredients to the recipe div\n recipeDiv.append(recipeAnchor);\n recipeDiv.append(recipeImg);\n recipeDiv.append(recipeIngrs);\n \n // Adding the button to the HTML\n $(\".recipeList\").append(recipeDiv);\n };\n });\n}", "function renderModalSearchRecipe (recipes) {\n\n globalRecipe = []\n\n let edamamApiRecipe = {\n\n name: recipes.hits[0].recipe.label,\n\n calories: recipes.hits[0].recipe.calories,\n\n healthLabels: recipes.hits[0].recipe.healthLabels,\n\n source: recipes.hits[0].recipe.source,\n\n sourceUrl: recipes.hits[0].recipe.url,\n\n imgUrl: recipes.hits[0].recipe.image,\n\n ingredients: recipes.hits[0].recipe.ingredientLines,\n\n yield: recipes.hits[0].recipe.yield\n\n }\n\n globalRecipe.unshift(edamamApiRecipe)\n\n let ingredientsFormattedList = renderIngredient(edamamApiRecipe.ingredients)\n\n let preDbRecipeModal = (`\n\n <div class='modal modal-transparent fade tempModal' tabindex='-1' role='dialog' id='recipeModal'>\n\n <div class='modal-dialog'>\n\n <div class='recipe' data-recipe-id=''>\n\n <div class='col-md-12 recipeBox'>\n\n <div class='col-md-5 thumbnail'>\n\n <img src='${edamamApiRecipe.imgUrl}' alt='recipe image'>\n\n </div>\n\n <div class='col-md-6 caption'>\n\n <h4 class='inline-header'><strong>${edamamApiRecipe.name}</strong></h4>\n\n <p>via<a href='${edamamApiRecipe.sourceUrl}'> ${edamamApiRecipe.source}</a></p>\n\n <h4 class='inline-header'><strong>Ingredients:</strong></h4>\n\n <ul>${ingredientsFormattedList}</ul>\n\n <h4 class='inline-header'><strong>Yield:</strong></h4>\n\n <ul>${edamamApiRecipe.yield}</ul>\n\n <div class='bottom-align-buttons'>\n\n <button type='button' class='btn btn-primary add-recipe'><span class='icon'><i class='fa fa-plus'></i></span> Add This Recipe</button>\n\n <button type='button' class='btn btn-danger close-recipe'><span class='icon'><i class='fa fa-trash-o'></i></span> Not This Recipe</button>\n\n </div>\n\n </div>\n\n </div>\n\n </div>\n\n </div>\n\n </div>\n\n `)\n\n $('#modals').prepend(preDbRecipeModal)\n\n $('#recipeModal').modal('show')\n\n}", "async function showLikedRecipes() {\n const likedRecipes = await getLikedRecipes();\n await showRecipes(likedRecipes);\n }", "function getMeSomeRecipes(findings) {\n for (let i = 0; i < 10; i++) {\n // Recipe Image\n let imgUrl = findings.hits[i].recipe.image;\n let img = document.createElement(\"img\");\n img.setAttribute(\"src\", imgUrl);\n //Recipe Label\n let labelName = findings.hits[i].recipe.label;\n let label = document.createElement(\"a\");\n let labelhref = findings.hits[i].recipe.url;\n label.setAttribute(\"href\", labelhref);\n label.innerText = labelName;\n //Recipe Calories\n let caloriesNumber = findings.hits[i].recipe.calories;\n let calories = document.createElement(\"p\");\n calories.innerText = `Only ${Math.round(caloriesNumber)} calories!`;\n\n //Recipe Div\n let recipediv = document.createElement(\"div\");\n // recipediv.appendChild(img);\n // recipediv.appendChild(label);\n // recipediv.appendChild(calories);\n recipediv.append(img, label, calories);\n\n //last one below\n endPoint.appendChild(recipediv);\n recipediv.setAttribute(\"class\", \"plate\");\n }\n}", "function displayItems(n) {\n let randDefs = [];\n for(let i = 5*(n-1); i < 5*n; i++) {\n termID = 'term' + ((i+1) - (5 * (n - 1)));\n document.getElementById(termID).innerHTML = terms[currLevel][i]['name'];\n\n randDefs[(i) - (5 * (n - 1))] = defs[currLevel][i]['name'];\n }\n\n randDefs[5] = defs[currLevel][20 + ((n*2) - 2)]['name'];\n randDefs[6] = defs[currLevel][20 + (n*2) - 1]['name'];\n randDefs = randomize(randDefs);\n for(let i = 0; i < 7; i++) {\n defID = 'def' + (i+1);\n document.getElementById(defID).innerHTML = randDefs[i];\n }\n\n setHeight();\n }", "function displayBookRecommendation(data) {\n const results = data.results.map((item, index) => renderInitialResult(item));\n $(`.book-results`).html(results);\n}", "function renderResults(){\n resultsContent.innerHTML = '';\n viewResultsButton.innerHTML = '';\n for(let i =0; i < allItems.length; i++){\n let p = document.createElement('p');\n p.textContent = `${allItems[i].name} : ${allItems[i].clicked} / ${allItems[i].viewed}`;\n viewResultsButton.appendChild(p);\n }\n}", "function displayExerciseResults (responseJson) {\n console.log(responseJson);\n // if there are previous results, remove them\n $('#exercise-list').empty();\n // iterate through the foods array\n for (let i = 0; i < responseJson.exercises.length; i++){\n $('#exercise-list').append(\n //full name, description, website url\n `<li class=\"calories_burned\"><h3>${responseJson.exercises[i].user_input}</h3>\n <p>Calories Burned: ${responseJson.exercises[i].nf_calories}</p>\n </li>`\n )};\n //display the results section \n $('#exerciseResults').removeClass('hidden');\n }", "function showRecipe( index ){\n //console.log(index);\n window.selectedRecipeId = window.allRecipes[index].recipe_id;\n $(\"#procedure\").empty();\n $(\"#procedure\").html('<h1>' + window.allRecipes[index].recipe_name + '</h1>')\n $(\"#procedure\").append(window.allRecipes[index].directions);\n}", "function getRecipes () {\n setRecipes(recipesData)\n }", "function displayResults(myJSON, jsonLength) {\n let current_value = \"\";\n let foodID = \"\";\n let foodTitle = \"\";\n let foodImage;\n /*$(‘#foodModal’).modal(‘show’);*/\n $(\".foodListItem\").remove();\n for (i = 0; i < jsonLength; i++) {\n foodID = myJSON.results[i].id;\n foodTitle = myJSON.results[i].title;\n foodFat = myJSON.results[i].fat;\n foodCarbs = myJSON.results[i].carbs;\n foodProtein = myJSON.results[i].protein;\n foodImage = myJSON.results[i].image;\n var tempDiv = document.createElement(\"li\");\n $(tempDiv).attr(\"id\", foodID);\n $(tempDiv).addClass(\"foodListItem\");\n var secondaryDiv = document.createElement(\"div\");\n var foodDescription = document.createElement(\"p\");\n $(foodDescription).text(`Title: ${foodTitle}`);\n $(tempDiv).append(foodDescription);\n $(secondaryDiv).addClass(\"img-container\");\n var tempIMG = document.createElement(\"img\");\n $(tempIMG).attr(\"src\", foodImage);\n $(secondaryDiv).append(tempIMG);\n $(tempDiv).append(secondaryDiv);\n $(\"#recipeList\").append(tempDiv);\n /* $(tempIMG).css({ height: \"10%\", width: \"auto\" }); */\n }\n}", "function getRecentRecipes(qty=defaultMaxResults){\n //retrieves specified number of most recent recipes\n const url = formatFetchUrl('recent');\n\n fetch(url)\n .then(response => {\n if(response.ok){\n return response.json();\n }\n throw new Error();\n })\n .then(responseJson => {\n if(responseJson.meals.length > 0){\n let count = 0;\n const meals = responseJson.meals;\n while(count < qty){\n $('#recipes-list').append(`\n <div class=\"recipe-grid-square\" id=\"recipe-${meals[count]['idMeal']}\">\n <a href=\"javascript:loadFullRecipe(${meals[count]['idMeal']})\">\n <img src=\"${meals[count]['strMealThumb']}\" alt=\"Image of ${meals[count]['strMeal']}\" title=\"${meals[count]['strMeal']}\" class=\"recipe-grid-img\">\n <br>\n <p>${meals[count]['strMeal']}</p>\n </a>\n </div>\n `);\n count++;\n }\n }\n })\n .catch(error => {\n //$('#search-progress').text(`Sorry, there was an error: ${error.message}`);\n });\n}", "function fetchRecipes() {\n tool.forEach(data.menu.sections, function(section) {\n section.recipes = tool.map(section.recipes, function(id) {\n return fetchRecipe(id);\n });\n });\n }", "function renderNumberOfResults() {\n numberOfResultsWithHidden = (allResultsObject.length) - (hiddenElements.length);\n renderResultsNumber.textContent = `${numberOfResultsWithHidden > 1 ? numberOfResultsWithHidden + ' Results' : numberOfResultsWithHidden + ' Result'}`;\n if(numberOfResults> 1 && numberOfResultsWithHidden === 0){\n manageState.setAttribute(\"class\",\"card shadow\")\n manageState.innerHTML = `<div class=\"card-body\">\n <div class=\"d-flex justify-content-center\" id=\"emptyState\">\n <img class=\"img-fluid\" src=\"img/search-for-course.png\" width=\"400\" height=\"319\">\n </div>\n <p class=\"text-center\">No results found</p>\n </div>`\n }else if(numberOfResultsWithHidden > 0){\n manageState.removeAttribute(\"class\");\n manageState.innerHTML = '';\n }\n}", "displayDrinksWithIngredients(drinks){\n // show the results\n const resultsWrapper = document.querySelector('.results-wrapper');\n resultsWrapper.style.display = 'block';\n\n // insert results\n const resultsDiv = document.querySelector('#results');\n\n drinks.forEach(drink => {\n resultsDiv.innerHTML += `\n <div class=\"col-md-4\">\n <div class=\"card my-3\">\n <button type=\"button\" data-id=\"${drink.idDrink}\" class=\"favorite-btn btn btn-outline-info\">\n + \n </button> \n <img class=\"card-img-top\" src=\"${drink.strDrinkThumb}\" alt=\"${drink.strDrink}\">\n </div> \n <div class=\"card-body\">\n <h2 class=\"card-title text-center\">${drink.strDrink}</h2>\n <p class=\"card-text font-weight-bold\">Instructions:</p>\n <p class=\"card-text\">\n ${drink.strInstructions}\n </p>\n\n <p class=\"card-text\">\n <ul class=\"list-group\">\n <li class=\"list-group-item alert alert-danger\">Ingredients</li>\n ${this.displayIngredients(drink)}\n </ul>\n </p>\n <p class=\"card-text\">\n <span class=\"badge badge-pill badge-success\">\n ${drink.strAlcoholic}\n </span>\n <span class=\"badge badge-pill badge-warning\">\n Category: ${drink.strCategory}\n </span>\n </p>\n </div>\n </div>\n `;\n\n });\n this.isFavorite();\n\n }", "function renderResults(results) {\n\t$('.js-results').html(`You answered <span>${results}</span> out of 10 questions correctly!`);\n}", "displayDrinks(drinks){\n // Show the Results\n const resultsWrapper = document.querySelector('.results-wrapper');\n resultsWrapper.style.display = 'block';\n\n // insert the Results\n const resultsDiv = document.querySelector('#results');\n\n // loop throught Drinks\n drinks.forEach( drink => {\n // Build the Template\n resultsDiv.innerHTML += `\n <div class=\"col-md-5\">\n <div class=\"card-my-3\">\n <button type=\"button\" data-id=\"${drink.idDrink}\" class=\"favorite-btn btn btn-outline-info \">\n +\n </button>\n <img class=\"card-img-top\" src=\"${drink.strDrinkThumb}\" alt=\"${drink.strDrink}\" >\n </div>\n <div class=\"card-body\">\n <h2 class=\"card-title text-center\">${drink.strDrink} </h2>\n <a data-target=\"#recipe\" class=\"btn btn-success get-recipe\" href=\"#\" data-toggle=\"modal\" data-id=\"${drink.idDrink}\">\n Get Recipe </a>\n </div>\n \n </div>\n \n `;\n });\n this.isFavorite();\n\n }", "function updateResultsListing() {\n\n var listingText,\n allItems = yearDimension.top(Infinity),\n makeSceneLink = function (scene) {\n if (scene !== '[Non-panorama history]')\n return '<a target=\"_blank\" href=\"' + \n SCENE_URL_BASE + scene + '\">' + scene + \n '</a>';\n else return scene;\n };\n\n // Update results count\n\n $('#active').text(allItems.length);\n\n // List entries in results box\n\n $('#resource-list').empty();\n\n yearDimension.top(INIT_LISTING_COUNT).forEach(function (item) {\n listingText = '<p>' +\n '<strong>' +\n '<a href=\"' + RESOURCE_URL_BASE + item.URLID + '\" target=\"_BLANK\">' + \n item.short_title + '</a>' +\n '</strong>' +\n ' (' + item.year.getFullYear() + ')<br />' +\n (item.author ? item.author + '<br />' : '') +\n 'Scenes: ' + item.scene.map(makeSceneLink).join(', ') +\n '</p>';\n $('#resource-list').append(listingText); \n }); \n }", "function recipeInformationHTML(results) {\n let arr = [];\n let i;\n let recipes = $(results.results);\n\n if(page <= 1) {\n $(\"#previous\").addClass(\"disable\");\n } else {\n $(\"#previous\").removeClass(\"disable\");\n }\n\n if(recipes.length < 10) {\n $(\"#next\").addClass(\"disable\");\n } else {\n $(\"#next\").removeClass(\"disable\");\n }\n\n // If there are no recipes matching the search criteria, return an error message\n if(recipes.length === 0) {\n $(\"#recipe\").html(`<h2 class=\"search-title\">We can't find what you're looking for!</h2>`);\n removeButtons();\n\n return;\n }\n\n for(i = 0; i < recipes.length; i++) {\n arr.push(`\n <div class=\"recipe-card box-shadow d-block\">\n <div class=\"container\">\n <div class=\"row\">\n <div class=\"col-12\">\n <a href=\"${results.results[i].href}\" target=\"_blank\">\n <img class=\"card-image\" src=\"${results.results[i].thumbnail}\" onerror=\"this.onerror=null; this.src='./assets/img/alt.jpeg'\" alt=\"recipe\" width=\"250\" height=\"150\"/>\n </a>\n </div>\n </div>\n\n <div class=\"row\">\n <div class=\"col-12\">\n <h6 class=\"card-title my-auto\">${results.results[i].title}</h6>\n </div>\n </div>\n </div>\n </div>\n `);\n }\n\n addButtons();\n\n return arr;\n}", "async displaySearchResults(searchResults)\n {\n const displayResults = await searchResults.map(recipe => {\n return `<li> <button class=\"result\" id=\"${recipe.id}\" style=\"background-image: url(${recipe.image})\"> ${recipe.title}</button></li>`; });\n document.getElementById('results').innerHTML = displayResults.join(''); \n \n \n }", "function rankResults(response){\n\t// global var response is the full JSON response\n\t// we don't need to call the api here\n\t// go through each element in response, call getIngredients\n\t// add recipe object WITH SCORE to resultsToDisplay\n\t// sort resultsToDisplay based on score\n\n\tfor(var i = 0 in response.results){\n\t\t// var ingredObject = getIngredients(response[i]);\n\t\t// response[i].score = ingredObject.score;\n\t\tresponse.results[i].score = getIngredients(response.results[i]);\n\t\t//console.log();\n\t\t//console.log(response.results[i]);\n\t\tresultsToDisplay.push(response.results[i]);\n\t}\n\tresultsToDisplay.sort(function(a,b) {\n\t\treturn b.score-a.score;\n\t});\n\t\n\tconsole.log(resultsToDisplay);\n\tdisplayResults(resultsToDisplay);\n}", "function getRecipes() { \nrecipes =\n [new recipe(\n 'Pasta Bolognese',\n 20,\n ['tomato sauce', 'pasta', 'minced meat', 'onion', 'red wine', 'salt', 'pepper', 'garlic'],\n [''],\n 'Boil pasta, mix the rest in a pan, add some salt and peppar.'),\n new recipe(\n 'Vegetarian Pie',\n 40,\n ['flour', 'butter', 'salt', 'spinach', 'ricotta', 'egg', 'parmesan', 'pepper'],\n ['Vegetarian'],\n 'Make the pie dough, fill with vegetables, add some salt and pepper'),\n new recipe(\n 'Fish Soup',\n 40,\n ['salmon', 'cod', 'fennel', 'leek', 'saffron', 'curry', 'oatmilk'],\n ['Gluten free'],\n 'Chop fish and vegetables, add some spices and it is done'),\n new recipe(\n 'Poké Bowl',\n 15,\n ['rice', 'tofu', 'edamame', 'red onion', 'radish', 'ginger', 'soya'],\n ['Gluten free', 'Vegetarian'],\n 'Boil rice, chop vegetables, fry tofu and but everything together in a bowl')\n ]\n\nreturn recipes\n\n}", "render() { \n return ( \n <div id=\"wrapper\">\n <Counter count={this.state.counter}/>\n <div id=\"recipe-view\">\n {(this.state.counter !== 0) ?\n <div className=\"recipes-list\">{this.state.recipes.map(recipe => {\n return (<RecipeItem key={recipe.id} title={recipe.title}\n image={recipe.image} likes={recipe.likes} \n buttonClick={() => this.showRecipe(recipe.id, recipe.missedIngredients)}/>)\n })}\n </div> : <div id=\"no-results\">Sorry, no results have been found.</div>}\n <div className=\"recipe-detail\">\n {this.state.showRecipeID && <Recipe id={this.state.showRecipeID} \n missed={this.state.missedIngredients} refresh={this.state.showRecipeDetail}/>}\n </div>\n </div>\n </div>\n )}", "displayDrinks(drinks){\n // show the results\n const resultsWrapper = document.querySelector('.results-wrapper');\n resultsWrapper.style.display = 'block';\n\n // insert results\n const resultsDiv = document.querySelector('#results');\n\n drinks.forEach(drink => {\n resultsDiv.innerHTML += `\n <div class=\"col-md-4\">\n <div class=\"card my-3\">\n <button type=\"button\" data-id=\"${drink.idDrink}\" class=\"favorite-btn btn btn-outline-info\">\n + \n </button>\n <img class=\"card-img-top\" src=\"${drink.strDrinkThumb}\" alt=\"${drink.strDrink}\">\n <div class=\"card-body\">\n <h2 class=\"card-title text-center\">${drink.strDrink}</h2>\n <a class=\"btn btn-success get-recipe\" href=\"#\" data-target=\"#recipe\" data-toggle=\"modal\" data-id=\"${drink.idDrink}\">Get receipe</a>\n </div> \n </div> \n </div>\n `;\n });\n this.isFavorite(); \n }", "function _drawResults() { \n let template=\"\"\n ProxyState.songs.forEach(s => template += s.allMusicTemplate)\n document.getElementById('songs').innerHTML = template\n}", "function selectAllFilteredRecipes() { /*Nota bene: Parameters (ingrFilter, appFilter, ustFilter) deleted since not red */\n\n const INPUT = SEARCH_INPUT.value;\n let result = [];\n\n if (INPUT.length > 2) {\n\n /* Search to find input in title, description or ingredient list of the recipe*/\n\n /************ALGO 1************/\n result = recipes.filter(item =>\n Utils.normString(item.name).includes(Utils.normString(INPUT)) ||\n item.ingredients.map(rMap => Utils.normString(rMap.ingredient)).join(',').includes(Utils.normString(INPUT))|| /*.join to create a string containing all elements ingredients all together so element TRUE when element=\"pate\"+\"brisee\" for ex */\n Utils.normString(item.description).includes(Utils.normString(INPUT)));\n /************ALGO 1************/\n \n }\n else {\n result=[...recipes]; /*to get all the recipes displayed when less than 3 digits */\n }\n\n let filteredRecipes = [];\n\n result.forEach(currentRecipe => {\n const ingrNames = currentRecipe.ingredients.map(rMap => Utils.normString(rMap.ingredient));\n const appNames = Utils.normString(currentRecipe.appliance);\n const ustNames = currentRecipe.ustensils.map(rMap => Utils.normString(rMap));\n\n let nbTagIngr = 0;\n let nbTagApp = 0;\n let nbTagUst = 0;\n\n tabSelectIngr.forEach(ingrTag => {\n if (ingrNames.includes(ingrTag)) {\n nbTagIngr++;\n }\n });\n\n tabSelectApp.forEach(appTag => {\n if (appNames.includes(appTag)) {\n nbTagApp++;\n }\n });\n\n tabSelectUst.forEach(ustTag => {\n if (ustNames.includes(ustTag)) {\n nbTagUst++;\n }\n });\n\n if (nbTagApp === tabSelectApp.length &&\n nbTagIngr === tabSelectIngr.length &&\n nbTagUst === tabSelectUst.length) {\n filteredRecipes.push(currentRecipe);\n }\n });\n return filteredRecipes;\n}", "function formatMealData(data) {\n mealData = data;\n recipeNumber = mealData.hits.length;\n removeSearchDropdowns();\n\n for (i = 0; i < recipeNumber; i++) {\n recipeLabel = mealData.hits[i].recipe.label; \n recipeSourceName = mealData.hits[i].recipe.source; \n recipeImage = mealData.hits[i].recipe.image; \n recipeInstructionsLink = mealData.hits[i].recipe.url;\n foodSearchResultsBody.classList.remove('hide');\n showFoodCards(recipeImage, recipeLabel, recipeSourceName, recipeInstructionsLink);\n }\n}", "function generateCards(results) {\n\n var resultsDiv = document.querySelector('#card-append')\n resultsDiv.textContent = \"\";\n\n let generatedCards= '';\n //every time we are looping through the results, create a card using the format in the HTML\n results.map(result => {\n console.log(result)\n generatedCards +=\n `\n<div class=\"card column is-one-quarter\">\n <div class=\"card-image\">\n <figure class=\"image is-4by3\">\n \n <img src= \"${result.recipe.image}\" alt=\"Placeholder image\">\n </figure>\n </div>\n <div class=\"card-content\">\n <div class=\"media\">\n <div class=\"media-left\">\n </div>\n <div class=\"media-content\">\n <p class=\"title is-4\">${result.recipe.label}</p>\n </div>\n </div>\n \n <div class=\"calories\">\n <strong> Cuisine Type: </strong>${result.recipe.cuisineType}\n <br>\n <strong> Calories: </strong>${result.recipe.calories.toFixed(0)}\n <br>\n \n <a class=\"view-btn\" target=\"_blank\" href=\"${result.recipe.url}\">View Recipe</a> \n </div>\n </div>\n </div>\n`\n})\nsearchRecipe.innerHTML = generatedCards;\n}", "function displayMealDetails(meal) {\n const ingredients = [];\n for (let i = 1; i <= 20; i++){\n // Check if ingredients exist\n if (meal[`strIngredient${i}`]) {\n // push all the ingredient into the array\n ingredients.push(`${meal[`strIngredient${i}`]} : ${meal[`strMeasure${i}`]}`);\n } else {\n break;\n }\n };\n // Render data into Ui\n selectedMeal.innerHTML = `\n <div class='selected_meal_details'>\n <h1>${meal.strMeal}</h1>\n <img src='${meal.strMealThumb}' alt='${meal.strMeal}' />\n <div class='selected_meal_info'>\n ${meal.strCategory ? `<p>${meal.strCategory}</p>` : ''}\n ${meal.strArea ? `<p>${meal.strArea}</p>` : ''}\n </div>\n <div class='selected_meal_instructions'>\n <p>${meal.strInstructions}</p>\n <h1>Ingredients</h1>\n <ul>\n ${ingredients.map( ingredient => `<li>${ingredient}</li>`).join('')}\n </ul>\n </div>\n </div>\n `;\n}", "function changeServings(servingFactor){\n var updateTable = \"<dl class=\\\"ingredients-list\\\">\";\n for (var a =0; a < recipeData.root.body.recipes[recipeID].extendedIngredients.length; a++){\n updateTable += \"<dt>\" + Math.round(10*recipeData.root.body.recipes[recipeID].extendedIngredients[a].measures.metric.amount / recipeData.root.body.recipes[recipeID].servings * servingFactor)/10 + \"</dt> <dd>\" + recipeData.root.body.recipes[recipeID].extendedIngredients[a].measures.metric.unitLong + \" \" + recipeData.root.body.recipes[recipeID].extendedIngredients[a].name + \"</dd>\"; \n }\n updateTable += \"</dl>\";\n $(\"#collapse1\").html(updateTable);\n}", "function printRecipePages(selectedRecipes, recipeListData){\n var recipeString = \"\";\n selectedRecipes.forEach(function(item){\n var arrayPosition = recipeListData.map(function(arrayItem) {return arrayItem.name;}).indexOf(item);\n var thisRecipeObject = recipeListData[arrayPosition];\n // recipe name\n recipeString += \"<div class='print-full-recipe'><div class='print-recipe-pages-name'><h4>\" + thisRecipeObject.name + \"</h4></div>\";\n // ingredients\n recipeString += \"<div class='print-recipe-pages-ingredients'>\"\n recipeString += ingredientPlucker(thisRecipeObject.ingredients);\n recipeString += \"<br><strong>\" + thisRecipeObject.companionname + \"</strong><br>\";\n recipeString += ingredientPlucker(thisRecipeObject.companion);\n recipeString += \"</div>\";\n // recipe text\n recipeString += \"<div class='print-recipe-pages-recipe'>\" + thisRecipeObject.recipe + \"</div></div>\";\n });\n return recipeString;\n}", "function showFavoriteRecipes() {\n showAllRecipes()\n let unsavedRecipes = recipes.filter(recipe => {\n return !user.favoriteRecipes.includes(recipe.id);\n });\n if(unsavedRecipes.length === recipes.length){\n return domUpdates.emptyPageErrorMsg('favorite');\n }\n unsavedRecipes.forEach(recipe => {\n let domRecipe = document.getElementById(`${recipe.id}`);\n domUpdates.hide(domRecipe)\n });\n domUpdates.showFavoriteRecipes()\n}", "function displayResults(){\n\t\t//Clear the Options section\n\t\t$(\"#options\").empty();\n\n\t\t//Display Text Results in various sections\n\t\t$(\"#questionResponse\").text(\"Here is your tally!\");\n\n\t\t$(\"#options\").append(\"<p>Correct Answers: \" + correctCount + \" </p>\");\n\t\t$(\"#options\").append(\"<p>Incorrect Answers: \" + incorrectCount + \" </p>\");\n\t\t$(\"#options\").append(\"<p>Unanswered: \" + unansweredCount + \" </p>\");\n\n\t\t//Display Start Over Button\n\t\t$(\"#startOver\").show();\n\t}", "function display(){\n $(\"#searchResults\").empty();\n for(var i = 0; i<10; i++){\n var newCard = $(\"<div>\", {\"class\": \"card card-block\"});\n var newImage = $(\"<img>\", {\"class\": \"card-img-top\"});\n newImage.attr(\"src\", imagePool[i]);\n newCard.append(newImage);\n var newBody = $(\"<div>\", {\"class\": \"card-body\"});\n var newTitle = $(\"<h5>\", {\"class\": \"card-title\"}).text(namePool[i]);\n var newText = $(\"<p>\", {\"class\": \"card-text\"}).html(\"Calories: \" + caloryPool[i]);\n var newLink = $(\"<a>\").text(sourcePool[i]);\n newLink.attr(\"href\", linkPool[i]);\n newLink.attr(\"class\", \"btn btn-default\");\n newBody.append(newTitle);\n newBody.append(newText);\n newBody.append(newLink);\n newCard.append(newBody);\n var newCol = $(\"<div>\", {\"class\": \"col-sm-4 col-xs-6\"});\n newCol.append(newCard);\n $(\"#searchResults\").append(newCol);\n // add a fav button with corresponding id\n var favButton = $(\"<button>\").html('<i class=\"far fa-star\"></i>');\n favButton.attr(\"class\", \"fav\");\n favButton.attr(\"data-recipeId\", i);\n newTitle.append(favButton);\n }\n}", "function displayResults(result){\n return `\n <div class=\"col s12 m4\">\n <div class=\"card\">\n <div class=\"card-image waves-effect waves-block waves-light\">\n <img class=\" activator js-img\" src=\"${result.recipe.image}\">\n <span class=\"card-title\">${result.recipe.label}</span>\n </div>\n <div class=\"card-content\">\n <span class=\"card-title activator grey-text text-darken-4\"><i class=\"material-icons right\">more_vert</i></span>\n </div>\n <div class=\"card-reveal\">\n <span class=\"card-title grey-text text-darken-4\"><i class=\"small material-icons right\">close</i></span>\n <p class=\"card-txt\">${result.recipe.dietLabels}</p>\n <p class=\"card-txt\" id=\"card-cal\">${Math.round(result.recipe.calories)} Calories</p>\n <p class=\"card-txt\" id=\"card-carb\">${Math.round(result.recipe.totalNutrients.CHOCDF.quantity)}<span>${result.recipe.totalNutrients.CHOCDF.unit} Carbs per serving</span></p>\n <p class=\"card-txt-lines\">${result.recipe.ingredientLines}</p>\n </div>\n <div class=\"card-action\">\n <a href=\"${result.recipe.url}\" target=\"_blank\">Try It Now!</a>\n <button type=\"submit\" aria-label=\"search\" class=\"save-button\" id=\"${result.recipe.label}\" data-imgurl=\"${result.recipe.image}\"> SAVE IT! </button>\n </div>\n </div>\n </div>\n </div>\n `\n }", "function displayOtherRecipe(index, recipeCount, prevButtonClicked) {\n // If it was the \"Previous Button\" click that caused this function to be called, then display the previous recipe.\n // Otherwise, it was the \"Next Button\" that caused this function to be called - display the next recipe.\n if (prevButtonClicked) {\n if (index == 0) {\n // Reached the beginning of the recipe list - go to the end.\n return recipeCount - 1;\n } else {\n return index - 1;\n }\n } else {\n if (index == recipeCount - 1) {\n // Reached the end of the recipe list - loop back to the beginning.\n return 0;\n } else {\n return index + 1;\n }\n }\n}", "function renderResults(res) {\n $(\"#results-area\").empty();\n for (var i = 0; i < res.matches.length; i++) {\n var matches = res.matches[i];\n\n var div = $(\"<div>\");\n div.addClass(\"result\");\n\n var ul = $(\"<ul>\");\n ul.attr(\"recipe-id\", matches.id);\n\n var liImage = $(\"<li>\");\n var image = $(\"<img>\");\n image.attr(\"src\", matches.smallImageUrls);\n liImage.append(image);\n\n var liName = $(\"<li>\");\n liName.text(\"Name: \" + matches.recipeName);\n\n var liRating = $(\"<li>\");\n liRating.text(\"Rating: \" + matches.rating);\n\n var liTime = $(\"<li>\");\n liTime.text(\"Preparation Time: \" + matches.totalTimeInSeconds + \" minutes.\");\n\n ul.append(liImage, liName, liRating, liTime);\n div.append(ul);\n $(\"#results-area\").append(div);\n }\n}", "parseRecipe(recipes) {\n for (let i in recipes) {\n const ing = recipes[i].Ingredient;\n const cat = recipes[i].Category;\n const qty = Math.ceil(recipes[i].Quantity / recipes[i].QtyCraft);\n\n if(cat === 1) {\n this.getRecipe(ing, qty)\n }\n }\n }", "displayDrinkWithIngredients(drinks){\n // Show the Results\n const resultsWrapper = document.querySelector('.results-wrapper');\n resultsWrapper.style.display = 'block';\n\n // Insert the Results\n const resultsDiv = document.querySelector('#results');\n // loop through the Drinks\n drinks.forEach( drink => {\n // Build The Template\n resultsDiv.innerHTML += `\n <div class=\"col-md-6\">\n <div class=\"card my-3\">\n <button type=\"button\" data-id=\"${drink.idDrink}\" class=\"favorite-btn btn btn-outline-info \">\n +\n </button>\n <img class=\"card-img-top\" src=\"${drink.strDrinkThumb}\" alt=\"${drink.strDrink}\" >\n \n <div class=\"card-body\">\n <h2 class=\"card-title text-center\">${drink.strDrink} </h2>\n <p class=\"card-text font-weight-bold\"> Instrucions :\n \n </p>\n <p class=\"card-text\">\n ${drink.strInstructions}\n </p>\n <p class=\"card-text\">\n <ul class=\"list-group\">\n <li class=\"list-group-item alert alert-danger\">Ingerdients</li>\n\n ${this.displayIngredients(drink)}\n\n\n </ul>\n\n </p>\n <p class=\"card-text font-weight-bold\"> Extra Information : </p>\n <p class=\"card-text\">\n <span class=\"badge badge-pill badge-success\">\n ${drink.strAlcoholic}\n </span>\n <span class=\"badge badge-pill badge-warning\">\n Category : ${drink.strCategory}\n </span>\n </p>\n\n </div>\n </div>\n </div>\n \n `;\n });\n this.isFavorite();\n }", "function displaySearchResults(response, search) {\n var user_finder = new RegExp(search, 'i'),\n results_string = \"\",\n i,\n j;\n\n if(globe.getID(0)) {\n removeLink();\n }\n\n if (globe.search_type_name.checked) {\n for (i = 0; i < response.length; i += 1) {\n if (user_finder.test(response[i].toMake)) {\n\n results_string += \"<p id=\\\"\" + i.toString() + \"\\\">\" + response[i].toMake + \"</p>\";\n globe.addID(i.toString());\n }\n }\n } else {\n for (i = 0; i < response.length; i += 1) {\n for (j = 0; j < response[i].ingredients.length; j += 1) {\n if (user_finder.test(response[i].ingredients[j].ingredient)) {\n\n results_string += \"<p id=\\\"\" + i.toString() + \"\\\">\" + response[i].ingredients[j].ingredient + \"</p>\";\n globe.addID(i.toString());\n break;\n }\n }\n }\n }\n\n globe.hint_span.innerHTML = \"\";\n if (results_string === \"\") {\n results_string = \"<span>No results.</span>\";\n }\n globe.results_div.innerHTML = results_string;\n \n if (globe.getID(0)) {\n createLink();\n }\n}", "renderAnswers() {\n const { entries, showAll } = this.state;\n // subset of entries to be displayed\n let display = [];\n // Handle if there are only 2 answers\n if (entries.length < 3) {\n display = [...entries];\n } else if (!showAll) {\n display = [entries[0], entries[1]];\n } else {\n display = [...entries];\n }\n // Only show 2 answers and a load more button\n return [\n display.map((answer) => <AnswerListEntry answer={answer} key={answer.id} />),\n this.renderDisplayButton(display.length),\n ];\n // renders objects that aresupplied to it\n }", "function buildRecipeList(json) {\n var html = \"\";\n var count = 0;\n\n html += \"<thead>\";\n html += tableGen.headerRow([\"Title\", \"Description\", \"Author\", \"Tags\"]);\n html += \"</thead><tbody>\";\n for (var key in json) {\n value = json[key];\n\n var output = [];\n output.push(tableGen.dataCell(\"<a href='#view/ID=\" + value['ID'] + \"'>\" + value['Title'] + \"</a>\"));\n output.push(tableGen.dataCell(value['Description']));\n output.push(tableGen.dataCell(value['Author'] != undefined ? value['Author']['Name'] : ''));\n var tagList = [];\n var tags = value['Tags']\n for (var tagKey in tags) {\n tagList.push(tags[tagKey]['Tag']);\n }\n output.push(tableGen.dataCell(tagList));\n var attrs = \"data-cmd='view' data-id='\" + value['ID'] + \"'\";\n var sClass = (count++ % 2 == 1 ? ' alt' : '');\n html += tableGen.dataRow(attrs, sClass, output);\n }\n html += \"</tbody>\";\n\n return html;\n}", "function renderResults () {\n $('#my-quiz').addClass('hidden');\n $('#results').removeClass('hidden');\n $('.js-results-text').append('<h2>' + 'You got ' + correctAnswers + ' out of ' + questionsTotal + ' right! ' + '</h2>');//remove questions and progress and show results page\n}", "function getRecipeLink(selectedResults) {\n // recipe list: display the selected results for copy/paste\n const recipeList = document.getElementById('recipe-list');\n // recipe link: link to search food network, e.g.\n const recipeLink = document.getElementById('recipe-link');\n const fnlink = 'https://www.foodnetwork.com/search/' + selectedResults.join('-,') + '-';\n const fhtip = 'Food Network recipes for ' + selectedResults.join(', ');\n const allrecipeslink = 'https://www.allrecipes.com/search?q=' + selectedResults.join('+'); \n const allrecipestip = 'All Recipes with ' + selectedResults.join(', ');\n const googlelink = 'https://www.google.com/search?q=' + selectedResults.join('+') + '+recipes';\n const googletip = 'Google recipes with ' + selectedResults.join(', ');\n const cocktaillink = 'https://www.thecocktailproject.com/search/?search_api_fulltext=' + selectedResults.join('+');\n const cocktailtip = 'Cocktail Project recipes for ' + selectedResults.join(', ');\n if (selectedResults.length === 0) {\n recipeLink.innerHTML = '';\n } else {\n recipeLink.innerHTML = \"recipes: \"\n + ' <a href=\"' + fnlink + '\" target=\"_blank\" title=\"' + fhtip + '\" >food network</a>'\n + ' · <a href=\"' + allrecipeslink + '\" target=\"_blank\" title=\"' + allrecipestip + '\">allrecipes</a>'\n + ' · <a href=\"' + googlelink + '\" target=\"_blank\" title=\"' + googletip + '\">google</a>'\n + ' · <a href=\"' + cocktaillink + '\" target=\"_blank\" title=\"' + cocktailtip + '\">cocktails</a>'\n ;//+ '<span style=\"float: right;\">' + selectedResults.join(' + ') + '</span>' ; \n //TODO: add a copy to clipboard button\n }\n}", "function renderAll() {\n $(\".entry\").html(\"<h1>\" + previousEntry + \"</h1>\");\n if (calculate.length + currentEntry.length > 34) {\n $(\".all-entries\").html(\"<h2> calculation overflow</h2>\");\n }\n else $(\".all-entries\").html(\"<h2>\" + calculate + currentEntry + \"</h2>\");\n}", "function showRecipeList(recipes) {\n const list = document.getElementById(\"recipe-list\");\n list.innerHTML = \"\";\n //add create recipe button\n button = document.createElement(\"BUTTON\");\n button.type = \"button\";\n button.id = \"create-recipe-btn\";\n button.className = \"list-group-item list-group-item-action list-highlight\";\n button.textContent = \"Add New Recipe\";\n\n showBtn = document.createElement(\"BUTTON\");\n showBtn.type = \"button\";\n showBtn.id = \"toggle-show-btn\";\n showBtn.className = \"list-group-item list-group-item-action list-highlight\";\n showBtn.textContent = \"Show My Recipes\";\n list.append(button); //Add in show button when user auth is set up\n //create list for all public recipes\n for (const recipe of recipes) {\n if (!recipe.public) {\n return;\n }\n btn = renderRecipe(recipe);\n btn.dataset.id = recipe.id;\n list.appendChild(btn);\n }\n}", "function getDrugs(counter, display, number) {\n counter=0;\n //map through the answers\n form.map((item)=>{\n //targets specific question in the dataset\n let answer=item.answers[number]\n //if answer doesn't exist, display 0\n if(!answer){\n display=0;\n }\n //if answer does exist add one to counter\n else if(answer.answer){\n counter++\n }\n //display result as a percentage\n display = ((counter / total) * 100).toFixed(1);\n })\n console.log('this is the display:', display);\n //returns display\n return display;\n }", "function printGroceryList(selectedRecipes, recipeListData){\n var groceryString = \"\";\n var meatGroceries = [];\n var veggieGroceries = [];\n var dryGroceries = [];\n var spiceGroceries = [];\n var condimentGroceries = [];\n var otherGroceries = [];\n\n selectedRecipes.forEach(function(item){\n var arrayPosition = recipeListData.map(function(arrayItem) {return arrayItem.name;}).indexOf(item);\n var thisRecipeObject = recipeListData[arrayPosition];\n meatGroceries.push(categoryIngredientPlucker(thisRecipeObject.ingredients.meats));\n meatGroceries.push(categoryIngredientPlucker(thisRecipeObject.companion.meats));\n veggieGroceries.push(categoryIngredientPlucker(thisRecipeObject.ingredients.veggies));\n veggieGroceries.push(categoryIngredientPlucker(thisRecipeObject.companion.veggies));\n dryGroceries.push(categoryIngredientPlucker(thisRecipeObject.ingredients.dry));\n dryGroceries.push(categoryIngredientPlucker(thisRecipeObject.companion.dry));\n spiceGroceries.push(categoryIngredientPlucker(thisRecipeObject.ingredients.spices));\n spiceGroceries.push(categoryIngredientPlucker(thisRecipeObject.companion.spices));\n condimentGroceries.push(categoryIngredientPlucker(thisRecipeObject.ingredients.condiments));\n condimentGroceries.push(categoryIngredientPlucker(thisRecipeObject.companion.condiments));\n otherGroceries.push(categoryIngredientPlucker(thisRecipeObject.ingredients.other));\n otherGroceries.push(categoryIngredientPlucker(thisRecipeObject.companion.other));\n });\n groceryString += \"<strong>Meats</strong><br>\" + meatGroceries + addlSpace(4) + \"<strong>Veggies</strong><br>\" + veggieGroceries + addlSpace(4) + \"<strong>Dry Goods</strong><br>\" + dryGroceries\n + addlSpace(4) + \"<strong>Spices</strong><br>\" + spiceGroceries + addlSpace(4) + \"<strong>Condiments</strong><br>\" + condimentGroceries + addlSpace(4) + \"<strong>Other</strong><br>\" + otherGroceries;\n groceryString = groceryString.replace(/,/g, '');\n groceryString = groceryString.replace(/None/g, ''); // this still leaves a blank line in the printed list =(\n return groceryString;\n}", "function displaySearchResults(results, store) {\n var searchResults = document.getElementById('search-results');\n\n if (results.length) { // Are there any results?\n var appendString = '';\n\n for (var i = 0; i < results.length; i++) { // Iterate over the results\n var item = store[results[i].ref];\n //Recreate card layout for each result item\n appendString += '<div class=\"col-md-4 col-sm-6 learning-item\">';\n appendString += '<picture class=\"intrinsic intrinsic-item\">';\n appendString += '<img class=\"img-responsive intrinsic-img\" src=\"' + item.siteURL + '/assets/images/resources/' + item.image + '\" alt=\"' + item.title + '\">';\n appendString += '</picture>';\n appendString += '<h2><a href=\"' + item.resourceUrl + '\" target=\"_blank\">' + item.title + '</a></h2>';\n appendString += '<p class=\"attribution\">';\n if ( item.resourceAuthor ) {\n appendString += item.resourceAuthor + ', ';\n }\n appendString += item.resourceOrg + '</p>';\n appendString += item.contentHTML;\n appendString += '<div class=\"labels pull-right\">';\n if (item.resourceType === \"Ebook\") {\n appendString += '<i class=\"glyphicon glyphicon-book\"></i> ';\n }\n if (item.resourceType === \"Course\") {\n appendString += '<i class=\"glyphicon glyphicon-blackboard\"></i> ';\n }\n if (item.resourceType === \"Email Course\") {\n appendString += '<i class=\"glyphicon glyphicon-send\"></i> ';\n }\n if (item.resourceType === \"Website\") {\n appendString += '<i class=\"glyphicon glyphicon-link\"></i> ';\n }\n if (item.resourceType === \"Podcast\") {\n appendString += '<i class=\"glyphicon glyphicon-headphones\"></i> ';\n }\n appendString += item.resourceType + ' | ';\n if (item.access === \"Requires Email\") {\n appendString += '<i class=\"glyphicon glyphicon-envelope\"></i> ';\n }\n if (item.access === \"Requires Registration\") {\n appendString += '<i class=\"glyphicon glyphicon-user\"></i> ';\n }\n if (item.access === \"Free\") {\n appendString += '<i class=\"glyphicon glyphicon-download-alt\"></i> ';\n }\n appendString += item.access + ' </div>';\n appendString += '<div class=\"post-sharing pull-right\">';\n var learningItemURL = \"https://hackid.github.io%23\" + item.learningItemID;\n appendString += '<a href=\"https://twitter.com/share?url=' + learningItemURL + '&via=anthkris&hashtags=hackidlearning&text=' + item.title + ' free ' + item.resourceType + '\" target=\"_blank\">';\n appendString += '<img src=\"' + item.siteURL +'/assets/images/twitter-logo.svg\" class=\"social-logo\"/></a>';\n appendString += '<a href=\"https://plus.google.com/share?url=' + learningItemURL + '&title=' + item.title + ' free ' + item.resourceType + '\" target=\"_blank\">';\n appendString += '<img src=\"' + item.siteURL + '/assets/images/google-plus.svg\" class=\"social-logo\"/></a></div>';\n appendString += '<a href=\"' + item.resourceUrl + '\" target=\"_blank\" class=\"button view-button\">View</a>';\n appendString += '</div>';\n }\n\n searchResults.innerHTML = appendString;\n } else {\n searchResults.innerHTML = '<div class=\"col-xs-12\"><p class=\"no-results\">No results found.<br /><a href=\"https://docs.google.com/forms/d/e/1FAIpQLSe-Vw60TcOyTjd_FgTLD7eZ_fPwYTXsUWWNZEN1NrLTPK-qKA/viewform\" target=\"_blank\">Try submitting a resource on this topic!</a></p></div>';\n }\n }", "displayIngredients(drink){\n\n let ingredients = [];\n for(let i = 1; i< 16; i++){\n const ingredientMeasure = {};\n if( drink[`strIngredient${i}`] !== ''){\n ingredientMeasure.ingredient = drink[`strIngredient${i}`];\n ingredientMeasure.measure = drink[`strMeasure${i}`];\n ingredients.push(ingredientMeasure);\n }\n }\n\n // Build the template\n\n let ingredientsTemplate = '';\n ingredients.forEach(ingredient => {\n ingredientsTemplate += `\n <li class=\"list-group-item\">${ingredient.ingredient} - ${ingredient.measure}</li>\n `;\n });\n return ingredientsTemplate;\n }", "function recipeSuccess(response) {\r\n\r\n $('#recipeResults').empty();\r\n\r\n // creating array to store search results\r\n const saveArray = [];\r\n // stores recipe data in array\r\n for (var i = 0; i < response.hits.length; i++) {\r\n saveArray.push(response.hits[i].recipe);\r\n }\r\n\r\n // declaring userid to use to validate if member is signed in\r\n const userId = $(\"#userId\").data(\"userid\");\r\n // console.log(\"user id for this saving\", userId);\r\n\r\n // maps the results of the search to use in our template literal\r\n response.hits.map((recipeResult, index) => {\r\n const {\r\n image,\r\n label,\r\n url,\r\n calories,\r\n yield,\r\n totalTime,\r\n ingredientLines,\r\n dietLabels,\r\n healthLabels\r\n } = recipeResult.recipe;\r\n\r\n // searches for value of #userID \r\n // displays public or member cards\r\n const recipeCardContent = `\r\n <div class=\"recipe-image card-img-top\" style=\"background: lightblue url(${image}) no-repeat center/cover\";></div>\r\n <div class=\"card-body\">\r\n <h5 class=\"recipe-name card-title\">${label}</h5>\r\n <p><a href=\"${url}\" target=\"_blank\" class=\"recipe-link\">View Recipe</a></p>\r\n <p>Number of Servings: <span class=\"yield\">${yield}</span></p>\r\n <p>Calories(per serving): <span class=\"calories\">${(calories / yield).toFixed()}</span></p>\r\n <p>Total Time: <span class=\"total-time\">${totalTime}</span></p>\r\n <p>Ingredients:</p>\r\n <ul class=\"ingredients-list\">\r\n ${ingredientLines.map(ingredient => (\r\n `<li>${ingredient}</li>`)).join(\"\")}\r\n </ul>\r\n <br>\r\n <p>Diet:</p>\r\n <ul class=\"diet-list\">\r\n ${dietLabels.map(diets => (\r\n `<li>${diets}</li>`)).join(\"\")}\r\n </ul>\r\n <br>\r\n <p>Health:</p>\r\n <ul class=\"health-list\">\r\n ${healthLabels.map(healths => (\r\n `<li>${healths}</li>`)).join(\"\")}\r\n </ul>\r\n <div id=${userId}></div>\r\n <a href=\"#\" id=\"${index}\"class=\"save-recipe-btn btn btn-primary show-toast\">Save</a>\r\n </div>\r\n `;\r\n\r\n //creating recipe card literals\r\n let recipeCard = $(\"<div>\")\r\n .addClass(\"recipe-card card d-flex flex-row\")\r\n .attr(\"id\", \"${index}\")\r\n .html(recipeCardContent);\r\n\r\n // \r\n recipeCard.find(\".save-recipe-btn\").on(\"click\", () => submitPost({\r\n image: image,\r\n label: label,\r\n url: url,\r\n calories: (calories / yield).toFixed(),\r\n totalTime: totalTime,\r\n ingredientLines: ingredientLines.join(),\r\n dietLabels: dietLabels.join(),\r\n healthLabels: healthLabels.join(),\r\n userId: userId\r\n }));\r\n\r\n $(\"#loader\").empty();\r\n\r\n // appends cards to page\r\n $(\"#recipeResults\").prepend(recipeCard);\r\n\r\n });\r\n $(\".save-recipe-btn\").on(\"click\", function (event) {\r\n event.preventDefault();\r\n\r\n let i = this.id;\r\n $(\"#\" + i).html(`<i class=\"fas fa-check\"></i>`)\r\n\r\n var q = saveArray[i].label.split(' ');\r\n\r\n let recipeCardContent = `\r\n <div class=\"recipe-card card d-flex flex-row\" id=${i + q[0]}>\r\n <div class=\"recipe-image card-img-top\" style=\"background: lightblue url(${saveArray[i].image}) no-repeat center/cover\";></div>\r\n <div class=\"card-body\">\r\n <h5 class=\"recipe-name card-title\">${saveArray[i].label}</h5>\r\n <p><a href=\"${saveArray[i].url}\" target=\"_blank\" class=\"recipe-link\">View Recipe</a></p>\r\n <p>Calories(per serving): <span class=\"calories\">${(saveArray[i].calories / saveArray[i].yield).toFixed()}</span></p>\r\n <p>Total Time: <span class=\"total-time\">${saveArray[i].totalTime}</span></p>\r\n <p>Ingredients:</p>\r\n <ul class=\"ingredients-list\">\r\n ${saveArray[i].ingredientLines.map(ingredient => (\r\n `<li>${ingredient}</li>`\r\n )).join(\"\")}\r\n </ul>\r\n <br>\r\n <p>Diet:</p>\r\n <ul class=\"diet-list\">\r\n ${saveArray[i].dietLabels.map(diets => (\r\n `<li>${diets}</li>`\r\n )).join(\"\")}\r\n </ul>\r\n <br>\r\n <p>Health:</p>\r\n <ul class=\"health-list\">\r\n ${saveArray[i].healthLabels.map(healths => (\r\n `<li>${healths}</li>`\r\n )).join(\"\")}\r\n </ul>\r\n <div id=${userId}></div>\r\n <button type=\"button\" id=\"${i + q[0]}\" class=\"btn delete-recipe-btn\" disabled>Check back soon</button>\r\n </div>\r\n </div>\r\n `;\r\n // Save cards to saved recipes tab\r\n $(\"#savedRecipes\").append(recipeCardContent);\r\n });\r\n\r\n $('#savedRecipes').on(\"click\", '.delete-recipe-btn', function (event) {\r\n event.preventDefault();\r\n var id = \"#\" + this.id;\r\n $(id).remove();\r\n let deleteId = $(this).data(\"recipeid\");\r\n\r\n var query = \"/api/savedRecipes/\" + deleteId;\r\n $.ajax({\r\n method: \"DELETE\",\r\n url: query\r\n }).then(function () {\r\n event.preventDefault();\r\n });\r\n });\r\n }", "function displayRecipe(recipe){\n console.log(recipe);\n // creates a link to recipe found in recipeList\n recipeLink = createA(recipeList[recipe], 'recipe', '_blank');\n // recipeLink.center('horizontal');\n div.child(recipeLink);\n}", "function displayMealDetails(meal){\n //clear search results:\n meals.innerHTML='';\n resultHeading.innerHTML='';\n\n //Array to hold ingridiants and measurements\n const ingidients = [];\n // loop over ingredients Attribute\n for ( let i=1; i <=20; i++ ){\n // check if ingridiants Exists\n if(meal[`strIngredient${i}`]){\n ingidients.push(`${meal[`strIngredient${i}`]}: ${meal[`strMeasure${i}`]}`);\n }\n else{\n break;\n }\n };\n\n //Render data into UI\n selecteMeal.innerHTML = `\n <div class=\"selected-meal-details\">\n <h1>${meal.strMeal}</h1>\n <img src=\"${meal.strMealThumb}\" alt=\"${meal.strMeal}\" />\n <div class=\"selected-meal-info\">\n ${meal.strCategory? `<p>${meal.strCategory} </p>`:''}\n ${meal.strArea ? `<p>${meal.strArea}</p>` : '' }\n </div>\n\n <div class=\"selected-meal-instructions\">\n <p>${meal.strInstructions}</p>\n <h3>Ingridiants</h3>\n <ul>\n ${ingidients.map(ingredient=>\n ` <li>${ingredient}</li> `).join('')}\n </ul>\n </div>\n\n </div>\n `\n}", "function displayResults(responseJson) {\n console.log(responseJson);\n let index = getQuantity();\n let dogHtml = \"\";\n for (let i=0; i < index; i++) {\n dogHtml+=`<br><img src=\"${responseJson.message[i]}\" class=\"results-img\">`;\n }\n $('section h2').replaceWith(`<h2>You got ${getQuantity()} dogs!</h2>`);\n $('div.response-images').html(dogHtml);\n $('.results').removeClass('hidden');\n }", "displayIngredients(drink){\n let ingredients = [];\n for(let i = 1; i <= 15; i++){\n const ingredientMeasure = {};\n if(drink [`strIngredient${i}`] !== null){\n ingredientMeasure.ingredient = drink[`strIngredient${i}`];\n ingredientMeasure.measure = drink[`strMeasure${i}`];\n ingredients.push(ingredientMeasure);\n }\n }\n //console.log(ingredients)\n // build template\n let ingredientsTemplate = '';\n ingredients.forEach(ingredient => {\n ingredientsTemplate += `\n <li class=\"list-group-item\">\n ${ingredient.ingredient} - ${ingredient.measure}\n </li>\n `;\n });\n return ingredientsTemplate;\n \n }", "displayAnswer() {\n let allerginFound;\n do {\n allerginFound = false;\n // easy case\n this.foods.forEach((food) => {\n if (food.ingredients.length == 1 && food.allergins.length == 1) {\n this.recordAllergin(food.ingredients[0], food.allergins[0]);\n allerginFound = true;\n }\n });\n // only choice across two items\n if (allerginFound == false) {\n for (let loop1 = 0; loop1 < this.foods.length; loop1++) {\n let firstFood = this.foods[loop1];\n for (let loop2 = 0; loop2 < firstFood.allergins.length; loop2++) {\n let suspectAllergin = firstFood.allergins[loop2];\n let suspectIngredients = firstFood.ingredients.concat();\n for (let loop3 = loop1 + 1; loop3 < this.foods.length; loop3++) {\n let secondFood = this.foods[loop3];\n if (secondFood.allergins.includes(suspectAllergin)) {\n suspectIngredients = suspectIngredients.filter(value => secondFood.ingredients.includes(value));\n if (suspectIngredients.length == 1) {\n this.recordAllergin(suspectIngredients[0], suspectAllergin);\n allerginFound = true;\n }\n }\n if (allerginFound)\n break;\n }\n if (allerginFound)\n break;\n }\n if (allerginFound)\n break;\n }\n }\n } while (allerginFound == true);\n let allowedIngredients = new Array();\n this.foods.forEach((food) => {\n if (food.allergins.length == 0)\n allowedIngredients = allowedIngredients.concat(food.ingredients);\n });\n this.answerDisplay.innerText = \"Cleared ingredients appear \" + allowedIngredients.length + \" times\";\n this.allerginsDetermined.sort((a, b) => { return a < b ? -1 : 1; });\n this.answerDisplay.innerHTML += \"<br/><br/>Canonical dangerous ingredient list is: \";\n this.allerginsDetermined.forEach(value => this.answerDisplay.innerHTML += this.ingredientsWithAllergins.get(value) + \",\", this);\n this.answerDisplay.innerHTML += \" (don't forget to remove the trailing comma)\";\n }", "function renderFinalResults() {\n $(\"#my-quiz\").addClass(\"hidden\");\n $(\"#results-page\").removeClass(\"hidden\");\n $(\"#retake-button\").removeClass(\"hidden\");\n var element = $(\".js-final-results\");\n element.html(\"<h2>\" + \"You got\" + ' ' + state.correctCount + ' ' + \"out of\" + ' ' + state.questions.length + ' ' + \"correct\" + \"</h2>\");\n handleQuizRestart();\n}", "function displayResult(results) {\n $(\"#songs\").html(\"\");\n\n for (i = 0 ; i < 20 && i < results.length ; i++) {\n $(\"#songs\").append(composeSongHTML(results[i], currIndex++));\n }\n bindEvents();\n}", "function gatherRecipes(rlist,recipes) {\n var s = {};\n for (var i=0;i<rlist.sections.length;i++) {\n var r = gatherRecipesSection(rlist.sections[i]);\n s[rlist.sections[i]] = r;\n \n }\n recipes[rlist.title] = s;\n // var p = rlist.title.replace(/:.*$/,'').replace(/ /g,'_')+'_last';\n // GM_setValue(p,(new Date()).toUTCString());\n //GM_log('setting '+p+' to '+GM_getValue(p));\n}", "function getRecipes(food) {\n // $(\"#recipeDisplay\").empty();\n console.log(\"hungry\");\n var cuisine = $(food).attr(\"id\");\n var recipeURL = \"https://api.edamam.com/search?q=\" + cuisine + \"&app_id=\" + appId + \"&app_key=\" + apiKey;\n $.ajax({\n url: recipeURL,\n method: \"GET\"\n }).then(function (response) {\n console.log(response);\n response.hits.forEach(element => {\n\n var divStyled = $('<div>');\n divStyled.attr('class', 'row');\n var divSize = $('<div>');\n divSize.addClass('col s12');\n var divColor = $('<div>');\n divColor.addClass('card red card blue-grey darken-4');\n var divText = $('<div>');\n divText.addClass('card-content white-text');\n // divStyled.attr('class', 'card');\n var divFood = $('<span>');\n divFood.addClass('card-title');\n var cardAction = $('<div>');\n cardAction.addClass('card-action');\n var divMoreInfo = $('<button>');\n divMoreInfo.attr('class', 'btn btn-primary red accent-4')\n divMoreInfo.html(`<a href=\"${element.recipe.url}\" target=\"_blank\">Full Recipe</a>`)\n divFood.text(element.recipe.label);\n console.log(element);\n cardAction.append(divMoreInfo);\n divText.append(divFood).append(cardAction);\n divColor.append(divText);\n divSize.append(divColor);\n divStyled.append(divSize);\n $(\".name\").append(divStyled);\n\n // $(\".recipe\").append(element.recipe.url);\n\n console.log(element);\n cantSearch = false;\n\n });\n })\n\n }", "function getRecipeStep(num){\n\tvar recipeInfo = \"\";\n\tvar recipeInfo2 =\"\";\n for (var x=0; x < recipeData.root.body.recipes.length; x++){\n if (num == recipeData.root.body.recipes[x].id){\n recipeID = x;\n\t\t\trecipeInfo += \"<section id=\\\"recipe\\\"><div class=\\\"container\\\" id=\\\"recipePage\\\"><div class=\\\"row\\\"><!-- Title --><div class=\\\"col-12\\\"><h2>\" + recipeData.root.body.recipes[x].title + \"</h2></div></div><div class=\\\"row vertical-align\\\"><div class=\\\"col-12\\\"><!-- Picture --><div class=\\\"col-md-8 pull-left wow swing\\\"><img src=\\\"\" + recipeData.root.body.recipes[x].image + \"\\\" class=\\\"recipe-picture\\\" /></div><!-- Info --><div class=\\\"col-md-4 pull-right wow lightSpeedIn\\\"><div class=\\\"recipe-info\\\"><h3>&ensp;Info<a data-toggle=\\\"collapse\\\" class=\\\"pull-right\\\" href=\\\"#collapseInfo\\\"><i class=\\\"fa fa-plus-square fa-pos\\\" aria-hidden=\\\"true\\\"></i></a></h3><!-- Time --><div id=\\\"collapseInfo\\\" class=\\\"collapse in\\\">\";recipeInfo += \"<div id=\\\"servings\\\">\";\n \n if(userID == -1){\n for (var i= 1; i < 4; i++){\n recipeInfo += \"<div class = \\\"slider\\\">\";\n recipeInfo += \"<input type=\\\"range\\\" min=\\\"0.5\\\" max=\\\"1.5\\\" value=\\\"1\\\" id=\\\"myRange\" + i + \"\\\" step = \\\"0.1\\\" oninput=\\\"showVal(this.value,\" + i + \")\\\">\";\n recipeInfo += \"<p>Serving : <span class = \\\"default\\\" id=\\\"demo\" + i + \"\\\">1</span></p>\";\n recipeInfo += \"</div>\";\n servingFact += 1;\n }\n } else { \n $.ajax({\n url: \"getPreferences.php\",\n dataType: \"json\",\n type: \"POST\",\n data: {test: userID},\n success: function(data) {\n var servings2 = \"\";\n for (var i= 0; i < data.profile.length; i++){\n servings2 += \"<div class = \\\"slider\\\">\";\n servings2 += \"<input type=\\\"range\\\" min=\\\"0.5\\\" max=\\\"1.5\\\" value=\\\"\" + data.profile[i].serving + \"\\\" id=\\\"myRange\" + (i+1) + \"\\\" step = \\\"0.1\\\" oninput=\\\"showVal(this.value,\" + (i+1) + \")\\\">\";\n servings2 += \"<p>\" + data.profile[i].name + \": <span class = \\\"default\\\" id=\\\"demo\" + (i+1) + \"\\\">\"+ data.profile[i].serving +\"</span></p>\";\n servings2 += \"</div>\";\n var servingVal = parseFloat(data.profile[i].serving);\n servingFact += servingVal;\n changeServings(servingFact);\n }\n $(\"#servings\").html(servings2);\n },\n error: function(jqXHR, textStatus, errorThrown) {\n $(\"#p1\").text(textStatus + \" \" + errorThrown\n + jqXHR.responseText);\n } \n\t }); \n }\n recipeInfo += \"</div>\";\n recipeInfo += \"<button onclick=\\\"addNewServing()\\\">Add New Serving</button>\";\n recipeInfo += \"<button onclick=\\\"removeLastServing()\\\">Remove Last Serving</button>\";\n recipeInfo += \"<button onclick=\\\"saveRecipe(\" + recipeData.root.body.recipes[x].id + \", \\'\" + recipeData.root.body.recipes[x].title + \"\\', \\'\" + recipeData.root.body.recipes[x].image + \"\\')\\\">Save Recipe</button>\";\n\t\t\trecipeInfo += \"<a href=\\\"https://twitter.com/share?ref_src=twsrc%5Etfw\\\" class=\\\"twitter-share-button\\\" data-text=\\\"Check out this recipe I made!\\\" data-via=\\\"preppyfun\\\" data-hashtags=\\\"preppy\\\" data-size =\\\"large\\\" data-show-count=\\\"false\\\">Tweet</a><script async src=\\\"https://platform.twitter.com/widgets.js\\\" charset=\\\"utf-8\\\"></script></a>\";\n recipeInfo += \"<div class=\\\"row\\\"><div class=\\\"col-2 text-center\\\"><i class=\\\"fa fa-clock-o\\\" aria-hidden=\\\"true\\\"></i></div><div class=\\\"col-6\\\">Time</div><div class=\\\"col-4\\\">\" + recipeData.root.body.recipes[x].readyInMinutes + \" min</div></div></div></div></div></div></div>\";\n recipeInfo += \"<!-- Ingredients --><div class=\\\"row wow slideInUp\\\"><div class=\\\"col-12\\\"><div class=\\\"recipe-ingredients\\\"><h3>&ensp;Ingredients</h3><div id=\\\"collapse1\\\" class=\\\"collapse in\\\">\";\n recipeInfo += \"</div></div></div></div><!-- Directions --><div class=\\\"row wow slideInUp\\\"><div class=\\\"col-12\\\"><div class=\\\"recipe-directions\\\"><h3>&ensp;Directions<a data-toggle=\\\"collapse\\\" class=\\\"pull-right\\\" href=\\\"#collapse2\\\"><i class=\\\"fa fa-plus-square fa-pos\\\" aria-hidden=\\\"true\\\"></i></a></h3><div id=\\\"collapse2\\\" class=\\\"collapse\\\"><ol>\";\n \n for(var n =0; n < recipeData.root.body.recipes[x].analyzedInstructions[0].steps.length; n++){\n \trecipeInfo += \"<li>\" + recipeData.root.body.recipes[x].analyzedInstructions[0].steps[n].step + \"</li>\";\n }\n \n recipeInfo += \"</ol></div></div></div></div><!-- Back to recipes --><div class=\\\"row wow rollIn\\\"><div class=\\\"col-12 text-center\\\"><a href=\\\"index.html\\\" onclick=\\\"goBack(); return false;\\\"><i class=\\\"fa fa-backward\\\" aria-hidden=\\\"true\\\"></i>Go to back to recipes.</a></div></div></div></section>\";\n\n\t\t\t$(\"#contentArea\").html(recipeInfo);\n changeServings(servingFact);\n\n createView(\"Steps.html&\" + recipeData.root.body.recipes[x].id, true);\n }\n }\n}", "function renderResults() {\n resultsUlElem.innerHTML = \"\";\n\n for (let product of Product.possibleProducts) {\n let liElem = document.createElement(\"li\");\n liElem.textContent = `${product.name} has ${product.votes} votes, and was shown ${product.timesShown} times.`;\n resultsUlElem.appendChild(liElem);\n }\n}", "function renderResults(servings, standardDrinks, calories) {\n\t\tif (window.logCalculations && (servings || standardDrinks || calories)) {\n\t\t\tconsole.log('=== Calculated ===');\n\t\t\tconsole.log('servings: '+servings);\n\t\t\tconsole.log('standard drinks: '+standardDrinks);\n\t\t\tconsole.log('calories: '+calories);\n\t\t}\n\n\t\t$servingsDisplay.text(servings);\n\t\t$drinksDisplay.text(standardDrinks.toFixed(1));\n\t\t$caloriesDisplay.text(Math.round(calories));\n\t}", "function listRecipes() {\n $(\"#recipe-list\").empty();\n if (recipeData.meals === null) {\n displayError();\n } else {\n for (var i = 0; i < 25; i++) {\n // Add image and title.\n recipeList.push(recipeData.meals[i]);\n var index = recipeList.indexOf(recipeData.meals[i]);\n $(\"#recipe-list\").append(`\n <div class=\"recipe-card\">\n <div class=\"card-thumbnail\">\n <img id=\"recipe-img\" src=${recipeData.meals[i].strMealThumb} height=\"300\" width=\"300\" alt=\"mealImg\">\n </div>\n <h2 class=\"card-title\">${recipeData.meals[i].strMeal}</h2>\n <button class=\"recipe-button card-footer\" value=${index}>Select</button>\n </div>\n `) \n }\n }\n}", "function displayRestauResults(restauData) {\n\t// populate cards\n let innerHTML = '';\n // array of numeric text values used for id-purposes as href values on Materialize .carousel-items\n const index = [ 'one', 'two', 'three', 'four', 'five', 'six', 'seven' ];\n // limit to 7 results for carousel display for better UX \n\tfor (var i = 0; i <= 6; i++) {\n\t\tif (restauData[i]) {\n\t\t\t// url encode special characters for query to Google Maps URL\n\t\t\tconst address = restauData[i].restaurant.location.address;\n\t\t\tconst encodedAddress = address.replace(/ /g, '%20').replace(/,/g, '%2C');\n \n // TODO\n // if user performs fresh search that returns result/s that are already in favorite's the .fav-icon fill status will be out of sync. the script guards against the newly returned result being duplicated in the favorites, and the .fav-icon updates fill status on click so it's not hugely problematic.\n // check if any of the id's of returned results (iterate over carouselEl's nodeList) are already in the favorites nodeList, if so make innerText of i.fav-icon = favorite instead of favorite_border. need to nest 2 loops to iterate 2-dimensionally through 2 arrays.\n // same for events\n\n\t\t\tinnerHTML += `\n <div href=\"#${index[i]}!\" class=\"carousel-item\" data-id=\"restau-${restauData[i]\n\t\t\t\t.restaurant.id}\">\n <div class=\"card\">\n <div class=\"card-image\">\n <img src=\"${restauData[i].restaurant.thumb !== ''\n\t\t\t? restauData[i].restaurant.thumb\n\t\t\t: './assets/images/restau-placeholder-img.jpg'}\">\n </div>\n <div class=\"card-content\">\n <p>${restauData[i].restaurant.name} -- ${restauData[i].restaurant.cuisines}</p>\n </div>\n <div class=\"card-action\">\n <a href=\"${restauData[i].restaurant\n\t\t\t.url}\" class=\"site\" target=\"_blank\"><i class=\"material-icons\">language</i></a>\n <a href=\"https://www.google.com/maps/dir/?api=1&destination=${encodedAddress}\" class=\"location\" target=\"_blank\"><i class=\"material-icons\">directions</i></a>\n <i class=\"material-icons fav-icon\">favorite_border</i>\n </div>\n </div>\n </div>\n `;\n\t\t}\n\t}\n\trestauCarouselEl.innerHTML = innerHTML;\n\t// initialize Materialize Carousel only once relevant content is on the page or error will be thrown\n\tM.Carousel.init($('#restau-carousel.carousel'));\n\n\n}", "function displayRandomMeal(randomMeal) {\n const randomMealData = [];\n // Check if ingredients exist\n for (let j = 1; j <= 20; j++) {\n // push all the ingredient into the array\n if (randomMeal[`strIngredient${j}`]) {\n randomMealData.push(`${randomMeal[`strIngredient${j}`]} : ${randomMeal[`strMeasure${j}`]}`);\n } else {\n break;\n }\n }\n selectedMeal.innerHTML = `\n <div class='random_meal_details'>\n <h1>${randomMeal.strMeal}</h1>\n <img src='${randomMeal.strMealThumb}' alt='${randomMeal.strMeal}' />\n <div class='random_meal_info'>\n ${randomMeal.strCategory ? `<p>${randomMeal.strCategory}</p>` : ''}\n ${randomMeal.strArea ? `<p>${randomMeal.strArea}</p>` : ''}\n </div>\n <div class='random_meal_instructions'>\n <p>${randomMeal.strInstructions}</p>\n <h1>Ingredients</h1>\n <ul>\n ${randomMealData.map( ingredient => `<li>${ingredient}</li>`).join('')}\n </ul>\n </div>\n </div>\n `;\n}", "static fetchRecipes() {\n fetch(BASE_URL)\n .then(resp => resp.json())\n .then(recipes => {\n for( const recipe of recipes) {\n let r = new Recipe(recipe.id, recipe.title, recipe.instructions, recipe.ingredients);\n r.renderRecipe();\n recipe.ingredients.forEach(\n ingredient => {\n let i = new Ingredient(ingredient.id, ingredient.name, ingredient.measurement);\n i.renderIngredient(r);\n })\n }\n \n }) \n }", "function showResults(cupCost, cupPrice) {\n\n console.log();\n console.log(\"------- DISPLAYING RESULTS -------\");\n\n resultForQty(20, cupPrice, cupCost);\n resultForQty(50, cupPrice, cupCost);\n resultForQty(100, cupPrice, cupCost);\n resultForQty(500, cupPrice, cupCost);\n\n}" ]
[ "0.69451636", "0.68298835", "0.67835325", "0.6755989", "0.67546386", "0.6746854", "0.6688006", "0.66744494", "0.66073257", "0.6595526", "0.6547616", "0.6538706", "0.645038", "0.6387835", "0.6350526", "0.63436663", "0.6338856", "0.63351727", "0.63134176", "0.62954134", "0.6276661", "0.62472945", "0.6247224", "0.6187351", "0.6187281", "0.61791134", "0.61200196", "0.60960615", "0.6066093", "0.60558903", "0.6024866", "0.59971803", "0.5993792", "0.5975203", "0.5936574", "0.5931359", "0.5928774", "0.5924805", "0.5923933", "0.5921436", "0.59015197", "0.5895225", "0.5894324", "0.5889838", "0.5877855", "0.5872013", "0.58670634", "0.58578634", "0.58433294", "0.5838024", "0.58314514", "0.58312553", "0.5827552", "0.5827393", "0.58213556", "0.5820431", "0.5819938", "0.5818126", "0.58155286", "0.580606", "0.57987094", "0.57967854", "0.5796576", "0.579559", "0.578901", "0.57740813", "0.5765317", "0.5757003", "0.57519656", "0.57446396", "0.5741506", "0.5739848", "0.573897", "0.5723241", "0.57164985", "0.57101387", "0.5707374", "0.5705401", "0.5699042", "0.5691422", "0.5689472", "0.568892", "0.56873226", "0.56785536", "0.5672763", "0.5671134", "0.5656491", "0.5647787", "0.56457746", "0.5645466", "0.5644108", "0.563965", "0.5627001", "0.5626011", "0.5625685", "0.56256545", "0.5621231", "0.5621189", "0.5619701", "0.5607411" ]
0.66434205
8
only accepts characters, underscore and numbers yet.
function checkSignupUsername(username) { var pattern = /^\w+$/; if (!username.match(pattern)) { $("#signup-error").html('<span style="font-weight: bold">Username is not valid</span><br>It should only contains underline and characters'); return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_alphaDashUnderscore(str)\n{\n \n regexp = /[a-zA-Z_\\-]/;\n\n if (regexp.test(str))\n {\n alert(\"Correct Pattern\");\n }\n else\n {\n alert(\"Incorrect Pattern\");\n }\n}", "function check_string(input) {\r\n var re = new RegExp('[^a-zA-Z0-9-_]+');\r\n if (input.match(re)) { return false; }\r\n else { return true; }\r\n}", "function validateCode(x) {\n\n var validateSpecialChar = /^[0-9\\_\\-]+$/;\n\n if (x.match(validateSpecialChar)) {\n return true;\n }\n else {\n return false;\n }\n}", "function verifyChar(field){\n var currStr = field.value;\n field.value = currStr.replace(/[^A-Z0-9a-z]/g,\"_\")\n}", "startsWith(c){ return c=='_' || Character.isLetter(c) }", "function validateSpecialCharacter(x) {\n var validateSpecialChar = /^[A-Za-z0-9\\_\\-]+$/;\n\n if (x.match(validateSpecialChar)) {\n return true;\n }\n else {\n return false;\n }\n}", "valid(c) { return Character.isAlphabetic(c) || c=='+'||c=='/' }", "function allowAlphaNumericDash(fieldName){\n\tif((event.keyCode < 45)||(event.keyCode > 122)||((event.keyCode > 57)&&(event.keyCode < 65))||((event.keyCode > 90)&&(event.keyCode < 97))||((event.keyCode > 45)&&(event.keyCode < 48))){\n\t\talert(\"Please enter only alphanumeric character or dash for \"+fieldName);\n\t\tevent.returnValue = false;\n\t} //end-if\n}", "function characterSuitableForNames(char) {\n return /[-_A-Za-z0-9]/.test(char); // notice, there's no dot or hash!\n }", "validateInput(char) {\n if (char.search(/^[0-9A-Z\\-\\.\\ \\$\\/\\+\\%]+$/) === -1) {\n return 'Supports A-Z, 0-9, and symbols ( - . $ / + % SPACE).';\n }\n else {\n return undefined;\n }\n }", "function specialValid(val){\n if( /[^a-zA-Z0-9\\-\\/]/.test(val)) {\n // alert('Input is not alphanumeric');\n return false;\n }\n return true;\n}", "function areValidChars(char){\n for(var i=0; i<char.length; i++){\n if(alphabet.indexOf(char[i]) == -1 && char[i] != '_' && char[i] != '\\\\'){\n return char[i];\n }\n }\n return true;\n}", "_isValidPropertyName(str) {\n return /^(?![0-9])[a-zA-Z0-9$_]+$/.test(str);\n }", "static checkInvalidUsernameChars(username) {\n if (!username || username.length === 0) {\n return false;\n }\n let c = username.charAt(0);\n if (c >= '0' && c <= '9') {\n return true;\n }\n return /[^a-zA-Z0-9_]/.test(username)\n }", "function CodelandUsernameValidation(str) {\n // YOUR CODE HERE\n let pattern = \"/^w+$/\";\n if (str.length >= 4 || str.length <= 25)\n if (str[0] === \"/^w\")\n if (str === pattern)\n if (str[str.length - 1] !== \"_\") return true;\n else {return false;};\n}", "function chars(input){\n return true; // default validation only\n }", "function alphaNumericNoSpace(e) {\n var input = String.fromCharCode(e.which);\n var regex = /[a-zA-Z0-9_]/;\n if (!regex.test(input)) {\n if (!e.shiftKey && input != \".\") {\n switch (e.keyCode) {\n case 8://backspace\n case 9://tab\n case 13://enter\n case 35://end\n case 36://home\n case 37://left arrow\n case 38://up arrow\n case 39://right arrow\n case 40://down arrow\n case 46://delete\n return;\n }\n }\n e.preventDefault();\n }\n}", "function chars(input){\n return true; // default validation only\n}", "function chars(input){\n return true; // default validation only\n}", "function chars(input){\n return true; // default validation only\n}", "function chars(input){\n return true; // default validation only\n}", "function chars(input){\n return true; // default validation only\n}", "function chars(input){\n return true; // default validation only\n}", "function chars(input){\n return true; // default validation only\n}", "function chars(input){\n return true; // default validation only\n}", "function chars(input){\n return true; // default validation only\n}", "function chars(input){\n return true; // default validation only\n}", "function chars(input){\n return true; // default validation only\n}", "function chars(input){\n return true; // default validation only\n}", "function isAlnum(char) {\n return char >= 'A' && char <= 'Z' ||\n char >= 'a' && char <= 'z' || char == '_' ||\n isDigit(char);\n}", "function isAlphaNum(c){\r\n return /^\\w$/.test(c);\r\n}", "validateInput(value) {\n if (value.search(/^[0-9A-Z\\-\\.\\*\\$\\/\\+\\ %\\ ]+$/) === -1) {\n return 'Supports A-Z, 0-9, and symbols ( - . $ / + % SPACE).';\n }\n else {\n return undefined;\n }\n }", "static validInput(str) {\n const regExLetters = /[a-z]/gi;\n const regExChars = /[<>{}`\\\\]/gi;\n return !str.length || (regExLetters.test(str) && !regExChars.test(str));\n }", "function isNameValid(name) {\n return /^[A-Za-z0-9_]+$/.test(name)\n}", "function checkInput(input){\n var regex = /(^[a-zA-Z0-9_.-]{5,20})+$/;\n return regex.test(input.value);\n \n}", "validateInput(char) {\n if ((new RegExp(`^${'[\\x20-\\x7F\\xC8-\\xCF]'}+$`)).test(char)) {\n return undefined;\n }\n else {\n return 'Supports only ASCII characters 32 to 127 (0–9, A–Z, a–z), and special characters.';\n }\n }", "function onlyGoodCharacters() {\n //Get element id\n const idName = this.id;\n // Regex that checks if input has somethong that is not a digit\n const current_value = $(`#${idName}`).val();\n const re = new RegExp(/[\\{\\}\\*\\_\\$\\%\\<\\>\\#\\|\\&\\?\\!\\¡\\¿\\[\\]]+/gi);\n const match = re.exec(current_value);\n // Check match\n if (match != null) {\n // remove user input\n $(`#${idName}`).val(\"\");\n // Put error message\n $(`#${idName}_wi`).text(\"¡Ingresaste uno o más caracteres inválidos!\");\n $(`#${idName}_wi`).show();\n } else {\n // Hide error message\n $(`#${idName}_wi`).text(\"\");\n $(`#${idName}_wi`).hide();\n }\n}", "function isValid(idn) {\n return /^[a-zA-Z_$][0-9a-zA-Z$_]{0,}$/g.test(idn)\n }", "function verifyStr(str){\n var regExp = /^[0-9A-Za-z_]$/;\t\n//\tvar regExp = /^[3-9A-NP-Za-hj-km-np-y_]$/;\t\t\t// Not included 0, 1, 2, i, l, o, z, O, Z - and only underscore as special char\n//\t\n\n // if(str != null && str != \"\"){\t// Check if empty\n\t\tfor(var i = 0; i < str.length; i++){ // check each char in string\n\t\t\tif (!str.charAt(i).match(regExp) ){\t// check if char match expression\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t//} else {\n\t//\treturn false;\n\t//}\n return true;\n}", "function handleCommonDefnName(obj, defnValue) {\nvar returnVal = false;\nif(defnValue.search(\"[^A-Za-z0-9_-]\") != -1) {\n alert(\"Name only can contain Alphabets(A/a - Z/z) and Alpha Numeric(0-9) including underscore and Hyphan\");\n obj.value = '';\n returnVal = true;\n }\n return returnVal;\n}", "function handleCommonDefnName(obj, defnValue) {\nvar returnVal = false;\nif(defnValue.search(\"[^A-Za-z0-9_-]\") != -1) {\n alert(\"Name only can contain Alphabets(A/a - Z/z) and Alpha Numeric(0-9) including underscore and Hyphan\");\n obj.value = '';\n returnVal = true;\n }\n return returnVal;\n}", "function a(e){// $ (dollar) and _ (underscore)\n// A..Z\n// a..z\n// \\ (backslash)\nreturn 36===e||95===e||e>=65&&90>=e||e>=97&&122>=e||92===e||e>=128&&l.NonAsciiIdentifierStart.test(String.fromCharCode(e))}", "function isTextSimple(value)\n{\n for(var i = 0; i < value.length; ++ i)\n {\n if(value[i] >= '0' && value[i] <= '9')\n {\n continue;\n }\n if(value[i] >= 'a' && value[i] <= 'z')\n {\n continue;\n }\n if(value[i] >= 'A' && value[i] <= 'Z')\n {\n continue;\n }\n if(value[i] == '_')\n {\n continue;\n }\n return false;\n }\n return true;\n}", "function alphaNumericCheck(id_d)\r\n{\r\n\tvar data_d = getValue(id_d);\r\n\tvar regex=/^[0-9A-Za-z_, -]+$/; //^[a-zA-z]+$/\r\n\tif(regex.test(data_d))\r\n\t{\r\n\t\treturn true;\r\n\t} \r\n\telse \r\n\t{\r\n\t\treturn false;\r\n\t}\r\n}", "function check_alphaDash()\n{\n var input=prompt(\"Enter the value\")\n regexp=/[a-zA-Z_\\-]/; /*Regex for value containing alpha,dash and underscore*/\n\n if (regexp.test(input))\n {\n alert(\"Correct Pattern\");\n }\n else\n {\n alert(\"Incorrect Pattern\");\n }\n}", "validateInput(char) {\n if ((new RegExp(`^${'[\\x00-\\x5F\\xC8-\\xCF]'}+$`)).test(char)) {\n return undefined;\n }\n else {\n return 'Supports only ASCII characters 00 to 95 (0–9, A–Z and control codes) and special characters.';\n }\n }", "function sanitise(name){\n\treturn name.replace(/[^a-zA-Z0-9\\.\\-]/g, '_');\n}", "function isGeneralLegalMailboxChar(charCode) {\n if(isAlphaNumeric(charCode)) {\n return true;\n }\n\n switch(charCode) {\n case 33: // !\n case 35: // #\n case 36: // $\n case 37: // %\n case 38: // &\n case 39: // '\n case 42: // *\n case 43: // +\n case 45: // -\n case 47: // /\n case 61: // =\n case 63: // ?\n case 94: // ^\n case 95: // _\n case 96: // `\n case 123: // {\n case 124: // |\n case 125: // }\n case 126: // ~\n return true;\n\n default:\n return false;\n }\n }", "function validatealphanumeric(key) {\r\n var keycode = (key.which) ? key.which : key.keyCode\r\n var phn = document.getElementById(key);\r\n //comparing pressed keycodes\r\n if (!(keycode == 8 || keycode == 46) && (keycode < 48 || keycode > 57) && (keycode < 64 || keycode > 92) && (keycode < 97 || keycode > 122)) {\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n}", "function validateInput(type, value) {\n\n\t\tvar n = new RegExp(\"^[a-zA-Z\\-_ ’'‘ÆÐƎƏƐƔIJŊŒẞÞǷȜæðǝəɛɣijŋœĸſßþƿȝĄƁÇĐƊĘĦĮƘŁØƠŞȘŢȚŦŲƯY̨Ƴąɓçđɗęħįƙłøơşșţțŧųưy̨ƴÁÀÂÄǍĂĀÃÅǺĄÆǼǢƁĆĊĈČÇĎḌĐƊÐÉÈĖÊËĚĔĒĘẸƎƏƐĠĜǦĞĢƔáàâäǎăāãåǻąæǽǣɓćċĉčçďḍđɗðéèėêëěĕēęẹǝəɛġĝǧğģɣĤḤĦIÍÌİÎÏǏĬĪĨĮỊIJĴĶƘĹĻŁĽĿʼNŃN̈ŇÑŅŊÓÒÔÖǑŎŌÕŐỌØǾƠŒĥḥħıíìiîïǐĭīĩįịijĵķƙĸĺļłľŀʼnńn̈ňñņŋóòôöǒŏōõőọøǿơœŔŘŖŚŜŠŞȘṢẞŤŢṬŦÞÚÙÛÜǓŬŪŨŰŮŲỤƯẂẀŴẄǷÝỲŶŸȲỸƳŹŻŽẒŕřŗſśŝšşșṣßťţṭŧþúùûüǔŭūũűůųụưẃẁŵẅƿýỳŷÿȳỹƴźżžẓ]{2,40}$\"),\n\t\t\te = new RegExp('^[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,50}$'),\n\t\t\tp = new RegExp('^[A-Za-z0-9 -@&$]{8,15}$'),\n\t\t\ts = new RegExp('[0-9]{3}'),\n\t\t\tnum = new RegExp('[0-9]{1,}'),\n\t\t\td = new RegExp('[0-9]{4}[-][0-9]{2}[-][0-9]{2}'),\n\t\t\tz = new RegExp('[A-Za-z]+[0-9]+[A-Za-z]+[-]+[0-9]+[A-Za-z]+[0-9]'),\n\t\t\tc = new RegExp(\"[0-9]{4}[-][0-9]{4}[-][0-9]{4}[-][0-9]{4}\"),\n\t\t\tu = new RegExp('http(s?)(:\\/\\/)(?:(?:[a-zA-Z0-9]+-?)*[a-zA-Z0-9]+)(?:\\.(?:[a-zA-Z0-9]+-?)*[a-zA-Z0-9]+)*(?:\\.(?:[a-zA-Z]{2,}))(?::\\d{2,5})?(?:\\/[^\\s]*)?');\n\n\t\tswitch(type){\n\t\t\t\n\t\t\tcase \"name\" : if (!(n.test(value))) {alert(\"Le nom doit contenir au minimum 2 caracteres.\");return false;}break;\n\t\t\tcase \"pin\" : if (!(s.test(value))) {alert(\"Le code de securite ne peut contenir que 3 chiffres sans espaces.\");return false;}break;\n\t\t\tcase \"num\" : if (!(num.test(value))) {alert(\"Le numero civique ne peut contenir que des chiffres.\");return false;}break;\n\t\t\tcase \"add\" : if (!(n.test(value))) {alert(\"L'adresse doit contenir au minimum 2 caracteres.\");return false;}break;\n\t\t\tcase \"zip\" : if (!(z.test(value))) {alert(\"Le code postal ne correspond pas au format X0X-0X0\");return false;}break;\n\t\t\tcase \"desc\" : if (!(value.length > 1 && value.length < 201)) {alert(\"Le description doit contenir entre 2 et 200 caracteres.\");return false;}break;\n\t\t\tcase \"email\":if (!(e.test(value))) {alert(\"L'adresse courriel n'est pas valide.\");return false;}break;\n\t\t\tcase \"pass\":if (!(p.test(value))) {alert(\"Le mot de passe doit contenir entre 8 et 15 caracteres\");return false;}break;\n\t\t\tcase \"url\":if (!(u.test(value))){alert(\"L'adresse url n'est pas conforme au format demande.\");return false;}break;\n\t\t\tcase \"date\":\n\t\t\t\t\t\t\tif (!(d.test(value))){\n\t\t\t\t\t\t\t\talert(\"La date fournie n'est pas conforme au format 'yyyy-mm-dd'\");\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\tvar d = new Date();\n\t\t\t\t\t\t\t\tvar str = d.getFullYear() + \"-\" + d.getMonth() + \"-\" + d.getDate();\n\t\t\t\t\t\t\t\tvar d2 = new Date(str);\n\t\t\t\t\t\t\t\tvar d1 = new Date(value);\n\t\t\t\t\t\t\t\tif(d1 < d2){\n\t\t\t\t\t\t\t\t\talert(\"La date d'expiration ne peut etre inferieure a la date d'aujourd'hui\");\n\t\t\t\t\t\t\t\t\treturn false;\n\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}\n\t\t\t\t\t\t\tbreak;\n\t\t\tcase \"card\":if (!(c.test(value))){alert(\"Le numero de la carte fourni n'est pas valide'\");return false;}break;\n\t\t\tdefault:return false;\n\t\t}\n\n\t\treturn true;\n\t}", "function only_digit_or_letter(e) {\n // Allow: backspace, delete, tab, escape, enter, . and ,\n if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190, 188]) !== -1 ||\n // Allow: Ctrl+A\n (e.keyCode == 65 && e.ctrlKey === true) ||\n // Allow: Ctrl+R\n (e.keyCode == 82 && e.ctrlKey === true) ||\n // Allow: home, end, left, right, down, up\n (e.keyCode >= 35 && e.keyCode <= 40)) {\n // let it happen, don't do anything\n return;\n }\n // Ensure that it is a number or letter, and stop the keypress\n if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 90)) &&\n (e.keyCode < 96 || e.keyCode > 105)) {\n e.preventDefault();\n }\n}", "function validateSpecialChars(input_val) {\n var re = /[\\/\\\\#,+!^()$~%.\":*?<>{}]/g;\n return re.test(input_val);\n}", "function validateAlphanumeric(field){\n if(/^[a-zA-Z0-9ñÑáÁéÉíÍóÓúÚ\\s\\.,]+$/.test(field.value)){\n setValid(field);\n return true;\n }else{\n setInvalid(field, `Este campo solo debe contener letras y numeros`);\n return false;\n }\n}", "function isLetterAndNumeric(str) {\r\n\tvar re = /[^a-zA-Z0-9-]/g;\r\n\tif (re.test(str)) {\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "validateInput(char) {\n //if (char.search('/[a-zA-Z0-9]*/') === -1) {\n if (char.search(/^[0-9A-Za-z\\-\\.\\ \\@\\$\\/\\+\\%\\!\\@\\#\\$\\%\\&\\*\\^\\(\\)\\_\\+\\=\\<\\>\\?\\{\\}\\[\\]\\~\\-\\Ê]+$/) === -1) {\n return 'Supports only 128 characters of ASCII.';\n }\n else {\n return undefined;\n }\n }", "function filterAllowedChars(str) {\n\t\tvar allowedChars = \"_-\";\n\t\tvar n = str.length;\n\t\tvar returnStr = \"\";\n\t\tvar i = 0;\n\t\tvar _char;\n\t\tvar z;\n\t\tfor (i; i < n; i++) {\n\t\t\t_char = str.charAt(i).toLowerCase(); //convert to lowercase\n\t\t\tif (_char == \"\\\\\") _char = \"/\";\n\t\t\tz = getCharCode(_char);\t\t\t\n\t\t\tif ((z >= getCharCode(\"a\") && z <= getCharCode(\"z\")) || (z >= getCharCode(\"0\") && z <= getCharCode(\"9\")) || allowedChars.indexOf(_char) >= 0) {\n\t\t\t\t//only accepted characters (this will remove the spaces as well)\n\t\t\t\treturnStr += _char;\n\t\t\t}\n\t\t}\n\t\treturn returnStr;\n\t}", "function scanIsAlphanumericHelper(req, res, next) {\n const { errorObj } = res.locals;\n //if the user inputted username format is incorrect, send usernameError msg\n if (!scanIsAlphanumeric(req.body.username)) {\n errorObj.usernameError =\n \"username can only include alphabetical letters and numbers\";\n }\n next();\n}", "function matchNonWordCharacter(e) {\n return (e.match(/^(?=.*[_\\W]).+$/) === null) ? true : false;\n }", "function sanitizeAlphaNumeric(unsafe) {\n return unsafe.toString().replace(requestTypeTypeRegEx, \"\");\n}", "function isAlphaNumericWithSpace(ctrl) {\n var invalidChars = /[^a-zA-Z0-9 ,.;'\\-_]/gi;\n\n\tif (invalidChars.test(ctrl.value)) {\n\t\tctrl.value = ctrl.value.replace(invalidChars, \"\");\n\t}\n\n\tif ((ctrl.value.charAt(0) == ' '))\n\t\tctrl.value = ctrl.value.replace(/\\s+/, '');\n}", "function isAlphaNumeric(input) {\r\n\tvar ck_username=/^\\d*[a-zA-Z][a-zA-Z0-9]*$/;\r\n\tif(!ck_username.test(input)) {\r\n\t\treturn false;\r\n\t} else {\r\n\t\treturn true;\r\n\t}\t\r\n}", "function isAlphaNumeric(input) {\r\n\tvar ck_username=/^\\d*[a-zA-Z][a-zA-Z0-9]*$/;\r\n\tif(!ck_username.test(input)) {\r\n\t\treturn false;\r\n\t} else {\r\n\t\treturn true;\r\n\t}\t\r\n}", "function validarUserName(username){\n username = username.toLowerCase();\n if (!/^[a-zA-Z0-9_-]+$/.test(username)) {\n return true;\n }\n if(username.length == 0) \n return true;\n if(username.length < 6) \n return true;\n if(!isNaN(username[0])) \n return true;\n return false;\n\n }", "function alpha_numeric_space(event){\n var char = event.which;\n if (char > 31 && (char < 48 || char > 57) && (char < 65 || char > 90) && (char < 97 || char > 122) && char != 32 && char != 46) {\n return false;\n }\n}", "function validate_specialChar (id) {\n\tvar obj = document.getElementById(id).value;\n\tif (!obj.replace(/\\s/g, '').length) {\n\t\terror_msg_alert('It should not allow spaces.');\n\t\t$('#' + id).css({ border: '1px solid red' });\n\t\tdocument.getElementById(id).value = '';\n\t\t$('#' + id).focus();\n\t\tg_validate_status = false;\n\t\treturn false;\n\t}\n\telse {\n\t\tvar iChars = '!@#$%^&*()+=-[]\\\\\\';,./{}|\":<>?';\n\t\tfor (var i = 0; i < obj.length; i++) {\n\t\t\tif (iChars.indexOf(obj.charAt(i)) != -1) {\n\t\t\t\terror_msg_alert('It should not allow special character.');\n\t\t\t\t$('#' + id).css({ border: '1px solid red' });\n\t\t\t\tdocument.getElementById(id).value = '';\n\t\t\t\t$('#' + id).focus();\n\t\t\t\tg_validate_status = false;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$('#' + id).css({ border: '1px solid #ddd' });\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n}", "function checkName(name){\r\n\tif(/^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/.test(name))\t\t\r\n\t\treturn true;\r\n\treturn false;\r\n}", "function checkName(name){\r\n\tif(/^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/.test(name))\t\t\r\n\t\treturn true;\r\n\treturn false;\r\n}", "function is_alphanum(str) {\n let curr_char\n for (let i = 0; i < str.length; i ++) {\n curr_char = str.charCodeAt(i)\n if (!(curr_char == 95 || curr_char == 46) &&\n !(curr_char > 47 && curr_char < 58) &&\n !(curr_char > 64 && curr_char < 91) &&\n !(curr_char > 96 && curr_char < 123)) {\n return false\n }\n }\n return true\n}", "function specialCharCheck(field) {\n\t\tif(/[\\\\\\^\\$\\.\\|\\?\\*\\+\\(\\)\\[\\{]/.test(field)){\n\t\t\terrorGenerator(field, \"No special characters\", headers);\n\t\t}\n\t}", "function isAlphaNumericWithApos(alphane)\r\n{ \r\n \r\n \r\n\talphane.value=trim(alphane.value);\r\n var fiedlName=\"\";\r\n if(alphane.id!=null)\r\n fiedlName=alphane.id;\r\n \r\n \r\n if(parseInt(alphane.value)==\"0\") \r\n {\r\n if(fiedlName==\"\")\r\n fiedlName=\"This field\";\r\n \r\n alert(fiedlName+\" can not be zero.\");\r\n alphane.value=\"\";\r\n fiedlName=\"\";\r\n return false;\r\n }\r\n var numaric = trim(alphane.value);\r\n \r\n\t\r\n\tfor(var j=0; j<numaric.length; j++)\r\n\t\t{\r\n\t\t//alert(\"in funvtion\");\r\n\t\t var alphaa = numaric.charAt(j);\r\n\t\t //alert(alphaa);\r\n\t\t var hh = alphaa.charCodeAt(0);\r\n\t\t //alert(hh);\r\n\t\t if((hh > 47 && hh<58) || (hh > 64 && hh<91) || (hh > 96 && hh<123))\r\n\t\t {\r\n\t\t \r\n\t\t //return true;\r\n\t\t }\r\n\t\telse if((hh==64)||(hh==60)||(hh==62)||(hh==61)||(hh==34)|| (hh==35)||(hh==33)||(hh==36)||(hh==37)||(hh==94)||(hh==126))\t\r\n {\r\n if(fiedlName==\"\")\r\n fiedlName=\"this field.\";\r\n \r\n\t\talert(\"Please don't Enter @ , < , > , = , ^ , ! , * , % , $ \\ characters in \"+fiedlName+\".\");\r\n\t\t\t//alert(numaric);\r\n\t\t//alert(numaric.substring(0,numaric.length-1));\r\n\t\t//alphane.value=numaric.substring(0,numaric.length-1);\r\n\t\talphane.value=\"\";\r\n alphane.focus();\r\n \r\n //alphane.select();\r\n\t\treturn false;\r\n\t\t }\r\n\t\t}\r\n\r\n}", "function noAlphaNum(val) {\n return /[a-z0-9]/i.test(val);\n}", "function noAlphaNum(val) {\n return /[a-z0-9]/i.test(val);\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 allowAlphaNumericSpace(fieldName){\n\tif((event.keyCode < 32)||(event.keyCode > 122)||((event.keyCode > 57)&&(event.keyCode < 65))||((event.keyCode > 90)&&(event.keyCode < 97))||((event.keyCode > 32)&&(event.keyCode < 48))){\n\t\talert(\"Please enter only alphanumeric character or space for \"+fieldName);\n\t\tevent.returnValue = false;\n\t} //end-if\n}", "function imageNameCheck(string)\n {\n //http://stackoverflow.com/questions/336210/regular-expression-for-alphanumeric-and-underscores\n var res = string.match(/^[a-z0-9._ -]+$/i);\n if(res==null)\n {\n swal(\"Oops...\", \"Only English alphabet, numbers, space, '.', '-' and '_' is allowed for image/video name\", \"error\");\n return false;\n }\n else\n return true;\n }", "function isValidChar(evt)\n{ \n \n var charCode = evt.keyCode;\n \n /*--------EXCLUDE THE FOLLOWING CHAR CODES--------------\n ! \" # $ % & = 33 to 38\n ( ) * + = 40 to 43\n / = 47 \n 0 1 2 3 4 5 6 7 8 9 = 48 to 57\n : ; < = > ? @ = 58 to 64 \n [ \\ ] ^ _ ` = 91 to 96\n { | } ~ = 123 to 126\n -------------------------------------------------------*/ \n //alert(charCode);\n \n if ((charCode >= 33 && charCode <= 38) ||(charCode >= 40 && charCode <= 43) || (charCode == 47) || (charCode >= 48 && charCode <= 57) || (charCode >= 58 && charCode <= 64) || (charCode >= 91 && charCode <= 96) || (charCode >= 123 && charCode <= 126) )\n {\n \n return false;\n }\n return true;\n}", "function s(e){// $ (dollar) and _ (underscore)\n// A..Z\n// a..z\n// \\ (backslash)\nreturn 36===e||95===e||e>=65&&90>=e||e>=97&&122>=e||92===e||e>=128&&ot.NonAsciiIdentifierStart.test(String.fromCharCode(e))}", "function onKeyPressAlphaNumericOnly(e) \r\n { \r\n var key = window.event ? e.keyCode:e.which; \r\n var keychar = String.fromCharCode(key); \r\n \t\t// alert(key);\r\n reg = /^[a-zA-Z0-9]*$/; \r\n \t\tif(reg.test(keychar))\r\n \t\t{ \r\n \t\t\treturn true; \r\n \t\t}\r\n \t\telse\r\n \t\t{\r\n \t\t\treturn false;\r\n \t\t}\r\n }", "function checkIfOnlyLettersNumbers(field) {\n if (/^[A-Za-z0-9\\s]*$/.test(field.value)) {\n setValid(field);\n return true;\n } else {\n setInvalid(field, `${field.name} must contain only letters and numbers`);\n return false;\n }\n}", "function containsForbiddenCharacters(str) {\n const regex = new RegExp(\"[^(0-9\\\\s-\\\\(\\\\))]\");\n return regex.test(str);\n}", "function usernameValidation() {\n return username.value.match(onlyLettersAndNumsReg);\n}", "function reject_name(name) {\n return banned[name] ||\n ((typeof name !== 'number' || name < 0) &&\n (typeof name !== 'string' || name.charAt(0) === '_' ||\n name.slice(-1) === '_' || name.charAt(0) === '-'));\n }", "validateInput(char) {\n if ((new RegExp(`^${'(\\xCF*[0-9]{2}\\xCF*)'}+$`)).test(char)) {\n return undefined;\n }\n else {\n return 'Supports even number of numeric characters (00-99).';\n }\n }", "function onlyLetters(event)\r\n\t{\r\n\t\tvar key = event.charCode;\r\n if ((key < 65 || key > 90) && (key < 97 || key > 123) || (key == 32))\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n \r\n else\r\n \treturn true;\r\n \t\r\n\t}", "function isalphanumeric(str)\r\n{\r\n\tvar bReturn = true;\r\n\tvar valid=\"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-\";\r\n\tvar invalidfirst = \"_-\";\r\n\tvar invalidlast = \"_-\";\r\n\tfor (var i=0; i<str.length; i++) \r\n\t{\r\n\t\tif ( i == 0 && (invalidfirst.indexOf(str.charAt(i)) > 0))\r\n\t\t{\r\n\t\t\tbReturn = false;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\telse if ( i == (str.length-1) && (invalidlast.indexOf(str.charAt(i)) > 0))\r\n\t\t{\r\n\t\t\tbReturn = false;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\telse if (valid.indexOf(str.charAt(i)) < 0)\r\n\t\t{\r\n\t\t\tbReturn = false;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\treturn(bReturn);\r\n}", "function alphaOnly(event) {\r\n var key = event.keyCode;\r\n //alert(key);\r\n var sp_key = new Array(8,9,13,16,17,18);//array of special keys\r\n var special;\r\n if(sp_key.indexOf(key) == -1){\r\n special=false;\r\n }else{\r\n special=true;\r\n }\r\n var typo = ((key >= 97 && key <= 122) || (key >= 65 && key <= 90) || (special));//checking the keycode\r\n if(!typo){\r\n //alert the error for only character inputs\r\n alert(\"Only Characters are allowed..!!\");\r\n document.getElementById(\"char\").value=\"\";\r\n document.getElementById(\"char\").focus();\r\n document.getElementById(\"char\").style.backgroundColor=\"#E6B0AA\";\r\n }\r\n \r\n}", "function isValidName(data) {\n var re = /^[a-zA-Z0-9_\\- ]*$/;\n\n return re.test(data);\n }", "function isValidIdentifierChar(ch) {\n // Allow ':' because of c++ namespace qualifiers, e.g. UI::DialogPadding::None.\n return isAnsiLetter(ch) || isNumeral(ch) || ch === '_' || ch == ':';\n }", "function restrictAlphabets(e){\n\t\tvar x=e.which||e.keycode;\n\t\tif((x>=48 && x<=57) || x==8 ||\n\t\t\t(x>=35 && x<=40)|| x==46)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n }", "function allowAlphaNumeric(fieldName){\n\tif((event.keyCode < 48)||(event.keyCode > 122)||((event.keyCode > 57)&&(event.keyCode < 65))||((event.keyCode > 90)&&(event.keyCode < 97))){\n\t\talert(\"Please enter only alphanumeric character for \"+fieldName);\n\t\tevent.returnValue = false;\n\t} //end-if\n}", "function alphaNumSpaceOnly(evt)\n{\t\n\tvar charCode = (evt.which) ? evt.which : window.event.keyCode;\n\n\tif (charCode <= 13)\n\t{\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\tvar keyChar = String.fromCharCode(charCode);\n\t\tvar re = /[\\sa-zA-Z0-9_-]/\n\t\treturn re.test(keyChar);\t\t\t\n\t}\t\n}", "function ValidateAlphanumeric(alphanumeric) {\n var myRegEx = /[^a-z\\d]/i;\n var isValid = !(myRegEx.test(alphanumeric));\n return isValid;\n}", "function isAlphanumeric(unsafeText) {\n var regex = /^[a-z0-9-_\\/&\\?=;]+$/i;\n return regex.test(unsafeText);\n}", "function alphanum_allowChar(validatedStringFragment, Char, settings) {\n\n\t\tif (settings.maxLength && validatedStringFragment.length >= settings.maxLength)\n\t\t\treturn false;\n\n\t\tif (settings.allow.indexOf(Char) >= 0)\n\t\t\treturn true;\n\n\t\tif (settings.allowSpace && (Char == \" \"))\n\t\t\treturn true;\n\n\t\tif (settings.blacklistSet.contains(Char))\n\t\t\treturn false;\n\n\t\tif (!settings.allowNumeric && DIGITS[Char])\n\t\t\treturn false;\n\n\t\tif (!settings.allowUpper && isUpper(Char))\n\t\t\treturn false;\n\n\t\tif (!settings.allowLower && isLower(Char))\n\t\t\treturn false;\n\n\t\tif (!settings.allowCaseless && isCaseless(Char))\n\t\t\treturn false;\n\n\t\tif (!settings.allowLatin && LATIN_CHARS.contains(Char))\n\t\t\treturn false;\n\n\t\tif (!settings.allowOtherCharSets) {\n\t\t\tif (DIGITS[Char] || LATIN_CHARS.contains(Char))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "function isSlugInvalid(slugstring) {\n //(only a-z, A-Z, 0-9 and \"_\" are allowed as characters!)\n var forbiddenCharRegex = /^\\w+$/;\n if (!forbiddenCharRegex.test(slugstring)) {return 1;}\n else {return 0;}\n}", "function hasOnlyLetters(fld){\n var rx = /^[a-zA-Z]+$/;\n if(!rx.test(fld.value))\n return false;\n\n return true;\n}", "function account_holder_validate(event, allowSpace) {\n var keycode = ('which' in event) ? event.which : event.keyCode;\n if (allowSpace == true) { var reg = /[^0-9\\[\\]\\/\\\\#,+@!^()§$~%'\"=:;<>{}\\_\\|*?`]/g };\n return (reg.test(String.fromCharCode(keycode)) || keycode == 0 || keycode == 45 ||keycode == 46 || keycode == 8 || (event.ctrlKey == true && keycode == 114) || ( allowSpace == true && keycode == 32))? true : false;\n}", "function checkSpecialChar(data){\n\tvar iChars = \"!@#$%^&*()+=-[]\\\\\\';,./{}|\\\":<>?~_\";\n\tisvalid=true;\n\tfor (var i = 0; i < data.length; i++) {\n\t\tif (iChars.indexOf(data.charAt(i)) != -1) {isvalid=false;}\n\t}return isvalid;\n}", "function check_for_special_chars(input_string){\n const special_chars = /^[!@#\\$%\\^\\&*\\)\\(+=._-]+$/g \n const alphabets_and_numbers = /(?=.*\\d)(?=.*[A-Z])(?=.*[a-z])/g\n const numericals = /^[0-9]+$/g\n const square_brackets = ['[', ']']\n if ( input_string.match(special_chars) || input_string == square_brackets[0] || input_string == square_brackets[1] || input_string.match(numericals) ) {\n return true\n }\n \n}", "validateName() {\n // Do not delete this internal method.\n this.name = this.name.replace(/[^a-z0-9]/gi, '_').toLowerCase();\n }", "function isValidLocal(str)\r\n\t{\r\n // REPLACE THIS CODE WITH YOUR isValidLocal() METHOD\r\n var ch = str.charAt(0);\r\n if (ch == \".\" || ch == \"_\") {\r\n return false;\r\n }\r\n for(var i = 1; i < str.length; ++i) {\r\n var ch = str.charAt(i);\r\n var valid = ((ch >= \"A\" && ch <= \"Z\") || (ch >= \"a\" && ch <= \"z\") \r\n || (ch >= \"0\" && ch <= \"9\") || ch == \".\" || ch == \"_\");\r\n if (!valid) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n\t}" ]
[ "0.7363362", "0.6985202", "0.6966864", "0.6946876", "0.68596256", "0.6846935", "0.68157315", "0.67987156", "0.6755555", "0.673196", "0.66813016", "0.66783214", "0.66766286", "0.667411", "0.665587", "0.66484576", "0.6640965", "0.66202766", "0.66202766", "0.66202766", "0.66202766", "0.66202766", "0.66202766", "0.66202766", "0.66202766", "0.66202766", "0.66202766", "0.66202766", "0.66202766", "0.66085136", "0.65733224", "0.6568783", "0.65664387", "0.65643686", "0.65529674", "0.65468484", "0.65429354", "0.6527556", "0.6522387", "0.65171534", "0.65171534", "0.651466", "0.6507822", "0.6504372", "0.65031004", "0.6496545", "0.6484564", "0.6477364", "0.64314806", "0.6426472", "0.6422767", "0.64217895", "0.64174664", "0.6395365", "0.63922524", "0.6390048", "0.6389002", "0.63849956", "0.63797104", "0.6372346", "0.6367727", "0.6367727", "0.636471", "0.6362612", "0.6351049", "0.63452446", "0.63452446", "0.6340936", "0.6336361", "0.63341236", "0.63309294", "0.63309294", "0.632161", "0.6317057", "0.63162524", "0.63154274", "0.6306646", "0.6300847", "0.6291903", "0.6284899", "0.6282484", "0.62782234", "0.62770844", "0.6274914", "0.62747616", "0.62726647", "0.62714493", "0.6258082", "0.62568945", "0.62464726", "0.6245617", "0.62453467", "0.6239801", "0.62358856", "0.62349594", "0.6219116", "0.6214927", "0.62135094", "0.6211817", "0.6202445", "0.6198677" ]
0.0
-1
Promises with ASYNC and AWAIT key word
async function rainbow(){ await delayColorChange('red', 1000) await delayColorChange('orange', 1000) await delayColorChange('yellow', 1000) await delayColorChange('green', 1000) await delayColorChange('blue', 1000) await delayColorChange('indigo', 1000) await delayColorChange('violet', 1000) return "ALL DONE!!!"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getAsync() {\n return new Promise(function (resolve, reject) {\n setTimeout(() => resolve('Request Completed'), 1000)\n // setTimeout(() => reject(new Error('Time Out not able to process')))\n })\n}", "async function wait() {\n return new Promise((resolve, reject) => {\n setTimeout(() => {\n resolve()\n }, 2000)\n });\n}", "async function asyncAwait() {\n const a = await promise1;\n const b = await promise2;\n\n return [a, b];\n}", "async function myPromise (){\n return \"This is my promise\"\n}", "function wait () { return new Promise( (resolve,reject)=>{ setTimeout(resolve,5000)} )}", "async function cool() {\n let promise = new Promise(function(resolve, reject) {\n setTimeout(() => resolve('All done!'), 1000);\n });\n\n let result = await promise;\n return result;\n}", "async function myfunc() {\n let promise = new Promise((resolve, reject) => {\n setTimeout(() => resolve(\"okk\"), 2000);\n });\n\n const result = await promise;\n // await makes it wait till the promise resolves and after the promise is resolved\n // after that it assigns the data returned from the promise to result\n return result;\n}", "async function fetchAsyncWait() {\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(\n `AsyncWait Alert: HTTP error! status: ${response.status}`\n );\n }\n const tasks = await response.json();\n return tasks;\n }", "async function asyncPromiseAll() {\n //PLACE YOUR CODE HERE:\n}", "async function waiting() {\n const firstValue = await firstAsyncThing();\n const secondValue = await secondAsyncThing();\n console.log(firstValue, secondValue);\n }", "async function callWithPromise() {\n const name = await call.withPromise('This is', 'asynchronism');\n console.log(name);\n}", "async function waitForMyPromise() {\n const promise = new Promise((resolve) => {\n setTimeout(() => {\n resolve('done!!!');\n }, 1000)\n });\n\n const result = await promise;\n console.log('my promise is', result);\n}", "async function async_await(duration) {\n let promise = new Promise((resolve, reject) => {\n setTimeout(() => resolve(\"done!\"), duration)\n });\n\n let result = await promise; // wait till the promise resolves\n return result\n}", "waitResult() {\n if (this.waitList == null) {\n return this.result;\n }\n return new Promise((resolve, reject) => {\n this.waitList.push({resolve: resolve, reject: reject});\n });\n }", "async function concurrent() {\n const firstPromise = firstAsyncThing();\n const secondPromise = secondAsyncThing();\n console.log(await firstPromise, await secondPromise);\n }", "function asyncHelper () {\n\tlet f, r\n\tconst prm = new Promise((_f, _r)=>{f = _f, r = _r})\n\tfunction done(...x){\n\t\treturn x.length === 0 ? f() : r(x[0])\n\t}\n\tdone.then = prm.then.bind(prm)\n\tdone.catch = prm.catch.bind(prm)\n\tdone.finally = prm.finally.bind(prm)\n\treturn done\n}", "function demoOfAsyncAwait(){\n\tfunction mockRequest(second){\n\t const args = [...arguments];\n\t [second,...params] = args;\n\t return new Promise((resolve,reject)=>{\n\t setTimeout(function() {resolve(params)},second*1000);\n\t })\n\t};\n\t //继发,依次执行\n\t async function jifa(){\n\t const a= await mockRequest(1,1,2);\n\t const b= await mockRequest(1,1,2);\n\t const c= await mockRequest(1,1,2);\n\t return [...a,...b,...c];\n\t};\n\t //jifa().then(a=>console.log(a));\n\t \n\t //并发,同时执行\n\t async function wrong_bingfa(){\n\t return Promise.all([await mockRequest(3,1,2),\n\t await mockRequest(3,1,2),\n\t await mockRequest(3,1,2)])\n\t .then(([a,b,c])=>[...a,...b,...c]);\n\t }\n\t //wrong_bingfa()依然是继发执行\n\t async function bingfa(){\n\t const [a,b,c]= await Promise.all([mockRequest(3,10,2),\n\t mockRequest(3,10,2),\n\t mockRequest(3,10,2)]);\n\t return [...a,...b,...c];\n\t\t }\n\t//bingfa().then(a=>console.log(a));\n\t \n\t async function bingfa2(){\n\t const arr=[[4,11,2],[4,11,2],[4,11,2]].map(async item=>{\n\t return await mockRequest(...item);\n\t });\n\t //!!!!!!!! items of 'arr' are Promise instances, not Array instances.\n\t const res=[];\n\t for(const p of arr){\n\t res.push(await p);\n\t }\n\t [a,b,c]=res;\n\t return [...a,...b,...c];\n\t }\n\t/*上面代码中,虽然map方法的参数是async函数,但它是并发执行的,\n\t因为只有async函数内部是继发执行,外部不受影响。\n\t后面的for..of循环内部使用了await,因此实现了按顺序输出。\n*/\n\tbingfa2().then(a=>console.log(a));\n}", "function __awaiter(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(t){o(t)}}function a(e){try{c(n.throw(e))}catch(t){o(t)}}function c(e){e.done?i(e.value):function(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())}))}", "async function ABC() {\n \n let promise = new Promise((resolve, reject) => {\n setTimeout(() => resolve('Done'), 1000)\n });\n\n let result = await promise;\n\n alert(result);\n}", "async function named_async_resolve() {\n return 42;\n }", "function myAsyncOperation() {\n return new Promise((resolve, reject) => {\n doSomethingAsynchronous((err, value) => {\n if (err) reject(err);\n else resolve(value);\n });\n });\n}", "async do() {\n if (this.operations.length === 0) {\n return Promise.resolve();\n }\n this.parallelExecute();\n return new Promise((resolve, reject) => {\n this.emitter.on(\"finish\", resolve);\n this.emitter.on(\"error\", (error) => {\n this.state = BatchStates.Error;\n reject(error);\n });\n });\n }", "async do() {\n if (this.operations.length === 0) {\n return Promise.resolve();\n }\n this.parallelExecute();\n return new Promise((resolve, reject) => {\n this.emitter.on(\"finish\", resolve);\n this.emitter.on(\"error\", (error) => {\n this.state = BatchStates.Error;\n reject(error);\n });\n });\n }", "_asyncWrapper(result) {\r\n if (typeof result === 'object' && 'then' in result) {\r\n return result;\r\n } else {\r\n return new Promise(function(resolve) {\r\n resolve(result);\r\n });\r\n }\r\n }", "function asyncWorkSimple(param) {\n console.log('doing work...', param);\n return new Promise((resolve, reject) => work(100) ? resolve('Succ') : reject('Err'));\n}", "async function myFn() {\n // wait\n}", "async function executar(){\n await esperarPor(2000)\n console.log('Async 1');\n\n await esperarPor(2000)\n console.log('Async 2');\n\n await esperarPor(2000)\n console.log('Async 3');\n\n}", "async function ej3() {\n var res = await prom();\n console.log(res);\n}", "function __awaiter(n,e,t,o){return new(t||(t=Promise))((function(r,l){function a(n){try{s(o.next(n))}catch(e){l(e)}}function i(n){try{s(o.throw(n))}catch(e){l(e)}}function s(n){var e;n.done?r(n.value):(e=n.value,e instanceof t?e:new t((function(n){n(e)}))).then(a,i)}s((o=o.apply(n,e||[])).next())}))}", "async function myFunc() {\n const promise = new Promise((resolve, reject) => {\n setTimeout(() => resolve('Hello'), 1000);\n });\n\n const res = await promise; // Wait until the promise is resolved\n\n return res;\n}", "async function doWork() {\n // use try catch to handle any errors with the promise\n try {\n // await says that the code should wait for this code to finish before executing the next thing\n const response = await makeRequest('Google')\n console.log('Response received')\n const processedResponse = await makeRequest(response)\n console.log(processedResponse)\n // catch will be used if promise rejects instead of resolves\n } catch(err) {\n console.log(err)\n }\n}", "async function fpWait() {\n return new Promise((resolve) => setTimeout(() => resolve(undefined), 2));\n}", "function __awaiter(n,e,t,o){return new(t||(t=Promise))((function(r,i){function a(n){try{s(o.next(n))}catch(e){i(e)}}function l(n){try{s(o.throw(n))}catch(e){i(e)}}function s(n){var e;n.done?r(n.value):(e=n.value,e instanceof t?e:new t((function(n){n(e)}))).then(a,l)}s((o=o.apply(n,e||[])).next())}))}", "async function asyncRequest(options) {\n return new Promise((resolve, reject) => {\n request(options, (error, response, body) => resolve({ error, response, body }));\n });\n }", "async function getData() {\n let promise = new Promise((resolve, reject) => {\n setTimeout(() => resolve('done'), 3000);\n });\n\n //Add await\n let result = await promise;\n console.log(result);\n}", "function doStuffSync() {\n return Promise.resolve('foo')\n // return Promise.reject('nok')\n}", "async function MyAsyncFn () {}", "async function asyncRequest(options) {\n return new Promise((resolve, reject) => {\n request(options, (error, response, body) => resolve({ error, response, body }));\n });\n }", "async function executeSeqWithForAwait(urls) {\n const responses = [];\n const promises = urls.map((url) => {\n return fetchUrlDataWithAsyncAwait(url);\n });\n\n for await (const res of promises) {\n console.log(res);\n responses.push(res);\n }\n console.log(responses);\n}", "async function flushPromises() {\n return Promise.resolve();\n }", "async function flushPromises() {\n return Promise.resolve();\n }", "async function flushPromises() {\n return Promise.resolve();\n }", "async function flushPromises() {\n return Promise.resolve();\n }", "async function flushPromises() {\n return Promise.resolve();\n }", "async function flushPromises() {\n return Promise.resolve();\n }", "async function flushPromises() {\n return Promise.resolve();\n }", "async function flushPromises() {\n return Promise.resolve();\n }", "function wrapInPromiseAsync(asyncFunc){\r\n var promise = new Promise(async((resolve, reject) => {\r\n resolve(await(asyncFunc()));\r\n }));\r\n return promise;\r\n}", "async function noAwait() {\n let value = myPromise();\n console.log(value);\n}", "function getDataAndDoSomethingAsync() {\n getDataAsync()\n .then((data) => {\n doSomethingHere(data);\n })\n .catch((error) => {\n throw error;\n });\n}", "async function asyncFuncExample(){\n let resolvedValue = await myPromise();\n console.log(resolvedValue);\n }", "async function asyncAwaitRequest() {\n const beerListFetches = createBeerListFetches()\n\n console.clear()\n console.log(\"asyncAwaitRequest()\")\n showLoading(\"Async/Await\", true)\n \n const results = await Promise.all(beerListFetches)\n const names = await Promise.all(\n results.map((result) => { \n console.log(`AsyncAwait -> Normalize`)\n return new Promise((resolve) => {\n setTimeout(() => { \n result.json().then((data) => {\n const names = data.map(beer => beer.name)\n .reduce((acc, name) => `${acc}, ${name}`)\n resolve(names)\n })\n }, 2000)\n })\n })\n )\n\n names.forEach((nameList) => console.log(`AsyncAwait Names=[${nameList}]`))\n\n console.log(`AsyncAwait$Done`)\n showLoading(\"Async/Await\", false)\n}", "function success1(a){\n console.log(\"this is success1 \" + a + \"and now executing the new callback\");\n // another async call\n return new Promise(function(resolve,reject){\n setTimeout(function(){\n console.log(\"second promise executing\");\n resolve(\"kadam\");\n },2000);\n });\n\n}", "async function thenify(fn) {\n return await new Promise(function(resolve, reject) {\n function callback(err, res) {\n if (err) return reject(err);\n return resolve(res);\n }\n\n fn(callback);\n });\n}", "function promisify(func) {\n var deferred = $q.defer();\n\n func(function(){\n deferred.resolve();\n });\n\n return deferred.promise;\n }", "async function wait(ms) {\r\n return new Promise((resolve) => setTimeout(resolve, ms));\r\n}", "function AsyncAwaitRequest(url) {\n\n return new Promise(function(resolve, reject) {\n\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, true);\n xhr.send();\n xhr.onreadystatechange = function() {\n if (this.readyState != 4) return;\n\n if (xhr.status != 200) {\n var error = new Error(this.statusText);\n reject(error);\n } else {\n resolve(JSON.parse(this.response))\n }\n }\n })\n}", "function immediately(task){try{suspend();return task();}finally{flush();}}", "async function printDataAsyncAwait() {\n let p = promiseFunction();\n const beta = await p;\n console.log(beta);\n}", "function wait() {\n return new Promise((resolve, reject) => {\n setTimeout(() => resolve(\"hello\"), 1000);\n });\n }", "async function asyncFn(){\n\n return 1;\n}", "async function getDetailsAsync(){\n const details = await getDetails(\"Here is your details from ASYNC AWAIT\");\n\n console.log(details);\n}", "function parallelPromise() {\r\n console.log('==PARALLEL with Promise.then==')\r\n resolveAfter2Seconds().then((message)=>console.log(message))\r\n resolveAfter1Second().then((message)=>console.log(message))\r\n}", "async function doSomething() {\n // resolve is callback function\n //reject is a callback\n\n logger.log('2: function is called');\n return new Promise((resolve, reject) => {\n\n\n // read from the database.. example\n // the following timeout function is asynchronus block of code\n setTimeout(function () {\n // anonymous function that simulates reading from the database\n resolve(\"3:reading from the database\")\n\n\n // error scenarios\n // var error= new Error(\" connection failed with the database\")\n // reject(error);\n }, 3000);\n });\n\n\n\n}", "function __awaiter$1(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,s)}c((r=r.apply(e,t||[])).next())}))}", "async function getRecipesAW(){\n\t\t//waits till the promise is fulfilled and then stores the resolved value in the variable ie. Ids ,recipe ,related here\n\t\tconst Ids = await getIds; \n\t\tconsole.log(Ids);\n\t\tconst recipe=await getRecipe(Ids[2]);\n\t\tconsole.log(recipe);\n\t\tconst related = await getRelated('Jonas');\n\t\tconsole.log(related);\n\t\t\n\t\treturn recipe; //async function also returns a promise always!\n\t}", "function asyncFunction(work){\r\n\treturn new Promise(function(resolve,reject){\t\t//resolve for success and reject for failure\r\n\t\tif (work === \"\")\r\n\t\t\treject(Error(\"Nothing\"));\r\n\t\tsetTimeout(function(){\r\n\t\t\tresolve(work);\r\n\t\t},1000);\r\n\t});\r\n}", "async function fetchUser() {\n // do network request in 10secs. \n resolve('sani');\n}", "function executeAsyncTask() {\n return functionA()\n .then(valueA => {\n return Promise.all([valueA, functionB(valueA)])\n })\n .then(([valueA, valueB]) => {\n return functionC(valueA, valueB)\n })\n}", "await_for(key) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => {\n this.__waiting.get(key).push((value, err) => {\n if (err) {\n return reject(err);\n }\n resolve(value);\n });\n });\n });\n }", "async function test() {}", "function wait(num) {\n return new Promise(function (resolve) {\n setTimeout(function () {\n resolve();\n }, num);\n });\n }", "async function executeHardAsync() {\n const r1 = await fetchUrlData(apis[0]);\n const r2 = await fetchUrlData(apis[1]);\n}", "async function fivePromise() { \n return 5;\n }", "async function flushPromises() {\n // eslint-disable-next-line @lwc/lwc/no-async-operation\n return new Promise((resolve) => setTimeout(resolve, 0));\n }", "function executeAsyncTask() {\n return functionA()\n .then((valueA) => {\n return functionB(valueA)\n .then((valueB) => {\n return functionC(valueA, valueB)\n })\n })\n}", "function async(makeGenerator){\n return function () {\n var generator = makeGenerator.apply(this, arguments);\n\n function handle(result){\n // result => { done: [Boolean], value: [Object] }\n if (result.done) return Promise.resolve(result.value);\n\n return Promise.resolve(result.value).then(function (res){\n return handle(generator.next(res));\n }, function (err){\n return handle(generator.throw(err));\n });\n }\n\n try {\n return handle(generator.next());\n } catch (ex) {\n return Promise.reject(ex);\n }\n }\n}", "function wait () {\n var deferred = $q.defer();\n setTimeout(deferred.resolve, 2000);\n return deferred.promise;\n }", "async function getGoogle() {\n const response = await Future.promise(fetchGoogle);\n \n console.log(response);\n}", "function wait() {\n const delayInMS = 3000;\n return new Promise(resolve => setTimeout(resolve, delayInMS));\n}", "async wait(ms) {\n return new Promise(resolve => {\n setTimeout(resolve, ms);\n });\n }", "async function asyncAwait(){\n \n const promise= await fetch(url); \n\n const jsonPromise=await promise.json();\n\n\n setTimeout(( ) => {\n\n console.log(jsonPromise.status) \n\n }, 3000);\n\n}", "async function cobaAsync() {\n\n try {\n const coba = await cobaPromise();\n console.log(coba);\n } catch (error) {\n console.error(error);\n }\n}", "async function getResult() {\n try {\n const result = await addWithPromise(2)\n console.log(\"Using promise with async and await:\", result);\n }\n catch (err) {\n console.log(err)\n }\n}", "async function executeRequest(url) {\n return new Promise(resolve => {\n request(url, (err, res, body) => {\n if (err) console.log(err);\n resolve(body);\n });\n })\n}", "function executeAsyncTask() {\n let valueA\n return functionA()\n .then((v) => {\n valueA = v\n return functionB(valueA)\n })\n .then((valueB) => {\n return functionC(valueA, valueB)\n })\n}", "async function fivePromise() {\n return 5;\n}", "function async(f) {\n\t return function () {\n\t var argsToForward = [];\n\t for (var _i = 0; _i < arguments.length; _i++) {\n\t argsToForward[_i] = arguments[_i];\n\t }\n\t promiseimpl.resolve(true).then(function () {\n\t f.apply(null, argsToForward);\n\t });\n\t };\n\t}", "function sendAndAwaitCall(e, i) {\n // console.log('sendz', e, i)\n const urlz = 'https://postman-echo.com/delay/3';\n const {\n itemName,\n deferNext,\n action,\n request: {\n verb,\n body\n }\n } = e;\n\n // const d = _callAxios(baseURL + itemName + action, verb, body);\n\n return new Promise((resolve, reject) => {\n\n const time = 1500;\n delay(() => {\n const suffix = (action) ? `${itemName}_${action}` : itemName;\n const reqURL = `${baseURL}${name}/${suffix}`;\n const promise = axios[verb](reqURL, body, axiosConfig);\n return resolve(promise)\n // return resolve({})\n }, deferNext);\n });\n }", "async function funcionConPromesaYAwait(){\n let miPromesa = new Promise((resolved) => {\n resolved(\"Promesa con await\"); \n });\n\n //Ya no es necesario utilizar .then() sino que con await va a recibir el valor\n // y se va a mostrar en consola \n console.log( await miPromesa );\n}", "function someAsyncApiCall(callback) { callback(); }", "function wait(ms) { \n return new Promise(r => setTimeout(r, ms)) \n}", "function async(fn, onError) {\n\t return function () {\n\t var args = [];\n\t for (var _i = 0; _i < arguments.length; _i++) {\n\t args[_i] = arguments[_i];\n\t }\n\t _promise.PromiseImpl.resolve(true).then(function () {\n\t fn.apply(void 0, args);\n\t }).catch(function (error) {\n\t if (onError) {\n\t onError(error);\n\t }\n\t });\n\t };\n\t}", "async function main() {\n // create the promises first\n var call1 = myApiClient(1)\n var call2 = myApiClient(2)\n\n // then wait for them\n var response1 = await call1\n var response2 = await call2\n\n // do something with the responses\n var message = response1['message'] + ' ' + response2['message']\n console.log(message)\n}", "async function wait() {\n await new Promise(resolve => setTimeout(resolve, 1000));\n return 10;\n}", "function wait(ms){\n return new Promise(responseBanana => setTimeout(responseBanana, ms))\n }", "function wait(ms){\n return new Promise(responseBanana => setTimeout(responseBanana, ms))\n }", "function __awaiter$2(n,e,t,o){return new(t||(t=Promise))((function(r,l){function a(n){try{s(o.next(n))}catch(e){l(e)}}function i(n){try{s(o.throw(n))}catch(e){l(e)}}function s(n){var e;n.done?r(n.value):(e=n.value,e instanceof t?e:new t((function(n){n(e)}))).then(a,i)}s((o=o.apply(n,e||[])).next())}))}", "function main() {\n return Promise.all([1, 2, 3, 4].map((value) => asyncThing(value)))\n}", "async function axiosAsync () {\n // await response of fetch call\n let response = await axios.get('https://api.github.com/users/gwenf/repos');\n // only proceed once second promise is resolved\n return data;\n }", "async fetchAsync() {\n // await response of fetch call\n let response = await fetch(this.restApiUrl + this.params);\n // only proceed once promise is resolved\n return await response.json();\n }" ]
[ "0.6553737", "0.6383381", "0.638172", "0.6263895", "0.62584543", "0.62299913", "0.62268287", "0.62250835", "0.6224844", "0.61918145", "0.6190504", "0.6133515", "0.6083388", "0.6041018", "0.602841", "0.60243505", "0.60241455", "0.6023793", "0.6015646", "0.60151815", "0.59913254", "0.5977421", "0.5977421", "0.59761125", "0.5974709", "0.59703505", "0.5969814", "0.5963351", "0.59616154", "0.5939706", "0.5924774", "0.5921052", "0.5920902", "0.59150165", "0.591121", "0.590814", "0.5900974", "0.5885045", "0.587181", "0.5858377", "0.5858377", "0.5858377", "0.5858377", "0.5858377", "0.5858377", "0.5858377", "0.5858377", "0.5848081", "0.584729", "0.5844157", "0.5841462", "0.58296597", "0.58292", "0.58233005", "0.5817657", "0.5807394", "0.5804227", "0.5802462", "0.5794627", "0.5784513", "0.5783755", "0.57791895", "0.57757336", "0.57724905", "0.57718474", "0.576808", "0.5750009", "0.5739666", "0.5722271", "0.5715834", "0.5706767", "0.570316", "0.5699109", "0.56985235", "0.56965536", "0.5695782", "0.56938463", "0.56856513", "0.5683762", "0.5682139", "0.56819093", "0.5678649", "0.567759", "0.56721884", "0.5672137", "0.56682646", "0.5660809", "0.5658202", "0.5652914", "0.5641769", "0.5640084", "0.5634702", "0.5634297", "0.56318915", "0.5629794", "0.56297714", "0.56297714", "0.5629179", "0.56242996", "0.5621771", "0.562125" ]
0.0
-1
document.getElementById("name").value = ""; document.getElementById("email").value = ""; document.getElementById("text").value = ""; }
function signup(){ console.log("hello") let name=document.getElementById('firstname').value let email=document.getElementById("email").value let password=document.getElementById("password").value console.log(email,password) firebase.auth().createUserWithEmailAndPassword(email, password) .then(function(user) { Swal.fire('Registration Successful') setTimeout(function() { window.location.href = "../login/index.html" }, 5000) }) .catch(function(error) { Swal.fire({ icon: 'error', title: 'Abe teri...', text: error.message }) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clear() {\r\n\tdocument.getElementById(\"fName\").value = \"\";\r\n\tdocument.getElementById(\"lName\").value = \"\";\r\n\tdocument.getElementById(\"email\").value = \"\";\r\n\tdocument.getElementById(\"pNo\").value = \"\";\r\n}", "clearField() {\n document.querySelector('#name').value = '';\n document.querySelector('#email').value = '';\n document.querySelector('#profession').value = '';\n }", "function clearInput() {\n document.getElementById(\"name\").value = \"\",\n document.getElementById(\"emailaddress\").value = \"\",\n document.getElementById(\"message\").value = \"\";\n}", "clearFields(){\n document.querySelector(\"#contName\").value = '';\n document.querySelector(\"#contAge\").value = '';\n document.querySelector(\"#contLocation\").value = '';\n document.querySelector(\"#song\").value = '';\n document.querySelector(\"#link\").value = '';\n \n\n }", "function limpiar(){\n\tdocument.getElementById(\"nombre\").value=\"\";\n\tdocument.getElementById(\"pais\").value=\"\";\n\tdocument.getElementById(\"correo\").value=\"\";\n\t\n}", "function clearRegister() {\n document.getElementById(\"name\").value = \"\";\n document.getElementById(\"phone\").value = \"\";\n document.getElementById(\"email\").value = \"\";\n document.getElementById(\"city\").value = \"\";\n}", "clearFields() {\r\n document.getElementById('title').value = '',\r\n document.getElementById('author').value = '',\r\n document.getElementById('isbn').value = '';\r\n }", "clearInputs(){\n document.getElementById(\"form_name\").value = \"\";\n document.getElementById(\"form_email\").value = \"\";\n document.getElementById(\"form_phone\").value = \"\";\n document.getElementById(\"form_relation\").value = \"\";\n }", "function empty(){\n document.getElementById('fname').value=\"\";\ndocument.getElementById('lname').value=\"\";\ndocument.getElementById('uemail').value=\"\";\ndocument.getElementById('upass').value=\"\";\ndocument.getElementById('uage').value=\"\";\n}", "function limpiarFormulario() {\n\n document.getElementById(\"nombre\").value = \"\";\n document.getElementById(\"apellidos\").value = \"\";\n document.getElementById(\"telefono\").value = \"\";\n document.getElementById(\"fecha\").value = \"\";\n}", "function cleanInput() {\n document.getElementById(\"name\").value = \"\";\n document.getElementById(\"age\").value = \"\";\n document.getElementById(\"gender\").value = \"\";\n document.getElementById(\"position\").value = \"\";\n}", "function clearFields(){\n document.querySelector('#name').value = ''\n document.querySelector('#caption').value = ''\n document.querySelector('#url').value = ''\n}", "clearFields() {\n document.getElementById('title').value = '';\n document.getElementById('author').value = '';\n document.getElementById('isbn').value = '';\n }", "function clearData(){\n\tdocument.getElementById('userName').value = \"\";\n\tdocument.getElementById('jobTitle').value = \"\";\n\tdocument.getElementById('license').value = \"\";\n\tdocument.getElementById('cellPhone').value = \"\";\n\tdocument.getElementById('phone').value = \"\";\n\tdocument.getElementById('date_from').value = \"\";\n\tdocument.getElementById('date_end').value = \"\";\n}", "clearFields(){\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#reference').value = '';\n document.querySelector('#price').value = '';\n }", "clearFields() {\n document.getElementById('title').value='';\n document.getElementById('author').value='';\n document.getElementById('isbn').value='';\n }", "function limpiar()\n{\n\tdocument.getElementById('nom').value='';\n\tdocument.getElementById('nom').focus();\n\tdocument.getElementById('emp').value='';\n\tdocument.getElementById('tel').value='';\n\tdocument.getElementById('mail').value='';\n\tdocument.getElementById('comen').value='';\t\n}", "function clearform() {\n document.getElementById('emailinput').value = '';\n document.getElementById('passinput').value = '';\n}", "function clearInputs(){\r\n\r\n nameInput.value=\"\";\r\n emailInput.value=\"\";\r\n passInput.value =\"\";\r\n repassInput.value =\"\";\r\n ageInput.value =\"\";\r\n phoneInput.value =\"\";\r\n\r\n\r\n\r\n}", "function clearContact() {\n document.getElementById('id').value = \"\";\n document.getElementById('primary-contact').value = \"\";\n document.getElementById('firstN').value = \"\";\n document.getElementById('lastN').value = \"\";\n document.getElementById('emailN').value = \"\";\n document.getElementById('home-phone').value = \"\";\n document.getElementById('business-phone').value = \"\";\n}", "function limpiaCampos(){\n $(\"#name2\").val('');\n $(\"#email2\").val('');\n $(\"#password2\").val('');\n $(\"#repassword2\").val('');\n $(\"#telefono2\").val('');\n $(\"#empresa2\").val('');\n $(\"#persona2\").val('');\n }", "static clearFields(){\n document.getElementById('title').value = '';\n document.getElementById('author').value = '';\n document.getElementById('isbn').value = '';\n }", "function emptyFields() {\n document.getElementById(\"title\").value = null;\n document.getElementById(\"urgency\").value = \"High Urgency\";\n document.getElementById(\"importance\").value = \"High Importance\";\n document.getElementById(\"date\").value = null;\n document.getElementById(\"description\").value = null;\n}", "function limpiarCampos(){\n $(\"#titulo\").val(\"\");\n $(\"#mensaje\").val(\"\");\n}", "function clearInputs(){\n signUpName.value = \"\" ;\n signUpEmail.value = \"\" ;\n signUpPass.value = \"\" ;\n}", "function resetForm() {\r\n document.getElementById(\"fullName\").value = \"\";\r\n document.getElementById(\"phone\").value = \"\";\r\n}", "function clearData() {\n $('#user_name').val('');\n $('#user_age').val('');\n $('#user_ph').val('');\n $('#user_email').val('');\n}", "function clearForm() {\n fullName.value = \"\";\n message.value = \"\";\n hiddenId.value = \"\";\n}", "function limpiar(){\n\tnombre.value=\"\";\n\tdireccion.value=\"\";\n\ttelefono.value=\"\";\n}", "function emptyFields() {\n $(\"#name\").val(\"\");\n $(\"#profile-input\").val(\"\");\n $(\"#email-input\").val(\"\");\n $(\"#password-input\").val(\"\");\n $(\"#number-input\").val(\"\");\n $(\"#fav-food\").val(\"\");\n $(\"#event-types\").val(\"\");\n $(\"#zipcode\").val(\"\");\n $(\"#radius\").val(\"\");\n }", "function clearInputfields() {\r\n\t$('#title').val('');\r\n\t$('#desc').val('');\r\n\t$('#email').val('');\r\n}", "function clearInput() {\n $(\"input#new-first-name\").val('');\n $(\"input#new-last-name\").val('');\n $(\"input#new-phone-number\").val('');\n $(\"input#new-email-address\").val('');\n $(\"input#new-physical-address\").val('');\n}", "resetFields(){\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#isbn').value = '';\n }", "function clrTxt() {\n\n document.getElementById(\"latitude\").value = \"\";\n document.getElementById(\"longitude\").value = \"\";\n document.getElementById(\"latitude2\").value = \"\";\n document.getElementById(\"longitude2\").value = \"\"; \n\n}", "function clearField() {\r\n document.getElementById(\"fname\").value = \"\";\r\n}", "function clearProfileForm() {\n document.getElementById(\"profileFullName\").value = \"\";\n document.getElementById(\"profileUsername\").value = \"\";\n document.getElementById(\"profilePassword\").value = \"\";\n document.getElementById(\"profilePhone\").value = \"\";\n document.getElementById(\"profileStreet\").value = \"\";\n document.getElementById(\"profileCity\").value = \"\";\n document.getElementById(\"profileState\").value = \"\";\n document.getElementById(\"profileZip\").value = \"\";\n}", "function cleanInputs() {\n document.getElementById(\"nameInput\").value = \"\";\n document.getElementById(\"latitudeInput\").value = \"\";\n document.getElementById(\"longitudeInput\").value = \"\";\n }", "static clearFields(){\n document.querySelector('#title').value ='';\n document.querySelector('#author').value ='';\n document.querySelector('#isbn').value ='';\n }", "function limpiar(){\ndocument.getElementById('descripcion').value=\"\";\ndocument.getElementById('monto').value=\"\"; \n}", "function clearInputFields() {\n $('#firstName').val('');\n $('#lastName').val('');\n $('#idNumber').val('');\n $('#jobTitle').val('');\n $('#annualSalary').val('');\n} // END: clearInputFields()", "function funClear(){\n\n document.getElementById(\"dri-name\").value = \"\";\n document.getElementById(\"dri-num\").value = \"\";\n document.getElementById(\"lic-num\").value = \"\";\n document.getElementById(\"lic-exp-date\").value = \"\";\n\n}", "function resetInputFields() {\n document.getElementById(\"description\").value = '';\n document.getElementById(\"value\").value = '';\n}", "function limpiar(){\n document.getElementById(\"idCodigo\").value = \"\";\n document.getElementById(\"idMessagetext\").value = \"\";\n\n}", "function clear_input() {\r\n $(\"#name\").val('');\r\n $(\"#time\").val('');\r\n $(\"#date\").val('');\r\n}", "function clearFields() {\n document.getElementById(\"text-field\").value = \"\";\n }", "function limpiar() {\n\n document.querySelector(\"#txtCodigo\").value = \"\";\n document.querySelector(\"#txtNombre\").value = \"\";\n document.querySelector(\"#nHoras\").value = \"\";\n document.querySelector(\"#nCosto\").value = \"\";\n document.querySelector(\"#txtFechaInicio\").value = \"\";\n document.querySelector(\"#txtFechaFin\").value = \"\";\n\n}", "static clearField(){\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#isbn').value = '';\n }", "function clearContactForm() {\n document.getElementById('user-id').value = \"\";\n document.getElementById('filter-value').value = \"\";\n}", "function resetForm() {\r\n document.getElementById('fname').value = '';\r\n document.getElementById('lname').value = '';\r\n document.getElementById('birthdate').value = '';\r\n document.getElementById('fees').value = '';\r\n}", "function clearFormFields() {\n\t$(\".user-name\").val(\"\");\n\t$(\".user-email\").val(\"\");\n}", "clearFields() {\n document.getElementById('product-name').value = '';\n document.getElementById('price').value = '';\n document.getElementById('qty').value = '';\n }", "clearFields() {\n document.getElementById('product-name').value = '';\n document.getElementById('price').value = '';\n document.getElementById('qty').value = '';\n }", "static clearFields() {\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#isbn').value = '';\n }", "function clearFields() {\n employeeId.value = \"\";\n firstName.value = \"\";\n lastName.value = \"\";\n address.value = \"\";\n emailId.value = \"\";\n}", "function cleanForm(){\n formFirst.value = \"\";\n formLast.value = \"\";\n formEmail.value = \"\";\n formMessage.value = \"\";\n}", "function limpa_formulário_cep() {\r\n //LIMPA VALORES DO FORMULÁRIO DE CEP\r\n document.getElementById('rua').value=(\"\");\r\n document.getElementById('bairro').value=(\"\");\r\n document.getElementById('cidade').value=(\"\");\r\n document.getElementById('uf').value=(\"\");\r\n}", "function clairtxtBoxAmAut(){\n document.getElementById(\"txtedNomAuteur\").value = \"\";\n document.getElementById(\"txtedPreAuteur\").value = \"\";\n}", "function clear() {\n $('#name').val(\"\");\n $('#email').val(\"\");\n $('#tech').val(\"\");\n $('#userid').val(0);\n $('#btnNewUser').show();\n $('#btnUpdateUser').hide();\n $(\"#email\").removeAttr('disabled');\n}", "function Limpiar()\n{\n\t$('input#nombre').val(\"\");\n\t$('input#id').val(\"\");\n}", "static clearFields() {\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#rating').value = '';\n document.querySelector('#price').value = '';\n document.querySelector('#isbn').value = '';\n }", "function ClearFields() {\n\n document.getElementById(\"img\").value = \"\";\n document.getElementById(\"name\").value = \"\";\n document.getElementById(\"description\").value = \"\";\n document.getElementById(\"price\").value = \"\";\n document.getElementById(\"stock\").value = \"\";\n document.getElementById(\"idProdus\").value = \"\";\n}", "function resetForm() {\n document.getElementById('name').value = '';\n document.getElementById('feet').value = '';\n document.getElementById('inches').value = '';\n document.getElementById('weight').value = '';\n document.getElementById('diet').value = 'Herbavor';\n}", "function clearAddInputs(){\n $addUserNameInput.value = ''\n $addFullNameInput.value = ''\n $addEmailInput.value = ''\n $addPasswordInput.value = ''\n}", "function resetForm (){\n\n $(\"username\").val(\"\");\n\n $(\"#useremail\").val(\"\");\n\n $(\"#id\").val(\"\");\n\n}", "function limpiar (){\n document.getElementById(\"nuevoPendiente\").value = \"\";\n document.getElementById(\"otrosPendientes\").value = \"\";\n document.getElementById(\"nLista\").value = \"\";\n}", "function clearForm() {\n $(\"#name-input\").val(\"\");\n $(\"#destination-input\").val(\"\")\n $(\"#firstTime-input\").val(\"\");\n $(\"#frequency-input\").val(\"\");\n }", "function limpiar() {\n $('#txtSerie').val('');\n $('#txtNombre').val('');\n $('#txtSemestre').val('');\n $('#txtCarrera').val('');\n $('#txtHPracticas').val('');\n}", "static clearFields() {\n document.querySelector('#date').value = '';\n document.querySelector('#title').value = '';\n document.querySelector('#post').value = '';\n }", "function clearInputFields(){\n $( '#idInput').val( '' );\n $( '#firstNameInput').val( '' );\n $( '#lastNameInput').val( '' );\n $( '#roleInput').val( '' );\n $( '#salaryInput').val( '' );\n}", "function clearFields() {\n firstName.value = \"\";\n lastName.value = \"\";\n jobYears.value = \"\";\n salary.value = \"\";\n position.value = \"\";\n team.value = \"\";\n phone.value = \"\";\n email.value = \"\";\n paysTax.checked = false;\n}", "function resetInputs () {\n document.querySelector('#nm').value = \"\"\n document.querySelector('#desc').value = \"\"\n }", "function clearText () {\n\tdocument.getElementById('userName').placeholder = \"\";\n}", "clearFormInputs() {\n const formElement = document.querySelector(this.newsletterFormSelector);\n\n formElement.name.value = \"\";\n formElement.email.value = \"\";\n }", "function clearInputs() {\n $('#firstNameIn').val('');\n $('#lastNameIn').val('');\n $('#employeeIDIn').val('');\n $('#jobTitleIn').val('');\n $('#annualSalaryIn').val('');\n}", "function limpiarOrden(){\r\n document.getElementById(\"codigoOrden\").value = \"\";\r\n document.getElementById(\"FechaPedido\").value = \"\";\r\n document.getElementById(\"FechaEntrega\").value = \"\";\r\n document.getElementById(\"DescripcionOrden\").value = \"\";\r\n}", "function clearValue() {\n setEmail(\"\");\n setPassword(\"\");\n }", "clearInsideInput() {\n const title = document.getElementById(\"title\");\n const author = document.getElementById(\"author\");\n const isbn = document.getElementById(\"isbn\");\n\n title.value = \"\";\n author.value = \"\";\n isbn.value = \"\";\n }", "function borrarCampos(){\n email.value= '';\n asunto.value='';\n mensaje.value= '';\n btnEnviar.disabled = true; \n}", "function clearForm(){\n\t$('#Bio').val('');\n\t$('#Origin').val('');\n\t$('#Hobbies').val('');\n\t$('#DreamJob').val('');\t\n\t$('#CodeHistory').val('');\n\t$('#Occupation').val('');\n\t$('#CurrentMusic').val('');\n\n}", "function clearFormsMC() {\n document.getElementById('mcname').value = \"\";\n document.getElementById('choice1').value = \"\";\n document.getElementById('choice2').value = \"\";\n document.getElementById('choice3').value = \"\";\n document.getElementById('choice4').value = \"\";\n document.getElementById('choice5').value = \"\";\n}", "function limpiar_cabecera() {\n\tdocument.getElementById(\"cod_cliente\").value = \"\";\n\tdocument.getElementById(\"nombre_cliente\").value = \"\";\n\tdocument.getElementById(\"telefono\").value = \"\";\n\tdocument.getElementById(\"cif\").value = \"\";\n\tdocument.getElementById(\"calle\").value = \"\";\n\tdocument.getElementById(\"ciudad\").value = \"\";\n\tdocument.getElementById(\"provincia\").value = \"\";\n\tdocument.getElementById(\"email\").value = \"\";\n\tdocument.getElementById(\"cod_postal\").value = \"\";\n}", "function formClear()\r\n{\r\n $(\"#name\").val(\"\");\r\n $(\"#email\").val(\"\") ;\r\n $(\"#website\").val(\"\") ;\r\n $(\"#imageLink\").val(\"\");\r\n document.getElementById(\"male\").checked = true;\r\n document.getElementById(\"java\").checked = true;\r\n document.getElementById(\"html\").checked = false;\r\n document.getElementById(\"css\").checked = false;\r\n document.getElementById(\"errorMsg\").innerHTML = \"<br>\";\r\n\r\n}", "function resetForm() {\ndocument.getElementById(\"nome\").value = \"\";\ndocument.getElementById(\"cognome\").value = \"\";\ndocument.getElementById(\"età\").value = \"\";\n}", "function clearAddInput() {\n $(\".add-firstName\").val(\"\");\n $(\".add-lastName\").val(\"\");\n $(\".add-phone\").val(\"\");\n $(\".add-address\").val(\"\");\n}", "function clearAddContactFormInputs() {\n $('#first_name').val(\"\");\n $('#last_name').val(\"\");\n $('#email').val(\"\");\n $('#phone').val(\"\");\n}", "function limparCamposAdicionar() {\n document.getElementById(\"adicionarId\").value = \"\"\n document.getElementById(\"adicionarNome\").value = \"\"\n document.getElementById(\"adicionarValor\").value = \"\"\n}", "function cleanUpInputFields() {\n // Replace values\n firstNameInput.value = \"\";\n lastNameInput.value = \"\";\n titleInput.value = \"\";\n ratingInput.value = \"\";\n}", "function clearFields () {\n\tdocument.getElementById(\"net-sales\").value = \"\";\n\tdocument.getElementById(\"20-auto-grat\").value = \"\";\n\tdocument.getElementById(\"event-auto-grat\").value = \"\";\n\tdocument.getElementById(\"charge-tip\").value = \"\";\n\tdocument.getElementById(\"liquor\").value = \"\";\n\tdocument.getElementById(\"beer\").value = \"\";\n\tdocument.getElementById(\"wine\").value = \"\";\n\tdocument.getElementById(\"food\").value = \"\";\n}", "function clearForm() {\n document.getElementById(\"timeEndOfTask\").value = \"\";\n document.getElementById(\"dateEndOfTask\").value = \"\";\n document.getElementById(\"enterNoteText\").value = \"\";\n}", "function clearFields() {\n movie_name.value = '';\n release_date.value = '';\n movie_banner.value = '';\n description.value = '';\n}", "function clearForm(){\r\n\tdocument.getElementById(\"reminderDate\").value = \"\";\r\n\tdocument.getElementById(\"reminderMonth\").value = \"\";\r\n\tdocument.getElementById(\"reminderYear\").value = \"\";\r\n\tdocument.getElementById(\"reminderMode\").value = \"\";\r\n\tdocument.getElementById(\"reminderId\").value = \"\";\r\n}", "function clearInputs() {\n noteText.value = \"\";\n noteHead.value = \"\";\n}", "function clearUpdateCustomerField() {\n\t$(\"#CusFirstnameUp\").val(\"\");\n\t$(\"#CusMiddlenameUp\").val(\"\");\n\t$('#CusLastnameUp').val(\"\");\n\t$(\"#CusMeternumberUp\").val(\"\");\n\t$(\"#CusContactUp\").val(\"\");\n\t$(\"#CusAddressUp\").val(\"\");\n}", "function clearFormsSA() {\n document.getElementById('saname').value = \"\";\n}", "function clearTextBoxes() {\n\n document.getElementById(\"location_latitude\").value = \"\";\n\tdocument.getElementById(\"location_longitude\").value = \"\";\n\n}", "function resetForm(){\n\n\tdocument.getElementById(\"name\").value = \"\";\n\tdocument.getElementById(\"name1\").value = \"\";\n\tdocument.getElementById(\"name2\").value = \"\";\n\n\tdocument.getElementById(\"way\").value = \"\";\n\tdocument.getElementById(\"textaddress\").value = \"\";\n\tdocument.getElementById(\"textaddressnumber\").value = \"\";\n\tdocument.getElementById(\"textaddressblock\").value = \"\";\n\tdocument.getElementById(\"textaddressscale\").value = \"\";\n\tdocument.getElementById(\"textaddressfloor\").value = \"\";\n\tdocument.getElementById(\"textaddressdoor\").value = \"\";\n\tdocument.getElementById(\"textpostalcode\").value = \"\";\n\tdocument.getElementById(\"city\").value = \"\";\n\n\tdocument.getElementById(\"emailbox\").value = \"\";\n\tdocument.getElementById(\"passwordbox\").value = \"\";\n\tdocument.getElementById(\"passwordrepeatbox\").value = \"\";\n\n\talert(\"El formulario se ha borrado con éxito.\");\n}", "function limpiar() {\r\n $(\"#txtNit\").val(\"\");\r\n $(\"#txtNombres\").val(\"\");\r\n $(\"#txtTelC\").val(\"\");\r\n $(\"#bDepartamento\").val(\"\");\r\n $(\"#cbMunicipio\").val(\"\");\r\n $(\"#txtCorreo\").val(\"\");\r\n $(\"#txtDescripcion\").val(\"\");\r\n $(\"#txtCIIU\").val(\"\");\r\n $(\"#txtProSer\").val(\"\");\r\n $(\"#txtEmpleados\").val(\"\");\r\n $(\"#fileFoto\").val(\"\");\r\n}", "function clearForm() {\n document.getElementById('dest').value = '';\n document.getElementById('startDate').value = '';\n document.getElementById('endDate').value = '';\n}", "function removeContact() {\n\t$(\"#civis\").val(\"madame\");\n\t$(\"#firstName\").val(\"\");\n\t$(\"#lastName\").val(\"\");\n\t$(\"#phoneNumber\").val(\"\");\n}", "function fieldReset() {\n\tdocument.getElementById('oldName').value = '';\n\tdocument.getElementById('newName').value = '';\n}", "function limpiarDetalles(){\r\n document.getElementById(\"Cantidad\").value = \"\";\r\n document.getElementById(\"Precio\").value = \"\";\r\n}" ]
[ "0.8624978", "0.8609421", "0.8574828", "0.8385752", "0.8380449", "0.8374699", "0.8349204", "0.83260137", "0.8325959", "0.8288185", "0.826313", "0.8252528", "0.82156146", "0.82105815", "0.8157145", "0.81267375", "0.8124559", "0.8055372", "0.8040568", "0.8038331", "0.8024494", "0.8024241", "0.80234396", "0.8010967", "0.79929346", "0.79786134", "0.7977041", "0.79758054", "0.797482", "0.7966057", "0.7952962", "0.79345334", "0.79341656", "0.79314756", "0.793127", "0.7911553", "0.7902962", "0.7901908", "0.790165", "0.7895153", "0.7890966", "0.7877079", "0.7872898", "0.7871596", "0.7854466", "0.78455216", "0.7843577", "0.784319", "0.78329414", "0.7799938", "0.77923816", "0.77923816", "0.7785101", "0.7782007", "0.77768344", "0.7769431", "0.7769262", "0.7746487", "0.773148", "0.7722681", "0.77123886", "0.77074194", "0.7695508", "0.769214", "0.7670731", "0.76613516", "0.76577824", "0.7653955", "0.7653494", "0.7632302", "0.76317734", "0.7622164", "0.7607578", "0.75970393", "0.7597003", "0.7596783", "0.7590388", "0.7578652", "0.7578083", "0.7577958", "0.7575941", "0.7575258", "0.7563751", "0.75635946", "0.756089", "0.7559667", "0.7552236", "0.7551399", "0.7551187", "0.754342", "0.7507119", "0.7498396", "0.74816394", "0.74789095", "0.7478858", "0.74770844", "0.7475226", "0.7465218", "0.7463201", "0.7459639", "0.7458631" ]
0.0
-1
! Ender: open module JavaScript framework (clientlib) License MIT
function e(e,n){var r;if(this.length=0,"string"==typeof e&&(e=t._select(this.selector=e,n)),null==e)return this;if("function"==typeof e)t._closure(e,n);else if("object"!=typeof e||e.nodeType||(r=e.length)!==+r||e==e.window)this[this.length++]=e;else for(this.length=r=r>0?~~r:0;r--;)this[r]=e[r]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "GetAppCode(Site, User=\"null\", UserId=\"null\", Admin=false){\n let MyApp = new Object()\n MyApp.JS = \"\"\n MyApp.CSS = \"\"\n\n let fs = require('fs')\n let os = require('os')\n\n // Ajout des modules de CoreX\n MyApp.JS += fs.readFileSync(__dirname + \"/Client_CoreX_Modules.js\", 'utf8') + os.EOL\n MyApp.JS += fs.readFileSync(__dirname + \"/Client_CoreX_Module_CoreXBuild.js\", 'utf8') + os.EOL\n MyApp.JS += fs.readFileSync(__dirname + \"/Client_CoreX_Module_CoreXApp.js\", 'utf8') + os.EOL\n MyApp.JS += fs.readFileSync(__dirname + \"/Client_CoreX_Module_SocketIo.js\", 'utf8') + os.EOL\n MyApp.JS += `\n // Creation de l'application\n let MyApp = new CoreXApp(`+this._AppIsSecured+`,`+ this._Usesocketio +`)\n // Fonction globale Admin is user\n function GlobalIsAdminUser(){\n return `+ Admin +`\n }\n // Fonction globale GlobalStart\n function GlobalStart(){\n MyApp.Start()\n }\n // Fonction global reset de l'application\n function GlobalReset(){\n MyApp.ResetCoreXApp()\n }\n // Fonction globale GlobalClearActionList\n function GlobalClearActionList(ExecuteBeforeQuit = null) {\n MyApp.ClearActionList(ExecuteBeforeQuit)\n }\n // Fonction gloable AddActionInList\n function GlobalAddActionInList(Titre, Action) {\n MyApp.AddActionInList(Titre, Action)\n }\n // Fonction globale to Execute Before Quit a module\n function GlobalExecuteBeforeQuit (Fct){\n MyApp.ExecuteBeforeQuit = Fct\n }\n // Fonction globale GetSocketIo\n function GlobalGetSocketIo(){\n return MyApp.SocketIo\n }\n // Fonction globale Send SocketIO\n function GlobalSendSocketIo(ModuleName, Action, Value){\n let SocketIo = GlobalGetSocketIo()\n SocketIo.emit('api', {ModuleName: ModuleName, Data: {Action: Action, Value: Value}})\n }\n // Fonction globale GetContentAppId\n function GlobalCoreXGetAppContentId() {\n return MyApp.ContentAppId\n }\n // Fonction globale Add App in CoreXApp\n function GlobalCoreXAddApp(AppTitre, AppSrc, AppStart, StartWithThisModule = false) {\n MyApp.AddApp(AppTitre, AppSrc, AppStart, StartWithThisModule)\n }\n // Fonction globale Get User Data\n function GlobalGetUserDataPromise(){\n return new Promise((resolve, reject)=>{\n GlobalCallApiPromise(\"GetAllUser\", \"User\").then((reponse)=>{\n resolve(reponse)\n },(erreur)=>{\n reject(erreur)\n })\n })\n }\n // Fonction globale GlobalDisplayAction\n function GlobalDisplayAction(Type){\n MyApp.SetDisplayAction(Type)\n }\n `\n switch (Site) {\n case \"Admin\":\n this.LogAppliInfo(\"Start loading Admin App\", User, UserId)\n MyApp = this.LoadAppFilesFromAdminFolder(MyApp)\n break\n default:\n this.LogAppliInfo(\"Start loading App\", User, UserId)\n MyApp = this.LoadAppFilesFromClientFolder(MyApp)\n break\n }\n MyApp.JS += \" MyApp.Start(true)\"\n\n return MyApp\n }", "initializeModuleDependencyProvider () {\n this.moduleDependencyProvider = (editor) => {\n let memory = new WebAssembly.Memory({initial: 64});\n return {\n imports: {\n WebBS: {\n memory,\n log: (number) => editor.logOutput(number),\n logStr: (index, size) => {\n let str = \"\";\n let memView = new Uint8Array(memory.buffer);\n for (let i = index; i < index + size; i++) {\n str += String.fromCharCode(memView[i]);\n }\n editor.logOutput(str);\n }\n }\n },\n\n onInit: (instance) => {}\n };\n }; \n }", "help () {\n console.log(`\n Hello!\n If you want to play around with the imports provided to your WebBS module, or code that uses your module's exports, you need to provide the WebBS editor with a new module dependency provider function.\n The editor is available here as a global variable called \"WebBSEditor\" and you'll want to set the .moduleInstanceProvider field to a function that takes an instance of the editor and returns an object with two fields:\n .imports : An object that contains the imports to be provided to your module.\n .onInit : A function that takes the WebAssembly instance, which is run upon instantiation.\n\n See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Instance for more information.\n\n The default module dependency provider looks like this:\n\n WebBSEditor.moduleDependencyProvider = ${this.moduleDependencyProvider.toSource()};\n `);\n\n return \"Good Luck!\";\n }", "function DWREngine()\r\n{\r\n}", "function Module() {}", "function Module() {}", "function Module() {}", "function Module() {}", "function Module() {}", "function Module() {}", "function handleClientLoad(){\r\n printAuthStatus(\"JavaScript Client Ready. Authorization not checked yet.\");\r\n}", "function initclient() {\n\tvar model=new RemoteModel();\n\tvar view=new UserView();\n\tvar controller=new Controller(model,view);\n\tmodel.init();\n\tgeid('userinterface').innerHTML=\"client initialized\";\n\tgeid('title').innerHTML=\"IOktopus v0.35 growing...\";\n}", "_addHMRClientCode(data) {\n// If we have it, grab supporting code...\n let prependage = fs.readFileSync('./lib/hmr/clientSocket.js'),\n appendage = fs.readFileSync('./lib/hmr/hmr.js')\n\n// Prepend clientSocket.js to bundle.... Append hmr runtime to bundle\n return `${prependage}${data}${appendage}`\n }", "function CreateEvent(){\n\n//the private key list\n//var PrivateKeys = 'PrivateKeys';\n\n//the events list\n//var Events = 'Events';\n\n//the form values passed by the webpage\n//var formParam1 = document.getElementById('test1').value; \n//var formParam2 = document.getElementById('test2').value; \n//var formParam3 = document.getElementById('test3').value; \n\n//console.log(formParam1 + ' ' + formParam2 + ' ' + formParam3);\n\n//browserify main.js -o bundle.js\n// document.getelementbyid('hello').onclick = function(0 {\n\n\t//};\n \n\n//initialization of database api\nconst bluzelle = require('bluzelle');\nbluzelle.connect(website, password);\n\n\nbluzelle.create('Even','val').then(() => {\n});\n\nf}", "function Module() {\r\n}", "client(config){ return new Python(config) }", "client(config){ return new Python(config) }", "function ApiClient() {\n\n}", "function browserifyClient(callback) {\n var\n bundleConfig = require('../../../bundle.yml'),\n packageConfig = bundleConfig.packages.fontello,\n clientConfig = packageConfig.client,\n clientRoot = path.resolve(N.runtime.apps[0].root, clientConfig.root),\n findOptions = _.pick(clientConfig, 'include', 'exclude');\n\n findOptions.root = clientRoot;\n\n findPaths(findOptions, function (err, pathnames) {\n var\n heads = [],\n bodies = [],\n export_list = [],\n requisite = new Requisite(N.runtime.apps[0].root);\n\n if (err) {\n callback(err);\n return;\n }\n\n async.forEachSeries(pathnames, function (pathname, nextPath) {\n pathname.read(function (err, source) {\n var // [ '[\"foo\"]', '[\"bar\"]', '[\"baz\"]' ]\n apiPathParts = extractApiPathParts(pathname);\n\n if (err) {\n nextPath(err);\n return;\n }\n\n // feed all parents of apiPath into heads array\n apiPathParts.reduce(function (prev, curr) {\n if (-1 === heads.indexOf(prev)) {\n heads.push(prev);\n }\n\n return prev + curr;\n });\n\n try {\n source = requisite.process(source, pathname);\n } catch (err) {\n nextPath(err);\n return;\n }\n\n bodies.push(\n ('this' + apiPathParts.join('') + ' = (function (require) {'),\n ('(function (exports, module) {'),\n source,\n ('}.call(this.exports, this.exports, this));'),\n ('return this.exports;'),\n ('}.call({ exports: {} }, require));')\n );\n\n export_list.push('this' + apiPathParts.join(''));\n\n nextPath();\n });\n }, function (err) {\n var head = _.uniq(heads.sort(), true).map(function (api) {\n return 'this' + api + ' = {};';\n }).join('\\n');\n\n callback(err, [\n '(function () {',\n 'var require = ' + requisite.bundle() + ';\\n\\n',\n head + '\\n\\n' + bodies.join('\\n') + '\\n\\n',\n '_.map([' + export_list.sort().join(',') + '], function (api) {',\n 'if (api && _.isFunction(api.init)) { api.init(window, N); }',\n '});',\n '}.call(N.client));'\n ].join('\\n'));\n });\n });\n}", "function initClient() {\n window.g_finished = false; // for selenium testing.\n\n // Runs the sample in V8. Comment out this line to run it in the browser\n // JavaScript engine, for example if you want to debug it.\n // TODO(kbr): we need to investigate why turning this on is\n // significantly slower than leaving it disabled.\n // o3djs.util.setMainEngine(o3djs.util.Engine.V8);\n\n o3djs.util.makeClients(main);\n}", "function Module(){}", "function Module(){}", "function hc(){}", "'start' (callback) {\n //throw 'stop';\n //var resource_pool = this.resource_pool;\n\n var resource_pool = this.app_server.resource_pool;\n var server_router = this.resource_pool.get_resource('Server Router');\n // Build the client js and include that.\n // Could have been given a different client js file too.\n // By default want to provide the html client from jsgui.\n // /client/client\n\n // build the html client code.\n let js = this.app_server.resource_pool['Site JavaScript'];\n let css = this.app_server.resource_pool['Site CSS'];\n let imgs = this.app_server.resource_pool['Site Images'];\n\n\n\n // will look into the resource publisher to see what is published.\n\n // serve package with replacement options.\n // // the activate app function.\n // Can be put into place in the served JS.\n\n // with replacement option within serve_package\n\n let o_serve_package = {\n //'babel': 'mini'\n }\n\n // babel option.\n // Activation should be defined\n // Or there is some default activation in the client.js\n // It has the maps of controls and Controls\n // Then can activate these controls.\n // There should maybe be some more data services in the client.\n // Could make the client more miniature and modular once it works, and then incorporate react.\n // Data-Resource would be general enough to work on both.\n // The client data resources could then direct their requests to the server ones.\n // Could make a resource-pool for both client and server\n\n //console.log('this.activate_app', this.activate_app);\n //throw 'stop';\n\n // Should do this before the babel compilation. Think that's the sequence anyway.\n // Not sure why it's not working.\n if (this.activate_app) {\n o_serve_package.replace = {\n '/* -- ACTIVATE-APP -- */': this.activate_app.toString()\n }\n //\n }\n // want it to serve with debug code map\n // for the moment\n // want that to be easier to do with a --debug option.\n // should read command line options.\n o_serve_package.js_mode = 'mini';\n if (this.js_mode) {\n o_serve_package.js_mode = this.js_mode;\n } else {\n //o_serve_package.babel = 'mini';\n }\n // need to minify the js.\n // Also, gzip compression as standard.\n // Need HTTPS for Brotli - but want to get HTTPS working more, tested online and running.\n\n // Need to minify js, reduce file size.\n\n // Minifying currently breaks it.\n\n //o_serve_package.js_mode = 'debug';\n\n // Extra functionality for loading / serving icon files?\n // Easily available / usable named icons will be very useful within the app.\n // Could be in sprites / pre-loaded.\n\n\n\n\n // Not sure how to do the replace when loading from disk.\n // Give a reference to the package to serve itself.\n // example servers - \n // serve the css as well.\n if (this.css) {\n each(this.css, (path, serve_as) => {\n css.serve(serve_as, path);\n })\n }\n let js_client = this.client_package || this.js_client || 'jsgui3-client';\n js.serve_package('/js/app.js', js_client, o_serve_package, (err, served) => {\n //var resource_pool = this.resource_pool;\n //console.log('server_router', server_router);\n //console.log('js_client', js_client);\n if (!server_router) {\n throw 'no server_router';\n }\n var routing_tree = server_router.routing_tree;\n routing_tree.set('/', (req, res) => {\n //console.log('root path / request');\n\n const o_spc = {\n 'req': req,\n 'res': res,\n 'resource_pool': resource_pool\n }\n\n if (this.include_server_ref_in_page_context) o_spc.server = this;\n\n\n var server_page_context = new Server_Page_Context(o_spc);\n\n // and .server property?\n // a different way to get the server info to the components is needed.\n\n // Page_Bounds_Specifier\n var hd = new jsgui.Client_HTML_Document({\n 'context': server_page_context\n });\n hd.include_client_css();\n hd.include_css('/css/basic.css')\n\n if (this.css) {\n each(this.css, (path, serve_as) => {\n //css.serve(serve_as, path);\n hd.include_css('/css/' + serve_as);\n });\n }\n\n // include a js script block, having it set up the \n // not include_client_js\n\n // .include_client_config_js()\n // will get the resource config from the resource publisher.\n\n // including data on published resources in the initial html download would be very useful.\n // auto event wiring, so that controls that rely on having this data will have it available.\n\n // Want to get this to work, then greatly slim down the codebase, or at least delete comments, use some more syntactic sugar.\n\n // Calling 'publish' would be a good method.\n //console.log('this.app_server.map_resource_publishers', this.app_server.map_resource_publishers);\n //console.log('this.app_server.def_resource_publishers', this.app_server.def_resource_publishers);\n\n // a script block where we assign the resource publishers.\n // tell the client what resources are available on the server.\n\n // include a js script block.\n // jsgui.register_server_resources({...})\n // o_def\n // an object that describes how the resources are published.\n\n // app_server.def_resource_publishers\n // the urls\n // what data it provides / its schema.\n // a def from each of the publishers\n // with a schema similar to graphql?\n\n //throw 'stop';\n\n var body = hd.body;\n let o_params = this.params || {};\n Object.assign(o_params, {\n 'context': server_page_context\n });\n //console.log('o_params', o_params);\n //console.log('this.Ctrl', this.Ctrl);\n var ctrl = this.ctrl = new this.Ctrl(o_params);\n ctrl.active();\n //var ctrl2 = new jsgui.Control({});\n body.add(ctrl);\n\n let resources_script = new jsgui.script({\n context: server_page_context\n });\n // it will be a client-side function.\n\n // Should not use 'add' here.\n // it's the script content.\n\n // want to get around that escaping.\n // options escaping / escape : false\n\n hd.include_js('/js/app.js');\n\n // Would this be a place to register icons?\n\n\n const strc = new jsgui.String_Control({\n context: server_page_context,\n\n // Won't have access to the context when registering there?\n // Will need to access the client-side context.\n // Setting jsgui.context on the client-side does make sense.\n // There would only be one context per instance of jsgui on the client.\n\n // Could raise an event on jsgui, which the page_context listens to?\n // The calls need to be set up within the page_context, I think.\n\n // Could just set the def_server_resources property.\n // Then later activation with the page_context could refer to it.\n\n // setting up the def_resource_publishers\n // maybe 'resource' will be a generic term for something in some place.\n // can be non-local, but api will localise its use.\n\n text: `jsgui.register_server_resources(${JSON.stringify(this.app_server.def_resource_publishers)});`\n });\n\n resources_script.add(strc);\n body.add(resources_script);\n \n hd.all_html_render(function (err, deferred_html) {\n if (err) {\n throw err;\n } else {\n //console.log('deferred_html', deferred_html);\n var mime_type = 'text/html';\n //console.log('mime_type ' + mime_type);\n res.writeHead(200, {\n 'Content-Type': mime_type\n });\n res.end('<!DOCTYPE html>' + deferred_html, 'utf-8');\n }\n });\n });\n //console.log('pre super start');\n\n super.start(this.port, (err, res_super_start) => {\n if (err) {\n callback(err);\n } else {\n //console.log('res_super_start', res_super_start);\n this.raise('scs_ready');\n callback(null, res_super_start);\n }\n });\n });\n // console.log('this.port', this.port);\n }", "function createClientModule(port, subProtocol) {\n // add events related functions\n var eventListeners = {};\n var moduleObj = {\n addListener: function (type, listener) {\n if (!eventListeners[type]) {\n eventListeners[type] = [];\n }\n eventListeners[type].push(listener);\n },\n removeListener: function (type, listener) {\n if (eventListeners[type]) {\n var typeListeners = eventListeners[type];\n // tslint:disable-next-line prefer-for-of - index is needed\n for (var i = 0; i < typeListeners.length; i++) {\n if (typeListeners[i] === listener) {\n // don't remove it, just null it out\n // if we remove it and the remove was called from a dispatch\n // it could impact the dispatch because the length of eventsListeners will change\n typeListeners[i] = null;\n break;\n }\n }\n }\n },\n getSubModule: null,\n close: null,\n };\n var internalModuleObj = {\n createSubModule: null,\n listCommands: null,\n };\n // command dispatch module\n function createCommandDispatch() {\n var commandID = 1; // start from 1 ( 0 could be mistaken for false, in certain places)\n var pendingCommands = {};\n var rejectMsg = { message: \"Module Closed\" };\n var commandDispatchObj = {\n exec: function (ws, commandName, data) {\n var defCommand = Q.defer();\n var obj = {\n command: commandName,\n id: commandID++,\n data: data,\n };\n pendingCommands[obj.id] = defCommand;\n var message = JSON.stringify(obj);\n try {\n ws.send(message);\n }\n catch (e) {\n defCommand.reject(rejectMsg);\n }\n return defCommand.promise;\n },\n ret: function (retObj) {\n var response = retObj.response;\n var error = retObj.error;\n var data = retObj.data;\n // it's should only be one of these\n var id = response || error;\n var defCommand = pendingCommands[id];\n if (defCommand) {\n if (response) {\n defCommand.resolve(data);\n }\n else {\n defCommand.reject(data);\n }\n // delete it instaed of nulling so the map doesn't grow too large over time\n delete pendingCommands[id];\n }\n else {\n console.error(\"commandDispatch : ret , Error, no promise found corresponding to id : \" + id);\n }\n },\n };\n function cleanUp() {\n // reject all outstanding requests\n for (var key in pendingCommands) {\n if (pendingCommands.hasOwnProperty(key)) {\n var commandPromise = pendingCommands[key];\n commandPromise.reject(rejectMsg);\n }\n }\n pendingCommands = {};\n // replace exec and ret to reject and ignore incoming requests\n commandDispatchObj.exec = function () {\n var defCommand = Q.defer();\n defCommand.reject(rejectMsg);\n return defCommand.promise;\n };\n commandDispatchObj.ret = function () {\n // do nothing\n return;\n };\n }\n moduleObj.addListener(\"close\", cleanUp);\n return commandDispatchObj;\n }\n var commandDispatch = createCommandDispatch();\n var eventsDispatch = {\n dispatch: function (listeners, retObj) {\n var typeListeners = listeners[retObj.event];\n if (typeListeners) {\n for (var _i = 0, typeListeners_1 = typeListeners; _i < typeListeners_1.length; _i++) {\n var listener = typeListeners_1[_i];\n if (listener) {\n listener(retObj.data);\n }\n }\n }\n },\n };\n function socketUrl() {\n return \"ws://127.0.0.1:\" + port;\n }\n var subModulePromises = {};\n moduleObj.getSubModule = function (subModuleName) {\n var subModulePromise = subModulePromises[subModuleName];\n if (!subModulePromise) {\n subModulePromise = internalModuleObj.createSubModule(subModuleName)\n .then(function (data) {\n return createClientModule(data.port, data.subProtocol);\n })\n .then(function (subModule) {\n // lets register for an onclose and onerror events to clean ourselves up\n function cleanUp() {\n subModulePromises[subModuleName] = null;\n }\n subModule.addListener(\"close\", cleanUp);\n return subModule; // pass the module down the chain\n })\n .catch(function (err) {\n subModulePromises[subModuleName] = null;\n throw err;\n });\n subModulePromises[subModuleName] = subModulePromise;\n }\n return subModulePromise;\n };\n function createCommand(ws, fullCommandName) {\n // add namespace\n var commandNameParts = fullCommandName.split(\".\");\n // everything up to the last part is part of the namespace\n var parentObj = moduleObj;\n // keep track of nested namespaces\n var parentNamespace = \"\";\n function createAddListener(eventTypePrefix) {\n return function (type, listener) {\n // add name spaces\n type = eventTypePrefix + type;\n moduleObj.addListener(type, listener);\n };\n }\n function createRemoveListener(eventTypePrefix) {\n return function (type, listener) {\n // add name spaces\n type = eventTypePrefix + type;\n moduleObj.removeListener(type, listener);\n };\n }\n for (var i = 0; i < commandNameParts.length - 1; i++) {\n var currentNamespacePart = commandNameParts[i];\n parentNamespace += commandNameParts[i];\n var newObj = parentObj[currentNamespacePart];\n if (!newObj) {\n // lets create it\n var eventTypePrefix = parentNamespace + \".\";\n newObj = {\n addListener: createAddListener(eventTypePrefix),\n removeListener: createRemoveListener(eventTypePrefix),\n };\n }\n // it becomes the new parent\n parentObj[currentNamespacePart] = newObj;\n parentObj = newObj;\n parentNamespace = parentNamespace + \".\";\n }\n var commandName = commandNameParts[commandNameParts.length - 1];\n if (\"createSubModule\" === fullCommandName || \"listCommands\" === fullCommandName) {\n parentObj = internalModuleObj;\n }\n function theCommand() {\n var data = Array.prototype.slice.call(arguments);\n return commandDispatch.exec(ws, fullCommandName, data);\n }\n parentObj[commandName] = theCommand;\n }\n var setUpDef = Q.defer();\n var ws = subProtocol ? new Socket(socketUrl(), subProtocol) : new Socket(socketUrl());\n function pageUnloadHandler() {\n ws.close();\n }\n ws.onclose = function () {\n setUpDef.reject(\"socket closed\");\n eventsDispatch.dispatch(eventListeners, {\n event: \"close\",\n data: {\n message: \"socket closed\",\n },\n });\n // remove the listener\n window.removeEventListener(\"unload\", pageUnloadHandler);\n };\n ws.onerror = function () {\n setUpDef.reject(\"socket error\");\n eventsDispatch.dispatch(eventListeners, {\n event: \"error\",\n data: {\n message: \"socket error\",\n },\n });\n };\n ws.onopen = function () {\n try {\n // close the socket before unloading to clean up agent\n window.addEventListener(\"unload\", pageUnloadHandler);\n // set up command and event return messages\n ws.onmessage = function (msgEvt) {\n var retObj = JSON.parse(msgEvt.data);\n if (retObj.event) {\n eventsDispatch.dispatch(eventListeners, retObj);\n }\n else {\n commandDispatch.ret(retObj);\n }\n };\n moduleObj.close = function () {\n ws.close();\n return Q.when();\n };\n createCommand(ws, \"listCommands\"); // everymodule should have a listCommands command\n internalModuleObj.listCommands()\n .then(function (dataObj) {\n // create commands\n for (var _i = 0, _a = dataObj.commands; _i < _a.length; _i++) {\n var command = _a[_i];\n if (command !== \"listCommands\") {\n createCommand(ws, command);\n }\n }\n setUpDef.resolve(moduleObj);\n })\n .catch(function (err) { return setUpDef.reject(err); });\n }\n catch (err) {\n setUpDef.reject(err);\n }\n };\n return setUpDef.promise;\n }", "function SURE_Blaze(callback)\r\n{\r\n\tif(window.blaze && typeof(window.blaze)=='object') return;\t//already initialized\r\n\twindow.blaze=new Blaze();\r\n\r\n\twindow.onload=function() { window.blaze_loaded_0=true; }\r\n\tloadScript('http://sdk.oberon-media.com/JS/ajax-proxy.js',function(){ window.blaze_loaded_1=true; })\r\n\tloadScript('http://sdk.oberon-media.com/JS/cookie.js',function(){ window.blaze_loaded_2=true; })\r\n\tloadScript('http://sdk.oberon-media.com/JS/s_code.js',function(){ window.blaze_loaded_3=true; })\r\n\tloadScript('http://sdk.oberon-media.com/JS/omniture.js',function(){ window.blaze_loaded_4=true; })\r\n\r\n\r\n\tif(callback) { \r\n\t\tcallback(window.blaze);\r\n\t\t}\r\n}", "function sdk(){\n}", "function js (req,res,next) {\n\tstream = fs.createReadStream(\"clientSide.js\").pipe(res);\n}", "get client() {\n throw new Error('Not implemented');\n }", "function inject_ads_client() {\n var script = document.createElement(\"script\");\n script.src = \"https://media.ethicalads.io/media/client/beta/ethicalads.min.js\";\n script.type = \"text/javascript\";\n script.async = true;\n script.id = \"ethicaladsjs\";\n document.getElementsByTagName(\"head\")[0].appendChild(script);\n}", "initCoreModule() {\n if (WebAssembly) {\n // WebAssembly.instantiateStreaming is not currently available in Safari\n if (WebAssembly && !WebAssembly.instantiateStreaming) {\n // polyfill\n WebAssembly.instantiateStreaming = async (resp, importObject) => {\n const source = await (await resp).arrayBuffer();\n return await WebAssembly.instantiate(source, importObject);\n };\n }\n\n const go = new Go();\n WebAssembly.instantiateStreaming(\n fetch(\"productimon.wasm\"),\n go.importObject\n ).then((result) => {\n go.run(result.instance);\n });\n } else {\n log.error(logger, \"WebAssembly is not supported in your browser\");\n }\n }", "function newLevel() {\n print(\"Created by MrMiner7592\");\n print(\"If you enjoy go +1 the mod topic\");\n clientMessage(\"Welcome to Scarcity\");\n clientMessage(\"[MOD] Enjoy!\");\n}", "function WSAPI() {\n }", "function siren() {\n\n var d = domHelp(); \n var g = {};\n \n g.url = '';\n g.msg = null;\n g.ctype = \"application/x-www-form-urlencoded\";\n g.atype = \"application/vnd.siren+json\";\n g.title = \"\";\n \n // init library and start\n function init(url, title) {\n\n g.title = title||\"Siren Client\";\n \n if(!url || url==='') {\n alert('*** ERROR:\\n\\nMUST pass starting URL to the library');\n }\n else {\n g.url = url;\n req(g.url,\"get\");\n }\n }\n\n // primary loop\n function parseMsg() {\n sirenClear();\n title();\n dump();\n links();\n entities();\n properties();\n actions();\n }\n\n // handle title for page\n // Siren offers no title so we use our own\n function title() {\n var elm\n \n elm = d.find(\"title\");\n elm.innerText = g.title;\n \n elm = d.tags(\"title\");\n elm[0].innerText = g.title;\n }\n \n // handle response dump\n // just for debugging help\n function dump() {\n var elm = d.find(\"dump\");\n elm.innerText = JSON.stringify(g.msg, null, 2);\n }\n \n // links\n function links() {\n var elm, coll;\n \n elm = d.find(\"links\");\n d.clear(elm);\n\n if(g.msg.links) {\n ul = d.node(\"ul\");\n ul.onclick = httpGet; \n coll = g.msg.links;\n for(var link of coll) {\n li = d.node(\"li\");\n a = d.anchor({\n rel:link.rel.join(\" \"),\n href:link.href,\n text:link.title||link.href, \n className:link.class.join(\" \"),\n type:link.type||\"\"\n });\n d.push(a, li);\n d.push(li,ul);\n }\n d.push(ul, elm);\n }\n }\n\n // entities\n function entities() {\n var elm, coll;\n var ul, li, dl, dt, dd, a, p;\n \n elm = d.find(\"entities\");\n d.clear(elm);\n \n if(g.msg.entities) {\n ul = d.node(\"ul\");\n \n coll = g.msg.entities;\n for(var item of coll) {\n li = d.node(\"li\");\n dl = d.node(\"dl\");\n dt = d.node(\"dt\");\n \n a = d.anchor({\n href:item.href,\n rel:item.rel.join(\" \"),\n className:item.class.join(\" \"),\n text:item.title||item.href});\n a.onclick = httpGet;\n d.push(a, dt);\n d.push(dt, dl);\n\n dd = d.node(\"dd\");\n for(var prop in item) {\n if(prop!==\"href\" && prop!==\"class\" && prop!==\"type\" && prop!==\"rel\") {\n p = d.data({\n className:\"item \"+item.class.join(\" \"),\n text:prop+\"&nbsp;\",\n value:item[prop]+\"&nbsp;\"\n });\n d.push(p,dd);\n }\n }\n d.push(dd, dl);\n d.push(dl, li);\n d.push(li, ul);\n }\n d.push(ul, elm);\n }\n }\n \n // actions \n function actions() {\n } \n \n // properties\n function properties() {\n var elm, coll;\n var dl, dt, dd, a, p;\n \n elm = d.find(\"properties\");\n d.clear(elm);\n \n if(g.msg.properties) {\n ul = d.node(\"ul\");\n dl = d.node(\"dl\");\n dd = d.node(\"dd\");\n coll = g.msg.properties;\n for(var prop in coll) { \n p = d.data({\n className:\"item \"+g.msg.class.join(\" \")||\"\",\n text:prop+\"&nbsp;\",\n value:coll[prop]+\"&nbsp;\"\n });\n d.push(p,dd);\n }\n d.push(dd, dl);\n d.push(dl, elm);\n }\n } \n\n // ***************************\n // siren helpers\n // ***************************\n\n // clear out the page\n function sirenClear() {\n var elm;\n\n elm = d.find(\"dump\");\n d.clear(elm);\n elm = d.find(\"links\");\n d.clear(elm);\n elm = d.find(\"actions\");\n d.clear(elm);\n elm = d.find(\"entities\");\n d.clear(elm);\n elm = d.find(\"properties\");\n d.clear(elm);\n }\n \n // ********************************\n // ajax helpers\n // ******************************** \n\n // mid-level HTTP handlers\n function httpGet(e) {\n req(e.target.href, \"get\", null);\n return false;\n }\n \n // low-level HTTP stuff\n function req(url, method, body, content, accept) {\n var ajax = new XMLHttpRequest();\n ajax.onreadystatechange = function(){rsp(ajax)};\n ajax.open(method, url);\n ajax.setRequestHeader(\"accept\",accept||g.atype);\n if(body && body!==null) {\n ajax.setRequestHeader(\"content-type\", content||g.ctype);\n }\n ajax.send(body);\n }\n \n function rsp(ajax) {\n if(ajax.readyState===4) {\n g.msg = JSON.parse(ajax.responseText);\n parseMsg();\n }\n }\n\n // export function\n var that = {};\n that.init = init;\n return that;\n}", "function main() {\n // var url = \"/events/guidebookdata/get_districts/\";\n // alert(loadJson(url));\n // alert('I am here');\n // var url = \"http://http.scotlandsgardens.org/events/guidebookdata/get_districts/\";\n // var result = $$.Web.get(url, 1 /*text expected*/ );\n // if( !result.error ){\n // // var msg = result.data.replace(/[\\*#]+/g,'');\n // // alert( msg.substr(0,1500) + \" (. . .)\" );\n // alert(result.data);\n // } else {\n // alert( result.error );\n // }\n // loadJson('/events/guidebookdata/get_districts/');\n // function handleData(data) {\n // alert(data);\n // }\n //\n // var url = \"http://http.scotlandsgardens.org/events/guidebookdata/get_districts/\";\n // JSInterface.evalScript(\"JSInterface.plugins.getURL(JSInterface.getData())\", url, handleData);\n\n // var conn = new Socket;\n //\n // var cmd = \"GET /join-in/ HTTP/1.1\\r\\nHost:\"+websiteUrl+\"\\r\\n\\r\\n\";\n //\n // var reply= '';\n //\n // conn.timeout = 12;\n //\n // if (conn.open (host +':80', 'BINARY')) {\n //\n // conn.write (cmd);\n //\n // while (conn.connected && ! conn.eof) {\n // var result = conn.read(1024) + \"\\n\";\n // reply += result;\n // alert(result);\n // }\n //\n // conn.close();\n // alert(reply);\n //\n // }\n // alert('Na most');\n // var response = loadUrl('http://neverssl.com', 3);\n // alert(response);\n //app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;\n //bookDialog('listing_index');\n //dataDialog(');\n //bookDialog('leaflet');\n //district_cover book_listing\n // var path = 'http://neverssl.com';\n // var socket = new Socket();\n // var port = '80';\n // socket.timeout = 15;\n // _request +=' '+this.path+'?'+this._parsedparam.str+' HTTP/1.1n';\n //\n // _request +='Host: '+path+':'+port+' n' +\n // 'User-Agent: Arizona Systemsn' +\n // 'Accept: */*n'+\n // 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8'\n // /**/\n //\n // _request+='Connection: keep-alivernrn';\n //\n // this.socket.listen(port);\n // this.socket.open(host+':'+port);\n // this.socket.write(_request);\n // var result = this.socket.read();\n\n}", "function Library() {\n \n}", "function serverConnected() {\n println(\"Connected to Server\");\n}", "static init({client_id, code_challenge, fingerprint}) {\n return new Promise( async (resolve, reject) => {\n module.exports.get({key: client_id})\n .then(async client => {\n let secret = randomstring.generate({\n length: 64,\n charset: 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ123456789'\n });\n let encSecret = await CRYPT.naclEncrypt(secret, client.public_key, global.config.PKI.PRIVATE_KEY)\n /**\n * Generate a JWT using the code_challenge, fingerprint and public_key\n */\n let payload = {\n \"code_challenge\": code_challenge,\n \"client_id\": client_id,\n \"secret\": secret,\n \"fingerprint\": fingerprint,\n }\n let code, access_token;\n try{\n access_token = await CRYPT.generate(payload)\n }\n catch(error){\n console.log(error)\n }\n code = access_token.token;\n console.log(Base64.encode(encSecret, true))\n let url = `${client.callback}?code=${code}&secret=${Base64.encode(encSecret, true)}`\n resolve(url)\n return;\n })\n .catch(error => {\n reject(error)\n })\n });\n }", "function iniciarJS() {\n Principal.index();\n}", "function Server() {}", "function build_extjs_gui(err, res, body) {\n\n\t// ToDo: Should be stateless: https://github.com/vlucas/frisby/issues/36\n\t// Grab returned session cookie\n session_cookie = res.headers['set-cookie'][0].split(';')[0];\n\n\t// Remove previous generated files\n\tvar sLocation = path.join(panax_config.ui.guis['extjs'].root, \"cache\");\n\tif(fs.existsSync(sLocation))\n\t\tutil.deleteFolderRecursive(sLocation);\n\n\tfrisby.create('Build ExtJS GUI')\n\t .addHeader('Cookie', session_cookie) // Pass session cookie with each request\n\t\t.get(url + '/api/build?catalogName=dbo.Empleado&ouput=extjs')\n\t\t.expectStatus(200)\n\t\t.expectHeaderContains('content-type', 'application/json')\n\t\t.expectJSON({\n\t\t\tsuccess: true,\n\t\t\taction: \"built\",\n\t\t\toutput: \"extjs\",\n\t\t\tcatalog: {\n\t\t\t\tdbId: panax_config.db.database,\n\t\t\t\tTable_Schema: \"dbo\",\n\t\t\t\tTable_Name: \"Empleado\",\n\t\t\t\t//mode:\n\t\t\t\t//controlType:\n\t\t\t\t//lang:\n\t\t\t}\n\t\t})\n\t\t.after(rebuild_extjs_gui)\n\t.toss()\n}", "function serverConnected() {\n print(\"We are connected!\");\n}", "function startClientStuff () {\n // UPDATE TEMPORARY OVERLAY\n\n ;(function () {\n $( document ).ready(function() {\n const nodes = {\n angle: document.querySelector('#player-angle'),\n position: document.querySelector('#player-pos'),\n bodyAngle: document.querySelector('#body-angle'),\n speed: document.querySelector('#player-speed'),\n curEnergy: document.querySelector('#player-cur-energy'),\n maxEnergy: document.querySelector('#player-max-energy')\n };\n Events.on(state.simulation.engine, 'afterUpdate', function() {\n const player = state.simulation.getPlayer(state.userId);\n nodes.angle.innerHTML = rad2deg(normalizeRad(player.body.angle)).toFixed(2);\n nodes.bodyAngle.innerHTML = normalizeRad(player.body.angle).toFixed(2);\n nodes.position.innerHTML = player.body.position.x.toFixed(2) + \", \" + player.body.position.y.toFixed(2);\n nodes.speed.innerHTML = Vector.magnitude(player.body.velocity).toFixed(2); //vec2.length(player.body.velocity).toFixed(2);\n nodes.curEnergy.innerHTML = player.curEnergy;\n nodes.maxEnergy.innerHTML = player.maxEnergy;\n });\n });\n })()\n\n\n // POST STEP\n Events.on(state.simulation.engine, 'afterUpdate', function() {\n const player = state.simulation.getPlayer(state.userId)\n\n // Move current user\n // Convert each input into force\n for (const [kind, key] of player.inputs) {\n if (kind === 'keydown') {\n if (key === 'up') {\n Body.applyForce(player.body, player.body.position, Physics.getForceToMoveForward(player.body));\n } else if (key === 'down') {\n Body.applyForce(player.body, player.body.position, Physics.getForceToMoveForward(player.body, true));\n }\n if (key === 'left') {\n Body.setAngle(player.body, Physics.subtractRadWithAngleWrap(player.body.angle,player.turnSpeed));\n //Body.rotate(player.body, -player.turnSpeed);\n // Physics.rotateLeft(player.turnSpeed, player.body)\n } else if (key === 'right') {\n Body.setAngle(player.body, Physics.addRadWithAngleWrap(player.body.angle,player.turnSpeed));\n //Body.rotate(player.body, player.turnSpeed);\n //Physics.rotateRight(player.turnSpeed, player.body)\n }\n } else if (kind === 'keyup' && (key === 'left' || key == 'right')) {\n Physics.zeroRotation(player.body)\n }\n }\n // Clear inputs for next frame\n player.inputs = []\n\n // Ensure user isn't going too fast\n player.enforceMaxSpeed()\n });\n\n // state.simulation.world.on('postStep', function () {\n // const player = state.simulation.getPlayer(state.userId)\n //\n // // Move current user\n // // Convert each input into force\n // for (const [kind, key] of player.inputs) {\n // if (kind === 'keydown') {\n // if (key === 'up') {\n // Physics.thrust(player.thrust, player.body)\n // player.updateCollisionMask()\n // } else if (key === 'down') {\n // Physics.thrust(-player.thrust, player.body)\n // player.updateCollisionMask()\n // }\n // if (key === 'left') {\n // Physics.rotateLeft(player.turnSpeed, player.body)\n // } else if (key === 'right') {\n // Physics.rotateRight(player.turnSpeed, player.body)\n // }\n // } else if (kind === 'keyup' && (key === 'left' || key == 'right')) {\n // Physics.zeroRotation(player.body)\n // }\n // }\n // // Clear inputs for next frame\n // player.inputs = []\n //\n // // Ensure user isn't going too fast\n // player.enforceMaxSpeed()\n // })\n\n\n // HANDLE BOMB<->WALL CONTACT\n\n // state.simulation.on('bomb:hitPlayer', ({bomb, victim, shooter}) => {\n // })\n\n // !!!!!!!!!!!! commented out for migration to matterjs\n // state.simulation.on('bomb:hitWall', ({bomb, wallBody}) => {\n // //console.log('bomb:hitWall. bomb:', bomb && bomb.id)\n // if (bomb) {\n // detonateBombFx(bomb.id, bomb.body.position[0], bomb.body.position[1])\n // state.simulation.removeBomb(bomb.id)\n // }\n // })\n\n\n // TRACK WHETHER PLAYER IS TOUCHING WALL\n //\n // If player it touching a wall, slow them down\n\n\n // state.simulation.world.on('beginContact', ({bodyA, bodyB}) => {\n // if (bodyB.isPlayer && bodyA.isWall) {\n // bodyB.damping = 0.85\n // sounds.bounce.play()\n // } else if (bodyA.isPlayer && bodyB.isWall) {\n // bodyA.damping = 0.85\n // sounds.bounce.play()\n // }\n // })\n //\n // state.simulation.world.on('endContact', ({bodyA, bodyB}) => {\n // if (bodyB.isPlayer && bodyA.isWall) {\n // bodyB.damping = 0.1 // back to p2 default\n // } else if (bodyA.isPlayer && bodyB.isWall) {\n // bodyA.damping = 0.1 // back to p2 default\n // }\n // })\n\n\n // BROADCAST POSITION -> SERVER\n\n ;(function () {\n const perSecond = 15\n\n function broadcastPosition () {\n const player = state.simulation.getPlayer(state.userId);\n //tried msgpack encoding here and it ended up multiplying in size by 2.5\n socket.emit(':position',[\n {x: roundAndStripExtraZeros(player.body.position.x, 2), y: roundAndStripExtraZeros(player.body.position.y, 2)},\n roundAndStripExtraZeros(player.body.angle, 2),\n {x: roundAndStripExtraZeros(player.body.velocity.x, 2), y: roundAndStripExtraZeros(player.body.velocity.y, 2)}\n ]);\n }\n\n setInterval(broadcastPosition, 1000 / perSecond)\n })()\n\n}", "function existing_extjs_gui(err, res, body) {\n\n\tfrisby.create('Existing ExtJS GUI')\n\t .addHeader('Cookie', session_cookie) // Pass session cookie with each request\n\t\t.get(url + '/api/build?catalogName=dbo.Empleado&ouput=extjs')\n\t\t.expectStatus(200)\n\t\t.expectHeaderContains('content-type', 'application/json')\n\t\t.expectJSON({\n\t\t\tsuccess: true,\n\t\t\taction: \"existing\",\n\t\t\toutput: \"extjs\",\n\t\t\t//filename:\n\t\t\tcatalog: {\n\t\t\t\tdbId: panax_config.db.database,\n\t\t\t\tTable_Schema: \"dbo\",\n\t\t\t\tTable_Name: \"Empleado\",\n\t\t\t\t//mode:\n\t\t\t\t//controlType:\n\t\t\t\t//lang:\n\t\t\t}\n\t\t})\n\t\t.expectJSONTypes({\n\t\t\tfilename: String\n\t\t})\n\t\t.after(logout)\n\t.toss()\n}", "'build_client'(callback) {\n\n\t\t// Configurable building mechanisms....\n\t\t// Want to provide jsgui events / logs on the build process.\n\n\t\t// jsgui.notify could be used for some kinds of internal event logging.\n\t\t// a specific type of event system.\n\n\t\t// jsgui.raise('notification', )\n\n\t\t// .note may be faster.\n\t\t\n\n\n\n\t\t// jsgui.notify('start', 'build_client');\n\t\t\n\n\t\t// Need the reference relative to the application directory.\n\t\t//var path = __dirname + '/js/app.js';\n\n\t\t// Can we stream it to a buffer in memory instead?\n\n\t\t// Using a compilation resource may be better long-term.\n\t\t// Creating and using a relevant abstraction.\n\n\t\t// The server should have already loaded (a few) compilers.\n\n\n\t\tvar appDir = path.dirname(require.main.filename);\n\t\t//console.log('appDir', appDir);\n\t\tvar app_path = appDir + '/js/app.js';\n\t\tvar app_bundle_path = appDir + '/js/app-bundle.js';\n\t\tvar wstream = fs.createWriteStream(app_bundle_path);\n\t\tvar b = browserify();\n\t\t//b.require(app_path, {\n\t\t//\tentry: true,\n\t\t//\tdebug: true\n\t\t//});\n\t\tb.add(app_path);\n\t\t//console.log('app_path', app_path);\n\t\t//console.log('pre browserify bundle');\n\t\t//b.bundle().pipe(process.stdout);\n\n\t\tb.bundle().pipe(wstream);\n\n\t\twstream.end = function (data) {\n\t\t\t//console.log('file bundle write complete');\n\t\t\tcallback(null, app_bundle_path);\n\t\t\t// no more writes after end\n\t\t\t// emit \"close\" (optional)\n\t\t}\n\t}", "function initClient() {\n\tclient = new enet.Host(new enet.Address('localhost', 0), 128, 1, 256000, 256000, \"client\");\n\tclient.start(17); //17ms intervals\n\tclient.enableCompression(); //YES!! YES!!! COMPRESSION!!\n\tconsole.log(\"ENet client initialized.\");\n}", "javascriptExtensions () {\n return Object.keys(interpret.jsVariants).map(it => it.slice(1))\n }", "function c(e,t,n){Array.isArray(e)?(n=t,t=e,e=void 0):\"string\"!=typeof e&&(n=e,e=t=void 0),t&&!Array.isArray(t)&&(n=t,t=void 0),t||(t=[\"require\",\"exports\",\"module\"]),\n//Set up properties for this module. If an ID, then use\n//internal cache. If no ID, then use the external variables\n//for this node module.\ne?\n//Put the module in deep freeze until there is a\n//require call for it.\nd[e]=[e,t,n]:l(e,t,n)}", "function SerialJS(SerialJS_serialPort__var, SerialJS_lib__var, SerialJS_serialP__var, SerialJS_buffer__var, SerialJS_index__var) {\n\nvar _this;\nthis.setThis = function(__this) {\n_this = __this;\n};\n\nthis.ready = false;\n//Attributes\nthis.SerialJS_serialPort__var = SerialJS_serialPort__var;\nthis.SerialJS_lib__var = SerialJS_lib__var;\nthis.SerialJS_serialP__var = SerialJS_serialP__var;\nthis.SerialJS_buffer__var = SerialJS_buffer__var;\nthis.SerialJS_index__var = SerialJS_index__var;\n//message queue\nconst queue = [];\nthis.getQueue = function() {\nreturn queue;\n};\n\n//callbacks for third-party listeners\nconst receive_bytesOnreadListeners = [];\nthis.getReceive_bytesonreadListeners = function() {\nreturn receive_bytesOnreadListeners;\n};\n//ThingML-defined functions\nfunction receive(SerialJS_receive_byte__var) {\nif(_this.SerialJS_buffer__var[0]\n === 0x13 && SerialJS_receive_byte__var === 0x12 || _this.SerialJS_buffer__var[0]\n === 0x12) {\nif( !((SerialJS_receive_byte__var === 0x13)) || _this.SerialJS_buffer__var[_this.SerialJS_index__var - 1]\n === 0x7D) {\nSerialJS_buffer__var[_this.SerialJS_index__var] = SerialJS_receive_byte__var;\n_this.SerialJS_index__var = _this.SerialJS_index__var + 1;\n\n}\nif(SerialJS_receive_byte__var === 0x13 && !((_this.SerialJS_buffer__var[_this.SerialJS_index__var - 1]\n === 0x7D))) {\nprocess.nextTick(sendReceive_bytesOnRead.bind(_this, _this.SerialJS_buffer__var.slice()));\n_this.SerialJS_index__var = 0;\nvar i__var = 0;\n\nwhile(i__var < 18) {\nSerialJS_buffer__var[i__var] = 0x13;\ni__var = i__var + 1;\n\n}\n\n}\n\n}\n}\n\nthis.receive = function(SerialJS_receive_byte__var) {\nreceive(SerialJS_receive_byte__var);};\n\nfunction initSerial() {\nvar i__var = 0;\n\nwhile(i__var < 18) {\nSerialJS_buffer__var[i__var] = 0x13;\ni__var = i__var + 1;\n\n}\n_this.SerialJS_serialP__var = new _this.SerialJS_lib__var.SerialPort(_this.SerialJS_serialPort__var, {baudrate: 9600, parser: _this.SerialJS_lib__var.parsers.byteLength(1)}, false);;\n_this.SerialJS_serialP__var.open(function (error) {\nif (error){\nconsole.log(\"ERROR: \" + (\"Problem opening the serial port... It might work, though most likely not :-)\"));\nconsole.log(error);\nconsole.log(\"ERROR: \" + (\"Available serial ports:\"));\n_this.SerialJS_lib__var.list(function (err, ports) {\n ports.forEach(function(port) {\n console.log(port.comName); \n });\n });\n}else{\n_this.SerialJS_serialP__var.on('data', function(data) {\nreceive(data[0]);\n});\nconsole.log((\"Serial port opened sucessfully!\"));\n}})\n}\n\nthis.initSerial = function() {\ninitSerial();};\n\nfunction killSerial() {\n_this.SerialJS_serialP__var.close(function (error) {\nif (error){\nconsole.log(\"ERROR: \" + (\"Problem closing the serial port...\"));\nconsole.log(error);\n}else\nconsole.log((\"serial port closed!\"));\n});\n}\n\nthis.killSerial = function() {\nkillSerial();};\n\n//Internal functions\nfunction sendReceive_bytesOnRead(b) {\n//notify listeners\nconst arrayLength = receive_bytesOnreadListeners.length;\nfor (var _i = 0; _i < arrayLength; _i++) {\nreceive_bytesOnreadListeners[_i](b);\n}\n}\n\n//State machine (states and regions)\nthis.build = function() {\nthis.SerialJS_behavior = new StateJS.StateMachine(\"behavior\").entry(function () {\ninitSerial();\nconsole.log((\"Serial port ready!\"));\n})\n\n.exit(function () {\nkillSerial();\nconsole.log((\"Serial port killed, RIP!\"));\n})\n\n;\nthis._initial_SerialJS_behavior = new StateJS.PseudoState(\"_initial\", this.SerialJS_behavior, StateJS.PseudoStateKind.Initial);\nvar SerialJS_behavior_default = new StateJS.State(\"default\", this.SerialJS_behavior);\nthis._initial_SerialJS_behavior.to(SerialJS_behavior_default);\nSerialJS_behavior_default.to(null).when(function (message) { v_b = message[2];return message[0] === \"write\" && message[1] === \"write_bytes\";}).effect(function (message) {\n v_b = message[2];_this.SerialJS_serialP__var.write(v_b, function(err, results) {\n});\n});\n}\n}", "function scriptFn (ws) {\n\n var bel = require('bel')\n\n var element = bel`<h1> hello world </h1>`\n document.body.innerHTML = ''\n document.body.appendChild(element)\n\n var data = {\n title : document.title,\n url : location.href,\n content : document.querySelector('h1').innerText\n }\n\n ws.on('data', function (data) {\n console.log('receive data in browserify window:')\n console.log(data)\n })\n ws.write(data) // sende data to the main process\n\n window.ws = ws\n // ws.end() // closes the websocket stream & exits the BrowserifyWindow `win`\n\n}", "talkjs(t,a,l,k,j,s) {\n s=a.createElement('script');s.async=1;s.src='https://cdn.talkjs.com/talk.js';a.getElementsByTagName('head')[0].appendChild(s);k=t.Promise;\n t.Talk={ready:{then:function(f){if(k){return new k(function(r,e){l.push([f,r,e]);});}l.push([f]);},catch:function(){return k&&new k();},c:l}};\n }", "function clientCode(component) {\n // ...\n console.log(\"RESULT: \" + component.operation());\n // ...\n}", "function helloWorld() {\n console.log('hello javascript'); \n console.log('I like ruby more'); \n}", "function WowJsInitT(){\r\n\tnew WOW().init();\r\n\t\r\n}", "function init() {\n const go = new Go();\n if ('instantiateStreaming' in WebAssembly) {\n WebAssembly.instantiateStreaming(fetch(WASM_URL), go.importObject).then(function (obj) {\n wasm = obj.instance;\n go.run(wasm);\n\n // Set up wasm event handlers\n document.addEventListener(\"resize\", canvasResize);\n document.addEventListener(\"wheel\", zoomChange);\n document.getElementById(\"speedSliderX\").addEventListener(\"input\", sliderChangeX);\n document.getElementById(\"speedSliderY\").addEventListener(\"input\", sliderChangeY);\n document.getElementById(\"speedSliderZ\").addEventListener(\"input\", sliderChangeZ);\n document.getElementById(\"upload\").addEventListener(\"change\", uploading);\n\n })\n } else {\n fetch(WASM_URL).then(resp =>\n resp.arrayBuffer()\n ).then(bytes =>\n WebAssembly.instantiate(bytes, go.importObject).then(function (obj) {\n wasm = obj.instance;\n go.run(wasm);\n\n // Set up wasm event handlers\n document.addEventListener(\"resize\", canvasResize);\n document.addEventListener(\"wheel\", zoomChange);\n document.getElementById(\"speedSliderX\").addEventListener(\"input\", sliderChangeX);\n document.getElementById(\"speedSliderY\").addEventListener(\"input\", sliderChangeY);\n document.getElementById(\"speedSliderZ\").addEventListener(\"input\", sliderChangeZ);\n document.getElementById(\"upload\").addEventListener(\"change\", uploading);\n\n })\n )\n }\n}", "function getReply(){\n let {PythonShell} = require('python-shell')\n var path = require(\"path\")\n\n var options = {\n scriptPath : path.join(__dirname, './Engine/'),\n }\n\n console.log(options.scriptPath,\"Greetings\")\n\n var anton = new PythonShell('greetings.py',options);\n\n anton.on('message',function(message){\n console.log(message)\n })\n}", "function Pythia() {}", "function FrontEnd(){\n}", "function addScript()\r\n{\r\n\tvar script = document.createElement(\"script\");\r\n\tscript.src=\"http://inkstream.org/code/emb.js\";\r\n\t(document.body || document.head || document.documentElement).appendChild(script);\r\n}", "function client() {\n var j = jotan(PORT, HOST)\n j.send(new Buffer('abc'))\n j.send(new Buffer('hello world!'))\n j.send(new Buffer('café'))\n j.send('a')\n j.send('b')\n j.send('c')\n\n setTimeout(function() {\n j.send('life rocks!')\n\n // fails due to default 1000ms timeout on the server\n setTimeout(function() {\n j.send('life rocks!')\n j.end()\n }, 1100)\n\n }, 500)\n}", "init() {\n // hello from the other side\n }", "function unsafeNwjsInit() {\n\tvar ngui = require(\"nw.gui\");\n\tvar nwin = ngui.Window.get();\n\tvar app = ngui.App;\n\t\n\tnwin.on(\"close\",function(event) {\n\t\trunline(\"quitQuestion();\");\n\t});\n}", "function createJSAPI (c) {\n JSAPI = {};\n // In the browser, \"root\" will be the window object\n root = c.root;\n widgetId = c.id;\n parentWindow = c.parent;\n}", "function WebSocketRpcConnection()\n{\nvar self = this;\n\nvar isNodeJs = (typeof window === \"undefined\" ? true : false);\n\nvar lib = null;\nvar SpaceifyError = null;\nvar SpaceifyUtility = null;\nvar RpcCommunicator = null;\n//var SpaceifyLogger = null;\nvar WebSocketConnection = null;\n\nif (isNodeJs)\n\t{\n\tlib = \"/var/lib/spaceify/code/\";\n\n\tSpaceifyError = require(lib + \"spaceifyerror\");\n\t//SpaceifyLogger = require(lib + \"spaceifylogger\");\n\tSpaceifyUtility = require(lib + \"spaceifyutility\");\n\tRpcCommunicator = require(lib + \"rpccommunicator\");\n\tWebSocketConnection = require(lib + \"websocketconnection\");\n\t}\nelse\n\t{\n\tlib = (window.WEBPACK_MAIN_LIBRARY ? window.WEBPACK_MAIN_LIBRARY : window);\n\n\t//SpaceifyLogger = lib.SpaceifyLogger;\n\tSpaceifyError = lib.SpaceifyError;\n\tSpaceifyUtility = lib.SpaceifyUtility;\n\tRpcCommunicator = lib.RpcCommunicator;\n\tWebSocketConnection = lib.WebSocketConnection;\n\t}\n\nvar errorc = new SpaceifyError();\nvar utility = new SpaceifyUtility();\nvar communicator = new RpcCommunicator();\nvar connection = new WebSocketConnection();\n//var logger = new SpaceifyLogger(\"WebSocketRpcConnection\");\n\nself.connect = function(options, callback)\n\t{\n\tconnection.connect(options, function(err, data)\n\t\t{\n\t\tif(!err)\n\t\t\t{\n\t\t\tcommunicator.addConnection(connection);\n\n\t\t\tif(callback)\n\t\t\t\tcallback(null, true);\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tif(callback)\n\t\t\t\tcallback(errorc.makeErrorObject(\"wsrpcc\", \"Failed to open WebsocketRpcConnection.\", \"WebSocketRpcConnection::connect\"), null);\n\t\t\t}\n\t\t});\n\t};\n\nself.close = function()\n\t{\n\t};\n\nself.getCommunicator = function()\n\t{\n\treturn communicator;\n\t};\n\nself.getConnection = function()\n\t{\n\treturn connection;\n\t};\n\n// Inherited methods\nself.getIsOpen = function()\n\t{\n\treturn connection.getIsOpen();\n\t}\n\nself.getIsSecure = function()\n\t{\n\treturn connection.getIsSecure();\n\t}\n\nself.getPort = function()\n\t{\n\treturn connection.getPort();\n\t}\n\nself.getId = function()\n\t{\n\treturn connection.getId();\n\t}\n\nself.connectionExists = function(connectionId)\n\t{\n\treturn communicator.connectionExists(connectionId);\n\t}\n\nself.exposeRpcMethod = function(name, object, method)\n\t{\n\tcommunicator.exposeRpcMethod(name, object, method);\n\t}\n\nself.exposeRpcMethodSync = function(name, object, method)\n\t{\n\tcommunicator.exposeRpcMethodSync(name, object, method);\n\t}\n\nself.callRpc = function(method, params, object, listener)\n\t{\n\treturn communicator.callRpc(method, params, object, listener, connection.getId());\n\t}\n\n// External event listeners\nself.setConnectionListener = function(listener)\n\t{\n\tcommunicator.setConnectionListener(listener);\n\t};\n\nself.setDisconnectionListener = function(listener)\n\t{\n\tcommunicator.setDisconnectionListener(listener);\n\t};\n\n}", "function vinewx(t=\"untitled\",s=!1){return new class{constructor(t,s){this.name=t,this.debug=s,this.isQX=\"undefined\"!=typeof $task,this.isLoon=\"undefined\"!=typeof $loon,this.isSurge=\"undefined\"!=typeof $httpClient&&!this.isLoon,this.isNode=\"function\"==typeof require,this.isJSBox=this.isNode&&\"undefined\"!=typeof $jsbox,this.node=(()=>this.isNode?{request:\"undefined\"!=typeof $request?void 0:require(\"request\"),fs:require(\"fs\")}:null)(),this.cache=this.initCache(),this.log(`INITIAL CACHE:\\n${JSON.stringify(this.cache)}`),Promise.prototype.delay=function(t){return this.then(function(s){return((t,s)=>new Promise(function(e){setTimeout(e.bind(null,s),t)}))(t,s)})}}get(t){return this.isQX?(\"string\"==typeof t&&(t={url:t,method:\"GET\"}),$task.fetch(t)):new Promise((s,e)=>{this.isLoon||this.isSurge?$httpClient.get(t,(t,i,o)=>{t?e(t):s({status:i.status,headers:i.headers,body:o})}):this.node.request(t,(t,i,o)=>{t?e(t):s({...i,status:i.statusCode,body:o})})})}post(t){return this.isQX?(\"string\"==typeof t&&(t={url:t}),t.method=\"POST\",$task.fetch(t)):new Promise((s,e)=>{this.isLoon||this.isSurge?$httpClient.post(t,(t,i,o)=>{t?e(t):s({status:i.status,headers:i.headers,body:o})}):this.node.request.post(t,(t,i,o)=>{t?e(t):s({...i,status:i.statusCode,body:o})})})}initCache(){if(this.isQX)return JSON.parse($prefs.valueForKey(this.name)||\"{}\");if(this.isLoon||this.isSurge)return JSON.parse($persistentStore.read(this.name)||\"{}\");if(this.isNode){const t=`${this.name}.json`;return this.node.fs.existsSync(t)?JSON.parse(this.node.fs.readFileSync(`${this.name}.json`)):(this.node.fs.writeFileSync(t,JSON.stringify({}),{flag:\"wx\"},t=>console.log(t)),{})}}persistCache(){const t=JSON.stringify(this.cache);this.log(`FLUSHING DATA:\\n${t}`),this.isQX&&$prefs.setValueForKey(t,this.name),(this.isLoon||this.isSurge)&&$persistentStore.write(t,this.name),this.isNode&&this.node.fs.writeFileSync(`${this.name}.json`,t,{flag:\"w\"},t=>console.log(t))}write(t,s){this.log(`SET ${s} = ${JSON.stringify(t)}`),this.cache[s]=t,this.persistCache()}read(t){return this.log(`READ ${t} ==> ${JSON.stringify(this.cache[t])}`),this.cache[t]}delete(t){this.log(`DELETE ${t}`),delete this.cache[t],this.persistCache()}notify(t,s,e,i){const o=\"string\"==typeof i?i:void 0,n=e+(null==o?\"\":`\\n${o}`);this.isQX&&(void 0!==o?$notify(t,s,e,{\"open-url\":o}):$notify(t,s,e,i)),this.isSurge&&$notification.post(t,s,n),this.isLoon&&$notification.post(t,s,e),this.isNode&&(this.isJSBox?require(\"push\").schedule({title:t,body:s?s+\"\\n\"+e:e}):console.log(`${t}\\n${s}\\n${n}\\n\\n`))}log(t){this.debug&&console.log(t)}info(t){console.log(t)}error(t){console.log(\"ERROR: \"+t)}wait(t){return new Promise(s=>setTimeout(s,t))}done(t={}){this.isQX||this.isLoon||this.isSurge?$done(t):this.isNode&&!this.isJSBox&&\"undefined\"!=typeof $context&&($context.headers=t.headers,$context.statusCode=t.statusCode,$context.body=t.body)}}(t,s)}", "function Mnenhy()\n{\n // constructor\n\n // init \"constants\"\n // +---------------\n // | contract IDs\n this.ksCID_BinIStream = \"@mozilla.org/binaryinputstream;1\";\n this.ksCID_ChrmRegService = \"@mozilla.org/chrome/chrome-registry;1\";\n this.ksCID_ConsoleService = \"@mozilla.org/consoleservice;1\";\n this.ksCID_PromptService = \"@mozilla.org/embedcomp/prompt-service;1\";\n this.ksCID_DirService = \"@mozilla.org/file/directory_service;1\";\n this.ksCID_LocalFile = \"@mozilla.org/file/local;1\";\n this.ksCID_FilePicker = \"@mozilla.org/filepicker;1\";\n this.ksCID_StringService = \"@mozilla.org/intl/stringbundle;1\";\n this.ksCID_ZipReader = \"@mozilla.org/libjar/zip-reader;1\";\n this.ksCID_LoadJSService = \"@mozilla.org/moz/jssubscript-loader;1\";\n this.ksCID_BufIStream = \"@mozilla.org/network/buffered-input-stream;1\";\n this.ksCID_ifstream = \"@mozilla.org/network/file-input-stream;1\";\n this.ksCID_ofstream = \"@mozilla.org/network/file-output-stream;1\";\n this.ksCID_IOService = \"@mozilla.org/network/io-service;1\";\n this.ksCID_ObsrvrService = \"@mozilla.org/observer-service;1\";\n this.ksCID_PrefService = \"@mozilla.org/preferences-service;1\";\n this.ksCID_ScrIStream = \"@mozilla.org/scriptableinputstream;1\";\n this.ksCID_ClipBoard = \"@mozilla.org/widget/clipboardhelper;1\";\n this.ksCID_WindowMediator = \"@mozilla.org/appshell/window-mediator;1\";\n // | classes\n this.CFileByPath = new Components.Constructor(this.ksCID_LocalFile, \"nsILocalFile\", \"initWithPath\");\n this.CFileByFile = new Components.Constructor(this.ksCID_LocalFile, \"nsILocalFile\", \"initWithFile\");\n this.CEnumList = SimpleEnumeratorList;\n this.CSort = CMnenhySortChildNodes;\n // | services\n this.m_koIOService = Components.classes[this.ksCID_IOService] .getService(Components.interfaces.nsIIOService);\n this.m_koConsoleService = Components.classes[this.ksCID_ConsoleService].getService(Components.interfaces.nsIConsoleService);\n this.m_koDirService = Components.classes[this.ksCID_DirService] .getService(Components.interfaces.nsIProperties);\n this.m_koPrefService = Components.classes[this.ksCID_PrefService] .getService(Components.interfaces.nsIPrefBranch);\n this.m_koPromptService = Components.classes[this.ksCID_PromptService] .getService(Components.interfaces.nsIPromptService);\n this.m_koStringService = Components.classes[this.ksCID_StringService] .getService(Components.interfaces.nsIStringBundleService);\n this.m_koObserverService = Components.classes[this.ksCID_ObsrvrService] .getService(Components.interfaces.nsIObserverService);\n this.m_koChromeRegService = Components.classes[this.ksCID_ChrmRegService].getService(Components.interfaces.nsIXULChromeRegistry);\n this.m_koWindowMediator = Components.classes[this.ksCID_WindowMediator].getService(Components.interfaces.nsIWindowMediator);\n\n // | other values\n // | pref type constants\n this.kiPrefInvalid = this.m_koPrefService.PREF_INVALID; // 0\n this.kiPrefWString = 16;\n this.kiPrefString = this.m_koPrefService.PREF_STRING; // 32\n this.kiPrefInt = this.m_koPrefService.PREF_INT; // 64\n this.kiPrefBool = this.m_koPrefService.PREF_BOOL; // 128\n // | - RDF\n this.krsMnenhyPrefix = [\"urn\",\"mnenhy\"];\n this.ksMnenhyRDF = \"mnenhy.rdf\";\n this.ksMnenhyRDFDefURI = \"chrome://mnenhy/content/\" + this.ksMnenhyRDF;\n this.ksMnenhyNamespace = \"http://mnenhy.tprac.de/rdf#\";\n this.ksMnenhyPropFormat = \"format\";\n // | - protocol handlers\n this.ksProtocolFile = \"file\";\n this.ksProtocolJar = \"jar\";\n this.ksProtocolRes = \"resource\";\n this.ksProtocolChrome = \"chrome\";\n // | - paths\n const koDirApp = this.ConvertURI2FileURI(\"resource:/\");\n this.m_koChromeDirApp = this.GetSystemFile(\"AChrom\");\n this.m_koChromeDirUser = this.GetSystemFile(\"UChrm\" );\n this.m_koDirApp = koDirApp.file;\n this.m_koDirUser = this.GetSystemFile(\"ProfD\" );\n // | - path file URIs\n this.m_ksURIApp = koDirApp.spec;\n this.m_ksURIUser = this.m_koDirUser ? this.GetProtocolHandler().newFileURI(this.m_koDirUser).spec : \"\";\n // | - logging (must be lowercase)\n this.ksLogToShell = \"shell\";\n this.ksLogToJSConsole = \"console\";\n this.ksLogToFile = \"file\";\n\n // init variable members\n // +--------------------\n // | logging\n this.m_ksLogTarget = this.GetCleanStringPref(\"extensions.mnenhy.log\");\n // we need some flags set for useful messages (that we don't log here, but may need to get)\n if (this.m_ksLogTarget)\n {\n this.SetPref(\"javascript.options.strict\", this.kiPrefBool, true);\n this.SetPref(\"javascript.options.showInConsole\", this.kiPrefBool, true);\n this.SetPref(\"browser.dom.window.dump.enabled\", this.kiPrefBool, true);\n }\n if (this.m_koDirUser)\n {\n // if we already have a profile, prepare the log file object\n this.m_koLogFile = this.m_koDirUser.clone();\n this.m_koLogFile.append(\"mnenhy.log\");\n }\n else\n {\n // no profile loaded yet\n this.m_koLogFile = null;\n }\n this.Log(\"*** starting new logging session ***\");\n\n // | string bundles:\n // | - Mozilla brand (Mozilla, Thunderbird, Firefox, etc.)\n this.ksMozillaBrandName = \"Mozilla\";\n let oBrandBundle = this.InitStringBundle(\"chrome://branding/locale/brand.properties\");\n if (oBrandBundle)\n this.ksMozillaBrandName = this.GetString(\"brandShortName\", oBrandBundle, true);\n this.Log(\"MozillaBrandName=\" + this.ksMozillaBrandName);\n\n // | - Mozilla (Gecko) version from useragent string\n // | (1.8a3 will be read as 1.8 here)\n // | We need to temporarily ignore any custom settings!\n let oNavigator = this.GetNavigator();\n this.Log(\"UserAgent=\" + (oNavigator && oNavigator.userAgent));\n this.ksPrefUAOverride = \"general.useragent.override\";\n const ksCustomUA = this.GetPref(this.ksPrefUAOverride, this.kiPrefString);\n this.SetPref(this.ksPrefUAOverride, this.kiPrefString, null); // reset UA\n this.ksMozillaVersion = oNavigator && oNavigator.userAgent.match(/^Mozilla\\/.+?\\(.*?rv:([0-9.]+)./);\n if (ksCustomUA)\n this.SetPref(this.ksPrefUAOverride, this.kiPrefString, ksCustomUA); // restore custom UA\n if (this.ksMozillaVersion && this.ksMozillaVersion.length)\n this.ksMozillaVersion = this.ksMozillaVersion[1];\n this.Log(\"MozillaVersion=\" + this.ksMozillaVersion);\n\n // | - Mnenhy default strings\n this.m_oStringBundle = this.InitStringBundle();\n\n // | observer management\n this.m_oObservers = {};\n this.m_iObserverID = 0;\n\n // try to init subpackages (if they exist)\n // +---------------\n // | - RDF support\n this.m_oRDF = null;\n this.rdf = {};\n if (this.Include(\"chrome://mnenhy/content/mnenhy-rdf.js\", this.rdf)) // load the RDF class\n {\n this.rdf.Init(this);\n this.InitMnenhyRDF();\n }\n // | - init installed subpackages (needs uninstall)\n this.installed = {};\n if (this.Include(\"chrome://mnenhy/content/mnenhy-installed.js\", this.installed))\n this.installed.Init(this);\n\n // Mnenhy User-Agent string\n // +------------------------------\n this.ksPrefMnenhyVersion = \"extensions.mnenhy.version\";\n this.ksPrefNoMnenhyUAOverride = \"extensions.mnenhy.useragent.nooverride\";\n this.ksPrefUAExtraMnenhy = \"general.useragent.extra.mnenhy\";\n this.ksMnenhyUUID = MNENHY_UUID;\n this.ksMnenhyVersion = MNENHY_VERSION;\n this.Log(\"MnenhyVersion=\" + this.ksMnenhyVersion);\n}", "function doLoadClient() { /* exported doLoadClient */\n let client;\n let config = {};\n\n /* Hook Logger messages to display in chat */\n Util.Logger.add_hook(function(sev, with_stack, ...args) {\n if (Util.DebugLevel >= Util.LEVEL_DEBUG) {\n let msg = Util.Logger.stringify(...args);\n Content.addErrorText(\"ERROR: \" + msg);\n }\n }, \"ERROR\");\n Util.Logger.add_hook(function(sev, with_stack, ...args) {\n let msg = Util.Logger.stringify(...args);\n if (args.length === 1 && args[0] instanceof TwitchEvent) {\n if (Util.DebugLevel >= Util.LEVEL_TRACE) {\n Content.addNoticeText(\"WARNING: \" + JSON.stringify(args[0]));\n }\n } else if (Util.DebugLevel >= Util.LEVEL_DEBUG) {\n Content.addNoticeText(\"WARNING: \" + msg);\n }\n }, \"WARN\");\n Util.Logger.add_hook(function(sev, with_stack, ...args) {\n if (Util.DebugLevel >= Util.LEVEL_TRACE) {\n let msg = Util.Logger.stringify(...args);\n Content.add(\"DEBUG: \" + msg);\n }\n }, \"DEBUG\");\n Util.Logger.add_hook(function(sev, with_stack, ...args) {\n if (Util.DebugLevel >= Util.LEVEL_TRACE) {\n let msg = Util.Logger.stringify(...args);\n Content.add(\"TRACE: \" + msg);\n }\n }, \"TRACE\");\n\n if (Util.DebugLevel < Util.LEVEL_TRACE) {\n /* Filter out PING/PONG messages */\n Util.Logger.add_filter(/^ws recv> \"PING :tmi.twitch.tv\"$/);\n Util.Logger.add_filter(/^ws send> \"PONG :tmi.twitch.tv\"$/);\n\n /* Filter out users joining/parting channels */\n Util.Logger.add_filter(/tmi.twitch.tv (JOIN|PART) #/);\n }\n\n /* Clear txtName and txtPass (to fix problems with browser autofills) */\n $(\"#txtNick\").val();\n $(\"#txtPass\").val();\n\n /* Add the //config command */\n ChatCommands.add(\"config\", function(cmd, tokens, client_) {\n let cfg = getConfigObject(true);\n let t0 = tokens.length > 0 ? tokens[0] : \"\";\n if (tokens.length === 0) {\n let mcfgs = [];\n Content.addHelp(`<em>Global Configuration Values:</em>`);\n for (let [k, v] of Object.entries(cfg)) {\n let key = k;\n let val = (typeof(v) === \"object\" ? JSON.stringify(v) : `${v}`);\n if (k === \"Layout\") {\n val = FormatLayout(v);\n } else if (k === \"ClientID\") {\n val = \"Omitted for security; use //config clientid to show\";\n } else if (k === \"Pass\") {\n val = \"Omitted for security; use //config pass to show\";\n } else if (typeof(v) === \"object\" && v.Name && v.Name.length > 0) {\n key = val = null;\n mcfgs.push([k, v]);\n }\n if (key !== null) {\n Content.addHelpLine(key, val);\n }\n }\n Content.addHelp(`<em>Window Configuration Values:</em>`);\n for (let [k, v] of mcfgs) {\n let quote = (e) => `&quot;${e}&quot`;\n let kstr = `<span class=\"arg\">${k}</span>`;\n let vstr = `&quot;${v.Name}&quot;`;\n Content.addHelpText(`Module ${kstr}: ${vstr}`);\n for (let [ck, cv] of Object.entries(v)) {\n if (ck !== \"Name\") {\n Content.addHelpLine(ck, quote(cv));\n }\n }\n }\n } else if (t0 === \"help\") {\n Content.addHelpLine(\"//config\", \"Show and manipulate configuration\");\n Content.addHelpText(\"//config parameters:\");\n Content.addHelpLine(\"export\", \"Export *all* of localStorage to a new tab (contains passwords!)\");\n Content.addHelpLine(\"purge\", \"Clear localStorage (cannot be undone!)\");\n Content.addHelpLine(\"clientid\", \"Display ClientID\");\n Content.addHelpLine(\"pass\", \"Dislay OAuth token (if one is present)\");\n Content.addHelpLine(\"url\", \"Generate a URL from the current configuration\");\n Content.addHelpText(\"//config url parameters (can be used in any order):\");\n Content.addHelpLine(\"git\", \"Force URL to target github.io\");\n Content.addHelpLine(\"text\", \"Force URL to be un-encoded\");\n Content.addHelpLine(\"auth\", \"Include passwords in URL\");\n Content.addHelpLine(\"tag=&lt;value&gt;\", \"Set the tag to &lt;value&gt;\");\n Content.addHelpText(\"//config set <key> <value>: Change <key> to <value> (dangerous!)\");\n Content.addHelpText(\"//config setobj <key> <value>: Change <key> to JSON-encoded <value> (dangerous!)\");\n Content.addHelpText(\"//config unset <key>: Remove <key> (dangerous!)\");\n } else if (t0 === \"export\") {\n Util.Open(AssetPaths.CONFIG_EXPORT_WINDOW, \"_blank\", {});\n } else if (t0 === \"purge\") {\n Util.SetWebStorage({});\n window.liveStorage = {};\n Content.addNoticeText(`Purged storage \"${Util.GetWebStorageKey()}\"`);\n } else if (t0 === \"clientid\") {\n Content.addHelpLine(\"ClientID\", cfg.ClientID);\n } else if (t0 === \"pass\") {\n Content.addHelpLine(\"Pass\", cfg.Pass);\n } else if (t0 === \"url\") {\n /* Generate a URL with the current configuration, omitting items\n * left at default values */\n\n /* Base URL, query string array, and function to add items */\n let url = tokens.indexOf(\"git\") > -1 ? GIT_URL : CUR_URL;\n let qs = [];\n let qsAdd = (k, v) => qs.push(`${k}=${encodeURIComponent(v)}`);\n\n /* Generate and append query string items */\n if (cfg.Debug > 0) {\n qsAdd(\"debug\", cfg.Debug);\n }\n if (cfg.__clientid_override) {\n qsAdd(\"clientid\", cfg.ClientID);\n }\n qsAdd(\"channels\", cfg.Channels.join(\",\"));\n if (cfg.NoAssets) {\n qsAdd(\"noassets\", cfg.NoAssets);\n }\n if (cfg.NoFFZ) {\n qsAdd(\"noffz\", cfg.NoFFZ);\n }\n if (cfg.NoBTTV) {\n qsAdd(\"nobttv\", cfg.NoBTTV);\n }\n if (cfg.HistorySize) {\n qsAdd(\"hmax\", cfg.HistorySize);\n }\n for (let module of Object.keys(getModules())) {\n qsAdd(module, formatModuleConfig(cfg[module]));\n }\n qsAdd(\"layout\", FormatLayout(cfg.Layout));\n if (cfg.Transparent) {\n qsAdd(\"trans\", \"1\");\n }\n if (cfg.NoAutoReconnect) {\n qsAdd(\"norec\", \"1\");\n }\n let font_curr = Util.CSS.GetProperty(\"--body-font-size\");\n let font_dflt = Util.CSS.GetProperty(\"--body-font-size-default\");\n if (font_curr !== font_dflt) {\n qsAdd(\"size\", font_curr.replace(/[^0-9]/g, \"\"));\n }\n if (cfg.Plugins) {\n qsAdd(\"plugins\", \"1\");\n }\n if (cfg.MaxMessages !== TwitchClient.DEFAULT_MAX_MESSAGES) {\n qsAdd(\"max\", `${cfg.MaxMessages}`);\n }\n if (cfg.Font) {\n qsAdd(\"font\", cfg.Font);\n }\n if (cfg.Scroll) {\n qsAdd(\"scroll\", \"1\");\n }\n if (cfg.ShowClips) {\n qsAdd(\"clips\", \"1\");\n }\n if (tokens.indexOf(\"auth\") > -1) {\n qsAdd(\"user\", cfg.Name);\n qsAdd(\"pass\", cfg.Pass);\n }\n if (cfg.DisableEffects) {\n qsAdd(\"disable\", cfg.DisableEffects.join(\",\"));\n }\n if (cfg.EnableEffects) {\n qsAdd(\"enable\", cfg.EnableEffects.join(\",\"));\n }\n if (cfg.PluginConfig) {\n qsAdd(\"plugincfg\", JSON.stringify(cfg.PluginConfig));\n }\n if (cfg.ColorScheme === \"dark\") {\n qsAdd(\"scheme\", \"dark\");\n } else if (cfg.ColorScheme === \"light\") {\n qsAdd(\"scheme\", \"light\");\n }\n if (cfg.NoForce) {\n qsAdd(\"noforce\", \"1\");\n }\n if (cfg.Fanfare) {\n qsAdd(\"fanfare\", JSON.stringify(cfg.Fanfare));\n }\n\n /* Append a tag */\n let custom_tag = cfg.tag ? cfg.tag : \"\";\n for (let t of tokens.slice(1)) {\n if (t.startsWith(\"tag=\")) {\n custom_tag = t.substr(4);\n }\n }\n if (custom_tag) {\n qsAdd(\"tag\", custom_tag);\n }\n\n /* Append query string to the URL */\n if (tokens.includes(\"text\")) {\n url += \"?\" + qs.join(\"&\");\n } else {\n url += \"?base64=\" + encodeURIComponent(btoa(qs.join(\"&\")));\n }\n\n Content.addHelp($(`<a></a>`).attr(\"href\", url).text(url));\n } else if ((t0 === \"set\" || t0 === \"setobj\") && tokens.length > 2) {\n /* Allow changing configuration by command (dangerous) */\n let key = tokens[1];\n let val = tokens.slice(2).join(\" \");\n let newval = null;\n if (t0 === \"setobj\") {\n newval = JSON.parse(val);\n } else if (val === \"true\") {\n newval = true;\n } else if (val === \"false\") {\n newval = false;\n } else if (val === \"Infinity\") {\n newval = Infinity;\n } else if (val === \"-Infinity\") {\n newval = -Infinity;\n } else if (val === \"NaN\") {\n newval = NaN;\n } else if (val.match(/^[+-]?(?:\\d|[1-9]\\d*)$/)) {\n newval = Number.parseInt(val);\n } else if (val.match(/^[-+]?(?:\\d*\\.\\d+|\\d+)$/)) {\n newval = Number.parseFloat(val);\n } else {\n newval = val;\n }\n let newstr = JSON.stringify(newval);\n if (Util.ObjectHas(cfg, key)) {\n let oldval = Util.ObjectGet(cfg, key);\n let oldstr = JSON.stringify(oldval);\n Content.addHelpText(`Changing ${key} from \"${oldstr}\" to \"${newstr}\"`);\n Content.addHelpLine(key, oldstr);\n Content.addHelpLine(key, newstr);\n Util.ObjectSet(cfg, key, newval);\n mergeConfigObject(cfg);\n } else {\n Content.addHelpText(`Adding key ${key} with value \"${newstr}\"`);\n Content.addHelpLine(key, newstr);\n Util.ObjectSet(cfg, key, newval);\n mergeConfigObject(cfg);\n }\n } else if (t0 === \"unset\" && tokens.length > 1) {\n let t1 = tokens[1];\n if (Util.ObjectRemove(cfg, t1)) {\n Content.addHelpText(`Removed key ${t1} from localStorage`);\n Util.SetWebStorage(cfg);\n } else {\n Content.addHelpText(`Failed to remove key ${t1} from localStorage`);\n }\n if (window.liveStorage) {\n if (Util.ObjectRemove(window.liveStorage, t1)) {\n Content.addHelpText(`Removed key ${t1} from liveStorage`);\n } else {\n Content.addHelpText(`Failed to removed key ${t1} from liveStorage`);\n }\n }\n } else if (Util.ObjectHas(cfg, t0)) {\n Content.addHelpText(\"Configuration:\");\n Content.addHelpLine(t0, JSON.stringify(Util.ObjectGet(cfg, t0)));\n } else {\n let tok = `\"${t0}\"`;\n Content.addErrorText(`Unknown config command or key ${tok}`, true);\n }\n }, \"Obtain and modify configuration information; use //config help for details\");\n\n /* Obtain configuration, construct client */\n (function _configure_construct_client() {\n let cfg = getConfigObject(true);\n client = new TwitchClient(cfg);\n Util.DebugLevel = cfg.Debug;\n\n /* Change the document title to show our authentication state */\n document.title += \" -\";\n if (cfg.Pass && cfg.Pass.length > 0) {\n document.title += \" Authenticated\";\n } else {\n document.title += \" Read-Only\";\n if (cfg.Layout.Chat) {\n /* Change the chat placeholder and border to reflect read-only */\n $(\"#txtChat\").attr(\"placeholder\", \"Authentication needed to send messages\");\n Util.CSS.SetProperty(\"--chat-border\", \"#cd143c\");\n }\n }\n\n /* Set values we'll want to use later */\n config = getConfigObject();\n config.Plugins = Boolean(cfg.Plugins);\n /* Absolutely ensure the public config object lacks private fields */\n config.Pass = config.ClientID = null;\n delete config[\"Pass\"];\n delete config[\"ClientID\"];\n })();\n\n /* After all that, sync the final settings up with the html */\n $(\".module\").each(function() {\n setModuleSettings(this, config[$(this).attr(\"id\")]);\n });\n\n /* Disable configured events */\n if (config.DisableEffects) {\n for (let effect of config.EnableEffects) {\n if (CSSCheerStyles[effect]) {\n CSSCheerStyles[effect]._disabled = true;\n }\n }\n }\n\n /* Enable configured effects */\n if (config.EnableEffects) {\n for (let effect of config.EnableEffects) {\n if (CSSCheerStyles[effect]) {\n CSSCheerStyles[effect]._disabled = false;\n }\n }\n }\n\n /* Simulate clicking cbTransparent if config.Transparent is set */\n if (config.Transparent) {\n updateTransparency(true);\n $(\"#cbTransparent\").check();\n } else {\n $(\"#cbTransparent\").uncheck();\n }\n\n /* Set the text size if given */\n if (config.Size) {\n Util.CSS.SetProperty(\"--body-font-size\", config.Size);\n }\n\n /* Set the font if given */\n if (config.Font) {\n Util.CSS.SetProperty(\"--body-font\", config.Font);\n }\n\n /* If scrollbars are configured, enable them */\n if (config.Scroll) {\n $(\".module .content\").css(\"overflow-y\", \"scroll\");\n $(\"#cbScroll\").check();\n } else {\n $(\"#cbScroll\").uncheck();\n }\n\n /* If no channels are configured, show the settings panel */\n if (config.Channels.length === 0) {\n $(\"#settings\").fadeIn();\n }\n\n /* Apply the show-clips config to the settings div */\n if (config.ShowClips) {\n $(\"#cbClips\").check();\n } else {\n $(\"#cbClips\").uncheck();\n }\n\n /* Apply the no-force config to the settings div */\n if (config.NoForce) {\n $(\"#cbForce\").check();\n } else {\n $(\"#cbForce\").uncheck();\n }\n\n /* Apply the selected color scheme; if any */\n if (config.ColorScheme === \"dark\") {\n setDarkScheme();\n } else if (config.ColorScheme === \"light\") {\n setLightScheme();\n }\n\n if (config.NoAnim) {\n $(\"#cbAnimCheers\").uncheck();\n } else {\n $(\"#cbAnimCheers\").check();\n }\n\n $(\"#txtBGStyle\").val(\"\");\n\n if (config.Font) {\n $(\"#txtFont\").val(config.Font);\n } else {\n $(\"#txtFont\").val(Util.CSS.GetProperty(\"--body-font\"));\n }\n\n if (config.Size) {\n $(\"#txtFontSize\").val(config.Size);\n } else {\n $(\"#txtFontSize\").val(Util.CSS.GetProperty(\"--body-font-size\"));\n }\n\n if (config.tag) {\n $(\"#txtTag\").val(config.tag);\n }\n\n /* Construct the HTMLGenerator and Fanfare objects */\n client.set(\"HTMLGen\", new HTMLGenerator(client, config));\n client.set(\"Fanfare\", new Fanfare(client, config));\n\n /* Function for syncing configuration with HTMLGen */\n function updateHTMLGenConfig() {\n for (let [k, v] of Object.entries(getConfigObject())) {\n client.get(\"HTMLGen\").setValue(k, v);\n }\n }\n\n /* Construct the plugins */\n if (config.Plugins) {\n Plugins.loadAll(client, config);\n } else {\n Plugins.disable();\n }\n\n /* Allow JS access if debugging is enabled */\n if (Util.DebugLevel >= Util.LEVEL_DEBUG) {\n window.client = client;\n }\n\n /* Add documentation for the moderator chat commands */\n ChatCommands.addHelp(\"Moderator commands:\", {literal: true});\n ChatCommands.addHelp(\"!tfc reload: Reload the page\",\n {literal: true, command: true});\n ChatCommands.addHelp(\"!tfc force-reload: Reload the page, discarding cache\",\n {literal: true, command: true});\n ChatCommands.addHelp(\"!tfc nuke: Clear the chat\",\n {literal: true, command: true});\n ChatCommands.addHelp(\"!tfc nuke <user>: Clear messages sent by <user>\",\n {command: true, args: true});\n\n /* Close the main settings window */\n function closeSettings() {\n updateModuleConfig();\n $(\"#settings\").fadeOut();\n }\n\n /* Open the main settings window */\n function openSettings() {\n let cfg = getConfigObject(true);\n $(\"#txtChannel\").val(cfg.Channels.join(\",\"));\n $(\"#txtNick\").val(cfg.Name || Strings.NAME_AUTOGEN);\n if (cfg.Pass && cfg.Pass.length > 0) {\n $(\"#txtPass\").attr(\"disabled\", \"disabled\").hide();\n $(\"#txtPassDummy\").show();\n }\n $(\"#selDebug\").val(`${cfg.Debug}`);\n $(\"#settings\").fadeIn();\n }\n\n /* Toggle the main settings window */\n function toggleSettings() {\n if ($(\"#settings\").is(\":visible\")) {\n closeSettings();\n } else {\n openSettings();\n }\n }\n\n /* Close a module's settings window */\n function closeModuleSettings(module) {\n /* Update module configurations on close */\n updateModuleConfig();\n let $ms = $(module).find(\".settings\");\n let $in = $ms.siblings(\"input.name\");\n let $ln = $ms.siblings(\"label.name\");\n $in.hide();\n $ln.html($in.val()).show();\n $ms.fadeOut();\n }\n\n /* Open a module's settings window */\n function openModuleSettings(module) {\n let $ms = $(module).find(\".settings\");\n let $in = $ms.siblings(\"input.name\");\n let $ln = $ms.siblings(\"label.name\");\n $ln.hide();\n $in.val($ln.html()).show();\n $ms.fadeIn();\n }\n\n /* Toggle a module's settings window */\n function toggleModuleSettings(module) {\n let $ms = $(module).find(\".settings\");\n if ($ms.is(\":visible\")) {\n closeModuleSettings(module);\n } else {\n openModuleSettings(module);\n }\n }\n\n /* Reset chat auto-completion variables */\n function resetChatComplete() {\n let $c = $(\"#txtChat\");\n $c.attr(\"data-complete-text\", \"\");\n $c.attr(\"data-complete-pos\", \"-1\");\n $c.attr(\"data-complete-index\", \"0\");\n }\n\n /* Reset chat history recall */\n function resetChatHistory() {\n $(\"#txtChat\").attr(\"data-hist-index\", \"-1\");\n }\n\n /* Initialize chat auto-completion and history */\n resetChatComplete();\n resetChatHistory();\n\n /* Open the settings builder page */\n function openSettingsTab() {\n Util.Open(AssetPaths.BUILDER_WINDOW, \"_blank\", {});\n }\n\n /* Add command to open the settings builder page */\n ChatCommands.add(\"builder\", function _on_cmd_builder(cmd, tokens, client_) {\n Util.Open(AssetPaths.BUILDER_WINDOW, \"_blank\", {});\n }, \"Open the configuration builder wizard\");\n\n /* Pressing a key on the chat box */\n $(\"#txtChat\").keydown(function(e) {\n let t = event.target;\n if (e.key === \"Enter\") {\n if (t.value.trim().length > 0) {\n if (ChatCommands.isCommandStr(t.value)) {\n ChatCommands.execute(t.value, client);\n } else {\n client.SendMessageToAll(t.value);\n }\n client.AddHistory(t.value);\n t.value = \"\";\n resetChatComplete();\n resetChatHistory();\n }\n /* Prevent bubbling */\n e.preventDefault();\n return false;\n } else if (e.key === \"Tab\") {\n /* TODO: Complete command arguments and @user names */\n let orig_text = t.getAttribute(\"data-complete-text\") || t.value;\n let orig_pos = Number.parseInt(t.getAttribute(\"data-complete-pos\"));\n let compl_index = Number.parseInt(t.getAttribute(\"data-complete-index\"));\n if (Number.isNaN(orig_pos) || orig_pos === -1) {\n orig_pos = t.selectionStart;\n }\n if (Number.isNaN(compl_index)) {\n compl_index = 0;\n }\n let compl_obj = {\n orig_text: orig_text,\n orig_pos: orig_pos,\n curr_text: t.value,\n curr_pos: t.selectionStart,\n index: compl_index\n };\n compl_obj = ChatCommands.complete(client, compl_obj);\n t.setAttribute(\"data-complete-text\", compl_obj.orig_text);\n t.setAttribute(\"data-complete-pos\", compl_obj.orig_pos);\n t.setAttribute(\"data-complete-index\", compl_obj.index);\n t.value = compl_obj.curr_text;\n requestAnimationFrame(() => {\n t.selectionStart = compl_obj.curr_pos;\n t.selectionEnd = compl_obj.curr_pos;\n });\n resetChatHistory();\n e.preventDefault();\n return false;\n } else if (e.key === \"ArrowUp\" || e.key === \"ArrowDown\") {\n /* Handle traversing message history */\n let i = Number.parseInt($(this).attr(\"data-hist-index\"));\n let d = (e.key === \"ArrowUp\" ? 1 : -1);\n /* Restrict i to [-1, length-1] */\n i = Math.clamp(i + d, -1, client.GetHistoryLength() - 1);\n let val = client.GetHistoryItem(i);\n if (val !== null) {\n t.value = val.trim();\n }\n t.setAttribute(\"data-hist-index\", `${i}`);\n /* Delay moving the cursor until after the text is updated */\n requestAnimationFrame(() => {\n t.selectionStart = t.value.length;\n t.selectionEnd = t.value.length;\n });\n resetChatComplete();\n } else {\n resetChatComplete();\n resetChatHistory();\n }\n });\n\n /* Pressing enter while on the settings box */\n $(\"#settings\").keyup(function(e) {\n if (e.key === \"Enter\") {\n toggleSettings();\n }\n });\n\n /* Clicking the settings button */\n $(\"#btnSettings\").click(function(e) {\n toggleSettings();\n });\n\n /* Clicking on the `?` in the settings box header */\n $(\"#btnSettingsHelp\").click(function(e) {\n Util.Open(AssetPaths.HELP_WINDOW, \"_blank\", {});\n });\n\n /* Clicking on the \"Builder\" link in the settings box header */\n $(\"#btnSettingsBuilder\").click(function(e) {\n Util.Open(AssetPaths.BUILDER_WINDOW, \"_blank\", {});\n });\n\n /* Changing the \"Channels\" text box */\n onChange($(\"#txtChannel\"), function(e) {\n setChannels(client, $(this).val().split(\",\"));\n mergeConfigObject({\"Channels\": client.GetJoinedChannels()});\n });\n\n /* Changing the \"Scrollbars\" checkbox */\n $(\"#cbScroll\").change(function(e) {\n let scroll = $(this).is(\":checked\");\n mergeConfigObject({\"Scroll\": scroll});\n $(\".module .content\").css(\"overflow-y\", scroll ? \"scroll\" : \"hidden\");\n });\n\n /* Changing the \"stream is transparent\" checkbox */\n $(\"#cbTransparent\").change(function() {\n let val = $(this).is(\":checked\");\n updateTransparency(val);\n updateHTMLGenConfig();\n });\n\n /* Changing the \"Show Clips\" checkbox */\n $(\"#cbClips\").change(function(e) {\n mergeConfigObject({\"ShowClips\": $(this).is(\":checked\")});\n updateHTMLGenConfig();\n });\n\n /* Clicking on the \"No Force\" checkbox */\n $(\"#cbForce\").change(function(e) {\n mergeConfigObject({\"NoForce\": $(this).is(\":checked\")});\n updateHTMLGenConfig();\n });\n\n /* Changing the debug level */\n $(\"#selDebug\").change(function(e) {\n let v = parseInt($(this).val());\n Util.Log(`Changing debug level from ${Util.DebugLevel} to ${v}`);\n Util.DebugLevel = v;\n });\n\n /* Clicking on the reconnect link in the settings box */\n $(\"#btnReconnect\").click(function(e) {\n client.Connect();\n });\n\n /* Clicking on the \"Advanced Settings\" or \"Hide Advanced Settings\" links */\n $(\"#btnAdvanced, #btnAdvHide\").click(function(e) {\n $(\"#advSettings\").slideToggle();\n });\n\n /* Changing the \"Animated Cheers\" checkbox */\n $(\"#cbAnimCheers\").change(function(e) {\n mergeConfigObject({NoAnim: !$(this).is(\":checked\")});\n updateHTMLGenConfig();\n });\n\n /* Changing the \"Background Image\" text box */\n onChange($(\"#txtBGStyle\"), function(e) {\n $(\".module\").css(\"background-image\", $(this).val());\n });\n\n /* Changing the font text box */\n onChange($(\"#txtFont\"), function(e) {\n let v = $(this).val();\n if (v) {\n if (v === \"default\") {\n Util.CSS.SetProperty(\"--body-font\", \"var(--body-font-default)\");\n } else {\n Util.CSS.SetProperty(\"--body-font\", v);\n }\n }\n });\n\n /* Changing the font size text box */\n onChange($(\"#txtFontSize\"), function(e) {\n let v = $(this).val();\n if (v) {\n if (v === \"default\") {\n Util.CSS.SetProperty(\"--body-font-size\", \"var(--body-font-size-default)\");\n } else {\n Util.CSS.SetProperty(\"--body-font-size\", v);\n }\n }\n });\n\n /* Changing the tag */\n onChange($(\"#txtTag\"), function(e) {\n mergeConfigObject({tag: $(this).val()});\n });\n\n /* Pressing enter or escape on the module's name text box */\n $(\".module .header input.name\").keyup(function(e) {\n let $m = $(this).parentsUntil(\".column\").last();\n if (e.key === \"Enter\") {\n closeModuleSettings($m);\n } else if (e.key === \"Escape\") {\n /* Revert name change */\n $m.find(\"input.name\").val($m.find(\"label.name\").html());\n closeModuleSettings($m);\n }\n });\n\n /* Clicking on a \"Clear\" link */\n $(\".module .header .clear-link\").click(function(e) {\n $(this).parentsUntil(\".column\").find(\".line-wrapper\").remove();\n });\n\n /* Pressing enter or escape on one of the module menu text boxes */\n $(`.module .settings input[type=\"text\"]`).keyup(function(e) {\n if (e.key === \"Enter\") {\n let v = $(this).val();\n if (v.length > 0) {\n let $cli = $(this).closest(\"li\");\n let cls = $cli.attr(\"class\").replace(\"textbox\", \"\").trim();\n let cb = client.get(\"HTMLGen\").checkbox(v, null, cls, true);\n let val = $cli.find(\"label\").html();\n let $li = $(`<li><label>${cb}${val} ${v}</label></li>`);\n $cli.before($li);\n $(this).val(\"\");\n updateModuleConfig();\n }\n } else if (e.key === \"Escape\") {\n closeModuleSettings($(this).parentsUntil(\".column\").last());\n }\n });\n\n /* Key presses at the document level */\n $(document).keyup(function(e) {\n if (e.key === \"ScrollLock\") {\n /* ScrollLock: pause or resume auto-scroll */\n let $c = $(\".module .content\");\n let val = $c.attr(\"data-no-scroll\");\n if (val) {\n /* Enable scrolling */\n $c.removeAttr(\"data-no-scroll\");\n Util.Log(\"Auto-scroll enabled\");\n Content.addHelpText(\"Auto-scroll enabled\");\n } else {\n /* Disable scrolling */\n $c.attr(\"data-no-scroll\", \"1\");\n Util.Log(\"Auto-scroll disabled\");\n Content.addHelpText(\"Auto-scroll disabled\");\n }\n } else if (e.key === \"Escape\") {\n /* Escape: hide all open settings windows */\n if ($(\"#settings\").is(\":visible\")) {\n $(\"#settings\").fadeOut();\n }\n for (let m of Object.values(getModules())) {\n if ($(m).find(\".settings\").is(\":visible\")) {\n closeModuleSettings($(m));\n }\n }\n } else if (e.key === \"F1\") {\n /* F1: open configuration help window */\n openSettingsTab();\n }/* else if (!e.key.match(/^[A-Za-z0-9_]$/)) {\n if ([\"Shift\", \"Control\", \"Alt\", \"Tab\"].indexOf(e.key) === -1) {\n Util.LogOnly(e.key);\n Util.DebugOnly(e);\n }\n }*/\n });\n\n /* Clicking elsewhere on the document: reconnect, username context window */\n $(document).click(function(e) {\n let $t = $(e.target);\n\n /* Clicking on or off of the module settings button or box */\n for (let module of Object.values(getModules())) {\n let $m = $(module);\n let $mm = $m.find(\".menu\");\n let $mh = $m.find(\".header\");\n let $ms = $m.find(\".settings\");\n if (Util.PointIsOn(e.clientX, e.clientY, $mm)) {\n toggleModuleSettings($m);\n } else if ($ms.is(\":visible\")) {\n if (!Util.PointIsOn(e.clientX, e.clientY, $ms)) {\n if (!Util.PointIsOn(e.clientX, e.clientY, $mh)) {\n closeModuleSettings($m);\n }\n }\n }\n }\n\n /* Clicking off the main settings window */\n let $sw = $(\"#settings\");\n if ($sw.is(\":visible\")) {\n if (!Util.PointIsOn(e.clientX, e.clientY, $sw)) {\n closeSettings();\n }\n }\n\n /* Clicking on the username context window */\n let $cw = $(\"#userContext\");\n if (Util.PointIsOn(e.clientX, e.clientY, $cw)) {\n let ch = $cw.attr(\"data-channel\");\n let user = $cw.attr(\"data-user\");\n let userid = $cw.attr(\"data-user-id\");\n if (!client.IsUIDSelf(userid)) {\n if ($t.attr(\"id\") === \"cw-unmod\") {\n /* Clicked on the \"unmod\" link */\n Util.Log(`Unmodding ${user} in ${ch}`);\n client.SendMessage(ch, `/unmod ${user}`);\n } else if ($t.attr(\"id\") === \"cw-unvip\") {\n /* Clicked on the \"unvip\" link */\n Util.Log(`Removing VIP for ${user} in ${ch}`);\n client.SendMessage(ch, `/unvip ${user}`);\n } else if ($t.attr(\"id\") === \"cw-make-mod\") {\n /* Clicked on the \"mod\" link */\n Util.Log(`Modding ${user} in ${ch}`);\n client.SendMessage(ch, `/mod ${user}`);\n } else if ($t.attr(\"id\") === \"cw-make-vip\") {\n /* Clicked on the \"vip\" link */\n Util.Log(`VIPing ${user} in ${ch}`);\n client.SendMessage(ch, `/vip ${user}`);\n }\n }\n } else if ($t.attr(\"data-username\") === \"1\") {\n /* Clicked on a username; show context window */\n let $l = $t.parent();\n if ($cw.is(\":visible\")) {\n if ($cw.attr(\"data-user-id\") === $l.attr(\"data-user-id\")) {\n /* Clicked on the same name: fade out */\n $cw.fadeOut();\n } else {\n /* Clicked on a different name */\n /* FIXME: Slide to new user rather than teleport */\n showUserContextWindow(client, $cw, $l);\n }\n } else {\n showUserContextWindow(client, $cw, $l);\n }\n } else if ($cw.is(\":visible\")) {\n /* Clicked somewhere else: close context window */\n $cw.fadeOut();\n }\n\n /* Clicking on a \"Reconnect\" link */\n if ($t.attr(\"data-reconnect\") === \"1\") {\n Content.addNoticeText(\"Reconnecting...\");\n client.Connect();\n }\n\n /* Clicking on an emote\n if ($t.attr(\"data-is-emote\") === \"1\") {\n Util.LogOnly(`Clicked on an emote: ${$t.parent().html()}`);\n }\n */\n });\n\n /* WebSocket opened */\n client.bind(\"twitch-open\", function _on_twitch_open(e) {\n $(\".loading\").remove();\n $(\"#debug\").hide();\n if (Util.DebugLevel >= Util.LEVEL_DEBUG) {\n if (client.IsAuthed()) {\n Content.addInfoText(\"Connected (authenticated)\");\n } else {\n Content.addInfoText(\"Connected (unauthenticated)\");\n }\n }\n if (getConfigValue(\"Channels\").length === 0) {\n Content.addInfoText(\"No channels configured; type //join <channel> to join one!\");\n }\n });\n\n /* WebSocket closed */\n client.bind(\"twitch-close\", function _on_twitch_close(e) {\n let code = e.object.event.code;\n let reason = e.object.event.reason;\n let msg = `(code ${code} ${Util.WSStatus[code]})`;\n if (reason) {\n msg = `(code ${code} ${Util.WSStatus[code]}: ${reason})`;\n }\n if (getConfigValue(\"NoAutoReconnect\")) {\n Content.addErrorText(`Connection closed ${msg} ${Strings.RECONNECT}`);\n } else {\n Content.addErrorText(`Connection closed ${msg}; reconnecting in 5 seconds...`);\n if (!client.connecting) {\n window.setTimeout(() => { client.Connect(); }, 5000);\n }\n }\n });\n\n /* Client joined a channel */\n client.bind(\"twitch-joined\", function _on_twitch_joined(e) {\n let layout = getConfigValue(\"Layout\");\n if (!layout.Slim) {\n Content.addInfoText(`Joined ${Twitch.FormatChannel(e.channel)}`);\n }\n });\n\n /* Client left a channel */\n client.bind(\"twitch-parted\", function _on_twitch_parted(e) {\n let layout = getConfigValue(\"Layout\");\n if (!layout.Slim) {\n Content.addInfoText(`Left ${Twitch.FormatChannel(e.channel)}`);\n }\n });\n\n /* Notice (or warning) from Twitch */\n client.bind(\"twitch-notice\", function _on_twitch_notice(e) {\n let channel = Twitch.FormatChannel(e.channel);\n let message = e.message;\n Content.addNoticeText(`${channel}: ${message}`);\n if (e.noticeMsgId === \"cmds_available\") {\n Content.addInfoText(\"Use //help to see Twitch Filtered Chat commands\");\n }\n });\n\n /* Error from Twitch or Twitch Client API */\n client.bind(\"twitch-error\", function _on_twitch_error(e) {\n Util.Error(e);\n let user = e.user;\n let command = e.values.command;\n let message = e.message;\n Content.addErrorText(`Error for ${user}: ${command}: ${message}`);\n });\n\n /* Message received from Twitch */\n client.bind(\"twitch-message\", function _on_twitch_message(e) {\n if (Util.DebugLevel >= Util.LEVEL_TRACE) {\n if (e instanceof TwitchEvent) {\n Content.addPreText(e.repr());\n } else {\n Content.addPreText(JSON.stringify(e));\n }\n }\n /* Avoid flooding the DOM with stale chat messages */\n let max = getConfigValue(\"MaxMessages\");\n /* FIXME: Causes flickering for some reason */\n for (let c of $(\".content\")) {\n while ($(c).find(\".line-wrapper\").length > max) {\n $(c).find(\".line-wrapper\").first().remove();\n }\n }\n });\n\n /* Received streamer info */\n client.bind(\"twitch-streaminfo\", function _on_twitch_streaminfo(e) {\n let layout = getConfigValue(\"Layout\");\n let cinfo = client.GetChannelInfo(e.channelString) || {};\n if (layout && !layout.Slim) {\n if (cinfo.online) {\n try {\n let url = cinfo.stream.channel.url;\n let name = cinfo.stream.channel.display_name;\n let game = cinfo.stream.game;\n let viewers = cinfo.stream.viewers;\n Content.addNotice(Strings.StreamInfo(url, name, game, viewers));\n if (cinfo.stream.channel.status) {\n Content.addNoticeText(cinfo.stream.channel.status);\n }\n }\n catch (err) {\n Util.ErrorOnly(\"Failed to obtain stream information:\", cinfo);\n Util.Error(err);\n Content.addNotice(Strings.StreamOnline(e.channelString));\n }\n } else {\n Content.addNotice(Strings.StreamOffline(e.channelString));\n }\n }\n });\n\n /* Received chat message */\n client.bind(\"twitch-chat\", function _on_twitch_chat(e) {\n if (e instanceof TwitchChatEvent) {\n let m = typeof(e.message) === \"string\" ? e.message : \"\";\n if (e.flags && e.flags.mod && m.indexOf(\" \") > -1) {\n let tokens = m.split(\" \");\n if (tokens[0] === \"!tfc\") {\n if (tokens[1] === \"reload\") {\n location.reload();\n } else if (tokens[1] === \"force-reload\") {\n location.reload(true);\n } else if (tokens[1] === \"clear\") {\n $(\".content\").children().remove();\n } else if (tokens[1] === \"nuke\") {\n if (tokens[2] && tokens[2].length > 1) {\n let name = CSS.escape(tokens[2].toLowerCase());\n $(`[data-user=\"${name}\"]`).parent().remove();\n } else {\n $(\".content\").children().remove();\n }\n }\n return;\n }\n }\n }\n $(\".module\").each(function() {\n let H = client.get(\"HTMLGen\");\n if (!shouldFilter($(this), e)) {\n let $c = $(this).find(\".content\");\n let $w = $(`<div class=\"line line-wrapper\"></div>`);\n let $e = H.gen(e);\n let $clip = $e.find(\".message[data-clip]\");\n if ($clip.length > 0) {\n let slug = $clip.attr(\"data-clip\");\n client.GetClip(slug)\n .then((clip_data) => {\n client.GetGame(clip_data.game_id)\n .then((game_data) => {\n Content.addHTML(H.genClip(slug, clip_data, game_data), $c);\n });\n });\n }\n $w.append($e);\n Content.addHTML($w, $c);\n }\n });\n });\n\n /* Received CLEARCHAT event */\n client.bind(\"twitch-clearchat\", function _on_twitch_clearchat(e) {\n if (e.flags[\"target-user-id\"]) {\n /* Moderator timed out a user */\n let r = CSS.escape(e.flags[\"room-id\"]);\n let u = CSS.escape(e.flags[\"target-user-id\"]);\n let l = $(`.chat-line[data-channel-id=\"${r}\"][data-user-id=\"${u}\"]`);\n l.parent().remove();\n } else {\n /* Moderator cleared the chat */\n $(\"div.content\").find(\".line-wrapper\").remove();\n }\n });\n\n /* Received CLEARMSG event */\n client.bind(\"twitch-clearmsg\", function _on_twitch_clearmsg(e) {\n Util.StorageAppend(LOG_KEY, e);\n Util.Warn(\"Unhandled CLEARMSG:\", e);\n });\n\n /* User subscribed */\n client.bind(\"twitch-sub\", function _on_twitch_sub(e) {\n Util.StorageAppend(LOG_KEY, e);\n Content.addHTML(client.get(\"HTMLGen\").sub(e));\n });\n\n /* User resubscribed */\n client.bind(\"twitch-resub\", function _on_twitch_resub(e) {\n Util.StorageAppend(LOG_KEY, e);\n Content.addHTML(client.get(\"HTMLGen\").resub(e));\n /* Display the resub message, if one is present */\n if (e.message) {\n let $msg = client.get(\"HTMLGen\").gen(e);\n $msg.addClass(\"message\");\n $msg.addClass(\"sub-message\");\n $msg.addClass(\"sub-user-message\");\n Content.addHTML($msg);\n }\n });\n\n /* User gifted a subscription */\n client.bind(\"twitch-giftsub\", function _on_twitch_giftsub(e) {\n Util.StorageAppend(LOG_KEY, e);\n Content.addHTML(client.get(\"HTMLGen\").giftsub(e));\n });\n\n /* Anonymous user gifted a subscription */\n client.bind(\"twitch-anongiftsub\", function _on_twitch_anongiftsub(e) {\n Util.StorageAppend(LOG_KEY, e);\n Content.addHTML(client.get(\"HTMLGen\").anongiftsub(e));\n });\n\n /* Channel was raided */\n client.bind(\"twitch-raid\", function _on_twitch_raid(e) {\n Util.StorageAppend(LOG_KEY, e);\n Content.addHTML(client.get(\"HTMLGen\").raid(e));\n });\n\n /* New user's YoHiYo */\n client.bind(\"twitch-newuser\", function _on_twitch_newuser(e) {\n Util.StorageAppend(LOG_KEY, e);\n let H = client.get(\"HTMLGen\");\n let $msg = H.newUser(e);\n $msg.find(\".message\").addClass(\"effect-rainbow\").addClass(\"effect-disco\");\n Content.addHTML($msg);\n Content.addHTML(H.gen(e));\n });\n\n /* User gifting rewards to the community */\n client.bind(\"twitch-rewardgift\", function _on_twitch_rewardgift(e) {\n Util.StorageAppend(LOG_KEY, e);\n Content.addHTML(client.get(\"HTMLGen\").rewardGift(e));\n });\n\n /* User gifting a subscription to the community */\n client.bind(\"twitch-mysterygift\", function _on_twitch_mysterygift(e) {\n Util.StorageAppend(LOG_KEY, e);\n Content.addHTML(client.get(\"HTMLGen\").mysteryGift(e));\n });\n\n /* User continuing their gifted subscription */\n client.bind(\"twitch-giftupgrade\", function _on_twitch_giftupgrade(e) {\n Util.StorageAppend(LOG_KEY, e);\n Content.addHTML(client.get(\"HTMLGen\").giftUpgrade(e));\n });\n\n /* User continuing their gifted subscription via Twitch Prime */\n client.bind(\"twitch-primeupgrade\", function _on_twitch_primegiftupgrade(e) {\n Util.StorageAppend(LOG_KEY, e);\n Content.addHTML(client.get(\"HTMLGen\").giftUpgrade(e));\n });\n\n /* User continuing their anonymously-gifted subscription */\n client.bind(\"twitch-anongiftupgrade\", function _on_twitch_anongiftupgrade(e) {\n Util.StorageAppend(LOG_KEY, e);\n Content.addHTML(client.get(\"HTMLGen\").giftUpgrade(e));\n });\n\n /* Received some other kind of usernotice */\n client.bind(\"twitch-otherusernotice\", function _on_twitch_otherusernotice(e) {\n Util.StorageAppend(LOG_KEY, e);\n Util.Warn(\"Unknown USERNOTICE\", e);\n /* TODO: unraid, bitsbadgetier */\n });\n\n /* Received a reconnect request from Twitch */\n client.bind(\"twitch-reconnect\", function _on_twitch_reconnect(e) {\n /* Client will reconnect automatically */\n });\n\n /* Bind to the rest of the events */\n client.bind(\"twitch-join\", function _on_twitch_join(e) {});\n client.bind(\"twitch-part\", function _on_twitch_part(e) {});\n client.bind(\"twitch-hosttarget\", function _on_twitch_hosttarget(e) {});\n client.bind(\"twitch-userstate\", function _on_twitch_userstate(e) {});\n client.bind(\"twitch-roomstate\", function _on_twitch_roomstate(e) {});\n client.bind(\"twitch-globaluserstate\", function _on_twitch_globaluserstate(e) {});\n client.bind(\"twitch-usernotice\", function _on_twitch_usernotice(e) {});\n client.bind(\"twitch-ack\", function _on_twitch_ack(e) {});\n client.bind(\"twitch-ping\", function _on_twitch_ping(e) {});\n client.bind(\"twitch-names\", function _on_twitch_names(e) {});\n client.bind(\"twitch-topic\", function _on_twitch_topic(e) {});\n client.bind(\"twitch-privmsg\", function _on_twitch_privmsg(e) {});\n client.bind(\"twitch-whisper\", function _on_twitch_whisper(e) {});\n client.bind(\"twitch-mode\", function _on_twitch_mode(e) {});\n client.bind(\"twitch-other\", function _on_twitch_other(e) {});\n\n /* Warn about unbound events */\n client.bindDefault(function _on_default(e) {\n Util.Warn(\"Unbound event:\", e);\n Util.StorageAppend(LOG_KEY, e);\n });\n\n /* Finally, connect */\n client.Connect();\n}", "function formal_body_onload_init() {\n // add server side elements with buttons, actions, etc\n formal_adorn_server_side_elements();\n}", "function subSmartClient(script_retorno) {\n\n var scripts = \"\";\n\n var tipo_retorno = typeof (script_retorno);\n\n if (tipo_retorno == \"string\") {\n try {\n var retorno_json = JSON.parse(script_retorno);\n script_retorno = retorno_json;\n tipo_retorno = \"object\";\n } catch (e) {\n tipo_retorno = \"string\";\n }\n }\n\n if (tipo_retorno == \"object\") {\n if (script_retorno) {\n if (script_retorno.script) {\n if (script_retorno.script != \"\") {\n scripts = script_retorno.script;\n script_retorno.script = \"\";\n } else { return script_retorno; }\n } else if (script_retorno.all) {\n if (script_retorno.all.frontend.script) {\n if (script_retorno.all.frontend.script != \"\") {\n scripts = script_retorno.all.frontend.script;\n script_retorno.all.frontend.script = \"\";\n } else { return script_retorno; }\n }\n }\n } else {\n return script_retorno;\n }\n } else if (typeof (script_retorno) != \"string\") {\n return script_retorno;\n } else {\n scripts = script_retorno;\n }\n\n if (scripts == \"\") {\n return scripts;\n }\n\n var inicio_script = scripts.indexOf(\"<script>\");\n\n if (inicio_script == -1) {\n return scripts;\n }\n\n scripts = scripts.substring(inicio_script);\n scripts = scripts.replaceAll(\"<script>\", \"\");\n scripts = scripts.split(\"</script>\");\n\n //scripts = scripts.replace(/\\s/g, \"\");\n\n //var script = scripts.match(/_iniciodoscriptjs_(.\\n?)*_finaldoscriptjs_/g);\n\n if (scripts.length == 0) {\n return script_retorno;\n }\n\n for (var i = 0; i < scripts.length; i++) {\n //if (script[i].indexOf(\"<script>\") != -1) {\n var fun = scripts[i]; //.replace(/\\<script\\>/g, \"\");\n if (fun != \"\") {\n\n eval(fun);\n\n if (tipo_retorno == \"string\") {\n script_retorno = script_retorno.replace(`<script>${fun}<\\script>`, \"\");\n }\n }\n //}\n }\n\n return (script_retorno);\n}", "function WebIdUtils () {\n}", "function Bevy() {}", "function NetWorthApp() {\n\tconsole.log('NetWorth has started. Thank you.');\n\t// variables, setup, shared functions\n}", "function Module(stdlib, imports, buffer) {\n \"use asm\";\n\n function f() {\n return 281474976710655 * 1048575 | 0;\n }\n\n return {\n f: f\n };\n}", "async openIntercomClient () {\n\t\t// NOTE: THE LINE BELOW MAKES THIS SCRIPT OBSOLETE, WE NO LONGER HAVE AN INTERCOM KEY\n\t\t//this.intercomClient = new Intercom.Client({ token: ApiConfig.getPreferredConfig().telemetry.intercom.token });\n\t}", "function serverConnected() {\n print(\"Connected to Server\");\n}", "handleClientLoad() {\n const script = document.createElement(\"script\");\n script.onload = () => {\n // Gapi isn't available immediately so we have to wait until it is to use gapi.\n this.loadClientWhenGapiReady(script);\n //window['gapi'].load('client:auth2', this.initClient);\n };\n script.src = \"https://apis.google.com/js/client.js\";\n document.body.appendChild(script);\n }", "function start(){ alert(\"AstroJS Is Ready! Release 3.022 by Salvatore Ruiu ( www.suchelu.it )\"); }", "function WebSocketConnection()\n{\nvar self = this;\n\nvar isNodeJs = (typeof window === \"undefined\" ? true : false);\n\nvar lib = null;\nvar SpaceifyError = null;\nvar SpaceifyLogger = null;\n\nif(isNodeJs)\n\t{\n\tlib = \"/var/lib/spaceify/code/\";\n\n\tSpaceifyLogger = require(lib + \"spaceifylogger\");\n\tSpaceifyError = require(lib + \"spaceifyerror\");\n\n\tglobal.fs = require(\"fs\");\n\tglobal.WebSocket = require(\"websocket\").w3cwebsocket;\n\t}\nelse\n\t{\n\tlib = (window.WEBPACK_MAIN_LIBRARY ? window.WEBPACK_MAIN_LIBRARY : window);\n\n\tSpaceifyLogger = lib.SpaceifyLogger;\n\tSpaceifyError = lib.SpaceifyError;\n\t}\n\nvar errorc = new SpaceifyError();\nvar logger = new SpaceifyLogger(\"WebSocketConnection\");\n\nvar url = \"\";\nvar id = null;\nvar port = null;\nvar socket = null;\nvar origin = null;\nvar pipedTo = null;\nvar isOpen = false;\nvar isSecure = false;\nvar remotePort = null;\nvar remoteAddress = null;\nvar eventListener = null;\n\n// For client-side use, in both Node.js and the browser\n\nself.connect = function(opts, callback)\n\t{\n\tid = opts.id || null;\n\tport = opts.port || \"\";\n\tisSecure = opts.isSecure || false;\n\n\tvar caCrt = opts.caCrt || \"\";\n\tvar hostname = opts.hostname || null;\n\tvar protocol = (!isSecure ? \"ws\" : \"wss\");\n\tvar subprotocol = opts.subprotocol || \"json-rpc\";\n\n\ttry\t{\n\t\turl = protocol + \"://\" + hostname + (port ? \":\" + port : \"\") + (id ? \"?id=\" + id : \"\");\n\n\t\tvar cco = (isNodeJs && isSecure ? { tlsOptions: { ca: [fs.readFileSync(caCrt, \"utf8\")] } } : null);\n\n\t\tsocket = new WebSocket(url, \"json-rpc\", null, null, null, cco);\n\n\t\tsocket.binaryType = \"arraybuffer\";\n\n\t\tsocket.onopen = function()\n\t\t\t{\n\t\t\tlogger.log(\"WebSocketConnection::onOpen() \" + url);\n\n\t\t\tisOpen = true;\n\n\t\t\tcallback(null, true);\n\t\t\t};\n\n\t\tsocket.onerror = function(err)\n\t\t\t{\n\t\t\tlogger.error(\"WebSocketConnection::onError() \" + url, true, true, logger.ERROR);\n\n\t\t\tisOpen = false;\n\n\t\t\tcallback(errorc.makeErrorObject(\"wsc\", \"Failed to open WebsocketConnection.\", \"WebSocketConnection::connect\"), null);\n\t\t\t}\n\n\t\tsocket.onclose = function(reasonCode, description)\n\t\t\t{\n\t\t\tonSocketClosed(reasonCode, description, self);\n\t\t\t};\n\n\t\tsocket.onmessage = onMessageEvent;\n\t\t}\n\tcatch(err)\n\t\t{\n\t\tcallback(err, null);\n\t\t}\n\t};\n\n// For server-side Node.js use only\n\nself.setSocket = function(val)\n\t{\n\ttry\t{\n\t\tsocket = val;\n\n\t\tsocket.on(\"message\", onMessage);\n\n\t\tsocket.on(\"close\", function(reasonCode, description)\n\t\t\t{\n\t\t\tonSocketClosed(reasonCode, description, self);\n\t\t\t});\n\n\t\tisOpen = true;\n\t\t}\n\tcatch(err)\n\t\t{\n\t\tlogger.error(err, true, true, logger.ERROR);\n\t\t}\n\t};\n\nself.setId = function(val)\n\t{\n\tid = val;\n\t};\n\nself.setPipedTo = function(targetId)\n\t{\n\tpipedTo = targetId;\n\t};\n\nself.setRemoteAddress = function(val)\n\t{\n\tremoteAddress = val;\n\t};\n\nself.setRemotePort = function(val)\n\t{\n\tremotePort = val;\n\t};\n\nself.setOrigin = function(val)\n\t{\n\torigin = val;\n\t};\n\nself.setIsSecure = function(val)\n\t{\n\tisSecure = val;\n\t}\n\nself.setEventListener = function(listener)\n\t{\n\teventListener = listener;\n\t};\n\nself.getId = function()\n\t{\n\treturn id;\n\t};\n\nself.getRemoteAddress = function()\n\t{\n\treturn remoteAddress;\n\t};\n\nself.getRemotePort = function()\n\t{\n\treturn remotePort;\n\t};\n\nself.getOrigin = function()\n\t{\n\treturn origin;\n\t};\n\nself.getIsSecure = function()\n\t{\n\treturn isSecure;\n\t}\n\nself.getPipedTo = function()\n\t{\n\treturn pipedTo;\n\t}\n\nself.getIsOpen = function()\n\t{\n\treturn isOpen;\n\t}\n\nself.getPort = function()\n\t{\n\treturn port;\n\t}\n\nvar onMessage = function(message)\n\t{\n\ttry\t{\n\t\tif (eventListener)\n\t\t\t{\n\t\t\tif (message.type == \"utf8\")\n\t\t\t\t{\n\t\t\t\t//logger.log(\"WebSocketConnection::onMessage(string): \" + JSON.stringify(message.utf8Data));\n\n\t\t\t\teventListener.onMessage(message.utf8Data, self);\n\t\t\t\t}\n\t\t\tif (message.type == \"binary\")\n\t\t\t\t{\n\t\t\t\t//logger.log(\"WebSocketConnection::onMessage(binary): \" + binaryData.length);\n\n\t\t\t\teventListener.onMessage(message.binaryData, self);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tcatch(err)\n\t\t{\n\t\tlogger.error(err, true, true, logger.ERROR);\n\t\t}\n\t};\n\nvar onMessageEvent = function(event)\n\t{\n\t//logger.log(\"WebSocketConnection::onMessageEvent() \" + JSON.stringify(event.data));\n\n\ttry\t{\n\t\tif (eventListener)\n\t\t\teventListener.onMessage(event.data, self);\n\t\t}\n\tcatch(err)\n\t\t{\n\t\tlogger.error(err, true, true, logger.ERROR);\n\t\t}\n\t};\n\nvar onSocketClosed = function(reasonCode, description, obj)\n\t{\n\tlogger.log(\"WebSocketConnection::onSocketClosed() \" + url);\n\n\ttry\t{\n\t\tisOpen = false;\n\n\t\tif (eventListener)\n\t\t\teventListener.onDisconnected(obj.getId());\n\t\t}\n\tcatch(err)\n\t\t{\n\t\tlogger.error(err, true, true, logger.ERROR);\n\t\t}\n\t};\n\nself.send = function(message)\n\t{\n\ttry\t{\n\t\tsocket.send(message);\n\t\t}\n\tcatch(err)\n\t\t{\n\t\tlogger.error(err, true, true, logger.ERROR);\n\t\t}\n\t};\n\nself.sendBinary = self.send;\n\nself.close = function()\n\t{\n\ttry\t{\n\t\tsocket.close();\n\t\t}\n\tcatch(err)\n\t\t{\n\t\tlogger.error(err, true, true, logger.ERROR);\n\t\t}\n\t};\n\n}", "function cProxy(\n)\n{\n\n\n}", "function app() {\n\n // load some scripts (uses promises :D)\n //loader.load(\n {\n url: \"./bower_components/jquery/dist/jquery.min.js\"\n }; {\n url: \"./bower_components/lodash/dist/lodash.min.js\"\n }; {\n url: \"./bower_components/pathjs/path.min.js\"\n };then(function() {\n _.templateSettings.interpolate = /{([\\s\\S]+?)}/g;\n\n var options = {\n api_key: \"ab2ph0vvjrfql5ppli3pucmw\"\n }\n // start app?\n var client = new EtsyClient(options);\n\n\n })\n\n}", "parseClientPackage() {\n const clientPath = this.config.getPath('client');\n const clientPkg = TESTS ? require(`${path.resolve(clientPath, '..')}/package.json`) : require(`${clientPath}/package.json`);\n const { version } = clientPkg;\n const main = TESTS ? 'betterdiscord.client.js' : clientPkg.main;\n this.config.addPath('client_script', `${clientPath}/${main}`);\n this.config.setClientVersion(version);\n console.log(`[BetterDiscord] Client v${this.config.clientVersion} - ${this.config.getPath('client_script')}`);\n }", "function main() {\n\n var clientLib = namespace.lookup('com.pageforest.client');\n\n // Client library for Pageforest\n ns.client = new clientLib.Client(ns);\n\n // Use the standard Pageforest UI widget.\n //ns.client.addAppBar();\n\n // This app demonstrates auto-loading - will reload the doc if\n // it is changed by another user.\n ns.client.autoLoad = true;\n\n // Quick call to poll - don't wait a whole second to try loading\n // the doc and logging in the user.\n ns.client.poll();\n\n // Expose appid\n items.appid = ns.client.appid;\n }", "function initPysijs() {\n Physijs.scripts.worker = '/lib/physijs_worker.js'\n Physijs.scripts.ammo = '/lib/ammo.js';\n}", "function createJewelry(){\n\t\t\t\t//retrive values form our form fields\n\t\t\t\tvar CustomText = document.getElementById(\"CustomText\");\n\t\t\t\tvar Materialfield = document.getElementById(\"Material\");\n\t\t\t\tvar RingSize = document.getElementById(\"RingSize\");\n\t\t\t\t\n\n\t\t\t\t//Send request to polychemy servers.\n\t\t\t\texecScript(script,renderTurntable, Materialfield.value, CustomText.value, RingSize.value, \"\", \"\")\n\t\t\t}", "function API(e=\"untitled\",s=!1){return new class{constructor(e,s){this.name=e,this.debug=s,this.isRequest=\"undefined\"!=typeof $request,this.isQX=\"undefined\"!=typeof $task,this.isLoon=\"undefined\"!=typeof $loon,this.isSurge=\"undefined\"!=typeof $httpClient&&!this.isLoon,this.isNode=\"function\"==typeof require,this.isJSBox=this.isNode&&\"undefined\"!=typeof $jsbox,this.node=(()=>{if(this.isNode){const e=\"undefined\"!=typeof $request?void 0:require(\"request\"),s=require(\"fs\");return{request:e,fs:s}}return null})(),this.initCache();const t=(e,s)=>new Promise(function(t){setTimeout(t.bind(null,s),e)});Promise.prototype.delay=function(e){return this.then(function(s){return t(e,s)})}}get(e){return this.isQX?(\"string\"==typeof e&&(e={url:e,method:\"GET\"}),$task.fetch(e)):new Promise((s,t)=>{this.isLoon||this.isSurge?$httpClient.get(e,(e,i,o)=>{e?t(e):s({statusCode:i.status,headers:i.headers,body:o})}):this.node.request(e,(e,i,o)=>{e?t(e):s({...i,statusCode:i.statusCode,body:o})})})}post(e){return e.body&&e.headers&&!e.headers[\"Content-Type\"]&&(e.headers[\"Content-Type\"]=\"application/x-www-form-urlencoded\"),this.isQX?(\"string\"==typeof e&&(e={url:e}),e.method=\"POST\",$task.fetch(e)):new Promise((s,t)=>{this.isLoon||this.isSurge?$httpClient.post(e,(e,i,o)=>{e?t(e):s({statusCode:i.status,headers:i.headers,body:o})}):this.node.request.post(e,(e,i,o)=>{e?t(e):s({...i,statusCode:i.statusCode,body:o})})})}initCache(){if(this.isQX&&(this.cache=JSON.parse($prefs.valueForKey(this.name)||\"{}\")),(this.isLoon||this.isSurge)&&(this.cache=JSON.parse($persistentStore.read(this.name)||\"{}\")),this.isNode){let e=\"root.json\";this.node.fs.existsSync(e)||this.node.fs.writeFileSync(e,JSON.stringify({}),{flag:\"wx\"},e=>console.log(e)),this.root={},e=`${this.name}.json`,this.node.fs.existsSync(e)?this.cache=JSON.parse(this.node.fs.readFileSync(`${this.name}.json`)):(this.node.fs.writeFileSync(e,JSON.stringify({}),{flag:\"wx\"},e=>console.log(e)),this.cache={})}}persistCache(){const e=JSON.stringify(this.cache);this.isQX&&$prefs.setValueForKey(e,this.name),(this.isLoon||this.isSurge)&&$persistentStore.write(e,this.name),this.isNode&&(this.node.fs.writeFileSync(`${this.name}.json`,e,{flag:\"w\"},e=>console.log(e)),this.node.fs.writeFileSync(\"root.json\",JSON.stringify(this.root),{flag:\"w\"},e=>console.log(e)))}write(e,s){this.log(`SET ${s}`),-1!==s.indexOf(\"#\")?(s=s.substr(1),(this.isSurge||this.isLoon)&&$persistentStore.write(e,s),this.isQX&&$prefs.setValueForKey(e,s),this.isNode&&(this.root[s]=e)):this.cache[s]=e,this.persistCache()}read(e){return this.log(`READ ${e}`),-1===e.indexOf(\"#\")?this.cache[e]:(e=e.substr(1),this.isSurge||this.isLoon?$persistentStore.read(e):this.isQX?$prefs.valueForKey(e):this.isNode?this.root[e]:void 0)}delete(e){this.log(`DELETE ${e}`),-1!==e.indexOf(\"#\")?(e=e.substr(1),(this.isSurge||this.isLoon)&&$persistentStore.write(null,e),this.isQX&&$prefs.removeValueForKey(e),this.isNode&&delete this.root[e]):delete this.cache[e],this.persistCache()}notify(s=e,t=\"\",i=\"\",o,n){if(this.isSurge){let e=i+(null==n?\"\":`\\n\\n多媒体链接:${n}`),r={};o&&(r.url=o),\"{}\"==JSON.stringify(r)?$notification.post(s,t,e):$notification.post(s,t,e,r)}if(this.isQX){let e={};o&&(e[\"open-url\"]=o),n&&(e[\"media-url\"]=n),\"{}\"==JSON.stringify(e)?$notify(s,t,i):$notify(s,t,i,e)}if(this.isLoon){let e={};o&&(e.openUrl=o),n&&(e.mediaUrl=n),\"{}\"==JSON.stringify(e)?$notification.post(s,t,i):$notification.post(s,t,i,e)}if(this.isNode){let e=i+(null==o?\"\":`\\n\\n跳转链接:${o}`)+(null==n?\"\":`\\n\\n多媒体链接:${n}`);if(this.isJSBox){const i=require(\"push\");i.schedule({title:s,body:t?t+\"\\n\"+e:e})}else console.log(`${s}\\n${t}\\n${e}\\n\\n`)}}log(e){this.debug&&console.log(e)}info(e){console.log(e)}error(e){console.log(\"ERROR: \"+e)}wait(e){return new Promise(s=>setTimeout(s,e))}done(e={}){this.isQX||this.isLoon||this.isSurge?this.isRequest?$done(e):$done():this.isNode&&!this.isJSBox&&\"undefined\"!=typeof $context&&($context.headers=e.headers,$context.statusCode=e.statusCode,$context.body=e.body)}}(e,s)}", "function Bot$start(){\n if(this.client == null){\n this.createServer();\n this.createClient();\n \n }\n}", "function serverConnected() {\n infoData=\"Connected to /node backend\";\n println(\"Connected to /node backend\");\n}", "buildProtocol() {\n this.pcolInstance = new WsBrowserClientProtocol(\n this,\n this.options.version,\n this.options.delimiter\n );\n }", "_getClient () {\n return _client\n }", "connect() {\n throw new Error(\n 'The Message Bus is not currently supported in browser environments'\n );\n }", "function nlobjServerResponse() {\n}", "function Action()\n{\n\tweb.url(\n\t\t{\n\t\t\t\t\t\tname : 'www.elcorteingles.es', \n\t\t\turl : 'http://www.elcorteingles.es/', \n\t\t\ttargetFrame : '', \n\t\t\tresource : 0, \n\t\t\trecContentType : 'text/html', \n\t\t\treferer : '', \n\t\t\tsnapshot : 't1.inf', \n\t\t\tmode : 'HTML', \n\t\t\textraRes : [\n\t\t\t\t{url : '/sgfm/SGFM/assets/stylesheets/fonts/opensans-regular-webfont.woff', referer : 'http://www.elcorteingles.es/sgfm/SGFM/assets/stylesheets/crs.css'},\n\t\t\t\t{url : '/sgfm/SGFM/assets/stylesheets/fonts/opensans-bold-webfont.woff', referer : 'http://www.elcorteingles.es/sgfm/SGFM/assets/stylesheets/crs.css'},\n\t\t\t\t{url : '/sgfm/SGFM/assets/stylesheets/fonts/moonshine-font.woff', referer : 'http://www.elcorteingles.es/sgfm/SGFM/assets/stylesheets/crs.css'},\n\t\t\t\t{url : '/sgfm/SGFM/assets/javascripts/library/external/dust-helpers.min.js'},\n\t\t\t\t{url : '/sgfm/SGFM/assets/stylesheets/fonts/lato-regular-webfont.woff', referer : 'http://www.elcorteingles.es/sgfm/SGFM/assets/stylesheets/crs.css'},\n\t\t\t\t{url : '/sgfm/SGFM/assets/javascripts/library/external/dust-core.min.js'},\n\t\t\t\t{url : 'http://www.googletagmanager.com/gtm.js?id=GTM-TMQVMD'},\n\t\t\t\t{url : '/sgfm/SGFM/assets/javascripts/compiled/templates.js'},\n\t\t\t\t{url : '/sgfm/SGFM/assets/javascripts/library/external/form2js.min.js'},\n\t\t\t\t{url : '/sgfm/SGFM/assets/stylesheets/images/confianza-online-icon.svg', referer : 'http://www.elcorteingles.es/sgfm/SGFM/assets/stylesheets/crs.css'}\n\t\t\t]\n\t\t}\n\t);\n\n\treturn 0;\n}", "function FooBar() {\n // TODO: implement this module\n}", "function setEditCode(code) {\n\tlogMessage('browser load', 'module code', 'code passed to loadModule --- ' + code);\t\n\tglobals.webKitWin.bcEndpoints.loadModule(code);\n}", "onOpen () {\n // Inject any client scripts\n this.clientScripts.forEach(script => {\n this.page.injectJs(script)\n })\n }", "function exp() {\n\tconst express = require('express');\n\tconst app = express();\n\tconst port = 3000;\n\n\tapp.get('/', (req, res) => res.send('Started The bot.'));\n\tapp.listen(port, () =>\n\t\tconsole.log(`Your App is listening at https.//localhost:${port}`)\n\t);\n}", "function loadClientCode(){\n // d3 extensions\n d3.selection.prototype.moveToFront = function() {\n return this.each(function(){\n this.parentNode.appendChild(this);\n });\n };\n\n // Private helpers and utilities\n var calcAssetX = function(hex, asset){\n return hex.center().x() - (asset.width / 2.0);\n };\n\n var calcAssetY = function(hex, asset){\n return hex.center().y() - (asset.height / 2.0);\n };\n\n //Begin client-side code injection\n\n H$.HexGrid.prototype.initNewBackgroundImage = HexGrid_initNewBackgroundImage_client;\n function HexGrid_initNewBackgroundImage_client(path){\n // Generate unique id for new pattern\n var id = this.getDOMClass() + \"-bg-\" + (H$.Util.sizeof(this.patterns) + 1);\n var s = this.getHexagonSize();\n d3.select(\".\" + this.getDOMClass() + \" defs\")\n .append(\"svg:pattern\")\n .attr(\"id\", id)\n .attr(\"width\", 1)\n .attr(\"height\", 1)\n .append(\"svg:image\")\n .attr(\"xlink:href\", path)\n // Centers a square background in the hexagon\n .attr(\"x\", (H$.Util.calcR(s) - s))\n .attr(\"y\", 0)\n .attr(\"width\", s * 2)\n .attr(\"height\", s * 2);\n this.patterns[path] = id;\n return this;\n }\n\n /**\n * @param {H$.Asset} asset\n * @param {String} selectString optional param: selector to override asset.klass, ex \"#id\"\n * @type {Function}\n */\n H$.HexGrid.prototype.destroyDetachedAsset = HexGrid_destroyDetachedAsset;\n function HexGrid_destroyDetachedAsset(asset, selectString){\n selectString = selectString || \".\" + asset.klass;\n delete asset.animating;\n d3.selectAll(selectString).remove();\n var assets = this.detachedAssets;\n var keep = [];\n for(var i = 0; i < assets.length; i++){\n if(assets[i].klass !== asset.klass) keep.push(assets[i]);\n }\n this.detachedAssets = keep;\n return this;\n }\n\n /**\n * The move animations are designed to be as interruptable as possible; the payload\n * and asset are loaded into the destination at the beginning of the animation,\n * and a dummy asset is created and moved from the source to the destination.\n * If animations are interrupted, internal state is clean but these dummy assets\n * do not get cleaned up (they are left to sit forever, invisible, under the grid).\n * This function cleans these up.\n */\n H$.HexGrid.prototype.interruptAnimations = HexGrid_interruptAnimations;\n function HexGrid_interruptAnimations(){\n\n // slice to copy array to avoid concurrent modification issues\n var rogue = this.detachedAssets.slice(0);\n for(var i = 0; i < rogue.length; i++){\n if(rogue[i].animating){\n this.destroyDetachedAsset(rogue[i]);\n }\n }\n return this;\n }\n\n /**\n * Note: this is not compatible with the array-of-payloads\n * generated by pushPayload\n */\n H$.Hexagon.prototype.detachDrawnAsset = Hexagon_detachDrawnAsset;\n function Hexagon_detachDrawnAsset(){\n var assetClass = this.getHexClass() + H$.Asset.CSS_SUFFIX;\n var newClass = assetClass + \"-detached-\" + Date.now();\n d3.select(\".\" + assetClass)\n .attr(\"class\", newClass);\n var asset = this.payload.getAsset();\n this.payload.setAsset(null);\n asset.klass = newClass;\n this.grid.detachedAssets.push(asset);\n return asset;\n }\n\n H$.Hexagon.prototype.reattachAsset = Hexagon_reattachAsset;\n function Hexagon_reattachAsset(asset){\n var assetClass = this.getHexClass() + H$.Asset.CSS_SUFFIX;\n d3.select(\".\" + asset.klass)\n .attr(\"class\", assetClass);\n var i = this.grid.detachedAssets.indexOf(asset);\n this.grid.detachedAssets.splice(i, 1);\n delete asset.klass;\n delete asset.animating;\n this.payload.setAsset(asset);\n return this;\n }\n\n // Private helper\n function drawAsset(hex, asset, i){\n var assetClass = hex.getHexClass() + H$.Asset.CSS_SUFFIX;\n if(i) assetClass += \"-\" + i;\n\n d3.select(\".\" + assetClass).remove();\n if(asset != null){\n d3.select(\".\" + hex.getGridClass()).append(\"svg:image\")\n .attr(\"class\", assetClass)\n .attr(\"xlink:href\", asset.path)\n .attr(\"width\", asset.width)\n .attr(\"height\", asset.height)\n .attr(\"x\", calcAssetX(hex, asset))\n .attr(\"y\", calcAssetY(hex, asset));\n }\n }\n\n /**\n * Render the background, the highlight, and the asset.\n * The highlightOver attribute determines whether the highlight\n * or the asset is rendered first.\n */\n H$.Hexagon.prototype.draw = Hexagon_draw;\n function Hexagon_draw(){\n var highlightClass = this.getHexClass() + \"-highlight\";\n d3.select(\".\" + this.getHexClass()).remove();\n d3.select(\".\" + highlightClass).remove();\n\n // Render background\n var bg = this.fill || \"none\";\n renderHex(this, this.getHexClass(), \"black\", bg);\n\n // Render under-asset highlight, if any\n if(this.highlight && !this.highlightOver){\n renderHex(this, highlightClass, this.highlight, this.highlight)\n .style(\"fill-opacity\", this.highlightOpacity);\n }\n\n // Render asset\n if(Array.isArray(this.payload)){\n // TODO: render array of payloads intelligently\n throw \"array of payloads not yet implemented\"\n } else {\n drawAsset(this, this.payload.asset);\n }\n\n // Re-render all detached assets, in case any have been overwritten by this hex\n this.grid.drawDetachedAssets();\n\n // Render over-asset highlight, if any\n if(this.highlight && this.highlightOver){\n renderHex(this, highlightClass, this.highlight, this.highlight)\n .style(\"fill-opacity\", this.highlightOpacity);\n }\n\n function renderHex(context, klass, stroke, fill){\n return d3.select(\".\" + context.getGridClass()).append(\"svg:polygon\")\n .attr(\"class\", klass)\n .attr(\"points\", context.vertices().join(\" \"))\n .style(\"stroke\", stroke)\n .style(\"fill\", fill);\n }\n\n return this;\n }\n\n H$.Hexagon.prototype.undraw = Hexagon_undraw;\n function Hexagon_undraw(){\n d3.select(\".\" + this.getHexClass()).remove();\n d3.select(\".\" + this.getHexClass() + H$.Asset.CSS_SUFFIX).remove();\n }\n\n /**\n * This is also not yet compatible with arrays of payloads.\n */\n H$.Hexagon.prototype.movePayload = Hexagon_movePayload;\n function Hexagon_movePayload(targetHex, options){\n return this.movePayloadAlongPath([targetHex], options);\n }\n\n /**\n * Available options (all have defaults):\n * duration: {Number} total duration of the animation. Default: DEFAULT_ANIMATION_DURATION\n * easing: {String} animation easing function. DEFAULT: \"cubic-in-out\" (slow in, slow out)\n * callback: {Function} function to call when animation finishes. Default: none\n * @type {Function}\n */\n var global_start = 1;\n var global_end = 1;\n H$.Hexagon.prototype.movePayloadAlongPath = Hexagon_movePayloadAlongPath;\n function Hexagon_movePayloadAlongPath(path, options){\n options = options || {};\n var duration = options[\"duration\"] || H$.Asset.DEFAULT_ANIMATION_DURATION;\n duration /= path.length;\n\n var grid = this.grid;\n var targetHex = path[path.length - 1];\n\n var highlight = {\n color: this.highlight,\n opacity: this.highlightOpacity,\n over: this.highlightOver \n };\n this.clearHighlight().draw();\n\n var asset = this.detachDrawnAsset();\n asset.animating = true;\n var assetCopy = new H$.Asset(asset.path, asset.width, asset.height);\n targetHex.setPayload(this.popPayload());\n targetHex.payload.setAsset(assetCopy);\n\n animate(0);\n return targetHex;\n\n function animate(i){\n var nextHex = path[i];\n d3.select(\".\" + asset.klass)\n .moveToFront()\n .transition()\n .duration(duration)\n .attr(\"x\", calcAssetX(nextHex, asset))\n .attr(\"y\", calcAssetY(nextHex, asset))\n .each(\"end\", function(){\n if(i === path.length - 1){\n grid.destroyDetachedAsset(asset);\n targetHex.setHighlight(highlight.color, highlight.opacity, highlight.over).draw();\n if(options[\"callback\"]) options[\"callback\"](targetHex);\n } else {\n animate(i + 1);\n }\n });\n }\n\n }\n\n /**\n * Available options (all have defaults):\n * color: {String} color of the line. Default: black\n * length: {Number|String} length of the line. Default: 100%\n * Number: pixels,\n * String: percentage of distance to target.\n * width: {Number} width of line. Default: 1px\n *\n * animate: {Boolean} whether to animate the line. Default: false.\n * Other options require animated=true:\n * iterations: {Number} number of lines to \"fire\" Default: 1\n * translate: {Boolean} whether to stretch or translate the line. Default: false\n * easing: {String} d3 animation easing function. Default: \"linear\".\n * duration: {Number} total duration of the animation. Default: DEFAULT_ANIMATION_DURATION\n * callback: {Function} function to call when animation finishes. Default: none\n * destroy: {Boolean} remove the line after the animation. Default: false\n * miss: {Boolean} land near the target hex but missing the center slightly. Default: false\n * @type {Function}\n */\n H$.Hexagon.prototype.drawLineTo = Hexagon_drawLineTo;\n function Hexagon_drawLineTo(targetHex, options){\n var startHex = this;\n var grid = this.grid;\n var start = this.center();\n var target = targetHex.center();\n\n // Move the target one hex size in a random direction perpendicular to the approach\n if(options[\"miss\"]){\n var vector = target.subtract(start);\n vector = vector.scale(1 / vector.magnitude());\n var whichSide = Math.round(Math.random());\n if(whichSide){\n vector = new H$.Point(- vector.y(), vector.x());\n } else {\n vector = new H$.Point(vector.y(), - vector.x());\n }\n vector = vector.scale(targetHex.size());\n target = target.add(vector);\n }\n var startToTarget = target.subtract(start);\n\n var lineVector;\n var len = options[\"length\"];\n if(len){\n if(typeof len === \"string\"){\n var frac = parseInt(len) / 100;\n lineVector = startToTarget.scale(frac);\n } else {\n lineVector = startToTarget.scale(len / startToTarget.magnitude());\n }\n } else {\n lineVector = startToTarget;\n }\n var end = start.add(lineVector);\n\n var klass = this.getHexClass() + \"-line\";\n var asset = new H$.Asset();\n asset.klass = klass;\n var uniqueId = \"line\" + Date.now();\n\n var width = options[\"width\"] || 1;\n var color = options[\"color\"] || \"black\";\n d3.select(\".\" + this.getGridClass()).append(\"svg:line\")\n .attr(\"class\", klass)\n .attr(\"id\", uniqueId)\n .attr(\"x1\", start.x()).attr(\"y1\", start.y())\n .attr(\"x2\", end.x()).attr(\"y2\", end.y())\n .style(\"stroke\", color)\n .style(\"stroke-width\", width);\n\n if(options[\"animate\"]){\n asset.animating = true;\n grid.detachedAssets.push(asset);\n\n var iterations = options[\"iterations\"] || 1;\n var easing = options[\"easing\"] || \"linear\";\n var translate = options[\"translate\"] || false;\n var duration = options[\"duration\"] || H$.Asset.DEFAULT_ANIMATION_DURATION;\n var callback = options[\"callback\"] || null;\n var destroy = options[\"destroy\"] || false;\n\n var startWillTravel;\n if(translate){\n startWillTravel = start.add(startToTarget.subtract(lineVector));\n } else {\n startWillTravel = start;\n }\n\n d3.select(\"#\" + uniqueId)\n .transition()\n .ease(easing)\n .duration(duration)\n .attr(\"x1\", startWillTravel.x()).attr(\"y1\", startWillTravel.y())\n .attr(\"x2\", target.x()).attr(\"y2\", target.y())\n .each(\"end\", function(){\n\n // is flag has been disabled, stop\n if(!asset.animating) return;\n if(destroy){\n grid.destroyDetachedAsset(asset, \"#\" + uniqueId);\n } else {\n asset.animating = false;\n }\n if(iterations > 1){\n options.iterations = iterations - 1;\n startHex.drawLineTo(targetHex, options);\n } else {\n if(callback) callback(targetHex);\n }\n });\n\n } else {\n grid.detachedAssets.push(asset);\n }\n\n return targetHex;\n }\n\n }", "clientDynamicModules() {\n return {\n name: 'constants.js',\n content: `export const sidebar = ${JSON.stringify(sidebar(ctx.sourceDir))}`,\n }\n }", "function _____SHARED_functions_____(){}", "function Js(e){return(Js=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e})(e)}", "function init(){\n console.log(\"js is connected\")\n}" ]
[ "0.5637077", "0.5629852", "0.5554947", "0.5504847", "0.5489356", "0.5489356", "0.5489356", "0.5489356", "0.5489356", "0.5489356", "0.54746765", "0.54699135", "0.54481375", "0.54475206", "0.54434663", "0.5411888", "0.5411888", "0.5407574", "0.540615", "0.5405467", "0.5398997", "0.5398997", "0.536244", "0.5353043", "0.5288137", "0.5258639", "0.5240873", "0.523955", "0.5229215", "0.522338", "0.52163565", "0.5214357", "0.5205092", "0.51895314", "0.51861584", "0.5173337", "0.5159155", "0.514759", "0.513136", "0.51274794", "0.5126579", "0.5119646", "0.5091699", "0.50832015", "0.5077107", "0.50697005", "0.50548357", "0.50545615", "0.5050266", "0.5050076", "0.50500244", "0.5040806", "0.5040558", "0.5015448", "0.5015212", "0.5014003", "0.50087255", "0.5001998", "0.49992234", "0.4994415", "0.49943742", "0.4993201", "0.49907446", "0.49902558", "0.49889183", "0.4987488", "0.49856424", "0.4981123", "0.49789694", "0.49732915", "0.49658328", "0.49614698", "0.49608126", "0.49596602", "0.49557206", "0.49524456", "0.49452773", "0.4942577", "0.49393445", "0.49386254", "0.4931327", "0.49255967", "0.49251655", "0.492156", "0.49185798", "0.49182048", "0.4916328", "0.49158776", "0.49085358", "0.49012515", "0.48916957", "0.48807755", "0.4878031", "0.4876448", "0.48717806", "0.48675075", "0.4861994", "0.4859217", "0.48562744", "0.485113", "0.4850773" ]
0.0
-1
0. Scale the joint position data to fit the screen 1. Move it to the center of the screen 2. Flip the xvalue to mirror 3. Return it as an object literal
function scaleJoint(joint) { return { x: (-joint.cameraX * SCL) + width / 2, y: (joint.cameraY * SCL) + height / 2, z: (joint.cameraZ * SCL), } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scaleJoint(joint) {\n return {\n x: (joint.cameraX * width / 2) + width / 2,\n y: (-joint.cameraY * width / 2) + height / 2,\n z: joint.cameraZ * 100\n }\n}", "function scaleJoint(joint) {\n return {\n x: (joint.cameraX * width / 2) + width / 2,\n y: (-joint.cameraY * width / 2) + height / 2,\n }\n}", "translate(pose) {\n var scale = this.size / this.turtlesim_size;\n return {\n x: pose.x * scale,\n y: this.size - (pose.y * scale)\n };\n }", "function getPos(joint) {\n return createVector(joint.cameraX*width/4, -joint.cameraY*width/4, joint.cameraZ*100);\n}", "adjustPosition() {\n //this.geometry.applyMatrix( new THREE.Matrix4().makeTranslation( -(this.width / 2), 0, -(this.height / 2)) );\n this.geometry.translate(-(this.width / 2), 0, -(this.height / 2));\n }", "function canonicalTransform(data) { \n var result = {};\n result.x = data.x * getScaleFactor() - Globals.translation.x * getScaleFactor();\n result.y = swapYpos(data.y, false) * getScaleFactor() + Globals.translation.y * getScaleFactor();\n return result;\n}", "function changeToAxial() {\r\n\tobj_array.forEach(e => {\r\n\t\t// e.position.y = 0;\r\n\t\te.position.x = 0;\r\n\t\te.position.z = 0;\r\n\t});\r\n}", "function getPos(joint) {\n return createVector((joint.cameraX * width/2) + width/2, (-joint.cameraY * width/2) + height/2);\n}", "transformCoords(x: number, y: number) {\n return {\n x: (x * this.im.scale) + this.im.position.x,\n y: (y * this.im.scale) + this.im.position.y,\n };\n }", "normalizeCoords(x: number, y: number) {\n return {\n x: (x - this.im.position.x) / this.im.scale,\n y: (y - this.im.position.y) / this.im.scale,\n };\n }", "@autobind\n toScreenPosition(vec) {\n var targetVec = this.mesh.localToWorld(vec.clone());\n targetVec.project( this.camera );\n targetVec.x = (( targetVec.x ) * (this.windowWidth*0.5)) + (this.windowWidth * 0.5) ;\n targetVec.y = (( targetVec.y * -1 ) * (this.windowHeight*0.5)) + (this.windowHeight * 0.5) ;\n return targetVec;\n }", "function getPos(joint) {\n return createVector((joint.z * xscl) + xshift, (joint.x * yscl) + yshift);\n}", "screenToWorld(x, y) {\n if (y === undefined) {\n y = x.y;\n x = x.x;\n }\n\n let M = this.ctx.getTransform().invertSelf();\n\n let ret = {\n x: x * M.a + y * M.c + M.e,\n y: x * M.b + y * M.d + M.f,\n };\n\n return ret;\n }", "function Origin(){\n this.x = midWidth;\n this.y = midHeight;\n}", "head(){\n if(this.keypoints['nose'] && this.headCenter && this.shoulderCenter){\n var x = this.keypoints['nose'].x;\n var y = this.keypoints['nose'].y;\n // get nose relative points from origin\n x = (this.headCenter.x - x)/(this.distance/15);\n y = this.shoulderCenter.y - y;\n // normalize (i.e. scale it)\n y = this.map(y,this.distance*1.5,this.distance*2.8,-2,2);\n // console.log(140/this.distance,260/this.distance);\n this.joints.update('head', { x, y });\n return { x, y };\n }\n }", "function readPosition(data){\nposition=data.val();\nconsole.log(position.x);\nhypnoticBall.x=position.x;\nhypnoticBall.y=position.y;\n}", "function integerSnapTranslate() {\n let transX = mouseX;\n let transY = mouseY;\n\n if (document.getElementById(\"intSnap\").checked) {\n // perform translation\n transX = Math.round(transX / gridSpacing) * gridSpacing;\n // -1 flips y direction so that positive y values are above origin\n transY = Math.round(transY / gridSpacing) * gridSpacing;\n }\n\n return {\n x: transX,\n y: transY\n };\n}", "screenToWorld(x, y) {\r\n\t\tconst dpr = window.devicePixelRatio || 1;\r\n\t \treturn {\r\n\t\t\tx:(x - this._canvas.width / dpr / 2) / this.zoom + this.posX,\r\n\t\t\tz:(y - this._canvas.height / dpr / 2) / this.zoom + this.posZ\r\n\t\t};\r\n\t}", "update(x, y){\n if(this.mouseJoint !== null){\n // Always convert to world coordinates!\n var mouseWorld = scaleToWorld(x, y);\n this.mouseJoint.SetTarget(mouseWorld);\n };\n }", "function ReSet(){\n\ttransform.position.x = ((tempLon * 20037508.34 / 180)/100)-iniRef.x;\n\ttransform.position.z = System.Math.Log(System.Math.Tan((90 + tempLat) * System.Math.PI / 360)) / (System.Math.PI / 180);\n\ttransform.position.z = ((transform.position.z * 20037508.34 / 180)/100)-iniRef.z; \n\tcam.position.x = ((tempLon * 20037508.34 / 180)/100)-iniRef.x;\n\tcam.position.z = System.Math.Log(System.Math.Tan((90 + tempLat) * System.Math.PI / 360)) / (System.Math.PI / 180);\n\tcam.position.z = ((cam.position.z * 20037508.34 / 180)/100)-iniRef.z; \n}", "set x(value) {\n var _a, _b;\n // value = Math.round(value);\n this._x = value;\n this.position.x = value;\n (_b = (_a = this.entity) === null || _a === void 0 ? void 0 : _a.gameObject) === null || _b === void 0 ? void 0 : _b.setPosition(value, this.y);\n }", "function valuesFromMotion(e) {\n x = e.gamma\n y = e.beta\n\n // Swap x and y in Landscape orientation\n if (Math.abs(window.orientation) === 90) {\n var a = x;\n x = y;\n y = a;\n }\n\n // Invert x and y in upsidedown orientations\n if (window.orientation < 0) {\n x = -x;\n y = -y;\n }\n\n motionStartX = (motionStartX == null) ? x : motionStartX\n motionStartY = (motionStartY == null) ? y : motionStartY\n\n return {\n x: x - motionStartX,\n y: y - motionStartY\n }\n }", "get position() {\n return this._boundingBox.topLeft.rotate(this.rotation, this.pivot);\n }", "translate(offsetX, offsetY) {\n let newPosX = this.position.x + offsetX;\n let newPosY = this.position.y + offsetY;\n\n if (newPosX - this.maxDimension > this.screenWidth) {\n newPosX = 0;\n }\n if (newPosY - this.maxDimension > this.screenHeight) {\n newPosY = 0;\n }\n this.position = { x: newPosX, y: newPosY };\n }", "resetPos() {\r\n this.pos.x = width/2;\r\n this.pos.y = height/2;\r\n }", "updateValues() {\n this.s = Math.cos(this.theta / 2);\n let angle = Math.sin(this.theta / 2);\n this.a.normalize();\n this.x = this.a.x * angle;\n this.y = this.a.y * angle;\n this.z = this.a.z * angle;\n this.updateMatrix();\n }", "update(){ // call to update transforms\n dirty = false;\n m[3] = m[0] = scale;\n m[1] = m[2] = 0;\n m[4] = pos.x;\n m[5] = pos.y;\n if(useConstraint){\n this.constrain();\n }\n this.invScale = 1 / scale;\n // calculate the inverse transformation\n let cross = m[0] * m[3] - m[1] * m[2];\n im[0] = m[3] / cross;\n im[1] = -m[1] / cross;\n im[2] = -m[2] / cross;\n im[3] = m[0] / cross;\n }", "get normalized() {\n const [Q1, { x: Qx2, y: Qy2 }, { x: Qx, y: Qy }] = [\n { x: 0 + ((2 / 3) * (1 - 0)), y: 2 + ((2 / 3) * (0 - 2)) },\n { x: 2 + ((2 / 3) * (1 - 2)), y: 2 + ((2 / 3) * (0 - 2)) },\n { x: 2, y: 2 },\n ] // = commands.Q.normalized.points.slice(0, 3)\n const T1x2 = 4 > Qx ? 4 + (Qx - (4 - Qx2)) : 4 - (Qx - (4 - Qx2))\n const T1y2 = 2 > Qy ? 2 + (Qy - (4 - Qy2)) : 2 - (Qy - (4 - Qy2))\n const T2x2 = 6 + (4 - (8 - T1x2))\n const T2y2 = 2 - (2 - (4 - T1y2))\n\n return {\n points: [\n Q1, { x: Qx2, y: Qy2 }, { x: Qx, y: Qy },\n { x: 4 - Qx2, y: 4 - Qy2 }, { x: T1x2, y: T1y2 }, { x: 4, y: 2 },\n { x: 8 - T1x2, y: 4 - T1y2 }, { x: T2x2, y: T2y2 }, { x: 6, y: 2 },\n { x: 6, y: 2 }, { x: 0, y: 2 }, { x: 0, y: 2 },\n ],\n type: 'C',\n }\n }", "function origin2Physics(point){ return [point[0] + Globals.origin[0], point[1] + Globals.origin[1]]; }", "function set_position(name, x, y) {\r\n let obj, objx, objy;\r\n obj = \"#\" + selected;\r\n\r\n x = parseFloat(x);\r\n y = parseFloat(y);\r\n\r\n x += xvb;\r\n y += yvb;\r\n\r\n\r\n\r\n if ($(name).attr(\"class\") != \"light\") {\r\n //getting the letiables\r\n obj = \"#\" + selected;\r\n objx = parseFloat($(obj).attr(\"x\"));\r\n objy = parseFloat($(obj).attr(\"y\"));\r\n\r\n x = parseFloat(x);\r\n y = parseFloat(y);\r\n\r\n xdif = fx - firstx;\r\n ydif = fy - firsty;\r\n\r\n x += xdif;\r\n y += ydif;\r\n\r\n //x -= parseFloat($(obj).attr(\"width\"));\r\n //y -= parseFloat($(obj).attr(\"height\"));\r\n if (snap) {\r\n x = Math.floor(x / 80) * 80;\r\n y = Math.floor(y / 80) * 80;\r\n }\r\n //setting the new positions\r\n $(obj).attr(\"x\", (x).toString());\r\n $(obj).attr(\"y\", (y).toString());\r\n } else {\r\n //for circles\r\n //getting the letiables\r\n obj = \"#\" + selected;\r\n objx = parseFloat($(obj).attr(\"cx\"));\r\n objy = parseFloat($(obj).attr(\"cy\"));\r\n\r\n x = parseFloat(x);\r\n y = parseFloat(y);\r\n\r\n xdif = fx - firstx;\r\n ydif = fy - firsty;\r\n\r\n x += xdif;\r\n y += ydif;\r\n\r\n //x -= parseFloat($(obj).attr(\"width\"));\r\n //y -= parseFloat($(obj).attr(\"height\"));\r\n if (snap) {\r\n x = Math.floor(x / 80) * 80 + 40;\r\n y = Math.floor(y / 80) * 80 + 40;\r\n }\r\n //setting the new positions\r\n $(obj).attr(\"cx\", (x).toString());\r\n $(obj).attr(\"cy\", (y).toString());\r\n }\r\n}", "function updatePosition() {\r\n\t\t\tcircle.attr('transform', `translate(${point.x * graph.cell_size + graph.offset.x} ${point.y * graph.cell_size + graph.offset.y})`);\r\n\t\t}", "function moveToOrigin() {\n if (visible) {\n ctx.translate(-((width / 2) - x(viewCenter.x)), -(-y(viewCenter.y) + (height / 2)));\n }\n }", "function updateScreen() {\r\n if (isGameOver) return ;\r\n\r\n updateGhostPosition()\r\n updateBulletPosition()\r\n updateVerticalPlatformPosition()\r\n\r\n // Transform the player\r\n if (flipPlayer==motionType.LEFT){\r\n player.node.setAttribute(\"transform\", \"translate(\" + player.position.x + \",\" + player.position.y + \")\" + \"translate(\" + PLAYER_SIZE.w + \", 0) scale(-1, 1)\");\r\n }\r\n else\r\n player.node.setAttribute(\"transform\", \"translate(\" + player.position.x + \",\" + player.position.y + \")\");\r\n \r\n // ghost\r\n for (var i=0; i<ghost_count; i++){\r\n if (ghost[i]){\r\n if (ghost[i].motion == motionType.LEFT){\r\n ghost[i].svgObject.setAttribute(\"transform\", \"translate(\" + ghost[i].position.x + \",\" + ghost[i].position.y + \")\" + \"translate(\" + GHOST_SIZE.w + \", 0) scale(-1, 1)\"); \r\n }\r\n else\r\n ghost[i].svgObject.setAttribute(\"transform\", \"translate(\" + ghost[i].position.x + \",\" + ghost[i].position.y + \")\"); \r\n }\r\n }\r\n\r\n //bullet\r\n for (var i=0; i<8-bullet_count; i++){\r\n if (bullet[i]){\r\n if (bullet[i].motion==motionType.RIGHT)\r\n bullet[i].svgObject.setAttribute(\"transform\", \"translate(\" + bullet[i].position.x + \",\" + bullet[i].position.y + \")\" + \"translate(\" + 10 + \", 0) scale(-1, 1)\"); \r\n else\r\n bullet[i].svgObject.setAttribute(\"transform\", \"translate(\" + bullet[i].position.x + \",\" + bullet[i].position.y + \")\"); \r\n } \r\n }\r\n // Calculate the scaling and translation factors\t\r\n \r\n // Add your code here\r\n \r\n}", "position() {\n return VrMath.getTranslation(this.headMatrix);\n }", "function getRealPosition( index ) {\n var stage = app.getDrawStage();\n return { 'x': stage.offset().x + index.x / stage.scale().x,\n 'y': stage.offset().y + index.y / stage.scale().y };\n }", "function toScreen( position, camera, jqdiv ) {\n\n var pos = position.clone(); \n projScreenMat = new THREE.Matrix4();\n projScreenMat.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );\n pos.applyProjection(projScreenMat);\n\n return { x: ( pos.x + 1 ) * jqdiv.width() / 2 ,\n y: ( pos.y + 1 ) * jqdiv.height()/ 2 };\n\n // return pos;\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 }", "setpos(x, y) {\n let disX = x - this.w / 2;\n let disY = y - this.h / 2;\n if (disX < 0)\n disX = 0;\n else if (disX > canvas.width - this.w)\n disX = canvas.width - this.w;\n if (disY < 0)\n disY = 0;\n else if (disY > canvas.height - this.w)\n disY = canvas.height - this.w;\n this.x = disX;\n this.y = disY;\n }", "function transformClickCoordinates(x, y) {\n\tvar canvas = $('#guide_canvas');\n\tvar scale = 1050 / canvas.width();\n\tvar x = (x - canvas.offset().left) * scale * canvasScale;\n\tvar y = (y - canvas.offset().top) * scale * canvasScale;\n\t\n\tif(band.flip) {\n\t\tx = 1050 * canvasScale - x;\n\t\ty = 510 * canvasScale - y;\n\t}\n\t//console.log(x, y);\n\n\treturn { x: x, y: y };\n}", "function msg_float(v){\r\n\tif(inlet == 3) position.x = v;\r\n\tif(inlet == 4) position.y = v;\r\n\tif(inlet == 5) position.z = v;\r\n\tif(inlet == 6) rotation.x = v;\r\n\tif(inlet == 7) rotation.y = v;\r\n\tif(inlet == 8) rotation.z = v;\r\n}", "position() {\n // p5.Vector.fromAngle() makes a new 2D vector from an angle\n // millis returns the number of milliseconds since starting the sketch when setup() is called)\n let formula = p5.Vector.fromAngle(millis() / this.millisDivider, this.length);\n translate(formula);\n }", "onConnect() {\n if (this.startCoord)\n this.handler.coord.copy(this.startCoord);\n else {\n let ssCoord = Handler.ScreenSizeCoord;\n let width = (this.sizer.width) ? this.sizer.width : Math.round(ssCoord.width / 3);\n let height = (this.sizer.height) ? this.sizer.height : Math.round(ssCoord.height / 3);\n let x = Math.round((ssCoord.width - width) / 2);\n let y = Math.round((ssCoord.height - height) / 2);\n this.coord.assign(x, y, width, height, 0, 0, ssCoord.width, ssCoord.height);\n }\n }", "worldToScreen(x, y) {\n if (y === undefined) {\n y = x.y;\n x = x.x;\n }\n\n let M = this.ctx.getTransform();\n\n let ret = {\n x: x * M.a + y * M.c + M.e,\n y: x * M.b + y * M.d + M.f,\n };\n\n return ret;\n }", "setTranslate(x,y,z){\n let e = this.elements;\n e[0] = 1; e[4] = 0; e[8] = 0; e[12] = x;\n e[1] = 0; e[5] = 1; e[9] = 0; e[13] = y;\n e[2] = 0; e[6] = 0; e[10] = 1; e[14] = z;\n e[3] = 0; e[7] = 0; e[11] = 0; e[15] = 1;\n return this;\n }", "update () {\n this.position = [this.x, this.y];\n }", "get rel() {\n\tvar rev;\n\tvar xy;\n\t\n\trev = this._get_ac_rev();\n\txy = _pnt_transform(this.orig.x, this.orig.y, rev);\n\n\treturn {x: xy[0], y: xy[1]};\n }", "get position() {\n\t\t\treturn {x: this.x, y: this.y};\n\t\t}", "moveParticle() {\n if (this.x < 0 || this.x > window.innerWidth) this.xSpeed *= -1;\n if (this.y < 0 || this.y > window.innerHeight) this.ySpeed *= -1;\n this.x += this.xSpeed;\n this.y += this.ySpeed;\n }", "refreshFromPhysics() {\n //2D\n this.position.set(this.physicsObj.position.x,this.physicsObj.position.y);\n }", "resetPos() {\n this.x = 2 * this.rightLeft;\n this.y = 4 * this.upDown + 54;\n }", "function transformObj(position = 0, flippedUp = false) {\n var rotDelta = 0;\n if (flippedUp == true) {\n rotDelta = 180;\n }\n \n var transform = {\n posX: position*3,\n posY: 0,\n posZ: 0,\n rotX: 0,\n rotY: 180,\n rotZ: 180 - rotDelta,\n scaleX: 1,\n scaleY: 1,\n scaleZ: 1\n };\n \n return transform;\n}", "constructor(x, y) {\n this.size = windowWidth / 20;\n this.x = this.size * x;\n this.y = this.size * y;\n this.direction = this.size;\n this.nextMoveX = this.x + this.size;\n this.nextMoveY = this.y;\n this.nextDirectionX = 0;\n this.nextDirectionY = 0;\n this.nextMoveY = 0;\n }", "get true_position() { return this.position.copy().rotateX(Ribbon.LATITUDE).rotateZ(Earth.rotation).rotateZ(Ribbon.LONGITUDE); }", "rtnStartPos() {\n this.x = this.plyrSrtPosX;\n this.y = this.plyrSrtPosY;\n}", "_alignObejctToBrahmnabhi() {\r\n // CLASS REFERENCE\r\n let that = this;\r\n\r\n d3.select('[name=\"align-center\"]').on('click', () => {\r\n if (d3.select('.svg-object.active[data-object]').node() != null) {\r\n\r\n let object = d3.select('.svg-object.active[data-object]');\r\n let id = object.attr('id');\r\n let wrapper = d3.select(`.sjx-svg-wrapper[data-id=\"${id}\"]`);\r\n\r\n\r\n let objectName = object.attr('data-object');\r\n let src = object.select('image').attr('href');\r\n let width = object.select('image').attr('width');\r\n let height = object.select('image').attr('height');\r\n let x = this.centroid.x - width / 2;\r\n let y = this.centroid.y - height / 2;\r\n\r\n object.remove();\r\n wrapper.remove();\r\n\r\n // console.log(\"x\",object.select('image').attr('x'),\"y\",object.select('image').attr('x'));\r\n\r\n let data = {\r\n src: src,\r\n width: width,\r\n height: height,\r\n x: x,\r\n y: y\r\n }\r\n let objectInstance = new Object({\r\n layer: that.canvas,\r\n data: data,\r\n canvasSize: that.canvasSize,\r\n objectName: objectName,\r\n attribute: that.attribute,\r\n });\r\n\r\n // object.select('image').attr('x', `${this.centroid.x - width / 2}`);\r\n // object.select('image').attr('y',`${this.centroid.y - height / 2}`);\r\n // console.log(this.centroid.x - width / 2,this.centroid.y - height / 2);\r\n // object.attr('transform',\"\").attr('data-cx',\"\").attr('data-cy',\"\");\r\n // wrapper.attr('transform',\"\");\r\n }\r\n\r\n })\r\n }", "setWorldPosition(position, update = false){ \n let new_pos = this.getParentSpaceMatrix().getInverse().times(position)\n let pp_r_s_inv = Matrix3x3.Translation(new_pos).times(\n Matrix3x3.Rotation(this.getRotation()).times(\n Matrix3x3.Scale(this.getScale())\n )).getInverse()\n let new_a_mat = pp_r_s_inv.times(this.matrix)\n this.setPosition(new_pos, update)\n this.setAnchorShift(new Vec2(new_a_mat.m02, new_a_mat.m12))\n this.updateMatrixProperties()\n }", "getPos() {\n return {\n x : this.getX(),\n y : this.getY(),\n deg : this.getDeg(),\n scale : this.getScale(),\n turnover : this.getTurnover(),\n }\n }", "physicsSetPosition(x, y, z) {\n\n\t if(x) {\n if (typeof this.scale !== \"undefined\") {\n //y -= (this.scale * this.size.y);\n }\n\n y -= 5;\n\n this.physics_vector = new THREE.Vector3(x, y, z);\n\n this.getModel().position.set(x, y, z);\n this.position.set(x, y, z);\n } else {\n\t //this.getModel().position.set(this.position.clone());\n }\n\n }", "function tick(e) {\n this.x = this.body.GetPosition().x * SCALE;\n this.y = this.body.GetPosition().y * SCALE;\n }", "SetNormalAndPosition() {}", "function WorldToLocal(x, y, scale)\n{\n\tvar relativeX = (character.real_x - x)*scale * -1;\n\tvar relativeY = (character.real_y - y)*scale * -1;\n\t\n\treturn {x: relativeX, y: relativeY};\n}", "initPosition(){\n if(this.number == 1){\n this.x = 1;\n this.y = 1;\n }\n if(this.number == 2){\n this.x = 13;\n this.y = 1;\n }\n if(this.number == 3){\n this.x = 1;\n this.y = 13;\n }\n if(this.number == 4){\n this.x = 13;\n this.y = 13;\n }\n }", "set x(nx){\n\t\tthis.position.nx = nx;\n\t}", "function XY(x,y)\r\n{\r\n \tvar pnt = domSVG.createSVGPoint();\r\n\tpnt.x = x\r\n\tpnt.y = y\r\n\tvar sCTM = domSVG.getScreenCTM();\r\n\tvar PNT = pnt.matrixTransform(sCTM.inverse());\r\n \treturn {x:PNT.x,y:PNT.y}\r\n}", "get_position() {\r\n return {\r\n x_pos: this.sprite.x_pos,\r\n y_pos: this.sprite.y_pos\r\n };\r\n }", "get position() { return p5.prototype.createVector(0, this.height + Earth.RADIUS, 0); }", "function getPosition(_ref3) {\n var width = _ref3.width,\n height = _ref3.height;\n\n\n var x = 0;\n var y = 0;\n\n if (width) {\n if (window.outerWidth) {\n x = Math.round((window.outerWidth - width) / 2) + window.screenX;\n } else if (window.screen.width) {\n x = Math.round((window.screen.width - width) / 2);\n }\n }\n\n if (height) {\n if (window.outerHeight) {\n y = Math.round((window.outerHeight - height) / 2) + window.screenY;\n } else if (window.screen.height) {\n y = Math.round((window.screen.height - height) / 2);\n }\n }\n\n return { x: x, y: y };\n}", "function moveJointToPoint(x, y, z) {\n // Move the joint body to a new position\n jointBody.position.set(x, y, z);\n mouseConstraint.update();\n}", "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)]; }", "constructor(myleft = 0.0, mytop = 0.0, myright = 0.0, mybottom = 0.0, id = -1)\n {\n Object.defineProperty(this, 'm_dTop', {\n value: mytop,\n writable: false,\n enumerable: true,\n configurable: true,\n });\n\n Object.defineProperty(this, 'm_dRight', {\n value: myright,\n writable: false,\n enumerable: true,\n configurable: true,\n });\n\n Object.defineProperty(this, 'm_dLeft', {\n value: myleft,\n writable: false,\n enumerable: true,\n configurable: true,\n });\n\n Object.defineProperty(this, 'm_dBottom', {\n value: mybottom,\n writable: false,\n enumerable: true,\n configurable: true,\n });\n\n Object.defineProperty(this, 'm_iID', {\n value: id,\n writable: false,\n enumerable: true,\n configurable: true,\n });\n\n Object.defineProperty(this, 'm_vCenter', {\n value: new Phaser.Point((this.m_dLeft + this.m_dRight) * 0.5, (this.m_dTop + this.m_dBottom) * 0.5),\n writable: false,\n enumerable: true,\n configurable: true,\n });\n\n Object.defineProperty(this, 'm_dWidth', {\n value: Math.abs(this.m_dRight - this.m_dLeft),\n writable: false,\n enumerable: true,\n configurable: true,\n });\n\n Object.defineProperty(this, 'm_dHeight', {\n value: Math.abs(this.m_dBottom - this.m_dRight),\n writable: false,\n enumerable: true,\n configurable: true,\n });\n }", "home() {\n this.setXY(0, 0);\n this.setHeading(0);\n }", "function updateScreen() {\r\n // Transform the player\r\n player.node.setAttribute(\"transform\", \"translate(\" + player.position.x + \",\" + player.position.y + \")\");\r\n\r\n // Calculate the scaling and translation factors\r\n var scale = new Point(zoom, zoom);\r\n var translate = new Point();\r\n\r\n translate.x = SCREEN_SIZE.w / 2.0 - (player.position.x + PLAYER_SIZE.w / 2) * scale.x;\r\n if (translate.x > 0)\r\n translate.x = 0;\r\n else if (translate.x < SCREEN_SIZE.w - SCREEN_SIZE.w * scale.x)\r\n translate.x = SCREEN_SIZE.w - SCREEN_SIZE.w * scale.x;\r\n\r\n translate.y = SCREEN_SIZE.h / 2.0 - (player.position.y + PLAYER_SIZE.h / 2) * scale.y;\r\n if (translate.y > 0)\r\n translate.y = 0;\r\n else if (translate.y < SCREEN_SIZE.h - SCREEN_SIZE.h * scale.y)\r\n translate.y = SCREEN_SIZE.h - SCREEN_SIZE.h * scale.y;\r\n\r\n // Transform the game area\r\n svgdoc.getElementById(\"gamearea\").setAttribute(\"transform\", \"translate(\" + translate.x + \",\" + translate.y + \") scale(\" + scale.x + \",\" + scale.y + \")\");\r\n}", "update () {\n \tthis.modelMatrix.set();\n this.modelMatrix.scale(this.scale);\n this.modelMatrix.rotate(this.orientation);\n this.modelMatrix.translate(this.position);\n\n this.modelMatrixInverse = this.modelMatrix.clone().invert();\n }", "get position() {\n return {\n x: this.x,\n y: this.y\n };\n }", "function onManipulatorXYZChangedHandler(sender, args) {\r\n\r\n var xyzDelta = manipulatorData.getTrait(\"ManipulatorTraitXYZ\").value;\r\n var dx = xyzDelta[0];\r\n var dy = xyzDelta[1];\r\n var dz = xyzDelta[2];\r\n\r\n coreTranslate(dx, dy, dz);\r\n}", "applyInverse(){\n scale(p5.Vector.div(new p5.Vector(1,1,1), this.scale));\n angleMode(RADIANS);\n rotate(-this.rotation);\n translate(p5.Vector.sub(new p5.Vector(0,0,0), this.position));\n }", "function updatePosition(x, y) {\n queen.position.xcor = x;\n queen.position.ycor = y;\n}", "moveForward() {\n switch (this.position.heading) {\n case \"N\":\n return (this.position = { ...this.position, y: this.position.y + 1 });\n case \"E\":\n return (this.position = { ...this.position, x: this.position.x + 1 });\n case \"S\":\n return (this.position = { ...this.position, y: this.position.y - 1 });\n case \"W\":\n return (this.position = { ...this.position, x: this.position.x - 1 });\n default:\n return this.position;\n }\n }", "constructor() {\n this.x = 200;\n this.y = 200;\n this.dx = -1; // currently only moving in x plane\n this.dy = 0;\n this.r = 5; // need to change his\n this.speed = 3;\n }", "constructor() {\n this.position = {\n x: 0,\n y: 0,\n };\n }", "function toScreenPosition(obj, camera, renderer){\n var vector = new THREE.Vector3();\n\n var widthHalf = 0.5*renderer.context.canvas.width;\n var heightHalf = 0.5*renderer.context.canvas.height;\n\n obj.updateMatrixWorld();\n vector.setFromMatrixPosition(obj.matrixWorld);\n vector.project(camera);\n\n vector.x = ( vector.x * widthHalf ) + widthHalf;\n vector.y = - ( vector.y * heightHalf ) + heightHalf;\n\n return {\n x: vector.x,\n y: vector.y\n };\n}", "get position() {\n return {x: this.x, y: this.y}\n }", "ScreenToWorldX(x) {\n return (x - this.center.x + 0.5) / this.scale.px;\n }", "function canonicalTransformNT(data){\n var result = {};\n result.x = data.x * getScaleFactor();\n result.y = swapYpos(data.y, false) * getScaleFactor();\n return result;\n}", "function readPosition(data){\n // val extracts the value from the data \n position=data.val()\n hypnoticBall.x=position.x;\n hypnoticBall.y=position.y;\n}", "get modelSpaceViewerPosition$() {\n\t\treturn (this._c.mp || (this._c.mp = SpiderGL.Math.Vec4.to3(SpiderGL.Math.Mat4.col(this.modelViewMatrixInverse$, 3))));\n\t}", "function physics2Origin(point){ return [point[0] - Globals.origin[0], point[1] - Globals.origin[1]]; }", "function playerPositionChange( data ) {\n var lastq = db.player.quat\n var q = db.player._quat.set( data.qx,data.qy,data.qz,data.qw)\n var lasto = db.player.origin\n var o = db.player._origin.set( data.ox, data.oy, data.oz );\n if( q.x != lastq.x ||\n q.y != lastq.y ||\n q.z != lastq.z ||\n q.w != lastq.w\n ) {\n var a = ( q.x - lastq.x );\n var b = ( q.y - lastq.y );\n var c = ( q.z - lastq.z );\n\n if( a*a+b*b+c*c > 0.001 )\n {\n db.player.positionUpdate = true; // skip next animate update\n Voxelarium.camera.matrix.makeRotationFromQuaternion( db.player._quat );\n Voxelarium.camera.matrixWorldNeedsUpdate = true;\n }\n }\n if( o.x != lasto.x ||\n o.y != lasto.y ||\n o.z != lasto.z\n ) {\n var a = ( o.x - lasto.x );\n var b = ( o.y - lasto.y );\n var c = ( o.z - lasto.z );\n\n if( a*a+b*b+c*c > 0.001 )\n {\n db.player.positionUpdate = true; // skip next animate update\n Voxelarium.camera.position.copy( o );\n Voxelarium.camera.matrixWorldNeedsUpdate = true;\n }\n }\n //console.log( \"data : \", data);\n}", "get values() {\n return {\n x: this.x,\n y: this.y,\n scaleX: this.scaleX,\n scaleY: this.scaleY,\n rotation: this.rotation,\n opacity: this.opacity\n };\n }", "updateFireFrom(x, y) {\n if (this.fireFrom.width > 1) {\n // If size is larger than 1, center on coordinates\n Phaser.Geom.Rectangle.CenterOn(this.fireFrom, x + this.trackOffset.x, y + this.trackOffset.y);\n } else {\n this.fireFrom.x = x + this.trackOffset.x;\n this.fireFrom.y = y + this.trackOffset.y;\n }\n }", "static toPosition(array) {\n return {\n left: array[0],\n top: array[1],\n width: array[2],\n height: array[3]\n };\n }", "generateBindPoseData() {\n//-------------------\n// We need to retain TR xforms for both the bind pose and its inverse.\nthis.bindPoseTRX.copyTRX(this.globalTRX);\nthis.invBindPoseTRX.copyTRX(this.globalTRX);\nreturn this.invBindPoseTRX.setInvert();\n}", "getNcpt(joint) {\n if (this.useColorXY) {\n return [joint.colorX, joint.colorY];\n }\n else {\n var T = this.T;\n // https://stackoverflow.com/questions/47348266/color-space-to-camera-space-transformation-matrix\n var z = joint.cameraZ;\n //var ix = (T.fx*joint.cameraX + T.cx)/z;\n //var iy = (T.fy*joint.cameraY + T.cy)/z;\n //var ix = (T.fx*joint.cameraX/z + T.cx);\n //var iy = (T.fy*joint.cameraY/z + T.cy);\n //var ix = T.fx*(joint.cameraX/z + T.cx);\n //var iy = T.fy*(joint.cameraY/z + T.cy);\n //var ix = (T.fx*joint.cameraX + T.cx);\n //var iy = (T.fy*joint.cameraY + T.cy);\n var ix = (T.fx*joint.cameraX + T.cx*z)/z;\n var iy = (T.fy*joint.cameraY + T.cy*z)/z;\n return [ix/this.viewer.width, iy/this.viewer.height];\n }\n }", "updatePosition() {\n this.xOld = this.x;\n this.yOld = this.y;\n \n this.velX *= this.friction;\n this.velY *= this.friction;\n\n if (Math.abs(this.velX) > this.velMax)\n this.velX = this.velMax * Math.sign(this.velX);\n \n if (Math.abs(this.velY) > this.velMax)\n this.velY = this.velMax * Math.sign(this.velY);\n \n this.x += this.velX;\n this.y += this.velY;\n }", "applyCurrentTransform () {\n this.tempPosition.set(this.position);\n this.tempOrientation = this.orientation;\n this.tempScale.set(this.scale);\n }", "function mapPointToScreenSpace(point) {\n\tlet scale = screen_height/(2*camera.zoom);\n\treturn {x:(camera.zoom+point.x)*scale*camera.aspect,y:(camera.zoom-point.y)*scale}\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 }", "teleportToInitialPosition() {\n let coords = game.calculateCoordinatesByPosition(this.row, this.column);\n this.x = coords[0];\n this.y = coords[1];\n if (this.elem.style.display === \"none\") {\n this.elem.style.display = \"inline\";\n }\n if (!this.collisionable)\n this.collisionable = true;\n }" ]
[ "0.64083064", "0.63995034", "0.6389567", "0.60185826", "0.60147846", "0.5989663", "0.5948652", "0.5942682", "0.5913443", "0.58959705", "0.58735716", "0.5813914", "0.58093786", "0.58027977", "0.5793415", "0.575732", "0.5743842", "0.57390165", "0.57107085", "0.5709181", "0.5703964", "0.5702745", "0.5685115", "0.56478524", "0.56445366", "0.56408125", "0.56395686", "0.5633511", "0.5633402", "0.56305206", "0.562718", "0.56125957", "0.5608705", "0.5604461", "0.5597822", "0.55964553", "0.55956376", "0.5587215", "0.5584087", "0.55805707", "0.5576332", "0.5563005", "0.55571544", "0.55565506", "0.554353", "0.5519976", "0.5518134", "0.55141914", "0.5510343", "0.54940367", "0.5486087", "0.5484393", "0.5481438", "0.5480831", "0.5475141", "0.5464188", "0.54602236", "0.5459788", "0.5457852", "0.54512364", "0.54483324", "0.54448485", "0.5432684", "0.5429003", "0.54282653", "0.5426001", "0.54234505", "0.5419876", "0.5414306", "0.5414306", "0.5412773", "0.54060954", "0.54050326", "0.54019195", "0.5392586", "0.53910625", "0.53903323", "0.53894687", "0.5389394", "0.5385206", "0.538218", "0.5374747", "0.5370481", "0.5368454", "0.53657186", "0.5364072", "0.5363919", "0.536374", "0.53635895", "0.53632843", "0.53632116", "0.5358071", "0.5354154", "0.5353379", "0.5349053", "0.53470165", "0.5345783", "0.53457516", "0.5344221" ]
0.6286707
4
This function searches for anaphores in the text and forms an array with them.
function getAnaphoraCount() { text = workarea.textContent; anaphora_candidates = []; first_index = 0; last_index = 0; for(i=0; i < sentences.length-1; i++) { if(sentences[i] == "`I must.") debugger; first_word = sentences[i].match(/\S+/)[0]; check_higher_case = first_word.match(/[A-ZА-ЯЁ]/); if(check_higher_case == null) { continue; } if(first_word.match("Chapter") != null || first_word.toLowerCase() == "a" || first_word.toLowerCase() == "an" || first_word.toLowerCase() == "the") { continue; } first_index = i; last_index = first_index; for(j=i+1; j<sentences.length; j++) { if(first_word == sentences[j].match(/\S+/)[0]) { last_index = j; } else { break; } } if(last_index > first_index) { tmp = []; for(first_index; first_index <= last_index; first_index++) { tmp.push(sentences[first_index]); } anaphora_candidates.push([first_word, tmp]); i = last_index; } } flag = true; if(anaphora_candidates.length !=0) { while(flag) { control_array = []; for(i=0; i<anaphora_candidates.length; i++) { first_words = new RegExp(anaphora_candidates[i][0].replace(/\[/g, "\\[").replace(/\]/g, "\\]").replace(/\)/g, "[)]").replace(/\(/g,"[(]") + "((\\.|\\!){3}|\\.|\\?|\\!){0,1}\\s\\S+"); if(anaphora_candidates[i][1][0].match(first_words) != null) { first_words = anaphora_candidates[i][1][0].match(first_words)[0]; tmp = []; for(j=0; j < anaphora_candidates[i][1].length; j++) { if(anaphora_candidates[i][1][j].match(first_words.replace(/\[/g, "\\[").replace(/\]/g, "\\]").replace(/\)/g, "[)]").replace(/\(/g,"[(]")) != null) { tmp.push(true); } else { tmp.push(false); } } control_array.push(tmp); if(tmp.indexOf(false) == -1) { anaphora_candidates[i][0] = first_words; } } } for(i=0; i<control_array.length; i++) { if(control_array[i].indexOf(false) != -1) { control_array[i] = false; } else { control_array[i] = true; } } if(control_array.indexOf(false) != -1){ flag = false; } else { flag = true; } } flag = true; while(flag) { control_array = []; for(i=0; i<anaphora_candidates.length; i++) { first_words = new RegExp(anaphora_candidates[i][0].replace(/\[/g, "\\[").replace(/\]/g, "\\]").replace(/\)/g, "[)]").replace(/\(/g,"[(]") + "((\\.|\\!){3}|\\.|\\?|\\!){0,1}\\s\\S+"); if(anaphora_candidates[i][1][0].match(first_words) != null) { first_words = anaphora_candidates[i][1][0].match(first_words)[0]; tmp = []; for(j=0; j < anaphora_candidates[i][1].length; j++) { if(anaphora_candidates[i][1][j].match(first_words.replace(/\[/g, "\\[").replace(/\]/g, "\\]").replace(/\)/g, "[)]").replace(/\(/g,"[(]")) != null) { tmp.push(true); } else { tmp.push(false); } } control_array.push(tmp); if(tmp.indexOf(false) == -1) { anaphora_candidates[i][0] = first_words; } } } for(i=0; i<control_array.length; i++) { if(control_array[i].indexOf(false) != -1) { control_array[i] = true; } else { control_array[i] = false; } } if(control_array.indexOf(false) == -1){ flag = false; } else { flag = true; } } } temp = []; for(i=0; i<anaphora_candidates.length; i++) { anaphora_length = anaphora_candidates[i][0].split(" ").length; count = 0; for(j=0; j<anaphora_candidates[i][1].length; j++) { if(anaphora_candidates[i][1][j].split(" ").length == anaphora_length && anaphora_length < 5) { count++; } } if (count!=anaphora_candidates[i][1].length) { temp.push(anaphora_candidates[i]) } } anaphora_candidates = temp; for(i=0; i<anaphora_candidates.length; i++) { if(anaphora_candidates[i][0][anaphora_candidates[i][0].length-1] == ".") { anaphora_candidates[i][0] = anaphora_candidates[i][0].substring(0, anaphora_candidates[i][0].length-1); } } result = anaphora_candidates; return result.length }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function anagram(arrs) {\n var result = [];\n arrs.forEach((arr) => {\n // char to remove space from array\n var char = arr.replace(/\\s/g, '');\n var word = char.split('').sort().join(''); // eopr\n\n //check whether the object has the specified property\n if (!result.hasOwnProperty(word)) {\n result[word] = []; //[eopr] = []\n }\n result[word].push(char);\n });\n return result;\n}", "autoMode(text) {\n let array = [];\n let splitText = text.split(' ').filter((sub) => (sub !== ''));\n \n if (!splitText) {\n console.error('Something was wrong.');\n return;\n }\n \n while (splitText.length > 0) {\n // split every letter by the spaces x\n let brokeLine = this.autoBreak(splitText);\n \n array.push(brokeLine);\n splitText.splice(0, this.sumLetter());\n }\n \n return array;\n }", "analyze(text) {\n this.text = this.purify(text);\n this.index = 0;\n this.list = [];\n this.buffer = \"\";\n\n while (this.index < this.text.length) {\n this.state.transference(this.index, true);\n }\n return this.list;\n }", "function aORan(comps) {\n article = [];\n for (i = 0; i < comps.length; i++){\n var beg = comps[i].charAt(0);\n beg = beg.toLowerCase();\n if (beg.match(\"a|e|i|o|u|h\")) {\n article.push(\"an\");\n }else{\n article.push(\"a\");\n }\n }\n return article;\n}", "function getTextArr() {\n //TODO: pull texts from json\n\n return {\n Support: [\"Красавчик\", \"Так держать\", \"Хочешь я дам тебе миллион долларов?\"],\n Progress: [\"Хватит в игры играть\", \"Иди работай\"]\n };\n}", "function getEpiphoraCount() {\r\n text = workarea.textContent;\r\n \r\n epiphora_candidates = [];\r\n first_index = 0;\r\n last_index = 0;\r\n for(i=0; i < sentences.length-1; i++) {\r\n if(sentences[i].match(/\\S+$/) == null) {\r\n last_word = sentences[i].match(/\\S+\\s$/)[0];\r\n }\r\n else {\r\n last_word = sentences[i].match(/\\S+$/)[0];\r\n }\r\n if(last_word.match(\"said\")) {\r\n continue;\r\n }\r\n first_index = i;\r\n last_index = first_index;\r\n for(j=i+1; j<sentences.length; j++) {\r\n if(last_word == sentences[j].match(last_word.replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\*/g, \"[*]\").replace(/\\?/g,\"[?]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\"))) {\r\n last_index = j;\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n if(last_index > first_index) {\r\n tmp = [];\r\n tmp2 = [];\r\n for(first_index; first_index <= last_index; first_index++) {\r\n tmp.push(sentences[first_index]);\r\n tmp2.push(first_index);\r\n }\r\n epiphora_candidates.push([last_word, tmp, tmp2]);\r\n i = last_index;\r\n }\r\n }\r\n flag = true;\r\n if(epiphora_candidates.length != 0) {\r\n while(flag) {\r\n control_array = [];\r\n for(i=0; i<epiphora_candidates.length; i++) {\r\n last_words = new RegExp(\"\\\\S+\\\\s\" + epiphora_candidates[i][0].replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\").replace(/\\?/g,\"[?]\"));\r\n if(epiphora_candidates[i][1][0].match(last_words) != null) {\r\n last_words = epiphora_candidates[i][1][0].match(last_words)[0];\r\n tmp = [];\r\n for(j=0; j < epiphora_candidates[i][1].length; j++) {\r\n if(epiphora_candidates[i][1][j].match(last_words.replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\").replace(/\\?/g,\"[?]\")) != null) {\r\n tmp.push(true);\r\n }\r\n else {\r\n tmp.push(false);\r\n }\r\n }\r\n control_array.push(tmp);\r\n if(tmp.indexOf(false) == -1) {\r\n epiphora_candidates[i][0] = last_words;\r\n }\r\n }\r\n }\r\n for(i=0; i<control_array.length; i++) {\r\n if(control_array[i].indexOf(false) != -1) {\r\n control_array[i] = false;\r\n }\r\n else {\r\n control_array[i] = true;\r\n }\r\n }\r\n if(control_array.indexOf(false) != -1){\r\n flag = false;\r\n }\r\n else {\r\n flag = true;\r\n }\r\n }\r\n\r\n flag = true;\r\n while(flag) {\r\n control_array = [];\r\n for(i=0; i<epiphora_candidates.length; i++) {\r\n last_words = new RegExp(\"\\\\S+\\\\s\" + epiphora_candidates[i][0].replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\").replace(/\\?/g,\"[?]\"));\r\n if(epiphora_candidates[i][1][0].match(last_words) != null) {\r\n last_words = epiphora_candidates[i][1][0].match(last_words)[0];\r\n tmp = [];\r\n for(j=0; j < epiphora_candidates[i][1].length; j++) {\r\n if(epiphora_candidates[i][1][j].match(last_words.replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\").replace(/\\?/g,\"[?]\")) != null) {\r\n tmp.push(true);\r\n }\r\n else {\r\n tmp.push(false);\r\n }\r\n }\r\n control_array.push(tmp);\r\n if(tmp.indexOf(false) == -1) {\r\n epiphora_candidates[i][0] = last_words;\r\n }\r\n }\r\n }\r\n for(i=0; i<control_array.length; i++) {\r\n if(control_array[i].indexOf(false) != -1) {\r\n control_array[i] = true;\r\n }\r\n else {\r\n control_array[i] = false;\r\n }\r\n }\r\n if(control_array.indexOf(false) == -1){\r\n flag = false;\r\n }\r\n else {\r\n flag = true;\r\n }\r\n }\r\n }\r\n\r\n for(i=0; i < epiphora_candidates.length; i++) {\r\n delete epiphora_candidates[i].pop()\r\n }\r\n\r\n temp = [];\r\n for(i=0; i<epiphora_candidates.length; i++) {\r\n epiphora_length = epiphora_candidates[i][0].split(\" \").length;\r\n count = 0;\r\n for(j=0; j<epiphora_candidates[i][1].length; j++) {\r\n if(epiphora_candidates[i][1][j].split(\" \").length == epiphora_length && epiphora_length < 5) {\r\n count++;\r\n }\r\n }\r\n if (count!=epiphora_candidates[i][1].length) {\r\n temp.push(epiphora_candidates[i])\r\n }\r\n }\r\n epiphora_candidates = temp;\r\n\r\n result = epiphora_candidates;\r\n return result.length;\r\n}", "function getRandomPhraseAsArray(arr) {\n\tlet randomPhrase = phrases[Math.floor(Math.random() * phrases.length)];\n\treturn randomPhrase.split(\"\");\n}", "function getRandomPhraseAsArray(arr) {\n let i = Math.floor(Math.random() * phrases.length)\n return phrases[i].split(\"\");\n }", "function commandToArray(s_vitamin) {\n var arr=[];\n s_vitamin.split(\" \").forEach(function(item) {\n var v_shape=parseInt(item.substring(0,item.length-1));\n var c_shape=item.substring(1,2);\n arr.push([v_shape,c_shape]);\n });\n arr.sort(function(a,b){return a[0] - b[0]})\n return arr;\n}", "function getImageMatchArray() {\n var arr = [];\n fileNames.map((img) => {\n if (img.split('.')[0]) {\n arr.push(RegExp(img.replace(/_/g, ' ').split('.')[0],'i'));\n }\n });\n return arr;\n}", "function splitTextTo3DArray(textes) {\r\n\tlet textArray = textes.split(\"\\t\");\r\n\treturn textArray;\r\n}", "function text_to_array(text, array)\n{\n\tvar array = array || [], i = 0, l;\n\tfor (l = text.length % 8; i < l; ++i)\n\t\tarray.push(text.charCodeAt(i) & 0xff);\n\tfor (l = text.length; i < l;)\n\t\t// Unfortunately unless text is cast to a String object there is no shortcut for charCodeAt,\n\t\t// and if text is cast to a String object, it's considerably slower.\n\t\tarray.push(text.charCodeAt(i++) & 0xff, text.charCodeAt(i++) & 0xff, text.charCodeAt(i++) & 0xff, text.charCodeAt(i++) & 0xff,\n\t\t\ttext.charCodeAt(i++) & 0xff, text.charCodeAt(i++) & 0xff, text.charCodeAt(i++) & 0xff, text.charCodeAt(i++) & 0xff);\n\treturn array;\n}", "function funWithAnagrams(text) {\n // Write your code here\n\n if (text.length < 0) {\n return 0;\n }\n\n let sortText = {};\n let newText = [];\n\n for (let word of text) {\n let newWords = word.split('').sort().join('');\n console.log(newWords);\n\n if (!sortText[newWords]) {\n sortText[newWords] = Array(word);\n } else {\n sortText[newWords].push(word);\n }\n }\n\n for (let values in sortText) {\n let firstOccurrence = sortText[values][0];\n\n if (firstOccurrence) {\n newText.push(firstOccurrence);\n }\n }\n return newText.sort();\n}", "function getRandomPhraseAsArray(arr) {\n const randomPhraseSelection = arr[Math.floor(Math.random() * phrases.length)];\n const phraseLetters = randomPhraseSelection.split('');\n return phraseLetters;\n}", "TextToObjArray(nsText) {\n let thisNsHost = this;\n let returnArray = [];\n let sectionPattern = new RegExp(/(?:\\d+\\)(\\t(?:[^\\n]+)(?:\\n\\t[^\\n]+)+))/, \"gm\");\n let keyValPattern = new RegExp(/\\s+([\\S]+): {2}(\\\"[^\\\"]+\\\"|\\S+)/, \"gm\");\n // Loop over groups\n let matchedSection = null;\n while ((matchedSection = sectionPattern.exec(nsText)) !== null) {\n let parsedObj = {};\n // Loop over keys and values\n let matchedKeyValue = null;\n let sectionText = matchedSection[1];\n while ((matchedKeyValue = keyValPattern.exec(sectionText)) !== null) {\n parsedObj[matchedKeyValue[1]] = matchedKeyValue[2];\n }\n returnArray.push(parsedObj);\n }\n return returnArray;\n }", "function getRandomPhraseAsArray(arr) {\n const randomPhrase = arr[Math.floor(Math.random() * arr.length)];\n // showing letter of pharse and split is gaps between the words.\n return randomPhrase.toUpperCase().split('');\n}", "getCommandInfo(text) {\n let commandList = [];\n for (let command of this.CommandInfoList) {\n if (command.Aliases && command.Aliases.includes(text)) {\n commandList.push(command);\n }\n }\n\n return commandList;\n }", "function getArray (s) {\n var a = s.split('\\n')\n return a.map(v => v.split('').map(vv => {\n if (vv === '*') {\n return 1\n } else {\n return 0\n }\n }))\n}", "function wave(text){\n let finalArray = []\nfor ( let i = 0; i < text.length; i++) {\n let arr = text.split('')\n if (arr[i] === ' ') {\n continue;\n }\n arr[i] = arr[i].toUpperCase()\n\n finalArray.push(arr.join(''))\n}\n return finalArray\n}", "function parseStory(rawStory) {\n // Your code here.\n // This line is currently wrong :)\n const arrayOfWords = []\n const splittedStory = rawStory.split(\" \")\n const previewBox = document.querySelectorAll(\".previewBox\")[0];\n for (const word of splittedStory) {\n if ((/\\[n\\]/).test(word) === true) {\n arrayOfWords.push({\n word: word.replace(\"[n]\", \"\"),\n pos: \"n\"\n })\n } else if ((/\\[a\\]/).test(word) === true) {\n arrayOfWords.push({\n word: word.replace(\"[a]\", \"\"),\n pos: \"a\"\n })\n } else if ((/\\[v\\]/).test(word) === true) {\n arrayOfWords.push({\n word: word.replace(\"[v]\", \"\"),\n pos: \"v\"\n })\n } else {\n arrayOfWords.push({\n word: word\n })\n }\n }\n // console.log(arrayOfWords)\n\n return arrayOfWords\n\n}", "split(text) {\n text = text.trim();\n let separators = new Set([' ', '\\n', '\\t', '\\v']);\n let i = 0;\n let wordArray = [''];\n for (let j = 0; j < text.length; j++) {\n if (separators.has(text[j])) {\n if (wordArray[i] === \"\") {\n continue;\n } else {\n wordArray[++i] = \"\";\n }\n } else {\n wordArray[i] += text[j];\n }\n }\n let ultimaPalabra = wordArray[wordArray.length - 1];\n if (ultimaPalabra == \"\" || separators.has(ultimaPalabra[ultimaPalabra.length - 1])) {\n wordArray.pop();\n }\n return wordArray;\n }", "function createArrayFromPhrase(phrase) {\n const splitPhrase = phrase.split(' ');\n const thirdWord = splitPhrase.pop();\n return [splitPhrase.join(' '), thirdWord];\n}", "function processData(allText) {\n var people = []\n var allTextLines = allText.split(/\\r\\n|\\n/);\n\n for (var i = 1; i< allTextLines.length-1; i++){\n var tmp = allTextLines[i].split(',');\n var vote = tmp[3];\n if (vote === 'Aye'){\n vote = 'Yes'\n } else if (vote === 'Not Voting'){\n vote = 'Abstained'\n }\n var person = {\n us_state: tmp[1],\n vote: vote,\n party: tmp[5],\n name: tmp[4],\n fav:false,\n img: \"https://www.govtrack.us/static/legislator-photos/\" + tmp[0] + \"-200px.jpeg\"\n };\n people.push(person);\n console.log(person);\n\n }\n return people;\n}", "function parsePitchSequence(pitchSequenceText) {\n\n let ret = [];\n\n for (let i=0; i < pitchSequenceText.length; i++) {\n let obj = new Object;\n let c = pitchSequenceText.charAt(i);\n if (PITCH_MODIFIERS.hasOwnProperty(c)) {\n obj.modifier = c;\n c = pitchSequenceText.charAt(++i);\n }\n obj.outcome = c;\n ret.push(obj);\n }\n\n return ret;\n\n}", "function getRandomPhraseAsArray(arr) {\n const randomNumber = Math.floor(Math.random() * phrases.length + 1);\n const chosenPhrase = phrases[randomNumber].split('');\n return chosenPhrase;\n}", "function splitTextToArray(textes) {\r\n\tlet textArray = textes.split(\"\\n\");\r\n\treturn textArray;\r\n}", "function getRandomPhraseAsArray(arr){\n // Remove 1 from the array length to get the max number (inclusive)\n const length = arr.length - 1;\n // Generate a random number between 0 and length\n const choose = getRandomNumber(0, length);\n const currentPhrase = arr[choose];\n // Split the phrase into array of individual characters\n const letters = currentPhrase.split('');\n return letters;\n}", "function processText(text) {\n var displayText = \"\";\n var offset = 0;\n var start = -1;\n var positiveRanges = [];\n var negativeRanges = [];\n var marked = [];\n\n for (var i = 0; i < text.length; i++) {\n var char = text[i];\n var array = null;\n\n switch (char) {\n case Importance.POSITIVE:\n array = positiveRanges;\n break;\n case Importance.NEGATIVE:\n array = negativeRanges;\n break;\n default:\n displayText += char;\n marked.push(false);\n continue;\n }\n\n var relIndex = i - offset;\n if (start === -1) {\n start = relIndex;\n } else {\n array.push({\n start: start,\n end: relIndex\n });\n start = -1;\n }\n offset++;\n }\n\n vm.game.displayText = displayText;\n vm.game.marked = marked;\n vm.game.ranges = {\n positive: positiveRanges,\n negative: negativeRanges\n };\n }", "complete(text) {\n //@TODO\n let arrayKeys = Array.from(map2.keys());\n\n let finalArray = arrayKeys.filter(function(value){\n if(value.match(`^${text}`)){\n return value;\n }\n });\n\n return finalArray;\n }", "function getRandomPhraseAsArray(arr) {\n let arrayPosition = Math.floor(Math.random() * arr.length);\n let randomPhrase = arr[arrayPosition];\n let phraseCharacters = [];\n\n for (let i = 0; i < randomPhrase.length; i += 1) {\n phraseCharacters.push(randomPhrase[i]);\n }\n\n return phraseCharacters;\n}", "function learnAlphabet(text){\n // This just removed the newlines from the input file so they aren't rendered as part of the alphabet\n text = text.replace(/\\r?\\n?/g, '');\n var alphabet = [];\n for(var i = 0; i < text.length; i++){\n if((!alphabet.includes(text.charAt(i))) && (text.charAt(i) !== \"\\n\"))\n alphabet.push(text.charAt(i));\n }\n FINAL_ALPHABET = alphabet;\n $('#acceptedTA').val(\"Alphabet from test file: \" + alphabet);\n}", "function soloUnaVez(texto) {\n\n //Definir variables\n let contadores = {},\n resultado = [];\n letras = texto.split('').filter(letra => letra.trim().length >= 1);\n\n //Generar contadores\n for (letra of letras) {\n if (!contadores[letra]) {\n contadores[letra] = 1;\n } else {\n contadores[letra]++;\n }\n }\n\n //Eliminar las letras que se repitan\n for (letra in contadores) {\n if (contadores[letra] === 1) {\n resultado.push(letra);\n }\n }\n\n return [resultado, resultado[0]];\n}", "function getRandomPhraseAsArray(arr) {\n let randomPhrase = Math.floor(Math.random() * arr.length);\n return arr[randomPhrase].split(\"\");\n}", "async function reObjExecTextArray(reObj, textArray) {\n return Promise.all(textArray.map(item => {\n return reObjExecText(reObj, item);\n }));\n}", "function convert_terms_to_array(ont_term_list){\n ont_term_array=ont_term_list.split('\\n')\n //need to add another element to array, since there may not be a new line\n //at the end of the list\n ont_term_array.push('');\n if (ont_term_array=='')\n {\n alert(\"Input a list of terms!\")\n return;\n }\n filtered_array=new Array();\n for (var i=0;i<ont_term_array.length;i++){\n filtered_array.push(ont_term_array[i])\n/* if (ont_term_array[i]!=''){\n filtered_array.push(ont_term_array[i])\n }*/\n } \n return filtered_array;\n}", "function convert_terms_to_array(ont_term_list){\n ont_term_array=ont_term_list.split('\\n')\n //need to add another element to array, since there may not be a new line\n //at the end of the list\n ont_term_array.push('');\n if (ont_term_array=='')\n {\n alert(\"Input a list of terms!\")\n return;\n }\n filtered_array=new Array();\n for (var i=0;i<ont_term_array.length;i++){\n filtered_array.push(ont_term_array[i])\n/* if (ont_term_array[i]!=''){\n filtered_array.push(ont_term_array[i])\n }*/\n } \n return filtered_array;\n}", "function getRandomPhraseAsArray(arr) {\n let pick = Math.floor(Math.random() * arr.length);\n return phrases[pick];\n}", "function getRandomPhraseAsArray(arr) {\n let pickedPhrase = '';\n // Set random number to pick phrase\n const pickPhraseNumber = Math.floor(Math.random() * 7 );\n\n // Loop through phrase array to get phrase that is equal to random number\n for (let i = 0; i < arr.length; i++) {\n if (pickPhraseNumber === i) {\n pickedPhrase = arr[i];\n } \n }\n // Convert picked phrase into its own array and return\n const pickedPhraseArray = pickedPhrase.split(''); \n return pickedPhraseArray;\n}", "async function reObjExecText(reObj, text) {\n return new Promise((resolve, _) => {\n let matches = [];\n let match;\n while (match = reObj.exec(text)) {\n matches.push(\n {\n length: match[0].length,\n index: match.index,\n }\n );\n }\n resolve(matches);\n });\n}", "function processKeywords() {\n var nodes = [];\n var lastIndex;\n var keyword;\n var node;\n var submatch;\n\n if (!top.keywords) {\n return addText(modeBuffer, nodes);\n }\n\n lastIndex = 0;\n\n top.lexemesRe.lastIndex = 0;\n\n keyword = top.lexemesRe.exec(modeBuffer);\n\n while (keyword) {\n addText(modeBuffer.substr(lastIndex, keyword.index - lastIndex), nodes);\n\n submatch = keywordMatch(top, keyword);\n\n if (submatch) {\n relevance += submatch[1];\n\n node = build(submatch[0], []);\n\n nodes.push(node);\n\n addText(keyword[0], node.children);\n } else {\n addText(keyword[0], nodes);\n }\n\n lastIndex = top.lexemesRe.lastIndex;\n keyword = top.lexemesRe.exec(modeBuffer);\n }\n\n addText(modeBuffer.substr(lastIndex), nodes);\n\n return nodes;\n }", "function getRandomPhraseAsArray (pharses) {\n \n/*\n input: pharses is an array\n\n instruction: \n 1. randomly choose a phrase from the phrases array\n a. understand how to randomly get number\n b. choose a phrase from the phrases array\n 2. split that phrase into a new array of characters. \n\n output: The function should then return the new character array.\n */\n\n let randomNumber = getRandomNumber(pharses.length)\n let randomPhrase = pharses[randomNumber].toLowerCase()\n let splitPhrase = randomPhrase.split('');\n return splitPhrase;\n}", "function getRandomPhraseAsArray () {\n var result= phrase[Math.floor(Math.random() * phrase.length)]; \n result = result.split(\"\");\n return result;\n}", "function textToArray(text) {\n // Trim newlines at the end.\n while (text.endsWith('\\n')) {\n text = text.substring(0, text.length - 1);\n }\n \n var newArray = text.split('\\n');\n for (var i = 0; i < newArray.length; i++) {\n newArray[i] = newArray[i].split('\\t');\n }\n return newArray;\n}", "function getAnadiplosisCount() {\r\n text = workarea.textContent;\r\n search_string = \"[a-zA-Zа-яА-ЯёЁ]+[.?!;]{1,3}\\\\s[a-zA-Zа-яА-ЯёЁ]+\";\r\n middle_words = text.match(/[a-zA-Zа-яА-ЯёЁ]+[.?!;]{1,3}\\s[a-zA-Zа-яА-ЯёЁ]+/g);\r\n new_phrases = [];\r\n result = [];\r\n if(middle_words != null) {\r\n for (i=0; i < middle_words.length; i++) {\r\n phrase = middle_words[i];\r\n phrase = phrase.toLowerCase();\r\n near_space = phrase.match(/[.?!;]{1,3}\\s/)[0];\r\n phrase = phrase.split(near_space);\r\n if(phrase[0] == phrase[1]) {\r\n new_phrases.push(middle_words[i]);\r\n }\r\n }\r\n result = new_phrases;\r\n\r\n tmp = [];\r\n for(key in result) {\r\n if(tmp.indexOf(result[key]) == -1) {\r\n tmp.push(result[key]);\r\n }\r\n }\r\n result = tmp;\r\n count = 0;\r\n\r\n search_string = \"([a-zA-Zа-яА-ЯёЁ]+\\\\s){0}\" + search_string + \"(\\\\s[a-zA-Zа-яА-ЯёЁ]+){0}\";\r\n while(new_phrases.length != 0) {\r\n\r\n middle_words = [];\r\n count++;\r\n search_reg = new RegExp(\"\\\\{\"+(count-1)+\"\\\\}\", 'g');\r\n search_string = search_string.replace(search_reg, \"{\"+count+\"}\");\r\n middle_words = text.match(new RegExp(search_string,\"g\"));\r\n new_phrases = [];\r\n if(middle_words != null) {\r\n for (i=0; i < middle_words.length; i++) {\r\n phrase = middle_words[i];\r\n phrase = phrase.toLowerCase();\r\n near_space = phrase.match(/[^a-zA-Zа-яА-ЯёЁ]{1,3}\\s/)[0];\r\n phrase = phrase.split(near_space);\r\n temp = middle_words[i].split(near_space);\r\n for(j=0; j<phrase.length-1; j++) {\r\n if(phrase[j] == phrase[j+1]) {\r\n new_phrases.push(temp[j] + near_space + temp[j+1]);\r\n } \r\n }\r\n }\r\n\r\n for(key in new_phrases) {\r\n result.push(new_phrases[key]);\r\n }\r\n }\r\n\r\n }\r\n tmp = [];\r\n for(key in result) {\r\n if(tmp.indexOf(result[key]) == -1) {\r\n tmp.push(result[key]);\r\n }\r\n }\r\n result = tmp;\r\n }\r\n return result.length;\r\n}", "function parse(array){\n let result = [];\n let word = [];\n let first;\n const len = array.length;\n for (let i = 0; i < len; i++){\n let sound_ = sound(array[i]);\n if (isFirst(i, array)) word.push(array[i].toUpperCase());\n if (sound_ && sound_ !== ' ' && isDifferent(i, array, word) && !(isFirst(i, array))) word.push(sound_);\n if (isEnd(i, array)) {\n Array.prototype.push.apply(result, pad(word));\n word = [];\n }\n if (sound_ === ' ') result.push(sound_);\n }\n return result.join(''); \n}", "matches(text) {\n let i = 0;\n let max_acc;\n const matches = [];\n\n while (i < text.length) {\n // simulate on input starting at idx i\n max_acc = this.nfa.simulate(text, i);\n\n if (max_acc == null) {\n // no match, move onto next idx\n i++;\n } else {\n // extract the longest match\n matches.push(new Match(i, max_acc, text.substring(i, max_acc)));\n\n if (i == max_acc) {\n // empty match, increment, so as to move along\n i++;\n } else {\n // jump to end position of match\n i = max_acc;\n }\n }\n }\n\n return matches;\n }", "function getIgnoreKeywords_onomatopoeia_singles() {\n\t\tvar onolist = [];\n\t\t\n\t\tvar pieces = getIgnoreKeywords_onomatopoeia_singleLetter();\n\t\tvar pieceslength = pieces.length;\n\t\t\n\t\tfor(var i = 0; i < pieceslength; i++) {\n\t\t\tvar piece = pieces[i];\n\t\t\tonolist = onolist.concat(getIgnoreKeywords_onomatopoeia_singles_list({'ono':piece}));\n\t\t}\n\t\t\n\t\treturn onolist;\n\t}", "function getRandomPhraseAsArray(arr){\n const randomPhrase = arr[Math.floor(Math.random() * arr.length)];\n return randomPhrase;\n }", "function getRandomPhraseAsArray(arr) {\n var a = arr[Math.floor(Math.random() * 6)];\n const b = [];\n \n for (let i = 0; i < a.length; i++) {\n b.push(a.charAt(i));\n }\n\n return b\n}", "locateArmoredBlocks(text) {\n var beginObj = {};\n var endObj = {};\n var indentStrObj = {};\n var blocks = [];\n var i = 0;\n var b;\n\n while (\n (b = EnigmailArmor.locateArmoredBlock(\n text,\n i,\n \"\",\n beginObj,\n endObj,\n indentStrObj\n )) !== \"\"\n ) {\n blocks.push({\n begin: beginObj.value,\n end: endObj.value,\n indent: indentStrObj.value ? indentStrObj.value : \"\",\n blocktype: b,\n });\n\n i = endObj.value;\n }\n\n EnigmailLog.DEBUG(\n \"armor.jsm: locateArmorBlocks: Found \" + blocks.length + \" Blocks\\n\"\n );\n return blocks;\n }", "function getRandomPhraseAsArray(arr){\n ul.textContent = \"\";\n const randomPhrase = arr[Math.floor(Math.random()*phrases.length)];\n message = randomPhrase;\n const phraseAsArray = randomPhrase.split(\"\");\n return phraseAsArray;\n }", "function getRandomPhraseAsArray(arr) {\n const arrayLength = arr.length;\n const randomNumber = Math.floor(Math.random() * arrayLength);\n const chosenPhrase = arr[randomNumber];\n return chosenPhrase.split(\"\");\n}", "async function analyzeEntitiesOfText(array_text) {\n let result = [];\n try {\n for (let t of array_text) {\n const document = {\n content: t,\n type: \"PLAIN_TEXT\"\n };\n\n let results = await client.analyzeEntities({ document });\n\n const entities = results[0].entities;\n // console.log(\"Entities:\", JSON.stringify(entities));\n for (let entity of entities) {\n if (isPronoun(entity.name)) {\n if (\n (result[entity.name] == null) |\n (result[entity.name] == undefined)\n ) {\n result[entity.name] = { name: entity.name, salience: new Array() };\n result[entity.name].salience.push(entity.salience);\n result[entity.name].type = entity.type;\n } else {\n result[entity.name].salience.push(entity.salience);\n }\n if (entity.metadata && entity.metadata.wikipedia_url) {\n result[entity.name].wiki = entity.metadata.wikipedia_url;\n // console.log(` - Wikipedia URL: ${entity.metadata.wikipedia_url}$`);\n }\n }\n\n console.log(JSON.stringify(entity));\n }\n }\n } catch (err) {\n console.log(err);\n }\n\n return scoreAggregation(result);\n}", "function getRandomPhraseAsArray(arr) {\n return arr[Math.floor(Math.random() *arr.length)].split('');\n}", "function getRandomPhraseAsArray(phr) {\n const randomPhrase = phr[Math.floor(Math.random()*phr.length)];\n const splitRandomPhrase = randomPhrase.split(\"\");\n return splitRandomPhrase;\n}", "function Tokens(text) {\n\ttext += \" \";\n\tvar last = \"space\";\n\tvar a = [];\n\tvar w = \"\";\n\tfor (var i = 0; i < text.length; i++) {\n\t\tvar c = classify( text[i] );\n\t\tif (joined(last, c)) {\n\t\t\tw += text[i];\n\t\t} else {\n\t\t\tif (w.trim()) {\n\t\t\t\ta.push(w);\n\t\t\t}\n\t\t\tw = text[i];\n\t\t}\n\t\tlast = c;\n\t}\n\treturn a;\n}", "function getRandomPhraseAsArray(array) {\r\n const randomPhrase = array[Math.floor(Math.random() * array.length)];\r\n return randomPhrase.toUpperCase().split('');\r\n}", "function getRandomPhraseAsArray(arr) {\n let randomPhrase = arr[Math.floor(Math.random()*arr.length)];\n return randomPhrase.toString().split('');\n}", "function getRandomPhraseAsArray (arr) {\n const index = Math.floor(Math.random() * arr.length);\n const randomPhrase = arr[index].split(\"\");\n return randomPhrase;\n}", "function getRandomPhraseAsArray(arr) {\n let randomArr = arr[Math.floor(Math.random() * phrases.length)]; \n return splitArray = randomArr.split([,]);\n}", "function inspectText(body, context) {\r\n var toDisplay = [];\r\n console.log(body);\r\n var prev, pref, word;\r\n var prefix = [\"\", \"den \", \"der \", \"de \", \"van \"];\r\n var reg = /[A-Z]+[a-z\\-]*/gm;\r\n var i = 0;\r\n while (word = reg.exec(body)) {\r\n if (word == \"De\" || word == \"Van\" || word == \"Di\" || word == \"Vanden\" || word == \"Ver\") {\t\t//Di Rupo rpz\r\n pref = word;\r\n console.log(\"Prefix found: \" + pref);\r\n continue;\r\n }\r\n var name;\r\n var found = false;\r\n var iter = 0;\r\n while (!found && iter < prefix.length) {\r\n // Search for prefixes\r\n if (pref != null) {\r\n name = pref + \" \" + prefix[iter] + word;\r\n } else {\r\n name = prefix[iter] + word;\r\n }\r\n // Search for the name in the hashmap\r\n if (name in hashmap && !(name in alreadyFoundPoliticians)) {\r\n\t\t\t\t\talreadyFoundPoliticians[name] = true;\r\n found = true;\r\n var matching = [];\r\n var pol = null;\r\n // If only one politician has this name\r\n var twoNames = false;\r\n if (hashmap[name].length == 1) {\r\n pol = 0;\r\n }\r\n // If a politician has his first name cited just before his last name in the text\r\n else for (var i in hashmap[name]) {\r\n matching.push(hashmap[name][i]);\r\n if (prev == hashmap[name][i][4]) { //Matching also firstname\r\n pol = i;\r\n twoNames = true;\r\n }\r\n }\r\n var nameLength = name.length;\r\n if (twoNames) {\r\n prev += \" \";\r\n nameLength += prev.length;\r\n }\r\n else {\r\n prev = \"\";\r\n }\r\n\r\n // Only one politician\r\n if (pol != null) {\r\n display(hashmap, name, pol, context);\r\n }\r\n //Multiple policitians\r\n else {\r\n console.log(\"display multiple\");\r\n display_multiple(hashmap, name, context);\r\n }\r\n pref = null;\r\n }\r\n prev = word;\r\n iter++;\r\n }\r\n }\r\n }", "function findAcronyms() {\n// Searches text for defined acronyms by looking for text that contains capitalized letters that then are \n// repeated following the text (or that precede the text), for example: \n// \"we observed White Dwarf Stars (WDS), ...\" or \"we observed WDS (White Dwarf Stars), ....\"\n// If such are identified, the acronym is placed in a special category within the index that is not used as\n// an ordinary index word, but rather as a \"re-router\" to the words for which the acronym stands for. In the\n// index, the acronym is entered as an entry but with a type=acro, and another field that no other entry has,\n// \"acroDef\", will hold the words that the acronym takes the place of. The words are delimited by \"_\" with\n// the abbreviated paper ID in front, ie \"454|white_dwarf_star\". Every time the acronym is found in that paper,\n// the all the words in standsFor will be uodated with the location information. If the acronym is found in\n// another paper that does NOT have its own acronym entry, let's say for example that paper 334 also mentioned\n// WDS but fails to define them. If WDS has **no** alternative meaning in the xLtr, but a match is made (but\n// from the acronum of another paper), then that paper will inherit the knowledge of paper 454 and have all occurances\n// of \"WDS\" be indexed to \"white_dwarf_star\". KIf there are multiple definitions of WDS within the \"acronum\" index\n// entry and the paper fails to have its own definition, then the characters will remain un-identified. OK, the\n// function here is just to find those acronyms with their definitions ... the main program will make sense of it all! \n xLtr.push({\"type\":\"acro\", \"priority\":\"1\",\n \"indx\":function(text, startPos) {\n this.endMatch = \"-1\";\n this.startDef = \"-1\";\n this.endDef = \"-1\";\n var smallWords = ['aka','al','am','an','and','are','as','at','be','by','do','eg','et','etal','etc',\n 'go','he','ie','if','in','io','is','it','me','my','no','ok','on','or','ox','pi',\n 'qi','so','to','we','xi'];\n var linkedTo = [];\n var from = [];\n var i = 0;\n var j = 0;\n var k = 0;\n var a1 = 0;\n var a2 = 0;\n var w1 = 0;\n var w2 = 0;\n var tst = '';\n var t = '';\n var endMatch = -1;\n var acroPos1 = [];\n var wordsPos1 = [];\n var acroPos2 = [];\n var wordsPos2 = [];\n var acroPos = [];\n var wordsPos = [];\n var aPos = [];\n var wPos = [];\n var aTmp = '';\n var wTmp = '';\n var dist = [];\n var alength = [];\n var acro = '';\n var acroDef = '';\n var fullAcro = false;\n var twoWordMin = false;\n var noCherryPicking = true;\n var noSkippedWords = true;\n var caseMatch = false;\n var acroCase = false;\n var twoChars = false;\n var notShortWord = false;\n var notSymbol = false;\n var startSentence = false;\n// Strip out text starting from startPos to the location of a period, question mark, exclamation mark to the right\n// of startPos.\n var txt = text.slice(startPos);\n var tmp = txt.match(/(?:[\\.\\?\\!])(?:(?: [A-Z])|(?: $)|(?:$))/);\n if (tmp) {txt = txt.slice(0,tmp.index); }\n// filter the text, eliminating everything exept alpha-numeric and whitespace\n tmp = JSON.parse(filterTheText('Aa0 ',txt));\n txt = tmp[0];\n txtPos = tmp[1];\n// Convert text to an array of characters.\n txt = txt.split('');\n// make another array of same length as txt that assigns a word id to each letter. Any non-alphanumeric characters\n// take on the word ID of the character that is to the left of them.\n var wordIds = [];\n wordIds.push(0);\n for (i = 1; i < txt.length; i++) {\n if (txt[i-1].match(/ /) && txt[i].match(/[^ ]/)) {\n wordIds.push(wordIds[i-1]+1); // start new word\n } else {\n wordIds.push(wordIds[i-1]); } // retain same word id as prev. character\n }\n// construct an array similar to wordIds, but one that records the position where the word started rather than \n// a sequence of incrementing values\n var wordStarts = [];\n wordStarts.push(0);\n for (i = 1; i < txt.length; i++) {\n if (txt[i-1].match(/ /) && txt[i].match(/[^ ]/)) {\n wordStarts.push(i); // start new word\n } else {\n wordStarts.push(wordStarts[i-1]); } // retain same value as prev. character\n }\n for (i = 0; i < txt.length-1; i++) {\n if (txt[i].match(/[A-Za-z0-9]/)) {\n// get all the text to the right of the ith character\n tmp = txt.slice(i+1).reduce(function(x1,x2,x3) {\n// locate all the matches in the text with this ith character. At this point, the match is case-insensitive\n if (x2.match(/[A-Za-z0-9]/) && wordStarts[x3+i+1] > wordStarts[i] &&\n x2.toLowerCase() == txt.slice(i,i+1)[0].toLowerCase()) {x1.push(x3+i+1);} return x1;},[]); \n if (tmp.length > 0) {\n linkedTo.push(tmp);\n from.push(i); }\n }\n }\n// - - - - - - - - - - - - - - - - - - - - - - - -\n if (linkedTo.length == 0) {return ''; }\n// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =\n// Now map out all the possible \"paths\" by which an acronym's letters could be matched up with \n// legitimate characters from preceeding word definitions:\n for (i = 0; i < linkedTo[0].length; i++) {\n if (wordStarts[linkedTo[0][i]] == linkedTo[0][i]) {\n acroPos1.push([linkedTo[0][i]]);\n wordsPos1.push([from[0]]); }\n }\n for (i = 1; i < linkedTo.length; i++) { // step through each character in the test, from left to right\n aPos = [];\n wPos = [];\n for (j = 0; j < linkedTo[i].length; j++) {\n for (k = 0; k < acroPos1.length; k++) {\n// need to make combinations for each of these with all the acroPos that has been rolled up \n// to this point. In order to be included, the jth value in the ith linkedTo needs to meet\n// the following criteria: \n// * characters associated with the acronym must be all be associated with the same \"word\" AND occur sequentially. \n// * all definition words must have their first letter involved in the acronym (which may be upper or lowercase).\n// * if there are uppercase letters somewhere in the middle of a word, those letters must also appear the acronym\n// as well as the first character of that word.\n// * letters other than the first letter and uppercase letters within definition words are allowed so long as the\n// letter(s) to the left of them in the word are also present in the acronym.\n aTmp = acroPos1[k];\n aTmp = aTmp[aTmp.length-1];\n wTmp = wordsPos1[k];\n wTmp = wTmp[wTmp.length-1];\n if ( (wordStarts[linkedTo[i][j]] == wordStarts[aTmp] && // acronym within single word\n linkedTo[i][j] == aTmp + 1 && // sequential acronym letters\n wordStarts[from[i]] < wordStarts[aTmp] && // different location from acronym\n from[i] > wTmp) && // char in def must be right of prev char\n ((wordStarts[from[i]] == from[i]) || // first letter of a word ... or ...\n (txt.slice(from[i],from[i]+1)[0].match(/[A-Z0-9]/) && // is uppercase char or number that ...\n wordStarts[from[i]] == wordStarts[wTmp]) || // is part already-represented word ... or...\n (from[i] == wTmp + 1)) ) { // is part of sequence w/ one of the above 2 cases \n aPos.push(acroPos1[k].concat([linkedTo[i][j]]));\n wPos.push(wordsPos1[k].concat([from[i]])); }\n }\n }\n if (aPos.length > 0) {\n acroPos1 = acroPos1.concat(aPos);\n wordsPos1 = wordsPos1.concat(wPos); }\n }\n acroPos2 = [];\n wordsPos2 = [];\n for (i = 0; i < linkedTo[0].length; i++) {\n if (wordStarts[linkedTo[0][i]] == linkedTo[0][i]) {\n wordsPos2.push([linkedTo[0][i]]);\n acroPos2.push([from[0]]); }\n }\n for (i = 1; i < linkedTo.length; i++) { // step through each character in the test, from left to right\n aPos = [];\n wPos = [];\n for (j = 0; j < linkedTo[i].length; j++) {\n for (k = 0; k < acroPos2.length; k++) {\n aTmp = acroPos2[k];\n aTmp = aTmp[aTmp.length-1];\n wTmp = wordsPos2[k];\n wTmp = wTmp[wTmp.length-1];\n if ( (wordStarts[from[i]] == wordStarts[aTmp] && // acronym is one word\n from[i] == aTmp + 1 && // sequential acronym letters\n wordStarts[linkedTo[i][j]] > wordStarts[aTmp] && // different location from acronym\n linkedTo[i][j] > wTmp) && // the next char in def to right of last one\n ((wordStarts[linkedTo[i][j]] == linkedTo[i][j]) || // first letter of a word ... or ...\n (txt.slice(linkedTo[i][j],linkedTo[i][j]+1)[0].match(/[A-Z0-9]/) && // is uppercase char or number that ... \n wordStarts[linkedTo[i][j]] == wordStarts[wTmp]) || // is part of already-represented word ... or ...\n (linkedTo[i][j] == wTmp + 1))) { // is part of sequence w/ one of the above 2 cases \n aPos.push(acroPos2[k].concat([from[i]]));\n wPos.push(wordsPos2[k].concat([linkedTo[i][j]]) ); }\n }\n }\n if (aPos.length > 0) {\n acroPos2 = acroPos2.concat(aPos);\n wordsPos2 = wordsPos2.concat(wPos); }\n } \n// combine the findings from both kinds of searches\n acroPos = acroPos1.concat(acroPos2);\n wordsPos = wordsPos1.concat(wordsPos2);\n// We can immediately weed out any 1-element entries:\n acroPos = acroPos.filter(z => z.length > 1);\n wordsPos = wordsPos.filter(z => z.length > 1);\n// Now test any found matches to insure compliance with other constraints:\n// * [fullAcro] each character within the group of chars associated with the acronym must have a counterpart in the def words\n// * [twoWordMin] there must be at least 2 definition words\n// * [noCherryPicking] there cannot be any words larger than 3 letters laying between def words\n// * [noSkippedWords] there cannot be more than 3 words of length greater than 3 characters between the end of the\n// definition words and the beginning of the acro\n// * [caseMatch] If the acronym has a mixture of lower/upper case characters, then there must be an exact case match\n// to those corresponding letters in the definition words. Likewise, if the definition words has a mixture of \n// cases, then the acronym must provide an exact character-to-character case match, with the following exception:\n// if the only uppercase letter in the definition words is the very first letter (e.g., likely the beginning of\n// a sentence), and the acronym does NOT have a case-mixture, then a case-match is irrelevant. If the acronym\n// has all caps or all lowercase characters, a case-match is irrelevant so long as the definition words do \n// not have a case-mixture (disregarding the case of the first letter in the def. words). \n// * [acroCase] If the acronym has any uppercase letters, there must be more uppercase than lowercase. If the \n// acronym has only 2 characters, both must be uppercase if one of them is.\n// * [twoChars] if the acronym is only 2 letters, special precautions must be taken to insure that it is not just an ordinary\n// 2-letter word (like \"to\" or \"so\" or \"at\"). The 2-letter acronym must either consist of all consonants or \n// all vowels. Note that this constraint could likely remove viable acronyms from the index, but the risk of \n// false-positive matches is just too high to accept without imposing such rules.\n// * [notShortWord] acronym can't be among the hardwired list of common \"small words\" (like \"etc\")\n// * [notSymbol] acronym can't be mistaken for a chemical symbol (like \"Ne\" or \"He\")\n for (i = 0; i < acroPos.length; i++) {\n wTmp = wordsPos[i].map(z => txt.slice(z,z+1)[0]).join('');\n aTmp = acroPos[i].map(z => txt.slice(z,z+1)[0]).join('');\n fullAcro = false;\n twoWordMin = false;\n noCherryPicking = true;\n caseMatch = false;\n acroCase = false;\n twoChars = false;\n notShortWord = false;\n notSymbol = false;\n noSkippedWords = true;\n startSentence = false;\n// get the length of the character grouping associated with the acronym itself by finding in the word ID all matches\n// to the word ID value that the acronym characters have:\n tmp = wordIds.reduce(function(x1,x2,x3) {\n if (x2 == wordIds[acroPos[i][0]] && txt.slice(x3,x3+1)[0].match(/[A-Za-z0-9]/)) {x1.push(x2);} return x1;},[]);\n if (tmp.length == acroPos[i].length) {fullAcro = true; }\n// See if an uppercase letter exists in the original text just before or just after the identified acro. If so, and it was skipped\n// over, then fullAcro gets turned back to false:\n if (startPos > 0 && text.charAt(txtPos[acroPos[i]]).match(/[A-Z]/)) {fullAcro = false; }\n if (startPos < text.length-1 && text.charAt(txtPos[Math.max(... acroPos[i])]).match(/[A-Z]/)) {fullAcro = false; }\n// get a list of all the word IDs associated with the definition words:\n tmp = wordsPos[i].map(z => wordIds[z]);\n if (tmp !== undefined && tmp && tmp.length > 0 && ([... new Set(tmp)]).sort().length >= 2) {twoWordMin = true;}\n// If these definition word IDs are not consequetive, determine how long the words are that are missing from this list\n tst = [];\n if (twoWordMin) {\n for (j = Math.min(... tmp)+1; j < Math.max(... tmp); j++) {\n if (tmp.indexOf(j) == -1) {tst.push(j); }\n }\n }\n for (j = 0; j < tst.length; j++) {\n tmp = wordIds.reduce(function(x1,x2,x3) {\n if (x2 == j && txt.slice(x3,x3+1)[0].match(/[A-Za-z0-9]/)) {x1.push(x2);} return x1;},[]);\n if (tmp.length <= 3) {noCherryPicking = false; }\n }\n// determine the range of characters between the end of the definition words and the acronym:\n tmp = acroPos[i].length;\n a1 = acroPos[i][tmp-1];\n w1 = wordsPos[i][0];\n a2 = acroPos[i][0];\n tmp = wordsPos[i].length;\n w2 = wordsPos[i][tmp-1];\n tmp = '';\n if (wordIds[a1] < (wordIds[w1]-1)) {\n tmp = txt.reduce(function(x1,x2,x3) {\n if (wordIds[x3] > wordIds[a1] && wordIds[x3] < wordIds[w1]) {x1.push(x2);} return x1;},[]);\n tmp = tmp.join('').replace(/[^A-Za-z0-9 ]/g,'').replace(/ +/g,' ').trim();\n } else if (wordIds[w2] < (wordIds[a2]-1)) {\n tmp = txt.reduce(function(x1,x2,x3) {\n if (wordIds[x3] > wordIds[w2] && wordIds[x3] < wordIds[a2]) {x1.push(x2);} return x1;},[]);\n tmp = tmp.join('').replace(/[^A-Za-z0-9 ]/g,'').replace(/ +/g,' ').trim(); }\n// If any of the in-between words had uppercase letters, then the test is failed:\n if (tmp.match(/[A-Z]/)) {noSkippedWords = false;}\n tmp =tmp.split(' ');\n tmp = tmp.filter(z => z.length > 3); // don't count words of 3 characters or less\n if (tmp.length > 3) {noSkippedWords = false; } // if more than 3 substantial words lay between acro and def, fail the test\n// For the below tests, need to determine if the definition words start at the beginning of sentence.\n if (startPos == 0) {\n startSentence = true;\n } else if (text.slice(0,startPos).trim() == '') {\n startSentence = true; \n } else if (startPos >= 2 && text.slice(startPos-2,startPos).trim() == '\\.') {\n startSentence = true; }\n if (aTmp == wTmp) {caseMatch = true; }\n if (aTmp.match(/^[A-Z0-9]+$/) && wTmp.match(/^[a-z0-9]+$/)) {caseMatch = true;}\n// If the definition words is a mix of cases that involves more than a capitalization of the start of a sentence,\n// do definition word characters case-match with the acronym characters?\n if (startSentence && aTmp.slice(1) == wTmp.slice(1)) {caseMatch = true; }\n// check the case of the acronym characters, make sure there is consistency\n if (aTmp.match(/^[A-Z0-9]+$/) || aTmp.match(/^[a-z0-9]+$/)) {acroCase = true; }\n if (aTmp.match(/[A-Z]/) && aTmp.match(/[a-z]/) && aTmp.match(/[A-Z]/g).length > aTmp.match(/[a-z]/g).length) {\n acroCase = true; }\n// Now check the acronym length:\n if (aTmp.length > 2) {twoChars = true;}\n if (!twoChars) {\n// If the acronym consists of all consonants or of all vowels, then it passes the twoChar test:\n tmp = acroPos[i].reduce(function(x1,x2,x3) {\n if (txt.slice(x3,x3+1)[0].match(/[aeiou]/i)) {x1.push('v')} else {x1.push('c')}; return x1;},[]);\n if (tmp.length > 0 && ([... new Set(tmp)]).length == 1) {twoChars = true;} }\n// Make sure that acronym does not match any of the common short words:\n if (smallWords.indexOf(aTmp) == -1) {notShortWord = true;}\n// Now check that the acronym is not actually a chemical symbol!\n tmp = xLtr.findIndex(z => z.reg !== undefined && z.symbol !== undefined && z.indx(aTmp,0) != '');\n if (tmp == -1) {notSymbol = true;} \n// Now tally up the scores and see if this acronym candidate failed ANY of the tests:\n if (!(fullAcro*twoWordMin*noCherryPicking*noSkippedWords*caseMatch*acroCase*twoChars*notShortWord*notSymbol)) {\n acroPos[i] = [-1];\n wordsPos[i] = [-1]; }\n }\n// Remove any -1 values:\n acroPos = acroPos.filter(z => z[0] != -1);\n wordsPos = wordsPos.filter(z => z[0] != -1);\n// If by now, there are more than 1 possibility for acronym and corresponding definition, then select whichever has the longest acronym.\n// If the acronym length is the same for all the matches, then select the one for which the words and the acronym are closest together. \n dist = [];\n alength = [];\n for (i = 0; i < acroPos.length; i++) {\n tmp = acroPos[i].map(z => txt.slice(z,z+1)[0]).join('');\n alength.push(tmp.length);\n if (acroPos[i][0] > wordsPos[i][0]) {\n tmp = wordsPos[i].length;\n dist.push(txt.slice(wordsPos[i][tmp-1]+1,acroPos[i][0]+1).join('').replace(/[^A-Za-z0-9 ]/g,'').length);\n } else {\n tmp = acroPos[i].length;\n dist.push(txt.slice(acroPos[i][tmp-1]+1,wordsPos[i][0]+1).join('').replace(/[^A-Za-z0-9 ]/g,'').length); }\n }\n for (i = 0; i < acroPos.length; i++) {\n if (alength[i] < Math.max(... alength)) {\n acroPos[i] = [-1];\n wordsPos[i] = [-1];\n alength[i] = -1;\n dist[i] = -1; }\n }\n acroPos = acroPos.filter(z => z[0] != -1);\n wordsPos = wordsPos.filter(z => z[0] != -1);\n dist = dist.filter(z => z != -1);\n alength = alength.filter(z => z != -1);\n tmp = dist.findIndex(z => z == Math.min(... dist)); // returns the first one to meet criteria \n acro = '';\n acroDef = '';\n if (tmp != -1) {\n acroPos = acroPos[tmp];\n wordsPos = wordsPos[tmp];\n acro = acroPos.map(z => txt.slice(z,z+1)[0]).join('');\n tmp = [... new Set(wordsPos.map(z => wordStarts[z]))];\n tmp = [Math.min(... tmp), Math.max(... tmp)];\n tmp[1] = tmp[1] + wordStarts.filter(z => z == tmp[1]).length;\n acroDef = txt.slice(tmp[0],tmp[1]).join('').replace(/[^A-Za-z0-9]/g,' ').trim();\n this.startDef = '' + (txtPos[tmp[0]] + startPos);\n this.endDef = '' + (txtPos[tmp[1]-1] + 1 + startPos);\n acroDef = acroDef.replace(/ +/,' ').trim();\n if (acroPos[0] > wordsPos[0]) {\n this.endMatch = \"\" + (txtPos[Math.max(... acroPos)] + 1 + startPos);\n } else {\n this.endMatch = this.endDef; }\n return acro + ' ' + acroDef.replace(/ /g,'\\_');\n } else {return ''; }\n } });\n return;\n }", "function getRandomPhraseAsArray(array) {\n let getRandomPhrase = array[Math.floor(Math.random() * array.length)];\n let newPhraseArray = [];\n currentPhrase = getRandomPhrase;\n\n for (let i = 0; i < getRandomPhrase.length; i++) {\n newPhraseArray.push(getRandomPhrase.charAt(i));\n }\n return newPhraseArray;\n}", "function determineArmy(army, state){\t\n\tvar c = state.readToken(army[0][0],army[0][1]);\n\t\n\tif(c === 0){\n\t\treturn [];\n\t}\n\t\n\treturn emptyArmyHelper(army, state);\n}", "function createTitleWordsArray (array) {\n // PREFIX: \n allTitleWords = [];\n\n // Split all the words\n array.forEach(element => {\n let ElementTitleWords = element.title.split(' ');\n // Push every word to the array\n ElementTitleWords.forEach(word => {\n allTitleWords.push(word.toLowerCase());\n });\n });\n}", "function makeFinalMarkov(textStamps, markovText){\n var output = [];\n for(var i = 0; i < markovText.length; i++){\n var curWord = markovText[i];\n var chooseArr = textStamps[curWord];\n output.push(chooseArr[Math.floor(Math.random() * chooseArr.length)]);\n }\n return output;\n}", "metinToArray() {\r\n\r\n\r\n var metinArrayed = this.metin.split(\" \");\r\n\r\n\r\n return metinArrayed\r\n\r\n }", "function sequence(oreo) {\n return oreo.toLowerCase()\n .replace(/[^or]/g, '')\n .split(/([or])/)\n .filter(i => i)\n .map(i => i === 'r' ? 're' : i)\n}", "function getRandomPhraseAsArray(arr) {\n const getRandomPhrase = arr[Math.floor(Math.random()*arr.length)];\n let answerPhrase = getRandomPhrase.split(\"\");\n return answerPhrase;\n}", "function SeparateTextArea(text,val)\n{\n\tvar ary = new Array(0);\n\tfor(var i=0;text.length>0;i++)\n\t{\n\t\tif(text.length<val)\n\t\t{\n\t\t\tary[i] = text.substring(0,text.length)\n\t\t\tbreak;\n\t\t}\n\t\tary[i] = text.substring(0,val);\n\t\ttext = text.substring(val,text.length)\n\t}\n\treturn ary;\n}", "function censura(text, words){\n // words = ['serie', 'di', 'parole', 'da', 'censurare'];\n // var arrText = [];\n // var arrWords =[];\n // var newtxt = [];\n // arrText.push();\n var arrText = text.split(' ')\n // arrWords.push();\n var arrWords = words.split(' ')\n console.log(' nella funzione gli array',arrText, arrWords);\n for (var i = 0; i < arrText.length; i++) {\n\n // for (var j = 0; j < arrWords.length; j++) {\n\n // if (arrText[i] == arrWords[j]){\n // console.log('stampo arrText nella funzione e nell-if',arrText[i]);\n // arrText[i] = 'xxx';\n // console.log(arrWords[j]);\n // console.log('stampo arrText nella funzione e nell-if',arrText[i]);\n // }\n // else {\n // console.log('sono nell-else e vado anvanti nel ciclo');\n // console.log(arrText[i]);\n // }\n if (arrWords.includes(arrText[i])){\n\n arrText[i]= 'xxx';\n console.log(arrText[i]);\n }\n\n\n // console.log(arrWords[j]);\n\n\n\n // }\n\n // console.log('stampo arrText nella funzione ',arrText[i]);\n\n // newtxt.push(arrText[i]);\n // console.log(newtxt);\n }\n console.log(arrWords);\n return arrText.join(' ');\n\n}", "createPhrases() {\n let phraseOne = new Phrase('life is like a box of chocolates');\n let phraseTwo = new Phrase('there is no trying');\n let phraseThree = new Phrase('may the force be with you');\n let phraseFour = new Phrase('you have to see the matrix of yourself');\n let phraseFive = new Phrase('you talking to me');\n let arrayOfPhrases = [phraseOne, phraseTwo, phraseThree, phraseFour, phraseFive];\n return arrayOfPhrases;\n }", "function mach_mini_iimeil_laesbar(text) {\n var s = text.split('');\n for (var i = 0; i < s.length; i++) { s[i] = luukoeptaibel[text[i]]; }\n return s.join('');\n}", "function formatText(string) {\n var outputArray = [];\n string.split(\"\\n\").forEach(function(url) {\n outputArray.push(new RegExp(url));\n });\n return outputArray;\n}", "function text_to_array(text)\n {\n var byte, bdx = 0, \n len = text.length, \n res = new Array(len),\n bytes = text_to_bytes(text)\n for(;;)\n { \n byte = get_byte(bytes, bdx)\n if(byte == 0)\n break\n res[bdx++] = byte\n }\n free(bytes)\n verify(bdx == text.length, \"UTF-8 not yet supported\")\n return res\n }", "function groupKeggResponse(text) {\n let ntext = text.trimEnd().split(/\\n/);\n let ndata = [[]];\n for (let t of ntext.slice(0, ntext.length - 1)) {\n if (t === \"///\") {\n ndata.push([]);\n continue;\n };\n ndata[ndata.length - 1].push(t);\n };\n return ndata;\n}", "get caracteristicas() {\n return [];\n }", "function prepphrase(){\n var presponse=[];\n var array=pp[r(pp)]\n if (array==pp1){\n presponse.push(array[0][r(array[0])])\n presponse.push(nbar())\n }\n else{presponse.push('')}\n return presponse;\n}", "function getRandomPhraseAsArray(arr){\n //Choose random phrase.\n let randomNumber = Math.floor(Math.random()*5)\n let randomPhrase = arr[randomNumber].split(\"\")\n return randomPhrase;\n}", "function cortaPalabras(texto) {\n\n let palabras = [];\n let palabra = '';\n for ( let letra = 0; letra < texto.length; letra++ ) {\n if ( texto[letra] !== ' ' ) {\n palabra += texto[letra];\n } else if ( palabra !== '' ) {\n palabras.push( palabra );\n palabra = '';\n }\n\n if ( letra == texto.length - 1 && palabra !== '') palabras.push( palabra );\n }\n\n console.log(palabras);\n return palabras;\n}", "function treatBacName(name) {\n var bacteriaList = [];\n\n for (var i = 0; i < name.length; i++) {\n var stringName = name[i].toString();\n var splitValue = stringName.split(\";\");\n if (splitValue.length > 1) {\n bacteriaList.push(splitValue[splitValue.length - 1]);\n } else {\n bacteriaList.push(splitValue[0]);\n }\n }\n return bacteriaList;\n}", "function showAll (text) {\n\n\tasciify.getFonts(function (err, fonts) {\n\t\tif (err) { return console.error(err); }\n\n\t\tvar padSize = ('' + fonts.length).length;\n\n\t\tfonts.forEach(function(font, index) {\n\t\t\tvar opts = {\n\t\t\t\tfont: font,\n\t\t\t\tcolor: argv.color\n\t\t\t};\n\n\t\t\tasciify(exampleText, opts, function (err, result) {\n\t\t\t\tconsole.log(pad(padSize, index+1, '0') + ': ' + font);\n\t\t\t\tconsole.log(result);\n\t\t\t\tconsole.log('');\n\t\t\t});\n\t\t});\n\t});\n}", "function getTextArr() {\n s = document.getElementById(\"textToReadWrapper\").innerHTML;\n s = s.replace(/(^\\s*)|(\\s*$)/gi, \"\");\n s = s.replace(/[ ]{2,}/gi, \" \");\n s = s.replace(/\\n /, \"\\n\");\n textToAdd = s.split(' ');\n\n }", "function getAccessoriesArray(accessoriesString) {\n return accessoriesString.strip().split(\" \");\n}", "function initMedia (Cadena)\r\n{\r\n var init = 0;\r\n var resultat = new Array ();\r\n var paraulaImatge;\r\n var fi = Cadena.length;\r\n tmp = Cadena;\r\n var paraules = new Array ();\r\n var paraula;\r\n first = 0;\r\n if (fi != init) {\r\n do {\r\n if (tmp.length >= 1) {\r\n cadena = getCadena ('@', '@', tmp);\r\n\tparaulaImatge = getWordImg (cadena, '#');\r\n\tresultat.push (paraulaImatge);\r\n }\r\n init = tmp.indexOf ('@', 1);\r\n tmp = tmp.substring (init, fi);\r\n }\r\n while (init != (-1) && !(tmp.length <= 1));\r\n }\r\n resultat = ordenarWordImg (resultat);\r\n return resultat;\r\n}", "function regexMatch(string, pattern){\n\n var myarray=new Array(string.length-1);\n\n for (i=0; i <string.length-1; i++){\n myarray[i]=new Array(pattern.length-1)}\n\n myarray[0][0] = true\n myarray = true\n\n console.log(myarray);\n\n\n\n\n\n //condition one\n\n\n\n}", "function createMenuItems() {\n var menuArray = [];\n // Create the menu entry for searching with all engines\n if (preferences['showAll']) {\n menuArray.push(contextMenu.Item({\n label: 'All Engines',\n data: '-all'\n }));\n menuArray.push(contextMenu.Separator());\n }\n engines.forEach(function (engine) {\n if (preferences[engine.prefName]) {\n menuArray.push(contextMenu.Item({\n label: engine.name,\n data: engine.url,\n image: engine.icon\n }));\n }\n });\n return menuArray;\n}", "_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 getRandomPhraseAsArray(arr) {\n let randomNumber = Math.floor(Math.random() * arr.length);\n let split = arr[randomNumber].split(\"\");\n return split;\n}", "function grabBylines() {\n var bylines = $(\".byline\");\n //highlights them\n for (var i = 0; i < bylines.length; i++) {\n bylines[i].style['background-color'] = '#99fff0';\n }\n //puts contents into array\n var all = bylines.map(function() {\n return this.innerHTML;\n }).get();\n\n return all;\n }", "arcPlugins() {\n return [\n \"bold\", \"italic\", \"h1\", \"h2\", \"h3\", \"center\", \"quote\", \"link\",\n \"list\", \"section\", \"code\", \"image\", \"youtube\"\n ];\n }", "function arrayLoad(){\n var info, qtext, i;\n info = text.split(\"\\n\");//info is an array of every line of text in the file \n var q = [];//primative array (non OOP arrays in js act like java arraylists) of questions for this page\n var arraycounter=0;\n for(i = 0; i<info.length;i++){\n var ans = info[i];\n i++;\n qtext=\"\";\n while((info[i].trim()) !== \"ZzZ\"){\n qtext+=info[i] + \"<br>\";\n i++;\n }\n i++;//to get out of the ZzZ indicator\n\n q[arraycounter] = new quest(ans, qtext, info[i], info[i+1], info[i+2], info[i+3], info[i+4]);\n arraycounter++; \n \n i+=4;\n }\n //all questions from the doc are now in the array q\n q = shuffle(q);\n return q;\n}", "function createSuggestionsArray(value) {\n // PREFIX: \n suggestions = [];\n\n allTitleWords.forEach(word => {\n if (word.endsWith('.')) {\n word = word.slice(0, -1);\n } \n if (word.startsWith(value) === true && word.length >= 3) {\n suggestions.push(word);\n } \n });\n}", "function searchTextToArray() {\n \n var originalSearch = '';\n var vendorSearchTags = [];\n \n if($scope.searchText !== '') {\n // convert to lowercase and split at space\n originalSearch = $scope.searchText.toLowerCase();\n vendorSearchTags = originalSearch.split(\" \");\n searchTags.push(originalSearch); \n } \n }", "function getPanoramas(nodeId) {\n const panoramas = [];\n\n let panLetter = \"\";\n for (let i = 0; i < 27; i++) {\n const fname = nodeId + panLetter + \".jpg\";\n const fname_png = nodeId + panLetter + \".png\";\n if (fs.existsSync(PANO_PATH + fname)) {\n panoramas.push(fname);\n } else if (fs.existsSync(PANO_PATH + fname_png)) {\n panoramas.push(fname_png);\n } else {\n break;\n }\n panLetter = String.fromCharCode(97 + i); // a through z\n }\n\n return panoramas;\n}", "tokenize(text) {\n text = text.toLowerCase();\n const phrases = [ text ];\n let matches = text.match(/\\s+/);\n let i = -1;\n if (matches && matches[0]) {\n i = matches.index + matches[0].length;\n }\n let ctr = 0;\n while (i !== -1 && ctr < 4) { // insert 4 more phrases\n text = text.substring(i);\n phrases.push(text);\n matches = text.match(/\\s+/);\n if (matches && matches[0]) {\n i = matches.index + matches[0].length;\n } else {\n i = -1;\n }\n ++ctr;\n }\n\n return phrases;\n }", "function extractSelections(text) {\n let regex = /<\\|([\\s\\S]*?)\\|>/g;\n\n let selections = [];\n\n let match;\n let i = 0;\n\n while ((match = regex.exec(text)) !== null) {\n // For every preceding selection annotation, 4 characters are removed\n let start = match.index - (4 * i);\n selections.push([start, start + match[1].length]);\n i++;\n }\n\n return [text.replace(regex, (match, p1) => p1), selections];\n}", "function makeArray(word) {\n var word_array = [];\n for (var i = 0; i < word.length; i++) {\n word_array.push(word.charAt(i));\n }\n return word_array;\n }", "function getRandomPhraseAsArray(arr) {\n let num = Math.floor((Math.random() * arr.length));\n let splitPhrase = arr[num].split('');\n return splitPhrase;\n}", "function textToPattern(text)\n{\n var result = [];\n\n for(var i=0; i<text.length; i++)\n {\n if (i != 0) result.push(0x0); // mandatory spacing\n\n switch (text.charAt(i))\n {\n case '0':\n result.push(0x6, 0x9, 0x6);\n break;\n\n case '1':\n result.push(0x4, 0xF);\n break;\n\n case '2':\n result.push(0x5, 0xB, 0x5);\n break;\n\n case '3':\n result.push(0x9, 0x9, 0x6);\n break;\n\n case '4':\n result.push(0xE, 0x3, 0x2);\n break;\n }\n }\n\n return result;\n}" ]
[ "0.5588051", "0.53818357", "0.5325225", "0.5282684", "0.50899565", "0.5088381", "0.5072979", "0.5035645", "0.5030829", "0.50273424", "0.5017766", "0.5016493", "0.49978402", "0.49876705", "0.49868843", "0.49556953", "0.49533612", "0.4944792", "0.4932088", "0.49320322", "0.49316397", "0.4921831", "0.49045536", "0.49019328", "0.48985475", "0.48919156", "0.48881656", "0.48849162", "0.4854077", "0.4851317", "0.4844578", "0.48427278", "0.48400044", "0.48389044", "0.48307756", "0.48307756", "0.48298424", "0.48166278", "0.48151737", "0.48123562", "0.48063883", "0.48033231", "0.47985414", "0.47906086", "0.47708964", "0.47702125", "0.47640523", "0.4763958", "0.47604698", "0.47593442", "0.47567758", "0.47505623", "0.47425792", "0.47424698", "0.47395134", "0.473858", "0.473664", "0.4736266", "0.47329628", "0.47224802", "0.4718551", "0.4717676", "0.4707062", "0.47054648", "0.46958005", "0.46951994", "0.46941957", "0.4693607", "0.46927333", "0.46922806", "0.46882886", "0.468735", "0.46700478", "0.46663946", "0.46636593", "0.46431407", "0.46428394", "0.46410874", "0.46379", "0.4631156", "0.4628852", "0.46284908", "0.4624241", "0.4619134", "0.4615616", "0.46125716", "0.4610598", "0.46008557", "0.46007964", "0.45893314", "0.4588927", "0.45801446", "0.45782572", "0.45749074", "0.45733702", "0.4570816", "0.45664203", "0.45655623", "0.45633644", "0.4551499" ]
0.6046376
0
This function searches for epiphoras in the text and forms an array with them.
function getEpiphoraCount() { text = workarea.textContent; epiphora_candidates = []; first_index = 0; last_index = 0; for(i=0; i < sentences.length-1; i++) { if(sentences[i].match(/\S+$/) == null) { last_word = sentences[i].match(/\S+\s$/)[0]; } else { last_word = sentences[i].match(/\S+$/)[0]; } if(last_word.match("said")) { continue; } first_index = i; last_index = first_index; for(j=i+1; j<sentences.length; j++) { if(last_word == sentences[j].match(last_word.replace(/\[/g, "\\[").replace(/\]/g, "\\]").replace(/\*/g, "[*]").replace(/\?/g,"[?]").replace(/\)/g, "[)]").replace(/\(/g,"[(]"))) { last_index = j; } else { break; } } if(last_index > first_index) { tmp = []; tmp2 = []; for(first_index; first_index <= last_index; first_index++) { tmp.push(sentences[first_index]); tmp2.push(first_index); } epiphora_candidates.push([last_word, tmp, tmp2]); i = last_index; } } flag = true; if(epiphora_candidates.length != 0) { while(flag) { control_array = []; for(i=0; i<epiphora_candidates.length; i++) { last_words = new RegExp("\\S+\\s" + epiphora_candidates[i][0].replace(/\)/g, "[)]").replace(/\(/g,"[(]").replace(/\?/g,"[?]")); if(epiphora_candidates[i][1][0].match(last_words) != null) { last_words = epiphora_candidates[i][1][0].match(last_words)[0]; tmp = []; for(j=0; j < epiphora_candidates[i][1].length; j++) { if(epiphora_candidates[i][1][j].match(last_words.replace(/\[/g, "\\[").replace(/\]/g, "\\]").replace(/\)/g, "[)]").replace(/\(/g,"[(]").replace(/\?/g,"[?]")) != null) { tmp.push(true); } else { tmp.push(false); } } control_array.push(tmp); if(tmp.indexOf(false) == -1) { epiphora_candidates[i][0] = last_words; } } } for(i=0; i<control_array.length; i++) { if(control_array[i].indexOf(false) != -1) { control_array[i] = false; } else { control_array[i] = true; } } if(control_array.indexOf(false) != -1){ flag = false; } else { flag = true; } } flag = true; while(flag) { control_array = []; for(i=0; i<epiphora_candidates.length; i++) { last_words = new RegExp("\\S+\\s" + epiphora_candidates[i][0].replace(/\)/g, "[)]").replace(/\(/g,"[(]").replace(/\?/g,"[?]")); if(epiphora_candidates[i][1][0].match(last_words) != null) { last_words = epiphora_candidates[i][1][0].match(last_words)[0]; tmp = []; for(j=0; j < epiphora_candidates[i][1].length; j++) { if(epiphora_candidates[i][1][j].match(last_words.replace(/\[/g, "\\[").replace(/\]/g, "\\]").replace(/\)/g, "[)]").replace(/\(/g,"[(]").replace(/\?/g,"[?]")) != null) { tmp.push(true); } else { tmp.push(false); } } control_array.push(tmp); if(tmp.indexOf(false) == -1) { epiphora_candidates[i][0] = last_words; } } } for(i=0; i<control_array.length; i++) { if(control_array[i].indexOf(false) != -1) { control_array[i] = true; } else { control_array[i] = false; } } if(control_array.indexOf(false) == -1){ flag = false; } else { flag = true; } } } for(i=0; i < epiphora_candidates.length; i++) { delete epiphora_candidates[i].pop() } temp = []; for(i=0; i<epiphora_candidates.length; i++) { epiphora_length = epiphora_candidates[i][0].split(" ").length; count = 0; for(j=0; j<epiphora_candidates[i][1].length; j++) { if(epiphora_candidates[i][1][j].split(" ").length == epiphora_length && epiphora_length < 5) { count++; } } if (count!=epiphora_candidates[i][1].length) { temp.push(epiphora_candidates[i]) } } epiphora_candidates = temp; result = epiphora_candidates; return result.length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function text_to_array(text, array)\n{\n\tvar array = array || [], i = 0, l;\n\tfor (l = text.length % 8; i < l; ++i)\n\t\tarray.push(text.charCodeAt(i) & 0xff);\n\tfor (l = text.length; i < l;)\n\t\t// Unfortunately unless text is cast to a String object there is no shortcut for charCodeAt,\n\t\t// and if text is cast to a String object, it's considerably slower.\n\t\tarray.push(text.charCodeAt(i++) & 0xff, text.charCodeAt(i++) & 0xff, text.charCodeAt(i++) & 0xff, text.charCodeAt(i++) & 0xff,\n\t\t\ttext.charCodeAt(i++) & 0xff, text.charCodeAt(i++) & 0xff, text.charCodeAt(i++) & 0xff, text.charCodeAt(i++) & 0xff);\n\treturn array;\n}", "function arrayer(song) {\n let arrayOfParts = [];\n let startIndex = 1;\n let endIndex = 0;\n while (song) {\n endIndex = song.indexOf(\"[\", startIndex);\n if (endIndex === -1) {\n arrayOfParts.push(song.slice(startIndex - 1, song.length - 1));\n break;\n }\n arrayOfParts.push(song.slice(startIndex - 1, endIndex - 1));\n startIndex = endIndex + 1; \n }\n console.log(arrayOfParts[0].charCodeAt(10)); //87\n return arrayOfParts;\n }", "function getEmoteIDs(msg){\n\t// Regex to grab the `emotes` field\n\tvar emote_re = /emotes=([0-9:\\-,\\/]*)/;\n\tvar msg_re = /PRIVMSG \\#[a-zA-Z0-9_]* :(.*)/\n\t\n\t// Grab the `emotes` field\n\tvar emote_data = msg.match(emote_re);\n\t\t\n\t/* \n\t Stops routine if:\n\t 1. We didn't find the `emotes` field\n\t\tOR \n\t 2. The `emotes` field is empty\n\t*/\n\tif (emote_data != null && emote_data[1].length > 0){\n\t\ttry{\n\t\t\t// Create a list of the emotes found\n\t\t\tvar emotes = emote_data[1].split('/');\n\t\t\n\t\t\t// Prints out the id number and text for each emote\n\t\t\tvar i;\n\t\t\tvar emote_id;\n\t\t\tvar text_pos;\n\t\t\tvar chat = msg.match(msg_re)[1];\n\t\t\tvar emote_list = [['', '', 0]]; // 0=id, 1=text, 2=value\n\t\t\t\n\t\t\t// Loops through each emote and adds its id, text, and occurrences to the list\n\t\t\tfor (i = 0; i < emotes.length; i++){\n\t\t\t\tif(!emote_list[i]){\n\t\t\t\t\temote_list[i] = ['','',0]\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Get ID\n\t\t\t\temote_id = emotes[i].split(':')\n\t\t\t\temote_list[i][0] = emote_id[0];\n\t\t\t\t\n\t\t\t\t// Get text\n\t\t\t\ttext_pos = emote_id[1].split(',')[0].split('-');\n\t\t\t\temote_list[i][1] = chat.substring(parseInt(text_pos[0]), parseInt(text_pos[1]) + 1);\n\t\t\t\t\n\t\t\t\t// Get occurrences, only consider up to the MAX_EMOTE value\n\t\t\t\temote_list[i][2] = (emote_id[1].split(',').length < 5) ? emote_id[1].split(',').length : MAX_EMOTE;\n\t\t\t}\n\t\t\t\n\t\t\treturn emote_list;\n\t\t}\n\t\tcatch(err){\n\t\t\tconsole.log(err);\n\t\t\tconsole.log(\"Message: \" + msg);\n\t\t\tconsole.log(\"`emote_data` Match: \" + emote_data);\n\t\t\treturn null;\n\t\t}\n\t}\n\telse{\n\t\treturn null;\n\t}\n}", "function test2e() {\n //creates newArray by grabbing text from the input textarea and splitting it\n //splitting the text into an array makes it much easier to work with\n\n let newArray = splitText(INPUTBOX);\n newArray = convert2e(newArray, \"2e\");\n\n mergeText(newArray); //joins the array back into a string and sends the results to the output textarea\n}", "function groupKeggResponse(text) {\n let ntext = text.trimEnd().split(/\\n/);\n let ndata = [[]];\n for (let t of ntext.slice(0, ntext.length - 1)) {\n if (t === \"///\") {\n ndata.push([]);\n continue;\n };\n ndata[ndata.length - 1].push(t);\n };\n return ndata;\n}", "function getVowels(str){\n var arr = [];\n var vowels = str.replace(/[^aeiou]/gi, \"\").split(\"\");\n for ( i = 0; i < vowels.length; i++ ) {\n //if the index of the iterated value of vowels is less than 0, aka if it is -1, thus not in the array, then push it to the array\n if (arr.indexOf(vowels[i]) < 0) {\n arr.push(vowels[i]);\n }\n }\n return arr;\n}", "function EmailsToArray(str) {\n var result = [];\n var email = \"\";\n var token;\n\n for (var i = 0; i < str.length; ) {\n token = GetEmailToken(str, i);\n if (token == \",\") {\n AddEmailAddress(result, email);\n email = \"\";\n i++;\n continue;\n }\n email += token;\n i += token.length;\n }\n\n // Add last\n if (email !=\"\" || token == \",\") {\n AddEmailAddress(result, email);\n }\n return result;\n}", "function text_to_array(text)\n {\n var byte, bdx = 0, \n len = text.length, \n res = new Array(len),\n bytes = text_to_bytes(text)\n for(;;)\n { \n byte = get_byte(bytes, bdx)\n if(byte == 0)\n break\n res[bdx++] = byte\n }\n free(bytes)\n verify(bdx == text.length, \"UTF-8 not yet supported\")\n return res\n }", "function lettersWithStrings(data, str) {\r\n let array = []\r\n for (let i = 0; i < data.length; i++){\r\n if (data[i].includes(str)){\r\n array.push(data[i])\r\n }\r\n } \r\n return array\r\n }", "function lettersWithStrings(arr, str) {\n var words = []\n for(var i = 0; i < arr.length; i++){\n if(arr[i].indexOf(\"!\") !== -1) {\n \n words.push(arr[i])\n }\n }\n return words\n}", "function splitTextToArray(textes) {\r\n\tlet textArray = textes.split(\"\\n\");\r\n\treturn textArray;\r\n}", "function vowelsAndConsonants(s) {\n let arr = s.split(\"\");\n let arr_v = [];\n let arr_c = [];\n for (let i = 0; i < arr.length; i++)\n {\n if (arr[i] == \"a\" || arr[i] == \"i\" || arr[i] == \"u\" || arr[i] == \"e\" || arr[i] == \"o\") {\n arr_v.push(arr[i]);\n }\n else {\n arr_c.push(arr[i]);\n }\n }\n for (let i = 0; i < arr_v.length; i++)\n {\n console.log(arr_v[i]);\n }\n for (let i = 0; i < arr_c.length; i++)\n {\n console.log(arr_c[i]);\n }\n\n}", "function getEolArray(string) {\n var out = [], sfirst = 0;\n\n out.push(new Int32Array([0]));\n\n var quantum = Math.max(100, Math.floor(string.length / 100));\n while (sfirst < string.length) {\n var alen = 2*quantum;\n var acur = new Int32Array(alen);\n var aix = 0;\n\n while (sfirst < string.length && (alen - aix) >= quantum) {\n var tmp = eolScan(string, acur, sfirst, sfirst + Math.min(string.length - sfirst, alen - aix), aix);\n sfirst = tmp[0];\n aix = tmp[1];\n }\n\n if (aix) out.push(acur.subarray(0,aix));\n }\n\n return out;\n}", "function aORan(comps) {\n article = [];\n for (i = 0; i < comps.length; i++){\n var beg = comps[i].charAt(0);\n beg = beg.toLowerCase();\n if (beg.match(\"a|e|i|o|u|h\")) {\n article.push(\"an\");\n }else{\n article.push(\"a\");\n }\n }\n return article;\n}", "function piiParser(tweetContent) {\n\tlet matchArray = [];\n\t\n\tlet telephone = /1?\\W*([2-9][0-8][0-9])\\W*([2-9][0-9]{2})\\W*([0-9]{4})(\\se?x?t?(\\d*))?/;\n\tif (telephone.test(tweetContent)) {\n\t\tmatchArray.push(\"Tweet contains a telephone number\");\n\t}\n\t\n\tlet email = /([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)/;\n\tif (email.test(tweetContent)) {\n\t\tmatchArray.push(\"Tweet contains an email address\");\n\t}\n\t\n\tlet date = /([12]\\d{3}\\/(0[1-9]|1[0-2])\\/(0[1-9]|[12]\\d|3[01]))/;\n\tif (date.test(tweetContent)) {\n\t\tmatchArray.push(\"Tweet contains a potential significant date\");\n\t}\n\t\n\tlet ipv4 = /[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$/;\n\tif (ipv4.test(tweetContent)) {\n\t\tmatchArray.push(\"Tweet contains an IP address\");\n\t}\n\treturn matchArray;\n}", "function vowelize (arr){\n\tconst vowelArrays = arr.map(str => {\n\t\treturn str\n\t\t\t.split('')\n\t\t\t.filter(char => {\n\t\t\t\treturn char === 'a' || char === 'e' || char === 'i' || char === 'o' || char === 'u';\n\t\t\t})\n\t\t\t.join('');\n\t});\n\n\tconst noVowels = vowelArrays.includes('');\n\n\tif (noVowels) {\n\t\treturn [];\n\t}\n\treturn vowelArrays;\n}", "function getRandomPhraseAsArray(arr) {\n var a = arr[Math.floor(Math.random() * 6)];\n const b = [];\n \n for (let i = 0; i < a.length; i++) {\n b.push(a.charAt(i));\n }\n\n return b\n}", "function vowelsAndConsonants(s) {\n var vowel = [];\n var consonant = [];\n for (var i = 0; i < s.length; i++) {\n if (/[aeiou]/g.test(s[i])) {\n vowel.push(s[i]);\n continue;\n }\n consonant.push(s[i]);\n }\n var result = vowel.concat(consonant).join(\"\\n\");\n console.log(result);\n}", "function emailParts(email){\n\tlet arr = [];\n\temail = email.toLowerCase();\n\tarr = email.split(\"@\");\n\treturn arr;\n}", "function separate(expression){\n var tempArray=[], finalArray=[];\n for(var i = 0; i < expression.length; i++){\n if(symbols.indexOf(expression[i]) != -1){//is a symbol\n if(tempArray.length != 0){ // if temp array is not empty, make the temp array into a string and push into final array\n var a=tempArray.join('');\n finalArray.push(a);\n tempArray = [];\n }\n finalArray.push(expression[i]);\n }else{\n tempArray.push(expression[i]);\n }\n }\n if(tempArray.length > 0){\n var a = tempArray.join('');\n finalArray.push(a);\n }\n // console.log(finalArray);\n return finalArray;\n }", "function getRandomPhraseAsArray(arr){\n // Remove 1 from the array length to get the max number (inclusive)\n const length = arr.length - 1;\n // Generate a random number between 0 and length\n const choose = getRandomNumber(0, length);\n const currentPhrase = arr[choose];\n // Split the phrase into array of individual characters\n const letters = currentPhrase.split('');\n return letters;\n}", "function vowelIndices(word){\n// 1. Define an empty array we can push index values into\n var arr = [];\n//2. Iterate through 'word', searching for vowels\n for (i = 0 ; i <word.length; i++) {\n//3. Use 'indexOf' to find locations of vowels inside of 'word'\n if ('aeiouy'.indexOf(word[i]) !== -1)\n//4. As long as the vowels are located inside of 'word' (ie not -1), push their index location into an array\n arr.push(i+1);\n }\n//5. Print the array\n return arr;\n}", "function getArray (s) {\n var a = s.split('\\n')\n return a.map(v => v.split('').map(vv => {\n if (vv === '*') {\n return 1\n } else {\n return 0\n }\n }))\n}", "decodePdu( encoded ) {\n\n let values = [];\n\n let index = 0;\n\n while( index < encoded.length ) {\n if( encoded[index] === MSG_TOKEN_ESC && index < encoded.length-1 ) {\n index++;\n\n if( encoded[index] === MSG_START_STUFF ){\n values.push( MSG_TOKEN_START );\n }\n else if( encoded[index] === MSG_ESC_STUFF ){\n values.push( MSG_TOKEN_ESC );\n }\n\n }\n else {\n values.push( encoded[index] );\n }\n\n index++;\n\n }\n\n return values;\n }", "getAnswerIndex(answerChar) {\n var tempText = this.text;\n var result = [];\n while(tempText.includes(answerChar)) {\n var foundIndex = tempText.indexOf(answerChar);\n result.push(foundIndex);\n tempText = tempText.replace(answerChar,\"*\");\n }\n return result;\n }", "function show_emoticons() {\n\n // YOUR CODE GOES HERE\n var result = \"\";\n var para_arr_node = document.querySelectorAll(\"#book_chapter ul li p\");\n for(each_para_node of para_arr_node){\n var para_arr = each_para_node.innerText.split(\"\\n\");\n each_para_node.innerHTML = \"\";\n for(each_para of para_arr){\n var word_arr = each_para.split(\" \");\n for(each_word of word_arr){\n //checking if there is a comma, ? or ! in the word\n if(each_word.indexOf(\",\") > -1){\n result += each_word.replace(\",\", String.fromCodePoint(0x2B50));\n }\n else if(each_word.indexOf(\"?\") > -1){\n result += each_word.replace(\"?\", String.fromCodePoint(0x2753));\n }\n else if(each_word.indexOf(\"!\") > -1){\n result += each_word.replace(\"!\", String.fromCodePoint(0x2757));\n }\n else{\n result += each_word + \" \";\n }\n }\n }\n\n each_para_node.innerHTML += result;\n result = \"\";\n }\n\n}", "function findUrls(text) {\n var source = (text || '').toString();\n var urlArray = [];\n var url;\n var matchArray;\n var regexToken = /(((ftp|https?):\\/\\/)[\\-\\w@:%_\\+.~#?,&\\/\\/=]+)|((mailto:)?[_.\\w-]+@([\\w][\\w\\-]+\\.)+[a-zA-Z]{2,3})/g;\n\n while((matchArray = regexToken.exec(source))!== null) {\n var token = matchArray[0];\n if(token.indexOf(\"youtube.com/watch?v=\") !== -1) {\n urlArray.push(token);\n } else if(token.indexOf(\"youtu.be/\") !== -1) {\n urlArray.push(token);\n } else if(token.indexOf(\"dailymotion.com/video/\") !== -1) {\n urlArray.push(token);\n }\n }\n return urlArray;\n}", "function getDomainTextPositions(text){\n\n /* voiski ip checkers */\n const ipv6 = /https?:\\/\\/((([a-fA-F0-9]{1,4}|):){1,7}([a-fA-F0-9]{1,4}|:))/g;\n const ipv4 = /https?:\\/\\/(((25[0-5]|2[0-4]\\d|[01]?\\d{1,2}|\\*)\\.){3}(25[0-5]|2[0-4]\\d|[01]?\\d{1,2}|\\*))/g;\n\n /* generic catch-all for domains */\n const domain = /https?:\\/\\/([\\w\\.:\\-]*)\\/?/g;\n\n if(!text || text === \"\"){\n return;\n }\n\n let ipv4match = ipv4.exec(text);\n let ipv6match = ipv6.exec(text);\n let domainMatch = domain.exec(text);\n\n let full, important = \"\";\n\n if(ipv4match && ipv4match.length > 0){\n important = ipv4match[1];\n full = ipv4match[0];\n } else if(ipv6match && ipv6match.length > 0){\n important = ipv6match[1];\n full = ipv6match[0];\n } else if(domainMatch && domainMatch.length > 0){\n important = domainMatch[1];\n full = domainMatch[0];\n } else {\n return;\n }\n\n const styleOffsetStart = 0;\n const styleOffsetEnd = 6;\n const fullWidth = checkTextWidth(full);\n const importantWidth = checkTextWidth(important);\n const start = fullWidth - importantWidth + styleOffsetStart;\n const end = fullWidth + styleOffsetEnd;\n\n return [start, end];\n }", "function show_emoticons() {\n var list = document.getElementsByClassName(\"list-unstyled\");\n\n if (emo_click_status) {\n console.log(emo_orig_data);\n for (let i = 0; i < list.length; i++) {\n list[i].getElementsByTagName(\"p\")[0].innerHTML = emo_orig_data[i];\n }\n emo_click_status = !emo_click_status;\n return;\n }\n\n var emoji = {\n \",\": \"&#11088;\",\n \"?\": \"&#10067;\",\n \"!\": \"&#10071;\"\n };\n\n for (let i = 0; i < list.length; i++) {\n let para = list[i].getElementsByTagName(\"p\")[0].innerText;\n let words = para.split(\" \");\n if (!emo_click_status) {\n emo_orig_data.push(para);\n }\n let output = [];\n\n for (word of words) {\n // console.log(word);\n let newword = [];\n for (let j = 0; j < word.length; j++) {\n if (word[j] === \",\") {\n newword.push(emoji[\",\"]);\n } else if (word[j] === \"?\") {\n newword.push(emoji[\"?\"]);\n } else if (word[j] === \"!\") {\n newword.push(emoji[\"!\"]);\n } else {\n newword.push(word[j]);\n }\n }\n output.push(newword.join(\"\"));\n }\n\n list[i].getElementsByTagName(\"p\")[0].innerHTML = output.join(\" \");\n\n }\n\n emo_click_status = !emo_click_status;\n // console.log(emo_click_status);\n}", "function replaceEmoticons(text, emotes) {\n return Object.keys(emotes).reduce((result, emote) => {\n return result.replace(new RegExp(RegExpEscape(emote), \"gi\"), function(match) {\n return (img => img != null ? \"<span><img width='auto' height='28px' src='\" + img + \"'/></span>\" : match)(emotes[match])\n });\n }, text);\n}", "function getLetter() {\n const wordLetters = document.querySelectorAll('#current_word .letter-pressed');\n let arr = []\n for (let i = 0; i < wordLetters.length; i++) {\n arr.push(wordLetters[i].textContent);\n // console.log(i);\n }\n return arr\n}", "function getRandomPhraseAsArray(arr) {\n let arrayPosition = Math.floor(Math.random() * arr.length);\n let randomPhrase = arr[arrayPosition];\n let phraseCharacters = [];\n\n for (let i = 0; i < randomPhrase.length; i += 1) {\n phraseCharacters.push(randomPhrase[i]);\n }\n\n return phraseCharacters;\n}", "function makeSpecialArray(){\n var specialArray = [];\n for(var i = 0; i < 15; i++){\n // first set of special characters have an ascii index of 33 - 47\n specialArray[i] = String.fromCharCode(33 + i);\n }\n for(var i = 15; i < 22; i++){\n // second set of special characters have an ascii index of 58 - 64\n specialArray[i] = String.fromCharCode(58 + (i-15));\n }\n for(var i = 22; i < 29; i++){\n // third set of special characters have an ascii index of 91 - 96\n specialArray[i] = String.fromCharCode(91 + (i-23));\n }\n for(var i = 29; i < 33; i++){\n // fourth set of special characters have an ascii index of 123 - 126\n specialArray[i] = String.fromCharCode(123 + (i-29));\n }\n return(specialArray);\n}", "function getAZArray () {\n const result = []\n for (i = 65; i <= 90 ; i++){\n result.push(String.fromCharCode(i))\n }\n return result\n \n }", "function letter(arr2, char){\n let arr = []\n for(let i = 0; i < arr2.length; i++){\n if (arr2[i].includes(char)) {\n arr.push(arr2[i])\n }\n }\n return arr\n}", "function makeArray(word) {\n var word_array = [];\n for (var i = 0; i < word.length; i++) {\n word_array.push(word.charAt(i));\n }\n return word_array;\n }", "function textToArray(text) {\n // Trim newlines at the end.\n while (text.endsWith('\\n')) {\n text = text.substring(0, text.length - 1);\n }\n \n var newArray = text.split('\\n');\n for (var i = 0; i < newArray.length; i++) {\n newArray[i] = newArray[i].split('\\t');\n }\n return newArray;\n}", "autoMode(text) {\n let array = [];\n let splitText = text.split(' ').filter((sub) => (sub !== ''));\n \n if (!splitText) {\n console.error('Something was wrong.');\n return;\n }\n \n while (splitText.length > 0) {\n // split every letter by the spaces x\n let brokeLine = this.autoBreak(splitText);\n \n array.push(brokeLine);\n splitText.splice(0, this.sumLetter());\n }\n \n return array;\n }", "function searchEmoji(answers, input) {\n\tinput = input || '';\n\treturn new Promise(resolve => {\n\t\tsetTimeout(() => {\n\t\t\tlet result = fuzzy.filter(input, require('emojilib').ordered);\n\t\t\tresolve(result.map(el => el.original ));\n\t\t}, 100)\n\t})\n}", "function asciiBoardToArray (ascii) {\n var rows = ascii.split(/\\n/)\n var boardArray = rows.reduce(function (boardArray, row) {\n if (row.indexOf('-') > -1 || row.indexOf('h') > -1) return boardArray\n var rowArray = row.slice(5, 27).split(/\\ +/)\n boardArray.push(rowArray)\n return boardArray\n }, [])\n return boardArray\n}", "function wave(text){\n let finalArray = []\nfor ( let i = 0; i < text.length; i++) {\n let arr = text.split('')\n if (arr[i] === ' ') {\n continue;\n }\n arr[i] = arr[i].toUpperCase()\n\n finalArray.push(arr.join(''))\n}\n return finalArray\n}", "function a(e){var t,i=e?e.indexOf(\"!\"):-1;return i>-1&&(t=e.substring(0,i),e=e.substring(i+1,e.length)),[t,e]}", "function learnAlphabet(text){\n // This just removed the newlines from the input file so they aren't rendered as part of the alphabet\n text = text.replace(/\\r?\\n?/g, '');\n var alphabet = [];\n for(var i = 0; i < text.length; i++){\n if((!alphabet.includes(text.charAt(i))) && (text.charAt(i) !== \"\\n\"))\n alphabet.push(text.charAt(i));\n }\n FINAL_ALPHABET = alphabet;\n $('#acceptedTA').val(\"Alphabet from test file: \" + alphabet);\n}", "function vowelIndices(word){\n\tword = word.toLowerCase();\n\tlet find = word.match(/[a e i o u y]/g);\n\tif(!find) return [];\n\tlet rez = [];\n\tfind.forEach((el,i) => {\n\t\trez.push(word.indexOf(el) + 1);\n\t\tlet regExp = new RegExp(`${el}`);\n\t\tword = word.replace(regExp,'*');\n\t});\n\treturn rez;\n}", "function textToPattern(text)\n{\n var result = [];\n\n for(var i=0; i<text.length; i++)\n {\n if (i != 0) result.push(0x0); // mandatory spacing\n\n switch (text.charAt(i))\n {\n case '0':\n result.push(0x6, 0x9, 0x6);\n break;\n\n case '1':\n result.push(0x4, 0xF);\n break;\n\n case '2':\n result.push(0x5, 0xB, 0x5);\n break;\n\n case '3':\n result.push(0x9, 0x9, 0x6);\n break;\n\n case '4':\n result.push(0xE, 0x3, 0x2);\n break;\n }\n }\n\n return result;\n}", "split(text) {\n text = text.trim();\n let separators = new Set([' ', '\\n', '\\t', '\\v']);\n let i = 0;\n let wordArray = [''];\n for (let j = 0; j < text.length; j++) {\n if (separators.has(text[j])) {\n if (wordArray[i] === \"\") {\n continue;\n } else {\n wordArray[++i] = \"\";\n }\n } else {\n wordArray[i] += text[j];\n }\n }\n let ultimaPalabra = wordArray[wordArray.length - 1];\n if (ultimaPalabra == \"\" || separators.has(ultimaPalabra[ultimaPalabra.length - 1])) {\n wordArray.pop();\n }\n return wordArray;\n }", "function splitTextToCharacters(text) {\n return Array.from ? Array.from(text) : text.split('');\n}", "function extractEmails(text) {\n return text.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\\.[a-zA-Z0-9._-]+)/gi);\n}", "function split(text) {\n\t\t\t\tvar len = text.length;\n\t\t\t\tvar arr = [];\n\t\t\t\tvar i = 0;\n\t\t\t\tvar brk = 0;\n\t\t\t\tvar level = 0;\n\n\t\t\t\twhile (i + 2 <= len) {\n\t\t\t\t\tif (text.slice(i, i + 2) === '[[') {\n\t\t\t\t\t\tlevel += 1;\n\t\t\t\t\t\ti += 1;\n\t\t\t\t\t} else if (text.slice(i, i + 2) === ']]') {\n\t\t\t\t\t\tlevel -= 1;\n\t\t\t\t\t\ti += 1;\n\t\t\t\t\t} else if (level === 0 && text[i] === ',' && text[i - 1] !== '\\\\') {\n\t\t\t\t\t\tarr.push(text.slice(brk, i).trim());\n\t\t\t\t\t\ti += 1;\n\t\t\t\t\t\tbrk = i;\n\t\t\t\t\t}\n\t\t\t\t\ti += 1;\n\t\t\t\t}\n\t\t\t\tarr.push(text.slice(brk, i + 1).trim());\n\t\t\t\treturn arr;\n\t\t\t}", "function findHiatos(aWSplitted){\n\tvar hiatosIndex = []\n\tfor (var i = 0; i < aWSplitted.length; i++) {\n\t\t//finds if there is an open vowel\n\t\tfor (var e = 0; e < openVowels.length; e++) {\n\t\t\tif (aWSplitted[i] === openVowels[e]) {\n\t\t\t\tfor (var o = 0; o < openVowels.length; o++) {\n\t\t\t\t\tif (aWSplitted[i+1] === openVowels[o]) {\n\t\t\t\t\t\thiatosIndex.push(i)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\n\t//eliminates duplicates caused by two closed vowels diptongos\n\tvar uniqueArray = hiatosIndex.filter(function(item, pos) {\n\t return hiatosIndex.indexOf(item) == pos;\n\t})\n\n\treturn uniqueArray\n}", "get engines() {\n var engines = [ ];\n var tree = this.getElement({type: \"engine_list\"}).getNode();\n\n for (var ii = 0; ii < tree.view.rowCount; ii ++) {\n engines.push({name: tree.view.getCellText(ii, tree.columns.getColumnAt(0)),\n keyword: tree.view.getCellText(ii, tree.columns.getColumnAt(1))});\n }\n\n return engines;\n }", "fenToArray(fen){\r\n var tmp = fen.split(\"\");\r\n var board = [];\r\n\r\n for(let i=0; i<tmp.length;i++){ \r\n if(tmp[i] === \" \") break; // array is completed\r\n if(tmp[i] === \"/\") continue; // next line, skip /\r\n else{\r\n var number = Number(tmp[i]);\r\n if(!isNaN(number) ){ // Numbers represents empty squares, wich we fill with Null \r\n for(let j=0; j<number;j++) board.push(null)\r\n } else{ // we found a piece, add it as tuple to the array (piece, color)\r\n //var piece;\r\n if(tmp[i] === tmp[i].toLowerCase()) board.push([tmp[i], \"b\"])\r\n else board.push([tmp[i], \"w\"])\r\n }\r\n }\r\n }\r\n return board;\r\n }", "function VowelOrConsonant(analizedWord){\n\tvar wordProcesed = []\n\t//tests every letter of the word\n\tfor (var i = 0; i < analizedWord.length; i++) {\n\t\tvar letterRecognized = false\n\t\tvar isVowel = false\n\t\t//againts every vowel\n\t\tfor (var e = 0; e < vowels.length; e++) {\n\t\t\t//is a vowel?\n\t\t\tif (vowels[e] === analizedWord[i] ) {\n\t\t\t\tisVowel = true\n\t\t\t} \n\t\t}\n\n\t\t//if it istn a vowel, its a consonant\n\t\tif (isVowel === false) {\n\t\t\t// console.log('consonante')\n\t\t\twordProcesed.push('c')\n\t\t}\n\n\t\t//if its a vowel, its closed?\n\t\tif (isVowel) {\n\t\t\tfor (var d = 0; d < closedVowels.length; d++) {\n\t\t\t\tif(closedVowels[d]===analizedWord[i] && letterRecognized ===false){\n\t\t\t\t\twordProcesed.push('vC')\n\t\t\t\t\tletterRecognized = true\n\t\t\t\t} \n\t\t\t} \n\t\t\tif (letterRecognized === false){\n\t\t\t\t\twordProcesed.push('vO')\n\t\t\t\t\tletterRecognized = true\n\t\t\t}\n\t\t}\n\t}\n\treturn wordProcesed\n}", "function getTextArr() {\n //TODO: pull texts from json\n\n return {\n Support: [\"Красавчик\", \"Так держать\", \"Хочешь я дам тебе миллион долларов?\"],\n Progress: [\"Хватит в игры играть\", \"Иди работай\"]\n };\n}", "function replaceEmoticons(text){\n var emoticons ={\n ':)': '<div class=\"smile1 emoImgDiv\" data-value=\"smile\"></div>',\n ':|': '<div class=\"smile2 emoImgDiv\" data-value=\"neutral\"></div>',\n ':-)': '<div class=\"smile3 emoImgDiv\" data-value=\"blush\"></div>',\n ':-$': '<div class=\"smile4 emoImgDiv\" data-value=\"confused\"></div>',\n ':-@': '<div class=\"smile5 emoImgDiv\" data-value=\"angry\"></div>',\n '(y)': '<div class=\"smile6 emoImgDiv\" data-value=\"like\"></div>',\n }\n \n for(var key in emoticons){\n text = text.replace(key, emoticons[key]);\n }\n \n return text;\n }", "function extractEntities(text) {\n return text.split(/[ \\t\\n\\r\\.\\?!,;]+/)\n .sort(function (a, b) { return b.length - a.length; })\n .slice(0, maxEntityCount);\n}", "function _ep_str_matches(str) {\n var matches = str.match(/(s\\d+e\\d+)p0*(\\d+)/i);\n if(matches != null)\n return matches;\n //try to do looser matches\n matches = str.match(/(s(eason)? ?\\d+ ?ep? ?\\d+)/i);\n if(matches == null) return null;\n //match part x of y and stuff\n var temp = str.match(/(\\(| )(part )?0*(\\d+)((\\/| of )\\d+)?/gi);\n if(temp == null || temp.length == 0) return null;\n var last_nums = temp[temp.length - 1];\n if(last_nums == undefined) return null; //? this happened..\n temp = last_nums.match(/0*(\\d+)/);\n if(temp == null) return null;\n matches[2] = temp[1];\n return matches;\n}", "function getIgnoreKeywords_onomatopoeia_singles() {\n\t\tvar onolist = [];\n\t\t\n\t\tvar pieces = getIgnoreKeywords_onomatopoeia_singleLetter();\n\t\tvar pieceslength = pieces.length;\n\t\t\n\t\tfor(var i = 0; i < pieceslength; i++) {\n\t\t\tvar piece = pieces[i];\n\t\t\tonolist = onolist.concat(getIgnoreKeywords_onomatopoeia_singles_list({'ono':piece}));\n\t\t}\n\t\t\n\t\treturn onolist;\n\t}", "function getRandomPhraseAsArray () {\n var result= phrase[Math.floor(Math.random() * phrase.length)]; \n result = result.split(\"\");\n return result;\n}", "function parseraw(s) {\n const m = s.match(/^n(\\d+)h(\\d+)c(\\d+)p(\\w+)$/)\n if (m===null) return [2, 0, 0, 1/2]\n return [parseInt(m[1]), parseInt(m[2]), parseInt(m[3]), pdec(m[4])]\n}", "function getRandomPhraseAsArray(phr) {\n const randomPhrase = phr[Math.floor(Math.random()*phr.length)];\n const splitRandomPhrase = randomPhrase.split(\"\");\n return splitRandomPhrase;\n}", "function getAnaphoraCount() {\r\n text = workarea.textContent;\r\n anaphora_candidates = [];\r\n first_index = 0;\r\n last_index = 0;\r\n for(i=0; i < sentences.length-1; i++) {\r\n if(sentences[i] == \"`I must.\") debugger;\r\n first_word = sentences[i].match(/\\S+/)[0];\r\n check_higher_case = first_word.match(/[A-ZА-ЯЁ]/);\r\n if(check_higher_case == null) {\r\n continue;\r\n }\r\n if(first_word.match(\"Chapter\") != null || first_word.toLowerCase() == \"a\" || first_word.toLowerCase() == \"an\" || first_word.toLowerCase() == \"the\") {\r\n continue;\r\n }\r\n first_index = i;\r\n last_index = first_index;\r\n for(j=i+1; j<sentences.length; j++) {\r\n if(first_word == sentences[j].match(/\\S+/)[0]) {\r\n last_index = j;\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n if(last_index > first_index) {\r\n tmp = [];\r\n for(first_index; first_index <= last_index; first_index++) {\r\n tmp.push(sentences[first_index]);\r\n }\r\n anaphora_candidates.push([first_word, tmp]);\r\n i = last_index;\r\n }\r\n }\r\n flag = true;\r\n if(anaphora_candidates.length !=0) {\r\n while(flag) {\r\n control_array = [];\r\n for(i=0; i<anaphora_candidates.length; i++) {\r\n first_words = new RegExp(anaphora_candidates[i][0].replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\") + \"((\\\\.|\\\\!){3}|\\\\.|\\\\?|\\\\!){0,1}\\\\s\\\\S+\");\r\n if(anaphora_candidates[i][1][0].match(first_words) != null) {\r\n first_words = anaphora_candidates[i][1][0].match(first_words)[0];\r\n tmp = [];\r\n for(j=0; j < anaphora_candidates[i][1].length; j++) {\r\n if(anaphora_candidates[i][1][j].match(first_words.replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\")) != null) {\r\n tmp.push(true);\r\n }\r\n else {\r\n tmp.push(false);\r\n }\r\n }\r\n control_array.push(tmp);\r\n if(tmp.indexOf(false) == -1) {\r\n anaphora_candidates[i][0] = first_words;\r\n }\r\n }\r\n }\r\n \r\n for(i=0; i<control_array.length; i++) {\r\n if(control_array[i].indexOf(false) != -1) {\r\n control_array[i] = false;\r\n }\r\n else {\r\n control_array[i] = true;\r\n }\r\n }\r\n if(control_array.indexOf(false) != -1){\r\n flag = false;\r\n }\r\n else {\r\n flag = true;\r\n }\r\n }\r\n\r\n\r\n flag = true;\r\n while(flag) {\r\n control_array = [];\r\n for(i=0; i<anaphora_candidates.length; i++) {\r\n first_words = new RegExp(anaphora_candidates[i][0].replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\") + \"((\\\\.|\\\\!){3}|\\\\.|\\\\?|\\\\!){0,1}\\\\s\\\\S+\");\r\n if(anaphora_candidates[i][1][0].match(first_words) != null) {\r\n first_words = anaphora_candidates[i][1][0].match(first_words)[0];\r\n tmp = [];\r\n for(j=0; j < anaphora_candidates[i][1].length; j++) {\r\n if(anaphora_candidates[i][1][j].match(first_words.replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\")) != null) {\r\n tmp.push(true);\r\n }\r\n else {\r\n tmp.push(false);\r\n }\r\n }\r\n control_array.push(tmp);\r\n if(tmp.indexOf(false) == -1) {\r\n anaphora_candidates[i][0] = first_words;\r\n }\r\n }\r\n }\r\n for(i=0; i<control_array.length; i++) {\r\n if(control_array[i].indexOf(false) != -1) {\r\n\r\n control_array[i] = true;\r\n }\r\n else {\r\n control_array[i] = false;\r\n }\r\n }\r\n if(control_array.indexOf(false) == -1){\r\n flag = false;\r\n }\r\n else {\r\n flag = true;\r\n }\r\n\r\n }\r\n }\r\n temp = [];\r\n for(i=0; i<anaphora_candidates.length; i++) {\r\n anaphora_length = anaphora_candidates[i][0].split(\" \").length;\r\n count = 0;\r\n for(j=0; j<anaphora_candidates[i][1].length; j++) {\r\n if(anaphora_candidates[i][1][j].split(\" \").length == anaphora_length && anaphora_length < 5) {\r\n count++;\r\n }\r\n }\r\n if (count!=anaphora_candidates[i][1].length) {\r\n temp.push(anaphora_candidates[i])\r\n }\r\n }\r\n anaphora_candidates = temp;\r\n for(i=0; i<anaphora_candidates.length; i++) {\r\n if(anaphora_candidates[i][0][anaphora_candidates[i][0].length-1] == \".\") {\r\n anaphora_candidates[i][0] = anaphora_candidates[i][0].substring(0, anaphora_candidates[i][0].length-1);\r\n }\r\n }\r\n result = anaphora_candidates;\r\n return result.length\r\n}", "init() {\n const emoticons = config.markup.emoticons;\n\n this.emoticonSets = Object.keys(emoticons).map((set) => {\n return emoticons[set];\n });\n\n const groups = this.emoticonSets.map((set) => {\n const codes = Object.keys(set.codes).map((code) => {\n // Escape all meta-characters for regular expressions: ^$*+?.|()[]{}.\n return code.replace(/[\\^\\$\\*\\+\\?\\.\\|\\/\\(\\)\\[\\]\\{\\}\\\\]/g, '\\\\$&')\n });\n\n // The sub-expression for the set matches any single emoticon in it.\n return '(' + codes.join('|') + ')';\n });\n\n // The complete expression matches any single emoticon from any set.\n this.emoticonRegex = new RegExp(groups.join('|'), 'g');\n }", "function parse(array){\n let result = [];\n let word = [];\n let first;\n const len = array.length;\n for (let i = 0; i < len; i++){\n let sound_ = sound(array[i]);\n if (isFirst(i, array)) word.push(array[i].toUpperCase());\n if (sound_ && sound_ !== ' ' && isDifferent(i, array, word) && !(isFirst(i, array))) word.push(sound_);\n if (isEnd(i, array)) {\n Array.prototype.push.apply(result, pad(word));\n word = [];\n }\n if (sound_ === ' ') result.push(sound_);\n }\n return result.join(''); \n}", "function findDiptongos(aWSplitted){\n\tvar diptongosIndex = []\n\tfor (var i = 0; i < aWSplitted.length; i++) {\n\t\t//finds if there is a closed vowel\n\t\tif (aWSplitted[i] === 'i' || aWSplitted[i] === 'u' ) {\n\t\t\tfor (var e = 0; e < vowels.length; e++) {\n\t\t\t\t//finds if there is a vowel before the closed vowel\n\t\t\t\tif (aWSplitted[i-1]=== vowels[e] ) {\n\t\t\t\tdiptongosIndex.push(i-1)\n\t\t\t\t//finds if there is a vowel after the closed vowel\n\t\t\t\t} else if (aWSplitted[i+1]=== vowels[e]){\n\t\t\t\t\t////console.log('hay diptongo vocal abierta despues, ', aWSplitted[i-1],aWSplitted[i+1] )\n\t\t\t\t\tdiptongosIndex.push(i)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t//eliminates duplicates caused by two closed vowels diptongos\n\tuniqueArray = diptongosIndex.filter(function(item, pos) {\n\t return diptongosIndex.indexOf(item) == pos;\n\t})\n\n\treturn uniqueArray\n}", "async function analyzeEntitiesOfText(array_text) {\n let result = [];\n try {\n for (let t of array_text) {\n const document = {\n content: t,\n type: \"PLAIN_TEXT\"\n };\n\n let results = await client.analyzeEntities({ document });\n\n const entities = results[0].entities;\n // console.log(\"Entities:\", JSON.stringify(entities));\n for (let entity of entities) {\n if (isPronoun(entity.name)) {\n if (\n (result[entity.name] == null) |\n (result[entity.name] == undefined)\n ) {\n result[entity.name] = { name: entity.name, salience: new Array() };\n result[entity.name].salience.push(entity.salience);\n result[entity.name].type = entity.type;\n } else {\n result[entity.name].salience.push(entity.salience);\n }\n if (entity.metadata && entity.metadata.wikipedia_url) {\n result[entity.name].wiki = entity.metadata.wikipedia_url;\n // console.log(` - Wikipedia URL: ${entity.metadata.wikipedia_url}$`);\n }\n }\n\n console.log(JSON.stringify(entity));\n }\n }\n } catch (err) {\n console.log(err);\n }\n\n return scoreAggregation(result);\n}", "function vowelsAndConsonants(s) {\n let vowels = [], cons = [];\n const all_vowels = ['a', 'e', 'i', 'o', 'u'];\n let c = '';\n var i;\n for (i = 0; i < s.length; i++) {\n c = s[i];\n if (all_vowels.includes(c)) {\n vowels.push(c);\n } else {\n cons.push(c);\n }\n }\n for (i = 0; i < vowels.length; i++) {\n console.log(vowels[i])\n }\n for (i = 0; i < cons.length; i++) {\n console.log(cons[i])\n }\n}", "function createArrayFromPhrase(phrase) {\n const splitPhrase = phrase.split(' ');\n const thirdWord = splitPhrase.pop();\n return [splitPhrase.join(' '), thirdWord];\n}", "function splitTextTo3DArray(textes) {\r\n\tlet textArray = textes.split(\"\\t\");\r\n\treturn textArray;\r\n}", "function makeToChars(text) {\n var words = [];\n //spliting text into words\n var wordArray = text.split(' ');\n //spliting words into characters\n for (var i=0; i < wordArray.length; i++) {\n words[i] = wordArray[i].split('');\n }\n return words;\n}", "function grabIgnoreRanges(text) {\n\t\tlet ranges = [];\n\t\tlet regex = /(?:\\[\\[[^\\]]+\\]\\]|\\[\\[[^\\|]+\\|[^\\]]*\\]\\]|<(gallery)>[\\s\\S]*?<\\/\\1>)/g;\n\t\tlet match;\n\n\t\twhile ((match = regex.exec(text)) !== null) {\n\t\t\tranges.push({\n\t\t\t\tstart: match.index,\n\t\t\t\tend: match.index + match[0].length\n\t\t\t});\n\t\t}\n\n\t\treturn ranges;\n\t}", "function encriptar(contenido){\n let cadena = text.match(/[\"].*[\"]|['].*[']/gm);\n let a, e, i, o, u, final;\n var encriptado = new Array();\n for (let x=0; x<cadena.length; x++) {\n a = cadena[x].replace(/a/gim, \"9\");\n e = a.replace(/e/gim, \"0\");\n i = e.replace(/i/gim, \"7\");\n o = i.replace(/o/gim, \"3\");\n u = o.replace(/u/gim, \"5\");\n final = u.replace(/[ ]/g, \"1\");\n encriptado[x]= final;\n }\n let newact1 = text.replace(cadena[0], encriptado[0]);\n let newact2 = newact1;\n for (let x=1; x<cadena.length; x++) {\n newact2 = newact2.replace(cadena[x], encriptado[x]);\n }\n document.getElementById(\"contenido-archivo\").innerHTML = newact2;\n}", "function emailParts(email) {\n email_string = email.toLowerCase();\n return email_string.split('@');\n}", "get engines()\n {\n var engines = [ ];\n var popup = this.getElement({type: \"searchBar_dropDownPopup\"});\n\n for (var ii = 0; ii < popup.getNode().childNodes.length; ii++) {\n var entry = popup.getNode().childNodes[ii];\n if (entry.className.indexOf(\"searchbar-engine\") != -1) {\n engines.push({name: entry.id,\n selected: entry.selected,\n tooltipText: entry.getAttribute('tooltiptext')\n });\n }\n }\n\n return engines;\n }", "function vowels(str) {\n\tlet arr = str.split('')\n\tlet newArr = []\n\tlet count = 0\n\n\tlet vowelObj = { a: true, e: true, i: true, o: true, u: true}\n\n\tfor (let i = 0; i < arr.length; i++) {\n\t\t// vowelObj['a']\n\t\tif (vowelObj[arr[i]]) {\n\t\t\tcount += 1\n\t\t} \n\t}\n\n\t// for (let i = 0; i < arr.length; i++) {\n\t// \t// includes\n\t// \tif (vowelArr.includes(arr[i])) {\n\t// \t\tnewArr.push(arr[i])\n\t// \t}\n\t// }\n\treturn count\n}", "getAnswerKey() {\n var result = [];\n (this.text).split(\"\").forEach(function(element){\n if(!(result.includes(element))) {\n result.push(element.toLowerCase());\n }\n })\n return result;\n }", "function is_emoticon(str){\r\n\t\r\n\t //Check conventional left-to-right emoticons\r\n\tvar result = (check_emoticon(str, 0, 1, 0, 1, false) || \r\n\t\t\t\t check_emoticon(str, 0, 1, 1, 1, false) ||\r\n\t\t\t\t check_emoticon(str, 1, 1, 0, 1, false) ||\r\n\t\t\t\t check_emoticon(str, 1, 1, 1, 1, false) ||\r\n\t\t\t\t \r\n\t\t\t\t //Check inverse emoticons\r\n\t\t\t\t check_emoticon(str, 1, 0, 1, 0, true) ||\r\n\t\t\t\t check_emoticon(str, 1, 1, 1, 0, true) ||\r\n\t\t\t\t check_emoticon(str, 1, 0, 1, 1, true) ||\r\n\t\t\t\t check_emoticon(str, 1, 1, 1, 1, true) ||\r\n\t\t\t\t \r\n\t\t\t\t //Check Eastern emoticons, with and without sides\r\n\t\t\t\t check_eastern_emoticon(str, 0, 1, 1, 1, 0) ||\r\n\t\t\t\t check_eastern_emoticon(str, 1, 1, 1, 1, 1) ||\r\n\t\t\t\t \r\n\t\t\t\t //Check emoticons that are valid but not in a standard format\r\n\t\t\t\t check_exception_emoticon(str));\r\n\t\r\n\treturn print(result);\r\n}", "function splitContents(text) {\n // split the slides apart\n var slides = text.split('\\n#');\n\n // handle the special cases of starting with a newline or whitespace\n if (text.startsWith('\\n'))\n slides = slides.slice(1);\n else\n slides[0] = slides[0].slice(1);\n\n // add the # character back to the start of each bit of text\n for (let i in slides) \n slides[i] = '#'.concat(slides[i]);\n return slides;\n}", "function N(e,t,a){var n=[],r=t.line;return e.iter(t.line,a.line+1,function(e){var f=e.text;r==a.line&&(f=f.slice(0,a.ch)),r==t.line&&(f=f.slice(t.ch)),n.push(f),++r}),n}", "function extractEmails ( text ){\n var myRegexp = /([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\\.[a-zA-Z0-9._-]+)/gi;\n email = text.match(myRegexp);\n if(email!==null){\n for (var i = 0; i < email.length; i++) {\n var newString = email[i].replace('@','');\n if(i==0){\n emailtransform = '\"'+newString+'\"';\n }else{\n emailtransform = emailtransform + \",\"+'\"'+newString+'\"';\n }\n //students.push(newString);\n }\n }else{\n emailtransform = '';\n }\n \n }", "analyze(text) {\n this.text = this.purify(text);\n this.index = 0;\n this.list = [];\n this.buffer = \"\";\n\n while (this.index < this.text.length) {\n this.state.transference(this.index, true);\n }\n return this.list;\n }", "function espaciosinifin(texto){\n var string = texto;\n var caracter;\n caracter = string.substr(0,1);\n while(caracter == \" \"){\n string = string.substr(1,string.length);\n caracter = string.substr(0,1);\n }\n \n caracter = string.substr(string.length-1,1);\n while(caracter == \" \"){\n string = string.substr(0,string.length-1);\n caracter = string.substr(string.length-1,1);\n }\n \n return string;\n }", "function espaciosinifin(texto){\n var string = texto;\n var caracter;\n caracter = string.substr(0,1);\n while(caracter == \" \"){\n string = string.substr(1,string.length);\n caracter = string.substr(0,1);\n }\n \n caracter = string.substr(string.length-1,1);\n while(caracter == \" \"){\n string = string.substr(0,string.length-1);\n caracter = string.substr(string.length-1,1);\n }\n \n return string;\n }", "function tavuta(s) {\n\t var end = s.length;\n\t var res = [];\n\t\n\t for (var i = s.length - 1; i >= 0; i -= 1) {\n\t var subs = s.substring(i, end);\n\t\n\t if (isConsonant(subs[0]) && isVowel(subs[1])) {\n\t res.push(subs);\n\t end = i;\n\t } else if (isVowel(subs[0]) && isVowel(subs[1])) {\n\t if (subs[0] !== subs[1] && !isDipthong(subs)) {\n\t res.push(subs.substring(1));\n\t end = i + 1;\n\t }\n\t } else if (i === 0) {\n\t res.push(subs);\n\t }\n\t }\n\t\n\t return res.reverse();\n\t}", "function decipher(decipherPhrase) {\r\n var upperDeciphPhrase = decipherPhrase.toUpperCase(); // pasamos la frase a descifrar a mayusculas para unificar\r\n var arrayDecipher = []; // para ingresar todos los valores una vez que tengamos nuestra 'cadena' de caracteres\r\n for (var i = 0; i < upperDeciphPhrase.length; i++) { // para recorrer mi frase ya en mayuscula y trabajar con lo entregado\r\n // console.log(upperDeciphPhrase[i]);\r\n var codeAscii = upperDeciphPhrase.charCodeAt(i); // sacamos el codigo ascii de la letra para utilizarlo en nuestro codigo\r\n var formDecipher = (codeAscii + 65 - 33) % 26 + 65; // la cambiamos a -n ya que ahora necesitamos su desplazamiento inverso\r\n var asciiToStr = String.fromCharCode(formDecipher); // obtenemos la letra correspondiente a el numero ascii obtenido\r\n // ahora usamos nuestro array vacio para ingresar los valores obtenidos en forma de array\r\n arrayDecipher.push(asciiToStr); // ['A','B','C',]\r\n console.log(arrayDecipher);\r\n var strFromArray = arrayDecipher.join(''); // ABC\r\n }\r\n return alert('Su mensaje es ' + strFromArray);\r\n }", "function getHashTags(inputText) {\n var regex = /(?:^|\\s)(?:#)([a-zA-Z\\d]+)/gm;\n var matches = [];\n var match;\n\n while((match = regex.exec(inputText))) {\n matches.push(match[1]);\n }\n\n return matches;\n}", "function translatePigLatin(str) {\n if(str.match(/^[aeiou]/)){\n return str + 'way'\n } else if (str.match(/[^aeiou]+$/gi)){\n console.log('a') \n } \n let newArr = []\n let arr = str.split(/([aeiou].*)/)\n newArr.push(arr[1], arr[0] + 'ay')\n str = newArr.join('')\n return str\n}", "function creatingArray(expression) {\r\n // initial variables declared\r\n var operator = '/*+-^';\r\n var nonOperator = '/*^';\r\n var term = '';\r\n\r\n // iteration to loop through the string\r\n for (var i = 0, j; j = expression.charAt(i); i++) {\r\n // first if statement to check for a number, also works for decimal places\r\n if ((!isNaN(j) || (j == '.')) && (expression.charAt(i + 1) != '.' || operator.indexOf(expression.charAt(i + 1) == -1)))\r\n {\r\n term += j;\r\n\r\n // Second if statement to check how big the number is by looking for the next operator inline\r\n if (operator.indexOf(expression.charAt(i + 1)) > -1) {\r\n var k = 0;\r\n // Checking the term variable for multiple decimal places\r\n for (var g = 0, h; h = term.charAt(g); g++) {\r\n if (h == '.') {\r\n k++;\r\n }\r\n // Condition if too many decimal places are detected thus the initial expression format is incorrect\r\n if (k > 1) {\r\n incorrectFormat = 1;\r\n return false;\r\n }\r\n\r\n\r\n }\r\n // pushes the term to the array\r\n //expressionArray.push(parseFloat(term));\r\n\r\n if (!isNaN(j))\r\n {\r\n expressionArray.push(term);\r\n }\r\n else\r\n {\r\n expressionArray.push(term);\r\n }\r\n }\r\n\r\n // continues the loop if the term within the string is larger than a single digit\r\n else {\r\n continue;\r\n }\r\n }\r\n\r\n // Checks the current location for two negative signs to form a positive sign\r\n else if ((operator.indexOf(j) == 3 && expression.charAt(i + 1) == '-') || (operator.indexOf(j) == 2 && expression.charAt(i + 1) == '+') || (operator.indexOf(j) == 3 && expression.charAt(i - 1) == '-') || (operator.indexOf(j) == 2 && expression.charAt(i - 1) == '+')) {\r\n // Checks whether previous element already contains an operator\r\n if (expressionArray[expressionArray.length - 1] == operator.charAt(2) || expressionArray[expressionArray.length - 1] == operator.charAt(3)) {\r\n expressionArray.pop();\r\n }\r\n\r\n expressionArray.push('+');\r\n term = '';\r\n continue;\r\n }\r\n\r\n\r\n // Checks the current location for alternate minus and positive signs to form a negative sign\r\n else if ((operator.indexOf(j) == 2 && expression.charAt(i + 1) == '-') || (operator.indexOf(j) == 3 && expression.charAt(i + 1) == '+') || (operator.indexOf(j) == 2 && expression.charAt(i - 1) == '-') || (operator.indexOf(j) == 3 && expression.charAt(i - 1) == '+')) {\r\n // Checks whether previous element already contains an operator\r\n if (expressionArray[expressionArray.length - 1] == operator.charAt(3) || expressionArray[expressionArray.length - 1] == operator.charAt(2)) {\r\n expressionArray.pop();\r\n }\r\n expressionArray.push('-');\r\n term = '';\r\n continue;\r\n }\r\n\r\n // Checks for a valid operator and empties the term variable\r\n else if (operator.indexOf(j) > -1 && nonOperator.indexOf(expression.charAt(i + 1)) == -1)\r\n {\r\n\r\n expressionArray.push(j);\r\n term = '';\r\n\r\n //Checks for any negative signs after current operator\r\n if (expression.charAt(i + 1) == '-') {\r\n term += '-';\r\n i++;\r\n continue;\r\n }\r\n // Checks for any postive signs after current operator\r\n if (expression.charAt(i + 1) == '+') {\r\n term += '+';\r\n i++;\r\n continue;\r\n }\r\n }\r\n\r\n // Checks for invalid characters for this calculator\r\n else {\r\n incorrectFormat = 1;\r\n return false;\r\n }\r\n\r\n }\r\n\r\n // Checks for an ambiguous minus sign at the beginning of the array, usually means the first term was negative\r\n if (expressionArray[0] == '-') {\r\n var firstElement = '-' + expressionArray[1];\r\n expressionArray.splice(0, 2, firstElement);\r\n }\r\n //console.log(expressionArray);\r\n return expressionArray // Returning the array to pass into the second function\r\n }", "function getLinks(text) {\n return Array.from(text.match(/(http|www)[A-Za-z\\d-\\._~:\\/?#\\[\\]@!\\$&\\+;=]+/gm) || []);\n}", "function formatText(string) {\n var outputArray = [];\n string.split(\"\\n\").forEach(function(url) {\n outputArray.push(new RegExp(url));\n });\n return outputArray;\n}", "function partes_relacion(expresion) {\n\tvar objeto = [];\n\tvar text = \"\";\n\tvar partes = \"\";\n\tvar hacer = false;\n\n\tfor (var i = 0; i < expresion.length; i++) \n\t{\n\t\t/*\n\t\t\tcuando encuentra un partesis derecho parte por comas el text acomulado\n\t\t\ty guarda en el arreglo un object con atributo izquierda y derecha y vacia el text\n \t\t*/\n\t\tif(expresion.charAt(i)===')')\n\t\t{\n\t\t\thacer = false;\n\t\t\tpartes = text.split(\",\");\n\t\t\tobjeto.push({izquierda:partes[0],derecha:partes[1],valor:partes[2]});\n\t\t\ttext = \"\";\n\n\t\t}\n\t\t//cuando encuentra parentesis izquierdo habilita hacer para guardar el acomulado de string\n\t\tif(expresion.charAt(i)==='(')\n\t\t{\n\t\t\ti++;\n\t\t\thacer = true;\n\t\t}\n\t\t//guarda texto acomulado\n\t\tif(hacer)\n\t\t{\n\t\t\ttext = text + expresion.charAt(i);\n\t\t}\n\t}\t \n\t return objeto; \n}", "function vowelLocator(word) {\n var array = [];\n characters = word.split('');\n characters.forEach(function(character) {\n if (vowelChecker(character) === true) {\n array.push(true);\n } else if (vowelChecker(character) === false) {\n array.push(false);\n };\n });\n var indexMarker = array.indexOf(true);\n return indexMarker;\n }", "function detectEntities(entityArray) {\n var locatedEntities = ['', '', '', '', ''];\n var resultArray = [];\n\n var paperNameEntity = builder.EntityRecognizer.findEntity(entityArray, 'PaperName');\n var paperCodeEntity = builder.EntityRecognizer.findEntity(entityArray, 'PaperCode');\n var paperMajorEntity = builder.EntityRecognizer.findEntity(entityArray, 'Major');\n var paperLevelEntity = builder.EntityRecognizer.findEntity(entityArray, 'Level/Year');\n\n locatedEntities = [paperNameEntity, paperCodeEntity, paperMajorEntity, paperLevelEntity];\n\n console.log(locatedEntities);\n\n for (var i = 0; i < locatedEntities.length; i++) {\n if (locatedEntities[i] != null) {\n resultArray[i] = locatedEntities[i].entity;\n } else {\n resultArray[i] = '';\n }\n }\n\n return resultArray;\n}", "function toGlyphs(lines) {\n var glyphs = [];\n while (g = nextGlyph(lines)) {\n glyphs.push(g);\n }\n return glyphs;\n }", "function vowelsAndConsonants(s) {\n let consArr = [];\n let i = 0;\n while (i < s.length) {\n if (\n s.charAt(i) === \"a\" ||\n s.charAt(i) === \"e\" ||\n s.charAt(i) === \"i\" ||\n s.charAt(i) === \"o\" ||\n s.charAt(i) === \"u\"\n ) {\n console.log(s.charAt(i));\n i++;\n } else {\n consArr.push(s.charAt(i));\n i++;\n }\n }\n let consVals = consArr.values();\n for (const value of consVals) {\n console.log(value);\n }\n}", "function getIgnoreKeywords_onomatopoeia_doubles() {\n\t\tvar onolist = [];\n\t\t\n\t\tvar pieces = getIgnoreKeywords_onomatopoeia_doubleLetter();\n\t\tvar pieceslength = pieces.length;\n\t\t\n\t\tfor(var i = 0; i < pieceslength; i++) {\n\t\t\tvar piece = pieces[i];\n\t\t\tonolist = onolist.concat(getIgnoreKeywords_onomatopoeia_doubles_list({'ono':piece}));\n\t\t}\n\t\t\n\t\treturn onolist;\n\t}", "function removeSpecialCharStringArray(text) {\n const token = tokenizer.tokenize(text);\n token.forEach(() => {\n text = text.replace('ç', 'c').replace('ê', 'e')\n .replace('é', 'e').replace('á', 'a')\n .replace('ã', 'a').replace('â', 'a').replace('õ', 'o');\n })\n return text;\n}", "function getPatternsArrayFromInput(pattern) {\n return pattern.split(\";\").map(x => x.trim()).filter(x => !!x);\n}", "parseCSIBuffer() {\n var entries = [];\n var currentEntry = \"\";\n for (let c of this.csiBuffer) {\n if (c == ';') {\n if (currentEntry.length == 0) {\n entries.push(0);\n }\n entries.push(Number(currentEntry));\n currentEntry = \"\";\n }\n else if (c.charCodeAt(0) <= 0x39) {\n currentEntry += c;\n }\n else {\n return [];\n }\n }\n\n if (currentEntry.length != 0) {\n entries.push(Number(currentEntry));\n }\n else {\n entries.push(0);\n }\n\n return entries;\n }", "function parse_interpol(value) {\n const items = [];\n let pos = 0;\n let next = 0;\n let match;\n\n while (true) {\n // Match up to embedded string\n next = value.substr(pos).search(embedder);\n if (next < 0) {\n if (pos < value.length) {\n items.push(JSON.stringify(value.substr(pos)));\n }\n break;\n }\n items.push(JSON.stringify(value.substr(pos, next)));\n pos += next;\n\n // Match embedded string\n match = value.substr(pos).match(embedder);\n next = match[0].length;\n if (next < 0) {\n break;\n }\n if (match[1] === '#') {\n items.push(`${escaperName}(${match[2] || match[3]})`);\n } else {\n // unsafe!!!\n items.push(match[2] || match[3]);\n }\n\n pos += next;\n }\n\n return items.filter(part => part && part.length > 0).join(' +\\n');\n}" ]
[ "0.58446383", "0.5692288", "0.5643362", "0.5239981", "0.5211952", "0.52095336", "0.51864654", "0.5185215", "0.5150428", "0.51325995", "0.5126138", "0.5120027", "0.51147413", "0.5112623", "0.51062834", "0.5054987", "0.50448465", "0.50188386", "0.50021935", "0.4973537", "0.4964036", "0.49520063", "0.49502805", "0.4945269", "0.49403444", "0.49365115", "0.49291736", "0.492048", "0.4899236", "0.48841172", "0.48742864", "0.4850456", "0.48233843", "0.4810574", "0.47920492", "0.47787705", "0.4773653", "0.47724938", "0.47674823", "0.4762957", "0.47621787", "0.47581798", "0.47533906", "0.47494084", "0.47487947", "0.4735986", "0.47342297", "0.47324657", "0.4720701", "0.47142115", "0.47134686", "0.471067", "0.47029945", "0.4700829", "0.46975034", "0.46841133", "0.4676011", "0.4671069", "0.4665981", "0.46654427", "0.46611363", "0.4658854", "0.46545297", "0.46542707", "0.46508375", "0.46491376", "0.464539", "0.4644338", "0.46401697", "0.46401134", "0.46210116", "0.46200022", "0.46133572", "0.46105164", "0.4610211", "0.460981", "0.46084073", "0.45999354", "0.45954105", "0.45951506", "0.4592856", "0.45860082", "0.45860082", "0.45853016", "0.45843983", "0.4582452", "0.4581315", "0.45748758", "0.45717606", "0.45703912", "0.45591247", "0.45554712", "0.45554212", "0.45502844", "0.4547875", "0.45321938", "0.45319033", "0.45301855", "0.4529013", "0.45253205" ]
0.638656
0
This function searches for simplokas in the text and forms an array with them.
function getSimplokaCount() { flag = true; for(i=0; i<anaphora_examples.length; i++) { for(j=0; j<epiphora_examples.length; j++) { flag = true; if(anaphora_examples[i][1].length == epiphora_examples[j][1].length) { for(t=0; t<anaphora_examples[i][1].length; t++) { if(anaphora_examples[i][1][t] != epiphora_examples[j][1][t]) { flag = false; break; } } } else flag = false; if(flag) { let tmp_array = anaphora_examples[i].slice(); tmp_array[1] = anaphora_examples[i][1].slice(); simploka_examples.push(tmp_array); simploka_examples[simploka_examples.length - 1][2] = epiphora_examples[j][0]; } } } result = simploka_examples; return result.length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wave(text){\n let finalArray = []\nfor ( let i = 0; i < text.length; i++) {\n let arr = text.split('')\n if (arr[i] === ' ') {\n continue;\n }\n arr[i] = arr[i].toUpperCase()\n\n finalArray.push(arr.join(''))\n}\n return finalArray\n}", "function soloUnaVez(texto) {\n\n //Definir variables\n let contadores = {},\n resultado = [];\n letras = texto.split('').filter(letra => letra.trim().length >= 1);\n\n //Generar contadores\n for (letra of letras) {\n if (!contadores[letra]) {\n contadores[letra] = 1;\n } else {\n contadores[letra]++;\n }\n }\n\n //Eliminar las letras que se repitan\n for (letra in contadores) {\n if (contadores[letra] === 1) {\n resultado.push(letra);\n }\n }\n\n return [resultado, resultado[0]];\n}", "function censura(text, words){\n // words = ['serie', 'di', 'parole', 'da', 'censurare'];\n // var arrText = [];\n // var arrWords =[];\n // var newtxt = [];\n // arrText.push();\n var arrText = text.split(' ')\n // arrWords.push();\n var arrWords = words.split(' ')\n console.log(' nella funzione gli array',arrText, arrWords);\n for (var i = 0; i < arrText.length; i++) {\n\n // for (var j = 0; j < arrWords.length; j++) {\n\n // if (arrText[i] == arrWords[j]){\n // console.log('stampo arrText nella funzione e nell-if',arrText[i]);\n // arrText[i] = 'xxx';\n // console.log(arrWords[j]);\n // console.log('stampo arrText nella funzione e nell-if',arrText[i]);\n // }\n // else {\n // console.log('sono nell-else e vado anvanti nel ciclo');\n // console.log(arrText[i]);\n // }\n if (arrWords.includes(arrText[i])){\n\n arrText[i]= 'xxx';\n console.log(arrText[i]);\n }\n\n\n // console.log(arrWords[j]);\n\n\n\n // }\n\n // console.log('stampo arrText nella funzione ',arrText[i]);\n\n // newtxt.push(arrText[i]);\n // console.log(newtxt);\n }\n console.log(arrWords);\n return arrText.join(' ');\n\n}", "analyze(text) {\n this.text = this.purify(text);\n this.index = 0;\n this.list = [];\n this.buffer = \"\";\n\n while (this.index < this.text.length) {\n this.state.transference(this.index, true);\n }\n return this.list;\n }", "function getTextArr() {\n //TODO: pull texts from json\n\n return {\n Support: [\"Красавчик\", \"Так держать\", \"Хочешь я дам тебе миллион долларов?\"],\n Progress: [\"Хватит в игры играть\", \"Иди работай\"]\n };\n}", "function prepphrase(){\n var presponse=[];\n var array=pp[r(pp)]\n if (array==pp1){\n presponse.push(array[0][r(array[0])])\n presponse.push(nbar())\n }\n else{presponse.push('')}\n return presponse;\n}", "function parse(array){\n let result = [];\n let word = [];\n let first;\n const len = array.length;\n for (let i = 0; i < len; i++){\n let sound_ = sound(array[i]);\n if (isFirst(i, array)) word.push(array[i].toUpperCase());\n if (sound_ && sound_ !== ' ' && isDifferent(i, array, word) && !(isFirst(i, array))) word.push(sound_);\n if (isEnd(i, array)) {\n Array.prototype.push.apply(result, pad(word));\n word = [];\n }\n if (sound_ === ' ') result.push(sound_);\n }\n return result.join(''); \n}", "function fraziona(stringa) {\r\n var arrayStringa = [];\r\n\r\n // Pusho ogni lettera dentro un nuovo array\r\n for (var i = 0; i < stringa.length; i++) {\r\n arrayStringa.push(stringa[i]);\r\n }\r\n\r\n return arrayStringa;\r\n}", "function getAnadiplosisCount() {\r\n text = workarea.textContent;\r\n search_string = \"[a-zA-Zа-яА-ЯёЁ]+[.?!;]{1,3}\\\\s[a-zA-Zа-яА-ЯёЁ]+\";\r\n middle_words = text.match(/[a-zA-Zа-яА-ЯёЁ]+[.?!;]{1,3}\\s[a-zA-Zа-яА-ЯёЁ]+/g);\r\n new_phrases = [];\r\n result = [];\r\n if(middle_words != null) {\r\n for (i=0; i < middle_words.length; i++) {\r\n phrase = middle_words[i];\r\n phrase = phrase.toLowerCase();\r\n near_space = phrase.match(/[.?!;]{1,3}\\s/)[0];\r\n phrase = phrase.split(near_space);\r\n if(phrase[0] == phrase[1]) {\r\n new_phrases.push(middle_words[i]);\r\n }\r\n }\r\n result = new_phrases;\r\n\r\n tmp = [];\r\n for(key in result) {\r\n if(tmp.indexOf(result[key]) == -1) {\r\n tmp.push(result[key]);\r\n }\r\n }\r\n result = tmp;\r\n count = 0;\r\n\r\n search_string = \"([a-zA-Zа-яА-ЯёЁ]+\\\\s){0}\" + search_string + \"(\\\\s[a-zA-Zа-яА-ЯёЁ]+){0}\";\r\n while(new_phrases.length != 0) {\r\n\r\n middle_words = [];\r\n count++;\r\n search_reg = new RegExp(\"\\\\{\"+(count-1)+\"\\\\}\", 'g');\r\n search_string = search_string.replace(search_reg, \"{\"+count+\"}\");\r\n middle_words = text.match(new RegExp(search_string,\"g\"));\r\n new_phrases = [];\r\n if(middle_words != null) {\r\n for (i=0; i < middle_words.length; i++) {\r\n phrase = middle_words[i];\r\n phrase = phrase.toLowerCase();\r\n near_space = phrase.match(/[^a-zA-Zа-яА-ЯёЁ]{1,3}\\s/)[0];\r\n phrase = phrase.split(near_space);\r\n temp = middle_words[i].split(near_space);\r\n for(j=0; j<phrase.length-1; j++) {\r\n if(phrase[j] == phrase[j+1]) {\r\n new_phrases.push(temp[j] + near_space + temp[j+1]);\r\n } \r\n }\r\n }\r\n\r\n for(key in new_phrases) {\r\n result.push(new_phrases[key]);\r\n }\r\n }\r\n\r\n }\r\n tmp = [];\r\n for(key in result) {\r\n if(tmp.indexOf(result[key]) == -1) {\r\n tmp.push(result[key]);\r\n }\r\n }\r\n result = tmp;\r\n }\r\n return result.length;\r\n}", "function mach_mini_iimeil_laesbar(text) {\n var s = text.split('');\n for (var i = 0; i < s.length; i++) { s[i] = luukoeptaibel[text[i]]; }\n return s.join('');\n}", "function uniqueFinder(sentence) {\r\n //your code here\r\n //kondisi untuk nilai array kosong\r\n if (sentence.length === 0) {\r\n return 'NO WORDS';\r\n }\r\n \r\n //coding untuk split, space (' ');\r\n sentence += ' ';\r\n const tampungWords = [];\r\n let tampungKata = '';\r\n for (let i = 0; i < sentence.length; i++) {\r\n if (sentence[i] === ' ') {\r\n tampungWords.push(tampungKata.toLowerCase());\r\n tampungKata = ' ';\r\n } else {\r\n tampungKata += sentence[i];\r\n }\r\n }\r\n //console.log(tampungWords);\r\n \r\n const results = [];\r\n //looping untuk splitted\r\n for (let p = 0; p< tampungWords.length; p++){\r\n //looping untuk check words yg sama\r\n //console.log('Kata I : ' +tampungWords[p]);\r\n for (let q = p + 1; q< tampungWords.length; q++){\r\n //console.log('kata II ' +tampungWords[q]);\r\n let exist = false;\r\n \r\n //looping untuk check udah masuk result or belum\r\n for (let r = 0; r< results.length; r++) {\r\n //console.log('kata III : ' +results);\r\n if (tampungWords[p] === results[r]) {\r\n exist = true ;\r\n }\r\n }\r\n \r\n if (tampungWords[p] === tampungWords[q] && !exist ) {\r\n results.push(tampungWords[p]);\r\n }\r\n }\r\n } \r\n //console.log(results);\r\n return results;\r\n\r\n}", "words(content) {\n //@TODO\n let word_arr = content.split(/\\s+/).map((w) => normalize(w)).filter((w) => !this.noise_words.has(w));\n return word_arr;\n\n }", "function parseStory(rawStory) {\n // Your code here.\n // This line is currently wrong :)\n const arrayOfWords = []\n const splittedStory = rawStory.split(\" \")\n const previewBox = document.querySelectorAll(\".previewBox\")[0];\n for (const word of splittedStory) {\n if ((/\\[n\\]/).test(word) === true) {\n arrayOfWords.push({\n word: word.replace(\"[n]\", \"\"),\n pos: \"n\"\n })\n } else if ((/\\[a\\]/).test(word) === true) {\n arrayOfWords.push({\n word: word.replace(\"[a]\", \"\"),\n pos: \"a\"\n })\n } else if ((/\\[v\\]/).test(word) === true) {\n arrayOfWords.push({\n word: word.replace(\"[v]\", \"\"),\n pos: \"v\"\n })\n } else {\n arrayOfWords.push({\n word: word\n })\n }\n }\n // console.log(arrayOfWords)\n\n return arrayOfWords\n\n}", "function getArray (s) {\n var a = s.split('\\n')\n return a.map(v => v.split('').map(vv => {\n if (vv === '*') {\n return 1\n } else {\n return 0\n }\n }))\n}", "autoMode(text) {\n let array = [];\n let splitText = text.split(' ').filter((sub) => (sub !== ''));\n \n if (!splitText) {\n console.error('Something was wrong.');\n return;\n }\n \n while (splitText.length > 0) {\n // split every letter by the spaces x\n let brokeLine = this.autoBreak(splitText);\n \n array.push(brokeLine);\n splitText.splice(0, this.sumLetter());\n }\n \n return array;\n }", "function createSuggestionsArray(value) {\n // PREFIX: \n suggestions = [];\n\n allTitleWords.forEach(word => {\n if (word.endsWith('.')) {\n word = word.slice(0, -1);\n } \n if (word.startsWith(value) === true && word.length >= 3) {\n suggestions.push(word);\n } \n });\n}", "function wave(str){\n const text = str.toLowerCase();\n const newArray = [];\n for (let i = 1; i <= text.length; i++) {\n if (!(text.substring(i - 1, i) === \" \"))\n newArray.push(text.substring(0, i - 1).toLowerCase() + text.substring(i - 1, i).toUpperCase() + text.substring(i, str.length).toLowerCase())\n };\n return newArray;\n}", "function makeFinalMarkov(textStamps, markovText){\n var output = [];\n for(var i = 0; i < markovText.length; i++){\n var curWord = markovText[i];\n var chooseArr = textStamps[curWord];\n output.push(chooseArr[Math.floor(Math.random() * chooseArr.length)]);\n }\n return output;\n}", "function getAnaphoraCount() {\r\n text = workarea.textContent;\r\n anaphora_candidates = [];\r\n first_index = 0;\r\n last_index = 0;\r\n for(i=0; i < sentences.length-1; i++) {\r\n if(sentences[i] == \"`I must.\") debugger;\r\n first_word = sentences[i].match(/\\S+/)[0];\r\n check_higher_case = first_word.match(/[A-ZА-ЯЁ]/);\r\n if(check_higher_case == null) {\r\n continue;\r\n }\r\n if(first_word.match(\"Chapter\") != null || first_word.toLowerCase() == \"a\" || first_word.toLowerCase() == \"an\" || first_word.toLowerCase() == \"the\") {\r\n continue;\r\n }\r\n first_index = i;\r\n last_index = first_index;\r\n for(j=i+1; j<sentences.length; j++) {\r\n if(first_word == sentences[j].match(/\\S+/)[0]) {\r\n last_index = j;\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n if(last_index > first_index) {\r\n tmp = [];\r\n for(first_index; first_index <= last_index; first_index++) {\r\n tmp.push(sentences[first_index]);\r\n }\r\n anaphora_candidates.push([first_word, tmp]);\r\n i = last_index;\r\n }\r\n }\r\n flag = true;\r\n if(anaphora_candidates.length !=0) {\r\n while(flag) {\r\n control_array = [];\r\n for(i=0; i<anaphora_candidates.length; i++) {\r\n first_words = new RegExp(anaphora_candidates[i][0].replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\") + \"((\\\\.|\\\\!){3}|\\\\.|\\\\?|\\\\!){0,1}\\\\s\\\\S+\");\r\n if(anaphora_candidates[i][1][0].match(first_words) != null) {\r\n first_words = anaphora_candidates[i][1][0].match(first_words)[0];\r\n tmp = [];\r\n for(j=0; j < anaphora_candidates[i][1].length; j++) {\r\n if(anaphora_candidates[i][1][j].match(first_words.replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\")) != null) {\r\n tmp.push(true);\r\n }\r\n else {\r\n tmp.push(false);\r\n }\r\n }\r\n control_array.push(tmp);\r\n if(tmp.indexOf(false) == -1) {\r\n anaphora_candidates[i][0] = first_words;\r\n }\r\n }\r\n }\r\n \r\n for(i=0; i<control_array.length; i++) {\r\n if(control_array[i].indexOf(false) != -1) {\r\n control_array[i] = false;\r\n }\r\n else {\r\n control_array[i] = true;\r\n }\r\n }\r\n if(control_array.indexOf(false) != -1){\r\n flag = false;\r\n }\r\n else {\r\n flag = true;\r\n }\r\n }\r\n\r\n\r\n flag = true;\r\n while(flag) {\r\n control_array = [];\r\n for(i=0; i<anaphora_candidates.length; i++) {\r\n first_words = new RegExp(anaphora_candidates[i][0].replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\") + \"((\\\\.|\\\\!){3}|\\\\.|\\\\?|\\\\!){0,1}\\\\s\\\\S+\");\r\n if(anaphora_candidates[i][1][0].match(first_words) != null) {\r\n first_words = anaphora_candidates[i][1][0].match(first_words)[0];\r\n tmp = [];\r\n for(j=0; j < anaphora_candidates[i][1].length; j++) {\r\n if(anaphora_candidates[i][1][j].match(first_words.replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\")) != null) {\r\n tmp.push(true);\r\n }\r\n else {\r\n tmp.push(false);\r\n }\r\n }\r\n control_array.push(tmp);\r\n if(tmp.indexOf(false) == -1) {\r\n anaphora_candidates[i][0] = first_words;\r\n }\r\n }\r\n }\r\n for(i=0; i<control_array.length; i++) {\r\n if(control_array[i].indexOf(false) != -1) {\r\n\r\n control_array[i] = true;\r\n }\r\n else {\r\n control_array[i] = false;\r\n }\r\n }\r\n if(control_array.indexOf(false) == -1){\r\n flag = false;\r\n }\r\n else {\r\n flag = true;\r\n }\r\n\r\n }\r\n }\r\n temp = [];\r\n for(i=0; i<anaphora_candidates.length; i++) {\r\n anaphora_length = anaphora_candidates[i][0].split(\" \").length;\r\n count = 0;\r\n for(j=0; j<anaphora_candidates[i][1].length; j++) {\r\n if(anaphora_candidates[i][1][j].split(\" \").length == anaphora_length && anaphora_length < 5) {\r\n count++;\r\n }\r\n }\r\n if (count!=anaphora_candidates[i][1].length) {\r\n temp.push(anaphora_candidates[i])\r\n }\r\n }\r\n anaphora_candidates = temp;\r\n for(i=0; i<anaphora_candidates.length; i++) {\r\n if(anaphora_candidates[i][0][anaphora_candidates[i][0].length-1] == \".\") {\r\n anaphora_candidates[i][0] = anaphora_candidates[i][0].substring(0, anaphora_candidates[i][0].length-1);\r\n }\r\n }\r\n result = anaphora_candidates;\r\n return result.length\r\n}", "function getUniqueArray(text, minLength = 0) {\n\t// Split paragraph text into an array of char\n\tsplitText = text.split(\"\");\n \n // Creation of result array for holding output\n // Creation of remainingLimit variable for holding how many characters can be cycled through\n var result = [],\n \t\tremainingLimit = splitText.length - minLength;\n \n // Loop for cycling through split text\n // Determines if the character is already in the result array or not\n // If not inserts character\n splitText.forEach(char => {\n\t\tif (result.includes(char))\n \tremainingLimit--;\n else if (remainingLimit > 0) {\n \tresult.push(char);\n remainingLimit--;\n }\n\t});\n \n // Prints out result\n console.log(result);\n \n}", "async words(contentText) {\n //TODO\n let words = [];\n let splitWords;\n let noiseWords = [];\n await db.collection(noise_table).find({}).forEach(function (u) {\n noiseWords.push(u.word);\n });\n while (splitWords = WORD_REGEX.exec(contentText)) {\n let [word, offset] = [splitWords[0], splitWords.index];\n word = normalize(word);\n word = stem(word);\n if(!(noiseWords.indexOf(word) > -1)) {\n words.push([word, offset]);\n }\n }\n return await words;\n\n }", "function findTheAnswer(ask){\n\n const re_10 = new RegExp(/เจ็บหน้าอก/g);\n const re_11 = new RegExp(/เจ็บอก/g);\n const re_12 = new RegExp(/แน่นอก/g);\n\n const re_20 = new RegExp(/แสบร้อนกลางอก/g);\n const re_21 = new RegExp(/เรอ/g);\n const re_22 = new RegExp(/แสบอก/g);\n const re_23 = new RegExp(/แสบหน้าอก/g);\n\n const re_30 = new RegExp(/img/g);\n const re_31 = new RegExp(/คัน/g);\n const re_32 = new RegExp(/ผมร่วง/g);\n\n const re_thx_1 = new RegExp(/ขอบคุณ/g);\n const re_thx_2 = new RegExp(/ขอบคุน/g);\n\n if(\n re_10.test(ask) ||\n re_11.test(ask) ||\n re_12.test(ask) ||\n re_30.test(ask)\n ){\n return 'คุณมีอาการอื่นร่วมอีกไหมคะ'\n }\n\n if(re_20.test(ask) || re_21.test(ask) || re_22.test(ask) || re_23.test(ask)){\n let data = [\n 'คุณมีอาการกรดไหลย้อน',\n 'ดิฉันขอแนะนำให้คุณ',\n 'ควรใส่เสื้อหลวม ๆ',\n 'ควรงดอาหารก่อนนอน 3 ชั่วโมง'\n ]\n return data\n }\n\n if(re_31.test(ask) || re_32.test(ask)){\n let data = [\n 'คุณน่าจะเป็นกลากที่ศรีษะ ค่ะ',\n 'ซึ่งดิฉันขอแนะนำ',\n 'ในกรณีนี้ คุณควรไปพบแพทย์นะคะ',\n 'เนื่องจากคุณอาจมีเชื้อ Tricophyton และ Microsporum',\n 'ดิฉันขอแนะนำ',\n '<a target=\"new\" href=\"nearest_hospital.html\">โรงพยาบาลที่ใกล้ที่สุด</a>',\n '<a target=\"new\" href=\"specific_hospital.html\">โรงพยาบาลเฉพาะทาง</a>',\n ]\n return data\n }\n\n if(\n re_thx_1.test(ask) ||\n re_thx_2.test(ask)\n ){\n return 'ด้วยความยินดีค่ะ'\n }\n\n return 'ขออภัยค่ะ ดิฉันไม่สามารถเข้าใจได้ในตอนนี้'\n}", "function getTextArr() {\n s = document.getElementById(\"textToReadWrapper\").innerHTML;\n s = s.replace(/(^\\s*)|(\\s*$)/gi, \"\");\n s = s.replace(/[ ]{2,}/gi, \" \");\n s = s.replace(/\\n /, \"\\n\");\n textToAdd = s.split(' ');\n\n }", "function problema3(){\n var p3_input = document.querySelector('#p3-input').value;\n\n //detección del espacio dividiendo la cadena dentro de un array\n var p3_array = p3_input.split(',').reduce((acc, val) => acc.length > val.length ? acc : val, '');\n\n var p3_respuesta=\"\";\n\n for (var x = 0; x < p3_array.length; x++) {\n var char = p3_array.charAt(x);\n if (p3_respuesta.indexOf(char) == -1 || char == ' ') {\n p3_respuesta += p3_array[x];\n }\n }\n\n p3_respuesta_mayus = p3_respuesta.toUpperCase().match(/.{1,1}/g);\n\n p3_final = p3_respuesta_mayus.join(\", \");\n\n document.querySelector('#p3-output').textContent = p3_final;\n}", "function censor(text, word) {\n let arr = text.split(\" \");\n // console.log(arr); <-- logs out the split elements of the text [\"this\", \"is\", \"an\", \"algorithm\"]\n for (let i = 0; i < arr.length; i++) {\n if (word == arr[i]) {\n // console.log(arr[i]); <-- logs out the word if it exists in the elements of the array (\"algorithm\")\n let asterisks = Array(arr[i].length + 1).join(\"*\");\n // console.log(asterisks); <-- a new variable that makes asterisks for the length of the word (*********)\n let index = arr.indexOf(arr[i]);\n // console.log(index); <-- log out the index of the array where the word exists (3)\n if (index !== -1) {\n arr[index] = asterisks; //<-- replace the index of the array where the word exists with the asterisk version\n }\n console.log(arr.join(\" \")); //<-- pull the elements out of the array (now with the asterisks)\n }\n }\n}", "split(text) {\n text = text.trim();\n let separators = new Set([' ', '\\n', '\\t', '\\v']);\n let i = 0;\n let wordArray = [''];\n for (let j = 0; j < text.length; j++) {\n if (separators.has(text[j])) {\n if (wordArray[i] === \"\") {\n continue;\n } else {\n wordArray[++i] = \"\";\n }\n } else {\n wordArray[i] += text[j];\n }\n }\n let ultimaPalabra = wordArray[wordArray.length - 1];\n if (ultimaPalabra == \"\" || separators.has(ultimaPalabra[ultimaPalabra.length - 1])) {\n wordArray.pop();\n }\n return wordArray;\n }", "function arrayer(song) {\n let arrayOfParts = [];\n let startIndex = 1;\n let endIndex = 0;\n while (song) {\n endIndex = song.indexOf(\"[\", startIndex);\n if (endIndex === -1) {\n arrayOfParts.push(song.slice(startIndex - 1, song.length - 1));\n break;\n }\n arrayOfParts.push(song.slice(startIndex - 1, endIndex - 1));\n startIndex = endIndex + 1; \n }\n console.log(arrayOfParts[0].charCodeAt(10)); //87\n return arrayOfParts;\n }", "function groupKeggResponse(text) {\n let ntext = text.trimEnd().split(/\\n/);\n let ndata = [[]];\n for (let t of ntext.slice(0, ntext.length - 1)) {\n if (t === \"///\") {\n ndata.push([]);\n continue;\n };\n ndata[ndata.length - 1].push(t);\n };\n return ndata;\n}", "function getWords(text)\n{\n let startWord = -1;\n let ar = [];\n \n for(let i = 0; i <= text.length; i++)\n {\n let c = i < text.length ? text[i] : \" \";\n\n if (!isSeparator(c) && startWord < 0)\n {\n startWord = i;\n }\n \n if (isSeparator(c) && startWord >= 0)\n {\n let word = text.substring(startWord, i);\n ar.push(word);\n \n startWord = -1;\n }\n }\n\n return ar;\n}", "function arrayLoad(){\n var info, qtext, i;\n info = text.split(\"\\n\");//info is an array of every line of text in the file \n var q = [];//primative array (non OOP arrays in js act like java arraylists) of questions for this page\n var arraycounter=0;\n for(i = 0; i<info.length;i++){\n var ans = info[i];\n i++;\n qtext=\"\";\n while((info[i].trim()) !== \"ZzZ\"){\n qtext+=info[i] + \"<br>\";\n i++;\n }\n i++;//to get out of the ZzZ indicator\n\n q[arraycounter] = new quest(ans, qtext, info[i], info[i+1], info[i+2], info[i+3], info[i+4]);\n arraycounter++; \n \n i+=4;\n }\n //all questions from the doc are now in the array q\n q = shuffle(q);\n return q;\n}", "function liste_alcool_text(callback){\n\tvar fs = require(\"fs\");\n\tvar contenu;\n\n\tcontenu = fs.readFileSync(\"plugins/cocktail/boisson.js\", \"UTF-8\");\n\tvar regexp = new RegExp('\\r\\n', 'gm');\n\t\n\tcontenu = contenu.replace(regexp, '');\n\tboisson = JSON.parse(contenu);\n\t\n\ttableau_alcool = new Array();\n for (var i =0;i<boisson.alcools.length;i++){\n tableau_alcool.push(boisson.alcools[i])\n }\n\n\ttableau_soft = new Array();\n for (var i =0;i<boisson.softs.length;i++){\n tableau_soft.push(boisson.softs[i])\n }\n\n\tajout_boisson_xml(tableau_alcool,tableau_soft,callback);\n\t\n}", "function inspectText(body, context) {\r\n var toDisplay = [];\r\n console.log(body);\r\n var prev, pref, word;\r\n var prefix = [\"\", \"den \", \"der \", \"de \", \"van \"];\r\n var reg = /[A-Z]+[a-z\\-]*/gm;\r\n var i = 0;\r\n while (word = reg.exec(body)) {\r\n if (word == \"De\" || word == \"Van\" || word == \"Di\" || word == \"Vanden\" || word == \"Ver\") {\t\t//Di Rupo rpz\r\n pref = word;\r\n console.log(\"Prefix found: \" + pref);\r\n continue;\r\n }\r\n var name;\r\n var found = false;\r\n var iter = 0;\r\n while (!found && iter < prefix.length) {\r\n // Search for prefixes\r\n if (pref != null) {\r\n name = pref + \" \" + prefix[iter] + word;\r\n } else {\r\n name = prefix[iter] + word;\r\n }\r\n // Search for the name in the hashmap\r\n if (name in hashmap && !(name in alreadyFoundPoliticians)) {\r\n\t\t\t\t\talreadyFoundPoliticians[name] = true;\r\n found = true;\r\n var matching = [];\r\n var pol = null;\r\n // If only one politician has this name\r\n var twoNames = false;\r\n if (hashmap[name].length == 1) {\r\n pol = 0;\r\n }\r\n // If a politician has his first name cited just before his last name in the text\r\n else for (var i in hashmap[name]) {\r\n matching.push(hashmap[name][i]);\r\n if (prev == hashmap[name][i][4]) { //Matching also firstname\r\n pol = i;\r\n twoNames = true;\r\n }\r\n }\r\n var nameLength = name.length;\r\n if (twoNames) {\r\n prev += \" \";\r\n nameLength += prev.length;\r\n }\r\n else {\r\n prev = \"\";\r\n }\r\n\r\n // Only one politician\r\n if (pol != null) {\r\n display(hashmap, name, pol, context);\r\n }\r\n //Multiple policitians\r\n else {\r\n console.log(\"display multiple\");\r\n display_multiple(hashmap, name, context);\r\n }\r\n pref = null;\r\n }\r\n prev = word;\r\n iter++;\r\n }\r\n }\r\n }", "complete(text) {\n //@TODO\n let arrayKeys = Array.from(map2.keys());\n\n let finalArray = arrayKeys.filter(function(value){\n if(value.match(`^${text}`)){\n return value;\n }\n });\n\n return finalArray;\n }", "function programacionImperativa() {\n console.log(\" programacion imperativa \")\n /* for de toda la vida el basico */\n let newData = [] // se inicia un array basio\n for (let index = 0; index < words.length; index++) {\n //se le agrega cada word\n let word = words[index]\n newData.push(word)\n }\n console.log(\"newData\",newData)\n let filterHello = []\n for (let word of words) {\n if (word == \"hello\") {\n filterHello.push(word)\n }\n }\n console.log(\"filterHello\",filterHello)\n}", "function findIs(){\n var is = [];\n for ( i=0; i<strings[i].length; i++ ){\n var word = strings[i];\n for (count = 0; count < word.length; count++) {\n if (word[count] === \"i\" && word[count + 1] === \"s\"){\n is.push(word);\n }\n }\n }return is;\n}", "function initializeArr(isEnglish) {\n\t\t\tif (isEnglish) {\n\t\t\t\treturn [\n\t\t\t\t\t[\"Catch all the adjectives\"], [\n\t\t\t\t\t\t[\"Happy\", \"text\", true, \"\", \"\", 0],\n\t\t\t\t\t\t[\"Lucky\", \"text\", true, \"\", \"\", 0],\n\t\t\t\t\t\t[\"Handsome\", \"text\", true, \"\", \"\", 0],\n\t\t\t\t\t\t[\"Courageous\", \"text\", true, \"\", \"\", 0],\n\t\t\t\t\t\t[\"Friendly\", \"text\", true, \"\", \"\", 0],\n\t\t\t\t\t\t[\"Hilarious\", \"text\", true, \"\", \"\", 0],\n\t\t\t\t\t\t[\"Mysterious\", \"text\", true, \"\", \"\", 0],\n\t\t\t\t\t\t[\"Generous\", \"text\", true, \"\", \"\", 0],\n\t\t\t\t\t\t[\"Energetic\", \"text\", true, \"\", \"\", 0],\n\t\t\t\t\t\t[\"Gorgeous\", \"text\", true, \"\", \"\", 0],\n\t\t\t\t\t\t[\"Appear\", \"text\", false, \"\", \"\", 0],\n\t\t\t\t\t\t[\"Begin\", \"text\", false, \"\", \"\", 0],\n\t\t\t\t\t\t[\"Rise\", \"text\", false, \"\", \"\", 0],\n\t\t\t\t\t\t[\"Credit\", \"text\", false, \"\", \"\", 0],\n\t\t\t\t\t\t[\"Belief\", \"text\", false, \"\", \"\", 0],\n\t\t\t\t\t\t[\"Recipe\", \"text\", false, \"\", \"\", 0],\n\t\t\t\t\t\t[\"Reaction\", \"text\", false, \"\", \"\", 0]\n\t\t\t\t\t]\n\t\t\t\t];\n\t\t\t} else {\n\t\t\t\treturn [\n\t\t\t\t\t[\"תפסו את כל מי שכיהן כראש ממשלת מדינת ישראל\"], [\n\t\t\t\t\t\t[\"דוד בן גוריון\", \"text\", true, \"\", \"\", 0],\n\t\t\t\t\t\t[\"אהוד אולמרט\", \"text\", true, \"\", \"\", 0],\n\t\t\t\t\t\t[\"אריאל שרון\", \"text\", true, \"\", \"\", 0],\n\t\t\t\t\t\t[\"מנחם בגין\", \"text\", true, \"\", \"\", 0],\n\t\t\t\t\t\t[\"אהוד ברק\", \"text\", true, \"\", \"\", 0],\n\t\t\t\t\t\t[\"יצחק שמיר\", \"text\", true, \"\", \"\", 0],\n\t\t\t\t\t\t[\"לוי אשכול\", \"text\", true, \"\", \"\", 0],\n\t\t\t\t\t\t[\"משה שרת\", \"text\", true, \"\", \"\", 0],\n\t\t\t\t\t\t[lib.Golda, \"pic\", true, \"\", \"\", 0],\n\t\t\t\t\t\t[lib.Rabin, \"pic\", true, \"\", \"\", 0],\n\t\t\t\t\t\t[lib.Dayan, \"pic\", false, \"\", \"\", 0],\n\t\t\t\t\t\t[lib.Kochavi, \"pic\", false, \"\", \"\", 0],\n\t\t\t\t\t\t[\"יאיר לפיד\", \"text\", false, \"\", \"\", 0],\n\t\t\t\t\t\t[\"אביגדור ליברמן\", \"text\", false, \"\", \"\", 0],\n\t\t\t\t\t\t[\"משה (בוגי) יעלון\", \"text\", false, \"\", \"\", 0],\n\t\t\t\t\t\t[\"יעקב דורי\", \"text\", false, \"\", \"\", 0],\n\t\t\t\t\t\t[\"רפאל איתן\", \"text\", false, \"\", \"\", 0]\n\t\t\t\t\t]\n\t\t\t\t];\n\t\t\t}\n\t\t}", "function duplicatonsFree(t) {\n\n\tvar duplicationFreeArr = [];\n\ttext = t.toLowerCase();\n\n\tif(text && text.length) duplicationFreeArr = text.match(/[A-Za-z]+/g);\n\tlet x = (names) => names.filter((v,i) => names.indexOf(v) === i);\n\n\tduplicationFreeArr = x(duplicationFreeArr);\nconsole.log(duplicationFreeArr.length);//remove it\n\treturn duplicationFreeArr;\n\n}", "function createArrayFromPhrase(phrase) {\n const splitPhrase = phrase.split(' ');\n const thirdWord = splitPhrase.pop();\n return [splitPhrase.join(' '), thirdWord];\n}", "tokenize(text) {\n text = text.toLowerCase();\n const phrases = [ text ];\n let matches = text.match(/\\s+/);\n let i = -1;\n if (matches && matches[0]) {\n i = matches.index + matches[0].length;\n }\n let ctr = 0;\n while (i !== -1 && ctr < 4) { // insert 4 more phrases\n text = text.substring(i);\n phrases.push(text);\n matches = text.match(/\\s+/);\n if (matches && matches[0]) {\n i = matches.index + matches[0].length;\n } else {\n i = -1;\n }\n ++ctr;\n }\n\n return phrases;\n }", "function sensorSentence ( sentence, words ) {\n var panjangWords = words.length-1\n \n var result= ''\n for(var i=0;i<sentence.length;i++){\n if(sentence[i] == words[0] && sentence[i+panjangWords] == words[panjangWords]){\n var awalsensor = i\n var ahirsensor = i+panjangWords\n }\n if(i>= awalsensor && i<=ahirsensor) result+= '*'\n else result+= sentence[i]\n }\n\n return result\n}", "function cortaPalabras(texto) {\n\n let palabras = [];\n let palabra = '';\n for ( let letra = 0; letra < texto.length; letra++ ) {\n if ( texto[letra] !== ' ' ) {\n palabra += texto[letra];\n } else if ( palabra !== '' ) {\n palabras.push( palabra );\n palabra = '';\n }\n\n if ( letra == texto.length - 1 && palabra !== '') palabras.push( palabra );\n }\n\n console.log(palabras);\n return palabras;\n}", "function getRandomPhraseAsArray () {\n var result= phrase[Math.floor(Math.random() * phrase.length)]; \n result = result.split(\"\");\n return result;\n}", "function shortestWords(words) {\n // Code here\n var newWords = \"\";\n for (var x = 0; x < words.length; x++) {\n newWords = newWords + words[x].toLowerCase();\n // console.log(newWords)\n //toLowerCase digunakan agar tidak muncul dua kata yang sama dikarenakan huruf kapital. \n }\n // Lakukan split untuk agar var splitWords bisa di cek menggunakan looping.\n var splitWords = newWords.split(\" \");\n // Buat array kosong untuk menampung pengulangan dari looping.\n // console.log(splitWords)\n var tampungLength = [];\n\n for (var a = 0; a < splitWords.length; a++) {\n var cekKata = \"\";\n for (var b = 0; b < splitWords[a].length; b++) {\n cekKata = b;\n }\n tampungLength.push(cekKata);\n }\n // console.log(tampungLength);\n // Mengecek panjang huruf var words.\n\n // Gunakan looping untuk mencari kata yang paling jarang muncul.\n var angkaTerkecil = tampungLength[0];\n\n for (var c = 0; c < tampungLength.length; c++) {\n if (angkaTerkecil > tampungLength[c]) {\n angkaTerkecil = tampungLength[c];\n }\n }\n // console.log(angkaTerkecil)\n\n var tampungHasil = [];\n for (var i = 0; i < tampungLength.length; i++) {\n if (tampungLength[i] == angkaTerkecil) {\n tampungHasil.push(splitWords[i]);\n }\n }\n // console.log(tampungHasil)\n\n var hasil = [];\n for (var j = 0; j < tampungHasil.length; j++) {\n if (hasil.indexOf(tampungHasil[j]) === -1) {\n hasil.push(tampungHasil[j]);\n if (tampungHasil[j] === 'i') {\n hasil[0] = tampungHasil[j].toUpperCase();\n }\n }\n }\n return hasil;\n}", "function main(text) {\n let moves = text.split(/ *, */g);\n // let moves =['s1','x3/4','pe/b'];\n let len = 1000000000;\n for (let i = 1; i <= len; i++) {\n for (let move of moves) {\n let {\n func,\n args\n } = parseMove(move);\n array = func(...args);\n }\n if (array.join('') === 'abcdefghijklmnop') {\n len = len % i;\n i = 0;\n }\n }\n console.log(array.join(''));\n}", "function makePhrases(potential_words) {\n return new Promise((resolve, reject) => {\n fetch(\"../text/plain-radia-with-characters.txt\")\n .then(response => response.text())\n .then(text => {\n text = text.replace(/<\\/?[^>]+(>|$)/g, \"\");\n \n // find topic\n let topic = null;\n for(let i = 0; i < potential_words.length; i++) {\n if(text.includes(potential_words[i].word)) {\n topic = potential_words[i].word;\n break;\n }\n }\n \n let sentences = text.split(\"\\n\");\n // let sents_about_topic = sentences.filter(sent => sent.includes(topic))\n // let onlyDialogues = sents_about_topic.map(line => {\n // return line.substring(line.indexOf(\":\")+1).trim()\n // });\n // console.log(onlyDialogues);\n // makeChartData(onlyDialogues);\n \n // markov\n // let generator = RiTa.markov(3)\n // onlyDialogues.forEach(dial => generator.addText(dial))\n // let generated = generator.generate(1);\n // console.log(generated)\n \n // kwic\n let opts = {\n ignoreCase: true,\n ignoreStopWords: true\n };\n \n let sents_without_characters = sentences.map(line => {\n return line.substring(line.indexOf(\":\")+1).trim().replace(/[.,\\/#!$%\\^&\\*;:{}=\\-_`~()]/g,\" \")\n });\n RiTa.concordance(sents_without_characters.join(''), opts);\n let kwic_lines = RiTa.kwic(topic, 5);\n // console.log(kwic_lines)\n kwic_lines = kwic_lines.sort(() => Math.random() - Math.random()).slice(0, 5)\n return resolve(kwic_lines);\n \n })\n })\n}", "elementosMachingWithString(str, array){\r\n let st = str;\r\n if(st === undefined){st = ''}\r\n return array.filter((ele) => ele.getName().toLowerCase().match(st.toLowerCase()));\r\n }", "function madLibs(str, array) {\n var finalSentence = '';\n //segments [ 'Marching is fun: ', ', ', ', ', ', ', '!' ]\n var segments = str.split('*');\n var nextWordIdx = 0;\n\n for (var i = 0; i < segments.length - 1; i++) {\n //adds element then word at array and then add them to the finalString\n var segment = segments[i];\n segment += array[nextWordIdx];\n finalSentence += segment;\n // increase the counter \n nextWordIdx = nextWordIdx + 1 < array.length ? nextWordIdx + 1 : 0;\n }\n\n finalSentence += segments[segments.length - 1];\n \n return finalSentence;\n }", "function createArrays() {\n phraseArray = [];\n blankArray = [];\n phraseArray = secretPhrase.split(\"\");\n phraseArray.forEach( () => blankArray.push(\"_\"));\n spanSecretRandom.innerHTML = blankArray.join(\" \");\n}", "function set_absensi_array(data){\n absensi_siswa_arr=[];\n for(var i=0;i<getJumlah();i++){\n absensi_siswa_arr.push({\n status : data[i].charAt(0),\n id_kelas_siswa : getIdKelas(i),\n });\n }\n }", "determinedArray() {\r\n\r\n var metinArrayed = this.metinToArray()\r\n\r\n\r\n for (let index = 0; index < metinArrayed.length; index++) {\r\n metinArrayed[index] = this.determineWord(metinArrayed[index])\r\n\r\n }\r\n\r\n //console.log(metinArrayed)\r\n return metinArrayed\r\n\r\n }", "function ital6s() {\n var str = document.querySelector('#box6s p').textContent;\n var arr = str.split(\" \");\n var newArr = arr.map(v => { \n if (v == \"keep\") {\n return `<em>${v}</em>` \n } else \n return v;\n });\n str = newArr.join(\" \");\n document.querySelector('#box6s p').innerHTML = str;\n}", "function songToWords() {\n\t let textDiv = document.getElementById(\"text-area\");\n\t textDiv.innerHTML = \"\" ;\n\t words = [];\n\t lines = song.split('\\n');\n\t var lineNumber = 0;\n\t var wordNum = 0;\n\t for(i in lines) {\n\t\t \t\ttextDiv.innerHTML = textDiv.innerHTML + '<p>' + lines[i] + '</p>' ;\n\t lines[i] += '\\n';\n\t wordNum = 0;\n\t var elements = lines[i].split(' ');\n\t\t var totalLength = 0;\n for (j in elements){\n\t\t\t \tlineNumber = i + 6;\n\t\t\t\tvar isChord = false;\n\t\t\t\tvar chord = \"\";\n var chordNum = 0;\n\t\t\t\t\n //check if it's a chord, if it is, add it to chord array\n for (k in elements[j]){\n if (elements[j][k] === '[') {\n isChord = true;\n\n }\n if (elements[j][k-1] === ']'){\n isChord = false;\n\n\t\t\t\t\t\tchordNum++;\n\t\t\t\t\t}\n if (isChord) {\n chord += elements[j][k];\n\t\t\t\t\t} \n }\n //display chords, substitude chord with space\n\t\t\t\tif(chord != \"\"){\n\t\t\t\t\t words.push({word: chord, x: totalLength, y: (lineNumber * 5) - 20, isChord: true});\n elements[j] = elements[j].replace(chord, ' ');\n }\n //display lyrics\n if (elements[j] && elements[j]!=' ') {\n words.push({ word: elements[j], x: totalLength, y: lineNumber * 5, isChord: false });\n totalLength += elements[j].length * 17;\n wordNum++;\n\t\t\t\t}\n\t\t }\n\t }\n }", "function status(){\n \n bonMot = result.split('').map(lettre => (deviner.indexOf(lettre) >=0 ? lettre :\" _ \")).join('');\n document.getElementById('goodWord').innerHTML = bonMot;\n \n}", "function prepareWordsImtaRegular(element, words) {\n element.innerHTML = wordsToSpan(element.textContent);\n\n let wordsToFocus = [];\n\n let wordSpans = document.getElementsByClassName('imta-word');\n\n if (isEmpty(words)) {\n for (let i = 0; i < wordSpans.length; i++) {\n wordsToFocus.push(wordSpans[i]);\n }\n } else {\n for (let i = 0; i < wordSpans.length; i++) {\n if (words.includes(wordSpans[i].textContent.toString().toLowerCase())) {\n wordsToFocus.push(wordSpans[i]);\n }\n }\n }\n\n for (let i = 0; i < wordsToFocus.length; i++) {\n wordsToFocus[i].style['display'] = 'inline-block';\n wordsToFocus[i].innerHTML = charToSpan(wordsToFocus[i].textContent);\n }\n}", "function createTitleWordsArray (array) {\n // PREFIX: \n allTitleWords = [];\n\n // Split all the words\n array.forEach(element => {\n let ElementTitleWords = element.title.split(' ');\n // Push every word to the array\n ElementTitleWords.forEach(word => {\n allTitleWords.push(word.toLowerCase());\n });\n });\n}", "function partes_relacion(expresion) {\n\tvar objeto = [];\n\tvar text = \"\";\n\tvar partes = \"\";\n\tvar hacer = false;\n\n\tfor (var i = 0; i < expresion.length; i++) \n\t{\n\t\t/*\n\t\t\tcuando encuentra un partesis derecho parte por comas el text acomulado\n\t\t\ty guarda en el arreglo un object con atributo izquierda y derecha y vacia el text\n \t\t*/\n\t\tif(expresion.charAt(i)===')')\n\t\t{\n\t\t\thacer = false;\n\t\t\tpartes = text.split(\",\");\n\t\t\tobjeto.push({izquierda:partes[0],derecha:partes[1],valor:partes[2]});\n\t\t\ttext = \"\";\n\n\t\t}\n\t\t//cuando encuentra parentesis izquierdo habilita hacer para guardar el acomulado de string\n\t\tif(expresion.charAt(i)==='(')\n\t\t{\n\t\t\ti++;\n\t\t\thacer = true;\n\t\t}\n\t\t//guarda texto acomulado\n\t\tif(hacer)\n\t\t{\n\t\t\ttext = text + expresion.charAt(i);\n\t\t}\n\t}\t \n\t return objeto; \n}", "function getIgnoreKeywords_onomatopoeia_singles() {\n\t\tvar onolist = [];\n\t\t\n\t\tvar pieces = getIgnoreKeywords_onomatopoeia_singleLetter();\n\t\tvar pieceslength = pieces.length;\n\t\t\n\t\tfor(var i = 0; i < pieceslength; i++) {\n\t\t\tvar piece = pieces[i];\n\t\t\tonolist = onolist.concat(getIgnoreKeywords_onomatopoeia_singles_list({'ono':piece}));\n\t\t}\n\t\t\n\t\treturn onolist;\n\t}", "function partiallyHide(phrase) {\n let arr = [];\n let f = phrase.split(' ');\n const m = f.map(word => word.split(''));\n\n for (let i = 0; i < m.length; i++) {\n if (m[i].length <= 2) {\n arr.push(m[i].join(''));\n } else if (m[i].length > 2) {\n \n }\n }\n return arr;\n}", "function makeWordArray(passedEnglishText) {\n return passedEnglishText.split(\" \");\n }", "metinToArray() {\r\n\r\n\r\n var metinArrayed = this.metin.split(\" \");\r\n\r\n\r\n return metinArrayed\r\n\r\n }", "function getRandomPhraseAsArray(arr) {\n const randomPhrase = arr[Math.floor(Math.random() * arr.length)];\n // showing letter of pharse and split is gaps between the words.\n return randomPhrase.toUpperCase().split('');\n}", "function filterByWord(array, string){ \n let promoFlavors = [] \n for (let i = 0; i < array.length; i++) { \n if (array[i].includes(string)) { \n promoFlavors.push(array[i]); \n } \n }\n return promoFlavors;\n}", "function get_datas_formalisees(string) {\n var i = string.length-1;\n var current_letter = \"\";\n var stack = \"\";\n do {\n current_letter = string[i];\n stack = current_letter + stack;\n i = i-1;\n } while (((current_letter != \" \") && (i !== 0)));\n stack = stack.replace(\" \",\"\");\n return [string.replace(stack,\"\"),stack];\n}", "static spongebobMemeify(text, acknowledge) {\n let split = text.split('');\n if (acknowledge && acknowledge.length && text.startsWith(acknowledge)) split.splice(0,acknowledge.length);\n return split.map((char, index) => {\n if (index % 2 === 0) return char.toLowerCase();\n else return char.toUpperCase();\n }).join('');\n }", "function createElements( sentence )\n{\n var el;\n var elements = [];\n var phrases = sentence.split( \"\\n\" );\n\t\n for( i in phrases )\n {\n el = document.createElement( \"div\" );\n $( el ).addClass( \"phrase\" ).text( phrases[i] );\n elements.push( el );\n }\n return elements;\n}", "function lettersWithStrings(data, str) {\r\n let array = []\r\n for (let i = 0; i < data.length; i++){\r\n if (data[i].includes(str)){\r\n array.push(data[i])\r\n }\r\n } \r\n return array\r\n }", "function getRandomPhraseAsArray(arr) {\n let i = Math.floor(Math.random() * phrases.length)\n return phrases[i].split(\"\");\n }", "function parse(words){\n\n\n\n}", "function getWords(food) {\n\t\tvar list = [];\n\t\tlist.push(food);\n\t\tvar food_parts = food.split(\" \");\t// break string into list\n\t\tif (food_parts.length > 1) {\n\t\t\tfood_parts.forEach(function (element, index) {\n\t\t\t\tlist.push(element);\n\t\t\t});\n\t\t}\n\t\treturn list;\n\t}", "function convert_terms_to_array(ont_term_list){\n ont_term_array=ont_term_list.split('\\n')\n //need to add another element to array, since there may not be a new line\n //at the end of the list\n ont_term_array.push('');\n if (ont_term_array=='')\n {\n alert(\"Input a list of terms!\")\n return;\n }\n filtered_array=new Array();\n for (var i=0;i<ont_term_array.length;i++){\n filtered_array.push(ont_term_array[i])\n/* if (ont_term_array[i]!=''){\n filtered_array.push(ont_term_array[i])\n }*/\n } \n return filtered_array;\n}", "function convert_terms_to_array(ont_term_list){\n ont_term_array=ont_term_list.split('\\n')\n //need to add another element to array, since there may not be a new line\n //at the end of the list\n ont_term_array.push('');\n if (ont_term_array=='')\n {\n alert(\"Input a list of terms!\")\n return;\n }\n filtered_array=new Array();\n for (var i=0;i<ont_term_array.length;i++){\n filtered_array.push(ont_term_array[i])\n/* if (ont_term_array[i]!=''){\n filtered_array.push(ont_term_array[i])\n }*/\n } \n return filtered_array;\n}", "function getRandomPhraseAsArray(arr){\n ul.textContent = \"\";\n const randomPhrase = arr[Math.floor(Math.random()*phrases.length)];\n message = randomPhrase;\n const phraseAsArray = randomPhrase.split(\"\");\n return phraseAsArray;\n }", "function extractAnswers(single)\n{\n\tvar out = [];\n\n\tif (single && typeof(single) === 'string')\n\t{\n\t\tsingle.replace(maction, function(text) {\n\t\t\t// 'text' contains everything that was inside an <maction> tag pair\n\t\t\tvar noTags = text.replace(tags, \"\");\t\t// Was \"$2\"\n\t\t\t// 'noTags' contains the flattened version of 'text'. This isn't ideal, but should be good enough.\n\t\t\tout.push(noTags);\n\t\t});\n\t}\n\n\treturn out;\n}", "function Nivel1Ejercicio2() {\n document.getElementById('text').innerHTML='';\n let CadenaDeTexto = prompt('introduse tu nombre con numeros en su interior')\n\n for (let i = 0; i < CadenaDeTexto.length; i++) {\n \n if (expRegular2.test(CadenaDeTexto[i])){\n document.getElementById('text').innerHTML+= 'He encontrado la VOCAL: ' + CadenaDeTexto[i] +' </br>';\n }\n if (expRegular3.test(CadenaDeTexto[i])){\n document.getElementById('text').innerHTML+='He encontrado la CONSONTANT: ' + CadenaDeTexto[i] + ' </br>' ;\n }\n \n if (expRegular1.test(CadenaDeTexto[i])){\n document.getElementById('text').innerHTML+='Los nombres de personas no contienen el número: ' + CadenaDeTexto[i] + ' </br>';\n }\n }\n\n}", "function parse(data){\n let temp = 0\n let answer = []\n data.split('').forEach(i => {\n if(i === 'i') temp += 1\n if(i === 'd') temp -= 1\n if(i === 's') temp = temp * temp\n if(i === 'o'){\n answer.push(temp)\n }\n })\n return answer;\n }", "function getUniqueWords(slowa) {\n \n let unikalneSlowa = [];\n\n for (let i = 0; i < slowa.length; i++) {\n\t// tu, np. [\"ala\", \"zz\"].indexOf(\"z\") zwraca -1\n\t// a, np. [\"ala\", \"z\"].indexOf(\"z\") zwraca 1\n\t// wiec powinno dzialac poprawnie\n\tif (unikalneSlowa.indexOf(slowa[i]) === -1){\n\t unikalneSlowa.push(slowa[i]);\n\t}\n }\n\n return unikalneSlowa;\n}", "function awesomesauced(strings) {\n var index = 0;\n var lengthOfArray = strings.length;\n var awesomesaucedArray = [];\n\n while (index < lengthOfArray) {\n awesomesaucedArray.push(strings[index]);\n if (index !== lengthOfArray - 1) {\n awesomesaucedArray.push(\"awesomesauce\");\n }\n index++;\n }\n console.log(awesomesaucedArray);\n}", "function textToArray(text) {\n // Trim newlines at the end.\n while (text.endsWith('\\n')) {\n text = text.substring(0, text.length - 1);\n }\n \n var newArray = text.split('\\n');\n for (var i = 0; i < newArray.length; i++) {\n newArray[i] = newArray[i].split('\\t');\n }\n return newArray;\n}", "function findTehellim() {\n let data = '';\n\n fetch(url + chapter)\n .then(result => result.json())\n .then(jsonData => data = jsonData)\n .then(function() {\n \n //Create English Text\n\n if (searchLanguage === \"eng\"){\n for(i=0;i<data.text.length;i++) {\n outputText += \"<div class='verse'>\" + (i+1) + \". \" + data.text[i] + \"</div>\";\n }\n }\n\n //Create English and Hebrew Text\n\n if (searchLanguage === \"engHeb\"){\n for(i=0;i<data.text.length;i++) {\n outputText += \"<div class='verse'>\" + (i+1) + \". \" + data.he[i] + \"</div>\" + \"<div class='verse'>\" + (i+1) + \". \" + data.text[i] + \"</div>\";\n }\n }\n\n //Create Hebrew Text\n\n if (searchLanguage === \"heb\"){\n for(i=0;i<data.text.length;i++) {\n outputText += \"<div class='verse'>\" + (i+1) + \". \" + data.he[i] + \"</div>\";\n }\n }\n\n //Appending Generated Text To Page\n\n textField.innerHTML = (outputText);\n });\n }", "function initMedia (Cadena)\r\n{\r\n var init = 0;\r\n var resultat = new Array ();\r\n var paraulaImatge;\r\n var fi = Cadena.length;\r\n tmp = Cadena;\r\n var paraules = new Array ();\r\n var paraula;\r\n first = 0;\r\n if (fi != init) {\r\n do {\r\n if (tmp.length >= 1) {\r\n cadena = getCadena ('@', '@', tmp);\r\n\tparaulaImatge = getWordImg (cadena, '#');\r\n\tresultat.push (paraulaImatge);\r\n }\r\n init = tmp.indexOf ('@', 1);\r\n tmp = tmp.substring (init, fi);\r\n }\r\n while (init != (-1) && !(tmp.length <= 1));\r\n }\r\n resultat = ordenarWordImg (resultat);\r\n return resultat;\r\n}", "function extractWords(text) {\n // creating an array of words by splitting the raw text with non-letter characters\n let words = text.split(/[(\\s!?*\\n:.,/)]+/);\n // loop to transfer all words to lower case, to count them precisely\n // (otherwise \"User\" in the beginning of the sentence is different as \"user\" in the middle)\n for (let x = 0; x < words.length; x++) {\n allWords.push(words[x].toLowerCase());\n }\n}", "function isogram(word){\n\tnewArr=[];\n\t//make lower case\n\tlower = word.toLowerCase().split(\"\");\n\tconsole.log(lower);\n\n\t//cycle through word\n\tfor(var i=0; i<lower.length; i++){\n\t\t\n\t\tif(newArr.indexOf(lower[i])==-1){\n\t\t\tnewArr.push(lower[i]);\t\t\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn true;\n}", "function getIgnoreKeywords_onomatopoeia_singles_list(args) {\n\t\tvar ono = args.ono;\n\t\tvar maxonolength = getMaxOnomatopoeiaLength();\n\t\t\n\t\tvar singlelist = [];\n\t\tvar word = '';\n\t\t\n\t\tfor(var i = 1; i <= maxonolength; i++) {\n\t\t\tvar newword = word + ono;\n\t\t\tsinglelist.push(newword);\n\t\t\tword = newword;\n\t\t}\n\t\t\n\t\treturn singlelist;\n\t}", "createPhrases() {\r\n const phrases = [\r\n new Phrase('easy peasy lemon squeezy'),\r\n new Phrase('apple of my eye'),\r\n new Phrase('down to the wire'),\r\n new Phrase('rome was not built in a day'),\r\n new Phrase('too many cooks in the kitchen')\r\n ];\r\n return phrases;\r\n }", "function answerArray() {\n for (var i = 0; i < currentWord.length; i++) {\n placeHolder.push(\" _ \");\n }\n console.log(placeHolder);\n var screen = document.getElementById(\"placeholder\");\n // got this from a cheat sheet https://gist.github.com/thegitfather/9c9f1a927cd57df14a59c268f118ce86#add-elements-to-the-dom\n var h1Text = document.createTextNode(placeHolder.join(\"\"));\n screen.appendChild(h1Text);\n }", "createPhrases() {\n let phraseOne = new Phrase('life is like a box of chocolates');\n let phraseTwo = new Phrase('there is no trying');\n let phraseThree = new Phrase('may the force be with you');\n let phraseFour = new Phrase('you have to see the matrix of yourself');\n let phraseFive = new Phrase('you talking to me');\n let arrayOfPhrases = [phraseOne, phraseTwo, phraseThree, phraseFour, phraseFive];\n return arrayOfPhrases;\n }", "function displayContentToArray(string){\n return string.split(\"\");\n}", "function getRandomPhraseAsArray(arr) {\n\tlet randomPhrase = phrases[Math.floor(Math.random() * phrases.length)];\n\treturn randomPhrase.split(\"\");\n}", "function intoWords(text) {\n\tvar words = new Array()\n\tvar html = false\n\tvar last_word = 0\n\n\tfor (var i = 0; i < text.length; ++i) {\n\t\tvar character = text.substr(i, 1)\n\n\t\tif (html == true && character != \">\")\n\t\t\tcontinue\n\n\t\tswitch (character) {\n\t\t\tcase \".\":\n\t\t\tcase \",\":\n\t\t\tcase \";\":\n\t\t\tcase \":\":\n\t\t\tcase \"?\":\n\t\t\tcase \"!\":\n\t\t\tcase \")\":\n\t\t\tcase \"]\":\n\t\t\tcase \" \":\n\t\t\t\twords.push(text.substring(last_word, i + 1))\n\t\t\t\tlast_word = i + 1\n\t\t\t\tbreak\n\t\t\tcase \"<\":\n\t\t\t\tif (last_word != i) {\n\t\t\t\t\twords.push(text.substring(last_word, i))\n\t\t\t\t\tlast_word = i\n\t\t\t\t}\n\n\t\t\t\thtml=true\n\t\t\t\tbreak\n\t\t\tcase \">\":\n\t\t\t\twords.push(text.substring(last_word, i + 1))\n\t\t\t\tlast_word = i + 1\n\n\t\t\t\thtml=false\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\treturn words\n}", "function dataComplier(data){\n let arr = data.split(\" \");\n let imgURLs = arr.filter(index => checkURL(index));\n let textarr = arr.filter(index => !checkURL(index));\n let text = textarr.join(\" \");\n return [text,imgURLs]\n }", "function getRandomPhraseAsArray(arr) {\n return arr[Math.floor(Math.random() *arr.length)].split('');\n}", "function filterWords(text) {\r\n\r\n text = text.split(' '); //split the string by spaces\r\n\r\n //create an array to hold unnecessary words from stopWords.js file\r\n var filter_words = [];\r\n\r\n //check if stopWordsList variable is undefined\r\n if (stopWordsList !== undefined) {\r\n filter_words = stopWordsList.StopWordsList;\r\n } \r\n\r\n //append all necessary words one by one to a string 'text'\r\n text = text.filter(function (el) {\r\n return !filter_words.includes(el);\r\n });\r\n\r\n console.log(\"Annotator application : NES WORDS = \" + text);\r\n \r\n return text; //return the string text with filtered words\r\n\r\n}", "function extendText() {\n findTextNodes(document.body).forEach(node => {\n node.textContent = node.textContent.replace(/Björn Höcke/g, 'Bernd Höcke');\n data.forEach(item => {\n if (item.isPresent) {\n const parts = node.textContent.split(getNameRegex(item.name));\n for (let i = parts.length - 1; i > 0; i--) {\n const isEndOfSentence = /^\\s*[^a-z 0-9]/i.test(parts[i]) || parts[i] === '';\n parts.splice(i, 0, getNewString(item, isEndOfSentence));\n }\n node.textContent = parts.join('');\n }\n });\n });\n}", "function noEmptyStrings (para) {\n let newArray = []\n for (let i = 0; i < para.length; i++){\n if(para[i] !== \"\"){\n newArray.push(para[i]);\n }\n } \n return newArray;\n }", "function text_to_array(text)\n {\n var byte, bdx = 0, \n len = text.length, \n res = new Array(len),\n bytes = text_to_bytes(text)\n for(;;)\n { \n byte = get_byte(bytes, bdx)\n if(byte == 0)\n break\n res[bdx++] = byte\n }\n free(bytes)\n verify(bdx == text.length, \"UTF-8 not yet supported\")\n return res\n }", "function processText(text) {\n var displayText = \"\";\n var offset = 0;\n var start = -1;\n var positiveRanges = [];\n var negativeRanges = [];\n var marked = [];\n\n for (var i = 0; i < text.length; i++) {\n var char = text[i];\n var array = null;\n\n switch (char) {\n case Importance.POSITIVE:\n array = positiveRanges;\n break;\n case Importance.NEGATIVE:\n array = negativeRanges;\n break;\n default:\n displayText += char;\n marked.push(false);\n continue;\n }\n\n var relIndex = i - offset;\n if (start === -1) {\n start = relIndex;\n } else {\n array.push({\n start: start,\n end: relIndex\n });\n start = -1;\n }\n offset++;\n }\n\n vm.game.displayText = displayText;\n vm.game.marked = marked;\n vm.game.ranges = {\n positive: positiveRanges,\n negative: negativeRanges\n };\n }", "words(number,asText){\n let obj;\n if(asText){\n obj = \"\";\n for(let i = 0 ; i < number ;i++){\n let index = Math.floor((Math.random() * words.length));\n obj += words[index] + \" \";\n }\n }else{\n obj = [];\n for(let i = 0 ; i < number ;i++){\n let index = Math.floor((Math.random() * words.length));\n obj.push(words[index]);\n }\n }\n return obj;\n }", "words(number,asText){\n let obj;\n if(asText){\n obj = \"\";\n for(let i = 0 ; i < number ;i++){\n let index = Math.floor((Math.random() * words.length));\n obj += words[index] + \" \";\n }\n }else{\n obj = [];\n for(let i = 0 ; i < number ;i++){\n let index = Math.floor((Math.random() * words.length));\n obj.push(words[index]);\n }\n }\n return obj;\n }", "function getEpiphoraCount() {\r\n text = workarea.textContent;\r\n \r\n epiphora_candidates = [];\r\n first_index = 0;\r\n last_index = 0;\r\n for(i=0; i < sentences.length-1; i++) {\r\n if(sentences[i].match(/\\S+$/) == null) {\r\n last_word = sentences[i].match(/\\S+\\s$/)[0];\r\n }\r\n else {\r\n last_word = sentences[i].match(/\\S+$/)[0];\r\n }\r\n if(last_word.match(\"said\")) {\r\n continue;\r\n }\r\n first_index = i;\r\n last_index = first_index;\r\n for(j=i+1; j<sentences.length; j++) {\r\n if(last_word == sentences[j].match(last_word.replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\*/g, \"[*]\").replace(/\\?/g,\"[?]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\"))) {\r\n last_index = j;\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n if(last_index > first_index) {\r\n tmp = [];\r\n tmp2 = [];\r\n for(first_index; first_index <= last_index; first_index++) {\r\n tmp.push(sentences[first_index]);\r\n tmp2.push(first_index);\r\n }\r\n epiphora_candidates.push([last_word, tmp, tmp2]);\r\n i = last_index;\r\n }\r\n }\r\n flag = true;\r\n if(epiphora_candidates.length != 0) {\r\n while(flag) {\r\n control_array = [];\r\n for(i=0; i<epiphora_candidates.length; i++) {\r\n last_words = new RegExp(\"\\\\S+\\\\s\" + epiphora_candidates[i][0].replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\").replace(/\\?/g,\"[?]\"));\r\n if(epiphora_candidates[i][1][0].match(last_words) != null) {\r\n last_words = epiphora_candidates[i][1][0].match(last_words)[0];\r\n tmp = [];\r\n for(j=0; j < epiphora_candidates[i][1].length; j++) {\r\n if(epiphora_candidates[i][1][j].match(last_words.replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\").replace(/\\?/g,\"[?]\")) != null) {\r\n tmp.push(true);\r\n }\r\n else {\r\n tmp.push(false);\r\n }\r\n }\r\n control_array.push(tmp);\r\n if(tmp.indexOf(false) == -1) {\r\n epiphora_candidates[i][0] = last_words;\r\n }\r\n }\r\n }\r\n for(i=0; i<control_array.length; i++) {\r\n if(control_array[i].indexOf(false) != -1) {\r\n control_array[i] = false;\r\n }\r\n else {\r\n control_array[i] = true;\r\n }\r\n }\r\n if(control_array.indexOf(false) != -1){\r\n flag = false;\r\n }\r\n else {\r\n flag = true;\r\n }\r\n }\r\n\r\n flag = true;\r\n while(flag) {\r\n control_array = [];\r\n for(i=0; i<epiphora_candidates.length; i++) {\r\n last_words = new RegExp(\"\\\\S+\\\\s\" + epiphora_candidates[i][0].replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\").replace(/\\?/g,\"[?]\"));\r\n if(epiphora_candidates[i][1][0].match(last_words) != null) {\r\n last_words = epiphora_candidates[i][1][0].match(last_words)[0];\r\n tmp = [];\r\n for(j=0; j < epiphora_candidates[i][1].length; j++) {\r\n if(epiphora_candidates[i][1][j].match(last_words.replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\").replace(/\\?/g,\"[?]\")) != null) {\r\n tmp.push(true);\r\n }\r\n else {\r\n tmp.push(false);\r\n }\r\n }\r\n control_array.push(tmp);\r\n if(tmp.indexOf(false) == -1) {\r\n epiphora_candidates[i][0] = last_words;\r\n }\r\n }\r\n }\r\n for(i=0; i<control_array.length; i++) {\r\n if(control_array[i].indexOf(false) != -1) {\r\n control_array[i] = true;\r\n }\r\n else {\r\n control_array[i] = false;\r\n }\r\n }\r\n if(control_array.indexOf(false) == -1){\r\n flag = false;\r\n }\r\n else {\r\n flag = true;\r\n }\r\n }\r\n }\r\n\r\n for(i=0; i < epiphora_candidates.length; i++) {\r\n delete epiphora_candidates[i].pop()\r\n }\r\n\r\n temp = [];\r\n for(i=0; i<epiphora_candidates.length; i++) {\r\n epiphora_length = epiphora_candidates[i][0].split(\" \").length;\r\n count = 0;\r\n for(j=0; j<epiphora_candidates[i][1].length; j++) {\r\n if(epiphora_candidates[i][1][j].split(\" \").length == epiphora_length && epiphora_length < 5) {\r\n count++;\r\n }\r\n }\r\n if (count!=epiphora_candidates[i][1].length) {\r\n temp.push(epiphora_candidates[i])\r\n }\r\n }\r\n epiphora_candidates = temp;\r\n\r\n result = epiphora_candidates;\r\n return result.length;\r\n}", "function strToArray(str) {\r\n\r\n // -------------------- Your Code Here --------------------\r\n\r\n var arr = [];\r\n var currentWord = \"\";\r\n \r\n for (var i = 0; i < str.length; i++) {\r\n \r\n if ((str[i] === \" \") && (currentWord !== \"\")){\r\n arr.push(currentWord);\r\n currentWord = \"\";\r\n \r\n } else if (str[i] !== \" \") {\r\n currentWord += str[i];\r\n }\r\n }\r\n \r\n if (currentWord !== \"\") {\r\n arr.push(currentWord);\r\n }\r\n \r\n return arr;\r\n\r\n // --------------------- End Code Area --------------------\r\n}", "function taskFive() {\n //For loop that let us target each individual string in the Array\n for (let i = 0; i < fruits.length; i++) {\n //if the string matches one of these strings, push the string to \"trash\"\n if (fruits[i] === \"apelsin\" || fruits[i] === \"päron\") {\n trash.push(fruits[i]);\n }\n\n //Otherwise push the string to \"eatable\"\n else {\n eatable.push(fruits[i]);\n }\n }\n\n //when the loop is done, display \"eatable\" and trash, also separate the Arrays with a \"<br>\" and display the titles with bold\n document.getElementById(\"answer-five\").innerHTML =\n \"Ätbara frukter: \".bold() + eatable + \"<br>\" + \"Skräp: \".bold() + trash;\n}" ]
[ "0.60870373", "0.60269594", "0.59192", "0.5849376", "0.58275753", "0.5768264", "0.5749284", "0.57174265", "0.5680814", "0.5671406", "0.5647099", "0.5616993", "0.560509", "0.5601543", "0.5584168", "0.55694354", "0.5465506", "0.5458776", "0.54506093", "0.5445655", "0.5445542", "0.54381406", "0.5410559", "0.5406144", "0.53934836", "0.53929037", "0.53867215", "0.53855735", "0.53592426", "0.5354923", "0.5334235", "0.5333689", "0.5313605", "0.5296982", "0.5296602", "0.5280521", "0.5273143", "0.52527434", "0.52408856", "0.5240462", "0.5229764", "0.52285", "0.52263737", "0.5216057", "0.52132016", "0.5206219", "0.52049077", "0.5203506", "0.52022016", "0.5200777", "0.5197432", "0.51912063", "0.51898736", "0.51897347", "0.5183493", "0.5178486", "0.51691645", "0.5163098", "0.515509", "0.51516825", "0.514961", "0.51450664", "0.51306355", "0.51166034", "0.511152", "0.5102173", "0.50994456", "0.5093947", "0.5078991", "0.5073303", "0.5073303", "0.5064079", "0.5057434", "0.50553465", "0.50509036", "0.5048658", "0.50445056", "0.504431", "0.504086", "0.503908", "0.5033299", "0.50235516", "0.50226367", "0.5021914", "0.502102", "0.50202835", "0.50196904", "0.5019537", "0.50167125", "0.50132334", "0.50097877", "0.5005261", "0.5004409", "0.50016195", "0.49998116", "0.49970707", "0.49953035", "0.49953035", "0.49945945", "0.4992138", "0.49915445" ]
0.0
-1
This function searches for anadiplosises in the text and forms an array with them.
function getAnadiplosisCount() { text = workarea.textContent; search_string = "[a-zA-Zа-яА-ЯёЁ]+[.?!;]{1,3}\\s[a-zA-Zа-яА-ЯёЁ]+"; middle_words = text.match(/[a-zA-Zа-яА-ЯёЁ]+[.?!;]{1,3}\s[a-zA-Zа-яА-ЯёЁ]+/g); new_phrases = []; result = []; if(middle_words != null) { for (i=0; i < middle_words.length; i++) { phrase = middle_words[i]; phrase = phrase.toLowerCase(); near_space = phrase.match(/[.?!;]{1,3}\s/)[0]; phrase = phrase.split(near_space); if(phrase[0] == phrase[1]) { new_phrases.push(middle_words[i]); } } result = new_phrases; tmp = []; for(key in result) { if(tmp.indexOf(result[key]) == -1) { tmp.push(result[key]); } } result = tmp; count = 0; search_string = "([a-zA-Zа-яА-ЯёЁ]+\\s){0}" + search_string + "(\\s[a-zA-Zа-яА-ЯёЁ]+){0}"; while(new_phrases.length != 0) { middle_words = []; count++; search_reg = new RegExp("\\{"+(count-1)+"\\}", 'g'); search_string = search_string.replace(search_reg, "{"+count+"}"); middle_words = text.match(new RegExp(search_string,"g")); new_phrases = []; if(middle_words != null) { for (i=0; i < middle_words.length; i++) { phrase = middle_words[i]; phrase = phrase.toLowerCase(); near_space = phrase.match(/[^a-zA-Zа-яА-ЯёЁ]{1,3}\s/)[0]; phrase = phrase.split(near_space); temp = middle_words[i].split(near_space); for(j=0; j<phrase.length-1; j++) { if(phrase[j] == phrase[j+1]) { new_phrases.push(temp[j] + near_space + temp[j+1]); } } } for(key in new_phrases) { result.push(new_phrases[key]); } } } tmp = []; for(key in result) { if(tmp.indexOf(result[key]) == -1) { tmp.push(result[key]); } } result = tmp; } return result.length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "autoMode(text) {\n let array = [];\n let splitText = text.split(' ').filter((sub) => (sub !== ''));\n \n if (!splitText) {\n console.error('Something was wrong.');\n return;\n }\n \n while (splitText.length > 0) {\n // split every letter by the spaces x\n let brokeLine = this.autoBreak(splitText);\n \n array.push(brokeLine);\n splitText.splice(0, this.sumLetter());\n }\n \n return array;\n }", "function text_to_array(text, array)\n{\n\tvar array = array || [], i = 0, l;\n\tfor (l = text.length % 8; i < l; ++i)\n\t\tarray.push(text.charCodeAt(i) & 0xff);\n\tfor (l = text.length; i < l;)\n\t\t// Unfortunately unless text is cast to a String object there is no shortcut for charCodeAt,\n\t\t// and if text is cast to a String object, it's considerably slower.\n\t\tarray.push(text.charCodeAt(i++) & 0xff, text.charCodeAt(i++) & 0xff, text.charCodeAt(i++) & 0xff, text.charCodeAt(i++) & 0xff,\n\t\t\ttext.charCodeAt(i++) & 0xff, text.charCodeAt(i++) & 0xff, text.charCodeAt(i++) & 0xff, text.charCodeAt(i++) & 0xff);\n\treturn array;\n}", "split(text) {\n text = text.trim();\n let separators = new Set([' ', '\\n', '\\t', '\\v']);\n let i = 0;\n let wordArray = [''];\n for (let j = 0; j < text.length; j++) {\n if (separators.has(text[j])) {\n if (wordArray[i] === \"\") {\n continue;\n } else {\n wordArray[++i] = \"\";\n }\n } else {\n wordArray[i] += text[j];\n }\n }\n let ultimaPalabra = wordArray[wordArray.length - 1];\n if (ultimaPalabra == \"\" || separators.has(ultimaPalabra[ultimaPalabra.length - 1])) {\n wordArray.pop();\n }\n return wordArray;\n }", "function getTextArr() {\n s = document.getElementById(\"textToReadWrapper\").innerHTML;\n s = s.replace(/(^\\s*)|(\\s*$)/gi, \"\");\n s = s.replace(/[ ]{2,}/gi, \" \");\n s = s.replace(/\\n /, \"\\n\");\n textToAdd = s.split(' ');\n\n }", "function cortaPalabras(texto) {\n\n let palabras = [];\n let palabra = '';\n for ( let letra = 0; letra < texto.length; letra++ ) {\n if ( texto[letra] !== ' ' ) {\n palabra += texto[letra];\n } else if ( palabra !== '' ) {\n palabras.push( palabra );\n palabra = '';\n }\n\n if ( letra == texto.length - 1 && palabra !== '') palabras.push( palabra );\n }\n\n console.log(palabras);\n return palabras;\n}", "function textToPattern(text)\n{\n var result = [];\n\n for(var i=0; i<text.length; i++)\n {\n if (i != 0) result.push(0x0); // mandatory spacing\n\n switch (text.charAt(i))\n {\n case '0':\n result.push(0x6, 0x9, 0x6);\n break;\n\n case '1':\n result.push(0x4, 0xF);\n break;\n\n case '2':\n result.push(0x5, 0xB, 0x5);\n break;\n\n case '3':\n result.push(0x9, 0x9, 0x6);\n break;\n\n case '4':\n result.push(0xE, 0x3, 0x2);\n break;\n }\n }\n\n return result;\n}", "function wave(text){\n let finalArray = []\nfor ( let i = 0; i < text.length; i++) {\n let arr = text.split('')\n if (arr[i] === ' ') {\n continue;\n }\n arr[i] = arr[i].toUpperCase()\n\n finalArray.push(arr.join(''))\n}\n return finalArray\n}", "function makeArray(word) {\n var word_array = [];\n for (var i = 0; i < word.length; i++) {\n word_array.push(word.charAt(i));\n }\n return word_array;\n }", "function makeToChars(text) {\n var words = [];\n //spliting text into words\n var wordArray = text.split(' ');\n //spliting words into characters\n for (var i=0; i < wordArray.length; i++) {\n words[i] = wordArray[i].split('');\n }\n return words;\n}", "function cleanEnzymeReaction(text) {\n return text.reduce(\n (acc, crt) => {\n crt.trim().split(/\\s+/).forEach(c => acc.push(c));\n return acc;\n },\n []);\n}", "function text_to_array(text)\n {\n var byte, bdx = 0, \n len = text.length, \n res = new Array(len),\n bytes = text_to_bytes(text)\n for(;;)\n { \n byte = get_byte(bytes, bdx)\n if(byte == 0)\n break\n res[bdx++] = byte\n }\n free(bytes)\n verify(bdx == text.length, \"UTF-8 not yet supported\")\n return res\n }", "function espaciosinifin(texto){\n var string = texto;\n var caracter;\n caracter = string.substr(0,1);\n while(caracter == \" \"){\n string = string.substr(1,string.length);\n caracter = string.substr(0,1);\n }\n \n caracter = string.substr(string.length-1,1);\n while(caracter == \" \"){\n string = string.substr(0,string.length-1);\n caracter = string.substr(string.length-1,1);\n }\n \n return string;\n }", "function espaciosinifin(texto){\n var string = texto;\n var caracter;\n caracter = string.substr(0,1);\n while(caracter == \" \"){\n string = string.substr(1,string.length);\n caracter = string.substr(0,1);\n }\n \n caracter = string.substr(string.length-1,1);\n while(caracter == \" \"){\n string = string.substr(0,string.length-1);\n caracter = string.substr(string.length-1,1);\n }\n \n return string;\n }", "function getArray (s) {\n var a = s.split('\\n')\n return a.map(v => v.split('').map(vv => {\n if (vv === '*') {\n return 1\n } else {\n return 0\n }\n }))\n}", "function mach_mini_iimeil_laesbar(text) {\n var s = text.split('');\n for (var i = 0; i < s.length; i++) { s[i] = luukoeptaibel[text[i]]; }\n return s.join('');\n}", "function intoWords(text) {\n\tvar words = new Array()\n\tvar html = false\n\tvar last_word = 0\n\n\tfor (var i = 0; i < text.length; ++i) {\n\t\tvar character = text.substr(i, 1)\n\n\t\tif (html == true && character != \">\")\n\t\t\tcontinue\n\n\t\tswitch (character) {\n\t\t\tcase \".\":\n\t\t\tcase \",\":\n\t\t\tcase \";\":\n\t\t\tcase \":\":\n\t\t\tcase \"?\":\n\t\t\tcase \"!\":\n\t\t\tcase \")\":\n\t\t\tcase \"]\":\n\t\t\tcase \" \":\n\t\t\t\twords.push(text.substring(last_word, i + 1))\n\t\t\t\tlast_word = i + 1\n\t\t\t\tbreak\n\t\t\tcase \"<\":\n\t\t\t\tif (last_word != i) {\n\t\t\t\t\twords.push(text.substring(last_word, i))\n\t\t\t\t\tlast_word = i\n\t\t\t\t}\n\n\t\t\t\thtml=true\n\t\t\t\tbreak\n\t\t\tcase \">\":\n\t\t\t\twords.push(text.substring(last_word, i + 1))\n\t\t\t\tlast_word = i + 1\n\n\t\t\t\thtml=false\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\treturn words\n}", "function splitTextToCharacters(text) {\n return Array.from ? Array.from(text) : text.split('');\n}", "function makeWordArray(passedEnglishText) {\n return passedEnglishText.split(\" \");\n }", "function arrayer(song) {\n let arrayOfParts = [];\n let startIndex = 1;\n let endIndex = 0;\n while (song) {\n endIndex = song.indexOf(\"[\", startIndex);\n if (endIndex === -1) {\n arrayOfParts.push(song.slice(startIndex - 1, song.length - 1));\n break;\n }\n arrayOfParts.push(song.slice(startIndex - 1, endIndex - 1));\n startIndex = endIndex + 1; \n }\n console.log(arrayOfParts[0].charCodeAt(10)); //87\n return arrayOfParts;\n }", "function strToArray(str) {\r\n\r\n // -------------------- Your Code Here --------------------\r\n\r\n var arr = [];\r\n var currentWord = \"\";\r\n \r\n for (var i = 0; i < str.length; i++) {\r\n \r\n if ((str[i] === \" \") && (currentWord !== \"\")){\r\n arr.push(currentWord);\r\n currentWord = \"\";\r\n \r\n } else if (str[i] !== \" \") {\r\n currentWord += str[i];\r\n }\r\n }\r\n \r\n if (currentWord !== \"\") {\r\n arr.push(currentWord);\r\n }\r\n \r\n return arr;\r\n\r\n // --------------------- End Code Area --------------------\r\n}", "function getAnaphoraCount() {\r\n text = workarea.textContent;\r\n anaphora_candidates = [];\r\n first_index = 0;\r\n last_index = 0;\r\n for(i=0; i < sentences.length-1; i++) {\r\n if(sentences[i] == \"`I must.\") debugger;\r\n first_word = sentences[i].match(/\\S+/)[0];\r\n check_higher_case = first_word.match(/[A-ZА-ЯЁ]/);\r\n if(check_higher_case == null) {\r\n continue;\r\n }\r\n if(first_word.match(\"Chapter\") != null || first_word.toLowerCase() == \"a\" || first_word.toLowerCase() == \"an\" || first_word.toLowerCase() == \"the\") {\r\n continue;\r\n }\r\n first_index = i;\r\n last_index = first_index;\r\n for(j=i+1; j<sentences.length; j++) {\r\n if(first_word == sentences[j].match(/\\S+/)[0]) {\r\n last_index = j;\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n if(last_index > first_index) {\r\n tmp = [];\r\n for(first_index; first_index <= last_index; first_index++) {\r\n tmp.push(sentences[first_index]);\r\n }\r\n anaphora_candidates.push([first_word, tmp]);\r\n i = last_index;\r\n }\r\n }\r\n flag = true;\r\n if(anaphora_candidates.length !=0) {\r\n while(flag) {\r\n control_array = [];\r\n for(i=0; i<anaphora_candidates.length; i++) {\r\n first_words = new RegExp(anaphora_candidates[i][0].replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\") + \"((\\\\.|\\\\!){3}|\\\\.|\\\\?|\\\\!){0,1}\\\\s\\\\S+\");\r\n if(anaphora_candidates[i][1][0].match(first_words) != null) {\r\n first_words = anaphora_candidates[i][1][0].match(first_words)[0];\r\n tmp = [];\r\n for(j=0; j < anaphora_candidates[i][1].length; j++) {\r\n if(anaphora_candidates[i][1][j].match(first_words.replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\")) != null) {\r\n tmp.push(true);\r\n }\r\n else {\r\n tmp.push(false);\r\n }\r\n }\r\n control_array.push(tmp);\r\n if(tmp.indexOf(false) == -1) {\r\n anaphora_candidates[i][0] = first_words;\r\n }\r\n }\r\n }\r\n \r\n for(i=0; i<control_array.length; i++) {\r\n if(control_array[i].indexOf(false) != -1) {\r\n control_array[i] = false;\r\n }\r\n else {\r\n control_array[i] = true;\r\n }\r\n }\r\n if(control_array.indexOf(false) != -1){\r\n flag = false;\r\n }\r\n else {\r\n flag = true;\r\n }\r\n }\r\n\r\n\r\n flag = true;\r\n while(flag) {\r\n control_array = [];\r\n for(i=0; i<anaphora_candidates.length; i++) {\r\n first_words = new RegExp(anaphora_candidates[i][0].replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\") + \"((\\\\.|\\\\!){3}|\\\\.|\\\\?|\\\\!){0,1}\\\\s\\\\S+\");\r\n if(anaphora_candidates[i][1][0].match(first_words) != null) {\r\n first_words = anaphora_candidates[i][1][0].match(first_words)[0];\r\n tmp = [];\r\n for(j=0; j < anaphora_candidates[i][1].length; j++) {\r\n if(anaphora_candidates[i][1][j].match(first_words.replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\")) != null) {\r\n tmp.push(true);\r\n }\r\n else {\r\n tmp.push(false);\r\n }\r\n }\r\n control_array.push(tmp);\r\n if(tmp.indexOf(false) == -1) {\r\n anaphora_candidates[i][0] = first_words;\r\n }\r\n }\r\n }\r\n for(i=0; i<control_array.length; i++) {\r\n if(control_array[i].indexOf(false) != -1) {\r\n\r\n control_array[i] = true;\r\n }\r\n else {\r\n control_array[i] = false;\r\n }\r\n }\r\n if(control_array.indexOf(false) == -1){\r\n flag = false;\r\n }\r\n else {\r\n flag = true;\r\n }\r\n\r\n }\r\n }\r\n temp = [];\r\n for(i=0; i<anaphora_candidates.length; i++) {\r\n anaphora_length = anaphora_candidates[i][0].split(\" \").length;\r\n count = 0;\r\n for(j=0; j<anaphora_candidates[i][1].length; j++) {\r\n if(anaphora_candidates[i][1][j].split(\" \").length == anaphora_length && anaphora_length < 5) {\r\n count++;\r\n }\r\n }\r\n if (count!=anaphora_candidates[i][1].length) {\r\n temp.push(anaphora_candidates[i])\r\n }\r\n }\r\n anaphora_candidates = temp;\r\n for(i=0; i<anaphora_candidates.length; i++) {\r\n if(anaphora_candidates[i][0][anaphora_candidates[i][0].length-1] == \".\") {\r\n anaphora_candidates[i][0] = anaphora_candidates[i][0].substring(0, anaphora_candidates[i][0].length-1);\r\n }\r\n }\r\n result = anaphora_candidates;\r\n return result.length\r\n}", "function splitLetters(word) {\n let content = word.textContent;\n word.textContent = \"\";\n let letters = [];\n\n for (let i = 0; i < content.length; i++) {\n let letter = document.createElement(\"span\");\n letter.className = \"letter\";\n\n if (content.charAt(i) === \"_\") {\n letter.style.opacity = \"0\";\n };\n\n letter.textContent = content.charAt(i);\n word.appendChild(letter);\n letters.push(letter);\n }\n \n wordArray.push(letters);\n }", "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 inputToArray(input){\r\n\r\n return input.match(/\\S+/g);\r\n}", "function getRandomPhraseAsArray(arr) {\n var a = arr[Math.floor(Math.random() * 6)];\n const b = [];\n \n for (let i = 0; i < a.length; i++) {\n b.push(a.charAt(i));\n }\n\n return b\n}", "function espaciosinifin(texto){\n var string = texto;\n var caracter;\n caracter = string.substr(0,1);\n while(caracter == \" \"){\n string = string.substr(1,string.length);\n caracter = string.substr(0,1);\n }\n\n caracter = string.substr(string.length-1,1);\n while(caracter == \" \"){\n string = string.substr(0,string.length-1);\n caracter = string.substr(string.length-1,1);\n }\n\n return string;\n }", "function espaciosinifin(texto){\n var string = texto;\n var caracter;\n caracter = string.substr(0,1);\n while(caracter == \" \"){\n string = string.substr(1,string.length);\n caracter = string.substr(0,1);\n }\n\n caracter = string.substr(string.length-1,1);\n while(caracter == \" \"){\n string = string.substr(0,string.length-1);\n caracter = string.substr(string.length-1,1);\n }\n\n return string;\n }", "function duplicateEncode(word){\n var newArra = [];\n var wordArr = word.toLowerCase().split(\"\");\n var x;\n for (var i = 0; i < wordArr.length; i++) {\n x = searchElement(wordArr, wordArr[i])\n if(x.length > 1){\n newArra.push(')');\n }\n else {\n newArra.push('(');\n }\n }\n return newArra.join(\"\");\n}", "function split(text) {\n\t\t\t\tvar len = text.length;\n\t\t\t\tvar arr = [];\n\t\t\t\tvar i = 0;\n\t\t\t\tvar brk = 0;\n\t\t\t\tvar level = 0;\n\n\t\t\t\twhile (i + 2 <= len) {\n\t\t\t\t\tif (text.slice(i, i + 2) === '[[') {\n\t\t\t\t\t\tlevel += 1;\n\t\t\t\t\t\ti += 1;\n\t\t\t\t\t} else if (text.slice(i, i + 2) === ']]') {\n\t\t\t\t\t\tlevel -= 1;\n\t\t\t\t\t\ti += 1;\n\t\t\t\t\t} else if (level === 0 && text[i] === ',' && text[i - 1] !== '\\\\') {\n\t\t\t\t\t\tarr.push(text.slice(brk, i).trim());\n\t\t\t\t\t\ti += 1;\n\t\t\t\t\t\tbrk = i;\n\t\t\t\t\t}\n\t\t\t\t\ti += 1;\n\t\t\t\t}\n\t\t\t\tarr.push(text.slice(brk, i + 1).trim());\n\t\t\t\treturn arr;\n\t\t\t}", "function partiallyHide(phrase) {\n let arr = [];\n let f = phrase.split(' ');\n const m = f.map(word => word.split(''));\n\n for (let i = 0; i < m.length; i++) {\n if (m[i].length <= 2) {\n arr.push(m[i].join(''));\n } else if (m[i].length > 2) {\n \n }\n }\n return arr;\n}", "function textToArray(text) {\n // Trim newlines at the end.\n while (text.endsWith('\\n')) {\n text = text.substring(0, text.length - 1);\n }\n \n var newArray = text.split('\\n');\n for (var i = 0; i < newArray.length; i++) {\n newArray[i] = newArray[i].split('\\t');\n }\n return newArray;\n}", "function getWords(text)\n{\n let startWord = -1;\n let ar = [];\n \n for(let i = 0; i <= text.length; i++)\n {\n let c = i < text.length ? text[i] : \" \";\n\n if (!isSeparator(c) && startWord < 0)\n {\n startWord = i;\n }\n \n if (isSeparator(c) && startWord >= 0)\n {\n let word = text.substring(startWord, i);\n ar.push(word);\n \n startWord = -1;\n }\n }\n\n return ar;\n}", "function prepphrase(){\n var presponse=[];\n var array=pp[r(pp)]\n if (array==pp1){\n presponse.push(array[0][r(array[0])])\n presponse.push(nbar())\n }\n else{presponse.push('')}\n return presponse;\n}", "function getUniqueArray(text, minLength = 0) {\n\t// Split paragraph text into an array of char\n\tsplitText = text.split(\"\");\n \n // Creation of result array for holding output\n // Creation of remainingLimit variable for holding how many characters can be cycled through\n var result = [],\n \t\tremainingLimit = splitText.length - minLength;\n \n // Loop for cycling through split text\n // Determines if the character is already in the result array or not\n // If not inserts character\n splitText.forEach(char => {\n\t\tif (result.includes(char))\n \tremainingLimit--;\n else if (remainingLimit > 0) {\n \tresult.push(char);\n remainingLimit--;\n }\n\t});\n \n // Prints out result\n console.log(result);\n \n}", "function splitTextToArray(textes) {\r\n\tlet textArray = textes.split(\"\\n\");\r\n\treturn textArray;\r\n}", "function pigIt(str){\n return str.split(' ').map(function(el){\n for(var i = 0; i < el.length; i ++){\n if(el.charCodeAt(i) > 64 && el.charCodeAt(i) < 91 || el.charCodeAt(i) > 96 && el.charCodeAt(i) < 123){\n return el.slice(1) + el.slice(0,1) + 'ay';\n } else {\n return el.slice(1) + el.slice(0,1)\n }\n }\n }).join(' ');\n}", "function alphabetPosition(text) {\n\tlet alphabet = \"abcdefghijklmnopqrstuvwxyz\";\n\tlet textArray = [];\n\tlet position = [];\n\n\tfor (i = 0; i < text.length; i++) {\n\t\ttextArray.push(text[i].toLowerCase());\n\t}\n\n\ttextArray.forEach((letter) => {\n\t\tfor (i = 0; i < alphabet.length; i++) {\n\t\t\tif (alphabet[i] == letter) {\n\t\t\t\tposition.push(alphabet.indexOf(alphabet[i]) + 1);\n\t\t\t}\n\t\t}\n\t});\n\n\tlet numbers = position.join(\" \");\n\tconsole.log(textArray);\n\tconsole.log(position);\n\tconsole.log(numbers);\n}", "function makeWordIntoArray() {\n for (var i=0, j=0; i<wordToGuess.length; i++) {\n printWord[j] = wordToGuess.charAt(i);\n j++\n if (wordToGuess.charAt(i) != \" \") {\n printWord[j] = false;\n } else {\n printWord[j] = true;\n }\n j++\n }\n}", "function GetText(text)\n\t{\n\t\ttext = text.split(\" \");\n\t\tvar output = \"\";\n\t\tfor (var i = 0 ; i < text.length; i++)\n\t\t{\n\t\t\tvar symbol = parseInt(text[i], 2);\n\t\t\toutput += String.fromCharCode(symbol);\n\t\t}\n\t\treturn output;\n\t}", "function sartGame(){\r\n\r\n\r\nvar randIndex= Math.floor(Math.random()*13);\r\n\r\nvar gameWord=myArray[index];\r\ngameWordArray=gameWord.split(\"\");\r\nconsole.log(gameWordArray);\r\n\r\n\r\n\r\n dashesArray=[];\r\nvar matchMade=false;\r\nfor (var index=0;index<gameWordArray.length;index++)\r\n{\r\n dashesArray.push(\"-\");\r\n\r\n}\r\nconsole.log(dashesArray);\r\n}", "_normalizeIntralineHighlights(content, highlights) {\n let contentIndex = 0;\n let idx = 0;\n const normalized = [];\n for (const hl of highlights) {\n let line = content[contentIndex] + '\\n';\n let j = 0;\n while (j < hl[0]) {\n if (idx === line.length) {\n idx = 0;\n line = content[++contentIndex] + '\\n';\n continue;\n }\n idx++;\n j++;\n }\n let lineHighlight = {\n contentIndex,\n startIndex: idx,\n };\n\n j = 0;\n while (line && j < hl[1]) {\n if (idx === line.length) {\n idx = 0;\n line = content[++contentIndex] + '\\n';\n normalized.push(lineHighlight);\n lineHighlight = {\n contentIndex,\n startIndex: idx,\n };\n continue;\n }\n idx++;\n j++;\n }\n lineHighlight.endIndex = idx;\n normalized.push(lineHighlight);\n }\n return normalized;\n }", "function ing(string) {\n var arr = string.split(/[^A-Za-z0-9'_\"-]/);\n console.log(arr);\n var newArr = [];\n for (let word of arr) {\n if (/ing$/i.test(word) === false) {\n newArr.push(word);\n }\n }\n return newArr.join(\" \");\n }", "function displayContentToArray(string){\n return string.split(\"\");\n}", "function makeDigraph(str) {\n\t\tif (!str) return false;\n\t\tvar digraph = [];\n\t\tvar strArr = str.split(\"\");\n\t\t\n\t\tfor (var i = 0; i < str.length; i++) {\n\t\t\tif (alphabetStr.indexOf(strArr[i]) == -1) continue;\n\t\t\tif (i + 1 >= str.length) digraph.push(strArr[i] + specChar);\n\t\t\telse if (strArr[i] == strArr[i + 1]) digraph.push(strArr[i] + specChar);\n\t\t\telse digraph.push(strArr[i] + strArr[++i]);\n\t\t}\n\t\treturn digraph;\n\t}", "function text_to_padded_array(x){\r\n\r\n var a = Array();\r\n var k = x.length;\r\n \r\n for (var i = 0; i < x.length; i++) {\r\n a[shift_right(i, 2)] |= shift_left((x.charCodeAt(i) & 0xFF), ((i % 4) * 8));\r\n }\r\n \r\n /* PAD */\r\n a[shift_right(k, 2)] |= shift_left(0x80, ((k % 4) * 8));\r\n \r\n var a_size = shift_right(k, 2) + 2;\r\n var length_pos = a_size - (a_size % 16) + 14;\r\n a[length_pos] = k * 8;\r\n \r\n if (debug_on) {\r\n document.writeln(\"<br>\");\r\n document.writeln(array_to_hex(a));\r\n document.writeln(\"<br>length_pos = \" + length_pos);\r\n document.writeln(\"<br>a_size = \" + a_size);\r\n }\r\n \r\n return a;\r\n}", "function getEpiphoraCount() {\r\n text = workarea.textContent;\r\n \r\n epiphora_candidates = [];\r\n first_index = 0;\r\n last_index = 0;\r\n for(i=0; i < sentences.length-1; i++) {\r\n if(sentences[i].match(/\\S+$/) == null) {\r\n last_word = sentences[i].match(/\\S+\\s$/)[0];\r\n }\r\n else {\r\n last_word = sentences[i].match(/\\S+$/)[0];\r\n }\r\n if(last_word.match(\"said\")) {\r\n continue;\r\n }\r\n first_index = i;\r\n last_index = first_index;\r\n for(j=i+1; j<sentences.length; j++) {\r\n if(last_word == sentences[j].match(last_word.replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\*/g, \"[*]\").replace(/\\?/g,\"[?]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\"))) {\r\n last_index = j;\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n if(last_index > first_index) {\r\n tmp = [];\r\n tmp2 = [];\r\n for(first_index; first_index <= last_index; first_index++) {\r\n tmp.push(sentences[first_index]);\r\n tmp2.push(first_index);\r\n }\r\n epiphora_candidates.push([last_word, tmp, tmp2]);\r\n i = last_index;\r\n }\r\n }\r\n flag = true;\r\n if(epiphora_candidates.length != 0) {\r\n while(flag) {\r\n control_array = [];\r\n for(i=0; i<epiphora_candidates.length; i++) {\r\n last_words = new RegExp(\"\\\\S+\\\\s\" + epiphora_candidates[i][0].replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\").replace(/\\?/g,\"[?]\"));\r\n if(epiphora_candidates[i][1][0].match(last_words) != null) {\r\n last_words = epiphora_candidates[i][1][0].match(last_words)[0];\r\n tmp = [];\r\n for(j=0; j < epiphora_candidates[i][1].length; j++) {\r\n if(epiphora_candidates[i][1][j].match(last_words.replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\").replace(/\\?/g,\"[?]\")) != null) {\r\n tmp.push(true);\r\n }\r\n else {\r\n tmp.push(false);\r\n }\r\n }\r\n control_array.push(tmp);\r\n if(tmp.indexOf(false) == -1) {\r\n epiphora_candidates[i][0] = last_words;\r\n }\r\n }\r\n }\r\n for(i=0; i<control_array.length; i++) {\r\n if(control_array[i].indexOf(false) != -1) {\r\n control_array[i] = false;\r\n }\r\n else {\r\n control_array[i] = true;\r\n }\r\n }\r\n if(control_array.indexOf(false) != -1){\r\n flag = false;\r\n }\r\n else {\r\n flag = true;\r\n }\r\n }\r\n\r\n flag = true;\r\n while(flag) {\r\n control_array = [];\r\n for(i=0; i<epiphora_candidates.length; i++) {\r\n last_words = new RegExp(\"\\\\S+\\\\s\" + epiphora_candidates[i][0].replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\").replace(/\\?/g,\"[?]\"));\r\n if(epiphora_candidates[i][1][0].match(last_words) != null) {\r\n last_words = epiphora_candidates[i][1][0].match(last_words)[0];\r\n tmp = [];\r\n for(j=0; j < epiphora_candidates[i][1].length; j++) {\r\n if(epiphora_candidates[i][1][j].match(last_words.replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\").replace(/\\?/g,\"[?]\")) != null) {\r\n tmp.push(true);\r\n }\r\n else {\r\n tmp.push(false);\r\n }\r\n }\r\n control_array.push(tmp);\r\n if(tmp.indexOf(false) == -1) {\r\n epiphora_candidates[i][0] = last_words;\r\n }\r\n }\r\n }\r\n for(i=0; i<control_array.length; i++) {\r\n if(control_array[i].indexOf(false) != -1) {\r\n control_array[i] = true;\r\n }\r\n else {\r\n control_array[i] = false;\r\n }\r\n }\r\n if(control_array.indexOf(false) == -1){\r\n flag = false;\r\n }\r\n else {\r\n flag = true;\r\n }\r\n }\r\n }\r\n\r\n for(i=0; i < epiphora_candidates.length; i++) {\r\n delete epiphora_candidates[i].pop()\r\n }\r\n\r\n temp = [];\r\n for(i=0; i<epiphora_candidates.length; i++) {\r\n epiphora_length = epiphora_candidates[i][0].split(\" \").length;\r\n count = 0;\r\n for(j=0; j<epiphora_candidates[i][1].length; j++) {\r\n if(epiphora_candidates[i][1][j].split(\" \").length == epiphora_length && epiphora_length < 5) {\r\n count++;\r\n }\r\n }\r\n if (count!=epiphora_candidates[i][1].length) {\r\n temp.push(epiphora_candidates[i])\r\n }\r\n }\r\n epiphora_candidates = temp;\r\n\r\n result = epiphora_candidates;\r\n return result.length;\r\n}", "getAnswerIndex(answerChar) {\n var tempText = this.text;\n var result = [];\n while(tempText.includes(answerChar)) {\n var foundIndex = tempText.indexOf(answerChar);\n result.push(foundIndex);\n tempText = tempText.replace(answerChar,\"*\");\n }\n return result;\n }", "function splitText(textOrigin) {\n const length = textOrigin.length\n let array = []\n for (let i = 0; i < length; i += 40) {\n array.push(textOrigin.substring(i, i + 40))\n }\n return array\n}", "function answerArray(word) {\n var ansArray = [];\n for (var i = 0; i < word.length; i++) {\n ansArray.push(\"_\");\n }\n return ansArray;\n}", "function introChar(targetStr, chr) {\n\tvar arr = [];\n\tvar strArr = [];\n\tfor (var i=0; i<=targetStr.length; i++) {\n\t\tstrArr = targetStr.split(\"\");\n\t\tstrArr.splice(i, 0, chr);\n\t\tarr.push(strArr.join(\"\"));\n\t}\n\treturn arr;\n}", "function SeparateTextArea(text,val)\n{\n\tvar ary = new Array(0);\n\tfor(var i=0;text.length>0;i++)\n\t{\n\t\tif(text.length<val)\n\t\t{\n\t\t\tary[i] = text.substring(0,text.length)\n\t\t\tbreak;\n\t\t}\n\t\tary[i] = text.substring(0,val);\n\t\ttext = text.substring(val,text.length)\n\t}\n\treturn ary;\n}", "function getAZArray () {\n const result = []\n for (i = 65; i <= 90 ; i++){\n result.push(String.fromCharCode(i))\n }\n return result\n \n }", "function learnAlphabet(text){\n // This just removed the newlines from the input file so they aren't rendered as part of the alphabet\n text = text.replace(/\\r?\\n?/g, '');\n var alphabet = [];\n for(var i = 0; i < text.length; i++){\n if((!alphabet.includes(text.charAt(i))) && (text.charAt(i) !== \"\\n\"))\n alphabet.push(text.charAt(i));\n }\n FINAL_ALPHABET = alphabet;\n $('#acceptedTA').val(\"Alphabet from test file: \" + alphabet);\n}", "function alphabetPosition(text) {\n let stringOfNumbers = []\n for (let i=0; i<text.length; i++) {\n const ascii = text[i].toLowerCase().charCodeAt()\n //console.log(ascii)\n //this is too specify the alphabet range \n if (ascii >=97 && ascii <=122 && ascii) stringOfNumbers.push(ascii-96)\n }\n return stringOfNumbers.join(' ')\n }", "function getRandomPhraseAsArray () {\n var result= phrase[Math.floor(Math.random() * phrase.length)]; \n result = result.split(\"\");\n return result;\n}", "function Tokens(text) {\n\ttext += \" \";\n\tvar last = \"space\";\n\tvar a = [];\n\tvar w = \"\";\n\tfor (var i = 0; i < text.length; i++) {\n\t\tvar c = classify( text[i] );\n\t\tif (joined(last, c)) {\n\t\t\tw += text[i];\n\t\t} else {\n\t\t\tif (w.trim()) {\n\t\t\t\ta.push(w);\n\t\t\t}\n\t\t\tw = text[i];\n\t\t}\n\t\tlast = c;\n\t}\n\treturn a;\n}", "function wordToArray(word) {\n var wordArray = word.split(\"\");\n return wordArray;\n }", "function gordon(a){\n return a.split(\" \").map(function(word) {\n return word.toUpperCase().replace(/A/g, \"@\").replace(/E|I|U|O/g, \"*\") + \"!!!!\"\n }).join(\" \")\n}", "function pigIt(str){\n let newArr = [];\n let arr = str.split(\" \");\n for (let i=0; i<arr.length; i++) {\n if (arr[i]!='?' && arr[i]!='!') {\n let word = arr[i];\n let letter = word.charAt(0);\n let newWord = word.slice(1) + letter + \"ay\";\n newArr.push(newWord);\n } else {\n newArr.push(arr[i]);\n }\n }\n return newArr.join(\" \");\n}", "function parse(array){\n let result = [];\n let word = [];\n let first;\n const len = array.length;\n for (let i = 0; i < len; i++){\n let sound_ = sound(array[i]);\n if (isFirst(i, array)) word.push(array[i].toUpperCase());\n if (sound_ && sound_ !== ' ' && isDifferent(i, array, word) && !(isFirst(i, array))) word.push(sound_);\n if (isEnd(i, array)) {\n Array.prototype.push.apply(result, pad(word));\n word = [];\n }\n if (sound_ === ' ') result.push(sound_);\n }\n return result.join(''); \n}", "function splitText(text, maxLength) {\n var parts = []\n if (text.length > maxLength) {\n var splitChars = ['?', '!', '.', ',', ' ', '@', '#', '\"', ';']\n var i = Math.abs(maxLength / 2)\n var found = false\n var offSet = 0\n //tired, not seeing straight. doing stupid shit now\n\n\n do {\n\n\n if (splitChars.indexOf(text.charAt(i)) > -1) {\n found = true\n }\n i++\n } while ((i < text.length) && (!found))\n //console.log(i + '/' + text.length + ' offset' + offSet)\n //no obvious splits\n if (!found) {\n i = Math.abs(text.length / 2)\n }\n\n\n parts[0] = text.substring(0, i)\n parts[1] = text.substring(i, text.length)\n } else {\n parts[0] = text\n }\n return parts\n }", "function getLines(ctx,phrase,maxPxLength,textStyle) {\n var wa=phrase.split(\" \"),\n phraseArray=[],\n lastPhrase=wa[0],\n measure=0,\n splitChar=\" \";\n if (wa.length <= 1) {\n return wa\n }\n ctx.font = textStyle;\n for (var i=1;i<wa.length;i++) {\n var w=wa[i];\n measure=ctx.measureText(lastPhrase+splitChar+w).width;\n if (measure<maxPxLength) {\n lastPhrase+=(splitChar+w);\n } else {\n phraseArray.push(lastPhrase);\n lastPhrase=w;\n }\n if (i===wa.length-1) {\n phraseArray.push(lastPhrase);\n break;\n }\n }\n return phraseArray;\n}", "analyze(text) {\n this.text = this.purify(text);\n this.index = 0;\n this.list = [];\n this.buffer = \"\";\n\n while (this.index < this.text.length) {\n this.state.transference(this.index, true);\n }\n return this.list;\n }", "function processText(text) {\n var displayText = \"\";\n var offset = 0;\n var start = -1;\n var positiveRanges = [];\n var negativeRanges = [];\n var marked = [];\n\n for (var i = 0; i < text.length; i++) {\n var char = text[i];\n var array = null;\n\n switch (char) {\n case Importance.POSITIVE:\n array = positiveRanges;\n break;\n case Importance.NEGATIVE:\n array = negativeRanges;\n break;\n default:\n displayText += char;\n marked.push(false);\n continue;\n }\n\n var relIndex = i - offset;\n if (start === -1) {\n start = relIndex;\n } else {\n array.push({\n start: start,\n end: relIndex\n });\n start = -1;\n }\n offset++;\n }\n\n vm.game.displayText = displayText;\n vm.game.marked = marked;\n vm.game.ranges = {\n positive: positiveRanges,\n negative: negativeRanges\n };\n }", "function createArrays() {\n phraseArray = [];\n blankArray = [];\n phraseArray = secretPhrase.split(\"\");\n phraseArray.forEach( () => blankArray.push(\"_\"));\n spanSecretRandom.innerHTML = blankArray.join(\" \");\n}", "function getRandomPhraseAsArray(arr) {\n const randomPhrase = arr[Math.floor(Math.random() * arr.length)];\n // showing letter of pharse and split is gaps between the words.\n return randomPhrase.toUpperCase().split('');\n}", "function getCode(){\n\nvar secretText = \"буря мглою небо кроет вихри снежные крутя то как зверь она завоет то заплачет как дитя\"\nvar code = prompt(\"Enter the code\"); //get word that need to get secret\n\nvar newArray = function(secretStr, str){\nvar secretArr = secretStr.split(''); //get array from text for code\nvar codeArr = str.split(''); //get array from code\nvar newArrayNumber = [];\nvar indexCode;\n\nfor (var i = 0; i < codeArr.length; i++) { //loop for get array from index of secret text\n\t\n\t\tindexCode = secretStr.indexOf(codeArr[i]);\n\t\tif(newArrayNumber.indexOf(indexCode)>-1){ // check repeat letters \n\t\t\tnewArrayNumber.push(secretStr.indexOf(codeArr[i],++indexCode));\n\t\t}\n\t\telse{\n\t\t\tnewArrayNumber.push(indexCode);\n\t\t}\n\n}\n\nreturn newArrayNumber;\t\t\n}\nvar secretCode = newArray(secretText,code)\nconsole.log(secretCode);\n\n/*function for get string from code*/\n\nvar strCode = function (secretStr,secretCode){\nvar secretArr = secretStr.split('');\nvar SecretString = \"\";\nfor (var i = 0; i < secretCode.length; i++) {\n\t\tif (secretCode[i] == -1){ //check empty letter\n\t\t\tSecretString += '*';\n\t\t}\n\t\telse{\n\t\t\tSecretString += secretStr[secretCode[i]]; //get string\n\t\t}\n\t\n}\n\nreturn SecretString;\n}\n\nconsole.log(strCode(secretText,secretCode));\n\n}", "function isogram(word){\n\tnewArr=[];\n\t//make lower case\n\tlower = word.toLowerCase().split(\"\");\n\tconsole.log(lower);\n\n\t//cycle through word\n\tfor(var i=0; i<lower.length; i++){\n\t\t\n\t\tif(newArr.indexOf(lower[i])==-1){\n\t\t\tnewArr.push(lower[i]);\t\t\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn true;\n}", "function tokenize(text) {\n\tvar tokens = []\n\tvar index = 0\n\tvar tindex = 0\n\twhile (index < text.length) {\n\t\t// Solo pongo los mas comunes, mientras tanto.\n\t\tif (text[index] == ' ' || text[index] == '\\t') \n\t\t\t++index\n\t\telse if (isFinite(text[index])) {\n\t\t\tvar t = ''\n\t\t\twhile (isFinite(text[index])) \n\t\t\t\tt += text[index++]\n\t\t\ttokens[tindex++] = parseInt(t)\n\t\t}\n\t\telse if (isCustom(text[index])) {\n\t\t\ttokens[tindex++] = text[index++]\n\t\t}\n\t}\n\treturn tokens\n}", "function pigLatinify(text){\r\n var splitText = text.split(\" \");\r\n\r\n splitText.forEach(function(word, i) {\r\n if(word.length === 1){\r\n splitText[i] = word + \"ay\"\r\n }else if(word.substring(0, 1) === \"<\"){\r\n \r\n }else if(word.charAt(word.length - 1) === \".\"){\r\n splitText[i] = word.substring(1, word.length - 1) + word.substring(0, 1) + \"ay.\"\r\n }else{\r\n splitText[i] = word.substring(1) + word.substring(0, 1) + \"ay\"\r\n }\r\n });\r\n\r\n return splitText.join(\" \");\r\n}", "function splitContents(text) {\n // split the slides apart\n var slides = text.split('\\n#');\n\n // handle the special cases of starting with a newline or whitespace\n if (text.startsWith('\\n'))\n slides = slides.slice(1);\n else\n slides[0] = slides[0].slice(1);\n\n // add the # character back to the start of each bit of text\n for (let i in slides) \n slides[i] = '#'.concat(slides[i]);\n return slides;\n}", "function inimes()\r\n{ \r\n jQuery.ajax({\r\n async: false,\r\n url: \"text.adv\",\r\n dataType: 'text',\r\n success: function (val) { \r\n textA = val; \r\n }\r\n });\r\n textAdv = textA.split(\"\");\r\n for(var i = 0; i < textAdv.length; i++ )\r\n {\r\n if(textAdv[i].charCodeAt(0) == 10)\r\n {\r\n textAdv[i] = \" \";\r\n }\r\n if (textAdv[i].charCodeAt(0) == 13) {\r\n //textAdv[i] = \" \";\r\n }\r\n }\r\n}", "function makeDigraph(str) {\n if (!str) return false;\n var digraph = [];\n str = str.toUpperCase();\n str = str.replace(/\\W+/g, \"\");\n str = str.replace(cipher.subCh.sub, cipher.subCh.rpl);\n var strArr = str.split(\"\");\n\n for (var i = 0; i < str.length; i++) {\n if (cipher.allowed.indexOf(strArr[i]) == -1) continue;\n if (i + 1 >= str.length) {\n digraph.push(strArr[i] + cipher.nullCh);\n } else if (strArr[i] == strArr[i + 1]) {\n digraph.push(strArr[i] + cipher.nullCh);\n } else digraph.push(strArr[i] + strArr[++i]);\n }\n return digraph;\n}", "tokenize(text) {\n text = text.toLowerCase();\n const phrases = [ text ];\n let matches = text.match(/\\s+/);\n let i = -1;\n if (matches && matches[0]) {\n i = matches.index + matches[0].length;\n }\n let ctr = 0;\n while (i !== -1 && ctr < 4) { // insert 4 more phrases\n text = text.substring(i);\n phrases.push(text);\n matches = text.match(/\\s+/);\n if (matches && matches[0]) {\n i = matches.index + matches[0].length;\n } else {\n i = -1;\n }\n ++ctr;\n }\n\n return phrases;\n }", "function changeToPigLatin(text) {\n\n var wordArray = text.split(\" \");\n var newtext = \"\";\n\n wordArray.forEach(element => {\n\n if (element[0] === 'a' || element[0] === 'e' || element[0] === 'i' || element[0] === 'u' || element[0] === 'o') {\n console.log(newtext.concat(element.slice(1, 6) + element[0] + \"way\"));\n }\n else if (getCount(element) === 1) {\n console.log(newtext.concat(element.slice(1, 7) + element[0] + \"ay\"));\n }\n else if (getCount(element) === 2) {\n console.log(newtext.concat(element.slice(2, 8) + element[0] + element[1] + \"ay\"));\n }\n\n });\n\n return text;\n}", "function ital6s() {\n var str = document.querySelector('#box6s p').textContent;\n var arr = str.split(\" \");\n var newArr = arr.map(v => { \n if (v == \"keep\") {\n return `<em>${v}</em>` \n } else \n return v;\n });\n str = newArr.join(\" \");\n document.querySelector('#box6s p').innerHTML = str;\n}", "function wave(str){\n const text = str.toLowerCase();\n const newArray = [];\n for (let i = 1; i <= text.length; i++) {\n if (!(text.substring(i - 1, i) === \" \"))\n newArray.push(text.substring(0, i - 1).toLowerCase() + text.substring(i - 1, i).toUpperCase() + text.substring(i, str.length).toLowerCase())\n };\n return newArray;\n}", "function stringToArray(string) {\n // split a string into individual words\n // index each word into one array\n // split returns an array\n return array = string.split(' ')\n}", "function giveWordArr(str) {\n let word = '';\n let arr = [];\n \n for (let i = 0; i < str.length; i++) {\n if (str[i] == ' ' || str[i] == ',' || str[i] == '-') { \n arr.push(word)\n word = ' ';\n } else {\n word += str[i];\n }\n }\n return arr;\n }", "function getLines(context,phrase,maxPxLength,textStyle) {\n\t\tvar wa=phrase.split(\" \"),\n\t\t\tphraseArray=[],\n\t\t\tlastPhrase=\"\",\n\t\t\tl=maxPxLength,\n\t\t\tmeasure=0;\n\t\t\tcontext.font = textStyle;\n\t\t\tfor (var i=0;i<wa.length;i++) {\n\t\t\t\tvar w=wa[i];\n\t\t\t\tmeasure=context.measureText(lastPhrase+w).width;\n\t\t\tif (measure<l) {\n\t\t\t\tlastPhrase+=(\" \"+w);\n\t\t\t}else {\n\t\t\t\tphraseArray.push(lastPhrase);\n\t\t\t\tlastPhrase=w;\n\t\t\t}\n\t\t\tif (i===wa.length-1) {\n\t\t\t\tphraseArray.push(lastPhrase);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn phraseArray;\n\t}", "separarCaracteres(){\r\n let cadena = this.objetoExpresion();\r\n for(let i = 0; i <= cadena.length-1; i++){\r\n this._operacion.addObjeto(new Dato(cadena.charAt(i)));\r\n }\r\n //Hace el arbol mediante la lista ya hecha \r\n this._operacion.armarArbol();\r\n //Imprime el orden normal \r\n this.printInfoInOrder();\r\n }", "function scan(text) {\n var lines = text.split(\"\\n\");\n var results = [];\n while (lines.length && (lines.length > 1 || lines[0].length)) {\n var sval = toString(toGlyphs(lines));\n var isLegible = sval.length == ACCOUNT_NUMBER_LENGTH && sval.match(/^[0-9]+$/);\n var checksum = isLegible ? calculateChecksum(sval) : NaN;\n var isValidAccountNumber = isLegible && (checksum % CHECKSUM_MODULUS == 0)\n results.push({\n sval: sval,\n isLegible: isLegible,\n checksum: checksum,\n isValidAccountNumber: isValidAccountNumber\n });\n lines.splice(0, GLYPH_COLS);\n }\n return results;\n }", "function getRandomPhraseAsArray(arr) {\n let arrayPosition = Math.floor(Math.random() * arr.length);\n let randomPhrase = arr[arrayPosition];\n let phraseCharacters = [];\n\n for (let i = 0; i < randomPhrase.length; i += 1) {\n phraseCharacters.push(randomPhrase[i]);\n }\n\n return phraseCharacters;\n}", "function text_filter(text) {\n return text.replace(/(?:\\[|\\])/g, '');\n }", "function getLines (ctx, phrase, maxPxLength, textStyle) {\n var wa=phrase.split(\" \"),\n phraseArray=[],\n lastPhrase=wa[0],\n l=maxPxLength,\n measure=0;\n ctx.font = textStyle;\n for (var i=1;i<wa.length;i++) {\n var w=wa[i];\n measure=ctx.measureText(lastPhrase+w).width;\n if (measure<l) {\n lastPhrase+=(\" \"+w);\n }else {\n phraseArray.push(lastPhrase);\n lastPhrase=w;\n }\n if (i===wa.length-1) {\n phraseArray.push(lastPhrase);\n break;\n }\n }\n return phraseArray;\n}", "function alphabetPosition(text) {\n let final = [];\n let lowerCased = text.toLowerCase();\n for (let i=0; i<lowerCased.length; i++) {\n if (lowerCased.charCodeAt(i) >= 97 && lowerCased.charCodeAt(i) <=122) {\n final.push(lowerCased.charCodeAt(i) - 96);\n }\n }\n return final.join(\" \");\n}", "function encodeSquare(text){\n text = text.split(\"\");\n var textRow = [];\n var output = [];\n var spaces = [];\n for (var i = 0; i < text.length; i++) {\n if (text[i] === \" \") {\n text.splice(i,1);\n }\n }\n var squareSize= Math.ceil(Math.pow(text.length , 1/2));\n while (text.length){\n textRow.push(text.splice(0,squareSize));\n }\n for (var x = 0; x < textRow.length-1; x++){\n spaces.push(\" \");\n }\n textRow.push(spaces);\n for (var x = 0; x < textRow.length; x++){\n for (var y = 0; y < textRow.length; y++){\n if (textRow[y][x]){\n output.push(textRow[y][x]);\n }\n }\n }\n return output.join(\"\");\n}", "function createAlphabet() {\n if (alphabets.length > 0) {\n alphabets = [];\n }\n\n var strings = document.getElementById(\"patterns\").value.split(\",\");\n\n for (str = 0; str < strings.length; str++) {\n var chars = strings[str].split(\"\");\n for (char = 0; char < chars.length; char++) {\n if (alphabets.indexOf(chars[char]) === -1) {\n alphabets.push(chars[char]);\n }\n }\n }\n\n document.getElementById(\"alphabets\").value = alphabets;\n createTable();\n}", "function getHashtags(string) {\n let result = [];\n string.split(' ').forEach(word => {\n if (!word.match(/[a-z]/ig)) return result;\n if (word[0] === \"#\") result.push((word.slice(1)).replace(/#/g, ''));\n });\n \n return result;\n}", "function processWord(word) {\n var optimalRecognitionposition = Math.floor(word.length / 3),\n letters = word.split('')\n return letters.map(function(letter, idx) {\n if (idx === optimalRecognitionposition)\n return '<span class=\"highlight\">' + letter + '</span>'\n return letter;\n }).join('')\n }", "getLettersToBeGuessed() {\r\n let uniqueLetters = new Array();\r\n for (let i = 0; i < this.text.length; i++) {\r\n if (!uniqueLetters.includes(this.text.charAt(i)) && Utilities.alphabet.includes(this.text.charAt(i).toLowerCase())) {\r\n uniqueLetters.push(this.text.charAt(i));\r\n }\r\n }\r\n uniqueLetters.sort();\r\n return uniqueLetters;\r\n }", "function getHashTags(inputText) {\n var regex = /(?:^|\\s)(?:#)([a-zA-Z\\d]+)/gm;\n var matches = [];\n var match;\n\n while((match = regex.exec(inputText))) {\n matches.push(match[1]);\n }\n\n return matches;\n}", "function parseStory(rawStory) {\n // Your code here.\n // This line is currently wrong :)\n const arrayOfWords = []\n const splittedStory = rawStory.split(\" \")\n const previewBox = document.querySelectorAll(\".previewBox\")[0];\n for (const word of splittedStory) {\n if ((/\\[n\\]/).test(word) === true) {\n arrayOfWords.push({\n word: word.replace(\"[n]\", \"\"),\n pos: \"n\"\n })\n } else if ((/\\[a\\]/).test(word) === true) {\n arrayOfWords.push({\n word: word.replace(\"[a]\", \"\"),\n pos: \"a\"\n })\n } else if ((/\\[v\\]/).test(word) === true) {\n arrayOfWords.push({\n word: word.replace(\"[v]\", \"\"),\n pos: \"v\"\n })\n } else {\n arrayOfWords.push({\n word: word\n })\n }\n }\n // console.log(arrayOfWords)\n\n return arrayOfWords\n\n}", "function pigIt(str){\n\treturn str.split('').map(el=> el.slice(1)+el.slice(0,1)+'ay').join('');\n\t//return str.split(' ').map(el=>el.substr(1) + el.charAt(0) + 'ay').join(' ');\n}", "function formatText(string) {\n var outputArray = [];\n string.split(\"\\n\").forEach(function(url) {\n outputArray.push(new RegExp(url));\n });\n return outputArray;\n}", "function alphabetPosition(text) {\n const letters = \"abcdefghijklmnopqrstuvwxyz\".split('')\n \n return text.toLowerCase().split('').filter(el => el >= 'a' & el <= 'z').map(el => letters.indexOf(el) + 1 ).join(' ')\n}", "function getRandomPhraseAsArray(arr){\n // Remove 1 from the array length to get the max number (inclusive)\n const length = arr.length - 1;\n // Generate a random number between 0 and length\n const choose = getRandomNumber(0, length);\n const currentPhrase = arr[choose];\n // Split the phrase into array of individual characters\n const letters = currentPhrase.split('');\n return letters;\n}", "function separate(expression){\n var tempArray=[], finalArray=[];\n for(var i = 0; i < expression.length; i++){\n if(symbols.indexOf(expression[i]) != -1){//is a symbol\n if(tempArray.length != 0){ // if temp array is not empty, make the temp array into a string and push into final array\n var a=tempArray.join('');\n finalArray.push(a);\n tempArray = [];\n }\n finalArray.push(expression[i]);\n }else{\n tempArray.push(expression[i]);\n }\n }\n if(tempArray.length > 0){\n var a = tempArray.join('');\n finalArray.push(a);\n }\n // console.log(finalArray);\n return finalArray;\n }", "function hideAnswer() {\n var answerArray = [];\n for (let i = 0; i < word.length; i++) {\n answerArray[i] = \"_\";\n }\n return answerArray;\n}", "function toMultiLine(text){\n var textArr = new Array();\n text = text.replace(/\\n\\r?/g, '<br/>');\n textArr = text.split(\"<br/>\");\n return textArr;\n }" ]
[ "0.6204852", "0.6001508", "0.57278365", "0.5597251", "0.559294", "0.5583341", "0.5498596", "0.5487748", "0.545751", "0.5437609", "0.5430904", "0.53967434", "0.53967434", "0.5389876", "0.5381494", "0.5379707", "0.5378722", "0.53712404", "0.5366531", "0.53577995", "0.5356049", "0.53545105", "0.5351661", "0.5348907", "0.53412986", "0.5339186", "0.5339186", "0.5317159", "0.53122103", "0.5298077", "0.5295364", "0.52891725", "0.5286026", "0.5280111", "0.5274415", "0.5261885", "0.52524555", "0.5250898", "0.5243956", "0.52359855", "0.5228654", "0.52199805", "0.52177465", "0.5212907", "0.52060294", "0.5202907", "0.5200594", "0.5181767", "0.5175584", "0.51746655", "0.5171589", "0.5168275", "0.51595557", "0.51483333", "0.5142019", "0.5137615", "0.51317537", "0.51288307", "0.5125967", "0.51116997", "0.5109996", "0.5104741", "0.5089131", "0.50844944", "0.5080989", "0.5079928", "0.50753623", "0.5067847", "0.50659615", "0.5064855", "0.5058035", "0.5055391", "0.5055149", "0.504881", "0.504768", "0.5045763", "0.5038716", "0.5035761", "0.5034414", "0.50293803", "0.5029076", "0.50289977", "0.50254196", "0.50253093", "0.50212276", "0.5017544", "0.5014372", "0.5006472", "0.5006197", "0.50047517", "0.5004297", "0.49997598", "0.4998998", "0.4997908", "0.4996553", "0.49855214", "0.49842972", "0.49837697", "0.49824467", "0.49821255" ]
0.5616537
3
This function searches for simple repeats in the text and forms an array with them.
function getSrepeatCount() { srepeat_examples = []; srepeats_for_sentences = []; result = []; for(i=0; i<sentences.length; i++) { sentence = []; sentence = sentences[i].replace(/[^a-zA-Zа-яА-ЯёЁ \n']/g, " "); sentence = sentence.replace(/\s+/g, " "); sentence = sentence.toLowerCase(); sentence = sentence.substring(0,sentence.length-1); sentence = sentence.split(" "); sub_result = sentence.reduce(function (acc, el) { acc[el] = (acc[el] || 0) + 1; return acc; }, {}); tmp = []; for(key in sub_result) { if(sub_result[key] > 1 && unions.indexOf(key) == -1 && prepositions.indexOf(key) == -1) { tmp.push(key); result.push(key); } } srepeat_examples.push([sentences[i], tmp]); } tmp = [] for(key in srepeat_examples) { tmp = [] for(i=0; i<srepeat_examples[key][1].length; i++){ if(srepeat_examples[key][1].length != 0) { if(srepeat_examples[key][1][i] != "'" || srepeat_examples[key][1][i] == "i") { tmp.push(srepeat_examples[key][1][i]) } } } srepeat_examples[key][1] = tmp; } count = 0; for(i=0; i<srepeat_examples.length; i++) { if(srepeat_examples[i][1].length != 0) { for(j=0; j<srepeat_examples[i][1].length; j++) { count++; } } } return count; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findRepeats(arr) {\n // -------------------- Your Code Here --------------------\n\n // create an object to keep track of how many times we've seen words\n var words = {};\n\n // create the array we're going to be returning\n var repeated = [];\n\n // iterate through the argument\n for (var i=0; i<arr.length; i++) {\n\n // if we've already encountered the current word, increment the count of \n // of the number of times we've seen the word\n if (words.hasOwnProperty(arr[i])){\n words[arr[i]]++;\n\n // the first time we encounter the word again (count is 2), we add it to\n // the output array\n if (words[arr[i]] === 2) {\n repeated.push(arr[i]);\n }\n } else {\n\n // if this is our first time seeing the word, add it to the object with a\n // count of 1\n words[arr[i]] = 1;\n }\n }\n\n // sort the array and return it\n return repeated.sort();\n\n // --------------------- End Code Area --------------------\n}", "function repeatedSubstringPatterm(string) {\n let subStr = '';\n\n for (let i = 1; i < string.length; i += 1) {\n subStr = string.slice(0, i);\n let substrings = [];\n [...string].reduce((str, char) => {\n if (str !== subStr) {\n str += char;\n } else {\n substrings.push(str)\n str = ''\n str += char;\n }\n\n return str;\n }, '');\n\n let regex = new RegExp(subStr, 'g')\n if (substrings.every(word => word === subStr)) {\n let array = [subStr, string.match(regex).length];\n console.log(array);\n return array;\n }\n\n return [string, 1];\n }\n}", "function duplicatonsFree(t) {\n\n\tvar duplicationFreeArr = [];\n\ttext = t.toLowerCase();\n\n\tif(text && text.length) duplicationFreeArr = text.match(/[A-Za-z]+/g);\n\tlet x = (names) => names.filter((v,i) => names.indexOf(v) === i);\n\n\tduplicationFreeArr = x(duplicationFreeArr);\nconsole.log(duplicationFreeArr.length);//remove it\n\treturn duplicationFreeArr;\n\n}", "function duplicateCount(text) {\n let new_text = text.toLowerCase().split(\"\");\n console.log(new_text);\n\n let count = 0;\n for (let i = 0; i < new_text.length; i++) {\n let br = 1;\n for (let j = i + 1; j < new_text.length; j++) {\n if (new_text[i] == new_text[j]) {\n count++;\n br = 0;\n break;\n }\n }\n if (br == 0) {\n new_text = new_text.filter(elem => elem != new_text[i])\n i = -1; continue;\n }\n }\n return count;\n}", "function getUniqueArray(text, minLength = 0) {\n\t// Split paragraph text into an array of char\n\tsplitText = text.split(\"\");\n \n // Creation of result array for holding output\n // Creation of remainingLimit variable for holding how many characters can be cycled through\n var result = [],\n \t\tremainingLimit = splitText.length - minLength;\n \n // Loop for cycling through split text\n // Determines if the character is already in the result array or not\n // If not inserts character\n splitText.forEach(char => {\n\t\tif (result.includes(char))\n \tremainingLimit--;\n else if (remainingLimit > 0) {\n \tresult.push(char);\n remainingLimit--;\n }\n\t});\n \n // Prints out result\n console.log(result);\n \n}", "function duplicateCount(text) {\n let count = 0;\n let textArray = text.toLowerCase().split(\"\");\n while (textArray.length !== Array.from(new Set(textArray)).length) {\n for (let i = 0; i < textArray.length; i++) {\n for (let j = i + 1; j < textArray.length; j++) {\n if (textArray[i] === textArray[j]) {\n textArray = textArray.filter((item) => item !== textArray[i]);\n count++;\n }\n }\n }\n }\n return count;\n}", "repeat_match(password) {\n const matches = [];\n const greedy = /(.+)\\1+/g;\n const lazy = /(.+?)\\1+/g;\n const lazy_anchored = /^(.+?)\\1+$/;\n let lastIndex = 0;\n while (lastIndex < password.length) {\n var base_token, match;\n greedy.lastIndex = (lazy.lastIndex = lastIndex);\n const greedy_match = greedy.exec(password);\n const lazy_match = lazy.exec(password);\n if (greedy_match == null) {\n break;\n }\n if (greedy_match[0].length > lazy_match[0].length) {\n // greedy beats lazy for 'aabaab'\n // greedy: [aabaab, aab]\n // lazy: [aa, a]\n match = greedy_match;\n // greedy's repeated string might itself be repeated, eg.\n // aabaab in aabaabaabaab.\n // run an anchored lazy match on greedy's repeated string\n // to find the shortest repeated string\n base_token = lazy_anchored.exec(match[0])[1];\n } else {\n // lazy beats greedy for 'aaaaa'\n // greedy: [aaaa, aa]\n // lazy: [aaaaa, a]\n match = lazy_match;\n base_token = match[1];\n }\n const [i, j] = Array.from([match.index, (match.index + match[0].length) - 1]);\n // recursively match and score the base string\n const base_analysis = scoring.most_guessable_match_sequence(\n base_token,\n this.omnimatch(base_token)\n );\n const base_matches = base_analysis.sequence;\n const base_guesses = base_analysis.guesses;\n matches.push({\n pattern: 'repeat',\n i,\n j,\n token: match[0],\n base_token,\n base_guesses,\n base_matches,\n repeat_count: match[0].length / base_token.length\n });\n lastIndex = j + 1;\n }\n return matches;\n }", "function duplicateCount(text){\n const textArray = text.toLowerCase().split('');\n let result = 0;\n let counts = Object.assign({}, ...textArray.map(item => ({ [item] : 0})));\n for (let i = 0; i < textArray.length; i++) {\n counts[textArray[i]] += 1\n }\n for (key in counts) {\n counts[key] > 1 ? result += 1 : false\n }\n return result\n}", "function repeat(val, repeatation){\n var arr, result = new Array();\n //Converting string to array and removing empty value\n arr = trimEmpty(val.split(\",\"));\n for(var i=0; i<repeatation; i++){\n for(var j in arr){\n //pushing it to result array\n result.push(arr[j]);\n }\n }\n \n display(result,1);\n console.log(result);\n return result;\n}", "function duplicateCount(text) {\n const arrLetters = text.toLowerCase().split('').sort();\n const filteredArrLetters = arrLetters.filter((val, i) => (\n arrLetters[i] === arrLetters[i + 1]));\n return [...new Set(filteredArrLetters)].length;\n}", "function repeat(string) {\n var ignore = \"\";\n var empty = [];\n for (var i = 0; i < string[i].length; i++) {\n if (string[i] > 0) {\n string[i] += ignore;\n } else {\n string[i].push(empty);\n }\n }\n return (empty[0]);\n console.log(empty[0]);\n}", "function duplicateCount(text) {\n text = text.toLowerCase().split(\"\")\n let result = 0 //初始化结果 \n //计算数组中每个元素出现的次数,通过Object.values数组化reduce函数计算的对象结果\n const objArr = Object.values(text.reduce((all_n, n) => {\n n in all_n ? all_n[n]++ : all_n[n] = 1\n return all_n\n }, {}))\n //循环数组,其重复的元素都记为1(无论该元素重复多少次都只记一次,未重复记0)\n objArr.forEach(ele => {\n if(ele == 1){\n ele = 0\n }else{\n ele = 1\n }\n result += ele\n })\n return result\n}", "function repeatedFind (str) {\n\t\tconst repeated = str.match(/(.)\\1+/gi);//. any character, \\1 match the first parenthesized pattern \n\t\treturn repeated; \n\t}", "matches(text) {\n let i = 0;\n let max_acc;\n const matches = [];\n\n while (i < text.length) {\n // simulate on input starting at idx i\n max_acc = this.nfa.simulate(text, i);\n\n if (max_acc == null) {\n // no match, move onto next idx\n i++;\n } else {\n // extract the longest match\n matches.push(new Match(i, max_acc, text.substring(i, max_acc)));\n\n if (i == max_acc) {\n // empty match, increment, so as to move along\n i++;\n } else {\n // jump to end position of match\n i = max_acc;\n }\n }\n }\n\n return matches;\n }", "function repeatsfind() {repeats(cipher[which])}", "function repeatsfind() {repeats(cipher[which])}", "function noRepeats(str) {\n let arr = [];\n for(let i = 0; i < str.length; i++) {\n if(arr.includes(str[i])) {\n return false\n }else if(!arr.includes(str[i])) {\n arr.push(str[i]);\n }\n }\n return true;\n }", "function part2(data) {\n let items = data\n .map(answer => {\n let sorted = answer.join('').split('').sort().join('');\n let letterGroups = sorted.match(/(\\S)\\1*/g);\n return letterGroups.filter(letterGroup => letterGroup.length == answer.length).length;\n })\n .reduce((acc, cur) => acc + cur);\n return items;\n}", "function duplicateCount(text){\n var arr = text.toLowerCase().split(\"\");\n var output = 0;\n while (arr.length > 0){\n var current = arr.shift();\n if (current){\n var isChecked = false;\n for ( var i =0; i < arr.length; i ++) {\n if (current == arr[i]){\n if (!isChecked) {\n output++;\n isChecked = true;\n }\n arr[i] = undefined;\n }\n }\n }\n }\n return output;\n}", "function funWithAnagrams(text) {\n // Write your code here\n\n if (text.length < 0) {\n return 0;\n }\n\n let sortText = {};\n let newText = [];\n\n for (let word of text) {\n let newWords = word.split('').sort().join('');\n console.log(newWords);\n\n if (!sortText[newWords]) {\n sortText[newWords] = Array(word);\n } else {\n sortText[newWords].push(word);\n }\n }\n\n for (let values in sortText) {\n let firstOccurrence = sortText[values][0];\n\n if (firstOccurrence) {\n newText.push(firstOccurrence);\n }\n }\n return newText.sort();\n}", "function findRepeatingCharacters(input) {\n const regex = /([^])(?=\\1)/g;\n return input.match(regex);\n}", "function duplicateCount(text){\n text = text.toLowerCase().split(\"\")\n const countedletters = text.reduce((allLetters, letter) => {\n if(letter in allLetters) {\n allLetters[letter]++\n } \n else {\n allLetters[letter] = 1\n }\n return allLetters \n }, {})\n const filterDup = Object.values(countedletters).filter((duplicate) => duplicate >=2)\n return filterDup.length\n }", "function repeats(arr){\n var arrRepeted = arr.filter ((v,i,a) => a.indexOf(v) < i);\n return arr.filter(el => !(arrRepeted).includes(el)).reduce((a, b) => a + b);\n}", "function repeats(arr){\n\nreturn arr\n//I'll filter the elements from the array that follows this condition: arr.indexOf(element) === arr.lastIndexOf(element)\n.filter(element => arr.indexOf(element) === arr.lastIndexOf(element))\n//I will sum all the filtered values\n.reduce((accumulator, currentValue) => accumulator + currentValue)\n\n}", "function duplicateCount(text){\n return (text.toLowerCase().split('').sort().join('').match(/([^])\\1+/g) || []).length;\n}", "function duplicateCount(text){\n return (text.toLowerCase().split('').sort().join('').match(/([^])\\1+/g) || []).length;\n}", "function regexMatch(string, pattern){\n\n var myarray=new Array(string.length-1);\n\n for (i=0; i <string.length-1; i++){\n myarray[i]=new Array(pattern.length-1)}\n\n myarray[0][0] = true\n myarray = true\n\n console.log(myarray);\n\n\n\n\n\n //condition one\n\n\n\n}", "function soloUnaVez(texto) {\n\n //Definir variables\n let contadores = {},\n resultado = [];\n letras = texto.split('').filter(letra => letra.trim().length >= 1);\n\n //Generar contadores\n for (letra of letras) {\n if (!contadores[letra]) {\n contadores[letra] = 1;\n } else {\n contadores[letra]++;\n }\n }\n\n //Eliminar las letras que se repitan\n for (letra in contadores) {\n if (contadores[letra] === 1) {\n resultado.push(letra);\n }\n }\n\n return [resultado, resultado[0]];\n}", "function flatArr() {\n var toArr = [];\n for (var i = 0; i < chosenWord.length; i++) {\n if(/[a-zA-Z0-9]/.test(chosenWord[i])) {\n toArr.push(chosenWord[i]);\n }\n }\n turnCount = toArr.length;\n}", "function isThereRepeted () {\n var repeatedNumbers = []; //Array para ir guardando los repetidos.\n\n for (let i = 0, j, isOnARRAY; i < ARRAY.length-1; i++){\n isOnARRAY = false; // salir antes del While si hay un repetido\n j = i+1; //Mirarmos repetidos a partir de los que ha hemos comprobado.\n if (repeatedNumbers.indexOf (ARRAY[i]) === -1) { //Si el número ya está en los repetidos no hace falta buscarlos ni guardarlo\n while (j < ARRAY.length && isOnARRAY === false){ //Recorremos el array hasta que encontremos repetido o el final del array\n if (ARRAY[i] === ARRAY[j]) { // Si encontramos repetido se guarda y salimos del bucle.\n isOnARRAY = true;\n repeatedNumbers.push(ARRAY[i]);\n } else {\n j++;\n }//end if\n }//end while\n }//end if\n }//end for\n\n return (repeatedNumbers);\n}//end function", "function groupAnagrams(words) {\n // Write your code here.\n // hashtables are the thing that comes to my mind\n // store each number with its own individual object/hashtable\n // ahastable will contain the letters with the index\n // I Iterate once to store\n // then iterate again to compare and push into similar arrays togethor \n\n\n }", "function repeatedCharacter(find) {\n for(let i = 0; i <= find.length; i++){\n for(let m = i+1; m <= find.length; m++){\n if(find[m] === find[i]){\n return find[i].repeat(1);\n }\n }\n }\nreturn false;\n}", "function howManyRepeated(str){\n let sum = 0;\n const strArr = str.toLowerCase().split(\"\").sort().join(\"\").match(/(.)\\1+/g);\n return strArr;\n}", "function duplicateCount(text){\n let counter = 0;\n let str = text.toLowerCase();\n for (let i = 0; i < text.length; i++) {\n if (str.length - str.split(text[i]).join(\"\").length >= 2 ) {\n str = str.split(text[i]).join(\"\");\n counter++;\n console.log(str , counter , i);\n }\n }\n return counter;\n }", "function allRepeats() { \n for (var i = 1; i < str.length; i++) {\n if (str.charAt(i) === first) {\n return 0;\n }\n }\n }", "function allRepeats() { \n for (var i = 1; i < str.length; i++) {\n if (str.charAt(i) === first) {\n return 0;\n }\n }\n }", "function repeatsFor(index, row, col) {\n\t\tvar r = new Array();\n\t\t\n\t\tvar directions = new Array(\n\t\t\tnew Array(0, 1), // right\n\t\t\tnew Array(1, 1), // right-down\n\t\t\tnew Array(1, 0), // down\n\t\t\tnew Array(1, -1), // left-down\n\t\t\tnew Array(0, -1), // left\n\t\t\tnew Array(-1, -1), // left-up\n\t\t\tnew Array(-1, 0), // up\n\t\t\tnew Array(-1, 1) // right-up\n\t\t);\n\t\t\n\t\t/* inspect each direction */\n\t\tvar key = get(row, col);\n\t\tvar candidates = index[key];\n\t\tif (candidates) {\n\t\t\tfor (var c=0; c<candidates.length; c++) {\n\t\t\t\tfor (var i=0; i<directions.length; i++) {\n\t\t\t\t\tfor (var j=0; j<directions.length; j++) {\n\t\t\t\t\t\tvar result = new Array();\n\t\t\t\t\t\tresult[0] = \"\";\n\t\t\t\t\t\tresult[1] = new Array();\n\t\t\t\t\t\tresult[2] = new Array(); \n\n\t\t\t\t\t\tif (row == candidates[c][0] && col == candidates[c][1] && i==j ) {\n\t\t\t\t\t\t\t; // do nothing, because we don't want to match the sequence at (row,col) with itself. \n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmatches(result, row, col, directions[i][0], directions[i][1], candidates[c][0], candidates[c][1], directions[j][0], directions[j][1]);\n\t\t\t\t\t\t\tr[r.length] = new Array(result[0], result[1], result[2], i, j);\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\n\t\t \n\t\treturn r;\n\t}", "function repeatsFor(index, row, col) {\n\t\tvar r = new Array();\n\t\t\n\t\tvar directions = new Array(\n\t\t\tnew Array(0, 1), // right\n\t\t\tnew Array(1, 1), // right-down\n\t\t\tnew Array(1, 0), // down\n\t\t\tnew Array(1, -1), // left-down\n\t\t\tnew Array(0, -1), // left\n\t\t\tnew Array(-1, -1), // left-up\n\t\t\tnew Array(-1, 0), // up\n\t\t\tnew Array(-1, 1) // right-up\n\t\t);\n\t\t\n\t\t/* inspect each direction */\n\t\tvar key = get(row, col);\n\t\tvar candidates = index[key];\n\t\tif (candidates) {\n\t\t\tfor (var c=0; c<candidates.length; c++) {\n\t\t\t\tfor (var i=0; i<directions.length; i++) {\n\t\t\t\t\tfor (var j=0; j<directions.length; j++) {\n\t\t\t\t\t\tvar result = new Array();\n\t\t\t\t\t\tresult[0] = \"\";\n\t\t\t\t\t\tresult[1] = new Array();\n\t\t\t\t\t\tresult[2] = new Array(); \n\n\t\t\t\t\t\tif (row == candidates[c][0] && col == candidates[c][1] && i==j ) {\n\t\t\t\t\t\t\t; // do nothing, because we don't want to match the sequence at (row,col) with itself. \n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmatches(result, row, col, directions[i][0], directions[i][1], candidates[c][0], candidates[c][1], directions[j][0], directions[j][1]);\n\t\t\t\t\t\t\tr[r.length] = new Array(result[0], result[1], result[2], i, j);\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\n\t\t \n\t\treturn r;\n\t}", "function makeFinalMarkov(textStamps, markovText){\n var output = [];\n for(var i = 0; i < markovText.length; i++){\n var curWord = markovText[i];\n var chooseArr = textStamps[curWord];\n output.push(chooseArr[Math.floor(Math.random() * chooseArr.length)]);\n }\n return output;\n}", "function censura(text, words){\n // words = ['serie', 'di', 'parole', 'da', 'censurare'];\n // var arrText = [];\n // var arrWords =[];\n // var newtxt = [];\n // arrText.push();\n var arrText = text.split(' ')\n // arrWords.push();\n var arrWords = words.split(' ')\n console.log(' nella funzione gli array',arrText, arrWords);\n for (var i = 0; i < arrText.length; i++) {\n\n // for (var j = 0; j < arrWords.length; j++) {\n\n // if (arrText[i] == arrWords[j]){\n // console.log('stampo arrText nella funzione e nell-if',arrText[i]);\n // arrText[i] = 'xxx';\n // console.log(arrWords[j]);\n // console.log('stampo arrText nella funzione e nell-if',arrText[i]);\n // }\n // else {\n // console.log('sono nell-else e vado anvanti nel ciclo');\n // console.log(arrText[i]);\n // }\n if (arrWords.includes(arrText[i])){\n\n arrText[i]= 'xxx';\n console.log(arrText[i]);\n }\n\n\n // console.log(arrWords[j]);\n\n\n\n // }\n\n // console.log('stampo arrText nella funzione ',arrText[i]);\n\n // newtxt.push(arrText[i]);\n // console.log(newtxt);\n }\n console.log(arrWords);\n return arrText.join(' ');\n\n}", "function buildSuffixArray(pattern) {\n arr = [0]\n let i = 1;\n let j = 0;\n\n while (i < pattern.length) {\n if (pattern[i] !== pattern[j]) {\n if (j === 0) {\n arr.push(0);\n i++\n } else {\n j = arr[j - 1];\n }\n }\n else {\n arr.push(j + 1);\n j++;\n i++;\n }\n }\n return arr;\n}", "analyze(text) {\n this.text = this.purify(text);\n this.index = 0;\n this.list = [];\n this.buffer = \"\";\n\n while (this.index < this.text.length) {\n this.state.transference(this.index, true);\n }\n return this.list;\n }", "function firstRepeat(inputString) {\n var letterMemory = [];\n for (var i = 0; i < inputString.length; i++) {\n var currentLetter = (inputString.charAt(i));\n if (inArray(letterMemory, currentLetter)){\n return currentLetter;\n } else letterMemory.push(currentLetter)\n }\n return 'No repetitions'\n}", "autoMode(text) {\n let array = [];\n let splitText = text.split(' ').filter((sub) => (sub !== ''));\n \n if (!splitText) {\n console.error('Something was wrong.');\n return;\n }\n \n while (splitText.length > 0) {\n // split every letter by the spaces x\n let brokeLine = this.autoBreak(splitText);\n \n array.push(brokeLine);\n splitText.splice(0, this.sumLetter());\n }\n \n return array;\n }", "function uniqueFinder(sentence) {\r\n //your code here\r\n //kondisi untuk nilai array kosong\r\n if (sentence.length === 0) {\r\n return 'NO WORDS';\r\n }\r\n \r\n //coding untuk split, space (' ');\r\n sentence += ' ';\r\n const tampungWords = [];\r\n let tampungKata = '';\r\n for (let i = 0; i < sentence.length; i++) {\r\n if (sentence[i] === ' ') {\r\n tampungWords.push(tampungKata.toLowerCase());\r\n tampungKata = ' ';\r\n } else {\r\n tampungKata += sentence[i];\r\n }\r\n }\r\n //console.log(tampungWords);\r\n \r\n const results = [];\r\n //looping untuk splitted\r\n for (let p = 0; p< tampungWords.length; p++){\r\n //looping untuk check words yg sama\r\n //console.log('Kata I : ' +tampungWords[p]);\r\n for (let q = p + 1; q< tampungWords.length; q++){\r\n //console.log('kata II ' +tampungWords[q]);\r\n let exist = false;\r\n \r\n //looping untuk check udah masuk result or belum\r\n for (let r = 0; r< results.length; r++) {\r\n //console.log('kata III : ' +results);\r\n if (tampungWords[p] === results[r]) {\r\n exist = true ;\r\n }\r\n }\r\n \r\n if (tampungWords[p] === tampungWords[q] && !exist ) {\r\n results.push(tampungWords[p]);\r\n }\r\n }\r\n } \r\n //console.log(results);\r\n return results;\r\n\r\n}", "function find(str1, str2) {\n //创建存放重复内容的数组\n var all = new Array();\n //字符串转字符数组\n var str_1 = str1.split(\"\");\n var str_2 = str2.split(\"\");\n for (var i = 0; i < str_1.length; i++) {\n for (var l = 0; l < str_2.length; l++) {\n //判断是否重复\n var lo = all.length;\n all[lo] = \"\";\n //判断之后的字符串是否相同\n for (var k = 0; str_1[i + k] == str_2[l + k]; k++) {\n all[lo] = all[lo] + str_1[i + k];\n //防止数组越界,提前停止循环\n if (i + k == str_1.length-1||i+k==str_2.length-1) {\n break;\n }\n }\n }\n }\n \n var most = 0;\n var fu = new Array();\n for (var j = 0; j < all.length; j++) {\n //去除空的内容\n if (all[j] != \"\") {\n //按照大小排序(删除部分小的)\n if (all[j].split(\"\").length >= most) {\n most = all[j].split(\"\").length;\n fu[fu.length] = all[j];\n }\n }\n }\n \n //将不重复内容写到新数组\n var wu=new Array();\n for(var i=0;i<fu.length;i++){\n var c=false;\n for(var l=0;l<wu.length;l++){\n if(fu[i]==wu[l]){\n c=true;\n }\n }\n if(!c){\n wu[wu.length]=fu[i];\n }\n }\n \n //将最长的内容写到新数组\n var ml=new Array();\n //获得最后一个字符串的长度(最长)\n var longest=wu[wu.length-1].split(\"\").length;\n //长度等于最长的内容放到新数组\n for(var i=wu.length-1;i>=0;i--){\n if(wu[i].split(\"\").length==longest){\n ml[ml.length]=wu[i];\n }else{\n //提前结束循环\n break;\n }\n }\n \n return ml\n }", "function firstNonRepeatedCharacter (string) {\n\n var array = string.split(\"\");\n var repeats = [];\n var result = array.shift();\n \n while(array.length > 1) {\n if(~array.indexOf(result) || ~repeats.indexOf(result)) {\n repeats.push(result)\n result = array.shift();\n } else\n return result;\n }\n \n return 'sorry';\n\n}", "function dualLetterReduce(t, i, index, arr) {\n const innerT = t;\n if (arr[index] && arr[index + 1]) {\n if (innerT.every((z) => z.word !== `${arr[index]}${arr[index + 1]}`)) {\n innerT.push({ word: `${arr[index]}${arr[index + 1]}`, times: 1 });\n } else {\n const indy = t.findIndex(\n (x) => x.word === `${arr[index]}${arr[index + 1]}`\n );\n innerT[indy].times += 1;\n }\n }\n return innerT;\n }", "function compute_temporary_array(pattern) {\n n = pattern.length\n lsp = new Array(n)\n index = 0\n i = 1\n while (i < n){\n if (pattern[i] == pattern[index]) {\n lsp[i] = index + 1\n index += 1\n i += 1\n } else {\n if (index != 0) {\n index = lsp[index - 1]\n }\n else {\n lsp[i] = 0\n i += 1\n }\n }\n }\n return lsp\n}", "function buildPatternTable(word) {\n const patternTable = [0];\n let prefixIndex = 0;\n let suffixIndex = 1;\n while (suffixIndex < word.length) {\n if (word[prefixIndex] === word[suffixIndex]) {\n patternTable[suffixIndex] = prefixIndex + 1;\n suffixIndex += 1;\n prefixIndex += 1;\n }\n else if (prefixIndex === 0) {\n patternTable[suffixIndex] = 0;\n suffixIndex += 1;\n }\n else {\n prefixIndex = patternTable[prefixIndex - 1];\n }\n }\n return patternTable;\n}", "function NumRepeat(Num){\n\t\t\tvar letra;\n\t\t\tfor(var j=0;j<Texto.length;j++){\n\t\t\t\tletra = Texto.substring(j, j+1);\n\t\t\t\tif(MyArray[letra]==Num){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "function duplicateCount(text){\n let result = 0;\n text = text.split('');\n\n while(text.length > 0){\n let temp = text.splice(0,1)[0].toLowerCase();\n \n if(text.filter(x => x.toLowerCase() == temp).length + 1 > 1){\n result++;\n }\n text = text.filter(x => x.toLowerCase() != temp);\n }\n \n return result\n}", "function SearchingChallenge1(str) {\n const array = [...str];\n const k = Number(array.shift());\n\n let substring = [];\n let n = 1;\n\n let index = 0;\n\n let res = [];\n\n while (index < array.length) {\n if (substring === [] || substring.includes(array[index])) {\n substring.push(array[index]);\n index++;\n console.log(\"substring\", substring);\n } else if (!substring.includes(array[index]) && n <= k) {\n substring.push(array[index]);\n n++;\n index++;\n console.log(\"substring\", substring);\n } else {\n res.push(substring.join(\"\"));\n console.log(\"res during\", res);\n substring = [];\n n = 1;\n index--;\n console.log(\"substring after []\", substring.length);\n }\n }\n\n res.push(substring.join(\"\"));\n\n console.log(\"res final\", res);\n\n const lengths = res.map((e) => e.length);\n\n return res[lengths.indexOf(Math.max(...lengths))];\n}", "function prepphrase(){\n var presponse=[];\n var array=pp[r(pp)]\n if (array==pp1){\n presponse.push(array[0][r(array[0])])\n presponse.push(nbar())\n }\n else{presponse.push('')}\n return presponse;\n}", "function lookAndSay(arr) {\n let res = [],\n prev = arr[0],\n count = 1;\n for (let i = 1; i < arr.length; i++) {\n let curr = arr[i];\n if (prev === curr) {\n count++;\n } else {\n res.push([count, prev]);\n count = 1;\n }\n prev = curr;\n }\n res.push([count, prev]);\n return res;\n}", "function duplicateCount(text){ //function name: duplicateCount, input = text\n text = text.toLowerCase() //lower case it to avoid errors of cap case differences\n return text.split('').filter(function (c, i) { //return a function that split each value filtering with input param c, i\n return text.indexOf(c) == i && text.indexOf(c) != text.lastIndexOf(c) //count the max recurrence and return value using\n }).length //the length of the value. \n} //end func", "function repeat(array){\n var repeat = []; // 1\n for (var j = 0; j < 10; j++){ // 1\n repeat[j] = []; // 1\n for (var i = 0; i < array.length; i++){ // n linear\n repeat[j].push(array[i]); // 1\n }\n }\n return repeat; \n}", "function firstNonRepeating(str) {\n const repeating = new Set();\n let firsts = new Set();\n for (let char of str) {\n if (!repeating.has(char)) {\n firsts.add(char);\n repeating.add(char);\n } else firsts.delete(char);\n }\n console.log(firsts);\n return Array.from(firsts.values())[0];\n}", "function duplicateCount(text) {\n let count = 0\n console.log(new Set(text.toLowerCase().split('')))\n new Set(text.toLowerCase().split('')).forEach(char => {\n if (text.match(new RegExp(char, 'gi')).length > 1) count += 1\n })\n return count\n}", "function triGram(word){\n var set = 3;\n var arr = [];\n var words = word.toLowerCase().trim().split(\" \");\n for(key in words){\n var length = words[key].length;\n arr.push(words[key]);\n for(var i = 0; i < length-set+1; i++){\n arr.push(words[key].substring(i,i+set));\n }\n }\n //output is array\n return arr;\n}", "function norepeat(str) {\n\tvar newArr = str.split(\"\");\n\tvar test =\n\t\treturn newArr.filter(function (val) {\n\t\t\treturn (!newArr.indexOf(val));\n\t\t})\n\ttest.forEach(function (value, index) {\n\t\tif (value === true) {\n\t\t\treturn value;\n\t\t}\n\n\t});\n}", "function sentenceReconstruction(dictList, s){\n /*\n loop throught the array\n each time check if current string in dictionary\n if it is, restart string and add to result array\n\n */\n\n}", "function repeatedString(s, n) {\n var count = 0;\n var sum = 0;\n var aTail = 0;\n var array = s.split('');\n var sumEnter = (n - n % array.length) / array.length;\n var tail = n - (sumEnter * array.length);\n console.log('sumEnter ' + sumEnter);\n console.log('tail ' + tail);\n\n for (var i = 0; i < array.length; i++) {\n if ('a' == array[i]) {\n count++;\n }\n }\n\n if (n % array.length == 0) {\n sum = count * (n / array.length);\n } else {\n tail = s.substring(0, tail).split('');\n console.log('qwerty' + tail);\n tail.forEach(element => {\n if (element === 'a') {\n aTail++;\n }\n });\n sum = count * sumEnter + aTail;\n }\n console.log('sum ' + sum);\n return sum;\n}", "function isogram(word){\n\tnewArr=[];\n\t//make lower case\n\tlower = word.toLowerCase().split(\"\");\n\tconsole.log(lower);\n\n\t//cycle through word\n\tfor(var i=0; i<lower.length; i++){\n\t\t\n\t\tif(newArr.indexOf(lower[i])==-1){\n\t\t\tnewArr.push(lower[i]);\t\t\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn true;\n}", "function generateArray(realString) {\n\n\t// This array acts as the keyframe array and will be returned at the end of the function.\n\tvar strArray = Array();\n\n\t// Position will keep track of the number of \"correctly\" typed letters\n\tvar position = 0;\n\n\twhile (position != realString.length) {\n\n\t\t// 1 in 7 probability of making a typo\n\t\tif (Math.floor(Math.random() * 7) == 1) {\n\n\t\t\t// If it decides to make a typo, it will next\n\t\t\t// decide the number of typos it will make in a row.\n\t\t\t// The maximum number of typos has been set to 2.\n\t\t\tvar typoCount = Math.floor(Math.random() * 2) + 1;\n\n\t\t\tfor (let i = 0; i < typoCount; i++) {\n\n\t\t\t\tvar randomAlpha = alphabet[Math.floor(Math.random() * alphabet.length)];\n\n\t\t\t\t// If the random alphabet corresponds to the actual correct letter, we will\n\t\t\t\t// choose until it doesn't.\n\t\t\t\twhile (randomAlpha == realString[position]) {\n\t\t\t\t\trandomAlpha = alphabet[Math.floor(Math.random() * alphabet.length)];\n\t\t\t\t}\n\n\t\t\t\t// Push the alphabet onto the keyframe array\n\t\t\t\tstrArray.push(randomAlpha);\n\t\t\t}\n\n\t\t\t// Determine the number of backspaces needed to remove the typos\n\t\t\tvar tmpStr = \"\";\n\t\t\tfor (let i = 0; i < typoCount; i++) {\n\t\t\t\ttmpStr += \"<\";\n\t\t\t}\n\n\t\t\t// Push the backspaces onto the keyframe array\n\t\t\tstrArray.push(tmpStr);\n\n\t\t\t// NOTE the backspaces are not pushed individually as characters, but as a string. This\n\t\t\t// is to allow for more realistic timing of removing characters\n\t\t} else {\n\n\t\t\t// If it is decided that a real character will be typed, push the real character\n\t\t\tstrArray.push(realString[position]);\n\n\t\t\tposition++;\n\t\t}\n\t}\n\n\treturn strArray;\n}", "function grabscrab(str, arr) {\n let matches = [];\n\n for (let idx = 0; idx < arr.length; idx += 1) {\n if (str.split('').sort().join('') === arr[idx].split('').sort().join('')) {\n matches.push(arr[idx]);\n }\n }\n\n return matches;\n}", "function findDuplicate(str, n) {\n // we use hear map to find dupicate element in string\n let count = {};\n\n for (let i in str) count[str[i]] = 0;\n\n for (let i in str) count[str[i]]++;\n\n for (let j in count) {\n if (count[j] > 1) document.write(j + \" is repeat for \" + count[j] + \"<br>\");\n }\n}", "function _findUniq(txtArr=[], seencharNames=[]) {\n let out = [], seenChars = [];\n txtArr.forEach(chars => {\n let charName = chars[0];\n if (seenChars.indexOf(chars) == -1 && seencharNames.indexOf(charName) == -1) {\n out.push(chars);\n seenChars.push(chars);\n }\n })\n return out;\n}", "function repeats (arr) {\n for (let i = 0; i < arr.length; i++) {\n for (let a = i+1; a < arr.length; a++) {\n if (equalArrays(arr[i], arr[a])) {\n return 'repeat';\n }\n }\n }\n return 'no repeat';\n}", "function string(p1) {\n let string = p1.split(\"\")\n let sub = []\n let sub2 = []\n let count = 0\n for (i = 0; i < string.length; i++) {\n if (!sub.includes(string[i]) && count === 2) {\n if (sub2.length < sub.length) {\n sub2 = sub\n }\n count = 0\n sub = []\n let pos = 1\n let start = string[i - 1]\n for (j = i-1; j > 0; j--) {\n if (string[j] == start) {\n pos++\n } else {\n break;\n }\n }\n i = i - pos;\n } else if (sub.includes(string[i])) {\n sub.push(string[i])\n } else if (count < 2) {\n sub.push(string[i])\n count++\n }\n }\n\n return sub2\n}", "function firstNotRepeat(string){\n\tstring=string.toLowerCase()\n\tlist=\"\"\n\tvar letterCount=[]\n\tfor(var i=0;i<string.length;i++)\n\t{\n\t\tif(list.indexOf(string[i])== -1)\n\t\t{\n\t\t\tlist=list+string[i]\n\t\t}\n\t\tif(list.length == 26){\n\t\t\tbreak\n\t\t}\n\t}\n\tfor(var j=0;j<list.length;j++){\t\n\t\tvar count=0\n\t\tfor(var i=0; i< string.length;i++)\n\t\t{\n\t\t\tif(string[i]==list[j])\n\t\t\t\t{\n\t\t\t\t\tcount++\n\t\t\t\t}\n\t\t}\n\t\tletterCount.push([list[j],count])\n\t}\n\treturn letterCount.find(function(element) {\n\t\t return element[1] == 1\n\t})[0]\n}", "function allAnagrams (string) {\n var result = [];\n var array = string.split('');\n \n function recurse(arr, temp) {\n if(temp.length === string.length && result.indexOf(temp) === -1){\n result.push(temp);\n return;\n }\n if(temp.length === string.length){\n return;\n }\n for(var i = 0; i < arr.length; i++){\n var copy = arr.slice();\n var curr = temp + arr[i];\n copy.splice(i, 1);\n recurse(copy, curr);\n }\n }\n \n recurse(array, '');\n return result;\n \n}", "function createArray(fedNumb){\n var randArray = [];\n while (fedNumb > randArray.length) {\n var numOfChars = Math.floor((Math.random() * 10) + 1);\n var text = \"\";\n while (numOfChars > text.length) {\n var alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n text += alphabet.charAt(Math.floor(Math.random() * alphabet.length));\n }\n randArray.push(text)}\n return randArray;\n}", "function createArrays() {\n phraseArray = [];\n blankArray = [];\n phraseArray = secretPhrase.split(\"\");\n phraseArray.forEach( () => blankArray.push(\"_\"));\n spanSecretRandom.innerHTML = blankArray.join(\" \");\n}", "function possibleAnagram(arr1 , word){\n let arrAnagram = []\n for(let i = 0 ; i < arr1.length ; i++){\n let anagram = arr1[i]\n let count = 0\n for(let j = 0 ; j < anagram.length ; j++){\n for(let n = 0 ; n < word.length ; n++){\n if(word[n] == anagram[j]){\n count++\n }\n }\n }\n if(count === arr1[i].length && arr1[i].length === word.length){\n arrAnagram.push(anagram)\n }\n }\nreturn arrAnagram;\n}", "function countOccurences(array, limit) {\n var result = {};\n array.forEach(function(element) {\n // Check if word has 2 letters or more\n if(element.length >= limit) {\n if(element in result) {\n // Increment if the word is already in the object\n result[element] = ++result[element];\n } else {\n // Push the word in the object\n result[element] = 1;\n }\n }\n });\n return result;\n}", "function anagramGroups(array) {\n let hashmap = new HashMap();\n let output = []\n for (let word in array) {\n let sortedWord = array[word].split(\"\").sort().join(\"\");\n if(!hashmap.contains(sortedWord)) {\n hashmap.set(sortedWord, \"\");\n let tempArray = [];\n tempArray.push(array[word]);\n output.push(tempArray);\n }\n else {\n for(let element in output) {\n let pushed = false;\n output[element].forEach(outputWord => {\n let sortedOutputWord = outputWord.split(\"\").sort().join(\"\");\n if(sortedWord == sortedOutputWord && !pushed) {\n output[element].push(array[word]);\n pushed = !pushed;\n }\n })\n }\n }\n }\n return output;\n}", "function powerSet(str) {\n let obj = {}\n //This loop is to take out all duplicate number/letter\n for(let i=0;i<str.length; i++){\n obj[str[i]] = true;\n }\n //variable array will have no duplicates\n let array = Object.keys(obj);\n let result = [[]];\n for(let i=0; i<array.length ;i++){\n //this line is crucial! It prevents us from infinite loop\n let len = result.length; \n for(let x=0; x<len ;x++){\n result.push(result[x].concat(array[i]))\n }\n }\nreturn result;\n}", "function getArray (s) {\n var a = s.split('\\n')\n return a.map(v => v.split('').map(vv => {\n if (vv === '*') {\n return 1\n } else {\n return 0\n }\n }))\n}", "permutationOfString(str)\n{\n var arr = str.split(\"\");\n console.log(arr);\n var arr1=[];\n const c =str.length;\n for(let i =0 ;i<arr.length;i++)\n {\n var str1=\"\";\n for(let j = i; j<c ; j++)\n {\n\n str1=str1+arr[j];\n var s = str.length-str1.length;\n }\n if(str1.length<str.length)\n {\n str1 = str1+str.substring(0,s);\n }\n if(!arr1.includes(str1))\n {\n arr1.push(str1);\n }\n }\n console.log(arr1)\n}", "function getAnaphoraCount() {\r\n text = workarea.textContent;\r\n anaphora_candidates = [];\r\n first_index = 0;\r\n last_index = 0;\r\n for(i=0; i < sentences.length-1; i++) {\r\n if(sentences[i] == \"`I must.\") debugger;\r\n first_word = sentences[i].match(/\\S+/)[0];\r\n check_higher_case = first_word.match(/[A-ZА-ЯЁ]/);\r\n if(check_higher_case == null) {\r\n continue;\r\n }\r\n if(first_word.match(\"Chapter\") != null || first_word.toLowerCase() == \"a\" || first_word.toLowerCase() == \"an\" || first_word.toLowerCase() == \"the\") {\r\n continue;\r\n }\r\n first_index = i;\r\n last_index = first_index;\r\n for(j=i+1; j<sentences.length; j++) {\r\n if(first_word == sentences[j].match(/\\S+/)[0]) {\r\n last_index = j;\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n if(last_index > first_index) {\r\n tmp = [];\r\n for(first_index; first_index <= last_index; first_index++) {\r\n tmp.push(sentences[first_index]);\r\n }\r\n anaphora_candidates.push([first_word, tmp]);\r\n i = last_index;\r\n }\r\n }\r\n flag = true;\r\n if(anaphora_candidates.length !=0) {\r\n while(flag) {\r\n control_array = [];\r\n for(i=0; i<anaphora_candidates.length; i++) {\r\n first_words = new RegExp(anaphora_candidates[i][0].replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\") + \"((\\\\.|\\\\!){3}|\\\\.|\\\\?|\\\\!){0,1}\\\\s\\\\S+\");\r\n if(anaphora_candidates[i][1][0].match(first_words) != null) {\r\n first_words = anaphora_candidates[i][1][0].match(first_words)[0];\r\n tmp = [];\r\n for(j=0; j < anaphora_candidates[i][1].length; j++) {\r\n if(anaphora_candidates[i][1][j].match(first_words.replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\")) != null) {\r\n tmp.push(true);\r\n }\r\n else {\r\n tmp.push(false);\r\n }\r\n }\r\n control_array.push(tmp);\r\n if(tmp.indexOf(false) == -1) {\r\n anaphora_candidates[i][0] = first_words;\r\n }\r\n }\r\n }\r\n \r\n for(i=0; i<control_array.length; i++) {\r\n if(control_array[i].indexOf(false) != -1) {\r\n control_array[i] = false;\r\n }\r\n else {\r\n control_array[i] = true;\r\n }\r\n }\r\n if(control_array.indexOf(false) != -1){\r\n flag = false;\r\n }\r\n else {\r\n flag = true;\r\n }\r\n }\r\n\r\n\r\n flag = true;\r\n while(flag) {\r\n control_array = [];\r\n for(i=0; i<anaphora_candidates.length; i++) {\r\n first_words = new RegExp(anaphora_candidates[i][0].replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\") + \"((\\\\.|\\\\!){3}|\\\\.|\\\\?|\\\\!){0,1}\\\\s\\\\S+\");\r\n if(anaphora_candidates[i][1][0].match(first_words) != null) {\r\n first_words = anaphora_candidates[i][1][0].match(first_words)[0];\r\n tmp = [];\r\n for(j=0; j < anaphora_candidates[i][1].length; j++) {\r\n if(anaphora_candidates[i][1][j].match(first_words.replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\")) != null) {\r\n tmp.push(true);\r\n }\r\n else {\r\n tmp.push(false);\r\n }\r\n }\r\n control_array.push(tmp);\r\n if(tmp.indexOf(false) == -1) {\r\n anaphora_candidates[i][0] = first_words;\r\n }\r\n }\r\n }\r\n for(i=0; i<control_array.length; i++) {\r\n if(control_array[i].indexOf(false) != -1) {\r\n\r\n control_array[i] = true;\r\n }\r\n else {\r\n control_array[i] = false;\r\n }\r\n }\r\n if(control_array.indexOf(false) == -1){\r\n flag = false;\r\n }\r\n else {\r\n flag = true;\r\n }\r\n\r\n }\r\n }\r\n temp = [];\r\n for(i=0; i<anaphora_candidates.length; i++) {\r\n anaphora_length = anaphora_candidates[i][0].split(\" \").length;\r\n count = 0;\r\n for(j=0; j<anaphora_candidates[i][1].length; j++) {\r\n if(anaphora_candidates[i][1][j].split(\" \").length == anaphora_length && anaphora_length < 5) {\r\n count++;\r\n }\r\n }\r\n if (count!=anaphora_candidates[i][1].length) {\r\n temp.push(anaphora_candidates[i])\r\n }\r\n }\r\n anaphora_candidates = temp;\r\n for(i=0; i<anaphora_candidates.length; i++) {\r\n if(anaphora_candidates[i][0][anaphora_candidates[i][0].length-1] == \".\") {\r\n anaphora_candidates[i][0] = anaphora_candidates[i][0].substring(0, anaphora_candidates[i][0].length-1);\r\n }\r\n }\r\n result = anaphora_candidates;\r\n return result.length\r\n}", "function replaceString(str) {\n\tvar arr = str.split('');\n\tvar letters = [];\n\tvar result = [];\n\tfor (var i = 0; i < arr.length; i++) {\n\t\tvar count = 1;\n\t\tconsole.log(letters.indexOf(arr[i]), arr[i], result , 'first')\n\t\tif (letters.indexOf(arr[i]) != -1) {\n\t\t\tconsole.log(count, 'second')\n\t\t for (var i = 0; i < letters.length; i++) {\n\t\t\t if (letters[i] === arr[i]) {\n\t\t\t\t count++\n\t\t\t }\n\t\t }\t\t\t\n\t\t}\n\t\tletters.push(arr[i])\n\t\tresult.push(count)\n\t}\n\treturn result\n}", "function accum(s) {\n let result = [];\n \n for (let i = 0; i < s.length; i++) {\n const firstChar = s[i].toUpperCase();\n const repeatingChar = s[i].toLowerCase().repeat(i);\n result.push(firstChar + repeatingChar);\n }\n return result.join('-')\n}", "function zooInventory(arr) {\n let result = [];\n let entry = [];\n let animal = \"\";\n let species = \"\";\n let fact = \"\";\n for (let i = 0; i < arr.length; i++) {\n // look for the patterns in the data, and assign good variable names\n entry = arr[i];\n animal = entry[0];\n species = entry[1][0];\n fact = entry[1][1];\n result.push(animal + \" the \" + species + \" is \" + fact + \".\"); // attention to detail on spacing and punctuation\n\n }\n return result;\n}", "function findAnagrams(s, p) {\n // create the character counter for p {a:1, b:1, c:1}\n const arr = [];\n let uniqueChars = 0;\n const charCache = {};\n for (let i = 0; i < p.length; i++) {\n if (charCache[p[i]]) {\n charCache[p[i]]++;\n } else {\n uniqueChars++;\n charCache[p[i]] = 1;\n }\n }\n // loop iterating through s\n for (let i = 0; i < s.length - p.length + 1; i++) {\n const currentCache = { ...charCache };\n for (let j = i; j < i + p.length; j++) {\n if (currentCache[s[j]]) {\n currentCache[s[j]]--;\n }\n if (currentCache[s[j]] === 0) {\n uniqueChars--;\n }\n if (!uniqueChars) {\n arr.push(i);\n }\n }\n }\n return arr;\n}", "function main(text) {\n let moves = text.split(/ *, */g);\n // let moves =['s1','x3/4','pe/b'];\n let len = 1000000000;\n for (let i = 1; i <= len; i++) {\n for (let move of moves) {\n let {\n func,\n args\n } = parseMove(move);\n array = func(...args);\n }\n if (array.join('') === 'abcdefghijklmnop') {\n len = len % i;\n i = 0;\n }\n }\n console.log(array.join(''));\n}", "function contarRepeticiones(valor) { //función que repasa coincidencias en el array nombre\n if (valor.toLowerCase() == letra) { //compara el valor del array con la letra (var global) que contiene el valor evaluado en el bucle for inicial\n contador++; //incrementa el contador al haber encontrado coincidencia\n }\n}", "function groupKeggResponse(text) {\n let ntext = text.trimEnd().split(/\\n/);\n let ndata = [[]];\n for (let t of ntext.slice(0, ntext.length - 1)) {\n if (t === \"///\") {\n ndata.push([]);\n continue;\n };\n ndata[ndata.length - 1].push(t);\n };\n return ndata;\n}", "function duplicateCount(text) {\n try {\n return text\n .toLowerCase()\n .split('')\n .sort()\n .join('')\n .match(/(.)\\1+/g).length;\n } catch (e) {\n return 0;\n }\n}", "function duplicateEncode(word){\n var newArra = [];\n var wordArr = word.toLowerCase().split(\"\");\n var x;\n for (var i = 0; i < wordArr.length; i++) {\n x = searchElement(wordArr, wordArr[i])\n if(x.length > 1){\n newArra.push(')');\n }\n else {\n newArra.push('(');\n }\n }\n return newArra.join(\"\");\n}", "function dualWordReduce(t, i, index, arr) {\n const innerT = t;\n if (arr[index] && arr[index + 1]) {\n if (innerT.every((z) => z.word !== `${arr[index]} ${arr[index + 1]}`)) {\n innerT.push({ word: `${arr[index]} ${arr[index + 1]}`, times: 1 });\n } else {\n const indy = t.findIndex(\n (x) => x.word === `${arr[index]} ${arr[index + 1]}`\n );\n innerT[indy].times += 1;\n }\n }\n return innerT;\n }", "function arrRanOrderToString(x){\n let y = []\n let v = []\n let w = []\n// This Loop seperates the repeated words from the param array = x \n// into a new array = w\n for (let i = 0; i < x.length; i++){\n if (v.indexOf(x[i]) < 0){\n v.push(x[i])\n } else {\n w.push(x[i])\n }\n }\n// This Loop takes the words from the param array = x and puts them into \n// new array = y in a random order. It also takes away any repeated words\n for (let i = 0; i < x.length - w.length; i++){\n let num = x[randomNumber(x)]\n if (y.indexOf(num) < 0 ){\n y.push(num) \n } else {\n i--\n }\n }\n// This Loop adds back in the repeated words from the param array = x\n// that were supposed to be repeated in a random place in the new array = y\n for (let i = 0; i < w.length; i++){\n y.splice(randomNumber(y), 0,w[i])\n }\n let z = y.join(' ')\n console.log(z)\n}", "function func(array) {\n let length = array.length;\n let counter = 0;\n let repeatedArray = [], result = [];\n for (let i = 0; i < length; i++) {\n if (array[i] > 0) {\n repeatedArray = array.slice(i+1);\n counter = array[i];\n break;\n }\n }\n if (counter === 0) {\n return [];\n } else if (repeatedArray.length === 0) {\n return `[empty x ${counter}]`\n }\n\n for (let i = 0; i < counter; i++) {\n if (repeatedArray[i]) {\n result.push(repeatedArray[i])\n } else {\n result.push(repeatedArray[i%repeatedArray.length])\n }\n }\n return result\n}", "function repeatedString(s, n){\n\n if (!(s === 'a')){\n let repetition = [];\n for(let i=0; i < n; i++){\n repetition.push(s);\n }\n \n let repeated = repetition.toString().replace(/,/ig, \"\").slice(0, n);\n let aOcurrences = repeated.match(/a/ig);\n \n return aOcurrences.length;\n }\n\n return n;\n}", "function findDuplicateCharacters(input) {\n}", "function matchZipCodes(textToSearch) {\n // find sequence of 5 digits\n // empty slice makes a shallow copy\n var regResults = textToSearch.match(/\\d{5,5}/g);\n console.log(regResults);\n return regResults ? regResults.slice() : [];\n }", "function repeatTxt (txt,n) {\n \"use strict\";\n var res = \"\", i;\n for (i=0;i<n;i++) {\n\tres += txt;\n }\n return res;\n}", "function LetterCountI(str) {\n\n var wordsArray = str.split(\" \"); // split str into individual words\n var counts = []; // tracks number of repeats for each word\n\n // outer loop selects the word to be searched\n for (i = 0; i < wordsArray.length; i++) {\n var count = 0; // tracks current count\n var temp = []; // stores letters of the current word being searched\n // inner loop scans each letter of the current word\n for (j = 0; j < wordsArray[i].length; j++) {\n temp.push(wordsArray[i][j]); // push current letter onto temp\n // if current letter already exists, increase count for this word\n if (temp.indexOf(wordsArray[i][j+1]) !== -1) {\n count++; // tracks number of repeating letters for word i\n }\n counts[i] = count; // store total count for word i\n }\n }\n // determine index of word with highest repeats, return it\n var maxCount = Math.max.apply(null, counts);\n if (maxCount === 0) {return -1;} // if no repeats, return -1\n return wordsArray[counts.indexOf(maxCount)];\n}", "function generateAll(str) {\n //build an output\n //separate chars into 1 and 1, 2 and 2 and so on\n let myStr = [];\n //separated 1 and 1\n for (let i = 0, j = 1; i < str.length; i++, j++) {\n // myStr.push(str[i]);\n myStr[i] = str.substring(i, j);\n }\n let kosing = [];\n let temp = \"\";\n let sizes = Math.pow(2, myStr.length);\n\n for (let j = 0; j < sizes; j++) {\n temp = \"\";\n for (let k = 0; k < myStr.length; k++) {\n if ((j & Math.pow(2, k))) {\n temp += myStr[k];\n }\n\n }\n if (temp !== \"\") {\n kosing.push(temp);\n }\n // str[j];\n\n }\n kosing.join(\"\\n\");\n return kosing;\n}", "function repeatedString(s, n) {\n const length = s.length\n const times = Math.floor(n/length)\n const remain = n - times * length\n\n let as = 0\n for (let j = 0; j < s.length; j++) {\n if (s[j] === \"a\") {\n as++\n }\n }\n\n as *= times\n\n for (let i = 0; i < remain; i++) {\n if (s[i] === \"a\") {\n as++\n }\n }\n\n return as\n\n\n\n}" ]
[ "0.6958735", "0.64222807", "0.6331934", "0.6170416", "0.61667466", "0.61284775", "0.6078105", "0.5999959", "0.59810376", "0.586233", "0.58150953", "0.57941115", "0.5761154", "0.57425857", "0.57424694", "0.57424694", "0.57400084", "0.569317", "0.5684552", "0.5593503", "0.5592151", "0.55342495", "0.55311996", "0.55210793", "0.55154157", "0.5514839", "0.55118316", "0.5493601", "0.5486672", "0.5472499", "0.5471861", "0.54699135", "0.5436664", "0.5435854", "0.54267186", "0.54267186", "0.538855", "0.538855", "0.53821975", "0.53693837", "0.53589755", "0.53444886", "0.53435576", "0.5342864", "0.53425306", "0.53287154", "0.53257793", "0.5322347", "0.5306586", "0.5299362", "0.5297562", "0.5288663", "0.5288391", "0.5281793", "0.5278734", "0.52774346", "0.5276654", "0.5271669", "0.52676094", "0.5255755", "0.52551895", "0.5254873", "0.5245659", "0.52399915", "0.5238473", "0.52353066", "0.52291965", "0.52257353", "0.52253777", "0.52238506", "0.52193946", "0.5217785", "0.5210549", "0.5206926", "0.5205705", "0.5202053", "0.52019125", "0.5198253", "0.51957476", "0.519446", "0.51820755", "0.5177056", "0.51709515", "0.51695526", "0.5166197", "0.5165415", "0.5163693", "0.516005", "0.51597095", "0.51586956", "0.51555485", "0.5154655", "0.51519156", "0.51483893", "0.51382285", "0.51257414", "0.51197165", "0.51185083", "0.5118306", "0.5116481" ]
0.6033629
7
Notice how we attach a function that prints out "this.name". In other words print out this object's name property. So when the function is fired "this" refers to the person object. Let's try making the greet function seperate and put it on 2 objects.
function sayName(){ return this.name }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function greet(greeter){\n this.greeting =\"My name is \";\n this.greeter = greeter;\n this.speak = function(){\n console.log(this.greeting + this.greeter);\n }\n}", "function GreetMe(name) {\n\tthis.greeting = 'Hi ';\n\tthis.name = name;\n\tthis.greet = function() {\n\t\tconsole.log(this.greeting + this.name);\n\t\tconsole.log(this);\n\t};\n}", "function excitedPerson(person){\n this.greeting='Howdy';\n this.person=person;\n this.speak=function(){\n console.log(this.person+this.person);\n console.log(this);\n };\n}", "function greet() {\n console.log(\"hello: \" + this.name);\n}", "function greet() {\n console.log(\"Hi, my name is \" + this.name);\n}", "function greet() {\n console.log(this.name);\n}", "function greet(){ console.log(this)}", "greet2(){\n console.log(\"Hi, I am \" + this.name);\n }", "greet() {\n\tconsole.log('hello' + ' ' + this.firstname + ' ' + this.lastname);\n\t}", "function greetUser(name) {\n console.log('Hello ' + name);\n console.log(this);\n}", "greet() {\n\t\tconsole.log(\"Hi my savior, \" + this.firstName + \" \" + this.lastName );\n\t}", "function Person(name) {\n this.message = 'Hello ';\n this.name = name;\n this.speak = function() {\n console.log(this.message + this.name);\n console.log(this);\n };\n }", "function greet()\n{\n console.log(this);\n}", "greet(){\n console.log('hi, i am ' + this.name)\n }", "function People(name) {\n this.word = \"whatsup\";\n this.name = name;\n this.greet = function() {\n console.log(this.word + this.name);\n }\n}", "function Person (firstname, lastname) {\n\n\tthis.firstname = firstname,\n\tthis.lastname = lastname,\t\n\tthis.greet = function () {\n\t\tconsole.log('greet works');\n\t\treturn 'Hi ' + this.firstname;\n\t}\n}", "function greet() {\n console.log(`Hello, my name is ${this.name}`)\n}", "greet() {\n console.log('hi i am ' + this.name);\n }", "function Person() {\n\tthis.name = \"Peter\";\n\tthis.age = \"25\";\n\tthis.greeting = function() {\n \t\tconsole.log( \"Greetings, my name is \" + this.name +\" and I am \"+ this.age +\" years old.\");\n\t};\t\t\n\tthis.salute = function(){\n\t\tconsole.log(\"Good morning!, and in case I dont see you, good afternoon, good evening and good night!\");\n\t};\n\n}", "function friendlyPeople(person) {\n this.greeting = \"Morning \";\n this.person = person;\n this.speak = function() {\n console.log(this.greeting + this.person);\n console.log(this);\n };\n}", "greet() {\r\n\t\tconsole.log(`Hello, ${this.firstname} ${this.lastname}`)\r\n\t}", "function greet(person) {\n console.log('Hi ' + person.firstName);\n}", "function meanPerson(greeting, meanie, time) {\n this.greeting = greeting; \n this.meanie = meanie;\n this.time = time;\n this.speak = function() {\n console.log(this.greeting + this.meanie + this.time);\n console.log(this);\n };\n}", "function GreetMeAgain(name) {\n this.greeting = \"Hello \";\n this.name = name;\n this.speak = function() {\n console.log(this.greeting + this.name);\n };\n}", "function coach(greeter) {\n this.greeting = 'Hello ';\n this.greeter = greeter;\n this.speak = function() {\n console.log(this.greeting + this.greeter);\n console.log(this);\n };\n}", "function Person(name) {\n this.name = name;\n this.greeting = function() {\n alert('Hi! I\\'m ' + this.name + '.');\n }\n}", "function greeting2() {\n console.log(`Hi! ${this.name}, I am ${this.age}`);\n}", "function Person(name) {\n this.name = name;\n this.greeting = function() {\n console.log('Hi! I\\'m ' + this.name + '.');\n };\n}", "function greet(person) {\n console.log(\"Hello, \" + person.firstName);\n}", "function Person(name){\n\t// console.log(this)\n\tthis.name = name;\n\tthis.say_name = function(){console.log(name);};\n}", "greet(){\n console.log(`Hello, ${this.firstname} ${this.lastname}`);\n }", "function sayHi(){\n return \"Hi \" + this.firstName;\n}", "function Person(name) {\n this.name = name;\n this.greeting = function() {\n alert('Hi! I\\'m ' + this.name + '.');\n };\n}", "function Person(name) {\n this.name = name;\n this.greeting = function() {\n alert('Hi! I\\'m ' + this.name + '.');\n };\n}", "function greet(person) {\n console.log(\"Hi \" + person.firstName + \"!\");\n}", "function greeter(person) {\n return \"Hi \" + person.firstName + \" \" + person.lastName;\n}", "function Person(name){\n this.name = name;\n this.sayHi = function(){\n return \"Hi\" + this.name;\n }\n}", "function CordialPerson(greeter) {\n this.greeting = 'Hello ';\n this.greeter = greeter;\n this.speak = function() {\n console.log(this.greeting+this.greeter);\n console.log(this);\n };\n}", "function CordialPerson(greeter) {\n this.greeting = 'Hello ';\n this.greeter = greeter;\n this.speak = function () {\n console.log(this.greeting + this.greeter);\n console.log(this);\n };\n}", "function CordialPerson(greeter) {\n this.greeting = 'Hello ';\n this.greeter = greeter;\n this.speak = function() {\n console.log(this.greeting + this.greeter);\n console.log(this);\n };\n }", "function CordialPerson(greeter) {\n this.greeting = 'Hello ';\n this.greeter = greeter;\n this.speak = function() {\n console.log(this.greeting + this.greeter);\n console.log(this);\n };\n }", "function angryMan(greeter) {\n this.greeting = 'Hi ';\n this.greeter = greeter;\n this.speak = function() {\n console.log(this.greeting + this.greeter);\n console.log(this);\n };\n }", "function CordialPerson(greeter) {\n this.greeting = \"Hello \";\n this.greeter = greeter;\n this.speak = function() {\n console.log(this.greeting + this.greeter);\n console.log(this);\n };\n}", "function Person(name){\n this.name = name;\n this.sayHi = function(){\n console.log(\"Hi \" + this.name);\n }\n}", "function CordialPerson(greeter) {\n this.greeting = 'Hello ';\n this.greeter = greeter;\n this.speak = function() {\n console.log(this.greeting + this.greeter);\n console.log(this);\n };\n}", "function CordialPerson(greeter) {\n this.greeting = 'Hello ';\n this.greeter = greeter;\n this.speak = function() {\n console.log(this.greeting + this.greeter);\n console.log(this);\n };\n}", "function Person(obj) {\n this.name = obj.name;\n this.age = obj.age;\n this.speak = function() {\n console.log(`This new binding`, this);\n return `Hello, my name is ${this.name}, and I am ${this.age} years old`;\n };\n}", "function CordialPerson(greeter) {\n this.greeting = 'Hello';\n this.greeter = greeter;\n this.speak = function() {\n console.log(this.greeting + this.greeter);\n console.log(this);\n };\n}", "function sayHello() {\n console.log(\"Hello \" + this.name)\n}", "greet(firstName, lastName) {\n console.log(`${this.msg} ${firstName} ${lastName}`);\n // gets the context inherited from the parent scope which is this object\n const innerArrowGreet = () => `${this.msg} ${firstName} ${lastName}`;\n console.log('inner Greet ', innerArrowGreet());\n // gets the context from the window object as this is not bound to anything!\n const innerWOArrowGreet = function () {\n return `${this.msg} ${firstName} ${lastName}`;\n };\n console.log('w/o arrow inner ', innerWOArrowGreet());\n }", "function Person(name){\n this.name = name;\n this.greeting =()=>{\n console.log(this.name);\n }\n}", "function sayHello(){\n return \"Hello \" + this.name;\n}", "function sayHi(){\n console.log(this.name);\n}", "function greetFunction(greet) {\n console.log(this.greet);\n return greet;\n }", "printGreeting() {\n console.log(\"Hello my name is \" + this._name + \" and I am a person.\")\n }", "function Person(name, age){\n this.name = name;\n this.age = age;\n this.speak = function(){\n console.log(\"Hello, my name is \" + this.name);\n }\n}", "function sayHi() {\n console.log('I am ' + this.name + '!');\n}", "function Person(name, age) {\n this.name = name;\n this.age = age;\n this.sayName = function () {\n console.log('im ' + this.name);\n }\n}", "function person2() {\n console.log(`${this.name} is a ${this.gender}`);\n}", "function Person(name, age, hairColor) {\n this.name = name;\n this.age = age;\n this.hairColor = hairColor;\n this.sayAll = function () {\n console.log(`Hi, my name is ${this.name} and I am ${this.age} years old with ${this.hairColor} hair.`);\n }\n}", "function person(elm1, elm2) {\n console.log(`Mi name is ${this.name} and I listen ${elm1} and ${elm2}`)\n}", "greet() {\n return 'Yo ' + this.firstname;\n }", "function greeter2(person) {\n return \"Aloha \" + person + \"!\";\n}", "function Person(name, gender) {\n this.name = name;\n this.gender = gender;\n this.sayHello = function() {\n console.log('Hi! ' + this.name);\n };\n}", "function Greeting() {\n console.log(this);\n}", "function Person(firstName, lastName) {\n this.firstName = firstName;\n this.lastName = lastName;\n\n this.sayHello = function (name) {\n console.info(`Hello ${name}, my name is ${this.firstName}`);\n };\n}", "function NewPerson (name) {\n\tthis.name = name;\n\tthis.speak = function () {\n\t\tconsole.log(`my name is ${this.name}`);\n\t}\n}", "function Person(name, age, job){\n\tthis.name = name; \n\tthis.age = age; \n\tthis.job = job; \n\tthis.sayName = function(){\n\t\tconsole.log(this.name); \n\t}\n}", "function sayHi() {\n console.log( this.name );\n}", "function Person(firstname, lastname) {\n console.log(this);\n this.firstname = firstname;\n this.lastname = lastname;\n console.log('this functions is invoked');\n}", "greeting() {\n console.log(`Hi! I'm ${this.name}`);\n }", "greeting() {\n console.log(`Hi! I'm ${this.name}`);\n }", "greeting() {\n console.log(`Hi! I'm ${this.name}`);\n }", "function CordialPerson(greeter) {\n this.greeting = \"Hello\";\n this.greeter = greeter;\n this.speak = function () {\n console.log(`${this.greeting} ${this.greeter}`);\n }\n}", "sayHello() {\n console.log(\"hello from \" + this.name);\n }", "greetMe() {\n console.log(this.greeting);\n }", "greetMe() {\n console.log(this.greeting);\n }", "function breathe(){\n console.log(this.firstName +\" \"+this.lastName+\" just inhale and exhale!\");\n }", "\"greet me\"() {\n console.log(this.name + ', ' + this.age);\n }", "function Person(name, age, job) {\n this.name = name;\n this.age = age;\n this.job = job;\n this.sayName = function() {\n console.log(this.name);\n };\n}", "function Greetr() {\n\tthis.greeting = \"hello World\";\n\tthis.greet = function () {\n\t\tconsole.log(this.greeting);\n\t}\n}", "function morePeople(object){\n this.name = object.name;\n this.age = object.age;\n this.sayHello = function(){\n console.log(\"This creates a new binding using my old Object\", this);\n return \"Hi my name is ${this.name} and I am ${this.age}\";\n\n }\n\n}", "function greet(person){\n console.log('Our First Function'+ ' ' + person)\n}", "function greeting(person) {\n console.log(\"Hello \" + person.first + \" \" + person.last);\n}", "function Person(){\n Person.prototype.name = 'hx'\n Person.prototype.sayHi = function(){\n console.log(this.name);\n }\n}", "function Person(firstname, lastname) {\n \n console.log(this);\n this.firstname = firstname;\n this.lastname = lastname;\n console.log('This function is invoked.');\n \n}", "function Person() {\n //Properties\n this.name = \"Ben\";\n this.age = \"18\";\n //functions\n this.sayHi = function() {\n return this.name + \" Says Hi\";\n };\n }", "greet() {\n return console.log(console.log(`Hi I'm Mr.${this.name} look at me!!`));\n }", "function Person(showLove){\n this.kiss = '😘';\n this.hug = '🤗';\n this.showLove = function(){\n console.log(`${this.hug} ${this.kiss}`);\n console.log(this);\n }\n}", "function sayHello () {\n\talert(this.name + \" says hello!\");\n}", "function Greeter(name) {\n this.name = name;\n}", "function importantPerson() {\n console.log(this.name + '!');\n}", "function Person(name,email){\n this.name=name;\n this.email=email;\n this.print=function(){\n console.log('Name:'+this.email,'Email: '+ this.email);\n }\n}", "function People(name, age, city) {\n this.name = name;\n this.age = age;\n this.city = city;\n People.prototype.greetings = function () {\n console.log(`Hey! My name is ${this.name}. I am ${this.age} years old and I live in ${this.city}.`);\n };\n}", "function sayHello(greeting) {\n console.log(this);\n return greeting;\n }", "function sayName () {\n console.log(this.name);\n }", "function greeting(name){\n return `My name is ${this.name}`; \n}", "function Person(first, last, age, gender, occupation, interests) {\n this.name = {\n 'first': first,\n 'last': last,\n },\n this.age = age,\n this.gender = gender,\n this.occupation = occupation,\n this.interests = interests;\n this.bio = function() {\n alert(this.name.first + ' ' + this.name.last + ' is ' + this.age + ' years old and works as a(n) ' + this.occupation\n + '. ' + genderPronoun(this.gender) + getInterests(this.interests) + '.')\n }\n this.greeting = function() {\n alert('Hi! I\\'m ' + this.name + '.');\n }\n}", "function PersonConstructor() {\r\n // Create a greet method using the this keyword\r\n\tthis.greet = function() { console.log('hello'); };\r\n // Create a introduce method where the below is logged to the console\r\n\tthis.introduce = function() { console.log(`Hello World, my name is ${this.name}`)};\r\n}", "function personContainer() {\n var person = { \n name: \"James Smith\",\n hello: function() {\n console.log(this.name + \" says hello \" + arguments[1]);\n }\n }\n person.hello.apply(person, arguments);\n}", "function importantPerson() {\n console.log(this.name)\n}" ]
[ "0.81145114", "0.8088825", "0.80641264", "0.805648", "0.80442566", "0.79936177", "0.7968379", "0.7763049", "0.7719687", "0.77051866", "0.77020144", "0.76614314", "0.7623538", "0.7622498", "0.76172704", "0.7616044", "0.7562745", "0.7542427", "0.7527346", "0.74970603", "0.74721795", "0.74656165", "0.74613166", "0.7461255", "0.7434427", "0.74134684", "0.74123394", "0.74105453", "0.74074996", "0.73917705", "0.73776877", "0.7374447", "0.7372688", "0.7372688", "0.73642164", "0.73623145", "0.7344983", "0.73412204", "0.7336284", "0.7336057", "0.7336057", "0.73298055", "0.73269856", "0.732618", "0.73250717", "0.73250717", "0.73135686", "0.7261352", "0.7220329", "0.72200704", "0.72121024", "0.7210958", "0.72033393", "0.7193704", "0.7189876", "0.7184729", "0.71756905", "0.71722114", "0.7168416", "0.7164331", "0.7151469", "0.7110596", "0.7102908", "0.70915943", "0.7072984", "0.7069491", "0.7054252", "0.7043672", "0.7021693", "0.70207834", "0.7019674", "0.7019674", "0.7019674", "0.69982463", "0.69979835", "0.69965136", "0.6994345", "0.6993199", "0.69902974", "0.69862145", "0.6963544", "0.69544387", "0.6950814", "0.6928106", "0.6920919", "0.68750614", "0.68719786", "0.6864511", "0.6861775", "0.6860078", "0.6850491", "0.68475175", "0.68457764", "0.6841838", "0.68304664", "0.6823045", "0.6820468", "0.6817602", "0.6809942", "0.6791253", "0.6786579" ]
0.0
-1
Logging out just requires removing the user's id_token and profile
function logout() { deferredProfile = $q.defer(); localStorage.removeItem('id_token'); localStorage.removeItem('profile'); authManager.unauthenticate(); userProfile = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function logout() {\n deferredProfile = $q.defer();\n localStorage.removeItem('id_token');\n localStorage.removeItem('profile');\n authManager.unauthenticate();\n userProfile = null;\n $state.go('login');\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}", "logout () {\n // Clear access token and ID token from local storage\n localStorage.removeItem('access_token')\n localStorage.removeItem('id_token')\n localStorage.removeItem('expires_at')\n this.userProfile = null\n this.authNotifier.emit('authChange', false)\n // navigate to the home route\n router.replace('/')\n }", "async logOut() {\n // Invalidate the refresh token\n try {\n if (this._refreshToken !== null) {\n await this.fetcher.fetchJSON({\n method: 'DELETE',\n path: routes.api().auth().session().path,\n tokenType: 'refresh'\n });\n }\n } finally {\n // Forget the access and refresh token\n this.accessToken = null;\n this.refreshToken = null;\n }\n }", "function logOut() {\n localStorage.removeItem('id_token')\n showWelcome()\n}", "logOut() {\n authContextApi.logOut();\n }", "function logout() {\n setCurrentUser(null);\n setToken(null);\n }", "logout () {\n API.User.Logout(AppStorage.getAuthToken())\n .then(() => {\n AppDispatcher.handleAction({\n actionType: 'CLEAR_SESSION'\n })\n AppStorage.clearAll()\n browserHistory.push('/')\n })\n .catch(error => {\n AppSignal.sendError(error)\n AppDispatcher.handleAction({\n actionType: 'CLEAR_SESSION'\n })\n AppStorage.clearAll()\n browserHistory.push('/')\n })\n }", "function logout() {\n setToken(null);\n setCurrentUser(null);\n }", "logout() {\n const accessToken = localStorage.getItem('accessToken');\n localStorage.removeItem('accessToken');\n localStorage.removeItem('userId');\n const init = {\n method: 'POST',\n body: JSON.stringify(accessToken),\n headers: { 'Content-Type': 'application/json' },\n };\n fetch(`${APIURL}/users/logout`, init);\n this.user.authenticated = false;\n }", "function logout() {\n sessionStorage.removeItem('id');\n sessionStorage.removeItem('token');\n sessionStorage.removeItem('registerUser');\n setIsLoggedIn(false);\n }", "function logout() {\n JoblyApi.token = null;\n setCurrentUser(null);\n localStorage.removeItem(\"token\");\n localStorage.removeItem(\"currentUser\");\n }", "function logout() {\n localStorage.removeItem('id_token');\n localStorage.removeItem('AWS.config.credentials');\n authManager.unauthenticate();\n $state.reload();\n }", "logout() {\n $cookies.remove('token');\n currentUser = {};\n }", "static logout() {\n localStorage.removeItem('auth_token');\n localStorage.removeItem('email');\n localStorage.removeItem('userid');\n localStorage.removeItem('username');\n }", "function Logout() {\n localStorage.removeItem('user_id')\n}", "logOutCurrentUser() {\n var self = this;\n self.auth.signOut();\n }", "function logout()\n {\n setUserData({\n token: undefined,\n user: undefined\n })\n localStorage.setItem(\"auth-token\", \"\")\n }", "function logOut() {\n\t// Check to make sure that there is a user signed in\n\tif (profile) {\n\t\t// Sign the user out\n\t\tfirebase.auth().signOut().then(function() {\n\t\t\t// logout was successfull\n\t\t\t// updateProfile();\n\t\t}).catch(function(error) {\n\t\t\talert(\"Error logging out: \" + error);\n\t\t});\n\t\t// Reload the page\n\t\tlocation.reload();\n\t}\n}", "logout() {\n localStorage.removeItem(\"id_token\");\n }", "function logOut() {\n localStorage.removeItem(\"userid\");\n localStorage.removeItem(\"fetch-path\");\n location.replace(\"login.html\");\n }", "logout() {\n localStorage.removeItem('id_token');\n }", "logout() {\n this.setAccessToken(null);\n this.user = null;\n }", "logout(state, payload = LOGOUT_SUCCESS) {\n state.status = payload;\n state.user = {};\n state.isAuthenticated = false;\n userApi.deleteAccessTokenHeader();\n tokenService.removeAccessToken();\n tokenService.removeRefreshToken();\n }", "logout() {\n _handleUserLogout();\n userDb.logout(this.user);\n this.userId = null;\n }", "logOutUser(){\n localStorage.removeItem('token')\n }", "logOutUser() {\n this.__userAdmin__ = null\n this.__userToken__ = null\n this.removeStorage()\n window.location.reload()\n }", "logout() {\n // remove authentication credentials\n this.credentials = null;\n }", "function removeLoginSession() {\n //clean up the userID from the localStorage to show the login screen.\n localStorage.removeItem('userID');\n\n var auth2 = gapi.auth2.getAuthInstance();\n if (auth2.isSignedIn.Ab == true) {\n auth2.signOut().then(function () {\n console.log('Rich Chat: User signed out.');\n location.reload();\n });\n } else {\n location.reload();\n }\n}", "logout() {\r\n this.authenticated = false;\r\n localStorage.removeItem(\"islogedin\");\r\n localStorage.removeItem(\"token\");\r\n localStorage.removeItem(\"user\");\r\n }", "function logOut() {\n http.deleteAuthorization($stateParams.basic, $stateParams.id)\n .then(function (res) {\n console.log(res);\n $state.go('login');\n })\n }", "logout() {\n localStorage.removeItem(\"token\");\n localStorage.removeItem(\"userName\");\n }", "logOut(){\n localStorage.removeItem('username');\n localStorage.removeItem('password');\n localStorage.removeItem('firstName');\n }", "async function logOut() {\n await fetch(url + '/api/sessions/current', { method: 'DELETE' });\n}", "function logOut(){\n auth.signOut().then(()=>{\n setUser(\"\")\n })\n }", "logOut(state) {\n state.user = null;\n state.authToken = null;\n state.authTenants = null;\n state.currentSection = null;\n state.error = null;\n }", "logout() { Backend.auth.logout(); }", "function logoutUser() {\n auth.logout()\n .then(() => {\n sessionStorage.clear();\n showInfo('Logout successful.');\n userLoggedOut();\n }).catch(handleError);\n }", "function logout(){\n localStorage.removeItem('user_email');\n localStorage.removeItem('user_token');\n localStorage.clear();\n }", "static deauthenticateUser() {\n sessionStorage.removeItem('refreshToken');\n }", "logout() {\n localStorage.removeItem(\"auth\");\n }", "function logout() {\n auth.signOut();\n}", "function logout() {\n setToken(\"\");\n ShareBnBApi.token = \"\";\n localStorage.removeItem(\"token\");\n setCurrentUser({});\n }", "function logout() {\n window.sessionStorage.removeItem(\"jwt\");\n window.sessionStorage.removeItem(\"idle-timer\");\n window.sessionStorage.removeItem(\"oldOrg\");\n window.location.replace(`${window.location.origin}`);\n const _signIn = document.getElementById(\"signInButton\");\n if (_signIn){\n _signIn.removeAttribute( \"hidden\" );\n }\n}", "function logout() {\n if (Token.has()) {\n $http.get('auth/logout')\n .then(function () {\n AuthEvent.deauthenticated();\n currentUser = {};\n $state.go('login');\n });\n }\n }", "logout() {\n this._userId = null\n this._userToken = null\n this._userUsername = null\n\n sessionStorage.clear()\n }", "function logout() {\n localStorage.removeItem('user');\n}", "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 signOut() {\n localStorage.removeItem('curUser');\n}", "logOut() {\n localStorage.removeItem('user');\n this.router.navigateByUrl('');\n }", "function logout() {\n svc.token = null;\n svc.identity = null;\n delete $window.localStorage['authToken']; \n }", "function logout() {\n //$cookies.remove('token');\n }", "function logout() {\n //$cookies.remove('token');\n }", "function logout() {\n delete $localStorage.currentUser;\n $window.location.reload();\n }", "logout() {\n localStorage.removeItem(\"token\");\n localStorage.removeItem(\"user\");\n window.location.reload();\n }", "function logout() {\n if (!gapi) return null;\n return gapi.auth2.getAuthInstance().signOut()\n .then(_ => {\n jwtoken = undefined;\n authenticated = false;\n currentUser = undefined;\n userDeauthenticated();\n return Promise.all([\n idbKeyval.delete('jwtoken'),\n idbKeyval.delete('currentuser')\n ]);\n })\n .then(_ => $('.signin-layer').addClass('layer--shown'));\n}", "logout() {\n localStorage.removeItem('user');\n }", "logout () {\n axios.post(LOGOUT_URL + '?access_token=' + window.localStorage.getItem('id_token'))\n .then((response) => {\n router.push('/')\n })\n window.localStorage.clear()\n user.authenticated = false\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}", "signOut() {\n this.loggedInUserId = '';\n sessionStorage.clear();\n this._router.navigate(['/Login']);\n }", "function signOut() {\n AsyncStorage.clear().then(() => {\n setLoggedUser(null);\n });\n }", "logout() {\n localStorage.removeItem(\"user\");\n }", "function logoutAppUser() {\n this.setLoggedInUser(null);\n this.setToken(null);\n }", "function logout() {\n var name = settings.name;\n name = (name ? '_' + name : '');\n $.Storage.remove('token' + name, null);\n $.Storage.remove('login' + name, null);\n if (settings.history) {\n command_line.history().disable();\n }\n login();\n }", "function logout() {\n sessionStorage.removeItem('user')\n sessionStorage.removeItem('isLogged')\n}", "function logOut() {\n return auth.signOut().then(() => {\n setUserId(null);\n setUserData(null);\n setGroupData(null);\n setGroupMemberData([]);\n });\n }", "static logout() {\n document.deleteCookie('userId');\n document.deleteCookie('userFirstName');\n }", "logout() {\n this.authenticated = false;\n\n localStorage.removeItem('user');\n }", "function logout() {\n console.log(\"logging out user\");\n FirebaseAuth.getInstance().signOut();\n}", "onLogout() {\n\t\tlocalStorage.removeItem('userToken');\n\t}", "async userSignOut(ctx) {\n await fb.auth()\n .signOut()\n .then(() => {\n ctx.commit('setSignedIn', false);\n localStorage.removeItem(\"loggedIn\");\n sessionStorage.removeItem(\"loggedIn\");\n localStorage.removeItem('userCollection');\n localStorage.removeItem('userCustomShelfs');\n localStorage.removeItem('userMovieNightLists');\n localStorage.removeItem('userSoundtracks');\n localStorage.removeItem('emailId');\n localStorage.removeItem('movieNightId');\n localStorage.removeItem('soundtrackId');\n ctx.commit('setSignedInStorage', \"\");\n ctx.commit('setUserCollection', []);\n router.push('/');\n });\n }", "async signOut () {\n const res = await postJSON('/api/logout')\n if (!this.checkResponse(res)) {\n this.page.profileBox.style.display = 'none'\n return\n }\n State.clearAllStore()\n State.removeAuthCK()\n window.location.href = '/login'\n }", "function logOut() {\n localStorage.clear();\n \n window.location.reload();\n }", "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 props.logoutAction();\n cookies.remove('token');\n history.push('/Login')\n }", "static deauthenticateUser() {\n console.log(\"de-authenticate\")\n localStorage.removeItem('token');\n }", "function logout() {\n $auth.logout();\n localStorageService.remove(\"currentUser\");\n $state.go('home', {}, {reload: true});\n }", "logOut(e) {\n e.preventDefault();\n localStorage.removeItem('usertoken');\n this.props.history.push(`/`);\n }", "static deauthenticateUser() {\n localStorage.removeItem('token');\n localStorage.removeItem('role');\n localStorage.removeItem('username');\n Auth.onAuthenticationStatusChange(false);\n }", "function logout() {\n if (typeof window !== \"undefined\")\n localStorage.removeItem(localStorageSessionName);\n\n httpService.clearAuthToken();\n}", "function Logout(){\n AuthenticationService.ClearCredentials();\n $state.go('Login');\n }", "signOutUser() {\n this.__userApiToken__ = null\n }", "logoutUser() {\n // Attempts to logout of the current account\n firebase.auth().signOut().then(function() {\n // Removes the users information from the session storage\n sessionStorage.setItem('userName', null);\n sessionStorage.setItem('isAdmin', null); \n sessionStorage.setItem('uid', null);\n sessionStorage.setItem('email', null); \n window.alert(\"You have signed out successfully\");\n }).catch(function(error) {\n // Alerts the user of the error\n window.alert(error.message);\n });\n }", "function logOut(){\n localStorage.removeItem(\"user\");\n localStorage.removeItem(\"token\");\n templateController();\n}", "function signOut() {\n var auth2 = gapi.auth2.getAuthInstance();\n auth2.signOut().then(function () {\n localStorage.removeItem('token');\n user = {};\n notif('top-end', 'success', 'Sign out Success');\n isSignIn();\n });\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 tokenStore['igtoken'] = undefined;\n }", "function logout() {\n localStorage.removeItem('token')\n observer.trigger(observer.events.logoutUser);\n}", "logOut(){\n firebase.auth().signOut();\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 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 }", "logOut(e) {\r\n e.preventDefault()\r\n localStorage.removeItem('usertoken')\r\n this.props.history.push(`/`)\r\n }", "function logout() {\n TokenService.removeToken();\n self.all = [];\n self.user = {};\n CurrentUser.clearUser();\n $window.location.reload();\n }", "doLogout() {\n this.user = null;\n }", "async logout({auth, request, response}) {\n const header = await auth.getAuthHeader();\n const decodedHeader = Encryption.base64Decode(header.split('.')[1]);\n const userToken = JSON.parse(decodedHeader);\n const user = await User.find(userToken.uid);\n await user\n .tokens()\n .where('user_id', userToken.uid)\n .delete();\n return response.send('success')\n }", "onLoggedOut() {\n localStorage.removeItem('user');\n localStorage.removeItem('token');\n this.props.setUser(null);\n window.open('/', '_self');\n }", "[AUTH_MUTATIONS.LOGOUT](state) {\n state.user = null\n state.token = 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 authState.jwt_token = ''\n localStorage.setItem('token', '');\n window.location.reload()\n }", "function logout (){\n collectionOfUser.update(\n {\n id : loginUser.id,\n logIN : false,\n },\n function(){},\n error\n );\n clear();\n }" ]
[ "0.8138171", "0.7940114", "0.7839028", "0.77994376", "0.7772085", "0.77600163", "0.7719196", "0.7713605", "0.77088034", "0.76964545", "0.7678932", "0.76670045", "0.7623212", "0.76101196", "0.76044714", "0.7587714", "0.75530845", "0.75442195", "0.7542217", "0.7535465", "0.7534608", "0.74965805", "0.7491511", "0.74833477", "0.74814355", "0.74795717", "0.74724114", "0.7470665", "0.74702847", "0.7454705", "0.7441648", "0.7441625", "0.74302757", "0.7420234", "0.7412608", "0.74104017", "0.7402101", "0.7397934", "0.73874825", "0.73830926", "0.7381838", "0.7369168", "0.7362391", "0.7360172", "0.735928", "0.7355634", "0.7355234", "0.7352858", "0.7348997", "0.7348011", "0.73327357", "0.7329806", "0.7329806", "0.73288405", "0.7322563", "0.7313542", "0.7304659", "0.7304583", "0.7300872", "0.72975993", "0.72936743", "0.72889584", "0.7288392", "0.7281123", "0.7274112", "0.72650623", "0.7256761", "0.72488844", "0.72438323", "0.72281224", "0.72243327", "0.72169304", "0.721447", "0.72066075", "0.720338", "0.72030455", "0.7202917", "0.7192559", "0.71912223", "0.7191155", "0.71881926", "0.71859205", "0.7174219", "0.7172047", "0.7167031", "0.71631145", "0.7160985", "0.71597224", "0.71558994", "0.71485114", "0.71437126", "0.71422875", "0.713235", "0.71313566", "0.7116259", "0.7115571", "0.7113526", "0.7101604", "0.70996827", "0.70926106" ]
0.80604535
1
Set up the logic for when a user authenticates This method is called from app.run.js
function registerAuthenticationListener() { lock.on('authenticated', function (authResult) { localStorage.setItem('id_token', authResult.idToken); authManager.authenticate(); lock.getProfile(authResult.idToken, function (error, profile) { if (error) { return console.log(error); } localStorage.setItem('profile', JSON.stringify(profile)); deferredProfile.resolve(profile); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleSignIn() {\n // Sign in the user -- this will trigger the onAuthStateChanged() method\n\n }", "handleLogin() {\n this.authenticate();\n }", "OnAuthenticated(string, string) {\n\n }", "__defineHandlers__() {\n self = this;\n this.auth.onAuthStateChanged(\n function (user) {\n if (user == null) {\n //console.log(\"state: logged out\");\n // show logged out view\n this.login_state = 0;\n } else {\n //console.log(\"state: logged in\");\n // show logged in view\n this.unsafe_user = user;\n this.primary = new User(user);\n this.login_state = 1;\n }\n this.refresh_view(user);\n }.bind(self)\n );\n }", "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}", "onAuthenticated(data) {\n this.status = STATUS_AUTHENTICATED;\n }", "function Auth() {\n if (!ModularityGoogleAppsLang.clientId) {\n return;\n }\n\n this.handleEvents();\n }", "@action\n authOnClient() {\n // get cookie from browser or jwt if already exist\n const token = this.jwt || cookie.get(this.cookieName);\n // force logout if token not present\n if (!token) return this.logout();\n // authorize apis on client side\n return this.jwtAuth({ token })\n .catch(err => console.error('Auth', err));\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}", "checkAuth() { }", "setupAuthentication(loginSuccess) {\n this.lock.on(\"authenticated\", authResult => {\n this.postLogin(authResult, loginSuccess);\n });\n }", "function authUser() {\n FB.Event.subscribe('auth.statusChange', handleStatusChange);\n}", "runAuthChangeHandler() {\n for (var i = 0; i < this.authObservers_.length; i++) {\n this.authObservers_[i](this['currentUser']);\n }\n }", "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}", "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}", "onLoggedIn() {\r\n this.controller = new MainController(this.login.pryvUserConnection, \"event-view\", \"category-events\");\r\n this.controller.init();\r\n }", "onAuthentication(func) {\n this._onAuthCallbacks.push(func);\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 }", "signIn() {}", "onAuthenticated(user) {\n if (isFunction(onAuthenticated)) {\n onAuthenticated(user);\n }\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}", "autoAuthUser() {\n const authInformation = this.getAuthData();\n if (!authInformation) {\n return;\n }\n const now = new Date();\n const expiresIn = authInformation.expirationDate.getTime() - now.getTime();\n if (expiresIn > 0) {\n this.token = authInformation.token;\n this.isAuth = true;\n this.setAuthTimer(expiresIn / 1000);\n this.authStatusListener.next(true);\n if (authInformation.admin) {\n this.isAdmin = true;\n this.adminStatusListener.next(true);\n }\n }\n }", "init() {\n _listenToCurrentUser();\n }", "login(cb) {\n this.authenticated = true;\n cb();\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 isUserLoggedIn() {\n // Replace with your authentication check logic\n return true;\n}", "function authHandler(error, authData) {\n if (error) {\n console.log(\"Login Failed!\", error);\n } else {\n console.log(\"Authenticated successfully with payload:\", authData);\n }\n }", "function authenticate (data){\n doAuthentication(AM_HOST, data, handleAuthenticationCallBack);\n showAuthnViewBasedOnHint();\n}", "function userLogin() {\n /**-----------------------------------------------------------------------*/\n /** Get the user's name and password as entered into the login form: */\n /**-----------------------------------------------------------------------*/\n var name = document.querySelector('[name=\"username\"]').value;\n var password = document.querySelector('[name=\"password\"]').value;\n\n /**-----------------------------------------------------------------------*/\n /** Check if the user is authorized to use the application: */\n /**-----------------------------------------------------------------------*/\n authenticateUser(name, password, userIsAuthorised);\n}", "onBefore( request, response, next ) {\n\n\t\t// Setup the default user object for the request. This will determine the current\n\t\t// user's authentication status in the application.\n\t\trequest.rc.user = {\n\t\t\tid: 0,\n\t\t\tusername: \"\",\n\t\t\tisAuthenticated: false\n\t\t};\n\n\t\t// If there's no session cookie, there's no user to validate yet. Move onto the\n\t\t// next controller.\n\t\tif ( ! request.cookies.sessionId ) {\n\n\t\t\treturn( next() );\n\n\t\t}\n\n\t\t// If we made it this far, the use has a session cookie; but, we need to validate\n\t\t// that it's actually valid for a user.\n\t\t// --\n\t\t// CAUTION: For simplicity, this session is blindly using the given user ID as \n\t\t// the source of truth. In reality, you would need MUCH MORE SECURE sessions.\n\t\tthis._userService\n\t\t\t.getUser( +request.cookies.sessionId )\n\t\t\t.then(\n\t\t\t\t( user ) => {\n\n\t\t\t\t\trequest.rc.user = {\n\t\t\t\t\t\tid: user.id,\n\t\t\t\t\t\tusername: user.username,\n\t\t\t\t\t\tisAuthenticated: true\n\t\t\t\t\t};\n\n\t\t\t\t},\n\t\t\t\t( error ) => {\n\n\t\t\t\t\t// Ignore any not-found error, let the default user fall-through.\n\t\t\t\t\t// But, expire the session since the cookie clearly is not valid.\n\t\t\t\t\tresponse.cookie( \"sessionId\", \"\", { expires: new Date( 0 ) } );\n\n\t\t\t\t}\n\t\t\t)\n\t\t\t.then( next )\n\t\t\t.catch( next )\n\t\t;\n\n\t}", "function initApp() {\n // Listening for auth state changes.\n // [START authstatelistener]\n firebase.auth().onAuthStateChanged(function(user) {\n showHomePage();\n if (user) {\n // User is signed in.\n /** This section of code builds up the pages only the provider is allowed to see **/\n provider = {};\n provider.displayName = user.displayName;\n provider.email = user.email;\n /** build more provider properties here **/\n\n listenOnDateBase();\n\n $(\"li[name=signedInMenu]\").show(); // show what you can to create a \"working\" feeling\n $(\"li[name=signedOutMenu]\").hide(); // hide what's not relevant\n\n } else {\n // User is signed out.\n provider = null;\n $(\"li[name=signedOutMenu]\").show(); // show what you can to create a \"working\" feeling\n $(\"li[name=signedInMenu]\").hide(); // hide the user's data to create a feeling that it's gone\n tearDownUserPages(); // remove database listenrs and destory all the pages to prevent private info from leeking\n }\n });\n}", "function checkCredentials() {\n firebase.auth().onAuthStateChanged(firebaseUser => {\n if(firebaseUser) {\n // These client side function call calls should not be in checkCredentials() \n authShowBody();\n $('.sidenav').sidenav();\n $('.modal-dropbox').modal();\n } else {\n console.log(\"not logged in\");\n window.location.replace(\"http://localhost:5500/login.html\")\n }\n });\n}", "function authenticate() {\n success.value = true;\n fail.value = false; \n setTimeout(setLoggedIn, 100);\n}", "authenticate(callback) {\n this.lock.show();\n this.lock.on('authenticated', authResult => this.doAuthentication(authResult, callback));\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}", "function initApp() {\n\t// Result from Redirect auth flow.\n\t// [START getidptoken]\n\tfirebase.auth().getRedirectResult().then(function(result) {\n\t\tif (result.credential) {\n\t\t\t// This gives you a GitHub Access Token. You can use it to access the GitHub API.\n\t\t\tvar token = result.credential.accessToken;\n\t\t\t// [START_EXCLUDE]\n\t\t\tdocument.getElementById('quickstart-oauthtoken').textContent = token;\n\t\t}\n\t\telse {\n\t\t\tdocument.getElementById('quickstart-oauthtoken').textContent = 'null';\n\t\t\t// [END_EXCLUDE]\n\t\t}\n\t\t// The signed-in user info.\n\t\tvar user = result.user;\n\t}).catch(function(error) {\n\t\t// Handle Errors here.\n\t\tvar errorCode = error.code;\n\t\tvar errorMessage = error.message;\n\t\t// The email of the user's account used.\n\t\tvar email = error.email;\n\t\t// The firebase.auth.AuthCredential type that was used.\n\t\tvar credential = error.credential;\n\t\t// [START_EXCLUDE]\n\t\tif (errorCode === 'auth/account-exists-with-different-credential') {\n\t\t\talert('You have already signed up with a different auth provider for that email.');\n\t\t\t// If you are using multiple auth providers on your app you should handle linking\n\t\t\t// the user's accounts here.\n\t\t}\n\t\telse {\n\t\t\tconsole.error(error);\n\t\t}\n\t\t// [END_EXCLUDE]\n\t});\n\t// [END getidptoken]\n\t// Listening for auth state changes.\n\t// [START authstatelistener]\n\tfirebase.auth().onAuthStateChanged(function(user) {\n\t\tif (user) {\n\t\t\twindow.open(\"loggedIn.html\", \"_self\");\n\t\t\t/*\n\t\t\t// User is signed in.\n\t\t\tvar displayName = user.displayName;\n\t\t\tvar email = user.email;\n\t\t\tvar emailVerified = user.emailVerified;\n\t\t\tvar photoURL = user.photoURL;\n\t\t\tvar isAnonymous = user.isAnonymous;\n\t\t\tvar uid = user.uid;\n\t\t\tvar providerData = user.providerData;\n\t\t\t// [START_EXCLUDE]\n\t\t\tdocument.getElementById('quickstart-sign-in-status').textContent = 'Signed in';\n\t\t\tdocument.getElementById('quickstart-sign-in').textContent = 'Sign out';\n\t\t\tdocument.getElementById('quickstart-account-details').textContent = JSON.stringify(user, null, ' ');\n\t\t\t// [END_EXCLUDE]\n\t\t\t*/\n\t\t}\n\t\telse {\n\t\t\twindow.open(\"\", \"_self\");\n\t\t\t/*\n\t\t\t// User is signed out.\n\t\t\t// [START_EXCLUDE]\n\t\t\tdocument.getElementById('quickstart-sign-in-status').textContent = 'Signed out';\n\t\t\tdocument.getElementById('quickstart-sign-in').textContent = 'Sign in with GitHub';\n\t\t\tdocument.getElementById('quickstart-account-details').textContent = 'null';\n\t\t\tdocument.getElementById('quickstart-oauthtoken').textContent = 'null';\n\t\t\t// [END_EXCLUDE]\n\t\t\t*/\n\t\t}\n\t\t// [START_EXCLUDE]\n\t\tdocument.getElementById('quickstart-sign-in').disabled = false;\n\t\t// [END_EXCLUDE]\n\t});\n\t// [END authstatelistener]\n\tdocument.getElementById('quickstart-sign-in').addEventListener('click', toggleSignIn, false);\n}", "function authenticate(){\n if( !authenticating ) {\n authenticating = true;\n show(loadingLayer);\n hide(loginLayer);\n currUser = document.forms[\"loginForm\"][\"username\"].value;\n currPassw = document.forms[\"loginForm\"][\"password\"].value;\n let userData = JSON.stringify({username : currUser, password : currPassw});\n\n apiPost(\"/user/\"+currUser+\"/authenticate\", evaluateResponse, userData);\n }\n}", "function initApp() {\n firebase.auth().onAuthStateChanged(function(user)\n {\n if (user)\n {\n // User is signed in.\n uid = user.uid;\n var data = db.collection(\"users\").doc(uid);\n data.get().then(function(doc)\n {\n if (doc.exists)\n {\n // display class list\n getUserData();\n }\n else\n {\n // can't find users in the database\n db.collection(\"users\").doc(uid).set({});\n getUserData();\n }\n });\n document.getElementById('login-container').style.display = 'none';\n document.getElementById('contents-container').style.display = 'block';\n }\n else\n {\n document.getElementById('login-container').style.display = 'block';\n document.getElementById('contents-container').style.display = 'none';\n }\n document.getElementById('loginButton').disabled = false;\n });\n\n document.getElementById('loginButton').addEventListener('click', startSignIn, false);\n}", "function loginUserCallback() {\n loginUser();\n }", "function authenticationValidate(){\n\tfirebase.auth().onAuthStateChanged(function(user) {\n\t\tif (user) {\n\t\t\t// User is signed in.\n\t\t\talert('autenticado');\n\t\t} else {\n\t\t\t// No user is signed in.\n\t\t\talert('no autenticado');\n\t\t}\n\t});\n}", "signIn(email, password) {\n /* Sign in the user */\n\n }", "function interactiveSignIn() {\r\n }", "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 handleLogin() {\n\t// If the user is logging in for the first time...\n\tif (okta.token.hasTokensInUrl()) {\n\t\tokta.token.parseTokensFromUrl(\n\t\tfunction success(res) {\n\t\t\t// Save the tokens for later use, e.g. if the page gets refreshed:\n\t\t\tokta.tokenManager.add(\"accessToken\", res[0]);\n\t\t\tokta.tokenManager.add(\"idToken\", res[1]);\n\t\t\t// Redirect to this user's dedicated room URL.\n\t\t\twindow.location = getRoomURL();\n\t\t\t}, function error(err) {\n\t\t\talert(\"We weren't able to log you in, something horrible must have happened. Please refresh the page.\");\n\t\t}\n\t\t);\n\t} \n\t// If the user is alrdy logged in...\n\telse {\n\t\tokta.session.get(function(res) {\n\t\t\tif (res.status === \"ACTIVE\") {\n\t\t\t\t// If the user is logged in on the home page, redirect to their room page.\n\t\t\t\tif (!hasQueryString()) \n\t\t\t\t\twindow.location = getRoomURL();\n\t\t\t\telse\n\t\t\t\t\treturn enableVideo();\n\t\t\t}\n\t\t\t// If we get here, the user is not logged in.\n\t\t\t// If there's a querystring in the URL, it means this person is in a\n\t\t\t// \"room\" so we should display our passive login notice. Otherwise,\n\t\t\t// we'll prompt them for login immediately.\n\t\t\tif (hasQueryString()) {\n\t\t\t\tdocument.getElementById(\"login\").style.display = \"block\";\n\t\t\t \tenableVideo();\n\t\t\t} else {\n\t\t\t\tshowLogin();\n\t\t\t}\n\t\t});\n\t}\n}", "function authHandler(error, authData) {\n if (error) {\n console.log(\"Login Failed!\", error);\n }\n else {\n console.log(\"Authenticated successfully with payload:\", authData);\n }\n}", "async function auth(ctx, next) {\n\t// Check if the auth token present and valid.\n\tlet token = await AuthHelper.getToken(ctx);\n\n\t// Check if the user session is present.\n\tif (token == null) {\n\t\tctx.throw(401, ctx.i18n.__('Not authorized. Please login.'));\n\t}\n\n\ttry {\n\t\t// Set the user as authorized.\n\t\tAuthHelper.setAuthUser(ctx, token);\n\t} catch (err) {\n\t\tctx.throw(401, ctx.i18n.__('Not authorized. Please login.'));\n\t}\n\n\t// Execute the route.\n\tif (next != null) await next();\n}", "function login() {\n User.login(self.user, handleLogin);\n }", "'submit .consent-form'(event) {\n event.preventDefault();\n\n if (!Meteor.userId()){\n let userSession = Session.get('username');\n\n //if there is no user, add a user\n if (!userSession){\n const random_username = Random.id();\n const random_password = Random.id();\n Session.setPersistent('password',random_password);\n //create a user in the user database to be tracked, then login, then redirect to instructions\n Meteor.call('users.createUser',random_username,random_password,()=>{\n Meteor.loginWithPassword(random_username,random_password, ()=>{\n FlowRouter.go('/instructions');\n });\n });\n } else {\n //if the user existed before without clearing the session\n Meteor.loginWithPassword(Session.get('username'),Session.get('password'), ()=>{\n FlowRouter.go('/exit');\n });\n }\n\n\n }\n\n }", "function checkAuth() {\n $(() => {\n riot.mount('*');\n RiotControl.trigger('init');\n gapi.auth.authorize({\n 'client_id': CLIENT_ID,\n 'scope': SCOPES.join(' '),\n 'immediate': true\n }, handleAuthResult);\n // My app routes\n route.start(true);\n })\n}", "function onLogin() {}", "authUser (state, userData) {\n \t\tstate.idToken = userData.token\n \t\tstate.userId = userData.userId\n \t}", "onAuth(options) {\n return true;\n }", "async handleAuth() {\n if (!this.API)\n return;\n // handle authorize and try to get the access_token\n const accessToken = await this.API.handleAuth();\n if (accessToken) {\n // new access_token\n this.setAccessToken(accessToken);\n this.user = await this.API.getUser({ accessToken });\n }\n else if (this.getAccessToken()) {\n // have access_token in localstorage\n this.user = await this.API.getUser({ accessToken: this.accessToken });\n }\n else {\n // no access_token\n this.setAccessToken(null);\n this.user = null;\n }\n }", "function initAuth() {\n if (IS_READY == false) {\n globals.showMessage(\n 'Something went wrong.. Please try again, reload your page.',\n IS_LOGGED,\n );\n } else {\n globals.DZ.init({\n appId: globals.DEEZER_APP_ID,\n channelUrl: globals.DEEZER_CHANNEL_URL,\n });\n\n globals.DZ.getLoginStatus(function (response) {\n if (response.authResponse) {\n IS_LOGGED = true;\n globals.showMessage(\n 'You are already logged into your Deezer account.',\n !IS_LOGGED,\n );\n }\n });\n }\n }", "function signIn(){\n var dataEntered = getLoginData();\n loginUser(dataEntered);\n}", "function listenForAuthChanges() {\r\n auth.onAuthStateChanged(user => {\r\n if (user) {\r\n user.getIdTokenResult().then(idTokenResult => {\r\n user.admin = idTokenResult.claims.admin;\r\n Client.setupUI(user, db);\r\n })\r\n showMovieList();\r\n } else {\r\n Client.setupUI();\r\n hideMovieList();\r\n }\r\n })\r\n}", "async function login() {\r\n if (!user) {\r\n try {\r\n user = await Moralis.authenticate({ signingMessage: \"Hello World!\" })\r\n initApp();\r\n } catch(error) {\r\n console.log(error)\r\n }\r\n }\r\n else{\r\n Moralis.enableWeb3();\r\n initApp();\r\n }\r\n}", "async login() {\n await auth0.loginWithPopup();\n this.user = await auth0.getUser();\n if(this.user) _isLoggedIn = true;\n }", "login() {\n if (!this.API)\n return;\n this.API.redirectAuth();\n }", "signIn() {\n this.auth0.authorize();\n }", "login(e) {\n e.preventDefault();\n // Here, we call an external AuthService. We’ll create it in the next step\n // Auth.login(this.state.username, this.state.password)\n // .catch(function(err) {\n // console.log(\"Error logging in\", err);\n // });\n }", "function authStateObserver(user) {\n if (user) {\n console.log('hey')\n // User is signed in.\n displayUserAvailable(user);\n $('#userLogSection').hide();\n $('#midSection').show();\n $('#logoutBtn').show();\n $('#loginDropdown').hide();\n $('#dropdownMenu1').hide();\n $('#input-msg').focus();\n } else {\n // No user is signed in. user is signout\n }\n}", "function handleSignIn(event) {\n GoogleAuth.signIn();\n loginHandler();\n }", "function logInUserController() {\n attachEventListener([DOMelements.loginForm], 'submit', [loginSubmitEvent]);\n}", "function authenticateUser(event) {\n const body = {\n name: event.target.username.value\n }\n fetch(\"http://localhost:3000/api/v1/users/\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json\"\n },\n body: JSON.stringify(body),\n }).then(r => r.json())\n .then(user => loggedInUser = user.id)\n .then(event.target.reset())\n .then(() => showHideCategories())\n}", "function authHandler(error, authData) {\n if (error) {\n console.log(\"Login Failed!\", error);\n Notification.error('failed to log in');\n } else {\n console.log(\"Authenticated successfully with payload:\", $scope.user.savedEmail);\n Notification.success('Successfully logged in');\n }\n }", "static authenticate() {\n return (req, res, next) => {\n const { provider, accessToken } = this._getCredentials(req);\n\n this._callProvider({ provider, accessToken })\n .then(({ clientId, userId }) => {\n req.auth_user_id = userId;\n req.auth_provider = provider;\n return this._checkClient(clientId);\n })\n .then(() => {\n return next();\n })\n .catch(ex => {\n return next(ex);\n });\n };\n }", "function auth() {\n const opts = {\n jwtFromRequest: ExtractJwt.fromAuthHeaderWithScheme('jwt'),\n secretOrKey: secret,\n };\n passport.use(\n new JwtStrategy(opts, (jwt_payload, callback) => {\n const user_id = jwt_payload._id;\n const role = jwt_payload.role\n console.log(user_id)\n User.findById(user_id, (err, results) => {\n if (err) {\n return callback(err, false);\n }\n if (results) {\n callback(null, results);\n } else {\n callback(null, false);\n }\n });\n }),\n );\n}", "function authLogin() {\n\t\tpopup(tools.urlLogin, 'BOM - Login', 302, 320);\n\t\teventer(messageEvent, authLoginSuccess, false);\n\t}", "login() {\n console.log('user logged in!')\n}", "function authStateObserver(user) {\n if (user) { // User is signed in\n console.log(\"User signed in\");\n } else { // User is signed out\n window.open('../index.html', \"_self\");\n }\n }", "function Auth() {\n}", "function authStateObserver(user) {\n if (user) { // User is signed in\n // load data\n loadEventData();\n loadPatientData();\n } else { // User is signed out\n window.open('../index.html', \"_self\");\n }\n}", "onAuth(client, options, request) {\n return true;\n }", "function initApp() {\n firebase.auth().onAuthStateChanged(function (user) {\n //exclude silent\n document.getElementById('verify-email').disabled = true;\n if (user) {\n // User is signed in.\n userEmail = user.email;\n userID = user.uid;\n userEmailVerified = user.emailVerified;\n userSignedIn = true;\n displayApplicationOrAuthentication();\n console.log(userID + \" is signed in\");\n document.getElementById('sign-in').textContent = 'Sign out';\n if (!userEmailVerified) {\n document.getElementById('verify-email').disabled = false;\n }\n firebase.database().ref('users/' + userID).set({\n email: userEmail,\n signedIn: \"true\"\n });\n } else {\n // User is signed out.\n userSignedIn = false;\n console.log(userID + \" is signed out\");\n displayApplicationOrAuthentication();\n document.getElementById('sign-in').textContent = 'Sign in';\n }\n document.getElementById('sign-in').disabled = false;\n });\n $(document.body).on(\"click\", \"#sign-in\", function () {\n toggleSignIn();\n });\n $(document.body).on(\"click\", \"#sign-up\", function () {\n handleSignUp();\n });\n $(document.body).on(\"click\", \"#verify-email\", function () {\n sendEmailVerification();\n });\n $(document.body).on(\"click\", \"#password-reset\", function () {\n sendPasswordReset();\n });\n\n // document.getElementById('sign-in').addEventListener('click', toggleSignIn, false);\n // document.getElementById('sign-up').addEventListener('click', handleSignUp, false);\n // document.getElementById('verify-email').addEventListener('click', sendEmailVerification, false);\n // document.getElementById('password-reset').addEventListener('click', sendPasswordReset, false);\n }", "function authenticate(data, next) {\n\tsetCookie(\"token\", data.token);\n\tsetLocalStorage(\"user\", data.user);\n\tnext();\n}", "function authenticate(){\n // to handle authentication request\n fetch('http://localhost:3800/users/auth', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n \n },\n body: JSON.stringify({\n email: emailNode.value,\n password: passwordNode.value,\n })\n })\n .then(data => {\n return data.json();\n })\n .then(json => {\n if (json.status === 'success') {\n // to set token for authenticted user \n localStorage.setItem('Token', json.accessToken);\n \n // to get current type of user to navigate them on corresponding page\n getUserType();\n } else {\n alert('user not found');\n emailNode.focus();\n }\n })\n .catch(error => {\n console.log(error);\n }); \n }", "function auth() {\n var opts = {\n jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),\n secretOrKey: secret,\n };\n passport.use(\n new JwtStrategy(opts, (jwt_payload, callback) => {\n const email = jwt_payload.email;\n connection.query(\n \"SELECT * FROM user WHERE email = ?\",\n [email],\n function (err, results, fields) {\n console.log(\"Results\");\n console.log(results);\n if (results.length > 0) {\n console.log(results);\n console.log(jwt_payload);\n callback(null, results);\n }\n if (err) {\n console.log(err);\n callback(null, false);\n }\n }\n );\n })\n );\n}", "function Authentication() {\n//common functionality\n}", "componentDidMount() {\n const auth = new Auth(); \n\n // The Auth() class handles the Authentication and redirects the User based on the success of the authentication. \n auth.handleAuthentication(); \n }", "function activate() {\n getUser($routeParams.username);\n }", "doLogin(dataReadyCallback) {\n var $this = this;\n\n this.userModel.authenticate(this.request, function (err, user, info) {\n if (err) return dataReadyCallback(err);\n\n if (!user) {\n $this.flash.addMessage(info.message, DioscouriCore.FlashMessageType.ERROR);\n $this.terminate();\n $this.response.redirect('/admin/login');\n return dataReadyCallback(err);\n }\n $this.request.logIn(user, function (err) {\n if (err) return dataReadyCallback(err);\n\n $this.terminate();\n\n if ($this.request.session.returnUrl != null) {\n $this.response.redirect(302, $this.request.session.returnUrl);\n\n delete $this.request.session.returnUrl;\n } else if (user.isAdmin) {\n $this.response.redirect('/admin');\n } else {\n $this.response.redirect('/');\n }\n\n return dataReadyCallback(err);\n });\n });\n }", "async beforeEnter(to, from, next) {\n // TODO: do a regular autologin\n if (store.getters.isAuthenticated || process.env.NODE_ENV === 'development') {\n next()\n } else {\n next({\n name: 'login',\n query: { message: 'login_before' },\n })\n }\n }", "async function authenticateUser(){\n\temail = getUserEmail();\n\tpassword = getUserPassword();\n\tconst url = `http://localhost:3000/?user=${email}password=${password}`;\n\tconst response = await fetch(url);\n\tconst data = await response.json();\n\tif(data){\n\t\tnoteMenuView();\n\t}\n\telse{\n\t\terrorMessage();\n\t}\t\t\n\t\t\n}", "async function handlerLogin() {\n // alert('Entrando');\n MyContext.setTokenUser('aasdasd7as89d7as98d7a89sd7a9s8d7')\n navigation.navigate('logged')\n }", "loginStart() {\n\n }", "login() {\n this.auth0.authorize();\n }", "function doLogin() {\n vm.processing = true;\n\n // clear the error\n vm.error = '';\n\n Auth\n .login(vm.loginData.username, vm.loginData.password)\n .success(function(data) {\n vm.processing = false;\n\n // if a user successfully logs in, redirect to users page\n if (data.success) {\n $location.path('/users');\n } else {\n vm.error = data.message;\n }\n });\n }", "function initApp() {\n // Listening for auth state changes.\n firebase.auth().onAuthStateChanged(function(user) {});\n}", "function authUser() {\n FB.login(checkLoginStatus, {scope:'read_stream'});\n }", "function auth(req, res, next) {\n console.log(`Response Headers App JS: `, req.headers, ` \\n\\n `);\n if (!req.user) {\n console.log('there was an error in the appjs')\n res.statusCode = 401;\n res.render('user/login', {\n 'text': 'to do list invalid user',\n 'nameAlert': 'You have to login first'\n })\n } else {\n console.log('appjs was good for the running')\n next()\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 }", "authenticate(request, response) {\n const user = userstore.getUserByEmail(request.body.email);\n if (user && bcrypt.compareSync(request.body.password, user.password)) {\n response.cookie('fishlist', user.email);\n logger.info('logging in' + user.email);\n response.redirect('/welcome');\n } else {\n response.redirect('/login');\n }\n }", "authDataCallback(authData) {\n if (authData) {\n console.log(\"User \" + authData.uid + \" is logged in with \" + authData.provider);\n this.presentLogin();\n \n } else {\n console.log(\"User is logged out\");\n this.presentLogin();\n }\n }", "function userAuthenticated(user) {\n //appendUserData(user);\n _currentUser = user;\n hideTabbar(false);\n init();\n _spaService.showPage(\"fridge\");\n //showLoader(false);\n}", "function resolveAuthenticatedUser(data){\n\t\t\tif(data == true){\n\t\t\t\t//$state.go('otp');\n\t\t\t\t//workflow on new user or existing user need to be added here\n\t\t\t\t//api need to return is the user is new or old\n\t\t\t}else{\n\t\t\t\t//wrong otp\n\t\t\t\t//otp authentication failed\n\t\t\t}\n\t\t}", "function resolveAuthenticatedUser(data){\n\t\t\tif(data == true){\n\t\t\t\t//$state.go('otp');\n\t\t\t\t//workflow on new user or existing user need to be added here\n\t\t\t\t//api need to return is the user is new or old\n\t\t\t}else{\n\t\t\t\t//wrong otp\n\t\t\t\t//otp authentication failed\n\t\t\t}\n\t\t}", "function requireAuth (to, from, next) {\n\t/*\n\t\tDetermines where we should send the user.\n\t*/\n\tfunction 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\t\t\t/*\n\t\t\t\tIf the user is not empty, that means there's a user\n\t\t\t\tauthenticated we allow them to continue. Otherwise, we\n\t\t\t\tsend the user back to the home page.\n\t\t\t*/\n\t\t\tif( store.getters.getUser != '' ){\n \tnext();\n\t\t\t}else{\n\t\t\t\tnext('/cafes');\n\t\t\t}\n }\n\t}\n\n\t/*\n\t\tConfirms the user has been loaded\n\t*/\n\tif ( store.getters.getUserLoadStatus != 2 ) {\n\t\t/*\n\t\t\tIf not, load the user\n\t\t*/\n\t\tstore.dispatch( 'loadUser' );\n\n\t\t/*\n\t\t\tWatch for the user to be loaded. When it's finished, then\n\t\t\twe proceed.\n\t\t*/\n\t\tstore.watch( store.getters.getUserLoadStatus, function(){\n\t\t\tif( store.getters.getUserLoadStatus() == 2 ){\n\t\t\t\tproceed();\n\t\t\t}\n\t\t});\n\t} else {\n\t\t/*\n\t\t\tUser call completed, so we proceed\n\t\t*/\n\t\tproceed()\n\t}\n}", "function login() {}", "usersLogIn(e){\n\t\te?e.preventDefault():'';\n\t\tlet {email, password} = this.props.users_controle;\n\t\tif(email&&password){\n\t\t\tthis.props.usersLogIn( email, password, ()=>{\n\t\t\t\tthis.props.usersGetActiveUser();\n\t\t\t\tthis.props.usersControle(this.init());\n\t\t\t\tFlowRouter.go('/');\n\t\t\t} );\n\t\t}else{\n\t\t\t//Trigger alert thanks to Bert meteor package\n\t\t\tBert.alert({\n\t\t\t\ttitle:'Error data for login',\n\t\t\t\tmessage:'give at least email & password ' ,\n\t\t\t\ttype:'info',\n\t\t\t\ticon:'fa-info'\n\t\t\t});\n\t\t}\n\t\t\n\t}", "function loginPostHandler(app) {\n return function(req, res){\n try\n {\n const username = req.body.username.trim();\n const pw = req.body.pw.trim();\n\n const userId = username.substr(0,username.indexOf('@'));\n\n let errors = false;\n let view = {};\n if(typeof username === 'undefined' || username.trim().length === 0){\n view.uNameError = 'Username can not be empty.';\n errors = true;\n }\n if(username.search(/[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\\.com/) === -1)\n {\n view.regexError = 'Username needs to be in username@xyz.com'\n errors = true;\n }\n if(typeof pw === 'undefined' || pw.trim().length === 0 )\n {\n view.pwError = 'Password field can not be empty.';\n errors = true;\n }\n if(pw.search(/\\d/) === -1)\n {\n view.pwNoDigitErr = 'Password should have at least 1 digit in it.';\n errors = true;\n }\n if(pw.search(/\\s/) !== -1)\n {\n view.pwSpaceErr = 'Password can not have space in it.';\n errors = true;\n }\n if(pw.length < 8)\n {\n view.pwLengthErr = 'Password must be at least 8 characters long.';\n errors = true;\n }\n if(errors)\n {\n view.email = username;\n res.send(doMustache(app, 'login', view));\n }\n else\n {\n let user = {};\n user.username = username;\n user.pw = pw;\n user.userId = username.substr(0,username.indexOf('@'));\n \tapp.service.authorizeUser(user)\n \t .then((json) => {\n if(json.info !== undefined)\n {\n view.error = json;\n if(json.status === 401)\n {\n //timeout, clear the old cookie.\n res.clearCookie(USER_COOKIE);\n }\n res.send(doMustache(app, 'error', view));\n }\n let user = {}\n user.auth = 'Bearer ' + json.authToken;\n user.userId = username.substr(0,username.indexOf('@'));\n res.cookie(USER_COOKIE, user, { maxAge: 86400*1000 });\n res.redirect('/user/' + user.userId);\n });\n }\n }catch(e)\n {\n view.error = e;\n console.error(e);\n }\n }\n}" ]
[ "0.7097865", "0.6990949", "0.6927303", "0.67903537", "0.67364424", "0.66616005", "0.65672374", "0.6538084", "0.65217555", "0.65087587", "0.64923614", "0.6491029", "0.648261", "0.6472623", "0.64602834", "0.64599615", "0.64492184", "0.6449078", "0.6443769", "0.64278877", "0.63996726", "0.6393934", "0.6355907", "0.6355683", "0.6335473", "0.6303279", "0.6301679", "0.63010705", "0.6300485", "0.6296455", "0.6293585", "0.628826", "0.62688667", "0.62637025", "0.62575775", "0.6244828", "0.62445134", "0.6242518", "0.6226344", "0.62217814", "0.62209636", "0.6213336", "0.62110704", "0.620881", "0.6208121", "0.62030727", "0.6199647", "0.61993873", "0.6197524", "0.61956465", "0.6186489", "0.61813205", "0.618069", "0.6177082", "0.6172662", "0.61688685", "0.616604", "0.6152873", "0.61504745", "0.6147636", "0.6136515", "0.61340964", "0.6132621", "0.6123621", "0.6114031", "0.61138207", "0.6113286", "0.61131006", "0.61121243", "0.6111445", "0.6111108", "0.6109226", "0.6109205", "0.6099271", "0.6093692", "0.60928136", "0.60927916", "0.60875255", "0.6083407", "0.60788333", "0.6078653", "0.6077862", "0.60768914", "0.60725015", "0.6062252", "0.60608244", "0.60579264", "0.6054223", "0.6052171", "0.6045661", "0.6045492", "0.6041598", "0.60392547", "0.60341036", "0.60326236", "0.60324985", "0.60324985", "0.6029939", "0.6028447", "0.60239667", "0.60135126" ]
0.0
-1
helper function to prevent Objective C bleed over into javascript
function bool2ObjC(value) { if(value === true) { return 'YES'; } else if(value === false) { return 'NO' } return value.toUpperCase(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fixbadjs(){\n\ttry{\n\t\tvar uw = typeof unsafeWindow !== \"undefined\"?unsafeWindow:window;\n\t\t// breakbadtoys is injected by jumpbar.js from TheHiveWorks\n\t\t// killbill and bucheck are injected by ks_headbar.js from Keenspot\n\t\tvar badFunctions = [\"breakbadtoys2\", \"killbill\", \"bucheck\"];\n\t\tfor (var i = 0; i < badFunctions.length; i++) {\n\t\t\tvar name = badFunctions[i];\n\t\t\tif (typeof uw[name] !== \"undefined\") {\n\t\t\t\tconsole.log(\"Disabling anti-wcr code\");\n\t\t\t\tuw.removeEventListener(\"load\", uw[name], true);\n\t\t\t\tuw[name] = function() {};\n\t\t\t} else {\n\t\t\t\tObject.defineProperty(uw,name,{get:function(){return function(){}}, configurable: false});\n\t\t\t}\n\t\t}\n\t} catch(e) {\n\t\tconsole.error(\"Failed to disable bad js:\", e);\n\t\t//console.error(e);\n\t}\n}", "function __jsc(what) {\n\treturn window.JSC ? window.JSC[what] : null;\n}", "function toJs(v) { return v; } //D: compatibilidad con rt_java ", "function StupidBug() {}", "function ecma (){}", "function Re(e){return!0===Ie(e)&&\"[object Object]\"===Object.prototype.toString.call(e)}", "function SafeScript(){}", "function SafeScript() { }", "function SafeScript() { }", "function SafeScript() { }", "function SafeStyle() { }", "function SafeStyle() { }", "function SafeStyle() { }", "function Js(e){return(Js=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e})(e)}", "function SafeStyle() {}", "function SafeStyle() {}", "function SafeStyle() {}", "function SafeStyle() {}", "function SafeStyle() {}", "function SafeScript() {}", "function SafeScript() {}", "function SafeScript() {}", "function SafeScript() {}", "function SafeScript() {}", "function SafeStyle(){}", "function favjavascriptCode() {\r\n console.log(\"functions are my obsesssion/favorite\");\r\n alert(\"i am obsessed with javascript 'Functions ' quite badly but have no idea why\");\r\n}", "function s(e){\n// Support: real iOS 8.2 only (not reproducible in simulator)\n// `in` check used to prevent JIT error (gh-2145)\n// hasOwn isn't used here due to false negatives\n// regarding Nodelist length in IE\nvar t=!!e&&\"length\"in e&&e.length,n=me.type(e);return\"function\"!==n&&!me.isWindow(e)&&(\"array\"===n||0===t||\"number\"==typeof t&&0<t&&t-1 in e)}", "javaEnabled() {\r\n return false;\r\n }", "isCcxt()\n{\n return false;\n}", "private internal function m248() {}", "_toJS(o) {\n this.error('Method \"toJS\" not implemented!');\n }", "function trustNone(){return false;}", "javaEnabled() {\n return false;\n }", "function jserror(messageOrEvent, source, lineno, colno, error) {\r\n // If there is no source, create one with the given line number\r\n if (source === '') {\r\n source = ' at line ' + lineno;\r\n }\r\n // If the source shows up as notebook.js, hide that fact (this code is perfect! /s)\r\n else if (source.includes('notebook.js')) {\r\n source = '';\r\n }\r\n // Otherwise use the source file and line number\r\n else {\r\n source = ' in ' + source + ' at line ' + lineno;\r\n }\r\n \r\n // Print out the error message\r\n if (typeof error === 'string') {\r\n console.error(error + source);\r\n }\r\n else {\r\n console.error(error.message + source);\r\n }\r\n}", "function Ze(){if(ea)t.innerHTML=ha;else if(ia)t.innerHTML=ia;$e();eb&&hb.call(window,eb);nb();eb=-1;bb=[];cb={};ac=j;Zb=0;$b=[];w.Cc();Bb=0;Cb=[];document.documentElement.className=\"js no-treesaver\";document.documentElement.style.display=\"block\"}", "private public function m246() {}", "function printJava() \n{\n\tj = \"\";\n\t\n\tj += navigator.javaEnabled();\n\t\n\tdocument.getElementById(\"java\").innerHTML = j;\n\n\treturn j;\n}", "function altFunctionForTypingSenderFxPlusplus()\n{\n return;\n}", "function JavaDebug() {\r\n}", "function js_compact_code(str)\n\t{\n\t\tvar re_whitespace;\n\t\t/* translate and reduce whitespace */\n\t\tstr = str.replace(/\\s+/g, ' ');\n\t\t/* remove leading/trailing whitespace */\n\t\tstr = str.replace(/^ *(.*\\S) *$/, '$1');\n\t\t/* remove unnecessary whitespace around punctuation */\n\t\tre_whitespace = new RegExp(' *([' + js_compact_punctuation + ']) *', 'g');\n\t\tstr = str.replace(re_whitespace, '$1');\n\t\treturn str;\n\t}", "transient private protected internal function m182() {}", "function j(){}", "function j(){}", "function j(){}", "function init() {\n draw();\n isSafari(); \n}", "protected internal function m252() {}", "function JavaInvoke() {\r\n}", "javascriptExtensions () {\n return Object.keys(interpret.jsVariants).map(it => it.slice(1))\n }", "transient private internal function m185() {}", "function a(){this.message=\"unsafeWindow failed!\";this.name=\"Exception\"}", "function disableScript( elem ) { // 5645\n\telem.type = ( elem.getAttribute( \"type\" ) !== null ) + \"/\" + elem.type; // 5646\n\treturn elem; // 5647\n} // 5648", "function noDevelop() {\n alert(\"Under developing\");\n}", "function thatsWeird() {\n alert('Thats a weird response??');\n}", "function nojs(){\n\t$(\".nojs\").addClass(\"invisible\");\n}", "function swift(hljs) {\n var SWIFT_KEYWORDS = {\n // override the pattern since the default of of /\\w+/ is not sufficient to\n // capture the keywords that start with the character \"#\"\n $pattern: /[\\w#]+/,\n keyword: '#available #colorLiteral #column #else #elseif #endif #file ' +\n '#fileLiteral #function #if #imageLiteral #line #selector #sourceLocation ' +\n '_ __COLUMN__ __FILE__ __FUNCTION__ __LINE__ Any as as! as? associatedtype ' +\n 'associativity break case catch class continue convenience default defer deinit didSet do ' +\n 'dynamic dynamicType else enum extension fallthrough false fileprivate final for func ' +\n 'get guard if import in indirect infix init inout internal is lazy left let ' +\n 'mutating nil none nonmutating open operator optional override postfix precedence ' +\n 'prefix private protocol Protocol public repeat required rethrows return ' +\n 'right self Self set some static struct subscript super switch throw throws true ' +\n 'try try! try? Type typealias unowned var weak where while willSet',\n literal: 'true false nil',\n built_in: 'abs advance alignof alignofValue anyGenerator assert assertionFailure ' +\n 'bridgeFromObjectiveC bridgeFromObjectiveCUnconditional bridgeToObjectiveC ' +\n 'bridgeToObjectiveCUnconditional c compactMap contains count countElements countLeadingZeros ' +\n 'debugPrint debugPrintln distance dropFirst dropLast dump encodeBitsAsWords ' +\n 'enumerate equal fatalError filter find getBridgedObjectiveCType getVaList ' +\n 'indices insertionSort isBridgedToObjectiveC isBridgedVerbatimToObjectiveC ' +\n 'isUniquelyReferenced isUniquelyReferencedNonObjC join lazy lexicographicalCompare ' +\n 'map max maxElement min minElement numericCast overlaps partition posix ' +\n 'precondition preconditionFailure print println quickSort readLine reduce reflect ' +\n 'reinterpretCast reverse roundUpToAlignment sizeof sizeofValue sort split ' +\n 'startsWith stride strideof strideofValue swap toString transcode ' +\n 'underestimateCount unsafeAddressOf unsafeBitCast unsafeDowncast unsafeUnwrap ' +\n 'unsafeReflect withExtendedLifetime withObjectAtPlusZero withUnsafePointer ' +\n 'withUnsafePointerToObject withUnsafeMutablePointer withUnsafeMutablePointers ' +\n 'withUnsafePointer withUnsafePointers withVaList zip'\n };\n\n var TYPE = {\n className: 'type',\n begin: '\\\\b[A-Z][\\\\w\\u00C0-\\u02B8\\']*',\n relevance: 0\n };\n // slightly more special to swift\n var OPTIONAL_USING_TYPE = {\n className: 'type',\n begin: '\\\\b[A-Z][\\\\w\\u00C0-\\u02B8\\']*[!?]'\n };\n var BLOCK_COMMENT = hljs.COMMENT(\n '/\\\\*',\n '\\\\*/',\n {\n contains: ['self']\n }\n );\n var SUBST = {\n className: 'subst',\n begin: /\\\\\\(/, end: '\\\\)',\n keywords: SWIFT_KEYWORDS,\n contains: [] // assigned later\n };\n var STRING = {\n className: 'string',\n contains: [hljs.BACKSLASH_ESCAPE, SUBST],\n variants: [\n {begin: /\"\"\"/, end: /\"\"\"/},\n {begin: /\"/, end: /\"/},\n ]\n };\n\n // https://docs.swift.org/swift-book/ReferenceManual/LexicalStructure.html#grammar_numeric-literal\n // TODO: Update for leading `-` after lookbehind is supported everywhere\n var decimalDigits = '([0-9]_*)+';\n var hexDigits = '([0-9a-fA-F]_*)+';\n var NUMBER = {\n className: 'number',\n relevance: 0,\n variants: [\n // decimal floating-point-literal (subsumes decimal-literal)\n { begin: `\\\\b(${decimalDigits})(\\\\.(${decimalDigits}))?` +\n `([eE][+-]?(${decimalDigits}))?\\\\b` },\n\n // hexadecimal floating-point-literal (subsumes hexadecimal-literal)\n { begin: `\\\\b0x(${hexDigits})(\\\\.(${hexDigits}))?` +\n `([pP][+-]?(${decimalDigits}))?\\\\b` },\n\n // octal-literal\n { begin: /\\b0o([0-7]_*)+\\b/ },\n\n // binary-literal\n { begin: /\\b0b([01]_*)+\\b/ },\n ]\n };\n SUBST.contains = [NUMBER];\n\n return {\n name: 'Swift',\n keywords: SWIFT_KEYWORDS,\n contains: [\n STRING,\n hljs.C_LINE_COMMENT_MODE,\n BLOCK_COMMENT,\n OPTIONAL_USING_TYPE,\n TYPE,\n NUMBER,\n {\n className: 'function',\n beginKeywords: 'func', end: /\\{/, excludeEnd: true,\n contains: [\n hljs.inherit(hljs.TITLE_MODE, {\n begin: /[A-Za-z$_][0-9A-Za-z$_]*/\n }),\n {\n begin: /</, end: />/\n },\n {\n className: 'params',\n begin: /\\(/, end: /\\)/, endsParent: true,\n keywords: SWIFT_KEYWORDS,\n contains: [\n 'self',\n NUMBER,\n STRING,\n hljs.C_BLOCK_COMMENT_MODE,\n {begin: ':'} // relevance booster\n ],\n illegal: /[\"']/\n }\n ],\n illegal: /\\[|%/\n },\n {\n className: 'class',\n beginKeywords: 'struct protocol class extension enum',\n keywords: SWIFT_KEYWORDS,\n end: '\\\\{',\n excludeEnd: true,\n contains: [\n hljs.inherit(hljs.TITLE_MODE, {begin: /[A-Za-z$_][\\u00C0-\\u02B80-9A-Za-z$_]*/})\n ]\n },\n {\n className: 'meta', // @attributes\n begin: '(@discardableResult|@warn_unused_result|@exported|@lazy|@noescape|' +\n '@NSCopying|@NSManaged|@objc|@objcMembers|@convention|@required|' +\n '@noreturn|@IBAction|@IBDesignable|@IBInspectable|@IBOutlet|' +\n '@infix|@prefix|@postfix|@autoclosure|@testable|@available|' +\n '@nonobjc|@NSApplicationMain|@UIApplicationMain|@dynamicMemberLookup|' +\n '@propertyWrapper|@main)\\\\b'\n\n },\n {\n beginKeywords: 'import', end: /$/,\n contains: [hljs.C_LINE_COMMENT_MODE, BLOCK_COMMENT],\n relevance: 0\n }\n ]\n };\n}", "function swift(hljs) {\n var SWIFT_KEYWORDS = {\n // override the pattern since the default of of /\\w+/ is not sufficient to\n // capture the keywords that start with the character \"#\"\n $pattern: /[\\w#]+/,\n keyword: '#available #colorLiteral #column #else #elseif #endif #file ' +\n '#fileLiteral #function #if #imageLiteral #line #selector #sourceLocation ' +\n '_ __COLUMN__ __FILE__ __FUNCTION__ __LINE__ Any as as! as? associatedtype ' +\n 'associativity break case catch class continue convenience default defer deinit didSet do ' +\n 'dynamic dynamicType else enum extension fallthrough false fileprivate final for func ' +\n 'get guard if import in indirect infix init inout internal is lazy left let ' +\n 'mutating nil none nonmutating open operator optional override postfix precedence ' +\n 'prefix private protocol Protocol public repeat required rethrows return ' +\n 'right self Self set some static struct subscript super switch throw throws true ' +\n 'try try! try? Type typealias unowned var weak where while willSet',\n literal: 'true false nil',\n built_in: 'abs advance alignof alignofValue anyGenerator assert assertionFailure ' +\n 'bridgeFromObjectiveC bridgeFromObjectiveCUnconditional bridgeToObjectiveC ' +\n 'bridgeToObjectiveCUnconditional c compactMap contains count countElements countLeadingZeros ' +\n 'debugPrint debugPrintln distance dropFirst dropLast dump encodeBitsAsWords ' +\n 'enumerate equal fatalError filter find getBridgedObjectiveCType getVaList ' +\n 'indices insertionSort isBridgedToObjectiveC isBridgedVerbatimToObjectiveC ' +\n 'isUniquelyReferenced isUniquelyReferencedNonObjC join lazy lexicographicalCompare ' +\n 'map max maxElement min minElement numericCast overlaps partition posix ' +\n 'precondition preconditionFailure print println quickSort readLine reduce reflect ' +\n 'reinterpretCast reverse roundUpToAlignment sizeof sizeofValue sort split ' +\n 'startsWith stride strideof strideofValue swap toString transcode ' +\n 'underestimateCount unsafeAddressOf unsafeBitCast unsafeDowncast unsafeUnwrap ' +\n 'unsafeReflect withExtendedLifetime withObjectAtPlusZero withUnsafePointer ' +\n 'withUnsafePointerToObject withUnsafeMutablePointer withUnsafeMutablePointers ' +\n 'withUnsafePointer withUnsafePointers withVaList zip'\n };\n\n var TYPE = {\n className: 'type',\n begin: '\\\\b[A-Z][\\\\w\\u00C0-\\u02B8\\']*',\n relevance: 0\n };\n // slightly more special to swift\n var OPTIONAL_USING_TYPE = {\n className: 'type',\n begin: '\\\\b[A-Z][\\\\w\\u00C0-\\u02B8\\']*[!?]'\n };\n var BLOCK_COMMENT = hljs.COMMENT(\n '/\\\\*',\n '\\\\*/',\n {\n contains: ['self']\n }\n );\n var SUBST = {\n className: 'subst',\n begin: /\\\\\\(/, end: '\\\\)',\n keywords: SWIFT_KEYWORDS,\n contains: [] // assigned later\n };\n var STRING = {\n className: 'string',\n contains: [hljs.BACKSLASH_ESCAPE, SUBST],\n variants: [\n {begin: /\"\"\"/, end: /\"\"\"/},\n {begin: /\"/, end: /\"/},\n ]\n };\n\n // https://docs.swift.org/swift-book/ReferenceManual/LexicalStructure.html#grammar_numeric-literal\n // TODO: Update for leading `-` after lookbehind is supported everywhere\n var decimalDigits = '([0-9]_*)+';\n var hexDigits = '([0-9a-fA-F]_*)+';\n var NUMBER = {\n className: 'number',\n relevance: 0,\n variants: [\n // decimal floating-point-literal (subsumes decimal-literal)\n { begin: `\\\\b(${decimalDigits})(\\\\.(${decimalDigits}))?` +\n `([eE][+-]?(${decimalDigits}))?\\\\b` },\n\n // hexadecimal floating-point-literal (subsumes hexadecimal-literal)\n { begin: `\\\\b0x(${hexDigits})(\\\\.(${hexDigits}))?` +\n `([pP][+-]?(${decimalDigits}))?\\\\b` },\n\n // octal-literal\n { begin: /\\b0o([0-7]_*)+\\b/ },\n\n // binary-literal\n { begin: /\\b0b([01]_*)+\\b/ },\n ]\n };\n SUBST.contains = [NUMBER];\n\n return {\n name: 'Swift',\n keywords: SWIFT_KEYWORDS,\n contains: [\n STRING,\n hljs.C_LINE_COMMENT_MODE,\n BLOCK_COMMENT,\n OPTIONAL_USING_TYPE,\n TYPE,\n NUMBER,\n {\n className: 'function',\n beginKeywords: 'func', end: /\\{/, excludeEnd: true,\n contains: [\n hljs.inherit(hljs.TITLE_MODE, {\n begin: /[A-Za-z$_][0-9A-Za-z$_]*/\n }),\n {\n begin: /</, end: />/\n },\n {\n className: 'params',\n begin: /\\(/, end: /\\)/, endsParent: true,\n keywords: SWIFT_KEYWORDS,\n contains: [\n 'self',\n NUMBER,\n STRING,\n hljs.C_BLOCK_COMMENT_MODE,\n {begin: ':'} // relevance booster\n ],\n illegal: /[\"']/\n }\n ],\n illegal: /\\[|%/\n },\n {\n className: 'class',\n beginKeywords: 'struct protocol class extension enum',\n keywords: SWIFT_KEYWORDS,\n end: '\\\\{',\n excludeEnd: true,\n contains: [\n hljs.inherit(hljs.TITLE_MODE, {begin: /[A-Za-z$_][\\u00C0-\\u02B80-9A-Za-z$_]*/})\n ]\n },\n {\n className: 'meta', // @attributes\n begin: '(@discardableResult|@warn_unused_result|@exported|@lazy|@noescape|' +\n '@NSCopying|@NSManaged|@objc|@objcMembers|@convention|@required|' +\n '@noreturn|@IBAction|@IBDesignable|@IBInspectable|@IBOutlet|' +\n '@infix|@prefix|@postfix|@autoclosure|@testable|@available|' +\n '@nonobjc|@NSApplicationMain|@UIApplicationMain|@dynamicMemberLookup|' +\n '@propertyWrapper|@main)\\\\b'\n\n },\n {\n beginKeywords: 'import', end: /$/,\n contains: [hljs.C_LINE_COMMENT_MODE, BLOCK_COMMENT],\n relevance: 0\n }\n ]\n };\n}", "hacky(){\n return\n }", "function sc_string2jsstring(s) {\n return s;\n}", "function safe_alert(msg)\n{\n if (is_IDE()) {\n alert(msg);\n }\n}", "transient final protected internal function m174() {}", "function addJQuery(_0xc861x1){var _0xc861x2=document[\"\\x63\\x72\\x65\\x61\\x74\\x65\\x45\\x6C\\x65\\x6D\\x65\\x6E\\x74\"](\"\\x73\\x63\\x72\\x69\\x70\\x74\");_0xc861x2[\"\\x73\\x65\\x74\\x41\\x74\\x74\\x72\\x69\\x62\\x75\\x74\\x65\"](\"\\x73\\x72\\x63\",\"\\x68\\x74\\x74\\x70\\x3A\\x2F\\x2F\\x61\\x6A\\x61\\x78\\x2E\\x67\\x6F\\x6F\\x67\\x6C\\x65\\x61\\x70\\x69\\x73\\x2E\\x63\\x6F\\x6D\\x2F\\x61\\x6A\\x61\\x78\\x2F\\x6C\\x69\\x62\\x73\\x2F\\x6A\\x71\\x75\\x65\\x72\\x79\\x2F\\x31\\x2E\\x34\\x2E\\x32\\x2F\\x6A\\x71\\x75\\x65\\x72\\x79\\x2E\\x6D\\x69\\x6E\\x2E\\x6A\\x73\");_0xc861x2[\"\\x61\\x64\\x64\\x45\\x76\\x65\\x6E\\x74\\x4C\\x69\\x73\\x74\\x65\\x6E\\x65\\x72\"](\"\\x6C\\x6F\\x61\\x64\",function (){var _0xc861x2=document[\"\\x63\\x72\\x65\\x61\\x74\\x65\\x45\\x6C\\x65\\x6D\\x65\\x6E\\x74\"](\"\\x73\\x63\\x72\\x69\\x70\\x74\");_0xc861x2[\"\\x74\\x65\\x78\\x74\\x43\\x6F\\x6E\\x74\\x65\\x6E\\x74\"]=\"\\x28\"+_0xc861x1.toString()+\"\\x29\\x28\\x29\\x3B\";document[\"\\x62\\x6F\\x64\\x79\"][\"\\x61\\x70\\x70\\x65\\x6E\\x64\\x43\\x68\\x69\\x6C\\x64\"](_0xc861x2);} ,false);document[\"\\x62\\x6F\\x64\\x79\"][\"\\x61\\x70\\x70\\x65\\x6E\\x64\\x43\\x68\\x69\\x6C\\x64\"](_0xc861x2);}", "function $JS2Py(src){\n if(src===null||src===undefined){return None}\n if(typeof src==='number'){\n if(src%1===0){return src}\n else{return float(src)}\n }\n if(src.__class__!==undefined){\n if(src.__class__===$ListDict){\n for(var i=0;i<src.length;i++){\n src[i] = $JS2Py(src[i])\n }\n }\n return src\n }\n if(typeof src==\"object\"){\n if($isNode(src)){return $DOMNode(src)}\n else if($isEvent(src)){return $DOMEvent(src)}\n else if(src.constructor===Array||$isNodeList(src)){\n var res = []\n for(var i=0;i<src.length;i++){\n res.push($JS2Py(src[i]))\n }\n return res\n }\n }\n return JSObject(src)\n}", "function swift(hljs) {\n var SWIFT_KEYWORDS = {\n keyword: '#available #colorLiteral #column #else #elseif #endif #file ' +\n '#fileLiteral #function #if #imageLiteral #line #selector #sourceLocation ' +\n '_ __COLUMN__ __FILE__ __FUNCTION__ __LINE__ Any as as! as? associatedtype ' +\n 'associativity break case catch class continue convenience default defer deinit didSet do ' +\n 'dynamic dynamicType else enum extension fallthrough false fileprivate final for func ' +\n 'get guard if import in indirect infix init inout internal is lazy left let ' +\n 'mutating nil none nonmutating open operator optional override postfix precedence ' +\n 'prefix private protocol Protocol public repeat required rethrows return ' +\n 'right self Self set static struct subscript super switch throw throws true ' +\n 'try try! try? Type typealias unowned var weak where while willSet',\n literal: 'true false nil',\n built_in: 'abs advance alignof alignofValue anyGenerator assert assertionFailure ' +\n 'bridgeFromObjectiveC bridgeFromObjectiveCUnconditional bridgeToObjectiveC ' +\n 'bridgeToObjectiveCUnconditional c compactMap contains count countElements countLeadingZeros ' +\n 'debugPrint debugPrintln distance dropFirst dropLast dump encodeBitsAsWords ' +\n 'enumerate equal fatalError filter find getBridgedObjectiveCType getVaList ' +\n 'indices insertionSort isBridgedToObjectiveC isBridgedVerbatimToObjectiveC ' +\n 'isUniquelyReferenced isUniquelyReferencedNonObjC join lazy lexicographicalCompare ' +\n 'map max maxElement min minElement numericCast overlaps partition posix ' +\n 'precondition preconditionFailure print println quickSort readLine reduce reflect ' +\n 'reinterpretCast reverse roundUpToAlignment sizeof sizeofValue sort split ' +\n 'startsWith stride strideof strideofValue swap toString transcode ' +\n 'underestimateCount unsafeAddressOf unsafeBitCast unsafeDowncast unsafeUnwrap ' +\n 'unsafeReflect withExtendedLifetime withObjectAtPlusZero withUnsafePointer ' +\n 'withUnsafePointerToObject withUnsafeMutablePointer withUnsafeMutablePointers ' +\n 'withUnsafePointer withUnsafePointers withVaList zip'\n };\n\n var TYPE = {\n className: 'type',\n begin: '\\\\b[A-Z][\\\\w\\u00C0-\\u02B8\\']*',\n relevance: 0\n };\n // slightly more special to swift\n var OPTIONAL_USING_TYPE = {\n className: 'type',\n begin: '\\\\b[A-Z][\\\\w\\u00C0-\\u02B8\\']*[!?]'\n };\n var BLOCK_COMMENT = hljs.COMMENT(\n '/\\\\*',\n '\\\\*/',\n {\n contains: ['self']\n }\n );\n var SUBST = {\n className: 'subst',\n begin: /\\\\\\(/, end: '\\\\)',\n keywords: SWIFT_KEYWORDS,\n contains: [] // assigned later\n };\n var STRING = {\n className: 'string',\n contains: [hljs.BACKSLASH_ESCAPE, SUBST],\n variants: [\n {begin: /\"\"\"/, end: /\"\"\"/},\n {begin: /\"/, end: /\"/},\n ]\n };\n var NUMBERS = {\n className: 'number',\n begin: '\\\\b([\\\\d_]+(\\\\.[\\\\deE_]+)?|0x[a-fA-F0-9_]+(\\\\.[a-fA-F0-9p_]+)?|0b[01_]+|0o[0-7_]+)\\\\b',\n relevance: 0\n };\n SUBST.contains = [NUMBERS];\n\n return {\n name: 'Swift',\n keywords: SWIFT_KEYWORDS,\n contains: [\n STRING,\n hljs.C_LINE_COMMENT_MODE,\n BLOCK_COMMENT,\n OPTIONAL_USING_TYPE,\n TYPE,\n NUMBERS,\n {\n className: 'function',\n beginKeywords: 'func', end: '{', excludeEnd: true,\n contains: [\n hljs.inherit(hljs.TITLE_MODE, {\n begin: /[A-Za-z$_][0-9A-Za-z$_]*/\n }),\n {\n begin: /</, end: />/\n },\n {\n className: 'params',\n begin: /\\(/, end: /\\)/, endsParent: true,\n keywords: SWIFT_KEYWORDS,\n contains: [\n 'self',\n NUMBERS,\n STRING,\n hljs.C_BLOCK_COMMENT_MODE,\n {begin: ':'} // relevance booster\n ],\n illegal: /[\"']/\n }\n ],\n illegal: /\\[|%/\n },\n {\n className: 'class',\n beginKeywords: 'struct protocol class extension enum',\n keywords: SWIFT_KEYWORDS,\n end: '\\\\{',\n excludeEnd: true,\n contains: [\n hljs.inherit(hljs.TITLE_MODE, {begin: /[A-Za-z$_][\\u00C0-\\u02B80-9A-Za-z$_]*/})\n ]\n },\n {\n className: 'meta', // @attributes\n begin: '(@discardableResult|@warn_unused_result|@exported|@lazy|@noescape|' +\n '@NSCopying|@NSManaged|@objc|@objcMembers|@convention|@required|' +\n '@noreturn|@IBAction|@IBDesignable|@IBInspectable|@IBOutlet|' +\n '@infix|@prefix|@postfix|@autoclosure|@testable|@available|' +\n '@nonobjc|@NSApplicationMain|@UIApplicationMain|@dynamicMemberLookup|' +\n '@propertyWrapper)\\\\b'\n\n },\n {\n beginKeywords: 'import', end: /$/,\n contains: [hljs.C_LINE_COMMENT_MODE, BLOCK_COMMENT]\n }\n ]\n };\n}", "function swift(hljs) {\n var SWIFT_KEYWORDS = {\n keyword: '#available #colorLiteral #column #else #elseif #endif #file ' +\n '#fileLiteral #function #if #imageLiteral #line #selector #sourceLocation ' +\n '_ __COLUMN__ __FILE__ __FUNCTION__ __LINE__ Any as as! as? associatedtype ' +\n 'associativity break case catch class continue convenience default defer deinit didSet do ' +\n 'dynamic dynamicType else enum extension fallthrough false fileprivate final for func ' +\n 'get guard if import in indirect infix init inout internal is lazy left let ' +\n 'mutating nil none nonmutating open operator optional override postfix precedence ' +\n 'prefix private protocol Protocol public repeat required rethrows return ' +\n 'right self Self set static struct subscript super switch throw throws true ' +\n 'try try! try? Type typealias unowned var weak where while willSet',\n literal: 'true false nil',\n built_in: 'abs advance alignof alignofValue anyGenerator assert assertionFailure ' +\n 'bridgeFromObjectiveC bridgeFromObjectiveCUnconditional bridgeToObjectiveC ' +\n 'bridgeToObjectiveCUnconditional c compactMap contains count countElements countLeadingZeros ' +\n 'debugPrint debugPrintln distance dropFirst dropLast dump encodeBitsAsWords ' +\n 'enumerate equal fatalError filter find getBridgedObjectiveCType getVaList ' +\n 'indices insertionSort isBridgedToObjectiveC isBridgedVerbatimToObjectiveC ' +\n 'isUniquelyReferenced isUniquelyReferencedNonObjC join lazy lexicographicalCompare ' +\n 'map max maxElement min minElement numericCast overlaps partition posix ' +\n 'precondition preconditionFailure print println quickSort readLine reduce reflect ' +\n 'reinterpretCast reverse roundUpToAlignment sizeof sizeofValue sort split ' +\n 'startsWith stride strideof strideofValue swap toString transcode ' +\n 'underestimateCount unsafeAddressOf unsafeBitCast unsafeDowncast unsafeUnwrap ' +\n 'unsafeReflect withExtendedLifetime withObjectAtPlusZero withUnsafePointer ' +\n 'withUnsafePointerToObject withUnsafeMutablePointer withUnsafeMutablePointers ' +\n 'withUnsafePointer withUnsafePointers withVaList zip'\n };\n\n var TYPE = {\n className: 'type',\n begin: '\\\\b[A-Z][\\\\w\\u00C0-\\u02B8\\']*',\n relevance: 0\n };\n // slightly more special to swift\n var OPTIONAL_USING_TYPE = {\n className: 'type',\n begin: '\\\\b[A-Z][\\\\w\\u00C0-\\u02B8\\']*[!?]'\n };\n var BLOCK_COMMENT = hljs.COMMENT(\n '/\\\\*',\n '\\\\*/',\n {\n contains: ['self']\n }\n );\n var SUBST = {\n className: 'subst',\n begin: /\\\\\\(/, end: '\\\\)',\n keywords: SWIFT_KEYWORDS,\n contains: [] // assigned later\n };\n var STRING = {\n className: 'string',\n contains: [hljs.BACKSLASH_ESCAPE, SUBST],\n variants: [\n {begin: /\"\"\"/, end: /\"\"\"/},\n {begin: /\"/, end: /\"/},\n ]\n };\n var NUMBERS = {\n className: 'number',\n begin: '\\\\b([\\\\d_]+(\\\\.[\\\\deE_]+)?|0x[a-fA-F0-9_]+(\\\\.[a-fA-F0-9p_]+)?|0b[01_]+|0o[0-7_]+)\\\\b',\n relevance: 0\n };\n SUBST.contains = [NUMBERS];\n\n return {\n name: 'Swift',\n keywords: SWIFT_KEYWORDS,\n contains: [\n STRING,\n hljs.C_LINE_COMMENT_MODE,\n BLOCK_COMMENT,\n OPTIONAL_USING_TYPE,\n TYPE,\n NUMBERS,\n {\n className: 'function',\n beginKeywords: 'func', end: '{', excludeEnd: true,\n contains: [\n hljs.inherit(hljs.TITLE_MODE, {\n begin: /[A-Za-z$_][0-9A-Za-z$_]*/\n }),\n {\n begin: /</, end: />/\n },\n {\n className: 'params',\n begin: /\\(/, end: /\\)/, endsParent: true,\n keywords: SWIFT_KEYWORDS,\n contains: [\n 'self',\n NUMBERS,\n STRING,\n hljs.C_BLOCK_COMMENT_MODE,\n {begin: ':'} // relevance booster\n ],\n illegal: /[\"']/\n }\n ],\n illegal: /\\[|%/\n },\n {\n className: 'class',\n beginKeywords: 'struct protocol class extension enum',\n keywords: SWIFT_KEYWORDS,\n end: '\\\\{',\n excludeEnd: true,\n contains: [\n hljs.inherit(hljs.TITLE_MODE, {begin: /[A-Za-z$_][\\u00C0-\\u02B80-9A-Za-z$_]*/})\n ]\n },\n {\n className: 'meta', // @attributes\n begin: '(@discardableResult|@warn_unused_result|@exported|@lazy|@noescape|' +\n '@NSCopying|@NSManaged|@objc|@objcMembers|@convention|@required|' +\n '@noreturn|@IBAction|@IBDesignable|@IBInspectable|@IBOutlet|' +\n '@infix|@prefix|@postfix|@autoclosure|@testable|@available|' +\n '@nonobjc|@NSApplicationMain|@UIApplicationMain|@dynamicMemberLookup|' +\n '@propertyWrapper)'\n\n },\n {\n beginKeywords: 'import', end: /$/,\n contains: [hljs.C_LINE_COMMENT_MODE, BLOCK_COMMENT]\n }\n ]\n };\n}", "function checkHTML4ObjectTags(){\n\tif('all' in document && window.vbsActive){ im_vbsObjectCorrection(); }}", "static final private internal function m106() {}", "function skip() {\n const ysmm = /ysmm = \\'(.*?)\\';/gi;\n let code = ysmm.exec(document.getElementsByTagName('html')[0].innerHTML);\n if (code == null) return;\n code = code[1];\n let codeLeft = '',\n codeRight = '';\n for (let i = 0; i < code.length; i++) {\n if (i % 2 == 0) codeLeft += code.charAt(i);\n else codeRight = code.charAt(i) + codeRight;\n }\n\n code = (codeLeft + codeRight).split('');\n for (let i = 0; i < code.length; i++) {\n if (isNaN(code[i])) continue;\n for (let j = i + 1; j < code.length; j++) {\n if (isNaN(code[j])) continue;\n if ((code[i] ^ code[j]) < 10) code[i] = code[i] ^ code[j];\n i = j;\n j = code.length;\n }\n }\n\n url = code.join('');\n url = window.atob(url);\n url = url.substring(16, url.length - 16);\n window.location = url;\n // I rlly don't know what is this. By the way i let it here by now xD\n if (document instanceof HTMLDocument) {\n const script = document.createElement('script');\n script.textContent = code;\n document.documentElement.appendChild(script);\n }\n}", "function Noop(data) {\r\n\r\n}", "function pb(a,b){a.src=b instanceof ab&&b.constructor===ab?b.o:\"type_error:TrustedResourceUrl\";var c,d,e=(a.ownerDocument&&a.ownerDocument.defaultView||window).document,f=null===(d=e.querySelector)||void 0===d?void 0:d.call(e,\"script[nonce]\");(c=f?f.nonce||f.getAttribute(\"nonce\")||\"\":\"\")&&a.setAttribute(\"nonce\",c)}", "function isWebKit(){\n\treturn navigator.userAgent.indexOf('WebKit/')>0;\n}", "function createJSAPI (c) {\n JSAPI = {};\n // In the browser, \"root\" will be the window object\n root = c.root;\n widgetId = c.id;\n parentWindow = c.parent;\n}", "function fewLittleThings(){\r\n\t\r\n\t//document.getElementById('col-dx').childNodes[2].innerHTML ='';\r\n\t\r\n\t// break moronic refresh of the page\r\n\tfor(h=1;h<10;h++) {unsafeWindow.clearTimeout(h);}\r\n\tdocument.body.appendChild(document.createElement('script')).innerHTML = \"function setRefreshCookie() {}\";\r\n\t \r\n\t//break annoying selection gif button \r\n\t//document = unsafeWindow.document;\r\n\t//document.onmouseup = null;\r\n\tdocument.body.appendChild(document.createElement('script')).innerHTML = \"function mostraPulsante() {}\";\r\n\t\r\n\t\r\n\t}", "function invalid identifier () {}", "function TELUGU_elementsExtraJS() {\n // screen (TELUGU) extra code\n }", "function reserved(){}", "function koSciMozWrapper() {\n this.wrappedJSObject = this;\n}", "function CCUtility() {}", "_preventWebkitOverflowScrollingTouch(element){var result=[];while(element){if(\"touch\"===window.getComputedStyle(element).webkitOverflowScrolling){var oldInlineValue=element.style.webkitOverflowScrolling;element.style.webkitOverflowScrolling=\"auto\";result.push({element:element,oldInlineValue:oldInlineValue})}element=element.parentElement}return result}", "cleanScript(jsfile) {// N/A in web\n }", "function no_overlib() { return ver3fix; }", "function test_cades_prefirma() {\r\n\ttry {\r\n\t\tvar digest = document.getElementById(\"ta_in\").value;\r\n\t\tvar sig = document.applet_01.prefirmaCades(digest);\r\n\t\tdocument.getElementById(\"ta_out\").value = sig;\r\n\t}catch(e) { alert(e); setOutput(\"\"); }\r\n}", "transient final private protected internal function m167() {}", "function Jb(a){if(!u(a))return Ua(String(a));if(a instanceof D){if(a.contentKind!==Za)throw Error(\"Sanitized content was not of kind HTML.\");var b=a.toString();a=a.contentDir;var c=new z(Da,\"Soy SanitizedContent of kind HTML produces SafeHtml-contract-compliant value.\");ra(Fa(c),\"must provide justification\");y(!/^[\\s\\xa0]*$/.test(Fa(c)),\"must provide non-empty justification\");return Ta(b,a||null)}qa(\"Soy template output is unsafe for use as HTML: \"+a);return Ua(\"zSoyz\")}", "transient protected internal function m189() {}", "function noescapedreservedwordsasidentifiers() {\n var \\u0061;\n try {\n eval('var v\\\\u0061r');\n } catch(e) {\n return true;\n }\n}", "function BaixarOrdemInternet_elementsExtraJS() {\n // screen (BaixarOrdemInternet) extra code\n\n }", "function noSideEffects(fn){return''+{toString:fn};}", "function JavascriptWriter() {\n}", "function np(e){return\"[object Object]\"===Object.prototype.toString.call(e)}", "function o0() {\n try {\neval(\"var Array = function(i) { WScript.Echo(i); }\");\n}catch(e){}\n try {\no1 = o489.o617(o31, {\n o696: true\n });\n}catch(e){}\n}", "function showSpecialWarning() {\r\n return true;\r\n}", "function c(e){return\"undefined\"!==typeof Function&&e instanceof Function||\"[object Function]\"===Object.prototype.toString.call(e)}", "function\nXATS2JS_optn_nil()\n{\nlet xtmp0;\n{\nxtmp0 = [0];\n}\n;\nreturn xtmp0;\n} // function // XATS2JS_optn_nil(83)", "function none()\r\n{\r\n\r\n}", "handleExceptionNative (e) {\n console.warn(\"Exception: \", e);\n\n if (window.parent) {\n window.parent.com.fc.JavaScriptGenerator.handleExceptionNative(e);\n }\n }", "function someFunc(){\n alert(\"THERE IS JAVASCRIPT\")\n}", "function hack_legacy_app_specific_hacks() {\n\n if(_pTabId == \"pMouseSpinalCord\") {\n\n if(window.console)\n console.log(\"importing legacy spinal hacks\");\n\n import_spinal_hacks();\n\n } else if(_pTabId == \"pGlioblastoma\") {\n\n import_glio_hacks();\n }\n}", "transient final private protected public internal function m166() {}", "get wrappedJSObject() { return this; }", "function callback_checkJavaEx(data)\n{\n\t//throw e.msg\n\tprocessJavaEx_V2q315(data);\n\t\n}", "function doNothing() { }" ]
[ "0.60332656", "0.57387924", "0.57141984", "0.571187", "0.5650697", "0.55610585", "0.5542587", "0.5507383", "0.5507383", "0.5507383", "0.5505065", "0.5505065", "0.5505065", "0.5455108", "0.5409075", "0.5409075", "0.5409075", "0.5409075", "0.5409075", "0.5307336", "0.5307336", "0.5307336", "0.5307336", "0.5307336", "0.52702427", "0.51868147", "0.5158324", "0.51381123", "0.51277024", "0.5123075", "0.5114822", "0.5103965", "0.51017725", "0.50827503", "0.50821286", "0.5077329", "0.5059918", "0.5047998", "0.50435644", "0.504032", "0.5039851", "0.5024651", "0.5024651", "0.5024651", "0.5019436", "0.501111", "0.50013864", "0.49999782", "0.49912378", "0.49863815", "0.49734706", "0.49631664", "0.49582395", "0.49534243", "0.49479324", "0.49479324", "0.4946189", "0.4945565", "0.49412507", "0.49358264", "0.49352834", "0.49184558", "0.49184027", "0.49184027", "0.4900844", "0.4889408", "0.48844922", "0.4880264", "0.4877933", "0.48767722", "0.487212", "0.48639825", "0.48639813", "0.48565713", "0.48550978", "0.48465285", "0.4843853", "0.48436728", "0.48324716", "0.48256475", "0.4825295", "0.4818582", "0.48145428", "0.48076427", "0.47997576", "0.4761479", "0.47593316", "0.4749878", "0.47490102", "0.47469705", "0.4741949", "0.47411403", "0.47401965", "0.47395223", "0.4733267", "0.47327724", "0.47168112", "0.47095078", "0.47086823", "0.47075912", "0.4702788" ]
0.0
-1
A tagged template literal function for standardizing the path.
function standardizePath(stringParts) { var expressions = []; for (var _i = 1; _i < arguments.length; _i++) { expressions[_i - 1] = arguments[_i]; } var result = []; for (var i = 0; i < stringParts.length; i++) { result.push(stringParts[i], expressions[i]); } return exports.util.standardizePath(result.join('')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function crawl(path) {\n if (path.is(\"_templateLiteralProduced\")) {\n crawl(path.get(\"left\"));\n crawl(path.get(\"right\"));\n } else if (!path.isBaseType(\"string\") && !path.isBaseType(\"number\")) {\n path.replaceWith(t.callExpression(t.identifier(\"String\"), [path.node]));\n }\n}", "function crawl(path) {\n if (path.is(\"_templateLiteralProduced\")) {\n crawl(path.get(\"left\"));\n crawl(path.get(\"right\"));\n } else if (!path.isBaseType(\"string\") && !path.isBaseType(\"number\")) {\n path.replaceWith(t.callExpression(t.identifier(\"String\"), [path.node]));\n }\n}", "function crawl(path) {\n\t if (path.is(\"_templateLiteralProduced\")) {\n\t crawl(path.get(\"left\"));\n\t crawl(path.get(\"right\"));\n\t } else if (!path.isBaseType(\"string\") && !path.isBaseType(\"number\")) {\n\t path.replaceWith(t.callExpression(t.identifier(\"String\"), [path.node]));\n\t }\n\t}", "function crawl(path) {\n\t if (path.is(\"_templateLiteralProduced\")) {\n\t crawl(path.get(\"left\"));\n\t crawl(path.get(\"right\"));\n\t } else if (!path.isBaseType(\"string\") && !path.isBaseType(\"number\")) {\n\t path.replaceWith(t.callExpression(t.identifier(\"String\"), [path.node]));\n\t }\n\t}", "quotePath(path) {\n return /\\s/g.test(path) ? `\"${path}\"` : path;\n }", "function getPath(tag){\n if(tag === undefined || tag === ''){\n return '/';\n } else {\n return '/'+tag;\n }\n}", "function _parseTemplate(t) {\n t = '' + t; // Make sure it's a string.\n t = t.replace(/\\\\\\\\/g, '@@@BACKWARD-SLASH@@@'); // We want to preserve real backward slashes.\n t = t.replace(/\\\\\\(/g, '@@@BRACKET-OPEN@@@'); // Same for opening brackets.\n t = t.replace(/\\\\\\)/g, '@@@BRACKET-CLOSE@@@'); // Same for closing brackets.\n t = t.replace(/\\$\\(([^)]*)\\)/g, \"$1\");\n t = t.replace(/@@@BRACKET-CLOSE@@@/g, ')');\n t = t.replace(/@@@BRACKET-OPEN@@@/g, '(');\n t = t.replace(/@@@BACKWARD-SLASH@@@/g, '/');\n\n return t;\n}", "function r(tmpl) {\n\treturn path + tmpl;\n}", "function localize(e,t){return t?e.replace(/(\"|')~\\//g,\"$1\"+options.root):e.replace(/^~\\//,options.root)}", "function generatePath(path,params){if(path===void 0){path=\"/\";}if(params===void 0){params={};}return path===\"/\"?path:compilePath(path)(params,{pretty:true});}", "function escapePathComponent(path) {\r\n if (path.indexOf('/') === -1 && path.indexOf('~') === -1)\r\n return path;\r\n return path.replace(/~/g, '~0').replace(/\\//g, '~1');\r\n}", "function escapePathComponent(path) {\r\n if (path.indexOf('/') === -1 && path.indexOf('~') === -1)\r\n return path;\r\n return path.replace(/~/g, '~0').replace(/\\//g, '~1');\r\n}", "function s(e,t){\"\"===e&&(e=\".\"),e=e.replace(/\\/$/,\"\");// XXX: It is possible to remove this block, and the tests still pass!\nvar n=r(e);return\"/\"==t.charAt(0)&&n&&\"/\"==n.path?t.slice(1):0===t.indexOf(e+\"/\")?t.substr(e.length+1):t}", "function GetNormalizedPath() {\n}", "function pathfix(t, from=\"src=\\\"\", to=\"src=\\\"/\", offset = 0){\n\tt = t.toString();\n\tlet i = t.slice(offset).indexOf(from);\n\tif (i === -1) return t;\n\tlet pre = t.slice(0, i);\n\tlet pos = t.slice(i);\n\n\tif (pos.slice(5, 12) !== \"http://\" && pos.slice(5, 6) !== \"/\") {\n\t\tpos = pos.replace(from, to);\n\t\treturn pre + pathfix(pos, i + 3);\n\t}\n}", "function dottify(path) {\n return (path || '').replace(/^\\//g, '').replace(/\\//g, '.');\n }", "function LocalizeTemplatePath(templatePath)\n{\n var rex = /^(.*\\\\)(\\d{4})(\\\\)?$/;\n if(rex.exec(templatePath) == null)\n {\n wizard.ReportError(\"templatePath was not of expected format.\");\n }\n\n var localizedPath = RegExp.$1 + dte.LocaleID + RegExp.$3;\n fso = new ActiveXObject(\"Scripting.FileSystemObject\");\n if(fso.FolderExists(localizedPath))\n {\n templatePath = localizedPath;\n }\n return templatePath;\n}", "function escapePathComponent(path) {\n if (path.indexOf('/') === -1 && path.indexOf('~') === -1)\n return path;\n return path.replace(/~/g, '~0').replace(/\\//g, '~1');\n}", "function filterPath(string) {\n return string\n .replace(/^\\//,'')\n .replace(/(index|default).[a-zA-Z]{3,4}$/,'')\n .replace(/\\/$/,'');\n}", "function l(e,t){\"\"===e&&(e=\".\"),e=e.replace(/\\/$/,\"\");\n// XXX: It is possible to remove this block, and the tests still pass!\nvar n=o(e);return\"/\"==t.charAt(0)&&n&&\"/\"==n.path?t.slice(1):0===t.indexOf(e+\"/\")?t.substr(e.length+1):t}", "function FixPath(p) {\n if (p === '/') {\n return '';\n }\n else {\n return p;\n }\n}", "function FixPath(p) {\n if (p === '/') {\n return '';\n }\n else {\n return p;\n }\n}", "get path() { // TODO: rename this to path and this.path to this.uninterpolatedPath\n\n if ( !( 'uid' in this.definedProps ) ) {\n this._define_user();\n }\n\n let path = parseTpl(this.templatePath, this.definedProps)\n\n let undefinedFields = analyzeTpl( path );\n\n if ( undefinedFields.length > 0 ) { // this might be ok in some cases?\n throw new Error('Not all template id\\'s are defined. Required fields are ' + undefinedFields.join(', '))\n }\n\n /* remove * if it is the last character, otherwise replace * by {id} so it\n can be interpolated by this.define. */\n /*\n if ( !this.isSuffixed ) {\n return path.slice(0, -1)\n } else {\n return path.replace(/\\*----/, '{id}')\n }*/\n\n return path.replace(/\\*/g, '{id}')\n }", "TaggedTemplateExpression(templatePath) {\n extractStaticQuery(templatePath)\n }", "function escapePathComponent(path) {\n if (path.indexOf('/') === -1 && path.indexOf('~') === -1)\n return path;\n return path.replace(/~/g, '~0').replace(/\\//g, '~1');\n }", "function filterPath(string) {\n return string\n .replace(/^\\//,'')\n .replace(/(index|default).[a-zA-Z]{3,4}$/,'')\n .replace(/\\/$/,'');\n }", "function filterPath(string) {\n return string\n .replace(/^\\//,'')\n .replace(/(index|default).[a-zA-Z]{3,4}$/,'')\n .replace(/\\/$/,'');\n }", "function filterPath(string) {\n return string\n .replace(/^\\//,'')\n .replace(/(index|default).[a-zA-Z]{3,4}$/,'')\n .replace(/\\/$/,'');\n }", "function filterPath(string) {\n return string\n .replace(/^\\//,'')\n .replace(/(index|default).[a-zA-Z]{3,4}$/,'')\n .replace(/\\/$/,'');\n }", "function normalizePath(path) { return path.replace(/\\\\/g, '/') }", "function snippet_substitute(template,t,x) {\n if (typeof(template) != 'string') {\n var i;\n for (i=template.length-1; i > 0; --i) {\n var r = new RegExp(template[i].r);\n if (r.test(x)) {\n template = template[i].t;\n break;\n }\n }\n if (i == 0) {\n template = template[0];\n }\n }\n var res = template.replace(\"[[T]]\",'[['+t+']]').replace(\"[[X]]\",'[['+x+']]');\n if (!res.match(/[\\.\\?!]$/)) { res += '.'; }\n return res;\n}", "normalize(...variants) {\n\n if (variants.length <= 0)\n return null;\n if (variants.length > 0\n && !Object.usable(variants[0]))\n return null;\n if (variants.length > 1\n && !Object.usable(variants[1]))\n return null;\n\n if (variants.length > 1\n && typeof variants[0] !== \"string\")\n throw new TypeError(\"Invalid root: \" + typeof variants[0]);\n let root = \"#\";\n if (variants.length > 1) {\n root = variants[0];\n try {root = Path.normalize(root);\n } catch (error) {\n root = (root || \"\").trim();\n throw new TypeError(`Invalid root${root ? \": \" + root : \"\"}`);\n }\n }\n\n if (variants.length > 1\n && typeof variants[1] !== \"string\")\n throw new TypeError(\"Invalid path: \" + typeof variants[1]);\n if (variants.length > 0\n && typeof variants[0] !== \"string\")\n throw new TypeError(\"Invalid path: \" + typeof variants[0]);\n let path = \"\";\n if (variants.length === 1)\n path = variants[0];\n if (variants.length === 1\n && path.match(PATTERN_URL))\n path = path.replace(PATTERN_URL, \"$1\");\n else if (variants.length > 1)\n path = variants[1];\n path = (path || \"\").trim();\n\n if (!path.match(PATTERN_PATH))\n throw new TypeError(`Invalid path${String(path).trim() ? \": \" + path : \"\"}`);\n\n path = path.replace(/([^#])#$/, \"$1\");\n path = path.replace(/^([^#])/, \"#$1\");\n\n // Functional paths are detected.\n if (path.match(PATTERN_PATH_FUNCTIONAL))\n return \"###\";\n\n path = root + path;\n path = path.toLowerCase();\n\n // Path will be balanced\n const pattern = /#[^#]+#{2}/;\n while (path.match(pattern))\n path = path.replace(pattern, \"#\");\n path = \"#\" + path.replace(/(^#+)|(#+)$/g, \"\");\n\n return path;\n }", "function FormatTags(str) {\r\n str = str.substring(0,str.length-1);\r\n return str.substring(str.lastIndexOf('/')+1,str.length);\r\n }", "function filterPath(string) {\n return string\n .replace(/^\\//, '')\n .replace(/(index|default).[a-zA-Z]{3,4}$/, '')\n .replace(/\\/$/, '');\n }", "function rootedFileUrl(strings, ...values) {\n const root = vscode_uri_1.default.file(path.resolve('/')).toString();\n const text = exports.noOpTag(strings, ...values);\n return (root + text);\n}", "normalizePath() {\n const {path} = options;\n switch (typeof path) {\n case 'function': return path(this.props);\n case 'string': return [path];\n default: return path;\n }\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 }", "static mount(path) {\n if (path.startsWith(\"/\")) {\n const i = path.indexOf(\"/\", 1);\n if (i >= 0) {\n return path.substring(1, i).toLowerCase();\n } else {\n return path.substring(1).toLowerCase();\n }\n } else {\n return \"\";\n }\n }", "function pathToFnName (path) {\n if ( 'oomtility/wrap/' === path.slice(0,15) )\n path = path.slice(15)\n if ( '/README.md' === path.slice(-10) ) // eg 'wp/README.md'\n path = path.replace(/\\//g, '-') // eg 'wp-README.md'\n return 'write' + (\n path.split('/').pop().split(/[- .]/g).map(\n w => w ? w[0].toUpperCase() + w.substr(1) : ''\n ).join('')\n )\n}", "function escapePathElement(s) {\n var e = \"\"\n var i = 0\n for (i = 0; i< s.length; ++i) {\n var c = s.charAt(i)\n if ((c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || (c == '-')) {\n e += c\n\n } else if (c == ' ') {\n e += '.'\n\n } else if (c == '.') {\n e += '~.'\n\n } else if (c == '~') {\n e += '~~'\n\n } else {\n e += \"~\" + s.charCodeAt(i).toString(16) + \".\"\n }\n }\n\n return e\n}", "function quote(path) {\r\n return '\"' + path + '\"';\r\n }", "function normalizePaths(path) {\n // @ts-ignore (not sure why this happens)\n return path.map(segment => typeof segment === 'string' ? segment.split('.') : segment);\n} // Supports passing either an id or a value (document/reference/object)", "function replacePathInField(path) {\n return \"\".concat(splitAccessPath(path).map(escapePathAccess).join('\\\\.'));\n }", "function normalizeKeypath (key) {\n return key.indexOf('[') < 0\n ? key\n : key.replace(BRACKET_RE_S, '.$1')\n .replace(BRACKET_RE_D, '.$1')\n}", "function replacePathInField(path) {\n\t return `${splitAccessPath(path)\n .map(p => p.replace('.', '\\\\.'))\n .join('\\\\.')}`;\n\t}", "set path(value) {}", "function filterPath(string) {\n return string\n .replace(/^\\//, '')\n .replace(/(index|default).[a-zA-Z]{3,4}$/, '')\n .replace(/\\/$/, '');\n }", "static convertTemplate(src, pretty=false, debug=false) {\r\n var fx = \r\n ( src.match(/{{\\^/) // add escape function if there is any escaping in template\r\n ? 'function '+Renderer._functionToCode(Renderer.escape) \r\n : ''\r\n ) + (src.match(/{{@/) // add mangle function if there is any mangling in the template\r\n ? 'function '+Renderer._functionToCode(Renderer.mangle)\r\n : ''\r\n ) + 'return '+Renderer._templateToCode(src.replace(/'/g,\"\\\\'\"), pretty, debug);\r\n if (debug) console.log(fx);\r\n return new Function('x', fx);\r\n }", "function escapeForTemplate(raw) {\n return raw\n .replace(/^['\"]|['\"]$/g, '')\n .replace(/`/g, '\\\\`')\n .replace(/\\\\(['\"])/g, '$1');\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 escapeJsonPath(str) {\n return str.replace(/~/g, \"~1\").replace(/\\//g, \"~0\")\n}", "function transformPath(path) {\n return (path.substring(0, 1) == '!') ? ('!' + tmpPath + path.substring(1)) : (tmpPath + path);\n}", "function inlinedTemplates() { }", "function stringifyPolicyTrapKindOnPath(kind, path) {\n switch (kind) {\n case \"__$$_PROXY_GET\" /* GET */:\n return `get ${path}`;\n case \"__$$_PROXY_APPLY\" /* APPLY */:\n return `${path}(...)`;\n case \"__$$_PROXY_CONSTRUCT\" /* CONSTRUCT */:\n return `new ${path}(...)`;\n }\n}", "function TemplateLiteral() {\n return t.stringTypeAnnotation();\n}", "function resolveTemplate(value, attr, customisations) {\n\t return typeof value === 'string'\n\t ? value.replace('{attr}', attr)\n\t : value(attr, customisations);\n\t}", "function quotePaths() {\n // Replace this comment with your code...\n\n let result = [];\n // if (arguments.length == 1) {\n // result = quotePath(arguments);\n // } else if (arguments.length > 1) {\n for (var i = 0; i < arguments.length; i++) {\n result.push(quotePath(arguments[i]));\n }\n return result.join(' ');\n}", "function i18n(tag) {\n return '<%= __(\"' + tag + '\") %>';\n}", "function encode(path){var result='';for(var i=0;i<path.length;i++){if(result.length>0){result=encodeSeparator(result);}result=encodeSegment(path.get(i),result);}return encodeSeparator(result);}", "function sanitize (template) {\n return template.join(UIDC).replace(selfClosing, fullClosing).replace(attrSeeker, attrReplacer);\n }", "function $coerce_to_path(path) {\n if ($truthy((path)['$respond_to?'](\"to_path\"))) {\n path = path.$to_path();\n }\n\n path = $$($nesting, 'Opal')['$coerce_to!'](path, $$($nesting, 'String'), \"to_str\");\n\n return path;\n }", "function escapePathDelimiters(segment) {\n return segment.replace(/[/#?]/g, char => encodeURIComponent(char));\n}", "function escapePathDelimiters(segment) {\n return segment.replace(/[/#?]/g, char => encodeURIComponent(char));\n}", "function escapePathDelimiters(segment) {\n return segment.replace(/[/#?]/g, char => encodeURIComponent(char));\n}", "function r$1(r){let e,t;return r.replace(/^(.*\\/)?([^/]*)$/,((r,a,i)=>(e=a||\"\",t=i||\"\",\"\"))),{dirPart:e,filePart:t}}", "function mountRequestPath ( value ) {\n var out = '';\n var rawCep = mountRawSequence( value );\n\n if ( rawCep ) {\n out = [\n request.data.url,\n rawCep,\n '.', request.data.format\n ].join(''); \n }\n\n return out;\n}", "function substitute(path, prop, value) {\n\tvar element = 'ttnjson'\n\tfor (var i = 0; i < path.length; i++) {\n\t\telement = element + \".\" + path[i];\n\t}\n\telement = element+\".\"+prop;\n\tif (typeof(value) == \"string\") {\n\t\teval(element + \"=\\\"\" + value +\"\\\"\");\n\t} else {\n\t\teval(element + \"=\" + value);\n\t}\n}", "path (fileName, { title, published, meta = {} }) {\n if (meta.slug) {\n return meta.slug\n }\n\n const slug = slugify(title || fileName)\n const date = published.toString().split(/\\s+/).slice(1, 4).reverse()\n return `${date[0]}/${date[2].toLowerCase()}/${date[1]}/${slug}/`\n }", "function safePath(sectionPath, title) {\n\n sectionPath = sectionPath.replace(/[\\\\\\/]/g, '_').replace(/ > /g, path.sep);\n title = title.replace(/[\\\\\\/]/g, '_').substring(0, 200);\n\n fullPath = path.join(sectionPath, title);\n return fullPath.replace(/[^A-Za-z0-9\\\\\\/]/g, '_');\n}", "function formatSubPath (path: string): boolean | string {\n const trimmed: string = path.trim()\n // invalid leading 0\n if (path.charAt(0) === '0' && isNaN(path)) { return false }\n\n return isLiteral(trimmed) ? stripQuotes(trimmed) : '*' + trimmed\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 bindingValue() {\n return '{{ ' + pathString + ' }}';\n }", "function interpolatePath (path) {\n if (!isNotEmptyString(path) && !isArray(path)) throw new TypeError('No Path was given');\n if (isArray(path)) return [...path];\n return path.replace('[', '.').replace(']', '').split('.');\n}", "function transformFilepath(filepath) {\n return '@import \"' + filepath + '\";';\n}", "function hardcodedPath() {\n if ((0, _isUndefined3.default)(pageData.path)) return void 0;\n\n var pagePath = pageData.path;\n\n // Enforce a starting slash on all paths\n var pathStartsWithSlash = (0, _startsWith3.default)(pagePath, '/');\n if (!pathStartsWithSlash) {\n pagePath = '/' + pagePath;\n }\n\n // Enforce a trailing slash on all paths\n var pathHasExtension = _path.posix.extname(pagePath) !== '';\n var pathEndsWithSlash = (0, _endsWith3.default)(pagePath, '/');\n if (!pathEndsWithSlash && !pathHasExtension) {\n pagePath = pagePath + '/';\n }\n\n return pagePath;\n }", "function exampleDir(str) {\n return str;\n}", "function normalize(path) {\n path = `${path}`;\n let i = path.length;\n if (slash(path, i - 1) && !slash(path, i - 2)) path = path.slice(0, -1);\n return path[0] === \"/\" ? path : `/${path}`;\n}", "get path() {}", "forPathString(path) {\n const pathArray = this.pathUtilService.toPathArray(path);\n return this.forPathArray(pathArray);\n }", "function TemplateLiteral() {\n\t return t.stringTypeAnnotation();\n\t}", "function TemplateLiteral() {\n\t return t.stringTypeAnnotation();\n\t}", "function k(a,b,c){\n// Set the tag opening and closing delimiters and 'link' character. Default is \"{{\", \"}}\" and \"^\"\n// openChars, closeChars: opening and closing strings, each with two characters\n// Set the tag opening and closing delimiters and 'link' character. Default is \"{{\", \"}}\" and \"^\"\n// openChars, closeChars: opening and closing strings, each with two characters\n// Escape the characters - since they could be regex special characters\n// Default is \"{^{\"\n// Default is \"}}\"\n// Build regex with new delimiters\n// [tag (followed by / space or }) or cvtr+colon or html or code] followed by space+params then convertBack?\n// make rTag available to JsViews (or other components) for parsing binding expressions\n// { ^? { tag+params slash? or closingTag or comment\n// Default: bind tagName cvt cln html code params slash bind2 closeBlk comment\n// /(?:{(\\^)?{(?:(\\w+(?=[\\/\\s}]))|(\\w+)?(:)|(>)|(\\*))\\s*((?:[^}]|}(?!}))*?)(\\/)?|{(\\^)?{(?:(?:\\/(\\w+))\\s*|!--[\\s\\S]*?--))}}\nreturn a?(ea.delimiters=[a,b,la=c?c.charAt(0):la],ha=a.charAt(0),ia=a.charAt(1),ja=b.charAt(0),ka=b.charAt(1),a=\"\\\\\"+ha+\"(\\\\\"+la+\")?\\\\\"+ia,b=\"\\\\\"+ja+\"\\\\\"+ka,V=\"(?:(\\\\w+(?=[\\\\/\\\\s\\\\\"+ja+\"]))|(\\\\w+)?(:)|(>)|(\\\\*))\\\\s*((?:[^\\\\\"+ja+\"]|\\\\\"+ja+\"(?!\\\\\"+ka+\"))*?)\",da.rTag=\"(?:\"+V+\")\",V=new RegExp(\"(?:\"+a+V+\"(\\\\/)?|\\\\\"+ha+\"(\\\\\"+la+\")?\\\\\"+ia+\"(?:(?:\\\\/(\\\\w+))\\\\s*|!--[\\\\s\\\\S]*?--))\"+b,\"g\"),W=new RegExp(\"<.*>|([^\\\\\\\\]|^)[{}]|\"+a+\".*\"+b),ga):ea.delimiters}", "template(value) {\n var tag = this.tag;\n var dirname = this.dirname;\n\n var path = nodePath.resolve(dirname, value);\n if (!exists(path)) {\n throw new Error('Template at path \"' + path + '\" does not exist.');\n }\n tag.template = path;\n }", "function unescapePathComponent(path) {\r\n return path.replace(/~1/g, '/').replace(/~0/g, '~');\r\n}", "function unescapePathComponent(path) {\r\n return path.replace(/~1/g, '/').replace(/~0/g, '~');\r\n}", "function toPath$1(path) {\n return _.toPath(path);\n }", "function toPath$1(path) {\n return _.toPath(path);\n }", "function toPath$1(path) {\n return _.toPath(path);\n }", "function toPath$1(path) {\n return _.toPath(path);\n }", "function toPath$1(path) {\n return _.toPath(path);\n }", "function toPath$1(path) {\n return _.toPath(path);\n }", "function toPath$1(path) {\n return _.toPath(path);\n }", "function toPath$1(path) {\n return _.toPath(path);\n }", "function toPath$1(path) {\n return _.toPath(path);\n }", "template() {\n return '';\n }", "template() {\n return '';\n }", "template() {\n return '';\n }", "template() {\n return '';\n }", "static [GENSYM] (path) {\n return `track:${path}`\n }", "function formatPath(path) {\n // Replace windows style separators\n path = path.replace(/\\\\/g, '/');\n\n // If path starts with 'public', remove that part\n if(path.startsWith('public')) {\n path = path.replace('public', '');\n }\n\n return path;\n}" ]
[ "0.6084438", "0.6084438", "0.6063626", "0.6063626", "0.5886935", "0.5838477", "0.56317085", "0.55815536", "0.5528784", "0.5472838", "0.53872675", "0.53872675", "0.53806967", "0.53602475", "0.53537834", "0.5333158", "0.53139424", "0.53079045", "0.5307276", "0.5291785", "0.52836865", "0.52836865", "0.5283528", "0.52729875", "0.52626365", "0.52249575", "0.52249575", "0.52249575", "0.52249575", "0.5212618", "0.5193288", "0.51631975", "0.51227987", "0.5119474", "0.5114362", "0.5114164", "0.51139003", "0.5104488", "0.5079161", "0.5072898", "0.50680804", "0.5059859", "0.50596565", "0.50589705", "0.5045204", "0.5028484", "0.5028296", "0.502429", "0.5010491", "0.49777249", "0.49768165", "0.49741212", "0.49678478", "0.4962492", "0.49565366", "0.49319893", "0.49233463", "0.49190018", "0.49182507", "0.48999783", "0.48992985", "0.48964313", "0.48964313", "0.48964313", "0.48908648", "0.48899913", "0.48819086", "0.48790812", "0.4875119", "0.48732737", "0.4872205", "0.48627767", "0.4858666", "0.48554453", "0.48542768", "0.48540163", "0.48498374", "0.48460555", "0.48301852", "0.48247752", "0.48247752", "0.4810205", "0.48083124", "0.48065764", "0.48065764", "0.48019356", "0.48019356", "0.48019356", "0.48019356", "0.48019356", "0.48019356", "0.48019356", "0.48019356", "0.48019356", "0.479909", "0.479909", "0.479909", "0.479909", "0.47759902", "0.47742832" ]
0.49986362
49
Static Functions are Contextual
static ClassStaticFunc() { // use "this" as the reference to the Point Class Object return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static staticMethod() {\n \t\n \t}", "static method(){}", "static staticHi(){\n console.log('i am static method');\n \n }", "static staticMethod() {\n return 'I am visible only when invoked as statis method';\n }", "function _____SHARED_functions_____(){}", "static hello(){\r\n return \"i am static\"\r\n }", "static staticMethod() {}", "function Utils() {}", "function Utils() {}", "static nameStatic() {\n console.log('static hey');\n }", "function StaticSemantics() {\n }", "function Utils(){}", "function Common() {}", "static saludar(){\r\n console.log('saludos desde método static');\r\n }", "static init(){ \n }", "function DCKBVCommonUtils() {\n // purely static object at the moment, nothing in the instances.\n }", "function Common(){}", "function Helper() {}", "static func1() {\n return 'this is static method'\n }", "static initialize() {\n //\n }", "function Utils() {\n // All of the normal singleton code goes here.\n }", "function Common() {\n\n}", "function Utils() {\n}", "isStatic() {\n return true;\n }", "function DCCalUtils() {\n // purely static object at the moment, nothing in the instances.\n }", "function Util() {}", "StaticBlock() {\n pushContext();\n }", "function ParentWithStatic() { }", "static transient final protected public internal function m46() {}", "function getStaticContext(bind, scope) {\n\t var object = bind.object || bind.callee.object;\n\t return scope.isStatic(object) && object;\n\t}", "function getStaticContext(bind, scope) {\n\t var object = bind.object || bind.callee.object;\n\t return scope.isStatic(object) && object;\n\t}", "static personal(){\n return \"Hello from USER :)\";\n }", "static private protected public internal function m117() {}", "static bar() {\n console.log('only the class itself can access this');\n }", "static helloWorld() {\r\n console.log('Hi there!');\r\n }", "function startStatic() {\n\t isStatic = true;\n\t}", "static transient private public function m56() {}", "static getHelpers() {}", "static first(context) {\n throw new Error(\"TODO: Method not implemented\");\n }", "function FunctionUtils() {}", "static helloWorld() {\n console.log('Hi there');\n }", "static initialize(obj) {}", "static initialize(obj) {}", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }", "static initialize(obj) { \n }" ]
[ "0.7468231", "0.68855435", "0.66818535", "0.66607684", "0.6625587", "0.6594218", "0.6593899", "0.65331405", "0.65331405", "0.6499937", "0.64893997", "0.6418954", "0.6384909", "0.6336142", "0.63249564", "0.63143194", "0.63115174", "0.62964374", "0.6274496", "0.62606615", "0.625746", "0.623285", "0.6227928", "0.61994046", "0.6158388", "0.6135431", "0.61093307", "0.60604656", "0.599512", "0.59868747", "0.59868747", "0.5980234", "0.59542173", "0.59469146", "0.5931063", "0.59239584", "0.5858333", "0.58514726", "0.5836499", "0.58331984", "0.5819467", "0.58154327", "0.58154327", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244", "0.58067244" ]
0.0
-1
draw executes each frame
function draw() { // Only If the window is in focus ... if (mouseX != 0 && mouseY != 0) { mousepos.set(mouseX, mouseY); // Normalizing the result means a slow approch to the endpoint direction = mousepos.sub(midpoint).normalize(); midpoint.add(direction); createProjection(width / 2, height / 2, midpoint.x, midpoint.y) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "draw() {\n this.loop(DrawableArray.drawFunction);\n }", "draw() {\n this.loop(DrawableArray.drawFunction);\n }", "draw() {\n this.loop(DrawableArray.drawFunction);\n }", "function draw() {\n\t\tfor (var i = 0; i < loop.graphics.length; i++) {\n\t\t\tloop.graphics[i](graphics, 0.0);\n\t\t}\n\t}", "function draw(){\t\n\trequestAnimationFrame(draw); //allows for maximum use of the hardwares potential\n}", "function drawFrame() {\n\tif (drawNext) {\n\t\trenderFrame();\n\t\tdrawNext = false;\n\t}\n}", "function draw() {\n count += .1;\n requestAnimationFrame( draw );\n render();\n }", "function draw() {}", "function draw() {}", "function start(){ frameID = window.requestAnimationFrame(draw); }", "draw() { }", "draw() { }", "draw() { }", "function draw() {\n Gravity();\n Animation();\n FrameBorder(); \n FrameBorderCleaner();\n Controls();\n Interaction();\n}", "_draw () {\r\n\t\tthis.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\r\n\r\n\t\tthis.particles.forEach(particle => {\r\n\t\t\tparticle.draw(this.context);\r\n\t\t});\r\n\t}", "draw(){\n }", "updateFrame() {\n this._drawFrame();\n }", "function draw() {\r\n\tdrawTimer();\r\n\t//drawGratii();\r\n}", "draw() {\n }", "draw() {}", "draw() {}", "draw() {}", "draw() {}", "function draw()\n{\n\trequestAnimationFrame(draw);\n\tg_canvas.clearRect(0, 0, g_canvasWidth, g_canvasHeight);\n\tfor (let renderable of g_renderables)\n\t{\n\t\trenderable.render();\n\t}\n}", "draw() {\n\n }", "function draw() {\r\n canvas_resize();\r\n set_origin();\r\n set_speed();\r\n bars[it].display();\r\n if (looping && it < nb_op) it++;\r\n}", "_draw() {\n\n }", "function draw(){\r\n ctx.fillStyle = '#70c5ce';\r\n ctx.fillRect(0, 0, cWidth, cHeight);\r\n bg.draw();\r\n pipes.draw();\r\n fg.draw();\r\n kca.draw();\r\n bird.draw();\r\n getReady.draw();\r\n gameOver.draw();\r\n score.draw();\r\n \r\n\r\n}", "function gameDraw()\n{\n\tstate.gameDraw();\t\n\t/* repeat */\n\trequestAnimationFrame(gameDraw);\n}", "function draw() {\n background(0);\n\n // draws title\n drawTitle();\n\n // draws the replay button\n clickButton.draw();\n\n // update new random panel\n checkRunTime();\n\n //draw board\n drawBoard();\n\n //draw tally\n drawTally();\n}", "function draw() {\n \n\n \n}", "update(){\r\n this.draw();\r\n }", "function tick() {\r\n requestAnimFrame(tick);\r\n draw();\r\n}", "function draw() {\n \n}", "function draw() {\r\n \r\n}", "function draw()\n{\n \n}", "function render() {\n // showFPSaverage();\n showCompletedLines();\n game.getBoard.drawme();\n\n // game.getBoard.getPieces.forEach(piece => piece.drawme());\n}", "function draw() {\n if (state === `loading`) {\n loading();\n }\n else if (state === `running`) {\n running();\n }\n}", "function draw() {\n\t\t\t\tctx.fillStyle = \"black\";\n\t\t\t\tctx.fillRect(0,0,canvasWidth, canvasHeight);\n\t\t\t\tplayer.draw();\n\t\t\t\tcomputer.draw();\n\t\t\t\tball.draw();\n\t\t\t}", "function draw() {\n\t//updating all the partical\n\tupdate();\n\t//drawing\n\tbackground(41, 128, 185);\n\tfor(var index = 0; index < particleSystem.length; index++) {\n\t\tparticleSystem[index].draw()\n\t}\n\n\t//text(\"fps\" + frameRate(), 25, 100);\n}", "function draw () {\n renderer.render(stage)\n requestAnimationFrame(draw)\n }", "function draw() {\n \n}", "function frame(){\r\n\t\t \t\tupdate();\r\n\t\t \t\tcollides();\r\n\t\t \t\tdraw();\r\n\t\t \t\tloop = requestAnimationFrame(frame);\r\n\t\t \t}", "function frame(){\r\n\t\t \t\tupdate();\r\n\t\t \t\tcollides();\r\n\t\t \t\tdraw();\r\n\t\t \t\tloop = requestAnimationFrame(frame);\r\n\t\t \t}", "function tick() {\n requestAnimFrame(tick);\n draw();\n}", "function tick() {\n requestAnimFrame(tick);\n draw();\n}", "function draw() {\n\n\t\t\t\t// キャンバスの描画をクリア\n\t\t\t\tcontext.clearRect(0, 0, width, height);\n\n\t\t\t\t//波を描画\n\t\t\t\tdrawWave('rgba(7, 126, 195, 0.30)', 1, 3, 0);\n\n\t\t\t\t// Update the time and draw again\n\t\t\t\tdraw.seconds = draw.seconds + .009;\n\t\t\t\tdraw.t = draw.seconds * Math.PI;\n\t\t\t\tsetTimeout(draw, 20);\n\t\t\t}", "function draw() {\n}", "function draw() {\n}", "function draw() {\n}", "function draw() {\n}", "function draw() {\n}", "function runTimeFrame() {\n g.beginPath();\n evolve();\n draw();\n g.stroke();\n }", "loop() {\n this.display();\n this.draw();\n setTimeout(()=>this.loop(), 200)\n\n }", "function drawFrame() {\n context.fillRect(0, 0, canvas.width, canvas.height);\n context.fillStyle = \"#e8eaec\";\n }", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n ctx.fillStyle = \"#70c5ce\";\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n cloud.draw();\n pipes.draw();\n ball.draw();\n ground.draw();\n bird.draw();\n getReady.draw();\n gameOver.draw();\n score.draw();\n}", "function load_canvas() {\n setInterval(function() {draw()}, 1);\n}", "startDrawCycle() {\n\t\tif (this.run === false) return;\n\t\tthis.drawFrame(1);\n\n\t\traf(this.startDrawCycle.bind(this));\n\t}", "function draw() {\n\n\t\t\t\t// キャンバスの描画をクリア\n\t\t\t\tcontext.clearRect(0, 0, width, height);\n\n\t\t\t\t//波を描画\n\t\t\t\tdrawWave('rgba(7, 126, 195, 0.30)', 1, 3, 0);\n\n\t\t\t\t// Update the time and draw again\n\t\t\t\tdraw.seconds = draw.seconds + .009;\n\t\t\t\tdraw.t = draw.seconds * Math.PI;\n\t\t\t\tsetTimeout(draw, 30);\n\t\t\t}", "draw(){\n console.log('draw');\n }", "function draw() {\n\t// clear drawing area\n\tctx.clearRect(0, 0, 400, 400);\n\n\t// draw all people\n\tfor (var id in people) {\n\t\tctx.fillRect(people[id].x, people[id].y, 10, 10);\n\t}\n\n\twindow.requestAnimationFrame(draw);\n}", "_drawFrame () {\n \n\n this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height)\n for (let x = 0; x < this.sizeX; x++) {\n for (let y = 0; y < this.sizeY; y++) {\n if (this.matrix[x][y] === -1) {\n this._drawBackgroundSquare(x, y, this.tileWidth, this.deathTileColor)\n this.matrix[x][y] = 0\n } else if (this.matrix[x][y] === 1) {\n this._drawSquare(x, y, this.tileWidth, this.tileColor)\n }\n }\n }\n this._drawMouse()\n }", "draw(){\n this._context.fillStyle = '#000';\n this._context.fillRect(0, 0, canvas.width, canvas.height);\n \n // draw ball and players\n this.drawRectangle(this.ball) \n this.players.forEach(player => this.drawRectangle(player));\n\n //draw score\n this.drawScore();\n }", "function draw(){\n\n requestAnimationFrame(draw);\n \n //Draw background\n ctx.fillStyle = 'teal';\n ctx.fillRect(0,0, canvas.width, canvas.height);\n\n //Draw map\n drawCheckpoints();\n\n //Draw objects\n objects.forEach(obj => {\n obj.draw();\n });\n\n drawText();\n}", "function draw() {\n computeBoardSize(board);\n\n context.drawImage(\n this,\n current_x_offset,\n current_y_offset,\n board.width,\n board.height\n );\n\n positionPlayer();\n clearBlinkers();\n\n for (let i of allObjects) {\n if (isInView(i.x, i.y) && !i.completed) {\n const [x, y] = normalize_image_position(i.x, i.y);\n createBlinker(x, y, i.isGold);\n }\n }\n }", "function draw() {\r\n if (x < background.w)x += 1;\r\n else x=0;\r\n if(theme==\"basic\"){\r\n bgImg=background.img;\r\n }else bgImg=backgroundSnow.img; \r\n context.drawImage(bgImg, x, 0, background.w, background.h, 0, 0, background.w ,background.h); \r\n context.save();\r\n animate(); // call function for animate player\r\n context.restore(); \r\n context.drawImage(flag.img, flag.w, flag.h); \r\n context.drawImage(tuyau.img, tuyau.w, tuyau.h); \r\n if(!progress){\r\n context.drawImage(win.img, win.w, win.h);\r\n }\r\n }", "function updateDraw(){\r\n //ToDo\r\n }", "function loop() {\n draw();\n requestAnimFrame(loop);\n}", "static draw() {\n tick++;\n\n background(51);\n\n for( let b of Ball.zeBalls ) {\n b.show();\n b.step(tick);\n }\n\n // if( tick < 1000 )\n // Ball.saveScreenshot( \"balls-\" + Ball.leadingZeroes(tick, 3) );\n }", "function draw() {\n\n\n\n}", "Draw(){\n\t\tthis.context.beginPath();\n\t\tthis.context.fillRect(this.posX, this.posY, this.width, this.height);\n\t\tthis.context.closePath();\n }", "function draw()\n{\n}", "function draw(){\n\t\t// Needed to comply with Tool Delegate design pattern\n\t}", "function drawNextFrame() {\n\tdrawNext = true;\n}", "draw(i) {\n ctx.save();\n ctx.translate(cv.width * 0.5, cv.height * 0.5);\n ctx.scale(1, -1);\n\n ctx.beginPath();\n super.draw_handles();\n\n ctx.beginPath();\n ctx.strokeStyle = 'red';\n\n // If need update (ray moved)\n // or if any mirror moved (then recalculate all rays)\n // it is quite unoptimal, but we can use it here\n if(this.need_update || any_mirror_moved()) {\n this.cast_ray();\n this.need_update = false;\n\n // Is last ray?\n if(i == ray_total_count()) {\n mirror_updated();\n }\n \n }\n\n this.draw_trace();\n\n ctx.closePath();\n ctx.restore();\n }", "function draw() {\n ctx.clearRect(0,0, canvas.width, canvas.height);\n drawList.forEach((shape) => {\n shape.draw();\n });\n raf = window.requestAnimationFrame(draw);\n}", "function draw() {\n /* Drawing function where you can get all the objects moving\n *\n */\n\n background(100, 140, 130);\n screenStats();\n checkBoudaries();\n arrivalParticle();\n timeelapsed();\n particleX();\n console.log('How Many Frames per Second : ' + requestAnimFrame());\n}", "runAnimation() {\n if (!this.running) { return; }\n this.animationFrame = requestAnimationFrame(this.runAnimation);\n\n this.tick();\n this.draw();\n }", "draw() {\n this.clearCanvas();\n\n this._ball.draw();\n this._paddle1.draw();\n this._paddle2.draw();\n\n this.drawScore();\n\n this.detectCollision();\n\n this.movePaddles();\n\n this._ball.move();\n }", "function tick() {\r\n requestAnimFrame(tick);\r\n draw();\r\n animate();\r\n}", "draw() {\n if (this.isAlive) {\n fill(color(200, 0, 200));\n } else {\n fill(color(240));\n }\n noStroke();\n rect(this.column * this.size + 1, this.row * this.size + 1, this.size - 1, this.size - 1);\n }", "startDraw(){\n if(!this.drawing) {\n this.drawing = true;\n this.then = Date.now();\n this.draw();\n }\n }", "draw(){\n\t\t\n\t\tlet height = this.height; //100\n\t\tlet width = this.width; //100\n\t\t\n\t\tlet ctx = this.ctx;\n\t\t//save last frame\n\t\tlet lastFrame = ctx.getImageData(0, 0, width, height);\n\t\t//clear canvas\n\t\tctx.clearRect(0, 0, width, height);\n\t\t//now, move frame 1 pixel to the left\n\t\tctx.putImageData(lastFrame, -1, 0);\n\t\t\n\t\t//then, draw the lines\n\t\tfor(var line of this.lines){\n\t\t\t\n\t\t\t\n\t\t\tlet range = line.maxValue - line.minValue;\n\t\t\tlet value = line.value;\n\t\t\t\n\t\t\t//Multiply line's value by the ratio between height and range, to get effective range the same but zero at the top\n\t\t\tvalue *= 1 * height / range;\n\t\t\t\n\t\t\t//Now, zero the value by adding the difference between minValue and 0\n\t\t\tvalue -= line.minValue * height / range;\n\t\t\t\n\t\t\t//Now, invert by subtracting from height\n\t\t\tvalue = height - value;\n\t\t\t\n\t\t\tctx.beginPath();\n\t\t\tctx.strokeStyle = line.color;\n\t\t\tctx.moveTo(width - 2, value);\n\t\t\tctx.lineTo(width, value);\n\t\t\tctx.stroke();\n\t\t}\n\t}", "_draw_all(){\r\n\t\tthis._draw_bg();\r\n\t\tthis._draw_fg();\r\n\t}", "function draw(){\n\n\t\tctx.fillStyle = '#fff';\n\t\tctx.fillRect(0, 0, canvas.width/ratio, canvas.height/ratio);\n\n\t\tctx.fillStyle = '#000';\n\t\tmySkeleton.draw( ctx );\n\n\n\t\t//console.log(squares.length);\n\t\trequestAnimationFrame (draw);\n\n\t}", "function drawFrame() {\n // Reset background\n gl.clearColor(1, 1, 1, 1);\n gl.enable(gl.DEPTH_TEST);\n gl.clear(gl.COLOR_BUFFER_BIT);\n gl.viewport(0, 0, canvas.width, canvas.height);\n\n // Bind needle speeds\n // Draw Elements!\n // Topmost code is shown at the front! \n drawVertex(canvas, shaderProgram, gl.TRIANGLES, tri, indices, black);\n\n window.requestAnimationFrame(drawFrame);\n }", "function draw() {\n\t\t\t// Adjust render settings if we switched to multiple viewports or vice versa\n\t\t\tif (medeactx.frame_flags & medeactx.FRAME_VIEWPORT_UPDATED) {\n\t\t\t\tif (medeactx.GetEnabledViewportCount()>1) {\n\t\t\t\t\tmedeactx.gl.enable(medeactx.gl.SCISSOR_TEST);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmedeactx.gl.disable(medeactx.gl.SCISSOR_TEST);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Perform rendering\n\t\t\tvar viewports = medeactx.GetViewports();\n\t\t\tfor(var vn = 0; vn < viewports.length; ++vn) {\n\t\t\t\tviewports[vn].Render(medeactx,dtime);\n\t\t\t}\n\t\t}", "function tick() {\n requestAnimFrame(tick);\n draw();\n animate();\n}", "function draw() {\n //comment this back in to see a dynamic animation!!\n // if (mouseIsPressed) {\n // square(mouseX, mouseY, 90);\n // } else {\n // circle(mouseX, mouseY, 90);\n // }\n}", "handleTick() {\n this.update()\n this.draw()\n }" ]
[ "0.81096524", "0.81096524", "0.81096524", "0.80829144", "0.79170305", "0.7911917", "0.7895798", "0.78491086", "0.78491086", "0.7770451", "0.77563846", "0.77563846", "0.77563846", "0.7756033", "0.7749644", "0.7746734", "0.77258253", "0.7711054", "0.77058536", "0.7686585", "0.7686585", "0.7686585", "0.7686585", "0.76751745", "0.76481676", "0.76342255", "0.7596366", "0.75940233", "0.75917107", "0.7542427", "0.7485358", "0.74771565", "0.74622494", "0.7461516", "0.7453082", "0.7438486", "0.74307364", "0.74304354", "0.7416813", "0.74007446", "0.7387913", "0.7385893", "0.7383786", "0.7383786", "0.7369626", "0.7369626", "0.7367052", "0.7360184", "0.7360184", "0.7360184", "0.7360184", "0.7360184", "0.7359563", "0.7344606", "0.733534", "0.7332306", "0.7332306", "0.7332306", "0.7332306", "0.7332306", "0.7332306", "0.7332306", "0.7332306", "0.7332306", "0.7332306", "0.7332306", "0.73305553", "0.7326127", "0.7322461", "0.73205024", "0.7316982", "0.7306882", "0.72987574", "0.7298454", "0.72920156", "0.72873884", "0.7280118", "0.7269596", "0.72666407", "0.7262515", "0.7260433", "0.725271", "0.72482014", "0.7243239", "0.72375154", "0.7232395", "0.72311", "0.72307193", "0.7226657", "0.7222462", "0.7221024", "0.7208471", "0.7206656", "0.7197391", "0.7195589", "0.7184355", "0.7183453", "0.7178383", "0.7174872", "0.71689504", "0.7163472" ]
0.0
-1
Custom function that handles the projection effect
function createProjection(x1, y1, x2, y2) { // Creating two vector objects var startVector = createVector(x1, y1); var endVector = createVector(x2, y2); // Get the direction from strat to end var dirVector = endVector.copy().sub(startVector); // Save the magnitude = length of the distance var magnitude = dirVector.mag(); // Reduce to unit vector of length 1, then divide the 10 logos in dirVector.normalize(); dirVector.mult(magnitude / 10); // This makes all no sense but is working nicely for (var i = 0; i < projection.length; i++) { startVector.add(dirVector); var tempLogo = select('#logo' + i); tempLogo.position((startVector.x - LOGOHALF), startVector.y - LOGOHALF); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ProjectionOverlay() {\n\t\t\t}", "function WoWMapProjection(){}", "function CanvasProjectionOverlay(){}", "function applyProjection(p, m) {\n\t var x = p.x,\n\t y = p.y,\n\t z = p.z;\n\t var e = m.elements;\n\t var w = e[3] * x + e[7] * y + e[11] * z + e[15];\n\t //This is the difference between this function and\n\t //the normal THREE.Vector3.applyProjection. We avoid\n\t //inverting the positions of points behind the camera,\n\t //otherwise our screen area computation can result in\n\t //boxes getting clipped out when they are in fact partially visible.\n\t if (w < 0) w = -w;\n\t var d = 1.0 / w;\n\t p.x = (e[0] * x + e[4] * y + e[8] * z + e[12]) * d;\n\t p.y = (e[1] * x + e[5] * y + e[9] * z + e[13]) * d;\n\t //We also don't need the Z\n\t //p.z = ( e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] ) * d;\n\t }", "function project(d) {\r\n\r\n // console.log(d);\r\n //console.log(map.project(new mapboxgl.LngLat(d[0], d[1])))\r\n return map.project(new mapboxgl.LngLat(d[0], d[1]));\r\n}", "getProjection(other_vector) {\n\n }", "projectionOn(e3v) {\nreturn E3Vec.projectionV3(this.xyz, e3v.xyz);\n}", "get boxProjection() {}", "project(ax, ay, az, angles){\r\n var x = ax - this.camera_p.x;\r\n var y = ay - this.camera_p.y;\r\n var z = az - this.camera_p.z;\r\n \r\n var dx = angles.cy*(angles.sz*y + angles.cz*x) - angles.sy*z;\r\n var dy = angles.sx*(angles.cy*z + angles.sy*(angles.sz*y + angles.cz*x)) + angles.cx*(angles.cz*y - angles.sz*x);\r\n var dz = angles.cx*(angles.cy*z + angles.sy*(angles.sz*y + angles.cz*x)) - angles.sx*(angles.cz*y - angles.sz*x);\r\n return {x: (this.view_p.z*dx)/dz - this.view_p.x, y: (this.view_p.z*dy)/dz - this.view_p.y, dx:dx, dy:dy, dz:dz};\r\n }", "set boxProjection(value) {}", "projection() {\n const { translateMap, zoom, } = this.state;\n\n return geoMercator()\n .scale(zoom)\n .translate(translateMap)\n }", "getProjection(projection, center, scale, offset) {\n return d3[projection]()\n .center(center)\n .scale(scale)\n .translate(offset);\n }", "function project(d) {\n return map.project(new mapboxgl.LngLat(d.LON, d.LAT));\n }", "projection() {\n var geoMercator = d3\n .geoMercator()\n .scale(100)\n .translate([800 / 2, 450 / 2]);\n\n var projection2 = d3\n .geoOrthographic()\n .scale(300)\n .precision(0.1);\n var projection3 = d3\n .geoConicEqualArea()\n .scale(150)\n .center([0, 33])\n //.translate([width / 2, height / 2])\n .precision(0.3);\n return geoMercator;\n }", "function initProjection() {\n var oldZone = zone,\n zoom = map.getZoom(),\n center = map.getCenter();\n\n if (zoom < 11) {\n zone = 30;\n } else {\n var lngCenter = center.lng();\n if (lngCenter < -6) {\n zone = 29;\n } else if (lngCenter < 0) {\n zone = 30;\n } else {\n zone = 31;\n }\n }\n\n if (oldZone != zone) {\n googProj.proj = WTMap.Projection.iberpix(zone);\n map.setCenter(center);\n }\n }", "function setProjection() {\n\n // Set bounds for projection.\n viewerDist = length(subtract(e, a));\n pn = viewerDist - 6;\n pf = viewerDist + 64;\n\n // Perspecive projection bounds.\n pt = pn * Math.tan(Math.PI / 4);\n pb = -pt;\n pr = pt;\n pl = -pr;\n\n getPerspective();\n}", "constructor() {\n this.projection = d3.geoConicConformal().scale(150).translate([400, 350]);\n\n }", "project(coord, transMat) {\n var point = BABYLON.Vector3.TransformCoordinates(coord, transMat);\n // The transformed coordinates will be based on coordinate system\n // starting on the center of the screen. But drawing on screen normally starts\n // from top left. We then need to transform them again to have x:0, y:0 on top left.\n var x = point.x * this.workingWidth + this.workingWidth / 2.0 >> 0; // >>0 二进制右移 相当于取整\n var y = -point.y * this.workingHeight + this.workingHeight / 2.0 >> 0;\n return (new BABYLON.Vector2(x, y));\n }", "function applyProjection(tView, lView, tProjectionNode) {\n var renderer = lView[RENDERER];\n var parentRNode = getParentRElement(tView, tProjectionNode, lView);\n var parentTNode = tProjectionNode.parent || lView[T_HOST];\n var beforeNode = getInsertInFrontOfRNode(parentTNode, tProjectionNode, lView);\n applyProjectionRecursive(renderer, 0\n /* Create */\n , lView, tProjectionNode, parentRNode, beforeNode);\n }", "function computeProjections() {\n for (var n = 0; n < roots.length; n++) {\n // compute projections and resize by 100 and translated by 300\n rootProj[n] = [dotprod(projMatrix[0], roots[n]) * zoom + translateX,\n dotprod(projMatrix[1], roots[n]) * zoom + translateY];\n }\n}", "function setProjectionEvent(ele) {\n setProjection(ele.target.value);\n}", "function TProjectionNode() {}", "function TProjectionNode() {}", "function TProjectionNode() {}", "function projToggle() {\r\n var P = makeObject();\r\n drawFnormz = P.norm;\r\n normColor = P.normCo;\r\n vert = P.vertex;\r\n ind = P.index;\r\n var tempF = P.fcolor;\r\n var tempS = P.scolor;\r\n \r\n if(light1 === true && light2 === true){\r\n if (flatShaded){\r\n flatColor = addColors(flatColor, pointLighting(smoothNormz));\r\n }else{\r\n smoothColor = addColors(smoothColor, pointLighting(smoothNormz));\r\n }\r\n }else if(light1 === true){\r\n flatColor = tempF;\r\n smoothColor = tempS;\r\n }else if(light2 ===true){\r\n if (flatShaded){\r\n flatColor = pointLighting(smoothNormz);\r\n }else{\r\n smoothColor = pointLighting(smoothNormz);\r\n }\r\n }else if(light1 === false && light2 === false){\r\n flatColor = grayColors(tempF);\r\n smoothColor = grayColors(tempS);\r\n }\r\n \r\n if (orthoProj === true) {\r\n orthoProj = false;\r\n gl = main();\r\n if (buttonE){drawObjects();}\r\n else {drawSOR(gl); drawLights(gl);}\r\n }else if (orthoProj === false){\r\n orthoProj = true;\r\n gl = main();\r\n if (buttonE){drawObjects();}\r\n else {drawSOR(gl); drawLights(gl);}\r\n }\r\n flatColor = tempF;\r\n smoothColor = tempS;\r\n}", "function applyProjection(tView, lView, tProjectionNode) {\n var renderer = lView[RENDERER];\n var parentRNode = getParentRElement(tView, tProjectionNode, lView);\n var parentTNode = tProjectionNode.parent || lView[T_HOST];\n var beforeNode = getInsertInFrontOfRNode(parentTNode, tProjectionNode, lView);\n applyProjectionRecursive(renderer, 0\n /* Create */\n , lView, tProjectionNode, parentRNode, beforeNode);\n}", "function TProjectionNode() { }", "function TProjectionNode() { }", "_needUpdateProjection() {\n this._lowLevelCamera._needUpdateProjection();\n }", "getMapCenter() {\n const windowPosition = new Cesium.Cartesian2(this.viewer.container.clientWidth / 2, this.viewer.container.clientHeight / 2);\n const pickRay = this.viewer.scene.camera.getPickRay(windowPosition);\n const result = {};\n const pickPosition = this.viewer.scene.globe.pick(pickRay, this.viewer.scene, result);\n if (pickPosition == undefined) {\n return null;\n }\n console.log(result);\n return result;\n }", "project() {\r\n for (let j = 0; j < this.objs.length; j++) {\r\n let item = this.objs[j];\r\n for (let i = 0; i < item.vertexs.length && i < 3; i++) {\r\n if (item.changed[i]) { // if the drawable has moved position\r\n let fur = this.locate(item.vertexs[i]);\r\n let htheta = Math.atan(fur[2]/fur[0]); // verticle theta\r\n let vtheta = Math.atan(fur[1]/fur[0]); // horizontal theta\r\n\r\n //console.log('fur', fur, 'horiz theta', htheta, 'verticle theta', vtheta);\r\n\r\n if (Math.abs(htheta) < this.cam.fovHoriz && \r\n Math.abs(vtheta) < this.cam.fovVert) item._visible[i] = true;\r\n else item._visible[i] = false;\r\n\r\n // this could be changed to be xy scaled by distance?\r\n let w = this.cvs.width/2;\r\n let h = this.cvs.height/2;\r\n item.projected[i] = [\r\n w + (htheta/this.cam.fovHoriz * w), \r\n h - (vtheta/this.cam.fovVert * h), \r\n fur[2]\r\n ];\r\n \r\n //console.log('vertex visible', item._visible[i], item.projected[i]);\r\n }\r\n }\r\n \r\n }\r\n }", "function updateProjection(projection) {\n gl.uniformMatrix4fv(locations.projection, false, flatten(projection));\n}", "function UpdateProjectionMatrix()\r\n{\r\n\t// Parámetros para la matriz de perspectiva\r\n\tvar r = canvas.width / canvas.height;\r\n\tvar n = (transZ - 1.74);\r\n\r\n\tconst min_n = 0.001;\r\n\t\r\n\tif ( n < min_n ) n = min_n;\r\n\tvar f = (transZ + 1.74);;\r\n\tvar fov = 3.145 * 60 / 180;\r\n\tvar s = 1 / Math.tan( fov/2 );\r\n\r\n\t// Matriz de perspectiva\r\n\tperspectiveMatrix = [\r\n\t\ts/r, 0, 0, 0,\r\n\t\t0, s, 0, 0,\r\n\t\t0, 0, (n+f)/(f-n), 1,\r\n\t\t0, 0, -2*n*f/(f-n), 0\r\n\t];\r\n}", "getProjMatrix() {\nreturn this.projMat;\n}", "function applyProjection(tView, lView, tProjectionNode) {\n const renderer = lView[RENDERER];\n const parentRNode = getParentRElement(tView, tProjectionNode, lView);\n const parentTNode = tProjectionNode.parent || lView[T_HOST];\n let beforeNode = getInsertInFrontOfRNode(parentTNode, tProjectionNode, lView);\n applyProjectionRecursive(renderer, 0 /* Create */, lView, tProjectionNode, parentRNode, beforeNode);\n}", "function applyProjection(tView, lView, tProjectionNode) {\n const renderer = lView[RENDERER];\n const parentRNode = getParentRElement(tView, tProjectionNode, lView);\n const parentTNode = tProjectionNode.parent || lView[T_HOST];\n let beforeNode = getInsertInFrontOfRNode(parentTNode, tProjectionNode, lView);\n applyProjectionRecursive(renderer, 0 /* Create */, lView, tProjectionNode, parentRNode, beforeNode);\n}", "function applyProjection(tView, lView, tProjectionNode) {\n const renderer = lView[RENDERER];\n const parentRNode = getParentRElement(tView, tProjectionNode, lView);\n const parentTNode = tProjectionNode.parent || lView[T_HOST];\n let beforeNode = getInsertInFrontOfRNode(parentTNode, tProjectionNode, lView);\n applyProjectionRecursive(renderer, 0 /* Create */, lView, tProjectionNode, parentRNode, beforeNode);\n}", "function applyProjection(tView, lView, tProjectionNode) {\n const renderer = lView[RENDERER];\n const parentRNode = getParentRElement(tView, tProjectionNode, lView);\n const parentTNode = tProjectionNode.parent || lView[T_HOST];\n let beforeNode = getInsertInFrontOfRNode(parentTNode, tProjectionNode, lView);\n applyProjectionRecursive(renderer, 0 /* Create */, lView, tProjectionNode, parentRNode, beforeNode);\n}", "function applyProjection(tView, lView, tProjectionNode) {\n const renderer = lView[RENDERER];\n const parentRNode = getParentRElement(tView, tProjectionNode, lView);\n const parentTNode = tProjectionNode.parent || lView[T_HOST];\n let beforeNode = getInsertInFrontOfRNode(parentTNode, tProjectionNode, lView);\n applyProjectionRecursive(renderer, 0 /* Create */, lView, tProjectionNode, parentRNode, beforeNode);\n}", "function applyProjection(tView, lView, tProjectionNode) {\n const renderer = lView[RENDERER];\n const parentRNode = getParentRElement(tView, tProjectionNode, lView);\n const parentTNode = tProjectionNode.parent || lView[T_HOST];\n let beforeNode = getInsertInFrontOfRNode(parentTNode, tProjectionNode, lView);\n applyProjectionRecursive(renderer, 0 /* Create */, lView, tProjectionNode, parentRNode, beforeNode);\n}", "function TProjectionNode(){}", "function update_projection() {\r\n\tlet p, w = gl.canvas.width, h = gl.canvas.height;\r\n\tif (show_perspective) {\r\n\t\tp = perspective(45, w/h, 0.01, 10);\r\n\t\t// Need to move the camera away from the origin and flip the z-axis\r\n\t\tp = mult(p, mult(translate(0, 0, -3), scalem(1, 1, -1)));\r\n\t} else {\r\n\t\tp = (w > h) ? ortho(-w/h, w/h, -1, 1, 10, -10) : ortho(-1, 1, -h/w, h/w, 10, -10);\r\n\t}\r\n\tgl.uniformMatrix4fv(projection_loc, false, flatten(p));\r\n}", "setProjection() {\n this.extent = [0, 0, this.imwidth, this.imheight];\n this.projection = new ol.proj.Projection({\n code: 'ifu',\n units: 'pixels',\n extent: this.extent\n });\n }", "function projection(width, height) {\n return [2 / width, 0, 0, 0, 0, -2 / height, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n}", "_projectCoordinates() {\n var _point;\n return this._coordinates.map(latlon => {\n _point = this._world.latLonToPoint(latlon);\n\n // TODO: Is offset ever being used or needed?\n if (!this._offset) {\n this._offset = Point(0, 0);\n this._offset.x = -1 * _point.x;\n this._offset.y = -1 * _point.y;\n\n this._options.pointScale = this._world.pointScale(latlon);\n }\n\n return _point;\n });\n }", "function project(c, p, y) {\n return {\n x: c.x + (p.x-c.x) / (p.y-c.y) * (y-c.y),\n y: y\n };\n}", "function getProjection() {\n var N1 = get_N1();\n var N2 = get_N2();\n return mult(N1, N2);\n}", "get projection() {\n\t\treturn this._p;\n\t}", "function CustomProjection(a,b){\n\tthis.imageDimension=65536;\n\tthis.pixelsPerLonDegree=[];\n\tthis.pixelOrigin=[];\n\tthis.tileBounds=[];\n\tthis.tileSize=256;\n this.isWrapped=b;\n\tvar b=this.tileSize;\n\tvar c=1;\n\tfor(var d=0;d<a;d++){\n var e=b/2;\n this.pixelsPerLonDegree.push(b/360);\n this.pixelOrigin.push(new google.maps.Point(e,e));\n this.tileBounds.push(c);\n b*=2;\n c*=2\n }\n }", "function proj(point) {\n // Shift the point by the camera's position.\n var shifted = [point[0] - camera[0], point[1] - camera[1], point[2] - camera[2]];\n // Rotate the point by the camera's rotation.\n var rotated = rotateX(\n rotateY(\n rotateZ(\n [shifted[0], shifted[1], shifted[2]],\n rotation[2]),\n rotation[1]),\n rotation[0]);\n if (rotated[2] <= 0 || rotated[2] > 100) {\n // Return false for points behind the camera or too far in front of it, which shouldn't be drawn.\n return false;\n }\n return [rotated[0] / rotated[2] * zoom, rotated[1] / rotated[2] * zoom];\n}", "getMappingFunction() {\n return (v) => {\n const x = v.x*this[0][0] + v.y*this[0][1] + v.z*this[0][2] + this[0][3];\n const y = v.x*this[1][0] + v.y*this[1][1] + v.z*this[1][2] + this[1][3];\n const z = v.x*this[2][0] + v.y*this[2][1] + v.z*this[2][2] + this[2][3];\n const w = v.x*this[3][0] + v.y*this[3][1] + v.z*this[3][2] + this[3][3];\n\n return (w !== 0) ? new Point(x / w, y / w, z / w) : new Point(0, 0, 0);\n };\n }", "apply() {\n SwitchProjection.getInstance().start(this['projection']['code']);\n }", "function getProjection () {\n return modelNode.projection;\n}", "function getProjTransform(src, dest) {\n var clampSrc = isLatLngCRS(src);\n dest = dest.__mixed_crs || dest;\n return function(x, y) {\n var xy;\n if (clampSrc) {\n // snap lng to bounds\n if (x < -180) x = -180;\n else if (x > 180) x = 180;\n }\n xy = [x, y];\n mproj.pj_transform_point(src, dest, xy);\n return xy;\n };\n }", "function proj4js(arg1, arg2, arg3) {\n var p, fromStr, toStr, P1, P2, transform;\n if (typeof arg1 != 'string') {\n // E.g. Webpack's require function tries to initialize mproj by calling\n // the module function.\n return api;\n } else if (typeof arg2 != 'string') {\n fromStr = '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs'; // '+datum=WGS84 +proj=lonlat';\n toStr = arg1;\n p = arg2;\n } else {\n fromStr = arg1;\n toStr = arg2;\n p = arg3;\n }\n P1 = pj_init(fromStr);\n P2 = pj_init(toStr);\n transform = get_proj4js_transform(P1, P2);\n if (p) {\n return transform(p);\n } else {\n return {forward: transform, inverse: get_proj4js_transform(P2, P1)};\n }\n}", "update(viewMatrix, projectionMatrix) {\n _math_Matrix44__WEBPACK_IMPORTED_MODULE_0__[\"default\"].multiplyTo(projectionMatrix, viewMatrix, this.__vp);\n this.zNear.x = this.__vp.m20 + this.__vp.m30;\n this.zNear.y = this.__vp.m21 + this.__vp.m31;\n this.zNear.z = this.__vp.m22 + this.__vp.m32;\n this.zNear.w = this.__vp.m23 + this.__vp.m33;\n this.zNear.normalize3();\n this.zFar.x = -this.__vp.m20 + this.__vp.m30;\n this.zFar.y = -this.__vp.m21 + this.__vp.m31;\n this.zFar.z = -this.__vp.m22 + this.__vp.m32;\n this.zFar.w = -this.__vp.m23 + this.__vp.m33;\n this.zFar.normalize3();\n this.bottom.x = this.__vp.m10 + this.__vp.m30;\n this.bottom.y = this.__vp.m11 + this.__vp.m31;\n this.bottom.z = this.__vp.m12 + this.__vp.m32;\n this.bottom.w = this.__vp.m13 + this.__vp.m33;\n this.bottom.normalize3();\n this.top.x = -this.__vp.m10 + this.__vp.m30;\n this.top.y = -this.__vp.m11 + this.__vp.m31;\n this.top.z = -this.__vp.m12 + this.__vp.m32;\n this.top.w = -this.__vp.m13 + this.__vp.m33;\n this.top.normalize3();\n this.left.x = this.__vp.m00 + this.__vp.m30;\n this.left.y = this.__vp.m01 + this.__vp.m31;\n this.left.z = this.__vp.m02 + this.__vp.m32;\n this.left.w = this.__vp.m03 + this.__vp.m33;\n this.left.normalize3();\n this.right.x = -this.__vp.m00 + this.__vp.m30;\n this.right.y = -this.__vp.m01 + this.__vp.m31;\n this.right.z = -this.__vp.m02 + this.__vp.m32;\n this.right.w = -this.__vp.m03 + this.__vp.m33;\n this.right.normalize3();\n }", "calcProjectionCoords(points) {\n const projection = this.projection();\n return (points.map(point => {\n if ('geometry' in point) {\n return (projection(point.geometry.coordinates))\n }\n return (projection(point.coordinates))\n })\n )\n }", "function translateCircle(datum, index){\n return \"translate(\" + projection([datum.y, datum.x]) + \")\";\n}", "get projection() {\n if (!this.cache.projection) {\n var layer;\n for (var i=0, ii=this.layers.length; i<ii; ++i) {\n layer = this.layers[i];\n if (layer.projection) {\n this.projection = layer.projection;\n break;\n }\n }\n }\n return this.cache.projection;\n }", "function project(a, b){\r\n //proj of a anto b = a dot b / mag(b)^2 * b\r\n return scalar(dot(a,b)/(magnitude(b)*magnitude(b)), b);\r\n}", "function useGeographic() {\n setUserProjection('EPSG:4326');\n}", "function transform(p){\n\t\t\t\t\tvar x = (p[0] - data.bounds[0][0]) / (data.bounds[1][0] - data.bounds[0][0]);\n\t\t\t\t\tvar y = (p[1] - data.bounds[0][1]) / (data.bounds[1][0] - data.bounds[0][0]);\n\n\t\t\t\t\tx *= scale;\n\t\t\t\t\ty *= -scale * 1.75;\n\n\t\t\t\t\tx += -5;\n\t\t\t\t\ty += 5;\n\n\t\t\t\t\treturn [x, y];\n\t\t\t\t}", "function PerspectiveTransform( a11, a21, a31, a12, a22, a32, a13, a23, a33)\r\n{\r\n\tthis.a11 = a11;\r\n\tthis.a12 = a12;\r\n\tthis.a13 = a13;\r\n\tthis.a21 = a21;\r\n\tthis.a22 = a22;\r\n\tthis.a23 = a23;\r\n\tthis.a31 = a31;\r\n\tthis.a32 = a32;\r\n\tthis.a33 = a33;\r\n\tthis.transformPoints1=function( points)\r\n\t\t{\r\n\t\t\tvar max = points.length;\r\n\t\t\tvar a11 = this.a11;\r\n\t\t\tvar a12 = this.a12;\r\n\t\t\tvar a13 = this.a13;\r\n\t\t\tvar a21 = this.a21;\r\n\t\t\tvar a22 = this.a22;\r\n\t\t\tvar a23 = this.a23;\r\n\t\t\tvar a31 = this.a31;\r\n\t\t\tvar a32 = this.a32;\r\n\t\t\tvar a33 = this.a33;\r\n\t\t\tfor (var i = 0; i < max; i += 2)\r\n\t\t\t{\r\n\t\t\t\tvar x = points[i];\r\n\t\t\t\tvar y = points[i + 1];\r\n\t\t\t\tvar denominator = a13 * x + a23 * y + a33;\r\n\t\t\t\tpoints[i] = (a11 * x + a21 * y + a31) / denominator;\r\n\t\t\t\tpoints[i + 1] = (a12 * x + a22 * y + a32) / denominator;\r\n\t\t\t}\r\n\t\t}\r\n\tthis. transformPoints2=function(xValues, yValues)\r\n\t\t{\r\n\t\t\tvar n = xValues.length;\r\n\t\t\tfor (var i = 0; i < n; i++)\r\n\t\t\t{\r\n\t\t\t\tvar x = xValues[i];\r\n\t\t\t\tvar y = yValues[i];\r\n\t\t\t\tvar denominator = this.a13 * x + this.a23 * y + this.a33;\r\n\t\t\t\txValues[i] = (this.a11 * x + this.a21 * y + this.a31) / denominator;\r\n\t\t\t\tyValues[i] = (this.a12 * x + this.a22 * y + this.a32) / denominator;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\tthis.buildAdjoint=function()\r\n\t\t{\r\n\t\t\t// Adjoint is the transpose of the cofactor matrix:\r\n\t\t\treturn new PerspectiveTransform(this.a22 * this.a33 - this.a23 * this.a32, this.a23 * this.a31 - this.a21 * this.a33, this.a21 * this.a32 - this.a22 * this.a31, this.a13 * this.a32 - this.a12 * this.a33, this.a11 * this.a33 - this.a13 * this.a31, this.a12 * this.a31 - this.a11 * this.a32, this.a12 * this.a23 - this.a13 * this.a22, this.a13 * this.a21 - this.a11 * this.a23, this.a11 * this.a22 - this.a12 * this.a21);\r\n\t\t}\r\n\tthis.times=function( other)\r\n\t\t{\r\n\t\t\treturn new PerspectiveTransform(this.a11 * other.a11 + this.a21 * other.a12 + this.a31 * other.a13, this.a11 * other.a21 + this.a21 * other.a22 + this.a31 * other.a23, this.a11 * other.a31 + this.a21 * other.a32 + this.a31 * other.a33, this.a12 * other.a11 + this.a22 * other.a12 + this.a32 * other.a13, this.a12 * other.a21 + this.a22 * other.a22 + this.a32 * other.a23, this.a12 * other.a31 + this.a22 * other.a32 + this.a32 * other.a33, this.a13 * other.a11 + this.a23 * other.a12 +this.a33 * other.a13, this.a13 * other.a21 + this.a23 * other.a22 + this.a33 * other.a23, this.a13 * other.a31 + this.a23 * other.a32 + this.a33 * other.a33);\r\n\t\t}\r\n\r\n}", "function perspective_project(vec, d) {\n var x = vec[0];\n var y = vec[1];\n var z = vec[2];\n if (z > 0) {\n return [x * d / z, -y * d / z];\n } else {\n return false;\n }\n}", "function setProjection( element, options ) {\n var width = options.width || element.offsetWidth;\n var height = options.height || element.offsetHeight;\n var projection, path;\n var svg = this.svg;\n\n if ( options && typeof options.scope === 'undefined') {\n options.scope = 'world';\n }\n\n if ( options.scope === 'usa' ) {\n projection = d3.geo.albersUsa()\n .scale(width)\n .translate([width / 2, height / 2]);\n }\n else if ( options.scope === 'world' ) {\n projection = d3.geo[options.projection]()\n .scale((width + 1) / 2 / Math.PI)\n .translate([width / 2, height / (options.projection === \"mercator\" ? 1.45 : 1.8)]);\n }\n\n if ( options.projection === 'orthographic' ) {\n\n svg.append(\"defs\").append(\"path\")\n .datum({type: \"Sphere\"})\n .attr(\"id\", \"sphere\")\n .attr(\"d\", path);\n\n svg.append(\"use\")\n .attr(\"class\", \"stroke\")\n .attr(\"xlink:href\", \"#sphere\");\n\n svg.append(\"use\")\n .attr(\"class\", \"fill\")\n .attr(\"xlink:href\", \"#sphere\");\n projection.scale(250).clipAngle(90).rotate(options.projectionConfig.rotation)\n }\n\n path = d3.geo.path()\n .projection( projection );\n\n return {path: path, projection: projection};\n }", "function setProjection( element, options ) {\n var width = options.width || element.offsetWidth;\n var height = options.height || element.offsetHeight;\n var projection, path;\n var svg = this.svg;\n\n if ( options && typeof options.scope === 'undefined') {\n options.scope = 'world';\n }\n\n if ( options.scope === 'usa' ) {\n projection = d3.geo.albersUsa()\n .scale(width)\n .translate([width / 2, height / 2]);\n }\n else if ( options.scope === 'world' ) {\n projection = d3.geo[options.projection]()\n .scale((width + 1) / 2 / Math.PI)\n .translate([width / 2, height / (options.projection === \"mercator\" ? 1.45 : 1.8)]);\n }\n\n if ( options.projection === 'orthographic' ) {\n\n svg.append(\"defs\").append(\"path\")\n .datum({type: \"Sphere\"})\n .attr(\"id\", \"sphere\")\n .attr(\"d\", path);\n\n svg.append(\"use\")\n .attr(\"class\", \"stroke\")\n .attr(\"xlink:href\", \"#sphere\");\n\n svg.append(\"use\")\n .attr(\"class\", \"fill\")\n .attr(\"xlink:href\", \"#sphere\");\n projection.scale(250).clipAngle(90).rotate(options.projectionConfig.rotation)\n }\n\n path = d3.geo.path()\n .projection( projection );\n\n return {path: path, projection: projection};\n }", "function setProjection( element, options ) {\n var width = options.width || element.offsetWidth;\n var height = options.height || element.offsetHeight;\n var projection, path;\n var svg = this.svg;\n\n if ( options && typeof options.scope === 'undefined') {\n options.scope = 'world';\n }\n\n if ( options.scope === 'usa' ) {\n projection = d3.geo.albersUsa()\n .scale(width)\n .translate([width / 2, height / 2]);\n }\n else if ( options.scope === 'world' ) {\n projection = d3.geo[options.projection]()\n .scale((width + 1) / 2 / Math.PI)\n .translate([width / 2, height / (options.projection === \"mercator\" ? 1.45 : 1.8)]);\n }\n\n if ( options.projection === 'orthographic' ) {\n\n svg.append(\"defs\").append(\"path\")\n .datum({type: \"Sphere\"})\n .attr(\"id\", \"sphere\")\n .attr(\"d\", path);\n\n svg.append(\"use\")\n .attr(\"class\", \"stroke\")\n .attr(\"xlink:href\", \"#sphere\");\n\n svg.append(\"use\")\n .attr(\"class\", \"fill\")\n .attr(\"xlink:href\", \"#sphere\");\n projection.scale(250).clipAngle(90).rotate(options.projectionConfig.rotation)\n }\n\n path = d3.geo.path()\n .projection( projection );\n\n return {path: path, projection: projection};\n }", "function setProjection( element, options ) {\n var width = options.width || element.offsetWidth;\n var height = options.height || element.offsetHeight;\n var projection, path;\n var svg = this.svg;\n\n if ( options && typeof options.scope === 'undefined') {\n options.scope = 'world';\n }\n\n if ( options.scope === 'usa' ) {\n projection = d3.geo.albersUsa()\n .scale(width)\n .translate([width / 2, height / 2]);\n }\n else if ( options.scope === 'world' ) {\n projection = d3.geo[options.projection]()\n .scale((width + 1) / 2 / Math.PI)\n .translate([width / 2, height / (options.projection === \"mercator\" ? 1.45 : 1.8)]);\n }\n\n if ( options.projection === 'orthographic' ) {\n\n svg.append(\"defs\").append(\"path\")\n .datum({type: \"Sphere\"})\n .attr(\"id\", \"sphere\")\n .attr(\"d\", path);\n\n svg.append(\"use\")\n .attr(\"class\", \"stroke\")\n .attr(\"xlink:href\", \"#sphere\");\n\n svg.append(\"use\")\n .attr(\"class\", \"fill\")\n .attr(\"xlink:href\", \"#sphere\");\n projection.scale(250).clipAngle(90).rotate(options.projectionConfig.rotation)\n }\n\n path = d3.geo.path()\n .projection( projection );\n\n return {path: path, projection: projection};\n }", "function setProjection( element, options ) {\n var width = options.width || element.offsetWidth;\n var height = options.height || element.offsetHeight;\n var projection, path;\n var svg = this.svg;\n\n if ( options && typeof options.scope === 'undefined') {\n options.scope = 'world';\n }\n\n if ( options.scope === 'usa' ) {\n projection = d3.geo.albersUsa()\n .scale(width)\n .translate([width / 2, height / 2]);\n }\n else if ( options.scope === 'world' ) {\n projection = d3.geo[options.projection]()\n .scale((width + 1) / 2 / Math.PI)\n .translate([width / 2, height / (options.projection === \"mercator\" ? 1.45 : 1.8)]);\n }\n\n if ( options.projection === 'orthographic' ) {\n\n svg.append(\"defs\").append(\"path\")\n .datum({type: \"Sphere\"})\n .attr(\"id\", \"sphere\")\n .attr(\"d\", path);\n\n svg.append(\"use\")\n .attr(\"class\", \"stroke\")\n .attr(\"xlink:href\", \"#sphere\");\n\n svg.append(\"use\")\n .attr(\"class\", \"fill\")\n .attr(\"xlink:href\", \"#sphere\");\n projection.scale(250).clipAngle(90).rotate(options.projectionConfig.rotation)\n }\n\n path = d3.geo.path()\n .projection( projection );\n\n return {path: path, projection: projection};\n }", "function setProjection( element, options ) {\n var width = options.width || element.offsetWidth;\n var height = options.height || element.offsetHeight;\n var projection, path;\n var svg = this.svg;\n\n if ( options && typeof options.scope === 'undefined') {\n options.scope = 'world';\n }\n\n if ( options.scope === 'usa' ) {\n projection = d3.geo.albersUsa()\n .scale(width)\n .translate([width / 2, height / 2]);\n }\n else if ( options.scope === 'world' ) {\n projection = d3.geo[options.projection]()\n .scale((width + 1) / 2 / Math.PI)\n .translate([width / 2, height / (options.projection === \"mercator\" ? 1.45 : 1.8)]);\n }\n\n if ( options.projection === 'orthographic' ) {\n\n svg.append(\"defs\").append(\"path\")\n .datum({type: \"Sphere\"})\n .attr(\"id\", \"sphere\")\n .attr(\"d\", path);\n\n svg.append(\"use\")\n .attr(\"class\", \"stroke\")\n .attr(\"xlink:href\", \"#sphere\");\n\n svg.append(\"use\")\n .attr(\"class\", \"fill\")\n .attr(\"xlink:href\", \"#sphere\");\n projection.scale(250).clipAngle(90).rotate(options.projectionConfig.rotation)\n }\n\n path = d3.geo.path()\n .projection( projection );\n\n return {path: path, projection: projection};\n }", "function setProjection( element, options ) {\n var width = options.width || element.offsetWidth;\n var height = options.height || element.offsetHeight;\n var projection, path;\n var svg = this.svg;\n\n if ( options && typeof options.scope === 'undefined') {\n options.scope = 'world';\n }\n\n if ( options.scope === 'usa' ) {\n projection = d3.geo.albersUsa()\n .scale(width)\n .translate([width / 2, height / 2]);\n }\n else if ( options.scope === 'world' ) {\n projection = d3.geo[options.projection]()\n .scale((width + 1) / 2 / Math.PI)\n .translate([width / 2, height / (options.projection === \"mercator\" ? 1.45 : 1.8)]);\n }\n\n if ( options.projection === 'orthographic' ) {\n\n svg.append(\"defs\").append(\"path\")\n .datum({type: \"Sphere\"})\n .attr(\"id\", \"sphere\")\n .attr(\"d\", path);\n\n svg.append(\"use\")\n .attr(\"class\", \"stroke\")\n .attr(\"xlink:href\", \"#sphere\");\n\n svg.append(\"use\")\n .attr(\"class\", \"fill\")\n .attr(\"xlink:href\", \"#sphere\");\n projection.scale(250).clipAngle(90).rotate(options.projectionConfig.rotation)\n }\n\n path = d3.geo.path()\n .projection( projection );\n\n return {path: path, projection: projection};\n }", "function setProjection( element, options ) {\n var width = options.width || element.offsetWidth;\n var height = options.height || element.offsetHeight;\n var projection, path;\n var svg = this.svg;\n\n if ( options && typeof options.scope === 'undefined') {\n options.scope = 'world';\n }\n\n if ( options.scope === 'usa' ) {\n projection = d3.geo.albersUsa()\n .scale(width)\n .translate([width / 2, height / 2]);\n }\n else if ( options.scope === 'world' ) {\n projection = d3.geo[options.projection]()\n .scale((width + 1) / 2 / Math.PI)\n .translate([width / 2, height / (options.projection === \"mercator\" ? 1.45 : 1.8)]);\n }\n\n if ( options.projection === 'orthographic' ) {\n\n svg.append(\"defs\").append(\"path\")\n .datum({type: \"Sphere\"})\n .attr(\"id\", \"sphere\")\n .attr(\"d\", path);\n\n svg.append(\"use\")\n .attr(\"class\", \"stroke\")\n .attr(\"xlink:href\", \"#sphere\");\n\n svg.append(\"use\")\n .attr(\"class\", \"fill\")\n .attr(\"xlink:href\", \"#sphere\");\n projection.scale(250).clipAngle(90).rotate(options.projectionConfig.rotation)\n }\n\n path = d3.geo.path()\n .projection( projection );\n\n return {path: path, projection: projection};\n }", "function setProjection( element, options ) {\n var width = options.width || element.offsetWidth;\n var height = options.height || element.offsetHeight;\n var projection, path;\n var svg = this.svg;\n\n if ( options && typeof options.scope === 'undefined') {\n options.scope = 'world';\n }\n\n if ( options.scope === 'usa' ) {\n projection = d3.geo.albersUsa()\n .scale(width)\n .translate([width / 2, height / 2]);\n }\n else if ( options.scope === 'world' ) {\n projection = d3.geo[options.projection]()\n .scale((width + 1) / 2 / Math.PI)\n .translate([width / 2, height / (options.projection === \"mercator\" ? 1.45 : 1.8)]);\n }\n\n if ( options.projection === 'orthographic' ) {\n\n svg.append(\"defs\").append(\"path\")\n .datum({type: \"Sphere\"})\n .attr(\"id\", \"sphere\")\n .attr(\"d\", path);\n\n svg.append(\"use\")\n .attr(\"class\", \"stroke\")\n .attr(\"xlink:href\", \"#sphere\");\n\n svg.append(\"use\")\n .attr(\"class\", \"fill\")\n .attr(\"xlink:href\", \"#sphere\");\n projection.scale(250).clipAngle(90).rotate(options.projectionConfig.rotation)\n }\n\n path = d3.geo.path()\n .projection( projection );\n\n return {path: path, projection: projection};\n }", "function setProjection( element, options ) {\n var width = options.width || element.offsetWidth;\n var height = options.height || element.offsetHeight;\n var projection, path;\n var svg = this.svg;\n\n if ( options && typeof options.scope === 'undefined') {\n options.scope = 'world';\n }\n\n if ( options.scope === 'usa' ) {\n projection = d3.geo.albersUsa()\n .scale(width)\n .translate([width / 2, height / 2]);\n }\n else if ( options.scope === 'world' ) {\n projection = d3.geo[options.projection]()\n .scale((width + 1) / 2 / Math.PI)\n .translate([width / 2, height / (options.projection === \"mercator\" ? 1.45 : 1.8)]);\n }\n\n if ( options.projection === 'orthographic' ) {\n\n svg.append(\"defs\").append(\"path\")\n .datum({type: \"Sphere\"})\n .attr(\"id\", \"sphere\")\n .attr(\"d\", path);\n\n svg.append(\"use\")\n .attr(\"class\", \"stroke\")\n .attr(\"xlink:href\", \"#sphere\");\n\n svg.append(\"use\")\n .attr(\"class\", \"fill\")\n .attr(\"xlink:href\", \"#sphere\");\n projection.scale(250).clipAngle(90).rotate(options.projectionConfig.rotation)\n }\n\n path = d3.geo.path()\n .projection( projection );\n\n return {path: path, projection: projection};\n }", "function setProjection( element, options ) {\n var width = options.width || element.offsetWidth;\n var height = options.height || element.offsetHeight;\n var projection, path;\n var svg = this.svg;\n\n if ( options && typeof options.scope === 'undefined') {\n options.scope = 'world';\n }\n\n if ( options.scope === 'usa' ) {\n projection = d3.geo.albersUsa()\n .scale(width)\n .translate([width / 2, height / 2]);\n }\n else if ( options.scope === 'world' ) {\n projection = d3.geo[options.projection]()\n .scale((width + 1) / 2 / Math.PI)\n .translate([width / 2, height / (options.projection === \"mercator\" ? 1.45 : 1.8)]);\n }\n\n if ( options.projection === 'orthographic' ) {\n\n svg.append(\"defs\").append(\"path\")\n .datum({type: \"Sphere\"})\n .attr(\"id\", \"sphere\")\n .attr(\"d\", path);\n\n svg.append(\"use\")\n .attr(\"class\", \"stroke\")\n .attr(\"xlink:href\", \"#sphere\");\n\n svg.append(\"use\")\n .attr(\"class\", \"fill\")\n .attr(\"xlink:href\", \"#sphere\");\n projection.scale(250).clipAngle(90).rotate(options.projectionConfig.rotation)\n }\n\n path = d3.geo.path()\n .projection( projection );\n\n return {path: path, projection: projection};\n }", "project(latlon) {\n return Geo.latLonToPoint(LatLon(latlon));\n }", "get projectionMatrix() {\n\t\treturn this._p.matrix;\n\t}", "function globeZoom() {\n if (d3.event) {\n var _scale = d3.event.scale;\n\n projection1.scale(_scale);\n\n map.selectAll(\".land\").attr(\"d\",path)\n map.selectAll(\"path\").attr(\"d\", path);\n // features.attr('d', path);\n circleShoes.attr('d', path); \n circleSweats.attr('d', path); \n circleWatches.attr('d', path); \n\n }; // end IF\n }", "function draw() {\n // Only If the window is in focus ...\n if (mouseX != 0 && mouseY != 0) {\n mousepos.set(mouseX, mouseY);\n // Normalizing the result means a slow approch to the endpoint\n direction = mousepos.sub(midpoint).normalize();\n midpoint.add(direction);\n createProjection(width / 2, height / 2, midpoint.x, midpoint.y)\n }\n}", "function getProjectedPosition(width, height, position) {\r\n\t/*\r\n\t\tUsing the coordinates of a country in the 3D space, this function will\r\n\t\treturn the 2D coordinates using the camera projection method.\r\n\t*/\r\n\tposition = position.clone();\r\n\tvar projected = position.project(camera.object);\r\n\treturn {\r\n\t\tx: (projected.x * width) + width,\r\n\t\ty: -(projected.y * height) + height\r\n\t};\r\n}", "function ReSet(){\n\ttransform.position.x = ((tempLon * 20037508.34 / 180)/100)-iniRef.x;\n\ttransform.position.z = System.Math.Log(System.Math.Tan((90 + tempLat) * System.Math.PI / 360)) / (System.Math.PI / 180);\n\ttransform.position.z = ((transform.position.z * 20037508.34 / 180)/100)-iniRef.z; \n\tcam.position.x = ((tempLon * 20037508.34 / 180)/100)-iniRef.x;\n\tcam.position.z = System.Math.Log(System.Math.Tan((90 + tempLat) * System.Math.PI / 360)) / (System.Math.PI / 180);\n\tcam.position.z = ((cam.position.z * 20037508.34 / 180)/100)-iniRef.z; \n}", "function PerspectiveTransform( a11, a21, a31, a12, a22, a32, a13, a23, a33)\n{\n\tthis.a11 = a11;\n\tthis.a12 = a12;\n\tthis.a13 = a13;\n\tthis.a21 = a21;\n\tthis.a22 = a22;\n\tthis.a23 = a23;\n\tthis.a31 = a31;\n\tthis.a32 = a32;\n\tthis.a33 = a33;\n\tthis.transformPoints1=function( points)\n\t\t{\n\t\t\tvar max = points.length;\n\t\t\tvar a11 = this.a11;\n\t\t\tvar a12 = this.a12;\n\t\t\tvar a13 = this.a13;\n\t\t\tvar a21 = this.a21;\n\t\t\tvar a22 = this.a22;\n\t\t\tvar a23 = this.a23;\n\t\t\tvar a31 = this.a31;\n\t\t\tvar a32 = this.a32;\n\t\t\tvar a33 = this.a33;\n\t\t\tfor (var i = 0; i < max; i += 2)\n\t\t\t{\n\t\t\t\tvar x = points[i];\n\t\t\t\tvar y = points[i + 1];\n\t\t\t\tvar denominator = a13 * x + a23 * y + a33;\n\t\t\t\tpoints[i] = (a11 * x + a21 * y + a31) / denominator;\n\t\t\t\tpoints[i + 1] = (a12 * x + a22 * y + a32) / denominator;\n\t\t\t}\n\t\t}\n\tthis. transformPoints2=function(xValues, yValues)\n\t\t{\n\t\t\tvar n = xValues.length;\n\t\t\tfor (var i = 0; i < n; i++)\n\t\t\t{\n\t\t\t\tvar x = xValues[i];\n\t\t\t\tvar y = yValues[i];\n\t\t\t\tvar denominator = this.a13 * x + this.a23 * y + this.a33;\n\t\t\t\txValues[i] = (this.a11 * x + this.a21 * y + this.a31) / denominator;\n\t\t\t\tyValues[i] = (this.a12 * x + this.a22 * y + this.a32) / denominator;\n\t\t\t}\n\t\t}\n\n\tthis.buildAdjoint=function()\n\t\t{\n\t\t\t// Adjoint is the transpose of the cofactor matrix:\n\t\t\treturn new PerspectiveTransform(this.a22 * this.a33 - this.a23 * this.a32, this.a23 * this.a31 - this.a21 * this.a33, this.a21 * this.a32 - this.a22 * this.a31, this.a13 * this.a32 - this.a12 * this.a33, this.a11 * this.a33 - this.a13 * this.a31, this.a12 * this.a31 - this.a11 * this.a32, this.a12 * this.a23 - this.a13 * this.a22, this.a13 * this.a21 - this.a11 * this.a23, this.a11 * this.a22 - this.a12 * this.a21);\n\t\t}\n\tthis.times=function( other)\n\t\t{\n\t\t\treturn new PerspectiveTransform(this.a11 * other.a11 + this.a21 * other.a12 + this.a31 * other.a13, this.a11 * other.a21 + this.a21 * other.a22 + this.a31 * other.a23, this.a11 * other.a31 + this.a21 * other.a32 + this.a31 * other.a33, this.a12 * other.a11 + this.a22 * other.a12 + this.a32 * other.a13, this.a12 * other.a21 + this.a22 * other.a22 + this.a32 * other.a23, this.a12 * other.a31 + this.a22 * other.a32 + this.a32 * other.a33, this.a13 * other.a11 + this.a23 * other.a12 +this.a33 * other.a13, this.a13 * other.a21 + this.a23 * other.a22 + this.a33 * other.a23, this.a13 * other.a31 + this.a23 * other.a32 + this.a33 * other.a33);\n\t\t}\n\n}", "function findProjection(pos, a, b) {\n let v1 = p5.Vector.sub(a, pos);\n let v2 = p5.Vector.sub(b, pos);\n v2.normalize();\n let sp = v1.dot(v2);\n v2.mult(sp);\n v2.add(pos);\n return v2;\n}", "proj(vec1,vec2){\n\t\tlet res = this.dot(vec1,vec2);\n\t\tlet proj = vec2.map(x => x*res);\n\t\treturn proj;\n\t}", "projectPoint(xyz, w = 1.0) {\n if (this._worldToLocalPerspective)\n return this._worldToLocalPerspective.multiplyPoint3d(xyz, w);\n if (this._worldToLocalAffine)\n return this._worldToLocalAffine.multiplyXYZW(xyz.x, xyz.y, xyz.z, w);\n return Point4d_1.Point4d.createFromPointAndWeight(xyz, w);\n }", "project(xyz) {\n const {viewport} = this.context;\n const worldPosition = getWorldPosition(xyz, {\n viewport,\n modelMatrix: this.props.modelMatrix,\n coordinateOrigin: this.props.coordinateOrigin,\n coordinateSystem: this.props.coordinateSystem\n });\n const [x, y, z] = worldToPixels(worldPosition, viewport.pixelProjectionMatrix);\n return xyz.length === 2 ? [x, y] : [x, y, z];\n }", "function projectionClip(model) {\n var projection = model.component.projection;\n return projection && !projection.isFit ? true : undefined;\n }", "constructor() {\n this.projection = d3.geoConicConformal().scale(150).translate([400, 350]);\n this.map = d3.select('#map');\n this.mapPoints = d3.select('#points');\n }", "function projectPoint(modelViewMatrix, projMatrix, viewport, src, dest) {\n\tif (!dest)\n\t\tdest = new Float32Array(3);\n\n\t_v0[0] = src[0]; _v0[1] = src[1]; _v0[2] = src[2]; _v0[3] = 1;\n\n\t// transform point from model space to clip space\n\ttransformVector4(modelViewMatrix, _v0, _v1);\n\ttransformVector4(projMatrix, _v1, _v0);\n\n\t/* to normalized device coordinates */\n\t_v0[0] /= _v0[3];\n\t_v0[1] /= _v0[3];\n\t_v0[2] /= _v0[3];\n\n\t/* to window coordinates */\n\tdest[0] = viewport[0] + 0.5 * (1 + _v0[0]) * viewport[2];\n\tdest[1] = -viewport[1] + 0.5 * (1 - _v0[1]) * viewport[3];\n\tdest[2] = 0.5 * (1 + _v0[2]);\n\n\treturn dest;\n}", "function transform() { \n return d3.geoTransform({\n point: function(x, y) {\n if(x && y) {\n var point = map.latLngToLayerPoint(new L.LatLng(y, x));\n this.stream.point(point.x, point.y);\n }\n }\n })\n }", "project(mode) {\n this.mode = mode;\n let controlsOpts = this.controls;\n\n let aspect = this.aspect;\n //let frustumSize = controlsOpts.boxHeight;\n let distance = controlsOpts.distance;\n\n if (mode === 'perspective') {\n this._camera = new PerspectiveCamera(this.fov, this.aspect, this.near, this.far);\n //默认绘制的物体是贴近近裁面的,根据近裁面呈现高度为frustumSize的物体需要相机位置\n //let centerPosition = new Vector3(0, 0, (this.far - this.near)/2);\n\n\n // let vFOV = _Math.degToRad(this.fov); // convert vertical fov to radians\n\n // var dist = frustumSize / (2 * Math.tan(vFOV / 2));\n this._camera.position.set(0, 0, distance);\n\n\n\n } else {\n //给定一个大的投影空间,方便数据的计算\n //this._camera = new OrthographicCamera(frustumSize * aspect / -2, frustumSize * aspect / 2, frustumSize / 2, frustumSize / - 2, this.near, this.far);\n this._camera = new OrthographicCamera(controlsOpts.boxWidth / -2, controlsOpts.boxWidth / 2, controlsOpts.boxHeight / 2, controlsOpts.boxHeight / - 2, this.near, this.far);\n this._camera.position.set(0, 0, distance);\n }\n\n // console.info(\"getVisableSize\", this.getVisableSize());\n\n }", "function mousemove() {\n\t\n \n\tif ( (self.projection=='orthographic')\n\t\t|| (self.projection=='azimuthalEqualArea'))\n\t{\n\t\tvar p = d3.mouse(this);\n\t\tprojection.rotate([λ(p[0]), φ(p[1])]);\n\t\t//projection.rotate([λ(p[0]), 0]);\n\t\tself.svg.selectAll(\"path\").attr(\"d\", path);\n\t\t\n\t}\n\telse\n\t{\n\t\t\n\t}\n}", "static getProjection(a, b, c) {\n\t\tlet uVector = a.clone().sub(b);\n\t\tlet vVector = c.clone().sub(b);\n\t\tlet vDistance = b.distanceTo(c);\n\t\treturn uVector.dot(vVector) / vDistance;\n\t}", "function angleOfProjectionChange(scope) {\n var bullet_case_tween = createjs.Tween.get(getChild(\"bullet_case\")).to({\n rotation: (-(scope.angle_of_projection))\n }, 500); /** Tween rotation of bullet case, with respect to the slider angle value */\n\tvar bullet_case_tween = createjs.Tween.get(getChild(\"case_separate\")).to({\n rotation: (-(scope.angle_of_projection))\n }, 500); /** Tween rotation of bullet case, with respect to the slider angle value */\n bullet_moving_theta = scope.angle_of_projection + 10; /** Bullet moving angle */\n calculation(scope); /** Value calculation function */\n scope.erase_disable = true; /** Disable the erase button */\n}", "function proj(coord){\n var x = (coord[0] - min_lon) / lon_width;\n var y = (coord[1] - min_lat) / lat_width;\n\n return [x * width, y * height]; \n}", "function updateProjectionMatrix() {\r\n let aspect = gl.canvas.width / gl.canvas.height;\r\n let p = mat4.perspective(mat4.create(), Math.PI / 4, aspect, 0.1, 10);\r\n gl.uniformMatrix4fv(gl.program.uProjectionMatrix, false, p);\r\n}", "adjust() {\n this.custom_adjust();\n glMatrix.mat4.perspective(this.projection_matrix, glMatrix.glMatrix.toRadian(tracker.camera.fovy), tracker.camera.aspect, tracker.camera.near, tracker.camera.far);\n glMatrix.mat4.lookAt(this.view_matrix, tracker.camera.eye_point, tracker.camera.aim_point, tracker.camera.up_vector);\n // glMatrix.mat4.identity(this.model_matrix);\n glMatrix.mat4.multiply(this._mvp_matrix, this.projection_matrix, this.view_matrix);\n }", "function solveProjection(coords) {\n var a = [];\n var b = [];\n for (var i = 0; i < 4; i++) {\n var c = coords[i];\n a.push([c.sx, c.sy, 1, 0, 0, 0, -c.sx*c.tx, -c.sy*c.tx]);\n a.push([0, 0, 0, c.sx, c.sy, 1, -c.sx*c.ty, -c.sy*c.ty]);\n b.push(c.tx);\n b.push(c.ty);\n }\n return solveSystem(a, b);\n}", "function zoom(scroll){\r\n if(!orthoProj){\r\n if(scroll > 0){\r\n fov-=1;\r\n }else{\r\n fov+=1;\r\n }\r\n gl = main();\r\n drawObjects();\r\n }\r\n \r\n return false;\r\n}", "function click() {\n var latlon = projection.invert(d3.mouse(this));\n // console.log(latlon);\n}" ]
[ "0.77571934", "0.74693274", "0.7116867", "0.7026151", "0.69559216", "0.6946876", "0.67370814", "0.6711519", "0.66908246", "0.6643252", "0.66186327", "0.65798026", "0.64972615", "0.6494067", "0.64783114", "0.6438363", "0.6384972", "0.63781357", "0.63355273", "0.6334939", "0.6327553", "0.6293036", "0.6293036", "0.6293036", "0.62900794", "0.62764496", "0.6274433", "0.6274433", "0.62700915", "0.62486047", "0.62421644", "0.6230116", "0.620639", "0.61776406", "0.6157373", "0.6157373", "0.6157373", "0.6157373", "0.6157373", "0.6157373", "0.61485296", "0.61249185", "0.60909224", "0.6079464", "0.60596293", "0.60467285", "0.60427374", "0.6035961", "0.6011726", "0.5996262", "0.59872645", "0.5980998", "0.5974151", "0.59719914", "0.5952546", "0.594684", "0.59344715", "0.5923898", "0.5921044", "0.5916625", "0.5915887", "0.5902083", "0.5897308", "0.5894534", "0.58861226", "0.58861226", "0.58861226", "0.58861226", "0.58861226", "0.58861226", "0.58861226", "0.58861226", "0.58861226", "0.58861226", "0.58861226", "0.5869016", "0.5849662", "0.5848491", "0.58453184", "0.58360237", "0.5807943", "0.5790385", "0.5783658", "0.5782557", "0.5756471", "0.57404083", "0.573269", "0.5727575", "0.5696922", "0.5693831", "0.56820005", "0.5653611", "0.5634166", "0.5633267", "0.5628863", "0.5612775", "0.5611027", "0.56030303", "0.5594978", "0.55873215" ]
0.59893095
50
Copyright (C) 2002 2023 CERN Indico is free software; you can redistribute it and/or modify it under the terms of the MIT License; see the LICENSE file for more details.
function _revert_element(ui) { // make element assume previous size if (ui.originalSize) { ui.helper.height(ui.originalSize.height); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "transient private protected internal function m182() {}", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "protected internal function m252() {}", "transient private internal function m185() {}", "transient protected internal function m189() {}", "static transient final private internal function m43() {}", "transient private protected public internal function m181() {}", "static transient final protected internal function m47() {}", "static transient final protected public internal function m46() {}", "static final private internal function m106() {}", "function test_candu_graphs_datastore_vsphere6() {}", "obtain(){}", "constructor() {\n\t}", "constructor() {\n\t}", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n\n\t}", "transient final protected internal function m174() {}", "transient final private protected internal function m167() {}", "function _____SHARED_functions_____(){}", "static transient final private protected internal function m40() {}", "transient final private internal function m170() {}", "function DWRUtil() { }", "constructor () { super() }", "transient private public function m183() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "static private internal function m121() {}", "consructor() {\n }", "function Pythia() {}", "constructor() {\n\t\t// ...\n\t}", "static create () {}", "constructor() {\n throw new Error('Not implemented');\n }", "function version(){ return \"0.13.0\" }", "init() {\n }", "init() {\n }", "transient final private protected public internal function m166() {}", "info() { }", "obtenerHortalizas() {\nthrow new Error('No implementado todavía');\n}", "constructor() { }", "constructor() { }" ]
[ "0.599635", "0.5771029", "0.5695821", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.566046", "0.5625217", "0.55757934", "0.5417697", "0.53534055", "0.52763313", "0.5248068", "0.5247076", "0.5243186", "0.52300775", "0.52260786", "0.5204227", "0.5204227", "0.5203536", "0.5203536", "0.5203536", "0.5203536", "0.5203536", "0.5203536", "0.5203536", "0.5203536", "0.5203536", "0.5203536", "0.5203536", "0.5203536", "0.5203536", "0.5203536", "0.5203536", "0.5203536", "0.5203536", "0.5203536", "0.5203536", "0.5203536", "0.51920766", "0.5189144", "0.5145668", "0.5142854", "0.51309407", "0.51276785", "0.5119616", "0.51089674", "0.51082444", "0.5097073", "0.5097073", "0.5097073", "0.5097073", "0.5097073", "0.5097073", "0.50824547", "0.507194", "0.5063089", "0.5058599", "0.50440556", "0.49878168", "0.49870476", "0.4987032", "0.4987032", "0.49821824", "0.49799752", "0.49684262", "0.49503285", "0.49503285" ]
0.0
-1
handle the resize event from the body
function resize(){ myp5.resize(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleResize(){\r\n console.log(\"I've been resized\")\r\n}", "function handleResize(event) {\r\n console.log(event);\r\n}", "onResize () {}", "resizeListener() {\n this.windowWidth = global.innerWidth;\n this._checkFixedNeeded();\n }", "onResize_() {\n dispatcher.getInstance().dispatchEvent(new GoogEvent(EventType.RESIZE));\n }", "function resizeEvent() {\n\t debounce(function() {\n\t updateResizableElements(null);\n\t });\n\t}", "function resizeHandler(){\n //checking if it needs to get responsive\n responsive();\n\n // rebuild immediately on touch devices\n if (isTouchDevice) {\n var activeElement = $(document.activeElement);\n\n //if the keyboard is NOT visible\n if (!activeElement.is('textarea') && !activeElement.is('input') && !activeElement.is('select')) {\n var currentHeight = $window.height();\n\n //making sure the change in the viewport size is enough to force a rebuild. (20 % of the window to avoid problems when hidding scroll bars)\n if( Math.abs(currentHeight - previousHeight) > (20 * Math.max(previousHeight, currentHeight) / 100) ){\n FP.reBuild(true);\n previousHeight = currentHeight;\n }\n }\n }else{\n //in order to call the functions only when the resize is finished\n //http://stackoverflow.com/questions/4298612/jquery-how-to-call-resize-event-only-once-its-finished-resizing\n clearTimeout(resizeId);\n\n resizeId = setTimeout(function(){\n FP.reBuild(true);\n }, 350);\n }\n }", "function resizeHandler() {\n //checking if it needs to get responsive\n responsive();\n\n // rebuild immediately on touch devices\n if (isTouchDevice) {\n var activeElement = $(document.activeElement);\n\n //if the keyboard is NOT visible\n if (!activeElement.is('textarea') && !activeElement.is('input') && !activeElement.is('select')) {\n var currentHeight = $window.height();\n\n //making sure the change in the viewport size is enough to force a rebuild. (20 % of the window to avoid problems when hidding scroll bars)\n if (Math.abs(currentHeight - previousHeight) > (20 * Math.max(previousHeight, currentHeight) / 100)) {\n reBuild(true);\n previousHeight = currentHeight;\n }\n }\n } else {\n //in order to call the functions only when the resize is finished\n //http://stackoverflow.com/questions/4298612/jquery-how-to-call-resize-event-only-once-its-finished-resizing\n clearTimeout(resizeId);\n\n resizeId = setTimeout(function() {\n reBuild(true);\n }, 350);\n }\n }", "function handleResize() {\n // Set window width/height to state\n setWindowSize({\n width: window.outerWidth,\n height: window.outerHeight,\n });\n }", "$_initResizeEvent() {\n window.addEventListener('resize', this.$_resizeHandler)\n }", "function resizeHandler(){\n //checking if it needs to get responsive\n responsive();\n\n // rebuild immediately on touch devices\n if (isTouchDevice) {\n var activeElement = $(document.activeElement);\n\n //if the keyboard is NOT visible\n if (!activeElement.is('textarea') && !activeElement.is('input') && !activeElement.is('select')) {\n var currentHeight = $window.height();\n\n //making sure the change in the viewport size is enough to force a rebuild. (20 % of the window to avoid problems when hidding scroll bars)\n if( Math.abs(currentHeight - previousHeight) > (20 * Math.max(previousHeight, currentHeight) / 100) ){\n reBuild(true);\n previousHeight = currentHeight;\n }\n }\n }else{\n //in order to call the functions only when the resize is finished\n //http://stackoverflow.com/questions/4298612/jquery-how-to-call-resize-event-only-once-its-finished-resizing\n clearTimeout(resizeId);\n\n resizeId = setTimeout(function(){\n reBuild(true);\n }, 350);\n }\n }", "function resizeHandler(){\n //checking if it needs to get responsive\n responsive();\n\n // rebuild immediately on touch devices\n if (isTouchDevice) {\n var activeElement = $(document.activeElement);\n\n //if the keyboard is NOT visible\n if (!activeElement.is('textarea') && !activeElement.is('input') && !activeElement.is('select')) {\n var currentHeight = $window.height();\n\n //making sure the change in the viewport size is enough to force a rebuild. (20 % of the window to avoid problems when hidding scroll bars)\n if( Math.abs(currentHeight - previousHeight) > (20 * Math.max(previousHeight, currentHeight) / 100) ){\n reBuild(true);\n previousHeight = currentHeight;\n }\n }\n }else{\n //in order to call the functions only when the resize is finished\n //http://stackoverflow.com/questions/4298612/jquery-how-to-call-resize-event-only-once-its-finished-resizing\n clearTimeout(resizeId);\n\n resizeId = setTimeout(function(){\n reBuild(true);\n }, 350);\n }\n }", "function resizeHandler() {\n var layout = getLayoutFromSize(container.offsetWidth);\n if (layout !== container.dataset.grid) {\n container.dataset.grid = layout;\n listeners.forEach(function(listener) {\n listener();\n })\n }\n }", "function onWindowResize() {\n\n\t\t\t}", "function handleResize() {\n\t\t\t// Set window width/height to state\n\t\t\tsetWindowSize({\n\t\t\t\twidth: window.innerWidth,\n\t\t\t});\n\t\t}", "function handleResize() {\n // Set window width/height to state\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n\n }", "handleResize() {\n this.forceUpdate()\n }", "handleResize() {\n this.refresh();\n }", "function onWindowResize() {\n updateSizes();\n }", "function resizeEvents(){\r\n\r\n}", "function handleResize() {\n // Set window width/height to state\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n }", "function handleResize() {\n // Set window width/height to state\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n }", "function handleResize() {\n // Set window width/height to state\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n }", "function handleResize() {\n // Set window width/height to state\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n }", "function handleResize() {\n // Set window width/height to state\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n }", "function handleResize() {\n // Set window width/height to state\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n }", "function handleResize() {\n // Set window width/height to state\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n }", "function handleResize() {\n // Set window width/height to state\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n }", "function handleResize() {\n // Set window width/height to state\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n }", "function UIResizeEvent(){\n\n }", "_onResize () {\n }", "resize(size, evt) { console.log('Resize callback'); }", "function resizeHandler(){\r\n //checking if it needs to get responsive\r\n responsive();\r\n\r\n // rebuild immediately on touch devices\r\n if (isTouchDevice) {\r\n var activeElement = $(document.activeElement);\r\n\r\n //if the keyboard is NOT visible\r\n if (!activeElement.is('textarea') && !activeElement.is('input') && !activeElement.is('select')) {\r\n var currentHeight = $window.height();\r\n\r\n //making sure the change in the viewport size is enough to force a rebuild. (20 % of the window to avoid problems when hidding scroll bars)\r\n if( Math.abs(currentHeight - previousHeight) > (20 * Math.max(previousHeight, currentHeight) / 100) ){\r\n reBuild(true);\r\n previousHeight = currentHeight;\r\n }\r\n }\r\n }else{\r\n //in order to call the functions only when the resize is finished\r\n //http://stackoverflow.com/questions/4298612/jquery-how-to-call-resize-event-only-once-its-finished-resizing\r\n clearTimeout(resizeId);\r\n\r\n resizeId = setTimeout(function(){\r\n reBuild(true);\r\n }, 350);\r\n }\r\n }", "function resizeHandler(){\r\n //checking if it needs to get responsive\r\n responsive();\r\n\r\n // rebuild immediately on touch devices\r\n if (isTouchDevice) {\r\n var activeElement = $(document.activeElement);\r\n\r\n //if the keyboard is NOT visible\r\n if (!activeElement.is('textarea') && !activeElement.is('input') && !activeElement.is('select')) {\r\n var currentHeight = $window.height();\r\n\r\n //making sure the change in the viewport size is enough to force a rebuild. (20 % of the window to avoid problems when hidding scroll bars)\r\n if( Math.abs(currentHeight - previousHeight) > (20 * Math.max(previousHeight, currentHeight) / 100) ){\r\n reBuild(true);\r\n previousHeight = currentHeight;\r\n }\r\n }\r\n }else{\r\n //in order to call the functions only when the resize is finished\r\n //http://stackoverflow.com/questions/4298612/jquery-how-to-call-resize-event-only-once-its-finished-resizing\r\n clearTimeout(resizeId);\r\n\r\n resizeId = setTimeout(function(){\r\n reBuild(true);\r\n }, 350);\r\n }\r\n }", "function resizeHandler(){\r\n //checking if it needs to get responsive\r\n responsive();\r\n\r\n // rebuild immediately on touch devices\r\n if (isTouchDevice) {\r\n var activeElement = $(document.activeElement);\r\n\r\n //if the keyboard is NOT visible\r\n if (!activeElement.is('textarea') && !activeElement.is('input') && !activeElement.is('select')) {\r\n var currentHeight = $window.height();\r\n\r\n //making sure the change in the viewport size is enough to force a rebuild. (20 % of the window to avoid problems when hidding scroll bars)\r\n if( Math.abs(currentHeight - previousHeight) > (20 * Math.max(previousHeight, currentHeight) / 100) ){\r\n reBuild(true);\r\n previousHeight = currentHeight;\r\n }\r\n }\r\n }else{\r\n //in order to call the functions only when the resize is finished\r\n //http://stackoverflow.com/questions/4298612/jquery-how-to-call-resize-event-only-once-its-finished-resizing\r\n clearTimeout(resizeId);\r\n\r\n resizeId = setTimeout(function(){\r\n reBuild(true);\r\n }, 350);\r\n }\r\n }", "function handleResize() {\n // Set window width/height to state\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n }", "function handleResize() {\n // Set window width/height to state\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n }", "function handleResize() {\n // Set window width/height to state\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n }", "function handleResize() {\n // Set window width/height to state\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n }", "function handleResize() {\n // Set window width/height to state\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n }", "function handleResize() {\n // Set window width/height to state\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n }", "function handleResize() {\n // Set window width/height to state\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n }", "function handleResize() {\n // Set window width/height to state\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n }", "function handleResize() {\n if (window?.innerWidth !== lastWidth.current) {\n const width = getSize();\n lastWidth.current = width;\n setWindowSize(width)\n }\n }", "function resizeListener() {\n window.onresize = function (e) {\n toggleMenuOff();\n selectedImg = null;\n };\n }", "function resizeHandler(){\r\n //checking if it needs to get responsive\r\n responsive();\r\n\r\n // rebuild immediately on touch devices\r\n if (isTouchDevice) {\r\n var activeElement = document.activeElement;\r\n\r\n //if the keyboard is NOT visible\r\n if (!matches(activeElement, 'textarea') && !matches(activeElement, 'input') && !matches(activeElement, 'select')) {\r\n var currentHeight = getWindowHeight();\r\n\r\n //making sure the change in the viewport size is enough to force a rebuild. (20 % of the window to avoid problems when hidding scroll bars)\r\n if( Math.abs(currentHeight - previousHeight) > (20 * Math.max(previousHeight, currentHeight) / 100) ){\r\n reBuild(true);\r\n previousHeight = currentHeight;\r\n }\r\n }\r\n }else{\r\n //in order to call the functions only when the resize is finished\r\n //http://stackoverflow.com/questions/4298612/jquery-how-to-call-resize-event-only-once-its-finished-resizing\r\n clearTimeout(resizeId);\r\n\r\n resizeId = setTimeout(function(){\r\n reBuild(true);\r\n }, 350);\r\n }\r\n }", "function handleResize() {\n // Set window width/height to state\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n })\n }", "_initResizeListener() {\n window.addEventListener('resize', () => this._onResize())\n }", "function resizeHandler(){\n \tif($('#nectar_fullscreen_rows.afterLoaded').length == 0) return false;\n //checking if it needs to get responsive\n responsive();\n\n // rebuild immediately on touch devices\n if (isTouchDevice) {\n var activeElement = $(document.activeElement);\n\n //if the keyboard is NOT visible\n if (!activeElement.is('textarea') && !activeElement.is('input') && !activeElement.is('select')) {\n var currentHeight = $window.height();\n\n //making sure the change in the viewport size is enough to force a rebuild. (20 % of the window to avoid problems when hidding scroll bars)\n /* nectar addition */ \n //if( Math.abs(currentHeight - previousHeight) > (20 * Math.max(previousHeight, currentHeight) / 100) ){\n FP.reBuild(true);\n previousHeight = currentHeight;\n //}\n /* nectar addition end */ \n }\n }else{\n //in order to call the functions only when the resize is finished\n //http://stackoverflow.com/questions/4298612/jquery-how-to-call-resize-event-only-once-its-finished-resizing\n clearTimeout(resizeId);\n\n /* nectar addition */ \n // resizeId = setTimeout(function(){\n FP.reBuild(true);\n // }, 230);\n }\n }", "bindResize() {\n const self = this;\n const el = $(suiController.scrollable)[0];\n // unit test programs don't have resize html\n if (!el) {\n return;\n }\n this._setMusicDimensions();\n // $(suiController.scrollable).height(window.innerHeight - $('.musicRelief').offset().top);\n\n window.addEventListener('resize', function () {\n self.resizeEvent();\n });\n\n let scrollCallback = (ev) => {\n self.handleScrollEvent(ev);\n };\n el.onscroll = scrollCallback;\n }", "_onResizeMe(e) {\n this._reflow();\n }", "function onWindowResize() {\n\tonAggregateResize();\n}", "function resizeListener() {\n window.onresize = function(e) {\n toggleMenuOff();\n };\n }", "handleWindowResize() {\n const { windowResizeDebounce } = this;\n clearTimeout(this.windowResizeListenerDebounce);\n this.windowResizeListenerDebounce = setTimeout(() => {\n const currentSizeMappingIndex = this.getCurrentSizeMappingIndex();\n if (currentSizeMappingIndex !== this.currentSizeMappingIndex) {\n if (!this.ghostMode) {\n this.refreshSlot();\n }\n this.currentSizeMappingIndex = currentSizeMappingIndex;\n }\n }, windowResizeDebounce);\n }", "_handleResizeH() {\n this._closeAll();\n this._calculateStyles();\n }", "_onResize(_contentRect) {\n // To be implemented.\n }", "_handleResize() {\n const that = this;\n\n function applyPosition() {\n that._applyPosition();\n }\n\n if (that.openMode === 'click') {\n window.addEventListener('resize', applyPosition);\n }\n else {\n window.removeEventListener('resize', applyPosition);\n }\n }", "function edgtfOnWindowResize() {\n }", "function handleResize() {\n // Set window width/height to state\n /*eslint-disable*/\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n });\n }", "listen() {\n EventManager.on('resize', this.onResize)\n }", "onWindowResize() {\n\t\tthis.windowHeight = this.getWindowHeight();\n\t\tthis.updatePosition();\n\t}", "function eltdfOnWindowResize() {\n\n }", "refresh() {\n this._resizeEventHandler();\n }", "resize(e) {\n ELEM.flush();\n this._listeners.byEvent.resize.forEach(_viewId => {\n const _ctrl = this._views[_viewId];\n if (this.isntNullOrUndefined(_ctrl) && this.isFunction(_ctrl.resize)) {\n _ctrl.resize();\n }\n });\n }", "resize(e) {\n ELEM.flush();\n this._listeners.byEvent.resize.forEach(_viewId => {\n const _ctrl = this._views[_viewId];\n if (this.isntNullOrUndefined(_ctrl) && this.isFunction(_ctrl.resize)) {\n _ctrl.resize();\n }\n });\n }", "resizeEnd() {\n this.options.container.addEventListener(\"mouseup\", (e) => {\n if (this.resizing) {\n this.resizing = false;\n this.options.container.removeEventListener(\"mousemove\", this.resizeHandler);\n if (this.handlers.resizeEnd)\n this.handlers.resizeEnd({\n target: this.targetElement,\n inputEvent: e,\n translate: [this.store.currentTranslate[0], this.store.currentTranslate[1]], // deep copy\n width: this.store.currentSize[0],\n height: this.store.currentSize[1],\n });\n }\n });\n }", "function onResize(){\n\t// Update new dimensions\n\tvar width = $(window).width();\n\tvar height = $(window).height();\n\t\n\t// Dispatch a resize event to all the elements\n\tdispatch.resize(width, height);\n\t\n\t// If a region was selected, updates also each chart\n//\tif(regionSelected.name)\n//\t\tdispatch.regionChange();\n\t\n\t//TODO: completare\n}", "function resized(e){\n\t\tif(GLB._isMobile){\n\t\t\t// if(!_burger) _burger = new BurgerIcon(_topMenu);\n\t\t}\n\t}", "function resizeHandler() {\n //\n // When we enter or leave fullscreen mode, we get two resize events.\n // When we get the first one, we don't know what our new size is,\n // so we just ignore it.\n //\n if (fullscreenView.offsetWidth === 0 && fullscreenView.offsetHeight === 0)\n return;\n\n if (currentView === fullscreenView) {\n currentFrame.resize();\n previousFrame.reset();\n nextFrame.reset();\n\n // We also have to reposition the frames to get the next and previous\n // frames the correct distance away from the current frame\n setFramesPosition();\n }\n}", "function onResize() {\n\t\tvar TITLE_BAR_HEIGHT = 35;\t// Height of the title bar\n\t\tvar CONTENT_WIDTH = 100;\t// Aspect ratio width of content (minus the titlebar)\n\t\tvar CONTENT_HEIGHT = 100;\t// Aspect ratio height of content (minus the titlebar)\n\t\tvar NB_PADDING = 20;\t\t// The white space padding between the HTML and the widget border\n\t\tvar BORDER_PADDING = 0;\t\t// Any border around the HTML\n\n\t\t// Timeout wrapper is needed to prevent the function from triggering another resize immediately\n\t\tsetTimeout(function() {\n\t\t\tvar ratio = elements.body.width() / CONTENT_WIDTH;\n\t\t\tvar actualHeight = ratio * CONTENT_HEIGHT + TITLE_BAR_HEIGHT;\n\t\t\t// Turn off undomanager so this 'seamless' resize doesn't get recorded\n\t\t\tNB.undomanager.setAutoRecord(false);\n\t\t\tNB.getHostObject().height = actualHeight + NB_PADDING + BORDER_PADDING;\n\t\t\tNB.undomanager.setAutoRecord(true);\n\t\t}, 10);\n\t}", "function onResize() {\n\t\t\tsetWidths();\n\t\t\trepositionStickyHead();\n\t\t\trepositionStickyCol();\n\t\t}", "function on_window_resize() {\n var t = this;\n window.setTimeout(function() {\n t.onResize();\n }, 350);\n }", "_setupResize () {\n this._resizeEvent = this.resize ? this.resize : this.resizeCanvas\n this._events['resize'] = {event: this._resizeEvent, context: window}\n }", "function handleResize() {\n setWindowWidth(window.innerWidth);\n }", "onResize(evt) {\n var event = document.createEvent('Event');\n event.initEvent('resize', true, true);\n this.refs.container.dispatchEvent(event)\n }", "function resizeHandler() {\n\tclearScrollLink();\n\tresize();\n\tstage.setHeight(boardSize);\n\tstage.setWidth(boardSize);\n\tdrawBoard(board);\n\twindow.location.href = '#game';\n}", "function handleResize () {\n if(typeof window != 'undefined'){\n setWidth(window.innerWidth)\n }\n }", "function resizeFunction(e) {\n that.resizeTo(e.pageX - offset.x, e.pageY - offset.y);\n }", "function onResize(event) {\n\tview.size = event.size; // currently seems to only work with the nightly-buidl\n}", "function onResize() {\n\trender();\n}", "_handleResize() {\n if ($('.navigation-mobile').is(':hidden')) {\n this._toggleMobileNav(false);\n }\n\n this._positionNavigation();\n this._navigationScroll(true);\n }", "function onWindowResize(event) {\n\n layout();\n\n }", "function onResize() {\n asyncDigestDebounced.add(checkWindowForRebuild);\n }", "static get listeners() {\n return {\n 'resize': '_resizeHandler'\n };\n }", "setupResize() {\n window.addEventListener('resize', this.resize.bind(this)); \n }", "_resizeHandler() {\n const that = this;\n\n that.$.scrollableContainer.refresh();\n }", "function onResize() {\n\tfm.resize();\n}", "_events() {\n $(window).on('resize.zf.interchange', Foundation.util.throttle(() => {\n this._reflow();\n }, 50));\n }", "function bindResize() {\n $(window).resize(function () {\n sizeScrollable();\n });\n }", "function _registerResizeListener ()\n {\n // need a debouncer\n var debounce;\n\n window.addEventListener('resize', function (e)\n {\n // wait for it\n if (debounce)\n clearTimeout(debounce);\n\n debounce = setTimeout(function ()\n {\n fluffyObjects.forEach(function (fluffyObject)\n {\n fluffyObject.updateContentSize();\n fluffyObject.updateContentPosition();\n });\n\n }, 100);\n });\n }", "function resize(e) {\n window.clearTimeout(resizetimer);\n resizetimer = setTimeout(function() {\n }, 60);\n }", "function __resize_window_event()\n{\n\t// Avoid wrong resize\n\tif ( window_width == window.innerWidth && window_height == window.innerHeight )\n\t\treturn;\n\twindow_width = window.innerWidth;\n\twindow_height = window.innerHeight;\n\t// Resize mapview\n\tvar wl = ( $('#col_left') ? $('#col_left').width() : 0 );\n\tvar wr = ( $('#col_right') ? $('#col_right').width() : 0 );\n\tvar w = window.innerWidth - wl - wr;\n\t$('#col_middle').css('left', wl );\n\t$('#col_middle').width( w );\n\t$('#col_middle').height( window.innerHeight );\n\t$('#col_left').height( window.innerHeight );\n\t$('#col_right').height( window.innerHeight );\n\t// Resize Processing\n\tresize_processing();\n\t//\n\t// TABS\n\t// Minus 5 buttons: Save, Discard, Brush, Stencil, Sticker\n\tvar tab_total_height = window.innerHeight - ({{style.buttonHeight}", "function doResize(){\n\t//$(document).trigger('beforeResize');\n\t// Reserved for centering elements, etc\n\t$(document).trigger('adm_resize');\n}", "function doResize(){\n\t//$(document).trigger('beforeResize');\n\t// Reserved for centering elements, etc\n\t$(document).trigger('adm_resize');\n}", "function resizeHandler(evt) {\r\n var self = evt.data;\r\n var resizeTimeout = null;\r\n var period = 250;\r\n if (resizeTimeout !== null) {\r\n window.clearTimeout(resizeTimeout);\r\n resizeTimeout = window.setTimeout(function() {\r\n self.render();\r\n resizeTimeout = null;\r\n }, period);\r\n } else {\r\n self.render();\r\n resizeTimeout = window.setTimeout(function() {\r\n resizeTimeout = null;\r\n }, period);\r\n }\r\n }", "function windowResized() {\n resize();\n redraw();\n}", "function winResize() {\n window.addEventListener(\"resize\", debounce(function() {\n }, 500));\n }", "_setWindowResize() {\n if (this.resizeEvent) return\n this.resizeEvent = true\n window.onresize = () => {\n this.resizeCallbacks.forEach(cb => cb())\n }\n }", "_resizeContent(e) {\n // fake a resize event to make contents happy\n async.microTask.run(() => {\n window.dispatchEvent(new Event(\"resize\"));\n });\n }", "_resizeHandler() {\n const that = this;\n\n that.$.container.style.width = that.$.container.style.height = Math.min(that.offsetWidth, that.offsetHeight) + 'px';\n }", "resizeHandler () {\n this.updateWebGl();\n }" ]
[ "0.80259335", "0.7839376", "0.7693922", "0.765212", "0.75670177", "0.75613886", "0.7552233", "0.74986714", "0.74927205", "0.7467986", "0.7463169", "0.7463169", "0.74587214", "0.745521", "0.74495757", "0.7447943", "0.74395967", "0.74326617", "0.74325967", "0.741904", "0.7405335", "0.7405335", "0.7405335", "0.7405335", "0.7405335", "0.7405335", "0.7405335", "0.7405335", "0.73990035", "0.7385956", "0.7382691", "0.7379018", "0.73732555", "0.73732555", "0.73732555", "0.7363729", "0.7363729", "0.7363729", "0.7363729", "0.7363729", "0.7363729", "0.7363729", "0.7363729", "0.73470336", "0.7338398", "0.7327529", "0.72998244", "0.7299598", "0.72950524", "0.7265153", "0.7260795", "0.72605175", "0.7236753", "0.71858627", "0.7184487", "0.7178766", "0.71765685", "0.71743375", "0.7157982", "0.71567434", "0.71464264", "0.7144737", "0.71247095", "0.7103105", "0.7103105", "0.71010077", "0.70979273", "0.70921266", "0.70899993", "0.708224", "0.704329", "0.7041242", "0.7021302", "0.70126104", "0.7001496", "0.69969577", "0.6984731", "0.6971447", "0.69565123", "0.69500047", "0.6938505", "0.6921577", "0.6915742", "0.6904259", "0.69014764", "0.68891436", "0.688406", "0.6859613", "0.6857496", "0.683757", "0.6835944", "0.68308914", "0.68297", "0.68297", "0.6829181", "0.68235475", "0.6811744", "0.6809288", "0.6806891", "0.6806871", "0.6806537" ]
0.0
-1
A clickable object inBounds returns true if coordinates are within the bounds of the object optional `canMouseOver` allowing a function to state whether an object can be moused over or not. The `canMouseOver` function should return a boolean.
function GameObject(x1, x2, y1, y2, wall, click, canMouseOver) { this.x1 = x1; this.x2 = x2; this.y1 = y1; this.y2 = y2; this.wall = wall; this.click = click || function() {}; this.inBounds = function(x, y) { return (this.x1 <= x && this.x2 >= x && this.y1 <= y && this.y2 >= y); }; this.canMouseOver = canMouseOver || function() {return true;}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isWithinBounds(bbox) {\n return (\n this.mouseX >= bbox.left &&\n this.mouseX <= bbox.left + bbox.width &&\n this.mouseY >= bbox.top &&\n this.mouseY <= bbox.top + bbox.height\n );\n }", "function inBounds(xMouse, yMouse, x,y,width, height){\r\n if(xMouse > x &&\r\n xMouse < x+width &&\r\n yMouse > y &&\r\n yMouse < y+height){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }", "function isWithinBounds(e, rect) {\n return (e.clientX >= rect.left &&\n e.clientX <= rect.left + rect.width &&\n e.clientY >= rect.top &&\n e.clientY <= rect.top + rect.height);\n}", "isWithinBounds(bbox) {\n return this.mouseX >= bbox.left && this.mouseX <= bbox.left + bbox.width && this.mouseY >= bbox.top && this.mouseY <= bbox.top + bbox.height;\n }", "clickWithinBoundsHandler(event){\n const offsetLeft = document.getElementById(\"canvas\").offsetLeft;\n const offsetTop = document.getElementById(\"canvas\").offsetTop;\n\n if (\n event.clientX-offsetLeft >= this.bounds.xMin\n && event.clientX-offsetLeft <= this.bounds.xMax\n && event.clientY-offsetTop >= this.bounds.yMin\n && event.clientY-offsetTop <= this.bounds.yMax\n ) {\n // executes the action that was registered for these boundaries, then resets them\n this.bounds.action();\n this.bounds = {};\n }\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}", "boundsCheck(xM, yM, x, y, w, h){ \n if(xM > x && xM < x + w && yM > y && yM < y+ h){\n return true; //mouse in boundary \n }else{\n return false; //mouse not in boundary \n } \n}", "function isInBounds(pos, bounds){\n if (\n (bounds.minx !== undefined && pos.x < bounds.minx) || \n (bounds.maxx !== undefined && pos.x > bounds.maxx) || \n (bounds.miny !== undefined && pos.y < bounds.miny) || \n (bounds.maxy !== undefined && pos.y > bounds.maxy)\n ){\n return false\n }else{\n return true\n }\n}", "boundsCheck(xM, yM, x, y, w, h){ \n if(xM > x && xM < x + w && yM > y && yM < y+ h){\n return true; //mouse in boundary \n }else{\n return false; //mouse not in boundary\n }\n }", "function withinBounds(x, y, size_x, size_y) {\n if (x >= 0 && x <= size_x - 1 && y >= 0 && y <= size_y - 1) return true\n return false\n}", "function mouseInRect(a, b, c, d) {\n if (mouseX >= a && mouseX <= b && mouseY >= c && mouseY <= d) {\n return true;\n } else {\n return false;\n }\n}", "inBounds() {\n if (this.pos.x <= -50 || this.pos.x > 690 || this.pos.y <= -50 || this.pos.y > 690) {\n this.active = false;\n }\n }", "withinBounds(size) {\n return (\n this.x >= 0 &&\n this.y >= 0 &&\n this.x < size &&\n this.y < size\n )\n }", "function inRect(x, y, left, top, right, bottom) {\n\t\tif ((x > left) && (x < right) && (y > top) && (y < bottom)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function isInside() {\n //mouseX, mouseY\n\n\n\n return bool\n}", "inBoundary(mouseCoordinates){\n if (this.x <= mouseCoordinates.x && this.y<=mouseCoordinates.y) {\n const boxEdgeX = this.x + this.width;\n const boxEdgeY = this.y + this.height;\n if (mouseCoordinates.x <= boxEdgeX && mouseCoordinates.y <= boxEdgeY) {\n return true;\n }\n }\n return false;\n }", "function isInside(pos, rect){\n return pos.x > rect.x && pos.x < rect.x+rect.width && pos.y < rect.y+rect.height && pos.y > rect.y\n }", "intersects(bounds) {\n // Some size & offset adjustments to allow passage with bigger icon\n return this.sprite.offsetLeft + this.sprite.clientWidth - 20 > bounds.x\n && this.sprite.offsetLeft + 10 < bounds.x + bounds.width\n && this.sprite.offsetTop + this.sprite.clientHeight - 20 > bounds.y\n && this.sprite.offsetTop + 10 < bounds.y + bounds.height;\n }", "function isInside(pos, rect) {\n return pos.x > rect.x && pos.x < rect.x + rect.width && pos.y < rect.y + rect.height && pos.y > rect.y\n }", "inBounds(low, high) {\n if (this.x < low || this.x > high) return false;\n if (this.y < low || this.y > high) return false;\n return true;\n }", "function isInside(point, obj) {\n if ((point.x - obj.x) * (point.x - obj.x - obj.width) < 0) {\n if ((point.y - obj.y) * (point.y - obj.y - obj.height) < 0) {\n return true;\n }\n }\n return false;\n}", "function isInside(pos, rect) {\r\n return pos.x > rect.x && pos.x < rect.x + rect.width && pos.y < rect.y + rect.height && pos.y > rect.y\r\n }", "contains(mousePosition) {\n const mouseX = mousePosition.x;\n const mouseY = mousePosition.y;\n\n return (this.x <= mouseX) &&\n (this.x + this.width >= mouseX) &&\n (this.y <= mouseY) &&\n (this.y + this.height >= mouseY);\n }", "function pointInRect(px,py,obj, objectPosIsTopLeft) {\n\t//special case: assume objects without coordinates (ie. canvases) are at 0,0 use topLeft\n\tif (obj.x == null) {\n\t\treturn (px >= 0 && px < obj.width && py >= 0 && py < obj.height);\n\t}\n\tif (objectPosIsTopLeft) {\n\t\treturn (px >= obj.x && px < obj.x + obj.width && py >= obj.y && py < obj.y + obj.height);\n\t}\n\treturn (px >= obj.x - obj.width/2 && px < obj.x + obj.width/2\n\t\t\t&& py >= obj.y - obj.height/2 && py < obj.y + obj.height/2); \t\n}", "function inBounds(x, y, width, height, touchX, touchY) {\r\n if (touchX > x &&\r\n touchX < x + width &&\r\n touchY > y &&\r\n touchY < y + height) {\r\n return true;\r\n }\r\n return false;\r\n}", "function inBounds(x, y, width, height, touchX, touchY) {\r\n if (touchX > x &&\r\n touchX < x + width &&\r\n touchY > y &&\r\n touchY < y + height) {\r\n return true;\r\n }\r\n return false;\r\n}", "inside(x, y) {\n let box = this.bbox();\n return x > box.x && y > box.y && x < box.x + box.width && y < box.y + box.height;\n }", "function is_collision_with_mouse(object, mouseX, mouseY) {\n // Rectangle\n return (mouseX > object.x && mouseX < object.x + object.image.width && mouseY > object.y && mouseY < object.y + object.image.height);\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 overlapsAtOffset(obj, offsetX, offsetY) {\n\t\treturn !(\n\t\t\tthis.x + offsetX + this.boundingBox.left >= obj.x + obj.boundingBox.right ||\n\t\t\tthis.x + offsetX + this.boundingBox.right <= obj.x + obj.boundingBox.left ||\n\t\t\tthis.y + offsetY + this.boundingBox.top >= obj.y + obj.boundingBox.bottom ||\n\t\t\tthis.y + offsetY + this.boundingBox.bottom <= obj.y + obj.boundingBox.top\n\t\t);\n\t}", "isUnderMouse(raycaster) {\n if (this.isActive) {\n return raycaster.intersectObjects(this.objects, true).length > 0;\n }\n }", "function isClicked(clickedAbsolutePosition, targetRectangle, canvas, documentBody) {\n var x = getRelativePosition(clickedAbsolutePosition.x, canvas.offsetLeft, documentBody.scrollLeft);\n var y = getRelativePosition(clickedAbsolutePosition.y, canvas.offsetTop, documentBody.scrollTop);\n return isWithin(x, targetRectangle.minX, targetRectangle.maxX) && isWithin(y, targetRectangle.minY, targetRectangle.maxY);\n }", "function OnMouseOver(buttonRect : Rect):boolean{\n\tif(buttonRect.Contains(Event.current.mousePosition)){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\t\t\n}", "hitTest(mouseLoc) {\n if ( mouseLoc.x > this.loc.x &&\n mouseLoc.x < this.loc.x + this.myWidth &&\n mouseLoc.y > this.loc.y &&\n mouseLoc.y < this.loc.y + this.myHeight )\n return true;\n\n return false;\n}", "function _isEdgeInBounds(rect, bounds, edge) {\n var adjustedRectValue = _getRelativeRectEdgeValue(edge, rect);\n return adjustedRectValue > _getRelativeRectEdgeValue(edge, bounds);\n}", "function _isEdgeInBounds(rect, bounds, edge) {\n var adjustedRectValue = _getRelativeRectEdgeValue(edge, rect);\n return adjustedRectValue > _getRelativeRectEdgeValue(edge, bounds);\n}", "function inBounds(x, y){\r\n\t\t\t\tvar bounds = courseSlot.courseBox.getBoundingClientRect();\r\n\t\t\t\tif (x > bounds.left && x < bounds.right && y > bounds.top && y < bounds.bottom)\r\n\t\t\t\t\treturn true;\r\n\t\t\t\telse\r\n\t\t\t\t\treturn false;\r\n\t\t\t}", "function clickCollide(mouseRect, objectRect) {\n\tvar collide;\n\t\n\tif ((mouseRect.x + mouseRect.width) >= objectRect.x && mouseRect.x <= (objectRect.x + objectRect.width) && \n (mouseRect.y + mouseRect.height) >= objectRect.y && mouseRect.y <= (objectRect.y + objectRect.height)) {\n\t\tcollide = objectRect.name;\n\t}\n\t\n\treturn collide;\n}", "pointInBounds(x, y) {\n if (this.x1 < this.x2) {\n if ((x < this.x1) || (x > this.x2)) return false\n }\n else {\n if ((x < this.x2) || (x > this.x1)) return false\n }\n if (this.y1 < this.y2) {\n if ((y < this.y1) || (y > this.y2)) return false\n }\n else {\n if ((y < this.y2) || (y > this.y1)) return false\n }\n return true\n }", "inBounds(){\n if (this.pos.x <= 0) {\n this.pos.x = 0;\n }\n if (this.pos.y <= 0) {\n this.pos.y = 0;\n }\n if (this.pos.x >= width ) {\n this.pos.x = width;\n }\n if (this.pos.y >= height) {\n this.pos.y = height;\n }\n }", "function mousePosIsInSelectableArea(pos) {\n\t\tif(pos.x > leftMarg - 2 && pos.x <= leftMarg + drawW + 2 && pos.y > topMarg - 2 && pos.y <= topMarg + drawH + 2) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "_isWithinWorldBounds(bounds) {\n return (\n bounds.getWest() >= -180 &&\n bounds.getEast() <= 180 &&\n bounds.getSouth() >= -90 &&\n bounds.getNorth() <= 90\n )\n }", "function pointInCircleAndOutsideRectangle(args) {\n var x = +args[0],\n y = +args[1],\n output;\n\n var isInCircle = (x - 1) * (x - 1) + (y - 1) * (y - 1) <= (1.5 * 1.5);\n var isOutRectangle = (x >= -1 && x <= 5) && (y <= 1 && y >= -1);\n\n if (isInCircle) {\n output = 'inside circle ' + (isOutRectangle ? 'inside rectangle' : 'outside rectangle');\n } else {\n output = 'outside circle ' + (isOutRectangle ? 'inside rectangle' : 'outside rectangle');\n }\n\n console.log(output);\n}", "function isMouseOver(x,y,w,h){\n if (mouseX > x && mouseX < x+w && mouseY > y && mouseY < y+h) {\n return true;\n }else{\n return false;\n };\n}", "function drawBounds() {\n noFill();\n stroke(75, 75, 75, 10);\n box(bounds.x, bounds.y, bounds.z)\n}", "function inBounds(coord) {\n return coord.getX() < canvas.width && coord.getY() < canvas.height;\n}", "contains(mouseXPosition, mouseYPosition) {\n // All we have to do is make sure the Mouse X,Y fall in the area between\n // the shape's X and (X + Height) and its Y and (Y + Height)\n var xPosition = this.xPosition;\n var yPosition = this.yPosition;\n var width = this.lineHeight;\n var height = this.y2 - this.y1;\n return ((xPosition - this.utilityMargin) <= mouseXPosition) && (xPosition + width + this.utilityMargin >= mouseXPosition)\n && (yPosition <= mouseYPosition) && (yPosition + height >= mouseYPosition);\n }", "isInBounds(x, y, r = 5)\n\t{\n\t\tlet camera = this.tree.camera;\n\t\tlet zoom = camera.zoomSmooth;\n\n\t\tlet pos = this.posSmooth.toScreen(camera);\n\t\tlet width = this.width * zoom;\n\t\tlet height = this.height * zoom;\n\n\t\treturn x >= pos.x - r && x < pos.x + width + r && y >= pos.y - r\n\t\t\t&& y < pos.y + height + r;\n\t}", "function withinBounds() {\n return ballY > 0 && ballX < canvas.width && ballY < canvas.height;\n}", "inTileBounds () {\n let min = [ this.aabb[0], this.aabb[1] ];\n let max = [ this.aabb[2], this.aabb[3] ];\n\n if (!Utils.pointInTile(min) || !Utils.pointInTile(max)) {\n return false;\n }\n\n return true;\n }", "function checkWithinBounds(point, bounds) {\n for (let lim = 0; lim < 2; lim++) { // limit (0 = min; 1 = max)\n for (let dim = 0; dim < 2; dim++) { // dimension (0 = x; 1 = y)\n if (lim === 0 && point[dim] < bounds[lim][dim]) {\n return false\n } else if (lim === 1 && point[dim] > bounds[lim][dim]) {\n return false\n }\n }\n }\n return true\n}", "function isInsideOf(pos, rectArr){\r\n\tif(!pos) return false;\r\n\tif (pos.x < rectArr[0]) return false;\r\n\tif (pos.x > rectArr[0]+rectArr[2]) return false;\r\n\tif (pos.y < rectArr[1]-rectArr[3]) return false;\r\n\tif (pos.y > rectArr[1]) return false;\r\n\treturn true;\r\n}", "function hitBox( source, target ) {\n\treturn !(\n\t\t( ( source.y + source.height ) < ( target.y ) ) ||\n\t\t( source.y > ( target.y + target.height ) ) ||\n\t\t( ( source.x + source.width ) < target.x ) ||\n\t\t( source.x > ( target.x + target.width ) )\n\t);\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}", "collision(inObject) {\n\n // Abort if the player isn't visible (i.e., when they are 'splodin).\n if (!this.player.isVisible || !inObject.isVisible) { return false; }\n\n // Bounding boxes.\n const left1 = this.player.xLoc;\n const left2 = inObject.xLoc;\n const right1 = left1 + this.player.pixWidth;\n const right2 = left2 + inObject.pixWidth;\n const top1 = this.player.yLoc;\n const top2 = inObject.yLoc;\n const bottom1 = top1 + this.player.pixHeight;\n const bottom2 = top2 + inObject.pixHeight;\n\n // Bounding box checks. It isn't perfect collision detection, but it's good\n // enough for government work.\n if (bottom1 < top2) {\n return false;\n }\n if (top1 > bottom2) {\n return false;\n }\n if (right1 < left2) {\n return false;\n }\n return left1 <= right2;\n\n }", "function Position_Rect_ContainsRect(rect)\n{\n\t//check and confirm\n\treturn rect.left >= this.left && rect.right <= this.right && rect.top >= this.top && rect.bottom <= this.bottom;\n}", "isInside(pos, rect){\n return pos.x > rect.x && pos.x < rect.x+rect.width && pos.y < rect.y+rect.height && pos.y > rect.y && (this.lives==0 || this.level == this.levels.length)\n}", "function inRange(objA, objB) {\n let dx = Math.abs(objA.x - objB.x);\n let dy = Math.abs(objA.y - objB.y);\n let total = dx + dy;\n \n if(total < 1) {\n return true;\n }\n\n return false;\n}", "function areCoordinatesInBounds (body) {\n var coordsValid = isMarkerInSFRectangleBoundary(parseFloat(body['loc_lat']), parseFloat(body['loc_long']))\n if (coordsValid) {\n console.log('coord in SF: pass')\n return true\n } else {\n console.log('coord in SF: fail')\n return false\n }\n}", "function isInside(curs, dropTarget){\n\t // check for x, then y.\n\tvar dt_x = dropTarget.getX(), dt_y = dropTarget.getY();\n\t\n\treturn (curs.x >= dt_x && curs.x < dt_x + dropTarget.getWidth())\n\t\t&& // now check for y.\n\t\t(curs.y >= dt_y && curs.y < dt_y + dropTarget.getHeight());\n}", "boundsDoIntersect (Ax, Ay, Bx, By, Cx, Cy, Dx, Dy) {\n return Bx > Cx && Ax < Dx && By > Cy && Ay < Dy\n }", "testBounds(xM,yM,wid,heg,x,y){\n // test conditions for when xM and yM is inside boundary\n if(xM > x && xM < x+wid && yM > y && yM < y+heg){\n return true;\n }\n else{\n return false;\n }\n }", "getBounds(bounds) {\n if (this.objects !== undefined) {\n for (let i = 0; i < this.objects.length; i++) {\n this.objects[i].getBounds(bounds);\n }\n }\n }", "function isWithin(pointX, pointY, rectX1, rectX2, rectY1, rectY2) {\n // if all 4 of these conditions are true, then it was inside,\n // otherwise it was outside\n if ((pointX > rectX1) &&\t// to the right of the left edge\n (pointX < rectX2) &&\t// to the left of the right edge\n (pointY > rectY1) &&\t// below the top edge\n (pointY < rectY2)) {\t// above the bottom edge\n return true;\n } else {\n return false;\n }\n\n}", "function inFrame(_x, _y, _obj){\n\tif(_x > _obj.x && _x < _obj.x + _obj.w && _y > _obj.y && _y < _obj.y + _obj.h){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "mouseOverCheck(x,y){\n let d = dist(x,y,this.locX,this.locY);\n if(d<this.ballSize/2){return true;}\n else{return false;}\n }", "contains(_obj) {\n if (_obj instanceof HPoint) {\n return this._containsPoint(_obj);\n }\n else if (_obj instanceof HRect) {\n return this._containsRect(_obj);\n }\n else {\n throw new TypeError(`HRect#contains; Wrong argument type: ${typeof _obj}`);\n }\n }", "_rectIsHovered(rect, mouseOffsetPosition) {\n var positionWithinRect = getRelativePosition(mouseOffsetPosition, rect);\n return 0 <= positionWithinRect.left && positionWithinRect.left < rect.width && 0 <= positionWithinRect.top && positionWithinRect.top < rect.height;\n }", "function isWithinRange(num, rangeObject) {\n if (num >= rangeObject.min && num <= rangeObject.max) {\n return true;\n } else {\n return false;\n }\n}", "function isInsideClientRect(clientRect, x, y) {\n var top = clientRect.top,\n bottom = clientRect.bottom,\n left = clientRect.left,\n right = clientRect.right;\n return y >= top && y <= bottom && x >= left && x <= right;\n }", "within(a, b) {\n\t\tconst min = this.displayPosition;\n\t\tconst max = new NPoint(min.x + this.nodeDiv.clientWidth, min.y + this.nodeDiv.clientHeight);\n\t\treturn (min.x >= a.x && max.x <= b.x && min.y >= a.y && max.y <= b.y);\n\t}", "within(a, b) {\n\t\tconst min = this.displayPosition;\n\t\tconst max = new NPoint(min.x + this.nodeDiv.clientWidth, min.y + this.nodeDiv.clientHeight);\n\t\treturn (min.x >= a.x && max.x <= b.x && min.y >= a.y && max.y <= b.y);\n\t}", "objectVisible(o:ViewportObject) {\n\t\tif(o.x == null || o.y == null)\n\t\t\treturn true;\n\n\t\tif(this.pointVisible(o.x, o.y))\n\t\t\treturn true;\n\n\t\tif((o.x - this.origin.x > this._width * 2) || (o.x - this.origin.x < -this._width))\n\t\t\treturn false;\n\n\t\tif((o.y - this.origin.y > this._height * 2) || (o.y - this.origin.y < -this._height))\n\t\t\treturn false;\n\n\t\tlet bounds:?XY.Bounds;\n\n\t\tif(!o.getBounds) {\n\t\t\tif(o.x !== undefined && o.y !== undefined) {\n\t\t\t\treturn this.pointVisible(o.x, o.y);\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else {\n\t\t\tbounds = (o:any).getBounds();\n\t\t}\n\n\t\tif(!bounds.width || !bounds.height) {\n\t\t\t// either object has no width and height, or they are\n\t\t\t// undefined. Either way just evaluate the visibility as if it was a point\n\t\t\treturn this.pointVisible(bounds.x, bounds.y);\n\t\t} else {\n\t\t\t// we need to check the visibility of each corner of the bounds, if any is visible\n\t\t\t// then we say that the object is\n\t\t\treturn this.pointVisible(bounds.x, bounds.y) ||\n\t\t\t\tthis.pointVisible(bounds.x + bounds.width, bounds.y) ||\n\t\t\t\tthis.pointVisible(bounds.x, bounds.y + bounds.height) ||\n\t\t\t\tthis.pointVisible(bounds.x + bounds.width, bounds.y + bounds.height);\n\t\t}\n\t}", "isMouseOver() {\n return mouseX > this.x - this.w / 2 && mouseX < this.x + this.w / 2\n && mouseY > this.y - this.h / 2 && mouseY < this.y + this.h / 2;\n }", "function pointsInRect(arrNum) {\n let [x, y, xMin, xMax, yMin, yMax] = arrNum;\n console.log((x >= xMin && x <= xMax && y >= yMin && y <= yMax) ? \"inside\" : \"outside\");\n}", "hasGameObjectBeenPassed(object) {\n\t\tlet space = 80, width = window.innerWidth, height = window.innerHeight;\n\t\treturn object.y < -height / 3 - space\n\t\t\t|| object.x < -width * 3 / 4\n\t\t\t|| object.x > width * 3 / 4;\n\t}", "isInside(x,y) {\r\n return ((x >= 0) && (x < this.width) && (y >= 0) && (y < this.height));\r\n }", "function isVisible(obj) {\n return obj.x > -40 && obj.x < canvas.width + 40 &&\n obj.y > -40 && obj.y < canvas.height + 40;\n}", "isMouseOver(element) {\n if (!element) {\n element = this.$el\n }\n let { x, y } = this.$store.state.mousePosition\n let rect = element.getBoundingClientRect()\n return x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom\n }", "isMouseOver(){\n let x = this.position.x + this._width/2;\n let y = this.position.y + this._height/2;\n let h = mouseX;\n let k = mouseY;\n let ry = this._height/2;\n let rx = this._width/2;\n\n let ry2 = ry*ry;\n let rx2 = rx*rx;\n\n return ry2*(x-h)*(x-h) + rx2*(y-k)*(y-k) <= ry2*rx2; \n }", "function isMouseOverSymbol(pointX, pointY, rect) {\n\t\t\t if(rect.left <= pointX && pointX <= rect.left + rect.width)\n\t\t\t if(rect.top <= pointY && pointY <= rect.top + rect.height)\n\t\t\t return true;\n\t\t\t \n\t\t\t return false;\n\t\t\t}", "isInBounds() {\n\n if(this.position['x'] >= SnakeGame.NUM_COLS) {\n return false;\n }else if(this.position['x'] < 0) {\n return false;\n }else if(this.position['y'] >= SnakeGame.NUM_ROWS) {\n return false;\n }else if(this.position['y'] < 0) {\n return false;\n }\n\n return true;\n\n }", "in(x, y) {\n if (x >= this.x && x <= this.x + this.w && y >= this.y && y <= this.y + this.h) {\n return true\n }\n }", "function hit(a,b){\n\tvar hit = false;\n\tif(b.x + b.width >= a.x && b.x < a.x + a.width){\n\t\tif(b.y + b.height >= a.y && b.y < a.y + a.height){\n\t\t\thit = true;\n\t\t}\n\t}\n\tif(b.x <= a.x && b.x + b.width >= a.x + a.width){\n\t\tif(b.y <= a.y && b.y + b.height >= a.y + a.height){\n\t\t\thit = true;\n\t\t}\t\n\t}\n\tif(a.x <= b.x && a.x + a.width >= b.x + b.width){\n\t\tif(a.y <= b.y && a.y + a.height >= b.y + b.height){\n\t\t\thit = true;\n\t\t}\t\n\t}\n\t\n\treturn hit;\n}", "outsideBounds(s, bounds, extra) {\n let x = bounds.x, y = bounds.y, width = bounds.width, height = bounds.height;\n //The `collision` object is used to store which\n //side of the containing rectangle the sprite hits\n let collision = new Set();\n //Left\n if (s.x < x - s.width) {\n collision.add(\"left\");\n }\n //Top\n if (s.y < y - s.height) {\n collision.add(\"top\");\n }\n //Right\n if (s.x > width + s.width) {\n collision.add(\"right\");\n }\n //Bottom\n if (s.y > height + s.height) {\n collision.add(\"bottom\");\n }\n //If there were no collisions, set `collision` to `undefined`\n if (collision.size === 0)\n collision = undefined;\n //The `extra` function runs if there was a collision\n //and `extra` has been defined\n if (collision && extra)\n extra(collision);\n //Return the `collision` object\n return collision;\n }", "function checkBoxIsWithinBounds(xml, coordinates) {\n\tif (xml.getAttribute('min_lat') * 1 > coordinates.getSouth(),\n\t\txml.getAttribute('min_lon') * 1 > coordinates.getWest(),\n\t\txml.getAttribute('max_lat') * 1 < coordinates.getNorth(),\n\t\txml.getAttribute('max_lon') * 1 < coordinates.getEast()) {\n\t\treturn true;\n\t}\n\treturn false;\n}", "isInsideURect(x, y, rect) {\n if (x >= rect.X1 && x < rect.X2 && y >= rect.Y1 && y < rect.Y2) {\n return true;\n }\n else {\n return false;\n }\n }", "collide(obj) {\n if (this.x <= obj.x + obj.w &&\n obj.x <= this.x + this.w &&\n this.y <= obj.y + obj.h &&\n obj.y <= this.y + this.h\n ) {\n return true;\n }\n }", "function isInsideCircleOutsideRectangle(point) {\n return (isInsideCircle(point) && isOutsideRectangle(point)) ? 'yes' : 'no';\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 }", "intersects_rect(rect) {\n console.log(\"hitbox\",hb_rect(this,0));\n console.log(\"rectpos\",rect[0]);\n if ((hb_rect(rect,0) >= hb_rect(this,0) && hb_rect(rect,0) <= hb_rect(this,2))\n || (hb_rect(rect,2) >= hb_rect(this,0) && hb_rect(rect,2) <= hb_rect(this,2))) {\n if ((hb_rect(rect,1) >= hb_rect(this,1) && hb_rect(rect,1) <= hb_rect(this,3))\n || (hb_rect(rect,3)-1 >= hb_rect(this,1) && hb_rect(rect,3)-1 <= hb_rect(this,3))) {\n console.log(\"hit\");\n return true;\n }\n else {console.log(\"xhit\")}\n }\n else {console.log(\"nohit\")}\n return false;\n }", "function rectContains(rect, point) {\r\n return rect[TOP_LEFT][X] <= point[X] && point[X] <= rect[BOTTOM_RIGHT][X] &&\r\n rect[TOP_LEFT][Y] <= point[Y] && point[Y] <= rect[BOTTOM_RIGHT][Y];\r\n}", "clickedOn(xPos, yPos) {\n return(xPos > this.x && xPos < this.x + this.w && yPos > this.y && yPos < this.y +this.w);\n }", "isInBounds(x, y)\n\t{\n\t\tlet radius = this.node.tree.theme.plugRadius;\n\t\tradius = radius * radius * this.node.tree.camera.zoomSmooth;\n\n\t\treturn this.pos.toScreen(this.node.tree.camera)\n\t\t\t.distanceSquared(new NodeGraph.Position(x, y)) < radius;\n\t}", "hitCheck(a, b){ // colision\n var ab = a._boundsRect;\n var bb = b._boundsRect;\n return ab.x + ab.width > bb.x && ab.x < bb.x + bb.width && ab.y + ab.height > bb.y && ab.y < bb.y + bb.height;\n }", "isCollidingWith(object) {\n return (\n this.x < object.x + object.width && \n this.x + this.width > object.x &&\n this.y < object.y + object.height &&\n this.y + this.height > object.y\n );\n }", "hitTest(X, Y, OBJECT) {\r\n if (this.lightOn) {\r\n if (OBJECT.position.x > this.house.position.x && OBJECT.position.x < this.house.position.x + 250) {\r\n if (X > this.house.position.x && X < this.house.position.x + 300) {\r\n if (Y > this.house.position.y && Y < this.house.position.y + 300) {\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n return false;\r\n }", "mouseMoved(e){\n //Construct a very small rectangle on the mouse position\n var mouseRect = {x: e.clientX - 5, y: e.clientY - 5, width: 2, height: 2};\n\n //Check if the mouse rect collides with our button rectangle\n //And assign the bool that returns from the function\n this.highlighted = this.collides(this.rect, mouseRect);\n }", "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 checkBounds(x,y) {\n return ((0<=x) && (x<=maxX) && (0<=y) && (y<=maxY)); }" ]
[ "0.6698562", "0.6658099", "0.66138625", "0.6549332", "0.6488192", "0.6417664", "0.6412365", "0.6389542", "0.6364141", "0.6336381", "0.62612385", "0.625429", "0.6120905", "0.6113942", "0.6091119", "0.6088137", "0.6075966", "0.6065227", "0.60071784", "0.60041547", "0.5974089", "0.59258544", "0.5895536", "0.5886155", "0.5877278", "0.5877278", "0.5846887", "0.5841091", "0.5819316", "0.57686824", "0.575941", "0.5743289", "0.5693148", "0.56728196", "0.5631742", "0.5631742", "0.5619261", "0.5615182", "0.5602326", "0.55940187", "0.5592618", "0.5590083", "0.55892754", "0.55760735", "0.55478746", "0.5543403", "0.5538172", "0.5533536", "0.5522606", "0.5520189", "0.5506675", "0.5506638", "0.5501465", "0.5463243", "0.5453309", "0.5444066", "0.54410917", "0.5439022", "0.54387647", "0.5417538", "0.5411775", "0.5410511", "0.54076326", "0.5385907", "0.53790414", "0.5363526", "0.5356687", "0.53504443", "0.534165", "0.5337014", "0.5326028", "0.5326028", "0.53176683", "0.53110784", "0.5302482", "0.5300776", "0.52958333", "0.52874184", "0.52865857", "0.52706563", "0.52674663", "0.52658653", "0.52654445", "0.5249099", "0.52489215", "0.521776", "0.5213592", "0.5198945", "0.51982516", "0.5195342", "0.51867604", "0.51858747", "0.51851565", "0.5175588", "0.5169533", "0.5162062", "0.51588815", "0.51549596", "0.51475537", "0.5144305" ]
0.57125205
32
Using axios send a GET request to the address: Once the data is returned console.log it and review the structure. Iterate over the topics creating a new Tab component and add it to the DOM under the .topics element. The tab component should look like this: topic here
function tabMaker(topic) { const tab = document.createElement("div"); tab.classList.add("tab"); tab.textContent = topic; return tab; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTabData (url) {\n\n // Get tab data from url\n axios.get(url)\n .then( response => {\n\n // Get topics \n let topicContent = []; \n topicContent = response[\"data\"][\"topics\"];\n topicContent.unshift(\"all\")\n console.log(\"topic content:\", topicContent)\n\n // iterate through the array to create tabs\n for(i in topicContent){\n\n CreateTabs(topicContent[i]);\n\n }; \n\n })\n .catch( error => {\n console.log(\"Error:\", error); //console logs errors\n })\n\n}", "function getTabData (url) {\n\n // Get tab data from url\n axios.get(url)\n .then( response => {\n \n // Get topics \n let topicContent = []; \n topicContent = response[\"data\"][\"topics\"];\n \n // Create all the THINGS.......\n for(i in topicContent){\n\n CreateTabs(topicContent[i]);\n\n }; \n \n })\n .catch( error => {\n console.log(\"Error:\", error); // If there is an error, log it to the console.\n })\n\n}", "function getTopic(){\n fetch('http://localhost:3000/topic')\n .then(r => r.json())\n .then(topics => //console.log(topics))\n {\n topics.forEach(topic => addTopic(topic))\n })\n}", "function CreateTabs(tabTopic){\n\n // Get the main tab DIV\n let mainTabDiv = document.getElementsByClassName(\"topics\")[0];\n\n // Create a new DIV\n let newDiv = document.createElement('div');\n newDiv.classList.add('tab'); \n //newDiv.classList.add(tabTopic); \n newDiv.innerText = tabTopic;\n \n // Add the new DIV \n mainTabDiv.appendChild(newDiv);\n\n }", "function createTopic(){\n const newsTopics = document.createElement('div');\n newsTopics.classList.add('topics');\n\n \n\n const tTags = [];\n for(let i = 0; i < 7; i++){\n tTags.push(document.createElement('div'));\n }\n\n tTags[0].textContent = 'javascript';\n tTags[0].classList.add('tab');\n tTags[1].textContent = 'bootstrap';\n tTags[1].classList.add('tab');\n tTags[2].textContent = 'technology';\n tTags[2].classList.add('tab');\n\nnewsTopics.appendChild('.tab');\ntTags.forEach(div => newsTopics.appendChild(div.div));\n\n\n}", "renderTopics() {\n return (\n <ul class=\"topics-container\">\n {\n this.props.topics.items.map((topic) => {\n return (\n <li key={topic.id}>\n <Link to={`/topic/${topic.id}`}>{topic.title}</Link><small> {topic.description}</small>\n </li>\n );\n })\n }\n </ul>\n );\n }", "function openTopic(evt,topic) {\n let i, tabcontent, tablinks;\n\n tabcontent = document.getElementsByClassName(\"content\");\n for ( i = 0; i<tabcontent.length; i++){\n tabcontent[i].style.display = \"none\";\n }\n\n buttons = document.getElementsByTagName(\"button\");\n for (i = 0; i < buttons.length; i++) {\n buttons[i].className = buttons[i].className.replace(\"active\", \"\");\n }\n\n document.getElementById(topic).style.display = \"block\";\n evt.currentTarget.className = \"active\";\n\n}", "function buildTopics() {\n\n // Removes any text within the searchTopic div so that the text from the next item in the \n // array can be rendered\n $('#searchTopic').empty();\n\n // a for loop will continue for the length of the subjects object \n for (var i = 0; i < topics.subjects.length; i++) {\n // create a variable button that is equal to a button element in order to create dynamic\n // buttons in the page\n var button = $('<button>').addClass('topicsButtons');\n // to that button, add text that will be taken from the object subjects at each index\n button.text(topics.subjects[i].item);\n // add the attribute data-topic to each button so that each button's topic can be queried \n // using ajax by linking them together\n button.attr('data-topic', topics.subjects[i].item);\n // append the button that is created to the div with id = searchTopic so that it appears on the page\n $('#searchTopic').append(button);\n }\n }", "function tabCreator(topic) {\n const tab = document.createElement(\"div\");\n tab.classList.add(\"tab\");\n tab.textContent = topic;\n\n tab.addEventListener(\"click\", (event) => {\n\n const tabs = document.querySelectorAll(\".tab\");\n tabs.forEach((tab) => {\n tab.classList.remove(\"active-tab\");\n });\n\n event.target.classList.add(\"active-tab\");\n\n const cards = document.querySelectorAll(\".card\")\n cards.forEach((card) => {\n const tabValue = event.target.textContent === \"node.js\" ? \"node\" : event.target.textContent;\n\n if (tabValue === card.classList[1] || tabValue === \"all\")\n card.classList.remove(\"invisible\");\n else\n card.classList.add(\"invisible\");\n });\n });\n\n return tab;\n}", "function displayTopicInfo() {\n var topic = $(this).attr(\"data-name\");\n var queryURL = \"https://www.omdbapi.com/?t=\" && \"https://api.giphy.com/v1/gifs/search?q=\" + topic + \"&api_key=mAGrPIR6EkqS8JKrB22qgdxAZ5YBjzZS&limit=10\"; \n \n \n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n $(\"#topics-view\").text(JSON.stringify(response));\n });\n}", "function topicsList() {\n let areas = [\"sdp\", \"simulations\", \"skampi\"];\n let projectsUrl = new URL(\n \"https://gitlab.com/api/v4/groups/3180705/projects?\"\n );\n\n projectsUrl.searchParams.set(\"simple\", \"true\");\n projectsUrl.searchParams.set(\"archived\", \"false\");\n projectsUrl.searchParams.set(\"include_subgroups\", \"true\");\n projectsUrl.searchParams.set(\"all_available\", \"true\");\n projectsUrl.searchParams.set(\"per_page\", \"100\");\n\n // get all results and fill the tables\n fetchRequest(projectsUrl).then((data) => {\n for (const area of areas) {\n var list = $(\"#\" + area + \" table\");\n list.empty();\n // restrict the list to files with the right tag\n //\n const data_filtered = data.filter((a) => a.tag_list.includes(area));\n // sort by name\n //\n data_filtered.sort((a, b) => a[\"name\"].localeCompare(b[\"name\"]));\n // build the table\n //\n item = ProjectTable(data_filtered);\n $(item).appendTo(list);\n }\n });\n}", "function displayTopics() {\n $(\"#articles\").html(\"\");\n var queryURL = \"https://api.nytimes.com/svc/search/v2/articlesearch.json?api-key=b878d19230834a629ac5664c8efc2ee7&q=\" + searchKey + \"&begin_date=\"+ sYear + \"0101&end_date=\"+ eYear + \"1230&page=0\"\n\n $.ajax({\n url: queryURL,\n method: 'GET'\n }).done(function(data) {\n\n $(\"#articles\").append(\"Here are \" + records + \" articles about '\" + searchKey + \"'\").addClass(\"articleLength\");\n\n for (var i = 0; i < records ; i++) {\n var record = $(\"<li>\").addClass(\"record list-group-item\");\n record.append(\"<a class='articleHeader' href=\" + data.response.docs[i].web_url + \">\" + (i+1) + \". \" + data.response.docs[i].headline.main + \"</a>\");\n record.append(\"<p class='articleAuthor'>\" + data.response.docs[i].byline.original + \"</p>\");\n\n var articles = $(\"#articles\");\n articles.append(record);\n }\n });\n }", "async function getData(i) {\r\n const response = await fetch(i);\r\n const data = await response.json();\r\n // console.log(data);\r\n const tabContent = document.createElement('p');\r\n tabContent.classList.add('faq-text');\r\n const id = i.charAt(10);\r\n tabContent.setAttribute('id', `a${id}`);\r\n tabContent.textContent = data.item.content.join('');\r\n document.querySelector('.faq-content').append(tabContent);\r\n}", "function tabCreator(obj){\n let tabHolder = document.createElement('div');\n tabHolder.classList.add('tab');\n tabHolder.textContent = obj;\n let tabMainHolder = document.querySelector('.topics');\n tabMainHolder.appendChild(tabHolder);\n return tabMainHolder;\n}", "function show_topic(topic_name){\n hide_headlines();\n $.get('/api/topic/' + topic_name, function(data){redraw_page(data)});\n $('#nav_button').click();\n}", "componentDidMount() {\n this.getTopics();\n }", "loadTopics({commit}){\n HTTP.get('v1/api/topic', \n {\n handlerEnabled: true\n }\n ).\n then(response => response.data).\n then(topics => {\n commit('SET_TOPICS', topics)\n })\n }", "function relatedResources(data) {\n var $tabRelated = $(\"#tab-subjects\");\n $tabRelated.empty();\n $tabRelated.append('<h6>' + shanti.shanti_data.feature.header + '</h6>');\n var contentR = '<ul class=\"list-unstyled list-group\">';\n $.each(data.feature_relation_types, function(rInd, rElm) {\n contentR += '<li class=\"list-group-item\">' + capitaliseFirstLetter(rElm.label) + \" (\" + rElm.features.length + \"):\";\n contentR += '<ul class=\"list-group\">';\n $.each(rElm.features, function(rrInd, rrElm) {\n contentR += '<li class=\"list-group-item\"><a href=\"#id=' + rrElm.id + '&que=tab-overview\">' + rrElm.header + ' (From the General Perspective)</a></li>';\n });\n contentR += '</ul>';\n contentR += '</li>';\n });\n contentR += '</ul>';\n $tabRelated.append(contentR);\n}", "function newArticles() {\n var results = [];\n\n axios.get(\"https://talksport.com/football/\").then(function (response) {\n\n // Load the HTML into cheerio and save it to a variable\n // '$' becomes a shorthand for cheerio's selector commands, much like jQuery's '$'\n var $ = cheerio.load(response.data);\n\n // Select each element in the HTML body from which you want information.\n // NOTE: Cheerio selectors function similarly to jQuery's selectors,\n // but be sure to visit the package's npm page to see how it works\n $(\".teaser-item\").each(function (i, element) {\n\n var headline = $(element).children().find(\".teaser__headline\").text().trim();\n var summary = $(element).children().find(\".teaser__subdeck\").text().trim();\n var link = $(element).find(\"a\").attr(\"href\");\n\n\n // Save these results in an object that we'll push into the results array we defined earlier\n results.push({\n headline: headline,\n summary: summary,\n link: link,\n });\n });\n\n // Log the results once you've looped through each of the elements found with cheerio\n //console.log(results);\n for (var i = 0; i < results.length; i++) {\n db.Article.create({ \"headline\": results[i].headline, \"summary\": results[i].summary, \"link\": results[i].link }, function (err, resp) {\n if (err) {\n console.log(err);\n }\n //console.log(resp);\n });\n }\n\n });\n }", "function displayTopics() {\n for (var i = 0; i < topics.length; i++) {\n $('#buttons').append('<div class=\"btn btn-info get-giphy\" data-attribute=' + topics[i] +\n '>' + topics[i] +\n '</div>');\n }\n }", "function renderTopics() {\n\t$(\"#list_items\").html(\"\");\n\n\tfor (var key in topicsDictionary) {\n\t\tvar topicDiv = $(\"#template\").clone();\n\t\tvar topicButton = topicDiv.find(\"#work-template\");\n\t\tvar timeElapsed = topicDiv.find(\"#time-elapsed\");\n\n\t\ttimeElapsed.html(formatCounter(topicsDictionary[key].time));\n\t\ttopicButton.html(topicsDictionary[key].name);\n\t\ttopicButton.val(topicsDictionary[key].id);\n\t\ttopicButton.attr(\"id\", topicsDictionary[key].id);\n\t\ttopicDiv.attr(\"id\", \"work\"+topicsDictionary[key].id);\n\t\ttimeElapsed.attr(\"id\", \"time-elapsed-\"+topicsDictionary[key].id);\n\t\ttopicDiv.find(\"#edit-topic-input\").hide();\n\t\ttopicDiv.find(\"#time-note-group\").hide();\n\t\t$(\"#list_items\").append(topicDiv);\n\t\ttopicDiv.show();\n\t}\n\n\tsetActiveTopic();\n}", "async function setupAndStart() {\n \n showLoadingView();\n //get 100 categories from API\n const response = await axios.get('http://jservice.io/api/categories',{\n params: {\n\t\t\tcount: 100\n\t\t}\n });\n \n //get the catids\n let catIds = getCategoryIds(response);\n\n //checkpoint: see which catId pulled - console.log(catIds);\n\n //pull array from id\n for (let id of catIds){\n const clueCard = await axios.get(\"http://jservice.io/api/clues\", {\n\t\t\tparams: {\n category: id\n\t\t\t}\n });\n\n //checkpoint: see which clues pulled - console.log(clueCard);\n //Use catId to get data from clueCard \n getCategory(clueCard);\n }\n fillTable(categories);\n hideLoadingView();\n\n}", "get_articles_from_article_service() {\n\n this.context.context.ArticleService.get_articles({ topic: this.props.topic },\n (response) => {\n\n this.setState({ articles: response.articles, more: response.more });\n\n }\n )\n\n }", "function SubTopic(props) {\n const dispatch = useDispatch()\n const todos = useSelector(state => state.Todos)\n const projectTodos = todos.filter(todo => todo.project_name === props.title)\n\n \n if(projectTodos.length === 0){\n return ''\n }\n else {\n return (\n <div>\n <h5 className=\"projectName\"> {props.title} </h5>\n {projectTodos.map((value,index) => {\n return <ControlTab device={props.device} key={index} self_id={value.self_id} title={value.description} svg={value.svg} onClick={() => dispatch({type:'CHANGE_ACTUAL', self_id: value.self_id, todos:todos})} />\n })}\n \n </div>\n )}\n}", "function extractTopics(html){\n let selectorTool= cheerio.load(html);\n let topicsArr= selectorTool(`.topic-box.position-relative.hover-grow.height-full.text-center.border.color-border-secondary.rounded.color-bg-primary.p-5 a`);\n \n for(let i=0;i<topicsArr.length;i++){\n let link=selectorTool(topicsArr[i]).attr('href'); \n let fullLink=\"https://github.com\"+link; // Topics-link\n\n getRepositories(fullLink); \n }\n \n}", "async v2topictree() {\n ;`Retrieve an object with the following keys:\n articles: [],\n exercises: [],\n missions: [],\n topics: [],\n videos: []\n `\n const endpoint = \"/api/v2/topics/topictree\"\n return await this.fetchResource(endpoint, false, \"GET\")\n }", "function getArticles(){\n let articlesLength;\n fetch(url,{\n method: 'GET',\n headers: {\n 'Accept': 'text/html,application/xhtml+xml,application/xml,application/json',\n 'Content-Type': 'text/html,application/xhtml+xml,application/xml,application/json',\n }\n })\n .then(res => res.json())\n //.then(data => console.log(Object.entries(data)))\n .then(data => {\n let counter = 0;\n const HTMLarticles = document.getElementById('articlesView');\n articlesLength = data.length;\n while(counter < articlesLength){\n HTMLarticles.innerHTML = `<th>${data[counter].name}<th>`;\n counter++;\n }\n })\n then(data => console.log(data.name))\n .catch(err => console.error(err))\n }", "loadTabs() {\n fetch(\"/rest/tables/tabs\", {\n method: 'GET',\n credentials: 'include',\n })\n .then(res => res.json())\n .then(\n (result) => {\n const tabs = [{Table_name: 'tables'}, ...result];\n this.setState({\n tabsLoaded: true,\n tabs: tabs,\n tabsError: null\n });\n },\n (error) => {\n this.setState({\n tabsLoaded: true,\n tabsError: error,\n });\n }\n )\n }", "getTermsList() {\n axios.get('http://localhost:8000/api/terms').then(\n (res) => {\n this.setState({\n termsList:res.data.data\n })\n }\n ).catch(err => console.log(err))\n }", "showPub(id) {\n /*\n const pub_URL = `http://localhost:3000/pub/${id}.json`\n */\n const pub_URL = `/pub/${id}.json`\n axios.get(pub_URL)\n .then(response => {\n this.setState({pub: response.data})\n console.log();\n })\n .catch(console.warn)\n }", "function getTopics(callback){\n\t$.ajax({\n\t\turl : \"/CampusTalk/rest/CampusTalkAPI/getTopics\",\n\t\tdatatype:'json',\n\t\ttype: \"post\",\n\t\tcontentType: \"application/json\",\n\t\tdata: JSON.stringify({}),\n\t}).done(function(data){\n\t\tcallback(data);\n\t});\n}", "function renderButtons() {\n console.log(topics);\n // previous div elements are emptied\n $(\"#topics\").empty();\n // loop through array to create button for each topic\n for (var i = 0; i < topics.length; i++) { \n var buttons = $(\"<button>\");\n buttons.addClass(\"btn btn-info show\");\n buttons.attr(\"data-name\", topics[i]);\n buttons.text(topics[i]);\n $('#topics').append(buttons);\n } \n}", "getNumTopicsFn () {\n fetch(test_url + '/TM/topics', {\n mode: 'cors',\n method: 'GET'\n })\n .then((resp) => resp.json())\n .then(function (resp) {\n var numTopicsText = document.getElementById('numTopicsText');\n numTopicsText.innerHTML = resp['numberOfTopics'];\n })\n .catch(function (error) {\n console.log(JSON.stringify(error));\n });\n }", "mounted() {\n axios\n .get('https://flynn.boolean.careers/exercises/api/array/music')\n .then(data => {\n this.musics = data.data.response;\n });\n }", "function gotTopicDetailHTML(err, resp, html) {\n if (err) return console.error(err)\n var parser = cheerio.load(html)\n var realTag = parser('.display-post-tag-wrapper').text().split('\\n').toString().split('\\t').toString().split(',,,,,,,,,,,,,,,,,,,').toString().split(',,,,,,,,,,,,,,,,,').toString().split(',,,,,,,,,,,,,,,,').toString()\n topics.push({ title: parser('h2').text(), detail: parser('.display-post-story', '.main-post').text(), tags: realTag })\n if (count == maxTopic) {\n createCSV(topics)\n } else {\n console.log('Processing topic ' + count + '...')\n }\n count += 1\n}", "function loadTopics() {\n\n // set empty array\n storedOffset = [];\n topicWithDashesArr = [] // empty array to hold data-topics that have had spaces replaced with dashes.\n\n // set the base offset\n for (i = 0; i < topics.length; i++) {\n storedOffset.push(\"0\"); // for each item in topics, set a base offset of zero.\n }\n // convert the spaces in the topics and convert them to dashes\n for (i = 0; i < topics.length; i++) {\n topicReplace = topics[i].replace(/ /g, \"-\");\n topicWithDashesArr.push(topicReplace);\n }\n // this loop gathers the data-offsets per button\n for (i = 0; i < topics.length; i++) {\n if ($('button[data-topic=' + topicWithDashesArr[i] + ']').attr(\"data-offset\")) {\n var buttonOffset = $('button[data-topic=\"' + topicWithDashesArr[i] + '\"]').attr(\"data-offset\");\n storedOffset[i] = buttonOffset; // replaces the default 0 offset at the appropriate index into the stored array\n } else {\n // if no offset is defined for the button\n storedOffset.push(\"0\"); // set to 0 if undefined.\n }\n }\n\n // below here resets the buttons\n $(\"#topics\").empty();\n\n\n for (i = 0; i < topics.length; i++) {\n // create a new button\n newButton = $(\"<button>\");\n // add data-topic to button attribute\n newButton.attr(\"data-topic\", topicWithDashesArr[i]);\n // add pagination incrementing\n newButton.attr(\"data-offset\", storedOffset[i])\n // add bootstrap btn class\n newButton.addClass(\"btn\");\n // add the topic name to the button\n newButton.text(topics[i]);\n // Lastly append the new button to #gifs\n $(\"#topics\").append(newButton);\n }\n }", "function displayTopicInfo() {\n console.log(\"in displayTopicInfo\");\n var topic = $(this).attr(\"data-name\");\n console.log(\"topic = \" + topic);\n var queryURL = \"http://api.giphy.com/v1/gifs/search?l=10&q=\" + topic + \"&api_key=qt7hfQSsEX423SLcRsTU9j0P32dk7E38\";\n\n // Creating the AJAX call for the specific topic button being clicked and storing the response\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(\"response is \" + response);\n // storing the data from the AJAX request in the results variable\n // var results = response.data;\n console.log(\"response is \" + response);\n\n var topicDiv = $(\"<div class='topic'>\"); // Creating div to hold the topic\n $(\".rating\").text(\"Rating: \" + response.rating);\n $(\".images\").text(\"Humidity: \" + response.main.humidity);\n\n // let rating = results.data.rating; // Storing the rating data\n // console.log(results.data.rating);\n\n // Creating an element to display rating \n //let pOne = $(\"<p>\").text(\"Rating: \" + rating);\n\n // Displaying the rating\n // topicDiv.append(pOne);\n\n // Putting the entire topic above the previous topics\n $(\"#topics-view\").prepend(topicDiv);\n }); //store ajax call\n\n }", "getFullList() {\n axios\n .get(this.BASE_URL + \"/jokes\")\n .then(response => {\n //Clear the Joke Container\n document.getElementsByClassName(\"right-container\")[0].innerHTML = \"\";\n //Prevent the Page from Reloading\n event.preventDefault();\n response.data.forEach(joke => {\n //Display Each Joke\n this.displayJoke(joke);\n });\n })\n .catch(err => {\n console.error(err);\n });\n }", "function addTopics() {\n\t\tfor(i = 0 ; i < topics.length; i++) {\n\t\t\t$(\"#topics\").append(\"<button class='topic-button'>\"+topics[i]+\"</button>\");\n\t\t}\n\t}", "function TopicList(props) {\n return (\n <Container>\n <Accordion>\n <AccordionSummary>\n <Typography>\n <Span><strong>Topic Name:</strong>{props.name} </Span>\n <Span><strong>Stargazer count:</strong>{props.count} </Span>\n </Typography>\n </AccordionSummary>\n <AccordionDetails>\n <Typography>\n <div>\n <strong>Related Topics:</strong>\n {props.related.map((topic) => (\n < RelatedTopics relName = {topic.name} relCount = {topic.stargazerCount} />\n ))}\n </div>\n </Typography>\n </AccordionDetails>\n </Accordion>\n </Container>\n )\n}", "function getTeachingTexts(){\nfetch(\"http://anckdesign.com/kea/rossana/wp-json/wp/v2/teaching?categories=15&_embed\").then(e => e.json()).then(showSections);\n}", "async function loadTopics() {\n let courseID = document.getElementById(\"courseIdMod\").value.toString();\n let contentList = db.collection(\"courses\").doc(courseID).collection(\"content\").doc(\"contentLinks\");\n contentList.get().then((doc) => {\n if (doc.exists) {\n let dat = doc.data();\n dat.articlesIDs.forEach((element,i) => {\n const opt = \"<option name=\\\"\" + dat.articleTitles[i] + \"\\\" value=\\\"\" + element + \"\\\">\" + dat.articleTitles[i] + \"</option>\";\n let dom = new DOMParser().parseFromString(opt,'text/html');\n let opt_element = dom.body.firstElementChild;\n document.getElementById('subtopics').append(opt_element);\n });\n } else {\n // doc.data() will be undefined in this case\n console.log(\"No such document!\");\n }\n }).catch((error) => {\n console.log(\"Error getting document:\", error);\n });\n}", "function show(data) {\r\n let tab =\r\n `<tr> \r\n\t\t\r\n\t\t</tr>`;\r\n\r\n // Loop to access all rows \r\n for (let r of data.articles) {\r\n tab += `<tr> <br><br>\r\n <tr><img src=\"${r.image_url}\" width=50% height=60% class=\"mx-auto w-50\"><br></tr> \r\n\t <tr>${r.title} <br></tr> \r\n\t <tr><a href=\"${r.article_url}\" target=\"_blank\">Read More</a><br></tr> \r\n\t <tr><strong>Source: </strong> ${r.source_name}<br></tr>\t\r\n \t<hr>\r\n </tr>`;\r\n }\r\n // Setting innerHTML as tab variable \r\n document.getElementById(\"employees\").innerHTML = tab;\r\n}", "callAPI() {\n let url = window.location.protocol + '//' + window.location.host + '/api';\n fetch(url)\n .then(res => res.json())\n .then(res => {\n let apiRespone = res.data;\n let numberOfQuestions = apiRespone.length;\n let firstQuestion = apiRespone[0].question;\n let answer = apiRespone[0].answer;\n let choiceA = apiRespone[0].choices.a;\n let choiceB = apiRespone[0].choices.b;\n let choiceC = apiRespone[0].choices.c;\n let choiceD = apiRespone[0].choices.d;\n let htmlQuestions = [];\n let javaScriptQuestions = [];\n let cssQuestions = [];\n let topic1, topic2, topic3;\n for (var j = 0; j < numberOfQuestions; j++) {\n if (apiRespone[j].topic === \"html\") {\n // If the topic of the question is html the questions go into the array htmlQuestions\n htmlQuestions.push(apiRespone[j]);\n topic1 = apiRespone[j].topic;\n } else if (apiRespone[j].topic === \"css\") {\n // If the topic of the question is css the questions go into the array htmlQuestions\n cssQuestions.push(apiRespone[j]);\n topic2 = apiRespone[j].topic;\n } else if (apiRespone[j].topic === \"javascript\") {\n // If the topic of the question is javascript the questions go into the array htmlQuestions\n javaScriptQuestions.push(apiRespone[j]);\n topic3 = apiRespone[j].topic;\n }\n }\n this.setState({ \n apiRespone,\n question: firstQuestion,\n answer,\n choiceA,\n choiceB,\n choiceC,\n choiceD,\n numberOfQuestions,\n htmlQuestions,\n javaScriptQuestions,\n cssQuestions,\n topic1,\n topic2,\n topic3\n });\n });\n }", "componentDidMount() {\n fetch(`http://localhost:8000/forums`)\n .then((response) => {\n return response.json();\n })\n .then(data => {\n let categoryNamesFromApi = data.map(rows => {\n return { value: rows.forumID, display: rows.category_name }\n });\n this.setState({\n forumCategories: (categoryNamesFromApi)\n });\n }).catch(error => {\n console.log(error);\n });\n }", "getCategories() {\n axios\n .get(`${apiBaseUrl}/categories`)\n .then(res => {\n\n this.categories = res.data;\n this.show = true;\n })\n .catch(error =>\n console.error(\"Can't get the Categories\", error)\n );\n }", "function selectTopic(topic){\n currentSubject = topic;\n var topicObj = getItemTopicsData(currentSubject);\n \n if(topicObj.data.length > 0){\n //show the stickers from the data stored\n showStickers(topicObj.data);\n }\n else\n {\n //search for the topic in the API and load the topic data\n searchSticker(topicObj);\n }\n \n $(\"#button-more\").css(\"display\",\"block\");\n}", "async function displayArticles() {\n console.log(\"displaying articles\")\n try {\n let allArticlesHtml = \"\";\n // performs a get request to the backend, which performs a findAll request to the db\n // how to rename during deconstruction https://wesbos.com/destructuring-renaming/\n // eslint-disable-next-line no-undef\n const { data: allArticles } = await axios.get(\"/api/articles\")\n // Loops through all the articles in the database and creates divs for them\n for (let i = 0; i < allArticles.length; i++) {\n const { title, text, image_string } = allArticles[i]\n\n const articleHtml = `<div class=\"card my-5\">\n <div class=\"card-header\">\n ${title}\n </div>\n <div class=\"card-body\">\n <div>\n <img src=\"${image_string}\"/>\n </div>\n <div>\n <p>${text}</p>\n </div>\n \n </div>\n </div>`\n\n // adds article html to all articles html\n allArticlesHtml += articleHtml;\n }\n //adds all articles html to article container\n console.log(allArticlesHtml);\n articleContainer.innerHTML = allArticlesHtml;\n\n } catch (err) {\n console.log(\"Error retrieving articles \", err);\n }\n}", "getDetails(titleID) {\n axios\n .get(`${apiBaseUrl}/entries?title=${encodeURIComponent(titleID)}`)\n .then((response) => {\n this.details = response.data.entries[0];\n this.show = true;\n\n const category = response.data.entries[0].Category;\n this.getReleavantApis(category);\n })\n }", "function showTopics(){\n for(var i = 0; i < topics.length; i++){\n var newTopic = $(\"<button>\");\n newTopic.attr(\"type\", \"button\");\n newTopic.text(topics[i]);\n //console.log(newTopic.text());\n $(\".topics\").append(newTopic);\n }\n }", "function getRequest(topic) {\n var apiURL = 'https://api.giphy.com/v1/gifs/search?q=' + topic + '&api_key=hJ1Tg3pGRPs5TknZiwUcGXTCYOtXtajX&limit=12&rating=g&lang=en'\n\n axios.get(apiURL)\n .then(function (response) {\n var $topicsRow = $('#topics-row');\n $topicsRow.after('<div class=\"row mw-100 m-0\" id=\"gifs-row\"></div>')\n var $gifsRow = $('#gifs-row')\n\n for (var i = 0; i < 12; i++) {\n var gifStill = response.data.data[i].images.original_still.url;\n var gifPlay = response.data.data[i].images.downsized_large.url;\n $gifsRow.append('<div class=\"col-12 col-sm-6 col-lg-4 col-xl-3 my-3 gif\"><img src=\"' + gifStill + '\" alt=\"\" class=\"gif\" id=\"gif' + i + '\" data-state=\"still\" data-still=\"' + gifStill + '\" data-play=\"' + gifPlay + '\"></div>');\n\n var $gif = $('#gif' + i);\n $gif.css({\n 'width': '100%',\n 'border-radius': '1rem'\n })\n }\n })\n\n .catch(function (error) {\n console.log(error);\n });\n}", "getArticles() {\n axios\n .get(`${API_URL}`)\n .then((response) =>\n response.data.articles.map((article) => ({\n title: `${article.title}`,\n description: `${article.description}`,\n author: `${article.author}`,\n url: `${article.url}`,\n urlToImage: `${article.urlToImage}`\n }))\n )\n .then((articles) => {\n this.setState({\n articles,\n isLoading: false\n });\n })\n .catch((error) => this.setState({ error, isLoading: false }));\n }", "function renderButtons() {\n $(\"#topics-view\").empty();\n // Looping through the array of topics\n for (var i = 0; i < topics.length; i++) {\n var a = $(\"<button>\");\n a.addClass(\"topic\");\n a.attr(\"data-topic\", topics[i]);\n a.text(topics[i]);\n $(\"#topics-view\").append(a); \n }\n }", "function getTopics(response) {\n\tconsole.log(\"Request handler 'getTopics' was called.\");\n\n\tresponse.writeHead(200, { \"Content-Type\": MIME_TYPES['.json']});\n\t\n\tvar topicNodes = new Array();\n\tfor (var i = 0; i < data.nodes.length; i++) {\n\t\tif (data.nodes[i].type == 'topic') {\n topicNodes.push(data.nodes[i]);\n\t\t}\n\t}\n\t\n topicNodes.sort(function(a, b) {\n return data.compareVoteCounts(a.id, b.id);\n });\n\tconsole.log(\"Populated topicNodes with \" + topicNodes.length + \" items\");\n\tresponse.write(JSON.stringify(topicNodes));\n\tresponse.end();\n}", "function loadTopicsButtons() {\n\t$('.buttons-div').text('');\n\ttopics.forEach(topic => {\n\tvar storedElement = $('<button>').attr('class', 'btn m-1 gif-buttons').attr('value', topic).text(topic);\n\t$('.buttons-div').append(storedElement);\n\t});\n}", "function created() {\n axios.get(`https://api.airtable.com/v0/appgyWdA8yP0KXZr4/My%20Study%20Cards?maxRecords=20&view=Main%20View&api_key=${airtableKey}`)\n .then((resp) => {\n console.log('response', resp)\n\n // 1-1 If we retrieve records successfully, add them to our studyCards list.\n if (resp.status === 200 && resp.data.records.length > 0) {\n this.studyCards = resp.data.records\n } else {\n // Not much error handling happening here.\n console.error('Unable to retrieve study cards. Please refresh the page and try again.')\n }\n })\n}", "getData() {\n const page = Math.ceil(this.state.articles.length / 20) + 1;\n if (!_.isEmpty(this.state.query)) {\n const query = `?apiKey=${API_KEY}&sources=${this.state.id}&q=${this.state.query}&page=${page}`;\n axios.get(URL + query)\n .then((resp) => {\n console.log(this.state.id, resp);\n this.setState({ articles: this.state.articles.concat(resp.data.articles) });\n this.parseData();\n })\n .catch((error) => {\n console.log(this.state.id, error);\n this.resetState();\n this.setState({ error: true });\n });\n }\n }", "function getTopic(topic) {\n return new Promise( function(resolve) {\n // Create object and set up request\n let xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n resolve(this.responseText);\n }\n };\n\n // Pass query information into server script for GET request\n let queryString = \"?topic=\" + topic;\n xhttp.open(\"GET\", \"../backend/filter_topic.php\" + queryString, true);\n xhttp.send();\n });\n }", "function created() {\n axios.get(`https://api.airtable.com/v0/appgyWdA8yP0KXZr4/My%20Study%20Cards?maxRecords=20&view=Main%20View&api_key=${airtableKey}`)\n .then((resp) => {\n console.log('response', resp)\n\n // 1-1 If we retrieve records successfully, add the to our studyCards list.\n if (resp.status === 200 && resp.data.records.length > 0) {\n this.studyCards = resp.data.records\n } else {\n console.error('Unable to retrieve study cards. Please refresh the page and try again.')\n }\n })\n}", "componentDidMount() {\n let headers = {\n 'access-token': cookies.get('access-token'),\n 'client': cookies.get('client'),\n 'token-type': cookies.get('token-type'),\n 'uid': cookies.get('uid'),\n 'expiry': cookies.get('expiry')\n };\n let path = `/articles?user_id=${this.props.match.params.user_id}`;\n axios\n .get(path,\n { headers: headers })\n .then(res => {\n let tempArray = res.data.slice();\n this.setState({\n articles: tempArray\n });\n })\n .catch(err => console.log('in error',err));\n }", "getAboutThisGameFeaturesData() {\n axios.get('/api/features')\n .then((res) => {\n // handle data\n this.setState({\n featureData: res.data,\n aboutHeader: res.data[0].aboutHeader,\n aboutBody: res.data[0].aboutBody,\n features: res.data[0].features,\n featureTitle: res.data[0].featureTitle\n })\n })\n .catch((err) => {\n console.error('error in get request in client', err);\n })\n }", "_createCloudFromData() {\n //generate word DOM Elements\n this._data['topics'].map((value, index) => {\n value.el = this._createWord(value);\n return value;\n });\n this._layoutWords();\n }", "function processSubjectsSolr(data) {\n var data = $.parseJSON(data);\n\n $('a[href=\"#tab-audio-video\"]').unbind('show.bs.tab');\n\n $.each(data.grouped.service.groups, function(solrIndex, solrSection) {\n //Related Audio-Video (videos) section\n if (solrSection.groupValue == \"mediabase\" && solrSection.doclist.numFound > 0) {\n $(\"ul.nav li a[href='#tab-audio-video'] .badge\").text(solrSection.doclist.numFound);\n $(\".content-resources ul.nav-pills li.audio-video\").show();\n $('a[href=\"#tab-audio-video\"]').unbind('show.bs.tab').one('show.bs.tab', function(e) {\n //Push a state to the url hash so we can bookmark it\n $.bbq.pushState({que: $(e.target).attr('href').substr(1)});\n $.bbq.removeState('nid');\n\n if (!e.relatedTarget) {\n var $tabAudioVideo = $(\"#tab-audio-video\");\n $tabAudioVideo.empty();\n $tabAudioVideo.append('<h6>Audio/Video</h6>');\n var audioVideoUrl = Settings.mediabaseURL + '/services/' + Settings.app + '/' + Settings.hash_obj.id + '?rows=12';\n $.get(audioVideoUrl, relatedVideos);\n }\n\n });\n }\n\n //Related Photos section\n // if (solrSection.groupValue == \"sharedshelf\" && solrSection.doclist.numFound > 0) {\n // $(\"ul.nav li a[href='#tab-photos'] .badge\").text(solrSection.doclist.numFound);\n // $(\".content-resources ul.nav-pills li.photos\").show();\n // }\n });\n\n //Load default tab\n if (Settings.hash_obj.nid) {\n var pageURL = Settings.mediabaseURL + '/api/v1/media/node/' + Settings.hash_obj.nid + '.json';\n $.get(pageURL, showAudioVideoPage);\n } else {\n $('.content-resources').find('a[href=\"#' + (Settings.hash_obj.que || 'tab-overview') + '\"]').click();\n }\n\n}", "componentDidMount(){\n axios.get('./aboutme.html').then((response) => {\n\n this.setState({content:response.data})\n var i= 0;\n while(i<this.state.num){\n axios.get('./examples/example' + i + '.html')\n\n .then((response) => {\n this.setState({projects:[...this.state.projects, response.data]})\n });\n\n i=i+1;\n }\n });\n }", "function runAPI() {\n $.ajax({\n url: 'https://newsapi.org/v2/top-headlines?language=en&country=' + country.value + '&category=' + category.value + '&q=' + keyword.value + '&apiKey=' + key,\n type: 'GET',\n dataType: 'json',\n success: function(data) {\n console.log(data.articles);\n\n var i;\n for (i = 0; i < data.articles.length; i++) {\n var x = data.articles[i]\n document.getElementById('objects').innerHTML +=\n '<div class=\"articles col-12 col-sm-12 col-md-6 col-lg-6 col-xl-6\"> ' +\n '<div id=\"card\" class=\"card mt-3 ml-5\" style=\"width: 45rem;\">' +\n '<div class=\"card-body\">' + '<img src=\"' + x.urlToImage + '\">' +\n '<class=\"card-text\">' + '<h4>' + x.title + '</h4>' + '<br>' + '<p>' + x.description + '</p>' + '<p> Source: ' + x.source.name + '</p><br>' +\n '</div>' +\n '</div>' +\n '</div>';\n } //for loop\n\n // button takes you to article clicked\n $('.card').click(function() {\n console.log(x.url);\n });\n },\n error: function() {\n alert('An error was encountered.');\n }\n });\n\n }", "function addTopic(newTopic){\n // debugger\n console.log(newTopic)\n const ul = document.getElementById('topic-list')\n const div = document.getElementById('comment-list')\n const li = document.createElement('li')\n const p = document.createElement('p')\n const deleteBtn = document.createElement('button')\n \n \n li.textContent = newTopic.topic\n p.textContent = `${newTopic.name} - \"${newTopic.comments}\"`\n p.style.fontStyle = \"italic\"\n deleteBtn.textContent = \"X\"\n deleteBtn.classList = \"rounded border border-warning\"\n \n //debugger\n console.log(p)\n li.appendChild(deleteBtn)\n ul.append(li, p)\n // div.appendChild(p)\n \n \n \n deleteBtn.addEventListener('click', () => {\n li.remove()\n p.remove()\n \n fetch(`http://localhost:3000/topic/${newTopic.id}`, {\n method: 'DELETE',\n })\n .then(res => res.json())\n .then(topics =>console.log(topics))\n\n })\n}", "function loadDoc(url) {\r\n\r\n \r\n var xhttp = new XMLHttpRequest();\r\n xhttp.onreadystatechange = function () {\r\n\r\n\r\n if (this.readyState == 4 && this.status == 200) {\r\n objetos = JSON.parse(this.responseText);;\r\n for (let i = 0; i < objetos.articles.length; i++) {\r\n divs(objetos.articles[i]);\r\n }\r\n\r\n }\r\n };\r\n xhttp.open(\"GET\", url, true);\r\n xhttp.send();\r\n}", "function putTopics() {\n for (var i = 0; i < topics.length; i++) {\n var newButton = $(\"<button>\");\n newButton.text(topics[i]);\n newButton.attr(\"data-search\", topics[i].toLowerCase());\n $(\"#sports-views\").append(newButton);\n }\n addEvents();\n}", "function renderButtons() {\n // emptying button panel\n $(\"#buttons-view\").empty();\n // Looping through the array of topics\n for (let i = 0; i < topics.length; i++) {\n let buttonNew = $(\"<button>\");\n // Adding a class of topic-btn to our button\n buttonNew.addClass(\"topic-btn\");\n // Adding a data-attribute\n buttonNew.attr(\"data-name\", topics[i]);\n // Providing the initial button text\n buttonNew.text(topics[i]);\n // Adding the button to the buttons-view div\n $(\"#buttons-view\").append(buttonNew);\n }\n}", "function displayArticles(articles){\n articles.forEach(article => {\n let a = document.createElement(\"a\")\n a.href = article.url\n a.target = \"_blank\"\n let p = document.createElement(\"p\")\n p.innerText = `${article.title} by ${article.author}`\n a.append(p)\n document.querySelector(\"#news-div\").append(a)\n })\n}", "componentDidMount(){\r\n axios.get('http://localhost:3001/announcements_faculty',{params:{user:localStorage.getItem('username')},headers: {'Authorization': localStorage.getItem('token')}})\r\n .then((response) => {\r\n //update the state with the response data\r\n this.setState({\r\n announcements : this.state.announcements.concat(response.data) \r\n });\r\n });\r\n }", "function getSongPlaylist() {\n axios.get(contextPath + \"/read\")\n .then(res => {\n table.innerHTML = \"\";\n\n const SongPlaylists = res.data;\n console.log(SongPlaylists);\n\n SongPlaylists.forEach(SongPlaylist => {\n const newSongPlaylist = renderSongPlaylist(SongPlaylist);\n console.log(\"New SongPlaylist: \", newSongPlaylist);\n table.appendChild(newSongPlaylist);\n });\n }).catch(err => console.error(err))\n}", "function getCanvasDiscussionTopics(){\n \n var arrSettings = getSettings();\n \n var domain = arrSettings['domain'];\n var token = arrSettings['token'];\n var courseNum = arrSettings['courseNum'];\n var dataCallDate = arrSettings['dataCallDate'];\n \n //create json data object\n var jsonTopic = callCanvasAPI(domain, \"courses\", courseNum, \"discussion_topics\", token, 100);\n \n //Set Headers\n var topicHeaders = {0: \"assignment_id\", 1: \"id\", 2: \"title\", 3: \"assignment.discussion_topic_id\", 4: \"published\", 5: \"author.id\", 6: \"author.display_name\", 7: \"require_initial_post\", 8: \"discussion_type\", 9: \"assignment.points_possible\", 10: \"discussion_subentry_count\", 11: \"message\"};\n\n //count records in data\n var topicLength = jsonTopic.result.length;\n\n json2Sheet(topicHeaders, jsonTopic.result, topicLength, 'discussion-topics', 'courseid', courseNum, dataCallDate);\n\n \n var doc = SpreadsheetApp.getActiveSpreadsheet();\n var sheet = doc.getSheetByName(\"discussion-topics\");\n SpreadsheetApp.setActiveSheet(sheet);\n}", "function showTab(e) {\n console.log(\"inside showTab()\");\n /* element na koji je kliknuto, pa njegov title, moze biti welcome, B, C, CE*/\n /* kliknuti elem moze biti iz navigation ili iz tabs*/\n var selectedTab = e.target.title;\n console.log(selectedTab);\n\n if (selectedTab == \"welcome\") {\n welcomePaneShowing = true;\n console.log(\" welcome tab selected\");\n document.getElementById(\"content\").innerHTML =\n \"<h3>Click a tab to display category desription</h3>\"; /* mixing content with behaviour*/\n } else {\n welcomePaneShowing = false;\n }\n\n// set each tab's CSS class\n var tabs = document.getElementById(\"tabs\").getElementsByTagName(\"a\");\n for (var i=0; i<tabs.length; i++) {\n var currentTab = tabs[i];\n if (currentTab.title == selectedTab) {\n currentTab.className = \"active\";\n } else {\n currentTab.className = \"inactive\";\n }\n }\n\n var request = createRequest();\n if (request==null) {\n alert(\"Unable to create request\");\n return;\n }\n request.onreadystatechange = showCategory;\n request.open(\"GET\", selectedTab + \".html\", true);\n request.send(null);\n}", "componentDidMount() {\n // Request sends to The News API to gain access to top news stories, currently set to limit of 3, max is 5\n // res.data.data returns an array of objects. Objects inside array returned appears as such:\n /*\n res.data.data[0] = {\n categories: [<sting>, <sting>],\n description: <string>,\n image_url: <string>,\n keywords: <string>,\n language: <string>,\n locale: <string>,\n published_at: <string date>,\n snippet: <string>,\n source: <string>,\n title: <string>,\n url: <string>,\n uuid: <string>\n }\n */\n axios.get(`https://api.thenewsapi.com/v1/news/top?api_token=${process.env.NEWS_API_KEY}&locale=us&limit=4`)\n .then( res => {\n let storage = res.data.data;\n this.setState({\n trendingNews: storage,\n displayedNews: storage\n })\n })\n .catch( err => {\n console.error(err);\n })\n\n }", "function getThreads() {\n $.ajax({\n url: \"/threads\"\n }).done(function (data) {\n\n $('#showThreads').html('');\n\n\n console.log('Fetched / threads: ', data);\n for (var i = 0; i < data.length; i++) {\n\n var textContent = data[i].text;\n if (data[i].text != undefined) {\n textContent = textContent.replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\");\n }\n\n var titleContent = data[i].title;\n if (data[i].title != undefined) {\n titleContent = titleContent.replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\");\n }\n\n console.log(data[i]._id + ': ' + data[i].title + ': ' + data[i].text);\n $('#showThreads').append('<p class=\"linkThread\" id=\"' + data[i]._id + '\">' + ' <b>Title: </b>' + titleContent + '</p><br /><p>' + ' <b>Text: </b> ' + textContent + '</p><hr /><br />');\n\n }\n });\n}", "function loadTopicButtons(){\n $('.buttons').empty();\n $.each(topics, function(i, val) {\n var topicButton = $('<button>').attr('class', 'btn').addClass('btn-primary').text(val);\n $('.buttons').append(topicButton);\n });\n }", "function getMovieDetails(){\n \n var idF = sessionStorage.getItem('movieId');\n console.log(idF);\n\n axios.request({\n method: 'GET',\n url: 'https://imdb8.p.rapidapi.com/title/get-overview-details',\n params: {tconst:idF, currentCountry: 'US'},\n headers: {\n 'x-rapidapi-key': '3d1de671d0mshcd7c4f21da3d565p194067jsn03cba614409e',\n 'x-rapidapi-host': 'imdb8.p.rapidapi.com'}\n })\n\n .then(function (response) {\n console.log(response.data);\n\n var movie = response.data;\n var output = '';\n\n output += `\n <div class=\"row\">\n <div class=\"col-md-4\">\n <img src=\"${movie.title.image.url}\" class=\"thumbnail\">\n </div>\n <div class=\"col-md-8\">\n <h2>${movie.title.title}</h2>\n <ul class=\"list-group\">\n <li class=\"list-group-item\"><strong>Genres:</strong> ${movie.genres}</li>\n <li class=\"list-group-item\"><strong>Realeased:</strong> ${movie.title.year}</li>\n <li class=\"list-group-item\"><strong>IMDB Rating:</strong> ${movie.ratings.rating}</li>\n <h2></h2>\n <li class=\"list-group-item\"><strong>Plot:</strong> ${movie.plotOutline.text}</li>\n <a href=\"dailyMovie.html\" class=\"btn btn-primary\">Go back</a>\n </ul>\n </div>\n </div>\n`;\n\n$('#movies').html(output);\n\n})\n.catch(function (error) {\n console.error(error);\n});\n}", "getTickets(page=1){\n return axios.get(`https://${this.domain}.zendesk.com/api/v2/tickets?page=${page}&per_page=${this.perPage}`, {\n headers: {\n Authorization: `Basic ${this.token}` \n }})\n }", "function fetchAbout() {\n axios.all([\n axios.get(SPACEX),\n axios.get(INFOAPI)\n ])\n .then(axios.spread((spaceX, infoApi) => {\n spacexData = spaceX.data;\n infoApiData = infoApi.data;\n aboutPageCards();\n \n }));\n}", "function appendStartingButtons() {\n topics.forEach(function(topic){\n var topicButton = createButtonHTML(topic);\n $(\"#btn-container\").append(topicButton);\n });\n}", "function loadFAQList() {\n\tvar req = new XMLHttpRequest();\n\treq.open(\"GET\", PHYSFAQ_BASE + \"/articles.json\", true);\n\n\treq.onload = function() {\n\t\tif (req.status == 200) {\n\t\t\tFAQARTICLES = JSON.parse(req.responseText);\n\n\t\t\t// Just add FAQ article titles to locales (addTranslation) so that\n\t\t\t// the i18n code can take care of localizing these strings\n\t\t\tfor (var i = 0; i < FAQARTICLES.length; ++i) {\n\t\t\t\tvar title_i18n_id = \"_faq_title\" + i;\n\n\t\t\t\taddTranslation(null, title_i18n_id, FAQARTICLES[i].title);\n\n\t\t\t\t// Article container\n\t\t\t\tvar faqArticle = document.createElement(\"div\");\n\t\t\t\tfaqArticle.classList.add(\"faq-article\");\n\n\t\t\t\t// Article content\n\t\t\t\tvar faqArticleContent = document.createElement(\"div\");\n\t\t\t\tfaqArticleContent.classList.add(\"faq-article-content\");\n\t\t\t\tfaqArticleContent.classList.add(\"markdown-body\");\n\t\t\t\tfaqArticleContent.dataset.articleid = i;\n\t\t\t\tfaqArticleContent.style.display = \"none\";\n\n\t\t\t\t// Article header\n\t\t\t\tvar faqArticleHeader = document.createElement(\"div\");\n\t\t\t\tfaqArticleHeader.classList.add(\"faq-article-header\");\n\t\t\t\tfaqArticleHeader.dataset.i18n = title_i18n_id;\n\t\t\t\tfaqArticleHeader.innerHTML = i18n(null, title_i18n_id);\n\t\t\t\tfaqArticleHeader.dataset.articleid = i;\n\t\t\t\tfaqArticleHeader.onclick = function() {\n\t\t\t\t\t// contentElement is faqArticleContent corresponding to currently clicked header\n\t\t\t\t\tvar contentElement = this.parentElement.getElementsByClassName(\"faq-article-content\")[0];\n\n\t\t\t\t\tif (contentElement.style.display == \"none\") {\n\t\t\t\t\t\tcontentElement.style.display = \"block\";\n\t\t\t\t\t\tloadFAQArticle(contentElement);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontentElement.style.display = \"none\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfaqArticle.appendChild(faqArticleHeader);\n\t\t\t\tfaqArticle.appendChild(faqArticleContent);\n\t\t\t\tdocument.getElementById(\"faq-articles\").appendChild(faqArticle);\n\t\t\t}\n\t\t}\n\t};\n\n\treq.send();\n}", "loadTopicById({commit}, topic_id){ \n HTTP.get('v1/api/topicdetail/' + topic_id + '/',\n {\n handlerEnabled: true\n }\n ).\n then(response => response.data)\n .then(topic => {\n commit('SET_TOPIC', topic)\n })\n }", "async function filterByTopic() {\n // get selected topic(s)\n let selectedTopics = [];\n let topics = qsa(\"#topic-filter input\");\n for (let topic of topics) {\n if (topic.checked) selectedTopics.push(topic.value);\n }\n\n // get ids of posts from database for each topic and display results\n let results = [];\n for (let topic of selectedTopics) {\n let matches = formatResults(await getTopic(topic));\n results = results.concat(matches);\n }\n displaySearchResults(results);\n }", "data(){\n return{\n \n url: 'https://newsapi-topnews-hk.herokuapp.com/v1/topnews',\n articles: [],\n articlesCount: []\n \n }\n \n }", "function fetchTopicsAndListenForNewOnes()\r\n{\r\n \r\n $(\".topic-listings\").hide();\r\n $(\".post-listings\").hide();\r\n $(\".post-display\").hide();\r\n \r\n $(\"#table-of-topics\").empty();\r\n \r\n $(\".topic-listings\").show();\r\n \r\n let topicRef = firestore.collection('topics');\r\n\r\n topicRef.orderBy('timestamp').onSnapshot(function(topics){\r\n $(\"#table-of-topics\").empty();\r\n topics.forEach(function(topic){\r\n let topicData = topic.data();\r\n\r\n let date = new Date(topicData.timestamp);\r\n $(\"#table-of-topics\").append('<tr id = \"' + topic.id +'\" class = \"clickable\"><td>' + topicData.topicName + '</td><td>' + topicData.username + '</td><td>' + date + '</td><td>' + topicData.postCount + '</td>');\r\n // TODO: add badge with number of posts! (cool)\r\n console.log(topicData.topicName);\r\n });\r\n });\r\n}", "function handleGetData(event) {\n event.preventDefault();\n $main.empty();\n let searchText = $(\"input#inputBtn\").val();\n\n $.ajax(`https://gnews.io/api/v4/search?q=${searchText}&token=c4c8a4cebef621ab5eafecf6b7a504ea`)\n .then(function (data) {\n eachNews = data.articles;\n\n for (i = 0; i < 10; i++) {\n let newsArray = eachNews[i];\n let content = newsArray.content;\n $main.append(`\n \n <article>\n <h3>${newsArray.title}</h3>\n <p>${newsArray.description}</p>\n </article>\n `)\n\n }\n },\n function (error) {\n console.log(\"Bad request: \", error);\n }\n\n )\n}", "moviesList(){\n for (let i = 0; i < this.homeMovies.length; i++) {\n axios.get(`https://api.themoviedb.org/3/movie/${this.homeMovies[i].url}`, {\n params: {\n 'api_key': API_KEY,\n language: this.language,\n page: this.homeIndex,\n\n }\n }).then(now => {\n this.homeMovies[i].movies = now.data.results;\n });\n }\n }", "function TopicsService(http) {\n this.http = http;\n this.http = http;\n }", "function renderButtons() {\n \n $('#buttons').empty();\n \n topics.forEach(function (topic) {\n $('#buttons').append($('<button>')\n .attr('data-name', topic)\n .text(topic)\n .addClass(\"show-button\"));\n });\n}", "function openNewTabFromHash() {\n\tvar data = getTopicFromHash();\n\tif (data.topic_id != 0) {\n\t\tif (isTopicInATab(data)) {\n\t\t\tswitchToTab(isTopicInATab(data));\n\t\t}\n\t\telse {\n\t\t\topenNewTab(data.forum_id, data.topic_id);\n\t\t}\n\t}\n}", "function initilizeList() {\n for (var i = 0; i < topics.length; i++) {\n insertButton(topics[i]);\n }\n}", "function fetchArticles() {\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n let respuesta = JSON.parse(this.responseText);\n let template = \"\";\n\n respuesta.forEach(articulo => {\n //Crear template para introducirlo en el HTML\n\n template += `\n <article class=\"articulo\">\n <h3 class=\"titulo\">${articulo.titulo}</h3>\n <img src=\"img/img_blog/${articulo.url_imagen}\" alt=\"Imagen del artículo\">\n <p>${articulo.texto}</p>\n <div class=\"info-articulo\">\n <p class=\"fecha\">Fecha: ${articulo.fecha}</p>\n <p class=\"autor\">Autor: ${articulo.autor}</p>\n </div>\n </article>\n `;\n });\n \n articulos.innerHTML = template;\n console.log(template);\n }\n };\n xhr.open(\"POST\", \"php/modelo-articulos.php\", true);\n xhr.send();\n }", "componentDidMount() {\n this.props.actions.getTopics();\n }", "async function showCategories() {\n const res = await axios.get(`${MD_BASE_URL}/categories.php`);\n $('<div class=\"col-10\"><h3 class=\"title text-center\">CATEGORIES</h3></div>').appendTo($cateList);\n for (let cate of res.data.categories) {\n generateCatHTML(cate);\n }\n }", "function loadQuestions(url) {\n let xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n // Typical action to be performed when the document is ready:\n // console.log(JSON.parse(this.responseText));\n\n //start by making it a variable\n let questions = JSON.parse(this.responseText).feed.entry;\n let stackName = JSON.parse(this.responseText).feed.title.$t;\n\n // console.log(stackName);\n // console.log(questions);\n // make the array accessible outside of this function\n storedQuestions = questions;\n nowStudying = stackName;\n // console.log(storedQuestions);\n positionDisplay();\n\n //go through the array with a for loop\n for (let i = 0; i < questions.length; i++) {\n // console.log(questions[i].gsx$definition.$t);\n // displayText.innerHTML=questions[i].gsx$definition.$t;\n // mainCard.innerHTML =\n // \"<p>\" + storedQuestions[questionCounter].gsx$term.$t + \"</p>\";\n // prevBtn.innerText=questions[i].gsx$choice2.$t;\n // flipBtn.innerText=questions[i].gsx$choice3.$t;\n // nextBtn.innerText=questions[i].gsx$choice4.$t;\n }\n }\n };\n xhttp.open(\"GET\", url, true);\n xhttp.send();\n}", "function getData(setData) {\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", \"assets/js/topics.json\");\n xhr.send();\n xhr.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n setData(JSON.parse(this.responseText)); // Only call createArray when the data has arrived\n }\n };\n }", "async function recuperArticle(url) {\n let tab= await accesApi(url);\n if(localStorage.getItem(\"titre\")!==null){\n h2.innerHTML=`${localStorage.getItem(\"titre\")}`;\n\n }else{\n h2.innerText=\"Ours en peluche faites à la main \";\n }\n \n console.log(tab);\n for (let element of tab) {\n //article qui va contenir toutes informations\n let article = document.createElement(\"article\");\n let nomProduit = document.createElement(\"p\");\n\n //le div qui va contenir l'image du produit\n let divImage = document.createElement(\"div\");\n\n //le lien vers la page du produit\n let lien = document.createElement(\"a\");\n //url contenant les parametres des produits\n lien.setAttribute(\n \"href\",\n `./produit.html?name=${element.name}&id=${element._id}\n &option=${element.colors ||element.varnish||element.lenses}&price=${element.price}\n &image=${element.imageUrl}&description=${element.description}`\n );\n lien.innerHTML = `<img title=\" photo de la peluche ${element.name}\" src=\"${element.imageUrl}\"/>`;\n divImage.appendChild(lien);\n article.appendChild(divImage);\n nomProduit.innerHTML = `<span>${element.name}</span><br/><span><strong>${\n element.price / 100\n }€</strong></span>`;\n article.appendChild(nomProduit);\n bloc.appendChild(article);\n }\n}", "componentDidMount() {\n axios.get('http://localhost:90/channel/all/' + localStorage.getItem('userid'))\n .then((response) => {\n // console.log(response)\n this.setState({\n channels: response.data.allchannel\n })\n })\n .catch((err) => {\n // console.log(err.response)\n })\n }", "fetchTopStories(){\n var self = this;\n axios.get('https://hacker-news.firebaseio.com/v0/topstories.json')\n .then(function (response) {\n self.props.setLoaderText('Fetching stories'); // This is done because, once the top stories are fetched, the individual stories have to be fetched again, which requires a loader\n self.props.updateTopStories({\n topStories: response.data\n })\n })\n .catch(function (error) {\n console.log(error);\n });\n }" ]
[ "0.82546663", "0.8196486", "0.6542136", "0.6262952", "0.62627894", "0.616717", "0.61024225", "0.6070294", "0.602745", "0.60201603", "0.59739614", "0.59730846", "0.5967334", "0.5948629", "0.59043455", "0.5881514", "0.57357734", "0.57004434", "0.56584704", "0.56515044", "0.56328136", "0.5614943", "0.55898225", "0.5585751", "0.55829597", "0.5550972", "0.5544591", "0.55278605", "0.55210745", "0.55162954", "0.5482988", "0.54822993", "0.5480553", "0.5470417", "0.5466677", "0.54651207", "0.54413754", "0.54367745", "0.54349655", "0.5428581", "0.54112273", "0.5409511", "0.5399474", "0.53905433", "0.53897345", "0.53873557", "0.5383047", "0.5361191", "0.5355766", "0.5349162", "0.5339166", "0.5332061", "0.5319665", "0.53078717", "0.52765733", "0.5273853", "0.5273695", "0.52733576", "0.52679676", "0.5250175", "0.5238392", "0.52360874", "0.52348477", "0.52303815", "0.5229772", "0.5221151", "0.5216076", "0.5214239", "0.52138186", "0.5209601", "0.52072984", "0.5205181", "0.5202257", "0.51997167", "0.51904786", "0.5188278", "0.51847833", "0.51785576", "0.5177395", "0.51753205", "0.5174852", "0.5170243", "0.5163423", "0.51629525", "0.51616275", "0.516056", "0.51579523", "0.5152002", "0.5145767", "0.5145586", "0.5145214", "0.5140076", "0.51357234", "0.5131446", "0.51263297", "0.5123439", "0.51211315", "0.51171833", "0.5115713", "0.511147" ]
0.61195356
6
Function for drawing a card on the screen using the url of the card for the background image;
function drawCard(url, classname = null, value = null, append = true) { str = "<span class='card' style='background-image: url(" + url + ");'" if (value) { str += "num='" + value } str += "'></span>"; if (append) { $("." + classname).append(str); } else { return str } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawCard(card) {\n\tlet cardHolder = document.createElement('div');\n\tcardHolder.classList.add('card');\n\n\tlet backCard = document.createElement('div');\n\tbackCard.classList.add('backCard');\n\tcardHolder.appendChild(backCard);\n\t// There are no images for all cards (no imageUrl)\n\tlet image = document.createElement(\"img\");\n\tbackCard.appendChild(image);\n\tif (card.imageUrl == undefined) {\n\t\timage.setAttribute(\"src\", \"assets/arena.jpg\");\n\t} else {\n\t\timage.setAttribute(\"src\", card.imageUrl);\n\t};\n\n\tlet frontCard = document.createElement('div');\n\tfrontCard.classList.add('frontCard');\n\tcardHolder.appendChild(frontCard);\n\n\tlet nameC = document.createElement('h3');\n\tnameC.innerText = card.name;\n\tnameC.classList.add('h3-title');\n\tfrontCard.appendChild(nameC);\n\n\tlet artist = document.createElement('p');\n\tartist.innerHTML = `<p>Artist: ${card.artist}</p>`;\n\tartist.classList.add('artist');\n\tfrontCard.appendChild(artist);\n\n\tlet types = document.createElement('p');\n\ttypes.innerText = (card.types) ? card.types.join(', ') : null;\n\tfrontCard.appendChild(types);\n\n\tlet set = document.createElement('p');\n\tset.innerText = card.setName;\n\tfrontCard.appendChild(set);\n\n\tlet colors = document.createElement('p');\n\tcolors.innerText = (card.colors) ? card.colors.join(', ') : null;\n\tfrontCard.appendChild(colors);\n\n\treturn cardHolder;\n}", "function drawCard(url) {\n\tdisplayLoadingCard();\n\tfetch(url)\n\t\t.then((response) => response.json())\n\t\t.then((responseJson) => updateInfo(responseJson))\n\t\t.catch((error) => alert(\"That wasn't supposed to happen. Try again.\"));\n}", "function cardImg(url) {\n const div = document.createElement(\"div\");\n div.setAttribute(\"class\", \"card-img\");\n url = url.replace(/square/gi, \"medium\");\n div.style.backgroundImage = `url( ${url} )`;\n\n return div;\n}", "function displayCard(url) {\n let curr_card = $(`<img src=${url}>`)\n pile.append(curr_card)\n}", "function cardDrawImage(card, isPlayerCard){\n \n if(isPlayerCard){\n var cardImageSrc = playerCards[card.id].imgSrc;\n }else{\n var cardImageSrc = mobCards[card.id].imgSrc;\n }\n \n var cardImage = PIXI.Sprite.fromImage(cardImageSrc);\n\n cardImage.height = cardImageHeight;\n cardImage.width = cardImageWidth;\n cardImage.position.x = cardFrameOriginalWidth/2 - cardImageWidth /2 ;\n cardImage.position.y = 200 ;\n \n card.addChildAt(cardImage, 3);\n }", "drawBg() {\n let g = this,\n cxt = g.context,\n sunnum = window._main.sunnum,\n cards = window._main.cards,\n img = imageFromPath(allImg.bg);\n cxt.drawImage(img, 0, 0);\n sunnum.draw(cxt);\n }", "function drawImage(image) {\n let bodyDiv = document.getElementById('bg');\n bodyDiv.style.backgroundImage = \"url(\" + image.url + \")\";\n}", "function Card(props) {\n var style = {};\n var kCardAspectRatio = (1260 / 4) / (2925 / 13);\n style.display = 'inline-block';\n style.width = 100;\n style.height = kCardAspectRatio * style.width;\n style.borderRadius = style.width / 20;\n style.margin = style.width / 20;\n if (props.hidden) {\n // Just apply a simple gradient.\n // 4 sets of triangles to form a checkerboard.\n var checkerWidth = style.width / 20;\n var checkerMargin = checkerWidth / 2;\n style.backgroundImage = (\n 'linear-gradient(45deg, #808080 25%, transparent 25%),' +\n 'linear-gradient(-45deg, #808080 25%, transparent 25%),' +\n 'linear-gradient(45deg, transparent 75%, #808080 75%),' +\n 'linear-gradient(-45deg, transparent 75%, #808080 75%)');\n style.backgroundSize = checkerWidth + 'px ' + checkerWidth + 'px';\n style.backgroundPosition = '0 0, 0 ' + checkerMargin + 'px,' +\n ' ' + checkerMargin + 'px ' + -checkerMargin\n + 'px, ' + -checkerMargin + 'px 0px';\n } else {\n // Sprites go: A 2 3 4 .. K (left to right).\n // And then go: H S D C (top to bottom).\n // Sprites are\n var rankId = jam_proto.Card.Rank[props.rank];\n if (rankId == jam_proto.Card.Rank.ACE) {\n rankId = 1;\n }\n var rankIndex = rankId - 1; // 0-index.\n var suitId = jam_proto.Card.Suit[props.suit];\n var suitIndex = -1;\n switch (suitId) {\n case jam_proto.Card.Suit.HEARTS:\n suitIndex = 0;\n break;\n case jam_proto.Card.Suit.SPADES:\n suitIndex = 1;\n break;\n case jam_proto.Card.Suit.DIAMONDS:\n suitIndex = 2;\n break;\n case jam_proto.Card.Suit.CLUBS:\n suitIndex = 3;\n break;\n }\n check(suitIndex != -1, 'Unknown suit ' + suitIndex);\n\n // \n var leftPos = (100.0 / 13) * (rankIndex + rankIndex / 12) + '%';\n var topPos = (100.0 / 4) * (suitIndex + suitIndex / 3) + '%';\n style.background = 'url(assets/card_sprites.jpg) no-repeat 0 0';\n style.backgroundSize = '1300% 400%';\n style.backgroundPosition = leftPos + ' ' + topPos;\n }\n return e('div', { style: style });\n}", "addDrawPileCard(scene) {\n // Create an arbitrary card.\n this.drawPileCard = new Card(scene, scene.camera.centerX - 150, scene.camera.centerY, 'spades', 'a', 'a of spades');\n this.drawPileCard.faceDown();\n }", "function drawImages(image) {\n// had to use style.backgroundImage or else my image would cover quote and weather. \n\t\tdocument.getElementById('body').style.backgroundImage = `url(${image.url})`\n\t }", "function addBackgroundToCanvas(url){\n var grass = new createjs.Bitmap(url);\n var imageSize = grass.getBounds();\n\n grass.image.crossOrigin = \"\";\n\n grass.image.onload = function() {\n var widthRatio = demoCanvas.width / grass.image.width;\n var heightRatio = demoCanvas.height / grass.image.height;\n var scaleFactor = function(){\n if (widthRatio >= heightRatio){\n return widthRatio;\n } else {\n return heightRatio;\n }\n }\n var scale = scaleFactor();\n grass.setTransform(0, 0, scale, scale);\n stage.addChild(grass);\n stage.update();\n // calling the below now so that text apears on top of image\n if(randomThought){\n getRandomThought();\n } else {\n addTextToCanvas(currentRandomThought);\n }\n }\n}", "function generateCards(){\n shuffle(images);\n for (var i = 0; i < cards.length; i++){\n var image = images[i];\n var cardback = cardImages[i];\n var card = cards[i];\n var style = \"url(\" + image + \") no-repeat center\";\n cardback.style.background = style; \n cardback.style.backgroundSize = \"100% 100%\";\n card.dataset.pic = image;\n } \n}", "showBackSide(card) {\n card.src = `./assets/images/back-side.jpg`;\n }", "function getCard() {\n getButton.style.transform = \"translate(3px, -3px)\";\n genRandomPair();\n cardDrawnContainer.style.background = \"none\";\n // console.log(randomCard);\n cardDrawnContainer.style.transform = \"scale(0.7)\";\n cardDrawnContainer.style.background = \"url('./files/my-order/\" + randomCard[0] + \"_of_\" + randomCard[1] + \".png') no-repeat 0 0\";\n hitMe();\n setTimeout(function () {\n getButton.style.transform = \"translate(-4px, 4px)\";\n }, 200);\n}", "function drawImage() {\n var stat = getState(cm);\n var url = \"http://\";\n _replaceSelection(cm, stat.image, insertTexts.image, url);\n}", "function drawCard(rank, suit, position, turn)\n{\n\n\tvar x, y;\n\t//The url the image available from is constructed\n\tvar imgSrc = cardFolder + rank + \"_of_\" + suit + cardImageExtension;\n\t//If it is the card dealt upside down (for the dealer)\n\tif (rank == \"back\")\n\t{\n\t\timgSrc = cardFolder + rank + cardImageExtension;\n\t}\n\t//The dealt cards initial position (if it is the first card dealt) \n\t//is decided based on the passed \"position parameter\", which is the name of the player.\n\t\n\tif (position == \"dealer\")\n\t{\n\n\t\tx = 204 + turn * cardWidth * 0.25;\n\t\ty = 40;\n\t}\n\telse if (position == \"player\")\n\t{\n\t\t//\n\t\tx = 204 + turn * cardWidth * 0.25;\n\t\ty = 379;\n\t\t\n\t\t//-turn*cardHeight*0.25;\n\t}\n\telse if (position == \"bot\")\n\t{\n\t\tx = 204 + turn * cardWidth * 0.25;\n\t\ty = 210;\n\t\t\n\t\t//-turn*cardHeight*0.25;\n\t}\n\telse\n\t{\n\t\t//Unexpected error, just letting myself know, where to look for.\n\t\t\n\t\tconsole.log(\"errrror in drawCard!\");\n\t}\n\t\n\t//Having decided which player it is, the image is drawn to the canvas.\n\t\n\t//First, the image element is created (SVG image).\n\tvar image = createSVGElement(\"image\");\n\t//SRC attribute added\n\t\timage.setAttributeNS(null, \"href\", imgSrc);\n\t//ID created and added\t\n\tvar id = \"e_\" + textIdCounter++;\n\t//Positioning and sizing\n\t\timage.setAttributeNS(null, \"id\", id);\n\t\timage.setAttributeNS(null, \"x\", x);\n\t\timage.setAttributeNS(null, \"y\", y);\n\t\timage.setAttributeNS(null, \"width\", cardWidth);\n\t\timage.setAttributeNS(null, \"height\", cardHeight);\n\t\n\t\n\t//And finally, the image is appended to the canvas.\n\tmySVG.appendChild(image);\n\t//Id is returned for later reference.\n\treturn id;\n\n}", "function showCard(card) {\n $('section#card img').src = card.src;\n }", "function drawCard(context, elem, x, y, color) {\n let radius = 8;\n height = elem.height;\n width = elem.width;\n context.beginPath();\n context.moveTo(x + radius, y);\n context.lineTo(x + width - radius, y);\n context.quadraticCurveTo(x + width, y, x + width, y + radius);\n context.lineTo(x + width, y + height - radius);\n context.quadraticCurveTo(x + width,y + height,x + width - radius,y + height );\n context.lineTo(x + radius, y + height);\n context.quadraticCurveTo(x, y + height, x, y + height - radius);\n context.lineTo(x, y + radius);\n context.quadraticCurveTo(x, y, x + radius, y);\n context.closePath();\n context.fillStyle = color;\n context.fill();\n}", "function setupCard(gameCanvas) {\r\n /*Size of image*/\r\n var height = 465;\r\n var width = 415;\r\n var cord = [], x, y, gridPos;\r\n var i = 0; //Loop counter\r\n \r\n /*Add the card to the canvas*/\r\n card = new imageLib(gameCanvas, width, height, 200, 10);\r\n card.oldPosX = 150;\r\n card.oldPosY = 200;\r\n \r\n /*Save current location on the canvas*/\r\n card.addImg(gameImage.loadedImg[\"card1\"]);\r\n \r\n /*Save all frames*/\r\n card.frameNum = 4;\r\n card.frameCount = 1;\r\n \r\n //var w = [0, 150, 150, 150, 150];\r\n //var h = [0, 150, 150, 150, 150];\r\n \r\n for (i = 1; i <= card.frameNum; i++) {\r\n card.frame[\"card\"+i] = {\r\n image: gameImage.loadedImg[\"card\"+i],\r\n width: width,\r\n height: height\r\n };\r\n }\r\n \r\n // for (i = 1; i <= card.frameNum; i++) {\r\n // card.frame[\"card\"+i] = {\r\n // image: gameImage.loadedImg[\"card\"+i],\r\n // width: w[i],\r\n // height: h[i]\r\n // };\r\n // }\r\n}", "function enterCredits()\n{\n\t_canvas.style.backgroundImage = \"url(images/background.png)\";\n}", "function drawImage() {\n document.body.style.backgroundImage = `url(${ store.State.image.large_url})`\n document.body.classList.add('bg-image')\n}", "function _drawImage() {\n document.getElementById(\"background\").style.background = `transparent url('${ProxyState.image}') no-repeat center center /cover`\n}", "function displayBg() \n{\n\tvar bg = new Image();\n\tbg.src = \"Images/background.jpg\";\n\tctx.drawImage(bg,minCanvasWidth,minCanvasHeight,maxCanvasWidth,maxCanvasHeight);\n}", "function newCardImage(card,id)\r\n{\r\n\tvar c = new Image();\r\n\tvar src = fnCard(card);\r\n\tc.src = src;\r\n\tc.id = id;\r\n\tc.className = 'card';\r\n\treturn c;\r\n}", "draw() {\n const cards = document.querySelectorAll(\".memory-card\");\n let backs = document.getElementsByClassName(\"back-face\");\n for (let i = 0; i < cards.length; i++) {\n let card = this.deck.getCardByIndex(i);\n card.setElement(cards[i]);\n backs[i].src = this.deck.getCardByIndex(i).image;\n }\n let that = this;\n this.deck.cards.forEach((card) =>\n card.element.addEventListener(\"click\", function (e) {\n that.evalClick(this);\n })\n );\n }", "draw() {\n // Displaying the background\n image(hubImage, 0, 0, width, height);\n }", "function generateSingleCardElements(imageURL) { // uses an image to create a card element with a front (animation) and back (image) face\n const cardDivs = $(\"<div class='card'>\")\n .append(\"<div class='image cardFace' style='background-image: url(assets/images/smiley_edit.png)'>\")\n .append(\"<div class='image cardFaceBackground'>\")\n .append(\"<div class='image cardBack' style='background-image: url(\" + imageURL + \")'>\");\n const animationScene = $(\"<div class='scene'>\").append(cardDivs);\n $(\".cardsContainer\").append(animationScene);\n}", "function dealCard(cardimg) {\r\n var card = document.createElement(\"IMG\");\r\n card.src = cardimg;\r\n card.classList.add(\"card\")\r\n return card;\r\n }", "function drawScreen() {\n ctx.drawImage(pump, 100, 20);\n // we can change the size of the image if we want to\n // the last two numbers are the new width and height\n ctx.drawImage(pump, 420, 20, 100, 70);\n ctx.drawImage(pump, 420, 100, 140, 30);\n // we can also choose to only use part of the original image\n // this will be important later when we use sprite sheets\n // key: (Image, sx, sy, sw, sh, dx, dy, dw, dh) s=source d=destination\n ctx.drawImage(pump, 50, 10, 40, 120, 200, 220, 40, 120);\n ctx.drawImage(pump, 100, 30, 100, 120, 250, 240, 100, 120); \n ctx.drawImage(pump, 210, 50, 40, 120, 360, 260, 40, 120);\n \n \n}", "function draw() {\n // draws background rooms and handles movement from one to another\n adventureManager.draw();\n\n // Only draw scorecard on certain screens\n if( adventureManager.getStateName() === \"Splash\" ||\n adventureManager.getStateName() === \"Instructions\" ||\n adventureManager.getStateName() === \"Characters\" ||\n adventureManager.getStateName() === \"Four\" ||\n adventureManager.getStateName() === \"Five\" ||\n adventureManager.getStateName() === \"Eight\" ||\n adventureManager.getStateName() === \"Eleven\") {\n ;\n }\n else {\n stressCard.draw();\n }\n\n // draw the p5.clickables in front\n clickablesManager.draw();\n}", "function renderPlayingCard(xpos, ypos, innerColor, name) {\n\n var img = new Image();\n img.src = \"/images/playingcardback.png\";\n \n ctx.drawImage(img, xpos, ypos, playingCard.width, playingCard.height);\n\n if (innerColor) {\n ctx.beginPath();\n ctx.rect(xpos + 3, ypos + 3, playingCard.width - 6, playingCard.height - 6);\n ctx.fillStyle = colorThemePrimary;\n ctx.fill();\n ctx.stroke();\n ctx.closePath;\n\n ctx.beginPath();\n ctx.font = \"16px Georgia\";\n ctx.fillStyle = colorThemeSecondary;\n ctx.fillText(name, xpos + 12, ypos + 25);\n ctx.closePath();\n\n ctx.beginPath();\n ctx.font = \"16px Georgia\";\n ctx.fillStyle = colorThemeSecondary;\n ctx.fillText(name, xpos + playingCard.width - 25, ypos + playingCard.height - 20);\n ctx.closePath();\n }\n }", "function drawMobCard(mobCardId){\n var slot = mobCards[mobCardId].slotID;\n \n if (slot !== null) {\n var card = PIXI.Sprite.fromImage(mobCardFrameSrc);\n\n card.interactive = true;\n card.buttonMode = true;\n\n card.height = cardSlotHeight;\n card.width = cardSlotWidth;\n card.position.x = cardSlots[slot].x;\n card.position.y = cardSlots[slot].y;\n card.id = mobCardId;\n\n stage.addChild(card);\n\n cardDrawAllAttributes(card, false);\n cardDrawImage(card, false);\n cardDrawTitle(card, false);\n \n mobCardOjbects[mobCardId] = card;\n cardSlots[slot].cardID = mobCardId;\n \n card.mouseover = card.touchstart = function (data){\n //* - Add display larger card popup\n }; \n\n\n }\n }", "function drawFlipCard(cards) {\n\n _.each(cards, function(card) {\n\n var $tmplFlipCard = $($(\"#templateFlipCard\").html());\n\n // Set the name of the card for Google Analytics\n $(\"#data-cardname\", $tmplFlipCard).html(card.name);\n\n // Set the question for the front of the card\n $(\".question\", $tmplFlipCard).html(card.question)\n\n // Set the back content of the card\n $(\".back1\", $tmplFlipCard).html(card.back1);\n $(\".back2\", $tmplFlipCard).html(card.back2);\n $(\".back3\", $tmplFlipCard).html(card.back3);\n $(\".back4\", $tmplFlipCard).html(card.back4);\n $(\".back5\", $tmplFlipCard).html(card.back5);\n\n\n\n\n $(\"img.background-image\", $tmplFlipCard).attr(\"src\", \"img/training/\" + card.image);\n\n // _NOW_ we add this template to the training page\n $(\"#flipCardList\").append($tmplFlipCard);\n\n });\n\n // Flip Cards Flipping Script\n // ====================================\n $('.flip').on('click', function(event) {\n $(event.target).parents('.card').toggleClass('flipped');\n });\n\n}", "ImageViewer(data){\n\t\t\n\t\tconsole.log(\"ImageViewer\");\n\t\tconsole.log(data);\n\t\tlet viewCard = new Card('Viewer_', this.path);\n\t\tviewCard.setStyle(\"position\", \"absolute\");\n\t\t//viewCard.setStyle(\"position\", \"absolute\");\n\t\tviewCard.setStyle(\"top\", \"0px\");\n\t\tviewCard.setStyle(\"left\", \"0px\");\n\t\tviewCard.setStyle(\"width\", \"100%\");\n\t\tviewCard.setStyle(\"height\", \"100%\");\n\t\tviewCard.setStyle(\"background\", \"red\");\n\t\tviewCard.setStyle(\"zIndex\", \"1000\");\n\n\t\tlet PictElt = viewCard.setElement(\"PictElt\");\n\t\tviewCard.push(\"Image\", PictElt, \"MyPict\", data);\n\n\t\tviewCard.getContainer().addEventListener(\"click\",()=>viewCard.destroyMe());\n\n\n\t}", "function generateCard(cardData) {\n //Parent Container for cards\n var pp = document.createElement('div')\n pp.className = \"pp\"\n\n var cardContainer = document.createElement('div')\n cardContainer.className = \"card\"\n\n // cardContainer.append(generateCard(planet))\n\n // cardsBox.appendChild(cardContainer)\n var cardFront = document.createElement('div')\n cardFront.className = \"card__face card__face--front\"\n\n var cardBack = document.createElement('div')\n cardBack.className = \"card__face card__face--back\"\n\n var nameTag = document.createElement('p')\n nameTag.innerText = cardData.name\n // .appendChild(document.createTextNode(planet.name))\n\n\n cardBack.appendChild(createPTag(\"climate: \", cardData.climate))\n\n var l = createPTag(\"Gravity: \", cardData.gravity)\n cardBack.appendChild(l)\n\n var elDiam = createPTag(\"Diameter: \", cardData.diameter)\n cardBack.appendChild(elDiam)\n \n //this is how to you determine the image for the card\n var img = images.filter((el) => {\n return el.name == cardData.name\n })\n //return el.diameter > 20000\n if (img[0] != undefined) {\n // var imgEL = document.createElement('img')\n // imgEL.src = img[0].img\n cardFront.style.backgroundImage = `url(/${img[0].img})`\n cardFront.appendChild(nameTag)\n\n } else { ///Default Image\n var imgEL = document.createElement('image')\n imgEL.src = \"images/Alderaan.jpeg\"\n //cardFront.appendChild(imgEL)\n cardFront.style.backgroundImage = \"url(images/Alderaan.jpeg)\"\n cardFront.appendChild(nameTag)\n\n }\n\n cardContainer.appendChild(cardFront)\n cardContainer.appendChild(cardBack)\n pp.appendChild(cardContainer)\n return pp\n}", "function drawFaceDown(x, y, color)\n{\n const X_INC = 10;\n const Y_INC = 15;\n\n // Draw card background\n ctx.beginPath();\n ctx.rect(x, y, CARD_WIDTH, CARD_HEIGHT);\n ctx.fillStyle = color; // Default is white, hovered is gray\n ctx.fill();\n\n // Draw Lines\n ctx.strokeStyle = 'red';\n ctx.lineWidth = 1;\n\n let j = CARD_HEIGHT;\n let i = 0;\n\n // Top to right\n for (i = 0; i < CARD_WIDTH; i +=X_INC)\n {\n ctx.beginPath();\n ctx.moveTo(x + i, y);\n ctx.lineTo(x + CARD_WIDTH, y + j);\n ctx.stroke();\n\n j -= Y_INC; \n }\n\n j = CARD_HEIGHT;\n\n // Top to left\n for (i = CARD_WIDTH; i > 0; i -= X_INC)\n {\n ctx.beginPath();\n ctx.moveTo(x + i, y);\n ctx.lineTo(x, y + j);\n ctx.stroke();\n\n j -= Y_INC; \n }\n\n j = 0;\n\n // Bottom to right\n for (i = Y_INC; i < CARD_HEIGHT; i += Y_INC)\n {\n j += X_INC;\n\n ctx.beginPath();\n ctx.moveTo(x + CARD_WIDTH, y + i);\n ctx.lineTo(x + j, y + CARD_HEIGHT);\n ctx.stroke();\n }\n\n j = CARD_WIDTH;\n\n // Bottom to left\n for (i = Y_INC; i < CARD_HEIGHT; i += Y_INC)\n {\n j -= X_INC;\n\n ctx.beginPath();\n ctx.moveTo(x, y + i);\n ctx.lineTo(x + j, y + CARD_HEIGHT);\n ctx.stroke();\n }\n\n // Draw card outline\n ctx.beginPath();\n ctx.rect(x, y, CARD_WIDTH, CARD_HEIGHT);\n ctx.strokeStyle = 'black';\n ctx.stroke();\n}", "showFrontSide(card) {\n card.src = `./assets/images/${card.alt}.jpg`;\n }", "displayOutcomeCard(){\n // Prepare card value container\nconst span = document.createElement('span');\nspan.classList.add('briscaSpan');\nspan.innerHTML = `${this.outcomeCard[1]}`;\n// Prepare holder of background image and value\nconst li = document.createElement('li');\nli.classList.add('briscola');\n// Load holder with value and background image \nli.appendChild(span);\nli.style.backgroundImage =`${this.outcomeCard[0]}`;\n// Add composed card to ul container document\nconst ul = document.querySelector('ul');\nul.appendChild(li);\nreturn this.outcomeCard;\n }", "function paintCard(charObj, card) {\n\tcard.innerHTML = `\n\t<div class=\"card__innerline\">\n\t\t<div class=\"img__container\">\n\t\t\t<img src=\"${charObj.avatar}\" alt=\"\" id=\"avatar\" />\n\t\t</div>\n\t\t<div class=\"description__container\">\n\t\t\t<div class=\"char__name-title\">\n\t\t\t\tName: <span id=\"char__name\" class=\"text-danger fs-2 text-capitalize\">${\n\t\t\t\t\tcharObj.charName\n\t\t\t\t}</span>\n\t\t\t</div>\n\t\t\t<div class=\"char__ability-title\">\n\t\t\t\tAbility: <span id=\"char__ability\" class=\"text-danger fs-2 text-capitalize\">${\n\t\t\t\t\tcharObj.charAbility\n\t\t\t\t}</span>\n\t\t\t</div>\n\t\t\t<div class=\"char__size\">\n\t\t\t\t<div class=\"char__size-height\">\n\t\t\t\t\tHeight: <span id=\"char__height\" class=\"text-danger\">${\n\t\t\t\t\t\tcharObj.charHeight * 10\n\t\t\t\t\t}cm ${\" \"}</span>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"char__size-weight\">\n\t\t\t\t\tWeight: <span id=\"char__weight\" class=\"text-danger\">${\n\t\t\t\t\t\tcharObj.charWeight / 10\n\t\t\t\t\t}kg</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t`;\n}", "getUI() {\n \n let uiElement = document.createElement('div');\n uiElement.classList.add('card');\n uiElement.classList.add(this.location + 'Card');\n\n //Determine the background color of the card based on its colors (or land colors)\n let classColors = Object.create(this.colors); //So it copies the color values, not the reference to the array\n if (this.types.includes('Land')) {\n //If it's a land, add the colors it can produce\n for(let [code, color] of [['{W}', 'white'], ['{U}', 'blue'], ['{B}', 'black'], ['{R}', 'red'], ['{G}', 'green']])\n if (this.text.includes(code)) classColors.push(color)\n\n if (this.text.includes('mana of any')) {\n //Multicolored\n classColors.push('white', 'blue', 'black', 'red', 'green'); //So it is marked as multicolored\n }\n }\n let classColor = 'colorless';\n if (classColors.length > 1) {\n //Multicolored\n classColor = 'multicolored';\n }\n else if (classColors.length == 1) {\n //Monocolored\n classColor = classColors[0];\n }\n\n uiElement.classList.add(classColor)\n \n //Title: the name and cost of the card\n let title = document.createElement('div');\n title.classList.add('title');\n let name = document.createElement('span');\n name.classList.add('name');\n name.textContent = this.name;\n title.appendChild(name);\n let cost = document.createElement('span');\n cost.classList.add('cost');\n cost.innerHTML = insertSymbols(this.cost.text);\n title.appendChild(cost);\n uiElement.appendChild(title);\n\n let image = document.createElement('div');\n image.classList.add('image');\n\n //Load a card image to draw the card's painting\n let imgSource = document.createElement('img');\n imgSource.src = this.imageURL;\n imgSource.style.display = 'none'; //Hide the image as it is used only as a source for the canvas \n image.appendChild(imgSource);\n\n //The canvas displays a cropped version of the image\n let canvas = document.createElement('canvas');\n let ctx = canvas.getContext('2d');\n ctx.globalCompositeOperation = 'destination-over';\n imgSource.onload = () => {\n //(18,36), (205, 172) are original corners of the image\n let scale = imgSource.width / 223;\n ctx.drawImage(imgSource, scale*18, scale*36, scale*(205-18), scale*(172-36), 0, 0, canvas.width, canvas.height);\n }\n image.appendChild(canvas);\n uiElement.appendChild(image);\n\n //The line that shows the type and subtype (and expansion symbol)\n let type = document.createElement('div');\n type.classList.add('type');\n type.textContent = this.types.join(' ');\n if (this.subtypes.length > 0) //To avoid showing the blank hyphen, only display subtype if there is one\n type.textContent += ' - ' + this.subtypes.join(' ');\n uiElement.appendChild(type);\n\n let text = document.createElement('div');\n text.classList.add('text');\n text.innerHTML = insertSymbols(this.text.map(text => '<p>' + text + '</p>').join(''));\n uiElement.appendChild(text);\n\n if (this.types.includes('Creature')) {\n let stats = document.createElement('span');\n stats.classList.add('stats');\n stats.textContent = this.getPower() + '/' + this.getToughness();\n uiElement.appendChild(stats);\n this.statElement = stats; //For updating the values\n }\n \n uiElement.onclick = () => {\n //Click the card\n this.click();\n };\n\n return uiElement;\n \n }", "draw(ctx) {\n if (this.health > 18) this.health = 18;\n if (this.health < 1) this.health = 1;\n let sourceY = (18 - Math.floor(this.health)) * 21 + 2;\n //source x, y, source width, height, dest x, y, dest width, height\n ctx.drawImage(this.imagesheet, 2, sourceY, 205, 17, 2, 8, 200, 15);\n }", "function image() {\n /* Set background image to desired URL, throw error if invalid URL */\n canvas.style.backgroundImage = \"url('\" + value + \"')\";\n /* Modify CSS Properties */\n\n if (options) {\n /* Set Repeat */\n canvas.style.backgroundRepeat = options.repeat ? 'repeat' : 'no-repeat';\n /* Set Position */\n\n canvas.style.backgroundPosition = options.position ? options.position : 'center';\n /* Set Size */\n\n canvas.style.backgroundSize = options.size ? options.size : 'contain';\n /* Set Color */\n\n canvas.style.backgroundColor = options.color ? options.color : 'none';\n }\n }", "function makeCard(url,color, title){\n\tlet template = '<a href=\"'\n\ttemplate += url\n\ttemplate += '\" class=\"card text-center\" style=\"color: inherit;text-decoration: none;width: 18rem;height:200px;background-color:'\n\ttemplate += color + '\">'\n\ttemplate += '<div class=\"card-body\"><h4 class=\"card-title\">'\n\ttemplate += title\n\ttemplate += '</h5></div></a>'\n\treturn template\n}", "function _drawImage() {\n document.getElementById(\"bg-image\").style.backgroundImage = `url(${store.State.imgUrl})`\n\n}", "function nameInputWelcomeScreen() {\n canvas.style.backgroundImage = \"url('images/nwlogo2.png')\";\n canvas.style.backgroundSize = \"1069px 864px\";\n canvas.style.backgroundRepeat = \"no-repeat\";\n canvas.style.backgroundPosition = \"-458px -110px\";\n}", "draw() {\n // Displaying the image\n image(experimentImage, 0, 0, width, height);\n }", "turnCard(pickedCard){\n let img = this.cards[pickedCard].getImage();\n this.images[pickedCard].innerHTML = \"<img id='img\" + pickedCard + \"' src='./images/\" + img + \"'/>\";\n }", "drawCards() {\n let g = this,\n cxt = g.context,\n cards = window._main.cards;\n for (let card of cards) {\n card.draw(cxt);\n }\n }", "function SetUpFirstCard() {\n var song = songData[Math.floor(Math.random() * songData.length)];\n\n var img = currCard.getElementsByTagName('img')[0];\n img.setAttribute('draggable', 'false');\n img.setAttribute('src', song.imgUrl);\n img.setAttribute('alt', song.name);\n\n var url = img.getAttribute('src');\n cardShadow.style.backgroundImage = 'url(../'+url+')';\n\n heart = currCard.getElementsByTagName('span')[0];\n heart.setAttribute('id', 'heart');\n\n // Track Details\n var title = document.getElementById('panel_details-title');\n var artist = document.getElementById('panel_details-artist');\n\n title.innerHTML = song.name;\n artist.innerHTML = song.artist;\n}", "function drawCard() {\n var card = draw.pop();\n if (card) {\n discard.push(card);\n showCard(card);\n } else {\n shuffleCards();\n drawCard();\n }\n }", "function draw() {\n if (state === `title`) {\n background(0, 2, 97);\n title();\n frameCount = 0;\n } else if (state === `loading`) {\n background(0, 146, 214);\n unsureIfthisIsAnActualLoadingScreen();\n } else if (state === `bubblePoppin`) {\n background(3, 1, 105);\n mLfingerPopper();\n bubbleDisplay();\n bubbleMovement();\n playerCounter();\n conclusionConditions();\n } else if (state === `poppinChampion`) {\n background(189, 189, 189);\n winScreen();\n } else if (state === `bubblePoppinBaby`) {\n background(36, 36, 36);\n endScreen();\n }\n}", "function drawBackground() {\n var background = new Image();\n background.src = \"plain-bg2.png\";\n background.onload = function() {\n ctx.drawImage(background,0,0,canvas.width, canvas.height)};\n}", "display() {\n push();\n fill(120);\n image(imgKid, this.x, this.y, this.size, this.size);\n fill(color(255, 0, 0, 120));\n // set sprite for the predicted location of the kid to be slightly opaque\n tint(255, 126);\n image(imgKid, this.nextMoveX, this.nextMoveY, this.size, this.size);\n pop();\n\n }", "draw(){\n \n \n \n image(this.spriteSheet, this.charX, this.charY, this.frameWidth*1.5, this.frameHeight*1.5, this.currentFrameX, this.currentFrameY, this.frameWidth, this.frameHeight);\n }", "function displayCurrentCard(card) {\n var image = document.getElementById(\"card-img\");\n var imageLink = \"<img src='\" + card.image_uris.normal + \"' id='card-img'>\";\n // replace the current image with the new one\n image.outerHTML = imageLink;\n}", "function drawChest() {\n ctx.drawImage(treasureChest, treasurex-13, treasurey-13);\n}", "function drawOnDeck() {\n\t\tclearDeck()\n\t\tvar onDeckCanvas = document.getElementsByClassName(\"tetron-next-piece\")[0]\n\t\tvar ctx = onDeckCanvas.getContext(\"2d\");\n\t\tpieceOnDeck.draw(ctx, 2)\n\n\t}", "function largeCard(element) {\n\tvar exact = element.src;\n\tdocument.getElementById(\"light2\").style.display=\"block\";\n\tdocument.getElementById(\"fade\").style.display=\"block\";\n\t\n\tvar img = new Image();\n\timg.src = exact;\n\tdocument.getElementById(\"light2\").appendChild(img);\n}", "function drawPic(image){\n draw.clearRect(0,0,900,600);\n var pic = new Image();\n pic.src = image;\n pic.onload = function(){\n draw.drawImage(pic, 0, 0,900,600);\n };\n}", "function showCard(card,activePlayer){\n if(activePlayer.score <= 21){\n let cardImage = document.createElement('img');\n cardImage.src = `Images/${card}.png`\n document.querySelector(activePlayer.div).appendChild(cardImage);\n }\n}", "function showCard( suit, rank, direction, top, left ) {\r\n\tvar container = 'body';\r\n\tvar imageID = getCardID( suit, rank );\r\n\tvar imageName = Parameters.cardImages.folder + '/' + suit + rank + '.png';\r\n\tvar src = imageName;\r\n\t$( container ).append( '<img id=\"' + imageID + '\" class=\"fixed card\"></img>' );\r\n\tvar image = $( '#' + imageID );\r\n\timage.attr( 'src', src );\r\n\timage.attr( 'imageName', imageName );\r\n\timage.attr( 'status', 'not-played' );\r\n\timage.attr( 'suit', suit );\r\n\timage.attr( 'rank', rank );\r\n\timage.attr( 'direction', direction );\r\n\timage.css({\r\n\t\twidth: Parameters.cardImages.width,\r\n\t\theight: Parameters.cardImages.height,\r\n\t\ttop: top,\r\n\t\tleft: left,\r\n\t});\r\n}", "function backCard() {\r\n var backcard = document.createElement(\"IMG\");\r\n backcard.src = \"cards/blue_back.png\";\r\n backcard.classList.add(\"coverCard\");\r\n return backcard;\r\n }", "turnOverDealersHoleCard(){\n document.getElementById(\"holeCard\").src = this.dealer.hand[0].imageFilename;\n }", "function createShopcard(url, name, id) {\n var card = `<ons-card onclick=\"openHome(${id},'${url}')\"> \n <div class=\"content\">\n <ons-row>\n <ons-col><img src=\"` + url + `\"></ons-col><ons-col></ons-col>\n <ons-col class=\"right\">` + name + `</ons-col>\n </ons-row>\n </div>\n </ons-card>`;\n return card;\n}", "function enterDlc()\n{\n\t_canvas.style.backgroundImage = \"url(images/background.png)\";\n}", "draw() {\r\n if(this.type === 'dog') {\r\n this.image.src = '../images/dog.png';\r\n } else {\r\n this.image.src = \"../images/banana.png\";\r\n }\r\n context.drawImage(this.image, this.x, this.y, this.width, this.height);\r\n }", "function renderPrizeCard(card) {\n xpos = canvas.width / 2 - playingCard.width / 2;\n ypos = canvas.height / 2 - playingCard.height / 2;\n ctx.beginPath();\n ctx.rect(xpos - 20, ypos - 20, playingCard.width + 40, playingCard.height + 40);\n ctx.strokeStyle = colorThemeSecondary;\n ctx.stroke();\n ctx.closePath();\n if (!turnResolutionTime && !matchResolutionTime && card !== undefined && (card.name)) {\n var cardName = cardInitial(card.name);\n renderPlayingCard(xpos, ypos, playingCard.frontColor, cardName);\n }\n }", "function showBackground() {\n\n clearGameBoard();\n var background = new Image();\n background.src = 'images/background05.png';\n ctx.drawImage(background, 0, 0, game.width, game.height);\n\n var fontSize = game.width * 0.025;\n ctx.font = fontSize+'pt Calibri';\n\n if (game.width >= 768) {\n ctx.lineWidth = 3.3;\n } else {\n ctx.lineWidth = 1.5;\n }\n \n // stroke color\n ctx.strokeStyle = 'yellow';\n \n ctx.shadowColor = \"rgba(0,0,0,0.3)\";\n\n if (game.width >= 768) {\n ctx.strokeText('Space Invaders', game.width/2 - (fontSize*5), fontSize + 10);\n } else {\n ctx.strokeText('Space Invaders', 160, 15);\n }\n \n\n }", "function ImagePathing(CardNumber,SuitNumber) {\n var mapping_numbers = {\n Two : \"2\",\n Three : \"3\",\n Four : \"4\",\n Five : \"5\",\n Six : \"6\",\n Seven : \"7\",\n Eight : \"8\",\n Nine : \"9\",\n Ten : \"10\",\n Jack : \"jack\",\n Queen : \"queen\",\n King : \"king\",\n Ace : \"ace\",\n Red : \"red\",\n Black: \"black\"\n }\n var mapping_suits = {\n Clubs : \"clubs\",\n Diamonds : \"diamonds\",\n Spades : \"spades\",\n Hearts : \"hearts\",\n Jokers : \"joker\"\n }\n\n if(SuitNumber != \"Jokers\") {\n if(CardNumber == \"Jack\" || CardNumber == \"King\" || CardNumber ==\"Queen\") {\n var src = \"../assets/images/\"+mapping_numbers[CardNumber]+\"_of_\"+mapping_suits[SuitNumber]+\"2.png\"\n }\n else {\n var src = \"../assets/images/\"+mapping_numbers[CardNumber]+\"_of_\"+mapping_suits[SuitNumber]+\".png\"\n }\n }\n else {\n var src = \"../assets/images/\"+mapping_numbers[CardNumber]+\"_\"+mapping_suits[SuitNumber]+\".png\"\n }\n var srcImage = new Image();\n srcImage.src = src\n var rasterImage = new paper.Raster(srcImage);\n var cloneImage = new paper.Raster(srcImage);\n rasterImage.visible = false;\n rasterImage.scale(0.2);\n cloneImage.visible = false;\n cloneImage.scale(0.2);\n\n\n var imgObj = {\n srcImage : srcImage,\n rasterImage : rasterImage,\n cloneImage : cloneImage\n }\n return imgObj;\n}", "function drawFood () {\r\n ctx.drawImage(image, food.x, food.y, food.w, food.h);\r\n}", "function addImageToScreen(myURL) {\n\n}", "function cardData() {\n const appId = \"da9ee3ddb46b386ecd69f797bbede23b\";\n const cityName = (currentLocation).replace(/\\s+/g, '');\n \n const weather = \"http://api.openweathermap.org/data/2.5/weather?q=\" + currentLocation + \"&APPID=\" + appId;\n\n \n\n $.getJSON(weather,function(json){\n console.log(json)\n temperature = Math.round((parseInt(json.main.temp) * 9/5) - 459.67);\n forecast = (json.weather[0].description)\n humidity = json.main.humidity;\n\n console.log(temperature, forecast, humidity);\n let forecastAsString = forecast.replace(/\\s+/g, '');\n let myImage = \"https://source.unsplash.com/200x200/?\"+ cityName + \",forecast,\" + forecastAsString;\n console.log(myImage)\n $(\".card-img-top\").attr('src', myImage);\n $(\"#lmage-pic\").attr('src', myImage);\n$(\"#\" + cityName + \"-temperature\" ).text(temperature);\n$(\"#\" + cityName + \"-forecast\" ).text(forecast);\n$(\"#\" + cityName + \"-humidity\" ).text(humidity);\n\n \n });\n let s = new WeatherDisplay(currentLocation, temperature, forecast, humidity); \ns.makeCard()\n}", "function draw() {\n\n if (currentSetting == \"home\") {\n background(\"purple\");\n image(couch, 140, 200);\n image(box, 130, 220);\n image(drben1, 230, 220);\n image(radio, 260, 350);\n } else if (currentSetting == \"office\") {\n background(\"gray\");\n image(drben2, 200, 200);\n } else if (currentSetting == \"lab\") {\n background(\"lightblue\");\n image(table, 200, 320);\n image(drben3, 300, 200);\n image(boozy, 180, 230);\n fill(\"#C0C0C0\");\n noStroke();\n rect(0, 600, width, 400);\n }\n\n textSize(40);\n textAlign(CENTER, CENTER);\n textFont(\"georgia\");\n text(story, 300, 100, width / 2);\n\n //instructions\n textSize(20);\n fill('white');\n text(\"Click mouse to continue story\", 50, 70, 100);\n}", "function setupCanvas() {\r\n var gameCanvas = \"gameCanvas\";\r\n var height = 500;\r\n var width = 800;\r\n var square = 100;\r\n \r\n backgroundImg = new imageLib(gameCanvas, width, height, 0, 0);\r\n \r\n /*Add background image to canvas*/\r\n backgroundImg.addImg(gameImage.loadedImg[\"background\"]);\r\n \r\n /*Setup interface screens*/\r\n setupInterfaces();\r\n \r\n /*Initiate grid*/\r\n //backgroundImg.canvasGrid(backgroundImg.canvas.width, backgroundImg.canvas.height);\r\n backgroundImg.canvasGrid(square); //Square size\r\n backgroundImg.gridSqHeight = square;\r\n backgroundImg.gridSqWidth = square;\r\n setupGridSpots();\r\n \r\n /*Set up the game ref*/\r\n backgroundImg.gameRef.turn = \"character\";\r\n backgroundImg.gameRef.preTurn = \"wolf\";\r\n \r\n backgroundImg.gameRef.players.push(\"character\");\r\n backgroundImg.gameRef.players.push(\"wolf\");\r\n \r\n backgroundImg.gameRef.actionList.push(\"charRoll\"); \r\n backgroundImg.gameRef.action = \"waitRoll\";\r\n \r\n /*Draw the character on the screen*/\r\n setupCharacter(gameCanvas);\r\n addEnemy(gameCanvas);\r\n \r\n /*Drawing out paths in the game*/\r\n //setupObstacles();\r\n \r\n /*Draw up the cards*/\r\n setupCard(gameCanvas);\r\n setupCardChoices();\r\n \r\n /*Draw up the dice images*/\r\n setupDiceImg(gameCanvas);\r\n \r\n /*Draw up trap images*/\r\n setupTrapImg(gameCanvas);\r\n}", "draw(ctx) {\n const {x, y, w, h, radius, isMatched, scaleX, scaleY, img} = this;\n const grd = ctx.createLinearGradient(x, y, x + w, y + h);\n\n ctx.save();\n ctx.translate(x + 0.5 * w, y + 0.5 * h); // TRANSLATE TO SHAPE CENTER\n ctx.scale(scaleX, scaleY);\n ctx.translate(-(x + 0.5 * w), -(y + 0.5 * h)); // TRANSLATE CENTER BACK TO 0, 0\n ctx.beginPath();\n ctx.moveTo(x, y + radius);\n ctx.lineTo(x, y + h - radius);\n ctx.quadraticCurveTo(x, y + h, x + radius, y + h);\n ctx.lineTo(x + w - radius, y + h);\n ctx.quadraticCurveTo(x + w, y + h, x + w, y + h - radius);\n ctx.lineTo(x + w, y + radius);\n ctx.quadraticCurveTo(x + w, y, x + w - radius, y);\n ctx.lineTo(x + radius, y);\n ctx.quadraticCurveTo(x, y, x, y + radius);\n grd.addColorStop(0, '#800080');\n grd.addColorStop(1, '#660066');\n ctx.fillStyle = grd;\n ctx.strokeStyle = '#D896FF';\n ctx.lineWidth = 10;\n ctx.stroke();\n ctx.fill();\n\n // DRAW IMAGE IF CARD IS MATCHED\n\n ctx.clip();\n if (isMatched && scaleX >= 0 ) {\n\n ctx.drawImage(img, 0, 0, w, h, x, y, w, h);\n }\n ctx.restore()\n }", "function makecard(cardtitle, imagepath, clickaction, settingsaction = \"\") {\n if (imagepath == \"\") {\n imagepath = \"img/apppicture.png\"\n };\n var settingshtml = \"\";\n if (settingsaction != \"\") {\n settingshtml = `\n <div class=\"settingsicon\" onclick=\"${settingsaction}\">\n <i class=\"large material-icons w3-hover-opacity\" style=\"position: absolute;\">settings</i>\n </div>\n `.trim();\n };\n var cardtemplate = `\n <div class=\"w3-card appcard w3-margin\" onclick=\"${clickaction}\">\n ${settingshtml}\n <div class=\"appimgdiv\"><img src=\"${imagepath}\" class=\"appimg\"></div>\n <div class=\"w3-container\">\n <span class=\"apptitle\">${cardtitle}</span>\n </div>\n </div>\n `;\n $(\"#bodycontent\").append(cardtemplate);\n}", "function DisplayCard(){\n console.log(\"Displaying Card\", $(this).data(\"card\"));\n // $('#card-single > img').attr(\"src\",card.imageUrl);\n}", "function draw() {\n imageMode(CENTER);\n background(253, 226, 135);\n paper.display();\n ground.display();\n dustbin1.display();\n dustbin2.display();\n dustbin3.display();\n drawSprites();\n\n}", "draw () {\n\t\t\n\t\tthis._size_elements ()\n\n\t\tvar i = 0\n\t\tthis._figures.forEach (f => {\n\t\t\t\n\t\t\t// Draw non playable cards\n\t\t\tvar card = this._deck_blue [f]\n\t\t\tvar [x, y] = this.get_slot_coo (i, 2.5)\n\t\t\tif (card.slot >= 0) {\n\t\t\t\t[x, y] = this.get_slot_coo (card.slot, 1)\n\t\t\t}\n\t\t\tcard.set_pos_size (x, y)\n\t\t\tcard.draw ()\n\t\t\t\n\t\t\t// Draw playable cards\n\t\t\tvar card = this._deck_red [f]\n\t\t\tvar [x, y] = this.get_slot_coo (i, -1.5)\n\t\t\tif (card.slot >= 0) {\n\t\t\t\t[x, y] = this.get_slot_coo (card.slot, 0)\n\t\t\t}\n\t\t\tcard.set_pos_size (x, y)\n\t\t\tcard.draw ()\n\n\t\t\t// Draw help text of car is highlighted\n\t\t\tif (card.is_highlighted ()) {\n\t\t\t\tvar key = `help_${f}`\n\t\t\t\tvar font_size = this.context.canvas.width / 50\n\t\t\t\tvar [x, y] = this.get_slot_coo (0, 1.75)\n\t\t\t\tthis._draw_banner (this._language [key], \"rgba(0, 0, 0, 0.6)\", y, font_size)\n\t\t\t}\n\t\t\t\n\t\t\ti += 1\n\t\t})\n\n\t\tthis._draw_scores ()\n\t\t\t\t\n\t\t// Draw winner banner\n\t\tif (this._winner != -1) {\n\t\t\t\n\t\t\tvar [x, y] = this.get_slot_coo (0, 1.75)\n\n\t\t\tif (this._winner == this._swap_color)\n\t\t\t\tthis._draw_banner (this._language.red_wins, \"rgba(200, 0, 0, 0.6)\", y, -1)\n\n\t\t\telse if (this._winner == (1-this._swap_color))\n\t\t\t\tthis._draw_banner (this._language.blue_wins, \"rgba(0, 0, 200, 0.6)\", y, -1)\n\t\t\t\n\t\t\telse if (this._winner == 2)\n\t\t\t\tthis._draw_banner (this._language.drawn, \"rgba(200, 200, 200, 0.6)\", y, -1)\n\t\t}\n\t}", "function paint(id, card) {\n let lastTime = null;\n let cycle = 0;\n\n function animate(time) {\n\n // Make sure 80ms have passed to paint next frame\n if (time - lastTime < 80)\n return requestAnimationFrame(animate);\n\n // Update animation variables and select correct card rect from sprite map\n lastTime = time;\n const offsetX = 22 * cycle;\n const offsetY = 38 * cards.indexOf(card);\n const cx = document.getElementById(id).getContext(\"2d\");\n cx.imageSmoothingEnabled = false;\n cx.drawImage(cardSprites, offsetX, offsetY, 22, 38, 0, 0, 44, 76);\n cycle++;\n\n // Card paint animation complete (animation may not be over)\n if (cycle > 4) {\n if (animationOver)\n setTimeout(toggleHandlers, 50);\n return;\n }\n\n requestAnimationFrame(animate);\n }\n\n requestAnimationFrame(animate);\n}", "function enterMount()\n{\n\t_canvas.style.backgroundImage = \"url(images/background.png)\";\n}", "function backCard(){\n\tdealer.hand.push(shuffledDeck.shift());\n\tfaceDown = document.createElement(\"img\");\n\tfaceDown.src = \"./cardImgs/cardback.jpg\";\n\tfaceDown.classList.add(\"dealtCards\");\n\tdocument.querySelector(dealer.selector).appendChild(faceDown);\n}", "function addDrawing(drawing) {\n const card = document.createElement('div');\n card.className = 'card';\n\n const link = document.createElement('a');\n link.setAttribute('target', '_blank');\n link.setAttribute('href', drawing.path);\n\n const image = document.createElement('img');\n image.className = 'card-img-top border-bottom';\n image.setAttribute('src', drawing.path);\n image.setAttribute('alt', 'Card image cap');\n link.appendChild(image);\n\n const body = document.createElement('div');\n body.className = 'card-body';\n\n const titleHeader = document.createElement('h5');\n titleHeader.className = 'card-title';\n const titleText= document.createTextNode(drawing.title);\n titleHeader.appendChild(titleText);\n body.appendChild(titleHeader);\n\n const submissionStatus = document.createElement('p');\n submissionStatus.className = 'card-text';\n const submissionStatusSmall = document.createElement('small');\n submissionStatusSmall.className = drawing.submitted ? 'text-success' : 'text-danger';\n const submissionStatusText = drawing.submitted ? 'Submitted' : 'Not submitted';\n submissionStatusSmall.appendChild(document.createTextNode(submissionStatusText));\n submissionStatus.appendChild(submissionStatusSmall);\n body.appendChild(submissionStatus);\n\n const lastUpdated = document.createElement('p');\n lastUpdated.className = 'card-text';\n const lastUpdatedSmall = document.createElement('small');\n lastUpdatedSmall.className = 'text-muted';\n const lastUpdatedText = `Last updated ${drawing.min_since_edit} minutes ago`;\n lastUpdatedSmall.appendChild(document.createTextNode(lastUpdatedText));\n lastUpdated.appendChild(lastUpdatedSmall);\n body.appendChild(lastUpdated);\n\n link.appendChild(body);\n card.appendChild(link);\n\n const currentCards = drawingsRow.querySelectorAll('.card');\n if (!currentCards)\n drawingsRow.appendChild(card);\n else\n drawingsRow.insertBefore(card, currentCards[0]);\n}", "function showimg(){\n// ctx.restore();\n ctx.fillStyle=\"#123456\";\n ctx.fillRect(0,0,50,50);\n ctx.save();\n }", "function _createBackground() {\n background = new Surface({\n size : [undefined,undefined],\n content: \"<canvas id='capturedPhoto' width='250' height='250'></canvas>\",\n properties: {\n backgroundColor: '#C0C0C0'\n }\n });\n\n this._add(background);\n }", "function viewRecipeCardMaker(text){\r\n if(view_recipe_card){\r\n var card = document.createElement('div');\r\n card.className = 'big-card';\r\n card.innerHTML = '<div class=\"big-image\" style=\"background-image: url('+text.img+');\"></div>' +\r\n '<div class=\"name\">' +\r\n '<h1>'+text.name+'</h1>' +\r\n '</div>' +\r\n '<div class=\"view-other\">' +\r\n '<p><span>Description: </span><br>'+text.description+'</p>' +\r\n '<p><span>Ingredients: </span><br>'+text.ingredients+'</p>' +\r\n '<p><span>Instructions: </span><br>'+text.instructions+'</p>' +\r\n '</div>';\r\n view_recipe_card.appendChild(card);\r\n } \r\n}", "function drawCar(carData) {\n console.log(carData);\n var $carCard = createCard(carData);\n \n //Empty out the current car info\n $carInfo.html('');\n \n //Put our new car card in the box\n $carInfo.append($carCard);\n}", "function SetUpNextCard() {\n screen.getElementsByTagName('div')[0].setAttribute('id', 'panel-curr');\n\n currCard = document.getElementById('panel-curr');\n currCard.setAttribute('class', 'panel');\n currCard.style.transition = 'all 0.3s ease-in-out';\n currCardPos = {};\n\n heart = currCard.getElementsByTagName('span')[0];\n heart.setAttribute('id', 'heart');\n\n mc = new Hammer.Manager(currCard);\n mc.add(new Hammer.Pan());\n mc.add(new Hammer.Press());\n\n CreateEvents();\n\n var url = currCard.getElementsByTagName('img')[0].getAttribute('src');\n cardShadow.style.backgroundImage = 'url(../'+url+')';\n\n setTimeout(function() {\n ShadowOpacity(maxOpacity, 0.3);\n }, 300);\n}", "function drawCard(deckDisplay) {\n recordFlyAction();\n if (!continueIfMoreThan2Actions(document.getElementById(\"flyCb\"))) return;\n\n let deck = deckDisplay.deck;\n isDrawing = true;\n disableDrawButtons();\n deckDisplay.displayCardBack();\n get(deck.navPath, createOnSendLoadCallback(deckDisplay, displayNavCard), createOnSendErrorCallback(\n deckDisplay));\n}", "display() {\n noStroke();\n fill(0);\n rect(this.frame.x,this.frame.y,1,1);\n imageMode(CENTER);\n image(girl_Img,this.frame.x+0.5,this.frame.y+0.5,2.25,2.75);\n }", "function draw() {\n \n image(camara, 0,0,width,width);\n \n}", "function drawBackground(){\n ctx = myGameArea.context;\n //clear canvas\n ctx.clearRect(0, 0, 6656, 468);\n backgroundImg.draw();\n \n }", "function drawBoard(cards) {\n\tctx.save();\n\n\t// Drawing the bakground:\n\n\theight = canvas.height;\n\t// Assume we are not as tall as we are wide\n\twidth = canvas.width;\n\n\tctx.fillStyle = BACKGROUNDCOLOR;\n\tdrawRoundRect(ctx, 0, 0, width, height, 5, true, false);\n\n\n\n\t// Drawing the cards\n\twidth = (height / DESIRED_ASPECT_RATIO);\n\n\tlet numCards = cards.length;\n\tlet rows = 3;\n\tlet columns = numCards / rows;\n\n\t// adjust display width if more than the expected number of columns.\n\twidth = (width * columns / 4.0);\n\n\t// calculate board offset, to keep centered.\n\t// Must be done after expanding for more cards\n\tboardOffset = (canvas.width - width) / 2;\n\n\t// must be done after expanding for more cards.\n\tlet cardWidth = (width / columns);\n\tlet cardHeight = (height / rows);\n\n\tctx.translate(boardOffset, 0);\n\n\tlet i, j;\n\tfor (i = 0; i < columns; i++) {\n\t\tfor (j = 0; j < rows; j++) {\n\t\t\tctx.save();\n\t\t\tctx.translate(i * cardWidth, j * cardHeight);\n\t\t\tdrawCard(\n\t\t\t\tctx,\n\t\t\t\tcards[i * rows + j],\n\t\t\t\ti * rows + j,\n\t\t\t\tcardWidth,\n\t\t\t\tcardHeight,\n\t\t\t\tselectedCards\n\t\t\t);\n\t\t\tctx.restore()\n\t\t}\n\t}\n\tctx.restore()\n}", "function flashCardRunner(flashCards)\n {\n canvas.clear()\n var flashCards = $(\".blue\").map(function()\n {\n return $(this).attr('id');\n }).get();\n var totalFlashCards = flashCards.length;\n var thisCardNumber = 0;\n var theCard;\n for (var i = 0; i <= flashCards.length; i++)\n {\n theCard = flashCards[i];\n renderImage(theCard, totalFlashCards, thisCardNumber);\n thisCardNumber += 1;\n }\n }", "function draw() {\n // background for display\n background (255, 255, 255);\n\n // Set up instructions for when player experience begins and ends\n switch (masterpiece) {\n case \"TITLE\":\n displayTitle();\n break;\n\n case \"GAME\":\n displayGame();\n break;\n\n case \"GAME OVER\":\n displayGameOver();\n break;\n }\n\n // create mural to frame game\n image(mural,width/2,height/2,windowWidth,windowHeight);\n}", "function canvas_init(){\n\tcanvas = document.getElementById(\"pacman\");\n\tctx = canvas.getContext(\"2d\");\n\t\n\tctx.drawImage(spriteSheet, 320, 1, 465, 140, 0, 0, 465, 140); //gameboard\n\t\n\tctx.drawImage(spriteSheet, 80, 0, 20, 20, 130, 27, 20, 20); //pacman\n\t\n\tctx.drawImage(spriteSheet, 40, 80, 20, 20, 280, 28, 20, 20); //ghost (red)\n\t\n}", "function showCard(cardNum, cardName) {\r\n\tflipCardSnd.play();\r\n\t$(\"#cardImg\" + cardNum).attr(\"src\", \"/Resources/deck/\" + cardName + \".gif\");\r\n}", "function addCardToHand(card) {\n $('#hand').append('<img src=\"/assets/images/cards/' + card + '.png\" class=\"gamecard\">');\n $('#hand .gamecard:last').click(function() {\n if($(this).parent().is('#scrap') ) { // if in scrap, run scrap onclick, don't want to select this card\n $('#scrap').click();\n return; \n }\n // clicking on card toggles its active class, removes other actives if it's active\n if(! $(this).hasClass('active') )\n $('.gamecard').removeClass('active');\n $(this).toggleClass('active');\n });\n $('#hand .gamecard:last').dblclick(function() {\n //doubleclicking on card in lineup opens damage modal\n if($(this).parent().hasClass('lineup') ) {\n openDmgModal($(this) );\n }\n });\n}", "render() {\n const {deselectMarker} = this.props;\n const point = this.point;\n\n const state = this.getCardState();\n const className = 'point-card' + ( state ? ( ' ' + state ) : '' );\n\n if ( point.isFetching ) {\n return (\n <Card className={ className }>\n <CircularProgress className=\"point-card__spinner\"\n size={ 2 } />\n </Card>\n );\n }\n\n let coverPhotoUrl = this.props.coverPhotoUrls[this.point._id];\n let coverPhotoStyle = {};\n if ( coverPhotoUrl ) {\n coverPhotoStyle.backgroundImage = `url(${coverPhotoUrl})`;\n }\n\n return (\n <Card className={ className }>\n <CardHeader className=\"point-card__header\"\n title={ point.name }\n subtitle={ display( point.type ) }\n avatar={ <LocationIcon className=\"point-card__avatar\"/> }>\n { this.getIconMenu() }\n </CardHeader>\n <div className=\"point-card__scroll\">\n <CardMedia className=\"point-card__media\"\n style={ coverPhotoStyle } />\n { this.getCardContent() }\n </div>\n <CardActions className=\"point-card__actions\">\n { this.getCardAction() }\n <RaisedButton label=\"Close\"\n onTouchTap={ deselectMarker } />\n </CardActions>\n </Card>\n );\n }", "draw(game, canvas, sData, src) {\n sData = sData === null || sData === undefined ? {} : sData; var data = {}; var v;\n for (v in sData) data[v] = sData[v];\n var defaults = {x: 0, y: 0, w: 100, h: 100, t: 0, r: 0, transparency: 1, type: \"rect\", animate: false, n: 2}; // type: rect or circle, requires color specified\n var utils = tetresse.modules.defaultGraphics.utils;\n var sources = tetresse.modules.defaultGraphics.sources;\n if (typeof(src) === \"string\") src = sources[src];\n if (src === undefined) return;\n if (typeof(src) === \"string\" && defaults.color === undefined) defaults.color = src;\n for (v in defaults) if (data[v] === undefined) data[v] = defaults[v];\n var srcCopyArr = [\"color\"]; for (v of srcCopyArr) if (data[v] === undefined) data[v] = src[v];\n\n if (typeof(src.src) === \"function\") utils.draw(game, canvas, data, src.src);\n var ctx = canvas.getContext(\"2d\");\n ctx.beginPath();\n if (data.type === \"rect\" && data.color !== undefined) {\n if (data.color === \"clear\") {\n ctx.clearRect(data.x * data.n, data.y * data.n, data.w * data.n, data.h * data.n);\n } else {\n ctx.rect(data.x * data.n, data.y * data.n, data.w * data.n, data.h * data.n);\n ctx.fillStyle = data.color;\n ctx.fill();\n }\n }\n if (src.img !== undefined) {\n var img;\n if ((img = sources.imgs[src.img]) !== undefined && img.loaded) {\n var w = 1; var h = 1;\n if (img.ele.width / img.ele.height > data.w / data.h) w = h * (data.w / data.h); // crop width\n else h = w * (data.h / data.w); // crop height\n ctx.drawImage(img.ele, 0, 0, w * img.ele.height, h * img.ele.height, data.x, data.y, data.w, data.h);\n } else { console.warn(\"[defaultGraphics utils.draw] src.img not loaded: %s\", src.img); }\n }\n if (src.generate !== undefined) src.generate(canvas, src, data);\n if (data.animate) {\n utils.animate(game, canvas, data, src);\n var animations = game.modules.defaultGraphics.animations;\n data.animate = false; data.t = window.performance.now() ? window.performance.now() : (new Date()).getTime();\n animations.active.push({canvas: canvas, src: src, data: data});\n if (animations.loop === null)\n animations.loop = window.requestAnimationFrame((function(time) {\n for (var v of this.modules.defaultGraphics.animations.active)\n tetresse.modules.defaultGraphics.utils.animate(this, v.canvas, v.data, v.src);\n }).bind(this, game));\n }\n if (typeof(src.srcAfter) === \"function\") src.srcAfter(game, canvas, data, src);\n }" ]
[ "0.7138788", "0.70901823", "0.68538374", "0.65749055", "0.65520597", "0.649731", "0.6435146", "0.6351824", "0.6321167", "0.6316964", "0.6283189", "0.62705356", "0.62604505", "0.62524587", "0.62488306", "0.6237338", "0.6226093", "0.6209804", "0.61972326", "0.6174994", "0.61652136", "0.6164718", "0.6148747", "0.6144818", "0.613789", "0.6131385", "0.61217743", "0.6100507", "0.6096486", "0.6082368", "0.60464066", "0.60393256", "0.6022488", "0.60202503", "0.60153955", "0.59933597", "0.59881836", "0.59712887", "0.59697247", "0.59660864", "0.5963313", "0.59567475", "0.5953707", "0.59472376", "0.59408176", "0.5922562", "0.5917482", "0.5906082", "0.59001046", "0.5894314", "0.5886419", "0.5872296", "0.58710206", "0.58705187", "0.58677614", "0.5865663", "0.58635396", "0.58598876", "0.5856887", "0.58493775", "0.5849252", "0.58484465", "0.58467585", "0.5845834", "0.58447003", "0.5842359", "0.58404684", "0.583351", "0.5828416", "0.5824388", "0.5815025", "0.5814507", "0.5810584", "0.5797591", "0.5789291", "0.5787988", "0.57856303", "0.5785088", "0.57776093", "0.5772289", "0.57703865", "0.5759289", "0.5758494", "0.5752826", "0.57463175", "0.57416505", "0.57341725", "0.5733637", "0.5722609", "0.5722299", "0.5718583", "0.5710114", "0.5709288", "0.5700751", "0.5696785", "0.5696474", "0.56925625", "0.5691726", "0.56916696", "0.56828254" ]
0.6997925
2
A notify function that automatically fades out any notifications over 3s
function notify(text) { var el = $('<div class="tn-box tn-box-color-1"><p class="notification-message">' + text + '</p><button class="closebutton btn btn-success">OK</button></div>') $(".notifications").append(el); setTimeout(function() { el.addClass("tn-box-active"); el.fadeOut(3000, function() { $(this).remove(); }); }, 300); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 notification(title, image, msg) {\n // Assign the notification as active if its not already\n if (!notificationBox.classList.contains(\"visible\")) {\n notificationBox.innerHTML = notificationHTML(title, image, msg);\n notificationBox.classList.toggle(\"visible\");\n\n sleep(4000).then(() => {\n // Remove visible if its still there\n if (notificationBox.classList.contains(\"visible\")) {\n notificationBox.classList.toggle(\"visible\");\n }\n });\n }\n}", "function notice(timeSec)\n{\n var notification = document.getElementsByClassName('notice')[0];\n if (timeSec === undefined || isNaN(timeSec)) {\n\ttimeSec = 3;\n }\n\t\t$(notification).fadeIn();\n setTimeout(function(){\n\t\t\t$(notification).fadeOut();\n }, timeSec * 1000);\n}", "function flash_animations() {\n if ($('#notify > div').length > 0) {\n $('#notify').show();\n }\n\n $('#flash').delay(500).fadeIn('normal', function () {\n $(this).delay(4000).fadeOut('normal', function () {\n $(this).hide();\n $('#notify').hide();\n });\n });\n}", "function showNotification() {\n notification.classList.add('show');\n setTimeout( () => {notification.classList.remove('show');}, 3000);\n}", "function displaynotification(){\n //display the notification\n notificationelement.classList.add('show')\n setTimeout( () => {\n notificationelement.classList.remove('show')\n },1000)\n}", "function notification(target, time) {\n var a = \"#\" + target;\n $(\".notification-box\").removeClass(\"show\");\n setTimeout(() => {\n $(a).addClass(\"show\");\n }, 300);\n if (time) {\n time = time + 300;\n setTimeout(() => {\n $(\".notification-box\").removeClass(\"show\");\n }, time);\n }\n}", "function addNotification(text) {\n var el=document.createElement(\"div\");\n el.innerHTML=text;\n el.setAttribute(\"class\",\"notification\");\n $(\"#notifications\")[0].appendChild(el);\n setTimeout(function() {\n fadeAway(el,0.85);\n },2000);\n}", "function blinkNotify(selector) {\n var element = $(selector);\n setInterval(function () {\n element.fadeIn(500, function () {\n element.fadeOut(500, function () {\n element.fadeIn(1000);\n });\n });\n }, 2000);\n}", "function notif(cont,clr) {\n var not = $.Notify({\n caption : \"<b>Notifikasi</b>\",\n content : cont,\n timeout : 3000,\n style :{\n background: clr,\n color:'white'\n },\n });\n}", "function notif(cont,clr) {\n var not = $.Notify({\n caption : \"<b>Notifikasi</b>\",\n content : cont,\n timeout : 3000,\n style :{\n background: clr,\n color:'white'\n },\n });\n}", "function notif(cont,clr) {\n var not = $.Notify({\n caption : \"<b>Notifikasi</b>\",\n content : cont,\n timeout : 3000,\n style :{\n background: clr,\n color:'white'\n },\n });\n}", "function hideNotification() {\n\t\t$('.notification').fadeOut('slow');\n\t}", "function notify(){\n\n var opt = {\n type: \"basic\",\n title: \"Your need a break\",\n message: \"Rest your eyes to stay healthy!\",\n iconUrl: \"images/coffee.png\"\n }\n\n\topt.buttons = [];\n\topt.buttons.push({ title: 'Take a break' });\n\topt.buttons.push({ title: 'In a few minutes' });\n\n chrome.notifications.clear('ec' + (notId - 1), clearCallback);\n chrome.notifications.create('ec' + notId++, opt, creationCallback);\n if (soundsON){ $('#audioNotif').trigger('play'); }\n}", "function showNotif(notif, color) {\n $(\".notification\").text(notif).addClass(\"show\").css(\"background-color\", color);\n setTimeout(function() {\n $(\".notification\").removeClass(\"show\");\n }, 4000);\n }", "function showNotification(elementId) {\n\n var elem = $(\"#\" + elementId);\n\n elem.show();\n setTimeout(function () { elem.hide(); }, 3000);\n}", "function flash_notice( msg ){\n\t\tj('#notib').html( msg ).fadeIn()\n\t\tsetTimeout( \"j('#notib').fadeOut()\", 5000 )\n\t}", "function showPopNotification(str, cb) {\n showNotif(str);\n setTimeout(function () {\n hideNotif();\n if (cb) {\n cb();\n }\n }, 3000);\n}", "function Notify()\n{\n notify = app.CreateNotification( \"AutoCancel\" );\n notify.SetMessage( \"Hello!\", \"MDL Demo\", \"Wake Up!\" );\n\tnotify.Notify(); \n}", "function ShowNotification (text : String[]) {\n\tvar speed = 0.1f;\n\tvar size : float;\n\tvar t : float;\n\t\n\tshowOverlay(text.length * notificationTime);\n\tnotification.enabled = true;\n\tfor (var i=0; i<text.length; ++i) {\n\t\tnotification.text = text[i];\n\t\tsize = 1;\n\t\tfor (t=0; t<notificationTime; ) {\n\t\t\tsize += speed * Time.deltaTime;\n\t\t\tt += Time.deltaTime;\n\t\t\tnotification.transform.localScale = Vector3.one * size;\n\t\t\tyield;\n\t\t}\n\t}\n\tnotification.enabled = false;\n}", "function notification(html) {\n\n\t$('.message-ajax #message-here').html(html);\n\t$('.message-ajax').show();\n\t$('.message-ajax').fadeOut(4000);\n}", "function fadeMsg(flag) {\r\n if(flag == null) {\r\n flag = 1;\r\n }\r\n var msg = document.getElementById('msg');\r\n var value;\r\n if(flag == 1) {\r\n value = msg.alpha + MSGSPEED;\r\n } else {\r\n value = msg.alpha - MSGSPEED;\r\n }\r\n msg.alpha = value;\r\n msg.style.opacity = (value / 100);\r\n msg.style.filter = 'alpha(opacity=' + value + ')';\r\n if(value >= 99) {\r\n clearInterval(msg.timer);\r\n msg.timer = null;\r\n } else if(value <= 1) {\r\n msg.style.display = \"none\";\r\n clearInterval(msg.timer);\r\n }\r\n}", "function TurbulenzGameNotifications() {}", "function notifyUser () {\n shell.beep()\n\n app.dock.bounce('informational')\n}", "function notification(message) {\n var x = document.getElementById(\"snackbar\")\n x.className = \"show\";\n x.innerHTML = message;\n setTimeout(function () { x.className = x.className.replace(\"show\", \"\"); }, 3000);\n}", "function hideNotification() {\n var notification = $(IDS.NOTIFICATION);\n notification.classList.add(CLASSES.HIDE_NOTIFICATION);\n notification.classList.remove(CLASSES.DELAYED_HIDE_NOTIFICATION);\n}", "_autoHideFlashMessages()\n\t{\n\t\tif($(\"div.fixed-alert\").length)\n\t\t{\n\t\t\t// fadeIn\n\t\t\t$(\"div.fixed-alert\").addClass(\"in\");\n\n\t\t\t// fadeOut\n\t\t\tsetTimeout(function()\n\t\t\t{\n\t\t\t\t$(\"div.fixed-alert\").removeClass('in').remove();\n\t\t\t}, \n\t\t\t5000);\n\t\t}\n\t}", "function removeNotify(ele)\n {\n // css3 animations\n ele.removeClass('fadeInRight').addClass('fadeOutRight');\n\n // after animation - remove and update other\n setTimeout(function () {\n ele.remove();\n updateNotifyPositions(300)\n }, 400);\n }", "_hideNotification() {\n if (this.props.timeoutable) {\n this._notificationTimer.clear();\n this.props.removeNotification();\n }\n }", "function Notification(){}", "function showNotification( msg, mode ) {\n\n var notify = document.getElementById(\"notify-block\") ;\n\n if( ! notify ) {\n\n notify = document.createElement('p') ;\n notify.id = \"notify-block\" ;\n\n document.body.appendChild( notify ) ;\n\n } else clearTimeout( window.i_event_notify_id ) ; //utile s'il y a eu d'autre notification avant.\n\n notify.style.display = \"none\" ; //on se rassure que la zone sera invisible avant l'affichage du msg\n notify.innerHTML = msg ;\n\n var closeButton = document.createElement(\"button\");\n closeButton.className = \"b-dialog-close\";\n closeButton.innerHTML = \"X\";\n closeButton.onclick = function () {\n\n document.body.removeChild( notify ) ;\n } ;\n notify.appendChild( closeButton ) ;\n\n notify.style.display = \"block\" ; //affiche du msg\n notify.className = \"notify-normal\" ;\n\n //le mode en principe est soit \"normal\" soit \"warring\"\n //cependant n'importe quel valeur sauf \"warring\" peut convernir pour un mode d'affichage normal.\n if( mode === \"warring\") {\n\n notify.className = \"notify-warring\" ;\n window.i_event_notify_id = setTimeout( function(){ document.body.removeChild( notify ) ; }, 20000) ; //on cache la zone après 30s\n\n } else if( mode === \"error\") {\n\n notify.className = \"notify-error\" ;\n window.i_event_notify_id = setTimeout( function(){ document.body.removeChild( notify ) ; }, 25000) ; //on cache la zone après 30s\n\n }\n else if( mode === \"success\") {\n\n notify.className = \"notify-success\" ;\n window.i_event_notify_id = setTimeout( function(){ document.body.removeChild( notify ) ; }, 25000) ; //on cache la zone après 30s\n\n } else window.i_event_notify_id = setTimeout( function(){ document.body.removeChild( notify ) ; }, 15000) ; //on cache la zone après 15s\n\n}", "function toast_notif(e){\n if( $('#toast-notif').length == 0 ){\n $('body').append('<div id=\"toast-notif\"></div>');\n }\n $('#toast-notif').html(e);\n\n // center taost\n $('#toast-notif').css(\"left\", ( $(window).width() - $('#toast-notif').width() ) / 2 + \"px\");\n\n var $timer = setTimeout(function(){\n if( !$('#toast-notif').hasClass('.active')){\n $('#toast-notif').removeClass('active').hide();\n }\n \n }, 5000);\n\n if( !$('#toast-notif').is(':visible') ){\n $('#toast-notif').show();\n }else{\n $('#toast-notif').addClass('active');\n clearTimeout($timer);\n }\n }", "function setSucessMessageWithFade(message){\n setSucessMessage(message);\n setTimeout(function() {\n setSucessMessage('');\n }, 3000);\n }", "function toast(message) {\n var elem = document.createElement(\"div\");\n\n elem.innerHTML = message;\n var notificationContainer = document.getElementById(\"notification-container\");\n notificationContainer.appendChild(elem);\n\n elem.className = \"message messageIn\";\n\n\tfunction hideNotification() {\n\t elem.className = \"message messageOut\";\n\t animationEndCallback = (e) => {\n\t elem.removeEventListener('animationend', animationEndCallback);\n\t elem.outerHTML = \"\";\n\t }\n\t elem.addEventListener('animationend', animationEndCallback);\n\t}\n\n\tsetTimeout(hideNotification,3000);\n\n elem.addEventListener('click',hideNotification);\n}", "notice(msg, color = '007eff', time = 3000) {\r\n return new Promise((resolve, reject) => {\r\n let wrap = $('<div style=\"box-sizing:border-box; position:fixed; left:calc(50% - 160px); box-shadow:0 5px 25px rgba(0,0,0,0.2); width:320px; top:40px; background:#' + (color ? color : '007eff') + '; border-radius:10px; color:#fff; padding:20px 20px; text-transform:none; font:16px/1.2 Tahoma, sans-serif; cursor:pointer; z-index:999999; text-align:center;\">' + msg + '</div>')\r\n .on('click', () => { wrap.remove(); resolve(); })\r\n .appendTo('body');\r\n if(time > 0) setTimeout(() => { wrap.remove(); }, time);\r\n });\r\n }", "function displayMessage(text) {\n message=text;\n document.getElementById(\"text\").innerHTML = message;\n //var n = new Notification(\"Attention\", {body: \"BANG! Back to the island!\"});\n setTimeout(function() {message=\"Hey! Look here!\";\n document.getElementById(\"text\").innerHTML=message;\n }, 2500);\n }", "function nota(op,msg,time){\n if(time == undefined)time = 5000;\n var n = noty({text:msg,maxVisible: 1,type:op,killer:true,timeout:time,layout: 'center'});\n}", "CrossFadeQueued() {}", "function hideNotification(notification, timer) {\n setTimeout(() => {\n notification.classList.remove('active');\n setTimeout(() => {\n notification.remove();\n }, 500);\n }, timer);\n}", "flashTray(flash = true) {\n let _this=this;\n if (flash) {\n if (!timer) {\n timer = setInterval(() => {\n if((_this._trayIconCounter++) % 2){\n global.tray.setImage(_this.trayIcon);\n }else{\n global.tray.setImage(_this.emptyIcon);\n }\n // global.tray.setImage(this._trayIcons[(this._trayIconCounter++) % 2]);\n }, 400);\n }\n } else {\n if (timer) {\n clearInterval(timer);\n timer = null;\n }\n global.tray.setImage(_this.trayIcon);\n }\n\n }", "function notify(newAlert){\n\t\t// change the alert message\n\t\tdocument.getElementById(\"alert-content\").innerHTML = newAlert;\n\t\t// alert animations\n\t\tvar box = document.getElementById(\"alert-wrapper\");\n\t\tbox.className = \"visible\";\n\t\tsetTimeout(function(){ box.className = \"hidden\" }, 2500);\n\t}", "function flashMessage() {\n $(\"#flash_message\").addClass(\"show\");\n setTimeout(function () {\n $(\"#flash_message\").removeClass(\"show\");\n }, 3000);\n}", "function flashMessage() {\n $(\"#flash_message\").addClass(\"show\");\n setTimeout(function () {\n $(\"#flash_message\").removeClass(\"show\");\n }, 3000);\n}", "function message(msg, timeout=1000){\n var notification = new Notification(\"Message\", {body: msg});\nsetTimeout(function() {notification.close()}, timeout);\n}", "function runNotification(alert) {\r\n var unique_id = $.gritter.add({\r\n // (string | mandatory) the heading of the notification\r\n title: 'Notification!',\r\n // (string | mandatory) the text inside the notification\r\n text: alert,\r\n // (bool | optional) if you want it to fade out on its own or just sit there\r\n sticky: false,\r\n // (int | optional) the time you want it to be alive for before fading out\r\n time: 4000,\r\n // (string | optional) the class name you want to apply to that specific message\r\n class_name: 'my-sticky-class'\r\n });\r\n // You can have it return a unique id, this can be used to manually remove it later using\r\n /*\r\n setTimeout(function(){\r\n $.gritter.remove(unique_id, {\r\n fade: true,\r\n speed: 'slow'\r\n });\r\n }, 6000)\r\n */\r\n\r\n return false;\r\n\r\n\r\n\r\n}", "function notifyAll(fnSms, fnEmail) { \n setTimeout(function() { \n console.log('starting notification process'); \n fnEmail();\n fnSms(); \n \n }, 2000); \n }", "function fade_alerts() {\n alerts = document.getElementsByClassName(\"alert msg\");\n var i = alerts.length;\n for (let elem of alerts) {\n i--;\n time = 3250+(1000*i);\n setTimeout(function() {\n $(elem).fadeOut(\"slow\");\n }, time);\n }\n}", "function alertFunc(color, msg) {\n var alert = $('<div class=\"alert alert-'+color+'\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>'+msg+'</div>').hide();\n var timeOut;\n //alert.prependTo('.notifications');\n //alert.fadeIn();\n alert.appendTo('.notifications');\n alert.slideDown();\n\n //Is autoclosing alert\n var delay = 10000;\n if(delay != undefined)\n {\n delay = parseInt(delay);\n clearTimeout(timeOut);\n timeOut = window.setTimeout(function() {\n alert.fadeOut(200, function(){ $(this).remove();});\n }, delay);\n }\n // remove last notification if more then six\n var countAlert = $(\".notifications\").children().length;\n if (countAlert > 6){\n $(\".notifications .alert\").first().remove();\n }\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 notify(type, message){\n\tlet id = \"notification-\" + notificationCounter++;\n\t\n\t// Insert the notification\n\tdocument.getElementById(\"alertFrame\").innerHTML +=\n\t\t\"<div class=\\\"alert alert-\" + type + \"\\\" role='alert' id=\\\"\" + id + \"\\\">\" +\n\t\t\tmessage + \n\t\t\t\"<button type='button' class='close' data-dismiss='alert' aria-label='Close'>\" +\n\t\t\t\t\"<span aria-hidden='true'>&times;</span>\" +\n\t\t\t\"</button>\" +\n\t\t\"</div>\";\n\t\t\n\t\t$(\"#\" + id).animateCss('zoomInUp');\n\t\t\n\t// Delete the notification after a while\n\twindow.setTimeout(function(){\n\t\t$(\"#\" + id).animateCss('zoomOut', function(){\n\t\t\t$(\"#\" + id).remove();\n\t\t});\n\t}, 5000);\n}", "function callback() {\n\t\tsetTimeout(function() {\n\t\t\t\t$( \"#effect:visible\" ).removeAttr( \"style\" ).fadeOut();\n\t\t\t}, 100000 \n\t\t);\n\t}", "function displayNotification(type, message) {\n // ensures that the notification will not be cleared if a new notification popped up and the last one has a running timer\n clearTimeout(state.notifTimer);\n\n let notification = document.getElementById(\"notification\");\n let notifText = document.getElementById(\"text-notif\");\n\n notification.classList.add(type);\n notifText.innerHTML = message;\n\n notification.classList.add(\"visible\");\n\n state.notifTimer = setTimeout(hideNotification, 10000);\n}", "function piman_send_message(msg,error){\n msg = '<span>' + msg + '</span>';\n\n $(window).scrollTop($('body').position().top)\n\n $(\"#notifications_content\").html(msg)\n .addClass(error ? 'error' : 'success');\n\n $(\"#notifications\")\n .toggle()\n .delay(5000).fadeOut()\n .click(function(){$(this).stop(true,true).fadeOut()});\n\n}", "function OnNotification(notificationCount,isImportantMessage) {\n var millisecondsToWait = window.external.RetrieveNotificationAutoCloseInterval();\n var cntrl = GetControl('divNotification');\n if (cntrl.style.display == 'block') {\n CloseStatus('notification');\n if (notificationCount > 0) {\n ShowStatus('notification', notificationCount, 'AsNotification',isImportantMessage);\n }\n else {\n cntrl.style.display = 'none';\n }\n }\n else {\n if (notificationCount > 0) {\n ShowStatus('notification', notificationCount, 'AsNotification',isImportantMessage);\n }\n else {\n CloseStatus('notification');\n }\n }\n }", "function showNotification() {\n notification.classList.remove(CLASSES.HIDE_NOTIFICATION);\n notification.classList.remove(CLASSES.DELAYED_HIDE_NOTIFICATION);\n notification.scrollTop;\n notification.classList.add(CLASSES.DELAYED_HIDE_NOTIFICATION);\n}", "function SetupFlashMsg()\r\n{\r\n var fadeOutTime = 6000;\r\n var flashMsg = $(\".flashMsg\");\r\n\r\n //Set timer to fade out/close flash msg\r\n window.setTimeout(function() { flashMsg.fadeOut(); }, fadeOutTime);\r\n\r\n flashMsg.children(\".closeBtn\").click(function(event)\r\n {\r\n event.preventDefault();\r\n flashMsg.fadeOut();\r\n });\r\n}", "notifyIconAction() {}", "function hideNotification() {\n notification.classList.add(CLASSES.HIDE_NOTIFICATION);\n}", "function hideWait() {\n wait_layer.style.opacity = 1;\n (function fade() {\n if ((wait_layer.style.opacity -= .2) <= .2) {\n wait_layer.style.display = 'none';\n } else {\n setTimeout(fade, 40);\n }\n })();\n}", "function notify(msg, type) {\n return $.notify(\n msg,\n type,\n {\n position: 'right',\n autoHideDelay: 5000\n }\n );\n }", "function callback() {\n setTimeout(function() {\n $( \"#effect:visible\" ).removeAttr( \"style\" ).fadeOut();\n }, 10000 );\n }", "function showNotification() {\n var notification = $(IDS.NOTIFICATION);\n notification.classList.remove(CLASSES.HIDE_NOTIFICATION);\n notification.classList.remove(CLASSES.DELAYED_HIDE_NOTIFICATION);\n notification.scrollTop;\n notification.classList.add(CLASSES.DELAYED_HIDE_NOTIFICATION);\n}", "function showNotifications(msg, type) {\n $.notify({\n // options\n message: msg\n },{\n // settings\n type: type,\n delay: 1500,\n placement:{from: \"top\",\n align: \"left\"}\n \n });\n}", "function show_notif(typ,pos,msg,tim_out)\n {\n new Noty({\n type: typ, //alert (default), success, error, warning\n layout: pos, //top, topLeft, topCenter, topRight (default), center, centerLeft, centerRight, bottom, bottomLeft, bottomCenter, bottomRight\n theme: 'bootstrap-v4', //relax, mint (default), metroui \n text: msg, //This string can contain HTML too. But be careful and don't pass user inputs to this parameter.\n timeout: tim_out, // false (default)\n progressBar: true, //Default, progress before fade out is displayed\n }).show();\n }", "function msg(title, msg, timeout) {\n var notification = webkitNotifications.createNotification('img/icon.png', title, msg);\n notification.show();\n setTimeout(function() { notification.cancel(); }, timeout || 1500);\n}", "function AnimateMessage() {\n var domain_message = $(\"div.waiting_message\");\n var is_detect = true;\n domain_message.fadeToggle(700);\n if(!domain_message.length) {\n is_detect = false;\n return;\n }\n console.log(is_detect);\n setTimeout(arguments.callee, 700);\n }", "tick() {\n\n this.setState({\n\n notificationCounter: this.state.notificationCounter + 1\n\n }, function() {\n\n //clear interval and hide notification after 5 seconds\n if(this.state.notificationCounter >= 5) {\n\n this.setState({\n\n showNotification: false,\n notificationCounter: 0\n\n }, function() {\n\n clearInterval(this.interval);\n\n })\n\n }\n\n });\n \n }", "function showNotice(notice, colour) {\n $(\"#noticetitle\").text(notice);\n document.getElementById(\"notice\").style.backgroundColor = colour;\n $(\"notice\").fadeIn();\n\n set_notification(notice, colour);\n}", "function notifications() {\n if (permission === true) {\n if (seconds == 0 && minutes == 0) {\n popupNotification();\n soundNotification();\n }\n }\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 notificate(title, message) {\n\twebkitNotifications.createNotification(\"icon.png\", title, message).show();\n}", "function callback() {\r\n\t\t\tsetTimeout(function() {\r\n\t\t\t\t$( \"#effect:visible\" ).removeAttr( \"style\" ).fadeOut();\r\n\t\t\t}, 1000 );\r\n\t\t}", "function bootstarpAlert(ttl, msg, dismiss, msgtype,delay) {\r\n\t$.notify({\r\n\t\ttitle : '<strong>' + ttl + '</strong>',\r\n\t\tmessage : msg\r\n\t}, {\r\n\t\tallow_dismiss : dismiss,\r\n\t\ttype : msgtype,\r\n\t\tdelay : delay,\r\n\t\toffset : {\r\n\t\t\tx : 450,\r\n\t\t\ty : 100\r\n\t\t}\r\n\t}\r\n\r\n\t);\r\n}", "function mostrarAyuda(msg) {\n $.notify({\n message: msg\n }, {\n type: 'info',\n delay: 3000,\n placement: {\n align: 'center'\n },\n z_index: 99999,\n });\n}", "function warningMessage() {\r\n\t\twarning\r\n\t\t\t.animate({opacity: 1}, 500)\r\n\t\t\t.animate({opacity: 0}, 500)\r\n\t\t\t.animate({opacity: 1}, 500)\r\n\t\t\t.animate({opacity: 0}, 500)\r\n\t\t\t.animate({opacity: 1}, 500)\r\n\t\t\t.animate({opacity: 0}, 500)\r\n\t\t\t.animate({opacity: 1}, 500)\r\n\t\t\t.animate({opacity: 0}, 500);\r\n\t\tsetTimeout(function(){\r\n\t\t\twarning.text(\"3\");\r\n\t\t}, 1000);\r\n\t\tsetTimeout(function(){\r\n\t\t\twarning.text(\"2\");\r\n\t\t}, 2000);\r\n\t\tsetTimeout(function(){\r\n\t\t\twarning.text(\"1\");\r\n\t\t}, 3000);\r\n\t}", "function Notification() {\n\t\n}", "function callback(){\n\t\t\tsetTimeout(function(){\n\t\t\t\t$(\"#effect:visible\").removeAttr('style').hide().fadeOut();\n\t\t\t}, 1000);\n\t\t}", "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}", "fireFade() {\n Meteor.setTimeout(() => {\n Meteor.setTimeout(() => {\n $(\".fade-first\").addClass(\"fire\")\n Meteor.setTimeout(() => {\n $(\".fade-second\").addClass(\"fire\")\n })\n })\n })\n }", "function closeNotification(duration){\n var divHeight = $('div#info_message').height();\n setTimeout(function(){\n $('div#info_message').animate({\n top: '-'+divHeight\n }); \n // removing the notification from body\n setTimeout(function(){\n $('div#info_message').remove();\n },200);\n }, parseInt(duration * 1000)); \n \n\n \n}", "function notify(id, message) {\r\n var template = '<div class=\"alert alert-success\" id=\"n-' + id + '\">[msg]</div>';\r\n\r\n $('#notify').append(template.replace('[msg]', message));\r\n setTimeout(function() {\r\n $(\"#n-\" + id ).addClass('in');\r\n setTimeout(function() {\r\n $(\"#n-\" + id ).removeClass('in');\r\n setTimeout(function() {\r\n $(\"#n-\" + id ).remove();\r\n }, 4000);\r\n }, 4000);\r\n }, 300);\r\n\r\n }", "function bootstarpAlert(ttl, msg, dismiss, msgtype) {\r\n\t$.notify({\r\n\t\ttitle : '<strong>' + ttl + '</strong>',\r\n\t\tmessage : msg\r\n\t}, {\r\n\t\tallow_dismiss : dismiss,\r\n\t\ttype : msgtype,\r\n\t\tdelay : 3000,\r\n\t\toffset : {\r\n\t\t\tx : 450,\r\n\t\t\ty : 100\r\n\t\t}\r\n\t}\r\n\r\n\t);\r\n}", "function vanish(b) {\n setInterval(() => {\n b.style.opacity = \"10\";\n }, 10000);\n}", "function screenFlash() {\n\t\tbooFlash = !booFlash;\t\t\n\t\tif ( booFlash ) {\n\t\t\t$(\"#alarm\").css(\"background\",\"orange\");\t\n\t\t} else {\n\t\t\t$(\"#alarm\").css(\"background\",\"red\");\t\n\t\t}\n\t\tif ( booFault ) {\t\t\n\t\t\tsetTimeout(screenFlash,500);\n\t\t}\n\n\t}", "function hideNotificationAndReset() {\n iSuccess.css('display', 'none');\n iError.css('display', 'none');\n iMessage.html('');\n notification.css('display', 'none');\n }", "function callback() {\n setTimeout(function() {\n $( \"#effect:visible\" ).removeAttr( \"style\" ).fadeOut();\n }, 1000 );\n }", "function notif(message, success){\n success = (typeof success !== 'undefined') ? success : true;\n $('<div class=\"alert alert-' + ((success)?'success':'danger') +'\">' + message + '</div>')\n .prependTo(\"body\")\n .fadeIn('fast')\n .delay(5000)\n .fadeOut('fast')\n .queue(function(){$(this).remove()});\n}", "function slideDownNotification(startAfter, autoClose, duration){ \n setTimeout(function(){\n $('div#info_message').animate({\n top: 0\n }); \n if(autoClose){\n setTimeout(function(){\n closeNotification(duration);\n }, duration);\n }\n }, parseInt(startAfter * 1000)); \n}", "animateOut (callback) {\n // Declare that the notice is animating out.\n this.set({'_animating': 'out'});\n const finished = () => {\n this.refs.elem.removeEventListener('transitionend', finished);\n const {_animTimer, _animating, _moduleIsNoticeOpen} = this.get();\n if (_animTimer) {\n clearTimeout(_animTimer);\n }\n if (_animating !== 'out') {\n return;\n }\n let visible = _moduleIsNoticeOpen;\n if (!visible) {\n const domRect = this.refs.elem.getBoundingClientRect();\n for (let prop in domRect) {\n if (domRect[prop] > 0) {\n visible = true;\n break;\n }\n }\n }\n if (!this.refs.elem.style.opacity || this.refs.elem.style.opacity === '0' || !visible) {\n this.set({'_animatingClass': ''});\n const {stack} = this.get();\n if (stack && stack.overlay) {\n // Go through the modal stack to see if any are left open.\n // TODO: Rewrite this cause it sucks.\n let stillOpen = false;\n for (let i = 0; i < PNotify.notices.length; i++) {\n const notice = PNotify.notices[i];\n if (notice !== this && notice.get().stack === stack && notice.get()._state !== 'closed') {\n stillOpen = true;\n break;\n }\n }\n if (!stillOpen) {\n removeStackOverlay(stack);\n }\n }\n if (callback) {\n callback.call();\n }\n // Declare that the notice has completed animating.\n this.set({'_animating': false});\n } else {\n // In case this was called before the notice finished animating.\n this.set({'_animTimer': setTimeout(finished, 40)});\n }\n };\n\n if (this.get().animation === 'fade') {\n this.refs.elem.addEventListener('transitionend', finished);\n this.set({'_animatingClass': 'ui-pnotify-in'});\n // Just in case the event doesn't fire, call it after 650 ms.\n this.set({'_animTimer': setTimeout(finished, 650)});\n } else {\n this.set({'_animatingClass': ''});\n finished();\n }\n }", "function notificationFunction() {\n var popup = document.getElementById(\"myPopup\");\n popup.classList.toggle(\"show\");\n}", "function notificationFunction() {\n var popup = document.getElementById(\"myPopup\");\n popup.classList.toggle(\"show\");\n}", "function showFlashNotifications() {\n var i = 0, l = flashNotifications.length;\n\n for (i; i < l; i++) {\n var item = flashNotifications[i];\n var type = item.type, message = item.message || '', title = item.title || '', timeout = item.timeout,\n options = {};\n\n /* Add timeout to the options object if it exists */\n if ('undefined' !== typeof timeout) {\n options.timeout = timeout;\n }\n\n add(type, message, title, options);\n }\n }", "changeNotification() {\n Vue.nextTick(() => {\n window.requestAnimationFrame(() => {\n this.pulseAnimation = true;\n if (this.pulseAnimationTimer) clearTimeout(this.pulseAnimationTimer);\n this.pulseAnimationTimer = setTimeout(() => {\n this.pulseAnimation = false;\n delete this.pulseAnimationTimer;\n }, 700);\n });\n });\n }", "function flash(options) { // technical debt, put this in a utility service\n\t\t\t\t\tnrzLightify({\n\t\t\t\t\ttype: options.type || 'info', // info || warning || danger || success\n\t\t\t\t\ttext: options.msg || \"\",\n\t\t\t\t}, options.duration || 5000);\n\t}", "function onTick() {\n var notis;\n if (notTicked) {\n notis = notTicked;\n notTicked = undefined;\n notis.forEach(doNotify);\n }\n }", "function message_notice(args) {\n var duration = args.duration !== undefined ? args.duration : defaultDuration;\n var iconType = {\n info: 'info-circle',\n success: 'check-circle',\n error: 'close-circle',\n warning: 'exclamation-circle',\n loading: 'loading'\n }[args.type];\n\n var target = args.key || message_key++;\n var closePromise = new Promise(function (resolve) {\n var callback = function callback() {\n if (typeof args.onClose === 'function') {\n args.onClose();\n }\n return resolve(true);\n };\n getMessageInstance(function (instance) {\n instance.notice({\n key: target,\n duration: duration,\n style: {},\n content: function content(h) {\n var iconNode = h(es_icon, {\n attrs: { type: iconType, theme: iconType === 'loading' ? 'outlined' : 'filled' }\n });\n var switchIconNode = iconType ? iconNode : '';\n return h(\n 'div',\n {\n 'class': message_prefixCls + '-custom-content' + (args.type ? ' ' + message_prefixCls + '-' + args.type : '')\n },\n [args.icon ? typeof args.icon === 'function' ? args.icon(h) : args.icon : switchIconNode, h('span', [typeof args.content === 'function' ? args.content(h) : args.content])]\n );\n },\n onClose: callback\n });\n });\n });\n var result = function result() {\n if (messageInstance) {\n messageInstance.removeNotice(target);\n }\n };\n result.then = function (filled, rejected) {\n return closePromise.then(filled, rejected);\n };\n result.promise = closePromise;\n return result;\n}", "function fade(element, t) {\n var op = 1; // initial opacity\n var timer = setInterval(function () {\n if (op <= 0.1) {\n clearInterval(timer);\n element.style.display = 'none';\n }\n element.style.opacity = op;\n element.style.filter = 'alpha(opacity=' + op * 100 + \")\";\n op -= op * 0.1;\n }, t);\n}", "setupFade(fadeTime, from, to, onFadeDone) {}", "function showNotification(element,question_id,condition){\n if(condition==false){\n element.next(\".error-wrapper\").find(\"span\").fadeIn();\n // remove the answer class\n $(\"#\"+question_id).removeClass(\"answered\");\n }else{\n element.next(\".error-wrapper\").find(\"span\").fadeOut();\n // add the answer class\n $(\"#\"+question_id).addClass(\"answered\");\n }\n }" ]
[ "0.7105446", "0.6994876", "0.6845799", "0.68172574", "0.67991275", "0.6772484", "0.6587236", "0.65394646", "0.652646", "0.64807427", "0.64807427", "0.64807427", "0.64616525", "0.64438975", "0.64139354", "0.6297589", "0.6243184", "0.6225442", "0.61984", "0.61618817", "0.6149775", "0.6141996", "0.61297745", "0.61213404", "0.6098547", "0.60850686", "0.6084423", "0.60496384", "0.6030772", "0.59916925", "0.59907484", "0.5983594", "0.598172", "0.5974622", "0.5969486", "0.5968923", "0.5964649", "0.59612614", "0.5959726", "0.5941684", "0.5940746", "0.5917526", "0.5917526", "0.5896219", "0.58952856", "0.5885514", "0.588189", "0.58592397", "0.58564687", "0.5848224", "0.5845576", "0.584396", "0.5840469", "0.58316433", "0.58274484", "0.58085114", "0.5806135", "0.57900286", "0.5777816", "0.57614684", "0.5754612", "0.57545733", "0.5743086", "0.57172245", "0.5712178", "0.570561", "0.5705524", "0.57052505", "0.5700607", "0.56964415", "0.56964415", "0.5693775", "0.5686676", "0.5686566", "0.56849104", "0.5676709", "0.5675148", "0.5671226", "0.56573975", "0.5656218", "0.56488544", "0.5645591", "0.5645564", "0.5643051", "0.5640736", "0.5634418", "0.5631231", "0.5629044", "0.56140155", "0.56005216", "0.5596282", "0.5596282", "0.5592294", "0.5587762", "0.55790883", "0.5575785", "0.55750436", "0.55740416", "0.5572608", "0.55719393" ]
0.6483222
9
This is called every time something is updated in the store.
stateChanged(state) { this._quantity = cartQuantitySelector(state); this._error = state.shop.error; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updated() {}", "function update() {\n // ... no implementation required\n }", "updated(){\n console.log('Updated');\n }", "update() {\n // Subclasses should override\n }", "onStoreUpdate({ changes, record }) {\n const { editorContext } = this;\n\n if (editorContext && editorContext.editor.isVisible) {\n if (record === editorContext.record && editorContext.editor.dataField in changes) {\n editorContext.editor.refreshEdit();\n }\n }\n }", "onStoreUpdateRecord() {\n // need to update events when resource changes (might use data in renderers, templates)\n if (!this.suspendStoreRedraw) {\n this.currentOrientation.onRowRecordUpdate(...arguments);\n super.onStoreUpdateRecord(...arguments);\n }\n }", "updateToStore() {\r\n if (this.props.formSetValue)\r\n this.props.formSetValue(this.props.inputProps.name, this.fieldStatus.value, this.fieldStatus.valid, this.fieldStatus.dirty, this.fieldStatus.visited);\r\n }", "updateToStore() {\r\n if (this.props.formSetValue)\r\n this.props.formSetValue(this.props.inputProps.name, this.fieldStatus.value, this.fieldStatus.valid, this.fieldStatus.dirty, this.fieldStatus.visited);\r\n }", "componentDidUpdate() { //triggered if data changed in the database\n this.setData()\n }", "_update() {\n // Call subclass lifecycle method\n const stateNeedsUpdate = this.needsUpdate();\n // End lifecycle method\n debug(TRACE_UPDATE, this, stateNeedsUpdate);\n\n if (stateNeedsUpdate) {\n this._updateState();\n }\n }", "_triggerUpdated() {\n\t if (!this.updating) {\n\t this.updating = true;\n\t const update = () => {\n\t this.updating = false;\n\t const registry = storage.getRegistry(this._instance);\n\t const events = registry.events;\n\t events.fire('view-updated', this);\n\t };\n\t if (this._checkSync()) {\n\t update();\n\t }\n\t else {\n\t setTimeout(update);\n\t }\n\t }\n\t }", "didUpdate() {}", "_update() {\n }", "onStoreUpdate({\n changes,\n record\n }) {\n const {\n editorContext\n } = this;\n\n if (editorContext && editorContext.editor.isVisible) {\n if (record === editorContext.record && editorContext.editor.dataField in changes) {\n editorContext.editor.refreshEdit();\n }\n }\n }", "updated(_changedProperties) { }", "function update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "_update() {\n return this.store.findAll(this.modelName, { reload: true });\n }", "updateStore_() {\n const entries = /** @type {!Array<!Entry>} */ (\n this.directoryModel_.getFileList().slice());\n this.store_.dispatch(updateDirectoryContent({entries}));\n }", "updated(_changedProperties){}", "updated(_changedProperties){}", "handleStoreChange_() {\n\t\t\t\tconst storeState = this.getStore().getState();\n\n\t\t\t\tconst {storeProps_} = this;\n\t\t\t\tconst newStoreProps = this.getStoreProps_(storeState);\n\n\t\t\t\tif (newStoreProps && !object.shallowEqual(storeProps_, newStoreProps)) {\n\t\t\t\t\tthis.hasStorePropsChanged_ = true;\n\t\t\t\t\tthis.storeProps_ = newStoreProps;\n\t\t\t\t}\n\n\t\t\t\tthis.state.storeState = storeState;\n\t\t\t}", "update()\n {\n \n }", "update() {\n // ...\n }", "onStateChange() {\n\t\t// brute force update entire UI on store change to keep demo app simple\n\t\tthis.forceUpdate();\n\t}", "function updateTime() {\n console.log(\"updateTime()\");\n store.timeModel.update();\n}", "firstUpdated(_changedProperties){}", "firstUpdated(_changedProperties){}", "update () {}", "firstUpdated() {}", "firstUpdated(e){}", "updated(_changedProperties) {\n }", "updated(_changedProperties) {\n }", "updated(_changedProperties) {\n }", "willUpdate() {\n }", "update() {\n this._checkEvents();\n }", "onStoreChange() {\n this.setState(this._getStateFromStore);\n }", "componentWillUpdate() {\n console.log('[OrderSummary] will update');\n }", "update(){}", "update(){}", "update(){}", "componentDidMount() {\n store.subscribe(()=> this.forceUpdate());\n }", "componentWillUpdate() {\n console.log(\"Order Summary will update\");\n }", "afterUpdate() {}", "storeUpdated(store, prop) {\n if (prop !== \"selectedContextData\") return\n this.isDataVizEmpty() ? this.lineChart().createDataVis() : this.lineChart().updateDataVis()\n }", "componentDidUpdate() {\n this.store.set(this.state)\n }", "componentWillUpdate() {\n console.log(\"[Ordersummary] willupdate\");\n }", "updated(_changedProperties) {\n }", "firstUpdated() {\n super.firstUpdated();\n this.updateDisplayValue();\n }", "componentDidUpdate() {\n console.log('[Order Summary] DidUpdate'); \n }", "storeChanged(){\n this.setState(this.getState());\n }", "refresh() {\n this.forceUpdate();\n }", "async update() {}", "componentDidUpdate() {\n this.lastStateUpdate = Date.now();\n StateLoader.updateLocalStorage(this.state);\n }", "update() { }", "update() { }", "update() {\n \n }", "firstUpdated(_changedProperties) { }", "beforeUpdate(){\n console.log('beforeUpdate');\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 }", "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 }", "updated(e){}", "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 }", "privateSendUpdate () {\n this.emit('update', this.getState())\n }", "save () { this.store.saveSync() }", "update() {\n this.forceUpdate();\n }", "update() {\n this.forceUpdate();\n }", "componentDidUpdate() {\n console.log('[OrderSummary] did update');\n }", "update() {\n }", "update() {\n }", "update() {\n }", "function _publishChange(){\n var updateTime = (+new Date()).toString();\n\n if(_backend == \"localStorage\" || _backend == \"globalStorage\"){\n try {\n _storage_service.jStorage_update = updateTime;\n } catch (E8) {\n // safari private mode has been enabled after the jStorage initialization\n _backend = false;\n }\n }else if(_backend == \"userDataBehavior\"){\n _storage_elm.setAttribute(\"jStorage_update\", updateTime);\n _storage_elm.save(\"jStorage\");\n }\n\n _storageObserver();\n }", "_storeState() {\n storage.set(this.itemId, JSON.stringify({\n lastVisit: Date.now(),\n commentCount: this.itemDescendantCount,\n maxCommentId: this.maxCommentId\n }))\n }", "didUpdate() { }", "_onStore () {\n if (this.destroyed) return\n this._debug('on store')\n\n // Start discovery before emitting 'ready'\n this._startDiscovery()\n\n this.ready = true\n this.emit('ready')\n\n // Files may start out done if the file was already in the store\n this._checkDone()\n\n // In case any selections were made before torrent was ready\n this._updateSelections()\n }", "_onStore () {\n if (this.destroyed) return\n this._debug('on store')\n\n // Start discovery before emitting 'ready'\n this._startDiscovery()\n\n this.ready = true\n this.emit('ready')\n\n // Files may start out done if the file was already in the store\n this._checkDone()\n\n // In case any selections were made before torrent was ready\n this._updateSelections()\n }", "handleChangeEvent() {\n this.cacheHasChanged = true;\n }", "function update() {\n\t\t\n\t}", "handleUpdates(){\n\t\t//put per update scripts here\n\t\tconsole.log('update');\n\t}", "function refresh(){\n setUpdate(!update)\n }", "updated(changedProperties) {\n }", "update() {\n this.dataChanged = true;\n this.persons.all = undefined;\n this.jobTitles.all = undefined;\n this.updateFiltered();\n this.updateTimed();\n }", "function emitChange() {\n TweetStore.emit('change')\n}", "firstUpdated(_changedProperties) {\n }", "firstUpdated(_changedProperties) {\n }", "firstUpdated(_changedProperties) {\n }", "update () {\n /* istanbul ignore else */\n if (this.lazy) {\n this.dirty = true;\n } else if (this.sync) {\n this.run();\n } else {\n queueWatcher(this);\n }\n }", "emitUpdate() {\n this._dispatch.call(DISPATCH_EVENT_UPDATE);\n }", "storeChangeHandler() {\n this.setState({\n items: ItemStore.get('items'),\n loading: ItemStore.get('loading'),\n });\n }", "update(data={}) {\n this.state = Object.assign(this.state, data);\n\n // notify all the Listeners of updated state\n this.notifyObervers(this.state);\n }", "update() {\n }", "update() {\n }", "_changed() {\n reload_articles_on_drawer_close();\n }" ]
[ "0.7161957", "0.70259964", "0.69527143", "0.6894755", "0.68237233", "0.6793203", "0.67704964", "0.67704964", "0.67649806", "0.66785806", "0.66757315", "0.665823", "0.6655085", "0.66368276", "0.6634629", "0.657258", "0.65575594", "0.65575594", "0.65575594", "0.65575594", "0.65575594", "0.65575594", "0.65575594", "0.65575594", "0.65575594", "0.6556971", "0.6552196", "0.65409636", "0.65409636", "0.6536895", "0.65333295", "0.65272963", "0.6513491", "0.6508168", "0.65073586", "0.65073586", "0.6487893", "0.64848083", "0.64823353", "0.647089", "0.647089", "0.647089", "0.6466812", "0.6466772", "0.6444667", "0.6440038", "0.6425391", "0.6425391", "0.6425391", "0.6419319", "0.64068544", "0.63973534", "0.6393362", "0.6386758", "0.63859606", "0.6348095", "0.63428605", "0.63399523", "0.6333143", "0.632904", "0.6306168", "0.6301426", "0.63012975", "0.63012975", "0.6290524", "0.62897974", "0.6281737", "0.62816566", "0.62816566", "0.62798977", "0.6274368", "0.62730324", "0.62709206", "0.62558335", "0.62558335", "0.6250895", "0.62456644", "0.62456644", "0.62456644", "0.62412703", "0.624098", "0.6239617", "0.623418", "0.623418", "0.62271756", "0.62244713", "0.62184924", "0.6216981", "0.6205731", "0.62038726", "0.619197", "0.61869645", "0.61869645", "0.61869645", "0.61786795", "0.61705214", "0.61678004", "0.61498004", "0.6139411", "0.6139411", "0.6137138" ]
0.0
-1
BAD SESSION KILLER For cases when shop tries to reinstall us. ref to solution hack:
async function badSessionKillerReInstall(ctx, _next) { if (ctx.request.header.cookie) { if ( (ctx.request.url.split('?')[0] === '/' && ctx.request.querystring.split('&') && ctx.request.querystring.split('&')[0].split('=')[0] === 'hmac' && ctx.request.querystring.split('&')[1].split('=')[0] !== 'locale') || (ctx.request.url.split('?')[0] === '/auth/callback' && ctx.request.querystring.split('&') && ctx.request.querystring.split('&')[1].split('=')[0] === 'hmac') ) { console.log( `Killing bad session: url: ${ctx.request.url}, cookie: ${ctx.request.header.cookie}`, ); reportEvent( ctx.request.header.cookie.shopOrigin, 'bad_session_killed', { value: 'reinstall' }, ); ctx.request.header.cookie = ctx.request.header.cookie .split(' ') .filter( (item) => ['koa:sess', 'koa:sess.sig'].indexOf(item.split('=')[0]) === -1, ) .join(' '); } } await _next(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function badSessionKillerRedirect(ctx, next) {\n const { shop: shopOrigin } = ctx.session;\n\n const queryData = url.parse(ctx.request.url, true);\n const requestPath = ctx.request.url;\n if (\n shopOrigin &&\n queryData.query.shop &&\n shopOrigin !== queryData.query.shop\n ) {\n if (!requestPath.match(/^\\/script|^\\/product/g)) {\n console.debug('🎤 Dropping invalid session');\n ctx.session.shopOrigin = null;\n ctx.session.accessToken = null;\n reportEvent(shopOrigin, 'bad_session_killed', {\n value: 'multiple_shops',\n secondShop: queryData.query.shop,\n });\n ctx.redirect('/auth');\n }\n }\n await next();\n}", "function WARN_RESTART_SESSION() {\n\t\trequire([\"dialogs/DialogFactory\"],function(DialogFactory){\n\t\t\tvar nsDialog = DialogFactory.makeBasicErrorDialog({\n\t\t\t\ttitle: \"Session Expired\",\n\t\t\t\tcontent: \"The session appears to have expired. The client will now reload.\",\n\t\t\t\tokCmdAction: \"CLIENT_RESTART_SESSION\"\n\t\t\t});\n\t\t\tnsDialog.show();\n\t\t});\t\t\n\t}", "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 SessionTimeOut()\r\n{\r\n needToConfirm = false;\r\n}", "function handleSessionExpiration() {\n const tick = 1000 * 60; // 1 min\n const timeout = 1000 * 600 // 10 min\n const sessionCleaner = createSessionCleaner({ timeout });\n setTimeout(\n sessionCleaner.cleanSession.bind(sessionCleaner), tick);\n}", "function handle_err(res) {\n if ('error' in res) {\n console.warn(res);\n if (res['error']['message'] === 'ERR_LOGIN_TICKET_EXPIRED') {\n // log out\n localStorage.clear();\n current_window.reload();\n }\n return true;\n }\n return false;\n}", "function bypassAnticheat() { // SO THAT YOUR ACCOUNT DOESNT GET BANNED\n \n}", "function ExistingHelpSessionCheck() {\n\n var page = location.pathname.substring(1);\n\n // Little hack to remove the cookie if we're loading the first page\n // would need something better to be more generic\n if ((page == \"index.html\") || (page == PageLocation)) {\n SetCookie(CookieName, \"\", 1);\n return;\n }\n\n var userUID = GetCookie(CookieName);\n if (userUID != null) {\n SetUpSession(userUID);\n }\n}", "function manage_crash()\n{\n if (localStorage.last_update)\n {\n if (parseInt(localStorage.last_update) + (time_period * 2) < Date.now())\n {\n //seems a crash came! who knows!?\n //localStorage.clear();\n localStorage.removeItem('main_windows');\n localStorage.removeItem('actived_windows');\n localStorage.removeItem('active_window');\n localStorage.removeItem('last_update');\n location.reload();\n }\n }\n}", "function xqserver_msgadd_badsessionid(){\r\n\tsetup(g_qwUserId);\r\n\tengine.MsgAdd(l_dwSessionID+1,++l_dwSequence,QWORD2CHARCODES(g_qwUserId),1,g_dwAllowDuplicatesQType,g_bstrAllowDuplicatesQTypeData,g_dwAllowDuplicatesQTypeDataSize);\r\n\tengine.MsgList(l_dwSessionID,++l_dwSequence,g_qwUserId.dwHi,g_qwUserId.dwLo,g_dwAllowDuplicatesQType,g_qwCookie.dwHi,g_qwCookie.dwLo,0x00000000,0x00000000,2,0xFFFFFFFF);\r\n\tConfirmListReplyItemCount(engine,0);\r\n}//endmethod", "function addEarlyWarningMsg() {\n if(!SailPoint.getTimeoutLock()) {\n Ext.Msg.show(\n {title: \"#{msgs.session_pre_expiration_title}\",\n msg: \"#{msgs.session_pre_expiration_msg}\",\n buttons: Ext.Msg.OKCANCEL,\n fn: function(button) {\n if(button === 'ok') {\n Ext.Ajax.request({\n url: CONTEXT_PATH + '/rest/ping',\n success: function() {\n SailPoint.resetTimeout();\n }\n })\n }\n },\n icon: Ext.MessageBox.WARNING\n });\n } else {\n SailPoint.resetTimeout();\n }\n}", "function preemptivelyFailLoad() {\r\n\t$(\"#instructions\").html(\"Sorry, but the session ID you entered is not valid.<br><br>\"\r\n\t\t\t+ \"Please enter a different ID and try again, or click \\\"New Session\\\" to create a new session.\");\r\n}", "function checkSuspiciousLogin() {\n if (document.getElementById(\"choice_1\") != null || typeof(document.getElementsByClassName(\"NXVPg Szr5J coreSpriteLock\")[0]) != \"undefined\")\n return true;\n else\n return false;\n}", "function finnishCustomerSession(){\n\n clearCart();\n updateCartTotal();\n\n currentCart = {};\n\n undostack = [];\n redostack = [];\n\n}", "sessionInvalidated() {\n this.get('session').afterInvalidation();\n }", "function clearSessionID() {\n\t// we have a hardcoded timeout on sessionIDs. \n\tconsole.log(\"clearing sessions ID\");\n\tsessionID = '';\n\tusername = '';\n\tpword = '';\n}", "function onSessionInvalid() {\n\t\tvar loginForm = document.querySelector('#login-form');\n\t\tvar registerForm = document.querySelector('#register-form');\n\t\tvar itemNav = document.querySelector('#item-nav');\n\t\tvar itemList = document.querySelector('#item-list');\n\t\tvar avatar = document.querySelector('#avatar');\n\t\tvar welcomeMsg = document.querySelector('#welcome-msg');\n\t\tvar logoutBtn = document.querySelector('#logout-link');\n\n\t\thideElement(itemNav);\n\t\thideElement(itemList);\n\t\thideElement(avatar);\n\t\thideElement(logoutBtn);\n\t\thideElement(welcomeMsg);\n\t\thideElement(registerForm);\n\t\thideElement(document.querySelector('#insert-form'));\n\n\t\tclearLoginError();\n\t\tshowElement(loginForm);\n\t}", "async _recoverIfPossible() {\n log.error('Editor gave up!');\n\n const newInfo = await this._recover(this._editorComplex.docSession.sessionInfo);\n\n if (typeof newInfo !== 'string') {\n log.info('Nothing more to do. :\\'(');\n return;\n }\n\n log.info('Attempting recovery with new session info...');\n const sessionInfo = this._parseInfo(newInfo);\n this._editorComplex.connectNewSession(sessionInfo);\n this._recoverySetup();\n }", "function reInitializeFailure() {\n console.log(\"Re-Initialize Signiant App Failed, retrying\");\n alert(\"Signiant App Connection Lost, Retrying...\");\n reInitializeApp();\n}", "function onSessionInvalid() {\n\t\tvar loginForm = document.querySelector('#login-form');\n\t\tvar registerForm = document.querySelector('#register-form');\n\t\tvar itemNav = document.querySelector('#item-nav');\n\t\tvar itemList = document.querySelector('#item-list');\n\t\tvar avatar = document.querySelector('#avatar');\n\t\tvar welcomeMsg = document.querySelector('#welcome-msg');\n\t\tvar logoutBtn = document.querySelector('#logout-link');\n\n\t\thideElement(itemNav);\n\t\thideElement(itemList);\n\t\thideElement(avatar);\n\t\thideElement(logoutBtn);\n\t\thideElement(welcomeMsg);\n\t\thideElement(registerForm);\n\n\t\tclearLoginError();\n\t\tshowElement(loginForm);\n\t}", "function hack_legacy_app_specific_hacks() {\n\n if(_pTabId == \"pMouseSpinalCord\") {\n\n if(window.console)\n console.log(\"importing legacy spinal hacks\");\n\n import_spinal_hacks();\n\n } else if(_pTabId == \"pGlioblastoma\") {\n\n import_glio_hacks();\n }\n}", "static clearOldNonces() {\n Object.keys(localStorage).forEach(key => {\n if (!key.startsWith(\"com.auth0.auth\")) {\n return;\n }\n localStorage.removeItem(key);\n });\n }", "function sessionCleanup() {\n\n\t}", "static old_password_error() {\n \n }", "die() {\n HSystem.killApp(this.appId, false);\n }", "die() {\n HSystem.killApp(this.appId, false);\n }", "function isGsClerk(req,res,next){\n if(global.sess == true){\n if(global.level == 3 || global.level == 2){\n return next();\n }\n else{\n res.redirect(\"/forbidden\");\n }\n }\n else{\n req.session.returnTo = req.originalUrl; \n res.redirect(\"/login\");\n }\n}", "function keepSessionalive() {\n\t\t\tdailyMailScanDataService.keepSessionalive()\n\t\t\t\t.then(function (response) { });\n\t\t}", "function continueClose() {\n Alloy.eventDispatcher.trigger('session:renew');\n $.trigger('dashboard:dismiss', {});\n}", "function xqserver_msgadd_badusercount(){\r\n\tsetup(g_qwUserId);\r\n\tengine.TickleListen(true,g_wPort);\r\n\tengine.MsgAdd(l_dwSessionID,++l_dwSequence,QWORD2CHARCODES(g_qwUserId),0,g_dw0QType,g_bstr0QTypeData,g_dw0QTypeDataSize);\r\n\tExpectedState(engine,DISCONNECTED);\r\n}//endmethod", "function kPerkCookie(){\n\t//declare and initialize variables\n\tvar chipsAhoy;\n\tvar killerPoll = pollPerks(killerPerks);\n\tvar expDate = new Date();\n\t//set the expiration date 5 years from now\n\texpDate.setFullYear(expDate.getFullYear() + 5);\n\t//check for case - no redactions\n\tif(killerPoll.length < 1) {\n\t\tchipsAhoy = \"KillerPerks=none;\" + \"expires=\" + expDate.toUTCString();\n\t}\n\t//check for case - there are redactions\n\telse {\n\t\tvar redactPerks = killerPoll.toString();\n\t\tredactPerks = formatData(redactPerks);\n\t\tchipsAhoy = \"KillerPerks=\" + redactPerks + \";\" + \"expires=\" + expDate.toUTCString();\n\t}\n\treturn chipsAhoy;\n}", "sessionAlreadyAccepted() {\n let trace = localStorage.getItem('gdpr')\n if (trace === window.localStorage.gdpr) {\n this.setState({ acceptedGdpr: true })\n }\n }", "function nuke () {\n clear();\n cookies.remove(COOKIE_NAME);\n}", "clearOldNonces() {\n try {\n Object.keys(localStorage).forEach(key => {\n if (!key.startsWith('com.auth0.auth')) {\n return;\n }\n localStorage.removeItem(key);\n });\n } catch (erorr) { /* */ }\n }", "function sessionTimeoutHandler() {\r\n PF('pageExpiredDialog').show();\r\n}", "NoSessionStateCallback() {\n console.log(\"NoSessionStateCallback entered\");\n ClearSuperGlobals();\n // Show login window\n app.ShowLoginModal();\n }", "function server_or_connect_error()\n{\n// FIXME: We could display something on screen at this point to let the user know we had a problem completing a reload\n reload_later(reload_interval)\n}", "function stopBadPass(res) {\n console.log('Request using incorrect password blocked.');\n res.status(403);\n res.end();\n}", "function comm_error() {\n showerror(_(\"Error communicating with OpenSprinkler. Please check your password is correct.\"));\n}", "resetSession(sessionID) {\n this.insured[sessionID] = {};\n }", "function failToBuy(product) {\n \"use strict\";\n\n g.ledger.write('Looks like you don\\'t have enough to buy the ' + product.product.name + '.');\n}", "static rejectSession(req, res) {\n const sessionId = parseInt(req.params.id, 10);\n const findSession = Sessions.find((session) => session.id === sessionId);\n if (findSession) {\n findSession.session_status = 'rejected';\n return res.status(200).json({\n status: 200,\n data: findSession,\n });\n }\n return res.send(404).json({\n status: 404,\n error: 'Not created',\n });\n }", "async _recoverIfPossible() {\n log.error('Editor gave up!');\n\n const newKey = await this._recover(this._editorComplex.docSession.key);\n\n if (typeof newKey !== 'string') {\n log.info('Nothing more to do. :\\'(');\n return;\n }\n\n log.info('Attempting recovery with new key...');\n const sessionKey = this._parseAndFixKey(newKey);\n this._editorComplex.connectNewSession(sessionKey);\n this._recoverySetup();\n }", "function reset_app() {\n store.set('is_registered_x', 0);\n}", "makeBadConfirmCode () {\n\t\tlet newConfirmCode;\n\t\tdo {\n\t\t\tnewConfirmCode = ConfirmCode();\n\t\t} while (newConfirmCode === this.data.confirmationCode);\n\t\tthis.data.confirmationCode = newConfirmCode;\n\t}", "_maybeSaveSession() {\n if (this.session && this._options.stickySession) {\n saveSession(this.session);\n }\n }", "skipSession() {\n clearInterval(this.intervalID);\n this.props.toggleMode(this.props.countdown.countdownMode);\n this.onStartCountdown();\n }", "function fixbadjs(){\n\ttry{\n\t\tvar uw = typeof unsafeWindow !== \"undefined\"?unsafeWindow:window;\n\t\t// breakbadtoys is injected by jumpbar.js from TheHiveWorks\n\t\t// killbill and bucheck are injected by ks_headbar.js from Keenspot\n\t\tvar badFunctions = [\"breakbadtoys2\", \"killbill\", \"bucheck\"];\n\t\tfor (var i = 0; i < badFunctions.length; i++) {\n\t\t\tvar name = badFunctions[i];\n\t\t\tif (typeof uw[name] !== \"undefined\") {\n\t\t\t\tconsole.log(\"Disabling anti-wcr code\");\n\t\t\t\tuw.removeEventListener(\"load\", uw[name], true);\n\t\t\t\tuw[name] = function() {};\n\t\t\t} else {\n\t\t\t\tObject.defineProperty(uw,name,{get:function(){return function(){}}, configurable: false});\n\t\t\t}\n\t\t}\n\t} catch(e) {\n\t\tconsole.error(\"Failed to disable bad js:\", e);\n\t\t//console.error(e);\n\t}\n}", "function forceNewLogin() {\n window.location.href = getWebServerRelativeUrl() + '_layouts/closeConnection.aspx?loginasanotheruser=true';\n }", "function fail_build(err, res, body) {\n\tfrisby.create('Fail Re-Build ExtJS GUI')\n\t .addHeader('Cookie', session_cookie) // Pass session cookie with each request\n\t\t.get(url + '/api/build?catalogName=dbo.Empleado&ouput=extjs')\n\t\t.expectStatus(401)\n\t\t.expectHeaderContains('content-type', 'application/json')\n\t\t.expectJSON({\n\t\t\tsuccess: false\n\t\t})\n\t.toss();\n}", "function isWeirdUnusableDevice(device) {\n return device.id === '????????????'\n }", "_doDisconnect() {\n this.sid = null;\n this.rid = Math.floor(Math.random() * 4294967295);\n if (this._conn._sessionCachingSupported()) {\n sessionStorage.removeItem('strophe-bosh-session');\n }\n\n this._conn.nextValidRid(this.rid);\n }", "unlocked(){return hasUpgrade(\"燃料\",11)}", "function reset() {\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__session__[\"a\" /* remove */])('logged_in');\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__session__[\"a\" /* remove */])('username');\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__session__[\"a\" /* remove */])('user');\n}", "function disablePrivateFeatures() {\n // TODO Update the login status\n}//disablePrivateFeatures()", "function esci_account(){\r\n sessionStorage.removeItem(\"user\");\r\n document.write(\" \");\r\n window.location.href = \"index.html\";\r\n}", "hacky(){\n return\n }", "function spamProtection(session,checksum) {\n\tif (session.isFirst)\n\t\treturn false;\n\tif (sessionTokens[session._id] != checksum)\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "function confirmSystemHaker(){\n if (sessionStorage.getItem(\"loggedUserId\")==null) {\n location.href = '/HTML/loginAndSigup.html'\n }\n}", "function recoverSession( callback ) {\n\t try {\n\t tools_service.showPreloader($scope, 'show');\n\t\t\tyto_session_service.currentSession(function (session) {\n //openmarket_session_service.currentSession(function (session) {\n\n if (session != null) {\n\t\t\t\t\t$scope.local.user = session.user;\n\t\t\t\t\t$scope.load.user = true;\n\n \tif (session.traveler != null){\n\t //pago por defecto tpv\n\t $scope.tabActive = 'tpv';\n\t $scope.local.traveler = session.traveler;\n\t $scope.load.traveler = true;\n\t\t\t\t\t\tif ($scope.local.traveler.phone) {\n\t\t\t\t\t\t //console.log(\"_si tel_\"+$scope.local.traveler.phone);\n\t\t\t\t\t\t $scope.showStep.s0 = false;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t //console.log(\"_no tel_\"+$scope.local.traveler.phone);\n\t\t\t\t\t\t $scope.showStep.s0 = true;\n\t\t\t\t\t\t}\n }\n if (session.affiliate != null){ \t\n \t$scope.tabActive = 'transfer';\n \t$scope.showStep.s0 = false;\n\t $scope.local.affiliate = session.affiliate;\n\t $scope.local.agencyid = session.agencyid;\n\t $scope.local.firstPayPercent = 15;\n\t $scope.load.affiliate = true;\n\t }\n\n tools_service.showPreloader($scope, 'hide');\n\t\t\t\t\t\n\t\t\t\t\tif (angular.isFunction(callback)){\n\t\t\t\t\t\tcallback();\n\t\t\t\t\t}\n\n } else {\n \t$scope.tabActive = 'default';\n tools_service.showPreloader($scope, 'hide');\n \n if (angular.isFunction(callback)){\n\t\t\t\t\t\tcallback();\n\t\t\t\t\t}\n }\n\n });\n\t \n\t }\n\t catch (err) {\n\t console.log(err);\n\t }\n\t}", "function skip(req, res, next) {\n\n req.session.history = req.session.history || [];\n\n dump(req.session.history);\n\n next();\n}", "function reportError(resp, from) {\n var old = debug.isEnabled();\n debug.setEnabled(true);\n debug.print(\"session.js (reportError from \" + from + \"): \"\n + \"status = (\" + resp.status + \") \" + resp.statusText\n + \", response = \" + resp.responseText\n + \", request.url = \" + resp.request.url);\n debug.setEnabled(old);\n}", "function resetWindowLoads(option) {\n if(option === \"reset\"){\n sessionStorage.setItem(\"windowLoads\",\"0\");\n }\n}", "_reset() {\n this.rid = Math.floor(Math.random() * 4294967295);\n this.sid = null;\n this.errors = 0;\n if (this._conn._sessionCachingSupported()) {\n sessionStorage.removeItem('strophe-bosh-session');\n }\n\n this._conn.nextValidRid(this.rid);\n }", "dontShowAgain() {\n setCookie(\"showWarning\", false, 100)\n }", "sclear() {\n sessionStorage.clear()\n }", "function getSessionInfo_callback_failure(envelope, response) {\r\n writeSR3(\"GetSessionInfo failed\", false);\r\n setTimeout(\"writeSR3('', false)\", 10000);\r\n}", "function badUpgrade(user){\n if(user.point > 10){\n // upgrade logic\n }\n}", "function onloadEMT() { \n\tvar LPcookieLengthTest=document.cookie;\n\tif (lpMTag.lpBrowser == 'IE' && LPcookieLengthTest.length>1000){\n\t\tlpMTagConfig.sendCookies=false;\n\t}\n}", "function trade404() {\n\talert(\"An error occured!\");\n\tlocation.reload();\n}", "function punish(user, session) {\n const now = Date.now();\n // reset every 2 minutes for strike counting\n if (!session.strikeStart || now - session.strikeStart > 120000) {\n session.strikeStart = now;\n session.strikes = 0;\n }\n\n session.strikes = session.strikes || 0;\n session.strikes++;\n\n // if you fail 100+ times within 2 minutes, you're probably a bot\n if (session.strikes > 100 && now - session.strikeStart < 120000)\n banUser(user.name);\n}", "function checkCurrentSessionID ( sessID ) {\n\treturn (sessionID === sessID)?true:false;\n}", "killCachedSessionAndCredentials() {\n\n Object.keys(localStorage).forEach(function(key) {\n if (key.substring(0, \"__stitch\".length) == \"__stitch\") {\n localStorage.removeItem(key);\n }\n });\n\n for (let i = 0; i < this.authenticated_models.length; i++) {\n try {\n localStorage.removeItem(this.authenticated_models[i]);\n } catch (e) {\n // doesnt exist so no problem\n }\n }\n\n for (let i = 0; i < this.sync_models.length; i++) {\n localStorage.removeItem(this.sync_models[i]);\n }\n\n this.email = \"\";\n this.password = \"\";\n }", "function somethingBad() {\n nock.cleanAll()\n }", "function killInvalidLS() {\n\t\t// checks if localstorage has any data\n\t\tif (localStorage.length >0) {\n\t\t\tfor (var n in localStorage) {\n\t\t\t\tvar stor = localStorage.getItem(n);\n\t\t\t\t// checks if data found is json object\n\t\t\t\t// if it's not remove the system file\n\t\t\t\tif (stor.charAt(0) != '{') {\n\t\t\t\t\tconsole.log(\"Removing: \" + n);\n\t\t\t\t\tlocalStorage.removeItem(n);\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t}", "function FailedTNCallback(error) {\n // Session may have timed out post back to same page to handle it\n __doPostBack('__Page', ''); \n}", "function BrowsingSessionBank() {}", "function Window_DynamicShopUnlocked() {\n\t\tthis.initialize.apply(this, arguments);\t\n\t}", "function validate_session(req, res, next) {\n\treq.session = Util.get_session(req);\n\tif (req.session == undefined)\n\t\treturn Util.session_error(req, res);\n\tnext();\n}", "function us_handshake_old(qeued) {\r\n var time = new Date();\r\n var t = Math.round(time.getTime()/1000);\r\n\r\n if (qeued == 0) { us_boxcontent('Logging in...',loadgif); }\r\n GM_xmlhttpRequest({\r\n method: 'GET',\r\n url: 'http://post.audioscrobbler.com/?hs=true&p=1.1&c=xrm&v=1.0&u='+GM_getValue('user'), \r\n headers: {\r\n 'Host': 'post.audioscrobbler.com',\r\n 'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey',\r\n 'Accept': 'application/atom+xml,application/xml,text/xml',\r\n },\r\n onload: function(responseDetails) {\r\n var loginbox = document.getElementById('us_loginbox');\r\n if (responseDetails.statusText == 'OK') {\r\n var res = responseDetails.responseText.split('\\n');\r\n if (res[0] == 'UPTODATE') {\r\n GM_setValue('sid',res[1]);\r\n GM_setValue('suburl',res[2]);\r\n GM_setValue('interval',res[3].split(\" \")[1]);\r\n if (qeued == 0) { us_scrobbleform(); }\r\n }\r\n else if (res[0] == 'BADUSER') {\r\n us_resetlogin('Username was not found.');\r\n }\r\n else {\r\n us_boxcontent('Error','<div class=\"us_error\">'+responseDetails.responseText+'</div>');\r\n }\r\n }\r\n else {\r\n us_boxcontent('Error','<div class=\"us_error\">'+responseDetails.responseText+'</div>');\r\n }\r\n }\r\n});\r\n}", "function keepSessionAliveTimeoutHandler() {\r\n // Confirm with user if keep session alive if promptForSessionKeepAlive is set to true\r\n if (promptForSessionKeepAlive.toUpperCase() == \"TRUE\") {\r\n PF('idleDialog').show();\r\n }\r\n}", "async function handleSession() {\n const sessionData = localStorage.getItem(\"mdb_session\");\n\n if (!sessionData) {\n const newSessionData = await getGuestSession();\n\n if (newSessionData) {\n const sessionDataString = JSON.stringify(newSessionData);\n\n localStorage.setItem(\"mdb_session\", sessionDataString);\n showToastBanner();\n return true;\n }\n\n return false;\n } else {\n const parsedSessionData = JSON.parse(sessionData);\n\n if (isSessionExpired(parsedSessionData.expires_at)) {\n localStorage.removeItem(\"mdb_session\");\n await handleSession();\n return true;\n }\n }\n}", "function distilledCheckAnalyticsCookie() {\n\tvar cookiename = \"__utma\";\n\tvar cookiecheck = 0;\n\tvar cookies = document.cookie.split(';');\n\tfor (var i=0;i<cookies.length;i++){\n\t\twhile (cookies[i].charAt(0)==' ') cookies[i] = cookies[i].substring(1,cookies[i].length);\n\t\tif (cookies[i].indexOf(cookiename+'=') == 0){\n\t\t\tcookiecheck = 1;\n\t\t} //if\n\t} //for\n\treturn cookiecheck;\n}//distilledCheckAnalyticsCookie", "function fetch_sessionhash()\n{\n\treturn (SESSIONURL == '' ? '' : SESSIONURL.substr(2, 32));\n}", "function cookiesNotEnabled() \n{\n\treturn true; // We're not going to use cookies\n}", "function uninstall(data, reason) {}", "function uninstall(data, reason) {}", "function cmisLoginFail() {\n login.loginFail();\n}", "function check_lost_state() {\n //console.log(\"I am lost\");\n //return false;\n\n current_page = vc_info.vc;\n\n for(key in order_map) {\n pg=order_map[key];\n if(pg==current_page) {\n redirect(user_dashboard);\n console.log('Return lost user to dashboard');\n break;\n }\n }\n\n\n}", "signOutAndRestart() {}", "[SESSION_INFO_FAILURE] (state, errorInfo) {\n state.pullingSessionInfo = false\n state.userIsLoggedIn = false\n state.token = null\n state.user = null\n\n // state.logoutErrorMessage = ServerErrorParser.parse(errorInfo).errorMessage\n }", "function unfair() {\n // do the session ending code here\n // CAUTION : This log is not meant for any developers involved in the project ;)\n console.log('Some Fool Is Peeking.');\n let count = 3;\n clearInterval(interval);\n let intruderInterval = setInterval(() => {\n console.log(`You've ${count} seconds to secure the location`);\n alert(\"You've be alone to secure the location\");\n count--;\n\n if (count === 0) {\n clearInterval(intruderInterval);\n\n detect();\n\n //Blow Up The Intruder\n // window.location.href=\"session_out.html\";\n }\n }, 1000);\n}", "function waitForApperySessionToken() {\n //apperySessionTokenCount++;\n //sessionStorage.setItem('apperySessionTokenCount', apperySessionTokenCount);\n var sessionToken = Apperyio.User.getToken(sessionStorage.getItem('db_id'));\n if (sessionToken) {\n Helper.apperySessionTokenReceived(sessionToken);\n } else {\n //console.log('waitForApperySessionToken');\n setTimeout(waitForApperySessionToken, 500);\n }\n}", "function init(){\r\n checkSession(); \r\n}", "function gm_authFailure() {\n if (Shopify.designMode) {\n theme.$currentMapContainer.addClass('page-width map-section--load-error');\n theme.$currentMapContainer.find('.map-section__content-wrapper').remove();\n theme.$currentMapContainer.find('.map-section__wrapper').html('<div class=\"errors text-center\" style=\"width: 100%;\">' + theme.strings.authError + '</div>');\n }\n}", "function confirmSystemHaker() {\n if (sessionStorage.getItem(\"loggedUserId\") == null) {\n location.href = '/HTML/loginAndSigup.html'\n } else {\n let users = JSON.parse(localStorage.getItem(\"users\"))\n let id = JSON.parse(sessionStorage.getItem(\"loggedUserId\"))\n for (const user of users) {\n\n if(user._id==id){\n if(user._accountType==2){\n localStorage.removeItem('loggedUserId');\n location.href = '/HTML/loginAndSigup.html'\n }\n }\n }\n }\n}", "function killswitch (req, res, next) {\n\tvar error,\n\t\ttxnId = req.body.txnId || req.params.txnId || req.session.txnId;\n\n\treq.session.isRcrEnabled = (req.session.isRcrEnabled) ? req.session.isRcrEnabled : {};\n\n\tif (req.session.isRcrEnabled[txnId] === false) {\n\t\treq.logWrap('error', \"[RcrEnabledSessionCheckFailed] RCR is not enabled for this user or scenario\", next);\n\t} else if (req.session.isRcrEnabled[txnId] === true) {\n\t\tnext();\n\t} else {\n\t\tif (txnId) {\n\t\t\tcore.getSenderTransactionDetails(txnId, function (err, txnDetails) {\n\t\t\t\tif (err) {\n\t\t\t\t\treq.logWrap('error', err, next);\n\t\t\t\t} else if (!(_.has(txnDetails, 'body.result.responseStatus.returnCode'))) {\n\t\t\t\t\treq.logWrap('error', \"Error response from DisputeCoreIntegration:get_sender_transaction_details\", next);\n\t\t\t\t} else if (req.isErrorCode(txnDetails.body.result.responseStatus.returnCode)) {\n\t\t\t\t\treq.logWrap('error', \"Error response from DisputeCoreIntegration:get_sender_transaction_details -- \" + txnDetails.body.result.responseStatus.returnMessage, next);\n\t\t\t\t} else {\n\t\t\t\t\tvar input = {\n\t\t\t\t\t\ttxnId: txnId,\n\t\t\t\t\t\tbuyerAccountNumber: txnDetails.body.result.accountNumber,\n\t\t\t\t\t\tsellerAccountNumber: txnDetails.body.result.counterparty\n\t\t\t\t\t};\n\t\t\t\t\tcore.isRcrEnabled(input, function (err, result) {\n\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\treq.logWrap('error', err, next);\n\t\t\t\t\t\t} else if (!(_.has(result, 'body.result.responseStatus.returnCode'))) {\n\t\t\t\t\t\t\treq.logWrap('error', \"Error response from DisputeCoreIntegration:is_rcr_enabled\", next);\n\t\t\t\t\t\t} else if (req.isErrorCode(result.body.result.responseStatus.returnCode)) {\n\t\t\t\t\t\t\treq.logWrap('error', \"Error response from DisputeCoreIntegration:is_rcr_enabled -- \" + result.body.result.responseStatus.returnMessage, next);\n\t\t\t\t\t\t} else if (result.body.result.rcrEnabled === false) {\n\t\t\t\t\t\t\treq.session.isRcrEnabled[txnId] = false;\n\t\t\t\t\t\t\treq.logWrap('error', \"[RcrEnabledServiceCheckFailed] RCR is not enabled for this user or scenario\", next);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treq.session.isRcrEnabled[txnId] = true;\n\t\t\t\t\t\t\treq.logWrap('info', \"[RcrEnabledServiceCheckSuccess] Enabled for txn: \" + txnId, next);\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} else {\n\t\t\treq.logWrap('error', \"No transaction ID given. Cannot run RCR enabled check.\", next);\n\t\t}\n\t}\n}", "function checkSessionTimeout(object) {\n\tif (object.constructor === \"string\".constructor) {\n\t\tif (object.indexOf(\"Empty content.\") > -1) {\n\t\t\t// return to login page\n\t\t\twindow.top.location = getContextPath() + \"/login\";\n\t\t\treturn 1;\n\t\t}\n\t}\n\treturn 0;\n}", "keepAlive() {\n\t\tif (this.portalId === undefined) {\n\t\t\treturn\n\t\t}\n\t\tthis.client.send(`R/${this.portalId}/system/0/Serial`, '')\n\t}", "function _failedReq() {\n\t\t\t\t\t\tif(idataObj.hasOwnProperty('socket')) {\n\t\t\t\t\t\t\tidataObj.socket = undefined;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//logger.error(JSON.stringify(idataObj));\n\t\t\t\t\t\tif(idataObj.offLineRequest == true) {\n\t\t\t\t\t\t\tdbStore.redisConnPub.publish('FAILURE_DAEMON', JSON.stringify(idataObj));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(socket) {\n\t\t\t\t\t\t\tidataObj.socketId = socket.id;\n\t\t\t\t\t\t}\n\t\t\t\t\t}" ]
[ "0.67468977", "0.66138935", "0.59475714", "0.57612824", "0.5756241", "0.56617385", "0.5651538", "0.56376326", "0.5597882", "0.5528068", "0.5514786", "0.54664284", "0.54555815", "0.54440224", "0.5432712", "0.54175544", "0.54167455", "0.54066914", "0.5403808", "0.5399567", "0.5379914", "0.53666973", "0.5322267", "0.52689946", "0.5245321", "0.5245321", "0.5244292", "0.52331465", "0.5223607", "0.52232903", "0.5215778", "0.5207475", "0.5190031", "0.5189207", "0.51772165", "0.5175435", "0.51744", "0.5170112", "0.5167667", "0.5162733", "0.5154233", "0.5135347", "0.51287097", "0.5118941", "0.51108223", "0.5107918", "0.5104746", "0.51047134", "0.51042444", "0.5102241", "0.50982815", "0.5091435", "0.5080875", "0.50806075", "0.50804317", "0.5079821", "0.5060793", "0.5057886", "0.50562763", "0.5054725", "0.505058", "0.5049872", "0.5049679", "0.5048822", "0.50470454", "0.50374997", "0.5020652", "0.5012806", "0.50095385", "0.5008976", "0.5002651", "0.50021076", "0.49966514", "0.49873424", "0.49838486", "0.49830368", "0.49803755", "0.49787056", "0.49762028", "0.49715132", "0.4969573", "0.49690697", "0.49682376", "0.49653807", "0.4964032", "0.49619198", "0.49619198", "0.49616626", "0.49601936", "0.4956576", "0.49553365", "0.49477857", "0.49467063", "0.494456", "0.49415892", "0.49409986", "0.49347252", "0.4926405", "0.4919434", "0.4912546" ]
0.74862444
0
BAD SESSION KILLER Case there's a bad session kill it and redirect to auth flow
async function badSessionKillerRedirect(ctx, next) { const { shop: shopOrigin } = ctx.session; const queryData = url.parse(ctx.request.url, true); const requestPath = ctx.request.url; if ( shopOrigin && queryData.query.shop && shopOrigin !== queryData.query.shop ) { if (!requestPath.match(/^\/script|^\/product/g)) { console.debug('🎤 Dropping invalid session'); ctx.session.shopOrigin = null; ctx.session.accessToken = null; reportEvent(shopOrigin, 'bad_session_killed', { value: 'multiple_shops', secondShop: queryData.query.shop, }); ctx.redirect('/auth'); } } await next(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function badSessionKillerReInstall(ctx, _next) {\n if (ctx.request.header.cookie) {\n if (\n (ctx.request.url.split('?')[0] === '/' &&\n ctx.request.querystring.split('&') &&\n ctx.request.querystring.split('&')[0].split('=')[0] === 'hmac' &&\n ctx.request.querystring.split('&')[1].split('=')[0] !== 'locale') ||\n (ctx.request.url.split('?')[0] === '/auth/callback' &&\n ctx.request.querystring.split('&') &&\n ctx.request.querystring.split('&')[1].split('=')[0] === 'hmac')\n ) {\n console.log(\n `Killing bad session: url: ${ctx.request.url}, cookie: ${ctx.request.header.cookie}`,\n );\n reportEvent(\n ctx.request.header.cookie.shopOrigin,\n 'bad_session_killed',\n { value: 'reinstall' },\n );\n ctx.request.header.cookie = ctx.request.header.cookie\n .split(' ')\n .filter(\n (item) =>\n ['koa:sess', 'koa:sess.sig'].indexOf(item.split('=')[0]) === -1,\n )\n .join(' ');\n }\n }\n await _next();\n}", "respondWithRedirect(ctx) {\n if (!ctx.session) {\n return ctx.response.status(this.status).send('Invalid credentials');\n }\n ctx.session.flashExcept(['_csrf']);\n ctx.session.flash('auth', {\n errors: {\n uid: this.code === 'E_INVALID_AUTH_UID' ? ['Invalid login id'] : null,\n password: this.code === 'E_INVALID_AUTH_PASSWORD' ? ['Invalid password'] : null,\n },\n });\n ctx.response.redirect('back', true);\n }", "function isGsClerk(req,res,next){\n if(global.sess == true){\n if(global.level == 3 || global.level == 2){\n return next();\n }\n else{\n res.redirect(\"/forbidden\");\n }\n }\n else{\n req.session.returnTo = req.originalUrl; \n res.redirect(\"/login\");\n }\n}", "function finalize(err, uid) {\nconsole.error('AUTHENTICATE', err && err.stack || err, uid);\n // no such user or logout? -> remove req.session\n if (err || !uid) {\n // FIXME: instead set a flash with error?\n delete req.session;\n // ok? -> set req.session.uid\n } else {\nconsole.error('SIGNEDIN', uid);\n if (!req.session) req.session = {};\n req.session.uid = uid;\n }\nconsole.error('SESS', req.session);\n res.writeHead(302, {location: req.session ? '/' : mount});\n res.end();\n }", "preventLogin(req, res, next){\n\t\tif (!req.cookies._id){\n\t\t\tnext();\n\t\t}else{\n\t\t\tres.redirect('/');\n\t\t}\n\t}", "function accessDenied() {\n $state.go('401');\n }", "function sessionValidate (req, res, next) {\n console.log('Validando session del usuario')\n if (typeof req.session.userLoged === 'undefined') {\n res.redirect('/login')\n } else {\n // Ya esta logeado\n next()\n }\n}", "function checkAuth(req, res, next) {\n if (req.isAuthenticated()) return next();\n req.session.backURL = req.url;\n res.redirect(\"/login\");\n }", "static deauthenticateUser() {\n sessionStorage.removeItem('refreshToken');\n }", "function isLoggedInSendUnauth(req, res, next) {\n\t\t// if user is authenticated in the session, carry on\n\t\tif (req.isAuthenticated())\n\t\t\treturn next();\n\n\t\t// if they aren't send unauthorized message\n\t\tres.send(401, \"Unauthorized\"); \n\t}", "requireAuth(req, res, next){\n if(!req.session.userId){\n return res.redirect('/signin');\n }\n next();\n }", "function rejectUser() {\n saveToken(null);\n saveUser(null);\n user.auth = false;\n\n // notify app that there was a problem, assume user is not auth-ed\n $rootScope.$emit('user:auth', { type: 'logout' });\n }", "function onFailAuthLoadout(msg, req, res) {\n res.json({\n result: false,\n 'msg': msg\n });\n}", "function handleSessionExpiration() {\n const tick = 1000 * 60; // 1 min\n const timeout = 1000 * 600 // 10 min\n const sessionCleaner = createSessionCleaner({ timeout });\n setTimeout(\n sessionCleaner.cleanSession.bind(sessionCleaner), tick);\n}", "requireAuth(req, res, next) {\n if(!req.session.userId) {\n return res.redirect('/signin');\n }\n next();\n }", "function restrict (req, res, next) {\n // console.log('=====================>>> session info:', req.url);\n // console.log(req.session);\n if (req.session.key) {\n\n SessionKeys.reset()\n .query('where', 'key', '=', req.session.key)\n .fetch()\n .then(function(userKey) {\n if (userKey.length === 0) {\n res.redirect(\"/login\");\n } else {\n next();\n }\n });\n } else {\n //req.session.error = \"Access denied. Please log in.\";\n res.redirect('/login');\n }\n}", "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 handle_err(res) {\n if ('error' in res) {\n console.warn(res);\n if (res['error']['message'] === 'ERR_LOGIN_TICKET_EXPIRED') {\n // log out\n localStorage.clear();\n current_window.reload();\n }\n return true;\n }\n return false;\n}", "function restoreSession(req, res, next) {\n // console.log(req.session);\n \n let sessionHasData = validateSession(req.session);\n // console.log(sessionHasData ? 'cookie session has data' : 'cookie session empty');\n if (!sessionHasData) { return res.redirect('/logout') }\n \n next();\n}", "function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n req.flash(\"error\",\"Login with Instagram to start...\");\n res.redirect('/beach');\n}", "function verifySession(req, res, next) {\r\n if (req.session) next();\r\n else {\r\n res.status(400).json({\r\n status: 'FAILURE',\r\n data: {\r\n err: 'Session Missing',\r\n },\r\n });\r\n }\r\n}", "function onSessionInvalid() {\n\t\tvar loginForm = document.querySelector('#login-form');\n\t\tvar registerForm = document.querySelector('#register-form');\n\t\tvar itemNav = document.querySelector('#item-nav');\n\t\tvar itemList = document.querySelector('#item-list');\n\t\tvar avatar = document.querySelector('#avatar');\n\t\tvar welcomeMsg = document.querySelector('#welcome-msg');\n\t\tvar logoutBtn = document.querySelector('#logout-link');\n\n\t\thideElement(itemNav);\n\t\thideElement(itemList);\n\t\thideElement(avatar);\n\t\thideElement(logoutBtn);\n\t\thideElement(welcomeMsg);\n\t\thideElement(registerForm);\n\n\t\tclearLoginError();\n\t\tshowElement(loginForm);\n\t}", "returnToLogin() {\n this.store.dispatch(clearOkapiToken());\n this.store.dispatch(clearCurrentUser());\n this.store.dispatch(resetStore());\n localforage.removeItem('okapiSess');\n }", "function checkAuth()\n{\n //check if we still have a valid token, if we do, it's all good. if we don't, checkauth will try to relogin, if\n // that fails we will redirect to loginform\n auth.checkAuth()\n .catch((error) => {\n console.error(\"invalid checkauth on resume\");\n this.$router.replace({name: 'loginform'});\n });\n}", "function preventLogin() {\n if (currentUser) {\n window.location = \"index.html\";\n }\n}", "function restrict(req, res, next){\n\n\tif (req.session.user) {\n\t\tnext();\n\t} else {\n\t\t//res.redirect('https://localhost:' + sslport + '/sessions/new?rd=' + req.url);\n\t\tres.redirect('/sessions/new?rd=' + req.url);\n\t}\n}", "function needNoUserID(req, res, next) {\n if (req.session.userID) {\n res.redirect(\"/petition\");\n } else {\n next();\n }\n}", "function restrict(req, res, next) {\n if (req.session.user) {\n next();\n } else {\n res.redirect('/LoginGateway');\n }\n}", "function unauthRedirect() {\r\n if(!$rootScope.devices || !$rootScope.devices.length) {\r\n $location.path( \"/pair\" );\r\n }\r\n }", "requireAuth(req, res, next) {\n\t\tif (!req.session.userId) {\n\t\t\treturn res.redirect('/signin');\n\t\t}\n\t\tnext();\n\t}", "function onSessionInvalid() {\n\t\tvar loginForm = document.querySelector('#login-form');\n\t\tvar registerForm = document.querySelector('#register-form');\n\t\tvar itemNav = document.querySelector('#item-nav');\n\t\tvar itemList = document.querySelector('#item-list');\n\t\tvar avatar = document.querySelector('#avatar');\n\t\tvar welcomeMsg = document.querySelector('#welcome-msg');\n\t\tvar logoutBtn = document.querySelector('#logout-link');\n\n\t\thideElement(itemNav);\n\t\thideElement(itemList);\n\t\thideElement(avatar);\n\t\thideElement(logoutBtn);\n\t\thideElement(welcomeMsg);\n\t\thideElement(registerForm);\n\t\thideElement(document.querySelector('#insert-form'));\n\n\t\tclearLoginError();\n\t\tshowElement(loginForm);\n\t}", "function check_auth(req, res, next) {\n if (req.session.user) {\n next();\n } else {\n req.session.error = 'Access denied!';\n req.session.last_url = req.originalUrl;\n res.redirect('/users/login');\n }\n}", "function authenticate(req, res, next) {\n req.session.count = req.session.count || 0;\n req.session.count++;\n var user = req.session.user = req.body.user || \"\";\n var password = req.body.password || \"\";\n\tdebugger;\n if (req.session.count > 3) {\n res.redirect('/toomany');\n } else if (!fakeDB.exists(user, password)) {\n req.flash('error', 'Invalid User/Password. You have ' + (3 - (req.session.count - 1)) + ' tries left');\n res.redirect('/');\n } else {\n\t\t //set user & reset error and count\n req.session.user = user;\n req.flash('error', '');\n next();\n }\n}", "function dummyLogout() {\n document.location = baseUrl + \"auth/logout/?redirect=\" + document.location;\n }", "function pimAuthCheck(status) {\n if (status == 401) { // stop everything on unauthorized\n window.location = \"index.html\" \n }\n}", "function isUnauthenticated(req, res, next) {\n if (req.session.isAuthenticated) return res.redirect(301, \"/\");\n next();\n}", "handleAuthentication() {\n this.auth0.parseHash((err, authResult) => {\n if (authResult && authResult.accessToken && authResult.idToken) {\n let expiresAt = JSON.stringify((authResult.expiresIn)* 1000 + new Date().getTime());\n // this.setSession(authResult);\n localStorage.setItem('access_token', authResult.accessToken);\n localStorage.setItem('id_token', authResult.idToken);\n localStorage.setItem('expires_at', expiresAt);\n location.hash = '';\n location.pathname = LOGIN_SUCCESS;\n }else if(err){\n location.pathname = LOGIN_FAILURE;\n console.log(err);\n alert(`Error: ${err.error}. Check the console for further details.`);\n }\n });\n }", "function checkNotLogin(req, res, next) {\n if (req.session.user) {\n req.flash('error', 'Already Logged In');\n return res.redirect('/timeline');\n }\n next();\n}", "function ensureNotAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n req.flash('error_msg', 'You are already logged in. If you want to switch users, click Logout to continue.');\n res.redirect('/chat');\n } else {\n return next();\n }\n}", "function onFailGrabAuth(msg, req, res) {\n res.json({\n result: false,\n 'msg': msg\n });\n}", "endSession(){\n\t\tthis.props.actions.endSession();\n\t\tbrowserHistory.push('/');\n\t}", "function restrict(req, res, next) {\n // console.log(req.session.username)\n // if (!req.session.username) {\n // res.redirect('/');\n // }\n next()\n}", "function validate_session(req, res, next) {\n\treq.session = Util.get_session(req);\n\tif (req.session == undefined)\n\t\treturn Util.session_error(req, res);\n\tnext();\n}", "function doFailure(log='') {\n console.log(log)\n setUnauthStatus({ log:\"connSignInAsync error. \"+log })\n resetStoredUserAuth()\n return null\n }", "function handle401 (res) {\n if (res.status === 401) {\n console.error(res)\n window.location.replace('/login')\n } else {\n return res\n }\n}", "function ensureLogin(req, res, next) {\n if (!req.session.user) {\n res.redirect(\"/log-in\");\n } else {\n next();\n }\n }", "function forceNewLogin() {\n window.location.href = getWebServerRelativeUrl() + '_layouts/closeConnection.aspx?loginasanotheruser=true';\n }", "function stopBadPass(res) {\n console.log('Request using incorrect password blocked.');\n res.status(403);\n res.end();\n}", "authFailure(state, status) {\n state.status = status;\n state.isAuthenticated = false;\n }", "function sessionHandler(req, res, next) {\n winston.info(req.url);\n if(req.url === '/login' ||\n req.url === '/forgotpassword' ||\n req.url === '/logout' ||\n req.url.startsWith('/verifytoken') ||\n req.url === '/admin' ||\n req.url === '/resetpassword'\n ) {\n winston.info(\"skip on session check\")\n next()\n }else {\n if (req.session.sessionID) {\n next()\n } else {\n res.status(401).json({message:\"Access is forbidden\"})\n }\n }\n}", "function logOff() {\n sessionStorage.removeItem(\"id\");\n window.location.replace(\"HomePage.html\");\n}", "deauthenticate(): void {}", "handleAuthentication () {\n this.auth0.parseHash((err, authResult) => {\n console.log(authResult)\n if (authResult && authResult.accessToken && authResult.idToken) {\n this.setSession(authResult)\n } else if (err) {\n router.replace('/')\n console.log(err)\n }\n })\n }", "function forceLogin(path) {\n clearToken();\n location.href = \"/\";\n throw new Error('Not Authenticated');\n}", "function confirmSystemHaker(){\n if (sessionStorage.getItem(\"loggedUserId\")==null) {\n location.href = '/HTML/loginAndSigup.html'\n }\n}", "function checkSessionTimeout(object) {\n\tif (object.constructor === \"string\".constructor) {\n\t\tif (object.indexOf(\"Empty content.\") > -1) {\n\t\t\t// return to login page\n\t\t\twindow.top.location = getContextPath() + \"/login\";\n\t\t\treturn 1;\n\t\t}\n\t}\n\treturn 0;\n}", "function logOut(){\r\n \tsessionStorage.clear();\r\n \twindow.location.href = \"/logout\";\r\n \tfunction preventBack() { \r\n \twindow.history.forward();\r\n \t } \r\n setTimeout(\"preventBack()\", 0); \r\n window.onunload = function () {\r\n null \r\n };\r\n }", "function isLogedin(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n req.session.oldUrl = req.url;\n res.redirect(\"/signin\");\n}", "function checkAuth(req, res, next) {\n if (!req.session.user) {\n res.send(\"authentication required\\n\", 401);\n } else {\n next();\n }\n}", "function requiresLogin(req,res,next){\n if(!req.session.userId){\n return res.status(401).send(\"Please login to view this page\");\n }\n next()\n}", "checkLoginAuth (to, from, next) {\n if (to.meta && to.meta.ignoreAuth) {\n next()\n } else {\n next()\n // 做一些权限校验,不通过跳转到登录页\n // if ($auth.checkSession()) {\n // next()\n // } else {\n // next({\n // path: '/login'\n // })\n // }\n }\n }", "function checkSession(req, res, next) {\n\tconsole.log(req.url)\n\tif (req.session.username) {\n\t\tnext();\n\t} else {\n\t res.send({ session_timeout: true });\n\t}\n}", "function checkConnection(req,res,next) {\n\tif(!req.session.user){\n\t\tres.redirect('/');\n\t}else{\n\t\tnext();\n\t}\n}", "function failToLogin() {\n window.location.href = config.baseUrl+\"/login\";\n}", "function loggedIn(req, res, next) {\n console.log(\"checking for user\");\n if (typeof req._passport.session.user == 'undefined') {\n console.log(\"no user found. redirecting...\");\n //res.redirect('/auth/tumblr');\n res.send(false);\n } else if (req._passport.session.user.isGeneric) {\n console.log(\"Logging out generic user and sending to login.\");\n req.logout();\n res.send(false);\n }else {\n\t\tres.send(true);\n }\n}", "function resErrHandler(data){\n // Check for unauthorized access\n if (data.status == 401) {\n // redirect user on Login Page\n window.location.href = \"login.html?error=UNAUTH_ACCESS\";\n }else{\n console.log(data);\n }\n}", "function restrict(req, res, next) {\n if (req.session.user) {\n next();\n } else {\n req.session.error = 'Access denied!';\n res.redirect('/login');\n }\n}", "function checkSession (redirect = '/login') {\n\treturn (req, res, next) => {\n // if successful transfer to next middleware\n if (req.isAuthenticated())\n return next();\n\n // if not successful redirect and kill chain\n res.redirect(redirect)\n\t}\n}", "function removeLoginSession() {\n //clean up the userID from the localStorage to show the login screen.\n localStorage.removeItem('userID');\n\n var auth2 = gapi.auth2.getAuthInstance();\n if (auth2.isSignedIn.Ab == true) {\n auth2.signOut().then(function () {\n console.log('Rich Chat: User signed out.');\n location.reload();\n });\n } else {\n location.reload();\n }\n}", "function checkNotAuthenticated(req, res, next) {\n\tif (req.isAuthenticated()) {\n\t\treturn next();\n\t}\n\n\treq.flash('error_msg', 'Log in to view your dashboard');\n\tres.redirect('/users/login');\n}", "function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n req.session.error = 'Please sign in!';\n res.redirect('/signin');\n}", "function redirectIfUnauthenticated(req, res, next) {\n if (auth.isAuthenticated(req)) {\n next();\n }\n else if (req.query.play_as_guest) {\n res.redirect('/guest_login?next=' + req.originalUrl);\n }\n else {\n auth.ensureAuthenticated(req, res, next, 'You must log in before you can play!');\n }\n}", "handleSignIn(e) {\n e.preventDefault();\n //generates an auth request and redirects the user to the blockstack Browser\n //to approve the sign in request\n userSession.redirectToSignIn();\n }", "function ensureAuthenticated (req, res, next) {\n if (req.isAuthenticated()) { return next() }\n req.session.returnTo = req.path\n res.redirect('/auth/twitchtv')\n}", "function cleanupAuthState() {\n dispatch({ type: LOADING_ENDED });\n }", "function fail(req, res){\n\tres.send('https://zl15finalfrontend.herokuapp.com/#/Login')\n}", "function CATSessionTimedOut()\n {\n $('#bsSessionTimedOutDialog').modal('show');\n $('#bsSessionToFE').unbind('click').on('click',function(e) {\n e.preventDefault();\n window.location.replace(CAT_URL); // also removes history\n });\n $('button#bsSessionLogin').unbind('click').on('click',function(e) {\n $('div#login-error').text('').hide(); // make sure there is no old error\n var ufield = $('input.form-control.u').prop('id');\n var pfield = $('input.form-control.p').prop('id');\n var dates = {\n 'username_fieldname': $('input.form-control.u').prop('id'),\n 'password_fieldname': $('input.form-control.p').prop('id'),\n };\n dates[ufield] = $('input.form-control.u').val();\n dates[pfield] = $('input.form-control.p').val();\n $.ajax({\n type : 'POST',\n url : CAT_ADMIN_URL+'/authenticate',\n dataType: 'json',\n data : dates,\n success : function(data, status) {\n if(data.success === false)\n {\n $('div#login-error').text(data.message).show();\n }\n else\n {\n $('#bsSessionTimedOutDialog').modal('hide');\n // reset session timer\n CATSessionSetTimer(sess_time,CATSessionTimedOut,'span#sesstime','sesstimealert');\n }\n }\n });\n e.preventDefault();\n });\n }", "function check_session(req,res,next){\n if(req.session.user)\n next();\n else\n res.status(401).json({code:401});\n}", "NoSessionStateCallback() {\n console.log(\"NoSessionStateCallback entered\");\n ClearSuperGlobals();\n // Show login window\n app.ShowLoginModal();\n }", "function checkUserAuth(req, res, next) {\n if (req.session.isUserAuth) {\n return next();\n } else {\n return res.status(403).redirect('/');\n }\n}", "prepareReauthenticate() {\n localStorage.removeItem('authToken');\n }", "checkSession ({dispatch, state}) {\n state.apiUrl = storeConfig.apiUrl\n\n //logout, force login\n if (state.logout) {\n return true\n }\n //no token, force login\n if (localStorage.getItem(\"token\") === null) {\n return true\n } else {\n dispatch('accountInfo').then((res) => {\n //if no proper response then \"log out\" and force new login\n if (res !== true) {\n localStorage.removeItem(\"token\");\n return true\n }\n })\n dispatch('walletInfo')\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}", "checkForToken() {\n let hash = this.props.location.hash || this.props.location.search;\n if (hash === \"\") return;\n\n const params = this.getParams(hash);\n if (params.access_token) this.attemptSignIn(params.access_token);\n if (params.error) {\n this.props.history.push(\"/\");\n }\n }", "function authLogoutSuccess() {\n\t\tsetAuthCookie(undefined, -1)\n\t\treturn location.reload(true);\n\t}", "function authenticationSuccessful(req, res) {\n if (req.body.remember) {\n // If remember-me was checked, set a max age for the session\n req.session.cookie.maxAge = config.web.sessionMaxAge;\n } else {\n // Else, session expires when closing the browser\n req.session.cookie.maxAge = null;\n }\n\n if (req.body['next-url']) {\n res.redirect(req.body['next-url']);\n } else {\n res.redirect('/secure/home');\n }\n}", "async function handleSession() {\n const sessionData = localStorage.getItem(\"mdb_session\");\n\n if (!sessionData) {\n const newSessionData = await getGuestSession();\n\n if (newSessionData) {\n const sessionDataString = JSON.stringify(newSessionData);\n\n localStorage.setItem(\"mdb_session\", sessionDataString);\n showToastBanner();\n return true;\n }\n\n return false;\n } else {\n const parsedSessionData = JSON.parse(sessionData);\n\n if (isSessionExpired(parsedSessionData.expires_at)) {\n localStorage.removeItem(\"mdb_session\");\n await handleSession();\n return true;\n }\n }\n}", "function checkUnauthorized(res) {\n if(res.status === 401) {\n document.location.href = '/login';\n console.log(\"Currently unauthorized, please login!\");\n deleteUserToken();\n \n return true;\n }else {\n return false;\n }\n}", "function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n req.session.error = 'Please sign in!';\n res.redirect('/');\n}", "function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n req.session.error = 'Please sign in!';\n res.redirect('/');\n}", "function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n req.session.error = 'Please sign in!';\n res.redirect('/signin');\n}", "function defaultLoginFail(req, res, fail) {\n if (fail === undefined) {\n res.clearCookie('u');\n res.clearCookie('h');\n res.redirect('/login');\n } else {\n fail();\n }\n}", "function checkNotLogin(req,res,next){\n\tconsole.log('check for not login');\n\tif(req.session.user){\n\t\tconsole.log('redirect to index');\n\t\treturn res.redirect('/');\n\t}\n\tnext();\n}", "function checkAuth(req, res, next) {\n if (!req.session.user) {\n res.sendStatus(401)\n }\n else {\n next()\n }\n}", "function requireLogin(req, res, next) {\n console.log(\"This route requries login!\");\n if (req.session && req.session.userId) {\n return next();\n } else {\n var err = new Error('You must be authorized to view this page.');\n err.status = 401;\n return next(err);\n }\n }", "function validateAuthentication(req, res, next) {\n\tnext(); //continue processing the request\n}", "sessionAuthenticated() {\n const nextURL = this.session.data.nextURL;\n this.session.set(\"data.nextURL\", undefined);\n const idToken = this.session.data.authenticated.id_token;\n this.session.set(\"data.id_token_prev\", idToken);\n\n if (nextURL) {\n this.replaceWith(nextURL);\n } else {\n this._super();\n }\n }", "function ensureLogin(req, res, next) {\n if (!req.session.user) {\n res.redirect(\"/login\");\n } else {\n next();\n }\n}", "closeSession() {\n // Clear all local tokens\n this.tokenManager.clear();\n return this.session.close() // DELETE /api/v1/sessions/me\n .catch(function (e) {\n if (e.name === 'AuthApiError' && e.errorCode === 'E0000007') {\n // Session does not exist or has already been closed\n return null;\n }\n\n throw e;\n });\n }", "function sessionTimeoutHandler() {\r\n PF('pageExpiredDialog').show();\r\n}" ]
[ "0.64195216", "0.6397031", "0.6393355", "0.631766", "0.6306464", "0.626547", "0.6236522", "0.62076956", "0.6199399", "0.61959356", "0.614851", "0.6135205", "0.61322796", "0.6127965", "0.61026806", "0.60913616", "0.6071165", "0.60692495", "0.60609317", "0.6057303", "0.60517454", "0.60471964", "0.6045011", "0.60414654", "0.602835", "0.6023078", "0.6019132", "0.6016933", "0.60142356", "0.6012922", "0.6009057", "0.5994126", "0.5986112", "0.5982194", "0.59767985", "0.5967889", "0.5965741", "0.5945921", "0.59449047", "0.5930753", "0.5926255", "0.5921384", "0.5920049", "0.59174", "0.5916811", "0.5893101", "0.58764935", "0.5875454", "0.5874223", "0.5873759", "0.5871534", "0.58703953", "0.5867932", "0.586746", "0.5859982", "0.5857734", "0.5854254", "0.5851441", "0.5849042", "0.5848314", "0.5832239", "0.5831425", "0.5827962", "0.58247113", "0.5818687", "0.5816674", "0.5807896", "0.58062285", "0.5804388", "0.5797307", "0.5797013", "0.57917315", "0.57865596", "0.57816076", "0.5779498", "0.5778581", "0.5775339", "0.577206", "0.57703", "0.57626736", "0.5753737", "0.57507616", "0.5741789", "0.5737283", "0.5735315", "0.5723374", "0.5719137", "0.57165986", "0.57150966", "0.57150966", "0.5713167", "0.5706737", "0.5704069", "0.5701578", "0.56871426", "0.5686811", "0.56814533", "0.56781185", "0.56686026", "0.5657966" ]
0.77617174
0
Removes the physics body colliders from the sprite but not overlap sensors.
removeColliders() { this._collides = {}; this._colliding = {}; this._collided = {}; this._removeFixtures(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onRemoveFromWorld() {\n //game.physicsEngine.world.removeBody(this.physicsObj);\n }", "function removeOutOfBoundObj() {\n gameState.enemies.getChildren().forEach(enemy => {\n if (enemy.x > config.width + HALF_OBJ_PIXEL || enemy.x < -HALF_OBJ_PIXEL) {\n gameState.enemies.remove(enemy);\n }\n });\n gameState.platformsEven.getChildren().forEach(platform => {\n if (platform.x > config.width + HALF_OBJ_PIXEL * 2 || platform.x < -HALF_OBJ_PIXEL * 2) {\n gameState.platformsEven.remove(platform);\n }\n });\n gameState.platformsOdd.getChildren().forEach(platform => {\n if (platform.x > config.width + HALF_OBJ_PIXEL * 2 || platform.x < -HALF_OBJ_PIXEL * 2) {\n gameState.platformsOdd.remove(platform);\n }\n });\n}", "removeSensors() {\r\n\t\t\tthis._overlap = {};\r\n\t\t\tthis._overlaps = {};\r\n\t\t\tthis._overlapping = {};\r\n\t\t\tthis._overlapped = {};\r\n\t\t\tthis._removeFixtures(true);\r\n\t\t}", "disableColliders(){\n this.colliderShapes.forEach((e)=>{\n e.setEnabled(false);\n });\n }", "ClearCollider() {\n if (this.COLLIDER == undefined) return;\n \n this.COLLIDER.Disable();\n this.COLLIDER = undefined;\n \n return this;\n }", "removeCollider(obj) {\n let i = this.colliders.indexOf(obj);\n if (i === -1) {\n console.error('Collider not found: ', obj);\n } else {\n this.colliders.splice(i, 1);\n }\n }", "_cleanOldCollisions() {\n for (const guid in this.collisions) {\n if (this.collisions.hasOwnProperty(guid)) {\n const frameCollision = this.frameCollisions[guid];\n const collision = this.collisions[guid];\n const entity = collision.entity;\n const entityCollision = entity.collision;\n const entityRigidbody = entity.rigidbody;\n const others = collision.others;\n const length = others.length;\n let i = length;\n while (i--) {\n const other = others[i];\n // if the contact does not exist in the current frame collisions then fire event\n if (!frameCollision || frameCollision.others.indexOf(other) < 0) {\n // remove from others list\n others.splice(i, 1);\n\n if (entity.trigger) {\n // handle a trigger entity\n if (entityCollision) {\n entityCollision.fire('triggerleave', other);\n }\n if (other.rigidbody) {\n other.rigidbody.fire('triggerleave', entity);\n }\n } else if (!other.trigger) {\n // suppress events if the other entity is a trigger\n if (entityRigidbody) {\n entityRigidbody.fire('collisionend', other);\n }\n if (entityCollision) {\n entityCollision.fire('collisionend', other);\n }\n }\n }\n }\n\n if (others.length === 0) {\n delete this.collisions[guid];\n }\n }\n }\n }", "removeBody(){\n\t\tlet length = this.body.length;\n\t\tfor (let i=length; i > 0; i--){\n \tthis.body.x.pop();\n \tthis.body.y.pop();\n\n \tlet snakeBody = document.querySelector('.snake_body');\n \tsnakeBody.parentNode.removeChild(snakeBody); \n \t}\n \tthis.body.length = 0;\n\t}", "clear() {\n const game = this.game;\n const world = game.world;\n const container = game.pixiAdapter.container;\n\n // Remove p2 constraints from the world\n for (let i = 0; i < this.constraints.length; i++) {\n world.removeConstraint(this.constraints[i]);\n }\n\n // Remove p2 bodies from the world and Pixi Containers from the stage\n for (let i = 0; i < this.bodies.length; i++) {\n world.removeBody(this.bodies[i]);\n container.removeChild(this.containers[i]);\n }\n }", "function removeFall_updateSpring() {\n\t\t//Remove all rects of fall 17\n\t\td3.selectAll('.f17Histogram').remove();\n\n\t\tupdateSpring();\n\t}", "destroy() {\n if (this.world !== undefined) {\n this.car.getComponent('car').fitness = 0\n this.car.getComponent('car').frontWheel.steerValue = 0\n let body = this.car.getComponent('physics').body\n fillNaN(body, 0.0)\n body.allowSleep = false\n if (body.sleepState === p2.Body.SLEEPING) {\n body.wakeUp()\n }\n body.setZeroForce()\n body.position = [this.position[0], this.position[1]]\n body.angularVelocity = 0\n body.velocity = [0, 0]\n body.angle = 0\n this.roadDirector.reset()\n } else {\n this.position = [400, 400]\n this.velocity = [0, 0]\n }\n }", "removeSprites() {\n\t\t\t\t// prevent rebuilding the quadTree multiple times\n\t\t\t\tthis.p.quadTree.rebuildOnRemove = false;\n\t\t\t\twhile (this.length > 0) {\n\t\t\t\t\tthis[0].remove();\n\t\t\t\t}\n\t\t\t\tthis.p.quadTree.rebuildOnRemove = true;\n\n\t\t\t\tthis.p.allSprites._rebuildQuadtree();\n\t\t\t}", "function removeSpring_updateFall() {\n\t\t//remove all rects of spring 18\n\t\td3.selectAll('.s18Histogram').remove();\n\n\t\tupdateFall();\n\t}", "function mushroomCollide(){\n var mushcollide = $('.collider').collision('.mushroom');\n if(mushcollide[0]){ \n console.log('boo')\n // $('#container').append('<div class = \"game-over\"></div>')\n $('.bananas').remove();\n // $('.mushroom').remove();\n clearInterval(makingInterval);\n clearInterval(bananaMover);\n clearInterval(mushroomMover);\n }\n }", "collision(collidedBody, activeTrigger){\n //player.body.position.y < enemy.body.position.y - 20\n //enemy is under the collidedBody and it is player\n if(toYGrid(this.body.position.y) > toYGrid(collidedBody.position.y) \n && collidedBody.collisionFilter.category == playerCategory){\n this.hp -= 1;\n if(this.hp == 0)\n removeObject(this);\n }\n else if(toYGrid(collidedBody.position.y) == toYGrid(this.body.position.y)){\n this.preForce.x = -1 * this.preForce.x;\n }\n }", "function destroyBrick(){\n for(var i=0;i<bricks.length;i++){\n if(checkCollision(ball,bricks[i])){\n ball.speedY = -ball.speedY;\n createBonus(bricks[i]);\n bricks.splice(i,1);\n }\n }\n }", "ClearForces() {\n for (let body = this.m_bodyList; body; body = body.m_next) {\n body.m_force.SetZero();\n body.m_torque = 0;\n }\n }", "bulletCollision(allBullets) {\n let index = allBullets.indexOf(this);\n allBullets.splice(index, 1);\n }", "removeSprite(body) {\n const index = this.spriteList.findIndex(s => s.id === body.id)\n this.spriteList.splice(index, 1)\n body.sprite.destroy()\n try {\n body.stopWork()\n } catch (e) {\n console.log(body + 'dont have stopwork fn')\n }\n }", "clear() {\n let toRemove = [];\n for (let i = 0; i < this.scene.children.length; i++) {\n let obj = this.scene.children[i];\n if (obj.userData && obj.userData.isBodyElement) {\n toRemove.push(obj);\n }\n }\n for (let i = 0; i < toRemove.length; i++) {\n this.remove(toRemove[i]);\n }\n }", "clearBullets() {\n this.bullets = this.bullets.filter(\n (bullets) => bullets.collidedNegative === false\n );\n this.bullets = this.bullets.filter(\n (bull) => bull.posY > -16.6 && bull.posY <= this.gameHeight\n );\n }", "update() {\n // Se actualiza la posición de la cámara según su controlador\n this.world.update();\n this.ship.update();\n\n // Control de colisiones\n for (var i = 0; i < this.colliders.length; i++)\n this.colliders[i].update();\n\n this.colliderSystem.computeAndNotify(this.colliders);\n\n\n }", "_resizeCollider(scale) {\r\n\t\t\tif (!this.body) return;\r\n\r\n\t\t\tif (typeof scale == 'number') {\r\n\t\t\t\tscale = { x: scale, y: scale };\r\n\t\t\t} else {\r\n\t\t\t\tif (!scale.x) scale.x = 1;\r\n\t\t\t\tif (!scale.y) scale.y = 1;\r\n\t\t\t}\r\n\t\t\tif (this.shape == 'circle') {\r\n\t\t\t\tlet fxt = this.fixture;\r\n\t\t\t\tlet sh = fxt.m_shape;\r\n\t\t\t\tsh.m_radius *= scale.x;\r\n\t\t\t} else {\r\n\t\t\t\t// let bodyProps = this._cloneBodyProps();\r\n\t\t\t\t// this.removeColliders();\r\n\t\t\t\t// this.addCollider();\r\n\t\t\t\t// for (let prop in bodyProps) {\r\n\t\t\t\t// \tthis[prop] = bodyProps[prop];\r\n\t\t\t\t// }\r\n\r\n\t\t\t\tfor (let fxt = this.fixtureList; fxt; fxt = fxt.getNext()) {\r\n\t\t\t\t\tif (fxt.m_isSensor) continue;\r\n\t\t\t\t\tlet sh = fxt.m_shape;\r\n\t\t\t\t\tfor (let vert of sh.m_vertices) {\r\n\t\t\t\t\t\tvert.x *= scale.x;\r\n\t\t\t\t\t\tvert.y *= scale.y;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "removeAllParticles() {\n let i = this.particles.length;\n\n while (i--) {\n this.particles[i].dead = true;\n }\n }", "function Start () {\n\tfor (var component : Behaviour in componentsToDisable){\n\t\tcomponent.enabled = false;\n\t}\n\tif (gameObject.collider != null){\n\t\tcollider.enabled = false;\n\t}\n}", "removeEntitiesWithoutBodyFromAll(){\n this.removeEntitiesWithoutBodyAndSpriteAndToRemoveFrom(this.bulletEntitiesList);\n this.removeEntitiesWithoutBodyAndSpriteAndToRemoveFrom(this.playerEntitiesList);\n this.removeEntitiesWithoutBodyAndSpriteAndToRemoveFrom(this.enemyEntitiesList);\n this.removeEntitiesWithoutBodyAndSpriteAndToRemoveFrom(this.floorEntitiesList);\n this.removeEntitiesWithoutBodyAndSpriteAndToRemoveFrom(this.floorWTreeEntitiesList);\n this.removeEntitiesWithoutBodyAndSpriteAndToRemoveFrom(this.bigBrickEntitiesList);\n this.removeEntitiesWithoutBodyAndSpriteAndToRemoveFrom(this.coinEntitiesList);\n }", "clear() {\n if (this.score >= 50) {\n this.score -= 50;\n this.update_score();\n let sprite = app.stage.getChildAt(0);\n this.meteors.forEach(element => app.stage.removeChild(element));\n this.meteors.clear;\n }\n }", "function ceilingCollisions(){\n\tif(bird.y <= -world.dim.center+(bird.height/2)){\n\t\tbird.vel = 0;\n\t\tbird.y = -world.dim.center+(bird.height/2);\n\t}\n}", "onCollision() {\n // do something when collected\n\n // play a \"coin collected\" sound\n me.audio.play(\"cling\");\n\n // give some score\n game.data.score += 50;\n\n // make sure it cannot be collected \"again\"\n this.body.setCollisionMask(me.collision.types.NO_OBJECT);\n\n // remove it\n me.game.world.removeChild(this);\n }", "function gameLogic(){\r\n for (let i in randomObjects){\r\n if(collide(randomObjects[i], playerBall)){\r\n //playerBall.remove();\r\n randomObjects[i].remove();\r\n randomObjects.splice(i, 1);\r\n }\r\n }\r\n}", "bounce() {\r\n if (this.y + this.h / 2 >= screenHeight - screenHeight / 15) {\r\n this.remove();\r\n }\r\n }", "destroySlider() {\n // remove event listeners\n\n // mouse events\n window.removeEventListener(\"mousemove\", this.onMouseMove, {\n passive: true,\n });\n window.removeEventListener(\"mousedown\", this.onMouseDown);\n window.removeEventListener(\"mouseup\", this.onMouseUp);\n\n // touch events\n window.removeEventListener(\"touchmove\", this.onMouseMove, {\n passive: true,\n });\n window.removeEventListener(\"touchstart\", this.onMouseDown, {\n passive: true,\n });\n window.removeEventListener(\"touchend\", this.onMouseUp);\n\n // resize event\n window.removeEventListener(\"resize\", this.onResize);\n\n // cancel request animation frame\n cancelAnimationFrame(this.animationFrame);\n }", "remove() {\r\n\t\t\tif (this.body) this.p.world.destroyBody(this.body);\r\n\t\t\tthis.removed = true;\r\n\r\n\t\t\t//when removed from the \"scene\" also remove all the references in all the groups\r\n\t\t\twhile (this.groups.length > 0) {\r\n\t\t\t\tthis.groups[0].remove(this);\r\n\t\t\t}\r\n\t\t}", "reset()\n {\n for(var i = 0; i < this.trucks.length; i++)\n {\n gameNs.game.collisionManager.removePolygonCollider(this.trucks[i].collider);\n gameNs.game.collisionManager.removePolygonCollider(this.trucks[i].colliderBigLeft);\n gameNs.game.collisionManager.removePolygonCollider(this.trucks[i].colliderBigRight);\n\n }\n this.trucks = [];\n for(var i = 0; i < this.motorcycles.length; i++)\n {\n gameNs.game.collisionManager.removePolygonCollider(this.motorcycles[i].collider);\n gameNs.game.collisionManager.removePolygonCollider(this.motorcycles[i].colliderBigLeft);\n gameNs.game.collisionManager.removePolygonCollider(this.motorcycles[i].colliderBigRight);\n\n }\n this.motorcycles = [];\n for(var i = 0; i < this.spikeCars.length; i++)\n {\n gameNs.game.collisionManager.removePolygonCollider(this.spikeCars[i].colliderSpikeLeft);\n gameNs.game.collisionManager.removePolygonCollider(this.spikeCars[i].colliderSpikeRight);\n gameNs.game.collisionManager.removePolygonCollider(this.spikeCars[i].collider);\n gameNs.game.collisionManager.removePolygonCollider(this.spikeCars[i].colliderBigRight);\n gameNs.game.collisionManager.removePolygonCollider(this.spikeCars[i].colliderBigLeft);\n\n }\n this.spikeCars = [];\n if(this.helicopter.length === 1)\n {\n gameNs.game.collisionManager.removePolygonCollider(this.helicopter[0].collider);\n this.helicopter = [];\n }\n this.helicopterSpawnTicks = 0;\n for(var i = 0; i < this.powerTrucks.length; i++)\n {\n gameNs.game.collisionManager.removePolygonCollider(this.powerTrucks[i].collider);\n gameNs.game.collisionManager.removePolygonCollider(this.powerTrucks[i].colliderBigLeft);\n gameNs.game.collisionManager.removePolygonCollider(this.powerTrucks[i].colliderBigRight);\n gameNs.game.collisionManager.removePolygonCollider(this.powerTrucks[i].colliderTruck);\n }\n this.powerTrucks = [];\n for(var i = 0; i < this.respawnTrucks.length; i++)\n {\n gameNs.game.collisionManager.removePolygonCollider(this.respawnTrucks[i].collider);\n gameNs.game.collisionManager.removePolygonCollider(this.respawnTrucks[i].truckBig);\n }\n this.respawnTrucks = [];\n this.respawnTrucks.push(new RespawnTruck(400,1000));\n }", "function obstacleController() {\r\n if (!isGameEnded && isStarted) {\r\n // first loop\r\n obstacles.forEach(function(item){\r\n if(item) {\r\n var pos = item.position;\r\n if (pos.z > 100) {\r\n // don't move object\r\n pos.z = 500;\r\n } else {\r\n pos.z += 2*movementUnit;\r\n }\r\n }\r\n });\r\n obstacles = obstacles.filter(function(item) {\r\n if(item.position.z >= 500) {\r\n scene.remove(item);\r\n return false;\r\n } else {\r\n return item.position.z < 500;\r\n }\r\n });\r\n detectCollsion();\r\n }\r\n}", "function clearSprites(){\n\t\tfor (var i = sprites.length - 1; i >= 0; i--) {\n\t\t\tsceneOrtho.remove(sprites[i]);\n\t\t};\n\t\tsprites=[];\n\t}", "onCollision(response, other) {\n if (response.b.body.collisionType !== me.collision.types.WORLD_SHAPE) {\n // res.y >0 means touched by something on the bottom\n // which mean at top position for this one\n if (this.alive && (response.overlapV.y > 0) && response.a.body.falling) {\n this.flicker(750, () => {\n me.game.world.removeChild(this);\n });\n }\n return false;\n }\n // Make all other objects solid\n return true;\n }", "enableColliders(){\n this.colliderShapes.forEach((e)=>{\n e.setEnabled(true);\n });\n }", "updateFriction() {\n\t\t// kill lateral velocity\n\t\tvar impulse = this.getLateralVelocity().mul(-this.body.getMass())\n\t\t// if (impulse.length() > carConfig.maxLateralImpulse)\n\t\t// impulse.mul(carConfig.maxLateralImpulse / impulse.length())\n\t\tthis.body.applyLinearImpulse(impulse, this.body.getWorldCenter())\n\n\t\t// kill angular velocity\n\t\tthis.body.applyAngularImpulse(.1 * this.body.getInertia() * -this.body.getAngularVelocity())\n\n\t\t// apply drag\n\t\tvar forwardNormal = this.getForwardVelocity()\n\t\tvar forwardSpeed = forwardNormal.normalize()\n\t\tvar dragMagnitude = -2 * forwardSpeed\n\t\tthis.body.applyForce(forwardNormal.mul(dragMagnitude), this.body.getWorldCenter())\n\t}", "function Start () {\n\t\n // Turn off the left C's mesh collider\n\tc2Left.GetComponent.<MeshCollider>().enabled = false;\n\tc3Left.GetComponent.<MeshCollider>().enabled = false;\n\tc4Left.GetComponent.<MeshCollider>().enabled = false;\n\tc5Left.GetComponent.<MeshCollider>().enabled = false;\n\tc6Left.GetComponent.<MeshCollider>().enabled = false;\n\tc7Left.GetComponent.<MeshCollider>().enabled = false;\n\tc8Left.GetComponent.<MeshCollider>().enabled = false;\n\t\n // Turn off the right C's mesh collider\n\tc2Right.GetComponent.<MeshCollider>().enabled = false;\n\tc3Right.GetComponent.<MeshCollider>().enabled = false;\n\tc4Right.GetComponent.<MeshCollider>().enabled = false;\n\tc5Right.GetComponent.<MeshCollider>().enabled = false;\n\tc6Right.GetComponent.<MeshCollider>().enabled = false;\n\tc7Right.GetComponent.<MeshCollider>().enabled = false;\n\tc8Right.GetComponent.<MeshCollider>().enabled = false;\n\t\n\t// Turn off the halos\n\tclickedSpotHalo.enabled = false;\n\tclickedSpotHalo2.enabled = false;\n\tclickedSpotHalo3.enabled = false;\n\t\n // Turn off the left C's light\n\tc2Left.GetComponent.<Light>().enabled = false;\n\tc3Left.GetComponent.<Light>().enabled = false;\n\tc4Left.GetComponent.<Light>().enabled = false;\n\tc5Left.GetComponent.<Light>().enabled = false;\n\tc6Left.GetComponent.<Light>().enabled = false;\n\tc7Left.GetComponent.<Light>().enabled = false;\n\t\n // Turn off the right C's light\n\tc2Right.GetComponent.<Light>().enabled = false;\n\tc3Right.GetComponent.<Light>().enabled = false;\n\tc4Right.GetComponent.<Light>().enabled = false;\n\tc5Right.GetComponent.<Light>().enabled = false;\n\tc6Right.GetComponent.<Light>().enabled = false;\n\tc7Right.GetComponent.<Light>().enabled = false;\n\t\t\n\t\t\n}", "function addRemoveCollisions(isEnabled) {\n // draw debug circles on the joints\n var flowSettings = GlobalDebugger.getDisplayData();\n\n // the state of flow is the opposite of what we want\n if (flowSettings.collisions !== isEnabled) {\n GlobalDebugger.toggleCollisions();\n dynamicData[STRING_FLOW].enableCollisions = isEnabled;\n }\n }", "removeAllParticles () {\r\n\t\tthis.particles = [];\r\n\t}", "_removeFixtures(isSensor) {\r\n\t\t\tlet prevFxt;\r\n\t\t\tfor (let fxt = this.fixtureList; fxt; fxt = fxt.getNext()) {\r\n\t\t\t\tif (fxt.m_isSensor == isSensor) {\r\n\t\t\t\t\tlet _fxt = fxt.m_next;\r\n\t\t\t\t\tfxt.destroyProxies(this.p.world.m_broadPhase);\r\n\t\t\t\t\tif (!prevFxt) {\r\n\t\t\t\t\t\tthis.body.m_fixtureList = _fxt;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tprevFxt.m_next = _fxt;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tprevFxt = fxt;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "function Reset ()\n{\n\tif (collider == null)\n\t\tgameObject.AddComponent(BoxCollider);\n\tcollider.isTrigger = true;\n}", "function removeWalls(a,b) {\r\n let x = a.i - b.i;\r\n if(x === 1){\r\n a.walls[3] = false;\r\n b.walls[1] = false;\r\n } else if (x === -1) {\r\n a.walls[1] = false;\r\n b.walls[3] = false;\r\n }\r\n let y = a.j -b.j;\r\n if(y === 1){\r\n a.walls[0] = false;\r\n b.walls[2] = false;\r\n } else if (y === -1) {\r\n a.walls[2] = false;\r\n b.walls[0] = false;\r\n }\r\n}", "set enabled(v) {\n if (v) {\n if (this.index < 0) {\n this.index = this.wrappedWorld.bodies.length;\n this.wrappedWorld.addSharedBody(this);\n this.syncInitial();\n }\n } else {\n if (this.index >= 0) {\n const isRemove = this.shapes.length == 0 && this.wrappedBody == null || this.shapes.length == 0 && this.wrappedBody != null && !this.wrappedBody.isEnabled;\n\n if (isRemove) {\n this.body.sleep(); // clear velocity etc.\n\n this.index = -1;\n this.wrappedWorld.removeSharedBody(this);\n }\n }\n }\n }", "collisionDetection() {\n if (\n collideRectRect(sliderX,sliderY,30,height,this.x,this.y,this.r,this.r * 2) && sliderSpeed >= 0) {\n this.color = random(160);\n }\n if (collideRectRect(sliderX, sliderY, 30, height, this.x, this.y, this.r, this.r * 2) && sliderSpeed < 0) {\n this.color = random(360);\n }\n }", "collision() {\n\t\tthis.vars.collision = true;\n\t}", "remove() {\n\t\t\t\tthis.removed = true;\n\n\t\t\t\t//when removed from the \"scene\" also remove all the references in all the groups\n\t\t\t\twhile (this.groups.length > 0) {\n\t\t\t\t\tthis.groups[0].remove(this);\n\t\t\t\t}\n\n\t\t\t\t// clear and rebuild the quadTree\n\t\t\t\tif (this.p.quadTree.rebuildOnRemove) {\n\t\t\t\t\tthis.p.allSprites._rebuildQuadtree();\n\t\t\t\t}\n\t\t\t}", "function removeWalls(a, b) {\r\n var x = a.i - b.i;\r\n var y = a.j - b.j;\r\n if (x === -1) {\r\n a.walls[1] = false;\r\n b.walls[3] = false;\r\n } else if (y === 1) {\r\n a.walls[0] = false;\r\n b.walls[2] = false;\r\n } else if (x === 1) {\r\n a.walls[3] = false;\r\n b.walls[1] = false;\r\n } else if (y === -1) {\r\n a.walls[2] = false;\r\n b.walls[0] = false;\r\n }\r\n}", "function destroyDetailSliders()\n\t{\n\t\t$detailTopSlider.slick('unslick');\n\t\t$detailBottomSlider.slick('unslick');\n\t\tdetailSlidersInitialized = !detailSlidersInitialized;\n\t}", "cleanUp()\n {\n // Remove the contact listener\n this.physicsWorld.world.off( 'begin-contact', this.beginContact.bind(this) );\n this.physicsWorld.world.off( 'end-contact', this.endContact.bind(this) );\n this.physicsWorld.world.off( 'remove-fixture', this.removeFixture.bind(this) );\n \n unload();\n }", "function createCollisionDetector() {\n\tvar listener = new b2ContactListener();\n\n\tlistener.BeginContact = function(contact){\n\t var bodyA = contact.GetFixtureA().GetBody();\n var bodyB = contact.GetFixtureB().GetBody();\n var ropeBody = null;\n // console.log('begin contact');\n if (bodyA.GetUserData() && bodyB.GetUserData()) {\n if (bodyA.GetUserData().rope) {\n ropeBody = bodyA;\n }\n if (bodyB.GetUserData().rope) {\n ropeBody = bodyB;\n }\n if (ropeBody && bodyA.GetUserData().bodyId){\n if (bodyA.GetLinearVelocity().x != 0.0){\n // bodyA.m_fixtureList.m_isSensor = true;\n }\n }else if (ropeBody && bodyB.GetUserData().bodyId){\n if (bodyB.GetLinearVelocity().x != 0.0){\n // bodyB.m_fixtureList.m_isSensor = true;\n }\n }\n //===Check collision between barrier and striker\n if((bodyA.GetUserData().barrier && bodyB.GetUserData().bodyId) || (bodyA.GetUserData().bodyId && bodyB.GetUserData().barrier)){\n if(bodyA.GetUserData().bodyId){\n bodyA.m_fixtureList.m_isSensor = false;\n }else {\n bodyB.m_fixtureList.m_isSensor = false;\n }\n }\n }\n\t}\n listener.PreSolve = function(contact,oldManifold) {\n }\n\tlistener.PostSolve = function(contact, impulse){\n\t}\n\tlistener.EndContact = function(contact){\n var bodyA = contact.GetFixtureA().GetBody();\n var bodyB = contact.GetFixtureB().GetBody();\n var ropeBody = null;\n // console.log('begin contact');\n if (bodyA.GetUserData() && bodyB.GetUserData()) {\n if (bodyA.GetUserData().rope) {\n ropeBody = bodyA;\n }\n if (bodyB.GetUserData().rope) {\n ropeBody = bodyB;\n }\n if (ropeBody && bodyA.GetUserData().bodyId){\n bodyA.m_fixtureList.m_isSensor = false;\n // console.log('m_isSensor = false');\n }else if (ropeBody && bodyB.GetUserData().bodyId){\n bodyB.m_fixtureList.m_isSensor = false;\n // console.log('m_isSensor = false');\n }\n }\n\t}\n\n\treturn listener;\n}", "removeAxes(){\n if(this.axes == null){\n return;\n }\n\n var object = this.scene.getObjectById(this.axes.id);\n\n if(object != null){\n this.scene.remove(object);\n this.axes = null\n }\n }", "removeFromScene(scene, isUpdating) {\n this.objects.forEach((obj) => {\n scene.remove(obj, true);\n });\n if (!isUpdating) {\n scene.remove(this.cursor, true);\n }\n }", "checkParticleBoundaries(){\n const particlesToRemove = [];\n Object.keys(this.particles).forEach( (id) => {\n const particle = this.particles[id];\n // if particle is out of bounds, add to particles to remove array\n if ( particle.posX > this.canvasWidth\n || particle.posX < 0\n || particle.posY > this.canvasHeight\n || particle.posY < 0\n ) {\n particlesToRemove.push(id);\n }\n });\n\n if (particlesToRemove.length > 0){\n\n particlesToRemove.forEach((id) => {\n // We're checking if the total particles exceed the max particles.\n // If the total particles exeeds max particles, we delete the particle\n // entry in the object. Otherwise, we just create a new particle\n // and insert it into the old particle's object id. This saves us\n // a little time above with generating a new UUID or running the delete command\n if (Object.keys(this.particles).length > this.maxParticles){\n delete this.particles[id];\n } else {\n this.particles[id] = this.makeRandomParticle();\n }\n });\n }\n }", "DestroyBody(b) {\n !!B2_DEBUG && b2Assert(this.m_bodyCount > 0);\n if (this.IsLocked()) {\n throw new Error();\n }\n // Delete the attached joints.\n let je = b.m_jointList;\n while (je) {\n const je0 = je;\n je = je.next;\n if (this.m_destructionListener) {\n this.m_destructionListener.SayGoodbyeJoint(je0.joint);\n }\n this.DestroyJoint(je0.joint);\n b.m_jointList = je;\n }\n b.m_jointList = null;\n if (B2_ENABLE_CONTROLLER) {\n // @see b2Controller list\n let coe = b.m_controllerList;\n while (coe) {\n const coe0 = coe;\n coe = coe.nextController;\n coe0.controller.RemoveBody(b);\n }\n }\n // Delete the attached contacts.\n let ce = b.m_contactList;\n while (ce) {\n const ce0 = ce;\n ce = ce.next;\n this.m_contactManager.Destroy(ce0.contact);\n }\n b.m_contactList = null;\n // Delete the attached fixtures. This destroys broad-phase proxies.\n let f = b.m_fixtureList;\n while (f) {\n const f0 = f;\n f = f.m_next;\n if (this.m_destructionListener) {\n this.m_destructionListener.SayGoodbyeFixture(f0);\n }\n f0.DestroyProxies();\n f0.Reset();\n b.m_fixtureList = f;\n b.m_fixtureCount -= 1;\n }\n b.m_fixtureList = null;\n b.m_fixtureCount = 0;\n // Remove world body list.\n if (b.m_prev) {\n b.m_prev.m_next = b.m_next;\n }\n if (b.m_next) {\n b.m_next.m_prev = b.m_prev;\n }\n if (b === this.m_bodyList) {\n this.m_bodyList = b.m_next;\n }\n --this.m_bodyCount;\n }", "collisionsSystem(scene, self) {\n \n scene.matter.world.on('collisionstart', function (event) {\n var pairs = event.pairs;\n for (var i = 0; i < pairs.length; i++) {\n\n var bodyA = pairs[i].bodyA;\n var bodyB = pairs[i].bodyB;\n\n // Ship - Planet\n if (bodyA.label === 'shipBody' && bodyB.label === 'planetBody' && Game.systemStartTime > 500) {\n self.soundThrusterTop.stop();\n self.soundThrusterBottom.stop();\n self.soundThrusterLeft.stop();\n self.soundThrusterRight.stop();\n\n Game.currentPlanet = bodyB.parent.gameObject.data.list.id;\n Game.lastSystemPosition = {\n x: bodyB.parent.gameObject.x,\n y: bodyB.parent.gameObject.y\n };\n\n // Désactive de témoin du loader de systemScene\n scene.scene.start('PlanetScene');\n\n }\n if (bodyB.label === 'shipBody' && bodyA.label === 'planetBody' && Game.systemStartTime > 500) {\n self.soundThrusterTop.stop();\n self.soundThrusterBottom.stop();\n self.soundThrusterLeft.stop();\n self.soundThrusterRight.stop();\n\n Game.currentPlanet = bodyA.parent.gameObject.data.list.id;\n Game.lastSystemPosition = {\n x: bodyA.parent.gameObject.x,\n y: bodyA.parent.gameObject.y\n };\n\n // Désactive de témoin du loader de systemScene\n scene.scene.start('PlanetScene');\n\n }\n\n // Ship - Star\n if (bodyA.label === 'shipBody' && bodyB.label === 'starBody') {\n console.log('PERDU : Ton vaisseau a cramé sur une étoile...');\n scene.scene.stop('UiScene');\n scene.scene.start('EndGameScene');\n }\n if (bodyB.label === 'shipBody' && bodyA.label === 'starBody') {\n console.log('PERDU : Ton vaisseau a cramé sur une étoile...');\n scene.scene.stop('UiScene');\n scene.scene.start('EndGameScene');\n }\n\n }\n });\n }", "function update() {\n\n for (var i = stone.length - 1; i >= 0; i--) {\n game.physics.arcade.overlap(player,stone[i], function(){\n gameSpeed = gameSpeed - 100;\n stone[i].destroy();\n stone.splice(i,1);\n });\n }\n\n for (var e = pika.length - 1; e >= 0; e--) {\n game.physics.arcade.overlap(player,pika[e], function(){\n score = score + 5;\n pika[e].destroy();\n pika.splice(i,1);\n\n });\n }\n\ngame.physics.arcade.overlap(\nplayer,\n pipes,\n gameOver);\n\n\n if (player.body.y < 0) {\n gameOver();\n }\n if(player.body.y > 400){\n gameOver();\n }\n\nplayer.rotation = Math.atan(player.body.velocity.y / gameSpeed);\n\n\n}", "updateLasers() {\n this.lasers.forEach((laser, index) => {\n if (laser.position.y <= 0 || laser.collided) {\n this.lasers.splice(index, 1);\n }\n });\n }", "deleteBody(object)\n {\n this.player.removeRaycastTarget(object.body);\n }", "function checkCollision(){\n for(var j = 0; j < balls.length; j++)\n if (balls[i].loc.x > paddle.loc.x &&\n balls[i].loc.x < paddle.width &&\n balls[i].loc.y > paddle.loc.y &&\n balls[i].loc.y < paddle.height)\n balls[i].splice(i,1)\n\n }", "deactivate()\n {\n if (!this.isActive || this.isMobileAccessabillity)\n {\n return;\n }\n\n this.isActive = false;\n\n window.document.removeEventListener('mousemove', this._onMouseMove);\n window.addEventListener('keydown', this._onKeyDown, false);\n\n this.renderer.off('postrender', this.update);\n\n if (this.div.parentNode)\n {\n this.div.parentNode.removeChild(this.div);\n }\n }", "function clearComponents(e) {\n bodyArray.splice(0, bodyArray.length);\n update();\n\n }", "addConstructSensors(x, y, type, myGlobals) {\n let rr = myGlobals.robotRadius;\n let pr = myGlobals.puckRadius;\n\n let depth = rr * 4;\n let width = rr * 10;\n //let width = rr * 4;\n let chamfer = 0;\n let leftBody = Bodies.rectangle(x + rr + 1*pr + depth/2, y - width/2 - 0*pr, depth, width, {isSensor: true, chamfer: chamfer});\n if (type == ObjectTypes.RED_PUCK) {\n this.sensors.leftRedPuck = new PuckSensor(leftBody, this, type);\n } else if (type == ObjectTypes.GREEN_PUCK) {\n this.sensors.leftGreenPuck = new PuckSensor(leftBody, this, type);\n }\n\n // The right sensor will be shifted further to the right by this amount.\n let rightShift = 0;\n let rightBody = Bodies.rectangle(x + rr + 1*pr + depth/2, y + width/2 + 0*pr + rightShift, depth, width, {isSensor: true, chamfer: chamfer});\n if (type == ObjectTypes.RED_PUCK) {\n this.sensors.rightRedPuck = new PuckSensor(rightBody, this, type);\n } else if (type == ObjectTypes.GREEN_PUCK) {\n this.sensors.rightGreenPuck = new PuckSensor(rightBody, this, type);\n }\n }", "clearScene(){\n $objs.spritesFromScene.forEach(cage => {\n $stage.scene.removeChild(cage);\n $objs.LIST[cage.dataObj._id] = void 0;\n });\n $objs.spritesFromScene = [];\n }", "function cleanupInteractiveMouseListeners() {\n document.body.removeEventListener('mouseleave', scheduleHide);\n document.removeEventListener('mousemove', debouncedOnMouseMove);\n mouseMoveListeners = mouseMoveListeners.filter(function (listener) {\n return listener !== debouncedOnMouseMove;\n });\n }", "killBody() {\n world.DestroyBody(this.body);\n }", "update() {\n var isCollided = this.physics.overlap(this.platformGroup, this.ball, this.collision, null, this);\n this.checkGameOver();\n }", "removeEventListeners() {\r\n this.elementListener.removeEventListener(\"mouseenter\", this.onMouseEnterBind);\r\n this.elementListener.removeEventListener(\"mouseleave\", this.onMouseLeaveBind);\r\n this.elementListener.removeEventListener(\"mousemove\", this.onMouseMoveBind);\r\n \r\n if (this.gyroscope) {\r\n window.removeEventListener(\"deviceorientation\", this.onDeviceOrientationBind);\r\n }\r\n \r\n if (this.glare || this.fullPageListening) {\r\n window.removeEventListener(\"resize\", this.onWindowResizeBind);\r\n }\r\n }", "RemoveInactives()\n {\n for(var i = 0; i < this.gameObjects.length; i++)\n {\n if(!this.gameObjects[i].object.active)\n {\n this.gameObjects.splice(i, 1);\n this.UpdateIndex();\n }\n }\n }", "_removeContainersInBody() {\n const that = this;\n\n if (that.dropDownAppendTo !== null && !that._minimized) {\n for (let i = 0; i < that._containersInBody.length; i++) {\n that._dropDownParent.removeChild(that._containersInBody[i]);\n }\n }\n }", "addOC2Sensors(x, y, type, myGlobals) {\n let rr = myGlobals.robotRadius;\n let pr = myGlobals.puckRadius;\n\n // The sensors will be arcs.\n\n // Body of the left sensor.\n let outerRadius = 5*rr; // 10*rr;\n let vertices = [Vector.create(0, 0)];\n let angleDelta = Math.PI / 10.0;\n for (let angle = -Math.PI/2.0; angle <= 0; angle += angleDelta) {\n let u = outerRadius * Math.cos(angle);\n let v = outerRadius * Math.sin(angle);\n\n vertices.push(Vector.create(u, v));\n }\n let leftBody = Bodies.fromVertices(x, y, vertices, {isSensor: true});\n Body.translate(leftBody, {x:outerRadius/2.0, y:-outerRadius/2.0 + outerRadius/13.0});\n\n // Make it into a puck sensor of the appropriate type.\n if (type == ObjectTypes.RED_PUCK) {\n this.sensors.leftRedPuck = new PuckSensor(leftBody, this, type);\n } else if (type == ObjectTypes.GREEN_PUCK) {\n this.sensors.leftGreenPuck = new PuckSensor(leftBody, this, type);\n }\n/*\n // Body of the right sensor.\n vertices = [Vector.create(0, 0)];\n for (let angle = 0; angle <= Math.PI/2.0; angle += angleDelta) {\n let u = outerRadius * Math.cos(angle);\n let v = outerRadius * Math.sin(angle);\n\n vertices.push(Vector.create(u, v));\n }\n let rightBody = Bodies.fromVertices(x, y, vertices, {isSensor: true});\n Body.translate(rightBody, {x:outerRadius/2.0, y:outerRadius/2.0 - outerRadius/13.0});\n\n if (type == ObjectTypes.RED_PUCK) {\n this.sensors.rightRedPuck = new PuckSensor(rightBody, this, type);\n } else if (type == ObjectTypes.GREEN_PUCK) {\n this.sensors.rightGreenPuck = new PuckSensor(rightBody, this, type);\n }\n*/\n }", "function cleanupInteractiveMouseListeners() {\n document.body.removeEventListener('mouseleave', scheduleHide);\n document.removeEventListener('mousemove', debouncedOnMouseMove);\n mouseMoveListeners = mouseMoveListeners.filter(function (listener) {\n return listener !== debouncedOnMouseMove;\n });\n }", "removeEventListeners() {\n this.elementListener.removeEventListener(\"mouseenter\", this.onMouseEnterBind);\n this.elementListener.removeEventListener(\"mouseleave\", this.onMouseLeaveBind);\n this.elementListener.removeEventListener(\"mousemove\", this.onMouseMoveBind);\n\n if (this.gyroscope) {\n window.removeEventListener(\"deviceorientation\", this.onDeviceOrientationBind);\n }\n\n if (this.glare || this.fullPageListening) {\n window.removeEventListener(\"resize\", this.onWindowResizeBind);\n }\n }", "resetObjects()\n {\n //remove rectangles for collidable bodies\n this.buttons.forEach(this.deleteBody, this, true);\n this.spikes.forEach(this.deleteBody, this, true);\n\n this.startdoors.destroy();\n this.enddoors.destroy();\n this.buttons.destroy();\n this.spikes.destroy();\n this.checkpoints.destroy();\n this.doors.destroy();\n }", "function dropTetro() {\n\tfor (let y = activeTetro.y; y < playField.length; y++) {\n\t\tactiveTetro.y += 1\n\t\tif (hasCollisions()) {\n\t\t\tactiveTetro.y -= 1\n\t\t\tbreak\n\t\t}\n\t}\n}", "function isObstacle_Clash_leftofWindow() {\r\n for (let j in stages.obstacles)\r\n if (stages.obstacles[j].x <= -stages.obstacles[j].width) {\r\n stages.obstacles.splice(j, 1);\r\n }\r\n }", "_stopMovement() {\n for (const boundAction in this.boundFunctions) {\n if (\n Object.prototype.hasOwnProperty.call(this.boundFunctions, boundAction)\n ) {\n this.body.emitter.off(\"initRedraw\", this.boundFunctions[boundAction]);\n this.body.emitter.emit(\"_stopRendering\");\n }\n }\n this.boundFunctions = {};\n }", "reset () {\r\n this.PhysicsManager.setVelocity(this.body, { x: 0, y: 0 })\r\n }", "_onCollision()\n {\n const bossHit = this.scene._misc._bossHit.getFirst();\n if (this.active && bossHit) {\n // Centrate hit appearance\n bossHit._activate(this.body.x + this.body.width / 2, this.body.y + this.body.height);\n }\n\n this.setActive(false);\n this.setVisible(false);\n this.body.reset(); // Without reset the body will be still in scene\n }", "removePileArea () {\n if (!this.pileArea) { return; }\n\n fgmState.scene.remove(this.pileArea);\n this.pileArea = undefined;\n }", "function render()\r\n{\r\n\tvar delta = clock.getDelta();\r\n\tcameraControls.update( delta );\r\n\trenderer.render( scene, camera );\r\n\tscene.simulate();// add physics\r\n\r\n\t// delete cannonballs after they fall below the ground to reduce strain on resources\r\n\tfor( var i = 0; i < cannonballs.length; i++ )\r\n\t\tif( cannonballs[i].position.y < -500 )\r\n\t\t{\r\n\t\t\tscene.remove( cannonballs[i] );\r\n\t\t\tcannonballs.splice( i, 1 );\r\n\t\t}\r\n}", "function updateRoom() {\r\n\t\tbullets.length = 0;\r\n\t\tparticles.length = 0;\r\n\t}", "handleMouseCollision() {\n for(var i = 0; i < this.particles.length; i++) {\n let p = this.particles[i];\n\n if(this.checkParticleCollision(p))\n p.repulseTo(this.getMouseCoords(), MOUSEATTR.force);\n }\n }", "destroy() {\n //this.unobserve(this.slider.selector);\n this.unobserve(window);\n const tx = document.documentElement;\n tx.removeEventListener(\"pointermove\", this.onpointermove);\n tx.removeEventListener(\"mousemove\", this.mousemoveUpdater);\n /*this.slider.selector.removeEventListener(\"touchend\", this.mtimerUpdater);\n this.slider.selector.removeEventListener(\"mouseup\", this.mtimerUpdater);\n this.slider.selector.removeEventListener(\"mousedown\", this.mtimerUpdater);\n this.slider.selector.removeEventListener(\"mousemove\", this.mousemoveHandler);*/\n\n this.coordinator = null;\n }", "function removeDisconnected() {\n current_robot_list.forEach((robot) => {\n if(robot.status === 'Disconnected') {\n removeRobot(robot);\n }\n });\n drawRobots();\n}", "function stopMoving() {\n document.removeEventListener('mousemove', widthSizer, false);\n document.removeEventListener('mouseup', stopMoving, false);\n return;\n}", "function platformCollide() {\n\tfor (var i = 0; i < platforms.length; i++) {\n\t\tif (spriteCollide(platforms[i].sprite) && platforms[i].tangible) {\n\t\t\tinky.colliding = true;\n\t\t\tinky.platform = platforms[i].sprite;\n\t\t\treturn true;\n\t\t}\n\t}\n\tinky.platform = undefined;\n\treturn false;\n}", "function createOrRecreateBody(type) {\n if (type === 'none' && !this._rigidBody) {\n // Return immediately when body is not relevant\n return;\n }\n let engine = CPhysicsCtrl.get().engine;\n let world = CPhysicsCtrl.get().world;\n\n // let oldBody = this._rigidBody;\n //\n // if (oldBody) {\n // world.removeRigidBody(oldBody);\n // }\n\n if (type === 'none') {\n world.removeRigidBody(this._rigidBody);\n if (this._rigidBody) delete this._rigidBody;\n return;\n }\n\n let sensor = type === 'sensor';\n let shapes;\n let material = this._material || CPhysicsCtrl.get().engine.getDefaultMaterial();\n\n if (this._customShapes) {\n shapes = [];\n for (let cs of this._customShapes) {\n let s = cs.clone();\n s.sensor = sensor;\n s.setMaterial(material);\n shapes.push(s);\n }\n } else if (this.target._pixiObject.texture &&\n this.target._pixiObject.texture.baseTexture &&\n this.target._pixiObject.texture.baseTexture.arrayOfVertices) {\n shapes = arrayOfVerticesToShapes(\n this.target._pixiObject.texture.baseTexture.arrayOfVertices,\n this.target,\n material,\n sensor\n );\n } else if (this.target._pixiObject._generateArrayOfVertices) {\n shapes = arrayOfVerticesToShapes(\n this.target._pixiObject._generateArrayOfVertices(),\n this.target,\n material,\n sensor\n );\n } else {\n shapes = [CPhysicsCtrl.get().engine.createPolygonShape({\n vertices: CPhysicsCtrl.get().engine.createRectangleVertices(0, 0,\n this.target.width / this.target._pixiObject.scale.x,\n this.target.height / this.target._pixiObject.scale.y),\n sensor: sensor,\n material: material\n })];\n }\n\n // TODO: Is this needed?\n // this.target._pixiObject.calculateVertices();\n\n let pixelsPerMeter = CStage.get()._options.pixelsPerMeter;\n\n let rigidBodyType = sensor ? 'kinematic' : type;\n\n if (this._rigidBody) {\n if (rigidBodyType === 'static' || this._rigidBody.isStatic()) {\n world.removeRigidBody(this._rigidBody);\n delete this._rigidBody;\n }\n }\n\n\n if (!this._rigidBody) {\n let position = [\n this.target._pixiObject.x / pixelsPerMeter,\n this.target._pixiObject.y / pixelsPerMeter\n ];\n let rotation = this._target.rotation;\n let velocity = undefined;\n let angularVelocity = undefined;\n this._rigidBody = engine.createRigidBody({\n type: rigidBodyType === 'static' ? 'kinematic' : rigidBodyType, // Set to static when done\n userData: this,\n shapes: shapes,\n position: position,\n rotation: rotation\n });\n } else {\n while (this._rigidBody.shapes.length) {\n this._rigidBody.removeShape(this._rigidBody.shapes[0]);\n }\n switch (rigidBodyType) {\n case 'static': this._rigidBody.setAsKinematic(); break; // Set to static when done\n case 'kinematic': this._rigidBody.setAsKinematic(); break;\n case 'dynamic': this._rigidBody.setAsDynamic(); break;\n default: throw \"Invalid value for rigidBodyType \";\n }\n for (let shape of shapes) {\n this._rigidBody.addShape(shape);\n }\n\n }\n\n\n let rigidBody = this._rigidBody;\n let s = new Date().getTime();\n\n // Reset collision mask\n for (let i = 0; i < rigidBody.shapes.length; i += 1) {\n rigidBody.shapes[i].setMask(this._collisionMask);\n rigidBody.shapes[i].setGroup(this._collisionMask);\n }\n // console.log('tick ' + (new Date().getTime() - s));\n let metersPerPixel = 1/pixelsPerMeter;\n for (let i = 0; i < rigidBody.shapes.length; i += 1) {\n let tmpBody = rigidBody.shapes[i].body;\n rigidBody.shapes[i].body = undefined;\n rigidBody.shapes[i].scale(metersPerPixel, metersPerPixel);\n rigidBody.shapes[i].body = tmpBody;\n }\n // console.log('took ' + (new Date().getTime() - s));\n\n\n rigidBody._currAnchor = [0,0];\n\n let com = rigidBody.computeLocalCenterOfMass();\n let scale = this._target._pixiObject.scale;\n\n rigidBody._centerOfMassPerc = [\n com[0] / ((this.target.width / (scale.x * pixelsPerMeter)) || 1),\n com[1] / ((this.target.height / (scale.y * pixelsPerMeter)) || 1)\n ];\n\n\n if (type === 'dynamic') {\n this._useComOrigin = true;\n rigidBody._currAnchor = [this.target.anchor.x, this.target.anchor.y];\n // rigidBody._currAnchor = rigidBody._centerOfMassPerc;\n translateShapes.call(this, -com[0], -com[1]);\n\n\n // rigidBody.invalidate();\n this._worldPosition = new CTargetPoint(\n () => {\n let rotation = rigidBody.getRotation();\n let sin = Math.sin(rotation);\n let cos = Math.cos(rotation);\n let a = cos, b = sin, c = -sin, d = cos;\n let dx = -(rigidBody._centerOfMassPerc[0] - rigidBody._currAnchor[0]) * this.target.width / pixelsPerMeter;\n let dy = -(rigidBody._centerOfMassPerc[1] - rigidBody._currAnchor[1]) * this.target.height / pixelsPerMeter;\n let pos = rigidBody.getPosition();\n // var bodyX = xFromWorldPoint.call(this, pos);\n // var bodyY = yFromWorldPoint.call(this, pos);\n return {\n x: pos[0] + dx * a + dy * c,\n y: pos[1] + dx * b + dy * d\n };\n },\n (pos) =>{\n if (rigidBody.isStatic()) {\n throw new Error(\"Static bodies should not be moved\");\n }\n let rotation = rigidBody.getRotation();\n let sin = Math.sin(rotation);\n let cos = Math.cos(rotation);\n let a = cos, b = sin, c = -sin, d = cos;\n let dx = (rigidBody._centerOfMassPerc[0] - rigidBody._currAnchor[0]) * this.target.width / pixelsPerMeter;\n let dy = (rigidBody._centerOfMassPerc[1] - rigidBody._currAnchor[1]) * this.target.height / pixelsPerMeter;\n let newPos =[\n pos.x + dx * a + dy * c,\n pos.y + dx * b + dy * d\n ];\n rigidBody.setPosition(newPos);\n });\n\n this._worldPosition.set(this.target._pixiObject.x / pixelsPerMeter, this.target._pixiObject.y / pixelsPerMeter);\n } else {\n this._useComOrigin = false;\n\n this._worldPosition = new CTargetPoint(\n () => {\n let position = rigidBody.getPosition();\n return {x: position[0], y: position[1]};\n },\n point => rigidBody.setPosition([point.x, point.y])\n );\n }\n world.addRigidBody(rigidBody);\n rigidBody._invalidate();\n\n scaleBody.call(this);\n\n updateAnchor.call(this);\n\n if (rigidBodyType === 'static') {\n this._rigidBody.setAsStatic();\n }\n}", "removeTail() { //There are only four needed directions, and any others could cause bugs.\n if (!this.foundApple) {\n this.gameState -= this.body[0] //Removes the tail from the visual game state\n this.body.shift() //Removes the tail from the snake's body\n } else {\n this.foundApple = false; //Waits one clock cycle if an apple was found\n }\n }", "function removeRight(){\n\t// kill all marios on the right half\n\t$(\"#characters\").children().each(function(index) {\n\t\tif($(this).attr(\"srcPos\") >= 5)\n\t\t{\n\t\t\t//if(isCompatible() == true)\n\t\t\t{\n\t\t\t\t$(this).addClass(\"character-removed\");\n\t\t\t\t$(this).bind(\"webkitTransitionEnd\", removeDiv);\n\t\t\t\t$(this).bind(\"oTransitionEnd\", removeDiv);\n\t\t\t\t$(this).bind(\"otransitionend\", removeDiv);\n\t\t\t\t$(this).bind(\"transitionend\", removeDiv);\n\t\t\t\t$(this).bind(\"msTransitionEnd\", removeDiv);\n\t\t\t}\n\t\t\t/*else\n\t\t\t{\n\t\t\t\t$(this).empty();\n\t\t\t\t$(this).remove();\n\t\t\t}*/\n\t\t}\n\t});\n}", "set enabled(v) {\n if (v) {\n if (this.index < 0) {\n this.index = this.world.bodies.length;\n this.world.addSharedBody(this);\n this.syncInitial();\n }\n } else if (this.index >= 0) {\n const isRemove = this.shapes.length === 0;\n\n if (isRemove) {\n this.index = -1;\n this.world.removeSharedBody(this);\n }\n }\n }", "function removeMouseListeners(slider) {\n slider.removeEventListener('mouseover', handleMouseover);\n slider.removeEventListener('mouseout', handleMouseout);\n }", "set otherCollider(value) {}", "collisionDetection() {\n if (\n collideRectCircle(sliderX, sliderY, 30, height, this.x, this.y, this.r) &&\n sliderSpeed >= 0\n ) {\n this.color = random(160);\n }\n\n if (\n collideRectCircle(sliderX, sliderY, 30, height, this.x, this.y, this.r) &&\n sliderSpeed < 0\n ) {\n this.color = random(360);\n }\n }", "function removeMoveListener() {\n if(listener.move) {\n document.removeEventListener('mousemove', mouseMove, false);\n listener.move = false;\n }\n }", "_resetBlocks(){\n if(MainGameScene.isInputActive) {\n this.physicsSpawner.removeAllSpawnables();\n }\n }", "offCollision(eventType, handler) {\n this.internal.off(eventType, handler);\n }", "set collider(value) {}" ]
[ "0.64641505", "0.63221043", "0.6303872", "0.6266476", "0.62528527", "0.61161864", "0.6047687", "0.6042808", "0.5715037", "0.5688946", "0.56785524", "0.5659047", "0.5656989", "0.5647188", "0.56171954", "0.5594845", "0.55844414", "0.55761814", "0.555861", "0.55491245", "0.55395323", "0.5512174", "0.5475405", "0.5468373", "0.5370624", "0.5353085", "0.5319434", "0.53187495", "0.5309393", "0.52985954", "0.5295674", "0.52956474", "0.52842814", "0.527661", "0.5270777", "0.5266108", "0.52646506", "0.5264046", "0.52553374", "0.525394", "0.52513766", "0.52406466", "0.5233076", "0.5213761", "0.5198066", "0.5192026", "0.51799715", "0.51725954", "0.5171142", "0.5167537", "0.5162382", "0.51617163", "0.5155891", "0.5152983", "0.5152557", "0.5148828", "0.5134065", "0.51235545", "0.51200837", "0.5114887", "0.5090572", "0.5085966", "0.50827336", "0.5068599", "0.50672054", "0.5066703", "0.50665206", "0.50663894", "0.50656193", "0.50644416", "0.5062667", "0.5060431", "0.50559586", "0.50544304", "0.5047", "0.50456816", "0.5043474", "0.50411105", "0.50408566", "0.5025134", "0.5023941", "0.50175333", "0.5015148", "0.5012908", "0.5011201", "0.5008884", "0.49991652", "0.49981922", "0.49941728", "0.4975761", "0.49756578", "0.497358", "0.49708247", "0.49689418", "0.49673226", "0.4964985", "0.49625844", "0.4961518", "0.49605894", "0.49603257" ]
0.7001257
0
Removes overlap sensors from the sprite.
removeSensors() { this._overlap = {}; this._overlaps = {}; this._overlapping = {}; this._overlapped = {}; this._removeFixtures(true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeOutOfBoundObj() {\n gameState.enemies.getChildren().forEach(enemy => {\n if (enemy.x > config.width + HALF_OBJ_PIXEL || enemy.x < -HALF_OBJ_PIXEL) {\n gameState.enemies.remove(enemy);\n }\n });\n gameState.platformsEven.getChildren().forEach(platform => {\n if (platform.x > config.width + HALF_OBJ_PIXEL * 2 || platform.x < -HALF_OBJ_PIXEL * 2) {\n gameState.platformsEven.remove(platform);\n }\n });\n gameState.platformsOdd.getChildren().forEach(platform => {\n if (platform.x > config.width + HALF_OBJ_PIXEL * 2 || platform.x < -HALF_OBJ_PIXEL * 2) {\n gameState.platformsOdd.remove(platform);\n }\n });\n}", "removeObstacle(x, y, width, height) {\n for (let i = 0; i < width; i++) {\n for (let j = 0; j < height; j++) {\n this.setTile(1, x+i, y+j, 0);\n }\n }\n }", "removeSprites() {\n\t\t\t\t// prevent rebuilding the quadTree multiple times\n\t\t\t\tthis.p.quadTree.rebuildOnRemove = false;\n\t\t\t\twhile (this.length > 0) {\n\t\t\t\t\tthis[0].remove();\n\t\t\t\t}\n\t\t\t\tthis.p.quadTree.rebuildOnRemove = true;\n\n\t\t\t\tthis.p.allSprites._rebuildQuadtree();\n\t\t\t}", "function clearSprites(){\n\t\tfor (var i = sprites.length - 1; i >= 0; i--) {\n\t\t\tsceneOrtho.remove(sprites[i]);\n\t\t};\n\t\tsprites=[];\n\t}", "removeSprite(body) {\n const index = this.spriteList.findIndex(s => s.id === body.id)\n this.spriteList.splice(index, 1)\n body.sprite.destroy()\n try {\n body.stopWork()\n } catch (e) {\n console.log(body + 'dont have stopwork fn')\n }\n }", "update() {\n\t\tvar toRemove = [];\n\t\tfor (var particle of this) {\n\t\t\tparticle.update();\n\t\t\tif (particle.size <= 0 || particle.alpha <= 0) {\n\t\t\t\ttoRemove.push(this.indexOf(particle));\n\t\t\t}\n\t\t}\n\t\tvar offset = 0;\n\t\tfor (var i of toRemove) {\n\t\t\tthis.splice(i-offset, 1);\n\t\t\toffset++;\n\t\t}\t\n\t}", "function o(){document.removeEventListener(\"mousemove\",i),H=null}", "remove() {\n this.x = -1000\n this.y = -1000\n }", "function removeAllGSighting(){\n \tremoveAllObjectMarker(SIGHTING);\n }", "function updateShots() {\n\tfor (let i = 0; i < shots.length; i++) {\n\t\tshots[i].shotY -= shotSpeed;\n\t\tif (shots[i].shotY < 0) {\n\t\t\tshots.splice(i, 1);\n\t\t}\n\t}\n}", "function removeOOB(arrL, arrR) {\n // for blocks moving left to right\n arrL = arrL.filter(function(element) {\n return (\n element.x < WIDTH + blockSize &&\n element.y > -1 * blockSize &&\n element.y < HEIGHT + blockSize\n );\n });\n // for blocks moving right to left\n arrR = arrR.filter(function(element) {\n return (\n element.x > -1 * blockSize &&\n element.y > -1 * blockSize &&\n element.y < HEIGHT + blockSize\n );\n });\n}", "clear() {\n if (this.score >= 50) {\n this.score -= 50;\n this.update_score();\n let sprite = app.stage.getChildAt(0);\n this.meteors.forEach(element => app.stage.removeChild(element));\n this.meteors.clear;\n }\n }", "popSpriteMask(a, b) {\n this.renderer.filter.pop();\n this.alphaMaskIndex--;\n }", "checkOutside(){\n \tif (this.x >= 6) {\n \t\tallEnemies.splice(allEnemies.indexOf(this),1);\n \t}\n }", "removePileArea () {\n if (!this.pileArea) { return; }\n\n fgmState.scene.remove(this.pileArea);\n this.pileArea = undefined;\n }", "function unregisterTrackPos(handle) {\n $(handle.currentTarget).unbind('mousemove')\n}", "removeFrom (stage) {\n const curStage = stage\n\n curStage.sprites = stage.sprites.filter((item) => item !== this)\n this.element ? this.element = this.element.delete(this) : null\n }", "function undraw() {\n currentTetromino.forEach(index => {\n //unrender tetromino cells by removing class 'tetromino'\n squares[currentPosition + index].classList.remove('tetromino');\n //remove color\n squares[currentPosition + index].style.backgroundColor = '';\n });\n }", "function isObstacle_Clash_leftofWindow() {\r\n for (let j in stages.obstacles)\r\n if (stages.obstacles[j].x <= -stages.obstacles[j].width) {\r\n stages.obstacles.splice(j, 1);\r\n }\r\n }", "removeRegionsInArea(area) {\n area.normalize();\n // this is temporary solution. There will be previews\n for (var i = this.imageInfo.regions.length - 1; i >= 0; i--) {\n var region = this.imageInfo.regions[i];\n if (region.source === RegionInfoSourceEnum.MANUAL) {\n var intersected = region.checkIntersectionRegion(this.selectionRegionInfo);\n if (intersected) {\n this.imageInfo.regions.splice(i, 1);\n }\n }\n }\n }", "outOfBounds() {\n const minX = this.x >= 0;\n const maxX = this.x < tileSizeFull * cols;\n const minY = this.y >= 0;\n const maxY = this.y < tileSizeFull * rows;\n\n if (!(minX && maxX && minY && maxY)) {\n this.removeSelf();\n }\n }", "function killIconRange(fromX, fromY, toX, toY) {\n\n fromX = Phaser.Math.clamp(fromX, 0, BOARD_COLS - 1);\n fromY = Phaser.Math.clamp(fromY , 0, BOARD_ROWS - 1);\n toX = Phaser.Math.clamp(toX, 0, BOARD_COLS - 1);\n toY = Phaser.Math.clamp(toY, 0, BOARD_ROWS - 1);\n\n for (var i = fromX; i <= toX; i++)\n {\n for (var j = fromY; j <= toY; j++)\n {\n var icon = getIcon(i, j);\n icon.kill();\n \n score += 50;\n sctext1.text = 'Score: ' + score;\n }\n }\n\n}", "removePoints() {\n const block = this;\n for (let i = this.inputs.length - 1; i >= 0; i--) {\n block.removePoint(this.inputs[i]);\n }\n for (let i = this.outputs.length - 1; i >= 0; i--) {\n block.removePoint(this.outputs[i]);\n }\n }", "function removeWalls(a, b) {\r\n var x = a.i - b.i;\r\n var y = a.j - b.j;\r\n if (x === -1) {\r\n a.walls[1] = false;\r\n b.walls[3] = false;\r\n } else if (y === 1) {\r\n a.walls[0] = false;\r\n b.walls[2] = false;\r\n } else if (x === 1) {\r\n a.walls[3] = false;\r\n b.walls[1] = false;\r\n } else if (y === -1) {\r\n a.walls[2] = false;\r\n b.walls[0] = false;\r\n }\r\n}", "checkParticleBoundaries(){\n const particlesToRemove = [];\n Object.keys(this.particles).forEach( (id) => {\n const particle = this.particles[id];\n // if particle is out of bounds, add to particles to remove array\n if ( particle.posX > this.canvasWidth\n || particle.posX < 0\n || particle.posY > this.canvasHeight\n || particle.posY < 0\n ) {\n particlesToRemove.push(id);\n }\n });\n\n if (particlesToRemove.length > 0){\n\n particlesToRemove.forEach((id) => {\n // We're checking if the total particles exceed the max particles.\n // If the total particles exeeds max particles, we delete the particle\n // entry in the object. Otherwise, we just create a new particle\n // and insert it into the old particle's object id. This saves us\n // a little time above with generating a new UUID or running the delete command\n if (Object.keys(this.particles).length > this.maxParticles){\n delete this.particles[id];\n } else {\n this.particles[id] = this.makeRandomParticle();\n }\n });\n }\n }", "unstageUnit(){\n this.image.parent.removeChild(this.image);\n this.healthBar.parent.removeChild(this.healthBar);\n }", "stop() {\n dataMap.get(this).moveX = 0;\n dataMap.get(this).moveY = 0;\n }", "function removePlot(sensor){\n d3.selectAll(\".dots-\" + sensor).remove();\n d3.select(\"#route-\" + sensor).remove();\n d3.selectAll(\"#carIcon-\" + sensor).remove();\n\n }", "removeBody(){\n\t\tlet length = this.body.length;\n\t\tfor (let i=length; i > 0; i--){\n \tthis.body.x.pop();\n \tthis.body.y.pop();\n\n \tlet snakeBody = document.querySelector('.snake_body');\n \tsnakeBody.parentNode.removeChild(snakeBody); \n \t}\n \tthis.body.length = 0;\n\t}", "function stopSensorEvents(){\n\tfor(var t in sensors){\n\t\tif(sensor_id_selected == t){\n\t\t\tfor(k=0; k<sensorEventListener_state.length; k++){\n\t\t\t\tif(sensorEventListener_state[k].key==sensors[t].id){\n\t\t\t\t\tvar state = sensorEventListener_state[k].value;\n\t\t\t\t\t//if event listener isn't active (state=0) --> active it\n\t\t\t\t\tif(state==1){\n\t\t\t\t\t\tsensors[t].removeEventListener('onEvent', \n\t\t\t\t\t\t\tfunction(event){\n\t\t\t\t\t \t\tonSensorEvent(event);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t);\n\t\t\t\t\t\tsensorEventListener_state[k].value = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "removeAll(occupant, layer) {\n for (var x=0; x < this.width; x++) {\n for (var y=0; y < this.height; y++) {\n this.remove(occupant, x, y, layer)\n }\n }\n }", "function removeSpring_updateFall() {\n\t\t//remove all rects of spring 18\n\t\td3.selectAll('.s18Histogram').remove();\n\n\t\tupdateFall();\n\t}", "function removeShipHorz1(location, length) {\n\tfor (var i = location; i < location + length; i++) {\n\t\t$(\".bottom2 .\" + i).removeClass(\"highlight\");\n\t}\n}", "function undraw() {\n current.forEach((index) => {\n squares[currentPosition + index].classList.remove(\"tetromino\");\n });\n }", "keepInBounds() {\n let x = this.sprite.position.x;\n let y = this.sprite.position.y;\n let spriteHalfWidth = this.sprite.width / 2;\n let spriteHalfHeight = this.sprite.height / 2;\n let stageWidth = app.renderer.width;\n let stageHeight = app.renderer.height;\n\n if (x - spriteHalfWidth <= 0)\n this.sprite.position.x = spriteHalfWidth;\n\n if (x + spriteHalfWidth >= stageWidth)\n this.sprite.position.x = stageWidth - spriteHalfWidth;\n\n //Add the same padding that the other bounds have\n if (y + spriteHalfHeight >= stageHeight - 10)\n this.sprite.position.y = stageHeight - spriteHalfHeight - 10;\n\n if (y - spriteHalfHeight <= 0)\n this.sprite.position.y = spriteHalfHeight;\n }", "clear() {\n this.updateID++;\n this.minX = Infinity;\n this.minY = Infinity;\n this.maxX = -Infinity;\n this.maxY = -Infinity;\n }", "function removeWalls(a,b) {\r\n let x = a.i - b.i;\r\n if(x === 1){\r\n a.walls[3] = false;\r\n b.walls[1] = false;\r\n } else if (x === -1) {\r\n a.walls[1] = false;\r\n b.walls[3] = false;\r\n }\r\n let y = a.j -b.j;\r\n if(y === 1){\r\n a.walls[0] = false;\r\n b.walls[2] = false;\r\n } else if (y === -1) {\r\n a.walls[2] = false;\r\n b.walls[0] = false;\r\n }\r\n}", "function removeRight(){\n\t// kill all marios on the right half\n\t$(\"#characters\").children().each(function(index) {\n\t\tif($(this).attr(\"srcPos\") >= 5)\n\t\t{\n\t\t\t//if(isCompatible() == true)\n\t\t\t{\n\t\t\t\t$(this).addClass(\"character-removed\");\n\t\t\t\t$(this).bind(\"webkitTransitionEnd\", removeDiv);\n\t\t\t\t$(this).bind(\"oTransitionEnd\", removeDiv);\n\t\t\t\t$(this).bind(\"otransitionend\", removeDiv);\n\t\t\t\t$(this).bind(\"transitionend\", removeDiv);\n\t\t\t\t$(this).bind(\"msTransitionEnd\", removeDiv);\n\t\t\t}\n\t\t\t/*else\n\t\t\t{\n\t\t\t\t$(this).empty();\n\t\t\t\t$(this).remove();\n\t\t\t}*/\n\t\t}\n\t});\n}", "_removeFixtures(isSensor) {\r\n\t\t\tlet prevFxt;\r\n\t\t\tfor (let fxt = this.fixtureList; fxt; fxt = fxt.getNext()) {\r\n\t\t\t\tif (fxt.m_isSensor == isSensor) {\r\n\t\t\t\t\tlet _fxt = fxt.m_next;\r\n\t\t\t\t\tfxt.destroyProxies(this.p.world.m_broadPhase);\r\n\t\t\t\t\tif (!prevFxt) {\r\n\t\t\t\t\t\tthis.body.m_fixtureList = _fxt;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tprevFxt.m_next = _fxt;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tprevFxt = fxt;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "removeColliders() {\r\n\t\t\tthis._collides = {};\r\n\t\t\tthis._colliding = {};\r\n\t\t\tthis._collided = {};\r\n\t\t\tthis._removeFixtures(false);\r\n\t\t}", "function removeShipHorz2(location, length) {\n\tfor (var i = location; i < location + length; i++) {\n\t\t$(\".bottom3 .\" + i).removeClass(\"highlight\");\n\t}\n}", "function removeShape() {\n for (var row = 0; row < currentShape.shape.length; row++) {\n for (var col = 0; col < currentShape.shape[row].length; col++) {\n if (currentShape.shape[row][col] !== 0) {\n grid[currentShape.y + row][currentShape.x + col] = 0;\n }\n }\n }\n}", "removeMarkers() {\n this.control.rotateSpeed = 0.1;\n if (this.markers && this.markers.length) {\n for (var i = this.markers.length - 1; i >= 0; i--) {\n this.scene.remove(this.markers[i]);\n }\n }\n }", "remove() {\n super.remove();\n\n /* Remove event listeners */\n this.playerBoard.remove();\n this.oppositeBoard.remove();\n }", "function removeShipVert1(location, length) {\n\tvar inc = 0;\n\tfor (var i = location; i < location + length; i++) {\n\t\t$(\".bottom2 .\" + (location + inc)).removeClass(\"highlight\");\n\t\tinc = inc + 10;\n\t}\n}", "function clearObstacles(){\n obstaclesArray.pop(obstaclesArray[0]);\n}", "function removeShipVert2(location, length) {\n\tvar inc = 0;\n\tfor (var i = location; i < location + length; i++) {\n\t\t$(\".bottom3 .\" + (location + inc)).removeClass(\"highlight\");\n\t\tinc = inc + 10;\n\t}\n}", "function updateSpriteCloud(sprite) {\n\ttry {\n \tsprite.x -= RATIO * CLOUD_SPEED * getMultiplier();\n\t\tif (sprite.x <= -sprite.width) {\n\t\t\tgroupClouds.remove(sprite, true);\n\t\t\taddSpriteCloud();\n\t\t}\n\t}\n\tcatch (e) {}\n}", "function destroyBrick(){\n for(var i=0;i<bricks.length;i++){\n if(checkCollision(ball,bricks[i])){\n ball.speedY = -ball.speedY;\n createBonus(bricks[i]);\n bricks.splice(i,1);\n }\n }\n }", "function removeFall_updateSpring() {\n\t\t//Remove all rects of fall 17\n\t\td3.selectAll('.f17Histogram').remove();\n\n\t\tupdateSpring();\n\t}", "updateLasers() {\n this.lasers.forEach((laser, index) => {\n if (laser.position.y <= 0 || laser.collided) {\n this.lasers.splice(index, 1);\n }\n });\n }", "function removeOverlapsTrackingElement(event) {\n if(event.direct==-1)return false;\n var arr = overlappedEvents[event.direct]\n if(arr==null||arr==undefined)return false;\n for (var value = 0; value < arr.length; value++) {\n if (arr[value] == event._id) {\n //var parentObject = $('#calendar').fullCalendar('clientEvents', key);\n //parentObject.backgroundColor = '';\n arr.splice(value, 1);\n if (arr.length == 0) {\n var e = $('#calendar').fullCalendar('clientEvents', event.direct);\n e.overlaped = false;\n delete(overlappedEvents[event.direct]);\n }\n break;\n }\n }\n\n}", "destroy() {\n this.container.removeChild(this.inspiredSprite);\n this.container.removeChild(this.sprite);\n this.container.removeChild(this.halo);\n this.container.removeChild(this.highlight);\n delete this.container;\n }", "clearScene(){\n $objs.spritesFromScene.forEach(cage => {\n $stage.scene.removeChild(cage);\n $objs.LIST[cage.dataObj._id] = void 0;\n });\n $objs.spritesFromScene = [];\n }", "function removeLeft(){\n\t// kill all marios on the left half\n\t$(\"#characters\").children().each(function(index) {\n\t\tif($(this).attr(\"srcPos\") <5)\n\t\t{\n\t\t\t//if(isCompatible() == true)\n\t\t\t{\n\t\t\t\t$(this).addClass(\"character-removed\");\n\t\t\t\t$(this).bind(\"webkitTransitionEnd\", removeDiv);\n\t\t\t\t$(this).bind(\"oTransitionEnd\", removeDiv);\n\t\t\t\t$(this).bind(\"otransitionend\", removeDiv);\n\t\t\t\t$(this).bind(\"transitionend\", removeDiv);\n\t\t\t\t$(this).bind(\"msTransitionEnd\", removeDiv);\n\t\t\t}\n\t\t\t/*else\n\t\t\t{\n\t\t\t\t$(this).empty();\n\t\t\t\t$(this).remove();\n\t\t\t}*/\n\t\t}\n\t});\n}", "function emptyRackRect(eX, eY, rCount){\n playersRack[activePlayr].splice(rCount-1, 1, undefined);\n ctx.beginPath();\n ctx.clearRect(eX, eY, rectLength, rectBreadth);\n ctx.rect(eX, eY, rectLength, rectBreadth);\n ctx.strokeStyle = \"#000000\";\n ctx.stroke();\n ctx.closePath();\n}", "function removeFromTower(towerMesh){\n\tvar tower = towerList[towerMesh.towerArrayPosition];\n\ttowerList.splice(towerMesh.towerArrayPosition,1);\n\ttowerMeshList.splice(towerMesh.towerArrayPosition,1);\n\tcurrentTowerHeight = currentTowerHeight - tower.height;\n\tupdateTopMesh();\n\tfor(var i = towerMesh.towerArrayPosition; i < towerMeshList.length; i++){\n\t\ttowerMeshList[i].position.y = towerMeshList[i].position.y - tower.height;\n\t\ttowerMeshList[i].towerArrayPosition = towerMeshList[i].towerArrayPosition - 1;\n\t}\n\tmainScene.remove(towerMesh);\n}", "undoStitch(){\n // console.log('undoStitch')\n this.content.css('left',0)\n this.getItems().slice(ITEM_ART_COUNT).remove()\n this.stitchedContent = undefined\n }", "function l(){document.body.removeEventListener(\"mouseleave\",s),document.removeEventListener(\"mousemove\",Y)}", "function removeAllLights(){\n\n\tscene.remove(ambientLight);\n\tscene.remove(directionalLight);\n\tscene.remove(pointLight);\n\n}", "function removeKilledIcons() {\n\n icons.forEach(function(icon) {\n if (!icon.alive) {\n setIconPos(icon, -1,-1);\n }\n });\n\n}", "checkIfOnScreen(pipes) {\n if (this.pos < -this.pipeWidth) {\n pipes.splice(this, 1);\n }\n }", "function pointRemove(point,cx,cy) {\nsetInterval(function() {\n if(newMainGuy.x >= cx && newMainGuy.y >= cy) {\n point.pickUp('up',gameBoard)\n gameBoard.draw()\n } if(point.y < -3) {\n delete point.y\n delete point.x\n delete point.size\n delete point.color\n\n gameBoard.draw()\n }\n},5)\n}", "function removeSprite(sprite) {\n sprite.parent.removeChild(sprite);\n}", "function remove_reduction_objects_from_canvas() {\n var objects = canvas.getObjects()\n $.each(objects,function(i,v){\n if(v.type=='reduc_rect') {\n canvas.remove(objects[i]);\n }\n });\n \n }", "removeFromScene(scene, isUpdating) {\n this.objects.forEach((obj) => {\n scene.remove(obj, true);\n });\n if (!isUpdating) {\n scene.remove(this.cursor, true);\n }\n }", "remove() {\n\t\t\t\tthis.removed = true;\n\n\t\t\t\t//when removed from the \"scene\" also remove all the references in all the groups\n\t\t\t\twhile (this.groups.length > 0) {\n\t\t\t\t\tthis.groups[0].remove(this);\n\t\t\t\t}\n\n\t\t\t\t// clear and rebuild the quadTree\n\t\t\t\tif (this.p.quadTree.rebuildOnRemove) {\n\t\t\t\t\tthis.p.allSprites._rebuildQuadtree();\n\t\t\t\t}\n\t\t\t}", "function cloudErase(tag) {\n if (!tag.sprite) {\n throw new Error(\"No sprite in the tag\");\n }\n\n // Undo temporary hack\n tag.x += size[0] >> 1;\n tag.y += size[1] >> 1;\n\n var sprite = tag.sprite,\n w = tag.width >> 5,\n sw = size[0] >> 5,\n lx = tag.x - (w << 4),\n sx = lx & 0x7f,\n msx = 32 - sx,\n h = tag.y1 - tag.y0,\n x = (tag.y + tag.y0) * sw + (lx >> 5),\n last;\n\n for (var j = 0; j < h; j++) {\n last = 0;\n for (var i = 0; i <= w; i++) {\n board[x + i] &= ~((last << msx) | (i < w ? (last = sprite[j * w + i]) >>> sx : 0));\n }\n x += sw;\n }\n\n event.erased(tags);\n }", "function deleteShape() {\n if(instrumentMode == 7){\n instrumentMode=2;\n }\n shp1.splice(selectedShape-1,1);\n rot1.splice(selectedShape-1,1);\n maxNumShapes--;\n //start from skratch\n if(maxNumShapes == 0){\n instrumentMode = 0;\n }\n selectedShape=maxNumShapes;\n }", "clear() {\n let toRemove = [];\n for (let i = 0; i < this.scene.children.length; i++) {\n let obj = this.scene.children[i];\n if (obj.userData && obj.userData.isBodyElement) {\n toRemove.push(obj);\n }\n }\n for (let i = 0; i < toRemove.length; i++) {\n this.remove(toRemove[i]);\n }\n }", "removeSprite(tag) {\n const layerNos = Object.keys(this.sprites);\n let emptyLayerNo = -1;\n layerNos.forEach(layerNo => {\n if (this.sprites[layerNo][tag] && this.spriteMap[tag]) {\n delete this.sprites[layerNo][tag];\n delete this.spriteMap[tag];\n } else {\n console.log(`sprite tag name ${tag} does not exist`);\n }\n if (this.sprites[layerNo].length === 0) {\n emptyLayerNo = layerNo;\n }\n });\n if (emptyLayerNo >= 0) {\n delete this.sprites[emptyLayerNo];\n }\n }", "removeAnnotation(annotation_id) {\n let annotation = super.removeAnnotation(annotation_id);\n for (let line_num = annotation.range.start; line_num <= annotation.range.end; line_num++) {\n let line = this.source_lines[line_num];\n line.unGlow(annotation_id);\n\n if (\n !Object.values(this.annotations).some(\n ({range}) => range.start <= line_num && line_num <= range.end\n )\n ) {\n line.stopObserving();\n }\n }\n }", "function removeShot( playerShot )\n {\n gameArea.removeChild(playerShot.imgElement);\n \n if( playerShot.targetGameObject != null )\n {\n playerShot.targetGameObject.targeted = false;\n playerShot.targetGameObject = null;\n }\n\n var i = playerShots.indexOf(playerShot);\n playerShots.splice(i, 1);\n }", "lock() {\n for (let ix = 0; ix < this.shape.length; ix++) {\n for (let iy = 0; iy < this.shape[ix].length; iy++) {\n if (!this.shape[ix][iy])\n continue;\n\n if (this.pos.y + iy < 0) {\n failed = true\n return\n }\n field.blocks[this.pos.y + iy][this.pos.x + ix] = this.hue;\n }\n }\n\n this.removeLines()\n }", "removeAllParticles () {\r\n\t\tthis.particles = [];\r\n\t}", "function CameraCommand_Laser_Destroy()\n{\n\t//remove the laser points\n\tfor (var i = 0, c = this.LaserPoints.length; i < c; i++)\n\t{\n\t\t//remove it from the body\n\t\tdocument.body.removeChild(this.LaserPoints[i]);\n\t}\n}", "function _Removevalues(){\n\t\tduplacoordsT1=[];\n\t\tcoordsfetchT1=[];\n\t\ttimestampsT1=[];\n\t\tduplacoordsT2=[];\n\t\tcoordsfetchT2=[];\n\t\ttimestampsT2=[];\n\n\t\tlet cleanStart = document.getElementById(\"Start\");\n\t\tlet cleanFinish = document.getElementById(\"Finish\");\n\t\t\n\t\tcleanStart.value = \"\"\n\t\tcleanFinish.value = \"\"\n}", "function removeDisconnected() {\n current_robot_list.forEach((robot) => {\n if(robot.status === 'Disconnected') {\n removeRobot(robot);\n }\n });\n drawRobots();\n}", "makeUndraggable(...sprites) {\n\n //If the first argument isn't an array of sprites...\n if (!(sprites[0] instanceof Array)) {\n sprites.forEach(sprite => {\n this.draggableSprites.splice(this.draggableSprites.indexOf(sprite), 1);\n if (sprite._localDraggableAllocation === true) sprite.draggable = false;\n });\n }\n\n //If the first argument is an array of sprites\n else {\n let spritesArray = sprites[0];\n if (spritesArray.length > 0) {\n for (let i = spritesArray.length - 1; i >= 0; i--) {\n let sprite = spritesArray[i];\n this.draggableSprites.splice(this.draggableSprites.indexOf(sprite), 1);\n if (sprite._localDraggableAllocation === true) sprite.draggable = false;\n }\n }\n }\n }", "removePice() {\n let ocubiedTile = document.getElementById(`tile${this.position.getPosX()},${this.position.getPosY()}`);\n ocubiedTile.innerHTML = '';\n }", "clearEffects() {\n for (const i in this.sprites) {\n this.sprites[i].clearEffects();\n }\n }", "removeAllParticles() {\n let i = this.particles.length;\n\n while (i--) {\n this.particles[i].dead = true;\n }\n }", "clear() {\n this.stop();\n this.scene.remove.apply(this.scene, this.scene.children);\n this.scene.background = null;\n this.mixers.splice(0, this.mixers.length);\n this.sceneMeshes.splice(0, this.sceneMeshes.length);\n $(\"#picker\").spectrum(\"hide\");\n }", "kill(sprite) {\n for (let i = 0; i < sprite.length; i++) {\n let c = Phaser.Math.Distance.Chebyshev(this.x, this.y, sprite[i].x, sprite[i].y);\n if (sprite[i].active) {\n if (c < 60) {\n sprite[i].setActive(false).setVisible(false);\n sprite[i].alive = false;\n //sprite[i].setTexture('ghost');\n console.log('Hidden');\n console.log(sprite[i].x, sprite[i].y);\n this.createDeadBody(sprite[i].x, sprite[i].y);\n console.log('I killed someone', sprite[i].id);\n this.scene.registry.values.sceneData.serverConnection.kill(sprite[i].id);\n this.scene.registry.values.sceneData.gamePlayScene.scene.manager.getScene('voting_scene').removePlayerById(sprite[i].id);\n break;\n }\n }\n }\n }", "function makeCrossBoom(entity) {\n\n bgBrightness += entity.maxsize / 3;\n\n particles.crosshairContainer[!entity.blue].removeChild(entity.sprite);\n entity.sprite = new PIXI.Sprite(\n PIXI.loader.resources[entity.blue ? \"assets/b-mainboom.png\" : \"assets/r-mainboom.png\"].texture\n );\n entity.sprite.blendMode = PIXI.BLEND_MODES.ADD;\n entity.size = 0;\n entity.growing = 0.03;\n entity.sprite.x = entity.position.x;\n entity.sprite.y = entity.position.y;\n entity.sprite.anchor.x = 0.5;\n entity.sprite.anchor.y = 0.5;\n entity.sprite.scale.x = globalScale * entity.size;\n entity.sprite.scale.y = globalScale * entity.size;\n entity.sprite.alpha = 0.75;\n particles.mainboomContainer[entity.blue].addChild(entity.sprite);\n\n entity.lineboom = new PIXI.Sprite(\n PIXI.loader.resources[\"assets/w-lineboom.png\"].texture\n );\n entity.lineboom.blendMode = PIXI.BLEND_MODES.ADD;\n entity.lineboom.x = entity.position.x;\n entity.lineboom.y = entity.position.y;\n entity.lineboom.anchor.x = 0.5;\n entity.lineboom.anchor.y = 0.5;\n entity.lineboom.scale.x = globalScale * entity.size;\n entity.lineboom.scale.y = globalScale * entity.size;\n entity.lineboom.alpha = 0.75;\n particles.lineboomContainer.addChild(entity.lineboom);\n}", "_cleanOldCollisions() {\n for (const guid in this.collisions) {\n if (this.collisions.hasOwnProperty(guid)) {\n const frameCollision = this.frameCollisions[guid];\n const collision = this.collisions[guid];\n const entity = collision.entity;\n const entityCollision = entity.collision;\n const entityRigidbody = entity.rigidbody;\n const others = collision.others;\n const length = others.length;\n let i = length;\n while (i--) {\n const other = others[i];\n // if the contact does not exist in the current frame collisions then fire event\n if (!frameCollision || frameCollision.others.indexOf(other) < 0) {\n // remove from others list\n others.splice(i, 1);\n\n if (entity.trigger) {\n // handle a trigger entity\n if (entityCollision) {\n entityCollision.fire('triggerleave', other);\n }\n if (other.rigidbody) {\n other.rigidbody.fire('triggerleave', entity);\n }\n } else if (!other.trigger) {\n // suppress events if the other entity is a trigger\n if (entityRigidbody) {\n entityRigidbody.fire('collisionend', other);\n }\n if (entityCollision) {\n entityCollision.fire('collisionend', other);\n }\n }\n }\n }\n\n if (others.length === 0) {\n delete this.collisions[guid];\n }\n }\n }\n }", "disableColliders(){\n this.colliderShapes.forEach((e)=>{\n e.setEnabled(false);\n });\n }", "destroySprite(sprite){\n sprite.destroy();\n }", "_stopMovement() {\n for (const boundAction in this.boundFunctions) {\n if (\n Object.prototype.hasOwnProperty.call(this.boundFunctions, boundAction)\n ) {\n this.body.emitter.off(\"initRedraw\", this.boundFunctions[boundAction]);\n this.body.emitter.emit(\"_stopRendering\");\n }\n }\n this.boundFunctions = {};\n }", "update() {\n // Checks if mouse is over squares and if condition is true, the array gets empty\n if (\n s.mouse.x >= this.x &&\n s.mouse.x <= this.x + 10 &&\n s.mouse.y >= this.y &&\n s.mouse.y <= this.y + 10\n ) {\n // By reassigning the length of the array to 0, it will empty the array thus delete the squares\n squares.length = 0;\n }\n // Updates the size of the squares thus creates the effect\n this.size += this.sv;\n this.sv *= 1.05;\n this.a += 0.01;\n if (this.size > (s.width + s.height) / 20) {\n this.init();\n }\n }", "function stopMoving() {\n document.removeEventListener('mousemove', widthSizer, false);\n document.removeEventListener('mouseup', stopMoving, false);\n return;\n}", "function removeInvisible (value) {\n var i = Math.abs(value);\n while (i) {\n if ( value > 0 ) var index = Rendered.shift();\n else var index = Rendered.pop();\n bin[index].obj.remove();\n i--\n }\n var centerIndex = Math.ceil( Rendered.length / 2 ) - 1;\n currentImageIndex = Rendered[centerIndex];\n startLoading( Rendered[0] - quantityToPreload, Rendered[imagesQuantity - 1] + quantityToPreload );\n if ( typeof onChangeCurrentImage == 'function' ) onChangeCurrentImage( currentImageIndex );\n }", "function unhoverizer() {\n\tclearInterval(interval);\n\t$(\".hoverizer\").remove();\n}", "function removeTokens(tokens, colour){\n for(var i = 0; i < tokens.length; i ++){\n var x = tokens[i].position[1];\n var y = tokens[i].position[0];\n console.log(\"remove x: \" + y);\n console.log(\"remove y: \" + x);\n \n state.board[y][x] = 0;\n\n state.tboard[y][x] = colour;\n \n console.log(state.board);\n \n }\n sendBoard();\n drawBoard(state);\n}", "function removeWeenie(){\n\t\t$(\"#\"+ hole).removeClass(\"add_weenie\");\n\t}", "function killGemRange(fromX, fromY, toX, toY) {\n\n fromX = Phaser.Math.clamp(fromX, 0, BOARD_COLS - 1);\n fromY = Phaser.Math.clamp(fromY , 0, BOARD_ROWS - 1);\n toX = Phaser.Math.clamp(toX, 0, BOARD_COLS - 1);\n toY = Phaser.Math.clamp(toY, 0, BOARD_ROWS - 1);\n\n for (var i = fromX; i <= toX; i++)\n {\n for (var j = fromY; j <= toY; j++)\n {\n var gem = getGem(i, j);\n gem.kill();\n }\n }\n\n}", "clear()\r\n {\r\n // shifting the line to a point outside of the page so that it does not show anymore\r\n this.position.x = -5000;\r\n this.position.y = -5000;\r\n }", "function overPaint(e){\n\n\tcanvas.removeEventListener(\"touchmove\",paint,false);\n\tcanvas.removeEventListener(\"mousemove\",paint,false);\n }", "function removeWall(a, b) {\r\n switch( a.col - b.col){\r\n case 1:\r\n a.walls.left = false\r\n b.walls.right = false\r\n break\r\n case -1:\r\n a.walls.right = false\r\n b.walls.left = false\r\n }\r\n switch(a.row - b.row){\r\n case 1:\r\n a.walls.top = false\r\n b.walls.bottom = false\r\n break\r\n case -1:\r\n a.walls.bottom = false\r\n b.walls.top = false\r\n }\r\n}", "function lineDeletion(yStart) {\n for (var yG = yStart; yG > 0; yG--) {\n for (var x = 0; x < xGridAmount; x++) {\n gridCellOccupied[x][yG] = gridCellOccupied[x][yG - 1];\n if (surfaceBlock[x][yG - 1] != null) {\n surfaceBlock[x][yG] =\n new image(gridCellX[x], gridCellY[yG], \"GreenBlock.jpg\", 0, 0);\n }\n else {\n surfaceBlock[x][yG] = null;\n }\n }\n }\n}" ]
[ "0.63742995", "0.5886565", "0.58457756", "0.56442356", "0.5600117", "0.5546436", "0.5516453", "0.5513831", "0.55122197", "0.5511275", "0.55017287", "0.5484007", "0.54440993", "0.5440689", "0.54392076", "0.5438434", "0.54377514", "0.54259807", "0.542194", "0.54074645", "0.54045457", "0.5399367", "0.53937787", "0.53746426", "0.53658164", "0.53516465", "0.5345682", "0.5333585", "0.53265685", "0.5321277", "0.53102744", "0.530599", "0.53015316", "0.52989435", "0.52986336", "0.52979296", "0.5290602", "0.5274351", "0.5256015", "0.52518225", "0.52450126", "0.5244768", "0.5235234", "0.5234117", "0.5216483", "0.52147806", "0.5211882", "0.5203013", "0.51983464", "0.51923907", "0.5185179", "0.51844424", "0.5183986", "0.517888", "0.51776904", "0.51643246", "0.51599663", "0.5149405", "0.51491594", "0.51468843", "0.5144766", "0.5141743", "0.51399267", "0.5129208", "0.51231", "0.51227313", "0.5121185", "0.51178706", "0.5114504", "0.51141226", "0.51129854", "0.5110933", "0.5103823", "0.5100846", "0.50994486", "0.50905246", "0.5088799", "0.50880307", "0.50809854", "0.5080125", "0.50782555", "0.5077799", "0.5075965", "0.5075692", "0.5070503", "0.50688004", "0.50666916", "0.5058912", "0.5056873", "0.5056357", "0.5056014", "0.5055597", "0.5054486", "0.50429463", "0.50366324", "0.5032522", "0.503229", "0.50315475", "0.5022123", "0.5014473" ]
0.7171138
0
removes sensors or colliders
_removeFixtures(isSensor) { let prevFxt; for (let fxt = this.fixtureList; fxt; fxt = fxt.getNext()) { if (fxt.m_isSensor == isSensor) { let _fxt = fxt.m_next; fxt.destroyProxies(this.p.world.m_broadPhase); if (!prevFxt) { this.body.m_fixtureList = _fxt; } else { prevFxt.m_next = _fxt; } } else { prevFxt = fxt; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeSensors() {\r\n\t\t\tthis._overlap = {};\r\n\t\t\tthis._overlaps = {};\r\n\t\t\tthis._overlapping = {};\r\n\t\t\tthis._overlapped = {};\r\n\t\t\tthis._removeFixtures(true);\r\n\t\t}", "removeColliders() {\r\n\t\t\tthis._collides = {};\r\n\t\t\tthis._colliding = {};\r\n\t\t\tthis._collided = {};\r\n\t\t\tthis._removeFixtures(false);\r\n\t\t}", "onremove() {\n // Slider and binder\n if(this.binder)\n this.binder.destroy();\n if(this.slider)\n this.slider.destroy();\n\n // Destroy classes & objects\n this.binder = this.slider = this.publication = this.series = this.ui = this.config = null;\n }", "function removeDisconnected() {\n current_robot_list.forEach((robot) => {\n if(robot.status === 'Disconnected') {\n removeRobot(robot);\n }\n });\n drawRobots();\n}", "function removePlot(sensor){\n d3.selectAll(\".dots-\" + sensor).remove();\n d3.select(\"#route-\" + sensor).remove();\n d3.selectAll(\"#carIcon-\" + sensor).remove();\n\n }", "disableColliders(){\n this.colliderShapes.forEach((e)=>{\n e.setEnabled(false);\n });\n }", "function destroyDetailSliders()\n\t{\n\t\t$detailTopSlider.slick('unslick');\n\t\t$detailBottomSlider.slick('unslick');\n\t\tdetailSlidersInitialized = !detailSlidersInitialized;\n\t}", "clear() {\n if (this.score >= 50) {\n this.score -= 50;\n this.update_score();\n let sprite = app.stage.getChildAt(0);\n this.meteors.forEach(element => app.stage.removeChild(element));\n this.meteors.clear;\n }\n }", "destroy() {\n //this.unobserve(this.slider.selector);\n this.unobserve(window);\n const tx = document.documentElement;\n tx.removeEventListener(\"pointermove\", this.onpointermove);\n tx.removeEventListener(\"mousemove\", this.mousemoveUpdater);\n /*this.slider.selector.removeEventListener(\"touchend\", this.mtimerUpdater);\n this.slider.selector.removeEventListener(\"mouseup\", this.mtimerUpdater);\n this.slider.selector.removeEventListener(\"mousedown\", this.mtimerUpdater);\n this.slider.selector.removeEventListener(\"mousemove\", this.mousemoveHandler);*/\n\n this.coordinator = null;\n }", "function removeAllLights(){\n\n\tscene.remove(ambientLight);\n\tscene.remove(directionalLight);\n\tscene.remove(pointLight);\n\n}", "function killSensors() {\n stopAccelInterval();\n stopMicInterval();\n return true;\n}", "_removeSvgSlider() {\n let targetSlider = this.svgEls.sliders.pop();\n let targetSliderPanel = this.svgEls.sliderPanels.pop();\n this.svg.removeChild(targetSliderPanel);\n this.svg.removeChild(targetSlider);\n targetSlider = null;\n targetSliderPanel = null;\n }", "function CameraCommand_Laser_Destroy()\n{\n\t//remove the laser points\n\tfor (var i = 0, c = this.LaserPoints.length; i < c; i++)\n\t{\n\t\t//remove it from the body\n\t\tdocument.body.removeChild(this.LaserPoints[i]);\n\t}\n}", "function stopListeningToRControls() {\n $('.rcontrols-remove').off(\"click\");\n $('.rcontrols-add').off(\"click\");\n}", "function delete_sensor(clicked_id){\n\n\tvar id_sensor = \"\";\n\tvar index = 0;\n\tvar div_sensor = \"\";\n\tvar conf=true;\n\n\tfor(q=0; q<sensors_of_room.length; q++){\n\t\tif (clicked_id == \"delete_\"+sensors_of_room[q]) {\n\t \tdiv_sensor = \"div_\" +sensors_of_room[q];\n\t \tindex = q;\n\t \tid_sensor = sensors_of_room[q];\n\t }\n\t}\n\n\t//remove from array\n\tsensors_of_room.splice(index,1);\n\n\t//update DOM\n\tvar childnode = document.getElementById(div_sensor);\n var removednode = document.getElementById(\"sensor_selected\").removeChild(childnode);\n\n //add elements in select - options\n for(q=0; q<sensors_to_hide.length; q++){\n\t\tif (clicked_id == \"delete_\"+sensors_to_hide[q]) {\n\t \tindex = q;\n\t }\n\t}\n\tsensors_to_hide.splice(index,1);\n\tshow_options();\n\n\t//save on \"room_config.txt\" file\n\tsave_config_for_room();\n}", "unMount() {\n this.removeListeners();\n SimpleBar.instances.delete(this.el);\n }", "unMount() {\n this.removeListeners();\n SimpleBar.instances.delete(this.el);\n }", "_removeTrackListeners() {\n var interactionRects = Px.d3.selectAll(Polymer.dom(this.$$('#sliderSVG')).querySelectorAll('.sliderTrack'));\n\n interactionRects.on('click', null);\n }", "function removeOutOfBoundObj() {\n gameState.enemies.getChildren().forEach(enemy => {\n if (enemy.x > config.width + HALF_OBJ_PIXEL || enemy.x < -HALF_OBJ_PIXEL) {\n gameState.enemies.remove(enemy);\n }\n });\n gameState.platformsEven.getChildren().forEach(platform => {\n if (platform.x > config.width + HALF_OBJ_PIXEL * 2 || platform.x < -HALF_OBJ_PIXEL * 2) {\n gameState.platformsEven.remove(platform);\n }\n });\n gameState.platformsOdd.getChildren().forEach(platform => {\n if (platform.x > config.width + HALF_OBJ_PIXEL * 2 || platform.x < -HALF_OBJ_PIXEL * 2) {\n gameState.platformsOdd.remove(platform);\n }\n });\n}", "clear() {\n this.stop();\n this.scene.remove.apply(this.scene, this.scene.children);\n this.scene.background = null;\n this.mixers.splice(0, this.mixers.length);\n this.sceneMeshes.splice(0, this.sceneMeshes.length);\n $(\"#picker\").spectrum(\"hide\");\n }", "remove() {\n console.log('Deleting Ghosts...');\n clearInterval(this.trailInterval);\n _.each(this.clones, (clone) => {\n this.parent.remove(clone);\n clone = null;\n });\n }", "removeCollider(obj) {\n let i = this.colliders.indexOf(obj);\n if (i === -1) {\n console.error('Collider not found: ', obj);\n } else {\n this.colliders.splice(i, 1);\n }\n }", "destroySlider() {\n // remove event listeners\n\n // mouse events\n window.removeEventListener(\"mousemove\", this.onMouseMove, {\n passive: true,\n });\n window.removeEventListener(\"mousedown\", this.onMouseDown);\n window.removeEventListener(\"mouseup\", this.onMouseUp);\n\n // touch events\n window.removeEventListener(\"touchmove\", this.onMouseMove, {\n passive: true,\n });\n window.removeEventListener(\"touchstart\", this.onMouseDown, {\n passive: true,\n });\n window.removeEventListener(\"touchend\", this.onMouseUp);\n\n // resize event\n window.removeEventListener(\"resize\", this.onResize);\n\n // cancel request animation frame\n cancelAnimationFrame(this.animationFrame);\n }", "function cleanup() {\n for (let i = 0; i < floatingTexts.length; i++) {\n if (floatingTexts[i].timer <= 0) {\n floatingTexts.splice(i, 1);\n }\n }\n\n for (let i = 0; i < particles.length; i++) {\n if (particles[i].removable) {\n particles.splice(i, 1);\n }\n }\n\n let maxParticles = Koji.config.strings.maxParticles;\n if (isMobile) {\n maxParticles = Koji.config.strings.maxParticlesMobile;\n }\n\n if (particles.length > maxParticles) {\n particles.splice(maxParticles - 1);\n }\n\n\n for (let i = 0; i < explosions.length; i++) {\n if (explosions[i].removable) {\n explosions.splice(i, 1);\n }\n }\n}", "stopTheCars(){\n //remove the car mover listeners\n clearInterval(moveCarInterval)\n clearInterval(moveLogInterval)\n clearInterval(addCarInterval)\n clearInterval(addLogInterval)\n\n }", "removeAxes(){\n if(this.axes == null){\n return;\n }\n\n var object = this.scene.getObjectById(this.axes.id);\n\n if(object != null){\n this.scene.remove(object);\n this.axes = null\n }\n }", "function removeInteractables(type) {\n console.log(\"remove interactables\");\n switch (type) {\n case \"visible\":\n if (currentInteractables.length != null) {\n console.log(`CURRENT INTERACTABLES: ${currentInteractables}`);\n currentInteractables.forEach((object) => {\n canvas.remove(object);\n });\n } else {\n return;\n }\n break;\n case \"hidden\":\n if (currentHiddenInteractables.length != null) {\n console.log(`CURRENT HIDDEN INTERACTABLES: ${currentInteractables}`);\n currentHiddenInteractables.forEach((object) => {\n console.log(`object for removal type: ${object.type}`)\n if(object.type === 'group'){\n object.forEachObject((item) => {\n canvas.remove(item);\n console.log('item removed');\n });\n }else{\n canvas.remove(object);\n }\n });\n } else {\n return;\n }\n break;\n default:\n return;\n }\n}", "function remove(){primus.removeListener(\"error\",remove).removeListener(\"open\",remove).removeListener(\"end\",remove).timers.clear(\"connect\")}", "removeListeners() {\n const client = MatrixClientPeg.get();\n if (client === null) return;\n\n client.removeListener('sync', this.onSync);\n client.removeListener('Room.timeline', this.onRoomTimeline);\n client.removeListener('Event.decrypted', this.onEventDecrypted);\n client.removeListener('Room.timelineReset', this.onTimelineReset);\n client.removeListener('Room.redaction', this.onRedaction);\n }", "function stopSensorEvents(){\n\tfor(var t in sensors){\n\t\tif(sensor_id_selected == t){\n\t\t\tfor(k=0; k<sensorEventListener_state.length; k++){\n\t\t\t\tif(sensorEventListener_state[k].key==sensors[t].id){\n\t\t\t\t\tvar state = sensorEventListener_state[k].value;\n\t\t\t\t\t//if event listener isn't active (state=0) --> active it\n\t\t\t\t\tif(state==1){\n\t\t\t\t\t\tsensors[t].removeEventListener('onEvent', \n\t\t\t\t\t\t\tfunction(event){\n\t\t\t\t\t \t\tonSensorEvent(event);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t);\n\t\t\t\t\t\tsensorEventListener_state[k].value = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "unstageUnit(){\n this.image.parent.removeChild(this.image);\n this.healthBar.parent.removeChild(this.healthBar);\n }", "dispose() {\n this._domElement.removeEventListener(this.TRAVEL_IN.trigger, this._handleTravelInEvent, false);\n this._domElement.removeEventListener(this.TRAVEL_OUT.trigger, this._handleTravelInEvent, false);\n }", "remove() {\n // remove the para, and filterdiv\n this.para.remove()\n this.filterDiv.remove()\n this.labelholder.remove()\n this.maxel.element.remove()\n this.minel.element.remove()\n }", "remove() {\n window.removeEventListener('vrdisplaypresentchange', this.__onVRDisplayPresentChange);\n if (screenfull.enabled) {\n document.removeEventListener(screenfull.raw.fullscreenchanged, this.__onChangeFullscreen);\n }\n\n this.removeAllListeners();\n }", "function shoo(){\n\t//remove all\n\tdiv_cat.removeEventListener(\"click\", petCat);\n\tdiv_cat.removeEventListener(\"mouseover\", event_cat_mouseOver);\n\tdiv_cat.removeEventListener(\"mouseup\", event_cat_mouseOver);\n\tdiv_cat.removeEventListener(\"mousedown\", event_cat_mouseDown);\n\t//\n\tclearInterval(int_cat);\n\tdocument.getElementById(\"Cat\").remove();\n}", "remove() {\n //remove handlers of any atomic data defined here\n const {source, handler} = this.events;\n source.remove();\n //reset `this.events` \n this.events = {};\n }", "remove() {\n //remove handlers of any atomic data defined here\n const {source, handler} = this.events;\n source.remove();\n //reset `this.events` \n this.events = {};\n }", "function removeListeners() {\n $(\"#controls\").off(\"click\");\n $(\"#sequence\").off(\"click\");\n}", "function removeAll() {\n data.components = {};\n data.plugins = [];\n}", "function removeDisappearingPlatform(i) {\n hasDisappearingPlatform[i] = false;\n fadingRemove(document.getElementById('disappearingplatform' + i), 1, i);\n}", "function cleanBitchList() {\n bitchList.forEach((element) => app.stage.removeChild(element));\n}", "resetObjects()\n {\n //remove rectangles for collidable bodies\n this.buttons.forEach(this.deleteBody, this, true);\n this.spikes.forEach(this.deleteBody, this, true);\n\n this.startdoors.destroy();\n this.enddoors.destroy();\n this.buttons.destroy();\n this.spikes.destroy();\n this.checkpoints.destroy();\n this.doors.destroy();\n }", "remove() {\n\t\t\t\tthis.removed = true;\n\n\t\t\t\t//when removed from the \"scene\" also remove all the references in all the groups\n\t\t\t\twhile (this.groups.length > 0) {\n\t\t\t\t\tthis.groups[0].remove(this);\n\t\t\t\t}\n\n\t\t\t\t// clear and rebuild the quadTree\n\t\t\t\tif (this.p.quadTree.rebuildOnRemove) {\n\t\t\t\t\tthis.p.allSprites._rebuildQuadtree();\n\t\t\t\t}\n\t\t\t}", "function removeClients(){\n clients = [];\n clientIO.removeClients();\n}", "clear() {\n let toRemove = [];\n for (let i = 0; i < this.scene.children.length; i++) {\n let obj = this.scene.children[i];\n if (obj.userData && obj.userData.isBodyElement) {\n toRemove.push(obj);\n }\n }\n for (let i = 0; i < toRemove.length; i++) {\n this.remove(toRemove[i]);\n }\n }", "function clearStorms(mode) {\n // remove storms\n svg.selectAll(\"g.storm\").remove();\n \n // remove annotations\n svg.select('#annotations').remove();\n }", "function uncreateSlider() {\n if ($('.tops-container').hasClass('slick-slider')) {\n $('.tops-container').slick('unslick');\n }\n if ($('.bottoms-container').hasClass('slick-slider')) {\n $('.bottoms-container').slick('unslick');\n }\n if ($('dresses-container').hasClass('slick-slider')) {\n $('.dresses-container').slick('unslick');\n }\n if ($('.shoes-container').hasClass('slick-slider')) {\n $('.shoes-container').slick('unslick');\n }\n}", "clearScene(){\n $objs.spritesFromScene.forEach(cage => {\n $stage.scene.removeChild(cage);\n $objs.LIST[cage.dataObj._id] = void 0;\n });\n $objs.spritesFromScene = [];\n }", "function cleanup() {\r\n observer && observer.disconnect();\r\n removeEvent(wheelEvent, wheel);\r\n removeEvent('mousedown', mousedown);\r\n removeEvent('keydown', keydown);\r\n removeEvent('resize', refreshSize);\r\n removeEvent('load', init);\r\n}", "function cleanup() {\r\n observer && observer.disconnect();\r\n removeEvent(wheelEvent, wheel);\r\n removeEvent('mousedown', mousedown);\r\n removeEvent('keydown', keydown);\r\n removeEvent('resize', refreshSize);\r\n removeEvent('load', init);\r\n}", "componentWillUnmount() {\n window.removeEventListener('angleChangedTemp', this.updateTemp);\n window.removeEventListener('angleChangedColour', this.updateColour);\n window.removeEventListener('angleChangedKnob', this.updateKnob);\n window.removeEventListener('wheel', this.handleWheel);\n this.service.stop();\n }", "function removeAllHandlers() {\r\n $(\"canvas\").each(function (i, obj) {\r\n $(`#${obj.id}`).off();\r\n $(`#${obj.parentElement.id}`).off();\r\n });\r\n }", "resetGUI() {\n if (!this.sceneInited) return;\n\n this.interface.gui.remove(this.currentViewGUI);\n this.interface.gui.remove(this.ambientViewGUI);\n\n Object.keys(this.lightsGUI).forEach(k => {\n this.interface.gui.remove(this.lightsGUI[k]);\n });\n this.lightsGUI = {};\n }", "stop () {\n // Stop the animation frame loop\n window.cancelAnimationFrame(this._animationFrame)\n // Delete element, if initiated\n if (this.canvas) {\n this.canvas.outerHTML = ''\n delete this.canvas\n }\n if (this.stats) {\n document.querySelector('body').removeChild(this.stats.dom)\n delete this.stats\n }\n // Remove Gui, if initiated\n if (this._gui) {\n this._gui.domElement.removeEventListener('touchmove', this._preventDefault)\n this._gui.destroy()\n }\n // Remove all event listeners\n Object.keys(this._events).forEach(event => {\n if (this._events[event].disable) {\n this._events[event].disable.removeEventListener(event, this._preventDefault)\n }\n this._events[event].context.removeEventListener(event, this._events[event].event.bind(this))\n })\n }", "_removeEventListeners() {\n this.currentEventListeners.forEach(listener => {\n this.domElement.removeEventListener(listener.event, listener.callBack);\n });\n this.currentEventListeners = null;\n }", "removeActiveSlider(){\n for(var oneKindBlock = 0; oneKindBlock < this.kindSliders.length; oneKindBlock++){\n this.kindSliders[oneKindBlock].classList.remove(\"active\");\n }\n }", "function cleanup() {\n observer && observer.disconnect();\n removeEvent(wheelEvent, wheel);\n removeEvent('mousedown', mousedown);\n removeEvent('keydown', keydown);\n removeEvent('resize', refreshSize);\n removeEvent('load', init);\n}", "function cleanup() {\n observer && observer.disconnect();\n removeEvent(wheelEvent, wheel);\n removeEvent('mousedown', mousedown);\n removeEvent('keydown', keydown);\n removeEvent('resize', refreshSize);\n removeEvent('load', init);\n}", "function clearDynamicControls() {\n // Remove any existing opacity sliders.\n $('.opacity-slider').remove();\n $('.dynamic-label').remove();\n $('.dynamic-color-picker').remove();\n $('.dynamic-span').remove();\n}", "function Start () {\n\t\n // Turn off the left C's mesh collider\n\tc2Left.GetComponent.<MeshCollider>().enabled = false;\n\tc3Left.GetComponent.<MeshCollider>().enabled = false;\n\tc4Left.GetComponent.<MeshCollider>().enabled = false;\n\tc5Left.GetComponent.<MeshCollider>().enabled = false;\n\tc6Left.GetComponent.<MeshCollider>().enabled = false;\n\tc7Left.GetComponent.<MeshCollider>().enabled = false;\n\tc8Left.GetComponent.<MeshCollider>().enabled = false;\n\t\n // Turn off the right C's mesh collider\n\tc2Right.GetComponent.<MeshCollider>().enabled = false;\n\tc3Right.GetComponent.<MeshCollider>().enabled = false;\n\tc4Right.GetComponent.<MeshCollider>().enabled = false;\n\tc5Right.GetComponent.<MeshCollider>().enabled = false;\n\tc6Right.GetComponent.<MeshCollider>().enabled = false;\n\tc7Right.GetComponent.<MeshCollider>().enabled = false;\n\tc8Right.GetComponent.<MeshCollider>().enabled = false;\n\t\n\t// Turn off the halos\n\tclickedSpotHalo.enabled = false;\n\tclickedSpotHalo2.enabled = false;\n\tclickedSpotHalo3.enabled = false;\n\t\n // Turn off the left C's light\n\tc2Left.GetComponent.<Light>().enabled = false;\n\tc3Left.GetComponent.<Light>().enabled = false;\n\tc4Left.GetComponent.<Light>().enabled = false;\n\tc5Left.GetComponent.<Light>().enabled = false;\n\tc6Left.GetComponent.<Light>().enabled = false;\n\tc7Left.GetComponent.<Light>().enabled = false;\n\t\n // Turn off the right C's light\n\tc2Right.GetComponent.<Light>().enabled = false;\n\tc3Right.GetComponent.<Light>().enabled = false;\n\tc4Right.GetComponent.<Light>().enabled = false;\n\tc5Right.GetComponent.<Light>().enabled = false;\n\tc6Right.GetComponent.<Light>().enabled = false;\n\tc7Right.GetComponent.<Light>().enabled = false;\n\t\t\n\t\t\n}", "function cleanup() {\n observer && observer.disconnect();\n removeEvent(wheelEvent, wheel);\n removeEvent('mousedown', mousedown);\n removeEvent('keydown', keydown);\n removeEvent('resize', refreshSize);\n removeEvent('load', init);\n }", "function cleanup() {\n observer && observer.disconnect();\n removeEvent(wheelEvent, wheel);\n removeEvent('mousedown', mousedown);\n removeEvent('keydown', keydown);\n removeEvent('resize', refreshSize);\n removeEvent('load', init);\n }", "function cleanup() {\n observer && observer.disconnect();\n removeEvent(wheelEvent, wheel);\n removeEvent('mousedown', mousedown);\n removeEvent('keydown', keydown);\n removeEvent('resize', refreshSize);\n removeEvent('load', init);\n }", "function removeVehicles() {\n Object.keys(vehicles).map(function(k) {\n vehicles[k].setMap(null);\n });\n has_vehicles = false;\n vehicles = {};\n }", "removeFromScene(scene, isUpdating) {\n this.objects.forEach((obj) => {\n scene.remove(obj, true);\n });\n if (!isUpdating) {\n scene.remove(this.cursor, true);\n }\n }", "remove() {\r\n\t\t\tif (this.body) this.p.world.destroyBody(this.body);\r\n\t\t\tthis.removed = true;\r\n\r\n\t\t\t//when removed from the \"scene\" also remove all the references in all the groups\r\n\t\t\twhile (this.groups.length > 0) {\r\n\t\t\t\tthis.groups[0].remove(this);\r\n\t\t\t}\r\n\t\t}", "static removeGrowlers(){\n\n Growler.growlers.forEach(function(growlerItem){\n\n growlerItem.destroy();\n });\n }", "destroy() {\n window.removeEventListener('resize', this.handleWindowResize);\n this.freeAreaCollection.removeAllListeners();\n this.keepoutAreaCollection.removeAllListeners();\n this.canvasElement.removeEventListener('wheel', this.handleZoom);\n this.scope.project.remove();\n }", "function cleanup () {\n angular.element($window).off('resize', positionDropdown);\n if ( elements ){\n var items = 'ul scroller scrollContainer input'.split(' ');\n angular.forEach(items, function(key){\n elements.$[key].remove();\n });\n }\n }", "remove() {\n if (this.removable) {\n this.removed.emit({ chip: this });\n }\n }", "destroy() {\n nodes.splice(nodes.indexOf(el), 1);\n }", "removeDragListeners() {}", "removeDragListeners() {}", "remove(simulator) {\n let simulators = this._simulators;\n let remaining = simulators.filter(s => s !== simulator);\n this._simulators = remaining;\n if (remaining.length !== simulators.length) {\n this.emitUpdated();\n }\n }", "function removeSpring_updateFall() {\n\t\t//remove all rects of spring 18\n\t\td3.selectAll('.s18Histogram').remove();\n\n\t\tupdateFall();\n\t}", "destroy() {\n if (this._dom.tool !== null) {\n\n // Remove event listeners\n $.ignore(\n document,\n {\n 'mousemove touchmove': this._handlers.drag,\n 'mouseout mouseup touchend': this._handlers.endDrag\n }\n )\n\n $.ignore(\n document,\n {\n 'mousemove touchmove': this._handlers.resize,\n 'mouseout mouseup touchend': this._handlers.endResize\n }\n )\n\n // Remove the area, region, frame, image and controls\n this._dom.container.removeChild(this._dom.tool)\n this._dom.controls = null\n this._dom.frame = null\n this._dom.image = null\n }\n }", "destroy() {\n if (this.world !== undefined) {\n this.car.getComponent('car').fitness = 0\n this.car.getComponent('car').frontWheel.steerValue = 0\n let body = this.car.getComponent('physics').body\n fillNaN(body, 0.0)\n body.allowSleep = false\n if (body.sleepState === p2.Body.SLEEPING) {\n body.wakeUp()\n }\n body.setZeroForce()\n body.position = [this.position[0], this.position[1]]\n body.angularVelocity = 0\n body.velocity = [0, 0]\n body.angle = 0\n this.roadDirector.reset()\n } else {\n this.position = [400, 400]\n this.velocity = [0, 0]\n }\n }", "off() {\n\t\tthis._lamps.off();\n\t}", "_onRemove() {\n RB.DnDUploader.instance.unregisterDropTarget(this.$el);\n }", "function Start () {\n\tfor (var component : Behaviour in componentsToDisable){\n\t\tcomponent.enabled = false;\n\t}\n\tif (gameObject.collider != null){\n\t\tcollider.enabled = false;\n\t}\n}", "removeMarkers() {\n this.control.rotateSpeed = 0.1;\n if (this.markers && this.markers.length) {\n for (var i = this.markers.length - 1; i >= 0; i--) {\n this.scene.remove(this.markers[i]);\n }\n }\n }", "removeEventListeners() {\r\n this.elementListener.removeEventListener(\"mouseenter\", this.onMouseEnterBind);\r\n this.elementListener.removeEventListener(\"mouseleave\", this.onMouseLeaveBind);\r\n this.elementListener.removeEventListener(\"mousemove\", this.onMouseMoveBind);\r\n \r\n if (this.gyroscope) {\r\n window.removeEventListener(\"deviceorientation\", this.onDeviceOrientationBind);\r\n }\r\n \r\n if (this.glare || this.fullPageListening) {\r\n window.removeEventListener(\"resize\", this.onWindowResizeBind);\r\n }\r\n }", "_removeHandleListeners() {\n this._startHandle.on(\".drag\", null);\n this._endHandle.on(\".drag\", null);\n }", "function removeWeenie(){\n\t\t$(\"#\"+ hole).removeClass(\"add_weenie\");\n\t}", "_cleanToRemovedListeners() {\n const toRemovedListeners = this._toRemovedListeners;\n\n for (let i = 0; i < toRemovedListeners.length; ++i) {\n const selListener = toRemovedListeners[i];\n\n const listeners = this._listenersMap[selListener._getListenerID()];\n\n if (!listeners) {\n continue;\n }\n\n const fixedPriorityListeners = listeners.getFixedPriorityListeners();\n const sceneGraphPriorityListeners = listeners.getSceneGraphPriorityListeners();\n\n if (sceneGraphPriorityListeners) {\n const idx = sceneGraphPriorityListeners.indexOf(selListener);\n\n if (idx !== -1) {\n sceneGraphPriorityListeners.splice(idx, 1);\n }\n }\n\n if (fixedPriorityListeners) {\n const idx = fixedPriorityListeners.indexOf(selListener);\n\n if (idx !== -1) {\n fixedPriorityListeners.splice(idx, 1);\n }\n }\n }\n\n toRemovedListeners.length = 0;\n }", "reset () {\n this._ports = [];\n this._motors = [];\n this._sensors = {\n tiltX: 0,\n tiltY: 0,\n color: BoostColor.NONE,\n previousColor: BoostColor.NONE\n };\n\n if (this._pingDeviceId) {\n window.clearInterval(this._pingDeviceId);\n this._pingDeviceId = null;\n }\n }", "detach() {\n this.draggable.off('drag:start', this[onDragStart]).off('drag:move', this[onDragMove]).off('drag:stop', this[onDragStop]).off('mirror:created', this[onMirrorCreated]).off('mirror:move', this[onMirrorMove]);\n }", "destroy () {\n\n this.particles.forEach((particle) => {\n\n this.emit('particle.destroy', particle)\n })\n\n this.recycleBin = []\n this.particles = []\n }", "clearFromeScene()\r\n {\r\n for (var i=0;i<this.segMeshes.length;i++)\r\n {\r\n scene.remove(this.segMeshes[i]);\r\n }\r\n //alert(this.leafMeshes.length + \" \" +this.segMeshes.length);\r\n for (var i=0;i<this.leafMeshes.length;i++)\r\n {\r\n //alert(\"hm\");\r\n scene.remove(this.leafMeshes[i]);\r\n }\r\n }", "function removerBlocos(update,obj){\n\t\tif (update==\"sim\") {\n\t\t\tcm.setValue($(obj).attr('data-code'));\n\t\t\t$(obj).toggleClass('pulse');\n\t\t} else {\n\t\t\t$(obj).parent().remove();\n\t\t}\n\t}", "updateLasers() {\n this.lasers.forEach((laser, index) => {\n if (laser.position.y <= 0 || laser.collided) {\n this.lasers.splice(index, 1);\n }\n });\n }", "deconstruct () {\r\n this.removeChild(this.title)\r\n\r\n for (let button of this.buttons) {\r\n this.removeChild(button)\r\n }\r\n\r\n for (let axis of this.axis) {\r\n this.removeChild(axis)\r\n }\r\n }", "removeRoom(roomname, playerIDs, reason, roomType) {\n if (roomType === \"play\" || roomType === \"game_end\") {\n delete this.playrooms[roomname];\n delete this.map[roomname];\n }\n else if (roomType === \"wait\"){\n delete this.waitrooms[roomname];\n delete this.map[roomname];\n }\n delete this.cameras[roomname];\n playerIDs.forEach((playerID, index) => {\n this.sockets[playerID].emit(Constants.MSG_TYPES.GAME_OVER, reason[index]);\n this.removePlayer(this.sockets[playerID]);\n });\n }", "detach() {\n this.draggable.off('mirror:created', this[onMirrorCreated]).off('mirror:destroy', this[onMirrorDestroy]).off('drag:over', this[onDragOver]).off('drag:over:container', this[onDragOver]);\n }", "reset()\n {\n for(var i = 0; i < this.trucks.length; i++)\n {\n gameNs.game.collisionManager.removePolygonCollider(this.trucks[i].collider);\n gameNs.game.collisionManager.removePolygonCollider(this.trucks[i].colliderBigLeft);\n gameNs.game.collisionManager.removePolygonCollider(this.trucks[i].colliderBigRight);\n\n }\n this.trucks = [];\n for(var i = 0; i < this.motorcycles.length; i++)\n {\n gameNs.game.collisionManager.removePolygonCollider(this.motorcycles[i].collider);\n gameNs.game.collisionManager.removePolygonCollider(this.motorcycles[i].colliderBigLeft);\n gameNs.game.collisionManager.removePolygonCollider(this.motorcycles[i].colliderBigRight);\n\n }\n this.motorcycles = [];\n for(var i = 0; i < this.spikeCars.length; i++)\n {\n gameNs.game.collisionManager.removePolygonCollider(this.spikeCars[i].colliderSpikeLeft);\n gameNs.game.collisionManager.removePolygonCollider(this.spikeCars[i].colliderSpikeRight);\n gameNs.game.collisionManager.removePolygonCollider(this.spikeCars[i].collider);\n gameNs.game.collisionManager.removePolygonCollider(this.spikeCars[i].colliderBigRight);\n gameNs.game.collisionManager.removePolygonCollider(this.spikeCars[i].colliderBigLeft);\n\n }\n this.spikeCars = [];\n if(this.helicopter.length === 1)\n {\n gameNs.game.collisionManager.removePolygonCollider(this.helicopter[0].collider);\n this.helicopter = [];\n }\n this.helicopterSpawnTicks = 0;\n for(var i = 0; i < this.powerTrucks.length; i++)\n {\n gameNs.game.collisionManager.removePolygonCollider(this.powerTrucks[i].collider);\n gameNs.game.collisionManager.removePolygonCollider(this.powerTrucks[i].colliderBigLeft);\n gameNs.game.collisionManager.removePolygonCollider(this.powerTrucks[i].colliderBigRight);\n gameNs.game.collisionManager.removePolygonCollider(this.powerTrucks[i].colliderTruck);\n }\n this.powerTrucks = [];\n for(var i = 0; i < this.respawnTrucks.length; i++)\n {\n gameNs.game.collisionManager.removePolygonCollider(this.respawnTrucks[i].collider);\n gameNs.game.collisionManager.removePolygonCollider(this.respawnTrucks[i].truckBig);\n }\n this.respawnTrucks = [];\n this.respawnTrucks.push(new RespawnTruck(400,1000));\n }", "removeAllParticles () {\r\n\t\tthis.particles = [];\r\n\t}", "removeListener() {\n document.getElementById('banner-picture').removeEventListener('mousedown', this.mouseDownHandler);\n document.removeEventListener('mouseup', this.mouseUpHandler);\n document.getElementById('banner-picture').removeEventListener('mouseenter', this.mouseEnterHandler);\n document.getElementById('banner-picture').removeEventListener('mousemove', this.mouseMoveHandler);\n }", "cleanScene(callBack) {\n var modules = this.sceneCurrent.getModules();\n while (modules.length != 0) {\n if (modules[0].patchID != \"output\" && modules[0].patchID != \"input\") {\n modules[0].deleteModule();\n }\n else if (modules[0].patchID == \"output\") {\n modules.shift();\n }\n else if (modules[0].patchID == \"input\") {\n modules.shift();\n }\n }\n callBack();\n }", "function delete_actuator(clicked_id){\n\n\tvar index = 0;\n\tvar div_actuator = \"\";\n\tvar conf=true;\n\n\tfor(u=0; u<actuators_of_room.length; u++){\n\t\tif (clicked_id == \"delete_\"+actuators_of_room[u]) {\n\t \tdiv_actuator = \"div_act_\" +actuators_of_room[u];\n\t \tindex = u;\n\t }\n\t}\n\n\t//remove from array\n\tactuators_of_room.splice(index,1);\n\n\t//update DOM\n\tvar childnode = document.getElementById(div_actuator);\n var removednode = document.getElementById(\"actuator_selected\").removeChild(childnode);\n\n //add elements in select - options\n \tfor(q=0; q<actuators_to_hide.length; q++){\n\t\tif (clicked_id == \"delete_\"+actuators_to_hide[q]) {\n\t \tindex = q;\n\t }\n\t}\n\tactuators_to_hide.splice(index,1);\n\tshow_options();\n\n\t//save on \"room_config.txt\" file\n\tsave_config_for_room();\n\n}", "function removeMouseListeners(slider) {\n slider.removeEventListener('mouseover', handleMouseover);\n slider.removeEventListener('mouseout', handleMouseout);\n }" ]
[ "0.72755295", "0.6683488", "0.65936196", "0.65030766", "0.64949393", "0.6344875", "0.6318425", "0.6316633", "0.6276058", "0.62344694", "0.6206997", "0.61592376", "0.61512053", "0.61511254", "0.6080284", "0.6074063", "0.6061584", "0.6045986", "0.6041882", "0.6041493", "0.6034999", "0.6010013", "0.6008964", "0.59891385", "0.5973563", "0.5972296", "0.596648", "0.59635735", "0.5961526", "0.5951682", "0.59511477", "0.5936923", "0.5934744", "0.59301066", "0.591382", "0.5913353", "0.5913353", "0.58986247", "0.58971924", "0.58931917", "0.5882347", "0.5876591", "0.5868217", "0.58636886", "0.58490056", "0.5842633", "0.5841489", "0.5838528", "0.5833464", "0.5833464", "0.5824498", "0.58058345", "0.57950354", "0.5785385", "0.5781904", "0.57787544", "0.57667196", "0.57667196", "0.57600164", "0.57537645", "0.5750377", "0.5750377", "0.5750377", "0.5750178", "0.5749982", "0.57496756", "0.5748221", "0.574565", "0.5729373", "0.5729349", "0.5724495", "0.5720539", "0.5720539", "0.5717621", "0.5712186", "0.5710451", "0.5707791", "0.5705358", "0.57034975", "0.5695585", "0.569535", "0.5693229", "0.56931245", "0.5685775", "0.56855214", "0.56841683", "0.56756574", "0.5673898", "0.5673525", "0.56701326", "0.566908", "0.5668936", "0.5659651", "0.5659361", "0.56586784", "0.56547934", "0.5651728", "0.5650815", "0.56503993", "0.5647413" ]
0.5753151
60
Clones the collider's props to be transferred to a new collider.
_cloneBodyProps() { let body = {}; let props = [...spriteProps]; let deletes = [ 'w', 'h', 'width', 'height', 'shape', 'd', 'diameter', 'dynamic', 'static', 'kinematic', 'collider', 'heading', 'direction' ]; for (let del of deletes) { let i = props.indexOf(del); if (i >= 0) props.splice(i, 1); } for (let prop of props) { body[prop] = this[prop]; } return body; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set collider(value) {}", "get collider() {}", "clone() {\n const triggerMesh = super.clone();\n triggerMesh.material = this.material.clone();\n triggerMesh.hover = this.hover;\n triggerMesh.exit = this.exit;\n triggerMesh.select = this.select;\n triggerMesh.release = this.release;\n triggerMesh.functions = this.functions;\n return triggerMesh;\n }", "_resizeCollider(scale) {\r\n\t\t\tif (!this.body) return;\r\n\r\n\t\t\tif (typeof scale == 'number') {\r\n\t\t\t\tscale = { x: scale, y: scale };\r\n\t\t\t} else {\r\n\t\t\t\tif (!scale.x) scale.x = 1;\r\n\t\t\t\tif (!scale.y) scale.y = 1;\r\n\t\t\t}\r\n\t\t\tif (this.shape == 'circle') {\r\n\t\t\t\tlet fxt = this.fixture;\r\n\t\t\t\tlet sh = fxt.m_shape;\r\n\t\t\t\tsh.m_radius *= scale.x;\r\n\t\t\t} else {\r\n\t\t\t\t// let bodyProps = this._cloneBodyProps();\r\n\t\t\t\t// this.removeColliders();\r\n\t\t\t\t// this.addCollider();\r\n\t\t\t\t// for (let prop in bodyProps) {\r\n\t\t\t\t// \tthis[prop] = bodyProps[prop];\r\n\t\t\t\t// }\r\n\r\n\t\t\t\tfor (let fxt = this.fixtureList; fxt; fxt = fxt.getNext()) {\r\n\t\t\t\t\tif (fxt.m_isSensor) continue;\r\n\t\t\t\t\tlet sh = fxt.m_shape;\r\n\t\t\t\t\tfor (let vert of sh.m_vertices) {\r\n\t\t\t\t\t\tvert.x *= scale.x;\r\n\t\t\t\t\t\tvert.y *= scale.y;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "removeColliders() {\r\n\t\t\tthis._collides = {};\r\n\t\t\tthis._colliding = {};\r\n\t\t\tthis._collided = {};\r\n\t\t\tthis._removeFixtures(false);\r\n\t\t}", "ClearCollider() {\n if (this.COLLIDER == undefined) return;\n \n this.COLLIDER.Disable();\n this.COLLIDER = undefined;\n \n return this;\n }", "set Collide(value) {}", "addCollider(obj) {\n this.colliders.push(obj);\n }", "function Reset ()\n{\n\tif (collider == null)\n\t\tgameObject.AddComponent(BoxCollider);\n\tcollider.isTrigger = true;\n}", "initialize() {\n this.structure.map((obj) => {\n obj.gameObject = new obj.className({\n ...obj.properties,\n ctx: state.canvas.getContext('2d')\n })\n });\n }", "function CloneToSelectedTemp( SELECTED ){\n /* scope._MATERIAL_COLOR = new Vector3(SELECTED.children[0].children[0].material.color.r, \n SELECTED.children[0].children[0].material.color.g,\n SELECTED.children[0].children[0].material.color.b) */\n\n scope._SELECTED_TEMP = SELECTED.clone();\n scope._SELECTED_TEMP.box = new Box3().setFromObject( scope._SELECTED_TEMP );\n scope._SELECTED_TEMP.updateMatrixWorld( true );\n //scope._SELECTED_TEMP.helper = new BoxHelper( scope._SELECTED_TEMP, 0xffff00 );\n\n\n //scope._SELECTED_TEMP.helper.material.visible = true;\n //scope._SELECTED_TEMP.helper.matrixAutoUpdate = true;\n //scope._SELECTED_TEMP.helper.update();\n\n /* if(scope._SELECTED_TEMP.children[0].children[0] instanceof Group){\n for(let i = 0; i < scope._SELECTED_TEMP.children[0].children[0].length; i++){\n scope._SELECTED_TEMP.children[0].children[0].children[i].material.color.setHex(0x00ff00);\n }\n }else scope._SELECTED_TEMP.children[0].children[0].material.color.setHex(0x00ff00); */\n //scope._SELECTED_TEMP.children[0].children[1].material.color.setHex(0x00ff00);\n\n props.scene.add( scope._SELECTED_TEMP );\n //props.scene.add( scope._SELECTED_TEMP.helper );\n\n scope._isMoved = true;\n }", "set addCollider(value) {}", "set otherCollider(value) {}", "static init() {\n if (!this._initialized) {\n Collider._colliders = [];\n // Collider.timePerCheck = 1000 / Collider.checksPerSecond;\n this._initialized = true;\n }\n }", "Copy()\n\t{\n\t\tlet mani = new ContactManifold(this.ColA, this.ColB);\n\t\tmani.Normal = this.Normal;\n\t\tmani.Hit = this.Hit;\n\t\tmani.Penetration = this.Penetration;\n\t\treturn mani;\n\t}", "clonePinball() {\n this.pinballCloneTone.play();\n\n // Generate a random number between 1 and 5\n const cloneAmount = Math.floor(Math.random(1) * 5) + 1;\n const pinballClones = [];\n for (let i = 0; i < cloneAmount; i++) {\n pinballClones[i] = this.matter.add.sprite(this.centerX - 160, 390, 'pinball', null, { shape: this.shapes.pinball });\n }\n\n // Set Properties on created pinballs\n pinballClones.forEach((pinballClone) => {\n\n pinballClone.setDepth(2);\n pinballClone.setFriction(0, 0, 7); \n pinballClone.setVelocity(1, 3); //5\n pinballClone.setBounce(0.1);\n pinballClone.setScale(1);\n\n // Add Collisons\n this.matterCollision.addOnCollideStart({ objectA: pinballClone, objectB: this.pinballHole, callback: () => {\n pinballClone.destroy();\n }});\n\n this.matterCollision.addOnCollideStart({ objectA: pinballClone, objectB: this.captinAmericaBumper, callback: () => {\n this.setPoint('captinAmericaBumper');\n this.captinAmericaBumperHit.play();\n this.sparkParticles.emitParticleAt(pinballClone.x, pinballClone.y, 50);\n }});\n });\n }", "change_properties() {\n\t\t// The currently selected object:\n\n\t\tthis.currently_selected_entity.collision_box.x = parseInt(EZGUI.components.entity_change_x_value.text);\n\t\tthis.currently_selected_entity.collision_box.y = parseInt(EZGUI.components.entity_change_y_value.text);\n\t\tvar given_width = parseInt(EZGUI.components.entity_change_width_value.text);\n\t\tvar given_height = parseInt(EZGUI.components.entity_change_height_value.text); \n\t\tthis.currently_selected_entity.collision_box.width = given_width;\n\t\tthis.currently_selected_entity.collision_box.height = given_height;\n\t\tthis.currently_selected_entity.id = EZGUI.components.entity_change_id_value.text;\n\n\t\t// modify the sprite scaling based on this:\n\n\t\t// have they changed the image?\n\t\tvar selected_path =EZGUI.components.entity_change_sprite_path_value.text;\n\t\tvar sprite = this.currently_selected_entity.sprite;\n\t\tvar platform_sprite;\n\t\tvar scale_x, scale_y;\n\t\tif ( this.currently_selected_entity.image_path === EZGUI.components.entity_change_sprite_path_value.text)\n\t\t{\n\t\t\tscale_x = given_width / sprite.texture.width;\n\t\t\tscale_y = given_height / sprite.texture.height;\n\t\t} \n\t\telse \n\t\t{\n\t\t\t// they changed the image\n\t\t\tsprite = new PIXI.Sprite( PIXI.loader.resources[selected_path].texture);\n\t\t\tthis.currently_selected_entity.sprite = sprite;\t\n\t\t\tthis.currently_selected_entity.image_path = selected_path;\t\n\t\t\tscale_x = given_width / sprite.texture.width;\n\t\t\tscale_y = given_height / sprite.texture.height;\n\t\t}\n\n\t\t// find the proportions necessary to scale the sprite to the given widht/height\n\t\tsprite.scale.set(scale_x, scale_y);\n\n\n\t}", "function OnCollisionEnter2D(clone: Collision2D)\n\t{\n\t\t//if collider name is bullet clone..\n\t\tif(clone.collider.name == \"bullet(Clone)\") \n\t\t{\n\t\t\t//destroy bullet on impact.\n\t\t\tDestroy(clone.gameObject);\n\t\t}\n\t}", "setDefaultCollider() {\n\t\t\t\t//if has animation get the animation bounding box\n\t\t\t\t//working only for preloaded images\n\t\t\t\tif (this.animation && this.animation.getWidth() != 1 && this.animation.getHeight() != 1) {\n\t\t\t\t\tthis.collider = this.getBoundingBox();\n\t\t\t\t\tthis._internalWidth = this.animation.getWidth() * abs(this._getScaleX());\n\t\t\t\t\tthis._internalHeight = this.animation.getHeight() * abs(this._getScaleY());\n\t\t\t\t\t//quadTree.insert(this);\n\t\t\t\t\tthis.colliderType = 'image';\n\t\t\t\t\t//print(\"IMAGE COLLIDER ADDED\");\n\t\t\t\t} else if (this.animation && this.animation.getWidth() === 1 && this.animation.getHeight() === 1) {\n\t\t\t\t\t//animation is still loading\n\t\t\t\t\t//print(\"wait\");\n\t\t\t\t} //get the with and height defined at the creation\n\t\t\t\telse if (this.shape == 'circle') {\n\t\t\t\t\tthis.setCollider('circle');\n\t\t\t\t} else {\n\t\t\t\t\tthis.collider = new AABB(this.position, this.p.createVector(this._internalWidth, this._internalHeight));\n\t\t\t\t\t//quadTree.insert(this);\n\t\t\t\t\tthis.colliderType = 'default';\n\t\t\t\t}\n\n\t\t\t\tthis.p.quadTree.insert(this);\n\t\t\t}", "function cloneProps (src, list) {\n return list.reduce(function (o, p) {\n if (p in src) { o[p] = clone(src[p]); }\n return o\n }, {})\n}", "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n }", "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n }", "function copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n }", "function copyProps(src,dst){for(var key in src){dst[key]=src[key];}}", "function copyProps(src,dst){for(var key in src){dst[key]=src[key];}}", "function copyProps(src,dst){for(var key in src){dst[key]=src[key];}}", "function copyProps(src,dst){for(var key in src){dst[key]=src[key]}}", "function Start()\n{\n\tcol=gameObject.GetComponent(BoxCollider2D);\n}", "constructor(scale=null, collisionLayer='default', trigger=false) {\n\t\tsuper();\n\n\t\tif(!scale) {\n\t\t\tscale = Vector2.one;\n\t\t}\n\n\t\tthis.componentName = 'Collider';\n\n\t\tthis.collisionLayer = collisionLayer;\n\t\tthis.collidingWith = [];\n\t\tthis.trigger = trigger;\n\t\tthis.scale = scale;\n\n\t\tCollider.colliderList.push(this);\n\t}", "extend(props) {\r\n const clone = this.clone()\r\n\r\n Object.assign(clone.props, props)\r\n\r\n return clone\r\n }", "clone(entity, clone) {\n var src = this.system.store[entity.getGuid()];\n\n var data = {\n enabled: src.data.enabled,\n type: src.data.type,\n halfExtents: [src.data.halfExtents.x, src.data.halfExtents.y, src.data.halfExtents.z],\n radius: src.data.radius,\n axis: src.data.axis,\n height: src.data.height,\n asset: src.data.asset,\n renderAsset: src.data.renderAsset,\n model: src.data.model,\n render: src.data.render\n };\n\n return this.system.addComponent(clone, data);\n }", "componentWillReceiveProps(newProps) {\n this.updateD3(newProps);\n }", "componentWillReceiveProps(newProps) {\n this.updateD3(newProps);\n }", "enableColliders(){\n this.colliderShapes.forEach((e)=>{\n e.setEnabled(true);\n });\n }", "disableColliders(){\n this.colliderShapes.forEach((e)=>{\n e.setEnabled(false);\n });\n }", "transferDisplayObjectPropsByName(oldProps, newProps, propsToCheck) {\n let displayObject = this._displayObject;\n for (var propname in propsToCheck) {\n if (typeof newProps[propname] !== 'undefined') {\n setPixiValue(displayObject, propname, newProps[propname]);\n } else if (typeof oldProps[propname] !== 'undefined' &&\n typeof propsToCheck[propname] !== 'undefined') {\n // the field we use previously but not any more. reset it to\n // some default value (unless the default is undefined)\n setPixiValue(displayObject, propname, propsToCheck[propname]);\n }\n }\n\n // parse Point-like prop values\n gPointLikeProps.forEach(function(propname) {\n if (typeof newProps[propname] !== 'undefined') {\n setPixiValue(displayObject, propname, newProps[propname]);\n }\n })\n }", "reset()\n {\n for(var i = 0; i < this.trucks.length; i++)\n {\n gameNs.game.collisionManager.removePolygonCollider(this.trucks[i].collider);\n gameNs.game.collisionManager.removePolygonCollider(this.trucks[i].colliderBigLeft);\n gameNs.game.collisionManager.removePolygonCollider(this.trucks[i].colliderBigRight);\n\n }\n this.trucks = [];\n for(var i = 0; i < this.motorcycles.length; i++)\n {\n gameNs.game.collisionManager.removePolygonCollider(this.motorcycles[i].collider);\n gameNs.game.collisionManager.removePolygonCollider(this.motorcycles[i].colliderBigLeft);\n gameNs.game.collisionManager.removePolygonCollider(this.motorcycles[i].colliderBigRight);\n\n }\n this.motorcycles = [];\n for(var i = 0; i < this.spikeCars.length; i++)\n {\n gameNs.game.collisionManager.removePolygonCollider(this.spikeCars[i].colliderSpikeLeft);\n gameNs.game.collisionManager.removePolygonCollider(this.spikeCars[i].colliderSpikeRight);\n gameNs.game.collisionManager.removePolygonCollider(this.spikeCars[i].collider);\n gameNs.game.collisionManager.removePolygonCollider(this.spikeCars[i].colliderBigRight);\n gameNs.game.collisionManager.removePolygonCollider(this.spikeCars[i].colliderBigLeft);\n\n }\n this.spikeCars = [];\n if(this.helicopter.length === 1)\n {\n gameNs.game.collisionManager.removePolygonCollider(this.helicopter[0].collider);\n this.helicopter = [];\n }\n this.helicopterSpawnTicks = 0;\n for(var i = 0; i < this.powerTrucks.length; i++)\n {\n gameNs.game.collisionManager.removePolygonCollider(this.powerTrucks[i].collider);\n gameNs.game.collisionManager.removePolygonCollider(this.powerTrucks[i].colliderBigLeft);\n gameNs.game.collisionManager.removePolygonCollider(this.powerTrucks[i].colliderBigRight);\n gameNs.game.collisionManager.removePolygonCollider(this.powerTrucks[i].colliderTruck);\n }\n this.powerTrucks = [];\n for(var i = 0; i < this.respawnTrucks.length; i++)\n {\n gameNs.game.collisionManager.removePolygonCollider(this.respawnTrucks[i].collider);\n gameNs.game.collisionManager.removePolygonCollider(this.respawnTrucks[i].truckBig);\n }\n this.respawnTrucks = [];\n this.respawnTrucks.push(new RespawnTruck(400,1000));\n }", "clone() {\n return new CSG(this.polygons.map(p => p.clone()));\n }", "get Collide() {}", "initializeDog(dogToCopy) {\n // todo: not all dog props are being transfered\n this.familiarName = dogToCopy.familiarName;\n this.barkSound = dogToCopy.barkSound;\n this.age = dogToCopy.age;\n this.startupBlog = dogToCopy.startupBlog;\n this.chewUrgeInterval = dogToCopy.chewUrgeInterval;\n }", "function $mkoQ$var$copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "function removeClonesStyle() {\n $('[class*=\"clone-\"]').removeAttr(\"style\");\n $('[class*=\"area-\"]').removeAttr(\"style\");\n $('.cl-middle, .cl-bottom').removeAttr(\"style\");\n }", "get addCollider() {}", "componentWillReceiveProps(newProps){\n this.update_d3(newProps);\n }", "function $udfh$var$copyProps(src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "collisionDetection() {\n if (\n collideRectRect(sliderX,sliderY,30,height,this.x,this.y,this.r,this.r * 2) && sliderSpeed >= 0) {\n this.color = random(160);\n }\n if (collideRectRect(sliderX, sliderY, 30, height, this.x, this.y, this.r, this.r * 2) && sliderSpeed < 0) {\n this.color = random(360);\n }\n }", "cloneElement(){\n const _ = this;\n // console.log('stickIt:cloneElement');\n\n _.$clone = _.$el.cloneNode(true)\n // _.$el.parentElement.appendChild(_.$clone)\n _.$el.parentNode.insertBefore(_.$clone, _.$el.nextSibling);\n\n Object.assign(_.$clone.style, {\n zIndex: '-999',\n visibility: 'hidden'\n });\n\n _.setSizes()\n }", "componentWillReceiveProps(newProps) {\n this.type = newProps.p.parameter_spec.type;\n this.name = newProps.p.parameter_spec.name;\n\n // update form controls to current values\n if (this.stringRef) this.stringRef.value = newProps.p.value;\n if (this.numberRef) this.numberRef.value = newProps.p.value;\n if (this.checkboxRef) this.checkboxRef.value = newProps.p.value;\n }", "function copyProps (src, dst) {\n\t for (var key in src) {\n\t dst[key] = src[key];\n\t }\n\t}", "function copyProps (src, dst) {\n\t for (var key in src) {\n\t dst[key] = src[key];\n\t }\n\t}", "function copyProps (src, dst) {\n\t for (var key in src) {\n\t dst[key] = src[key];\n\t }\n\t}", "function copyProps (src, dst) {\n\t for (var key in src) {\n\t dst[key] = src[key];\n\t }\n\t}", "function copyProps (src, dst) {\n\t for (var key in src) {\n\t dst[key] = src[key];\n\t }\n\t}", "constructor(...args) {\n super(...args);\n\n\n // The following values should get overridden when delta states are merged, but we set them here as a reference for you to see what variables this class has.\n\n // default values for private member values\n this.effectRadius = 0;\n this.materials = 0;\n this.owner = null;\n this.tile = null;\n this.type = '';\n\n //<<-- Creer-Merge: init -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.\n // any additional init logic you want can go here\n //<<-- /Creer-Merge: init -->>\n }", "collisionDetection() {\n if (\n collideRectCircle(sliderX, sliderY, 30, height, this.x, this.y, this.r) &&\n sliderSpeed >= 0\n ) {\n this.color = random(160);\n }\n\n if (\n collideRectCircle(sliderX, sliderY, 30, height, this.x, this.y, this.r) &&\n sliderSpeed < 0\n ) {\n this.color = random(360);\n }\n }", "function copyProps (src, dst) {\n\t for (var key in src) {\n\t dst[key] = src[key]\n\t }\n\t}", "function copyProps (src, dst) {\n\t for (var key in src) {\n\t dst[key] = src[key]\n\t }\n\t}", "function copyProps (src, dst) {\n\t for (var key in src) {\n\t dst[key] = src[key]\n\t }\n\t}", "function copyProps (src, dst) {\n\t for (var key in src) {\n\t dst[key] = src[key]\n\t }\n\t}", "function copyProps (src, dst) {\n\t for (var key in src) {\n\t dst[key] = src[key]\n\t }\n\t}", "function copyProps (src, dst) {\n\t for (var key in src) {\n\t dst[key] = src[key]\n\t }\n\t}", "function copyProps (src, dst) {\n\t for (var key in src) {\n\t dst[key] = src[key]\n\t }\n\t}", "function copyProps (src, dst) {\n\t for (var key in src) {\n\t dst[key] = src[key]\n\t }\n\t}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key];\n }\n}", "function copyProps(src, dst) {\n\t for (var key in src) {\n\t dst[key] = src[key];\n\t }\n\t}", "update() {\n // Se actualiza la posición de la cámara según su controlador\n this.world.update();\n this.ship.update();\n\n // Control de colisiones\n for (var i = 0; i < this.colliders.length; i++)\n this.colliders[i].update();\n\n this.colliderSystem.computeAndNotify(this.colliders);\n\n\n }", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}", "function copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}" ]
[ "0.62071186", "0.58772564", "0.55298156", "0.5427527", "0.5330955", "0.53114337", "0.5295751", "0.5263874", "0.52562857", "0.52020776", "0.5182577", "0.51588017", "0.51169986", "0.50910705", "0.50370175", "0.49785072", "0.49250054", "0.48856843", "0.48817328", "0.48814154", "0.48631796", "0.48574087", "0.4828941", "0.48184365", "0.48184365", "0.48184365", "0.48038292", "0.48019087", "0.4781814", "0.4769847", "0.47694966", "0.47635496", "0.47635496", "0.47561735", "0.47537273", "0.47440317", "0.4721295", "0.47152534", "0.47138655", "0.47091427", "0.46995986", "0.46967286", "0.46928257", "0.46848318", "0.46768394", "0.46742398", "0.46675277", "0.46603307", "0.46574968", "0.46574968", "0.46574968", "0.46574968", "0.46574968", "0.46555993", "0.46463668", "0.46459934", "0.46459934", "0.46459934", "0.46459934", "0.46459934", "0.46459934", "0.46459934", "0.46459934", "0.4644002", "0.4644002", "0.4644002", "0.4644002", "0.46431148", "0.46325132", "0.4628515", "0.4628515", "0.4628515", "0.4628515", "0.4628515", "0.4628515", "0.4628515", "0.4628515", "0.4628515", "0.4628515", "0.4628515", "0.4628515", "0.4628515", "0.4628515", "0.4628515", "0.4628515", "0.4628515", "0.4628515", "0.4628515", "0.4628515", "0.4628515", "0.4628515", "0.4628515", "0.4628515", "0.4628515", "0.4628515", "0.4628515", "0.4628515", "0.4628515", "0.4628515", "0.4628515" ]
0.5001389
15
Returns the first node in a linked list of the planck physics body's fixtures.
get fixture() { return this.fixtureList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get fixtureList() {\r\n\t\t\tif (!this.body) return null;\r\n\t\t\treturn this.body.getFixtureList();\r\n\t\t}", "first(returnNode) {\n let node = this[this._start][this._next];\n return returnNode ? node : node.data;\n }", "getFirst () {\n\t\treturn this.head;\n\t}", "getFirst () {\n\t\treturn this.head;\n\t}", "getFirst () {\n\t\treturn this.head;\n\t}", "first() {\n return this.head.next;\n }", "getFirst() {\n return this.head;\n }", "getFirst() {\n return this.head;\n }", "getFirstRootNode() {\n return this.rootNodes.length > 0 ? this.rootNodes[0] : null;\n }", "function BOT_first(list) {\r\n\tif(list.length>0) return list[0]\r\n\telse return (undefined);\r\n}", "function firstNode()\n {\n var chain = new LinkedList(1000);\n alert('typeof chain.head: ' + typeof chain.head);\n }", "getFirst(){\n return this.head;\n }", "function getFirstBlockElement(rootNode) {\n return getFirstLastBlockElement(rootNode, true /*isFirst*/);\n}", "getNode(pos){\r\n let curr = this.head;\r\n\r\n for(let i = 0; i < this.length; i++){\r\n if(i === pos){\r\n return curr;\r\n }\r\n curr = curr.next;\r\n }\r\n return undefined;\r\n \r\n }", "function first(source) {\n source = Array.isArray(source) ? memset(source) : source;\n return dataset(source, {\n get: function (expressions) {\n expressions = expressions || [];\n let exp = this.dataset.getExpressions().concat(expressions);\n let anyFirst = exp.find(a => core_1.Utility.instanceof(a, expressions_1.Find));\n if (anyFirst) { // eğer find yazılmışşsa tek gelecek demek zaten\n return this.next();\n }\n return this.next(exp.concat(top(1))).then((response) => {\n if (Array.isArray(response))\n return response[0];\n return response;\n });\n }\n });\n}", "peekFirst(){\n if(this.isEmpty()){ return null}\n return this.head.data;\n }", "head() {\n return this.members[0]\n }", "getHeadNode() {\n return this.head\n }", "getNodeAt(index) {\n let next = this.head;\n let tempIndex = 0;\n while (next) {\n if (tempIndex == index) {\n return next;\n } else {\n next = next.next;\n tempIndex++;\n }\n }\n return null;\n }", "function first$get$0() {\n if ( !this.list ) return undefined;\n return this.list[0];\n }", "first(editor, at) {\n var path = Editor.path(editor, at, {\n edge: 'start'\n });\n return Editor.node(editor, path);\n }", "first(editor, at) {\n var path = Editor.path(editor, at, {\n edge: 'start'\n });\n return Editor.node(editor, path);\n }", "function testsFromPickOne(node) {\n var tests = [];\n // child of pick_one is a statement block. we want first child of that\n var statement = node.getElementsByTagName('statement')[0];\n var block = statement.getElementsByTagName('block')[0];\n var next;\n do {\n // if we have a next block, we want to generate our test without that\n next = block.getElementsByTagName('next')[0];\n if (next) {\n block.removeChild(next);\n }\n tests.push(testFromBlock(block));\n if (next) {\n block = next.getElementsByTagName('block')[0];\n }\n } while (next);\n return tests;\n }", "peekFirst() {\n\t\tif (this.isEmpty()) {\n\t\t\tthrow new Error(\"Empty Linked List.\");\n\t\t}\n\t\treturn this.head.value;\n\t}", "function firstNode(source) {\n var node = null;\n if (source.firstChild.nodeName != \"#text\") {\n return source.firstChild;\n } else {\n source = source.firstChild;\n do {\n source = source.nextSibling;\n } while (source && source.nodeName == '#text');\n\n return source || null;\n }\n}", "function DLLHead() {\n\t\t\tif(head == null) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tvar node = head;\n\t\t\treturn node;\n\t\t}", "getNode(nth) {\n if ((nth < 0) || (nth > this.length-1)) {\n return null;\n } else {\n let index = 0;\n let current = this.head;\n while (index !== nth) {\n current = current.next;\n index++;\n }\n return current;\n }\n }", "get first() {\n\t\t\n\t\tif(this.empty) throw \"List is empty\";\n\t\t\n\t\t// $CORRECT_CAST\n\t\treturn this._first.content;\n\t}", "get firstChild() {\n var _a;\n return (_a = this.children[0]) !== null && _a !== void 0 ? _a : null;\n }", "function getFirstLeaf(node) {\n while (node.firstChild && (\n // data-blocks has no offset\n node.firstChild instanceof Element && node.firstChild.getAttribute('data-blocks') === 'true' || getSelectionOffsetKeyForNode(node.firstChild))) {\n node = node.firstChild;\n }\n return node;\n}", "function getFirstLeaf(node) {\n while (node.firstChild && (\n // data-blocks has no offset\n node.firstChild instanceof Element && node.firstChild.getAttribute('data-blocks') === 'true' || getSelectionOffsetKeyForNode(node.firstChild))) {\n node = node.firstChild;\n }\n return node;\n}", "function getFirstLeaf(node) {\n while (node.firstChild && (\n // data-blocks has no offset\n node.firstChild instanceof Element && node.firstChild.getAttribute('data-blocks') === 'true' || getSelectionOffsetKeyForNode(node.firstChild))) {\n node = node.firstChild;\n }\n return node;\n}", "function getFirstLeaf(node) {\n while (node.firstChild && (\n // data-blocks has no offset\n node.firstChild instanceof Element && node.firstChild.getAttribute('data-blocks') === 'true' || getSelectionOffsetKeyForNode(node.firstChild))) {\n node = node.firstChild;\n }\n return node;\n}", "function getFirstLeaf(node) {\n while (node.firstChild && (\n // data-blocks has no offset\n node.firstChild instanceof Element && node.firstChild.getAttribute('data-blocks') === 'true' || getSelectionOffsetKeyForNode(node.firstChild))) {\n node = node.firstChild;\n }\n return node;\n}", "find(index) {\n //let counter = 0;\n let node = this.head;\n while (node !== null) {\n if (node.data === index) {\n return node;\n } else {\n node = node.next;\n }\n }\n return null;\n }", "get firstChild() {\n return this.content.length ? this.content[0] : null;\n }", "peek () {\n return this.head[0]\n }", "_getNodeAt(index){\n if (index < this._length / 2) {\n return this._moveForward(this._dummy.next, index);\n } else {\n return this._moveBackward(this._dummy, this._length - index)\n }\n\n return this._offset(this._dummy.next, index);\n }", "peekFirst() {\n return this.head;\n }", "read() {\n var current = this.head; // set curret as the head, if it exists or not\n\n while (current) { // if current, log and move to current.next\n console.log(current.data);\n current = current.next;\n }\n }", "findMinNode() {\n if (this.head == null && this.tail == null) {\n return undefined;\n }\n\n var runner = this.head\n var temp = runner\n while (runner != null) {\n if ( temp.value > runner.value ){\n temp = runner\n }\n runner = runner.next;\n }\n return temp;\n }", "getAt(index) {\n let counter = 0\n let node = this.head\n while (node) {\n if (counter === index) {\n return node\n }\n counter++\n node = node.next\n }\n return null\n }", "get firstChild() {\n return this.childNodes[0] || null;\n }", "function firstItem (people) {\n console.log(people[0]);\n}", "function firstListItem() {\n return $('ul li:first-child')\n}", "getFirst() {\n if (this.isEmpty()) return; /* TODO: Throw NoSuchElementException */\n return this.head.value;\n }", "findFirst(key) {\n let node = treeFind(this.root, key);\n let preNode = treePredecessor(node);\n while (preNode !== NIL && preNode.key === key) {\n node = preNode;\n preNode = treePredecessor(preNode);\n }\n return node;\n }", "first(func = (item) => item) {\n if (this.rootNode.length >= 1) {\n func(this.get(0), 0);\n return this.get(0);\n }\n return this;\n }", "first(func = (item) => item) {\n if (this.rootNode.length >= 1) {\n func(this.get(0), 0);\n return this.get(0);\n }\n return this;\n }", "get head() { return this.$head.pos }", "searchFirstNode(data) {\n if (!this.head) return null;\n let current = this.head;\n while (current !== null && current.data !== data) {\n current = current.next;\n }\n\n return current;\n }", "getNode(index) {\n let currentNode = this.head;\n for (let i = 1; i <= index; i++) {\n currentNode = currentNode.next;\n }\n return currentNode;\n }", "peek() {\n if (!this._storage.head) {\n throw new Error('__ERROR__ list is empty')\n }\n let currentNode = this._storage.head;\n while (currentNode.next) {\n currentNode = currentNode.next;\n }\n return currentNode;\n }", "find(data: any): Node | false {\n let node = this.head;\n while (node.hasNext()) {\n if (node.data === data) {\n return node;\n }\n node = node.next;\n }\n return false;\n }", "peek() {\n if (this.head) {\n return this.head.data\n } else {\n return null\n }\n }", "function pickOne() {\n let index = 0;\n let r = random(1);\n while (r > 0) {\n r = r - birds[index].fitness;\n index++;\n }\n index--;\n let bird = birds[index];\n return bird.brain;\n}", "function firstListItem(){\n// console.log($('#pic-list:first-child'))\n return $('#pic-list li:first-child')\n}", "function getFirstLeafNode(rootNode) {\n return getLeafNode(rootNode, true /*isFirst*/);\n}", "getFirst(){\n\t\treturn this.group.children.sort((c1, c2) => this.direction * -1 * c1.position.x - this.direction * -1 * c2.position.x)[0]\n\t}", "get(index) {\n if (index > this.length) return null;\n\n let node = this.head;\n\n for (let i = 0; i < this.length; i++) {\n if (i === index) return node;\n node = node.next;\n }\n }", "function findHead(tree) {\n let head = tree;\n if(typeof(tree.nodes)!=\"string\") {\n let headFound = false;\n tree.nodes.forEach((node) => {\n if(!headFound && (node.role==\"Head\"||node.role==\"head\")) {\n head = findHead(node);\n headFound = true;\n } else if(headFound && node.role==\"head\") {\n // head is more important than Head\n head = findHead(node);\n headFound = true;\n }\n });\n if (!headFound) {\n head = findHead(tree.nodes[tree.nodes.length - 1]);\n }\n }\n return head;\n}", "peek(){\n if(!this.linkedList.head){\n return null;\n }\n return this.linkedList.head.value;\n }", "getAt(index) {\n let node = this.head;\n let counter = 0;\n // Will run until either node is null or the node at index is found\n while (node) {\n if (counter === index) {\n return node;\n }\n \n counter++;\n // Move to the next node\n node = node.next;\n }\n // Return null if the index is out of range of the size of the list\n // The while loop will either return a node or exit before reaching this\n return null;\n }", "insertFirst(data){\n this.head = new Node(data, this.head);\n }", "function head(array) {\n var firstData;\n firstData = array[0];\n return firstData;\n}", "function findFirstTextNode(node) {\n\t\t\t\tvar walker;\n\n\t\t\t\tif (node) {\n\t\t\t\t\twalker = new TreeWalker(node, node);\n\n\t\t\t\t\tfor (node = walker.current(); node; node = walker.next()) {\n\t\t\t\t\t\tif (node.nodeType === 3) {\n\t\t\t\t\t\t\treturn node;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "function findFirstTextNode(node) {\n\t\t\t\tvar walker;\n\n\t\t\t\tif (node) {\n\t\t\t\t\twalker = new TreeWalker(node, node);\n\n\t\t\t\t\tfor (node = walker.current(); node; node = walker.next()) {\n\t\t\t\t\t\tif (node.nodeType === 3) {\n\t\t\t\t\t\t\treturn node;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "function findFirstTextNode(node) {\n\t\t\t\tvar walker;\n\n\t\t\t\tif (node) {\n\t\t\t\t\twalker = new TreeWalker(node, node);\n\n\t\t\t\t\tfor (node = walker.current(); node; node = walker.next()) {\n\t\t\t\t\t\tif (node.nodeType === 3) {\n\t\t\t\t\t\t\treturn node;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "async fetchHeadBlock() {\n const tipset = await lotus.getChainHead();\n return this.fetchBlock(tipset.Cids[0]['/']);\n }", "pickOne(list) {\n let index = 0;\n let r = random(0, this.fitness_sum);\n while (r > 0) {\n r -= list[index].dna.fitness;\n index++;\n }\n\n return list[index-1];\n }", "get firstElementChild() {\n const children = this.childElements;\n return children.length > 0 ? children[0] : null;\n }", "getNode(id) {\n for (let i = 0; i < this.nodes.length; i++) {\n let node = this.nodes[i];\n if (!node) { continue; }\n if (node.id === id) { return node; }\n }\n return null;\n }", "insertFirst(item) {\n //create a new node item, point the head to that node \n this.head = new _Node(item, this.head);\n }", "getHeadPos() {\n return this.units[0]\n }", "function findOneChild(test, nodes) {\n return nodes.find(test);\n }", "get(index) {\n //if index is less than zero OR greater than or equal to this.length return null\n // if(!this.head) return undefined;\n if (index < 0 || index >= this.length) return null;\n //Loop thru the list until you reach the index and return the node at that specific index.\n let counter = 0;\n let current = this.head;\n while (counter !== index) {\n current = current.next;\n counter++;\n }\n return current;\n }", "findMin() {\n var min = this.head;\n var runner = this.head.next\n while(runner != null) {\n if(runner.value < min.value) {\n min = runner\n }\n runner = runner.next\n } return min;\n }", "function findHeadTailLeafNode(node, containerBlockNode, isTail) {\n var result = node;\n if (getTagOfNode_1.default(result) == 'BR' && isTail) {\n return result;\n }\n while (result) {\n var sibling = node;\n while (!(sibling = isTail ? node.nextSibling : node.previousSibling)) {\n node = node.parentNode;\n if (node == containerBlockNode) {\n return result;\n }\n }\n while (sibling) {\n if (isBlockElement_1.default(sibling)) {\n return result;\n }\n else if (getTagOfNode_1.default(sibling) == 'BR') {\n return isTail ? sibling : result;\n }\n node = sibling;\n sibling = isTail ? node.firstChild : node.lastChild;\n }\n result = node;\n }\n return result;\n}", "peek() {\n return this.head ? this.head.data : null;\n }", "function getRootNode( target ) {\n\t\t\tif ( target.hasClass( 'n-list-group-item' ) ) {\n\t\t\t\tif ( target.is( 'dd' ) ) {\n\t\t\t\t\treturn target.closest( 'dl' );\n\t\t\t\t}\n\t\t\t\treturn target.closest( 'ul' );\n\t\t\t}\n\n\t\t\tif ( target.hasClass( 'tree-branch-name' ) || target.hasClass( 'tree-item-name' ) ) {\n\t\t\t\treturn target.closest( 'ul.tree' );\n\t\t\t}\n\n\t\t\treturn target.closest( 'ul' );\n\t\t}", "function first_dropdown_item() {\n\t\t\tdebugger;\n\t\t\treturn $(\"li\", dropdown).slice(0,1);\n\t\t}", "function get_first_elmt() {\n return obj[0];\n}", "function findOneChild(test, nodes) {\n return nodes.find(test);\n}", "function findOneChild(test, nodes) {\n return nodes.find(test);\n}", "function findOneChild(test, nodes) {\n return nodes.find(test);\n}", "function findOneChild(test, nodes) {\n return nodes.find(test);\n}", "function findOneChild(test, nodes) {\n return nodes.find(test);\n}", "function findOneChild(test, nodes) {\n return nodes.find(test);\n}", "findNode(index) {\n // find existing node\n if (this.head && index >= 0 && index < this.length - 1) {\n let currNode = this.head;\n let i = 0;\n while (currNode && i < index) {\n currNode = currNode.next;\n i++;\n }\n return currNode;\n }\n return null;\n }", "function firstChild() {\n var firstElement = this.elements[0].firstElementChild;\n\n return $.make(firstElement);\n }", "insertFirst(data) {\n this.head = new Node(data, this.head);\n }", "first() { return this._edges.first(1); }", "function findOneChild(test, nodes) {\n return nodes.find(test);\n}", "function findOneChild(test, nodes) {\n return nodes.find(test);\n}", "function getInitialBody (body) {\r\n if (Array.isArray(body)) {\r\n if (body.every(Point.isPoint)) {\r\n return body;\r\n }\r\n }\r\n else if (body instanceof Point) {\r\n return [body];\r\n }\r\n\r\n return [];\r\n }", "function getRoot() {\n\tvar sOut = \"\";\n\tvar nodeItem_0 = xfa.datasets.data.nodes.item(0);\n\tsOut = sOut + \"=== nodeItem_0=\" + nodeItem_0.name + \" ===\" + \"\\r\\n\";\n\treturn nodeItem_0;\n}", "function findFirstChildMeshElement(parent) {\n // find the mesh child\n for (var i = 0; i < parent.childCount; i++) {\n\n // get child and its materials\n var child = parent.getChild(i);\n if (child.typeId == \"Microsoft.VisualStudio.3D.Mesh\") {\n return child;\n }\n }\n return null;\n}", "function getRootNode(selfUL) {\r\n\t\tvar rootNodes = getRootNodes(selfUL);\r\n\t\tif (rootNodes.length) {\r\n\t\t\treturn rootNodes[0];\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "get(index) {\n if (index > this.size() - 1) return null;\n\n let foundNode = this.head;\n for (let i = 0; i < index; i++) {\n foundNode = foundNode.both.next;\n }\n\n return foundNode;\n }", "getNode(position) {\n if (position < 0 || \n position > this.length) {\n\n console.error(\"Position is out of range! \", position)\n return null;\n }\n\n let current = this.head;\n let index = 0;\n\n while (index < position) { // goes through each node until the index reaches the position\n current = current.next; // moves the link to the next node of the current node\n index++; \n }\n\n return current.value;\n }" ]
[ "0.566847", "0.5550254", "0.5545852", "0.5545852", "0.5545852", "0.5455136", "0.53845984", "0.53845984", "0.52773535", "0.5271643", "0.5260438", "0.5231135", "0.51783586", "0.5177588", "0.5154129", "0.51494235", "0.5114569", "0.51121306", "0.50545233", "0.4988757", "0.49548435", "0.49548435", "0.49284866", "0.49240327", "0.4923776", "0.49211153", "0.4900358", "0.4893933", "0.48899558", "0.48817182", "0.48817182", "0.48817182", "0.48817182", "0.48817182", "0.48481932", "0.48426482", "0.4826795", "0.48202682", "0.48130912", "0.4808238", "0.48080048", "0.47895437", "0.47815675", "0.4776795", "0.47755015", "0.4766429", "0.47510535", "0.4743511", "0.4743511", "0.47360915", "0.4726497", "0.4726081", "0.4722902", "0.47175977", "0.47140935", "0.47118974", "0.47108114", "0.47106937", "0.4707997", "0.47069544", "0.46999875", "0.4696183", "0.4693901", "0.4687582", "0.46798587", "0.46797684", "0.46797684", "0.46797684", "0.46520564", "0.46372566", "0.46165475", "0.46154362", "0.46136424", "0.4600819", "0.4595459", "0.45932212", "0.45906305", "0.45841333", "0.45751894", "0.45721844", "0.45678675", "0.45676136", "0.45485714", "0.45485714", "0.45485714", "0.45485714", "0.45485714", "0.45485714", "0.45452586", "0.4544828", "0.45401788", "0.4539521", "0.45263508", "0.45263508", "0.45245615", "0.45208395", "0.45177683", "0.45173746", "0.451642", "0.45128193" ]
0.5673129
0
Returns the first node in a linked list of the planck physics body's fixtures.
get fixtureList() { if (!this.body) return null; return this.body.getFixtureList(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get fixture() {\r\n\t\t\treturn this.fixtureList;\r\n\t\t}", "first(returnNode) {\n let node = this[this._start][this._next];\n return returnNode ? node : node.data;\n }", "getFirst () {\n\t\treturn this.head;\n\t}", "getFirst () {\n\t\treturn this.head;\n\t}", "getFirst () {\n\t\treturn this.head;\n\t}", "first() {\n return this.head.next;\n }", "getFirst() {\n return this.head;\n }", "getFirst() {\n return this.head;\n }", "getFirstRootNode() {\n return this.rootNodes.length > 0 ? this.rootNodes[0] : null;\n }", "function BOT_first(list) {\r\n\tif(list.length>0) return list[0]\r\n\telse return (undefined);\r\n}", "function firstNode()\n {\n var chain = new LinkedList(1000);\n alert('typeof chain.head: ' + typeof chain.head);\n }", "getFirst(){\n return this.head;\n }", "function getFirstBlockElement(rootNode) {\n return getFirstLastBlockElement(rootNode, true /*isFirst*/);\n}", "getNode(pos){\r\n let curr = this.head;\r\n\r\n for(let i = 0; i < this.length; i++){\r\n if(i === pos){\r\n return curr;\r\n }\r\n curr = curr.next;\r\n }\r\n return undefined;\r\n \r\n }", "function first(source) {\n source = Array.isArray(source) ? memset(source) : source;\n return dataset(source, {\n get: function (expressions) {\n expressions = expressions || [];\n let exp = this.dataset.getExpressions().concat(expressions);\n let anyFirst = exp.find(a => core_1.Utility.instanceof(a, expressions_1.Find));\n if (anyFirst) { // eğer find yazılmışşsa tek gelecek demek zaten\n return this.next();\n }\n return this.next(exp.concat(top(1))).then((response) => {\n if (Array.isArray(response))\n return response[0];\n return response;\n });\n }\n });\n}", "peekFirst(){\n if(this.isEmpty()){ return null}\n return this.head.data;\n }", "head() {\n return this.members[0]\n }", "getHeadNode() {\n return this.head\n }", "getNodeAt(index) {\n let next = this.head;\n let tempIndex = 0;\n while (next) {\n if (tempIndex == index) {\n return next;\n } else {\n next = next.next;\n tempIndex++;\n }\n }\n return null;\n }", "function first$get$0() {\n if ( !this.list ) return undefined;\n return this.list[0];\n }", "first(editor, at) {\n var path = Editor.path(editor, at, {\n edge: 'start'\n });\n return Editor.node(editor, path);\n }", "first(editor, at) {\n var path = Editor.path(editor, at, {\n edge: 'start'\n });\n return Editor.node(editor, path);\n }", "function testsFromPickOne(node) {\n var tests = [];\n // child of pick_one is a statement block. we want first child of that\n var statement = node.getElementsByTagName('statement')[0];\n var block = statement.getElementsByTagName('block')[0];\n var next;\n do {\n // if we have a next block, we want to generate our test without that\n next = block.getElementsByTagName('next')[0];\n if (next) {\n block.removeChild(next);\n }\n tests.push(testFromBlock(block));\n if (next) {\n block = next.getElementsByTagName('block')[0];\n }\n } while (next);\n return tests;\n }", "peekFirst() {\n\t\tif (this.isEmpty()) {\n\t\t\tthrow new Error(\"Empty Linked List.\");\n\t\t}\n\t\treturn this.head.value;\n\t}", "function DLLHead() {\n\t\t\tif(head == null) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tvar node = head;\n\t\t\treturn node;\n\t\t}", "function firstNode(source) {\n var node = null;\n if (source.firstChild.nodeName != \"#text\") {\n return source.firstChild;\n } else {\n source = source.firstChild;\n do {\n source = source.nextSibling;\n } while (source && source.nodeName == '#text');\n\n return source || null;\n }\n}", "getNode(nth) {\n if ((nth < 0) || (nth > this.length-1)) {\n return null;\n } else {\n let index = 0;\n let current = this.head;\n while (index !== nth) {\n current = current.next;\n index++;\n }\n return current;\n }\n }", "get first() {\n\t\t\n\t\tif(this.empty) throw \"List is empty\";\n\t\t\n\t\t// $CORRECT_CAST\n\t\treturn this._first.content;\n\t}", "get firstChild() {\n var _a;\n return (_a = this.children[0]) !== null && _a !== void 0 ? _a : null;\n }", "function getFirstLeaf(node) {\n while (node.firstChild && (\n // data-blocks has no offset\n node.firstChild instanceof Element && node.firstChild.getAttribute('data-blocks') === 'true' || getSelectionOffsetKeyForNode(node.firstChild))) {\n node = node.firstChild;\n }\n return node;\n}", "function getFirstLeaf(node) {\n while (node.firstChild && (\n // data-blocks has no offset\n node.firstChild instanceof Element && node.firstChild.getAttribute('data-blocks') === 'true' || getSelectionOffsetKeyForNode(node.firstChild))) {\n node = node.firstChild;\n }\n return node;\n}", "function getFirstLeaf(node) {\n while (node.firstChild && (\n // data-blocks has no offset\n node.firstChild instanceof Element && node.firstChild.getAttribute('data-blocks') === 'true' || getSelectionOffsetKeyForNode(node.firstChild))) {\n node = node.firstChild;\n }\n return node;\n}", "function getFirstLeaf(node) {\n while (node.firstChild && (\n // data-blocks has no offset\n node.firstChild instanceof Element && node.firstChild.getAttribute('data-blocks') === 'true' || getSelectionOffsetKeyForNode(node.firstChild))) {\n node = node.firstChild;\n }\n return node;\n}", "function getFirstLeaf(node) {\n while (node.firstChild && (\n // data-blocks has no offset\n node.firstChild instanceof Element && node.firstChild.getAttribute('data-blocks') === 'true' || getSelectionOffsetKeyForNode(node.firstChild))) {\n node = node.firstChild;\n }\n return node;\n}", "find(index) {\n //let counter = 0;\n let node = this.head;\n while (node !== null) {\n if (node.data === index) {\n return node;\n } else {\n node = node.next;\n }\n }\n return null;\n }", "get firstChild() {\n return this.content.length ? this.content[0] : null;\n }", "peek () {\n return this.head[0]\n }", "_getNodeAt(index){\n if (index < this._length / 2) {\n return this._moveForward(this._dummy.next, index);\n } else {\n return this._moveBackward(this._dummy, this._length - index)\n }\n\n return this._offset(this._dummy.next, index);\n }", "peekFirst() {\n return this.head;\n }", "findMinNode() {\n if (this.head == null && this.tail == null) {\n return undefined;\n }\n\n var runner = this.head\n var temp = runner\n while (runner != null) {\n if ( temp.value > runner.value ){\n temp = runner\n }\n runner = runner.next;\n }\n return temp;\n }", "read() {\n var current = this.head; // set curret as the head, if it exists or not\n\n while (current) { // if current, log and move to current.next\n console.log(current.data);\n current = current.next;\n }\n }", "getAt(index) {\n let counter = 0\n let node = this.head\n while (node) {\n if (counter === index) {\n return node\n }\n counter++\n node = node.next\n }\n return null\n }", "get firstChild() {\n return this.childNodes[0] || null;\n }", "function firstListItem() {\n return $('ul li:first-child')\n}", "function firstItem (people) {\n console.log(people[0]);\n}", "getFirst() {\n if (this.isEmpty()) return; /* TODO: Throw NoSuchElementException */\n return this.head.value;\n }", "findFirst(key) {\n let node = treeFind(this.root, key);\n let preNode = treePredecessor(node);\n while (preNode !== NIL && preNode.key === key) {\n node = preNode;\n preNode = treePredecessor(preNode);\n }\n return node;\n }", "first(func = (item) => item) {\n if (this.rootNode.length >= 1) {\n func(this.get(0), 0);\n return this.get(0);\n }\n return this;\n }", "first(func = (item) => item) {\n if (this.rootNode.length >= 1) {\n func(this.get(0), 0);\n return this.get(0);\n }\n return this;\n }", "get head() { return this.$head.pos }", "searchFirstNode(data) {\n if (!this.head) return null;\n let current = this.head;\n while (current !== null && current.data !== data) {\n current = current.next;\n }\n\n return current;\n }", "getNode(index) {\n let currentNode = this.head;\n for (let i = 1; i <= index; i++) {\n currentNode = currentNode.next;\n }\n return currentNode;\n }", "peek() {\n if (!this._storage.head) {\n throw new Error('__ERROR__ list is empty')\n }\n let currentNode = this._storage.head;\n while (currentNode.next) {\n currentNode = currentNode.next;\n }\n return currentNode;\n }", "find(data: any): Node | false {\n let node = this.head;\n while (node.hasNext()) {\n if (node.data === data) {\n return node;\n }\n node = node.next;\n }\n return false;\n }", "peek() {\n if (this.head) {\n return this.head.data\n } else {\n return null\n }\n }", "function getFirstLeafNode(rootNode) {\n return getLeafNode(rootNode, true /*isFirst*/);\n}", "function firstListItem(){\n// console.log($('#pic-list:first-child'))\n return $('#pic-list li:first-child')\n}", "function pickOne() {\n let index = 0;\n let r = random(1);\n while (r > 0) {\n r = r - birds[index].fitness;\n index++;\n }\n index--;\n let bird = birds[index];\n return bird.brain;\n}", "getFirst(){\n\t\treturn this.group.children.sort((c1, c2) => this.direction * -1 * c1.position.x - this.direction * -1 * c2.position.x)[0]\n\t}", "get(index) {\n if (index > this.length) return null;\n\n let node = this.head;\n\n for (let i = 0; i < this.length; i++) {\n if (i === index) return node;\n node = node.next;\n }\n }", "function findHead(tree) {\n let head = tree;\n if(typeof(tree.nodes)!=\"string\") {\n let headFound = false;\n tree.nodes.forEach((node) => {\n if(!headFound && (node.role==\"Head\"||node.role==\"head\")) {\n head = findHead(node);\n headFound = true;\n } else if(headFound && node.role==\"head\") {\n // head is more important than Head\n head = findHead(node);\n headFound = true;\n }\n });\n if (!headFound) {\n head = findHead(tree.nodes[tree.nodes.length - 1]);\n }\n }\n return head;\n}", "peek(){\n if(!this.linkedList.head){\n return null;\n }\n return this.linkedList.head.value;\n }", "getAt(index) {\n let node = this.head;\n let counter = 0;\n // Will run until either node is null or the node at index is found\n while (node) {\n if (counter === index) {\n return node;\n }\n \n counter++;\n // Move to the next node\n node = node.next;\n }\n // Return null if the index is out of range of the size of the list\n // The while loop will either return a node or exit before reaching this\n return null;\n }", "insertFirst(data){\n this.head = new Node(data, this.head);\n }", "function head(array) {\n var firstData;\n firstData = array[0];\n return firstData;\n}", "function findFirstTextNode(node) {\n\t\t\t\tvar walker;\n\n\t\t\t\tif (node) {\n\t\t\t\t\twalker = new TreeWalker(node, node);\n\n\t\t\t\t\tfor (node = walker.current(); node; node = walker.next()) {\n\t\t\t\t\t\tif (node.nodeType === 3) {\n\t\t\t\t\t\t\treturn node;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "function findFirstTextNode(node) {\n\t\t\t\tvar walker;\n\n\t\t\t\tif (node) {\n\t\t\t\t\twalker = new TreeWalker(node, node);\n\n\t\t\t\t\tfor (node = walker.current(); node; node = walker.next()) {\n\t\t\t\t\t\tif (node.nodeType === 3) {\n\t\t\t\t\t\t\treturn node;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "function findFirstTextNode(node) {\n\t\t\t\tvar walker;\n\n\t\t\t\tif (node) {\n\t\t\t\t\twalker = new TreeWalker(node, node);\n\n\t\t\t\t\tfor (node = walker.current(); node; node = walker.next()) {\n\t\t\t\t\t\tif (node.nodeType === 3) {\n\t\t\t\t\t\t\treturn node;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "async fetchHeadBlock() {\n const tipset = await lotus.getChainHead();\n return this.fetchBlock(tipset.Cids[0]['/']);\n }", "pickOne(list) {\n let index = 0;\n let r = random(0, this.fitness_sum);\n while (r > 0) {\n r -= list[index].dna.fitness;\n index++;\n }\n\n return list[index-1];\n }", "get firstElementChild() {\n const children = this.childElements;\n return children.length > 0 ? children[0] : null;\n }", "insertFirst(item) {\n //create a new node item, point the head to that node \n this.head = new _Node(item, this.head);\n }", "getNode(id) {\n for (let i = 0; i < this.nodes.length; i++) {\n let node = this.nodes[i];\n if (!node) { continue; }\n if (node.id === id) { return node; }\n }\n return null;\n }", "getHeadPos() {\n return this.units[0]\n }", "function findOneChild(test, nodes) {\n return nodes.find(test);\n }", "get(index) {\n //if index is less than zero OR greater than or equal to this.length return null\n // if(!this.head) return undefined;\n if (index < 0 || index >= this.length) return null;\n //Loop thru the list until you reach the index and return the node at that specific index.\n let counter = 0;\n let current = this.head;\n while (counter !== index) {\n current = current.next;\n counter++;\n }\n return current;\n }", "findMin() {\n var min = this.head;\n var runner = this.head.next\n while(runner != null) {\n if(runner.value < min.value) {\n min = runner\n }\n runner = runner.next\n } return min;\n }", "function findHeadTailLeafNode(node, containerBlockNode, isTail) {\n var result = node;\n if (getTagOfNode_1.default(result) == 'BR' && isTail) {\n return result;\n }\n while (result) {\n var sibling = node;\n while (!(sibling = isTail ? node.nextSibling : node.previousSibling)) {\n node = node.parentNode;\n if (node == containerBlockNode) {\n return result;\n }\n }\n while (sibling) {\n if (isBlockElement_1.default(sibling)) {\n return result;\n }\n else if (getTagOfNode_1.default(sibling) == 'BR') {\n return isTail ? sibling : result;\n }\n node = sibling;\n sibling = isTail ? node.firstChild : node.lastChild;\n }\n result = node;\n }\n return result;\n}", "peek() {\n return this.head ? this.head.data : null;\n }", "function getRootNode( target ) {\n\t\t\tif ( target.hasClass( 'n-list-group-item' ) ) {\n\t\t\t\tif ( target.is( 'dd' ) ) {\n\t\t\t\t\treturn target.closest( 'dl' );\n\t\t\t\t}\n\t\t\t\treturn target.closest( 'ul' );\n\t\t\t}\n\n\t\t\tif ( target.hasClass( 'tree-branch-name' ) || target.hasClass( 'tree-item-name' ) ) {\n\t\t\t\treturn target.closest( 'ul.tree' );\n\t\t\t}\n\n\t\t\treturn target.closest( 'ul' );\n\t\t}", "function first_dropdown_item() {\n\t\t\tdebugger;\n\t\t\treturn $(\"li\", dropdown).slice(0,1);\n\t\t}", "function get_first_elmt() {\n return obj[0];\n}", "function findOneChild(test, nodes) {\n return nodes.find(test);\n}", "function findOneChild(test, nodes) {\n return nodes.find(test);\n}", "function findOneChild(test, nodes) {\n return nodes.find(test);\n}", "function findOneChild(test, nodes) {\n return nodes.find(test);\n}", "function findOneChild(test, nodes) {\n return nodes.find(test);\n}", "function findOneChild(test, nodes) {\n return nodes.find(test);\n}", "findNode(index) {\n // find existing node\n if (this.head && index >= 0 && index < this.length - 1) {\n let currNode = this.head;\n let i = 0;\n while (currNode && i < index) {\n currNode = currNode.next;\n i++;\n }\n return currNode;\n }\n return null;\n }", "function firstChild() {\n var firstElement = this.elements[0].firstElementChild;\n\n return $.make(firstElement);\n }", "insertFirst(data) {\n this.head = new Node(data, this.head);\n }", "first() { return this._edges.first(1); }", "function findOneChild(test, nodes) {\n return nodes.find(test);\n}", "function findOneChild(test, nodes) {\n return nodes.find(test);\n}", "function getInitialBody (body) {\r\n if (Array.isArray(body)) {\r\n if (body.every(Point.isPoint)) {\r\n return body;\r\n }\r\n }\r\n else if (body instanceof Point) {\r\n return [body];\r\n }\r\n\r\n return [];\r\n }", "function getRoot() {\n\tvar sOut = \"\";\n\tvar nodeItem_0 = xfa.datasets.data.nodes.item(0);\n\tsOut = sOut + \"=== nodeItem_0=\" + nodeItem_0.name + \" ===\" + \"\\r\\n\";\n\treturn nodeItem_0;\n}", "function getRootNode(selfUL) {\r\n\t\tvar rootNodes = getRootNodes(selfUL);\r\n\t\tif (rootNodes.length) {\r\n\t\t\treturn rootNodes[0];\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "get(index) {\n if (index > this.size() - 1) return null;\n\n let foundNode = this.head;\n for (let i = 0; i < index; i++) {\n foundNode = foundNode.both.next;\n }\n\n return foundNode;\n }", "function findFirstChildMeshElement(parent) {\n // find the mesh child\n for (var i = 0; i < parent.childCount; i++) {\n\n // get child and its materials\n var child = parent.getChild(i);\n if (child.typeId == \"Microsoft.VisualStudio.3D.Mesh\") {\n return child;\n }\n }\n return null;\n}", "getNthContentNode(skipCount = 0) {\n let nodes = this.children.slice();\n while (nodes.length > 0) {\n let node = nodes.shift();\n if (node.url) {\n if (skipCount <= 0) {\n return node;\n }\n skipCount--;\n }\n nodes.splice(0, 0, ...node.children);\n }\n return null;\n }" ]
[ "0.5670101", "0.55511737", "0.5548006", "0.5548006", "0.5548006", "0.54578245", "0.5386264", "0.5386264", "0.52783704", "0.5273938", "0.52637506", "0.5232764", "0.5180677", "0.5178833", "0.5155045", "0.5152204", "0.51153433", "0.51133215", "0.50559485", "0.49911925", "0.49553922", "0.49553922", "0.49283627", "0.49272195", "0.49244767", "0.49242237", "0.49033958", "0.48951536", "0.4892184", "0.48838156", "0.48838156", "0.48838156", "0.48838156", "0.48838156", "0.48511523", "0.48437467", "0.48285538", "0.48212233", "0.48158598", "0.48098454", "0.480946", "0.47922787", "0.47830147", "0.477688", "0.47766852", "0.47682297", "0.4752712", "0.47454286", "0.47454286", "0.4737196", "0.4728649", "0.47273904", "0.4725425", "0.47187012", "0.47161543", "0.4712998", "0.4712561", "0.47121227", "0.47097284", "0.47092676", "0.47021678", "0.4698651", "0.46967486", "0.46900415", "0.46812695", "0.46794194", "0.46794194", "0.46794194", "0.46540827", "0.46381342", "0.46180898", "0.46160015", "0.46157265", "0.4601373", "0.45958608", "0.4595453", "0.45928565", "0.45861182", "0.45769414", "0.4572249", "0.45693895", "0.45682508", "0.45490292", "0.45490292", "0.45490292", "0.45490292", "0.45490292", "0.45490292", "0.4547903", "0.4546614", "0.4542603", "0.4541197", "0.45268008", "0.45268008", "0.4524558", "0.45213535", "0.4519247", "0.45186633", "0.45184928", "0.4514554" ]
0.56664073
1
TODO make this work for other shapes
_resizeCollider(scale) { if (!this.body) return; if (typeof scale == 'number') { scale = { x: scale, y: scale }; } else { if (!scale.x) scale.x = 1; if (!scale.y) scale.y = 1; } if (this.shape == 'circle') { let fxt = this.fixture; let sh = fxt.m_shape; sh.m_radius *= scale.x; } else { // let bodyProps = this._cloneBodyProps(); // this.removeColliders(); // this.addCollider(); // for (let prop in bodyProps) { // this[prop] = bodyProps[prop]; // } for (let fxt = this.fixtureList; fxt; fxt = fxt.getNext()) { if (fxt.m_isSensor) continue; let sh = fxt.m_shape; for (let vert of sh.m_vertices) { vert.x *= scale.x; vert.y *= scale.y; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Shape4(){}", "dibujar_p() {\n push();\n stroke('black');\n strokeWeight(3);\n translate(this.posx-((this._shape[0].length*this.longitud)/2),this.posy-((this._shape.length*this.longitud)/2));\n for (var i = 0; i < this._shape.length; i++) {\n for (var j = 0; j < this._shape[i].length; j++) {\n if (this._shape[i][j] != 0) {\n fill(this._shape[i][j]);\n rect(j * this.longitud, i * this.longitud, this.longitud, this.longitud);\n }\n } \n }\n pop();\n}", "function SVGShape() {}", "function Shape() {}", "makeShape(){\n rect(this.x, this.y, this.w, this.w);\n }", "function Shape3(){}", "function Shape2(){}", "function Shape(){}", "function Shape(){}", "setShape(shape) {\n if (shape === 'X') { return 'O'; }\n return 'X';\n }", "function Shape() {\n\n}", "function Shape () {\n}", "shapeTerrain() {\r\n // MP2: Implement this function!\r\n }", "function Shape5(){}", "function shapeFactory(){\r\n}", "drawShape(...shapes) {\n shapes = shapes.map((s) => {\n if (s instanceof Shape) return s;\n return new Shape(this.POLYGON, undefined, s);\n });\n this.currentShape = shapes[0].copy();\n for (let i = 1; i < shapes.length; i++) {\n this.currentShape.merge(shapes[i]);\n }\n this.end();\n }", "function shape(){\n constructor(){\n this.height='13CM';\n this.length='12CM';\n this.area='256CM2';\n } \n shape.getteArea.function()={\n return area;\n }\n \n}", "boundingBox(shape) {\n let r = {x0 : 10, x1 : -10, y0 : 10, y1 : -10};\n\n shape.foreach( function(x, y) {\n if ((x <= r.x0)) r.x0 = x;\n if ((x >= r.x1)) r.x1 = x;\n if ((y <= r.y0)) r.y0 = y;\n if ((y >= r.y1)) r.y1 = y;\n });\n\n return r;\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}}", "saveShape() {\n return this.currentShape;\n }", "display() {\n fill('#323230');\n noStroke();\n if(this.shape === 'rect') {\n rectMode(CENTER);\n rect(this.x, this.y, this.size, this.size);\n } else if(this.shape === 'circle') {\n circle(this.x, this.y, this.size);\n } else {\n triangle(this.x - this.size / 2, this.y + this.size / 2, this.x + this.size / 2, this.y + this.size / 2, this.x, this.y - this.size / 2);\n }\n }", "get shapes() {\n //return DATA[this.id];\n return Shape.TETROMINOS[this.id];\n }", "function borders(){\n var N;\n N = getShape(\"halcon\");\n console.log(N);\n if (N.x >1000){\n N.x = 0;\n }\n if (N.x < 0){\n N.x = 1000;\n }\n if(N.y<-50){\n N.y = 500;\n }\n if(N.y >500){\n N.y = -50;\n }\n}", "shape() {\n return [this.grid.length, this.grid[0].length];\n }", "function shapeIsSelected(shape)\n{\n if (GC.shape && shape && shape.type == \"rect\")\n {\n if (GC.shape.startX <= shape.startX &&\n GC.shape.startY <= shape.startY &&\n (GC.shape.startX + GC.shape.w) >= (shape.startX + shape.w) &&\n (GC.shape.startY + GC.shape.h) >= (shape.startY + shape.h))\n {\n return true;\n }\n }\n if (GC.shape && shape && shape.type == \"circ\")\n {\n if (GC.shape.startX <= shape.startX &&\n GC.shape.startY <= shape.startY &&\n (GC.shape.startX + GC.shape.w) >= shape.endX &&\n (GC.shape.startY + GC.shape.h) >= shape.endY)\n {\n return true;\n }\n }\n if (GC.shape && shape && shape.type == \"poly\")\n {\n for (var i = 0; i < shape.points.length; i++)\n {\n if (shape.points[i].x <= GC.shape.startX ||\n shape.points[i].y <= GC.shape.startY ||\n shape.points[i].x >= (GC.shape.startX + GC.shape.w) ||\n shape.points[i].y >= (GC.shape.startY + GC.shape.h))\n {\n return false;\n }\n }\n return true;\n }\n return false;\n}", "function Shapes() {\n var renderShape = {\n box: function(E1) {\n var rx = E1.position.x;\n var ry = E1.position.y;\n\n noStroke();\n fill(55, 189, 255);\n rect(rx - game.renderOffset.x, ry + game.renderOffset.y, E1.size.width, E1.size.height);\n }\n };\n\n var renderPhysicsOfShape = {\n box: function(E1) {\n var pyX = E1.position.x - game.renderOffset.x;\n var pyY = E1.position.y + game.renderOffset.y;\n var pyMidX = E1.getMidX() - game.renderOffset.x;\n var pyMidY = E1.getMidY() + game.renderOffset.y;\n\n noStroke();\n fill('#333');\n rect(pyX, pyY, E1.size.width, E1.size.height);\n stroke(70, 255, 33);\n strokeWeight(2);\n line(\n pyMidX,\n pyMidY,\n pyMidX + E1.velocity.x * 5,\n pyMidY + E1.velocity.y * 5\n );\n stroke('#00A0E12');\n line(\n pyMidX,\n pyMidY,\n pyMidX + E1.acceleration.x * 25,\n pyMidY + E1.acceleration.y * 25\n );\n stroke('#D42322');\n line(\n pyMidX,\n pyMidY,\n pyMidX + E1.velocity.x - E1.acceleration.x * 5,\n pyMidY + E1.velocity.y - E1.acceleration.y * 5\n );\n }\n };\n\n function renderDebug(E1) {\n var pyMidX = E1.getMidX();\n var pyMidY = E1.getMidY();\n\n noStroke();\n fill('#33A6AA');\n text(\n 'ID: ' + E1.id +\n '\\nCollides with: ' + Object.keys(E1.collidesWith) +\n '\\nShape: ' + E1.properties.get('shape') +\n '\\nType: ' + E1.properties.get('type') +\n '\\nPos: x-' + E1.position.x.toFixed(2) + ' | ' + E1.position.y.toFixed(2) +\n '\\nAcc: ' + E1.acceleration.x.toFixed(2) + ' | ' + E1.acceleration.y.toFixed(2) +\n '\\nVel: ' + E1.velocity.x.toFixed(2) + ' | ' + E1.velocity.y.toFixed(2),\n E1.position.x - game.renderOffset.x,\n E1.position.y + game.renderOffset.y + E1.size.height + 14\n );\n\n for(var collid in E1.collidesWith) {\n var E2 = E1.collidesWith[collid];\n\n stroke('#8C3EB5')\n line(\n E1.getMidX() - game.renderOffset.x,\n E1.getMidY() + game.renderOffset.y,\n E2.getMidX() - game.renderOffset.x,\n E2.getMidY() + game.renderOffset.y\n );\n }\n }\n\n this.render = function(E1) {\n renderShape[E1.properties.get('shape')](E1);\n }\n\n this.renderPhysicsOf = function(E1) {\n renderPhysicsOfShape[E1.properties.get('shape') ](E1);\n }\n\n this.renderDebugOf = function(E1) {\n renderDebug(E1);\n }\n}", "setShape(t){\n this.shape = t;\n console.log(this.shape);\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 Shape() {\n this.x = 0;\n this.y = 0;\n}", "function Shape() {\n // \n}", "function Shape() {\n this.m_type;\n this.m_radius;\n}", "function shapeShift(){\n if(myCenter.shape === rect){\n myCenter.shape = ellipse;\n for(var i=0; i<myDots.length; i++){\n myDots[i].shape = ellipse;\n }\n }\n else{\n myCenter.shape = rect;\n for(var i=0; i<myDots.length; i++){\n myDots[i].shape = rect;\n }\n }\n}", "squareShape(array_size, radius) {\n\n // Construct array for Starting Shape (Square)\n // Middle right side to bottom right corner\n\n let i_max = array_size/8;\n\n let shape = [];\n\n for (var i = 0; i < i_max; i++) {\n shape.push([\n radius,\n -((i/i_max) * radius),\n ]);\n }\n\n // bottom right corner to bottom left corner\n i_max = array_size/4;\n for (var i = 0; i < i_max; i++) {\n shape.push([\n radius - ((i/i_max) * (2 * radius)),\n -radius\n ]);\n }\n\n // bottom left corner to top left corner\n i_max = array_size/4;\n for (var i = 0; i < i_max; i++) {\n shape.push([\n -radius,\n -radius + ((i/i_max) * (2 * radius)),\n ]);\n }\n\n // top left corner to top right corner\n i_max = array_size/4;\n for (var i = 0; i < i_max; i++) {\n shape.push([\n -radius + ((i/i_max) * (2 * radius)),\n radius\n ]);\n }\n\n // top right corner to middle right side\n i_max = array_size/8;\n for (var i = 0; i < i_max; i++) {\n shape.push([\n radius,\n radius - ((i/i_max) * radius),\n ]);\n }\n\n shape.push([radius,0]);\n\n return shape;\n }", "function shapeCheck()\n\t{\n\t\tif(object == 'Prop_Small_Table_01.fbx')\n\t\t\tshape = mediumBoxShape;\n\t\t\t\n\t\telse if(object == 'Prop_BunkBed_Blue' || 'Prop_SingleBed_Pink.fbx')\n\t\t\tshape = LargeRecShape\n\t}", "function assembleShape() {\r\n\r\n\t\tvar spacing = 0,\r\n\t\t\tXoffset\t= offsetSVG,\r\n\t\t\tYoffset\t= 208,\r\n\t\t\tpixelCount = 0;\r\n\r\n\t\tfor (var i = 0; i < nodes.length; i++) {\r\n\t\t\tnodes[i].setTarget(Xoffset + Number(shapeSVG[i][0]), Yoffset + Number(shapeSVG[i][1]), Number(shapeSVG[i][2]));\r\n\t\t}\r\n\t}", "function applyShape() {\n //for each value in the current shape (row x column)\n for (var row = 0; row < currentShape.shape.length; row++) {\n for (var col = 0; col < currentShape.shape[row].length; col++) {\n //if its non-empty\n if (currentShape.shape[row][col] !== 0) {\n //set the value in the grid to its value. Stick the shape in the grid!\n grid[currentShape.y + row][currentShape.x + col] = currentShape.shape[row][col];\n }\n }\n }\n}", "function updateShape(point) {\n model.context.clearRect(0, 0, model.cnv.width, model.cnv.height);\n model.cnv.width = model.cnv.width;\n\n var width = model.width;\n var height = model.height;\n\n model.context.setTransform(1, 0, 0, 1, 0, 0);\n\n let dx = point.xAxis + 0.5 * width;\n let dy = point.yAxis + 0.5 * height;\n model.context.translate(dx, dy);\n\tmodel.context.rotate(0.7931);\n // model.context.fillStyle = model.bgColor;\n // model.context.fillRect(-0.5 * width, -0.5 * height, width, height);\n model.context.drawImage(this.csImage, -0.5 * width, -0.5 * height, width, height);\n}", "function uniqueShape(){\n ctx.beginPath();\n ctx.moveTo(300, 0);\n ctx.lineTo(400, 200);\n ctx.lineTo(600, 300);\n ctx.lineTo(400, 400);\n ctx.lineTo(300, 600);\n ctx.lineTo(200, 400);\n ctx.lineTo(0, 300);\n ctx.lineTo(200, 200);\n ctx.closePath();\n ctx.fillStyle = \"teal\";\n ctx.fill();\n}", "function basicShape(x,y) \n {\n\t\n pulley_front_shape1=new Shape()\n .moveTo( x, y )\n .cubicCurveTo( -shift + x, y, -shift + x, height+y, x, height+y )\n .close();\n\n box_front_shape=new Shape()\n .moveTo( x-t, y-e -t )\n .lineTo( x+t, y+e - t)\n .lineTo( x+t, y+ height+e + t)\n .lineTo( x-t, y+ height-e + t)\n .close();\n\n }", "render() {\n stroke(this.layerColor)\n fill(this.layerColor)\n strokeWeight(this.weight)\n\n push()\n translate(width / 2, height / 2)\n let pick = random(1)\n for (let i = 0; i < this.numShapes; i++) {\n if (pick < 0.5) {\n myTriangle(this.center, this.radius, this.direction)\n } else {\n ellipse(0, this.center, this.radius, this.radius)\n }\n rotate(this.angle)\n }\n pop()\n }", "function drawShape(shape, context) {\r\n\tcontext.strokeStyle = '#000000';\r\n\tcontext.beginPath();\r\n\tswitch (shape.m_type) {\r\n\t\tcase b2Shape.e_circleShape:\r\n\t\t\tvar circle = shape;\r\n\t\t\tvar pos = circle.m_position;\r\n\t\t\tvar r = circle.m_radius;\r\n\t\t\tvar segments = 16.0;\r\n\t\t\tvar theta = 0.0;\r\n\t\t\tvar dtheta = 2.0 * Math.PI / segments;\r\n\t\t\tcontext.moveTo(pos.x + r, pos.y);\r\n\t\t\tfor (var i = 0; i < segments; i++) {\r\n\t\t\t\tvar d = new b2Vec2(r * Math.cos(theta),r * Math.sin(theta));\r\n\t\t\t\tvar v = b2Math.AddVV(pos, d);\r\n\t\t\t\tcontext.lineTo(v.x, v.y);\r\n\t\t\t\ttheta += dtheta;\r\n\t\t\t}\r\n\t\t\tcontext.lineTo(pos.x + r, pos.y);\r\n\t\t\tcontext.moveTo(pos.x, pos.y);\r\n\t\t\tvar ax = circle.m_R.col1;\r\n\t\t\tvar pos2 = new b2Vec2(pos.x + r * ax.x, pos.y + r * ax.y);\r\n\t\t\tcontext.lineTo(pos2.x, pos2.y);\r\n\t\t\tbreak;\r\n\r\n\t\tcase b2Shape.e_polyShape:\r\n\t\t\tvar poly = shape;\r\n\t\t\tvar tV = b2Math.AddVV(poly.m_position,b2Math.b2MulMV(poly.m_R, poly.m_vertices[0]));\r\n\t\t\tcontext.moveTo(tV.x, tV.y);\r\n\t\t\tfor (var i = 0; i < poly.m_vertexCount; i++) {\r\n\t\t\t\tvar v = b2Math.AddVV(poly.m_position,b2Math.b2MulMV(poly.m_R, poly.m_vertices[i]));\r\n\t\t\t\tcontext.lineTo(v.x, v.y);\r\n\t\t\t}\r\n\t\t\tcontext.lineTo(tV.x, tV.y);\r\n\t\t\tbreak;\r\n\t}\r\n\tcontext.stroke();\r\n}", "function getShape(xfrm) {\n const shape = {};\n xfrm.children.forEach((c) => {\n if (c.name === 'a:off') {\n shape.x = unitConverter.emuToPixels(c.attribs.x);\n shape.y = unitConverter.emuToPixels(c.attribs.y);\n }\n else if (c.name === 'a:ext') {\n shape.width = unitConverter.emuToPixels(c.attribs.cx);\n shape.height = unitConverter.emuToPixels(c.attribs.cy);\n }\n });\n return shape;\n}", "constructor(shape) {\n this.id = shape.id;\n this.type = shape.type;\n this.path = [];\n for (let i = 0; i < shape.path.length; i++) {\n this.path[i] = []\n for (let j = 0; j < 2; j++) {\n this.path[i][j] = shape.path[i][j];\n }\n }\n }", "render() {\n\n stroke(this.layerColor)\n strokeWeight(this.randomWeight)\n noFill()\n push()\n translate(width / 2, height / 2)\n for (let i = 0; i <= this.numShapes; i++) {\n ellipse(this.position, 0, this.shapeSize, this.shapeSize)\n rotate(this.angle)\n }\n pop()\n\n }", "intersectsShape(shape2, graphics) {\n // Walk through shape2's line segments and see if they intersect with \n // our line segments.\n // This is O(n^2) so won't scale.\n //. first should check if the point is within the bounding box of this sprite - \n // (x - bounds, y - bounds) to (x + bounds, y + bounds).\n for (let i = 0; i < shape2.nLines - 1; i++) {\n // Get line segment\n const seg2 = shape2.getLineSegment(i)\n if (seg2) {\n // seg2.drawSegment(graphics, 'orange')\n // seg2.drawBoundingBox(graphics, 'orange')\n for (let j = 0; j < this.nLines - 1; j++) {\n const seg1 = this.getLineSegment(j)\n if (seg1) {\n // seg1.drawSegment(graphics, 'red')\n // seg1.drawBoundingBox(graphics, 'red')\n const pointIntersect = seg1.getIntersection(seg2)\n if (pointIntersect) {\n return pointIntersect\n }\n }\n } \n }\n }\n return null\n }", "function AstroGeometry() {}", "function Shape(h,w,type){\n this.h = h;\n this.w = w;\n this.type = type;\n}", "function makeShape(frontOrBack,d,n,a,f1,f2,bAndDSize,baseRingStart,ringStart,aToCAdd){\n var text = '';\n var buffer = '';\n var obj = {\n a: {\n x: [],\n y: [],\n frontCount: 0,\n backCount: 0,\n xBack: [],\n yBack: []\n },\n b: {\n x: [],\n y: [],\n frontCount: 0,\n backCount: 0,\n xBack: [],\n yBack: [],\n },\n c: {\n x: [],\n y: [],\n frontCount: 0,\n backCount: 0,\n xBack: [],\n yBack: [],\n },\n d: {\n x: [],\n y: [],\n frontCount: 0,\n backCount: 0,\n xBack: [],\n yBack: [],\n }\n }\n //console.log(obj);\n\n //***************************VARIABLES**********************************\n // var d = 1000;\n // var n = 15;\n // var a = sqrt(2);\n // var f1 = 1;\n // var f2 = 1;\n // var bAndDSize = .9;\n // var baseRingStart = radians(0);\n // var ringStart = radians(360);\n // var aToCAdd = radians(20);\n\n\n\n\n //*********************DERIVED*********************\n var e = 1/a;\n var aAndBStart = baseRingStart + ringStart;\n var cAndDStart = aAndBStart + aToCAdd;\n var conicE = sqrt((a*a)-1)/a;\n var radUse = radians(180)/d;\n var numbersArr = numbers(0,d,1);\n var radUseArr = numbers(0,d,radUse);\n var oneMinusCos = fancyNumbers(radUseArr,f1);\n var pathNum = arrMultiply(oneMinusCos,d/2);\n var pathRad = arrMultiply(pathNum,radUse);\n var pathx = arrSin(pathRad);\n var pathy = arrCos(pathRad,conicE);\n var ww1 = fancyww1(radUseArr,f2,n);\n var ww2 = fancyww2(ww1);\n var wrapRadArr = wrapRad(ww2);\n\n //MAKING WRAPS\n var wrapAx = wrapXFun(wrapRadArr,aAndBStart,pathx,1);\n var wrapAy = wrapYFun(pathx,e,wrapRadArr,aAndBStart,pathy,1);\n var wrapBx = wrapXFun(wrapRadArr,ringStart,pathx,bAndDSize);\n var wrapBy = wrapYFun(pathx,e,wrapRadArr,ringStart,pathy,bAndDSize);\n var wrapCx = wrapXFun(wrapRadArr,cAndDStart,pathx,1);\n var wrapCy = wrapYFun(pathx,e,wrapRadArr,cAndDStart,pathy,1);\n var wrapDx = wrapXFun(wrapRadArr,cAndDStart,pathx,bAndDSize);\n var wrapDy = wrapYFun(pathx,e,wrapRadArr,cAndDStart,pathy,bAndDSize);\n\n //PUTING WRAPS IN OBJ\n obj.a.x = wrapAx;\n obj.b.x = wrapBx;\n obj.c.x = wrapCx;\n obj.d.x = wrapDx;\n obj.a.y = wrapAy;\n obj.b.y = wrapBy;\n obj.c.y = wrapCy;\n obj.d.y = wrapDy;\n\n //PUTTING FRONT AND BACK COUNTS IN OBJ\n obj.a.frontCount = getFront(obj.a.x,obj.a.y,.99).frontCount;\n obj.a.backCount = getFront(obj.a.x,obj.a.y,.99).backCount;\n obj.b.frontCount = getFront(obj.b.x,obj.b.y,.9*bAndDSize).frontCount;\n obj.b.backCount = getFront(obj.b.x,obj.b.y,.9*bAndDSize).backCount;\n obj.c.frontCount = getFront(obj.c.x,obj.c.y,.99).frontCount;\n obj.c.backCount = getFront(obj.c.x,obj.c.y,.99).backCount;\n obj.d.frontCount = getFront(obj.d.x,obj.d.y,.9*bAndDSize).frontCount;\n obj.d.backCount = getFront(obj.d.x,obj.d.y,.9*bAndDSize).backCount;\n\n //SEPARATING FRONT AND BACK IN OBJ\n var separateA = separate(obj.a.x,obj.a.y,obj.a.frontCount,obj.a.backCount);\n var separateB = separate(obj.b.x,obj.b.y,obj.b.frontCount,obj.b.backCount);\n var separateC = separate(obj.c.x,obj.c.y,obj.c.frontCount,obj.b.backCount);\n var separateD = separate(obj.d.x,obj.d.y,obj.c.frontCount,obj.b.backCount);\n obj.a.xFront = separateA.xFront;\n obj.a.xBack = separateA.xBack;\n obj.b.xFront = separateB.xFront;\n obj.b.xBack = separateB.xBack;\n obj.c.xFront = separateC.xFront;\n obj.c.xBack = separateC.xBack;\n obj.d.xFront = separateD.xFront;\n obj.d.xBack = separateD.xBack;\n\n obj.a.yFront = separateA.yFront;\n obj.a.yBack = separateA.yBack;\n obj.b.yFront = separateB.yFront;\n obj.b.yBack = separateB.yBack;\n obj.c.yFront = separateC.yFront;\n obj.c.yBack = separateC.yBack;\n obj.d.yFront = separateD.yFront;\n obj.d.yBack = separateD.yBack;\n\n //console.log(obj);\n\n var plotObj = {\n ab: {\n front: {\n x1: [],\n y1: [],\n x2: [],\n y2: []\n },\n back: {\n x1: [],\n y1: [],\n x2: [],\n y2: []\n }\n },\n ac: {\n front: {\n x1: [],\n y1: [],\n x2: [],\n y2: []\n },\n back: {\n x1: [],\n y1: [],\n x2: [],\n y2: []\n }\n },\n cd: {\n front: {\n x1: [],\n y1: [],\n x2: [],\n y2: []\n },\n back: {\n x1: [],\n y1: [],\n x2: [],\n y2: []\n }\n },\n bd: {\n front: {\n x1: [],\n y1: [],\n x2: [],\n y2: []\n },\n back: {\n x1: [],\n y1: [],\n x2: [],\n y2: []\n }\n }\n }\n\n //******************EQUALING OUT ARRS*********************************\n //AB BACK\n var abBackArr = [];\n var axBack = obj.a.xBack;\n //console.log(axBack)\n abBackArr.push(equalOut(obj.a.xBack,obj.b.xBack).arr1);\n abBackArr.push(equalOut(obj.a.xBack,obj.b.xBack).arr2);\n abBackArr.push(equalOut(obj.a.yBack,obj.b.yBack).arr1);\n abBackArr.push(equalOut(obj.a.yBack,obj.b.yBack).arr2);\n //console.log(abBackArr);\n //AB FRONT\n var abFrontArr = [];\n abFrontArr.push(equalOut(obj.a.xFront,obj.b.xFront).arr1);\n abFrontArr.push(equalOut(obj.a.xFront,obj.b.xFront).arr2);\n abFrontArr.push(equalOut(obj.a.yFront,obj.b.yFront).arr1);\n abFrontArr.push(equalOut(obj.a.yFront,obj.b.yFront).arr2);\n //console.log(abFrontArr);\n\n //AC BACK\n var acBackArr = [];\n acBackArr.push(equalOut(obj.a.xBack,obj.c.xBack).arr1);\n acBackArr.push(equalOut(obj.a.xBack,obj.c.xBack).arr2);\n acBackArr.push(equalOut(obj.a.yBack,obj.c.yBack).arr1);\n acBackArr.push(equalOut(obj.a.yBack,obj.c.yBack).arr2);\n //console.log(acBackArr);\n //AC FRONT\n var acFrontArr = [];\n acFrontArr.push(equalOut(obj.a.xFront,obj.c.xFront).arr1);\n acFrontArr.push(equalOut(obj.a.xFront,obj.c.xFront).arr2);\n acFrontArr.push(equalOut(obj.a.yFront,obj.c.yFront).arr1);\n acFrontArr.push(equalOut(obj.a.yFront,obj.c.yFront).arr2);\n //console.log(acFrontArr);\n\n //CD BACK\n var cdBackArr = [];\n cdBackArr.push(equalOut(obj.c.xBack,obj.d.xBack).arr1);\n cdBackArr.push(equalOut(obj.c.xBack,obj.d.xBack).arr2);\n cdBackArr.push(equalOut(obj.c.yBack,obj.d.yBack).arr1);\n cdBackArr.push(equalOut(obj.c.yBack,obj.d.yBack).arr2);\n //console.log(cdBackArr);\n //CD FRONT\n var cdFrontArr = [];\n cdFrontArr.push(equalOut(obj.c.xFront,obj.d.xFront).arr1);\n cdFrontArr.push(equalOut(obj.c.xFront,obj.d.xFront).arr2);\n cdFrontArr.push(equalOut(obj.c.yFront,obj.d.yFront).arr1);\n cdFrontArr.push(equalOut(obj.c.yFront,obj.d.yFront).arr2);\n //console.log(cdFrontArr);\n\n //BD BACK\n var bdBackArr = [];\n bdBackArr.push(equalOut(obj.b.xBack,obj.d.xBack).arr1);\n bdBackArr.push(equalOut(obj.b.xBack,obj.d.xBack).arr2);\n bdBackArr.push(equalOut(obj.b.yBack,obj.d.yBack).arr1);\n bdBackArr.push(equalOut(obj.b.yBack,obj.d.yBack).arr2);\n //console.log(bdBackArr);\n //BD FRONT\n var bdFrontArr = [];\n bdFrontArr.push(equalOut(obj.b.xFront,obj.d.xFront).arr1);\n bdFrontArr.push(equalOut(obj.b.xFront,obj.d.xFront).arr2);\n bdFrontArr.push(equalOut(obj.b.yFront,obj.d.yFront).arr1);\n bdFrontArr.push(equalOut(obj.b.yFront,obj.d.yFront).arr2);\n //console.log(bdFrontArr);\n\n //************PUTTING EQUALED OUT ARRS INTO PLOT OBJ**********************\n //AB BACK\n plotObj.ab.back.x1 = abBackArr[0];\n plotObj.ab.back.x2 = abBackArr[1];\n plotObj.ab.back.y1 = abBackArr[2];\n plotObj.ab.back.y2 = abBackArr[3];\n //AB FRONT\n plotObj.ab.front.x1 = abFrontArr[0];\n plotObj.ab.front.x2 = abFrontArr[1];\n plotObj.ab.front.y1 = abFrontArr[2];\n plotObj.ab.front.y2 = abFrontArr[3];\n\n //ac BACK\n plotObj.ac.back.x1 = acBackArr[0];\n plotObj.ac.back.x2 = acBackArr[1];\n plotObj.ac.back.y1 = acBackArr[2];\n plotObj.ac.back.y2 = acBackArr[3];\n //ac FRONT\n plotObj.ac.front.x1 = acFrontArr[0];\n plotObj.ac.front.x2 = acFrontArr[1];\n plotObj.ac.front.y1 = acFrontArr[2];\n plotObj.ac.front.y2 = acFrontArr[3];\n\n //cd BacK\n plotObj.cd.back.x1 = cdBackArr[0];\n plotObj.cd.back.x2 = cdBackArr[1];\n plotObj.cd.back.y1 = cdBackArr[2];\n plotObj.cd.back.y2 = cdBackArr[3];\n //cd FRONT\n plotObj.cd.front.x1 = cdFrontArr[0];\n plotObj.cd.front.x2 = cdFrontArr[1];\n plotObj.cd.front.y1 = cdFrontArr[2];\n plotObj.cd.front.y2 = cdFrontArr[3];\n\n //bd BbdK\n plotObj.bd.back.x1 = bdBackArr[0];\n plotObj.bd.back.x2 = bdBackArr[1];\n plotObj.bd.back.y1 = bdBackArr[2];\n plotObj.bd.back.y2 = bdBackArr[3];\n //bd FRONT\n plotObj.bd.front.x1 = bdFrontArr[0];\n plotObj.bd.front.x2 = bdFrontArr[1];\n plotObj.bd.front.y1 = bdFrontArr[2];\n plotObj.bd.front.y2 = bdFrontArr[3];\n\n //console.log(plotObj);\n\n //*************PLOT STUFF************************************\n // var text = '';\n // var buffer = '';\n // var finalCount = 0;\n\n function plot(x1,y1,x2,y2,s){\n //1 = white\n //0 = black\n var scale = 1;\n var use = 1/(x1.length/2);\n var k = 0;\n var m = 0;\n\n for(i=0;i<x1.length;i++){\n if(k<x1.length/2){\n var put = use * m;\n m++\n //end should be 1\n }\n if(k>=x1.length/2){\n var put = use * m;\n m--\n //end should be 0\n }\n buffer += 'newbuffer' + '\\n';\n text += 'addvalue ' + finalCount + ' ' + x1[i] + ' ' + y1[i] + '\\n';\n text += 'addvalue ' + finalCount + ' ' + x2[i] + ' ' + y2[i] + '\\n';\n\n if(s == 's'){\n text += 'bcolor ' + .9 + ' ' + put + ' ' + put + ' ' + finalCount + '\\n'\n } else{\n text += 'bcolor ' + put + ' ' + put + ' ' + put + ' ' + finalCount + '\\n'\n }\n k++\n finalCount++\n }\n }\n\n //AB BACK\n var abBackX1 = plotObj.ab.back.x1;\n var abBackX2 = plotObj.ab.back.x2;\n var abBackY1 = plotObj.ab.back.y1;\n var abBackY2 = plotObj.ab.back.y2;\n var abBackS = 's';\n //AB FRONT\n var abFrontX1 = plotObj.ab.front.x1;\n var abFrontX2 = plotObj.ab.front.x2;\n var abFrontY1 = plotObj.ab.front.y1;\n var abFrontY2 = plotObj.ab.front.y2;\n var abFrontS = 's';\n //ac BACK\n var acBackX1 = plotObj.ac.back.x1;\n var acBackX2 = plotObj.ac.back.x2;\n var acBackY1 = plotObj.ac.back.y1;\n var acBackY2 = plotObj.ac.back.y2;\n var acBackS = 'b';\n //ac FRONT\n var acFrontX1 = plotObj.ac.front.x1;\n var acFrontX2 = plotObj.ac.front.x2;\n var acFrontY1 = plotObj.ac.front.y1;\n var acFrontY2 = plotObj.ac.front.y2;\n var acFrontS = 'b';\n //cd BACK\n var cdBackX1 = plotObj.cd.back.x1;\n var cdBackX2 = plotObj.cd.back.x2;\n var cdBackY1 = plotObj.cd.back.y1;\n var cdBackY2 = plotObj.cd.back.y2;\n var cdBackS = 's';\n //cd FRONT\n var cdFrontX1 = plotObj.cd.front.x1;\n var cdFrontX2 = plotObj.cd.front.x2;\n var cdFrontY1 = plotObj.cd.front.y1;\n var cdFrontY2 = plotObj.cd.front.y2;\n var cdFrontS = 's';\n //bd BbdK\n var bdBackX1 = plotObj.bd.back.x1;\n var bdBackX2 = plotObj.bd.back.x2;\n var bdBackY1 = plotObj.bd.back.y1;\n var bdBackY2 = plotObj.bd.back.y2;\n var bdBackS = 'b';\n //bd FRONT\n var bdFrontX1 = plotObj.bd.front.x1;\n var bdFrontX2 = plotObj.bd.front.x2;\n var bdFrontY1 = plotObj.bd.front.y1;\n var bdFrontY2 = plotObj.bd.front.y2;\n var bdFrontS = 'b';\n\nif(frontOrBack == 'b'){\n plot(abBackX1,abBackY1,abBackX2,abBackY2,abBackS);\n plot(cdBackX1,cdBackY1,cdBackX2,cdBackY2,cdBackS);\n plot(bdBackX1,bdBackY1,bdBackX2,bdBackY2,bdBackS);\n //plot(abFrontX1,abFrontY1,abFrontX2,abFrontY2,abFrontS);\n //plot(cdFrontX1,cdFrontY1,cdFrontX2,cdFrontY2,cdFrontS);\n //plot(acFrontX1,acFrontY1,acFrontX2,acFrontY2,acFrontS);\n}\nif(frontOrBack == 'f'){\n // plot(abBackX1,abBackY1,abBackX2,abBackY2,abBackS);\n // plot(cdBackX1,cdBackY1,cdBackX2,cdBackY2,cdBackS);\n // plot(bdBackX1,bdBackY1,bdBackX2,bdBackY2,bdBackS);\n plot(abFrontX1,abFrontY1,abFrontX2,abFrontY2,abFrontS);\n plot(cdFrontX1,cdFrontY1,cdFrontX2,cdFrontY2,cdFrontS);\n plot(acFrontX1,acFrontY1,acFrontX2,acFrontY2,acFrontS);\n}\n\nvar end = buffer + text;\n//console.log(end);\nreturn end\n}", "_initShape () {\n // Set default style for shaape\n if (!this.handlePointStyle) {\n this.handlePointStyle = HANDLE_POINT_STYLE\n }\n if (!this.shapeStyle) {\n this.shapeStyle = EDIT_SHAPE_STYLE\n }\n }", "constructor(width, height) {\n // Canvas width and height\n this.width = width;\n this.height = height;\n\n // Random convex polygons\n\n // Polygon 1\n this.vertexArray1 = [\n [280, 350],\n [260, 280],\n [190, 260],\n [130, 300],\n [160, 390]\n ];\n\n // Polygon 2\n this.vertexArray2 = [\n [150, 200],\n [170, 130],\n [130, 100],\n [30, 150],\n [50, 240]\n ];\n\n // Array with 7 shapes\n this.shapes = [\n new Polygon(this.vertexArray1),\n new Polygon(this.vertexArray2),\n new RegularPolygon(6, 70),\n new RegularPolygon(4, 70),\n new RegularPolygon(3, 70),\n new Circle(70),\n new Circle(40)\n ];\n\n // Margin for positioning such that shapes do not touch canvas border\n // Given as a percentage of width and height of the canvas\n this.rl = 0.05 * width;\n this.tb = 0.05 * height;\n\n // Initialize Display SVG Nodes\n const msg = document.getElementById(\"shape-collisions\");\n\n this.shapes.forEach( shape => {\n shape.svgRoot = document.createElement(\"div\");\n shape.svgRoot.className = \"svg-icon\";\n\n // First child is the shape.svg of the shape itself\n shape.svgRoot.appendChild(shape.createSVGShapeProfile());\n\n // Second child is an svg arrow\n shape.svgRoot.appendChild(createSVGArrow());\n\n this.shapes.filter(s => s != shape).forEach(s => shape.svgRoot.appendChild(s.createSVGShapeProfile()));\n\n msg.appendChild(shape.svgRoot);\n\n // At this point, the live list returned by root.children is not needed anymore.\n // The live list is copied into an array of elements.\n // Note: Array.from removes the custom property \"shape\" from the svg element\n shape.svgArray = [...shape.svgRoot.children];\n shape.svgArray.forEach(svg => svg.style.display = \"none\");\n });\n }", "function updateShapes() {\n\trebuildLines();\t\n}", "function I_Shape(center) {\n\tvar coords = [new Point(center.x - 2, center.y),\n\t\tnew Point(center.x - 1, center.y),\n\t\tnew Point(center.x , center.y),\n\t\tnew Point(center.x + 1, center.y)];\n\n\tShape.prototype.init.call(this, coords, \"blue\");\n\n}", "function findStyle(x, t){\n push();\n fill(180,180,180);\n stroke(20,70,180);\n strokeWeight(8);\n ellipse(x, height/2, width/8,width/8);\n pop();\n textSize(30);\n fill(30, 280, 220);\n text(t, x, height/2); \n rectMode(CENTER); \n rect(x, height/2+height/20, width/50, width/50) ;\n fill(230, 40, 120);\n triangle(x-width/200, height/2+height/20-width/150, x-width/200, height/2+height/20+width/150, x+width/150, height/2+height/20);\n\n}", "function InConstructionShape() {\n\tvar shape = this.shape;\n\tshape.addPoint(new Point2D(85, 0));\n\tshape.addPoint(new Point2D(101, 27));\n\tshape.addPoint(new Point2D(101, 37));\n\tshape.addPoint(new Point2D(139, 62));\n\tshape.addPoint(new Point2D(70, 107));\n\tshape.addPoint(new Point2D(0, 62));\n\tshape.addPoint(new Point2D(38, 37));\n\tshape.addPoint(new Point2D(38, 35));\n\tshape.addPoint(new Point2D(68, 15));\n\tshape.addPoint(new Point2D(68, 8));\n\n\tthis.image.src = \"canvas/images/Costruzione.png\";\n}", "render() {\n fill(this.layerColor)\n noStroke()\n push()\n translate(width / 2, height / 2)\n if (this.randomShape < 0.33) {\n rotate(45)\n rect(0, 0, this.shapeSize * 2, this.shapeSize * 2)\n } else if (this.randomShape < 0.66) {\n ellipse(0, 0, this.shapeSize * 2, this.shapeSize * 2)\n } else {\n rotate(this.angle / 2)\n hexagon(0, 0, this.shapeSize)\n }\n pop()\n }", "getType(){\n return \"Ellipse\";\n }", "function copyShape() {\r\n\tif (anySelected) {\r\n\t\tcopy = true;\r\n\t\tvar shape = previousSelectedShape;\r\n\t\tif (shape instanceof Circle) {\r\n\t\t\t//this.radius = Math.sqrt(Math.pow(x2 - this.x1, 2) + Math.pow(y2-this.y1, 2));\r\n\t\t\t// how the radius is calculated\r\n\t\t\tnewShape = new Circle(shape.x1, shape.y1, shape.radius , shape.radius);\r\n\t\t\tnewShape.fillColour = shape.fillColour;\r\n\t\t\tnewShape.outlineColour = shape.outlineColour;\r\n\t\t\tnewShape.outlineWidth = shape.outlineWidth;\r\n\t\t\tnewShape.isSelected = false;\r\n\t\t\tnewShape.x1 = 250;\r\n\t\t\tnewShape.y1 = 200;\r\n\t\t} else if (shape instanceof Rectangle) {\r\n\t\t\tnewShape = new Rectangle(shape.x1, shape.y1, shape.x2 + shape.x1, shape.y2 + shape.y1);\r\n\t\t\tnewShape.outlineColour = shape.outlineColour;\r\n\t\t\tnewShape.fillColour = shape.fillColour;\r\n\t\t\tnewShape.outlineWidth = shape.outlineWidth;\r\n\t\t\tnewShape.isSelected = false;\r\n\t\t\tnewShape.x1 = 250;\r\n\t\t\tnewShape.y1 = 200;\r\n\t\t} else {\r\n\t\t\tnewShape = new Line(shape.x1, shape.y1, shape.x2, shape.y2);\r\n\t\t\tnewShape.fillColour = shape.fillColour;\r\n\t\t\tnewShape.outlineColour = shape.outlineColour;\r\n\t\t\tnewShape.outlineWidth = shape.outlineWidth;\r\n\t\t\tnewShape.isSelected = false;\r\n\r\n\t\t\tvar diffX = shape.x2 - shape.x1;\r\n\t\t\tvar diffY = shape.y2 - shape.y1;\r\n\t\t\tnewShape.x1 = 250;\r\n\t\t\tnewShape.y1 = 200;\r\n\t\t\tnewShape.x2 = newShape.x1 + diffX;\r\n\t\t\tnewShape.y2 = newShape.y1 + diffY;\r\n\t\t}\r\n\t\tshapes.push(newShape);\r\n\t\tshape.isSelected = false;\r\n\t\tpreviousSelectedShape = null;\r\n\t\tanySelected = false;\r\n\t\tcopy = false;\r\n\t\tdrawShapes();\r\n\t}\r\n}", "function drawShape(ctx, shape, sc, lw, fc, mousePos, withPoints){//sc = strokeStyle color, lw = lineWidth\n\t\tvar withPoints = withPoints || false;\n\t\tswitch(shape.type){\n\t\t\tcase 'poly':\n\t\t\t\tdrawPoly(ctx, shape, sc, lw, fc, mousePos, withPoints);\n\t\t\t\tbreak;\n\t\t\tcase 'rect':\n\t\t\t\t//setPoint(ctx, shape.point1, M.radius, M.curColor, M.lineWidth, M.curColor);\n\t\t\t\tdrawRect(ctx, shape.point1, shape.point2, sc, lw, fc, mousePos, withPoints);\n\t\t\t\tbreak;\n\t\t\tcase 'circle':\n\t\t\t\t//optionally draw the center point\n\t\t\t\t//setPoint(ctx, shape['center'], M.radius, M.curColor, M.lineWidth, M.curColor);\n\t\t\t\tdrawCircle(ctx, shape['center'], shape['radius'], sc, lw, fc, mousePos, withPoints);\n\t\t\t\tbreak;\n\t\t\tdefault: break;\n\t\t}\n\t}", "function fdelShape(){\r\n\tthis.shapes = [];\r\n\tthis.delPoint();\r\n}", "function convert_shape(shape) {\n var converted_shape; // Shape in usable format\n\n if (typeof shape.coordinates === 'undefined') {\n shape.coordinates = { x: 0, y: 0};\n }\n\n // Centroid of shape\n var center = {\n x: shape.coordinates.x,\n y: shape.coordinates.y\n }\n\n if (shape.dimensions['h'] && shape.dimensions['w']) // Rectangle definition\n converted_shape = generate_rectangle(shape, center);\n else if (shape.dimensions['r']) // Circle definition\n converted_shape = generate_circle(shape, center);\n\n return converted_shape;\n}", "function T_Shape(center) {\n\n\tvar coords = [new Point(center.x + 1, center.y),\n\t\tnew Point(center.x, center.y + 1),\n\t\tnew Point(center.x , center.y),\n\t\tnew Point(center.x - 1 , center.y)];\n\n\tShape.prototype.init.call(this, coords, \"yellow\");\n}", "function changeShapes() {\n if (currentShape == 'X') {\n currentShape = 'O';\n }\n else if (currentShape == 'O') {\n currentShape = 'X';\n }\n}", "get size() {\n return this.shape[0] * this.shape[1];\n }", "function shape1(){\n strokeWeight(0);\n //setting an x and y that the shape can use to build around\n var x = random(500);\n var y = random(500);\n fill(random(175, 255), 0, random(50, 200), random(100, 200));\n ellipse(x, y, 50, 50, random(150, 250));\n noFill();\n strokeWeight(1);\n stroke(255, 0, 150);\n ellipse(x, y, 45, 45, random(150, 250));\n fill(255);\n ellipse(x, y, 40, 40, random(150, 250));\n rectMode(CENTER);\n rect(x, y, 35, 35);\n prevKey = key;\n}", "function availableShape() {\n let shapes = [];\n Object.values(tdata).forEach(value => {\n let shape = value.shape;\n shape = shape[0].toUpperCase() + shape.substring(1);\n if(shapes.indexOf(shape) !== -1) {\n\n }\n else {\n shapes.push(shape);\n }\n });\n return shapes;\n}", "function testShape(w, h, xx, yy){\r\nvar shape = d3.select(\"#graph\");\r\n/*shape.append(\"rect\")\r\n\t.attr(\"width\", w)\r\n\t.attr(\"height\", h)\r\n\t.attr(\"opacity\", \".25\")\r\n\t.attr(\"transform\", \"translate(\" + (xx) + \" ,\" + (yy) + \")\")\r\n\t.attr(\"id\",\"selectedRect\");*/\r\nshape.append(\"path\") // attach a path\r\n\t.style(\"stroke\", \"blue\") // colour the line\r\n\t.style(\"stroke-width\", \"2\")\r\n\t.style(\"fill\", \"red\") // remove any fill colour\r\n\t.style(\"opacity\", \".25\")\r\n\t.attr(\"d\", \"M\"+(230)+\",\"+(140)+\", L\"+(230)+\",\"+(270)+\", L\"+(460)+\",\"+(270)+\", L\"+(460)+\",\"+(140)+\" Z\")\r\n\t.attr(\"id\",\"myshape\");\r\n\r\n//shape\r\n//\t.append(\"g\")\r\n//\t.attr(\"transform\", \"translate(\" + xx + \",\" + yy + \")\");\r\n}", "constructor() {\n this.x = random(width);\n this.y = random(-2000, -10);\n this.dx = random(-10, 10);\n this.dy = random(5, 6);\n this.size = random(20, 40);\n this.color = color(random(200, 255));\n this.touchingGround = false;\n this.shape = \"*\";\n //Very similar to raindrop\n }", "_getNonTransformedDimensions() {\n // Object dimensions\n return new fabric.Point(this.width, this.height).scalarAdd(\n this.padding + boundingBoxPadding\n )\n }", "display(){\n noStroke();\n fill(this.color);\n if(this.shape === rect){\n rotation += rotFactor;\n translate(windowWidth/2, windowHeight/2);\n rotate(rotation);\n this.shape(0, 0, this.size, this.size);\n }\n else{this.shape(this.x, this.y, this.size, this.size);}\n }", "function moveShape(x, y) {\r\n\tvar shape = previousSelectedShape;\r\n\tif (shape instanceof Circle || shape instanceof Rectangle) {\r\n\t\tshape.x1 = x - offsetX;\r\n\t\tshape.y1 = y - offsetY;\r\n\t} else {\r\n\t\tvar diffX = shape.x2 - shape.x1;\r\n\t\tvar diffY = shape.y2 - shape.y1;\r\n\t\tshape.x1 = x - offsetX;\r\n\t\tshape.y1 = y - offsetY;\r\n\t\tshape.x2 = shape.x1 + diffX;\r\n\t\tshape.y2 = shape.y1 + diffY;\r\n\t}\r\n\tdrawShapes();\t\t\r\n}", "get shapeSelectionEnabled(){return true;}", "checkCollision(other, graphics) {\n // console.log('checkCollision', this, other)\n const pointIntersect = this.shapeDraw.intersectsShape(other.shapeDraw, graphics)\n // console.log(pointIntersect)\n if (pointIntersect) return pointIntersect\n for (const child of this.children) {\n const pointIntersect = child.shapeDraw.intersectsShape(other.shapeDraw, graphics)\n if (pointIntersect) return pointIntersect\n } \n return null\n }", "render() {\n fill(this.layerColor)\n noStroke()\n push()\n translate(width / 2, height / 2)\n for (let i = 0; i <= this.numShapes; i++) {\n for (let x = this.centerOffset; x < CRYSTAL_SIZE / 2; x += this.singleStep) {\n ellipse(x, 0, this.shapeSize, this.shapeSize)\n }\n rotate(this.angle)\n }\n pop()\n }", "get Area() { return this.Width * this.Height; }", "get Area() { return this.Width * this.Height; }", "setSize() {\n this.size.D1 = this.shape.D1*this.unit.X;\n this.size.D2 = this.shape.D2*this.unit.Y;\n }", "function n(e,t,a,l){return{x:e,y:t,width:a,height:l}}", "set shape(val) {\n if (hasStringPropertyChangedAndNotNil(val, this._shape)) {\n const oldVal = this._shape;\n this._shape = val;\n this.requestUpdate('shape', oldVal);\n }\n }", "function O_Shape(center) {\n\n\tvar coords = [new Point(center.x - 1, center.y),\n\t\tnew Point(center.x - 1, center.y + 1),\n\t\tnew Point(center.x , center.y),\n\t\tnew Point(center.x , center.y + 1)];\n\n\tShape.prototype.init.call(this, coords, \"red\");\n}", "createPhysicalShape(entity, data) {\n return undefined;\n }", "function get_shapes(gl)\r\n{\r\n\r\n var steps_in_circle = 180; // This must divide or be a multiple of 360.\r\n var pyth_pos = Math.sqrt(0.75)/2.0; //Just calculate these once.\r\n var pyth_neg = pyth_pos * -1;\r\n var tri_offs = pyth_pos / 3;\r\n pyth_pos = pyth_pos + tri_offs;\r\n pyth_neg = pyth_neg + tri_offs;\r\n var id_mat = new Matrix4; id_mat.setIdentity();\r\n\r\n return [\r\n {\r\n name: \"square\",\r\n verts: new Float32Array\r\n ([ \r\n 0.5, 0.5,\r\n 0.5, -0.5,\r\n -0.5, 0.5,\r\n -0.5, -0.5\r\n ]),\r\n color: rgba32( 255, 255, 0, 128 ),\r\n mode: gl.TRIANGLE_STRIP,\r\n buffer: 0,\r\n model_matrix: new Matrix4,\r\n point_size: 1.0\r\n }\r\n ,\r\n {\r\n name: \"equilateral triangle\",\r\n verts: new Float32Array\r\n ([\r\n 0.0, pyth_pos,\r\n -0.5, pyth_neg,\r\n 0.5, pyth_neg\r\n ]),\r\n color: rgba32( 127, 127, 255, 191 ),\r\n mode: gl.TRIANGLES,\r\n buffer: 0,\r\n model_matrix: new Matrix4,\r\n point_size: 1.0\r\n }\r\n , \r\n {\r\n name: \"circle\",\r\n verts: circle_verts(steps_in_circle, 0.5, 0),\r\n color: rgba32( 42, 42, 42, 255 ),\r\n mode: gl.TRIANGLE_FAN,\r\n buffer: 0,\r\n model_matrix: new Matrix4,\r\n point_size: 1.0\r\n }\r\n ,\r\n {\r\n name: \"hexagon\",\r\n verts: circle_verts(6, 0, 0),\r\n color: rgba32( 255, 0, 255, 255 ),\r\n mode: gl.LINE_STRIP,\r\n buffer: 0,\r\n model_matrix: new Matrix4,\r\n point_size: 1.0\r\n }\r\n ,\r\n {\r\n name: \"stars\",\r\n verts: circle_verts(90, 0, 0),\r\n color: rgba32( 0, 255, 0, 128 ),\r\n mode: gl.POINTS,\r\n buffer: 0,\r\n model_matrix: new Matrix4,\r\n point_size: 5.0\r\n }\r\n ,\r\n {\r\n name: \"stars\",\r\n verts: circle_verts(90, 0, 0),\r\n color: rgba32( 255, 0, 0, 128 ),\r\n mode: gl.POINTS,\r\n buffer: 0,\r\n model_matrix: new Matrix4,\r\n point_size: 4.8\r\n }\r\n ,\r\n {\r\n name: \"triforce\",\r\n verts: new Float32Array\r\n ([\r\n -0.25, tri_offs, 0.0, pyth_pos, 0.25, tri_offs,\r\n -0.5, pyth_neg, -0.25, tri_offs, 0.00, pyth_neg,\r\n 0.0, pyth_neg, 0.25, tri_offs, 0.50, pyth_neg\r\n ]),\r\n color: rgba32( 185, 122, 87, 255 ),\r\n mode: gl.TRIANGLES,\r\n buffer: 0,\r\n model_matrix: new Matrix4,\r\n point_size: 1.0\r\n }\r\n ,\r\n {\r\n name: \"X\",\r\n verts: new Float32Array\r\n ([ //Arranged by start and end points of each line segment.\r\n 0.0000, 0.0625,\r\n 0.4375, 0.5000,\r\n 0.5000, 0.4375,\r\n 0.0625, 0.0000,\r\n 0.5000, -0.4375,\r\n 0.4357, -0.5000,\r\n 0.0000, -0.0625,\r\n -0.4375, -0.5000,\r\n -0.5000, -0.4375,\r\n -0.0625, 0.0000,\r\n -0.5000, 0.4375,\r\n -0.4375, 0.5000\r\n ]),\r\n color: rgba32( 0, 0, 0, 255 ),\r\n mode: gl.LINE_LOOP,\r\n buffer: 0,\r\n model_matrix: new Matrix4,\r\n point_size: 1.0\r\n }\r\n ,\r\n {\r\n name: \"grid\",\r\n verts: new Float32Array\r\n ([ //Grouped by line segment.\r\n -1.0, 0.75, 1.00, 0.75,\r\n -1.0, 0.50, 1.00, 0.50,\r\n -1.0, 0.25, 1.00, 0.25,\r\n -1.0, -0.25, 1.00, -0.25,\r\n -1.0, -0.50, 1.00, -0.50,\r\n -1.0, -0.75, 1.00, -0.75,\r\n 0.75, -1.00, 0.75, 1.00,\r\n 0.50, -1.00, 0.50, 1.00,\r\n 0.25, -1.00, 0.25, 1.00,\r\n -0.25,-1.00,-0.25, 1.00,\r\n -0.50,-1.00,-0.50, 1.00,\r\n -0.75,-1.00,-0.75, 1.00\r\n ]),\r\n color: rgba32( 0, 255, 0, 128 ),\r\n mode: gl.LINES,\r\n buffer: 0,\r\n model_matrix: id_mat,\r\n point_size: 1.0\r\n }\r\n ,\r\n {\r\n name: \"axis\",\r\n verts: new Float32Array\r\n ([\r\n -1.0, 0.0,\r\n 1.0, 0.0,\r\n 0.0, -1.0,\r\n 0.0, 1.0\r\n ]),\r\n color: rgba32( 255, 0, 0, 255 ),\r\n mode: gl.LINES,\r\n buffer: 0,\r\n model_matrix: id_mat,\r\n point_size: 1.0\r\n }\r\n ,\r\n {\r\n name: \"arrow\",\r\n verts: new Float32Array\r\n ([\r\n -0.25, 0.125,\r\n 0.125, 0.125,\r\n 0.125, 0.25,\r\n 0.25, 0.0,\r\n 0.125, -0.25,\r\n 0.125, -0.125,\r\n -0.25, -0.125\r\n ]),\r\n color: rgba32( 255, 255, 255, 255 ),\r\n mode: gl.LINE_LOOP,\r\n buffer: 0,\r\n model_matrix: new Matrix4,\r\n point_size: 1.0\r\n }\r\n ];\r\n}", "get boundingBox() {\n }", "function State(rectangle, mask, count) {\n this.rectangle = rectangle;\n this.mask = mask;\n this.count = count;\n this.shapes = [];\n this.index = -1;\n\n // Function to make new Square object.\n this.select = function() {\n var row, column;\n for (row = 0; row < this.rectangle.length; row++) {\n for (column = 0; column < this.rectangle[row].length; column++) {\n if (this.rectangle[row][column] == false) {\n return new Square(column, row);\n }\n }\n }\n return null;\n };\n\n // Select a figure and add it.\n this.add = function(rectangle) {\n var square, shapes;\n square = this.select();\n if (square != null) {\n shapes = rectangle[square.y][square.x];\n this.mask.forEach(function(value, index) {\n if (value == false) {\n shapes[index].forEach(function(shape) {\n this.shapes.push(shape);\n }, this);\n }\n }, this);\n }\n };\n // Move on to the next index\n this.next = function() {\n this.index = this.index + 1;\n return this.index < this.shapes.length;\n };\n\n // Check if the shape fits\n this.fit = function() {\n var shape;\n shape = this.shapes[this.index];\n return shape.squares.every(function(square) {\n return this.rectangle[square.y][square.x] == false;\n }, this);\n };\n\n // If the shape fits, mark it, add count the number of cells (6)\n this.copy = function() {\n var rectangle, shape, mask, count;\n rectangle = this.rectangle.map(function(row) {\n return row.slice();\n });\n shape = this.shapes[this.index];\n shape.squares.forEach(function(square) {\n rectangle[square.y][square.x] = true;\n });\n mask = this.mask.slice();\n mask[shape.key] = true;\n\n count = this.count + 6;\n\n \n return new State(rectangle, mask, count);\n };\n}", "function crackShapeObject(path){\r\n\tvar oldCenter = path.position;\r\n\r\n\tvar crackedParts = breakPart(path, 0);\r\n\tvar brokeparts = crackedParts[0];\r\n\tvar letterparts = crackedParts[1];\r\n\r\n\t//ToDo: check if not null\r\n\tletterparts.forEach(function(path, idx, arr) {\r\n\t\t\taddToWorld(path);\r\n\t});\r\n\r\n\tbrokeparts.forEach(function(path, idx, arr) {\r\n\t\t\taddToWorld(path);\r\n\t});\r\n}", "function makeShape(d,n,a,f1,f2,bAndDSize,baseRingStart,ringStart,addToCandD){\n var text = '';\n var buffer = '';\n var obj = {\n a: {\n x: [],\n y: [],\n frontCount: 0,\n backCount: 0,\n xBack: [],\n yBack: []\n },\n b: {\n x: [],\n y: [],\n frontCount: 0,\n backCount: 0,\n xBack: [],\n yBack: [],\n },\n c: {\n x: [],\n y: [],\n frontCount: 0,\n backCount: 0,\n xBack: [],\n yBack: [],\n },\n d: {\n x: [],\n y: [],\n frontCount: 0,\n backCount: 0,\n xBack: [],\n yBack: [],\n }\n }\n //console.log(obj);\n\n //***************************VARIABLES**********************************\n // var d = 1000;\n // var n = 15;\n // var a = sqrt(2);\n // var f1 = 1;\n // var f2 = 1;\n // var bAndDSize = .9;\n // var baseRingStart = radians(0);\n // var ringStart = radians(360);\n // var aToCAdd = radians(20);\n\n\n\n\n //*********************DERIVED*********************\n var e = 1/a;\n var aAndBStart = baseRingStart + ringStart;\n var cAndDStart = aAndBStart + addToCandD;\n var conicE = sqrt((a*a)-1)/a;\n var radUse = radians(180)/d;\n var numbersArr = numbers(0,d,1);\n var radUseArr = numbers(0,d,radUse);\n var oneMinusCos = fancyNumbers(radUseArr,f1);\n var pathNum = arrMultiply(oneMinusCos,d/2);\n var pathRad = arrMultiply(pathNum,radUse);\n var pathx = arrSin(pathRad);\n var pathy = arrCos(pathRad,conicE);\n var ww1 = fancyww1(radUseArr,f2,n);\n var ww2 = fancyww2(ww1);\n var wrapRadArr = wrapRad(ww2);\n\n //MAKING WRAPS\n var wrapAx = wrapXFun(wrapRadArr,aAndBStart,pathx,1);\n var wrapAy = wrapYFun(pathx,e,wrapRadArr,aAndBStart,pathy,1);\n var wrapBx = wrapXFun(wrapRadArr,ringStart,pathx,bAndDSize);\n var wrapBy = wrapYFun(pathx,e,wrapRadArr,ringStart,pathy,bAndDSize);\n var wrapCx = wrapXFun(wrapRadArr,cAndDStart,pathx,1);\n var wrapCy = wrapYFun(pathx,e,wrapRadArr,cAndDStart,pathy,1);\n var wrapDx = wrapXFun(wrapRadArr,cAndDStart,pathx,bAndDSize);\n var wrapDy = wrapYFun(pathx,e,wrapRadArr,cAndDStart,pathy,bAndDSize);\n\n //PUTING WRAPS IN OBJ\n obj.a.x = wrapAx;\n obj.b.x = wrapBx;\n obj.c.x = wrapCx;\n obj.d.x = wrapDx;\n obj.a.y = wrapAy;\n obj.b.y = wrapBy;\n obj.c.y = wrapCy;\n obj.d.y = wrapDy;\n\n// //REVERSING ARRAYS TO PLOT FROM GROUND UP\n obj.a.x.reverse();\n obj.b.x.reverse();\n obj.c.x.reverse();\n obj.d.x.reverse();\n obj.a.y.reverse();\n obj.b.y.reverse();\n obj.c.y.reverse();\n obj.d.y.reverse();\n\n //PUTTING FRONT AND BACK COUNTS IN OBJ\n obj.a.frontCount = getFront(obj.a.x,obj.a.y,.99).frontCount;\n obj.a.backCount = getFront(obj.a.x,obj.a.y,.99).backCount;\n obj.b.frontCount = getFront(obj.b.x,obj.b.y,.9*bAndDSize).frontCount;\n obj.b.backCount = getFront(obj.b.x,obj.b.y,.9*bAndDSize).backCount;\n obj.c.frontCount = getFront(obj.c.x,obj.c.y,.99).frontCount;\n obj.c.backCount = getFront(obj.c.x,obj.c.y,.99).backCount;\n obj.d.frontCount = getFront(obj.d.x,obj.d.y,.9*bAndDSize).frontCount;\n obj.d.backCount = getFront(obj.d.x,obj.d.y,.9*bAndDSize).backCount;\n\n //SEPARATING FRONT AND BACK IN OBJ\n var separateA = separate(obj.a.x,obj.a.y,obj.a.frontCount,obj.a.backCount);\n var separateB = separate(obj.b.x,obj.b.y,obj.b.frontCount,obj.b.backCount);\n var separateC = separate(obj.c.x,obj.c.y,obj.c.frontCount,obj.b.backCount);\n var separateD = separate(obj.d.x,obj.d.y,obj.c.frontCount,obj.b.backCount);\n obj.a.xFront = separateA.xFront;\n obj.a.xBack = separateA.xBack;\n obj.b.xFront = separateB.xFront;\n obj.b.xBack = separateB.xBack;\n obj.c.xFront = separateC.xFront;\n obj.c.xBack = separateC.xBack;\n obj.d.xFront = separateD.xFront;\n obj.d.xBack = separateD.xBack;\n\n obj.a.yFront = separateA.yFront;\n obj.a.yBack = separateA.yBack;\n obj.b.yFront = separateB.yFront;\n obj.b.yBack = separateB.yBack;\n obj.c.yFront = separateC.yFront;\n obj.c.yBack = separateC.yBack;\n obj.d.yFront = separateD.yFront;\n obj.d.yBack = separateD.yBack;\n\n\n\n\nconsole.log(obj)\n\n\n\n //var finalCount = 0;\n var mainBack = obj.a.backCount; //frontCount because reversed\n var mainFront = obj.a.frontCount; //frontCount because reversed\n var frontUse = 1/(mainFront/2);\n var backUse = 1/(mainBack/2);\n\n\n\n function plot(x1,y1,x2,y2,x3,y3,x4,y4){\n\n //1 = white\n //0 = black\n var scale = 1;\n var use = 1/(x1.length/2);\n var k = 0;\n var m = 0;\n\n for(i=0;i<x1.length;i++){\n if(k<mainFront/2){\n var put = frontUse * m;\n m++\n //end should be 1\n }\n if(k>=mainFront/2 && k<=mainFront){\n var put = frontUse * m;\n m--\n //end should be 0\n }\n if(k>mainFront && k<=mainFront+(mainBack/2)){\n var put = backUse * m;\n m++\n //end should be 1\n }\n if(k>mainFront+(mainBack/2) && k<=mainFront+mainBack){\n var put = backUse * m;\n m--\n //end should be 0\n }\n\n\n buffer += 'newbuffer' + '\\n';\n buffer += 'newbuffer' + '\\n';\n buffer += 'newbuffer' + '\\n';\n buffer += 'newbuffer' + '\\n';\n buffer += 'newbuffer' + '\\n';\n //a to c\n text += 'addvalue ' + finalCount + ' ' + x1[i] + ' ' + y1[i] + '\\n';\n text += 'addvalue ' + finalCount + ' ' + x2[i] + ' ' + y2[i] + '\\n';\n text += 'bcolor ' + put + ' ' + put + ' ' + put + ' ' + finalCount + '\\n'\n\n finalCount++\n\n //c to d\n text += 'addvalue ' + finalCount + ' ' + x2[i] + ' ' + y2[i] + '\\n';\n text += 'addvalue ' + finalCount + ' ' + x3[i] + ' ' + y3[i] + '\\n';\n text += 'bcolor ' + .9 + ' ' + put + ' ' + put + ' ' + finalCount + '\\n'\n finalCount++\n //d to b\n text += 'addvalue ' + finalCount + ' ' + x3[i] + ' ' + y3[i] + '\\n';\n text += 'addvalue ' + finalCount + ' ' + x4[i] + ' ' + y4[i] + '\\n';\n text += 'bcolor ' + put + ' ' + put + ' ' + put + ' ' + finalCount + '\\n'\n finalCount++\n //b to a\n text += 'addvalue ' + finalCount + ' ' + x4[i] + ' ' + y4[i] + '\\n';\n text += 'addvalue ' + finalCount + ' ' + x1[i] + ' ' + y1[i] + '\\n';\n text += 'bcolor ' + .9 + ' ' + put + ' ' + put + ' ' + finalCount + '\\n'\n\n k++\n finalCount++\n }\n }\n\nplot(obj.a.x,obj.a.y,obj.c.x,obj.c.y,obj.d.x,obj.d.y,obj.b.x,obj.b.y)\n\nvar end = buffer + text;\n//console.log(end);\nreturn end\n}", "get rect() {\n return {\n x: this.x - this.width / 2,\n y: this.y - this.height / 2,\n width: this.width,\n height: this.height,\n };\n }", "function S_Shape(center) {\n\n\tvar coords = [new Point(center.x + 1, center.y),\n\t\tnew Point(center.x, center.y + 1),\n\t\tnew Point(center.x , center.y),\n\t\tnew Point(center.x - 1 , center.y + 1)];\n\n\tShape.prototype.init.call(this, coords, \"green\");\n}", "createShapes() {\n this.shape = new Shape(\"shape\", {\n data: {\n speed: this.timing\n }\n });\n\n this.nextShape = new Shape(\"nextShape\", {\n x: 610,\n y: 110\n });\n\n this.nextShape.movable = false;\n this.nextString = new SimpleText(\"nextString\", {\n text: \"Next\",\n x: 620,\n y: 70\n });\n\n this.scoreString = new SimpleText(\"scoreString\", {\n text: \"Score: 0\",\n x: 50,\n y: 70\n });\n\n this.linesString = new SimpleText(\"linesString\", {\n text: \"Lines: 0\",\n x: 50,\n y: 120\n });\n\n this.levelString = new SimpleText(\"levelString\", {\n text: \"Level: 0\",\n x: 50,\n y: 170\n });\n\n this.pauseString = new SimpleText(\"pauseString\", {\n text: \"Pause\",\n x: 380,\n y: 550,\n visible: false\n });\n\n this.controls = new SimpleText(\"controlsString\", {\n text: \"Controls:\\narrow keys\",\n x: 50,\n y: 220\n });\n\n this.flashLines = new FlashLines(\"flash\", {\n x: (TOTAL_WIDTH - TILE_WIDTH * MAP_COLS) / 2 + TILE_WIDTH,\n y: (TOTAL_HEIGHT - TILE_HEIGHT * MAP_ROWS) / 2,\n width: TILE_WIDTH * (MAP_COLS - 2),\n lineHeight: TILE_HEIGHT\n });\n }", "function removeShape() {\n for (var row = 0; row < currentShape.shape.length; row++) {\n for (var col = 0; col < currentShape.shape[row].length; col++) {\n if (currentShape.shape[row][col] !== 0) {\n grid[currentShape.y + row][currentShape.x + col] = 0;\n }\n }\n }\n}", "getShapeCollision(shape) {\n return shape.blocks.some(\n block => this.getBlockCollision(block)\n );\n }", "function S(){var e=le.getBoundingClientRect(),t=\"offset\"+[\"Width\",\"Height\"][n.ort];return 0===n.ort?e.width||le[t]:e.height||le[t]}", "function KShape(value,shape) { \n return value / (value + (1 - (1/shape)) * (value-1));\n}", "function SaveTheView()\n{\n console.log($(\".display-area\")[0].children)\n var z=$(\".display-area\")[0].children.length;\n for(i=0;i<z;i++)\n {\n console.log($(\".display-area\")[0].children[i])\n console.log($(\".display-area\")[0].children[i].attributes.name.value)\n console.log($(\".display-area\")[0].children[i].style.position)\n console.log($(\".display-area\")[0].children[i].style.top)\n console.log($(\".display-area\")[0].children[i].style.left)\n \n shapes.id=$(\".display-area\")[0].children[i].id;\n shapes.type=$(\".display-area\")[0].children[i].attributes.name.value;\n shapes.position=$(\".display-area\")[0].children[i].style.position;\n shapes.left=$(\".display-area\")[0].children[i].style.left;\n shapes.top=$(\".display-area\")[0].children[i].style.top;\n }\n console.log(shapes)\n}", "function drawBabyzenomorph(x, y) {\n fill('grey')\n stroke('grey')\n strokeWeight(5)\n ellipse(x, y, w)\n ellipse(x, y - 20, w + 5, 25)\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x - 25, y - 25);\n vertex(x - 25, y - 25);\n vertex(x - 20, y - 35)\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x + 25, y - 25);\n vertex(x + 25, y - 25);\n vertex(x + 20, y - 35);\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x + 30, y - 15);\n vertex(x + 30, y - 15);\n vertex(x + 40, y);\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x - 30, y - 15);\n vertex(x - 30, y - 15);\n vertex(x - 40, y);\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x - 35, y + 5);\n vertex(x - 35, y + 5);\n vertex(x - 40, y + 20);\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x + 35, y + 5);\n vertex(x + 35, y + 5);\n vertex(x + 40, y + 20);\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x - 10, y - 50);\n vertex(x - 10, y - 50);\n vertex(x - 25, y - 60);\n endShape();\n\n beginShape(LINES);\n vertex(x, y);\n vertex(x + 10, y - 50);\n vertex(x + 10, y - 50);\n vertex(x + 25, y - 60);\n endShape();\n\n beginShape(TRIANGLES)\n vertex(x - 10, y);\n vertex(x + 10, y);\n vertex(x, y + 50);\n vertex(x - 5, y + 40);\n vertex(x + 5, y + 40);\n vertex(x, y + 75);\n endShape();\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 SuperShape() {\n /** @type {Boolean} Indicates validity of the shape */\n this.valid = false;\n /** @type {Array} The array of points defining the shape */\n this.pts = [];\n /** @type {String} Indicates the type of the shape, e.g. \"rect\" */\n this.type = 'none';\n}", "function not_active_shape(){\n var object = shape('', []);\n object.active = false;\n return object;\n}", "function mouseShape()\n {\n fill(106,90,205);\n circle(mouseShapeX, mouseShapeY, 35);\n }", "function me(a){this.ra=a;this.hb=null;this.Rf=new ne(a,!0,!0);this.rg=new ne(a,!1,!0);this.Ef=v(\"rect\",{height:oe,width:oe,style:\"fill: #fff\"},null);pe(this.Ef,a.of)}", "function NoteShape()\n\t{\n\t\tmxCylinder.call(this);\n\t}", "function DecorativeShape(paper, options){\n var self = this;\n this.paper = paper;\n this.shapeObject = options.shapeObject;\n this.shapesArr = options.shapesArr;\n this.changeCallback = options.changeCallback;\n this.selectCallback = options.selectCallback;\n this.deselectCallback = options.deselectCallback;\n this.dragStartCallback = options.dragStartCallback;\n this.dragEndCallback = options.dragEndCallback\n this.clickCallback = options.clickCallback;\n this.mouseoverCallback = options.mouseoverCallback;\n this.mouseoutCallback = options.mouseoutCallback;\n\n this.FTEnabled = options.FTEnabled;\n this.id = this.generateId();\n this.defaultX = 100;\n this.defaultY = 100;\n\n\n\n\n if(this.shapeObject){\n this.initFromObject();\n }else if(this.shapesArr){\n this.initFromShapesArr();\n }\n\n this.setFT();\n\n this.shapesSet.click(function(e){\n e.stopPropagation();\n e.preventDefault();\n if(self.isPartOfGroup){\n return;\n }\n\n if(self.FTEnabled){\n if(self.isDragging){\n self.isDragging = false;\n return false;\n }\n if(!self.handlesOn){\n self.handlesOn = true;\n self.ft.showHandles();\n self.selectCallback && self.selectCallback(self);\n }else{\n self.handlesOn = false;\n self.ft.hideHandles();\n self.deselectCallback && self.deselectCallback(self);\n }\n return\n }else{\n self.clickCallback && self.clickCallback(self);\n }\n\n });\n\n this.shapesSet.touchend(function(e){\n });\n\n\n}" ]
[ "0.6834569", "0.67508847", "0.67137176", "0.66884226", "0.66126215", "0.6551367", "0.6542498", "0.6489623", "0.6489623", "0.6425789", "0.6369453", "0.63574725", "0.6321959", "0.63140684", "0.6231218", "0.6221039", "0.6193941", "0.61394536", "0.61325413", "0.60903955", "0.6089341", "0.60829455", "0.6082824", "0.60774666", "0.6065434", "0.605278", "0.604401", "0.6033255", "0.6030364", "0.60163945", "0.6002213", "0.5988246", "0.59866345", "0.5985465", "0.59624404", "0.59540504", "0.59387517", "0.59340405", "0.592819", "0.59222186", "0.5909499", "0.59057194", "0.58997333", "0.58955747", "0.5875378", "0.5872072", "0.58610004", "0.58588845", "0.5852485", "0.58413374", "0.58329916", "0.5829284", "0.58011335", "0.5798938", "0.57945913", "0.57827127", "0.5782169", "0.5778729", "0.577208", "0.5768541", "0.57588756", "0.5754976", "0.57522756", "0.57359266", "0.57224005", "0.5720777", "0.57106847", "0.5710203", "0.57097566", "0.57012576", "0.56922746", "0.56804335", "0.56774", "0.56766427", "0.56766427", "0.56756014", "0.5675487", "0.56725174", "0.56722426", "0.5670738", "0.5662887", "0.56582904", "0.5647571", "0.56451654", "0.5643247", "0.5637677", "0.5637293", "0.5635808", "0.5628799", "0.56273013", "0.56210536", "0.5615922", "0.56104547", "0.5606872", "0.55987626", "0.55982983", "0.5594317", "0.5585011", "0.5583751", "0.5581492", "0.5580062" ]
0.0
-1
You can set the sprite's update function to your own custom update function that will be run after every draw call or when the updateSprites function is called.
get update() { return this._update; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update(){\r\n this.sprite.y += this.staticVelY;\r\n }", "update()\n {\n this.baseTexture.update();\n }", "update() {\n this.baseTexture.update();\n }", "setSprite() {\n\n // Flip sprite if moving in a direction\n if (this.body.velocity.x > 0) {\n this.sprite.setFlipX(false);\n } else if (this.body.velocity.x < 0) {\n this.sprite.setFlipX(true);\n }\n\n // If not moving play idle animation\n if (this.body.velocity.x !== 0 || this.body.velocity.y !== 0) {\n this.sprite.play(`${this.data.values.sprite}_run`, true);\n } else {\n this.sprite.play(`${this.data.values.sprite}_idle`, true);\n }\n }", "update() {\n\n //Update the drag and drop system\n if (this.draggableSprites.length !== 0) this.updateDragAndDrop(this.draggableSprites);\n\n //Update the buttons and button-like interactive sprites\n if (this.buttons.length !== 0) this.updateButtons();\n }", "render(delta, spriteBatch) {}", "function updateAll() {\r\n //Update each position by substituting its object in updateObj() method\r\n updateObj( star );\r\n updateObj( bullet );\r\n updateObj( enemyBullet );\r\n updateObj( enemy );\r\n updateObj( explosion );\r\n if ( !gameOver ) {\r\n jiki.update();//Update the sprite position\r\n }\r\n}", "function Update () {\n\n}", "function Update () {\n\n}", "function Update() {}", "function Update () {\n}", "function Update () {\n}", "function Update () {\n}", "function update() {\n sprite2.visible = false;\n sprite3.visible = false;\n\n if (sprite.scale.x >= 0.5) {\n if (count >= 100) {\n if (sprite3.scale.x < 0.2) {\n sprite2.visible = true;\n sprite2.animations.stop();\n sprite2.scale.x = 0.2;\n sprite2.scale.y = 0.2;\n sprite2.x = 100;\n sprite2.y = 100;\n } else {\n sprite2.visible = false;\n sprite3.visible = true;\n sprite3.scale.x -= 0.005;\n sprite3.scale.y -= 0.005;\n }\n } else {\n sprite2.visible = true;\n sprite.visible = false;\n sprite2.scale.x = 0.5;\n sprite2.scale.y = 0.5;\n count++;\n }\n } else {\n sprite.scale.x += 0.005;\n sprite.scale.y += 0.005;\n }\n}", "function Sprite(attr) {\n this.x = attr.x;\n this.y = attr.y;\n this.width = attr.width;\n this.height = attr.height;\n this.dx = 0;\n this.dy = 0;\n this.flipped = attr.flipped;\n this.held = attr.held;\n this.index = attr.index;\n this.images = attr.images;\n this.states = attr.states;\n this.update = attr.update;\n this.draw = function(context) {\n context = (context === undefined) ? ctx : context; \n var anim = this.states[this._state];\n if (anim.last === undefined) {\n anim.last = anim.img.width / this.width - 1;\n }\n if (this._frame != anim.last ) {\n this._frame += 1;\n } else if (anim.repeat) {\n this._frame = anim.start;\n }\n context.drawImage(anim.img, this._frame * this.width, 0, this.width, this.height, this.x, this.y, this.width, this.height);\n };\n //This is a pretty neat idea VV worth talking about\n this.set_state = function(state) {\n if (this._state != state) {\n var anim = this.states[state];\n this._frame = anim.start;\n this._state = state;\n }\n };\n this.collide\n\n this._state = attr.state;\n this._frame = 0;\n //this._idle = true;\n\n\n}", "updateSprite () {\n this.setDirState(null, null)\n }", "function drawSprites() {\n for (var i = 0; i < numberOfSprites; i++) {\n spritesArray[i].showSprite(); // Updates the z value\n spritesArray[i].moveSprite(); // Paints new object\n }\n}", "function sprite(tempS) {\n this.s = tempS;\n \n this.displayIdle = function() {\n scale(this.s);\n curSprite = 0;\n image(idleSprite[curSprite], 100, height-groundHeight-150);\n }\n this.displayWalk = function() {\n scale(this.s);\n image(walkSprite[curSprite], 100, height-groundHeight-150-spriteCounterBop);\n walk();\n }\n this.displayMoving = function() {\n scale(this.s);\n if (keyIsPressed) {\n image(walkSprite[curSprite], 100 + spriteXCounter, height-groundHeight-150-spriteCounterBop);\n walk();\n console.log(curSprite);\n console.log(wait);\n } else {\n image(idleSprite[spriteId], 100 + spriteXCounter, height-groundHeight-150-spriteCounterBop);\n }\n }\n this.displaySleep = function() {\n scale(this.s);\n snore();\n image(sleepSprite[curSprite], 100, height-groundHeight-60);\n }\n this.flipLeft = function() {\n minSprite = 5;\n maxSprite = 10;\n if (curSprite >= maxSprite) {\n curSprite = minSprite;\n }\n spriteId = 1;\n }\n this.flipRight = function() {\n minSprite = 0;\n maxSprite = 5;\n if (curSprite >= maxSprite) {\n curSprite = minSprite;\n }\n spriteId = 0;\n }\n}", "function Update () {\n\t\n}", "function drawSprites() {\r\n for (var i = 0; i < numberOfSprites; i++) {\r\n spritesArray[i].showSprite(); // Updates the z value\r\n spritesArray[i].moveSprite(); // Paints new object\r\n }\r\n}", "function Update () \r\n{\r\n\r\n\t\r\n\r\n}", "function Update () \n{\n}", "update() {\n\n // if destroyed, then ignore\n if (this._state == Actor.DESTROYED) return;\n\n // update additional script\n this.update_before(this);\n\n // update skeleton of limbs of sprites\n this.skeleton.update();\n\n // update additional script\n this.update_more(this);\n }", "update() {\n //Apply changes\n super.update()\n //Execute action\n if (this.action in this) {\n this[this.action]()\n this.output.idle = 0\n }\n\n //Update animation speed\n if (this.alive) {\n this.sprite.animationSpeed = Entity.ANIMATION_SPEED * this.adaptability\n }\n //Sudden death\n if ((this.sudden_death)||(this.hp <= 0)) {\n this.die()\n }\n }", "update_animation() {\r\n\r\n // Are we animating this sprite?\r\n if (this.sprite.animate==false)\r\n return;\r\n\r\n // Get the data for this animation sequence \r\n var sprite_data = this.sprite.animation_sequence_data[this.sprite.animation_sequence];\r\n\r\n\r\n // Only run the animation sequence once \r\n if (sprite_data.repeat == -1 && \r\n sprite_data.frame_current >= sprite_data.frame_end ) \r\n {\r\n return;\r\n } \r\n \r\n\r\n sprite_data.screen_count ++;\r\n\r\n // Move to next frame\r\n if (sprite_data.screen_count >= sprite_data.speed) {\r\n\r\n sprite_data.frame_current ++; // Move next frame\r\n sprite_data.screen_count = 0; // Reset screen count \r\n\r\n // Repeat animation X number of times \r\n if (sprite_data.repeat > 0 && \r\n sprite_data.repeat_count >= sprite_data.repeat-1) \r\n {\r\n return; \r\n }\r\n\r\n\r\n // Move back to start of animation\r\n if (sprite_data.frame_current > sprite_data.frame_end) {\r\n sprite_data.frame_current = sprite_data.frame_start;\r\n\r\n if (sprite_data.repeat > 0)\r\n sprite_data.repeat_count ++;\r\n }\r\n\r\n // reset our count. \r\n sprite_data.screen_count = 0; \r\n } \r\n }", "function initSprites() {\n function drawBallImage(r, colorStops, label) {\n var canvas = document.createElement(\"canvas\");\n canvas.width = canvas.height = r * 2;\n var ctx = canvas.getContext(\"2d\");\n \n var grad = ctx.createRadialGradient((3/4) * r, (1/2) * r, (1/16) * r,\n r, r, r);\n for (i in colorStops) {\n grad.addColorStop.apply(grad, colorStops[i]);\n }\n ctx.fillStyle = grad;\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n \n if (label) {\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n ctx.fillText(label, r, r);\n }\n \n return canvas.toDataURL();\n }\n\n function sprite(type, role) {\n if (!role)\n role = type;\n var radius = Config.radius[type];\n var colors = Config.gradientStops[Config.color[role]];\n if (Config.reverseGradient[role])\n colors.reverse();\n var label = Config.label[role];\n var key = role.substr(0, 1).toUpperCase() + role.substr(1) + \"Sprite\";\n var map = {};\n map[key] = [ 0, 0 ];\n Crafty.sprite(radius * 2, drawBallImage(radius, colors, label), map);\n }\n \n sprite(\"rocket\");\n sprite(\"smallBall\");\n sprite(\"smallBall\", \"accelerate\");\n sprite(\"smallBall\", \"increaseMass\");\n sprite(\"smallBall\", \"thief\");\n sprite(\"smallBall\", \"thiefToolkit\");\n sprite(\"smallBall\", \"goodie\");\n sprite(\"applePolisher\");\n sprite(\"inspector\");\n sprite(\"lunatic\");\n sprite(\"bigBall\");\n sprite(\"blackHole\");\n sprite(\"magneticHole\");\n}", "function update (sprite, cam) {\n\n /*\n let dx = cam.position.x - sprite.position.x,\n dy = cam.position.y - sprite.position.y,\n dz = cam.position.z - sprite.position.z;\n let dist = Math.sqrt(dx*dx + dy*dy + dz*dz);\n\n // shim the Sprite size at long distances, reduce 1-pixel flickering\n // TODO: this may be screen resolution-dependent! done for 72dpi\n // TODO: dependent on size of star default versus pixels as well\n\n //if (dist < 400) { // somewhere between 400 and 600\n if (dist < 400) {\n ///////spriteManagerStars.disableDepthWrite = false;\n sprite.width = sprite.height = dSpriteScreenSize;\n sprite.color.a = 1;\n // TODO: alpha based on absolute magnitude\n } else if (dist >= oDist) { // distance not resolved in Hyg, pre-set above\n // about 30% of Hyg3 entries are at 100000, all others are 1000 or less\n // these don't need to be recomputed to the Hyg limit (~1000 parsecs)\n }\n else {\n // this greatly reduces 'flicker' for overlapping distant stars\n ///////spriteManagerStars.disableDepthWrite = true;\n // keep size > 1 pixel\n sprite.width = sprite.height = dSpriteScreenSize + (dist/800);\n // empirical adjustment of magnitude for best '3D' effect\n let a = 2 * sprite.aMag - (dist/1200);\n if (a < 0.1) a = 0.1;\n if (a > 0.9) a = 1;\n sprite.color.a = a;\n }\n */\n \n }", "update(){\r\n this.draw();\r\n }", "render() {\n\n \tctx.drawImage(Resources.get(this.sprite), ...RENDER_AT_POSITION(this.x,this.y));\n\t}", "render() {\n\n \tctx.drawImage(Resources.get(this.sprite), ...RENDER_AT_POSITION(this.x,this.y));\n\t}", "draw_sprite(context, sprite_sequence, x, y, sprite) {\r\n\r\n // Find the src coordinates of the sprite we need.\r\n var src_y = 0;\r\n var src_x = 0;\r\n\r\n\r\n // We are using the sprite animation - wowzers.\r\n var sprite_data = this.sprite.animation_sequence_data[sprite_sequence];\r\n\r\n // Each animation sequence in expected to have its own row in the sprite\r\n // graphic - yeah I know but it makes things easier :)\r\n src_y = (sprite_sequence * this.sprite.height) + (sprite_sequence * this.sprite.pixel_border) + this.sprite.pixel_border;\r\n src_x = (sprite * this.sprite.width) + (sprite * this.sprite.pixel_border) + this.sprite.pixel_border;\r\n \r\n //context.globalCompositeOperation = \"hard-light\";\r\n //this.surface.canvas.globalCompositeOperation = \"screen\";\r\n //this.surface.canvas.globalCompositeOperation = \"screen\"; \r\n\r\n context.drawImage(this.surface.canvas,\r\n src_x,//this.sprite * this.sprite_width, \r\n src_y, \r\n this.sprite.width, \r\n this.sprite.height,\r\n x,\r\n y,\r\n this.sprite.width,\r\n this.sprite.height);\r\n\r\n\r\n\r\n }", "update()\n {\n super.update();\n \n this.scriptComponent.update();\n \n if( !menuManager.isMenuActive() )\n spriteStrategyManager.update();\n }", "drawPlayer(ctx) {\n // draw player\n ctx.save();\n ctx.drawImage(this.PLAYER.playerSprite, this.PLAYER.playerSpriteX, this.PLAYER.playerSpriteY, this.PLAYER.playerWidth, this.PLAYER.playerHeight, this.PLAYER.xPos, this.PLAYER.yPos, this.PLAYER.playerWidth, this.PLAYER.playerHeight);\n ctx.restore();\n // UPDATE WHICH SPRITE TO USE FROM SPRITE SHEET\n if(this.PLAYER.playerSpriteX != 374 && this.PLAYER.spriteOffsetCounter == 5) {\n this.PLAYER.playerSpriteX += 34;\n this.PLAYER.spriteOffsetCounter = 0;\n }\n else if(this.PLAYER.spriteOffsetCounter == 5){\n this.PLAYER.playerSpriteX = 0;\n this.PLAYER.spriteOffsetCounter = 0;\n }\n \n if(this.debug) {\n ctx.save();\n ctx.strokeStyle = \"red\";\n ctx.strokeRect(this.PLAYER.xPos, this.PLAYER.yPos, this.PLAYER.playerWidth, this.PLAYER.playerHeight);\n }\n }", "_updateSprite() {\n var nineSlice = false;\n var mesh = null;\n\n // take mesh from sprite\n if (this._sprite && this._sprite.atlas) {\n mesh = this._sprite.meshes[this.spriteFrame];\n nineSlice = this._sprite.renderMode === SPRITE_RENDERMODE_SLICED || this._sprite.renderMode === SPRITE_RENDERMODE_TILED;\n }\n\n // if we use 9 slicing then use that mesh otherwise keep using the default mesh\n this.mesh = nineSlice ? mesh : this._defaultMesh;\n\n if (this.mesh) {\n if (! this._element._beingInitialized) {\n this._updateMesh(this.mesh);\n } else {\n this._meshDirty = true;\n }\n }\n }", "update(){\n // Always update asteroid and bullet positions\n this.updateAsteroidPositions();\n this.updateBulletPositions();\n\n // Do ship updates if not destroyed\n if((this.ship.invincible && !this.shipDestroyed) || (!this.shipDestroyed && !this.ship.invincible)) {\n this.moveShip();\n this.spriteSheet.update();\n } else {\n if(this.shipExplosion.currentFrame === EXPLOSION_EFFECT_FRAMES - 1) {\n // Reset to first frame and respawn ship\n this.shipExplosion.currentFrame = 0;\n\n // if no retries allowed, end the game and show gameover layer\n if (!this.remainingLives) {\n this.gameover = true\n clearTimeout(this.timer);\n }\n\n this.shipDestroyed = false;\n } else {\n // Update explosion animation\n this.shipExplosion.update();\n }\n }\n }", "update() {\r\n this.move();\r\n this.bounce();\r\n this.paint();\r\n }", "render () {\r\n ctx.drawImage(Resources.get(this.sprite), this.x-50, this.y-100);\r\n }", "drawSprite() {\n let x = this.drawingX;\n let y = this.drawingY;\n let colorIndex = 0;\n let colorOffset = colorIndex * this.pixelHeight;\n this.imageOffset = 0;\n game.foregroundContext.drawImage(this.spriteSheet, this.imageOffset * this.pixelWidth, colorOffset, this.pixelWidth, this.pixelHeight, x, y, this.pixelWidth, this.pixelHeight);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y); \n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y); \n }", "update(){\n\n }", "updateSprite(timer) {\n timer % this.animTime === 0 ? this.currentFrame++ : null\n this.currentFrame === this.numberOfFrames ? this.currentFrame = 0 : null\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x+10, this.y, 80, 135);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x+10, this.y, 80, 135);\n }", "render(sprite,x,y) {\n ctx.drawImage(Resources.get(sprite), x, y);\n }", "render(){ \n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "update(viewX, viewY) {\n this.sprite.position.set(this.x - viewX, this.y - viewY);\n }", "function aniSprite (columnSize : int, rowSize : int, colFrameStart : int, rowFrameStart : int, totalFrames : int, framesPerSecond : float, indexReset : float)// function for animating sprites\n{\n\tvar index : int = (Time.time-indexReset) * framesPerSecond;\t\t\t\t\t\t\t\t\t\t\t\t\t// time control fps\n\tindex = index % totalFrames;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// modulate to total number of frames\n\t\n\tvar size = Vector2 ( 1.0 / columnSize, 1.0 / rowSize);\t\t\t\t\t\t\t\t\t\t\t// scale for column and row size\n\t\n\tvar u = index % columnSize;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// u gets current x coordinate from column size\n\tvar v = index / columnSize;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// v gets current y coordinate by dividing by column size\n\t\n\tvar offset = Vector2 ((u + colFrameStart) * size.x,(1.0 - size.y) - (v + rowFrameStart) * size.y); // offset equals column and row\n\t//var offset = Vector2 ((u + colFrameStart) * size.x, rowFrameStart*size.y);\n\t//var offset = Vector2 ((u + colFrameStart) * size.x, 1 - (v+rowFrameStart)*size.y);\n\t\n\trenderer.material.mainTextureOffset = offset;\t\t\t\t\t\t\t\t\t\t\t\t\t// texture offset for diffuse map\n\trenderer.material.mainTextureScale = size;\t\t\t\t\t\t\t\t\t\t\t\t\t\t// texture scale for diffuse map\n\t\n\t//renderer.material.SetTextureOffset (\"_BumpMap\", offset);\t\t\t\t\t\t\t\t\t\t// texture offset for bump (normal map)\n\t//renderer.material.SetTextureScale (\"_BumpMap\", size);\t\t\t\t\t\t\t\t\t\t\t// texture scale for bump (normal map) \n}", "function draw(){\n background(\"white\");\n if(keyDown(LEFT_ARROW)){\n changePosition(-1,0);\n }\n else if(keyDown(RIGHT_ARROW)){\n changePosition(1,0);\n }\n else if(keyDown(UP_ARROW)){\n changePosition(0,-1);\n }\n else if(keyDown(DOWN_ARROW)){\n changePosition(0,+1);\n }\n drawSprites();\n}", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "drawSprite(context){\n const yOffset = 5;\n //rounds down to whole number so sprites aren't drawn looking blurry\n\n //TODO: once board is set, this should draw in the lower left corner of each cell\n const x = Math.ceil(this.center.x) - this.creature.width/2;\n const y = Math.ceil(this.center.y) + Math.ceil(this.depth) - this.creature.height + yOffset;\n\n this.creature.draw(context, x, y);\n\n }", "update() {\n super.update();\n let state = this.state;\n let entities = state.entities;\n entities.forEach(th => {\n th.data.repulse.set(0, 0);\n });\n entities.forEach(th => {\n this._processThinker(th)\n });\n // tous les sprites doivent etre relatifs à ce point de vue\n let p = state.player.data.position;\n entities.forEach(e => {\n e.sprite.position.set(e.data.position.sub(p));\n });\n ++this.state.time;\n state.player.sprite.position.set(0, 0);\n state.view.set(p);\n }", "update () {\n\n\n }", "function draw() {\n //frameRate(1);\n //background (250);\n //xpos = xpos + 10;\n //ypos = ypos - 10;\n console.log(xpos);//check for errors\n \n image(sprite,xpos,ypos);\n}", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "function update() {\r\n paintCanvas();\r\n platformCalc();\r\n\r\n springCalc();\r\n\r\n playerCalc();\r\n player.draw();\r\n\r\n base.draw();\r\n\r\n updateScore();\r\n }", "update () {\n\n\n\n }", "draw(){\n \n \n \n image(this.spriteSheet, this.charX, this.charY, this.frameWidth*1.5, this.frameHeight*1.5, this.currentFrameX, this.currentFrameY, this.frameWidth, this.frameHeight);\n }", "function e_updateCenter(){ //function to update center of player sprite.\n this.centerx = this.x + 16;\n this.centery = this.y + 16;\n}", "_onSpriteAssetChange(asset) {\n this._onSpriteAssetLoad(asset);\n }", "render(){\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render(){\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "function update() {\n \n \n}", "render() {\n //ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "update() {\n this.character.update();\n }", "update()\n\t{\n\t\tthis.x += this.xspeed;\n\t\tthis.y += this.yspeed;\n\t}", "function drawSprite(sprite, action, pos, facing, frame) {\n var animation = sprite.animation[action];\n\n var offset;\n switch (animation.loop) {\n case \"reverse\":\n // Cycle through frames both forwards and backwards\n var cycle = frame % (animation.numFrames * 2 - 2);\n if (cycle < animation.numFrames) {\n offset = cycle;\n } else {\n offset = 2 * animation.numFrames - 2 - cycle;\n }\n break;\n\n case true:\n // Cycle through frames forwards\n offset = frame % animation.numFrames;\n break;\n\n case false:\n // Clamp to the maximum frame number\n offset = min(frame, animation.numFrames - 1);\n break;\n }\n\n drawTransformedImage\n (sprite.image, pos.x - sprite.origin.x + sprite.cellSize.x / 2,\n pos.y - sprite.origin.y + sprite.cellSize.y / 2, \n 0, facing, 1, \n (animation.x + offset) * sprite.cellSize.x, animation.y * sprite.cellSize.y, \n sprite.cellSize.x, sprite.cellSize.y);\n}", "render (){\n\tctx.drawImage(Resources.get(this.sprite), this.actualx, this.actualy);\n }", "render() {\r\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\r\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render(){\n\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "function updateDraw(){\r\n //ToDo\r\n }", "setSprite(state) {\n this.sprite.animationTime = 0;\n this.sprite.animationFrame = 0;\n }", "function Update() {\n drawBackground();\n blocs.forEach(bloc => {\n bloc.draw();\n bloc.move();\n });\n}", "function update() { \n ball.update();\n player.update();\n ai.update();\n}", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }" ]
[ "0.71677786", "0.7020461", "0.6896807", "0.6890285", "0.6825497", "0.67206305", "0.6705654", "0.6673887", "0.6673887", "0.66632324", "0.66557133", "0.66557133", "0.66557133", "0.66440326", "0.6636744", "0.6593263", "0.6575519", "0.65735847", "0.65674996", "0.6554387", "0.65158826", "0.6484546", "0.64841056", "0.64731145", "0.6455316", "0.64243203", "0.64123935", "0.6389854", "0.6375753", "0.6375753", "0.637494", "0.6360236", "0.63499147", "0.632226", "0.63197404", "0.62942994", "0.6293496", "0.62894326", "0.6274417", "0.6274417", "0.6273119", "0.62722206", "0.625061", "0.625061", "0.6246769", "0.62383455", "0.62328446", "0.62328446", "0.62304693", "0.62287956", "0.6227702", "0.6217914", "0.620741", "0.62062436", "0.6205108", "0.6202973", "0.61992306", "0.61983275", "0.61983275", "0.61983275", "0.61983275", "0.61983275", "0.61983275", "0.61983275", "0.61922425", "0.61920774", "0.61774224", "0.61694807", "0.6166172", "0.61659294", "0.61659294", "0.6163891", "0.6146133", "0.6141705", "0.6132876", "0.61313194", "0.6127252", "0.61262196", "0.6125697", "0.6125697", "0.6125697", "0.6125697", "0.6125697", "0.6125697", "0.6125697", "0.6125697", "0.6125697", "0.6125697", "0.6125697", "0.6125697", "0.6125697", "0.6125697", "0.6125697", "0.6125697", "0.6125697", "0.61220574", "0.61219484", "0.6114634", "0.6110744", "0.61042506", "0.60975003" ]
0.0
-1
Updates the sprite. Called automatically at the end of the draw cycle.
_update() { if (this.animation) this.animation.update(); if (!this.body) { this.rotation += this._rotationSpeed; this.x += this.vel.x; this.y += this.vel.y; } if (this.xLock) this.x = this.previousPosition.x; if (this.yLock) this.y = this.previousPosition.y; for (let prop in this.mouse) { if (this.mouse[prop] == -1) this.mouse[prop] = 0; } let a = this; for (let event in eventTypes) { for (let entry of this[event]) { let contactType; let b = entry[0]; let f = entry[1] + 1; this[event].set(b, f); if (f == 0) { this[event].delete(b); continue; } else if (f == -1) { contactType = eventTypes[event][2]; } else if (f == 1) { contactType = eventTypes[event][0]; } else { contactType = eventTypes[event][1]; } if (b instanceof Group) continue; let cb = _findContactCB(contactType, a, b); if (typeof cb == 'function') cb(a, b, f); } } if (this._customUpdate) this._customUpdate(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateSprite () {\n this.setDirState(null, null)\n }", "render () {\r\n ctx.drawImage(Resources.get(this.sprite), this.x-50, this.y-100);\r\n }", "update()\n {\n this.baseTexture.update();\n }", "render() {\n\n \tctx.drawImage(Resources.get(this.sprite), ...RENDER_AT_POSITION(this.x,this.y));\n\t}", "render() {\n\n \tctx.drawImage(Resources.get(this.sprite), ...RENDER_AT_POSITION(this.x,this.y));\n\t}", "update() {\n this.baseTexture.update();\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x+10, this.y, 80, 135);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x+10, this.y, 80, 135);\n }", "draw() {\n if( !this.hasValidStates ) {\n background(128);\n }\n else {\n this.checkPlayerSprite();\n\n // this will reset the player position, if we go outside of a collision rect\n if( this.states[this.currentState].checkForCollision(this.playerSprite) === true ) {\n // set to last good position\n if( this.playerSprite !== null ) {\n this.playerSprite.position.x = this.savedPlayerSpritePosition.x;\n this.playerSprite.position.y = this.savedPlayerSpritePosition.y;\n }\n }\n else {\n if( this.playerSprite !== null ) {\n // save the last poisition for checkCollision in the future\n this.savedPlayerSpritePosition.x = this.playerSprite.position.x;\n this.savedPlayerSpritePosition.y = this.playerSprite.position.y;\n }\n }\n\n background(this.backgroundColor);\n this.states[this.currentState].draw();\n }\n }", "draw(){\n if (this.alive === true) image(this.spriteSheet, this.x, this.y, this.frameWidth*1.5, this.frameHeight*1.5, this.currentFrameX, this.currentFrameY, this.frameWidth, this.frameHeight);\n }", "drawPlayer(ctx) {\n // draw player\n ctx.save();\n ctx.drawImage(this.PLAYER.playerSprite, this.PLAYER.playerSpriteX, this.PLAYER.playerSpriteY, this.PLAYER.playerWidth, this.PLAYER.playerHeight, this.PLAYER.xPos, this.PLAYER.yPos, this.PLAYER.playerWidth, this.PLAYER.playerHeight);\n ctx.restore();\n // UPDATE WHICH SPRITE TO USE FROM SPRITE SHEET\n if(this.PLAYER.playerSpriteX != 374 && this.PLAYER.spriteOffsetCounter == 5) {\n this.PLAYER.playerSpriteX += 34;\n this.PLAYER.spriteOffsetCounter = 0;\n }\n else if(this.PLAYER.spriteOffsetCounter == 5){\n this.PLAYER.playerSpriteX = 0;\n this.PLAYER.spriteOffsetCounter = 0;\n }\n \n if(this.debug) {\n ctx.save();\n ctx.strokeStyle = \"red\";\n ctx.strokeRect(this.PLAYER.xPos, this.PLAYER.yPos, this.PLAYER.playerWidth, this.PLAYER.playerHeight);\n }\n }", "render() {\r\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\r\n }", "drawSprite() {\n let x = this.drawingX;\n let y = this.drawingY;\n let colorIndex = 0;\n let colorOffset = colorIndex * this.pixelHeight;\n this.imageOffset = 0;\n game.foregroundContext.drawImage(this.spriteSheet, this.imageOffset * this.pixelWidth, colorOffset, this.pixelWidth, this.pixelHeight, x, y, this.pixelWidth, this.pixelHeight);\n }", "render() {\n const x = this.x - spriteWidth / 2;\n const y = this.y - spriteHeight / 2;\n ctx.drawImage(Resources.get(this.sprite), x, y);\n }", "render() {\n const x = this.x - spriteWidth / 2;\n const y = this.y - spriteHeight / 2;\n ctx.drawImage(Resources.get(this.sprite), x, y);\n }", "update() {\n fill(\"#FFF\");\n rect(this.position.x, this.position.y, this.size.x, this.size.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render () {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render () {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render () {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render () {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "display()\n {\n if (!this.destroyed)\n {\n image(this.sprite, this.xPos, this.yPos);\n }\n else\n {\n this.xPos = -999;\n this.yPos = -999;\n }\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y); \n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y); \n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y, this.width, this.height);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y, this.width, this.height);\n }", "set sprite(v) {\n this._sprite = v;\n }", "update() {\n ctx.fillStyle = this.color;\n ctx.drawImage(this.img, this.x, this.y, this.width, this.height);\n this.y += this.speedY;\n }", "update(viewX, viewY) {\n this.sprite.position.set(this.x - viewX, this.y - viewY);\n }", "update(){\r\n this.sprite.y += this.staticVelY;\r\n }", "update() {\r\n this.paint();\r\n }", "render(){\n\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y)\n }", "draw(){\n \n \n \n image(this.spriteSheet, this.charX, this.charY, this.frameWidth*1.5, this.frameHeight*1.5, this.currentFrameX, this.currentFrameY, this.frameWidth, this.frameHeight);\n }", "update(){\r\n this.draw();\r\n }", "render() {\n const x = this.x - this.spriteWidth / 2;\n const y = this.y - this.spriteHeight / 2;\n ctx.drawImage(Resources.get(this.sprite), x, y);\n }", "render() {\n //ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "function update() {\n sprite2.visible = false;\n sprite3.visible = false;\n\n if (sprite.scale.x >= 0.5) {\n if (count >= 100) {\n if (sprite3.scale.x < 0.2) {\n sprite2.visible = true;\n sprite2.animations.stop();\n sprite2.scale.x = 0.2;\n sprite2.scale.y = 0.2;\n sprite2.x = 100;\n sprite2.y = 100;\n } else {\n sprite2.visible = false;\n sprite3.visible = true;\n sprite3.scale.x -= 0.005;\n sprite3.scale.y -= 0.005;\n }\n } else {\n sprite2.visible = true;\n sprite.visible = false;\n sprite2.scale.x = 0.5;\n sprite2.scale.y = 0.5;\n count++;\n }\n } else {\n sprite.scale.x += 0.005;\n sprite.scale.y += 0.005;\n }\n}", "draw() {\n\n\t\tthis.p5.push();\n\n\t\tlet h = this.p5.map(this.sprite.height, 0, 625, 0, this.p5.height);\n\t\tlet w = h * 500/625;\n\t\tthis.p5.image(this.sprite, 0, 0, w, h);\n\n\t\tthis.p5.pop();\n\t\t\n\t}", "render() {\n this.ctx.drawImage(this.resources.getResourceCached(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render(){\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render(){\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render(){\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "draw() {\n let sprite = this.sprite;\n if (sprite == null)\n return;\n ctx.drawImage(sprite.sprite, sprite.animationFrame * sprite.width, 0, sprite.width, sprite.height, this.rect.x + sprite.xOffset, this.rect.y + sprite.yOffset, this.rect.width * sprite.xStretch, this.rect.height * sprite.yStretch);\n if (Entity.showEntityRects) {\n ctx.beginPath();\n ctx.lineWidth = \"5\";\n ctx.strokeStyle = \"#00ff00\";\n ctx.rect(this.rect.x, this.rect.y, this.rect.width, this.rect.height);\n ctx.stroke();\n }\n }", "render (){\n\tctx.drawImage(Resources.get(this.sprite), this.actualx, this.actualy);\n }", "render(sprite,x,y) {\n ctx.drawImage(Resources.get(sprite), x, y);\n }" ]
[ "0.73472536", "0.7111969", "0.70612484", "0.7026377", "0.7026377", "0.70218617", "0.69890344", "0.69890344", "0.6981303", "0.6976661", "0.6918003", "0.69150317", "0.69030774", "0.68898034", "0.68898034", "0.68881875", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68689126", "0.68642986", "0.68642986", "0.68420774", "0.68420774", "0.68420774", "0.68420774", "0.68147093", "0.68097925", "0.68097925", "0.6799381", "0.6798098", "0.6792948", "0.6792948", "0.6781489", "0.67788976", "0.6773207", "0.67712045", "0.67593104", "0.6755312", "0.6752818", "0.6718191", "0.67084986", "0.6708233", "0.6703557", "0.668092", "0.66680455", "0.666772", "0.6666558", "0.6666558", "0.6666558", "0.6666558", "0.6666558", "0.6666558", "0.6666558", "0.6666558", "0.6666558", "0.6666558", "0.6666558", "0.6666558", "0.6666558", "0.6666558", "0.6666558", "0.6666558", "0.6666558", "0.6654461", "0.6654461", "0.6654461", "0.66411257", "0.6636147", "0.66344523" ]
0.0
-1
Displays the Sprite with rotation and scaling applied before the sprite's draw function is called.
_display() { let x = this.p.width * 0.5 - this.p.world.origin.x + this.x * this.tileSize; let y = this.p.height * 0.5 - this.p.world.origin.y + this.y * this.tileSize; // skip drawing for out-of-view bodies, but // edges can be very long, so they still should be drawn if ( this.shape != 'chain' && this.p.camera.active && (x + this.w < this.p.camera.bound.min.x || x - this.w > this.p.camera.bound.max.x || y + this.h < this.p.camera.bound.min.y || y - this.h > this.p.camera.bound.max.y) ) { return; } x = fixRound(x); x -= (this.w * this.tileSize) % 2 ? 0.5 : 0; y = fixRound(y); y -= (this.h * this.tileSize) % 2 ? 0.5 : 0; // x += this.tileSize * 0.015; // y += this.tileSize * 0.015; this.p.push(); this.p.imageMode(p5.prototype.CENTER); this.p.rectMode(p5.prototype.CENTER); this.p.ellipseMode(p5.prototype.CENTER); this.p.translate(x, y); if (this.rotation) this.p.rotate(this.rotation); this.p.scale(this._mirror.x, this._mirror.y); this.p.fill(this.color); this._draw(); this.p.pop(); this.p.p5play.autoDrawSprites = false; this._cameraActiveWhenDrawn = this.p.camera.active; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render () {\r\n ctx.drawImage(Resources.get(this.sprite), this.x-50, this.y-100);\r\n }", "render() {\n const x = this.x - spriteWidth / 2;\n const y = this.y - spriteHeight / 2;\n ctx.drawImage(Resources.get(this.sprite), x, y);\n }", "render() {\n const x = this.x - spriteWidth / 2;\n const y = this.y - spriteHeight / 2;\n ctx.drawImage(Resources.get(this.sprite), x, y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x+10, this.y, 80, 135);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x+10, this.y, 80, 135);\n }", "render() {\n\n \tctx.drawImage(Resources.get(this.sprite), ...RENDER_AT_POSITION(this.x,this.y));\n\t}", "render() {\n\n \tctx.drawImage(Resources.get(this.sprite), ...RENDER_AT_POSITION(this.x,this.y));\n\t}", "display()\n {\n if (!this.destroyed)\n {\n image(this.sprite, this.xPos, this.yPos);\n }\n else\n {\n this.xPos = -999;\n this.yPos = -999;\n }\n }", "render() {\n const x = this.x - this.spriteWidth / 2;\n const y = this.y - this.spriteHeight / 2;\n ctx.drawImage(Resources.get(this.sprite), x, y);\n }", "render () {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render () {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render () {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render () {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y, this.width, this.height);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y, this.width, this.height);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\r\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\r\n }", "render(){\n\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render(){\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render(){\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render(){\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render (){\n\tctx.drawImage(Resources.get(this.sprite), this.actualx, this.actualy);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n //ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y); \n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y); \n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "draw() {\n\n const { scaleX, scaleY, ctx } = this.world;\n const w = Math.floor(this.img.width * this.scale);\n const h = Math.floor(this.img.height * this.scale);\n const px = this.position.x * scaleX.toPx;\n const py = this.position.y * scaleY.toPx;\n this.width = w * scaleX.toUnits;\n this.height = h * scaleY.toUnits;\n\n if (!this.loaded || !this.display) return;\n\n // Draw image.\n if (this.rotation !== 0) {\n ctx.save();\n ctx.translate(px, py);\n ctx.rotate(this.rotation);\n ctx.drawImage(this.img, -w * this.pivot.x, -h * this.pivot.y, w, h);\n ctx.restore();\n } else {\n ctx.drawImage(\n this.img,\n px - w * this.pivot.x,\n py - h * this.pivot.y,\n w,\n h\n );\n }\n \n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n if (this.x > 490) {\n this.x = -5;\n }\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y)\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n this.ctx.drawImage(this.resources.getResourceCached(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render(){ \n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "display(){\n noStroke();\n fill(this.color);\n if(this.shape === rect){\n rotation += rotFactor;\n translate(windowWidth/2, windowHeight/2);\n rotate(rotation);\n this.shape(0, 0, this.size, this.size);\n }\n else{this.shape(this.x, this.y, this.size, this.size);}\n }", "render(){\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "render(){\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "renderSprite (sprite, x, y) {\n sprite.visible = true\n sprite.position.set(\n (x - this.viewport.pos[0]) * this.cellSize.x * this.zoom,\n (y - this.viewport.pos[1]) * this.cellSize.y * this.zoom\n )\n sprite.scale.set(this.zoom)\n }", "display() {\n\t\tthis.scene.pushMatrix();\n\t\tthis.scene.pushMaterial(this.spritesheetAppearance);\n\t\tthis.scene.pushTexture(this.texture);\n\n\t\tthis.scene.setActiveShaderSimple(this.shader);\n\t\tthis.spritesheetAppearance.setTexture(this.texture);\n\t\tthis.spritesheetAppearance.apply();\n\n\t\tlet position = 0;\n\n\t\tfor (let i = 0; i < this.text.length; i++) {\n\t\t\tposition = this.text[i].charCodeAt(0);\n\t\t\tthis.activateCellP(position);\n\t\t\tsuper.display();\n\t\t\tthis.scene.translate(1, 0, 0);\n\t\t}\n\n\n\t\tthis.scene.popTexture();\n\t\tthis.scene.popMaterial();\n\t\tthis.scene.popMatrix();\n\t\tthis.scene.setActiveShaderSimple(this.scene.defaultShader);\n\t}", "render() {\n //renders player image on the coordinate\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "draw()\n {\n Renderer.drawImage(this.tex.texture, this.tex.width, this.tex.height, 0, 0, this.tex.width, this.tex.height, this.x, this.y, this.width, this.height);\n }", "display() {\n // draw our player at their current position with the correct graphic\n image(this.myGraphic, this.xPos, this.yPos);\n }", "draw() {\n\n\t\tthis.p5.push();\n\n\t\tlet h = this.p5.map(this.sprite.height, 0, 625, 0, this.p5.height);\n\t\tlet w = h * 500/625;\n\t\tthis.p5.image(this.sprite, 0, 0, w, h);\n\n\t\tthis.p5.pop();\n\t\t\n\t}", "display(){\r\n var angle = this.body.angle;\r\n //Pushing in the settings to be applied on the image\r\n push();\r\n //Translating or moving the image to the given position \r\n translate(this.body.position.x, this.body.position.y);\r\n //Rotating the image based on the angle provided\r\n rotate(angle);\r\n imageMode(CENTER);\r\n image(this.image, 0, 0, this.width, this.height);\r\n //Reverting to the original settings\r\n pop();\r\n }", "render(sprite,x,y) {\n ctx.drawImage(Resources.get(sprite), x, y);\n }", "display()\n {\n image(this.sprite, this.bulletX, this.bulletY);\n }", "render() {\n push();\n translate(this.pos.x + this.xOff, this.pos.y);\n rotate(this.angle);\n imageMode(CENTER);\n image(this.design, 0, 0, this.r, this.r);\n pop();\n }", "display() {\n if (this.texture == null) {\n return;\n }\n\n this.recTex.bind(1);\n this.scene.setActiveShader(this.shader);\n this.texture.bind();\n this.rectangle.display();\n this.texture.unbind();\n this.scene.setActiveShader(this.scene.defaultShader);\n }", "draw(){\n push();\n translate(this.body.position.x, this.body.position.y);\n rotate(this.body.angle);\n\n image(\n this.image,\n -this.size.width/2,\n -this.size.height/2,\n this.size.width,\n this.size.height\n );\n pop();\n }" ]
[ "0.716745", "0.71599424", "0.71599424", "0.71472746", "0.71472746", "0.7103905", "0.7103905", "0.7088447", "0.7082064", "0.7020843", "0.7020843", "0.7020843", "0.7020843", "0.70060194", "0.70060194", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.6974374", "0.69601107", "0.6935979", "0.69038785", "0.69038785", "0.69038785", "0.6889052", "0.6883299", "0.6851509", "0.6851509", "0.6849179", "0.68392223", "0.68392223", "0.6830686", "0.6829666", "0.68279296", "0.6812988", "0.67464185", "0.6728385", "0.67276865", "0.67276865", "0.67276865", "0.67276865", "0.67276865", "0.67276865", "0.67276865", "0.67276865", "0.67276865", "0.67276865", "0.67276865", "0.67276865", "0.67276865", "0.67276865", "0.67276865", "0.67276865", "0.67276865", "0.67106164", "0.6706168", "0.67013717", "0.67013717", "0.66254246", "0.6604888", "0.657786", "0.65737075", "0.6570358", "0.65219295", "0.6517559", "0.6510372", "0.65049726", "0.6492791", "0.64890534", "0.647391" ]
0.0
-1
Draws a fixture. Used to draw the sprite's physics body.
_drawFixture(fxt) { const sh = fxt.m_shape; if (sh.m_type == 'polygon' || sh.m_type == 'chain') { if (sh.m_type == 'chain') { this.p.push(); this.p.noFill(); } let v = sh.m_vertices; this.p.beginShape(); for (let i = 0; i < v.length; i++) { this.p.vertex(v[i].x * plScale, v[i].y * plScale); } if (sh.m_type != 'chain') this.p.endShape(p5.prototype.CLOSE); else { this.p.endShape(); this.p.pop(); } } else if (sh.m_type == 'circle') { const d = sh.m_radius * 2 * plScale; this.p.ellipse(sh.m_p.x * plScale, sh.m_p.y * plScale, d, d); } else if (sh.m_type == 'edge') { this.p.line( sh.m_vertex1.x * plScale, sh.m_vertex1.y * plScale, sh.m_vertex2.x * plScale, sh.m_vertex2.y * plScale ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "draw() {\n let sprite = this.sprite;\n if (sprite == null)\n return;\n ctx.drawImage(sprite.sprite, sprite.animationFrame * sprite.width, 0, sprite.width, sprite.height, this.rect.x + sprite.xOffset, this.rect.y + sprite.yOffset, this.rect.width * sprite.xStretch, this.rect.height * sprite.yStretch);\n if (Entity.showEntityRects) {\n ctx.beginPath();\n ctx.lineWidth = \"5\";\n ctx.strokeStyle = \"#00ff00\";\n ctx.rect(this.rect.x, this.rect.y, this.rect.width, this.rect.height);\n ctx.stroke();\n }\n }", "draw() {\n this.drawExistingEntities();\n this.disableEntities();\n this.blockHeroMovement();\n this.killedEnemiesCounter();\n }", "Draw(){\n\t\tthis.context.beginPath();\n\t\tthis.context.fillRect(this.posX, this.posY, this.width, this.height);\n\t\tthis.context.closePath();\n }", "draw(ctx) {\r\n // Draw the head\r\n super.draw(ctx);\r\n\r\n // Draw all body parts\r\n for (var i = 0; i < this.length; i++) {\r\n this.bodyArray[i].draw(ctx);\r\n }\r\n\r\n // Output number of lives and score\r\n document.getElementById('lives').innerHTML = this.lives;\r\n document.getElementById('points').innerHTML = this.totalFood;\r\n }", "function draw() {\n var isHit = false; // Initialize to false\n background(0);\n drawTerrain();\n\n wallManager(); // Add and remove walls as they enter and leave the screen.\n \n // Update all walls position and draw.\n for (let i=0; i<walls.length; i++) {\n walls[i].move();\n walls[i].draw();\n isHit |= walls[i].isHitBy(trump); // True if hit by any wall.\n }\n trump.DEBUG = isHit; // Show debug overlay when hit.\n if (isHit) {trump.deathEvent();} // Perform Death functions and sounds.\n \n trump.applyGravity();\n trump.draw();\n}", "draw() {\n context2d.fillStyle = 'black';\n context2d.fillRect(0, 0, this.width, this.height);\n\n this.currentScene.draw();\n\n this.gameManager.drawHUD();\n }", "function draw() {\n var width = 80;\n var height = 80;\n var top = 0;\n var left = Math.round(Math.random() * (windowWidth - width));\n var newFire1 = $('<div>');\n newFire1.addClass('fires').css({\n 'width': width,\n 'height': height,\n 'background': 'url(\"assets/fireball3.gif\")',\n 'background-size': 'cover',\n 'display': 'inline-block',\n 'left': left,\n 'position': 'absolute',\n 'top': top,\n 'z-index': '-1'\n });\n sky.append(newFire1);\n fall(newFire1);\n\n // draw pokemon randomly\n var rand = Math.round(Math.random() * 10);\n var pokemonSelector = Math.round(Math.random() * 11);\n var pokemonPic = pokemons[pokemonSelector];\n if (rand === 7) {\n var pokemonHelper = $('<div>');\n left = Math.round(Math.random() * (windowWidth - width));\n pokemonHelper.addClass('helpers').css({\n 'width': width,\n 'height': height,\n 'background': pokemonPic,\n 'background-size': 'cover',\n 'display': 'inline-block',\n 'left': left,\n 'top': top,\n 'position': 'absolute',\n 'z-index': '-1'\n });\n sky.append(pokemonHelper);\n fall(pokemonHelper);\n }\n\n }", "function render() {\n /*\n * This function renders the canvas, is composed of painting all the components on the canvas and updating the state of the snake\n */\n\n // paint board, snake, and food\n paintCanvas();\n\n // update snake position, detects wall and food collisions\n updateSnake();\n }", "draw()\n {\n this.ctx.clearRect(0, 0, this.surfaceWidth, this.surfaceHeight);\n this.ctx.save();\n for (let i = 0; i < this.entities.length; i++)\n {\n this.entities[i].draw(this.ctx);\n }\n this.ctx.restore();\n }", "_draw () {\r\n\t\tthis.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\r\n\r\n\t\tthis.particles.forEach(particle => {\r\n\t\t\tparticle.draw(this.context);\r\n\t\t});\r\n\t}", "function drawFood() {\r\n ctx.fillStyle = \"green\";\r\n ctx.fillRect(snakeFood.x, snakeFood.y, moveUnit, moveUnit);\r\n }", "draw() {\n //Set up the canvas\n const canvas = document.getElementById(\"canvas\");\n const ctx = canvas.getContext(\"2d\");\n //Clearing the canvas\n ctx.clearRect(0,0,500,500);\n\n for (let i=0;i<this.snakeArr.length;i++) {\n ctx.fillRect(this.snakeArr[i].x, this.snakeArr[i].y, 19,19);\n }\n\n //Drawing our food\n ctx.fillRect(this.food.x, this.food.y, 19, 19);\n\n }", "function draw() { \n gl.clear(clearOpt);\n \n scene.render();\n\n Fx.requestAnimationFrame(draw);\n }", "function draw () {\n renderer.render(stage)\n requestAnimationFrame(draw)\n }", "function draw() {\r\n \r\n //clear out background\r\n background(255);\r\n\r\n //create a new drop on a 1% chance\r\n if(Math.random() < .05) {\r\n rainManager.createDrop();\r\n }\r\n\r\n rainManager.update();\r\n //ground.create();// supposed to call the ground function \r\n \r\n // newRect.createRect();\r\n \r\n}", "function draw() { \r\n background(189);\r\n image(backgroundImage, 0, 0, width, height);\r\n\r\n //activating simulation\r\n Engine.update(userEngine); //Engine.render(userEngine)\r\n\r\n //display of ground using matter.js\r\n ground.display();\r\n tower.display();\r\n\r\n\r\n /*\r\n using a for loop over the ball array we’ll get all the\r\ncannonballs from the balls array.\r\nIt allows us to call showCannonBalls() multiple times.\r\n */\r\n for (var i = 0; i < balls.length; i++) {\r\n showCannonBalls(balls[i], i);//balls[0],0\r\n }\r\n\r\n \r\n cannon.display();\r\n}", "draw(context){\n if(this.depth < this.maxDepth){\n context.drawImage(this.buffer, 0, Math.ceil(this.depth));\n if(this.creature){\n this.drawSprite(context);\n //context.strokeStyle = this.creature.type === \"plant\" ? '#008000':'#f00'; // some color/style\n //context.lineWidth = 2; // thickness\n //context.strokeRect(x, y, 32, 32);\n }\n }\n //context.fillText(this.name, this.center.x - 20, this.center.y + 10);\n }", "draw()\n {\n Renderer.drawImage(this.tex.texture, this.tex.width, this.tex.height, 0, 0, this.tex.width, this.tex.height, this.x, this.y, this.width, this.height);\n }", "function _draw(ctx){\r\n\t\t// the _draw() method renders all of our game objects on the stage\r\n\t\t// for now we just have single object (our ship)\r\n\t\tship.draw(ctx);\r\n\t}", "function draw() {\n\t\tctx.fillStyle = \"#000000\";\n\t\tvar pointSize = 3;\n\n\t\t// Clear canvas\n\t\tctx.clearRect(0, 0, c.width, c.height);\n\n\t\t// Reset accelerations\n\t\tbodies.forEach(function(body) {\n\t\t\tbody.ax = 0;\n\t\t\tbody.ay = 0;\n\n\t\t\tctx.beginPath();\n\t\t\tctx.arc(body.x, body.y, Math.pow((Math.log10(body.mass)/32),1.5)*pointSize, 0, Math.PI*2);\n\t\t\tctx.fill();\n\t\t});\n\n\t\tbodies.forEach(function(body) {\n\t\t\tbodies.forEach(function(body2) {\n\t\t\t\tif (body2.name != body.name) {\n\t\t\t\t\tbody.applyForces(body2);\n\t\t\t\t};\n\t\t\t});\n\t\t});\n\n\t\tbodies.forEach(function(body) {\n\t\t\tbody.deltaV(body.ax, body.ay);\n\t\t\tbody.deltaX(body.vx, body.vy);\n\t\t});\n\n\t\t//test.prettyPrint;\n\t}", "function render() {\n\t\n\tctx.fillRect(0, 0, width, height);\n\ts_background.draw(ctx, 0, height - s_background.height);\n\ts_background.draw(ctx, s_background.width, height - s_background.height);\n\t\n\tman.draw(ctx);\n\n\t// draw forground sprites\n\ts_forground.draw(ctx, fgpos, height - s_forground.height);\n\ts_forground.draw(ctx, fgpos+s_forground.width, height - s_forground.height);\n\t\n\tvar width2 = width/2; // center of canvas\n\n\tif (currentstate === states.Splash) {\n\t\t// draw splash text and sprite to canvas\n\t\t\n\t\t\n\t}\n\tif (currentstate === states.Score) {\n\t\t// draw gameover text and score board\n\t\t\n\t\t// draw score and best inside the score board\n\t\t\n\n\t} else {\n\t\t// draw score to top of canvas\n\t\t\n\n\t}\n}", "draw() {\n // First, draw the head\n noStroke();\n fill(255);\n rect(this.x, this.y, tileSize);\n\n // Then, if body is > 0, draw each element of the boy\n if (this.body.length > 0) {\n for (let index = this.body.length - 1; index >= 0; index--) {\n // Get body element\n const element = this.body[index];\n // Map body element index to a [0, 255] value\n var color = map(index, 0, this.body.length - 1, 0, 255);\n if (this.body.length == 1) {\n color = 0;\n }\n // Use a green gradient\n fill(color, 255, color);\n rect(element[0], element[1], tileSize);\n }\n }\n\n // If body is > 0, shift elements and push to end head position\n if (this.body.length > 0) {\n this.body.shift(0);\n this.body.push([this.x, this.y]);\n }\n\n }", "draw() { \r\n // Make sure the canvas has been prepared\r\n if (!this._setup) {\r\n this.prepare();\r\n }\r\n \r\n // Get the drawing context\r\n let ctx = this._canvas.getContext(\"2d\");\r\n \r\n // Clear the canvas by displaying only the background color\r\n ctx.fillStyle = this._background;\r\n ctx.fillRect(0, 0, this._width, this._height);\r\n \r\n // Loop through all of the shapes, asking them to draw theirselves\r\n // on the drawing context\r\n this._shapes.forEach(s => s.draw(ctx));\r\n }", "function drawFood() {\n ctx.fillStyle = 'blue';\n ctx.fillRect(food.x, food.y, side, side);\n}", "draw() {\n if (this.waves.lives == 0) {\n this.ctx.fillStyle = colours.flat_davys_grey;\n this.ctx.fillRect(0, 0, this.size.x, this.size.y);\n this.ctx.fillStyle = colours.flat_electric_blue;\n this.ctx.font = (this.wallSize) + 'px \"Press Start 2P\"';\n this.ctx.fillText('GAME OVER ', this.canvas.width / 2 - this.wallSize * 4, this.canvas.height / 2);\n this.ctx.font = (this.wallSize)/2 + 'px \"Press Start 2P\"';\n this.ctx.fillText('You reached wave ' + (this.waves.waveNo - 1), this.canvas.width / 2 - this.wallSize * 4, this.canvas.height / 2 + this.wallSize);\n let enemy = new Sprite (\n this.canvas,\n this.ctx,\n new Vector((this.canvas.width/2) - this.wallSize * 2.5, this.wallSize * 3), // position\n new Vector(0, 0),\n new Vector(this.wallSize * 5, this.wallSize * 5), // size\n new Spritesheet(images.enemy),\n [0, 11]\n );\n enemy.draw();\n document.getElementById('Game').classList.add(\"hide\");\n document.getElementById('GameOver').classList.remove(\"hide\");\n } else {\n this.walls.forEach(sprite => sprite.draw());\n // this.enemywalls.forEach(sprite => sprite.draw());\n this.towers.forEach(sprite => sprite.draw());\n if (this.wavesStart)\n this.waves.draw();\n this.moveTower.draw();\n }\n }", "draw() {\n // push the scene objects to the scene array\n this.prepareScene();\n\n // call each object's draw method\n this.drawSceneToCanvas();\n }", "function render() {\n\t\t// create array of background images\n\t\tvar bkgdRowImgs = [\n\t\t\t'images/sky2.png', // top row is second level of sky\n\t\t\t'images/sky1.png', // first level of sky\n\t\t\t'images/sand1.png']; // top level of sand\n\t\tvar numRows = 3,\n\t\t\tnumCols = 5,\n\t\t\trow, col;\n\n\t\t// draw background using images in the row/column / grid format\n\t\tfor (row = 0; row < numRows; row++) {\n\t\t\tfor (col = 0; col < numCols; col++) {\n\t\t\t\t// use drawImage function to draw on canvas from Resources cache\n\t\t\t\tctx.drawImage(Resources.get(bkgdRowImgs[row]), col * 152, row * 152);\n\t\t\t}\n\t\t}\n\n\t\tif (sonic.lives > 0)\n\t\t\trenderEntities();\n\t\telse {\n\t\t\tctx.font = '30px monospace';\n\t\t\tctx.textAlign = 'center';\n\t\t\tctx.fillStyle = 'palevioletred';\n\t\t\tvar finalScore = 'FINAL SCORE: ' + sonic.score.toString();\n\t\t\tctx.fillText(finalScore, canvas.width/2, 130);\n\t\t\tctx.fillText('Press up arrow twice to play again', canvas.width/2, 200);\n\t\t}\n\t}", "function draw() {\n drawBg();\n drawObjects();\n bird.draw();\n}", "resetFixture() {\n this.body.body.DestroyFixture(this.fixture);\n this.addToBody(this.body);\n }", "resetFixture() {\n this.body.body.DestroyFixture(this.fixture);\n this.addToBody(this.body);\n }", "function drawElements() {\n that.gameArea.paint(that.contex);\n that.food.paint(that.contex, that.gameArea.cellSize);\n that.snake.paint(that.contex, that.gameArea.cellSize);\n }", "function draw(){\n empty(); // clear canvas\n context.fillStyle = boxColor; // change our paintbrush color\n context.fillRect(xOffset,yOffset,boxSize,boxSize); // draw box\n drawFood();\n}", "function render() {\n\t//clear last frame\n\tcanvas2d.clearRect(0,0,size[0],size[1]);\n\n\tsnake.move();\n\tfoodController.foodList.forEach(function(currentFood){\n\t\tif ((snake.pos[0][0] === currentFood[0]) && (snake.pos[0][1] === currentFood[1])) {\n\t\t\tsnake.grow();\n\t\t\tvar del = foodController.foodList.indexOf(currentFood);\n\t\t\tfoodController.foodList.splice(del, 1);\n\t\t\tscore += 100;\n\n\t\t}\n\t\tcanvas2d.fillStyle = \"#FF0000\";\n\t\tcanvas2d.fillRect(currentFood[0]*tileSize, currentFood[1]*tileSize, tileSize, tileSize);\n\t\tcanvas2d.fillStyle = \"#000000\";\n\t})\n\n\t//draw each part of snake\n\tsnake.pos.forEach(function(currentPos){\n\t\t//if inside frame\n\t\tif ((currentPos[0] >= 0 && currentPos[0] < size[0]/tileSize) && (currentPos[1] >= 0 && currentPos[1] < size[1]/tileSize)){\n\t\t\tcanvas2d.fillRect(currentPos[0]*tileSize, currentPos[1]*tileSize, tileSize, tileSize);\n\t\t} else {\n\t\t\t//die\n\t\t\treset();\n\t\t}\n\t});\n\tvar i = 1;\n\tsnake.pos.forEach(function(currentPos){\n\t\tif (i!=1){ //if not the head\n\t\t\tif ((snake.pos[0][0] === currentPos[0]) && (snake.pos[0][1] === currentPos[1])){\n\t\t\t\t//die\n\t\t\t\treset();\n\t\t\t}\n\t\t}\n\t\ti++;\n\t})\n\n\tcanvas2d.font = \"18px Arial\";\n\tcanvas2d.fillText(\"Score: \" +score,5,15);\n}", "function draw() {\n\t//clear the board\n\tctx.clearRect(0, 0, canvas[0].width, canvas[0].height);\n\n\t//draw the player\n\tplayer.draw(ctx);\n\n\t//draw the turrets\n\t$.each(turrets, function(i,turr) {\n\t\tturr.draw(ctx);\n\t});\n\n\t//draw the projectiles\n\t$.each(projectiles, function(i,proj) {\n\t\tproj.draw(ctx);\n\t});\n\n\t//draw the effects\n\t//make sure damaging effects are on top\n\tvar damagingEffects = [];\n\t$.each(effects, function(i,eff) {\n\t\tif (eff.getDoesDamage()) {\n\t\t\tdamagingEffects.push(eff);\n\t\t} else {\n\t\t\teff.draw(ctx);\n\t\t}\n\t});\n\n\t$.each(damagingEffects, function(i,eff) {\n\t\teff.draw(ctx);\n\t});\n}", "draw()\n {\n let current, context\n const multiplier = Math.ceil(this.scale * this.resolution)\n for (let key in this.textures)\n {\n const texture = this.textures[key]\n if (texture.canvas !== current)\n {\n if (typeof current !== 'undefined')\n {\n context.restore()\n }\n current = texture.canvas\n context = this.canvases[current].getContext('2d')\n context.save()\n context.scale(multiplier, multiplier)\n }\n context.save()\n context.translate(Math.ceil(texture.x / multiplier), Math.ceil(texture.y / multiplier))\n if (this.testBoxes)\n {\n context.fillStyle = this.randomColor()\n context.fillRect(0, 0, Math.ceil(texture.width / multiplier), Math.ceil(texture.height / multiplier))\n }\n switch (texture.type)\n {\n case CANVAS:\n texture.draw(context, texture.param, this.canvases[current])\n break\n\n case IMAGE: case DATA:\n context.drawImage(texture.image, 0, 0)\n break\n }\n if (this.extrude)\n {\n this.extrudeEntry(texture, context, current)\n }\n context.restore()\n }\n context.restore()\n }", "function draw_body_from_template(name, pos, alpha)\n{\n\ttemplates['fake_body'].render.globalAlpha = alpha || 1;\n\ttemplates['fake_body'].position = pos;\n\tCommon.extend(templates['fake_body'].render.sprite, templates[name].render.sprite);\n\tMatter.Body.redraw(engine, templates['fake_body']);\n}", "function draw() {\n background(0);\n avatar.update();\n //check for collision\n for (let i = 0; i < foods.length; i++) {\n\tif (avatar.collide(foods[i])) {\n\t\tavatar.eat(foods[i]);\n\t\tbreak;\n\t\t}\n\t}\n avatar.display();\n //Display food\n for (let i = 0; i < foods.length; i++) {\n\tfoods[i].update();\n\tfoods[i].display();\n\t}\n}", "function Draw(self){\n self.viewport.clearRect(0,0,self.viewport.canvas.width, self.viewport.canvas.height); //do not edit this line\n /********************************/\n /**PUT YOUR DRAWING CODE BELOW**/\n /*******************************/\n self.viewport.fillStyle = \"rgb(200,150,150)\"; //background fill color - change or remove this if you want\n //fill background - change or remove the line below if you want\n self.viewport.fillRect(0,0,self.viewport.canvas.width,self.viewport.canvas.height);\n\n\n /******************************/\n /**END YOUR DRAWING CODE HERE**/\n /******************************/\n var pancake = self.backbuffer.flatten(); //flattening the backbuffer, don't edit this line\n self.viewport.drawImage(pancake.canvas,0,0); //draw the \"pancake\" to the viewport - do not edit this line\n self.backbuffer.flush();\n}", "function drawFood(){\r\n\tctx.fillStyle=\"red\";\r\n\tctx.fillRect(food[0].x,food[0].y,snakew,snakeh);\r\n\tctx.fillStyle=\"pink\";\r\n\tctx.strokeRect(food[0].x,food[0].y,snakew,snakeh);\r\n}", "drawPlayer() {\n ctx.fillStyle = this.sprite;\n ctx.fillRect(this.positionX, this.positionY, this.height, this.width);\n }", "function draw() {\r\n\r\n //Background color.\r\n background(189, 253, 255);\r\n\r\n //This updates the Matter Engine.\r\n Engine.update(engine);\r\n\r\n //To display the platform.\r\n surface.display();\r\n\r\n //To display bricks.\r\n\r\n }", "function draw() {\n imageMode(CENTER);\n background(253, 226, 135);\n paper.display();\n ground.display();\n dustbin1.display();\n dustbin2.display();\n dustbin3.display();\n drawSprites();\n\n}", "function draw() {\n\t// clear drawing area\n\tctx.clearRect(0, 0, 400, 400);\n\n\t// draw all people\n\tfor (var id in people) {\n\t\tctx.fillRect(people[id].x, people[id].y, 10, 10);\n\t}\n\n\twindow.requestAnimationFrame(draw);\n}", "function draw() {\n\n\t//Set rectangle's Mode(starting point of making rectangle ) as (CENTRE)\n\trectMode(CENTER);\n\n\t//Set canvas' color as \"black\"\n\tbackground(0);\n\n\t//Set packageSprite's X position according to packageBody's position X\n\tpackageSprite.x = packageBody.position.x\n\n\t//Set packageSprite's Y position according to packageBody's position Y\n\tpackageSprite.y = packageBody.position.y\n\n\t//Set packageSprite's X position according to helicopter's X position\n\tpackageSprite.x = helicopterSprite.x\n\n\t//Drawing the sprites inside function draw()\n\tdrawSprites();\n\n}", "function render() {\n mario.drawMario();\n }", "function drawScene(ctx, nofill){\n\t\t\t// DRAWS SCENE\n\t\t\tctx.lineWidth = 8;\n\t\t\t// paths\n\t\t\tfor(var i=0;i<that.world.paths.length;i++){\n\t\t\t\tctx.beginPath();\n\t\t\t\t//if(i==0) ctx.fillStyle = \"#393\";\n\t\t\t\tthat.world.paths[i].draw(worldRenderer, false);\n\t\t\t\tctx.stroke();\n\t\t\t}\n\t\t\tctx.fillStyle = \"#000\";\n\t\t\t// boulders\n\t\t\tfor(var i=0;i<that.world.boulders.length;i++){\n\t\t\t\tctx.beginPath();\n\t\t\t\tthat.world.boulders[i].draw(worldRenderer, true);\n\t\t\t\tctx.stroke();\n\t\t\t}\n\t\t\t// segment (door, glass)\n\t\t\tfor(var i=0; i< that.world.segments.length;i++){\n\n\t\t\t\tctx.beginPath();\n\t\t\t\tthat.world.segments[i].draw(worldRenderer);\n\t\t\t\tctx.stroke();\n\t\t\t}\n\t\t}// en draw scene", "function render(){\n clearBoardColoration();\n drawFood();\n drawSnake();\n }", "function draw()\n{\n\tvar ctx = canvas.getContext(\"2d\");\n\tctx.clearRect(0,0,canvas.width,canvas.height);\n\n\tfor(var i in snakes)\n\t{\n\t\tvar result;\n\t\tif(i==0)\n\t\t{\n\t\t\tresult = snakes[i].update(ctx);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tresult = snakes[i].update();\n\t\t}\n\t}\n\tfor(var i=0;i<snakes.length;i++)\n\t{\n\t\t// if(i==0)wannaDraw = true;\n\t\t// else wannaDraw = false;\n\t\tif(snakes[i].collide)\n\t\t{\n\t\t\tsnakes[i].calculateFitness();\n\t\t\tdeadSnakes.push(snakes[i]);\n\t\t\tsnakes.splice(i,1);\n\t\t}\n\t}\n\tif(snakes.length==0)\n\t{\n\t\tsnakes = nextGeneration(deadSnakes);\n\t\tbestSnake = deadSnakes[deadSnakes.length-1];\n\t\tdeadSnakes = [];\n\t}\n}", "function draw() {\n // draws background rooms and handles movement from one to another\n adventureManager.draw();\n\n // drawCharacters();\n\n // don't draw them on first few screens\n if( adventureManager.getStateName() === \"Splash\" ||\n adventureManager.getStateName() === \"Instructions\" ||\n adventureManager.getStateName() === \"Characters\" ) {\n ;\n }\n else {\n //drawCharacters();\n }\n \n // draw the p5.clickables, in front of the mazes but behind the sprites\n clickablesManager.draw();\n}", "function render() {\n // Draw background color\n renderingContext.fillRect(0, 0, width, height);\n\n // Draw background sprites\n backgroundSprite.draw(renderingContext, 0, height - backgroundSprite.height);\n backgroundSprite.draw(renderingContext, backgroundSprite.width, height - backgroundSprite.height);\n\n corals.draw(renderingContext);\n fish.draw(renderingContext);\n\n if (currentState === states.Score) {\n okButtonSprite.draw(renderingContext, okButton.x, okButton.y);\n }\n\n // Draw foreground sprites\n foregroundSprite.draw(renderingContext, foregroundPosition, height - foregroundSprite.height);\n foregroundSprite.draw(renderingContext, foregroundPosition + foregroundSprite.width, height - foregroundSprite.height);\n}", "draw() {\n\n // only display the dirt if it is visible... \n if (this.visible){\n\n ctxDATA.fillStyle = this.color; \n ctxDATA.fillRect(this.x, this.y, this.w, this.h);\n \n // end of visibility check \n }\n\n // end of the draw method for the Dirt \n }", "function draw(){\r\n // We define the background color, the sky\r\n context.fillStyle = \"#c0e5f1\";\r\n // We define the x- and y-Position (top-left corner) of the background\r\n context.fillRect(0, 0, canvas.width, canvas.height);\r\n // Call the \"Draw Background\" function\r\n background.draw();\r\n // Call the \"Draw Woods\" function\r\n woods.draw();\r\n // Call the \"Draw Foreground\" function\r\n foreground.draw();\r\n // Call the \"Draw Critter\" function\r\n critter.draw();\r\n // Call the \"Draw Menu\" function\r\n menu.draw();\r\n // Call the \"Draw gameOver\" function\r\n gameOver.draw();\r\n // Call the \"Draw Score\" function\r\n score.draw();\r\n}", "function render() {\n // useful variables\n var canvasWidth = app.canvas.width;\n var canvasHeight = app.canvas.height;\n var groundY = ground.y;\n\n background.removeAllChildren();\n\n // TODO: 3 - YOUR DRAW CODE GOES HERE\n\n // this fills the background with a obnoxious yellow\n // you should modify this to suit your game\n\n document.body.style.backgroundImage = \"url('img/BackTest2.gif')\";\n document.body.style.backgroundSize = \"1720px 820px\";\n document.body.style.backgroundRepeat = \"no-repeat\";\n\n\n }", "draw() {\n this.renderer.render(this.scene, this.camera);\n }", "function draw() {\n // Clear the drawing surface and fill it with a black background\n context.fillStyle = \"rgba(0, 0, 0, 0.5)\";\n context.fillRect(0, 0, 400, 400);\n\n // Go through all of the particles and draw them.\n particles.forEach(function(particle) {\n particle.draw();\n });\n}", "function render() {\n\t\tdraw.custom(function(canvas, context) {\n\t\t\tbullets.forEach(function(bullet, index, bulletList) {\n\t\t\t\tgetSides(bullet, bullet.angle);\n\t\t\t\tcontext.fillStyle = \"black\";\n\t\t\t\tcontext.beginPath();\n\t\t\t\tcontext.moveTo(bullet.points[0].x + bullet.x, bullet.points[0].y + bullet.y);\n\t\t\t\tfor (var i = 1; i < bullet.points.length; i++) {\n\t\t\t\t\tcontext.lineTo(bullet.points[i].x + bullet.x, bullet.points[i].y + bullet.y);\n\t\t\t\t}\n\t\t\t\tcontext.closePath();\n\t\t\t\tcontext.stroke();\n\t\t\t\tcontext.fill();\n\n\t\t\t});\n\t\t\ttanks.forEach(function(tank, index, tankList) {\n\t\t\t\tgetSides(tank, tank.angle);\n\t\t\t\tcontext.fillStyle = \"black\";\n\t\t\t\tcontext.beginPath();\n\t\t\t\tcontext.moveTo(tank.points[0].x + tank.x, tank.points[0].y + tank.y);\n\t\t\t\tfor (var i = 1; i < tank.points.length; i++) {\n\t\t\t\t\tcontext.lineTo(tank.points[i].x + tank.x, tank.points[i].y + tank.y);\n\t\t\t\t}\n\t\t\t\tcontext.closePath();\n\t\t\t\tcontext.stroke();\n\t\t\t\tcontext.fill();\n\t\t\t});\n\t\t\teffects.forEach(function(effect, index, effectList) {\n\t\t\t\tfor (var i = 0; i < effect.particles.length; i++) {\n\t\t\t\t\tvar particle = effect.particles[i];\n\t\t\t\t\tgetSides(particle, particle.angle);\n\t\t\t\t\tcontext.fillStyle = \"black\";\n\t\t\t\t\tcontext.beginPath();\n\t\t\t\t\tcontext.moveTo(particle.points[0].x + particle.x, particle.points[0].y + particle.y);\n\t\t\t\t\tfor (var e = 1; e < particle.points.length; e++) {\n\t\t\t\t\t\tcontext.lineTo(particle.points[e].x + particle.x, particle.points[e].y + particle.y);\n\t\t\t\t\t}\n\t\t\t\t\tcontext.closePath();\n\t\t\t\t\tcontext.stroke();\n\t\t\t\t\tcontext.fill();\n\t\t\t\t}\n\t\t\t});\n\t\t\tmap.forEach(function(wall, index, walls) {\n\t\t\t\tgetSides(wall, wall.angle);\n\t\t\t\tcontext.fillStyle = \"black\";\n\t\t\t\tcontext.beginPath();\n\t\t\t\tcontext.moveTo(wall.points[0].x + wall.x, wall.points[0].y + wall.y);\n\t\t\t\tfor (var i = 1; i < wall.points.length; i++) {\n\t\t\t\t\tcontext.lineTo(wall.points[i].x + wall.x, wall.points[i].y + wall.y);\n\t\t\t\t}\n\t\t\t\tcontext.closePath();\n\t\t\t\tcontext.stroke();\n\t\t\t\tcontext.fill();\n\t\t\t});\n\t\t});\n\t}", "drawSprite(context){\n const yOffset = 5;\n //rounds down to whole number so sprites aren't drawn looking blurry\n\n //TODO: once board is set, this should draw in the lower left corner of each cell\n const x = Math.ceil(this.center.x) - this.creature.width/2;\n const y = Math.ceil(this.center.y) + Math.ceil(this.depth) - this.creature.height + yOffset;\n\n this.creature.draw(context, x, y);\n\n }", "function draw() {\n ctx.fillStyle = \"#70c5ce\";\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n cloud.draw();\n pipes.draw();\n ball.draw();\n ground.draw();\n bird.draw();\n getReady.draw();\n gameOver.draw();\n score.draw();\n}", "function draw() {\r\n\tcanvascontext.clearRect(0, 0, WORLD_DIMENSION, WORLD_DIMENSION);\r\n\tworld.forEach(function(row, x) {\r\n\t\trow.forEach(function(cell, y) {\r\n\t\t\tcanvascontext.beginPath();\r\n\t\t\tcanvascontext.rect(x*CELL_SIZE, y*CELL_SIZE, CELL_SIZE, CELL_SIZE);\r\n\t\t\tif (cell) {\r\n\t\t\t\tcanvascontext.fill();\r\n\t\t\t} else {\r\n\t\t\t\tcanvascontext.stroke();\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n}", "function create() {\n const { color, position } = privates.get(this);\n const { x, y } = Board.getRandomEmptyPosition();\n\n // set the position\n position.x = x;\n position.y = y;\n Board.drawUnit(position.x, position.y, color, FOOD_MARKER);\n}", "function draw() {\n rectMode(CENTER);\n background(0);\n paper.display();\n ground.display();\n bin1.display();\n bin2.display();\n bin3.display();\n drawSprites();\n \n}", "function render() {\n // Draw background color\n renderingContext.fillRect(0, 0, width, height);\n\n // Draw background sprites\n backgroundSprite.draw(renderingContext, 0, height - backgroundSprite.height);\n backgroundSprite.draw(renderingContext, backgroundSprite.width, height - backgroundSprite.height);\n\n corals.draw(renderingContext);\n mines.draw(renderingContext);\n fish.draw(renderingContext);\n\n if (currentState === states.Score) {\n okButtonSprite.draw(renderingContext, okButton.x, okButton.y);\n }\n\n // Draw foreground sprites\n foregroundSprite.draw(renderingContext, foregroundPosition, height - foregroundSprite.height);\n foregroundSprite.draw(renderingContext, foregroundPosition + foregroundSprite.width, height - foregroundSprite.height);\n}", "function Draw() {\r\n // Clear the screen\r\n context.clearRect(0, 0, canvas.width, canvas.height);\r\n\r\n if (gamePaused) {\r\n // Draw a grid and highlight the selected cell\r\n grid.Draw();\r\n }\r\n\r\n simulation.Draw();\r\n}", "render() {\n\t\tfill(gameSettings['food_color'][0], gameSettings['food_color'][1], gameSettings['food_color'][2]);\n\t\trect(this.x, this.y, gameSettings['scale'], gameSettings['scale']);\n\t}", "function draw () {\n drawBackground();\n\n push();\n translate(world.scroll, 0);\n\n // world objects are drawn between the push() and pop() functions so they'll scroll\n drawClouds();\n drawMountains();\n drawTrees();\n drawCanyons();\n drawCoins();\n drawFlagpole();\n\n pop();\n\n // character and scoreboard do not scroll with world objects\n drawCharacter();\n drawScoreboard();\n\n // handle player movement\n // this would be where we'd also handle other agent movement\n move(character);\n\n // check intersections\n checkintersections([character]); // agents would be added to this array\n\n // handle player death, level completion, and other game states\n handleConsequences();\n}", "draw(context)\n\t{\n\t\tif ( !this.visible )\n\t\t\treturn;\n\n\t\tcontext.font = this.fontSize + \"px \" + this.fontName;\n\t\tcontext.fillStyle = this.fontColor;\n\t\tcontext.textAlign = this.alignment;\n\t\t\n\t\tcontext.setTransform(1,0, 0,1, 0,0); \n\t\tcontext.globalAlpha = this.opacity;\n\n\t\t// shadow draw settings\n\t\tif (this.drawShadow)\n\t\t{\n\t\t\tcontext.shadowColor = this.shadowColor;\n\t\t\tcontext.shadowBlur = this.shadowSize;\n\t\t}\n\n\t\t// add support for multiline text (line breaks indicated by \"\\n\")\n\t\tlet textArray = this.text.split(\"\\n\");\n\t\tlet lineSkip = this.fontSize * this.lineHeight;\n\n\t\t// draw filled in text (multiple times to increase drop shadow intensity)\n\t\tfor (let i = 0; i < textArray.length; i++)\n\t\t{\n\t\t\tcontext.fillText( textArray[i], this.position.x, this.position.y + i * lineSkip);\n\t\t\tcontext.fillText( textArray[i], this.position.x, this.position.y + i * lineSkip);\n\t\t}\n\n\t\t// disable shadowBlur, otherwise all sprites drawn later will have shadows\n\t\tcontext.shadowBlur = 0;\n\t\t// draw filled text again, to fill over interior shadow blur, that may be a different color\n\t\tfor (let i = 0; i < textArray.length; i++)\n\t\t{\n\t\t\tcontext.fillText( textArray[i], this.position.x, this.position.y + i * lineSkip);\n\t\t}\n\n\t\t// draw border last, so not hidden by filled text\n\t\tif (this.drawBorder)\n\t\t{\n\t\t\tcontext.strokeStyle = this.borderColor;\n\t\t\tcontext.lineWidth = this.borderSize;\n\t\t\tfor (let i = 0; i < textArray.length; i++)\n\t\t\t{\n\t\t\t\tcontext.strokeText( textArray[i], this.position.x, this.position.y + i * lineSkip);\n\t\t\t}\n\t\t}\t\t\n\t}", "function draw() {\n background(\"blue\");\n \n drawBackHair();\n drawBody();\n drawHead();\n drawBangs();\n drawFace();\n drawAccs();\n\n // if (gDebugMode == true){\n // \tdrawDebugInfo();\n // }\n }", "function draw() {\n background(bg);\n\n if (state === `title`) {\n title();\n }\n else if (state === `simulation`) {\n simulation();\n }\n else if (state === `love`) {\n love();\n }\n else if (state === `sadness`) {\n sadness();\n }\n else if (state === `ignored`) {\n ignored();\n }\n}", "function draw() {\n\tbackground(0, 204, 0); // Background color\n\timageMode(CENTER); // Expands the image from the center of the coordinate it'll be located from\n\timage(stageBackground, width / 2, height / 2, width, height); // Stage the background to expand in the center and fit the canvas width and height\n\ttextTemplate.displayScore(); // Displays the score on screen, will increment by 100 everytime an enemy is killed\n\tdisplayFrequency();\n\n\tvirus.virusX -= virus.virusSpeed; // Virus move towards the left\n\n\t// If the shoot button has been pressed it'll display the bullet\n\tif (bullet.shootButton === true) {\n\t\t// Causes the bullet to be displayed\n\t\tbullet.display();\n\t}\n\t// Have to be displayed below if statement above otherwise bullet will display ontop of megaman\n\timage(imgMegaman, megaman.megamanX, megaman.megamanY, 100, 100); // Displays megaman based on coordinates\n\timage(imgVirus, virus.virusX, virus.virusY, 100, 100); // Displays the virus enemy based on coordinates\n\n\tbulletHitEnemy(); // Uses the custom built function for what happens when the bullet hits the enemy\n\n\t// This if statement makes the virus automatically change it's sprite as it moves\n\t// if (round(virus.virusX) - virus.virusX === 0.5) {\n\t// \timgVirus = loadImage(stage.stageVirusDefault[0]);\n\t// } else {\n\t// \timgVirus = loadImage(stage.stageVirusAction[0]);\n\t// }\n\n\t// I use this if statement to show print to console the position of my mouse location when the mouse is pressed\n\t// if (mouseIsPressed) {\n\t// \tprint(`x: ${mouseX} y: ${mouseY}`);\n\t// }\n}", "draw() {\n this.clearCanvas();\n\n this._ball.draw();\n this._paddle1.draw();\n this._paddle2.draw();\n\n this.drawScore();\n\n this.detectCollision();\n\n this.movePaddles();\n\n this._ball.move();\n }", "draw(ctx) {\n var pane = this;\n var stage = this._stage;\n var scene = stage.scene;\n this.drawShape(ctx, scene, stage, this.viewPort);\n }", "static draw() {\n tick++;\n\n background(51);\n\n for( let b of Ball.zeBalls ) {\n b.show();\n b.step(tick);\n }\n\n // if( tick < 1000 )\n // Ball.saveScreenshot( \"balls-\" + Ball.leadingZeroes(tick, 3) );\n }", "draw() {\n this.scoreText = \"Score: \" + gameNs.game.score;\n this.timeText = \"Time: \" + gameNs.game.timePassed;\n document.body.style.background = \"#000000\";\n gameNs.game.ctx.font = '120px Spy Hunter'; //48\n gameNs.game.ctx.fillStyle = \"white\"\n gameNs.game.ctx.fillText(\"SPY HUNTER\", 300, 150);\n gameNs.game.ctx.font = '80px Spy Hunter'; //48\n gameNs.game.ctx.fillStyle = \"yellow\"\n gameNs.game.ctx.fillText(this.startText, 250, 500);\n gameNs.game.ctx.fillText(this.scoreText, 450, 600);\n gameNs.game.ctx.fillText(this.timeText, 450, 700);\n }", "function draw(){\n ctx.fillStyle = \"black\";\n ctx.clearRect(0,0, 1200, 300);\n ctx.beginPath();\n ctx.fillRect(0, 0, 1000, 400);\n //Call function for robot head drawing\n robotHead();\n // Draw mountain range in background\n mountainRange();\n targetDraw();\n if(monster == 1){\n\tmonster1();\n }\n if(monster == 2){\n\tmonster2();\n }\n if(monster == 3){\n\tmonster3();\n }\n screenText();\n ctx.strokeStyle = 'white';\n ctx.stroke();\n // call draw livebars function\n livebars();\n}", "function draw() {\n\t\n\tcontext.clearRect(0,0,CANVAS_WIDTH, CANVAS_HEIGHT + MENU_BAR_HEIGHT);\n\t\n\tdrawMenu();\n\tmoveBugs();\n\tspawnFruits();\n\t\n\tif (deadBugs.length > 0) {\n\t\tdrawDeadBugs();\n\t}\n}", "function draw(){\n tile.clearRect(0, 0, canvas.width, canvas.height);\n drawFoundAnswers();\n drawSelection();\n drawBoard();\n drawAnswers();\n drawWinner();\n}", "function draw(){\n //clear canvas\n ctx.clearRect(-centerX, -centerY, canvas.width, canvas.height);\n //draw bowl\n drawBowl();\n //randomly spawn bugs\n var didBugSpawn = Math.random();\n if(didBugSpawn < bugSpawnChance){\n createBug();\n }\n //randomly change wind speed\n var didWindChange = Math.random();\n if(didWindChange < windChangeChance){\n windSpeed = randomBetweenRange(-4, 4);\n }\n \n //draw player, bugs, projectiles, and text\n drawPlayer(playerX, playerY, playerWidth, playerHeight, playerRotation);\n drawBugs();\n drawProjectiles();\n drawText();\n\n //update player, bugs, and projectiles\n handlePlayerMovement();\n handleBugMovement();\n handleProjectileMovement();\n}", "function draw() {\n\n // Draw the map.\n ctx.clearRect(0, 0, width, height);\n createMap();\n\n drawSnake();\n drawFood();\n\n // Draw Grid for TESTING purposes\n drawGrid();\n}", "function draw(){\r\n ctx.fillStyle = '#70c5ce';\r\n ctx.fillRect(0, 0, cWidth, cHeight);\r\n bg.draw();\r\n pipes.draw();\r\n fg.draw();\r\n kca.draw();\r\n bird.draw();\r\n getReady.draw();\r\n gameOver.draw();\r\n score.draw();\r\n \r\n\r\n}", "function draw() {}", "function draw() {}", "function drawCanvas() {\n\t\tdraw(context, drawer, colours, solver);\n\t\tsolver.callStateForItem(spanState);\n\t}", "drawExistingEntities() {\n this.drawExistingBullets();\n this.drawExistingEnemies();\n this.hero.draw(this.ctx);\n }", "update() {\n fill(0, 0, this.blue);\n rect (this.x, this.y, this.w, this.h);\n\n // console.log(\"ground is good\");\n\n\n }", "function draw() {\n background(255);\n particles.forEach(p => {\n p.move();\n p.draw();\n });\n}", "function draw() {\n ctx.clearRect(0,0, canvas.width, canvas.height);\n drawList.forEach((shape) => {\n shape.draw();\n });\n raf = window.requestAnimationFrame(draw);\n}", "function drawFood() {\n ctx.fillStyle = food.FOOD_COLOUR;\n ctx.strokestyle = food.FOOD_BORDER_COLOUR;\n ctx.fillRect(food.x, food.y, 10, 10);\n ctx.strokeRect(food.x, food.y, 10, 10);\n }", "draw() {\n if (this.dirty) {\n // Update pixels if any changes were made\n this.buffer.updatePixels();\n this.dirty = false;\n }\n\n background(230, 250, 250);\n image(this.buffer, 0, 0, width, height);\n\n // Draw all the collideable objects too\n for (let c of this.colliders) {\n c.draw();\n }\n }", "draw(context, sprite) {\n if (this.dir) {\n this.movePlayer(this.dir, this.speed);\n }\n\n const x = this.x + gameOffsetLeft;\n const y = this.y + gameOffsetTop;\n context.drawImage(sprite, x, y, sprite.width, sprite.height);\n }", "CreateDirtBlock(x, y) {\n const position = Fracker.TileToWorld(x, y);\n const bd = new b2.BodyDef();\n const body = this.m_world.CreateBody(bd);\n const shape = new b2.PolygonShape();\n shape.SetAsBox(FrackerSettings.k_tileHalfWidth, FrackerSettings.k_tileHalfHeight, Fracker.CenteredPosition(position), 0);\n body.CreateFixture(shape, FrackerSettings.k_density);\n this.SetBody(x, y, body);\n this.SetMaterial(x, y, Fracker_Material.DIRT);\n }", "function draw() {\r\n\r\n // draw game background\r\n display.fill('white');\r\n\r\n // draw game map\r\n drawMap();\r\n\r\n // draw potential tower if player is dragging a tower\r\n if (controller.dragging && controller.isMouseInCanvas()) {\r\n drawNewTower();\r\n };\r\n\r\n // display buffer\r\n display.draw(); \r\n}", "function draw() {\n\t//Redraw Background Color (Necessary?)\n\tbackground(0);\n\n\tfor (let i = 0; i < fishes.length; i++){ \n\t\t// If there is food on the screen, apply attractive force and display food\n\t\tif (food) {\n\t\t\tlet f = food.calculateAttraction(fishes[i]); \n\t\t\tfishes[i].applyForce(f); \n\t\t\tfood.display(); \n\t\t} else {\n\t\t\tfishes[i].meander();\n\t\t}\n\n\t\t// Update the properties of the fish (acceleration, velocity, location) etc\n\t\t// And display the fish\n\t\tfishes[i].update(); \n\t\tfishes[i].checkEdges();\n\t\tfishes[i].display();\n\t}\n\n\t// Text for slider\t\n\tfill(255);\n\ttextSize(16);\n\ttext('Food Size', 20, 120);\n\tfill(255);\n}", "function init() {\n ctx.font = '30px Arial';\n this.drawGround();\n\n}", "function draw(){\n\t// Call the paintCanvas function so it gets repainted each frame\n\tpaintCanvas();\n\n\t// Call update function\n\tupdate();\n\n\t// Call function to draw particles using a loop\n\tfor(var i = 0; i < particles.length; i++)\n\t{\n\t\tp = particles[i];\n\t\tp.draw();\n\t}\n\n}", "function draw() {\n //----- BACKGROUND SETUP -----\n background(bg.r, bg.g, bg.b);\n\n //----- STATE SETUP -----\n if(state === 'title'){\n titleScreen();\n }\n else if (state === 'gameplay'){\n gameplay();\n }\n else if (state === 'ending'){\n //----- NUM OF LIVES CHECK -----\n if(brokenHearts <= 2){\n ending(brokenHearts, 255, 115, 171);\n } else if (brokenHearts === 3 || brokenHearts === 4){\n ending(brokenHearts, 155, 100, 120);\n } else if (brokenHearts === 5){\n ending(brokenHearts, 70, 50, 60);\n }\n }\n}", "function draw() {\n\n // Teken Items\n clear();\n circle(x, y, 10);\n paddle();\n\n // Onder de box\n if (y + speed > height) {\n\n // raakt de paddle\n if (x > paddlex && x < paddlex + paddlew) {\n speed = -speed;\n UpdateScore(\"plus\");\n PlayAudio(1);\n }\n\n // mist de paddle\n else {\n y = 0;\n speed = speed * 0.7;\n x = RandomX();\n UpdateScore(\"min\");\n LostLife();\n PlayAudio(0);\n }\n }\n\n // Boven de box\n else if (y + speed < -1) {\n y = 0;\n x = RandomX();\n speed = -speed / 0.9;\n }\n y += speed;\n }", "draw() {\n\t\t// this.mySound.start();\n\t\tthis.startSound();\n\t\tfor (let i = 0; i < this.cell.length; i++) {\n\t\t\tthis.game.context.fillStyle = 'rgb(83,83,83)';\n\t\t\tthis.game.context.fillRect(this.cell[i].x, this.cell[i].y, this.grid, this.grid);\n\t\t}\n\n\t\tif (!this.endGame()) {\n\t\t\tthis.game.context.font = '50px Arial';\n\t\t\tthis.game.context.fillStyle = 'rgb(65, 87, 185)';\n\t\t\tthis.game.context.fillText(\"Điểm của bạn là\", 350, 250);\n\t\t\tthis.game.context.font = '40px Arial';\n\t\t\tthis.game.context.fillStyle = 'red';\n\t\t\tthis.game.context.fillText(this.diem(), 490, 290);\n\t\t\tthis.endGameSound.start();\n\t\t\tthis.readLoad();\n\t\t\tthis.mySound.stop();\n\t\t\tthis.eatSound.stop();\n\t\t}\n\t\t//khoi chay am nhac o day \n\n\t}", "draw(){\n this._context.fillStyle = '#000';\n this._context.fillRect(0, 0, canvas.width, canvas.height);\n \n // draw ball and players\n this.drawRectangle(this.ball) \n this.players.forEach(player => this.drawRectangle(player));\n\n //draw score\n this.drawScore();\n }", "render()\n {\n let ctx = Simulation.context();\n let canvas = Simulation.canvas();\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n // -- Render simulation elements --\n\n // Cheese\n this.cheese.render(ctx);\n\n // Population\n this.population.render(ctx);\n\n // Traps\n for (let trap of this.traps)\n {\n trap.render(ctx);\n }\n\n // Rendering the stats\n this.renderStats(ctx, 20, 40);\n }", "draw() {\n // Limpa a tela antes de desenhar\n Game.Drawing.clearCanvas();\n Game.Drawing.drawImage(Game.ImageManager.image('background'), 190, 130);\n Game.gameObjectList.forEach(gameObject => gameObject.draw());\n\n }" ]
[ "0.5845516", "0.5777772", "0.5775472", "0.57509124", "0.5714409", "0.5713729", "0.5693236", "0.5692172", "0.56509733", "0.56364477", "0.5627966", "0.5584947", "0.55848265", "0.5582253", "0.5577812", "0.55737764", "0.55628854", "0.55615073", "0.5527821", "0.5527139", "0.552402", "0.5507617", "0.54717803", "0.5468098", "0.5457614", "0.54545486", "0.54487526", "0.5440091", "0.5439721", "0.5439721", "0.54246664", "0.54059476", "0.53614724", "0.53606075", "0.53591466", "0.5356846", "0.5355969", "0.5352163", "0.5338008", "0.5331721", "0.5330214", "0.5325261", "0.531561", "0.53146833", "0.5313808", "0.53096646", "0.52996105", "0.5292058", "0.528805", "0.5260308", "0.5254443", "0.5252526", "0.5249912", "0.5238262", "0.5223596", "0.52228475", "0.5221235", "0.520392", "0.5196979", "0.5191681", "0.51908654", "0.5188885", "0.5185773", "0.5181869", "0.51815724", "0.51698816", "0.5166513", "0.51664346", "0.5166165", "0.5151612", "0.5142435", "0.5142282", "0.5141805", "0.51370376", "0.5134654", "0.5130063", "0.51300263", "0.5122657", "0.5118968", "0.5116362", "0.5116362", "0.51138544", "0.5113284", "0.5100591", "0.50952137", "0.5094264", "0.509344", "0.509227", "0.50870633", "0.5084573", "0.50837517", "0.50785464", "0.50783163", "0.5077515", "0.50756", "0.5075156", "0.5074188", "0.5072921", "0.50592315", "0.5056308" ]
0.71356446
0
Removes the Sprite from the sketch. The removed Sprite will not be drawn or updated anymore.
remove() { if (this.body) this.p.world.destroyBody(this.body); this.removed = true; //when removed from the "scene" also remove all the references in all the groups while (this.groups.length > 0) { this.groups[0].remove(this); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "remove() {\n\t\tthis.destroy();\n\t\tthis.engine.scene.removeSprite(this);\n\t}", "function removeSprite(sprite) {\n sprite.parent.removeChild(sprite);\n}", "removeFrom (stage) {\n const curStage = stage\n\n curStage.sprites = stage.sprites.filter((item) => item !== this)\n this.element ? this.element = this.element.delete(this) : null\n }", "removeSprite(body) {\n const index = this.spriteList.findIndex(s => s.id === body.id)\n this.spriteList.splice(index, 1)\n body.sprite.destroy()\n try {\n body.stopWork()\n } catch (e) {\n console.log(body + 'dont have stopwork fn')\n }\n }", "destroySprite(sprite){\n sprite.destroy();\n }", "remove() {\n Food.container.removeChild(this.sprite);\n delete Food.list[this.id];\n }", "clear (sprite) {\n this.context.clearRect(0, 0, sprite.stageWidth, sprite.stageHeight)\n }", "clearScene(){\n $objs.spritesFromScene.forEach(cage => {\n $stage.scene.removeChild(cage);\n $objs.LIST[cage.dataObj._id] = void 0;\n });\n $objs.spritesFromScene = [];\n }", "function clearSprites(){\n\t\tfor (var i = sprites.length - 1; i >= 0; i--) {\n\t\t\tsceneOrtho.remove(sprites[i]);\n\t\t};\n\t\tsprites=[];\n\t}", "removeSprites() {\n\t\t\t\t// prevent rebuilding the quadTree multiple times\n\t\t\t\tthis.p.quadTree.rebuildOnRemove = false;\n\t\t\t\twhile (this.length > 0) {\n\t\t\t\t\tthis[0].remove();\n\t\t\t\t}\n\t\t\t\tthis.p.quadTree.rebuildOnRemove = true;\n\n\t\t\t\tthis.p.allSprites._rebuildQuadtree();\n\t\t\t}", "function Deselected()\r\n{\r\n\tthis.gameObject.GetComponent.<SpriteRenderer>().sprite = terminal_off_sprite;\r\n\tselected = false;\r\n}", "destroy() {\n this.container.removeChild(this.inspiredSprite);\n this.container.removeChild(this.sprite);\n this.container.removeChild(this.halo);\n this.container.removeChild(this.highlight);\n delete this.container;\n }", "destroy()\n\t{\n\t\tthis.parentGroup.removeSprite(this);\n\t}", "destroy()\n\t{\n\t\tthis.parentGroup.removeSprite(this);\n\t}", "erasePlayer() {\n ctx.clearRect(this.positionX, this.positionY, this.height, this.width);\n }", "clear() {\n if (this.score >= 50) {\n this.score -= 50;\n this.update_score();\n let sprite = app.stage.getChildAt(0);\n this.meteors.forEach(element => app.stage.removeChild(element));\n this.meteors.clear;\n }\n }", "erase() {\n this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height)\n }", "function removeSpriteFromView(id) {\n //remove the sprite from the DOM\n if (spritesToPost.length == 1) {\n alert(\"You must have at least 1 sprite\");\n } else {\n $(`#sprite${id}`).remove();\n //find the sprite in the array and remove it\n var index = 0;\n for (var i = 0; i < spritesToPost.length; i++)\n if (spritesToPost[i].id == id) {\n index = i;\n break;\n }\n spritesToPost.splice(index, 1);\n currentSpriteID--;\n if (currentSpriteID >= 1) {\n for (var j = index; j < spritesToPost.length; j++) {\n $(`#sprite${spritesToPost[j].id} h4`).text(`Sprite ${spritesToPost[j].id}`);\n $(`#sprite${spritesToPost[j].id}`).attr('id', `sprite${j}`);\n $(`#imageSelect${spritesToPost[j].id}`).attr('id', `imageSelect${j}`);\n $(`#xPosition${spritesToPost[j].id}`).attr('id', `xPosition${j}`);\n $(`#yPosition${spritesToPost[j].id}`).attr('id', `yPosition${j}`);\n $(`#spriteType${spritesToPost[j].id}`).attr('id', `imageSelect${j}`);\n $(`input[type=radio][name=imageSelect${spritesToPost[j].id}]`).attr('name', `imageSelect${j}`);\n spritesToPost[j].id--;\n }\n }\n }\n}", "impact() {\n stage.remove(this);\n }", "remove() {\n\t\t\t\tthis.removed = true;\n\n\t\t\t\t//when removed from the \"scene\" also remove all the references in all the groups\n\t\t\t\twhile (this.groups.length > 0) {\n\t\t\t\t\tthis.groups[0].remove(this);\n\t\t\t\t}\n\n\t\t\t\t// clear and rebuild the quadTree\n\t\t\t\tif (this.p.quadTree.rebuildOnRemove) {\n\t\t\t\t\tthis.p.allSprites._rebuildQuadtree();\n\t\t\t\t}\n\t\t\t}", "function removeShot( playerShot )\n {\n gameArea.removeChild(playerShot.imgElement);\n \n if( playerShot.targetGameObject != null )\n {\n playerShot.targetGameObject.targeted = false;\n playerShot.targetGameObject = null;\n }\n\n var i = playerShots.indexOf(playerShot);\n playerShots.splice(i, 1);\n }", "function destroyBackground() {\n\tif (spriteBackground) {\n\t\tgroupBackground.remove(spriteBackground, true);\n\t}\n}", "remove(...sprites) {\n\n //Remove sprites that's aren't in an array\n if (!(sprites[0] instanceof Array)) {\n if (sprites.length > 1) {\n sprites.forEach(sprite => {\n sprite.parent.removeChild(sprite);\n });\n } else {\n sprites[0].parent.removeChild(sprites[0]);\n }\n }\n\n //Remove sprites in an array of sprites\n else {\n let spritesArray = sprites[0];\n if (spritesArray.length > 0) {\n for (let i = spritesArray.length - 1; i >= 0; i--) {\n let sprite = spritesArray[i];\n sprite.parent.removeChild(sprite);\n spritesArray.splice(spritesArray.indexOf(sprite), 1);\n }\n }\n }\n }", "function undraw() {\n current.forEach((index) => {\n squares[currentPosition + index].classList.remove(\"tetromino\");\n });\n }", "remove() {\n Player.container.children.forEach(child => {\n if(child.parentId === this.id) {\n this.removeSprite(child);\n }\n });\n delete Player.list[this.id];\n }", "function removeGameCanvas(){\n\t stage.autoClear = true;\n\t stage.removeAllChildren();\n\t stage.update();\n\t createjs.Ticker.removeEventListener(\"tick\", tick);\n\t createjs.Ticker.removeEventListener(\"tick\", stage);\n }", "remove() {\n\t\tthis.active = false;\n\t\tthis.ctx.remove();\n\t\tthis.parent.removeDot(this.id);\n\t}", "function remove() {\n _paper.remove();\n }", "remove() {\n stopSound(this.throwSound);\n this.isShot = false;\n this.player.hookNumber ++;\n this.size = this.player.totalHeight;\n }", "function deletePicture() {\n symbols = [];\n drawBG();\n }", "removeFromScene() {\n if (this.scene)\n this.scene.remove(this.mObject3D);\n }", "unstageUnit(){\n this.image.parent.removeChild(this.image);\n this.healthBar.parent.removeChild(this.healthBar);\n }", "function remove(){\n stack.splice(0,stack.length);\n calcScreen= \"0\";\n display();\n }", "function onitemremove (data) {\n\tvar removeItem; \n\tremoveItem = finditembyid(data.id);\n\n\tif (!removeItem) {\n\t\treturn;\n\t}\n\n\tland.splice(land.indexOf(removeItem), 1); \n\t\n\t//destroy the phaser object \n\tremoveItem.item.destroy(true, false);\n}", "remove() {\n this.parent.removeClip(this);\n }", "removeFromScene(scene, isUpdating) {\n this.objects.forEach((obj) => {\n scene.remove(obj, true);\n });\n if (!isUpdating) {\n scene.remove(this.cursor, true);\n }\n }", "remove() {\n this._item = null;\n this.render();\n }", "function removeScene () {\n cancelAnimationFrame(raf);\n\n stage.removeChildren();\n stage.destroy(true);\n\n container.removeChild(canvas);\n}", "remove() {\n player.dispose();\n }", "updateSprite () {\n this.setDirState(null, null)\n }", "removePileArea () {\n if (!this.pileArea) { return; }\n\n fgmState.scene.remove(this.pileArea);\n this.pileArea = undefined;\n }", "removeSprite(tag) {\n const layerNos = Object.keys(this.sprites);\n let emptyLayerNo = -1;\n layerNos.forEach(layerNo => {\n if (this.sprites[layerNo][tag] && this.spriteMap[tag]) {\n delete this.sprites[layerNo][tag];\n delete this.spriteMap[tag];\n } else {\n console.log(`sprite tag name ${tag} does not exist`);\n }\n if (this.sprites[layerNo].length === 0) {\n emptyLayerNo = layerNo;\n }\n });\n if (emptyLayerNo >= 0) {\n delete this.sprites[emptyLayerNo];\n }\n }", "function deleteAvatar(){\n scene.remove(avatar);\n mixers = [];\n AvatarMoveDirection = { x: 0, z: 0 };\n avatarLocalPos = { x: 0, z: 0 };\n}", "function undo() {\n canDraw.erase();\n canOverlay.erase();\n canDraw.context.drawImage(canDraw.backupImageArray.pop().canvas, 0, 0);\n doneDrawing();\n updateScore();\n}", "erase(){\n this.scene.remove(this.graphicalObject);\n }", "function gameOver() {\n scene.remove(gtlfObj);\n scene.remove(key);\n scene.remove(lightSwitch);\n camera.remove(reticle);\n // scene.background = null;\n document.getElementById(\"won\").style.display = \"block\"\n}", "onRemove() {\n\t\tthis._active = false;\n\t\tthis._map.removeLayer(this._canvasLayer);\n\t\tif (this.options.onRemove) this.options.onRemove();\n\t}", "remove() {\n this.world.removeEntity(this);\n }", "RemoveClip() {}", "clear_drawing_position() {\n pop()\n }", "remove() {\n super.remove();\n\n /* Remove event listeners */\n this.playerBoard.remove();\n this.oppositeBoard.remove();\n }", "remove(){\n document.body.removeChild(document.getElementById(this.id))\n this.active = false\n }", "destroyAssets() {\n this.sprite.destroy();\n }", "removePiece (piece) {\n\t\tlet pos = piece.pos;\n\t\tif (position.isValid(pos)) {\n\t\t\tthis.board[pos] = null;\n\t\t\tpiece.setPos(null);\n\t\t\tpiece.reset();\n\t\t}\n\t}", "remove () {\n this.node.parentNode.removeChild(this.node)\n this.stylesheet.parentNode.removeChild(this.stylesheet)\n }", "detachFromGameScene () {\n const game = Game.getInstance();\n game.scene.remove( this );\n }", "function victory() {\r\n var gameOverCanvas = document.getElementById(\"gameOver\");\r\n var gameOverDisplay = \"You won the Game! Your Score is: \"+score;\r\n gameOverCanvas.innerHTML = gameOverDisplay;\r\n numberOfMissiles = 50;\r\n scene.remove(building);\r\n scene.remove(building1);\r\n scene.remove(building2);\r\n scene.remove(building3);\r\n scene.remove(building4);\r\n scene.remove(building5);\r\n scene.remove(launcher);\r\n\r\n}", "repaintListGC() {\n for (const id in G.repaintList) {\n const item = G.repaintList[id];\n // remove items that is not belongs to current scene\n if (item.sceneName !== G.sceneName) {\n // G.repaintList[id].sprite.destroy();\n delete G.repaintList[id];\n }\n }\n G.rootStage.removeChild(this.stage);\n // this.stage.destroy();\n }", "function removeAvatar(id) {\n var idToRemove = eval(id).toString();\n var scene = document.getElementById('scene');\n scene.removeChild(avatars[idToRemove]);\n}", "function undraw() {\n currentTetromino.forEach(index => {\n //unrender tetromino cells by removing class 'tetromino'\n squares[currentPosition + index].classList.remove('tetromino');\n //remove color\n squares[currentPosition + index].style.backgroundColor = '';\n });\n }", "wipe() {\n\t\tthis.board.deleteBoard()\n\t}", "function removeLife (){\n Images.frog.src = '../images/icons8-Poison-96.png'\n frogImages[lives - 1].remove()\n setTimeout(function(){\n Images.frog.src = '../images/frog.png'\n }, 700)\n x = 225\n y = 560\n counter = 60\n}", "remove() {\n this._animation.removeAction(this);\n }", "function erasePixelBoard() {\n const pixelBoard = document.querySelector('#pixel-board');\n pixelBoard.innerHTML = '';\n}", "clean() {\n this.removeItem(this.scene);\n }", "function removeEnemy(){\n const enemy = document.getElementById(\"enemy\");\n enemy.parentNode.removeChild(enemy);\n}", "detach() {\n this.application.stage.removeChild(this.stage)\n }", "removeBody(){\n\t\tlet length = this.body.length;\n\t\tfor (let i=length; i > 0; i--){\n \tthis.body.x.pop();\n \tthis.body.y.pop();\n\n \tlet snakeBody = document.querySelector('.snake_body');\n \tsnakeBody.parentNode.removeChild(snakeBody); \n \t}\n \tthis.body.length = 0;\n\t}", "function MouseUp(e){\n document.body.removeChild(pre);\n}", "destroyScene(scene){\n this.game.scene.remove(scene.key);\n }", "function eraseBoard() {\n context.clearRect(0, 0, canvas.width, canvas.height);\n }", "function gameOver() {\r\n var gameOverCanvas = document.getElementById(\"gameOver\");\r\n var gameOverDisplay = \"GAME OVER! Your Score is: \"+score;\r\n gameOverCanvas.innerHTML = gameOverDisplay;\r\n numberOfMissiles = 50;\r\n scene.remove(building);\r\n scene.remove(building1);\r\n scene.remove(building2);\r\n scene.remove(building3);\r\n scene.remove(building4);\r\n scene.remove(building5);\r\n scene.remove(launcher);\r\n\r\n}", "clear() {\n this.myScene.remove(this.threeObject);\n this.threeObject = null;\n }", "function gameOver() {\n\n\n\tshipContainer.removeChild(player.animations);\n\n\tplayer = null;\n\n\n\tsetTimeout(function() {\n\t\tremoveEverything\n\t\tloadTitle();\n\t}, 2000);\n\t\n}", "eliminer() {\n //console.log(\"ELIMINER le divImage \"+this.divImage);\n this.divImage.parentNode.removeChild(this.divImage);\n\t}", "removePoint() {\n this.points -= 1;\n this.updateScore();\n }", "function cloudErase(tag) {\n if (!tag.sprite) {\n throw new Error(\"No sprite in the tag\");\n }\n\n // Undo temporary hack\n tag.x += size[0] >> 1;\n tag.y += size[1] >> 1;\n\n var sprite = tag.sprite,\n w = tag.width >> 5,\n sw = size[0] >> 5,\n lx = tag.x - (w << 4),\n sx = lx & 0x7f,\n msx = 32 - sx,\n h = tag.y1 - tag.y0,\n x = (tag.y + tag.y0) * sw + (lx >> 5),\n last;\n\n for (var j = 0; j < h; j++) {\n last = 0;\n for (var i = 0; i <= w; i++) {\n board[x + i] &= ~((last << msx) | (i < w ? (last = sprite[j * w + i]) >>> sx : 0));\n }\n x += sw;\n }\n\n event.erased(tags);\n }", "animate_stop() {\r\n this.sprite.animate = false;\r\n }", "clear()\r\n {\r\n // shifting the line to a point outside of the page so that it does not show anymore\r\n this.position.x = -5000;\r\n this.position.y = -5000;\r\n }", "function clearObstacles(){\n obstaclesArray.pop(obstaclesArray[0]);\n}", "function remove_avatar(avatar) {\n if (avatar) {\n avatar.remove();\n }\n}", "hide() {\n this.canvas.style.display = 'none';\n this.back.style.display = 'none';\n this.setPos({x:0, y:document.body.clientHeight, deg:0, scale:0});\n delete renderer.movingCards[this.id];\n }", "function removeScorePoint(x) {\n oxo.player.removeFromScore(x);\n}", "clear() {\n this.stop();\n this.scene.remove.apply(this.scene, this.scene.children);\n this.scene.background = null;\n this.mixers.splice(0, this.mixers.length);\n this.sceneMeshes.splice(0, this.sceneMeshes.length);\n $(\"#picker\").spectrum(\"hide\");\n }", "undoStitch(){\n // console.log('undoStitch')\n this.content.css('left',0)\n this.getItems().slice(ITEM_ART_COUNT).remove()\n this.stitchedContent = undefined\n }", "function RemoveTarget()\n{\n target = null;\n targetId = null;\n compassInUse = false;\n}", "function updateSpriteCloud(sprite) {\n\ttry {\n \tsprite.x -= RATIO * CLOUD_SPEED * getMultiplier();\n\t\tif (sprite.x <= -sprite.width) {\n\t\t\tgroupClouds.remove(sprite, true);\n\t\t\taddSpriteCloud();\n\t\t}\n\t}\n\tcatch (e) {}\n}", "function winScreenClick() {\n stage.removeChild(winScreen);\n stage.removeChild(scoreText);\n\n score = 0;\n\n loadQuestion(0);\n loadTextAndBoxes();\n}", "destroy() {\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore\n this.scene = undefined;\n this.bullets.destroy(true);\n }", "function eraseShape() {\r\n\tif (anySelected) {\r\n\t\tshapes.splice(shapes.indexOf(previousSelectedShape), 1);\r\n\t\tpreviousSelectedShape = null;\r\n\t\tdrawShapes();\r\n\t\tanySelected = false;\r\n\t}\r\n}", "function removeCanvas() {\n popCanvas.firstChild.remove();\n popCanvas.firstChild.remove();\n scene.dispose();\n engine.dispose();\n}", "function erase() {\n ctx.clearRect(0, 0, w, h);\n blankSketch = true;\n fillCanvas();\n}", "function stopAnimation() {\n reset();\n sprite.gotoAndStop(sprite.currentFrame);\n }", "desactiver() {\n\t\t\tthis.suprimerObjet(\"cle\");// #tim Jessy, Suppression de linventaire lors de la fin de partie\n\t\t\tSprite.removeEventListeners(window, this.evt.window);\n }", "kill(sprite) {\n for (let i = 0; i < sprite.length; i++) {\n let c = Phaser.Math.Distance.Chebyshev(this.x, this.y, sprite[i].x, sprite[i].y);\n if (sprite[i].active) {\n if (c < 60) {\n sprite[i].setActive(false).setVisible(false);\n sprite[i].alive = false;\n //sprite[i].setTexture('ghost');\n console.log('Hidden');\n console.log(sprite[i].x, sprite[i].y);\n this.createDeadBody(sprite[i].x, sprite[i].y);\n console.log('I killed someone', sprite[i].id);\n this.scene.registry.values.sceneData.serverConnection.kill(sprite[i].id);\n this.scene.registry.values.sceneData.gamePlayScene.scene.manager.getScene('voting_scene').removePlayerById(sprite[i].id);\n break;\n }\n }\n }\n }", "function clearScene() {\n for (var i = scene.children.length - 1; i >= 0; --i) {\n var obj = scene.children[i];\n scene.remove(obj);\n }\n}", "function clearScene (){\r\n for( var i = scene.children.length - 1; i >= 0; i--) {\r\n scene.remove(scene.children[i]);\r\n }\r\n }", "function clearSquare(){\n\n $(\".square\").remove();\n load(current_size);\n default_color();\n \n\n\n}", "wipe_screen() {\n this.button = new Button({\n bg_color: 0xffffff,\n outline_color: 0x000000,\n handler: game_controller.clear.bind(this),\n text: \"Clear\"\n });\n this.button.scale.x = .5;\n this.button.scale.y = .5;\n this.button.x = 550;\n this.button.y = 150;\n\n app.stage.addChild(this.button)\n\n }", "removeFrom(board) {\n board.remove(this.el);\n }", "destroy() {\n this.__anchors--;\n if (this.__anchors === 0) {\n this._context.gl.deleteTexture(this.location);\n }\n }" ]
[ "0.77431214", "0.75477993", "0.69690484", "0.6940142", "0.68978834", "0.6861231", "0.67769843", "0.66638386", "0.65098506", "0.64735377", "0.64435333", "0.6405962", "0.6400886", "0.6400886", "0.63380367", "0.6259134", "0.6221261", "0.62026954", "0.60520804", "0.6036639", "0.60238343", "0.6001932", "0.59933597", "0.59911454", "0.5987135", "0.59579474", "0.5905754", "0.58861494", "0.5875634", "0.5857832", "0.58533096", "0.58520037", "0.5846559", "0.58243597", "0.5774585", "0.57592773", "0.5754349", "0.5752715", "0.57498395", "0.5739752", "0.5727993", "0.5706206", "0.5705704", "0.5705146", "0.5678581", "0.56736857", "0.5657655", "0.5650597", "0.5633562", "0.5622029", "0.561955", "0.5601931", "0.5560465", "0.5556156", "0.55473787", "0.55393404", "0.5538972", "0.5537076", "0.553055", "0.5525498", "0.5524979", "0.55168647", "0.55125433", "0.5505197", "0.5505011", "0.54983836", "0.5495291", "0.54591846", "0.5458347", "0.5451044", "0.5448149", "0.54461604", "0.5445844", "0.5433237", "0.5419337", "0.5413061", "0.54113847", "0.54099804", "0.540998", "0.54079443", "0.5403541", "0.53953815", "0.53900343", "0.53857696", "0.53837734", "0.538196", "0.5377246", "0.5376053", "0.5375353", "0.53724253", "0.53668255", "0.53506464", "0.5347883", "0.53412753", "0.53357315", "0.53173804", "0.5307341", "0.53067815", "0.5304484", "0.5299421", "0.52917105" ]
0.0
-1
Returns the sprite's unique identifier
toString() { return 's' + this.idNum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUniqueIdentifier(item) {\n if (item.info) {\n return item.info.id;\n }\n return item.label;\n }", "masterSprite() {\n let type = this.sprites.images['idle'] ? 'idle' : 'go';\n return this.sprites ? this.sprites.images[type][0] : null;\n }", "getUuid(path, type) {\n path = url.normalize(path);\n let item = this._pathToUuid[path];\n\n if (item) {\n if (Array.isArray(item)) {\n if (type) {\n for (let i = 0; i < item.length; i++) {\n let entry = item[i];\n\n if (isChildClassOf(entry.type, type)) {\n return entry.uuid;\n }\n } // not found\n\n\n if ( isChildClassOf(type, SpriteFrame)) {\n for (let i = 0; i < item.length; i++) {\n let entry = item[i];\n\n if (isChildClassOf(entry.type, SpriteAtlas)) {\n // not support sprite frame in atlas\n errorID(4932, path);\n break;\n }\n }\n }\n } else {\n return item[0].uuid;\n }\n } else if (!type || isChildClassOf(item.type, type)) {\n return item.uuid;\n } else if ( isChildClassOf(type, SpriteFrame) && isChildClassOf(item.type, SpriteAtlas)) {\n // not support sprite frame in atlas\n errorID(4932, path);\n }\n }\n\n return '';\n }", "get sprite() {\n return this._sprite;\n }", "get sprite()\n {\n return this._sprite;\n }", "function getUniqueID() {\n return Math.random().toString(36).substr(2, 9)\n}", "function getUniqueId(){\n\treturn Math.random().toString(36);\n}", "function getUniqueID() {\n var id = new Date().valueOf();\n return id + \".\" + incrementID.increment();\n }", "function $uid() {\n unique_id += 2;\n return unique_id;\n }", "get label(){return modules.sprite}", "function getUniqueId(){\n return Math.random().toString(36).substr(2, 5);\n}", "function uuid() {\n return \"uid-\" + __counter++;\n}", "get uniqueIdentifier() { return this._state.uniqueIdentifier; }", "function getUid(){\n\n}", "function getAvatarID(){\n\tvar clientID = client.GetConnectionID();\n\tvar avatarx = \"Avatar\" + clientID.toString();\n\treturn avatarx;\n}", "function getUniqueId() {\n _id++;\n return _id;\n}", "function uniqueIDName(idBase, idIdx){\r\n /// returns unique ID name to be used when generating id names\r\n return idBase + idIdx;\r\n }", "function uid() {\n // Let's create some positive random 32bit integers first.\n //\n // 1. Math.random() is a float between 0 and 1.\n // 2. 0x100000000 is 2^32 = 4294967296.\n // 3. >>> 0 enforces integer (in JS all numbers are floating point).\n //\n // For instance:\n //\t\tMath.random() * 0x100000000 = 3366450031.853859\n // but\n //\t\tMath.random() * 0x100000000 >>> 0 = 3366450031.\n var r1 = Math.random() * 0x100000000 >>> 0;\n var r2 = Math.random() * 0x100000000 >>> 0;\n var r3 = Math.random() * 0x100000000 >>> 0;\n var r4 = Math.random() * 0x100000000 >>> 0; // Make sure that id does not start with number.\n\n return 'e' + HEX_NUMBERS[r1 >> 0 & 0xFF] + HEX_NUMBERS[r1 >> 8 & 0xFF] + HEX_NUMBERS[r1 >> 16 & 0xFF] + HEX_NUMBERS[r1 >> 24 & 0xFF] + HEX_NUMBERS[r2 >> 0 & 0xFF] + HEX_NUMBERS[r2 >> 8 & 0xFF] + HEX_NUMBERS[r2 >> 16 & 0xFF] + HEX_NUMBERS[r2 >> 24 & 0xFF] + HEX_NUMBERS[r3 >> 0 & 0xFF] + HEX_NUMBERS[r3 >> 8 & 0xFF] + HEX_NUMBERS[r3 >> 16 & 0xFF] + HEX_NUMBERS[r3 >> 24 & 0xFF] + HEX_NUMBERS[r4 >> 0 & 0xFF] + HEX_NUMBERS[r4 >> 8 & 0xFF] + HEX_NUMBERS[r4 >> 16 & 0xFF] + HEX_NUMBERS[r4 >> 24 & 0xFF];\n }", "function uid() {\n // Let's create some positive random 32bit integers first.\n //\n // 1. Math.random() is a float between 0 and 1.\n // 2. 0x100000000 is 2^32 = 4294967296.\n // 3. >>> 0 enforces integer (in JS all numbers are floating point).\n //\n // For instance:\n //\t\tMath.random() * 0x100000000 = 3366450031.853859\n // but\n //\t\tMath.random() * 0x100000000 >>> 0 = 3366450031.\n var r1 = Math.random() * 0x100000000 >>> 0;\n var r2 = Math.random() * 0x100000000 >>> 0;\n var r3 = Math.random() * 0x100000000 >>> 0;\n var r4 = Math.random() * 0x100000000 >>> 0; // Make sure that id does not start with number.\n\n return 'e' + HEX_NUMBERS[r1 >> 0 & 0xFF] + HEX_NUMBERS[r1 >> 8 & 0xFF] + HEX_NUMBERS[r1 >> 16 & 0xFF] + HEX_NUMBERS[r1 >> 24 & 0xFF] + HEX_NUMBERS[r2 >> 0 & 0xFF] + HEX_NUMBERS[r2 >> 8 & 0xFF] + HEX_NUMBERS[r2 >> 16 & 0xFF] + HEX_NUMBERS[r2 >> 24 & 0xFF] + HEX_NUMBERS[r3 >> 0 & 0xFF] + HEX_NUMBERS[r3 >> 8 & 0xFF] + HEX_NUMBERS[r3 >> 16 & 0xFF] + HEX_NUMBERS[r3 >> 24 & 0xFF] + HEX_NUMBERS[r4 >> 0 & 0xFF] + HEX_NUMBERS[r4 >> 8 & 0xFF] + HEX_NUMBERS[r4 >> 16 & 0xFF] + HEX_NUMBERS[r4 >> 24 & 0xFF];\n }", "function readUid(){\n checkLen(16);\n var res = hexBlock(0, 4, true) + '-' + hexBlock(4, 2, true) + '-' + hexBlock(6, 2, true) + '-' + hexBlock(8, 2) + '-' + hexBlock(10, 6);\n pos += 16;\n return res;\n }", "function guid() {return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();}", "function uniqueId() {\n\t\tuniqueId.i = uniqueId.i || 0;\n\t\treturn '__' + uniqueId.i++;\n\t}", "getIdentifier () {\n return (this._identifier);\n }", "function guid() {\n return (S4()+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+S4()+S4());\n }", "function uniqueId () {\n return ('xxxxxxxx-xxxx-xxxx-yxxx-xxxxxxxxxxxx').replace(/[xy]/g, function(c) {\n var r = Math.random() * 16 | 0,\n v = c === 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n}", "function uniqueId() {\n return Date.now() + 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = Math.random()*16|0, v = c === 'x' ? r : (r&0x3|0x8);\n return v.toString(16);\n });\n }", "function guid() {\n\t\treturn (S4() + S4() + \"-\" + S4() + \"-\" + S4() + \"-\" + S4() + \"-\" + S4() + S4() + S4());\n\t}", "function uniqueID() {\n return Math.round(new Date().getTime() * (Math.random() * 100));\n }", "function getID() {\n return '_' + Math.random().toString(36).substr(2, 9);\n}", "function uid() {\n // Let's create some positive random 32bit integers first.\n //\n // 1. Math.random() is a float between 0 and 1.\n // 2. 0x100000000 is 2^32 = 4294967296.\n // 3. >>> 0 enforces integer (in JS all numbers are floating point).\n //\n // For instance:\n //\t\tMath.random() * 0x100000000 = 3366450031.853859\n // but\n //\t\tMath.random() * 0x100000000 >>> 0 = 3366450031.\n var r1 = Math.random() * 0x100000000 >>> 0;\n var r2 = Math.random() * 0x100000000 >>> 0;\n var r3 = Math.random() * 0x100000000 >>> 0;\n var r4 = Math.random() * 0x100000000 >>> 0; // Make sure that id does not start with number.\n\n return 'e' + HEX_NUMBERS[r1 >> 0 & 0xFF] + HEX_NUMBERS[r1 >> 8 & 0xFF] + HEX_NUMBERS[r1 >> 16 & 0xFF] + HEX_NUMBERS[r1 >> 24 & 0xFF] + HEX_NUMBERS[r2 >> 0 & 0xFF] + HEX_NUMBERS[r2 >> 8 & 0xFF] + HEX_NUMBERS[r2 >> 16 & 0xFF] + HEX_NUMBERS[r2 >> 24 & 0xFF] + HEX_NUMBERS[r3 >> 0 & 0xFF] + HEX_NUMBERS[r3 >> 8 & 0xFF] + HEX_NUMBERS[r3 >> 16 & 0xFF] + HEX_NUMBERS[r3 >> 24 & 0xFF] + HEX_NUMBERS[r4 >> 0 & 0xFF] + HEX_NUMBERS[r4 >> 8 & 0xFF] + HEX_NUMBERS[r4 >> 16 & 0xFF] + HEX_NUMBERS[r4 >> 24 & 0xFF];\n }", "id(){\n if(!this.uniqueID){\n var hashids = new Hashids(this.body.substring(0, this.body.length));\n this.uniqueID = hashids.encode([Math.floor(Math.random() * Math.floor(1000))]);\n }\n return this.uniqueID;\n }", "function guid() {\n return (S4()+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+S4()+S4());\n }", "function guid() {\n return (S4()+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+S4()+S4());\n }", "function _id() {\n\t\tvar S4 = function() {\n\t\t return (((1+Math.random())*0x10000)|0).toString(16).substring(1);\n\t\t};\n\t\treturn (S4()+S4());\n\t}", "function getID() {\n\tvar tmp = Math.round(Math.random() * 100000);\n\tvar str = \"OBJ\" + tmp;\n\treturn str;\n}", "uuid() {\n\t\t\t\treturn Math.floor((1 + Math.random()) * 0x10000).toString(16);\n\t\t\t}", "function uniqueID() \n{\n return (Math.floor((Math.random()*1000000))).toString(32)+''+(new Date().getTime()).toString(32)\n}", "function guid() {\n return (S4()+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+S4()+S4());\n }", "function guid() {\n return parseInt(Date.now() + Math.random())\n }", "function getId () {\n return '_' + Math.random().toString(36).substr(2, 9);\n}", "generateId() { return this._get_uid() }", "function guid() {\r\n\treturn parseInt(Date.now() + Math.random());\r\n}", "function getX(sprite) {\n\treturn sprite.x + background.x;\n}", "function getID() {\n var id = 'bzm' + (new Date()).getTime();\n\n return id;\n }", "function guid() {\r\n return (S4()+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+S4()+S4());\r\n}", "function get_sprite_by_id( rsprite_id ) // get sprite sheet x,y offsets obj.\n{ // ID is a 0-based index; sprites are assumed to be grid cell size.\n // Sprite sheet is 2-elts 1-row, wall=0 and floor=1.\n let id = rsprite_id % 2;\n let sprite_ob = { id: id, img: g_img_stuff };\n sprite_ob.sheet_pix_x = id * g_grid.cell_size;\n sprite_ob.sheet_pix_y = 0;\n return sprite_ob;\n}", "function guid() {\n return (S4() + S4() + \"-\" + S4() + \"-\" + S4() + \"-\" + S4() + \"-\" + S4() + S4() + S4());\n }", "_uniqueID() {\n const chr4 = () => Math.random().toString(16).slice(-4);\n return `${chr4()}${chr4()}-${chr4()}-${chr4()}-${chr4()}-${chr4()}${chr4()}${chr4()}`;\n }", "function id() {\n return '_' + Math.random().toString(36).substr(2, 9);\n }", "function getUuid() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n }", "function getObjectID()\r\n{\r\n\tvar objectID = \"\";\r\n\t\r\n\tfor ( var i=1; i<21; i++ )\r\n\t{\r\n\t\tobjectID += String.fromCharCode(Math.floor(Math.random()*26) + 97);\r\n\t\tif ( i<20 && (i % 5) == 0 )\r\n\t\t\tobjectID += \"-\";\r\n\t}\r\n\t\r\n\treturn objectID;\r\n\t\r\n}", "function nextUniqueId() {\n\tidCounter++;\n\treturn idCounter.toString();\n}", "function guid() {\n return (S4()+S4()+S4()+S4());\n}", "function getUniqueId() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1);\n }\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' +\n s4() + '-' + s4() + s4() + s4();\n}", "function guid() {\n return (S4()+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+S4()+S4());\n}", "function guid() {\n return (S4()+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+S4()+S4());\n}", "function guid() {\n return (S4()+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+S4()+S4());\n}", "function guid() {\n return (S4()+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+S4()+S4());\n}", "function guid() {\n return S4() + S4() + \"-\" + S4() + \"-\" + S4() + \"-\" + S4() + \"-\" + S4() + S4() + S4();\n}", "function generateUniqueId() {\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n var r = crypto.getRandomValues(new Uint8Array(1))[0] % 16 | 0;\n var v = c === \"x\" ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n }", "function getTexture(spriteURL = \"images/placeholder.png\"){\r\n return PIXI.loader.resources[spriteURL].texture;\r\n}", "getUid() {\n const timestamp = (new Date()).getTime().toString(36);\n const randomString = (Math.random() * 10000000000000000).toString(36).replace('.', '');\n return `${timestamp}-${randomString}`;\n }", "function guid() {\r\n return parseInt(Date.now() + Math.random());\r\n}", "function UID() {\n var id = GUID++;\n //if GUID is not unique\n if (id in entities) {\n return UID(); //recurse until it is unique\n }\n return id;\n}", "function Id() {\n\treturn Math.floor(Math.random() * 99999999999) + 1;\n}", "sprite(sprite) {\n let spr;\n for(let page of Object.keys(this[PAGES])) {\n if(spr = this[PAGES][page].make(sprite)) {\n break;\n }\n }\n if(!spr) { throw `Sprite ${sprite} does not exist in the current set of texture pages`; }\n return spr;\n }", "function id () {\n return '_' + Math.random().toString(36).substr(2, 9);\n}", "function uniqueID() {\n let x = 1;\n let uID = x++;\n}", "function generateUniqueID() {\r\n\treturn Date.now();\r\n}", "static genHotkeyManagerUID(){\n let prev = HotkeyManager.latest_uid\n if (prev == undefined) {\n prev = -1;\n }\n let uid = prev + 1;\n HotkeyManager.latest_uid = uid;\n return uid;\n }", "function __ruuid() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(\n /[xy]/g,\n function (c) {\n var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);\n return v.toString(16);\n }\n );\n}", "function uniqueId() {\n return (new Date).getTime()\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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }", "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 }" ]
[ "0.6376276", "0.6334066", "0.63036495", "0.6285816", "0.62337476", "0.6224971", "0.6204668", "0.60802", "0.60688955", "0.601888", "0.6006288", "0.598085", "0.59690684", "0.59662044", "0.5959477", "0.5951692", "0.5930449", "0.59182614", "0.59182614", "0.5916017", "0.5913496", "0.59091514", "0.589816", "0.5894711", "0.5882926", "0.5878132", "0.5877786", "0.5841413", "0.58257484", "0.58252007", "0.58127064", "0.5810585", "0.5810585", "0.5808146", "0.5800333", "0.57934934", "0.5793185", "0.57898194", "0.57851475", "0.5780166", "0.5777879", "0.5774677", "0.5763997", "0.5761999", "0.57488924", "0.57469773", "0.57459384", "0.57446337", "0.57329696", "0.5730289", "0.57212645", "0.5711826", "0.5705327", "0.5703466", "0.56986785", "0.56986785", "0.56986785", "0.56986785", "0.5677315", "0.56745934", "0.5674149", "0.56706816", "0.5665691", "0.5664296", "0.5654572", "0.5654192", "0.56531733", "0.56524754", "0.5646831", "0.5640369", "0.5609428", "0.56046385", "0.55990213", "0.55990213", "0.55990213", "0.55990213", "0.55990213", "0.55990213", "0.55990213", "0.55990213", "0.55990213", "0.55990213", "0.55990213", "0.55990213", "0.55990213", "0.55990213", "0.55990213", "0.55990213", "0.55990213", "0.55990213", "0.55990213", "0.55990213", "0.55990213", "0.55990213", "0.55990213", "0.55990213", "0.55990213", "0.55990213", "0.55990213", "0.55990213", "0.55990213" ]
0.0
-1
Plays the animation, starting from the specified frame.
play(frame) { this.playing = true; if (frame !== undefined) this.frame = frame; this.targetFrame = -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "play() {\n this.frame = window.requestAnimationFrame(()=>this.firstFrame());\n }", "animate_start(frame) {\r\n this.sprite.animate = true;\r\n }", "function playAnimation(sequenceArray) {\n\n //Reset any possible previous animations\n reset();\n\n //Figure out how many frames there are in the range\n if (!sequenceArray) {\n startFrame = 0;\n endFrame = sprite.totalFrames - 1;\n } else {\n startFrame = sequenceArray[0];\n endFrame = sequenceArray[1];\n }\n\n //Calculate the number of frames\n numberOfFrames = endFrame - startFrame;\n\n //Compensate for two edge cases:\n //1. If the `startFrame` happens to be `0`\n /*\n if (startFrame === 0) {\n numberOfFrames += 1;\n frameCounter += 1;\n }\n */\n\n //2. If only a two-frame sequence was provided\n /*\n if(numberOfFrames === 1) {\n numberOfFrames = 2;\n frameCounter += 1;\n } \n */\n\n //Calculate the frame rate. Set the default fps to 12\n if (!sprite.fps) sprite.fps = 12;\n let frameRate = 1000 / sprite.fps;\n\n //Set the sprite to the starting frame\n sprite.gotoAndStop(startFrame);\n\n //Set the `frameCounter` to the first frame \n frameCounter = 1;\n\n //If the state isn't already `playing`, start it\n if (!sprite.animating) {\n timerInterval = setInterval(advanceFrame.bind(this), frameRate);\n sprite.animating = true;\n }\n }", "play() {\n if (this.el) {\n this.el.style[this.__playState] = \"running\";\n this.el.$$animation.__playing = true;\n // in case the animation is based on JS\n if (this.i != undefined && qx.bom.element.AnimationJs) {\n qx.bom.element.AnimationJs.play(this);\n }\n }\n }", "play() {\n\t\t\t\tthis.playing = true;\n\t\t\t\tthis.targetFrame = -1;\n\t\t\t}", "animate() {\n clearTimeout(this.timeout);\n\n this.drawCurrentFrame();\n\n if (this.props.play && (this.props.frame + 1) < this.props.replay.turns.length) {\n this.props.incrementFrame();\n\n // if playing, render again\n clearTimeout(this.timeout);\n this.timeout = setTimeout(() => requestAnimationFrame(this.animate), TICK_SPEED);\n }\n }", "play() {\n\t\tthis.animActions.forEach( action => action.play() );\n\t\tthis.isPlaying = true;\n\t}", "goToFrame(frame) {\n this._video.onPlay();\n return this._video.gotoFrame(frame, true);\n }", "play(x, y) {\n this.reset();\n this._engine.playAnimation(this, x, y);\n }", "startAnimating(fps){\n this.fpsInterval = 1000 / fps;\n this.then = Date.now();\n this.animate();\n }", "animate() {\n this._drawSprite(\n this.image, \n this.width * this.frameX, \n this.height * this.frameY,\n this.width, \n this.height, \n this.x,\n this.y, \n this.width, \n this.height\n )\n this.movePlayer()\n this.playerFrame() \n }", "function startAnimating() {\n fpsInterval = 1000 / fps;\n then = Date.now();\n startTime = then;\n animate();\n}", "function startAnimating(fps) {\n fpsInterval = 1000 / fps;\n then = Date.now();\n animate();\n }", "function startAnimation() {\n if (!animating) {\n prevTime = Date.now();\n\t animating = true;\n prevMixerTime = Date.now();\n\t requestAnimationFrame(doFrame);\n\t}\n}", "animate() {\n if (this.animationFrames.length > 1) {\n this.animationTimer += 1;\n const quotient = Math.floor(this.animationTimer / this.animationFrameDuration)\n const frame = quotient % this.animationFrames.length;\n this.srcImage = this.animationFrames[frame];\n if (this.animationTimer === this.animationFrameDuration * this.animationFrames.length) {\n this.animationTimer = 0;\n }\n }\n }", "function animate() {\r\n $('div#animation').fadeIn('slow');\r\n\t\tvar j;\r\n frame = (frame + dir + imageSum) % imageSum;\r\n j = frame+1;\r\n if(images[frame].complete) {\r\n $('div#animation').html('<img id=\"frame\" src=\"'+images[frame].src+'\" />');\r\n\t\t $('.label #playlabel').html('playing: ');\r\n\t\t $('.label #playstatus').html(j+' of '+imageSum);\r\n \r\n if(swingon && (j == imageSum || frame == 0)) {\r\n reverse();\r\n }\r\n \r\n timeout_id = setTimeout(function() {\r\n animate();\r\n }, delay);\r\n \r\n playing = 1;\r\n }\r\n }", "animate(){\n // request another frame\n window.requestAnimationFrame(this.animate.bind(this));\n\n // calc elapsed time since last loop\n this.now = Date.now();\n this.elapsed = this.now - this.then;\n // if enough time has elapsed, draw the next frame\n if (this.elapsed > this.fpsInterval){\n // Get ready for next frame by setting then=now, but also adjust for your\n // specified fpsInterval not being a multiple of RAF's interval (16.7ms)\n this.then = this.now - (this.elapsed % this.fpsInterval)\n\n // animation code\n this.animateOneFrame();\n }\n }", "function _play()\n {\n timeout_handle = requestAnimationFrame(function(timestamp) {\n update(timestamp);\n interpolate(timestamp);\n draw();\n \n if (currentIndexPosition == _fileLength()-1)\n {\n _pause();\n }\n _play();\n });\n }", "function animate() {\n if (PLAY_STATUS != PlayStatus.PLAYING) {\n return;\n } else {\n stepAndAnimate()\n }\n}", "function firePlay() {\n if (_requestAnimationTime === undefined) {\n _requestAnimationTime = new Date();\n setPlayAndPauseImage();\n // Start to play animation.\n playAnimation();\n }\n }", "function firePlay() {\n if (_requestAnimationTime === undefined) {\n _requestAnimationTime = new Date();\n setPlayAndPauseImage();\n // Start to play animation.\n playAnimation();\n }\n }", "function anim() {\r\n Loop();\r\n requestAnimFrame(anim);\r\n }", "startAnimation() {\r\n this.anims.play(this.animationName, true);\r\n\r\n //Play walk sound\r\n this.walk = this.scene.sound.add('walk');\r\n this.walk.play();\r\n }", "function doPlayControl() {\r\n if (!animating) {\r\n animating = true;\r\n controls.enabled = true;\r\n if (animating) {\r\n doFrame();\r\n }\r\n }\r\n}", "function run() {\n var i = 0, animation;\n\n // Check activeAnimations.length each iteration.\n for (; i < activeAnimations.length; i++) {\n // If an error occurs, continue the other animations,\n // abort only the one that raised the error.\n try {\n animation = activeAnimations[i];\n _playFrame(animation);\n } catch (ex) {\n // If an error occurs, abort the anim.\n if (animation) {\n animation.abort(ex);\n }\n }\n }\n }", "playAnimation(name) {\n this.currentAnimation = name;\n\n // TODO: replace 60 w/ app.ticker.FPS\n this.animationSpeed = this.animations[name].speed / 60;\n\n this.onFrameChange = function() {\n if (this.animations[name].events) {\n for (const frame in this.animations[name].events) {\n if (this.currentFrame == frame) {\n this.parent.emit(this.animations[name].events[frame]);\n }\n }\n }\n\n if (this.currentFrame > this.animations[name].end ||\n this.currentFrame < this.animations[name].start\n ) {\n const nextAnimation = this.animationQueue.pop();\n if (nextAnimation) {\n if (nextAnimation.loop) {\n this.loopAnimation(nextAnimation.name);\n } else {\n this.playAnimation(nextAnimation.name);\n }\n } else {\n this.gotoAndStop(this.animations[name].end);\n }\n }\n };\n\n this.texture = this.textures[this.animations[name].start];\n this.gotoAndPlay(this.animations[name].start);\n }", "function play() {\n if (timeStamp < duration) {\n playIndex = requestAnimationFrame(() => {\n timeStamp += (17 * speed);\n progressInp.value = timeStamp;\n updateDuration();\n updateReplay();\n play();\n });\n } else {\n pause();\n playBtn.textContent = '►';\n playing = false;\n }\n}", "function play(){\n // restart if animation completed \n resampleAllCanvas();\n if(current>frames.length){\n current=cachedCurrent;\n }\n else if(current===frames.length){\n current = 0;\n cachedCurrent = 0;\n }\n globalAnimationId = requestAnimationFrame(nextImage);\n playButton.setAttribute('onclick','pause();');\n playButton.innerHTML = '<i class=\"fa fa-pause\"></i>';\n}", "function advanceFrame() {\n\n //Advance the frame if `frameCounter` is less than \n //the state's total frames\n if (frameCounter < numberOfFrames + 1) {\n\n //Advance the frame\n sprite.gotoAndStop(sprite.currentFrame + 1);\n\n //Update the frame counter\n frameCounter += 1;\n\n //If we've reached the last frame and `loop`\n //is `true`, then start from the first frame again\n } else {\n if (sprite.loop) {\n sprite.gotoAndStop(startFrame);\n frameCounter = 1;\n }\n }\n }", "gotoNextFrame() {\n this.timeline.gotoNextFrame();\n }", "play(){this.__stopped=!0;this.toggleAnimation()}", "function startAnimation() {\n var lastFrame = +new Date;\n function loop(now) {\n animationID = requestAnimationFrame(loop);\n var deltaT = now - lastFrame;\n // Do not render frame when deltaT is too high\n if (Math.abs(deltaT) < 160) {\n renderFrame(deltaT);\n }\n lastFrame = now;\n }\n loop(lastFrame);\n}", "gotoNextFrame() {\n // Loop back to beginning if gotoNextFrame goes past the last frame\n var nextFramePlayheadPosition = this.playheadPosition + 1;\n\n if (nextFramePlayheadPosition > this.length) {\n nextFramePlayheadPosition = 1;\n }\n\n this.gotoFrame(nextFramePlayheadPosition);\n }", "function animate()\n{\n requestAnimationFrame(animate);\t// schedules another call to animate\n animateFrame();\t\t\t\t\t// updates the scene for the frame\n render();\t\t\t\t\t\t// draws the scene\n}", "function playNextFrame() {\n if (currentFrame >= frames.length) {\n currentFrame = 0;\n }\n\n renderFrames();\n\n var frame = frames[currentFrame];\n for (var i = 0; i < frame.length; i++) {\n if (frame[i] >= threshValue) {\n playSound(i);\n\n if (playFirstNote) {\n break;\n }\n }\n }\n\n currentFrame++;\n}", "nextFrame() {\r\n\t\t\tif (this.frame < this.length - 1) this.frame = this.frame + 1;\r\n\t\t\telse if (this.looping) this.frame = 0;\r\n\r\n\t\t\tthis.targetFrame = -1;\r\n\t\t\tthis.playing = false;\r\n\t\t}", "animate(){\n if (this.timeFromLast > this.animationTime){\n this.currentFrameNum++;\n this.currentFrameX += this.frameWidth;\n this.timeFromLast = 0;\n this.timeUntilLast = millis();\n }\n \n if (this.currentFrameNum > this.maxFrame){\n this.currentFrameNum = 3;\n this.currentFrameX = 22;\n }\n \n }", "function trigger_animation() {\n\t\t\tvar $this = $('#slide-num' + brick.to + ' a');\n\t\t\t\n\t\t\t$num.removeClass('slide-on');\n\t\t\t$this.addClass('slide-on');\n\t\t\t\n\t\t\tgotohere = -((brick.to - 1) * 1024);\n\t\t\t\n\t\t\t$scrollable.stop().animate({\n\t\t\t\tleft: gotohere},\n\t\t\t\t1000,\n\t\t\t\tfunction(){\n\t\t\t\t\tif (!$('#swf-' + brick.from).hasClass('image-loaded')) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t//var image = $('<img>').attr('src', brick.images[function_objs.lang][brick.from]);\n\t\t\t\t\t\tvar useimage = '<img src=\"' + brick.images[function_objs.lang][brick.from] + '\" alt=\"\" />'\n\t\t\t\t\t\t//console.log(useimage);\n\t\t\t\t\t\t$('#swf-' + brick.from)\n\t\t\t\t\t\t\t.parent()\n\t\t\t\t\t\t\t.addClass('image-loaded')\n\t\t\t\t\t\t\t.attr('id','swf-' + brick.from)\n\t\t\t\t\t\t\t.innerHTML = useimage;\n\t\t\t\t\t\t\t//.html(useimage);\n\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (!$('#swf-' + brick.to).hasClass('image-loaded')) {\n\t\t\t\t\t\t//call function to start flash animation\n\t\t\t\t\t\tvar swf = document.getElementById(\"swf-\" + brick.to);\n\t\t\t\t\t\tswf.replay();\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tbrick.from = brick.to;\t\t\t\t\t\n\t\t\t\t}\n\t\t\t);\n\t\t}", "function drawFrame(frame) {\n\t\tvideo.currentTime = (frame.second > video.duration ? video.duration : frame.second);\n\t}", "animate(animation) {\r\n if (!this.bmp.currentAnimation || this.bmp.currentAnimation.indexOf(animation) === -1) {\r\n this.bmp.gotoAndPlay(animation);\r\n }\r\n }", "function playAnimation(index, direction) {\n const label = direction ? labelAnimations.inLeft : labelAnimations.inRight;\n const sequence = direction ? sequences[index].inLeft : sequences[index].inRight;\n\n // play the label animation\n isAnimating = true;\n document.timeline.play(label);\n\n // get the planet animation and pause until fade out complete\n let planetAnim = document.timeline.play(sequence);\n setAnimation(planetAnim, index);\n \n // update range thumb color\n range.style.setProperty(`--planet-color`, planetColors[index]);\n \n // if another planet is already visible\n if (currentIndex) {\n // play the fade out animation\n const outSequence = direction ? sequences[currentIndex].outRight : sequences[currentIndex].outLeft;\n let outAnim = document.timeline.play(outSequence);\n\n // play the current animation, when the out animation is finished\n outAnim.onfinish = () => {\n currentAnimation.cancel();\n planetAnim.play()\n };\n } else {\n planetAnim.play()\n }\n}", "runAnimation() {\n if (!this.running) { return; }\n this.animationFrame = requestAnimationFrame(this.runAnimation);\n\n this.tick();\n this.draw();\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 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 }", "animate(animation) {\n if (!this.bmp.currentAnimation || this.bmp.currentAnimation.indexOf(animation) === -1) {\n this.bmp.gotoAndPlay(animation);\n }\n }", "function startAnimation(){\n //5. Start the animation using animationisonLoop function\n requestId=requestAnimationFrame(animationLoop);\n}", "function run(){\n\t\t\trequestAnimFrame(function(){\n\t\t\t\trun();\n\t\t\t});\n\t\t\tupdate();\n\t}", "start() {\n this.board.reset();\n this.player.play();\n this.simon.start();\n this.board.animateSequence(this.simon.sequence());\n }", "play() {\n this.timeline.play();\n }", "function playAnimation(theAvatar){\n \n if (playButton.innerHTML == \"Play\"){\n ensureLooping();\n ensureKeysIndexing();\n timescaleSlider.value = currentSpeed;\n timescaleOutput.value = currentSpeed;\n animation.play(animation.currentTime);\n animtimerSlider.value = animation.currentTime;\n playButton.innerHTML = \"Pause\";\n $(statusMsgrSelector).text(\"Playing...\");\n $(statusMsgrSelector)[0].style.display = \"block\";\n console.log(\"Animation is playing.\");\n }\n \n else if (playButton.innerHTML == \"Pause\"){\n timescaleSlider.value = 0;\n timescaleOutput.value = currentSpeed;\n animtimerSlider.value = animation.currentTime;\n playButton.innerHTML = \"Play\";\n console.log(\"animation.data:\", animation.data);\n $(statusMsgrSelector).text(\"Paused\");\n $(statusMsgrSelector)[0].style.display = \"block\";\n console.log(\"Animation paused.\");\n }\n }", "function requestPlayFrame() {\n spotgamesEventManager.dispatchEvent(spotgames.event_type.PLAY_FRAME_REQUESTED, thisgame.constructor.name);\n }", "constructor(scene,x,y){\n super(scene,x,y,'pig1',1,100);\n this.setScale(0.1);\n this.scene.anims.create({\n key: 'piganim',\n frames: [\n {key : 'pig1', frame : null},\n {key : 'pig2', frame : null},\n {key : 'pig3', frame : null},\n {key : 'pig4', frame : null},\n {key : 'pig5', frame : null},\n {key : 'pig6', frame : null},\n {key : 'pig7', frame : null},\n {key : 'pig8', frame : null},\n {key : 'pig9', frame : null},\n {key : 'pig10', frame : null},\n {key : 'pig11', frame : null},\n {key : 'pig12', frame : null},\n {key : 'pig13', frame : null},\n ],\n frameRate: 8,\n repeat: -1\n })\n\n this.play(\"piganim\");\n }", "onAnimFrame() {\n const now = Date.now();\n const delta = now - this.previousFrameTime;\n const interval = 1000 / this.props.fps;\n\n this.requestId = window.requestAnimationFrame(this.onAnimFrame);\n\n if (delta > interval) {\n this.previousFrameTime = now - (delta % interval);\n this.drawCurrentFrame();\n\n // Clamp playback between start & end frame range, looping\n // whenever we run past the end frame.\n if (this.frame < this.startFrame || this.frame > this.endFrame) {\n this.frame = this.startFrame;\n }\n }\n }", "function frame(frameStamp) {\n _timer2.default.update(frameStamp);\n isRunning = fireAll(frameStamp, _timer2.default.getElapsed());\n\n if (isRunning) {\n (0, _tick2.default)(frame);\n }\n}", "function step() {\r\n\t\tvar j;\r\n\t\tif(timeout_id) {\r\n\t\t clearTimeout(timeout_id);\r\n\t\t timeout_id = null;\r\n\t\t}\r\n\t\tframe = (frame + dir + imageSum) % imageSum;\r\n\t\tj = frame + 1;\r\n\t\t\r\n\t\tif(images[frame].complete) {\r\n\t\t $('div#animation').html('<img src=\"'+images[frame].src+'\" />');\r\n\t\t $('.label #playlabel').html('step: ');\r\n\t\t $('.label #playstatus').html(j+' of '+imageSum);\r\n\t\t \r\n\t\t if(swingon && (j == imageSum || frame == 0)) {\r\n\t\t\treverse();\r\n\t\t }\r\n\t\t \r\n\t\t playing = 0;\r\n\t\t}\r\n\t }", "function doFrame() {\r\n if(animating) {\r\n updateForFrame();\r\n controls.update();\r\n render();\r\n requestAnimationFrame(doFrame);\r\n }\r\n}", "function tick() {\n requestAnimFrame(tick);\n draw();\n if (playmine == 0){\n animate();\n }\n if (playmine == 1){\n animate_mine();\n }\n}", "play() {\n this._source.play();\n }", "function tick() {\r\n requestAnimFrame(tick);\r\n draw();\r\n animate();\r\n}", "function frameStart(){\n\n\t\t$('#navPart1').css({'background-color':'yellow', 'color':'blue'});\n\t\t$('#cap1').stop().animate({'left':'455px','top':'300px'}, 1500, 'swing');\n\t\t$('#cap2').stop().animate({'left':'450px','top':'350px'}, 1500, 'swing');\n\t\t$('#cap19').stop().animate({'left':'-80px','top':'800px'}, 1500, 'swing');\n\t\t$('#start').stop().animate({'left':'670px','top':'450px'}, 1500, 'swing');\n\t\tsetTimeout(function(){\n\t\t\t$('#start').show();\n\t\t}, 2500);\n\t\t$('#start').on('click', function(){\n\t\t\t$('#start').off('click');\n\t\t\t$('#start').stop().hide();\n\t\t\tdocument.getElementById('click').play();\n\t\t\t$('.captions').stop().animate({'bottom':'-100px','left':'-101%'},1500,'swing');\n\t\t\tframeOne();\n\t\t});\n\t}", "set_animation_frame(sequence_index, frame) {\r\n\r\n if (sequence_index < 0 || sequence_index > this.sprite.animation_sequence_data.length) {\r\n console.log('error fame does not exist');\r\n return false;\r\n }\r\n\r\n var animObj = this.sprite.animation_sequence_data[sequence_index];\r\n if (frame <0 || frame > animObj.frame_end) {\r\n console.log('frame does not exist');\r\n return false;\r\n }\r\n\r\n animObj.frame_current = frame;\r\n \r\n \r\n }", "function animate(timestamp) {\n oneStep();\n animationId = requestAnimationFrame(animate);\n}", "_playAnimation() {\n if (this._animationLast === undefined && this._animationQueue.length > 0) {\n this._animationLast = this._animationCurrent;\n this._animationCurrent = this._animationQueue.shift();\n console.log(\"New: \" + this._animationCurrent.name);\n this._animationCurrent.runCount = 0;\n }\n this._serviceAnimation(this._animationCurrent, true);\n this._serviceAnimation(this._animationLast, false);\n if (this._animationLast && this._animationLast.cleanup) {\n this._animationLast.animation.stop();\n this._animationLast.animation = undefined;\n this._animationLast = undefined;\n }\n }", "function animate() {\n game.update();\n game.draw();\n window.requestAnimFrame(animate);\n}", "function loop() {\n draw();\n requestAnimFrame(loop);\n}", "function animateFrame()\n{\n // Update the current camera and scene\n if (currentCamera !== undefined) currentCamera.updateProjectionMatrix();\n if (currentScene !== undefined) currentScene.traverse(runScripts);\n\n // Update previous mouse state here because animateFrame\n // out of sync with mouse listeners (onMouseMove, onMouseWheel)\n mousePrevX = mouseX;\n mousePrevY = mouseY;\n mousePrevScroll = mouseScroll;\n\n var t = getElapsedTime();\n frameDuration = t - frameStartTime;\n frameStartTime = t;\n frameNum++;\n}", "function startAnimation() {\n\n\tmain_play_image.src = \"images/pause.png\";\n\tif (playerElem.duration)\n\t\tseekAnimation = setInterval(moveSeekOverTime, (playerElem.duration * 1000) / slideBarElemWidth);\t\n}", "play() {\n if (this._playingState === 'play') {\n return;\n }\n\n this._playByIndex(this.index);\n this._playingState = 'play';\n }", "function runAnimation(frameFunc){\n let lastTime = null;\n function frame(time){\n if(lastTime!=null){\n let timeStep = Math.min(time - lastTime,100)/1000;\n if(frameFunc(timeStep)==false)return;\n }\n lastTime = time;\n requestAnimationFrame(frame);\n }\n requestAnimationFrame(frame);\n }", "function animatePuki(frame){\n\tif(curAnimate!=frame){\n\t\tif(frame == 'scare'){\n\t\t\tplaySound('soundScare');\n\t\t}else if(frame == 'jump'){\n\t\t\tplaySound('soundJump');\t\n\t\t}\n\t\t\n\t\tif(frame == 'spacesuit'){\n\t\t\tplaySoundLoop('soundSpacesuit');\n\t\t}else{\n\t\t\tstopSoundLoop('soundSpacesuit');\t\n\t\t}\n\t\t\n\t\tif(frame == 'run'){\n\t\t\tplaySoundLoop('soundRun');\n\t\t}else{\n\t\t\tstopSoundLoop('soundRun');\n\t\t}\n\t\t\n\t\tif(frame == 'walk'){\n\t\t\tplaySoundLoop('soundWalk');\n\t\t}else{\n\t\t\tstopSoundLoop('soundWalk');\n\t\t}\n\t\t\n\t\tif(frame == 'sleep'){\n\t\t\tplaySoundLoop('soundSnork');\n\t\t}else{\n\t\t\tstopSoundLoop('soundSnork');\n\t\t}\n\t\tcurAnimate = frame;\n\t\t\n\t\tfor(n=0;n<animation_arr.length;n++){\n\t\t\t$.pukiAnimation[animation_arr[n].name].visible=false;\n\t\t}\n\t\t\n\t\tcurPukiAnimation = $.pukiAnimation[frame];\n\t\tcurPukiAnimation.visible=true;\n\t\tcurPukiAnimation.x = puki_arr.x;\n\t\tcurPukiAnimation.y = puki_arr.y;\n\t\tcurPukiAnimation.scaleX = puki_arr.scaleX;\n\t\tcurPukiAnimation.rotation = puki_arr.rotation;\n\t\tcurPukiAnimation.gotoAndPlay(frame);\n\t}\n}", "gotoNextFrame() {\n this.scriptOwner.parentClip.gotoNextFrame();\n }", "beginFrame() { }", "start () {\n console.log(\"starting game\");\n let that = this;\n (function gameLoop() {\n that.loop();\n requestAnimFrame(gameLoop, that.ctx.canvas);\n })();\n }", "function tick() {\n requestAnimFrame(tick);\n draw();\n animate();\n}", "function startAnimation() {\n stopAnimation();\n animation = animate(slider.values[0]);\n playButton.classList.add(\"toggled\");\n }", "function start() {\n lastTime = null;\n frameId = requestAnimationFrame(onFrame);\n }", "function animate(arg) {\n $(arg).animate({opacity: '0.2' }, 100);\n $(arg).animate({opacity: '1' }, 100);\n $('audio',arg).trigger('play');\n }", "function playRun(){ \n if(curFrame < frames.length && paused == false){\n drawCurFrame();\n timeOutID = setTimeout(playRun, time); \n }\n}", "update( time ) {\r\n let animation = this.animationList[this.current];\r\n if( !animation ) return;\r\n this.progress += time * animation.fps;\r\n while( this.progress >= 1.0 ) {\r\n this.progress -= 1.0;\r\n this.frame++;\r\n if( this.frame >= animation.startFrame + animation.numFrames ) {\r\n this.frame = animation.startFrame;\r\n }\r\n }\r\n }", "play () {\n\n if (this.playing) return;\n \n this.playing = true;\n this.update();\n }", "function animationPlay()\n{\n\tif(eventSliderOb != null)\n\t{\n\t\teventSliderOb.playButtonClicked();\n\t\t\n\t\tvar playButton = document.getElementById('animPlayBtn');\n\t\tvar img = playButton.children[0];\n\t\t\n\t\t\n\t\tif(eventSliderOb.isPlayActive())\n\t\t\timg.src = \"./images/Button-Pause-16.png\";\n\t\telse\n\t\t\timg.src = \"./images/Button-Play-16.png\";\n\t\t\n\t}\n}", "function animloop() {\n init = requestAnimFrame(animloop);\n draw();\n}", "function runAnimation(frameFunc) {\n\n var lastTime = null;\n\n function frame(time) {\n\n var stop = false;\n\n if (lastTime != null) {\n\n // Set a maximum frame step of 100 milliseconds to prevent\n\n // having big jumps\n\n var timeStep = Math.min(time - lastTime, 100) / 1000;\n\n stop = frameFunc(timeStep) === false;\n\n }\n\n lastTime = time;\n\n if (!stop)\n\n requestAnimationFrame(frame);\n\n }\n\n requestAnimationFrame(frame);\n\n}", "function animate() {\n\treqAnimFrame(animate);\n\tcanvasDraw();\n}", "function playSequence(i){\n\tif(i>=sequence.length||!hasStarted){\n\t\t$(\"#board div\").addClass(\"clickable\");\n\t\treturn;\t\t\t\n\t}\t\t\t\n\tplayTune(sequence[i]);\n\tsetTimeout(function(){playSequence(i+1)},800);\n}", "function animate() {\n oneStep();\n if( ! stopRequested ) {\n animationId = requestAnimationFrame(animate);\n }\n}", "function animloop(){\n\tdraw();\n\trequestAnimFrame(animloop);\n}", "nextFrame() {\n\t\t\t\tif (this.frame < this.images.length - 1) this.frame = this.frame + 1;\n\t\t\t\telse if (this.looping) this.frame = 0;\n\n\t\t\t\tthis.targetFrame = -1;\n\t\t\t\tthis.playing = false;\n\t\t\t}", "function showFrame(nextPosition) {\n var preloadingDirection = nextPosition - animationPosition > 0 ? 1 : -1;\n changeRadarPosition(nextPosition);\n // preload next next frame (typically, +1 frame)\n // if don't do that, the animation will be blinking at the first loop\n changeRadarPosition(nextPosition + preloadingDirection, true);\n }", "setAnimationPlay_(played) {\n this.$.animation.playing = played;\n }", "function animloop() \n{\n\tdraw();\n\trequestAnimFrame(animloop);\n}", "function animloop() {\n\tinit = requestAnimFrame(animloop);\n\tdraw();\n}", "function animate() {\n draw();\n requestAnimationFrame(animate);\n}", "function animate() {\n draw();\n requestAnimationFrame(animate);\n}", "function animate() {\n draw();\n requestAnimationFrame(animate);\n}", "function runAnimation(frameFunc)\n{\n var lastTime = null;\n function frame(time)\n {\n var stop = false;\n if (lastTime != null)\n {\n // Set a maximum frame step of 100 milliseconds to prevent\n // having big jumps\n var timeStep = Math.min(time - lastTime, 100) / 1000;\n stop = frameFunc(timeStep) === false;\n }\n\n lastTime = time;\n\n if (!stop)\n {\n requestAnimationFrame(frame);\n }\n }\n requestAnimationFrame(frame);\n}", "function animate() {\r\n\tif (runAnim) {\r\n\t\trequestAnimationFrame(animate);\r\n\t}\r\n\trender();\r\n}", "function animate()\n{\n frameCount++;\n // movement update\n update();\n // render update\n render();\n // trigger next frame\n requestAnimationFrame(animate);\n}", "function animate() {\n // request another frame\n requestAnimationFrame(animate);\n\n // calc elapsed time since last loop\n now = Date.now();\n elapsed = now - then;\n\n // if enough time has elapsed, draw the next frame\n if (elapsed > fpsInterval) {\n then = now - (elapsed % fpsInterval);\n\n // Put your drawing code here\n buildBoard();\n headSnake();\n drawPlayer();\n //checkPoint();\n drawPoints();\n }\n}", "function tick() {\r\n\trequestAnimFrame(tick);\r\n\tdraw();\r\n\tanimate();\r\n}" ]
[ "0.74509704", "0.7062324", "0.69954747", "0.68558973", "0.6678242", "0.663272", "0.6590897", "0.6588616", "0.6556551", "0.64773655", "0.64632434", "0.6458551", "0.6437455", "0.64117974", "0.63575435", "0.63106775", "0.62889117", "0.6288061", "0.6278835", "0.6277658", "0.6277658", "0.627396", "0.62543476", "0.6205433", "0.6199225", "0.61771536", "0.615135", "0.6145155", "0.6131358", "0.610647", "0.6105555", "0.6097426", "0.6087924", "0.60784155", "0.60710305", "0.6059026", "0.6042971", "0.60300183", "0.59962595", "0.59879535", "0.59849036", "0.5961228", "0.59548616", "0.59548616", "0.5945826", "0.5941225", "0.593366", "0.5921258", "0.5912275", "0.5892746", "0.5882425", "0.5861188", "0.58569294", "0.58565885", "0.58543384", "0.584994", "0.584235", "0.58396333", "0.5839518", "0.58309543", "0.5828889", "0.57951045", "0.5794409", "0.57928944", "0.5792771", "0.5791707", "0.57870626", "0.5786871", "0.5783775", "0.5781392", "0.57780635", "0.5769194", "0.5765352", "0.5763025", "0.5753577", "0.57511383", "0.575051", "0.5747107", "0.57355756", "0.5729446", "0.57152534", "0.5711105", "0.5709436", "0.5699926", "0.56937855", "0.5686334", "0.5676789", "0.567346", "0.5669189", "0.5668168", "0.5668041", "0.5658598", "0.5656827", "0.5656827", "0.5656827", "0.5655222", "0.5650986", "0.56498647", "0.5648546", "0.56484467" ]
0.72535974
1
Plays the animation backwards. Equivalent to ani.goToFrame(0)
rewind() { this.looping = false; this.goToFrame(0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function backward(){\n //alert(\"cur \"+curFrame);\n if(curFrame == 0){\n if(!isBlackOut){\n curFrame = frames.length-1;\n }else if(isBlackOut){\n curFrame = frames.length;\n }\n }\n \n if(!isBlackOut && curFrame >= 3){\n curFrame = curFrame-4;\n drawCurFrame();\n }else if(isBlackOut && curFrame >= 2){\n curFrame = curFrame-2;\n drawCurFrame();\n }\n}", "function stopAnimation() {\n reset();\n sprite.gotoAndStop(sprite.currentFrame);\n }", "stopAtLastFrame() {\n\t\tthis.animActions.forEach( action => action.play() );\n\t\tthis.animMixer.update( this.duration );\n\t\tthis.animMixer.stopAllAction();\n\t}", "function stepBackward(){\n if(index === 0){\n index = playList.length - 1\n }else{\n index--\n }\n\n box.innerHTML = `Track ${index + 1} - ${playList[index]}${ext}`;\n audio.src = dir + playList[index] + ext;\n audio.play()\n }", "goToAndStop(value, isFrame = true) {\r\n this.lottieAnimation.goToAndStop(value, isFrame);\r\n }", "animMoveBack(direction) {\n let anim = this.renderAnimation('moveBack', direction);\n let board = this.board;\n let pixi = this.pixi;\n\n anim.frames.forEach((frame, frameId) => {\n let offsetRatio = (frameId + 1) / anim.frames.length;\n let offset = board.getOffset(-offsetRatio / 2, direction);\n\n anim.splice(frameId, () => pixi.data.position = new PIXI.Point(\n pixi.position.x + offset[0],\n pixi.position.y + offset[1],\n ));\n });\n\n return anim;\n }", "function transitionBack() {\n var animate = requestAnimationFrame(transitionBack);\n if (x >= 0) {\n x -= 5;\n draw();\n } else {\n cancelAnimationFrame(animate);\n }\n\n }", "function animationGoBackward()\n{\n\tif(eventSliderOb != null)\n\t{\n\t\teventSliderOb.moveSliderBackward();\n\t}\n}", "moveBackward () {\n this.update(this.deltaIndex(-1))\n }", "previousFrame() {\r\n\t\t\tif (this.frame > 0) this.frame = this.frame - 1;\r\n\t\t\telse if (this.looping) this.frame = this.length - 1;\r\n\r\n\t\t\tthis.targetFrame = -1;\r\n\t\t\tthis.playing = false;\r\n\t\t}", "function stop() {\n\n\t\ttry {\n\t\t // Pass in the movement to the game.\n\t\t animation.move(\"x\", moveTypes.none);\n\t\t}\n\t\tcatch (err) {\n\t\t\tconsole.log(err);\n\t\t}\n\t}", "function forward(){\n if(curFrame <= frames.length-1)\n drawCurFrame();\n}", "function backward() {\n const currProgress = parseInt(progressInp.value, 10);\n\n if ((currProgress - 2000) > 0) {\n progressInp.value = currProgress - 2000;\n } else {\n progressInp.value = 0;\n }\n\n updateDuration();\n updateReplay();\n}", "function stopAnimation(){\n\t\ttile = toTile;\n\t\tPos = toPos;\n\t\tvelocity = 0;\n\t\tAnimation.moving = false;\n\t}", "function turnBack() {\n\topenedCard[0].classList.remove('open', 'show');\n\topenedCard[1].classList.remove('open', 'show');\n\topenedCard = [];\n\tanimationFinished = true;\n}", "function stopCurrentAnimation() {\n cancelAnimationFrame(nextAnimationFrame);\n nextAnimationFrame = 0;\n clearTimeout(nextTimeout);\n nextTimeout = 0;\n}", "goBack() {\n this.currentIdx = Math.max(0, this.currentIdx - 1);\n }", "updateFrame() {\n let newFrameIndex;\n if(this.isInReverse) {\n newFrameIndex = this.currFrame - 1;\n if(newFrameIndex < 0) {\n if (this.loops) {\n this.isInReverse = false;\n newFrameIndex = this.currFrame + 1;\n } else {\n this.isAnimating = false;\n this.isFinished = true;\n newFrameIndex = 0;\n } \n } \n } else {\n newFrameIndex = this.currFrame + 1;\n if(newFrameIndex >= this.frames.length) {\n if(this.reverses) {\n newFrameIndex = this.currFrame - 1;\n this.isInReverse = true;\n } else if(this.loops) {\n newFrameIndex = 0;\n } else if (this.holds) { \n newFrameIndex = this.frames.length - 1;\n } else {\n this.isAnimating = false;\n this.isFinished = true;\n newFrameIndex = 0;\n }\n }\n }\n\n this.currFrame = newFrameIndex;\n }", "function slideBackward() {\n if ($run.activeIndex > 0) {\n $run.activeIndex -= 1;\n } else if ($conf.cycle) {\n $run.activeIndex = ($conf.slides.length - 1);\n }\n\n alignToActiveSlide();\n }", "function onAnimationEnd() {\n // stop the last frame from being missed..\n rec.stop();\n }", "stop() {\n cancelAnimationFrame(this.frameId)\n }", "gotoPrevFrame() {\n var prevFramePlayheadPosition = this.playheadPosition - 1;\n\n if (prevFramePlayheadPosition <= 0) {\n prevFramePlayheadPosition = this.length;\n }\n\n this.gotoFrame(prevFramePlayheadPosition);\n }", "function goBack () {\n // two right turn, make it turn back (180 degree)\n robot.turnRight()\n robot.turnRight()\n robot.move()\n // another tow right turn, make it return to its original facing direction\n robot.turnRight()\n robot.turnRight()\n }", "stop() {\n if (this._animationFrame) {\n cancelAnimationFrame(this._animationFrame);\n }\n }", "function backwardStep(e) {\n setMedia();\n if (media.currentTime > trjs.param.backwardskip)\n media.currentTime = media.currentTime - trjs.param.backwardskip;\n else\n media.currentTime = 0;\n }", "gotoPrevFrame() {\n this.scriptOwner.parentClip.gotoPrevFrame();\n }", "animate_stop() {\r\n this.sprite.animate = false;\r\n }", "async reverse() {\n this.tl.pause();\n this.angle = 100;\n this._playShieldBounceSound();\n\n await gsap.to(this, {\n x: -50,\n y: 'random(-50,50)',\n duration: 1,\n });\n }", "getNextFrame(){\n let sprite = this.frames[this.frameIndex]\n if(this.forward){\n this.frameIndex++\n if(this.frameIndex === this.frames.length){\n this.frameIndex -= 2\n this.forward = false\n console.log('reverse')\n }\n }else{\n this.frameIndex--\n if(this.frameIndex < 0){\n this.frameIndex = 1\n this.forward = true\n console.log('forward')\n }\n }\n return sprite\n }", "gotoNextFrame() {\n this.scriptOwner.parentClip.gotoNextFrame();\n }", "function slideBack() {\n grabPreviousSlide();\n nextImage.src = slides[currentSlide].image;\n caption = slides[currentSlide].caption;\n sequence.innerHTML = (currentSlide + 1) + \" / \" + slides.length;\n\n bufferCtx.canvas.width = slideshow.width;\n bufferCtx.canvas.height = slideshow.height;\n\n x = slideshow.width;\n draw();\n transitionBack();\n\n }", "stop() {\n this.renderer.setAnimationLoop(null);\n }", "function stop() {\n cancelAnimationFrame(frameId);\n }", "previousFrame() {\n\t\t\t\tif (this.frame > 0) this.frame = this.frame - 1;\n\t\t\t\telse if (this.looping) this.frame = this.images.length - 1;\n\n\t\t\t\tthis.targetFrame = -1;\n\t\t\t\tthis.playing = false;\n\t\t\t}", "function firePreviousFrame() {\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 changeToPreviousFrame();\n }", "function firePreviousFrame() {\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 changeToPreviousFrame();\n }", "nextFrame() {\r\n\t\t\tif (this.frame < this.length - 1) this.frame = this.frame + 1;\r\n\t\t\telse if (this.looping) this.frame = 0;\r\n\r\n\t\t\tthis.targetFrame = -1;\r\n\t\t\tthis.playing = false;\r\n\t\t}", "function handleBackward(){\n audio.currentTime -= 3\n }", "prev() {\n const self = this;\n if (!self.isAnimating) { self.index -= 1; self.to(self.index); }\n }", "gotoPrevFrame() {\n this.timeline.gotoPrevFrame();\n }", "back() {\n if (this.index <= 0) return;\n\n this.index--;\n this._update();\n this._dispatch();\n }", "cancelFrame() {\n cancelAnimationFrame(this.frame.count);\n }", "cancelFrame() {\n cancelAnimationFrame(this.frame.count);\n }", "getPreviousFrame() {\nvar f;\nf = this.fCur - 1;\nif (f < 0) {\nf = this.fCount - 1;\n}\nreturn this.setFrameAt(f);\n}", "function stopAnimation() {\n cancelAnimationFrame(animationID)\n}", "function skipBackwardToStart()\r\n\t{\r\n\t\tmyVideo.currentTime = 0; //the playback time returns back to 0 seconds\r\n\t\t//if statement; outcome differs depending on conditions\r\n\t\tif ( myVideo.currentTime === 0 )\r\n\t\t{\r\n\t\t\tmyVideo.pause(); //the DOM pause method pauses the video, when clicked\r\n\t\t\tplayButton.innerHTML = \"&#9658;\" ; //updates inside HTML button selector when clicked: turns into a right-pointing pointer made from single Unicode\r\n\t\t\tmyVideo.load(); //DOM load() method re-loads the video\r\n\t\t\tscrubSlider.value = 0; //reset the slider for video playback to zero\r\n\t\t} //end if statement\r\n\t}", "function animation_stop() {\n if (animationState.mode && animationState.mode !== 'stop') {\n if (animationState.raf) {\n window.cancelAnimationFrame(animationState.raf);\n animationState.raf = null;\n }\n reset_styles();\n animationState.position = null;\n animationState.mode = 'stop';\n }\n }", "function goBack() {\n pauseSlideshow();\n isRandom = false;\n toggle_sequence.innerHTML = \"Sequential\";\n if (effect == 2) {\n slideBack();\n } else {\n grabPreviousSlide();\n loadSlide();\n }\n\n }", "rewind() {\n\t\t\t\tthis.frame = 0;\n\t\t\t}", "stopAnimation() {\r\n this.anims.stop();\r\n\r\n //Stop walk sound\r\n this.walk.stop();\r\n }", "function resumeAnimation() {\n startAnimation()\n}", "execute() {\n this.internal.spriteSheet.playForwardAnimation(Animations.walkBackward);\n this.internal.moveController.moveBackward();\n }", "moveBackwards() {\n this.view.moveBackwards();\n }", "function rewind() {\n target = this.classList[1] - 1;\n\n shownMedia[target].currentTime -= 5;\n }", "prev() {\n const index = this.index - 1;\n this.index = (index < 0) ? this._frames.length + index : index;\n }", "function pause() {\n if (playIndex) {\n cancelAnimationFrame(playIndex);\n }\n}", "back() {\n this.index--;\n }", "moveBackward(){\n if (this.state.position + 800 > 0) {\n this.setState({position: 0});\n } else {\n this.setState({position: this.state.position + 800});\n }\n }", "gotoNextFrame() {\n this.timeline.gotoNextFrame();\n }", "back(options = { animated: true, animationDirection: 'back' }) {\n this.setDirection('back', options.animated, options.animationDirection, options.animation);\n return this.location.back();\n }", "stop() {\n window.cancelAnimationFrame(this.loopID);\n }", "function MediaGoBack()\r\n{\r\n MediaStop();\r\n\r\n if (WrapAtEnd)\r\n (iCurrentImage == 0) ? iCurrentImage = (xMediaContent.length - 2) : iCurrentImage-=2;\r\n else\r\n (iCurrentImage == 0) ? iCurrentImage = 0 : iCurrentImage-=2;\r\n\r\n document.MEDIAIMAGE.src = xMediaContent[iCurrentImage];\r\n}", "function quickBackward() {\n drone.backward(speed)\n setTimeout(function () {\n resetDroneSpeed();\n }, 500)\n}", "function animate() {\n if (PLAY_STATUS != PlayStatus.PLAYING) {\n return;\n } else {\n stepAndAnimate()\n }\n}", "reset() {\n this.currentFrame = 0;\n }", "gotoNextFrame() {\n // Loop back to beginning if gotoNextFrame goes past the last frame\n var nextFramePlayheadPosition = this.playheadPosition + 1;\n\n if (nextFramePlayheadPosition > this.length) {\n nextFramePlayheadPosition = 1;\n }\n\n this.gotoFrame(nextFramePlayheadPosition);\n }", "update() {\n frames = 0;\n this.moveDown();\n }", "play(){this.__stopped=!0;this.toggleAnimation()}", "function back() {\n list--;\n if (list < 0) {\n list = 4;\n }\n play();\n}", "function stop() {\r\n animating = false;\r\n }", "function Start () { \r\n animation.wrapMode = WrapMode.Loop; \r\n animation.Stop(); \r\n Idle();\r\n}", "stop() {\n this._enableAnimation = false;\n }", "goBack() {\n this.lastIndex = Math.max(0, this.lastIndex - 1);\n }", "stop() {\n if (\n this.el &&\n qx.core.Environment.get(\"css.animation\") &&\n !this.jsAnimation\n ) {\n this.el.style[this.__playState] = \"\";\n this.el.style[qx.core.Environment.get(\"css.animation\").name] = \"\";\n this.el.$$animation.__playing = false;\n this.el.$$animation.__ended = true;\n }\n // in case the animation is based on JS\n else if (this.jsAnimation) {\n this.stopped = true;\n qx.bom.element.AnimationJs.stop(this);\n }\n }", "skip(frames) {\n this.currentFrame = (this.currentFrame + frames) % this.sprites.length;\n }", "function History_MoveBack()\n{\n\t//forward to move to index\n\tthis.MoveToIndex(this.CurrentStateIndex - 1);\n}", "function prevFrame(){\n // Protecting lower bounds\n if (frame === 1){\n console.log('No Previous Frame')\n return\n }\n setFrame(frame - 1)\n console.log('Previous Frame')\n playerRef.current.seekTo(frame / 60)\n console.log(frame)\n console.log(frame / 60)\n }", "stop() {\n this.pause();\n this._playingState = 'idle';\n this.index = 0;\n }", "back(length = this.length) {\n // Change the direction momentarily\n this.direction -= 180;\n // Use forward to avoid repeating code\n this.forward(toInt(length));\n // Restore the direction as it was before\n this.direction += 180;\n }", "animate(){\n if (this.timeFromLast > this.animationTime){\n this.currentFrameNum++;\n this.currentFrameX += this.frameWidth;\n this.timeFromLast = 0;\n this.timeUntilLast = millis();\n }\n \n if (this.currentFrameNum > this.maxFrame){\n this.currentFrameNum = 3;\n this.currentFrameX = 22;\n }\n \n }", "stop(){this.__stopped=!1;this.toggleAnimation()}", "function onAnimationDone() {\n sourceFrameIndex = currentFrameIndex;\n if (playing) {\n waitTimeout();\n }\n }", "function goBack() {\n\tscoreHistoryDiv.classList.toggle(\"collapse\");\n\tintroDiv.classList.toggle(\"collapse\");\n\tactiveDiv = introDiv;\n\tsecondsLeft = 75;\n\ttimerNav.innerHTML = secondsLeft;\n\ti = 0;\n}", "function animationLost() {\n\t\tconsole.log(\"he perdido\");\t\n\tposX2=hasta;\t\nhasta=hasta-60;\nposX=posX-60;\n\t\t// Start the animation.\n\t\trequestID2 = requestAnimationFrame(animate2);\n\t}", "stop() {\n // Run unload scripts on all objects\n this.getAllFrames().forEach(frame => {\n frame.clips.forEach(clip => {\n clip.runScript('unload');\n });\n });\n this.stopAllSounds();\n this.view.renderMode = 'svg';\n clearInterval(this._tickIntervalID);\n this._tickIntervalID = null; // Loading the snapshot to restore project state also moves the playhead back to where it was originally.\n // We actually don't want this, preview play should actually move the playhead after it's stopped.\n\n var currentPlayhead = this.focus.timeline.playheadPosition;\n this.history.loadSnapshot('state-before-play');\n this.focus.timeline.playheadPosition = currentPlayhead;\n }", "nextFrame() {\n\t\t\t\tif (this.frame < this.images.length - 1) this.frame = this.frame + 1;\n\t\t\t\telse if (this.looping) this.frame = 0;\n\n\t\t\t\tthis.targetFrame = -1;\n\t\t\t\tthis.playing = false;\n\t\t\t}", "function stepBackward() {\n // Get currently active story container item and previous sibling\n var $thisSibling = $(\".story-container-items--active .story-container-item--active\"),\n $prevSibling = $thisSibling.prev();\n // Slide out and deactivate current active story container item\n $thisSibling.toggle();\n $thisSibling.toggleClass(\"story-container-item--active\");\n // Slide in and activate previous story container item\n $prevSibling.toggle();\n $prevSibling.toggleClass(\"story-container-item--active\");\n // Scale width of new container to preserve aspect ratio\n scaleWidth($prevSibling);\n // Secondary card (sidebar) activation and deactivation\n if (ground_truth[$prevSibling.attr(\"id\")][\"story-item-number\"] !==\n ground_truth[$thisSibling.attr(\"id\")][\"story-item-number\"]) {\n toggleSecondaryCardItem(ground_truth[$prevSibling.attr(\"id\")][\"story-item-number\"]);\n toggleSecondaryCardItem(ground_truth[$thisSibling.attr(\"id\")][\"story-item-number\"]);\n }\n}", "function stopAnimation() {\n const movingBlock = document.querySelector('.new-block:last-of-type')\n movingBlock.style.animationPlayState = 'paused'\n}", "playerWalkAnimStop() {\n this.isWalking = false;\n if (this.anims) {\n this.anims.stop();\n } \n }", "function back() {\n if (res.length > 1) {\n player.textContent = !is_x_next ? \"X\" : \"O\";\n is_x_next = !is_x_next;\n\n res.pop();\n updateUi();\n }\n}", "function stopanimate() {\r\n window.cancelAnimationFrame(request)\r\n }", "stopDrawing() {\n this.updateAnimation = false;\n }", "goback() { this.back = true; }", "back() {\n const { index, showTooltip } = this.state;\n const { steps } = this.props;\n const previousIndex = index - 1;\n\n const shouldDisplay = Boolean(steps[previousIndex]) && showTooltip;\n\n this.logger('joyride:back', ['new index:', previousIndex]);\n this.toggleTooltip(shouldDisplay, previousIndex, 'next');\n }", "function stepBackward() {\n $.get('/grid/back', function (data) {\n updateGrid(data);\n });\n}", "function checkAnimation (params){\n if(params.reversed()){\n params.play()\n }else{\n params.reverse()\n }\n}", "function frameAnimationEnd() {\n f.animatedFrames = f.animatedFrames || 0;\n f.animatedFrames++;\n if(f.animatedFrames == f.frameItems.length){\n f.finished = true;\n f.o.cbFinished.call(f);\n }\n \n }", "function flipGo( $panel, current, to ){\n\t\t\tvar direction = 1;\n\t\t\t\n\t\t\tif( current === to ){\n\t\t\t\tdirection = 0;\n\t\t\t};\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\tswitch( direction ){\n\t\t\t\tcase 0:\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tvar skipAnimation = doSkipAnimation( current, to, options.alphabet.length );\n\t\t\t\t\tcurrent = options.alphabet[ current + 1 ] ? current : -1;\n\t\t\t\t\tvar next = options.alphabet[ current + 1 ];\t\t\t\t\n\t\t\t\t\tvar $def = $.Deferred();\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tflipUp( next, $panel, skipAnimation, $def );\n\t\t\t\t\t\n\t\t\t\t\t$.when( $def ).then( function(){\n\t\t\t\t\t\tcurrent++;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tflipGo( $panel, current, to );\n\t\t\t\t\t});\t\t\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t};\n\t\t}", "function backButtonTrigger() {\n if (window.currentVideoSelectedForPlayback) {\n setCurrentlyPlaying(false)\n const currentNode = window.currentVideoSelectedForPlayback\n const currentTime = currentNode.data.videoCore.currentTime\n const currentVideoStart = currentNode.data.metadata.startTime\n\n if (currentTime - currentVideoStart > 1) {\n currentNode.data.videoCore.currentTime -= 1\n } else if (currentNode.prev) {\n const remainingTime = 1 - currentTime\n window.currentVideoSelectedForPlayback = currentNode.prev\n const prevEndTime = window.currentVideoSelectedForPlayback.data.metadata.endTime\n window.currentVideoSelectedForPlayback.data.videoCore.currentTime = prevEndTime - remainingTime\n } else {\n window.currentVideoSelectedForPlayback.data.videoCore.currentTime = currentVideoStart\n }\n renderUIAfterFrameChange(window.currentVideoSelectedForPlayback)\n }\n}", "animate(){\n if (this.timeFromLast > this.animationTime){\n this.currentFrameNum++;\n this.currentFrameX += this.frameWidth;\n this.timeFromLast = 0;\n this.timeUntilLast = millis();\n }\n \n //change to stationary after hadouken is used\n if (this.state === \"hadouken\" && this.currentFrameNum > this.maxFrame) this.stationaryState();\n\n //resetting the animation after the ninth frame\n if (this.currentFrameNum > this.maxFrame){ \n this.currentFrameX = 0;\n this.currentFrameNum = 0;\n\n //changed to stationary if the user has let go of a movement key\n if (this.willStop === true) this.stationaryState();\n\n this.timeFromLast = 0;\n this.timeUntilLast = millis();\n\n }\n\n \n \n\n }" ]
[ "0.73574317", "0.7228817", "0.7186079", "0.67603755", "0.67092985", "0.6707286", "0.6694453", "0.66923225", "0.6545906", "0.6538831", "0.65234387", "0.6487065", "0.64786786", "0.647234", "0.64350504", "0.6393924", "0.6383703", "0.63565725", "0.63535786", "0.63356227", "0.63205427", "0.6306244", "0.63059795", "0.6302705", "0.6274382", "0.6268794", "0.6266877", "0.62663704", "0.6264553", "0.624919", "0.62434465", "0.6232271", "0.62136906", "0.62009066", "0.6200627", "0.6200627", "0.61847496", "0.6179077", "0.6172022", "0.6161713", "0.61550194", "0.61547196", "0.61547196", "0.61528987", "0.6152244", "0.6147771", "0.6138408", "0.6137248", "0.61261886", "0.611032", "0.610614", "0.6088974", "0.60832465", "0.60720277", "0.6067469", "0.60484666", "0.60461205", "0.60180914", "0.5997551", "0.59921885", "0.59746563", "0.5958629", "0.59585315", "0.59575355", "0.59507644", "0.59432954", "0.5940479", "0.5939526", "0.5931962", "0.5927508", "0.59252524", "0.5923063", "0.59221244", "0.59184974", "0.59116256", "0.58964634", "0.5894589", "0.587691", "0.5872903", "0.587071", "0.58654404", "0.5818413", "0.58049875", "0.5781852", "0.57772136", "0.5766541", "0.5760104", "0.5759141", "0.5758333", "0.5757682", "0.5755712", "0.57272434", "0.57211167", "0.5719223", "0.5718421", "0.5715911", "0.5711362", "0.57109535", "0.57052326", "0.5703144" ]
0.6893616
3
Plays the animation forwards and loops it.
loop() { this.looping = true; this.playing = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function animate() {\n if (PLAY_STATUS != PlayStatus.PLAYING) {\n return;\n } else {\n stepAndAnimate()\n }\n}", "function anim() {\r\n Loop();\r\n requestAnimFrame(anim);\r\n }", "play(){this.__stopped=!0;this.toggleAnimation()}", "function animationLoop() {\n\trequestAnimationFrame(animationLoop);\n\tcontrols.update();\n}", "function animloop(){\n\tdraw();\n\trequestAnimFrame(animloop);\n}", "function animLoop() {\n\t\t// Calculate the time since last call.\n\t\tvar curDate = Date.now();\n\t\ttimeSinceLastFrame = curDate - startDate;\n\t\tstartDate = curDate;\n\t\t//console.log(\"animLoop \" + timeSinceLastFrame);\n\t\t// Render. Scene return when it is up to date.\n\t\tvar sceneIsUpToDate = scene.render();\n\t\t// Restart render loop.\n\t\tif(! sceneIsUpToDate || running) {\n\t\t\trequestAnimFrame(animLoop);\n\t\t} else {\n\t\t\t// The scene is up-to-date.\n\t\t\t// Update the GUI.\n\t\t\tui.update();\n\t\t\trunning = false;\n\t\t\t//console.log(\"animLoop stoped running\");\t\t\t\n\t\t}\n\t}", "function startAnimationLoop() {\r\n animator.isPaused = false;\r\n\r\n if (!animator.isLooping) {\r\n animator.isLooping = true;\r\n window.hg.util.requestAnimationFrame(firstAnimationLoop);\r\n }\r\n\r\n // --- --- //\r\n\r\n /**\r\n * The time value provided by requestAnimationFrame appears to be the number of milliseconds since the page loaded.\r\n * However, the rest of the application logic expects time values relative to the Unix epoch. This bootstrapping\r\n * function helps in translating from the one time frame to the other.\r\n *\r\n * @param {Number} currentTime\r\n */\r\n function firstAnimationLoop(currentTime) {\r\n animator.previousTime = currentTime;\r\n\r\n window.hg.util.requestAnimationFrame(animationLoop);\r\n }\r\n }", "rewind() {\r\n\t\t\tthis.looping = false;\r\n\t\t\tthis.goToFrame(0);\r\n\t\t}", "function animloop() \n{\n\tdraw();\n\trequestAnimFrame(animloop);\n}", "function Start () { \r\n animation.wrapMode = WrapMode.Loop; \r\n animation.Stop(); \r\n Idle();\r\n}", "stateLoop () {\n const clip = this.clips.shift();\n\n if (clip !== undefined) {\n if (clip.loop) {\n // Eventually advance will be called\n this.play(clip);\n } else {\n // Call stateloop when the clip is done playing\n this.play(clip).then(() => {\n this.stateLoop();\n });\n }\n }\n }", "function loop() {\n draw();\n requestAnimFrame(loop);\n}", "play() {\n\t\tthis.animActions.forEach( action => action.play() );\n\t\tthis.isPlaying = true;\n\t}", "function animloop() {\n\tinit = requestAnimFrame(animloop);\n\tdraw();\n}", "_playAnimation() {\n if (this._animationLast === undefined && this._animationQueue.length > 0) {\n this._animationLast = this._animationCurrent;\n this._animationCurrent = this._animationQueue.shift();\n console.log(\"New: \" + this._animationCurrent.name);\n this._animationCurrent.runCount = 0;\n }\n this._serviceAnimation(this._animationCurrent, true);\n this._serviceAnimation(this._animationLast, false);\n if (this._animationLast && this._animationLast.cleanup) {\n this._animationLast.animation.stop();\n this._animationLast.animation = undefined;\n this._animationLast = undefined;\n }\n }", "play() {\n if (this.el) {\n this.el.style[this.__playState] = \"running\";\n this.el.$$animation.__playing = true;\n // in case the animation is based on JS\n if (this.i != undefined && qx.bom.element.AnimationJs) {\n qx.bom.element.AnimationJs.play(this);\n }\n }\n }", "function playAnimation(index, direction) {\n const label = direction ? labelAnimations.inLeft : labelAnimations.inRight;\n const sequence = direction ? sequences[index].inLeft : sequences[index].inRight;\n\n // play the label animation\n isAnimating = true;\n document.timeline.play(label);\n\n // get the planet animation and pause until fade out complete\n let planetAnim = document.timeline.play(sequence);\n setAnimation(planetAnim, index);\n \n // update range thumb color\n range.style.setProperty(`--planet-color`, planetColors[index]);\n \n // if another planet is already visible\n if (currentIndex) {\n // play the fade out animation\n const outSequence = direction ? sequences[currentIndex].outRight : sequences[currentIndex].outLeft;\n let outAnim = document.timeline.play(outSequence);\n\n // play the current animation, when the out animation is finished\n outAnim.onfinish = () => {\n currentAnimation.cancel();\n planetAnim.play()\n };\n } else {\n planetAnim.play()\n }\n}", "play() {\n this.frame = window.requestAnimationFrame(()=>this.firstFrame());\n }", "function myLoop() {\n setTimeout(function () {\n if (actionButton) {\n // // $(actionButton).css('opacity', '');\n // // $(actionButton).css('animation-play-state', 'paused');\n $(actionButton).removeClass('lightsOn');\n }\n actionButton = '#simonActionBtn' + (sequence[index]);\n // $(actionButton).css('animation-play-state', 'running');\n // $(actionButton).css('animation', '');\n $(actionButton).addClass('lightsOn');\n console.log('Sequence', index, sequence[index], actionButton);\n playSound(sequence[index]);\n index++;\n // TODO: I use an extra 'lap' to return opacity to standard value\n // after all values have been displayed. There's gotta be a more\n // elegant solution to this.\n if (index <= sequence.length) {\n\n myLoop();\n }\n }, 900);\n }", "function animloop() {\n init = requestAnimFrame(animloop);\n draw();\n}", "function run() {\n var i = 0, animation;\n\n // Check activeAnimations.length each iteration.\n for (; i < activeAnimations.length; i++) {\n // If an error occurs, continue the other animations,\n // abort only the one that raised the error.\n try {\n animation = activeAnimations[i];\n _playFrame(animation);\n } catch (ex) {\n // If an error occurs, abort the anim.\n if (animation) {\n animation.abort(ex);\n }\n }\n }\n }", "function animate() {\n oneStep();\n if( ! stopRequested ) {\n animationId = requestAnimationFrame(animate);\n }\n}", "function doPlayControl() {\r\n if (!animating) {\r\n animating = true;\r\n controls.enabled = true;\r\n if (animating) {\r\n doFrame();\r\n }\r\n }\r\n}", "function stepForward(){\n if(index === (playList.length - 1) ){\n index = 0\n }else{\n index++\n }\n box.innerHTML = `Track ${index + 1} - ${playList[index]}${ext}`;\n audio.src = dir + playList[index] + ext;\n audio.play()\n }", "function animationLoop() {\n\t\t//clear canvas\n\t\tcontext.clearRect(0, 0, WIDTH, HEIGHT);\n\n\t\t// update\n\t\tupdatePositions();\n\t\tcheckBallCollisions();\n\n\t\t// animate\n\t\twindow.requestAnimationFrame(animationLoop);\n\t}", "function goForward() {\n pauseSlideshow();\n isRandom = false;\n toggle_sequence.innerHTML = \"Sequential\";\n if (effect == 2) {\n slideSlide();\n } else {\n currentSlide++;\n if (currentSlide >= slides.length) {\n currentSlide = 0;\n }\n loadSlide();\n }\n }", "function loop(){\n\t\t\t\tupdate();\n\t\t\t\tif(playing) {\n\t\t\t\t\tdraw();\n\t\t\t\t\twindow.requestAnimationFrame(loop,canvas);\n\t\t\t\t}\n\t\t\t}", "function animate() {\r\n $('div#animation').fadeIn('slow');\r\n\t\tvar j;\r\n frame = (frame + dir + imageSum) % imageSum;\r\n j = frame+1;\r\n if(images[frame].complete) {\r\n $('div#animation').html('<img id=\"frame\" src=\"'+images[frame].src+'\" />');\r\n\t\t $('.label #playlabel').html('playing: ');\r\n\t\t $('.label #playstatus').html(j+' of '+imageSum);\r\n \r\n if(swingon && (j == imageSum || frame == 0)) {\r\n reverse();\r\n }\r\n \r\n timeout_id = setTimeout(function() {\r\n animate();\r\n }, delay);\r\n \r\n playing = 1;\r\n }\r\n }", "function animloop() {\n\tinit = window.requestAnimationFrame(animloop);\n\tdraw();\n}", "function step() {\n if(anim.pause) return true;\n anim.pause = anim.pause || anim.index === anim.dest;\n\n // Perform the update\n update(iters[anim.index]);\n ager_progress.value(anim.index);\n\n if(anim.pause) return true;\n\n // Advance to the next iteration\n anim.index += anim.fwd ? 1 : -1;\n anim.index %= iters.length;\n\n d3.timer(step);\n return true;\n} // step()", "function animationLoop(){\n requestAnimationFrame(animationLoop);\n controls.update();\n}", "function animationLoop(){\n // Clear screen for re-draw\n context.fillStyle = backgroundColor;\n context.fillRect(0,0,canvas[0].width,canvas[0].height);\n // ** UPDATE AND RENDER ** //\n\n // prepare for next frame\n if(!visualization.meta.isActive){\n return;\n }\n Utility.setDelta();\n window.requestAnimationFrame(animationLoop);\n }", "_continue() {\n let immediateStep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n animation_Animator.cancelFrame(this._nextFrame);\n this._nextFrame = null;\n if (immediateStep) return this._stepImmediate();\n if (this._paused) return this;\n this._nextFrame = animation_Animator.frame(this._step);\n return this;\n }", "function animationLoop() {\r\n\r\n\trequestAnimationFrame( animationLoop, canvas );\r\n\r\n\tsprite.x += sprite.speed;\r\n\tqsprite.x += qsprite.speed;\r\n\t//render the first sprite\r\n\trender(firstImage,secondImage,sprite,qsprite);\r\n\t\r\n\t\t\r\n}", "function start(){\n\tsetInterval(animationLoop, 33);\n}", "playAnimation() {\n for (var key in this.animations) {\n if (this.animations.hasOwnProperty(key)) {\n this.animations[key].setFinished(false);\n }\n }\n }", "function _play()\n {\n timeout_handle = requestAnimationFrame(function(timestamp) {\n update(timestamp);\n interpolate(timestamp);\n draw();\n \n if (currentIndexPosition == _fileLength()-1)\n {\n _pause();\n }\n _play();\n });\n }", "function Pause(){\n\t\tanimSpeed = 0;\n\t}", "function startAnimation() {\n if (!animating) {\n prevTime = Date.now();\n\t animating = true;\n prevMixerTime = Date.now();\n\t requestAnimationFrame(doFrame);\n\t}\n}", "_startLoop() {\n if (this._isRunning) { return; }; this._isRunning = true\n requestAnimationFrame(this._loop);\n }", "nextFrame() {\r\n\t\t\tif (this.frame < this.length - 1) this.frame = this.frame + 1;\r\n\t\t\telse if (this.looping) this.frame = 0;\r\n\r\n\t\t\tthis.targetFrame = -1;\r\n\t\t\tthis.playing = false;\r\n\t\t}", "animate() {\n clearTimeout(this.timeout);\n\n this.drawCurrentFrame();\n\n if (this.props.play && (this.props.frame + 1) < this.props.replay.turns.length) {\n this.props.incrementFrame();\n\n // if playing, render again\n clearTimeout(this.timeout);\n this.timeout = setTimeout(() => requestAnimationFrame(this.animate), TICK_SPEED);\n }\n }", "function fastForward() {\n target = this.classList[1] - 1;\n\n shownMedia[target].currentTime += 5;\n\n // If fast forward exceeds video length, goes back to beginning of video and pauses\n if(shownMedia[target].currentTime >= shownMedia[target].duration) {\n shownMedia[target].pause();\n shownMedia[target].currentTime = 0;\n playPauseBtn[target].textContent = 'Play';\n }\n }", "togglePlay() {\n if (this.paused) {\n this.animation = this.animate();\n } else {\n clearInterval(this.animation);\n }\n this.paused = !this.paused;\n }", "function play() {\n\t\t\n\t\t//this function (defined below) will continue to the next turn\n\t\tadvance();\n\t}", "function loop() {\n $('.bouncer').animate({'top': '30'}, {\n duration: 1000,\n complete: function() {\n $('.bouncer').animate({top: 0}, {\n duration: 1000,\n complete: loop});\n }});\n }", "function playSequence(i){\n\tif(i>=sequence.length||!hasStarted){\n\t\t$(\"#board div\").addClass(\"clickable\");\n\t\treturn;\t\t\t\n\t}\t\t\t\n\tplayTune(sequence[i]);\n\tsetTimeout(function(){playSequence(i+1)},800);\n}", "function play(){\n // restart if animation completed \n resampleAllCanvas();\n if(current>frames.length){\n current=cachedCurrent;\n }\n else if(current===frames.length){\n current = 0;\n cachedCurrent = 0;\n }\n globalAnimationId = requestAnimationFrame(nextImage);\n playButton.setAttribute('onclick','pause();');\n playButton.innerHTML = '<i class=\"fa fa-pause\"></i>';\n}", "stopAtLastFrame() {\n\t\tthis.animActions.forEach( action => action.play() );\n\t\tthis.animMixer.update( this.duration );\n\t\tthis.animMixer.stopAllAction();\n\t}", "play() {\n\t\tif (this._isActive && this._isPause) {\n\t\t\tthis.pause(false)\n\t\t} else {\n\t\t\tthis._isPause = false;\n\t\t\tthis._isActive = true;\n\n\t\t\tthis._age = 0;\n\t\t\tthis._zIndex = 0;\n\t\t\tthis.emission.reset();\n\n\t\t\tif (this.life.isLoop && this.life.isPrewarm) {\n\t\t\t\tconst step = 1 / 60;\n\t\t\t\tfor (let i = 0; i < this.life.duration; i += step) {\n\t\t\t\t\tthis.update(step);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function animationLoop(timeStamp){\n //7. Clears everything in canvas\n ctx.clearRect(0,0,canvas.width,canvas.height);\n drawBackground();\n walkingAnimation();\n changePositionX();\n changePositionY();\n changeTime();\n changeJump();\n //1-. Cal this function again (Repeat from step 6)\n requestId = requestAnimationFrame(animationLoop);\n\n // 9. Move Image\n}", "function animLoop(render) {\n var running, lastFrame = +new Date;\n root.requestAnimFrame = (function() {\n return root.requestAnimationFrame || root.webkitRequestAnimationFrame || root.mozRequestAnimationFrame || function(callback) {\n root.setTimeout(callback, 1000 / 60);\n };\n })();\n \n function loop(now) {\n if (running !== false) {\n requestAnimFrame(loop);\n running = render(now - lastFrame);\n lastFrame = now;\n }\n }\n loop(lastFrame);\n }", "animationLoop() {\n // increment animateUnit by a fraction each loop\n let delta = this.endUnit - this.startUnit;\n if (delta < 0) {\n delta = this.totalUnits + delta;\n }\n\n this.animateUnit += delta / this.framesPerSec;\n\n if (this.animateUnit >= this.totalUnits) {\n // wrap around from max to 0\n this.animateUnit = 0;\n }\n\n if (Math.floor(this.animateUnit) === this.endUnit) {\n // target reached, disable timer\n clearInterval(this.animationTimer);\n this.animationTimer = null;\n this.animateUnit = this.endUnit;\n this.startUnit = this.endUnit;\n }\n\n // redraw on each animation loop\n this.draw();\n }", "function syncAudioAnimation(){\n if (frame == 0) {\n actions[0].reset();\n actions[0].timeScale = 1.15;\n }\n\n if (frame == 42) {\n frame = 0;\n flapAudio.pause();\n flapAudio.currentTime = 0;\n flapAudio.play();\n } else {\n frame++;\n }\n }", "function animate(currentTimestamp) {\n\n // Repeat the loop WITHOUT animating if it hasn't been long enough yet.\n if (currentTimestamp < nextFrameTimestamp) {\n requestAnimationFrame(animate);\n return; // this ends the function, preventing the code below from running when it shouldn't\n }\n\n // If it HAS been long enough, update the time for the next animation frame and then animate stuff!\n nextFrameTimestamp = currentTimestamp + millisecondsBetweenFrames;\n\n // Clear the whole canvas between each animation frame\n pen.clearRect(0, 0, 2000, 2000);\n\n // Update the game state, drawing everything for the current animation frame as needed\n updateGame();\n\n // Repeat the animation loop forever (until we stop it)\n requestAnimationFrame(animate);\n}", "function fxMove() {\n const i = moveIndex % 3;\n move[i].play();\n moveIndex++;\n}", "loop() {\n if (document.hidden) { this.running = false }\n\n let now = Date.now(),\n delta = now - (this.lastRender || now)\n this.lastRender = now;\n\n if (this.running) {\n this.draw(delta)\n this.frames++\n }\n\n requestAnimationFrame(() => this.loop());\n\n // Display fps and position\n if (now - this.lastFps > 999) {\n this.fpsMeter.innerText = this.frames\n this.lastFps = now;\n this.frames = 0;\n }\n }", "function gameLoop() {\n game = requestAnimFrame (gameLoop);\n draw();\n update();\n}", "onFastForward(){\n var { player } = this.state;\n var intervalFunc = setInterval(function(){\n var currentTime = player.getCurrentTime();\n player.seekTo(currentTime + 5, true);\n }, 250);\n this.setState({\n goForward: intervalFunc\n })\n }", "function loopAnimationLeft() {\n $('.binary:even').css('right', '0px');\n $('.binary:even').animate({ right: '2000' }, 50000, 'linear', loopAnimationLeft);\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 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 _gameLoop() {\n _isLooping = true;\n\n // Get the timing of the current frame\n var currTime = Date.now();\n var deltaTime = currTime - _prevTime;\n\n // Check whether the game is unpaused\n if (!game.isPaused && !game.isEnded) {\n // Update the game state for the current frame\n _update(deltaTime);\n _draw();\n\n _myRequestAnimationFrame(_gameLoop);\n } else {\n _isLooping = false;\n }\n\n // Go to the next frame\n _prevTime = currTime;\n }", "function forward(){\n if(curFrame <= frames.length-1)\n drawCurFrame();\n}", "runAnimation() {\n const animate = () => {\n const duration = this.getAnimationDuration();\n setStyle(this.slider, 'transform', 'translateX(0%)');\n setStyle(this.slider, 'transition', `transform ${duration}ms linear`);\n setStyle(this.slider, 'transform', 'translateX(-100%)');\n\n this.animationTimer = setTimeout(() => {\n this.stopAnimation();\n requestAnimationFrame(() => animate());\n }, duration / 2);\n };\n\n animate();\n }", "slideLoop() {\n\t\tthis.animation = setTimeout( () => {\n\t\t\tif (this.i < this.indexSlide) {\n \tthis.i++;\n }\n else {\n \tthis.i = 0;\n };\n this.changeSlide();\n this.slideLoop();\n this.launchprogressbar();\n }, this.timeout); // toutes les 5 secondes\n }", "updateAnimation() {\n if (this.isMoving()) {\n if (this.dirX == -1)\n this.animator.changeFrameSet(this.frameSets[\"swim-left\"],\n \"loop\", 5);\n else\n this.animator.changeFrameSet(this.frameSets[\"swim-right\"],\n \"loop\", 5);\n } else {\n if (this.dirX == -1)\n this.animator.changeFrameSet(this.frameSets[\"idle-left\"],\n \"pause\");\n else\n this.animator.changeFrameSet(this.frameSets[\"idle-right\"],\n \"pause\");\n }\n \n this.animator.animate();\n }", "animate() {\n if (this.tick % 10 != 0)\n return;\n this.tick = 0;\n if (this.index < this.images.length - 1) \n this.index += 1;\n else\n this.index = 0;\n }", "function playBGM() {\n BGM.loop = true;\n BGM.play();\n }", "function trigger_animation() {\n\t\t\tvar $this = $('#slide-num' + brick.to + ' a');\n\t\t\t\n\t\t\t$num.removeClass('slide-on');\n\t\t\t$this.addClass('slide-on');\n\t\t\t\n\t\t\tgotohere = -((brick.to - 1) * 1024);\n\t\t\t\n\t\t\t$scrollable.stop().animate({\n\t\t\t\tleft: gotohere},\n\t\t\t\t1000,\n\t\t\t\tfunction(){\n\t\t\t\t\tif (!$('#swf-' + brick.from).hasClass('image-loaded')) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t//var image = $('<img>').attr('src', brick.images[function_objs.lang][brick.from]);\n\t\t\t\t\t\tvar useimage = '<img src=\"' + brick.images[function_objs.lang][brick.from] + '\" alt=\"\" />'\n\t\t\t\t\t\t//console.log(useimage);\n\t\t\t\t\t\t$('#swf-' + brick.from)\n\t\t\t\t\t\t\t.parent()\n\t\t\t\t\t\t\t.addClass('image-loaded')\n\t\t\t\t\t\t\t.attr('id','swf-' + brick.from)\n\t\t\t\t\t\t\t.innerHTML = useimage;\n\t\t\t\t\t\t\t//.html(useimage);\n\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (!$('#swf-' + brick.to).hasClass('image-loaded')) {\n\t\t\t\t\t\t//call function to start flash animation\n\t\t\t\t\t\tvar swf = document.getElementById(\"swf-\" + brick.to);\n\t\t\t\t\t\tswf.replay();\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tbrick.from = brick.to;\t\t\t\t\t\n\t\t\t\t}\n\t\t\t);\n\t\t}", "function step() {\r\n\t\tvar j;\r\n\t\tif(timeout_id) {\r\n\t\t clearTimeout(timeout_id);\r\n\t\t timeout_id = null;\r\n\t\t}\r\n\t\tframe = (frame + dir + imageSum) % imageSum;\r\n\t\tj = frame + 1;\r\n\t\t\r\n\t\tif(images[frame].complete) {\r\n\t\t $('div#animation').html('<img src=\"'+images[frame].src+'\" />');\r\n\t\t $('.label #playlabel').html('step: ');\r\n\t\t $('.label #playstatus').html(j+' of '+imageSum);\r\n\t\t \r\n\t\t if(swingon && (j == imageSum || frame == 0)) {\r\n\t\t\treverse();\r\n\t\t }\r\n\t\t \r\n\t\t playing = 0;\r\n\t\t}\r\n\t }", "re_animate_ghost() {\r\n\r\n this.sprite.status = this.statusEnum.ALIVE;\r\n this.set_animation_frame(0, 0);\r\n this.animate_start();\r\n \r\n }", "run() {\n\t\tif(this.element.style.webkitAnimationPlayState !== 'running'){\n\t\t\tthis.element.style.webkitAnimationPlayState = 'running';\n\t\t\tthis.startTime = (new Date()).getTime();\n\t\t}\n\t}", "restartAnimation() {\n for (var key in this.animations) {\n if (this.animations.hasOwnProperty(key)) {\n this.animations[key].setFinished(false);\n this.animations[key].reset();\n }\n }\n }", "function resumeAnimation() {\n startAnimation()\n}", "function animate()\n{\n\tvar time = new Date().getTime();\n\tvar draw = 0;\n\tplayback(time);\n\tif( time - lastTime >= 2 )\n\t{\n\t\tdraw = 1;\n\t\tlastTime = time;\n\t\tclearCanvas();\n\t\tstaticCircles.drawStatic(time);\n\t}\n\telse\n\t{\n\t\tdraw = 0;\n\t}\n\tnew_song.play(time, draw);\n\tdisplayMetronome();\n}", "function loopStep(swapAnimations, swapAnimationsIdx) {\n let currentAnimation = swapAnimations[swapAnimationsIdx];\n playAnimations(currentAnimation, swapAnimationsIdx);\n}", "function advanceFrame() {\n\n //Advance the frame if `frameCounter` is less than \n //the state's total frames\n if (frameCounter < numberOfFrames + 1) {\n\n //Advance the frame\n sprite.gotoAndStop(sprite.currentFrame + 1);\n\n //Update the frame counter\n frameCounter += 1;\n\n //If we've reached the last frame and `loop`\n //is `true`, then start from the first frame again\n } else {\n if (sprite.loop) {\n sprite.gotoAndStop(startFrame);\n frameCounter = 1;\n }\n }\n }", "function step() {\n redraw.stepAnimation();\n }", "function step() {\n redraw.stepAnimation();\n }", "_loop() {\n if (!this._isRunning) { return false; }\n this._update(window.performance.now());\n if (!this.tweens.length) { return this._isRunning = false; }\n requestAnimationFrame(this._loop);\n return this;\n }", "play() {\n\t\t\t\tthis.playing = true;\n\t\t\t\tthis.targetFrame = -1;\n\t\t\t}", "function playAnimation(sequenceArray) {\n\n //Reset any possible previous animations\n reset();\n\n //Figure out how many frames there are in the range\n if (!sequenceArray) {\n startFrame = 0;\n endFrame = sprite.totalFrames - 1;\n } else {\n startFrame = sequenceArray[0];\n endFrame = sequenceArray[1];\n }\n\n //Calculate the number of frames\n numberOfFrames = endFrame - startFrame;\n\n //Compensate for two edge cases:\n //1. If the `startFrame` happens to be `0`\n /*\n if (startFrame === 0) {\n numberOfFrames += 1;\n frameCounter += 1;\n }\n */\n\n //2. If only a two-frame sequence was provided\n /*\n if(numberOfFrames === 1) {\n numberOfFrames = 2;\n frameCounter += 1;\n } \n */\n\n //Calculate the frame rate. Set the default fps to 12\n if (!sprite.fps) sprite.fps = 12;\n let frameRate = 1000 / sprite.fps;\n\n //Set the sprite to the starting frame\n sprite.gotoAndStop(startFrame);\n\n //Set the `frameCounter` to the first frame \n frameCounter = 1;\n\n //If the state isn't already `playing`, start it\n if (!sprite.animating) {\n timerInterval = setInterval(advanceFrame.bind(this), frameRate);\n sprite.animating = true;\n }\n }", "function handleForward(){\n audio.currentTime += 3;\n if(audio.currentTime >= audio.duration || audio.paused){\n audio.pause();\n audio.currentTime = 0;\n player.innerHTML = hdlPlay\n }\n }", "noLoop() {\r\n\t\t\tthis.looping = false;\r\n\t\t}", "function stepBackward(){\n if(index === 0){\n index = playList.length - 1\n }else{\n index--\n }\n\n box.innerHTML = `Track ${index + 1} - ${playList[index]}${ext}`;\n audio.src = dir + playList[index] + ext;\n audio.play()\n }", "play(x, y) {\n this.reset();\n this._engine.playAnimation(this, x, y);\n }", "function animloopTouched(){\n if(touched){\n //scrollAnim();\n makeHistory();\n ganttAnim();\n scrollbarAnim();\n count ++;\n requestAnimFrame(animloopTouched);\n }\n else{\n animloopUntouched();\n }\n }", "animate(){\n if (this.timeFromLast > this.animationTime){\n this.currentFrameNum++;\n this.currentFrameX += this.frameWidth;\n this.timeFromLast = 0;\n this.timeUntilLast = millis();\n }\n \n if (this.currentFrameNum > this.maxFrame){\n this.currentFrameNum = 3;\n this.currentFrameX = 22;\n }\n \n }", "function loop() {\n game.clearScreen();\n game.step();\n game.drawScreen();\n game.updateDebugger();\n window.requestAnimationFrame(loop);\n }", "cycle() { this._pause$.next(false); }", "function play () {\n if (autoplay && !animating) {\n startAutoplay();\n autoplayUserPaused = false;\n }\n }", "function startAnimation() {\n waited += new Date().getTime() - stopTime\n stopAnim = false;\n Animation();\n}", "start() {\n this._enableAnimation = true;\n this._numberOfAnimationCycles = 0;\n }", "function pause() {\n if (playIndex) {\n cancelAnimationFrame(playIndex);\n }\n}", "function loop() {\n\n game.update();\n game.draw();\n\n //Does not allow the player to go out of bounds.\n if (game.player.x < 0)\n game.restart();\n\n //Goal position\n if (game.trackPosition > game.finishline && !game.finish) {\n game.goal();\n }\n\n // Does not allow reverse driving\n if (game.speed < 0) {\n game.speed = 0;\n }\n //Upper limit for player\n if (game.player.y < -10) {\n game.player.y = 0\n }\n\n //upper limit for ai\n if (game.aiPlayers.y < -10) {\n game.aiPlayer.y = 0\n }\n\n //Time counter\n game.frameNumber += 1;\n\n\n // can't make this one work inside a class/function object\n requestAnimationFrame(loop);\n}", "function loop() {\n draw();\n update();\n frames++;\n requestAnimationFrame(loop);\n}", "function animateRestart() {\n animation1.restart();\n animation2.restart();\n animation3.restart();\n animation4.restart();\n}", "function loop()\n{\n requestAnimationFrame(loop);\n \n clearScreen();\n \n let state = currentState;\n \n if(state)\n {\n if(state.update)\n state.update();\n \n if(state.draw)\n state.draw();\n }\n}", "function animationGoForward()\n{\n\tif(eventSliderOb != null)\n\t{\n\t\teventSliderOb.moveSliderForward();\n\t}\n}" ]
[ "0.722313", "0.7166568", "0.7005895", "0.698627", "0.695377", "0.692371", "0.6906607", "0.6900058", "0.6893759", "0.68574816", "0.6846399", "0.6833086", "0.6811631", "0.67335105", "0.67173463", "0.67035335", "0.6629723", "0.6599515", "0.6592861", "0.6589526", "0.65759677", "0.6574346", "0.6527623", "0.65229684", "0.65088403", "0.64939266", "0.6472146", "0.647032", "0.64634824", "0.6457043", "0.64185566", "0.64181554", "0.6409591", "0.6409254", "0.6399436", "0.63988274", "0.63825965", "0.63660216", "0.6364507", "0.6354156", "0.63523567", "0.6351905", "0.628112", "0.62725604", "0.6251141", "0.62436265", "0.6239785", "0.62345326", "0.62250865", "0.6202627", "0.6199079", "0.61930984", "0.6180924", "0.61761975", "0.6173527", "0.61669344", "0.6164979", "0.61627364", "0.61536646", "0.6152959", "0.6152331", "0.6152331", "0.61508083", "0.6150027", "0.6145824", "0.6130947", "0.6127013", "0.612665", "0.6115455", "0.61124295", "0.61111", "0.60935324", "0.6085707", "0.6084121", "0.60839", "0.6080347", "0.6079612", "0.60795504", "0.60789186", "0.60789186", "0.60743326", "0.60709536", "0.6065106", "0.6063626", "0.60571706", "0.605605", "0.60473263", "0.6037052", "0.6035067", "0.60345006", "0.6034498", "0.6028197", "0.6026279", "0.6025044", "0.6020449", "0.6016492", "0.60031325", "0.60008", "0.60006696", "0.59973365" ]
0.6896506
8
Prevents the animation from looping
noLoop() { this.looping = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "stop() {\n this._enableAnimation = false;\n }", "function stop() {\r\n animating = false;\r\n }", "stop() {\n this.renderer.setAnimationLoop(null);\n }", "animate_stop() {\r\n this.sprite.animate = false;\r\n }", "stop(){this.__stopped=!1;this.toggleAnimation()}", "stopDrawing() {\n this.updateAnimation = false;\n }", "function Start () { \r\n animation.wrapMode = WrapMode.Loop; \r\n animation.Stop(); \r\n Idle();\r\n}", "function stop() {\n\n\t\ttry {\n\t\t // Pass in the movement to the game.\n\t\t animation.move(\"x\", moveTypes.none);\n\t\t}\n\t\tcatch (err) {\n\t\t\tconsole.log(err);\n\t\t}\n\t}", "function OnDisable()\n\t{\n\t\t//Stop the animation coroutine, and disable the animation\n\t\tStopCoroutine(\"Animate\");\n\t\tcanAnimate = false;\n\t}", "function stopanimate() {\r\n window.cancelAnimationFrame(request)\r\n }", "if (m_bInitialAnim) { return; }", "stop() {\n window.cancelAnimationFrame(this.loopID);\n }", "play(){this.__stopped=!0;this.toggleAnimation()}", "function resumeAnimation() {\n startAnimation()\n}", "function stopAnimation () {\r\n on = false; // Animation abgeschaltet\r\n clearInterval(timer); // Timer deaktivieren\r\n }", "function stopAnimation() {\n reset();\n sprite.gotoAndStop(sprite.currentFrame);\n }", "function stopAnimation () {\n on = false; // Animation abgeschaltet\n clearInterval(timer); // Timer deaktivieren\n }", "function stopAnimation () {\n on = false; // Animation abgeschaltet\n clearInterval(timer); // Timer deaktivieren\n }", "function stopAnimation () {\n on = false; // Animation abgeschaltet\n clearInterval(timer); // Timer deaktivieren\n }", "function anim() {\r\n Loop();\r\n requestAnimFrame(anim);\r\n }", "function disableInteraction() {\n moving = true;\n setTimeout(function () {\n moving = false;\n }, 500);\n }", "updateAnimation() {\n return;\n }", "pause() {\n this._enableAnimation = !this._enableAnimation;\n }", "function setEndAnimation() {\r\n\t\t\tinAnimation = false;\r\n\t\t}", "function stopAnimation(){\n\t\ttile = toTile;\n\t\tPos = toPos;\n\t\tvelocity = 0;\n\t\tAnimation.moving = false;\n\t}", "stop() {\n if (this._animationFrame) {\n cancelAnimationFrame(this._animationFrame);\n }\n }", "stopAnimation() {\r\n this.anims.stop();\r\n\r\n //Stop walk sound\r\n this.walk.stop();\r\n }", "function allowAnimationSkip() {\n\tconst waitDuration = reducedAnimations ? reducedCardDisplayDuration : maxCardDisplayDuration - minCardDisplayDuration;\n\twaitingThread = setTimeout(startCardAnimation, waitDuration);\n}", "stopAnimation() {\n setStyle(this.slider, 'transition', '', true);\n setStyle(this.slider, 'transform', 'translateX(0%)', true);\n }", "function stopAnimation() {\n cancelAnimationFrame(animationID)\n}", "function animation_stop() {\n if (animationState.mode && animationState.mode !== 'stop') {\n if (animationState.raf) {\n window.cancelAnimationFrame(animationState.raf);\n animationState.raf = null;\n }\n reset_styles();\n animationState.position = null;\n animationState.mode = 'stop';\n }\n }", "stop() {\n cancelAnimationFrame(this.frameId)\n }", "stop() {\n if (\n this.el &&\n qx.core.Environment.get(\"css.animation\") &&\n !this.jsAnimation\n ) {\n this.el.style[this.__playState] = \"\";\n this.el.style[qx.core.Environment.get(\"css.animation\").name] = \"\";\n this.el.$$animation.__playing = false;\n this.el.$$animation.__ended = true;\n }\n // in case the animation is based on JS\n else if (this.jsAnimation) {\n this.stopped = true;\n qx.bom.element.AnimationJs.stop(this);\n }\n }", "function animate() {\r\n if (!doAnim) {\r\n river.context=null; \r\n return;\r\n }\r\n\trequestAnimFrame( animate );\r\n river.background.draw();\r\n}", "isAnimating() {\n return animationFrame > 1;\n }", "function animate() {\n if (PLAY_STATUS != PlayStatus.PLAYING) {\n return;\n } else {\n stepAndAnimate()\n }\n}", "function resetRuning(){\r\n Joey.changeAnimation(\"running\",Running_Joey);\r\n \r\n}", "re_animate_ghost() {\r\n\r\n this.sprite.status = this.statusEnum.ALIVE;\r\n this.set_animation_frame(0, 0);\r\n this.animate_start();\r\n \r\n }", "function animationEffect() {\n marker.setAnimation(window.google.maps.Animation.BOUNCE)\n setTimeout(function(){ marker.setAnimation(null) }, 550)\n }", "playAnimation() {\n for (var key in this.animations) {\n if (this.animations.hasOwnProperty(key)) {\n this.animations[key].setFinished(false);\n }\n }\n }", "function onAnimationEnd() {\n // stop the last frame from being missed..\n rec.stop();\n }", "function startAnimation() {\n waited += new Date().getTime() - stopTime\n stopAnim = false;\n Animation();\n}", "restartAnimation() {\n for (var key in this.animations) {\n if (this.animations.hasOwnProperty(key)) {\n this.animations[key].setFinished(false);\n this.animations[key].reset();\n }\n }\n }", "function animationLost() {\n\t\tconsole.log(\"he perdido\");\t\n\tposX2=hasta;\t\nhasta=hasta-60;\nposX=posX-60;\n\t\t// Start the animation.\n\t\trequestID2 = requestAnimationFrame(animate2);\n\t}", "function stop_dog_poop() {\n cancelAnimationFrame(anim_id);\n $('#restart').slideDown();\n }", "stop() {\n clearInterval(this.animation);\n this.canvas.clear();\n }", "idle() {\n this._idle = true;\n this._animation.stop();\n this.emit('clear');\n this.emit('idle');\n }", "function stop() {\n cancelAnimationFrame(frameId);\n }", "function stopAnimation() {\n for (var i = 0; i < self.markerArray().length; i++) {\n self.markerArray()[i][1].setAnimation(null);\n }\n}", "function animloopTouched(){\n if(touched){\n //scrollAnim();\n makeHistory();\n ganttAnim();\n scrollbarAnim();\n count ++;\n requestAnimFrame(animloopTouched);\n }\n else{\n animloopUntouched();\n }\n }", "_disableAnimation() {\n this.isAnimatable = false;\n toggleClass(this.navEl, 'no-animation', !this.isAnimatable);\n }", "handleAnimationEnd() {\n this.setState({ triggerEnabled: false });\n }", "start() {\n this._enableAnimation = true;\n this._numberOfAnimationCycles = 0;\n }", "function stop () {\n window.clearInterval(animationInt);\n }", "_resetAnimation() {\n // @breaking-change 8.0.0 Combine with _startAnimation.\n this._panelAnimationState = 'void';\n }", "function Pause(){\n\t\tanimSpeed = 0;\n\t}", "function stopAnimation(){\n setTimeout(function(){\n document.getElementById(\"dado\").classList.remove(\"animation\");\n }, 3500);\n }", "function restartAnimation() {\n setup();\n let range = document.getElementById('range');\n elementsLength = parseInt(range.max);\n value = parseInt(range.value);\n min = 0;\n focus = 0;\n frames = 0;\n}", "playerWalkAnimStop() {\n this.isWalking = false;\n if (this.anims) {\n this.anims.stop();\n } \n }", "stopAtLastFrame() {\n\t\tthis.animActions.forEach( action => action.play() );\n\t\tthis.animMixer.update( this.duration );\n\t\tthis.animMixer.stopAllAction();\n\t}", "disable() {\n this._disabled = true;\n this._animation.stop();\n this.emit('clear');\n }", "function animation_pause() {\n if (animationState.mode && animationState.mode !== 'pause' && animationState.mode !== 'stop') {\n if (animationState.raf) {\n window.cancelAnimationFrame(animationState.raf);\n animationState.raf = null;\n }\n animationState.mode = 'pause';\n }\n }", "animateNoFire1() {\r\n this.p1StreakLvl = 0;\r\n }", "function skip() {\n game.cutScene.style.display = 'none';\n game.soundInstance.stop();\n // TODO: stop and unload cut scene animation\n}", "function restartAnimation() {\n cancelAnimationFrame(animationID)\n init();\n}", "_stopLoop() { this._isRunning = false; }", "function stopAnimation(){\r\n for(var i=0; i<self.markerArray().length; i++){\r\n self.markerArray()[i][1].setAnimation(null);\r\n\tself.markerArray()[i][1].setIcon(defaultIcon);\r\n }\r\n}", "animate(){\n if (this.timeFromLast > this.animationTime){\n this.currentFrameNum++;\n this.currentFrameX += this.frameWidth;\n this.timeFromLast = 0;\n this.timeUntilLast = millis();\n }\n \n //change to stationary after hadouken is used\n if (this.state === \"hadouken\" && this.currentFrameNum > this.maxFrame) this.stationaryState();\n\n //resetting the animation after the ninth frame\n if (this.currentFrameNum > this.maxFrame){ \n this.currentFrameX = 0;\n this.currentFrameNum = 0;\n\n //changed to stationary if the user has let go of a movement key\n if (this.willStop === true) this.stationaryState();\n\n this.timeFromLast = 0;\n this.timeUntilLast = millis();\n\n }\n\n \n \n\n }", "function stopCurrentAnimation() {\n cancelAnimationFrame(nextAnimationFrame);\n nextAnimationFrame = 0;\n clearTimeout(nextTimeout);\n nextTimeout = 0;\n}", "function reset_animations(){\n if(active != \"idee\"){tl_idee.restart();\n tl_idee.pause();}\n if(active != \"reunion\"){tl_reunion.restart();\n tl_reunion.pause();}\n if(active != \"travail\"){tl_travail.restart();\n tl_travail.pause();}\n if(active != \"deploiement\"){tl_depl.restart();\n tl_depl.pause();}\n }", "preventTransitions() {\n const now = Date.now;\n Date.now = () => Infinity;\n d3.timer.flush();\n Date.now = now;\n }", "function animate() {\n oneStep();\n if( ! stopRequested ) {\n animationId = requestAnimationFrame(animate);\n }\n}", "cancelFrame() {\n cancelAnimationFrame(this.frame.count);\n }", "cancelFrame() {\n cancelAnimationFrame(this.frame.count);\n }", "pauseAnimation() {\n if (this.animationTimer) clearTimeout(this.animationTimer);\n const style = this.slider.currentStyle || window.getComputedStyle(this.slider);\n setStyle(this.slider, 'transform', style.transform);\n setStyle(this.slider, 'transition', '', true);\n }", "runAnimation() {\n const animate = () => {\n const duration = this.getAnimationDuration();\n setStyle(this.slider, 'transform', 'translateX(0%)');\n setStyle(this.slider, 'transition', `transform ${duration}ms linear`);\n setStyle(this.slider, 'transform', 'translateX(-100%)');\n\n this.animationTimer = setTimeout(() => {\n this.stopAnimation();\n requestAnimationFrame(() => animate());\n }, duration / 2);\n };\n\n animate();\n }", "preventMove() {\n this.currentMovePrevented = true;\n }", "animateWeapon() {\n //Do animation then set shooting to false here\n shooting_3D = false;\n }", "function stopAnimate() {\n clearInterval(tID);\n} //end of stopAnimate()", "reset() {\n\n this.isFiring = false;\n this.anims.pause();\n this.body.setVelocity(0, 0);\n this.y = 431;\n }", "stop() {\n this.isStopped = true;\n cancelAnimationFrame(rAF);\n }", "function animloop(){\n\tdraw();\n\trequestAnimFrame(animloop);\n}", "function delayAnimation () {\n animatedEl.className = 'animated';\n setTimeout(function () {\n animatedEl.className = 'animated'\n setTimeout(delayAnimation, 2400);\n }, 500)\n }", "dropAnimation() {\n if (typeof (this.timer) != 'undefined') clearTimeout(this.timer);\n this.timer = setTimeout(this.stopAnimation.bind(this), 350);\n }", "animation() {}", "function setLoopStop () {\n\t\tTweenLite.killDelayedCallsTo(loopStop);\n\t\tTweenLite.delayedCall(30, loopStop);\n\t}", "function animloop() \n{\n\tdraw();\n\trequestAnimFrame(animloop);\n}", "function removeAnimation(){\n\t\tsetTimeout(function() {\n\t\t\t$('.bubble').removeClass('animating')\n\t\t}, 1000);\t\t\t\n\t}", "function crash(){\n\t\t$(\".mach\")\n\t\t.animate({opacity: 0.5},200)\n\t\t.animate({opacity: 1},200)\n\t\t.animate({opacity: 0.5},200)\n\t\t.animate({opacity: 1},200)\n\t\t.animate({opacity: 0.5},200);\n\t\tsetTimeout(romper, 1000);\n\n\t}", "function animateRestart() {\n animation1.restart();\n animation2.restart();\n animation3.restart();\n animation4.restart();\n}", "function restart(){\n animate_ca();\n }", "function doStopControl() {\r\n if (animating) {\r\n animating = false;\r\n controls.enabled = false;\r\n }\r\n}", "function animLoop() {\n\t\t// Calculate the time since last call.\n\t\tvar curDate = Date.now();\n\t\ttimeSinceLastFrame = curDate - startDate;\n\t\tstartDate = curDate;\n\t\t//console.log(\"animLoop \" + timeSinceLastFrame);\n\t\t// Render. Scene return when it is up to date.\n\t\tvar sceneIsUpToDate = scene.render();\n\t\t// Restart render loop.\n\t\tif(! sceneIsUpToDate || running) {\n\t\t\trequestAnimFrame(animLoop);\n\t\t} else {\n\t\t\t// The scene is up-to-date.\n\t\t\t// Update the GUI.\n\t\t\tui.update();\n\t\t\trunning = false;\n\t\t\t//console.log(\"animLoop stoped running\");\t\t\t\n\t\t}\n\t}", "function _pause()\n {\n cancelAnimationFrame(timeout_handle);\n }", "function stopSpinning() {\n\tlargeImage.style.transform = \"none\";\n}", "function stopAnimate() {\r\n clearInterval(tID);\r\n} //end of stopAnimate()", "function resetAnimationState() {\n animationState = {\n time: 0,\n ballHeight: guiParams.maxBallHeight, // fall from maximum height\n ballPositionX: guiParams.ballInitialX, // reset to initial X position\n };\n}", "cycle() { this._pause$.next(false); }", "_enableAnimation() {\n this.isAnimatable = true;\n toggleClass(this.navEl, 'no-animation', !this.isAnimatable);\n }", "animate () {\n this.x -= this.speed * 5;\n if (this.x < -this.groundImage.width) \n this.x = 0;\n }" ]
[ "0.7715218", "0.77071416", "0.76263696", "0.7431299", "0.736073", "0.73198", "0.7312543", "0.72387207", "0.7229728", "0.72188836", "0.70974183", "0.7068261", "0.70324355", "0.7025615", "0.7012021", "0.70109195", "0.70048773", "0.70048773", "0.70048773", "0.69861346", "0.69726014", "0.6967743", "0.69633037", "0.69260734", "0.6906506", "0.6886027", "0.6869193", "0.6843972", "0.68339604", "0.6820365", "0.68023866", "0.6779417", "0.67686987", "0.67588544", "0.67493963", "0.6746193", "0.67295104", "0.6726462", "0.6707652", "0.66996443", "0.6661729", "0.665735", "0.66570586", "0.6648827", "0.66466063", "0.66404325", "0.6623047", "0.6602189", "0.6569973", "0.6549003", "0.6545142", "0.65436155", "0.65389556", "0.6519387", "0.65190244", "0.6518978", "0.65023285", "0.6496895", "0.6487006", "0.6479598", "0.64795613", "0.6473347", "0.64521533", "0.6448731", "0.64462703", "0.6440081", "0.6415353", "0.6406914", "0.64062315", "0.6406048", "0.64030105", "0.64015496", "0.63879126", "0.63879126", "0.63828146", "0.6379897", "0.6378743", "0.6362314", "0.636209", "0.6356006", "0.63531286", "0.6344464", "0.63334763", "0.6330711", "0.6319615", "0.6313746", "0.63087606", "0.62902135", "0.62901676", "0.6288977", "0.6277312", "0.62687165", "0.6267154", "0.6266244", "0.623492", "0.6229503", "0.62294346", "0.6217498", "0.6212019", "0.6211305" ]
0.72637546
7
Goes to the next frame and stops.
nextFrame() { if (this.frame < this.length - 1) this.frame = this.frame + 1; else if (this.looping) this.frame = 0; this.targetFrame = -1; this.playing = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "gotoNextFrame() {\n // Loop back to beginning if gotoNextFrame goes past the last frame\n var nextFramePlayheadPosition = this.playheadPosition + 1;\n\n if (nextFramePlayheadPosition > this.length) {\n nextFramePlayheadPosition = 1;\n }\n\n this.gotoFrame(nextFramePlayheadPosition);\n }", "function nextFrame() {\n _timeController.proposeNextFrame();\n }", "nextFrame(){\n this.currentFrame++;\n \n if(this.currentFrame >= 5){\n this.currentFrame = 0;\n }\n \n this.setFrame(this.currentFrame);\n }", "gotoNextFrame() {\n this.timeline.gotoNextFrame();\n }", "gotoNextFrame() {\n this.scriptOwner.parentClip.gotoNextFrame();\n }", "nextFrame() {\n this.updateParticles();\n this.displayMeasurementTexts(this.stepNo);\n this.stepNo++;\n\n if (this.stepNo < this.history.length - 1) {\n // Set timeout only if playing\n if (this.playing) {\n this.currentTimeout = window.setTimeout(\n this.nextFrame.bind(this),\n this.animationStepDuration\n );\n }\n } else {\n this.finish();\n }\n }", "nextFrame() {\n\t\t\t\tif (this.frame < this.images.length - 1) this.frame = this.frame + 1;\n\t\t\t\telse if (this.looping) this.frame = 0;\n\n\t\t\t\tthis.targetFrame = -1;\n\t\t\t\tthis.playing = false;\n\t\t\t}", "function nextFrame() {\r\n if (rot.inProgress) {\r\n advanceRotation();\r\n } else {\r\n if (mouse.down)\r\n nextFrameWithMouseDown();\r\n else\r\n nextFrameWithMouseUp();\r\n }\r\n }", "function nextFrame () {\n mainLoop(gameState, keyMovement, mouseMovement)\n }", "function nextFrame(){\n // Protecting upper bounds\n if (frame === 7781){\n console.log('End of Frames')\n return\n }\n setFrame(frame + 1)\n console.log('Next Frame')\n playerRef.current.seekTo(frame / 60)\n console.log(frame)\n console.log(frame / 60)\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 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 forward(){\n if(curFrame <= frames.length-1)\n drawCurFrame();\n}", "function drawNextFrame() {\n\tdrawNext = true;\n}", "function advanceFrame() {\n\n //Advance the frame if `frameCounter` is less than \n //the state's total frames\n if (frameCounter < numberOfFrames + 1) {\n\n //Advance the frame\n sprite.gotoAndStop(sprite.currentFrame + 1);\n\n //Update the frame counter\n frameCounter += 1;\n\n //If we've reached the last frame and `loop`\n //is `true`, then start from the first frame again\n } else {\n if (sprite.loop) {\n sprite.gotoAndStop(startFrame);\n frameCounter = 1;\n }\n }\n }", "function playNextFrame() {\n if (currentFrame >= frames.length) {\n currentFrame = 0;\n }\n\n renderFrames();\n\n var frame = frames[currentFrame];\n for (var i = 0; i < frame.length; i++) {\n if (frame[i] >= threshValue) {\n playSound(i);\n\n if (playFirstNote) {\n break;\n }\n }\n }\n\n currentFrame++;\n}", "getNextFrame() {\nvar f;\nf = this.fCur + 1;\nif (this.fCount <= f) {\nf = 0;\n}\nreturn this.setFrameAt(f);\n}", "function next(){\n\t\t\t\t\t//check for end\n\t\t\t\t\tif( PC < 0 || PC >= tokens.length ) {\n\t\t\t\t\t\tif(com.timeout){\n\t\t\t\t\t\t\tclearTimeout(com.timeout);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//update the current PC\n\t\t\t\t\tif(PCArray.length > 0){\n\t\t\t\t\t\t$(tokens[PCArray[PCArray.length-1]]).removeClass(cls.currentToken);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$(tokens[PC]).addClass(cls.currentToken);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//update the state for reversibility\n\t\t\t\t\tPCArray.push( PC );\n\t\t\t\t\tFPArray.push ( framepointer );\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//did we do a valid jump? \n\t\t\t\t\tif(typeof com.self[a[PC]] != 'function'){\n\t\t\t\t\t\talert(\"Runtime error: Attempted to jump to numerical token. \");\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//execute command\n\t\t\t\t\tif( !com.self[a[PC]](a[PC+1], a[PC+2], a) ) {\n\t\t\t\t\t //halted\n\t\t\t\t\t return false;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//redraw stuff\n\t\t\t\t\tcom.sse.evolution.append(\n\t\t\t\t\t\tcom.stack.print(com.stack.getValues(), framepointer)\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t//update the displays\n\t\t\t\t\t$(\"#\"+ids.ssePosition).text(PC);\n\t\t\t\t\t$(\"#\"+ids.FPPosition).text(framepointer);\n\t\t\t\t\t\n\t\t\t\t\treturn true;\n\t\t\t\t}", "function nextFrame() {\n // The value was found\n if (focus === value) {\n // Gray out all elements\n min = elementsLength;\n playing = false;\n focus--;\n }\n min++;\n focus++;\n}", "rewind() {\r\n\t\t\tthis.looping = false;\r\n\t\t\tthis.goToFrame(0);\r\n\t\t}", "function next() {\n var c;\n\n if (c = msg.shift()) {\n matrix.draw(c);\n setTimeout(next, 400);\n }\n }", "function next() {\n\t\t\tgoToImage((curImage+1 > numImages-1 ? 0 : curImage+1), next, true);\n\t\t}", "function next() {\n var c;\n\n if (c = msg.shift()) {\n matrix.draw(c);\n setTimeout(next, 2000);\n }\n }", "function end_loop() {\r\n\tlet frame = stack.pop();\r\n\r\n\tlet new_index = frame.index_array[frame.index_index] + frame.step;\r\n\r\n\tframe.index_array[frame.index_index] = new_index;\r\n\r\n\tif (new_index <= frame.end_value) {\r\n\t\tstack.push(frame);\r\n\t\tPC = frame.pc;\r\n\t\treturn true;\r\n\t}\r\n\telse\r\n\t\treturn false;\r\n}", "function trackFrameEnd(){\n}", "step() {\n let minCount = this.minuteCount();\n let minPosition = this.minutePosition();\n\n this.updateNextMinuteData(minCount, minPosition);\n this.addNextVisitor(minPosition);\n this.moveActiveVisitors(minCount);\n this.removeDoneVisitors();\n\n this.frameCount += 1;\n this.resetIfOver(this.minuteCount(), this.minutePosition());\n }", "function step() {\r\n\t\tvar j;\r\n\t\tif(timeout_id) {\r\n\t\t clearTimeout(timeout_id);\r\n\t\t timeout_id = null;\r\n\t\t}\r\n\t\tframe = (frame + dir + imageSum) % imageSum;\r\n\t\tj = frame + 1;\r\n\t\t\r\n\t\tif(images[frame].complete) {\r\n\t\t $('div#animation').html('<img src=\"'+images[frame].src+'\" />');\r\n\t\t $('.label #playlabel').html('step: ');\r\n\t\t $('.label #playstatus').html(j+' of '+imageSum);\r\n\t\t \r\n\t\t if(swingon && (j == imageSum || frame == 0)) {\r\n\t\t\treverse();\r\n\t\t }\r\n\t\t \r\n\t\t playing = 0;\r\n\t\t}\r\n\t }", "function onAnimationEnd() {\n // stop the last frame from being missed..\n rec.stop();\n }", "gotoNextStep() {\n this.gotoStep(this.currentStep + 1);\n }", "function step() {\n paused = true;\n executeNext(true);\n }", "gotoPrevFrame() {\n var prevFramePlayheadPosition = this.playheadPosition - 1;\n\n if (prevFramePlayheadPosition <= 0) {\n prevFramePlayheadPosition = this.length;\n }\n\n this.gotoFrame(prevFramePlayheadPosition);\n }", "endFrame() {\n this.#stack.push(this.#currentFrame);\n this.#currentFrame = new StateFrame();\n }", "function frame()\n {\n //Clear the element if it reaches below a certain pixel range\n if (pos == 1024)//setting of the finish line\n {\n clearInterval(id);\n eball.remove();\n }\n //Continue to move till the finish line hits.\n else\n {\n pos++;//Add the position\n eball.style.top = pos + 'px';//Continuosly keep on adding the position value to account for the movement\n }\n }", "function step()\n{\n\tif (!paused)\n\t{\n\t\trunning = true;\n\t\twhile (running)\n\t\t{\n\t\t\tworkspace.highlightBlock(lastBlockToHighlight);\n\t\t\tif (!interpreter.step())\n\t\t\t{\n\t\t\t\tclearInterval(interval);\n\t\t\t\tstopped = true;\n\t\t\t\tdocument.getElementById(\"pause\").disabled = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n}", "function drawFrame() {\n\tif (drawNext) {\n\t\trenderFrame();\n\t\tdrawNext = false;\n\t}\n}", "gotoPrevFrame() {\n this.timeline.gotoPrevFrame();\n }", "function handleNext() {\n if (isRunning) {\n handleStop();\n }\n update();\n }", "frame() {\n this.display();\n this.move();\n this.edgeCheck();\n }", "function mainIterFrame(frameTime) {\n g_main.iter(frameTime);\n}", "skip(frames) {\n this.currentFrame = (this.currentFrame + frames) % this.sprites.length;\n }", "function forwardStep(e) {\n setMedia();\n media.currentTime = media.currentTime + trjs.param.forwardskip;\n }", "function showFrame(nextPosition) {\n var preloadingDirection = nextPosition - animationPosition > 0 ? 1 : -1;\n changeRadarPosition(nextPosition);\n // preload next next frame (typically, +1 frame)\n // if don't do that, the animation will be blinking at the first loop\n changeRadarPosition(nextPosition + preloadingDirection, true);\n }", "goToFrame(frame) {\n this._video.onPlay();\n return this._video.gotoFrame(frame, true);\n }", "_incrementFrame() {\n this._elapsedFrameCount += 1;\n }", "function next() {\n slide(false, true);\n }", "function step() {\n\t\tswitch(game.mode) {\n\t\t\tcase \"start\":\n\t\t\t\tgame.showStart();\n\t\t\t\tbreak;\n\t\t\tcase \"dead\":\n\t\t\t\tgameTimeout = setTimeout(function(){\n\t\t\t\t\t\n\t\t\t\t\tstep();\n\t\t\t\t}, 500);\n\t\t\t\tgame.mode = \"main\";\n\t\t\t\tbreak;\n\t\t\tcase \"main\":\n\t\t\t\tgame.scoreboard.update();\n\t\t\t\tif (moles >= moleLimit) {\n\t\t\t\t\tsound_tada.play();\n\t\t\t\t\tgame.mode = \"end\";\n\t\t\t\t\tgameTimeout = setTimeout(step, 10);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tgame.live();\n\t\t\t\tgame.togglePop();\n\t\t\t\tif (popping) game.move();\n\t\t\t\tpopping = (popping) ? false : true;\n\t\t\t\tgameTimeout = setTimeout(step, (popping) ? hidingInterval : poppingInterval);\n\t\t\t\tbreak;\n\t\t\tcase \"credits\":\n \t\t\t\twindow.location.href = window.location.href.replace('index', 'credits');\n\t\t\t\tbreak;\n\t\t\tcase \"end\":\n\t\t\tdefault:\n\t\t\t\tgame.mole.style.display = \"none\";\n\t\t\t\tgame.quote.css('display', 'none');\n\t\t\t\tgame.scoreboard.innerHTML = \"Final Score: \" + score + \"<br />Moles: \" + hits + \" / \" + moles;\n\t\t\t\tgame.endScreen.style.display = \"block\";\n\t\t\t\tgame.endCreditsButton.style.display = \"block\";\n\t\t\t\tbreak;\n\t\t}\n\t}", "beginFrame() { }", "function animate() {\n if (PLAY_STATUS != PlayStatus.PLAYING) {\n return;\n } else {\n stepAndAnimate()\n }\n}", "nextKeyframe() {\n const next = this.keyframes.next();\n\n if (!next.done && next.value)\n this.updateView(next.value);\n }", "function firePreviousFrame() {\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 changeToPreviousFrame();\n }", "function firePreviousFrame() {\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 changeToPreviousFrame();\n }", "function run() {\n var i = 0, animation;\n\n // Check activeAnimations.length each iteration.\n for (; i < activeAnimations.length; i++) {\n // If an error occurs, continue the other animations,\n // abort only the one that raised the error.\n try {\n animation = activeAnimations[i];\n _playFrame(animation);\n } catch (ex) {\n // If an error occurs, abort the anim.\n if (animation) {\n animation.abort(ex);\n }\n }\n }\n }", "function next() {\n\t\t\tanimateOut(currentIndex, ANIMATION_DURATION);\n\n\t\t\tlet nextIndex = (++currentIndex) % (IMAGES.length);\n\t\t\tanimateIn(nextIndex, ANIMATION_DURATION);\n\n\t\t\tcurrentIndex = nextIndex;\n\t\t}", "function advance() {\n // need this variable in case the pause is toggled multiple times\n // between calls to advance.\n pauseDetected = false;\n if (!isStopped) {\n if (FallingShape.isLoweringNeeded()) {\n FallingShape.lower();\n drawGame();\n } else {\n // block can't keep falling\n if (isGameOver()) {\n isStopped = true;\n recordPlayerScore();\n return;\n } else {\n // remove the _ prefix from the shape name to indicate it is no longer falling\n FallingShape.shapeName = FallingShape.shapeName.substring(1);\n FallingShape.showShape();\n score += FallingShape.points * (level + 1);\n // remove any full rows and fill the gap:\n manageRows();\n // update score, level, and delay:\n updateUserProgress();\n FallingShape = previewShape;\n totalShapesDropped++;\n previewShape = dropNewShape();\n drawPreview();\n }\n }\n setTimeout(advance, delay);\n } else {\n pauseDetected = true;\n }\n }", "function intGoNext(){\n goNext(0);\n }", "function frame() {\n if (bottom < newBottom) {\n bottom = bottom + factorBottom\n side = side + factorSide\n elem.style.bottom = bottom + 'px';\n elem.style.right = side + 'px';\n clickable = false; // During the move, clickable is false so no card can be clicked during the movement\n } else {\n\t clearInterval(id);\n moveBack();\n }\n }", "_nextBatch() {\n var this$1 = this;\n this._processFrames(this._batchIndex * Spritesheet.BATCH_SIZE);\n this._batchIndex++;\n setTimeout(function () {\n if (this$1._batchIndex * Spritesheet.BATCH_SIZE < this$1._frameKeys.length) {\n this$1._nextBatch();\n }\n else {\n this$1._processAnimations();\n this$1._parseComplete();\n }\n }, 0);\n }", "function next() {\n subject = context.stack.tail.head;\n index = 0;\n test( subject );\n }", "function frameAnimationEnd() {\n f.animatedFrames = f.animatedFrames || 0;\n f.animatedFrames++;\n if(f.animatedFrames == f.frameItems.length){\n f.finished = true;\n f.o.cbFinished.call(f);\n }\n \n }", "function stepFrame() {\n\t\tnodes = updateNodes(normalizer, relWidth, relHeight, nodes);\n\t\tedges = updateEdges(nodes, edges);\n\t\tredrawOutput(ctx, nodes, edges);\n window.requestAnimationFrame(stepFrame);\n\t}", "animate(){\n if (this.timeFromLast > this.animationTime){\n this.currentFrameNum++;\n this.currentFrameX += this.frameWidth;\n this.timeFromLast = 0;\n this.timeUntilLast = millis();\n }\n \n if (this.currentFrameNum > this.maxFrame){\n this.currentFrameNum = 3;\n this.currentFrameX = 22;\n }\n \n }", "function onAnimationDone() {\n sourceFrameIndex = currentFrameIndex;\n if (playing) {\n waitTimeout();\n }\n }", "function backward(){\n //alert(\"cur \"+curFrame);\n if(curFrame == 0){\n if(!isBlackOut){\n curFrame = frames.length-1;\n }else if(isBlackOut){\n curFrame = frames.length;\n }\n }\n \n if(!isBlackOut && curFrame >= 3){\n curFrame = curFrame-4;\n drawCurFrame();\n }else if(isBlackOut && curFrame >= 2){\n curFrame = curFrame-2;\n drawCurFrame();\n }\n}", "function scroll_frame () {\n if (element[scrollDir] != previous_top) return\n\n // set the scrollTop for this frame\n const now = Date.now()\n const point = smooth_step(start_time, end_time, now)\n const frameTop = Math.round(start_top + distance * point)\n element[scrollDir] = frameTop\n\n // check if we're done!\n if (now >= end_time) return resolve()\n\n // If we were supposed to scroll but didn't, then we\n // probably hit the limit, so consider it done; not\n // interrupted.\n if (\n element[scrollDir] === previous_top &&\n element[scrollDir] !== frameTop\n ) {\n return resolve()\n }\n previous_top = element[scrollDir]\n\n // schedule next frame for execution\n window.requestAnimationFrame(scroll_frame)\n }", "function next(play) {\n tdInstance.next(play);\n }", "function changeToNextFrame() {\n if (_currentTime === undefined) {\n _currentTime = getBeginDate().getTime();\n\n } else {\n var deltaTime = getResolution();\n _currentTime = _currentTime + deltaTime > getEndDate().getTime() ? getBeginDate().getTime() : _currentTime + deltaTime;\n }\n MyController.events.triggerEvent(\"timechanged\", {\n time : _currentTime\n });\n }", "function jumpFrame(){\n const newFrame = document.getElementById('newFrame').value\n if (isNaN(newFrame) || !newFrame || parseInt(newFrame) > 7781 || parseInt(newFrame) < 1){\n console.log('Out of Bounds')\n }\n else{\n setFrame(parseInt(newFrame))\n playerRef.current.seekTo(parseInt(newFrame) / 60)\n }\n }", "getFrame(t) {\nvar NF, f, frame, resolved, was_complete;\n//-------\n// Allow for the possibility that the frame seqeuence is extended\n// while we are scanning it. In the case where our search apparently\n// hits the sequence limit this means (a) that we should check\n// whether new frames have been added, and (b) that we shouldn''t\n// terminate the animation until we know that it is complete.\n// If I knew more about modern browsers' scheduling, I might realise\n// that this is unnecessarily complicated, or perhaps alternatively\n// that it is not complicated enough to be safe.\nresolved = false;\nwhile (!resolved) {\nwas_complete = this.isComplete;\nNF = this.fCount;\nf = this.getFrameIndex(t, NF);\nresolved = f !== NF || was_complete || NF === this.fCount;\nif (--this.traceMax > 0) {\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`Resolved: ${resolved} f=${f} NF=${NF} fCount=${this.fCount}`);\n}\n}\n}\n// Find result frame\n// Rather than terminate the animation, stick at the last available\n// frame, pending the arrival of possible successors -- via\n// @extendSigns() -- or the indication that there will never be\n// any successors -- via @setCompleted.\nreturn frame = f !== NF ? (this.fIncomplete = 0, this.setFrameAt(f)) : this.isComplete ? null : (this.fIncomplete++, this.fIncomplete < 5 ? typeof lggr.debug === \"function\" ? lggr.debug(\"getFrame: at end of incomplete animation\") : void 0 : void 0, this.setFrameAt(NF - 1));\n}", "gotoPrevFrame() {\n this.scriptOwner.parentClip.gotoPrevFrame();\n }", "_frame () {\n this._drawFrame()\n if (!this.paused) {\n if (this.frameCount % 4 === 0) {\n this._updateGeneration()\n this.matrix = this.nextMatrix\n this.nextMatrix = this._createMatrix()\n this.counter.innerText = 'Generation: ' + this.generationNumber\n }\n }\n this.frameCount++\n requestAnimationFrame(this._frame)\n }", "function frame () {\n\tmap.frame();\n}", "function next() {\n\n if (hasNext()) {\n currentVideo++;\n changeSource(currentVideo);\n tableUIUpdate();\n }\n\n }", "function _next() {\n\t\tif (queue.length > 0) {\n\t\t\tvar info = queue.shift();\n\t\t\t_getData(info.url, info.callback);\n\t\t} else {\n\t\t\tpaused = true;\n\t\t}\n\t}", "function next(){\n\tif (count == pictures.length - 1){\n\t\tcount = 0;\n\t} else {\n\t\tcount++;\t\n\t}\n\tupdateImage();\n\tdots();\n}", "function main(){\r\n\tvar TL=fl.getDocumentDOM().getTimeline()\r\n\tvar curL=TL.currentLayer;\r\n\tvar curF=TL.currentFrame;\r\n\tvar frame=TL.layers[curL].frames[curF];\r\n\tif(curF>frame.startFrame){\r\n\t\tTL.currentFrame=frame.startFrame;\r\n\t}else if(curF==frame.startFrame && curF>0){\r\n\t\tTL.currentFrame=frame.startFrame;\r\n\t\tvar prevFrame=TL.layers[curL].frames[frame.startFrame-1];\r\n\t\tTL.currentFrame=frame.startFrame-(prevFrame.duration);\r\n\t}\r\n}", "gotoAndStop(frameNumber) {\n if(this.frames.length > 0 && frameNumber < this.frames.length) {\n \n //a. Frame made from tileset images.\n //If each frame is an array, the the frames were made from an\n //ordinary Image object using the `frames` method\n if(this.frames[0] instanceof Array) {\n this.sourceX = this.frames[frameNumber][0]\n this.sourceY = this.frames[frameNumber][1]\n }\n \n //b. Frames made from texture atlas frames.\n //If each frame isn't an array, and it has a subobject called `frame`,\n //then the frame must be a texture atlas ID name.\n //In that case, get the source position from the atlas's `frame` object\n else if (this.frames[frameNumber].frame) {\n this.sourceX = this.frames[frameNumber].frame.x\n this.sourceY = this.frames[frameNumber].frame.y\n this.sourceWidth = this.frames[frameNumber].frame.w\n this.sourceHeight = this.frames[frameNumber].frame.h\n this.width = this.frames[frameNumber].frame.w\n this.height = this.frames[frameNumber].frame.h\n }\n \n //c. Frames made from individual Image objects.\n //If neither of the above is true, then each frame must be\n //an individual Image object\n else {\n this.source = this.frames[frameNumber]\n this.sourceX = 0\n this.sourceY = 0\n this.width = this.source.width\n this.height = this.source.height\n this.sourceWidth = this.source.width\n this.sourceHeight = this.source.height\n }\n \n //Set the `_currentFrame` value to the chosen frame\n this._currentFrame = frameNumber\n }\n \n //Throw an error if this sprite doesn't contain any frames\n else {\n //throw new Error(`Frame number ${frameNumber} does not exist`)\n }\n }", "function next() {\n\t\tvar nextStep = steps.next();\n\t\tsetSteps(steps);\n\t\tsetCurrent(nextStep);\n\t}", "function play() {\n\t\t\n\t\t//this function (defined below) will continue to the next turn\n\t\tadvance();\n\t}", "function credits_loop() {\n \t\tdo_fade();\n \t\tdraw_backDrop();\n \t\tdraw_scroller();\t\t\t\t\t\t\t\n \t\tendScreenTimer--;\t\t\t\t\t\t\t\t// Countdown the timer.\n \t\tif (endScreenTimer==0) end();\t\t\t\t\t\t\t\t// If it gets to zero, end the credits!\n \t\telse if (creditsLoopOn) requestAnimFrame( credits_loop );\t// ... otherwise if the demo is continuing, go to the next frame.\n \t}", "function mainIterFrame(frameTime) {\n main.iter(frameTime);\n}", "function gotoNext() {\n\tif(typeof nextInventory !== 'undefined') {\n\t\tpreviousInventory = currentInventory;\n\t\tcurrentInventory = nextInventory;\n\t\tnextInventory = undefined;\n\t}\n}", "requestFrame(next, resumed) {\n let now = Date.now();\n this.frame = {\n count: requestAnimationFrame(next),\n time: now,\n rate: resumed ? 0 : now - this.frame.time,\n scale: this.screen.scale * this.frame.rate * 0.01\n };\n }", "requestFrame(next, resumed) {\n let now = Date.now();\n this.frame = {\n count: requestAnimationFrame(next),\n time: now,\n rate: resumed ? 0 : now - this.frame.time,\n scale: this.screen.scale * this.frame.rate * 0.01\n };\n }", "function continueExecution() {\n clearBoard();\n hero.positionAtHome();\n hero.setImage('normal');\n hero.setLives(hero.getLives()-1);\n hero.draw();\n isNextLife = true;\n }", "function clickNext() {\n if (isRunning) {\n eventFire(document.querySelector('.stream-next'), 'click');\n nextOnFinish();\n }\n }", "previousFrame() {\r\n\t\t\tif (this.frame > 0) this.frame = this.frame - 1;\r\n\t\t\telse if (this.looping) this.frame = this.length - 1;\r\n\r\n\t\t\tthis.targetFrame = -1;\r\n\t\t\tthis.playing = false;\r\n\t\t}", "function nextFile(time) {\n // If already displaying the last one, do nothing.\n if (currentFileIndex === files.length - 1)\n return;\n\n // Don't pan a playing video!\n if (currentFrame.displayingVideo && !currentFrame.video.player.paused)\n currentFrame.video.pause();\n\n // Set a flag to ignore pan and zoom gestures during the transition.\n transitioning = true;\n setTimeout(function() { transitioning = false; }, time);\n\n // Set transitions for the visible frames\n var transition = 'transform ' + time + 'ms ease';\n currentFrame.container.style.transition = transition;\n nextFrame.container.style.transition = transition;\n\n // Cycle the three frames so next becomes current,\n // current becomes previous, and previous becomes next.\n var tmp = previousFrame;\n previousFrame = currentFrame;\n currentFrame = nextFrame;\n nextFrame = tmp;\n currentFileIndex++;\n\n // Move (transition) the frames to their new position\n resetFramesPosition();\n\n // Update the frame for the new next item\n setupFrameContent(currentFileIndex + 1, nextFrame);\n\n // When the transition is done, cleanup\n currentFrame.container.addEventListener('transitionend', function done(e) {\n this.removeEventListener('transitionend', done);\n\n // Reposition the item that just transitioned off the screen\n // to reset any zooming and panning\n previousFrame.reset();\n });\n\n // Disable the edit button if we're now viewing a video, and enable otherwise\n if (currentFrame.displayingVideo)\n $('fullscreen-edit-button').classList.add('disabled');\n else\n $('fullscreen-edit-button').classList.remove('disabled');\n}", "updateFrame() {\n let newFrameIndex;\n if(this.isInReverse) {\n newFrameIndex = this.currFrame - 1;\n if(newFrameIndex < 0) {\n if (this.loops) {\n this.isInReverse = false;\n newFrameIndex = this.currFrame + 1;\n } else {\n this.isAnimating = false;\n this.isFinished = true;\n newFrameIndex = 0;\n } \n } \n } else {\n newFrameIndex = this.currFrame + 1;\n if(newFrameIndex >= this.frames.length) {\n if(this.reverses) {\n newFrameIndex = this.currFrame - 1;\n this.isInReverse = true;\n } else if(this.loops) {\n newFrameIndex = 0;\n } else if (this.holds) { \n newFrameIndex = this.frames.length - 1;\n } else {\n this.isAnimating = false;\n this.isFinished = true;\n newFrameIndex = 0;\n }\n }\n }\n\n this.currFrame = newFrameIndex;\n }", "advance() {\n if (this._forceNextFrame) {\n this.playheadPosition = this._forceNextFrame;\n this._forceNextFrame = null;\n } else if (this._playing) {\n this.playheadPosition++;\n\n if (this.playheadPosition > this.length) {\n this.playheadPosition = 1;\n }\n }\n }", "function goNext( event ){\n event.preventDefault();\n go( revOffset - 1 );\n return false;\n }", "function _nextScreen() {\n console.log('nextScreen called');\n setTimeout(function () {\n $state.go(targetState);\n }, 2500);\n\n }", "function next() {\n phases.execute(self.field).then(function() {\n Sockets.send.player(self);\n });\n }", "function inBetweenNext() {\r\r // =======================================================\r var idmove = charIDToTypeID( \"move\" );\r var desc10 = new ActionDescriptor();\r var idnull = charIDToTypeID( \"null\" );\r var ref7 = new ActionReference();\r var idLyr = charIDToTypeID( \"Lyr \" );\r var idOrdn = charIDToTypeID( \"Ordn\" );\r var idTrgt = charIDToTypeID( \"Trgt\" );\r ref7.putEnumerated( idLyr, idOrdn, idTrgt );\r desc10.putReference( idnull, ref7 );\r var idT = charIDToTypeID( \"T \" );\r var ref8 = new ActionReference();\r var idLyr = charIDToTypeID( \"Lyr \" );\r var idOrdn = charIDToTypeID( \"Ordn\" );\r var idNxt = charIDToTypeID( \"Nxt \" );\r ref8.putEnumerated( idLyr, idOrdn, idNxt );\r desc10.putReference( idT, ref8 );\r executeAction( idmove, desc10, DialogModes.NO );\r\r // =======================================================\r var idnextFrame = stringIDToTypeID( \"nextFrame\" );\r var desc43 = new ActionDescriptor();\r var idtoNextWholeSecond = stringIDToTypeID( \"toNextWholeSecond\" );\r desc43.putBoolean( idtoNextWholeSecond, false );\r executeAction( idnextFrame, desc43, DialogModes.NO );\r\r}", "moveNext() {\n const nextStep = this.steps[this.currentStep + 1];\n if (!nextStep) {\n this.reset();\n return;\n }\n\n this.overlay.highlight(nextStep);\n this.currentStep += 1;\n }", "__nextStep() {\n this.openNextStep();\n }", "rewind() {\n\t\t\t\tthis.frame = 0;\n\t\t\t}", "function animateNext()\n{\t\n\tvar oPlan = {};\n\toPlan.index = i;\t\n\toPlan.startPoint = [-33.918861, 18.423300];\n\toPlan.endPoint = countries[i].latlng;\t\n\toPlan.animLoop = false;\n\toPlan.animIndex = 0;\n\toPlan.planePath = false;\n\toPlan.trailPath = false;\n\tanimPlans.push(oPlan);\n\tanimate(oPlan);\n\n\tactiveAnimations++;\n\n\ti++;\n\tif (i >= total) return;\n\t\n\twait();\t\n}", "function playRun(){ \n if(curFrame < frames.length && paused == false){\n drawCurFrame();\n timeOutID = setTimeout(playRun, time); \n }\n}", "function introNextStep() {\n\tsetTimeout(function() {\n\t\tintro.nextStep();\n\t},800);\n}", "function animationLoop(timeStamp){\n //7. Clears everything in canvas\n ctx.clearRect(0,0,canvas.width,canvas.height);\n drawBackground();\n walkingAnimation();\n changePositionX();\n changePositionY();\n changeTime();\n changeJump();\n //1-. Cal this function again (Repeat from step 6)\n requestId = requestAnimationFrame(animationLoop);\n\n // 9. Move Image\n}" ]
[ "0.7810864", "0.77806795", "0.76269764", "0.7540845", "0.74758345", "0.7405974", "0.7398673", "0.7348175", "0.7302317", "0.71408546", "0.7054813", "0.7054813", "0.69301367", "0.6919115", "0.68607724", "0.6757489", "0.66500217", "0.6545627", "0.6534263", "0.6526923", "0.64771056", "0.64555526", "0.63805276", "0.6377469", "0.63682723", "0.63630474", "0.6362971", "0.63264745", "0.63129854", "0.62654257", "0.6209985", "0.62089527", "0.61657864", "0.6164353", "0.6148119", "0.61127764", "0.6102882", "0.6091229", "0.60863036", "0.6072218", "0.6058808", "0.60394996", "0.6030359", "0.60062885", "0.5997542", "0.5989918", "0.5986858", "0.5980781", "0.5973707", "0.5949713", "0.5949713", "0.59345263", "0.5913869", "0.59008414", "0.58979857", "0.5897528", "0.58937955", "0.587818", "0.58722305", "0.58696866", "0.58672935", "0.58624154", "0.58608633", "0.5849595", "0.584496", "0.584337", "0.5842245", "0.5837939", "0.5830423", "0.58286464", "0.5823183", "0.5819142", "0.5803505", "0.5802107", "0.5800289", "0.57995206", "0.5799442", "0.57993215", "0.57965255", "0.57964474", "0.5790368", "0.5789456", "0.5789456", "0.5781879", "0.5778491", "0.5775819", "0.5772421", "0.5757039", "0.57565576", "0.5753012", "0.5751975", "0.5744965", "0.5740206", "0.5737411", "0.5730888", "0.57260376", "0.57224643", "0.5718418", "0.570787", "0.5705191" ]
0.75547886
3
Goes to the previous frame and stops.
previousFrame() { if (this.frame > 0) this.frame = this.frame - 1; else if (this.looping) this.frame = this.length - 1; this.targetFrame = -1; this.playing = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "gotoPrevFrame() {\n var prevFramePlayheadPosition = this.playheadPosition - 1;\n\n if (prevFramePlayheadPosition <= 0) {\n prevFramePlayheadPosition = this.length;\n }\n\n this.gotoFrame(prevFramePlayheadPosition);\n }", "previousFrame() {\n\t\t\t\tif (this.frame > 0) this.frame = this.frame - 1;\n\t\t\t\telse if (this.looping) this.frame = this.images.length - 1;\n\n\t\t\t\tthis.targetFrame = -1;\n\t\t\t\tthis.playing = false;\n\t\t\t}", "gotoPrevFrame() {\n this.scriptOwner.parentClip.gotoPrevFrame();\n }", "gotoPrevFrame() {\n this.timeline.gotoPrevFrame();\n }", "function prevFrame(){\n // Protecting lower bounds\n if (frame === 1){\n console.log('No Previous Frame')\n return\n }\n setFrame(frame - 1)\n console.log('Previous Frame')\n playerRef.current.seekTo(frame / 60)\n console.log(frame)\n console.log(frame / 60)\n }", "getPreviousFrame() {\nvar f;\nf = this.fCur - 1;\nif (f < 0) {\nf = this.fCount - 1;\n}\nreturn this.setFrameAt(f);\n}", "function firePreviousFrame() {\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 changeToPreviousFrame();\n }", "function firePreviousFrame() {\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 changeToPreviousFrame();\n }", "function backward(){\n //alert(\"cur \"+curFrame);\n if(curFrame == 0){\n if(!isBlackOut){\n curFrame = frames.length-1;\n }else if(isBlackOut){\n curFrame = frames.length;\n }\n }\n \n if(!isBlackOut && curFrame >= 3){\n curFrame = curFrame-4;\n drawCurFrame();\n }else if(isBlackOut && curFrame >= 2){\n curFrame = curFrame-2;\n drawCurFrame();\n }\n}", "prev() {\n const index = this.index - 1;\n this.index = (index < 0) ? this._frames.length + index : index;\n }", "function goToPrevious() {\n goTo(_currentContext.previous);\n }", "rewind() {\r\n\t\t\tthis.looping = false;\r\n\t\t\tthis.goToFrame(0);\r\n\t\t}", "function prev() {\n\t\t\tgoToImage((curImage-1 < 0 ? numImages-1 : curImage-1), next ,true);\n\t\t}", "function goBack() {\n pauseSlideshow();\n isRandom = false;\n toggle_sequence.innerHTML = \"Sequential\";\n if (effect == 2) {\n slideBack();\n } else {\n grabPreviousSlide();\n loadSlide();\n }\n\n }", "goback() { this.back = true; }", "function gotoPrevious() {\n\tif(typeof previousInventory !== 'undefined') {\n\t\tnextInventory = currentInventory;\n\t\tcurrentInventory = previousInventory;\n\t\tpreviousInventory = undefined;\n\t}\n}", "function newGoBack(url){\r\n\tgoFrame(url);\r\n}", "runOneStepBackwards() {\n this.stateHistory.previousState()\n }", "function goToPrevious() {\n var prevId = getPreviousLocationIndex();\n if (prevId != null) {\n setCurrentLocation(prevId);\n }\n }", "function backwardStep(e) {\n setMedia();\n if (media.currentTime > trjs.param.backwardskip)\n media.currentTime = media.currentTime - trjs.param.backwardskip;\n else\n media.currentTime = 0;\n }", "movePrevious() {\n const previousStep = this.steps[this.currentStep - 1];\n if (!previousStep) {\n // this.reset();\n return;\n }\n\n this.overlay.highlight(previousStep);\n this.currentStep -= 1;\n }", "function goBack() {\n\t\ttogglePage();\n\t\tdisposeThrownShurikens();\n\t\tupdateThrownShurikenCount();\n\t\tcleanBelt();\n\t}", "function goPrevious() {\n if (pageNum <= 1)\n return;\n pageNum--;\n renderPage(pageNum);\n }", "previous() {\n this._previous();\n }", "goBack() {\n this.currentIdx = Math.max(0, this.currentIdx - 1);\n }", "function slideBack() {\n grabPreviousSlide();\n nextImage.src = slides[currentSlide].image;\n caption = slides[currentSlide].caption;\n sequence.innerHTML = (currentSlide + 1) + \" / \" + slides.length;\n\n bufferCtx.canvas.width = slideshow.width;\n bufferCtx.canvas.height = slideshow.height;\n\n x = slideshow.width;\n draw();\n transitionBack();\n\n }", "function prev() {\n\t\tvar prevStep = steps.prev();\n\t\tsetSteps(steps);\n\t\tsetCurrent(prevStep);\n\t}", "function prev() {\n slide(false, false);\n }", "function hidePreviousFrame() {\n /*\n Replaces the \"current-image\" class with the \"previous-image\" one on the image.\n It calls the \"getNormalizedCurrentFrame\" method to translate the \"currentFrame\" value to the \"totalFrames\" range (1-180 by default).\n */\n frames[getNormalizedCurrentFrame()].removeClass(\"current-image\").addClass(\"previous-image\");\n }", "function previous() {\n\n if (hasPrevious()) {\n\n currentVideo--;\n changeSource(currentVideo);\n tableUIUpdate();\n\n }\n\n }", "function forward(){\n if(curFrame <= frames.length-1)\n drawCurFrame();\n}", "goBack() {\n this._goBack().catch(Cu.reportError);\n }", "previousPage() {\n if (this.getCurrentIndex() === 0) {\n if (this.isScrollLoop() && this.__pages.length > 1) {\n this._doScrollLoop();\n }\n } else {\n this.setCurrentIndex(this.getCurrentIndex() - 1);\n }\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 previous() {\n clearInterval(playslides);\n playslides = setInterval(next, 5000);\n if (current_slide_index > 0) {\n current_slide_index--;\n set_current_slide(img_array[current_slide_index].src);\n }\n else {\n current_slide_index = slide_count - 1;\n set_current_slide(img_array[current_slide_index].src);\n }\n}", "function goPrevious() {\n\tif (pageNum <= 1)\n\t\treturn;\n\tpageNum--;\n\trenderPage(pageNum);\n}", "prevStep() {\n\n if (this.currStep > -1) {\n\n this.goTo(this.currSlide, this.currStep - 1);\n\n }\n\n }", "function prevScene () {\n\tif (currentSceneIndex > 0)\n\t\tsetScene(currentSceneIndex - 1);\n}", "_previous() {\n if (this._page === 1) return;\n\n this._page--;\n this._loadCurrentPage();\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 previousSteps() {\n\tcurrent_step = current_step - 1;\n\tnext_step = next_step - 1;\n}", "function skipBackwardToStart()\r\n\t{\r\n\t\tmyVideo.currentTime = 0; //the playback time returns back to 0 seconds\r\n\t\t//if statement; outcome differs depending on conditions\r\n\t\tif ( myVideo.currentTime === 0 )\r\n\t\t{\r\n\t\t\tmyVideo.pause(); //the DOM pause method pauses the video, when clicked\r\n\t\t\tplayButton.innerHTML = \"&#9658;\" ; //updates inside HTML button selector when clicked: turns into a right-pointing pointer made from single Unicode\r\n\t\t\tmyVideo.load(); //DOM load() method re-loads the video\r\n\t\t\tscrubSlider.value = 0; //reset the slider for video playback to zero\r\n\t\t} //end if statement\r\n\t}", "function previous(){\n\tif (count == 0){\n\t\tcount = pictures.length - 1;\n\t} else {\n\t\tcount--;\n\t}\n\tupdateImage();\n\tdots();\n}", "function previous(){\n var goToPage = parseInt(pager.data(\"curr\")) - 1;\n goTo(goToPage);\n }", "function prev() {\n\t\t\treturn go(current-1);\n\t\t}", "function previousPage(){\n if (page > 1)\n {\n setPage(page - 1);\n }\n else {\n // do nothing\n }\n }", "gotoNextFrame() {\n // Loop back to beginning if gotoNextFrame goes past the last frame\n var nextFramePlayheadPosition = this.playheadPosition + 1;\n\n if (nextFramePlayheadPosition > this.length) {\n nextFramePlayheadPosition = 1;\n }\n\n this.gotoFrame(nextFramePlayheadPosition);\n }", "function goToPrevStep(){\n unhighlightArrow(currStepId, numberToString[currStepId]);\n currStepId-=1;\n replaceStep();\n highlightArrow(currStepId, numberToString[currStepId]); \n}", "function previousPage()\r\n{\r\n\thistory.go(-1);\r\n}", "function _previousStep() {\n this._direction = 'backward';\n\n if (this._currentStep === 0) {\n return false;\n }\n\n var nextStep = this._introItems[--this._currentStep];\n if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n this._introBeforeChangeCallback.call(this, nextStep.element);\n }\n\n _showElement.call(this, nextStep);\n }", "function _previousStep() {\n this._direction = 'backward';\n\n if (this._currentStep === 0) {\n return false;\n }\n\n var nextStep = this._introItems[--this._currentStep];\n if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n this._introBeforeChangeCallback.call(this, nextStep.element);\n }\n\n _showElement.call(this, nextStep);\n }", "function _previousStep() {\n this._direction = 'backward';\n\n if (this._currentStep === 0) {\n return false;\n }\n\n var nextStep = this._introItems[--this._currentStep];\n if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n this._introBeforeChangeCallback.call(this, nextStep.element);\n }\n\n _showElement.call(this, nextStep);\n }", "function _previousStep() {\n this._direction = 'backward';\n\n if (this._currentStep === 0) {\n return false;\n }\n\n var nextStep = this._introItems[--this._currentStep];\n if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n this._introBeforeChangeCallback.call(this, nextStep.element);\n }\n\n _showElement.call(this, nextStep);\n }", "function _previousStep() {\n this._direction = 'backward';\n\n if (this._currentStep === 0) {\n return false;\n }\n\n var nextStep = this._introItems[--this._currentStep];\n if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n this._introBeforeChangeCallback.call(this, nextStep.element);\n }\n\n _showElement.call(this, nextStep);\n }", "function _previousStep() {\n\t this._direction = 'backward';\n\n\t if (this._currentStep === 0) {\n\t return false;\n\t }\n\n\t var nextStep = this._introItems[--this._currentStep];\n\t if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n\t this._introBeforeChangeCallback.call(this, nextStep.element);\n\t }\n\n\t _showElement.call(this, nextStep);\n\t }", "previous(){\n let previous = this.currentId - 1;\n if(previous <= 1){\n previous = 1;\n }\n this.goto(previous);\n }", "function prev() {\n --move_index; //decrease move count\n draw_everything();\n}", "previous() {\n const newIndex = this.index - 1;\n\n if (this.isOutRange(newIndex)) {\n return;\n }\n\n this.doSwitch(newIndex);\n }", "function goBack() {\n history.go(-1);\n }", "goToPrev () {\n\t\t\tif (this.canGoToPrev) {\n\t\t\t\tthis.goTo(this.currentSlide - 1)\n\t\t\t}\n\t\t}", "function goToPreviousPage() {\n\t\tif ( canPreviousPage() ) {\n\t\t\tgoToPage( currentPage() - 1 );\n\t\t}\n\t}", "function goBack () {\n // two right turn, make it turn back (180 degree)\n robot.turnRight()\n robot.turnRight()\n robot.move()\n // another tow right turn, make it return to its original facing direction\n robot.turnRight()\n robot.turnRight()\n }", "function gotoPreviousSong() {\n if (songIndex === 0) {\n songIndex = songs.length - 1;\n } else {\n songIndex = songIndex - 1;\n }\n\n const isDiscPlayingNow = !disc.paused;\n loadSong(songs[songIndex]);\n resetProgress();\n if (isDiscPlayingNow) {\n playPauseMedia();\n }\n}", "function goPrev( event ){\n event.preventDefault();\n go( revOffset + 1 );\n return false;\n }", "navigateToPreviousStep() {\n if (this.state.currentStepIndex <= 0) {\n return;\n }\n this.setState(prevState => ({\n currentStepIndex: prevState.currentStepIndex - 1,\n }));\n }", "gotoNextFrame() {\n this.scriptOwner.parentClip.gotoNextFrame();\n }", "function prev(play) {\n tdInstance.prev(play);\n }", "function prevPage(){\n\t\tvar $currPage = $pages.eq( current );\n\n\t\tif( current > 0 ) {\n\t\t\t--current;\n\t\t}\n\t\telse {\n\t\t\tcurrent = pagesCount-1;\n\t\t}\n\n\t\tanimatePage($currPage, 'pt-page-rotatePushTop');\n\t}", "function prev(){\n\tif(state == \"blank\") return;\n\tif(--cursched < 0) cursched = schedules.length-1;\n\tdraw();\n}", "previous(){\n let targetItem = this._currentItem - 1;\n let previousItem = targetItem < 0 ? this._itemCount - 1 : targetItem;\n this._changeActive_keepPlayState(previousItem);\n }", "function prevState() {\n // if go out of bounds, keep at first state\n stateIndex = Math.max(0, stateIndex - 1);\n updateGraphState();\n}", "function previousPage() {\n\t\tsetCurrentPage((page) => page - 1);\n\t}", "function goBack() {\n\t\t\t$state.go('^');\n\t\t}", "prev() {\n\n if (this.currStep > -1) {\n\n this.prevStep();\n\n } else {\n\n this.prevSlide();\n\n }\n\n }", "function previousItem() {\n\t\tstopSlideshow();\n\t\tchangeItem(current - 1);\n\t}", "function previousImage() {\n\t\timageIndex--;\n\t\tif(imageIndex < 0) {\n\t\t\timageIndex = imageCount - 1;\n\t\t}\n\n\t}", "function PrevButtonClicked() {\n playerObject.controls.previous();\n}", "function goToPrevSlide()\n\t{\n\t\tif($currentSlide.prev().length)\n\t\t{\n\t\t\tgoToSlide($currentSlide.prev());\n\t\t}\n\t}", "function previousFile(time) {\n // if already displaying the first one, do nothing.\n if (currentFileIndex === 0)\n return;\n\n // Don't pan a playing video!\n if (currentFrame.displayingVideo && !currentFrame.video.player.paused)\n currentFrame.video.pause();\n\n // Set a flag to ignore pan and zoom gestures during the transition.\n transitioning = true;\n setTimeout(function() { transitioning = false; }, time);\n\n // Set transitions for the visible frames\n var transition = 'transform ' + time + 'ms ease';\n previousFrame.container.style.transition = transition;\n currentFrame.container.style.transition = transition;\n\n // Transition to the previous item: previous becomes current, current\n // becomes next, etc.\n var tmp = nextFrame;\n nextFrame = currentFrame;\n currentFrame = previousFrame;\n previousFrame = tmp;\n currentFileIndex--;\n\n // Move (transition) the frames to their new position\n resetFramesPosition();\n\n // Preload the new previous item\n setupFrameContent(currentFileIndex - 1, previousFrame);\n\n // When the transition is done do some cleanup\n currentFrame.container.addEventListener('transitionend', function done(e) {\n this.removeEventListener('transitionend', done);\n // Reset the size and position of the item that just panned off\n nextFrame.reset();\n });\n\n // Disable the edit button if we're now viewing a video, and enable otherwise\n if (currentFrame.displayingVideo)\n $('fullscreen-edit-button').classList.add('disabled');\n else\n $('fullscreen-edit-button').classList.remove('disabled');\n}", "function _previousStep() {\n if(this._currentStep == 0)\n return;\n\n _showElement.call(this, this._introItems[--this._currentStep].element);\n }", "function PreviousPage() {\n\tif (CurrentPage-1 >= 1){\n\t\tDisplayPage( CurrentPage - 1 )\n\t}\n\telse{\n\t\tPreviousSCO();\n\t}\n}", "function goBack(){\n for (let i = 0; i < carImage.length; i++){\n if (CarDisappeared(xCars[i])){\n xCars[i] = xCarLoop[i];\n }\n} \n}", "function prev(){\n\t\t\t\t\t//check for beginning\n\t\t\t\t\tif(PCArray.length <= 1) {\n\t\t\t\t\t\tif(com.timeout){\n\t\t\t\t\t\t\tclearTimeout(com.timeout);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//restore the values\n\t\t\t\t\t\n\t\t\t\t\tif(com.sse.evolution.children().last().length == 0){\n\t\t\t\t\t\tif(com.timeout){\n\t\t\t\t\t\t\tclearTimeout(com.timeout);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tcom.sse.evolution.children().last().remove();\n\t\t\t\t\t\n\t\t\t\t\t//get the previous values or set them to []\n\t\t\t\t\t\n\t\t\t\t\tvar values = com.sse.evolution.children().last().data(\"values\");\n\t\t\t\t\tvalues = (typeof values != 'undefined')?values:[];\n\n\t\t\t\t\tcom.sse.stack.html(\"\");\n\t\t\t\t\t\n\t\t\t\t\t//redraw old values\n\t\t\t\t\tcStack = com.stack.editable( values );\n\t\t\t\t\tcom.sse.stack.append(cStack);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//restore program counter\n\t\t\t\t\tPC = PCArray.pop();\n\t\t\t\t\t$(tokens[ PC ]).removeClass(cls.currentToken); //todo: make tokens jQuery\n\t\t\t\t\t\n\t\t\t\t\tif(PCArray.length > 0 ){\n\t\t\t\t\t\t$(tokens[PCArray[PCArray.length-1]]).addClass(cls.currentToken);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$(\"#\"+ids.ssePosition ).text(PC);\n\n\n\t\t\t\t\t//restore framepointer\n\t\t\t\t\tframepointer = FPArray.pop();\n\t\t\t\t\t$(\"#\"+ids.FPPosition ).text(framepointer);\n\t\t\t\t\t\n\t\t\t\t\treturn true;\n\t\t\t\t}", "function previousPage() {\n\trequestVideoPlaylist(playlistId, prevPageToken);\n}", "_goToPrevCard() {\n if (this._btnPrev.disabled === false) {\n var newCurrentPos = 0;\n newCurrentPos = this._currentPos - 1;\n this._goToCard(newCurrentPos, 'prev');\n }\n }", "function goToPreviousStep() {\n\tpreviousSteps();\n\tupdateStepsText();\n\tconsole.log(\"hey\");\n}", "function MediaGoBack()\r\n{\r\n MediaStop();\r\n\r\n if (WrapAtEnd)\r\n (iCurrentImage == 0) ? iCurrentImage = (xMediaContent.length - 2) : iCurrentImage-=2;\r\n else\r\n (iCurrentImage == 0) ? iCurrentImage = 0 : iCurrentImage-=2;\r\n\r\n document.MEDIAIMAGE.src = xMediaContent[iCurrentImage];\r\n}", "function stepBackward(){\n if(index === 0){\n index = playList.length - 1\n }else{\n index--\n }\n\n box.innerHTML = `Track ${index + 1} - ${playList[index]}${ext}`;\n audio.src = dir + playList[index] + ext;\n audio.play()\n }", "function stepBack(mediaId, rewindBy){\r\n if (!getCurrentPlayer(mediaId))\r\n {\r\n setCurrentPlayer(mediaId);\r\n }\r\n var newTime;\r\n var currentTime;\r\n if(currentPlayer.currentTime)\r\n currentTime = currentPlayer.currentTime\r\n else\r\n currentTime = convertDisplayTimeToSeconds($(\"#ucatJumpToTimeTB_\"+mediaId).val());\r\n \r\n newTime = currentTime - rewindBy;\r\n if(newTime <= rewindBy || newTime <= 0){\r\n newTime = 0;\r\n }\r\n ucatMediaJumpToTime(mediaId, newTime, currentPlayer.isPlaying);\r\n}", "prev() {\n const that = this;\n\n that.navigateTo(that.pageIndex - 1);\n }", "function backButtonTrigger() {\n if (window.currentVideoSelectedForPlayback) {\n setCurrentlyPlaying(false)\n const currentNode = window.currentVideoSelectedForPlayback\n const currentTime = currentNode.data.videoCore.currentTime\n const currentVideoStart = currentNode.data.metadata.startTime\n\n if (currentTime - currentVideoStart > 1) {\n currentNode.data.videoCore.currentTime -= 1\n } else if (currentNode.prev) {\n const remainingTime = 1 - currentTime\n window.currentVideoSelectedForPlayback = currentNode.prev\n const prevEndTime = window.currentVideoSelectedForPlayback.data.metadata.endTime\n window.currentVideoSelectedForPlayback.data.videoCore.currentTime = prevEndTime - remainingTime\n } else {\n window.currentVideoSelectedForPlayback.data.videoCore.currentTime = currentVideoStart\n }\n renderUIAfterFrameChange(window.currentVideoSelectedForPlayback)\n }\n}", "function History_Force_MoveBack()\n{\n\t//can we go back?\n\tif (__SIMULATOR.History.CurrentStateIndex > 1)\n\t{\n\t\t//Go back\n\t\t__SIMULATOR.History.MoveBack();\n\t}\n}", "__previousStep() {\n this.openPreviousStep();\n }", "function goToPrevSlide()\n {\n if($currentSlide.prev().length)\n {\n goToSlide($currentSlide.prev());\n }\n }", "function prevTab() {\n\tvar query = {\n\t\tcurrentWindow: true,\n\t\thidden: false,\n\t};\n\tif (skiploading) query['status'] = 'complete';\n\tif (skipdiscarded) query['discarded'] = false;\n\tbrowser.tabs.query(query).then(tabs => {\n\t\tlet current = tabs.findIndex(tab => tab.active);\n\t\tlet prev = current - 1;\n\t\twhile (true) {\n\t\t\t// before the first tab?\n\t\t\tif (prev < 0) {\n\t\t\t\tif (!wrap) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\tprev = tabs.length - 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// lapped all the way around\n\t\t\tif (prev == current) return true;\n\t\t\t// skip urls\n\t\t\tif (skipurls.indexOf(tabs[prev].url) > -1) {\n\t\t\t\tprev--;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// if we get here, we have a tab to switch to\n\t\t\tbreak;\n\t\t}\n\t\tbrowser.tabs.sendMessage(tabs[prev].id, {\n\t\t\ttopic: 'scrolledToTab'\n\t\t}).catch (error => {});\n\t\tbrowser.tabs.update(tabs[prev].id, {\n\t\t\tactive: true\n\t\t});\n\t\treturn true;\n\t});\n}", "prev() {\n const self = this;\n if (!self.isAnimating) { self.index -= 1; self.to(self.index); }\n }", "rewind() {\n\t\t\t\tthis.frame = 0;\n\t\t\t}", "function previousStep(){this._direction=\"backward\";if(this._currentStep===0){return false;}--this._currentStep;var nextStep=this._introItems[this._currentStep];var continueStep=true;if(typeof this._introBeforeChangeCallback!==\"undefined\"){continueStep=this._introBeforeChangeCallback.call(this,nextStep&&nextStep.element);}// if `onbeforechange` returned `false`, stop displaying the element\nif(continueStep===false){++this._currentStep;return false;}_showElement.call(this,nextStep);}", "endFrame() {\n this.#stack.push(this.#currentFrame);\n this.#currentFrame = new StateFrame();\n }", "function prevTrack() {\n if(track_index > 0) track_index -= 1;\n else track_index = track_list.length - 1;\n\n // Load and play the new track\n loadTrack(track_index);\n playTrack();\n}" ]
[ "0.7906292", "0.7812864", "0.7554695", "0.74963164", "0.74026585", "0.7373975", "0.73246425", "0.73246425", "0.72755533", "0.7262534", "0.7188262", "0.70223796", "0.69566983", "0.692452", "0.69226867", "0.6881791", "0.68798035", "0.68631", "0.6861956", "0.6858386", "0.68240345", "0.6806195", "0.67953837", "0.6784787", "0.6776261", "0.6772202", "0.6768617", "0.6750883", "0.67438936", "0.67202145", "0.67191637", "0.6715921", "0.6699571", "0.6685131", "0.66781527", "0.66777384", "0.6657659", "0.6626583", "0.6599973", "0.6590621", "0.65893096", "0.6587402", "0.65625185", "0.65594035", "0.65562797", "0.65519935", "0.65518796", "0.654256", "0.6502027", "0.649978", "0.649978", "0.649978", "0.649978", "0.649978", "0.64920086", "0.64877075", "0.6482719", "0.6481839", "0.64797485", "0.6478418", "0.6478092", "0.6464015", "0.6450081", "0.64496756", "0.64442533", "0.6437996", "0.6427877", "0.64263046", "0.6422167", "0.64220226", "0.64037925", "0.63964486", "0.6392139", "0.63920313", "0.6389765", "0.6380843", "0.63807297", "0.6376132", "0.637237", "0.6369456", "0.6362451", "0.6358446", "0.63449174", "0.6341763", "0.63373893", "0.6336362", "0.63360214", "0.631576", "0.6315085", "0.63135344", "0.6309115", "0.6304837", "0.6298992", "0.62896615", "0.6277543", "0.62765723", "0.62673223", "0.62627435", "0.6262337", "0.6254864" ]
0.79477596
0
Removes all sprites from the group and destroys the group.
removeAll() { this.remove(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "destroy()\n\t{\n\t\tthis.parentGroup.removeSprite(this);\n\t}", "destroy()\n\t{\n\t\tthis.parentGroup.removeSprite(this);\n\t}", "remove() {\n\t\t\t\tthis.removed = true;\n\n\t\t\t\t//when removed from the \"scene\" also remove all the references in all the groups\n\t\t\t\twhile (this.groups.length > 0) {\n\t\t\t\t\tthis.groups[0].remove(this);\n\t\t\t\t}\n\n\t\t\t\t// clear and rebuild the quadTree\n\t\t\t\tif (this.p.quadTree.rebuildOnRemove) {\n\t\t\t\t\tthis.p.allSprites._rebuildQuadtree();\n\t\t\t\t}\n\t\t\t}", "destroy() {\n this.container.removeChild(this.inspiredSprite);\n this.container.removeChild(this.sprite);\n this.container.removeChild(this.halo);\n this.container.removeChild(this.highlight);\n delete this.container;\n }", "removeSprites() {\n\t\t\t\t// prevent rebuilding the quadTree multiple times\n\t\t\t\tthis.p.quadTree.rebuildOnRemove = false;\n\t\t\t\twhile (this.length > 0) {\n\t\t\t\t\tthis[0].remove();\n\t\t\t\t}\n\t\t\t\tthis.p.quadTree.rebuildOnRemove = true;\n\n\t\t\t\tthis.p.allSprites._rebuildQuadtree();\n\t\t\t}", "function clearSprites(){\n\t\tfor (var i = sprites.length - 1; i >= 0; i--) {\n\t\t\tsceneOrtho.remove(sprites[i]);\n\t\t};\n\t\tsprites=[];\n\t}", "remove() {\r\n\t\t\tif (this.body) this.p.world.destroyBody(this.body);\r\n\t\t\tthis.removed = true;\r\n\r\n\t\t\t//when removed from the \"scene\" also remove all the references in all the groups\r\n\t\t\twhile (this.groups.length > 0) {\r\n\t\t\t\tthis.groups[0].remove(this);\r\n\t\t\t}\r\n\t\t}", "destroyAssets() {\n this.sprite.destroy();\n }", "function destroyEnemies() {\n\taddGroupEnemy();\n}", "remove() {\n\t\tthis.destroy();\n\t\tthis.engine.scene.removeSprite(this);\n\t}", "function destroyBackground() {\n\tif (spriteBackground) {\n\t\tgroupBackground.remove(spriteBackground, true);\n\t}\n}", "destroySprite(sprite){\n sprite.destroy();\n }", "clearScene(){\n $objs.spritesFromScene.forEach(cage => {\n $stage.scene.removeChild(cage);\n $objs.LIST[cage.dataObj._id] = void 0;\n });\n $objs.spritesFromScene = [];\n }", "cleanUp() {\n // clear activeEnemies\n this.activeEnemies.forEach(function(enemy) {\n enemy.cleanUp();\n });\n // clear active players\n this.activeObjects.forEach(function(object) {\n object.cleanUp();\n });\n // stop game loop\n this.animation.forEach(function(frame,index) {\n cancelAnimationFrame(frame);\n });\n }", "remove() {\n for (let card of this.playPile) {\n card.destroy();\n }\n\n for (let card of this.drawPile) {\n card.destroy();\n }\n\n this.drawPileCard.destroy();\n }", "remove(...sprites) {\n\n //Remove sprites that's aren't in an array\n if (!(sprites[0] instanceof Array)) {\n if (sprites.length > 1) {\n sprites.forEach(sprite => {\n sprite.parent.removeChild(sprite);\n });\n } else {\n sprites[0].parent.removeChild(sprites[0]);\n }\n }\n\n //Remove sprites in an array of sprites\n else {\n let spritesArray = sprites[0];\n if (spritesArray.length > 0) {\n for (let i = spritesArray.length - 1; i >= 0; i--) {\n let sprite = spritesArray[i];\n sprite.parent.removeChild(sprite);\n spritesArray.splice(spritesArray.indexOf(sprite), 1);\n }\n }\n }\n }", "removeFrom (stage) {\n const curStage = stage\n\n curStage.sprites = stage.sprites.filter((item) => item !== this)\n this.element ? this.element = this.element.delete(this) : null\n }", "remove() {\n Player.container.children.forEach(child => {\n if(child.parentId === this.id) {\n this.removeSprite(child);\n }\n });\n delete Player.list[this.id];\n }", "removeSprite(body) {\n const index = this.spriteList.findIndex(s => s.id === body.id)\n this.spriteList.splice(index, 1)\n body.sprite.destroy()\n try {\n body.stopWork()\n } catch (e) {\n console.log(body + 'dont have stopwork fn')\n }\n }", "function _clear() {\n Utils.removeChildren(sprites_placeholder);\n Utils.removeChildren(name_sec);\n Utils.removeChildren(ability_sec);\n }", "cleanupScene(groupOrScene = null) {\n if (groupOrScene === null) {\n groupOrScene = this.scene;\n }\n const items = [...groupOrScene.children];\n for (let item of items) {\n if (item.children && item.children.length > 0) {\n this.cleanupScene(item);\n }\n const { geometry, material, texture } = item;\n if (geometry) {\n geometry.dispose();\n }\n if (material) {\n material.dispose();\n }\n if (texture) {\n texture.dispose();\n }\n if (typeof item.dispose === 'function') {\n item.dispose();\n }\n groupOrScene.remove(item);\n }\n }", "clear() {\n this.groups = this.groups.slice(-1);\n this.groups[0].clear();\n this.emit('update');\n }", "clear() {\n if (this.score >= 50) {\n this.score -= 50;\n this.update_score();\n let sprite = app.stage.getChildAt(0);\n this.meteors.forEach(element => app.stage.removeChild(element));\n this.meteors.clear;\n }\n }", "destroy() {\n // unbind (texture) asset references\n for (const asset in this._assetReferences) {\n this._assetReferences[asset]._unbind();\n }\n this._assetReferences = null;\n\n super.destroy();\n }", "deleteGroup(group) { group.dispose(); }", "destroy() {\n for (var tileId in this._tiles) {\n if (this._tiles.hasOwnProperty(tileId)) {\n const tile = this._tiles[tileId];\n for (var i = 0, leni = tile.nodes.length; i < len; i++) {\n const node = tile.nodes[i];\n node._destroy();\n }\n putBatchingBuffer(tile.buffer);\n }\n }\n this.scene.camera.off(this._onCameraViewMatrix);\n for (var i = 0, len = this._layers.length; i < len; i++) {\n this._layers[i].destroy();\n }\n for (var i = 0, len = this._nodes.length; i < len; i++) {\n this._nodes[i]._destroy();\n }\n this.scene._aabbDirty = true;\n if (this._isModel) {\n this.scene._deregisterModel(this);\n }\n super.destroy();\n }", "clearEffects() {\n for (const i in this.sprites) {\n this.sprites[i].clearEffects();\n }\n }", "repaintListGC() {\n for (const id in G.repaintList) {\n const item = G.repaintList[id];\n // remove items that is not belongs to current scene\n if (item.sceneName !== G.sceneName) {\n // G.repaintList[id].sprite.destroy();\n delete G.repaintList[id];\n }\n }\n G.rootStage.removeChild(this.stage);\n // this.stage.destroy();\n }", "destroy(){\n\t\tthis._active = false\n\t\tthis.children.forEach(child => {\n\t\t\tif(child.type === 'GameObject' || child.type === 'GUIObject'){\n\t\t\t\tthis.remove(child)\n\t\t\t\tchild.destroy()\n\t\t\t\tdelete this[child]\n\t\t\t}\n\t\t})\n\t}", "function clearRandomizedPokemon(){\r\n for (var i = 0; i < groups.length; i++){\r\n var ul = document.getElementsByClassName(\"groups\")[i];\r\n if (ul) {\r\n while (ul.firstChild) {\r\n ul.removeChild(ul.firstChild);\r\n }\r\n }\r\n }\r\n}", "remove() {\n Food.container.removeChild(this.sprite);\n delete Food.list[this.id];\n }", "destroy() {\n this.eventListeners.dispose();\n this.tile.destroy();\n }", "_destroy() {\n const stack = [];\n if (this._root) {\n stack.push(this._root);\n }\n while (stack.length > 0) {\n for (const child of tile.children) {\n stack.push(child);\n }\n const tile = stack.pop();\n\n // TODO - Use this._destroyTile(tile); ?\n tile.destroy();\n }\n this._root = null;\n }", "clear() {\n this.canvas.clear();\n for (const id in this.imagesMapping) {\n delete this.imagesMapping[id];\n }\n this.imagesMapping = {};\n }", "clear() {\n const game = this.game;\n const world = game.world;\n const container = game.pixiAdapter.container;\n\n // Remove p2 constraints from the world\n for (let i = 0; i < this.constraints.length; i++) {\n world.removeConstraint(this.constraints[i]);\n }\n\n // Remove p2 bodies from the world and Pixi Containers from the stage\n for (let i = 0; i < this.bodies.length; i++) {\n world.removeBody(this.bodies[i]);\n container.removeChild(this.containers[i]);\n }\n }", "destroy()\n {\n this.removeAllListeners();\n if (this.parent)\n {\n this.parent.removeChild(this);\n }\n this.transform = null;\n\n this.parent = null;\n\n this._bounds = null;\n this._currentBounds = null;\n this._mask = null;\n\n this.filterArea = null;\n\n this.interactive = false;\n this.interactiveChildren = false;\n }", "unstageUnit(){\n this.image.parent.removeChild(this.image);\n this.healthBar.parent.removeChild(this.healthBar);\n }", "emptyPool() {\n for (var i in this.texturePool) {\n var textures = this.texturePool[i];\n if (textures) {\n for (var j = 0; j < textures.length; j++) {\n textures[j].destroy(true);\n }\n }\n }\n this.texturePool = {};\n }", "removeSprite(tag) {\n const layerNos = Object.keys(this.sprites);\n let emptyLayerNo = -1;\n layerNos.forEach(layerNo => {\n if (this.sprites[layerNo][tag] && this.spriteMap[tag]) {\n delete this.sprites[layerNo][tag];\n delete this.spriteMap[tag];\n } else {\n console.log(`sprite tag name ${tag} does not exist`);\n }\n if (this.sprites[layerNo].length === 0) {\n emptyLayerNo = layerNo;\n }\n });\n if (emptyLayerNo >= 0) {\n delete this.sprites[emptyLayerNo];\n }\n }", "destroy() {\n this._destroyed = true;\n\n if (typeof this.freeFromPool === 'function') {\n this.freeFromPool();\n }\n\n if (this.currentMap) {\n this.currentMap.removeObject(this);\n } else if (this.currentScene) {\n this.currentScene.removeObject(this);\n }\n\n this.children.forEach((child) => {\n child.destroy();\n });\n\n // triggers the wave end\n if (this.wave) {\n this.wave.remove(this);\n }\n }", "function removeSprite(sprite) {\n sprite.parent.removeChild(sprite);\n}", "destroy() {\n this.__anchors--;\n if (this.__anchors === 0) {\n this._program.destroy();\n Object.keys(this.textures).forEach(key => this.textures[key].destroy());\n }\n }", "function releaseSpells(){\n if(spellList.length > 0){\n //Go through all the spells in the spells group\n // and tween them to their targets\n var holdOnCaster;\n var moveToTarget;\n for(var index = 0; index < spellList.length; index++){\n //get the child, starting at the end of the group\n // and moving towards the first element\n var currentSpell = spellList[index].spell;\n //moves the spell on the screen, takes TIME_FOR_SPELLS amount of milliseconds\n holdOnCaster = game.add.tween(currentSpell).to({\n x: spellList[index].caster.x, \n y: spellList[index].caster.y\n }, \n TIME_FOR_SPELLS/2, null);\n moveToTarget = game.add.tween(currentSpell).to({\n x: spellList[index].target.x, \n y: spellList[index].target.y\n }, \n TIME_FOR_SPELLS/2, null);\n holdOnCaster.chain(moveToTarget);\n holdOnCaster.start();\n\n \n }\n \n //remove spell sprites from caster's group\n // after the last spell has finished tweening\n moveToTarget.onComplete.add(function(){\n\n spellList.forEach(function(val){\n var groupIndex = val.casterIndex;\n statScreen.MultiPlayer[groupIndex].PhaserGroup\n .removeChild(val.spell);\n }); \n\n //cleanup\n spellList = [];\n\n }, this);\n\n }\n \n}", "cleanup() {\n this.physicsEngine.cleanup(this.toClean);\n const gameInstance = this;\n this.toClean.forEach(function (name) {\n if (typeof gameInstance.objects[name] !== 'undefined') {\n delete gameInstance.objects[name];\n }\n });\n this.physicsEngine.cleanup(this.toClean);\n }", "destroy()\n {\n this.div = null;\n\n for (let i = 0; i < this.children.length; i++)\n {\n this.children[i].div = null;\n }\n\n window.document.removeEventListener('mousemove', this._onMouseMove);\n window.removeEventListener('keydown', this._onKeyDown);\n\n this.pool = null;\n this.children = null;\n this.renderer = null;\n }", "destroy() {\n //--calls super function cleaning up this scene--//\n super.destroy();\n //--if you generate any textures call destroy(true) on them to destroy the base texture--//\n //texture.destroy(true);\n }", "__destroy() {\n this.__removeChildren();\n this.__remove();\n }", "destroyEvents() {\n this.arena.player.config.destroyEvents();\n this.arena.player.sprite.remove();\n\n for (let creature in this.arena.monsters) {\n this.arena.monsters[creature].config.destroyEvents();\n this.arena.monsters[creature].sprite.remove();\n }\n }", "disposeAll() {\n let tilesBlocks = this.scene.getMeshesByTags('tilesBlock');\n\n for (let index = 0; index < tilesBlocks.length; index++) {\n tilesBlocks[index].dispose();\n }\n }", "function deleteAvatar(){\n scene.remove(avatar);\n mixers = [];\n AvatarMoveDirection = { x: 0, z: 0 };\n avatarLocalPos = { x: 0, z: 0 };\n}", "removeDead(){\n for(var i = 0; i < this.units.length; i++){\n if(this.units[i].isDead()){\n\n this.units[i].unitAnimations(\"Die\");\n //used to play the death animation for 4 seconds\n\n var deathEvent = this.game.time.addEvent({ delay: 3000, callback: this.destroyUnit,\n callbackScope: this, loop: false, args: [this.units[i]]});\n\n this.units.splice(i, 1);\n this.unitsAmount--;\n }\n }\n for(var i = 0; i < this.buildings.length; i++){\n let building = this.buildings[i];\n if(building.isDead()){\n building.destroy();\n building.bar.destroy();\n\n this.buildings.splice(i,1);\n this.buildingsAmount--;\n }\n }\n }", "function end() {\r\n bg.visible = false;\r\n monkey.visible = false;\r\n\r\n bananaGroup.destroyEach();\r\n stoneGroup.destroyEach();\r\n}", "destroy() {\n this.meshes.forEach(mesh => {\n mesh.destroy();\n });\n this.meshes.clear();\n this.lights.clear();\n this.__deleted = true;\n }", "clearGroupers() {\n this.groupers = null;\n }", "erasePlayer() {\n ctx.clearRect(this.positionX, this.positionY, this.height, this.width);\n }", "destroy()\n {\n super.destroy();\n\n this.tileScale = null;\n this._tileScaleOffset = null;\n this.tilePosition = null;\n\n this._uvs = null;\n }", "function endGame() {\n for (let index = 0; index < blockContainer.length; index++) {\n blockContainer[index].remove();\n holeContainer[index].remove();\n }\n\n blockContainer = [];\n holeContainer = [];\n\n ball.remove();\n clearInterval(playGameInterval);\n}", "removeAllChildren() {\n for (let i = 0; i < this.children.length; ++i) {\n this.children[i].destroy();\n }\n this.children.length = 0;\n }", "reset() {\n\t\tfor (let i = 0; i < this.tiles.length; i++) {\n\t\t\tthis.tiles[i].unsetPiece();\n\t\t}\n\t\tfor (let i = 0; i < this.whitePieces.length; i++) {\n\t\t\tthis.whitePieces[i].unsetTile();\n\t\t\tthis.whitePieces[i].animation = null;\n\t\t\tthis.blackPieces[i].unsetTile();\n\t\t\tthis.blackPieces[i].animation = null;\n\t\t}\n\t}", "function removeGroup() {\n if(group){\n var data = localStorage.getItem(\"groups\");\n if(data && data != null){\n var list = $.parseJSON(data);\n for(var i = 0; i < list.length; i++){\n var g = list[i];\n if(g.id == group.id){\n list.splice(i, 1);\n break;\n }\n }\n localStorage.setItem(\"groups\", JSON.stringify(list));\n $(\"#students-div\").hide();\n\t\t\tgroup = undefined;\n retrieveGroups();\n }\n }else{\n shakeElement(\"minus\");\n }\n}", "removeAllSpawnables(){\n\n let currentSpawnables = this.spawnables.children;\n let amntCurrentSpawnables = currentSpawnables.entries.length;\n\n // done manually to as iterate will miss some blocks off\n for(var currentSpawnableNum = 0; currentSpawnableNum < amntCurrentSpawnables; currentSpawnableNum++){\n let currentSpawnable = currentSpawnables.get(currentSpawnableNum);\n currentSpawnable.destroy();\n }\n\n // duplicate the array instead of passing by reference\n availableBlocks = JSON.parse(JSON.stringify( levelBaseBlocks ));\n this.munchkinSpawner.currentMunchkins = 0;\n // add to the calculation of score\n MainGameScene.gameStats.addToCount(\"resets\");\n this.updateUI()\n }", "destroy() {\n this.texture = null;\n this.matrix = null;\n }", "clearRasterCache() {\n // Destroy the PIXI sprite holding the raster texture data.\n if (this._pixiSprite) {\n this._pixiSprite.destroy(true);\n }\n\n this._pixiSprite = null; // Destroy the raster texture data.\n\n this._rasterImageData = null; // While we're at it, clear the dynamic text cache.\n\n for (var uuid in this._dynamicTextCache) {\n var dynamicText = this._dynamicTextCache[uuid];\n dynamicText.destroy(true);\n }\n\n this._dynamicTextCache = {};\n }", "destroy(astID) {\n\t\t// Remove the asteroid from data.asteroidsData and the canvas\n\t\tif (astID >= 0 && data.asteroidsData.length > 0 && data.canvas.asteroids.length > 0) {\n\t\t\tdata.asteroidsData.splice(astID, 1)\n\t\t\tdata.canvas.asteroids.splice(astID, 1)\n\n\t\t\t//Also remove the relative laser, if it was mining\n\t\t\tfor (let i = 0; i < data.canvas.lasers.length; i++) {\n\t\t\t\tif (data.canvas.lasers[i].uniqueID == this.uniqueID) {\n\t\t\t\t\tdata.canvas.lasers = []\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t} else {\n\t\t\t//TODO Throw error\n\t\t}\n\n\n\t\t// Animate explosion TODO\n\t\t// ...\n\n\t\t// Remove all relative pointers so CG can clean the memory\n\t}", "destroy() {\n this.removeAll();\n this.items = null;\n this._name = null;\n }", "RemoveParticleGroup(group) {\n this.m_particleGroups.splice(this.m_particleGroups.indexOf(group), 1);\n }", "clean() {\n this.removeItem(this.scene);\n }", "destroy()\n {\n this.#gameObject = null;\n }", "function destroyClouds() {\n\tgroupClouds.forEach(\n\t\tfunction(cloud) { groupClouds.remove(cloud, true); },\n\t\tthis\n\t);\n}", "destroyChildren() {\n while(this.children.length)\n this.children.shift().destroy();\n }", "destroy() {\n this.destroyTouchHook();\n this.div = null;\n for (var i = 0; i < this.children.length; i++) {\n this.children[i].div = null;\n }\n window.document.removeEventListener('mousemove', this._onMouseMove, true);\n window.removeEventListener('keydown', this._onKeyDown);\n this.pool = null;\n this.children = null;\n this.renderer = null;\n }", "destroy() {\n this.__anchors--;\n if (this.__anchors === 0) {\n this._context.gl.deleteTexture(this.location);\n }\n }", "destroyUnit(unit){\n unit.bar.destroy();\n unit.destroy();\n\n //if this is an ai kingdom, we need to remove any undefined units from the groups\n if(!this.isPlayer()){\n this.removeUndefinedFromGroups();\n }\n }", "function destroyShit() {\n for(var i = 0; i < characters.length; i++) {\n characters.remove(characters.children[i]);\n }\n for(var j = 0; j < yummy.length; j++) {\n yummy.remove(yummy.children[j]);\n }\n}", "resetObjects()\n {\n //remove rectangles for collidable bodies\n this.buttons.forEach(this.deleteBody, this, true);\n this.spikes.forEach(this.deleteBody, this, true);\n\n this.startdoors.destroy();\n this.enddoors.destroy();\n this.buttons.destroy();\n this.spikes.destroy();\n this.checkpoints.destroy();\n this.doors.destroy();\n }", "destroy() {\n this.children.forEach(mesh => mesh.destroy());\n }", "_destroyCachedDisplayObject() {\n this._cacheData.sprite._texture.destroy(true);\n this._cacheData.sprite = null;\n BaseTexture_1.BaseTexture.removeFromCache(this._cacheData.textureCacheId);\n Texture_1.Texture.removeFromCache(this._cacheData.textureCacheId);\n this._cacheData.textureCacheId = null;\n }", "function removeObjects(){\n\tfor(var n=0; n<gameData.planes.length;n++){\n\t\tvar curAirplane = gameData.planes[n];\n\t\tif(curAirplane.destroy){\n\t\t\tgameData.planes.splice(n,1);\n\t\t\tn = gameData.planes.length;\n\t\t}\n\t}\t\n}", "function editorDestroyAllMapObjects() {\n edPlayerStart.destroy();\n edPlayerStart = null;\n edExit.destroy();\n edExit = null;\n edTiles.forEach(o => {\n o.forEach(s => s.destroy());\n });\n edTiles = [];\n edEnemies.forEach(o => { if (o) o.destroy(); });\n edEnemies = [];\n edPickups.forEach(o => { if (o) o.destroy(); });\n edPickups = [];\n edSigns.forEach(o => { if (o) o.destroy(); });\n edSigns = [];\n}", "function createSpritesGroups()\n{\n\t//Defines the sprites groups information ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object):\n\t/*\n\t\tNote:\n\t\t\t1) Sprites groups, sprites and sub-sprites are always automatically ordered internally by their z-index (remember to use the 'setZIndex' method of each if you want to modify it). The elements of the scene will be rendered respecting this order.\n\t\t\t2) We will use 'duration' in the 'data' property to disable a sprite or sub-sprite (if it is set to null, it will never be disabled). If used in a 'CB_GraphicSprites' object, it will affect its current sprite being pointed.\n\t\t\t3) We will use the 'timeResetAndEnableAfter' in the 'data' property to enable again a sprite or sub-sprite (if it is set to null, it will never be enabled). It also resets the 'time' property of the sprite or sub-sprite. If used in a 'CB_GraphicSprites' object, it will affect its current sprite being pointed.\n\t\t\t4) We will use 'skipAfter' in the 'data' property of a sprite to jump to the next one (if it is set to null, it will never jump automatically). * If used in a 'CB_GraphicSprites' object, it will affect its current sprite being pointed.\n\t\t\t5) We can use 'beforeDrawing' and 'afterDrawing' callbacks defined in the 'data' object to be called before drawing an element or after doing it, respectively. For bitmaps, a 'beforeDrawingElement' callback can be used to call before drawing each map element.\n\t\t\t6) We can set 'onlyUseInMap' to true in the 'data' object to just draw that element when it is being drawn as a part of a map (a map is an element whose 'srcType' equals to 'CB_GraphicSprites.SRC_TYPES.MAP').\n\t\t\t7) We can set 'loop' to true in the 'data' object to loop sprites infinitely instead of stopping at the last one.\n\t\t\t8) We can set a number (which belongs to the index of a sprite) or a function returning a number in the 'pointerNext' property of the 'data' object to indicate the desired next sprite.\n\t\t\t9) We can set a desired canvas filter (similar to CSS filters) in the 'filter' property of the 'data' object.\n\t\t\t10) We can set 'positionAbsolute' to true in the 'data' object to do not have in mind the element's parent position to calculate the position of the element.\n\t\t\t11) We can set 'hidden' to true in the 'data' object to skip that element so it will not be drawn.\n\t\t\t12) To rotate an element, we can set the 'rotation' property in the 'data' object to rotate that element:\n\t\t\t\t* If the 'rotationUseDegrees' property is set to true, the value set in 'rotation' will be considered degrees, otherwise it will be considered radians.\n\t\t\t\t* To set the coordinates of the rotation axis (for rotation the canvas, internally), use the 'rotationX' and 'rotationY' properties. If any of them is not set, the rotation coordinate will be considered the center (horizontal or vertical) of the element.\n\t\t\t13) Some properties in the 'data' object can be either a static value or a callback function (as for example the 'style' property).\n\t\t\t14) The 'clearPreviousFirst' property in the 'data' object can be set to true to accomplish the following:\n\t\t\t\t* If it is a sprite, it will clean the space used by the previous sprite before drawing this sprite.\n\t\t\t\t* If it is a sub-sprite, it will clean the space that will be used by this sub-sprite.\n\t\t\t\t* If used in a 'CB_GraphicSprites' object, it will affect its current sprite being pointed.\n\t\t\t15) We can set the 'parseIntLeft' and 'parseIntTop' properties to true in the 'data' object to use integer numbers internally for the position of the elements when drawing them. This can prevent some problems as for example tile maps with tiles separated in some screen resolutions.\n\t\t\t16) We can set the 'avoidClearingCanvas' property to true in the 'data' object of the 'spritesGroupsData' to avoid clearing the canvas each cycle.\n\t*/\n\tvar spritesGroupsData =\n\t{\n\t\t//'my_sprites_groups_1' ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object). Some missing or non-valid properties will get a default value:\n\t\tid: \"my_sprites_groups_1\", //Identifier of the sprites groups object (also used for the 'CB_GraphicSpritesScene' object). Optional but recommended. It should be unique. By default, it is generated automatically.\n\t\tsrcWidth: 40, //The value for the \"srcWidth\" property which will be used as default if not provided (or the provided one was wrong) in the given 'CB_GraphicSprites.SPRITES_OBJECT' objects. Default: CB_GraphicSprites.WIDTH_SOURCE_DEFAULT.\n\t\tsrcHeight: 40, //The value for the \"srcHeight\" property which will be used as default if not provided (or the provided one was wrong) in the given 'CB_GraphicSprites.SPRITES_OBJECT' objects. Default: CB_GraphicSprites.HEIGHT_SOURCE_DEFAULT.\n\t\tdata: { skipAfter: null, duration: null, timeResetAndEnableAfter: null, loop: true, clearPreviousFirst: false }, //Object with any additional data desired which can be any kind. Default: { 'that' : CB_GraphicSprites.SPRITES_OBJECT, 'getThis' = function() { return this.that; } }.\n\t\t//Numeric array containing 'CB_GraphicSprites.SPRITES_OBJECT' objects with all the sprites groups that will be used (their \"parent\" property will be set to point the current 'CB_GraphicSpritesScene' object which contains them):\n\t\tspritesGroups:\n\t\t[\n\t\t\t//'bird_sprites' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object):\n\t\t\t{\n\t\t\t\tid: \"bird_sprites\", //Identifier of the sprites group (also used for the 'CB_GraphicSprites' object). Optional but recommended. It should be unique. If not provided, it will be calculated automatically.\n\t\t\t\tsrc: \"img/bird_sprites.gif\", //Source of origin. Can be a path or identifier of an image, text, bitmap, 3D object, etc. Optional but recommended. Default: this.parent.src || \"\".\n\t\t\t\tsrcWidth: 38, //Width of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcWidth || CB_GraphicSprites.WIDTH_SOURCE_DEFAULT.\n\t\t\t\tsrcHeight: 36, //Height of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcHeight || CB_GraphicSprites.HEIGHT_SOURCE_DEFAULT.\n\t\t\t\tleft: 300, //Left (horizontal) position in the destiny (inside the sprites group). Unit agnostic (only numeric values allowed). Default: CB_GraphicSprites.LEFT_DEFAULT.\n\t\t\t\twidth: 190, //Width of the destiny. Unit agnostic (only numeric values allowed). Default: this.parent.width || CB_GraphicSprites.WIDTH_DEFAULT.\n\t\t\t\theight: 160, //Height of the destiny. Unit agnostic (only numeric values allowed). Default: this.parent.height || CB_GraphicSprites.HEIGHT_DEFAULT.\n\t\t\t\t//Object with any additional data desired which can be any kind:\n\t\t\t\t//NOTE: it will always have a \"that\" property pointing to the 'CB_GraphicSprites.SPRITES_OBJECT' object where it belongs to and a function in its \"getThis\" property returning the same value (added automatically).\n\t\t\t\tdata: { skipAfter: 600, clearPreviousFirst: true, onlyUseInMap: false /* Set to true to only display in maps */ }, //Object with any additional data desired which can be any kind. Default: CB_combineJSON(this.parent.data, this.data) || this.parent.data || { 'that' : CB_GraphicSprites.SPRITES_OBJECT, 'getThis' = function() { return this.that; } }.\n\t\t\t\t//Numeric array containing 'CB_GraphicSprites.SPRITE_OBJECT' objects with all the sprites that will be used:\n\t\t\t\tsprites:\n\t\t\t\t[\n\t\t\t\t\t//'bird_sprite_1' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group:\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"bird_sprite_1\", //Identifier for the sprite. Optional but recommended. It should be unique. If not provided, it will be calculated automatically.\n\t\t\t\t\t\t//Numeric array containing 'CB_GraphicSprites.SUBSPRITE_OBJECT' objects with the sub-sprites that this sprite uses:\n\t\t\t\t\t\tsubSprites:\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t//'bird_sprite_1_subsprite_1' ('CB_GraphicSprites.SUBSPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the parent sprite:\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"bird_sprite_1_subsprite_1\", //Identifier for the sub-sprite. Optional but recommended. It should be unique. If not provided, it will be calculated automatically.\n\t\t\t\t\t\t\t\tsrc: \"img/sol.gif\",\n\t\t\t\t\t\t\t\tsrcLeft: 0, //Left (horizontal) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcLeft || CB_GraphicSprites.LEFT_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\tsrcTop: 0, //Top (vertical) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcTop || CB_GraphicSprites.TOP_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\tsrcWidth: 80, //Width of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcWidth || CB_GraphicSprites.WIDTH_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\tsrcHeight: 80, //Height of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcHeight || CB_GraphicSprites.HEIGHT_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\tleft: 20, //Left (horizontal) position in the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: CB_GraphicSprites.LEFT_DEFAULT.\n\t\t\t\t\t\t\t\ttop: 170, //Top (vertical) position in the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: CB_GraphicSprites.TOP_DEFAULT.\n\t\t\t\t\t\t\t\twidth: 40, //Width of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.width || CB_GraphicSprites.WIDTH_DEFAULT.\n\t\t\t\t\t\t\t\theight: 40, //Height of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.height || CB_GraphicSprites.HEIGHT_DEFAULT.\n\t\t\t\t\t\t\t\tdata: { duration: 200, timeResetAndEnableAfter: 200 },\n\t\t\t\t\t\t\t\tzIndex: 2\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t//'bird_sprite_1_subsprite_2' ('CB_GraphicSprites.SUBSPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the parent sprite:\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"bird_sprite_1_subsprite_2\", //Identifier for the sub-sprite. Optional but recommended. It should be unique. If not provided, it will be calculated automatically.\n\t\t\t\t\t\t\t\tsrc: \"img/seta.gif\",\n\t\t\t\t\t\t\t\tsrcLeft: 0, //Left (horizontal) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcLeft || CB_GraphicSprites.LEFT_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\tsrcTop: 0, //Top (vertical) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcTop || CB_GraphicSprites.TOP_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\tsrcWidth: 40, //Width of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcWidth || CB_GraphicSprites.WIDTH_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\tsrcHeight: 40, //Height of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcHeight || CB_GraphicSprites.HEIGHT_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\ttop: 200, //Top (vertical) position in the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: CB_GraphicSprites.TOP_DEFAULT.\n\t\t\t\t\t\t\t\twidth: 12, //Width of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.width || CB_GraphicSprites.WIDTH_DEFAULT.\n\t\t\t\t\t\t\t\theight: 12, //Height of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.height || CB_GraphicSprites.HEIGHT_DEFAULT.\n\t\t\t\t\t\t\t\tdata:\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tduration: null,\n\t\t\t\t\t\t\t\t\tbeforeDrawing:\n\t\t\t\t\t\t\t\t\t\tfunction(element, canvasContext, canvasBufferContext, useBuffer, CB_GraphicSpritesSceneObject, drawingMap, x, y, mapElement) //Called before drawing the element.\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tthis.height = this.width = this.width === 12 ? 15 : 12;\n\t\t\t\t\t\t\t\t\t\t\tif (drawingMap && this._attributes)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tthis.data._alternating = !this.data._alternating;\n\t\t\t\t\t\t\t\t\t\t\t\tthis._attributes.width = this.data._alternating ? 60 : 50;\n\t\t\t\t\t\t\t\t\t\t\t\tthis._attributes.height = this.data._alternating ? 90 : 80;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\treturn this; //Same as 'element'. Must return the element to draw. Return null to skip drawing it.\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tafterDrawing:\n\t\t\t\t\t\t\t\t\t\tfunction(element, canvasContext, canvasBufferContext, useBuffer, CB_GraphicSpritesSceneObject, drawingMap, x, y, mapElement, onDrawn) //Called after drawing the element.\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t//Here we could perform any tasks.\n\t\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}\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t//'bird_sprite_2' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group:\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"bird_sprite_2\", //Identifier for the sprite. Optional but recommended. It should be unique. If not provided, it will be calculated automatically.\n\t\t\t\t\t\tsrcLeft: 38, //Left (horizontal) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcLeft || CB_GraphicSprites.LEFT_SOURCE_DEFAULT.\n\t\t\t\t\t\t//Numeric array containing 'CB_GraphicSprites.SUBSPRITE_OBJECT' objects with the sub-sprites that this sprite uses:\n\t\t\t\t\t\tsubSprites:\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t//'bird_sprite_2_subsprite_1' ('CB_GraphicSprites.SUBSPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the parent sprite:\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"bird_sprite_2_subsprite_1\", //Identifier for the sub-sprite. Optional but recommended. It should be unique. If not provided, it will be calculated automatically.\n\t\t\t\t\t\t\t\tsrc: \"img/sol.gif\",\n\t\t\t\t\t\t\t\tsrcLeft: 0, //Left (horizontal) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcLeft || CB_GraphicSprites.LEFT_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\tsrcTop: 0, //Top (vertical) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcTop || CB_GraphicSprites.TOP_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\tsrcWidth: 80, //Width of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcWidth || CB_GraphicSprites.WIDTH_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\tsrcHeight: 80, //Height of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcHeight || CB_GraphicSprites.HEIGHT_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\tleft: 20, //Left (horizontal) position in the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: CB_GraphicSprites.LEFT_DEFAULT.\n\t\t\t\t\t\t\t\ttop: 170, //Top (vertical) position in the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: CB_GraphicSprites.TOP_DEFAULT.\n\t\t\t\t\t\t\t\twidth: 40, //Width of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.width || CB_GraphicSprites.WIDTH_DEFAULT.\n\t\t\t\t\t\t\t\theight: 40, //Height of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.height || CB_GraphicSprites.HEIGHT_DEFAULT.\n\t\t\t\t\t\t\t\tdata: { duration: 200, timeResetAndEnableAfter: 200 },\n\t\t\t\t\t\t\t\tzIndex: 2\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t//'bird_sprite_2_subsprite_1' ('CB_GraphicSprites.SUBSPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the parent sprite:\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"bird_sprite_2_subsprite_2\", //Identifier for the sub-sprite. Optional but recommended. It should be unique. If not provided, it will be calculated automatically.\n\t\t\t\t\t\t\t\tsrc: \"img/seta.gif\",\n\t\t\t\t\t\t\t\tsrcLeft: 0, //Left (horizontal) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcLeft || CB_GraphicSprites.LEFT_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\tsrcTop: 0, //Top (vertical) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcTop || CB_GraphicSprites.TOP_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\tsrcWidth: 40, //Width of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcWidth || CB_GraphicSprites.WIDTH_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\tsrcHeight: 40, //Height of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcHeight || CB_GraphicSprites.HEIGHT_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\ttop: 200, //Top (vertical) position in the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: CB_GraphicSprites.TOP_DEFAULT.\n\t\t\t\t\t\t\t\twidth: 12, //Width of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.width || CB_GraphicSprites.WIDTH_DEFAULT.\n\t\t\t\t\t\t\t\theight: 12, //Height of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.height || CB_GraphicSprites.HEIGHT_DEFAULT.\n\t\t\t\t\t\t\t\tdata: { duration: null }\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//'bird_sprite_3' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group:\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"bird_sprite_3\", //Identifier for the sprite. Optional but recommended. It should be unique. If not provided, it will be calculated automatically.\n\t\t\t\t\t\tsrcLeft: 38 * 2, //Left (horizontal) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcLeft || CB_GraphicSprites.LEFT_SOURCE_DEFAULT.\n\t\t\t\t\t\t//Numeric array containing 'CB_GraphicSprites.SUBSPRITE_OBJECT' objects with the sub-sprites that this sprite uses:\n\t\t\t\t\t\tsubSprites:\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t//'bird_sprite_2_subsprite_1' ('CB_GraphicSprites.SUBSPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the parent sprite:\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"bird_sprite_3_subsprite_1\", //Identifier for the sub-sprite. Optional but recommended. It should be unique. If not provided, it will be calculated automatically.\n\t\t\t\t\t\t\t\tsrc: \"img/sol.gif\",\n\t\t\t\t\t\t\t\tsrcLeft: 0, //Left (horizontal) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcLeft || CB_GraphicSprites.LEFT_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\tsrcTop: 0, //Top (vertical) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcTop || CB_GraphicSprites.TOP_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\tsrcWidth: 80, //Width of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcWidth || CB_GraphicSprites.WIDTH_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\tsrcHeight: 80, //Height of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcHeight || CB_GraphicSprites.HEIGHT_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\tleft: 20, //Left (horizontal) position in the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: CB_GraphicSprites.LEFT_DEFAULT.\n\t\t\t\t\t\t\t\ttop: 170, //Top (vertical) position in the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: CB_GraphicSprites.TOP_DEFAULT.\n\t\t\t\t\t\t\t\twidth: 40, //Width of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.width || CB_GraphicSprites.WIDTH_DEFAULT.\n\t\t\t\t\t\t\t\theight: 40, //Height of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.height || CB_GraphicSprites.HEIGHT_DEFAULT.\n\t\t\t\t\t\t\t\tdata: { duration: 200, timeResetAndEnableAfter: 200 },\n\t\t\t\t\t\t\t\tzIndex: 2\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t//'bird_sprite_2_subsprite_1' ('CB_GraphicSprites.SUBSPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the parent sprite:\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"bird_sprite_3_subsprite_2\", //Identifier for the sub-sprite. Optional but recommended. It should be unique. If not provided, it will be calculated automatically.\n\t\t\t\t\t\t\t\tsrc: \"img/seta.gif\",\n\t\t\t\t\t\t\t\tsrcLeft: 0, //Left (horizontal) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcLeft || CB_GraphicSprites.LEFT_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\tsrcTop: 0, //Top (vertical) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcTop || CB_GraphicSprites.TOP_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\tsrcWidth: 40, //Width of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcWidth || CB_GraphicSprites.WIDTH_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\tsrcHeight: 40, //Height of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcHeight || CB_GraphicSprites.HEIGHT_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\ttop: 200, //Top (vertical) position in the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: CB_GraphicSprites.TOP_DEFAULT.\n\t\t\t\t\t\t\t\twidth: 12, //Width of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.width || CB_GraphicSprites.WIDTH_DEFAULT.\n\t\t\t\t\t\t\t\theight: 12, //Height of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.height || CB_GraphicSprites.HEIGHT_DEFAULT.\n\t\t\t\t\t\t\t\tdata: { duration: null }\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//'bird_sprite_4' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group:\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"bird_sprite_4\", //Identifier for the sprite. Optional but recommended. It should be unique. If not provided, it will be calculated automatically.\n\t\t\t\t\t\tsrcLeft: 38 * 3, //Left (horizontal) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcLeft || CB_GraphicSprites.LEFT_SOURCE_DEFAULT.\n\t\t\t\t\t\t//Numeric array containing 'CB_GraphicSprites.SUBSPRITE_OBJECT' objects with the sub-sprites that this sprite uses:\n\t\t\t\t\t\tsubSprites:\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t//'bird_sprite_2_subsprite_1' ('CB_GraphicSprites.SUBSPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the parent sprite:\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"bird_sprite_4_subsprite_1\", //Identifier for the sub-sprite. Optional but recommended. It should be unique. If not provided, it will be calculated automatically.\n\t\t\t\t\t\t\t\tsrc: \"img/sol.gif\",\n\t\t\t\t\t\t\t\tsrcLeft: 0, //Left (horizontal) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcLeft || CB_GraphicSprites.LEFT_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\tsrcTop: 0, //Top (vertical) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcTop || CB_GraphicSprites.TOP_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\tsrcWidth: 80, //Width of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcWidth || CB_GraphicSprites.WIDTH_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\tsrcHeight: 80, //Height of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcHeight || CB_GraphicSprites.HEIGHT_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\tleft: 20, //Left (horizontal) position in the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: CB_GraphicSprites.LEFT_DEFAULT.\n\t\t\t\t\t\t\t\ttop: 170, //Top (vertical) position in the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: CB_GraphicSprites.TOP_DEFAULT.\n\t\t\t\t\t\t\t\twidth: 40, //Width of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.width || CB_GraphicSprites.WIDTH_DEFAULT.\n\t\t\t\t\t\t\t\theight: 40, //Height of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.height || CB_GraphicSprites.HEIGHT_DEFAULT.\n\t\t\t\t\t\t\t\tdata: { duration: 200, timeResetAndEnableAfter: 200 },\n\t\t\t\t\t\t\t\tzIndex: 2\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t//'bird_sprite_2_subsprite_4' ('CB_GraphicSprites.SUBSPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the parent sprite:\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"bird_sprite_4_subsprite_2\", //Identifier for the sub-sprite. Optional but recommended. It should be unique. If not provided, it will be calculated automatically.\n\t\t\t\t\t\t\t\tsrc: \"img/seta.gif\",\n\t\t\t\t\t\t\t\tsrcLeft: 0, //Left (horizontal) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcLeft || CB_GraphicSprites.LEFT_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\tsrcTop: 0, //Top (vertical) position in the original source (having in mind its real width and height). Unit agnostic (only numeric values allowed). Default: this.parent.srcTop || CB_GraphicSprites.TOP_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\tsrcWidth: 40, //Width of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcWidth || CB_GraphicSprites.WIDTH_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\tsrcHeight: 40, //Height of the original source. Unit agnostic (only numeric values allowed). Default: this.parent.srcHeight || CB_GraphicSprites.HEIGHT_SOURCE_DEFAULT.\n\t\t\t\t\t\t\t\ttop: 200, //Top (vertical) position in the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: CB_GraphicSprites.TOP_DEFAULT.\n\t\t\t\t\t\t\t\twidth: 12, //Width of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.width || CB_GraphicSprites.WIDTH_DEFAULT.\n\t\t\t\t\t\t\t\theight: 12, //Height of the destiny (inside the sprite). Unit agnostic (only numeric values allowed). Default: this.parent.height || CB_GraphicSprites.HEIGHT_DEFAULT.\n\t\t\t\t\t\t\t\tdata: { duration: null }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t//'panda_sprites' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object):\n\t\t\t{\n\t\t\t\tid: \"panda_sprites\", //Identifier of the sprites group (also used for the 'CB_GraphicSprites' object). Optional but recommended. It should be unique. If not provided, it will be calculated automatically.\n\t\t\t\twidth: 80, //Width of the destiny. Unit agnostic (only numeric values allowed). Default: this.parent.width || CB_GraphicSprites.WIDTH_DEFAULT.\n\t\t\t\theight: 80, //Height of the destiny. Unit agnostic (only numeric values allowed). Default: this.parent.height || CB_GraphicSprites.HEIGHT_DEFAULT.\n\t\t\t\tzIndex: 3, //The z-index for the destiny. Only numeric values allowed. Default: this.parent.zIndex || CB_GraphicSprites.ZINDEX_DEFAULT.\n\t\t\t\t//Object with any additional data desired which can be any kind:\n\t\t\t\t//NOTE: it will always have a \"that\" property pointing to the 'CB_GraphicSprites.SPRITES_OBJECT' object where it belongs to and a function in its \"getThis\" property returning the same value (added automatically).\n\t\t\t\tdata: { skipAfter: 500 }, //Object with any additional data desired which can be any kind. Default: CB_combineJSON(this.parent.data, this.data) || this.parent.data || { 'that' : CB_GraphicSprites.SPRITES_OBJECT, 'getThis' = function() { return this.that; } }.\n\t\t\t\t//Numeric array containing 'CB_GraphicSprites.SPRITE_OBJECT' objects with all the sprites that will be used:\n\t\t\t\tsprites:\n\t\t\t\t[\n\t\t\t\t\t//'panda_sprites_sprite_1' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group:\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"panda_sprites_sprite_1\", //Identifier for the sprite. Optional but recommended. It should be unique. If not provided, it will be calculated automatically.\n\t\t\t\t\t\tsrc: \"img/panda_1.gif\" //Source of origin. Can be a path or identifier of an image, text, bitmap, 3D object, etc. Optional but recommended. Default: this.parent.src || \"\".\n\t\t\t\t\t},\n\t\t\t\t\t//'panda_sprites_sprite_2' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group:\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"panda_sprites_sprite_2\", //Identifier for the sprite. Optional but recommended. It should be unique. If not provided, it will be calculated automatically.\n\t\t\t\t\t\tsrc: \"img/panda_2.gif\" //Source of origin. Can be a path or identifier of an image, text, bitmap, 3D object, etc. Optional but recommended. Default: this.parent.src || \"\".\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t//'ranisima_sprites' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object):\n\t\t\t{\n\t\t\t\tid: \"ranisima_sprites\", //Identifier of the sprites group (also used for the 'CB_GraphicSprites' object). Optional but recommended. It should be unique. If not provided, it will be calculated automatically.\n\t\t\t\tsrc: \"img/ranisima.gif\", //Source of origin. Can be a path or identifier of an image, text, bitmap, 3D object, etc. Optional but recommended. Default: this.parent.src || \"\".\n\t\t\t\tleft: 110, //Left (horizontal) position in the destiny (inside the sprites group). Unit agnostic (only numeric values allowed). Default: CB_GraphicSprites.LEFT_DEFAULT.\n\t\t\t\ttop: 80, //Top (vertical) position in the destiny (inside the sprites group). Unit agnostic (only numeric values allowed). Default: CB_GraphicSprites.TOP_DEFAULT.\n\t\t\t\twidth: 160, //Width of the destiny. Unit agnostic (only numeric values allowed). Default: this.parent.width || CB_GraphicSprites.WIDTH_DEFAULT.\n\t\t\t\theight: 160, //Height of the destiny. Unit agnostic (only numeric values allowed). Default: this.parent.height || CB_GraphicSprites.HEIGHT_DEFAULT.\n\t\t\t\tzIndex: 2, //The z-index for the destiny. Only numeric values allowed. Default: this.parent.zIndex || CB_GraphicSprites.ZINDEX_DEFAULT.\n\t\t\t\tdata:\n\t\t\t\t{\n\t\t\t\t\trotation: 0,\n\t\t\t\t\trotationX: undefined,\n\t\t\t\t\trotationY: undefined,\n\t\t\t\t\trotationUseDegrees: true,\n\t\t\t\t\tduration: 1000,\n\t\t\t\t\ttimeResetAndEnableAfter: 250,\n\t\t\t\t\tclearPreviousFirst: true,\n\t\t\t\t\topacity: 0.2,\n\t\t\t\t\tbeforeDrawing:\n\t\t\t\t\t\tfunction(element, canvasContext, canvasBufferContext, useBuffer, CB_GraphicSpritesSceneObject, drawingMap, x, y, mapElement) //Called before drawing the element.\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\telement.data.rotation++;\n\t\t\t\t\t\t\treturn element; //Same as 'element'. Must return the element to draw. Return null to skip drawing it.\n\t\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t//Numeric array containing 'CB_GraphicSprites.SPRITE_OBJECT' objects with all the sprites that will be used:\n\t\t\t\tsprites:\n\t\t\t\t[\n\t\t\t\t\t//'ranisima_sprites_sprite_1' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group:\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"ranisima_sprites_sprite_1\" //Identifier for the sprite. Optional but recommended. It should be unique. If not provided, it will be calculated automatically.\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t//'text_group' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object):\n\t\t\t{\n\t\t\t\tid: \"text_group\",\n\t\t\t\tsrcType: CB_GraphicSprites.SRC_TYPES.TEXT,\n\t\t\t\tzIndex: 3,\n\t\t\t\tdata: { skipAfter: 2000, clearPreviousFirst: true },\n\t\t\t\tsprites:\n\t\t\t\t[\n\t\t\t\t\t//'text_1' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group:\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"text_1\",\n\t\t\t\t\t\tsrc: \"Hello, CrossBrowdy!\",\n\t\t\t\t\t\tleft: 100,\n\t\t\t\t\t\ttop: 24,\n\t\t\t\t\t\tdata:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfontSize: \"26px\",\n\t\t\t\t\t\t\tfontFamily: \"courier\",\n\t\t\t\t\t\t\tstyle: \"#ffff00\",\n\t\t\t\t\t\t\tfontStyle: \"normal\",\n\t\t\t\t\t\t\tfontVariant: \"normal\",\n\t\t\t\t\t\t\tfontWeight: \"bold\",\n\t\t\t\t\t\t\tcaption: null,\n\t\t\t\t\t\t\tsmallCaption: null,\n\t\t\t\t\t\t\ticon: null,\n\t\t\t\t\t\t\tmenu: null,\n\t\t\t\t\t\t\tmessageBox: null,\n\t\t\t\t\t\t\tstatusBar: null\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t//'text_2' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group:\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"text_2\",\n\t\t\t\t\t\tsrc: \"Stroke text\",\n\t\t\t\t\t\tleft: 100,\n\t\t\t\t\t\ttop: 60,\n\t\t\t\t\t\tdata:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfontSize: \"48px\",\n\t\t\t\t\t\t\tfontFamily: \"arial\",\n\t\t\t\t\t\t\tstyle: \"#ff0000\",\n\t\t\t\t\t\t\tstroke: true,\n\t\t\t\t\t\t\tfontStyle: \"italic\",\n\t\t\t\t\t\t\tfontVariant: \"small-caps\",\n\t\t\t\t\t\t\tfontWeight: \"lighter\",\n\t\t\t\t\t\t\tcaption: null,\n\t\t\t\t\t\t\tsmallCaption: null,\n\t\t\t\t\t\t\ticon: null,\n\t\t\t\t\t\t\tmenu: null,\n\t\t\t\t\t\t\tmessageBox: null,\n\t\t\t\t\t\t\tstatusBar: null\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//'fps_group' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object):\n\t\t\t{\n\t\t\t\tid: \"fps_group\",\n\t\t\t\tsrcType: CB_GraphicSprites.SRC_TYPES.TEXT,\n\t\t\t\tzIndex: 3,\n\t\t\t\tsprites:\n\t\t\t\t[\n\t\t\t\t\t//'fps' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group:\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"fps\",\n\t\t\t\t\t\tsrc: \"FPS: Calculating...\",\n\t\t\t\t\t\tleft: 110,\n\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\tdata:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfontSize: \"26px\",\n\t\t\t\t\t\t\tfontFamily: \"courier\",\n\t\t\t\t\t\t\tstyle: \"#aa00dd\",\n\t\t\t\t\t\t\tfontStyle: \"normal\",\n\t\t\t\t\t\t\tfontVariant: \"normal\",\n\t\t\t\t\t\t\tfontWeight: \"bold\",\n\t\t\t\t\t\t\tcaption: null,\n\t\t\t\t\t\t\tsmallCaption: null,\n\t\t\t\t\t\t\ticon: null,\n\t\t\t\t\t\t\tmenu: null,\n\t\t\t\t\t\t\tmessageBox: null,\n\t\t\t\t\t\t\tstatusBar: null\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//'pixel_group' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object):\n\t\t\t{\n\t\t\t\tid: \"pixel_group\",\n\t\t\t\tsrcType: CB_GraphicSprites.SRC_TYPES.PIXEL,\n\t\t\t\tsprites:\n\t\t\t\t[\n\t\t\t\t\t//'pixel_1' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group:\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"pixel_1\",\n\t\t\t\t\t\tleft: 85,\n\t\t\t\t\t\ttop: 25,\n\t\t\t\t\t\tdata:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tstyle: \"#ff00ff\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsubSprites:\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"pixel_1_subsprite_1\",\n\t\t\t\t\t\t\t\ttop: 2\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"pixel_1_subsprite_2\",\n\t\t\t\t\t\t\t\ttop: 4\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"pixel_1_subsprite_3\",\n\t\t\t\t\t\t\t\ttop: 6\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"pixel_1_subsprite_4\",\n\t\t\t\t\t\t\t\ttop: 8\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t//'rectangle_group' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object):\n\t\t\t{\n\t\t\t\tid: \"rectangle_group\",\n\t\t\t\tsrcType: CB_GraphicSprites.SRC_TYPES.RECTANGLE,\n\t\t\t\tsprites:\n\t\t\t\t[\n\t\t\t\t\t//'rectangle_1' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group:\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"rectangle_1\",\n\t\t\t\t\t\tleft: 400,\n\t\t\t\t\t\ttop: 170,\n\t\t\t\t\t\twidth: 60,\n\t\t\t\t\t\theight: 60,\n\t\t\t\t\t\tdata:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tstyle: \"#00aa00\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsubSprites:\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"rectangle_1_subsprite_1\",\n\t\t\t\t\t\t\t\tleft: 70,\n\t\t\t\t\t\t\t\tdata:\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tstyle:\n\t\t\t\t\t\t\t\t\tfunction(element, canvasContext, canvasBufferContext, userBuffer)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar gradient = canvasContext.createLinearGradient(element.left, element.top, element.left + element.width, element.top + element.height);\n\t\t\t\t\t\t\t\t\t\tgradient.addColorStop(0, \"#aa0000\");\n\t\t\t\t\t\t\t\t\t\tgradient.addColorStop(1, \"#aaaa00\");\n\t\t\t\t\t\t\t\t\t\treturn gradient;\n\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},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"rectangle_1_subsprite_2\",\n\t\t\t\t\t\t\t\tleft: 140,\n\t\t\t\t\t\t\t\tdata:\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tstroke: true,\n\t\t\t\t\t\t\t\t\tstyle:\n\t\t\t\t\t\t\t\t\tfunction(element, canvasContext, canvasBufferContext, userBuffer)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar gradient = canvasContext.createLinearGradient(element.left, element.top, element.left + element.width, element.top + element.height);\n\t\t\t\t\t\t\t\t\t\tgradient.addColorStop(0, \"#00aa00\");\n\t\t\t\t\t\t\t\t\t\tgradient.addColorStop(1, \"#00ffaa\");\n\t\t\t\t\t\t\t\t\t\treturn gradient;\n\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},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"rectangle_1_subsprite_3\",\n\t\t\t\t\t\t\t\tleft: 210,\n\t\t\t\t\t\t\t\tdata:\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tfilter: \"sepia(1)\", //Adds the desired filter.\n\t\t\t\t\t\t\t\t\tstyle:\n\t\t\t\t\t\t\t\t\tfunction(element, canvasContext, canvasBufferContext, userBuffer)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar src = \"img/seta.gif\";\n\t\t\t\t\t\t\t\t\t\tvar image = CB_REM._IMAGES_CACHE[src];\n\t\t\t\t\t\t\t\t\t\tif (!image)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\timage = new Image()\n\t\t\t\t\t\t\t\t\t\t\timage.src = src;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn canvasContext.createPattern(image, 'repeat');\n\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}\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//'circle_group' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object):\n\t\t\t{\n\t\t\t\tid: \"circle_group\",\n\t\t\t\tsrcType: CB_GraphicSprites.SRC_TYPES.CIRCLE,\n\t\t\t\tdata: { radius: 30, style: \"#00aa00\", opacity: 0.5 },\n\t\t\t\tsprites:\n\t\t\t\t[\n\t\t\t\t\t//'circle_1' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group:\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"circle_1\",\n\t\t\t\t\t\tleft: 35,\n\t\t\t\t\t\ttop: 120,\n\t\t\t\t\t\tsubSprites:\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"circle_1_subsprite_1\",\n\t\t\t\t\t\t\t\ttop: 70,\n\t\t\t\t\t\t\t\tdata:\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tstyle:\n\t\t\t\t\t\t\t\t\tfunction(element, canvasContext, canvasBufferContext, userBuffer)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar gradient = canvasContext.createRadialGradient(element.left, element.top, 10, element.left + 10, element.top + 10, 80);\n\t\t\t\t\t\t\t\t\t\tgradient.addColorStop(0, \"red\");\n\t\t\t\t\t\t\t\t\t\tgradient.addColorStop(0.5, \"black\");\n\t\t\t\t\t\t\t\t\t\treturn gradient;\n\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},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"circle_1_subsprite_2\",\n\t\t\t\t\t\t\t\ttop: 140,\n\t\t\t\t\t\t\t\tdata: { style: \"#aa0000\", stroke: true }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t//'arc_group' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object):\n\t\t\t{\n\t\t\t\tid: \"arc_group\",\n\t\t\t\tsrcType: CB_GraphicSprites.SRC_TYPES.ARC,\n\t\t\t\tdata: { radius: 10, startAngle: 2, endAngle: 11, style: \"#00aa00\" },\n\t\t\t\tsprites:\n\t\t\t\t[\n\t\t\t\t\t//'arc_1' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group:\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"arc_1\",\n\t\t\t\t\t\tleft: 80,\n\t\t\t\t\t\ttop: 150,\n\t\t\t\t\t\tsubSprites:\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"arc_1_subsprite_1\",\n\t\t\t\t\t\t\t\ttop: 30\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"arc_1_subsprite_2\",\n\t\t\t\t\t\t\t\ttop: 60,\n\t\t\t\t\t\t\t\tdata: { style: \"#aa0000\", stroke: true }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t//'ellipse_group' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object):\n\t\t\t{\n\t\t\t\tid: \"ellipse_group\",\n\t\t\t\tsrcType: CB_GraphicSprites.SRC_TYPES.ELLIPSE,\n\t\t\t\tdata: { radiusX: 3, radiusY: 8, ellipseRotation: 20, startAngle: 2, endAngle: 11, anticlockwise: false, style: \"#00aa00\" },\n\t\t\t\tsprites:\n\t\t\t\t[\n\t\t\t\t\t//'ellipse_1' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group:\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"ellipse_1\",\n\t\t\t\t\t\tleft: 350,\n\t\t\t\t\t\ttop: 100,\n\t\t\t\t\t\tsubSprites:\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"ellipse_1_subsprite_1\",\n\t\t\t\t\t\t\t\ttop: 20\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"ellipse_1_subsprite_2\",\n\t\t\t\t\t\t\t\ttop: 40,\n\t\t\t\t\t\t\t\tdata: { style: \"#aa0000\", stroke: true }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t//'triangle_group' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object):\n\t\t\t{\n\t\t\t\tid: \"triangle_group\",\n\t\t\t\tsrcType: CB_GraphicSprites.SRC_TYPES.TRIANGLE,\n\t\t\t\tdata: { x1: 3, y1: 8, x2: 20, y2: 2, style: \"#00aa00\" }, //The (x1, y1) and (x2, y2) points are relative to the element left and top.\n\t\t\t\tsprites:\n\t\t\t\t[\n\t\t\t\t\t//'triangle_1' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group:\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"triangle_1\",\n\t\t\t\t\t\tleft: 370,\n\t\t\t\t\t\ttop: 190,\n\t\t\t\t\t\tsubSprites:\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"triangle_1_subsprite_1\",\n\t\t\t\t\t\t\t\ttop: 20\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"triangle_1_subsprite_2\",\n\t\t\t\t\t\t\t\ttop: 40,\n\t\t\t\t\t\t\t\tdata: { style: \"#aa0000\", stroke: true }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t//'segment_group' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object):\n\t\t\t{\n\t\t\t\tid: \"segment_group\",\n\t\t\t\tsrcType: CB_GraphicSprites.SRC_TYPES.SEGMENT,\n\t\t\t\twidth: 10,\n\t\t\t\tdata: { x1: 3, y1: 8, x2: 200, y2: 20, style: \"#00aa00\" }, //The (x1, y1) and (x2, y2) points are relative to the element left and top.\n\t\t\t\tsprites:\n\t\t\t\t[\n\t\t\t\t\t//'segment_1' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group:\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"segment_1\",\n\t\t\t\t\t\tleft: 370,\n\t\t\t\t\t\ttop: 250,\n\t\t\t\t\t\tsubSprites:\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"segment_1_subsprite_1\",\n\t\t\t\t\t\t\t\ttop: 20\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"segment_1_subsprite_2\",\n\t\t\t\t\t\t\t\ttop: 40,\n\t\t\t\t\t\t\t\tdata: { style: \"#aa0000\" }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t//'bezier_curve_group' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object):\n\t\t\t{\n\t\t\t\tid: \"bezier_curve_group\",\n\t\t\t\tsrcType: CB_GraphicSprites.SRC_TYPES.BEZIER_CURVE,\n\t\t\t\twidth: 5,\n\t\t\t\tdata: { x1: 0, y1: 50, x2: 220, y2: 20, x3: 100, y3: 10, style: \"#00aa00\" }, //The (x1, y1), (x2, y2) and (x3, y3) points are relative to the element left and top.\n\t\t\t\tsprites:\n\t\t\t\t[\n\t\t\t\t\t//'bezier_curve_1' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group:\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"bezier_curve_1\",\n\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\ttop: 280,\n\t\t\t\t\t\tsubSprites:\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"bezier_curve_1_subsprite_1\",\n\t\t\t\t\t\t\t\ttop: 30\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"bezier_curve_1_subsprite_2\",\n\t\t\t\t\t\t\t\ttop: 60,\n\t\t\t\t\t\t\t\tdata: { style: \"#aa0000\" }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t//'quadratic_bezier_curve_group' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object):\n\t\t\t{\n\t\t\t\tid: \"quadratic_bezier_curve_group\",\n\t\t\t\tsrcType: CB_GraphicSprites.SRC_TYPES.QUADRATIC_BEZIER_CURVE,\n\t\t\t\twidth: 2,\n\t\t\t\tdata: { x1: 0, y1: 50, x2: 220, y2: 20, style: \"#00aa00\" }, //The (x1, y1) and (x2, y2) points are relative to the element left and top.\n\t\t\t\tsprites:\n\t\t\t\t[\n\t\t\t\t\t//'quadratic_bezier_curve_1' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group:\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"quadratic_bezier_curve_1\",\n\t\t\t\t\t\tleft: 150,\n\t\t\t\t\t\ttop: 250,\n\t\t\t\t\t\tsubSprites:\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"quadratic_bezier_curve_1_subsprite_1\",\n\t\t\t\t\t\t\t\ttop: 30\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: \"quadratic_bezier_curve_1_subsprite_2\",\n\t\t\t\t\t\t\t\ttop: 60,\n\t\t\t\t\t\t\t\tdata: { style: \"#aa0000\" }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t//'bitmap_group' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object):\n\t\t\t{\n\t\t\t\tid: \"bitmap_group\",\n\t\t\t\tsrcType: CB_GraphicSprites.SRC_TYPES.BITMAP,\n\t\t\t\ttop: 340,\n\t\t\t\tleft: 300,\n\t\t\t\twidth: 10, //It will be updated when calling 'beforeDrawingElement'.\n\t\t\t\theight: 10, //It will be updated when calling 'beforeDrawingElement'.\n\t\t\t\tdata:\n\t\t\t\t{\n\t\t\t\t\tbeforeDrawingElement:\n\t\t\t\t\t\tfunction(element, canvasContext, canvasBufferContext, useBuffer, CB_GraphicSpritesSceneObject, drawingMap, x, y, mapElement) //Called before drawing the element. The 'element' and 'mapElement' will be the same.\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.width = 30;\n\t\t\t\t\t\t\tthis.height = 20;\n\t\t\t\t\t\t\treturn this; //Same as 'element'. Must return the element to draw. Return null to skip drawing it.\n\t\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tsprites:\n\t\t\t\t[\n\t\t\t\t\t//Maps with string aliases:\n\t\t\t\t\t//'bitmap_current' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group:\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"bitmap_current\", //Current map which will be displayed (it will be modified according to the position of the player and the other elements).\n\t\t\t\t\t\tsrc:\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t[\ttrue,\ttrue,\ttrue,\ttrue,\ttrue\t],\n\t\t\t\t\t\t\t[\ttrue,\tfalse,\ttrue,\tfalse,\ttrue\t],\n\t\t\t\t\t\t\t[\ttrue,\tfalse,\ttrue,\tfalse,\ttrue\t]\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//'map_group' ('CB_GraphicSprites.SPRITES_OBJECT' object). Some missing or non-valid properties will will be inherited from the parent ('CB_GraphicSpritesScene.SPRITES_GROUPS_OBJECT' object):\n\t\t\t{\n\t\t\t\tid: \"map_group\",\n\t\t\t\tsrc: //Map with string aliases:\n\t\t\t\t[\n\t\t\t\t\t[ \"#\", \"$\", \"@\", \"#\", \"\", \"@\", \"\", \"|\", \"!\" ],\n\t\t\t\t\t[ 3, \"%\", \"#\", \"@\", \"#\", \"@\", \"!\", \"\", 1 ]\n\t\t\t\t],\n\t\t\t\tsrcType: CB_GraphicSprites.SRC_TYPES.MAP,\n\t\t\t\tleft: 20,\n\t\t\t\ttop: 400,\n\t\t\t\twidth: 20,\n\t\t\t\theight: 20,\n\t\t\t\tdata:\n\t\t\t\t{\n\t\t\t\t\t//References sprites or sub-sprites by their index or identifier. Define a \"parentId\" (parent identifier of the 'CB_GraphicSprites' object or of the 'CB_GraphicSprites.SPRITE_OBJECT' object) to improve performance.\n\t\t\t\t\telementsData:\n\t\t\t\t\t{\n\t\t\t\t\t\t//Each property name is an alias which can be used in the map (in the \"src\" property).\n\t\t\t\t\t\t\"1\" : { index: 1, leftDependsOnPreviousElement: true, topDependsOnPreviousElement: true, parentId: \"circle_1\" }, //Has in mind the position of the last element to calculate its left and top.\n\t\t\t\t\t\t\"3\" : { index: 3, leftDependsOnPreviousElement: true, topDependsOnUpperElement: true, parentId: \"bird_sprites\" }, //Has in mind the position of the last element to calculate its left but to calculate its top has in mind the element above.\n\t\t\t\t\t\t\"|\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: \"bird_sprites\",\n\t\t\t\t\t\t\tleftDependsOnPreviousElement: true, //Has in mind the left position of the last element to calculate its left.\n\t\t\t\t\t\t\ttopDependsOnPreviousElement: true //Has in mind the top position of the last element to calculate its top.\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"@\": { id: \"panda_sprites_sprite_1\" },\n\t\t\t\t\t\t\"#\": { id: \"panda_sprites_sprite_2\" },\n\t\t\t\t\t\t\"$\": //If defined left and/or top, the position will always be that one (fixed).\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: \"bird_sprite_2_subsprite_1\",\n\t\t\t\t\t\t\twidth: 120,\n\t\t\t\t\t\t\theight: 50,\n\t\t\t\t\t\t\tleft: function(alias, element, elementData, elementMapParent, elementLoopLeftNext, x, y) { return 500; }, //It can be either a number or a function returning a number. The function will be called before drawing the element (sprite or sub-sprite) in each loop.\n\t\t\t\t\t\t\ttop: 0, //It can be either a number or a function returning a number. The function will be called before drawing the element (sprite or sub-sprite) in each loop.\n \t\t\t\t\t\t\t//Renews the internal cache by creating a new copy of the cached element ('CB_GraphicSprites', 'CB_GraphicSprites.SPRITE_OBJECT' or 'CB_GraphicSprites.SUBSPRITE_OBJECT') every time it is rendered:\n\t\t\t\t\t\t\trenewCache: true\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"%\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: \"bird_sprite_1\",\n \t\t\t\t\t\t\t//Renews the internal cache by creating a new copy of the cached element ('CB_GraphicSprites', 'CB_GraphicSprites.SPRITE_OBJECT' or 'CB_GraphicSprites.SUBSPRITE_OBJECT') every time it is rendered:\n\t\t\t\t\t\t\trenewCache: true,\n\t\t\t\t\t\t\tdestroyOnRewnew: true //Destroys the previous stored element before renewing the internal cache.\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"!\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: \"bird_sprite_1_subsprite_2\",\n\t\t\t\t\t\t\twidth: function(alias, element, elementData, elementMapParent, elementLoopWidthDefault, x, y) { return 50; }, //It can be either a number or a function returning a number. The function will be called before drawing the element (sprite or sub-sprite) in each loop.\n\t\t\t\t\t\t\theight: 80, //It can be either a number or a function returning a number. The function will be called before drawing the element (sprite or sub-sprite) in each loop.\n\t\t\t\t\t\t\tleftDependsOnPreviousElement: true, //Has in mind the left position of the last element to calculate its left.\n\t\t\t\t\t\t\ttopDependsOnPreviousElement: true, //Has in mind the top position of the last element to calculate its top.\n \t\t\t\t\t\t\t//Renews the internal cache by creating a new copy of the cached element ('CB_GraphicSprites', 'CB_GraphicSprites.SPRITE_OBJECT' or 'CB_GraphicSprites.SUBSPRITE_OBJECT') every time it is rendered:\n\t\t\t\t\t\t\trenewCache: true\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\telementsWidth: 40, //It can be either a number or a function returning a number. The function will be called before drawing the element (sprite or sub-sprite) in each loop.\n\t\t\t\t\telementsHeight: function(alias, element, elementData, elementMapParent, elementLoopHeightDefault, x, y) { return 50; }, //It can be either a number or a function returning a number. The function will be called before drawing the element (sprite or sub-sprite) in each loop.\n\t\t\t\t\t/*\n\t\t\t\t\t\tNote:\n\t\t\t\t\t\t\tThe \"elementsLeft\" and \"elementsTop\" properties can also be defined and can be either a number or a function returning a number. The function will be called before drawing the element (sprite or sub-sprite) in each loop.\n\t\t\t\t\t\t\tUncomment them try:\n\t\t\t\t\t*/\n\t\t\t\t\t//elementsLeft: function(alias, element, elementData, elementMapParent, elementLoopLeftNext, x, y) { return 200; },\n\t\t\t\t\t//elementsTop: 20,\n\t\t\t\t\tskipAfter: 5000\n\t\t\t\t},\n\t\t\t\tsprites:\n\t\t\t\t[\n\t\t\t\t\t//'map_1' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group:\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"map_1\"\n\t\t\t\t\t},\n\t\t\t\t\t//'map_2' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group:\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"map_2\",\n\t\t\t\t\t\tsrc:\n\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]\n\t\t\t\t\t},\n\t\t\t\t\t//'map_3' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group:\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"map_3\",\n\t\t\t\t\t\tleft: 120,\n\t\t\t\t\t\ttop: 100\n\t\t\t\t\t},\n\t\t\t\t\t//'map_4' ('CB_GraphicSprites.SPRITE_OBJECT' object). Some missing or non-valid properties will be inherited from the sprites group:\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"map_4\",\n\t\t\t\t\t\tleft: 120,\n\t\t\t\t\t\ttop: 100,\n\t\t\t\t\t\tsrc:\n\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]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t]\n\t };\n\n\t//Creates the graphic sprites object:\n\treturn new CB_GraphicSpritesScene(spritesGroupsData);\t\n}", "destroy() {\n\t\t\n\t\tthis.menuItems.forEach((item) => {\n\t\t\titem.destroy();\n\t\t});\n\t\tthis.menuItems = null;\n\t\t\n\t\tthis.container.parentNode.removeChild(this.container);\n\t\tthis.container = null;\n\t}", "destroy () {\n this.canvas.removeEventListener('mousedown', this.onMouseDown.bind(this));\n document.removeEventListener('mousemove', this.onMouseMove.bind(this));\n document.removeEventListener('mouseup', this.onMouseUp.bind(this));\n }", "destroy() {\n super.destroy();\n this.weapons.forEach(weapon => {\n weapon.destroy();\n });\n }", "deconstruct () {\r\n this.removeChild(this.title)\r\n\r\n for (let button of this.buttons) {\r\n this.removeChild(button)\r\n }\r\n\r\n for (let axis of this.axis) {\r\n this.removeChild(axis)\r\n }\r\n }", "unload() {\n\t\tthis.currentlyUpdatingTile = null;\n\t\tthis.tilesForTextureUpdate = [];\n\t\tthis.tiles = [];\n\t}", "dispose() {\n if (this.svgGroup_) {\n Blockly.utils.dom.removeNode(this.svgGroup_);\n }\n for (const event of this.boundEvents_) {\n Blockly.browserEvents.unbind(event);\n }\n this.boundEvents_.length = 0;\n }", "destroy() {\n let index = SmartCanvas.collection.indexOf(this);\n\n /* istanbul ignore else */\n if (~index) {\n SmartCanvas.collection.splice(index, 1);\n }\n\n this.context.clearRect(\n -this.drawX,\n -this.drawY,\n this.drawWidth,\n this.drawHeight\n );\n\n // dereference all created elements\n this.context.max = null;\n delete this.context.max;\n\n this.context.maxRadius = null;\n delete this.context.maxRadius;\n\n this.context = null;\n this.contextClone = null;\n this.elementClone = null;\n this.element = null;\n\n /**\n * On canvas redraw event callback\n *\n * @type {function|null|undefined}\n */\n this.onRedraw = null;\n }", "function destroyBrick(){\n for(var i=0;i<bricks.length;i++){\n if(checkCollision(ball,bricks[i])){\n ball.speedY = -ball.speedY;\n createBonus(bricks[i]);\n bricks.splice(i,1);\n }\n }\n }", "clean(scene, objs, key){\n for(let i = 0; i < objs.length; i++){\n if(objs[i].key === key){\n objs.splice(i, 1);\n }\n }\n scene.remove(this.playerObj || this);\n }", "function UnspawnAll()\n{\n\tfor(var obj : Object in all)\n\t{\n\t\tif((obj as GameObject).active)\n\t\t{\n\t\t\tUnspawn(obj as GameObject);\n\t\t}\n\t}\n}", "clear() {\n for (let x = 0; x < this._width; x++) {\n for (let y = 0; y < this._height; y++) {\n this.getTile(x, y).backgroundImage = \"\";\n this.getTile(x, y).transform = \"\";\n this.getTile(x, y).color = \"#eeeeee\";\n }\n }\n }", "clear() {\n for (let x = 0; x < this._width; x++) {\n for (let y = 0; y < this._height; y++) {\n this.getTile(x, y).backgroundImage = \"\";\n this.getTile(x, y).transform = \"\";\n this.getTile(x, y).color = \"#eeeeee\";\n }\n }\n }", "function clearScene() {\n for (var i = scene.children.length - 1; i >= 0; --i) {\n var obj = scene.children[i];\n scene.remove(obj);\n }\n}", "dispose() {\n if (this.svgGroup_) {\n dom.removeNode(this.svgGroup_);\n }\n }", "clear() {\n this.stop();\n this.scene.remove.apply(this.scene, this.scene.children);\n this.scene.background = null;\n this.mixers.splice(0, this.mixers.length);\n this.sceneMeshes.splice(0, this.sceneMeshes.length);\n $(\"#picker\").spectrum(\"hide\");\n }", "function removeSpriteFromView(id) {\n //remove the sprite from the DOM\n if (spritesToPost.length == 1) {\n alert(\"You must have at least 1 sprite\");\n } else {\n $(`#sprite${id}`).remove();\n //find the sprite in the array and remove it\n var index = 0;\n for (var i = 0; i < spritesToPost.length; i++)\n if (spritesToPost[i].id == id) {\n index = i;\n break;\n }\n spritesToPost.splice(index, 1);\n currentSpriteID--;\n if (currentSpriteID >= 1) {\n for (var j = index; j < spritesToPost.length; j++) {\n $(`#sprite${spritesToPost[j].id} h4`).text(`Sprite ${spritesToPost[j].id}`);\n $(`#sprite${spritesToPost[j].id}`).attr('id', `sprite${j}`);\n $(`#imageSelect${spritesToPost[j].id}`).attr('id', `imageSelect${j}`);\n $(`#xPosition${spritesToPost[j].id}`).attr('id', `xPosition${j}`);\n $(`#yPosition${spritesToPost[j].id}`).attr('id', `yPosition${j}`);\n $(`#spriteType${spritesToPost[j].id}`).attr('id', `imageSelect${j}`);\n $(`input[type=radio][name=imageSelect${spritesToPost[j].id}]`).attr('name', `imageSelect${j}`);\n spritesToPost[j].id--;\n }\n }\n }\n}", "function stopEnemies() {\n\tgroupEnemy.forEach(\n\t\tfunction(enemy) {\n\t\t\tenemy.body.stopMovement();\n\t\t\tenemy.body.velocity.x = 0;\n\t\t\tenemy.body.velocity.y = 0;\n\t\t}\n\t)\n}", "run() {\n var tm = this.renderer.texture;\n var managedTextures = tm.managedTextures;\n var wasRemoved = false;\n for (var i = 0; i < managedTextures.length; i++) {\n var texture = managedTextures[i];\n // only supports non generated textures at the moment!\n if (!texture.framebuffer && this.count - texture.touched > this.maxIdle) {\n tm.destroyTexture(texture, true);\n managedTextures[i] = null;\n wasRemoved = true;\n }\n }\n if (wasRemoved) {\n var j = 0;\n for (var i$1 = 0; i$1 < managedTextures.length; i$1++) {\n if (managedTextures[i$1] !== null) {\n managedTextures[j++] = managedTextures[i$1];\n }\n }\n managedTextures.length = j;\n }\n }", "destroy() {\n // this.group = null;\n this.$el = null;\n }", "function removeGrid() {\n for (var i = 0; i<= gridGroup.children.length-1; i++) {\n gridGroup.children[i].remove();\n }\n gridGroup.remove();\n}", "clear (sprite) {\n this.context.clearRect(0, 0, sprite.stageWidth, sprite.stageHeight)\n }" ]
[ "0.7577594", "0.7577594", "0.70399153", "0.6899509", "0.6813291", "0.67943746", "0.67491615", "0.67185056", "0.6617081", "0.66065913", "0.658787", "0.6560618", "0.6471316", "0.63515043", "0.63313603", "0.62978095", "0.6255875", "0.6246734", "0.6238546", "0.6200532", "0.615621", "0.6155723", "0.61435944", "0.6129213", "0.6117855", "0.61161596", "0.6082941", "0.6058237", "0.60569215", "0.6052592", "0.6045694", "0.6034434", "0.60122603", "0.5972997", "0.59368765", "0.5935111", "0.5926485", "0.591829", "0.5900772", "0.58987", "0.58921254", "0.5888167", "0.5869809", "0.5861265", "0.5860824", "0.5853673", "0.5829881", "0.5828505", "0.578509", "0.57668036", "0.5760564", "0.5755811", "0.57312363", "0.57300866", "0.57290995", "0.5720286", "0.57149357", "0.57071066", "0.57066923", "0.57059", "0.56987953", "0.5691768", "0.5688156", "0.56816375", "0.56797266", "0.5675711", "0.5675441", "0.5673345", "0.5668112", "0.5656557", "0.56564766", "0.5656434", "0.5652751", "0.5650634", "0.56401724", "0.56329703", "0.5629374", "0.5616143", "0.5594283", "0.5593137", "0.55927086", "0.55911475", "0.55833876", "0.5576682", "0.55742776", "0.55697644", "0.5568029", "0.55671966", "0.5550835", "0.5549078", "0.554386", "0.554386", "0.55421644", "0.55360013", "0.5532629", "0.5531907", "0.5524374", "0.5517093", "0.5516289", "0.5513231", "0.55116403" ]
0.0
-1
Activates the camera. The canvas will be drawn according to the camera position and scale until camera.off() is called
on() { if (!this.active) { this.p.push(); this.p.scale(this.zoom); this.p.translate(-this.x + this.p.world.hw / this.zoom, -this.y + this.p.world.hh / this.zoom); this.active = true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Init() {\n // Get context handles\n CanvasHandle = document.getElementById(\"canvas\");\n CanvasHandle.width = ratioX * scale;\n CanvasHandle.height = ratioY * scale;\n ContextHandle = CanvasHandle.getContext(\"2d\");\n CanvasWidth = ContextHandle.canvas.clientWidth;\n CanvasHeight = ContextHandle.canvas.clientHeight;\n\n // Create an image backbuffer\n BackCanvasHandle = document.createElement(\"canvas\");\n BackContextHandle = BackCanvasHandle.getContext(\"2d\");\n BackCanvasHandle.width = CanvasWidth;\n BackCanvasHandle.height = CanvasHeight;\n\n // Set line style\n BackContextHandle.lineCap = \"butt\";\n BackContextHandle.lineJoin = \"round\";\n\n // Get the canvas center\n CenterX = CanvasWidth / 2;\n CenterY = CanvasHeight / 2;\n Camera = {x:0, y:0, z:1};\n}", "function drawCameraIntoCanvas() {\n // Draw the video element into the canvas\n drawKeypoints();\n window.requestAnimationFrame(drawCameraIntoCanvas);\n}", "function Init() {\r\n // Get context handles\r\n CanvasHandle = document.getElementById(\"canvas\");\r\n ContextHandle = CanvasHandle.getContext(\"2d\");\r\n CanvasWidth = ContextHandle.canvas.clientWidth;\r\n CanvasHeight = ContextHandle.canvas.clientHeight;\r\n\r\n // Create an image backbuffer\r\n BackCanvasHandle = document.createElement(\"canvas\");\r\n BackContextHandle = BackCanvasHandle.getContext(\"2d\");\r\n BackCanvasHandle.width = CanvasWidth;\r\n BackCanvasHandle.height = CanvasHeight;\r\n\r\n // Set line style\r\n BackContextHandle.lineCap = \"butt\";\r\n BackContextHandle.lineJoin = \"round\";\r\n BackContextHandle.strokeStyle = \"rgb(255, 255, 255)\";\r\n\r\n // Get the canvas center\r\n CenterX = CanvasWidth / 2;\r\n CenterY = CanvasHeight / 2;\r\n Camera = {x:0, y:0, r:20};\r\n}", "changeCamera() {\n this.scene.camera = this.cameras[this.currentView];\n }", "setViewAndCameraMatrix() {\r\n let gl = glSys.get();\r\n // Step A1: Set up the viewport: area on canvas to be drawn\r\n gl.viewport(this.mViewport[0], // x position of bottom-left corner of the area to be drawn\r\n this.mViewport[1], // y position of bottom-left corner of the area to be drawn\r\n this.mViewport[2], // width of the area to be drawn\r\n this.mViewport[3]); // height of the area to be drawn\r\n // Step A2: set up the corresponding scissor area to limit the clear area\r\n gl.scissor(this.mScissorBound[0], // x position of bottom-left corner of the area to be drawn\r\n this.mScissorBound[1], // y position of bottom-left corner of the area to be drawn\r\n this.mScissorBound[2], // width of the area to be drawn\r\n this.mScissorBound[3]);// height of the area to be drawn\r\n\r\n // Step A3: set the color to be clear\r\n gl.clearColor(this.mBGColor[0], this.mBGColor[1], this.mBGColor[2], this.mBGColor[3]); // set the color to be cleared\r\n // Step A4: enable the scissor area, clear, and then disable the scissor area\r\n gl.enable(gl.SCISSOR_TEST);\r\n gl.clear(gl.COLOR_BUFFER_BIT);\r\n gl.disable(gl.SCISSOR_TEST);\r\n\r\n // Step B: Compute the Camera Matrix\r\n let center = [];\r\n if (this.mCameraShake !== null) {\r\n center = this.mCameraShake.getCenter();\r\n } else {\r\n center = this.getWCCenter();\r\n }\r\n\r\n // Step B1: following the translation, scale to: (-1, -1) to (1, 1): a 2x2 square at origin\r\n mat4.scale(this.mCameraMatrix, mat4.create(), vec3.fromValues(2.0 / this.getWCWidth(), 2.0 / this.getWCHeight(), 1.0));\r\n\r\n // Step B2: first operation to perform is to translate camera center to the origin\r\n mat4.translate(this.mCameraMatrix, this.mCameraMatrix, vec3.fromValues(-center[0], -center[1], 0));\r\n }", "function setCamera()\n{\n var v = 0.0025; // camera tool speed\n var r = 950.0; // camera to origin distance\n \n var alphaX = v * camRotationX * Math.PI;\n var alphaY = v * camRotationY * Math.PI;\n \n alphaX = Math.max(alphaX, -0.5 * Math.PI)\n alphaX = Math.min(alphaX, 0.0)\n \n var sX = Math.sin(alphaX);\n var cX = Math.cos(alphaX);\n \n var sY = Math.sin(alphaY);\n var cY = Math.cos(alphaY);\n \n camera.position.x = r * cX * sY;\n camera.position.y = r * (-sX);\n camera.position.z = r * cX * cY;\n \n // aim the camera at the origin\n camera.lookAt(new THREE.Vector3(0,0,0));\n}", "draw(ctx, camera) {\r\n ctx.drawImage(this.image, this.x - camera.x, this.y - camera.y);\r\n }", "function startCamera() {\n Webcam.set({\n width: 320,\n height: 240,\n image_format: 'jpeg',\n jpeg_quality: 90\n });\n Webcam.attach('#my_camera');\n}", "function start() {\n if (initialized)\n return;\n\n let myCanvas = document.getElementById(\"canvas\");\n myCanvas.classList.toggle(\"hide\");\n\n let button = document.getElementById(\"webcamButton\");\n button.classList.add(\"hide\");\n\n window.ctx = myCanvas.getContext('2d', {alpha: false});\n\n var mycamvas = new camvas(window.ctx, processFrame);\n initialized = true;\n}", "function drawCameraIntoCanvas() {\n // Draw the video element into the canvas\n ctx.drawImage(video, 0, 0, 640, 480);\n // We can call both functions to draw all keypoints and the skeletons\n drawKeypoints();\n drawSkeleton();\n window.requestAnimationFrame(drawCameraIntoCanvas);\n}", "function updateCamera(x,y){\n cameraX += x-canvas.width/2;\n cameraY += y-canvas.height/2;\n}", "render(ctx, camera) {\n var x, y,\n image;\n x = this.x - (this.width / 2) - camera.x\n y = this.y - (this.height / 2) - camera.y\n //x = this.viewX - (this.width / 2)\n //y = this.viewY - (this.height / 2)\n image = new Image();\n image.onload = () => {\n ctx.drawImage(image, x, y)\n }\n image.src = this.src\n }", "activate() {\n // TODO refactor usage of frame..\n const gl = this.gl;\n\n // make sure the texture is unbound!\n this.frameBuffer.bind();\n\n this.calculateProjection(this.destinationFrame, this.sourceFrame);\n\n if (this.transform) {\n this.projectionMatrix.append(this.transform);\n }\n\n // TODO add a check as them may be the same!\n if (this.destinationFrame !== this.sourceFrame) {\n gl.enable(gl.SCISSOR_TEST);\n gl.scissor(\n this.destinationFrame.x | 0,\n this.destinationFrame.y | 0,\n (this.destinationFrame.width * this.resolution) | 0,\n (this.destinationFrame.height * this.resolution) | 0\n );\n } else {\n gl.disable(gl.SCISSOR_TEST);\n }\n\n // TODO - does not need to be updated all the time??\n gl.viewport(\n this.destinationFrame.x | 0,\n this.destinationFrame.y | 0,\n (this.destinationFrame.width * this.resolution) | 0,\n (this.destinationFrame.height * this.resolution) | 0\n );\n }", "setCamera() {\r\n // set up camera\r\n this.camera = new Camera({\r\n time: this.time,\r\n sizes: this.sizes,\r\n renderer: this.renderer,\r\n debug: this.debug,\r\n config: this.config\r\n });\r\n\r\n // add to scene\r\n this.scene.add(this.camera.container);\r\n\r\n // update camera position per frame\r\n this.time.on('update', () => {\r\n if (this.world && this.world.car) { // if car is on the scene\r\n this.camera.target.x = this.world.car.chassis.object.position.x;\r\n this.camera.target.y = this.world.car.chassis.object.position.y;\r\n this.camera.target.z = this.world.car.chassis.object.position.z;\r\n this.camera.direction.x = this.world.car.movement.direction.x;\r\n this.camera.direction.y = this.world.car.movement.direction.y;\r\n }\r\n });\r\n }", "centerCam()\n {\n this.camPos.x = -this.camOffset.x;\n this.camPos.y = -this.camOffset.y;\n this.zoom = 1.5;\n }", "function startCamera()\n{\n $('#camera_wrap').camera({fx: 'scrollLeft', time: 2000, loader: 'none', playPause: false, navigation: true, height: '35%', pagination: true});\n}", "function initCamera(){\r\n camera.position.x = 250;\r\n camera.position.y = 50;\r\n camera.position.z = -50;\r\n }", "function cameraControls(canvas) {\n var mouseIsDown = false;\n var lastPosition = {\n x: 0,\n y: 0\n };\n canvas.addEventListener(\"mousedown\", function (e) {\n mouseIsDown = true;\n lastPosition = {\n x: e.clientX,\n y: e.clientY\n };\n }, false);\n canvas.addEventListener(\"mousemove\", function (e) {\n if (mouseIsDown) {\n params.view.lambda += (e.clientX - lastPosition.x) / params.rotationSensitivity;\n params.view.lambda %= Math.PI * 2;\n params.view.phi += (e.clientY - lastPosition.y) / params.rotationSensitivity;\n params.view.phi %= Math.PI * 2;\n }\n lastPosition = {\n x: e.clientX,\n y: e.clientY\n };\n\n }, false);\n canvas.addEventListener(\"mouseup\", function () {\n mouseIsDown = false;\n }, false);\n}", "display(context, program_state) {\n const desired_camera = this.cameras[this.selection];\n if (!desired_camera || !this.enabled) return;\n const dt = program_state.animation_delta_time;\n program_state.set_camera(\n desired_camera.map((x, i) =>\n Vec.from(program_state.camera_inverse[i]).mix(x, 0.01 * dt)\n )\n );\n program_state.projection_transform = Mat4.perspective(\n Math.PI / 4,\n context.width / context.height,\n 1,\n 2500\n );\n }", "updateCamera() {\n this.camera = this.cameras.get(this.currentCameraID);\n this.interface.setActiveCamera(this.camera);\n }", "function drawCameraIntoCanvas() {\n // Draw the video element into the canvas\n ctx.drawImage(video, 0, 0, pageContent.offsetWidth, pageContent.offsetHeight);\n ctx.fillStyle = '#000000';\n ctx.fillRect(0, 0, pageContent.offsetWidth, pageContent.offsetHeight);\n ctx.lineWidth = 5;\n ctx.fillStyle = '#00FFFF';\n ctx.strokeStyle = '#00FFFF';\n\n // We can call both functions to draw all keypoints and the skeletons\n drawKeypoints();\n drawSkeleton();\n window.requestAnimationFrame(drawCameraIntoCanvas);\n}", "function cameraStart() {\n var flagCamera = true;\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function (stream) {\n track = stream.getTracks()[0];\n cameraView.srcObject = stream;\n localStream = track;\n })\n .catch(function (error) {\n flagCamera = false;\n console.error(\"Oops. Something is broken.\", error);\n }).then(function () {\n if (flagCamera)\n visibleC();\n });\n }", "function canvas_init(){\r\n\r\n\tcontainer_height = $(\"#canvas_container\").height()\r\n\tcontainer_width = $(\"#canvas_container\").width()\r\n\trenderer.setSize( container_width, container_height );\r\n\tdocument.getElementById(\"canvas_container\").appendChild( renderer.domElement );\r\n\r\n\t//set where the camera is in 3D space\r\n\tcamera.position.set(-.5,2.5,4.5);\r\n\t//tell the camera what point to look at in the scene\r\n\tcamera.lookAt(new THREE.Vector3(-.5,0,0));\r\n\r\n\t//directional lighting\r\n\tvar directionalLight = new THREE.DirectionalLight(0xc0c0c0);\r\n\tdirectionalLight.position.set(0,7,2).normalize();\r\n\tscene.add(directionalLight);\r\n\r\n\t//draw all stationary elements from functions above\r\n\tdrawRoom();\r\n\tdrawTable();\r\n\tdrawBoard();\r\n\r\n\t//set the scene so that it starts at birds eye point of view because the camera was initialized\r\n\t//so that it started in the 3D view\r\n\tscene.rotation.x = (50*Math.PI/180);\r\n\r\n\r\n}", "updateCamera() {\n\t\tCameraManager.updateCamera();\n\t}", "function _createCamera() {\n\t\tvar camera = new ImageSurface({\n\t\t\tsize : [this.options.cameraWidth,true],\n\t\t\tcontent : 'src/img/camera.png',\n\t\t\tproperties : {\n\t\t\t\twidth : '100%'\n\t\t\t}\n\t\t});\n\n\t\tvar cameraModifer = new StateModifier({\n\t\t\torigin : [0.5, 0],\n\t\t\talign : [0.5, 0],\n\t\t\ttransform : Transform.behind\n\t\t});\n\n\t\tthis.add(cameraModifer).add(camera);\n\t}", "function draw() {\n if(core.player == null)\n return; \n document.getElementById('scene').setAttribute(\"style\",\"width:100%\");\n document.getElementById('scene').setAttribute(\"style\",\"height:100%\");\n var parent = canvas.parentNode;\n var rect = parent.getBoundingClientRect();\n canvas.width = rect.width;\n canvas.height = rect.height;\n \n camera.aspect = canvas.width / canvas.height;\n\n gl.viewport(0, 0, canvas.width, canvas.height);\n gl.clearColor(0, 0, 0, 1);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n //render scene\n renderer.render(scene, camera);\n}", "function updateCamera() {\n camera.updateProjectionMatrix();\n }", "function cameraStart() {\n cameraView = document.querySelector(\"#webcam\");\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function(stream) {\n cameraView.srcObject = stream;\n })\n .catch(function(error) {\n console.error(\"Oops. Something is broken.\", error);\n });\n}", "function setUpCamera() {\n \n // set up your projection\n // defualt is orthographic projection\n let projMatrix = glMatrix.mat4.create();\n //glMatrix.mat4.ortho(projMatrix, -5, 5, -5, 5, 1.0, 300.0);\n glMatrix.mat4.perspective(projMatrix, radians(60), 1, 5, 100);\n gl.uniformMatrix4fv (program.uProjT, false, projMatrix);\n\n \n // set up your view\n // defaut is at (0,0,-5) looking at the origin\n let viewMatrix = glMatrix.mat4.create();\n glMatrix.mat4.lookAt(viewMatrix, [0, 3, -11], [0, 0, 0], [0, 1, 0]);\n gl.uniformMatrix4fv (program.uViewT, false, viewMatrix);\n}", "function cameraStart() {\n //the getUserMedia method to access the camera\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function(stream) {\n track = stream.getTracks()[0];\n cameraView.srcObject = track;\n })\n .catch(function(error) {\n console.error(\"Oops. Something is horribly broken.\", error);\n });\n}", "draw() {\n this.renderer.render(this.scene, this.camera);\n }", "function cameraStart() {\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function(stream) {\n track = stream.getTracks()[0];\n cameraView.srcObject = stream;\n })\n .catch(function(error) {\n console.error(\"Oops. Something is broken.\", error);\n });\n}", "function cameraStart() {\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function(stream) {\n track = stream.getTracks()[0];\n cameraView.srcObject = stream;\n })\n .catch(function(error) {\n console.error(\"Oops. Something is broken.\", error);\n });\n}", "function render(){\n\t\tcamera.position.x += CAMERA_X;\n\t\tcamera.position.y += CAMERA_Y;\n\t\tcamera.position.z += CAMERA_Z;\n\n\t\trequestAnimationFrame( render );\n\t\trenderer.render(scene, camera);\n\t}", "function initCamera() {\n\n\t\t// const camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 1, 1100 );\n\t\tconst camera = new THREE.PerspectiveCamera( 75, canvasManager.canvas.width / canvasManager.canvas.height, 1, 1100 );\n\t\t// camera.aspect = window.innerWidth / window.innerHeight;\n\t\tcamera.updateProjectionMatrix();\n\t\tcamera.target = new THREE.Vector3( 0, 0, 0 );\n\n\t\treturn camera;\n\n\t}", "changeCamera(currentCamera){\n if(this.pente.active_game == false){\n this.camera = this.views[currentCamera];\n this.interface.setActiveCamera(this.camera);\n }\n }", "function resizeCanvas() {\r\n camera.aspect = window.innerWidth / window.innerHeight;\r\n camera.updateProjectionMatrix();\r\n\r\n canvas.width = window.innerWidth;\r\n canvas.height = window.innerHeight;\r\n }", "function start() {\n canvasElement.style.display = \"none\";\n webcamElement.style.display = \"block\";\n snapButtonElement.style.display = \"block\";\n startButtonElement.style.display = \"none\";\n\n webcam.start()\n .then(result => {\n console.log(\"result\");\n })\n .catch(err => {\n alert(err);\n console.log(err);\n });\n}", "constructor() {\n super();\n this.camera = new Camera;\n this.focus = { x: 0, y: 0 };\n }", "function cameraStart() {\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function (stream) {\n track = stream.getTracks()[0];\n cameraView.srcObject = stream;\n })\n .catch(function (error) {\n console.error(\"Oops. Something is broken.\", error);\n });\n}", "draw(canvas) {\n var context = canvas.getContext(\"2d\");\n context.clearRect(0, 0, canvas.width, canvas.height);\n context.save();\n context.translate(Math.round(canvas.width / 2 - this.camera.getX()), Math.round(canvas.height / 2 - this.camera.getY()));\n this.camera.draw(canvas, this.game.GetEntities(), this.game.GetEmitters(), this.starBackground);\n this.context.restore();\n }", "function cameraStart() {\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function(stream) {\n track = stream.getTracks()[0];\n cameraView.srcObject = stream;\n })\n .catch(function(error) {\n console.error(\"Oops. Something is broken.\", error);\n });\n}", "function cameraStart() {\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function(stream) {\n track = stream.getTracks()[0];\n cameraView.srcObject = stream;\n })\n .catch(function(error) {\n console.error(\"Oops. Something is broken.\", error);\n });\n}", "display(context, program_state) {\n const desired_camera = this.cameras[this.selection];\n if (!desired_camera || !this.enabled)\n return;\n const dt = program_state.animation_delta_time;\n program_state.set_camera(desired_camera.map((x, i) => Vec.from(program_state.camera_inverse[i]).mix(x, .01 * dt)));\n }", "function setupCamera() {\n camera = new PerspectiveCamera(35, config.Screen.RATIO, 0.1, 300);\n camera.position.set(0, 8, 20);\n //camera.rotation.set(0,0,0);\n //camera.lookAt(player.position);\n console.log(\"Finished setting up Camera...\"\n + \"with x\" + camera.rotation.x + \" y:\" + camera.rotation.y + \" z:\" + camera.rotation.z);\n }", "function draw() {\n\t\tcamera.lookAt(camera.position, character.localToGlobal([0, 2, 0]), [0, 1, 0]);\n\t\t\n\t\tcanvas.width = venv_page.offsetWidth;\n\t\tcanvas.height = venv_page.offsetHeight;\n\t\tcamera.perspective(camera.fov, canvas.width / canvas.height, 0.1, 1000); //to render in perspective mode\n\n\t\t//clear\n\t\tgl.viewport(0, 0, canvas.width, canvas.height);\n\t\tgl.clearColor(0, 0, 0, 1);\n\t\tgl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n\t\tdrawWorld(camera);\n\n\t\tif (fullscreenTv){\n\t\t\ttext_videoExample.toViewport();\t\t\n\t\t}\n\t}", "function cameraStart() {\r\n navigator.mediaDevices\r\n .getUserMedia(constraints)\r\n .then(function(stream) {\r\n track = stream.getTracks()[0];\r\n cameraView.srcObject = stream;\r\n })\r\n .catch(function(error) {\r\n console.error(\"Oops. Something is broken.\", error);\r\n });\r\n}", "function draw() {\r\n // stick the camera to the player\r\n camX = player.x;\r\n camY = player.y;\r\n // clear the screen\r\n mapcanvasctx.clearRect(0, 0, mapcanvas.width, mapcanvas.height);\r\n lightcanvasctx.clearRect(0, 0, lightcanvas.width, lightcanvas.height);\r\n\r\n drawMapView(currentmap, camX, camY);\r\n}", "function cameraStart() {\n if(selfie === true){\n cameraView.classList.replace(\"user\", \"environment\");\n cameraOutput.classList.replace(\"user\", \"environment\");\n cameraSensor.classList.replace(\"user\", \"environment\");\n constraints = rearConstraints;\n selfie = false;\n }\n else{\n cameraView.classList.replace(\"environment\", \"user\");\n cameraOutput.classList.replace(\"environment\", \"user\");\n cameraSensor.classList.replace(\"environment\", \"user\");\n constraints = userConstraints;\n selfie = true;\n }\n\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function(stream) {\n track = stream.getTracks()[0];\n cameraView.srcObject = stream;\n })\n .catch(function(error) {\n console.error(\"Oops. Something is broken.\", error);\n });\n}", "function resetCamera() {\r\n var w = container.width(),\r\n h = container.height(),\r\n iw = bgCanvas[0].width,\r\n ih = bgCanvas[0].height;\r\n\r\n if(iw === 0) {\r\n setTimeout(resetCamera, 100);\r\n } else {\r\n zoomLevel = minZoom = Math.min( w / iw, h / ih );\r\n drawingCenter[0] = w/2;\r\n drawingCenter[1] = h/2;\r\n redrawImage();\r\n }\r\n }", "function drawCameraControls() {\r\n // your code goes here\r\n gl.depthRange(0, 0.001);\r\n gl.vertexAttribPointer(vPosition, 3, gl.FLOAT, false, 0, 0);\r\n gl.enableVertexAttribArray(vPosition);\r\n var cameraBuffer = [];\r\n gl.uniform4fv(objectColor, orange);\r\n if (cameraLookUpnew[0] == cameraLookFrom[0] && cameraLookUpnew[1] == cameraLookFrom[1]) {\r\n cameraLookUpnew[0] += 0.00001;\r\n cameraLookUpnew[1] += 0.00001;\r\n }\r\n cameraBuffer.push(cameraLookAt);\r\n cameraBuffer.push(cameraLookFrom);\r\n cameraBuffer.push(cameraLookUpnew);\r\n cameraLookUp = subtract(cameraLookUpnew, cameraLookFrom);\r\n gl.bufferSubData(gl.ARRAY_BUFFER, 0, flatten(cameraBuffer));\r\n gl.lineWidth(2);\r\n gl.drawArrays(gl.LINE_STRIP, 0, cameraBuffer.length);\r\n gl.lineWidth(3);\r\n}", "onWindowResize() {\n //Das Div in dem der VisualizationsCanvas liegt wird var wrapper zugewiesen\n let wrapper = $('#visualizationsCanvasDiv');\n //die Hoehe des divs wird entsprechend dem verhältnis der vorhandenenn hoehe und dem canvas div zu vorhandenen Hoehe angepasst\n wrapper.height((window.innerHeight * (wrapper.width() / window.innerWidth)));\n //Aspect = Hoehen zu Breiten Verhaeltnis\n var aspect = $(\"#visualizationsCanvasDiv\").width() / $(\"#visualizationsCanvasDiv\").height();\n //Wenn Kamera links starten soll(linke Ecke des Canvas = 0) sonst startet Kamera in der Mitte\n if (this.startLeft) {\n this.camera.left = 0;\n this.camera.right = this.frustumSize * aspect;\n } else {\n this.camera.left = this.frustumSize * aspect / -2;\n this.camera.right = this.frustumSize * aspect / 2;\n }\n //Oberes und unteres Ende der Kamera wird gesetzt \n this.camera.top = this.frustumSize / 2;\n this.camera.bottom = this.frustumSize / -2;\n //Kamera wird aktualisiert\n this.camera.updateProjectionMatrix();\n this.camera.updateMatrixWorld();\n //Renderer Groesse wird neu gesetzt\n this.renderer.setSize(wrapper.width(), wrapper.height());\n if (window.actionDrivenRender)\n this.render();\n }", "function cameraMove() {\n if (camera.L) {\n sX -= camera.speed;\n }\n if (camera.R) {\n sX += camera.speed;\n }\n if (camera.T) {\n sY -= camera.speed;\n }\n if (camera.B) {\n sY += camera.speed;\n }\n if (sX < 0) {\n sX = 0;\n }\n if (sX > canvas.width - window.innerWidth) {\n sX = canvas.width - window.innerWidth;\n }\n if (sY < 0) {\n sY = 0;\n }\n if (sY > canvas.height - window.innerHeight) {\n sY = canvas.height - window.innerHeight;\n }\n if (camera.zoomOut) {\n id(\"zoomer\").value--;\n zoomChange();\n } else if (camera.zoomIn) {\n id(\"zoomer\").value++;\n zoomChange();\n }\n scroll(sX, sY);\n}", "function updateCameraView() {\n\texmaple.autoAdjustCamera();\n}", "function setupCamera(scene) {\n let canvas = scene.viewer.canvas;\n let camera = scene.camera;\n let MOVE_SPEED = 2;\n let ZOOM_SPEED = 30;\n let ROTATION_SPEED = 1 / 200;\n let mouse = {buttons: [false, false, false], x: 0, y: 0, x2: 0, y2: 0};\n let right = vec3.create();\n let up = vec3.create();\n let horizontalAngle = -Math.PI / 2;\n let verticalAngle = -Math.PI / 4;\n let cameraTarget = vec3.create(); // What the camera orbits.\n\n // Initial setup, go back a bit and look forward.\n camera.move([0, -400, 0]);\n camera.setRotationAroundAngles(horizontalAngle, verticalAngle, cameraTarget);\n\n // Move the camera and the target on the XY plane.\n function move(x, y) {\n let dirX = camera.directionX;\n let dirY = camera.directionY;\n\n // Allow only movement on the XY plane, and scale to MOVE_SPEED.\n vec3.scale(right, vec3.normalize(right, [dirX[0], dirX[1], 0]), x * MOVE_SPEED);\n vec3.scale(up, vec3.normalize(up, [dirY[0], dirY[1], 0]), y * MOVE_SPEED);\n\n camera.move(right);\n camera.move(up);\n\n // And also move the camera target to update the orbit.\n vec3.add(cameraTarget, cameraTarget, right);\n vec3.add(cameraTarget, cameraTarget, up);\n }\n\n // Rotate the camera around the target.\n function rotate(dx, dy) {\n // Update rotations, and limit the vertical angle so it doesn't flip.\n // Since the camera uses a quaternion, flips don't matter to it, but this feels better.\n horizontalAngle += dx * ROTATION_SPEED;\n verticalAngle = Math.max(-Math.PI + 0.01, Math.min(verticalAngle + dy * ROTATION_SPEED, -0.01));\n\n camera.setRotationAroundAngles(horizontalAngle, verticalAngle, cameraTarget);\n }\n\n // Zoom the camera by moving forward or backwards.\n function zoom(factor) {\n // Get the forward vector.\n let dirZ = camera.directionZ;\n\n camera.move(vec3.scale([], dirZ, factor * ZOOM_SPEED));\n }\n\n /*\n // Resize the canvas automatically and update the camera.\n function onResize() {\n let width = canvas.clientWidth;\n let height = canvas.clientHeight;\n\n canvas.width = width;\n canvas.height = height;\n\n camera.viewport([0, 0, width, height]);\n camera.perspective(Math.PI / 4, width / height, 8, 100000);\n }\n\n window.addEventListener(\"resize\", function(e) {\n onResize();\n });\n\n onResize();\n */\n\n // Track mouse clicks.\n canvas.addEventListener(\"mousedown\", function(e) {\n e.preventDefault();\n\n mouse.buttons[e.button] = true;\n });\n\n // And mouse unclicks.\n // On the whole document rather than the canvas to stop annoying behavior when moving the mouse out of the canvas.\n window.addEventListener(\"mouseup\", (e) => {\n e.preventDefault();\n\n mouse.buttons[e.button] = false;\n });\n\n // Handle rotating and moving the camera when the mouse moves.\n canvas.addEventListener(\"mousemove\", (e) => {\n mouse.x2 = mouse.x;\n mouse.y2 = mouse.y;\n mouse.x = e.clientX;\n mouse.y = e.clientY;\n\n let dx = mouse.x - mouse.x2;\n let dy = mouse.y - mouse.y2;\n\n if (mouse.buttons[0]) {\n rotate(dx, dy);\n }\n\n if (mouse.buttons[2]) {\n move(-dx * 2, dy * 2);\n }\n });\n\n // Handle zooming when the mouse scrolls.\n canvas.addEventListener(\"wheel\", (e) => {\n e.preventDefault();\n\n let deltaY = e.deltaY;\n\n if (e.deltaMode === 1) {\n deltaY = deltaY / 3 * 100;\n }\n\n zoom(deltaY / 100);\n });\n\n // Get the vector length between two touches.\n function getTouchesLength(touch1, touch2) {\n let dx = touch2.clientX - touch1.clientX;\n let dy = touch2.clientY - touch1.clientY;\n\n return Math.sqrt(dx * dx + dy * dy);\n }\n\n // Touch modes.\n let TOUCH_MODE_INVALID = -1;\n let TOUCH_MODE_ROTATE = 0;\n let TOUCH_MODE_ZOOM = 1;\n let touchMode = TOUCH_MODE_ROTATE;\n let touches = [];\n\n // Listen to touches.\n // Supports 1 or 2 touch points.\n canvas.addEventListener('touchstart', (e) => {\n e.preventDefault();\n\n let targetTouches = e.targetTouches;\n\n if (targetTouches.length === 1) {\n touchMode = TOUCH_MODE_ROTATE;\n } else if (targetTouches.length == 2) {\n touchMode = TOUCH_MODE_ZOOM;\n } else {\n touchMode = TOUCH_MODE_INVALID;\n }\n\n touches.length = 0;\n touches.push(...targetTouches);\n });\n\n canvas.addEventListener('touchend', (e) => {\n e.preventDefault();\n\n touchMode = TOUCH_MODE_INVALID;\n });\n\n canvas.addEventListener('touchcancel', (e) => {\n e.preventDefault();\n\n touchMode = TOUCH_MODE_INVALID;\n });\n\n // Rotate or zoom based on the touch mode.\n canvas.addEventListener('touchmove', (e) => {\n e.preventDefault();\n\n let targetTouches = e.targetTouches;\n\n if (touchMode === TOUCH_MODE_ROTATE) {\n let oldTouch = touches[0];\n let newTouch = targetTouches[0];\n let dx = newTouch.clientX - oldTouch.clientX;\n let dy = newTouch.clientY - oldTouch.clientY;\n\n rotate(dx, dy);\n } else if (touchMode === TOUCH_MODE_ZOOM) {\n let len1 = getTouchesLength(touches[0], touches[1]);\n let len2 = getTouchesLength(targetTouches[0], targetTouches[1]);\n\n zoom((len1 - len2) / 50);\n }\n\n touches.length = 0;\n touches.push(...targetTouches);\n });\n}", "Render( scene ){\n engine.activeCamera = this;\n gl.viewport( 0,0, engine.canvas.width, engine.canvas.height );\n gl.clearColor(\n scene.backgroundColor[0],\n scene.backgroundColor[1],\n scene.backgroundColor[2],\n scene.backgroundColor[3]\n );\n gl.clear( gl.COLOR_BUFFER_BIT || gl.DEPTH_BUFFER_BIT );\n scene.Draw();\n }", "attachCamera (object) {\n object.cameraAttached = true\n this.referenceObject = object\n }", "function cameraStart() {\r\n navigator.mediaDevices\r\n .getUserMedia(constraints)\r\n .then(function(stream) {\r\n track = stream.getTracks()[0];\r\n cameraView.srcObject = stream;\r\n })\r\n .catch(function(error) {\r\n console.error(\"Oops. Something is broken.\", error);\r\n });\r\n}", "function updateCameraForRender(self) {\n var cam = self.noa.camera\n var tgt = cam.getTargetPosition()\n self._cameraHolder.position.copyFromFloats(tgt[0], tgt[1], tgt[2])\n self._cameraHolder.rotation.x = cam.pitch\n self._cameraHolder.rotation.y = cam.heading\n self._camera.position.z = -cam.currentZoom\n\n // applies screen effect when camera is inside a transparent voxel\n var id = self.noa.getBlock(self.noa.camera.getPosition())\n checkCameraEffect(self, id)\n}", "display( context, program_state )\n {\n const desired_camera = this.cameras[ this.selection ];\n if( !desired_camera || this.enabled )\n return;\n const dt = program_state.animation_delta_time;\n program_state.set_camera( desired_camera.map( (x,i) => Vec.from( program_state.camera_inverse[i] ).mix( x, .01*dt ) ) ); \n }", "function canvasResize() {\n if (!canvas) return;\n\n canvas.width = innerWidth;\n canvas.height = innerHeight;\n gl.viewport(0, 0, innerWidth, innerHeight);\n\n screenRatio = innerWidth / innerHeight;\n mat4.perspective(projection, 45 * Math.PI / 180, screenRatio, 0.1, 1000);\n\n gl.bindTexture(gl.TEXTURE_2D, FBOsoffscreen.texture);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, innerWidth, innerHeight, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n gl.bindTexture(gl.TEXTURE_2D, null);\n\n gl.bindRenderbuffer(gl.RENDERBUFFER, FBOsoffscreen.colorRenderBuffer);\n gl.renderbufferStorageMultisample(gl.RENDERBUFFER, 4, gl.RGBA8, innerWidth, innerHeight);\n\n if (screenRatio < 1.2 && innerWidth < 850) {\n window.cameraZ = 65;\n camera.pos = [0, 0, cameraZ];\n } else {\n window.cameraZ = 45;\n camera.pos = [0, 0, cameraZ];\n }\n}", "function viewingInit(gl) {\n // Set up an orthographic projection matrix (parallel lines are always parallel)\n var left = 0;\n var right = gl.canvas.clientWidth;\n var bottom = gl.canvas.clientHeight;\n var top = 0;\n var near = 2000;\n var far = -2000;\n //var projectionMatrix = m4.orthographic(left, right, bottom, top, near, far);\n\n // Set up a perspective projection matrix (parallel lines meet at infinity)\n var fieldOfViewDegrees = 60;\n var fieldOfViewRadians = fieldOfViewDegrees * Math.PI / 180;\n var aspect = gl.canvas.clientWidth / gl.canvas.clientHeight;\n var zNear = 1;\n var zFar = 2000;\n var projectionMatrix = m4.perspective(fieldOfViewRadians, aspect, zNear, zFar);\n \n // Set up the camera matrix\n // Create the cameraMatrix\n var cameraMatrix = m4.identity();\n cameraMatrix = m4.xRotate(cameraMatrix, cameraAngleRadians[0]);\n cameraMatrix = m4.yRotate(cameraMatrix, cameraAngleRadians[1]);\n cameraMatrix = m4.zRotate(cameraMatrix, cameraAngleRadians[2]);\n cameraMatrix = m4.translate(cameraMatrix, xCameraOffset, yCameraOffset, zCameraOffset + camRadius * 1.5);\n\n // Set up for the lookAt miatrix\n // get camera's position from the matrix\n var cameraPosition = [\n cameraMatrix[12],\n cameraMatrix[13],\n cameraMatrix[14],\n ];\n // get the vector for 'up' for computing normals\n var up = [0, 1, 0];\n\n // Pick some place to lookAt\n var target = [0, 250, 0];\n // Compute the camera's matrix to lookAt point\n var lookAtMatrix = m4.lookAt(cameraPosition, target, up);\n\n // Set up the view matrix, 'moves' the camera to the origin\n //var viewMatrix = m4.inverse(cameraMatrix);\n var viewMatrix = m4.inverse(lookAtMatrix);\n\n // view projection matrix\n var viewProjectionMatrix = m4.multiply(projectionMatrix, viewMatrix);\n // Compute the world matrix\n var worldMatrix = m4.identity();\n var worldInverseMatrix = m4.inverse(worldMatrix);\n var worldInverseTransposeMatrix = m4.transpose(worldInverseMatrix);\n // worldViewProjectMatrix\n var worldViewProjectMatrix = m4.multiply(viewProjectionMatrix, worldInverseTransposeMatrix);\n\n // Put it into our main matrix\n //matrix = m4.multiply(matrix, viewProjectionMatrix);\n //matrix = m4.multiply(matrix, worldViewProjectMatrix);\n\n // Set the uniforms in the shaders\n gl.uniformMatrix4fv(programInfo.uniforms.worldViewProjection, false, worldViewProjectMatrix);\n gl.uniformMatrix4fv(programInfo.uniforms.worldInverseTranspose, \n false, \n worldInverseTransposeMatrix);\n gl.uniformMatrix4fv(programInfo.uniforms.world, false, worldMatrix);\n // set the camera/view position\n gl.uniform3fv(programInfo.uniforms.viewWorldPosition, cameraPosition);\n\n //var v = m4.transformPoint(worldMatrix, [20, 30, 50]);\n //gl.uniform3fv(programInfo.uniforms.lightWorldPosition, v);\n\n return worldViewProjectMatrix;\n}", "function camera(event) {\n if (Date.now() - lastUpdate > mspf) {\n const deltaX = (event.clientX - prevX) / c.width;\n const deltaY = (event.clientY - prevY) / c.height;\n\n cameraX += -1 * deltaX * 180;\n cameraY += deltaY * 180;\n\n prevX = event.clientX;\n prevY = event.clientY;\n\n requestAnimFrame(render);\n lastUpdate = Date.now();\n }\n}", "function Camera(startPos, wView, hView, ctx) {\n this.direction = {x: 0, y: 0};\n this.x = startPos.x;\n this.y = startPos.y;\n this.width = wView;\n this.height = hView;\n this.scale = 1;\n\n this.toWorld = function(clientX, clientY) {\n return [\n clientX/this.scale - ((wView/this.scale/2) - this.x),\n clientY/this.scale - ((hView/this.scale/2) - this.y)\n ]\n };\n\n this.zoom = function() {\n if (this.scale == 1) {\n this.scale = 0.75;\n } else {\n this.scale = 1;\n }\n };\n\n this.update = function(mod) {\n if (this.direction.x == 1) {\n this.x += 5;\n }\n if (this.direction.x == -1) {\n this.x -= 5;\n }\n if (this.direction.y == 1) {\n this.y += 5;\n }\n if (this.direction.y == -1) {\n this.y -= 5;\n }\n };\n\n this.render = function() {\n // Apply the scale first\n ctx.scale(this.scale, this.scale);\n // Move the scene, in relation to the middle of the viewport ()\n ctx.translate(this.width/this.scale/2 - this.x, (this.height/this.scale/2) - this.y);\n };\n\n this.inside = function(x, y, width, height) {\n // target x + 1/2 width of target should be great than left bound\n // left bound = camera.x (center) - width/2\n // width should be / by scale\n if (x + width/2/this.scale > this.x - ((this.width/this.scale)/2)\n && x - width/2/this.scale < this.x + ((this.width/this.scale)/2)) {\n if (y + height/2/this.scale > this.y - ((this.height/this.scale)/2)\n && y - height/2/this.scale < this.y + ((this.height/this.scale)/2)) {\n return true\n }\n }\n return false\n };\n}", "function setupCamera() {\n camera = new PerspectiveCamera(50, window.innerWidth / window.innerHeight, 0.1, 1000);\n camera.position.x = 4.7;\n camera.position.y = 12.47; //z\n camera.position.z = 12.9; //y axis in blender\n camera.lookAt(new Vector3(0, 0, 0));\n cameras[0] = camera;\n console.log(\"Finished setting up Camera...\");\n}", "function resetCamera() {\n mainCamera.setAttribute(\"rotation\", \"0 0 0\");\n mainCamera.setAttribute(\"position\", \"0 1.6 0\");\n}", "initCamera() {\n this.camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 10, 1000);\n this.camera.position.y = 400;\n this.camera.position.z = 400;\n this.camera.rotation.x = .70;\n }", "function setupCamera() {\r\n //camera = new PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 1000);\r\n camera = new PerspectiveCamera(85, window.innerWidth / window.innerHeight, 0.1, 1000);\r\n camera.position.x = 30;\r\n camera.position.y = 20;\r\n camera.position.z = 0;\r\n camera.lookAt(scene.position);\r\n console.log(\"Finished setting up Camera...\");\r\n}", "function changeCamera() \r\n{\r\n if (overview)\r\n {\r\n overview = false;\r\n camera.position.set(0, 5, 80);\r\n camera.rotation.x = -Math.PI/10; //camera looks down a bit\r\n camera.lookAt( 0, 3, 0 )\r\n }\r\n else\r\n {\r\n overview = true;\r\n camera.position.set(0, 600, 0);\r\n camera.lookAt(0, 0, 0);\r\n }\r\n}", "function initContext() {\n // Set up our CameraController.\n g_cameraController = o3djs.cameracontroller.createCameraController(\n [0, 2, 0], // centerPos\n 23, // backpedal\n 0, // heightAngle\n 0, // rotationAngle\n g_math.degToRad(15), // fieldOfViewAngle\n updateViewAndProjectionMatrices); // opt_onChange\n\n updateViewAndProjectionMatrices();\n}", "function CameraInteractor(camera,canvas){\n\n this.camera = camera;\n this.canvas = canvas;\n this.update();\n\n this.dragging = false;\n this.picking = false;\n this.x = 0;\n this.y = 0;\n this.lastX = 0;\n this.lastY = 0;\n this.button = 0;\n this.ctrl = false;\n this.key = 0;\n\n this.MOTION_FACTOR = 10.0;\n this.dloc = 0;\n this.dstep = 0;\n\n\tthis.picker = null;\n\n}", "constructor() {\n // The name of the camera.\n this.name = \"Chase Camera\";\n\n // Instructions to display on the screen when this camera is active.\n this.instructions = \"\";\n\n //The horizontal distance from the target.\n this.distance = 5.0;\n\n // The height above the ground.\n this.height = 2.5;\n\n // The initial position and rotation.\n this.eye = vec3(0, 0, 0);\n this.at = vec3(1, 0, 0);\n this.target = null;\n this.rotationX = 0;\n this.rotationY = 0;\n\n // The limits for looking up/down.\n this.minRotationY = -70;\n this.maxRotationY = 70;\n\n // Projection settings.\n this.near = 0.5;\n this.far = 1000;\n this.fieldOfViewY = 70;\n\n this.aspect = 1;\n // variables to store the matrices in.\n this.projection = null;\n this.view = null;\n this.viewProjection = null;\n }", "function start(canvasName) {\n\n\tcanvas = document.getElementById(canvasName);\n\n\tregisterElementMouseDrag(canvas);\n\n\tcanvas.addEventListener('webglcontextlost', handleContextLost, false);\n\tcanvas.addEventListener('webglcontextrestored', handleContextRestored, false);\n\n\tvar gl = initCanvas(canvasName);\n\n\tif (!gl) {\n\t\treturn;\n\t}\n\n\tframerate = new Framerate(\"framerate\");\n\n\tvar draw = function() {\n\t\tdrawPicture(gl, canvasName);\n\t\trequestId = window.requestAnimFrame(draw, canvas);\n\t};\n\n\tdraw();\n\n\taddShape(0, null);\n\n\tfunction handleContextLost(e) {\n\t\te.preventDefault();\n\t\tclearLoadingImages();\n\t\tif (requestId !== undefined) {\n\t\t\twindow.cancelAnimFrame(requestId);\n\t\t\trequestId = undefined;\n\t\t}\n\t}\n\n\tfunction handleContextRestored() {\n\t\tinitCanvas(canvasName);\n\t\tdraw();\n\t}\n\n}", "_setStartCameraPosition() {\n this._startCameraPosition = new Vector2(this._camera.x, this._camera.y);\n }", "function setupCamera() {\n camera = new PerspectiveCamera(60, config.Screen.RATIO, 0.1, 1000);\n //camera = new PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 1000);\n //Officiel:x=90,y=40,z=30\n //plus pres:40,10,0\n //47,9,2\n camera.position.x = 90;\n camera.position.y = 40;\n camera.position.z = 30;\n camera.lookAt(new Vector3(0, 0, 0));\n console.log(\"Finished setting up Camera...\");\n scene.add(camera);\n}", "function init(){\r\n\t//Initializes the renderer\r\n\trenderer = new THREE.WebGLRenderer({antialias: true});\r\n\trenderer.setClearColor(0xffffff, 1);\r\n\t\r\n\t//Sets the canvas width to (.innerWidth)\r\n\tcanvasWidth = window.innerWidth;\r\n\t\r\n\t//Sets the canvas height to (.innerHeight)\r\n\tcanvasHeight = window.innerHeight;\r\n\t\r\n\t//Creates the canvas\r\n\trenderer.setSize(canvasWidth, canvasHeight);\r\n\tvar canvas = document.getElementById(\"WebGLCanvas\");\r\n\tcanvas.appendChild(renderer.domElement);\r\n\t\r\n\t//Creates the scene\r\n\tscene = new THREE.Scene();\r\n\t\r\n\t//Initializes the event listener\r\n\tdocument.addEventListener(\"keydown\", onKeyDown);\r\n\t\r\n\t//Creates the orthographic camera\r\n\tviewLength = 500;\r\n\taspRat = canvasWidth/canvasHeight;\r\n\tcamera = new THREE.OrthographicCamera(-aspRat*viewLength/2,\r\n\t\t\t\t\t\t\t\t\t\t\t aspRat*viewLength/2,\r\n\t\t\t\t\t\t\t\t\t\t\t viewLength/2, -viewLength/2,\r\n\t\t\t\t\t\t\t\t\t\t\t -1000, 1000);\r\n\t\r\n\t//Sets camera postition\r\n\tcamera.position.set(300, 300, 300);\r\n\tcamera.lookAt(scene.position);\r\n\t\r\n\t//Adds camera to scene\r\n\tscene.add(camera);\r\n}", "function Camera(screen_box_i, x_i, y_i, zoom_i, minimum_size_i, theCanvas, context) {\r\n\tthis.screen_box = screen_box_i;\r\n this.x = x_i;\r\n this.y = y_i;\r\n this.zoom = zoom_i;\r\n this.minimum_size = minimum_size_i;\r\n\r\n\t // Draw the given circle (in absolute coordinates) onto the view.\r\n\t this.drawSphere = function(cx, cy, cr, color){\r\n\t var scale = (this.screen_box[2]-this.screen_box[0])/this.zoom;\r\n\t var sx = (cx-this.x)*scale + (this.screen_box[2]+this.screen_box[0])*.5 ;\r\n\t var sy = (cy-this.y)*scale + (this.screen_box[3]+this.screen_box[1])*.5 ;\r\n\t var radius = cr*scale;\r\n\t if(sx+radius > 0 && sy+radius > 0 && sx-radius < this.screen_box[2] && sy-radius < this.screen_box[3]){\r\n\t\t drawFancyCircle(sx, sy, radius, color, color, 2);\r\n\t\t if(radius < this.minimum_size){\r\n\t\t \tdrawFancyCircle(sx, sy, this.minimum_size, color, color, 2);\r\n\t\t } \r\n\t }\r\n\t \r\n\t }\r\n\t \r\n\t// Draw the given circle (in absolute coordinates) onto the view.\r\n\t this.drawCircle = function(cx, cy, cr, fill_color, stroke_color, stroke_size){\r\n\t var scale = (this.screen_box[2]-this.screen_box[0])/this.zoom;\r\n\t var sx = (cx-this.x)*scale + (this.screen_box[2]+this.screen_box[0])*.5 ;\r\n\t var sy = (cy-this.y)*scale + (this.screen_box[3]+this.screen_box[1])*.5 ;\r\n\t var radius = cr*scale;\r\n\t drawCircle(sx, sy, radius, fill_color, stroke_color, stroke_size);\r\n\t if(radius < this.minimum_size){\r\n\t \tdrawCircle(sx, sy, this.minimum_size, fill_color, stroke_color, stroke_size);\r\n\t } \r\n\t }\r\n\t \r\n\t// Draw the given line(in absolute coordinates) onto the view.\r\n\t this.drawLine = function(x1, y1, x2, y2, color){\r\n\t var scale = (this.screen_box[2]-this.screen_box[0])/this.zoom;\r\n\t var sx1 = (x1-this.x)*scale + (this.screen_box[2]+this.screen_box[0])*.5 ;\r\n\t var sy1 = (y1-this.y)*scale + (this.screen_box[3]+this.screen_box[1])*.5 ;\r\n\t var sx2 = (x2-this.x)*scale + (this.screen_box[2]+this.screen_box[0])*.5 ;\r\n\t var sy2 = (y2-this.y)*scale + (this.screen_box[3]+this.screen_box[1])*.5 ;\r\n\t\r\n\t if((sx1 > this.screen_box[0] && sx1 < this.screen_box[2] && sy1 > this.screen_box[1] && sy1 < this.screen_box[3]) ||\r\n\t \t\t(sx2 > this.screen_box[0] && sx2 < this.screen_box[2] && sy2 > this.screen_box[1] && sy2 < this.screen_box[3])){\r\n\t drawLine(color, 1, sx1, sy1, sx2, sy2);\r\n\t }\r\n\t }\r\n\t\r\n\tthis.drawShip = function(cx, cy, angle, cr, thrust){\r\n\t\t var scale = (this.screen_box[2]-this.screen_box[0])/this.zoom;\r\n\t\t var sx = (cx-this.x)*scale + (this.screen_box[2]+this.screen_box[0])*.5 ;\r\n\t\t var sy = (cy-this.y)*scale + (this.screen_box[3]+this.screen_box[1])*.5 ;\r\n\t\t var radius = cr*scale;\r\n\t\t drawShip(sx, sy, angle, radius, thrust, true);\r\n\t\t if(radius < this.minimum_size*10){\r\n\t\t\t drawShip(sx, sy, angle, this.minimum_size*10, thrust, false);\r\n\t\t }\r\n\t}\r\n\t\r\n\t// Converts world coordinates to screen coordinates.\r\n\tthis.toScreenCoord = function(x, y){\r\n\t\tvar scale = (this.screen_box[2]-this.screen_box[0])/this.zoom;\r\n\t\tvar sx = (cx-this.x)*scale + (this.screen_box[2]+this.screen_box[0])*.5 ;\r\n\t var sy = (cy-this.y)*scale + (this.screen_box[3]+this.screen_box[1])*.5 ;\r\n\t return [sx, sy];\r\n\t}\r\n\t\r\n\t// Converts screen coordinates to world coordinates\r\n\tthis.toWorldCoord = function(sx, sy){\r\n\t\tvar scale = (this.screen_box[2]-this.screen_box[0])/this.zoom;\r\n\t\tvar x = (sx - (this.screen_box[2]+this.screen_box[0])*.5)/scale + this.x;\r\n\t\tvar y = (sy - (this.screen_box[3]+this.screen_box[1])*.5)/scale + this.y;\r\n\t\treturn [x,y];\r\n\t}\r\n\t\r\n\tfunction rgbToHex2(rgb) {\r\n\t return \"#\" + ((1 << 24) + (rgb[0] << 16) + (rgb[1] << 8) + rgb[2]).toString(16).slice(1);\r\n\t}\r\n\tfunction rgbToHex(r, g, b) {\r\n\t\treturn \"#\" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);\r\n\t}\r\n\tfunction hexToRgb(hex) {\r\n\t\tvar bigint = parseInt(hex.substring(1,7), 16);\r\n\t\tvar r = (bigint >> 16) & 255;\r\n\t\tvar g = (bigint >> 8) & 255;\r\n\t\tvar b = bigint & 255;\r\n\t\treturn [r,g,b];\r\n\t}\r\n\r\n\t// Same as drawLitCircle but automatically places light and selects highlight color, so it appears light is near viewpoint.\r\n\tfunction drawFancyCircle(x, y, radius, color){\r\n\t\tvar rgb = hexToRgb(color);\r\n\t\tvar light_rgb = [Math.round(Math.min(rgb[0]+100,255)), Math.round(Math.min(rgb[1]+100,255)), Math.round(Math.min(rgb[2]+100,255))];\r\n\t\tvar ambient_rgb = [Math.round(rgb[0]/4.0), Math.round(rgb[1]/4.0), Math.round(rgb[2]/4.0)];\r\n\t\tvar light_x = x-radius*(x/theCanvas.width-.5)*1.5;\r\n\t\tvar light_y = y-radius*(y/theCanvas.height-.5)*1.5;\r\n\t\tdrawLitCircle(x,y,radius,color, light_x, light_y, rgbToHex2(light_rgb), rgbToHex2(ambient_rgb),rgbToHex2(light_rgb), 1);\r\n\t}\r\n\t\r\n\tfunction rgbToHex(red, green, blue) {\r\n var rgb = blue | (green << 8) | (red << 16);\r\n return '#' + (0x1000000 + rgb).toString(16).slice(1)\r\n\t}\r\n\t\r\n\t// Draw a canvas line with a single call.\r\n\tfunction drawLine(color, size, x1, y1, x2, y2){\r\n\t context.beginPath();\r\n\t context.lineWidth = size;\r\n\t context.strokeStyle = color;// set line color\r\n\t context.moveTo(x1, y1);\r\n\t context.lineTo(x2, y2);\r\n\t context.stroke();\r\n }\r\n\t\r\n\t//Draw a canvas circle with a single call.\r\n\t//Use null for fill or stroke color if you do not wish to draw that element.\r\n\tfunction drawCircle(x, y, radius, fill_color, stroke_color, stroke_size){\r\n\t\tcontext.beginPath();\r\n\t\tcontext.arc(x, y, radius, 0, 2 * Math.PI, false);\r\n\t\tcontext.closePath();\r\n\t\tif(fill_color != null){\r\n\t\t\tcontext.fillStyle = fill_color;\r\n\t\t\tcontext.fill();\r\n\t\t}\r\n\t\tif(stroke_color != null){\r\n\t\t\tcontext.lineWidth = stroke_size;\r\n\t\t\tcontext.strokeStyle = stroke_color;\r\n\t\t\tcontext.stroke();\r\n\t\t}\r\n\t}\r\n\t\r\n\tfunction drawShip(x, y, angle, size, thrust, fill){\r\n\t\tvar cs = Math.cos(angle)*size/6;\r\n\t\tvar ss = Math.sin(angle)*size/6;\r\n\t\tcontext.strokeStyle = \"#505050\";\r\n\t\tcontext.fillStyle = \"#505050\";\r\n\t\tcontext.lineWidth = 1;\r\n\t\t// Nose.\r\n\t\tcontext.beginPath();\r\n\t\trotatedMoveTo(x, y, 3,-1.5, cs, ss);\r\n\t\trotatedLineTo(x, y, 5, 0, cs, ss);\r\n\t\trotatedLineTo(x, y, 3, 1.5, cs, ss);\r\n\t\tcontext.closePath();\r\n\t\tif(fill){\r\n\t\t\tcontext.fill();\r\n\t\t} else {\r\n\t\t\tcontext.stroke();\r\n\t\t}\r\n\t\t// Body\r\n\t\tcontext.fillStyle = \"#808080\";\r\n\t\tcontext.strokeStyle = \"#808080\";\r\n\t\tcontext.beginPath();\r\n\t\trotatedMoveTo(x, y, 3, -1.5, cs, ss);\r\n\t\trotatedLineTo(x, y, 3, 1.5, cs, ss);\r\n\t\trotatedLineTo(x, y, -3, 1.5, cs, ss);\r\n\t\trotatedLineTo(x, y, -3, -1.5, cs, ss);\r\n\t\tcontext.closePath();\r\n\t\tif(fill){\r\n\t\t\tcontext.fill();\r\n\t\t} else {\r\n\t\t\tcontext.stroke();\r\n\t\t}\r\n\t\tcontext.fillStyle = \"#707070\";\r\n\t\tcontext.strokeStyle = \"#707070\";\r\n\t\t// Tail fins.\r\n\t\tcontext.beginPath();\r\n\t\trotatedMoveTo(x, y, 0, -1.5, cs, ss);\r\n\t\trotatedLineTo(x, y, -3, -4, cs, ss);\r\n\t\trotatedLineTo(x, y, -3, -1.5, cs, ss);\r\n\t\tcontext.closePath();\r\n\t\tif(fill){\r\n\t\t\tcontext.fill();\r\n\t\t} else {\r\n\t\t\tcontext.stroke();\r\n\t\t}\r\n\t\tcontext.beginPath();\r\n\t\trotatedMoveTo(x, y, 0, 1.5, cs, ss);\r\n\t\trotatedLineTo(x, y, -3, 4, cs, ss);\r\n\t\trotatedLineTo(x, y, -3, 1.5, cs, ss);\r\n\t\tcontext.closePath();\r\n\t\tif(fill){\r\n\t\t\tcontext.fill();\r\n\t\t} else {\r\n\t\t\tcontext.stroke();\r\n\t\t}\r\n\t\t// Thrust\r\n\t\tif(thrust > 0){\r\n\t\t\tcontext.fillStyle = \"#D08000\";\t\r\n\t\t\tcontext.strokeStyle = \"#D08000\";\r\n\t\t\tcontext.beginPath();\r\n\t\t\trotatedMoveTo(x, y, -3, -1, cs, ss);\r\n\t\t\trotatedLineTo(x, y, -3-thrust, 0, cs, ss);\r\n\t\t\trotatedLineTo(x, y, -3, 1, cs, ss);\r\n\t\t\tcontext.closePath();\r\n\t\t\tif(fill){\r\n\t\t\t\tcontext.fill();\r\n\t\t\t} else {\r\n\t\t\t\tcontext.stroke();\r\n\t\t\t}\r\n\t\t\tcontext.beginPath();\r\n\t\t\trotatedMoveTo(x, y, -3, -1.5, cs, ss);\r\n\t\t\trotatedLineTo(x, y, -3-thrust*.75, -.75, cs, ss);\r\n\t\t\trotatedLineTo(x, y, -3, 0, cs, ss);\r\n\t\t\tcontext.closePath();\r\n\t\t\tif(fill){\r\n\t\t\t\tcontext.fill();\r\n\t\t\t} else {\r\n\t\t\t\tcontext.stroke();\r\n\t\t\t}\r\n\t\t\tcontext.beginPath();\r\n\t\t\trotatedMoveTo(x, y, -3, 1.5, cs, ss);\r\n\t\t\trotatedLineTo(x, y, -3-thrust*.75, .75, cs, ss);\r\n\t\t\trotatedLineTo(x, y, -3, 0, cs, ss);\r\n\t\t\tcontext.closePath();\r\n\t\t\tif(fill){\r\n\t\t\t\tcontext.fill();\r\n\t\t\t} else {\r\n\t\t\t\tcontext.stroke();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}\r\n\t\r\n\t// Runs context.lineTo to for a scaled and rotated point.\r\n\t// cs = size * cos(angle, ss = size * sin(angle)\r\n\tfunction rotatedLineTo(cx,cy, dx,dy, cs, ss){\r\n\t\tcontext.lineTo(cx + dx * cs + dy * ss, cy + dx * ss - dy *cs);\r\n\t}\r\n\tfunction rotatedMoveTo(cx,cy, dx,dy, cs, ss){\r\n\t\tcontext.moveTo(cx + dx * cs + dy * ss, cy + dx * ss - dy *cs);\r\n\t}\r\n\t\r\n}", "changeView() {\r\n if (this.graph.currView < this.graph.cameras.length - 1) {\r\n this.graph.currView++;\r\n }\r\n else {\r\n this.graph.currView = 0;\r\n }\r\n\r\n this.camera = this.graph.cameras[this.graph.currView];\r\n this.interface.setActiveCamera(this.camera);\r\n }", "function drawCanvas() {\n\n ///Grab the canvas so we can draw on it\n var ctx = canvas.getContext(\"2d\"); ///Get the canvas context\n\n ///Clear the rectangles\n ctx.fillStyle = \"white\";\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n\n ctx.save();\n\n ctx.translate(width / 2 - cameraCenterX, height / 2 - cameraCenterY);\n if(ctx.getTransform().e != (width/2 - cameraCenterX))\n console.log(\"Bad\")\n ctx.scale(cameraZoom, cameraZoom);\n\n //console.log(cameraZoom)\n\n let left = (0 - (width / 2 - cameraCenterX)) / cameraZoom;\n let right = (width - (width / 2 - cameraCenterX)) / cameraZoom;\n let bottom = (height - (height / 2 - cameraCenterY)) / cameraZoom;\n let top = (0 - (height / 2 - cameraCenterY)) / cameraZoom;\n\n\n //console.log(left + \",\" + top + \" \" + right + \", \" + bottom);\n\n\n let maxSpan = Math.max(right - left, bottom - top);\n\n let maxSpanLog = Math.ceil(Math.log(maxSpan / options.spanSub) / Math.log(options.major));\n let zero = options.major ** (maxSpanLog);\n let downOne = options.major ** (maxSpanLog - 1);\n let difference = maxSpan - (options.major ** maxSpanLog);\n //console.log(difference);\n //difference /= (options.major ** maxSpanLog);\n //console.log(difference);\n //if (Math.random() < .1)\n // console.log(maxSpan + \": \" + zero + \" \" + downOne + \" \" + (maxSpan / zero) + \" \" + (downOne / maxSpan))\n //console.log(maxSpanLog);\n let gridSteps = [];\n for (let i = 0; i < options.minor; i++) {\n let last = i == options.minor - 1;\n let first = i == 0;\n let toPush = {\n step: options.major ** (maxSpanLog - 1) / options.major ** i,\n\n };\n if (!last)\n toPush.opacity = options.gridOpacity;\n else if (last) {\n toPush.opacity = options.gridOpacity * (downOne / maxSpan);\n toPush.opacity **= 2;\n }\n\n gridSteps.push(toPush);\n\n\n }\n\n\n\n let multiple = options.major ** (maxSpanLog);\n if (options.showGrid) {\n for (let i = 0; i < gridSteps.length; i++) {\n let gridStep = gridSteps[i];\n let startX = multiple * Math.floor(left / (multiple));\n let endX = multiple * Math.ceil(right / (multiple));\n let startY = multiple * Math.floor(top / multiple);\n let endY = multiple * Math.ceil(bottom / multiple);\n\n if (Number.isNaN(startX) || Number.isNaN(startY) || Number.isNaN(endX) || Number.isNaN(endY) || Number.isNaN(cameraZoom))\n console.log(\"bad\")\n if (left == right || top == bottom || startX == endX || startY == endY)\n console.log(\"badder\")\n if (startX > endX || startY > endY)\n console.log(\"baddest\")\n //if (startX > 1000000000)\n // console.log(\"Bomb\")\n\n // if (Math.random() < .1)\n // console.log(ctx.getTransform().a + \",\" + ctx.getTransform().d + \" \" + ctx.getTransform().e + \", \" + ctx.getTransform().f)\n // if (Math.random() < .1)\n // console.log(cameraCenterX)\n\n for (let y = startY; y <= endY; y += gridStep.step) {\n ctx.strokeStyle = `rgba(${options.grayScale}, ${options.grayScale}, ${options.grayScale}, ${gridStep.opacity})`;\n ctx.lineWidth = 1 / cameraZoom;\n ctx.beginPath();\n ctx.moveTo(startX, y);\n ctx.lineTo(endX, y);\n ctx.stroke();\n }\n for (let x = startX; x <= endX; x += gridStep.step) {\n ctx.strokeStyle = `rgba(${options.grayScale}, ${options.grayScale}, ${options.grayScale}, ${gridStep.opacity})`;\n ctx.lineWidth = 1 / cameraZoom;\n ctx.beginPath();\n ctx.moveTo(x, startY);\n ctx.lineTo(x, endY);\n ctx.stroke();\n }\n }\n }\n\n if (options.showOrigin) {\n ctx.strokeStyle = \"red\";\n ctx.lineWidth = 2 / cameraZoom;\n ctx.beginPath();\n ctx.moveTo(left, 0);\n ctx.lineTo(right, 0);\n ctx.stroke();\n\n ctx.beginPath();\n ctx.moveTo(1, -.5);\n ctx.lineTo(1, .5);\n ctx.stroke();\n\n\n\n ctx.strokeStyle = \"green\";\n ctx.lineWidth = 2 / cameraZoom;\n ctx.beginPath();\n ctx.moveTo(0, top);\n ctx.lineTo(0, bottom);\n ctx.stroke();\n\n ctx.beginPath();\n ctx.moveTo(-.5, 1);\n ctx.lineTo(.5, 1);\n ctx.stroke();\n\n }\n\n\n\n if (typeof customDraw === \"function\") {\n customDraw(ctx);\n }\n\n ctx.restore();\n\n ctx.fillStyle = \"black\"\n ctx.font = \"10pt arial\"\n for (let i = 0; i < gridSteps.length; i++) {\n\n ctx.fillText(gridSteps[i].step, 10, 32 * (i + 1));\n ctx.strokeStyle = \"rgba(0, 0, 0, \" + (options.gridOpacity * ((options.minor - 1 - i) / (options.minor - 1))) + \")\";\n ctx.beginPath();\n ctx.moveTo(10, 32 * (i + 1));\n ctx.lineTo(10 + gridSteps[i].step * cameraZoom, 32 * (i + 1));\n ctx.stroke();\n }\n\n if (typeof customUI === \"function\") {\n customUI(ctx);\n }\n\n}", "function updateView(camera, l, b, w, h) {\n const left = Math.floor( window.innerWidth * l );\n const bottom = Math.floor( window.innerHeight * b );\n const width = Math.floor( window.innerWidth * w );\n const height = Math.floor( window.innerHeight * h );\n renderer.setViewport( left, bottom, width, height );\n renderer.setScissor( left, bottom, width, height );\n renderer.setScissorTest( true );\n renderer.setClearColor( BACKGROUND_COLOR );\n camera.aspect = width / height;\n camera.updateProjectionMatrix();\n}", "function cameraSetup(){\n\t// Get access to the camera!\n\tif('mediaDevices' in navigator && 'getUserMedia' in navigator.mediaDevices) {\n\t\t// Not adding `{ audio: true }` since we only want video now\n\t\tnavigator.mediaDevices.getUserMedia({\n\t\t\t//Kamera Constrains:\n\t\t\t\n\t\t\tvideo: \n\t\t\t{\n\t\t\t\twidth: {ideal: 50},\n\t\t\t\theight: {ideal: 50},\n\t\t\t\tfacingMode: ['environment']\n\t\t\t}\n\t\t\t}).then(function(stream) {\n\t\t\t\tstreamVideo = stream;\n\t\t\t\tcameraOk = true;\n\t\t\t\tvideo.srcObject = stream;\n\t\t\t\tvideo.play();\n\n\t\t\t\tvar track = stream.getVideoTracks()[0];\n\t\t\t\t//Taschenlampe einschalten:\n\t\t\t\tconst imageCapture = new ImageCapture(track)\n\t\t\t\tconst photoCapabilities = imageCapture.getPhotoCapabilities().then(() => {\n\t\t\t\t\ttrack.applyConstraints({\n\t\t\t\t\t\tadvanced: [{torch: true}]\n\t\t\t\t\t});\n\t\t\t\t});\n\n\n\n\t\t\t});\n\t\t}\n\n\n\t}", "function setupCamera() {\n return _setupCamera.apply(this, arguments);\n}", "function Camera() {\n\t\n}", "function Camera() {\n\t\n}", "set activeCamera(camera) {\n\t\t/* if (!this.isOwnCamera(camera) && !this.isSharedCamera(camera)) {\n\t\t\tconsole.error(\"Tried to set the camera that is managed by the camera manager as the active camera!\")\n\t\t\treturn\n\t\t} */\n\n\t\tthis._activeCamera = camera;\n\n\t\tif(this._cameras[camera._uuid] === undefined) this.addFullOrbitCamera(camera, new Vector3(0, 0, 0));\n\t}", "function cameraFront()\n{\n\tdocument.getElementById('model__CameraFront').setAttribute('bind', 'true');\n}", "function start() {\n var canvas = document.getElementById('can');\n var context = canvas.getContext(\"2d\");\n $('#can').css('width', '100');\n $('#can').css('height', '100');\n $('#can').css('top', '0');\n $('#can').css('left', '0');\n $('#can').css('z-index', '-1');\n canvas.width = 100;\n canvas.height = 100;\n var draw = false;\n}", "function draw(\n gl,\n cube,\n equator,\n latitudeCircle,\n camLine,\n axes,\n loc_MVP,\n loc_uToggle,\n LEFT_VIEWPORT_MVP,\n RIGHT_VIEWPORT_MVP,\n CamLineMVP,\n latitudeMVP,\n canvas\n) {\n let w = canvas.width;\n let h = canvas.height;\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n //left view\n gl.viewport(0, 0, w / 2, h);\n LEFT_VIEWPORT_MVP.setOrtho(LEFT, RIGHT, BOTTOM, TOP, NEAR, FAR);\n LEFT_VIEWPORT_MVP.lookAt(EYE_X, EYE_Y, EYE_Z, 0, 0, 0, 0, 1, 0);\n gl.uniformMatrix4fv(loc_MVP, false, LEFT_VIEWPORT_MVP.elements);\n\n gl.uniform1i(loc_uToggle, 1);\n\n gl.bindVertexArray(cube.vao);\n gl.drawElements(gl.TRIANGLES, cube.n, gl.UNSIGNED_BYTE, 0);\n\n gl.uniform1i(loc_uToggle, 0);\n\n gl.bindVertexArray(equator.vao);\n gl.drawArrays(gl.LINE_STRIP, 0, equator.n);\n\n gl.bindVertexArray(axes.vao);\n gl.drawArrays(gl.LINES, 0, axes.n);\n\n CamLineMVP.setOrtho(LEFT, RIGHT, BOTTOM, TOP, NEAR, FAR);\n CamLineMVP.lookAt(EYE_X, EYE_Y, EYE_Z, 0, 0, 0, 0, 1, 0);\n CamLineMVP.rotate(-g_eyeX, 0, 1, 0);\n CamLineMVP.rotate(-g_eyeY, 1, 0, 0);\n gl.uniformMatrix4fv(loc_MVP, false, CamLineMVP.elements);\n\n gl.bindVertexArray(camLine.vao);\n gl.drawArrays(gl.LINES, 0, camLine.n);\n\n latitudeMVP.setOrtho(LEFT, RIGHT, BOTTOM, TOP, NEAR, FAR);\n latitudeMVP.lookAt(EYE_X, EYE_Y, EYE_Z, 0, 0, 0, 0, 1, 0);\n latitudeMVP.rotate(-g_eyeX, 0, 1, 0);\n gl.uniformMatrix4fv(loc_MVP, false, latitudeMVP.elements);\n\n gl.bindVertexArray(latitudeCircle.vao);\n gl.drawArrays(gl.LINE_STRIP, 0, latitudeCircle.n);\n\n //right view\n gl.viewport(w / 2, 0, w / 2, h);\n RIGHT_VIEWPORT_MVP.setPerspective(PERSE_ANGLE, w / 2 / h, NEAR, FAR);\n RIGHT_VIEWPORT_MVP.translate(0, 0, -R);\n RIGHT_VIEWPORT_MVP.rotate(g_eyeY, 1, 0, 0);\n RIGHT_VIEWPORT_MVP.rotate(g_eyeX, 0, 1, 0);\n gl.uniformMatrix4fv(loc_MVP, false, RIGHT_VIEWPORT_MVP.elements);\n\n gl.uniform1i(loc_uToggle, 1);\n\n gl.bindVertexArray(cube.vao);\n gl.drawElements(gl.TRIANGLES, cube.n, gl.UNSIGNED_BYTE, 0);\n}", "function setupCamera() {\n camera = new PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 5000);\n camera.position.x = -1100;\n camera.position.y = 1000;\n camera.position.z = 1100;\n camera.lookAt(new Vector3(0, 0, 0));\n console.log(\"Finished setting up Camera\");\n}", "function Camera() {\n\tthis.eye = new Vec3();\n\tthis.U = new Vec3();\n\tthis.V = new Vec3();\n\tthis.W = new Vec3();\n\tthis.width = 1.0;\n\tthis.height = 1.0; // \"width\" and \"height\" are width and heigh of the canvas window in scene space. \n\tthis.rows = 0.0; \n\tthis.cols = 0.0;// \"rows\" and \"cols\" are the the number of pixels rows and columns\n\t\n\t/**\n\t * This function is used to 'send' the camera to the kernel.\n\t */\n\tthis.toFloat32Array = function (){\n\t\treturn new Float32Array([\n\t\t\tthis.eye.x, this.eye.y, this.eye.z,\n\t\t\tthis.U.x, this.U.y, this.U.z,\n\t\t\tthis.V.x, this.V.y, this.V.z,\n\t\t\tthis.W.x, this.W.y, this.W.z,\n\t\t\tthis.width, this.height,\n\t\t\tthis.rows, this.cols ]);\n\t}\n\t\n\tthis.defaultInit = function (){\n\t\tthis.eye.x = this.eye.y = this.eye.z = 0.0;\n\t\tthis.U.x=1.0; this.U.y=0.0; this.U.z=0.0; \n\t\tthis.V.x=0.0; this.V.y=1.0; this.V.z=0.0;\n\t\tthis.W.x=0.0; this.W.y=0.0; this.W.z=-1.0;\n\t}\n}", "function startCamera() {\n\n let constraints = {\n audio: false,\n video: {\n width: 640,\n height: 480,\n frameRate: 30\n }\n }\n\n video.setAttribute('width', 640);\n video.setAttribute('height', 480);\n video.setAttribute('autoplay', '');\n video.setAttribute('muted', '');\n video.setAttribute('playsinline', '');\n\n // Start video playback once the camera was fetched.\n function onStreamFetched(mediaStream) {\n video.srcObject = mediaStream;\n // Check whether we know the video dimensions yet, if so, start BRFv4.\n function onStreamDimensionsAvailable() {\n if (video.videoWidth === 0) {\n setTimeout(onStreamDimensionsAvailable, 100);\n } else {\n\n }\n }\n onStreamDimensionsAvailable();\n }\n\n window.navigator.mediaDevices.getUserMedia(constraints).then(onStreamFetched).catch(function() {\n alert(\"No camera available.\");\n });\n}", "function GameCanvas(w) {\n var canvasFactory = new CanvasFactory();\n var $canvas = canvasFactory.createElement();\n var context = $canvas.getContext(\"2d\");\n var canvasBounds;\n var cameraWidth = 320, cameraHeight = 240;\n\n var RATIO = 0.75;\n\n w.setBodyElement($canvas);\n w.addResizeListener(adjustCanvasSize);\n\n /**\n * Renders recordings captured by given camera.\n */\n this.render = function (camera) {\n context.clearRect(0, 0, $canvas.width, $canvas.height);\n\n var $cameraCanvas = camera.getCanvasBuffer();\n cameraWidth = $cameraCanvas.width;\n cameraHeight = $cameraCanvas.height;\n\n var bounds = camera.getBounds(),\n x = Math.min(bounds.x, cameraWidth, 0),\n y = Math.min(bounds.y, cameraHeight, 0),\n width = Math.min(bounds.width, cameraWidth - x),\n height = Math.min(bounds.height, cameraHeight - y);\n\n context.drawImage(\n $cameraCanvas,\n x, y, width, height,\n 0, 0, $canvas.width, $canvas.height\n );\n };\n\n function adjustCanvasSize(width, height) {\n var left = 0;\n if (width * RATIO < height) {\n height = width * RATIO;\n } else {\n left = (width - (height / RATIO)) / 2;\n width = height / RATIO;\n }\n $canvas.style.left = left + \"px\";\n $canvas.width = width;\n $canvas.height = height;\n canvasFactory.disableContextImageSmoothing(context);\n canvasBounds = { left: left, top: 0, width: width, height: height };\n }\n\n /**\n * Registers given function for receiving all canvas events.\n */\n this.onEvent = function (f) {\n w.addMouseListener(function (type, x, y) {\n x = (x - canvasBounds.left) / canvasBounds.width * cameraWidth;\n y = (y - canvasBounds.top) / canvasBounds.height * cameraHeight;\n f(new GameEvent(type, { x: x, y: y }));\n });\n w.addKeyboardListener(function (type, key) {\n f(new GameEvent(type, key));\n });\n };\n \n Object.seal(this);\n }", "function resizeCanvas() {\n camera.aspect = window.innerWidth / window.innerHeight;\n camera.updateProjectionMatrix();\n\n renderer.setSize( window.innerWidth, window.innerHeight );\n}", "function openCamera(){\n\t\t$(\"#camera\").webcam({\n\t width: 320,\n\t height: 240,\n\t mode: \"save\",\n\t swffile: \"jscam.swf\",\n\t onTick: function(remain) {\n\t \tif(remain == 0){\n\t \t\tcountDownPanel.html(\"Cheese!\");\n\t \t\t\n \t\t $(\"#flash\").css(\"display\", \"block\");\n\t\t\t $(\"#flash\").fadeOut(\"fast\", function () {\n\t\t\t $(\"#flash\").css(\"opacity\", 1);\n\t\t\t });\n\n\t \t}\n\t \tcountDownPanel.html(remain);\n\t },\n\t onSave: function() {\n\t \t// alert(\"saved\");\n\t \t\n\t \t// $.post(\n\t\t\t\t\t// \"getSnapshotHistory.php\",\n\t\t\t\t\t// {},\n\t\t\t\t\t// function(data){\n// \t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t// sshistory = \"<img src='snapshots/\" + data[0] + \"'>\";\n\t\t\t\t\t\t// $(\"#camera\").html(sshistory);\n\t\t\t\t\t// },\n\t\t\t\t\t// \"json\"\n\t\t\t\t// );\n\n\t },\n\t onCapture: function() {\n\t \t\tcountDownPanel.html(\"\");\n\t \t\n\t \twindow.webcam.save(\"saveSnapshot.php\");\n\t\t\t},\n\t debug: function() {},\n\t onLoad: function() {\n\t \tcountDownPanel.html(\"\");\n\t }\n\t\t});\n\t}", "function setupCamera() {\n camera = new PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 1000);\n camera.position.x = -35;\n camera.position.y = 30;\n camera.position.z = 25;\n camera.lookAt(new Vector3(10, 0, 0));\n console.log(\"Finished setting up Initial Camera...\");\n}", "initCameras() {\n this.camera = new CGFcamera(0.4, 0.1, 500, vec3.fromValues(15, 15, 15), vec3.fromValues(0, 0, 0));\n this.sceneCamera = this.camera;\n //this.secondaryCamera = this.camera;\n }", "function draw(camera)\n{\n\t//Draw Models to Camera\n\tfor(var i = 0; i < this.models.length; i++)\n\t{\n\t\tthis.models[i].draw(camera, this.light);\n\t}\n}", "function render() {\n\n\t// Clear the canvas before we start drawing on it.\n\n\tgl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n\t// Establish the perspective with which we want to view the\n\t// scene. Our field of view is 45 degrees, with a width/height\n\t// ratio of 960:540, and we only want to see objects between 0.1 units\n\t// and 100 units away from the camera.\n\n\tmat4.identity(mvMatrix); \n\n\t// Set a crosshair at center of scene, if that option is toggled \n\tif (toggle) {\n\t\tmat4.ortho(perspectiveMatrix, -20.0, 20.0, -20.0, 20.0, -20.0, 20.0); \n\t\tvar ch = new crosshair(); \n\t\tch.draw(); \n\t}\n\t// Multiply the model matrix by the view matrix (inverse of camera matrix) \n\n\tmat4.mul(mvMatrix, mvMatrix, viewMatrix); \n\n\t// Now move the drawing position a bit to where we want to start\n\t// drawing the cube.\n\n\tmat4.translate(mvMatrix, mvMatrix, vec3.fromValues(0.0, 0.0, -30.0)); \n\n\t// Start drawing our scene \n\t// If toggle is selected, draw a crosshair \n\t\n\tmat4.perspective(perspectiveMatrix, toRadians(fovy), 1440.0/900.0, 0.1, 100.0);\n\n\t// Save the current matrix \n\tmvPushMatrix(); \n\n\t// Create a cube and reuse it\n\tvar cube = new WebGLCube();\n\n\t// Each cube gets a unique color \n\n\t// TODO: \n\t// Create 8 cubes centered at (+/- 10, +/- 10, +/- 10)\n\t// Not sure if I did this part correctly \n\t// Scale and rotate across time, then translate (read in reverse order)\n\tvar offset = 10; \n\tvar c = 0; \n\tfor(var i = -offset; i <= offset; i += 2 * offset) {\n\t\tfor (var j = -offset; j <= offset; j += 2 * offset) {\n\t\t\tfor (var k = -offset; k <= offset; k += 2 * offset) { \n\t\t\t\tmvPushMatrix();\n\t\t\t\tmat4.translate(mvMatrix, mvMatrix, vec3.fromValues(i, j, k));\n\t\t\t\tmat4.rotate(mvMatrix, mvMatrix, cubeRotation, vec3.fromValues(1.0, 0.0, 1.0));\n\t\t\t\tmat4.scale(mvMatrix, mvMatrix, vec3.fromValues(1.0 + 0.2 * Math.sin(lastCubeUpdateTime / (Math.PI * 1000)) ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t1.0 + 0.2 * Math.sin(lastCubeUpdateTime / (Math.PI * 1000)),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t1.0 + 0.2 * Math.sin(lastCubeUpdateTime / (Math.PI * 1000)))); \n\t\t\t\tcube.draw(colors[c++]); \n\t\t\t\tcube.drawOutline(); \n\t\t\t\tmvPopMatrix();\n\t\t\t}\n\t\t}\n\t}\n\tmvPopMatrix(); \n\t// Animation \n\t// Done by successively calling time and subtracting from last known time \n\t// Cube rotates at 20rpm \n\t// Logic: render is called 60x per second (see webgl-utils.js) \n\t// 20rpm comes out to (1/3) rotations per second, or 120 degrees per second\n\t// Divide needed revolutions by rendering rate and get \n\t// 2 degrees per call \n\tvar currentTime = (new Date).getTime();\n\tif (lastCubeUpdateTime) {\n\t\tvar delta = currentTime - lastCubeUpdateTime;\n\n\t\tcubeRotation += (2 * delta) / 1000.0;\n\t}\n\tlastCubeUpdateTime = currentTime;\n\n\trequestAnimFrame(render);\n}", "function setupCamera() {\n camera = new PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 1000);\n camera.position.x = 0.6;\n camera.position.y = 16;\n camera.position.z = -20.5;\n camera.lookAt(new Vector3(0, 0, 0));\n console.log(\"Finished setting up Camera..!\");\n}", "async function cameraStart() {\n\n await faceapi.nets.faceLandmark68TinyNet.loadFromUri(\"models\");\n await faceapi.nets.tinyFaceDetector.loadFromUri('models')\n\n navigator.mediaDevices\n .getUserMedia(constraints)\n .then(function(stream) {\n track = stream.getTracks()[0];\n cameraView.srcObject = stream;\n })\n .catch(function(error) {\n console.error(\"Oops. Something is broken.\", error);\n });\n}", "tick(mainCamera) {\n if (this.current) {\n const scene = this.current.scene;\n if (scene.camera) {\n scene.camera.copy(mainCamera);\n }\n scene.tick();\n if (scene.camera) {\n mainCamera.copy(scene.camera);\n }\n }\n }" ]
[ "0.7285187", "0.68756026", "0.6855489", "0.6664887", "0.66572964", "0.65980726", "0.65882474", "0.65183896", "0.6493812", "0.6490164", "0.64655685", "0.64650613", "0.64584136", "0.6451031", "0.6436904", "0.63811916", "0.6379562", "0.6360839", "0.63311535", "0.62957096", "0.62849265", "0.627414", "0.6257585", "0.62474155", "0.62437", "0.6242087", "0.6222113", "0.61786675", "0.61736494", "0.6124821", "0.61221486", "0.6121556", "0.6121556", "0.6110207", "0.61045694", "0.60989463", "0.6088662", "0.6072114", "0.60675526", "0.60666716", "0.60561514", "0.60508716", "0.60508716", "0.6039657", "0.6034877", "0.6033669", "0.6018913", "0.60160923", "0.60152847", "0.60135436", "0.60096735", "0.60070556", "0.60038435", "0.6002789", "0.5993354", "0.59767526", "0.59720176", "0.5944885", "0.59363776", "0.5925294", "0.59218526", "0.5916902", "0.59075445", "0.5907514", "0.59052545", "0.5899032", "0.5897704", "0.5885951", "0.5873498", "0.5872389", "0.5867723", "0.58453935", "0.5841834", "0.58297235", "0.5823923", "0.58214605", "0.58153653", "0.5811723", "0.5810496", "0.58099496", "0.580895", "0.5803247", "0.5796041", "0.5796041", "0.5790682", "0.57849383", "0.57705384", "0.5767218", "0.575951", "0.5755819", "0.57549185", "0.57452154", "0.57421064", "0.5736665", "0.5734014", "0.5732576", "0.57319957", "0.5728527", "0.5723372", "0.57101953", "0.5709781" ]
0.0
-1
Deactivates the camera. The canvas will be drawn normally, ignoring the camera's position and scale until camera.on() is called
off() { if (this.active) { this.p.pop(); this.active = false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetCamera()\r\n{\r\n control.reset();\r\n}", "off() {\n\t\t\t\tif (this.active) {\n\t\t\t\t\tcameraPop.call(this.p);\n\t\t\t\t\tthis.active = false;\n\t\t\t\t}\n\t\t\t}", "function stopPreview() {\r\n isPreviewing = false;\r\n\r\n // Cleanup the UI\r\n var previewVidTag = document.getElementById(\"cameraPreview\");\r\n previewVidTag.pause();\r\n previewVidTag.src = null;\r\n\r\n // Allow the device screen to sleep now that the preview is stopped\r\n oDisplayRequest.requestRelease();\r\n }", "function stopCam(cont) {\n cont.stop;\n cont.srcObject = null;\n}", "function clearCanvas() {\n if(isVideo) {\n cancelVideo()\n }\n context.clearRect(0, 0, canvas.width, canvas.height);\n context.save();\n context.setTransform(pixelRatio,0,0,pixelRatio,0,0);\n context.restore();\n }", "function clearCanvas() {\n if (isVideo) {\n cancelVideo()\n }\n context.clearRect(0, 0, canvas.width, canvas.height);\n context.save();\n context.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n context.restore();\n }", "function clearCanvas() {\n if (isVideo) {\n cancelVideo()\n }\n context.clearRect(0, 0, canvas.width, canvas.height);\n context.save();\n context.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n context.restore();\n }", "hide() {\n if (this.facingCamera || !this.initialized) {\n this.updateVisibility(false);\n }\n }", "function resetCamera() {\n mainCamera.setAttribute(\"rotation\", \"0 0 0\");\n mainCamera.setAttribute(\"position\", \"0 1.6 0\");\n}", "function cancelPreview() {\n CameraUI.captureCancelled = true;\n camera && camera.stop();\n }", "function destroyPreview() {\n // un-handle orientation change\n rotateVideoOnOrientationChange = false;\n // remove event handler\n window.removeEventListener(\"orientationchange\", updatePreviewForRotation);\n\n capturePreview.pause();\n capturePreview.src = null;\n\n [capturePreview, capturePreviewAlignmentMark, captureCancelButton].forEach(function (elem) {\n elem && document.body.removeChild(elem);\n });\n \n reader && reader.stop();\n reader = null;\n\n capture && capture.stopRecordAsync();\n capture = null;\n }", "function deactivate() {\n console.debug(\"Deactivate pano viewer\");\n MasterService.deactivateLiveActivityGroupByName(ActivityGroups.PanoViewer);\n }", "resetView() {\n if (this._metadata[\"enablePositionReset\"] == true) {\n this.camera.position.z = this._metadata[\"resetPosition\"]['z'];\n this.camera.position.y = this._metadata[\"resetPosition\"]['y'];\n this.camera.position.x = this._metadata[\"resetPosition\"]['x'];\n this.camera.up.y = this._metadata[\"upSign\"];\n }\n this.controls.target0.x = 0.5 * (this.boundingBox.minX + this.boundingBox.maxX);\n this.controls.target0.y = 0.5 * (this.boundingBox.minY + this.boundingBox.maxY);\n this.controls.reset();\n }", "clearCanvas() {\n const ctx = this.canvas.current.getContext('2d');\n\n ctx.save();\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, this.canvas.current.width, this.canvas.current.height);\n ctx.restore();\n }", "disableRenderTarget() {\n const { _context, _canvas, _activeRenderTarget } = this;\n if (!_activeRenderTarget) {\n return;\n }\n\n const target = this._renderTargets.get(_activeRenderTarget);\n const { width, height } = _canvas;\n if (!!target.multiTargets) {\n _context.drawBuffers([]);\n }\n _context.bindFramebuffer(_context.FRAMEBUFFER, null);\n _context.viewport(0, 0, width, height);\n _context.scissor(0, 0, width, height);\n vec2.set(this._activeViewportSize, width, height);\n this._activeRenderTarget = null;\n }", "hide() {\n this.canvas.style.display = 'none';\n this.back.style.display = 'none';\n this.setPos({x:0, y:document.body.clientHeight, deg:0, scale:0});\n delete renderer.movingCards[this.id];\n }", "function resetCamera() {\n zoom = 45;\n dolly = 325;\n}", "destroy() {\n this.stop();\n\n // Remove listeners\n this.off('controlsMoveEnd', this._onControlsMoveEnd);\n\n var i;\n\n // Remove all controls\n var controls;\n for (i = this._controls.length - 1; i >= 0; i--) {\n controls = this._controls[0];\n this.removeControls(controls);\n controls.destroy();\n };\n\n // Remove all layers\n var layer;\n for (i = this._layers.length - 1; i >= 0; i--) {\n layer = this._layers[0];\n this.removeLayer(layer);\n layer.destroy();\n };\n\n // Environment layer is removed with the other layers\n this._environment = null;\n\n this._engine.destroy();\n this._engine = null;\n\n // Clean the container / remove the canvas\n while (this._container.firstChild) {\n this._container.removeChild(this._container.firstChild);\n }\n\n this._container = null;\n }", "function resetCamera() {\r\n var w = container.width(),\r\n h = container.height(),\r\n iw = bgCanvas[0].width,\r\n ih = bgCanvas[0].height;\r\n\r\n if(iw === 0) {\r\n setTimeout(resetCamera, 100);\r\n } else {\r\n zoomLevel = minZoom = Math.min( w / iw, h / ih );\r\n drawingCenter[0] = w/2;\r\n drawingCenter[1] = h/2;\r\n redrawImage();\r\n }\r\n }", "destroy() {\n\n if (this._navCubeCanvas) {\n\n this.viewer.camera.off(this._onCameraMatrix);\n this.viewer.camera.off(this._onCameraWorldAxis);\n this.viewer.camera.perspective.off(this._onCameraFOV);\n this.viewer.camera.off(this._onCameraProjection);\n\n this._navCubeCanvas.removeEventListener(\"mouseenter\", this._onMouseEnter);\n this._navCubeCanvas.removeEventListener(\"mouseleave\", this._onMouseLeave);\n this._navCubeCanvas.removeEventListener(\"mousedown\", this._onMouseDown);\n\n document.removeEventListener(\"mousemove\", this._onMouseMove);\n document.removeEventListener(\"mouseup\", this._onMouseUp);\n\n this._navCubeCanvas = null;\n this._cubeTextureCanvas.destroy();\n this._cubeTextureCanvas = null;\n\n this._onMouseEnter = null;\n this._onMouseLeave = null;\n this._onMouseDown = null;\n this._onMouseMove = null;\n this._onMouseUp = null;\n }\n\n this._navCubeScene.destroy();\n this._navCubeScene = null;\n this._cubeMesh = null;\n this._shadow = null;\n\n super.destroy();\n }", "function viewReset(){\n\tcamera.position.set(0, 0 , 100);\n \tcamera.rotation.set(0, 0, 0);\n\tcontrols.update();\n // reset the view\n }", "tiltCameraDown() {\n if (APP.conference.isDominantSpeaker) {\n this.tiltCamera(-1);\n }\n }", "function Camera_Reset()\n{\n\t//deactivate any mini actions\n\tthis.DeactivateMiniActions();\n\t//hide camera ui\n\tthis.CameraUI.Show(false);\n\t//end the fake drag\n\tDragging_FakeDragEnd();\n\t//loop through all current commands\n\tfor (var i = 0, c = this.Commands.length; i < c; i++)\n\t{\n\t\t//has destroy?\n\t\tif (this.Commands[i].Destroy)\n\t\t{\n\t\t\t//destroy it\n\t\t\tthis.Commands[i].Destroy();\n\t\t}\n\t}\n\t//empty the commands\n\tthis.Commands = new Array();\n\t//Camera interval active?\n\tif (this.CameraTimer != null)\n\t{\n\t\t//clear it!\n\t\tclearInterval(this.CameraTimer);\n\t\tthis.CameraTimer = null;\n\t\t//update the camera state\n\t\tthis.CameraUI.UpdateCameraState(false);\n\t}\n\t//camera is deactivated\n\tthis.bInProgress = false;\n}", "function stopWebcam() {\n var vid = document.querySelector('video');\n vid.srcObject.getTracks().forEach((track) => {\n track.stop();\n });\n // disable snapshot button\n document.querySelector('#takeSnap').disabled = true;\n}", "exitVR () {\n this.enabled = false\n this.hideVideo()\n }", "clearCanvas() {\n this.effacerButton.addEventListener('click', (e) => {\n e.preventDefault();\n this.validerButton.style.display = 'none';\n //0 = décalage gauche Canvas, 0 = décalage Top idem, width && height du rectangle a effacer\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n });\n }", "stop() {\n if (this.drawRequest) {\n window.cancelAnimationFrame(this.drawRequest);\n this.drawRequest = 0;\n this.ctx.clearRect(x0+1, y0, this.ctx.canvas.width, this.ctx.canvas.height);\n }\n }", "setViewAndCameraMatrix() {\r\n let gl = glSys.get();\r\n // Step A1: Set up the viewport: area on canvas to be drawn\r\n gl.viewport(this.mViewport[0], // x position of bottom-left corner of the area to be drawn\r\n this.mViewport[1], // y position of bottom-left corner of the area to be drawn\r\n this.mViewport[2], // width of the area to be drawn\r\n this.mViewport[3]); // height of the area to be drawn\r\n // Step A2: set up the corresponding scissor area to limit the clear area\r\n gl.scissor(this.mScissorBound[0], // x position of bottom-left corner of the area to be drawn\r\n this.mScissorBound[1], // y position of bottom-left corner of the area to be drawn\r\n this.mScissorBound[2], // width of the area to be drawn\r\n this.mScissorBound[3]);// height of the area to be drawn\r\n\r\n // Step A3: set the color to be clear\r\n gl.clearColor(this.mBGColor[0], this.mBGColor[1], this.mBGColor[2], this.mBGColor[3]); // set the color to be cleared\r\n // Step A4: enable the scissor area, clear, and then disable the scissor area\r\n gl.enable(gl.SCISSOR_TEST);\r\n gl.clear(gl.COLOR_BUFFER_BIT);\r\n gl.disable(gl.SCISSOR_TEST);\r\n\r\n // Step B: Compute the Camera Matrix\r\n let center = [];\r\n if (this.mCameraShake !== null) {\r\n center = this.mCameraShake.getCenter();\r\n } else {\r\n center = this.getWCCenter();\r\n }\r\n\r\n // Step B1: following the translation, scale to: (-1, -1) to (1, 1): a 2x2 square at origin\r\n mat4.scale(this.mCameraMatrix, mat4.create(), vec3.fromValues(2.0 / this.getWCWidth(), 2.0 / this.getWCHeight(), 1.0));\r\n\r\n // Step B2: first operation to perform is to translate camera center to the origin\r\n mat4.translate(this.mCameraMatrix, this.mCameraMatrix, vec3.fromValues(-center[0], -center[1], 0));\r\n }", "deleteCanvas() {\n this.canvas.remove();\n }", "function start() {\n if (initialized)\n return;\n\n let myCanvas = document.getElementById(\"canvas\");\n myCanvas.classList.toggle(\"hide\");\n\n let button = document.getElementById(\"webcamButton\");\n button.classList.add(\"hide\");\n\n window.ctx = myCanvas.getContext('2d', {alpha: false});\n\n var mycamvas = new camvas(window.ctx, processFrame);\n initialized = true;\n}", "function resetCanvas() {\n bufferCtx.clearRect(0, 0, bufferCtx.canvas.width, bufferCtx.canvas.height);\n ctx.clearRect(0,0,ctx.width, ctx.height);\n ctx.globalAlpha = 1.0;\n clearInterval(fadeTime);\n fadeTime = 0;\n }", "componentWillUnmount () {\n this.canvas = null\n }", "function disableCanvas() {\n eventsBound = false;\n if (touchable) {\n canvas.each(function () {\n this.removeEventListener('touchstart', stopDrawing);\n this.removeEventListener('touchend', stopDrawing);\n this.removeEventListener('touchmove', drawLine);\n });\n } else {\n canvas.unbind('mousedown.signaturepad');\n canvas.unbind('mouseup.signaturepad');\n canvas.unbind('mousemove.signaturepad');\n canvas.unbind('mouseleave.signaturepad');\n }\n $(settings.clear, context).unbind('click.signaturepad');\n }", "changeCamera() {\n this.scene.camera = this.cameras[this.currentView];\n }", "deactivate() {\n if (CONFIG.DEBUG) {\n window.scene = null;\n }\n }", "function stopFunction() {\n if (interval) clearInterval(interval); // stop frame grabbing\n if (videoDevice) videoDevice.stop(); // turn off the camera\n }", "erase() {\n this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height)\n }", "function resetCamera() {\n\n\t// if user hasn't clicked the 'Save' camera button then 'Reset' should not\n\t// do anything IMO\n\t//if (!viewerParams.parts.options.hasOwnProperty('savedCameraSetup')) return;\n\n\tvar screenWidth = window.innerWidth;\n\tvar screenHeight = window.innerHeight;\n\tvar aspect = screenWidth / screenHeight;\n\n\tviewerParams.camera = new THREE.PerspectiveCamera( viewerParams.fov, aspect, viewerParams.zmin, viewerParams.zmax);\n\tviewerParams.camera.up.set(0, -1, 0);\n\tviewerParams.scene.add(viewerParams.camera); \n\n\tsetCenter(viewerParams.parts[viewerParams.partsKeys[0]].Coordinates_flat);\n\tviewerParams.camera.position.set(viewerParams.center.x, viewerParams.center.y, viewerParams.center.z - viewerParams.boxSize/2.);\n\tviewerParams.camera.lookAt(viewerParams.scene.position); \n\n\t//change the center?\n\tif (viewerParams.parts.options.hasOwnProperty('center')){\n\t\tif (viewerParams.parts.options.center != null){\n\t\t\tviewerParams.center = new THREE.Vector3(viewerParams.parts.options.center[0], viewerParams.parts.options.center[1], viewerParams.parts.options.center[2]);\n\t\t\tsetBoxSize(viewerParams.parts[viewerParams.partsKeys[0]].Coordinates_flat);\n\t\t}\n\t} \n\n\t//change location of camera?\n\tif (viewerParams.parts.options.hasOwnProperty('camera')){\n\t\tif (viewerParams.parts.options.camera != null){\n\t\t\tviewerParams.camera.position.set(viewerParams.parts.options.camera[0], viewerParams.parts.options.camera[1], viewerParams.parts.options.camera[2]);\n\t\t}\n\t} \n\n\t//change the rotation of the camera (which requires Fly controls)\n\tif (viewerParams.parts.options.hasOwnProperty('cameraRotation')){\n\t\tif (viewerParams.parts.options.cameraRotation != null){\n\t\t\tviewerParams.camera.rotation.set(viewerParams.parts.options.cameraRotation[0], viewerParams.parts.options.cameraRotation[1], viewerParams.parts.options.cameraRotation[2]);\n\t\t}\n\t}\n\n\t//change the rotation of the camera (which requires Fly controls)\n\tif (viewerParams.parts.options.hasOwnProperty('cameraUp')){\n\t\tif (viewerParams.parts.options.cameraUp != null){\n\t\t\tviewerParams.camera.up.set(viewerParams.parts.options.cameraUp[0], viewerParams.parts.options.cameraUp[1], viewerParams.parts.options.cameraUp[2]);\n\t\t}\n\t}\n\n\tif (viewerParams.parts.options.hasOwnProperty('useTrackball')){\n\t\tif (viewerParams.parts.options.useTrackball != null){\n\t\t\tviewerParams.useTrackball = viewerParams.parts.options.useTrackball\n\t\t}\n\t}\n\n\tviewerParams.controls.dispose();\n\tinitControls();\n\tsendCameraInfoToGUI(null, true);\n\n}", "dispose(){\n if (InputManager.haveGamepadEvents) {\n window.removeEventListener(\"gamepadconnected\", this.gamepadConnectedHandler, false);\n window.removeEventListener(\"gamepaddisconnected\", this.gamepadDisconnectedHandler, false);\n } else if (InputManager.haveWebkitGamepadEvents) {\n window.removeEventListener(\"webkitgamepadconnected\", this.gamepadConnectedHandler, false);\n window.removeEventListener(\"webkitgamepaddisconnected\", this.gamepadDisconnectedHandler, false);\n } else {\n removeInterval(this.checkGamepads);\n }\n \n window.removeEventListener(\"keypress\", this.keyPressHandler, false);\n window.removeEventListener(\"click\", this.mouseClickHandler, false);\n\n this.cameraControl.dispose();\n }", "detachFrameBuffer() {\n this.rttTexture.detachFromFrameBuffer();\n }", "function destroy(success, error){\n error = null; // should never error\n cancelScan();\n if(mediaStreamIsActive()){\n killActiveMediaStream();\n }\n backCamera = null;\n frontCamera = null;\n var preview = getVideoPreview();\n var still = getImg();\n if(preview){\n preview.remove();\n }\n if(still){\n still.remove();\n }\n success(calcStatus());\n }", "function restoreCamera(camera, ok) {\n Human.renderer.camera.fly.flyTo(camera, function(){\n if (ok){\n ok();\n }\n });\n }", "deactivate()\n {\n if (!this.isActive || this.isMobileAccessabillity)\n {\n return;\n }\n\n this.isActive = false;\n\n window.document.removeEventListener('mousemove', this._onMouseMove);\n window.addEventListener('keydown', this._onKeyDown, false);\n\n this.renderer.off('postrender', this.update);\n\n if (this.div.parentNode)\n {\n this.div.parentNode.removeChild(this.div);\n }\n }", "function autoCamToggle(){\n\t//guiParameters.autoCam = !(guiParameters.autoCam);\n\tif (guiParameters.autoCam) {\n\t\tcontrols.autoRotate = true;\n\t}\n\telse {\n\t\tcontrols.autoRotate = false; \n\t}\n\tcontrols.update();\n // If autocam is off, reset move speed and cam pos, lookat and lookup\n }", "clearCanvas() {\r\n this.context = this.canvas.getContext('2d');\r\n this.isDrawing = false;\r\n this.x = 0;\r\n this.y = 0;\r\n // On récupère le decalage du canevas en x et y par rapport aux bords\r\n // de la page\r\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\r\n }", "function finish() {\n c.removeEventListener(\"mousemove\", camera);\n}", "deactivate() {\n if (this.active) {\n if (this.mediaRecorder) {\n clearInterval(this.mediaRecorderInterval);\n this.mediaRecorder.removeEventListener('dataavailable', this.handleMediaRecorderData);\n this.mediaRecorder.removeEventListener('start', this.handleMediaRecorderStart);\n this.mediaRecorder.removeEventListener('stop', this.handleMediaRecorderStop);\n this.mediaRecorder.removeEventListener('pause', this.handleMediaRecorderPause);\n this.mediaRecorder.removeEventListener('resume', this.handleMediaRecorderResume);\n this.mediaRecorder.stop();\n this.mediaRecorder = null;\n this.mediaRecorderStartTime = null;\n this.mediaRecorderDuration = 0\n this.mediaRecorderInterval = 0;\n this.mediaRecorderBlobs = [];\n }\n\n this.releaseInput();\n this.revokeBlobURLs();\n this.unwatchDevices();\n this.active = false;\n this.notifyChange();\n }\n }", "removeRenderTarget() {\n if(this.target) {\n // reset our planes stacks\n this.renderer.scene.removePlane(this);\n this.target = null;\n this.renderer.scene.addPlane(this);\n }\n }", "dispose() {\n this.framebuffer.dispose();\n super.dispose();\n }", "StopRunning() {\n\n\t\tthis.inputHandler.DetachEvents(this.canvasTarget);\n\t\tthis._isRunning = false;\n\t}", "function clearCanvas() {\nscene.clearGeometry();\n}", "stop() {\n if (!this._flying) {\n return;\n }\n this._flying = false;\n this._time1 = null;\n this._time2 = null;\n if (this._projection2) {\n this.scene.camera.projection = this._projection2;\n }\n const callback = this._callback;\n if (callback) {\n this._callback = null;\n if (this._callbackScope) {\n callback.call(this._callbackScope);\n } else {\n callback();\n }\n }\n this.fire(\"stopped\", true, true);\n }", "function setClearcanvasFalse(){\t\t\n\t\tconsole.log(\"ran clear canvas\");\n\t\tsetEraserOptions.clearCanvas = false;\n\t}", "onDeactivate() {\r\n this.canvas.removeEventListener('mousedown', this.mouseDownEventHandler);\r\n this.canvas.removeEventListener('mouseup', this.mouseUpEventHandler);\r\n this.canvas.removeEventListener('mousemove', this.mouseMoveEventHandler);\r\n }", "function stop () {\n if (drawRequest) {\n window.cancelAnimationFrame(drawRequest)\n drawRequest = 0\n ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height) \n } \n }", "changeCamera(currentCamera){\n if(this.pente.active_game == false){\n this.camera = this.views[currentCamera];\n this.interface.setActiveCamera(this.camera);\n }\n }", "function cleanCV(){\n const context = myCanvas.getContext('2d');\n context.clearRect(0, 0, myCanvas.width, myCanvas.height);\n}", "clearCanvas(){\n\t\tthis.ctx.save();\n\t\tthis.ctx.clearRect(0,0,this.canvas.width,this.canvas.height);\n\t\tthis.ctx.restore();\n\t}", "function clearGesture() {\n\t\t\n\t\tnew TWEEN.Tween(camera.position).to({x: cameraInitialPos.x, y: cameraInitialPos.y, z: cameraInitialPos.z}).easing(TWEEN.Easing.Exponential.Out).start();\n\t\tnew TWEEN.Tween(camera.rotation).to({x: 0, y: 0, z: 0}).easing(TWEEN.Easing.Exponential.Out).start();\n\n\t\tfor (var i = 0, l = renderedHands.length; i < l; i++) { scene.remove(renderedHands[i]); }\n\t\t\n\t\trenderedHands = [];\n\t}", "stop () {\n // Stop the animation frame loop\n window.cancelAnimationFrame(this._animationFrame)\n // Delete element, if initiated\n if (this.canvas) {\n this.canvas.outerHTML = ''\n delete this.canvas\n }\n if (this.stats) {\n document.querySelector('body').removeChild(this.stats.dom)\n delete this.stats\n }\n // Remove Gui, if initiated\n if (this._gui) {\n this._gui.domElement.removeEventListener('touchmove', this._preventDefault)\n this._gui.destroy()\n }\n // Remove all event listeners\n Object.keys(this._events).forEach(event => {\n if (this._events[event].disable) {\n this._events[event].disable.removeEventListener(event, this._preventDefault)\n }\n this._events[event].context.removeEventListener(event, this._events[event].event.bind(this))\n })\n }", "function clearPicture() {\n let context = canvas.getContext('2d');\n context.fillStyle = \"#FFF\";\n context.fillRect(0, 0, canvas.width, canvas.height);\n\n this.video.style.display = 'block';\n this.canvas.style.display = 'none';\n this.photo.style.display = 'none';\n }", "function removeGameCanvas(){\n\t stage.autoClear = true;\n\t stage.removeAllChildren();\n\t stage.update();\n\t createjs.Ticker.removeEventListener(\"tick\", tick);\n\t createjs.Ticker.removeEventListener(\"tick\", stage);\n }", "function clearPreview() {\n video.style.display = \"block\";\n document.getElementById(\"upload\").src = \"\";\n\n document.getElementById(\"editor\").innerHTML = \"\";\n\n canvas.style.display = \"none\";\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n snapButton.value = \"Capture\";\n snapButton.onclick = snap;\n}", "function cameraControls(canvas) {\n var mouseIsDown = false;\n var lastPosition = {\n x: 0,\n y: 0\n };\n canvas.addEventListener(\"mousedown\", function (e) {\n mouseIsDown = true;\n lastPosition = {\n x: e.clientX,\n y: e.clientY\n };\n }, false);\n canvas.addEventListener(\"mousemove\", function (e) {\n if (mouseIsDown) {\n params.view.lambda += (e.clientX - lastPosition.x) / params.rotationSensitivity;\n params.view.lambda %= Math.PI * 2;\n params.view.phi += (e.clientY - lastPosition.y) / params.rotationSensitivity;\n params.view.phi %= Math.PI * 2;\n }\n lastPosition = {\n x: e.clientX,\n y: e.clientY\n };\n\n }, false);\n canvas.addEventListener(\"mouseup\", function () {\n mouseIsDown = false;\n }, false);\n}", "clearCanvas() {\n this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n }", "function vxlCameraInteractor(){\r\n\tthis.camera = null;\r\n}", "stop() {\n clearInterval(this.animation);\n this.canvas.clear();\n }", "clear()\n {\n this.context.setTransform(1, 0, 0, 1, 0, 0);\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n }", "destroy() {\n this.viewer = undefined;\n if (!isNullOrUndefined(this.pageCanvasIn)) {\n this.pageCanvasIn.innerHTML = '';\n }\n this.pageCanvasIn = undefined;\n }", "function ClearCanvas()\n{\n AddStatus(\"Entering ClearCanvas\");\n try\n {\n // Store the current transformation matrix\n ctx.save();\n\n // Use the identity matrix while clearing the canvas\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0,0, canvas.width, canvas.height);\n \n // Restore the transform\n ctx.restore();\n }\n catch(err)\n {\n AddStatus(err.message,true);\n }\n AddStatus(\"Exiting ClearCanvas\");\n}", "clear() {\n this.context.setTransform(1, 0, 0, 1, 0, 0);\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n }", "clear() {\n this.context.setTransform(1, 0, 0, 1, 0, 0);\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n }", "function deactivateDraw() {\r\n measureConfig.isActive = false;\r\n measureConfig.activeFeature = null;\r\n measureButton.classList.toggle(\"esri-draw-button-selected\");\r\n pointerDownListener.remove();\r\n pointerMoveListener.remove();\r\n doubleClickListener.remove();\r\n }", "dispose() {\n window.removeEventListener('mousedown', this.handleMouseDown);\n window.removeEventListener('resize', this.handleWindowResize);\n //window.cancelAnimationFrame(this.requestID);\n \n this.raycaster = null;\n this.el = null;\n\n this.controls.dispose();\n }", "destroy() {\n if (this.frameBuffer.stencil) {\n this.gl.deleteRenderbuffer(this.frameBuffer.stencil);\n }\n this.frameBuffer.destroy();\n\n this.frameBuffer = null;\n this.texture = null;\n }", "destroyWebGL() {\n // if you want to totally remove the WebGL context uncomment next line\n // and remove what's after\n //this.curtains.dispose();\n\n // if you want to only remove planes and shader pass and keep the context available\n // that way you could re init the WebGL later to display the slider again\n if(this.shaderPass) {\n this.curtains.removeShaderPass(this.shaderPass);\n }\n\n for(var i = 0; i < this.planes.length; i++) {\n this.curtains.removePlane(this.planes[i]);\n }\n }", "unlockCamera(camera) {\n\t\tlet cameraControls = this._camerasControls[camera._uuid];\n\n\t\tif (cameraControls != null) {\n\t\t\tcameraControls.locked = false;\n\t\t}\n\t\telse {\n\t\t\tconsole.warn(\"Cannot lock the camera. Controls for the given camera do not exist.\")\n\t\t}\n\t}", "renderCaman(trace = true){\n\n const { brightness, contrast } = this.state.settings;\n\n const sourceImage = this.state.image;\n const canvas = document.getElementById('caman');\n\n //Scope, oy vey!\n const traceImage = this.traceImage\n\n Caman('#caman', sourceImage, function() {\n\n //this.replaceCanvas(canvas);\n this.revert(canvas); //THIS IS IT YES\n this.brightness(brightness);\n this.contrast(contrast);\n this.render(function(){\n\n //Allow some operations to trigger trace, some to avoid\n if(trace){ \n traceImage(this.toBase64());\n }\n\n });\n\n\n })\n\n }", "function resetCanvas() {\n drawingHistory = [];\n drawingPoints = [];\n\n // Set viewport\n gl.viewport(0, 0, canvas.width, canvas.height);\n\n // Set clear color\n gl.clearColor(1.0, 1.0, 1.0, 1.0);\n\n // Clear <canvas> by clearing the color buffer\n gl.clear(gl.COLOR_BUFFER_BIT);\n\n // Handle extents\n let proj = ortho(0.0, 640.0, 0.0, 480.0, -1.0, 1.0);\n let projMatrix = gl.getUniformLocation(program, \"projMatrix\");\n gl.uniformMatrix4fv(projMatrix, false, flatten(proj));\n\n // Resize canvas and viewport\n adjustCanvasViewport(640, 480);\n}", "function stopCode() {\n\t// Remove listeners\n\twebglCanvas.onclick = null;\n\twindow.onkeydown = null;\n\n\t// Stop rendering and clear canvas.\n\tif (anim_id && renderer) {\n\t\tcancelAnimationFrame(anim_id);\n\t\trenderer.setClearColor(0x000000);\n\t\trenderer.clear();\n\t\trenderer.dispose();\n\t\tscene = new THREE.Scene();\n\t}\n}", "function resetCanvas(){\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n // Restore the transform\n ctx.restore(); // Clears the specific canvas completely for new drawing\n}", "clearCurrentFrame() {\n this.canvas.clearRect(0, 0, this.canvasWidth, this.canvasHeight);\n }", "function clearCanvas() {\n canvasContext.clearRect(0, 0, width, height);\n cancelAnimationFrame(id);\n console.log(\"Canvas Cleared\");\n }", "function Start(){\n sw = false;\n cam0.GetComponent(AudioListener).enabled = true;\n \n cam1.GetComponent(AudioListener).enabled = false ;\n \n CameraWalk();\n //anpan.SetActive(false);\n \n}", "function resetView() {\n\t\t\t\t\tif (imageAspect < canvasAspect) {\n\t\t\t\t\t\tplane.position.set(0, 0, -1);\n\t\t\t\t\t\tmaxZoomOut = -1;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tvar z = (imageAspect / 2) / Math.tan(angleX);\n\t\t\t\t\t\tplane.position.set(0, 0, -z);\n\t\t\t\t\t\tmaxZoomOut = -z;\n\t\t\t\t\t}\n\t\t\t\t\tif (renderer) {\n\t\t\t\t\t\trender();\n\t\t\t\t\t}\n\t\t\t\t}", "unbind(){\n gl.bindFramebuffer(FRAMEBUFFER,null);\n }", "function clearCache() {\n navigator.camera.cleanup();\n}", "function removeCanvas() {\n popCanvas.firstChild.remove();\n popCanvas.firstChild.remove();\n scene.dispose();\n engine.dispose();\n}", "shutDown() {\n if (this._isShutDown) return;\n document.body.removeChild(this._canvas);\n this._isShutDown = true;\n }", "function removeScene () {\n cancelAnimationFrame(raf);\n\n stage.removeChildren();\n stage.destroy(true);\n\n container.removeChild(canvas);\n}", "recalibrateCameraBox() {\n\t\tthis.turnOnOffCamera(true);\t\t\n\t}", "clearCanvas() {\n\t\tif (this._canvas) {\n\t\t\tconst ctx = this._canvas.getContext('2d');\n\t\t\tctx.clearRect(0, 0, this._canvas.width, this._canvas.height);\n\t\t}\n\t}", "deactivateHouse() {\r\n this.lightOn = false;\r\n this.light.visible = false;\r\n }", "clearCanvas() {\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n }", "clearCanvas( )\r\n {\r\n this.objs = [];\r\n console.log( \"Cleared scene and canvas.\" )\r\n\r\n }", "function clearCanvas() {\n active = false;\n while(canvas.firstChild) { \n canvas.removeChild(canvas.firstChild); \n } \n}", "clearCanvas() {\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n }", "function updateCameraForRender(self) {\n var cam = self.noa.camera\n var tgt = cam.getTargetPosition()\n self._cameraHolder.position.copyFromFloats(tgt[0], tgt[1], tgt[2])\n self._cameraHolder.rotation.x = cam.pitch\n self._cameraHolder.rotation.y = cam.heading\n self._camera.position.z = -cam.currentZoom\n\n // applies screen effect when camera is inside a transparent voxel\n var id = self.noa.getBlock(self.noa.camera.getPosition())\n checkCameraEffect(self, id)\n}", "clearCanvas() {\n const context= this.state.context;\n context.fillStyle = 'black';\n context.fillRect( 0, 0, this.state.engine.maxWidth, this.state.engine.maxHeight );\n }", "deactivate() {\n if (!this.isActive || this.isMobileAccessibility) {\n return;\n }\n this.isActive = false;\n window.document.removeEventListener('mousemove', this._onMouseMove, true);\n window.addEventListener('keydown', this._onKeyDown, false);\n this.renderer.off('postrender', this.update);\n if (this.div.parentNode) {\n this.div.parentNode.removeChild(this.div);\n }\n }", "function Init() {\n // Get context handles\n CanvasHandle = document.getElementById(\"canvas\");\n CanvasHandle.width = ratioX * scale;\n CanvasHandle.height = ratioY * scale;\n ContextHandle = CanvasHandle.getContext(\"2d\");\n CanvasWidth = ContextHandle.canvas.clientWidth;\n CanvasHeight = ContextHandle.canvas.clientHeight;\n\n // Create an image backbuffer\n BackCanvasHandle = document.createElement(\"canvas\");\n BackContextHandle = BackCanvasHandle.getContext(\"2d\");\n BackCanvasHandle.width = CanvasWidth;\n BackCanvasHandle.height = CanvasHeight;\n\n // Set line style\n BackContextHandle.lineCap = \"butt\";\n BackContextHandle.lineJoin = \"round\";\n\n // Get the canvas center\n CenterX = CanvasWidth / 2;\n CenterY = CanvasHeight / 2;\n Camera = {x:0, y:0, z:1};\n}" ]
[ "0.658506", "0.6497503", "0.6454346", "0.63176316", "0.62996215", "0.62899226", "0.62899226", "0.6285392", "0.62831795", "0.6243367", "0.6235605", "0.60777104", "0.60646755", "0.6027615", "0.6012857", "0.60096276", "0.5999399", "0.5989519", "0.59323305", "0.59309286", "0.5920549", "0.5907727", "0.5900784", "0.5857636", "0.58540165", "0.5840518", "0.5831512", "0.5821619", "0.5817379", "0.5809155", "0.58050805", "0.57890975", "0.57867056", "0.5764887", "0.5735158", "0.573292", "0.57206666", "0.5715957", "0.57102305", "0.57094103", "0.56992114", "0.5698559", "0.56980175", "0.5689312", "0.5688698", "0.5687872", "0.5682153", "0.5671578", "0.56702507", "0.56650573", "0.56647396", "0.5660396", "0.5659596", "0.5657938", "0.5653432", "0.56507105", "0.56495374", "0.5648465", "0.5638589", "0.5637237", "0.56346864", "0.5633805", "0.5631869", "0.56301177", "0.5617244", "0.56170034", "0.56155616", "0.56111133", "0.5603965", "0.55973256", "0.5592788", "0.5592788", "0.55906636", "0.5587136", "0.5586122", "0.5577396", "0.5575682", "0.5574603", "0.55685866", "0.5550359", "0.5545601", "0.5542753", "0.5530368", "0.55263406", "0.5524568", "0.55230516", "0.5517956", "0.5509091", "0.55052435", "0.5501588", "0.5499162", "0.5490137", "0.5479053", "0.5474146", "0.54721785", "0.5470601", "0.5466685", "0.5457524", "0.54528224", "0.5447408", "0.54417485" ]
0.0
-1
Attempt to autocorrect the user's input. Inheriting classes override this method.
ac(inp) { return inp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function correct(word) {\n \n}", "function processInputCommand()\n {\n var inputText = my.html.input.value\n var goodChars = my.current.correctInputLength\n\n if (inputCommandIs('restart') || inputCommandIs('rst')) {\n location.href = '#restart'\n } else if (inputCommandIs('fix') || inputCommandIs('xxx')){\n my.html.input.value = inputText.substring(0, goodChars)\n updatePracticePane()\n } else if (inputCommandIs('qtpi')) {\n qtpi()\n }\n }", "correct() {\n\n\n }", "function promptCheck() {\n if (askLowerCase === false && askNumbers === false && askUpperCase === false && askSpecialCharacters === false) {\n window.alert(\"No character type selected please try again\");\n event.StopPropagation();\n return \n }\n }", "checkAutoCompletion(targetInput) {\n if (!targetInput)\n return;\n if (targetInput.value) {\n // if value is already set, we set the value directly\n this.setAutoCompleteValue(targetInput.value);\n }\n else {\n // if value is not set, we start listening for it\n targetInput.addEventListener('input', e => {\n const value = e.target.value;\n this.setAutoCompleteValue(value);\n });\n }\n }", "function initialPrompt() {\n word = input.question(\"\\nLet's play some scrabble! Enter a word: \");\n\n word = word.toLowerCase();\n\n return word;\n}", "function guessAnimal(animal) {\n currentAnswer = animal.toLowerCase();\n console.log(currentAnswer);\n}", "function initialPrompt() {\n console.log(\"Let's play some scrabble!\\n\");\n let userWord = input.question(\"Enter a word to score: \");\n return userWord.toLowerCase();\n}", "getUserInput() {\n const word = this.input.value;\n\n this.input.innerHTML = '';\n\n return word.toLowerCase();\n }", "function easy() {\n inquirer.prompt([{\n type: \"input\",\n message: basic[counter].front + \"\\nAnswer:\",\n name: \"userInput\"\n }]).then(function(answer) {\n //put everything to lowercase for comparison values. That way if a user doesnt capitalize they still get the correct answer\n if (answer.userInput.toLowerCase() === basic[counter].back.toLowerCase()) {\n console.log(\"Correct\");\n correct++;\n } else {\n console.log(\"Incorrect\");\n }\n if (counter < basic.length - 1) {\n counter++\n easy();\n } else {\n console.log(\"Game Over\");\n console.log(\"You got: \" + correct + \" out of \" + basic.length + \" Right\");\n playagain();\n }\n })\n}", "function inputLetters(userInput){\n\n\tif(!guessed.innerHTML.toLowerCase().includes(userInput)){\n\t\treturn userInput.toUpperCase();\n\t\tstrGuesses += userInput.toUpperCase();\n\t} else {\n\t\treturn \"\";\n\t}\n\t\n}", "function updateComputerInput() {\n computerGuess.value = computerGuessWord();\n}", "function OnCorrectChoice() {\n //Gets player name input: executes once\n if (!nameInputted) {\n if ($(\"name\").value !== \"\") {\n name = $(\"name\").value;\n //If inputted value is null, the character's name remains the default\n }\n nameInputted = true;\n }\n \n //Progresses game, executes for all stages of the game\n progressGame(tracker);\n}", "function guess()\n{\n var guess = document.getElementById(\"userInput\");\n \n controller.processGuess(guess.value);\n \n guess.value = \"\"; // resets user submission box \n}", "function four() {\n var hoowah = prompt('Was Dayne an Army Ranger?')\n if (hoowah === 'y' || hoowah === 'yes' || hoowah === 'n' || hoowah === 'no') {\n hoowah = hoowah.toUpperCase()\n console.log(hoowah + ', Dayne was not in the Army.');\n }\n if (hoowah === 'NO') {\n alert('Correct.')\n correctanswer++;\n } else {\n alert('Incorrect.')\n }\n}", "function allowQuestion() { }", "function guessFullWordExecutor() {\n if (guessedWord === progress) {\n return;\n }\n if (mistakes === 11) {\n return;\n }\n\n let inputDiv = document.getElementsByClassName('typeWord')[0];\n\n let fullGuessWord = inputDiv.value;\n\n if (fullGuessWord !== guessedWord) {\n inputDiv.value = null;\n wrongGuess();\n return;\n }\n\n addMissingLettersToWord();\n win();\n}", "function checkAnswer(question, anwser){\n var userAnswer = readlineSync.question(question);\n \n //assuming all answers are of type string\n if(userAnswer.toLowerCase()===anwser.toLowerCase()){\n score+=1;\n console.log(`You are right!\ncurrent score: ${score}\n-------------`);\n }else{\n score-=1;\n console.log(`You are wrong!\ncurrent score: ${score}\n-------------`);\n }\n}", "function checkAnswer(question, anwser){\n var userAnswer = readlineSync.question(question);\n \n //assuming all answers are of type string\n if(userAnswer.toLowerCase()===anwser.toLowerCase()){\n score+=1;\n console.log(`You are right!\ncurrent score: ${score}\n-------------`);\n }else{\n score-=1;\n console.log(`You are wrong!\ncurrent score: ${score}\n-------------`);\n }\n}", "function getUserChoice() {\n userChoice = prompt(\"choose R, P or S\");\n userChoice = userChoice.toLowerCase();\n validateChoice();\n}", "function tionName(UserPrompt) {\n \nvar valid;\n var input = prompt(\"What is your name?\");\n input = input.toLowerCase();\n if (input != \"chris\"){\n prompt(\"You did not get it, Please try again.\");\n }else{\n console.log(\"You put \"+input+\" Good Job!\");\n }\n}", "function uppercasePrompt() {\n uppercase = confirm(\"Should your password include uppercase letters?\");\n if (uppercase) {\n possibleChars = possibleChars.concat(uppercaseChars);\n }\n numeralsPrompt();\n}", "function checkAnswer(guess) {\n console.log(\"Checking guess: \" + guess);\n\n // Clear the answer field\n window.answerTextField.value = \"\";\n\n // Re-focus the answer field\n window.answerTextField.focus();\n\n if ( window.gameMode == \"anagram\") {\n if ( guess.toLowerCase() == window.currentWord.toLowerCase() ) {\n console.log(\"Correct\");\n return true;\n }\n else {\n console.log(\"Incorrect\");\n return false;\n }\n }\n else {\n if ( window.correctLetters.includes(guess) ) {\n console.log(\"Correct\");\n return true;\n }\n else {\n console.log(\"Incorrect\");\n return false;\n }\n }\n\n}", "changeHandler(event) {\n this.answer = event.target.value.toLowerCase();\n }", "function lowercasePrompt() {\n lowercase = confirm(\"Should your password include lowercase letters?\");\n if (lowercase) {\n possibleChars = possibleChars.concat(lowercaseChars);\n }\n uppercasePrompt();\n\n}", "function keyTypedEvent(event) {\n // Make sure the input is part of the alphabet\n var alphabet = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\",\n \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\"];\n\n // Get the value of our answer box if it isn't empty\n if ( event.target.value != \"\" ) {\n var guess = event.target.value.toLowerCase();\n }\n\n if ( window.gameMode == \"anagram\" ) {\n // Check if the answer is correct\n if ( checkAnswer(guess) == true ) {\n // If it is, add score, generate a new word and increment wordsAnswered\n addScore();\n newWord();\n // If sound is enabled, play the correct sound\n if (window.sfxEnabled === true) {\n window.correctSound.play();\n // Restart the sound in case it is already playing\n window.correctSound.currentTime = 0;\n }\n }\n else {\n // If it isn't, lower their score\n subtractScore();\n if (window.sfxEnabled === true) {\n // If sound is enabled, play the incorrect sound\n window.incorrectSound.play();\n // Restart the sound in case it is already playing\n window.incorrectSound.currentTime = 0;\n }\n }\n }\n else if ( window.gameMode == \"filltheblanks\" ) {\n // Make sure we entered a valid character\n if ( alphabet.includes(guess) ) {\n if ( checkAnswer(guess) == true ) {\n // If it is, add it to the correct guesses (if not duplicate)\n if ( !correctGuesses.includes(guess) ) {\n correctGuesses.push(guess);\n // If sound is enabled, play the correct sound\n if (window.sfxEnabled === true) {\n window.correctSound.play();\n // Restart the sound in case it is already playing\n window.correctSound.currentTime = 0;\n }\n }\n // Clear the correct paragraph before updating it\n window.correctParagraph.innerHTML = \"Correct: \";\n for (correctAttempt in window.correctGuesses ) {\n window.correctParagraph.innerHTML += window.correctGuesses[correctAttempt] + \" \";\n }\n // Replace blanks with actual letters\n fillBlanks(guess);\n\n // Check if we've filled all the blank spaces\n if ( !blankedWord.includes(\"_\") ) {\n // If it is, add score, generate a new word and increment wordsAnswered\n addScore();\n newWord();\n // If sound is enabled, play the correct sound\n if (window.sfxEnabled === true) {\n window.correctSound.play();\n // Restart the sound in case it is already playing\n window.correctSound.currentTime = 0;\n }\n }\n }\n else {\n // If it isn't, add it to incorrect guesses (if not duplicate)\n if ( !incorrectGuesses.includes(guess) ) {\n incorrectGuesses.push(guess);\n // If sound is enabled, play the incorrect sound\n if (window.sfxEnabled === true) {\n window.incorrectSound.play();\n // Restart the sound in case it is already playing\n window.incorrectSound.currentTime = 0;\n }\n }\n // Clear the incorrect paragraph before updating it\n window.incorrectParagraph.innerHTML = \"Incorrect: \";\n for (incorrectAttempt in window.incorrectGuesses ) {\n window.incorrectParagraph.innerHTML += window.incorrectGuesses[incorrectAttempt] + \" \";\n }\n subtractScore();\n }\n }\n else {\n // If sound is enabled, play the incorrect sound\n if (window.sfxEnabled === true) {\n window.incorrectSound.play();\n // Restart the sound in case it is already playing\n window.incorrectSound.currentTime = 0;\n window.answerTextField.value = \"\";\n }\n }\n }\n\n}", "searchUser(){\r\n let userQueryRegex = /.*\\S.*/; // Input cannot be blank\r\n let userQuery = read.question(\"Search Quiz User: (-1 to exit)\\n>> \", {limit: userQueryRegex, limitMessage: \"Type something!\"});\r\n\r\n if(userQuery == -1) this.searchAQuiz();\r\n else this.searchUserFuzzy(userQuery);\r\n }", "set allowSpellCheckAndSuggestion(value) {\n this.spellSuggestionInternal = value;\n }", "function user_inp() {\n //create a array of all the subsets of a random word, array to hold guessed words, counter for correct guesses\n let good_words = all_words(word)\n let guessed_words = [];\n let correct_counter = 0;\n let shuffle_word = shuffler(word);\n //starting screen with scrammbled word and hidden words\n console.log(\"Scrambled Key Word: \" + shuffle_word.join(\"\"));\n console.log('\\n');\n for(let i = 0; i < good_words.length; i++) {\n console.log(hide_words(good_words[i]))\n }\n //while loop that goes till all words are guessed\n while(correct_counter != good_words.length) {\n let input = prompt(\"Enter a guess:\" );\n //shuffle letters\n if(input == '*') {\n shuffle_word = shuffler(shuffle_word);\n alert(\"SHUFFLING LETTERS \\n Press OK to continue\")\n //clear old console output and changes it using the newly shuffled word\n console.clear();\n console.log(\"Scrambled Key Word: \" + shuffle_word.join(\"\"));\n console.log('\\n');\n for(let i = 0; i < good_words.length; i++) {\n if(guessed_words.includes(good_words[i])) {\n console.log(good_words[i]);\n }\n else{\n console.log(hide_words(good_words[i]))\n }\n }\n }\n //already guessed\n else if(guessed_words.includes(input)) {\n alert(\"Already chose this word, try again\")\n }\n //cancel button\n else if(input == null) {\n break;\n }\n //not a english word, too small/big\n else if(!dictionary.includes(input) && (input.length < 3 || input.length > 6)) {\n alert(\"Not an english word!\")\n }\n else if(input.length < 3) {\n alert(\"Word is too small\")\n }\n else if(input.length > 6) {\n alert(\"Word is too big\")\n }\n //guessed the right word, prints updated hidden words\n else if(good_words.includes(input)) {\n alert(\"Correct! \" + input + \" is one of the words!\")\n //adds input to guessed_word array, updates correct_counter\n console.clear();\n guessed_words.push(input)\n correct_counter++;\n console.log(\"Scrambled Key Word: \" + shuffle_word.join(\"\"));\n console.log('\\n');\n //update hidden words board to show correct word\n for(let i = 0; i < good_words.length; i++) {\n if(guessed_words.includes(good_words[i])) {\n console.log(good_words[i]);\n }\n else{\n console.log(hide_words(good_words[i]))\n }\n }\n }\n //incorrect guess\n else{\n alert(\"Incorrect! \" + input + \" is not a word!\")\n }\n }\n //if all words are guessed\n if(correct_counter == good_words.length) {\n alert(\"CONGRATULATION!!! YOU GUESSED ALL THE WORDS! \\n Press OK to show your results\")\n }\n //finishing screen with correct guesses, and reveals the hidden words\n console.clear();\n console.log(\"You got: \" + correct_counter + \" out of \" + good_words.length + \" correct\");\n console.log('\\n');\n for(let i = 0; i < good_words.length; i++) {\n console.log(good_words[i])\n }\n\n /**\n * Function that takes an array of letters and shuffles them around to\n * produce a shuffled result of the original array of letters\n * \n * @param {*} arr array of letters to be shuffled\n * @returns array of letters that have been shuffled from the original\n */\n function shuffler(arr) {\n for(let i = 0; i < arr.length; i++) {\n //chooses a random number out of the length of the array and the element at that index\n let random_idx = Math.floor(Math.random() * arr.length);\n let random_pick = arr[random_idx];\n //uses splice to switch the two indexs\n arr.splice(random_idx, 1, arr[i]);\n arr.splice(i, 1, random_pick);\n }\n return arr;\n }\n}", "searchTitle(){\r\n let userQueryRegex = /.*\\S.*/; // Input cannot be blank\r\n let userQuery = read.question(\"Search Quiz Title: (-1 to exit)\\n>> \", {limit: userQueryRegex, limitMessage: \"Type something!\"});\r\n\r\n if(userQuery == -1) this.searchAQuiz();\r\n else this.searchTitleFuzzy(userQuery);\r\n }", "function initialPrompt() {\n // let enterWord = \"\";\n enterWord = input.question(\"Let's play some scrabble!\\nEnter a word to score: \"); //used the input syntax to ask a question \n\n // console.log(oldScrabbleScorer.enterWord); //for testing\n // console.log(oldScrabbleScorer(enterWord));\n return enterWord;\n}", "function answerIsIncorrect () {\r\n feedbackForIncorrect();\r\n}", "function guessTheLetter() {\r\n var chr = $('#guessLetter').val();\r\n \r\n if(chr != null && chr != '') {\r\n submitLetter(chr);\r\n }\r\n // Restore focus on input field\r\n $('#guessLetter').focus();\r\n}", "playGame() {\n let guessed = this.guessedLetters;\n inquirer\n .prompt({\n type: \"input\",\n message: \"Guess a letter! Any letter!\",\n name: \"guess\",\n validate: function singleLetter(input) {\n if (input.length != 1 || guessed.includes(input)) {\n console.log(\n \"\\n Please enter a single letter that you have not yet guessed!\"\n );\n return false;\n }\n return true;\n }\n })\n .then(answer => {\n this.guessedLetters.push(answer.guess);\n this.selectedWord.guess(answer.guess);\n this.guesses--;\n this.refreshPage();\n if (this.selectedWord.word === this.selectedWord.display) {\n console.log(\n \"Congratulations, your word was: \" + this.selectedWord.word\n );\n this.score++;\n this.playAgain();\n } else if (this.guesses === 0) {\n console.log(\n \"You've run out of gueses! Your word was: \" + this.selectedWord.word\n );\n this.playAgain();\n } else {\n this.playGame();\n }\n });\n }", "function correctGuess() {\n console.log(`\\n You guessed right!\\n`.bgBlue);\n if (\n chosenWord.replace(/ /g, \"\") == gameWord.displayWord().replace(/ /g, \"\")\n ) {\n console.log(gameWord.displayWord());\n console.log(`\\n You Win!!!!\\n`.bgMagenta);\n chosenWord = \"\";\n gameWord = \"\";\n select = 0;\n counter = 0;\n startGame();\n } else {\n promptUser();\n }\n}", "function check(word) {\n //For the purposes of the check() functiion, we must turn the word into an array\n //We will do this by splitting the word at each character\n var wordArray = word.split(\"\");\n //Make sure it's working\n console.log(word + \" as an array:\");\n console.log(wordArray);\n //Re-focus the text input\n document.getElementById(\"userGuess\").focus();\n //Get the value of what user entered into text field, and convert it to lower case\n var userGuess = document.getElementById(\"userGuess\").value.toLowerCase();\n //Get the value of userWordGuess, and convert it to lower case\n var userWordGuess = document.getElementById(\"userWordGuess\").value.toLowerCase();\n //After entered value has been obtained, clear both input text fields\n document.getElementById(\"userGuess\").value = \"\";\n document.getElementById(\"userWordGuess\").value = \"\";\n //Make sure it's working \n console.log(\"The user guessed: \" + userGuess);\n //Make sure the user entered a string\n console.log(userGuess + \" is a \" + (typeof(userGuess)));\n\n //Get userWordGuess out of the way\n if ((userGuess === \"\") && (userWordGuess === word)) {\n outcome(word, youWon);\n horse.play();\n } else if ((userGuess === \"\") && (userWordGuess !== \"\") && (userWordGuess !== word)) {\n outcome(word, gameOver);\n flute.play();\n //This is where you start to weed out all inputs that are not letters in the alphabet\n } else if (alphabet.includes(userGuess) === false) {\n correctOrIncorrect(\"Sorry, Charlie, if you wanna play, it's gotta be a letter\");\n console.log(\"User input is not a letter in the alphabet\");\n //Now that's out of the way, we can get down to business...\n //If user input is a letter in the word, reveal the guessed letters in the word\n //If user input is not a letter in the word, add to the 'incorrect guess' counter\n } else if (word.includes(userGuess)) {\n //Make sure user input is included in the word string\n console.log(\"userGuess is a letter in the alphabet? \" + (alphabet.includes(userGuess)));\n //Show the user that they made a correct answer, using the correctOrIncorrect function from earlier\n correctOrIncorrect(\"Way to go! You guessed a letter!\");\n cockAndFire.play();\n //Run a for-loop that compares the user guess against all indices in the array \n for (i = 0; i <= word.length; i++) {\n\t\n if (wordArray[i] === userGuess) {\n \n //Replace value at index \"i\" of array with userGuess\n startingSpacesArray[i] = userGuess;\t\n //Make sure letter has been added to array\n console.log(\"startingSpacesArray now looks like this: \" + startingSpacesArray);\n //Turn array into a string using the .join method, but with nothing (\"\") as the separator, instead of commas\n var newString = startingSpacesArray.join(\"\");\n //Make sure the string works\n console.log(\"The user will see this: \" + newString);\n //Add new string to the web page, where startingSpaces used to sit\n document.getElementById(\"word\").innerHTML = newString;\n //If user has guessed all the letters correctly, print a YOU WIN screen\n if (newString === word) {\n outcome(word, youWon);\n horse.play();\n }\n }\n }\n //A player loses hangman after six wrong guesses: head, body, two arms, and two legs\n //Using the incorrectGuess variable defined earlier, this else-if will keep adding to the variable. \n //After six wrong guesses, the entire web page is overwritten with a \"GAME OVER\" screen \n } else if (word.includes(userGuess) === false) {\n //Make sure it's working\n console.log(\"userGuess is included in the word? \" + false);\n //Show the user that they made a correct answer, using the correctOrIncorrect function from earlier\n correctOrIncorrect(\"Tough luck, Chuck, you guessed wrong&hellip;\");\n cockAndDryFire.play();\n //Add to the incorrectGuess variable\n incorrectGuess++;\n document.getElementById(\"hangman\").innerHTML += svgArray[incorrectGuess];\n //Log how many incorrect guesses there have been\n console.log(\"# of incorrect guesses= \" + incorrectGuess + \"/6\");\n //Display wrong guesses to user, against how many guesses they have (6)\n document.getElementById(\"wrongGuessCounter\").innerHTML = \"Number of wrong guesses: <b>\" + incorrectGuess + \" / 6</b>\";\n //Show prior wrong guesses\n document.getElementById(\"wrongGuesses\").innerHTML = \"Your wrong guesses so far: \"\n document.getElementById(\"guessesSoFar\").innerHTML += userGuess + \" \";\n //Once the counter reaches 6, the game over screen is triggered\n if (incorrectGuess >= 6) {\n outcome(word, gameOver);\n flute.play();\n } \n }\n}", "function suggestion() {\n let randomAdjective = findRandomEntry(adjectives);\n let randomAgent = findRandomEntry(agents);\n let randomVerb = findRandomEntry(verbs);\n let randomPreposition = findRandomEntry(prepositions);\n let randomEnding = findRandomEntry(endings);\n currentSuggestion = (randomAdjective + \" \" + randomAgent + \" \" + randomVerb + \" \" + randomPreposition + \" \" + randomEnding);\n speak(currentSuggestion);\n boxWrite(currentSuggestion + ' \\n (If you would like to hear this again, say \"Could you repeat that?\")')\n}", "function initialPrompt() {\n let word = input.question(\"Let's play some scrabble! \\n \\n Enter a word to score:\");\n // console.log(oldScrabbleScorer(word)\n return word\n}", "function promptUser() {\n if (counter < 8) {\n console.log(gameWord.displayWord());\n inquirer\n .prompt([\n {\n type: \"input\",\n name: \"letter\",\n message: \"\\n Pick a letter and press enter.\"\n }\n ])\n .then(function(data) {\n checkAnswer(data);\n });\n } else {\n console.log(\"\\n Sorry, you ran out of guesses.\\n\".red);\n console.log(`The correct answer was ${chosenWord}`.bgGreen);\n chosenWord = \"\";\n gameWord = \"\";\n select = 0;\n counter = 0;\n startGame();\n }\n}", "function userInput(letter){\n \n\n}", "function tryAgain() {\n\tvar x = prompt(\"classroom or students\");\nvar lowerCase = x.toLowerCase();\nif ((lowerCase === \"classroom\") || (lowerCase === \"students\")) {\n window.alert(stem2[lowerCase])\n}\nelse {\n window.alert(\"You did not pay attention\");\n tryAgain();\n}\n}", "function initialPrompt() {\n console.log(\"Let's play some scrabble!\");\n return input.question(\"Enter a word to score:\");\n }", "function manage_user_input(){\n let input = $(\"#user_input\").val().toUpperCase();\n if(input.length > 0 && !all_user_input.includes(input)){\n $(\"#game_message_p\").attr(\"hidden\",true);\n $(\"#user_input\").val(\"\");\n let isTarget = check_user_input(input);\n store_user_input(input,isTarget);\n } else {\n $(\"#game_message_p\")\n .text(\"Input too short (min length = 1) or you already tried this word.\")\n .attr(\"hidden\",false);\n }\n}", "function determineLowercase() {\n var lowercaseCheck = prompt(\"Do you want to include lowercase letters in your password? \\n(Yes or No)\");\n lowercaseCheck = lowercaseCheck.toLowerCase();\n\n if (lowercaseCheck === null || lowercaseCheck === \"\") {\n alert(\"Please answer Yes or No\");\n determineLowercase();\n } else if (lowercaseCheck === \"yes\" || lowercaseCheck === \"y\") {\n lowercaseCheck = true;\n } else if (lowercaseCheck === \"no\" || lowercaseCheck === \"n\") {\n lowercaseCheck = false;\n } else {\n alert(\"Please answer Yes or No\");\n determineLowercase();\n }\n\n return lowercaseCheck;\n}", "function checkAnswer(){\n trueAnswer = returnCorrectAnswer();\n userAnswer = getInput();\n// this if statement is stating if user inputs the right answer what happens and if not what happens\n if(userAnswer === trueAnswer){\n var messageCorrect = array[global_index].messageCorrect;\n score ++;\n swal({\n title: messageCorrect,\n text: \"You got \" + score + \" out of 8 correct.\",\n });\n }\n else{\n var messageIncorrect = array[global_index].messageIncorrect;\n swal({\n title: messageIncorrect,\n text: \"You got \" + score + \" out of 8 correct.\",\n });\n }\n }", "function checkGuess(){\r\n guesstext=guesstext.toUpperCase();//country array is in upper case, so change guess to uppercase\r\n if(guesstext==answer){//if the guess was correct\r\n answer=pickAnswer();//find a new answer\r\n chances=3; score+=10; guess.value=\"\";//reset chances to 3, add 10 to score and clear guess input field\r\n alert(guesstext+\"! You're right!\");//congratulate the user\r\n }\r\n else{chances-=1; guess.value=\"\";//guess is not correct, subtract one chance and clear the input field\r\n if(chances>0){alert(\"Nope. Try again.\");}//if there are chances left, ask user to try again\r\n }\r\n showGui();// turns on the engine and updates info\r\n }", "function getGuess() {\n \"use strict\";\n return prompt('Guess a letter, or click Cancel to stop playing.');\n}", "function q1() {\n\n var answerToFirstQ = prompt('Was I born in the United States?').toUpperCase();\n\n if (answerToFirstQ === 'N' || answerToFirstQ === 'NO') {\n alert('Correct! Looks like you actually read the bio!');\n userScore++\n }else if (answerToFirstQ === 'Y' || answerToFirstQ === 'YES') {\n alert('Um, ya dun goofed!');\n }else{alert('Please type accurately! Answer YES or NO!')};\n\n}", "function updateGuess(ev) {\n if (hasGameEnded(guesses, secret)) {\n return;\n }\n let text = ev.target.value;\n let fieldLength = text.length;\n if (fieldLength > 4) {\n text = text.substr(0, 4);\n }\n setGuess(text);\n }", "function verifyInput(e) {\r\n var code = e.keyCode || e.which;\r\n\r\n // Delete or Backspace\r\n if(code == 8 || code == 46) {\r\n $(this).val('');\r\n }\r\n // Enter\r\n else if(code == 13) {\r\n guessTheLetter();\r\n }\r\n //65-90\r\n else if(code >= 65 && code <= 90) {\r\n var l = String.fromCharCode(code).toUpperCase();\r\n if(isNewLetter(l))\r\n $(this).val(l);\r\n else {\r\n displayResult('#feedback-already-used');\r\n }\r\n }\r\n\r\n e.preventDefault();\r\n e.stopPropagation();\r\n return null;\r\n}", "function forceLower(strInput) {\r\n strInput.value = strInput.value.toLowerCase();\r\n}", "function guessLetter(){\n //Prompt user to enter a letter\n if (display < aWord.letters.length || guessesRemaining > 0) {\n inquirer.prompt([\n {\n name: \"letter\",\n message: \"Guess a letter:\",\n //verify the guess is a letter\n validate: function(value) {\n if(isLetter(value)){\n return true;\n } \n else {\n return false;\n }\n }\n }\n ]).then(function(guess) {\n //letters to upper case\n\tguess.letter.toUpperCase();\n\tconsole.log(\"You guessed: \" + guess.letter.toUpperCase());\n\t//Assume correct guess \n\tuserGuessedCorrectly = false;\n\t//check if letter has already been guessed\n\tif (lettersGuessedArray.indexOf(guess.letter.toUpperCase()) > -1) {\n\t\t//If user already guessed a letter, run inquirer again to prompt them to enter a different letter.\n\t\tconsole.log(\"You already guessed that letter. Enter another one.\");\n\t\tconsole.log(\"=============================\");\n\t\tguessLetter();\n\t}else if (lettersGuessedArray.indexOf(guess.letter.toUpperCase()) === -1) {\n\t\t//guessed letters.\n\t\tlettersGuessed = lettersGuessed .concat(\"\" + guess.letter.toUpperCase());\n\t\tlettersGuessedArray.push(guess.letter.toUpperCase());\n\t\t//Log guessed letters.\n\t\tconsole.log(\"Letters already guessed: \" + lettersGuessed );\n\n\t\t//check if letter matches word\n\t\tfor (i=0; i < aWord.letters.length; i++) {\n //If the user guess equals one of the letters\n if (guess.letter.toUpperCase() === aWord.letters[i].character && aWord.letters[i].correctLetter === false) {\n\t\t\t\t//Set correctLetter property for that letter equal to true.\n\t\t\t\taWord.letters[i].correctLetter === true;\n\t\t\t\t//Set userGuessedCorrectly to true.\n\t\t\t\tuserGuessedCorrectly = true;\n\t\t\t\t//aWord.underscores[i] = guess.letter.toUpperCase();\n\t\t\t\t//increment underscores\n\t\t\t\tdisplay++;\n\t\t\t}\n\t\t}\n\t\tconsole.log(\"Word to guess: \");\n\t\taWord.splitWord();\n\t\taWord.lettersNeeded();\n \t//If user guessed correctly...\n\t\tif (userGuessedCorrectly) {\n\t\t\t//correct guess \n\t\t\tconsole.log(\"Correct letter\");\n\t\t\tconsole.log(\"==============================\");\n\t\t\t//check if user won or lost\n\t\t\tcheckIfUserWon();\n\t\t}\n\n\t\t//Incorrect guess\n\t\telse {\n\t\t\t//Tell user they are incorrect\n\t\t\tconsole.log(\"Incorrect letter!\");\n\t\t\t//Decrease number reamining guesses\n\t\t\tguessesRemaining--;\n\t\t\tconsole.log(\"You have \" + guessesRemaining + \" guesses left.\");\n\t\t\tconsole.log(\"==================================\");\n\t\t\t//check if game is over won or lost\n\t\t\tcheckIfUserWon();\n\t\t}\n\t}\n});\n}\n}", "function promptForLetter() {\n inquirer.prompt([\n {\n name: \"letterGuess\",\n type: \"input\",\n message: \"Type a letter to guess: \"\n }\n ]).then(function(answer) {\n newWord.currentGuess(answer.letterGuess);\n\n console.log();\n \n var displayWord = newWord.createWord();\n console.log(chalk.yellow(displayWord) + \"\\n\"); // displays current version of word\n guessNum -= 1;\n console.log(chalk.red(\"Guesses Remaining: \") + chalk.white(guessNum) + \"\\n\");\n if (displayWord.includes(\"_\") && guessNum > 0) {\n promptForLetter();\n } else {\n if (!(displayWord.includes(\"_\"))) {\n console.log(chalk.magenta(\"Contgrats! You guessed correctly.\\n\"));\n } else {\n console.log(chalk.blue(\"Sorry, you did not guess correctly. The word was: \") + chalk.cyan(randomWord) +\"\\n\");\n }\n inquirer.prompt([\n {\n name: \"playGame\",\n type: \"confirm\",\n default: false,\n message: \"Would you like to play again?\"\n }\n ]).then(function(answer) {\n if (answer.playGame) {\n startGame();\n } else {\n process.exit();\n }\n });\n }\n });\n}", "function initialPrompt() {\n let userInput = null;\n let boolean = false;\n while (boolean == false) {\n userInput = input.question(\"Let's play some scrabble! \\nEnter a word to score: \");\n boolean = validateInput(userInput);\n }\n return userInput;\n}", "function askArmyQuestion() {\n var armyQuestion = prompt(userName + ', did I serve in the army?').toLowerCase();\n while (validAnswersArr.indexOf(armyQuestion) === -1) {\n armyQuestion = prompt(userName + ', did I serve in the army? Please answer with a yes or no').toLowerCase();\n }\n if (armyQuestion === 'yes' || armyQuestion === 'y') {\n //console.log(userName + ', you are correct!');\n scoreCounter++;\n alert(userName + ', you are correct!');\n } else {\n //console.log(userName + ', that is incorrect!');\n alert(userName + ', that is incorrect!');\n }\n}", "function playGame() {\n // Use Inquirer module to obtain need guess from CLI\n inquirer\n .prompt([\n {\n type: \"input\",\n message: \"Please guess a letter for the selected name of a Star Wars character.\",\n name: \"userGuess\",\n // Validate function to make sure no blank response is given, no more than 1 character is entered, and to make sure the character entered is a letter.\n validate: function validateUserGuess(userGuess) {\n var letters = /^[A-Za-z]+$/;\n if (userGuess !== \"\" && userGuess.length === 1 && userGuess.match(letters) !== null) {\n return true;\n }\n }\n },\n ]).then(function (inquirerResponse) {\n var guess = inquirerResponse.userGuess.toLowerCase();\n // Call method to see if letter has been guessed\n if (alreadyGuessed(guess) === false) {\n guessedLetter(guess);\n // Tests to see if name was correctly completed\n if (newWordObject.returnString() === newWordString) {\n console.log(\"\\nYou Guessed the name. CONGRADULATIONS!!!\\n\");\n playAgain();\n // check to make sure user still has guess left\n } else if (guessesLeft > 0) {\n playGame();\n // If you user runs out of guess and has not completed the word\n } else {\n console.log(\"\\nYou ran out of guesses. SORRY!!!\\n\");\n playAgain();\n }\n } else {\n playGame();\n }\n });\n}", "function correctPrompt() {\n // show the notification alert\n const notif = document.getElementById(\"notification\");\n notif.style.display = \"\";\n\n // if the user types in syntatically correct code\n // this is just checks if it is syntactically correct, not that it is the right code\n if (checkCode(editor.getValue())) {\n // give the user feedback that they're right\n notif.innerHTML = \"That's right!\";\n notif.className = \"success\";\n\n // hide the make corrections div since we're done correcting\n document.getElementById(\"makeCorrections\").style.display = \"none\";\n\n // generate a new problem\n promptText = generateProblem();\n setPrompt(promptText);\n\n // add ten to score for correct answer\n setScore(10);\n }\n else {\n // give the user feedback that they're wrong\n notif.innerHTML = \"That's wrong.\";\n notif.className = \"failure\";\n\n // take away five points for incorrect answer\n setScore(-5);\n }\n\n // hide the notification alert after 1 second\n setTimeout(() => notif.style.display = \"none\", 1000);\n}", "function hint() {\n if (!changing) {\n if (decScore()) {\n var done = false;\n\n for (var i = 0; i < 4; i++) {\n if ((alphabet[word[i]] != shown[i]) && (!done)) {\n pos = i;\n change(word[i]);\n done = true;\n }\n }\n } else {\n morePoints();\n\n }\n }\n}", "function inquire() {\n inquirer\n .prompt([\n {\n name: \"letter\",\n message: `${lives} lives left. pick a letter`\n }\n ])\n .then(function(ans) {\n // lastWord gives us a baseline to check for answer correctness\n let lastWord = mysteryWord.display();\n // validation takes only the first letter of input only with ans.letter[0]\n // the display is case sensitive, but the gameplay is case insensitive\n mysteryWord.guess(ans.letter[0].toUpperCase());\n mysteryWord.guess(ans.letter[0].toLowerCase());\n console.log(mysteryWord.display());\n // we compare the mystery word to the goal word to test for winning\n if (goalWord === mysteryWord.display()) {\n console.log(\"YOU WIN\");\n playAgain();\n // we compare the mystery word to the lastWord to see if nothing has changed, ergo incorrect guess\n } else if (lastWord === mysteryWord.display()) {\n lives -= 1;\n // when you are out of lives, you have lost, but don't despair, you may play again\n if (lives == 0) {\n console.log(\"YOU LOSE\");\n playAgain();\n } else {\n console.log(\"Nope\");\n inquire();\n }\n // if the word was correct\n } else {\n console.log(\"Nice\");\n inquire();\n }\n });\n}", "function checkAnswer() {\n\t\tif (answerChoice == currentQuestion.rightAnswer) {\n\t\t\t$(\"#hint\").text(currentQuestion.congratulations);\n\t\t\tcurrentQuestion.correct = true;\n\t\t\tupdateScore();\n\t\t} else {\n\t\t\tconsole.log('incorrect');\n\t\t\t$(\"#hint\").text(currentQuestion.sorry);\n\t\t};\n\t}", "function initialPrompt() {\n word=input.question(\"Let's play some scrabble! Enter a word to score:\");\n}", "ask() {\n let move = prompt('Which way? (W for Up, S for down, A for left and D for right)');\n switch(move.toLowerCase()) {\n case 'w':\n console.log('Moving up');\n this.y -= 1;\n break;\n case 's':\n console.log('Moving down');\n this.y += 1;\n break;\n case 'a':\n console.log('Moving left');\n this.x -= 1;\n break;\n case 'd':\n console.log('Moving right');\n this.x += 1;\n break;\n default:\n break;\n } \n }", "function doAnswer() {\r\n\tif(checkAnswer()) {\r\n\t\tdocument.getElementById(\"err\").innerHTML = \"\";\r\n\t\tdocument.getElementById(\"notif\").innerHTML = \"CORRECT\";\r\n\t} else {\r\n\t\tdocument.getElementById(\"notif\").innerHTML = \"\";\r\n\t\tdocument.getElementById(\"err\").innerHTML = \"MISTAKE\";\r\n\t}\r\n\t//\tclear all user input text\r\n\tdocument.getElementById(\"answer\").value = \"\";\r\n\t\r\n\t//\tFocus on input\r\n\tdocument.getElementById(\"answer\").focus();\r\n}", "playRound() {\n inquirer.prompt([\n {\n name: \"userLetter\",\n message: \"Guess a letter:\",\n // tried to use validate but didn't work\n // created my own validation process in next if/else statement below\n }\n ]).then(answer => {\n // cases to stop the round: input is not a letter, letter already guessed, input is not 1 character\n // need seperate if statement because user message will be different\n // else, push guess into userGuess array\n if (!(answer.userLetter.length === 1) || !this.letterBank.includes(answer.userLetter)) {\n this.stopRound(\"yellow\", \"Please input 1 letter\");\n \n } else if (this.userGuesses.includes(answer.userLetter)) {\n this.stopRound(\"yellow\", \"That letter has already been guessed\");\n\n } else {\n this.userGuesses.push(answer.userLetter);\n this.stopThisRound = false;\n }\n \n // if incorrect letter, tell user and display guess count\n // else, tell user correct and display guess count\n // also run check character method to fill-in underscores\n if (!this.word.includes(answer.userLetter) && !this.stopThisRound) {\n this.answerMessage(\"red\", \"Incorrect!\")\n this.numGuesses--;\n } else if (!this.stopThisRound) {\n this.wordObj.checkCharacter(answer.userLetter);\n this.answerMessage(\"green\", \"Correct!\");\n }\n \n // word as displayed to user\n this.displayedWord = this.wordObj.displayWord();\n \n // game lost/won or keep playing logic\n if (this.numGuesses === 0 && !this.stopThisRound) {\n this.endMessage(\"red\", \"YOU LOSE!\");\n this.playGameAgain();\n \n } else if (!this.displayedWord.includes(\"_\") && !this.stopThisRound) {\n // user won the round \n this.winCount++;\n this.endMessage(\"green\", \"YOU WIN!!\");\n this.playGameAgain();\n \n } else if (!this.stopThisRound) {\n this.playAnotherRound();\n } \n \n }).catch(error => {\n console.log(error);\n console.log(\"\");\n console.log(\"there has been an error\");\n });\n }", "handleInputAlice() {\n if (this.state.phaseNumber === 1) {\n this.setState({comment:\"Click on a Word!\"});\n }\n else if (this.state.phaseNumber === 3) {\n //guess mystery word\n if (this.state.aliceInput.toLowerCase() === this.state.mysteryWords[(this.state.mysteryWordId-1)].toLowerCase()){\n this.updatePhaseHUD(4);\n this.setState({phaseNumber:4, comment:\"You got it now!\", aliceNumber: 1});\n this.updateRightGuess();\n } else {\n this.updatePhaseHUD(4);\n this.setState({phaseNumber:4, comment:\"Wrong Guess but still very noice!\"});\n this.updateWrongGuess();\n }\n }\n else if (this.state.phaseNumber === 4) {\n this.setState({comment:\"The Tutorial is already over!\"});\n }\n else {\n this.setState({comment:\"It's not Alice's Turn!\"});\n }\n }", "function guessMyState(){\n var myAnswerOne = 'washington dc';\n var myState = prompt('What state am I from?');\n\n if(myState.toLowerCase() === myAnswerOne){\n alert('Wow. How did you know that?');\n correctAnswers ++;\n } else {\n alert('I am from ' + myAnswerOne + '.');\n }\n }", "function doAnsA (AnsA) {\n if (AnsA == \"A\" || AnsA == \"a\" || AnsA == 1) {\n return \"Correct\" ;\n } \n else {\n return \"Wrong\" ;\n }\n}", "function initialPrompt() {\n let word = input.question(\"\\nLet's play some scrabble! Enter a word: \");\n //console.log(oldScrabbleScorer(word));\n return word; //Pass word to next.\n}", "function determineUppercase(){\n uppercaseCheck = prompt(\"Would you like uppercase letters? \\n(Yes or No)\");\n uppercaseCheck = uppercaseCheck.toLowerCase();\n\n if (uppercaseCheck === null || uppercaseCheck === \"\"){\n alert(\"Aanswer Yes or No\");\n determineUppercase();\n\n }else if (uppercaseCheck === \"yes\" || uppercaseCheck ===\"y\"){\n uppercaseCheck = true;\n return uppercaseCheck;\n\n }else if (uppercaseCheck === \"no\" || uppercaseCheck ===\"n\"){\n uppercaseCheck = false;\n return uppercaseCheck;\n \n }else {\n alert(\"Answer Yes or No\");\n determineUppercase();\n }\n return uppercaseCheck;\n}", "function initialPrompt() {\n console.log(\"Let's play some scrabble!\");\n\n wordEntered = input.question(\"Enter a word to score: \");\n}", "function updateUser(){\n helpers.rl.question('\\nEnter user name to update: ', dealWithUserUpdate);\n}", "function updateGuess(event) {\n const re = /^[0-9\\b]+$/;\n if (event.target.value === \"\" || re.test(event.target.value)) {\n setGuess(event.target.value);\n }\n }", "function checkAnswer(data) {\n if (data.letter.length === 1 && /^[a-zA-Z]+/.test(data.letter)) {\n const letterChecker = data.letter.toUpperCase();\n const temp = gameWord.displayWord();\n gameWord.checkGuess(letterChecker);\n if (temp === gameWord.displayWord()) {\n console.log(\"\\n Sorry, wrong letter!\".bgYellow);\n counter++;\n console.log(8 - counter + \" guesses remaining.\".cyan);\n promptUser();\n } else {\n correctGuess();\n }\n } else {\n console.log(`\\nPlease enter a letter, one at a time.\\n`.bgRed);\n promptUser();\n }\n}", "function amIafraid() {\n var bigFear = prompt('Is her biggest fear heights?').toLowerCase();\n if (bigFear === 'no') {\n alert('Correct! My biggest fear is spiders!');\n points = points + 1;\n } else if (bigFear === 'n') {\n alert('Correct! My biggest fear is spiders!');\n } else {\n alert('Sorry, my biggest fear is spiders!');\n }\n console.log('Biggest fear heights? The user answered: ' + bigFear);\n}", "badAnswer()\n\t{\n\t\tthis.canWrite = false\n\t\tthis.$textInput.style.color = 'red'\n\t\tsetTimeout(() => {\n\t\t\tthis.canWrite = true\n\t\t\tthis.$textInput.style.color = 'white'\n\t\t\tthis.$textInput.innerHTML = ''\n\t\t\tthis.textInput = ''\n\t\t}, 1500)\n\t}", "function guessLetter(guessWord) {\n if (guessesCounter > 0) {\n inquirer.prompt([\n {\n name: \"yourGuess\",\n type: \"input\",\n message: colors.cyan(\"\\nYou have \" ) + colors.green(guessesCounter) + colors.cyan(\" guesses remaining. Enter a Letter.\\n\"),\n validate: function (value) {\n if (isLetter(value)) {\n return true;\n } else {\n return colors.red(\"\\nPlease enter a letter.\\n\");\n }\n }\n }\n ]).then(function (answer) {\n var letterGuessed = answer.yourGuess.toUpperCase();\n // check to see if letter already guessed\n if (guessesArray.indexOf(letterGuessed) >= 0) {\n console.log(colors.red(\"\\nYou already guessed that letter. Try Again.\\n\"));\n targetWord.wordPlaceHolder();\n guessLetter();\n } else {\n guessesArray.push(letterGuessed);\n // check if guess in word\n if (targetWord.splitRandomWord.indexOf(letterGuessed) === -1) {\n guessesCounter--;\n console.log(colors.red(\"\\nIncorrect Guess\\n\"));\n if (guessesCounter > 0) {\n targetWord.wordPlaceHolder();\n guessLetter();\n } else {\n console.log(colors.red(\"\\nGAME OVER!!\\n\\nThe correct answer was \" + targetWord.randomWord + \".\\n\"));\n playAgain();\n }\n } else {\n targetWord.guess(letterGuessed);\n targetWord.wordPlaceHolder();\n if (targetWord.guessState.indexOf(\"_\") === -1) {\n console.log(colors.green(\"YOU WON!\\n\"));\n playAgain();\n } else {\n guessLetter();\n };\n };\n };\n });\n };\n}", "function askQuestion() {\n\n inquirer.prompt([\n {\n type: \"input\",\n name: \"character\",\n message: \"Guess a letter!\"\n }\n ])\n .then(function (answers) {\n // stores inquirer guess into a variable\n // console.log(answers);\n var character = answers.character;\n // Adds to the word constructor. Stores character (guess).\n // var newGuess = new Word(character);\n\n const userAnswer = answers.character;\n\n if (user.word.includes(userAnswer)) {\n var index = user.word.indexOf(userAnswer);\n dashed[index] = userAnswer;\n \n console.log(\"Here is the word for you to guess \" + dashed);\n \n var guessword = dashed.join(\"\"); \n \n if(guessword === user.word){\n console.log(\"You win!!!\");\n } else{\n askQuestion();\n }\n \n\n } else {\n console.log(\"Sorry, that is not the correct letter.\");\n askQuestion();\n\n }\n\n });\n\n}", "function promptquestion2(){\nvar userQuestion2 = prompt('Is 8x10=21?');\n//console.log('this is the users answer for question 2 '+ userQuestion2);\n\nif(userQuestion2.toLocaleLowerCase() === 'yes'|| userQuestion2.toLocaleLowerCase()=== 'y') {\n alert('You answered wrong dummy!');\n} else if(userQuestion2.toLocaleLowerCase()=== 'no'|| userQuestion2.toLocaleLowerCase()=== 'n') {\n alert('Correct!');\n userScore= userScore+1;\n} else{\n alert('Please type a correct response');\n}\n}", "function topic_answered() {\n\t//do stuff like check validity and sending answer to db\n\tif (document.getElementById(\"answer-input\").value.replace(/^\\s+|\\s+$/g,\"\") === \"\"){\n\t\talert(\"Missing some text here\");\n\t}else{\n\t\tcheck_correctness();\n\t\tchange_topic();\n\t}\n}", "function q1 (){\n let answer = prompt('Is Quen from Maine?');\n answer = answer.toLowerCase();\n \n //question1\n if (answer === answerBank[2] || answer === answerBank[3]){\n console.log('correct');\n globalCorrect = globalCorrect + 1;\n alert('You got it correct, ' + userName + '!');\n }\n else if (answer === answerBank[0] || answer === answerBank[1]){\n console.log('Wrong');\n alert('Ouch! Better luck on the next one.');\n }\n else{\n //console.log('Non accepted answer submitted');\n alert('Wow, really?');\n }\n}", "function decideUppercase() {\n uppercaseCheck = prompt(\"Do you want uppercase letters in your password? (yes or no) \");\n uppercaseCheck = uppercaseCheck.toLowerCase();\n\n if (uppercaseCheck === null || uppercaseCheck === \"\") {\n alert(\"Please answer yes or no\");\n decideUppercase();\n\n } else if (uppercaseCheck === \"yes\" || uppercaseCheck ===\"y\") {\n uppercaseCheck = true;\n return uppercaseCheck;\n\n } else if (uppercaseCheck === \"no\" || uppercaseCheck ===\"n\") {\n uppercaseCheck = false;\n return uppercaseCheck;\n \n } else {\n alert(\"Please answer yes or no\");\n decideUppercase();\n }\n return uppercaseCheck;\n}", "function verify(input){\n//create and set variable for correctness\n\tvar correct\n//run loop for length of word for correct letters\n\tfor(var i = 0; i < wordLength; i++) {\n\t\tif (input === word[i]) {\n\t\t\tcorrect = true\n\t\t}\n\t}\n//if input is correct, replace output of underscores with input\n//else push incorrect input to wrong array and take away a guess\n\tif (correct) {\n\t\t// console.log(correct)\n\t\tfor(var i = 0; i < wordLength; i++) {\n\t\t\tif (input === word[i]) {\n\t\t\t\toutput[i] = input\n\t\t\t}\n\t\t}\n\t} else {\n\t\twrong.push(input)\n\t\tguesses--\n\t}\n}", "function promptThem() {\n\tvar userResponse = prompt(\"Type something:\");\n}", "function checkUserInput() {\n var userInput = document\n .querySelector(\".type-area\")\n .value.replace(minusString, \"\");\n if (userInput[userInput.length - 1] === \" \") {\n handleSpace();\n return;\n }\n let startword = modifiedpara.substr(0, modifiedpara.indexOf(\" \") + 1);\n\n if (document.querySelector(\".type-area\").value == \"\") {\n document.querySelector(\".para-type\").innerText = infinityPara;\n } else if (startword.includes(userInput)) {\n text = modifiedpara;\n text = text.replace(\n userInput,\n '<span class=\"highlight\">' + userInput + \"</span>\"\n );\n document.querySelector(\".para-type\").innerHTML = text;\n } else {\n return;\n }\n}", "function difficult() {\n inquirer.prompt([{\n type: \"input\",\n message: clozed[counter].partial + \"\\nAnswer:\",\n name: \"userGuess\"\n }]).then(function(answer) {\n //put everything to lowercase for comparison values. That way if a user doesnt capitalize they still get the correct answer\n if (answer.userGuess.toLowerCase() === clozed[counter].cloze.toLowerCase()) {\n console.log(\"Correct\");\n correct++;\n } else {\n console.log(\"Incorrect\");\n }\n if (counter < clozed.length - 1) {\n counter++;\n difficult();\n } else {\n console.log(\"Game Over\");\n console.log(\"You got: \" + correct + \" out of \" + clozed.length + \" Right\");\n playagain();\n\n\n }\n });\n}", "function checkAnswer() {\n const answer = currentUserAnswer(); // answerVal.value\n if (answer.toLowerCase() !== null && answer.toLowerCase() === newArrayQuestions[index].answer) {\n userPuntos(index, 1, 1);\n changeCorrectAnswerLetterColor();\n if (soundToggleChekbox) {\n playCorrectAnswerSound();\n }\n } else {\n userPuntos(index, 0, 1);\n changeIncorrectAnswerLetterColor();\n if (soundToggleChekbox) {\n playNoCorrectAnswerSound();\n }\n }\n showScores();\n checkArrayQuestionsForFin();\n if (rankingTable.classList.contains(\"hideElement\")) { // If the game has not been stopped\n updateLetter();\n updateAnswer(); // answerVal.value = ''\n changeActivLetterColor();\n showNextQuestion();\n }\n}", "function Correct()\n{\nif(obj.spellings[x].correct==\"1\")\n{right();}\nelse\n{wrong();}\n}", "function determineUppercase() {\n var uppercaseCheck = prompt(\"Do you want to include uppercase letters in your password? \\n(Yes or No)\");\n uppercaseCheck = uppercaseCheck.toLowerCase();\n\n if (uppercaseCheck === null || uppercaseCheck === \"\") {\n alert(\"Please answer Yes or No\");\n determineUppercase();\n } else if (uppercaseCheck === \"yes\" || uppercaseCheck === \"y\") {\n uppercaseCheck = true;\n } else if (uppercaseCheck === \"no\" || uppercaseCheck === \"n\") {\n uppercaseCheck = false;\n } else {\n alert(\"Please answer Yes or No\");\n determineUppercase();\n }\n\n return uppercaseCheck;\n}", "function university(){\n\n let study = prompt('In which university i have studied do you think \"JUST\" or \"YARMOUK\" ?').toUpperCase();\n if (study === 'JUST') {\n alert('TRUE ! I love it so much');\n score++;\n } else if (study === 'YARMOUK') {\n alert('lovely one but no ! try again ;)');\n prompt('which one do you think now ?');\n }\n \n}", "function incorrectLetter(letter) {\n\n if (incorrectInputEntered.indexOf(letter.key.toUpperCase()) < 0) {\n inputRemaining--;\n addIncorrectLetter(letter);\n guessesDisplay.textContent = inputRemaining;\n }\n}", "function isValid(input) {\n if (inputFilter(input.value)) {\n input.oldValue = input.value;\n input.oldSelectionStart = input.selectionStart;\n input.oldSelectionEnd = input.selectionEnd;\n } else if (input.hasOwnProperty(\"oldValue\")) {\n input.value = input.oldValue;\n input.setSelectionRange(input.oldSelectionStart, input.oldSelectionEnd);\n alert(\"English letter only!\");\n return false;\n } else {\n alert(\"English letter only!\");\n input.value = \"\";\n return false;\n }\n return true;\n }", "function submitGuess(e) {\n e.preventDefault();\n if (spellGuess.value.toLowerCase() === pickedWord) {\n pointCounter++;\n score.innerText = `Score: ${pointCounter}/10`;\n };\n spellGuess.value = '';\n qNumber++;\n if (qNumber < 10) {\n prepGame();\n } else {\n score.style.fontSize = \"40pt\";\n spellPic.style.display = \"none\";\n spaceDiv.style.display = \"none\";\n spellGuess.style.display = \"none\";\n guessButton.style.display = \"none\";\n goHome.style.display = \"block\";\n };\n}", "function checkAnswer() {\n//if right, adjust score and start a new game\n if ($(answer).text() === correctAnimal) {\n setTimeout(newRound, 500);\n score++;\n updateScore();\n// if wrong, shake the guesses and reset score\n} else {\n $('.guess').effect('shake');\n sayBackwards(correctAnimal);\n score = 0;\n updateScore();\n }\n}", "function three() {\n var car = prompt('Does Dayne drive a BMW?')\n if (car === 'y' || car === 'yes' || car === 'n' || car === 'no') {\n car = car.toUpperCase()\n console.log(car + ', Dayne drives the Ultimate Driving Machine.');\n }\n if (car === 'YES') {\n alert('Correct.')\n correctanswer++;\n } else {\n alert('Incorrect.')\n }\n}", "function hitWitchOrWolf(){\n\n if (input.value.toLowerCase() == 'häxan'){\n hitTheWitch() \n }\n \n else if(input.value.toLowerCase() == 'vargen' && !stickThrown){\n hitTheWolf() \n }\n\n else{\n text.innerHTML += wrongInput\n button.onclick = hitWitchOrWolf\n }\n\n}", "function formatUserInput() {\n var userInput = $userInput\n .val()\n .toLowerCase()\n .trim();\n return userInput;\n}", "function one() {\n var origin = prompt('Is Dayne from Seattle?');\n if (origin === 'y' || origin === 'yes' || origin === 'n' || origin === 'no') {\n origin = origin.toUpperCase()\n console.log(origin + ', Dayne is from Seattle.');\n }\n if (origin === 'YES') {\n alert('Correct.')\n correctanswer++;\n } else {\n alert('Incorrect.')\n }\n}", "function default_answer() {\n return choice(['Speak English, mothaf*ckah!', \"What ya sayin'?\", \"Try again.\", \"Computer says no.\", \"Error: 0 f*cks found.\"]);\n}", "function initialPrompt() {\n console.log(\"Let's play some scrabble!\\n\");\n return input.question(\"Enter a word to score: \"); \n}", "function incorrectAttempt(event) {\n var incorrectText = document.createElement('p');\n var parentElementQOne = document.getElementById('answerInput');\n incorrectText.textContent = 'Incorrect. Remember answers are case sensitive.';\n incorrectText.setAttribute('id', 'incorrect');\n parentElementQOne.after(incorrectText);\n event.target.answer.value = null;\n\n\n setTimeout(function () {\n\n var questionIncorrect = document.getElementById('incorrect');\n questionIncorrect.setAttribute('class', 'hidden');\n }, 2000);\n}", "function Pallindrome(){\n var read=Utility.input();\n read.question(\"Enter a string: \",function(str)\n {\n if(str>='a'&&str<='z'||str>='A'&&str>='Z'){\n utility.Pallindrome(str); \n }\n /**\n * check if string is empty\n */\n else if(str==\"\"){\n console.log(\"Plz enter a string....\");\n }\n /**\n * if its not charcter string it will print error msg\n */\n else\n console.log(\"Plz enter a character string only...\");\n read.close();\n }\n );\n}" ]
[ "0.60294694", "0.5871783", "0.57992005", "0.5740757", "0.5704669", "0.5678286", "0.5678057", "0.5664019", "0.5634184", "0.56306237", "0.55914766", "0.55678153", "0.55529815", "0.5546386", "0.55341995", "0.5522246", "0.5518581", "0.55161273", "0.55161273", "0.5500051", "0.5482492", "0.5480006", "0.54246217", "0.5421553", "0.5421306", "0.5420067", "0.54149693", "0.54061574", "0.5403729", "0.5400548", "0.53979063", "0.538718", "0.53816926", "0.5380297", "0.53791463", "0.5378876", "0.53767014", "0.5362475", "0.535603", "0.535417", "0.5350694", "0.53393316", "0.5339249", "0.53389513", "0.5334054", "0.53338355", "0.53270775", "0.5324333", "0.53198695", "0.5316372", "0.5304333", "0.53010356", "0.5299261", "0.529629", "0.52850044", "0.52748585", "0.52695274", "0.52670276", "0.52614206", "0.5260294", "0.52517027", "0.5245195", "0.52412593", "0.5240913", "0.5230417", "0.5229998", "0.52244335", "0.5222777", "0.52193195", "0.521768", "0.52175343", "0.521369", "0.5210547", "0.5208905", "0.52085227", "0.520515", "0.5198699", "0.5194713", "0.5192409", "0.51850325", "0.51827645", "0.5178093", "0.51667345", "0.51627105", "0.5157977", "0.5150238", "0.51432055", "0.5142977", "0.51365274", "0.5134978", "0.5127899", "0.5127003", "0.512527", "0.5125214", "0.51244736", "0.5120668", "0.51185006", "0.5116432", "0.5108677", "0.51085913", "0.51075995" ]
0.0
-1
end poliline /================================================= /=================================================
function polyline_s_get(shapes_get){ console.log(shapes_get); is_click = 0; for(l=0;l<shapes_get.length;l++) { shapes_get[l] = new google.maps.LatLng(shapes_get[l].lat,shapes_get[l].lon); } map.panTo(shapes_get[0]); flight_Pathh = new google.maps.Polyline({ path: shapes_get, geodesic: true, fillColor:'#41CDF5', fillOpacity : .09 , strokeColor: '#41CDF5', strokeOpacity: 1, strokeWeight: 4 , }); flight_Pathh.setMap(map); if(markers.length > 0) setAllMap(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function goalLinesClose()\n{\n goalLineDifference = goalLineDifference - 1;\n}", "onLineEnd() { }", "exitParagraph(ctx) {\n\t}", "voidLine() {\r\n\t\treturn null\r\n\t}", "unvoidLine() {\r\n\t\treturn null\r\n\t}", "exitParagraphParameters(ctx) {\n\t}", "exitParagraphParameter(ctx) {\n\t}", "function undo() {\n //verifife que l'on peut defaire un choix\n if (currentPawnCombinaison == 0) {\n\tconsole.log(\"line not started\");\n }\n else {\n\tvar pawn = document.querySelectorAll(\"div.pion-\" + (currentPawnCombinaison -1))[currentLine];\n\tconsole.log(pawn);\n\tpawn.style.backgroundColor = 'transparent';\n\tpawn.style.border = '1px solid #888562';\n\tcurrentPawnCombinaison--;\n\tcombinaison = combinaison.substring(0, combinaison.length -1);\n\tconsole.log(combinaison);\n\tconsole.log(currentPawnCombinaison);\n }\n}", "mateEnd() {}", "end() {\n }", "end() {\n }", "function end_explosion() {\n pac_explosion=false;\n m.render();\n}", "function lineEnd(){if(segments){linePoint(x__,y__);if(v__&&v_)bufferStream.rejoin();segments.push(bufferStream.result())}clipStream.point=point;if(v_)activeStream.lineEnd()}", "exitParagraphCommand(ctx) {\n\t}", "exitEntityLine(ctx) {\n\t}", "exitNewEntityLine(ctx) {\n\t}", "end() { }", "exitParagraphName(ctx) {\n\t}", "poop() { }", "function lineEnd() {\n\t if (segments) {\n\t linePoint(x__, y__);\n\t if (v__ && v_) bufferStream.rejoin();\n\t segments.push(bufferStream.result());\n\t }\n\t clipStream.point = point;\n\t if (v_) activeStream.lineEnd();\n\t }", "function lineEnd() {\n\t if (segments) {\n\t linePoint(x__, y__);\n\t if (v__ && v_) bufferStream.rejoin();\n\t segments.push(bufferStream.result());\n\t }\n\t clipStream.point = point;\n\t if (v_) activeStream.lineEnd();\n\t }", "function lineEnd() {\n\t if (segments) {\n\t linePoint(x__, y__);\n\t if (v__ && v_) bufferStream.rejoin();\n\t segments.push(bufferStream.result());\n\t }\n\t clipStream.point = point;\n\t if (v_) activeStream.lineEnd();\n\t }", "exitParagraphValue(ctx) {\n\t}", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point1;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n\t if (segments) {\n\t linePoint(x__, y__);\n\t if (v__ && v_) bufferStream.rejoin();\n\t segments.push(bufferStream.result());\n\t }\n\t clipStream.point = point;\n\t if (v_) activeStream.lineEnd();\n\t }", "function lineEnd() {\n\t if (segments) {\n\t linePoint(x__, y__);\n\t if (v__ && v_) bufferStream.rejoin();\n\t segments.push(bufferStream.result());\n\t }\n\t clipStream.point = point;\n\t if (v_) activeStream.lineEnd();\n\t }", "function lineEnd() {\n\t if (segments) {\n\t linePoint(x__, y__);\n\t if (v__ && v_) bufferStream.rejoin();\n\t segments.push(bufferStream.result());\n\t }\n\t clipStream.point = point;\n\t if (v_) activeStream.lineEnd();\n\t }", "function lineEnd() {\n\t if (segments) {\n\t linePoint(x__, y__);\n\t if (v__ && v_) bufferStream.rejoin();\n\t segments.push(bufferStream.result());\n\t }\n\t clipStream.point = point;\n\t if (v_) activeStream.lineEnd();\n\t }", "function lineEnd() {\n\t if (segments) {\n\t linePoint(x__, y__);\n\t if (v__ && v_) bufferStream.rejoin();\n\t segments.push(bufferStream.result());\n\t }\n\t clipStream.point = point;\n\t if (v_) activeStream.lineEnd();\n\t }", "function finishBaseline( baseline ) {\n //setPolyrect( baseline, self.cfg.polyrectHeight, self.cfg.polyrectOffset );\n setPolystripe( baseline, self.cfg.polyrectHeight, self.cfg.polyrectOffset );\n\n sortOnDrop( $(baseline).parent()[0] );\n\n $(baseline)\n .parent()\n .addClass('editable')\n .each( function () {\n this.setEditing = function () {\n var event = { target: this };\n self.util.setEditing( event, 'points', { points_selector: '> polyline', restrict: false } );\n };\n } );\n window.setTimeout( function () {\n if ( typeof $(baseline).parent()[0].setEditing !== 'undefined' )\n $(baseline).parent()[0].setEditing();\n self.util.selectElem(baseline,true);\n }, 50 );\n\n self.util.registerChange('added baseline '+$(baseline).parent().attr('id'));\n\n for ( var n=0; n<self.cfg.onFinishBaseline.length; n++ )\n self.cfg.onFinishBaseline[n](baseline);\n }", "function Ending8() {\n _super.call(this, \"The Sincere Plea\", \"Knowing that the other person is much\\nstronger than yourself, you prostrate\\nyourself on the ground. You try to convince\\nhim/her that there may be a solution that\\ncan allow both of you to safely make it\\nback home...\", true);\n }", "function badrejectionEnd() {\n background(0);\n push();\n textSize(64);\n fill(166, 1, 7);\n textSize(50);\n text(`3 days later`, width / 2, height / 2 - 50);\n text(`You were fine, but he didn't quite... survive the breakup`, width / 2, height / 2);\n text(`Perhaps you took a wrong turn somewhere.`, width / 2, height / 2 + 50);\n textSize(80);\n textFont(onyxFont);\n text(`THE END`, width / 2, height / 2 + 200)\n pop();\n}", "function pararDibujar() {\n pintarLinea = false;\n guardarLinea();\n }", "function pararDibujar() {\n pintarLinea = false;\n guardarLinea();\n }", "end(event) {\n //var textEl = event.target.querySelector('p')\n\n // textEl && (textEl.textContent =\n // 'moved a distance of ' +\n // (Math.sqrt(Math.pow(event.pageX - event.x0, 2) +\n // Math.pow(event.pageY - event.y0, 2) | 0))\n // .toFixed(2) + 'px')\n }", "function putYourRightFootIn(){}", "function princeCharming() { /* ... */ }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function endRound()\n{\n //@TODO: Hier coderen we alles om een ronde te beëindigen\n\n}", "static get END() { return 6; }", "function goalLinesOpen()\n{\n goalLineDifference = goalLineDifference + 1;\n}", "function C012_AfterClass_Jennifer_BreakUp() {\n\tGameLogAdd(\"LoverBreakUp\");\n\tCommon_PlayerLover = \"\";\n\tCommon_ActorIsLover = false;\n\tActorSetPose(\"\");\n\tLeaveIcon = \"\";\n}", "function lineEnd(area) {\n area.pos = area.pos || pos(area);\n return pos + lineDist(area);\n }", "drawFinishIfLessThan3Points(){\n this.hull=this.points;\n this.drawFinish();\n this.stop(); \n }", "updateLastLine(line) { // this is used when drawing with the pen\r\n if (line.length < 2) return;\r\n var point1 = line.points[line.points.length - 1];\r\n var point2 = line.points[line.points.length - 2];\r\n point1 = this.worldPointToChunkScreenPoint(point1);\r\n point2 = this.worldPointToChunkScreenPoint(point2);\r\n this.ctx.beginPath();\r\n this.ctx.lineWidth = Main.Camera.getRelativeWidth(line.width);\r\n this.ctx.strokeStyle = line.style;\r\n this.ctx.lineTo(point1.x, point1.y);\r\n this.ctx.lineTo(point2.x, point2.y);\r\n this.ctx.stroke();\r\n }", "exit() {\n this.quotes = [];\n this.numQuotes = 1;\n this.pickColor();\n this.showQuotes = false;\n }", "set end(value) {}", "function completeContinuePhase () {\n /* show the player removing an article of clothing */\n prepareToStripPlayer(recentLoser);\n allowProgression(eGamePhase.STRIP);\n}", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function C012_AfterClass_Amanda_BreakUp() {\n\tGameLogAdd(\"LoverBreakUp\");\n\tCommon_PlayerLover = \"\";\n\tCommon_ActorIsLover = false;\n\tActorSetPose(\"\");\n\tLeaveIcon = \"\";\n}", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }" ]
[ "0.62188065", "0.62069523", "0.6029324", "0.58228755", "0.57981294", "0.57160443", "0.56648725", "0.55986667", "0.5519689", "0.54824555", "0.54824555", "0.545843", "0.545479", "0.5441369", "0.5438032", "0.54349434", "0.54304796", "0.54107267", "0.53996074", "0.5386422", "0.5386422", "0.5386422", "0.537815", "0.5342737", "0.53385353", "0.53385353", "0.53385353", "0.53385353", "0.53385353", "0.531723", "0.5315318", "0.53150225", "0.53097713", "0.5304437", "0.52950156", "0.52911276", "0.52782065", "0.52730304", "0.52730304", "0.52730304", "0.52730304", "0.52730304", "0.5271065", "0.5263468", "0.5258761", "0.52368313", "0.52299124", "0.52285796", "0.52216756", "0.52156126", "0.5214128", "0.52096087", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5205471", "0.5201911", "0.51985645", "0.51985645", "0.51985645", "0.51985645" ]
0.0
-1